(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)})('undefined'==typeof self?this:self,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=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=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;sn.spinePos)return 1;if(t.spinePoso[d].index)return 1;if(a[d].indexr.offset?1:s.offset')}},{key:'textNodes',value:function(e,t){return Array.prototype.slice.call(e.childNodes).filter(function(e){return e.nodeType===l||t&&e.classList.contains(t)})}},{key:'walkToNode',value:function(e,t,n){var a=t||document,o=a.documentElement,r=e.length,l,d,u;for(u=0;uc)t-=c;else{i=u.nodeType===r?u.childNodes[0]:u;break}}return{container:i,offset:t}}},{key:'toRange',value:function(e,t){var n=e||document,a=this,i=!!t&&null!=n.querySelector('.'+t),o,r,l,d,u,c,p,h;if(o='undefined'==typeof n.createRange?new s.RangeObject:n.createRange(),a.range?(r=a.start,c=a.path.steps.concat(r.steps),d=this.findNode(c,n,i?t:null),l=a.end,p=a.path.steps.concat(l.steps),u=this.findNode(p,n,i?t:null)):(r=a.path,c=a.path.steps,d=this.findNode(a.path.steps,n,i?t:null)),d)try{null==r.terminal.offset?o.setStart(d,0):o.setStart(d,r.terminal.offset)}catch(a){h=this.fixMiss(c,r.terminal.offset,n,i?t:null),o.setStart(h.container,h.offset)}else return console.log('No startContainer found for',this.toString()),null;if(u)try{null==l.terminal.offset?o.setEnd(u,0):o.setEnd(u,l.terminal.offset)}catch(s){h=this.fixMiss(p,a.end.terminal.offset,n,i?t:null),o.setEnd(h.container,h.offset)}return o}},{key:'isCfiString',value:function(e){return'string'==typeof e&&0===e.indexOf('epubcfi(')&&')'===e[e.length-1]}},{key:'generateChapterComponent',value:function(e,t,n){var a=parseInt(t),i='/'+2*(e+1)+'/';return i+=2*(a+1),n&&(i+='['+n+']'),i}},{key:'collapse',value:function(e){this.range&&(this.range=!1,e?(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))}}]),e}();t.default=d,e.exports=t['default']},function(e,t,n){'use strict';var a=n(27),o=n(41),s=Function.prototype.apply,r=Function.prototype.call,i=Object.create,l=Object.defineProperty,d=Object.defineProperties,u=Object.prototype.hasOwnProperty,c={configurable:!0,enumerable:!1,writable:!0},p,h,g,f,m,y,v;p=function(e,t){var n;return o(t),u.call(this,'__ee__')?n=this.__ee__:(n=c.value=i(null),l(this,'__ee__',c),c.value=null),n[e]?'object'==typeof n[e]?n[e].push(t):n[e]=[n[e],t]:n[e]=t,this},h=function(e,t){var n,a;return o(t),a=this,p.call(this,e,n=function(){g.call(a,e,n),s.call(t,this,arguments)}),n.__eeOnceListener__=t,this},g=function(e,t){var n,a,s,r;if(o(t),!u.call(this,'__ee__'))return this;if(n=this.__ee__,!n[e])return this;if(a=n[e],'object'==typeof a)for(r=0;s=a[r];++r)(s===t||s.__eeOnceListener__===t)&&(2===a.length?n[e]=a[r?0:1]:a.splice(r,1));else(a===t||a.__eeOnceListener__===t)&&delete n[e];return this},f=function(e){var t,n,a,i,o;if(u.call(this,'__ee__')&&(i=this.__ee__[e],!!i))if('object'==typeof i){for(n=arguments.length,o=Array(n-1),t=1;tn.length||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(2c){if(47===n.charCodeAt(l+h))return n.slice(l+h+1);if(0==h)return n.slice(l+h)}else r>c&&(47===e.charCodeAt(a+h)?p=h:0==h&&(p=0));break}var i=e.charCodeAt(a+h),g=n.charCodeAt(l+h);if(i!==g)break;else 47===i&&(p=h)}var f='';for(h=a+p+1;h<=o;++h)(h===o||47===e.charCodeAt(h))&&(f+=0===f.length?'..':'/..');return 0=s;--c){if(a=e.charCodeAt(c),47===a){if(!u){l=c+1;break}continue}-1==d&&(u=!1,d=c+1),46===a?-1==r?r=c:1!=i&&(i=1):-1!=r&&(i=-1)}return-1==r||-1==d||0==i||1==i&&r==d-1&&r==l+1?-1!=d&&(0==l&&o?n.base=n.name=e.slice(1,d):n.base=n.name=e.slice(l,d)):(0==l&&o?(n.name=e.slice(1,r),n.base=e.slice(1,d)):(n.name=e.slice(l,r),n.base=e.slice(l,d)),n.ext=e.slice(r,d)),0this.container.scrollWidth&&(t=this.container.scrollWidth-this.layout.delta)):n=e.top,this.scrollTo(t,n,!0)}},{key:'add',value:function(e){var t=this,n=this.createView(e);return this.views.append(n),n.onDisplayed=this.afterDisplayed.bind(this),n.onResize=this.afterResized.bind(this),n.on(b.EVENTS.VIEWS.AXIS,function(e){t.updateAxis(e)}),n.display(this.request)}},{key:'append',value:function(e){var t=this,n=this.createView(e);return this.views.append(n),n.onDisplayed=this.afterDisplayed.bind(this),n.onResize=this.afterResized.bind(this),n.on(b.EVENTS.VIEWS.AXIS,function(e){t.updateAxis(e)}),n.display(this.request)}},{key:'prepend',value:function(e){var t=this,n=this.createView(e);return n.on(b.EVENTS.VIEWS.RESIZED,function(e){t.counter(e)}),this.views.prepend(n),n.onDisplayed=this.afterDisplayed.bind(this),n.onResize=this.afterResized.bind(this),n.on(b.EVENTS.VIEWS.AXIS,function(e){t.updateAxis(e)}),n.display(this.request)}},{key:'counter',value:function(e){'vertical'===this.settings.axis?this.scrollBy(0,e.heightDelta,!0):this.scrollBy(e.widthDelta,0,!0)}},{key:'next',value:function(){var e=this.settings.direction,t,n;if(this.views.length){if(this.isPaginated&&'horizontal'===this.settings.axis&&(!e||'ltr'===e))this.scrollLeft=this.container.scrollLeft,n=this.container.scrollLeft+this.container.offsetWidth+this.layout.delta,n<=this.container.scrollWidth?this.scrollBy(this.layout.delta,0,!0):t=this.views.last().section.next();else if(this.isPaginated&&'horizontal'===this.settings.axis&&'rtl'===e)this.scrollLeft=this.container.scrollLeft,n=this.container.scrollLeft,0p&&(g=p,r=g-h);var f=e.layout.count(p,o).pages,m=a(h/o),y=[],v=a(g/o);y=[];for(var b=m,i;b<=v;b++)i=b+1,y.push(i);var k=e.mapping.page(t.contents,t.section.cfiBase,h,g);return{index:d,href:u,pages:y,totalPages:f,mapping:k}});return i}},{key:'paginatedLocation',value:function(){var e=this,t=this.visible(),n=this.container.getBoundingClientRect(),a=0,o=0;this.fullsize&&(a=window.scrollX);var i=t.map(function(t){var r=t.section,l=r.index,d=r.href,u=t.offset().left,c=t.position().left,p=t.width(),h=a+n.left-c+o,g=h+e.layout.width-o,f=e.mapping.page(t.contents,t.section.cfiBase,h,g),m=e.layout.count(p).pages,y=s(h/e.layout.pageWidth),v=[],b=s(g/e.layout.pageWidth);if(0>y&&(y=0,++b),'rtl'===e.settings.direction){var k=y;y=m-b,b=m-k}for(var x=y+1,i;x<=b;x++)i=x,v.push(i);return{index:l,href:d,pages:v,totalPages:m,mapping:f}});return i}},{key:'isVisible',value:function(e,t,n,a){var i=e.position(),o=a||this.bounds();return'horizontal'===this.settings.axis&&i.right>o.left-t&&i.lefto.top-t&&i.top=a.end.displayed.total&&(a.atEnd=!0),t.index===this.book.spine.first().index&&1===a.start.displayed.page&&(a.atStart=!0),a}},{key:'destroy',value:function(){this.manager&&this.manager.destroy(),this.book=void 0}},{key:'passEvents',value:function(t){var n=this,e=x.default.listenedEvents;e.forEach(function(a){t.on(a,function(e){return n.triggerViewEvent(e,t)})}),t.on(w.EVENTS.CONTENTS.SELECTED,function(a){return n.triggerSelectedEvent(a,t)})}},{key:'triggerViewEvent',value:function(t,e){this.emit(t.type,t,e)}},{key:'triggerSelectedEvent',value:function(e,t){this.emit(w.EVENTS.RENDITION.SELECTED,e,t)}},{key:'triggerMarkEvent',value:function(e,t,n){this.emit(w.EVENTS.RENDITION.MARK_CLICKED,e,t,n)}},{key:'getRange',value:function(e,t){var n=new h.default(e),a=this.manager.visible().filter(function(e){if(n.spinePos===e.index)return!0});if(a.length)return a[0].contents.range(n,t)}},{key:'adjustImages',value:function(e){return'pre-paginated'===this._layout.name?new Promise(function(e){e()}):(e.addStylesheetRules({img:{"max-width":(this._layout.columnWidth?this._layout.columnWidth+'px':'100%')+'!important',"max-height":(this._layout.height?0.6*this._layout.height+'px':'60%')+'!important',"object-fit":'contain',"page-break-inside":'avoid'},svg:{"max-width":(this._layout.columnWidth?this._layout.columnWidth+'px':'100%')+'!important',"max-height":(this._layout.height?0.6*this._layout.height+'px':'60%')+'!important',"page-break-inside":'avoid'}}),new Promise(function(e){setTimeout(function(){e()},1)}))}},{key:'getContents',value:function(){return this.manager?this.manager.getContents():[]}},{key:'views',value:function(){var e=this.manager?this.manager.views:void 0;return e||[]}},{key:'handleLinks',value:function(e){var t=this;e&&e.on(w.EVENTS.CONTENTS.LINK_CLICKED,function(e){var n=t.book.path.relative(e);t.display(n)})}},{key:'injectStylesheet',value:function(e){var t=e.createElement('link');t.setAttribute('type','text/css'),t.setAttribute('rel','stylesheet'),t.setAttribute('href',this.settings.stylesheet),e.getElementsByTagName('head')[0].appendChild(t)}},{key:'injectScript',value:function(e){var t=e.createElement('script');t.setAttribute('type','text/javascript'),t.setAttribute('src',this.settings.script),t.textContent=' ',e.getElementsByTagName('head')[0].appendChild(t)}},{key:'injectIdentifier',value:function(e){var t=this.book.package.metadata.identifier,n=e.createElement('meta');n.setAttribute('name','dc.relation.ispartof'),t&&n.setAttribute('content',t),e.getElementsByTagName('head')[0].appendChild(n)}}]),e}();(0,l.default)(P.prototype),t.default=P,e.exports=t['default']},function(e,t,n){'use strict';function o(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}Object.defineProperty(t,'__esModule',{value:!0});var s=function(){function e(e,t){for(var n=0,a;n=t&&s<=n)return e;if(r>t)return e;o=e,i.push(e)}else if(a.horizontal&&'rtl'===a.direction){if(s=u.left,r=u.right,r<=n&&r>=t)return e;if(s=t&&l<=n)return e;if(d>t)return e;o=e,i.push(e)}}),r)return this.findTextStartRange(r,t,n);return this.findTextStartRange(o,t,n)}},{key:'findEnd',value:function(e,t,n){for(var a=this,o=[e],s=e,r,l;o.length;)if(r=o.shift(),l=this.walk(r,function(e){var r,l,d,u,c;if(c=a.getBounds(e),a.horizontal&&'ltr'===a.direction){if(r=i(c.left),l=i(c.right),r>n&&s)return s;if(l>n)return e;s=e,o.push(e)}else if(a.horizontal&&'rtl'===a.direction){if(r=i(a.horizontal?c.left:c.top),l=i(a.horizontal?c.right:c.bottom),ln&&s)return s;if(u>n)return e;s=e,o.push(e)}}),l)return this.findTextEndRange(l,t,n);return this.findTextEndRange(s,t,n)}},{key:'findTextStartRange',value:function(e,t,n){for(var a=this.splitTextNodeIntoRanges(e),o=0,i,s,r,l,d;o=t)return i;}else if(this.horizontal&&'rtl'===this.direction){if(d=s.right,d<=n)return i;}else if(l=s.top,l>=t)return i;return a[0]}},{key:'findTextEndRange',value:function(e,t,n){for(var a=this.splitTextNodeIntoRanges(e),o=0,i,s,r,l,d,u,c;on&&i)return i;if(d>n)return s}else if(this.horizontal&&'rtl'===this.direction){if(l=r.left,d=r.right,dn&&i)return i;if(c>n)return s}i=s}return a[a.length-1]}},{key:'splitTextNodeIntoRanges',value:function(e,t){var n=[],a=e.textContent||'',i=a.trim(),o=e.ownerDocument,s=t||' ',r=i.indexOf(s),l;if(-1===r||e.nodeType!=Node.TEXT_NODE)return l=o.createRange(),l.selectNodeContents(e),[l];for(l=o.createRange(),l.setStart(e,0),l.setEnd(e,r),n.push(l),l=!1;-1!=r;)r=i.indexOf(s,r+1),0=t||0>n||y&&a>=x}function p(){var e=i();return c(e)?h(e):void(_=setTimeout(p,u(e)))}function h(e){return(_=void 0,v&&b)?l(e):(b=k=void 0,E)}function g(){var e=i(),n=c(e);if(b=arguments,k=this,w=e,n){if(void 0===_)return d(w);if(y)return _=setTimeout(p,t),l(w)}return void 0===_&&(_=setTimeout(p,t)),E}var f=0,m=!1,y=!1,v=!0,b,k,x,E,_,w;if('function'!=typeof e)throw new TypeError('Expected a function');return t=s(t)||0,a(n)&&(m=!!n.leading,y='maxWait'in n,x=y?o(s(n.maxWait)||0,t):x,v='trailing'in n?!!n.trailing:v),g.cancel=function(){void 0!==_&&clearTimeout(_),f=0,b=w=k=_=void 0},g.flush=function(){return void 0===_?E:h(i())},g}},function(e,t,n){var a=n(59),i='object'==typeof self&&self&&self.Object===Object&&self,o=a||i||Function('return this')();e.exports=o},function(e,t,n){var a=n(22),i=a.Symbol;e.exports=i},function(e,t,n){'use strict';function a(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function o(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)?t:e}function r(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)}Object.defineProperty(t,'__esModule',{value:!0});var l=function(){function e(e,t){for(var n=0,a;n=h&&(o&&l?g():f()),0>c-s&&(o&&l?f():g());var m=i.map(function(e){return e.displayed});return i.length?Promise.all(m).then(function(){if('pre-paginated'===n.layout.name&&n.layout.props.spread)return n.check()}).then(function(){return n.update(s)},function(e){return e}):(this.q.enqueue(function(){this.update()}.bind(this)),a.resolve(!1),a.promise)}},{key:'trim',value:function(){for(var e=new d.defer,t=this.views.displayed(),n=t[0],a=t[t.length-1],o=this.views.indexOf(n),s=this.views.indexOf(a),r=this.views.slice(0,o),l=this.views.slice(s+1),u=0;uarguments.length||'string'!=typeof t?(d=n,n=t,t=null):d=arguments[2],null==t?(o=l=!0,r=!1):(o=s.call(t,'c'),r=s.call(t,'e'),l=s.call(t,'w')),u={value:n,configurable:o,enumerable:r,writable:l},d?a(i(d),u):u},r.gs=function(t,n,r){var l,d,u,p;return'string'==typeof t?u=arguments[3]:(u=r,r=n,n=t,t=null),null==n?n=void 0:o(n)?null==r?r=void 0:!o(r)&&(u=r,r=void 0):(u=n,n=r=void 0),null==t?(l=!0,d=!1):(l=s.call(t,'c'),d=s.call(t,'e')),p={get:n,set:r,configurable:l,enumerable:d},u?a(i(u),p):p}},function(e,t,n){'use strict';e.exports=n(29)()?Object.assign:n(30)},function(e){'use strict';e.exports=function(){var e=Object.assign,t;return!('function'!=typeof e)&&(t={foo:'raz'},e(t,{bar:'dwa'},{trzy:'trzy'}),'razdwatrzy'===t.foo+t.bar+t.trzy)}},function(e,t,n){'use strict';var a=n(31),s=n(35);e.exports=function(e,t){var n=o(arguments.length,2),r,l,i;for(e=Object(s(e)),i=function(n){try{e[n]=t[n]}catch(t){r||(r=t)}},l=1;ln&&(s+=n,i=n);i=n)s+=n-i,i=n;else{i+=o,d.endContainer=e,d.endOffset=i;var r=new c.default(d,t).toString();a.push(r),s=0}u=e}.bind(this)),d&&d.startContainer&&u){d.endContainer=u,d.endOffset=u.length;var p=new c.default(d,t).toString();a.push(p),s=0}return a}},{key:'locationFromCfi',value:function(e){var t;return(c.default.prototype.isCfiString(e)&&(e=new c.default(e)),0===this._locations.length)?-1:(t=(0,r.locationOf)(e,this._locations,this.epubcfi.compare),t>this.total?this.total:t)}},{key:'percentageFromCfi',value:function(e){if(0===this._locations.length)return null;var t=this.locationFromCfi(e);return this.percentageFromLocation(t)}},{key:'percentageFromLocation',value:function(e){return e&&this.total?e/this.total:0}},{key:'cfiFromLocation',value:function(e){var t=-1;return'number'!=typeof e&&(e=parseInt(e)),0<=e&&e=this._minSpreadWidth?2:1,'reflowable'!==this.name||'paginated'!==this._flow||0<=n||(i=0==l%2?l:l-1),'pre-paginated'===this.name&&(i=0),1=e.left&&t.top>=e.top&&t.bottom<=e.bottom}var u='function'==typeof Symbol&&'symbol'==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&'function'==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?'symbol':typeof e};Object.defineProperty(t,'__esModule',{value:!0}),t.Underline=t.Highlight=t.Mark=t.Pane=void 0;var c=function e(t,n,a){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(i===void 0){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,a)}if('value'in i)return i.value;var s=i.get;return void 0===s?void 0:s.call(a)},p=function(){function e(e,t){for(var n=0,a;nn&&r>t}var s=t.getBoundingClientRect(),r=e.getBoundingClientRect();if(!o(r,n,a))return!1;for(var l=e.getClientRects(),d=0,i=l.length;dt&&-1==[34,35,60,62,63,96].indexOf(t)?e:encodeURIComponent(e)}function s(e){var t=e.charCodeAt(0);return 32t&&-1==[34,35,60,62,96].indexOf(t)?e:encodeURIComponent(e)}function i(e,r,l){function d(e){x.push(e)}var m=r||'scheme start',y=0,v='',b=!1,k=!1,x=[];loop:for(;(e[y-1]!=f||0==y)&&!this._isInvalid;){var E=e[y];switch(m){case'scheme start':if(E&&h.test(E))v+=E.toLowerCase(),m='scheme';else if(!r){v='',m='no scheme';continue}else{d('Invalid scheme.');break loop}break;case'scheme':if(E&&g.test(E))v+=E.toLowerCase();else if(':'==E){if(this._scheme=v,v='',r)break loop;t(this._scheme)&&(this._isRelative=!0),m='file'==this._scheme?'relative':this._isRelative&&l&&l._scheme==this._scheme?'relative or authority':this._isRelative?'authority first slash':'scheme data'}else if(!r){v='',y=0,m='no scheme';continue}else if(f==E)break loop;else{d('Code point not allowed in scheme: '+E);break loop}break;case'scheme data':'?'==E?(this._query='?',m='query'):'#'==E?(this._fragment='#',m='fragment'):f!=E&&'\t'!=E&&'\n'!=E&&'\r'!=E&&(this._schemeData+=o(E));break;case'no scheme':if(!l||!t(l._scheme))d('Missing scheme.'),n.call(this);else{m='relative';continue}break;case'relative or authority':if('/'==E&&'/'==e[y+1])m='authority ignore slashes';else{d('Expected /, got: '+E),m='relative';continue}break;case'relative':if(this._isRelative=!0,'file'!=this._scheme&&(this._scheme=l._scheme),f==E){this._host=l._host,this._port=l._port,this._path=l._path.slice(),this._query=l._query,this._username=l._username,this._password=l._password;break loop}else if('/'==E||'\\'==E)'\\'==E&&d('\\ is an invalid code point.'),m='relative slash';else if('?'==E)this._host=l._host,this._port=l._port,this._path=l._path.slice(),this._query='?',this._username=l._username,this._password=l._password,m='query';else if('#'==E)this._host=l._host,this._port=l._port,this._path=l._path.slice(),this._query=l._query,this._fragment='#',this._username=l._username,this._password=l._password,m='fragment';else{var c=e[y+1],_=e[y+2];'file'==this._scheme&&h.test(E)&&(':'==c||'|'==c)&&(f==_||'/'==_||'\\'==_||'?'==_||'#'==_)||(this._host=l._host,this._port=l._port,this._username=l._username,this._password=l._password,this._path=l._path.slice(),this._path.pop()),m='relative path';continue}break;case'relative slash':if('/'==E||'\\'==E)'\\'==E&&d('\\ is an invalid code point.'),m='file'==this._scheme?'file host':'authority ignore slashes';else{'file'!=this._scheme&&(this._host=l._host,this._port=l._port,this._username=l._username,this._password=l._password),m='relative path';continue}break;case'authority first slash':if('/'==E)m='authority second slash';else{d('Expected \'/\', got: '+E),m='authority ignore slashes';continue}break;case'authority second slash':if(m='authority ignore slashes','/'!=E){d('Expected \'/\', got: '+E);continue}break;case'authority ignore slashes':if('/'!=E&&'\\'!=E){m='authority';continue}else d('Expected authority, got: '+E);break;case'authority':if('@'==E){b&&(d('@ already seen.'),v+='%40'),b=!0;for(var w=0,i;w