���ѧۧݧ�ӧ�� �ާ֧ߧ֧էا֧� - ���֧էѧܧ�ڧ��ӧѧ�� - /home/rickpfrv/drive.rickard.co/customizablesMYs/plugins/epub_reader/js/reader.min.js
���ѧ٧ѧ�
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.RSVP=e.RSVP||{})}(this,function(e){"use strict";function i(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function s(e){return e._promiseCallbacks||(e._promiseCallbacks={})}var t={mixin:function(e){return e.on=this.on,e.off=this.off,e.trigger=this.trigger,e._promiseCallbacks=void 0,e},on:function(e,t){if("function"!=typeof t)throw new TypeError("Callback must be a function");var n=s(this),r=void 0;-1===i(r=(r=n[e])||(n[e]=[]),t)&&r.push(t)},off:function(e,t){var n,r=s(this),o=void 0;t?-1!==(n=i(o=r[e],t))&&o.splice(n,1):r[e]=[]},trigger:function(e,t,n){var r;if(r=s(this)[e])for(var o=0;o<r.length;o++)(0,r[o])(t,n)}},c={instrument:!1};function n(e,t){if(2!==arguments.length)return c[e];c[e]=t}function a(e){return"function"==typeof e}function o(e){return null!==e&&"object"==typeof e}t.mixin(c);var h=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},r=Date.now||function(){return(new Date).getTime()},l=[];function u(e,t,n){1===l.push({name:e,payload:{key:t._guidKey,id:t._id,eventName:e,detail:t._result,childId:n&&n._id,label:t._label,timeStamp:r(),error:c["instrument-with-stack"]?new Error(t._label):null}})&&setTimeout(function(){for(var e=0;e<l.length;e++){var t=l[e],n=t.payload;n.guid=n.key+n.id,n.childGuid=n.key+n.childId,n.error&&(n.stack=n.error.stack),c.trigger(t.name,t.payload)}l.length=0},50)}function d(e,t){if(e&&"object"==typeof e&&e.constructor===this)return e;t=new this(p,t);return E(t,e),t}function p(){}var f=void 0,m=1,y=2,v=new B;function g(e){try{return e.then}catch(e){return v.error=e,v}}function b(e,r,o){c.async(function(t){var n=!1,e=function(e,t,n,r){try{e.call(t,n,r)}catch(e){return e}}(o,r,function(e){n||(n=!0,(r!==e?E:k)(t,e))},function(e){n||(n=!0,_(t,e))},t._label);!n&&e&&(n=!0,_(t,e))},e)}function S(e,t,n){var r,o;t.constructor===e.constructor&&n===J&&e.constructor.resolve===d?(r=e,(o=t)._state===m?k(r,o._result):o._state===y?(o._onError=null,_(r,o._result)):P(o,void 0,function(e){(o!==e?E:k)(r,e)},function(e){return _(r,e)})):n===v?(_(e,v.error),v.error=null):a(n)?b(e,t,n):k(e,t)}function E(e,t){var n,r;e===t?k(e,t):(r=typeof(n=t),null===n||"object"!=r&&"function"!=r?k(e,t):S(e,t,g(t)))}function w(e){e._onError&&e._onError(e._result),C(e)}function k(e,t){e._state===f&&(e._result=t,e._state=m,0===e._subscribers.length?c.instrument&&u("fulfilled",e):c.async(C,e))}function _(e,t){e._state===f&&(e._state=y,e._result=t,c.async(w,e))}function P(e,t,n,r){var o=e._subscribers,i=o.length;e._onError=null,o[i]=t,o[i+m]=n,o[i+y]=r,0===i&&e._state&&c.async(C,e)}function C(e){var t=e._subscribers,n=e._state;if(c.instrument&&u(n===m?"fulfilled":"rejected",e),0!==t.length){for(var r,o=void 0,i=e._result,s=0;s<t.length;s+=3)r=t[s],o=t[s+n],r?U(n,r,o,i):o(i);e._subscribers.length=0}}function B(){this.error=null}var x=new B;function U(e,t,n,r){var o=a(n),i=void 0,s=void 0;if(o){if((i=function(e,t){try{return e(t)}catch(e){return x.error=e,x}}(n,r))===x)s=i.error,i.error=null;else if(i===t)return void _(t,new TypeError("A promises callback cannot return that same promise."))}else i=r;t._state!==f||(o&&void 0===s?E(t,i):void 0!==s?_(t,s):e===m?k(t,i):e===y&&_(t,i))}function J(e,t,n){var r=this,o=r._state;if(o===m&&!e||o===y&&!t)return c.instrument&&u("chained",r,r),r;r._onError=null;var i,s=new r.constructor(p,n),a=r._result;return c.instrument&&u("chained",r,s),o===f?P(r,s,e,t):(i=o===m?e:t,c.async(function(){return U(o,s,i,a)})),s}var O=(T.prototype._init=function(e,t){var n=t.length||0;this.length=n,this._remaining=n,this._result=new Array(n),this._enumerate(t),0===this._remaining&&k(this.promise,this._result)},T.prototype._enumerate=function(e){for(var t=this.length,n=this.promise,r=0;n._state===f&&r<t;r++)this._eachEntry(e[r],r)},T.prototype._settleMaybeThenable=function(t,e){var n,r,o=this._instanceConstructor,i=o.resolve;i===d?(n=g(t))===J&&t._state!==f?(t._onError=null,this._settledAt(t._state,e,t._result)):"function"!=typeof n?(this._remaining--,this._result[e]=this._makeResult(m,e,t)):o===A?(S(r=new o(p),t,n),this._willSettleAt(r,e)):this._willSettleAt(new o(function(e){return e(t)}),e):this._willSettleAt(i(t),e)},T.prototype._eachEntry=function(e,t){var n;null!==(n=e)&&"object"==typeof n?this._settleMaybeThenable(e,t):(this._remaining--,this._result[t]=this._makeResult(m,t,e))},T.prototype._settledAt=function(e,t,n){var r=this.promise;r._state===f&&(this._abortOnReject&&e===y?_(r,n):(this._remaining--,this._result[t]=this._makeResult(e,t,n),0===this._remaining&&k(r,this._result)))},T.prototype._makeResult=function(e,t,n){return n},T.prototype._willSettleAt=function(e,t){var n=this;P(e,void 0,function(e){return n._settledAt(m,t,e)},function(e){return n._settledAt(y,t,e)})},T);function T(e,t,n,r){this._instanceConstructor=e,this.promise=new e(p,r),this._abortOnReject=n,this._init.apply(this,arguments)}function j(e,t,n){return e===m?{state:"fulfilled",value:n}:{state:"rejected",reason:n}}var R="rsvp_"+r()+"-",N=0;var A=(D.prototype._onError=function(e){var t=this;c.after(function(){t._onError&&c.trigger("error",e,t._label)})},D.prototype.catch=function(e,t){return this.then(void 0,e,t)},D.prototype.finally=function(t,e){var n=this.constructor;return this.then(function(e){return n.resolve(t()).then(function(){return e})},function(e){return n.resolve(t()).then(function(){throw e})},e)},D);function D(e,t){this._id=N++,this._label=t,this._state=void 0,this._result=void 0,this._subscribers=[],c.instrument&&u("created",this),p!==e&&("function"!=typeof e&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof D?function(t,e){var n=!1;try{e(function(e){n||(n=!0,E(t,e))},function(e){n||(n=!0,_(t,e))})}catch(e){_(t,e)}}(this,e):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}function M(){this.value=void 0}A.cast=d,A.all=function(e,t){return h(e)?new O(this,e,!0,t).promise:this.reject(new TypeError("Promise.all must be called with an array"),t)},A.race=function(e,t){var n=new this(p,t);if(!h(e))return _(n,new TypeError("Promise.race must be called with an array")),n;for(var r=0;n._state===f&&r<e.length;r++)P(this.resolve(e[r]),void 0,function(e){return E(n,e)},function(e){return _(n,e)});return n},A.resolve=d,A.reject=function(e,t){return _(t=new this(p,t),e),t},A.prototype._guidKey=R,A.prototype.then=J;var L=new M,$=new M;function I(e,t,n){try{e.apply(t,n)}catch(e){return L.value=e,L}}function z(d,f){function e(){for(var e=arguments.length,t=new Array(e+1),n=!1,r=0;r<e;++r){var o=arguments[r];if(!n){if((n=!(!(i=o)||"object"!=typeof i)&&(i.constructor===A||function(e){try{return e.then}catch(e){return L.value=e,L}}(i)))===$){var i=new A(p);return _(i,$.value),i}n&&!0!==n&&(o=function(n,r){return{then:function(e,t){return n.call(r,e,t)}}}(n,o))}t[r]=o}var s,a,c,l,u=new A(p);return t[e]=function(e,t){e?_(u,e):void 0===f?E(u,t):!0===f?E(u,function(e){for(var t=e.length,n=new Array(t-1),r=1;r<t;r++)n[r-1]=e[r];return n}(arguments)):h(f)?E(u,function(e,t){for(var n={},r=e.length,o=new Array(r),i=0;i<r;i++)o[i]=e[i];for(var s=0;s<t.length;s++)n[t[s]]=o[s+1];return n}(arguments,f)):E(u,t)},n?(s=u,a=t,c=d,l=this,A.all(a).then(function(e){e=I(c,l,e);return e===L&&_(s,e.value),s})):function(e,t,n,r){t=I(n,r,t);t===L&&_(e,t.value);return e}(u,t,d,this)}return e.__proto__=d,e}function K(e,t){return A.all(e,t)}var F,X=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(V,F=O),V);function V(e,t,n){return function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,F.call(this,e,t,!1,n))}function q(e,t){return h(e)?new X(A,e,t).promise:A.reject(new TypeError("Promise.allSettled must be called with an array"),t)}function H(e,t){return A.race(e,t)}X.prototype._makeResult=j;var G,W=Object.prototype.hasOwnProperty,Y=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(Q,G=O),Q.prototype._init=function(e,t){this._result={},this._enumerate(t),0===this._remaining&&k(this.promise,this._result)},Q.prototype._enumerate=function(e){var t,n=this.promise,r=[];for(t in e)W.call(e,t)&&r.push({position:t,entry:e[t]});var o=r.length;this._remaining=o;for(var i,s=0;n._state===f&&s<o;s++)i=r[s],this._eachEntry(i.entry,i.position)},Q);function Q(e,t){var n=!(2<arguments.length&&void 0!==arguments[2])||arguments[2],r=arguments[3];return function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,G.call(this,e,t,n,r))}function Z(e,t){return o(e)?new Y(A,e,t).promise:A.reject(new TypeError("Promise.hash must be called with an object"),t)}var ee,te=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(ne,ee=Y),ne);function ne(e,t,n){return function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,ee.call(this,e,t,!1,n))}function re(e,t){return o(e)?new te(A,e,!1,t).promise:A.reject(new TypeError("RSVP.hashSettled must be called with an object"),t)}function oe(e){throw setTimeout(function(){throw e}),e}function ie(e){var n={resolve:void 0,reject:void 0};return n.promise=new A(function(e,t){n.resolve=e,n.reject=t},e),n}function se(e,o,i){return h(e)?a(o)?A.all(e,i).then(function(e){for(var t=e.length,n=new Array(t),r=0;r<t;r++)n[r]=o(e[r]);return A.all(n,i)}):A.reject(new TypeError("RSVP.map expects a function as a second argument"),i):A.reject(new TypeError("RSVP.map must be called with an array"),i)}function ae(e,t){return A.resolve(e,t)}function ce(e,t){return A.reject(e,t)}function le(e,t){return A.all(e,t)}function ue(e,n,r){return h(e)||o(e)&&void 0!==e.then?a(n)?(h(e)?le(e,r):(e=e,t=r,A.resolve(e,t).then(function(e){return le(e,t)}))).then(function(o){for(var i=o.length,e=new Array(i),t=0;t<i;t++)e[t]=n(o[t]);return le(e,r).then(function(e){for(var t=new Array(i),n=0,r=0;r<i;r++)e[r]&&(t[n]=o[r],n++);return t.length=n,t})}):A.reject(new TypeError("RSVP.filter expects function as a second argument"),r):A.reject(new TypeError("RSVP.filter must be called with an array or promise"),r);var t}te.prototype._makeResult=j;var de=0,fe=void 0;function he(e,t){ge[de]=e,ge[de+1]=t,2===(de+=2)&&Ce()}var pe="undefined"!=typeof window?window:void 0,me=pe||{},ye=me.MutationObserver||me.WebKitMutationObserver,R="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),me="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function ve(){return function(){return setTimeout(be,1)}}var ge=new Array(1e3);function be(){for(var e=0;e<de;e+=2)(0,ge[e])(ge[e+1]),ge[e]=void 0,ge[e+1]=void 0;de=0}var Se,Ee,we,ke,_e,Pe,Ce=void 0,Ce=R?(_e=process.nextTick,Pe=process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/),Array.isArray(Pe)&&"0"===Pe[1]&&"10"===Pe[2]&&(_e=setImmediate),function(){return _e(be)}):ye?(Ee=0,we=new ye(be),ke=document.createTextNode(""),we.observe(ke,{characterData:!0}),function(){return ke.data=Ee=++Ee%2}):me?((Se=new MessageChannel).port1.onmessage=be,function(){return Se.port2.postMessage(0)}):(void 0===pe&&"function"==typeof require?function(){try{var e=require("vertx");return void 0!==(fe=e.runOnLoop||e.runOnContext)?function(){fe(be)}:ve()}catch(e){return ve()}}:ve)();if("object"==typeof self)0;else{if("object"!=typeof global)throw new Error("no global: `self` or `global` found");0}function Be(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}c.async=he,c.after=function(e){return setTimeout(e,0)};R=ae,me=function(e,t){return c.async(e,t)};function xe(){c.on.apply(c,arguments)}function Ue(){c.off.apply(c,arguments)}if("undefined"!=typeof window&&"object"==typeof window.__PROMISE_INSTRUMENTATION__){var Je,Oe=window.__PROMISE_INSTRUMENTATION__;for(Je in n("instrument",!0),Oe)Oe.hasOwnProperty(Je)&&xe(Je,Oe[Je])}Be(pe={asap:he,cast:R,Promise:A,EventTarget:t,all:K,allSettled:q,race:H,hash:Z,hashSettled:re,rethrow:oe,defer:ie,denodeify:z,configure:n,on:xe,off:Ue,resolve:ae,reject:ce,map:se},"async",me),Be(pe,"filter",ue);e.default=pe,e.asap=he,e.cast=R,e.Promise=A,e.EventTarget=t,e.all=K,e.allSettled=q,e.race=H,e.hash=Z,e.hashSettled=re,e.rethrow=oe,e.defer=ie,e.denodeify=z,e.configure=n,e.on=xe,e.off=Ue,e.resolve=ae,e.reject=ce,e.map=se,e.async=me,e.filter=ue,Object.defineProperty(e,"__esModule",{value:!0})});var EPUBJS=EPUBJS||{};EPUBJS.core={};var ELEMENT_NODE=1,TEXT_NODE=3,COMMENT_NODE=8,DOCUMENT_NODE=9;EPUBJS.core.getEl=function(e){return document.getElementById(e)},EPUBJS.core.getEls=function(e){return document.getElementsByClassName(e)},EPUBJS.core.request=function(e,t,n){var r=window.URL,o=r?"blob":"arraybuffer",i=new RSVP.defer,s=new XMLHttpRequest,a=XMLHttpRequest.prototype;return"overrideMimeType"in a||Object.defineProperty(a,"overrideMimeType",{value:function(e){}}),s.onreadystatechange=function(){var e;this.readyState==this.DONE&&(200!==this.status&&0!==this.status||!this.response?i.reject({message:this.response,stack:(new Error).stack}):(e="xml"==t?this.responseXML||(new DOMParser).parseFromString(this.response,"application/xml"):"xhtml"==t?this.responseXML||(new DOMParser).parseFromString(this.response,"application/xhtml+xml"):"html"==t?this.responseXML||(new DOMParser).parseFromString(this.response,"text/html"):"json"==t?JSON.parse(this.response):"blob"!=t||r?this.response:new Blob([this.response]),i.resolve(e)))},s.open("GET",e,!0),n&&(s.withCredentials=!0),t||(e=EPUBJS.core.uri(e),t={htm:"html"}[t=e.extension]||t),"blob"==t&&(s.responseType=o),"json"==t&&s.setRequestHeader("Accept","application/json"),"xml"==t&&(s.responseType="document",s.overrideMimeType("text/xml")),"xhtml"==t&&(s.responseType="document"),"html"==t&&(s.responseType="document"),"binary"==t&&(s.responseType="arraybuffer"),s.send(),i.promise},EPUBJS.core.toArray=function(e){var t,n,r=[];for(t in e)e.hasOwnProperty(t)&&((n=e[t]).ident=t,r.push(n));return r},EPUBJS.core.uri=function(e){var t={protocol:"",host:"",path:"",origin:"",directory:"",base:"",filename:"",extension:"",fragment:"",href:e},n=e.indexOf("blob:"),r=e.indexOf("://"),o=e.indexOf("?"),i=e.indexOf("#");return 0===n?(t.protocol="blob",t.base=e.indexOf(0,i)):(-1!=i&&(t.fragment=e.slice(i+1),e=e.slice(0,i)),-1!=o&&(t.search=e.slice(o+1),e=e.slice(0,o),href=t.href),-1!=r?(t.protocol=e.slice(0,r),-1===(r=(o=e.slice(r+3)).indexOf("/"))?(t.host=t.path,t.path=""):(t.host=o.slice(0,r),t.path=o.slice(r)),t.origin=t.protocol+"://"+t.host,t.directory=EPUBJS.core.folder(t.path),t.base=t.origin+t.directory):(t.path=e,t.directory=EPUBJS.core.folder(e),t.base=t.directory),t.filename=e.replace(t.base,""),-1!=(e=t.filename.lastIndexOf("."))&&(t.extension=t.filename.slice(e+1))),t},EPUBJS.core.folder=function(e){var t=e.lastIndexOf("/");return-1==t&&0,e.slice(0,t+1)},EPUBJS.core.dataURLToBlob=function(e){var t,n,r,o,i,s=";base64,";if(-1==e.indexOf(s))return n=(t=e.split(","))[0].split(":")[1],r=t[1],new Blob([r],{type:n});n=(t=e.split(s))[0].split(":")[1],o=(r=window.atob(t[1])).length,i=new Uint8Array(o);for(var a=0;a<o;++a)i[a]=r.charCodeAt(a);return new Blob([i],{type:n})},EPUBJS.core.addScript=function(e,t,n){var r=!1,o=document.createElement("script");o.type="text/javascript",o.async=!1,o.src=e,o.onload=o.onreadystatechange=function(){r||this.readyState&&"complete"!=this.readyState||(r=!0,t&&t())},(n=n||document.body).appendChild(o)},EPUBJS.core.addScripts=function(e,t,n){var r=e.length,o=0,i=function(){r==++o?t&&t():EPUBJS.core.addScript(e[o],i,n)};EPUBJS.core.addScript(e[o],i,n)},EPUBJS.core.addCss=function(e,t,n){var r=!1,o=document.createElement("link");o.type="text/css",o.rel="stylesheet",o.href=e,o.onload=o.onreadystatechange=function(){r||this.readyState&&"complete"!=this.readyState||(r=!0,t&&t())},(n=n||document.body).appendChild(o)},EPUBJS.core.prefixed=function(e){var t=["Webkit","Moz","O","ms"],n=e[0].toUpperCase()+e.slice(1),r=t.length;if(void 0!==document.documentElement.style[e])return e;for(var o=0;o<r;o++)if(void 0!==document.documentElement.style[t[o]+n])return t[o]+n;return e},EPUBJS.core.resolveUrl=function(e,t){var n=[],r=EPUBJS.core.uri(t),o=e.split("/");return r.host?t:(o.pop(),t.split("/").forEach(function(e){".."===e?o.pop():n.push(e)}),o.concat(n).join("/"))},EPUBJS.core.uuid=function(){var n=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=(n+16*Math.random())%16|0;return n=Math.floor(n/16),("x"==e?t:7&t|8).toString(16)})},EPUBJS.core.insert=function(e,t,n){n=EPUBJS.core.locationOf(e,t,n);return t.splice(n,0,e),n},EPUBJS.core.locationOf=function(e,t,n,r,o){var i=r||0,s=o||t.length,r=parseInt(i+(s-i)/2);return s-i<=0?r:(o=(n=n||function(e,t){return t<e?1:e<t?-1:(e=t)?0:void 0})(t[r],e),s-i==1?0<o?r:r+1:0===o?r:-1===o?EPUBJS.core.locationOf(e,t,n,r,s):EPUBJS.core.locationOf(e,t,n,i,r))},EPUBJS.core.indexOfSorted=function(e,t,n,r,o){var i=r||0,s=o||t.length,r=parseInt(i+(s-i)/2);return s-i<=0?-1:(o=(n=n||function(e,t){return t<e?1:e<t?-1:(e=t)?0:void 0})(t[r],e),s-i==1?0===o?r:-1:0===o?r:-1===o?EPUBJS.core.indexOfSorted(e,t,n,r,s):EPUBJS.core.indexOfSorted(e,t,n,i,r))},EPUBJS.core.queue=function(e){function t(){var e;r.length&&(e=r.shift(),n[e.funcName].apply(e.context||n,e.args))}var r=[],n=e;return{enqueue:function(e,t,n){return r.push({funcName:e,args:t,context:n}),r},dequeue:t,flush:function(){for(;r.length;)t()},clear:function(){r=[]},length:function(){return r.length}}},EPUBJS.core.getElementXPath=function(e){return e&&e.id?'//*[@id="'+e.id+'"]':EPUBJS.core.getElementTreeXPath(e)},EPUBJS.core.getElementTreeXPath=function(e){var t,n,r,o=[],i="http://www.w3.org/1999/xhtml"===e.ownerDocument.documentElement.getAttribute("xmlns");for(e.nodeType===Node.TEXT_NODE&&(t=EPUBJS.core.indexOfTextNode(e)+1,o.push("text()["+t+"]"),e=e.parentNode);e&&1==e.nodeType;e=e.parentNode){t=0;for(var s=e.previousSibling;s;s=s.previousSibling)s.nodeType!=Node.DOCUMENT_TYPE_NODE&&s.nodeName==e.nodeName&&++t;r=e.nodeName.toLowerCase(),n=i?"xhtml:"+r:r,r=t?"["+(t+1)+"]":"",o.splice(0,0,n+r)}return o.length?"./"+o.join("/"):null},EPUBJS.core.nsResolver=function(e){return{xhtml:"http://www.w3.org/1999/xhtml",epub:"http://www.idpf.org/2007/ops"}[e]||null},EPUBJS.core.cleanStringForXpath=function(e){return"concat('',"+e.match(/[^'"]+|['"]/g).map(function(e){return"'"===e?'"\'"':'"'===e?"'\"'":"'"+e+"'"}).join(",")+")"},EPUBJS.core.indexOfTextNode=function(e){for(var t,n=e.parentNode.childNodes,r=-1,o=0;o<n.length&&((t=n[o]).nodeType===Node.TEXT_NODE&&r++,t!=e);o++);return r},EPUBJS.core.defaults=function(e){for(var t=1,n=arguments.length;t<n;t++){var r,o=arguments[t];for(r in o)void 0===e[r]&&(e[r]=o[r])}return e},EPUBJS.core.extend=function(n){return[].slice.call(arguments,1).forEach(function(t){t&&Object.getOwnPropertyNames(t).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))})}),n},EPUBJS.core.clone=function(e){return EPUBJS.core.isArray(e)?e.slice():EPUBJS.core.extend({},e)},EPUBJS.core.isElement=function(e){return!(!e||1!=e.nodeType)},EPUBJS.core.isNumber=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},EPUBJS.core.isString=function(e){return"string"==typeof e||e instanceof String},EPUBJS.core.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},EPUBJS.core.values=function(e){var t,n,r,o=-1;if(!e)return[];for(n=(t=Object.keys(e)).length,r=Array(n);++o<n;)r[o]=e[t[o]];return r},EPUBJS.core.indexOfNode=function(e,t){for(var n,r=e.parentNode.childNodes,o=-1,i=0;i<r.length&&((n=r[i]).nodeType===t&&o++,n!=e);i++);return o},EPUBJS.core.indexOfTextNode=function(e){return EPUBJS.core.indexOfNode(e,TEXT_NODE)},EPUBJS.core.indexOfElementNode=function(e){return EPUBJS.core.indexOfNode(e,ELEMENT_NODE)},(EPUBJS=EPUBJS||{}).reader={},EPUBJS.reader.plugins={},function(e){e.ePubReader,e=e.ePubReader=function(e,t){return new EPUBJS.Reader(e,t)},"function"==typeof define&&define.amd?define(function(){return Reader}):"undefined"!=typeof module&&module.exports&&(module.exports=e)}(window,jQuery),EPUBJS.Reader=function(e,t){var n,r,o=this,i=$("#viewer"),s=window.location.search;for(r in this.settings=EPUBJS.core.defaults(t||{},{bookPath:e,restore:!0,reload:!1,bookmarks:void 0,annotations:void 0,contained:void 0,bookKey:void 0,styles:void 0,sidebarReflow:!1,generatePagination:!1,history:!0}),s&&s.slice(1).split("&").forEach(function(e){var t=e.split("="),e=t[0],t=t[1]||"";o.settings[e]=decodeURIComponent(t)}),this.setBookKey(this.settings.bookPath),this.settings.restore&&this.isSaved()&&this.applySavedSettings(),this.settings.styles=this.settings.styles||{fontSize:"100%"},this.book=n=new ePub(this.settings.bookPath,this.settings),this.offline=!1,this.sidebarOpen=!1,this.settings.bookmarks||(this.settings.bookmarks=[]),this.settings.annotations||(this.settings.annotations=[]),this.settings.generatePagination&&n.generatePagination(i.width(),i.height()),this.rendition=n.renderTo("viewer",{ignoreClass:"annotator-hl",width:"100%",height:"100%"}),this.settings.previousLocationCfi?this.displayed=this.rendition.display(this.settings.previousLocationCfi):this.displayed=this.rendition.display(),n.ready.then(function(){o.ReaderController=EPUBJS.reader.ReaderController.call(o,n),o.ControlsController=EPUBJS.reader.ControlsController.call(o,n),o.SidebarController=EPUBJS.reader.SidebarController.call(o,n),o.BookmarksController=EPUBJS.reader.BookmarksController.call(o,n),window.addEventListener("hashchange",this.hashChanged.bind(this),!1),document.addEventListener("keydown",this.adjustFontSize.bind(this),!1),this.rendition.on("keydown",this.adjustFontSize.bind(this)),this.rendition.on("keydown",o.ReaderController.arrowKeys.bind(this)),this.rendition.on("selected",this.selectedRange.bind(this))}.bind(this)).then(function(){o.ReaderController.hideLoader()}.bind(this)),EPUBJS.reader.plugins)EPUBJS.reader.plugins.hasOwnProperty(r)&&(o[r]=EPUBJS.reader.plugins[r].call(o,n));return n.loaded.metadata.then(function(e){o.MetaController=EPUBJS.reader.MetaController.call(o,e)}),n.loaded.navigation.then(function(e){o.TocController=EPUBJS.reader.TocController.call(o,e)}),window.addEventListener("beforeunload",this.unload.bind(this),!1),this},EPUBJS.Reader.prototype.adjustFontSize=function(e){var t,n=e.ctrlKey||e.metaKey;this.settings.styles&&(this.settings.styles.fontSize||(this.settings.styles.fontSize="100%"),t=parseInt(this.settings.styles.fontSize.slice(0,-1)),n&&187==e.keyCode&&(e.preventDefault(),this.book.setStyle("fontSize",t+2+"%")),n&&189==e.keyCode&&(e.preventDefault(),this.book.setStyle("fontSize",t-2+"%")),n&&48==e.keyCode&&(e.preventDefault(),this.book.setStyle("fontSize","100%")))},EPUBJS.Reader.prototype.addBookmark=function(e){-1<this.isBookmarked(e)||(this.settings.bookmarks.push(e),this.trigger("reader:bookmarked",e),this.settings.restore&&this.saveSettings())},EPUBJS.Reader.prototype.removeBookmark=function(e){e=this.isBookmarked(e);-1!==e&&(this.settings.bookmarks.splice(e,1),this.trigger("reader:unbookmarked",e),this.settings.restore&&this.saveSettings())},EPUBJS.Reader.prototype.isBookmarked=function(e){return this.settings.bookmarks.indexOf(e)},EPUBJS.Reader.prototype.clearBookmarks=function(){this.settings.bookmarks=[],this.settings.restore&&this.saveSettings()},EPUBJS.Reader.prototype.setBookKey=function(e){return this.settings.bookKey||(this.settings.bookKey="epubjsreader:"+EPUBJS.VERSION+":"+window.location.host+":"+e),this.settings.bookKey},EPUBJS.Reader.prototype.isSaved=function(e){return!!localStorage&&null!==localStorage.getItem(this.settings.bookKey)},EPUBJS.Reader.prototype.removeSavedSettings=function(){if(!localStorage)return!1;localStorage.removeItem(this.settings.bookKey)},EPUBJS.Reader.prototype.applySavedSettings=function(){var e;if(!localStorage)return!1;try{e=JSON.parse(localStorage.getItem(this.settings.bookKey))}catch(e){return!1}return!!e&&(e.styles&&(this.settings.styles=EPUBJS.core.defaults(this.settings.styles||{},e.styles)),this.settings=EPUBJS.core.defaults(this.settings,e),!0)},EPUBJS.Reader.prototype.saveSettings=function(){this.book&&(this.settings.previousLocationCfi=this.rendition.currentLocation().start.cfi),localStorage&&localStorage.setItem(this.settings.bookKey,JSON.stringify(this.settings))},EPUBJS.Reader.prototype.unload=function(){this.settings.restore&&this.saveSettings()},EPUBJS.Reader.prototype.hashChanged=function(){var e=window.location.hash.slice(1);this.rendition.display(e)},EPUBJS.Reader.prototype.selectedRange=function(e){var t="#"+e;this.settings.history&&window.location.hash!=t&&(history.pushState({},"",t),this.currentLocationCfi=e)},RSVP.EventTarget.mixin(EPUBJS.Reader.prototype),EPUBJS.reader.BookmarksController=function(){function t(e){var t=document.createElement("li"),n=document.createElement("a");t.id="bookmark-"+s,t.classList.add("list_item");var r=o.spine.get(e);return r&&r.index in o.navigation.toc?(r=o.navigation.toc[r.index-2],n.textContent=r.label):n.textContent=e,n.href=e,n.classList.add("bookmark_link"),n.addEventListener("click",function(e){var t=this.getAttribute("href");i.display(t),e.preventDefault()},!1),t.appendChild(n),s++,t}var o=this.book,i=this.rendition,e=$("#bookmarksView"),n=e.find("#bookmarks"),r=document.createDocumentFragment(),s=0;return this.settings.bookmarks.forEach(function(e){e=t(e);r.appendChild(e)}),n.append(r),this.on("reader:bookmarked",function(e){e=t(e);n.append(e)}),this.on("reader:unbookmarked",function(e){$("#bookmark-"+e).remove()}),{show:function(){e.show()},hide:function(){e.hide()}}},EPUBJS.reader.ControlsController=function(e){var n=this,t=this.rendition,r=($("#store"),$("#fullscreen")),o=($("#fullscreenicon"),$("#cancelfullscreenicon"),$("#slider")),i=($("#main"),$("#sidebar"),$("#bookmark"));return o.on("click",function(){n.sidebarOpen?(n.SidebarController.hide(),o.addClass("icon-menu"),o.removeClass("icon-right")):(n.SidebarController.show(),o.addClass("icon-right"),o.removeClass("icon-menu"))}),"undefined"!=typeof screenfull&&(r.on("click",function(){screenfull.toggle($("#container")[0])}),screenfull.raw&&document.addEventListener(screenfull.raw.fullscreenchange,function(){fullscreen=screenfull.isFullscreen,fullscreen?r.addClass("icon-resize-small").removeClass("icon-resize-full"):r.addClass("icon-resize-full").removeClass("icon-resize-small")})),i.on("click",function(){var e=n.rendition.currentLocation().start.cfi;-1===n.isBookmarked(e)?(n.addBookmark(e),i.addClass("icon-bookmark").removeClass("icon-bookmark-empty")):(n.removeBookmark(e),i.removeClass("icon-bookmark").addClass("icon-bookmark-empty"))}),t.on("relocated",function(e){var t=e.start.cfi,e="#"+t;-1===n.isBookmarked(t)?i.removeClass("icon-bookmark").addClass("icon-bookmark-empty"):i.addClass("icon-bookmark").removeClass("icon-bookmark-empty"),n.currentLocationCfi=t,n.settings.history&&window.location.hash!=e&&history.pushState({},"",e),this.settings.restore&&this.saveSettings()}),{}},EPUBJS.reader.MetaController=function(e){var t=e.title,n=e.creator,r=$("#book-title"),o=$("#chapter-title"),e=$("#title-seperator");document.title=t+" – "+n,r.html(t),o.html(n),e.show()},EPUBJS.reader.ReaderController=function(t){function n(){o.addClass("show")}function e(e){37==e.keyCode&&("rtl"===t.package.metadata.direction?l.next():l.prev(),a.addClass("active"),setTimeout(function(){a.removeClass("active")},100),e.preventDefault()),39==e.keyCode&&("rtl"===t.package.metadata.direction?l.prev():l.next(),s.addClass("active"),setTimeout(function(){s.removeClass("active")},100),e.preventDefault())}var r=$("#main"),o=$("#divider"),i=$("#loader"),s=$("#next"),a=$("#prev"),c=this,t=this.book,l=this.rendition,u=function(){o.removeClass("show")};return document.addEventListener("keydown",e,!1),s.on("click",function(e){"rtl"===t.package.metadata.direction?l.prev():l.next(),e.preventDefault()}),a.on("click",function(e){"rtl"===t.package.metadata.direction?l.next():l.prev(),e.preventDefault()}),l.on("layout",function(e){(!0===e.spread?n:u)()}),l.on("relocated",function(e){e.atStart&&a.addClass("disabled"),e.atEnd&&s.addClass("disabled"),c.settings.restore&&c.saveSettings()}),{slideOut:function(){var e=l.currentLocation();e&&(e.start.cfi,c.settings.sidebarReflow?(r.addClass("single"),r.one("transitionend",function(){l.resize()})):r.addClass("closed"))},slideIn:function(){l.currentLocation().start.cfi;c.settings.sidebarReflow?(r.removeClass("single"),r.one("transitionend",function(){l.resize()})):r.removeClass("closed")},showLoader:function(){i.show(),u()},hideLoader:function(){i.hide()},showDivider:n,hideDivider:u,arrowKeys:e}},EPUBJS.reader.SidebarController=function(e){function n(e){var t=e+"Controller";i!=e&&void 0!==r[t]&&(r[i+"Controller"].hide(),r[t].show(),i=e,o.find(".active").removeClass("active"),o.find("#show-"+e).addClass("active"))}var r=this,t=$("#sidebar"),o=$("#panels"),i="Toc";return o.find(".show_view").on("click",function(e){var t=$(this).data("view");n(t),e.preventDefault()}),{show:function(){r.sidebarOpen=!0,r.ReaderController.slideOut(),t.addClass("open")},hide:function(){r.sidebarOpen=!1,r.ReaderController.slideIn(),t.removeClass("open")},getActivePanel:function(){return i},changePanelTo:n}},EPUBJS.reader.TocController=function(e){this.book;var n=this.rendition,r=$("#tocView"),t=document.createDocumentFragment(),i=function(e,r){var o=document.createElement("ul");return r=r||1,e.forEach(function(e){var t=document.createElement("li"),n=document.createElement("a");toggle=document.createElement("a"),t.id="toc-"+e.id,t.classList.add("list_item"),n.textContent=e.label,n.href=e.href,n.classList.add("toc_link"),t.appendChild(n),e.subitems&&0<e.subitems.length&&(r++,e=i(e.subitems,r),toggle.classList.add("toc_toggle"),t.insertBefore(toggle,n),t.appendChild(e)),o.appendChild(t)}),o};n.on("renderered",function(e){var t=e.id,e=r.find("#toc-"+t),t=r.find(".currentChapter");r.find(".openChapter");e.length&&(e!=t&&0<e.has(!1).length&&t.removeClass("currentChapter"),e.addClass("currentChapter"),e.parents("li").addClass("openChapter"))});e=i(e);return t.appendChild(e),r.append(t),r.find(".toc_link").on("click",function(e){var t=this.getAttribute("href");e.preventDefault(),n.display(t),r.find(".currentChapter").addClass("openChapter").removeClass("currentChapter"),$(this).parent("li").addClass("currentChapter")}),r.find(".toc_toggle").on("click",function(e){var t=$(this).parent("li"),n=t.hasClass("openChapter");e.preventDefault(),n?t.removeClass("openChapter"):t.addClass("openChapter")}),{show:function(){r.show()},hide:function(){r.hide()}}};
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | ���֧ߧ֧�ѧ�ڧ� ����ѧߧڧ��: 0.06 |
proxy
|
phpinfo
|
���ѧ����ۧܧ�