l[n+1]&&(c=r,r=n,n=c,c=i,i=o,o=c),l[n+1]>l[a+1]&&(c=n,n=a,a=c,c=o,o=s,s=c),l[r+1]>l[n+1]&&(c=r,r=n,n=c,c=i,i=o,o=c);var d=(l[r]+t.offsetX)*t.scaleX,p=(l[r+1]+t.offsetY)*t.scaleY,g=(l[n]+t.offsetX)*t.scaleX,m=(l[n+1]+t.offsetY)*t.scaleY,v=(l[a]+t.offsetX)*t.scaleX,y=(l[a+1]+t.offsetY)*t.scaleY;if(!(p>=y))for(var b,w,k,S,_,A,x,C,P=u[i],T=u[i+1],E=u[i+2],R=u[o],O=u[o+1],I=u[o+2],F=u[s],L=u[s+1],M=u[s+2],N=Math.round(p),D=Math.round(y),B=N;B<=D;B++){if(By?1:m===y?0:(m-B)/(m-y)),w=R-(R-F)*U,k=O-(O-L)*U,S=I-(I-M)*U}var q=void 0;_=d-(d-v)*(q=By?1:(p-B)/(p-y)),A=P-(P-F)*q,x=T-(T-L)*q,C=E-(E-M)*q;for(var z=Math.round(Math.min(b,_)),G=Math.round(Math.max(b,_)),W=f*B+4*z,H=z;H<=G;H++)(q=(b-H)/(b-_))<0?q=0:q>1&&(q=1),h[W++]=w-(w-A)*q|0,h[W++]=k-(k-x)*q|0,h[W++]=S-(S-C)*q|0,h[W++]=255}}function t(t,r,n){var a,i,o=r.coords,s=r.colors;switch(r.type){case"lattice":var c=r.verticesPerRow,l=Math.floor(o.length/c)-1,u=c-1;for(a=0;a=n?a=n:r=a/e,{scale:r,size:a}},clipBbox:function(e,t,r,n,a,i){if(Array.isArray(t)&&4===t.length){var o=a-r,s=i-n;e.ctx.rect(r,n,o,s),e.clip(),e.endPath()}},setFillAndStrokeStyleToContext:function(r,a,i){var o=r.ctx,s=r.current;switch(a){case e:var c=this.ctx;o.fillStyle=c.fillStyle,o.strokeStyle=c.strokeStyle,s.fillColor=c.fillStyle,s.strokeColor=c.strokeStyle;break;case t:var l=n.Util.makeCssRgb(i[0],i[1],i[2]);o.fillStyle=l,o.strokeStyle=l,s.fillColor=l,s.strokeColor=l;break;default:throw new n.FormatError("Unsupported paint type: ".concat(a))}},getPattern:function(e,t){(e=this.ctx).setTransform.apply(e,this.baseTransform),e.transform.apply(e,this.matrix);var r=this.createPatternCanvas(t);return e.createPattern(r,"repeat")}},r}();t.TilingPattern=s},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalWorkerOptions=void 0;var n=Object.create(null);t.GlobalWorkerOptions=n,n.workerPort=void 0===n.workerPort?null:n.workerPort,n.workerSrc=void 0===n.workerSrc?"":n.workerSrc},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.MessageHandler=void 0;var n,a=(n=r(2))&&n.__esModule?n:{default:n},i=r(5);function o(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,a)}function s(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:1,s=arguments.length>2?arguments[2]:void 0;if(!this.isCancelled){var c=this.desiredSize;this.desiredSize-=r,c>0&&this.desiredSize<=0&&(this.sinkCapability=(0,i.createPromiseCapability)(),this.ready=this.sinkCapability.promise),t._postMessage({sourceName:a,targetName:o,stream:p,streamId:n,chunk:e},s)}},close:function(){this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:a,targetName:o,stream:d,streamId:n}),delete t.streamSinks[n])},error:function(e){(0,i.assert)(e instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:a,targetName:o,stream:g,streamId:n,reason:b(e)}))},sinkCapability:(0,i.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};c.sinkCapability.resolve(),c.ready=c.sinkCapability.promise,this.streamSinks[n]=c,new Promise((function(t){t(r(e.data,c))})).then((function(){s.postMessage({sourceName:a,targetName:o,stream:y,streamId:n,success:!0})}),(function(e){s.postMessage({sourceName:a,targetName:o,stream:y,streamId:n,reason:b(e)})}))}},{key:"_processStreamMessage",value:function(e){var t=e.streamId,r=this.sourceName,n=e.sourceName,a=this.comObj;switch(e.stream){case y:e.success?this.streamControllers[t].startCall.resolve():this.streamControllers[t].startCall.reject(b(e.reason));break;case v:e.success?this.streamControllers[t].pullCall.resolve():this.streamControllers[t].pullCall.reject(b(e.reason));break;case m:if(!this.streamSinks[t]){a.postMessage({sourceName:r,targetName:n,stream:v,streamId:t,success:!0});break}this.streamSinks[t].desiredSize<=0&&e.desiredSize>0&&this.streamSinks[t].sinkCapability.resolve(),this.streamSinks[t].desiredSize=e.desiredSize;var o=this.streamSinks[e.streamId].onPull;new Promise((function(e){e(o&&o())})).then((function(){a.postMessage({sourceName:r,targetName:n,stream:v,streamId:t,success:!0})}),(function(e){a.postMessage({sourceName:r,targetName:n,stream:v,streamId:t,reason:b(e)})}));break;case p:if((0,i.assert)(this.streamControllers[t],"enqueue should have stream controller"),this.streamControllers[t].isClosed)break;this.streamControllers[t].controller.enqueue(e.chunk);break;case d:if((0,i.assert)(this.streamControllers[t],"close should have stream controller"),this.streamControllers[t].isClosed)break;this.streamControllers[t].isClosed=!0,this.streamControllers[t].controller.close(),this._deleteStreamController(t);break;case g:(0,i.assert)(this.streamControllers[t],"error should have stream controller"),this.streamControllers[t].controller.error(b(e.reason)),this._deleteStreamController(t);break;case f:e.success?this.streamControllers[t].cancelCall.resolve():this.streamControllers[t].cancelCall.reject(b(e.reason)),this._deleteStreamController(t);break;case h:if(!this.streamSinks[t])break;var s=this.streamSinks[e.streamId].onCancel;new Promise((function(t){t(s&&s(b(e.reason)))})).then((function(){a.postMessage({sourceName:r,targetName:n,stream:f,streamId:t,success:!0})}),(function(e){a.postMessage({sourceName:r,targetName:n,stream:f,streamId:t,reason:b(e)})})),this.streamSinks[t].sinkCapability.reject(b(e.reason)),this.streamSinks[t].isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}},{key:"_deleteStreamController",value:(c=a.default.mark((function e(t){return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.allSettled([this.streamControllers[t].startCall,this.streamControllers[t].pullCall,this.streamControllers[t].cancelCall].map((function(e){return e&&e.promise})));case 2:delete this.streamControllers[t];case 3:case"end":return e.stop()}}),e,this)})),w=function(){var e=this,t=arguments;return new Promise((function(r,n){var a=c.apply(e,t);function i(e){o(a,r,n,i,s,"next",e)}function s(e){o(a,r,n,i,s,"throw",e)}i(void 0)}))},function(e){return w.apply(this,arguments)})},{key:"_postMessage",value:function(e,t){t&&this.postMessageTransfers?this.comObj.postMessage(e,t):this.comObj.postMessage(e)}},{key:"destroy",value:function(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}],r&&s(t.prototype,r),n&&s(t,n),e}();t.MessageHandler=w},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.Metadata=void 0;var n=r(5),a=r(206);function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){a=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(a)throw i}}return r}}(e,t)||o(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){if(e){if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r\\376\\377([^<]+)/g,(function(e,t){for(var r=t.replace(/\\([0-3])([0-7])([0-7])/g,(function(e,t,r,n){return String.fromCharCode(64*t+8*r+1*n)})).replace(/&(amp|apos|gt|lt|quot);/g,(function(e,t){switch(t){case"amp":return"&";case"apos":return"'";case"gt":return">";case"lt":return"<";case"quot":return'"'}throw new Error("_repair: ".concat(t," isn't defined."))})),n="",a=0,i=r.length;a=32&&o<127&&60!==o&&62!==o&&38!==o?String.fromCharCode(o):""+(65536+o).toString(16).substring(1)+";"}return">"+n}))}},{key:"_parse",value:function(e){var t=e.documentElement;if("rdf:rdf"!==t.nodeName.toLowerCase())for(t=t.firstChild;t&&"rdf:rdf"!==t.nodeName.toLowerCase();)t=t.nextSibling;var r=t?t.nodeName.toLowerCase():null;if(t&&"rdf:rdf"===r&&t.hasChildNodes())for(var n=t.childNodes,a=0,i=n.length;a=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,c=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return s=e.done,e},e:function(e){c=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw i}}}}(this._metadataMap);try{for(r.s();!(e=r.n()).done;){var n=i(e.value,2),a=n[0],s=n[1];t[a]=s}}catch(e){r.e(e)}finally{r.f()}return t}},{key:"has",value:function(e){return this._metadataMap.has(e)}}])&&c(t.prototype,r),s&&c(t,s),e}();t.Metadata=l},function(e,t,r){function n(e){return n="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},n(e)}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){a=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(a)throw i}}return r}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r";case"amp":return"&";case"quot":return'"'}return t.onResolveEntity(r)}))}},{key:"_parseContent",value:function(e,t){var r=[],n=t;function a(){for(;n"!==e[n]&&"/"!==e[n];)++n;var i=e.substring(t,n);for(a();n"!==e[n]&&"/"!==e[n]&&"?"!==e[n];){a();for(var o,s="";n"!==e[r]&&"/"!==e[r];)++r;var n=e.substring(t,r);!function(){for(;r"!==e[r+1]);)++r;return{name:n,value:e.substring(a,r),parsed:r-t}}},{key:"parseXml",value:function(e){for(var t=0;t",r))<0)return void this.onError(b);this.onEndElement(e.substring(r,n)),r=n+1;break;case"?":++r;var a=this._parseProcessingInstruction(e,r);if("?>"!==e.substring(r+a.parsed,r+a.parsed+2))return void this.onError(g);this.onPi(a.name,a.value),r+=a.parsed+2;break;case"!":if("--"===e.substring(r+1,r+3)){if((n=e.indexOf("--\x3e",r+3))<0)return void this.onError(v);this.onComment(e.substring(r+3,n)),r=n+3}else if("[CDATA["===e.substring(r+1,r+8)){if((n=e.indexOf("]]>",r+8))<0)return void this.onError(p);this.onCdata(e.substring(r+8,n)),r=n+3}else{if("DOCTYPE"!==e.substring(r+1,r+8))return void this.onError(y);var i=e.indexOf("[",r+8),o=!1;if((n=e.indexOf(">",r+8))<0)return void this.onError(m);if(i>0&&n>i){if((n=e.indexOf("]>",r+8))<0)return void this.onError(m);o=!0}var s=e.substring(r+8,n+(o?1:0));this.onDoctype(s),r=n+(o?2:1)}break;default:var c=this._parseContent(e,r);if(null===c)return void this.onError(y);var l=!1;if("/>"===e.substring(r+c.parsed,r+c.parsed+2))l=!0;else if(">"!==e.substring(r+c.parsed,r+c.parsed+1))return void this.onError(b);this.onBeginElement(c.name,c.attributes,l),r+=c.parsed+(l?2:1)}}else{for(;r0}},{key:"firstChild",get:function(){return this.childNodes&&this.childNodes[0]}},{key:"nextSibling",get:function(){var e=this.parentNode.childNodes;if(e){var t=e.indexOf(this);if(-1!==t)return e[t+1]}}},{key:"textContent",get:function(){return this.childNodes?this.childNodes.map((function(e){return e.textContent})).join(""):this.nodeValue||""}}]),e}(),_=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(r,e);var t=c(r);function r(){var e;return u(this,r),(e=t.call(this))._currentFragment=null,e._stack=null,e._errorCode=d,e}return f(r,[{key:"parseFromString",value:function(e){if(this._currentFragment=[],this._stack=[],this._errorCode=d,this.parseXml(e),this._errorCode===d){var t=a(this._currentFragment,1)[0];if(t)return{documentElement:t}}}},{key:"onResolveEntity",value:function(e){return"apos"===e?"'":o(l(r.prototype),"onResolveEntity",this).call(this,e)}},{key:"onText",value:function(e){if(!function(e){for(var t=0,r=e.length;t=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw i}}}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0){var o=new Uint8Array(a).buffer;this._queuedChunks.push(o)}this._pdfDataRangeTransport=r,this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._contentLength=t.length,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((function(e,t){n._onReceiveData({begin:e,chunk:t})})),this._pdfDataRangeTransport.addProgressListener((function(e,t){n._onProgress({loaded:e,total:t})})),this._pdfDataRangeTransport.addProgressiveReadListener((function(e){n._onReceiveData({chunk:e})})),this._pdfDataRangeTransport.addProgressiveDoneListener((function(){n._onProgressiveDone()})),this._pdfDataRangeTransport.transportReady()}return f(e,[{key:"_onReceiveData",value:function(e){var t=new Uint8Array(e.chunk).buffer;if(void 0===e.begin)this._fullRequestReader?this._fullRequestReader._enqueue(t):this._queuedChunks.push(t);else{var r=this._rangeReaders.some((function(r){return r._begin===e.begin&&(r._enqueue(t),!0)}));(0,i.assert)(r,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}},{key:"_onProgress",value:function(e){if(void 0===e.total){var t=this._rangeReaders[0];t&&t.onProgress&&t.onProgress({loaded:e.loaded})}else{var r=this._fullRequestReader;r&&r.onProgress&&r.onProgress({loaded:e.loaded,total:e.total})}}},{key:"_onProgressiveDone",value:function(){this._fullRequestReader&&this._fullRequestReader.progressiveDone(),this._progressiveDone=!0}},{key:"_removeRangeReader",value:function(e){var t=this._rangeReaders.indexOf(e);t>=0&&this._rangeReaders.splice(t,1)}},{key:"getFullReader",value:function(){(0,i.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");var e=this._queuedChunks;return this._queuedChunks=null,new p(this,e,this._progressiveDone)}},{key:"getRangeReader",value:function(e,t){if(t<=this._progressiveDataLength)return null;var r=new g(this,e,t);return this._pdfDataRangeTransport.requestDataRange(e,t),this._rangeReaders.push(r),r}},{key:"cancelAllRequests",value:function(e){this._fullRequestReader&&this._fullRequestReader.cancel(e),this._rangeReaders.slice(0).forEach((function(t){t.cancel(e)})),this._pdfDataRangeTransport.abort()}},{key:"_progressiveDataLength",get:function(){return this._fullRequestReader?this._fullRequestReader._loaded:0}}]),e}();t.PDFDataTransportStream=d;var p=function(){function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];u(this,e),this._stream=t,this._done=n||!1,this._filename=null,this._queuedChunks=r||[],this._loaded=0;var a,i=c(this._queuedChunks);try{for(i.s();!(a=i.n()).done;){var o=a.value;this._loaded+=o.byteLength}}catch(e){i.e(e)}finally{i.f()}this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}var t;return f(e,[{key:"_enqueue",value:function(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.byteLength)}},{key:"read",value:(t=s(a.default.mark((function e(){var t,r;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(this._queuedChunks.length>0)){e.next=3;break}return t=this._queuedChunks.shift(),e.abrupt("return",{value:t,done:!1});case 3:if(!this._done){e.next=5;break}return e.abrupt("return",{value:void 0,done:!0});case 5:return r=(0,i.createPromiseCapability)(),this._requests.push(r),e.abrupt("return",r.promise);case 8:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"cancel",value:function(e){this._done=!0,this._requests.forEach((function(e){e.resolve({value:void 0,done:!0})})),this._requests=[]}},{key:"progressiveDone",value:function(){this._done||(this._done=!0)}},{key:"headersReady",get:function(){return this._headersReady}},{key:"filename",get:function(){return this._filename}},{key:"isRangeSupported",get:function(){return this._stream._isRangeSupported}},{key:"isStreamingSupported",get:function(){return this._stream._isStreamingSupported}},{key:"contentLength",get:function(){return this._stream._contentLength}}]),e}(),g=function(){function e(t,r,n){u(this,e),this._stream=t,this._begin=r,this._end=n,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}var t;return f(e,[{key:"_enqueue",value:function(e){this._done||(0===this._requests.length?this._queuedChunk=e:(this._requests.shift().resolve({value:e,done:!1}),this._requests.forEach((function(e){e.resolve({value:void 0,done:!0})})),this._requests=[]),this._done=!0,this._stream._removeRangeReader(this))}},{key:"read",value:(t=s(a.default.mark((function e(){var t,r;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._queuedChunk){e.next=4;break}return t=this._queuedChunk,this._queuedChunk=null,e.abrupt("return",{value:t,done:!1});case 4:if(!this._done){e.next=6;break}return e.abrupt("return",{value:void 0,done:!0});case 6:return r=(0,i.createPromiseCapability)(),this._requests.push(r),e.abrupt("return",r.promise);case 9:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"cancel",value:function(e){this._done=!0,this._requests.forEach((function(e){e.resolve({value:void 0,done:!0})})),this._requests=[],this._stream._removeRangeReader(this)}},{key:"isStreamingSupported",get:function(){return!1}}]),e}()},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.WebGLContext=void 0;var n=r(5);function a(e,t){for(var r=0;r 0.0) { maskColor.rgb = maskColor.rgb * maskColor.a + u_backdrop.rgb * (1.0 - maskColor.a); } float lum; if (u_subtype == 0) { lum = maskColor.a; } else { lum = maskColor.r * 0.3 + maskColor.g * 0.59 + maskColor.b * 0.11; } imageColor.a *= lum; imageColor.rgb *= imageColor.a; gl_FragColor = imageColor; } ",u=null,h=" attribute vec2 a_position; attribute vec3 a_color; uniform vec2 u_resolution; uniform vec2 u_scale; uniform vec2 u_offset; varying vec4 v_color; void main() { vec2 position = (a_position + u_offset) * u_scale; vec2 clipSpace = (position / u_resolution) * 2.0 - 1.0; gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1); v_color = vec4(a_color / 255.0, 1.0); } ",f=" precision mediump float; varying vec4 v_color; void main() { gl_FragColor = v_color; } ",d=null;return{tryInitGL:function(){try{return s(),!!i}catch(e){}return!1},composeSMask:function(e,h,f){var d=e.width,p=e.height;u||function(){var e,a;s(),e=o,o=null,a=i,i=null;var h=n(a,[t(a,c),r(a,l)]);a.useProgram(h);var f={};f.gl=a,f.canvas=e,f.resolutionLocation=a.getUniformLocation(h,"u_resolution"),f.positionLocation=a.getAttribLocation(h,"a_position"),f.backdropLocation=a.getUniformLocation(h,"u_backdrop"),f.subtypeLocation=a.getUniformLocation(h,"u_subtype");var d=a.getAttribLocation(h,"a_texCoord"),p=a.getUniformLocation(h,"u_image"),g=a.getUniformLocation(h,"u_mask"),m=a.createBuffer();a.bindBuffer(a.ARRAY_BUFFER,m),a.bufferData(a.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]),a.STATIC_DRAW),a.enableVertexAttribArray(d),a.vertexAttribPointer(d,2,a.FLOAT,!1,0,0),a.uniform1i(p,0),a.uniform1i(g,1),u=f}();var g=u,m=g.canvas,v=g.gl;m.width=d,m.height=p,v.viewport(0,0,v.drawingBufferWidth,v.drawingBufferHeight),v.uniform2f(g.resolutionLocation,d,p),f.backdrop?v.uniform4f(g.resolutionLocation,f.backdrop[0],f.backdrop[1],f.backdrop[2],1):v.uniform4f(g.resolutionLocation,0,0,0,0),v.uniform1i(g.subtypeLocation,"Luminosity"===f.subtype?1:0);var y=a(v,e,v.TEXTURE0),b=a(v,h,v.TEXTURE1),w=v.createBuffer();return v.bindBuffer(v.ARRAY_BUFFER,w),v.bufferData(v.ARRAY_BUFFER,new Float32Array([0,0,d,0,0,p,0,p,d,0,d,p]),v.STATIC_DRAW),v.enableVertexAttribArray(g.positionLocation),v.vertexAttribPointer(g.positionLocation,2,v.FLOAT,!1,0,0),v.clearColor(0,0,0,0),v.enable(v.BLEND),v.blendFunc(v.ONE,v.ONE_MINUS_SRC_ALPHA),v.clear(v.COLOR_BUFFER_BIT),v.drawArrays(v.TRIANGLES,0,6),v.flush(),v.deleteTexture(y),v.deleteTexture(b),v.deleteBuffer(w),m},drawFigures:function(e,a,c,l,u){d||function(){var e,a;s(),e=o,o=null,a=i,i=null;var c=n(a,[t(a,h),r(a,f)]);a.useProgram(c);var l={};l.gl=a,l.canvas=e,l.resolutionLocation=a.getUniformLocation(c,"u_resolution"),l.scaleLocation=a.getUniformLocation(c,"u_scale"),l.offsetLocation=a.getUniformLocation(c,"u_offset"),l.positionLocation=a.getAttribLocation(c,"a_position"),l.colorLocation=a.getAttribLocation(c,"a_color"),d=l}();var p=d,g=p.canvas,m=p.gl;g.width=e,g.height=a,m.viewport(0,0,m.drawingBufferWidth,m.drawingBufferHeight),m.uniform2f(p.resolutionLocation,e,a);var v,y,b,w=0;for(v=0,y=l.length;v=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,c=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return s=e.done,e},e:function(e){c=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw i}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];p(this,e),this.isRenderable=r,this.data=t.data,this.layer=t.layer,this.page=t.page,this.viewport=t.viewport,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderInteractiveForms=t.renderInteractiveForms,this.svgFactory=t.svgFactory,r&&(this.container=this._createContainer(n))}return m(e,[{key:"_createContainer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.data,r=this.page,n=this.viewport,i=document.createElement("section"),o=t.rect[2]-t.rect[0],s=t.rect[3]-t.rect[1];i.setAttribute("data-annotation-id",t.id);var c=a.Util.normalizeRect([t.rect[0],r.view[3]-t.rect[1]+r.view[1],t.rect[2],r.view[3]-t.rect[3]+r.view[1]]);if(i.style.transform="matrix(".concat(n.transform.join(","),")"),i.style.transformOrigin="-".concat(c[0],"px -").concat(c[1],"px"),!e&&t.borderStyle.width>0){i.style.borderWidth="".concat(t.borderStyle.width,"px"),t.borderStyle.style!==a.AnnotationBorderStyleType.UNDERLINE&&(o-=2*t.borderStyle.width,s-=2*t.borderStyle.width);var l=t.borderStyle.horizontalCornerRadius,u=t.borderStyle.verticalCornerRadius;if(l>0||u>0){var h="".concat(l,"px / ").concat(u,"px");i.style.borderRadius=h}switch(t.borderStyle.style){case a.AnnotationBorderStyleType.SOLID:i.style.borderStyle="solid";break;case a.AnnotationBorderStyleType.DASHED:i.style.borderStyle="dashed";break;case a.AnnotationBorderStyleType.BEVELED:(0,a.warn)("Unimplemented border style: beveled");break;case a.AnnotationBorderStyleType.INSET:(0,a.warn)("Unimplemented border style: inset");break;case a.AnnotationBorderStyleType.UNDERLINE:i.style.borderBottomStyle="solid"}t.color?i.style.borderColor=a.Util.makeCssRgb(0|t.color[0],0|t.color[1],0|t.color[2]):i.style.borderWidth=0}return i.style.left="".concat(c[0],"px"),i.style.top="".concat(c[1],"px"),i.style.width="".concat(o,"px"),i.style.height="".concat(s,"px"),i}},{key:"_createPopup",value:function(e,t,r){t||((t=document.createElement("div")).style.height=e.style.height,t.style.width=e.style.width,e.appendChild(t));var n=new T({container:e,trigger:t,color:r.color,title:r.title,modificationDate:r.modificationDate,contents:r.contents,hideWrapper:!0}).render();n.style.left=e.style.width,e.appendChild(n)}},{key:"render",value:function(){(0,a.unreachable)("Abstract method `AnnotationElement.render` called")}}]),e}(),b=function(e){l(r,e);var t=h(r);function r(e){p(this,r);var n=!!(e.data.url||e.data.dest||e.data.action);return t.call(this,e,n)}return m(r,[{key:"render",value:function(){this.container.className="linkAnnotation";var e=this.data,t=this.linkService,r=document.createElement("a");return e.url?(0,n.addLinkAttributes)(r,{url:e.url,target:e.newWindow?n.LinkTarget.BLANK:t.externalLinkTarget,rel:t.externalLinkRel,enabled:t.externalLinkEnabled}):e.action?this._bindNamedAction(r,e.action):this._bindLink(r,e.dest),this.container.appendChild(r),this.container}},{key:"_bindLink",value:function(e,t){var r=this;e.href=this.linkService.getDestinationHash(t),e.onclick=function(){return t&&r.linkService.navigateTo(t),!1},t&&(e.className="internalLink")}},{key:"_bindNamedAction",value:function(e,t){var r=this;e.href=this.linkService.getAnchorUrl(""),e.onclick=function(){return r.linkService.executeNamedAction(t),!1},e.className="internalLink"}}]),r}(y),w=function(e){l(r,e);var t=h(r);function r(e){p(this,r);var n=!!(e.data.hasPopup||e.data.title||e.data.contents);return t.call(this,e,n)}return m(r,[{key:"render",value:function(){this.container.className="textAnnotation";var e=document.createElement("img");return e.style.height=this.container.style.height,e.style.width=this.container.style.width,e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.alt="[{{type}} Annotation]",e.dataset.l10nId="text_annotation_type",e.dataset.l10nArgs=JSON.stringify({type:this.data.name}),this.data.hasPopup||this._createPopup(this.container,e,this.data),this.container.appendChild(e),this.container}}]),r}(y),k=function(e){l(r,e);var t=h(r);function r(){return p(this,r),t.apply(this,arguments)}return m(r,[{key:"render",value:function(){return this.container}}]),r}(y),S=function(e){l(r,e);var t=h(r);function r(e){p(this,r);var n=e.renderInteractiveForms||!e.data.hasAppearance&&!!e.data.fieldValue;return t.call(this,e,n)}return m(r,[{key:"render",value:function(){this.container.className="textWidgetAnnotation";var e=null;if(this.renderInteractiveForms){if(this.data.multiLine?(e=document.createElement("textarea")).textContent=this.data.fieldValue:((e=document.createElement("input")).type="text",e.setAttribute("value",this.data.fieldValue)),e.disabled=this.data.readOnly,e.name=this.data.fieldName,null!==this.data.maxLen&&(e.maxLength=this.data.maxLen),this.data.comb){var t=(this.data.rect[2]-this.data.rect[0])/this.data.maxLen;e.classList.add("comb"),e.style.letterSpacing="calc(".concat(t,"px - 1ch)")}}else{(e=document.createElement("div")).textContent=this.data.fieldValue,e.style.verticalAlign="middle",e.style.display="table-cell";var r=null;this.data.fontRefName&&this.page.commonObjs.has(this.data.fontRefName)&&(r=this.page.commonObjs.get(this.data.fontRefName)),this._setTextStyle(e,r)}return null!==this.data.textAlignment&&(e.style.textAlign=["left","center","right"][this.data.textAlignment]),this.container.appendChild(e),this.container}},{key:"_setTextStyle",value:function(e,t){var r=e.style;if(r.fontSize="".concat(this.data.fontSize,"px"),r.direction=this.data.fontDirection<0?"rtl":"ltr",t){var n="normal";t.black?n="900":t.bold&&(n="bold"),r.fontWeight=n,r.fontStyle=t.italic?"italic":"normal";var a=t.loadedName?'"'.concat(t.loadedName,'", '):"",i=t.fallbackName||"Helvetica, sans-serif";r.fontFamily=a+i}}}]),r}(k),_=function(e){l(r,e);var t=h(r);function r(e){return p(this,r),t.call(this,e,e.renderInteractiveForms)}return m(r,[{key:"render",value:function(){this.container.className="buttonWidgetAnnotation checkBox";var e=document.createElement("input");return e.disabled=this.data.readOnly,e.type="checkbox",e.name=this.data.fieldName,this.data.fieldValue&&"Off"!==this.data.fieldValue&&e.setAttribute("checked",!0),this.container.appendChild(e),this.container}}]),r}(k),A=function(e){l(r,e);var t=h(r);function r(e){return p(this,r),t.call(this,e,e.renderInteractiveForms)}return m(r,[{key:"render",value:function(){this.container.className="buttonWidgetAnnotation radioButton";var e=document.createElement("input");return e.disabled=this.data.readOnly,e.type="radio",e.name=this.data.fieldName,this.data.fieldValue===this.data.buttonValue&&e.setAttribute("checked",!0),this.container.appendChild(e),this.container}}]),r}(k),x=function(e){l(r,e);var t=h(r);function r(){return p(this,r),t.apply(this,arguments)}return m(r,[{key:"render",value:function(){var e=s(d(r.prototype),"render",this).call(this);return e.className="buttonWidgetAnnotation pushButton",e}}]),r}(b),C=function(e){l(r,e);var t=h(r);function r(e){return p(this,r),t.call(this,e,e.renderInteractiveForms)}return m(r,[{key:"render",value:function(){this.container.className="choiceWidgetAnnotation";var e=document.createElement("select");e.disabled=this.data.readOnly,e.name=this.data.fieldName,this.data.combo||(e.size=this.data.options.length,this.data.multiSelect&&(e.multiple=!0));var t,r=i(this.data.options);try{for(r.s();!(t=r.n()).done;){var n=t.value,a=document.createElement("option");a.textContent=n.displayValue,a.value=n.exportValue,this.data.fieldValue.includes(n.displayValue)&&a.setAttribute("selected",!0),e.appendChild(a)}}catch(e){r.e(e)}finally{r.f()}return this.container.appendChild(e),this.container}}]),r}(k),P=function(e){l(r,e);var t=h(r);function r(e){p(this,r);var n=!(!e.data.title&&!e.data.contents);return t.call(this,e,n)}return m(r,[{key:"render",value:function(){if(this.container.className="popupAnnotation",["Line","Square","Circle","PolyLine","Polygon","Ink"].includes(this.data.parentType))return this.container;var e='[data-annotation-id="'.concat(this.data.parentId,'"]'),t=this.layer.querySelector(e);if(!t)return this.container;var r=new T({container:this.container,trigger:t,color:this.data.color,title:this.data.title,modificationDate:this.data.modificationDate,contents:this.data.contents}),n=parseFloat(t.style.left),a=parseFloat(t.style.width);return this.container.style.transformOrigin="-".concat(n+a,"px -").concat(t.style.top),this.container.style.left="".concat(n+a,"px"),this.container.appendChild(r.render()),this.container}}]),r}(y),T=function(){function e(t){p(this,e),this.container=t.container,this.trigger=t.trigger,this.color=t.color,this.title=t.title,this.modificationDate=t.modificationDate,this.contents=t.contents,this.hideWrapper=t.hideWrapper||!1,this.pinned=!1}return m(e,[{key:"render",value:function(){var e=document.createElement("div");e.className="popupWrapper",this.hideElement=this.hideWrapper?e:this.container,this.hideElement.setAttribute("hidden",!0);var t=document.createElement("div");t.className="popup";var r=this.color;if(r){var i=.7*(255-r[0])+r[0],o=.7*(255-r[1])+r[1],s=.7*(255-r[2])+r[2];t.style.backgroundColor=a.Util.makeCssRgb(0|i,0|o,0|s)}var c=document.createElement("h1");c.textContent=this.title,t.appendChild(c);var l=n.PDFDateString.toDateObject(this.modificationDate);if(l){var u=document.createElement("span");u.textContent="{{date}}, {{time}}",u.dataset.l10nId="annotation_date_string",u.dataset.l10nArgs=JSON.stringify({date:l.toLocaleDateString(),time:l.toLocaleTimeString()}),t.appendChild(u)}var h=this._formatContents(this.contents);return t.appendChild(h),this.trigger.addEventListener("click",this._toggle.bind(this)),this.trigger.addEventListener("mouseover",this._show.bind(this,!1)),this.trigger.addEventListener("mouseout",this._hide.bind(this,!1)),t.addEventListener("click",this._hide.bind(this,!0)),e.appendChild(t),e}},{key:"_formatContents",value:function(e){for(var t=document.createElement("p"),r=e.split(/(?:\r\n?|\n)/),n=0,a=r.length;n0&&void 0!==arguments[0]&&arguments[0]&&(this.pinned=!0),this.hideElement.hasAttribute("hidden")&&(this.hideElement.removeAttribute("hidden"),this.container.style.zIndex+=1)}},{key:"_hide",value:function(){(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&(this.pinned=!1),this.hideElement.hasAttribute("hidden")||this.pinned||(this.hideElement.setAttribute("hidden",!0),this.container.style.zIndex-=1)}}]),e}(),E=function(e){l(r,e);var t=h(r);function r(e){p(this,r);var n=!!(e.data.hasPopup||e.data.title||e.data.contents);return t.call(this,e,n,!0)}return m(r,[{key:"render",value:function(){return this.container.className="freeTextAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}]),r}(y),R=function(e){l(r,e);var t=h(r);function r(e){p(this,r);var n=!!(e.data.hasPopup||e.data.title||e.data.contents);return t.call(this,e,n,!0)}return m(r,[{key:"render",value:function(){this.container.className="lineAnnotation";var e=this.data,t=e.rect[2]-e.rect[0],r=e.rect[3]-e.rect[1],n=this.svgFactory.create(t,r),a=this.svgFactory.createElement("svg:line");return a.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),a.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),a.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),a.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),a.setAttribute("stroke-width",e.borderStyle.width||1),a.setAttribute("stroke","transparent"),n.appendChild(a),this.container.append(n),this._createPopup(this.container,a,e),this.container}}]),r}(y),O=function(e){l(r,e);var t=h(r);function r(e){p(this,r);var n=!!(e.data.hasPopup||e.data.title||e.data.contents);return t.call(this,e,n,!0)}return m(r,[{key:"render",value:function(){this.container.className="squareAnnotation";var e=this.data,t=e.rect[2]-e.rect[0],r=e.rect[3]-e.rect[1],n=this.svgFactory.create(t,r),a=e.borderStyle.width,i=this.svgFactory.createElement("svg:rect");return i.setAttribute("x",a/2),i.setAttribute("y",a/2),i.setAttribute("width",t-a),i.setAttribute("height",r-a),i.setAttribute("stroke-width",a||1),i.setAttribute("stroke","transparent"),i.setAttribute("fill","none"),n.appendChild(i),this.container.append(n),this._createPopup(this.container,i,e),this.container}}]),r}(y),I=function(e){l(r,e);var t=h(r);function r(e){p(this,r);var n=!!(e.data.hasPopup||e.data.title||e.data.contents);return t.call(this,e,n,!0)}return m(r,[{key:"render",value:function(){this.container.className="circleAnnotation";var e=this.data,t=e.rect[2]-e.rect[0],r=e.rect[3]-e.rect[1],n=this.svgFactory.create(t,r),a=e.borderStyle.width,i=this.svgFactory.createElement("svg:ellipse");return i.setAttribute("cx",t/2),i.setAttribute("cy",r/2),i.setAttribute("rx",t/2-a/2),i.setAttribute("ry",r/2-a/2),i.setAttribute("stroke-width",a||1),i.setAttribute("stroke","transparent"),i.setAttribute("fill","none"),n.appendChild(i),this.container.append(n),this._createPopup(this.container,i,e),this.container}}]),r}(y),F=function(e){l(r,e);var t=h(r);function r(e){var n;p(this,r);var a=!!(e.data.hasPopup||e.data.title||e.data.contents);return(n=t.call(this,e,a,!0)).containerClassName="polylineAnnotation",n.svgElementName="svg:polyline",n}return m(r,[{key:"render",value:function(){this.container.className=this.containerClassName;var e,t=this.data,r=t.rect[2]-t.rect[0],n=t.rect[3]-t.rect[1],a=this.svgFactory.create(r,n),o=[],s=i(t.vertices);try{for(s.s();!(e=s.n()).done;){var c=e.value,l=c.x-t.rect[0],u=t.rect[3]-c.y;o.push(l+","+u)}}catch(e){s.e(e)}finally{s.f()}o=o.join(" ");var h=this.svgFactory.createElement(this.svgElementName);return h.setAttribute("points",o),h.setAttribute("stroke-width",t.borderStyle.width||1),h.setAttribute("stroke","transparent"),h.setAttribute("fill","none"),a.appendChild(h),this.container.append(a),this._createPopup(this.container,h,t),this.container}}]),r}(y),L=function(e){l(r,e);var t=h(r);function r(e){var n;return p(this,r),(n=t.call(this,e)).containerClassName="polygonAnnotation",n.svgElementName="svg:polygon",n}return r}(F),M=function(e){l(r,e);var t=h(r);function r(e){p(this,r);var n=!!(e.data.hasPopup||e.data.title||e.data.contents);return t.call(this,e,n,!0)}return m(r,[{key:"render",value:function(){return this.container.className="caretAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}]),r}(y),N=function(e){l(r,e);var t=h(r);function r(e){var n;p(this,r);var a=!!(e.data.hasPopup||e.data.title||e.data.contents);return(n=t.call(this,e,a,!0)).containerClassName="inkAnnotation",n.svgElementName="svg:polyline",n}return m(r,[{key:"render",value:function(){this.container.className=this.containerClassName;var e,t=this.data,r=t.rect[2]-t.rect[0],n=t.rect[3]-t.rect[1],a=this.svgFactory.create(r,n),o=i(t.inkLists);try{for(o.s();!(e=o.n()).done;){var s,c=e.value,l=[],u=i(c);try{for(u.s();!(s=u.n()).done;){var h=s.value,f=h.x-t.rect[0],d=t.rect[3]-h.y;l.push("".concat(f,",").concat(d))}}catch(e){u.e(e)}finally{u.f()}l=l.join(" ");var p=this.svgFactory.createElement(this.svgElementName);p.setAttribute("points",l),p.setAttribute("stroke-width",t.borderStyle.width||1),p.setAttribute("stroke","transparent"),p.setAttribute("fill","none"),this._createPopup(this.container,p,t),a.appendChild(p)}}catch(e){o.e(e)}finally{o.f()}return this.container.append(a),this.container}}]),r}(y),D=function(e){l(r,e);var t=h(r);function r(e){p(this,r);var n=!!(e.data.hasPopup||e.data.title||e.data.contents);return t.call(this,e,n,!0)}return m(r,[{key:"render",value:function(){return this.container.className="highlightAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}]),r}(y),B=function(e){l(r,e);var t=h(r);function r(e){p(this,r);var n=!!(e.data.hasPopup||e.data.title||e.data.contents);return t.call(this,e,n,!0)}return m(r,[{key:"render",value:function(){return this.container.className="underlineAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}]),r}(y),j=function(e){l(r,e);var t=h(r);function r(e){p(this,r);var n=!!(e.data.hasPopup||e.data.title||e.data.contents);return t.call(this,e,n,!0)}return m(r,[{key:"render",value:function(){return this.container.className="squigglyAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}]),r}(y),U=function(e){l(r,e);var t=h(r);function r(e){p(this,r);var n=!!(e.data.hasPopup||e.data.title||e.data.contents);return t.call(this,e,n,!0)}return m(r,[{key:"render",value:function(){return this.container.className="strikeoutAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}]),r}(y),q=function(e){l(r,e);var t=h(r);function r(e){p(this,r);var n=!!(e.data.hasPopup||e.data.title||e.data.contents);return t.call(this,e,n,!0)}return m(r,[{key:"render",value:function(){return this.container.className="stampAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}]),r}(y),z=function(e){l(r,e);var t=h(r);function r(e){var i;p(this,r);var o=(i=t.call(this,e,!0)).data.file,s=o.filename,c=o.content;return i.filename=(0,n.getFilenameFromUrl)(s),i.content=c,i.linkService.eventBus&&i.linkService.eventBus.dispatch("fileattachmentannotation",{source:f(i),id:(0,a.stringToPDFString)(s),filename:s,content:c}),i}return m(r,[{key:"render",value:function(){this.container.className="fileAttachmentAnnotation";var e=document.createElement("div");return e.style.height=this.container.style.height,e.style.width=this.container.style.width,e.addEventListener("dblclick",this._download.bind(this)),this.data.hasPopup||!this.data.title&&!this.data.contents||this._createPopup(this.container,e,this.data),this.container.appendChild(e),this.container}},{key:"_download",value:function(){this.downloadManager?this.downloadManager.downloadData(this.content,this.filename,""):(0,a.warn)("Download cannot be started due to unavailable download manager")}}]),r}(y),G=function(){function e(){p(this,e)}return m(e,null,[{key:"render",value:function(e){var t,r=[],o=[],s=i(e.annotations);try{for(s.s();!(t=s.n()).done;){var c=t.value;c&&(c.annotationType!==a.AnnotationType.POPUP?r.push(c):o.push(c))}}catch(e){s.e(e)}finally{s.f()}o.length&&r.push.apply(r,o);for(var l=0,u=r;l1)g=!0;else if(r.transform[0]!==r.transform[3]){var m=Math.abs(r.transform[0]),v=Math.abs(r.transform[3]);m!==v&&Math.max(m,v)/Math.min(m,v)>1.5&&(g=!0)}if(g&&(u.vertical?s.canvasWidth=r.height*t._viewport.scale:s.canvasWidth=r.width*t._viewport.scale),t._textDivProperties.set(o,s),t._textContentStream&&t._layoutText(o),t._enhanceTextSelection){var y=1,b=0;0!==l&&(y=Math.cos(l),b=Math.sin(l));var w,k,S=(u.vertical?r.height:r.width)*t._viewport.scale,_=d;0!==l?(w=[y,b,-b,y,h,f],k=n.Util.getAxialAlignedBoundingBox([0,0,S,_],w)):k=[h,f,h+S,f+_],t._bounds.push({left:k[0],top:k[1],right:k[2],bottom:k[3],div:o,size:[S,_],m:w})}}function r(e){if(!e._canceled){var t=e._textDivs,r=e._capability,n=t.length;if(n>1e5)return e._renderingDone=!0,void r.resolve();if(!e._textContentStream)for(var a=0;a0&&(n=n?Math.min(i,n):i)}return n}function i(e){for(var t=e._bounds,r=e._viewport,i=function(e,t,r){var n=r.map((function(e,t){return{x1:e.left,y1:e.top,x2:e.right,y2:e.bottom,index:t,x1New:void 0,x2New:void 0}}));o(e,n);var a=new Array(r.length);return n.forEach((function(e){var t=e.index;a[t]={left:e.x1New,top:0,right:e.x2New,bottom:0}})),r.map((function(t,r){var i=a[r],o=n[r];o.x1=t.top,o.y1=e-i.right,o.x2=t.bottom,o.y2=e-i.left,o.index=r,o.x1New=void 0,o.x2New=void 0})),o(t,n),n.forEach((function(e){var t=e.index;a[t].top=e.x1New,a[t].bottom=e.x2New})),a}(r.width,r.height,t),s=0;s=0&&r[i].start>=e.y2;)i--;var o,s,c=-1/0;for(o=t;o<=i;o++){var l;(l=(a=(n=r[o]).boundary).x2>e.x1?a.index>e.index?a.x1New:e.x1:void 0===a.x2New?(a.x2+e.x1)/2:a.x2New)>c&&(c=l)}for(e.x1New=c,o=t;o<=i;o++)void 0===(a=(n=r[o]).boundary).x2New?a.x2>e.x1?a.index>e.index&&(a.x2New=a.x2):a.x2New=c:a.x2New>c&&(a.x2New=Math.max(c,a.x2));var u=[],h=null;for(o=t;o<=i;o++){var f=(a=(n=r[o]).boundary).x2>e.x2?a:e;h===f?u[u.length-1].end=n.end:(u.push({start:n.start,end:n.end,boundary:f}),h=f)}for(r[t].start=0&&r[s].start>=a.y1;s--)d=r[s].boundary===a;for(s=i+1;!d&&s0&&(t.scale=t.canvasWidth/o,r="scaleX(".concat(t.scale,")"))}0!==t.angle&&(r="rotate(".concat(t.angle,"deg) ").concat(r)),r.length>0&&(this._enhanceTextSelection&&(t.originalTransform=r),e.style.transform=r),this._textDivProperties.set(e,t),this._container.appendChild(e)}},_render:function(e){var t=this,a=(0,n.createPromiseCapability)(),i=Object.create(null),o=document.createElement("canvas");if(o.mozOpaque=!0,this._layoutTextCtx=o.getContext("2d",{alpha:!1}),this._textContent){var s=this._textContent.items,c=this._textContent.styles;this._processItems(s,c),a.resolve()}else{if(!this._textContentStream)throw new Error('Neither "textContent" nor "textContentStream" parameters specified.');this._reader=this._textContentStream.getReader(),function e(){t._reader.read().then((function(r){var n=r.value;r.done?a.resolve():(Object.assign(i,n.styles),t._processItems(n.items,i),e())}),a.reject)}()}a.promise.then((function(){i=null,e?t._renderTimer=setTimeout((function(){r(t),t._renderTimer=null}),e):r(t)}),this._capability.reject)},expandTextDivs:function(e){if(this._enhanceTextSelection&&this._renderingDone){null!==this._bounds&&(i(this),this._bounds=null);for(var t=[],r=[],n=0,a=this._textDivs.length;n0?(r.push("".concat(s.paddingTop,"px")),t.push("translateY(".concat(-s.paddingTop,"px)"))):r.push(0),s.paddingRight>0?r.push("".concat(s.paddingRight/s.scale,"px")):r.push(0),s.paddingBottom>0?r.push("".concat(s.paddingBottom,"px")):r.push(0),s.paddingLeft>0?(r.push("".concat(s.paddingLeft/s.scale,"px")),t.push("translateX(".concat(-s.paddingLeft/s.scale,"px)"))):r.push(0),o.style.padding=r.join(" "),t.length&&(o.style.transform=t.join(" "))):(o.style.padding=null,o.style.transform=s.originalTransform))}}}},function(e){var t=new s({textContent:e.textContent,textContentStream:e.textContentStream,container:e.container,viewport:e.viewport,textDivs:e.textDivs,textContentItemsStr:e.textContentItemsStr,enhanceTextSelection:e.enhanceTextSelection});return t._render(e.timeout),t}}();t.renderTextLayer=a},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.SVGGraphics=void 0;var n=r(5),a=r(1),i=r(7);function o(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||l(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){a=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(a)throw i}}return r}}(e,t)||l(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=l(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw i}}}}function l(e,t){if(e){if("string"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r>1&2147483647:a>>1&2147483647;t[r]=a}function s(e,r,n,a){var i=a,o=r.length;n[i]=o>>24&255,n[i+1]=o>>16&255,n[i+2]=o>>8&255,n[i+3]=255&o,n[i+=4]=255&e.charCodeAt(0),n[i+1]=255&e.charCodeAt(1),n[i+2]=255&e.charCodeAt(2),n[i+3]=255&e.charCodeAt(3),i+=4,n.set(r,i);var s=function(e,r,n){for(var a=-1,i=r;i>>8^t[o]}return-1^a}(n,a+4,i+=r.length);n[i]=s>>24&255,n[i+1]=s>>16&255,n[i+2]=s>>8&255,n[i+3]=255&s}function c(e){var t=e.length,r=65535,n=Math.ceil(t/r),a=new Uint8Array(2+t+5*n+4),i=0;a[i++]=120,a[i++]=156;for(var o=0;t>r;)a[i++]=0,a[i++]=255,a[i++]=255,a[i++]=0,a[i++]=0,a.set(e.subarray(o,o+r),i),i+=r,o+=r,t-=r;a[i++]=1,a[i++]=255&t,a[i++]=t>>8&255,a[i++]=255&~t,a[i++]=(65535&~t)>>8&255,a.set(e.subarray(o),i),i+=e.length-o;var s=function(e,t,r){for(var n=1,a=0,i=t;i>24&255,a[i++]=s>>16&255,a[i++]=s>>8&255,a[i++]=255&s,a}function l(t,r,a,o){var l,u,h,f=t.width,d=t.height,p=t.data;switch(r){case n.ImageKind.GRAYSCALE_1BPP:u=0,l=1,h=f+7>>3;break;case n.ImageKind.RGB_24BPP:u=2,l=8,h=3*f;break;case n.ImageKind.RGBA_32BPP:u=6,l=8,h=4*f;break;default:throw new Error("invalid format")}for(var g=new Uint8Array((1+h)*d),m=0,v=0,y=0;y>24&255,f>>16&255,f>>8&255,255&f,d>>24&255,d>>16&255,d>>8&255,255&d,l,u,0,0,0]),S=function(e){if(!i.isNodeJS)return c(e);try{var t;t=parseInt(process.versions.node)>=8?e:Buffer.from(e);var r=require$$4.deflateSync(t,{level:9});return r instanceof Uint8Array?r:new Uint8Array(r)}catch(e){(0,n.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+e)}return c(e)}(g),_=e.length+36+k.length+S.length,A=new Uint8Array(_),x=0;return A.set(e,x),s("IHDR",k,A,x+=e.length),s("IDATA",S,A,x+=12+k.length),x+=12+S.length,s("IEND",new Uint8Array(0),A,x),(0,n.createObjectURL)(A,"image/png",a)}return function(e,t,r){return l(e,void 0===e.kind?n.ImageKind.GRAYSCALE_1BPP:e.kind,t,r)}}(),k=function(){function e(){h(this,e),this.fontSizeScale=1,this.fontWeight=v.fontWeight,this.fontSize=0,this.textMatrix=n.IDENTITY_MATRIX,this.fontMatrix=n.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=n.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=v.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}return d(e,[{key:"clone",value:function(){return Object.create(this)}},{key:"setCurrentPoint",value:function(e,t){this.x=e,this.y=t}}]),e}(),S=0,_=0,A=0;t.SVGGraphics=p=function(){function e(t,r){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(var o in h(this,e),this.svgFactory=new a.DOMSVGFactory,this.current=new k,this.transformMatrix=n.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=t,this.objs=r,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!i,this._operatorIdMapping=[],n.OPS)this._operatorIdMapping[n.OPS[o]]=o}return d(e,[{key:"save",value:function(){this.transformStack.push(this.transformMatrix);var e=this.current;this.extraStack.push(e),this.current=e.clone()}},{key:"restore",value:function(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}},{key:"group",value:function(e){this.save(),this.executeOpTree(e),this.restore()}},{key:"loadDependencies",value:function(e){for(var t=this,r=e.fnArray,a=e.argsArray,i=0,o=r.length;i0&&(this.current.lineWidth=e)}},{key:"setLineCap",value:function(e){this.current.lineCap=y[e]}},{key:"setLineJoin",value:function(e){this.current.lineJoin=b[e]}},{key:"setMiterLimit",value:function(e){this.current.miterLimit=e}},{key:"setStrokeAlpha",value:function(e){this.current.strokeAlpha=e}},{key:"setStrokeRGBColor",value:function(e,t,r){this.current.strokeColor=n.Util.makeCssRgb(e,t,r)}},{key:"setFillAlpha",value:function(e){this.current.fillAlpha=e}},{key:"setFillRGBColor",value:function(e,t,r){this.current.fillColor=n.Util.makeCssRgb(e,t,r),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}},{key:"setStrokeColorN",value:function(e){this.current.strokeColor=this._makeColorN_Pattern(e)}},{key:"setFillColorN",value:function(e){this.current.fillColor=this._makeColorN_Pattern(e)}},{key:"shadingFill",value:function(e){var t=this.viewport.width,r=this.viewport.height,a=n.Util.inverseTransform(this.transformMatrix),i=n.Util.applyTransform([0,0],a),o=n.Util.applyTransform([0,r],a),s=n.Util.applyTransform([t,0],a),c=n.Util.applyTransform([t,r],a),l=Math.min(i[0],o[0],s[0],c[0]),u=Math.min(i[1],o[1],s[1],c[1]),h=Math.max(i[0],o[0],s[0],c[0]),f=Math.max(i[1],o[1],s[1],c[1]),d=this.svgFactory.createElement("svg:rect");d.setAttributeNS(null,"x",l),d.setAttributeNS(null,"y",u),d.setAttributeNS(null,"width",h-l),d.setAttributeNS(null,"height",f-u),d.setAttributeNS(null,"fill",this._makeShadingPattern(e)),this.current.fillAlpha<1&&d.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().appendChild(d)}},{key:"_makeColorN_Pattern",value:function(e){return"TilingPattern"===e[0]?this._makeTilingPattern(e):this._makeShadingPattern(e)}},{key:"_makeTilingPattern",value:function(e){var t=e[1],r=e[2],a=e[3]||n.IDENTITY_MATRIX,i=s(e[4],4),c=i[0],l=i[1],u=i[2],h=i[3],f=e[5],d=e[6],p=e[7],g="shading".concat(A++),m=s(n.Util.applyTransform([c,l],a),2),v=m[0],y=m[1],b=s(n.Util.applyTransform([u,h],a),2),w=b[0],k=b[1],S=s(n.Util.singularValueDecompose2dScale(a),2),_=f*S[0],x=d*S[1],C=this.svgFactory.createElement("svg:pattern");C.setAttributeNS(null,"id",g),C.setAttributeNS(null,"patternUnits","userSpaceOnUse"),C.setAttributeNS(null,"width",_),C.setAttributeNS(null,"height",x),C.setAttributeNS(null,"x","".concat(v)),C.setAttributeNS(null,"y","".concat(y));var P=this.svg,T=this.transformMatrix,E=this.current.fillColor,R=this.current.strokeColor,O=this.svgFactory.create(w-v,k-y);if(this.svg=O,this.transformMatrix=a,2===p){var I=n.Util.makeCssRgb.apply(n.Util,o(t));this.current.fillColor=I,this.current.strokeColor=I}return this.executeOpTree(this.convertOpList(r)),this.svg=P,this.transformMatrix=T,this.current.fillColor=E,this.current.strokeColor=R,C.appendChild(O.childNodes[0]),this.defs.appendChild(C),"url(#".concat(g,")")}},{key:"_makeShadingPattern",value:function(e){switch(e[0]){case"RadialAxial":var t,r="shading".concat(A++),a=e[3];switch(e[1]){case"axial":var i=e[4],o=e[5];(t=this.svgFactory.createElement("svg:linearGradient")).setAttributeNS(null,"id",r),t.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),t.setAttributeNS(null,"x1",i[0]),t.setAttributeNS(null,"y1",i[1]),t.setAttributeNS(null,"x2",o[0]),t.setAttributeNS(null,"y2",o[1]);break;case"radial":var s=e[4],l=e[5],u=e[6],h=e[7];(t=this.svgFactory.createElement("svg:radialGradient")).setAttributeNS(null,"id",r),t.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),t.setAttributeNS(null,"cx",l[0]),t.setAttributeNS(null,"cy",l[1]),t.setAttributeNS(null,"r",h),t.setAttributeNS(null,"fx",s[0]),t.setAttributeNS(null,"fy",s[1]),t.setAttributeNS(null,"fr",u);break;default:throw new Error("Unknown RadialAxial type: ".concat(e[1]))}var f,d=c(a);try{for(d.s();!(f=d.n()).done;){var p=f.value,g=this.svgFactory.createElement("svg:stop");g.setAttributeNS(null,"offset",p[0]),g.setAttributeNS(null,"stop-color",p[1]),t.appendChild(g)}}catch(e){d.e(e)}finally{d.f()}return this.defs.appendChild(t),"url(#".concat(r,")");case"Mesh":return(0,n.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error("Unknown IR type: ".concat(e[0]))}}},{key:"setDash",value:function(e,t){this.current.dashArray=e,this.current.dashPhase=t}},{key:"constructPath",value:function(e,t){var r,a=this.current,i=a.x,o=a.y,s=[],l=0,u=c(e);try{for(u.s();!(r=u.n()).done;)switch(0|r.value){case n.OPS.rectangle:i=t[l++],o=t[l++];var h=t[l++],f=t[l++],d=i+h,p=o+f;s.push("M",g(i),g(o),"L",g(d),g(o),"L",g(d),g(p),"L",g(i),g(p),"Z");break;case n.OPS.moveTo:i=t[l++],o=t[l++],s.push("M",g(i),g(o));break;case n.OPS.lineTo:i=t[l++],o=t[l++],s.push("L",g(i),g(o));break;case n.OPS.curveTo:i=t[l+4],o=t[l+5],s.push("C",g(t[l]),g(t[l+1]),g(t[l+2]),g(t[l+3]),g(i),g(o)),l+=6;break;case n.OPS.curveTo2:s.push("C",g(i),g(o),g(t[l]),g(t[l+1]),g(t[l+2]),g(t[l+3])),i=t[l+2],o=t[l+3],l+=4;break;case n.OPS.curveTo3:i=t[l+2],o=t[l+3],s.push("C",g(t[l]),g(t[l+1]),g(i),g(o),g(i),g(o)),l+=4;break;case n.OPS.closePath:s.push("Z")}}catch(e){u.e(e)}finally{u.f()}s=s.join(" "),a.path&&e.length>0&&e[0]!==n.OPS.rectangle&&e[0]!==n.OPS.moveTo?s=a.path.getAttributeNS(null,"d")+s:(a.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().appendChild(a.path)),a.path.setAttributeNS(null,"d",s),a.path.setAttributeNS(null,"fill","none"),a.element=a.path,a.setCurrentPoint(i,o)}},{key:"endPath",value:function(){var e=this.current;if(e.path=null,this.pendingClip)if(e.element){var t="clippath".concat(S++),r=this.svgFactory.createElement("svg:clipPath");r.setAttributeNS(null,"id",t),r.setAttributeNS(null,"transform",m(this.transformMatrix));var n=e.element.cloneNode(!0);"evenodd"===this.pendingClip?n.setAttributeNS(null,"clip-rule","evenodd"):n.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,r.appendChild(n),this.defs.appendChild(r),e.activeClipUrl&&(e.clipGroup=null,this.extraStack.forEach((function(e){e.clipGroup=null})),r.setAttributeNS(null,"clip-path",e.activeClipUrl)),e.activeClipUrl="url(#".concat(t,")"),this.tgrp=null}else this.pendingClip=null}},{key:"clip",value:function(e){this.pendingClip=e}},{key:"closePath",value:function(){var e=this.current;if(e.path){var t="".concat(e.path.getAttributeNS(null,"d"),"Z");e.path.setAttributeNS(null,"d",t)}}},{key:"setLeading",value:function(e){this.current.leading=-e}},{key:"setTextRise",value:function(e){this.current.textRise=e}},{key:"setTextRenderingMode",value:function(e){this.current.textRenderingMode=e}},{key:"setHScale",value:function(e){this.current.textHScale=e/100}},{key:"setRenderingIntent",value:function(e){}},{key:"setFlatness",value:function(e){}},{key:"setGState",value:function(e){var t,r=c(e);try{for(r.s();!(t=r.n()).done;){var a=s(t.value,2),i=a[0],o=a[1];switch(i){case"LW":this.setLineWidth(o);break;case"LC":this.setLineCap(o);break;case"LJ":this.setLineJoin(o);break;case"ML":this.setMiterLimit(o);break;case"D":this.setDash(o[0],o[1]);break;case"RI":this.setRenderingIntent(o);break;case"FL":this.setFlatness(o);break;case"Font":this.setFont(o);break;case"CA":this.setStrokeAlpha(o);break;case"ca":this.setFillAlpha(o);break;default:(0,n.warn)("Unimplemented graphic state operator ".concat(i))}}}catch(e){r.e(e)}finally{r.f()}}},{key:"fill",value:function(){var e=this.current;e.element&&(e.element.setAttributeNS(null,"fill",e.fillColor),e.element.setAttributeNS(null,"fill-opacity",e.fillAlpha),this.endPath())}},{key:"stroke",value:function(){var e=this.current;e.element&&(this._setStrokeAttributes(e.element),e.element.setAttributeNS(null,"fill","none"),this.endPath())}},{key:"_setStrokeAttributes",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=this.current,n=r.dashArray;1!==t&&n.length>0&&(n=n.map((function(e){return t*e}))),e.setAttributeNS(null,"stroke",r.strokeColor),e.setAttributeNS(null,"stroke-opacity",r.strokeAlpha),e.setAttributeNS(null,"stroke-miterlimit",g(r.miterLimit)),e.setAttributeNS(null,"stroke-linecap",r.lineCap),e.setAttributeNS(null,"stroke-linejoin",r.lineJoin),e.setAttributeNS(null,"stroke-width",g(t*r.lineWidth)+"px"),e.setAttributeNS(null,"stroke-dasharray",n.map(g).join(" ")),e.setAttributeNS(null,"stroke-dashoffset",g(t*r.dashPhase)+"px")}},{key:"eoFill",value:function(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}},{key:"fillStroke",value:function(){this.stroke(),this.fill()}},{key:"eoFillStroke",value:function(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}},{key:"closeStroke",value:function(){this.closePath(),this.stroke()}},{key:"closeFillStroke",value:function(){this.closePath(),this.fillStroke()}},{key:"closeEOFillStroke",value:function(){this.closePath(),this.eoFillStroke()}},{key:"paintSolidColorImageMask",value:function(){var e=this.svgFactory.createElement("svg:rect");e.setAttributeNS(null,"x","0"),e.setAttributeNS(null,"y","0"),e.setAttributeNS(null,"width","1px"),e.setAttributeNS(null,"height","1px"),e.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().appendChild(e)}},{key:"paintImageXObject",value:function(e){var t=this.objs.get(e);t?this.paintInlineImageXObject(t):(0,n.warn)("Dependent image with object ID ".concat(e," is not ready yet"))}},{key:"paintInlineImageXObject",value:function(e,t){var r=e.width,n=e.height,a=w(e,this.forceDataSchema,!!t),i=this.svgFactory.createElement("svg:rect");i.setAttributeNS(null,"x","0"),i.setAttributeNS(null,"y","0"),i.setAttributeNS(null,"width",g(r)),i.setAttributeNS(null,"height",g(n)),this.current.element=i,this.clip("nonzero");var o=this.svgFactory.createElement("svg:image");o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a),o.setAttributeNS(null,"x","0"),o.setAttributeNS(null,"y",g(-n)),o.setAttributeNS(null,"width",g(r)+"px"),o.setAttributeNS(null,"height",g(n)+"px"),o.setAttributeNS(null,"transform","scale(".concat(g(1/r)," ").concat(g(-1/n),")")),t?t.appendChild(o):this._ensureTransformGroup().appendChild(o)}},{key:"paintImageMaskXObject",value:function(e){var t=this.current,r=e.width,n=e.height,a=t.fillColor;t.maskId="mask".concat(_++);var i=this.svgFactory.createElement("svg:mask");i.setAttributeNS(null,"id",t.maskId);var o=this.svgFactory.createElement("svg:rect");o.setAttributeNS(null,"x","0"),o.setAttributeNS(null,"y","0"),o.setAttributeNS(null,"width",g(r)),o.setAttributeNS(null,"height",g(n)),o.setAttributeNS(null,"fill",a),o.setAttributeNS(null,"mask","url(#".concat(t.maskId,")")),this.defs.appendChild(i),this._ensureTransformGroup().appendChild(o),this.paintInlineImageXObject(e,i)}},{key:"paintFormXObjectBegin",value:function(e,t){if(Array.isArray(e)&&6===e.length&&this.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t){var r=t[2]-t[0],n=t[3]-t[1],a=this.svgFactory.createElement("svg:rect");a.setAttributeNS(null,"x",t[0]),a.setAttributeNS(null,"y",t[1]),a.setAttributeNS(null,"width",g(r)),a.setAttributeNS(null,"height",g(n)),this.current.element=a,this.clip("nonzero"),this.endPath()}}},{key:"paintFormXObjectEnd",value:function(){}},{key:"_initialize",value:function(e){var t=this.svgFactory.create(e.width,e.height),r=this.svgFactory.createElement("svg:defs");t.appendChild(r),this.defs=r;var n=this.svgFactory.createElement("svg:g");return n.setAttributeNS(null,"transform",m(e.transform)),t.appendChild(n),this.svg=n,t}},{key:"_ensureClipGroup",value:function(){if(!this.current.clipGroup){var e=this.svgFactory.createElement("svg:g");e.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.appendChild(e),this.current.clipGroup=e}return this.current.clipGroup}},{key:"_ensureTransformGroup",value:function(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",m(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().appendChild(this.tgrp):this.svg.appendChild(this.tgrp)),this.tgrp}}]),e}()},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.PDFNodeStream=void 0;var n,a=(n=r(2))&&n.__esModule?n:{default:n},i=r(5),o=r(213);function s(e){return s="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},s(e)}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}function l(e,t){return l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},l(e,t)}function u(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=h(e);if(t){var a=h(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return function(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,r)}}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function f(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,a)}function d(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){f(i,n,a,o,s,"next",e)}function s(e){f(i,n,a,o,s,"throw",e)}o(void 0)}))}}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(e,t){for(var r=0;r0,"Range chunk size must be larger than zero");var o={allowRangeRequests:!1,suggestedLength:void 0},s=parseInt(t("Content-Length"),10);return Number.isInteger(s)?(o.suggestedLength=s,s<=2*a||i||!r||"bytes"!==t("Accept-Ranges")||"identity"!==(t("Content-Encoding")||"identity")||(o.allowRangeRequests=!0),o):o},t.validateResponseStatus=function(e){return 200===e||206===e};var n=r(5),a=r(214)},function(e,t,r){function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){a=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(a)throw i}}return r}}(e,t)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=2&&r.onHeadersReceived&&(r.onHeadersReceived(),delete r.onHeadersReceived),4===n.readyState&&e in this.pendingRequests)if(delete this.pendingRequests[e],0===n.status&&this.isHttp)r.onError&&r.onError(n.status);else{var a=n.status||200;if(200===a&&206===r.expectedStatus||a===r.expectedStatus){var o=function(e){var t=e.response;return"string"!=typeof t?t:(0,i.stringToBytes)(t).buffer}(n);if(206===a){var s=n.getResponseHeader("Content-Range"),c=/bytes (\d+)-(\d+)\/(\d+)/.exec(s);r.onDone({begin:parseInt(c[1],10),chunk:o})}else o?r.onDone({begin:0,chunk:o}):r.onError&&r.onError(n.status)}else r.onError&&r.onError(n.status)}}}},{key:"hasPendingRequests",value:function(){for(var e in this.pendingRequests)return!0;return!1}},{key:"getRequestXhr",value:function(e){return this.pendingRequests[e].xhr}},{key:"isPendingRequest",value:function(e){return e in this.pendingRequests}},{key:"abortAllRequests",value:function(){for(var e in this.pendingRequests)this.abortRequest(0|e)}},{key:"abortRequest",value:function(e){var t=this.pendingRequests[e].xhr;delete this.pendingRequests[e],t.abort()}}]),e}(),d=function(){function e(t){l(this,e),this._source=t,this._manager=new f(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials}),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}return h(e,[{key:"_onRangeRequestReaderClosed",value:function(e){var t=this._rangeRequestReaders.indexOf(e);t>=0&&this._rangeRequestReaders.splice(t,1)}},{key:"getFullReader",value:function(){return(0,i.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new p(this._manager,this._source),this._fullRequestReader}},{key:"getRangeReader",value:function(e,t){var r=new g(this._manager,e,t);return r.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(r),r}},{key:"cancelAllRequests",value:function(e){this._fullRequestReader&&this._fullRequestReader.cancel(e),this._rangeRequestReaders.slice(0).forEach((function(t){t.cancel(e)}))}}]),e}();t.PDFNetworkStream=d;var p=function(){function e(t,r){l(this,e),this._manager=t;var n={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=r.url,this._fullRequestId=t.requestFull(n),this._headersReceivedCapability=(0,i.createPromiseCapability)(),this._disableRange=r.disableRange||!1,this._contentLength=r.length,this._rangeChunkSize=r.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}var t;return h(e,[{key:"_onHeadersReceived",value:function(){var e=this._fullRequestId,t=this._manager.getRequestXhr(e),r=function(e){return t.getResponseHeader(e)},n=(0,o.validateRangeRequestCapabilities)({getResponseHeader:r,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange}),a=n.allowRangeRequests,i=n.suggestedLength;a&&(this._isRangeSupported=!0),this._contentLength=i||this._contentLength,this._filename=(0,o.extractFilenameFromHeader)(r),this._isRangeSupported&&this._manager.abortRequest(e),this._headersReceivedCapability.resolve()}},{key:"_onDone",value:function(e){e&&(this._requests.length>0?this._requests.shift().resolve({value:e.chunk,done:!1}):this._cachedChunks.push(e.chunk)),this._done=!0,this._cachedChunks.length>0||(this._requests.forEach((function(e){e.resolve({value:void 0,done:!0})})),this._requests=[])}},{key:"_onError",value:function(e){var t=this._url,r=(0,o.createResponseStatusError)(e,t);this._storedError=r,this._headersReceivedCapability.reject(r),this._requests.forEach((function(e){e.reject(r)})),this._requests=[],this._cachedChunks=[]}},{key:"_onProgress",value:function(e){this.onProgress&&this.onProgress({loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}},{key:"read",value:(t=c(a.default.mark((function e(){var t,r;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._storedError){e.next=2;break}throw this._storedError;case 2:if(!(this._cachedChunks.length>0)){e.next=5;break}return t=this._cachedChunks.shift(),e.abrupt("return",{value:t,done:!1});case 5:if(!this._done){e.next=7;break}return e.abrupt("return",{value:void 0,done:!0});case 7:return r=(0,i.createPromiseCapability)(),this._requests.push(r),e.abrupt("return",r.promise);case 10:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"cancel",value:function(e){this._done=!0,this._headersReceivedCapability.reject(e),this._requests.forEach((function(e){e.resolve({value:void 0,done:!0})})),this._requests=[],this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}},{key:"filename",get:function(){return this._filename}},{key:"isRangeSupported",get:function(){return this._isRangeSupported}},{key:"isStreamingSupported",get:function(){return this._isStreamingSupported}},{key:"contentLength",get:function(){return this._contentLength}},{key:"headersReady",get:function(){return this._headersReceivedCapability.promise}}]),e}(),g=function(){function e(t,r,n){l(this,e),this._manager=t;var a={onDone:this._onDone.bind(this),onProgress:this._onProgress.bind(this)};this._requestId=t.requestRange(r,n,a),this._requests=[],this._queuedChunk=null,this._done=!1,this.onProgress=null,this.onClosed=null}var t;return h(e,[{key:"_close",value:function(){this.onClosed&&this.onClosed(this)}},{key:"_onDone",value:function(e){var t=e.chunk;this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunk=t,this._done=!0,this._requests.forEach((function(e){e.resolve({value:void 0,done:!0})})),this._requests=[],this._close()}},{key:"_onProgress",value:function(e){!this.isStreamingSupported&&this.onProgress&&this.onProgress({loaded:e.loaded})}},{key:"read",value:(t=c(a.default.mark((function e(){var t,r;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===this._queuedChunk){e.next=4;break}return t=this._queuedChunk,this._queuedChunk=null,e.abrupt("return",{value:t,done:!1});case 4:if(!this._done){e.next=6;break}return e.abrupt("return",{value:void 0,done:!0});case 6:return r=(0,i.createPromiseCapability)(),this._requests.push(r),e.abrupt("return",r.promise);case 9:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"cancel",value:function(e){this._done=!0,this._requests.forEach((function(e){e.resolve({value:void 0,done:!0})})),this._requests=[],this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}},{key:"isStreamingSupported",get:function(){return!1}}]),e}()},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.PDFFetchStream=void 0;var n,a=(n=r(2))&&n.__esModule?n:{default:n},i=r(5),o=r(213);function s(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,a)}function c(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){s(i,n,a,o,c,"next",e)}function c(e){s(i,n,a,o,c,"throw",e)}o(void 0)}))}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var r=0;r=0;--n){var a=this.tryEntries[n],o=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var s=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(s&&c){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;P(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:E(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},n}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}(regeneratorRuntime$1);var runtime=regeneratorRuntime$1.exports(),regenerator=runtime;try{regeneratorRuntime=runtime}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=runtime:Function("r","regeneratorRuntime = r")(runtime)}var pdfjsLib$2=pdf.exports,RenderingStates={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3},PAGE_FRAGMENT=10,RESTART_NUM=3,PDFRenderingQueue$2=function(){function e(t){_classCallCheck(this,e),this.PDFViewer=null,this.cacheList=[],this.restartViewId=null,this.restartNum=0,this.highestPriorityPage=null,this.isPainting=!1,this.limit="number"==typeof t.limit&&t.limit>0?t.limit:PAGE_FRAGMENT}return _createClass(e,[{key:"restartViewId",set:function(e){this.restartViewId!==e&&(this.restartNum=0)}},{key:"setViewer",value:function(e){this.PDFViewer=e}},{key:"setCache",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1?arguments[1]:void 0;if(t.length){var n=this.cacheList.length,a=[],i=Array.from({length:t[1]-t[0]+1},(function(e,r){return r+t[0]}));t[0]-this.cacheList[n-1]>3||this.cacheList[0]-t[1]>3?(a=_toConsumableArray(this.cacheList),this.cacheList=i):this.cacheList=this.cacheList.concat(i.filter((function(t){return!e.cacheList.includes(t)}))||[]).sort((function(e,t){return e-t}));var o=this.cacheList.length-this.limit;if(o>0){var s=this.cacheList.slice(0,o),c=this.cacheList.slice(-o);a=r&&s.every((function(e){return i.includes(e)}))?c:!r&&c.every((function(e){return i.includes(e)}))?s:r?this.cacheList.slice(0,o):this.cacheList.slice(-o)}var l=a.length;if(l){for(var u=0;u=0;){var r=this.cacheList[t],n=this.PDFViewer.getPageView(r);if(!this.isViewFinished(n))return n;t++}return null}},{key:"isViewFinished",value:function(e){return e.renderingState===RenderingStates.FINISHED}},{key:"render",value:function(e){var t=this;switch(e.renderingState){case RenderingStates.FINISHED:break;case RenderingStates.PAUSED:this.highestPriorityPage=e.renderingId,e.resume();break;case RenderingStates.RUNNING:this.highestPriorityPage=e.renderingId;break;case RenderingStates.INITIAL:this.highestPriorityPage=e.renderingId,this.isPainting=!0,e.draw().finally((function(){t.renderHighestPriority()})).catch((function(r){e.finishPaintTask(r),r instanceof pdfjsLib$2.RenderingCancelledException?t.renderHighestPriority():(t.cacheList.includes(e.renderingId)&&t.restartNum<=RESTART_NUM&&(t.restartViewId=e.renderingId,e.reset(),t.renderHighestPriority()),console.log('renderView: "'.concat(r,'"')))}))}}},{key:"clearUp",value:function(){for(;this.cacheList.length;){var e=this.cacheList.shift();this.PDFViewer.getPageView(e).reset()}this.resetQueueConfig()}},{key:"resetQueueConfig",value:function(){this.restartViewId=null,this.restartNum=0,this.highestPriorityPage=null,this.isPainting=!1}}]),e}(),PageViewer$2=function(){function e(t){_classCallCheck(this,e),this.pdfViewer=t.pdfViewer,this.div=t.div,this.renderingQueue=t.renderingQueue,this.renderingId=t.id,this.pdfScale=t.pdfScale,this.height=t.height,this.width=t.width,this._renderingState=RenderingStates.INITIAL,this.page=null,this.viewport=t.defaultViewport||null,this.renderTask=null,this.isLoading=!1,this.renderError=null,this.canvas=null,this.canvasIdPrefix=t.canvasIdPrefix,this.ratio=window.devicePixelRatio>2?2:window.devicePixelRatio||1,this.loadingDiv=document.createElement("div"),this.loadingDiv.classList.add("__pdf_page_loader","page".concat(this.renderingId,"_loader"))}return _createClass(e,[{key:"offsetTop",get:function(){return this.div.offsetTop}},{key:"renderingState",get:function(){return this._renderingState},set:function(e){if(e!==this._renderingState)switch(this._renderingState=e,e){case RenderingStates.PAUSED:case RenderingStates.RUNNING:this.isLoading||(this.div.appendChild(this.loadingDiv),this.isLoading=!0);break;case RenderingStates.INITIAL:case RenderingStates.FINISHED:this.isLoading&&(this.div.removeChild(this.loadingDiv),this.isLoading=!1)}}},{key:"setPdfPage",value:function(e){this.page=e,this.viewport=e.getViewport({scale:this.pdfScale})}},{key:"reset",value:function(){this.renderingState!==RenderingStates.FINISHED&&this.cancelRendering(),this.renderingState=RenderingStates.INITIAL,this.releaseCanvas(),this.renderTask=null,this.isLoading=!1,this.renderError=null}},{key:"cancelRendering",value:function(){this.renderTask&&(this.renderTask.cancel(),this.renderTask=null),this.resume=null}},{key:"releaseCanvas",value:function(){this.canvas&&(this.canvas.width=0,this.canvas.height=0,delete this.canvas);for(var e=this.div.childNodes,t=e.length-1;t>=0;t--){e[t].remove()}this.page&&this.page.cleanup()}},{key:"draw",value:function(){var e=this;return this.renderingState!==RenderingStates.INITIAL&&(console.error("Must be in new state before drawing"),this.reset()),new Promise((function(t,r){var n=e.page;if(!n)return e.renderingState=RenderingStates.FINISHED,r(new Error("page is not loaded"));e.renderingState=RenderingStates.RUNNING;var a=null;e.renderingQueue&&(a=function(t){if(!e.renderingQueue.isHighestPriority(e))return e.renderingState=RenderingStates.PAUSED,void(e.resume=function(){e.renderingState=RenderingStates.RUNNING,t()});t()});var i=e.paintCanvas(),o=e.renderTask=n.render(i);o.onContinue=a.bind(e),o.promise.then((function(){e.div.appendChild(e.canvas),e.finishPaintTask(null),t()}),(function(e){r(e)}))}))}},{key:"finishPaintTask",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.renderTask&&(this.renderTask=null),this.renderingState=RenderingStates.FINISHED,e&&(this.renderError=e)}},{key:"paintCanvas",value:function(){this.canvas=document.createElement("canvas"),this.canvas.classList.add("__pdf_canvas","pdfCanvas_".concat(this.renderingId)),this.canvasIdPrefix&&(this.canvas.id="".concat(this.canvasIdPrefix.toString()).concat(this.renderingId));var e=this.viewport.width*this.ratio,t=this.viewport.height*this.ratio;this.canvas.width=e,this.canvas.height=t,this.canvas.style.width="100%",this.canvas.style.height="100%";var r=this.canvas.getContext("2d",{alpha:!1});return{viewport:this.viewport,canvasContext:r,transform:this.ratio>1?[this.ratio,0,0,this.ratio,0,0]:null}}}]),e}(),PDFViewer$2=function(){function e(t){_classCallCheck(this,e),this.pdfTitle=null,this.pdfDocument=null,this.viewer=t.viewer,this.pdfScale=t.pdfScale,this.scale=t.scale,this.pages=[],this.renderingQueue=t.renderingQueue,this.currentNum=1,this.iniState=!0}var t,r;return _createClass(e,[{key:"numPages",get:function(){return this.pdfDocument?Number(this.pdfDocument.numPages):0}},{key:"pagesCount",get:function(){return this.pages.length}},{key:"setScale",value:function(e){this.scale=e}},{key:"setDocument",value:function(e){this.iniState=!0,e&&(this.pdfDocument!==e&&this.resetPdfViewer(),this.pdfDocument=e,this.renderingQueue.setViewer(this),this.viewer.scrollTop=0,this.iniState=!1,this.setTitle())}},{key:"setTitle",value:(r=_asyncToGenerator(regenerator.mark((function e(){var t,r;return regenerator.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.pdfDocument.getMetadata();case 2:t=e.sent,r=t.info,this.pdfTitle=r.title||"";case 5:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"getPage",value:function(e){return this.pdfDocument.getPage(e)}},{key:"resetPdfViewer",value:function(){this.renderingQueue.clearUp(),this.pdfDocument=null,this.pages=[],this.title=null}},{key:"pushPage",value:function(e){this.pages.push(e)}},{key:"getPageView",value:function(e){return this.pages[e-1]}},{key:"loadPage",value:(t=_asyncToGenerator(regenerator.mark((function e(t){var r;return regenerator.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.page){e.next=2;break}return e.abrupt("return",t.page);case 2:return e.prev=2,e.next=5,this.getPage(t.renderingId);case 5:return r=e.sent,t.setPdfPage(r),e.abrupt("return",r);case 10:return e.prev=10,e.t0=e.catch(2),console.log("Unable to get page for view",e.t0),e.abrupt("return",null);case 14:case"end":return e.stop()}}),e,this,[[2,10]])}))),function(e){return t.apply(this,arguments)})},{key:"renderPageInterval",value:function(e,t){this.currentNum=e;var r=[e-1,e+1];this.numPages<3?r=[1,this.numPages]:(r[0]<1&&(r=[1,3]),r[1]>this.numPages&&(r=[this.numPages-2,this.numPages])),this.renderingQueue.setCache(r,t),this.renderingQueue.renderHighestPriority(!0)}}]),e}();function debounce$2(e,t,r){var n=arguments,a=this,i=null;return function(o){var s=a,c=n;function l(){i=setTimeout((function(){e.apply(s,c),i=null}),t)}r?(clearTimeout(i),l()):i||l()}}function isArrayBuffer$2(e){return"object"===_typeof$1(e)&&null!==e&&void 0!==e.byteLength}function classMap$2(e){var t=[];for(var r in e)e[r]&&t.push(r);return t.join(" ")}function styleMap$2(e){var t=[];for(var r in e)e[r]&&t.push("".concat(r,":").concat(e[r]));return t.join(";")}function addClass$1(e,t){e&&!e.contains(t)&&e.add(t)}function removeClass$1(e,t){e&&e.contains(t)&&e.remove(t)}var pdfStyles$1="\n .__pdf_component {\n background-color: #eee;\n position: relative;\n display: flex;\n flex-direction: column;\n }\n .__pdf_loading_bar {\n --process-percent: 0;\n height: 4px;\n background: rgba(10, 132, 255, 1);\n width: var(--process-percent);\n border-radius: 0 20px 20px 0;\n position: absolute;\n top: 0;\n z-index: 9;\n }\n .__pdf_backTop{\n z-index: 9;\n color: #aaa;\n background: #fff;\n height: 36px;\n width: 36px;\n position: absolute;\n bottom: 20px;\n right: 20px;\n border-radius: 50%;\n border: 1px solid #eee;\n font-size: 20px;\n font-weight: 600;\n text-align: center;\n line-height: 36px;\n }\n .__pdf_component_out_box,\n .__pdf_component .__pdf_error {\n display: flex;\n overflow: hidden;\n flex-grow: 1;\n width: 100%;\n position: relative;\n }\n .__pdf_component .__pdf_error {\n justify-content: center;\n align-items: center;\n }\n .__pdf_component_box {\n overflow: auto;\n position: relative;\n width: 100%;\n margin: 8px 0;\n }\n .__pdf_container {\n width: 100%;\n box-sizing: border-box;\n min-height: 100%;\n font-size: 0;\n }\n .__pdf_pageNum_box {\n position: absolute;\n z-index: 9;\n top: 20px;\n left: 24px;\n background: #fff;\n border-radius: 4px;\n font-family: PingFangSC-Regular;\n font-size: 14px;\n color: #ccc;\n font-weight: 600;\n display: inline-block;\n padding: 4px 8px;\n }\n .__pdf_forceRead_desc {\n background-color: #fff5e7;\n color: #8c6d4d;\n text-align: center;\n height: 36px;\n line-height: 36px;\n font-size: 14px;\n font-weight: 600;\n font-family: PingFangSC-Regular;\n }\n .__pdf_forceRead_btn {\n height: 45px;\n color: #fff;\n font-size: 16px;\n text-align: center;\n line-height: 45px;\n font-weight: 600;\n background: #ffffff;\n background-size: contain;\n background-repeat: no-repeat;\n background-position: center;\n }\n .__pdf_page {\n margin: 8px 8px 0;\n box-sizing: border-box;\n position: relative;\n background-color: #fff;\n box-shadow: 0px 0px 3px #ccc;\n }\n .__pdf_page:first-child {\n margin-top: 0;\n }\n .__pdf_canvas {\n background-color: #fff;\n }\n .__pdf_loader,\n .__pdf_page_loader {\n border: 5px solid #f3f3f3;\n border-top: 5px solid #555;\n border-radius: 50%;\n width: 50px;\n height: 50px;\n display: inline-block;\n animation: __pdf_spin 2s linear infinite;\n position: absolute;\n left: calc(50% - 25px);\n top: 40%;\n z-index: 10;\n }\n \n @keyframes __pdf_spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n @keyframes __pdf_hide {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n .__pdf_component .__pdf_hide-num {\n opacity: 0;\n animation: __pdf_hide 1s 1;\n }\n .__pdf_component .__pdf_display-none {\n display: none;\n }\n ",utils=Object.freeze({__proto__:null,RenderingStates:RenderingStates,PAGE_FRAGMENT:PAGE_FRAGMENT,PDFRenderingQueue:PDFRenderingQueue$2,PageViewer:PageViewer$2,PDFViewer:PDFViewer$2,debounce:debounce$2,isArrayBuffer:isArrayBuffer$2,classMap:classMap$2,styleMap:styleMap$2,addClass:addClass$1,removeClass:removeClass$1,pdfStyles:pdfStyles$1}),require$$0=getAugmentedNamespace(utils),pdf_worker={exports:{}},_templateObject,_templateObject2;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_getPrototypeOf(e)}function _superPropBase(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf(e)););return e}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=_superPropBase(e,t);if(n){var a=Object.getOwnPropertyDescriptor(n,t);return a.get?a.get.call(arguments.length<3?e:r):a.value}},_get.apply(this,arguments)}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_setPrototypeOf(e,t)}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof$1(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var r,n=_getPrototypeOf(e);if(t){var a=_getPrototypeOf(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return _possibleConstructorReturn(this,r)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}
/**
* @licstart The following is the entire license notice for the
* Javascript code in this page
@@ -258,4 +258,4 @@ const previousStylePropertyCache=new WeakMap,styleMap$3=directive((e=>t=>{if(!(t
* @licend The above is the entire license notice for the
* Javascript code in this page
*/
-!function(e,t){var r;r=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"WorkerMessageHandler",{enumerable:!0,get:function(){return n.WorkerMessageHandler}});var n=r(1)},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerMessageHandler=t.WorkerTask=void 0;var n,a=(n=r(2))&&n.__esModule?n:{default:n},i=r(5),o=r(198),s=r(199),c=r(7),l=r(238),u=r(239),h=r(201);function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){a=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(a)throw i}}return r}}(e,t)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=i.VerbosityLevel.INFOS?Date.now():0;r.getOperatorList({handler:A,sink:t,task:a,intent:e.intent,renderInteractiveForms:e.renderInteractiveForms}).then((function(e){P(a),o&&(0,i.info)("page=".concat(n+1," - getOperatorList: time=")+"".concat(Date.now()-o,"ms, len=").concat(e.length)),t.close()}),(function(e){P(a),a.terminated||(A.send("UnsupportedFeature",{featureId:i.UNSUPPORTED_FEATURES.errorOperatorList}),t.error(e))}))}))}),this),A.on("GetTextContent",(function(e,t){var n=e.pageIndex;t.onPull=function(e){},t.onCancel=function(e){},r.getPage(n).then((function(r){var a=new g("GetTextContent: page "+n);C(a);var o=m>=i.VerbosityLevel.INFOS?Date.now():0;r.extractTextContent({handler:A,task:a,sink:t,normalizeWhitespace:e.normalizeWhitespace,combineTextItems:e.combineTextItems}).then((function(){P(a),o&&(0,i.info)("page=".concat(n+1," - getTextContent: time=")+"".concat(Date.now()-o,"ms")),t.close()}),(function(e){P(a),a.terminated||t.error(e)}))}))})),A.on("FontFallback",(function(e){return r.fontFallback(e.id,A)})),A.on("Cleanup",(function(e){return r.cleanup(!0)})),A.on("Terminate",(function(e){n=!0;var t=[];if(r){r.terminate(new i.AbortException("Worker was terminated."));var a=r.cleanup();t.push(a),r=null}else(0,o.clearPrimitiveCaches)();return c&&c(new i.AbortException("Worker was terminated.")),d.forEach((function(e){t.push(e.finished),e.terminate()})),Promise.all(t).then((function(){A.destroy(),A=null}))})),A.on("Ready",(function(t){!function(e){function t(e){x(),A.send("GetDoc",{pdfInfo:e})}function a(e){if(x(),e instanceof i.PasswordException){var t=new g("PasswordException: response ".concat(e.code));C(t),A.sendWithPromise("PasswordRequest",e).then((function(e){var n=e.password;P(t),r.updatePassword(n),o()})).catch((function(){P(t),A.send("DocException",e)}))}else e instanceof i.InvalidPDFException||e instanceof i.MissingPDFException||e instanceof i.UnexpectedResponseException||e instanceof i.UnknownErrorException?A.send("DocException",e):A.send("DocException",new i.UnknownErrorException(e.message,e.toString()))}function o(){x(),T(!1).then(t,(function(e){x(),e instanceof h.XRefParseException?(r.requestLoadedStream(),r.onLoadedStream().then((function(){x(),T(!0).then(t,a)}))):a(e)}),a)}x(),R(e,{maxImageSize:e.maxImageSize,disableFontFace:e.disableFontFace,ignoreErrors:e.ignoreErrors,isEvalSupported:e.isEvalSupported,fontExtraProperties:e.fontExtraProperties}).then((function(e){if(n)throw e.terminate(new i.AbortException("Worker was terminated.")),new Error("Worker was terminated");(r=e).onLoadedStream().then((function(e){A.send("DataLoaded",{length:e.bytes.byteLength})}))})).then(o,a)}(e),e=null})),_},initializeFromPort:function(e){var t=new l.MessageHandler("worker","main",e);v.setup(t,e),t.send("ready",null)}};t.WorkerMessageHandler=v,"undefined"==typeof window&&!c.isNodeJS&&"undefined"!=typeof self&&"function"==typeof(m=self).postMessage&&"onmessage"in m&&v.initializeFromPort(self)},function(e,t,r){e.exports=r(3)},function(e,t,r){(function(e){function t(e){return t="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},t(e)}var r=function(e){var r,n=Object.prototype,a=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(e,t,r,n){var a=t&&t.prototype instanceof m?t:m,i=Object.create(a.prototype),o=new T(n||[]);return i._invoke=function(e,t,r){var n=h;return function(a,i){if(n===d)throw new Error("Generator is already running");if(n===p){if("throw"===a)throw i;return R()}for(r.method=a,r.arg=i;;){var o=r.delegate;if(o){var s=x(o,r);if(s){if(s===g)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===h)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=d;var c=u(e,t,r);if("normal"===c.type){if(n=r.done?p:f,c.arg===g)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=p,r.method="throw",r.arg=c.arg)}}}(e,r,o),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var h="suspendedStart",f="suspendedYield",d="executing",p="completed",g={};function m(){}function v(){}function y(){}var b={};b[o]=function(){return this};var w=Object.getPrototypeOf,S=w&&w(w(E([])));S&&S!==n&&a.call(S,o)&&(b=S);var k=y.prototype=m.prototype=Object.create(b);function _(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function A(e,r){function n(i,o,s,c){var l=u(e[i],e,o);if("throw"!==l.type){var h=l.arg,f=h.value;return f&&"object"===t(f)&&a.call(f,"__await")?r.resolve(f.__await).then((function(e){n("next",e,s,c)}),(function(e){n("throw",e,s,c)})):r.resolve(f).then((function(e){h.value=e,s(h)}),(function(e){return n("throw",e,s,c)}))}c(l.arg)}var i;this._invoke=function(e,t){function a(){return new r((function(r,a){n(e,t,r,a)}))}return i=i?i.then(a,a):a()}}function x(e,t){var n=e.iterator[t.method];if(n===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=r,x(e,t),"throw"===t.method))return g;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,g;var i=a.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=r),t.delegate=null,g):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,g)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function E(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=a.call(o,"catchLoc"),l=a.call(o,"finallyLoc");if(c&&l){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;P(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:E(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=r),g}},e}("object"===t(e)?e.exports:{});try{regeneratorRuntime=r}catch(e){Function("r","regeneratorRuntime = r")(r)}}).call(this,r(4)(e))},function(e,t,r){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){function n(e,t){for(var r=0;r=u.INFOS&&console.log("Info: ".concat(e))},t.isArrayBuffer=function(e){return"object"===a(e)&&null!==e&&void 0!==e.byteLength},t.isArrayEqual=function(e,t){return e.length===t.length&&e.every((function(e,r){return e===t[r]}))},t.isBool=function(e){return"boolean"==typeof e},t.isEmptyObj=function(e){for(var t in e)return!1;return!0},t.isNum=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSameOrigin=function(e,t){var r;try{if(!(r=new URL(e)).origin||"null"===r.origin)return!1}catch(e){return!1}var n=new URL(t,r);return r.origin===n.origin},t.createValidAbsoluteUrl=function(e,t){if(!e)return null;try{var r=t?new URL(e,t):new URL(e);if(function(e){if(!e)return!1;switch(e.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(r))return r}catch(e){}return null},t.removeNullCharacters=function(e){return"string"!=typeof e?(f("The argument for removeNullCharacters must be a string."),e):e.replace(A,"")},t.setVerbosityLevel=function(e){Number.isInteger(e)&&(h=e)},t.shadow=g,t.string32=function(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)},t.stringToBytes=x,t.stringToPDFString=function(e){var t=e.length,r=[];if("þ"===e[0]&&"ÿ"===e[1])for(var n=2;n=u.WARNINGS&&console.log("Warning: ".concat(e))}function d(e){throw new Error(e)}function p(e,t){e||d(t)}function g(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!1}),r}var m=function(){function e(t){this.constructor===e&&d("Cannot initialize BaseException."),this.message=t,this.name=this.constructor.name}return e.prototype=new Error,e.constructor=e,e}();t.BaseException=m;var v=function(e){o(r,e);var t=c(r);function r(e,n){var a;return i(this,r),(a=t.call(this,e)).code=n,a}return r}(m);t.PasswordException=v;var y=function(e){o(r,e);var t=c(r);function r(e,n){var a;return i(this,r),(a=t.call(this,e)).details=n,a}return r}(m);t.UnknownErrorException=y;var b=function(e){o(r,e);var t=c(r);function r(){return i(this,r),t.apply(this,arguments)}return r}(m);t.InvalidPDFException=b;var w=function(e){o(r,e);var t=c(r);function r(){return i(this,r),t.apply(this,arguments)}return r}(m);t.MissingPDFException=w;var S=function(e){o(r,e);var t=c(r);function r(e,n){var a;return i(this,r),(a=t.call(this,e)).status=n,a}return r}(m);t.UnexpectedResponseException=S;var k=function(e){o(r,e);var t=c(r);function r(){return i(this,r),t.apply(this,arguments)}return r}(m);t.FormatError=k;var _=function(e){o(r,e);var t=c(r);function r(){return i(this,r),t.apply(this,arguments)}return r}(m);t.AbortException=_;var A=/\x00/g;function x(e){p("string"==typeof e,"Invalid argument for stringToBytes");for(var t=e.length,r=new Uint8Array(t),n=0;ne[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}},{key:"intersect",value:function(t,r){function n(e,t){return e-t}var a=[t[0],t[2],r[0],r[2]].sort(n),i=[t[1],t[3],r[1],r[3]].sort(n),o=[];return t=e.normalizeRect(t),r=e.normalizeRect(r),a[0]===t[0]&&a[1]===r[0]||a[0]===r[0]&&a[1]===t[0]?(o[0]=a[1],o[2]=a[2],i[0]===t[1]&&i[1]===r[1]||i[0]===r[1]&&i[1]===t[1]?(o[1]=i[1],o[3]=i[2],o):null):null}}],(r=null)&&n(t.prototype,r),a&&n(t,a),e}();t.Util=R;var O,I=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364],F=(O="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",function(e,t){if(!(arguments.length>2&&void 0!==arguments[2]&&arguments[2])&&URL.createObjectURL){var r=new Blob([e],{type:t});return URL.createObjectURL(r)}for(var n="data:".concat(t,";base64,"),a=0,i=e.length;a>2]+O[(3&o)<<4|s>>4]+O[a+1>6:64]+O[a+21?!!arguments[1]:!this.contains(e);return this[t?"add":"remove"](e),t}),function(){if(i&&s){var e=window.history.pushState,t=window.history.replaceState;window.history.pushState=function(t,r,n){var a=void 0===n?[t,r]:[t,r,n];e.apply(this,a)},window.history.replaceState=function(e,r,n){var a=void 0===n?[e,r]:[e,r,n];t.apply(this,a)}}}(),String.prototype.startsWith||r(53),String.prototype.endsWith||r(64),String.prototype.includes||r(66),Array.prototype.includes||r(68),Array.from||r(76),Object.assign||r(98),Math.log2||(Math.log2=r(101)),Number.isNaN||(Number.isNaN=r(103)),Number.isInteger||(Number.isInteger=r(105)),Uint8Array.prototype.slice||r(108),globalThis.Promise&&globalThis.Promise.allSettled||(globalThis.Promise=r(113)),globalThis.URL=r(136),function(){var e=!1;if("undefined"!=typeof ReadableStream)try{new ReadableStream({start:function(e){e.close()}}),e=!0}catch(e){}e||(globalThis.ReadableStream=r(143).ReadableStream)}(),globalThis.Map&&globalThis.Map.prototype.entries||(globalThis.Map=r(144)),globalThis.Set&&globalThis.Set.prototype.entries||(globalThis.Set=r(151)),globalThis.WeakMap||(globalThis.WeakMap=r(153)),globalThis.WeakSet||(globalThis.WeakSet=r(159)),String.prototype.codePointAt||r(161),String.fromCodePoint||(String.fromCodePoint=r(163)),globalThis.Symbol||r(165),String.prototype.padStart||r(188),String.prototype.padEnd||r(193),Object.values||(Object.values=r(195))}},function(e,t,r){function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.isNodeJS=void 0;var a="object"===("undefined"==typeof process?"undefined":n(process))&&process+""=="[object process]"&&!process.versions.nw&&!process.versions.electron;t.isNodeJS=a},function(e,t,r){r(9),e.exports=r(11)},function(e,t,r){r(10)({global:!0},{globalThis:r(11)})},function(e,t,r){var n=r(11),a=r(12).f,i=r(26),o=r(29),s=r(30),c=r(40),l=r(52);e.exports=function(e,t){var r,u,h,f,d,p=e.target,g=e.global,m=e.stat;if(r=g?n:m?n[p]||s(p,{}):(n[p]||{}).prototype)for(u in t){if(f=t[u],h=e.noTargetGet?(d=a(r,u))&&d.value:r[u],!l(g?u:p+(m?".":"#")+u,e.forced)&&void 0!==h){if(typeof f==typeof h)continue;c(f,h)}(e.sham||h&&h.sham)&&i(f,"sham",!0),o(r,u,f,e)}}},function(e,t){var r=function(e){return e&&e.Math==Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof commonjsGlobal&&commonjsGlobal)||Function("return this")()},function(e,t,r){var n=r(13),a=r(15),i=r(16),o=r(17),s=r(21),c=r(23),l=r(24),u=Object.getOwnPropertyDescriptor;t.f=n?u:function(e,t){if(e=o(e),t=s(t,!0),l)try{return u(e,t)}catch(e){}if(c(e,t))return i(!a.f.call(e,t),e[t])}},function(e,t,r){var n=r(14);e.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,r){var n={}.propertyIsEnumerable,a=Object.getOwnPropertyDescriptor,i=a&&!n.call({1:2},1);t.f=i?function(e){var t=a(this,e);return!!t&&t.enumerable}:n},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,r){var n=r(18),a=r(20);e.exports=function(e){return n(a(e))}},function(e,t,r){var n=r(14),a=r(19),i="".split;e.exports=n((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==a(e)?i.call(e,""):Object(e)}:Object},function(e,t){var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,r){var n=r(22);e.exports=function(e,t){if(!n(e))return e;var r,a;if(t&&"function"==typeof(r=e.toString)&&!n(a=r.call(e)))return a;if("function"==typeof(r=e.valueOf)&&!n(a=r.call(e)))return a;if(!t&&"function"==typeof(r=e.toString)&&!n(a=r.call(e)))return a;throw TypeError("Can't convert object to primitive value")}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){var r={}.hasOwnProperty;e.exports=function(e,t){return r.call(e,t)}},function(e,t,r){var n=r(13),a=r(14),i=r(25);e.exports=!n&&!a((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},function(e,t,r){var n=r(11),a=r(22),i=n.document,o=a(i)&&a(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t,r){var n=r(13),a=r(27),i=r(16);e.exports=n?function(e,t,r){return a.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},function(e,t,r){var n=r(13),a=r(24),i=r(28),o=r(21),s=Object.defineProperty;t.f=n?s:function(e,t,r){if(i(e),t=o(t,!0),i(r),a)try{return s(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},function(e,t,r){var n=r(22);e.exports=function(e){if(!n(e))throw TypeError(String(e)+" is not an object");return e}},function(e,t,r){var n=r(11),a=r(26),i=r(23),o=r(30),s=r(31),c=r(33),l=c.get,u=c.enforce,h=String(String).split("String");(e.exports=function(e,t,r,s){var c=!!s&&!!s.unsafe,l=!!s&&!!s.enumerable,f=!!s&&!!s.noTargetGet;"function"==typeof r&&("string"!=typeof t||i(r,"name")||a(r,"name",t),u(r).source=h.join("string"==typeof t?t:"")),e!==n?(c?!f&&e[t]&&(l=!0):delete e[t],l?e[t]=r:a(e,t,r)):l?e[t]=r:o(t,r)})(Function.prototype,"toString",(function(){return"function"==typeof this&&l(this).source||s(this)}))},function(e,t,r){var n=r(11),a=r(26);e.exports=function(e,t){try{a(n,e,t)}catch(r){n[e]=t}return t}},function(e,t,r){var n=r(32),a=Function.toString;"function"!=typeof n.inspectSource&&(n.inspectSource=function(e){return a.call(e)}),e.exports=n.inspectSource},function(e,t,r){var n=r(11),a=r(30),i="__core-js_shared__",o=n[i]||a(i,{});e.exports=o},function(e,t,r){var n,a,i,o=r(34),s=r(11),c=r(22),l=r(26),u=r(23),h=r(35),f=r(39),d=s.WeakMap;if(o){var p=new d,g=p.get,m=p.has,v=p.set;n=function(e,t){return v.call(p,e,t),t},a=function(e){return g.call(p,e)||{}},i=function(e){return m.call(p,e)}}else{var y=h("state");f[y]=!0,n=function(e,t){return l(e,y,t),t},a=function(e){return u(e,y)?e[y]:{}},i=function(e){return u(e,y)}}e.exports={set:n,get:a,has:i,enforce:function(e){return i(e)?a(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!c(t)||(r=a(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return r}}}},function(e,t,r){var n=r(11),a=r(31),i=n.WeakMap;e.exports="function"==typeof i&&/native code/.test(a(i))},function(e,t,r){var n=r(36),a=r(38),i=n("keys");e.exports=function(e){return i[e]||(i[e]=a(e))}},function(e,t,r){var n=r(37),a=r(32);(e.exports=function(e,t){return a[e]||(a[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.5",mode:n?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(e,t){e.exports=!1},function(e,t){var r=0,n=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++r+n).toString(36)}},function(e,t){e.exports={}},function(e,t,r){var n=r(23),a=r(41),i=r(12),o=r(27);e.exports=function(e,t){for(var r=a(t),s=o.f,c=i.f,l=0;lc;)n(s,r=t[c++])&&(~i(l,r)||l.push(r));return l}},function(e,t,r){var n=r(17),a=r(47),i=r(49),o=function(e){return function(t,r,o){var s,c=n(t),l=a(c.length),u=i(o,l);if(e&&r!=r){for(;l>u;)if((s=c[u++])!=s)return!0}else for(;l>u;u++)if((e||u in c)&&c[u]===r)return e||u||0;return!e&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}},function(e,t,r){var n=r(48),a=Math.min;e.exports=function(e){return e>0?a(n(e),9007199254740991):0}},function(e,t){var r=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:r)(e)}},function(e,t,r){var n=r(48),a=Math.max,i=Math.min;e.exports=function(e,t){var r=n(e);return r<0?a(r+t,0):i(r,t)}},function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,r){var n=r(14),a=/#|\.prototype\./,i=function(e,t){var r=s[o(e)];return r==l||r!=c&&("function"==typeof t?n(t):!!t)},o=i.normalize=function(e){return String(e).replace(a,".").toLowerCase()},s=i.data={},c=i.NATIVE="N",l=i.POLYFILL="P";e.exports=i},function(e,t,r){r(54);var n=r(61);e.exports=n("String","startsWith")},function(e,t,r){var n,a=r(10),i=r(12).f,o=r(47),s=r(55),c=r(20),l=r(60),u=r(37),h="".startsWith,f=Math.min,d=l("startsWith");a({target:"String",proto:!0,forced:!(!u&&!d&&(n=i(String.prototype,"startsWith"),n&&!n.writable)||d)},{startsWith:function(e){var t=String(c(this));s(e);var r=o(f(arguments.length>1?arguments[1]:void 0,t.length)),n=String(e);return h?h.call(t,n,r):t.slice(r,r+n.length)===n}})},function(e,t,r){var n=r(56);e.exports=function(e){if(n(e))throw TypeError("The method doesn't accept regular expressions");return e}},function(e,t,r){var n=r(22),a=r(19),i=r(57)("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[i])?!!t:"RegExp"==a(e))}},function(e,t,r){var n=r(11),a=r(36),i=r(23),o=r(38),s=r(58),c=r(59),l=a("wks"),u=n.Symbol,h=c?u:u&&u.withoutSetter||o;e.exports=function(e){return i(l,e)||(s&&i(u,e)?l[e]=u[e]:l[e]=h("Symbol."+e)),l[e]}},function(e,t,r){var n=r(14);e.exports=!!Object.getOwnPropertySymbols&&!n((function(){return!String(Symbol())}))},function(e,t,r){var n=r(58);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(e,t,r){var n=r(57)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[n]=!1,"/./"[e](t)}catch(e){}}return!1}},function(e,t,r){var n=r(11),a=r(62),i=Function.call;e.exports=function(e,t,r){return a(i,n[e].prototype[t],r)}},function(e,t,r){var n=r(63);e.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 0:return function(){return e.call(t)};case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,a){return e.call(t,r,n,a)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},function(e,t,r){r(65);var n=r(61);e.exports=n("String","endsWith")},function(e,t,r){var n,a=r(10),i=r(12).f,o=r(47),s=r(55),c=r(20),l=r(60),u=r(37),h="".endsWith,f=Math.min,d=l("endsWith");a({target:"String",proto:!0,forced:!(!u&&!d&&(n=i(String.prototype,"endsWith"),n&&!n.writable)||d)},{endsWith:function(e){var t=String(c(this));s(e);var r=arguments.length>1?arguments[1]:void 0,n=o(t.length),a=void 0===r?n:f(o(r),n),i=String(e);return h?h.call(t,i,a):t.slice(a-i.length,a)===i}})},function(e,t,r){r(67);var n=r(61);e.exports=n("String","includes")},function(e,t,r){var n=r(10),a=r(55),i=r(20);n({target:"String",proto:!0,forced:!r(60)("includes")},{includes:function(e){return!!~String(i(this)).indexOf(a(e),arguments.length>1?arguments[1]:void 0)}})},function(e,t,r){r(69);var n=r(61);e.exports=n("Array","includes")},function(e,t,r){var n=r(10),a=r(46).includes,i=r(70);n({target:"Array",proto:!0,forced:!r(75)("indexOf",{ACCESSORS:!0,1:0})},{includes:function(e){return a(this,e,arguments.length>1?arguments[1]:void 0)}}),i("includes")},function(e,t,r){var n=r(57),a=r(71),i=r(27),o=n("unscopables"),s=Array.prototype;null==s[o]&&i.f(s,o,{configurable:!0,value:a(null)}),e.exports=function(e){s[o][e]=!0}},function(e,t,r){var n,a=r(28),i=r(72),o=r(50),s=r(39),c=r(74),l=r(25),u=r(35),h="prototype",f="script",d=u("IE_PROTO"),p=function(){},g=function(e){return"<"+f+">"+e+""+f+">"},m=function(){try{n=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t,r;m=n?function(e){e.write(g("")),e.close();var t=e.parentWindow.Object;return e=null,t}(n):(t=l("iframe"),r="java"+f+":",t.style.display="none",c.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(g("document.F=Object")),e.close(),e.F);for(var a=o.length;a--;)delete m[h][o[a]];return m()};s[d]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(p[h]=a(e),r=new p,p[h]=null,r[d]=e):r=m(),void 0===t?r:i(r,t)}},function(e,t,r){var n=r(13),a=r(27),i=r(28),o=r(73);e.exports=n?Object.defineProperties:function(e,t){i(e);for(var r,n=o(t),s=n.length,c=0;s>c;)a.f(e,r=n[c++],t[r]);return e}},function(e,t,r){var n=r(45),a=r(50);e.exports=Object.keys||function(e){return n(e,a)}},function(e,t,r){var n=r(42);e.exports=n("document","documentElement")},function(e,t,r){var n=r(13),a=r(14),i=r(23),o=Object.defineProperty,s={},c=function(e){throw e};e.exports=function(e,t){if(i(s,e))return s[e];t||(t={});var r=[][e],l=!!i(t,"ACCESSORS")&&t.ACCESSORS,u=i(t,0)?t[0]:c,h=i(t,1)?t[1]:void 0;return s[e]=!!r&&!a((function(){if(l&&!n)return!0;var e={length:-1};l?o(e,1,{enumerable:!0,get:c}):e[1]=1,r.call(e,u,h)}))}},function(e,t,r){r(77),r(89);var n=r(43);e.exports=n.Array.from},function(e,t,r){var n=r(78).charAt,a=r(33),i=r(79),o="String Iterator",s=a.set,c=a.getterFor(o);i(String,"String",(function(e){s(this,{type:o,string:String(e),index:0})}),(function(){var e,t=c(this),r=t.string,a=t.index;return a>=r.length?{value:void 0,done:!0}:(e=n(r,a),t.index+=e.length,{value:e,done:!1})}))},function(e,t,r){var n=r(48),a=r(20),i=function(e){return function(t,r){var i,o,s=String(a(t)),c=n(r),l=s.length;return c<0||c>=l?e?"":void 0:(i=s.charCodeAt(c))<55296||i>56319||c+1===l||(o=s.charCodeAt(c+1))<56320||o>57343?e?s.charAt(c):i:e?s.slice(c,c+2):o-56320+(i-55296<<10)+65536}};e.exports={codeAt:i(!1),charAt:i(!0)}},function(e,t,r){var n=r(10),a=r(80),i=r(82),o=r(87),s=r(85),c=r(26),l=r(29),u=r(57),h=r(37),f=r(86),d=r(81),p=d.IteratorPrototype,g=d.BUGGY_SAFARI_ITERATORS,m=u("iterator"),v="keys",y="values",b="entries",w=function(){return this};e.exports=function(e,t,r,u,d,S,k){a(r,t,u);var _,A,x,C=function(e){if(e===d&&O)return O;if(!g&&e in E)return E[e];switch(e){case v:case y:case b:return function(){return new r(this,e)}}return function(){return new r(this)}},P=t+" Iterator",T=!1,E=e.prototype,R=E[m]||E["@@iterator"]||d&&E[d],O=!g&&R||C(d),I="Array"==t&&E.entries||R;if(I&&(_=i(I.call(new e)),p!==Object.prototype&&_.next&&(h||i(_)===p||(o?o(_,p):"function"!=typeof _[m]&&c(_,m,w)),s(_,P,!0,!0),h&&(f[P]=w))),d==y&&R&&R.name!==y&&(T=!0,O=function(){return R.call(this)}),h&&!k||E[m]===O||c(E,m,O),f[t]=O,d)if(A={values:C(y),keys:S?O:C(v),entries:C(b)},k)for(x in A)(g||T||!(x in E))&&l(E,x,A[x]);else n({target:t,proto:!0,forced:g||T},A);return A}},function(e,t,r){var n=r(81).IteratorPrototype,a=r(71),i=r(16),o=r(85),s=r(86),c=function(){return this};e.exports=function(e,t,r){var l=t+" Iterator";return e.prototype=a(n,{next:i(1,r)}),o(e,l,!1,!0),s[l]=c,e}},function(e,t,r){var n,a,i,o=r(82),s=r(26),c=r(23),l=r(57),u=r(37),h=l("iterator"),f=!1;[].keys&&("next"in(i=[].keys())?(a=o(o(i)))!==Object.prototype&&(n=a):f=!0),null==n&&(n={}),u||c(n,h)||s(n,h,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:f}},function(e,t,r){var n=r(23),a=r(83),i=r(35),o=r(84),s=i("IE_PROTO"),c=Object.prototype;e.exports=o?Object.getPrototypeOf:function(e){return e=a(e),n(e,s)?e[s]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?c:null}},function(e,t,r){var n=r(20);e.exports=function(e){return Object(n(e))}},function(e,t,r){var n=r(14);e.exports=!n((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},function(e,t,r){var n=r(27).f,a=r(23),i=r(57)("toStringTag");e.exports=function(e,t,r){e&&!a(e=r?e:e.prototype,i)&&n(e,i,{configurable:!0,value:t})}},function(e,t){e.exports={}},function(e,t,r){var n=r(28),a=r(88);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),t=r instanceof Array}catch(e){}return function(r,i){return n(r),a(i),t?e.call(r,i):r.__proto__=i,r}}():void 0)},function(e,t,r){var n=r(22);e.exports=function(e){if(!n(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},function(e,t,r){var n=r(10),a=r(90);n({target:"Array",stat:!0,forced:!r(97)((function(e){Array.from(e)}))},{from:a})},function(e,t,r){var n=r(62),a=r(83),i=r(91),o=r(92),s=r(47),c=r(93),l=r(94);e.exports=function(e){var t,r,u,h,f,d,p=a(e),g="function"==typeof this?this:Array,m=arguments.length,v=m>1?arguments[1]:void 0,y=void 0!==v,b=l(p),w=0;if(y&&(v=n(v,m>2?arguments[2]:void 0,2)),null==b||g==Array&&o(b))for(r=new g(t=s(p.length));t>w;w++)d=y?v(p[w],w):p[w],c(r,w,d);else for(f=(h=b.call(p)).next,r=new g;!(u=f.call(h)).done;w++)d=y?i(h,v,[u.value,w],!0):u.value,c(r,w,d);return r.length=w,r}},function(e,t,r){var n=r(28);e.exports=function(e,t,r,a){try{return a?t(n(r)[0],r[1]):t(r)}catch(t){var i=e.return;throw void 0!==i&&n(i.call(e)),t}}},function(e,t,r){var n=r(57),a=r(86),i=n("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(a.Array===e||o[i]===e)}},function(e,t,r){var n=r(21),a=r(27),i=r(16);e.exports=function(e,t,r){var o=n(t);o in e?a.f(e,o,i(0,r)):e[o]=r}},function(e,t,r){var n=r(95),a=r(86),i=r(57)("iterator");e.exports=function(e){if(null!=e)return e[i]||e["@@iterator"]||a[n(e)]}},function(e,t,r){var n=r(96),a=r(19),i=r(57)("toStringTag"),o="Arguments"==a(function(){return arguments}());e.exports=n?a:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?r:o?a(t):"Object"==(n=a(t))&&"function"==typeof t.callee?"Arguments":n}},function(e,t,r){var n={};n[r(57)("toStringTag")]="z",e.exports="[object z]"===String(n)},function(e,t,r){var n=r(57)("iterator"),a=!1;try{var i=0,o={next:function(){return{done:!!i++}},return:function(){a=!0}};o[n]=function(){return this},Array.from(o,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!a)return!1;var r=!1;try{var i={};i[n]=function(){return{next:function(){return{done:r=!0}}}},e(i)}catch(e){}return r}},function(e,t,r){r(99);var n=r(43);e.exports=n.Object.assign},function(e,t,r){var n=r(10),a=r(100);n({target:"Object",stat:!0,forced:Object.assign!==a},{assign:a})},function(e,t,r){var n=r(13),a=r(14),i=r(73),o=r(51),s=r(15),c=r(83),l=r(18),u=Object.assign,h=Object.defineProperty;e.exports=!u||a((function(){if(n&&1!==u({b:1},u(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol(),a="abcdefghijklmnopqrst";return e[r]=7,a.split("").forEach((function(e){t[e]=e})),7!=u({},e)[r]||i(u({},t)).join("")!=a}))?function(e,t){for(var r=c(e),a=arguments.length,u=1,h=o.f,f=s.f;a>u;)for(var d,p=l(arguments[u++]),g=h?i(p).concat(h(p)):i(p),m=g.length,v=0;m>v;)d=g[v++],n&&!f.call(p,d)||(r[d]=p[d]);return r}:u},function(e,t,r){r(102);var n=r(43);e.exports=n.Math.log2},function(e,t,r){var n=r(10),a=Math.log,i=Math.LN2;n({target:"Math",stat:!0},{log2:function(e){return a(e)/i}})},function(e,t,r){r(104);var n=r(43);e.exports=n.Number.isNaN},function(e,t,r){r(10)({target:"Number",stat:!0},{isNaN:function(e){return e!=e}})},function(e,t,r){r(106);var n=r(43);e.exports=n.Number.isInteger},function(e,t,r){r(10)({target:"Number",stat:!0},{isInteger:r(107)})},function(e,t,r){var n=r(22),a=Math.floor;e.exports=function(e){return!n(e)&&isFinite(e)&&a(e)===e}},function(e,t,r){r(109)},function(e,t,r){var n=r(110),a=r(112),i=r(14),o=n.aTypedArray,s=n.aTypedArrayConstructor,c=n.exportTypedArrayMethod,l=[].slice;c("slice",(function(e,t){for(var r=l.call(o(this),e,t),n=a(this,this.constructor),i=0,c=r.length,u=new(s(n))(c);c>i;)u[i]=r[i++];return u}),i((function(){new Int8Array(1).slice()})))},function(e,t,r){var n,a=r(111),i=r(13),o=r(11),s=r(22),c=r(23),l=r(95),u=r(26),h=r(29),f=r(27).f,d=r(82),p=r(87),g=r(57),m=r(38),v=o.Int8Array,y=v&&v.prototype,b=o.Uint8ClampedArray,w=b&&b.prototype,S=v&&d(v),k=y&&d(y),_=Object.prototype,A=_.isPrototypeOf,x=g("toStringTag"),C=m("TYPED_ARRAY_TAG"),P=a&&!!p&&"Opera"!==l(o.opera),T=!1,E={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},R=function(e){return s(e)&&c(E,l(e))};for(n in E)o[n]||(P=!1);if((!P||"function"!=typeof S||S===Function.prototype)&&(S=function(){throw TypeError("Incorrect invocation")},P))for(n in E)o[n]&&p(o[n],S);if((!P||!k||k===_)&&(k=S.prototype,P))for(n in E)o[n]&&p(o[n].prototype,k);if(P&&d(w)!==k&&p(w,k),i&&!c(k,x))for(n in T=!0,f(k,x,{get:function(){return s(this)?this[C]:void 0}}),E)o[n]&&u(o[n],C,n);e.exports={NATIVE_ARRAY_BUFFER_VIEWS:P,TYPED_ARRAY_TAG:T&&C,aTypedArray:function(e){if(R(e))return e;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(e){if(p){if(A.call(S,e))return e}else for(var t in E)if(c(E,n)){var r=o[t];if(r&&(e===r||A.call(r,e)))return e}throw TypeError("Target is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r){if(i){if(r)for(var n in E){var a=o[n];a&&c(a.prototype,e)&&delete a.prototype[e]}k[e]&&!r||h(k,e,r?t:P&&y[e]||t)}},exportTypedArrayStaticMethod:function(e,t,r){var n,a;if(i){if(p){if(r)for(n in E)(a=o[n])&&c(a,e)&&delete a[e];if(S[e]&&!r)return;try{return h(S,e,r?t:P&&v[e]||t)}catch(e){}}for(n in E)!(a=o[n])||a[e]&&!r||h(a,e,t)}},isView:function(e){var t=l(e);return"DataView"===t||c(E,t)},isTypedArray:R,TypedArray:S,TypedArrayPrototype:k}},function(e,t){e.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},function(e,t,r){var n=r(28),a=r(63),i=r(57)("species");e.exports=function(e,t){var r,o=n(e).constructor;return void 0===o||null==(r=n(o)[i])?t:a(r)}},function(e,t,r){r(114),r(77),r(116),r(119),r(134),r(135);var n=r(43);e.exports=n.Promise},function(e,t,r){var n=r(96),a=r(29),i=r(115);n||a(Object.prototype,"toString",i,{unsafe:!0})},function(e,t,r){var n=r(96),a=r(95);e.exports=n?{}.toString:function(){return"[object "+a(this)+"]"}},function(e,t,r){var n=r(11),a=r(117),i=r(118),o=r(26),s=r(57),c=s("iterator"),l=s("toStringTag"),u=i.values;for(var h in a){var f=n[h],d=f&&f.prototype;if(d){if(d[c]!==u)try{o(d,c,u)}catch(e){d[c]=u}if(d[l]||o(d,l,h),a[h])for(var p in i)if(d[p]!==i[p])try{o(d,p,i[p])}catch(e){d[p]=i[p]}}}},function(e,t){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(e,t,r){var n=r(17),a=r(70),i=r(86),o=r(33),s=r(79),c="Array Iterator",l=o.set,u=o.getterFor(c);e.exports=s(Array,"Array",(function(e,t){l(this,{type:c,target:n(e),index:0,kind:t})}),(function(){var e=u(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values"),i.Arguments=i.Array,a("keys"),a("values"),a("entries")},function(e,t,r){var n,a,i,o,s=r(10),c=r(37),l=r(11),u=r(42),h=r(120),f=r(29),d=r(121),p=r(85),g=r(122),m=r(22),v=r(63),y=r(123),b=r(19),w=r(31),S=r(124),k=r(97),_=r(112),A=r(125).set,x=r(128),C=r(129),P=r(131),T=r(130),E=r(132),R=r(33),O=r(52),I=r(57),F=r(133),L=I("species"),M="Promise",N=R.get,D=R.set,B=R.getterFor(M),j=h,U=l.TypeError,q=l.document,z=l.process,G=u("fetch"),W=T.f,H=W,V="process"==b(z),X=!!(q&&q.createEvent&&l.dispatchEvent),Y="unhandledrejection",K=O(M,(function(){if(w(j)===String(j)){if(66===F)return!0;if(!V&&"function"!=typeof PromiseRejectionEvent)return!0}if(c&&!j.prototype.finally)return!0;if(F>=51&&/native code/.test(j))return!1;var e=j.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[L]=t,!(e.then((function(){}))instanceof t)})),J=K||!k((function(e){j.all(e).catch((function(){}))})),Q=function(e){var t;return!(!m(e)||"function"!=typeof(t=e.then))&&t},$=function(e,t,r){if(!t.notified){t.notified=!0;var n=t.reactions;x((function(){for(var a=t.value,i=1==t.state,o=0;n.length>o;){var s,c,l,u=n[o++],h=i?u.ok:u.fail,f=u.resolve,d=u.reject,p=u.domain;try{h?(i||(2===t.rejection&&re(e,t),t.rejection=1),!0===h?s=a:(p&&p.enter(),s=h(a),p&&(p.exit(),l=!0)),s===u.promise?d(U("Promise-chain cycle")):(c=Q(s))?c.call(s,f,d):f(s)):d(a)}catch(e){p&&!l&&p.exit(),d(e)}}t.reactions=[],t.notified=!1,r&&!t.rejection&&ee(e,t)}))}},Z=function(e,t,r){var n,a;X?((n=q.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),l.dispatchEvent(n)):n={promise:t,reason:r},(a=l["on"+e])?a(n):e===Y&&P("Unhandled promise rejection",r)},ee=function(e,t){A.call(l,(function(){var r,n=t.value;if(te(t)&&(r=E((function(){V?z.emit("unhandledRejection",n,e):Z(Y,e,n)})),t.rejection=V||te(t)?2:1,r.error))throw r.value}))},te=function(e){return 1!==e.rejection&&!e.parent},re=function(e,t){A.call(l,(function(){V?z.emit("rejectionHandled",e):Z("rejectionhandled",e,t.value)}))},ne=function(e,t,r,n){return function(a){e(t,r,a,n)}},ae=function(e,t,r,n){t.done||(t.done=!0,n&&(t=n),t.value=r,t.state=2,$(e,t,!0))},ie=function(e,t,r,n){if(!t.done){t.done=!0,n&&(t=n);try{if(e===r)throw U("Promise can't be resolved itself");var a=Q(r);a?x((function(){var n={done:!1};try{a.call(r,ne(ie,e,n,t),ne(ae,e,n,t))}catch(r){ae(e,n,r,t)}})):(t.value=r,t.state=1,$(e,t,!1))}catch(r){ae(e,{done:!1},r,t)}}};K&&(j=function(e){y(this,j,M),v(e),n.call(this);var t=N(this);try{e(ne(ie,this,t),ne(ae,this,t))}catch(e){ae(this,t,e)}},(n=function(e){D(this,{type:M,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=d(j.prototype,{then:function(e,t){var r=B(this),n=W(_(this,j));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=V?z.domain:void 0,r.parent=!0,r.reactions.push(n),0!=r.state&&$(this,r,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),a=function(){var e=new n,t=N(e);this.promise=e,this.resolve=ne(ie,e,t),this.reject=ne(ae,e,t)},T.f=W=function(e){return e===j||e===i?new a(e):H(e)},c||"function"!=typeof h||(o=h.prototype.then,f(h.prototype,"then",(function(e,t){var r=this;return new j((function(e,t){o.call(r,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof G&&s({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return C(j,G.apply(l,arguments))}}))),s({global:!0,wrap:!0,forced:K},{Promise:j}),p(j,M,!1,!0),g(M),i=u(M),s({target:M,stat:!0,forced:K},{reject:function(e){var t=W(this);return t.reject.call(void 0,e),t.promise}}),s({target:M,stat:!0,forced:c||K},{resolve:function(e){return C(c&&this===i?j:this,e)}}),s({target:M,stat:!0,forced:J},{all:function(e){var t=this,r=W(t),n=r.resolve,a=r.reject,i=E((function(){var r=v(t.resolve),i=[],o=0,s=1;S(e,(function(e){var c=o++,l=!1;i.push(void 0),s++,r.call(t,e).then((function(e){l||(l=!0,i[c]=e,--s||n(i))}),a)})),--s||n(i)}));return i.error&&a(i.value),r.promise},race:function(e){var t=this,r=W(t),n=r.reject,a=E((function(){var a=v(t.resolve);S(e,(function(e){a.call(t,e).then(r.resolve,n)}))}));return a.error&&n(a.value),r.promise}})},function(e,t,r){var n=r(11);e.exports=n.Promise},function(e,t,r){var n=r(29);e.exports=function(e,t,r){for(var a in t)n(e,a,t[a],r);return e}},function(e,t,r){var n=r(42),a=r(27),i=r(57),o=r(13),s=i("species");e.exports=function(e){var t=n(e),r=a.f;o&&t&&!t[s]&&r(t,s,{configurable:!0,get:function(){return this}})}},function(e,t){e.exports=function(e,t,r){if(!(e instanceof t))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return e}},function(e,t,r){var n=r(28),a=r(92),i=r(47),o=r(62),s=r(94),c=r(91),l=function(e,t){this.stopped=e,this.result=t},u=e.exports=function(e,t,r,u,h){var f,d,p,g,m,v,y,b=o(t,r,u?2:1);if(h)f=e;else{if("function"!=typeof(d=s(e)))throw TypeError("Target is not iterable");if(a(d)){for(p=0,g=i(e.length);g>p;p++)if((m=u?b(n(y=e[p])[0],y[1]):b(e[p]))&&m instanceof l)return m;return new l(!1)}f=d.call(e)}for(v=f.next;!(y=v.call(f)).done;)if("object"==typeof(m=c(f,b,y.value,u))&&m&&m instanceof l)return m;return new l(!1)};u.stop=function(e){return new l(!0,e)}},function(e,t,r){var n,a,i,o=r(11),s=r(14),c=r(19),l=r(62),u=r(74),h=r(25),f=r(126),d=o.location,p=o.setImmediate,g=o.clearImmediate,m=o.process,v=o.MessageChannel,y=o.Dispatch,b=0,w={},S="onreadystatechange",k=function(e){if(w.hasOwnProperty(e)){var t=w[e];delete w[e],t()}},_=function(e){return function(){k(e)}},A=function(e){k(e.data)},x=function(e){o.postMessage(e+"",d.protocol+"//"+d.host)};p&&g||(p=function(e){for(var t=[],r=1;arguments.length>r;)t.push(arguments[r++]);return w[++b]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},n(b),b},g=function(e){delete w[e]},"process"==c(m)?n=function(e){m.nextTick(_(e))}:y&&y.now?n=function(e){y.now(_(e))}:v&&!f?(i=(a=new v).port2,a.port1.onmessage=A,n=l(i.postMessage,i,1)):!o.addEventListener||"function"!=typeof postMessage||o.importScripts||s(x)||"file:"===d.protocol?n=S in h("script")?function(e){u.appendChild(h("script"))[S]=function(){u.removeChild(this),k(e)}}:function(e){setTimeout(_(e),0)}:(n=x,o.addEventListener("message",A,!1))),e.exports={set:p,clear:g}},function(e,t,r){var n=r(127);e.exports=/(iphone|ipod|ipad).*applewebkit/i.test(n)},function(e,t,r){var n=r(42);e.exports=n("navigator","userAgent")||""},function(e,t,r){var n,a,i,o,s,c,l,u,h=r(11),f=r(12).f,d=r(19),p=r(125).set,g=r(126),m=h.MutationObserver||h.WebKitMutationObserver,v=h.process,y=h.Promise,b="process"==d(v),w=f(h,"queueMicrotask"),S=w&&w.value;S||(n=function(){var e,t;for(b&&(e=v.domain)&&e.exit();a;){t=a.fn,a=a.next;try{t()}catch(e){throw a?o():i=void 0,e}}i=void 0,e&&e.enter()},b?o=function(){v.nextTick(n)}:m&&!g?(s=!0,c=document.createTextNode(""),new m(n).observe(c,{characterData:!0}),o=function(){c.data=s=!s}):y&&y.resolve?(l=y.resolve(void 0),u=l.then,o=function(){u.call(l,n)}):o=function(){p.call(h,n)}),e.exports=S||function(e){var t={fn:e,next:void 0};i&&(i.next=t),a||(a=t,o()),i=t}},function(e,t,r){var n=r(28),a=r(22),i=r(130);e.exports=function(e,t){if(n(e),a(t)&&t.constructor===e)return t;var r=i.f(e);return(0,r.resolve)(t),r.promise}},function(e,t,r){var n=r(63),a=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n})),this.resolve=n(t),this.reject=n(r)};e.exports.f=function(e){return new a(e)}},function(e,t,r){var n=r(11);e.exports=function(e,t){var r=n.console;r&&r.error&&(1===arguments.length?r.error(e):r.error(e,t))}},function(e,t){e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},function(e,t,r){var n,a,i=r(11),o=r(127),s=i.process,c=s&&s.versions,l=c&&c.v8;l?a=(n=l.split("."))[0]+n[1]:o&&(!(n=o.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=o.match(/Chrome\/(\d+)/))&&(a=n[1]),e.exports=a&&+a},function(e,t,r){var n=r(10),a=r(63),i=r(130),o=r(132),s=r(124);n({target:"Promise",stat:!0},{allSettled:function(e){var t=this,r=i.f(t),n=r.resolve,c=r.reject,l=o((function(){var r=a(t.resolve),i=[],o=0,c=1;s(e,(function(e){var a=o++,s=!1;i.push(void 0),c++,r.call(t,e).then((function(e){s||(s=!0,i[a]={status:"fulfilled",value:e},--c||n(i))}),(function(e){s||(s=!0,i[a]={status:"rejected",reason:e},--c||n(i))}))})),--c||n(i)}));return l.error&&c(l.value),r.promise}})},function(e,t,r){var n=r(10),a=r(37),i=r(120),o=r(14),s=r(42),c=r(112),l=r(129),u=r(29);n({target:"Promise",proto:!0,real:!0,forced:!!i&&o((function(){i.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=c(this,s("Promise")),r="function"==typeof e;return this.then(r?function(r){return l(t,e()).then((function(){return r}))}:e,r?function(r){return l(t,e()).then((function(){throw r}))}:e)}}),a||"function"!=typeof i||i.prototype.finally||u(i.prototype,"finally",s("Promise").prototype.finally)},function(e,t,r){r(137),r(142),r(140);var n=r(43);e.exports=n.URL},function(e,t,r){r(77);var n,a=r(10),i=r(13),o=r(138),s=r(11),c=r(72),l=r(29),u=r(123),h=r(23),f=r(100),d=r(90),p=r(78).codeAt,g=r(139),m=r(85),v=r(140),y=r(33),b=s.URL,w=v.URLSearchParams,S=v.getState,k=y.set,_=y.getterFor("URL"),A=Math.floor,x=Math.pow,C="Invalid scheme",P="Invalid host",T="Invalid port",E=/[A-Za-z]/,R=/[\d+-.A-Za-z]/,O=/\d/,I=/^(0x|0X)/,F=/^[0-7]+$/,L=/^\d+$/,M=/^[\dA-Fa-f]+$/,N=/[\u0000\u0009\u000A\u000D #%/:?@[\\]]/,D=/[\u0000\u0009\u000A\u000D #/:?@[\\]]/,B=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,j=/[\u0009\u000A\u000D]/g,U=function(e,t){var r,n,a;if("["==t.charAt(0)){if("]"!=t.charAt(t.length-1))return P;if(!(r=z(t.slice(1,-1))))return P;e.host=r}else if(J(e)){if(t=g(t),N.test(t))return P;if(null===(r=q(t)))return P;e.host=r}else{if(D.test(t))return P;for(r="",n=d(t),a=0;a4)return e;for(r=[],n=0;n1&&"0"==a.charAt(0)&&(i=I.test(a)?16:8,a=a.slice(8==i?1:2)),""===a)o=0;else{if(!(10==i?L:8==i?F:M).test(a))return e;o=parseInt(a,i)}r.push(o)}for(n=0;n=x(256,5-t))return null}else if(o>255)return null;for(s=r.pop(),n=0;n6)return;for(n=0;f();){if(a=null,n>0){if(!("."==f()&&n<4))return;h++}if(!O.test(f()))return;for(;O.test(f());){if(i=parseInt(f(),10),null===a)a=i;else{if(0==a)return;a=10*a+i}if(a>255)return;h++}c[l]=256*c[l]+a,2!=++n&&4!=n||l++}if(4!=n)return;break}if(":"==f()){if(h++,!f())return}else if(f())return;c[l++]=t}else{if(null!==u)return;h++,u=++l}}if(null!==u)for(o=l-u,l=7;0!=l&&o>0;)s=c[l],c[l--]=c[u+o-1],c[u+--o]=s;else if(8!=l)return;return c},G=function(e){var t,r,n,a;if("number"==typeof e){for(t=[],r=0;r<4;r++)t.unshift(e%256),e=A(e/256);return t.join(".")}if("object"==typeof e){for(t="",n=function(e){for(var t=null,r=1,n=null,a=0,i=0;i<8;i++)0!==e[i]?(a>r&&(t=n,r=a),n=null,a=0):(null===n&&(n=i),++a);return a>r&&(t=n,r=a),t}(e),r=0;r<8;r++)a&&0===e[r]||(a&&(a=!1),n===r?(t+=r?":":"::",a=!0):(t+=e[r].toString(16),r<7&&(t+=":")));return"["+t+"]"}return e},W={},H=f({},W,{" ":1,'"':1,"<":1,">":1,"`":1}),V=f({},H,{"#":1,"?":1,"{":1,"}":1}),X=f({},V,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Y=function(e,t){var r=p(e,0);return r>32&&r<127&&!h(t,e)?e:encodeURIComponent(e)},K={ftp:21,file:null,http:80,https:443,ws:80,wss:443},J=function(e){return h(K,e.scheme)},Q=function(e){return""!=e.username||""!=e.password},$=function(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme},Z=function(e,t){var r;return 2==e.length&&E.test(e.charAt(0))&&(":"==(r=e.charAt(1))||!t&&"|"==r)},ee=function(e){var t;return e.length>1&&Z(e.slice(0,2))&&(2==e.length||"/"===(t=e.charAt(2))||"\\"===t||"?"===t||"#"===t)},te=function(e){var t=e.path,r=t.length;!r||"file"==e.scheme&&1==r&&Z(t[0],!0)||t.pop()},re=function(e){return"."===e||"%2e"===e.toLowerCase()},ne={},ae={},ie={},oe={},se={},ce={},le={},ue={},he={},fe={},de={},pe={},ge={},me={},ve={},ye={},be={},we={},Se={},ke={},_e={},Ae=function(e,t,r,a){var i,o,s,c,l,u=r||ne,f=0,p="",g=!1,m=!1,v=!1;for(r||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(B,"")),t=t.replace(j,""),i=d(t);f<=i.length;){switch(o=i[f],u){case ne:if(!o||!E.test(o)){if(r)return C;u=ie;continue}p+=o.toLowerCase(),u=ae;break;case ae:if(o&&(R.test(o)||"+"==o||"-"==o||"."==o))p+=o.toLowerCase();else{if(":"!=o){if(r)return C;p="",u=ie,f=0;continue}if(r&&(J(e)!=h(K,p)||"file"==p&&(Q(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=p,r)return void(J(e)&&K[e.scheme]==e.port&&(e.port=null));p="","file"==e.scheme?u=me:J(e)&&a&&a.scheme==e.scheme?u=oe:J(e)?u=ue:"/"==i[f+1]?(u=se,f++):(e.cannotBeABaseURL=!0,e.path.push(""),u=Se)}break;case ie:if(!a||a.cannotBeABaseURL&&"#"!=o)return C;if(a.cannotBeABaseURL&&"#"==o){e.scheme=a.scheme,e.path=a.path.slice(),e.query=a.query,e.fragment="",e.cannotBeABaseURL=!0,u=_e;break}u="file"==a.scheme?me:ce;continue;case oe:if("/"!=o||"/"!=i[f+1]){u=ce;continue}u=he,f++;break;case se:if("/"==o){u=fe;break}u=we;continue;case ce:if(e.scheme=a.scheme,o==n)e.username=a.username,e.password=a.password,e.host=a.host,e.port=a.port,e.path=a.path.slice(),e.query=a.query;else if("/"==o||"\\"==o&&J(e))u=le;else if("?"==o)e.username=a.username,e.password=a.password,e.host=a.host,e.port=a.port,e.path=a.path.slice(),e.query="",u=ke;else{if("#"!=o){e.username=a.username,e.password=a.password,e.host=a.host,e.port=a.port,e.path=a.path.slice(),e.path.pop(),u=we;continue}e.username=a.username,e.password=a.password,e.host=a.host,e.port=a.port,e.path=a.path.slice(),e.query=a.query,e.fragment="",u=_e}break;case le:if(!J(e)||"/"!=o&&"\\"!=o){if("/"!=o){e.username=a.username,e.password=a.password,e.host=a.host,e.port=a.port,u=we;continue}u=fe}else u=he;break;case ue:if(u=he,"/"!=o||"/"!=p.charAt(f+1))continue;f++;break;case he:if("/"!=o&&"\\"!=o){u=fe;continue}break;case fe:if("@"==o){g&&(p="%40"+p),g=!0,s=d(p);for(var y=0;y65535)return T;e.port=J(e)&&S===K[e.scheme]?null:S,p=""}if(r)return;u=be;continue}return T}p+=o;break;case me:if(e.scheme="file","/"==o||"\\"==o)u=ve;else{if(!a||"file"!=a.scheme){u=we;continue}if(o==n)e.host=a.host,e.path=a.path.slice(),e.query=a.query;else if("?"==o)e.host=a.host,e.path=a.path.slice(),e.query="",u=ke;else{if("#"!=o){ee(i.slice(f).join(""))||(e.host=a.host,e.path=a.path.slice(),te(e)),u=we;continue}e.host=a.host,e.path=a.path.slice(),e.query=a.query,e.fragment="",u=_e}}break;case ve:if("/"==o||"\\"==o){u=ye;break}a&&"file"==a.scheme&&!ee(i.slice(f).join(""))&&(Z(a.path[0],!0)?e.path.push(a.path[0]):e.host=a.host),u=we;continue;case ye:if(o==n||"/"==o||"\\"==o||"?"==o||"#"==o){if(!r&&Z(p))u=we;else if(""==p){if(e.host="",r)return;u=be}else{if(c=U(e,p))return c;if("localhost"==e.host&&(e.host=""),r)return;p="",u=be}continue}p+=o;break;case be:if(J(e)){if(u=we,"/"!=o&&"\\"!=o)continue}else if(r||"?"!=o)if(r||"#"!=o){if(o!=n&&(u=we,"/"!=o))continue}else e.fragment="",u=_e;else e.query="",u=ke;break;case we:if(o==n||"/"==o||"\\"==o&&J(e)||!r&&("?"==o||"#"==o)){if(".."===(l=(l=p).toLowerCase())||"%2e."===l||".%2e"===l||"%2e%2e"===l?(te(e),"/"==o||"\\"==o&&J(e)||e.path.push("")):re(p)?"/"==o||"\\"==o&&J(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&Z(p)&&(e.host&&(e.host=""),p=p.charAt(0)+":"),e.path.push(p)),p="","file"==e.scheme&&(o==n||"?"==o||"#"==o))for(;e.path.length>1&&""===e.path[0];)e.path.shift();"?"==o?(e.query="",u=ke):"#"==o&&(e.fragment="",u=_e)}else p+=Y(o,V);break;case Se:"?"==o?(e.query="",u=ke):"#"==o?(e.fragment="",u=_e):o!=n&&(e.path[0]+=Y(o,W));break;case ke:r||"#"!=o?o!=n&&("'"==o&&J(e)?e.query+="%27":e.query+="#"==o?"%23":Y(o,W)):(e.fragment="",u=_e);break;case _e:o!=n&&(e.fragment+=Y(o,H))}f++}},xe=function(e){var t,r,n=u(this,xe,"URL"),a=arguments.length>1?arguments[1]:void 0,o=String(e),s=k(n,{type:"URL"});if(void 0!==a)if(a instanceof xe)t=_(a);else if(r=Ae(t={},String(a)))throw TypeError(r);if(r=Ae(s,o,null,t))throw TypeError(r);var c=s.searchParams=new w,l=S(c);l.updateSearchParams(s.query),l.updateURL=function(){s.query=String(c)||null},i||(n.href=Pe.call(n),n.origin=Te.call(n),n.protocol=Ee.call(n),n.username=Re.call(n),n.password=Oe.call(n),n.host=Ie.call(n),n.hostname=Fe.call(n),n.port=Le.call(n),n.pathname=Me.call(n),n.search=Ne.call(n),n.searchParams=De.call(n),n.hash=Be.call(n))},Ce=xe.prototype,Pe=function(){var e=_(this),t=e.scheme,r=e.username,n=e.password,a=e.host,i=e.port,o=e.path,s=e.query,c=e.fragment,l=t+":";return null!==a?(l+="//",Q(e)&&(l+=r+(n?":"+n:"")+"@"),l+=G(a),null!==i&&(l+=":"+i)):"file"==t&&(l+="//"),l+=e.cannotBeABaseURL?o[0]:o.length?"/"+o.join("/"):"",null!==s&&(l+="?"+s),null!==c&&(l+="#"+c),l},Te=function(){var e=_(this),t=e.scheme,r=e.port;if("blob"==t)try{return new URL(t.path[0]).origin}catch(e){return"null"}return"file"!=t&&J(e)?t+"://"+G(e.host)+(null!==r?":"+r:""):"null"},Ee=function(){return _(this).scheme+":"},Re=function(){return _(this).username},Oe=function(){return _(this).password},Ie=function(){var e=_(this),t=e.host,r=e.port;return null===t?"":null===r?G(t):G(t)+":"+r},Fe=function(){var e=_(this).host;return null===e?"":G(e)},Le=function(){var e=_(this).port;return null===e?"":String(e)},Me=function(){var e=_(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},Ne=function(){var e=_(this).query;return e?"?"+e:""},De=function(){return _(this).searchParams},Be=function(){var e=_(this).fragment;return e?"#"+e:""},je=function(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}};if(i&&c(Ce,{href:je(Pe,(function(e){var t=_(this),r=String(e),n=Ae(t,r);if(n)throw TypeError(n);S(t.searchParams).updateSearchParams(t.query)})),origin:je(Te),protocol:je(Ee,(function(e){var t=_(this);Ae(t,String(e)+":",ne)})),username:je(Re,(function(e){var t=_(this),r=d(String(e));if(!$(t)){t.username="";for(var n=0;n>1,e+=s(e/t);e>455;n+=36)e=s(e/35);return s(n+36*e/(e+38))},h=function(e){var t=[];e=function(e){for(var t=[],r=0,n=e.length;r=55296&&a<=56319&&r=h&&as((n-f)/v))throw RangeError(o);for(f+=(m-h)*v,h=m,r=0;rn)throw RangeError(o);if(a==h){for(var y=f,b=36;;b+=36){var w=b<=d?1:b>=d+26?26:b-d;if(y0?arguments[0]:void 0,u=[];if(P(this,{type:x,entries:u,updateURL:function(){},updateSearchParams:U}),void 0!==l)if(m(l))if("function"==typeof(e=w(l)))for(r=(t=e.call(l)).next;!(n=r.call(t)).done;){if((o=(i=(a=b(g(n.value))).next).call(a)).done||(s=i.call(a)).done||!i.call(a).done)throw TypeError("Expected sequence with length 2");u.push({key:o.value+"",value:s.value+""})}else for(c in l)f(l,c)&&u.push({key:c,value:l[c]+""});else j(u,"string"==typeof l?"?"===l.charAt(0)?l.slice(1):l:l+"")},W=G.prototype;s(W,{append:function(e,t){q(arguments.length,2);var r=T(this);r.entries.push({key:e+"",value:t+""}),r.updateURL()},delete:function(e){q(arguments.length,1);for(var t=T(this),r=t.entries,n=e+"",a=0;ae.key){a.splice(t,0,e);break}t===r&&a.push(e)}n.updateURL()},forEach:function(e){for(var t,r=T(this).entries,n=d(e,arguments.length>1?arguments[1]:void 0,3),a=0;a1&&(m(t=arguments[1])&&(r=t.body,p(r)===x&&((n=t.headers?new _(t.headers):new _).has("content-type")||n.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),t=v(t,{body:y(0,String(r)),headers:y(0,n)}))),a.push(t)),k.apply(this,a)}}),e.exports={URLSearchParams:G,getState:T}},function(e,t,r){var n=r(28),a=r(94);e.exports=function(e){var t=a(e);if("function"!=typeof t)throw TypeError(String(e)+" is not iterable");return n(t.call(e))}},function(e,t,r){r(10)({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return URL.prototype.toString.call(this)}})},function(e,t,r){!function(e){var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol:function(e){return"Symbol("+e+")"};function r(){}var n=Number.isNaN||function(e){return e!=e},a=r;function i(e){return"object"==typeof e&&null!==e||"function"==typeof e}function o(e){return e.slice()}function s(e,t,r,n,a){new Uint8Array(e).set(new Uint8Array(r,n,a),t)}function c(e){return!1!==l(e)&&e!==1/0}function l(e){return!("number"!=typeof e||n(e)||e<0)}function u(e,t,r){if("function"!=typeof e)throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,t,r)}function h(e,t,r,n){var a=e[t];if(void 0!==a){if("function"!=typeof a)throw new TypeError(a+" is not a method");switch(r){case 0:return function(){return d(a,e,n)};case 1:return function(t){var r=[t].concat(n);return d(a,e,r)}}}return function(){return _(void 0)}}function f(e,t,r){var n=e[t];if(void 0!==n)return u(n,e,r)}function d(e,t,r){try{return _(u(e,t,r))}catch(e){return A(e)}}function p(e){return e}function g(e){return!1}function m(e){if(e=Number(e),n(e)||e<0)throw new RangeError("highWaterMark property of a queuing strategy must be non-negative and non-NaN");return e}function v(e){if(void 0===e)return function(){return 1};if("function"!=typeof e)throw new TypeError("size property of a queuing strategy must be a function");return function(t){return e(t)}}var y=Promise,b=Promise.prototype.then,w=Promise.resolve.bind(y),S=Promise.reject.bind(y);function k(e){return new y(e)}function _(e){return w(e)}function A(e){return S(e)}function x(e,t,r){return b.call(e,t,r)}function C(e,t,r){x(x(e,t,r),void 0,a)}function P(e,t){C(e,t)}function T(e,t){C(e,void 0,t)}function E(e,t,r){return x(e,t,r)}function R(e){x(e,void 0,a)}var O=16384,I=function(){function e(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}return Object.defineProperty(e.prototype,"length",{get:function(){return this._size},enumerable:!0,configurable:!0}),e.prototype.push=function(e){var t=this._back,r=t;t._elements.length===O-1&&(r={_elements:[],_next:void 0}),t._elements.push(e),r!==t&&(this._back=r,t._next=r),++this._size},e.prototype.shift=function(){var e=this._front,t=e,r=this._cursor,n=r+1,a=e._elements,i=a[r];return n===O&&(t=e._next,n=0),--this._size,this._cursor=n,e!==t&&(this._front=t),a[r]=void 0,i},e.prototype.forEach=function(e){for(var t=this._cursor,r=this._front,n=r._elements;!(t===n.length&&void 0===r._next||t===n.length&&(t=0,0===(n=(r=r._next)._elements).length));)e(n[t]),++t},e.prototype.peek=function(){var e=this._front,t=this._cursor;return e._elements[t]},e}();function F(e,t,r){var n=null;!0===r&&(n=Object.prototype);var a=Object.create(n);return a.value=e,a.done=t,a}function L(e,t){e._forAuthorCode=!0,e._ownerReadableStream=t,t._reader=e,"readable"===t._state?B(e):"closed"===t._state?U(e):j(e,t._storedError)}function M(e,t){return Nr(e._ownerReadableStream,t)}function N(e){"readable"===e._ownerReadableStream._state?q(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):z(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),e._ownerReadableStream._reader=void 0,e._ownerReadableStream=void 0}function D(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function B(e){e._closedPromise=k((function(t,r){e._closedPromise_resolve=t,e._closedPromise_reject=r}))}function j(e,t){B(e),q(e,t)}function U(e){B(e),G(e)}function q(e,t){R(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0}function z(e,t){j(e,t)}function G(e){e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0}var W=t("[[CancelSteps]]"),H=t("[[PullSteps]]");function V(e,t){void 0===t&&(t=!1);var r=new Z(e);return r._forAuthorCode=t,r}function X(e){return k((function(t,r){var n={_resolve:t,_reject:r};e._reader._readRequests.push(n)}))}function Y(e,t,r){var n=e._reader;n._readRequests.shift()._resolve(F(t,r,n._forAuthorCode))}function K(e){return e._reader._readRequests.length}function J(e){var t=e._reader;return void 0!==t&&!!ee(t)}var Q,$,Z=function(){function e(e){if(!1===Lr(e))throw new TypeError("ReadableStreamDefaultReader can only be constructed with a ReadableStream instance");if(!0===Mr(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");L(this,e),this._readRequests=new I}return Object.defineProperty(e.prototype,"closed",{get:function(){return ee(this)?this._closedPromise:A(re("closed"))},enumerable:!0,configurable:!0}),e.prototype.cancel=function(e){return ee(this)?void 0===this._ownerReadableStream?A(D("cancel")):M(this,e):A(re("cancel"))},e.prototype.read=function(){return ee(this)?void 0===this._ownerReadableStream?A(D("read from")):te(this):A(re("read"))},e.prototype.releaseLock=function(){if(!ee(this))throw re("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");N(this)}},e}();function ee(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readRequests")}function te(e){var t=e._ownerReadableStream;return t._disturbed=!0,"closed"===t._state?_(F(void 0,!0,e._forAuthorCode)):"errored"===t._state?A(t._storedError):t._readableStreamController[H]()}function re(e){return new TypeError("ReadableStreamDefaultReader.prototype."+e+" can only be used on a ReadableStreamDefaultReader")}"symbol"==typeof t.asyncIterator&&((Q={})[t.asyncIterator]=function(){return this},$=Q,Object.defineProperty($,t.asyncIterator,{enumerable:!1}));var ne={next:function(){if(!1===ie(this))return A(oe("next"));var e=this._asyncIteratorReader;return void 0===e._ownerReadableStream?A(D("iterate")):E(te(e),(function(t){var r=t.done;return r&&N(e),F(t.value,r,!0)}))},return:function(e){if(!1===ie(this))return A(oe("next"));var t=this._asyncIteratorReader;if(void 0===t._ownerReadableStream)return A(D("finish iterating"));if(t._readRequests.length>0)return A(new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled"));if(!1===this._preventCancel){var r=M(t,e);return N(t),E(r,(function(){return F(e,!0,!0)}))}return N(t),_(F(e,!0,!0))}};function ae(e,t){void 0===t&&(t=!1);var r=V(e),n=Object.create(ne);return n._asyncIteratorReader=r,n._preventCancel=Boolean(t),n}function ie(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorReader")}function oe(e){return new TypeError("ReadableStreamAsyncIterator."+e+" can only be used on a ReadableSteamAsyncIterator")}function se(e){var t=e._queue.shift();return e._queueTotalSize-=t.size,e._queueTotalSize<0&&(e._queueTotalSize=0),t.value}function ce(e,t,r){if(!c(r=Number(r)))throw new RangeError("Size must be a finite, non-NaN, non-negative number.");e._queue.push({value:t,size:r}),e._queueTotalSize+=r}function le(e){return e._queue.peek().value}function ue(e){e._queue=new I,e._queueTotalSize=0}void 0!==$&&Object.setPrototypeOf(ne,$),Object.defineProperty(ne,"next",{enumerable:!1}),Object.defineProperty(ne,"return",{enumerable:!1});var he=t("[[AbortSteps]]"),fe=t("[[ErrorSteps]]"),de=function(){function e(e,t){void 0===e&&(e={}),void 0===t&&(t={}),me(this);var r=t.size,n=t.highWaterMark;if(void 0!==e.type)throw new RangeError("Invalid type is specified");var a=v(r);void 0===n&&(n=1),Ye(this,e,n=m(n),a)}return Object.defineProperty(e.prototype,"locked",{get:function(){if(!1===ve(this))throw ot("locked");return ye(this)},enumerable:!0,configurable:!0}),e.prototype.abort=function(e){return!1===ve(this)?A(ot("abort")):!0===ye(this)?A(new TypeError("Cannot abort a stream that already has a writer")):be(this,e)},e.prototype.close=function(){return!1===ve(this)?A(ot("close")):!0===ye(this)?A(new TypeError("Cannot close a stream that already has a writer")):!0===Ee(this)?A(new TypeError("Cannot close an already-closing stream")):we(this)},e.prototype.getWriter=function(){if(!1===ve(this))throw ot("getWriter");return pe(this)},e}();function pe(e){return new Me(e)}function ge(e,t,r,n,a,i){void 0===a&&(a=1),void 0===i&&(i=function(){return 1});var o=Object.create(de.prototype);return me(o),Xe(o,Object.create(He.prototype),e,t,r,n,a,i),o}function me(e){e._state="writable",e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=new I,e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function ve(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")}function ye(e){return void 0!==e._writer}function be(e,t){var r=e._state;if("closed"===r||"errored"===r)return _(void 0);if(void 0!==e._pendingAbortRequest)return e._pendingAbortRequest._promise;var n=!1;"erroring"===r&&(n=!0,t=void 0);var a=k((function(r,a){e._pendingAbortRequest={_promise:void 0,_resolve:r,_reject:a,_reason:t,_wasAlreadyErroring:n}}));return e._pendingAbortRequest._promise=a,!1===n&&_e(e,t),a}function we(e){var t=e._state;if("closed"===t||"errored"===t)return A(new TypeError("The stream (in "+t+" state) is not in the writable state and cannot be closed"));var r=k((function(t,r){var n={_resolve:t,_reject:r};e._closeRequest=n})),n=e._writer;return void 0!==n&&!0===e._backpressure&&"writable"===t&&St(n),Je(e._writableStreamController),r}function Se(e){return k((function(t,r){var n={_resolve:t,_reject:r};e._writeRequests.push(n)}))}function ke(e,t){"writable"!==e._state?Ae(e):_e(e,t)}function _e(e,t){var r=e._writableStreamController;e._state="erroring",e._storedError=t;var n=e._writer;void 0!==n&&qe(n,t),!1===Re(e)&&!0===r._started&&Ae(e)}function Ae(e){e._state="errored",e._writableStreamController[fe]();var t=e._storedError;if(e._writeRequests.forEach((function(e){e._reject(t)})),e._writeRequests=new I,void 0!==e._pendingAbortRequest){var r=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,!0===r._wasAlreadyErroring)return r._reject(t),void Fe(e);C(e._writableStreamController[he](r._reason),(function(){r._resolve(),Fe(e)}),(function(t){r._reject(t),Fe(e)}))}else Fe(e)}function xe(e){e._inFlightWriteRequest._resolve(void 0),e._inFlightWriteRequest=void 0}function Ce(e,t){e._inFlightWriteRequest._reject(t),e._inFlightWriteRequest=void 0,ke(e,t)}function Pe(e){e._inFlightCloseRequest._resolve(void 0),e._inFlightCloseRequest=void 0,"erroring"===e._state&&(e._storedError=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._resolve(),e._pendingAbortRequest=void 0)),e._state="closed";var t=e._writer;void 0!==t&&pt(t)}function Te(e,t){e._inFlightCloseRequest._reject(t),e._inFlightCloseRequest=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._reject(t),e._pendingAbortRequest=void 0),ke(e,t)}function Ee(e){return void 0!==e._closeRequest||void 0!==e._inFlightCloseRequest}function Re(e){return void 0!==e._inFlightWriteRequest||void 0!==e._inFlightCloseRequest}function Oe(e){e._inFlightCloseRequest=e._closeRequest,e._closeRequest=void 0}function Ie(e){e._inFlightWriteRequest=e._writeRequests.shift()}function Fe(e){void 0!==e._closeRequest&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);var t=e._writer;void 0!==t&&ft(t,e._storedError)}function Le(e,t){var r=e._writer;void 0!==r&&t!==e._backpressure&&(!0===t?bt(r):St(r)),e._backpressure=t}var Me=function(){function e(e){if(!1===ve(e))throw new TypeError("WritableStreamDefaultWriter can only be constructed with a WritableStream instance");if(!0===ye(e))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=e,e._writer=this;var t=e._state;if("writable"===t)!1===Ee(e)&&!0===e._backpressure?gt(this):vt(this),lt(this);else if("erroring"===t)mt(this,e._storedError),lt(this);else if("closed"===t)vt(this),ht(this);else{var r=e._storedError;mt(this,r),ut(this,r)}}return Object.defineProperty(e.prototype,"closed",{get:function(){return!1===Ne(this)?A(st("closed")):this._closedPromise},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!1===Ne(this))throw st("desiredSize");if(void 0===this._ownerWritableStream)throw ct("desiredSize");return ze(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ready",{get:function(){return!1===Ne(this)?A(st("ready")):this._readyPromise},enumerable:!0,configurable:!0}),e.prototype.abort=function(e){return!1===Ne(this)?A(st("abort")):void 0===this._ownerWritableStream?A(ct("abort")):De(this,e)},e.prototype.close=function(){if(!1===Ne(this))return A(st("close"));var e=this._ownerWritableStream;return void 0===e?A(ct("close")):!0===Ee(e)?A(new TypeError("Cannot close an already-closing stream")):Be(this)},e.prototype.releaseLock=function(){if(!1===Ne(this))throw st("releaseLock");void 0!==this._ownerWritableStream&&Ge(this)},e.prototype.write=function(e){return!1===Ne(this)?A(st("write")):void 0===this._ownerWritableStream?A(ct("write to")):We(this,e)},e}();function Ne(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")}function De(e,t){return be(e._ownerWritableStream,t)}function Be(e){return we(e._ownerWritableStream)}function je(e){var t=e._ownerWritableStream,r=t._state;return!0===Ee(t)||"closed"===r?_(void 0):"errored"===r?A(t._storedError):Be(e)}function Ue(e,t){"pending"===e._closedPromiseState?ft(e,t):dt(e,t)}function qe(e,t){"pending"===e._readyPromiseState?yt(e,t):wt(e,t)}function ze(e){var t=e._ownerWritableStream,r=t._state;return"errored"===r||"erroring"===r?null:"closed"===r?0:$e(t._writableStreamController)}function Ge(e){var t=e._ownerWritableStream,r=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");qe(e,r),Ue(e,r),t._writer=void 0,e._ownerWritableStream=void 0}function We(e,t){var r=e._ownerWritableStream,n=r._writableStreamController,a=Qe(n,t);if(r!==e._ownerWritableStream)return A(ct("write to"));var i=r._state;if("errored"===i)return A(r._storedError);if(!0===Ee(r)||"closed"===i)return A(new TypeError("The stream is closing or closed and cannot be written to"));if("erroring"===i)return A(r._storedError);var o=Se(r);return Ze(n,t,a),o}var He=function(){function e(){throw new TypeError("WritableStreamDefaultController cannot be constructed explicitly")}return e.prototype.error=function(e){if(!1===Ve(this))throw new TypeError("WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController");"writable"===this._controlledWritableStream._state&&it(this,e)},e.prototype[he]=function(e){var t=this._abortAlgorithm(e);return Ke(this),t},e.prototype[fe]=function(){ue(this)},e}();function Ve(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream")}function Xe(e,t,r,n,a,i,o,s){t._controlledWritableStream=e,e._writableStreamController=t,t._queue=void 0,t._queueTotalSize=void 0,ue(t),t._started=!1,t._strategySizeAlgorithm=s,t._strategyHWM=o,t._writeAlgorithm=n,t._closeAlgorithm=a,t._abortAlgorithm=i;var c=at(t);Le(e,c),C(_(r()),(function(){t._started=!0,et(t)}),(function(r){t._started=!0,ke(e,r)}))}function Ye(e,t,r,n){var a=Object.create(He.prototype);function i(){return f(t,"start",[a])}var o=h(t,"write",1,[a]),s=h(t,"close",0,[]),c=h(t,"abort",1,[]);Xe(e,a,i,o,s,c,r,n)}function Ke(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function Je(e){ce(e,"close",0),et(e)}function Qe(e,t){try{return e._strategySizeAlgorithm(t)}catch(t){return tt(e,t),1}}function $e(e){return e._strategyHWM-e._queueTotalSize}function Ze(e,t,r){var n={chunk:t};try{ce(e,n,r)}catch(t){return void tt(e,t)}var a=e._controlledWritableStream;!1===Ee(a)&&"writable"===a._state&&Le(a,at(e)),et(e)}function et(e){var t=e._controlledWritableStream;if(!1!==e._started&&void 0===t._inFlightWriteRequest)if("erroring"!==t._state){if(0!==e._queue.length){var r=le(e);"close"===r?rt(e):nt(e,r.chunk)}}else Ae(t)}function tt(e,t){"writable"===e._controlledWritableStream._state&&it(e,t)}function rt(e){var t=e._controlledWritableStream;Oe(t),se(e);var r=e._closeAlgorithm();Ke(e),C(r,(function(){Pe(t)}),(function(e){Te(t,e)}))}function nt(e,t){var r=e._controlledWritableStream;Ie(r),C(e._writeAlgorithm(t),(function(){xe(r);var t=r._state;if(se(e),!1===Ee(r)&&"writable"===t){var n=at(e);Le(r,n)}et(e)}),(function(t){"writable"===r._state&&Ke(e),Ce(r,t)}))}function at(e){return $e(e)<=0}function it(e,t){var r=e._controlledWritableStream;Ke(e),_e(r,t)}function ot(e){return new TypeError("WritableStream.prototype."+e+" can only be used on a WritableStream")}function st(e){return new TypeError("WritableStreamDefaultWriter.prototype."+e+" can only be used on a WritableStreamDefaultWriter")}function ct(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function lt(e){e._closedPromise=k((function(t,r){e._closedPromise_resolve=t,e._closedPromise_reject=r,e._closedPromiseState="pending"}))}function ut(e,t){lt(e),ft(e,t)}function ht(e){lt(e),pt(e)}function ft(e,t){R(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected"}function dt(e,t){ut(e,t)}function pt(e){e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved"}function gt(e){e._readyPromise=k((function(t,r){e._readyPromise_resolve=t,e._readyPromise_reject=r})),e._readyPromiseState="pending"}function mt(e,t){gt(e),yt(e,t)}function vt(e){gt(e),St(e)}function yt(e,t){R(e._readyPromise),e._readyPromise_reject(t),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected"}function bt(e){gt(e)}function wt(e,t){mt(e,t)}function St(e){e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled"}function kt(e){if("object"!=typeof e||null===e)return!1;try{return"boolean"==typeof e.aborted}catch(e){return!1}}var _t="undefined"!=typeof DOMException?DOMException:void 0;function At(e){if("function"!=typeof e&&"object"!=typeof e)return!1;try{return new e,!0}catch(e){return!1}}function xt(){var e=function(e,t){this.message=e||"",this.name=t||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return e.prototype=Object.create(Error.prototype),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,configurable:!0}),e}var Ct=At(_t)?_t:xt();function Pt(e,t,n,a,i,o){var s=V(e),c=pe(t);e._disturbed=!0;var l=!1,u=_(void 0);return k((function(h,f){var d;if(void 0!==o){if(d=function(){var r=new Ct("Aborted","AbortError"),n=[];!1===a&&n.push((function(){return"writable"===t._state?be(t,r):_(void 0)})),!1===i&&n.push((function(){return"readable"===e._state?Nr(e,r):_(void 0)})),w((function(){return Promise.all(n.map((function(e){return e()})))}),!0,r)},!0===o.aborted)return void d();o.addEventListener("abort",d)}function p(){return k((function(e,t){function r(n){n?e():x(g(),r,t)}r(!1)}))}function g(){return!0===l?_(!0):x(c._readyPromise,(function(){return x(te(s),(function(e){return!0===e.done||(u=x(We(c,e.value),void 0,r),!1)}))}))}if(y(e,s._closedPromise,(function(e){!1===a?w((function(){return be(t,e)}),!0,e):S(!0,e)})),y(t,c._closedPromise,(function(t){!1===i?w((function(){return Nr(e,t)}),!0,t):S(!0,t)})),b(e,s._closedPromise,(function(){!1===n?w((function(){return je(c)})):S()})),!0===Ee(t)||"closed"===t._state){var m=new TypeError("the destination writable stream closed before all data could be piped to it");!1===i?w((function(){return Nr(e,m)}),!0,m):S(!0,m)}function v(){var e=u;return x(u,(function(){return e!==u?v():void 0}))}function y(e,t,r){"errored"===e._state?r(e._storedError):T(t,r)}function b(e,t,r){"closed"===e._state?r():P(t,r)}function w(e,r,n){function a(){C(e(),(function(){return A(r,n)}),(function(e){return A(!0,e)}))}!0!==l&&(l=!0,"writable"===t._state&&!1===Ee(t)?P(v(),a):a())}function S(e,r){!0!==l&&(l=!0,"writable"===t._state&&!1===Ee(t)?P(v(),(function(){return A(e,r)})):A(e,r))}function A(e,t){Ge(c),N(s),void 0!==o&&o.removeEventListener("abort",d),e?f(t):h(void 0)}R(p())}))}var Tt=function(){function e(){throw new TypeError}return Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!1===Et(this))throw qt("desiredSize");return Nt(this)},enumerable:!0,configurable:!0}),e.prototype.close=function(){if(!1===Et(this))throw qt("close");if(!1===Bt(this))throw new TypeError("The stream is not in a state that permits close");Ft(this)},e.prototype.enqueue=function(e){if(!1===Et(this))throw qt("enqueue");if(!1===Bt(this))throw new TypeError("The stream is not in a state that permits enqueue");return Lt(this,e)},e.prototype.error=function(e){if(!1===Et(this))throw qt("error");Mt(this,e)},e.prototype[W]=function(e){ue(this);var t=this._cancelAlgorithm(e);return It(this),t},e.prototype[H]=function(){var e=this._controlledReadableStream;if(this._queue.length>0){var t=se(this);return!0===this._closeRequested&&0===this._queue.length?(It(this),Dr(e)):Rt(this),_(F(t,!1,e._reader._forAuthorCode))}var r=X(e);return Rt(this),r},e}();function Et(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")}function Rt(e){!1!==Ot(e)&&(!0!==e._pulling?(e._pulling=!0,C(e._pullAlgorithm(),(function(){e._pulling=!1,!0===e._pullAgain&&(e._pullAgain=!1,Rt(e))}),(function(t){Mt(e,t)}))):e._pullAgain=!0)}function Ot(e){var t=e._controlledReadableStream;return!1!==Bt(e)&&!1!==e._started&&(!0===Mr(t)&&K(t)>0||Nt(e)>0)}function It(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function Ft(e){var t=e._controlledReadableStream;e._closeRequested=!0,0===e._queue.length&&(It(e),Dr(t))}function Lt(e,t){var r=e._controlledReadableStream;if(!0===Mr(r)&&K(r)>0)Y(r,t,!1);else{var n=void 0;try{n=e._strategySizeAlgorithm(t)}catch(t){throw Mt(e,t),t}try{ce(e,t,n)}catch(t){throw Mt(e,t),t}}Rt(e)}function Mt(e,t){var r=e._controlledReadableStream;"readable"===r._state&&(ue(e),It(e),Br(r,t))}function Nt(e){var t=e._controlledReadableStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function Dt(e){return!0!==Ot(e)}function Bt(e){var t=e._controlledReadableStream._state;return!1===e._closeRequested&&"readable"===t}function jt(e,t,r,n,a,i,o){t._controlledReadableStream=e,t._queue=void 0,t._queueTotalSize=void 0,ue(t),t._started=!1,t._closeRequested=!1,t._pullAgain=!1,t._pulling=!1,t._strategySizeAlgorithm=o,t._strategyHWM=i,t._pullAlgorithm=n,t._cancelAlgorithm=a,e._readableStreamController=t,C(_(r()),(function(){t._started=!0,Rt(t)}),(function(e){Mt(t,e)}))}function Ut(e,t,r,n){var a=Object.create(Tt.prototype);function i(){return f(t,"start",[a])}var o=h(t,"pull",0,[a]),s=h(t,"cancel",1,[]);jt(e,a,i,o,s,r,n)}function qt(e){return new TypeError("ReadableStreamDefaultController.prototype."+e+" can only be used on a ReadableStreamDefaultController")}function zt(e,t){var r,n,a,i,s,c=V(e),l=!1,u=!1,h=!1,f=k((function(e){s=e}));function d(){return!0===l||(l=!0,R(E(te(c),(function(e){if(l=!1,!0===e.done)return!1===u&&Ft(a._readableStreamController),void(!1===h&&Ft(i._readableStreamController));var t=e.value,r=t,n=t;!1===u&&Lt(a._readableStreamController,r),!1===h&&Lt(i._readableStreamController,n)})))),_(void 0)}function p(t){if(u=!0,r=t,!0===h){var a=o([r,n]),i=Nr(e,a);s(i)}return f}function g(t){if(h=!0,n=t,!0===u){var a=o([r,n]),i=Nr(e,a);s(i)}return f}function m(){}return a=Ir(m,d,p),i=Ir(m,d,g),T(c._closedPromise,(function(e){Mt(a._readableStreamController,e),Mt(i._readableStreamController,e)})),[a,i]}var Gt=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},Wt=function(){function e(){throw new TypeError("ReadableStreamBYOBRequest cannot be used directly")}return Object.defineProperty(e.prototype,"view",{get:function(){if(!1===Xt(this))throw wr("view");return this._view},enumerable:!0,configurable:!0}),e.prototype.respond=function(e){if(!1===Xt(this))throw wr("respond");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");g(this._view.buffer),gr(this._associatedReadableByteStreamController,e)},e.prototype.respondWithNewView=function(e){if(!1===Xt(this))throw wr("respond");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");if(!ArrayBuffer.isView(e))throw new TypeError("You can only respond with array buffer views");g(e.buffer),mr(this._associatedReadableByteStreamController,e)},e}(),Ht=function(){function e(){throw new TypeError("ReadableByteStreamController constructor cannot be used directly")}return Object.defineProperty(e.prototype,"byobRequest",{get:function(){if(!1===Vt(this))throw Sr("byobRequest");if(void 0===this._byobRequest&&this._pendingPullIntos.length>0){var e=this._pendingPullIntos.peek(),t=new Uint8Array(e.buffer,e.byteOffset+e.bytesFilled,e.byteLength-e.bytesFilled),r=Object.create(Wt.prototype);br(r,this,t),this._byobRequest=r}return this._byobRequest},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!1===Vt(this))throw Sr("desiredSize");return pr(this)},enumerable:!0,configurable:!0}),e.prototype.close=function(){if(!1===Vt(this))throw Sr("close");if(!0===this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");var e=this._controlledReadableByteStream._state;if("readable"!==e)throw new TypeError("The stream (in "+e+" state) is not in the readable state and cannot be closed");hr(this)},e.prototype.enqueue=function(e){if(!1===Vt(this))throw Sr("enqueue");if(!0===this._closeRequested)throw new TypeError("stream is closed or draining");var t=this._controlledReadableByteStream._state;if("readable"!==t)throw new TypeError("The stream (in "+t+" state) is not in the readable state and cannot be enqueued to");if(!ArrayBuffer.isView(e))throw new TypeError("You can only enqueue array buffer views when using a ReadableByteStreamController");g(e.buffer),fr(this,e)},e.prototype.error=function(e){if(!1===Vt(this))throw Sr("error");dr(this,e)},e.prototype[W]=function(e){this._pendingPullIntos.length>0&&(this._pendingPullIntos.peek().bytesFilled=0),ue(this);var t=this._cancelAlgorithm(e);return ur(this),t},e.prototype[H]=function(){var e=this._controlledReadableByteStream;if(this._queueTotalSize>0){var t=this._queue.shift();this._queueTotalSize-=t.byteLength,tr(this);var r=void 0;try{r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}catch(e){return A(e)}return _(F(r,!1,e._reader._forAuthorCode))}var n=this._autoAllocateChunkSize;if(void 0!==n){var a=void 0;try{a=new ArrayBuffer(n)}catch(e){return A(e)}var i={buffer:a,byteOffset:0,byteLength:n,bytesFilled:0,elementSize:1,ctor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(i)}var o=X(e);return Yt(this),o},e}();function Vt(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")}function Xt(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")}function Yt(e){!1!==lr(e)&&(!0!==e._pulling?(e._pulling=!0,C(e._pullAlgorithm(),(function(){e._pulling=!1,!0===e._pullAgain&&(e._pullAgain=!1,Yt(e))}),(function(t){dr(e,t)}))):e._pullAgain=!0)}function Kt(e){rr(e),e._pendingPullIntos=new I}function Jt(e,t){var r=!1;"closed"===e._state&&(r=!0);var n=Qt(t);"default"===t.readerType?Y(e,n,r):Ar(e,n,r)}function Qt(e){var t=e.bytesFilled,r=e.elementSize;return new e.ctor(e.buffer,e.byteOffset,t/r)}function $t(e,t,r,n){e._queue.push({buffer:t,byteOffset:r,byteLength:n}),e._queueTotalSize+=n}function Zt(e,t){var r=t.elementSize,n=t.bytesFilled-t.bytesFilled%r,a=Math.min(e._queueTotalSize,t.byteLength-t.bytesFilled),i=t.bytesFilled+a,o=i-i%r,c=a,l=!1;o>n&&(c=o-t.bytesFilled,l=!0);for(var u=e._queue;c>0;){var h=u.peek(),f=Math.min(c,h.byteLength),d=t.byteOffset+t.bytesFilled;s(t.buffer,d,h.buffer,h.byteOffset,f),h.byteLength===f?u.shift():(h.byteOffset+=f,h.byteLength-=f),e._queueTotalSize-=f,er(e,f,t),c-=f}return l}function er(e,t,r){rr(e),r.bytesFilled+=t}function tr(e){0===e._queueTotalSize&&!0===e._closeRequested?(ur(e),Dr(e._controlledReadableByteStream)):Yt(e)}function rr(e){void 0!==e._byobRequest&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=void 0,e._byobRequest=void 0)}function nr(e){for(;e._pendingPullIntos.length>0;){if(0===e._queueTotalSize)return;var t=e._pendingPullIntos.peek();!0===Zt(e,t)&&(cr(e),Jt(e._controlledReadableByteStream,t))}}function ar(e,t){var r=e._controlledReadableByteStream,n=1;t.constructor!==DataView&&(n=t.constructor.BYTES_PER_ELEMENT);var a=t.constructor,i={buffer:p(t.buffer),byteOffset:t.byteOffset,byteLength:t.byteLength,bytesFilled:0,elementSize:n,ctor:a,readerType:"byob"};if(e._pendingPullIntos.length>0)return e._pendingPullIntos.push(i),_r(r);if("closed"===r._state)return _(F(new a(i.buffer,i.byteOffset,0),!0,r._reader._forAuthorCode));if(e._queueTotalSize>0){if(!0===Zt(e,i)){var o=Qt(i);return tr(e),_(F(o,!1,r._reader._forAuthorCode))}if(!0===e._closeRequested){var s=new TypeError("Insufficient bytes to fill elements in the given buffer");return dr(e,s),A(s)}}e._pendingPullIntos.push(i);var c=_r(r);return Yt(e),c}function ir(e,t){t.buffer=p(t.buffer);var r=e._controlledReadableByteStream;if(!0===Cr(r))for(;xr(r)>0;)Jt(r,cr(e))}function or(e,t,r){if(r.bytesFilled+t>r.byteLength)throw new RangeError("bytesWritten out of range");if(er(e,t,r),!(r.bytesFilled0){var a=r.byteOffset+r.bytesFilled,i=r.buffer.slice(a-n,a);$t(e,i,0,i.byteLength)}r.buffer=p(r.buffer),r.bytesFilled-=n,Jt(e._controlledReadableByteStream,r),nr(e)}}function sr(e,t){var r=e._pendingPullIntos.peek();if("closed"===e._controlledReadableByteStream._state){if(0!==t)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream");ir(e,r)}else or(e,t,r);Yt(e)}function cr(e){var t=e._pendingPullIntos.shift();return rr(e),t}function lr(e){var t=e._controlledReadableByteStream;return"readable"===t._state&&!0!==e._closeRequested&&!1!==e._started&&(!0===J(t)&&K(t)>0||!0===Cr(t)&&xr(t)>0||pr(e)>0)}function ur(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function hr(e){var t=e._controlledReadableByteStream;if(e._queueTotalSize>0)e._closeRequested=!0;else{if(e._pendingPullIntos.length>0&&e._pendingPullIntos.peek().bytesFilled>0){var r=new TypeError("Insufficient bytes to fill elements in the given buffer");throw dr(e,r),r}ur(e),Dr(t)}}function fr(e,t){var r=e._controlledReadableByteStream,n=t.buffer,a=t.byteOffset,i=t.byteLength,o=p(n);!0===J(r)?0===K(r)?$t(e,o,a,i):Y(r,new Uint8Array(o,a,i),!1):!0===Cr(r)?($t(e,o,a,i),nr(e)):$t(e,o,a,i),Yt(e)}function dr(e,t){var r=e._controlledReadableByteStream;"readable"===r._state&&(Kt(e),ue(e),ur(e),Br(r,t))}function pr(e){var t=e._controlledReadableByteStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function gr(e,t){if(!1===c(t=Number(t)))throw new RangeError("bytesWritten must be a finite");sr(e,t)}function mr(e,t){var r=e._pendingPullIntos.peek();if(r.byteOffset+r.bytesFilled!==t.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(r.byteLength!==t.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");r.buffer=t.buffer,sr(e,t.byteLength)}function vr(e,t,r,n,a,i,o){t._controlledReadableByteStream=e,t._pullAgain=!1,t._pulling=!1,t._byobRequest=void 0,t._queue=t._queueTotalSize=void 0,ue(t),t._closeRequested=!1,t._started=!1,t._strategyHWM=m(i),t._pullAlgorithm=n,t._cancelAlgorithm=a,t._autoAllocateChunkSize=o,t._pendingPullIntos=new I,e._readableStreamController=t,C(_(r()),(function(){t._started=!0,Yt(t)}),(function(e){dr(t,e)}))}function yr(e,t,r){var n=Object.create(Ht.prototype);function a(){return f(t,"start",[n])}var i=h(t,"pull",0,[n]),o=h(t,"cancel",1,[]),s=t.autoAllocateChunkSize;if(void 0!==s&&(s=Number(s),!1===Gt(s)||s<=0))throw new RangeError("autoAllocateChunkSize must be a positive integer");vr(e,n,a,i,o,r,s)}function br(e,t,r){e._associatedReadableByteStreamController=t,e._view=r}function wr(e){return new TypeError("ReadableStreamBYOBRequest.prototype."+e+" can only be used on a ReadableStreamBYOBRequest")}function Sr(e){return new TypeError("ReadableByteStreamController.prototype."+e+" can only be used on a ReadableByteStreamController")}function kr(e,t){void 0===t&&(t=!1);var r=new Pr(e);return r._forAuthorCode=t,r}function _r(e){return k((function(t,r){var n={_resolve:t,_reject:r};e._reader._readIntoRequests.push(n)}))}function Ar(e,t,r){var n=e._reader;n._readIntoRequests.shift()._resolve(F(t,r,n._forAuthorCode))}function xr(e){return e._reader._readIntoRequests.length}function Cr(e){var t=e._reader;return void 0!==t&&!!Tr(t)}var Pr=function(){function e(e){if(!Lr(e))throw new TypeError("ReadableStreamBYOBReader can only be constructed with a ReadableStream instance given a byte source");if(!1===Vt(e._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");if(Mr(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");L(this,e),this._readIntoRequests=new I}return Object.defineProperty(e.prototype,"closed",{get:function(){return Tr(this)?this._closedPromise:A(Rr("closed"))},enumerable:!0,configurable:!0}),e.prototype.cancel=function(e){return Tr(this)?void 0===this._ownerReadableStream?A(D("cancel")):M(this,e):A(Rr("cancel"))},e.prototype.read=function(e){return Tr(this)?void 0===this._ownerReadableStream?A(D("read from")):ArrayBuffer.isView(e)?(g(e.buffer),0===e.byteLength?A(new TypeError("view must have non-zero byteLength")):Er(this,e)):A(new TypeError("view must be an array buffer view")):A(Rr("read"))},e.prototype.releaseLock=function(){if(!Tr(this))throw Rr("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readIntoRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");N(this)}},e}();function Tr(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")}function Er(e,t){var r=e._ownerReadableStream;return r._disturbed=!0,"errored"===r._state?A(r._storedError):ar(r._readableStreamController,t)}function Rr(e){return new TypeError("ReadableStreamBYOBReader.prototype."+e+" can only be used on a ReadableStreamBYOBReader")}var Or=function(){function e(e,t){void 0===e&&(e={}),void 0===t&&(t={}),Fr(this);var r=t.size,n=t.highWaterMark,a=e.type;if("bytes"===String(a)){if(void 0!==r)throw new RangeError("The strategy for a byte stream cannot have a size function");void 0===n&&(n=0),yr(this,e,n=m(n))}else{if(void 0!==a)throw new RangeError("Invalid type is specified");var i=v(r);void 0===n&&(n=1),Ut(this,e,n=m(n),i)}}return Object.defineProperty(e.prototype,"locked",{get:function(){if(!1===Lr(this))throw jr("locked");return Mr(this)},enumerable:!0,configurable:!0}),e.prototype.cancel=function(e){return!1===Lr(this)?A(jr("cancel")):!0===Mr(this)?A(new TypeError("Cannot cancel a stream that already has a reader")):Nr(this,e)},e.prototype.getReader=function(e){var t=(void 0===e?{}:e).mode;if(!1===Lr(this))throw jr("getReader");if(void 0===t)return V(this,!0);if("byob"===(t=String(t)))return kr(this,!0);throw new RangeError("Invalid mode is specified")},e.prototype.pipeThrough=function(e,t){var r=e.writable,n=e.readable,a=void 0===t?{}:t,i=a.preventClose,o=a.preventAbort,s=a.preventCancel,c=a.signal;if(!1===Lr(this))throw jr("pipeThrough");if(!1===ve(r))throw new TypeError("writable argument to pipeThrough must be a WritableStream");if(!1===Lr(n))throw new TypeError("readable argument to pipeThrough must be a ReadableStream");if(i=Boolean(i),o=Boolean(o),s=Boolean(s),void 0!==c&&!kt(c))throw new TypeError("ReadableStream.prototype.pipeThrough's signal option must be an AbortSignal");if(!0===Mr(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(!0===ye(r))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return R(Pt(this,r,i,o,s,c)),n},e.prototype.pipeTo=function(e,t){var r=void 0===t?{}:t,n=r.preventClose,a=r.preventAbort,i=r.preventCancel,o=r.signal;return!1===Lr(this)?A(jr("pipeTo")):!1===ve(e)?A(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream")):(n=Boolean(n),a=Boolean(a),i=Boolean(i),void 0===o||kt(o)?!0===Mr(this)?A(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):!0===ye(e)?A(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Pt(this,e,n,a,i,o):A(new TypeError("ReadableStream.prototype.pipeTo's signal option must be an AbortSignal")))},e.prototype.tee=function(){if(!1===Lr(this))throw jr("tee");return o(zt(this))},e.prototype.getIterator=function(e){var t=(void 0===e?{}:e).preventCancel,r=void 0!==t&&t;if(!1===Lr(this))throw jr("getIterator");return ae(this,r)},e}();function Ir(e,t,r,n,a){void 0===n&&(n=1),void 0===a&&(a=function(){return 1});var i=Object.create(Or.prototype);return Fr(i),jt(i,Object.create(Tt.prototype),e,t,r,n,a),i}function Fr(e){e._state="readable",e._reader=void 0,e._storedError=void 0,e._disturbed=!1}function Lr(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")}function Mr(e){return void 0!==e._reader}function Nr(e,t){return e._disturbed=!0,"closed"===e._state?_(void 0):"errored"===e._state?A(e._storedError):(Dr(e),E(e._readableStreamController[W](t),r))}function Dr(e){e._state="closed";var t=e._reader;void 0!==t&&(ee(t)&&(t._readRequests.forEach((function(e){e._resolve(F(void 0,!0,t._forAuthorCode))})),t._readRequests=new I),G(t))}function Br(e,t){e._state="errored",e._storedError=t;var r=e._reader;void 0!==r&&(ee(r)?(r._readRequests.forEach((function(e){e._reject(t)})),r._readRequests=new I):(r._readIntoRequests.forEach((function(e){e._reject(t)})),r._readIntoRequests=new I),q(r,t))}function jr(e){return new TypeError("ReadableStream.prototype."+e+" can only be used on a ReadableStream")}"symbol"==typeof t.asyncIterator&&Object.defineProperty(Or.prototype,t.asyncIterator,{value:Or.prototype.getIterator,enumerable:!1,writable:!0,configurable:!0});var Ur=function(){function e(e){var t=e.highWaterMark;this.highWaterMark=t}return e.prototype.size=function(e){return e.byteLength},e}(),qr=function(){function e(e){var t=e.highWaterMark;this.highWaterMark=t}return e.prototype.size=function(){return 1},e}(),zr=function(){function e(e,t,r){void 0===e&&(e={}),void 0===t&&(t={}),void 0===r&&(r={});var n=t.size,a=t.highWaterMark,i=r.size,o=r.highWaterMark;if(void 0!==e.writableType)throw new RangeError("Invalid writable type specified");var s=v(n);if(void 0===a&&(a=1),a=m(a),void 0!==e.readableType)throw new RangeError("Invalid readable type specified");var c,l=v(i);void 0===o&&(o=0),o=m(o),Gr(this,k((function(e){c=e})),a,s,o,l),Qr(this,e);var u=f(e,"start",[this._transformStreamController]);c(u)}return Object.defineProperty(e.prototype,"readable",{get:function(){if(!1===Wr(this))throw ln("readable");return this._readable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"writable",{get:function(){if(!1===Wr(this))throw ln("writable");return this._writable},enumerable:!0,configurable:!0}),e}();function Gr(e,t,r,n,a,i){function o(){return t}function s(t){return nn(e,t)}function c(t){return an(e,t)}function l(){return on(e)}function u(){return sn(e)}function h(t){return Vr(e,t),_(void 0)}e._writable=ge(o,s,l,c,r,n),e._readable=Ir(o,u,h,a,i),e._backpressure=void 0,e._backpressureChangePromise=void 0,e._backpressureChangePromise_resolve=void 0,Xr(e,!0),e._transformStreamController=void 0}function Wr(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")}function Hr(e,t){Mt(e._readable._readableStreamController,t),Vr(e,t)}function Vr(e,t){$r(e._transformStreamController),tt(e._writable._writableStreamController,t),!0===e._backpressure&&Xr(e,!1)}function Xr(e,t){void 0!==e._backpressureChangePromise&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=k((function(t){e._backpressureChangePromise_resolve=t})),e._backpressure=t}var Yr=function(){function e(){throw new TypeError("TransformStreamDefaultController instances cannot be created directly")}return Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!1===Kr(this))throw cn("desiredSize");return Nt(this._controlledTransformStream._readable._readableStreamController)},enumerable:!0,configurable:!0}),e.prototype.enqueue=function(e){if(!1===Kr(this))throw cn("enqueue");Zr(this,e)},e.prototype.error=function(e){if(!1===Kr(this))throw cn("error");en(this,e)},e.prototype.terminate=function(){if(!1===Kr(this))throw cn("terminate");rn(this)},e}();function Kr(e){return!!i(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")}function Jr(e,t,r,n){t._controlledTransformStream=e,e._transformStreamController=t,t._transformAlgorithm=r,t._flushAlgorithm=n}function Qr(e,t){var r=Object.create(Yr.prototype),n=function(e){try{return Zr(r,e),_(void 0)}catch(e){return A(e)}},a=t.transform;if(void 0!==a){if("function"!=typeof a)throw new TypeError("transform is not a method");n=function(e){return d(a,t,[e,r])}}var i=h(t,"flush",0,[r]);Jr(e,r,n,i)}function $r(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0}function Zr(e,t){var r=e._controlledTransformStream,n=r._readable._readableStreamController;if(!1===Bt(n))throw new TypeError("Readable side is not in a state that permits enqueue");try{Lt(n,t)}catch(e){throw Vr(r,e),r._readable._storedError}Dt(n)!==r._backpressure&&Xr(r,!0)}function en(e,t){Hr(e._controlledTransformStream,t)}function tn(e,t){return E(e._transformAlgorithm(t),void 0,(function(t){throw Hr(e._controlledTransformStream,t),t}))}function rn(e){var t=e._controlledTransformStream,r=t._readable._readableStreamController;!0===Bt(r)&&Ft(r),Vr(t,new TypeError("TransformStream terminated"))}function nn(e,t){var r=e._transformStreamController;return!0===e._backpressure?E(e._backpressureChangePromise,(function(){var n=e._writable;if("erroring"===n._state)throw n._storedError;return tn(r,t)})):tn(r,t)}function an(e,t){return Hr(e,t),_(void 0)}function on(e){var t=e._readable,r=e._transformStreamController,n=r._flushAlgorithm();return $r(r),E(n,(function(){if("errored"===t._state)throw t._storedError;var e=t._readableStreamController;!0===Bt(e)&&Ft(e)}),(function(r){throw Hr(e,r),t._storedError}))}function sn(e){return Xr(e,!1),e._backpressureChangePromise}function cn(e){return new TypeError("TransformStreamDefaultController.prototype."+e+" can only be used on a TransformStreamDefaultController")}function ln(e){return new TypeError("TransformStream.prototype."+e+" can only be used on a TransformStream")}e.ByteLengthQueuingStrategy=Ur,e.CountQueuingStrategy=qr,e.ReadableStream=Or,e.TransformStream=zr,e.WritableStream=de,Object.defineProperty(e,"__esModule",{value:!0})}(t)},function(e,t,r){r(145),r(114),r(77),r(116);var n=r(43);e.exports=n.Map},function(e,t,r){var n=r(146),a=r(150);e.exports=n("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),a)},function(e,t,r){var n=r(10),a=r(11),i=r(52),o=r(29),s=r(147),c=r(124),l=r(123),u=r(22),h=r(14),f=r(97),d=r(85),p=r(149);e.exports=function(e,t,r){var g=-1!==e.indexOf("Map"),m=-1!==e.indexOf("Weak"),v=g?"set":"add",y=a[e],b=y&&y.prototype,w=y,S={},k=function(e){var t=b[e];o(b,e,"add"==e?function(e){return t.call(this,0===e?0:e),this}:"delete"==e?function(e){return!(m&&!u(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return m&&!u(e)?void 0:t.call(this,0===e?0:e)}:"has"==e?function(e){return!(m&&!u(e))&&t.call(this,0===e?0:e)}:function(e,r){return t.call(this,0===e?0:e,r),this})};if(i(e,"function"!=typeof y||!(m||b.forEach&&!h((function(){(new y).entries().next()})))))w=r.getConstructor(t,e,g,v),s.REQUIRED=!0;else if(i(e,!0)){var _=new w,A=_[v](m?{}:-0,1)!=_,x=h((function(){_.has(1)})),C=f((function(e){new y(e)})),P=!m&&h((function(){for(var e=new y,t=5;t--;)e[v](t,t);return!e.has(-0)}));C||((w=t((function(t,r){l(t,w,e);var n=p(new y,t,w);return null!=r&&c(r,n[v],n,g),n}))).prototype=b,b.constructor=w),(x||P)&&(k("delete"),k("has"),g&&k("get")),(P||A)&&k(v),m&&b.clear&&delete b.clear}return S[e]=w,n({global:!0,forced:w!=y},S),d(w,e),m||r.setStrong(w,e,g),w}},function(e,t,r){var n=r(39),a=r(22),i=r(23),o=r(27).f,s=r(38),c=r(148),l=s("meta"),u=0,h=Object.isExtensible||function(){return!0},f=function(e){o(e,l,{value:{objectID:"O"+ ++u,weakData:{}}})},d=e.exports={REQUIRED:!1,fastKey:function(e,t){if(!a(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,l)){if(!h(e))return"F";if(!t)return"E";f(e)}return e[l].objectID},getWeakData:function(e,t){if(!i(e,l)){if(!h(e))return!0;if(!t)return!1;f(e)}return e[l].weakData},onFreeze:function(e){return c&&d.REQUIRED&&h(e)&&!i(e,l)&&f(e),e}};n[l]=!0},function(e,t,r){var n=r(14);e.exports=!n((function(){return Object.isExtensible(Object.preventExtensions({}))}))},function(e,t,r){var n=r(22),a=r(87);e.exports=function(e,t,r){var i,o;return a&&"function"==typeof(i=t.constructor)&&i!==r&&n(o=i.prototype)&&o!==r.prototype&&a(e,o),e}},function(e,t,r){var n=r(27).f,a=r(71),i=r(121),o=r(62),s=r(123),c=r(124),l=r(79),u=r(122),h=r(13),f=r(147).fastKey,d=r(33),p=d.set,g=d.getterFor;e.exports={getConstructor:function(e,t,r,l){var u=e((function(e,n){s(e,u,t),p(e,{type:t,index:a(null),first:void 0,last:void 0,size:0}),h||(e.size=0),null!=n&&c(n,e[l],e,r)})),d=g(t),m=function(e,t,r){var n,a,i=d(e),o=v(e,t);return o?o.value=r:(i.last=o={index:a=f(t,!0),key:t,value:r,previous:n=i.last,next:void 0,removed:!1},i.first||(i.first=o),n&&(n.next=o),h?i.size++:e.size++,"F"!==a&&(i.index[a]=o)),e},v=function(e,t){var r,n=d(e),a=f(t);if("F"!==a)return n.index[a];for(r=n.first;r;r=r.next)if(r.key==t)return r};return i(u.prototype,{clear:function(){for(var e=d(this),t=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete t[r.index],r=r.next;e.first=e.last=void 0,h?e.size=0:this.size=0},delete:function(e){var t=this,r=d(t),n=v(t,e);if(n){var a=n.next,i=n.previous;delete r.index[n.index],n.removed=!0,i&&(i.next=a),a&&(a.previous=i),r.first==n&&(r.first=a),r.last==n&&(r.last=i),h?r.size--:t.size--}return!!n},forEach:function(e){for(var t,r=d(this),n=o(e,arguments.length>1?arguments[1]:void 0,3);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!v(this,e)}}),i(u.prototype,r?{get:function(e){var t=v(this,e);return t&&t.value},set:function(e,t){return m(this,0===e?0:e,t)}}:{add:function(e){return m(this,e=0===e?0:e,e)}}),h&&n(u.prototype,"size",{get:function(){return d(this).size}}),u},setStrong:function(e,t,r){var n=t+" Iterator",a=g(t),i=g(n);l(e,t,(function(e,t){p(this,{type:n,target:e,state:a(e),kind:t,last:void 0})}),(function(){for(var e=i(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?"keys"==t?{value:r.key,done:!1}:"values"==t?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})}),r?"entries":"values",!r,!0),u(t)}}},function(e,t,r){r(152),r(114),r(77),r(116);var n=r(43);e.exports=n.Set},function(e,t,r){var n=r(146),a=r(150);e.exports=n("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),a)},function(e,t,r){r(114),r(154),r(116);var n=r(43);e.exports=n.WeakMap},function(e,t,r){var n,a=r(11),i=r(121),o=r(147),s=r(146),c=r(155),l=r(22),u=r(33).enforce,h=r(34),f=!a.ActiveXObject&&"ActiveXObject"in a,d=Object.isExtensible,p=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},g=e.exports=s("WeakMap",p,c);if(h&&f){n=c.getConstructor(p,"WeakMap",!0),o.REQUIRED=!0;var m=g.prototype,v=m.delete,y=m.has,b=m.get,w=m.set;i(m,{delete:function(e){if(l(e)&&!d(e)){var t=u(this);return t.frozen||(t.frozen=new n),v.call(this,e)||t.frozen.delete(e)}return v.call(this,e)},has:function(e){if(l(e)&&!d(e)){var t=u(this);return t.frozen||(t.frozen=new n),y.call(this,e)||t.frozen.has(e)}return y.call(this,e)},get:function(e){if(l(e)&&!d(e)){var t=u(this);return t.frozen||(t.frozen=new n),y.call(this,e)?b.call(this,e):t.frozen.get(e)}return b.call(this,e)},set:function(e,t){if(l(e)&&!d(e)){var r=u(this);r.frozen||(r.frozen=new n),y.call(this,e)?w.call(this,e,t):r.frozen.set(e,t)}else w.call(this,e,t);return this}})}},function(e,t,r){var n=r(121),a=r(147).getWeakData,i=r(28),o=r(22),s=r(123),c=r(124),l=r(156),u=r(23),h=r(33),f=h.set,d=h.getterFor,p=l.find,g=l.findIndex,m=0,v=function(e){return e.frozen||(e.frozen=new y)},y=function(){this.entries=[]},b=function(e,t){return p(e.entries,(function(e){return e[0]===t}))};y.prototype={get:function(e){var t=b(this,e);if(t)return t[1]},has:function(e){return!!b(this,e)},set:function(e,t){var r=b(this,e);r?r[1]=t:this.entries.push([e,t])},delete:function(e){var t=g(this.entries,(function(t){return t[0]===e}));return~t&&this.entries.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,r,l){var h=e((function(e,n){s(e,h,t),f(e,{type:t,id:m++,frozen:void 0}),null!=n&&c(n,e[l],e,r)})),p=d(t),g=function(e,t,r){var n=p(e),o=a(i(t),!0);return!0===o?v(n).set(t,r):o[n.id]=r,e};return n(h.prototype,{delete:function(e){var t=p(this);if(!o(e))return!1;var r=a(e);return!0===r?v(t).delete(e):r&&u(r,t.id)&&delete r[t.id]},has:function(e){var t=p(this);if(!o(e))return!1;var r=a(e);return!0===r?v(t).has(e):r&&u(r,t.id)}}),n(h.prototype,r?{get:function(e){var t=p(this);if(o(e)){var r=a(e);return!0===r?v(t).get(e):r?r[t.id]:void 0}},set:function(e,t){return g(this,e,t)}}:{add:function(e){return g(this,e,!0)}}),h}}},function(e,t,r){var n=r(62),a=r(18),i=r(83),o=r(47),s=r(157),c=[].push,l=function(e){var t=1==e,r=2==e,l=3==e,u=4==e,h=6==e,f=5==e||h;return function(d,p,g,m){for(var v,y,b=i(d),w=a(b),S=n(p,g,3),k=o(w.length),_=0,A=m||s,x=t?A(d,k):r?A(d,0):void 0;k>_;_++)if((f||_ in w)&&(y=S(v=w[_],_,b),e))if(t)x[_]=y;else if(y)switch(e){case 3:return!0;case 5:return v;case 6:return _;case 2:c.call(x,v)}else if(u)return!1;return h?-1:l||u?u:x}};e.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6)}},function(e,t,r){var n=r(22),a=r(158),i=r(57)("species");e.exports=function(e,t){var r;return a(e)&&("function"!=typeof(r=e.constructor)||r!==Array&&!a(r.prototype)?n(r)&&null===(r=r[i])&&(r=void 0):r=void 0),new(void 0===r?Array:r)(0===t?0:t)}},function(e,t,r){var n=r(19);e.exports=Array.isArray||function(e){return"Array"==n(e)}},function(e,t,r){r(114),r(160),r(116);var n=r(43);e.exports=n.WeakSet},function(e,t,r){r(146)("WeakSet",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),r(155))},function(e,t,r){r(162);var n=r(61);e.exports=n("String","codePointAt")},function(e,t,r){var n=r(10),a=r(78).codeAt;n({target:"String",proto:!0},{codePointAt:function(e){return a(this,e)}})},function(e,t,r){r(164);var n=r(43);e.exports=n.String.fromCodePoint},function(e,t,r){var n=r(10),a=r(49),i=String.fromCharCode,o=String.fromCodePoint;n({target:"String",stat:!0,forced:!!o&&1!=o.length},{fromCodePoint:function(e){for(var t,r=[],n=arguments.length,o=0;n>o;){if(t=+arguments[o++],a(t,1114111)!==t)throw RangeError(t+" is not a valid code point");r.push(t<65536?i(t):i(55296+((t-=65536)>>10),t%1024+56320))}return r.join("")}})},function(e,t,r){r(166),r(114),r(168),r(172),r(173),r(174),r(175),r(176),r(177),r(178),r(179),r(180),r(181),r(182),r(183),r(184),r(185),r(186),r(187);var n=r(43);e.exports=n.Symbol},function(e,t,r){var n=r(10),a=r(14),i=r(158),o=r(22),s=r(83),c=r(47),l=r(93),u=r(157),h=r(167),f=r(57),d=r(133),p=f("isConcatSpreadable"),g=9007199254740991,m="Maximum allowed index exceeded",v=d>=51||!a((function(){var e=[];return e[p]=!1,e.concat()[0]!==e})),y=h("concat"),b=function(e){if(!o(e))return!1;var t=e[p];return void 0!==t?!!t:i(e)};n({target:"Array",proto:!0,forced:!v||!y},{concat:function(e){var t,r,n,a,i,o=s(this),h=u(o,0),f=0;for(t=-1,n=arguments.length;tg)throw TypeError(m);for(r=0;r=g)throw TypeError(m);l(h,f++,i)}return h.length=f,h}})},function(e,t,r){var n=r(14),a=r(57),i=r(133),o=a("species");e.exports=function(e){return i>=51||!n((function(){var t=[];return(t.constructor={})[o]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},function(e,t,r){var n=r(10),a=r(11),i=r(42),o=r(37),s=r(13),c=r(58),l=r(59),u=r(14),h=r(23),f=r(158),d=r(22),p=r(28),g=r(83),m=r(17),v=r(21),y=r(16),b=r(71),w=r(73),S=r(44),k=r(169),_=r(51),A=r(12),x=r(27),C=r(15),P=r(26),T=r(29),E=r(36),R=r(35),O=r(39),I=r(38),F=r(57),L=r(170),M=r(171),N=r(85),D=r(33),B=r(156).forEach,j=R("hidden"),U="Symbol",q="prototype",z=F("toPrimitive"),G=D.set,W=D.getterFor(U),H=Object[q],V=a.Symbol,X=i("JSON","stringify"),Y=A.f,K=x.f,J=k.f,Q=C.f,$=E("symbols"),Z=E("op-symbols"),ee=E("string-to-symbol-registry"),te=E("symbol-to-string-registry"),re=E("wks"),ne=a.QObject,ae=!ne||!ne[q]||!ne[q].findChild,ie=s&&u((function(){return 7!=b(K({},"a",{get:function(){return K(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=Y(H,t);n&&delete H[t],K(e,t,r),n&&e!==H&&K(H,t,n)}:K,oe=function(e,t){var r=$[e]=b(V[q]);return G(r,{type:U,tag:e,description:t}),s||(r.description=t),r},se=l?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof V},ce=function(e,t,r){e===H&&ce(Z,t,r),p(e);var n=v(t,!0);return p(r),h($,n)?(r.enumerable?(h(e,j)&&e[j][n]&&(e[j][n]=!1),r=b(r,{enumerable:y(0,!1)})):(h(e,j)||K(e,j,y(1,{})),e[j][n]=!0),ie(e,n,r)):K(e,n,r)},le=function(e,t){p(e);var r=m(t),n=w(r).concat(de(r));return B(n,(function(t){s&&!ue.call(r,t)||ce(e,t,r[t])})),e},ue=function(e){var t=v(e,!0),r=Q.call(this,t);return!(this===H&&h($,t)&&!h(Z,t))&&(!(r||!h(this,t)||!h($,t)||h(this,j)&&this[j][t])||r)},he=function(e,t){var r=m(e),n=v(t,!0);if(r!==H||!h($,n)||h(Z,n)){var a=Y(r,n);return!a||!h($,n)||h(r,j)&&r[j][n]||(a.enumerable=!0),a}},fe=function(e){var t=J(m(e)),r=[];return B(t,(function(e){h($,e)||h(O,e)||r.push(e)})),r},de=function(e){var t=e===H,r=J(t?Z:m(e)),n=[];return B(r,(function(e){!h($,e)||t&&!h(H,e)||n.push($[e])})),n};c||(V=function(){if(this instanceof V)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=I(e),r=function(e){this===H&&r.call(Z,e),h(this,j)&&h(this[j],t)&&(this[j][t]=!1),ie(this,t,y(1,e))};return s&&ae&&ie(H,t,{configurable:!0,set:r}),oe(t,e)},T(V[q],"toString",(function(){return W(this).tag})),T(V,"withoutSetter",(function(e){return oe(I(e),e)})),C.f=ue,x.f=ce,A.f=he,S.f=k.f=fe,_.f=de,L.f=function(e){return oe(F(e),e)},s&&(K(V[q],"description",{configurable:!0,get:function(){return W(this).description}}),o||T(H,"propertyIsEnumerable",ue,{unsafe:!0}))),n({global:!0,wrap:!0,forced:!c,sham:!c},{Symbol:V}),B(w(re),(function(e){M(e)})),n({target:U,stat:!0,forced:!c},{for:function(e){var t=String(e);if(h(ee,t))return ee[t];var r=V(t);return ee[t]=r,te[r]=t,r},keyFor:function(e){if(!se(e))throw TypeError(e+" is not a symbol");if(h(te,e))return te[e]},useSetter:function(){ae=!0},useSimple:function(){ae=!1}}),n({target:"Object",stat:!0,forced:!c,sham:!s},{create:function(e,t){return void 0===t?b(e):le(b(e),t)},defineProperty:ce,defineProperties:le,getOwnPropertyDescriptor:he}),n({target:"Object",stat:!0,forced:!c},{getOwnPropertyNames:fe,getOwnPropertySymbols:de}),n({target:"Object",stat:!0,forced:u((function(){_.f(1)}))},{getOwnPropertySymbols:function(e){return _.f(g(e))}}),X&&n({target:"JSON",stat:!0,forced:!c||u((function(){var e=V();return"[null]"!=X([e])||"{}"!=X({a:e})||"{}"!=X(Object(e))}))},{stringify:function(e,t,r){for(var n,a=[e],i=1;arguments.length>i;)a.push(arguments[i++]);if(n=t,(d(t)||void 0!==e)&&!se(e))return f(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!se(t))return t}),a[1]=t,X.apply(null,a)}}),V[q][z]||P(V[q],z,V[q].valueOf),N(V,U),O[j]=!0},function(e,t,r){var n=r(17),a=r(44).f,i={}.toString,o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return o&&"[object Window]"==i.call(e)?function(e){try{return a(e)}catch(e){return o.slice()}}(e):a(n(e))}},function(e,t,r){var n=r(57);t.f=n},function(e,t,r){var n=r(43),a=r(23),i=r(170),o=r(27).f;e.exports=function(e){var t=n.Symbol||(n.Symbol={});a(t,e)||o(t,e,{value:i.f(e)})}},function(e,t,r){r(171)("asyncIterator")},function(e,t,r){var n=r(10),a=r(13),i=r(11),o=r(23),s=r(22),c=r(27).f,l=r(40),u=i.Symbol;if(a&&"function"==typeof u&&(!("description"in u.prototype)||void 0!==u().description)){var h={},f=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof f?new u(e):void 0===e?u():u(e);return""===e&&(h[t]=!0),t};l(f,u);var d=f.prototype=u.prototype;d.constructor=f;var p=d.toString,g="Symbol(test)"==String(u("test")),m=/^Symbol\((.*)\)[^)]+$/;c(d,"description",{configurable:!0,get:function(){var e=s(this)?this.valueOf():this,t=p.call(e);if(o(h,e))return"";var r=g?t.slice(7,-1):t.replace(m,"$1");return""===r?void 0:r}}),n({global:!0,forced:!0},{Symbol:f})}},function(e,t,r){r(171)("hasInstance")},function(e,t,r){r(171)("isConcatSpreadable")},function(e,t,r){r(171)("iterator")},function(e,t,r){r(171)("match")},function(e,t,r){r(171)("matchAll")},function(e,t,r){r(171)("replace")},function(e,t,r){r(171)("search")},function(e,t,r){r(171)("species")},function(e,t,r){r(171)("split")},function(e,t,r){r(171)("toPrimitive")},function(e,t,r){r(171)("toStringTag")},function(e,t,r){r(171)("unscopables")},function(e,t,r){r(85)(Math,"Math",!0)},function(e,t,r){var n=r(11);r(85)(n.JSON,"JSON",!0)},function(e,t,r){r(189);var n=r(61);e.exports=n("String","padStart")},function(e,t,r){var n=r(10),a=r(190).start;n({target:"String",proto:!0,forced:r(192)},{padStart:function(e){return a(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,r){var n=r(47),a=r(191),i=r(20),o=Math.ceil,s=function(e){return function(t,r,s){var c,l,u=String(i(t)),h=u.length,f=void 0===s?" ":String(s),d=n(r);return d<=h||""==f?u:(c=d-h,(l=a.call(f,o(c/f.length))).length>c&&(l=l.slice(0,c)),e?u+l:l+u)}};e.exports={start:s(!1),end:s(!0)}},function(e,t,r){var n=r(48),a=r(20);e.exports="".repeat||function(e){var t=String(a(this)),r="",i=n(e);if(i<0||i==1/0)throw RangeError("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(t+=t))1&i&&(r+=t);return r}},function(e,t,r){var n=r(127);e.exports=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(n)},function(e,t,r){r(194);var n=r(61);e.exports=n("String","padEnd")},function(e,t,r){var n=r(10),a=r(190).end;n({target:"String",proto:!0,forced:r(192)},{padEnd:function(e){return a(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,r){r(196);var n=r(43);e.exports=n.Object.values},function(e,t,r){var n=r(10),a=r(197).values;n({target:"Object",stat:!0},{values:function(e){return a(e)}})},function(e,t,r){var n=r(13),a=r(73),i=r(17),o=r(15).f,s=function(e){return function(t){for(var r,s=i(t),c=a(s),l=c.length,u=0,h=[];l>u;)r=c[u++],n&&!o.call(s,r)||h.push(e?[r,s[r]]:s[r]);return h}};e.exports={entries:s(!0),values:s(!1)}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.clearPrimitiveCaches=function(){l._clearCache(),c._clearCache(),h._clearCache()},t.isEOF=function(e){return e===s},t.isCmd=function(e,t){return e instanceof l&&(void 0===t||e.cmd===t)},t.isDict=g,t.isName=p,t.isRef=function(e){return e instanceof h},t.isRefsEqual=function(e,t){return e.num===t.num&&e.gen===t.gen},t.isStream=function(e){return"object"===i(e)&&null!==e&&void 0!==e.getBytes},t.RefSetCache=t.RefSet=t.Ref=t.Name=t.Dict=t.Cmd=t.EOF=void 0;var n,a=(n=r(2))&&n.__esModule?n:{default:n};function i(e){return i="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},i(e)}function o(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,a)}r(5);var s={};t.EOF=s;var c=function(){var e=Object.create(null);function t(e){this.name=e}return t.prototype={},t.get=function(r){var n=e[r];return n||(e[r]=new t(r))},t._clearCache=function(){e=Object.create(null)},t}();t.Name=c;var l=function(){var e=Object.create(null);function t(e){this.cmd=e}return t.prototype={},t.get=function(r){var n=e[r];return n||(e[r]=new t(r))},t._clearCache=function(){e=Object.create(null)},t}();t.Cmd=l;var u=function(){var e=function(){return e};function t(t){this._map=Object.create(null),this.xref=t,this.objId=null,this.suppressEncryption=!1,this.__nonSerializable__=e}return t.prototype={assignXref:function(e){this.xref=e},get:function(e,t,r){var n=this._map[e];return void 0===n&&void 0!==t&&void 0===(n=this._map[t])&&void 0!==r&&(n=this._map[r]),n instanceof h&&this.xref?this.xref.fetch(n,this.suppressEncryption):n},getAsync:function(e,t,r){var n,i=this;return(n=a.default.mark((function n(){var o;return a.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(void 0===(o=i._map[e])&&void 0!==t&&void 0===(o=i._map[t])&&void 0!==r&&(o=i._map[r]),!(o instanceof h&&i.xref)){n.next=4;break}return n.abrupt("return",i.xref.fetchAsync(o,i.suppressEncryption));case 4:return n.abrupt("return",o);case 5:case"end":return n.stop()}}),n)})),function(){var e=this,t=arguments;return new Promise((function(r,a){var i=n.apply(e,t);function s(e){o(i,r,a,s,c,"next",e)}function c(e){o(i,r,a,s,c,"throw",e)}s(void 0)}))})()},getArray:function(e,t,r){var n=this.get(e,t,r);if(!Array.isArray(n)||!this.xref)return n;for(var a=0,i=(n=n.slice()).length;a0&&void 0!==arguments[0]&&arguments[0];return this.pdfDocument.cleanup(e)}},{key:"ensure",value:(t=v(a.default.mark((function e(t,r,n){return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(0,i.unreachable)("Abstract method `ensure` called");case 1:case"end":return e.stop()}}),e)}))),function(e,r,n){return t.apply(this,arguments)})},{key:"requestRange",value:function(e,t){(0,i.unreachable)("Abstract method `requestRange` called")}},{key:"requestLoadedStream",value:function(){(0,i.unreachable)("Abstract method `requestLoadedStream` called")}},{key:"sendProgressiveData",value:function(e){(0,i.unreachable)("Abstract method `sendProgressiveData` called")}},{key:"updatePassword",value:function(e){this._password=e}},{key:"terminate",value:function(e){(0,i.unreachable)("Abstract method `terminate` called")}},{key:"docId",get:function(){return this._docId}},{key:"password",get:function(){return this._password}},{key:"docBaseUrl",get:function(){var e=null;if(this._docBaseUrl){var t=(0,i.createValidAbsoluteUrl)(this._docBaseUrl);t?e=t.href:(0,i.warn)('Invalid absolute docBaseUrl: "'.concat(this._docBaseUrl,'".'))}return(0,i.shadow)(this,"docBaseUrl",e)}}]),e}(),k=function(e){h(n,e);var t,r=d(n);function n(e,t,a,i,o){var s;y(this,n),(s=r.call(this))._docId=e,s._password=a,s._docBaseUrl=o,s.evaluatorOptions=i;var u=new l.Stream(t);return s.pdfDocument=new c.PDFDocument(p(s),u),s._loadedStreamPromise=Promise.resolve(u),s}return w(n,[{key:"ensure",value:(t=v(a.default.mark((function e(t,r,n){var i;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof(i=t[r])){e.next=3;break}return e.abrupt("return",i.apply(t,n));case 3:return e.abrupt("return",i);case 4:case"end":return e.stop()}}),e)}))),function(e,r,n){return t.apply(this,arguments)})},{key:"requestRange",value:function(e,t){return Promise.resolve()}},{key:"requestLoadedStream",value:function(){}},{key:"onLoadedStream",value:function(){return this._loadedStreamPromise}},{key:"terminate",value:function(e){}}]),n}(S);t.LocalPdfManager=k;var _=function(e){h(n,e);var t,r=d(n);function n(e,t,a,i,s){var l;return y(this,n),(l=r.call(this))._docId=e,l._password=a.password,l._docBaseUrl=s,l.msgHandler=a.msgHandler,l.evaluatorOptions=i,l.streamManager=new o.ChunkedStreamManager(t,{msgHandler:a.msgHandler,length:a.length,disableAutoFetch:a.disableAutoFetch,rangeChunkSize:a.rangeChunkSize}),l.pdfDocument=new c.PDFDocument(p(l),l.streamManager.getStream()),l}return w(n,[{key:"ensure",value:(t=v(a.default.mark((function e(t,r,n){var i;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,"function"!=typeof(i=t[r])){e.next=4;break}return e.abrupt("return",i.apply(t,n));case 4:return e.abrupt("return",i);case 7:if(e.prev=7,e.t0=e.catch(0),e.t0 instanceof s.MissingDataException){e.next=11;break}throw e.t0;case 11:return e.next=13,this.requestRange(e.t0.begin,e.t0.end);case 13:return e.abrupt("return",this.ensure(t,r,n));case 14:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(e,r,n){return t.apply(this,arguments)})},{key:"requestRange",value:function(e,t){return this.streamManager.requestRange(e,t)}},{key:"requestLoadedStream",value:function(){this.streamManager.requestAllChunks()}},{key:"sendProgressiveData",value:function(e){this.streamManager.onReceiveData({chunk:e})}},{key:"onLoadedStream",value:function(){return this.streamManager.onLoadedStream()}},{key:"terminate",value:function(e){this.streamManager.abort(e)}}]),n}(S);t.NetworkPdfManager=_},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.ChunkedStreamManager=t.ChunkedStream=void 0;var n=r(5),a=r(201);function i(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,c=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return s=e.done,e},e:function(e){c=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw i}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=this.end?this.numChunks:Math.floor(t/this.chunkSize),a=r;a=t||t<=this.progressiveDataLength))for(var r=this.chunkSize,n=Math.floor(e/r),i=Math.floor((t-1)/r)+1,o=n;o=this.end?-1:(e>=this.progressiveDataLength&&this.ensureByte(e),this.bytes[this.pos++])}},{key:"getUint16",value:function(){var e=this.getByte(),t=this.getByte();return-1===e||-1===t?-1:(e<<8)+t}},{key:"getInt32",value:function(){return(this.getByte()<<24)+(this.getByte()<<16)+(this.getByte()<<8)+this.getByte()}},{key:"getBytes",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.bytes,n=this.pos,a=this.end;if(!e){a>this.progressiveDataLength&&this.ensureRange(n,a);var i=r.subarray(n,a);return t?new Uint8ClampedArray(i):i}var o=n+e;o>a&&(o=a),o>this.progressiveDataLength&&this.ensureRange(n,o),this.pos=o;var s=r.subarray(n,o);return t?new Uint8ClampedArray(s):s}},{key:"peekByte",value:function(){var e=this.getByte();return-1!==e&&this.pos--,e}},{key:"peekBytes",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.getBytes(e,t);return this.pos-=r.length,r}},{key:"getByteRange",value:function(e,t){return e<0&&(e=0),t>this.end&&(t=this.end),t>this.progressiveDataLength&&this.ensureRange(e,t),this.bytes.subarray(e,t)}},{key:"skip",value:function(e){e||(e=1),this.pos+=e}},{key:"reset",value:function(){this.pos=this.start}},{key:"moveStart",value:function(){this.start=this.pos}},{key:"makeSubStream",value:function(e,t,r){function n(){}t?e+t>this.progressiveDataLength&&this.ensureRange(e,e+t):e>=this.progressiveDataLength&&this.ensureByte(e),n.prototype=Object.create(this),n.prototype.getMissingChunks=function(){for(var e=this.chunkSize,t=Math.floor(this.start/e),r=Math.floor((this.end-1)/e)+1,n=[],a=t;a0&&void 0!==arguments[0]?arguments[0]:[]);try{for(r.s();!(e=r.n()).done;)for(var n=e.value,a=this.getBeginChunk(n.begin),o=this.getEndChunk(n.end),s=a;s=0&&n+1!==o&&(t.push({beginChunk:r,endChunk:n+1}),r=o),a+1===e.length&&t.push({beginChunk:r,endChunk:o+1}),n=o}return t}},{key:"onProgress",value:function(e){this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize+e.loaded,total:this.length})}},{key:"onReceiveData",value:function(e){var t=e.chunk,r=void 0===e.begin,a=r?this.progressiveDataLength:e.begin,o=a+t.byteLength,s=Math.floor(a/this.chunkSize),c=o100){(0,n.warn)('getInheritableProperty: maximum loop count exceeded for "'.concat(a,'"'));break}r=r.get("Parent")}return t},t.toRomanNumerals=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(0,n.assert)(Number.isInteger(e)&&e>0,"The number should be a positive integer.");for(var r,a=[];e>=1e3;)e-=1e3,a.push("M");r=e/100|0,e%=100,a.push(d[r]),r=e/10|0,e%=10,a.push(d[10+r]),a.push(d[20+e]);var i=a.join("");return t?i.toLowerCase():i},t.log2=function(e){return e<=0?0:Math.ceil(Math.log2(e))},t.readInt8=function(e,t){return e[t]<<24>>24},t.readUint16=function(e,t){return e[t]<<8|e[t+1]},t.readUint32=function(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0},t.isWhiteSpace=function(e){return 32===e||9===e||13===e||10===e},t.XRefParseException=t.XRefEntryException=t.MissingDataException=void 0;var n=r(5);function a(e){return a="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},a(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}function s(e,t){return s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},s(e,t)}function c(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=l(e);if(t){var i=l(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return function(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,r)}}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}var u=function(e){o(r,e);var t=c(r);function r(e,n){var a;return i(this,r),(a=t.call(this,"Missing data [".concat(e,", ").concat(n,")"))).begin=e,a.end=n,a}return r}(n.BaseException);t.MissingDataException=u;var h=function(e){o(r,e);var t=c(r);function r(){return i(this,r),t.apply(this,arguments)}return r}(n.BaseException);t.XRefEntryException=h;var f=function(e){o(r,e);var t=c(r);function r(){return i(this,r),t.apply(this,arguments)}return r}(n.BaseException);t.XRefParseException=f;var d=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"]},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.PDFDocument=t.Page=void 0;var n,a=(n=r(2))&&n.__esModule?n:{default:n},i=r(5),o=r(203),s=r(198),c=r(201),l=r(205),u=r(218),h=r(215),f=r(204),d=r(219),p=r(220),g=r(234);function m(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,a)}function v(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){m(i,n,a,o,s,"next",e)}function s(e){m(i,n,a,o,s,"throw",e)}o(void 0)}))}}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){a=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(a)throw i}}return r}}(e,t)||w(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=w(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw i}}}}function w(e,t){if(e){if("string"==typeof e)return S(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?S(e,t):void 0}}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]&&arguments[1],r=(0,c.getInheritableProperty)({dict:this.pageDict,key:e,getArray:t,stopWhenFound:!1});return Array.isArray(r)?1!==r.length&&(0,s.isDict)(r[0])?s.Dict.merge(this.xref,r):r[0]:r}},{key:"_getBoundingBox",value:function(e){var t=this._getInheritableProperty(e,!0);if(Array.isArray(t)&&4===t.length){if(t[2]-t[0]!=0&&t[3]-t[1]!=0)return t;(0,i.warn)("Empty /".concat(e," entry."))}return null}},{key:"getContentStream",value:function(){var e,t=this.content;if(Array.isArray(t)){var r,n=this.xref,a=[],i=b(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;a.push(n.fetchIfRef(o))}}catch(e){i.e(e)}finally{i.f()}e=new l.StreamsSequenceStream(a)}else e=(0,s.isStream)(t)?t:new l.NullStream;return e}},{key:"loadResources",value:function(e){var t=this;return this.resourcesPromise||(this.resourcesPromise=this.pdfManager.ensure(this,"resources")),this.resourcesPromise.then((function(){return new o.ObjectLoader(t.resources,e,t.xref).load()}))}},{key:"getOperatorList",value:function(e){var t=this,r=e.handler,n=e.sink,a=e.task,o=e.intent,s=e.renderInteractiveForms,c=this.pdfManager.ensure(this,"getContentStream"),l=this.loadResources(["ExtGState","ColorSpace","Pattern","Shading","XObject","Font"]),u=new p.PartialEvaluator({xref:this.xref,handler:r,pageIndex:this.pageIndex,idFactory:this.idFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,globalImageCache:this.globalImageCache,options:this.evaluatorOptions,pdfFunctionFactory:this.pdfFunctionFactory}),h=Promise.all([c,l]).then((function(e){var i=y(e,1)[0],s=new d.OperatorList(o,n,t.pageIndex);return r.send("StartRenderPage",{transparency:u.hasBlendModes(t.resources),pageIndex:t.pageIndex,intent:o}),u.getOperatorList({stream:i,task:a,resources:t.resources,operatorList:s}).then((function(){return s}))}));return Promise.all([h,this._parsedAnnotations]).then((function(e){var t=y(e,2),r=t[0],n=t[1];if(0===n.length)return r.flush(!0),{length:r.totalLength};var c,l=[],h=b(n);try{for(h.s();!(c=h.n()).done;){var f=c.value;C(f,o)&&l.push(f.getOperatorList(u,a,s).catch((function(e){return(0,i.warn)("getOperatorList - ignoring annotation data during "+'"'.concat(a.name,'" task: "').concat(e,'".')),null})))}}catch(e){h.e(e)}finally{h.f()}return Promise.all(l).then((function(e){r.addOp(i.OPS.beginAnnotations,[]);var t,n=b(e);try{for(n.s();!(t=n.n()).done;){var a=t.value;r.addOpList(a)}}catch(e){n.e(e)}finally{n.f()}return r.addOp(i.OPS.endAnnotations,[]),r.flush(!0),{length:r.totalLength}}))}))}},{key:"extractTextContent",value:function(e){var t=this,r=e.handler,n=e.task,a=e.normalizeWhitespace,i=e.sink,o=e.combineTextItems,s=this.pdfManager.ensure(this,"getContentStream"),c=this.loadResources(["ExtGState","XObject","Font"]);return Promise.all([s,c]).then((function(e){var s=y(e,1)[0];return new p.PartialEvaluator({xref:t.xref,handler:r,pageIndex:t.pageIndex,idFactory:t.idFactory,fontCache:t.fontCache,builtInCMapCache:t.builtInCMapCache,globalImageCache:t.globalImageCache,options:t.evaluatorOptions,pdfFunctionFactory:t.pdfFunctionFactory}).getTextContent({stream:s,task:n,resources:t.resources,normalizeWhitespace:a,combineTextItems:o,sink:i})}))}},{key:"getAnnotationsData",value:function(e){return this._parsedAnnotations.then((function(t){for(var r=[],n=0,a=t.length;n=360?e%=360:e<0&&(e=(e%360+360)%360),(0,i.shadow)(this,"rotate",e)}},{key:"annotations",get:function(){return(0,i.shadow)(this,"annotations",this._getInheritableProperty("Annots")||[])}},{key:"_parsedAnnotations",get:function(){var e=this,t=this.pdfManager.ensure(this,"annotations").then((function(){var t,r=[],n=b(e.annotations);try{for(n.s();!(t=n.n()).done;){var a=t.value;r.push(u.AnnotationFactory.create(e.xref,a,e.pdfManager,e.idFactory).catch((function(e){return(0,i.warn)('_parsedAnnotations: "'.concat(e,'".')),null})))}}catch(e){n.e(e)}finally{n.f()}return Promise.all(r).then((function(e){return e.filter((function(e){return!!e}))}))}));return(0,i.shadow)(this,"_parsedAnnotations",t)}}]),e}();t.Page=P;var T=new Uint8Array([37,80,68,70,45]),E=new Uint8Array([115,116,97,114,116,120,114,101,102]),R=new Uint8Array([101,110,100,111,98,106]),O=/^[1-9]\.[0-9]$/;function I(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1024,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=t.length,i=e.peekBytes(r),o=i.length-a;if(o<=0)return!1;if(n)for(var s=a-1,c=i.length-1;c>=s;){for(var l=0;l=a)return e.pos+=c-s,!0;c--}else for(var u=0;u<=o;){for(var h=0;h=a)return e.pos+=u,!0;u++}return!1}var F=function(){function e(t,r){var n;if(k(this,e),(0,s.isStream)(r))n=r;else{if(!(0,i.isArrayBuffer)(r))throw new Error("PDFDocument: Unknown argument type");n=new l.Stream(r)}if(n.length<=0)throw new i.InvalidPDFException("The PDF file is empty, i.e. its size is zero bytes.");this.pdfManager=t,this.stream=n,this.xref=new o.XRef(n,t),this.pdfFunctionFactory=new g.PDFFunctionFactory({xref:this.xref,isEvalSupported:t.evaluatorOptions.isEvalSupported}),this._pagePromises=[]}var t;return A(e,[{key:"parse",value:function(e){this.setup(e);var t=this.catalog.catDict.get("Version");(0,s.isName)(t)&&(this.pdfFormatVersion=t.name);try{if(this.acroForm=this.catalog.catDict.get("AcroForm"),this.acroForm){this.xfa=this.acroForm.get("XFA");var r=this.acroForm.get("Fields");Array.isArray(r)&&0!==r.length||this.xfa||(this.acroForm=null)}}catch(e){if(e instanceof c.MissingDataException)throw e;(0,i.info)("Cannot fetch AcroForm entry; assuming no AcroForms are present"),this.acroForm=null}try{var n=this.catalog.catDict.get("Collection");(0,s.isDict)(n)&&n.getKeys().length>0&&(this.collection=n)}catch(e){if(e instanceof c.MissingDataException)throw e;(0,i.info)("Cannot fetch Collection dictionary.")}}},{key:"checkHeader",value:function(){var e=this.stream;if(e.reset(),I(e,T)){e.moveStart();for(var t,r="";(t=e.getByte())>32&&!(r.length>=12);)r+=String.fromCharCode(t);this.pdfFormatVersion||(this.pdfFormatVersion=r.substring(5))}}},{key:"parseStartXRef",value:function(){this.xref.setStartXRef(this.startXRef)}},{key:"setup",value:function(e){this.xref.parse(e),this.catalog=new o.Catalog(this.pdfManager,this.xref)}},{key:"_getLinearizationPage",value:function(e){var t=this.catalog,r=this.linearization,n=s.Ref.get(r.objectNumberFirst,0);return this.xref.fetchAsync(n).then((function(e){if((0,s.isDict)(e,"Page")||(0,s.isDict)(e)&&!e.has("Type")&&e.has("Contents"))return n&&!t.pageKidsCountCache.has(n)&&t.pageKidsCountCache.put(n,1),[e,n];throw new i.FormatError("The Linearization dictionary doesn't point to a valid Page dictionary.")})).catch((function(r){return(0,i.info)(r),t.getPageDict(e)}))}},{key:"getPage",value:function(e){var t=this;if(void 0!==this._pagePromises[e])return this._pagePromises[e];var r=this.catalog,n=this.linearization,a=n&&n.pageFirst===e?this._getLinearizationPage(e):r.getPageDict(e);return this._pagePromises[e]=a.then((function(n){var a=y(n,2),i=a[0],o=a[1];return new P({pdfManager:t.pdfManager,xref:t.xref,pageIndex:e,pageDict:i,ref:o,fontCache:r.fontCache,builtInCMapCache:r.builtInCMapCache,globalImageCache:r.globalImageCache,pdfFunctionFactory:t.pdfFunctionFactory})}))}},{key:"checkFirstPage",value:function(){var e=this;return this.getPage(0).catch(function(){var t=v(a.default.mark((function t(r){return a.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r instanceof c.XRefEntryException)){t.next=5;break}return e._pagePromises.length=0,t.next=4,e.cleanup();case 4:throw new c.XRefParseException;case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}},{key:"fontFallback",value:function(e,t){return this.catalog.fontFallback(e,t)}},{key:"cleanup",value:(t=v(a.default.mark((function e(){var t,r=arguments;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]&&r[0],e.abrupt("return",this.catalog?this.catalog.cleanup(t):(0,s.clearPrimitiveCaches)());case 2:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"linearization",get:function(){var e=null;try{e=f.Linearization.create(this.stream)}catch(e){if(e instanceof c.MissingDataException)throw e;(0,i.info)(e)}return(0,i.shadow)(this,"linearization",e)}},{key:"startXRef",get:function(){var e=this.stream,t=0;if(this.linearization)e.reset(),I(e,R)&&(t=e.pos+6-e.start);else{for(var r=E.length,n=!1,a=e.end;!n&&a>0;)(a-=1024-r)<0&&(a=0),e.pos=a,n=I(e,E,1024,!0);if(n){var o;e.skip(9);do{o=e.getByte()}while((0,c.isWhiteSpace)(o));for(var s="";o>=32&&o<=57;)s+=String.fromCharCode(o),o=e.getByte();t=parseInt(s,10),isNaN(t)&&(t=0)}}return(0,i.shadow)(this,"startXRef",t)}},{key:"numPages",get:function(){var e=this.linearization,t=e?e.numPages:this.catalog.numPages;return(0,i.shadow)(this,"numPages",t)}},{key:"documentInfo",get:function(){var e={Title:i.isString,Author:i.isString,Subject:i.isString,Keywords:i.isString,Creator:i.isString,Producer:i.isString,CreationDate:i.isString,ModDate:i.isString,Trapped:s.isName},t=this.pdfFormatVersion;"string"==typeof t&&O.test(t)||((0,i.warn)("Invalid PDF header version number: ".concat(t)),t=null);var r,n={PDFFormatVersion:t,IsLinearized:!!this.linearization,IsAcroFormPresent:!!this.acroForm,IsXFAPresent:!!this.xfa,IsCollectionPresent:!!this.collection};try{r=this.xref.trailer.get("Info")}catch(e){if(e instanceof c.MissingDataException)throw e;(0,i.info)("The document information dictionary is invalid.")}if((0,s.isDict)(r)){var a,o=b(r.getKeys());try{for(o.s();!(a=o.n()).done;){var l=a.value,u=r.get(l);if(e[l])e[l](u)?n[l]="string"!=typeof u?u:(0,i.stringToPDFString)(u):(0,i.info)('Bad value in document info for "'.concat(l,'".'));else if("string"==typeof l){var h=void 0;if((0,i.isString)(u))h=(0,i.stringToPDFString)(u);else{if(!((0,s.isName)(u)||(0,i.isNum)(u)||(0,i.isBool)(u))){(0,i.info)('Unsupported value in document info for (custom) "'.concat(l,'".'));continue}h=u}n.Custom||(n.Custom=Object.create(null)),n.Custom[l]=h}}}catch(e){o.e(e)}finally{o.f()}}return(0,i.shadow)(this,"documentInfo",n)}},{key:"fingerprint",get:function(){for(var e,t=this.xref.trailer.get("ID"),r=[],n=0,a=(e=Array.isArray(t)&&t[0]&&(0,i.isString)(t[0])&&"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"!==t[0]?(0,i.stringToBytes)(t[0]):(0,h.calculateMD5)(this.stream.getByteRange(0,1024),0,1024)).length;n=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw i}}}}function S(e,t){if(e){if("string"==typeof e)return k(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?k(e,t):void 0}}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0;){var l=n.shift(),h=s.fetchIfRef(l.obj);if(null!==h){if(!h.has("Title"))throw new i.FormatError("Invalid outline item encountered.");var f={url:null,dest:null};e.parseDestDictionary({destDict:h,resultObj:f,docBaseUrl:this.pdfManager.docBaseUrl});var d=h.get("Title"),p=h.get("F")||0,g=h.getArray("C"),m=h.get("Count"),v=c;!Array.isArray(g)||3!==g.length||0===g[0]&&0===g[1]&&0===g[2]||(v=u.ColorSpace.singletons.rgb.getRgb(g,0));var y={dest:f.dest,url:f.url,unsafeUrl:f.unsafeUrl,newWindow:f.newWindow,title:(0,i.stringToPDFString)(d),color:v,count:Number.isInteger(m)?m:void 0,bold:!!(2&p),italic:!!(1&p),items:[]};l.parent.items.push(y),t=h.getRaw("First"),(0,o.isRef)(t)&&!a.has(t)&&(n.push({obj:t,parent:y}),a.put(t)),t=h.getRaw("Next"),(0,o.isRef)(t)&&!a.has(t)&&(n.push({obj:t,parent:l.parent}),a.put(t))}}return r.items.length>0?r.items:null}},{key:"_readPermissions",value:function(){var e=this.xref.trailer.get("Encrypt");if(!(0,o.isDict)(e))return null;var t=e.get("P");if(!(0,i.isNum)(t))return null;t+=Math.pow(2,32);var r=[];for(var n in i.PermissionFlag){var a=i.PermissionFlag[n];t&a&&r.push(a)}return r}},{key:"getDestination",value:function(e){var t=this._readDests();return t instanceof R||t instanceof o.Dict?C(t.get(e)||null):null}},{key:"_readDests",value:function(){var e=this.catDict.get("Names");return e&&e.has("Dests")?new R(e.getRaw("Dests"),this.xref):this.catDict.has("Dests")?this.catDict.get("Dests"):void 0}},{key:"_readPageLabels",value:function(){var e=this.catDict.getRaw("PageLabels");if(!e)return null;for(var t=new Array(this.numPages),r=null,n="",a=new O(e,this.xref).getAll(),s="",l=1,u=0,h=this.numPages;u=1))throw new i.FormatError("Invalid start in PageLabel dictionary.");l=g}else l=1}switch(r){case"D":s=l;break;case"R":case"r":s=(0,c.toRomanNumerals)(l,"r"===r);break;case"A":case"a":for(var m="a"===r?97:65,v=l-1,y=String.fromCharCode(m+v%26),b=[],w=0,S=v/26|0;w<=S;w++)b.push(y);s=b.join("");break;default:if(r)throw new i.FormatError('Invalid style "'.concat(r,'" in PageLabel dictionary.'));s=""}t[u]=n+s,l++}return t}},{key:"fontFallback",value:function(e,t){var r=[];return this.fontCache.forEach((function(e){r.push(e)})),Promise.all(r).then((function(r){var n,a=w(r);try{for(a.s();!(n=a.n()).done;){var i=n.value;if(i.loadedName===e)return void i.fallback(t)}}catch(e){a.e(e)}finally{a.f()}}))}},{key:"cleanup",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(0,o.clearPrimitiveCaches)(),this.globalImageCache.clear(t),this.pageKidsCountCache.clear();var r=[];return this.fontCache.forEach((function(e){r.push(e)})),Promise.all(r).then((function(t){var r,n=w(t);try{for(n.s();!(r=n.n()).done;)delete r.value.dict.translated}catch(e){n.e(e)}finally{n.f()}e.fontCache.clear(),e.builtInCMapCache.clear()}))}},{key:"getPageDict",value:function(e){var t,r=(0,i.createPromiseCapability)(),n=[this.catDict.getRaw("Pages")],a=new o.RefSet,s=this.xref,c=this.pageKidsCountCache,l=0;return function u(){for(var h=function(){var h=n.pop();if((0,o.isRef)(h))return(t=c.get(h))>0&&l+t=0){var f=h.objId;if(f&&!c.has(f)&&c.put(f,t),l+t<=e)return l+=t,"continue"}var d=h.get("Kids");if(!Array.isArray(d))return(0,o.isName)(h.get("Type"),"Page")||!h.has("Type")&&h.has("Contents")?l===e?(r.resolve([h,null]),{v:void 0}):(l++,"continue"):(r.reject(new i.FormatError("Page dictionary kids object is not an array.")),{v:void 0});for(var p=d.length-1;p>=0;p--)n.push(d[p])};n.length;){var f=h();if("continue"!==f&&"object"===b(f))return f.v}r.reject(new Error("Page index ".concat(e," not found.")))}(),r.promise}},{key:"getPageIndex",value:function(e){var t=this.xref,r=0;return function n(a){return function(r){var n,a=0;return t.fetchAsync(r).then((function(t){if((0,o.isRefsEqual)(r,e)&&!(0,o.isDict)(t,"Page")&&(!(0,o.isDict)(t)||t.has("Type")||!t.has("Contents")))throw new i.FormatError("The reference does not point to a /Page dictionary.");if(!t)return null;if(!(0,o.isDict)(t))throw new i.FormatError("Node must be a dictionary.");return n=t.getRaw("Parent"),t.getAsync("Parent")})).then((function(e){if(!e)return null;if(!(0,o.isDict)(e))throw new i.FormatError("Parent must be a dictionary.");return e.getAsync("Kids")})).then((function(e){if(!e)return null;for(var s=[],c=!1,l=0,u=e.length;l0&&(0===r||t>=n[r-1])&&t<=e.numPages}))&&(c=s);break;case"NumCopies":s>0&&(c=s);break;default:if("boolean"!=typeof s)throw new i.FormatError("viewerPreferences - expected a boolean value for: ".concat(a));c=s}void 0!==c?(n||(n=Object.create(null)),n[a]=c):(0,i.info)('Bad value in ViewerPreferences for "'.concat(a,'".'))}else(0,i.info)('Bad value in ViewerPreferences for "'.concat(a,'".'))}return(0,i.shadow)(this,"viewerPreferences",n)}},{key:"openAction",get:function(){var t=this.catDict.get("OpenAction"),r=null;if((0,o.isDict)(t)){var n=new o.Dict(this.xref);n.set("A",t);var a={url:null,dest:null,action:null};e.parseDestDictionary({destDict:n,resultObj:a}),Array.isArray(a.dest)?(r||(r=Object.create(null)),r.dest=a.dest):a.action&&(r||(r=Object.create(null)),r.action=a.action)}else Array.isArray(t)&&(r||(r=Object.create(null)),r.dest=t);return(0,i.shadow)(this,"openAction",r)}},{key:"attachments",get:function(){var e=this.catDict.get("Names"),t=null;if(e&&e.has("EmbeddedFiles")){var r=new R(e.getRaw("EmbeddedFiles"),this.xref).getAll();for(var n in r){var a=new I(r[n],this.xref);t||(t=Object.create(null)),t[(0,i.stringToPDFString)(n)]=a.serializable}}return(0,i.shadow)(this,"attachments",t)}},{key:"javaScript",get:function(){var e=this.catDict.get("Names"),t=null;function r(e){var r=e.get("S");if((0,o.isName)(r,"JavaScript")){var n=e.get("JS");if((0,o.isStream)(n))n=(0,i.bytesToString)(n.getBytes());else if(!(0,i.isString)(n))return;t||(t=[]),t.push((0,i.stringToPDFString)(n))}}if(e&&e.has("JavaScript")){var n=new R(e.getRaw("JavaScript"),this.xref).getAll();for(var a in n){var s=n[a];(0,o.isDict)(s)&&r(s)}}var c=this.catDict.get("OpenAction");return(0,o.isDict)(c)&&(0,o.isName)(c.get("S"),"JavaScript")&&r(c),(0,i.shadow)(this,"javaScript",t)}}],[{key:"parseDestDictionary",value:function(e){var t=e.destDict;if((0,o.isDict)(t)){var r=e.resultObj;if("object"===b(r)){var n,a,s=e.docBaseUrl||null,c=t.get("A");if(!(0,o.isDict)(c)&&t.has("Dest")&&(c=t.get("Dest")),(0,o.isDict)(c)){var l=c.get("S");if(!(0,o.isName)(l))return void(0,i.warn)("parseDestDictionary: Invalid type in Action dictionary.");var u=l.name;switch(u){case"URI":n=c.get("URI"),(0,o.isName)(n)?n="/"+n.name:(0,i.isString)(n)&&(n=function(e){return e.startsWith("www.")?"http://".concat(e):e}(n));break;case"GoTo":a=c.get("D");break;case"Launch":case"GoToR":var h=c.get("F");(0,o.isDict)(h)?n=h.get("F")||null:(0,i.isString)(h)&&(n=h);var f=c.get("D");if(f&&((0,o.isName)(f)&&(f=f.name),(0,i.isString)(n))){var d=n.split("#")[0];(0,i.isString)(f)?n=d+"#"+f:Array.isArray(f)&&(n=d+"#"+JSON.stringify(f))}var p=c.get("NewWindow");(0,i.isBool)(p)&&(r.newWindow=p);break;case"Named":var g=c.get("N");(0,o.isName)(g)&&(r.action=g.name);break;case"JavaScript":var m,v=c.get("JS");if((0,o.isStream)(v)?m=(0,i.bytesToString)(v.getBytes()):(0,i.isString)(v)&&(m=v),m){var y=new RegExp("^\\s*("+["app.launchURL","window.open"].join("|").split(".").join("\\.")+")\\((?:'|\")([^'\"]*)(?:'|\")(?:,\\s*(\\w+)\\)|\\))","i").exec((0,i.stringToPDFString)(m));if(y&&y[2]){n=y[2],"true"===y[3]&&"app.launchURL"===y[1]&&(r.newWindow=!0);break}}default:(0,i.warn)('parseDestDictionary: unsupported action type "'.concat(u,'".'))}}else t.has("Dest")&&(a=t.get("Dest"));if((0,i.isString)(n)){n=function(e){try{return(0,i.stringToUTF8String)(e)}catch(t){return e}}(n);var w=(0,i.createValidAbsoluteUrl)(n,s);w&&(r.url=w.href),r.unsafeUrl=n}a&&((0,o.isName)(a)&&(a=a.name),((0,i.isString)(a)||Array.isArray(a))&&(r.dest=a))}else(0,i.warn)("parseDestDictionary: `resultObj` must be an object.")}else(0,i.warn)("parseDestDictionary: `destDict` must be a dictionary.")}}]),e}();t.Catalog=P;var T=function(){function e(e,t){this.stream=e,this.pdfManager=t,this.entries=[],this.xrefstms=Object.create(null),this._cacheMap=new Map,this.stats={streamTypes:Object.create(null),fontTypes:Object.create(null)}}return e.prototype={setStartXRef:function(e){this.startXRefQueue=[e]},parse:function(e){var t,r,n;e?((0,i.warn)("Indexing all PDF objects"),t=this.indexObjects()):t=this.readXRef(),t.assignXref(this),this.trailer=t;try{r=t.get("Encrypt")}catch(e){if(e instanceof c.MissingDataException)throw e;(0,i.warn)('XRef.parse - Invalid "Encrypt" reference: "'.concat(e,'".'))}if((0,o.isDict)(r)){var a=t.get("ID"),s=a&&a.length?a[0]:"";r.suppressEncryption=!0,this.encrypt=new l.CipherTransformFactory(r,s,this.pdfManager.password)}try{n=t.get("Root")}catch(e){if(e instanceof c.MissingDataException)throw e;(0,i.warn)('XRef.parse - Invalid "Root" reference: "'.concat(e,'".'))}if(!(0,o.isDict)(n)||!n.has("Pages")){if(!e)throw new c.XRefParseException;throw new i.FormatError("Invalid root reference")}this.root=n},processXRefTable:function(e){"tableState"in this||(this.tableState={entryNum:0,streamPos:e.lexer.stream.pos,parserBuf1:e.buf1,parserBuf2:e.buf2});var t=this.readXRefTable(e);if(!(0,o.isCmd)(t,"trailer"))throw new i.FormatError("Invalid XRef table: could not find trailer dictionary");var r=e.getObj();if(!(0,o.isDict)(r)&&r.dict&&(r=r.dict),!(0,o.isDict)(r))throw new i.FormatError("Invalid XRef table: could not parse trailer dictionary");return delete this.tableState,r},readXRefTable:function(e){var t,r=e.lexer.stream,n=this.tableState;for(r.pos=n.streamPos,e.buf1=n.parserBuf1,e.buf2=n.parserBuf2;;){if(!("firstEntryNum"in n)||!("entryCount"in n)){if((0,o.isCmd)(t=e.getObj(),"trailer"))break;n.firstEntryNum=t,n.entryCount=e.getObj()}var a=n.firstEntryNum,s=n.entryCount;if(!Number.isInteger(a)||!Number.isInteger(s))throw new i.FormatError("Invalid XRef table: wrong types in subsection header");for(var c=n.entryNum;c0;){var u=l[0],h=l[1];if(!Number.isInteger(u)||!Number.isInteger(h))throw new i.FormatError("Invalid XRef range fields: ".concat(u,", ").concat(h));if(!Number.isInteger(o)||!Number.isInteger(s)||!Number.isInteger(c))throw new i.FormatError("Invalid XRef entry fields length: ".concat(u,", ").concat(h));for(t=n.entryNum;t=e.length);)r+=String.fromCharCode(n),n=e[t];return r}function t(e,t,r){for(var n=r.length,a=e.length,i=0;t=n)break;t++,i++}return i}var r=/^(\d+)\s+(\d+)\s+obj\b/,n=/\bendobj[\b\s]$/,a=/\s+(\d+\s+\d+\s+obj[\b\s<])$/,l=new Uint8Array([116,114,97,105,108,101,114]),u=new Uint8Array([115,116,97,114,116,120,114,101,102]),h=new Uint8Array([111,98,106]),f=new Uint8Array([47,88,82,101,102]);this.entries.length=0;var d=this.stream;d.pos=0;for(var p,g,m,v=d.getBytes(),y=d.start,b=v.length,w=[],S=[];y=b)break;k=v[y]}while(10!==k&&13!==k);else++y}for(p=0,g=S.length;p2&&void 0!==arguments[2]&&arguments[2],n=e.gen,a=e.num;if(t.gen!==n)throw new c.XRefEntryException("Inconsistent generation in XRef: ".concat(e));var i=this.stream.makeSubStream(t.offset+this.stream.start),l=new s.Parser({lexer:new s.Lexer(i),xref:this,allowStreams:!0}),u=l.getObj(),h=l.getObj(),f=l.getObj();if(u!==a||h!==n||!(f instanceof o.Cmd))throw new c.XRefEntryException("Bad (uncompressed) XRef entry: ".concat(e));if("obj"!==f.cmd){if(f.cmd.startsWith("obj")&&(a=parseInt(f.cmd.substring(3),10),!Number.isNaN(a)))return a;throw new c.XRefEntryException("Bad (uncompressed) XRef entry: ".concat(e))}return t=this.encrypt&&!r?l.getObj(this.encrypt.createCipherTransform(a,n)):l.getObj(),(0,o.isStream)(t)||this._cacheMap.set(a,t),t},fetchCompressed:function(e,t){var r=t.offset,n=this.fetch(o.Ref.get(r,0));if(!(0,o.isStream)(n))throw new i.FormatError("bad ObjStm stream");var a=n.dict.get("First"),l=n.dict.get("N");if(!Number.isInteger(a)||!Number.isInteger(l))throw new i.FormatError("invalid first and n parameters for ObjStm stream");for(var u=new s.Parser({lexer:new s.Lexer(n),xref:this,allowStreams:!0}),h=new Array(l),f=0;f0;){var a=t.fetchIfRef(n.shift());if((0,o.isDict)(a))if(a.has("Kids"))for(var s=a.get("Kids"),c=0,l=s.length;c10)return(0,i.warn)('Search depth limit reached for "'.concat(this._type,'" tree.')),null;var a=r.get("Kids");if(!Array.isArray(a))return null;for(var o=0,s=a.length-1;o<=s;){var c=o+s>>1,l=t.fetchIfRef(a[c]).get("Limits");if(et.fetchIfRef(l[1]))){r=t.fetchIfRef(a[c]);break}o=c+1}}if(o>s)return null}var u=r.get(this._type);if(Array.isArray(u)){for(var h=0,f=u.length-2;h<=f;){var d=h+f>>1,p=d+(1&d),g=t.fetchIfRef(u[p]);if(eg))return t.fetchIfRef(u[p+1]);h=p+2}}(0,i.info)('Falling back to an exhaustive search, for key "'.concat(e,'", ')+'in "'.concat(this._type,'" tree.'));for(var m=0,v=u.length;m0&&void 0!==arguments[0]?arguments[0]:null,t=this.buf1;if(this.shift(),t instanceof i.Cmd)switch(t.cmd){case"BI":return this.makeInlineImage(e);case"[":for(var r=[];!(0,i.isCmd)(this.buf1,"]")&&!(0,i.isEOF)(this.buf1);)r.push(this.getObj(e));if((0,i.isEOF)(this.buf1)){if(!this.recoveryMode)throw new a.FormatError("End of file inside array");return r}return this.shift(),r;case"<<":for(var n=new i.Dict(this.xref);!(0,i.isCmd)(this.buf1,">>")&&!(0,i.isEOF)(this.buf1);)if((0,i.isName)(this.buf1)){var o=this.buf1.name;if(this.shift(),(0,i.isEOF)(this.buf1))break;n.set(o,this.getObj(e))}else(0,a.info)("Malformed dictionary: key must be a name object"),this.shift();if((0,i.isEOF)(this.buf1)){if(!this.recoveryMode)throw new a.FormatError("End of file inside dictionary");return n}return(0,i.isCmd)(this.buf2,"stream")?this.allowStreams?this.makeStream(n,e):n:(this.shift(),n);default:return t}if(Number.isInteger(t)){if(Number.isInteger(this.buf1)&&(0,i.isCmd)(this.buf2,"R")){var s=i.Ref.get(t,this.buf1);return this.shift(),this.shift(),s}return t}return"string"==typeof t&&e?e.decryptString(t):t}},{key:"findDefaultInlineStreamEnd",value:function(e){for(var t,r,n=e.pos,i=0;-1!==(t=e.getByte());)if(0===i)i=69===t?1:0;else if(1===i)i=73===t?2:0;else if((0,a.assert)(2===i,"findDefaultInlineStreamEnd - invalid state."),32===t||10===t||13===t){r=e.pos;for(var s=e.peekBytes(10),c=0,l=s.length;c127)){i=0;break}if(2===i)break}else i=0;-1===t&&((0,a.warn)("findDefaultInlineStreamEnd: Reached the end of the stream without finding a valid EI marker"),r&&((0,a.warn)('... trying to recover by using the last "EI" occurrence.'),e.skip(-(e.pos-r))));var u=4;return e.skip(-u),t=e.peekByte(),e.skip(u),(0,o.isWhiteSpace)(t)||u--,e.pos-u-n}},{key:"findDCTDecodeInlineStreamEnd",value:function(e){for(var t,r,n=e.pos,i=!1;-1!==(t=e.getByte());)if(255===t){switch(e.getByte()){case 0:break;case 255:e.skip(-1);break;case 217:i=!0;break;case 192:case 193:case 194:case 195:case 197:case 198:case 199:case 201:case 202:case 203:case 205:case 206:case 207:case 196:case 204:case 218:case 219:case 220:case 221:case 222:case 223:case 224:case 225:case 226:case 227:case 228:case 229:case 230:case 231:case 232:case 233:case 234:case 235:case 236:case 237:case 238:case 239:case 254:(r=e.getUint16())>2?e.skip(r-2):e.skip(-2)}if(i)break}var o=e.pos-n;return-1===t?((0,a.warn)("Inline DCTDecode image stream: EOI marker not found, searching for /EI/ instead."),e.skip(-o),this.findDefaultInlineStreamEnd(e)):(this.inlineStreamSkipEI(e),o)}},{key:"findASCII85DecodeInlineStreamEnd",value:function(e){for(var t,r=e.pos;-1!==(t=e.getByte());)if(126===t){var n=e.pos;for(t=e.peekByte();(0,o.isWhiteSpace)(t);)e.skip(),t=e.peekByte();if(62===t){e.skip();break}if(e.pos>n){var i=e.peekBytes(2);if(69===i[0]&&73===i[1])break}}var s=e.pos-r;return-1===t?((0,a.warn)("Inline ASCII85Decode image stream: EOD marker not found, searching for /EI/ instead."),e.skip(-s),this.findDefaultInlineStreamEnd(e)):(this.inlineStreamSkipEI(e),s)}},{key:"findASCIIHexDecodeInlineStreamEnd",value:function(e){for(var t,r=e.pos;-1!==(t=e.getByte())&&62!==t;);var n=e.pos-r;return-1===t?((0,a.warn)("Inline ASCIIHexDecode image stream: EOD marker not found, searching for /EI/ instead."),e.skip(-n),this.findDefaultInlineStreamEnd(e)):(this.inlineStreamSkipEI(e),n)}},{key:"inlineStreamSkipEI",value:function(e){for(var t,r=0;-1!==(t=e.getByte());)if(0===r)r=69===t?1:0;else if(1===r)r=73===t?2:0;else if(2===r)break}},{key:"makeInlineImage",value:function(e){for(var t,r=this.lexer,n=r.stream,o=new i.Dict(this.xref);!(0,i.isCmd)(this.buf1,"ID")&&!(0,i.isEOF)(this.buf1);){if(!(0,i.isName)(this.buf1))throw new a.FormatError("Dictionary key must be a name object");var s=this.buf1.name;if(this.shift(),(0,i.isEOF)(this.buf1))break;o.set(s,this.getObj(e))}-1!==r.beginInlineImagePos&&(t=n.pos-r.beginInlineImagePos);var c,l=o.get("Filter","F");if((0,i.isName)(l))c=l.name;else if(Array.isArray(l)){var u=this.xref.fetchIfRef(l[0]);(0,i.isName)(u)&&(c=u.name)}var h,f=n.pos;h="DCTDecode"===c||"DCT"===c?this.findDCTDecodeInlineStreamEnd(n):"ASCII85Decode"===c||"A85"===c?this.findASCII85DecodeInlineStreamEnd(n):"ASCIIHexDecode"===c||"AHx"===c?this.findASCIIHexDecodeInlineStreamEnd(n):this.findDefaultInlineStreamEnd(n);var d,g=n.makeSubStream(f,h,o);if(h<1e3&&t<5552){var m=g.getBytes();g.reset();var v=n.pos;n.pos=r.beginInlineImagePos;var y=n.getBytes(t);n.pos=v,d=p(m)+"_"+p(y);var b=this.imageCache[d];if(void 0!==b)return this.buf2=i.Cmd.get("EI"),this.shift(),b.reset(),b}return e&&(g=e.createStream(g,h)),(g=this.filter(g,o,h)).dict=o,void 0!==d&&(g.cacheKey="inline_".concat(h,"_").concat(d),this.imageCache[d]=g),this.buf2=i.Cmd.get("EI"),this.shift(),g}},{key:"_findStreamLength",value:function(e,t){var r=this.lexer.stream;r.pos=e;for(var n=t.length;r.pos=n)return r.pos+=o,r.pos-e;o++}r.pos+=i}return-1}},{key:"makeStream",value:function(e,t){var r=this.lexer,n=r.stream;r.skipToNextLine();var s=n.pos-1,c=e.get("Length");if(Number.isInteger(c)||((0,a.info)('Bad length "'.concat(c,'" in stream')),c=0),n.pos=s+c,r.nextChar(),this.tryShift()&&(0,i.isCmd)(this.buf2,"endstream"))this.shift();else{var l=new Uint8Array([101,110,100,115,116,114,101,97,109]),u=this._findStreamLength(s,l);if(u<0){for(var h=1;h<=1;h++){var f=l.length-h,d=l.slice(0,f),p=this._findStreamLength(s,d);if(p>=0){var g=n.peekBytes(f+1)[f];if(!(0,o.isWhiteSpace)(g))break;(0,a.info)('Found "'.concat((0,a.bytesToString)(d),'" when ')+"searching for endstream command."),u=p;break}}if(u<0)throw new a.FormatError("Missing endstream command.")}c=u,r.nextChar(),this.shift(),this.shift()}return this.shift(),n=n.makeSubStream(s,c,e),t&&(n=t.createStream(n,c)),(n=this.filter(n,e,c)).dict=e,n}},{key:"filter",value:function(e,t,r){var n=t.get("Filter","F"),o=t.get("DecodeParms","DP");if((0,i.isName)(n))return Array.isArray(o)&&(0,a.warn)("/DecodeParms should not contain an Array, when /Filter contains a Name."),this.makeFilter(e,n.name,r,o);var s=r;if(Array.isArray(n))for(var c=n,l=o,u=0,h=c.length;u=48&&e<=57?15&e:e>=65&&e<=70||e>=97&&e<=102?9+(15&e):-1}var y=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;h(this,e),this.stream=t,this.nextChar(),this.strBuf=[],this.knownCommands=r,this._hexStringNumWarn=0,this.beginInlineImagePos=-1}return d(e,[{key:"nextChar",value:function(){return this.currentChar=this.stream.getByte()}},{key:"peekChar",value:function(){return this.stream.peekByte()}},{key:"getNumber",value:function(){var e=this.currentChar,t=!1,r=0,n=0;if(45===e?(n=-1,45===(e=this.nextChar())&&(e=this.nextChar())):43===e&&(n=1,e=this.nextChar()),10===e||13===e)do{e=this.nextChar()}while(10===e||13===e);if(46===e&&(r=10,e=this.nextChar()),e<48||e>57){if(10===r&&0===n&&((0,o.isWhiteSpace)(e)||-1===e))return(0,a.warn)("Lexer.getNumber - treating a single decimal point as zero."),0;throw new a.FormatError("Invalid number: ".concat(String.fromCharCode(e)," (charCode ").concat(e,")"))}n=n||1;for(var i=e-48,s=0,c=1;(e=this.nextChar())>=0;)if(e>=48&&e<=57){var l=e-48;t?s=10*s+l:(0!==r&&(r*=10),i=10*i+l)}else if(46===e){if(0!==r)break;r=1}else if(45===e)(0,a.warn)("Badly formatted number: minus sign in the middle");else{if(69!==e&&101!==e)break;if(43===(e=this.peekChar())||45===e)c=45===e?-1:1,this.nextChar();else if(e<48||e>57)break;t=!0}return 0!==r&&(i/=r),t&&(i*=Math.pow(10,c*s)),n*i}},{key:"getString",value:function(){var e=1,t=!1,r=this.strBuf;r.length=0;for(var n=this.nextChar();;){var i=!1;switch(0|n){case-1:(0,a.warn)("Unterminated string"),t=!0;break;case 40:++e,r.push("(");break;case 41:0==--e?(this.nextChar(),t=!0):r.push(")");break;case 92:switch(n=this.nextChar()){case-1:(0,a.warn)("Unterminated string"),t=!0;break;case 110:r.push("\n");break;case 114:r.push("\r");break;case 116:r.push("\t");break;case 98:r.push("\b");break;case 102:r.push("\f");break;case 92:case 40:case 41:r.push(String.fromCharCode(n));break;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:var o=15&n;i=!0,(n=this.nextChar())>=48&&n<=55&&(o=(o<<3)+(15&n),(n=this.nextChar())>=48&&n<=55&&(i=!1,o=(o<<3)+(15&n))),r.push(String.fromCharCode(o));break;case 13:10===this.peekChar()&&this.nextChar();break;case 10:break;default:r.push(String.fromCharCode(n))}break;default:r.push(String.fromCharCode(n))}if(t)break;i||(n=this.nextChar())}return r.join("")}},{key:"getName",value:function(){var e,t,r=this.strBuf;for(r.length=0;(e=this.nextChar())>=0&&!m[e];)if(35===e){if(e=this.nextChar(),m[e]){(0,a.warn)("Lexer_getName: NUMBER SIGN (#) should be followed by a hexadecimal number."),r.push("#");break}var n=v(e);if(-1!==n){t=e;var o=v(e=this.nextChar());if(-1===o){if((0,a.warn)("Lexer_getName: Illegal digit (".concat(String.fromCharCode(e),") ")+"in hexadecimal number."),r.push("#",String.fromCharCode(t)),m[e])break;r.push(String.fromCharCode(e));continue}r.push(String.fromCharCode(n<<4|o))}else r.push("#",String.fromCharCode(e))}else r.push(String.fromCharCode(e));return r.length>127&&(0,a.warn)("Name token is longer than allowed by the spec: ".concat(r.length)),i.Name.get(r.join(""))}},{key:"_hexStringWarn",value:function(e){5!=this._hexStringNumWarn++?this._hexStringNumWarn>5||(0,a.warn)("getHexString - ignoring invalid character: ".concat(e)):(0,a.warn)("getHexString - ignoring additional invalid characters.")}},{key:"getHexString",value:function(){var e=this.strBuf;e.length=0;var t,r,n=this.currentChar,i=!0;for(this._hexStringNumWarn=0;;){if(n<0){(0,a.warn)("Unterminated hex string");break}if(62===n){this.nextChar();break}if(1!==m[n]){if(i){if(-1===(t=v(n))){this._hexStringWarn(n),n=this.nextChar();continue}}else{if(-1===(r=v(n))){this._hexStringWarn(n),n=this.nextChar();continue}e.push(String.fromCharCode(t<<4|r))}i=!i,n=this.nextChar()}else n=this.nextChar()}return e.join("")}},{key:"getObj",value:function(){for(var e=!1,t=this.currentChar;;){if(t<0)return i.EOF;if(e)10!==t&&13!==t||(e=!1);else if(37===t)e=!0;else if(1!==m[t])break;t=this.nextChar()}switch(0|t){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return this.getNumber();case 40:return this.getString();case 47:return this.getName();case 91:return this.nextChar(),i.Cmd.get("[");case 93:return this.nextChar(),i.Cmd.get("]");case 60:return 60===(t=this.nextChar())?(this.nextChar(),i.Cmd.get("<<")):this.getHexString();case 62:return 62===(t=this.nextChar())?(this.nextChar(),i.Cmd.get(">>")):i.Cmd.get(">");case 123:return this.nextChar(),i.Cmd.get("{");case 125:return this.nextChar(),i.Cmd.get("}");case 41:throw this.nextChar(),new a.FormatError("Illegal character: ".concat(t))}for(var r=String.fromCharCode(t),n=this.knownCommands,o=n&&void 0!==n[r];(t=this.nextChar())>=0&&!m[t];){var s=r+String.fromCharCode(t);if(o&&void 0===n[s])break;if(128===r.length)throw new a.FormatError("Command token too long: ".concat(r.length));r=s,o=n&&void 0!==n[r]}return"true"===r||"false"!==r&&("null"===r?null:("BI"===r&&(this.beginInlineImagePos=this.stream.pos),i.Cmd.get(r)))}},{key:"skipToNextLine",value:function(){for(var e=this.currentChar;e>=0;){if(13===e){10===(e=this.nextChar())&&this.nextChar();break}if(10===e){this.nextChar();break}e=this.nextChar()}}}]),e}();t.Lexer=y;var b=function(){function e(){h(this,e)}return d(e,null,[{key:"create",value:function(e){function t(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e.get(t);if(Number.isInteger(n)&&(r?n>=0:n>0))return n;throw new Error('The "'.concat(t,'" parameter in the linearization ')+"dictionary is invalid.")}var r,n,o=new g({lexer:new y(e),xref:null}),s=o.getObj(),c=o.getObj(),l=o.getObj(),u=o.getObj();if(!(Number.isInteger(s)&&Number.isInteger(c)&&(0,i.isCmd)(l,"obj")&&(0,i.isDict)(u)&&(0,a.isNum)(r=u.get("Linearized"))&&r>0))return null;if((n=t(u,"L"))!==e.length)throw new Error('The "L" parameter in the linearization dictionary does not equal the stream length.');return{length:n,hints:function(e){var t,r=e.get("H");if(Array.isArray(r)&&(2===(t=r.length)||4===t)){for(var n=0;n0))throw new Error("Hint (".concat(n,") in the linearization dictionary is invalid."))}return r}throw new Error("Hint array in the linearization dictionary is invalid.")}(u),objectNumberFirst:t(u,"O"),endFirst:t(u,"E"),numPages:t(u,"N"),mainXRefEntriesOffset:t(u,"T"),pageFirst:u.has("P")?t(u,"P",!0):0}}}]),e}();t.Linearization=b},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.LZWStream=t.StringStream=t.StreamsSequenceStream=t.Stream=t.RunLengthStream=t.PredictorStream=t.NullStream=t.FlateStream=t.DecodeStream=t.DecryptStream=t.AsciiHexStream=t.Ascii85Stream=void 0;var n=r(5),a=r(198),i=r(201);function o(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=this.end?-1:this.bytes[this.pos++]},getUint16:function(){var e=this.getByte(),t=this.getByte();return-1===e||-1===t?-1:(e<<8)+t},getInt32:function(){return(this.getByte()<<24)+(this.getByte()<<16)+(this.getByte()<<8)+this.getByte()},getBytes:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.bytes,n=this.pos,a=this.end;if(!e){var i=r.subarray(n,a);return t?new Uint8ClampedArray(i):i}var o=n+e;o>a&&(o=a),this.pos=o;var s=r.subarray(n,o);return t?new Uint8ClampedArray(s):s},peekByte:function(){var e=this.getByte();return-1!==e&&this.pos--,e},peekBytes:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.getBytes(e,t);return this.pos-=r.length,r},getByteRange:function(e,t){return e<0&&(e=0),t>this.end&&(t=this.end),this.bytes.subarray(e,t)},skip:function(e){e||(e=1),this.pos+=e},reset:function(){this.pos=this.start},moveStart:function(){this.start=this.pos},makeSubStream:function(t,r,n){return new e(this.bytes.buffer,t,r,n)}},e}();t.Stream=c;var l=function(){function e(e){var t=(0,n.stringToBytes)(e);c.call(this,t)}return e.prototype=c.prototype,e}();t.StringStream=l;var u=function(){var e=new Uint8Array(0);function t(t){if(this._rawMinBufferLength=t||0,this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=e,this.minBufferLength=512,t)for(;this.minBufferLength1&&void 0!==arguments[1]&&arguments[1],n=this.pos;if(e){for(this.ensureBuffer(n+e),t=n+e;!this.eof&&this.bufferLengtha&&(t=a)}else{for(;!this.eof;)this.readBlock();t=this.bufferLength}this.pos=t;var i=this.buffer.subarray(n,t);return!r||i instanceof Uint8ClampedArray?i:new Uint8ClampedArray(i)},peekByte:function(){var e=this.getByte();return-1!==e&&this.pos--,e},peekBytes:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.getBytes(e,t);return this.pos-=r.length,r},makeSubStream:function(e,t,r){for(var n=e+t;this.bufferLength<=n&&!this.eof;)this.readBlock();return new c(this.buffer,e,t,r)},getByteRange:function(e,t){(0,n.unreachable)("Should not call DecodeStream.getByteRange")},skip:function(e){e||(e=1),this.pos+=e},reset:function(){this.pos=0},getBaseStreams:function(){return this.str&&this.str.getBaseStreams?this.str.getBaseStreams():[]}},t}();t.DecodeStream=u;var h=function(){function e(e){this.streams=e;for(var t=0,r=0,n=e.length;r>e,this.codeSize=a-=e,t},o.prototype.getCode=function(e){for(var t,r=this.str,a=e[0],i=e[1],o=this.codeSize,s=this.codeBuf;o>16,u=65535&c;if(l<1||o>l,this.codeSize=o-l,u},o.prototype.generateHuffmanTable=function(e){var t,r=e.length,n=0;for(t=0;tn&&(n=e[t]);for(var a=1<>=1;for(t=u;t>=1)){var u,h;if(1===l)u=a,h=i;else{if(2!==l)throw new n.FormatError("Unknown block type in flate stream");var f,d=this.getBits(5)+257,p=this.getBits(5)+1,g=this.getBits(4)+4,m=new Uint8Array(e.length);for(f=0;f0;)k[f++]=w}u=this.generateHuffmanTable(k.subarray(0,d)),h=this.generateHuffmanTable(k.subarray(d,S))}for(var x=(o=this.buffer)?o.length:0,C=this.bufferLength;;){var P=this.getCode(u);if(P<256)C+1>=x&&(x=(o=this.ensureBuffer(C+1)).length),o[C++]=P;else{if(256===P)return void(this.bufferLength=C);var T=(P=t[P-=257])>>16;T>0&&(T=this.getBits(T)),s=(65535&P)+T,P=this.getCode(h),(T=(P=r[P])>>16)>0&&(T=this.getBits(T));var E=(65535&P)+T;C+s>=x&&(x=(o=this.ensureBuffer(C+s)).length);for(var R=0;R15))throw new n.FormatError("Unsupported predictor: ".concat(i));this.readBlock=2===i?this.readBlockTiff:this.readBlockPng,this.str=e,this.dict=e.dict;var o=this.colors=r.get("Colors")||1,s=this.bits=r.get("BitsPerComponent")||8,c=this.columns=r.get("Columns")||1;return this.pixBytes=o*s+7>>3,this.rowBytes=c*o*s+7>>3,u.call(this,t),this}return e.prototype=Object.create(u.prototype),e.prototype.readBlockTiff=function(){var e=this.rowBytes,t=this.bufferLength,r=this.ensureBuffer(t+e),n=this.bits,a=this.colors,i=this.str.getBytes(e);if(this.eof=!i.length,!this.eof){var o,s=0,c=0,l=0,u=0,h=t;if(1===n&&1===a)for(o=0;o>1,f^=f>>2,s=(1&(f^=f>>4))<<7,r[h++]=f}else if(8===n){for(o=0;o>8&255,r[h++]=255&p}}else{var g=new Uint8Array(a+1),m=(1<>l-n)&m,l-=n,c=c<=8&&(r[y++]=c>>u-8&255,u-=8);u>0&&(r[y++]=(c<<8-u)+(s&(1<<8-u)-1))}this.bufferLength+=e}},e.prototype.readBlockPng=function(){var e=this.rowBytes,t=this.pixBytes,r=this.str.getByte(),a=this.str.getBytes(e);if(this.eof=!a.length,!this.eof){var i=this.bufferLength,o=this.ensureBuffer(i+e),s=o.subarray(i-e,i);0===s.length&&(s=new Uint8Array(e));var c,l,u,h=i;switch(r){case 0:for(c=0;c>1)+a[c];for(;c>1)+a[c]&255,h++;break;case 4:for(c=0;c0;e=(0,this.decrypt)(e,!t);var r,n=this.bufferLength,a=e.length,i=this.ensureBuffer(n+a);for(r=0;r=0;--n)r[a+n]=255&s,s>>=8}}else this.eof=!0},e}();t.Ascii85Stream=g;var m=function(){function e(e,t){this.str=e,this.dict=e.dict,this.firstDigit=-1,t&&(t*=.5),u.call(this,t)}return e.prototype=Object.create(u.prototype),e.prototype.readBlock=function(){var e=this.str.getBytes(8e3);if(e.length){for(var t=e.length+1>>1,r=this.ensureBuffer(this.bufferLength+t),n=this.bufferLength,a=this.firstDigit,i=0,o=e.length;i=48&&c<=57)s=15&c;else{if(!(c>=65&&c<=70||c>=97&&c<=102)){if(62===c){this.eof=!0;break}continue}s=9+(15&c)}a<0?a=s:(r[n++]=a<<4|s,a=-1)}a>=0&&this.eof&&(r[n++]=a<<4,a=-1),this.firstDigit=a,this.bufferLength=n}else this.eof=!0},e}();t.AsciiHexStream=m;var v=function(){function e(e,t){this.str=e,this.dict=e.dict,u.call(this,t)}return e.prototype=Object.create(u.prototype),e.prototype.readBlock=function(){var e=this.str.getBytes(2);if(!e||e.length<2||128===e[0])this.eof=!0;else{var t,r=this.bufferLength,n=e[0];if(n<128){if((t=this.ensureBuffer(r+n+1))[r++]=e[1],n>0){var a=this.str.getBytes(n);t.set(a,r),r+=n}}else{n=257-n;var i=e[1];t=this.ensureBuffer(r+n+1);for(var o=0;o>>t&(1<0;if(v<256)f[0]=v,d=1;else{if(!(v>=258)){if(256===v){u=9,o=258,d=0;continue}this.eof=!0,delete this.lzwState;break}if(v