1
0
mirror of https://github.com/janeczku/calibre-web synced 2024-11-28 20:39:59 +00:00
calibre-web/cps/static/js/libs/epub.min.js

2 lines
173 KiB
JavaScript
Raw Normal View History

2019-03-28 05:23:45 +00:00
(function(e,t){'object'==typeof exports&&'object'==typeof module?module.exports=t(require('xmldom'),function(){try{return require('jszip')}catch(t){}}()):'function'==typeof define&&define.amd?define(['xmldom','jszip'],t):'object'==typeof exports?exports.ePub=t(require('xmldom'),function(){try{return require('jszip')}catch(t){}}()):e.ePub=t(e.xmldom,e.jszip)})(this,function(e,t){var n=String.prototype,a=Math.ceil,i=Math.round,o=Math.max,s=Math.floor;return function(e){function t(a){if(n[a])return n[a].exports;var i=n[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,a){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:a})},t.n=function(e){var n=e&&e.__esModule?function(){return e['default']}:function(){return e};return t.d(n,'a',n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p='/dist/',t(t.s=25)}([function(e,t,n){'use strict';function a(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function i(){var e=new Date().getTime(),t='xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,function(t){var n=0|(e+16*Math.random())%16;return e=s(e/16),('x'==t?n:8|7&n).toString(16)});return t}function r(e){return!isNaN(parseFloat(e))&&isFinite(e)}function l(e,t,n,a,i){var o=a||0,s=i||t.length,r=parseInt(o+(s-o)/2),d;return(n||(n=function(e,t){return e>t?1:e<t?-1:e==t?0:void 0}),0>=s-o)?r:(d=n(t[r],e),1==s-o?0<=d?r:r+1:0===d?r:-1===d?l(e,t,n,r,s):l(e,t,n,o,r))}function d(e,t,n,a,i){var o=a||0,s=i||t.length,r=parseInt(o+(s-o)/2),l;return(n||(n=function(e,t){return e>t?1:e<t?-1:e==t?0:void 0}),0>=s-o)?-1:(l=n(t[r],e),1==s-o?0===l?r:-1:0===l?r:-1===l?d(e,t,n,r,s):d(e,t,n,o,r))}function u(e,t){for(var n=e.parentNode,a=n.childNodes,o=-1,s=0,i;s<a.length&&(i=a[s],i.nodeType===t&&o++,i!=e);s++);return o}function c(e,t){return new Blob([e],{type:t})}function p(e,t){return'undefined'==typeof e.querySelector?e.getElementsByTagName(t):e.querySelectorAll(t)}function h(e,t,n){for(var a=document.createTreeWalker(e,n,null,!1),i;i=a.nextNode();)t(i)}function g(e,t){if(t(e))return!0;if(e=e.firstChild,e)do{var n=g(e,t);if(n)return!0;e=e.nextSibling}while(e)}function f(e){for(var t=[e];e;e=e.parentNode)t.unshift(e);return t}Object.defineProperty(t,'__esModule',{value:!0});var m=function(){function e(e,t){for(var n=0,a;n<t.length;n++)a=t[n],a.enumerable=a.enumerable||!1,a.configurable=!0,'value'in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}();t.uuid=i,t.documentHeight=function(){return o(document.documentElement.clientHeight,document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight)},t.isElement=function(e){return!!(e&&1==e.nodeType)},t.isNumber=r,t.isFloat=function(e){var t=parseFloat(e);return t===e&&r(e)&&s(t)!==e},t.prefixed=function(e){var t=['Webkit','webkit','Moz','O','ms'],n=['-webkit-','-webkit-','-moz-','-o-','-ms-'],a=e[0].toUpperCase()+e.slice(1),o=t.length;if('undefined'==typeof document||'undefined'!=typeof document.body.style[e])return e;for(var s=0;s<o;s++)if('undefined'!=typeof document.body.style[t[s]+a])return n[s]+e;return e},t.defaults=function(e){for(var t=1,n=arguments.length,a;t<n;t++)for(var i in a=arguments[t],a)void 0===e[i]&&(e[i]=a[i]);return e},t.extend=function(e){var t=[].slice.call(arguments,1);return t.forEach(function(t){t&&Object.getOwnPropertyNames(t).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}),e},t.insert=function(e,t,n){var a=l(e,t,n);return t.splice(a,0,e),a},t.locationOf=l,t.indexOfSorted=d,t.bounds=function(e){var t=window.getComputedStyle(e),n=0,a=0;return['width','paddingRight','paddingLeft','marginRight','marginLeft','borderRightWidth','borderLeftWidth'].forEach(function(e){n+=parseFloat(t[e])||0}),['height','paddingTop','paddingBottom','marginTop','marginBottom','borderTopWidth','borderBottomWidth'].forEach(function(e){a+=parseFloat(t[e])||0}),{height:a,width:n}},t