/*! For license information please see shared.js.LICENSE.txt */ (self.webpackChunk=self.webpackChunk||[]).push([[7978],{9742:(e,t)=>{"use strict";t.byteLength=function(e){var t=l(e),r=t[0],i=t[1];return 3*(r+i)/4-i},t.toByteArray=function(e){var t,r,n=l(e),s=n[0],o=n[1],c=new a(function(e,t,r){return 3*(t+r)/4-r}(0,s,o)),u=0,d=o>0?s-4:s;for(r=0;r>16&255,c[u++]=t>>8&255,c[u++]=255&t;2===o&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,c[u++]=255&t);1===o&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t);return c},t.fromByteArray=function(e){for(var t,i=e.length,a=i%3,n=[],s=16383,o=0,l=i-a;ol?l:o+s));1===a?(t=e[i-1],n.push(r[t>>2]+r[t<<4&63]+"==")):2===a&&(t=(e[i-2]<<8)+e[i-1],n.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return n.join("")};for(var r=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,o=n.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,i){for(var a,n,s=[],o=t;o>18&63]+r[n>>12&63]+r[n>>6&63]+r[63&n]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},8764:(e,t,r)=>{"use strict";var i=r(9742),a=r(645),n=r(5826);function s(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(e,t){if(s()=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function p(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(i)return q(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,r){var i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return C(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return S(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function m(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function b(e,t,r,i,a){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=a?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(a)return-1;r=e.length-1}else if(r<0){if(!a)return-1;r=0}if("string"==typeof t&&(t=l.from(t,i)),l.isBuffer(t))return 0===t.length?-1:v(e,t,r,i,a);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,i,a);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,i,a){var n,s=1,o=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s=2,o/=2,l/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(a){var u=-1;for(n=r;no&&(r=o-l),n=r;n>=0;n--){for(var d=!0,h=0;ha&&(i=a):i=a;var n=t.length;if(n%2!=0)throw new TypeError("Invalid hex string");i>n/2&&(i=n/2);for(var s=0;s>8,a=r%256,n.push(a),n.push(i);return n}(t,e.length-r),e,r,i)}function S(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function C(e,t,r){r=Math.min(e.length,r);for(var i=[],a=t;a239?4:c>223?3:c>191?2:1;if(a+d<=r)switch(d){case 1:c<128&&(u=c);break;case 2:128==(192&(n=e[a+1]))&&(l=(31&c)<<6|63&n)>127&&(u=l);break;case 3:n=e[a+1],s=e[a+2],128==(192&n)&&128==(192&s)&&(l=(15&c)<<12|(63&n)<<6|63&s)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:n=e[a+1],s=e[a+2],o=e[a+3],128==(192&n)&&128==(192&s)&&128==(192&o)&&(l=(15&c)<<18|(63&n)<<12|(63&s)<<6|63&o)>65535&&l<1114112&&(u=l)}null===u?(u=65533,d=1):u>65535&&(u-=65536,i.push(u>>>10&1023|55296),u=56320|1023&u),i.push(u),a+=d}return function(e){var t=e.length;if(t<=P)return String.fromCharCode.apply(String,e);var r="",i=0;for(;i0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},l.prototype.compare=function(e,t,r,i,a){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===a&&(a=this.length),t<0||r>e.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&t>=r)return 0;if(i>=a)return-1;if(t>=r)return 1;if(this===e)return 0;for(var n=(a>>>=0)-(i>>>=0),s=(r>>>=0)-(t>>>=0),o=Math.min(n,s),c=this.slice(i,a),u=e.slice(t,r),d=0;da)&&(r=a),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var n=!1;;)switch(i){case"hex":return y(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":return x(this,e,t,r);case"latin1":case"binary":return k(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,t,r);default:if(n)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),n=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var P=4096;function I(e,t,r){var i="";r=Math.min(e.length,r);for(var a=t;ai)&&(r=i);for(var a="",n=t;nr)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,r,i,a,n){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||te.length)throw new RangeError("Index out of range")}function R(e,t,r,i){t<0&&(t=65535+t+1);for(var a=0,n=Math.min(e.length-r,2);a>>8*(i?a:1-a)}function M(e,t,r,i){t<0&&(t=4294967295+t+1);for(var a=0,n=Math.min(e.length-r,4);a>>8*(i?a:3-a)&255}function D(e,t,r,i,a,n){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(e,t,r,i,n){return n||D(e,0,r,4),a.write(e,t,r,i,23,4),r+4}function B(e,t,r,i,n){return n||D(e,0,r,8),a.write(e,t,r,i,52,8),r+8}l.prototype.slice=function(e,t){var r,i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),(t=void 0===t?i:~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),t0&&(a*=256);)i+=this[e+--t]*a;return i},l.prototype.readUInt8=function(e,t){return t||F(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||F(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||F(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||F(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||F(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||F(e,t,this.length);for(var i=this[e],a=1,n=0;++n=(a*=128)&&(i-=Math.pow(2,8*t)),i},l.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||F(e,t,this.length);for(var i=t,a=1,n=this[e+--i];i>0&&(a*=256);)n+=this[e+--i]*a;return n>=(a*=128)&&(n-=Math.pow(2,8*t)),n},l.prototype.readInt8=function(e,t){return t||F(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||F(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){t||F(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return t||F(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||F(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||F(e,4,this.length),a.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||F(e,4,this.length),a.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||F(e,8,this.length),a.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||F(e,8,this.length),a.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,r,i){(e=+e,t|=0,r|=0,i)||L(this,e,t,r,Math.pow(2,8*r)-1,0);var a=1,n=0;for(this[t]=255&e;++n=0&&(n*=256);)this[t+a]=e/n&255;return t+r},l.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||L(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||L(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||L(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||L(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):M(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||L(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t|=0,!i){var a=Math.pow(2,8*r-1);L(this,e,t,r,a-1,-a)}var n=0,s=1,o=0;for(this[t]=255&e;++n>0)-o&255;return t+r},l.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t|=0,!i){var a=Math.pow(2,8*r-1);L(this,e,t,r,a-1,-a)}var n=r-1,s=1,o=0;for(this[t+n]=255&e;--n>=0&&(s*=256);)e<0&&0===o&&0!==this[t+n+1]&&(o=1),this[t+n]=(e/s>>0)-o&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||L(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||L(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||L(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||L(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):M(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,r){return N(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return N(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return B(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return B(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,i){if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t=0;--a)e[a+t]=this[a+r];else if(n<1e3||!l.TYPED_ARRAY_SUPPORT)for(a=0;a>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(n=t;n55295&&r<57344){if(!a){if(r>56319){(t-=3)>-1&&n.push(239,191,189);continue}if(s+1===i){(t-=3)>-1&&n.push(239,191,189);continue}a=r;continue}if(r<56320){(t-=3)>-1&&n.push(239,191,189),a=r;continue}r=65536+(a-55296<<10|r-56320)}else a&&(t-=3)>-1&&n.push(239,191,189);if(a=null,r<128){if((t-=1)<0)break;n.push(r)}else if(r<2048){if((t-=2)<0)break;n.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;n.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;n.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return n}function z(e){return i.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(U,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function $(e,t,r,i){for(var a=0;a=t.length||a>=e.length);++a)t[a+r]=e[a];return a}},7422:(e,t,r)=>{"use strict";r.d(t,{Z:()=>h});var i=r(3645),a=r.n(i),n=r(1667),s=r.n(n),o=r(6810),l=r(9187),c=a()((function(e){return e[1]})),u=s()(o.Z),d=s()(l.Z);c.push([e.id,'.textLayer{bottom:0;left:0;line-height:1;opacity:.2;overflow:hidden;position:absolute;right:0;top:0}.textLayer>span{color:transparent;cursor:text;position:absolute;transform-origin:0 0;white-space:pre}.textLayer .highlight{background-color:#b400aa;border-radius:4px;margin:-1px;padding:1px}.textLayer .highlight.begin{border-radius:4px 0 0 4px}.textLayer .highlight.end{border-radius:0 4px 4px 0}.textLayer .highlight.middle{border-radius:0}.textLayer .highlight.selected{background-color:#006400}.textLayer ::-moz-selection{background:#00f}.textLayer ::selection{background:#00f}.textLayer .endOfContent{bottom:0;cursor:default;display:block;left:0;position:absolute;right:0;top:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:-1}.textLayer .endOfContent.active{top:0}.annotationLayer section{position:absolute}.annotationLayer .buttonWidgetAnnotation.pushButton>a,.annotationLayer .linkAnnotation>a{font-size:1em;height:100%;left:0;position:absolute;top:0;width:100%}.annotationLayer .buttonWidgetAnnotation.pushButton>a:hover,.annotationLayer .linkAnnotation>a:hover{background:#ff0;box-shadow:0 2px 10px #ff0;opacity:.2}.annotationLayer .textAnnotation img{cursor:pointer;position:absolute}.annotationLayer .buttonWidgetAnnotation.checkBox input,.annotationLayer .buttonWidgetAnnotation.radioButton input,.annotationLayer .choiceWidgetAnnotation select,.annotationLayer .textWidgetAnnotation input,.annotationLayer .textWidgetAnnotation textarea{background-color:rgba(0,54,255,.13);border:1px solid transparent;box-sizing:border-box;font-size:9px;height:100%;margin:0;padding:0 3px;vertical-align:top;width:100%}.annotationLayer .choiceWidgetAnnotation select option{padding:0}.annotationLayer .buttonWidgetAnnotation.radioButton input{border-radius:50%}.annotationLayer .textWidgetAnnotation textarea{font:message-box;font-size:9px;resize:none}.annotationLayer .buttonWidgetAnnotation.checkBox input[disabled],.annotationLayer .buttonWidgetAnnotation.radioButton input[disabled],.annotationLayer .choiceWidgetAnnotation select[disabled],.annotationLayer .textWidgetAnnotation input[disabled],.annotationLayer .textWidgetAnnotation textarea[disabled]{background:none;border:1px solid transparent;cursor:not-allowed}.annotationLayer .buttonWidgetAnnotation.checkBox input:hover,.annotationLayer .buttonWidgetAnnotation.radioButton input:hover,.annotationLayer .choiceWidgetAnnotation select:hover,.annotationLayer .textWidgetAnnotation input:hover,.annotationLayer .textWidgetAnnotation textarea:hover{border:1px solid #000}.annotationLayer .choiceWidgetAnnotation select:focus,.annotationLayer .textWidgetAnnotation input:focus,.annotationLayer .textWidgetAnnotation textarea:focus{background:none;border:1px solid transparent}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after,.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before{background-color:#000;content:"";display:block;position:absolute}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after,.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before{height:80%;left:45%;width:1px}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before{transform:rotate(45deg)}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after{transform:rotate(-45deg)}.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before{border-radius:50%;height:50%;left:30%;top:20%;width:50%}.annotationLayer .textWidgetAnnotation input.comb{font-family:monospace;padding-left:2px;padding-right:0}.annotationLayer .textWidgetAnnotation input.comb:focus{width:115%}.annotationLayer .buttonWidgetAnnotation.checkBox input,.annotationLayer .buttonWidgetAnnotation.radioButton input{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0}.annotationLayer .popupWrapper{position:absolute;width:20em}.annotationLayer .popup{word-wrap:break-word;background-color:#ff9;border-radius:2px;box-shadow:0 2px 5px #888;cursor:pointer;font:message-box;font-size:9px;margin-left:5px;max-width:20em;padding:6px;position:absolute;z-index:200}.annotationLayer .popup>*{font-size:9px}.annotationLayer .popup h1{display:inline-block}.annotationLayer .popup span{display:inline-block;margin-left:5px}.annotationLayer .popup p{border-top:1px solid #333;margin-top:2px;padding-top:2px}.annotationLayer .caretAnnotation,.annotationLayer .circleAnnotation svg ellipse,.annotationLayer .fileAttachmentAnnotation,.annotationLayer .freeTextAnnotation,.annotationLayer .highlightAnnotation,.annotationLayer .inkAnnotation svg polyline,.annotationLayer .lineAnnotation svg line,.annotationLayer .polygonAnnotation svg polygon,.annotationLayer .polylineAnnotation svg polyline,.annotationLayer .squareAnnotation svg rect,.annotationLayer .squigglyAnnotation,.annotationLayer .stampAnnotation,.annotationLayer .strikeoutAnnotation,.annotationLayer .underlineAnnotation{cursor:pointer}.pdfViewer .canvasWrapper{overflow:hidden}.pdfViewer .page{background-clip:content-box;background-color:#fff;border:9px solid transparent;-o-border-image:url('+u+") 9 9 repeat;border-image:url("+u+") 9 9 repeat;direction:ltr;height:1056px;margin:1px auto -8px;overflow:visible;position:relative;width:816px}.pdfViewer.removePageBorders .page{border:none;margin:0 auto 10px}.pdfViewer.singlePageView{display:inline-block}.pdfViewer.singlePageView .page{border:none;margin:0}.pdfViewer.scrollHorizontal,.pdfViewer.scrollWrapped,.spread{margin-left:3.5px;margin-right:3.5px;text-align:center}.pdfViewer.scrollHorizontal,.spread{white-space:nowrap}.pdfViewer.removePageBorders,.pdfViewer.scrollHorizontal .spread,.pdfViewer.scrollWrapped .spread{margin-left:0;margin-right:0}.pdfViewer.scrollHorizontal .page,.pdfViewer.scrollHorizontal .spread,.pdfViewer.scrollWrapped .page,.pdfViewer.scrollWrapped .spread,.spread .page{display:inline-block;vertical-align:middle}.pdfViewer.scrollHorizontal .page,.pdfViewer.scrollWrapped .page,.spread .page{margin-left:-3.5px;margin-right:-3.5px}.pdfViewer.removePageBorders .spread .page,.pdfViewer.removePageBorders.scrollHorizontal .page,.pdfViewer.removePageBorders.scrollWrapped .page{margin-left:5px;margin-right:5px}.pdfViewer .page canvas{display:block;margin:0}.pdfViewer .page canvas[hidden]{display:none}.pdfViewer .page .loadingIcon{background:url("+d+") 50% no-repeat;bottom:0;display:block;left:0;position:absolute;right:0;top:0}.pdfPresentationMode .pdfViewer{margin-left:0;margin-right:0}.pdfPresentationMode .pdfViewer .page,.pdfPresentationMode .pdfViewer .spread{display:block}.pdfPresentationMode .pdfViewer .page,.pdfPresentationMode .pdfViewer.removePageBorders .page{margin-left:auto;margin-right:auto}.pdfPresentationMode:-ms-fullscreen .pdfViewer .page{margin-bottom:100%!important}.pdfPresentationMode:-webkit-full-screen .pdfViewer .page{border:0;margin-bottom:100%}.pdfPresentationMode:fullscreen .pdfViewer .page{border:0;margin-bottom:100%}",""]);const h=c},7544:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});var i=r(3645),a=r.n(i)()((function(e){return e[1]}));a.push([e.id,'@-webkit-keyframes resizeSensorVisibility{0%{top:0}}@keyframes resizeSensorVisibility{0%{top:0}}.textLayer{bottom:0;left:0;line-height:1;opacity:.2;overflow:hidden;position:absolute;right:0;top:0}.textLayer>span{color:transparent;cursor:text;position:absolute;transform-origin:0 0;white-space:pre}.textLayer .highlight{background-color:#b400aa;border-radius:4px;margin:-1px;padding:1px}.textLayer .highlight.begin{border-radius:4px 0 0 4px}.textLayer .highlight.end{border-radius:0 4px 4px 0}.textLayer .highlight.middle{border-radius:0}.textLayer .highlight.selected{background-color:#006400}.textLayer ::-moz-selection{background:#00f}.textLayer ::selection{background:#00f}.textLayer .endOfContent{bottom:0;cursor:default;display:block;left:0;position:absolute;right:0;top:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:-1}.textLayer .endOfContent.active{top:0}.annotationLayer section{position:absolute}.annotationLayer .buttonWidgetAnnotation.pushButton>a,.annotationLayer .linkAnnotation>a{font-size:1em;height:100%;left:0;position:absolute;top:0;width:100%}.annotationLayer .buttonWidgetAnnotation.pushButton>a:hover,.annotationLayer .linkAnnotation>a:hover{background:#ff0;box-shadow:0 2px 10px #ff0;opacity:.2}.annotationLayer .textAnnotation img{cursor:pointer;position:absolute}.annotationLayer .buttonWidgetAnnotation.checkBox input,.annotationLayer .buttonWidgetAnnotation.radioButton input,.annotationLayer .choiceWidgetAnnotation select,.annotationLayer .textWidgetAnnotation input,.annotationLayer .textWidgetAnnotation textarea{background-color:rgba(0,54,255,.13);border:1px solid transparent;box-sizing:border-box;font-size:9px;height:100%;margin:0;padding:0 3px;vertical-align:top;width:100%}.annotationLayer .choiceWidgetAnnotation select option{padding:0}.annotationLayer .buttonWidgetAnnotation.radioButton input{border-radius:50%}.annotationLayer .textWidgetAnnotation textarea{font:message-box;font-size:9px;resize:none}.annotationLayer .buttonWidgetAnnotation.checkBox input[disabled],.annotationLayer .buttonWidgetAnnotation.radioButton input[disabled],.annotationLayer .choiceWidgetAnnotation select[disabled],.annotationLayer .textWidgetAnnotation input[disabled],.annotationLayer .textWidgetAnnotation textarea[disabled]{background:none;border:1px solid transparent;cursor:not-allowed}.annotationLayer .buttonWidgetAnnotation.checkBox input:hover,.annotationLayer .buttonWidgetAnnotation.radioButton input:hover,.annotationLayer .choiceWidgetAnnotation select:hover,.annotationLayer .textWidgetAnnotation input:hover,.annotationLayer .textWidgetAnnotation textarea:hover{border:1px solid #000}.annotationLayer .choiceWidgetAnnotation select:focus,.annotationLayer .textWidgetAnnotation input:focus,.annotationLayer .textWidgetAnnotation textarea:focus{background:none;border:1px solid transparent}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after,.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before{background-color:#000;content:"";display:block;position:absolute}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after,.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before{height:80%;left:45%;width:1px}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before{transform:rotate(45deg)}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after{transform:rotate(-45deg)}.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before{border-radius:50%;height:50%;left:30%;top:20%;width:50%}.annotationLayer .textWidgetAnnotation input.comb{font-family:monospace;padding-left:2px;padding-right:0}.annotationLayer .textWidgetAnnotation input.comb:focus{width:115%}.annotationLayer .buttonWidgetAnnotation.checkBox input,.annotationLayer .buttonWidgetAnnotation.radioButton input{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0}.annotationLayer .popupWrapper{position:absolute;width:20em}.annotationLayer .popup{word-wrap:break-word;background-color:#ff9;border-radius:2px;box-shadow:0 2px 5px #888;cursor:pointer;font:message-box;font-size:9px;margin-left:5px;max-width:20em;padding:6px;position:absolute;z-index:200}.annotationLayer .popup>*{font-size:9px}.annotationLayer .popup h1{display:inline-block}.annotationLayer .popup span{display:inline-block;margin-left:5px}.annotationLayer .popup p{border-top:1px solid #333;margin-top:2px;padding-top:2px}.annotationLayer .caretAnnotation,.annotationLayer .circleAnnotation svg ellipse,.annotationLayer .fileAttachmentAnnotation,.annotationLayer .freeTextAnnotation,.annotationLayer .highlightAnnotation,.annotationLayer .inkAnnotation svg polyline,.annotationLayer .lineAnnotation svg line,.annotationLayer .polygonAnnotation svg polygon,.annotationLayer .polylineAnnotation svg polyline,.annotationLayer .squareAnnotation svg rect,.annotationLayer .squigglyAnnotation,.annotationLayer .stampAnnotation,.annotationLayer .strikeoutAnnotation,.annotationLayer .underlineAnnotation{cursor:pointer}.pdfViewer .canvasWrapper{overflow:hidden}.pdfViewer .page{background-clip:content-box;background-color:#fff;border:9px solid transparent;-o-border-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAQAAADYWf5HAAAA6UlEQVR4Xl2Pi2rEMAwE16fm1f7/r14v7w4rI0IzLAF7hLxNevBSEMEF5+OilNCsRd8ZMyn+a4NmsOT8WJw1lFbSYgGFzF2bLFoLjTClWjKKGRWpDYAGXUnZ4uhbBUzF3Oe/GG/ue2fn4GgsyXhNgysV2JnrhKEMg4fEZcALmiKbNhBBRFpSyDOj1G4QOVly6O1FV54ZZq8OVygrciDt6JazRgi1ljTPH0gbrPmHPXAbCiDd4GawIjip1TPh9tt2sz24qaCjr/jAb/GBFTbq9KZ7Ke/Cqt8nayUikZKsWZK7Fe6bg5dOUt8fZHWG2BHc+6EAAAAASUVORK5CYII=) 9 9 repeat;border-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAQAAADYWf5HAAAA6UlEQVR4Xl2Pi2rEMAwE16fm1f7/r14v7w4rI0IzLAF7hLxNevBSEMEF5+OilNCsRd8ZMyn+a4NmsOT8WJw1lFbSYgGFzF2bLFoLjTClWjKKGRWpDYAGXUnZ4uhbBUzF3Oe/GG/ue2fn4GgsyXhNgysV2JnrhKEMg4fEZcALmiKbNhBBRFpSyDOj1G4QOVly6O1FV54ZZq8OVygrciDt6JazRgi1ljTPH0gbrPmHPXAbCiDd4GawIjip1TPh9tt2sz24qaCjr/jAb/GBFTbq9KZ7Ke/Cqt8nayUikZKsWZK7Fe6bg5dOUt8fZHWG2BHc+6EAAAAASUVORK5CYII=) 9 9 repeat;direction:ltr;height:1056px;margin:1px auto -8px;overflow:visible;position:relative;width:816px}.pdfViewer.removePageBorders .page{border:none;margin:0 auto 10px}.pdfViewer.singlePageView{display:inline-block}.pdfViewer.singlePageView .page{border:none;margin:0}.pdfViewer.scrollHorizontal,.pdfViewer.scrollWrapped,.spread{margin-left:3.5px;margin-right:3.5px;text-align:center}.pdfViewer.scrollHorizontal,.spread{white-space:nowrap}.pdfViewer.removePageBorders,.pdfViewer.scrollHorizontal .spread,.pdfViewer.scrollWrapped .spread{margin-left:0;margin-right:0}.pdfViewer.scrollHorizontal .page,.pdfViewer.scrollHorizontal .spread,.pdfViewer.scrollWrapped .page,.pdfViewer.scrollWrapped .spread,.spread .page{display:inline-block;vertical-align:middle}.pdfViewer.scrollHorizontal .page,.pdfViewer.scrollWrapped .page,.spread .page{margin-left:-3.5px;margin-right:-3.5px}.pdfViewer.removePageBorders .spread .page,.pdfViewer.removePageBorders.scrollHorizontal .page,.pdfViewer.removePageBorders.scrollWrapped .page{margin-left:5px;margin-right:5px}.pdfViewer .page canvas{display:block;margin:0}.pdfViewer .page canvas[hidden]{display:none}.pdfViewer .page .loadingIcon{background:url(data:image/gif;base64,R0lGODlhGAAYAPQAAP///wAAAM7Ozvr6+uDg4LCwsOjo6I6OjsjIyJycnNjY2KioqMDAwPLy8nZ2doaGhri4uGhoaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJBwAAACwAAAAAGAAYAAAFriAgjiQAQWVaDgr5POSgkoTDjFE0NoQ8iw8HQZQTDQjDn4jhSABhAAOhoTqSDg7qSUQwxEaEwwFhXHhHgzOA1xshxAnfTzotGRaHglJqkJcaVEqCgyoCBQkJBQKDDXQGDYaIioyOgYSXA36XIgYMBWRzXZoKBQUMmil0lgalLSIClgBpO0g+s26nUWddXyoEDIsACq5SsTMMDIECwUdJPw0Mzsu0qHYkw72bBmozIQAh+QQJBwAAACwAAAAAGAAYAAAFsCAgjiTAMGVaDgR5HKQwqKNxIKPjjFCk0KNXC6ATKSI7oAhxWIhezwhENTCQEoeGCdWIPEgzESGxEIgGBWstEW4QCGGAIJEoxGmGt5ZkgCRQQHkGd2CESoeIIwoMBQUMP4cNeQQGDYuNj4iSb5WJnmeGng0CDGaBlIQEJziHk3sABidDAHBgagButSKvAAoyuHuUYHgCkAZqebw0AgLBQyyzNKO3byNuoSS8x8OfwIchACH5BAkHAAAALAAAAAAYABgAAAW4ICCOJIAgZVoOBJkkpDKoo5EI43GMjNPSokXCINKJCI4HcCRIQEQvqIOhGhBHhUTDhGo4diOZyFAoKEQDxra2mAEgjghOpCgz3LTBIxJ5kgwMBShACREHZ1V4Kg1rS44pBAgMDAg/Sw0GBAQGDZGTlY+YmpyPpSQDiqYiDQoCliqZBqkGAgKIS5kEjQ21VwCyp76dBHiNvz+MR74AqSOdVwbQuo+abppo10ssjdkAnc0rf8vgl8YqIQAh+QQJBwAAACwAAAAAGAAYAAAFrCAgjiQgCGVaDgZZFCQxqKNRKGOSjMjR0qLXTyciHA7AkaLACMIAiwOC1iAxCrMToHHYjWQiA4NBEA0Q1RpWxHg4cMXxNDk4OBxNUkPAQAEXDgllKgMzQA1pSYopBgonCj9JEA8REQ8QjY+RQJOVl4ugoYssBJuMpYYjDQSliwasiQOwNakALKqsqbWvIohFm7V6rQAGP6+JQLlFg7KDQLKJrLjBKbvAor3IKiEAIfkECQcAAAAsAAAAABgAGAAABbUgII4koChlmhokw5DEoI4NQ4xFMQoJO4uuhignMiQWvxGBIQC+AJBEUyUcIRiyE6CR0CllW4HABxBURTUw4nC4FcWo5CDBRpQaCoF7VjgsyCUDYDMNZ0mHdwYEBAaGMwwHDg4HDA2KjI4qkJKUiJ6faJkiA4qAKQkRB3E0i6YpAw8RERAjA4tnBoMApCMQDhFTuySKoSKMJAq6rD4GzASiJYtgi6PUcs9Kew0xh7rNJMqIhYchACH5BAkHAAAALAAAAAAYABgAAAW0ICCOJEAQZZo2JIKQxqCOjWCMDDMqxT2LAgELkBMZCoXfyCBQiFwiRsGpku0EshNgUNAtrYPT0GQVNRBWwSKBMp98P24iISgNDAS4ipGA6JUpA2WAhDR4eWM/CAkHBwkIDYcGiTOLjY+FmZkNlCN3eUoLDmwlDW+AAwcODl5bYl8wCVYMDw5UWzBtnAANEQ8kBIM0oAAGPgcREIQnVloAChEOqARjzgAQEbczg8YkWJq8nSUhACH5BAkHAAAALAAAAAAYABgAAAWtICCOJGAYZZoOpKKQqDoORDMKwkgwtiwSBBYAJ2owGL5RgxBziQQMgkwoMkhNqAEDARPSaiMDFdDIiRSFQowMXE8Z6RdpYHWnEAWGPVkajPmARVZMPUkCBQkJBQINgwaFPoeJi4GVlQ2Qc3VJBQcLV0ptfAMJBwdcIl+FYjALQgimoGNWIhAQZA4HXSpLMQ8PIgkOSHxAQhERPw7ASTSFyCMMDqBTJL8tf3y2fCEAIfkECQcAAAAsAAAAABgAGAAABa8gII4k0DRlmg6kYZCoOg5EDBDEaAi2jLO3nEkgkMEIL4BLpBAkVy3hCTAQKGAznM0AFNFGBAbj2cA9jQixcGZAGgECBu/9HnTp+FGjjezJFAwFBQwKe2Z+KoCChHmNjVMqA21nKQwJEJRlbnUFCQlFXlpeCWcGBUACCwlrdw8RKGImBwktdyMQEQciB7oACwcIeA4RVwAODiIGvHQKERAjxyMIB5QlVSTLYLZ0sW8hACH5BAkHAAAALAAAAAAYABgAAAW0ICCOJNA0ZZoOpGGQrDoOBCoSxNgQsQzgMZyIlvOJdi+AS2SoyXrK4umWPM5wNiV0UDUIBNkdoepTfMkA7thIECiyRtUAGq8fm2O4jIBgMBA1eAZ6Knx+gHaJR4QwdCMKBxEJRggFDGgQEREPjjAMBQUKIwIRDhBDC2QNDDEKoEkDoiMHDigICGkJBS2dDA6TAAnAEAkCdQ8ORQcHTAkLcQQODLPMIgIJaCWxJMIkPIoAt3EhACH5BAkHAAAALAAAAAAYABgAAAWtICCOJNA0ZZoOpGGQrDoOBCoSxNgQsQzgMZyIlvOJdi+AS2SoyXrK4umWHM5wNiV0UN3xdLiqr+mENcWpM9TIbrsBkEck8oC0DQqBQGGIz+t3eXtob0ZTPgNrIwQJDgtGAgwCWSIMDg4HiiUIDAxFAAoODwxDBWINCEGdSTQkCQcoegADBaQ6MggHjwAFBZUFCm0HB0kJCUy9bAYHCCPGIwqmRq0jySMGmj6yRiEAIfkECQcAAAAsAAAAABgAGAAABbIgII4k0DRlmg6kYZCsOg4EKhLE2BCxDOAxnIiW84l2L4BLZKipBopW8XRLDkeCiAMyMvQAA+uON4JEIo+vqukkKQ6RhLHplVGN+LyKcXA4Dgx5DWwGDXx+gIKENnqNdzIDaiMECwcFRgQCCowiCAcHCZIlCgICVgSfCEMMnA0CXaU2YSQFoQAKUQMMqjoyAglcAAyBAAIMRUYLCUkFlybDeAYJryLNk6xGNCTQXY0juHghACH5BAkHAAAALAAAAAAYABgAAAWzICCOJNA0ZVoOAmkY5KCSSgSNBDE2hDyLjohClBMNij8RJHIQvZwEVOpIekRQJyJs5AMoHA+GMbE1lnm9EcPhOHRnhpwUl3AsknHDm5RN+v8qCAkHBwkIfw1xBAYNgoSGiIqMgJQifZUjBhAJYj95ewIJCQV7KYpzBAkLLQADCHOtOpY5PgNlAAykAEUsQ1wzCgWdCIdeArczBQVbDJ0NAqyeBb64nQAGArBTt8R8mLuyPyEAOwAAAAAAAAAAAA==) 50% no-repeat;bottom:0;display:block;left:0;position:absolute;right:0;top:0}.pdfPresentationMode .pdfViewer{margin-left:0;margin-right:0}.pdfPresentationMode .pdfViewer .page,.pdfPresentationMode .pdfViewer .spread{display:block}.pdfPresentationMode .pdfViewer .page,.pdfPresentationMode .pdfViewer.removePageBorders .page{margin-left:auto;margin-right:auto}.pdfPresentationMode:-ms-fullscreen .pdfViewer .page{margin-bottom:100%!important}.pdfPresentationMode:-webkit-full-screen .pdfViewer .page{border:0;margin-bottom:100%}.pdfPresentationMode:fullscreen .pdfViewer .page{border:0;margin-bottom:100%}',""]);const n=a},1238:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});var i=r(3645),a=r.n(i)()((function(e){return e[1]}));a.push([e.id,"@-webkit-keyframes resizeSensorVisibility{0%{top:0}}@keyframes resizeSensorVisibility{0%{top:0}}",""]);const n=a},4734:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});var i=r(3645),a=r.n(i)()((function(e){return e[1]}));a.push([e.id,".emoji{font-size:inherit;height:1em;width:1em}",""]);const n=a},9660:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});var i=r(3645),a=r.n(i)()((function(e){return e[1]}));a.push([e.id,".popover-wrapper[data-v-5d0dc97d]{position:relative}",""]);const n=a},6799:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});var i=r(3645),a=r.n(i)()((function(e){return e[1]}));a.push([e.id,".alphabet-icon g,.alphabet-icon line,.alphabet-icon polyline{color:inherit}",""]);const n=a},3485:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});var i=r(3645),a=r.n(i)()((function(e){return e[1]}));a.push([e.id,".preview-list-icon line,.preview-list-icon path{color:inherit}",""]);const n=a},1700:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});var i=r(3645),a=r.n(i)()((function(e){return e[1]}));a.push([e.id,".preview-list-icon line,.preview-list-icon path,.preview-list-icon polyline{color:inherit}",""]);const n=a},3822:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});var i=r(3645),a=r.n(i)()((function(e){return e[1]}));a.push([e.id,".preview-list-icon line,.preview-list-icon rect{color:inherit}",""]);const n=a},6991:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});var i=r(3645),a=r.n(i)()((function(e){return e[1]}));a.push([e.id,".multiselect-actions[data-v-71bfa9c7]{background:#fff;bottom:0;display:flex;left:0;overflow:hidden;padding:10px 15px;position:fixed;right:0;z-index:9}.multiselect-actions .action-btn[data-v-71bfa9c7]{margin-right:25px}.multiselect-actions .action-btn[data-v-71bfa9c7]:last-child{margin-right:0}.multiselect-actions .close-icon[data-v-71bfa9c7]{margin-left:auto!important}.is-inactive[data-v-71bfa9c7]{opacity:.25!important;pointer-events:none!important}.is-inactive .menu-option[data-v-71bfa9c7]{align-items:center;display:flex}.is-inactive .options.is-active[data-v-71bfa9c7]{opacity:1!important;pointer-events:auto!important}.dark .multiselect-actions[data-v-71bfa9c7]{background:#1e2024}.context-menu-enter-active[data-v-71bfa9c7],.context-menu-leave-active[data-v-71bfa9c7],.fade-enter-active[data-v-71bfa9c7],.fade-leave-active[data-v-71bfa9c7]{transition:all .2s}.fade-enter[data-v-71bfa9c7],.fade-leave-to[data-v-71bfa9c7]{opacity:0}.context-menu-enter[data-v-71bfa9c7],.context-menu-leave-to[data-v-71bfa9c7]{opacity:0;transform:translateY(100%)}.context-menu-leave-active[data-v-71bfa9c7]{position:absolute}",""]);const n=a},4397:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});var i=r(3645),a=r.n(i)()((function(e){return e[1]}));a.push([e.id,".spinner-wrapper[data-v-6f192493]{padding-bottom:90px;position:relative}.popup[data-v-6f192493]{bottom:0;height:100%;overflow:auto;top:0;z-index:20}.popup[data-v-6f192493],.popup-wrapper[data-v-6f192493]{left:0;position:absolute;right:0}.popup-wrapper[data-v-6f192493]{background:#fff;border-radius:8px;box-shadow:0 2px 40px rgba(26,38,74,.12);margin:0 auto;max-width:480px;padding:20px;text-align:center;top:50%;transform:translateY(-50%) scale(1);z-index:12}.popup-content .title[data-v-6f192493]{color:#1b2539;font-size:1.375em;font-weight:700}.popup-content .message[data-v-6f192493]{color:#333;font-size:1em;margin-top:5px}@media only screen and (max-width:690px){.popup-wrapper[data-v-6f192493]{left:15px;padding:20px;right:15px}.popup-content .title[data-v-6f192493]{font-size:1.1875em}.popup-content .message[data-v-6f192493]{font-size:.9375em}}.dark .popup-wrapper[data-v-6f192493]{background:#1e2024}.dark .popup-content .title[data-v-6f192493]{color:#bec6cf}.dark .popup-content .message[data-v-6f192493]{color:#7d858c}.popup-enter-active[data-v-6f192493]{-webkit-animation:popup-in-data-v-6f192493 .35s ease .15s both;animation:popup-in-data-v-6f192493 .35s ease .15s both}.popup-leave-active[data-v-6f192493]{animation:popup-in-data-v-6f192493 .15s ease reverse}@-webkit-keyframes popup-in-data-v-6f192493{0%{opacity:0;transform:scale(.7)}to{opacity:1;transform:scale(1)}}@keyframes popup-in-data-v-6f192493{0%{opacity:0;transform:scale(.7)}to{opacity:1;transform:scale(1)}}",""]);const n=a},2028:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});var i=r(3645),a=r.n(i)()((function(e){return e[1]}));a.push([e.id,".progress-bar[data-v-0b81e9e0]{background:#f4f5f6;border-radius:10px;height:5px;margin-top:6px;width:100%}.progress-bar span[data-v-0b81e9e0]{border-radius:10px;display:block;height:100%;max-width:100%}.dark .progress-bar[data-v-0b81e9e0]{background:#1e2024}@media only screen and (min-width:680px){.dark .progress-bar[data-v-0b81e9e0]{background:#1e2024}}",""]);const n=a},2248:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});var i=r(3645),a=r.n(i)()((function(e){return e[1]}));a.push([e.id,".sync-alt[data-v-4f244cbc]{-webkit-animation:spin-data-v-4f244cbc 1s linear infinite;animation:spin-data-v-4f244cbc 1s linear infinite;margin-right:5px}.sync-alt path[data-v-4f244cbc],.sync-alt polyline[data-v-4f244cbc]{color:inherit}@-webkit-keyframes spin-data-v-4f244cbc{0%{transform:rotate(0)}to{transform:rotate(1turn)}}@keyframes spin-data-v-4f244cbc{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.info-panel-enter-active[data-v-4f244cbc],.info-panel-leave-active[data-v-4f244cbc]{transition:all .3s ease}.info-panel-enter[data-v-4f244cbc],.info-panel-leave-to[data-v-4f244cbc]{opacity:0;transform:translateY(-100%)}.upload-progress[data-v-4f244cbc]{position:relative;width:100%;z-index:1}.upload-progress .progress-wrapper[data-v-4f244cbc]{display:flex}.upload-progress .progress-wrapper .cancel-icon[data-v-4f244cbc]{cursor:pointer;padding:0 7px 0 13px}.upload-progress .progress-wrapper .cancel-icon:hover line[data-v-4f244cbc]{color:inherit}.upload-progress .progress-title[data-v-4f244cbc]{font-weight:700;text-align:center}.upload-progress .progress-title span[data-v-4f244cbc]{font-size:.875em}.dark .progress-bar[data-v-4f244cbc]{background:#1e2024}",""]);const n=a},7691:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});var i=r(3645),a=r.n(i)()((function(e){return e[1]}));a.push([e.id,".context-menu-enter-active[data-v-87406fb8],.context-menu-leave-active[data-v-87406fb8],.fade-enter-active[data-v-87406fb8],.fade-leave-active[data-v-87406fb8]{transition:all .3s}.fade-enter[data-v-87406fb8],.fade-leave-to[data-v-87406fb8]{opacity:0}.context-menu-enter[data-v-87406fb8],.context-menu-leave-to[data-v-87406fb8]{opacity:0;transform:translateY(100%)}.context-menu-leave-active[data-v-87406fb8]{position:fixed}.vignette-enter-active[data-v-87406fb8]{-webkit-animation:vignette-in-data-v-87406fb8 .15s cubic-bezier(.4,0,1,1);animation:vignette-in-data-v-87406fb8 .15s cubic-bezier(.4,0,1,1)}.vignette-leave-active[data-v-87406fb8]{animation:vignette-in-data-v-87406fb8 .15s linear reverse}@-webkit-keyframes vignette-in-data-v-87406fb8{0%{opacity:0}to{opacity:1}}@keyframes vignette-in-data-v-87406fb8{0%{opacity:0}to{opacity:1}}",""]);const n=a},6713:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});var i=r(3645),a=r.n(i)()((function(e){return e[1]}));a.push([e.id,".menu-options[data-v-8c83820c]{list-style:none;margin-top:10px;width:100%}",""]);const n=a},6899:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});var i=r(3645),a=r.n(i)()((function(e){return e[1]}));a.push([e.id,".input-wrapper[data-v-f06bd638]{display:flex;width:100%}.input-wrapper .input-label[data-v-f06bd638]{color:#1b2539}.input-wrapper .switch-content[data-v-f06bd638]{width:100%}.input-wrapper .switch-content[data-v-f06bd638]:last-child{width:80px}.switch[data-v-f06bd638]{background:#f1f1f5;height:28px;position:relative;width:50px}.switch[data-v-f06bd638],.switch .switch-button[data-v-f06bd638]{border-radius:50px;display:block;transition:all .3s ease}.switch .switch-button[data-v-f06bd638]{background:#fff;box-shadow:0 2px 4px rgba(37,38,94,.1);cursor:pointer;height:22px;left:3px;position:absolute;top:3px;width:22px}.switch.active .switch-button[data-v-f06bd638]{left:25px}.dark .switch[data-v-f06bd638]{background:#1e2024}.dark .popup-wrapper .switch[data-v-f06bd638]{background:#25272c}",""]);const n=a},1894:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});var i=r(3645),a=r.n(i)()((function(e){return e[1]}));a.push([e.id,".popup-leave-active[data-v-b9a3c504]{animation:popup-slide-in-data-v-b9a3c504 .15s ease reverse}@media only screen and (min-width:960px){.popup-enter-active[data-v-b9a3c504]{-webkit-animation:popup-slide-in-data-v-b9a3c504 .25s ease .1s both;animation:popup-slide-in-data-v-b9a3c504 .25s ease .1s both}@-webkit-keyframes popup-slide-in-data-v-b9a3c504{0%{opacity:0;transform:translateY(100px)}to{opacity:1;transform:translateY(0)}}@keyframes popup-slide-in-data-v-b9a3c504{0%{opacity:0;transform:translateY(100px)}to{opacity:1;transform:translateY(0)}}}@media only screen and (max-width:960px){.popup-enter-active[data-v-b9a3c504]{-webkit-animation:popup-slide-in-data-v-b9a3c504 .35s ease .15s both;animation:popup-slide-in-data-v-b9a3c504 .35s ease .15s both}@-webkit-keyframes popup-slide-in-data-v-b9a3c504{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes popup-slide-in-data-v-b9a3c504{0%{transform:translateY(100%)}to{transform:translateY(0)}}}",""]);const n=a},2465:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});var i=r(3645),a=r.n(i)()((function(e){return e[1]}));a.push([e.id,".text-label[data-v-c05e7680]{color:#afafaf;display:block;font-size:.75em;font-weight:700;margin-bottom:5px;padding-left:25px}@media only screen and (max-width:1024px){.text-label[data-v-c05e7680]{padding-left:20px}}.dark .text-label[data-v-c05e7680]{opacity:.35}",""]);const n=a},1345:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});var i=r(3645),a=r.n(i)()((function(e){return e[1]}));a.push([e.id,".team-folder[data-v-117b08f2]{align-items:center;display:flex}.team-folder .member-count[data-v-117b08f2]{color:rgba(27,37,57,.7);font-size:.75em;margin-right:3px;min-width:14px;opacity:.7;text-align:left}.team-folder .members[data-v-117b08f2]{display:flex}.team-folder .members .member-preview[data-v-117b08f2]{margin-left:-10px}.team-folder .members .member-preview[data-v-117b08f2]:first-child{margin-left:0}.team-folder .members .member[data-v-117b08f2]{border:2px solid #fff;border-radius:10px;height:32px;-o-object-fit:cover;object-fit:cover;vertical-align:middle;width:32px}.dark .team-folder .member-count[data-v-117b08f2]{color:#7d858c}.dark .team-folder .members .member[data-v-117b08f2]{border-color:#1e2024}",""]);const n=a},1667:e=>{"use strict";e.exports=function(e,t){return t||(t={}),"string"!=typeof(e=e&&e.__esModule?e.default:e)?e:(/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e)}},9187:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});const i="/images/vendor/pdfjs-dist/web/loading-icon.gif?ff2dfa442d903d9d5e303345b82e5415"},6810:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});const i="/images/vendor/pdfjs-dist/web/shadow.png?4d046de3539f9ccc9ce07d3d1b786846"},645:(e,t)=>{t.read=function(e,t,r,i,a){var n,s,o=8*a-i-1,l=(1<>1,u=-7,d=r?a-1:0,h=r?-1:1,f=e[t+d];for(d+=h,n=f&(1<<-u)-1,f>>=-u,u+=o;u>0;n=256*n+e[t+d],d+=h,u-=8);for(s=n&(1<<-u)-1,n>>=-u,u+=i;u>0;s=256*s+e[t+d],d+=h,u-=8);if(0===n)n=1-c;else{if(n===l)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,i),n-=c}return(f?-1:1)*s*Math.pow(2,n-i)},t.write=function(e,t,r,i,a,n){var s,o,l,c=8*n-a-1,u=(1<>1,h=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:n-1,p=i?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+d>=1?h/l:h*Math.pow(2,1-d))*l>=2&&(s++,l/=2),s+d>=u?(o=0,s=u):s+d>=1?(o=(t*l-1)*Math.pow(2,a),s+=d):(o=t*Math.pow(2,d-1)*Math.pow(2,a),s=0));a>=8;e[r+f]=255&o,f+=p,o/=256,a-=8);for(s=s<0;e[r+f]=255&s,f+=p,s/=256,c-=8);e[r+f-p]|=128*g}},5826:e=>{var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},9299:function(module,__unused_webpack_exports,__webpack_require__){var process=__webpack_require__(4155),Buffer=__webpack_require__(8764).Buffer,factory;factory=function(){return function(e){var t={};function r(i){if(t[i])return t[i].exports;var a=t[i]={i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},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 i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(i,a,function(t){return e[t]}.bind(null,a));return i},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){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addLinkAttributes",{enumerable:!0,get:function(){return i.addLinkAttributes}}),Object.defineProperty(t,"getFilenameFromUrl",{enumerable:!0,get:function(){return i.getFilenameFromUrl}}),Object.defineProperty(t,"LinkTarget",{enumerable:!0,get:function(){return i.LinkTarget}}),Object.defineProperty(t,"loadScript",{enumerable:!0,get:function(){return i.loadScript}}),Object.defineProperty(t,"PDFDateString",{enumerable:!0,get:function(){return i.PDFDateString}}),Object.defineProperty(t,"RenderingCancelledException",{enumerable:!0,get:function(){return i.RenderingCancelledException}}),Object.defineProperty(t,"build",{enumerable:!0,get:function(){return a.build}}),Object.defineProperty(t,"getDocument",{enumerable:!0,get:function(){return a.getDocument}}),Object.defineProperty(t,"LoopbackPort",{enumerable:!0,get:function(){return a.LoopbackPort}}),Object.defineProperty(t,"PDFDataRangeTransport",{enumerable:!0,get:function(){return a.PDFDataRangeTransport}}),Object.defineProperty(t,"PDFWorker",{enumerable:!0,get:function(){return a.PDFWorker}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return a.version}}),Object.defineProperty(t,"CMapCompressionType",{enumerable:!0,get:function(){return n.CMapCompressionType}}),Object.defineProperty(t,"createObjectURL",{enumerable:!0,get:function(){return n.createObjectURL}}),Object.defineProperty(t,"createPromiseCapability",{enumerable:!0,get:function(){return n.createPromiseCapability}}),Object.defineProperty(t,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return n.createValidAbsoluteUrl}}),Object.defineProperty(t,"InvalidPDFException",{enumerable:!0,get:function(){return n.InvalidPDFException}}),Object.defineProperty(t,"MissingPDFException",{enumerable:!0,get:function(){return n.MissingPDFException}}),Object.defineProperty(t,"OPS",{enumerable:!0,get:function(){return n.OPS}}),Object.defineProperty(t,"PasswordResponses",{enumerable:!0,get:function(){return n.PasswordResponses}}),Object.defineProperty(t,"PermissionFlag",{enumerable:!0,get:function(){return n.PermissionFlag}}),Object.defineProperty(t,"removeNullCharacters",{enumerable:!0,get:function(){return n.removeNullCharacters}}),Object.defineProperty(t,"shadow",{enumerable:!0,get:function(){return n.shadow}}),Object.defineProperty(t,"UnexpectedResponseException",{enumerable:!0,get:function(){return n.UnexpectedResponseException}}),Object.defineProperty(t,"UNSUPPORTED_FEATURES",{enumerable:!0,get:function(){return n.UNSUPPORTED_FEATURES}}),Object.defineProperty(t,"Util",{enumerable:!0,get:function(){return n.Util}}),Object.defineProperty(t,"VerbosityLevel",{enumerable:!0,get:function(){return n.VerbosityLevel}}),Object.defineProperty(t,"AnnotationLayer",{enumerable:!0,get:function(){return s.AnnotationLayer}}),Object.defineProperty(t,"apiCompatibilityParams",{enumerable:!0,get:function(){return o.apiCompatibilityParams}}),Object.defineProperty(t,"GlobalWorkerOptions",{enumerable:!0,get:function(){return l.GlobalWorkerOptions}}),Object.defineProperty(t,"renderTextLayer",{enumerable:!0,get:function(){return c.renderTextLayer}}),Object.defineProperty(t,"SVGGraphics",{enumerable:!0,get:function(){return u.SVGGraphics}});var i=r(1),a=r(5),n=r(2),s=r(16),o=r(7),l=r(10),c=r(17),u=r(18);{const{isNodeJS:e}=r(4);if(e){const e=r(19).PDFNodeStream;(0,a.setPDFNetworkStreamFactory)((t=>new e(t)))}else{const e=r(22).PDFNetworkStream;let t;(0,i.isFetchSupported)()&&(t=r(23).PDFFetchStream),(0,a.setPDFNetworkStreamFactory)((r=>t&&(0,i.isValidFetchUrl)(r.url)?new t(r):new e(r)))}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addLinkAttributes=function(e,{url:t,target:r,rel:n,enabled:s=!0}={}){(0,i.assert)(t&&"string"==typeof t,'addLinkAttributes: A valid "url" parameter must provided.');const o=(0,i.removeNullCharacters)(t);s?e.href=e.title=o:(e.href="",e.title=`Disabled: ${o}`,e.onclick=()=>!1);let c="";switch(r){case l.NONE:break;case l.SELF:c="_self";break;case l.BLANK:c="_blank";break;case l.PARENT:c="_parent";break;case l.TOP:c="_top"}e.target=c,e.rel="string"==typeof n?n:a},t.getFilenameFromUrl=function(e){const t=e.indexOf("#"),r=e.indexOf("?"),i=Math.min(t>0?t:e.length,r>0?r:e.length);return e.substring(e.lastIndexOf("/",i)+1,i)},t.isFetchSupported=c,t.isValidFetchUrl=u,t.loadScript=function(e){return new Promise(((t,r)=>{const i=document.createElement("script");i.src=e,i.onload=t,i.onerror=function(){r(new Error(`Cannot load script at: ${i.src}`))},(document.head||document.documentElement).appendChild(i)}))},t.deprecated=function(e){console.log("Deprecated API usage: "+e)},t.PDFDateString=t.StatTimer=t.DOMSVGFactory=t.DOMCMapReaderFactory=t.DOMCanvasFactory=t.DEFAULT_LINK_REL=t.LinkTarget=t.RenderingCancelledException=t.PageViewport=void 0;var i=r(2);const a="noopener noreferrer nofollow";t.DEFAULT_LINK_REL=a;const n="http://www.w3.org/2000/svg";t.DOMCanvasFactory=class{create(e,t){if(e<=0||t<=0)throw new Error("Invalid canvas size");const r=document.createElement("canvas"),i=r.getContext("2d");return r.width=e,r.height=t,{canvas:r,context:i}}reset(e,t,r){if(!e.canvas)throw new Error("Canvas is not specified");if(t<=0||r<=0)throw new Error("Invalid canvas size");e.canvas.width=t,e.canvas.height=r}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}},t.DOMCMapReaderFactory=class{constructor({baseUrl:e=null,isCompressed:t=!1}){this.baseUrl=e,this.isCompressed=t}async fetch({name:e}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!e)throw new Error("CMap name must be specified.");const t=this.baseUrl+e+(this.isCompressed?".bcmap":""),r=this.isCompressed?i.CMapCompressionType.BINARY:i.CMapCompressionType.NONE;return c()&&u(t,document.baseURI)?fetch(t).then((async e=>{if(!e.ok)throw new Error(e.statusText);let t;return t=this.isCompressed?new Uint8Array(await e.arrayBuffer()):(0,i.stringToBytes)(await e.text()),{cMapData:t,compressionType:r}})).catch((e=>{throw new Error("Unable to load "+(this.isCompressed?"binary ":"")+`CMap at: ${t}`)})):new Promise(((e,a)=>{const n=new XMLHttpRequest;n.open("GET",t,!0),this.isCompressed&&(n.responseType="arraybuffer"),n.onreadystatechange=()=>{if(n.readyState===XMLHttpRequest.DONE){if(200===n.status||0===n.status){let t;if(this.isCompressed&&n.response?t=new Uint8Array(n.response):!this.isCompressed&&n.responseText&&(t=(0,i.stringToBytes)(n.responseText)),t)return void e({cMapData:t,compressionType:r})}a(new Error(n.statusText))}},n.send(null)})).catch((e=>{throw new Error("Unable to load "+(this.isCompressed?"binary ":"")+`CMap at: ${t}`)}))}},t.DOMSVGFactory=class{create(e,t){(0,i.assert)(e>0&&t>0,"Invalid SVG dimensions");const r=document.createElementNS(n,"svg:svg");return r.setAttribute("version","1.1"),r.setAttribute("width",e+"px"),r.setAttribute("height",t+"px"),r.setAttribute("preserveAspectRatio","none"),r.setAttribute("viewBox","0 0 "+e+" "+t),r}createElement(e){return(0,i.assert)("string"==typeof e,"Invalid SVG element type"),document.createElementNS(n,e)}};class s{constructor({viewBox:e,scale:t,rotation:r,offsetX:i=0,offsetY:a=0,dontFlip:n=!1}){this.viewBox=e,this.scale=t,this.rotation=r,this.offsetX=i,this.offsetY=a;const s=(e[2]+e[0])/2,o=(e[3]+e[1])/2;let l,c,u,d,h,f,p,g;switch(r=(r%=360)<0?r+360:r){case 180:l=-1,c=0,u=0,d=1;break;case 90:l=0,c=1,u=1,d=0;break;case 270:l=0,c=-1,u=-1,d=0;break;case 0:l=1,c=0,u=0,d=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}n&&(u=-u,d=-d),0===l?(h=Math.abs(o-e[1])*t+i,f=Math.abs(s-e[0])*t+a,p=Math.abs(e[3]-e[1])*t,g=Math.abs(e[2]-e[0])*t):(h=Math.abs(s-e[0])*t+i,f=Math.abs(o-e[1])*t+a,p=Math.abs(e[2]-e[0])*t,g=Math.abs(e[3]-e[1])*t),this.transform=[l*t,c*t,u*t,d*t,h-l*t*s-u*t*o,f-c*t*s-d*t*o],this.width=p,this.height=g}clone({scale:e=this.scale,rotation:t=this.rotation,offsetX:r=this.offsetX,offsetY:i=this.offsetY,dontFlip:a=!1}={}){return new s({viewBox:this.viewBox.slice(),scale:e,rotation:t,offsetX:r,offsetY:i,dontFlip:a})}convertToViewportPoint(e,t){return i.Util.applyTransform([e,t],this.transform)}convertToViewportRectangle(e){const t=i.Util.applyTransform([e[0],e[1]],this.transform),r=i.Util.applyTransform([e[2],e[3]],this.transform);return[t[0],t[1],r[0],r[1]]}convertToPdfPoint(e,t){return i.Util.applyInverseTransform([e,t],this.transform)}}t.PageViewport=s;class o extends i.BaseException{constructor(e,t){super(e),this.type=t}}t.RenderingCancelledException=o;const l={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};function c(){return"undefined"!=typeof fetch&&"undefined"!=typeof Response&&"body"in Response.prototype&&"undefined"!=typeof ReadableStream}function u(e,t){try{const{protocol:r}=t?new URL(e,t):new URL(e);return"http:"===r||"https:"===r}catch(e){return!1}}let d;t.LinkTarget=l,t.StatTimer=class{constructor(){this.started=Object.create(null),this.times=[]}time(e){e in this.started&&(0,i.warn)(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||(0,i.warn)(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){const e=[];let t=0;for(const e of this.times){const r=e.name;r.length>t&&(t=r.length)}for(const r of this.times){const i=r.end-r.start;e.push(`${r.name.padEnd(t)} ${i}ms\n`)}return e.join("")}},t.PDFDateString=class{static toDateObject(e){if(!e||!(0,i.isString)(e))return null;d||(d=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const t=d.exec(e);if(!t)return null;const r=parseInt(t[1],10);let a=parseInt(t[2],10);a=a>=1&&a<=12?a-1:0;let n=parseInt(t[3],10);n=n>=1&&n<=31?n:1;let s=parseInt(t[4],10);s=s>=0&&s<=23?s:0;let o=parseInt(t[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(t[6],10);l=l>=0&&l<=59?l:0;const c=t[7]||"Z";let u=parseInt(t[8],10);u=u>=0&&u<=23?u:0;let h=parseInt(t[9],10)||0;return h=h>=0&&h<=59?h:0,"-"===c?(s+=u,o+=h):"+"===c&&(s-=u,o-=h),new Date(Date.UTC(r,a,n,s,o,l))}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayByteLength=h,t.arraysToBytes=function(e){const t=e.length;if(1===t&&e[0]instanceof Uint8Array)return e[0];let r=0;for(let i=0;it}),e.promise=new Promise((function(r,i){e.resolve=function(e){t=!0,r(e)},e.reject=function(e){t=!0,i(e)}})),e},t.getVerbosityLevel=function(){return a},t.info=function(e){a>=i.INFOS&&console.log(`Info: ${e}`)},t.isArrayBuffer=function(e){return"object"==typeof 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(const 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){let r;try{if(r=new URL(e),!r.origin||"null"===r.origin)return!1}catch(e){return!1}const i=new URL(t,r);return r.origin===i.origin},t.createValidAbsoluteUrl=function(e,t){if(!e)return null;try{const 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?(n("The argument for removeNullCharacters must be a string."),e):e.replace(u,"")},t.setVerbosityLevel=function(e){Number.isInteger(e)&&(a=e)},t.shadow=l,t.string32=function(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)},t.stringToBytes=d,t.stringToPDFString=function(e){const t=e.length,r=[];if("þ"===e[0]&&"ÿ"===e[1])for(let i=2;i=i.WARNINGS&&console.log(`Warning: ${e}`)}function s(e){throw new Error(e)}function o(e,t){e||s(t)}function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!1}),r}const c=function(){function e(t){this.constructor===e&&s("Cannot initialize BaseException."),this.message=t,this.name=this.constructor.name}return e.prototype=new Error,e.constructor=e,e}();t.BaseException=c,t.PasswordException=class extends c{constructor(e,t){super(e),this.code=t}},t.UnknownErrorException=class extends c{constructor(e,t){super(e),this.details=t}},t.InvalidPDFException=class extends c{},t.MissingPDFException=class extends c{},t.UnexpectedResponseException=class extends c{constructor(e,t){super(e),this.status=t}},t.FormatError=class extends c{},t.AbortException=class extends c{};const u=/\x00/g;function d(e){o("string"==typeof e,"Invalid argument for stringToBytes");const t=e.length,r=new Uint8Array(t);for(let i=0;ie[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){function r(e,t){return e-t}const i=[e[0],e[2],t[0],t[2]].sort(r),a=[e[1],e[3],t[1],t[3]].sort(r),n=[];return e=m.normalizeRect(e),t=m.normalizeRect(t),i[0]===e[0]&&i[1]===t[0]||i[0]===t[0]&&i[1]===e[0]?(n[0]=i[1],n[2]=i[2],a[0]===e[1]&&a[1]===t[1]||a[0]===t[1]&&a[1]===e[1]?(n[1]=a[1],n[3]=a[2],n):null):null}}t.Util=m;const b=[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],v=function(){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return function(t,r,i=!1){if(!i&&URL.createObjectURL){const e=new Blob([t],{type:r});return URL.createObjectURL(e)}let a=`data:${r};base64,`;for(let r=0,i=t.length;r>2]+e[(3&n)<<4|s>>4]+e[r+1>6:64]+e[r+2{this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}))}}}();class PDFDataRangeTransport{constructor(e,t,r=!1){this.length=e,this.initialData=t,this.progressiveDone=r,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=(0,_util.createPromiseCapability)()}addRangeListener(e){this._rangeListeners.push(e)}addProgressListener(e){this._progressListeners.push(e)}addProgressiveReadListener(e){this._progressiveReadListeners.push(e)}addProgressiveDoneListener(e){this._progressiveDoneListeners.push(e)}onDataRange(e,t){for(const r of this._rangeListeners)r(e,t)}onDataProgress(e,t){this._readyCapability.promise.then((()=>{for(const r of this._progressListeners)r(e,t)}))}onDataProgressiveRead(e){this._readyCapability.promise.then((()=>{for(const t of this._progressiveReadListeners)t(e)}))}onDataProgressiveDone(){this._readyCapability.promise.then((()=>{for(const e of this._progressiveDoneListeners)e()}))}transportReady(){this._readyCapability.resolve()}requestDataRange(e,t){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(e,t){this._pdfInfo=e,this._transport=t}get numPages(){return this._pdfInfo.numPages}get fingerprint(){return this._pdfInfo.fingerprint}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getOpenActionDestination(){return(0,_display_utils.deprecated)("getOpenActionDestination, use getOpenAction instead."),this.getOpenAction().then((function(e){return e&&e.dest?e.dest:null}))}getAttachments(){return this._transport.getAttachments()}getJavaScript(){return this._transport.getJavaScript()}getOutline(){return this._transport.getOutline()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getData(){return this._transport.getData()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}getStats(){return this._transport.getStats()}cleanup(){return this._transport.startCleanup()}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(e,t,r,i=!1){this._pageIndex=e,this._pageInfo=t,this._transport=r,this._stats=i?new _display_utils.StatTimer:null,this._pdfBug=i,this.commonObjs=r.commonObjs,this.objs=new PDFObjects,this.cleanupAfterRender=!1,this.pendingCleanup=!1,this.intentStates=Object.create(null),this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:e,rotation:t=this.rotate,offsetX:r=0,offsetY:i=0,dontFlip:a=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:e,rotation:t,offsetX:r,offsetY:i,dontFlip:a})}getAnnotations({intent:e=null}={}){return this.annotationsPromise&&this.annotationsIntent===e||(this.annotationsPromise=this._transport.getAnnotations(this._pageIndex,e),this.annotationsIntent=e),this.annotationsPromise}render({canvasContext:e,viewport:t,intent:r="display",enableWebGL:i=!1,renderInteractiveForms:a=!1,transform:n=null,imageLayer:s=null,canvasFactory:o=null,background:l=null}){this._stats&&this._stats.time("Overall");const c="print"===r?"print":"display";this.pendingCleanup=!1,this.intentStates[c]||(this.intentStates[c]=Object.create(null));const u=this.intentStates[c];u.streamReaderCancelTimeout&&(clearTimeout(u.streamReaderCancelTimeout),u.streamReaderCancelTimeout=null);const d=o||new _display_utils.DOMCanvasFactory,h=new _webgl.WebGLContext({enable:i});u.displayReadyCapability||(u.displayReadyCapability=(0,_util.createPromiseCapability)(),u.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList({pageIndex:this._pageIndex,intent:c,renderInteractiveForms:!0===a}));const f=e=>{const t=u.renderTasks.indexOf(p);t>=0&&u.renderTasks.splice(t,1),(this.cleanupAfterRender||"print"===c)&&(this.pendingCleanup=!0),this._tryCleanup(),e?(p.capability.reject(e),this._abortOperatorList({intentState:u,reason:e})):p.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"))},p=new InternalRenderTask({callback:f,params:{canvasContext:e,viewport:t,transform:n,imageLayer:s,background:l},objs:this.objs,commonObjs:this.commonObjs,operatorList:u.operatorList,pageIndex:this._pageIndex,canvasFactory:d,webGLContext:h,useRequestAnimationFrame:"print"!==c,pdfBug:this._pdfBug});u.renderTasks||(u.renderTasks=[]),u.renderTasks.push(p);const g=p.task;return u.displayReadyCapability.promise.then((e=>{this.pendingCleanup?f():(this._stats&&this._stats.time("Rendering"),p.initializeGraphics(e),p.operatorListChanged())})).catch(f),g}getOperatorList(){const e="oplist";this.intentStates.oplist||(this.intentStates.oplist=Object.create(null));const t=this.intentStates.oplist;let r;return t.opListReadCapability||(r={},r.operatorListChanged=function(){if(t.operatorList.lastChunk){t.opListReadCapability.resolve(t.operatorList);const e=t.renderTasks.indexOf(r);e>=0&&t.renderTasks.splice(e,1)}},t.opListReadCapability=(0,_util.createPromiseCapability)(),t.renderTasks=[],t.renderTasks.push(r),t.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList({pageIndex:this._pageIndex,intent:e})),t.opListReadCapability.promise}streamTextContent({normalizeWhitespace:e=!1,disableCombineTextItems:t=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,normalizeWhitespace:!0===e,combineTextItems:!0!==t},{highWaterMark:100,size:e=>e.items.length})}getTextContent(e={}){const t=this.streamTextContent(e);return new Promise((function(e,r){const i=t.getReader(),a={items:[],styles:Object.create(null)};!function t(){i.read().then((function({value:r,done:i}){i?e(a):(Object.assign(a.styles,r.styles),a.items.push(...r.items),t())}),r)}()}))}_destroy(){this.destroyed=!0,this._transport.pageCache[this._pageIndex]=null;const e=[];return Object.keys(this.intentStates).forEach((t=>{const r=this.intentStates[t];this._abortOperatorList({intentState:r,reason:new Error("Page was destroyed."),force:!0}),"oplist"!==t&&r.renderTasks.forEach((function(t){const r=t.capability.promise.catch((function(){}));e.push(r),t.cancel()}))})),this.objs.clear(),this.annotationsPromise=null,this.pendingCleanup=!1,Promise.all(e)}cleanup(e=!1){return this.pendingCleanup=!0,this._tryCleanup(e)}_tryCleanup(e=!1){return!(!this.pendingCleanup||Object.keys(this.intentStates).some((e=>{const t=this.intentStates[e];return 0!==t.renderTasks.length||!t.operatorList.lastChunk}))||(Object.keys(this.intentStates).forEach((e=>{delete this.intentStates[e]})),this.objs.clear(),this.annotationsPromise=null,e&&this._stats&&(this._stats=new _display_utils.StatTimer),this.pendingCleanup=!1,0))}_startRenderPage(e,t){const r=this.intentStates[t];r&&(this._stats&&this._stats.timeEnd("Page Request"),r.displayReadyCapability&&r.displayReadyCapability.resolve(e))}_renderPageChunk(e,t){for(let r=0,i=e.length;r{t.read().then((({value:e,done:t})=>{t?r.streamReader=null:this._transport.destroyed||(this._renderPageChunk(e,r),i())}),(e=>{if(r.streamReader=null,!this._transport.destroyed){if(r.operatorList){r.operatorList.lastChunk=!0;for(let e=0;e{this._abortOperatorList({intentState:e,reason:t,force:!0}),e.streamReaderCancelTimeout=null}),RENDERING_CANCELLED_TIMEOUT))}e.streamReader.cancel(new _util.AbortException(t&&t.message)),e.streamReader=null,this._transport.destroyed||(Object.keys(this.intentStates).some((t=>this.intentStates[t]===e&&(delete this.intentStates[t],!0))),this.cleanup())}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(e=!0){this._listeners=[],this._defer=e,this._deferred=Promise.resolve(void 0)}postMessage(e,t){if(!this._defer)return void this._listeners.forEach((t=>{t.call(this,{data:e})}));const r=new WeakMap,i={data:function e(i){if("object"!=typeof i||null===i)return i;if(r.has(i))return r.get(i);let a,n;if((a=i.buffer)&&(0,_util.isArrayBuffer)(a))return n=t&&t.includes(a)?new i.constructor(a,i.byteOffset,i.byteLength):new i.constructor(i),r.set(i,n),n;n=Array.isArray(i)?[]:{},r.set(i,n);for(const t in i){let r,a=i;for(;!(r=Object.getOwnPropertyDescriptor(a,t));)a=Object.getPrototypeOf(a);if(void 0!==r.value)if("function"!=typeof r.value)n[t]=e(r.value);else if(i.hasOwnProperty&&i.hasOwnProperty(t))throw new Error(`LoopbackPort.postMessage - cannot clone: ${i[t]}`)}return n}(e)};this._deferred.then((()=>{this._listeners.forEach((e=>{e.call(this,i)}))}))}addEventListener(e,t){this._listeners.push(t)}removeEventListener(e,t){const r=this._listeners.indexOf(t);this._listeners.splice(r,1)}terminate(){this._listeners.length=0}}exports.LoopbackPort=LoopbackPort;const PDFWorker=function PDFWorkerClosure(){const pdfWorkerPorts=new WeakMap;let isWorkerDisabled=!1,fallbackWorkerSrc,nextFakeWorkerId=0,fakeWorkerCapability;if(_is_node.isNodeJS)isWorkerDisabled=!0,fallbackWorkerSrc="./pdf.worker.js";else if("object"==typeof document&&"currentScript"in document){const e=document.currentScript&&document.currentScript.src;e&&(fallbackWorkerSrc=e.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}function getWorkerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(void 0!==fallbackWorkerSrc)return _is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}function getMainThreadWorkerMessageHandler(){let e;try{e=globalThis.pdfjsWorker&&globalThis.pdfjsWorker.WorkerMessageHandler}catch(e){}return e||null}function setupFakeWorkerGlobal(){if(fakeWorkerCapability)return fakeWorkerCapability.promise;fakeWorkerCapability=(0,_util.createPromiseCapability)();const loader=async function(){const mainWorkerMessageHandler=getMainThreadWorkerMessageHandler();if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node.isNodeJS){const worker=eval("require")(getWorkerSrc());return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(getWorkerSrc()),window.pdfjsWorker.WorkerMessageHandler};return loader().then(fakeWorkerCapability.resolve,fakeWorkerCapability.reject),fakeWorkerCapability.promise}function createCDNWrapper(e){const t="importScripts('"+e+"');";return URL.createObjectURL(new Blob([t]))}class PDFWorker{constructor({name:e=null,port:t=null,verbosity:r=(0,_util.getVerbosityLevel)()}={}){if(t&&pdfWorkerPorts.has(t))throw new Error("Cannot use more than one PDFWorker per port");if(this.name=e,this.destroyed=!1,this.postMessageTransfers=!0,this.verbosity=r,this._readyCapability=(0,_util.createPromiseCapability)(),this._port=null,this._webWorker=null,this._messageHandler=null,t)return pdfWorkerPorts.set(t,this),void this._initializeFromPort(t);this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(e){this._port=e,this._messageHandler=new _message_handler.MessageHandler("main","worker",e),this._messageHandler.on("ready",(function(){})),this._readyCapability.resolve()}_initialize(){if("undefined"!=typeof Worker&&!isWorkerDisabled&&!getMainThreadWorkerMessageHandler()){let e=getWorkerSrc();try{(0,_util.isSameOrigin)(window.location.href,e)||(e=createCDNWrapper(new URL(e,window.location).href));const t=new Worker(e),r=new _message_handler.MessageHandler("main","worker",t),i=()=>{t.removeEventListener("error",a),r.destroy(),t.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},a=()=>{this._webWorker||i()};t.addEventListener("error",a),r.on("test",(e=>{t.removeEventListener("error",a),this.destroyed?i():e?(this._messageHandler=r,this._port=t,this._webWorker=t,e.supportTransfers||(this.postMessageTransfers=!1),this._readyCapability.resolve(),r.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),r.destroy(),t.terminate())})),r.on("ready",(e=>{if(t.removeEventListener("error",a),this.destroyed)i();else try{n()}catch(e){this._setupFakeWorker()}}));const n=()=>{const e=new Uint8Array([this.postMessageTransfers?255:0]);try{r.send("test",e,[e.buffer])}catch(t){(0,_util.warn)("Cannot use postMessage transfers."),e[0]=0,r.send("test",e)}};return void n()}catch(e){(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),isWorkerDisabled=!0),setupFakeWorkerGlobal().then((e=>{if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));const t=new LoopbackPort;this._port=t;const r="fake"+nextFakeWorkerId++,i=new _message_handler.MessageHandler(r+"_worker",r,t);e.setup(i,t);const a=new _message_handler.MessageHandler(r,r+"_worker",t);this._messageHandler=a,this._readyCapability.resolve(),a.send("configure",{verbosity:this.verbosity})})).catch((e=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${e.message}".`))}))}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),pdfWorkerPorts.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(e){if(!e||!e.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return pdfWorkerPorts.has(e.port)?pdfWorkerPorts.get(e.port):new PDFWorker(e)}static getWorkerSrc(){return getWorkerSrc()}}return PDFWorker}();exports.PDFWorker=PDFWorker;class WorkerTransport{constructor(e,t,r,i){this.messageHandler=e,this.loadingTask=t,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({docId:t.docId,onUnsupportedFeature:this._onUnsupportedFeature.bind(this)}),this._params=i,this.CMapReaderFactory=new i.CMapReaderFactory({baseUrl:i.cMapUrl,isCompressed:i.cMapPacked}),this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this._networkStream=r,this._fullReader=null,this._lastProgress=null,this.pageCache=[],this.pagePromises=[],this.downloadInfoCapability=(0,_util.createPromiseCapability)(),this.setupMessageHandler()}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=(0,_util.createPromiseCapability)(),this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];this.pageCache.forEach((function(t){t&&e.push(t._destroy())})),this.pageCache.length=0,this.pagePromises.length=0;const t=this.messageHandler.sendWithPromise("Terminate",null);return e.push(t),Promise.all(e).then((()=>{this.fontLoader.clear(),this._networkStream&&this._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()}),this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:t}=this;e.on("GetReader",((e,t)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=e=>{this._lastProgress={loaded:e.loaded,total:e.total}},t.onPull=()=>{this._fullReader.read().then((function({value:e,done:r}){r?t.close():((0,_util.assert)((0,_util.isArrayBuffer)(e),"GetReader - expected an ArrayBuffer."),t.enqueue(new Uint8Array(e),1,[e]))})).catch((e=>{t.error(e)}))},t.onCancel=e=>{this._fullReader.cancel(e)}})),e.on("ReaderHeadersReady",(e=>{const r=(0,_util.createPromiseCapability)(),i=this._fullReader;return i.headersReady.then((()=>{i.isStreamingSupported&&i.isRangeSupported||(this._lastProgress&&t.onProgress&&t.onProgress(this._lastProgress),i.onProgress=e=>{t.onProgress&&t.onProgress({loaded:e.loaded,total:e.total})}),r.resolve({isStreamingSupported:i.isStreamingSupported,isRangeSupported:i.isRangeSupported,contentLength:i.contentLength})}),r.reject),r.promise})),e.on("GetRangeReader",((e,t)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const r=this._networkStream.getRangeReader(e.begin,e.end);r?(t.onPull=()=>{r.read().then((function({value:e,done:r}){r?t.close():((0,_util.assert)((0,_util.isArrayBuffer)(e),"GetRangeReader - expected an ArrayBuffer."),t.enqueue(new Uint8Array(e),1,[e]))})).catch((e=>{t.error(e)}))},t.onCancel=e=>{r.cancel(e)}):t.close()})),e.on("GetDoc",(({pdfInfo:e})=>{this._numPages=e.numPages,t._capability.resolve(new PDFDocumentProxy(e,this))})),e.on("DocException",(function(e){let r;switch(e.name){case"PasswordException":r=new _util.PasswordException(e.message,e.code);break;case"InvalidPDFException":r=new _util.InvalidPDFException(e.message);break;case"MissingPDFException":r=new _util.MissingPDFException(e.message);break;case"UnexpectedResponseException":r=new _util.UnexpectedResponseException(e.message,e.status);break;case"UnknownErrorException":r=new _util.UnknownErrorException(e.message,e.details)}t._capability.reject(r)})),e.on("PasswordRequest",(e=>{if(this._passwordCapability=(0,_util.createPromiseCapability)(),t.onPassword){const r=e=>{this._passwordCapability.resolve({password:e})};try{t.onPassword(r,e.code)}catch(e){this._passwordCapability.reject(e)}}else this._passwordCapability.reject(new _util.PasswordException(e.message,e.code));return this._passwordCapability.promise})),e.on("DataLoaded",(e=>{t.onProgress&&t.onProgress({loaded:e.length,total:e.length}),this.downloadInfoCapability.resolve(e)})),e.on("StartRenderPage",(e=>{this.destroyed||this.pageCache[e.pageIndex]._startRenderPage(e.transparency,e.intent)})),e.on("commonobj",(t=>{if(this.destroyed)return;const[r,i,a]=t;if(!this.commonObjs.has(r))switch(i){case"Font":const t=this._params;if("error"in a){const e=a.error;(0,_util.warn)(`Error during font loading: ${e}`),this.commonObjs.resolve(r,e);break}let n=null;t.pdfBug&&globalThis.FontInspector&&globalThis.FontInspector.enabled&&(n={registerFont(e,t){globalThis.FontInspector.fontAdded(e,t)}});const s=new _font_loader.FontFaceObject(a,{isEvalSupported:t.isEvalSupported,disableFontFace:t.disableFontFace,ignoreErrors:t.ignoreErrors,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),fontRegistry:n});this.fontLoader.bind(s).catch((t=>e.sendWithPromise("FontFallback",{id:r}))).finally((()=>{!t.fontExtraProperties&&s.data&&(s.data=null),this.commonObjs.resolve(r,s)}));break;case"FontPath":case"FontType3Res":case"Image":this.commonObjs.resolve(r,a);break;default:throw new Error(`Got unknown common object type ${i}`)}})),e.on("obj",(e=>{if(this.destroyed)return;const[t,r,i,a]=e,n=this.pageCache[r];if(!n.objs.has(t)){if("Image"!==i)throw new Error(`Got unknown object type ${i}`);{n.objs.resolve(t,a);const e=8e6;a&&"data"in a&&a.data.length>e&&(n.cleanupAfterRender=!0)}}})),e.on("DocProgress",(e=>{this.destroyed||t.onProgress&&t.onProgress({loaded:e.loaded,total:e.total})})),e.on("UnsupportedFeature",this._onUnsupportedFeature.bind(this)),e.on("FetchBuiltInCMap",((e,t)=>{if(this.destroyed)return void t.error(new Error("Worker was destroyed"));let r=!1;t.onPull=()=>{r?t.close():(r=!0,this.CMapReaderFactory.fetch(e).then((function(e){t.enqueue(e,1,[e.cMapData.buffer])})).catch((function(e){t.error(e)})))}}))}_onUnsupportedFeature({featureId:e}){this.destroyed||this.loadingTask.onUnsupportedFeature&&this.loadingTask.onUnsupportedFeature(e)}getData(){return this.messageHandler.sendWithPromise("GetData",null)}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request"));const t=e-1;if(t in this.pagePromises)return this.pagePromises[t];const r=this.messageHandler.sendWithPromise("GetPage",{pageIndex:t}).then((e=>{if(this.destroyed)throw new Error("Transport destroyed");const r=new PDFPageProxy(t,e,this,this._params.pdfBug);return this.pageCache[t]=r,r}));return this.pagePromises[t]=r,r}getPageIndex(e){return this.messageHandler.sendWithPromise("GetPageIndex",{ref:e}).catch((function(e){return Promise.reject(new Error(e))}))}getAnnotations(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:t})}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return"string"!=typeof e?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getJavaScript(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){return this.messageHandler.sendWithPromise("GetMetadata",null).then((e=>({info:e[0],metadata:e[1]?new _metadata.Metadata(e[1]):null,contentDispositionFilename:this._fullReader?this._fullReader.filename:null})))}getStats(){return this.messageHandler.sendWithPromise("GetStats",null)}startCleanup(){return this.messageHandler.sendWithPromise("Cleanup",null).then((()=>{for(let e=0,t=this.pageCache.length;e{this._nextBound().catch(this.cancel.bind(this))})):Promise.resolve().then(this._nextBound).catch(this.cancel.bind(this))}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),this._canvas&&e.delete(this._canvas),this.callback())))}}}(),version="2.5.207";exports.version=version;const build="0974d605";exports.build=build},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FontLoader=t.FontFaceObject=void 0;var i=r(2);class a{constructor({docId:e,onUnsupportedFeature:t}){this.constructor===a&&(0,i.unreachable)("Cannot initialize BaseFontLoader."),this.docId=e,this._onUnsupportedFeature=t,this.nativeFontFaces=[],this.styleElement=null}addNativeFontFace(e){this.nativeFontFaces.push(e),document.fonts.add(e)}insertRule(e){let t=this.styleElement;t||(t=this.styleElement=document.createElement("style"),t.id=`PDFJS_FONT_STYLE_TAG_${this.docId}`,document.documentElement.getElementsByTagName("head")[0].appendChild(t));const r=t.sheet;r.insertRule(e,r.cssRules.length)}clear(){this.nativeFontFaces.forEach((function(e){document.fonts.delete(e)})),this.nativeFontFaces.length=0,this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async bind(e){if(e.attached||e.missingFile)return;if(e.attached=!0,this.isFontLoadingAPISupported){const t=e.createNativeFontFace();if(t){this.addNativeFontFace(t);try{await t.loaded}catch(r){throw this._onUnsupportedFeature({featureId:i.UNSUPPORTED_FEATURES.errorFontLoadNative}),(0,i.warn)(`Failed to load font '${t.family}': '${r}'.`),e.disableFontFace=!0,r}}return}const t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise((r=>{const i=this._queueLoadingCallback(r);this._prepareFontLoadEvent([t],[e],i)}))}}_queueLoadingCallback(e){(0,i.unreachable)("Abstract method `_queueLoadingCallback`.")}get isFontLoadingAPISupported(){const e="undefined"!=typeof document&&!!document.fonts;return(0,i.shadow)(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){(0,i.unreachable)("Abstract method `isSyncFontLoadingSupported`.")}get _loadTestFont(){(0,i.unreachable)("Abstract method `_loadTestFont`.")}_prepareFontLoadEvent(e,t,r){(0,i.unreachable)("Abstract method `_prepareFontLoadEvent`.")}}let n;t.FontLoader=n,t.FontLoader=n=class extends a{constructor(e){super(e),this.loadingContext={requests:[],nextRequestId:0},this.loadTestFontId=0}get isSyncFontLoadingSupported(){let e=!1;if("undefined"==typeof navigator)e=!0;else{const t=/Mozilla\/5.0.*?rv:(\d+).*? Gecko/.exec(navigator.userAgent);t&&t[1]>=14&&(e=!0)}return(0,i.shadow)(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(e){const t=this.loadingContext,r={id:"pdfjs-font-loading-"+t.nextRequestId++,done:!1,complete:function(){for((0,i.assert)(!r.done,"completeRequest() cannot be called twice."),r.done=!0;t.requests.length>0&&t.requests[0].done;){const e=t.requests.shift();setTimeout(e.callback,0)}},callback:e};return t.requests.push(r),r}get _loadTestFont(){return(0,i.shadow)(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}_prepareFontLoadEvent(e,t,r){function a(e,t){return e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|255&e.charCodeAt(t+3)}function n(e,t,r,i){return e.substring(0,t)+i+e.substring(t+r)}let s,o;const l=document.createElement("canvas");l.width=1,l.height=1;const c=l.getContext("2d");let u=0;const d=`lt${Date.now()}${this.loadTestFontId++}`;let h=this._loadTestFont;h=n(h,976,d.length,d);const f=1482184792;let p=a(h,16);for(s=0,o=d.length-3;s30)return(0,i.warn)("Load test font never loaded."),void r();c.font="30px "+t,c.fillText(".",0,20),c.getImageData(0,0,1,1).data[3]>0?r():setTimeout(e.bind(null,t,r))}(d,(function(){document.body.removeChild(b),r.complete()}))}},t.FontFaceObject=class{constructor(e,{isEvalSupported:t=!0,disableFontFace:r=!1,ignoreErrors:i=!1,onUnsupportedFeature:a=null,fontRegistry:n=null}){this.compiledGlyphs=Object.create(null);for(const t in e)this[t]=e[t];this.isEvalSupported=!1!==t,this.disableFontFace=!0===r,this.ignoreErrors=!0===i,this._onUnsupportedFeature=a,this.fontRegistry=n}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;const e=new FontFace(this.loadedName,this.data,{});return this.fontRegistry&&this.fontRegistry.registerFont(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const e=(0,i.bytesToString)(new Uint8Array(this.data)),t=`url(data:${this.mimetype};base64,${btoa(e)});`,r=`@font-face {font-family:"${this.loadedName}";src:${t}}`;return this.fontRegistry&&this.fontRegistry.registerFont(this,t),r}getPathGenerator(e,t){if(void 0!==this.compiledGlyphs[t])return this.compiledGlyphs[t];let r,a;try{r=e.get(this.loadedName+"_path_"+t)}catch(e){if(!this.ignoreErrors)throw e;return this._onUnsupportedFeature&&this._onUnsupportedFeature({featureId:i.UNSUPPORTED_FEATURES.errorFontGetPath}),(0,i.warn)(`getPathGenerator - ignoring character: "${e}".`),this.compiledGlyphs[t]=function(e,t){}}if(this.isEvalSupported&&i.IsEvalSupportedCached.value){let e,i="";for(let t=0,n=r.length;t>2),w=y.length,x=u+7>>3,k=4294967295,A=i.IsLittleEndianCached.value?4278190080:255;for(a=0;ax?u:8*_-7,P=-8&C,I=0,T=0;S>=1}for(;r=h&&(l=u*(s=d)),r=0,n=l;n--;)b[r++]=m[g++],b[r++]=m[g++],b[r++]=m[g++],b[r++]=255;e.putImageData(p,0,a*o)}}}}function r(e,t){for(var r=t.height,i=t.width,a=r%o,n=(r-a)/o,s=0===a?n:n+1,l=e.createImageData(i,o),c=0,u=t.data,d=l.data,h=0;h>=1}e.putImageData(l,0,h*o)}}function d(e,t){for(var r=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"],i=0,a=r.length;i>8,e[n-2]=e[n-2]*s+r*o>>8,e[n-1]=e[n-1]*s+i*o>>8}}}function p(e,t,r){for(var i=e.length,a=3;a>8]>>8:t[a]*n>>16}}function m(e,t,r,i){var a=t.canvas,n=t.context;e.setTransform(t.scaleX,0,0,t.scaleY,t.offsetX,t.offsetY);var s=t.backdrop||null;if(!t.transferMap&&i.isEnabled){const n=i.composeSMask({layer:r.canvas,mask:a,properties:{subtype:t.subtype,backdrop:s}});return e.setTransform(1,0,0,1,0,0),void e.drawImage(n,t.offsetX,t.offsetY)}!function(e,t,r,i,a,n,s){var o,l=!!n,c=l?n[0]:0,u=l?n[1]:0,d=l?n[2]:0;o="Luminosity"===a?g:p;for(var h=Math.min(i,Math.ceil(1048576/r)),m=0;m10&&"function"==typeof r,d=u?Date.now()+15:0,h=0,f=this.commonObjs,p=this.objs;;){if(void 0!==a&&o===a.nextBreakPoint)return a.breakIt(o,r),o;if((c=s[o])!==i.OPS.dependency)this[c].apply(this,n[o]);else for(const e of n[o]){const t=e.startsWith("g_")?f:p;if(!t.has(e))return t.get(e,r),o}if(++o===l)return o;if(u&&++h>10){if(Date.now()>d)return r(),o;h=0}}},endDrawing:function(){null!==this.current.activeSMask&&this.endSMaskGroup(),this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null),this.cachedCanvases.clear(),this.webGLContext.clear(),this.imageLayer&&this.imageLayer.endLayout()},setLineWidth:function(e){this.current.lineWidth=e,this.ctx.lineWidth=e},setLineCap:function(e){this.ctx.lineCap=b[e]},setLineJoin:function(e){this.ctx.lineJoin=v[e]},setMiterLimit:function(e){this.ctx.miterLimit=e},setDash:function(e,t){var r=this.ctx;void 0!==r.setLineDash&&(r.setLineDash(e),r.lineDashOffset=t)},setRenderingIntent(e){},setFlatness(e){},setGState:function(e){for(var t=0,r=e.length;t0&&this.stateStack[this.stateStack.length-1].activeSMask===this.current.activeSMask?this.suspendSMaskGroup():this.endSMaskGroup()),this.current.activeSMask=n?this.tempSMask:null,this.current.activeSMask&&this.beginSMaskGroup(),this.tempSMask=null}}},beginSMaskGroup:function(){var e=this.current.activeSMask,t=e.canvas.width,r=e.canvas.height,i="smaskGroupAt"+this.groupLevel,a=this.cachedCanvases.getCanvas(i,t,r,!0),n=this.ctx,s=n.mozCurrentTransform;this.ctx.save();var o=a.context;o.scale(1/e.scaleX,1/e.scaleY),o.translate(-e.offsetX,-e.offsetY),o.transform.apply(o,s),e.startTransformInverse=o.mozCurrentTransformInverse,d(n,o),this.ctx=o,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(n),this.groupLevel++},suspendSMaskGroup:function(){var e=this.ctx;this.groupLevel--,this.ctx=this.groupStack.pop(),m(this.ctx,this.current.activeSMask,e,this.webGLContext),this.ctx.restore(),this.ctx.save(),d(e,this.ctx),this.current.resumeSMaskCtx=e;var t=i.Util.transform(this.current.activeSMask.startTransformInverse,e.mozCurrentTransform);this.ctx.transform.apply(this.ctx,t),e.save(),e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,e.canvas.width,e.canvas.height),e.restore()},resumeSMaskGroup:function(){var e=this.current.resumeSMaskCtx,t=this.ctx;this.ctx=e,this.groupStack.push(t),this.groupLevel++},endSMaskGroup:function(){var e=this.ctx;this.groupLevel--,this.ctx=this.groupStack.pop(),m(this.ctx,this.current.activeSMask,e,this.webGLContext),this.ctx.restore(),d(e,this.ctx);var t=i.Util.transform(this.current.activeSMask.startTransformInverse,e.mozCurrentTransform);this.ctx.transform.apply(this.ctx,t)},save:function(){this.ctx.save();var e=this.current;this.stateStack.push(e),this.current=e.clone(),this.current.resumeSMaskCtx=null},restore:function(){this.current.resumeSMaskCtx&&this.resumeSMaskGroup(),null===this.current.activeSMask||0!==this.stateStack.length&&this.stateStack[this.stateStack.length-1].activeSMask===this.current.activeSMask||this.endSMaskGroup(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.ctx.restore(),this.pendingClip=null,this._cachedGetSinglePixelWidth=null)},transform:function(e,t,r,i,a,n){this.ctx.transform(e,t,r,i,a,n),this._cachedGetSinglePixelWidth=null},constructPath:function(e,t){for(var r=this.ctx,a=this.current,n=a.x,s=a.y,o=0,l=0,c=e.length;o100&&(c=100),this.current.fontSizeScale=t/c,this.ctx.font=`${o} ${s} ${c}px ${l}`},setTextRenderingMode:function(e){this.current.textRenderingMode=e},setTextRise:function(e){this.current.textRise=e},moveText:function(e,t){this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=t},setLeadingMoveText:function(e,t){this.setLeading(-t),this.moveText(e,t)},setTextMatrix:function(e,t,r,i,a,n){this.current.textMatrix=[e,t,r,i,a,n],this.current.textMatrixScale=Math.sqrt(e*e+t*t),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0},nextLine:function(){this.moveText(0,this.current.leading)},paintChar(e,t,r,a){var n=this.ctx,s=this.current,o=s.font,l=s.textRenderingMode,c=s.fontSize/s.fontSizeScale,u=l&i.TextRenderingMode.FILL_STROKE_MASK,d=!!(l&i.TextRenderingMode.ADD_TO_PATH_FLAG);const h=s.patternFill&&!o.missingFile;var f;(o.disableFontFace||d||h)&&(f=o.getPathGenerator(this.commonObjs,e)),o.disableFontFace||h?(n.save(),n.translate(t,r),n.beginPath(),f(n,c),a&&n.setTransform.apply(n,a),u!==i.TextRenderingMode.FILL&&u!==i.TextRenderingMode.FILL_STROKE||n.fill(),u!==i.TextRenderingMode.STROKE&&u!==i.TextRenderingMode.FILL_STROKE||n.stroke(),n.restore()):(u!==i.TextRenderingMode.FILL&&u!==i.TextRenderingMode.FILL_STROKE||n.fillText(e,t,r),u!==i.TextRenderingMode.STROKE&&u!==i.TextRenderingMode.FILL_STROKE||n.strokeText(e,t,r)),d&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:n.mozCurrentTransform,x:t,y:r,fontSize:c,addToPath:f})},get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);for(var t=e.getImageData(0,0,10,10).data,r=!1,a=3;a0&&t[a]<255){r=!0;break}return(0,i.shadow)(this,"isFontSubpixelAAEnabled",r)},showText:function(e){var t=this.current,r=t.font;if(r.isType3Font)return this.showType3Text(e);var a=t.fontSize;if(0===a)return;var n=this.ctx,o=t.fontSizeScale,l=t.charSpacing,c=t.wordSpacing,u=t.fontDirection,d=t.textHScale*u,h=e.length,f=r.vertical,p=f?1:-1,g=r.defaultVMetrics,m=a*t.fontMatrix[0],b=t.textRenderingMode===i.TextRenderingMode.FILL&&!r.disableFontFace&&!t.patternFill;let v;if(n.save(),t.patternFill){n.save();const e=t.fillColor.getPattern(n,this);v=n.mozCurrentTransform,n.restore(),n.fillStyle=e}n.transform.apply(n,t.textMatrix),n.translate(t.x,t.y+t.textRise),u>0?n.scale(d,-1):n.scale(d,1);var y=t.lineWidth,w=t.textMatrixScale;if(0===w||0===y){var x=t.textRenderingMode&i.TextRenderingMode.FILL_STROKE_MASK;x!==i.TextRenderingMode.STROKE&&x!==i.TextRenderingMode.FILL_STROKE||(this._cachedGetSinglePixelWidth=null,y=this.getSinglePixelWidth()*s)}else y/=w;1!==o&&(n.scale(o,o),y/=o),n.lineWidth=y;var k,A=0;for(k=0;k0){var N=1e3*n.measureText(R).width/a*o;if(Dnew e(t,this.commonObjs,this.objs,this.canvasFactory,this.webGLContext)};r=new a.TilingPattern(t,i,this.ctx,s,n)}else r=(0,a.getShadingPatternFromIR)(t);return r},setStrokeColorN:function(){this.current.strokeColor=this.getColorN_Pattern(arguments)},setFillColorN:function(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0},setStrokeRGBColor:function(e,t,r){var a=i.Util.makeCssRgb(e,t,r);this.ctx.strokeStyle=a,this.current.strokeColor=a},setFillRGBColor:function(e,t,r){var a=i.Util.makeCssRgb(e,t,r);this.ctx.fillStyle=a,this.current.fillColor=a,this.current.patternFill=!1},shadingFill:function(e){var t=this.ctx;this.save();var r=(0,a.getShadingPatternFromIR)(e);t.fillStyle=r.getPattern(t,this,!0);var n=t.mozCurrentTransformInverse;if(n){var s=t.canvas,o=s.width,l=s.height,c=i.Util.applyTransform([0,0],n),u=i.Util.applyTransform([0,l],n),d=i.Util.applyTransform([o,0],n),h=i.Util.applyTransform([o,l],n),f=Math.min(c[0],u[0],d[0],h[0]),p=Math.min(c[1],u[1],d[1],h[1]),g=Math.max(c[0],u[0],d[0],h[0]),m=Math.max(c[1],u[1],d[1],h[1]);this.ctx.fillRect(f,p,g-f,m-p)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.restore()},beginInlineImage:function(){(0,i.unreachable)("Should not call beginInlineImage")},beginImageData:function(){(0,i.unreachable)("Should not call beginImageData")},paintFormXObjectBegin:function(e,t){if(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(e)&&6===e.length&&this.transform.apply(this,e),this.baseTransform=this.ctx.mozCurrentTransform,t){var r=t[2]-t[0],i=t[3]-t[1];this.ctx.rect(t[0],t[1],r,i),this.clip(),this.endPath()}},paintFormXObjectEnd:function(){this.restore(),this.baseTransform=this.baseTransformStack.pop()},beginGroup:function(e){this.save();var t=this.ctx;e.isolated||(0,i.info)("TODO: Support non-isolated groups."),e.knockout&&(0,i.warn)("Knockout groups not supported.");var r=t.mozCurrentTransform;if(e.matrix&&t.transform.apply(t,e.matrix),!e.bbox)throw new Error("Bounding box is required.");var a=i.Util.getAxialAlignedBoundingBox(e.bbox,t.mozCurrentTransform),s=[0,0,t.canvas.width,t.canvas.height];a=i.Util.intersect(a,s)||[0,0,0,0];var o=Math.floor(a[0]),l=Math.floor(a[1]),c=Math.max(Math.ceil(a[2])-o,1),u=Math.max(Math.ceil(a[3])-l,1),h=1,f=1;c>n&&(h=c/n,c=n),u>n&&(f=u/n,u=n);var p="groupAt"+this.groupLevel;e.smask&&(p+="_smask_"+this.smaskCounter++%2);var g=this.cachedCanvases.getCanvas(p,c,u,!0),m=g.context;m.scale(1/h,1/f),m.translate(-o,-l),m.transform.apply(m,r),e.smask?this.smaskStack.push({canvas:g.canvas,context:m,offsetX:o,offsetY:l,scaleX:h,scaleY:f,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}):(t.setTransform(1,0,0,1,0,0),t.translate(o,l),t.scale(h,f)),d(t,m),this.ctx=m,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(t),this.groupLevel++,this.current.activeSMask=null},endGroup:function(e){this.groupLevel--;var t=this.ctx;this.ctx=this.groupStack.pop(),void 0!==this.ctx.imageSmoothingEnabled?this.ctx.imageSmoothingEnabled=!1:this.ctx.mozImageSmoothingEnabled=!1,e.smask?this.tempSMask=this.smaskStack.pop():this.ctx.drawImage(t.canvas,0,0),this.restore()},beginAnnotations:function(){this.save(),this.baseTransform&&this.ctx.setTransform.apply(this.ctx,this.baseTransform)},endAnnotations:function(){this.restore()},beginAnnotation:function(e,t,r){if(this.save(),h(this.ctx),this.current=new u,Array.isArray(e)&&4===e.length){var i=e[2]-e[0],a=e[3]-e[1];this.ctx.rect(e[0],e[1],i,a),this.clip(),this.endPath()}this.transform.apply(this,t),this.transform.apply(this,r)},endAnnotation:function(){this.restore()},paintImageMaskXObject:function(e){var t=this.ctx,i=e.width,a=e.height,n=this.current.fillColor,s=this.current.patternFill,o=this.processingType3;if(o&&void 0===o.compiled&&(o.compiled=i<=1e3&&a<=1e3?function(e){var t,r,i,a,n=e.width,s=e.height,o=n+1,l=new Uint8Array(o*(s+1)),c=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),u=n+7&-8,d=e.data,h=new Uint8Array(u*s),f=0;for(t=0,a=d.length;t0;)h[f++]=g&p?0:255,p>>=1;var m=0;for(0!==h[f=0]&&(l[0]=1,++m),r=1;r>2)+(h[f+1]?4:0)+(h[f-u+1]?8:0)]&&(l[i+r]=c[b],++m),f++;if(h[f-u]!==h[f]&&(l[i+r]=h[f]?2:4,++m),m>1e3)return null}for(i=t*o,0!==h[f=u*(s-1)]&&(l[i]=8,++m),r=1;r1e3)return null;var v=new Int32Array([0,o,-1,0,-o,0,0,0,1]),y=[];for(t=0;m&&t<=s;t++){for(var w=t*o,x=w+n;w>4,l[w]&=_>>2|_<<2),A.push(w%o),A.push(w/o|0),l[w]||--m}while(S!==w);y.push(A),--t}}return function(e){e.save(),e.scale(1/n,-1/s),e.translate(0,-s),e.beginPath();for(let r=0,i=y.length;r2&&g>1||f>2&&m>1;){var v=g,y=m;u>2&&g>1&&(u/=g/(v=Math.ceil(g/2))),f>2&&m>1&&(f/=m/(y=Math.ceil(m/2))),(p=(s=this.cachedCanvases.getCanvas(b,v,y)).context).clearRect(0,0,v,y),p.drawImage(n,0,0,g,m,0,0,v,y),n=s.canvas,g=v,m=y,b="prescale1"===b?"prescale2":"prescale1"}if(a.drawImage(n,0,0,g,m,0,-i,r,i),this.imageLayer){var w=this.getCanvasPosition(0,-i);this.imageLayer.appendImage({imgData:e,left:w[0],top:w[1],width:r/o[0],height:i/o[3]})}this.restore()},paintInlineImageXObjectGroup:function(e,r){var i=this.ctx,a=e.width,n=e.height,s=this.cachedCanvases.getCanvas("inlineImage",a,n);t(s.context,e);for(var o=0,l=r.length;oc[i+1]&&(l=r,r=i,i=l,l=n,n=s,s=l),c[i+1]>c[a+1]&&(l=i,i=a,a=l,l=s,s=o,o=l),c[r+1]>c[i+1]&&(l=r,r=i,i=l,l=n,n=s,s=l);var f=(c[r]+t.offsetX)*t.scaleX,p=(c[r+1]+t.offsetY)*t.scaleY,g=(c[i]+t.offsetX)*t.scaleX,m=(c[i+1]+t.offsetY)*t.scaleY,b=(c[a]+t.offsetX)*t.scaleX,v=(c[a+1]+t.offsetY)*t.scaleY;if(!(p>=v))for(var y,w,x,k,A,_,S,C,P=u[n],I=u[n+1],T=u[n+2],O=u[s],E=u[s+1],F=u[s+2],L=u[o],R=u[o+1],M=u[o+2],D=Math.round(p),N=Math.round(v),B=D;B<=N;B++){if(Bv?1:m===v?0:(m-B)/(m-v),y=g-(g-b)*e,w=O-(O-L)*e,x=E-(E-R)*e,k=F-(F-M)*e}let e;e=Bv?1:(p-B)/(p-v),A=f-(f-b)*e,_=P-(P-L)*e,S=I-(I-R)*e,C=T-(T-M)*e;for(var U=Math.round(Math.min(y,A)),j=Math.round(Math.max(y,A)),q=h*B+4*U,z=U;z<=j;z++)e=(y-z)/(y-A),e<0?e=0:e>1&&(e=1),d[q++]=w-(w-_)*e|0,d[q++]=x-(x-S)*e|0,d[q++]=k-(k-C)*e|0,d[q++]=255}}function t(t,r,i){var a,n,s=r.coords,o=r.colors;switch(r.type){case"lattice":var l=r.verticesPerRow,c=Math.floor(s.length/l)-1,u=l-1;for(a=0;a=i?a=i:r=a/e,{scale:r,size:a}},clipBbox:function(e,t,r,i,a,n){if(Array.isArray(t)&&4===t.length){var s=a-r,o=n-i;e.ctx.rect(r,i,s,o),e.clip(),e.endPath()}},setFillAndStrokeStyleToContext:function(r,a,n){const s=r.ctx,o=r.current;switch(a){case e:var l=this.ctx;s.fillStyle=l.fillStyle,s.strokeStyle=l.strokeStyle,o.fillColor=l.fillStyle,o.strokeColor=l.strokeStyle;break;case t:var c=i.Util.makeCssRgb(n[0],n[1],n[2]);s.fillStyle=c,s.strokeStyle=c,o.fillColor=c,o.strokeColor=c;break;default:throw new i.FormatError(`Unsupported paint type: ${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=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalWorkerOptions=void 0;const i=Object.create(null);t.GlobalWorkerOptions=i,i.workerPort=void 0===i.workerPort?null:i.workerPort,i.workerSrc=void 0===i.workerSrc?"":i.workerSrc},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessageHandler=void 0;var i=r(2);const a=1,n=2,s=1,o=2,l=3,c=4,u=5,d=6,h=7,f=8;function p(e){if("object"!=typeof e||null===e)return e;switch(e.name){case"AbortException":return new i.AbortException(e.message);case"MissingPDFException":return new i.MissingPDFException(e.message);case"UnexpectedResponseException":return new i.UnexpectedResponseException(e.message,e.status);case"UnknownErrorException":return new i.UnknownErrorException(e.message,e.details);default:return new i.UnknownErrorException(e.message,e.toString())}}t.MessageHandler=class{constructor(e,t,r){this.sourceName=e,this.targetName=t,this.comObj=r,this.callbackId=1,this.streamId=1,this.postMessageTransfers=!0,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=e=>{const t=e.data;if(t.targetName!==this.sourceName)return;if(t.stream)return void this._processStreamMessage(t);if(t.callback){const e=t.callbackId,r=this.callbackCapabilities[e];if(!r)throw new Error(`Cannot resolve callback ${e}`);if(delete this.callbackCapabilities[e],t.callback===a)r.resolve(t.data);else{if(t.callback!==n)throw new Error("Unexpected callback case");r.reject(p(t.reason))}return}const i=this.actionHandler[t.action];if(!i)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const e=this.sourceName,s=t.sourceName;new Promise((function(e){e(i(t.data))})).then((function(i){r.postMessage({sourceName:e,targetName:s,callback:a,callbackId:t.callbackId,data:i})}),(function(i){r.postMessage({sourceName:e,targetName:s,callback:n,callbackId:t.callbackId,reason:p(i)})}))}else t.streamId?this._createStreamSink(t):i(t.data)},r.addEventListener("message",this._onComObjOnMessage)}on(e,t){const r=this.actionHandler;if(r[e])throw new Error(`There is already an actionName called "${e}"`);r[e]=t}send(e,t,r){this._postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},r)}sendWithPromise(e,t,r){const a=this.callbackId++,n=(0,i.createPromiseCapability)();this.callbackCapabilities[a]=n;try{this._postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:a,data:t},r)}catch(e){n.reject(e)}return n.promise}sendWithStream(e,t,r,a){const n=this.streamId++,o=this.sourceName,l=this.targetName,c=this.comObj;return new ReadableStream({start:r=>{const s=(0,i.createPromiseCapability)();return this.streamControllers[n]={controller:r,startCall:s,pullCall:null,cancelCall:null,isClosed:!1},this._postMessage({sourceName:o,targetName:l,action:e,streamId:n,data:t,desiredSize:r.desiredSize},a),s.promise},pull:e=>{const t=(0,i.createPromiseCapability)();return this.streamControllers[n].pullCall=t,c.postMessage({sourceName:o,targetName:l,stream:d,streamId:n,desiredSize:e.desiredSize}),t.promise},cancel:e=>{(0,i.assert)(e instanceof Error,"cancel must have a valid reason");const t=(0,i.createPromiseCapability)();return this.streamControllers[n].cancelCall=t,this.streamControllers[n].isClosed=!0,c.postMessage({sourceName:o,targetName:l,stream:s,streamId:n,reason:p(e)}),t.promise}},r)}_createStreamSink(e){const t=this,r=this.actionHandler[e.action],a=e.streamId,n=this.sourceName,s=e.sourceName,o=this.comObj,d={enqueue(e,r=1,o){if(this.isCancelled)return;const l=this.desiredSize;this.desiredSize-=r,l>0&&this.desiredSize<=0&&(this.sinkCapability=(0,i.createPromiseCapability)(),this.ready=this.sinkCapability.promise),t._postMessage({sourceName:n,targetName:s,stream:c,streamId:a,chunk:e},o)},close(){this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:n,targetName:s,stream:l,streamId:a}),delete t.streamSinks[a])},error(e){(0,i.assert)(e instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:n,targetName:s,stream:u,streamId:a,reason:p(e)}))},sinkCapability:(0,i.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};d.sinkCapability.resolve(),d.ready=d.sinkCapability.promise,this.streamSinks[a]=d,new Promise((function(t){t(r(e.data,d))})).then((function(){o.postMessage({sourceName:n,targetName:s,stream:f,streamId:a,success:!0})}),(function(e){o.postMessage({sourceName:n,targetName:s,stream:f,streamId:a,reason:p(e)})}))}_processStreamMessage(e){const t=e.streamId,r=this.sourceName,a=e.sourceName,n=this.comObj;switch(e.stream){case f:e.success?this.streamControllers[t].startCall.resolve():this.streamControllers[t].startCall.reject(p(e.reason));break;case h:e.success?this.streamControllers[t].pullCall.resolve():this.streamControllers[t].pullCall.reject(p(e.reason));break;case d:if(!this.streamSinks[t]){n.postMessage({sourceName:r,targetName:a,stream:h,streamId:t,success:!0});break}this.streamSinks[t].desiredSize<=0&&e.desiredSize>0&&this.streamSinks[t].sinkCapability.resolve(),this.streamSinks[t].desiredSize=e.desiredSize;const{onPull:g}=this.streamSinks[e.streamId];new Promise((function(e){e(g&&g())})).then((function(){n.postMessage({sourceName:r,targetName:a,stream:h,streamId:t,success:!0})}),(function(e){n.postMessage({sourceName:r,targetName:a,stream:h,streamId:t,reason:p(e)})}));break;case c: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 l: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 u:(0,i.assert)(this.streamControllers[t],"error should have stream controller"),this.streamControllers[t].controller.error(p(e.reason)),this._deleteStreamController(t);break;case o:e.success?this.streamControllers[t].cancelCall.resolve():this.streamControllers[t].cancelCall.reject(p(e.reason)),this._deleteStreamController(t);break;case s:if(!this.streamSinks[t])break;const{onCancel:m}=this.streamSinks[e.streamId];new Promise((function(t){t(m&&m(p(e.reason)))})).then((function(){n.postMessage({sourceName:r,targetName:a,stream:o,streamId:t,success:!0})}),(function(e){n.postMessage({sourceName:r,targetName:a,stream:o,streamId:t,reason:p(e)})})),this.streamSinks[t].sinkCapability.reject(p(e.reason)),this.streamSinks[t].isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}async _deleteStreamController(e){await Promise.allSettled([this.streamControllers[e].startCall,this.streamControllers[e].pullCall,this.streamControllers[e].cancelCall].map((function(e){return e&&e.promise}))),delete this.streamControllers[e]}_postMessage(e,t){t&&this.postMessageTransfers?this.comObj.postMessage(e,t):this.comObj.postMessage(e)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Metadata=void 0;var i=r(2),a=r(13);t.Metadata=class{constructor(e){(0,i.assert)("string"==typeof e,"Metadata: input is not a string"),e=this._repair(e);const t=(new a.SimpleXMLParser).parseFromString(e);this._metadataMap=new Map,t&&this._parse(t)}_repair(e){return e.replace(/^[^<]+/,"").replace(/>\\376\\377([^<]+)/g,(function(e,t){const r=t.replace(/\\([0-3])([0-7])([0-7])/g,(function(e,t,r,i){return String.fromCharCode(64*t+8*r+1*i)})).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: ${t} isn't defined.`)}));let i="";for(let e=0,t=r.length;e=32&&t<127&&60!==t&&62!==t&&38!==t?String.fromCharCode(t):"&#x"+(65536+t).toString(16).substring(1)+";"}return">"+i}))}_parse(e){let t=e.documentElement;if("rdf:rdf"!==t.nodeName.toLowerCase())for(t=t.firstChild;t&&"rdf:rdf"!==t.nodeName.toLowerCase();)t=t.nextSibling;const r=t?t.nodeName.toLowerCase():null;if(!t||"rdf:rdf"!==r||!t.hasChildNodes())return;const i=t.childNodes;for(let e=0,t=i.length;e0}}t.SimpleXMLParser=class extends class{_resolveEntities(e){return e.replace(/&([^;]+);/g,((e,t)=>{if("#x"===t.substring(0,2))return String.fromCharCode(parseInt(t.substring(2),16));if("#"===t.substring(0,1))return String.fromCharCode(parseInt(t.substring(1),10));switch(t){case"lt":return"<";case"gt":return">";case"amp":return"&";case"quot":return'"'}return this.onResolveEntity(t)}))}_parseContent(e,t){const r=[];let i=t;function a(){for(;i"!==e[i]&&"/"!==e[i];)++i;const n=e.substring(t,i);for(a();i"!==e[i]&&"/"!==e[i]&&"?"!==e[i];){a();let t="",n="";for(;i"!==e[r]&&"/"!==e[r];)++r;const i=e.substring(t,r);!function(){for(;r"!==e[r+1]);)++r;return{name:i,value:e.substring(a,r),parsed:r-t}}parseXml(e){let t=0;for(;t",r),t<0)return void this.onError(c);this.onEndElement(e.substring(r,t)),r=t+1;break;case"?":++r;const i=this._parseProcessingInstruction(e,r);if("?>"!==e.substring(r+i.parsed,r+i.parsed+2))return void this.onError(n);this.onPi(i.name,i.value),r+=i.parsed+2;break;case"!":if("--"===e.substring(r+1,r+3)){if(t=e.indexOf("--\x3e",r+3),t<0)return void this.onError(o);this.onComment(e.substring(r+3,t)),r=t+3}else if("[CDATA["===e.substring(r+1,r+8)){if(t=e.indexOf("]]>",r+8),t<0)return void this.onError(a);this.onCdata(e.substring(r+8,t)),r=t+3}else{if("DOCTYPE"!==e.substring(r+1,r+8))return void this.onError(l);{const i=e.indexOf("[",r+8);let a=!1;if(t=e.indexOf(">",r+8),t<0)return void this.onError(s);if(i>0&&t>i){if(t=e.indexOf("]>",r+8),t<0)return void this.onError(s);a=!0}const n=e.substring(r+8,t+(a?1:0));this.onDoctype(n),r=t+(a?2:1)}}break;default:const u=this._parseContent(e,r);if(null===u)return void this.onError(l);let d=!1;if("/>"===e.substring(r+u.parsed,r+u.parsed+2))d=!0;else if(">"!==e.substring(r+u.parsed,r+u.parsed+1))return void this.onError(c);this.onBeginElement(u.name,u.attributes,d),r+=u.parsed+(d?2:1)}}else{for(;r0){const e=new Uint8Array(r).buffer;this._queuedChunks.push(e)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._contentLength=e.length,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener(((e,t)=>{this._onReceiveData({begin:e,chunk:t})})),this._pdfDataRangeTransport.addProgressListener(((e,t)=>{this._onProgress({loaded:e,total:t})})),this._pdfDataRangeTransport.addProgressiveReadListener((e=>{this._onReceiveData({chunk:e})})),this._pdfDataRangeTransport.addProgressiveDoneListener((()=>{this._onProgressiveDone()})),this._pdfDataRangeTransport.transportReady()}_onReceiveData(e){const t=new Uint8Array(e.chunk).buffer;if(void 0===e.begin)this._fullRequestReader?this._fullRequestReader._enqueue(t):this._queuedChunks.push(t);else{const r=this._rangeReaders.some((function(r){return r._begin===e.begin&&(r._enqueue(t),!0)}));(0,i.assert)(r,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?this._fullRequestReader._loaded:0}_onProgress(e){if(void 0===e.total){const t=this._rangeReaders[0];t&&t.onProgress&&t.onProgress({loaded:e.loaded})}else{const t=this._fullRequestReader;t&&t.onProgress&&t.onProgress({loaded:e.loaded,total:e.total})}}_onProgressiveDone(){this._fullRequestReader&&this._fullRequestReader.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){const t=this._rangeReaders.indexOf(e);t>=0&&this._rangeReaders.splice(t,1)}getFullReader(){(0,i.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new a(this,e,this._progressiveDone)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const r=new n(this,e,t);return this._pdfDataRangeTransport.requestDataRange(e,t),this._rangeReaders.push(r),r}cancelAllRequests(e){this._fullRequestReader&&this._fullRequestReader.cancel(e),this._rangeReaders.slice(0).forEach((function(t){t.cancel(e)})),this._pdfDataRangeTransport.abort()}};class a{constructor(e,t,r=!1){this._stream=e,this._done=r||!1,this._filename=null,this._queuedChunks=t||[],this._loaded=0;for(const e of this._queuedChunks)this._loaded+=e.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=(0,i.createPromiseCapability)();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._requests.forEach((function(e){e.resolve({value:void 0,done:!0})})),this._requests=[]}progressiveDone(){this._done||(this._done=!0)}}class n{constructor(e,t,r){this._stream=e,this._begin=t,this._end=r,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(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))}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const e=(0,i.createPromiseCapability)();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._requests.forEach((function(e){e.resolve({value:void 0,done:!0})})),this._requests=[],this._stream._removeRangeReader(this)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebGLContext=void 0;var i=r(2);t.WebGLContext=class{constructor({enable:e=!1}){this._enabled=!0===e}get isEnabled(){let e=this._enabled;return e&&(e=a.tryInitGL()),(0,i.shadow)(this,"isEnabled",e)}composeSMask({layer:e,mask:t,properties:r}){return a.composeSMask(e,t,r)}drawFigures({width:e,height:t,backgroundColor:r,figures:i,context:n}){return a.drawFigures(e,t,r,i,n)}clear(){a.cleanup()}};var a=function(){function e(e,t,r){var i=e.createShader(r);if(e.shaderSource(i,t),e.compileShader(i),!e.getShaderParameter(i,e.COMPILE_STATUS)){var a=e.getShaderInfoLog(i);throw new Error("Error during shader compilation: "+a)}return i}function t(t,r){return e(t,r,t.VERTEX_SHADER)}function r(t,r){return e(t,r,t.FRAGMENT_SHADER)}function i(e,t){for(var r=e.createProgram(),i=0,a=t.length;i 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; } ")]);a.useProgram(c);var u={};u.gl=a,u.canvas=e,u.resolutionLocation=a.getUniformLocation(c,"u_resolution"),u.positionLocation=a.getAttribLocation(c,"a_position"),u.backdropLocation=a.getUniformLocation(c,"u_backdrop"),u.subtypeLocation=a.getUniformLocation(c,"u_subtype");var d=a.getAttribLocation(c,"a_texCoord"),h=a.getUniformLocation(c,"u_image"),f=a.getUniformLocation(c,"u_mask"),p=a.createBuffer();a.bindBuffer(a.ARRAY_BUFFER,p),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(h,0),a.uniform1i(f,1),l=u}();var f=l,p=f.canvas,g=f.gl;p.width=d,p.height=h,g.viewport(0,0,g.drawingBufferWidth,g.drawingBufferHeight),g.uniform2f(f.resolutionLocation,d,h),u.backdrop?g.uniform4f(f.resolutionLocation,u.backdrop[0],u.backdrop[1],u.backdrop[2],1):g.uniform4f(f.resolutionLocation,0,0,0,0),g.uniform1i(f.subtypeLocation,"Luminosity"===u.subtype?1:0);var m=a(g,e,g.TEXTURE0),b=a(g,c,g.TEXTURE1),v=g.createBuffer();return g.bindBuffer(g.ARRAY_BUFFER,v),g.bufferData(g.ARRAY_BUFFER,new Float32Array([0,0,d,0,0,h,0,h,d,0,d,h]),g.STATIC_DRAW),g.enableVertexAttribArray(f.positionLocation),g.vertexAttribPointer(f.positionLocation,2,g.FLOAT,!1,0,0),g.clearColor(0,0,0,0),g.enable(g.BLEND),g.blendFunc(g.ONE,g.ONE_MINUS_SRC_ALPHA),g.clear(g.COLOR_BUFFER_BIT),g.drawArrays(g.TRIANGLES,0,6),g.flush(),g.deleteTexture(m),g.deleteTexture(b),g.deleteBuffer(v),p},drawFigures:function(e,a,l,u,d){c||function(){var e,a;o(),e=s,s=null,a=n,n=null;var l=i(a,[t(a," 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); } "),r(a," precision mediump float; varying vec4 v_color; void main() { gl_FragColor = v_color; } ")]);a.useProgram(l);var u={};u.gl=a,u.canvas=e,u.resolutionLocation=a.getUniformLocation(l,"u_resolution"),u.scaleLocation=a.getUniformLocation(l,"u_scale"),u.offsetLocation=a.getUniformLocation(l,"u_offset"),u.positionLocation=a.getAttribLocation(l,"a_position"),u.colorLocation=a.getAttribLocation(l,"a_color"),c=u}();var h=c,f=h.canvas,p=h.gl;f.width=e,f.height=a,p.viewport(0,0,p.drawingBufferWidth,p.drawingBufferHeight),p.uniform2f(h.resolutionLocation,e,a);var g,m,b,v=0;for(g=0,m=u.length;g0){n.style.borderWidth=`${t.borderStyle.width}px`,t.borderStyle.style!==a.AnnotationBorderStyleType.UNDERLINE&&(s-=2*t.borderStyle.width,o-=2*t.borderStyle.width);const e=t.borderStyle.horizontalCornerRadius,r=t.borderStyle.verticalCornerRadius;if(e>0||r>0){const t=`${e}px / ${r}px`;n.style.borderRadius=t}switch(t.borderStyle.style){case a.AnnotationBorderStyleType.SOLID:n.style.borderStyle="solid";break;case a.AnnotationBorderStyleType.DASHED:n.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:n.style.borderBottomStyle="solid"}t.color?n.style.borderColor=a.Util.makeCssRgb(0|t.color[0],0|t.color[1],0|t.color[2]):n.style.borderWidth=0}return n.style.left=`${l[0]}px`,n.style.top=`${l[1]}px`,n.style.width=`${s}px`,n.style.height=`${o}px`,n}_createPopup(e,t,r){t||((t=document.createElement("div")).style.height=e.style.height,t.style.width=e.style.width,e.appendChild(t));const i=new m({container:e,trigger:t,color:r.color,title:r.title,modificationDate:r.modificationDate,contents:r.contents,hideWrapper:!0}).render();i.style.left=e.style.width,e.appendChild(i)}render(){(0,a.unreachable)("Abstract method `AnnotationElement.render` called")}}class o extends s{constructor(e){super(e,!!(e.data.url||e.data.dest||e.data.action))}render(){this.container.className="linkAnnotation";const{data:e,linkService:t}=this,r=document.createElement("a");return e.url?(0,i.addLinkAttributes)(r,{url:e.url,target:e.newWindow?i.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}_bindLink(e,t){e.href=this.linkService.getDestinationHash(t),e.onclick=()=>(t&&this.linkService.navigateTo(t),!1),t&&(e.className="internalLink")}_bindNamedAction(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(t),!1),e.className="internalLink"}}class l extends s{constructor(e){super(e,!!(e.data.hasPopup||e.data.title||e.data.contents))}render(){this.container.className="textAnnotation";const 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}}class c extends s{render(){return this.container}}class u extends c{constructor(e){super(e,e.renderInteractiveForms||!e.data.hasAppearance&&!!e.data.fieldValue)}render(){const e=["left","center","right"];this.container.className="textWidgetAnnotation";let t=null;if(this.renderInteractiveForms){if(this.data.multiLine?(t=document.createElement("textarea"),t.textContent=this.data.fieldValue):(t=document.createElement("input"),t.type="text",t.setAttribute("value",this.data.fieldValue)),t.disabled=this.data.readOnly,t.name=this.data.fieldName,null!==this.data.maxLen&&(t.maxLength=this.data.maxLen),this.data.comb){const e=(this.data.rect[2]-this.data.rect[0])/this.data.maxLen;t.classList.add("comb"),t.style.letterSpacing=`calc(${e}px - 1ch)`}}else{t=document.createElement("div"),t.textContent=this.data.fieldValue,t.style.verticalAlign="middle",t.style.display="table-cell";let e=null;this.data.fontRefName&&this.page.commonObjs.has(this.data.fontRefName)&&(e=this.page.commonObjs.get(this.data.fontRefName)),this._setTextStyle(t,e)}return null!==this.data.textAlignment&&(t.style.textAlign=e[this.data.textAlignment]),this.container.appendChild(t),this.container}_setTextStyle(e,t){const r=e.style;if(r.fontSize=`${this.data.fontSize}px`,r.direction=this.data.fontDirection<0?"rtl":"ltr",!t)return;let i="normal";t.black?i="900":t.bold&&(i="bold"),r.fontWeight=i,r.fontStyle=t.italic?"italic":"normal";const a=t.loadedName?`"${t.loadedName}", `:"",n=t.fallbackName||"Helvetica, sans-serif";r.fontFamily=a+n}}class d extends c{constructor(e){super(e,e.renderInteractiveForms)}render(){this.container.className="buttonWidgetAnnotation checkBox";const 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}}class h extends c{constructor(e){super(e,e.renderInteractiveForms)}render(){this.container.className="buttonWidgetAnnotation radioButton";const 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}}class f extends o{render(){const e=super.render();return e.className="buttonWidgetAnnotation pushButton",e}}class p extends c{constructor(e){super(e,e.renderInteractiveForms)}render(){this.container.className="choiceWidgetAnnotation";const 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));for(const t of this.data.options){const r=document.createElement("option");r.textContent=t.displayValue,r.value=t.exportValue,this.data.fieldValue.includes(t.displayValue)&&r.setAttribute("selected",!0),e.appendChild(r)}return this.container.appendChild(e),this.container}}class g extends s{constructor(e){super(e,!(!e.data.title&&!e.data.contents))}render(){if(this.container.className="popupAnnotation",["Line","Square","Circle","PolyLine","Polygon","Ink"].includes(this.data.parentType))return this.container;const e=`[data-annotation-id="${this.data.parentId}"]`,t=this.layer.querySelector(e);if(!t)return this.container;const r=new m({container:this.container,trigger:t,color:this.data.color,title:this.data.title,modificationDate:this.data.modificationDate,contents:this.data.contents}),i=parseFloat(t.style.left),a=parseFloat(t.style.width);return this.container.style.transformOrigin=`-${i+a}px -${t.style.top}`,this.container.style.left=`${i+a}px`,this.container.appendChild(r.render()),this.container}}class m{constructor(e){this.container=e.container,this.trigger=e.trigger,this.color=e.color,this.title=e.title,this.modificationDate=e.modificationDate,this.contents=e.contents,this.hideWrapper=e.hideWrapper||!1,this.pinned=!1}render(){const e=document.createElement("div");e.className="popupWrapper",this.hideElement=this.hideWrapper?e:this.container,this.hideElement.setAttribute("hidden",!0);const t=document.createElement("div");t.className="popup";const r=this.color;if(r){const e=.7*(255-r[0])+r[0],i=.7*(255-r[1])+r[1],n=.7*(255-r[2])+r[2];t.style.backgroundColor=a.Util.makeCssRgb(0|e,0|i,0|n)}const n=document.createElement("h1");n.textContent=this.title,t.appendChild(n);const s=i.PDFDateString.toDateObject(this.modificationDate);if(s){const e=document.createElement("span");e.textContent="{{date}}, {{time}}",e.dataset.l10nId="annotation_date_string",e.dataset.l10nArgs=JSON.stringify({date:s.toLocaleDateString(),time:s.toLocaleTimeString()}),t.appendChild(e)}const o=this._formatContents(this.contents);return t.appendChild(o),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}_formatContents(e){const t=document.createElement("p"),r=e.split(/(?:\r\n?|\n)/);for(let e=0,i=r.length;e1)g=!0;else if(r.transform[0]!==r.transform[3]){const e=Math.abs(r.transform[0]),t=Math.abs(r.transform[3]);e!==t&&Math.max(e,t)/Math.min(e,t)>1.5&&(g=!0)}if(g&&(u.vertical?o.canvasWidth=r.height*t._viewport.scale:o.canvasWidth=r.width*t._viewport.scale),t._textDivProperties.set(s,o),t._textContentStream&&t._layoutText(s),t._enhanceTextSelection){var m=1,b=0;0!==c&&(m=Math.cos(c),b=Math.sin(c));var v,y,w=(u.vertical?r.height:r.width)*t._viewport.scale,x=d;0!==c?(v=[m,b,-b,m,f,p],y=i.Util.getAxialAlignedBoundingBox([0,0,w,x],v)):y=[f,p,f+w,p+x],t._bounds.push({left:y[0],top:y[1],right:y[2],bottom:y[3],div:s,size:[w,x],m:v})}}function r(e){if(!e._canceled){var t=e._textDivs,r=e._capability,i=t.length;if(i>1e5)return e._renderingDone=!0,void r.resolve();if(!e._textContentStream)for(var a=0;a0&&(i=i?Math.min(r,i):r)}return i}function n(e){for(var t=e._bounds,r=e._viewport,n=function(e,t,r){var i=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}}));s(e,i);var a=new Array(r.length);return i.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 n=a[r],s=i[r];s.x1=t.top,s.y1=e-n.right,s.x2=t.bottom,s.y2=e-n.left,s.index=r,s.x1New=void 0,s.x2New=void 0})),s(t,i),i.forEach((function(e){var t=e.index;a[t].top=e.x1New,a[t].bottom=e.x2New})),a}(r.width,r.height,t),o=0;o=0&&r[n].start>=e.y2;)n--;var s,o,l=-1/0;for(s=t;s<=n;s++){var c;(c=(a=(i=r[s]).boundary).x2>e.x1?a.index>e.index?a.x1New:e.x1:void 0===a.x2New?(a.x2+e.x1)/2:a.x2New)>l&&(l=c)}for(e.x1New=l,s=t;s<=n;s++)void 0===(a=(i=r[s]).boundary).x2New?a.x2>e.x1?a.index>e.index&&(a.x2New=a.x2):a.x2New=l:a.x2New>l&&(a.x2New=Math.max(l,a.x2));var u=[],d=null;for(s=t;s<=n;s++){var h=(a=(i=r[s]).boundary).x2>e.x2?a:e;d===h?u[u.length-1].end=i.end:(u.push({start:i.start,end:i.end,boundary:h}),d=h)}for(r[t].start=0&&r[o].start>=a.y1;o--)f=r[o].boundary===a;for(o=n+1;!f&&o{this._layoutTextCtx&&(this._layoutTextCtx.canvas.width=0,this._layoutTextCtx.canvas.height=0,this._layoutTextCtx=null)})).catch((()=>{}))}return o.prototype={get promise(){return this._capability.promise},cancel:function(){this._canceled=!0,this._reader&&(this._reader.cancel(new i.AbortException("TextLayer task cancelled.")),this._reader=null),null!==this._renderTimer&&(clearTimeout(this._renderTimer),this._renderTimer=null),this._capability.reject(new Error("TextLayer task cancelled."))},_processItems(e,r){for(let i=0,a=e.length;i0&&(t.scale=t.canvasWidth/n,r=`scaleX(${t.scale})`)}0!==t.angle&&(r=`rotate(${t.angle}deg) ${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){const t=(0,i.createPromiseCapability)();let a=Object.create(null);const n=document.createElement("canvas");if(n.mozOpaque=!0,this._layoutTextCtx=n.getContext("2d",{alpha:!1}),this._textContent){const e=this._textContent.items,r=this._textContent.styles;this._processItems(e,r),t.resolve()}else{if(!this._textContentStream)throw new Error('Neither "textContent" nor "textContentStream" parameters specified.');{const e=()=>{this._reader.read().then((({value:r,done:i})=>{i?t.resolve():(Object.assign(a,r.styles),this._processItems(r.items,a),e())}),t.reject)};this._reader=this._textContentStream.getReader(),e()}}t.promise.then((()=>{a=null,e?this._renderTimer=setTimeout((()=>{r(this),this._renderTimer=null}),e):r(this)}),this._capability.reject)},expandTextDivs:function(e){if(!this._enhanceTextSelection||!this._renderingDone)return;null!==this._bounds&&(n(this),this._bounds=null);const t=[],r=[];for(var i=0,a=this._textDivs.length;i0?(r.push(`${n.paddingTop}px`),t.push(`translateY(${-n.paddingTop}px)`)):r.push(0),n.paddingRight>0?r.push(n.paddingRight/n.scale+"px"):r.push(0),n.paddingBottom>0?r.push(`${n.paddingBottom}px`):r.push(0),n.paddingLeft>0?(r.push(n.paddingLeft/n.scale+"px"),t.push(`translateX(${-n.paddingLeft/n.scale}px)`)):r.push(0),a.style.padding=r.join(" "),t.length&&(a.style.transform=t.join(" "))):(a.style.padding=null,a.style.transform=n.originalTransform))}}},function(e){var t=new o({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){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SVGGraphics=void 0;var i=r(2),a=r(1),n=r(4);let s=function(){throw new Error("Not implemented: SVGGraphics")};t.SVGGraphics=s;{const e={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},r="http://www.w3.org/XML/1998/namespace",o="http://www.w3.org/1999/xlink",l=["butt","round","square"],c=["miter","round","bevel"],u=function(){const e=new Uint8Array([137,80,78,71,13,10,26,10]),t=new Int32Array(256);for(let e=0;e<256;e++){let r=e;for(let e=0;e<8;e++)r=1&r?3988292384^r>>1&2147483647:r>>1&2147483647;t[e]=r}function r(e,r,i,a){let n=a;const s=r.length;i[n]=s>>24&255,i[n+1]=s>>16&255,i[n+2]=s>>8&255,i[n+3]=255&s,n+=4,i[n]=255&e.charCodeAt(0),i[n+1]=255&e.charCodeAt(1),i[n+2]=255&e.charCodeAt(2),i[n+3]=255&e.charCodeAt(3),n+=4,i.set(r,n),n+=r.length;const o=function(e,r,i){let a=-1;for(let n=r;n>>8^t[r]}return-1^a}(i,a+4,n);i[n]=o>>24&255,i[n+1]=o>>16&255,i[n+2]=o>>8&255,i[n+3]=255&o}function a(e){let t=e.length;const r=65535,i=Math.ceil(t/r),a=new Uint8Array(2+t+5*i+4);let n=0;a[n++]=120,a[n++]=156;let s=0;for(;t>r;)a[n++]=0,a[n++]=255,a[n++]=255,a[n++]=0,a[n++]=0,a.set(e.subarray(s,s+r),n),n+=r,s+=r,t-=r;a[n++]=1,a[n++]=255&t,a[n++]=t>>8&255,a[n++]=255&~t,a[n++]=(65535&~t)>>8&255,a.set(e.subarray(s),n),n+=e.length-s;const o=function(e,t,r){let i=1,a=0;for(let n=t;n>24&255,a[n++]=o>>16&255,a[n++]=o>>8&255,a[n++]=255&o,a}function s(t,s,o,l){const c=t.width,u=t.height;let d,h,f;const p=t.data;switch(s){case i.ImageKind.GRAYSCALE_1BPP:h=0,d=1,f=c+7>>3;break;case i.ImageKind.RGB_24BPP:h=2,d=8,f=3*c;break;case i.ImageKind.RGBA_32BPP:h=6,d=8,f=4*c;break;default:throw new Error("invalid format")}const g=new Uint8Array((1+f)*u);let m=0,b=0;for(let e=0;e>24&255,c>>16&255,c>>8&255,255&c,u>>24&255,u>>16&255,u>>8&255,255&u,d,h,0,0,0]),y=function(e){if(!n.isNodeJS)return a(e);try{let t;t=parseInt(process.versions.node)>=8?e:Buffer.from(e);const r=__webpack_require__(2258).deflateSync(t,{level:9});return r instanceof Uint8Array?r:new Uint8Array(r)}catch(e){(0,i.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+e)}return a(e)}(g),w=e.length+36+v.length+y.length,x=new Uint8Array(w);let k=0;return x.set(e,k),k+=e.length,r("IHDR",v,x,k),k+=12+v.length,r("IDATA",y,x,k),k+=12+y.length,r("IEND",new Uint8Array(0),x,k),(0,i.createObjectURL)(x,"image/png",o)}return function(e,t,r){return s(e,void 0===e.kind?i.ImageKind.GRAYSCALE_1BPP:e.kind,t,r)}}();class d{constructor(){this.fontSizeScale=1,this.fontWeight=e.fontWeight,this.fontSize=0,this.textMatrix=i.IDENTITY_MATRIX,this.fontMatrix=i.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=i.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=e.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=""}clone(){return Object.create(this)}setCurrentPoint(e,t){this.x=e,this.y=t}}function h(e){let t=[];const r=[];for(const i of e)"save"!==i.fn?"restore"===i.fn?t=r.pop():t.push(i):(t.push({fnId:92,fn:"group",items:[]}),r.push(t),t=t[t.length-1].items);return t}function f(e){if(Number.isInteger(e))return e.toString();const t=e.toFixed(10);let r=t.length-1;if("0"!==t[r])return t;do{r--}while("0"===t[r]);return t.substring(0,"."===t[r]?r:r+1)}function p(e){if(0===e[4]&&0===e[5]){if(0===e[1]&&0===e[2])return 1===e[0]&&1===e[3]?"":`scale(${f(e[0])} ${f(e[3])})`;if(e[0]===e[3]&&e[1]===-e[2])return`rotate(${f(180*Math.acos(e[0])/Math.PI)})`}else if(1===e[0]&&0===e[1]&&0===e[2]&&1===e[3])return`translate(${f(e[4])} ${f(e[5])})`;return`matrix(${f(e[0])} ${f(e[1])} ${f(e[2])} ${f(e[3])} ${f(e[4])} ${f(e[5])})`}let g=0,m=0,b=0;t.SVGGraphics=s=class{constructor(e,t,r=!1){this.svgFactory=new a.DOMSVGFactory,this.current=new d,this.transformMatrix=i.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=e,this.objs=t,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!r,this._operatorIdMapping=[];for(const e in i.OPS)this._operatorIdMapping[i.OPS[e]]=e}save(){this.transformStack.push(this.transformMatrix);const e=this.current;this.extraStack.push(e),this.current=e.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(e){this.save(),this.executeOpTree(e),this.restore()}loadDependencies(e){const t=e.fnArray,r=e.argsArray;for(let e=0,a=t.length;e{e.get(t,r)}));this.current.dependencies.push(r)}return Promise.all(this.current.dependencies)}transform(e,t,r,a,n,s){const o=[e,t,r,a,n,s];this.transformMatrix=i.Util.transform(this.transformMatrix,o),this.tgrp=null}getSVG(e,t){this.viewport=t;const r=this._initialize(t);return this.loadDependencies(e).then((()=>(this.transformMatrix=i.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(e)),r)))}convertOpList(e){const t=this._operatorIdMapping,r=e.argsArray,i=e.fnArray,a=[];for(let e=0,n=i.length;e0&&(this.current.lineWidth=e)}setLineCap(e){this.current.lineCap=l[e]}setLineJoin(e){this.current.lineJoin=c[e]}setMiterLimit(e){this.current.miterLimit=e}setStrokeAlpha(e){this.current.strokeAlpha=e}setStrokeRGBColor(e,t,r){this.current.strokeColor=i.Util.makeCssRgb(e,t,r)}setFillAlpha(e){this.current.fillAlpha=e}setFillRGBColor(e,t,r){this.current.fillColor=i.Util.makeCssRgb(e,t,r),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(e){this.current.strokeColor=this._makeColorN_Pattern(e)}setFillColorN(e){this.current.fillColor=this._makeColorN_Pattern(e)}shadingFill(e){const t=this.viewport.width,r=this.viewport.height,a=i.Util.inverseTransform(this.transformMatrix),n=i.Util.applyTransform([0,0],a),s=i.Util.applyTransform([0,r],a),o=i.Util.applyTransform([t,0],a),l=i.Util.applyTransform([t,r],a),c=Math.min(n[0],s[0],o[0],l[0]),u=Math.min(n[1],s[1],o[1],l[1]),d=Math.max(n[0],s[0],o[0],l[0]),h=Math.max(n[1],s[1],o[1],l[1]),f=this.svgFactory.createElement("svg:rect");f.setAttributeNS(null,"x",c),f.setAttributeNS(null,"y",u),f.setAttributeNS(null,"width",d-c),f.setAttributeNS(null,"height",h-u),f.setAttributeNS(null,"fill",this._makeShadingPattern(e)),this.current.fillAlpha<1&&f.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().appendChild(f)}_makeColorN_Pattern(e){return"TilingPattern"===e[0]?this._makeTilingPattern(e):this._makeShadingPattern(e)}_makeTilingPattern(e){const t=e[1],r=e[2],a=e[3]||i.IDENTITY_MATRIX,[n,s,o,l]=e[4],c=e[5],u=e[6],d=e[7],h="shading"+b++,[f,p]=i.Util.applyTransform([n,s],a),[g,m]=i.Util.applyTransform([o,l],a),[v,y]=i.Util.singularValueDecompose2dScale(a),w=c*v,x=u*y,k=this.svgFactory.createElement("svg:pattern");k.setAttributeNS(null,"id",h),k.setAttributeNS(null,"patternUnits","userSpaceOnUse"),k.setAttributeNS(null,"width",w),k.setAttributeNS(null,"height",x),k.setAttributeNS(null,"x",`${f}`),k.setAttributeNS(null,"y",`${p}`);const A=this.svg,_=this.transformMatrix,S=this.current.fillColor,C=this.current.strokeColor,P=this.svgFactory.create(g-f,m-p);if(this.svg=P,this.transformMatrix=a,2===d){const e=i.Util.makeCssRgb(...t);this.current.fillColor=e,this.current.strokeColor=e}return this.executeOpTree(this.convertOpList(r)),this.svg=A,this.transformMatrix=_,this.current.fillColor=S,this.current.strokeColor=C,k.appendChild(P.childNodes[0]),this.defs.appendChild(k),`url(#${h})`}_makeShadingPattern(e){switch(e[0]){case"RadialAxial":const t="shading"+b++,r=e[3];let a;switch(e[1]){case"axial":const r=e[4],i=e[5];a=this.svgFactory.createElement("svg:linearGradient"),a.setAttributeNS(null,"id",t),a.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),a.setAttributeNS(null,"x1",r[0]),a.setAttributeNS(null,"y1",r[1]),a.setAttributeNS(null,"x2",i[0]),a.setAttributeNS(null,"y2",i[1]);break;case"radial":const n=e[4],s=e[5],o=e[6],l=e[7];a=this.svgFactory.createElement("svg:radialGradient"),a.setAttributeNS(null,"id",t),a.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),a.setAttributeNS(null,"cx",s[0]),a.setAttributeNS(null,"cy",s[1]),a.setAttributeNS(null,"r",l),a.setAttributeNS(null,"fx",n[0]),a.setAttributeNS(null,"fy",n[1]),a.setAttributeNS(null,"fr",o);break;default:throw new Error(`Unknown RadialAxial type: ${e[1]}`)}for(const e of r){const t=this.svgFactory.createElement("svg:stop");t.setAttributeNS(null,"offset",e[0]),t.setAttributeNS(null,"stop-color",e[1]),a.appendChild(t)}return this.defs.appendChild(a),`url(#${t})`;case"Mesh":return(0,i.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${e[0]}`)}}setDash(e,t){this.current.dashArray=e,this.current.dashPhase=t}constructPath(e,t){const r=this.current;let a=r.x,n=r.y,s=[],o=0;for(const r of e)switch(0|r){case i.OPS.rectangle:a=t[o++],n=t[o++];const e=a+t[o++],r=n+t[o++];s.push("M",f(a),f(n),"L",f(e),f(n),"L",f(e),f(r),"L",f(a),f(r),"Z");break;case i.OPS.moveTo:a=t[o++],n=t[o++],s.push("M",f(a),f(n));break;case i.OPS.lineTo:a=t[o++],n=t[o++],s.push("L",f(a),f(n));break;case i.OPS.curveTo:a=t[o+4],n=t[o+5],s.push("C",f(t[o]),f(t[o+1]),f(t[o+2]),f(t[o+3]),f(a),f(n)),o+=6;break;case i.OPS.curveTo2:s.push("C",f(a),f(n),f(t[o]),f(t[o+1]),f(t[o+2]),f(t[o+3])),a=t[o+2],n=t[o+3],o+=4;break;case i.OPS.curveTo3:a=t[o+2],n=t[o+3],s.push("C",f(t[o]),f(t[o+1]),f(a),f(n),f(a),f(n)),o+=4;break;case i.OPS.closePath:s.push("Z")}s=s.join(" "),r.path&&e.length>0&&e[0]!==i.OPS.rectangle&&e[0]!==i.OPS.moveTo?s=r.path.getAttributeNS(null,"d")+s:(r.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().appendChild(r.path)),r.path.setAttributeNS(null,"d",s),r.path.setAttributeNS(null,"fill","none"),r.element=r.path,r.setCurrentPoint(a,n)}endPath(){const e=this.current;if(e.path=null,!this.pendingClip)return;if(!e.element)return void(this.pendingClip=null);const t="clippath"+g++,r=this.svgFactory.createElement("svg:clipPath");r.setAttributeNS(null,"id",t),r.setAttributeNS(null,"transform",p(this.transformMatrix));const i=e.element.cloneNode(!0);"evenodd"===this.pendingClip?i.setAttributeNS(null,"clip-rule","evenodd"):i.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,r.appendChild(i),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(#${t})`,this.tgrp=null}clip(e){this.pendingClip=e}closePath(){const e=this.current;if(e.path){const t=`${e.path.getAttributeNS(null,"d")}Z`;e.path.setAttributeNS(null,"d",t)}}setLeading(e){this.current.leading=-e}setTextRise(e){this.current.textRise=e}setTextRenderingMode(e){this.current.textRenderingMode=e}setHScale(e){this.current.textHScale=e/100}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(const[t,r]of e)switch(t){case"LW":this.setLineWidth(r);break;case"LC":this.setLineCap(r);break;case"LJ":this.setLineJoin(r);break;case"ML":this.setMiterLimit(r);break;case"D":this.setDash(r[0],r[1]);break;case"RI":this.setRenderingIntent(r);break;case"FL":this.setFlatness(r);break;case"Font":this.setFont(r);break;case"CA":this.setStrokeAlpha(r);break;case"ca":this.setFillAlpha(r);break;default:(0,i.warn)(`Unimplemented graphic state operator ${t}`)}}fill(){const e=this.current;e.element&&(e.element.setAttributeNS(null,"fill",e.fillColor),e.element.setAttributeNS(null,"fill-opacity",e.fillAlpha),this.endPath())}stroke(){const e=this.current;e.element&&(this._setStrokeAttributes(e.element),e.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(e,t=1){const r=this.current;let i=r.dashArray;1!==t&&i.length>0&&(i=i.map((function(e){return t*e}))),e.setAttributeNS(null,"stroke",r.strokeColor),e.setAttributeNS(null,"stroke-opacity",r.strokeAlpha),e.setAttributeNS(null,"stroke-miterlimit",f(r.miterLimit)),e.setAttributeNS(null,"stroke-linecap",r.lineCap),e.setAttributeNS(null,"stroke-linejoin",r.lineJoin),e.setAttributeNS(null,"stroke-width",f(t*r.lineWidth)+"px"),e.setAttributeNS(null,"stroke-dasharray",i.map(f).join(" ")),e.setAttributeNS(null,"stroke-dashoffset",f(t*r.dashPhase)+"px")}eoFill(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const 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)}paintImageXObject(e){const t=this.objs.get(e);t?this.paintInlineImageXObject(t):(0,i.warn)(`Dependent image with object ID ${e} is not ready yet`)}paintInlineImageXObject(e,t){const r=e.width,i=e.height,a=u(e,this.forceDataSchema,!!t),n=this.svgFactory.createElement("svg:rect");n.setAttributeNS(null,"x","0"),n.setAttributeNS(null,"y","0"),n.setAttributeNS(null,"width",f(r)),n.setAttributeNS(null,"height",f(i)),this.current.element=n,this.clip("nonzero");const s=this.svgFactory.createElement("svg:image");s.setAttributeNS(o,"xlink:href",a),s.setAttributeNS(null,"x","0"),s.setAttributeNS(null,"y",f(-i)),s.setAttributeNS(null,"width",f(r)+"px"),s.setAttributeNS(null,"height",f(i)+"px"),s.setAttributeNS(null,"transform",`scale(${f(1/r)} ${f(-1/i)})`),t?t.appendChild(s):this._ensureTransformGroup().appendChild(s)}paintImageMaskXObject(e){const t=this.current,r=e.width,i=e.height,a=t.fillColor;t.maskId="mask"+m++;const n=this.svgFactory.createElement("svg:mask");n.setAttributeNS(null,"id",t.maskId);const s=this.svgFactory.createElement("svg:rect");s.setAttributeNS(null,"x","0"),s.setAttributeNS(null,"y","0"),s.setAttributeNS(null,"width",f(r)),s.setAttributeNS(null,"height",f(i)),s.setAttributeNS(null,"fill",a),s.setAttributeNS(null,"mask",`url(#${t.maskId})`),this.defs.appendChild(n),this._ensureTransformGroup().appendChild(s),this.paintInlineImageXObject(e,n)}paintFormXObjectBegin(e,t){if(Array.isArray(e)&&6===e.length&&this.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t){const e=t[2]-t[0],r=t[3]-t[1],i=this.svgFactory.createElement("svg:rect");i.setAttributeNS(null,"x",t[0]),i.setAttributeNS(null,"y",t[1]),i.setAttributeNS(null,"width",f(e)),i.setAttributeNS(null,"height",f(r)),this.current.element=i,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(e){const t=this.svgFactory.create(e.width,e.height),r=this.svgFactory.createElement("svg:defs");t.appendChild(r),this.defs=r;const i=this.svgFactory.createElement("svg:g");return i.setAttributeNS(null,"transform",p(e.transform)),t.appendChild(i),this.svg=i,t}_ensureClipGroup(){if(!this.current.clipGroup){const 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}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",p(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().appendChild(this.tgrp):this.svg.appendChild(this.tgrp)),this.tgrp}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFNodeStream=void 0;var i=r(2),a=r(20);const n=__webpack_require__(172),s=__webpack_require__(2001),o=__webpack_require__(3779),l=__webpack_require__(6558),c=/^file:\/\/\/[a-zA-Z]:\//;t.PDFNodeStream=class{constructor(e){this.source=e,this.url=function(e){const t=l.parse(e);return"file:"===t.protocol||t.host?t:/^[a-z]:[/\\]/i.test(e)?l.parse(`file:///${e}`):(t.host||(t.protocol="file:"),t)}(e.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.httpHeaders=this.isHttp&&e.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?this._fullRequestReader._loaded:0}getFullReader(){return(0,i.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new g(this):new f(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const r=this.isFsUrl?new m(this,e,t):new p(this,e,t);return this._rangeRequestReaders.push(r),r}cancelAllRequests(e){this._fullRequestReader&&this._fullRequestReader.cancel(e),this._rangeRequestReaders.slice(0).forEach((function(t){t.cancel(e)}))}};class u{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;const t=e.source;this._contentLength=t.length,this._loaded=0,this._filename=null,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._readableStream=null,this._readCapability=(0,i.createPromiseCapability)(),this._headersCapability=(0,i.createPromiseCapability)()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return null===e?(this._readCapability=(0,i.createPromiseCapability)(),this.read()):(this._loaded+=e.length,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",(()=>{this._readCapability.resolve()})),e.on("end",(()=>{e.destroy(),this._done=!0,this._readCapability.resolve()})),e.on("error",(e=>{this._error(e)})),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new i.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class d{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=(0,i.createPromiseCapability)();const t=e.source;this._isStreamingSupported=!t.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return null===e?(this._readCapability=(0,i.createPromiseCapability)(),this.read()):(this._loaded+=e.length,this.onProgress&&this.onProgress({loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",(()=>{this._readCapability.resolve()})),e.on("end",(()=>{e.destroy(),this._done=!0,this._readCapability.resolve()})),e.on("error",(e=>{this._error(e)})),this._storedError&&this._readableStream.destroy(this._storedError)}}function h(e,t){return{protocol:e.protocol,auth:e.auth,host:e.hostname,port:e.port,path:e.path,method:"GET",headers:t}}class f extends u{constructor(e){super(e);const t=t=>{if(404===t.statusCode){const e=new i.MissingPDFException(`Missing PDF "${this._url}".`);return this._storedError=e,void this._headersCapability.reject(e)}this._headersCapability.resolve(),this._setReadableStream(t);const r=e=>this._readableStream.headers[e.toLowerCase()],{allowRangeRequests:n,suggestedLength:s}=(0,a.validateRangeRequestCapabilities)({getResponseHeader:r,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n,this._contentLength=s||this._contentLength,this._filename=(0,a.extractFilenameFromHeader)(r)};this._request=null,"http:"===this._url.protocol?this._request=s.request(h(this._url,e.httpHeaders),t):this._request=o.request(h(this._url,e.httpHeaders),t),this._request.on("error",(e=>{this._storedError=e,this._headersCapability.reject(e)})),this._request.end()}}class p extends d{constructor(e,t,r){super(e),this._httpHeaders={};for(const t in e.httpHeaders){const r=e.httpHeaders[t];void 0!==r&&(this._httpHeaders[t]=r)}this._httpHeaders.Range=`bytes=${t}-${r-1}`;const a=e=>{if(404!==e.statusCode)this._setReadableStream(e);else{const e=new i.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=e}};this._request=null,"http:"===this._url.protocol?this._request=s.request(h(this._url,this._httpHeaders),a):this._request=o.request(h(this._url,this._httpHeaders),a),this._request.on("error",(e=>{this._storedError=e})),this._request.end()}}class g extends u{constructor(e){super(e);let t=decodeURIComponent(this._url.path);c.test(this._url.href)&&(t=t.replace(/^\//,"")),n.lstat(t,((e,r)=>{if(e)return"ENOENT"===e.code&&(e=new i.MissingPDFException(`Missing PDF "${t}".`)),this._storedError=e,void this._headersCapability.reject(e);this._contentLength=r.size,this._setReadableStream(n.createReadStream(t)),this._headersCapability.resolve()}))}}class m extends d{constructor(e,t,r){super(e);let i=decodeURIComponent(this._url.path);c.test(this._url.href)&&(i=i.replace(/^\//,"")),this._setReadableStream(n.createReadStream(i,{start:t,end:r-1}))}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createResponseStatusError=function(e,t){return 404===e||0===e&&t.startsWith("file:")?new i.MissingPDFException('Missing PDF "'+t+'".'):new i.UnexpectedResponseException("Unexpected server response ("+e+') while retrieving PDF "'+t+'".',e)},t.extractFilenameFromHeader=function(e){const t=e("Content-Disposition");if(t){let e=(0,a.getFilenameFromContentDispositionHeader)(t);if(e.includes("%"))try{e=decodeURIComponent(e)}catch(e){}if(/\.pdf$/i.test(e))return e}return null},t.validateRangeRequestCapabilities=function({getResponseHeader:e,isHttp:t,rangeChunkSize:r,disableRange:a}){(0,i.assert)(r>0,"Range chunk size must be larger than zero");const n={allowRangeRequests:!1,suggestedLength:void 0},s=parseInt(e("Content-Length"),10);return Number.isInteger(s)?(n.suggestedLength=s,s<=2*r||a||!t||"bytes"!==e("Accept-Ranges")||"identity"!==(e("Content-Encoding")||"identity")||(n.allowRangeRequests=!0),n):n},t.validateResponseStatus=function(e){return 200===e||206===e};var i=r(2),a=r(21)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFilenameFromContentDispositionHeader=function(e){let t=!0,r=i("filename\\*","i").exec(e);if(r){r=r[1];let e=s(r);return e=unescape(e),e=o(e),e=l(e),n(e)}if(r=function(e){const t=[];let r;const a=i("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(r=a.exec(e));){let[,e,i,a]=r;if(e=parseInt(e,10),e in t){if(0===e)break}else t[e]=[i,a]}const n=[];for(let e=0;e=2&&r.onHeadersReceived&&(r.onHeadersReceived(),delete r.onHeadersReceived),4!==a.readyState)return;if(!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],0===a.status&&this.isHttp)return void(r.onError&&r.onError(a.status));const n=a.status||200;if((200!==n||206!==r.expectedStatus)&&n!==r.expectedStatus)return void(r.onError&&r.onError(a.status));const s=function(e){const t=e.response;return"string"!=typeof t?t:(0,i.stringToBytes)(t).buffer}(a);if(206===n){const e=a.getResponseHeader("Content-Range"),t=/bytes (\d+)-(\d+)\/(\d+)/.exec(e);r.onDone({begin:parseInt(t[1],10),chunk:s})}else s?r.onDone({begin:0,chunk:s}):r.onError&&r.onError(a.status)}hasPendingRequests(){for(const e in this.pendingRequests)return!0;return!1}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortAllRequests(){for(const e in this.pendingRequests)this.abortRequest(0|e)}abortRequest(e){const t=this.pendingRequests[e].xhr;delete this.pendingRequests[e],t.abort()}}t.PDFNetworkStream=class{constructor(e){this._source=e,this._manager=new n(e.url,{httpHeaders:e.httpHeaders,withCredentials:e.withCredentials}),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){const t=this._rangeRequestReaders.indexOf(e);t>=0&&this._rangeRequestReaders.splice(t,1)}getFullReader(){return(0,i.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new s(this._manager,this._source),this._fullRequestReader}getRangeReader(e,t){const r=new o(this._manager,e,t);return r.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(r),r}cancelAllRequests(e){this._fullRequestReader&&this._fullRequestReader.cancel(e),this._rangeRequestReaders.slice(0).forEach((function(t){t.cancel(e)}))}};class s{constructor(e,t){this._manager=e;const r={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._fullRequestId=e.requestFull(r),this._headersReceivedCapability=(0,i.createPromiseCapability)(),this._disableRange=t.disableRange||!1,this._contentLength=t.length,this._rangeChunkSize=t.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}_onHeadersReceived(){const e=this._fullRequestId,t=this._manager.getRequestXhr(e),r=e=>t.getResponseHeader(e),{allowRangeRequests:i,suggestedLength:n}=(0,a.validateRangeRequestCapabilities)({getResponseHeader:r,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});i&&(this._isRangeSupported=!0),this._contentLength=n||this._contentLength,this._filename=(0,a.extractFilenameFromHeader)(r),this._isRangeSupported&&this._manager.abortRequest(e),this._headersReceivedCapability.resolve()}_onDone(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=[])}_onError(e){const t=this._url,r=(0,a.createResponseStatusError)(e,t);this._storedError=r,this._headersReceivedCapability.reject(r),this._requests.forEach((function(e){e.reject(r)})),this._requests=[],this._cachedChunks=[]}_onProgress(e){this.onProgress&&this.onProgress({loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=(0,i.createPromiseCapability)();return this._requests.push(e),e.promise}cancel(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}}class o{constructor(e,t,r){this._manager=e;const i={onDone:this._onDone.bind(this),onProgress:this._onProgress.bind(this)};this._requestId=e.requestRange(t,r,i),this._requests=[],this._queuedChunk=null,this._done=!1,this.onProgress=null,this.onClosed=null}_close(){this.onClosed&&this.onClosed(this)}_onDone(e){const 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()}_onProgress(e){!this.isStreamingSupported&&this.onProgress&&this.onProgress({loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(null!==this._queuedChunk){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const e=(0,i.createPromiseCapability)();return this._requests.push(e),e.promise}cancel(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()}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFFetchStream=void 0;var i=r(2),a=r(20);function n(e,t,r){return{method:"GET",headers:e,signal:r&&r.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function s(e){const t=new Headers;for(const r in e){const i=e[r];void 0!==i&&t.append(r,i)}return t}t.PDFFetchStream=class{constructor(e){this.source=e,this.isHttp=/^https?:/i.test(e.url),this.httpHeaders=this.isHttp&&e.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?this._fullRequestReader._loaded:0}getFullReader(){return(0,i.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new o(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const r=new l(this,e,t);return this._rangeRequestReaders.push(r),r}cancelAllRequests(e){this._fullRequestReader&&this._fullRequestReader.cancel(e),this._rangeRequestReaders.slice(0).forEach((function(t){t.cancel(e)}))}};class o{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;const t=e.source;this._withCredentials=t.withCredentials||!1,this._contentLength=t.length,this._headersCapability=(0,i.createPromiseCapability)(),this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),"undefined"!=typeof AbortController&&(this._abortController=new AbortController),this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._headers=s(this._stream.httpHeaders);const r=t.url;fetch(r,n(this._headers,this._withCredentials,this._abortController)).then((e=>{if(!(0,a.validateResponseStatus)(e.status))throw(0,a.createResponseStatusError)(e.status,r);this._reader=e.body.getReader(),this._headersCapability.resolve();const t=t=>e.headers.get(t),{allowRangeRequests:n,suggestedLength:s}=(0,a.validateRangeRequestCapabilities)({getResponseHeader:t,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n,this._contentLength=s||this._contentLength,this._filename=(0,a.extractFilenameFromHeader)(t),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new i.AbortException("Streaming is disabled."))})).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._reader&&this._reader.cancel(e),this._abortController&&this._abortController.abort()}}class l{constructor(e,t,r){this._stream=e,this._reader=null,this._loaded=0;const o=e.source;this._withCredentials=o.withCredentials||!1,this._readCapability=(0,i.createPromiseCapability)(),this._isStreamingSupported=!o.disableStream,"undefined"!=typeof AbortController&&(this._abortController=new AbortController),this._headers=s(this._stream.httpHeaders),this._headers.append("Range",`bytes=${t}-${r-1}`);const l=o.url;fetch(l,n(this._headers,this._withCredentials,this._abortController)).then((e=>{if(!(0,a.validateResponseStatus)(e.status))throw(0,a.createResponseStatusError)(e.status,l);this._readCapability.resolve(),this._reader=e.body.getReader()})),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._reader&&this._reader.cancel(e),this._abortController&&this._abortController.abort()}}}])},module.exports=factory()},9016:(e,t,r)=>{("undefined"!=typeof window?window:{}).pdfjsWorker=r(7624)},7624:function(e,t,r){var i,a=r(4155);i=function(){return function(e){var t={};function r(i){if(t[i])return t[i].exports;var a=t[i]={i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},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 i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(i,a,function(t){return e[t]}.bind(null,a));return i},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){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"WorkerMessageHandler",{enumerable:!0,get:function(){return i.WorkerMessageHandler}});var i=r(1)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerMessageHandler=t.WorkerTask=void 0;var i=r(2),a=r(5),n=r(6),s=r(4),o=r(45),l=r(46),c=r(8),u=function(){function e(e){this.name=e,this.terminated=!1,this._capability=(0,i.createPromiseCapability)()}return e.prototype={get finished(){return this._capability.promise},finish(){this._capability.resolve()},terminate(){this.terminated=!0},ensureNotTerminated(){if(this.terminated)throw new Error("Worker task was terminated")}},e}();t.WorkerTask=u;var d,h={setup(e,t){var r=!1;e.on("test",(function(t){if(r)return;if(r=!0,!(t instanceof Uint8Array))return void e.send("test",null);const i=255===t[0];e.postMessageTransfers=i,e.send("test",{supportTransfers:i})})),e.on("configure",(function(e){(0,i.setVerbosityLevel)(e.verbosity)})),e.on("GetDocRequest",(function(e){return h.createDocumentHandler(e,t)}))},createDocumentHandler(e,t){var r,s=!1,d=null,h=[];const f=(0,i.getVerbosityLevel)(),p=e.apiVersion,g="2.5.207";if(p!==g)throw new Error(`The API version "${p}" does not match the Worker version "2.5.207".`);const m=[];for(const e in[])m.push(e);if(m.length)throw new Error("The `Array.prototype` contains unexpected enumerable properties: "+m.join(", ")+"; thus breaking e.g. `for...in` iteration of `Array`s.");if("undefined"==typeof ReadableStream||void 0===Promise.allSettled)throw new Error("The browser/environment lacks native support for critical functionality used by the PDF.js library (e.g. `ReadableStream` and/or `Promise.allSettled`); please use an ES5-compatible build instead.");var b=e.docId,v=e.docBaseUrl,y=e.docId+"_worker",w=new o.MessageHandler(y,b,t);function x(){if(s)throw new Error("Worker was terminated")}function k(e){h.push(e)}function A(e){e.finish();var t=h.indexOf(e);h.splice(t,1)}async function _(e){await r.ensureDoc("checkHeader"),await r.ensureDoc("parseStartXRef"),await r.ensureDoc("parse",[e]),e||await r.ensureDoc("checkFirstPage");const[t,i]=await Promise.all([r.ensureDoc("numPages"),r.ensureDoc("fingerprint")]);return{numPages:t,fingerprint:i}}function S(e,t){var r=(0,i.createPromiseCapability)();let a;var s=e.source;if(s.data){try{a=new n.LocalPdfManager(b,s.data,s.password,t,v),r.resolve(a)}catch(e){r.reject(e)}return r.promise}var o,c=[];try{o=new l.PDFWorkerStream(w)}catch(e){return r.reject(e),r.promise}var u=o.getFullReader();u.headersReady.then((function(){if(u.isRangeSupported){var e=s.disableAutoFetch||u.isStreamingSupported;a=new n.NetworkPdfManager(b,o,{msgHandler:w,password:s.password,length:u.contentLength,disableAutoFetch:e,rangeChunkSize:s.rangeChunkSize},t,v);for(let e=0;e=i.VerbosityLevel.INFOS?Date.now():0;r.getOperatorList({handler:w,sink:t,task:n,intent:e.intent,renderInteractiveForms:e.renderInteractiveForms}).then((function(e){A(n),s&&(0,i.info)(`page=${a+1} - getOperatorList: time=${Date.now()-s}ms, len=${e.length}`),t.close()}),(function(e){A(n),n.terminated||(w.send("UnsupportedFeature",{featureId:i.UNSUPPORTED_FEATURES.errorOperatorList}),t.error(e))}))}))}),this),w.on("GetTextContent",(function(e,t){var a=e.pageIndex;t.onPull=function(e){},t.onCancel=function(e){},r.getPage(a).then((function(r){var n=new u("GetTextContent: page "+a);k(n);const s=f>=i.VerbosityLevel.INFOS?Date.now():0;r.extractTextContent({handler:w,task:n,sink:t,normalizeWhitespace:e.normalizeWhitespace,combineTextItems:e.combineTextItems}).then((function(){A(n),s&&(0,i.info)(`page=${a+1} - getTextContent: time=`+(Date.now()-s)+"ms"),t.close()}),(function(e){A(n),n.terminated||t.error(e)}))}))})),w.on("FontFallback",(function(e){return r.fontFallback(e.id,w)})),w.on("Cleanup",(function(e){return r.cleanup(!0)})),w.on("Terminate",(function(e){s=!0;const t=[];if(r){r.terminate(new i.AbortException("Worker was terminated."));const e=r.cleanup();t.push(e),r=null}else(0,a.clearPrimitiveCaches)();return d&&d(new i.AbortException("Worker was terminated.")),h.forEach((function(e){t.push(e.finished),e.terminate()})),Promise.all(t).then((function(){w.destroy(),w=null}))})),w.on("Ready",(function(t){!function(e){function t(e){x(),w.send("GetDoc",{pdfInfo:e})}function a(e){if(x(),e instanceof i.PasswordException){var t=new u(`PasswordException: response ${e.code}`);k(t),w.sendWithPromise("PasswordRequest",e).then((function({password:e}){A(t),r.updatePassword(e),n()})).catch((function(){A(t),w.send("DocException",e)}))}else e instanceof i.InvalidPDFException||e instanceof i.MissingPDFException||e instanceof i.UnexpectedResponseException||e instanceof i.UnknownErrorException?w.send("DocException",e):w.send("DocException",new i.UnknownErrorException(e.message,e.toString()))}function n(){x(),_(!1).then(t,(function(e){x(),e instanceof c.XRefParseException?(r.requestLoadedStream(),r.onLoadedStream().then((function(){x(),_(!0).then(t,a)}))):a(e)}),a)}x(),S(e,{maxImageSize:e.maxImageSize,disableFontFace:e.disableFontFace,ignoreErrors:e.ignoreErrors,isEvalSupported:e.isEvalSupported,fontExtraProperties:e.fontExtraProperties}).then((function(e){if(s)throw e.terminate(new i.AbortException("Worker was terminated.")),new Error("Worker was terminated");(r=e).onLoadedStream().then((function(e){w.send("DataLoaded",{length:e.bytes.byteLength})}))})).then(n,a)}(e),e=null})),y},initializeFromPort(e){var t=new o.MessageHandler("worker","main",e);h.setup(t,e),t.send("ready",null)}};t.WorkerMessageHandler=h,"undefined"==typeof window&&!s.isNodeJS&&"undefined"!=typeof self&&"function"==typeof(d=self).postMessage&&"onmessage"in d&&h.initializeFromPort(self)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayByteLength=h,t.arraysToBytes=function(e){const t=e.length;if(1===t&&e[0]instanceof Uint8Array)return e[0];let r=0;for(let i=0;it}),e.promise=new Promise((function(r,i){e.resolve=function(e){t=!0,r(e)},e.reject=function(e){t=!0,i(e)}})),e},t.getVerbosityLevel=function(){return a},t.info=function(e){a>=i.INFOS&&console.log(`Info: ${e}`)},t.isArrayBuffer=function(e){return"object"==typeof 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(const 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){let r;try{if(r=new URL(e),!r.origin||"null"===r.origin)return!1}catch(e){return!1}const i=new URL(t,r);return r.origin===i.origin},t.createValidAbsoluteUrl=function(e,t){if(!e)return null;try{const 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?(n("The argument for removeNullCharacters must be a string."),e):e.replace(u,"")},t.setVerbosityLevel=function(e){Number.isInteger(e)&&(a=e)},t.shadow=l,t.string32=function(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)},t.stringToBytes=d,t.stringToPDFString=function(e){const t=e.length,r=[];if("þ"===e[0]&&"ÿ"===e[1])for(let i=2;i=i.WARNINGS&&console.log(`Warning: ${e}`)}function s(e){throw new Error(e)}function o(e,t){e||s(t)}function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!1}),r}const c=function(){function e(t){this.constructor===e&&s("Cannot initialize BaseException."),this.message=t,this.name=this.constructor.name}return e.prototype=new Error,e.constructor=e,e}();t.BaseException=c,t.PasswordException=class extends c{constructor(e,t){super(e),this.code=t}},t.UnknownErrorException=class extends c{constructor(e,t){super(e),this.details=t}},t.InvalidPDFException=class extends c{},t.MissingPDFException=class extends c{},t.UnexpectedResponseException=class extends c{constructor(e,t){super(e),this.status=t}},t.FormatError=class extends c{},t.AbortException=class extends c{};const u=/\x00/g;function d(e){o("string"==typeof e,"Invalid argument for stringToBytes");const t=e.length,r=new Uint8Array(t);for(let i=0;ie[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){function r(e,t){return e-t}const i=[e[0],e[2],t[0],t[2]].sort(r),a=[e[1],e[3],t[1],t[3]].sort(r),n=[];return e=m.normalizeRect(e),t=m.normalizeRect(t),i[0]===e[0]&&i[1]===t[0]||i[0]===t[0]&&i[1]===e[0]?(n[0]=i[1],n[2]=i[2],a[0]===e[1]&&a[1]===t[1]||a[0]===t[1]&&a[1]===e[1]?(n[1]=a[1],n[3]=a[2],n):null):null}}t.Util=m;const b=[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],v=function(){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return function(t,r,i=!1){if(!i&&URL.createObjectURL){const e=new Blob([t],{type:r});return URL.createObjectURL(e)}let a=`data:${r};base64,`;for(let r=0,i=t.length;r>2]+e[(3&n)<<4|s>>4]+e[r+1>6:64]+e[r+2=this.end?this.numChunks:Math.floor(t/this.chunkSize);for(let e=r;e=t)return;if(t<=this.progressiveDataLength)return;const r=this.chunkSize,i=Math.floor(e/r),n=Math.floor((t-1)/r)+1;for(let r=i;r=this.end?-1:(e>=this.progressiveDataLength&&this.ensureByte(e),this.bytes[this.pos++])}getUint16(){const e=this.getByte(),t=this.getByte();return-1===e||-1===t?-1:(e<<8)+t}getInt32(){return(this.getByte()<<24)+(this.getByte()<<16)+(this.getByte()<<8)+this.getByte()}getBytes(e,t=!1){const r=this.bytes,i=this.pos,a=this.end;if(!e){a>this.progressiveDataLength&&this.ensureRange(i,a);const e=r.subarray(i,a);return t?new Uint8ClampedArray(e):e}let n=i+e;n>a&&(n=a),n>this.progressiveDataLength&&this.ensureRange(i,n),this.pos=n;const s=r.subarray(i,n);return t?new Uint8ClampedArray(s):s}peekByte(){const e=this.getByte();return-1!==e&&this.pos--,e}peekBytes(e,t=!1){const r=this.getBytes(e,t);return this.pos-=r.length,r}getByteRange(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)}skip(e){e||(e=1),this.pos+=e}reset(){this.pos=this.start}moveStart(){this.start=this.pos}makeSubStream(e,t,r){function i(){}t?e+t>this.progressiveDataLength&&this.ensureRange(e,e+t):e>=this.progressiveDataLength&&this.ensureByte(e),i.prototype=Object.create(this),i.prototype.getMissingChunks=function(){const e=this.chunkSize,t=Math.floor(this.start/e),r=Math.floor((this.end-1)/e)+1,i=[];for(let e=t;e{const s=o=>{try{if(!o.done){const e=o.value;return a.push(e),n+=(0,i.arrayByteLength)(e),r.isStreamingSupported&&this.onProgress({loaded:n}),void r.read().then(s,t)}const l=(0,i.arraysToBytes)(a);a=null,e(l)}catch(e){t(e)}};r.read().then(s,t)})).then((t=>{this.aborted||this.onReceiveData({chunk:t,begin:e})}))}requestAllChunks(){const e=this.stream.getMissingChunks();return this._requestChunks(e),this._loadedStreamCapability.promise}_requestChunks(e){const t=this.currRequestId++,r=Object.create(null);this.chunksNeededByRequest[t]=r;for(const t of e)this.stream.hasChunk(t)||(r[t]=!0);if((0,i.isEmptyObj)(r))return Promise.resolve();const a=(0,i.createPromiseCapability)();this.promisesByRequest[t]=a;const n=[];for(let e in r)e|=0,e in this.requestsByChunk||(this.requestsByChunk[e]=[],n.push(e)),this.requestsByChunk[e].push(t);if(!n.length)return a.promise;const s=this.groupChunks(n);for(const e of s){const t=e.beginChunk*this.chunkSize,r=Math.min(e.endChunk*this.chunkSize,this.length);this.sendRequest(t,r)}return a.promise}getStream(){return this.stream}requestRange(e,t){t=Math.min(t,this.length);const r=this.getBeginChunk(e),i=this.getEndChunk(t),a=[];for(let e=r;e=0&&i+1!==n&&(t.push({beginChunk:r,endChunk:i+1}),r=n),a+1===e.length&&t.push({beginChunk:r,endChunk:n+1}),i=n}return t}onProgress(e){this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize+e.loaded,total:this.length})}onReceiveData(e){const t=e.chunk,r=void 0===e.begin,a=r?this.progressiveDataLength:e.begin,n=a+t.byteLength,s=Math.floor(a/this.chunkSize),o=n100){(0,i.warn)(`getInheritableProperty: maximum loop count exceeded for "${t}"`);break}e=e.get("Parent")}return n},t.toRomanNumerals=function(e,t=!1){(0,i.assert)(Number.isInteger(e)&&e>0,"The number should be a positive integer.");const r=[];let a;for(;e>=1e3;)e-=1e3,r.push("M");a=e/100|0,e%=100,r.push(o[a]),a=e/10|0,e%=10,r.push(o[10+a]),r.push(o[20+e]);const n=r.join("");return t?n.toLowerCase():n},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 i=r(2);class a extends i.BaseException{constructor(e,t){super(`Missing data [${e}, ${t})`),this.begin=e,this.end=t}}t.MissingDataException=a;class n extends i.BaseException{}t.XRefEntryException=n;class s extends i.BaseException{}t.XRefParseException=s;const o=["","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){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFDocument=t.Page=void 0;var i=r(2),a=r(10),n=r(5),s=r(8),o=r(12),l=r(25),c=r(22),u=r(11),d=r(26),h=r(27),f=r(41);const p=[0,0,612,792];function g(e,t){return"display"===t&&e.viewable||"print"===t&&e.printable}class m{constructor({pdfManager:e,xref:t,pageIndex:r,pageDict:i,ref:a,fontCache:n,builtInCMapCache:s,globalImageCache:o,pdfFunctionFactory:l}){this.pdfManager=e,this.pageIndex=r,this.pageDict=i,this.xref=t,this.ref=a,this.fontCache=n,this.builtInCMapCache=s,this.globalImageCache=o,this.pdfFunctionFactory=l,this.evaluatorOptions=e.evaluatorOptions,this.resourcesPromise=null;const c={obj:0};this.idFactory={createObjId:()=>`p${r}_${++c.obj}`,getDocId:()=>`g_${e.docId}`}}_getInheritableProperty(e,t=!1){const r=(0,s.getInheritableProperty)({dict:this.pageDict,key:e,getArray:t,stopWhenFound:!1});return Array.isArray(r)?1!==r.length&&(0,n.isDict)(r[0])?n.Dict.merge(this.xref,r):r[0]:r}get content(){return this.pageDict.get("Contents")}get resources(){return(0,i.shadow)(this,"resources",this._getInheritableProperty("Resources")||n.Dict.empty)}_getBoundingBox(e){const 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 /${e} entry.`)}return null}get mediaBox(){return(0,i.shadow)(this,"mediaBox",this._getBoundingBox("MediaBox")||p)}get cropBox(){return(0,i.shadow)(this,"cropBox",this._getBoundingBox("CropBox")||this.mediaBox)}get userUnit(){let e=this.pageDict.get("UserUnit");return(!(0,i.isNum)(e)||e<=0)&&(e=1),(0,i.shadow)(this,"userUnit",e)}get view(){const{cropBox:e,mediaBox:t}=this;let r;if(e===t||(0,i.isArrayEqual)(e,t))r=t;else{const a=i.Util.intersect(e,t);a&&a[2]-a[0]!=0&&a[3]-a[1]!=0?r=a:(0,i.warn)("Empty /CropBox and /MediaBox intersection.")}return(0,i.shadow)(this,"view",r||t)}get rotate(){let e=this._getInheritableProperty("Rotate")||0;return e%90!=0?e=0:e>=360?e%=360:e<0&&(e=(e%360+360)%360),(0,i.shadow)(this,"rotate",e)}getContentStream(){const e=this.content;let t;if(Array.isArray(e)){const r=this.xref,i=[];for(const t of e)i.push(r.fetchIfRef(t));t=new o.StreamsSequenceStream(i)}else t=(0,n.isStream)(e)?e:new o.NullStream;return t}loadResources(e){return this.resourcesPromise||(this.resourcesPromise=this.pdfManager.ensure(this,"resources")),this.resourcesPromise.then((()=>new a.ObjectLoader(this.resources,e,this.xref).load()))}getOperatorList({handler:e,sink:t,task:r,intent:a,renderInteractiveForms:n}){const s=this.pdfManager.ensure(this,"getContentStream"),o=this.loadResources(["ExtGState","ColorSpace","Pattern","Shading","XObject","Font"]),l=new h.PartialEvaluator({xref:this.xref,handler:e,pageIndex:this.pageIndex,idFactory:this.idFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,globalImageCache:this.globalImageCache,options:this.evaluatorOptions,pdfFunctionFactory:this.pdfFunctionFactory}),c=Promise.all([s,o]).then((([i])=>{const n=new d.OperatorList(a,t,this.pageIndex);return e.send("StartRenderPage",{transparency:l.hasBlendModes(this.resources),pageIndex:this.pageIndex,intent:a}),l.getOperatorList({stream:i,task:r,resources:this.resources,operatorList:n}).then((function(){return n}))}));return Promise.all([c,this._parsedAnnotations]).then((function([e,t]){if(0===t.length)return e.flush(!0),{length:e.totalLength};const s=[];for(const e of t)g(e,a)&&s.push(e.getOperatorList(l,r,n).catch((function(e){return(0,i.warn)(`getOperatorList - ignoring annotation data during "${r.name}" task: "${e}".`),null})));return Promise.all(s).then((function(t){e.addOp(i.OPS.beginAnnotations,[]);for(const r of t)e.addOpList(r);return e.addOp(i.OPS.endAnnotations,[]),e.flush(!0),{length:e.totalLength}}))}))}extractTextContent({handler:e,task:t,normalizeWhitespace:r,sink:i,combineTextItems:a}){const n=this.pdfManager.ensure(this,"getContentStream"),s=this.loadResources(["ExtGState","XObject","Font"]);return Promise.all([n,s]).then((([n])=>new h.PartialEvaluator({xref:this.xref,handler:e,pageIndex:this.pageIndex,idFactory:this.idFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,globalImageCache:this.globalImageCache,options:this.evaluatorOptions,pdfFunctionFactory:this.pdfFunctionFactory}).getTextContent({stream:n,task:t,resources:this.resources,normalizeWhitespace:r,combineTextItems:a,sink:i})))}getAnnotationsData(e){return this._parsedAnnotations.then((function(t){const r=[];for(let i=0,a=t.length;i{const e=[];for(const t of this.annotations)e.push(l.AnnotationFactory.create(this.xref,t,this.pdfManager,this.idFactory).catch((function(e){return(0,i.warn)(`_parsedAnnotations: "${e}".`),null})));return Promise.all(e).then((function(e){return e.filter((e=>!!e))}))}));return(0,i.shadow)(this,"_parsedAnnotations",e)}}t.Page=m;const b=new Uint8Array([37,80,68,70,45]),v=new Uint8Array([115,116,97,114,116,120,114,101,102]),y=new Uint8Array([101,110,100,111,98,106]),w=/^[1-9]\.[0-9]$/;function x(e,t,r=1024,i=!1){const a=t.length,n=e.peekBytes(r),s=n.length-a;if(s<=0)return!1;if(i){const r=a-1;let i=n.length-1;for(;i>=r;){let s=0;for(;s=a)return e.pos+=i-r,!0;i--}}else{let r=0;for(;r<=s;){let i=0;for(;i=a)return e.pos+=r,!0;r++}}return!1}t.PDFDocument=class{constructor(e,t){let r;if((0,n.isStream)(t))r=t;else{if(!(0,i.isArrayBuffer)(t))throw new Error("PDFDocument: Unknown argument type");r=new o.Stream(t)}if(r.length<=0)throw new i.InvalidPDFException("The PDF file is empty, i.e. its size is zero bytes.");this.pdfManager=e,this.stream=r,this.xref=new a.XRef(r,e),this.pdfFunctionFactory=new f.PDFFunctionFactory({xref:this.xref,isEvalSupported:e.evaluatorOptions.isEvalSupported}),this._pagePromises=[]}parse(e){this.setup(e);const t=this.catalog.catDict.get("Version");(0,n.isName)(t)&&(this.pdfFormatVersion=t.name);try{if(this.acroForm=this.catalog.catDict.get("AcroForm"),this.acroForm){this.xfa=this.acroForm.get("XFA");const e=this.acroForm.get("Fields");Array.isArray(e)&&0!==e.length||this.xfa||(this.acroForm=null)}}catch(e){if(e instanceof s.MissingDataException)throw e;(0,i.info)("Cannot fetch AcroForm entry; assuming no AcroForms are present"),this.acroForm=null}try{const e=this.catalog.catDict.get("Collection");(0,n.isDict)(e)&&e.getKeys().length>0&&(this.collection=e)}catch(e){if(e instanceof s.MissingDataException)throw e;(0,i.info)("Cannot fetch Collection dictionary.")}}get linearization(){let e=null;try{e=u.Linearization.create(this.stream)}catch(e){if(e instanceof s.MissingDataException)throw e;(0,i.info)(e)}return(0,i.shadow)(this,"linearization",e)}get startXRef(){const e=this.stream;let t=0;if(this.linearization)e.reset(),x(e,y)&&(t=e.pos+6-e.start);else{const r=1024,i=v.length;let a=!1,n=e.end;for(;!a&&n>0;)n-=r-i,n<0&&(n=0),e.pos=n,a=x(e,v,r,!0);if(a){let r;e.skip(9);do{r=e.getByte()}while((0,s.isWhiteSpace)(r));let i="";for(;r>=32&&r<=57;)i+=String.fromCharCode(r),r=e.getByte();t=parseInt(i,10),isNaN(t)&&(t=0)}}return(0,i.shadow)(this,"startXRef",t)}checkHeader(){const e=this.stream;if(e.reset(),!x(e,b))return;e.moveStart();let t,r="";for(;(t=e.getByte())>32&&!(r.length>=12);)r+=String.fromCharCode(t);this.pdfFormatVersion||(this.pdfFormatVersion=r.substring(5))}parseStartXRef(){this.xref.setStartXRef(this.startXRef)}setup(e){this.xref.parse(e),this.catalog=new a.Catalog(this.pdfManager,this.xref)}get numPages(){const e=this.linearization,t=e?e.numPages:this.catalog.numPages;return(0,i.shadow)(this,"numPages",t)}get documentInfo(){const 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:n.isName};let t=this.pdfFormatVersion;"string"==typeof t&&w.test(t)||((0,i.warn)(`Invalid PDF header version number: ${t}`),t=null);const r={PDFFormatVersion:t,IsLinearized:!!this.linearization,IsAcroFormPresent:!!this.acroForm,IsXFAPresent:!!this.xfa,IsCollectionPresent:!!this.collection};let a;try{a=this.xref.trailer.get("Info")}catch(e){if(e instanceof s.MissingDataException)throw e;(0,i.info)("The document information dictionary is invalid.")}if((0,n.isDict)(a))for(const t of a.getKeys()){const s=a.get(t);if(e[t])e[t](s)?r[t]="string"!=typeof s?s:(0,i.stringToPDFString)(s):(0,i.info)(`Bad value in document info for "${t}".`);else if("string"==typeof t){let e;if((0,i.isString)(s))e=(0,i.stringToPDFString)(s);else{if(!((0,n.isName)(s)||(0,i.isNum)(s)||(0,i.isBool)(s))){(0,i.info)(`Unsupported value in document info for (custom) "${t}".`);continue}e=s}r.Custom||(r.Custom=Object.create(null)),r.Custom[t]=e}}return(0,i.shadow)(this,"documentInfo",r)}get fingerprint(){let e;const t=this.xref.trailer.get("ID");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,c.calculateMD5)(this.stream.getByteRange(0,1024),0,1024);const r=[];for(let t=0,i=e.length;t{if((0,n.isDict)(e,"Page")||(0,n.isDict)(e)&&!e.has("Type")&&e.has("Contents"))return a&&!t.pageKidsCountCache.has(a)&&t.pageKidsCountCache.put(a,1),[e,a];throw new i.FormatError("The Linearization dictionary doesn't point to a valid Page dictionary.")})).catch((r=>((0,i.info)(r),t.getPageDict(e))))}getPage(e){if(void 0!==this._pagePromises[e])return this._pagePromises[e];const{catalog:t,linearization:r}=this,i=r&&r.pageFirst===e?this._getLinearizationPage(e):t.getPageDict(e);return this._pagePromises[e]=i.then((([r,i])=>new m({pdfManager:this.pdfManager,xref:this.xref,pageIndex:e,pageDict:r,ref:i,fontCache:t.fontCache,builtInCMapCache:t.builtInCMapCache,globalImageCache:t.globalImageCache,pdfFunctionFactory:this.pdfFunctionFactory})))}checkFirstPage(){return this.getPage(0).catch((async e=>{if(e instanceof s.XRefEntryException)throw this._pagePromises.length=0,await this.cleanup(),new s.XRefParseException}))}fontFallback(e,t){return this.catalog.fontFallback(e,t)}async cleanup(e=!1){return this.catalog?this.catalog.cleanup(e):(0,n.clearPrimitiveCaches)()}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSpec=t.XRef=t.ObjectLoader=t.Catalog=void 0;var i=r(2),a=r(5),n=r(11),s=r(8),o=r(22),l=r(23),c=r(24);function u(e){return(0,a.isDict)(e)?e.get("D"):e}class d{constructor(e,t){if(this.pdfManager=e,this.xref=t,this.catDict=t.getCatalogObj(),!(0,a.isDict)(this.catDict))throw new i.FormatError("Catalog object is not a dictionary.");this.fontCache=new a.RefSetCache,this.builtInCMapCache=new Map,this.globalImageCache=new c.GlobalImageCache,this.pageKidsCountCache=new a.RefSetCache}get metadata(){const e=this.catDict.getRaw("Metadata");if(!(0,a.isRef)(e))return(0,i.shadow)(this,"metadata",null);const t=!(this.xref.encrypt&&this.xref.encrypt.encryptMetadata),r=this.xref.fetch(e,t);let n;if(r&&(0,a.isDict)(r.dict)){const e=r.dict.get("Type"),t=r.dict.get("Subtype");if((0,a.isName)(e,"Metadata")&&(0,a.isName)(t,"XML"))try{n=(0,i.stringToUTF8String)((0,i.bytesToString)(r.getBytes()))}catch(e){if(e instanceof s.MissingDataException)throw e;(0,i.info)("Skipping invalid metadata.")}}return(0,i.shadow)(this,"metadata",n)}get toplevelPagesDict(){const e=this.catDict.get("Pages");if(!(0,a.isDict)(e))throw new i.FormatError("Invalid top-level pages dictionary.");return(0,i.shadow)(this,"toplevelPagesDict",e)}get documentOutline(){let e=null;try{e=this._readDocumentOutline()}catch(e){if(e instanceof s.MissingDataException)throw e;(0,i.warn)("Unable to read document outline.")}return(0,i.shadow)(this,"documentOutline",e)}_readDocumentOutline(){let e=this.catDict.get("Outlines");if(!(0,a.isDict)(e))return null;if(e=e.getRaw("First"),!(0,a.isRef)(e))return null;const t={items:[]},r=[{obj:e,parent:t}],n=new a.RefSet;n.put(e);const s=this.xref,o=new Uint8ClampedArray(3);for(;r.length>0;){const t=r.shift(),c=s.fetchIfRef(t.obj);if(null===c)continue;if(!c.has("Title"))throw new i.FormatError("Invalid outline item encountered.");const u={url:null,dest:null};d.parseDestDictionary({destDict:c,resultObj:u,docBaseUrl:this.pdfManager.docBaseUrl});const h=c.get("Title"),f=c.get("F")||0,p=c.getArray("C"),g=c.get("Count");let m=o;!Array.isArray(p)||3!==p.length||0===p[0]&&0===p[1]&&0===p[2]||(m=l.ColorSpace.singletons.rgb.getRgb(p,0));const b={dest:u.dest,url:u.url,unsafeUrl:u.unsafeUrl,newWindow:u.newWindow,title:(0,i.stringToPDFString)(h),color:m,count:Number.isInteger(g)?g:void 0,bold:!!(2&f),italic:!!(1&f),items:[]};t.parent.items.push(b),e=c.getRaw("First"),(0,a.isRef)(e)&&!n.has(e)&&(r.push({obj:e,parent:b}),n.put(e)),e=c.getRaw("Next"),(0,a.isRef)(e)&&!n.has(e)&&(r.push({obj:e,parent:t.parent}),n.put(e))}return t.items.length>0?t.items:null}get permissions(){let e=null;try{e=this._readPermissions()}catch(e){if(e instanceof s.MissingDataException)throw e;(0,i.warn)("Unable to read permissions.")}return(0,i.shadow)(this,"permissions",e)}_readPermissions(){const e=this.xref.trailer.get("Encrypt");if(!(0,a.isDict)(e))return null;let t=e.get("P");if(!(0,i.isNum)(t))return null;t+=2**32;const r=[];for(const e in i.PermissionFlag){const a=i.PermissionFlag[e];t&a&&r.push(a)}return r}get numPages(){const e=this.toplevelPagesDict.get("Count");if(!Number.isInteger(e))throw new i.FormatError("Page count in top-level pages dictionary is not an integer.");return(0,i.shadow)(this,"numPages",e)}get destinations(){const e=this._readDests(),t=Object.create(null);if(e instanceof p){const r=e.getAll();for(const e in r)t[e]=u(r[e])}else e instanceof a.Dict&&e.forEach((function(e,r){r&&(t[e]=u(r))}));return(0,i.shadow)(this,"destinations",t)}getDestination(e){const t=this._readDests();return t instanceof p||t instanceof a.Dict?u(t.get(e)||null):null}_readDests(){const e=this.catDict.get("Names");return e&&e.has("Dests")?new p(e.getRaw("Dests"),this.xref):this.catDict.has("Dests")?this.catDict.get("Dests"):void 0}get pageLabels(){let e=null;try{e=this._readPageLabels()}catch(e){if(e instanceof s.MissingDataException)throw e;(0,i.warn)("Unable to read page labels.")}return(0,i.shadow)(this,"pageLabels",e)}_readPageLabels(){const e=this.catDict.getRaw("PageLabels");if(!e)return null;const t=new Array(this.numPages);let r=null,n="";const o=new g(e,this.xref).getAll();let l="",c=1;for(let e=0,u=this.numPages;e=1))throw new i.FormatError("Invalid start in PageLabel dictionary.");c=e}else c=1}switch(r){case"D":l=c;break;case"R":case"r":l=(0,s.toRomanNumerals)(c,"r"===r);break;case"A":case"a":const e=26,t=65,a=97,n="a"===r?a:t,o=c-1,u=String.fromCharCode(n+o%e),d=[];for(let t=0,r=o/e|0;t<=r;t++)d.push(u);l=d.join("");break;default:if(r)throw new i.FormatError(`Invalid style "${r}" in PageLabel dictionary.`);l=""}t[e]=n+l,c++}return t}get pageLayout(){const e=this.catDict.get("PageLayout");let t="";if((0,a.isName)(e))switch(e.name){case"SinglePage":case"OneColumn":case"TwoColumnLeft":case"TwoColumnRight":case"TwoPageLeft":case"TwoPageRight":t=e.name}return(0,i.shadow)(this,"pageLayout",t)}get pageMode(){const e=this.catDict.get("PageMode");let t="UseNone";if((0,a.isName)(e))switch(e.name){case"UseNone":case"UseOutlines":case"UseThumbs":case"FullScreen":case"UseOC":case"UseAttachments":t=e.name}return(0,i.shadow)(this,"pageMode",t)}get viewerPreferences(){const e={HideToolbar:i.isBool,HideMenubar:i.isBool,HideWindowUI:i.isBool,FitWindow:i.isBool,CenterWindow:i.isBool,DisplayDocTitle:i.isBool,NonFullScreenPageMode:a.isName,Direction:a.isName,ViewArea:a.isName,ViewClip:a.isName,PrintArea:a.isName,PrintClip:a.isName,PrintScaling:a.isName,Duplex:a.isName,PickTrayByPDFSize:i.isBool,PrintPageRange:Array.isArray,NumCopies:Number.isInteger},t=this.catDict.get("ViewerPreferences");let r=null;if((0,a.isDict)(t))for(const a in e){if(!t.has(a))continue;const n=t.get(a);if(!e[a](n)){(0,i.info)(`Bad value in ViewerPreferences for "${a}".`);continue}let s;switch(a){case"NonFullScreenPageMode":switch(n.name){case"UseNone":case"UseOutlines":case"UseThumbs":case"UseOC":s=n.name;break;default:s="UseNone"}break;case"Direction":switch(n.name){case"L2R":case"R2L":s=n.name;break;default:s="L2R"}break;case"ViewArea":case"ViewClip":case"PrintArea":case"PrintClip":switch(n.name){case"MediaBox":case"CropBox":case"BleedBox":case"TrimBox":case"ArtBox":s=n.name;break;default:s="CropBox"}break;case"PrintScaling":switch(n.name){case"None":case"AppDefault":s=n.name;break;default:s="AppDefault"}break;case"Duplex":switch(n.name){case"Simplex":case"DuplexFlipShortEdge":case"DuplexFlipLongEdge":s=n.name;break;default:s="None"}break;case"PrintPageRange":if(n.length%2!=0)break;n.every(((e,t,r)=>Number.isInteger(e)&&e>0&&(0===t||e>=r[t-1])&&e<=this.numPages))&&(s=n);break;case"NumCopies":n>0&&(s=n);break;default:if("boolean"!=typeof n)throw new i.FormatError(`viewerPreferences - expected a boolean value for: ${a}`);s=n}void 0!==s?(r||(r=Object.create(null)),r[a]=s):(0,i.info)(`Bad value in ViewerPreferences for "${a}".`)}return(0,i.shadow)(this,"viewerPreferences",r)}get openAction(){const e=this.catDict.get("OpenAction");let t=null;if((0,a.isDict)(e)){const r=new a.Dict(this.xref);r.set("A",e);const i={url:null,dest:null,action:null};d.parseDestDictionary({destDict:r,resultObj:i}),Array.isArray(i.dest)?(t||(t=Object.create(null)),t.dest=i.dest):i.action&&(t||(t=Object.create(null)),t.action=i.action)}else Array.isArray(e)&&(t||(t=Object.create(null)),t.dest=e);return(0,i.shadow)(this,"openAction",t)}get attachments(){const e=this.catDict.get("Names");let t=null;if(e&&e.has("EmbeddedFiles")){const r=new p(e.getRaw("EmbeddedFiles"),this.xref).getAll();for(const e in r){const a=new m(r[e],this.xref);t||(t=Object.create(null)),t[(0,i.stringToPDFString)(e)]=a.serializable}}return(0,i.shadow)(this,"attachments",t)}get javaScript(){const e=this.catDict.get("Names");let t=null;function r(e){const r=e.get("S");if(!(0,a.isName)(r,"JavaScript"))return;let n=e.get("JS");if((0,a.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")){const t=new p(e.getRaw("JavaScript"),this.xref).getAll();for(const e in t){const i=t[e];(0,a.isDict)(i)&&r(i)}}const n=this.catDict.get("OpenAction");return(0,a.isDict)(n)&&(0,a.isName)(n.get("S"),"JavaScript")&&r(n),(0,i.shadow)(this,"javaScript",t)}fontFallback(e,t){const r=[];return this.fontCache.forEach((function(e){r.push(e)})),Promise.all(r).then((r=>{for(const i of r)if(i.loadedName===e)return void i.fallback(t)}))}cleanup(e=!1){(0,a.clearPrimitiveCaches)(),this.globalImageCache.clear(e),this.pageKidsCountCache.clear();const t=[];return this.fontCache.forEach((function(e){t.push(e)})),Promise.all(t).then((e=>{for(const{dict:t}of e)delete t.translated;this.fontCache.clear(),this.builtInCMapCache.clear()}))}getPageDict(e){const t=(0,i.createPromiseCapability)(),r=[this.catDict.getRaw("Pages")],n=new a.RefSet,s=this.xref,o=this.pageKidsCountCache;let l,c=0;return function u(){for(;r.length;){const d=r.pop();if((0,a.isRef)(d)){if(l=o.get(d),l>0&&c+l=0){const t=d.objId;if(t&&!o.has(t)&&o.put(t,l),c+l<=e){c+=l;continue}}const h=d.get("Kids");if(!Array.isArray(h)){if((0,a.isName)(d.get("Type"),"Page")||!d.has("Type")&&d.has("Contents")){if(c===e)return void t.resolve([d,null]);c++;continue}return void t.reject(new i.FormatError("Page dictionary kids object is not an array."))}for(let e=h.length-1;e>=0;e--)r.push(h[e])}t.reject(new Error(`Page index ${e} not found.`))}(),t.promise}getPageIndex(e){const t=this.xref;let r=0;return function n(s){return function(r){let n,s=0;return t.fetchAsync(r).then((function(t){if((0,a.isRefsEqual)(r,e)&&!(0,a.isDict)(t,"Page")&&(!(0,a.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,a.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,a.isDict)(e))throw new i.FormatError("Parent must be a dictionary.");return e.getAsync("Kids")})).then((function(e){if(!e)return null;const o=[];let l=!1;for(let n=0,c=e.length;n0;){var u=c[0],d=c[1];if(!Number.isInteger(u)||!Number.isInteger(d))throw new i.FormatError(`Invalid XRef range fields: ${u}, ${d}`);if(!Number.isInteger(s)||!Number.isInteger(o)||!Number.isInteger(l))throw new i.FormatError(`Invalid XRef entry fields length: ${u}, ${d}`);for(t=a.entryNum;t=e.length);)r+=String.fromCharCode(i),i=e[t];return r}function t(e,t,r){for(var i=r.length,a=e.length,n=0;t=i)break;t++,n++}return n}var r=/^(\d+)\s+(\d+)\s+obj\b/;const o=/\bendobj[\b\s]$/,l=/\s+(\d+\s+\d+\s+obj[\b\s<])$/;var c=new Uint8Array([116,114,97,105,108,101,114]),u=new Uint8Array([115,116,97,114,116,120,114,101,102]);const d=new Uint8Array([111,98,106]);var h=new Uint8Array([47,88,82,101,102]);this.entries.length=0;var f=this.stream;f.pos=0;for(var p,g,m=f.getBytes(),b=f.start,v=m.length,y=[],w=[];b=v)break;x=m[b]}while(10!==x&&13!==x);else++b}for(p=0,g=w.length;p0;){const s=t.fetchIfRef(n.shift());if(!(0,a.isDict)(s))continue;if(s.has("Kids")){const e=s.get("Kids");for(let t=0,a=e.length;t10)return(0,i.warn)(`Search depth limit reached for "${this._type}" tree.`),null;const n=r.get("Kids");if(!Array.isArray(n))return null;let s=0,o=n.length-1;for(;s<=o;){const i=s+o>>1,a=t.fetchIfRef(n[i]).get("Limits");if(et.fetchIfRef(a[1]))){r=t.fetchIfRef(n[i]);break}s=i+1}}if(s>o)return null}const n=r.get(this._type);if(Array.isArray(n)){let r=0,a=n.length-2;for(;r<=a;){const i=r+a>>1,s=i+(1&i),o=t.fetchIfRef(n[s]);if(eo))return t.fetchIfRef(n[s+1]);r=s+2}}(0,i.info)(`Falling back to an exhaustive search, for key "${e}", in "${this._type}" tree.`);for(let r=0,a=n.length;r>")&&!(0,n.isEOF)(this.buf1);){if(!(0,n.isName)(this.buf1)){(0,a.info)("Malformed dictionary: key must be a name object"),this.shift();continue}const t=this.buf1.name;if(this.shift(),(0,n.isEOF)(this.buf1))break;i.set(t,this.getObj(e))}if((0,n.isEOF)(this.buf1)){if(!this.recoveryMode)throw new a.FormatError("End of file inside dictionary");return i}return(0,n.isCmd)(this.buf2,"stream")?this.allowStreams?this.makeStream(i,e):i:(this.shift(),i);default:return t}if(Number.isInteger(t)){if(Number.isInteger(this.buf1)&&(0,n.isCmd)(this.buf2,"R")){const e=n.Ref.get(t,this.buf1);return this.shift(),this.shift(),e}return t}return"string"==typeof t&&e?e.decryptString(t):t}findDefaultInlineStreamEnd(e){const t=e.pos;let r,i,n=0;for(;-1!==(r=e.getByte());)if(0===n)n=69===r?1:0;else if(1===n)n=73===r?2:0;else if((0,a.assert)(2===n,"findDefaultInlineStreamEnd - invalid state."),32===r||10===r||13===r){i=e.pos;const t=e.peekBytes(10);for(let e=0,i=t.length;e127)){n=0;break}if(2===n)break}else n=0;-1===r&&((0,a.warn)("findDefaultInlineStreamEnd: Reached the end of the stream without finding a valid EI marker"),i&&((0,a.warn)('... trying to recover by using the last "EI" occurrence.'),e.skip(-(e.pos-i))));let o=4;return e.skip(-o),r=e.peekByte(),e.skip(o),(0,s.isWhiteSpace)(r)||o--,e.pos-o-t}findDCTDecodeInlineStreamEnd(e){const t=e.pos;let r,i,n=!1;for(;-1!==(r=e.getByte());)if(255===r){switch(e.getByte()){case 0:break;case 255:e.skip(-1);break;case 217:n=!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:i=e.getUint16(),i>2?e.skip(i-2):e.skip(-2)}if(n)break}const s=e.pos-t;return-1===r?((0,a.warn)("Inline DCTDecode image stream: EOI marker not found, searching for /EI/ instead."),e.skip(-s),this.findDefaultInlineStreamEnd(e)):(this.inlineStreamSkipEI(e),s)}findASCII85DecodeInlineStreamEnd(e){const t=e.pos;let r;for(;-1!==(r=e.getByte());)if(126===r){const t=e.pos;for(r=e.peekByte();(0,s.isWhiteSpace)(r);)e.skip(),r=e.peekByte();if(62===r){e.skip();break}if(e.pos>t){const t=e.peekBytes(2);if(69===t[0]&&73===t[1])break}}const i=e.pos-t;return-1===r?((0,a.warn)("Inline ASCII85Decode image stream: EOD marker not found, searching for /EI/ instead."),e.skip(-i),this.findDefaultInlineStreamEnd(e)):(this.inlineStreamSkipEI(e),i)}findASCIIHexDecodeInlineStreamEnd(e){const t=e.pos;let r;for(;-1!==(r=e.getByte())&&62!==r;);const i=e.pos-t;return-1===r?((0,a.warn)("Inline ASCIIHexDecode image stream: EOD marker not found, searching for /EI/ instead."),e.skip(-i),this.findDefaultInlineStreamEnd(e)):(this.inlineStreamSkipEI(e),i)}inlineStreamSkipEI(e){let t,r=0;for(;-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}makeInlineImage(e){const t=this.lexer,r=t.stream,i=new n.Dict(this.xref);let s;for(;!(0,n.isCmd)(this.buf1,"ID")&&!(0,n.isEOF)(this.buf1);){if(!(0,n.isName)(this.buf1))throw new a.FormatError("Dictionary key must be a name object");const t=this.buf1.name;if(this.shift(),(0,n.isEOF)(this.buf1))break;i.set(t,this.getObj(e))}-1!==t.beginInlineImagePos&&(s=r.pos-t.beginInlineImagePos);const o=i.get("Filter","F");let l;if((0,n.isName)(o))l=o.name;else if(Array.isArray(o)){const e=this.xref.fetchIfRef(o[0]);(0,n.isName)(e)&&(l=e.name)}const c=r.pos;let u;u="DCTDecode"===l||"DCT"===l?this.findDCTDecodeInlineStreamEnd(r):"ASCII85Decode"===l||"A85"===l?this.findASCII85DecodeInlineStreamEnd(r):"ASCIIHexDecode"===l||"AHx"===l?this.findASCIIHexDecodeInlineStreamEnd(r):this.findDefaultInlineStreamEnd(r);let h,f=r.makeSubStream(c,u,i);if(u<1e3&&s<5552){const e=f.getBytes();f.reset();const i=r.pos;r.pos=t.beginInlineImagePos;const a=r.getBytes(s);r.pos=i,h=d(e)+"_"+d(a);const o=this.imageCache[h];if(void 0!==o)return this.buf2=n.Cmd.get("EI"),this.shift(),o.reset(),o}return e&&(f=e.createStream(f,u)),f=this.filter(f,i,u),f.dict=i,void 0!==h&&(f.cacheKey=`inline_${u}_${h}`,this.imageCache[h]=f),this.buf2=n.Cmd.get("EI"),this.shift(),f}_findStreamLength(e,t){const{stream:r}=this.lexer;r.pos=e;const i=t.length;for(;r.pos=i)return r.pos+=s,r.pos-e;s++}r.pos+=n}return-1}makeStream(e,t){const r=this.lexer;let i=r.stream;r.skipToNextLine();const o=i.pos-1;let l=e.get("Length");if(Number.isInteger(l)||((0,a.info)(`Bad length "${l}" in stream`),l=0),i.pos=o+l,r.nextChar(),this.tryShift()&&(0,n.isCmd)(this.buf2,"endstream"))this.shift();else{const e=new Uint8Array([101,110,100,115,116,114,101,97,109]);let t=this._findStreamLength(o,e);if(t<0){const r=1;for(let n=1;n<=r;n++){const r=e.length-n,l=e.slice(0,r),c=this._findStreamLength(o,l);if(c>=0){const e=i.peekBytes(r+1)[r];if(!(0,s.isWhiteSpace)(e))break;(0,a.info)(`Found "${(0,a.bytesToString)(l)}" when searching for endstream command.`),t=c;break}}if(t<0)throw new a.FormatError("Missing endstream command.")}l=t,r.nextChar(),this.shift(),this.shift()}return this.shift(),i=i.makeSubStream(o,l,e),t&&(i=t.createStream(i,l)),i=this.filter(i,e,l),i.dict=e,i}filter(e,t,r){let i=t.get("Filter","F"),s=t.get("DecodeParms","DP");if((0,n.isName)(i))return Array.isArray(s)&&(0,a.warn)("/DecodeParms should not contain an Array, when /Filter contains a Name."),this.makeFilter(e,i.name,r,s);let o=r;if(Array.isArray(i)){const t=i,r=s;for(let l=0,c=t.length;l=48&&e<=57?15&e:e>=65&&e<=70||e>=97&&e<=102?9+(15&e):-1}class g{constructor(e,t=null){this.stream=e,this.nextChar(),this.strBuf=[],this.knownCommands=t,this._hexStringNumWarn=0,this.beginInlineImagePos=-1}nextChar(){return this.currentChar=this.stream.getByte()}peekChar(){return this.stream.peekByte()}getNumber(){let e=this.currentChar,t=!1,r=0,i=0;if(45===e?(i=-1,e=this.nextChar(),45===e&&(e=this.nextChar())):43===e&&(i=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===i&&((0,s.isWhiteSpace)(e)||-1===e))return(0,a.warn)("Lexer.getNumber - treating a single decimal point as zero."),0;throw new a.FormatError(`Invalid number: ${String.fromCharCode(e)} (charCode ${e})`)}i=i||1;let n=e-48,o=0,l=1;for(;(e=this.nextChar())>=0;)if(e>=48&&e<=57){const i=e-48;t?o=10*o+i:(0!==r&&(r*=10),n=10*n+i)}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(e=this.peekChar(),43===e||45===e)l=45===e?-1:1,this.nextChar();else if(e<48||e>57)break;t=!0}return 0!==r&&(n/=r),t&&(n*=10**(l*o)),i*n}getString(){let e=1,t=!1;const r=this.strBuf;r.length=0;let i=this.nextChar();for(;;){let n=!1;switch(0|i){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(i=this.nextChar(),i){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(i));break;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:let e=15&i;i=this.nextChar(),n=!0,i>=48&&i<=55&&(e=(e<<3)+(15&i),i=this.nextChar(),i>=48&&i<=55&&(n=!1,e=(e<<3)+(15&i))),r.push(String.fromCharCode(e));break;case 13:10===this.peekChar()&&this.nextChar();break;case 10:break;default:r.push(String.fromCharCode(i))}break;default:r.push(String.fromCharCode(i))}if(t)break;n||(i=this.nextChar())}return r.join("")}getName(){let e,t;const r=this.strBuf;for(r.length=0;(e=this.nextChar())>=0&&!f[e];)if(35===e){if(e=this.nextChar(),f[e]){(0,a.warn)("Lexer_getName: NUMBER SIGN (#) should be followed by a hexadecimal number."),r.push("#");break}const i=p(e);if(-1!==i){t=e,e=this.nextChar();const n=p(e);if(-1===n){if((0,a.warn)(`Lexer_getName: Illegal digit (${String.fromCharCode(e)}) in hexadecimal number.`),r.push("#",String.fromCharCode(t)),f[e])break;r.push(String.fromCharCode(e));continue}r.push(String.fromCharCode(i<<4|n))}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: ${r.length}`),n.Name.get(r.join(""))}_hexStringWarn(e){5!=this._hexStringNumWarn++?this._hexStringNumWarn>5||(0,a.warn)(`getHexString - ignoring invalid character: ${e}`):(0,a.warn)("getHexString - ignoring additional invalid characters.")}getHexString(){const e=this.strBuf;e.length=0;let t,r,i=this.currentChar,n=!0;for(this._hexStringNumWarn=0;;){if(i<0){(0,a.warn)("Unterminated hex string");break}if(62===i){this.nextChar();break}if(1!==f[i]){if(n){if(t=p(i),-1===t){this._hexStringWarn(i),i=this.nextChar();continue}}else{if(r=p(i),-1===r){this._hexStringWarn(i),i=this.nextChar();continue}e.push(String.fromCharCode(t<<4|r))}n=!n,i=this.nextChar()}else i=this.nextChar()}return e.join("")}getObj(){let e=!1,t=this.currentChar;for(;;){if(t<0)return n.EOF;if(e)10!==t&&13!==t||(e=!1);else if(37===t)e=!0;else if(1!==f[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(),n.Cmd.get("[");case 93:return this.nextChar(),n.Cmd.get("]");case 60:return t=this.nextChar(),60===t?(this.nextChar(),n.Cmd.get("<<")):this.getHexString();case 62:return t=this.nextChar(),62===t?(this.nextChar(),n.Cmd.get(">>")):n.Cmd.get(">");case 123:return this.nextChar(),n.Cmd.get("{");case 125:return this.nextChar(),n.Cmd.get("}");case 41:throw this.nextChar(),new a.FormatError(`Illegal character: ${t}`)}let r=String.fromCharCode(t);const i=this.knownCommands;let s=i&&void 0!==i[r];for(;(t=this.nextChar())>=0&&!f[t];){const e=r+String.fromCharCode(t);if(s&&void 0===i[e])break;if(128===r.length)throw new a.FormatError(`Command token too long: ${r.length}`);r=e,s=i&&void 0!==i[r]}return"true"===r||"false"!==r&&("null"===r?null:("BI"===r&&(this.beginInlineImagePos=this.stream.pos),n.Cmd.get(r)))}skipToNextLine(){let e=this.currentChar;for(;e>=0;){if(13===e){e=this.nextChar(),10===e&&this.nextChar();break}if(10===e){this.nextChar();break}e=this.nextChar()}}}t.Lexer=g,t.Linearization=class{static create(e){function t(e,t,r=!1){const i=e.get(t);if(Number.isInteger(i)&&(r?i>=0:i>0))return i;throw new Error(`The "${t}" parameter in the linearization dictionary is invalid.`)}const r=new h({lexer:new g(e),xref:null}),i=r.getObj(),s=r.getObj(),o=r.getObj(),l=r.getObj();let c,u;if(!(Number.isInteger(i)&&Number.isInteger(s)&&(0,n.isCmd)(o,"obj")&&(0,n.isDict)(l)&&(0,a.isNum)(c=l.get("Linearized"))&&c>0))return null;if((u=t(l,"L"))!==e.length)throw new Error('The "L" parameter in the linearization dictionary does not equal the stream length.');return{length:u,hints:function(e){const t=e.get("H");let r;if(Array.isArray(t)&&(2===(r=t.length)||4===r)){for(let e=0;e0))throw new Error(`Hint (${e}) in the linearization dictionary is invalid.`)}return t}throw new Error("Hint array in the linearization dictionary is invalid.")}(l),objectNumberFirst:t(l,"O"),endFirst:t(l,"E"),numPages:t(l,"N"),mainXRefEntriesOffset:t(l,"T"),pageFirst:l.has("P")?t(l,"P",!0):0}}}},function(e,t,r){"use strict";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 i=r(2),a=r(5),n=r(8),s=function(){function e(e,t,r,i){this.bytes=e instanceof Uint8Array?e:new Uint8Array(e),this.start=t||0,this.pos=this.start,this.end=t+r||this.bytes.length,this.dict=i}return e.prototype={get length(){return this.end-this.start},get isEmpty(){return 0===this.length},getByte:function(){return this.pos>=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(e,t=!1){var r=this.bytes,i=this.pos,a=this.end;if(!e){const e=r.subarray(i,a);return t?new Uint8ClampedArray(e):e}var n=i+e;n>a&&(n=a),this.pos=n;const s=r.subarray(i,n);return t?new Uint8ClampedArray(s):s},peekByte:function(){var e=this.getByte();return-1!==e&&this.pos--,e},peekBytes(e,t=!1){var r=this.getBytes(e,t);return this.pos-=r.length,r},getByteRange(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,i){return new e(this.bytes.buffer,t,r,i)}},e}();t.Stream=s;var o=function(){function e(e){const t=(0,i.stringToBytes)(e);s.call(this,t)}return e.prototype=s.prototype,e}();t.StringStream=o;var l=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.minBufferLengtha&&(r=a)}else{for(;!this.eof;)this.readBlock();r=this.bufferLength}this.pos=r;const n=this.buffer.subarray(i,r);return!t||n instanceof Uint8ClampedArray?n:new Uint8ClampedArray(n)},peekByte:function(){var e=this.getByte();return-1!==e&&this.pos--,e},peekBytes(e,t=!1){var r=this.getBytes(e,t);return this.pos-=r.length,r},makeSubStream:function(e,t,r){for(var i=e+t;this.bufferLength<=i&&!this.eof;)this.readBlock();return new s(this.buffer,e,t,r)},getByteRange(e,t){(0,i.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=l;var c=function(){function e(e){this.streams=e;let t=0;for(let r=0,i=e.length;r>e,this.codeSize=a-=e,t},s.prototype.getCode=function(e){for(var t,r=this.str,a=e[0],n=e[1],s=this.codeSize,o=this.codeBuf;s>16,u=65535&l;if(c<1||s>c,this.codeSize=s-c,u},s.prototype.generateHuffmanTable=function(e){var t,r=e.length,i=0;for(t=0;ti&&(i=e[t]);for(var a=1<>=1;for(t=u;t>=1)){var u,d;if(1===c)u=a,d=n;else{if(2!==c)throw new i.FormatError("Unknown block type in flate stream");var h,f=this.getBits(5)+257,p=this.getBits(5)+1,g=this.getBits(4)+4,m=new Uint8Array(e.length);for(h=0;h0;)k[h++]=w}u=this.generateHuffmanTable(k.subarray(0,f)),d=this.generateHuffmanTable(k.subarray(f,x))}for(var S=(s=this.buffer)?s.length:0,C=this.bufferLength;;){var P=this.getCode(u);if(P<256)C+1>=S&&(S=(s=this.ensureBuffer(C+1)).length),s[C++]=P;else{if(256===P)return void(this.bufferLength=C);var I=(P=t[P-=257])>>16;I>0&&(I=this.getBits(I)),o=(65535&P)+I,P=this.getCode(d),(I=(P=r[P])>>16)>0&&(I=this.getBits(I));var T=(65535&P)+I;C+o>=S&&(S=(s=this.ensureBuffer(C+o)).length);for(var O=0;O15))throw new i.FormatError(`Unsupported predictor: ${n}`);this.readBlock=2===n?this.readBlockTiff:this.readBlockPng,this.str=e,this.dict=e.dict;var s=this.colors=r.get("Colors")||1,o=this.bits=r.get("BitsPerComponent")||8,c=this.columns=r.get("Columns")||1;return this.pixBytes=s*o+7>>3,this.rowBytes=c*s*o+7>>3,l.call(this,t),this}return e.prototype=Object.create(l.prototype),e.prototype.readBlockTiff=function(){var e=this.rowBytes,t=this.bufferLength,r=this.ensureBuffer(t+e),i=this.bits,a=this.colors,n=this.str.getBytes(e);if(this.eof=!n.length,!this.eof){var s,o=0,l=0,c=0,u=0,d=t;if(1===i&&1===a)for(s=0;s>1,h^=h>>2,o=(1&(h^=h>>4))<<7,r[d++]=h}else if(8===i){for(s=0;s>8&255,r[d++]=255&p}}else{var g=new Uint8Array(a+1),m=(1<>c-i)&m,c-=i,l=l<=8&&(r[v++]=l>>u-8&255,u-=8);u>0&&(r[v++]=(l<<8-u)+(o&(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 n=this.bufferLength,s=this.ensureBuffer(n+e),o=s.subarray(n-e,n);0===o.length&&(o=new Uint8Array(e));var l,c,u,d=n;switch(r){case 0:for(l=0;l>1)+a[l];for(;l>1)+a[l]&255,d++;break;case 4:for(l=0;l0;e=(0,this.decrypt)(e,!t);var r,i=this.bufferLength,a=e.length,n=this.ensureBuffer(i+a);for(r=0;r=0;--i)r[a+i]=255&o,o>>=8}}else this.eof=!0},e}();t.Ascii85Stream=f;var p=function(){function e(e,t){this.str=e,this.dict=e.dict,this.firstDigit=-1,t&&(t*=.5),l.call(this,t)}return e.prototype=Object.create(l.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),i=this.bufferLength,a=this.firstDigit,n=0,s=e.length;n=48&&l<=57)o=15&l;else{if(!(l>=65&&l<=70||l>=97&&l<=102)){if(62===l){this.eof=!0;break}continue}o=9+(15&l)}a<0?a=o:(r[i++]=a<<4|o,a=-1)}a>=0&&this.eof&&(r[i++]=a<<4,a=-1),this.firstDigit=a,this.bufferLength=i}else this.eof=!0},e}();t.AsciiHexStream=p;var g=function(){function e(e,t){this.str=e,this.dict=e.dict,l.call(this,t)}return e.prototype=Object.create(l.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,i=e[0];if(i<128){if((t=this.ensureBuffer(r+i+1))[r++]=e[1],i>0){var a=this.str.getBytes(i);t.set(a,r),r+=i}}else{i=257-i;var n=e[1];t=this.ensureBuffer(r+i+1);for(var s=0;s>>t&(1<0;if(b<256)h[0]=b,f=1;else{if(!(b>=258)){if(256===b){u=9,s=258,f=0;continue}this.eof=!0,delete this.lzwState;break}if(b=0;t--)h[t]=o[r],r=c[r];else h[f++]=h[0]}if(v&&(c[s]=d,l[s]=l[d]+1,o[s]=h[0],u=++s+n&s+n-1?u:0|Math.min(Math.log(s+n)/.6931471805599453+1,12)),d=b,i<(p+=f)){do{i+=512}while(ie.getByte()};this.ccittFaxDecoder=new a.CCITTFaxDecoder(s,{K:r.get("K"),EndOfLine:r.get("EndOfLine"),EncodedByteAlign:r.get("EncodedByteAlign"),Columns:r.get("Columns"),Rows:r.get("Rows"),EndOfBlock:r.get("EndOfBlock"),BlackIs1:r.get("BlackIs1")}),n.DecodeStream.call(this,t)}return e.prototype=Object.create(n.DecodeStream.prototype),e.prototype.readBlock=function(){for(;!this.eof;){const e=this.ccittFaxDecoder.readNextChar();if(-1===e)return void(this.eof=!0);this.ensureBuffer(this.bufferLength+1),this.buffer[this.bufferLength++]=e}},e}();t.CCITTFaxStream=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CCITTFaxDecoder=void 0;var i=r(2);const a=function(){const e=-1,t=[[-1,-1],[-1,-1],[7,8],[7,7],[6,6],[6,6],[6,5],[6,5],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2]],r=[[-1,-1],[12,-2],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[11,1792],[11,1792],[12,1984],[12,2048],[12,2112],[12,2176],[12,2240],[12,2304],[11,1856],[11,1856],[11,1920],[11,1920],[12,2368],[12,2432],[12,2496],[12,2560]],a=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[8,29],[8,29],[8,30],[8,30],[8,45],[8,45],[8,46],[8,46],[7,22],[7,22],[7,22],[7,22],[7,23],[7,23],[7,23],[7,23],[8,47],[8,47],[8,48],[8,48],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[7,20],[7,20],[7,20],[7,20],[8,33],[8,33],[8,34],[8,34],[8,35],[8,35],[8,36],[8,36],[8,37],[8,37],[8,38],[8,38],[7,19],[7,19],[7,19],[7,19],[8,31],[8,31],[8,32],[8,32],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[8,53],[8,53],[8,54],[8,54],[7,26],[7,26],[7,26],[7,26],[8,39],[8,39],[8,40],[8,40],[8,41],[8,41],[8,42],[8,42],[8,43],[8,43],[8,44],[8,44],[7,21],[7,21],[7,21],[7,21],[7,28],[7,28],[7,28],[7,28],[8,61],[8,61],[8,62],[8,62],[8,63],[8,63],[8,0],[8,0],[8,320],[8,320],[8,384],[8,384],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[7,27],[7,27],[7,27],[7,27],[8,59],[8,59],[8,60],[8,60],[9,1472],[9,1536],[9,1600],[9,1728],[7,18],[7,18],[7,18],[7,18],[7,24],[7,24],[7,24],[7,24],[8,49],[8,49],[8,50],[8,50],[8,51],[8,51],[8,52],[8,52],[7,25],[7,25],[7,25],[7,25],[8,55],[8,55],[8,56],[8,56],[8,57],[8,57],[8,58],[8,58],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[8,448],[8,448],[8,512],[8,512],[9,704],[9,768],[8,640],[8,640],[8,576],[8,576],[9,832],[9,896],[9,960],[9,1024],[9,1088],[9,1152],[9,1216],[9,1280],[9,1344],[9,1408],[7,256],[7,256],[7,256],[7,256],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7]],n=[[-1,-1],[-1,-1],[12,-2],[12,-2],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[11,1792],[11,1792],[11,1792],[11,1792],[12,1984],[12,1984],[12,2048],[12,2048],[12,2112],[12,2112],[12,2176],[12,2176],[12,2240],[12,2240],[12,2304],[12,2304],[11,1856],[11,1856],[11,1856],[11,1856],[11,1920],[11,1920],[11,1920],[11,1920],[12,2368],[12,2368],[12,2432],[12,2432],[12,2496],[12,2496],[12,2560],[12,2560],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[12,52],[12,52],[13,640],[13,704],[13,768],[13,832],[12,55],[12,55],[12,56],[12,56],[13,1280],[13,1344],[13,1408],[13,1472],[12,59],[12,59],[12,60],[12,60],[13,1536],[13,1600],[11,24],[11,24],[11,24],[11,24],[11,25],[11,25],[11,25],[11,25],[13,1664],[13,1728],[12,320],[12,320],[12,384],[12,384],[12,448],[12,448],[13,512],[13,576],[12,53],[12,53],[12,54],[12,54],[13,896],[13,960],[13,1024],[13,1088],[13,1152],[13,1216],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64]],s=[[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[11,23],[11,23],[12,50],[12,51],[12,44],[12,45],[12,46],[12,47],[12,57],[12,58],[12,61],[12,256],[10,16],[10,16],[10,16],[10,16],[10,17],[10,17],[10,17],[10,17],[12,48],[12,49],[12,62],[12,63],[12,30],[12,31],[12,32],[12,33],[12,40],[12,41],[11,22],[11,22],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[12,128],[12,192],[12,26],[12,27],[12,28],[12,29],[11,19],[11,19],[11,20],[11,20],[12,34],[12,35],[12,36],[12,37],[12,38],[12,39],[11,21],[11,21],[12,42],[12,43],[10,0],[10,0],[10,0],[10,0],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12]],o=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[6,9],[6,8],[5,7],[5,7],[4,6],[4,6],[4,6],[4,6],[4,5],[4,5],[4,5],[4,5],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2]];function l(e,t={}){if(!e||"function"!=typeof e.next)throw new Error('CCITTFaxDecoder - invalid "source" parameter.');this.source=e,this.eof=!1,this.encoding=t.K||0,this.eoline=t.EndOfLine||!1,this.byteAlign=t.EncodedByteAlign||!1,this.columns=t.Columns||1728,this.rows=t.Rows||0;let r,i=t.EndOfBlock;for(null==i&&(i=!0),this.eoblock=i,this.black=t.BlackIs1||!1,this.codingLine=new Uint32Array(this.columns+1),this.refLine=new Uint32Array(this.columns+2),this.codingLine[0]=this.columns,this.codingPos=0,this.row=0,this.nextLine2D=this.encoding<0,this.inputBits=0,this.inputBuf=0,this.outputBits=0,this.rowsDone=!1;0===(r=this._lookBits(12));)this._eatBits(1);1===r&&this._eatBits(12),this.encoding>0&&(this.nextLine2D=!this._lookBits(1),this._eatBits(1))}return l.prototype={readNextChar(){if(this.eof)return-1;const t=this.refLine,r=this.codingLine,a=this.columns;let n,s,o,l,c;if(0===this.outputBits){if(this.rowsDone&&(this.eof=!0),this.eof)return-1;let o,c,u;if(this.err=!1,this.nextLine2D){for(l=0;r[l]=64);do{c+=u=this._getWhiteCode()}while(u>=64)}else{do{o+=u=this._getWhiteCode()}while(u>=64);do{c+=u=this._getBlackCode()}while(u>=64)}for(this._addPixels(r[this.codingPos]+o,s),r[this.codingPos]0?--n:++n;t[n]<=r[this.codingPos]&&t[n]0?--n:++n;t[n]<=r[this.codingPos]&&t[n]0?--n:++n;t[n]<=r[this.codingPos]&&t[n]=64);else do{o+=u=this._getWhiteCode()}while(u>=64);this._addPixels(r[this.codingPos]+o,s),s^=1}let d=!1;if(this.byteAlign&&(this.inputBits&=-8),this.eoblock||this.row!==this.rows-1){if(o=this._lookBits(12),this.eoline)for(;o!==e&&1!==o;)this._eatBits(1),o=this._lookBits(12);else for(;0===o;)this._eatBits(1),o=this._lookBits(12);1===o?(this._eatBits(12),d=!0):o===e&&(this.eof=!0)}else this.rowsDone=!0;if(!this.eof&&this.encoding>0&&!this.rowsDone&&(this.nextLine2D=!this._lookBits(1),this._eatBits(1)),this.eoblock&&d&&this.byteAlign){if(o=this._lookBits(12),1===o){if(this._eatBits(12),this.encoding>0&&(this._lookBits(1),this._eatBits(1)),this.encoding>=0)for(l=0;l<4;++l)o=this._lookBits(12),1!==o&&(0,i.info)("bad rtc code: "+o),this._eatBits(12),this.encoding>0&&(this._lookBits(1),this._eatBits(1));this.eof=!0}}else if(this.err&&this.eoline){for(;;){if(o=this._lookBits(13),o===e)return this.eof=!0,-1;if(o>>1==1)break;this._eatBits(1)}this._eatBits(12),this.encoding>0&&(this._eatBits(1),this.nextLine2D=!(1&o))}r[0]>0?this.outputBits=r[this.codingPos=0]:this.outputBits=r[this.codingPos=1],this.row++}if(this.outputBits>=8)c=1&this.codingPos?0:255,this.outputBits-=8,0===this.outputBits&&r[this.codingPos]o?(c<<=o,1&this.codingPos||(c|=255>>8-o),this.outputBits-=o,o=0):(c<<=this.outputBits,1&this.codingPos||(c|=255>>8-this.outputBits),o-=this.outputBits,this.outputBits=0,r[this.codingPos]0&&(c<<=o,o=0))}while(o)}return this.black&&(c^=255),c},_addPixels(e,t){const r=this.codingLine;let a=this.codingPos;e>r[a]&&(e>this.columns&&((0,i.info)("row is wrong length"),this.err=!0,e=this.columns),1&a^t&&++a,r[a]=e),this.codingPos=a},_addPixelsNeg(e,t){const r=this.codingLine;let a=this.codingPos;if(e>r[a])e>this.columns&&((0,i.info)("row is wrong length"),this.err=!0,e=this.columns),1&a^t&&++a,r[a]=e;else if(e0&&e=n){const e=i[t-n];if(e[0]===a)return this._eatBits(a),[!0,e[1],!0]}}return[!1,0,!1]},_getTwoDimCode(){let r,a=0;if(this.eoblock){if(a=this._lookBits(7),r=t[a],r&&r[0]>0)return this._eatBits(r[0]),r[1]}else{const e=this._findTableCode(1,7,t);if(e[0]&&e[2])return e[1]}return(0,i.info)("Bad two dim code"),e},_getWhiteCode(){let t,n=0;if(this.eoblock){if(n=this._lookBits(12),n===e)return 1;if(t=n>>5==0?r[n]:a[n>>3],t[0]>0)return this._eatBits(t[0]),t[1]}else{let e=this._findTableCode(1,9,a);if(e[0])return e[1];if(e=this._findTableCode(11,12,r),e[0])return e[1]}return(0,i.info)("bad white code"),this._eatBits(1),1},_getBlackCode(){let t,r;if(this.eoblock){if(t=this._lookBits(13),t===e)return 1;if(r=t>>7==0?n[t]:t>>9==0&&t>>7!=0?s[(t>>1)-64]:o[t>>7],r[0]>0)return this._eatBits(r[0]),r[1]}else{let e=this._findTableCode(2,6,o);if(e[0])return e[1];if(e=this._findTableCode(7,12,s,64),e[0])return e[1];if(e=this._findTableCode(10,13,n),e[0])return e[1]}return(0,i.info)("bad black code"),this._eatBits(1),1},_lookBits(t){let r;for(;this.inputBits>16-t;this.inputBuf=this.inputBuf<<8|r,this.inputBits+=8}return this.inputBuf>>this.inputBits-t&65535>>16-t},_eatBits(e){(this.inputBits-=e)<0&&(this.inputBits=0)}},l}();t.CCITTFaxDecoder=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Jbig2Stream=void 0;var i=r(5),a=r(12),n=r(16),s=r(2);const o=function(){function e(e,t,r,i){this.stream=e,this.maybeLength=t,this.dict=r,this.params=i,a.DecodeStream.call(this,t)}return e.prototype=Object.create(a.DecodeStream.prototype),Object.defineProperty(e.prototype,"bytes",{get(){return(0,s.shadow)(this,"bytes",this.stream.getBytes(this.maybeLength))},configurable:!0}),e.prototype.ensureBuffer=function(e){},e.prototype.readBlock=function(){if(this.eof)return;const e=new n.Jbig2Image,t=[];if((0,i.isDict)(this.params)){const e=this.params.get("JBIG2Globals");if((0,i.isStream)(e)){const r=e.getBytes();t.push({data:r,start:0,end:r.length})}}t.push({data:this.bytes,start:0,end:this.bytes.length});const r=e.parseChunks(t),a=r.length;for(let e=0;e>>0}var s=n(1),o=n(1)?n(1)?n(1)?n(1)?n(1)?n(32)+4436:n(12)+340:n(8)+84:n(6)+20:n(4)+4:n(2);return 0===s?o:o>0?-o:null}function l(e,t,r){for(var i=e.getContexts("IAID"),a=1,n=0;n=L&&C=R)for(z=z<<1&v,f=0;f=0&&I=0&&(O=B[P][I])&&(z|=O<=e?L<<=1:L=L<<1|_[E][F];for(h=0;h=k||F<0||F>=x?L<<=1:L=L<<1|i[E][F];var R=S.readBit(C,L);T[O]=R}}return _}function m(e,t,i,a,n,s,c,u,d,h,f,p,m,b,v,y,w,x,k){if(e&&t)throw new o("refinement with Huffman is not supported");var A,_,S=[];for(A=0;A1&&(a=e?k.readBits(x):r(I,"IAIT",P));var F=c*T+a,L=e?b.symbolIDTable.decode(k):l(I,P,d),R=t&&(e?k.readBit():r(I,"IARI",P)),M=u[L],D=M[0].length,N=M.length;if(R){var B=r(I,"IARDW",P),U=r(I,"IARDH",P);M=g(D+=B,N+=U,v,M,(B>>1)+r(I,"IARDX",P),(U>>1)+r(I,"IARDY",P),!1,y,w)}var j,q,z,$=F-(1&p?0:N-1),H=E-(2&p?D-1:0);if(h){for(j=0;j>5&7,d=[31&l],h=t+6;if(7===l){u=536870911&(0,a.readUint32)(e,h-1),h+=3;var f=u+7>>3;for(d[0]=e[h++];--f>0;)d.push(e[h++])}else if(5===l||6===l)throw new o("invalid referred-to flags");r.retainBits=d;let p=4;r.number<=256?p=1:r.number<=65536&&(p=2);var g,m,b=[];for(g=0;g>>24&255,k[3]=v.height>>16&255,k[4]=v.height>>8&255,k[5]=255&v.height,g=h,m=e.length;g>2&3,h.huffmanDWSelector=f>>4&3,h.bitmapSizeSelector=f>>6&1,h.aggregationInstancesSelector=f>>7&1,h.bitmapCodingContextUsed=!!(256&f),h.bitmapCodingContextRetained=!!(512&f),h.template=f>>10&3,h.refinementTemplate=f>>12&1,u+=2,!h.huffman){for(s=0===h.template?4:1,i=[],n=0;n>2&3,p.stripSize=1<>4&3,p.transposed=!!(64&g),p.combinationOperator=g>>7&3,p.defaultPixelValue=g>>9&1,p.dsOffset=g<<17>>27,p.refinementTemplate=g>>15&1,p.huffman){var m=(0,a.readUint16)(c,u);u+=2,p.huffmanFS=3&m,p.huffmanDS=m>>2&3,p.huffmanDT=m>>4&3,p.huffmanRefinementDW=m>>6&3,p.huffmanRefinementDH=m>>8&3,p.huffmanRefinementDX=m>>10&3,p.huffmanRefinementDY=m>>12&3,p.huffmanRefinementSizeSelector=!!(16384&m)}if(p.refinement&&!p.refinementTemplate){for(i=[],n=0;n<2;n++)i.push({x:(0,a.readInt8)(c,u),y:(0,a.readInt8)(c,u+1)}),u+=2;p.refinementAt=i}p.numberOfSymbolInstances=(0,a.readUint32)(c,u),u+=4,r=[p,l.referredTo,c,u,d];break;case 16:const e={},t=c[u++];e.mmr=!!(1&t),e.template=t>>1&3,e.patternWidth=c[u++],e.patternHeight=c[u++],e.maxPatternIndex=(0,a.readUint32)(c,u),u+=4,r=[e,l.number,c,u,d];break;case 22:case 23:const A={};A.info=y(c,u),u+=w;const _=c[u++];A.mmr=!!(1&_),A.template=_>>1&3,A.enableSkip=!!(8&_),A.combinationOperator=_>>4&7,A.defaultPixelValue=_>>7&1,A.gridWidth=(0,a.readUint32)(c,u),u+=4,A.gridHeight=(0,a.readUint32)(c,u),u+=4,A.gridOffsetX=4294967295&(0,a.readUint32)(c,u),u+=4,A.gridOffsetY=4294967295&(0,a.readUint32)(c,u),u+=4,A.gridVectorX=(0,a.readUint16)(c,u),u+=2,A.gridVectorY=(0,a.readUint16)(c,u),u+=2,r=[A,l.referredTo,c,u,d];break;case 38:case 39:var b={};b.info=y(c,u),u+=w;var v=c[u++];if(b.mmr=!!(1&v),b.template=v>>1&3,b.prediction=!!(8&v),!b.mmr){for(s=0===b.template?4:1,i=[],n=0;n>2&1,x.combinationOperator=k>>3&3,x.requiresBuffer=!!(32&k),x.combinationOperatorOverride=!!(64&k),r=[x];break;case 49:case 50:case 51:case 62:break;case 53:r=[l.number,c,u,d];break;default:throw new o(`segment type ${l.typeName}(${l.type}) is not implemented`)}var A="on"+l.typeName;A in t&&t[A].apply(t,r)}function k(e,t){for(var r=0,i=e.length;r0&&this.rootNode.buildTree(r,r.prefixLength-1)}}A.prototype={onPageInformation:function(e){this.currentPageInfo=e;var t=e.width+7>>3,r=new Uint8ClampedArray(t*e.height);if(e.defaultPixelValue)for(var i=0,a=r.length;i>3,d=s.combinationOperatorOverride?e.combinationOperator:s.combinationOperator,h=this.buffer,f=128>>(7&e.x),p=e.y*u+(e.x>>3);switch(d){case 0:for(r=0;r>=1)||(a=128,n++);p+=u}break;case 2:for(r=0;r>=1)||(a=128,n++);p+=u}break;default:throw new o(`operator ${d} is not supported`)}},onImmediateGenericRegion:function(e,r,i,a){var n=e.info,s=new t(r,i,a),o=p(e.mmr,n.width,n.height,e.template,e.prediction,null,e.at,s);this.drawBitmap(n,o)},onImmediateLosslessGenericRegion:function(){this.onImmediateGenericRegion.apply(this,arguments)},onSymbolDictionary:function(e,i,n,s,c,u){let d,h;e.huffman&&(d=function(e,t,r){let i,a,n,s,l=0;switch(e.huffmanDHSelector){case 0:case 1:i=I(e.huffmanDHSelector+4);break;case 3:i=O(l,t,r),l++;break;default:throw new o("invalid Huffman DH selector")}switch(e.huffmanDWSelector){case 0:case 1:a=I(e.huffmanDWSelector+2);break;case 3:a=O(l,t,r),l++;break;default:throw new o("invalid Huffman DW selector")}return e.bitmapSizeSelector?(n=O(l,t,r),l++):n=I(1),s=e.aggregationInstancesSelector?O(l,t,r):I(1),{tableDeltaHeight:i,tableDeltaWidth:a,tableBitmapSize:n,tableAggregateInstances:s}}(e,n,this.customTables),h=new T(s,c,u));var f=this.symbols;f||(this.symbols=f={});for(var b=[],v=0,y=n.length;v1)C=m(e,t,a,w,0,T,1,i.concat(y),x,0,0,1,0,c,h,f,b,0,v);else{var O=l(A,k,x),L=r(A,"IARDX",k),R=r(A,"IARDY",k);C=g(a,w,h,O=32){let r,i,s;switch(t){case 32:if(0===e)throw new o("no previous value in symbol ID table");i=a.readBits(2)+3,r=n[e-1].prefixLength;break;case 33:i=a.readBits(3)+3,r=0;break;case 34:i=a.readBits(7)+11,r=0;break;default:throw new o("invalid code length in symbol ID table")}for(s=0;s=0;y--)E=e?F(O,u,d,!0):p(!1,u,d,r,!1,null,P,b),I[y]=E;for(L=0;L=0;w--)M=I[w][L][R]^M,D|=M<>8,U=f+L*g-R*m>>8,B>=0&&B+_<=i&&U>=0&&U+S<=n)for(y=0;y=n))for(q=v[t],j=N[y],w=0;w<_;w++)e=B+w,e>=0&&e>1&7),c=1+(i>>4&7),u=[];let d,h,f=n;do{d=o.readBits(l),h=o.readBits(c),u.push(new _([f,d,h,0])),f+=1<>t&1;if(t<=0)this.children[r]=new S(e);else{let i=this.children[r];i||(this.children[r]=i=new S(null)),i.buildTree(e,t-1)}},decodeNode(e){if(this.isLeaf){if(this.isOOB)return null;const t=e.readBits(this.rangeLength);return this.rangeLow+(this.isLowerRange?-t:t)}const t=this.children[e.readBit()];if(!t)throw new o("invalid Huffman data");return t.decodeNode(e)}},C.prototype={decode(e){return this.rootNode.decodeNode(e)},assignPrefixCodes(e){const t=e.length;let r=0;for(let i=0;i>r&1,r--}if(i&&!c){const e=5;for(let t=0;t=this.end)throw new o("end of data while reading bit");this.currentByte=this.data[this.position++],this.shift=7}const e=this.currentByte>>this.shift&1;return this.shift--,e},readBits(e){let t,r=0;for(t=e-1;t>=0;t--)r|=this.readBit()<=this.end?-1:this.data[this.position++]}},L.prototype={parseChunks:e=>function(e){for(var t=new A,r=0,i=e.length;r>=1}return{imgData:h,width:c,height:u}}(e);return this.width=r,this.height=i,t}},L}();t.Jbig2Image=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArithmeticDecoder=void 0;const i=[{qe:22017,nmps:1,nlps:1,switchFlag:1},{qe:13313,nmps:2,nlps:6,switchFlag:0},{qe:6145,nmps:3,nlps:9,switchFlag:0},{qe:2753,nmps:4,nlps:12,switchFlag:0},{qe:1313,nmps:5,nlps:29,switchFlag:0},{qe:545,nmps:38,nlps:33,switchFlag:0},{qe:22017,nmps:7,nlps:6,switchFlag:1},{qe:21505,nmps:8,nlps:14,switchFlag:0},{qe:18433,nmps:9,nlps:14,switchFlag:0},{qe:14337,nmps:10,nlps:14,switchFlag:0},{qe:12289,nmps:11,nlps:17,switchFlag:0},{qe:9217,nmps:12,nlps:18,switchFlag:0},{qe:7169,nmps:13,nlps:20,switchFlag:0},{qe:5633,nmps:29,nlps:21,switchFlag:0},{qe:22017,nmps:15,nlps:14,switchFlag:1},{qe:21505,nmps:16,nlps:14,switchFlag:0},{qe:20737,nmps:17,nlps:15,switchFlag:0},{qe:18433,nmps:18,nlps:16,switchFlag:0},{qe:14337,nmps:19,nlps:17,switchFlag:0},{qe:13313,nmps:20,nlps:18,switchFlag:0},{qe:12289,nmps:21,nlps:19,switchFlag:0},{qe:10241,nmps:22,nlps:19,switchFlag:0},{qe:9217,nmps:23,nlps:20,switchFlag:0},{qe:8705,nmps:24,nlps:21,switchFlag:0},{qe:7169,nmps:25,nlps:22,switchFlag:0},{qe:6145,nmps:26,nlps:23,switchFlag:0},{qe:5633,nmps:27,nlps:24,switchFlag:0},{qe:5121,nmps:28,nlps:25,switchFlag:0},{qe:4609,nmps:29,nlps:26,switchFlag:0},{qe:4353,nmps:30,nlps:27,switchFlag:0},{qe:2753,nmps:31,nlps:28,switchFlag:0},{qe:2497,nmps:32,nlps:29,switchFlag:0},{qe:2209,nmps:33,nlps:30,switchFlag:0},{qe:1313,nmps:34,nlps:31,switchFlag:0},{qe:1089,nmps:35,nlps:32,switchFlag:0},{qe:673,nmps:36,nlps:33,switchFlag:0},{qe:545,nmps:37,nlps:34,switchFlag:0},{qe:321,nmps:38,nlps:35,switchFlag:0},{qe:273,nmps:39,nlps:36,switchFlag:0},{qe:133,nmps:40,nlps:37,switchFlag:0},{qe:73,nmps:41,nlps:38,switchFlag:0},{qe:37,nmps:42,nlps:39,switchFlag:0},{qe:21,nmps:43,nlps:40,switchFlag:0},{qe:9,nmps:44,nlps:41,switchFlag:0},{qe:5,nmps:45,nlps:42,switchFlag:0},{qe:1,nmps:45,nlps:43,switchFlag:0},{qe:22017,nmps:46,nlps:46,switchFlag:0}];t.ArithmeticDecoder=class{constructor(e,t,r){this.data=e,this.bp=t,this.dataEnd=r,this.chigh=e[t],this.clow=0,this.byteIn(),this.chigh=this.chigh<<7&65535|this.clow>>9&127,this.clow=this.clow<<7&65535,this.ct-=7,this.a=32768}byteIn(){const e=this.data;let t=this.bp;255===e[t]?e[t+1]>143?(this.clow+=65280,this.ct=8):(t++,this.clow+=e[t]<<9,this.ct=7,this.bp=t):(t++,this.clow+=t65535&&(this.chigh+=this.clow>>16,this.clow&=65535)}readBit(e,t){let r=e[t]>>1,a=1&e[t];const n=i[r],s=n.qe;let o,l=this.a-s;if(this.chigh>15&1,this.clow=this.clow<<1&65535,this.ct--}while(0==(32768&l));return this.a=l,e[t]=r<<1|a,o}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JpegStream=void 0;var i=r(12),a=r(5),n=r(19),s=r(2);const o=function(){function e(e,t,r,a){let n;for(;-1!==(n=e.getByte());)if(255===n){e.skip(-1);break}this.stream=e,this.maybeLength=t,this.dict=r,this.params=a,i.DecodeStream.call(this,t)}return e.prototype=Object.create(i.DecodeStream.prototype),Object.defineProperty(e.prototype,"bytes",{get:function(){return(0,s.shadow)(this,"bytes",this.stream.getBytes(this.maybeLength))},configurable:!0}),e.prototype.ensureBuffer=function(e){},e.prototype.readBlock=function(){if(this.eof)return;const e={decodeTransform:void 0,colorTransform:void 0},t=this.dict.getArray("Decode","D");if(this.forceRGB&&Array.isArray(t)){const r=this.dict.get("BitsPerComponent")||8,i=t.length,a=new Int32Array(i);let n=!1;const s=(1<0&&!e[s-1];)s--;n.push({children:[],index:0});var o,l=n[0];for(r=0;r0;)l=n.pop();for(l.index++,n.push(l);n.length<=r;)n.push(o={children:[],index:0}),l.children[l.index]=o.children,l=o;a++}r+10)return k--,x>>k&1;if(x=t[r++],255===x){var e=t[r++];if(e){if(220===e&&g){r+=2;const e=(0,a.readUint16)(t,r);if(r+=2,e>0&&e!==l.scanLines)throw new s("Found DNL marker (0xFFDC) while parsing scan data",e)}else if(217===e){if(g){const e=8*O;if(e>0&&e>>7}function _(e){for(var t=e;;){switch(typeof(t=t[A()])){case"number":return t;case"object":continue}throw new n("invalid huffman sequence")}}function S(e){for(var t=0;e>0;)t=t<<1|A(),e--;return t}function C(e){if(1===e)return 1===A()?1:-1;var t=S(e);return t>=1<0)I--;else for(var i=d,a=h;i<=a;){var n=_(t.huffmanTableAC),s=15&n,o=n>>4;if(0!==s){var l=e[i+=o];t.blockData[r+l]=C(s)*(1<>4,0==(i=15&a))l<15?(I=S(l)+(1<>4;if(0!==o){var c=e[n+=l];t.blockData[r+c]=C(o),n++}else{if(l<15)break;n+=16}}};var j,q,z,$,H=0;for(q=1===U?c[0].blocksPerLine*c[0].blocksPerColumn:b*l.mcusPerColumn;H<=q;){var G=u?Math.min(q-H,u):q;if(G>0){for(R=0;R0?"unexpected":"excessive";(0,i.warn)(`decodeScan - ${e} MCU data, current marker is: ${j.invalid}`),r=j.offset}if(!(j.marker>=65488&&j.marker<=65495))break;r+=2}return r-y}function v(e,i,a){var s,o,p,g,m,b,v,y,w,x,k,A,_,S,C,P,I,T=e.quantizationTable,O=e.blockData;if(!T)throw new n("missing required Quantization Table.");for(var E=0;E<64;E+=8)w=O[i+E],x=O[i+E+1],k=O[i+E+2],A=O[i+E+3],_=O[i+E+4],S=O[i+E+5],C=O[i+E+6],P=O[i+E+7],w*=T[E],0!=(x|k|A|_|S|C|P)?(x*=T[E+1],k*=T[E+2],A*=T[E+3],_*=T[E+4],S*=T[E+5],C*=T[E+6],P*=T[E+7],o=(s=(s=h*w+128>>8)+(o=h*_+128>>8)+1>>1)-o,I=(p=k)*d+(g=C)*u+128>>8,p=p*u-g*d+128>>8,v=(m=(m=f*(x-P)+128>>8)+(v=S<<4)+1>>1)-v,b=(y=(y=f*(x+P)+128>>8)+(b=A<<4)+1>>1)-b,g=(s=s+(g=I)+1>>1)-g,p=(o=o+p+1>>1)-p,I=m*c+y*l+2048>>12,m=m*l-y*c+2048>>12,y=I,I=b*r+v*t+2048>>12,b=b*t-v*r+2048>>12,v=I,a[E]=s+y,a[E+7]=s-y,a[E+1]=o+v,a[E+6]=o-v,a[E+2]=p+b,a[E+5]=p-b,a[E+3]=g+m,a[E+4]=g-m):(I=h*w+512>>10,a[E]=I,a[E+1]=I,a[E+2]=I,a[E+3]=I,a[E+4]=I,a[E+5]=I,a[E+6]=I,a[E+7]=I);for(var F=0;F<8;++F)w=a[F],0!=((x=a[F+8])|(k=a[F+16])|(A=a[F+24])|(_=a[F+32])|(S=a[F+40])|(C=a[F+48])|(P=a[F+56]))?(o=(s=4112+((s=h*w+2048>>12)+(o=h*_+2048>>12)+1>>1))-o,I=(p=k)*d+(g=C)*u+2048>>12,p=p*u-g*d+2048>>12,g=I,v=(m=(m=f*(x-P)+2048>>12)+(v=S)+1>>1)-v,b=(y=(y=f*(x+P)+2048>>12)+(b=A)+1>>1)-b,I=m*c+y*l+2048>>12,m=m*l-y*c+2048>>12,y=I,I=b*r+v*t+2048>>12,b=b*t-v*r+2048>>12,(w=(s=s+g+1>>1)+y)<16?w=0:w>=4080?w=255:w>>=4,(x=(o=o+p+1>>1)+(v=I))<16?x=0:x>=4080?x=255:x>>=4,(k=(p=o-p)+b)<16?k=0:k>=4080?k=255:k>>=4,(A=(g=s-g)+m)<16?A=0:A>=4080?A=255:A>>=4,(_=g-m)<16?_=0:_>=4080?_=255:_>>=4,(S=p-b)<16?S=0:S>=4080?S=255:S>>=4,(C=o-v)<16?C=0:C>=4080?C=255:C>>=4,(P=s-y)<16?P=0:P>=4080?P=255:P>>=4,O[i+F]=w,O[i+F+8]=x,O[i+F+16]=k,O[i+F+24]=A,O[i+F+32]=_,O[i+F+40]=S,O[i+F+48]=C,O[i+F+56]=P):(I=(I=h*w+8192>>14)<-2040?0:I>=2024?255:I+2056>>4,O[i+F]=I,O[i+F+8]=I,O[i+F+16]=I,O[i+F+24]=I,O[i+F+32]=I,O[i+F+40]=I,O[i+F+48]=I,O[i+F+56]=I)}function y(e,t){for(var r=t.blocksPerLine,i=t.blocksPerColumn,a=new Int16Array(64),n=0;n=i)return null;var s=(0,a.readUint16)(e,t);if(s>=65472&&s<=65534)return{invalid:null,marker:s,offset:t};for(var o=(0,a.readUint16)(e,n);!(o>=65472&&o<=65534);){if(++n>=i)return null;o=(0,a.readUint16)(e,n)}return{invalid:s.toString(16),marker:o,offset:n}}return p.prototype={parse(t,{dnlScanLines:r=null}={}){function l(){const e=(0,a.readUint16)(t,h);let r=(h+=2)+e-2;var n=w(t,r,h);n&&n.invalid&&((0,i.warn)("readDataBlock - incorrect length, current marker is: "+n.invalid),r=n.offset);var s=t.subarray(h,r);return h+=s.length,s}function c(e){for(var t=Math.ceil(e.samplesPerLine/8/e.maxH),r=Math.ceil(e.scanLines/8/e.maxV),i=0;i>4==0)for(S=0;S<64;S++)O[e[S]]=t[h++];else{if(T>>4!=1)throw new n("DQT - invalid table spec");for(S=0;S<64;S++)O[e[S]]=(0,a.readUint16)(t,h),h+=2}v[15&T]=O}break;case 65472:case 65473:case 65474:if(u)throw new n("Only single frame JPEGs supported");h+=2,(u={}).extended=65473===A,u.progressive=65474===A,u.precision=t[h++];const y=(0,a.readUint16)(t,h);h+=2,u.scanLines=r||y,u.samplesPerLine=(0,a.readUint16)(t,h),h+=2,u.components=[],u.componentIds={};var E,F=t[h++],L=0,R=0;for(_=0;_>4,D=15&t[h+1];L>4==0?k:x)[15&B]=g(U,q)}break;case 65501:h+=2,d=(0,a.readUint16)(t,h),h+=2;break;case 65498:const Q=1==++m&&!r;h+=2;var z,$=t[h++],H=[];for(_=0;_<$;_++){var G=u.componentIds[t[h++]];z=u.components[G];var V=t[h++];z.huffmanTableDC=k[V>>4],z.huffmanTableAC=x[15&V],H.push(z)}var W=t[h++],Z=t[h++],X=t[h++];try{var Y=b(t,h,u,H,d,W,Z,X>>4,15&X,Q);h+=Y}catch(e){if(e instanceof s)return(0,i.warn)(`${e.message} -- attempting to re-parse the JPEG image.`),this.parse(t,{dnlScanLines:e.scanLines});if(e instanceof o){(0,i.warn)(`${e.message} -- ignoring the rest of the image data.`);break e}throw e}break;case 65500:h+=4;break;case 65535:255!==t[h]&&h--;break;default:const J=w(t,h-2,h-3);if(J&&J.invalid){(0,i.warn)("JpegImage.parse - unexpected data, current marker is: "+J.invalid),h=J.offset;break}if(h>=t.length-1){(0,i.warn)("JpegImage.parse - reached the end of the image data without finding an EOI marker (0xFFD9).");break e}throw new n("JpegImage.parse - unknown marker: "+A.toString(16))}A=(0,a.readUint16)(t,h),h+=2}for(this.width=u.samplesPerLine,this.height=u.scanLines,this.jfif=f,this.adobe=p,this.components=[],_=0;_>8)+A[d+1];return y},get _isColorConversionNeeded(){return this.adobe?!!this.adobe.transformCode:3===this.numComponents?0!==this._colorTransform:1===this._colorTransform},_convertYccToRgb:function(e){for(var t,r,i,a=0,n=e.length;a4)throw new n("Unsupported color mode");var a=this._getLinearizedBlockData(e,t,i);if(1===this.numComponents&&r){for(var s=a.length,o=new Uint8ClampedArray(3*s),l=0,c=0;c0?Math.min(i.xcb,a.PPx-1):Math.min(i.xcb,a.PPx),a.ycb_=r>0?Math.min(i.ycb,a.PPy-1):Math.min(i.ycb,a.PPy),a}function c(e,t,r){var i=1<t.trx0?Math.ceil(t.trx1/i)-Math.floor(t.trx0/i):0,c=t.try1>t.try0?Math.ceil(t.try1/a)-Math.floor(t.try0/a):0,u=l*c;t.precinctParameters={precinctWidth:i,precinctHeight:a,numprecinctswide:l,numprecinctshigh:c,numprecincts:u,precinctWidthInSubband:s,precinctHeightInSubband:o}}function u(e,t,r){var i,a,n,s,o=r.xcb_,l=r.ycb_,c=1<>o,h=t.tby0>>l,f=t.tbx1+c-1>>o,p=t.tby1+u-1>>l,g=t.resolution.precinctParameters,m=[],b=[];for(a=h;av.cbxMax&&(v.cbxMax=i),av.cbyMax&&(v.cbyMax=a)):b[s]=v={cbxMin:i,cbyMin:a,cbxMax:i,cbyMax:a},n.precinct=v}t.codeblockParameters={codeblockWidth:o,codeblockHeight:l,numcodeblockwide:f-d+1,numcodeblockhigh:p-h+1},t.codeblocks=m,t.precincts=b}function d(e,t,r){for(var i=[],a=e.subbands,n=0,s=a.length;ne.codingStyleParameters.decompositionLevelsCount)){for(var t=e.resolutions[u],r=t.precinctParameters.numprecincts;fe.codingStyleParameters.decompositionLevelsCount)){for(var t=e.resolutions[c],r=t.precinctParameters.numprecincts;fs.codingStyleParameters.decompositionLevelsCount)){var e=s.resolutions[r],n=e.precinctParameters.numprecincts;if(!(a>=n)){for(;t=0;--m){var b=l.resolutions[m],v=g*b.precinctParameters.precinctWidth,y=g*b.precinctParameters.precinctHeight;d=Math.min(d,v),h=Math.min(h,y),f=Math.max(f,b.precinctParameters.numprecinctswide),p=Math.max(p,b.precinctParameters.numprecinctshigh),u[m]={width:v,height:y},g<<=1}r=Math.min(r,d),i=Math.min(i,h),a=Math.max(a,f),n=Math.max(n,p),s[o]={resolutions:u,minWidth:d,minHeight:h,maxNumWide:f,maxNumHigh:p}}return{components:s,minWidth:r,minHeight:i,maxNumWide:a,maxNumHigh:n}}function y(e){for(var t=e.SIZ,r=e.currentTile.index,i=e.tiles[r],a=t.Csiz,n=0;n>>(o-=e)&(1<0;){var U=k.shift();void 0===(w=U.codeblock).data&&(w.data=[]),w.data.push({data:t,start:r+s,end:r+s+U.dataLength,codingpasses:U.codingpasses}),s+=U.dataLength}}}return s}function x(e,t,r,i,a,s,o,l){for(var c=i.tbx0,u=i.tby0,d=i.tbx1-i.tbx0,h=i.codeblocks,f="H"===i.type.charAt(0)?1:0,p="H"===i.type.charAt(1)?t:0,g=0,m=h.length;g=s?R:R*(1<0?1-b:0));var P=v.subbands[A],O=e[P.type];x(k,y,0,P,f?1:2**(h+O-C)*(1+S/2048),u+C-1,f,d)}g.push({width:y,height:w,items:k})}var E=p.calculate(g,a.tcx0,a.tcy0);return{left:a.tcx0,top:a.tcy0,width:E.width,height:E.height,items:E.items}}function A(e,t){for(var r=e.SIZ.Csiz,i=e.tiles[t],a=0;a>24&255,l>>16&255,l>>8&255,255&l);(0,i.warn)("Unsupported header type "+l+" ("+f+")")}u&&(t+=c)}else this.parseCodestream(e,0,e.length)},parseImageProperties:function(e){for(var t=e.getByte();t>=0;)if(65361==(t<<8|(t=e.getByte()))){e.skip(4);var r=e.getInt32()>>>0,i=e.getInt32()>>>0,a=e.getInt32()>>>0,n=e.getInt32()>>>0;e.skip(16);var o=e.getUint16();return this.width=r-a,this.height=i-n,this.componentsCount=o,void(this.bitsPerComponent=8)}throw new s("No size marker found in JPX stream")},parseCodestream:function(e,t,n){var l={},c=!1;try{for(var u=t;u+1>5,p=[];h>3,T.mu=0):(T.epsilon=e[h]>>3,T.mu=(7&e[h])<<8|e[h+1],h+=2),p.push(T)}I.SPqcds=p,l.mainHeader?l.QCD=I:(l.currentTile.QCD=I,l.currentTile.QCC=[]);break;case 65373:v=(0,a.readUint16)(e,u);var O,E={};switch(h=u+2,l.SIZ.Csiz<257?O=e[h++]:(O=(0,a.readUint16)(e,h),h+=2),31&(f=e[h++])){case 0:g=8,m=!0;break;case 1:g=16,m=!1;break;case 2:g=16,m=!0;break;default:throw new Error("Invalid SQcd value "+f)}for(E.noQuantization=8===g,E.scalarExpounded=m,E.guardBits=f>>5,p=[];h>3,T.mu=0):(T.epsilon=e[h]>>3,T.mu=(7&e[h])<<8|e[h+1],h+=2),p.push(T);E.SPqcds=p,l.mainHeader?l.QCC[O]=E:l.currentTile.QCC[O]=E;break;case 65362:v=(0,a.readUint16)(e,u);var F={};h=u+2;var L=e[h++];F.entropyCoderWithCustomPrecincts=!!(1&L),F.sopMarkerUsed=!!(2&L),F.ephMarkerUsed=!!(4&L),F.progressionOrder=e[h++],F.layersCount=(0,a.readUint16)(e,h),h+=2,F.multipleComponentTransform=e[h++],F.decompositionLevelsCount=e[h++],F.xcb=2+(15&e[h++]),F.ycb=2+(15&e[h++]);var R=e[h++];if(F.selectiveArithmeticCodingBypass=!!(1&R),F.resetContextProbabilities=!!(2&R),F.terminationOnEachCodingPass=!!(4&R),F.verticallyStripe=!!(8&R),F.predictableTermination=!!(16&R),F.segmentationSymbolUsed=!!(32&R),F.reversibleTransformation=e[h++],F.entropyCoderWithCustomPrecincts){for(var M=[];h>4})}F.precinctsSizes=M}var N=[];if(F.selectiveArithmeticCodingBypass&&N.push("selectiveArithmeticCodingBypass"),F.resetContextProbabilities&&N.push("resetContextProbabilities"),F.terminationOnEachCodingPass&&N.push("terminationOnEachCodingPass"),F.verticallyStripe&&N.push("verticallyStripe"),F.predictableTermination&&N.push("predictableTermination"),N.length>0)throw c=!0,new Error("Unsupported COD options ("+N.join(", ")+")");l.mainHeader?l.COD=F:(l.currentTile.COD=F,l.currentTile.COC=[]);break;case 65424:v=(0,a.readUint16)(e,u),(b={}).index=(0,a.readUint16)(e,u+2),b.length=(0,a.readUint32)(e,u+4),b.dataEnd=b.length+u-2,b.partIndex=e[u+8],b.partsCount=e[u+9],l.mainHeader=!1,0===b.partIndex&&(b.COD=l.COD,b.COC=l.COC.slice(0),b.QCD=l.QCD,b.QCC=l.QCC.slice(0)),l.currentTile=b;break;case 65427:0===(b=l.currentTile).partIndex&&(A(l,b.index),y(l)),w(l,e,u,v=b.dataEnd-u);break;case 65365:case 65367:case 65368:case 65380:v=(0,a.readUint16)(e,u);break;case 65363:throw new Error("Codestream code 0xFF53 (COC) is not implemented");default:throw new Error("Unknown codestream code: "+d.toString(16))}u+=v}}catch(e){if(c||this.failOnCorruptedImage)throw new s(e.message);(0,i.warn)("JPX: Trying to recover from: "+e.message)}this.tiles=function(e){for(var t=e.SIZ,r=e.components,i=t.Csiz,a=[],n=0,s=e.tiles.length;n>2);v[w++]=e+m>>u,v[w++]=e>>u,v[w++]=e+g>>u}else for(h=0;h>u,v[w++]=p-.34413*g-.71414*m>>u,v[w++]=p+1.772*g>>u;if(x)for(h=0,w=3;h>u}else for(o=0;o>u,w+=i}a.push(y)}return a}(l),this.width=l.SIZ.Xsiz-l.SIZ.XOsiz,this.height=l.SIZ.Ysiz-l.SIZ.YOsiz,this.componentsCount=l.SIZ.Csiz}};var _=function(){function e(e,t){var r=(0,a.log2)(Math.max(e,t))+1;this.levels=[];for(var i=0;i>=1,t>>=1,i++}i--,(r=this.levels[i]).items[r.index]=a,this.currentLevel=i,delete this.value},incrementValue:function(){var e=this.levels[this.currentLevel];e.items[e.index]++},nextLevel:function(){var e=this.currentLevel,t=this.levels[e],r=t.items[t.index];return--e<0?(this.value=r,!1):(this.currentLevel=e,(t=this.levels[e]).items[t.index]=r,!0)}},e}(),S=function(){function e(e,t,r){var i=(0,a.log2)(Math.max(e,t))+1;this.levels=[];for(var n=0;nr)return this.currentLevel=i,this.propagateValues(),!1;e>>=1,t>>=1,i++}return this.currentLevel=i-1,!0},incrementValue:function(e){var t=this.levels[this.currentLevel];t.items[t.index]=e+1,this.propagateValues()},propagateValues:function(){for(var e=this.currentLevel,t=this.levels[e],r=t.items[t.index];--e>=0;)(t=this.levels[e]).items[t.index]=r},nextLevel:function(){var e=this.currentLevel,t=this.levels[e],r=t.items[t.index];return t.items[t.index]=255,!(--e<0||(this.currentLevel=e,(t=this.levels[e]).items[t.index]=r,0))}},e}(),C=function(){var e=17,t=new Uint8Array([0,5,8,0,3,7,8,0,4,7,8,0,0,0,0,0,1,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8]),r=new Uint8Array([0,3,4,0,5,7,7,0,8,8,8,0,0,0,0,0,1,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8]),i=new Uint8Array([0,1,2,0,1,2,2,0,2,2,2,0,0,0,0,0,3,4,5,0,4,5,5,0,5,5,5,0,0,0,0,0,6,7,7,0,7,7,7,0,7,7,7,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8]);function a(e,a,n,s,o){let l;this.width=e,this.height=a,l="HH"===n?i:"HL"===n?r:t,this.contextLabelTable=l;var c=e*a;let u;this.neighborsSignificance=new Uint8Array(c),this.coefficentsSign=new Uint8Array(c),u=o>14?new Uint32Array(c):o>6?new Uint16Array(c):new Uint8Array(c),this.coefficentsMagnitude=u,this.processingFlags=new Uint8Array(c);var d=new Uint8Array(c);if(0!==s)for(var h=0;h0,l=t+10&&(i=r-n,o&&(a[i-1]+=16),l&&(a[i+1]+=16),a[i]+=4),e+1=r)break;if(s[h]&=-2,!i[h]&&n[h]){var g=l[n[h]];if(e.readBit(o,g)){var m=this.decodeSignBit(p,d,h);a[h]=m,i[h]=1,this.setNeighborsSignificance(p,d,h),s[h]|=2}c[h]++,s[h]|=1}}},decodeSignBit:function(e,t,r){var i,a,n,s,o,l,c=this.width,u=this.height,d=this.coefficentsMagnitude,h=this.coefficentsSign;s=t>0&&0!==d[r-1],t+10&&0!==d[r-c],e+1=0?(o=9+i,l=this.decoder.readBit(this.contexts,o)):(o=9-i,l=1^this.decoder.readBit(this.contexts,o)),l},runMagnitudeRefinementPass:function(){for(var e,t=this.decoder,r=this.width,i=this.height,a=this.coefficentsMagnitude,n=this.neighborsSignificance,s=this.contexts,o=this.bitsDecoded,l=this.processingFlags,c=r*i,u=4*r,d=0;d>1,l=-1.586134342059924,c=-.052980118572961,u=.882911075530934,d=.443506852043971,h=1.230174104914001;for(i=(t|=0)-3,a=o+4;a--;i+=2)e[i]*=.8128930661159609;for(n=d*e[(i=t-2)-1],a=o+3;a--&&(s=d*e[i+1],e[i]=h*e[i]-n-s,a--);i+=2)n=d*e[(i+=2)+1],e[i]=h*e[i]-n-s;for(n=u*e[(i=t-1)-1],a=o+2;a--&&(s=u*e[i+1],e[i]-=n+s,a--);i+=2)n=u*e[(i+=2)+1],e[i]-=n+s;for(n=c*e[(i=t)-1],a=o+1;a--&&(s=c*e[i+1],e[i]-=n+s,a--);i+=2)n=c*e[(i+=2)+1],e[i]-=n+s;if(0!==o)for(n=l*e[(i=t+1)-1],a=o;a--&&(s=l*e[i+1],e[i]-=n+s,a--);i+=2)n=l*e[(i+=2)+1],e[i]-=n+s},e}(),T=function(){function e(){P.call(this)}return e.prototype=Object.create(P.prototype),e.prototype.filter=function(e,t,r){var i,a,n=r>>1;for(i=t|=0,a=n+1;a--;i+=2)e[i]-=e[i-1]+e[i+1]+2>>2;for(i=t+1,a=n;a--;i+=2)e[i]+=e[i-1]+e[i+1]>>1},e}();return t}();t.JpxImage=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateSHA512=t.calculateSHA384=t.calculateSHA256=t.calculateMD5=t.PDF20=t.PDF17=t.CipherTransformFactory=t.ARCFourCipher=t.AES256Cipher=t.AES128Cipher=void 0;var i=r(2),a=r(5),n=r(12),s=function(){function e(e){this.a=0,this.b=0;var t,r,i=new Uint8Array(256),a=0,n=e.length;for(t=0;t<256;++t)i[t]=t;for(t=0;t<256;++t)a=a+(r=i[t])+e[t%n]&255,i[t]=i[a],i[a]=r;this.s=i}return e.prototype={encryptBlock:function(e){var t,r,i,a=e.length,n=this.a,s=this.b,o=this.s,l=new Uint8Array(a);for(t=0;t>5&255,f[i++]=r>>13&255,f[i++]=r>>21&255,f[i++]=r>>>29&255,f[i++]=0,f[i++]=0,f[i++]=0;var p=new Int32Array(16);for(i=0;i>>32-A)|0,b=x}s=s+b|0,c=c+v|0,u=u+y|0,d=d+w|0}return new Uint8Array([255&s,s>>8&255,s>>16&255,s>>>24&255,255&c,c>>8&255,c>>16&255,c>>>24&255,255&u,u>>8&255,u>>16&255,u>>>24&255,255&d,d>>8&255,d>>16&255,d>>>24&255])});t.calculateMD5=c;var u=function(){function e(e,t){this.high=0|e,this.low=0|t}return e.prototype={and:function(e){this.high&=e.high,this.low&=e.low},xor:function(e){this.high^=e.high,this.low^=e.low},or:function(e){this.high|=e.high,this.low|=e.low},shiftRight:function(e){e>=32?(this.low=this.high>>>e-32|0,this.high=0):(this.low=this.low>>>e|this.high<<32-e,this.high=this.high>>>e|0)},shiftLeft:function(e){e>=32?(this.high=this.low<>>32-e,this.low=this.low<>>e|r<<32-e,this.high=r>>>e|t<<32-e},not:function(){this.high=~this.high,this.low=~this.low},add:function(e){var t=(this.low>>>0)+(e.low>>>0),r=(this.high>>>0)+(e.high>>>0);t>4294967295&&(r+=1),this.low=0|t,this.high=0|r},copyTo:function(e,t){e[t]=this.high>>>24&255,e[t+1]=this.high>>16&255,e[t+2]=this.high>>8&255,e[t+3]=255&this.high,e[t+4]=this.low>>>24&255,e[t+5]=this.low>>16&255,e[t+6]=this.low>>8&255,e[t+7]=255&this.low},assign:function(e){this.high=e.high,this.low=e.low}},e}(),d=function(){function e(e,t){return e>>>t|e<<32-t}function t(e,t,r){return e&t^~e&r}function r(e,t,r){return e&t^e&r^t&r}function i(t){return e(t,2)^e(t,13)^e(t,22)}function a(t){return e(t,6)^e(t,11)^e(t,25)}function n(t){return e(t,7)^e(t,18)^t>>>3}var s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];return function(o,l,c){var u,d,h,f=1779033703,p=3144134277,g=1013904242,m=2773480762,b=1359893119,v=2600822924,y=528734635,w=1541459225,x=64*Math.ceil((c+9)/64),k=new Uint8Array(x);for(u=0;u>>29&255,k[u++]=c>>21&255,k[u++]=c>>13&255,k[u++]=c>>5&255,k[u++]=c<<3&255;var A,_=new Uint32Array(64);for(u=0;u>>10)+_[d-7]+n(_[d-15])+_[d-16];var S,C,P=f,I=p,T=g,O=m,E=b,F=v,L=y,R=w;for(d=0;d<64;++d)S=R+a(E)+t(E,F,L)+s[d]+_[d],C=i(P)+r(P,I,T),R=L,L=F,F=E,E=O+S|0,O=T,T=I,I=P,P=S+C|0;f=f+P|0,p=p+I|0,g=g+T|0,m=m+O|0,b=b+E|0,v=v+F|0,y=y+L|0,w=w+R|0}return new Uint8Array([f>>24&255,f>>16&255,f>>8&255,255&f,p>>24&255,p>>16&255,p>>8&255,255&p,g>>24&255,g>>16&255,g>>8&255,255&g,m>>24&255,m>>16&255,m>>8&255,255&m,b>>24&255,b>>16&255,b>>8&255,255&b,v>>24&255,v>>16&255,v>>8&255,255&v,y>>24&255,y>>16&255,y>>8&255,255&y,w>>24&255,w>>16&255,w>>8&255,255&w])}}();t.calculateSHA256=d;var h=function(){function e(e,t,r,i,a){e.assign(t),e.and(r),a.assign(t),a.not(),a.and(i),e.xor(a)}function t(e,t,r,i,a){e.assign(t),e.and(r),a.assign(t),a.and(i),e.xor(a),a.assign(r),a.and(i),e.xor(a)}function r(e,t,r){e.assign(t),e.rotateRight(28),r.assign(t),r.rotateRight(34),e.xor(r),r.assign(t),r.rotateRight(39),e.xor(r)}function i(e,t,r){e.assign(t),e.rotateRight(14),r.assign(t),r.rotateRight(18),e.xor(r),r.assign(t),r.rotateRight(41),e.xor(r)}function a(e,t,r){e.assign(t),e.rotateRight(1),r.assign(t),r.rotateRight(8),e.xor(r),r.assign(t),r.shiftRight(7),e.xor(r)}function n(e,t,r){e.assign(t),e.rotateRight(19),r.assign(t),r.rotateRight(61),e.xor(r),r.assign(t),r.shiftRight(6),e.xor(r)}var s=[new u(1116352408,3609767458),new u(1899447441,602891725),new u(3049323471,3964484399),new u(3921009573,2173295548),new u(961987163,4081628472),new u(1508970993,3053834265),new u(2453635748,2937671579),new u(2870763221,3664609560),new u(3624381080,2734883394),new u(310598401,1164996542),new u(607225278,1323610764),new u(1426881987,3590304994),new u(1925078388,4068182383),new u(2162078206,991336113),new u(2614888103,633803317),new u(3248222580,3479774868),new u(3835390401,2666613458),new u(4022224774,944711139),new u(264347078,2341262773),new u(604807628,2007800933),new u(770255983,1495990901),new u(1249150122,1856431235),new u(1555081692,3175218132),new u(1996064986,2198950837),new u(2554220882,3999719339),new u(2821834349,766784016),new u(2952996808,2566594879),new u(3210313671,3203337956),new u(3336571891,1034457026),new u(3584528711,2466948901),new u(113926993,3758326383),new u(338241895,168717936),new u(666307205,1188179964),new u(773529912,1546045734),new u(1294757372,1522805485),new u(1396182291,2643833823),new u(1695183700,2343527390),new u(1986661051,1014477480),new u(2177026350,1206759142),new u(2456956037,344077627),new u(2730485921,1290863460),new u(2820302411,3158454273),new u(3259730800,3505952657),new u(3345764771,106217008),new u(3516065817,3606008344),new u(3600352804,1432725776),new u(4094571909,1467031594),new u(275423344,851169720),new u(430227734,3100823752),new u(506948616,1363258195),new u(659060556,3750685593),new u(883997877,3785050280),new u(958139571,3318307427),new u(1322822218,3812723403),new u(1537002063,2003034995),new u(1747873779,3602036899),new u(1955562222,1575990012),new u(2024104815,1125592928),new u(2227730452,2716904306),new u(2361852424,442776044),new u(2428436474,593698344),new u(2756734187,3733110249),new u(3204031479,2999351573),new u(3329325298,3815920427),new u(3391569614,3928383900),new u(3515267271,566280711),new u(3940187606,3454069534),new u(4118630271,4000239992),new u(116418474,1914138554),new u(174292421,2731055270),new u(289380356,3203993006),new u(460393269,320620315),new u(685471733,587496836),new u(852142971,1086792851),new u(1017036298,365543100),new u(1126000580,2618297676),new u(1288033470,3409855158),new u(1501505948,4234509866),new u(1607167915,987167468),new u(1816402316,1246189591)];return function(o,l,c,d){var h,f,p,g,m,b,v,y;(d=!!d)?(h=new u(3418070365,3238371032),f=new u(1654270250,914150663),p=new u(2438529370,812702999),g=new u(355462360,4144912697),m=new u(1731405415,4290775857),b=new u(2394180231,1750603025),v=new u(3675008525,1694076839),y=new u(1203062813,3204075428)):(h=new u(1779033703,4089235720),f=new u(3144134277,2227873595),p=new u(1013904242,4271175723),g=new u(2773480762,1595750129),m=new u(1359893119,2917565137),b=new u(2600822924,725511199),v=new u(528734635,4215389547),y=new u(1541459225,327033209));var w,x,k,A=128*Math.ceil((c+17)/128),_=new Uint8Array(A);for(w=0;w>>29&255,_[w++]=c>>21&255,_[w++]=c>>13&255,_[w++]=c>>5&255,_[w++]=c<<3&255;var S=new Array(80);for(w=0;w<80;w++)S[w]=new u(0,0);var C,P,I=new u(0,0),T=new u(0,0),O=new u(0,0),E=new u(0,0),F=new u(0,0),L=new u(0,0),R=new u(0,0),M=new u(0,0),D=new u(0,0),N=new u(0,0),B=new u(0,0),U=new u(0,0);for(w=0;w=1;--e){r=n[13],n[13]=n[9],n[9]=n[5],n[5]=n[1],n[1]=r,r=n[14],i=n[10],n[14]=n[6],n[10]=n[2],n[6]=r,n[2]=i,r=n[15],i=n[11],a=n[7],n[15]=n[3],n[11]=r,n[7]=i,n[3]=a;for(let e=0;e<16;++e)n[e]=this._inv_s[n[e]];for(let r=0,i=16*e;r<16;++r,++i)n[r]^=t[i];for(let e=0;e<16;e+=4){const t=this._mix[n[e]],i=this._mix[n[e+1]],a=this._mix[n[e+2]],s=this._mix[n[e+3]];r=t^i>>>8^i<<24^a>>>16^a<<16^s>>>24^s<<8,n[e]=r>>>24&255,n[e+1]=r>>16&255,n[e+2]=r>>8&255,n[e+3]=255&r}}r=n[13],n[13]=n[9],n[9]=n[5],n[5]=n[1],n[1]=r,r=n[14],i=n[10],n[14]=n[6],n[10]=n[2],n[6]=r,n[2]=i,r=n[15],i=n[11],a=n[7],n[15]=n[3],n[11]=r,n[7]=i,n[3]=a;for(let e=0;e<16;++e)n[e]=this._inv_s[n[e]],n[e]^=t[e];return n}_encrypt(e,t){const r=this._s;let i,a,n;const s=new Uint8Array(16);s.set(e);for(let e=0;e<16;++e)s[e]^=t[e];for(let e=1;e=i;--r)if(e[r]!==t){t=0;break}o-=t,n[n.length-1]=e.subarray(0,16-t)}}const l=new Uint8Array(o);for(let e=0,t=0,r=n.length;e=256&&(o=255&(27^o)));for(let t=0;t<4;++t)r[e]=i^=r[e-32],e++,r[e]=a^=r[e-32],e++,r[e]=n^=r[e-32],e++,r[e]=s^=r[e-32],e++}return r}}t.AES256Cipher=b;var v=function(){function e(e,t){if(e.length!==t.length)return!1;for(var r=0;rs-32;){var o=t.length+a.length+i.length,l=new Uint8Array(64*o),c=e(t,a);c=e(c,i);for(var u=0,p=0;u<64;u++,p+=o)l.set(c,p);n=new m(a.subarray(0,16)).encrypt(l,a.subarray(16,32));for(var g=0,b=0;b<16;b++)g*=1,g%=3,g+=(n[b]>>>0)%3,g%=3;0===g?a=d(n,0,n.length):1===g?a=f(n,0,n.length):2===g&&(a=h(n,0,n.length)),s++}return a.subarray(0,32)}function r(){}function i(e,t){if(e.length!==t.length)return!1;for(var r=0;r>8&255,p[g++]=n>>16&255,p[g++]=n>>>24&255,d=0,h=t.length;d=4&&!u&&(p[g++]=255,p[g++]=255,p[g++]=255,p[g++]=255);var m=c(p,0,g),b=l>>3;if(o>=3)for(d=0;d<50;++d)m=c(m,0,b);var v,y=m.subarray(0,b);if(o>=3){for(g=0;g<32;++g)p[g]=e[g];for(d=0,h=t.length;d>3;if(i>=3)for(n=0;n<50;++n)h=c(h,0,h.length);if(i>=3){d=r;var p,g=new Uint8Array(f);for(n=19;n>=0;n--){for(p=0;p=4){var R=n.get("CF");(0,a.isDict)(R)&&(R.suppressEncryption=!0),this.cf=R,this.stmf=n.get("StmF")||r,this.strf=n.get("StrF")||r,this.eff=n.get("EFF")||this.stmf}}function o(e,t,r,i){var a,n,s=new Uint8Array(r.length+9);for(a=0,n=r.length;a>8&255,s[a++]=e>>16&255,s[a++]=255&t,s[a++]=t>>8&255,i&&(s[a++]=115,s[a++]=65,s[a++]=108,s[a++]=84),c(s,0,a).subarray(0,Math.min(r.length+5,16))}function l(e,t,r,n,l){if(!(0,a.isName)(t))throw new i.FormatError("Invalid crypt filter name.");var c,u=e.get(t.name);if(null!=u&&(c=u.get("CFM")),!c||"None"===c.name)return function(){return new p};if("V2"===c.name)return function(){return new s(o(r,n,l,!1))};if("AESV2"===c.name)return function(){return new m(o(r,n,l,!0))};if("AESV3"===c.name)return function(){return new b(l)};throw new i.FormatError("Unknown crypto method")}return n.prototype={createCipherTransform:function(e,t){if(4===this.algorithm||5===this.algorithm)return new w(l(this.cf,this.stmf,e,t,this.encryptionKey),l(this.cf,this.strf,e,t,this.encryptionKey));var r=o(e,t,this.encryptionKey,!1),i=function(){return new s(r)};return new w(i,i)}},n}();t.CipherTransformFactory=x},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorSpace=void 0;var i=r(2),a=r(5);class n{constructor(e,t){this.constructor===n&&(0,i.unreachable)("Cannot initialize ColorSpace."),this.name=e,this.numComps=t}getRgb(e,t){const r=new Uint8ClampedArray(3);return this.getRgbItem(e,t,r,0),r}getRgbItem(e,t,r,a){(0,i.unreachable)("Should not call ColorSpace.getRgbItem")}getRgbBuffer(e,t,r,a,n,s,o){(0,i.unreachable)("Should not call ColorSpace.getRgbBuffer")}getOutputLength(e,t){(0,i.unreachable)("Should not call ColorSpace.getOutputLength")}isPassthrough(e){return!1}isDefaultDecode(e,t){return n.isDefaultDecode(e,this.numComps)}fillRgb(e,t,r,i,a,n,s,o,l){const c=t*r;let u=null;const d=1<d&&"DeviceGray"!==this.name&&"DeviceRGB"!==this.name){const t=s<=8?new Uint8Array(d):new Uint16Array(d);for(let e=0;e8?((e+16)/116)**3:.0011070564598794539*e}function f(i,n,f,p,g,m){const b=d(0,1,n[f]*m),v=d(0,1,n[f+1]*m),y=d(0,1,n[f+2]*m),w=b**i.GR,x=v**i.GG,k=y**i.GB,A=i.MXA*w+i.MXB*x+i.MXC*k,_=i.MYA*w+i.MYB*x+i.MYC*k,S=i.MZA*w+i.MZB*x+i.MZC*k,C=o;C[0]=A,C[1]=_,C[2]=S;const P=l;!function(r,i,a){if(1===r[0]&&1===r[2])return a[0]=i[0],a[1]=i[1],void(a[2]=i[2]);const n=a;c(e,i,n);const o=s;!function(e,t,r){r[0]=1*t[0]/e[0],r[1]=1*t[1]/e[1],r[2]=1*t[2]/e[2]}(r,n,o),c(t,o,a)}(i.whitePoint,C,P);const I=o;!function(e,t,r){if(0===e[0]&&0===e[1]&&0===e[2])return r[0]=t[0],r[1]=t[1],void(r[2]=t[2]);const i=h(0),a=(1-i)/(1-h(e[0])),n=1-a,s=(1-i)/(1-h(e[1])),o=1-s,l=(1-i)/(1-h(e[2])),c=1-l;r[0]=t[0]*a+n,r[1]=t[1]*s+o,r[2]=t[2]*l+c}(i.blackPoint,P,I);const T=l;!function(r,i,a){const n=a;c(e,i,n);const o=s;!function(e,t,r){r[0]=.95047*t[0]/e[0],r[1]=1*t[1]/e[1],r[2]=1.08883*t[2]/e[2]}(r,n,o),c(t,o,a)}(a,I,T);const O=o;c(r,T,O),p[g]=255*u(O[0]),p[g+1]=255*u(O[1]),p[g+2]=255*u(O[2])}return class extends n{constructor(e,t,r,a){if(super("CalRGB",3),!e)throw new i.FormatError("WhitePoint missing - required for color space CalRGB");t=t||new Float32Array(3),r=r||new Float32Array([1,1,1]),a=a||new Float32Array([1,0,0,0,1,0,0,0,1]);const n=e[0],s=e[1],o=e[2];this.whitePoint=e;const l=t[0],c=t[1],u=t[2];if(this.blackPoint=t,this.GR=r[0],this.GG=r[1],this.GB=r[2],this.MXA=a[0],this.MYA=a[1],this.MZA=a[2],this.MXB=a[3],this.MYB=a[4],this.MZB=a[5],this.MXC=a[6],this.MYC=a[7],this.MZC=a[8],n<0||o<0||1!==s)throw new i.FormatError(`Invalid WhitePoint components for ${this.name}, no fallback available`);(l<0||c<0||u<0)&&((0,i.info)(`Invalid BlackPoint for ${this.name} [${l}, ${c}, ${u}], falling back to default.`),this.blackPoint=new Float32Array(3)),(this.GR<0||this.GG<0||this.GB<0)&&((0,i.info)(`Invalid Gamma [${this.GR}, ${this.GG}, ${this.GB}] for ${this.name}, falling back to default.`),this.GR=this.GG=this.GB=1)}getRgbItem(e,t,r,i){f(this,e,t,r,i,1)}getRgbBuffer(e,t,r,i,a,n,s){const o=1/((1<=6/29?e*e*e:108/841*(e-4/29),t}function t(e,t,r,i){return r+e*(i-r)/t}function r(r,i,a,n,s,o){let l=i[a],c=i[a+1],u=i[a+2];!1!==n&&(l=t(l,n,0,100),c=t(c,n,r.amin,r.amax),u=t(u,n,r.bmin,r.bmax)),c>r.amax?c=r.amax:cr.bmax?u=r.bmax:uthis.amax||this.bmin>this.bmax)&&((0,i.info)("Invalid Range, falling back to defaults"),this.amin=-100,this.amax=100,this.bmin=-100,this.bmax=100)}getRgbItem(e,t,i,a){r(this,e,t,!1,i,a)}getRgbBuffer(e,t,i,a,n,s,o){const l=(1<=n.MAX_IMAGES_TO_CACHE)}addPageIndex(e,t){let r=this._refCache.get(e);r||(r=new Set,this._refCache.put(e,r)),r.add(t)}getData(e,t){if(!this._refCache.has(e))return null;const r=this._refCache.get(e);return r.size=n.MAX_IMAGES_TO_CACHE?(0,i.info)("GlobalImageCache.setData - ignoring image above MAX_IMAGES_TO_CACHE."):this._imageCache.put(e,t))}clear(e=!1){e||this._refCache.clear(),this._imageCache.clear()}}t.GlobalImageCache=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getQuadPoints=u,t.MarkupAnnotation=t.AnnotationFactory=t.AnnotationBorderStyle=t.Annotation=void 0;var i=r(2),a=r(10),n=r(5),s=r(23),o=r(8),l=r(26),c=r(12);function u(e,t){if(!e.has("QuadPoints"))return null;const r=e.getArray("QuadPoints");if(!Array.isArray(r)||r.length%8>0)return null;const i=[];for(let e=0,a=r.length/8;et[2]||st[3])return null;i[e].push({x:n,y:s})}}return i}t.AnnotationFactory=class{static create(e,t,r,i){return r.ensure(this,"_create",[e,t,r,i])}static _create(e,t,r,a){const s=e.fetchIfRef(t);if(!(0,n.isDict)(s))return;const l=(0,n.isRef)(t)?t.toString():`annot_${a.createObjId()}`;let c=s.get("Subtype");c=(0,n.isName)(c)?c.name:null;const u={xref:e,dict:s,subtype:c,id:l,pdfManager:r};switch(c){case"Link":return new y(u);case"Text":return new v(u);case"Widget":let e=(0,o.getInheritableProperty)({dict:s,key:"FT"});switch(e=(0,n.isName)(e)?e.name:null,e){case"Tx":return new g(u);case"Btn":return new m(u);case"Ch":return new b(u)}return(0,i.warn)('Unimplemented widget field type "'+e+'", falling back to base field type.'),new p(u);case"Popup":return new w(u);case"FreeText":return new x(u);case"Line":return new k(u);case"Square":return new A(u);case"Circle":return new _(u);case"PolyLine":return new S(u);case"Polygon":return new C(u);case"Caret":return new P(u);case"Ink":return new I(u);case"Highlight":return new T(u);case"Underline":return new O(u);case"Squiggly":return new E(u);case"StrikeOut":return new F(u);case"Stamp":return new L(u);case"FileAttachment":return new R(u);default:return c?(0,i.warn)('Unimplemented annotation type "'+c+'", falling back to base annotation.'):(0,i.warn)("Annotation is missing the required /Subtype."),new d(u)}}};class d{constructor(e){const t=e.dict;this.setContents(t.get("Contents")),this.setModificationDate(t.get("M")),this.setFlags(t.get("F")),this.setRectangle(t.getArray("Rect")),this.setColor(t.getArray("C")),this.setBorderStyle(t),this.setAppearance(t),this.data={annotationFlags:this.flags,borderStyle:this.borderStyle,color:this.color,contents:this.contents,hasAppearance:!!this.appearance,id:e.id,modificationDate:this.modificationDate,rect:this.rectangle,subtype:e.subtype}}_hasFlag(e,t){return!!(e&t)}_isViewable(e){return!this._hasFlag(e,i.AnnotationFlag.INVISIBLE)&&!this._hasFlag(e,i.AnnotationFlag.HIDDEN)&&!this._hasFlag(e,i.AnnotationFlag.NOVIEW)}_isPrintable(e){return this._hasFlag(e,i.AnnotationFlag.PRINT)&&!this._hasFlag(e,i.AnnotationFlag.INVISIBLE)&&!this._hasFlag(e,i.AnnotationFlag.HIDDEN)}get viewable(){return 0===this.flags||this._isViewable(this.flags)}get printable(){return 0!==this.flags&&this._isPrintable(this.flags)}setContents(e){this.contents=(0,i.stringToPDFString)(e||"")}setModificationDate(e){this.modificationDate=(0,i.isString)(e)?e:null}setFlags(e){this.flags=Number.isInteger(e)&&e>0?e:0}hasFlag(e){return this._hasFlag(this.flags,e)}setRectangle(e){Array.isArray(e)&&4===e.length?this.rectangle=i.Util.normalizeRect(e):this.rectangle=[0,0,0,0]}setColor(e){const t=new Uint8ClampedArray(3);if(Array.isArray(e))switch(e.length){case 0:this.color=null;break;case 1:s.ColorSpace.singletons.gray.getRgbItem(e,0,t,0),this.color=t;break;case 3:s.ColorSpace.singletons.rgb.getRgbItem(e,0,t,0),this.color=t;break;case 4:s.ColorSpace.singletons.cmyk.getRgbItem(e,0,t,0),this.color=t;break;default:this.color=t}else this.color=t}setBorderStyle(e){if(this.borderStyle=new h,(0,n.isDict)(e))if(e.has("BS")){const t=e.get("BS"),r=t.get("Type");r&&!(0,n.isName)(r,"Border")||(this.borderStyle.setWidth(t.get("W"),this.rectangle),this.borderStyle.setStyle(t.get("S")),this.borderStyle.setDashArray(t.getArray("D")))}else if(e.has("Border")){const t=e.getArray("Border");Array.isArray(t)&&t.length>=3&&(this.borderStyle.setHorizontalCornerRadius(t[0]),this.borderStyle.setVerticalCornerRadius(t[1]),this.borderStyle.setWidth(t[2],this.rectangle),4===t.length&&this.borderStyle.setDashArray(t[3]))}else this.borderStyle.setWidth(0)}setAppearance(e){this.appearance=null;const t=e.get("AP");if(!(0,n.isDict)(t))return;const r=t.get("N");if((0,n.isStream)(r))return void(this.appearance=r);if(!(0,n.isDict)(r))return;const i=e.get("AS");(0,n.isName)(i)&&r.has(i.name)&&(this.appearance=r.get(i.name))}loadResources(e){return this.appearance.dict.getAsync("Resources").then((t=>{if(t)return new a.ObjectLoader(t,e,t.xref).load().then((function(){return t}))}))}getOperatorList(e,t,r){if(!this.appearance)return Promise.resolve(new l.OperatorList);const a=this.data,n=this.appearance.dict,s=this.loadResources(["ExtGState","ColorSpace","Pattern","Shading","XObject","Font"]),o=n.getArray("BBox")||[0,0,1,1],c=n.getArray("Matrix")||[1,0,0,1,0,0],u=function(e,t,r){const[a,n,s,o]=i.Util.getAxialAlignedBoundingBox(t,r);if(a===s||n===o)return[1,0,0,1,e[0],e[1]];const l=(e[2]-e[0])/(s-a),c=(e[3]-e[1])/(o-n);return[l,0,0,c,e[0]-a*l,e[1]-n*c]}(a.rect,o,c);return s.then((r=>{const n=new l.OperatorList;return n.addOp(i.OPS.beginAnnotation,[a.rect,u,c]),e.getOperatorList({stream:this.appearance,task:t,resources:r,operatorList:n}).then((()=>(n.addOp(i.OPS.endAnnotation,[]),this.appearance.reset(),n)))}))}}t.Annotation=d;class h{constructor(){this.width=1,this.style=i.AnnotationBorderStyleType.SOLID,this.dashArray=[3],this.horizontalCornerRadius=0,this.verticalCornerRadius=0}setWidth(e,t=[0,0,0,0]){if((0,n.isName)(e))this.width=0;else if(Number.isInteger(e)){if(e>0){const r=(t[2]-t[0])/2,a=(t[3]-t[1])/2;r>0&&a>0&&(e>r||e>a)&&((0,i.warn)(`AnnotationBorderStyle.setWidth - ignoring width: ${e}`),e=1)}this.width=e}}setStyle(e){if((0,n.isName)(e))switch(e.name){case"S":this.style=i.AnnotationBorderStyleType.SOLID;break;case"D":this.style=i.AnnotationBorderStyleType.DASHED;break;case"B":this.style=i.AnnotationBorderStyleType.BEVELED;break;case"I":this.style=i.AnnotationBorderStyleType.INSET;break;case"U":this.style=i.AnnotationBorderStyleType.UNDERLINE}}setDashArray(e){if(Array.isArray(e)&&e.length>0){let t=!0,r=!0;for(const i of e){if(!(+i>=0)){t=!1;break}i>0&&(r=!1)}t&&!r?this.dashArray=e:this.width=0}else e&&(this.width=0)}setHorizontalCornerRadius(e){Number.isInteger(e)&&(this.horizontalCornerRadius=e)}setVerticalCornerRadius(e){Number.isInteger(e)&&(this.verticalCornerRadius=e)}}t.AnnotationBorderStyle=h;class f extends d{constructor(e){super(e);const t=e.dict;if(t.has("IRT")){const e=t.getRaw("IRT");this.data.inReplyTo=(0,n.isRef)(e)?e.toString():null;const r=t.get("RT");this.data.replyType=(0,n.isName)(r)?r.name:i.AnnotationReplyType.REPLY}if(this.data.replyType===i.AnnotationReplyType.GROUP){const e=t.get("IRT");this.data.title=(0,i.stringToPDFString)(e.get("T")||""),this.setContents(e.get("Contents")),this.data.contents=this.contents,e.has("CreationDate")?(this.setCreationDate(e.get("CreationDate")),this.data.creationDate=this.creationDate):this.data.creationDate=null,e.has("M")?(this.setModificationDate(e.get("M")),this.data.modificationDate=this.modificationDate):this.data.modificationDate=null,this.data.hasPopup=e.has("Popup"),e.has("C")?(this.setColor(e.getArray("C")),this.data.color=this.color):this.data.color=null}else this.data.title=(0,i.stringToPDFString)(t.get("T")||""),this.setCreationDate(t.get("CreationDate")),this.data.creationDate=this.creationDate,this.data.hasPopup=t.has("Popup"),t.has("C")||(this.data.color=null)}setCreationDate(e){this.creationDate=(0,i.isString)(e)?e:null}}t.MarkupAnnotation=f;class p extends d{constructor(e){super(e);const t=e.dict,r=this.data;r.annotationType=i.AnnotationType.WIDGET,r.fieldName=this._constructFieldName(t),r.fieldValue=(0,o.getInheritableProperty)({dict:t,key:"V",getArray:!0}),r.alternativeText=(0,i.stringToPDFString)(t.get("TU")||""),r.defaultAppearance=(0,o.getInheritableProperty)({dict:t,key:"DA"})||"";const a=(0,o.getInheritableProperty)({dict:t,key:"FT"});r.fieldType=(0,n.isName)(a)?a.name:null,this.fieldResources=(0,o.getInheritableProperty)({dict:t,key:"DR"})||n.Dict.empty,r.fieldFlags=(0,o.getInheritableProperty)({dict:t,key:"Ff"}),(!Number.isInteger(r.fieldFlags)||r.fieldFlags<0)&&(r.fieldFlags=0),r.readOnly=this.hasFieldFlag(i.AnnotationFieldFlag.READONLY),"Sig"===r.fieldType&&(r.fieldValue=null,this.setFlags(i.AnnotationFlag.HIDDEN))}_constructFieldName(e){if(!e.has("T")&&!e.has("Parent"))return(0,i.warn)("Unknown field name, falling back to empty field name."),"";if(!e.has("Parent"))return(0,i.stringToPDFString)(e.get("T"));const t=[];e.has("T")&&t.unshift((0,i.stringToPDFString)(e.get("T")));let r=e;for(;r.has("Parent")&&(r=r.get("Parent"),(0,n.isDict)(r));)r.has("T")&&t.unshift((0,i.stringToPDFString)(r.get("T")));return t.join(".")}hasFieldFlag(e){return!!(this.data.fieldFlags&e)}getOperatorList(e,t,r){return r?Promise.resolve(new l.OperatorList):super.getOperatorList(e,t,r)}}class g extends p{constructor(e){super(e);const t=e.dict;this.data.fieldValue=(0,i.stringToPDFString)(this.data.fieldValue||"");let r=(0,o.getInheritableProperty)({dict:t,key:"Q"});(!Number.isInteger(r)||r<0||r>2)&&(r=null),this.data.textAlignment=r;let a=(0,o.getInheritableProperty)({dict:t,key:"MaxLen"});(!Number.isInteger(a)||a<0)&&(a=null),this.data.maxLen=a,this.data.multiLine=this.hasFieldFlag(i.AnnotationFieldFlag.MULTILINE),this.data.comb=this.hasFieldFlag(i.AnnotationFieldFlag.COMB)&&!this.hasFieldFlag(i.AnnotationFieldFlag.MULTILINE)&&!this.hasFieldFlag(i.AnnotationFieldFlag.PASSWORD)&&!this.hasFieldFlag(i.AnnotationFieldFlag.FILESELECT)&&null!==this.data.maxLen}getOperatorList(e,t,r){if(r||this.appearance)return super.getOperatorList(e,t,r);const a=new l.OperatorList;if(!this.data.defaultAppearance)return Promise.resolve(a);const n=new c.Stream((0,i.stringToBytes)(this.data.defaultAppearance));return e.getOperatorList({stream:n,task:t,resources:this.fieldResources,operatorList:a}).then((function(){return a}))}}class m extends p{constructor(e){super(e),this.data.checkBox=!this.hasFieldFlag(i.AnnotationFieldFlag.RADIO)&&!this.hasFieldFlag(i.AnnotationFieldFlag.PUSHBUTTON),this.data.radioButton=this.hasFieldFlag(i.AnnotationFieldFlag.RADIO)&&!this.hasFieldFlag(i.AnnotationFieldFlag.PUSHBUTTON),this.data.pushButton=this.hasFieldFlag(i.AnnotationFieldFlag.PUSHBUTTON),this.data.checkBox?this._processCheckBox(e):this.data.radioButton?this._processRadioButton(e):this.data.pushButton?this._processPushButton(e):(0,i.warn)("Invalid field flags for button widget annotation")}_processCheckBox(e){(0,n.isName)(this.data.fieldValue)&&(this.data.fieldValue=this.data.fieldValue.name);const t=e.dict.get("AP");if(!(0,n.isDict)(t))return;const r=t.get("D");if(!(0,n.isDict)(r))return;const i=r.getKeys();2===i.length&&(this.data.exportValue="Off"===i[0]?i[1]:i[0])}_processRadioButton(e){this.data.fieldValue=this.data.buttonValue=null;const t=e.dict.get("Parent");if((0,n.isDict)(t)&&t.has("V")){const e=t.get("V");(0,n.isName)(e)&&(this.data.fieldValue=e.name)}const r=e.dict.get("AP");if(!(0,n.isDict)(r))return;const i=r.get("N");if((0,n.isDict)(i))for(const e of i.getKeys())if("Off"!==e){this.data.buttonValue=e;break}}_processPushButton(e){e.dict.has("A")?a.Catalog.parseDestDictionary({destDict:e.dict,resultObj:this.data,docBaseUrl:e.pdfManager.docBaseUrl}):(0,i.warn)("Push buttons without action dictionaries are not supported")}}class b extends p{constructor(e){super(e),this.data.options=[];const t=(0,o.getInheritableProperty)({dict:e.dict,key:"Opt"});if(Array.isArray(t)){const r=e.xref;for(let e=0,a=t.length;e1e3&&(d=Math.max(d,p),g+=f+2,p=0,f=0),h.push({transform:m,x:p,y:g,w:b.width,h:b.height}),p+=b.width+2,f=Math.max(f,b.height)}var v=Math.max(d,p)+1,y=g+f+1,w=new Uint8ClampedArray(v*y*4),x=v<<2;for(u=0;u=0;)k[S-4]=k[S],k[S-3]=k[S+1],k[S-2]=k[S+2],k[S-1]=k[S+3],k[S+A]=k[S+A-4],k[S+A+1]=k[S+A-3],k[S+A+2]=k[S+A-2],k[S+A+3]=k[S+A-1],S-=x}return r.splice(s,4*c,i.OPS.paintInlineImageXObjectGroup),a.splice(s,4*c,[{width:v,height:y,kind:i.ImageKind.RGBA_32BPP,data:w},h]),s+1})),e(t,[i.OPS.save,i.OPS.transform,i.OPS.paintImageMaskXObject,i.OPS.restore],null,(function(e,t){var r=e.fnArray,a=(t-(e.iCurr-3))%4;switch(a){case 0:return r[t]===i.OPS.save;case 1:return r[t]===i.OPS.transform;case 2:return r[t]===i.OPS.paintImageMaskXObject;case 3:return r[t]===i.OPS.restore}throw new Error(`iterateImageMaskGroup - invalid pos: ${a}`)}),(function(e,t){var r,a=e.fnArray,n=e.argsArray,s=e.iCurr,o=s-3,l=s-2,c=s-1,u=Math.floor((t-o)/4);if(u=function(e,t,r,a){for(var n=e+2,s=0;s=4&&r[n-4]===r[s]&&r[n-3]===r[o]&&r[n-2]===r[l]&&r[n-1]===r[c]&&i[n-4][0]===u&&i[n-4][1]===d&&(h++,f-=5);for(var p=f+4,g=1;g=i)break}a=(a||t)[e[r]],a&&!Array.isArray(a)?(s.iCurr=r,r++,!a.checkFn||(0,a.checkFn)(s)?(n=a,a=null):a=null):r++}this.state=a,this.match=n,this.lastProcessed=r},push(e,t){this.queue.fnArray.push(e),this.queue.argsArray.push(t),this._optimize()},flush(){for(;this.match;){const e=this.queue.fnArray.length;this.lastProcessed=(0,this.match.processFn)(this.context,e),this.match=null,this.state=null,this._optimize()}},reset(){this.state=null,this.match=null,this.lastProcessed=0}},r}(),n=function(){function e(e){this.queue=e}return e.prototype={push(e,t){this.queue.fnArray.push(e),this.queue.argsArray.push(t)},flush(){},reset(){}},e}(),s=function(){function e(e,t,r){this._streamSink=t,this.fnArray=[],this.argsArray=[],this.optimizer=t&&"oplist"!==e?new a(this):new n(this),this.dependencies=Object.create(null),this._totalLength=0,this.pageIndex=r,this.intent=e,this.weight=0,this._resolved=t?null:Promise.resolve()}return e.prototype={get length(){return this.argsArray.length},get ready(){return this._resolved||this._streamSink.ready},get totalLength(){return this._totalLength+this.length},addOp(e,t){this.optimizer.push(e,t),this.weight++,this._streamSink&&(this.weight>=1e3||this.weight>=995&&(e===i.OPS.restore||e===i.OPS.endText))&&this.flush()},addDependency(e){e in this.dependencies||(this.dependencies[e]=!0,this.addOp(i.OPS.dependency,[e]))},addDependencies(e){for(var t in e)this.addDependency(t)},addOpList(t){if(t instanceof e){Object.assign(this.dependencies,t.dependencies);for(var r=0,a=t.length;r{if(this.builtInCMapCache.has(e))return this.builtInCMapCache.get(e);const t=this.handler.sendWithStream("FetchBuiltInCMap",{name:e}).getReader(),r=await new Promise((function(e,r){!function i(){t.read().then((function({value:t,done:r}){r||(e(t),i())}),r)}()}));return r.compressionType!==i.CMapCompressionType.NONE&&this.builtInCMapCache.set(e,r),r}}function r(){this.reset()}function h(e,t=!1){if(Array.isArray(e)){for(let t=0,r=e.length;tf)return void(0,i.warn)("Image exceeded maximum allowed size and was removed.");if(o.get("ImageMask","IM")){var p=o.get("Width","W"),m=o.get("Height","H"),b=p+7>>3,v=t.getBytes(b*m,!0),y=o.getArray("Decode","D");return(d=k.PDFImage.createMask({imgArray:v,width:p,height:m,imageIsFromDecodeStream:t instanceof g.DecodeStream,inverseDecode:!!y&&y[0]>0})).cached=!!n,h=[d],a.addOp(i.OPS.paintImageMaskXObject,h),void(n&&s.set(n,l,{fn:i.OPS.paintImageMaskXObject,args:h}))}var w=o.get("SMask","SM")||!1,x=o.get("Mask")||!1;if(r&&!w&&!x&&c+u<200){const n=new k.PDFImage({xref:this.xref,res:e,image:t,isInline:r,pdfFunctionFactory:this.pdfFunctionFactory});return d=n.createImageData(!0),void a.addOp(i.OPS.paintInlineImageXObject,[d])}let A=`img_${this.idFactory.createObjId()}`,_=!1;this.parsingType3Font?A=`${this.idFactory.getDocId()}_type3res_${A}`:l&&(_=this.globalImageCache.shouldCache(l,this.pageIndex),_&&(A=`${this.idFactory.getDocId()}_${A}`)),a.addDependency(A),h=[A,c,u];const S=k.PDFImage.buildImage({xref:this.xref,res:e,image:t,isInline:r,pdfFunctionFactory:this.pdfFunctionFactory}).then((e=>{if(d=e.createImageData(!1),this.parsingType3Font)return this.handler.sendWithPromise("commonobj",[A,"FontType3Res",d],[d.data.buffer]);_?this.handler.send("commonobj",[A,"Image",d],[d.data.buffer]):this.handler.send("obj",[A,this.pageIndex,"Image",d],[d.data.buffer])})).catch((e=>{if((0,i.warn)("Unable to decode image: "+e),this.parsingType3Font)return this.handler.sendWithPromise("commonobj",[A,"FontType3Res",null]);_?this.handler.send("commonobj",[A,"Image",null]):this.handler.send("obj",[A,this.pageIndex,"Image",null])}));this.parsingType3Font&&await S,a.addOp(i.OPS.paintImageXObject,h),n&&(s.set(n,l,{fn:i.OPS.paintImageXObject,args:h}),l&&((0,i.assert)(!r,"Cannot cache an inline image globally."),this.globalImageCache.addPageIndex(l,this.pageIndex),_&&this.globalImageCache.setData(l,{objId:A,fn:i.OPS.paintImageXObject,args:h})))},handleSMask:function(e,t,r,i,a){var n=e.get("G"),s={subtype:e.get("S").name,backdrop:e.get("BC")},o=e.get("TR");if((0,v.isPDFFunction)(o)){const e=this.pdfFunctionFactory.create(o);for(var l=new Uint8Array(256),c=new Float32Array(1),u=0;u<256;u++)c[0]=u/255,e(c,0,c,0),l[u]=255*c[0]|0;s.transferMap=l}return this.buildFormXObject(t,n,s,r,i,a.state.clone())},handleTilingType(e,t,r,a,s,o,l){const c=new x.OperatorList,u=[s.get("Resources"),r],h=n.Dict.merge(this.xref,u);return this.getOperatorList({stream:a,task:l,resources:h,operatorList:c}).then((function(){return(0,d.getTilingPatternIR)({fnArray:c.fnArray,argsArray:c.argsArray},s,t)})).then((function(t){o.addDependencies(c.dependencies),o.addOp(e,t)}),(e=>{if(!(e instanceof i.AbortException)){if(this.options.ignoreErrors)return this.handler.send("UnsupportedFeature",{featureId:i.UNSUPPORTED_FEATURES.errorTilingPattern}),void(0,i.warn)(`handleTilingType - ignoring pattern: "${e}".`);throw e}}))},handleSetFont:function(e,t,r,a,n,o){var l;return t&&(l=(t=t.slice())[0].name),this.loadFont(l,r,e).then((t=>t.font.isType3Font?t.loadType3Data(this,e,a,n).then((function(){return t})).catch((e=>(this.handler.send("UnsupportedFeature",{featureId:i.UNSUPPORTED_FEATURES.errorFontLoadType3}),new _({loadedName:"g_font_error",font:new s.ErrorFont(`Type3 font load error: ${e}`),dict:t.font,extraProperties:this.options.fontExtraProperties})))):t)).then((e=>(o.font=e.font,e.send(this.handler),e.loadedName)))},handleText(e,r){const a=r.font,n=a.charsToGlyphs(e);return a.data&&(r.textRenderingMode&i.TextRenderingMode.ADD_TO_PATH_FLAG||"Pattern"===r.fillColorSpace.name||a.disableFontFace||this.options.disableFontFace)&&t.buildFontPaths(a,n,this.handler),n},ensureStateFont(e){if(e.font)return;const t=new i.FormatError("Missing setFont (Tf) operator before text rendering operator.");if(this.options.ignoreErrors)return this.handler.send("UnsupportedFeature",{featureId:i.UNSUPPORTED_FEATURES.errorFontState}),void(0,i.warn)(`ensureStateFont: "${t}".`);throw t},setGState:function(e,t,r,a,s){for(var o=[],l=t.getKeys(),c=Promise.resolve(),u=0,d=l.length;uthis.handleSetFont(e,null,f[0],r,a,s.state).then((function(e){r.addDependency(e),o.push([d,[e,f[1]]])}))));break;case"BM":o.push([d,h(f)]);break;case"SMask":if((0,n.isName)(f,"None")){o.push([d,!1]);break}(0,n.isDict)(f)?(c=c.then((()=>this.handleSMask(f,e,r,a,s))),o.push([d,!0])):(0,i.warn)("Unsupported SMask type");break;case"OP":case"op":case"OPM":case"BG":case"BG2":case"UCR":case"UCR2":case"TR":case"TR2":case"HT":case"SM":case"SA":case"AIS":case"TK":(0,i.info)("graphic state operator "+d);break;default:(0,i.info)("Unknown graphic state operator "+d)}}return c.then((function(){o.length>0&&r.addOp(i.OPS.setGState,[o])}))},loadFont:function(e,r,a){const o=()=>Promise.resolve(new _({loadedName:"g_font_error",font:new s.ErrorFont(`Font "${e}" is not available.`),dict:r,extraProperties:this.options.fontExtraProperties}));var l,c=this.xref;if(r){if(!(0,n.isRef)(r))throw new i.FormatError('The "font" object should be a reference.');l=r}else{var u=a.get("Font");u&&(l=u.getRaw(e))}if(!l){const a=`Font "${e||r&&r.toString()}" is not available`;if(!this.options.ignoreErrors&&!this.parsingType3Font)return(0,i.warn)(`${a}.`),o();this.handler.send("UnsupportedFeature",{featureId:i.UNSUPPORTED_FEATURES.errorFontMissing}),(0,i.warn)(`${a} -- attempting to fallback to a default font.`),l=t.getFallbackFontDict()}if(this.fontCache.has(l))return this.fontCache.get(l);if(r=c.fetchIfRef(l),!(0,n.isDict)(r))return o();if(r.translated)return r.translated;var d=(0,i.createPromiseCapability)(),h=this.preEvaluateFont(r);const{descriptor:f,hash:p}=h;var g,m,b=(0,n.isRef)(l);if(b&&(g=l.toString()),p&&(0,n.isDict)(f)){f.fontAliases||(f.fontAliases=Object.create(null));var v=f.fontAliases;if(v[p]){var y=v[p].aliasRef;if(b&&y&&this.fontCache.has(y))return this.fontCache.putAlias(l,y),this.fontCache.get(l)}else v[p]={fontID:s.Font.getFontID()};b&&(v[p].aliasRef=l),g=v[p].fontID}b?this.fontCache.put(l,d.promise):(g||(g=this.idFactory.createObjId()),this.fontCache.put(`id_${g}`,d.promise)),(0,i.assert)(g,'The "fontID" must be defined.'),r.loadedName=`${this.idFactory.getDocId()}_f${g}`,r.translated=d.promise;try{m=this.translateFont(h)}catch(e){m=Promise.reject(e)}return m.then((e=>{void 0!==e.fontType&&(c.stats.fontTypes[e.fontType]=!0),d.resolve(new _({loadedName:r.loadedName,font:e,dict:r,extraProperties:this.options.fontExtraProperties}))})).catch((e=>{this.handler.send("UnsupportedFeature",{featureId:i.UNSUPPORTED_FEATURES.errorFontTranslate});try{var t=f&&f.get("FontFile3"),a=t&&t.get("Subtype"),n=(0,s.getFontType)(h.type,a&&a.name);c.stats.fontTypes[n]=!0}catch(e){}d.resolve(new _({loadedName:r.loadedName,font:new s.ErrorFont(e instanceof Error?e.message:e),dict:r,extraProperties:this.options.fontExtraProperties}))})),d.promise},buildPath(e,t,r,a=!1){var n=e.length-1;if(r||(r=[]),n<0||e.fnArray[n]!==i.OPS.constructPath)a&&((0,i.warn)(`Encountered path operator "${t}" inside of a text object.`),e.addOp(i.OPS.save,null)),e.addOp(i.OPS.constructPath,[[t],r]),a&&e.addOp(i.OPS.restore,null);else{var s=e.argsArray[n];s[0].push(t),Array.prototype.push.apply(s[1],r)}},parseColorSpace({cs:e,resources:t}){return new Promise((r=>{r(p.ColorSpace.parse(e,this.xref,t,this.pdfFunctionFactory))})).catch((e=>{if(e instanceof i.AbortException)return null;if(this.options.ignoreErrors)return this.handler.send("UnsupportedFeature",{featureId:i.UNSUPPORTED_FEATURES.errorColorSpace}),(0,i.warn)(`parseColorSpace - ignoring ColorSpace: "${e}".`),null;throw e}))},async handleColorN(e,t,r,a,s,o,l){var c,u=r[r.length-1];if((0,n.isName)(u)&&(c=s.get(u.name))){var h=(0,n.isStream)(c)?c.dict:c,f=h.get("PatternType");if(1===f){var p=a.base?a.base.getRgb(r,0):null;return this.handleTilingType(t,p,o,c,h,e,l)}if(2===f){var g=h.get("Shading"),m=h.getArray("Matrix");return c=d.Pattern.parseShading(g,m,this.xref,o,this.handler,this.pdfFunctionFactory),void e.addOp(t,c.getIR())}throw new i.FormatError(`Unknown PatternType: ${f}`)}throw new i.FormatError(`Unknown PatternName: ${u}`)},getOperatorList({stream:e,task:t,resources:a,operatorList:s,initialState:o=null}){if(a=a||n.Dict.empty,o=o||new P,!s)throw new Error('getOperatorList: missing "operatorList" parameter');var l=this,c=this.xref;let u=!1;const h=new y.LocalImageCache;var f=a.get("XObject")||n.Dict.empty,g=a.get("Pattern")||n.Dict.empty,m=new S(o),b=new I(e,c,m),v=new r;function w(e){for(var t=0,r=b.savedStatesDepth;t{if(!(e instanceof i.AbortException)){if(this.options.ignoreErrors)return this.handler.send("UnsupportedFeature",{featureId:i.UNSUPPORTED_FEATURES.errorOperatorList}),(0,i.warn)(`getOperatorList - ignoring errors during "${t.name}" task: "${e}".`),void w();throw e}}))},getTextContent({stream:e,task:t,resources:a,stateManager:s=null,normalizeWhitespace:o=!1,combineTextItems:l=!1,sink:u,seenStyles:d=Object.create(null)}){a=a||n.Dict.empty,s=s||new S(new C);var h=/\s/g,p={items:[],styles:Object.create(null)},g={initialized:!1,str:[],width:0,height:0,vertical:!1,lastAdvanceWidth:0,lastAdvanceHeight:0,textAdvanceScale:0,spaceWidth:0,fakeSpaceMin:1/0,fakeMultiSpaceMin:1/0,fakeMultiSpaceMax:-0,textRunBreakAllowed:!1,transform:null,fontName:null},m=this,b=this.xref,v=null;const w=new y.LocalImageCache;var x,k=new I(e,b,s);function _(){if(g.initialized)return g;var e=x.font;e.loadedName in d||(d[e.loadedName]=!0,p.styles[e.loadedName]={fontFamily:e.fallbackName,ascent:e.ascent,descent:e.descent,vertical:e.vertical}),g.fontName=e.loadedName;var t=[x.fontSize*x.textHScale,0,0,x.fontSize,0,x.textRise];if(e.isType3Font&&x.fontSize<=1&&!(0,i.isArrayEqual)(x.fontMatrix,i.FONT_IDENTITY_MATRIX)){const r=e.bbox[3]-e.bbox[1];r>0&&(t[3]*=r*x.fontMatrix[3])}var r=i.Util.transform(x.ctm,i.Util.transform(x.textMatrix,t));g.transform=r,e.vertical?(g.width=Math.sqrt(r[0]*r[0]+r[1]*r[1]),g.height=0,g.vertical=!0):(g.width=0,g.height=Math.sqrt(r[2]*r[2]+r[3]*r[3]),g.vertical=!1);var a=x.textLineMatrix[0],n=x.textLineMatrix[1],s=Math.sqrt(a*a+n*n);a=x.ctm[0],n=x.ctm[1];var o=Math.sqrt(a*a+n*n);g.textAdvanceScale=o*s,g.lastAdvanceWidth=0,g.lastAdvanceHeight=0;var l=e.spaceWidth/1e3*x.fontSize;return l?(g.spaceWidth=l,g.fakeSpaceMin=.3*l,g.fakeMultiSpaceMin=1.5*l,g.fakeMultiSpaceMax=4*l,g.textRunBreakAllowed=!e.isMonospace):(g.spaceWidth=0,g.fakeSpaceMin=1/0,g.fakeMultiSpaceMin=1/0,g.fakeMultiSpaceMax=0,g.textRunBreakAllowed=!1),g.initialized=!0,g}function P(e){for(var t,r=0,i=e.length;r=32&&t<=127;)r++;return r0&&E(f,r.str)}var p=0,g=0;t.vertical?a+=g=l*x.fontMatrix[0]*x.fontSize+h:i+=p=(l*x.fontMatrix[0]*x.fontSize+h)*x.textHScale,x.translateTextMatrix(p,g),r.str.push(u)}return t.vertical?(r.lastAdvanceHeight=a,r.height+=Math.abs(a)):(r.lastAdvanceWidth=i,r.width+=i),r}function E(e,t){if(!(e0;)t.push(" ")}function F(){var e,t,r;g.initialized&&(g.vertical?g.height*=g.textAdvanceScale:g.width*=g.textAdvanceScale,p.items.push((t=(e=g).str.join(""),r=(0,f.bidi)(t,-1,e.vertical),{str:o?P(r.str):r.str,dir:r.dir,width:e.width,height:e.height,transform:e.transform,fontName:e.fontName})),g.initialized=!1,g.str.length=0)}function L(){const e=p.items.length;e>0&&(u.enqueue(p,e),p.items=[],p.styles=Object.create(null))}var R=new r;return new Promise((function e(r,c){const h=function(t){L(),Promise.all([t,u.ready]).then((function(){try{e(r,c)}catch(e){c(e)}}),c)};t.ensureNotTerminated(),R.reset();for(var f,y={},C=[];!(f=R.check())&&(C.length=0,y.args=C,k.read(y));){x=s.state;var P,I=y.fn;switch(C=y.args,0|I){case i.OPS.setFont:var M=C[0].name,D=C[1];if(x.font&&M===x.fontName&&D===x.fontSize)break;return F(),x.fontName=M,x.fontSize=D,void h(T(M,null));case i.OPS.setTextRise:F(),x.textRise=C[0];break;case i.OPS.setHScale:F(),x.textHScale=C[0]/100;break;case i.OPS.setLeading:F(),x.leading=C[0];break;case i.OPS.moveText:var N=!!x.font&&0===(x.font.vertical?C[0]:C[1]);if(P=C[0]-C[1],l&&N&&g.initialized&&P>0&&P<=g.fakeMultiSpaceMax){x.translateTextLineMatrix(C[0],C[1]),g.width+=C[0]-g.lastAdvanceWidth,g.height+=C[1]-g.lastAdvanceHeight,E(C[0]-g.lastAdvanceWidth-(C[1]-g.lastAdvanceHeight),g.str);break}F(),x.translateTextLineMatrix(C[0],C[1]),x.textMatrix=x.textLineMatrix.slice();break;case i.OPS.setLeadingMoveText:F(),x.leading=-C[1],x.translateTextLineMatrix(C[0],C[1]),x.textMatrix=x.textLineMatrix.slice();break;case i.OPS.nextLine:F(),x.carriageReturn();break;case i.OPS.setTextMatrix:if(P=x.calcTextLineMatrixAdvance(C[0],C[1],C[2],C[3],C[4],C[5]),l&&null!==P&&g.initialized&&P.value>0&&P.value<=g.fakeMultiSpaceMax){x.translateTextLineMatrix(P.width,P.height),g.width+=P.width-g.lastAdvanceWidth,g.height+=P.height-g.lastAdvanceHeight,E(P.width-g.lastAdvanceWidth-(P.height-g.lastAdvanceHeight),g.str);break}F(),x.setTextMatrix(C[0],C[1],C[2],C[3],C[4],C[5]),x.setTextLineMatrix(C[0],C[1],C[2],C[3],C[4],C[5]);break;case i.OPS.setCharSpacing:x.charSpacing=C[0];break;case i.OPS.setWordSpacing:x.wordSpacing=C[0];break;case i.OPS.beginText:F(),x.textMatrix=i.IDENTITY_MATRIX.slice(),x.textLineMatrix=i.IDENTITY_MATRIX.slice();break;case i.OPS.showSpacedText:if(!s.state.font){m.ensureStateFont(s.state);continue}for(var B,U=C[0],j=0,q=U.length;jg.fakeMultiSpaceMax)||(g.height+=B)):(B=(P=-P)*x.textHScale,x.translateTextMatrix(B,0),(z=g.textRunBreakAllowed&&P>g.fakeMultiSpaceMax)||(g.width+=B)),z?F():P>0&&E(P,g.str)}break;case i.OPS.showText:if(!s.state.font){m.ensureStateFont(s.state);continue}O(C[0]);break;case i.OPS.nextLineShowText:if(!s.state.font){m.ensureStateFont(s.state);continue}F(),x.carriageReturn(),O(C[0]);break;case i.OPS.nextLineSetSpacingShowText:if(!s.state.font){m.ensureStateFont(s.state);continue}F(),x.wordSpacing=C[0],x.charSpacing=C[1],x.carriageReturn(),O(C[2]);break;case i.OPS.paintXObject:F(),v||(v=a.get("XObject")||n.Dict.empty);var $=C[0].name;if($&&w.getByName($))break;return void h(new Promise((function(e,r){if(!$)throw new i.FormatError("XObject must be referred to by name.");let c=v.getRaw($);if(c instanceof n.Ref){if(w.getByRef(c))return void e();c=b.fetch(c)}if(!c)return void e();if(!(0,n.isStream)(c))throw new i.FormatError("XObject should be a stream");const h=c.dict.get("Subtype");if(!(0,n.isName)(h))throw new i.FormatError("XObject should have a Name subtype");if("Form"!==h.name)return w.set($,c.dict.objId,!0),void e();const f=s.state.clone(),p=new S(f),g=c.dict.getArray("Matrix");Array.isArray(g)&&6===g.length&&p.transform(g),L();const y={enqueueInvoked:!1,enqueue(e,t){this.enqueueInvoked=!0,u.enqueue(e,t)},get desiredSize(){return u.desiredSize},get ready(){return u.ready}};m.getTextContent({stream:c,task:t,resources:c.dict.get("Resources")||a,stateManager:p,normalizeWhitespace:o,combineTextItems:l,sink:y,seenStyles:d}).then((function(){y.enqueueInvoked||w.set($,c.dict.objId,!0),e()}),r)})).catch((function(e){if(!(e instanceof i.AbortException)){if(!m.options.ignoreErrors)throw e;(0,i.warn)(`getTextContent - ignoring XObject: "${e}".`)}})));case i.OPS.setGState:F();var H=C[0],G=a.get("ExtGState");if(!(0,n.isDict)(G)||!(0,n.isName)(H))break;var V=G.get(H.name);if(!(0,n.isDict)(V))break;var W=V.get("Font");if(W)return x.fontName=null,x.fontSize=W[1],void h(T(null,W[0]))}if(p.items.length>=u.desiredSize){f=!0;break}}f?h(A):(F(),L(),r())})).catch((e=>{if(!(e instanceof i.AbortException)){if(this.options.ignoreErrors)return(0,i.warn)(`getTextContent - ignoring errors during "${t.name}" task: "${e}".`),F(),void L();throw e}}))},extractDataStructures:function(e,t,r){const a=this.xref;let l;var c=e.get("ToUnicode")||t.get("ToUnicode"),u=c?this.readToUnicode(c):Promise.resolve(void 0);if(r.composite){var d=e.get("CIDSystemInfo");(0,n.isDict)(d)&&(r.cidSystemInfo={registry:(0,i.stringToPDFString)(d.get("Registry")),ordering:(0,i.stringToPDFString)(d.get("Ordering")),supplement:d.get("Supplement")});var h=e.get("CIDToGIDMap");(0,n.isStream)(h)&&(l=h.getBytes())}var f,p=[],g=null;if(e.has("Encoding")){if(f=e.get("Encoding"),(0,n.isDict)(f)){if(g=f.get("BaseEncoding"),g=(0,n.isName)(g)?g.name:null,f.has("Differences"))for(var m=f.get("Differences"),b=0,v=0,y=m.length;v0,r.dict=e,u.then((e=>(r.toUnicode=e,this.buildToUnicode(r)))).then((e=>(r.toUnicode=e,l&&(r.cidToGidMap=this.readCidToGidMap(l,e)),r)))},_buildSimpleFontToUnicode(e,t=!1){(0,i.assert)(!e.composite,"Must be a simple font.");const r=[],a=e.defaultEncoding.slice(),n=e.baseEncodingName,l=e.differences;for(const e in l){const t=l[e];".notdef"!==t&&(a[e]=t)}const u=(0,m.getGlyphsUnicode)();for(const i in a){let s=a[i];if(""!==s)if(void 0!==u[s])r[i]=String.fromCharCode(u[s]);else{let a=0;switch(s[0]){case"G":3===s.length&&(a=parseInt(s.substring(1),16));break;case"g":5===s.length&&(a=parseInt(s.substring(1),16));break;case"C":case"c":if(s.length>=3&&s.length<=4){const r=s.substring(1);if(t){a=parseInt(r,16);break}if(a=+r,Number.isNaN(a)&&Number.isInteger(parseInt(r,16)))return this._buildSimpleFontToUnicode(e,!0)}break;default:const r=(0,c.getUnicodeForGlyph)(s,u);-1!==r&&(a=r)}if(a>0&&a<=1114111&&Number.isInteger(a)){if(n&&a===+i){const e=(0,o.getEncoding)(n);if(e&&(s=e[i])){r[i]=String.fromCharCode(u[s]);continue}}r[i]=String.fromCodePoint(a)}}}return new s.ToUnicodeMap(r)},buildToUnicode(e){if(e.hasIncludedToUnicodeMap=!!e.toUnicode&&e.toUnicode.length>0,e.hasIncludedToUnicodeMap)return!e.composite&&e.hasEncoding&&(e.fallbackToUnicode=this._buildSimpleFontToUnicode(e)),Promise.resolve(e.toUnicode);if(!e.composite)return Promise.resolve(this._buildSimpleFontToUnicode(e));if(e.composite&&(e.cMap.builtInCMap&&!(e.cMap instanceof a.IdentityCMap)||"Adobe"===e.cidSystemInfo.registry&&("GB1"===e.cidSystemInfo.ordering||"CNS1"===e.cidSystemInfo.ordering||"Japan1"===e.cidSystemInfo.ordering||"Korea1"===e.cidSystemInfo.ordering))){const t=e.cidSystemInfo.registry,r=e.cidSystemInfo.ordering,o=n.Name.get(t+"-"+r+"-UCS2");return a.CMapFactory.create({encoding:o,fetchBuiltInCMap:this.fetchBuiltInCMap,useCMap:null}).then((function(t){const r=e.cMap,a=[];return r.forEach((function(e,r){if(r>65535)throw new i.FormatError("Max size of CID is 65,535");const n=t.lookup(r);n&&(a[e]=String.fromCharCode((n.charCodeAt(0)<<8)+n.charCodeAt(1)))})),new s.ToUnicodeMap(a)}))}return Promise.resolve(new s.IdentityToUnicodeMap(e.firstChar,e.lastChar))},readToUnicode:function(e){var t=e;return(0,n.isName)(t)?a.CMapFactory.create({encoding:t,fetchBuiltInCMap:this.fetchBuiltInCMap,useCMap:null}).then((function(e){return e instanceof a.IdentityCMap?new s.IdentityToUnicodeMap(0,65535):new s.ToUnicodeMap(e.getMap())})):(0,n.isStream)(t)?a.CMapFactory.create({encoding:t,fetchBuiltInCMap:this.fetchBuiltInCMap,useCMap:null}).then((function(e){if(e instanceof a.IdentityCMap)return new s.IdentityToUnicodeMap(0,65535);var t=new Array(e.length);return e.forEach((function(e,r){for(var i=[],a=0;a{if(e instanceof i.AbortException)return null;if(this.options.ignoreErrors)return this.handler.send("UnsupportedFeature",{featureId:i.UNSUPPORTED_FEATURES.errorFontToUnicode}),(0,i.warn)(`readToUnicode - ignoring ToUnicode data: "${e}".`),null;throw e})):Promise.resolve(null)},readCidToGidMap(e,t){for(var r=[],i=0,a=e.length;i>1;(0!==n||t.has(a))&&(r[a]=n)}return r},extractWidths:function(e,t,r){var i,a,o,l,c,u,d,h,f=this.xref,p=[],g=0,m=[];if(r.composite){if(g=e.has("DW")?e.get("DW"):1e3,h=e.get("W"))for(a=0,o=h.length;a{if(e){const r=[];let i=f;for(let t=0,a=e.length;tthis.extractDataStructures(o,r,t))).then((e=>(this.extractWidths(o,c,e),"Type3"===d&&(e.isType3Font=!0),new s.Font(y.name,_,e))))}},t.buildFontPaths=function(e,t,r){function i(t){e.renderer.hasBuiltPath(t)||r.send("commonobj",[`${e.loadedName}_path_${t}`,"FontPath",e.renderer.getPathJs(t)])}for(const e of t){i(e.fontChar);const t=e.accent;t&&t.fontChar&&i(t.fontChar)}},t.getFallbackFontDict=function(){if(this._fallbackFontDict)return this._fallbackFontDict;const e=new n.Dict;return e.set("BaseFont",n.Name.get("PDFJS-FallbackFont")),e.set("Type",n.Name.get("FallbackType")),e.set("Subtype",n.Name.get("FallbackType")),e.set("Encoding",n.Name.get("WinAnsiEncoding")),this._fallbackFontDict=e},t}();t.PartialEvaluator=A;class _{constructor({loadedName:e,font:t,dict:r,extraProperties:i=!1}){this.loadedName=e,this.font=t,this.dict=r,this._extraProperties=i,this.type3Loaded=null,this.sent=!1}send(e){this.sent||(this.sent=!0,e.send("commonobj",[this.loadedName,"Font",this.font.exportData(this._extraProperties)]))}fallback(e){if(!this.font.data)return;this.font.disableFontFace=!0;const t=this.font.glyphCacheValues;A.buildFontPaths(this.font,t,e)}loadType3Data(e,t,r,a){if(!this.font.isType3Font)throw new Error("Must be a Type3 font.");if(this.type3Loaded)return this.type3Loaded;var n=Object.create(e.options);n.ignoreErrors=!1;var s=e.clone(n);s.parsingType3Font=!0;for(var o=this.font,l=Promise.resolve(),c=this.dict.get("CharProcs"),u=this.dict.get("Resources")||t,d=c.getKeys(),h=Object.create(null),f=0,p=d.length;fl&&(0,i.info)(`Command ${a}: expected [0, ${l}] args, but received ${c} args.`);else{if(c!==l){for(var u=this.nonProcessedArgs;c>l;)u.push(t.shift()),c--;for(;c=i.OPS.moveTo&&o<=i.OPS.endPath&&++this._numInvalidPathOPS>20)throw new i.FormatError(`Invalid ${e}`);(0,i.warn)(`Skipping ${e}`),null!==t&&(t.length=0);continue}}return this.preprocessCommand(o,t),e.fn=o,e.args=t,!0}if(r===n.EOF)return!1;if(null!==r&&(null===t&&(t=[]),t.push(r),t.length>33))throw new i.FormatError("Too many arguments")}},preprocessCommand:function(e,t){switch(0|e){case i.OPS.save:this.stateManager.save();break;case i.OPS.restore:this.stateManager.restore();break;case i.OPS.transform:this.stateManager.transform(t)}}},t}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CMapFactory=t.IdentityCMap=t.CMap=void 0;var i=r(2),a=r(5),n=r(11),s=r(8),o=r(12),l=["Adobe-GB1-UCS2","Adobe-CNS1-UCS2","Adobe-Japan1-UCS2","Adobe-Korea1-UCS2","78-EUC-H","78-EUC-V","78-H","78-RKSJ-H","78-RKSJ-V","78-V","78ms-RKSJ-H","78ms-RKSJ-V","83pv-RKSJ-H","90ms-RKSJ-H","90ms-RKSJ-V","90msp-RKSJ-H","90msp-RKSJ-V","90pv-RKSJ-H","90pv-RKSJ-V","Add-H","Add-RKSJ-H","Add-RKSJ-V","Add-V","Adobe-CNS1-0","Adobe-CNS1-1","Adobe-CNS1-2","Adobe-CNS1-3","Adobe-CNS1-4","Adobe-CNS1-5","Adobe-CNS1-6","Adobe-GB1-0","Adobe-GB1-1","Adobe-GB1-2","Adobe-GB1-3","Adobe-GB1-4","Adobe-GB1-5","Adobe-Japan1-0","Adobe-Japan1-1","Adobe-Japan1-2","Adobe-Japan1-3","Adobe-Japan1-4","Adobe-Japan1-5","Adobe-Japan1-6","Adobe-Korea1-0","Adobe-Korea1-1","Adobe-Korea1-2","B5-H","B5-V","B5pc-H","B5pc-V","CNS-EUC-H","CNS-EUC-V","CNS1-H","CNS1-V","CNS2-H","CNS2-V","ETHK-B5-H","ETHK-B5-V","ETen-B5-H","ETen-B5-V","ETenms-B5-H","ETenms-B5-V","EUC-H","EUC-V","Ext-H","Ext-RKSJ-H","Ext-RKSJ-V","Ext-V","GB-EUC-H","GB-EUC-V","GB-H","GB-V","GBK-EUC-H","GBK-EUC-V","GBK2K-H","GBK2K-V","GBKp-EUC-H","GBKp-EUC-V","GBT-EUC-H","GBT-EUC-V","GBT-H","GBT-V","GBTpc-EUC-H","GBTpc-EUC-V","GBpc-EUC-H","GBpc-EUC-V","H","HKdla-B5-H","HKdla-B5-V","HKdlb-B5-H","HKdlb-B5-V","HKgccs-B5-H","HKgccs-B5-V","HKm314-B5-H","HKm314-B5-V","HKm471-B5-H","HKm471-B5-V","HKscs-B5-H","HKscs-B5-V","Hankaku","Hiragana","KSC-EUC-H","KSC-EUC-V","KSC-H","KSC-Johab-H","KSC-Johab-V","KSC-V","KSCms-UHC-H","KSCms-UHC-HW-H","KSCms-UHC-HW-V","KSCms-UHC-V","KSCpc-EUC-H","KSCpc-EUC-V","Katakana","NWP-H","NWP-V","RKSJ-H","RKSJ-V","Roman","UniCNS-UCS2-H","UniCNS-UCS2-V","UniCNS-UTF16-H","UniCNS-UTF16-V","UniCNS-UTF32-H","UniCNS-UTF32-V","UniCNS-UTF8-H","UniCNS-UTF8-V","UniGB-UCS2-H","UniGB-UCS2-V","UniGB-UTF16-H","UniGB-UTF16-V","UniGB-UTF32-H","UniGB-UTF32-V","UniGB-UTF8-H","UniGB-UTF8-V","UniJIS-UCS2-H","UniJIS-UCS2-HW-H","UniJIS-UCS2-HW-V","UniJIS-UCS2-V","UniJIS-UTF16-H","UniJIS-UTF16-V","UniJIS-UTF32-H","UniJIS-UTF32-V","UniJIS-UTF8-H","UniJIS-UTF8-V","UniJIS2004-UTF16-H","UniJIS2004-UTF16-V","UniJIS2004-UTF32-H","UniJIS2004-UTF32-V","UniJIS2004-UTF8-H","UniJIS2004-UTF8-V","UniJISPro-UCS2-HW-V","UniJISPro-UCS2-V","UniJISPro-UTF8-V","UniJISX0213-UTF32-H","UniJISX0213-UTF32-V","UniJISX02132004-UTF32-H","UniJISX02132004-UTF32-V","UniKS-UCS2-H","UniKS-UCS2-V","UniKS-UTF16-H","UniKS-UTF16-V","UniKS-UTF32-H","UniKS-UTF32-V","UniKS-UTF8-H","UniKS-UTF8-V","V","WP-Symbol"];const c=2**24-1;class u{constructor(e=!1){this.codespaceRanges=[[],[],[],[]],this.numCodespaceRanges=0,this._map=[],this.name="",this.vertical=!1,this.useCMap=null,this.builtInCMap=e}addCodespaceRange(e,t,r){this.codespaceRanges[e-1].push(t,r),this.numCodespaceRanges++}mapCidRange(e,t,r){if(t-e>c)throw new Error("mapCidRange - ignoring data above MAX_MAP_RANGE.");for(;e<=t;)this._map[e++]=r++}mapBfRange(e,t,r){if(t-e>c)throw new Error("mapBfRange - ignoring data above MAX_MAP_RANGE.");for(var i=r.length-1;e<=t;)this._map[e++]=r,r=r.substring(0,i)+String.fromCharCode(r.charCodeAt(i)+1)}mapBfRangeToArray(e,t,r){if(t-e>c)throw new Error("mapBfRangeToArray - ignoring data above MAX_MAP_RANGE.");const i=r.length;let a=0;for(;e<=t&&a>>0;const s=a[n];for(let e=0,t=s.length;e=t&&i<=a)return r.charcode=i,void(r.length=n+1)}}r.charcode=0,r.length=1}get length(){return this._map.length}get isIdentityCMap(){if("Identity-H"!==this.name&&"Identity-V"!==this.name)return!1;if(65536!==this._map.length)return!1;for(let e=0;e<65536;e++)if(this._map[e]!==e)return!1;return!0}}t.CMap=u;class d extends u{constructor(e,t){super(),this.vertical=e,this.addCodespaceRange(t,0,65535)}mapCidRange(e,t,r){(0,i.unreachable)("should not call mapCidRange")}mapBfRange(e,t,r){(0,i.unreachable)("should not call mapBfRange")}mapBfRangeToArray(e,t,r){(0,i.unreachable)("should not call mapBfRangeToArray")}mapOne(e,t){(0,i.unreachable)("should not call mapCidOne")}lookup(e){return Number.isInteger(e)&&e<=65535?e:void 0}contains(e){return Number.isInteger(e)&&e<=65535}forEach(e){for(let t=0;t<=65535;t++)e(t,t)}charCodeOf(e){return Number.isInteger(e)&&e<=65535?e:-1}getMap(){const e=new Array(65536);for(let t=0;t<=65535;t++)e[t]=t;return e}get length(){return 65536}get isIdentityCMap(){(0,i.unreachable)("should not access .isIdentityCMap")}}t.IdentityCMap=d;var h=function(){function e(e,t){for(var r=0,i=0;i<=t;i++)r=r<<8|e[i];return r>>>0}function t(e,t){return 1===t?String.fromCharCode(e[0],e[1]):3===t?String.fromCharCode(e[0],e[1],e[2],e[3]):String.fromCharCode.apply(null,e.subarray(0,t+1))}function r(e,t,r){for(var i=0,a=r;a>=0;a--)i+=e[a]+t[a],e[a]=255&i,i>>=8}function a(e,t){for(var r=1,i=t;i>=0&&r>0;i--)r+=e[i],e[i]=255&r,r>>=8}var n=16;function s(e){this.buffer=e,this.pos=0,this.end=e.length,this.tmpBuf=new Uint8Array(19)}function o(){}return s.prototype={readByte(){return this.pos>=this.end?-1:this.buffer[this.pos++]},readNumber(){var e,t=0;do{var r=this.readByte();if(r<0)throw new i.FormatError("unexpected EOF in bcmap");e=!(128&r),t=t<<7|127&r}while(!e);return t},readSigned(){var e=this.readNumber();return 1&e?~(e>>>1):e>>>1},readHex(e,t){e.set(this.buffer.subarray(this.pos,this.pos+t+1)),this.pos+=t+1},readHexNumber(e,t){var r,a=this.tmpBuf,n=0;do{var s=this.readByte();if(s<0)throw new i.FormatError("unexpected EOF in bcmap");r=!(128&s),a[n++]=127&s}while(!r);for(var o=t,l=0,c=0;o>=0;){for(;c<8&&a.length>0;)l=a[--n]<>=8,c-=8}},readHexSigned(e,t){this.readHexNumber(e,t);for(var r=1&e[t]?255:0,i=0,a=0;a<=t;a++)i=(1&i)<<8|e[a],e[a]=i>>1^r},readString(){for(var e=this.readNumber(),t="",r=0;r=0;){var x=p>>5;if(7!==x){var k=!!(16&p),A=15&p;if(A+1>n)throw new Error("processBinaryCMap: Invalid dataSize.");var _,S=d.readNumber();switch(x){case 0:for(d.readHex(m,A),d.readHexNumber(b,A),r(b,m,A),o.addCodespaceRange(A+1,e(m,A),e(b,A)),_=1;_>>0}function t(e){if(!(0,i.isString)(e))throw new i.FormatError("Malformed CMap: expected string.")}function r(e){if(!Number.isInteger(e))throw new i.FormatError("Malformed CMap: expected int.")}function c(r,i){for(;;){var n=i.getObj();if((0,a.isEOF)(n))break;if((0,a.isCmd)(n,"endbfchar"))return;t(n);var s=e(n);t(n=i.getObj());var o=n;r.mapOne(s,o)}}function f(r,n){for(;;){var s=n.getObj();if((0,a.isEOF)(s))break;if((0,a.isCmd)(s,"endbfrange"))return;t(s);var o=e(s);t(s=n.getObj());var l=e(s);if(s=n.getObj(),Number.isInteger(s)||(0,i.isString)(s)){var c=Number.isInteger(s)?String.fromCharCode(s):s;r.mapBfRange(o,l,c)}else{if(!(0,a.isCmd)(s,"["))break;s=n.getObj();for(var u=[];!(0,a.isCmd)(s,"]")&&!(0,a.isEOF)(s);)u.push(s),s=n.getObj();r.mapBfRangeToArray(o,l,u)}}throw new i.FormatError("Invalid bf range.")}function p(i,n){for(;;){var s=n.getObj();if((0,a.isEOF)(s))break;if((0,a.isCmd)(s,"endcidchar"))return;t(s);var o=e(s);r(s=n.getObj());var l=s;i.mapOne(o,l)}}function g(i,n){for(;;){var s=n.getObj();if((0,a.isEOF)(s))break;if((0,a.isCmd)(s,"endcidrange"))return;t(s);var o=e(s);t(s=n.getObj());var l=e(s);r(s=n.getObj());var c=s;i.mapCidRange(o,l,c)}}function m(t,r){for(;;){var n=r.getObj();if((0,a.isEOF)(n))break;if((0,a.isCmd)(n,"endcodespacerange"))return;if(!(0,i.isString)(n))break;var s=e(n);if(n=r.getObj(),!(0,i.isString)(n))break;var o=e(n);t.addCodespaceRange(n.length,s,o)}throw new i.FormatError("Invalid codespace range.")}function b(e,t){var r=t.getObj();Number.isInteger(r)&&(e.vertical=!!r)}function v(e,t){var r=t.getObj();(0,a.isName)(r)&&(0,i.isString)(r.name)&&(e.name=r.name)}function y(e,t,r,n){var o,l;e:for(;;)try{var u=t.getObj();if((0,a.isEOF)(u))break;if((0,a.isName)(u))"WMode"===u.name?b(e,t):"CMapName"===u.name&&v(e,t),o=u;else if((0,a.isCmd)(u))switch(u.cmd){case"endcmap":break e;case"usecmap":(0,a.isName)(o)&&(l=o.name);break;case"begincodespacerange":m(e,t);break;case"beginbfchar":c(e,t);break;case"begincidchar":p(e,t);break;case"beginbfrange":f(e,t);break;case"begincidrange":g(e,t)}}catch(e){if(e instanceof s.MissingDataException)throw e;(0,i.warn)("Invalid cMap data: "+e);continue}return!n&&l&&(n=l),n?w(e,r,n):Promise.resolve(e)}function w(e,t,r){return x(r,t).then((function(t){if(e.useCMap=t,0===e.numCodespaceRanges){for(var r=e.useCMap.codespaceRanges,i=0;i=this.firstChar&&e<=this.lastChar?e:-1},amend(e){(0,i.unreachable)("Should not call amend()")}},e}();t.IdentityToUnicodeMap=C;var P=function(){function e(e,t,r){e[t]=r>>8&255,e[t+1]=255&r}function t(e,t,r){e[t]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r}function r(e,t,r){var i,a;if(r instanceof Uint8Array)e.set(r,t);else if("string"==typeof r)for(i=0,a=r.length;ir;)r<<=1,i++;var a=r*t;return{range:a,entry:i,rangeShift:t*e-a}},a.prototype={toArray:function(){var n=this.sfnt,s=this.tables,o=Object.keys(s);o.sort();var l,u,d,h,f,p=o.length,g=12+16*p,m=[g];for(l=0;l>>0,m.push(g);var b=new Uint8Array(g);for(l=0;l>>0;t(b,g+4,y),t(b,g+8,m[l]),t(b,g+12,s[f].length),g+=16}return b},addTable:function(e,t){if(e in this.tables)throw new Error("Table "+e+" already exists");this.tables[e]=t}},a}(),I=function(){function e(e,t,r){var a;this.name=e,this.loadedName=r.loadedName,this.isType3Font=r.isType3Font,this.missingFile=!1,this.glyphCache=Object.create(null),this.isSerifFont=!!(r.flags&y.Serif),this.isSymbolicFont=!!(r.flags&y.Symbolic),this.isMonospace=!!(r.flags&y.FixedPitch);var n=r.type,s=r.subtype;this.type=n,this.subtype=s;let o="sans-serif";if(this.isMonospace?o="monospace":this.isSerifFont&&(o="serif"),this.fallbackName=o,this.differences=r.differences,this.widths=r.widths,this.defaultWidth=r.defaultWidth,this.composite=r.composite,this.cMap=r.cMap,this.ascent=r.ascent/g,this.descent=r.descent/g,this.fontMatrix=r.fontMatrix,this.bbox=r.bbox,this.defaultEncoding=r.defaultEncoding,this.toUnicode=r.toUnicode,this.fallbackToUnicode=r.fallbackToUnicode||new S,this.toFontChar=[],"Type3"!==r.type){if(this.cidEncoding=r.cidEncoding,this.vertical=!!r.vertical,this.vertical&&(this.vmetrics=r.vmetrics,this.defaultVMetrics=r.defaultVMetrics),!t||t.isEmpty)return t&&(0,i.warn)('Font file is empty in "'+e+'" ('+this.loadedName+")"),void this.fallbackToSystemFont();[n,s]=function(e,{type:t,subtype:r,composite:a}){let n,s;return function(e){var t=e.peekBytes(4);return 65536===(0,c.readUint32)(t,0)||"true"===(0,i.bytesToString)(t)}(e)||O(e)?n=a?"CIDFontType2":"TrueType":function(e){var t=e.peekBytes(4);return"OTTO"===(0,i.bytesToString)(t)}(e)?n=a?"CIDFontType2":"OpenType":function(e){var t=e.peekBytes(2);return 37===t[0]&&33===t[1]||128===t[0]&&1===t[1]}(e)?n=a?"CIDFontType0":"MMType1"===t?"MMType1":"Type1":function(e){const t=e.peekBytes(4);return t[0]>=1&&t[3]>=1&&t[3]<=4}(e)?a?(n="CIDFontType0",s="CIDFontType0C"):(n="MMType1"===t?"MMType1":"Type1",s="Type1C"):((0,i.warn)("getFontFileType: Unable to detect correct font file Type/Subtype."),n=t,s=r),[n,s]}(t,r),n===this.type&&s===this.subtype||(0,i.info)(`Inconsistent font file Type/SubType, expected: ${this.type}/${this.subtype} but found: ${n}/${s}.`);try{var l;switch(n){case"MMType1":(0,i.info)("MMType1 font ("+e+"), falling back to Type1.");case"Type1":case"CIDFontType0":this.mimetype="font/opentype";var u="Type1C"===s||"CIDFontType0C"===s?new F(t,r):new E(e,t,r);x(r),l=this.convert(e,u,r);break;case"OpenType":case"TrueType":case"CIDFontType2":this.mimetype="font/opentype",l=this.checkAndRepair(e,t,r),this.isOpenType&&(x(r),n="OpenType");break;default:throw new i.FormatError(`Font ${n} is not supported`)}}catch(e){return(0,i.warn)(e),void this.fallbackToSystemFont()}this.data=l,this.fontType=k(n,s),this.fontMatrix=r.fontMatrix,this.widths=r.widths,this.defaultWidth=r.defaultWidth,this.toUnicode=r.toUnicode,this.seacMap=r.seacMap}else{for(a=0;a<256;a++)this.toFontChar[a]=this.differences[a]||r.defaultEncoding[a];this.fontType=i.FontType.TYPE3}}var t;function r(e,t){return(e<<8)+t}function f(e,t){var r=(e<<8)+t;return 32768&r?r-65536:r}function I(e){return String.fromCharCode(e>>8&255,255&e)}function T(e){return e>32767?e=32767:e<-32768&&(e=-32768),String.fromCharCode(e>>8&255,255&e)}function O(e){const t=e.peekBytes(4);return"ttcf"===(0,i.bytesToString)(t)}function L(e,t,r){for(var i,a=[],n=0,s=e.length;nl){if(++s>=p.length){(0,i.warn)("Ran out of space in font private use area.");break}o=p[s][0],l=p[s][1]}var d=o++;0===u&&(u=r),a[d]=u,n[c]=d}}return{toFontChar:n,charCodeToGlyphId:a,nextAvailableFontCharCode:o}}function M(e,t){var r,a,n,s,o=function(e,t){var r=[];for(var i in e)e[i]>=t||r.push({fontCharCode:0|i,glyphId:e[i]});0===r.length&&r.push({fontCharCode:0,glyphId:0}),r.sort((function(e,t){return e.fontCharCode-t.fontCharCode}));for(var a=[],n=r.length,s=0;s65535?2:1,c="\0\0"+I(l)+"\0\0"+(0,i.string32)(4+8*l);for(r=o.length-1;r>=0&&!(o[r][0]<=65535);--r);var u=r+1;o[r][0]<65535&&65535===o[r][1]&&(o[r][1]=65534);var d,h,f,p,g=o[r][1]<65535?1:0,m=u+g,b=P.getSearchParams(m,2),v="",y="",w="",x="",k="",A=0;for(r=0,a=u;r0&&(y+="ÿÿ",v+="ÿÿ",w+="\0",x+="\0\0");var C="\0\0"+I(2*m)+I(b.range)+I(b.entry)+I(b.rangeShift)+y+"\0\0"+v+w+x+k,T="",O="";if(l>1){for(c+="\0\0\n"+(0,i.string32)(4+8*l+4+C.length),T="",r=0,a=o.length;r(d|=0)||!c)&&(c=d),u 123 are reserved for internal usage");o|=1<65535&&(u=65535)}else c=0,u=255;var f=e.bbox||[0,0,0,0],p=r.unitsPerEm||1/(e.fontMatrix||i.FONT_IDENTITY_MATRIX)[0],m=e.ascentScaled?1:p/g,b=r.ascent||Math.round(m*(e.ascent||f[3])),v=r.descent||Math.round(m*(e.descent||f[1]));v>0&&e.descent>0&&f[1]<0&&(v=-v);var y=r.yMax||b,w=-r.yMin||-v;return"\0$ô\0\0\0Š»\0\0\0ŒŠ»\0\0ß\x001\0\0\0\0"+String.fromCharCode(e.fixedPitch?9:0)+"\0\0\0\0\0\0"+(0,i.string32)(a)+(0,i.string32)(n)+(0,i.string32)(s)+(0,i.string32)(o)+"*21*"+I(e.italicAngle?1:0)+I(c||e.firstChar)+I(u||e.lastChar)+I(b)+I(v)+"\0d"+I(y)+I(w)+"\0\0\0\0\0\0\0\0"+I(e.xHeight)+I(e.capHeight)+I(0)+I(c||e.firstChar)+"\0"}function N(e){var t=Math.floor(65536*e.italicAngle);return"\0\0\0"+(0,i.string32)(t)+"\0\0\0\0"+(0,i.string32)(e.fixedPitch)+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}function B(e,t){t||(t=[[],[]]);var r,i,a,n,s,o=[t[0][0]||"Original licence",t[0][1]||e,t[0][2]||"Unknown",t[0][3]||"uniqueID",t[0][4]||e,t[0][5]||"Version 0.11",t[0][6]||"",t[0][7]||"Unknown",t[0][8]||"Unknown",t[0][9]||"Unknown"],l=[];for(r=0,i=o.length;r0,d&&"CIDFontType2"===t&&this.cidEncoding.startsWith("Identity-")){const t=(0,o.getGlyphMapForStandardFonts)(),r=[];for(const e in t)r[+e]=t[e];if(/Arial-?Black/i.test(e)){var h=(0,o.getSupplementalGlyphMapForArialBlack)();for(const e in h)r[+e]=h[e]}else if(/Calibri/i.test(e)){const e=(0,o.getSupplementalGlyphMapForCalibri)();for(const t in e)r[+t]=e[t]}this.toUnicode instanceof C||this.toUnicode.forEach((function(e,t){r[+e]=t})),this.toFontChar=r,this.toUnicode=new S(r)}else if(/Symbol/i.test(a))this.toFontChar=L(s.SymbolSetEncoding,(0,n.getGlyphsUnicode)(),this.differences);else if(/Dingbats/i.test(a))/Wingdings/i.test(e)&&(0,i.warn)("Non-embedded Wingdings font, falling back to ZapfDingbats."),this.toFontChar=L(s.ZapfDingbatsEncoding,(0,n.getDingbatsGlyphsUnicode)(),this.differences);else if(d)this.toFontChar=L(this.defaultEncoding,(0,n.getGlyphsUnicode)(),this.differences);else{const t=(0,n.getGlyphsUnicode)(),r=[];if(this.toUnicode.forEach(((e,i)=>{if(!this.composite){var a=this.differences[e]||this.defaultEncoding[e];const r=(0,l.getUnicodeForGlyph)(a,t);-1!==r&&(i=r)}r[+e]=i})),this.composite&&this.toUnicode instanceof C&&/Verdana/i.test(e)){const e=(0,o.getGlyphMapForStandardFonts)();for(const t in e)r[+t]=e[t]}this.toFontChar=r}this.loadedName=a.split("-")[0],this.fontType=k(t,r)},checkAndRepair:function(e,t,o){const l=["OS/2","cmap","head","hhea","hmtx","maxp","name","post","loca","glyf","fpgm","prep","cvt ","CFF "];function c(e,t){const r=Object.create(null);r["OS/2"]=null,r.cmap=null,r.head=null,r.hhea=null,r.hmtx=null,r.maxp=null,r.name=null,r.post=null;for(let i=0;i>>0,a=e.getInt32()>>>0,n=e.getInt32()>>>0,s=e.pos;e.pos=e.start?e.start:0,e.skip(a);var o=e.getBytes(n);return e.pos=s,"head"===t&&(o[8]=o[9]=o[10]=o[11]=0,o[17]|=32),{tag:t,checksum:r,length:n,offset:a,data:o}}function p(e){return{version:(0,i.bytesToString)(e.getBytes(4)),numTables:e.getUint16(),searchRange:e.getUint16(),entrySelector:e.getUint16(),rangeShift:e.getUint16()}}function g(e,t,r,i,a,n){var s={length:0,sizeOfInstructions:0};if(r-t<=12)return s;var o,l,c,u=e.subarray(t,r),d=f(u[0],u[1]);if(d<0)return c=d=-1,(o=u)[1+(l=0)]=c,o[l]=c>>>8,i.set(u,a),s.length=u.length,s;var h,p=10,g=0;for(h=0;hu.length?s:!n&&b>0?(i.set(u.subarray(0,m),a),i.set([0,0],a+m),i.set(u.subarray(v,k),a+m+2),k-=b,u.length-k>3&&(k=k+3&-4),s.length=k,s):u.length-k>3?(k=k+3&-4,i.set(u.subarray(0,k),a),s.length=k,s):(i.set(u,a),s.length=u.length,s)}function b(e){var r=(t.start?t.start:0)+e.offset;t.pos=r;var a=[[],[]],n=e.length,s=r+n;if(0!==t.getUint16()||n<6)return a;var o,l,c=t.getUint16(),u=t.getUint16(),d=[];for(o=0;os)){t.pos=p;var g=f.name;if(f.encoding){for(var m="",b=0,v=f.length;b0&&(c+=k-1)}}else(m||y)&&((0,i.warn)("TT: nested FDEFs not allowed"),g=!0),m=!0,d=c,s=h.pop(),t.functionsDefined[s]={data:l,i:c};else if(!m&&!y)if(s=h[h.length-1],isNaN(s))(0,i.info)("TT: CALL empty stack (or invalid entry).");else if(t.functionsUsed[s]=!0,s in t.functionsStackDeltas){const e=h.length+t.functionsStackDeltas[s];if(e<0)return(0,i.warn)("TT: CALL invalid functions stack delta."),void(t.hintsValid=!1);h.length=e}else if(s in t.functionsDefined&&!p.includes(s)){if(f.push({data:l,i:c,stackTop:h.length-1}),p.push(s),!(o=t.functionsDefined[s]))return(0,i.warn)("TT: CALL non-existent function"),void(t.hintsValid=!1);l=o.data,c=o.i}if(!m&&!y){let e=0;for(x<=142?e=v[x]:x>=192&&x<=223?e=-1:x>=224&&(e=-2),x>=113&&x<=117&&(a=h.pop(),isNaN(a)||(e=2*-a));e<0&&h.length>0;)h.pop(),e++;for(;e>0;)h.push(NaN),e--}}t.tooComplexToFollowFunctions=g;var A=[l];c>l.length&&A.push(new Uint8Array(c-l.length)),d>u&&((0,i.warn)("TT: complementing a missing function tail"),A.push(new Uint8Array([34,45]))),function(e,t){if(t.length>1){var r,i,a=0;for(r=0,i=t.length;r>>0,s=[];for(let t=0;t>>0);const o={ttcTag:t,majorVersion:r,minorVersion:a,numFonts:n,offsetTable:s};switch(r){case 1:return o;case 2:return o.dsigTag=e.getInt32()>>>0,o.dsigLength=e.getInt32()>>>0,o.dsigOffset=e.getInt32()>>>0,o}throw new i.FormatError(`Invalid TrueType Collection majorVersion: ${r}.`)}(e);for(let n=0;n0||!(o.cMap instanceof d.IdentityCMap));if("OTTO"===k.version&&!t||!_.head||!_.hhea||!_.maxp||!_.post)return C=new h.Stream(_["CFF "].data),S=new F(C,o),x(o),this.convert(e,S,o);delete _.glyf,delete _.loca,delete _.fpgm,delete _.prep,delete _["cvt "],this.isOpenType=!0}if(!_.maxp)throw new i.FormatError('Required "maxp" table is not found');t.pos=(t.start||0)+_.maxp.offset;var T=t.getInt32();const E=t.getUint16();let L=E+1,U=!0;L>65535&&(U=!1,L=E,(0,i.warn)("Not enough space in glyfs to duplicate first glyph."));var j=0,q=0;T>=65536&&_.maxp.length>=22&&(t.pos+=8,t.getUint16()>2&&(_.maxp.data[14]=0,_.maxp.data[15]=2),t.pos+=4,j=t.getUint16(),t.pos+=4,q=t.getUint16()),_.maxp.data[4]=L>>8,_.maxp.data[5]=255&L;var z=function(e,t,r,a){var n={functionsDefined:[],functionsUsed:[],functionsStackDeltas:[],tooComplexToFollowFunctions:!1,hintsValid:!0};if(e&&y(e,n),t&&y(t,n),e&&function(e,t){if(!e.tooComplexToFollowFunctions){if(e.functionsDefined.length>t)return(0,i.warn)("TT: more functions defined than expected"),void(e.hintsValid=!1);for(var r=0,a=e.functionsUsed.length;rt)return(0,i.warn)("TT: invalid function id: "+r),void(e.hintsValid=!1);if(e.functionsUsed[r]&&!e.functionsDefined[r])return(0,i.warn)("TT: undefined function: "+r),void(e.hintsValid=!1)}}}(n,a),r&&1&r.length){var s=new Uint8Array(r.length+1);s.set(r.data),r.data=s}return n.hintsValid}(_.fpgm,_.prep,_["cvt "],j);if(z||(delete _.fpgm,delete _.prep,delete _["cvt "]),function(e,t,r,a,n){if(t){e.pos=(e.start?e.start:0)+t.offset,e.pos+=4,e.pos+=2,e.pos+=2,e.pos+=2,e.pos+=2,e.pos+=2,e.pos+=2,e.pos+=2,e.pos+=2,e.pos+=2,e.pos+=2,e.pos+=8,e.pos+=2;var s=e.getUint16();s>a&&((0,i.info)("The numOfMetrics ("+s+") should not be greater than the numGlyphs ("+a+")"),s=a,t.data[34]=(65280&s)>>8,t.data[35]=255&s);var o=a-s-(r.length-4*s>>1);if(o>0){var l=new Uint8Array(r.length+2*o);l.set(r.data),n&&(l[r.length]=r.data[2],l[r.length+1]=r.data[3]),r.data=l}}else r&&(r.data=null)}(t,_.hhea,_.hmtx,L,U),!_.head)throw new i.FormatError('Required "head" table is not found');!function(e,t,a){var n,s,o,l,c=e.data,u=(n=c[0],s=c[1],o=c[2],l=c[3],(n<<24)+(s<<16)+(o<<8)+l);u>>16!=1&&((0,i.info)("Attempting to fix invalid version in head table: "+u),c[0]=0,c[1]=1,c[2]=0,c[3]=0);var d=r(c[50],c[51]);if(d<0||d>1){(0,i.info)("Attempting to fix invalid indexToLocFormat in head table: "+d);var h=t+1;if(a===h<<1)c[50]=0,c[51]=0;else{if(a!==h<<2)throw new i.FormatError("Could not fix indexToLocFormat: "+d);c[50]=0,c[51]=1}}}(_.head,E,I?_.loca.length:0);var $=Object.create(null);if(I){var H=r(_.head.data[50],_.head.data[51]),G=function(e,t,r,i,a,n,s){var o,l,c;i?(o=4,l=function(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]},c=function(e,t,r){e[t]=r>>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r}):(o=2,l=function(e,t){return e[t]<<9|e[t+1]<<1},c=function(e,t,r){e[t]=r>>9&255,e[t+1]=r>>1&255});var u=n?r+1:r,d=o*(1+u),h=new Uint8Array(d);h.set(e.data.subarray(0,d)),e.data=h;var f,p,m=t.data,b=m.length,v=new Uint8Array(b),y=l(h,0),w=0,x=Object.create(null);for(c(h,0,w),f=0,p=o;fb&&(b+3&-4)===k&&(k=b),k>b&&(y=k);var A=g(m,y,k,v,w,a),_=A.length;0===_&&(x[f]=!0),A.sizeOfInstructions>s&&(s=A.sizeOfInstructions),c(h,p,w+=_),y=k}if(0===w){var S=new Uint8Array([0,1,0,0,0,0,0,0,0,0,0,0,0,0,49,0]);for(f=0,p=o;fC+w?t.data=v.subarray(0,C+w):(t.data=new Uint8Array(C+w),t.data.set(v.subarray(0,w))),t.data.set(v.subarray(0,C),w),c(e.data,h.length-o,w+C)}else t.data=v.subarray(0,w);return{missingGlyphs:x,maxSizeOfInstructions:s}}(_.loca,_.glyf,E,H,z,U,q);$=G.missingGlyphs,T>=65536&&_.maxp.length>=22&&(_.maxp.data[26]=G.maxSizeOfInstructions>>8,_.maxp.data[27]=255&G.maxSizeOfInstructions)}if(!_.hhea)throw new i.FormatError('Required "hhea" table is not found');0===_.hhea.data[10]&&0===_.hhea.data[11]&&(_.hhea.data[10]=255,_.hhea.data[11]=255);var V={unitsPerEm:r(_.head.data[18],_.head.data[19]),yMax:r(_.head.data[42],_.head.data[43]),yMin:f(_.head.data[38],_.head.data[39]),ascent:r(_.hhea.data[4],_.hhea.data[5]),descent:f(_.hhea.data[6],_.hhea.data[7])};this.ascent=V.ascent/V.unitsPerEm,this.descent=V.descent/V.unitsPerEm,_.post&&function(e,r,a){var n=(t.start?t.start:0)+e.offset;t.pos=n;var s,o=n+e.length,l=t.getInt32();t.skip(28);var c,u=!0;switch(l){case 65536:s=w;break;case 131072:var d=t.getUint16();if(d!==a){u=!1;break}var h=[];for(c=0;c=32768){u=!1;break}h.push(f)}if(!u)break;for(var p=[],g=[];t.pos65535)throw new i.FormatError("Max size of CID is 65,535");var r=-1;Y?r=t:void 0!==X[t]&&(r=X[t]),r>=0&&r>>0,p=!1;if((!o||o.platformId!==d||o.encodingId!==h)&&(0===d&&0===h||1===d&&0===h?p=!0:3!==d||1!==h||!a&&o?r&&3===d&&0===h&&(p=!0,c=!0):(p=!0,r||(c=!0)),p&&(o={platformId:d,encodingId:h,offset:f}),c))break}if(o&&(t.pos=s+o.offset),!o||-1===t.peekByte())return(0,i.warn)("Could not find a preferred cmap table."),{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1};var g=t.getUint16();t.skip(4);var m,b,v=!1,y=[];if(0===g){for(m=0;m<256;m++){var w=t.getByte();w&&y.push({charCode:m,glyphId:w})}v=!0}else if(4===g){var x=t.getUint16()>>1;t.skip(6);var k,A=[];for(k=0;k>1)-(x-k);n.offsetIndex=C,_=Math.max(_,C+n.end-n.start+1)}else n.offsetIndex=-1}var P=[];for(m=0;m<_;m++)P.push(t.getUint16());for(k=0;k0&&Z(le)&&(W[e]=le)}}}}else if(0===Q&&0===J)for(let e=0;e=61440&&t<=61695&&(t&=255),W[t]=ee[e].glyphId}}0===W.length&&(W[0]=0);let ce=L-1;U||(ce=0);var ue=R(W,Z,ce);if(this.toFontChar=ue.toFontChar,_.cmap={tag:"cmap",data:M(ue.charCodeToGlyphId,L)},_["OS/2"]&&function(e,t){t.pos=(t.start||0)+e.offset;var r=t.getUint16();t.skip(60);var i=t.getUint16();return!(r<4&&768&i||t.getUint16()>t.getUint16()||(t.skip(6),0===t.getUint16()||(e.data[8]=e.data[9]=0,0)))}(_["OS/2"],t)||(_["OS/2"]={tag:"OS/2",data:D(o,ue.charCodeToGlyphId,V)}),!I)try{C=new h.Stream(_["CFF "].data),S=new a.CFFParser(C,o,m).parse(),S.duplicateFirstGlyph();var de=new a.CFFCompiler(S);_["CFF "].data=de.compile()}catch(e){(0,i.warn)("Failed to compile font "+o.loadedName)}if(_.name){var he=b(_.name);_.name.data=B(e,he)}else _.name={tag:"name",data:B(this.name)};var fe=new P(k.version);for(var pe in _)fe.addTable(pe,_[pe].data);return fe.toArray()},convert:function(e,t,r){r.fixedPitch=!1,r.builtInEncoding&&function(e,t){if(!e.hasIncludedToUnicodeMap&&!(e.hasEncoding||t===e.defaultEncoding||e.toUnicode instanceof C)){var r=[],i=(0,n.getGlyphsUnicode)();for(var a in t){var s=t[a],o=(0,l.getUnicodeForGlyph)(s,i);-1!==o&&(r[a]=String.fromCharCode(o))}e.toUnicode.amend(r)}}(r,r.builtInEncoding);let a=1;t instanceof F&&(a=t.numGlyphs-1);var o=t.getGlyphMapping(r),c=R(o,t.hasGlyphId.bind(t),a);this.toFontChar=c.toFontChar;var u=t.numGlyphs;function d(e,t){var r=null;for(var i in e)t===e[i]&&(r||(r=[]),r.push(0|i));return r}function h(e,t){for(var r in e)if(t===e[r])return 0|r;return c.charCodeToGlyphId[c.nextAvailableFontCharCode]=t,c.nextAvailableFontCharCode++}var f=t.seacs;if(f&&f.length){var p=r.fontMatrix||i.FONT_IDENTITY_MATRIX,g=t.getCharset(),m=Object.create(null);for(var b in f){var v=f[b|=0],y=s.StandardEncoding[v[2]],w=s.StandardEncoding[v[3]],x=g.indexOf(y),k=g.indexOf(w);if(!(x<0||k<0)){var A={x:v[0]*p[0]+v[1]*p[2]+p[4],y:v[0]*p[1]+v[1]*p[3]+p[5]},_=d(o,b);if(_)for(let e=0,t=_.length;e=0?i:0;else if(c)for(a in t)l[a]=t[a];else for(o=s.StandardEncoding,a=0;a=0?i:0;var u,d=e.differences;if(d)for(a in d){var h=d[a];if(-1===(i=r.indexOf(h))){u||(u=(0,n.getGlyphsUnicode)());var f=A(h,u);f!==h&&(i=r.indexOf(f))}l[a]=i>=0?i:0}return l}t.ErrorFont=T;var E=function(){function e(e,t,r){for(var i,a=e.length,n=t.length,s=a-n,o=r,l=!1;o=n){for(o+=i;o=0&&(n[s]=r)}return O(e,n,i)},hasGlyphId:function(e){return!(e<0||e>=this.numGlyphs)&&(0===e||this.charstrings[e-1].charstring.length>0)},getSeacs:function(e){var t,r,i=[];for(t=0,r=e.length;t0;v--)b[v]-=b[v-1];p.setByName(m,b)}}s.topDict.privateDict=p;var y=new a.CFFIndex;for(c=0,u=i.length;c=t)throw new i.FormatError("Invalid CFF header");0!==r&&((0,i.info)("cff data is shifted"),e=e.subarray(r),this.bytes=e);var a=e[0],n=e[1],s=e[2],o=e[3];return{obj:new u(a,n,s,o),endPos:s}},parseDict:function(e){var t=0;function r(){var r=e[t++];return 30===r?function(){var r="",i=15;const a=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];for(var n=e.length;t>4,l=15&s;if(o===i)break;if(r+=a[o],l===i)break;r+=a[l]}return parseFloat(r)}():28===r?r=((r=e[t++])<<24|e[t++]<<16)>>16:29===r?r=(r=(r=(r=e[t++])<<8|e[t++])<<8|e[t++])<<8|e[t++]:r>=32&&r<=246?r-139:r>=247&&r<=250?256*(r-247)+e[t++]+108:r>=251&&r<=254?-256*(r-251)-e[t++]-108:((0,i.warn)('CFFParser_parseDict: "'+r+'" is a reserved command.'),NaN)}var a=[],n=[];t=0;for(var s=e.length;t10)return!1;for(var o=r.stackSize,l=r.stack,c=a.length,u=0;u>16,u+=2,o++;else if(14===d){if(o>=4&&(o-=4,this.seacAnalysisEnabled))return r.seac=l.slice(o,o+4),!1;h=e[d]}else if(d>=32&&d<=246)l[o]=d-139,o++;else if(d>=247&&d<=254)l[o]=d<251?(d-247<<8)+a[u]+108:-(d-251<<8)-a[u]-108,u++,o++;else if(255===d)l[o]=(a[u]<<24|a[u+1]<<16|a[u+2]<<8|a[u+3])/65536,u+=4,o++;else if(19===d||20===d)r.hints+=o>>1,u+=r.hints+7>>3,o%=2,h=e[d];else{if(10===d||29===d){var p;if(!(p=10===d?n:s))return h=e[d],(0,i.warn)("Missing subrsIndex for "+h.id),!1;var g=32768;p.count<1240?g=107:p.count<33900&&(g=1131);var m=l[--o]+g;if(m<0||m>=p.count||isNaN(m))return h=e[d],(0,i.warn)("Out of bounds subrIndex for "+h.id),!1;if(r.stackSize=o,r.callDepth++,!this.parseCharString(r,p.get(m),n,s))return!1;r.callDepth--,o=r.stackSize;continue}if(11===d)return r.stackSize=o,!0;h=e[d]}if(h){if(h.stem&&(r.hints+=o>>1,3===d||23===d?r.hasVStems=!0:!r.hasVStems||1!==d&&18!==d||((0,i.warn)("CFF stem hints are in wrong order"),a[u-1]=1===d?3:23)),"min"in h&&!r.undefStack&&o=2&&h.stem?o%=2:o>1&&(0,i.warn)("Found too many parameters for stack-clearing command"),o>0&&l[o-1]>=0&&(r.width=l[o-1])),"stackDelta"in h?("stackFn"in h&&h.stackFn(l,o),o+=h.stackDelta):h.stackClearing?o=0:h.resetStack?(o=0,r.undefStack=!1):h.undefStack&&(o=0,r.undefStack=!0,r.firstStackClearing=!1)}}return r.stackSize=o,!0},parseCharStrings({charStrings:e,localSubrIndex:t,globalSubrIndex:r,fdSelect:a,fdArray:n,privateDict:s}){for(var o=[],l=[],c=e.count,u=0;u=n.length&&((0,i.warn)("Invalid fd index for glyph index."),f=!1),f&&(p=(g=n[m].privateDict).subrsIndex)}else t&&(p=t);if(f&&(f=this.parseCharString(h,d,p,r)),null!==h.width){const e=g.getByName("nominalWidthX");l[u]=e+h.width}else{const e=g.getByName("defaultWidthX");l[u]=e}null!==h.seac&&(o[u]=h.seac),f||e.set(u,new Uint8Array([14]))}return{charStrings:e,seacs:o,widths:l}},emptyPrivateDictionary:function(e){var t=this.createDict(g,[],e.strings);e.setByKey(18,[0,0]),e.privateDict=t},parsePrivateDict:function(e){if(e.hasName("Private")){var t=e.getByName("Private");if(Array.isArray(t)&&2===t.length){var r=t[0],i=t[1];if(0===r||i>=this.bytes.length)this.emptyPrivateDictionary(e);else{var a=i+r,n=this.bytes.subarray(i,a),s=this.parseDict(n),o=this.createDict(g,s,e.strings);if(e.privateDict=o,o.getByName("Subrs")){var l=o.getByName("Subrs"),c=i+l;if(0===l||c>=this.bytes.length)this.emptyPrivateDictionary(e);else{var u=this.parseIndex(c);o.subrsIndex=u.obj}}}}else e.removeByName("Private")}else this.emptyPrivateDictionary(e)},parseCharsets:function(e,t,r,n){if(0===e)return new b(!0,m.ISO_ADOBE,a.ISOAdobeCharset);if(1===e)return new b(!0,m.EXPERT,a.ExpertCharset);if(2===e)return new b(!0,m.EXPERT_SUBSET,a.ExpertSubsetCharset);var s=this.bytes,o=e,l=s[e++];const c=[n?0:".notdef"];var u,d,h;switch(t-=1,l){case 0:for(h=0;h=65535)(0,i.warn)("Not enough space in charstrings to duplicate first glyph.");else{var e=this.charStrings.get(0);this.charStrings.add(e),this.isCIDFont&&this.fdSelect.fdSelect.push(this.fdSelect.fdSelect[0])}},hasGlyphId:function(e){return!(e<0||e>=this.charStrings.count)&&this.charStrings.get(e).length>0}},e}();t.CFF=c;var u=function(e,t,r,i){this.major=e,this.minor=t,this.hdrSize=r,this.offSize=i};t.CFFHeader=u;var d=function(){function e(){this.strings=[]}return e.prototype={get:function(e){return e>=0&&e<=390?s[e]:e-o<=this.strings.length?this.strings[e-o]:s[0]},getSID:function(e){let t=s.indexOf(e);return-1!==t?t:(t=this.strings.indexOf(e),-1!==t?t+o:-1)},add:function(e){this.strings.push(e)},get count(){return this.strings.length}},e}();t.CFFStrings=d;var h=function(){function e(){this.objects=[],this.length=0}return e.prototype={add:function(e){this.length+=e.length,this.objects.push(e)},set:function(e,t){this.length+=t.length-this.objects[e].length,this.objects[e]=t},get:function(e){return this.objects[e]},get count(){return this.objects.length}},e}();t.CFFIndex=h;var f=function(){function e(e,t){this.keyToNameMap=e.keyToNameMap,this.nameToKeyMap=e.nameToKeyMap,this.defaults=e.defaults,this.types=e.types,this.opcodes=e.opcodes,this.order=e.order,this.strings=t,this.values=Object.create(null)}return e.prototype={setByKey:function(e,t){if(!(e in this.keyToNameMap))return!1;var r=t.length;if(0===r)return!0;for(var a=0;a=this.fdSelect.length?-1:this.fdSelect[e]}},e}();t.CFFFDSelect=y;var w=function(){function e(){this.offsets=Object.create(null)}return e.prototype={isTracking:function(e){return e in this.offsets},track:function(e,t){if(e in this.offsets)throw new i.FormatError(`Already tracking location of ${e}`);this.offsets[e]=t},offset:function(e){for(var t in this.offsets)this.offsets[t]+=e},setEntryLocation:function(e,t,r){if(!(e in this.offsets))throw new i.FormatError(`Not tracking location of ${e}`);for(var a=r.data,n=this.offsets[e],s=0,o=t.length;s>24&255,a[u]=f>>16&255,a[d]=f>>8&255,a[h]=255&f}}},e}(),x=function(){function e(e){this.cff=e}return e.prototype={compile:function(){var e=this.cff,t={data:[],length:0,add:function(e){this.data=this.data.concat(e),this.length=this.data.length}},r=this.compileHeader(e.header);t.add(r);var a=this.compileNameIndex(e.names);if(t.add(a),e.isCIDFont&&e.topDict.hasName("FontMatrix")){var n=e.topDict.getByName("FontMatrix");e.topDict.removeByName("FontMatrix");for(var s=0,o=e.fdArray.length;s=-107&&e<=107?[e+139]:e>=108&&e<=1131?[247+((e-=108)>>8),255&e]:e>=-1131&&e<=-108?[251+((e=-e-108)>>8),255&e]:e>=-32768&&e<=32767?[28,e>>8&255,255&e]:[29,e>>24&255,e>>16&255,e>>8&255,255&e]},compileHeader:function(e){return[e.major,e.minor,e.hdrSize,e.offSize]},compileNameIndex:function(e){for(var t=new h,r=0,a=e.length;r"~"||"["===c||"]"===c||"("===c||")"===c||"{"===c||"}"===c||"<"===c||">"===c||"/"===c||"%"===c)&&(c="_"),o[l]=c}""===(o=o.join(""))&&(o="Bad_Font_Name"),t.add((0,i.stringToBytes)(o))}return this.compileIndex(t)},compileTopDicts:function(e,t,r){for(var i=[],a=new h,n=0,s=e.length;n>8&255,255&s]);else{n=new Uint8Array(1+2*s),n[0]=0;let t=0;const a=e.charset.length;let o=!1;for(let s=1;s>8&255,n[s+1]=255&l}}return this.compileTypedArray(n)},compileEncoding:function(e){return this.compileTypedArray(e.raw)},compileFDSelect:function(e){const t=e.format;let r,i;switch(t){case 0:for(r=new Uint8Array(1+e.fdSelect.length),r[0]=t,i=0;i>8&255,255&a,n];for(i=1;i>8&255,255&i,t),n=t)}const o=(s.length-3)/3;s[1]=o>>8&255,s[2]=255&o,s.push(i>>8&255,255&i),r=new Uint8Array(s)}return this.compileTypedArray(r)},compileTypedArray:function(e){for(var t=[],r=0,i=e.length;r>8&255,255&i],o=1;for(a=0;a>8&255,255&l):3===n?s.push(l>>16&255,l>>8&255,255&l):s.push(l>>>24&255,l>>16&255,l>>8&255,255&l),r[a]&&(l+=r[a].length);for(a=0;a=65520&&e<=65535?0:e>=62976&&e<=63743?a()[e]||e:173===e?45:e},t.reverseIfRtl=function(e){var t,r,i=e.length;if(i<=1||!((t=e.charCodeAt(0))>=(r=n[13]).begin&&t=(r=n[11]).begin&&t=0;s--)a+=e[s];return a},t.getUnicodeRangeFor=function(e){for(var t=0,r=n.length;t=i.begin&&e=5&&a<=7))return-1;i=e.substring(1)}if(i===i.toUpperCase()&&(r=parseInt(i,16))>=0)return r}return-1}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FontRendererFactory=void 0;var i=r(2),a=r(30),n=r(33),s=r(32),o=r(12),l=function(){function e(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function t(e,t){return e[t]<<8|e[t+1]}function r(e){const t=e.length;let r=32768;return t<1240?r=107:t<33900&&(r=1131),r}function l(r,a,n){var s,o,l,c=1===t(r,a+2)?e(r,a+8):e(r,a+16),u=t(r,a+c);if(4===u){t(r,a+c+2);var d=t(r,a+c+6)>>1;for(o=a+c+14,s=[],l=0;l>1;r>16,c=0,u=0;if(o+=10,l<0)do{s=e[o]<<8|e[o+1];var h,f,p=e[o+2]<<8|e[o+3];o+=4,1&s?(h=(e[o]<<24|e[o+1]<<16)>>16,f=(e[o+2]<<24|e[o+3]<<16)>>16,o+=4):(h=e[o++],f=e[o++]),2&s?(c=h,u=f):(c=0,u=0);var g=1,m=1,b=0,v=0;8&s?(g=m=(e[o]<<24|e[o+1]<<16)/1073741824,o+=2):64&s?(g=(e[o]<<24|e[o+1]<<16)/1073741824,m=(e[o+2]<<24|e[o+3]<<16)/1073741824,o+=4):128&s&&(g=(e[o]<<24|e[o+1]<<16)/1073741824,b=(e[o+2]<<24|e[o+3]<<16)/1073741824,v=(e[o+4]<<24|e[o+5]<<16)/1073741824,m=(e[o+6]<<24|e[o+7]<<16)/1073741824,o+=8);var y=r.glyphs[p];y&&(t.push({cmd:"save"}),t.push({cmd:"transform",args:[g,b,v,m,c,u]}),d(y,t,r),t.push({cmd:"restore"}))}while(32&s);else{var w,x,k=[];for(w=0;w0;)_.push({flags:s})}for(w=0;w>16,o+=2;break;case 2:c-=e[o++];break;case 18:c+=e[o++]}_[w].x=c}for(w=0;w>16,o+=2;break;case 4:u-=e[o++];break;case 36:u+=e[o++]}_[w].y=u}var C=0;for(o=0;o>1,C=!0;break;case 4:p+=d.pop(),o(f,p),C=!0;break;case 5:for(;d.length>0;)f+=d.shift(),p+=d.shift(),l(f,p);break;case 6:for(;d.length>0&&(l(f+=d.shift(),p),0!==d.length);)p+=d.shift(),l(f,p);break;case 7:for(;d.length>0&&(p+=d.shift(),l(f,p),0!==d.length);)l(f+=d.shift(),p);break;case 8:for(;d.length>0;)v=f+d.shift(),w=p+d.shift(),y=v+d.shift(),x=w+d.shift(),f=y+d.shift(),p=x+d.shift(),c(v,w,y,x,f,p);break;case 10:if(_=d.pop(),S=null,a.isCFFCIDFont){const e=a.fdSelect.getFDIndex(n);if(e>=0&&eMath.abs(p-T)?f+=d.shift():p+=d.shift(),c(v,w,y,x,f,p);break;default:throw new i.FormatError(`unknown operator: 12 ${P}`)}break;case 14:if(d.length>=4){var O=d.pop(),E=d.pop();p=d.pop(),f=d.pop(),t.push({cmd:"save"}),t.push({cmd:"translate",args:[f,p]});var F=u(a.cmap,String.fromCharCode(a.glyphNameMap[s.StandardEncoding[O]]));h(a.glyphs[F.glyphId],t,a,F.glyphId),t.push({cmd:"restore"}),F=u(a.cmap,String.fromCharCode(a.glyphNameMap[s.StandardEncoding[E]])),h(a.glyphs[F.glyphId],t,a,F.glyphId)}return;case 19:case 20:b+=(g+=d.length>>1)+7>>3,C=!0;break;case 21:p+=d.pop(),o(f+=d.pop(),p),C=!0;break;case 22:o(f+=d.pop(),p),C=!0;break;case 24:for(;d.length>2;)v=f+d.shift(),w=p+d.shift(),y=v+d.shift(),x=w+d.shift(),f=y+d.shift(),p=x+d.shift(),c(v,w,y,x,f,p);f+=d.shift(),p+=d.shift(),l(f,p);break;case 25:for(;d.length>6;)f+=d.shift(),p+=d.shift(),l(f,p);v=f+d.shift(),w=p+d.shift(),y=v+d.shift(),x=w+d.shift(),f=y+d.shift(),p=x+d.shift(),c(v,w,y,x,f,p);break;case 26:for(d.length%2&&(f+=d.shift());d.length>0;)v=f,w=p+d.shift(),y=v+d.shift(),x=w+d.shift(),f=y,p=x+d.shift(),c(v,w,y,x,f,p);break;case 27:for(d.length%2&&(p+=d.shift());d.length>0;)c(v=f+d.shift(),w=p,y=v+d.shift(),x=w+d.shift(),f=y+d.shift(),p=x);break;case 28:d.push((m[b]<<24|m[b+1]<<16)>>16),b+=2;break;case 29:_=d.pop()+a.gsubrsBias,(S=a.gsubrs[_])&&e(S);break;case 30:for(;d.length>0&&(v=f,w=p+d.shift(),y=v+d.shift(),x=w+d.shift(),f=y+d.shift(),p=x+(1===d.length?d.shift():0),c(v,w,y,x,f,p),0!==d.length);)v=f+d.shift(),w=p,y=v+d.shift(),x=w+d.shift(),p=x+d.shift(),c(v,w,y,x,f=y+(1===d.length?d.shift():0),p);break;case 31:for(;d.length>0&&(v=f+d.shift(),w=p,y=v+d.shift(),x=w+d.shift(),p=x+d.shift(),c(v,w,y,x,f=y+(1===d.length?d.shift():0),p),0!==d.length);)v=f,w=p+d.shift(),y=v+d.shift(),x=w+d.shift(),f=y+d.shift(),p=x+(1===d.length?d.shift():0),c(v,w,y,x,f,p);break;default:if(P<32)throw new i.FormatError(`unknown operator: ${P}`);P<247?d.push(P-139):P<251?d.push(256*(P-247)+m[b++]+108):P<255?d.push(256*-(P-251)-m[b++]-108):(d.push((m[b]<<24|m[b+1]<<16|m[b+2]<<8|m[b+3])/65536),b+=4)}C&&(d.length=0)}}(e)}const f=[];class p{constructor(e){this.constructor===p&&(0,i.unreachable)("Cannot initialize CompiledFont."),this.fontMatrix=e,this.compiledGlyphs=Object.create(null),this.compiledCharCodeToGlyphId=Object.create(null)}getPathJs(e){const t=u(this.cmap,e);let r=this.compiledGlyphs[t.glyphId];return r||(r=this.compileGlyph(this.glyphs[t.glyphId],t.glyphId),this.compiledGlyphs[t.glyphId]=r),void 0===this.compiledCharCodeToGlyphId[t.charCode]&&(this.compiledCharCodeToGlyphId[t.charCode]=t.glyphId),r}compileGlyph(e,t){if(!e||0===e.length||14===e[0])return f;let r=this.fontMatrix;if(this.isCFFCIDFont){const e=this.fdSelect.getFDIndex(t);e>=0&&ei)return!0;for(var a=i-e,n=a;n>8&255,255&s):(s=65536*s|0,this.output.push(255,s>>24&255,s>>16&255,s>>8&255,255&s))}return this.output.push.apply(this.output,t),r?this.stack.splice(a,e):this.stack.length=0,!1}},h}(),l=function(){function e(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function t(e,t,r){if(r>=e.length)return new Uint8Array(0);var i,a,n=0|t;for(i=0;i>8,n=52845*(l+n)+22719&65535}return o}function r(e){return 47===e||91===e||93===e||123===e||125===e||40===e||41===e}function s(r,i,s){if(i){var o=r.getBytes(),l=!((e(o[0])||(0,a.isWhiteSpace)(o[0]))&&e(o[1])&&e(o[2])&&e(o[3])&&e(o[4])&&e(o[5])&&e(o[6])&&e(o[7]));r=new n.Stream(l?t(o,55665,4):function(t,r,i){var a,n,s=0|r,o=t.length,l=new Uint8Array(o>>>1);for(a=0,n=0;a>8,s=52845*(d+s)+22719&65535}}}return l.slice(i,n)}(o,55665,4))}this.seacAnalysisEnabled=!!s,this.stream=r,this.nextChar()}return s.prototype={readNumberArray:function(){this.getToken();for(var e=[];;){var t=this.getToken();if(null===t||"]"===t||"}"===t)break;e.push(parseFloat(t||0))}return e},readNumber:function(){var e=this.getToken();return parseFloat(e||0)},readInt:function(){var e=this.getToken();return 0|parseInt(e||0,10)},readBoolean:function(){return"true"===this.getToken()?1:0},nextChar:function(){return this.currentChar=this.stream.getByte()},getToken:function(){for(var e=!1,t=this.currentChar;;){if(-1===t)return null;if(e)10!==t&&13!==t||(e=!1);else if(37===t)e=!0;else if(!(0,a.isWhiteSpace)(t))break;t=this.nextChar()}if(r(t))return this.nextChar(),String.fromCharCode(t);var i="";do{i+=String.fromCharCode(t),t=this.nextChar()}while(t>=0&&!(0,a.isWhiteSpace)(t)&&!r(t));return i},readCharStrings:function(e,r){return-1===r?e:t(e,4330,r)},extractFontProgram:function(e){var t=this.stream,r=[],i=[],a=Object.create(null);a.lenIV=4;for(var n,s,l,c,u,d={subrs:[],charstrings:[],properties:{privateData:a}};null!==(n=this.getToken());)if("/"===n)switch(n=this.getToken()){case"CharStrings":for(this.getToken(),this.getToken(),this.getToken(),this.getToken();null!==(n=this.getToken())&&"end"!==n;)if("/"===n){var h=this.getToken();s=this.readInt(),this.getToken(),l=s>0?t.getBytes(s):new Uint8Array(0),c=d.properties.privateData.lenIV,u=this.readCharStrings(l,c),this.nextChar(),"noaccess"===(n=this.getToken())&&this.getToken(),i.push({glyph:h,encoded:u})}break;case"Subrs":for(this.readInt(),this.getToken();"dup"===this.getToken();){const e=this.readInt();s=this.readInt(),this.getToken(),l=s>0?t.getBytes(s):new Uint8Array(0),c=d.properties.privateData.lenIV,u=this.readCharStrings(l,c),this.nextChar(),"noaccess"===(n=this.getToken())&&this.getToken(),r[e]=u}break;case"BlueValues":case"OtherBlues":case"FamilyBlues":case"FamilyOtherBlues":var f=this.readNumberArray();f.length>0&&f.length;break;case"StemSnapH":case"StemSnapV":d.properties.privateData[n]=this.readNumberArray();break;case"StdHW":case"StdVW":d.properties.privateData[n]=this.readNumberArray()[0];break;case"BlueShift":case"lenIV":case"BlueFuzz":case"BlueScale":case"LanguageGroup":case"ExpansionFactor":d.properties.privateData[n]=this.readNumber();break;case"ForceBold":d.properties.privateData[n]=this.readBoolean()}for(var p=0;p-1&&void 0===e.widths[t]&&t>=e.firstChar&&t<=e.lastChar&&(e.widths[t]=g.width)}}return d},extractFontHeader:function(e){for(var t;null!==(t=this.getToken());)if("/"===t)switch(t=this.getToken()){case"FontMatrix":var r=this.readNumberArray();e.fontMatrix=r;break;case"Encoding":var a,n=this.getToken();if(/^\d+$/.test(n)){a=[];var s=0|parseInt(n,10);this.getToken();for(var o=0;o=d||C<=0)(0,i.info)("Bad shading domain.");else{var I,T=new Float32Array(o.numComps),O=new Float32Array(1);for(let e=0;e<=10;e++){O[0]=u+e*C,S(O,0,T,0),I=o.getRgb(T,0);var E=i.Util.makeCssRgb(I[0],I[1],I[2]);P.push([e/10,E])}var F="transparent";e.has("Background")&&(I=o.getRgb(e.get("Background"),0),F=i.Util.makeCssRgb(I[0],I[1],I[2])),f||(P.unshift([0,F]),P[1][0]+=p.SMALL_NUMBER),g||(P[P.length-1][0]-=p.SMALL_NUMBER,P.push([1,F])),this.colorStops=P}}return e.prototype={getIR:function(){var e,t,r,a,n,s=this.coordsArr,c=this.shadingType;c===o?(t=[s[0],s[1]],r=[s[2],s[3]],a=null,n=null,e="axial"):c===l?(t=[s[0],s[1]],r=[s[3],s[4]],a=s[2],n=s[5],e="radial"):(0,i.unreachable)(`getPattern type unknown: ${c}`);var u=this.matrix;if(u&&(t=i.Util.applyTransform(t,u),r=i.Util.applyTransform(r,u),c===l)){var d=i.Util.singularValueDecompose2dScale(u);a*=d[0],n*=d[1]}return["RadialAxial",e,this.bbox,this.colorStops,t,r,a,n]}},e}(),p.Mesh=function(){function e(e,t){this.stream=e,this.context=t,this.buffer=0,this.bufferLength=0;var r=t.numComps;this.tmpCompsBuf=new Float32Array(r);var i=t.colorSpace.numComps;this.tmpCsCompsBuf=t.colorFn?new Float32Array(i):this.tmpCompsBuf}e.prototype={get hasData(){if(this.stream.end)return this.stream.pos0)return!0;var e=this.stream.getByte();return!(e<0||(this.buffer=e,this.bufferLength=8,0))},readBits:function(e){var t=this.buffer,r=this.bufferLength;if(32===e){if(0===r)return(this.stream.getByte()<<24|this.stream.getByte()<<16|this.stream.getByte()<<8|this.stream.getByte())>>>0;t=t<<24|this.stream.getByte()<<16|this.stream.getByte()<<8|this.stream.getByte();var i=this.stream.getByte();return this.buffer=i&(1<>r)>>>0}if(8===e&&0===r)return this.stream.getByte();for(;r>r},align:function(){this.buffer=0,this.bufferLength=0},readFlag:function(){return this.readBits(this.context.bitsPerFlag)},readCoordinate:function(){var e=this.context.bitsPerCoordinate,t=this.readBits(e),r=this.readBits(e),i=this.context.decode,a=e<32?1/((1<o?o:t,r=r>l?l:r,i=i=0&&"ET"===f[P];--P)f[P]="EN";for(P=m+1;P0&&(T=f[m-1]);var O=S;I+1E&&s(E)&&(L=E);for(E=F;E>=L;--E){var R=-1;for(m=0,b=x.length;m=0&&(u(h,R,m),R=-1):R<0&&(R=m);R>=0&&u(h,R,x.length)}for(m=0,b=h.length;m"!==M||(h[m]="")}return d(h.join(""),p)};var i=r(2),a=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],n=["AN","AN","AN","AN","AN","AN","ON","ON","AL","ET","ET","AL","CS","AL","ON","ON","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","ON","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","ON","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL"];function s(e){return 0!=(1&e)}function o(e){return 0==(1&e)}function l(e,t,r){for(var i=t,a=e.length;i>l)*u,c&=(1<r?e=r:e0&&(h=a[u-1]);var f=i[1];u>1,l=a.length>>1,d=new c(s),h=Object.create(null),f=8192,p=new Float32Array(l);return function(e,t,r,i){var a,s,c="",u=p;for(a=0;a(y=n[2*a+1]))&&(s=y),m[a]=s}f>0&&(f--,h[c]=m),r.set(m,i)}else r.set(g,i)}}},l=function(){function e(e){this.stack=e?Array.prototype.slice.call(e,0):[]}return e.prototype={push:function(e){if(this.stack.length>=100)throw new Error("PostScript function stack overflow.");this.stack.push(e)},pop:function(){if(this.stack.length<=0)throw new Error("PostScript function stack underflow.");return this.stack.pop()},copy:function(e){if(this.stack.length+e>=100)throw new Error("PostScript function stack overflow.");for(var t=this.stack,r=t.length-e,i=e-1;i>=0;i--,r++)t.push(t[r])},index:function(e){this.push(this.stack[this.stack.length-e-1])},roll:function(e,t){var r,i,a,n=this.stack,s=n.length-e,o=n.length-1,l=s+(t-Math.floor(t/e)*e);for(r=s,i=o;r0?n.push(r<>a);break;case"ceiling":r=n.pop(),n.push(Math.ceil(r));break;case"copy":r=n.pop(),n.copy(r);break;case"cos":r=n.pop(),n.push(Math.cos(r));break;case"cvi":r=0|n.pop(),n.push(r);break;case"cvr":break;case"div":a=n.pop(),r=n.pop(),n.push(r/a);break;case"dup":n.copy(1);break;case"eq":a=n.pop(),r=n.pop(),n.push(r===a);break;case"exch":n.roll(2,1);break;case"exp":a=n.pop(),r=n.pop(),n.push(r**a);break;case"false":n.push(!1);break;case"floor":r=n.pop(),n.push(Math.floor(r));break;case"ge":a=n.pop(),r=n.pop(),n.push(r>=a);break;case"gt":a=n.pop(),r=n.pop(),n.push(r>a);break;case"idiv":a=n.pop(),r=n.pop(),n.push(r/a|0);break;case"index":r=n.pop(),n.index(r);break;case"le":a=n.pop(),r=n.pop(),n.push(r<=a);break;case"ln":r=n.pop(),n.push(Math.log(r));break;case"log":r=n.pop(),n.push(Math.log(r)/Math.LN10);break;case"lt":a=n.pop(),r=n.pop(),n.push(r=t?new r(t):e.max<=t?e:new n(e,t)}function f(){}return e.prototype.visit=function(e){(0,i.unreachable)("abstract method")},t.prototype=Object.create(e.prototype),t.prototype.visit=function(e){e.visitArgument(this)},r.prototype=Object.create(e.prototype),r.prototype.visit=function(e){e.visitLiteral(this)},a.prototype=Object.create(e.prototype),a.prototype.visit=function(e){e.visitBinaryOperation(this)},n.prototype=Object.create(e.prototype),n.prototype.visit=function(e){e.visitMin(this)},s.prototype=Object.create(e.prototype),s.prototype.visit=function(e){e.visitVariable(this)},o.prototype=Object.create(e.prototype),o.prototype.visit=function(e){e.visitVariableDefinition(this)},l.prototype={visitArgument(e){this.parts.push("Math.max(",e.min,", Math.min(",e.max,", src[srcOffset + ",e.index,"]))")},visitVariable(e){this.parts.push("v",e.index)},visitLiteral(e){this.parts.push(e.number)},visitBinaryOperation(e){this.parts.push("("),e.arg1.visit(this),this.parts.push(" ",e.op," "),e.arg2.visit(this),this.parts.push(")")},visitVariableDefinition(e){this.parts.push("var "),e.variable.visit(this),this.parts.push(" = "),e.arg.visit(this),this.parts.push(";")},visitMin(e){this.parts.push("Math.min("),e.arg.visit(this),this.parts.push(", ",e.max,")")},toString(){return this.parts.join("")}},f.prototype={compile:function(e,i,a){var n,f,p,g,m,b,v,y,w=[],x=[],k=i.length>>1,A=a.length>>1,_=0;for(let e=0;ee.min&&(s.unshift("Math.max(",i,", "),s.push(")")),n=0&&(t>=65&&t<=90||t>=97&&t<=122);)r.push(String.fromCharCode(t));const i=r.join("");switch(i.toLowerCase()){case"if":return o.IF;case"ifelse":return o.IFELSE;default:return o.getOperator(i)}}getNumber(){let e=this.currentChar;const t=this.strBuf;for(t.length=0,t[0]=String.fromCharCode(e);(e=this.nextChar())>=0&&(e>=48&&e<=57||45===e||46===e);)t.push(String.fromCharCode(e));const r=parseFloat(t.join(""));if(isNaN(r))throw new i.FormatError(`Invalid floating point number: ${r}`);return r}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MurmurHash3_64=void 0;var i=r(2);const a=3285377520,n=4294901760,s=65535;t.MurmurHash3_64=class{constructor(e){this.h1=e?4294967295&e:a,this.h2=e?4294967295&e:a}update(e){let t,r;if((0,i.isString)(e)){t=new Uint8Array(2*e.length),r=0;for(let i=0,a=e.length;i>>8,t[r++]=255&a)}}else{if(!(0,i.isArrayBuffer)(e))throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");t=e,r=t.byteLength}const a=r>>2,o=r-4*a,l=new Uint32Array(t.buffer,0,a);let c=0,u=0,d=this.h1,h=this.h2;const f=3432918353,p=461845907,g=11601,m=13715;for(let e=0;e>>17,c=c*p&n|c*m&s,d^=c,d=d<<13|d>>>19,d=5*d+3864292196):(u=l[e],u=u*f&n|u*g&s,u=u<<15|u>>>17,u=u*p&n|u*m&s,h^=u,h=h<<13|h>>>19,h=5*h+3864292196);switch(c=0,o){case 3:c^=t[4*a+2]<<16;case 2:c^=t[4*a+1]<<8;case 1:c^=t[4*a],c=c*f&n|c*g&s,c=c<<15|c>>>17,c=c*p&n|c*m&s,1&a?d^=c:h^=c}this.h1=d,this.h2=h}hexdigest(){let e=this.h1,t=this.h2;e^=t>>>1,e=3981806797*e&n|36045*e&s,t=4283543511*t&n|(2950163797*(t<<16|e>>>16)&n)>>>16,e^=t>>>1,e=444984403*e&n|60499*e&s,t=3301882366*t&n|(3120437893*(t<<16|e>>>16)&n)>>>16,e^=t>>>1;const r=(e>>>0).toString(16),i=(t>>>0).toString(16);return r.padStart(8,"0")+i.padStart(8,"0")}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFImage=void 0;var i=r(2),a=r(5),n=r(23),s=r(12),o=r(18),l=r(21),c=function(){function e(e,t,r,i){return(e=t+e*r)<0?e=0:e>i&&(e=i),e}function t(e,t,r,i,a,n){var s=a*n;let o;o=t<=8?new Uint8Array(s):t<=16?new Uint16Array(s):new Uint32Array(s);var l,c,u,d,h=r/a,f=i/n,p=0,g=new Uint16Array(a),m=r;for(l=0;l0&&Number.isInteger(s.height)&&s.height>0&&(s.width!==m||s.height!==b)&&((0,i.warn)("PDFImage - using the Width/Height of the image data, rather than the image dictionary."),m=s.width,b=s.height),m<1||b<1)throw new i.FormatError(`Invalid image width: ${m} or height: ${b}`);this.width=m,this.height=b,this.interpolate=f.get("Interpolate","I")||!1,this.imageMask=f.get("ImageMask","IM")||!1,this.matte=f.get("Matte")||!1;var v=s.bitsPerComponent;if(!v&&!(v=f.get("BitsPerComponent","BPC"))){if(!this.imageMask)throw new i.FormatError(`Bits per component missing in image: ${this.imageMask}`);v=1}if(this.bpc=v,!this.imageMask){var y=f.get("ColorSpace","CS");if(!y)switch((0,i.info)("JPX images (which do not require color spaces)"),s.numComps){case 1:y=a.Name.get("DeviceGray");break;case 3:y=a.Name.get("DeviceRGB");break;case 4:y=a.Name.get("DeviceCMYK");break;default:throw new Error(`JPX images with ${s.numComps} color components not supported.`)}const r=o?t:null;this.colorSpace=n.ColorSpace.parse(y,e,r,h),this.numComps=this.colorSpace.numComps}if(this.decode=f.getArray("Decode","D"),this.needsDecode=!1,this.decode&&(this.colorSpace&&!this.colorSpace.isDefaultDecode(this.decode,v)||d&&!n.ColorSpace.isDefaultDecode(this.decode,1))){this.needsDecode=!0;var w=(1<>3)*r,l=e.byteLength;if(!i||a&&o!==l)if(a)for((n=new Uint8ClampedArray(o)).set(e),s=l;s>7&1,o[h+1]=c>>6&1,o[h+2]=c>>5&1,o[h+3]=c>>4&1,o[h+4]=c>>3&1,o[h+5]=c>>2&1,o[h+6]=c>>1&1,o[h+7]=1&c,h+=8;if(h>=1}else{var b=0;for(c=0,h=0,l=n;h>v;r<0?r=0:r>d&&(r=d),o[h]=r,c&=(1<g[w+1]){b=255;break}}l[d]=b}}if(l)for(d=0,f=3,h=a*s;d>3;if(!e){var f;if("DeviceGray"===this.colorSpace.name&&1===d?f=i.ImageKind.GRAYSCALE_1BPP:"DeviceRGB"!==this.colorSpace.name||8!==d||this.needsDecode||(f=i.ImageKind.RGB_24BPP),f&&!this.smask&&!this.mask&&r===c&&a===u){if(n.kind=f,t=this.getImageBytes(u*h),this.image instanceof s.DecodeStream)n.data=t;else{var p=new Uint8ClampedArray(t.length);p.set(t),n.data=p}if(this.needsDecode){(0,i.assert)(f===i.ImageKind.GRAYSCALE_1BPP,"PDFImage.createImageData: The image must be grayscale.");for(var g=n.data,m=0,b=g.length;m>3,c=this.getImageBytes(s*l),u=this.getComponents(c);if(1!==o){this.needsDecode&&this.decodeBuffer(u),a=n*s;var d=255/((1<{const t=e.data;if(t.targetName!==this.sourceName)return;if(t.stream)return void this._processStreamMessage(t);if(t.callback){const e=t.callbackId,r=this.callbackCapabilities[e];if(!r)throw new Error(`Cannot resolve callback ${e}`);if(delete this.callbackCapabilities[e],t.callback===a)r.resolve(t.data);else{if(t.callback!==n)throw new Error("Unexpected callback case");r.reject(p(t.reason))}return}const i=this.actionHandler[t.action];if(!i)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const e=this.sourceName,s=t.sourceName;new Promise((function(e){e(i(t.data))})).then((function(i){r.postMessage({sourceName:e,targetName:s,callback:a,callbackId:t.callbackId,data:i})}),(function(i){r.postMessage({sourceName:e,targetName:s,callback:n,callbackId:t.callbackId,reason:p(i)})}))}else t.streamId?this._createStreamSink(t):i(t.data)},r.addEventListener("message",this._onComObjOnMessage)}on(e,t){const r=this.actionHandler;if(r[e])throw new Error(`There is already an actionName called "${e}"`);r[e]=t}send(e,t,r){this._postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},r)}sendWithPromise(e,t,r){const a=this.callbackId++,n=(0,i.createPromiseCapability)();this.callbackCapabilities[a]=n;try{this._postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:a,data:t},r)}catch(e){n.reject(e)}return n.promise}sendWithStream(e,t,r,a){const n=this.streamId++,o=this.sourceName,l=this.targetName,c=this.comObj;return new ReadableStream({start:r=>{const s=(0,i.createPromiseCapability)();return this.streamControllers[n]={controller:r,startCall:s,pullCall:null,cancelCall:null,isClosed:!1},this._postMessage({sourceName:o,targetName:l,action:e,streamId:n,data:t,desiredSize:r.desiredSize},a),s.promise},pull:e=>{const t=(0,i.createPromiseCapability)();return this.streamControllers[n].pullCall=t,c.postMessage({sourceName:o,targetName:l,stream:d,streamId:n,desiredSize:e.desiredSize}),t.promise},cancel:e=>{(0,i.assert)(e instanceof Error,"cancel must have a valid reason");const t=(0,i.createPromiseCapability)();return this.streamControllers[n].cancelCall=t,this.streamControllers[n].isClosed=!0,c.postMessage({sourceName:o,targetName:l,stream:s,streamId:n,reason:p(e)}),t.promise}},r)}_createStreamSink(e){const t=this,r=this.actionHandler[e.action],a=e.streamId,n=this.sourceName,s=e.sourceName,o=this.comObj,d={enqueue(e,r=1,o){if(this.isCancelled)return;const l=this.desiredSize;this.desiredSize-=r,l>0&&this.desiredSize<=0&&(this.sinkCapability=(0,i.createPromiseCapability)(),this.ready=this.sinkCapability.promise),t._postMessage({sourceName:n,targetName:s,stream:c,streamId:a,chunk:e},o)},close(){this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:n,targetName:s,stream:l,streamId:a}),delete t.streamSinks[a])},error(e){(0,i.assert)(e instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:n,targetName:s,stream:u,streamId:a,reason:p(e)}))},sinkCapability:(0,i.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};d.sinkCapability.resolve(),d.ready=d.sinkCapability.promise,this.streamSinks[a]=d,new Promise((function(t){t(r(e.data,d))})).then((function(){o.postMessage({sourceName:n,targetName:s,stream:f,streamId:a,success:!0})}),(function(e){o.postMessage({sourceName:n,targetName:s,stream:f,streamId:a,reason:p(e)})}))}_processStreamMessage(e){const t=e.streamId,r=this.sourceName,a=e.sourceName,n=this.comObj;switch(e.stream){case f:e.success?this.streamControllers[t].startCall.resolve():this.streamControllers[t].startCall.reject(p(e.reason));break;case h:e.success?this.streamControllers[t].pullCall.resolve():this.streamControllers[t].pullCall.reject(p(e.reason));break;case d:if(!this.streamSinks[t]){n.postMessage({sourceName:r,targetName:a,stream:h,streamId:t,success:!0});break}this.streamSinks[t].desiredSize<=0&&e.desiredSize>0&&this.streamSinks[t].sinkCapability.resolve(),this.streamSinks[t].desiredSize=e.desiredSize;const{onPull:g}=this.streamSinks[e.streamId];new Promise((function(e){e(g&&g())})).then((function(){n.postMessage({sourceName:r,targetName:a,stream:h,streamId:t,success:!0})}),(function(e){n.postMessage({sourceName:r,targetName:a,stream:h,streamId:t,reason:p(e)})}));break;case c: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 l: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 u:(0,i.assert)(this.streamControllers[t],"error should have stream controller"),this.streamControllers[t].controller.error(p(e.reason)),this._deleteStreamController(t);break;case o:e.success?this.streamControllers[t].cancelCall.resolve():this.streamControllers[t].cancelCall.reject(p(e.reason)),this._deleteStreamController(t);break;case s:if(!this.streamSinks[t])break;const{onCancel:m}=this.streamSinks[e.streamId];new Promise((function(t){t(m&&m(p(e.reason)))})).then((function(){n.postMessage({sourceName:r,targetName:a,stream:o,streamId:t,success:!0})}),(function(e){n.postMessage({sourceName:r,targetName:a,stream:o,streamId:t,reason:p(e)})})),this.streamSinks[t].sinkCapability.reject(p(e.reason)),this.streamSinks[t].isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}async _deleteStreamController(e){await Promise.allSettled([this.streamControllers[e].startCall,this.streamControllers[e].pullCall,this.streamControllers[e].cancelCall].map((function(e){return e&&e.promise}))),delete this.streamControllers[e]}_postMessage(e,t){t&&this.postMessageTransfers?this.comObj.postMessage(e,t):this.comObj.postMessage(e)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFWorkerStream=void 0;var i=r(2);t.PDFWorkerStream=class{constructor(e){this._msgHandler=e,this._contentLength=null,this._fullRequestReader=null,this._rangeRequestReaders=[]}getFullReader(){return(0,i.assert)(!this._fullRequestReader,"PDFWorkerStream.getFullReader can only be called once."),this._fullRequestReader=new a(this._msgHandler),this._fullRequestReader}getRangeReader(e,t){const r=new n(e,t,this._msgHandler);return this._rangeRequestReaders.push(r),r}cancelAllRequests(e){this._fullRequestReader&&this._fullRequestReader.cancel(e),this._rangeRequestReaders.slice(0).forEach((function(t){t.cancel(e)}))}};class a{constructor(e){this._msgHandler=e,this.onProgress=null,this._contentLength=null,this._isRangeSupported=!1,this._isStreamingSupported=!1;const t=this._msgHandler.sendWithStream("GetReader");this._reader=t.getReader(),this._headersReady=this._msgHandler.sendWithPromise("ReaderHeadersReady").then((e=>{this._isStreamingSupported=e.isStreamingSupported,this._isRangeSupported=e.isRangeSupported,this._contentLength=e.contentLength}))}get headersReady(){return this._headersReady}get contentLength(){return this._contentLength}get isStreamingSupported(){return this._isStreamingSupported}get isRangeSupported(){return this._isRangeSupported}async read(){const{value:e,done:t}=await this._reader.read();return t?{value:void 0,done:!0}:{value:e.buffer,done:!1}}cancel(e){this._reader.cancel(e)}}class n{constructor(e,t,r){this._msgHandler=r,this.onProgress=null;const i=this._msgHandler.sendWithStream("GetRangeReader",{begin:e,end:t});this._reader=i.getReader()}get isStreamingSupported(){return!1}async read(){const{value:e,done:t}=await this._reader.read();return t?{value:void 0,done:!0}:{value:e.buffer,done:!1}}cancel(e){this._reader.cancel(e)}}}])},e.exports=i()},7963:function(e,t,r){var i;i=function(){return function(e){var t={};function r(i){if(t[i])return t[i].exports;var a=t[i]={i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},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 i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(i,a,function(t){return e[t]}.bind(null,a));return i},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){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AnnotationLayerBuilder",{enumerable:!0,get:function(){return i.AnnotationLayerBuilder}}),Object.defineProperty(t,"DefaultAnnotationLayerFactory",{enumerable:!0,get:function(){return i.DefaultAnnotationLayerFactory}}),Object.defineProperty(t,"DefaultTextLayerFactory",{enumerable:!0,get:function(){return a.DefaultTextLayerFactory}}),Object.defineProperty(t,"TextLayerBuilder",{enumerable:!0,get:function(){return a.TextLayerBuilder}}),Object.defineProperty(t,"EventBus",{enumerable:!0,get:function(){return n.EventBus}}),Object.defineProperty(t,"NullL10n",{enumerable:!0,get:function(){return n.NullL10n}}),Object.defineProperty(t,"ProgressBar",{enumerable:!0,get:function(){return n.ProgressBar}}),Object.defineProperty(t,"PDFLinkService",{enumerable:!0,get:function(){return s.PDFLinkService}}),Object.defineProperty(t,"SimpleLinkService",{enumerable:!0,get:function(){return s.SimpleLinkService}}),Object.defineProperty(t,"DownloadManager",{enumerable:!0,get:function(){return o.DownloadManager}}),Object.defineProperty(t,"GenericL10n",{enumerable:!0,get:function(){return l.GenericL10n}}),Object.defineProperty(t,"PDFFindController",{enumerable:!0,get:function(){return c.PDFFindController}}),Object.defineProperty(t,"PDFHistory",{enumerable:!0,get:function(){return u.PDFHistory}}),Object.defineProperty(t,"PDFPageView",{enumerable:!0,get:function(){return d.PDFPageView}}),Object.defineProperty(t,"PDFSinglePageViewer",{enumerable:!0,get:function(){return h.PDFSinglePageViewer}}),Object.defineProperty(t,"PDFViewer",{enumerable:!0,get:function(){return f.PDFViewer}});var i=r(1),a=r(5),n=r(3),s=r(4),o=r(6),l=r(8),c=r(10),u=r(12),d=r(13),h=r(15),f=r(17)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultAnnotationLayerFactory=t.AnnotationLayerBuilder=void 0;var i=r(2),a=r(3),n=r(4);class s{constructor({pageDiv:e,pdfPage:t,linkService:r,downloadManager:i,imageResourcesPath:n="",renderInteractiveForms:s=!1,l10n:o=a.NullL10n}){this.pageDiv=e,this.pdfPage=t,this.linkService=r,this.downloadManager=i,this.imageResourcesPath=n,this.renderInteractiveForms=s,this.l10n=o,this.div=null,this._cancelled=!1}render(e,t="display"){this.pdfPage.getAnnotations({intent:t}).then((t=>{if(this._cancelled)return;const r={viewport:e.clone({dontFlip:!0}),div:this.div,annotations:t,page:this.pdfPage,imageResourcesPath:this.imageResourcesPath,renderInteractiveForms:this.renderInteractiveForms,linkService:this.linkService,downloadManager:this.downloadManager};if(this.div)i.AnnotationLayer.update(r);else{if(0===t.length)return;this.div=document.createElement("div"),this.div.className="annotationLayer",this.pageDiv.appendChild(this.div),r.div=this.div,i.AnnotationLayer.render(r),this.l10n.translate(this.div)}}))}cancel(){this._cancelled=!0}hide(){this.div&&this.div.setAttribute("hidden","true")}}t.AnnotationLayerBuilder=s,t.DefaultAnnotationLayerFactory=class{createAnnotationLayerBuilder(e,t,r="",i=!1,o=a.NullL10n){return new s({pageDiv:e,pdfPage:t,imageResourcesPath:r,renderInteractiveForms:i,linkService:new n.SimpleLinkService,l10n:o})}}},function(e,t,i){"use strict";let a;a="undefined"!=typeof window&&window["pdfjs-dist/build/pdf"]?window["pdfjs-dist/build/pdf"]:r(9299),e.exports=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isValidRotation=function(e){return Number.isInteger(e)&&e%90==0},t.isValidScrollMode=function(e){return Number.isInteger(e)&&Object.values(i).includes(e)&&e!==i.UNKNOWN},t.isValidSpreadMode=function(e){return Number.isInteger(e)&&Object.values(a).includes(e)&&e!==a.UNKNOWN},t.isPortraitOrientation=function(e){return e.width<=e.height},t.clamp=d,t.getPDFFileNameFromURL=function(e,t="document.pdf"){if("string"!=typeof e)return t;if(function(e){let t=0;const r=e.length;for(;t1?i[1]:null;r[decodeURIComponent(a)]=decodeURIComponent(n)}return r},t.backtrackBeforeAllVisibleElements=o,t.getVisibleElements=function(e,t,r=!1,i=!1){const a=e.scrollTop,n=a+e.clientHeight,l=e.scrollLeft,c=l+e.clientWidth,u=[],d=t.length;let h=0===d?0:s(t,i?function(e){const t=e.div;return t.offsetLeft+t.clientLeft+t.clientWidth>l}:function(e){const t=e.div;return t.offsetTop+t.clientTop+t.clientHeight>a});h>0&&h=n&&(f=m);else if((i?o:d)>f)break;if(m<=a||d>=n||g<=l||o>=c)continue;const b=Math.max(0,a-d)+Math.max(0,m-n),v=Math.max(0,l-o)+Math.max(0,g-c),y=(p-b)*(h-v)*100/p/h|0;u.push({id:r.id,x:o,y:d,view:r,percent:y})}const p=u[0],g=u[u.length-1];return r&&u.sort((function(e,t){const r=e.percent-t.percent;return Math.abs(r)>.001?-r:e.id-t.id})),{first:p,last:g,views:u}},t.roundToDivide=function(e,t){const r=e%t;return 0===r?e:Math.round(e-r+t)},t.getPageSizeInches=function({view:e,userUnit:t,rotate:r}){const[i,a,n,s]=e,o=r%180!=0,l=(n-i)/72*t,c=(s-a)/72*t;return{width:o?c:l,height:o?l:c}},t.approximateFraction=function(e){if(Math.floor(e)===e)return[e,1];const t=1/e;if(t>8)return[1,8];if(Math.floor(t)===t)return[1,t];const r=e>1?t:e;let i,a=0,n=1,s=1,o=1;for(;;){const e=a+s,t=n+o;if(t>8)break;r<=e/t?(s=e,o=t):(a=e,n=t)}return i=r-a/nn),i.lastX=r;const s=e.scrollTop,o=i.lastY;s!==o&&(i.down=s>o),i.lastY=s,t(i)})))},i={right:!0,down:!0,lastX:e.scrollLeft,lastY:e.scrollTop,_eventHandler:r};let a=null;return e.addEventListener("scroll",r,!0),i},t.binarySearchFirstItem=s,t.normalizeWheelEventDelta=function(e){let t=Math.sqrt(e.deltaX*e.deltaX+e.deltaY*e.deltaY);const r=Math.atan2(e.deltaY,e.deltaX);return-.25*Math.PI=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");function n(r){e instanceof u?e._off(t,s):e.removeEventListener(t,s),c&&clearTimeout(c),i(r)}const s=n.bind(null,l.EVENT);e instanceof u?e._on(t,s):e.addEventListener(t,s);const o=n.bind(null,l.TIMEOUT),c=setTimeout(o,r)}))},t.moveToEndOfArray=function(e,t){const r=[],i=e.length;let a=0;for(let n=0;n"en-us",getDirection:async()=>"ltr",get:async(e,t,r)=>function(e,t){return t?e.replace(/\{\{\s*(\w+)\s*\}\}/g,((e,r)=>r in t?t[r]:"{{"+r+"}}")):e}(r,t),async translate(e){}};function s(e,t){let r=0,i=e.length-1;if(i<0||!t(e[i]))return e.length;if(t(e[r]))return r;for(;r>1;t(e[a])?i=a:r=a+1}return r}function o(e,t,r){if(e<2)return e;let i=t[e].div,a=i.offsetTop+i.clientTop;a>=r&&(i=t[e-1].div,a=i.offsetTop+i.clientTop);for(let r=e-2;r>=0&&(i=t[r].div,!(i.offsetTop+i.clientTop+i.clientHeight<=a));--r)e=r;return e}t.NullL10n=n;const l={EVENT:"event",TIMEOUT:"timeout"};t.WaitOnType=l;const c=new Promise((function(e){window.requestAnimationFrame(e)}));t.animationStarted=c;class u{constructor(e){this._listeners=Object.create(null)}on(e,t){this._on(e,t,{external:!0})}off(e,t){this._off(e,t,{external:!0})}dispatch(e){const t=this._listeners[e];if(!t||0===t.length)return;const r=Array.prototype.slice.call(arguments,1);let i;t.slice(0).forEach((function({listener:e,external:t}){if(t)return i||(i=[]),void i.push(e);e.apply(null,r)})),i&&(i.forEach((function(e){e.apply(null,r)})),i=null)}_on(e,t,r=null){let i=this._listeners[e];i||(this._listeners[e]=i=[]),i.push({listener:t,external:!0===(r&&r.external)})}_off(e,t,r=null){const i=this._listeners[e];if(i)for(let e=0,r=i.length;e0&&(this.bar.style.width=`calc(100% - ${t}px)`)}hide(){this.visible&&(this.visible=!1,this.bar.classList.add("hidden"),document.body.classList.remove("loadingInProgress"))}show(){this.visible||(this.visible=!0,document.body.classList.add("loadingInProgress"),this.bar.classList.remove("hidden"))}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SimpleLinkService=t.PDFLinkService=void 0;var i=r(3);t.PDFLinkService=class{constructor({eventBus:e,externalLinkTarget:t=null,externalLinkRel:r=null,externalLinkEnabled:i=!0,ignoreDestinationZoom:a=!1}={}){this.eventBus=e,this.externalLinkTarget=t,this.externalLinkRel=r,this.externalLinkEnabled=i,this._ignoreDestinationZoom=a,this.baseUrl=null,this.pdfDocument=null,this.pdfViewer=null,this.pdfHistory=null,this._pagesRefCache=null}setDocument(e,t=null){this.baseUrl=t,this.pdfDocument=e,this._pagesRefCache=Object.create(null)}setViewer(e){this.pdfViewer=e}setHistory(e){this.pdfHistory=e}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return this.pdfViewer.currentPageNumber}set page(e){this.pdfViewer.currentPageNumber=e}get rotation(){return this.pdfViewer.pagesRotation}set rotation(e){this.pdfViewer.pagesRotation=e}navigateTo(e){const t=({namedDest:r,explicitDest:i})=>{const a=i[0];let n;if(a instanceof Object){if(n=this._cachedPageNumber(a),null===n)return void this.pdfDocument.getPageIndex(a).then((e=>{this.cachePageRef(e+1,a),t({namedDest:r,explicitDest:i})})).catch((()=>{console.error(`PDFLinkService.navigateTo: "${a}" is not a valid page reference, for dest="${e}".`)}))}else{if(!Number.isInteger(a))return void console.error(`PDFLinkService.navigateTo: "${a}" is not a valid destination reference, for dest="${e}".`);n=a+1}!n||n<1||n>this.pagesCount?console.error(`PDFLinkService.navigateTo: "${n}" is not a valid page number, for dest="${e}".`):(this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.push({namedDest:r,explicitDest:i,pageNumber:n})),this.pdfViewer.scrollPageIntoView({pageNumber:n,destArray:i,ignoreDestinationZoom:this._ignoreDestinationZoom}))};new Promise(((t,r)=>{"string"!=typeof e?t({namedDest:"",explicitDest:e}):this.pdfDocument.getDestination(e).then((r=>{t({namedDest:e,explicitDest:r})}))})).then((r=>{Array.isArray(r.explicitDest)?t(r):console.error(`PDFLinkService.navigateTo: "${r.explicitDest}" is not a valid destination array, for dest="${e}".`)}))}getDestinationHash(e){if("string"==typeof e)return this.getAnchorUrl("#"+escape(e));if(Array.isArray(e)){const t=JSON.stringify(e);return this.getAnchorUrl("#"+escape(t))}return this.getAnchorUrl("")}getAnchorUrl(e){return(this.baseUrl||"")+e}setHash(e){let t,r;if(e.includes("=")){const a=(0,i.parseQueryString)(e);if("search"in a&&this.eventBus.dispatch("findfromurlhash",{source:this,query:a.search.replace(/"/g,""),phraseSearch:"true"===a.phrase}),"page"in a&&(t=0|a.page||1),"zoom"in a){const e=a.zoom.split(","),t=e[0],i=parseFloat(t);t.includes("Fit")?"Fit"===t||"FitB"===t?r=[null,{name:t}]:"FitH"===t||"FitBH"===t||"FitV"===t||"FitBV"===t?r=[null,{name:t},e.length>1?0|e[1]:null]:"FitR"===t?5!==e.length?console.error('PDFLinkService.setHash: Not enough parameters for "FitR".'):r=[null,{name:t},0|e[1],0|e[2],0|e[3],0|e[4]]:console.error(`PDFLinkService.setHash: "${t}" is not a valid zoom value.`):r=[null,{name:"XYZ"},e.length>1?0|e[1]:null,e.length>2?0|e[2]:null,i?i/100:t]}r?this.pdfViewer.scrollPageIntoView({pageNumber:t||this.page,destArray:r,allowNegativeOffset:!0}):t&&(this.page=t),"pagemode"in a&&this.eventBus.dispatch("pagemode",{source:this,mode:a.pagemode}),"nameddest"in a&&this.navigateTo(a.nameddest)}else{r=unescape(e);try{r=JSON.parse(r),Array.isArray(r)||(r=r.toString())}catch(e){}if("string"==typeof r||function(e){if(!Array.isArray(e))return!1;const t=e.length;if(t<2)return!1;const r=e[0];if(!("object"==typeof r&&Number.isInteger(r.num)&&Number.isInteger(r.gen)||Number.isInteger(r)&&r>=0))return!1;const i=e[1];if("object"!=typeof i||"string"!=typeof i.name)return!1;let a=!0;switch(i.name){case"XYZ":if(5!==t)return!1;break;case"Fit":case"FitB":return 2===t;case"FitH":case"FitBH":case"FitV":case"FitBV":if(3!==t)return!1;break;case"FitR":if(6!==t)return!1;a=!1;break;default:return!1}for(let r=2;r1&&this.page--;break;case"LastPage":this.page=this.pagesCount;break;case"FirstPage":this.page=1}this.eventBus.dispatch("namedaction",{source:this,action:e})}cachePageRef(e,t){if(!t)return;const r=0===t.gen?`${t.num}R`:`${t.num}R${t.gen}`;this._pagesRefCache[r]=e}_cachedPageNumber(e){const t=0===e.gen?`${e.num}R`:`${e.num}R${e.gen}`;return this._pagesRefCache&&this._pagesRefCache[t]||null}isPageVisible(e){return this.pdfViewer.isPageVisible(e)}},t.SimpleLinkService=class{constructor(){this.externalLinkTarget=null,this.externalLinkRel=null,this.externalLinkEnabled=!0,this._ignoreDestinationZoom=!1}get pagesCount(){return 0}get page(){return 0}set page(e){}get rotation(){return 0}set rotation(e){}navigateTo(e){}getDestinationHash(e){return"#"}getAnchorUrl(e){return"#"}setHash(e){}executeNamedAction(e){}cachePageRef(e,t){}isPageVisible(e){return!0}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultTextLayerFactory=t.TextLayerBuilder=void 0;var i=r(2);class a{constructor({textLayerDiv:e,eventBus:t,pageIndex:r,viewport:i,findController:a=null,enhanceTextSelection:n=!1}){this.textLayerDiv=e,this.eventBus=t,this.textContent=null,this.textContentItemsStr=[],this.textContentStream=null,this.renderingDone=!1,this.pageIdx=r,this.pageNumber=this.pageIdx+1,this.matches=[],this.viewport=i,this.textDivs=[],this.findController=a,this.textLayerRenderTask=null,this.enhanceTextSelection=n,this._onUpdateTextLayerMatches=null,this._bindMouse()}_finishRendering(){if(this.renderingDone=!0,!this.enhanceTextSelection){const e=document.createElement("div");e.className="endOfContent",this.textLayerDiv.appendChild(e)}this.eventBus.dispatch("textlayerrendered",{source:this,pageNumber:this.pageNumber,numTextDivs:this.textDivs.length})}render(e=0){if(!this.textContent&&!this.textContentStream||this.renderingDone)return;this.cancel(),this.textDivs=[];const t=document.createDocumentFragment();this.textLayerRenderTask=(0,i.renderTextLayer)({textContent:this.textContent,textContentStream:this.textContentStream,container:t,viewport:this.viewport,textDivs:this.textDivs,textContentItemsStr:this.textContentItemsStr,timeout:e,enhanceTextSelection:this.enhanceTextSelection}),this.textLayerRenderTask.promise.then((()=>{this.textLayerDiv.appendChild(t),this._finishRendering(),this._updateMatches()}),(function(e){})),this._onUpdateTextLayerMatches||(this._onUpdateTextLayerMatches=e=>{e.pageIndex!==this.pageIdx&&-1!==e.pageIndex||this._updateMatches()},this.eventBus._on("updatetextlayermatches",this._onUpdateTextLayerMatches))}cancel(){this.textLayerRenderTask&&(this.textLayerRenderTask.cancel(),this.textLayerRenderTask=null),this._onUpdateTextLayerMatches&&(this.eventBus._off("updatetextlayermatches",this._onUpdateTextLayerMatches),this._onUpdateTextLayerMatches=null)}setTextContentStream(e){this.cancel(),this.textContentStream=e}setTextContent(e){this.cancel(),this.textContent=e}_convertMatches(e,t){if(!e)return[];const{findController:r,textContentItemsStr:i}=this;let a=0,n=0;const s=i.length-1,o=r.state.query.length,l=[];for(let r=0,c=e.length;r=n+i[a].length;)n+=i[a].length,a++;a===i.length&&console.error("Could not find a matching mapping");const u={begin:{divIdx:a,offset:c-n}};for(c+=t?t[r]:o;a!==s&&c>n+i[a].length;)n+=i[a].length,a++;u.end={divIdx:a,offset:c-n},l.push(u)}return l}_renderMatches(e){if(0===e.length)return;const{findController:t,pageIdx:r,textContentItemsStr:i,textDivs:a}=this,n=r===t.selected.pageIdx,s=t.selected.matchIdx;let o=null;const l={divIdx:-1,offset:void 0};function c(e,t){const r=e.divIdx;a[r].textContent="",u(r,0,e.offset,t)}function u(e,t,r,n){const s=a[e],o=i[e].substring(t,r),l=document.createTextNode(o);if(n){const e=document.createElement("span");return e.className=n,e.appendChild(l),void s.appendChild(e)}s.appendChild(l)}let d=s,h=d+1;if(t.state.highlightAll)d=0,h=e.length;else if(!n)return;for(let i=d;i{if(this.enhanceTextSelection&&this.textLayerRenderTask)return this.textLayerRenderTask.expandTextDivs(!0),void(t&&(clearTimeout(t),t=null));const i=e.querySelector(".endOfContent");if(!i)return;let a=r.target!==e;if(a=a&&"none"!==window.getComputedStyle(i).getPropertyValue("-moz-user-select"),a){const t=e.getBoundingClientRect(),a=Math.max(0,(r.pageY-t.top)/t.height);i.style.top=(100*a).toFixed(2)+"%"}i.classList.add("active")})),e.addEventListener("mouseup",(()=>{if(this.enhanceTextSelection&&this.textLayerRenderTask)return void(t=setTimeout((()=>{this.textLayerRenderTask&&this.textLayerRenderTask.expandTextDivs(!1),t=null}),300));const r=e.querySelector(".endOfContent");r&&(r.style.top="",r.classList.remove("active"))}))}}t.TextLayerBuilder=a,t.DefaultTextLayerFactory=class{createTextLayerBuilder(e,t,r,i=!1,n){return new a({textLayerDiv:e,pageIndex:t,viewport:r,enhanceTextSelection:i,eventBus:n})}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DownloadManager=void 0;var i=r(2);const a=r(7).viewerCompatibilityParams.disableCreateObjectURL||!1;function n(e,t){const r=document.createElement("a");if(!r.click)throw new Error('DownloadManager: "a.click()" is not supported.');r.href=e,r.target="_parent","download"in r&&(r.download=t),(document.body||document.documentElement).appendChild(r),r.click(),r.remove()}t.DownloadManager=class{constructor({disableCreateObjectURL:e=a}){this.disableCreateObjectURL=e}downloadUrl(e,t){(0,i.createValidAbsoluteUrl)(e,"http://example.com")&&n(e+"#pdfjs.action=download",t)}downloadData(e,t,r){navigator.msSaveBlob?navigator.msSaveBlob(new Blob([e],{type:r}),t):n((0,i.createObjectURL)(e,r,this.disableCreateObjectURL),t)}download(e,t,r){navigator.msSaveBlob?navigator.msSaveBlob(e,r)||this.downloadUrl(t,r):this.disableCreateObjectURL?this.downloadUrl(t,r):n(URL.createObjectURL(e),r)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.viewerCompatibilityParams=void 0;const i=Object.create(null);{const e="undefined"!=typeof navigator&&navigator.userAgent||"",t="undefined"!=typeof navigator&&navigator.platform||"",r="undefined"!=typeof navigator&&navigator.maxTouchPoints||1,a=/Android/.test(e),n=/Trident/.test(e),s=/\b(iPad|iPhone|iPod)(?=;)/.test(e)||"MacIntel"===t&&r>1,o=/CriOS/.test(e);(n||o)&&(i.disableCreateObjectURL=!0),(s||a)&&(i.maxCanvasPixels=5242880)}const a=Object.freeze(i);t.viewerCompatibilityParams=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GenericL10n=void 0,r(9);const i=document.webL10n;t.GenericL10n=class{constructor(e){this._lang=e,this._ready=new Promise(((t,r)=>{i.setLanguage(e,(()=>{t(i)}))}))}async getLanguage(){return(await this._ready).getLanguage()}async getDirection(){return(await this._ready).getDirection()}async get(e,t,r){return(await this._ready).get(e,t,r)}async translate(e){return(await this._ready).translate(e)}}},function(e,t,r){"use strict";document.webL10n=function(e,t,r){var i={},a="",n="textContent",s="",o={},l="loading";function c(e,t,r){t=t||function(e){},r=r||function(){};var i=new XMLHttpRequest;i.open("GET",e,!0),i.overrideMimeType&&i.overrideMimeType("text/plain; charset=utf-8"),i.onreadystatechange=function(){4==i.readyState&&(200==i.status||0===i.status?t(i.responseText):r())},i.onerror=r,i.ontimeout=r;try{i.send(null)}catch(e){r()}}function u(e,t,r,s){var o=e.replace(/[^\/]*$/,"")||"./";function l(e){return e.lastIndexOf("\\")<0?e:e.replace(/\\\\/g,"\\").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\{/g,"{").replace(/\\}/g,"}").replace(/\\"/g,'"').replace(/\\'/g,"'")}c(e,(function(e){a+=e,function(e,r){var i={},a=/^\s*|\s*$/,n=/^\s*#|^\s*$/,s=/^\s*\[(.*)\]\s*$/,u=/^\s*@import\s+url\((.*)\)\s*$/i,d=/^([^=\s]*)\s*=\s*(.+)$/;function h(e,r,c){var h=e.replace(a,"").split(/[\r\n]+/),p="*",g=t.split("-",1)[0],m=!1,b="";!function e(){for(;;){if(!h.length)return void c();var a=h.shift();if(!n.test(a)){if(r){if(b=s.exec(a)){p=b[1].toLowerCase(),m="*"!==p&&p!==t&&p!==g;continue}if(m)continue;if(b=u.exec(a))return void f(o+b[1],e)}var v=a.match(d);v&&3==v.length&&(i[v[1]]=l(v[2]))}}}()}function f(e,t){c(e,(function(e){h(e,!1,t)}),(function(){console.warn(e+" not found."),t()}))}h(e,!0,(function(){r(i)}))}(e,(function(e){for(var t in e){var a,s,o=t.lastIndexOf(".");o>0?(a=t.substring(0,o),s=t.substring(o+1)):(a=t,s=n),i[a]||(i[a]={}),i[a][s]=e[t]}r&&r()}))}),s)}function d(e,r){e&&(e=e.toLowerCase()),r=r||function(){},i={},a="",s="",s=e;var n=t.querySelectorAll('link[type="application/l10n"]'),o=n.length;if(0!==o){var c,d,h=0;d=function(){++h>=o&&(r(),l="complete")};for(var f=0;f0&&(s=e.substring(a+1),e=e.substring(0,a)),r&&((i={})[s]=r);var o=h(e,t,i);return o&&s in o?o[s]:"{{"+e+"}}"},getData:function(){return i},getText:function(){return a},getLanguage:function(){return s},setLanguage:function(e,t){d(e,(function(){t&&t()}))},getDirection:function(){var e=s.split("-",1)[0];return["ar","he","fa","ps","ur"].indexOf(e)>=0?"rtl":"ltr"},translate:function(e){for(var r=function(e){return e?e.querySelectorAll("*[data-l10n-id]"):[]}(e=e||t.documentElement),i=r.length,a=0;a{if(!this._pdfDocument||r&&this._pdfDocument!==r)return;this._extractText();const t=!this._highlightMatches,i=!!this._findTimeout;this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),"find"===e?this._findTimeout=setTimeout((()=>{this._nextMatch(),this._findTimeout=null}),250):this._dirtyMatch?this._nextMatch():"findagain"===e?(this._nextMatch(),t&&this._state.highlightAll&&this._updateAllPages()):"findhighlightallchange"===e?(i?this._nextMatch():this._highlightMatches=!0,this._updateAllPages()):this._nextMatch()}))}scrollMatchIntoView({element:e=null,pageIndex:t=-1,matchIndex:r=-1}){if(!this._scrollMatches||!e)return;if(-1===r||r!==this._selected.matchIdx)return;if(-1===t||t!==this._selected.pageIdx)return;this._scrollMatches=!1;const i={top:-50,left:-400};(0,n.scrollIntoView)(e,i,!0)}_reset(){this._highlightMatches=!1,this._scrollMatches=!1,this._pdfDocument=null,this._pageMatches=[],this._pageMatchesLength=[],this._state=null,this._selected={pageIdx:-1,matchIdx:-1},this._offset={pageIdx:null,matchIdx:null,wrapped:!1},this._extractTextPromises=[],this._pageContents=[],this._matchesCountTotal=0,this._pagesToSearch=null,this._pendingFindMatches=Object.create(null),this._resumePageIdx=null,this._dirtyMatch=!1,clearTimeout(this._findTimeout),this._findTimeout=null,this._firstPageCapability=(0,i.createPromiseCapability)()}get _query(){return this._state.query!==this._rawQuery&&(this._rawQuery=this._state.query,this._normalizedQuery=c(this._state.query)),this._normalizedQuery}_shouldDirtyMatch(e,t){if(t.query!==this._state.query)return!0;switch(e){case"findagain":const e=this._selected.pageIdx+1,t=this._linkService;return e>=1&&e<=t.pagesCount&&e!==t.page&&!t.isPageVisible(e);case"findhighlightallchange":return!1}return!0}_prepareMatches(e,t,r){function i(t){const r=e[t],i=e[t+1];if(t=0;i--){const t=e[i];if(!t.skipped){if(t.match+t.matchLength=r.match+r.matchLength)return r.skipped=!0,!0}}return!1}e.sort((function(e,t){return e.match===t.match?e.matchLength-t.matchLength:e.match-t.match}));for(let a=0,n=e.length;a0){const r=e.charCodeAt(t),i=e.charCodeAt(t-1);if((0,a.getCharacterType)(r)===(0,a.getCharacterType)(i))return!1}const i=t+r-1;if(i0&&(this._matchesCountTotal+=s,this._updateUIResultsCount())}_extractText(){if(this._extractTextPromises.length>0)return;let e=Promise.resolve();for(let t=0,r=this._linkService.pagesCount;tthis._pdfDocument.getPage(t+1).then((e=>e.getTextContent({normalizeWhitespace:!0}))).then((e=>{const i=e.items,a=[];for(let e=0,t=i.length;e{console.error(`Unable to get text content for page ${t+1}`,e),this._pageContents[t]="",r.resolve(t)}))))}}_updatePage(e){this._scrollMatches&&this._selected.pageIdx===e&&(this._linkService.page=e+1),this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:e})}_updateAllPages(){this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:-1})}_nextMatch(){const e=this._state.findPrevious,t=this._linkService.page-1,r=this._linkService.pagesCount;if(this._highlightMatches=!0,this._dirtyMatch){this._dirtyMatch=!1,this._selected.pageIdx=this._selected.matchIdx=-1,this._offset.pageIdx=t,this._offset.matchIdx=null,this._offset.wrapped=!1,this._resumePageIdx=null,this._pageMatches.length=0,this._pageMatchesLength.length=0,this._matchesCountTotal=0,this._updateAllPages();for(let e=0;e{delete this._pendingFindMatches[e],this._calculateMatch(e)})))}if(""===this._query)return void this._updateUIState(s.FOUND);if(this._resumePageIdx)return;const i=this._offset;if(this._pagesToSearch=r,null!==i.matchIdx){const t=this._pageMatches[i.pageIdx].length;if(!e&&i.matchIdx+10)return i.matchIdx=e?i.matchIdx-1:i.matchIdx+1,void this._updateMatch(!0);this._advanceOffsetPage(e)}this._nextPageMatch()}_matchesReady(e){const t=this._offset,r=e.length,i=this._state.findPrevious;return r?(t.matchIdx=i?r-1:0,this._updateMatch(!0),!0):(this._advanceOffsetPage(i),!!(t.wrapped&&(t.matchIdx=null,this._pagesToSearch<0))&&(this._updateMatch(!1),!0))}_nextPageMatch(){null!==this._resumePageIdx&&console.error("There can only be one pending page.");let e=null;do{const t=this._offset.pageIdx;if(e=this._pageMatches[t],!e){this._resumePageIdx=t;break}}while(!this._matchesReady(e))}_advanceOffsetPage(e){const t=this._offset,r=this._linkService.pagesCount;t.pageIdx=e?t.pageIdx-1:t.pageIdx+1,t.matchIdx=null,this._pagesToSearch--,(t.pageIdx>=r||t.pageIdx<0)&&(t.pageIdx=e?r-1:0,t.wrapped=!0)}_updateMatch(e=!1){let t=s.NOT_FOUND;const r=this._offset.wrapped;if(this._offset.wrapped=!1,e){const e=this._selected.pageIdx;this._selected.pageIdx=this._offset.pageIdx,this._selected.matchIdx=this._offset.matchIdx,t=r?s.WRAPPED:s.FOUND,-1!==e&&e!==this._selected.pageIdx&&this._updatePage(e)}this._updateUIState(t,this._state.findPrevious),-1!==this._selected.pageIdx&&(this._scrollMatches=!0,this._updatePage(this._selected.pageIdx))}_onFindBarClose(e){const t=this._pdfDocument;this._firstPageCapability.promise.then((()=>{!this._pdfDocument||t&&this._pdfDocument!==t||(this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),this._resumePageIdx&&(this._resumePageIdx=null,this._dirtyMatch=!0),this._updateUIState(s.FOUND),this._highlightMatches=!1,this._updateAllPages())}))}_requestMatchesCount(){const{pageIdx:e,matchIdx:t}=this._selected;let r=0,i=this._matchesCountTotal;if(-1!==t){for(let t=0;ti)&&(r=i=0),{current:r,total:i}}_updateUIResultsCount(){this._eventBus.dispatch("updatefindmatchescount",{source:this,matchesCount:this._requestMatchesCount()})}_updateUIState(e,t){this._eventBus.dispatch("updatefindcontrolstate",{source:this,state:e,previous:t,matchesCount:this._requestMatchesCount()})}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCharacterType=function(e){return function(e){return e<11904}(e)?function(e){return 0==(65408&e)}(e)?function(e){return 32===e||9===e||13===e||10===e}(e)?i.SPACE:function(e){return e>=97&&e<=122||e>=65&&e<=90}(e)||function(e){return e>=48&&e<=57}(e)||95===e?i.ALPHA_LETTER:i.PUNCT:function(e){return 3584==(65408&e)}(e)?i.THAI_LETTER:160===e?i.SPACE:i.ALPHA_LETTER:function(e){return e>=13312&&e<=40959||e>=63744&&e<=64255}(e)?i.HAN_LETTER:function(e){return e>=12448&&e<=12543}(e)?i.KATAKANA_LETTER:function(e){return e>=12352&&e<=12447}(e)?i.HIRAGANA_LETTER:function(e){return e>=65376&&e<=65439}(e)?i.HALFWIDTH_KATAKANA_LETTER:i.ALPHA_LETTER},t.CharacterType=void 0;const i={SPACE:0,ALPHA_LETTER:1,PUNCT:2,HAN_LETTER:3,KATAKANA_LETTER:4,HIRAGANA_LETTER:5,HALFWIDTH_KATAKANA_LETTER:6,THAI_LETTER:7};t.CharacterType=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDestHashesEqual=n,t.isDestArraysEqual=s,t.PDFHistory=void 0;var i=r(3);function a(){return document.location.hash}function n(e,t){if("string"!=typeof e||"string"!=typeof t)return!1;if(e===t)return!0;const{nameddest:r}=(0,i.parseQueryString)(e);return r===t}function s(e,t){function r(e,t){if(typeof e!=typeof t)return!1;if(Array.isArray(e)||Array.isArray(t))return!1;if(null!==e&&"object"==typeof e&&null!==t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!r(e[i],t[i]))return!1;return!0}return e===t||Number.isNaN(e)&&Number.isNaN(t)}if(!Array.isArray(e)||!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(let i=0,a=e.length;i{this._isViewerInPresentationMode=e.active||e.switchInProgress})),this.eventBus._on("pagesinit",(()=>{this._isPagesLoaded=!1;const e=t=>{this.eventBus._off("pagesloaded",e),this._isPagesLoaded=!!t.pagesCount};this.eventBus._on("pagesloaded",e)}))}initialize({fingerprint:e,resetHistory:t=!1,updateUrl:r=!1}){if(!e||"string"!=typeof e)return void console.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.');this._initialized&&this.reset();const i=""!==this._fingerprint&&this._fingerprint!==e;this._fingerprint=e,this._updateUrl=!0===r,this._initialized=!0,this._bindEvents();const n=window.history.state;if(this._popStateInProgress=!1,this._blockHashChange=0,this._currentHash=a(),this._numPositionUpdates=0,this._uid=this._maxUid=0,this._destination=null,this._position=null,!this._isValidState(n,!0)||t){const{hash:e,page:r,rotation:a}=this._parseCurrentHash(!0);return!e||i||t?void this._pushOrReplaceState(null,!0):void this._pushOrReplaceState({hash:e,page:r,rotation:a},!0)}const s=n.destination;this._updateInternalState(s,n.uid,!0),this._uid>this._maxUid&&(this._maxUid=this._uid),void 0!==s.rotation&&(this._initialRotation=s.rotation),s.dest?(this._initialBookmark=JSON.stringify(s.dest),this._destination.page=null):s.hash?this._initialBookmark=s.hash:s.page&&(this._initialBookmark=`page=${s.page}`)}reset(){this._initialized&&(this._pageHide(),this._initialized=!1,this._unbindEvents()),this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._initialBookmark=null,this._initialRotation=null}push({namedDest:e=null,explicitDest:t,pageNumber:r}){if(!this._initialized)return;if(e&&"string"!=typeof e)return void console.error(`PDFHistory.push: "${e}" is not a valid namedDest parameter.`);if(!Array.isArray(t))return void console.error(`PDFHistory.push: "${t}" is not a valid explicitDest parameter.`);if(!(Number.isInteger(r)&&r>0&&r<=this.linkService.pagesCount)&&(null!==r||this._destination))return void console.error(`PDFHistory.push: "${r}" is not a valid pageNumber parameter.`);const i=e||JSON.stringify(t);if(!i)return;let a=!1;if(this._destination&&(n(this._destination.hash,i)||s(this._destination.dest,t))){if(this._destination.page)return;a=!0}this._popStateInProgress&&!a||(this._pushOrReplaceState({dest:t,hash:i,page:r,rotation:this.linkService.rotation},a),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then((()=>{this._popStateInProgress=!1}))))}pushCurrentPosition(){this._initialized&&!this._popStateInProgress&&this._tryPushCurrentPosition()}back(){if(!this._initialized||this._popStateInProgress)return;const e=window.history.state;this._isValidState(e)&&e.uid>0&&window.history.back()}forward(){if(!this._initialized||this._popStateInProgress)return;const e=window.history.state;this._isValidState(e)&&e.uid0)}get initialBookmark(){return this._initialized?this._initialBookmark:null}get initialRotation(){return this._initialized?this._initialRotation:null}_pushOrReplaceState(e,t=!1){const r=t||!this._destination,i={fingerprint:this._fingerprint,uid:r?this._uid:this._uid+1,destination:e};let a;if(this._updateInternalState(e,i.uid),this._updateUrl&&e&&e.hash){const t=document.location.href.split("#")[0];t.startsWith("file://")||(a=`${t}#${e.hash}`)}r?window.history.replaceState(i,"",a):(this._maxUid=this._uid,window.history.pushState(i,"",a))}_tryPushCurrentPosition(e=!1){if(!this._position)return;let t=this._position;if(e&&(t=Object.assign(Object.create(null),this._position),t.temporary=!0),!this._destination)return void this._pushOrReplaceState(t);if(this._destination.temporary)return void this._pushOrReplaceState(t,!0);if(this._destination.hash===t.hash)return;if(!this._destination.page&&this._numPositionUpdates<=50)return;let r=!1;if(this._destination.page>=t.first&&this._destination.page<=t.page){if(this._destination.dest||!this._destination.first)return;r=!0}this._pushOrReplaceState(t,r)}_isValidState(e,t=!1){if(!e)return!1;if(e.fingerprint!==this._fingerprint){if(!t)return!1;{if("string"!=typeof e.fingerprint||e.fingerprint.length!==this._fingerprint.length)return!1;const[t]=performance.getEntriesByType("navigation");if(!t||"reload"!==t.type)return!1}}return!(!Number.isInteger(e.uid)||e.uid<0)&&null!==e.destination&&"object"==typeof e.destination}_updateInternalState(e,t,r=!1){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),r&&e&&e.temporary&&delete e.temporary,this._destination=e,this._uid=t,this._numPositionUpdates=0}_parseCurrentHash(e=!1){const t=unescape(a()).substring(1),r=(0,i.parseQueryString)(t),n=r.nameddest||"";let s=0|r.page;return Number.isInteger(s)&&s>0&&s<=this.linkService.pagesCount&&!(e&&n.length>0)||(s=null),{hash:t,page:s,rotation:this.linkService.rotation}}_updateViewarea({location:e}){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._position={hash:this._isViewerInPresentationMode?`page=${e.pageNumber}`:e.pdfOpenParams.substring(1),page:this.linkService.page,first:e.pageNumber,rotation:e.rotation},this._popStateInProgress||(this._isPagesLoaded&&this._destination&&!this._destination.page&&this._numPositionUpdates++,this._updateViewareaTimeout=setTimeout((()=>{this._popStateInProgress||this._tryPushCurrentPosition(!0),this._updateViewareaTimeout=null}),1e3))}_popState({state:e}){const t=a(),r=this._currentHash!==t;if(this._currentHash=t,!e){this._uid++;const{hash:e,page:t,rotation:r}=this._parseCurrentHash();return void this._pushOrReplaceState({hash:e,page:t,rotation:r},!0)}if(!this._isValidState(e))return;this._popStateInProgress=!0,r&&(this._blockHashChange++,(0,i.waitOnEventOrTimeout)({target:window,name:"hashchange",delay:1e3}).then((()=>{this._blockHashChange--})));const n=e.destination;this._updateInternalState(n,e.uid,!0),this._uid>this._maxUid&&(this._maxUid=this._uid),(0,i.isValidRotation)(n.rotation)&&(this.linkService.rotation=n.rotation),n.dest?this.linkService.navigateTo(n.dest):n.hash?this.linkService.setHash(n.hash):n.page&&(this.linkService.page=n.page),Promise.resolve().then((()=>{this._popStateInProgress=!1}))}_pageHide(){this._destination&&!this._destination.temporary||this._tryPushCurrentPosition()}_bindEvents(){this._boundEvents||(this._boundEvents={updateViewarea:this._updateViewarea.bind(this),popState:this._popState.bind(this),pageHide:this._pageHide.bind(this)},this.eventBus._on("updateviewarea",this._boundEvents.updateViewarea),window.addEventListener("popstate",this._boundEvents.popState),window.addEventListener("pagehide",this._boundEvents.pageHide))}_unbindEvents(){this._boundEvents&&(this.eventBus._off("updateviewarea",this._boundEvents.updateViewarea),window.removeEventListener("popstate",this._boundEvents.popState),window.removeEventListener("pagehide",this._boundEvents.pageHide),this._boundEvents=null)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFPageView=void 0;var i=r(3),a=r(2),n=r(14);const s=r(7).viewerCompatibilityParams.maxCanvasPixels||16777216;t.PDFPageView=class{constructor(e){const t=e.container,r=e.defaultViewport;this.id=e.id,this.renderingId="page"+this.id,this.pdfPage=null,this.pageLabel=null,this.rotation=0,this.scale=e.scale||i.DEFAULT_SCALE,this.viewport=r,this.pdfPageRotate=r.rotation,this.hasRestrictedScaling=!1,this.textLayerMode=Number.isInteger(e.textLayerMode)?e.textLayerMode:i.TextLayerMode.ENABLE,this.imageResourcesPath=e.imageResourcesPath||"",this.renderInteractiveForms=e.renderInteractiveForms||!1,this.useOnlyCssZoom=e.useOnlyCssZoom||!1,this.maxCanvasPixels=e.maxCanvasPixels||s,this.eventBus=e.eventBus,this.renderingQueue=e.renderingQueue,this.textLayerFactory=e.textLayerFactory,this.annotationLayerFactory=e.annotationLayerFactory,this.renderer=e.renderer||i.RendererType.CANVAS,this.enableWebGL=e.enableWebGL||!1,this.l10n=e.l10n||i.NullL10n,this.paintTask=null,this.paintedViewportMap=new WeakMap,this.renderingState=n.RenderingStates.INITIAL,this.resume=null,this.error=null,this.annotationLayer=null,this.textLayer=null,this.zoomLayer=null;const a=document.createElement("div");a.className="page",a.style.width=Math.floor(this.viewport.width)+"px",a.style.height=Math.floor(this.viewport.height)+"px",a.setAttribute("data-page-number",this.id),this.div=a,t.appendChild(a)}setPdfPage(e){this.pdfPage=e,this.pdfPageRotate=e.rotate;const t=(this.rotation+this.pdfPageRotate)%360;this.viewport=e.getViewport({scale:this.scale*i.CSS_UNITS,rotation:t}),this.stats=e.stats,this.reset()}destroy(){this.reset(),this.pdfPage&&this.pdfPage.cleanup()}_resetZoomLayer(e=!1){if(!this.zoomLayer)return;const t=this.zoomLayer.firstChild;this.paintedViewportMap.delete(t),t.width=0,t.height=0,e&&this.zoomLayer.remove(),this.zoomLayer=null}reset(e=!1,t=!1){this.cancelRendering(t),this.renderingState=n.RenderingStates.INITIAL;const r=this.div;r.style.width=Math.floor(this.viewport.width)+"px",r.style.height=Math.floor(this.viewport.height)+"px";const i=r.childNodes,a=e&&this.zoomLayer||null,s=t&&this.annotationLayer&&this.annotationLayer.div||null;for(let e=i.length-1;e>=0;e--){const t=i[e];a!==t&&s!==t&&r.removeChild(t)}r.removeAttribute("data-loaded"),s?this.annotationLayer.hide():this.annotationLayer&&(this.annotationLayer.cancel(),this.annotationLayer=null),a||(this.canvas&&(this.paintedViewportMap.delete(this.canvas),this.canvas.width=0,this.canvas.height=0,delete this.canvas),this._resetZoomLayer()),this.svg&&(this.paintedViewportMap.delete(this.svg),delete this.svg),this.loadingIconDiv=document.createElement("div"),this.loadingIconDiv.className="loadingIcon",r.appendChild(this.loadingIconDiv)}update(e,t){this.scale=e||this.scale,void 0!==t&&(this.rotation=t);const r=(this.rotation+this.pdfPageRotate)%360;if(this.viewport=this.viewport.clone({scale:this.scale*i.CSS_UNITS,rotation:r}),this.svg)return this.cssTransform(this.svg,!0),void this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!0,timestamp:performance.now()});let a=!1;if(this.canvas&&this.maxCanvasPixels>0){const e=this.outputScale;(Math.floor(this.viewport.width)*e.sx|0)*(Math.floor(this.viewport.height)*e.sy|0)>this.maxCanvasPixels&&(a=!0)}if(this.canvas){if(this.useOnlyCssZoom||this.hasRestrictedScaling&&a)return this.cssTransform(this.canvas,!0),void this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!0,timestamp:performance.now()});this.zoomLayer||this.canvas.hasAttribute("hidden")||(this.zoomLayer=this.canvas.parentNode,this.zoomLayer.style.position="absolute")}this.zoomLayer&&this.cssTransform(this.zoomLayer.firstChild),this.reset(!0,!0)}cancelRendering(e=!1){this.paintTask&&(this.paintTask.cancel(),this.paintTask=null),this.resume=null,this.textLayer&&(this.textLayer.cancel(),this.textLayer=null),!e&&this.annotationLayer&&(this.annotationLayer.cancel(),this.annotationLayer=null)}cssTransform(e,t=!1){const r=this.viewport.width,i=this.viewport.height,a=this.div;e.style.width=e.parentNode.style.width=a.style.width=Math.floor(r)+"px",e.style.height=e.parentNode.style.height=a.style.height=Math.floor(i)+"px";const n=this.viewport.rotation-this.paintedViewportMap.get(e).rotation,s=Math.abs(n);let o=1,l=1;90!==s&&270!==s||(o=i/r,l=r/i);const c="rotate("+n+"deg) scale("+o+","+l+")";if(e.style.transform=c,this.textLayer){const e=this.textLayer.viewport,t=this.viewport.rotation-e.rotation,i=Math.abs(t);let a=r/e.width;90!==i&&270!==i||(a=r/e.height);const n=this.textLayer.textLayerDiv;let s,o;switch(i){case 0:s=o=0;break;case 90:s=0,o="-"+n.style.height;break;case 180:s="-"+n.style.width,o="-"+n.style.height;break;case 270:s="-"+n.style.width,o=0;break;default:console.error("Bad rotation value.")}n.style.transform="rotate("+i+"deg) scale("+a+", "+a+") translate("+s+", "+o+")",n.style.transformOrigin="0% 0%"}t&&this.annotationLayer&&this.annotationLayer.render(this.viewport,"display")}get width(){return this.viewport.width}get height(){return this.viewport.height}getPagePoint(e,t){return this.viewport.convertToPdfPoint(e,t)}draw(){this.renderingState!==n.RenderingStates.INITIAL&&(console.error("Must be in new state before drawing"),this.reset());const{div:e,pdfPage:t}=this;if(!t)return this.renderingState=n.RenderingStates.FINISHED,this.loadingIconDiv&&(e.removeChild(this.loadingIconDiv),delete this.loadingIconDiv),Promise.reject(new Error("pdfPage is not loaded"));this.renderingState=n.RenderingStates.RUNNING;const r=document.createElement("div");r.style.width=e.style.width,r.style.height=e.style.height,r.classList.add("canvasWrapper"),this.annotationLayer&&this.annotationLayer.div?e.insertBefore(r,this.annotationLayer.div):e.appendChild(r);let s=null;if(this.textLayerMode!==i.TextLayerMode.DISABLE&&this.textLayerFactory){const t=document.createElement("div");t.className="textLayer",t.style.width=r.style.width,t.style.height=r.style.height,this.annotationLayer&&this.annotationLayer.div?e.insertBefore(t,this.annotationLayer.div):e.appendChild(t),s=this.textLayerFactory.createTextLayerBuilder(t,this.id-1,this.viewport,this.textLayerMode===i.TextLayerMode.ENABLE_ENHANCE,this.eventBus)}this.textLayer=s;let o=null;this.renderingQueue&&(o=e=>{if(!this.renderingQueue.isHighestPriority(this))return this.renderingState=n.RenderingStates.PAUSED,void(this.resume=()=>{this.renderingState=n.RenderingStates.RUNNING,e()});e()});const l=async r=>{if(c===this.paintTask&&(this.paintTask=null),r instanceof a.RenderingCancelledException)this.error=null;else if(this.renderingState=n.RenderingStates.FINISHED,this.loadingIconDiv&&(e.removeChild(this.loadingIconDiv),delete this.loadingIconDiv),this._resetZoomLayer(!0),this.error=r,this.stats=t.stats,this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!1,timestamp:performance.now()}),r)throw r},c=this.renderer===i.RendererType.SVG?this.paintOnSvg(r):this.paintOnCanvas(r);c.onRenderContinue=o,this.paintTask=c;const u=c.promise.then((function(){return l(null).then((function(){if(s){const e=t.streamTextContent({normalizeWhitespace:!0});s.setTextContentStream(e),s.render()}}))}),(function(e){return l(e)}));return this.annotationLayerFactory&&(this.annotationLayer||(this.annotationLayer=this.annotationLayerFactory.createAnnotationLayerBuilder(e,t,this.imageResourcesPath,this.renderInteractiveForms,this.l10n)),this.annotationLayer.render(this.viewport,"display")),e.setAttribute("data-loaded",!0),this.eventBus.dispatch("pagerender",{source:this,pageNumber:this.id}),u}paintOnCanvas(e){const t=(0,a.createPromiseCapability)(),r={promise:t.promise,onRenderContinue(e){e()},cancel(){p.cancel()}},n=this.viewport,s=document.createElement("canvas");this.l10n.get("page_canvas",{page:this.id},"Page {{page}}").then((e=>{s.setAttribute("aria-label",e)})),s.setAttribute("hidden","hidden");let o=!0;const l=function(){o&&(s.removeAttribute("hidden"),o=!1)};e.appendChild(s),this.canvas=s,s.mozOpaque=!0;const c=s.getContext("2d",{alpha:!1}),u=(0,i.getOutputScale)(c);if(this.outputScale=u,this.useOnlyCssZoom){const e=n.clone({scale:i.CSS_UNITS});u.sx*=e.width/n.width,u.sy*=e.height/n.height,u.scaled=!0}if(this.maxCanvasPixels>0){const e=n.width*n.height,t=Math.sqrt(this.maxCanvasPixels/e);u.sx>t||u.sy>t?(u.sx=t,u.sy=t,u.scaled=!0,this.hasRestrictedScaling=!0):this.hasRestrictedScaling=!1}const d=(0,i.approximateFraction)(u.sx),h=(0,i.approximateFraction)(u.sy);s.width=(0,i.roundToDivide)(n.width*u.sx,d[0]),s.height=(0,i.roundToDivide)(n.height*u.sy,h[0]),s.style.width=(0,i.roundToDivide)(n.width,d[1])+"px",s.style.height=(0,i.roundToDivide)(n.height,h[1])+"px",this.paintedViewportMap.set(s,n);const f={canvasContext:c,transform:u.scaled?[u.sx,0,0,u.sy,0,0]:null,viewport:this.viewport,enableWebGL:this.enableWebGL,renderInteractiveForms:this.renderInteractiveForms},p=this.pdfPage.render(f);return p.onContinue=function(e){l(),r.onRenderContinue?r.onRenderContinue(e):e()},p.promise.then((function(){l(),t.resolve(void 0)}),(function(e){l(),t.reject(e)})),r}paintOnSvg(e){let t=!1;const r=()=>{if(t)throw new a.RenderingCancelledException(`Rendering cancelled, page ${this.id}`,"svg")},s=this.pdfPage,o=this.viewport.clone({scale:i.CSS_UNITS});return{promise:s.getOperatorList().then((t=>(r(),new a.SVGGraphics(s.commonObjs,s.objs).getSVG(t,o).then((t=>{r(),this.svg=t,this.paintedViewportMap.set(t,o),t.style.width=e.style.width,t.style.height=e.style.height,this.renderingState=n.RenderingStates.FINISHED,e.appendChild(t)}))))),onRenderContinue(e){e()},cancel(){t=!0}}}setPageLabel(e){this.pageLabel="string"==typeof e?e:null,null!==this.pageLabel?this.div.setAttribute("data-page-label",this.pageLabel):this.div.removeAttribute("data-page-label")}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFRenderingQueue=t.RenderingStates=void 0;const i={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3};t.RenderingStates=i,t.PDFRenderingQueue=class{constructor(){this.pdfViewer=null,this.pdfThumbnailViewer=null,this.onIdle=null,this.highestPriorityPage=null,this.idleTimeout=null,this.printing=!1,this.isThumbnailViewEnabled=!1}setViewer(e){this.pdfViewer=e}setThumbnailViewer(e){this.pdfThumbnailViewer=e}isHighestPriority(e){return this.highestPriorityPage===e.renderingId}renderHighestPriority(e){this.idleTimeout&&(clearTimeout(this.idleTimeout),this.idleTimeout=null),this.pdfViewer.forceRendering(e)||this.pdfThumbnailViewer&&this.isThumbnailViewEnabled&&this.pdfThumbnailViewer.forceRendering()||this.printing||this.onIdle&&(this.idleTimeout=setTimeout(this.onIdle.bind(this),3e4))}getHighestPriority(e,t,r){const i=e.views,a=i.length;if(0===a)return null;for(let e=0;e{this.renderHighestPriority()})).catch((e=>{console.error(`renderView: "${e}"`)}))}return!0}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFSinglePageViewer=void 0;var i=r(16),a=r(2);class n extends i.BaseViewer{constructor(e){super(e),this.eventBus._on("pagesinit",(e=>{this._ensurePageViewVisible()}))}get _viewerElement(){return(0,a.shadow)(this,"_viewerElement",this._shadowViewer)}_resetView(){super._resetView(),this._previousPageNumber=1,this._shadowViewer=document.createDocumentFragment(),this._updateScrollDown=null}_ensurePageViewVisible(){const e=this._pages[this._currentPageNumber-1],t=this._pages[this._previousPageNumber-1],r=this.viewer.childNodes;switch(r.length){case 0:this.viewer.appendChild(e.div);break;case 1:if(r[0]!==t.div)throw new Error("_ensurePageViewVisible: Unexpected previously visible page.");if(e===t)break;this._shadowViewer.appendChild(t.div),this.viewer.appendChild(e.div),this.container.scrollTop=0;break;default:throw new Error("_ensurePageViewVisible: Only one page should be visible at a time.")}this._previousPageNumber=this._currentPageNumber}_scrollUpdate(){this._updateScrollDown&&this._updateScrollDown(),super._scrollUpdate()}_scrollIntoView({pageDiv:e,pageSpot:t=null,pageNumber:r=null}){r&&this._setCurrentPageNumber(r);const i=this._currentPageNumber>=this._previousPageNumber;this._ensurePageViewVisible(),this.update(),super._scrollIntoView({pageDiv:e,pageSpot:t,pageNumber:r}),this._updateScrollDown=()=>{this.scroll.down=i,this._updateScrollDown=null}}_getVisiblePages(){return this._getCurrentVisiblePage()}_updateHelper(e){}get _isScrollModeHorizontal(){return(0,a.shadow)(this,"_isScrollModeHorizontal",!1)}_updateScrollMode(){}_updateSpreadMode(){}}t.PDFSinglePageViewer=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseViewer=void 0;var i=r(3),a=r(14),n=r(1),s=r(2),o=r(13),l=r(4),c=r(5);function u(e){const t=[];this.push=function(r){const i=t.indexOf(r);i>=0&&t.splice(i,1),t.push(r),t.length>e&&t.shift().destroy()},this.resize=function(r,a){if(e=r,a){const e=new Set;for(let t=0,r=a.length;te;)t.shift().destroy()}}class d{constructor(e){if(this.constructor===d)throw new Error("Cannot initialize BaseViewer.");this._name=this.constructor.name,this.container=e.container,this.viewer=e.viewer||e.container.firstElementChild,this.eventBus=e.eventBus,this.linkService=e.linkService||new l.SimpleLinkService,this.downloadManager=e.downloadManager||null,this.findController=e.findController||null,this.removePageBorders=e.removePageBorders||!1,this.textLayerMode=Number.isInteger(e.textLayerMode)?e.textLayerMode:i.TextLayerMode.ENABLE,this.imageResourcesPath=e.imageResourcesPath||"",this.renderInteractiveForms=e.renderInteractiveForms||!1,this.enablePrintAutoRotate=e.enablePrintAutoRotate||!1,this.renderer=e.renderer||i.RendererType.CANVAS,this.enableWebGL=e.enableWebGL||!1,this.useOnlyCssZoom=e.useOnlyCssZoom||!1,this.maxCanvasPixels=e.maxCanvasPixels,this.l10n=e.l10n||i.NullL10n,this.defaultRenderingQueue=!e.renderingQueue,this.defaultRenderingQueue?(this.renderingQueue=new a.PDFRenderingQueue,this.renderingQueue.setViewer(this)):this.renderingQueue=e.renderingQueue,this.scroll=(0,i.watchScroll)(this.container,this._scrollUpdate.bind(this)),this.presentationModeState=i.PresentationModeState.UNKNOWN,this._onBeforeDraw=this._onAfterDraw=null,this._resetView(),this.removePageBorders&&this.viewer.classList.add("removePageBorders"),Promise.resolve().then((()=>{this.eventBus.dispatch("baseviewerinit",{source:this})}))}get pagesCount(){return this._pages.length}getPageView(e){return this._pages[e]}get pageViewsReady(){return!!this._pagesCapability.settled&&this._pages.every((function(e){return e&&e.pdfPage}))}get currentPageNumber(){return this._currentPageNumber}set currentPageNumber(e){if(!Number.isInteger(e))throw new Error("Invalid page number.");this.pdfDocument&&(this._setCurrentPageNumber(e,!0)||console.error(`${this._name}.currentPageNumber: "${e}" is not a valid page.`))}_setCurrentPageNumber(e,t=!1){return this._currentPageNumber===e?(t&&this._resetCurrentPageView(),!0):0=0&&(t=r+1)}this._setCurrentPageNumber(t,!0)||console.error(`${this._name}.currentPageLabel: "${e}" is not a valid page.`)}get currentScale(){return this._currentScale!==i.UNKNOWN_SCALE?this._currentScale:i.DEFAULT_SCALE}set currentScale(e){if(isNaN(e))throw new Error("Invalid numeric scale.");this.pdfDocument&&this._setScale(e,!1)}get currentScaleValue(){return this._currentScaleValue}set currentScaleValue(e){this.pdfDocument&&this._setScale(e,!1)}get pagesRotation(){return this._pagesRotation}set pagesRotation(e){if(!(0,i.isValidRotation)(e))throw new Error("Invalid pages rotation angle.");if(!this.pdfDocument)return;if(this._pagesRotation===e)return;this._pagesRotation=e;const t=this._currentPageNumber;for(let t=0,r=this._pages.length;t{this.eventBus.dispatch("pagesloaded",{source:this,pagesCount:t})})),this._onBeforeDraw=e=>{const t=this._pages[e.pageNumber-1];t&&this._buffer.push(t)},this.eventBus._on("pagerender",this._onBeforeDraw),this._onAfterDraw=e=>{e.cssTransform||this._onePageRenderedCapability.settled||(this._onePageRenderedCapability.resolve(),this.eventBus._off("pagerendered",this._onAfterDraw),this._onAfterDraw=null)},this.eventBus._on("pagerendered",this._onAfterDraw),r.then((r=>{this._firstPageCapability.resolve(r);const a=this.currentScale,n=r.getViewport({scale:a*i.CSS_UNITS}),s=this.textLayerMode!==i.TextLayerMode.DISABLE?this:null;for(let e=1;e<=t;++e){const t=new o.PDFPageView({container:this._viewerElement,eventBus:this.eventBus,id:e,scale:a,defaultViewport:n.clone(),renderingQueue:this.renderingQueue,textLayerFactory:s,textLayerMode:this.textLayerMode,annotationLayerFactory:this,imageResourcesPath:this.imageResourcesPath,renderInteractiveForms:this.renderInteractiveForms,renderer:this.renderer,enableWebGL:this.enableWebGL,useOnlyCssZoom:this.useOnlyCssZoom,maxCanvasPixels:this.maxCanvasPixels,l10n:this.l10n});this._pages.push(t)}const l=this._pages[0];l&&(l.setPdfPage(r),this.linkService.cachePageRef(1,r.ref)),this._spreadMode!==i.SpreadMode.NONE&&this._updateSpreadMode(),this._onePageRenderedOrForceFetch().then((()=>{if(this.findController&&this.findController.setDocument(e),e.loadingParams.disableAutoFetch||t>7500)return void this._pagesCapability.resolve();let r=t-1;if(r<=0)this._pagesCapability.resolve();else for(let i=2;i<=t;++i)e.getPage(i).then((e=>{const t=this._pages[i-1];t.pdfPage||t.setPdfPage(e),this.linkService.cachePageRef(i,e.ref),0==--r&&this._pagesCapability.resolve()}),(e=>{console.error(`Unable to get page ${i} to initialize viewer`,e),0==--r&&this._pagesCapability.resolve()}))})),this.eventBus.dispatch("pagesinit",{source:this}),this.defaultRenderingQueue&&this.update()})).catch((e=>{console.error("Unable to initialize viewer",e)}))}setPageLabels(e){if(this.pdfDocument){e?Array.isArray(e)&&this.pdfDocument.numPages===e.length?this._pageLabels=e:(this._pageLabels=null,console.error(`${this._name}.setPageLabels: Invalid page labels.`)):this._pageLabels=null;for(let e=0,t=this._pages.length;e0)this._setScaleUpdatePages(r,e,t,!1);else{const a=this._pages[this._currentPageNumber-1];if(!a)return;const n=this.isInPresentationMode||this.removePageBorders;let s=n?0:i.SCROLLBAR_PADDING,o=n?0:i.VERTICAL_PADDING;!n&&this._isScrollModeHorizontal&&([s,o]=[o,s]);const l=(this.container.clientWidth-s)/a.width*a.scale,c=(this.container.clientHeight-o)/a.height*a.scale;switch(e){case"page-actual":r=1;break;case"page-width":r=l;break;case"page-height":r=c;break;case"page-fit":r=Math.min(l,c);break;case"auto":const t=(0,i.isPortraitOrientation)(a)?l:Math.min(c,l);r=Math.min(i.MAX_AUTO_SCALE,t);break;default:return void console.error(`${this._name}._setScale: "${e}" is an unknown zoom value.`)}this._setScaleUpdatePages(r,e,t,!0)}}_resetCurrentPageView(){this.isInPresentationMode&&this._setScale(this._currentScaleValue,!0);const e=this._pages[this._currentPageNumber-1];this._scrollIntoView({pageDiv:e.div})}scrollPageIntoView({pageNumber:e,destArray:t=null,allowNegativeOffset:r=!1,ignoreDestinationZoom:a=!1}){if(!this.pdfDocument)return;const n=Number.isInteger(e)&&this._pages[e-1];if(!n)return void console.error(`${this._name}.scrollPageIntoView: "${e}" is not a valid pageNumber parameter.`);if(this.isInPresentationMode||!t)return void this._setCurrentPageNumber(e,!0);let s,o,l=0,c=0,u=0,d=0;const h=n.rotation%180!=0,f=(h?n.height:n.width)/n.scale/i.CSS_UNITS,p=(h?n.width:n.height)/n.scale/i.CSS_UNITS;let g=0;switch(t[1].name){case"XYZ":l=t[2],c=t[3],g=t[4],l=null!==l?l:0,c=null!==c?c:p;break;case"Fit":case"FitB":g="page-fit";break;case"FitH":case"FitBH":c=t[2],g="page-width",null===c&&this._location&&(l=this._location.left,c=this._location.top);break;case"FitV":case"FitBV":l=t[2],u=f,d=p,g="page-height";break;case"FitR":l=t[2],c=t[3],u=t[4]-l,d=t[5]-c;const e=this.removePageBorders?0:i.SCROLLBAR_PADDING,r=this.removePageBorders?0:i.VERTICAL_PADDING;s=(this.container.clientWidth-e)/u/i.CSS_UNITS,o=(this.container.clientHeight-r)/d/i.CSS_UNITS,g=Math.min(Math.abs(s),Math.abs(o));break;default:return void console.error(`${this._name}.scrollPageIntoView: "${t[1].name}" is not a valid destination type.`)}if(a||(g&&g!==this._currentScale?this.currentScaleValue=g:this._currentScale===i.UNKNOWN_SCALE&&(this.currentScaleValue=i.DEFAULT_SCALE_VALUE)),"page-fit"===g&&!t[4])return void this._scrollIntoView({pageDiv:n.div,pageNumber:e});const m=[n.viewport.convertToViewportPoint(l,c),n.viewport.convertToViewportPoint(l+u,c+d)];let b=Math.min(m[0][0],m[1][0]),v=Math.min(m[0][1],m[1][1]);r||(b=Math.max(b,0),v=Math.max(v,0)),this._scrollIntoView({pageDiv:n.div,pageSpot:{left:b,top:v},pageNumber:e})}_updateLocation(e){const t=this._currentScale,r=this._currentScaleValue,i=parseFloat(r)===t?Math.round(1e4*t)/100:r,a=e.id;let n="#page="+a;n+="&zoom="+i;const s=this._pages[a-1],o=this.container,l=s.getPagePoint(o.scrollLeft-e.x,o.scrollTop-e.y),c=Math.round(l[0]),u=Math.round(l[1]);n+=","+c+","+u,this._location={pageNumber:a,scale:i,top:u,left:c,rotation:this._pagesRotation,pdfOpenParams:n}}_updateHelper(e){throw new Error("Not implemented: _updateHelper")}update(){const e=this._getVisiblePages(),t=e.views,r=t.length;if(0===r)return;const i=Math.max(10,2*r+1);this._buffer.resize(i,t),this.renderingQueue.renderHighestPriority(e),this._updateHelper(t),this._updateLocation(e.first),this.eventBus.dispatch("updateviewarea",{source:this,location:this._location})}containsElement(e){return this.container.contains(e)}focus(){this.container.focus()}get _isScrollModeHorizontal(){return!this.isInPresentationMode&&this._scrollMode===i.ScrollMode.HORIZONTAL}get isInPresentationMode(){return this.presentationModeState===i.PresentationModeState.FULLSCREEN}get isChangingPresentationMode(){return this.presentationModeState===i.PresentationModeState.CHANGING}get isHorizontalScrollbarEnabled(){return!this.isInPresentationMode&&this.container.scrollWidth>this.container.clientWidth}get isVerticalScrollbarEnabled(){return!this.isInPresentationMode&&this.container.scrollHeight>this.container.clientHeight}_getCurrentVisiblePage(){if(!this.pagesCount)return{views:[]};const e=this._pages[this._currentPageNumber-1],t=e.div,r={id:e.id,x:t.offsetLeft+t.clientLeft,y:t.offsetTop+t.clientTop,view:e};return{first:r,last:r,views:[r]}}_getVisiblePages(){return(0,i.getVisibleElements)(this.container,this._pages,!0,this._isScrollModeHorizontal)}isPageVisible(e){return!!this.pdfDocument&&(e<1||e>this.pagesCount?(console.error(`${this._name}.isPageVisible: "${e}" is out of bounds.`),!1):this._getVisiblePages().views.some((function(t){return t.id===e})))}cleanup(){for(let e=0,t=this._pages.length;e(e.pdfPage||e.setPdfPage(t),this._pagesRequests.delete(e),t))).catch((t=>{console.error("Unable to get page for page view",t),this._pagesRequests.delete(e)}));return this._pagesRequests.set(e,t),t}forceRendering(e){const t=e||this._getVisiblePages(),r=this._isScrollModeHorizontal?this.scroll.right:this.scroll.down,i=this.renderingQueue.getHighestPriority(t,this._pages,r);return!!i&&(this._ensurePdfPageLoaded(i).then((()=>{this.renderingQueue.renderView(i)})),!0)}createTextLayerBuilder(e,t,r,i=!1,a){return new c.TextLayerBuilder({textLayerDiv:e,eventBus:a,pageIndex:t,viewport:r,findController:this.isInPresentationMode?null:this.findController,enhanceTextSelection:!this.isInPresentationMode&&i})}createAnnotationLayerBuilder(e,t,r="",a=!1,s=i.NullL10n){return new n.AnnotationLayerBuilder({pageDiv:e,pdfPage:t,imageResourcesPath:r,renderInteractiveForms:a,linkService:this.linkService,downloadManager:this.downloadManager,l10n:s})}get hasEqualPageSizes(){const e=this._pages[0];for(let t=1,r=this._pages.length;ta+n)&&(t={left:0,top:0})}super._scrollIntoView({pageDiv:e,pageSpot:t,pageNumber:r})}_getVisiblePages(){return this.isInPresentationMode?this._getCurrentVisiblePage():super._getVisiblePages()}_updateHelper(e){if(this.isInPresentationMode)return;let t=this._currentPageNumber,r=!1;for(const i of e){if(i.percent<100)break;if(i.id===t){r=!0;break}}r||(t=e[0].id),this._setCurrentPageNumber(t)}}t.PDFViewer=n}])},e.exports=i()},4479:(e,t,r)=>{"use strict";r.d(t,{C1:()=>n});function i(e){return null==e}function a(e){return Array.isArray(e)&&0===e.length}var n={validate:function(e,t){var r=(void 0===t?{allowFalse:!0}:t).allowFalse,n={valid:!1,required:!0};return i(e)||a(e)?n:!1!==e||r?(n.valid=!!String(e).trim().length,n):n},params:[{name:"allowFalse",default:!0}],computesRequired:!0}},9495:function(e,t,r){!function(e,t){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=r(t),a={code:"en",messages:{alpha:"The {_field_} field may only contain alphabetic characters",alpha_num:"The {_field_} field may only contain alpha-numeric characters",alpha_dash:"The {_field_} field may contain alpha-numeric characters as well as dashes and underscores",alpha_spaces:"The {_field_} field may only contain alphabetic characters as well as spaces",between:"The {_field_} field must be between {min} and {max}",confirmed:"The {_field_} field confirmation does not match",digits:"The {_field_} field must be numeric and exactly contain {length} digits",dimensions:"The {_field_} field must be {width} pixels by {height} pixels",email:"The {_field_} field must be a valid email",excluded:"The {_field_} field is not a valid value",ext:"The {_field_} field is not a valid file",image:"The {_field_} field must be an image",integer:"The {_field_} field must be an integer",length:"The {_field_} field must be {length} long",max_value:"The {_field_} field must be {max} or less",max:"The {_field_} field may not be greater than {length} characters",mimes:"The {_field_} field must have a valid file type",min_value:"The {_field_} field must be {min} or more",min:"The {_field_} field must be at least {length} characters",numeric:"The {_field_} field may only contain numeric characters",oneOf:"The {_field_} field is not a valid value",regex:"The {_field_} field format is invalid",required_if:"The {_field_} field is required",required:"The {_field_} field is required",size:"The {_field_} field size must be less than {size}KB",double:"The {_field_} field must be a valid decimal"}},n={en:/^[A-Z]*$/i,cs:/^[A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]*$/i,da:/^[A-ZÆØÅ]*$/i,de:/^[A-ZÄÖÜß]*$/i,es:/^[A-ZÁÉÍÑÓÚÜ]*$/i,fa:/^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰپژگچکی]*$/,fr:/^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]*$/i,it:/^[A-Z\xC0-\xFF]*$/i,lt:/^[A-ZĄČĘĖĮŠŲŪŽ]*$/i,nl:/^[A-ZÉËÏÓÖÜ]*$/i,hu:/^[A-ZÁÉÍÓÖŐÚÜŰ]*$/i,pl:/^[A-ZĄĆĘŚŁŃÓŻŹ]*$/i,pt:/^[A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]*$/i,ro:/^[A-ZĂÂÎŞŢ]*$/i,ru:/^[А-ЯЁ]*$/i,sk:/^[A-ZÁÄČĎÉÍĹĽŇÓŔŠŤÚÝŽ]*$/i,sr:/^[A-ZČĆŽŠĐ]*$/i,sv:/^[A-ZÅÄÖ]*$/i,tr:/^[A-ZÇĞİıÖŞÜ]*$/i,uk:/^[А-ЩЬЮЯЄІЇҐ]*$/i,ar:/^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]*$/,az:/^[A-ZÇƏĞİıÖŞÜ]*$/i,el:/^[Α-ώ]*$/i,ja:/^[A-Z\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\uFF00-\uFFEF\u4E00-\u9FAF]*$/i,he:/^[A-Z\u05D0-\u05EA']*$/i},s={en:/^[A-Z\s]*$/i,cs:/^[A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ\s]*$/i,da:/^[A-ZÆØÅ\s]*$/i,de:/^[A-ZÄÖÜß\s]*$/i,es:/^[A-ZÁÉÍÑÓÚÜ\s]*$/i,fa:/^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰپژگچکی]*$/,fr:/^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ\s]*$/i,it:/^[A-Z\xC0-\xFF\s]*$/i,lt:/^[A-ZĄČĘĖĮŠŲŪŽ\s]*$/i,nl:/^[A-ZÉËÏÓÖÜ\s]*$/i,hu:/^[A-ZÁÉÍÓÖŐÚÜŰ\s]*$/i,pl:/^[A-ZĄĆĘŚŁŃÓŻŹ\s]*$/i,pt:/^[A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ\s]*$/i,ro:/^[A-ZĂÂÎŞŢ\s]*$/i,ru:/^[А-ЯЁ\s]*$/i,sk:/^[A-ZÁÄČĎÉÍĹĽŇÓŔŠŤÚÝŽ\s]*$/i,sr:/^[A-ZČĆŽŠĐ\s]*$/i,sv:/^[A-ZÅÄÖ\s]*$/i,tr:/^[A-ZÇĞİıÖŞÜ\s]*$/i,uk:/^[А-ЩЬЮЯЄІЇҐ\s]*$/i,ar:/^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ\s]*$/,az:/^[A-ZÇƏĞİıÖŞÜ\s]*$/i,el:/^[Α-ώ\s]*$/i,ja:/^[A-Z\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\uFF00-\uFFEF\u4E00-\u9FAF\s]*$/i,he:/^[A-Z\u05D0-\u05EA'\s]*$/i},o={en:/^[0-9A-Z]*$/i,cs:/^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]*$/i,da:/^[0-9A-ZÆØÅ]$/i,de:/^[0-9A-ZÄÖÜß]*$/i,es:/^[0-9A-ZÁÉÍÑÓÚÜ]*$/i,fa:/^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰپژگچکی]*$/,fr:/^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]*$/i,it:/^[0-9A-Z\xC0-\xFF]*$/i,lt:/^[0-9A-ZĄČĘĖĮŠŲŪŽ]*$/i,hu:/^[0-9A-ZÁÉÍÓÖŐÚÜŰ]*$/i,nl:/^[0-9A-ZÉËÏÓÖÜ]*$/i,pl:/^[0-9A-ZĄĆĘŚŁŃÓŻŹ]*$/i,pt:/^[0-9A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]*$/i,ro:/^[0-9A-ZĂÂÎŞŢ]*$/i,ru:/^[0-9А-ЯЁ]*$/i,sk:/^[0-9A-ZÁÄČĎÉÍĹĽŇÓŔŠŤÚÝŽ]*$/i,sr:/^[0-9A-ZČĆŽŠĐ]*$/i,sv:/^[0-9A-ZÅÄÖ]*$/i,tr:/^[0-9A-ZÇĞİıÖŞÜ]*$/i,uk:/^[0-9А-ЩЬЮЯЄІЇҐ]*$/i,ar:/^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]*$/,az:/^[0-9A-ZÇƏĞİıÖŞÜ]*$/i,el:/^[0-9Α-ώ]*$/i,ja:/^[0-9A-Z\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\uFF00-\uFFEF\u4E00-\u9FAF]*$/i,he:/^[0-9A-Z\u05D0-\u05EA']*$/i},l={en:/^[0-9A-Z_-]*$/i,cs:/^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ_-]*$/i,da:/^[0-9A-ZÆØÅ_-]*$/i,de:/^[0-9A-ZÄÖÜß_-]*$/i,es:/^[0-9A-ZÁÉÍÑÓÚÜ_-]*$/i,fa:/^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰپژگچکی]*$/,fr:/^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ_-]*$/i,it:/^[0-9A-Z\xC0-\xFF_-]*$/i,lt:/^[0-9A-ZĄČĘĖĮŠŲŪŽ_-]*$/i,nl:/^[0-9A-ZÉËÏÓÖÜ_-]*$/i,hu:/^[0-9A-ZÁÉÍÓÖŐÚÜŰ_-]*$/i,pl:/^[0-9A-ZĄĆĘŚŁŃÓŻŹ_-]*$/i,pt:/^[0-9A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ_-]*$/i,ro:/^[0-9A-ZĂÂÎŞŢ_-]*$/i,ru:/^[0-9А-ЯЁ_-]*$/i,sk:/^[0-9A-ZÁÄČĎÉÍĹĽŇÓŔŠŤÚÝŽ_-]*$/i,sr:/^[0-9A-ZČĆŽŠĐ_-]*$/i,sv:/^[0-9A-ZÅÄÖ_-]*$/i,tr:/^[0-9A-ZÇĞİıÖŞÜ_-]*$/i,uk:/^[0-9А-ЩЬЮЯЄІЇҐ_-]*$/i,ar:/^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ_-]*$/,az:/^[0-9A-ZÇƏĞİıÖŞÜ_-]*$/i,el:/^[0-9Α-ώ_-]*$/i,ja:/^[0-9A-Z\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\uFF00-\uFFEF\u4E00-\u9FAF_-]*$/i,he:/^[0-9A-Z\u05D0-\u05EA'_-]*$/i},c=function(e,t){var r=(void 0===t?{}:t).locale,i=void 0===r?"":r;return Array.isArray(e)?e.every((function(e){return c(e,{locale:i})})):i?(n[i]||n.en).test(e):Object.keys(n).some((function(t){return n[t].test(e)}))},u={validate:c,params:[{name:"locale"}]},d=function(e,t){var r=(void 0===t?{}:t).locale,i=void 0===r?"":r;return Array.isArray(e)?e.every((function(e){return d(e,{locale:i})})):i?(l[i]||l.en).test(e):Object.keys(l).some((function(t){return l[t].test(e)}))},h={validate:d,params:[{name:"locale"}]},f=function(e,t){var r=(void 0===t?{}:t).locale,i=void 0===r?"":r;return Array.isArray(e)?e.every((function(e){return f(e,{locale:i})})):i?(o[i]||o.en).test(e):Object.keys(o).some((function(t){return o[t].test(e)}))},p={validate:f,params:[{name:"locale"}]},g=function(e,t){var r=(void 0===t?{}:t).locale,i=void 0===r?"":r;return Array.isArray(e)?e.every((function(e){return g(e,{locale:i})})):i?(s[i]||s.en).test(e):Object.keys(s).some((function(t){return s[t].test(e)}))},m={validate:g,params:[{name:"locale"}]},b=function(e,t){var r=void 0===t?{}:t,i=r.min,a=r.max;return Array.isArray(e)?e.every((function(e){return!!b(e,{min:i,max:a})})):Number(i)<=e&&Number(a)>=e},v={validate:b,params:[{name:"min"},{name:"max"}]},y={validate:function(e,t){var r=t.target;return String(e)===String(r)},params:[{name:"target",isTarget:!0}]},w=function(e,t){var r=t.length;if(Array.isArray(e))return e.every((function(e){return w(e,{length:r})}));var i=String(e);return/^[0-9]*$/.test(i)&&i.length===r},x={validate:w,params:[{name:"length",cast:function(e){return Number(e)}}]},k=function(e,t,r){var i=window.URL||window.webkitURL;return new Promise((function(a){var n=new Image;n.onerror=function(){return a(!1)},n.onload=function(){return a(n.width===t&&n.height===r)},n.src=i.createObjectURL(e)}))},A=function(e,t){var r=t.width,i=t.height,a=[];e=Array.isArray(e)?e:[e];for(var n=0;n()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return r&&!Array.isArray(e)&&(e=String(e).split(",").map((function(e){return e.trim()}))),Array.isArray(e)?e.every((function(e){return i.test(String(e))})):i.test(String(e))},params:[{name:"multiple",default:!1}]};function C(e){return e!=e}function P(e){return null==e}function I(e){return Array.isArray(e)&&0===e.length}var T=function(e){return null!==e&&e&&"object"==typeof e&&!Array.isArray(e)};function O(e,t){return!(!C(e)||!C(t))||e===t}function E(e){return""!==e&&!P(e)}function F(e){return"function"==typeof e}function L(e){return F(e)&&!!e.__locatorRef}function R(e,t){var r=Array.isArray(e)?e:N(e);if(F(r.findIndex))return r.findIndex(t);for(var i=0;i=0:Array.isArray(e)?e.every((function(e){return ae(e,{length:r})})):String(e).length<=r},ne={validate:ae,params:[{name:"length",cast:function(e){return Number(e)}}]},se=function(e,t){var r=t.max;return!P(e)&&""!==e&&(Array.isArray(e)?e.length>0&&e.every((function(e){return se(e,{max:r})})):Number(e)<=r)},oe={validate:se,params:[{name:"max",cast:function(e){return Number(e)}}]},le=function(e,t){var r=new RegExp(t.join("|").replace("*",".+")+"$","i");return Array.isArray(e)?e.every((function(e){return r.test(e.type)})):r.test(e.type)},ce={validate:le},ue=function(e,t){var r=t.length;return!P(e)&&(Array.isArray(e)?e.every((function(e){return ue(e,{length:r})})):String(e).length>=r)},de={validate:ue,params:[{name:"length",cast:function(e){return Number(e)}}]},he=function(e,t){var r=t.min;return!P(e)&&""!==e&&(Array.isArray(e)?e.length>0&&e.every((function(e){return he(e,{min:r})})):Number(e)>=r)},fe={validate:he,params:[{name:"min",cast:function(e){return Number(e)}}]},pe=/^[٠١٢٣٤٥٦٧٨٩]+$/,ge=/^[0-9]+$/,me={validate:function(e){var t=function(e){var t=String(e);return ge.test(t)||pe.test(t)};return Array.isArray(e)?e.every(t):t(e)}},be=function(e,t){var r=t.regex;return Array.isArray(e)?e.every((function(e){return be(e,{regex:r})})):r.test(String(e))},ve={validate:be,params:[{name:"regex",cast:function(e){return"string"==typeof e?new RegExp(e):e}}]},ye={validate:function(e,t){var r=(void 0===t?{allowFalse:!0}:t).allowFalse,i={valid:!1,required:!0};return P(e)||I(e)?i:!1!==e||r?(i.valid=!!String(e).trim().length,i):i},params:[{name:"allowFalse",default:!0}],computesRequired:!0},we=function(e){return I(e)||D([!1,null,void 0],e)||!String(e).trim().length},xe=function(e,t){var r,i=t.target,a=t.values;return a&&a.length?(Array.isArray(a)||"string"!=typeof a||(a=[a]),r=a.some((function(e){return e==String(i).trim()}))):r=!we(i),r?{valid:!we(e),required:r}:{valid:!0,required:r}},ke={validate:xe,params:[{name:"target",isTarget:!0},{name:"values"}],computesRequired:!0},Ae=function(e,t){var r=t.size;if(isNaN(r))return!1;var i=1024*r;if(!Array.isArray(e))return e.size<=i;for(var a=0;ai)return!1;return!0},_e={validate:Ae,params:[{name:"size",cast:function(e){return Number(e)}}]},Se=function(e,t){var r=t||{},i=r.decimals,a=void 0===i?0:i,n=r.separator,s=new RegExp("^-?\\d+"+("comma"===(void 0===n?"dot":n)?",?":"\\.?")+(0===a?"\\d*":"(\\d{"+a+"})?")+"$");return Array.isArray(e)?e.every((function(e){return s.test(String(e))})):s.test(String(e))},Ce={validate:Se,params:[{name:"decimals",default:0},{name:"separator",default:"dot"}]},Pe=Object.freeze({__proto__:null,alpha_dash:h,alpha_num:p,alpha_spaces:m,alpha:u,between:v,confirmed:y,digits:x,dimensions:_,email:S,ext:Y,image:Q,oneOf:W,integer:J,length:ie,is_not:te,is:ee,max:ne,max_value:oe,mimes:ce,min:de,min_value:fe,excluded:Z,numeric:me,regex:ve,required:ye,required_if:ke,size:_e,double:Ce}),Ie=function(){return Ie=Object.assign||function(e){for(var t,r=1,i=arguments.length;r0&&a[a.length-1])||6!==n[0]&&2!==n[0])){s=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]=0&&$e.getRuleDefinition("max")&&(i.max=r.maxlength),r.minlength>=0&&$e.getRuleDefinition("min")&&(i.min=r.minlength),"number"===r.type&&(E(r.min)&&$e.getRuleDefinition("min_value")&&(i.min_value=Number(r.min)),E(r.max)&&$e.getRuleDefinition("max_value")&&(i.max_value=Number(r.max))),i):i}function St(e){var t,r=["input","select","textarea"],i=null===(t=e.data)||void 0===t?void 0:t.attrs;if(!D(r,e.tag)||!i)return{};var a={};return"required"in i&&!1!==i.required&&$e.getRuleDefinition("required")&&(a.required="checkbox"!==i.type||[!0]),dt(e)?Ze(Ie(Ie({},a),_t(e))):Ze(a)}function Ct(e,t){return e.$scopedSlots.default?e.$scopedSlots.default(t)||[]:e.$slots.default||[]}function Pt(e,t){return!(e._ignoreImmediate||!e.immediate)||!(O(e.value,t)||!e.normalizedEvents.length)||!!e._needsValidation||!e.initialized&&void 0===t}function It(e){return Ie(Ie({},e.flags),{errors:e.errors,classes:e.classes,failedRules:e.failedRules,reset:function(){return e.reset()},validate:function(){for(var t=[],r=0;r0)){var c=Le().useConstraintAttrs?St(e):{};lt(t._resolvedRules,c)||(t._needsValidation=!0),kt(e)&&(t.fieldName=(null===(s=null===(n=e.data)||void 0===n?void 0:n.attrs)||void 0===s?void 0:s.name)||(null===(l=null===(o=e.data)||void 0===o?void 0:o.attrs)||void 0===l?void 0:l.id)),t._resolvedRules=c,Lt(t,e)}}))}return this.slim&&r.length<=1?r[0]:e(this.tag,r)},beforeDestroy:function(){this.$_veeObserver.unobserve(this.id)},activated:function(){this.isActive=!0},deactivated:function(){this.isActive=!1},methods:{setFlags:function(e){var t=this;Object.keys(e).forEach((function(r){t.flags[r]=e[r]}))},syncValue:function(e){var t=ut(e);this.value=t,this.flags.changed=!lt(this.initialValue,t)},reset:function(){var e=this;this.errors=[],this.initialValue=this.value;var t=q();t.required=this.isRequired,this.setFlags(t),this.failedRules={},this.validateSilent(),this._pendingValidation=void 0,this._pendingReset=!0,setTimeout((function(){e._pendingReset=!1}),this.debounce)},validate:function(){for(var e=[],t=0;t0&&this.syncValue(e[0]),[2,Et(this)]}))}))},validateSilent:function(){return Te(this,void 0,void 0,(function(){var e,t;return Oe(this,(function(r){switch(r.label){case 0:return this.setFlags({pending:!0}),e=Ie(Ie({},this._resolvedRules),this.normalizedRules),Object.defineProperty(e,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),[4,Je(this.value,e,Ie(Ie({name:this.name||this.fieldName},Bt(this)),{bails:this.bails,skipIfEmpty:this.skipIfEmpty,isInitial:!this.initialized,customMessages:this.customMessages}))];case 1:return t=r.sent(),this.setFlags({pending:!1,valid:t.valid,invalid:!t.valid}),void 0!==t.required&&this.setFlags({required:t.required}),[2,t]}}))}))},setErrors:function(e){this.applyResult({errors:e,failedRules:{}})},applyResult:function(e){var t=e.errors,r=e.failedRules,i=e.regenerateMap;this.errors=t,this._regenerateMap=i,this.failedRules=Ie({},r||{}),this.setFlags({valid:!t.length,passed:!t.length,invalid:!!t.length,failed:!!t.length,validated:!0,changed:!lt(this.value,this.initialValue)})},registerField:function(){jt(this)},checkComputesRequiredState:function(){var e=Ie(Ie({},this._resolvedRules),this.normalizedRules);return Object.keys(e).some($e.isRequireRule)}}});function Nt(e,t){for(var r={},i=Object.keys(t),a=i.length,n=function(a){var n=i[a],s=e&&e[n]||n,o=t[n];return P(o)?"continue":"valid"!==n&&"invalid"!==n||t.validated?void("string"==typeof s?r[s]=o:Array.isArray(s)&&s.forEach((function(e){r[e]=o}))):"continue"},s=0;s{"use strict";r.d(t,{Z:()=>a});const i={name:"AppInputSwitch",props:["description","isLast","title","error"]};const a=(0,r(1900).Z)(i,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"flex w-full items-center justify-between space-x-2 sm:space-x-8",class:{"mb-6 sm:mb-7":!e.isLast}},[r("div",{staticClass:"leading-5"},[r("label",{staticClass:"mb-1.5 block text-sm font-bold text-gray-700 dark:text-gray-200"},[e._v(" "+e._s(e.title)+": ")]),e._v(" "),e.description?r("span",{staticClass:"block text-xs leading-4 text-gray-500",domProps:{innerHTML:e._s(e.description)}}):e._e(),e._v(" "),e.error?r("span",{staticClass:"error-message"},[e._v("\n "+e._s(e.error)+"\n ")]):e._e()]),e._v(" "),r("div",[e._t("default")],2)])}),[],!1,null,null,null).exports},5264:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});const i={name:"AppInputText",props:["description","isLast","title","error"]};const a=(0,r(1900).Z)(i,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{class:{"mb-6 sm:mb-7":!e.isLast}},[e.title?r("label",{staticClass:"mb-1.5 block text-sm font-bold text-gray-700 dark:text-gray-200"},[e._v("\n "+e._s(e.title)+":\n ")]):e._e(),e._v(" "),e._t("default"),e._v(" "),e.error?r("span",{staticClass:"pt-2 text-xs text-rose-600"},[e._v("\n "+e._s(e.error)+"\n ")]):e._e(),e._v(" "),e.description?r("small",{staticClass:"block pt-2 text-xs leading-4 text-gray-500",domProps:{innerHTML:e._s(e.description)}}):e._e()],2)}),[],!1,null,null,null).exports},3907:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});var i=r(826);const a={name:"PopoverItem",props:["side","name"],data:function(){return{isVisible:!1}},methods:{hidePopover:function(){var e=this;setTimeout((function(){return e.isVisible=!1}),10)}},mounted:function(){var e=this;i.U.$on("popover:open",(function(t){e.name===t&&(e.isVisible=!e.isVisible)}))}};const n=(0,r(1900).Z)(a,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return e.isVisible?r("div",[r("div",{staticClass:"absolute top-12 z-20 w-60 overflow-hidden rounded-xl bg-white shadow-xl dark:bg-dark-foreground",class:{"right-0":"left"===e.side,"left-0":"right"===e.side},on:{"!click":function(t){return e.hidePopover.apply(null,arguments)}}},[e._t("default")],2),e._v(" "),r("div",{staticClass:"fixed top-0 left-0 right-0 bottom-0 z-10 cursor-pointer",on:{click:e.hidePopover}})]):e._e()}),[],!1,null,null,null).exports},144:(e,t,r)=>{"use strict";r.d(t,{Z:()=>l});const i={name:"PopoverWrapper"};var a=r(3379),n=r.n(a),s=r(9660),o={insert:"head",singleton:!1};n()(s.Z,o);s.Z.locals;const l=(0,r(1900).Z)(i,(function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{staticClass:"popover-wrapper"},[e._t("default")],2)}),[],!1,null,"5d0dc97d",null).exports},43:(e,t,r)=>{"use strict";r.d(t,{Z:()=>W});var i=r(144),a=r(3907),n=r(2089),s=r(9209),o=r(2784),l=r(9101),c=r(629),u=r(826);function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function h(e){for(var t=1;t1280?this.file.data.attributes.thumbnail.xl:this.file.data.attributes.thumbnail.lg}}};const v=(0,g.Z)(b,(function(){var e=this,t=e.$createElement;return(e._self._c||t)("img",{staticClass:"file",class:{"file-shadow":!e.$isMobile()},attrs:{id:"printable-file",src:e.imageSource}})}),[],!1,null,null,null).exports;var y=r(9299),w=r(7963);const x={props:{initial:{type:Boolean,default:!1}},data:function(){return{size:{width:-1,height:-1}}},methods:{reset:function(){var e=this.$el.firstChild,t=this.$el.lastChild;e.scrollLeft=1e5,e.scrollTop=1e5,t.scrollLeft=1e5,t.scrollTop=1e5},update:function(){this.size.width=this.$el.offsetWidth,this.size.height=this.$el.offsetHeight}},watch:{size:{deep:!0,handler:function(e){this.reset(),this.$emit("resize",{width:this.size.width,height:this.size.height})}}},render:function(e){var t="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;",r="position: absolute; left: 0; top: 0;";return e("div",{style:t+"animation-name: resizeSensorVisibility;",on:{"~animationstart":this.update}},[e("div",{style:t,on:{scroll:this.update}},[e("div",{style:r+"width: 100000px; height: 100000px;"})]),e("div",{style:t,on:{scroll:this.update}},[e("div",{style:r+"width: 200%; height: 200%;"})])])},beforeDestroy:function(){this.$emit("resize",{width:0,height:0}),this.$emit("resizeSensorBeforeDestroy")},mounted:function(){if(!0===this.initial&&this.$nextTick(this.update),this.$el.offsetParent!==this.$el.parentNode&&(this.$el.parentNode.style.position="relative"),"attachEvent"in this.$el&&!("AnimationEvent"in window)){var e=function(){this.update(),t()}.bind(this),t=function(){this.$el.detachEvent("onresize",e),this.$off("resizeSensorBeforeDestroy",t)}.bind(this);this.$el.attachEvent("onresize",e),this.$on("resizeSensorBeforeDestroy",t),this.reset()}}};var k=r(3379),A=r.n(k),S=r(1238),C={insert:"head",singleton:!1};A()(S.Z,C);S.Z.locals;const P=(0,g.Z)(x,undefined,undefined,!1,null,null,null).exports;r(9016);function I(e,t){var r;if("string"==typeof e)r={url:e};else{if("object"!=typeof e||null===e)throw new TypeError("invalid src type");r=Object.assign({},e)}var i=(0,y.getDocument)(r).promise;return i.__PDFDocumentLoadingTask=!0,t&&t.onPassword&&(i.onPassword=t.onPassword),t&&t.onProgress&&(i.onProgress=t.onProgress),i}const T={createLoadingTask:I,components:{resizeSensor:P},props:{src:{type:[String,Object,Promise],default:""},page:{type:Number,default:1},rotate:{type:Number,default:0},scale:{type:[Number,String],default:"page-width"},resize:{type:Boolean,default:!1},annotation:{type:Boolean,default:!1},text:{type:Boolean,default:!0}},data:function(){return{internalSrc:this.src,pdf:null,pdfViewer:null,loading:!0}},watch:{pdf:function(e){var t=e.pdfInfo||e._pdfInfo;this.$emit("numpages",t.numPages)},page:function(e){var t=this;this.pdf.getPage(e).then((function(e){t.pdfViewer.setPdfPage(e),t.pdfViewer.draw()}))},scale:function(e){this.drawScaled(e)},rotate:function(e){this.pdfViewer&&(this.pdfViewer.update(this.scale,e),this.pdfViewer.draw())}},mounted:function(){var e,t=this;("object"!=typeof(e=t.internalSrc)||null===e||!0!==e.__PDFDocumentLoadingTask)&&(t.internalSrc=I(t.internalSrc),t.$emit("loading",!0));var r=this.$refs.container,i=new w.EventBus;let a,n;t.pdfLinkService=new w.PDFLinkService({eventBus:i,externalLinkTarget:2}),t.pdfFindController=new w.PDFFindController({eventBus:i,linkService:t.pdfLinkService}),t.annotation&&(a=new w.DefaultAnnotationLayerFactory),t.text&&(n=new w.DefaultTextLayerFactory),t.internalSrc.then((function(e){return t.pdf=e,e.getPage(t.page)})).then((function(e){t.pdfViewer=new w.PDFPageView({container:r,id:t.page,scale:1,defaultViewport:e.getViewport({scale:1}),eventBus:i,textLayerFactory:n,annotationLayerFactory:a}),t.pdfViewer.setPdfPage(e);var s={scrollPageIntoView:function(e){t.$emit("link-clicked",e)}};t.pdfLinkService.setDocument(t.pdf),t.pdfLinkService.setViewer(s),t.pdfFindController.setDocument(t.pdf),t.drawScaled(t.scale),t.loading=!1,t.$emit("loading",!1)})).catch((e=>{t.$emit("error",e),t.loading=!1,t.$emit("loading",!1)}))},beforeDestroy(){var e=this;e.pdfViewer&&(e.pdfViewer.destroy(),e.pdfViewer=null)},methods:{calculateScale:function(e=-1,t=-1){return this.pdfViewer.update(1,this.rotate),-1===e&&-1===t&&(e=this.$refs.container.offsetWidth),e/this.pdfViewer.viewport.width},calculateScaleHeight:function(){this.pdfViewer.update(1,this.rotate);var e=this.$refs.container.offsetHeight;return this.$refs.container.parentElement.parentElement.offsetHeight/e},drawScaled:function(e){this.pdfViewer&&("page-width"===e?(e=this.calculateScale(),this.$emit("update:scale",e)):"page-height"===e&&(e=this.calculateScaleHeight(),this.$emit("update:scale",e)),this.pdfViewer.update(e,this.rotate),this.annotation&&(this.pdfViewer.annotationLayer=this.pdfViewer.annotationLayerFactory.createAnnotationLayerBuilder(this.pdfViewer.div,this.pdfViewer.pdfPage),this.pdfViewer.annotationLayer.linkService=this.pdfLinkService),this.pdfViewer.draw(),this.text&&(this.pdfViewer.textLayer.findController=this.pdfFindController),this.loading=!1,this.$emit("loading",!1))},resizeScale:function(){this.resize&&this.drawScaled("page-width")}}};var O=r(7422),E={insert:"head",singleton:!1};A()(O.Z,E);O.Z.locals;const F=(0,g.Z)(T,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[e.loading?e._t("loading"):e._e(),e._v(" "),r("div",{ref:"container",attrs:{id:"viewerContainer"}},[r("div",{staticClass:"pdfViewer",attrs:{id:"viewer"}}),e._v(" "),r("resizeSensor",{attrs:{initial:!0},on:{resize:e.resizeScale}})],1)],2)}),[],!1,null,null,null).exports,L={name:"PdfFile",components:{pdf:F},props:["file"],watch:{file:function(){this.getPdf()}},data:function(){return{pdfData:void 0,documentSize:50,numPages:0}},methods:{getPdf:function(){this.pdfData=void 0,this.numPages=0;var e=this;e.pdfData=F.createLoadingTask(this.file.data.attributes.file_url),e.pdfData.then((function(t){return e.numPages=t.numPages}))},getDocumentSize:function(){window.innerWidth<960&&(this.documentSize=100),window.innerWidth>960&&(this.documentSize=localStorage.getItem("documentSize")?parseInt(localStorage.getItem("documentSize")):50)},zoomIn:function(){this.documentSize<100&&(this.documentSize+=10,localStorage.setItem("documentSize",this.documentSize))},zoomOut:function(){this.documentSize>40&&(this.documentSize-=10,localStorage.setItem("documentSize",this.documentSize))}},created:function(){var e=this;this.getDocumentSize(),this.getPdf(),u.U.$on("document-zoom:in",(function(){return e.zoomIn()})),u.U.$on("document-zoom:out",(function(){return e.zoomOut()}))}},R=L;var M=r(7544),D={insert:"head",singleton:!1};A()(M.Z,D);M.Z.locals;const N=(0,g.Z)(R,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"absolute bottom-0 top-0 left-0 right-0 z-10 mx-auto overflow-y-auto rounded-xl md:p-5",style:{width:e.documentSize+"%"}},e._l(e.numPages,(function(t){return r("pdf",{key:t,staticClass:"mx-auto mb-6 w-full overflow-hidden md:rounded-xl md:shadow-lg",attrs:{src:e.pdfData,resize:!0,page:t,scale:"page-width",id:"printable-file"}},[r("template",{slot:"loading"},[r("b",[e._v("\n "+e._s(e.$t("loading content..."))+"\n ")])])],2)})),1)}),[],!1,null,null,null).exports;const B={name:"Audio",props:["file"]};const U=(0,g.Z)(B,(function(){var e=this,t=e.$createElement;return(e._self._c||t)("audio",{staticClass:"file audio",class:{"file-shadow":!e.$isMobile()},attrs:{src:e.file.data.attributes.file_url,controls:""}})}),[],!1,null,null,null).exports;var j=r(9621),q=r(7318);function z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function $(e){for(var t=1;t1||(this.currentIndex+=1,this.currentIndex>this.files.length-1&&(this.currentIndex=0))},prev:function(){!this.files.length>1||(this.currentIndex-=1,this.currentIndex<0&&(this.currentIndex=this.files.length-1))}},created:function(){var e=this;u.U.$on("file-preview:next",(function(){return e.next()})),u.U.$on("file-preview:prev",(function(){return e.prev()})),this.getFilesForView()}};const V={name:"FilePreview",components:{FilePreviewToolbar:m,FilePreviewMedia:(0,g.Z)(G,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return e.currentFile?r("div",{staticClass:"absolute top-[56px] left-0 right-0 bottom-0 select-none lg:top-[66px]"},[!e.$isMobile()&&e.files.length>1?r("div",{},[r("div",{staticClass:"fixed top-1/2 left-0 z-20 cursor-pointer p-3",on:{click:function(t){return t.preventDefault(),e.prev.apply(null,arguments)}}},[r("chevron-left-icon",{attrs:{size:"20"}})],1),e._v(" "),r("div",{staticClass:"fixed top-1/2 right-0 z-20 cursor-pointer p-3",on:{click:function(t){return t.preventDefault(),e.next.apply(null,arguments)}}},[r("chevron-right-icon",{attrs:{size:"20"}})],1)]):e._e(),e._v(" "),!e.$isMobile()&&(e.isAudio||e.isImage||e.isVideo||e.isPDF)?r("div",{staticClass:"flex h-full w-full items-center justify-center"},[e.isPDF?r("PdfFile",{attrs:{file:e.currentFile}}):e._e(),e._v(" "),r("div",{staticClass:"flex h-full w-full items-center justify-center"},[e.isAudio?r("Audio",{attrs:{file:e.currentFile}}):e._e(),e._v(" "),e.isVideo?r("Video",{staticClass:"mx-auto max-h-full max-w-[1080px] self-center",attrs:{file:e.currentFile}}):e._e(),e._v(" "),e.isImage?r("ImageFile",{staticClass:"mx-auto max-h-[100%] max-w-[100%] self-center",attrs:{file:e.currentFile}}):e._e()],1)],1):e._e(),e._v(" "),e.$isMobile()&&(e.isAudio||e.isImage||e.isVideo||e.isPDF)?r("div",{ref:"scrollBox",staticClass:"flex h-full snap-x snap-mandatory gap-6 overflow-x-auto",attrs:{id:"group-box"},on:{scroll:e.checkGroupInView}},e._l(e.files,(function(t,i){return r("div",{key:i,staticClass:"relative flex h-full w-screen shrink-0 snap-center items-center justify-center",attrs:{id:"group-"+t.data.id}},[e.isImage?r("ImageFile",{staticClass:"mx-auto max-h-[100%] max-w-[100%] self-center",attrs:{file:t}}):e._e(),e._v(" "),e.isAudio?r("Audio",{attrs:{file:t}}):e._e(),e._v(" "),e.isVideo?r("Video",{attrs:{file:t}}):e._e(),e._v(" "),e.isPDF?r("PdfFile",{attrs:{file:t}}):e._e()],1)})),0):e._e()]):e._e()}),[],!1,null,null,null).exports},data:function(){return{isFullPreview:!1}},methods:{closeFilePreview:function(){this.isFullPreview=!1,this.$store.commit("FAST_PREVIEW_CLEAR")},next:function(){u.U.$emit("file-preview:next")},prev:function(){u.U.$emit("file-preview:prev")}},updated:function(){this.isFullPreview&&this.$refs.filePreview.focus()},mounted:function(){var e=this;u.U.$on("file-preview:show",(function(){return e.isFullPreview=!0})),u.U.$on("file-preview:hide",(function(){return e.closeFilePreview()}))}};const W=(0,g.Z)(V,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return e.isFullPreview?r("div",{ref:"filePreview",staticClass:"fixed z-40 h-full w-full bg-white dark:bg-dark-background",attrs:{tabindex:"-1"},on:{keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:e.closeFilePreview.apply(null,arguments)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"right",39,t.key,["Right","ArrowRight"])||"button"in t&&2!==t.button?null:e.next.apply(null,arguments)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"left",37,t.key,["Left","ArrowLeft"])||"button"in t&&0!==t.button?null:e.prev.apply(null,arguments)}]}},[r("FilePreviewToolbar"),e._v(" "),r("FilePreviewMedia")],1):e._e()}),[],!1,null,null,null).exports},9621:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});const i={name:"Video",props:["file"]};const a=(0,r(1900).Z)(i,(function(){var e=this,t=e.$createElement;return(e._self._c||t)("video",{staticClass:"video",class:{"file-shadow":!e.$isMobile()},attrs:{src:e.file.data.attributes.file_url,controlsList:"nodownload",disablePictureInPicture:"",playsinline:"",controls:""}})}),[],!1,null,null,null).exports},916:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});const i={name:"CheckBox",props:["isClicked"],components:{CheckIcon:r(9101).nQG},data:function(){return{isSwitched:void 0}},methods:{changeState:function(){this.isSwitched=!this.isSwitched,this.$emit("input",this.isSwitched)}},mounted:function(){this.isSwitched=this.isClicked}};const a=(0,r(1900).Z)(i,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("div",{staticClass:"flex h-5 w-5 items-center justify-center rounded-md",class:{"bg-theme":e.isClicked,"bg-light-background dark:bg-dark-foreground":!e.isClicked},on:{click:e.changeState}},[e.isClicked?r("CheckIcon",{staticClass:"vue-feather text-white",attrs:{size:"17"}}):e._e()],1)])}),[],!1,null,null,null).exports},4137:(e,t,r)=>{"use strict";r.d(t,{Z:()=>x});var i=r(6485),a=r(1122),n=r(144),s=r(4121),o=r(3907),l=r(8495),c=r(2551),u=r(2784),d=r(29),h=r(2089),f=r(8172),p=r(826),g=r(629),m=r(9209);function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function v(e){for(var t=1;t1||0===this.clipboard.length},canCreateTeamFolder:function(){return this.$isThisRoute(this.$route,["MySharedItems","Files"])&&1===this.clipboard.length&&"folder"===this.clipboard[0].data.type}}),methods:{showTeamFolderMenu:function(){this.teamFolder&&p.U.$emit("popover:open","team-folder")},showCreateMenu:function(){p.U.$emit("popover:open","desktop-create")},showSortingMenu:function(){p.U.$emit("popover:open","desktop-sorting")}}};const x=(0,r(1900).Z)(w,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"hidden lg:block"},[r("div",{staticClass:"flex items-center justify-between py-3"},[r("NavigationBar"),e._v(" "),r("div",{staticClass:"flex items-center"},[r("PopoverWrapper",[r("ToolbarButton",{attrs:{source:"cloud-plus",action:e.$t("actions.create")},nativeOn:{click:function(t){return t.stopPropagation(),e.showCreateMenu.apply(null,arguments)}}}),e._v(" "),r("PopoverItem",{attrs:{name:"desktop-create",side:"left"}},[r("OptionGroup",{class:{"is-inactive":e.canUploadInView||e.isTeamFolderHomepage||e.isSharedWithMeHomepage},attrs:{title:e.$t("Upload")}},[r("OptionUpload",{attrs:{title:e.$t("actions.upload"),type:"file"}}),e._v(" "),r("OptionUpload",{attrs:{title:e.$t("actions.upload_folder"),type:"folder"}})],1),e._v(" "),r("OptionGroup",{attrs:{title:e.$t("Create")}},[r("Option",{class:{"is-inactive":e.canCreateFolder||e.isTeamFolderHomepage||e.isSharedWithMeHomepage},attrs:{title:e.$t("actions.create_folder"),icon:"folder-plus"},nativeOn:{click:function(t){return e.$createFolder.apply(null,arguments)}}}),e._v(" "),r("Option",{class:{"is-inactive":e.canCreateTeamFolder||e.isSharedWithMeHomepage},attrs:{title:e.$t("Create Team Folder"),icon:"users"},nativeOn:{click:function(t){return t.stopPropagation(),e.$createTeamFolder.apply(null,arguments)}}})],1)],1)],1),e._v(" "),r("SearchBar",{staticClass:"ml-5 hidden lg:block xl:ml-8"}),e._v(" "),r("div",{staticClass:"ml-5 flex items-center xl:ml-8"},[e.$isThisRoute(e.$route,["TeamFolders","SharedWithMe"])?r("PopoverWrapper",[r("TeamMembersButton",{staticClass:"cursor-pointer rounded-lg py-0.5 pl-2 pr-0.5 hover:bg-light-background dark:hover:bg-dark-foreground",attrs:{size:"32"},nativeOn:{click:function(t){return t.stopPropagation(),e.showTeamFolderMenu.apply(null,arguments)}}}),e._v(" "),r("PopoverItem",{attrs:{name:"team-folder",side:"left"}},[r("TeamFolderPreview"),e._v(" "),e.$isThisRoute(e.$route,["TeamFolders"])?r("OptionGroup",{attrs:{title:e.$t("Options")}},[r("Option",{attrs:{title:e.$t("Edit Members"),icon:"rename"},nativeOn:{click:function(t){return e.$updateTeamFolder(e.teamFolder)}}}),e._v(" "),r("Option",{attrs:{title:e.$t("Dissolve Team"),icon:"trash"},nativeOn:{click:function(t){return e.$dissolveTeamFolder(e.teamFolder)}}})],1):e._e(),e._v(" "),e.$isThisRoute(e.$route,["SharedWithMe"])?r("OptionGroup",{attrs:{title:e.$t("Options")}},[r("Option",{attrs:{title:e.$t("Leave the Team Folder"),icon:"user-minus"},nativeOn:{click:function(t){return e.$detachMeFromTeamFolder(e.teamFolder)}}})],1):e._e()],1)],1):e._e(),e._v(" "),e.$isMobile()?e._e():r("div",{staticClass:"flex items-center"},[e.canShowConvertToTeamFolder?r("ToolbarButton",{class:{"is-inactive":!e.canCreateTeamFolder},attrs:{source:"user-plus",action:e.$t("actions.convert_into_team_folder")},nativeOn:{click:function(t){return e.$convertAsTeamFolder(e.clipboard[0])}}}):e._e(),e._v(" "),e.$isThisRoute(e.$route,["SharedWithMe","Public"])?e._e():r("ToolbarButton",{class:{"is-inactive":e.canShareInView},attrs:{source:"share",action:e.$t("actions.share")},nativeOn:{click:function(t){return e.$shareFileOrFolder(e.clipboard[0])}}}),e._v(" "),r("ToolbarButton",{class:{"is-inactive":e.canMoveInView&&!e.canEdit},attrs:{source:"move",action:e.$t("actions.move")},nativeOn:{click:function(t){return e.$moveFileOrFolder(e.clipboard[0])}}}),e._v(" "),r("ToolbarButton",{class:{"is-inactive":e.canDeleteInView&&!e.canEdit},attrs:{source:"trash",action:e.$t("actions.delete")},nativeOn:{click:function(t){return e.$deleteFileOrFolder(e.clipboard[0])}}})],1)],1),e._v(" "),r("div",{staticClass:"ml-5 flex items-center xl:ml-8"},[r("PopoverWrapper",[r("ToolbarButton",{attrs:{source:"preview-sorting",action:e.$t("actions.sorting_view")},nativeOn:{click:function(t){return t.stopPropagation(),e.showSortingMenu.apply(null,arguments)}}}),e._v(" "),r("PopoverItem",{attrs:{name:"desktop-sorting",side:"left"}},[r("FileSortingOptions")],1)],1),e._v(" "),r("ToolbarButton",{attrs:{action:e.$t("actions.info_panel"),source:"info"},nativeOn:{click:function(t){return e.$store.dispatch("fileInfoToggle")}}})],1)],1)],1),e._v(" "),r("UploadProgress")],1)}),[],!1,null,null,null).exports},6086:(e,t,r)=>{"use strict";r.d(t,{Z:()=>u});var i=r(8639),a=r(629),n=r(826);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function o(e){for(var t=1;t1&&t?this.$t("file_detail.selected_multiple"):(e<2||!t)&&this.draggedItem?this.draggedItem.data.attributes.name:void 0},subtitle:function(){var e=this.clipboard.length,t=this.clipboard.includes(this.draggedItem);if(e>1&&t)return e+" "+this.$tc("file_detail.items",e);if((e<2||!t)&&this.draggedItem){if("folder"===this.draggedItem.data.type)return 0==this.draggedItem.items?this.$t("folder.empty"):this.$tc("folder.item_counts",this.draggedItem.items);if("folder"!==this.draggedItem.data.type&&this.draggedItem.data.attributes.mimetype)return"."+this.draggedItem.data.attributes.mimetype}}}),data:function(){return{isVisible:!1,draggedItem:void 0}},created:function(){var e=this;n.U.$on("dragstart",(function(t){e.draggedItem=t,setTimeout((function(){e.isVisible=!0}),100)})),n.U.$on("drop",(function(){return e.isVisible=!1}))}};const u=(0,r(1900).Z)(c,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{directives:[{name:"show",rawName:"v-show",value:e.isVisible,expression:"isVisible"}],staticClass:"pointer-events-none fixed z-20 w-64 rounded-xl bg-white p-5 shadow-lg dark:bg-dark-foreground",attrs:{id:"drag-ui"}},[r("TitlePreview",{attrs:{icon:"check-square",title:e.title,subtitle:e.subtitle}})],1)}),[],!1,null,null,null).exports},6065:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});const i={name:"FileIconThumbnail",props:["entry"]};const a=(0,r(1900).Z)(i,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"flex items-center justify-center"},[r("span",{staticClass:"text-theme absolute z-10 mx-auto mt-1 inline-block w-7 overflow-hidden text-ellipsis text-center text-[9px] font-semibold"},[e._v("\n "+e._s(e.entry.data.attributes.mimetype)+"\n ")]),e._v(" "),r("svg",{attrs:{width:"38px",height:"51px",viewBox:"0 0 38 51",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"}},[r("path",{attrs:{"stroke-width":"0",fill:"#f4f5f6",d:"M22.1666667,13.546875 L22.1666667,0 L2.375,0 C1.05885417,0 0,1.06582031 0,2.390625 L0,48.609375 C0,49.9341797 1.05885417,51 2.375,51 L35.625,51 C36.9411458,51 38,49.9341797 38,48.609375 L38,15.9375 L24.5416667,15.9375 C23.2354167,15.9375 22.1666667,14.8617187 22.1666667,13.546875 Z M38,12.1423828 L38,12.75 L25.3333333,12.75 L25.3333333,0 L25.9369792,0 C26.5703125,0 27.1739583,0.249023438 27.6192708,0.697265625 L37.3072917,10.4589844 C37.7526042,10.9072266 38,11.5148437 38,12.1423828 Z"}})])])}),[],!1,null,null,null).exports},4671:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var i=r(4121),a=r(8436),n=r(1188);const s={name:"FilterSortingMobile",components:{FileSortingOptions:i.Z,MenuMobileGroup:a.Z,MenuMobile:n.Z}};const o=(0,r(1900).Z)(s,(function(){var e=this.$createElement,t=this._self._c||e;return t("MenuMobile",{attrs:{name:"file-sorting"}},[t("MenuMobileGroup",[t("FileSortingOptions")],1)],1)}),[],!1,null,null,null).exports},4121:(e,t,r)=>{"use strict";r.d(t,{Z:()=>d});var i=r(2089),a=r(9209),n=r(9101),s=r(629);function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function l(e){for(var t=1;t{"use strict";r.d(t,{Z:()=>s});var i=r(8569),a=r(7212);const n={name:"FolderIcon",props:["item"],components:{VueFolderTeamIcon:i.Z,VueFolderIcon:a.Z}};const s=(0,r(1900).Z)(n,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[e.item.data.attributes.isTeamFolder?e._e():r("VueFolderIcon"),e._v(" "),e.item.data.attributes.isTeamFolder?r("VueFolderTeamIcon",{staticStyle:{width:"53px",height:"52px"}}):e._e()],1)}),[],!1,null,null,null).exports},6354:(e,t,r)=>{"use strict";r.d(t,{Z:()=>l});const i={name:"CloudPlusIcon"};var a=r(3379),n=r.n(a),s=r(3485),o={insert:"head",singleton:!1};n()(s.Z,o);s.Z.locals;const l=(0,r(1900).Z)(i,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("svg",{staticClass:"preview-list-icon",attrs:{fill:"none",stroke:"currentColor","stroke-width":"1.5","fill-rule":"evenodd","stroke-linecap":"round","stroke-linejoin":"round",width:"15px",height:"15px",viewBox:"0 0 17 12",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"}},[r("path",{attrs:{d:"M14.2729998,10.7729998 C15.6774712,10.0073227 16.384111,8.38688297 15.9895447,6.83668332 C15.5949785,5.28648367 14.1996249,4.20105605 12.5999998,4.19999993 L11.7179998,4.19999993 C11.1377566,1.9556703 9.23470173,0.300843012 6.93154234,0.0378706728 C4.62838295,-0.225101666 2.40127934,0.958148431 1.33005562,3.01391529 C0.258831904,5.06968215 0.564955244,7.57295196 2.09999996,9.30999984",id:"Path"}}),e._v(" "),r("line",{attrs:{x1:"8.5",y1:"7",x2:"8.5",y2:"12",id:"Path"}}),e._v(" "),r("line",{attrs:{x1:"6",y1:"9.5",x2:"11",y2:"9.5",id:"Path"}})])}),[],!1,null,null,null).exports},2617:(e,t,r)=>{"use strict";r.d(t,{Z:()=>l});const i={name:"SortingIcon"};var a=r(3379),n=r.n(a),s=r(3822),o={insert:"head",singleton:!1};n()(s.Z,o);s.Z.locals;const l=(0,r(1900).Z)(i,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("svg",{staticClass:"preview-list-icon",attrs:{fill:"none",stroke:"currentColor","stroke-width":"1.5","fill-rule":"evenodd","stroke-linecap":"round","stroke-linejoin":"round",width:"15px",height:"15px",viewBox:"0 0 20 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"}},[r("rect",{attrs:{x:"9.77777778",y:"0",width:"6.22222222",height:"6.22222222"}}),e._v(" "),r("rect",{attrs:{x:"9.77777778",y:"9.77777778",width:"6.22222222",height:"6.22222222"}}),e._v(" "),r("line",{attrs:{x1:"0",y1:"2",x2:"6",y2:"2"}}),e._v(" "),r("line",{attrs:{x1:"0",y1:"8",x2:"6",y2:"8"}}),e._v(" "),r("line",{attrs:{x1:"0",y1:"14",x2:"6",y2:"14"}})])}),[],!1,null,null,null).exports},7212:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});const i={name:"VueFolderIcon"};const a=(0,r(1900).Z)(i,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("svg",{attrs:{width:"53px",height:"52px",viewBox:"0 0 53 39",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"}},[r("path",{staticClass:"svg-color-theme",attrs:{d:"M48.03125,6.5 L29.790833,6.5 C28.7431613,6.5 27.7373076,6.08896217 26.9894703,5.35523504 L22.6980297,1.14476496 C21.9501924,0.41103783 20.9443387,-6.36543387e-16 19.896667,0 L4.96875,0 L4.96875,0 C2.22455078,0 0,2.18257812 0,4.875 L0,34.125 C0,36.8174219 2.22455078,39 4.96875,39 L48.03125,39 C50.7754492,39 53,36.8174219 53,34.125 L53,11.375 C53,8.68257813 50.7754492,6.5 48.03125,6.5 Z",stroke:"none","stroke-width":"0"}}),e._v(" "),r("path",{attrs:{d:"M48.03125,6.5 L29.790833,6.5 C28.7431613,6.5 27.7373076,6.08896217 26.9894703,5.35523504 L22.6980297,1.14476496 C21.9501924,0.41103783 20.9443387,-6.36543387e-16 19.896667,0 L4.96875,0 L4.96875,0 C2.22455078,0 0,2.18257812 0,4.875 L0,34.125 C0,36.8174219 2.22455078,39 4.96875,39 L48.03125,39 C50.7754492,39 53,36.8174219 53,34.125 L53,11.375 C53,8.68257813 50.7754492,6.5 48.03125,6.5 Z",fill:"black","fill-opacity":"0.2",stroke:"none","stroke-width":"0"}}),e._v(" "),r("path",{staticClass:"svg-color-theme",attrs:{d:"M48.03125,12.75 C49.0609313,12.75 49.9941504,13.1577174 50.6692739,13.8201027 C51.3356976,14.4739525 51.75,15.3766531 51.75,16.375 L51.75,16.375 L51.75,34.125 C51.75,35.1233469 51.3356976,36.0260475 50.6692739,36.6798973 C49.9941504,37.3422826 49.0609313,37.75 48.03125,37.75 L48.03125,37.75 L4.96875,37.75 C3.93906868,37.75 3.00584961,37.3422826 2.33072613,36.6798973 C1.66430239,36.0260475 1.25,35.1233469 1.25,34.125 L1.25,34.125 L1.25,16.375 C1.25,15.3766531 1.66430239,14.4739525 2.33072613,13.8201027 C3.00584961,13.1577174 3.93906868,12.75 4.96875,12.75 L4.96875,12.75 Z","stroke-width":"2",fill:"green"}})])}),[],!1,null,null,null).exports},8569:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});const i={name:"VueFolderTeamIcon"};const a=(0,r(1900).Z)(i,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("svg",{attrs:{viewBox:"0 0 53 39",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"}},[r("g",{attrs:{id:"V2",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"}},[r("g",{attrs:{id:"team-folder"}},[r("path",{staticClass:"svg-color-theme",attrs:{d:"M48.03125,6.5 L29.790833,6.5 C28.7431613,6.5 27.7373076,6.08896217 26.9894703,5.35523504 L22.6980297,1.14476496 C21.9501924,0.41103783 20.9443387,-6.36543387e-16 19.896667,0 L4.96875,0 L4.96875,0 C2.22455078,0 0,2.18257812 0,4.875 L0,34.125 C0,36.8174219 2.22455078,39 4.96875,39 L48.03125,39 C50.7754492,39 53,36.8174219 53,34.125 L53,11.375 C53,8.68257813 50.7754492,6.5 48.03125,6.5 Z",stroke:"none","stroke-width":"0"}}),e._v(" "),r("path",{attrs:{d:"M48.03125,6.5 L29.790833,6.5 C28.7431613,6.5 27.7373076,6.08896217 26.9894703,5.35523504 L22.6980297,1.14476496 C21.9501924,0.41103783 20.9443387,-6.36543387e-16 19.896667,0 L4.96875,0 L4.96875,0 C2.22455078,0 0,2.18257812 0,4.875 L0,34.125 C0,36.8174219 2.22455078,39 4.96875,39 L48.03125,39 C50.7754492,39 53,36.8174219 53,34.125 L53,11.375 C53,8.68257813 50.7754492,6.5 48.03125,6.5 Z",fill:"black","fill-opacity":"0.2",stroke:"none","stroke-width":"0"}}),e._v(" "),r("path",{staticClass:"svg-color-theme",attrs:{d:"M48.03125,12.75 C49.0609313,12.75 49.9941504,13.1577174 50.6692739,13.8201027 C51.3356976,14.4739525 51.75,15.3766531 51.75,16.375 L51.75,16.375 L51.75,34.125 C51.75,35.1233469 51.3356976,36.0260475 50.6692739,36.6798973 C49.9941504,37.3422826 49.0609313,37.75 48.03125,37.75 L48.03125,37.75 L4.96875,37.75 C3.93906868,37.75 3.00584961,37.3422826 2.33072613,36.6798973 C1.66430239,36.0260475 1.25,35.1233469 1.25,34.125 L1.25,34.125 L1.25,16.375 C1.25,15.3766531 1.66430239,14.4739525 2.33072613,13.8201027 C3.00584961,13.1577174 3.93906868,12.75 4.96875,12.75 L4.96875,12.75 Z","stroke-width":"2",fill:"green"}}),e._v(" "),r("g",{staticClass:"svg-stroke-theme-darken",attrs:{id:"Icon",transform:"translate(8.000000, 20.000000)","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.3",stroke:"black","stroke-opacity":"0.25"}},[r("path",{attrs:{d:"M9.59999943,10.7999994 L9.59999943,9.59999943 C9.59999943,8.27451611 8.52548289,7.19999957 7.19999957,7.19999957 L2.39999986,7.19999957 C1.07451654,7.19999957 0,8.27451611 0,9.59999943 L0,10.7999994"}}),e._v(" "),r("circle",{attrs:{cx:"4.79999971",cy:"2.39999986",r:"2.39999986"}}),e._v(" "),r("path",{attrs:{d:"M13.1999992,10.7999994 L13.1999992,9.59999943 C13.1991834,8.50627014 12.4589985,7.55143166 11.3999993,7.27799957"}}),e._v(" "),r("path",{attrs:{d:"M8.99999946,0.0779999954 C10.0619483,0.349901852 10.8047053,1.30679461 10.8047053,2.40299986 C10.8047053,3.4992051 10.0619483,4.45609786 8.99999946,4.72799972"}})])])])])}),[],!1,null,null,null).exports},6325:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});const i={name:"ImageMetaData",computed:{clipboard:function(){return this.$store.getters.clipboard[0].data.relationships.exif}}};const a=(0,r(1900).Z)(i,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[e.clipboard.data.attributes.date_time_original?r("div",{staticClass:"flex items-center justify-between pt-0.5 pb-2"},[r("b",{staticClass:"font-bold text-sm"},[e._v(e._s(e.$t("file_detail_meta.time_data")))]),e._v(" "),r("b",{staticClass:"font-bold text-sm"},[e._v(e._s(e.clipboard.data.attributes.date_time_original))])]):e._e(),e._v(" "),e.clipboard.data.attributes.artist?r("div",{staticClass:"flex items-center justify-between py-2"},[r("b",{staticClass:"font-bold text-sm"},[e._v(e._s(e.$t("file_detail_meta.author")))]),e._v(" "),r("b",{staticClass:"font-bold text-sm"},[e._v(e._s(e.clipboard.data.attributes.artist))])]):e._e(),e._v(" "),e.clipboard.data.attributes.width&&e.clipboard.data.attributes.height?r("div",{staticClass:"flex items-center justify-between py-2"},[r("b",{staticClass:"font-bold text-sm"},[e._v(e._s(e.$t("file_detail_meta.dimension")))]),e._v(" "),r("b",{staticClass:"font-bold text-sm"},[e._v(e._s(e.clipboard.data.attributes.width)+"x"+e._s(e.clipboard.data.attributes.height))])]):e._e(),e._v(" "),e.clipboard.data.attributes.x_resolution&&e.clipboard.data.attributes.y_resolution?r("div",{staticClass:"flex items-center justify-between py-2"},[r("b",{staticClass:"font-bold text-sm"},[e._v(e._s(e.$t("file_detail_meta.resolution")))]),e._v(" "),r("b",{staticClass:"font-bold text-sm"},[e._v(e._s(e.clipboard.data.attributes.x_resolution)+"x"+e._s(e.clipboard.data.attributes.y_resolution))])]):e._e(),e._v(" "),e.clipboard.data.attributes.color_space?r("div",{staticClass:"flex items-center justify-between py-2"},[r("b",{staticClass:"font-bold text-sm"},[e._v(" "+e._s(e.$t("file_detail_meta.color_space")))]),e._v(" "),r("b",{staticClass:"font-bold text-sm"},[e._v(e._s(e.clipboard.data.attributes.color_space))])]):e._e(),e._v(" "),e.clipboard.data.attributes.make?r("div",{staticClass:"flex items-center justify-between py-2"},[r("b",{staticClass:"font-bold text-sm"},[e._v(e._s(e.$t("file_detail_meta.make")))]),e._v(" "),r("b",{staticClass:"font-bold text-sm"},[e._v(e._s(e.clipboard.data.attributes.make))])]):e._e(),e._v(" "),e.clipboard.data.attributes.model?r("div",{staticClass:"flex items-center justify-between py-2"},[r("b",{staticClass:"font-bold text-sm"},[e._v(e._s(e.$t("file_detail_meta.model")))]),e._v(" "),r("b",{staticClass:"font-bold text-sm"},[e._v(e._s(e.clipboard.data.attributes.model))])]):e._e(),e._v(" "),e.clipboard.data.attributes.aperture_value?r("div",{staticClass:"flex items-center justify-between py-2"},[r("b",{staticClass:"font-bold text-sm"},[e._v(e._s(e.$t("file_detail_meta.aperture_value")))]),e._v(" "),r("b",{staticClass:"font-bold text-sm"},[e._v(" "+e._s(e.clipboard.data.attributes.aperture_value)+" ")])]):e._e(),e._v(" "),e.clipboard.data.attributes.exposure_time?r("div",{staticClass:"flex items-center justify-between py-2"},[r("b",{staticClass:"font-bold text-sm"},[e._v(e._s(e.$t("file_detail_meta.exposure")))]),e._v(" "),r("b",{staticClass:"font-bold text-sm"},[e._v(e._s(e.clipboard.data.attributes.exposure_time))])]):e._e(),e._v(" "),e.clipboard.data.attributes.focal_length?r("div",{staticClass:"flex items-center justify-between py-2"},[r("b",{staticClass:"font-bold text-sm"},[e._v(e._s(e.$t("file_detail_meta.focal")))]),e._v(" "),r("b",{staticClass:"font-bold text-sm"},[e._v(e._s(e.clipboard.data.attributes.focal_length))])]):e._e(),e._v(" "),e.clipboard.data.attributes.iso?r("div",{staticClass:"flex items-center justify-between py-2"},[r("b",{staticClass:"font-bold text-sm"},[e._v(e._s(e.$t("file_detail_meta.iso")))]),e._v(" "),r("b",{staticClass:"font-bold text-sm"},[e._v(e._s(e.clipboard.data.attributes.iso))])]):e._e(),e._v(" "),e.clipboard.data.attributes.aperture_f_number?r("div",{staticClass:"flex items-center justify-between py-2"},[r("b",{staticClass:"font-bold text-sm"},[e._v(e._s(e.$t("file_detail_meta.aperature")))]),e._v(" "),r("b",{staticClass:"font-bold text-sm"},[e._v(e._s(e.clipboard.data.attributes.aperture_f_number))])]):e._e(),e._v(" "),e.clipboard.data.attributes.ccd_width?r("div",{staticClass:"flex items-center justify-between py-2"},[r("b",{staticClass:"font-bold text-sm"},[e._v(e._s(e.$t("file_detail_meta.camera_lens")))]),e._v(" "),r("b",{staticClass:"font-bold text-sm"},[e._v(e._s(e.clipboard.data.attributes.ccd_width))])]):e._e(),e._v(" "),e.clipboard.data.attributes.longitude?r("div",{staticClass:"flex items-center justify-between py-2"},[r("b",{staticClass:"font-bold text-sm"},[e._v(e._s(e.$t("file_detail_meta.longitude")))]),e._v(" "),r("b",{staticClass:"font-bold text-sm"},[e._v(e._s(e.clipboard.data.attributes.longitude))])]):e._e(),e._v(" "),e.clipboard.data.attributes.latitude?r("div",{staticClass:"flex items-center justify-between py-2"},[r("b",{staticClass:"font-bold text-sm"},[e._v(e._s(e.$t("file_detail_meta.latitude")))]),e._v(" "),r("b",{staticClass:"font-bold text-sm"},[e._v(e._s(e.clipboard.data.attributes.latitude))])]):e._e()])}),[],!1,null,null,null).exports},6028:(e,t,r)=>{"use strict";r.d(t,{Z:()=>m});var i=r(3777),a=r(2873),n=r(9101),s=r(6325),o=r(8639),l=r(3774),c=r(55),u=r(2585),d=r(629);function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function f(e){for(var t=1;t{"use strict";r.d(t,{Z:()=>m});var i=r(1165),a=r(4886),n=r(9101),s=r(6065),o=r(2585),l=r(916),c=r(6486),u=r(629),d=r(826);function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function f(e){for(var t=1;t