UNPKG

epubjs

Version:
1 lines 292 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("xmldom"),require("JSZip")):"function"==typeof define&&define.amd?define(["xmldom","JSZip"],e):"object"==typeof exports?exports.ePub=e(require("xmldom"),require("JSZip")):t.ePub=e(t.xmldom,t.JSZip)}(window,(function(t,e){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=157)}([function(t,e,n){"use strict";n.r(e),n.d(e,"requestAnimationFrame",(function(){return o})),n.d(e,"uuid",(function(){return a})),n.d(e,"documentHeight",(function(){return u})),n.d(e,"isElement",(function(){return c})),n.d(e,"isNumber",(function(){return h})),n.d(e,"isFloat",(function(){return l})),n.d(e,"prefixed",(function(){return f})),n.d(e,"defaults",(function(){return d})),n.d(e,"extend",(function(){return p})),n.d(e,"insert",(function(){return v})),n.d(e,"locationOf",(function(){return g})),n.d(e,"indexOfSorted",(function(){return y})),n.d(e,"bounds",(function(){return m})),n.d(e,"borders",(function(){return b})),n.d(e,"nodeBounds",(function(){return w})),n.d(e,"windowBounds",(function(){return k})),n.d(e,"indexOfNode",(function(){return x})),n.d(e,"indexOfTextNode",(function(){return E})),n.d(e,"indexOfElementNode",(function(){return S})),n.d(e,"isXml",(function(){return O})),n.d(e,"createBlob",(function(){return _})),n.d(e,"createBlobUrl",(function(){return C})),n.d(e,"revokeBlobUrl",(function(){return T})),n.d(e,"createBase64Url",(function(){return R})),n.d(e,"type",(function(){return j})),n.d(e,"parse",(function(){return I})),n.d(e,"qs",(function(){return L})),n.d(e,"qsa",(function(){return A})),n.d(e,"qsp",(function(){return N})),n.d(e,"sprint",(function(){return P})),n.d(e,"treeWalker",(function(){return D})),n.d(e,"walk",(function(){return z})),n.d(e,"blob2base64",(function(){return B})),n.d(e,"defer",(function(){return M})),n.d(e,"querySelectorByType",(function(){return q})),n.d(e,"findChildren",(function(){return U})),n.d(e,"parents",(function(){return F})),n.d(e,"filterChildren",(function(){return W})),n.d(e,"getParentByTagName",(function(){return H})),n.d(e,"RangeObject",(function(){return V}));n(52),n(62),n(7),n(14),n(15),n(36),n(85),n(189),n(141),n(191),n(10),n(29),n(16),n(31),n(19),n(61),n(11),n(23),n(48);var i=n(87);function r(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o="undefined"!=typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame),s="undefined"!=typeof URL?URL:"undefined"!=typeof window?window.URL||window.webkitURL||window.mozURL:void 0;function a(){var t=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?n:7&n|8).toString(16)}))}function u(){return Math.max(document.documentElement.clientHeight,document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight)}function c(t){return!(!t||1!=t.nodeType)}function h(t){return!isNaN(parseFloat(t))&&isFinite(t)}function l(t){var e=parseFloat(t);return!1!==h(t)&&("string"==typeof t&&t.indexOf(".")>-1||Math.floor(e)!==e)}function f(t){var e=["-webkit-","-webkit-","-moz-","-o-","-ms-"],n=t.toLowerCase(),i=["Webkit","webkit","Moz","O","ms"].length;if("undefined"==typeof document||void 0!==document.body.style[n])return t;for(var r=0;r<i;r++)if(void 0!==document.body.style[e[r]+n])return e[r]+n;return t}function d(t){for(var e=1,n=arguments.length;e<n;e++){var i=arguments[e];for(var r in i)void 0===t[r]&&(t[r]=i[r])}return t}function p(t){var e=[].slice.call(arguments,1);return e.forEach((function(e){e&&Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))})),t}function v(t,e,n){var i=g(t,e,n);return e.splice(i,0,t),i}function g(t,e,n,i,r){var o,s=i||0,a=r||e.length,u=parseInt(s+(a-s)/2);return n||(n=function(t,e){return t>e?1:t<e?-1:t==e?0:void 0}),a-s<=0?u:(o=n(e[u],t),a-s==1?o>=0?u:u+1:0===o?u:-1===o?g(t,e,n,u,a):g(t,e,n,s,u))}function y(t,e,n,i,r){var o,s=i||0,a=r||e.length,u=parseInt(s+(a-s)/2);return n||(n=function(t,e){return t>e?1:t<e?-1:t==e?0:void 0}),a-s<=0?-1:(o=n(e[u],t),a-s==1?0===o?u:-1:0===o?u:-1===o?y(t,e,n,u,a):y(t,e,n,s,u))}function m(t){var e=window.getComputedStyle(t),n=0,i=0;return["width","paddingRight","paddingLeft","marginRight","marginLeft","borderRightWidth","borderLeftWidth"].forEach((function(t){n+=parseFloat(e[t])||0})),["height","paddingTop","paddingBottom","marginTop","marginBottom","borderTopWidth","borderBottomWidth"].forEach((function(t){i+=parseFloat(e[t])||0})),{height:i,width:n}}function b(t){var e=window.getComputedStyle(t),n=0,i=0;return["paddingRight","paddingLeft","marginRight","marginLeft","borderRightWidth","borderLeftWidth"].forEach((function(t){n+=parseFloat(e[t])||0})),["paddingTop","paddingBottom","marginTop","marginBottom","borderTopWidth","borderBottomWidth"].forEach((function(t){i+=parseFloat(e[t])||0})),{height:i,width:n}}function w(t){var e,n=t.ownerDocument;if(t.nodeType==Node.TEXT_NODE){var i=n.createRange();i.selectNodeContents(t),e=i.getBoundingClientRect()}else e=t.getBoundingClientRect();return e}function k(){var t=window.innerWidth,e=window.innerHeight;return{top:0,left:0,right:t,bottom:e,width:t,height:e}}function x(t,e){for(var n,i=t.parentNode.childNodes,r=-1,o=0;o<i.length&&((n=i[o]).nodeType===e&&r++,n!=t);o++);return r}function E(t){return x(t,3)}function S(t){return x(t,1)}function O(t){return["xml","opf","ncx"].indexOf(t)>-1}function _(t,e){return new Blob([t],{type:e})}function C(t,e){var n=_(t,e);return s.createObjectURL(n)}function T(t){return s.revokeObjectURL(t)}function R(t,e){if("string"==typeof t)return"data:"+e+";base64,"+btoa(encodeURIComponent(t))}function j(t){return Object.prototype.toString.call(t).slice(8,-1)}function I(t,e,n){var r;return r="undefined"==typeof DOMParser||n?i.DOMParser:DOMParser,65279===t.charCodeAt(0)&&(t=t.slice(1)),(new r).parseFromString(t,e)}function L(t,e){var n;if(!t)throw new Error("No Element Provided");return void 0!==t.querySelector?t.querySelector(e):(n=t.getElementsByTagName(e)).length?n[0]:void 0}function A(t,e){return void 0!==t.querySelector?t.querySelectorAll(e):t.getElementsByTagName(e)}function N(t,e,n){var i,r;if(void 0!==t.querySelector){for(var o in e+="[",n)e+=o+"~='"+n[o]+"'";return e+="]",t.querySelector(e)}if(i=t.getElementsByTagName(e),r=Array.prototype.slice.call(i,0).filter((function(t){for(var e in n)if(t.getAttribute(e)===n[e])return!0;return!1})))return r[0]}function P(t,e){void 0!==(t.ownerDocument||t).createTreeWalker?D(t,e,NodeFilter.SHOW_TEXT):z(t,(function(t){t&&3===t.nodeType&&e(t)}))}function D(t,e,n){for(var i,r=document.createTreeWalker(t,n,null,!1);i=r.nextNode();)e(i)}function z(t,e){if(e(t))return!0;if(t=t.firstChild)do{if(z(t,e))return!0;t=t.nextSibling}while(t)}function B(t){return new Promise((function(e,n){var i=new FileReader;i.readAsDataURL(t),i.onloadend=function(){e(i.result)}}))}function M(){var t=this;this.resolve=null,this.reject=null,this.id=a(),this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n})),Object.freeze(this)}function q(t,e,n){var i;if(void 0!==t.querySelector&&(i=t.querySelector("".concat(e,'[*|type="').concat(n,'"]'))),i&&0!==i.length)return i;i=A(t,e);for(var r=0;r<i.length;r++)if(i[r].getAttributeNS("http://www.idpf.org/2007/ops","type")===n||i[r].getAttribute("epub:type")===n)return i[r]}function U(t){for(var e=[],n=t.childNodes,i=0;i<n.length;i++){var r=n[i];1===r.nodeType&&e.push(r)}return e}function F(t){for(var e=[t];t;t=t.parentNode)e.unshift(t);return e}function W(t,e,n){for(var i=[],r=t.childNodes,o=0;o<r.length;o++){var s=r[o];if(1===s.nodeType&&s.nodeName.toLowerCase()===e){if(n)return s;i.push(s)}}if(!n)return i}function H(t,e){var n;if(null!==t&&""!==e)for(n=t.parentNode;1===n.nodeType;){if(n.tagName.toLowerCase()===e)return n;n=n.parentNode}}var V=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.collapsed=!1,this.commonAncestorContainer=void 0,this.endContainer=void 0,this.endOffset=void 0,this.startContainer=void 0,this.startOffset=void 0}var e,n,i;return e=t,(n=[{key:"setStart",value:function(t,e){this.startContainer=t,this.startOffset=e,this.endContainer?this.commonAncestorContainer=this._commonAncestorContainer():this.collapse(!0),this._checkCollapsed()}},{key:"setEnd",value:function(t,e){this.endContainer=t,this.endOffset=e,this.startContainer?(this.collapsed=!1,this.commonAncestorContainer=this._commonAncestorContainer()):this.collapse(!1),this._checkCollapsed()}},{key:"collapse",value:function(t){this.collapsed=!0,t?(this.endContainer=this.startContainer,this.endOffset=this.startOffset,this.commonAncestorContainer=this.startContainer.parentNode):(this.startContainer=this.endContainer,this.startOffset=this.endOffset,this.commonAncestorContainer=this.endOffset.parentNode)}},{key:"selectNode",value:function(t){var e=t.parentNode,n=Array.prototype.indexOf.call(e.childNodes,t);this.setStart(e,n),this.setEnd(e,n+1)}},{key:"selectNodeContents",value:function(t){t.childNodes[t.childNodes-1];var e=3===t.nodeType?t.textContent.length:parent.childNodes.length;this.setStart(t,0),this.setEnd(t,e)}},{key:"_commonAncestorContainer",value:function(t,e){var n=F(t||this.startContainer),i=F(e||this.endContainer);if(n[0]==i[0])for(var r=0;r<n.length;r++)if(n[r]!=i[r])return n[r-1]}},{key:"_checkCollapsed",value:function(){this.startContainer===this.endContainer&&this.startOffset===this.endOffset?this.collapsed=!0:this.collapsed=!1}},{key:"toString",value:function(){}}])&&r(e.prototype,n),i&&r(e,i),t}()},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return r})),n.d(e,"c",(function(){return o}));var i="0.3",r=["keydown","keyup","keypressed","mouseup","mousedown","click","touchend","touchstart","touchmove"],o={BOOK:{OPEN_FAILED:"openFailed"},CONTENTS:{EXPAND:"expand",RESIZE:"resize",SELECTED:"selected",SELECTED_RANGE:"selectedRange",LINK_CLICKED:"linkClicked"},LOCATIONS:{CHANGED:"changed"},MANAGERS:{RESIZE:"resize",RESIZED:"resized",ORIENTATION_CHANGE:"orientationchange",ADDED:"added",SCROLL:"scroll",SCROLLED:"scrolled",REMOVED:"removed"},VIEWS:{AXIS:"axis",WRITING_MODE:"writingMode",LOAD_ERROR:"loaderror",RENDERED:"rendered",RESIZED:"resized",DISPLAYED:"displayed",SHOWN:"shown",HIDDEN:"hidden",MARK_CLICKED:"markClicked"},RENDITION:{STARTED:"started",ATTACHED:"attached",DISPLAYED:"displayed",DISPLAY_ERROR:"displayerror",RENDERED:"rendered",REMOVED:"removed",RESIZED:"resized",ORIENTATION_CHANGE:"orientationchange",LOCATION_CHANGED:"locationChanged",RELOCATED:"relocated",MARK_CLICKED:"markClicked",SELECTED:"selected",LAYOUT:"layout"},LAYOUT:{UPDATED:"updated"},ANNOTATION:{ATTACH:"attach",DETACH:"detach"}}},function(t,e,n){"use strict";n(64),n(65),n(66),n(52),n(62),n(7),n(14),n(15),n(147),n(40),n(36),n(10),n(16),n(31),n(19),n(148),n(39),n(11),n(23);var i=n(0);function r(t){return(r="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})(t)}function o(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var s=function(){function t(e,n,o){var s;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),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,n,o);if("string"==typeof n?this.base=this.parseComponent(n):"object"===r(n)&&n.steps&&(this.base=n),"string"===(s=this.checkType(e)))return this.str=e,Object(i.extend)(this,this.parse(e));if("range"===s)return Object(i.extend)(this,this.fromRange(e,this.base,o));if("node"===s)return Object(i.extend)(this,this.fromNode(e,this.base,o));if("EpubCFI"===s&&e.path)return e;if(e)throw new TypeError("not a valid argument for EpubCFI");return this}var e,n,s;return e=t,(n=[{key:"checkType",value:function(e){return this.isCfiString(e)?"string":!e||"object"!==r(e)||"Range"!==Object(i.type)(e)&&void 0===e.startContainer?e&&"object"===r(e)&&void 0!==e.nodeType?"node":!!(e&&"object"===r(e)&&e instanceof t)&&"EpubCFI":"range"}},{key:"parse",value:function(t){var e,n,i,r={spinePos:-1,range:!1,base:{},path:{},start:null,end:null};return"string"!=typeof t?{spinePos:-1}:(0===t.indexOf("epubcfi(")&&")"===t[t.length-1]&&(t=t.slice(8,t.length-1)),(e=this.getChapterComponent(t))?(r.base=this.parseComponent(e),n=this.getPathComponent(t),r.path=this.parseComponent(n),(i=this.getRange(t))&&(r.range=!0,r.start=this.parseComponent(i[0]),r.end=this.parseComponent(i[1])),r.spinePos=r.base.steps[1].index,r):{spinePos:-1})}},{key:"parseComponent",value:function(t){var e,n={steps:[],terminal:{offset:null,assertion:null}},i=t.split(":"),r=i[0].split("/");return i.length>1&&(e=i[1],n.terminal=this.parseTerminal(e)),""===r[0]&&r.shift(),n.steps=r.map(function(t){return this.parseStep(t)}.bind(this)),n}},{key:"parseStep",value:function(t){var e,n,i,r,o;if((r=t.match(/\[(.*)\]/))&&r[1]&&(o=r[1]),n=parseInt(t),!isNaN(n))return n%2==0?(e="element",i=n/2-1):(e="text",i=(n-1)/2),{type:e,index:i,id:o||null}}},{key:"parseTerminal",value:function(t){var e,n,r=t.match(/\[(.*)\]/);return r&&r[1]?(e=parseInt(t.split("[")[0]),n=r[1]):e=parseInt(t),Object(i.isNumber)(e)||(e=null),{offset:e,assertion:n}}},{key:"getChapterComponent",value:function(t){return t.split("!")[0]}},{key:"getPathComponent",value:function(t){var e=t.split("!");if(e[1])return e[1].split(",")[0]}},{key:"getRange",value:function(t){var e=t.split(",");return 3===e.length&&[e[1],e[2]]}},{key:"getCharecterOffsetComponent",value:function(t){return t.split(":")[1]||""}},{key:"joinSteps",value:function(t){return t?t.map((function(t){var e="";return"element"===t.type&&(e+=2*(t.index+1)),"text"===t.type&&(e+=1+2*t.index),t.id&&(e+="["+t.id+"]"),e})).join("/"):""}},{key:"segmentString",value:function(t){var e="/";return e+=this.joinSteps(t.steps),t.terminal&&null!=t.terminal.offset&&(e+=":"+t.terminal.offset),t.terminal&&null!=t.terminal.assertion&&(e+="["+t.terminal.assertion+"]"),e}},{key:"toString",value:function(){var t="epubcfi(";return t+=this.segmentString(this.base),t+="!",t+=this.segmentString(this.path),this.range&&this.start&&(t+=",",t+=this.segmentString(this.start)),this.range&&this.end&&(t+=",",t+=this.segmentString(this.end)),t+=")"}},{key:"compare",value:function(e,n){var i,r,o,s;if("string"==typeof e&&(e=new t(e)),"string"==typeof n&&(n=new t(n)),e.spinePos>n.spinePos)return 1;if(e.spinePos<n.spinePos)return-1;e.range?(i=e.path.steps.concat(e.start.steps),o=e.start.terminal):(i=e.path.steps,o=e.path.terminal),n.range?(r=n.path.steps.concat(n.start.steps),s=n.start.terminal):(r=n.path.steps,s=n.path.terminal);for(var a=0;a<i.length;a++){if(!i[a])return-1;if(!r[a])return 1;if(i[a].index>r[a].index)return 1;if(i[a].index<r[a].index)return-1}return i.length<r.length?-1:o.offset>s.offset?1:o.offset<s.offset?-1:0}},{key:"step",value:function(t){var e=3===t.nodeType?"text":"element";return{id:t.id,tagName:t.tagName,type:e,index:this.position(t)}}},{key:"filteredStep",value:function(t,e){var n,i=this.filter(t,e);if(i)return n=3===i.nodeType?"text":"element",{id:i.id,tagName:i.tagName,type:n,index:this.filteredPosition(i,e)}}},{key:"pathTo",value:function(t,e,n){for(var i,r={steps:[],terminal:{offset:null,assertion:null}},o=t;o&&o.parentNode&&9!=o.parentNode.nodeType;)(i=n?this.filteredStep(o,n):this.step(o))&&r.steps.unshift(i),o=o.parentNode;return null!=e&&e>=0&&(r.terminal.offset=e,"text"!=r.steps[r.steps.length-1].type&&r.steps.push({type:"text",index:0})),r}},{key:"equalStep",value:function(t,e){return!(!t||!e)&&t.index===e.index&&t.id===e.id&&t.type===e.type}},{key:"fromRange",value:function(t,e,n){var i={range:!1,base:{},path:{},start:null,end:null},o=t.startContainer,s=t.endContainer,a=t.startOffset,u=t.endOffset,c=!1;if(n&&(c=null!=o.ownerDocument.querySelector("."+n)),"string"==typeof e?(i.base=this.parseComponent(e),i.spinePos=i.base.steps[1].index):"object"===r(e)&&(i.base=e),t.collapsed)c&&(a=this.patchOffset(o,a,n)),i.path=this.pathTo(o,a,n);else{i.range=!0,c&&(a=this.patchOffset(o,a,n)),i.start=this.pathTo(o,a,n),c&&(u=this.patchOffset(s,u,n)),i.end=this.pathTo(s,u,n),i.path={steps:[],terminal:null};var h,l=i.start.steps.length;for(h=0;h<l&&this.equalStep(i.start.steps[h],i.end.steps[h]);h++)h===l-1?i.start.terminal===i.end.terminal&&(i.path.steps.push(i.start.steps[h]),i.range=!1):i.path.steps.push(i.start.steps[h]);i.start.steps=i.start.steps.slice(i.path.steps.length),i.end.steps=i.end.steps.slice(i.path.steps.length)}return i}},{key:"fromNode",value:function(t,e,n){var i={range:!1,base:{},path:{},start:null,end:null};return"string"==typeof e?(i.base=this.parseComponent(e),i.spinePos=i.base.steps[1].index):"object"===r(e)&&(i.base=e),i.path=this.pathTo(t,null,n),i}},{key:"filter",value:function(t,e){var n,i,r,o,s,a=!1;return 3===t.nodeType?(a=!0,r=t.parentNode,n=t.parentNode.classList.contains(e)):(a=!1,n=t.classList.contains(e)),n&&a?(o=r.previousSibling,s=r.nextSibling,o&&3===o.nodeType?i=o:s&&3===s.nodeType&&(i=s),i||t):!(n&&!a)&&t}},{key:"patchOffset",value:function(t,e,n){if(3!=t.nodeType)throw new Error("Anchor must be a text node");var i=t,r=e;for(t.parentNode.classList.contains(n)&&(i=t.parentNode);i.previousSibling;){if(1===i.previousSibling.nodeType){if(!i.previousSibling.classList.contains(n))break;r+=i.previousSibling.textContent.length}else r+=i.previousSibling.textContent.length;i=i.previousSibling}return r}},{key:"normalizedMap",value:function(t,e,n){var i,r,o,s={},a=-1,u=t.length;for(i=0;i<u;i++)1===(r=t[i].nodeType)&&t[i].classList.contains(n)&&(r=3),i>0&&3===r&&3===o?s[i]=a:e===r&&(a+=1,s[i]=a),o=r;return s}},{key:"position",value:function(t){var e,n;return 1===t.nodeType?((e=t.parentNode.children)||(e=Object(i.findChildren)(t.parentNode)),n=Array.prototype.indexOf.call(e,t)):n=(e=this.textNodes(t.parentNode)).indexOf(t),n}},{key:"filteredPosition",value:function(t,e){var n,i;return 1===t.nodeType?(n=t.parentNode.children,i=this.normalizedMap(n,1,e)):(n=t.parentNode.childNodes,t.parentNode.classList.contains(e)&&(n=(t=t.parentNode).parentNode.childNodes),i=this.normalizedMap(n,3,e)),i[Array.prototype.indexOf.call(n,t)]}},{key:"stepsToXpath",value:function(t){var e=[".","*"];return t.forEach((function(t){var n=t.index+1;t.id?e.push("*[position()="+n+" and @id='"+t.id+"']"):"text"===t.type?e.push("text()["+n+"]"):e.push("*["+n+"]")})),e.join("/")}},{key:"stepsToQuerySelector",value:function(t){var e=["html"];return t.forEach((function(t){var n=t.index+1;t.id?e.push("#"+t.id):"text"===t.type||e.push("*:nth-child("+n+")")})),e.join(">")}},{key:"textNodes",value:function(t,e){return Array.prototype.slice.call(t.childNodes).filter((function(t){return 3===t.nodeType||!(!e||!t.classList.contains(e))}))}},{key:"walkToNode",value:function(t,e,n){var r,o,s=e||document,a=s.documentElement,u=t.length;for(o=0;o<u&&("element"===(r=t[o]).type?a=r.id?s.getElementById(r.id):(a.children||Object(i.findChildren)(a))[r.index]:"text"===r.type&&(a=this.textNodes(a,n)[r.index]),a);o++);return a}},{key:"findNode",value:function(t,e,n){var i,r,o=e||document;return n||void 0===o.evaluate?i=n?this.walkToNode(t,o,n):this.walkToNode(t,o):(r=this.stepsToXpath(t),i=o.evaluate(r,o,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue),i}},{key:"fixMiss",value:function(t,e,n,i){var r,o,s=this.findNode(t.slice(0,-1),n,i),a=s.childNodes,u=this.normalizedMap(a,3,i),c=t[t.length-1].index;for(var h in u){if(!u.hasOwnProperty(h))return;if(u[h]===c){if(!(e>(o=(r=a[h]).textContent.length))){s=1===r.nodeType?r.childNodes[0]:r;break}e-=o}}return{container:s,offset:e}}},{key:"toRange",value:function(t,e){var n,r,o,s,a,u,c,h,l=t||document,f=!!e&&null!=l.querySelector("."+e);if(n=void 0!==l.createRange?l.createRange():new i.RangeObject,this.range?(r=this.start,u=this.path.steps.concat(r.steps),s=this.findNode(u,l,f?e:null),o=this.end,c=this.path.steps.concat(o.steps),a=this.findNode(c,l,f?e:null)):(r=this.path,u=this.path.steps,s=this.findNode(this.path.steps,l,f?e:null)),!s)return console.log("No startContainer found for",this.toString()),null;try{null!=r.terminal.offset?n.setStart(s,r.terminal.offset):n.setStart(s,0)}catch(t){h=this.fixMiss(u,r.terminal.offset,l,f?e:null),n.setStart(h.container,h.offset)}if(a)try{null!=o.terminal.offset?n.setEnd(a,o.terminal.offset):n.setEnd(a,0)}catch(t){h=this.fixMiss(c,this.end.terminal.offset,l,f?e:null),n.setEnd(h.container,h.offset)}return n}},{key:"isCfiString",value:function(t){return"string"==typeof t&&0===t.indexOf("epubcfi(")&&")"===t[t.length-1]}},{key:"generateChapterComponent",value:function(t,e,n){var i="/"+2*(t+1)+"/";return i+=2*(parseInt(e)+1),n&&(i+="["+n+"]"),i}},{key:"collapse",value:function(t){this.range&&(this.range=!1,t?(this.path.steps=this.path.steps.concat(this.start.steps),this.path.terminal=this.start.terminal):(this.path.steps=this.path.steps.concat(this.end.steps),this.path.terminal=this.end.terminal))}}])&&o(e.prototype,n),s&&o(e,s),t}();e.a=s},function(t,e,n){var i=n(6),r=n(45).f,o=n(27),s=n(28),a=n(91),u=n(119),c=n(97);t.exports=function(t,e){var n,h,l,f,d,p=t.target,v=t.global,g=t.stat;if(n=v?i:g?i[p]||a(p,{}):(i[p]||{}).prototype)for(h in e){if(f=e[h],l=t.noTargetGet?(d=r(n,h))&&d.value:n[h],!c(v?h:p+(g?".":"#")+h,t.forced)&&void 0!==l){if(typeof f==typeof l)continue;u(f,l)}(t.sham||l&&l.sham)&&o(f,"sham",!0),s(n,h,f,t)}}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){var i=n(6),r=n(93),o=n(13),s=n(73),a=n(99),u=n(122),c=r("wks"),h=i.Symbol,l=u?h:h&&h.withoutSetter||s;t.exports=function(t){return o(c,t)||(a&&o(h,t)?c[t]=h[t]:c[t]=l("Symbol."+t)),c[t]}},function(t,e,n){(function(e){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||Function("return this")()}).call(this,n(70))},function(t,e,n){"use strict";var i=n(3),r=n(139);i({target:"Array",proto:!0,forced:[].forEach!=r},{forEach:r})},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var i=n(8);t.exports=function(t){if(!i(t))throw TypeError(String(t)+" is not an object");return t}},function(t,e,n){var i=n(104),r=n(28),o=n(166);i||r(Object.prototype,"toString",o,{unsafe:!0})},function(t,e,n){var i=n(6),r=n(138),o=n(139),s=n(27);for(var a in r){var u=i[a],c=u&&u.prototype;if(c&&c.forEach!==o)try{s(c,"forEach",o)}catch(t){c.forEach=o}}},function(t,e,n){"use strict";var i,r,o,s,a,u,c,h=n(174),l=n(188),f=Function.prototype.apply,d=Function.prototype.call,p=Object.create,v=Object.defineProperty,g=Object.defineProperties,y=Object.prototype.hasOwnProperty,m={configurable:!0,enumerable:!1,writable:!0};r=function(t,e){var n,r;return l(e),r=this,i.call(this,t,n=function(){o.call(r,t,n),f.call(e,this,arguments)}),n.__eeOnceListener__=e,this},a={on:i=function(t,e){var n;return l(e),y.call(this,"__ee__")?n=this.__ee__:(n=m.value=p(null),v(this,"__ee__",m),m.value=null),n[t]?"object"==typeof n[t]?n[t].push(e):n[t]=[n[t],e]:n[t]=e,this},once:r,off:o=function(t,e){var n,i,r,o;if(l(e),!y.call(this,"__ee__"))return this;if(!(n=this.__ee__)[t])return this;if("object"==typeof(i=n[t]))for(o=0;r=i[o];++o)r!==e&&r.__eeOnceListener__!==e||(2===i.length?n[t]=i[o?0:1]:i.splice(o,1));else i!==e&&i.__eeOnceListener__!==e||delete n[t];return this},emit:s=function(t){var e,n,i,r,o;if(y.call(this,"__ee__")&&(r=this.__ee__[t]))if("object"==typeof r){for(n=arguments.length,o=new Array(n-1),e=1;e<n;++e)o[e-1]=arguments[e];for(r=r.slice(),e=0;i=r[e];++e)f.call(i,this,o)}else switch(arguments.length){case 1:d.call(r,this);break;case 2:d.call(r,this,arguments[1]);break;case 3:d.call(r,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,o=new Array(n-1),e=1;e<n;++e)o[e-1]=arguments[e];f.call(r,this,o)}}},u={on:h(i),once:h(r),off:h(o),emit:h(s)},c=g({},u),t.exports=e=function(t){return null==t?p(c):g(Object(t),u)},e.methods=a},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){"use strict";var i=n(3),r=n(94).indexOf,o=n(77),s=n(35),a=[].indexOf,u=!!a&&1/[1].indexOf(1,-0)<0,c=o("indexOf"),h=s("indexOf",{ACCESSORS:!0,1:0});i({target:"Array",proto:!0,forced:u||!c||!h},{indexOf:function(t){return u?a.apply(this,arguments)||0:r(this,t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){"use strict";var i=n(32),r=n(78),o=n(58),s=n(34),a=n(126),u=s.set,c=s.getterFor("Array Iterator");t.exports=a(Array,"Array",(function(t,e){u(this,{type:"Array Iterator",target:i(t),index:0,kind:e})}),(function(){var t=c(this),e=t.target,n=t.kind,i=t.index++;return!e||i>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:i,done:!1}:"values"==n?{value:e[i],done:!1}:{value:[i,e[i]],done:!1}}),"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(t,e,n){"use strict";var i=n(3),r=n(82);i({target:"RegExp",proto:!0,forced:/./.exec!==r},{exec:r})},function(t,e,n){"use strict";n(14),n(15),n(36),n(10),n(16),n(19),n(23),n(48);var i=n(26),r=n.n(i);function o(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var s=function(){function t(e){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e.indexOf("://")>-1&&(e=new URL(e).pathname),n=this.parse(e),this.path=e,this.isDirectory(e)?this.directory=e:this.directory=n.dir+"/",this.filename=n.base,this.extension=n.ext.slice(1)}var e,n,i;return e=t,(n=[{key:"parse",value:function(t){return r.a.parse(t)}},{key:"isAbsolute",value:function(t){return r.a.isAbsolute(t||this.path)}},{key:"isDirectory",value:function(t){return"/"===t.charAt(t.length-1)}},{key:"resolve",value:function(t){return r.a.resolve(this.directory,t)}},{key:"relative",value:function(t){return t&&t.indexOf("://")>-1?t:r.a.relative(this.directory,t)}},{key:"splitPath",value:function(t){return this.splitPathRe.exec(t).slice(1)}},{key:"toString",value:function(){return this.path}}])&&o(e.prototype,n),i&&o(e,i),t}();e.a=s},function(t,e,n){var i=n(4);t.exports=!i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(t,e,n){"use strict";var i=n(107).charAt,r=n(34),o=n(126),s=r.set,a=r.getterFor("String Iterator");o(String,"String",(function(t){s(this,{type:"String Iterator",string:String(t),index:0})}),(function(){var t,e=a(this),n=e.string,r=e.index;return r>=n.length?{value:void 0,done:!0}:(t=i(n,r),e.index+=t.length,{value:t,done:!1})}))},function(t,e,n){"use strict";n(14),n(15),n(10),n(16),n(19),n(196),n(23),n(48);var i=n(17),r=n(26),o=n.n(r);function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var a=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var r=e.indexOf("://")>-1,o=e;if(this.Url=void 0,this.href=e,this.protocol="",this.origin="",this.hash="",this.hash="",this.search="",this.base=n,!r&&!1!==n&&"string"!=typeof n&&window&&window.location&&(this.base=window.location.href),r||this.base)try{this.base?this.Url=new URL(e,this.base):this.Url=new URL(e),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,o=this.Url.pathname+(this.Url.search?this.Url.search:"")}catch(t){this.Url=void 0,this.base&&(o=new i.a(this.base).resolve(o))}this.Path=new i.a(o),this.directory=this.Path.directory,this.filename=this.Path.filename,this.extension=this.Path.extension}var e,n,r;return e=t,(n=[{key:"path",value:function(){return this.Path}},{key:"resolve",value:function(t){var e;return t.indexOf("://")>-1?t:(e=o.a.resolve(this.directory,t),this.origin+e)}},{key:"relative",value:function(t){return o.a.relative(t,this.directory)}},{key:"toString",value:function(){return this.href}}])&&s(e.prototype,n),r&&s(e,r),t}();e.a=a},function(t,e,n){var i=n(18),r=n(117),o=n(9),s=n(71),a=Object.defineProperty;e.f=i?a:function(t,e,n){if(o(t),e=s(e,!0),o(n),r)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var i=n(42),r=Math.min;t.exports=function(t){return t>0?r(i(t),9007199254740991):0}},function(t,e,n){var i=n(6),r=n(138),o=n(15),s=n(27),a=n(5),u=a("iterator"),c=a("toStringTag"),h=o.values;for(var l in r){var f=i[l],d=f&&f.prototype;if(d){if(d[u]!==h)try{s(d,u,h)}catch(t){d[u]=h}if(d[c]||s(d,c,l),r[l])for(var p in o)if(d[p]!==o[p])try{s(d,p,o[p])}catch(t){d[p]=o[p]}}}},function(t,e,n){"use strict";n(7),n(15),n(85),n(10),n(29),n(19),n(11),n(23);function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var r=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e||this,this.hooks=[]}var e,n,r;return e=t,(n=[{key:"register",value:function(){for(var t=0;t<arguments.length;++t)if("function"==typeof arguments[t])this.hooks.push(arguments[t]);else for(var e=0;e<arguments[t].length;++e)this.hooks.push(arguments[t][e])}},{key:"deregister",value:function(t){for(var e=0;e<this.hooks.length;e++)if(this.hooks[e]===t){this.hooks.splice(e,1);break}}},{key:"trigger",value:function(){var t=arguments,e=this.context,n=[];return this.hooks.forEach((function(i){var r=i.apply(e,t);r&&"function"==typeof r.then&&n.push(r)})),Promise.all(n)}},{key:"list",value:function(){return this.hooks}},{key:"clear",value:function(){return this.hooks=[]}}])&&i(e.prototype,n),r&&i(e,r),t}();e.a=r},function(t,e,n){var i=n(33);t.exports=function(t){return Object(i(t))}},function(t,e,n){"use strict";if(!i)var i={cwd:function(){return"/"}};function r(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+t)}function o(t,e){for(var n,i="",r=-1,o=0,s=0;s<=t.length;++s){if(s<t.length)n=t.charCodeAt(s);else{if(47===n)break;n=47}if(47===n){if(r===s-1||1===o);else if(r!==s-1&&2===o){if(i.length<2||46!==i.charCodeAt(i.length-1)||46!==i.charCodeAt(i.length-2))if(i.length>2){for(var a=i.length-1,u=a;u>=0&&47!==i.charCodeAt(u);--u);if(u!==a){i=-1===u?"":i.slice(0,u),r=s,o=0;continue}}else if(2===i.length||1===i.length){i="",r=s,o=0;continue}e&&(i.length>0?i+="/..":i="..")}else i.length>0?i+="/"+t.slice(r+1,s):i=t.slice(r+1,s);r=s,o=0}else 46===n&&-1!==o?++o:o=-1}return i}var s={resolve:function(){for(var t,e="",n=!1,s=arguments.length-1;s>=-1&&!n;s--){var a;s>=0?a=arguments[s]:(void 0===t&&(t=i.cwd()),a=t),r(a),0!==a.length&&(e=a+"/"+e,n=47===a.charCodeAt(0))}return e=o(e,!n),n?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(t){if(r(t),0===t.length)return".";var e=47===t.charCodeAt(0),n=47===t.charCodeAt(t.length-1);return 0!==(t=o(t,!e)).length||e||(t="."),t.length>0&&n&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return r(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e<arguments.length;++e){var n=arguments[e];r(n),n.length>0&&(void 0===t?t=n:t+="/"+n)}return void 0===t?".":s.normalize(t)},relative:function(t,e){if(r(t),r(e),t===e)return"";if((t=s.resolve(t))===(e=s.resolve(e)))return"";for(var n=1;n<t.length&&47===t.charCodeAt(n);++n);for(var i=t.length,o=i-n,a=1;a<e.length&&47===e.charCodeAt(a);++a);for(var u=e.length-a,c=o<u?o:u,h=-1,l=0;l<=c;++l){if(l===c){if(u>c){if(47===e.charCodeAt(a+l))return e.slice(a+l+1);if(0===l)return e.slice(a+l)}else o>c&&(47===t.charCodeAt(n+l)?h=l:0===l&&(h=0));break}var f=t.charCodeAt(n+l);if(f!==e.charCodeAt(a+l))break;47===f&&(h=l)}var d="";for(l=n+h+1;l<=i;++l)l!==i&&47!==t.charCodeAt(l)||(0===d.length?d+="..":d+="/..");return d.length>0?d+e.slice(a+h):(a+=h,47===e.charCodeAt(a)&&++a,e.slice(a))},_makeLong:function(t){return t},dirname:function(t){if(r(t),0===t.length)return".";for(var e=t.charCodeAt(0),n=47===e,i=-1,o=!0,s=t.length-1;s>=1;--s)if(47===(e=t.charCodeAt(s))){if(!o){i=s;break}}else o=!1;return-1===i?n?"/":".":n&&1===i?"//":t.slice(0,i)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');r(t);var n,i=0,o=-1,s=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var a=e.length-1,u=-1;for(n=t.length-1;n>=0;--n){var c=t.charCodeAt(n);if(47===c){if(!s){i=n+1;break}}else-1===u&&(s=!1,u=n+1),a>=0&&(c===e.charCodeAt(a)?-1==--a&&(o=n):(a=-1,o=u))}return i===o?o=u:-1===o&&(o=t.length),t.slice(i,o)}for(n=t.length-1;n>=0;--n)if(47===t.charCodeAt(n)){if(!s){i=n+1;break}}else-1===o&&(s=!1,o=n+1);return-1===o?"":t.slice(i,o)},extname:function(t){r(t);for(var e=-1,n=0,i=-1,o=!0,s=0,a=t.length-1;a>=0;--a){var u=t.charCodeAt(a);if(47!==u)-1===i&&(o=!1,i=a+1),46===u?-1===e?e=a:1!==s&&(s=1):-1!==e&&(s=-1);else if(!o){n=a+1;break}}return-1===e||-1===i||0===s||1===s&&e===i-1&&e===n+1?"":t.slice(e,i)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('Parameter "pathObject" must be an object, not '+typeof t);return function(t,e){var n=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return n?n===e.root?n+i:n+t+i:i}("/",t)},parse:function(t){r(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var n,i=t.charCodeAt(0),o=47===i;o?(e.root="/",n=1):n=0;for(var s=-1,a=0,u=-1,c=!0,h=t.length-1,l=0;h>=n;--h)if(47!==(i=t.charCodeAt(h)))-1===u&&(c=!1,u=h+1),46===i?-1===s?s=h:1!==l&&(l=1):-1!==s&&(l=-1);else if(!c){a=h+1;break}return-1===s||-1===u||0===l||1===l&&s===u-1&&s===a+1?-1!==u&&(e.base=e.name=0===a&&o?t.slice(1,u):t.slice(a,u)):(0===a&&o?(e.name=t.slice(1,s),e.base=t.slice(1,u)):(e.name=t.slice(a,s),e.base=t.slice(a,u)),e.ext=t.slice(s,u)),a>0?e.dir=t.slice(0,a-1):o&&(e.dir="/"),e},sep:"/",delimiter:":",posix:null};t.exports=s},function(t,e,n){var i=n(18),r=n(21),o=n(46);t.exports=i?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var i=n(6),r=n(27),o=n(13),s=n(91),a=n(92),u=n(34),c=u.get,h=u.enforce,l=String(String).split("String");(t.exports=function(t,e,n,a){var u=!!a&&!!a.unsafe,c=!!a&&!!a.enumerable,f=!!a&&!!a.noTargetGet;"function"==typeof n&&("string"!=typeof e||o(n,"name")||r(n,"name",e),h(n).source=l.join("string"==typeof e?e:"")),t!==i?(u?!f&&t[e]&&(c=!0):delete t[e],c?t[e]=n:r(t,e,n)):c?t[e]=n:s(e,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&c(this).source||a(this)}))},function(t,e,n){"use strict";var i,r,o,s,a=n(3),u=n(47),c=n(6),h=n(38),l=n(167),f=n(28),d=n(102),p=n(43),v=n(103),g=n(8),y=n(44),m=n(80),b=n(37),w=n(92),k=n(168),x=n(169),E=n(133),S=n(134).set,O=n(170),_=n(171),C=n(172),T=n(136),R=n(173),j=n(34),I=n(97),L=n(5),A=n(100),N=L("species"),P="Promise",D=j.get,z=j.set,B=j.getterFor(P),M=l,q=c.TypeError,U=c.document,F=c.process,W=h("fetch"),H=T.f,V=H,X="process"==b(F),G=!!(U&&U.createEvent&&c.dispatchEvent),Y=I(P,(function(){if(!(w(M)!==String(M))){if(66===A)return!0;if(!X&&"function"!=typeof PromiseRejectionEvent)return!0}if(u&&!M.prototype.finally)return!0;if(A>=51&&/native code/.test(M))return!1;var t=M.resolve(1),e=function(t){t((function(){}),(function(){}))};return(t.constructor={})[N]=e,!(t.then((function(){}))instanceof e)})),K=Y||!x((function(t){M.all(t).catch((function(){}))})),$=function(t){var e;return!(!g(t)||"function"!=typeof(e=t.then))&&e},Z=function(t,e,n){if(!e.notified){e.notified=!0;var i=e.reactions;O((function(){for(var r=e.value,o=1==e.state,s=0;i.length>s;){var a,u,c,h=i[s++],l=o?h.ok:h.fail,f=h.resolve,d=h.reject,p=h.domain;try{l?(o||(2===e.rejection&&et(t,e),e.rejection=1),!0===l?a=r:(p&&p.enter(),a=l(r),p&&(p.exit(),c=!0)),a===h.promise?d(q("Promise-chain cycle")):(u=$(a))?u.call(a,f,d):f(a)):d(r)}catch(t){p&&!c&&p.exit(),d(t)}}e.reactions=[],e.notified=!1,n&&!e.rejection&&Q(t,e)}))}},J=function(t,e,n){var i,r;G?((i=U.createEvent("Event")).promise=e,i.reason=n,i.initEvent(t,!1,!0),c.dispatchEvent(i)):i={promise:e,reason:n},(r=c["on"+t])?r(i):"unhandledrejection"===t&&C("Unhandled promise rejection",n)},Q=function(t,e){S.call(c,(function(){var n,i=e.value;if(tt(e)&&(n=R((function(){X?F.emit("unhandledRejection",i,t):J("unhandledrejection",t,i)})),e.rejection=X||tt(e)?2:1,n.error))throw n.value}))},tt=function(t){return 1!==t.rejection&&!t.parent},et=function(t,e){S.call(c,(function(){X?F.emit("rejectionHandled",t):J("rejectionhandled",t,e.value)}))},nt=function(t,e,n,i){return function(r){t(e,n,r,i)}},it=function(t,e,n,i){e.done||(e.done=!0,i&&(e=i),e.value=n,e.state=2,Z(t,e,!0))},rt=function(t,e,n,i){if(!e.done){e.done=!0,i&&(e=i);try{if(t===n)throw q("Promise can't be resolved itself");var r=$(n);r?O((function(){var i={done:!1};try{r.call(n,nt(rt,t,i,e),nt(it,t,i,e))}catch(n){it(t,i,n,e)}})):(e.value=n,e.state=1,Z(t,e,!1))}catch(n){it(t,{done:!1},n,e)}}};Y&&(M=function(t){m(this,M,P),y(t),i.call(this);var e=D(this);try{t(nt(rt,this,e),nt(it,this,e))}catch(t){it(this,e,t)}},(i=function(t){z(this,{type:P,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=d(M.prototype,{then:function(t,e){var n=B(this),i=H(E(this,M));return i.ok="function"!=typeof t||t,i.fail="function"==typeof e&&e,i.domain=X?F.domain:void 0,n.parent=!0,n.reactions.push(i),0!=n.state&&Z(this,n,!1),i.promise},catch:function(t){return this.then(void 0,t)}}),r=function(){var t=new i,e=D(t);this.promise=t,this.resolve=nt(rt,t,e),this.reject=nt(it,t,e)},T.f=H=function(t){return t===M||t===o?new r(t):V(t)},u||"function"!=typeof l||(s=l.prototype.then,f(l.prototype,"then",(function(t,e){var n=this;return new M((function(t,e){s.call(n,t,e)})).then(t,e)}),{unsafe:!0}),"function"==typeof W&&a({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return _(M,W.apply(c,arguments))}}))),a({global:!0,wrap:!0,forced:Y},{Promise:M}),p(M,P,!1,!0),v(P),o=h(P),a({target:P,stat:!0,forced:Y},{reject:function(t){var e=H(this);return e.reject.call(void 0,t),e.promise}}),a({target:P,stat:!0,forced:u||Y},{resolve:function(t){return _(u&&this===o?M:this,t)}}),a({target:P,stat:!0,forced:K},{all:function(t){var e=this,n=H(e),i=n.resolve,r=n.reject,o=R((function(){var n=y(e.resolve),o=[],s=0,a=1;k(t,(function(t){var u=s++,c=!1;o.push(void 0),a++,n.call(e,t).then((function(t){c||(c=!0,o[u]=t,--a||i(o))}),r)})),--a||i(o)}));return o.error&&r(o.value),n.promise},race:function(t){var e=this,n=H(e),i=n.reject,r=R((function(){var r=y(e.resolve);k(t,(function(t){r.call(e,t).then(n.resolve,i)}))}));return r.error&&i(r.value),n.promise}})},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return s})),n.d(e,"d",(function(){return a})),n.d(e,"c",(function(){return u})),n.d(e,"e",(function(){return c}));n(7),n(14),n(200),n(16),n(31),n(61),n(11);var i=n(0),r=n(20);n(17);function o(t,e){var n,r,o=e.url,s=o.indexOf("://")>-1;t&&(r=Object(i.qs)(t,"head"),(n=Object(i.qs)(r,"base"))||(n=t.createElement("base"),r.insertBefore(n,r.firstChild)),!s&&window&&window.location&&(o=window.location.origin+o),n.setAttribute("href",o))}function s(t,e){var n,r,o=e.canonical;t&&(n=Object(i.qs)(t,"head"),(r=Object(i.qs)(n,"link[rel='canonical']"))?r.setAttribute("href",o):((r=t.createElement("link")).setAttribute("rel","canonical"),r.setAttribute("href",o),n.appendChild(r)))}function a(t,e){var n,r,o=e.idref;t&&(n=Object(i.qs)(t,"head"),(r=Object(i.qs)(n,"link[property='dc.identifier']"))?r.setAttribute("content",o):((r=t.createElement("meta")).setAttribute("name","dc.identifier"),r.setAttribute("content",o),n.appendChild(r)))}function u(t,e){var n=t.querySelectorAll("a[href]");if(n.length)for(var o=Object(i.qs)(t.ownerDocument,"base"),s=o?o.getAttribute("href"):void 0,a=function(t){var n=t.getAttribute("href");if(0!==n.indexOf("mailto:"))if(n.indexOf("://")>-1)t.setAttribute("target","_blank");else{var i;try{i=new r.a(n,s)}catch(t){}t.onclick=function(){return i&&i.hash?e(i.Path.path+i.hash):e(i?i.Path.path:n),!1}}}.bind(this),u=0;u<n.length;u++)a(n[u])}function c(t,e,n){return e.forEach((function(e,i){e&&n[i]&&(e=e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),t=t.replace(new RegExp(e,"g"),n[i]))})),t}},function(t,e,n){"use strict";var i=n(28),r=n(9),o=n(4),s=n(106),a=RegExp.prototype,u=a.toString,c=o((function(){return"/a/b"!=u.call({source:"a",flags:"b"})})),h="toString"!=u.name;(c||h)&&i(RegExp.prototype,"toString",(function(){var t=r(this),e=String(t.source),n=t.flags;return"/"+e+"/"+String(void 0===n&&t instanceof RegExp&&!("flags"in a)?s.call(t):n)}),{unsafe:!0})},function(t,e,n){var i=n(53),r=n(33);t.exports=function(t){return i(r(t))}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var i,r,o,s=n(158),a=n(6),u=n(8),c=n(27),h=n(13),l=n(72),f=n(54),d=a.WeakMap;if(s){var p=new d,v=p.get,g=p.has,y=p.set;i=function(t,e){return y.call(p,t,e),e},r=function(t){return v.call(p,t)||{}},o=function(t){return g.call(p,t)}}else{var m=l("state");f[m]=!0,i=function(t,e){return c(t,m,e),e},r=function(t){return h(t,m)?t[m]:{}},o=function(t){return h(t,m)}}t.exports={set:i,get:r,has:o,enforce:function(t){return o(t)?r(t):i(t,{})},getterFor:function(t){return function(e){var n;if(!u(e)||(n=r(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}}},function(t,e,n){var i=n(18),r=n(4),o=n(13),s=Object.defineProperty,a={},u=function(t){throw t};t.exports=function(t,e){if(o(a,t))return a[t];e||(e={});var n=[][t],c=!!o(e,"ACCESSORS")&&e.ACCESSORS,h=o(e,0)?e[0]:u,l=o(e,1)?e[1]:void 0;return a[t]=!!n&&!r((function(){if(c&&!i)return!0;var t={length:-1};c?s(t,1,{enumerable:!0,get:u}):t[1]=1,n.call(t,h,l)}))}},function(t,e,n){"use strict";var i=n(3),r=n(8),o=n(75),s=n(74),a=n(22),u=n(32),c=n(76),h=n(5),l=n(56),f=n(35),d=l("slice"),p=f("slice",{ACCESSORS:!0,0:0,1:2}),v=h("species"),g=[].slice,y=Math.max;i({target:"Array",proto:!0,forced:!d||!p},{slice:function(t,e){var n,i,h,l=u(this),f=a(l.length),d=s(t,f),p=s(void 0===e?f:e,f);if(o(l)&&("function"!=typeof(n=l.constructor)||n!==Array&&!o(n.prototype)?r(n)&&null===(n=n[v])&&(n=void 0):n=void 0,n===Array||void 0===n))return g.call(l,d,p);for(i=new(void 0===n?Array:n)(y(p-d,0)),h=0;d<p;d++,h++)d in l&&c(i,h,l[d]);return i.length=h,i}})},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var i=n(120),r=n(6),o=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?o(i[t])||o(r[t]):i[t]&&i[t][e]||r[t]&&r[t][e]}},function(t,e,n){"use strict";var i=n(83),r=n(110),o=n(9),s=n(33),a=n(133),u=n(108),c=n(22),h=n(84),l=n(82),f=n(4),d=[].push,p=Math.min,v=!f((function(){return!RegExp(4294967295,"y")}));i("split",2,(function(t,e,n){var i;return i="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,n){var i=String(s(this)),o=void 0===n?4294967295:n>>>0;if(0===o)return[];if(void 0===t)return[i];if(!r(t))return e.call(i,t,o);for(var a,u,c,h=[],f=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),p=0,v=new RegExp(t.source,f+"g");(a=l.call(v,i))&&!((u=v.lastIndex)>p&&(h.push(i.slice(p,a.index)),a.length>1&&a.index<i.length&&d.apply(h,a.slice(1)),c=a[0].length,p=u,h.length>=o));)v.lastIndex===a.index&&v.lastIndex++;return p===i.length?!c&&v.test("")||h.push(""):h.push(i.slice(p)),h.length>o?h.slice(0,o):h}:"0".split(void 0,0).length?function(t,n){return void 0===t&&0===n?[]:e.call(this,t,n)}:e,[function(e,n){var r=s(this),o=null==e?void 0:e[t];return void 0!==o?o.call(e,r,n):i.call(String(r),e,n)},function(t,r){var s=n(i,t,this,r,i!==e);if(s.done)return s.value;var l=o(t),f=String(this),d=a(l,RegExp),g=l.unicode,y=(l.ignoreCase?"i":"")+(l.multiline?"m":"")+(l.unicode?"u":"")+(v?"y":"g"),m=new d(v?l:"^(?:"+l.source+")",y),b=void 0===r?4294967295:r>>>0;if(0===b)return[];if(0===f.length)return null===h(m,f)?[f]:[];for(var w=0,k=0,x=[];k<f.length;){m.lastIndex=v?k:0;var E,S=h(m,v?f:f.slice(k));if(null===S||(E=p(c(m.lastIndex+(v?0:k)),f.length))===w)k=u(f,k,g);else{if(x.push(f.slice(w,k)),x.length===b)return x;for(var O=1;O<=S.length-1;O++)if(x.push(S[O]),x.length===b)return x;k=w=E}}return x.push(f.slice(w)),x}]}),!v)},function(t,e,n){"use strict";var i=n(3),r=n(63).map,o=n(56),s=n(35),a=o("map"),u=s("map");i({target:"Array",proto:!0,forced:!a||!u},{map:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){var i=n(18),r=n(21).f,o=Function.prototype,s=o.toString,a=/^\s*function ([^ (]*)/;i&&!("name"in o)&&r(o,"name",{configurable:!0,get:function(){try{return s.call(this).match(a)[1]}catch(t){return""}}})},function(t,e){var n=Math.ceil,i=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?i:n)(t)}},function(t,e,n){var i=n(21).f,r=n(13),o=n(5)("toStringTag");t.exports=function(t,e,n){t&&!r(t=n?t:t.prototype,o)&&i(t,o,{configurable:!0,value:e})}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},function(t,e,n){var i=n(18),r=n(89),o=n(46),s=n(32),a=n(71),u=n(13),c=n(117),h=Object.getOwnPropertyDescriptor;e.f=i?h:function(t,e){if(t=s(t),e=a(e,!0),c)try{return h(t,e)}catch(t){}if(u(t,e))return o(!r.f.call(t,e),t[e])}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){t.exports=!1},function(t,e,n){"use strict";n(19);var i,r=n(3),o=n(18),s=n(143),a=n(6),u=n(124),c=n(28),h=n(80),l=n(13),f=n(144),d=n(192),p=n(107).codeAt,v=n(193),g=n(43),y=n(194),m=n(34),b=a.URL,w=y.URLSearchParams,k=y.getState,x=m.set,E=m.getterFor("URL"),S=Math.floor,O=Math.pow,_=/[A-Za-z]/,C=/[\d+-.A-Za-z]/,T=/\d/,R=/^(0x|0X)/,j=/^[0-7]+$/,I=/^\d+$/,L=/^[\dA-Fa-f]+$/,A=/[\u0000\u0009\u000A\u000D #%/:?@[\\]]/,N=/[\u0000\u0009\u000A\u000D #/:?@[\\]]/,P=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,D=/[\u0009\u000A\u000D]/g,z=function(t,e){var n,i,r;if("["==e.charAt(0)){if("]"!=e.charAt(e.length-1))return"Invalid host";if(!(n=M(e.slice(1,-1))))return"Invalid host";t.host=n}else if(G(t)){if(e=v(e),A.test(e))return"Invalid host";if(null===(n=B(e)))return"Invalid host";t.host=n}else{if(N.test(e))return"Invalid host";for(n="",i=d(e),r=0;r<i.length;r++)n+=V(i[r],U);t.host=n}},B=function(t){var e,n,i,r,o,s,a,u=t.split(".");if(u.length&&""==u[u.length-1]&&u.pop(),(e=u.length)>4)return t;for(n=[],i=0;i<e;i++){if(""==(r=u[i]))return t;if(o=10,r.length>1&&"0"==r.charAt(0)&&(o=R.test(r)?16:8,r=r.slice(8==o?1:2)),""===r)s=0;else{if(!(10==o?I:8==o?j:L).test(r))return t;s=parseInt(r,o)}n.push(s)}for(i=0;i<e;i++)if(s=n[i],i==e-1){if(s>=O(256,5-e))return null}else if(s>255)return null;for(a=n.pop(),i=0;i<n.length;i++)a+=n[i]*O(256,3-i);return a},M=function(t){var e,n,i,r,o,s,a,u=[0,0,0,0,0,0,0,0],c=0,h=null,l=0,f=function(){return t.charAt(l)};if(":"==f()){if(":"!=t.charAt(1))return;l+=2,h=++c}for(;f();){if(8==c)return;if(":"!=f()){for(e=n=0;n<4&&L.test(f());)e=16*e+parseInt(f(),16),l++,n++;if("."==f()){if(0==n)return;if(l-=n,c>6)return;for(i=0;f();){if(r=null,i>0){if(!("."==f()&&i<4))return;l++}if(!T.test(f()))return;for(;T.test(f());){if(o=parseInt(f(),10),null===r)r=o;else{if(0==r)return;r=10*r+o}if(r>255)return;l++}u[c]=256*u[c]+r,2!=++i&&4!=i||c++}if(4!=i)return;break}if(":"==f()){if(l++,!f())return}else if(f())return;u[c++]=e}else{if(null!==h)return;l++,h=++c}}if(null!==h)for(s=c-h,c=7;0!=c&&s>0;)a=u[c],u[c--]=u[h+s-1],u[h+--s]=a;else if(8!=c)return;return u},q=function(t){var e,n,i,r;if("number"==typeof t){for(e=[],n=0;n<4;n++)e.unshift(t%256),t=S(t/256);return e.join(".")}if("object"==typeof t){for(e="",i=function(t){for(var e=null,n=1,i=null,r=0,o=0;o<8;o++)0!==t[o]?(r>n&&(e=i,n=r),i=null,r=0):(null===i&&(i=o),++r);return r>n&&(e=i,n=r),e}(t),n=0;n<8;n++)r&&0===t[n]||(r&&(r=!1),i===n?(e+=n?":":"::",r=!0):(e+=t[n].toString(16),n<7&&(e+=":")));return"["+e+"]"}return t},U={},F=f({},U,{" ":1,'"':1,"<":1,">":1,"`":1}),W=f({},F,{"#":1,"?":1,"{":1,"}":1}),H=f({},W,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),V=function(t,e){var n=p(t,0);return n>32&&n<127&&!l(e,t)?t:encodeURIComponent(t)},X={ftp:21,file:null,http:80,https:443,ws:80,wss:443},G=function(t){return l(X,t.scheme)},Y=function(t){return""!=t.username||""!=t.password},K=function(t){return!t.host||t.cannotBeABaseURL||"file"==t.scheme},$=function(t,e){var n;return 2==t.length&&_.test(t.charAt(0))&&(":"==(n=t.charAt(1))||!e&&"|"==n)},Z=function(t){var e;return t.length>1&&$(t.slice(0,2))&&(2==t.length||"/"===(e