mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-04 15:09:16 +02:00
8 lines
No EOL
8.5 KiB
JavaScript
8 lines
No EOL
8.5 KiB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ePub=e():t.ePub=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="/dist/",e(0)}({0:function(t,e,n){t.exports=n(44)},18:function(t,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(t){if(f===setTimeout)return setTimeout(t,0);if((f===n||!f)&&setTimeout)return f=setTimeout,setTimeout(t,0);try{return f(t,0)}catch(e){try{return f.call(null,t,0)}catch(e){return f.call(this,t,0)}}}function i(t){if(l===clearTimeout)return clearTimeout(t);if((l===r||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(t);try{return l(t)}catch(e){try{return l.call(null,t)}catch(e){return l.call(this,t)}}}function u(){v&&p&&(v=!1,p.length?d=p.concat(d):y=-1,d.length&&s())}function s(){if(!v){var t=o(u);v=!0;for(var e=d.length;e;){for(p=d,d=[];++y<e;)p&&p[y].run();y=-1,e=d.length}p=null,v=!1,i(t)}}function c(t,e){this.fun=t,this.array=e}function a(){}var f,l,h=t.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:n}catch(t){f=n}try{l="function"==typeof clearTimeout?clearTimeout:r}catch(t){l=r}}();var p,d=[],v=!1,y=-1;h.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];d.push(new c(t,e)),1!==d.length||v||o(s)},c.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=a,h.addListener=a,h.once=a,h.off=a,h.removeListener=a,h.removeAllListeners=a,h.emit=a,h.binding=function(t){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(t){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},44:function(t,e,n){(function(e,r){/*!
|
|
* @overview es6-promise - a tiny implementation of Promises/A+.
|
|
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
|
|
* @license Licensed under MIT license
|
|
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
|
|
* @version 4.0.5
|
|
*/
|
|
!function(e,n){t.exports=n()}(this,function(){"use strict";function t(t){return"function"==typeof t||"object"==typeof t&&null!==t}function o(t){return"function"==typeof t}function i(t){R=t}function u(t){V=t}function s(){return function(){return e.nextTick(h)}}function c(){return"undefined"!=typeof Q?function(){Q(h)}:l()}function a(){var t=0,e=new $(h),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function f(){var t=new MessageChannel;return t.port1.onmessage=h,function(){return t.port2.postMessage(0)}}function l(){var t=setTimeout;return function(){return t(h,1)}}function h(){for(var t=0;t<J;t+=2){var e=nt[t],n=nt[t+1];e(n),nt[t]=void 0,nt[t+1]=void 0}J=0}function p(){try{var t=n(45);return Q=t.runOnLoop||t.runOnContext,c()}catch(e){return l()}}function d(t,e){var n=arguments,r=this,o=new this.constructor(y);void 0===o[ot]&&F(o);var i=r._state;return i?!function(){var t=n[i-1];V(function(){return k(i,o,t,r._result)})}():P(r,o,t,e),o}function v(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var n=new e(y);return x(n,t),n}function y(){}function _(){return new TypeError("You cannot resolve a promise with itself")}function m(){return new TypeError("A promises callback cannot return that same promise.")}function w(t){try{return t.then}catch(e){return ct.error=e,ct}}function b(t,e,n,r){try{t.call(e,n,r)}catch(o){return o}}function g(t,e,n){V(function(t){var r=!1,o=b(n,e,function(n){r||(r=!0,e!==n?x(t,n):j(t,n))},function(e){r||(r=!0,S(t,e))},"Settle: "+(t._label||" unknown promise"));!r&&o&&(r=!0,S(t,o))},t)}function T(t,e){e._state===ut?j(t,e._result):e._state===st?S(t,e._result):P(e,void 0,function(e){return x(t,e)},function(e){return S(t,e)})}function A(t,e,n){e.constructor===t.constructor&&n===d&&e.constructor.resolve===v?T(t,e):n===ct?S(t,ct.error):void 0===n?j(t,e):o(n)?g(t,e,n):j(t,e)}function x(e,n){e===n?S(e,_()):t(n)?A(e,n,w(n)):j(e,n)}function E(t){t._onerror&&t._onerror(t._result),M(t)}function j(t,e){t._state===it&&(t._result=e,t._state=ut,0!==t._subscribers.length&&V(M,t))}function S(t,e){t._state===it&&(t._state=st,t._result=e,V(E,t))}function P(t,e,n,r){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+ut]=n,o[i+st]=r,0===i&&t._state&&V(M,t)}function M(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,o=void 0,i=t._result,u=0;u<e.length;u+=3)r=e[u],o=e[u+n],r?k(n,r,o,i):o(i);t._subscribers.length=0}}function C(){this.error=null}function O(t,e){try{return t(e)}catch(n){return at.error=n,at}}function k(t,e,n,r){var i=o(n),u=void 0,s=void 0,c=void 0,a=void 0;if(i){if(u=O(n,r),u===at?(a=!0,s=u.error,u=null):c=!0,e===u)return void S(e,m())}else u=r,c=!0;e._state!==it||(i&&c?x(e,u):a?S(e,s):t===ut?j(e,u):t===st&&S(e,u))}function L(t,e){try{e(function(e){x(t,e)},function(e){S(t,e)})}catch(n){S(t,n)}}function Y(){return ft++}function F(t){t[ot]=ft++,t._state=void 0,t._result=void 0,t._subscribers=[]}function D(t,e){this._instanceConstructor=t,this.promise=new t(y),this.promise[ot]||F(this.promise),I(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?j(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&j(this.promise,this._result))):S(this.promise,K())}function K(){return new Error("Array Methods must be provided an Array")}function N(t){return new D(this,t).promise}function U(t){var e=this;return new e(I(t)?function(n,r){for(var o=t.length,i=0;i<o;i++)e.resolve(t[i]).then(n,r)}:function(t,e){return e(new TypeError("You must pass an array to race."))})}function W(t){var e=this,n=new e(y);return S(n,t),n}function q(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function z(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function B(t){this[ot]=Y(),this._result=this._state=void 0,this._subscribers=[],y!==t&&("function"!=typeof t&&q(),this instanceof B?L(this,t):z())}function G(){var t=void 0;if("undefined"!=typeof r)t=r;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=t.Promise;if(n){var o=null;try{o=Object.prototype.toString.call(n.resolve())}catch(e){}if("[object Promise]"===o&&!n.cast)return}t.Promise=B}var H=void 0;H=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var I=H,J=0,Q=void 0,R=void 0,V=function(t,e){nt[J]=t,nt[J+1]=e,J+=2,2===J&&(R?R(h):rt())},X="undefined"!=typeof window?window:void 0,Z=X||{},$=Z.MutationObserver||Z.WebKitMutationObserver,tt="undefined"==typeof self&&"undefined"!=typeof e&&"[object process]"==={}.toString.call(e),et="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,nt=new Array(1e3),rt=void 0;rt=tt?s():$?a():et?f():void 0===X?p():l();var ot=Math.random().toString(36).substring(16),it=void 0,ut=1,st=2,ct=new C,at=new C,ft=0;return D.prototype._enumerate=function(){for(var t=this.length,e=this._input,n=0;this._state===it&&n<t;n++)this._eachEntry(e[n],n)},D.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===v){var o=w(t);if(o===d&&t._state!==it)this._settledAt(t._state,e,t._result);else if("function"!=typeof o)this._remaining--,this._result[e]=t;else if(n===B){var i=new n(y);A(i,t,o),this._willSettleAt(i,e)}else this._willSettleAt(new n(function(e){return e(t)}),e)}else this._willSettleAt(r(t),e)},D.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===it&&(this._remaining--,t===st?S(r,n):this._result[e]=n),0===this._remaining&&j(r,this._result)},D.prototype._willSettleAt=function(t,e){var n=this;P(t,void 0,function(t){return n._settledAt(ut,e,t)},function(t){return n._settledAt(st,e,t)})},B.all=N,B.race=U,B.resolve=v,B.reject=W,B._setScheduler=i,B._setAsap=u,B._asap=V,B.prototype={constructor:B,then:d,"catch":function(t){return this.then(null,t)}},B.polyfill=G,B.Promise=B,B}),ES6Promise.polyfill()}).call(e,n(18),function(){return this}())},45:function(t,e){}})}); |