diff --git a/config/vuefilemanager.php b/config/vuefilemanager.php index 25c9889b..fdbafd41 100644 --- a/config/vuefilemanager.php +++ b/config/vuefilemanager.php @@ -1,7 +1,7 @@ '2.0.0-Rc.2', + 'version' => '2.0.0-Rc.3', 'is_demo' => env('APP_DEMO', false), diff --git a/public/3390.js b/public/3390.js new file mode 100644 index 00000000..9265eec1 --- /dev/null +++ b/public/3390.js @@ -0,0 +1,2 @@ +/*! For license information please see 3390.js.LICENSE.txt */ +(self.webpackChunk=self.webpackChunk||[]).push([[3390],{9742:(e,t)=>{"use strict";t.byteLength=function(e){var t=l(e),r=t[0],a=t[1];return 3*(r+a)/4-a},t.toByteArray=function(e){var t,r,n=l(e),s=n[0],o=n[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,o)),h=0,u=o>0?s-4:s;for(r=0;r>16&255,c[h++]=t>>8&255,c[h++]=255&t;2===o&&(t=a[e.charCodeAt(r)]<<2|a[e.charCodeAt(r+1)]>>4,c[h++]=255&t);1===o&&(t=a[e.charCodeAt(r)]<<10|a[e.charCodeAt(r+1)]<<4|a[e.charCodeAt(r+2)]>>2,c[h++]=t>>8&255,c[h++]=255&t);return c},t.fromByteArray=function(e){for(var t,a=e.length,i=a%3,n=[],s=16383,o=0,l=a-i;ol?l:o+s));1===i?(t=e[a-1],n.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[a-2]<<8)+e[a-1],n.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return n.join("")};for(var r=[],a=[],i="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,a){for(var i,n,s=[],o=t;o>18&63]+r[n>>12&63]+r[n>>6&63]+r[63&n]);return s.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},8764:(e,t,r)=>{"use strict";var a=r(9742),i=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 g(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 a=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return j(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(a)return j(e).length;t=(""+t).toLowerCase(),a=!0}}function p(e,t,r){var a=!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 E(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return T(this,t,r);case"latin1":case"binary":return I(this,t,r);case"base64":return C(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,t,r);default:if(a)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function m(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}function b(e,t,r,a,i){if(0===e.length)return-1;if("string"==typeof r?(a=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=l.from(t,a)),l.isBuffer(t))return 0===t.length?-1:y(e,t,r,a,i);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,a,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,a,i){var n,s=1,o=e.length,l=t.length;if(void 0!==a&&("ucs2"===(a=String(a).toLowerCase())||"ucs-2"===a||"utf16le"===a||"utf-16le"===a)){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(i){var h=-1;for(n=r;no&&(r=o-l),n=r;n>=0;n--){for(var u=!0,d=0;di&&(a=i):a=i;var n=t.length;if(n%2!=0)throw new TypeError("Invalid hex string");a>n/2&&(a=n/2);for(var s=0;s>8,i=r%256,n.push(i),n.push(a);return n}(t,e.length-r),e,r,a)}function C(e,t,r){return 0===t&&r===e.length?a.fromByteArray(e):a.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);for(var a=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+u<=r)switch(u){case 1:c<128&&(h=c);break;case 2:128==(192&(n=e[i+1]))&&(l=(31&c)<<6|63&n)>127&&(h=l);break;case 3:n=e[i+1],s=e[i+2],128==(192&n)&&128==(192&s)&&(l=(15&c)<<12|(63&n)<<6|63&s)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:n=e[i+1],s=e[i+2],o=e[i+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&&(h=l)}null===h?(h=65533,u=1):h>65535&&(h-=65536,a.push(h>>>10&1023|55296),h=56320|1023&h),a.push(h),i+=u}return function(e){var t=e.length;if(t<=P)return String.fromCharCode.apply(String,e);var r="",a=0;for(;a0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},l.prototype.compare=function(e,t,r,a,i){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===a&&(a=0),void 0===i&&(i=this.length),t<0||r>e.length||a<0||i>this.length)throw new RangeError("out of range index");if(a>=i&&t>=r)return 0;if(a>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var n=(i>>>=0)-(a>>>=0),s=(r>>>=0)-(t>>>=0),o=Math.min(n,s),c=this.slice(a,i),h=e.slice(t,r),u=0;ui)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var n=!1;;)switch(a){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":return A(this,e,t,r);case"latin1":case"binary":return k(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,r);default:if(n)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),n=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var P=4096;function T(e,t,r){var a="";r=Math.min(e.length,r);for(var i=t;ia)&&(r=a);for(var i="",n=t;nr)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,r,a,i,n){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function O(e,t,r,a){t<0&&(t=65535+t+1);for(var i=0,n=Math.min(e.length-r,2);i>>8*(a?i:1-i)}function M(e,t,r,a){t<0&&(t=4294967295+t+1);for(var i=0,n=Math.min(e.length-r,4);i>>8*(a?i:3-i)&255}function D(e,t,r,a,i,n){if(r+a>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(e,t,r,a,n){return n||D(e,0,r,4),i.write(e,t,r,a,23,4),r+4}function B(e,t,r,a,n){return n||D(e,0,r,8),i.write(e,t,r,a,52,8),r+8}l.prototype.slice=function(e,t){var r,a=this.length;if((e=~~e)<0?(e+=a)<0&&(e=0):e>a&&(e=a),(t=void 0===t?a:~~t)<0?(t+=a)<0&&(t=0):t>a&&(t=a),t0&&(i*=256);)a+=this[e+--t]*i;return a},l.prototype.readUInt8=function(e,t){return t||L(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||L(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||L(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||L(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||L(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||L(e,t,this.length);for(var a=this[e],i=1,n=0;++n=(i*=128)&&(a-=Math.pow(2,8*t)),a},l.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var a=t,i=1,n=this[e+--a];a>0&&(i*=256);)n+=this[e+--a]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},l.prototype.readInt8=function(e,t){return t||L(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||L(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||L(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||L(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||L(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||L(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||L(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||L(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||L(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,r,a){(e=+e,t|=0,r|=0,a)||R(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,n=0;for(this[t]=255&e;++n=0&&(n*=256);)this[t+i]=e/n&255;return t+r},l.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||R(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||R(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):O(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):O(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||R(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||R(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,a){if(e=+e,t|=0,!a){var i=Math.pow(2,8*r-1);R(this,e,t,r,i-1,-i)}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,a){if(e=+e,t|=0,!a){var i=Math.pow(2,8*r-1);R(this,e,t,r,i-1,-i)}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||R(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||R(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):O(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):O(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||R(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||R(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,a){if(r||(r=0),a||0===a||(a=this.length),t>=e.length&&(t=e.length),t||(t=0),a>0&&a=this.length)throw new RangeError("sourceStart out of bounds");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(n<1e3||!l.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(n=t;n55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&n.push(239,191,189);continue}if(s+1===a){(t-=3)>-1&&n.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&n.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&n.push(239,191,189);if(i=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 a.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 H(e,t,r,a){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}},7422:(e,t,r)=>{"use strict";r.d(t,{Z:()=>d});var a=r(3645),i=r.n(a),n=r(1667),s=r.n(n),o=r(6810),l=r(9187),c=i()((function(e){return e[1]})),h=s()(o.Z),u=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('+h+") 9 9 repeat;border-image:url("+h+") 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("+u+") 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 d=c},7544:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});var a=r(3645),i=r.n(a)()((function(e){return e[1]}));i.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=i},1238:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});var a=r(3645),i=r.n(a)()((function(e){return e[1]}));i.push([e.id,"@-webkit-keyframes resizeSensorVisibility{0%{top:0}}@keyframes resizeSensorVisibility{0%{top:0}}",""]);const n=i},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:()=>a});const a="/images/vendor/pdfjs-dist/web/loading-icon.gif?ff2dfa442d903d9d5e303345b82e5415"},6810:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});const a="/images/vendor/pdfjs-dist/web/shadow.png?4d046de3539f9ccc9ce07d3d1b786846"},645:(e,t)=>{t.read=function(e,t,r,a,i){var n,s,o=8*i-a-1,l=(1<>1,h=-7,u=r?i-1:0,d=r?-1:1,f=e[t+u];for(u+=d,n=f&(1<<-h)-1,f>>=-h,h+=o;h>0;n=256*n+e[t+u],u+=d,h-=8);for(s=n&(1<<-h)-1,n>>=-h,h+=a;h>0;s=256*s+e[t+u],u+=d,h-=8);if(0===n)n=1-c;else{if(n===l)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,a),n-=c}return(f?-1:1)*s*Math.pow(2,n-a)},t.write=function(e,t,r,a,i,n){var s,o,l,c=8*n-i-1,h=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=a?0:n-1,g=a?1:-1,p=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=h):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+u>=1?d/l:d*Math.pow(2,1-u))*l>=2&&(s++,l/=2),s+u>=h?(o=0,s=h):s+u>=1?(o=(t*l-1)*Math.pow(2,i),s+=u):(o=t*Math.pow(2,u-1)*Math.pow(2,i),s=0));i>=8;e[r+f]=255&o,f+=g,o/=256,i-=8);for(s=s<0;e[r+f]=255&s,f+=g,s/=256,c-=8);e[r+f-g]|=128*p}},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(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},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 a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(a,i,function(t){return e[t]}.bind(null,i));return a},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 a.addLinkAttributes}}),Object.defineProperty(t,"getFilenameFromUrl",{enumerable:!0,get:function(){return a.getFilenameFromUrl}}),Object.defineProperty(t,"LinkTarget",{enumerable:!0,get:function(){return a.LinkTarget}}),Object.defineProperty(t,"loadScript",{enumerable:!0,get:function(){return a.loadScript}}),Object.defineProperty(t,"PDFDateString",{enumerable:!0,get:function(){return a.PDFDateString}}),Object.defineProperty(t,"RenderingCancelledException",{enumerable:!0,get:function(){return a.RenderingCancelledException}}),Object.defineProperty(t,"build",{enumerable:!0,get:function(){return i.build}}),Object.defineProperty(t,"getDocument",{enumerable:!0,get:function(){return i.getDocument}}),Object.defineProperty(t,"LoopbackPort",{enumerable:!0,get:function(){return i.LoopbackPort}}),Object.defineProperty(t,"PDFDataRangeTransport",{enumerable:!0,get:function(){return i.PDFDataRangeTransport}}),Object.defineProperty(t,"PDFWorker",{enumerable:!0,get:function(){return i.PDFWorker}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return i.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 h.SVGGraphics}});var a=r(1),i=r(5),n=r(2),s=r(16),o=r(7),l=r(10),c=r(17),h=r(18);{const{isNodeJS:e}=r(4);if(e){const e=r(19).PDFNodeStream;(0,i.setPDFNetworkStreamFactory)((t=>new e(t)))}else{const e=r(22).PDFNetworkStream;let t;(0,a.isFetchSupported)()&&(t=r(23).PDFFetchStream),(0,i.setPDFNetworkStreamFactory)((r=>t&&(0,a.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,a.assert)(t&&"string"==typeof t,'addLinkAttributes: A valid "url" parameter must provided.');const o=(0,a.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:i},t.getFilenameFromUrl=function(e){const t=e.indexOf("#"),r=e.indexOf("?"),a=Math.min(t>0?t:e.length,r>0?r:e.length);return e.substring(e.lastIndexOf("/",a)+1,a)},t.isFetchSupported=c,t.isValidFetchUrl=h,t.loadScript=function(e){return new Promise(((t,r)=>{const a=document.createElement("script");a.src=e,a.onload=t,a.onerror=function(){r(new Error(`Cannot load script at: ${a.src}`))},(document.head||document.documentElement).appendChild(a)}))},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 a=r(2);const i="noopener noreferrer nofollow";t.DEFAULT_LINK_REL=i;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"),a=r.getContext("2d");return r.width=e,r.height=t,{canvas:r,context:a}}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?a.CMapCompressionType.BINARY:a.CMapCompressionType.NONE;return c()&&h(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,a.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,i)=>{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,a.stringToBytes)(n.responseText)),t)return void e({cMapData:t,compressionType:r})}i(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,a.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,a.assert)("string"==typeof e,"Invalid SVG element type"),document.createElementNS(n,e)}};class s{constructor({viewBox:e,scale:t,rotation:r,offsetX:a=0,offsetY:i=0,dontFlip:n=!1}){this.viewBox=e,this.scale=t,this.rotation=r,this.offsetX=a,this.offsetY=i;const s=(e[2]+e[0])/2,o=(e[3]+e[1])/2;let l,c,h,u,d,f,g,p;switch(r=(r%=360)<0?r+360:r){case 180:l=-1,c=0,h=0,u=1;break;case 90:l=0,c=1,h=1,u=0;break;case 270:l=0,c=-1,h=-1,u=0;break;case 0:l=1,c=0,h=0,u=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}n&&(h=-h,u=-u),0===l?(d=Math.abs(o-e[1])*t+a,f=Math.abs(s-e[0])*t+i,g=Math.abs(e[3]-e[1])*t,p=Math.abs(e[2]-e[0])*t):(d=Math.abs(s-e[0])*t+a,f=Math.abs(o-e[1])*t+i,g=Math.abs(e[2]-e[0])*t,p=Math.abs(e[3]-e[1])*t),this.transform=[l*t,c*t,h*t,u*t,d-l*t*s-h*t*o,f-c*t*s-u*t*o],this.width=g,this.height=p}clone({scale:e=this.scale,rotation:t=this.rotation,offsetX:r=this.offsetX,offsetY:a=this.offsetY,dontFlip:i=!1}={}){return new s({viewBox:this.viewBox.slice(),scale:e,rotation:t,offsetX:r,offsetY:a,dontFlip:i})}convertToViewportPoint(e,t){return a.Util.applyTransform([e,t],this.transform)}convertToViewportRectangle(e){const t=a.Util.applyTransform([e[0],e[1]],this.transform),r=a.Util.applyTransform([e[2],e[3]],this.transform);return[t[0],t[1],r[0],r[1]]}convertToPdfPoint(e,t){return a.Util.applyInverseTransform([e,t],this.transform)}}t.PageViewport=s;class o extends a.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 h(e,t){try{const{protocol:r}=t?new URL(e,t):new URL(e);return"http:"===r||"https:"===r}catch(e){return!1}}let u;t.LinkTarget=l,t.StatTimer=class{constructor(){this.started=Object.create(null),this.times=[]}time(e){e in this.started&&(0,a.warn)(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||(0,a.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 a=r.end-r.start;e.push(`${r.name.padEnd(t)} ${a}ms\n`)}return e.join("")}},t.PDFDateString=class{static toDateObject(e){if(!e||!(0,a.isString)(e))return null;u||(u=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const t=u.exec(e);if(!t)return null;const r=parseInt(t[1],10);let i=parseInt(t[2],10);i=i>=1&&i<=12?i-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 h=parseInt(t[8],10);h=h>=0&&h<=23?h:0;let d=parseInt(t[9],10)||0;return d=d>=0&&d<=59?d:0,"-"===c?(s+=h,o+=d):"+"===c&&(s-=h,o-=d),new Date(Date.UTC(r,i,n,s,o,l))}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayByteLength=d,t.arraysToBytes=function(e){const t=e.length;if(1===t&&e[0]instanceof Uint8Array)return e[0];let r=0;for(let a=0;at}),e.promise=new Promise((function(r,a){e.resolve=function(e){t=!0,r(e)},e.reject=function(e){t=!0,a(e)}})),e},t.getVerbosityLevel=function(){return i},t.info=function(e){i>=a.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 a=new URL(t,r);return r.origin===a.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(h,"")},t.setVerbosityLevel=function(e){Number.isInteger(e)&&(i=e)},t.shadow=l,t.string32=function(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)},t.stringToBytes=u,t.stringToPDFString=function(e){const t=e.length,r=[];if("þ"===e[0]&&"ÿ"===e[1])for(let a=2;a=a.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 h=/\x00/g;function u(e){o("string"==typeof e,"Invalid argument for stringToBytes");const t=e.length,r=new Uint8Array(t);for(let a=0;ae[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 a=[e[0],e[2],t[0],t[2]].sort(r),i=[e[1],e[3],t[1],t[3]].sort(r),n=[];return e=m.normalizeRect(e),t=m.normalizeRect(t),a[0]===e[0]&&a[1]===t[0]||a[0]===t[0]&&a[1]===e[0]?(n[0]=a[1],n[2]=a[2],i[0]===e[1]&&i[1]===t[1]||i[0]===t[1]&&i[1]===e[1]?(n[1]=i[1],n[3]=i[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],y=function(){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return function(t,r,a=!1){if(!a&&URL.createObjectURL){const e=new Blob([t],{type:r});return URL.createObjectURL(e)}let i=`data:${r};base64,`;for(let r=0,a=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,a=!1){this._pageIndex=e,this._pageInfo=t,this._transport=r,this._stats=a?new _display_utils.StatTimer:null,this._pdfBug=a,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:a=0,dontFlip:i=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:e,rotation:t,offsetX:r,offsetY:a,dontFlip:i})}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:a=!1,renderInteractiveForms:i=!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 h=this.intentStates[c];h.streamReaderCancelTimeout&&(clearTimeout(h.streamReaderCancelTimeout),h.streamReaderCancelTimeout=null);const u=o||new _display_utils.DOMCanvasFactory,d=new _webgl.WebGLContext({enable:a});h.displayReadyCapability||(h.displayReadyCapability=(0,_util.createPromiseCapability)(),h.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList({pageIndex:this._pageIndex,intent:c,renderInteractiveForms:!0===i}));const f=e=>{const t=h.renderTasks.indexOf(g);t>=0&&h.renderTasks.splice(t,1),(this.cleanupAfterRender||"print"===c)&&(this.pendingCleanup=!0),this._tryCleanup(),e?(g.capability.reject(e),this._abortOperatorList({intentState:h,reason:e})):g.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"))},g=new InternalRenderTask({callback:f,params:{canvasContext:e,viewport:t,transform:n,imageLayer:s,background:l},objs:this.objs,commonObjs:this.commonObjs,operatorList:h.operatorList,pageIndex:this._pageIndex,canvasFactory:u,webGLContext:d,useRequestAnimationFrame:"print"!==c,pdfBug:this._pdfBug});h.renderTasks||(h.renderTasks=[]),h.renderTasks.push(g);const p=g.task;return h.displayReadyCapability.promise.then((e=>{this.pendingCleanup?f():(this._stats&&this._stats.time("Rendering"),g.initializeGraphics(e),g.operatorListChanged())})).catch(f),p}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 a=t.getReader(),i={items:[],styles:Object.create(null)};!function t(){a.read().then((function({value:r,done:a}){a?e(i):(Object.assign(i.styles,r.styles),i.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,a=e.length;r{t.read().then((({value:e,done:t})=>{t?r.streamReader=null:this._transport.destroyed||(this._renderPageChunk(e,r),a())}),(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,a={data:function e(a){if("object"!=typeof a||null===a)return a;if(r.has(a))return r.get(a);let i,n;if((i=a.buffer)&&(0,_util.isArrayBuffer)(i))return n=t&&t.includes(i)?new a.constructor(i,a.byteOffset,a.byteLength):new a.constructor(a),r.set(a,n),n;n=Array.isArray(a)?[]:{},r.set(a,n);for(const t in a){let r,i=a;for(;!(r=Object.getOwnPropertyDescriptor(i,t));)i=Object.getPrototypeOf(i);if(void 0!==r.value)if("function"!=typeof r.value)n[t]=e(r.value);else if(a.hasOwnProperty&&a.hasOwnProperty(t))throw new Error(`LoopbackPort.postMessage - cannot clone: ${a[t]}`)}return n}(e)};this._deferred.then((()=>{this._listeners.forEach((e=>{e.call(this,a)}))}))}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),a=()=>{t.removeEventListener("error",i),r.destroy(),t.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},i=()=>{this._webWorker||a()};t.addEventListener("error",i),r.on("test",(e=>{t.removeEventListener("error",i),this.destroyed?a():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",i),this.destroyed)a();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++,a=new _message_handler.MessageHandler(r+"_worker",r,t);e.setup(a,t);const i=new _message_handler.MessageHandler(r,r+"_worker",t);this._messageHandler=i,this._readyCapability.resolve(),i.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,a){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=a,this.CMapReaderFactory=new a.CMapReaderFactory({baseUrl:a.cMapUrl,isCompressed:a.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)(),a=this._fullReader;return a.headersReady.then((()=>{a.isStreamingSupported&&a.isRangeSupported||(this._lastProgress&&t.onProgress&&t.onProgress(this._lastProgress),a.onProgress=e=>{t.onProgress&&t.onProgress({loaded:e.loaded,total:e.total})}),r.resolve({isStreamingSupported:a.isStreamingSupported,isRangeSupported:a.isRangeSupported,contentLength:a.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,a,i]=t;if(!this.commonObjs.has(r))switch(a){case"Font":const t=this._params;if("error"in i){const e=i.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(i,{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,i);break;default:throw new Error(`Got unknown common object type ${a}`)}})),e.on("obj",(e=>{if(this.destroyed)return;const[t,r,a,i]=e,n=this.pageCache[r];if(!n.objs.has(t)){if("Image"!==a)throw new Error(`Got unknown object type ${a}`);{n.objs.resolve(t,i);const e=8e6;i&&"data"in i&&i.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 a=r(2);class i{constructor({docId:e,onUnsupportedFeature:t}){this.constructor===i&&(0,a.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:a.UNSUPPORTED_FEATURES.errorFontLoadNative}),(0,a.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 a=this._queueLoadingCallback(r);this._prepareFontLoadEvent([t],[e],a)}))}}_queueLoadingCallback(e){(0,a.unreachable)("Abstract method `_queueLoadingCallback`.")}get isFontLoadingAPISupported(){const e="undefined"!=typeof document&&!!document.fonts;return(0,a.shadow)(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){(0,a.unreachable)("Abstract method `isSyncFontLoadingSupported`.")}get _loadTestFont(){(0,a.unreachable)("Abstract method `_loadTestFont`.")}_prepareFontLoadEvent(e,t,r){(0,a.unreachable)("Abstract method `_prepareFontLoadEvent`.")}}let n;t.FontLoader=n,t.FontLoader=n=class extends i{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,a.shadow)(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(e){const t=this.loadingContext,r={id:"pdfjs-font-loading-"+t.nextRequestId++,done:!1,complete:function(){for((0,a.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,a.shadow)(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}_prepareFontLoadEvent(e,t,r){function i(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,a){return e.substring(0,t)+a+e.substring(t+r)}let s,o;const l=document.createElement("canvas");l.width=1,l.height=1;const c=l.getContext("2d");let h=0;const u=`lt${Date.now()}${this.loadTestFontId++}`;let d=this._loadTestFont;d=n(d,976,u.length,u);const f=1482184792;let g=i(d,16);for(s=0,o=u.length-3;s30)return(0,a.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))}(u,(function(){document.body.removeChild(b),r.complete()}))}},t.FontFaceObject=class{constructor(e,{isEvalSupported:t=!0,disableFontFace:r=!1,ignoreErrors:a=!1,onUnsupportedFeature:i=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===a,this._onUnsupportedFeature=i,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,a.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,i;try{r=e.get(this.loadedName+"_path_"+t)}catch(e){if(!this.ignoreErrors)throw e;return this._onUnsupportedFeature&&this._onUnsupportedFeature({featureId:a.UNSUPPORTED_FEATURES.errorFontGetPath}),(0,a.warn)(`getPathGenerator - ignoring character: "${e}".`),this.compiledGlyphs[t]=function(e,t){}}if(this.isEvalSupported&&a.IsEvalSupportedCached.value){let e,a="";for(let t=0,n=r.length;t>2),w=v.length,A=h+7>>3,k=4294967295,S=a.IsLittleEndianCached.value?4278190080:255;for(i=0;iA?h:8*x-7,P=-8&_,T=0,I=0;C>=1}for(;r=d&&(l=h*(s=u)),r=0,n=l;n--;)b[r++]=m[p++],b[r++]=m[p++],b[r++]=m[p++],b[r++]=255;e.putImageData(g,0,i*o)}}}}function r(e,t){for(var r=t.height,a=t.width,i=r%o,n=(r-i)/o,s=0===i?n:n+1,l=e.createImageData(a,o),c=0,h=t.data,u=l.data,d=0;d>=1}e.putImageData(l,0,d*o)}}function u(e,t){for(var r=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"],a=0,i=r.length;a>8,e[n-2]=e[n-2]*s+r*o>>8,e[n-1]=e[n-1]*s+a*o>>8}}}function g(e,t,r){for(var a=e.length,i=3;i>8]>>8:t[i]*n>>16}}function m(e,t,r,a){var i=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&&a.isEnabled){const n=a.composeSMask({layer:r.canvas,mask:i,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,a,i,n,s){var o,l=!!n,c=l?n[0]:0,h=l?n[1]:0,u=l?n[2]:0;o="Luminosity"===i?p:g;for(var d=Math.min(a,Math.ceil(1048576/r)),m=0;m10&&"function"==typeof r,u=h?Date.now()+15:0,d=0,f=this.commonObjs,g=this.objs;;){if(void 0!==i&&o===i.nextBreakPoint)return i.breakIt(o,r),o;if((c=s[o])!==a.OPS.dependency)this[c].apply(this,n[o]);else for(const e of n[o]){const t=e.startsWith("g_")?f:g;if(!t.has(e))return t.get(e,r),o}if(++o===l)return o;if(h&&++d>10){if(Date.now()>u)return r(),o;d=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=y[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,a="smaskGroupAt"+this.groupLevel,i=this.cachedCanvases.getCanvas(a,t,r,!0),n=this.ctx,s=n.mozCurrentTransform;this.ctx.save();var o=i.context;o.scale(1/e.scaleX,1/e.scaleY),o.translate(-e.offsetX,-e.offsetY),o.transform.apply(o,s),e.startTransformInverse=o.mozCurrentTransformInverse,u(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(),u(e,this.ctx),this.current.resumeSMaskCtx=e;var t=a.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(),u(e,this.ctx);var t=a.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,a,i,n){this.ctx.transform(e,t,r,a,i,n),this._cachedGetSinglePixelWidth=null},constructPath:function(e,t){for(var r=this.ctx,i=this.current,n=i.x,s=i.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,a,i,n){this.current.textMatrix=[e,t,r,a,i,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,i){var n=this.ctx,s=this.current,o=s.font,l=s.textRenderingMode,c=s.fontSize/s.fontSizeScale,h=l&a.TextRenderingMode.FILL_STROKE_MASK,u=!!(l&a.TextRenderingMode.ADD_TO_PATH_FLAG);const d=s.patternFill&&!o.missingFile;var f;(o.disableFontFace||u||d)&&(f=o.getPathGenerator(this.commonObjs,e)),o.disableFontFace||d?(n.save(),n.translate(t,r),n.beginPath(),f(n,c),i&&n.setTransform.apply(n,i),h!==a.TextRenderingMode.FILL&&h!==a.TextRenderingMode.FILL_STROKE||n.fill(),h!==a.TextRenderingMode.STROKE&&h!==a.TextRenderingMode.FILL_STROKE||n.stroke(),n.restore()):(h!==a.TextRenderingMode.FILL&&h!==a.TextRenderingMode.FILL_STROKE||n.fillText(e,t,r),h!==a.TextRenderingMode.STROKE&&h!==a.TextRenderingMode.FILL_STROKE||n.strokeText(e,t,r)),u&&(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,i=3;i0&&t[i]<255){r=!0;break}return(0,a.shadow)(this,"isFontSubpixelAAEnabled",r)},showText:function(e){var t=this.current,r=t.font;if(r.isType3Font)return this.showType3Text(e);var i=t.fontSize;if(0===i)return;var n=this.ctx,o=t.fontSizeScale,l=t.charSpacing,c=t.wordSpacing,h=t.fontDirection,u=t.textHScale*h,d=e.length,f=r.vertical,g=f?1:-1,p=r.defaultVMetrics,m=i*t.fontMatrix[0],b=t.textRenderingMode===a.TextRenderingMode.FILL&&!r.disableFontFace&&!t.patternFill;let y;if(n.save(),t.patternFill){n.save();const e=t.fillColor.getPattern(n,this);y=n.mozCurrentTransform,n.restore(),n.fillStyle=e}n.transform.apply(n,t.textMatrix),n.translate(t.x,t.y+t.textRise),h>0?n.scale(u,-1):n.scale(u,1);var v=t.lineWidth,w=t.textMatrixScale;if(0===w||0===v){var A=t.textRenderingMode&a.TextRenderingMode.FILL_STROKE_MASK;A!==a.TextRenderingMode.STROKE&&A!==a.TextRenderingMode.FILL_STROKE||(this._cachedGetSinglePixelWidth=null,v=this.getSinglePixelWidth()*s)}else v/=w;1!==o&&(n.scale(o,o),v/=o),n.lineWidth=v;var k,S=0;for(k=0;k0){var N=1e3*n.measureText(O).width/i*o;if(Dnew e(t,this.commonObjs,this.objs,this.canvasFactory,this.webGLContext)};r=new i.TilingPattern(t,a,this.ctx,s,n)}else r=(0,i.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 i=a.Util.makeCssRgb(e,t,r);this.ctx.strokeStyle=i,this.current.strokeColor=i},setFillRGBColor:function(e,t,r){var i=a.Util.makeCssRgb(e,t,r);this.ctx.fillStyle=i,this.current.fillColor=i,this.current.patternFill=!1},shadingFill:function(e){var t=this.ctx;this.save();var r=(0,i.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=a.Util.applyTransform([0,0],n),h=a.Util.applyTransform([0,l],n),u=a.Util.applyTransform([o,0],n),d=a.Util.applyTransform([o,l],n),f=Math.min(c[0],h[0],u[0],d[0]),g=Math.min(c[1],h[1],u[1],d[1]),p=Math.max(c[0],h[0],u[0],d[0]),m=Math.max(c[1],h[1],u[1],d[1]);this.ctx.fillRect(f,g,p-f,m-g)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.restore()},beginInlineImage:function(){(0,a.unreachable)("Should not call beginInlineImage")},beginImageData:function(){(0,a.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],a=t[3]-t[1];this.ctx.rect(t[0],t[1],r,a),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,a.info)("TODO: Support non-isolated groups."),e.knockout&&(0,a.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 i=a.Util.getAxialAlignedBoundingBox(e.bbox,t.mozCurrentTransform),s=[0,0,t.canvas.width,t.canvas.height];i=a.Util.intersect(i,s)||[0,0,0,0];var o=Math.floor(i[0]),l=Math.floor(i[1]),c=Math.max(Math.ceil(i[2])-o,1),h=Math.max(Math.ceil(i[3])-l,1),d=1,f=1;c>n&&(d=c/n,c=n),h>n&&(f=h/n,h=n);var g="groupAt"+this.groupLevel;e.smask&&(g+="_smask_"+this.smaskCounter++%2);var p=this.cachedCanvases.getCanvas(g,c,h,!0),m=p.context;m.scale(1/d,1/f),m.translate(-o,-l),m.transform.apply(m,r),e.smask?this.smaskStack.push({canvas:p.canvas,context:m,offsetX:o,offsetY:l,scaleX:d,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(d,f)),u(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(),d(this.ctx),this.current=new h,Array.isArray(e)&&4===e.length){var a=e[2]-e[0],i=e[3]-e[1];this.ctx.rect(e[0],e[1],a,i),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,a=e.width,i=e.height,n=this.current.fillColor,s=this.current.patternFill,o=this.processingType3;if(o&&void 0===o.compiled&&(o.compiled=a<=1e3&&i<=1e3?function(e){var t,r,a,i,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]),h=n+7&-8,u=e.data,d=new Uint8Array(h*s),f=0;for(t=0,i=u.length;t0;)d[f++]=p&g?0:255,g>>=1;var m=0;for(0!==d[f=0]&&(l[0]=1,++m),r=1;r>2)+(d[f+1]?4:0)+(d[f-h+1]?8:0)]&&(l[a+r]=c[b],++m),f++;if(d[f-h]!==d[f]&&(l[a+r]=d[f]?2:4,++m),m>1e3)return null}for(a=t*o,0!==d[f=h*(s-1)]&&(l[a]=8,++m),r=1;r1e3)return null;var y=new Int32Array([0,o,-1,0,-o,0,0,0,1]),v=[];for(t=0;m&&t<=s;t++){for(var w=t*o,A=w+n;w>4,l[w]&=x>>2|x<<2),S.push(w%o),S.push(w/o|0),l[w]||--m}while(C!==w);v.push(S),--t}}return function(e){e.save(),e.scale(1/n,-1/s),e.translate(0,-s),e.beginPath();for(let r=0,a=v.length;r2&&p>1||f>2&&m>1;){var y=p,v=m;h>2&&p>1&&(h/=p/(y=Math.ceil(p/2))),f>2&&m>1&&(f/=m/(v=Math.ceil(m/2))),(g=(s=this.cachedCanvases.getCanvas(b,y,v)).context).clearRect(0,0,y,v),g.drawImage(n,0,0,p,m,0,0,y,v),n=s.canvas,p=y,m=v,b="prescale1"===b?"prescale2":"prescale1"}if(i.drawImage(n,0,0,p,m,0,-a,r,a),this.imageLayer){var w=this.getCanvasPosition(0,-a);this.imageLayer.appendImage({imgData:e,left:w[0],top:w[1],width:r/o[0],height:a/o[3]})}this.restore()},paintInlineImageXObjectGroup:function(e,r){var a=this.ctx,i=e.width,n=e.height,s=this.cachedCanvases.getCanvas("inlineImage",i,n);t(s.context,e);for(var o=0,l=r.length;oc[a+1]&&(l=r,r=a,a=l,l=n,n=s,s=l),c[a+1]>c[i+1]&&(l=a,a=i,i=l,l=s,s=o,o=l),c[r+1]>c[a+1]&&(l=r,r=a,a=l,l=n,n=s,s=l);var f=(c[r]+t.offsetX)*t.scaleX,g=(c[r+1]+t.offsetY)*t.scaleY,p=(c[a]+t.offsetX)*t.scaleX,m=(c[a+1]+t.offsetY)*t.scaleY,b=(c[i]+t.offsetX)*t.scaleX,y=(c[i+1]+t.offsetY)*t.scaleY;if(!(g>=y))for(var v,w,A,k,S,x,C,_,P=h[n],T=h[n+1],I=h[n+2],E=h[s],F=h[s+1],L=h[s+2],R=h[o],O=h[o+1],M=h[o+2],D=Math.round(g),N=Math.round(y),B=D;B<=N;B++){if(By?1:m===y?0:(m-B)/(m-y),v=p-(p-b)*e,w=E-(E-R)*e,A=F-(F-O)*e,k=L-(L-M)*e}let e;e=By?1:(g-B)/(g-y),S=f-(f-b)*e,x=P-(P-R)*e,C=T-(T-O)*e,_=I-(I-M)*e;for(var U=Math.round(Math.min(v,S)),q=Math.round(Math.max(v,S)),j=d*B+4*U,z=U;z<=q;z++)e=(v-z)/(v-S),e<0?e=0:e>1&&(e=1),u[j++]=w-(w-x)*e|0,u[j++]=A-(A-C)*e|0,u[j++]=k-(k-_)*e|0,u[j++]=255}}function t(t,r,a){var i,n,s=r.coords,o=r.colors;switch(r.type){case"lattice":var l=r.verticesPerRow,c=Math.floor(s.length/l)-1,h=l-1;for(i=0;i=a?i=a:r=i/e,{scale:r,size:i}},clipBbox:function(e,t,r,a,i,n){if(Array.isArray(t)&&4===t.length){var s=i-r,o=n-a;e.ctx.rect(r,a,s,o),e.clip(),e.endPath()}},setFillAndStrokeStyleToContext:function(r,i,n){const s=r.ctx,o=r.current;switch(i){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=a.Util.makeCssRgb(n[0],n[1],n[2]);s.fillStyle=c,s.strokeStyle=c,o.fillColor=c,o.strokeColor=c;break;default:throw new a.FormatError(`Unsupported paint type: ${i}`)}},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 a=Object.create(null);t.GlobalWorkerOptions=a,a.workerPort=void 0===a.workerPort?null:a.workerPort,a.workerSrc=void 0===a.workerSrc?"":a.workerSrc},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessageHandler=void 0;var a=r(2);const i=1,n=2,s=1,o=2,l=3,c=4,h=5,u=6,d=7,f=8;function g(e){if("object"!=typeof e||null===e)return e;switch(e.name){case"AbortException":return new a.AbortException(e.message);case"MissingPDFException":return new a.MissingPDFException(e.message);case"UnexpectedResponseException":return new a.UnexpectedResponseException(e.message,e.status);case"UnknownErrorException":return new a.UnknownErrorException(e.message,e.details);default:return new a.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===i)r.resolve(t.data);else{if(t.callback!==n)throw new Error("Unexpected callback case");r.reject(g(t.reason))}return}const a=this.actionHandler[t.action];if(!a)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const e=this.sourceName,s=t.sourceName;new Promise((function(e){e(a(t.data))})).then((function(a){r.postMessage({sourceName:e,targetName:s,callback:i,callbackId:t.callbackId,data:a})}),(function(a){r.postMessage({sourceName:e,targetName:s,callback:n,callbackId:t.callbackId,reason:g(a)})}))}else t.streamId?this._createStreamSink(t):a(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 i=this.callbackId++,n=(0,a.createPromiseCapability)();this.callbackCapabilities[i]=n;try{this._postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:i,data:t},r)}catch(e){n.reject(e)}return n.promise}sendWithStream(e,t,r,i){const n=this.streamId++,o=this.sourceName,l=this.targetName,c=this.comObj;return new ReadableStream({start:r=>{const s=(0,a.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},i),s.promise},pull:e=>{const t=(0,a.createPromiseCapability)();return this.streamControllers[n].pullCall=t,c.postMessage({sourceName:o,targetName:l,stream:u,streamId:n,desiredSize:e.desiredSize}),t.promise},cancel:e=>{(0,a.assert)(e instanceof Error,"cancel must have a valid reason");const t=(0,a.createPromiseCapability)();return this.streamControllers[n].cancelCall=t,this.streamControllers[n].isClosed=!0,c.postMessage({sourceName:o,targetName:l,stream:s,streamId:n,reason:g(e)}),t.promise}},r)}_createStreamSink(e){const t=this,r=this.actionHandler[e.action],i=e.streamId,n=this.sourceName,s=e.sourceName,o=this.comObj,u={enqueue(e,r=1,o){if(this.isCancelled)return;const l=this.desiredSize;this.desiredSize-=r,l>0&&this.desiredSize<=0&&(this.sinkCapability=(0,a.createPromiseCapability)(),this.ready=this.sinkCapability.promise),t._postMessage({sourceName:n,targetName:s,stream:c,streamId:i,chunk:e},o)},close(){this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:n,targetName:s,stream:l,streamId:i}),delete t.streamSinks[i])},error(e){(0,a.assert)(e instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:n,targetName:s,stream:h,streamId:i,reason:g(e)}))},sinkCapability:(0,a.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};u.sinkCapability.resolve(),u.ready=u.sinkCapability.promise,this.streamSinks[i]=u,new Promise((function(t){t(r(e.data,u))})).then((function(){o.postMessage({sourceName:n,targetName:s,stream:f,streamId:i,success:!0})}),(function(e){o.postMessage({sourceName:n,targetName:s,stream:f,streamId:i,reason:g(e)})}))}_processStreamMessage(e){const t=e.streamId,r=this.sourceName,i=e.sourceName,n=this.comObj;switch(e.stream){case f:e.success?this.streamControllers[t].startCall.resolve():this.streamControllers[t].startCall.reject(g(e.reason));break;case d:e.success?this.streamControllers[t].pullCall.resolve():this.streamControllers[t].pullCall.reject(g(e.reason));break;case u:if(!this.streamSinks[t]){n.postMessage({sourceName:r,targetName:i,stream:d,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:p}=this.streamSinks[e.streamId];new Promise((function(e){e(p&&p())})).then((function(){n.postMessage({sourceName:r,targetName:i,stream:d,streamId:t,success:!0})}),(function(e){n.postMessage({sourceName:r,targetName:i,stream:d,streamId:t,reason:g(e)})}));break;case c:if((0,a.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,a.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 h:(0,a.assert)(this.streamControllers[t],"error should have stream controller"),this.streamControllers[t].controller.error(g(e.reason)),this._deleteStreamController(t);break;case o:e.success?this.streamControllers[t].cancelCall.resolve():this.streamControllers[t].cancelCall.reject(g(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(g(e.reason)))})).then((function(){n.postMessage({sourceName:r,targetName:i,stream:o,streamId:t,success:!0})}),(function(e){n.postMessage({sourceName:r,targetName:i,stream:o,streamId:t,reason:g(e)})})),this.streamSinks[t].sinkCapability.reject(g(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 a=r(2),i=r(13);t.Metadata=class{constructor(e){(0,a.assert)("string"==typeof e,"Metadata: input is not a string"),e=this._repair(e);const t=(new i.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,a){return String.fromCharCode(64*t+8*r+1*a)})).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 a="";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">"+a}))}_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 a=t.childNodes;for(let e=0,t=a.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 a=t;function i(){for(;a"!==e[a]&&"/"!==e[a];)++a;const n=e.substring(t,a);for(i();a"!==e[a]&&"/"!==e[a]&&"?"!==e[a];){i();let t="",n="";for(;a"!==e[r]&&"/"!==e[r];)++r;const a=e.substring(t,r);!function(){for(;r"!==e[r+1]);)++r;return{name:a,value:e.substring(i,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 a=this._parseProcessingInstruction(e,r);if("?>"!==e.substring(r+a.parsed,r+a.parsed+2))return void this.onError(n);this.onPi(a.name,a.value),r+=a.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(i);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 a=e.indexOf("[",r+8);let i=!1;if(t=e.indexOf(">",r+8),t<0)return void this.onError(s);if(a>0&&t>a){if(t=e.indexOf("]>",r+8),t<0)return void this.onError(s);i=!0}const n=e.substring(r+8,t+(i?1:0));this.onDoctype(n),r=t+(i?2:1)}}break;default:const h=this._parseContent(e,r);if(null===h)return void this.onError(l);let u=!1;if("/>"===e.substring(r+h.parsed,r+h.parsed+2))u=!0;else if(">"!==e.substring(r+h.parsed,r+h.parsed+1))return void this.onError(c);this.onBeginElement(h.name,h.attributes,u),r+=h.parsed+(u?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,a.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,a.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new i(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 i{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,a.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,a.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 a=r(2);t.WebGLContext=class{constructor({enable:e=!1}){this._enabled=!0===e}get isEnabled(){let e=this._enabled;return e&&(e=i.tryInitGL()),(0,a.shadow)(this,"isEnabled",e)}composeSMask({layer:e,mask:t,properties:r}){return i.composeSMask(e,t,r)}drawFigures({width:e,height:t,backgroundColor:r,figures:a,context:n}){return i.drawFigures(e,t,r,a,n)}clear(){i.cleanup()}};var i=function(){function e(e,t,r){var a=e.createShader(r);if(e.shaderSource(a,t),e.compileShader(a),!e.getShaderParameter(a,e.COMPILE_STATUS)){var i=e.getShaderInfoLog(a);throw new Error("Error during shader compilation: "+i)}return a}function t(t,r){return e(t,r,t.VERTEX_SHADER)}function r(t,r){return e(t,r,t.FRAGMENT_SHADER)}function a(e,t){for(var r=e.createProgram(),a=0,i=t.length;a 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; } ")]);i.useProgram(c);var h={};h.gl=i,h.canvas=e,h.resolutionLocation=i.getUniformLocation(c,"u_resolution"),h.positionLocation=i.getAttribLocation(c,"a_position"),h.backdropLocation=i.getUniformLocation(c,"u_backdrop"),h.subtypeLocation=i.getUniformLocation(c,"u_subtype");var u=i.getAttribLocation(c,"a_texCoord"),d=i.getUniformLocation(c,"u_image"),f=i.getUniformLocation(c,"u_mask"),g=i.createBuffer();i.bindBuffer(i.ARRAY_BUFFER,g),i.bufferData(i.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]),i.STATIC_DRAW),i.enableVertexAttribArray(u),i.vertexAttribPointer(u,2,i.FLOAT,!1,0,0),i.uniform1i(d,0),i.uniform1i(f,1),l=h}();var f=l,g=f.canvas,p=f.gl;g.width=u,g.height=d,p.viewport(0,0,p.drawingBufferWidth,p.drawingBufferHeight),p.uniform2f(f.resolutionLocation,u,d),h.backdrop?p.uniform4f(f.resolutionLocation,h.backdrop[0],h.backdrop[1],h.backdrop[2],1):p.uniform4f(f.resolutionLocation,0,0,0,0),p.uniform1i(f.subtypeLocation,"Luminosity"===h.subtype?1:0);var m=i(p,e,p.TEXTURE0),b=i(p,c,p.TEXTURE1),y=p.createBuffer();return p.bindBuffer(p.ARRAY_BUFFER,y),p.bufferData(p.ARRAY_BUFFER,new Float32Array([0,0,u,0,0,d,0,d,u,0,u,d]),p.STATIC_DRAW),p.enableVertexAttribArray(f.positionLocation),p.vertexAttribPointer(f.positionLocation,2,p.FLOAT,!1,0,0),p.clearColor(0,0,0,0),p.enable(p.BLEND),p.blendFunc(p.ONE,p.ONE_MINUS_SRC_ALPHA),p.clear(p.COLOR_BUFFER_BIT),p.drawArrays(p.TRIANGLES,0,6),p.flush(),p.deleteTexture(m),p.deleteTexture(b),p.deleteBuffer(y),g},drawFigures:function(e,i,l,h,u){c||function(){var e,i;o(),e=s,s=null,i=n,n=null;var l=a(i,[t(i," 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(i," precision mediump float; varying vec4 v_color; void main() { gl_FragColor = v_color; } ")]);i.useProgram(l);var h={};h.gl=i,h.canvas=e,h.resolutionLocation=i.getUniformLocation(l,"u_resolution"),h.scaleLocation=i.getUniformLocation(l,"u_scale"),h.offsetLocation=i.getUniformLocation(l,"u_offset"),h.positionLocation=i.getAttribLocation(l,"a_position"),h.colorLocation=i.getAttribLocation(l,"a_color"),c=h}();var d=c,f=d.canvas,g=d.gl;f.width=e,f.height=i,g.viewport(0,0,g.drawingBufferWidth,g.drawingBufferHeight),g.uniform2f(d.resolutionLocation,e,i);var p,m,b,y=0;for(p=0,m=h.length;p0){n.style.borderWidth=`${t.borderStyle.width}px`,t.borderStyle.style!==i.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 i.AnnotationBorderStyleType.SOLID:n.style.borderStyle="solid";break;case i.AnnotationBorderStyleType.DASHED:n.style.borderStyle="dashed";break;case i.AnnotationBorderStyleType.BEVELED:(0,i.warn)("Unimplemented border style: beveled");break;case i.AnnotationBorderStyleType.INSET:(0,i.warn)("Unimplemented border style: inset");break;case i.AnnotationBorderStyleType.UNDERLINE:n.style.borderBottomStyle="solid"}t.color?n.style.borderColor=i.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 a=new m({container:e,trigger:t,color:r.color,title:r.title,modificationDate:r.modificationDate,contents:r.contents,hideWrapper:!0}).render();a.style.left=e.style.width,e.appendChild(a)}render(){(0,i.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,a.addLinkAttributes)(r,{url:e.url,target:e.newWindow?a.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 h 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 a="normal";t.black?a="900":t.bold&&(a="bold"),r.fontWeight=a,r.fontStyle=t.italic?"italic":"normal";const i=t.loadedName?`"${t.loadedName}", `:"",n=t.fallbackName||"Helvetica, sans-serif";r.fontFamily=i+n}}class u 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 d 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 g 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 p 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}),a=parseFloat(t.style.left),i=parseFloat(t.style.width);return this.container.style.transformOrigin=`-${a+i}px -${t.style.top}`,this.container.style.left=`${a+i}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],a=.7*(255-r[1])+r[1],n=.7*(255-r[2])+r[2];t.style.backgroundColor=i.Util.makeCssRgb(0|e,0|a,0|n)}const n=document.createElement("h1");n.textContent=this.title,t.appendChild(n);const s=a.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,a=r.length;e1)p=!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&&(p=!0)}if(p&&(h.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 y,v,w=(h.vertical?r.height:r.width)*t._viewport.scale,A=u;0!==c?(y=[m,b,-b,m,f,g],v=a.Util.getAxialAlignedBoundingBox([0,0,w,A],y)):v=[f,g,f+w,g+A],t._bounds.push({left:v[0],top:v[1],right:v[2],bottom:v[3],div:s,size:[w,A],m:y})}}function r(e){if(!e._canceled){var t=e._textDivs,r=e._capability,a=t.length;if(a>1e5)return e._renderingDone=!0,void r.resolve();if(!e._textContentStream)for(var i=0;i0&&(a=a?Math.min(r,a):r)}return a}function n(e){for(var t=e._bounds,r=e._viewport,n=function(e,t,r){var a=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,a);var i=new Array(r.length);return a.forEach((function(e){var t=e.index;i[t]={left:e.x1New,top:0,right:e.x2New,bottom:0}})),r.map((function(t,r){var n=i[r],s=a[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,a),a.forEach((function(e){var t=e.index;i[t].top=e.x1New,i[t].bottom=e.x2New})),i}(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=(i=(a=r[s]).boundary).x2>e.x1?i.index>e.index?i.x1New:e.x1:void 0===i.x2New?(i.x2+e.x1)/2:i.x2New)>l&&(l=c)}for(e.x1New=l,s=t;s<=n;s++)void 0===(i=(a=r[s]).boundary).x2New?i.x2>e.x1?i.index>e.index&&(i.x2New=i.x2):i.x2New=l:i.x2New>l&&(i.x2New=Math.max(l,i.x2));var h=[],u=null;for(s=t;s<=n;s++){var d=(i=(a=r[s]).boundary).x2>e.x2?i:e;u===d?h[h.length-1].end=a.end:(h.push({start:a.start,end:a.end,boundary:d}),u=d)}for(r[t].start=0&&r[o].start>=i.y1;o--)f=r[o].boundary===i;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 a.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 a=0,i=e.length;a0&&(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,a.createPromiseCapability)();let i=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:a})=>{a?t.resolve():(Object.assign(i,r.styles),this._processItems(r.items,i),e())}),t.reject)};this._reader=this._textContentStream.getReader(),e()}}t.promise.then((()=>{i=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 a=0,i=this._textDivs.length;a0?(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),i.style.padding=r.join(" "),t.length&&(i.style.transform=t.join(" "))):(i.style.padding=null,i.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=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SVGGraphics=void 0;var a=r(2),i=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"],h=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,a,i){let n=i;const s=r.length;a[n]=s>>24&255,a[n+1]=s>>16&255,a[n+2]=s>>8&255,a[n+3]=255&s,n+=4,a[n]=255&e.charCodeAt(0),a[n+1]=255&e.charCodeAt(1),a[n+2]=255&e.charCodeAt(2),a[n+3]=255&e.charCodeAt(3),n+=4,a.set(r,n),n+=r.length;const o=function(e,r,a){let i=-1;for(let n=r;n>>8^t[r]}return-1^i}(a,i+4,n);a[n]=o>>24&255,a[n+1]=o>>16&255,a[n+2]=o>>8&255,a[n+3]=255&o}function i(e){let t=e.length;const r=65535,a=Math.ceil(t/r),i=new Uint8Array(2+t+5*a+4);let n=0;i[n++]=120,i[n++]=156;let s=0;for(;t>r;)i[n++]=0,i[n++]=255,i[n++]=255,i[n++]=0,i[n++]=0,i.set(e.subarray(s,s+r),n),n+=r,s+=r,t-=r;i[n++]=1,i[n++]=255&t,i[n++]=t>>8&255,i[n++]=255&~t,i[n++]=(65535&~t)>>8&255,i.set(e.subarray(s),n),n+=e.length-s;const o=function(e,t,r){let a=1,i=0;for(let n=t;n>24&255,i[n++]=o>>16&255,i[n++]=o>>8&255,i[n++]=255&o,i}function s(t,s,o,l){const c=t.width,h=t.height;let u,d,f;const g=t.data;switch(s){case a.ImageKind.GRAYSCALE_1BPP:d=0,u=1,f=c+7>>3;break;case a.ImageKind.RGB_24BPP:d=2,u=8,f=3*c;break;case a.ImageKind.RGBA_32BPP:d=6,u=8,f=4*c;break;default:throw new Error("invalid format")}const p=new Uint8Array((1+f)*h);let m=0,b=0;for(let e=0;e>24&255,c>>16&255,c>>8&255,255&c,h>>24&255,h>>16&255,h>>8&255,255&h,u,d,0,0,0]),v=function(e){if(!n.isNodeJS)return i(e);try{let t;t=parseInt(process.versions.node)>=8?e:Buffer.from(e);const r=__webpack_require__(2216).deflateSync(t,{level:9});return r instanceof Uint8Array?r:new Uint8Array(r)}catch(e){(0,a.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+e)}return i(e)}(p),w=e.length+36+y.length+v.length,A=new Uint8Array(w);let k=0;return A.set(e,k),k+=e.length,r("IHDR",y,A,k),k+=12+y.length,r("IDATA",v,A,k),k+=12+v.length,r("IEND",new Uint8Array(0),A,k),(0,a.createObjectURL)(A,"image/png",o)}return function(e,t,r){return s(e,void 0===e.kind?a.ImageKind.GRAYSCALE_1BPP:e.kind,t,r)}}();class u{constructor(){this.fontSizeScale=1,this.fontWeight=e.fontWeight,this.fontSize=0,this.textMatrix=a.IDENTITY_MATRIX,this.fontMatrix=a.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=a.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 d(e){let t=[];const r=[];for(const a of e)"save"!==a.fn?"restore"===a.fn?t=r.pop():t.push(a):(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 g(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 p=0,m=0,b=0;t.SVGGraphics=s=class{constructor(e,t,r=!1){this.svgFactory=new i.DOMSVGFactory,this.current=new u,this.transformMatrix=a.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 a.OPS)this._operatorIdMapping[a.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,i=t.length;e{e.get(t,r)}));this.current.dependencies.push(r)}return Promise.all(this.current.dependencies)}transform(e,t,r,i,n,s){const o=[e,t,r,i,n,s];this.transformMatrix=a.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=a.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(e)),r)))}convertOpList(e){const t=this._operatorIdMapping,r=e.argsArray,a=e.fnArray,i=[];for(let e=0,n=a.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=a.Util.makeCssRgb(e,t,r)}setFillAlpha(e){this.current.fillAlpha=e}setFillRGBColor(e,t,r){this.current.fillColor=a.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,i=a.Util.inverseTransform(this.transformMatrix),n=a.Util.applyTransform([0,0],i),s=a.Util.applyTransform([0,r],i),o=a.Util.applyTransform([t,0],i),l=a.Util.applyTransform([t,r],i),c=Math.min(n[0],s[0],o[0],l[0]),h=Math.min(n[1],s[1],o[1],l[1]),u=Math.max(n[0],s[0],o[0],l[0]),d=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",h),f.setAttributeNS(null,"width",u-c),f.setAttributeNS(null,"height",d-h),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],i=e[3]||a.IDENTITY_MATRIX,[n,s,o,l]=e[4],c=e[5],h=e[6],u=e[7],d="shading"+b++,[f,g]=a.Util.applyTransform([n,s],i),[p,m]=a.Util.applyTransform([o,l],i),[y,v]=a.Util.singularValueDecompose2dScale(i),w=c*y,A=h*v,k=this.svgFactory.createElement("svg:pattern");k.setAttributeNS(null,"id",d),k.setAttributeNS(null,"patternUnits","userSpaceOnUse"),k.setAttributeNS(null,"width",w),k.setAttributeNS(null,"height",A),k.setAttributeNS(null,"x",`${f}`),k.setAttributeNS(null,"y",`${g}`);const S=this.svg,x=this.transformMatrix,C=this.current.fillColor,_=this.current.strokeColor,P=this.svgFactory.create(p-f,m-g);if(this.svg=P,this.transformMatrix=i,2===u){const e=a.Util.makeCssRgb(...t);this.current.fillColor=e,this.current.strokeColor=e}return this.executeOpTree(this.convertOpList(r)),this.svg=S,this.transformMatrix=x,this.current.fillColor=C,this.current.strokeColor=_,k.appendChild(P.childNodes[0]),this.defs.appendChild(k),`url(#${d})`}_makeShadingPattern(e){switch(e[0]){case"RadialAxial":const t="shading"+b++,r=e[3];let i;switch(e[1]){case"axial":const r=e[4],a=e[5];i=this.svgFactory.createElement("svg:linearGradient"),i.setAttributeNS(null,"id",t),i.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),i.setAttributeNS(null,"x1",r[0]),i.setAttributeNS(null,"y1",r[1]),i.setAttributeNS(null,"x2",a[0]),i.setAttributeNS(null,"y2",a[1]);break;case"radial":const n=e[4],s=e[5],o=e[6],l=e[7];i=this.svgFactory.createElement("svg:radialGradient"),i.setAttributeNS(null,"id",t),i.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),i.setAttributeNS(null,"cx",s[0]),i.setAttributeNS(null,"cy",s[1]),i.setAttributeNS(null,"r",l),i.setAttributeNS(null,"fx",n[0]),i.setAttributeNS(null,"fy",n[1]),i.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]),i.appendChild(t)}return this.defs.appendChild(i),`url(#${t})`;case"Mesh":return(0,a.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 i=r.x,n=r.y,s=[],o=0;for(const r of e)switch(0|r){case a.OPS.rectangle:i=t[o++],n=t[o++];const e=i+t[o++],r=n+t[o++];s.push("M",f(i),f(n),"L",f(e),f(n),"L",f(e),f(r),"L",f(i),f(r),"Z");break;case a.OPS.moveTo:i=t[o++],n=t[o++],s.push("M",f(i),f(n));break;case a.OPS.lineTo:i=t[o++],n=t[o++],s.push("L",f(i),f(n));break;case a.OPS.curveTo:i=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(i),f(n)),o+=6;break;case a.OPS.curveTo2:s.push("C",f(i),f(n),f(t[o]),f(t[o+1]),f(t[o+2]),f(t[o+3])),i=t[o+2],n=t[o+3],o+=4;break;case a.OPS.curveTo3:i=t[o+2],n=t[o+3],s.push("C",f(t[o]),f(t[o+1]),f(i),f(n),f(i),f(n)),o+=4;break;case a.OPS.closePath:s.push("Z")}s=s.join(" "),r.path&&e.length>0&&e[0]!==a.OPS.rectangle&&e[0]!==a.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(i,n)}endPath(){const e=this.current;if(e.path=null,!this.pendingClip)return;if(!e.element)return void(this.pendingClip=null);const t="clippath"+p++,r=this.svgFactory.createElement("svg:clipPath");r.setAttributeNS(null,"id",t),r.setAttributeNS(null,"transform",g(this.transformMatrix));const a=e.element.cloneNode(!0);"evenodd"===this.pendingClip?a.setAttributeNS(null,"clip-rule","evenodd"):a.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,r.appendChild(a),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,a.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 a=r.dashArray;1!==t&&a.length>0&&(a=a.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",a.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,a.warn)(`Dependent image with object ID ${e} is not ready yet`)}paintInlineImageXObject(e,t){const r=e.width,a=e.height,i=h(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(a)),this.current.element=n,this.clip("nonzero");const s=this.svgFactory.createElement("svg:image");s.setAttributeNS(o,"xlink:href",i),s.setAttributeNS(null,"x","0"),s.setAttributeNS(null,"y",f(-a)),s.setAttributeNS(null,"width",f(r)+"px"),s.setAttributeNS(null,"height",f(a)+"px"),s.setAttributeNS(null,"transform",`scale(${f(1/r)} ${f(-1/a)})`),t?t.appendChild(s):this._ensureTransformGroup().appendChild(s)}paintImageMaskXObject(e){const t=this.current,r=e.width,a=e.height,i=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(a)),s.setAttributeNS(null,"fill",i),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],a=this.svgFactory.createElement("svg:rect");a.setAttributeNS(null,"x",t[0]),a.setAttributeNS(null,"y",t[1]),a.setAttributeNS(null,"width",f(e)),a.setAttributeNS(null,"height",f(r)),this.current.element=a,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 a=this.svgFactory.createElement("svg:g");return a.setAttributeNS(null,"transform",g(e.transform)),t.appendChild(a),this.svg=a,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",g(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 a=r(2),i=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,a.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new p(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 g(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 h{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,a.createPromiseCapability)(),this._headersCapability=(0,a.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,a.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 a.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class u{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=(0,a.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,a.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 d(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 h{constructor(e){super(e);const t=t=>{if(404===t.statusCode){const e=new a.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,i.validateRangeRequestCapabilities)({getResponseHeader:r,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n,this._contentLength=s||this._contentLength,this._filename=(0,i.extractFilenameFromHeader)(r)};this._request=null,"http:"===this._url.protocol?this._request=s.request(d(this._url,e.httpHeaders),t):this._request=o.request(d(this._url,e.httpHeaders),t),this._request.on("error",(e=>{this._storedError=e,this._headersCapability.reject(e)})),this._request.end()}}class g extends u{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 i=e=>{if(404!==e.statusCode)this._setReadableStream(e);else{const e=new a.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=e}};this._request=null,"http:"===this._url.protocol?this._request=s.request(d(this._url,this._httpHeaders),i):this._request=o.request(d(this._url,this._httpHeaders),i),this._request.on("error",(e=>{this._storedError=e})),this._request.end()}}class p extends h{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 a.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 u{constructor(e,t,r){super(e);let a=decodeURIComponent(this._url.path);c.test(this._url.href)&&(a=a.replace(/^\//,"")),this._setReadableStream(n.createReadStream(a,{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 a.MissingPDFException('Missing PDF "'+t+'".'):new a.UnexpectedResponseException("Unexpected server response ("+e+') while retrieving PDF "'+t+'".',e)},t.extractFilenameFromHeader=function(e){const t=e("Content-Disposition");if(t){let e=(0,i.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:i}){(0,a.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||i||!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 a=r(2),i=r(21)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFilenameFromContentDispositionHeader=function(e){let t=!0,r=a("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 i=a("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(r=i.exec(e));){let[,e,a,i]=r;if(e=parseInt(e,10),e in t){if(0===e)break}else t[e]=[a,i]}const n=[];for(let e=0;e=2&&r.onHeadersReceived&&(r.onHeadersReceived(),delete r.onHeadersReceived),4!==i.readyState)return;if(!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],0===i.status&&this.isHttp)return void(r.onError&&r.onError(i.status));const n=i.status||200;if((200!==n||206!==r.expectedStatus)&&n!==r.expectedStatus)return void(r.onError&&r.onError(i.status));const s=function(e){const t=e.response;return"string"!=typeof t?t:(0,a.stringToBytes)(t).buffer}(i);if(206===n){const e=i.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(i.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,a.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,a.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:a,suggestedLength:n}=(0,i.validateRangeRequestCapabilities)({getResponseHeader:r,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});a&&(this._isRangeSupported=!0),this._contentLength=n||this._contentLength,this._filename=(0,i.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,i.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,a.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 a={onDone:this._onDone.bind(this),onProgress:this._onProgress.bind(this)};this._requestId=e.requestRange(t,r,a),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,a.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 a=r(2),i=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 a=e[r];void 0!==a&&t.append(r,a)}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,a.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,a.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,i.validateResponseStatus)(e.status))throw(0,i.createResponseStatusError)(e.status,r);this._reader=e.body.getReader(),this._headersCapability.resolve();const t=t=>e.headers.get(t),{allowRangeRequests:n,suggestedLength:s}=(0,i.validateRangeRequestCapabilities)({getResponseHeader:t,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n,this._contentLength=s||this._contentLength,this._filename=(0,i.extractFilenameFromHeader)(t),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new a.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,a.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,i.validateResponseStatus)(e.status))throw(0,i.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 a,i=r(4155);a=function(){return function(e){var t={};function r(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},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 a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(a,i,function(t){return e[t]}.bind(null,i));return a},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 a.WorkerMessageHandler}});var a=r(1)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerMessageHandler=t.WorkerTask=void 0;var a=r(2),i=r(5),n=r(6),s=r(4),o=r(45),l=r(46),c=r(8),h=function(){function e(e){this.name=e,this.terminated=!1,this._capability=(0,a.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=h;var u,d={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 a=255===t[0];e.postMessageTransfers=a,e.send("test",{supportTransfers:a})})),e.on("configure",(function(e){(0,a.setVerbosityLevel)(e.verbosity)})),e.on("GetDocRequest",(function(e){return d.createDocumentHandler(e,t)}))},createDocumentHandler(e,t){var r,s=!1,u=null,d=[];const f=(0,a.getVerbosityLevel)(),g=e.apiVersion,p="2.5.207";if(g!==p)throw new Error(`The API version "${g}" 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,y=e.docBaseUrl,v=e.docId+"_worker",w=new o.MessageHandler(v,b,t);function A(){if(s)throw new Error("Worker was terminated")}function k(e){d.push(e)}function S(e){e.finish();var t=d.indexOf(e);d.splice(t,1)}async function x(e){await r.ensureDoc("checkHeader"),await r.ensureDoc("parseStartXRef"),await r.ensureDoc("parse",[e]),e||await r.ensureDoc("checkFirstPage");const[t,a]=await Promise.all([r.ensureDoc("numPages"),r.ensureDoc("fingerprint")]);return{numPages:t,fingerprint:a}}function C(e,t){var r=(0,a.createPromiseCapability)();let i;var s=e.source;if(s.data){try{i=new n.LocalPdfManager(b,s.data,s.password,t,y),r.resolve(i)}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 h=o.getFullReader();h.headersReady.then((function(){if(h.isRangeSupported){var e=s.disableAutoFetch||h.isStreamingSupported;i=new n.NetworkPdfManager(b,o,{msgHandler:w,password:s.password,length:h.contentLength,disableAutoFetch:e,rangeChunkSize:s.rangeChunkSize},t,y);for(let e=0;e=a.VerbosityLevel.INFOS?Date.now():0;r.getOperatorList({handler:w,sink:t,task:n,intent:e.intent,renderInteractiveForms:e.renderInteractiveForms}).then((function(e){S(n),s&&(0,a.info)(`page=${i+1} - getOperatorList: time=${Date.now()-s}ms, len=${e.length}`),t.close()}),(function(e){S(n),n.terminated||(w.send("UnsupportedFeature",{featureId:a.UNSUPPORTED_FEATURES.errorOperatorList}),t.error(e))}))}))}),this),w.on("GetTextContent",(function(e,t){var i=e.pageIndex;t.onPull=function(e){},t.onCancel=function(e){},r.getPage(i).then((function(r){var n=new h("GetTextContent: page "+i);k(n);const s=f>=a.VerbosityLevel.INFOS?Date.now():0;r.extractTextContent({handler:w,task:n,sink:t,normalizeWhitespace:e.normalizeWhitespace,combineTextItems:e.combineTextItems}).then((function(){S(n),s&&(0,a.info)(`page=${i+1} - getTextContent: time=`+(Date.now()-s)+"ms"),t.close()}),(function(e){S(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 a.AbortException("Worker was terminated."));const e=r.cleanup();t.push(e),r=null}else(0,i.clearPrimitiveCaches)();return u&&u(new a.AbortException("Worker was terminated.")),d.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){A(),w.send("GetDoc",{pdfInfo:e})}function i(e){if(A(),e instanceof a.PasswordException){var t=new h(`PasswordException: response ${e.code}`);k(t),w.sendWithPromise("PasswordRequest",e).then((function({password:e}){S(t),r.updatePassword(e),n()})).catch((function(){S(t),w.send("DocException",e)}))}else e instanceof a.InvalidPDFException||e instanceof a.MissingPDFException||e instanceof a.UnexpectedResponseException||e instanceof a.UnknownErrorException?w.send("DocException",e):w.send("DocException",new a.UnknownErrorException(e.message,e.toString()))}function n(){A(),x(!1).then(t,(function(e){A(),e instanceof c.XRefParseException?(r.requestLoadedStream(),r.onLoadedStream().then((function(){A(),x(!0).then(t,i)}))):i(e)}),i)}A(),C(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 a.AbortException("Worker was terminated.")),new Error("Worker was terminated");(r=e).onLoadedStream().then((function(e){w.send("DataLoaded",{length:e.bytes.byteLength})}))})).then(n,i)}(e),e=null})),v},initializeFromPort(e){var t=new o.MessageHandler("worker","main",e);d.setup(t,e),t.send("ready",null)}};t.WorkerMessageHandler=d,"undefined"==typeof window&&!s.isNodeJS&&"undefined"!=typeof self&&"function"==typeof(u=self).postMessage&&"onmessage"in u&&d.initializeFromPort(self)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayByteLength=d,t.arraysToBytes=function(e){const t=e.length;if(1===t&&e[0]instanceof Uint8Array)return e[0];let r=0;for(let a=0;at}),e.promise=new Promise((function(r,a){e.resolve=function(e){t=!0,r(e)},e.reject=function(e){t=!0,a(e)}})),e},t.getVerbosityLevel=function(){return i},t.info=function(e){i>=a.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 a=new URL(t,r);return r.origin===a.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(h,"")},t.setVerbosityLevel=function(e){Number.isInteger(e)&&(i=e)},t.shadow=l,t.string32=function(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)},t.stringToBytes=u,t.stringToPDFString=function(e){const t=e.length,r=[];if("þ"===e[0]&&"ÿ"===e[1])for(let a=2;a=a.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 h=/\x00/g;function u(e){o("string"==typeof e,"Invalid argument for stringToBytes");const t=e.length,r=new Uint8Array(t);for(let a=0;ae[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 a=[e[0],e[2],t[0],t[2]].sort(r),i=[e[1],e[3],t[1],t[3]].sort(r),n=[];return e=m.normalizeRect(e),t=m.normalizeRect(t),a[0]===e[0]&&a[1]===t[0]||a[0]===t[0]&&a[1]===e[0]?(n[0]=a[1],n[2]=a[2],i[0]===e[1]&&i[1]===t[1]||i[0]===t[1]&&i[1]===e[1]?(n[1]=i[1],n[3]=i[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],y=function(){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return function(t,r,a=!1){if(!a&&URL.createObjectURL){const e=new Blob([t],{type:r});return URL.createObjectURL(e)}let i=`data:${r};base64,`;for(let r=0,a=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,a=Math.floor(e/r),n=Math.floor((t-1)/r)+1;for(let r=a;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,a=this.pos,i=this.end;if(!e){i>this.progressiveDataLength&&this.ensureRange(a,i);const e=r.subarray(a,i);return t?new Uint8ClampedArray(e):e}let n=a+e;n>i&&(n=i),n>this.progressiveDataLength&&this.ensureRange(a,n),this.pos=n;const s=r.subarray(a,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 a(){}t?e+t>this.progressiveDataLength&&this.ensureRange(e,e+t):e>=this.progressiveDataLength&&this.ensureByte(e),a.prototype=Object.create(this),a.prototype.getMissingChunks=function(){const e=this.chunkSize,t=Math.floor(this.start/e),r=Math.floor((this.end-1)/e)+1,a=[];for(let e=t;e{const s=o=>{try{if(!o.done){const e=o.value;return i.push(e),n+=(0,a.arrayByteLength)(e),r.isStreamingSupported&&this.onProgress({loaded:n}),void r.read().then(s,t)}const l=(0,a.arraysToBytes)(i);i=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,a.isEmptyObj)(r))return Promise.resolve();const i=(0,a.createPromiseCapability)();this.promisesByRequest[t]=i;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 i.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 i.promise}getStream(){return this.stream}requestRange(e,t){t=Math.min(t,this.length);const r=this.getBeginChunk(e),a=this.getEndChunk(t),i=[];for(let e=r;e=0&&a+1!==n&&(t.push({beginChunk:r,endChunk:a+1}),r=n),i+1===e.length&&t.push({beginChunk:r,endChunk:n+1}),a=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,i=r?this.progressiveDataLength:e.begin,n=i+t.byteLength,s=Math.floor(i/this.chunkSize),o=n100){(0,a.warn)(`getInheritableProperty: maximum loop count exceeded for "${t}"`);break}e=e.get("Parent")}return n},t.toRomanNumerals=function(e,t=!1){(0,a.assert)(Number.isInteger(e)&&e>0,"The number should be a positive integer.");const r=[];let i;for(;e>=1e3;)e-=1e3,r.push("M");i=e/100|0,e%=100,r.push(o[i]),i=e/10|0,e%=10,r.push(o[10+i]),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 a=r(2);class i extends a.BaseException{constructor(e,t){super(`Missing data [${e}, ${t})`),this.begin=e,this.end=t}}t.MissingDataException=i;class n extends a.BaseException{}t.XRefEntryException=n;class s extends a.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 a=r(2),i=r(10),n=r(5),s=r(8),o=r(12),l=r(25),c=r(22),h=r(11),u=r(26),d=r(27),f=r(41);const g=[0,0,612,792];function p(e,t){return"display"===t&&e.viewable||"print"===t&&e.printable}class m{constructor({pdfManager:e,xref:t,pageIndex:r,pageDict:a,ref:i,fontCache:n,builtInCMapCache:s,globalImageCache:o,pdfFunctionFactory:l}){this.pdfManager=e,this.pageIndex=r,this.pageDict=a,this.xref=t,this.ref=i,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,a.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,a.warn)(`Empty /${e} entry.`)}return null}get mediaBox(){return(0,a.shadow)(this,"mediaBox",this._getBoundingBox("MediaBox")||g)}get cropBox(){return(0,a.shadow)(this,"cropBox",this._getBoundingBox("CropBox")||this.mediaBox)}get userUnit(){let e=this.pageDict.get("UserUnit");return(!(0,a.isNum)(e)||e<=0)&&(e=1),(0,a.shadow)(this,"userUnit",e)}get view(){const{cropBox:e,mediaBox:t}=this;let r;if(e===t||(0,a.isArrayEqual)(e,t))r=t;else{const i=a.Util.intersect(e,t);i&&i[2]-i[0]!=0&&i[3]-i[1]!=0?r=i:(0,a.warn)("Empty /CropBox and /MediaBox intersection.")}return(0,a.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,a.shadow)(this,"rotate",e)}getContentStream(){const e=this.content;let t;if(Array.isArray(e)){const r=this.xref,a=[];for(const t of e)a.push(r.fetchIfRef(t));t=new o.StreamsSequenceStream(a)}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 i.ObjectLoader(this.resources,e,this.xref).load()))}getOperatorList({handler:e,sink:t,task:r,intent:i,renderInteractiveForms:n}){const s=this.pdfManager.ensure(this,"getContentStream"),o=this.loadResources(["ExtGState","ColorSpace","Pattern","Shading","XObject","Font"]),l=new d.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((([a])=>{const n=new u.OperatorList(i,t,this.pageIndex);return e.send("StartRenderPage",{transparency:l.hasBlendModes(this.resources),pageIndex:this.pageIndex,intent:i}),l.getOperatorList({stream:a,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)p(e,i)&&s.push(e.getOperatorList(l,r,n).catch((function(e){return(0,a.warn)(`getOperatorList - ignoring annotation data during "${r.name}" task: "${e}".`),null})));return Promise.all(s).then((function(t){e.addOp(a.OPS.beginAnnotations,[]);for(const r of t)e.addOpList(r);return e.addOp(a.OPS.endAnnotations,[]),e.flush(!0),{length:e.totalLength}}))}))}extractTextContent({handler:e,task:t,normalizeWhitespace:r,sink:a,combineTextItems:i}){const n=this.pdfManager.ensure(this,"getContentStream"),s=this.loadResources(["ExtGState","XObject","Font"]);return Promise.all([n,s]).then((([n])=>new d.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:i,sink:a})))}getAnnotationsData(e){return this._parsedAnnotations.then((function(t){const r=[];for(let a=0,i=t.length;a{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,a.warn)(`_parsedAnnotations: "${e}".`),null})));return Promise.all(e).then((function(e){return e.filter((e=>!!e))}))}));return(0,a.shadow)(this,"_parsedAnnotations",e)}}t.Page=m;const b=new Uint8Array([37,80,68,70,45]),y=new Uint8Array([115,116,97,114,116,120,114,101,102]),v=new Uint8Array([101,110,100,111,98,106]),w=/^[1-9]\.[0-9]$/;function A(e,t,r=1024,a=!1){const i=t.length,n=e.peekBytes(r),s=n.length-i;if(s<=0)return!1;if(a){const r=i-1;let a=n.length-1;for(;a>=r;){let s=0;for(;s=i)return e.pos+=a-r,!0;a--}}else{let r=0;for(;r<=s;){let a=0;for(;a=i)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,a.isArrayBuffer)(t))throw new Error("PDFDocument: Unknown argument type");r=new o.Stream(t)}if(r.length<=0)throw new a.InvalidPDFException("The PDF file is empty, i.e. its size is zero bytes.");this.pdfManager=e,this.stream=r,this.xref=new i.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,a.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,a.info)("Cannot fetch Collection dictionary.")}}get linearization(){let e=null;try{e=h.Linearization.create(this.stream)}catch(e){if(e instanceof s.MissingDataException)throw e;(0,a.info)(e)}return(0,a.shadow)(this,"linearization",e)}get startXRef(){const e=this.stream;let t=0;if(this.linearization)e.reset(),A(e,v)&&(t=e.pos+6-e.start);else{const r=1024,a=y.length;let i=!1,n=e.end;for(;!i&&n>0;)n-=r-a,n<0&&(n=0),e.pos=n,i=A(e,y,r,!0);if(i){let r;e.skip(9);do{r=e.getByte()}while((0,s.isWhiteSpace)(r));let a="";for(;r>=32&&r<=57;)a+=String.fromCharCode(r),r=e.getByte();t=parseInt(a,10),isNaN(t)&&(t=0)}}return(0,a.shadow)(this,"startXRef",t)}checkHeader(){const e=this.stream;if(e.reset(),!A(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 i.Catalog(this.pdfManager,this.xref)}get numPages(){const e=this.linearization,t=e?e.numPages:this.catalog.numPages;return(0,a.shadow)(this,"numPages",t)}get documentInfo(){const e={Title:a.isString,Author:a.isString,Subject:a.isString,Keywords:a.isString,Creator:a.isString,Producer:a.isString,CreationDate:a.isString,ModDate:a.isString,Trapped:n.isName};let t=this.pdfFormatVersion;"string"==typeof t&&w.test(t)||((0,a.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 i;try{i=this.xref.trailer.get("Info")}catch(e){if(e instanceof s.MissingDataException)throw e;(0,a.info)("The document information dictionary is invalid.")}if((0,n.isDict)(i))for(const t of i.getKeys()){const s=i.get(t);if(e[t])e[t](s)?r[t]="string"!=typeof s?s:(0,a.stringToPDFString)(s):(0,a.info)(`Bad value in document info for "${t}".`);else if("string"==typeof t){let e;if((0,a.isString)(s))e=(0,a.stringToPDFString)(s);else{if(!((0,n.isName)(s)||(0,a.isNum)(s)||(0,a.isBool)(s))){(0,a.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,a.shadow)(this,"documentInfo",r)}get fingerprint(){let e;const t=this.xref.trailer.get("ID");e=Array.isArray(t)&&t[0]&&(0,a.isString)(t[0])&&"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"!==t[0]?(0,a.stringToBytes)(t[0]):(0,c.calculateMD5)(this.stream.getByteRange(0,1024),0,1024);const r=[];for(let t=0,a=e.length;t{if((0,n.isDict)(e,"Page")||(0,n.isDict)(e)&&!e.has("Type")&&e.has("Contents"))return i&&!t.pageKidsCountCache.has(i)&&t.pageKidsCountCache.put(i,1),[e,i];throw new a.FormatError("The Linearization dictionary doesn't point to a valid Page dictionary.")})).catch((r=>((0,a.info)(r),t.getPageDict(e))))}getPage(e){if(void 0!==this._pagePromises[e])return this._pagePromises[e];const{catalog:t,linearization:r}=this,a=r&&r.pageFirst===e?this._getLinearizationPage(e):t.getPageDict(e);return this._pagePromises[e]=a.then((([r,a])=>new m({pdfManager:this.pdfManager,xref:this.xref,pageIndex:e,pageDict:r,ref:a,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 a=r(2),i=r(5),n=r(11),s=r(8),o=r(22),l=r(23),c=r(24);function h(e){return(0,i.isDict)(e)?e.get("D"):e}class u{constructor(e,t){if(this.pdfManager=e,this.xref=t,this.catDict=t.getCatalogObj(),!(0,i.isDict)(this.catDict))throw new a.FormatError("Catalog object is not a dictionary.");this.fontCache=new i.RefSetCache,this.builtInCMapCache=new Map,this.globalImageCache=new c.GlobalImageCache,this.pageKidsCountCache=new i.RefSetCache}get metadata(){const e=this.catDict.getRaw("Metadata");if(!(0,i.isRef)(e))return(0,a.shadow)(this,"metadata",null);const t=!(this.xref.encrypt&&this.xref.encrypt.encryptMetadata),r=this.xref.fetch(e,t);let n;if(r&&(0,i.isDict)(r.dict)){const e=r.dict.get("Type"),t=r.dict.get("Subtype");if((0,i.isName)(e,"Metadata")&&(0,i.isName)(t,"XML"))try{n=(0,a.stringToUTF8String)((0,a.bytesToString)(r.getBytes()))}catch(e){if(e instanceof s.MissingDataException)throw e;(0,a.info)("Skipping invalid metadata.")}}return(0,a.shadow)(this,"metadata",n)}get toplevelPagesDict(){const e=this.catDict.get("Pages");if(!(0,i.isDict)(e))throw new a.FormatError("Invalid top-level pages dictionary.");return(0,a.shadow)(this,"toplevelPagesDict",e)}get documentOutline(){let e=null;try{e=this._readDocumentOutline()}catch(e){if(e instanceof s.MissingDataException)throw e;(0,a.warn)("Unable to read document outline.")}return(0,a.shadow)(this,"documentOutline",e)}_readDocumentOutline(){let e=this.catDict.get("Outlines");if(!(0,i.isDict)(e))return null;if(e=e.getRaw("First"),!(0,i.isRef)(e))return null;const t={items:[]},r=[{obj:e,parent:t}],n=new i.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 a.FormatError("Invalid outline item encountered.");const h={url:null,dest:null};u.parseDestDictionary({destDict:c,resultObj:h,docBaseUrl:this.pdfManager.docBaseUrl});const d=c.get("Title"),f=c.get("F")||0,g=c.getArray("C"),p=c.get("Count");let m=o;!Array.isArray(g)||3!==g.length||0===g[0]&&0===g[1]&&0===g[2]||(m=l.ColorSpace.singletons.rgb.getRgb(g,0));const b={dest:h.dest,url:h.url,unsafeUrl:h.unsafeUrl,newWindow:h.newWindow,title:(0,a.stringToPDFString)(d),color:m,count:Number.isInteger(p)?p:void 0,bold:!!(2&f),italic:!!(1&f),items:[]};t.parent.items.push(b),e=c.getRaw("First"),(0,i.isRef)(e)&&!n.has(e)&&(r.push({obj:e,parent:b}),n.put(e)),e=c.getRaw("Next"),(0,i.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,a.warn)("Unable to read permissions.")}return(0,a.shadow)(this,"permissions",e)}_readPermissions(){const e=this.xref.trailer.get("Encrypt");if(!(0,i.isDict)(e))return null;let t=e.get("P");if(!(0,a.isNum)(t))return null;t+=2**32;const r=[];for(const e in a.PermissionFlag){const i=a.PermissionFlag[e];t&i&&r.push(i)}return r}get numPages(){const e=this.toplevelPagesDict.get("Count");if(!Number.isInteger(e))throw new a.FormatError("Page count in top-level pages dictionary is not an integer.");return(0,a.shadow)(this,"numPages",e)}get destinations(){const e=this._readDests(),t=Object.create(null);if(e instanceof g){const r=e.getAll();for(const e in r)t[e]=h(r[e])}else e instanceof i.Dict&&e.forEach((function(e,r){r&&(t[e]=h(r))}));return(0,a.shadow)(this,"destinations",t)}getDestination(e){const t=this._readDests();return t instanceof g||t instanceof i.Dict?h(t.get(e)||null):null}_readDests(){const e=this.catDict.get("Names");return e&&e.has("Dests")?new g(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,a.warn)("Unable to read page labels.")}return(0,a.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 p(e,this.xref).getAll();let l="",c=1;for(let e=0,h=this.numPages;e=1))throw new a.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,i=97,n="a"===r?i:t,o=c-1,h=String.fromCharCode(n+o%e),u=[];for(let t=0,r=o/e|0;t<=r;t++)u.push(h);l=u.join("");break;default:if(r)throw new a.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,i.isName)(e))switch(e.name){case"SinglePage":case"OneColumn":case"TwoColumnLeft":case"TwoColumnRight":case"TwoPageLeft":case"TwoPageRight":t=e.name}return(0,a.shadow)(this,"pageLayout",t)}get pageMode(){const e=this.catDict.get("PageMode");let t="UseNone";if((0,i.isName)(e))switch(e.name){case"UseNone":case"UseOutlines":case"UseThumbs":case"FullScreen":case"UseOC":case"UseAttachments":t=e.name}return(0,a.shadow)(this,"pageMode",t)}get viewerPreferences(){const e={HideToolbar:a.isBool,HideMenubar:a.isBool,HideWindowUI:a.isBool,FitWindow:a.isBool,CenterWindow:a.isBool,DisplayDocTitle:a.isBool,NonFullScreenPageMode:i.isName,Direction:i.isName,ViewArea:i.isName,ViewClip:i.isName,PrintArea:i.isName,PrintClip:i.isName,PrintScaling:i.isName,Duplex:i.isName,PickTrayByPDFSize:a.isBool,PrintPageRange:Array.isArray,NumCopies:Number.isInteger},t=this.catDict.get("ViewerPreferences");let r=null;if((0,i.isDict)(t))for(const i in e){if(!t.has(i))continue;const n=t.get(i);if(!e[i](n)){(0,a.info)(`Bad value in ViewerPreferences for "${i}".`);continue}let s;switch(i){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 a.FormatError(`viewerPreferences - expected a boolean value for: ${i}`);s=n}void 0!==s?(r||(r=Object.create(null)),r[i]=s):(0,a.info)(`Bad value in ViewerPreferences for "${i}".`)}return(0,a.shadow)(this,"viewerPreferences",r)}get openAction(){const e=this.catDict.get("OpenAction");let t=null;if((0,i.isDict)(e)){const r=new i.Dict(this.xref);r.set("A",e);const a={url:null,dest:null,action:null};u.parseDestDictionary({destDict:r,resultObj:a}),Array.isArray(a.dest)?(t||(t=Object.create(null)),t.dest=a.dest):a.action&&(t||(t=Object.create(null)),t.action=a.action)}else Array.isArray(e)&&(t||(t=Object.create(null)),t.dest=e);return(0,a.shadow)(this,"openAction",t)}get attachments(){const e=this.catDict.get("Names");let t=null;if(e&&e.has("EmbeddedFiles")){const r=new g(e.getRaw("EmbeddedFiles"),this.xref).getAll();for(const e in r){const i=new m(r[e],this.xref);t||(t=Object.create(null)),t[(0,a.stringToPDFString)(e)]=i.serializable}}return(0,a.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,i.isName)(r,"JavaScript"))return;let n=e.get("JS");if((0,i.isStream)(n))n=(0,a.bytesToString)(n.getBytes());else if(!(0,a.isString)(n))return;t||(t=[]),t.push((0,a.stringToPDFString)(n))}if(e&&e.has("JavaScript")){const t=new g(e.getRaw("JavaScript"),this.xref).getAll();for(const e in t){const a=t[e];(0,i.isDict)(a)&&r(a)}}const n=this.catDict.get("OpenAction");return(0,i.isDict)(n)&&(0,i.isName)(n.get("S"),"JavaScript")&&r(n),(0,a.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 a of r)if(a.loadedName===e)return void a.fallback(t)}))}cleanup(e=!1){(0,i.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,a.createPromiseCapability)(),r=[this.catDict.getRaw("Pages")],n=new i.RefSet,s=this.xref,o=this.pageKidsCountCache;let l,c=0;return function h(){for(;r.length;){const u=r.pop();if((0,i.isRef)(u)){if(l=o.get(u),l>0&&c+l=0){const t=u.objId;if(t&&!o.has(t)&&o.put(t,l),c+l<=e){c+=l;continue}}const d=u.get("Kids");if(!Array.isArray(d)){if((0,i.isName)(u.get("Type"),"Page")||!u.has("Type")&&u.has("Contents")){if(c===e)return void t.resolve([u,null]);c++;continue}return void t.reject(new a.FormatError("Page dictionary kids object is not an array."))}for(let e=d.length-1;e>=0;e--)r.push(d[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,i.isRefsEqual)(r,e)&&!(0,i.isDict)(t,"Page")&&(!(0,i.isDict)(t)||t.has("Type")||!t.has("Contents")))throw new a.FormatError("The reference does not point to a /Page dictionary.");if(!t)return null;if(!(0,i.isDict)(t))throw new a.FormatError("Node must be a dictionary.");return n=t.getRaw("Parent"),t.getAsync("Parent")})).then((function(e){if(!e)return null;if(!(0,i.isDict)(e))throw new a.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 h=c[0],u=c[1];if(!Number.isInteger(h)||!Number.isInteger(u))throw new a.FormatError(`Invalid XRef range fields: ${h}, ${u}`);if(!Number.isInteger(s)||!Number.isInteger(o)||!Number.isInteger(l))throw new a.FormatError(`Invalid XRef entry fields length: ${h}, ${u}`);for(t=i.entryNum;t=e.length);)r+=String.fromCharCode(a),a=e[t];return r}function t(e,t,r){for(var a=r.length,i=e.length,n=0;t=a)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]),h=new Uint8Array([115,116,97,114,116,120,114,101,102]);const u=new Uint8Array([111,98,106]);var d=new Uint8Array([47,88,82,101,102]);this.entries.length=0;var f=this.stream;f.pos=0;for(var g,p,m=f.getBytes(),b=f.start,y=m.length,v=[],w=[];b=y)break;A=m[b]}while(10!==A&&13!==A);else++b}for(g=0,p=w.length;g0;){const s=t.fetchIfRef(n.shift());if(!(0,i.isDict)(s))continue;if(s.has("Kids")){const e=s.get("Kids");for(let t=0,i=e.length;t10)return(0,a.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 a=s+o>>1,i=t.fetchIfRef(n[a]).get("Limits");if(et.fetchIfRef(i[1]))){r=t.fetchIfRef(n[a]);break}s=a+1}}if(s>o)return null}const n=r.get(this._type);if(Array.isArray(n)){let r=0,i=n.length-2;for(;r<=i;){const a=r+i>>1,s=a+(1&a),o=t.fetchIfRef(n[s]);if(eo))return t.fetchIfRef(n[s+1]);r=s+2}}(0,a.info)(`Falling back to an exhaustive search, for key "${e}", in "${this._type}" tree.`);for(let r=0,i=n.length;r>")&&!(0,n.isEOF)(this.buf1);){if(!(0,n.isName)(this.buf1)){(0,i.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;a.set(t,this.getObj(e))}if((0,n.isEOF)(this.buf1)){if(!this.recoveryMode)throw new i.FormatError("End of file inside dictionary");return a}return(0,n.isCmd)(this.buf2,"stream")?this.allowStreams?this.makeStream(a,e):a:(this.shift(),a);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,a,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,i.assert)(2===n,"findDefaultInlineStreamEnd - invalid state."),32===r||10===r||13===r){a=e.pos;const t=e.peekBytes(10);for(let e=0,a=t.length;e127)){n=0;break}if(2===n)break}else n=0;-1===r&&((0,i.warn)("findDefaultInlineStreamEnd: Reached the end of the stream without finding a valid EI marker"),a&&((0,i.warn)('... trying to recover by using the last "EI" occurrence.'),e.skip(-(e.pos-a))));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,a,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:a=e.getUint16(),a>2?e.skip(a-2):e.skip(-2)}if(n)break}const s=e.pos-t;return-1===r?((0,i.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 a=e.pos-t;return-1===r?((0,i.warn)("Inline ASCII85Decode image stream: EOD marker not found, searching for /EI/ instead."),e.skip(-a),this.findDefaultInlineStreamEnd(e)):(this.inlineStreamSkipEI(e),a)}findASCIIHexDecodeInlineStreamEnd(e){const t=e.pos;let r;for(;-1!==(r=e.getByte())&&62!==r;);const a=e.pos-t;return-1===r?((0,i.warn)("Inline ASCIIHexDecode image stream: EOD marker not found, searching for /EI/ instead."),e.skip(-a),this.findDefaultInlineStreamEnd(e)):(this.inlineStreamSkipEI(e),a)}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,a=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 i.FormatError("Dictionary key must be a name object");const t=this.buf1.name;if(this.shift(),(0,n.isEOF)(this.buf1))break;a.set(t,this.getObj(e))}-1!==t.beginInlineImagePos&&(s=r.pos-t.beginInlineImagePos);const o=a.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 h;h="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 d,f=r.makeSubStream(c,h,a);if(h<1e3&&s<5552){const e=f.getBytes();f.reset();const a=r.pos;r.pos=t.beginInlineImagePos;const i=r.getBytes(s);r.pos=a,d=u(e)+"_"+u(i);const o=this.imageCache[d];if(void 0!==o)return this.buf2=n.Cmd.get("EI"),this.shift(),o.reset(),o}return e&&(f=e.createStream(f,h)),f=this.filter(f,a,h),f.dict=a,void 0!==d&&(f.cacheKey=`inline_${h}_${d}`,this.imageCache[d]=f),this.buf2=n.Cmd.get("EI"),this.shift(),f}_findStreamLength(e,t){const{stream:r}=this.lexer;r.pos=e;const a=t.length;for(;r.pos=a)return r.pos+=s,r.pos-e;s++}r.pos+=n}return-1}makeStream(e,t){const r=this.lexer;let a=r.stream;r.skipToNextLine();const o=a.pos-1;let l=e.get("Length");if(Number.isInteger(l)||((0,i.info)(`Bad length "${l}" in stream`),l=0),a.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=a.peekBytes(r+1)[r];if(!(0,s.isWhiteSpace)(e))break;(0,i.info)(`Found "${(0,i.bytesToString)(l)}" when searching for endstream command.`),t=c;break}}if(t<0)throw new i.FormatError("Missing endstream command.")}l=t,r.nextChar(),this.shift(),this.shift()}return this.shift(),a=a.makeSubStream(o,l,e),t&&(a=t.createStream(a,l)),a=this.filter(a,e,l),a.dict=e,a}filter(e,t,r){let a=t.get("Filter","F"),s=t.get("DecodeParms","DP");if((0,n.isName)(a))return Array.isArray(s)&&(0,i.warn)("/DecodeParms should not contain an Array, when /Filter contains a Name."),this.makeFilter(e,a.name,r,s);let o=r;if(Array.isArray(a)){const t=a,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 p{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,a=0;if(45===e?(a=-1,e=this.nextChar(),45===e&&(e=this.nextChar())):43===e&&(a=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===a&&((0,s.isWhiteSpace)(e)||-1===e))return(0,i.warn)("Lexer.getNumber - treating a single decimal point as zero."),0;throw new i.FormatError(`Invalid number: ${String.fromCharCode(e)} (charCode ${e})`)}a=a||1;let n=e-48,o=0,l=1;for(;(e=this.nextChar())>=0;)if(e>=48&&e<=57){const a=e-48;t?o=10*o+a:(0!==r&&(r*=10),n=10*n+a)}else if(46===e){if(0!==r)break;r=1}else if(45===e)(0,i.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)),a*n}getString(){let e=1,t=!1;const r=this.strBuf;r.length=0;let a=this.nextChar();for(;;){let n=!1;switch(0|a){case-1:(0,i.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(a=this.nextChar(),a){case-1:(0,i.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(a));break;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:let e=15&a;a=this.nextChar(),n=!0,a>=48&&a<=55&&(e=(e<<3)+(15&a),a=this.nextChar(),a>=48&&a<=55&&(n=!1,e=(e<<3)+(15&a))),r.push(String.fromCharCode(e));break;case 13:10===this.peekChar()&&this.nextChar();break;case 10:break;default:r.push(String.fromCharCode(a))}break;default:r.push(String.fromCharCode(a))}if(t)break;n||(a=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,i.warn)("Lexer_getName: NUMBER SIGN (#) should be followed by a hexadecimal number."),r.push("#");break}const a=g(e);if(-1!==a){t=e,e=this.nextChar();const n=g(e);if(-1===n){if((0,i.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(a<<4|n))}else r.push("#",String.fromCharCode(e))}else r.push(String.fromCharCode(e));return r.length>127&&(0,i.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,i.warn)(`getHexString - ignoring invalid character: ${e}`):(0,i.warn)("getHexString - ignoring additional invalid characters.")}getHexString(){const e=this.strBuf;e.length=0;let t,r,a=this.currentChar,n=!0;for(this._hexStringNumWarn=0;;){if(a<0){(0,i.warn)("Unterminated hex string");break}if(62===a){this.nextChar();break}if(1!==f[a]){if(n){if(t=g(a),-1===t){this._hexStringWarn(a),a=this.nextChar();continue}}else{if(r=g(a),-1===r){this._hexStringWarn(a),a=this.nextChar();continue}e.push(String.fromCharCode(t<<4|r))}n=!n,a=this.nextChar()}else a=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 i.FormatError(`Illegal character: ${t}`)}let r=String.fromCharCode(t);const a=this.knownCommands;let s=a&&void 0!==a[r];for(;(t=this.nextChar())>=0&&!f[t];){const e=r+String.fromCharCode(t);if(s&&void 0===a[e])break;if(128===r.length)throw new i.FormatError(`Command token too long: ${r.length}`);r=e,s=a&&void 0!==a[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=p,t.Linearization=class{static create(e){function t(e,t,r=!1){const a=e.get(t);if(Number.isInteger(a)&&(r?a>=0:a>0))return a;throw new Error(`The "${t}" parameter in the linearization dictionary is invalid.`)}const r=new d({lexer:new p(e),xref:null}),a=r.getObj(),s=r.getObj(),o=r.getObj(),l=r.getObj();let c,h;if(!(Number.isInteger(a)&&Number.isInteger(s)&&(0,n.isCmd)(o,"obj")&&(0,n.isDict)(l)&&(0,i.isNum)(c=l.get("Linearized"))&&c>0))return null;if((h=t(l,"L"))!==e.length)throw new Error('The "L" parameter in the linearization dictionary does not equal the stream length.');return{length:h,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 a=r(2),i=r(5),n=r(8),s=function(){function e(e,t,r,a){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=a}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,a=this.pos,i=this.end;if(!e){const e=r.subarray(a,i);return t?new Uint8ClampedArray(e):e}var n=a+e;n>i&&(n=i),this.pos=n;const s=r.subarray(a,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,a){return new e(this.bytes.buffer,t,r,a)}},e}();t.Stream=s;var o=function(){function e(e){const t=(0,a.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.minBufferLengthi&&(r=i)}else{for(;!this.eof;)this.readBlock();r=this.bufferLength}this.pos=r;const n=this.buffer.subarray(a,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 a=e+t;this.bufferLength<=a&&!this.eof;)this.readBlock();return new s(this.buffer,e,t,r)},getByteRange(e,t){(0,a.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,a=e.length;r>e,this.codeSize=i-=e,t},s.prototype.getCode=function(e){for(var t,r=this.str,i=e[0],n=e[1],s=this.codeSize,o=this.codeBuf;s>16,h=65535&l;if(c<1||s>c,this.codeSize=s-c,h},s.prototype.generateHuffmanTable=function(e){var t,r=e.length,a=0;for(t=0;ta&&(a=e[t]);for(var i=1<>=1;for(t=h;t>=1)){var h,u;if(1===c)h=i,u=n;else{if(2!==c)throw new a.FormatError("Unknown block type in flate stream");var d,f=this.getBits(5)+257,g=this.getBits(5)+1,p=this.getBits(4)+4,m=new Uint8Array(e.length);for(d=0;d0;)k[d++]=w}h=this.generateHuffmanTable(k.subarray(0,f)),u=this.generateHuffmanTable(k.subarray(f,A))}for(var C=(s=this.buffer)?s.length:0,_=this.bufferLength;;){var P=this.getCode(h);if(P<256)_+1>=C&&(C=(s=this.ensureBuffer(_+1)).length),s[_++]=P;else{if(256===P)return void(this.bufferLength=_);var T=(P=t[P-=257])>>16;T>0&&(T=this.getBits(T)),o=(65535&P)+T,P=this.getCode(u),(T=(P=r[P])>>16)>0&&(T=this.getBits(T));var I=(65535&P)+T;_+o>=C&&(C=(s=this.ensureBuffer(_+o)).length);for(var E=0;E15))throw new a.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),a=this.bits,i=this.colors,n=this.str.getBytes(e);if(this.eof=!n.length,!this.eof){var s,o=0,l=0,c=0,h=0,u=t;if(1===a&&1===i)for(s=0;s>1,d^=d>>2,o=(1&(d^=d>>4))<<7,r[u++]=d}else if(8===a){for(s=0;s>8&255,r[u++]=255&g}}else{var p=new Uint8Array(i+1),m=(1<>c-a)&m,c-=a,l=l<=8&&(r[y++]=l>>h-8&255,h-=8);h>0&&(r[y++]=(l<<8-h)+(o&(1<<8-h)-1))}this.bufferLength+=e}},e.prototype.readBlockPng=function(){var e=this.rowBytes,t=this.pixBytes,r=this.str.getByte(),i=this.str.getBytes(e);if(this.eof=!i.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,h,u=n;switch(r){case 0:for(l=0;l>1)+i[l];for(;l>1)+i[l]&255,u++;break;case 4:for(l=0;l0;e=(0,this.decrypt)(e,!t);var r,a=this.bufferLength,i=e.length,n=this.ensureBuffer(a+i);for(r=0;r=0;--a)r[i+a]=255&o,o>>=8}}else this.eof=!0},e}();t.Ascii85Stream=f;var g=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),a=this.bufferLength,i=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)}i<0?i=o:(r[a++]=i<<4|o,i=-1)}i>=0&&this.eof&&(r[a++]=i<<4,i=-1),this.firstDigit=i,this.bufferLength=a}else this.eof=!0},e}();t.AsciiHexStream=g;var p=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,a=e[0];if(a<128){if((t=this.ensureBuffer(r+a+1))[r++]=e[1],a>0){var i=this.str.getBytes(a);t.set(i,r),r+=a}}else{a=257-a;var n=e[1];t=this.ensureBuffer(r+a+1);for(var s=0;s>>t&(1<0;if(b<256)d[0]=b,f=1;else{if(!(b>=258)){if(256===b){h=9,s=258,f=0;continue}this.eof=!0,delete this.lzwState;break}if(b=0;t--)d[t]=o[r],r=c[r];else d[f++]=d[0]}if(y&&(c[s]=u,l[s]=l[u]+1,o[s]=d[0],h=++s+n&s+n-1?h:0|Math.min(Math.log(s+n)/.6931471805599453+1,12)),u=b,a<(g+=f)){do{a+=512}while(ae.getByte()};this.ccittFaxDecoder=new i.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 a=r(2);const i=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]],i=[[-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,a=t.EndOfBlock;for(null==a&&(a=!0),this.eoblock=a,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,i=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,h;if(this.err=!1,this.nextLine2D){for(l=0;r[l]=64);do{c+=h=this._getWhiteCode()}while(h>=64)}else{do{o+=h=this._getWhiteCode()}while(h>=64);do{c+=h=this._getBlackCode()}while(h>=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+=h=this._getWhiteCode()}while(h>=64);this._addPixels(r[this.codingPos]+o,s),s^=1}let u=!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),u=!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&&u&&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,a.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 i=this.codingPos;e>r[i]&&(e>this.columns&&((0,a.info)("row is wrong length"),this.err=!0,e=this.columns),1&i^t&&++i,r[i]=e),this.codingPos=i},_addPixelsNeg(e,t){const r=this.codingLine;let i=this.codingPos;if(e>r[i])e>this.columns&&((0,a.info)("row is wrong length"),this.err=!0,e=this.columns),1&i^t&&++i,r[i]=e;else if(e0&&e=n){const e=a[t-n];if(e[0]===i)return this._eatBits(i),[!0,e[1],!0]}}return[!1,0,!1]},_getTwoDimCode(){let r,i=0;if(this.eoblock){if(i=this._lookBits(7),r=t[i],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,a.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]:i[n>>3],t[0]>0)return this._eatBits(t[0]),t[1]}else{let e=this._findTableCode(1,9,i);if(e[0])return e[1];if(e=this._findTableCode(11,12,r),e[0])return e[1]}return(0,a.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,a.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=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Jbig2Stream=void 0;var a=r(5),i=r(12),n=r(16),s=r(2);const o=function(){function e(e,t,r,a){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(){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,a.isDict)(this.params)){const e=this.params.get("JBIG2Globals");if((0,a.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),i=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 a=e.getContexts("IAID"),i=1,n=0;n=R&&_=O)for(z=z<<1&y,f=0;f=0&&T=0&&(E=B[P][T])&&(z|=E<=e?R<<=1:R=R<<1|x[F][L];for(d=0;d=k||L<0||L>=A?R<<=1:R=R<<1|a[F][L];var O=C.readBit(_,R);I[E]=O}}return x}function m(e,t,a,i,n,s,c,h,u,d,f,g,m,b,y,v,w,A,k){if(e&&t)throw new o("refinement with Huffman is not supported");var S,x,C=[];for(S=0;S1&&(i=e?k.readBits(A):r(T,"IAIT",P));var L=c*I+i,R=e?b.symbolIDTable.decode(k):l(T,P,u),O=t&&(e?k.readBit():r(T,"IARI",P)),M=h[R],D=M[0].length,N=M.length;if(O){var B=r(T,"IARDW",P),U=r(T,"IARDH",P);M=p(D+=B,N+=U,y,M,(B>>1)+r(T,"IARDX",P),(U>>1)+r(T,"IARDY",P),!1,v,w)}var q,j,z,H=L-(1&g?0:N-1),G=F-(2&g?D-1:0);if(d){for(q=0;q>5&7,u=[31&l],d=t+6;if(7===l){h=536870911&(0,i.readUint32)(e,d-1),d+=3;var f=h+7>>3;for(u[0]=e[d++];--f>0;)u.push(e[d++])}else if(5===l||6===l)throw new o("invalid referred-to flags");r.retainBits=u;let g=4;r.number<=256?g=1:r.number<=65536&&(g=2);var p,m,b=[];for(p=0;p>>24&255,k[3]=y.height>>16&255,k[4]=y.height>>8&255,k[5]=255&y.height,p=d,m=e.length;p>2&3,d.huffmanDWSelector=f>>4&3,d.bitmapSizeSelector=f>>6&1,d.aggregationInstancesSelector=f>>7&1,d.bitmapCodingContextUsed=!!(256&f),d.bitmapCodingContextRetained=!!(512&f),d.template=f>>10&3,d.refinementTemplate=f>>12&1,h+=2,!d.huffman){for(s=0===d.template?4:1,a=[],n=0;n>2&3,g.stripSize=1<>4&3,g.transposed=!!(64&p),g.combinationOperator=p>>7&3,g.defaultPixelValue=p>>9&1,g.dsOffset=p<<17>>27,g.refinementTemplate=p>>15&1,g.huffman){var m=(0,i.readUint16)(c,h);h+=2,g.huffmanFS=3&m,g.huffmanDS=m>>2&3,g.huffmanDT=m>>4&3,g.huffmanRefinementDW=m>>6&3,g.huffmanRefinementDH=m>>8&3,g.huffmanRefinementDX=m>>10&3,g.huffmanRefinementDY=m>>12&3,g.huffmanRefinementSizeSelector=!!(16384&m)}if(g.refinement&&!g.refinementTemplate){for(a=[],n=0;n<2;n++)a.push({x:(0,i.readInt8)(c,h),y:(0,i.readInt8)(c,h+1)}),h+=2;g.refinementAt=a}g.numberOfSymbolInstances=(0,i.readUint32)(c,h),h+=4,r=[g,l.referredTo,c,h,u];break;case 16:const e={},t=c[h++];e.mmr=!!(1&t),e.template=t>>1&3,e.patternWidth=c[h++],e.patternHeight=c[h++],e.maxPatternIndex=(0,i.readUint32)(c,h),h+=4,r=[e,l.number,c,h,u];break;case 22:case 23:const S={};S.info=v(c,h),h+=w;const x=c[h++];S.mmr=!!(1&x),S.template=x>>1&3,S.enableSkip=!!(8&x),S.combinationOperator=x>>4&7,S.defaultPixelValue=x>>7&1,S.gridWidth=(0,i.readUint32)(c,h),h+=4,S.gridHeight=(0,i.readUint32)(c,h),h+=4,S.gridOffsetX=4294967295&(0,i.readUint32)(c,h),h+=4,S.gridOffsetY=4294967295&(0,i.readUint32)(c,h),h+=4,S.gridVectorX=(0,i.readUint16)(c,h),h+=2,S.gridVectorY=(0,i.readUint16)(c,h),h+=2,r=[S,l.referredTo,c,h,u];break;case 38:case 39:var b={};b.info=v(c,h),h+=w;var y=c[h++];if(b.mmr=!!(1&y),b.template=y>>1&3,b.prediction=!!(8&y),!b.mmr){for(s=0===b.template?4:1,a=[],n=0;n>2&1,A.combinationOperator=k>>3&3,A.requiresBuffer=!!(32&k),A.combinationOperatorOverride=!!(64&k),r=[A];break;case 49:case 50:case 51:case 62:break;case 53:r=[l.number,c,h,u];break;default:throw new o(`segment type ${l.typeName}(${l.type}) is not implemented`)}var S="on"+l.typeName;S in t&&t[S].apply(t,r)}function k(e,t){for(var r=0,a=e.length;r0&&this.rootNode.buildTree(r,r.prefixLength-1)}}S.prototype={onPageInformation:function(e){this.currentPageInfo=e;var t=e.width+7>>3,r=new Uint8ClampedArray(t*e.height);if(e.defaultPixelValue)for(var a=0,i=r.length;a>3,u=s.combinationOperatorOverride?e.combinationOperator:s.combinationOperator,d=this.buffer,f=128>>(7&e.x),g=e.y*h+(e.x>>3);switch(u){case 0:for(r=0;r>=1)||(i=128,n++);g+=h}break;case 2:for(r=0;r>=1)||(i=128,n++);g+=h}break;default:throw new o(`operator ${u} is not supported`)}},onImmediateGenericRegion:function(e,r,a,i){var n=e.info,s=new t(r,a,i),o=g(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,a,n,s,c,h){let u,d;e.huffman&&(u=function(e,t,r){let a,i,n,s,l=0;switch(e.huffmanDHSelector){case 0:case 1:a=T(e.huffmanDHSelector+4);break;case 3:a=E(l,t,r),l++;break;default:throw new o("invalid Huffman DH selector")}switch(e.huffmanDWSelector){case 0:case 1:i=T(e.huffmanDWSelector+2);break;case 3:i=E(l,t,r),l++;break;default:throw new o("invalid Huffman DW selector")}return e.bitmapSizeSelector?(n=E(l,t,r),l++):n=T(1),s=e.aggregationInstancesSelector?E(l,t,r):T(1),{tableDeltaHeight:a,tableDeltaWidth:i,tableBitmapSize:n,tableAggregateInstances:s}}(e,n,this.customTables),d=new I(s,c,h));var f=this.symbols;f||(this.symbols=f={});for(var b=[],y=0,v=n.length;y1)_=m(e,t,i,w,0,I,1,a.concat(v),A,0,0,1,0,c,d,f,b,0,y);else{var E=l(S,k,A),R=r(S,"IARDX",k),O=r(S,"IARDY",k);_=p(i,w,d,E=32){let r,a,s;switch(t){case 32:if(0===e)throw new o("no previous value in symbol ID table");a=i.readBits(2)+3,r=n[e-1].prefixLength;break;case 33:a=i.readBits(3)+3,r=0;break;case 34:a=i.readBits(7)+11,r=0;break;default:throw new o("invalid code length in symbol ID table")}for(s=0;s=0;v--)F=e?L(E,h,u,!0):g(!1,h,u,r,!1,null,P,b),T[v]=F;for(R=0;R=0;w--)M=T[w][R][O]^M,D|=M<>8,U=f+R*p-O*m>>8,B>=0&&B+x<=a&&U>=0&&U+C<=n)for(v=0;v=n))for(j=y[t],q=N[v],w=0;w=0&&e>1&7),c=1+(a>>4&7),h=[];let u,d,f=n;do{u=o.readBits(l),d=o.readBits(c),h.push(new x([f,u,d,0])),f+=1<>t&1;if(t<=0)this.children[r]=new C(e);else{let a=this.children[r];a||(this.children[r]=a=new C(null)),a.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)}},_.prototype={decode(e){return this.rootNode.decodeNode(e)},assignPrefixCodes(e){const t=e.length;let r=0;for(let a=0;a>r&1,r--}if(a&&!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++]}},R.prototype={parseChunks:e=>function(e){for(var t=new S,r=0,a=e.length;r>=1}return{imgData:d,width:c,height:h}}(e);return this.width=r,this.height=a,t}},R}();t.Jbig2Image=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArithmeticDecoder=void 0;const a=[{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,i=1&e[t];const n=a[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|i,o}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JpegStream=void 0;var a=r(12),i=r(5),n=r(19),s=r(2);const o=function(){function e(e,t,r,i){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=i,a.DecodeStream.call(this,t)}return e.prototype=Object.create(a.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,a=t.length,i=new Int32Array(a);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;i++}r+10)return k--,A>>k&1;if(A=t[r++],255===A){var e=t[r++];if(e){if(220===e&&p){r+=2;const e=(0,i.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(p){const e=8*E;if(e>0&&e>>7}function x(e){for(var t=e;;){switch(typeof(t=t[S()])){case"number":return t;case"object":continue}throw new n("invalid huffman sequence")}}function C(e){for(var t=0;e>0;)t=t<<1|S(),e--;return t}function _(e){if(1===e)return 1===S()?1:-1;var t=C(e);return t>=1<0)T--;else for(var a=u,i=d;a<=i;){var n=x(t.huffmanTableAC),s=15&n,o=n>>4;if(0!==s){var l=e[a+=o];t.blockData[r+l]=_(s)*(1<>4,0==(a=15&i))l<15?(T=C(l)+(1<>4;if(0!==o){var c=e[n+=l];t.blockData[r+c]=_(o),n++}else{if(l<15)break;n+=16}}};var q,j,z,H,G=0;for(j=1===U?c[0].blocksPerLine*c[0].blocksPerColumn:b*l.mcusPerColumn;G<=j;){var W=h?Math.min(j-G,h):j;if(W>0){for(O=0;O0?"unexpected":"excessive";(0,a.warn)(`decodeScan - ${e} MCU data, current marker is: ${q.invalid}`),r=q.offset}if(!(q.marker>=65488&&q.marker<=65495))break;r+=2}return r-v}function y(e,a,i){var s,o,g,p,m,b,y,v,w,A,k,S,x,C,_,P,T,I=e.quantizationTable,E=e.blockData;if(!I)throw new n("missing required Quantization Table.");for(var F=0;F<64;F+=8)w=E[a+F],A=E[a+F+1],k=E[a+F+2],S=E[a+F+3],x=E[a+F+4],C=E[a+F+5],_=E[a+F+6],P=E[a+F+7],w*=I[F],0!=(A|k|S|x|C|_|P)?(A*=I[F+1],k*=I[F+2],S*=I[F+3],x*=I[F+4],C*=I[F+5],_*=I[F+6],P*=I[F+7],o=(s=(s=d*w+128>>8)+(o=d*x+128>>8)+1>>1)-o,T=(g=k)*u+(p=_)*h+128>>8,g=g*h-p*u+128>>8,y=(m=(m=f*(A-P)+128>>8)+(y=C<<4)+1>>1)-y,b=(v=(v=f*(A+P)+128>>8)+(b=S<<4)+1>>1)-b,p=(s=s+(p=T)+1>>1)-p,g=(o=o+g+1>>1)-g,T=m*c+v*l+2048>>12,m=m*l-v*c+2048>>12,v=T,T=b*r+y*t+2048>>12,b=b*t-y*r+2048>>12,y=T,i[F]=s+v,i[F+7]=s-v,i[F+1]=o+y,i[F+6]=o-y,i[F+2]=g+b,i[F+5]=g-b,i[F+3]=p+m,i[F+4]=p-m):(T=d*w+512>>10,i[F]=T,i[F+1]=T,i[F+2]=T,i[F+3]=T,i[F+4]=T,i[F+5]=T,i[F+6]=T,i[F+7]=T);for(var L=0;L<8;++L)w=i[L],0!=((A=i[L+8])|(k=i[L+16])|(S=i[L+24])|(x=i[L+32])|(C=i[L+40])|(_=i[L+48])|(P=i[L+56]))?(o=(s=4112+((s=d*w+2048>>12)+(o=d*x+2048>>12)+1>>1))-o,T=(g=k)*u+(p=_)*h+2048>>12,g=g*h-p*u+2048>>12,p=T,y=(m=(m=f*(A-P)+2048>>12)+(y=C)+1>>1)-y,b=(v=(v=f*(A+P)+2048>>12)+(b=S)+1>>1)-b,T=m*c+v*l+2048>>12,m=m*l-v*c+2048>>12,v=T,T=b*r+y*t+2048>>12,b=b*t-y*r+2048>>12,(w=(s=s+p+1>>1)+v)<16?w=0:w>=4080?w=255:w>>=4,(A=(o=o+g+1>>1)+(y=T))<16?A=0:A>=4080?A=255:A>>=4,(k=(g=o-g)+b)<16?k=0:k>=4080?k=255:k>>=4,(S=(p=s-p)+m)<16?S=0:S>=4080?S=255:S>>=4,(x=p-m)<16?x=0:x>=4080?x=255:x>>=4,(C=g-b)<16?C=0:C>=4080?C=255:C>>=4,(_=o-y)<16?_=0:_>=4080?_=255:_>>=4,(P=s-v)<16?P=0:P>=4080?P=255:P>>=4,E[a+L]=w,E[a+L+8]=A,E[a+L+16]=k,E[a+L+24]=S,E[a+L+32]=x,E[a+L+40]=C,E[a+L+48]=_,E[a+L+56]=P):(T=(T=d*w+8192>>14)<-2040?0:T>=2024?255:T+2056>>4,E[a+L]=T,E[a+L+8]=T,E[a+L+16]=T,E[a+L+24]=T,E[a+L+32]=T,E[a+L+40]=T,E[a+L+48]=T,E[a+L+56]=T)}function v(e,t){for(var r=t.blocksPerLine,a=t.blocksPerColumn,i=new Int16Array(64),n=0;n=a)return null;var s=(0,i.readUint16)(e,t);if(s>=65472&&s<=65534)return{invalid:null,marker:s,offset:t};for(var o=(0,i.readUint16)(e,n);!(o>=65472&&o<=65534);){if(++n>=a)return null;o=(0,i.readUint16)(e,n)}return{invalid:s.toString(16),marker:o,offset:n}}return g.prototype={parse(t,{dnlScanLines:r=null}={}){function l(){const e=(0,i.readUint16)(t,d);let r=(d+=2)+e-2;var n=w(t,r,d);n&&n.invalid&&((0,a.warn)("readDataBlock - incorrect length, current marker is: "+n.invalid),r=n.offset);var s=t.subarray(d,r);return d+=s.length,s}function c(e){for(var t=Math.ceil(e.samplesPerLine/8/e.maxH),r=Math.ceil(e.scanLines/8/e.maxV),a=0;a>4==0)for(C=0;C<64;C++)E[e[C]]=t[d++];else{if(I>>4!=1)throw new n("DQT - invalid table spec");for(C=0;C<64;C++)E[e[C]]=(0,i.readUint16)(t,d),d+=2}y[15&I]=E}break;case 65472:case 65473:case 65474:if(h)throw new n("Only single frame JPEGs supported");d+=2,(h={}).extended=65473===S,h.progressive=65474===S,h.precision=t[d++];const v=(0,i.readUint16)(t,d);d+=2,h.scanLines=r||v,h.samplesPerLine=(0,i.readUint16)(t,d),d+=2,h.components=[],h.componentIds={};var F,L=t[d++],R=0,O=0;for(x=0;x>4,D=15&t[d+1];R>4==0?k:A)[15&B]=p(U,j)}break;case 65501:d+=2,u=(0,i.readUint16)(t,d),d+=2;break;case 65498:const J=1==++m&&!r;d+=2;var z,H=t[d++],G=[];for(x=0;x>4],z.huffmanTableAC=A[15&V],G.push(z)}var X=t[d++],Y=t[d++],$=t[d++];try{var K=b(t,d,h,G,u,X,Y,$>>4,15&$,J);d+=K}catch(e){if(e instanceof s)return(0,a.warn)(`${e.message} -- attempting to re-parse the JPEG image.`),this.parse(t,{dnlScanLines:e.scanLines});if(e instanceof o){(0,a.warn)(`${e.message} -- ignoring the rest of the image data.`);break e}throw e}break;case 65500:d+=4;break;case 65535:255!==t[d]&&d--;break;default:const Z=w(t,d-2,d-3);if(Z&&Z.invalid){(0,a.warn)("JpegImage.parse - unexpected data, current marker is: "+Z.invalid),d=Z.offset;break}if(d>=t.length-1){(0,a.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: "+S.toString(16))}S=(0,i.readUint16)(t,d),d+=2}for(this.width=h.samplesPerLine,this.height=h.scanLines,this.jfif=f,this.adobe=g,this.components=[],x=0;x>8)+S[u+1];return v},get _isColorConversionNeeded(){return this.adobe?!!this.adobe.transformCode:3===this.numComponents?0!==this._colorTransform:1===this._colorTransform},_convertYccToRgb:function(e){for(var t,r,a,i=0,n=e.length;i4)throw new n("Unsupported color mode");var i=this._getLinearizedBlockData(e,t,a);if(1===this.numComponents&&r){for(var s=i.length,o=new Uint8ClampedArray(3*s),l=0,c=0;c0?Math.min(a.xcb,i.PPx-1):Math.min(a.xcb,i.PPx),i.ycb_=r>0?Math.min(a.ycb,i.PPy-1):Math.min(a.ycb,i.PPy),i}function c(e,t,r){var a=1<t.trx0?Math.ceil(t.trx1/a)-Math.floor(t.trx0/a):0,c=t.try1>t.try0?Math.ceil(t.try1/i)-Math.floor(t.try0/i):0,h=l*c;t.precinctParameters={precinctWidth:a,precinctHeight:i,numprecinctswide:l,numprecinctshigh:c,numprecincts:h,precinctWidthInSubband:s,precinctHeightInSubband:o}}function h(e,t,r){var a,i,n,s,o=r.xcb_,l=r.ycb_,c=1<>o,d=t.tby0>>l,f=t.tbx1+c-1>>o,g=t.tby1+h-1>>l,p=t.resolution.precinctParameters,m=[],b=[];for(i=d;iy.cbxMax&&(y.cbxMax=a),iy.cbyMax&&(y.cbyMax=i)):b[s]=y={cbxMin:a,cbyMin:i,cbxMax:a,cbyMax:i},n.precinct=y}t.codeblockParameters={codeblockWidth:o,codeblockHeight:l,numcodeblockwide:f-u+1,numcodeblockhigh:g-d+1},t.codeblocks=m,t.precincts=b}function u(e,t,r){for(var a=[],i=e.subbands,n=0,s=i.length;ne.codingStyleParameters.decompositionLevelsCount)){for(var t=e.resolutions[h],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(!(i>=n)){for(;t=0;--m){var b=l.resolutions[m],y=p*b.precinctParameters.precinctWidth,v=p*b.precinctParameters.precinctHeight;u=Math.min(u,y),d=Math.min(d,v),f=Math.max(f,b.precinctParameters.numprecinctswide),g=Math.max(g,b.precinctParameters.numprecinctshigh),h[m]={width:y,height:v},p<<=1}r=Math.min(r,u),a=Math.min(a,d),i=Math.max(i,f),n=Math.max(n,g),s[o]={resolutions:h,minWidth:u,minHeight:d,maxNumWide:f,maxNumHigh:g}}return{components:s,minWidth:r,minHeight:a,maxNumWide:i,maxNumHigh:n}}function v(e){for(var t=e.SIZ,r=e.currentTile.index,a=e.tiles[r],i=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 A(e,t,r,a,i,s,o,l){for(var c=a.tbx0,h=a.tby0,u=a.tbx1-a.tbx0,d=a.codeblocks,f="H"===a.type.charAt(0)?1:0,g="H"===a.type.charAt(1)?t:0,p=0,m=d.length;p=s?O:O*(1<0?1-b:0));var P=y.subbands[S],E=e[P.type];A(k,v,0,P,f?1:2**(d+E-_)*(1+C/2048),h+_-1,f,u)}p.push({width:v,height:w,items:k})}var F=g.calculate(p,i.tcx0,i.tcy0);return{left:i.tcx0,top:i.tcy0,width:F.width,height:F.height,items:F.items}}function S(e,t){for(var r=e.SIZ.Csiz,a=e.tiles[t],i=0;i>24&255,l>>16&255,l>>8&255,255&l);(0,a.warn)("Unsupported header type "+l+" ("+f+")")}h&&(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,a=e.getInt32()>>>0,i=e.getInt32()>>>0,n=e.getInt32()>>>0;e.skip(16);var o=e.getUint16();return this.width=r-i,this.height=a-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 h=t;h+1>5,g=[];d>3,I.mu=0):(I.epsilon=e[d]>>3,I.mu=(7&e[d])<<8|e[d+1],d+=2),g.push(I)}T.SPqcds=g,l.mainHeader?l.QCD=T:(l.currentTile.QCD=T,l.currentTile.QCC=[]);break;case 65373:y=(0,i.readUint16)(e,h);var E,F={};switch(d=h+2,l.SIZ.Csiz<257?E=e[d++]:(E=(0,i.readUint16)(e,d),d+=2),31&(f=e[d++])){case 0:p=8,m=!0;break;case 1:p=16,m=!1;break;case 2:p=16,m=!0;break;default:throw new Error("Invalid SQcd value "+f)}for(F.noQuantization=8===p,F.scalarExpounded=m,F.guardBits=f>>5,g=[];d>3,I.mu=0):(I.epsilon=e[d]>>3,I.mu=(7&e[d])<<8|e[d+1],d+=2),g.push(I);F.SPqcds=g,l.mainHeader?l.QCC[E]=F:l.currentTile.QCC[E]=F;break;case 65362:y=(0,i.readUint16)(e,h);var L={};d=h+2;var R=e[d++];L.entropyCoderWithCustomPrecincts=!!(1&R),L.sopMarkerUsed=!!(2&R),L.ephMarkerUsed=!!(4&R),L.progressionOrder=e[d++],L.layersCount=(0,i.readUint16)(e,d),d+=2,L.multipleComponentTransform=e[d++],L.decompositionLevelsCount=e[d++],L.xcb=2+(15&e[d++]),L.ycb=2+(15&e[d++]);var O=e[d++];if(L.selectiveArithmeticCodingBypass=!!(1&O),L.resetContextProbabilities=!!(2&O),L.terminationOnEachCodingPass=!!(4&O),L.verticallyStripe=!!(8&O),L.predictableTermination=!!(16&O),L.segmentationSymbolUsed=!!(32&O),L.reversibleTransformation=e[d++],L.entropyCoderWithCustomPrecincts){for(var M=[];d>4})}L.precinctsSizes=M}var N=[];if(L.selectiveArithmeticCodingBypass&&N.push("selectiveArithmeticCodingBypass"),L.resetContextProbabilities&&N.push("resetContextProbabilities"),L.terminationOnEachCodingPass&&N.push("terminationOnEachCodingPass"),L.verticallyStripe&&N.push("verticallyStripe"),L.predictableTermination&&N.push("predictableTermination"),N.length>0)throw c=!0,new Error("Unsupported COD options ("+N.join(", ")+")");l.mainHeader?l.COD=L:(l.currentTile.COD=L,l.currentTile.COC=[]);break;case 65424:y=(0,i.readUint16)(e,h),(b={}).index=(0,i.readUint16)(e,h+2),b.length=(0,i.readUint32)(e,h+4),b.dataEnd=b.length+h-2,b.partIndex=e[h+8],b.partsCount=e[h+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&&(S(l,b.index),v(l)),w(l,e,h,y=b.dataEnd-h);break;case 65365:case 65367:case 65368:case 65380:y=(0,i.readUint16)(e,h);break;case 65363:throw new Error("Codestream code 0xFF53 (COC) is not implemented");default:throw new Error("Unknown codestream code: "+u.toString(16))}h+=y}}catch(e){if(c||this.failOnCorruptedImage)throw new s(e.message);(0,a.warn)("JPX: Trying to recover from: "+e.message)}this.tiles=function(e){for(var t=e.SIZ,r=e.components,a=t.Csiz,i=[],n=0,s=e.tiles.length;n>2);y[w++]=e+m>>h,y[w++]=e>>h,y[w++]=e+p>>h}else for(d=0;d>h,y[w++]=g-.34413*p-.71414*m>>h,y[w++]=g+1.772*p>>h;if(A)for(d=0,w=3;d>h}else for(o=0;o>h,w+=a}i.push(v)}return i}(l),this.width=l.SIZ.Xsiz-l.SIZ.XOsiz,this.height=l.SIZ.Ysiz-l.SIZ.YOsiz,this.componentsCount=l.SIZ.Csiz}};var x=function(){function e(e,t){var r=(0,i.log2)(Math.max(e,t))+1;this.levels=[];for(var a=0;a>=1,t>>=1,a++}a--,(r=this.levels[a]).items[r.index]=i,this.currentLevel=a,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}(),C=function(){function e(e,t,r){var a=(0,i.log2)(Math.max(e,t))+1;this.levels=[];for(var n=0;nr)return this.currentLevel=a,this.propagateValues(),!1;e>>=1,t>>=1,a++}return this.currentLevel=a-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}(),_=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]),a=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 i(e,i,n,s,o){let l;this.width=e,this.height=i,l="HH"===n?a:"HL"===n?r:t,this.contextLabelTable=l;var c=e*i;let h;this.neighborsSignificance=new Uint8Array(c),this.coefficentsSign=new Uint8Array(c),h=o>14?new Uint32Array(c):o>6?new Uint16Array(c):new Uint8Array(c),this.coefficentsMagnitude=h,this.processingFlags=new Uint8Array(c);var u=new Uint8Array(c);if(0!==s)for(var d=0;d0,l=t+10&&(a=r-n,o&&(i[a-1]+=16),l&&(i[a+1]+=16),i[a]+=4),e+1=r)break;if(s[d]&=-2,!a[d]&&n[d]){var p=l[n[d]];if(e.readBit(o,p)){var m=this.decodeSignBit(g,u,d);i[d]=m,a[d]=1,this.setNeighborsSignificance(g,u,d),s[d]|=2}c[d]++,s[d]|=1}}},decodeSignBit:function(e,t,r){var a,i,n,s,o,l,c=this.width,h=this.height,u=this.coefficentsMagnitude,d=this.coefficentsSign;s=t>0&&0!==u[r-1],t+10&&0!==u[r-c],e+1=0?(o=9+a,l=this.decoder.readBit(this.contexts,o)):(o=9-a,l=1^this.decoder.readBit(this.contexts,o)),l},runMagnitudeRefinementPass:function(){for(var e,t=this.decoder,r=this.width,a=this.height,i=this.coefficentsMagnitude,n=this.neighborsSignificance,s=this.contexts,o=this.bitsDecoded,l=this.processingFlags,c=r*a,h=4*r,u=0;u>1,l=-1.586134342059924,c=-.052980118572961,h=.882911075530934,u=.443506852043971,d=1.230174104914001;for(a=(t|=0)-3,i=o+4;i--;a+=2)e[a]*=.8128930661159609;for(n=u*e[(a=t-2)-1],i=o+3;i--&&(s=u*e[a+1],e[a]=d*e[a]-n-s,i--);a+=2)n=u*e[(a+=2)+1],e[a]=d*e[a]-n-s;for(n=h*e[(a=t-1)-1],i=o+2;i--&&(s=h*e[a+1],e[a]-=n+s,i--);a+=2)n=h*e[(a+=2)+1],e[a]-=n+s;for(n=c*e[(a=t)-1],i=o+1;i--&&(s=c*e[a+1],e[a]-=n+s,i--);a+=2)n=c*e[(a+=2)+1],e[a]-=n+s;if(0!==o)for(n=l*e[(a=t+1)-1],i=o;i--&&(s=l*e[a+1],e[a]-=n+s,i--);a+=2)n=l*e[(a+=2)+1],e[a]-=n+s},e}(),I=function(){function e(){P.call(this)}return e.prototype=Object.create(P.prototype),e.prototype.filter=function(e,t,r){var a,i,n=r>>1;for(a=t|=0,i=n+1;i--;a+=2)e[a]-=e[a-1]+e[a+1]+2>>2;for(a=t+1,i=n;i--;a+=2)e[a]+=e[a-1]+e[a+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 a=r(2),i=r(5),n=r(12),s=function(){function e(e){this.a=0,this.b=0;var t,r,a=new Uint8Array(256),i=0,n=e.length;for(t=0;t<256;++t)a[t]=t;for(t=0;t<256;++t)i=i+(r=a[t])+e[t%n]&255,a[t]=a[i],a[i]=r;this.s=a}return e.prototype={encryptBlock:function(e){var t,r,a,i=e.length,n=this.a,s=this.b,o=this.s,l=new Uint8Array(i);for(t=0;t>5&255,f[a++]=r>>13&255,f[a++]=r>>21&255,f[a++]=r>>>29&255,f[a++]=0,f[a++]=0,f[a++]=0;var g=new Int32Array(16);for(a=0;a>>32-S)|0,b=A}s=s+b|0,c=c+y|0,h=h+v|0,u=u+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&h,h>>8&255,h>>16&255,h>>>24&255,255&u,u>>8&255,u>>16&255,u>>>24&255])});t.calculateMD5=c;var h=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}(),u=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 a(t){return e(t,2)^e(t,13)^e(t,22)}function i(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 h,u,d,f=1779033703,g=3144134277,p=1013904242,m=2773480762,b=1359893119,y=2600822924,v=528734635,w=1541459225,A=64*Math.ceil((c+9)/64),k=new Uint8Array(A);for(h=0;h>>29&255,k[h++]=c>>21&255,k[h++]=c>>13&255,k[h++]=c>>5&255,k[h++]=c<<3&255;var S,x=new Uint32Array(64);for(h=0;h>>10)+x[u-7]+n(x[u-15])+x[u-16];var C,_,P=f,T=g,I=p,E=m,F=b,L=y,R=v,O=w;for(u=0;u<64;++u)C=O+i(F)+t(F,L,R)+s[u]+x[u],_=a(P)+r(P,T,I),O=R,R=L,L=F,F=E+C|0,E=I,I=T,T=P,P=C+_|0;f=f+P|0,g=g+T|0,p=p+I|0,m=m+E|0,b=b+F|0,y=y+L|0,v=v+R|0,w=w+O|0}return new Uint8Array([f>>24&255,f>>16&255,f>>8&255,255&f,g>>24&255,g>>16&255,g>>8&255,255&g,p>>24&255,p>>16&255,p>>8&255,255&p,m>>24&255,m>>16&255,m>>8&255,255&m,b>>24&255,b>>16&255,b>>8&255,255&b,y>>24&255,y>>16&255,y>>8&255,255&y,v>>24&255,v>>16&255,v>>8&255,255&v,w>>24&255,w>>16&255,w>>8&255,255&w])}}();t.calculateSHA256=u;var d=function(){function e(e,t,r,a,i){e.assign(t),e.and(r),i.assign(t),i.not(),i.and(a),e.xor(i)}function t(e,t,r,a,i){e.assign(t),e.and(r),i.assign(t),i.and(a),e.xor(i),i.assign(r),i.and(a),e.xor(i)}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 a(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 i(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 h(1116352408,3609767458),new h(1899447441,602891725),new h(3049323471,3964484399),new h(3921009573,2173295548),new h(961987163,4081628472),new h(1508970993,3053834265),new h(2453635748,2937671579),new h(2870763221,3664609560),new h(3624381080,2734883394),new h(310598401,1164996542),new h(607225278,1323610764),new h(1426881987,3590304994),new h(1925078388,4068182383),new h(2162078206,991336113),new h(2614888103,633803317),new h(3248222580,3479774868),new h(3835390401,2666613458),new h(4022224774,944711139),new h(264347078,2341262773),new h(604807628,2007800933),new h(770255983,1495990901),new h(1249150122,1856431235),new h(1555081692,3175218132),new h(1996064986,2198950837),new h(2554220882,3999719339),new h(2821834349,766784016),new h(2952996808,2566594879),new h(3210313671,3203337956),new h(3336571891,1034457026),new h(3584528711,2466948901),new h(113926993,3758326383),new h(338241895,168717936),new h(666307205,1188179964),new h(773529912,1546045734),new h(1294757372,1522805485),new h(1396182291,2643833823),new h(1695183700,2343527390),new h(1986661051,1014477480),new h(2177026350,1206759142),new h(2456956037,344077627),new h(2730485921,1290863460),new h(2820302411,3158454273),new h(3259730800,3505952657),new h(3345764771,106217008),new h(3516065817,3606008344),new h(3600352804,1432725776),new h(4094571909,1467031594),new h(275423344,851169720),new h(430227734,3100823752),new h(506948616,1363258195),new h(659060556,3750685593),new h(883997877,3785050280),new h(958139571,3318307427),new h(1322822218,3812723403),new h(1537002063,2003034995),new h(1747873779,3602036899),new h(1955562222,1575990012),new h(2024104815,1125592928),new h(2227730452,2716904306),new h(2361852424,442776044),new h(2428436474,593698344),new h(2756734187,3733110249),new h(3204031479,2999351573),new h(3329325298,3815920427),new h(3391569614,3928383900),new h(3515267271,566280711),new h(3940187606,3454069534),new h(4118630271,4000239992),new h(116418474,1914138554),new h(174292421,2731055270),new h(289380356,3203993006),new h(460393269,320620315),new h(685471733,587496836),new h(852142971,1086792851),new h(1017036298,365543100),new h(1126000580,2618297676),new h(1288033470,3409855158),new h(1501505948,4234509866),new h(1607167915,987167468),new h(1816402316,1246189591)];return function(o,l,c,u){var d,f,g,p,m,b,y,v;(u=!!u)?(d=new h(3418070365,3238371032),f=new h(1654270250,914150663),g=new h(2438529370,812702999),p=new h(355462360,4144912697),m=new h(1731405415,4290775857),b=new h(2394180231,1750603025),y=new h(3675008525,1694076839),v=new h(1203062813,3204075428)):(d=new h(1779033703,4089235720),f=new h(3144134277,2227873595),g=new h(1013904242,4271175723),p=new h(2773480762,1595750129),m=new h(1359893119,2917565137),b=new h(2600822924,725511199),y=new h(528734635,4215389547),v=new h(1541459225,327033209));var w,A,k,S=128*Math.ceil((c+17)/128),x=new Uint8Array(S);for(w=0;w>>29&255,x[w++]=c>>21&255,x[w++]=c>>13&255,x[w++]=c>>5&255,x[w++]=c<<3&255;var C=new Array(80);for(w=0;w<80;w++)C[w]=new h(0,0);var _,P,T=new h(0,0),I=new h(0,0),E=new h(0,0),F=new h(0,0),L=new h(0,0),R=new h(0,0),O=new h(0,0),M=new h(0,0),D=new h(0,0),N=new h(0,0),B=new h(0,0),U=new h(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],a=n[10],n[14]=n[6],n[10]=n[2],n[6]=r,n[2]=a,r=n[15],a=n[11],i=n[7],n[15]=n[3],n[11]=r,n[7]=a,n[3]=i;for(let e=0;e<16;++e)n[e]=this._inv_s[n[e]];for(let r=0,a=16*e;r<16;++r,++a)n[r]^=t[a];for(let e=0;e<16;e+=4){const t=this._mix[n[e]],a=this._mix[n[e+1]],i=this._mix[n[e+2]],s=this._mix[n[e+3]];r=t^a>>>8^a<<24^i>>>16^i<<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],a=n[10],n[14]=n[6],n[10]=n[2],n[6]=r,n[2]=a,r=n[15],a=n[11],i=n[7],n[15]=n[3],n[11]=r,n[7]=a,n[3]=i;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 a,i,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=a;--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]=a^=r[e-32],e++,r[e]=i^=r[e-32],e++,r[e]=n^=r[e-32],e++,r[e]=s^=r[e-32],e++}return r}}t.AES256Cipher=b;var y=function(){function e(e,t){if(e.length!==t.length)return!1;for(var r=0;rs-32;){var o=t.length+i.length+a.length,l=new Uint8Array(64*o),c=e(t,i);c=e(c,a);for(var h=0,g=0;h<64;h++,g+=o)l.set(c,g);n=new m(i.subarray(0,16)).encrypt(l,i.subarray(16,32));for(var p=0,b=0;b<16;b++)p*=1,p%=3,p+=(n[b]>>>0)%3,p%=3;0===p?i=u(n,0,n.length):1===p?i=f(n,0,n.length):2===p&&(i=d(n,0,n.length)),s++}return i.subarray(0,32)}function r(){}function a(e,t){if(e.length!==t.length)return!1;for(var r=0;r>8&255,g[p++]=n>>16&255,g[p++]=n>>>24&255,u=0,d=t.length;u=4&&!h&&(g[p++]=255,g[p++]=255,g[p++]=255,g[p++]=255);var m=c(g,0,p),b=l>>3;if(o>=3)for(u=0;u<50;++u)m=c(m,0,b);var y,v=m.subarray(0,b);if(o>=3){for(p=0;p<32;++p)g[p]=e[p];for(u=0,d=t.length;u>3;if(a>=3)for(n=0;n<50;++n)d=c(d,0,d.length);if(a>=3){u=r;var g,p=new Uint8Array(f);for(n=19;n>=0;n--){for(g=0;g=4){var O=n.get("CF");(0,i.isDict)(O)&&(O.suppressEncryption=!0),this.cf=O,this.stmf=n.get("StmF")||r,this.strf=n.get("StrF")||r,this.eff=n.get("EFF")||this.stmf}}function o(e,t,r,a){var i,n,s=new Uint8Array(r.length+9);for(i=0,n=r.length;i>8&255,s[i++]=e>>16&255,s[i++]=255&t,s[i++]=t>>8&255,a&&(s[i++]=115,s[i++]=65,s[i++]=108,s[i++]=84),c(s,0,i).subarray(0,Math.min(r.length+5,16))}function l(e,t,r,n,l){if(!(0,i.isName)(t))throw new a.FormatError("Invalid crypt filter name.");var c,h=e.get(t.name);if(null!=h&&(c=h.get("CFM")),!c||"None"===c.name)return function(){return new g};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 a.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),a=function(){return new s(r)};return new w(a,a)}},n}();t.CipherTransformFactory=A},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorSpace=void 0;var a=r(2),i=r(5);class n{constructor(e,t){this.constructor===n&&(0,a.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,i){(0,a.unreachable)("Should not call ColorSpace.getRgbItem")}getRgbBuffer(e,t,r,i,n,s,o){(0,a.unreachable)("Should not call ColorSpace.getRgbBuffer")}getOutputLength(e,t){(0,a.unreachable)("Should not call ColorSpace.getOutputLength")}isPassthrough(e){return!1}isDefaultDecode(e,t){return n.isDefaultDecode(e,this.numComps)}fillRgb(e,t,r,a,i,n,s,o,l){const c=t*r;let h=null;const u=1<u&&"DeviceGray"!==this.name&&"DeviceRGB"!==this.name){const t=s<=8?new Uint8Array(u):new Uint16Array(u);for(let e=0;e8?((e+16)/116)**3:.0011070564598794539*e}function f(a,n,f,g,p,m){const b=u(0,1,n[f]*m),y=u(0,1,n[f+1]*m),v=u(0,1,n[f+2]*m),w=b**a.GR,A=y**a.GG,k=v**a.GB,S=a.MXA*w+a.MXB*A+a.MXC*k,x=a.MYA*w+a.MYB*A+a.MYC*k,C=a.MZA*w+a.MZB*A+a.MZC*k,_=o;_[0]=S,_[1]=x,_[2]=C;const P=l;!function(r,a,i){if(1===r[0]&&1===r[2])return i[0]=a[0],i[1]=a[1],void(i[2]=a[2]);const n=i;c(e,a,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,i)}(a.whitePoint,_,P);const T=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 a=d(0),i=(1-a)/(1-d(e[0])),n=1-i,s=(1-a)/(1-d(e[1])),o=1-s,l=(1-a)/(1-d(e[2])),c=1-l;r[0]=t[0]*i+n,r[1]=t[1]*s+o,r[2]=t[2]*l+c}(a.blackPoint,P,T);const I=l;!function(r,a,i){const n=i;c(e,a,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,i)}(i,T,I);const E=o;c(r,I,E),g[p]=255*h(E[0]),g[p+1]=255*h(E[1]),g[p+2]=255*h(E[2])}return class extends n{constructor(e,t,r,i){if(super("CalRGB",3),!e)throw new a.FormatError("WhitePoint missing - required for color space CalRGB");t=t||new Float32Array(3),r=r||new Float32Array([1,1,1]),i=i||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],h=t[2];if(this.blackPoint=t,this.GR=r[0],this.GG=r[1],this.GB=r[2],this.MXA=i[0],this.MYA=i[1],this.MZA=i[2],this.MXB=i[3],this.MYB=i[4],this.MZB=i[5],this.MXC=i[6],this.MYC=i[7],this.MZC=i[8],n<0||o<0||1!==s)throw new a.FormatError(`Invalid WhitePoint components for ${this.name}, no fallback available`);(l<0||c<0||h<0)&&((0,a.info)(`Invalid BlackPoint for ${this.name} [${l}, ${c}, ${h}], falling back to default.`),this.blackPoint=new Float32Array(3)),(this.GR<0||this.GG<0||this.GB<0)&&((0,a.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,a){f(this,e,t,r,a,1)}getRgbBuffer(e,t,r,a,i,n,s){const o=1/((1<=6/29?e*e*e:108/841*(e-4/29),t}function t(e,t,r,a){return r+e*(a-r)/t}function r(r,a,i,n,s,o){let l=a[i],c=a[i+1],h=a[i+2];!1!==n&&(l=t(l,n,0,100),c=t(c,n,r.amin,r.amax),h=t(h,n,r.bmin,r.bmax)),c>r.amax?c=r.amax:cr.bmax?h=r.bmax:hthis.amax||this.bmin>this.bmax)&&((0,a.info)("Invalid Range, falling back to defaults"),this.amin=-100,this.amax=100,this.bmin=-100,this.bmax=100)}getRgbItem(e,t,a,i){r(this,e,t,!1,a,i)}getRgbBuffer(e,t,a,i,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,a.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=h,t.MarkupAnnotation=t.AnnotationFactory=t.AnnotationBorderStyle=t.Annotation=void 0;var a=r(2),i=r(10),n=r(5),s=r(23),o=r(8),l=r(26),c=r(12);function h(e,t){if(!e.has("QuadPoints"))return null;const r=e.getArray("QuadPoints");if(!Array.isArray(r)||r.length%8>0)return null;const a=[];for(let e=0,i=r.length/8;et[2]||st[3])return null;a[e].push({x:n,y:s})}}return a}t.AnnotationFactory=class{static create(e,t,r,a){return r.ensure(this,"_create",[e,t,r,a])}static _create(e,t,r,i){const s=e.fetchIfRef(t);if(!(0,n.isDict)(s))return;const l=(0,n.isRef)(t)?t.toString():`annot_${i.createObjId()}`;let c=s.get("Subtype");c=(0,n.isName)(c)?c.name:null;const h={xref:e,dict:s,subtype:c,id:l,pdfManager:r};switch(c){case"Link":return new v(h);case"Text":return new y(h);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 p(h);case"Btn":return new m(h);case"Ch":return new b(h)}return(0,a.warn)('Unimplemented widget field type "'+e+'", falling back to base field type.'),new g(h);case"Popup":return new w(h);case"FreeText":return new A(h);case"Line":return new k(h);case"Square":return new S(h);case"Circle":return new x(h);case"PolyLine":return new C(h);case"Polygon":return new _(h);case"Caret":return new P(h);case"Ink":return new T(h);case"Highlight":return new I(h);case"Underline":return new E(h);case"Squiggly":return new F(h);case"StrikeOut":return new L(h);case"Stamp":return new R(h);case"FileAttachment":return new O(h);default:return c?(0,a.warn)('Unimplemented annotation type "'+c+'", falling back to base annotation.'):(0,a.warn)("Annotation is missing the required /Subtype."),new u(h)}}};class u{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,a.AnnotationFlag.INVISIBLE)&&!this._hasFlag(e,a.AnnotationFlag.HIDDEN)&&!this._hasFlag(e,a.AnnotationFlag.NOVIEW)}_isPrintable(e){return this._hasFlag(e,a.AnnotationFlag.PRINT)&&!this._hasFlag(e,a.AnnotationFlag.INVISIBLE)&&!this._hasFlag(e,a.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,a.stringToPDFString)(e||"")}setModificationDate(e){this.modificationDate=(0,a.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=a.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 d,(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 a=e.get("AS");(0,n.isName)(a)&&r.has(a.name)&&(this.appearance=r.get(a.name))}loadResources(e){return this.appearance.dict.getAsync("Resources").then((t=>{if(t)return new i.ObjectLoader(t,e,t.xref).load().then((function(){return t}))}))}getOperatorList(e,t,r){if(!this.appearance)return Promise.resolve(new l.OperatorList);const i=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],h=function(e,t,r){const[i,n,s,o]=a.Util.getAxialAlignedBoundingBox(t,r);if(i===s||n===o)return[1,0,0,1,e[0],e[1]];const l=(e[2]-e[0])/(s-i),c=(e[3]-e[1])/(o-n);return[l,0,0,c,e[0]-i*l,e[1]-n*c]}(i.rect,o,c);return s.then((r=>{const n=new l.OperatorList;return n.addOp(a.OPS.beginAnnotation,[i.rect,h,c]),e.getOperatorList({stream:this.appearance,task:t,resources:r,operatorList:n}).then((()=>(n.addOp(a.OPS.endAnnotation,[]),this.appearance.reset(),n)))}))}}t.Annotation=u;class d{constructor(){this.width=1,this.style=a.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,i=(t[3]-t[1])/2;r>0&&i>0&&(e>r||e>i)&&((0,a.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=a.AnnotationBorderStyleType.SOLID;break;case"D":this.style=a.AnnotationBorderStyleType.DASHED;break;case"B":this.style=a.AnnotationBorderStyleType.BEVELED;break;case"I":this.style=a.AnnotationBorderStyleType.INSET;break;case"U":this.style=a.AnnotationBorderStyleType.UNDERLINE}}setDashArray(e){if(Array.isArray(e)&&e.length>0){let t=!0,r=!0;for(const a of e){if(!(+a>=0)){t=!1;break}a>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=d;class f extends u{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:a.AnnotationReplyType.REPLY}if(this.data.replyType===a.AnnotationReplyType.GROUP){const e=t.get("IRT");this.data.title=(0,a.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,a.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,a.isString)(e)?e:null}}t.MarkupAnnotation=f;class g extends u{constructor(e){super(e);const t=e.dict,r=this.data;r.annotationType=a.AnnotationType.WIDGET,r.fieldName=this._constructFieldName(t),r.fieldValue=(0,o.getInheritableProperty)({dict:t,key:"V",getArray:!0}),r.alternativeText=(0,a.stringToPDFString)(t.get("TU")||""),r.defaultAppearance=(0,o.getInheritableProperty)({dict:t,key:"DA"})||"";const i=(0,o.getInheritableProperty)({dict:t,key:"FT"});r.fieldType=(0,n.isName)(i)?i.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(a.AnnotationFieldFlag.READONLY),"Sig"===r.fieldType&&(r.fieldValue=null,this.setFlags(a.AnnotationFlag.HIDDEN))}_constructFieldName(e){if(!e.has("T")&&!e.has("Parent"))return(0,a.warn)("Unknown field name, falling back to empty field name."),"";if(!e.has("Parent"))return(0,a.stringToPDFString)(e.get("T"));const t=[];e.has("T")&&t.unshift((0,a.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,a.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 p extends g{constructor(e){super(e);const t=e.dict;this.data.fieldValue=(0,a.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 i=(0,o.getInheritableProperty)({dict:t,key:"MaxLen"});(!Number.isInteger(i)||i<0)&&(i=null),this.data.maxLen=i,this.data.multiLine=this.hasFieldFlag(a.AnnotationFieldFlag.MULTILINE),this.data.comb=this.hasFieldFlag(a.AnnotationFieldFlag.COMB)&&!this.hasFieldFlag(a.AnnotationFieldFlag.MULTILINE)&&!this.hasFieldFlag(a.AnnotationFieldFlag.PASSWORD)&&!this.hasFieldFlag(a.AnnotationFieldFlag.FILESELECT)&&null!==this.data.maxLen}getOperatorList(e,t,r){if(r||this.appearance)return super.getOperatorList(e,t,r);const i=new l.OperatorList;if(!this.data.defaultAppearance)return Promise.resolve(i);const n=new c.Stream((0,a.stringToBytes)(this.data.defaultAppearance));return e.getOperatorList({stream:n,task:t,resources:this.fieldResources,operatorList:i}).then((function(){return i}))}}class m extends g{constructor(e){super(e),this.data.checkBox=!this.hasFieldFlag(a.AnnotationFieldFlag.RADIO)&&!this.hasFieldFlag(a.AnnotationFieldFlag.PUSHBUTTON),this.data.radioButton=this.hasFieldFlag(a.AnnotationFieldFlag.RADIO)&&!this.hasFieldFlag(a.AnnotationFieldFlag.PUSHBUTTON),this.data.pushButton=this.hasFieldFlag(a.AnnotationFieldFlag.PUSHBUTTON),this.data.checkBox?this._processCheckBox(e):this.data.radioButton?this._processRadioButton(e):this.data.pushButton?this._processPushButton(e):(0,a.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 a=r.getKeys();2===a.length&&(this.data.exportValue="Off"===a[0]?a[1]:a[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 a=r.get("N");if((0,n.isDict)(a))for(const e of a.getKeys())if("Off"!==e){this.data.buttonValue=e;break}}_processPushButton(e){e.dict.has("A")?i.Catalog.parseDestDictionary({destDict:e.dict,resultObj:this.data,docBaseUrl:e.pdfManager.docBaseUrl}):(0,a.warn)("Push buttons without action dictionaries are not supported")}}class b extends g{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,i=t.length;e1e3&&(u=Math.max(u,g),p+=f+2,g=0,f=0),d.push({transform:m,x:g,y:p,w:b.width,h:b.height}),g+=b.width+2,f=Math.max(f,b.height)}var y=Math.max(u,g)+1,v=p+f+1,w=new Uint8ClampedArray(y*v*4),A=y<<2;for(h=0;h=0;)k[C-4]=k[C],k[C-3]=k[C+1],k[C-2]=k[C+2],k[C-1]=k[C+3],k[C+S]=k[C+S-4],k[C+S+1]=k[C+S-3],k[C+S+2]=k[C+S-2],k[C+S+3]=k[C+S-1],C-=A}return r.splice(s,4*c,a.OPS.paintInlineImageXObjectGroup),i.splice(s,4*c,[{width:y,height:v,kind:a.ImageKind.RGBA_32BPP,data:w},d]),s+1})),e(t,[a.OPS.save,a.OPS.transform,a.OPS.paintImageMaskXObject,a.OPS.restore],null,(function(e,t){var r=e.fnArray,i=(t-(e.iCurr-3))%4;switch(i){case 0:return r[t]===a.OPS.save;case 1:return r[t]===a.OPS.transform;case 2:return r[t]===a.OPS.paintImageMaskXObject;case 3:return r[t]===a.OPS.restore}throw new Error(`iterateImageMaskGroup - invalid pos: ${i}`)}),(function(e,t){var r,i=e.fnArray,n=e.argsArray,s=e.iCurr,o=s-3,l=s-2,c=s-1,h=Math.floor((t-o)/4);if(h=function(e,t,r,i){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]&&a[n-4][0]===h&&a[n-4][1]===u&&(d++,f-=5);for(var g=f+4,p=1;p=a)break}i=(i||t)[e[r]],i&&!Array.isArray(i)?(s.iCurr=r,r++,!i.checkFn||(0,i.checkFn)(s)?(n=i,i=null):i=null):r++}this.state=i,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 i(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===a.OPS.restore||e===a.OPS.endText))&&this.flush()},addDependency(e){e in this.dependencies||(this.dependencies[e]=!0,this.addOp(a.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,i=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 a(){t.read().then((function({value:t,done:r}){r||(e(t),a())}),r)}()}));return r.compressionType!==a.CMapCompressionType.NONE&&this.builtInCMapCache.set(e,r),r}}function r(){this.reset()}function d(e,t=!1){if(Array.isArray(e)){for(let t=0,r=e.length;tf)return void(0,a.warn)("Image exceeded maximum allowed size and was removed.");if(o.get("ImageMask","IM")){var g=o.get("Width","W"),m=o.get("Height","H"),b=g+7>>3,y=t.getBytes(b*m,!0),v=o.getArray("Decode","D");return(u=k.PDFImage.createMask({imgArray:y,width:g,height:m,imageIsFromDecodeStream:t instanceof p.DecodeStream,inverseDecode:!!v&&v[0]>0})).cached=!!n,d=[u],i.addOp(a.OPS.paintImageMaskXObject,d),void(n&&s.set(n,l,{fn:a.OPS.paintImageMaskXObject,args:d}))}var w=o.get("SMask","SM")||!1,A=o.get("Mask")||!1;if(r&&!w&&!A&&c+h<200){const n=new k.PDFImage({xref:this.xref,res:e,image:t,isInline:r,pdfFunctionFactory:this.pdfFunctionFactory});return u=n.createImageData(!0),void i.addOp(a.OPS.paintInlineImageXObject,[u])}let S=`img_${this.idFactory.createObjId()}`,x=!1;this.parsingType3Font?S=`${this.idFactory.getDocId()}_type3res_${S}`:l&&(x=this.globalImageCache.shouldCache(l,this.pageIndex),x&&(S=`${this.idFactory.getDocId()}_${S}`)),i.addDependency(S),d=[S,c,h];const C=k.PDFImage.buildImage({xref:this.xref,res:e,image:t,isInline:r,pdfFunctionFactory:this.pdfFunctionFactory}).then((e=>{if(u=e.createImageData(!1),this.parsingType3Font)return this.handler.sendWithPromise("commonobj",[S,"FontType3Res",u],[u.data.buffer]);x?this.handler.send("commonobj",[S,"Image",u],[u.data.buffer]):this.handler.send("obj",[S,this.pageIndex,"Image",u],[u.data.buffer])})).catch((e=>{if((0,a.warn)("Unable to decode image: "+e),this.parsingType3Font)return this.handler.sendWithPromise("commonobj",[S,"FontType3Res",null]);x?this.handler.send("commonobj",[S,"Image",null]):this.handler.send("obj",[S,this.pageIndex,"Image",null])}));this.parsingType3Font&&await C,i.addOp(a.OPS.paintImageXObject,d),n&&(s.set(n,l,{fn:a.OPS.paintImageXObject,args:d}),l&&((0,a.assert)(!r,"Cannot cache an inline image globally."),this.globalImageCache.addPageIndex(l,this.pageIndex),x&&this.globalImageCache.setData(l,{objId:S,fn:a.OPS.paintImageXObject,args:d})))},handleSMask:function(e,t,r,a,i){var n=e.get("G"),s={subtype:e.get("S").name,backdrop:e.get("BC")},o=e.get("TR");if((0,y.isPDFFunction)(o)){const e=this.pdfFunctionFactory.create(o);for(var l=new Uint8Array(256),c=new Float32Array(1),h=0;h<256;h++)c[0]=h/255,e(c,0,c,0),l[h]=255*c[0]|0;s.transferMap=l}return this.buildFormXObject(t,n,s,r,a,i.state.clone())},handleTilingType(e,t,r,i,s,o,l){const c=new A.OperatorList,h=[s.get("Resources"),r],d=n.Dict.merge(this.xref,h);return this.getOperatorList({stream:i,task:l,resources:d,operatorList:c}).then((function(){return(0,u.getTilingPatternIR)({fnArray:c.fnArray,argsArray:c.argsArray},s,t)})).then((function(t){o.addDependencies(c.dependencies),o.addOp(e,t)}),(e=>{if(!(e instanceof a.AbortException)){if(this.options.ignoreErrors)return this.handler.send("UnsupportedFeature",{featureId:a.UNSUPPORTED_FEATURES.errorTilingPattern}),void(0,a.warn)(`handleTilingType - ignoring pattern: "${e}".`);throw e}}))},handleSetFont:function(e,t,r,i,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,i,n).then((function(){return t})).catch((e=>(this.handler.send("UnsupportedFeature",{featureId:a.UNSUPPORTED_FEATURES.errorFontLoadType3}),new x({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 i=r.font,n=i.charsToGlyphs(e);return i.data&&(r.textRenderingMode&a.TextRenderingMode.ADD_TO_PATH_FLAG||"Pattern"===r.fillColorSpace.name||i.disableFontFace||this.options.disableFontFace)&&t.buildFontPaths(i,n,this.handler),n},ensureStateFont(e){if(e.font)return;const t=new a.FormatError("Missing setFont (Tf) operator before text rendering operator.");if(this.options.ignoreErrors)return this.handler.send("UnsupportedFeature",{featureId:a.UNSUPPORTED_FEATURES.errorFontState}),void(0,a.warn)(`ensureStateFont: "${t}".`);throw t},setGState:function(e,t,r,i,s){for(var o=[],l=t.getKeys(),c=Promise.resolve(),h=0,u=l.length;hthis.handleSetFont(e,null,f[0],r,i,s.state).then((function(e){r.addDependency(e),o.push([u,[e,f[1]]])}))));break;case"BM":o.push([u,d(f)]);break;case"SMask":if((0,n.isName)(f,"None")){o.push([u,!1]);break}(0,n.isDict)(f)?(c=c.then((()=>this.handleSMask(f,e,r,i,s))),o.push([u,!0])):(0,a.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,a.info)("graphic state operator "+u);break;default:(0,a.info)("Unknown graphic state operator "+u)}}return c.then((function(){o.length>0&&r.addOp(a.OPS.setGState,[o])}))},loadFont:function(e,r,i){const o=()=>Promise.resolve(new x({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 a.FormatError('The "font" object should be a reference.');l=r}else{var h=i.get("Font");h&&(l=h.getRaw(e))}if(!l){const i=`Font "${e||r&&r.toString()}" is not available`;if(!this.options.ignoreErrors&&!this.parsingType3Font)return(0,a.warn)(`${i}.`),o();this.handler.send("UnsupportedFeature",{featureId:a.UNSUPPORTED_FEATURES.errorFontMissing}),(0,a.warn)(`${i} -- 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 u=(0,a.createPromiseCapability)(),d=this.preEvaluateFont(r);const{descriptor:f,hash:g}=d;var p,m,b=(0,n.isRef)(l);if(b&&(p=l.toString()),g&&(0,n.isDict)(f)){f.fontAliases||(f.fontAliases=Object.create(null));var y=f.fontAliases;if(y[g]){var v=y[g].aliasRef;if(b&&v&&this.fontCache.has(v))return this.fontCache.putAlias(l,v),this.fontCache.get(l)}else y[g]={fontID:s.Font.getFontID()};b&&(y[g].aliasRef=l),p=y[g].fontID}b?this.fontCache.put(l,u.promise):(p||(p=this.idFactory.createObjId()),this.fontCache.put(`id_${p}`,u.promise)),(0,a.assert)(p,'The "fontID" must be defined.'),r.loadedName=`${this.idFactory.getDocId()}_f${p}`,r.translated=u.promise;try{m=this.translateFont(d)}catch(e){m=Promise.reject(e)}return m.then((e=>{void 0!==e.fontType&&(c.stats.fontTypes[e.fontType]=!0),u.resolve(new x({loadedName:r.loadedName,font:e,dict:r,extraProperties:this.options.fontExtraProperties}))})).catch((e=>{this.handler.send("UnsupportedFeature",{featureId:a.UNSUPPORTED_FEATURES.errorFontTranslate});try{var t=f&&f.get("FontFile3"),i=t&&t.get("Subtype"),n=(0,s.getFontType)(d.type,i&&i.name);c.stats.fontTypes[n]=!0}catch(e){}u.resolve(new x({loadedName:r.loadedName,font:new s.ErrorFont(e instanceof Error?e.message:e),dict:r,extraProperties:this.options.fontExtraProperties}))})),u.promise},buildPath(e,t,r,i=!1){var n=e.length-1;if(r||(r=[]),n<0||e.fnArray[n]!==a.OPS.constructPath)i&&((0,a.warn)(`Encountered path operator "${t}" inside of a text object.`),e.addOp(a.OPS.save,null)),e.addOp(a.OPS.constructPath,[[t],r]),i&&e.addOp(a.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(g.ColorSpace.parse(e,this.xref,t,this.pdfFunctionFactory))})).catch((e=>{if(e instanceof a.AbortException)return null;if(this.options.ignoreErrors)return this.handler.send("UnsupportedFeature",{featureId:a.UNSUPPORTED_FEATURES.errorColorSpace}),(0,a.warn)(`parseColorSpace - ignoring ColorSpace: "${e}".`),null;throw e}))},async handleColorN(e,t,r,i,s,o,l){var c,h=r[r.length-1];if((0,n.isName)(h)&&(c=s.get(h.name))){var d=(0,n.isStream)(c)?c.dict:c,f=d.get("PatternType");if(1===f){var g=i.base?i.base.getRgb(r,0):null;return this.handleTilingType(t,g,o,c,d,e,l)}if(2===f){var p=d.get("Shading"),m=d.getArray("Matrix");return c=u.Pattern.parseShading(p,m,this.xref,o,this.handler,this.pdfFunctionFactory),void e.addOp(t,c.getIR())}throw new a.FormatError(`Unknown PatternType: ${f}`)}throw new a.FormatError(`Unknown PatternName: ${h}`)},getOperatorList({stream:e,task:t,resources:i,operatorList:s,initialState:o=null}){if(i=i||n.Dict.empty,o=o||new P,!s)throw new Error('getOperatorList: missing "operatorList" parameter');var l=this,c=this.xref;let h=!1;const d=new v.LocalImageCache;var f=i.get("XObject")||n.Dict.empty,p=i.get("Pattern")||n.Dict.empty,m=new C(o),b=new T(e,c,m),y=new r;function w(e){for(var t=0,r=b.savedStatesDepth;t{if(!(e instanceof a.AbortException)){if(this.options.ignoreErrors)return this.handler.send("UnsupportedFeature",{featureId:a.UNSUPPORTED_FEATURES.errorOperatorList}),(0,a.warn)(`getOperatorList - ignoring errors during "${t.name}" task: "${e}".`),void w();throw e}}))},getTextContent({stream:e,task:t,resources:i,stateManager:s=null,normalizeWhitespace:o=!1,combineTextItems:l=!1,sink:h,seenStyles:u=Object.create(null)}){i=i||n.Dict.empty,s=s||new C(new _);var d=/\s/g,g={items:[],styles:Object.create(null)},p={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,y=null;const w=new v.LocalImageCache;var A,k=new T(e,b,s);function x(){if(p.initialized)return p;var e=A.font;e.loadedName in u||(u[e.loadedName]=!0,g.styles[e.loadedName]={fontFamily:e.fallbackName,ascent:e.ascent,descent:e.descent,vertical:e.vertical}),p.fontName=e.loadedName;var t=[A.fontSize*A.textHScale,0,0,A.fontSize,0,A.textRise];if(e.isType3Font&&A.fontSize<=1&&!(0,a.isArrayEqual)(A.fontMatrix,a.FONT_IDENTITY_MATRIX)){const r=e.bbox[3]-e.bbox[1];r>0&&(t[3]*=r*A.fontMatrix[3])}var r=a.Util.transform(A.ctm,a.Util.transform(A.textMatrix,t));p.transform=r,e.vertical?(p.width=Math.sqrt(r[0]*r[0]+r[1]*r[1]),p.height=0,p.vertical=!0):(p.width=0,p.height=Math.sqrt(r[2]*r[2]+r[3]*r[3]),p.vertical=!1);var i=A.textLineMatrix[0],n=A.textLineMatrix[1],s=Math.sqrt(i*i+n*n);i=A.ctm[0],n=A.ctm[1];var o=Math.sqrt(i*i+n*n);p.textAdvanceScale=o*s,p.lastAdvanceWidth=0,p.lastAdvanceHeight=0;var l=e.spaceWidth/1e3*A.fontSize;return l?(p.spaceWidth=l,p.fakeSpaceMin=.3*l,p.fakeMultiSpaceMin=1.5*l,p.fakeMultiSpaceMax=4*l,p.textRunBreakAllowed=!e.isMonospace):(p.spaceWidth=0,p.fakeSpaceMin=1/0,p.fakeMultiSpaceMin=1/0,p.fakeMultiSpaceMax=0,p.textRunBreakAllowed=!1),p.initialized=!0,p}function P(e){for(var t,r=0,a=e.length;r=32&&t<=127;)r++;return r0&&F(f,r.str)}var g=0,p=0;t.vertical?i+=p=l*A.fontMatrix[0]*A.fontSize+d:a+=g=(l*A.fontMatrix[0]*A.fontSize+d)*A.textHScale,A.translateTextMatrix(g,p),r.str.push(h)}return t.vertical?(r.lastAdvanceHeight=i,r.height+=Math.abs(i)):(r.lastAdvanceWidth=a,r.width+=a),r}function F(e,t){if(!(e0;)t.push(" ")}function L(){var e,t,r;p.initialized&&(p.vertical?p.height*=p.textAdvanceScale:p.width*=p.textAdvanceScale,g.items.push((t=(e=p).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})),p.initialized=!1,p.str.length=0)}function R(){const e=g.items.length;e>0&&(h.enqueue(g,e),g.items=[],g.styles=Object.create(null))}var O=new r;return new Promise((function e(r,c){const d=function(t){R(),Promise.all([t,h.ready]).then((function(){try{e(r,c)}catch(e){c(e)}}),c)};t.ensureNotTerminated(),O.reset();for(var f,v={},_=[];!(f=O.check())&&(_.length=0,v.args=_,k.read(v));){A=s.state;var P,T=v.fn;switch(_=v.args,0|T){case a.OPS.setFont:var M=_[0].name,D=_[1];if(A.font&&M===A.fontName&&D===A.fontSize)break;return L(),A.fontName=M,A.fontSize=D,void d(I(M,null));case a.OPS.setTextRise:L(),A.textRise=_[0];break;case a.OPS.setHScale:L(),A.textHScale=_[0]/100;break;case a.OPS.setLeading:L(),A.leading=_[0];break;case a.OPS.moveText:var N=!!A.font&&0===(A.font.vertical?_[0]:_[1]);if(P=_[0]-_[1],l&&N&&p.initialized&&P>0&&P<=p.fakeMultiSpaceMax){A.translateTextLineMatrix(_[0],_[1]),p.width+=_[0]-p.lastAdvanceWidth,p.height+=_[1]-p.lastAdvanceHeight,F(_[0]-p.lastAdvanceWidth-(_[1]-p.lastAdvanceHeight),p.str);break}L(),A.translateTextLineMatrix(_[0],_[1]),A.textMatrix=A.textLineMatrix.slice();break;case a.OPS.setLeadingMoveText:L(),A.leading=-_[1],A.translateTextLineMatrix(_[0],_[1]),A.textMatrix=A.textLineMatrix.slice();break;case a.OPS.nextLine:L(),A.carriageReturn();break;case a.OPS.setTextMatrix:if(P=A.calcTextLineMatrixAdvance(_[0],_[1],_[2],_[3],_[4],_[5]),l&&null!==P&&p.initialized&&P.value>0&&P.value<=p.fakeMultiSpaceMax){A.translateTextLineMatrix(P.width,P.height),p.width+=P.width-p.lastAdvanceWidth,p.height+=P.height-p.lastAdvanceHeight,F(P.width-p.lastAdvanceWidth-(P.height-p.lastAdvanceHeight),p.str);break}L(),A.setTextMatrix(_[0],_[1],_[2],_[3],_[4],_[5]),A.setTextLineMatrix(_[0],_[1],_[2],_[3],_[4],_[5]);break;case a.OPS.setCharSpacing:A.charSpacing=_[0];break;case a.OPS.setWordSpacing:A.wordSpacing=_[0];break;case a.OPS.beginText:L(),A.textMatrix=a.IDENTITY_MATRIX.slice(),A.textLineMatrix=a.IDENTITY_MATRIX.slice();break;case a.OPS.showSpacedText:if(!s.state.font){m.ensureStateFont(s.state);continue}for(var B,U=_[0],q=0,j=U.length;qp.fakeMultiSpaceMax)||(p.height+=B)):(B=(P=-P)*A.textHScale,A.translateTextMatrix(B,0),(z=p.textRunBreakAllowed&&P>p.fakeMultiSpaceMax)||(p.width+=B)),z?L():P>0&&F(P,p.str)}break;case a.OPS.showText:if(!s.state.font){m.ensureStateFont(s.state);continue}E(_[0]);break;case a.OPS.nextLineShowText:if(!s.state.font){m.ensureStateFont(s.state);continue}L(),A.carriageReturn(),E(_[0]);break;case a.OPS.nextLineSetSpacingShowText:if(!s.state.font){m.ensureStateFont(s.state);continue}L(),A.wordSpacing=_[0],A.charSpacing=_[1],A.carriageReturn(),E(_[2]);break;case a.OPS.paintXObject:L(),y||(y=i.get("XObject")||n.Dict.empty);var H=_[0].name;if(H&&w.getByName(H))break;return void d(new Promise((function(e,r){if(!H)throw new a.FormatError("XObject must be referred to by name.");let c=y.getRaw(H);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 a.FormatError("XObject should be a stream");const d=c.dict.get("Subtype");if(!(0,n.isName)(d))throw new a.FormatError("XObject should have a Name subtype");if("Form"!==d.name)return w.set(H,c.dict.objId,!0),void e();const f=s.state.clone(),g=new C(f),p=c.dict.getArray("Matrix");Array.isArray(p)&&6===p.length&&g.transform(p),R();const v={enqueueInvoked:!1,enqueue(e,t){this.enqueueInvoked=!0,h.enqueue(e,t)},get desiredSize(){return h.desiredSize},get ready(){return h.ready}};m.getTextContent({stream:c,task:t,resources:c.dict.get("Resources")||i,stateManager:g,normalizeWhitespace:o,combineTextItems:l,sink:v,seenStyles:u}).then((function(){v.enqueueInvoked||w.set(H,c.dict.objId,!0),e()}),r)})).catch((function(e){if(!(e instanceof a.AbortException)){if(!m.options.ignoreErrors)throw e;(0,a.warn)(`getTextContent - ignoring XObject: "${e}".`)}})));case a.OPS.setGState:L();var G=_[0],W=i.get("ExtGState");if(!(0,n.isDict)(W)||!(0,n.isName)(G))break;var V=W.get(G.name);if(!(0,n.isDict)(V))break;var X=V.get("Font");if(X)return A.fontName=null,A.fontSize=X[1],void d(I(null,X[0]))}if(g.items.length>=h.desiredSize){f=!0;break}}f?d(S):(L(),R(),r())})).catch((e=>{if(!(e instanceof a.AbortException)){if(this.options.ignoreErrors)return(0,a.warn)(`getTextContent - ignoring errors during "${t.name}" task: "${e}".`),L(),void R();throw e}}))},extractDataStructures:function(e,t,r){const i=this.xref;let l;var c=e.get("ToUnicode")||t.get("ToUnicode"),h=c?this.readToUnicode(c):Promise.resolve(void 0);if(r.composite){var u=e.get("CIDSystemInfo");(0,n.isDict)(u)&&(r.cidSystemInfo={registry:(0,a.stringToPDFString)(u.get("Registry")),ordering:(0,a.stringToPDFString)(u.get("Ordering")),supplement:u.get("Supplement")});var d=e.get("CIDToGIDMap");(0,n.isStream)(d)&&(l=d.getBytes())}var f,g=[],p=null;if(e.has("Encoding")){if(f=e.get("Encoding"),(0,n.isDict)(f)){if(p=f.get("BaseEncoding"),p=(0,n.isName)(p)?p.name:null,f.has("Differences"))for(var m=f.get("Differences"),b=0,y=0,v=m.length;y0,r.dict=e,h.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,a.assert)(!e.composite,"Must be a simple font.");const r=[],i=e.defaultEncoding.slice(),n=e.baseEncodingName,l=e.differences;for(const e in l){const t=l[e];".notdef"!==t&&(i[e]=t)}const h=(0,m.getGlyphsUnicode)();for(const a in i){let s=i[a];if(""!==s)if(void 0!==h[s])r[a]=String.fromCharCode(h[s]);else{let i=0;switch(s[0]){case"G":3===s.length&&(i=parseInt(s.substring(1),16));break;case"g":5===s.length&&(i=parseInt(s.substring(1),16));break;case"C":case"c":if(s.length>=3&&s.length<=4){const r=s.substring(1);if(t){i=parseInt(r,16);break}if(i=+r,Number.isNaN(i)&&Number.isInteger(parseInt(r,16)))return this._buildSimpleFontToUnicode(e,!0)}break;default:const r=(0,c.getUnicodeForGlyph)(s,h);-1!==r&&(i=r)}if(i>0&&i<=1114111&&Number.isInteger(i)){if(n&&i===+a){const e=(0,o.getEncoding)(n);if(e&&(s=e[a])){r[a]=String.fromCharCode(h[s]);continue}}r[a]=String.fromCodePoint(i)}}}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 i.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 i.CMapFactory.create({encoding:o,fetchBuiltInCMap:this.fetchBuiltInCMap,useCMap:null}).then((function(t){const r=e.cMap,i=[];return r.forEach((function(e,r){if(r>65535)throw new a.FormatError("Max size of CID is 65,535");const n=t.lookup(r);n&&(i[e]=String.fromCharCode((n.charCodeAt(0)<<8)+n.charCodeAt(1)))})),new s.ToUnicodeMap(i)}))}return Promise.resolve(new s.IdentityToUnicodeMap(e.firstChar,e.lastChar))},readToUnicode:function(e){var t=e;return(0,n.isName)(t)?i.CMapFactory.create({encoding:t,fetchBuiltInCMap:this.fetchBuiltInCMap,useCMap:null}).then((function(e){return e instanceof i.IdentityCMap?new s.IdentityToUnicodeMap(0,65535):new s.ToUnicodeMap(e.getMap())})):(0,n.isStream)(t)?i.CMapFactory.create({encoding:t,fetchBuiltInCMap:this.fetchBuiltInCMap,useCMap:null}).then((function(e){if(e instanceof i.IdentityCMap)return new s.IdentityToUnicodeMap(0,65535);var t=new Array(e.length);return e.forEach((function(e,r){for(var a=[],i=0;i{if(e instanceof a.AbortException)return null;if(this.options.ignoreErrors)return this.handler.send("UnsupportedFeature",{featureId:a.UNSUPPORTED_FEATURES.errorFontToUnicode}),(0,a.warn)(`readToUnicode - ignoring ToUnicode data: "${e}".`),null;throw e})):Promise.resolve(null)},readCidToGidMap(e,t){for(var r=[],a=0,i=e.length;a>1;(0!==n||t.has(i))&&(r[i]=n)}return r},extractWidths:function(e,t,r){var a,i,o,l,c,h,u,d,f=this.xref,g=[],p=0,m=[];if(r.composite){if(p=e.has("DW")?e.get("DW"):1e3,d=e.get("W"))for(i=0,o=d.length;i{if(e){const r=[];let a=f;for(let t=0,i=e.length;tthis.extractDataStructures(o,r,t))).then((e=>(this.extractWidths(o,c,e),"Type3"===u&&(e.isType3Font=!0),new s.Font(v.name,x,e))))}},t.buildFontPaths=function(e,t,r){function a(t){e.renderer.hasBuiltPath(t)||r.send("commonobj",[`${e.loadedName}_path_${t}`,"FontPath",e.renderer.getPathJs(t)])}for(const e of t){a(e.fontChar);const t=e.accent;t&&t.fontChar&&a(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=S;class x{constructor({loadedName:e,font:t,dict:r,extraProperties:a=!1}){this.loadedName=e,this.font=t,this.dict=r,this._extraProperties=a,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;S.buildFontPaths(this.font,t,e)}loadType3Data(e,t,r,i){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"),h=this.dict.get("Resources")||t,u=c.getKeys(),d=Object.create(null),f=0,g=u.length;fl&&(0,a.info)(`Command ${i}: expected [0, ${l}] args, but received ${c} args.`);else{if(c!==l){for(var h=this.nonProcessedArgs;c>l;)h.push(t.shift()),c--;for(;c=a.OPS.moveTo&&o<=a.OPS.endPath&&++this._numInvalidPathOPS>20)throw new a.FormatError(`Invalid ${e}`);(0,a.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 a.FormatError("Too many arguments")}},preprocessCommand:function(e,t){switch(0|e){case a.OPS.save:this.stateManager.save();break;case a.OPS.restore:this.stateManager.restore();break;case a.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 a=r(2),i=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 h{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 a=r.length-1;e<=t;)this._map[e++]=r,r=r.substring(0,a)+String.fromCharCode(r.charCodeAt(a)+1)}mapBfRangeToArray(e,t,r){if(t-e>c)throw new Error("mapBfRangeToArray - ignoring data above MAX_MAP_RANGE.");const a=r.length;let i=0;for(;e<=t&&i>>0;const s=i[n];for(let e=0,t=s.length;e=t&&a<=i)return r.charcode=a,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=h;class u extends h{constructor(e,t){super(),this.vertical=e,this.addCodespaceRange(t,0,65535)}mapCidRange(e,t,r){(0,a.unreachable)("should not call mapCidRange")}mapBfRange(e,t,r){(0,a.unreachable)("should not call mapBfRange")}mapBfRangeToArray(e,t,r){(0,a.unreachable)("should not call mapBfRangeToArray")}mapOne(e,t){(0,a.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,a.unreachable)("should not access .isIdentityCMap")}}t.IdentityCMap=u;var d=function(){function e(e,t){for(var r=0,a=0;a<=t;a++)r=r<<8|e[a];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 a=0,i=r;i>=0;i--)a+=e[i]+t[i],e[i]=255&a,a>>=8}function i(e,t){for(var r=1,a=t;a>=0&&r>0;a--)r+=e[a],e[a]=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 a.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,i=this.tmpBuf,n=0;do{var s=this.readByte();if(s<0)throw new a.FormatError("unexpected EOF in bcmap");r=!(128&s),i[n++]=127&s}while(!r);for(var o=t,l=0,c=0;o>=0;){for(;c<8&&i.length>0;)l=i[--n]<>=8,c-=8}},readHexSigned(e,t){this.readHexNumber(e,t);for(var r=1&e[t]?255:0,a=0,i=0;i<=t;i++)a=(1&a)<<8|e[i],e[i]=a>>1^r},readString(){for(var e=this.readNumber(),t="",r=0;r=0;){var A=g>>5;if(7!==A){var k=!!(16&g),S=15&g;if(S+1>n)throw new Error("processBinaryCMap: Invalid dataSize.");var x,C=u.readNumber();switch(A){case 0:for(u.readHex(m,S),u.readHexNumber(b,S),r(b,m,S),o.addCodespaceRange(S+1,e(m,S),e(b,S)),x=1;x>>0}function t(e){if(!(0,a.isString)(e))throw new a.FormatError("Malformed CMap: expected string.")}function r(e){if(!Number.isInteger(e))throw new a.FormatError("Malformed CMap: expected int.")}function c(r,a){for(;;){var n=a.getObj();if((0,i.isEOF)(n))break;if((0,i.isCmd)(n,"endbfchar"))return;t(n);var s=e(n);t(n=a.getObj());var o=n;r.mapOne(s,o)}}function f(r,n){for(;;){var s=n.getObj();if((0,i.isEOF)(s))break;if((0,i.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,a.isString)(s)){var c=Number.isInteger(s)?String.fromCharCode(s):s;r.mapBfRange(o,l,c)}else{if(!(0,i.isCmd)(s,"["))break;s=n.getObj();for(var h=[];!(0,i.isCmd)(s,"]")&&!(0,i.isEOF)(s);)h.push(s),s=n.getObj();r.mapBfRangeToArray(o,l,h)}}throw new a.FormatError("Invalid bf range.")}function g(a,n){for(;;){var s=n.getObj();if((0,i.isEOF)(s))break;if((0,i.isCmd)(s,"endcidchar"))return;t(s);var o=e(s);r(s=n.getObj());var l=s;a.mapOne(o,l)}}function p(a,n){for(;;){var s=n.getObj();if((0,i.isEOF)(s))break;if((0,i.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;a.mapCidRange(o,l,c)}}function m(t,r){for(;;){var n=r.getObj();if((0,i.isEOF)(n))break;if((0,i.isCmd)(n,"endcodespacerange"))return;if(!(0,a.isString)(n))break;var s=e(n);if(n=r.getObj(),!(0,a.isString)(n))break;var o=e(n);t.addCodespaceRange(n.length,s,o)}throw new a.FormatError("Invalid codespace range.")}function b(e,t){var r=t.getObj();Number.isInteger(r)&&(e.vertical=!!r)}function y(e,t){var r=t.getObj();(0,i.isName)(r)&&(0,a.isString)(r.name)&&(e.name=r.name)}function v(e,t,r,n){var o,l;e:for(;;)try{var h=t.getObj();if((0,i.isEOF)(h))break;if((0,i.isName)(h))"WMode"===h.name?b(e,t):"CMapName"===h.name&&y(e,t),o=h;else if((0,i.isCmd)(h))switch(h.cmd){case"endcmap":break e;case"usecmap":(0,i.isName)(o)&&(l=o.name);break;case"begincodespacerange":m(e,t);break;case"beginbfchar":c(e,t);break;case"begincidchar":g(e,t);break;case"beginbfrange":f(e,t);break;case"begincidrange":p(e,t)}}catch(e){if(e instanceof s.MissingDataException)throw e;(0,a.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 A(r,t).then((function(t){if(e.useCMap=t,0===e.numCodespaceRanges){for(var r=e.useCMap.codespaceRanges,a=0;a=this.firstChar&&e<=this.lastChar?e:-1},amend(e){(0,a.unreachable)("Should not call amend()")}},e}();t.IdentityToUnicodeMap=_;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 a,i;if(r instanceof Uint8Array)e.set(r,t);else if("string"==typeof r)for(a=0,i=r.length;ar;)r<<=1,a++;var i=r*t;return{range:i,entry:a,rangeShift:t*e-i}},i.prototype={toArray:function(){var n=this.sfnt,s=this.tables,o=Object.keys(s);o.sort();var l,h,u,d,f,g=o.length,p=12+16*g,m=[p];for(l=0;l>>0,m.push(p);var b=new Uint8Array(p);for(l=0;l>>0;t(b,p+4,v),t(b,p+8,m[l]),t(b,p+12,s[f].length),p+=16}return b},addTable:function(e,t){if(e in this.tables)throw new Error("Table "+e+" already exists");this.tables[e]=t}},i}(),T=function(){function e(e,t,r){var i;this.name=e,this.loadedName=r.loadedName,this.isType3Font=r.isType3Font,this.missingFile=!1,this.glyphCache=Object.create(null),this.isSerifFont=!!(r.flags&v.Serif),this.isSymbolicFont=!!(r.flags&v.Symbolic),this.isMonospace=!!(r.flags&v.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/p,this.descent=r.descent/p,this.fontMatrix=r.fontMatrix,this.bbox=r.bbox,this.defaultEncoding=r.defaultEncoding,this.toUnicode=r.toUnicode,this.fallbackToUnicode=r.fallbackToUnicode||new C,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,a.warn)('Font file is empty in "'+e+'" ('+this.loadedName+")"),void this.fallbackToSystemFont();[n,s]=function(e,{type:t,subtype:r,composite:i}){let n,s;return function(e){var t=e.peekBytes(4);return 65536===(0,c.readUint32)(t,0)||"true"===(0,a.bytesToString)(t)}(e)||E(e)?n=i?"CIDFontType2":"TrueType":function(e){var t=e.peekBytes(4);return"OTTO"===(0,a.bytesToString)(t)}(e)?n=i?"CIDFontType2":"OpenType":function(e){var t=e.peekBytes(2);return 37===t[0]&&33===t[1]||128===t[0]&&1===t[1]}(e)?n=i?"CIDFontType0":"MMType1"===t?"MMType1":"Type1":function(e){const t=e.peekBytes(4);return t[0]>=1&&t[3]>=1&&t[3]<=4}(e)?i?(n="CIDFontType0",s="CIDFontType0C"):(n="MMType1"===t?"MMType1":"Type1",s="Type1C"):((0,a.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,a.info)(`Inconsistent font file Type/SubType, expected: ${this.type}/${this.subtype} but found: ${n}/${s}.`);try{var l;switch(n){case"MMType1":(0,a.info)("MMType1 font ("+e+"), falling back to Type1.");case"Type1":case"CIDFontType0":this.mimetype="font/opentype";var h="Type1C"===s||"CIDFontType0C"===s?new L(t,r):new F(e,t,r);A(r),l=this.convert(e,h,r);break;case"OpenType":case"TrueType":case"CIDFontType2":this.mimetype="font/opentype",l=this.checkAndRepair(e,t,r),this.isOpenType&&(A(r),n="OpenType");break;default:throw new a.FormatError(`Font ${n} is not supported`)}}catch(e){return(0,a.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(i=0;i<256;i++)this.toFontChar[i]=this.differences[i]||r.defaultEncoding[i];this.fontType=a.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 T(e){return String.fromCharCode(e>>8&255,255&e)}function I(e){return e>32767?e=32767:e<-32768&&(e=-32768),String.fromCharCode(e>>8&255,255&e)}function E(e){const t=e.peekBytes(4);return"ttcf"===(0,a.bytesToString)(t)}function R(e,t,r){for(var a,i=[],n=0,s=e.length;nl){if(++s>=g.length){(0,a.warn)("Ran out of space in font private use area.");break}o=g[s][0],l=g[s][1]}var u=o++;0===h&&(h=r),i[u]=h,n[c]=u}}return{toFontChar:n,charCodeToGlyphId:i,nextAvailableFontCharCode:o}}function M(e,t){var r,i,n,s,o=function(e,t){var r=[];for(var a in e)e[a]>=t||r.push({fontCharCode:0|a,glyphId:e[a]});0===r.length&&r.push({fontCharCode:0,glyphId:0}),r.sort((function(e,t){return e.fontCharCode-t.fontCharCode}));for(var i=[],n=r.length,s=0;s65535?2:1,c="\0\0"+T(l)+"\0\0"+(0,a.string32)(4+8*l);for(r=o.length-1;r>=0&&!(o[r][0]<=65535);--r);var h=r+1;o[r][0]<65535&&65535===o[r][1]&&(o[r][1]=65534);var u,d,f,g,p=o[r][1]<65535?1:0,m=h+p,b=P.getSearchParams(m,2),y="",v="",w="",A="",k="",S=0;for(r=0,i=h;r0&&(v+="ÿÿ",y+="ÿÿ",w+="\0",A+="\0\0");var _="\0\0"+T(2*m)+T(b.range)+T(b.entry)+T(b.rangeShift)+v+"\0\0"+y+w+A+k,I="",E="";if(l>1){for(c+="\0\0\n"+(0,a.string32)(4+8*l+4+_.length),I="",r=0,i=o.length;r(u|=0)||!c)&&(c=u),h 123 are reserved for internal usage");o|=1<65535&&(h=65535)}else c=0,h=255;var f=e.bbox||[0,0,0,0],g=r.unitsPerEm||1/(e.fontMatrix||a.FONT_IDENTITY_MATRIX)[0],m=e.ascentScaled?1:g/p,b=r.ascent||Math.round(m*(e.ascent||f[3])),y=r.descent||Math.round(m*(e.descent||f[1]));y>0&&e.descent>0&&f[1]<0&&(y=-y);var v=r.yMax||b,w=-r.yMin||-y;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,a.string32)(i)+(0,a.string32)(n)+(0,a.string32)(s)+(0,a.string32)(o)+"*21*"+T(e.italicAngle?1:0)+T(c||e.firstChar)+T(h||e.lastChar)+T(b)+T(y)+"\0d"+T(v)+T(w)+"\0\0\0\0\0\0\0\0"+T(e.xHeight)+T(e.capHeight)+T(0)+T(c||e.firstChar)+"\0"}function N(e){var t=Math.floor(65536*e.italicAngle);return"\0\0\0"+(0,a.string32)(t)+"\0\0\0\0"+(0,a.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,a,i,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,a=o.length;r0,u&&"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 d=(0,o.getSupplementalGlyphMapForArialBlack)();for(const e in d)r[+e]=d[e]}else if(/Calibri/i.test(e)){const e=(0,o.getSupplementalGlyphMapForCalibri)();for(const t in e)r[+t]=e[t]}this.toUnicode instanceof _||this.toUnicode.forEach((function(e,t){r[+e]=t})),this.toFontChar=r,this.toUnicode=new C(r)}else if(/Symbol/i.test(i))this.toFontChar=R(s.SymbolSetEncoding,(0,n.getGlyphsUnicode)(),this.differences);else if(/Dingbats/i.test(i))/Wingdings/i.test(e)&&(0,a.warn)("Non-embedded Wingdings font, falling back to ZapfDingbats."),this.toFontChar=R(s.ZapfDingbatsEncoding,(0,n.getDingbatsGlyphsUnicode)(),this.differences);else if(u)this.toFontChar=R(this.defaultEncoding,(0,n.getGlyphsUnicode)(),this.differences);else{const t=(0,n.getGlyphsUnicode)(),r=[];if(this.toUnicode.forEach(((e,a)=>{if(!this.composite){var i=this.differences[e]||this.defaultEncoding[e];const r=(0,l.getUnicodeForGlyph)(i,t);-1!==r&&(a=r)}r[+e]=a})),this.composite&&this.toUnicode instanceof _&&/Verdana/i.test(e)){const e=(0,o.getGlyphMapForStandardFonts)();for(const t in e)r[+t]=e[t]}this.toFontChar=r}this.loadedName=i.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 a=0;a>>0,i=e.getInt32()>>>0,n=e.getInt32()>>>0,s=e.pos;e.pos=e.start?e.start:0,e.skip(i);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:i,data:o}}function g(e){return{version:(0,a.bytesToString)(e.getBytes(4)),numTables:e.getUint16(),searchRange:e.getUint16(),entrySelector:e.getUint16(),rangeShift:e.getUint16()}}function p(e,t,r,a,i,n){var s={length:0,sizeOfInstructions:0};if(r-t<=12)return s;var o,l,c,h=e.subarray(t,r),u=f(h[0],h[1]);if(u<0)return c=u=-1,(o=h)[1+(l=0)]=c,o[l]=c>>>8,a.set(h,i),s.length=h.length,s;var d,g=10,p=0;for(d=0;dh.length?s:!n&&b>0?(a.set(h.subarray(0,m),i),a.set([0,0],i+m),a.set(h.subarray(y,k),i+m+2),k-=b,h.length-k>3&&(k=k+3&-4),s.length=k,s):h.length-k>3?(k=k+3&-4,a.set(h.subarray(0,k),i),s.length=k,s):(a.set(h,i),s.length=h.length,s)}function b(e){var r=(t.start?t.start:0)+e.offset;t.pos=r;var i=[[],[]],n=e.length,s=r+n;if(0!==t.getUint16()||n<6)return i;var o,l,c=t.getUint16(),h=t.getUint16(),u=[];for(o=0;os)){t.pos=g;var p=f.name;if(f.encoding){for(var m="",b=0,y=f.length;b0&&(c+=k-1)}}else(m||v)&&((0,a.warn)("TT: nested FDEFs not allowed"),p=!0),m=!0,u=c,s=d.pop(),t.functionsDefined[s]={data:l,i:c};else if(!m&&!v)if(s=d[d.length-1],isNaN(s))(0,a.info)("TT: CALL empty stack (or invalid entry).");else if(t.functionsUsed[s]=!0,s in t.functionsStackDeltas){const e=d.length+t.functionsStackDeltas[s];if(e<0)return(0,a.warn)("TT: CALL invalid functions stack delta."),void(t.hintsValid=!1);d.length=e}else if(s in t.functionsDefined&&!g.includes(s)){if(f.push({data:l,i:c,stackTop:d.length-1}),g.push(s),!(o=t.functionsDefined[s]))return(0,a.warn)("TT: CALL non-existent function"),void(t.hintsValid=!1);l=o.data,c=o.i}if(!m&&!v){let e=0;for(A<=142?e=y[A]:A>=192&&A<=223?e=-1:A>=224&&(e=-2),A>=113&&A<=117&&(i=d.pop(),isNaN(i)||(e=2*-i));e<0&&d.length>0;)d.pop(),e++;for(;e>0;)d.push(NaN),e--}}t.tooComplexToFollowFunctions=p;var S=[l];c>l.length&&S.push(new Uint8Array(c-l.length)),u>h&&((0,a.warn)("TT: complementing a missing function tail"),S.push(new Uint8Array([34,45]))),function(e,t){if(t.length>1){var r,a,i=0;for(r=0,a=t.length;r>>0,s=[];for(let t=0;t>>0);const o={ttcTag:t,majorVersion:r,minorVersion:i,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 a.FormatError(`Invalid TrueType Collection majorVersion: ${r}.`)}(e);for(let n=0;n0||!(o.cMap instanceof u.IdentityCMap));if("OTTO"===k.version&&!t||!x.head||!x.hhea||!x.maxp||!x.post)return _=new d.Stream(x["CFF "].data),C=new L(_,o),A(o),this.convert(e,C,o);delete x.glyf,delete x.loca,delete x.fpgm,delete x.prep,delete x["cvt "],this.isOpenType=!0}if(!x.maxp)throw new a.FormatError('Required "maxp" table is not found');t.pos=(t.start||0)+x.maxp.offset;var I=t.getInt32();const F=t.getUint16();let R=F+1,U=!0;R>65535&&(U=!1,R=F,(0,a.warn)("Not enough space in glyfs to duplicate first glyph."));var q=0,j=0;I>=65536&&x.maxp.length>=22&&(t.pos+=8,t.getUint16()>2&&(x.maxp.data[14]=0,x.maxp.data[15]=2),t.pos+=4,q=t.getUint16(),t.pos+=4,j=t.getUint16()),x.maxp.data[4]=R>>8,x.maxp.data[5]=255&R;var z=function(e,t,r,i){var n={functionsDefined:[],functionsUsed:[],functionsStackDeltas:[],tooComplexToFollowFunctions:!1,hintsValid:!0};if(e&&v(e,n),t&&v(t,n),e&&function(e,t){if(!e.tooComplexToFollowFunctions){if(e.functionsDefined.length>t)return(0,a.warn)("TT: more functions defined than expected"),void(e.hintsValid=!1);for(var r=0,i=e.functionsUsed.length;rt)return(0,a.warn)("TT: invalid function id: "+r),void(e.hintsValid=!1);if(e.functionsUsed[r]&&!e.functionsDefined[r])return(0,a.warn)("TT: undefined function: "+r),void(e.hintsValid=!1)}}}(n,i),r&&1&r.length){var s=new Uint8Array(r.length+1);s.set(r.data),r.data=s}return n.hintsValid}(x.fpgm,x.prep,x["cvt "],q);if(z||(delete x.fpgm,delete x.prep,delete x["cvt "]),function(e,t,r,i,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>i&&((0,a.info)("The numOfMetrics ("+s+") should not be greater than the numGlyphs ("+i+")"),s=i,t.data[34]=(65280&s)>>8,t.data[35]=255&s);var o=i-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,x.hhea,x.hmtx,R,U),!x.head)throw new a.FormatError('Required "head" table is not found');!function(e,t,i){var n,s,o,l,c=e.data,h=(n=c[0],s=c[1],o=c[2],l=c[3],(n<<24)+(s<<16)+(o<<8)+l);h>>16!=1&&((0,a.info)("Attempting to fix invalid version in head table: "+h),c[0]=0,c[1]=1,c[2]=0,c[3]=0);var u=r(c[50],c[51]);if(u<0||u>1){(0,a.info)("Attempting to fix invalid indexToLocFormat in head table: "+u);var d=t+1;if(i===d<<1)c[50]=0,c[51]=0;else{if(i!==d<<2)throw new a.FormatError("Could not fix indexToLocFormat: "+u);c[50]=0,c[51]=1}}}(x.head,F,T?x.loca.length:0);var H=Object.create(null);if(T){var G=r(x.head.data[50],x.head.data[51]),W=function(e,t,r,a,i,n,s){var o,l,c;a?(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 h=n?r+1:r,u=o*(1+h),d=new Uint8Array(u);d.set(e.data.subarray(0,u)),e.data=d;var f,g,m=t.data,b=m.length,y=new Uint8Array(b),v=l(d,0),w=0,A=Object.create(null);for(c(d,0,w),f=0,g=o;fb&&(b+3&-4)===k&&(k=b),k>b&&(v=k);var S=p(m,v,k,y,w,i),x=S.length;0===x&&(A[f]=!0),S.sizeOfInstructions>s&&(s=S.sizeOfInstructions),c(d,g,w+=x),v=k}if(0===w){var C=new Uint8Array([0,1,0,0,0,0,0,0,0,0,0,0,0,0,49,0]);for(f=0,g=o;f_+w?t.data=y.subarray(0,_+w):(t.data=new Uint8Array(_+w),t.data.set(y.subarray(0,w))),t.data.set(y.subarray(0,_),w),c(e.data,d.length-o,w+_)}else t.data=y.subarray(0,w);return{missingGlyphs:A,maxSizeOfInstructions:s}}(x.loca,x.glyf,F,G,z,U,j);H=W.missingGlyphs,I>=65536&&x.maxp.length>=22&&(x.maxp.data[26]=W.maxSizeOfInstructions>>8,x.maxp.data[27]=255&W.maxSizeOfInstructions)}if(!x.hhea)throw new a.FormatError('Required "hhea" table is not found');0===x.hhea.data[10]&&0===x.hhea.data[11]&&(x.hhea.data[10]=255,x.hhea.data[11]=255);var V={unitsPerEm:r(x.head.data[18],x.head.data[19]),yMax:r(x.head.data[42],x.head.data[43]),yMin:f(x.head.data[38],x.head.data[39]),ascent:r(x.hhea.data[4],x.hhea.data[5]),descent:f(x.hhea.data[6],x.hhea.data[7])};this.ascent=V.ascent/V.unitsPerEm,this.descent=V.descent/V.unitsPerEm,x.post&&function(e,r,i){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,h=!0;switch(l){case 65536:s=w;break;case 131072:var u=t.getUint16();if(u!==i){h=!1;break}var d=[];for(c=0;c=32768){h=!1;break}d.push(f)}if(!h)break;for(var g=[],p=[];t.pos65535)throw new a.FormatError("Max size of CID is 65,535");var r=-1;K?r=t:void 0!==$[t]&&(r=$[t]),r>=0&&r>>0,g=!1;if((!o||o.platformId!==u||o.encodingId!==d)&&(0===u&&0===d||1===u&&0===d?g=!0:3!==u||1!==d||!i&&o?r&&3===u&&0===d&&(g=!0,c=!0):(g=!0,r||(c=!0)),g&&(o={platformId:u,encodingId:d,offset:f}),c))break}if(o&&(t.pos=s+o.offset),!o||-1===t.peekByte())return(0,a.warn)("Could not find a preferred cmap table."),{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1};var p=t.getUint16();t.skip(4);var m,b,y=!1,v=[];if(0===p){for(m=0;m<256;m++){var w=t.getByte();w&&v.push({charCode:m,glyphId:w})}y=!0}else if(4===p){var A=t.getUint16()>>1;t.skip(6);var k,S=[];for(k=0;k>1)-(A-k);n.offsetIndex=_,x=Math.max(x,_+n.end-n.start+1)}else n.offsetIndex=-1}var P=[];for(m=0;m0&&Y(le)&&(X[e]=le)}}}}else if(0===J&&0===Z)for(let e=0;e=61440&&t<=61695&&(t&=255),X[t]=ee[e].glyphId}}0===X.length&&(X[0]=0);let ce=R-1;U||(ce=0);var he=O(X,Y,ce);if(this.toFontChar=he.toFontChar,x.cmap={tag:"cmap",data:M(he.charCodeToGlyphId,R)},x["OS/2"]&&function(e,t){t.pos=(t.start||0)+e.offset;var r=t.getUint16();t.skip(60);var a=t.getUint16();return!(r<4&&768&a||t.getUint16()>t.getUint16()||(t.skip(6),0===t.getUint16()||(e.data[8]=e.data[9]=0,0)))}(x["OS/2"],t)||(x["OS/2"]={tag:"OS/2",data:D(o,he.charCodeToGlyphId,V)}),!T)try{_=new d.Stream(x["CFF "].data),C=new i.CFFParser(_,o,m).parse(),C.duplicateFirstGlyph();var ue=new i.CFFCompiler(C);x["CFF "].data=ue.compile()}catch(e){(0,a.warn)("Failed to compile font "+o.loadedName)}if(x.name){var de=b(x.name);x.name.data=B(e,de)}else x.name={tag:"name",data:B(this.name)};var fe=new P(k.version);for(var ge in x)fe.addTable(ge,x[ge].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 _)){var r=[],a=(0,n.getGlyphsUnicode)();for(var i in t){var s=t[i],o=(0,l.getUnicodeForGlyph)(s,a);-1!==o&&(r[i]=String.fromCharCode(o))}e.toUnicode.amend(r)}}(r,r.builtInEncoding);let i=1;t instanceof L&&(i=t.numGlyphs-1);var o=t.getGlyphMapping(r),c=O(o,t.hasGlyphId.bind(t),i);this.toFontChar=c.toFontChar;var h=t.numGlyphs;function u(e,t){var r=null;for(var a in e)t===e[a]&&(r||(r=[]),r.push(0|a));return r}function d(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 g=r.fontMatrix||a.FONT_IDENTITY_MATRIX,p=t.getCharset(),m=Object.create(null);for(var b in f){var y=f[b|=0],v=s.StandardEncoding[y[2]],w=s.StandardEncoding[y[3]],A=p.indexOf(v),k=p.indexOf(w);if(!(A<0||k<0)){var S={x:y[0]*g[0]+y[1]*g[2]+g[4],y:y[0]*g[1]+y[1]*g[3]+g[5]},x=u(o,b);if(x)for(let e=0,t=x.length;e=0?a:0;else if(c)for(i in t)l[i]=t[i];else for(o=s.StandardEncoding,i=0;i=0?a:0;var h,u=e.differences;if(u)for(i in u){var d=u[i];if(-1===(a=r.indexOf(d))){h||(h=(0,n.getGlyphsUnicode)());var f=S(d,h);f!==d&&(a=r.indexOf(f))}l[i]=a>=0?a:0}return l}t.ErrorFont=I;var F=function(){function e(e,t,r){for(var a,i=e.length,n=t.length,s=i-n,o=r,l=!1;o=n){for(o+=a;o=0&&(n[s]=r)}return E(e,n,a)},hasGlyphId:function(e){return!(e<0||e>=this.numGlyphs)&&(0===e||this.charstrings[e-1].charstring.length>0)},getSeacs:function(e){var t,r,a=[];for(t=0,r=e.length;t0;y--)b[y]-=b[y-1];g.setByName(m,b)}}s.topDict.privateDict=g;var v=new i.CFFIndex;for(c=0,h=a.length;c=t)throw new a.FormatError("Invalid CFF header");0!==r&&((0,a.info)("cff data is shifted"),e=e.subarray(r),this.bytes=e);var i=e[0],n=e[1],s=e[2],o=e[3];return{obj:new h(i,n,s,o),endPos:s}},parseDict:function(e){var t=0;function r(){var r=e[t++];return 30===r?function(){var r="",a=15;const i=["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===a)break;if(r+=i[o],l===a)break;r+=i[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,a.warn)('CFFParser_parseDict: "'+r+'" is a reserved command.'),NaN)}var i=[],n=[];t=0;for(var s=e.length;t10)return!1;for(var o=r.stackSize,l=r.stack,c=i.length,h=0;h>16,h+=2,o++;else if(14===u){if(o>=4&&(o-=4,this.seacAnalysisEnabled))return r.seac=l.slice(o,o+4),!1;d=e[u]}else if(u>=32&&u<=246)l[o]=u-139,o++;else if(u>=247&&u<=254)l[o]=u<251?(u-247<<8)+i[h]+108:-(u-251<<8)-i[h]-108,h++,o++;else if(255===u)l[o]=(i[h]<<24|i[h+1]<<16|i[h+2]<<8|i[h+3])/65536,h+=4,o++;else if(19===u||20===u)r.hints+=o>>1,h+=r.hints+7>>3,o%=2,d=e[u];else{if(10===u||29===u){var g;if(!(g=10===u?n:s))return d=e[u],(0,a.warn)("Missing subrsIndex for "+d.id),!1;var p=32768;g.count<1240?p=107:g.count<33900&&(p=1131);var m=l[--o]+p;if(m<0||m>=g.count||isNaN(m))return d=e[u],(0,a.warn)("Out of bounds subrIndex for "+d.id),!1;if(r.stackSize=o,r.callDepth++,!this.parseCharString(r,g.get(m),n,s))return!1;r.callDepth--,o=r.stackSize;continue}if(11===u)return r.stackSize=o,!0;d=e[u]}if(d){if(d.stem&&(r.hints+=o>>1,3===u||23===u?r.hasVStems=!0:!r.hasVStems||1!==u&&18!==u||((0,a.warn)("CFF stem hints are in wrong order"),i[h-1]=1===u?3:23)),"min"in d&&!r.undefStack&&o=2&&d.stem?o%=2:o>1&&(0,a.warn)("Found too many parameters for stack-clearing command"),o>0&&l[o-1]>=0&&(r.width=l[o-1])),"stackDelta"in d?("stackFn"in d&&d.stackFn(l,o),o+=d.stackDelta):d.stackClearing?o=0:d.resetStack?(o=0,r.undefStack=!1):d.undefStack&&(o=0,r.undefStack=!0,r.firstStackClearing=!1)}}return r.stackSize=o,!0},parseCharStrings({charStrings:e,localSubrIndex:t,globalSubrIndex:r,fdSelect:i,fdArray:n,privateDict:s}){for(var o=[],l=[],c=e.count,h=0;h=n.length&&((0,a.warn)("Invalid fd index for glyph index."),f=!1),f&&(g=(p=n[m].privateDict).subrsIndex)}else t&&(g=t);if(f&&(f=this.parseCharString(d,u,g,r)),null!==d.width){const e=p.getByName("nominalWidthX");l[h]=e+d.width}else{const e=p.getByName("defaultWidthX");l[h]=e}null!==d.seac&&(o[h]=d.seac),f||e.set(h,new Uint8Array([14]))}return{charStrings:e,seacs:o,widths:l}},emptyPrivateDictionary:function(e){var t=this.createDict(p,[],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],a=t[1];if(0===r||a>=this.bytes.length)this.emptyPrivateDictionary(e);else{var i=a+r,n=this.bytes.subarray(a,i),s=this.parseDict(n),o=this.createDict(p,s,e.strings);if(e.privateDict=o,o.getByName("Subrs")){var l=o.getByName("Subrs"),c=a+l;if(0===l||c>=this.bytes.length)this.emptyPrivateDictionary(e);else{var h=this.parseIndex(c);o.subrsIndex=h.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,i.ISOAdobeCharset);if(1===e)return new b(!0,m.EXPERT,i.ExpertCharset);if(2===e)return new b(!0,m.EXPERT_SUBSET,i.ExpertSubsetCharset);var s=this.bytes,o=e,l=s[e++];const c=[n?0:".notdef"];var h,u,d;switch(t-=1,l){case 0:for(d=0;d=65535)(0,a.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 h=function(e,t,r,a){this.major=e,this.minor=t,this.hdrSize=r,this.offSize=a};t.CFFHeader=h;var u=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=u;var d=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=d;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 i=0;i=this.fdSelect.length?-1:this.fdSelect[e]}},e}();t.CFFFDSelect=v;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 a.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 a.FormatError(`Not tracking location of ${e}`);for(var i=r.data,n=this.offsets[e],s=0,o=t.length;s>24&255,i[h]=f>>16&255,i[u]=f>>8&255,i[d]=255&f}}},e}(),A=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 i=this.compileNameIndex(e.names);if(t.add(i),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 d,r=0,i=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,a.stringToBytes)(o))}return this.compileIndex(t)},compileTopDicts:function(e,t,r){for(var a=[],i=new d,n=0,s=e.length;n>8&255,255&s]);else{n=new Uint8Array(1+2*s),n[0]=0;let t=0;const i=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,a;switch(t){case 0:for(r=new Uint8Array(1+e.fdSelect.length),r[0]=t,a=0;a>8&255,255&i,n];for(a=1;a>8&255,255&a,t),n=t)}const o=(s.length-3)/3;s[1]=o>>8&255,s[2]=255&o,s.push(a>>8&255,255&a),r=new Uint8Array(s)}return this.compileTypedArray(r)},compileTypedArray:function(e){for(var t=[],r=0,a=e.length;r>8&255,255&a],o=1;for(i=0;i>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[i]&&(l+=r[i].length);for(i=0;i=65520&&e<=65535?0:e>=62976&&e<=63743?i()[e]||e:173===e?45:e},t.reverseIfRtl=function(e){var t,r,a=e.length;if(a<=1||!((t=e.charCodeAt(0))>=(r=n[13]).begin&&t=(r=n[11]).begin&&t=0;s--)i+=e[s];return i},t.getUnicodeRangeFor=function(e){for(var t=0,r=n.length;t=a.begin&&e=5&&i<=7))return-1;a=e.substring(1)}if(a===a.toUpperCase()&&(r=parseInt(a,16))>=0)return r}return-1}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FontRendererFactory=void 0;var a=r(2),i=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,i,n){var s,o,l,c=1===t(r,i+2)?e(r,i+8):e(r,i+16),h=t(r,i+c);if(4===h){t(r,i+c+2);var u=t(r,i+c+6)>>1;for(o=i+c+14,s=[],l=0;l>1;r>16,c=0,h=0;if(o+=10,l<0)do{s=e[o]<<8|e[o+1];var d,f,g=e[o+2]<<8|e[o+3];o+=4,1&s?(d=(e[o]<<24|e[o+1]<<16)>>16,f=(e[o+2]<<24|e[o+3]<<16)>>16,o+=4):(d=e[o++],f=e[o++]),2&s?(c=d,h=f):(c=0,h=0);var p=1,m=1,b=0,y=0;8&s?(p=m=(e[o]<<24|e[o+1]<<16)/1073741824,o+=2):64&s?(p=(e[o]<<24|e[o+1]<<16)/1073741824,m=(e[o+2]<<24|e[o+3]<<16)/1073741824,o+=4):128&s&&(p=(e[o]<<24|e[o+1]<<16)/1073741824,b=(e[o+2]<<24|e[o+3]<<16)/1073741824,y=(e[o+4]<<24|e[o+5]<<16)/1073741824,m=(e[o+6]<<24|e[o+7]<<16)/1073741824,o+=8);var v=r.glyphs[g];v&&(t.push({cmd:"save"}),t.push({cmd:"transform",args:[p,b,y,m,c,h]}),u(v,t,r),t.push({cmd:"restore"}))}while(32&s);else{var w,A,k=[];for(w=0;w0;)x.push({flags:s})}for(w=0;w>16,o+=2;break;case 2:c-=e[o++];break;case 18:c+=e[o++]}x[w].x=c}for(w=0;w>16,o+=2;break;case 4:h-=e[o++];break;case 36:h+=e[o++]}x[w].y=h}var _=0;for(o=0;o>1,_=!0;break;case 4:g+=u.pop(),o(f,g),_=!0;break;case 5:for(;u.length>0;)f+=u.shift(),g+=u.shift(),l(f,g);break;case 6:for(;u.length>0&&(l(f+=u.shift(),g),0!==u.length);)g+=u.shift(),l(f,g);break;case 7:for(;u.length>0&&(g+=u.shift(),l(f,g),0!==u.length);)l(f+=u.shift(),g);break;case 8:for(;u.length>0;)y=f+u.shift(),w=g+u.shift(),v=y+u.shift(),A=w+u.shift(),f=v+u.shift(),g=A+u.shift(),c(y,w,v,A,f,g);break;case 10:if(x=u.pop(),C=null,i.isCFFCIDFont){const e=i.fdSelect.getFDIndex(n);if(e>=0&&eMath.abs(g-I)?f+=u.shift():g+=u.shift(),c(y,w,v,A,f,g);break;default:throw new a.FormatError(`unknown operator: 12 ${P}`)}break;case 14:if(u.length>=4){var E=u.pop(),F=u.pop();g=u.pop(),f=u.pop(),t.push({cmd:"save"}),t.push({cmd:"translate",args:[f,g]});var L=h(i.cmap,String.fromCharCode(i.glyphNameMap[s.StandardEncoding[E]]));d(i.glyphs[L.glyphId],t,i,L.glyphId),t.push({cmd:"restore"}),L=h(i.cmap,String.fromCharCode(i.glyphNameMap[s.StandardEncoding[F]])),d(i.glyphs[L.glyphId],t,i,L.glyphId)}return;case 19:case 20:b+=(p+=u.length>>1)+7>>3,_=!0;break;case 21:g+=u.pop(),o(f+=u.pop(),g),_=!0;break;case 22:o(f+=u.pop(),g),_=!0;break;case 24:for(;u.length>2;)y=f+u.shift(),w=g+u.shift(),v=y+u.shift(),A=w+u.shift(),f=v+u.shift(),g=A+u.shift(),c(y,w,v,A,f,g);f+=u.shift(),g+=u.shift(),l(f,g);break;case 25:for(;u.length>6;)f+=u.shift(),g+=u.shift(),l(f,g);y=f+u.shift(),w=g+u.shift(),v=y+u.shift(),A=w+u.shift(),f=v+u.shift(),g=A+u.shift(),c(y,w,v,A,f,g);break;case 26:for(u.length%2&&(f+=u.shift());u.length>0;)y=f,w=g+u.shift(),v=y+u.shift(),A=w+u.shift(),f=v,g=A+u.shift(),c(y,w,v,A,f,g);break;case 27:for(u.length%2&&(g+=u.shift());u.length>0;)c(y=f+u.shift(),w=g,v=y+u.shift(),A=w+u.shift(),f=v+u.shift(),g=A);break;case 28:u.push((m[b]<<24|m[b+1]<<16)>>16),b+=2;break;case 29:x=u.pop()+i.gsubrsBias,(C=i.gsubrs[x])&&e(C);break;case 30:for(;u.length>0&&(y=f,w=g+u.shift(),v=y+u.shift(),A=w+u.shift(),f=v+u.shift(),g=A+(1===u.length?u.shift():0),c(y,w,v,A,f,g),0!==u.length);)y=f+u.shift(),w=g,v=y+u.shift(),A=w+u.shift(),g=A+u.shift(),c(y,w,v,A,f=v+(1===u.length?u.shift():0),g);break;case 31:for(;u.length>0&&(y=f+u.shift(),w=g,v=y+u.shift(),A=w+u.shift(),g=A+u.shift(),c(y,w,v,A,f=v+(1===u.length?u.shift():0),g),0!==u.length);)y=f,w=g+u.shift(),v=y+u.shift(),A=w+u.shift(),f=v+u.shift(),g=A+(1===u.length?u.shift():0),c(y,w,v,A,f,g);break;default:if(P<32)throw new a.FormatError(`unknown operator: ${P}`);P<247?u.push(P-139):P<251?u.push(256*(P-247)+m[b++]+108):P<255?u.push(256*-(P-251)-m[b++]-108):(u.push((m[b]<<24|m[b+1]<<16|m[b+2]<<8|m[b+3])/65536),b+=4)}_&&(u.length=0)}}(e)}const f=[];class g{constructor(e){this.constructor===g&&(0,a.unreachable)("Cannot initialize CompiledFont."),this.fontMatrix=e,this.compiledGlyphs=Object.create(null),this.compiledCharCodeToGlyphId=Object.create(null)}getPathJs(e){const t=h(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&&ea)return!0;for(var i=a-e,n=i;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(i,e):this.stack.length=0,!1}},d}(),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 a,i,n=0|t;for(a=0;a>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,a,s){if(a){var o=r.getBytes(),l=!((e(o[0])||(0,i.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,a){var i,n,s=0|r,o=t.length,l=new Uint8Array(o>>>1);for(i=0,n=0;i>8,s=52845*(u+s)+22719&65535}}}return l.slice(a,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,i.isWhiteSpace)(t))break;t=this.nextChar()}if(r(t))return this.nextChar(),String.fromCharCode(t);var a="";do{a+=String.fromCharCode(t),t=this.nextChar()}while(t>=0&&!(0,i.isWhiteSpace)(t)&&!r(t));return a},readCharStrings:function(e,r){return-1===r?e:t(e,4330,r)},extractFontProgram:function(e){var t=this.stream,r=[],a=[],i=Object.create(null);i.lenIV=4;for(var n,s,l,c,h,u={subrs:[],charstrings:[],properties:{privateData:i}};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 d=this.getToken();s=this.readInt(),this.getToken(),l=s>0?t.getBytes(s):new Uint8Array(0),c=u.properties.privateData.lenIV,h=this.readCharStrings(l,c),this.nextChar(),"noaccess"===(n=this.getToken())&&this.getToken(),a.push({glyph:d,encoded:h})}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=u.properties.privateData.lenIV,h=this.readCharStrings(l,c),this.nextChar(),"noaccess"===(n=this.getToken())&&this.getToken(),r[e]=h}break;case"BlueValues":case"OtherBlues":case"FamilyBlues":case"FamilyOtherBlues":var f=this.readNumberArray();f.length>0&&f.length;break;case"StemSnapH":case"StemSnapV":u.properties.privateData[n]=this.readNumberArray();break;case"StdHW":case"StdVW":u.properties.privateData[n]=this.readNumberArray()[0];break;case"BlueShift":case"lenIV":case"BlueFuzz":case"BlueScale":case"LanguageGroup":case"ExpansionFactor":u.properties.privateData[n]=this.readNumber();break;case"ForceBold":u.properties.privateData[n]=this.readBoolean()}for(var g=0;g-1&&void 0===e.widths[t]&&t>=e.firstChar&&t<=e.lastChar&&(e.widths[t]=p.width)}}return u},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 i,n=this.getToken();if(/^\d+$/.test(n)){i=[];var s=0|parseInt(n,10);this.getToken();for(var o=0;o=u||_<=0)(0,a.info)("Bad shading domain.");else{var T,I=new Float32Array(o.numComps),E=new Float32Array(1);for(let e=0;e<=10;e++){E[0]=h+e*_,C(E,0,I,0),T=o.getRgb(I,0);var F=a.Util.makeCssRgb(T[0],T[1],T[2]);P.push([e/10,F])}var L="transparent";e.has("Background")&&(T=o.getRgb(e.get("Background"),0),L=a.Util.makeCssRgb(T[0],T[1],T[2])),f||(P.unshift([0,L]),P[1][0]+=g.SMALL_NUMBER),p||(P[P.length-1][0]-=g.SMALL_NUMBER,P.push([1,L])),this.colorStops=P}}return e.prototype={getIR:function(){var e,t,r,i,n,s=this.coordsArr,c=this.shadingType;c===o?(t=[s[0],s[1]],r=[s[2],s[3]],i=null,n=null,e="axial"):c===l?(t=[s[0],s[1]],r=[s[3],s[4]],i=s[2],n=s[5],e="radial"):(0,a.unreachable)(`getPattern type unknown: ${c}`);var h=this.matrix;if(h&&(t=a.Util.applyTransform(t,h),r=a.Util.applyTransform(r,h),c===l)){var u=a.Util.singularValueDecompose2dScale(h);i*=u[0],n*=u[1]}return["RadialAxial",e,this.bbox,this.colorStops,t,r,i,n]}},e}(),g.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 a=t.colorSpace.numComps;this.tmpCsCompsBuf=t.colorFn?new Float32Array(a):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 a=this.stream.getByte();return this.buffer=a&(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),a=this.context.decode,i=e<32?1/((1<o?o:t,r=r>l?l:r,a=a=0&&"ET"===f[P];--P)f[P]="EN";for(P=m+1;P0&&(I=f[m-1]);var E=C;T+1F&&s(F)&&(R=F);for(F=L;F>=R;--F){var O=-1;for(m=0,b=A.length;m=0&&(h(d,O,m),O=-1):O<0&&(O=m);O>=0&&h(d,O,A.length)}for(m=0,b=d.length;m"!==M||(d[m]="")}return u(d.join(""),g)};var a=r(2),i=["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 a=t,i=e.length;a>l)*h,c&=(1<r?e=r:e0&&(d=i[h-1]);var f=a[1];h>1,l=i.length>>1,u=new c(s),d=Object.create(null),f=8192,g=new Float32Array(l);return function(e,t,r,a){var i,s,c="",h=g;for(i=0;i(v=n[2*i+1]))&&(s=v),m[i]=s}f>0&&(f--,d[c]=m),r.set(m,a)}else r.set(p,a)}}},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,a=e-1;a>=0;a--,r++)t.push(t[r])},index:function(e){this.push(this.stack[this.stack.length-e-1])},roll:function(e,t){var r,a,i,n=this.stack,s=n.length-e,o=n.length-1,l=s+(t-Math.floor(t/e)*e);for(r=s,a=o;r0?n.push(r<>i);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":i=n.pop(),r=n.pop(),n.push(r/i);break;case"dup":n.copy(1);break;case"eq":i=n.pop(),r=n.pop(),n.push(r===i);break;case"exch":n.roll(2,1);break;case"exp":i=n.pop(),r=n.pop(),n.push(r**i);break;case"false":n.push(!1);break;case"floor":r=n.pop(),n.push(Math.floor(r));break;case"ge":i=n.pop(),r=n.pop(),n.push(r>=i);break;case"gt":i=n.pop(),r=n.pop(),n.push(r>i);break;case"idiv":i=n.pop(),r=n.pop(),n.push(r/i|0);break;case"index":r=n.pop(),n.index(r);break;case"le":i=n.pop(),r=n.pop(),n.push(r<=i);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":i=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,a.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)},i.prototype=Object.create(e.prototype),i.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,a,i){var n,f,g,p,m,b,y,v,w=[],A=[],k=a.length>>1,S=i.length>>1,x=0;for(let e=0;ee.min&&(s.unshift("Math.max(",a,", "),s.push(")")),n=0&&(t>=65&&t<=90||t>=97&&t<=122);)r.push(String.fromCharCode(t));const a=r.join("");switch(a.toLowerCase()){case"if":return o.IF;case"ifelse":return o.IFELSE;default:return o.getOperator(a)}}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 a.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 a=r(2);const i=3285377520,n=4294901760,s=65535;t.MurmurHash3_64=class{constructor(e){this.h1=e?4294967295&e:i,this.h2=e?4294967295&e:i}update(e){let t,r;if((0,a.isString)(e)){t=new Uint8Array(2*e.length),r=0;for(let a=0,i=e.length;a>>8,t[r++]=255&i)}}else{if(!(0,a.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 i=r>>2,o=r-4*i,l=new Uint32Array(t.buffer,0,i);let c=0,h=0,u=this.h1,d=this.h2;const f=3432918353,g=461845907,p=11601,m=13715;for(let e=0;e>>17,c=c*g&n|c*m&s,u^=c,u=u<<13|u>>>19,u=5*u+3864292196):(h=l[e],h=h*f&n|h*p&s,h=h<<15|h>>>17,h=h*g&n|h*m&s,d^=h,d=d<<13|d>>>19,d=5*d+3864292196);switch(c=0,o){case 3:c^=t[4*i+2]<<16;case 2:c^=t[4*i+1]<<8;case 1:c^=t[4*i],c=c*f&n|c*p&s,c=c<<15|c>>>17,c=c*g&n|c*m&s,1&i?u^=c:d^=c}this.h1=u,this.h2=d}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),a=(t>>>0).toString(16);return r.padStart(8,"0")+a.padStart(8,"0")}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PDFImage=void 0;var a=r(2),i=r(5),n=r(23),s=r(12),o=r(18),l=r(21),c=function(){function e(e,t,r,a){return(e=t+e*r)<0?e=0:e>a&&(e=a),e}function t(e,t,r,a,i,n){var s=i*n;let o;o=t<=8?new Uint8Array(s):t<=16?new Uint16Array(s):new Uint32Array(s);var l,c,h,u,d=r/i,f=a/n,g=0,p=new Uint16Array(i),m=r;for(l=0;l0&&Number.isInteger(s.height)&&s.height>0&&(s.width!==m||s.height!==b)&&((0,a.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 a.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 y=s.bitsPerComponent;if(!y&&!(y=f.get("BitsPerComponent","BPC"))){if(!this.imageMask)throw new a.FormatError(`Bits per component missing in image: ${this.imageMask}`);y=1}if(this.bpc=y,!this.imageMask){var v=f.get("ColorSpace","CS");if(!v)switch((0,a.info)("JPX images (which do not require color spaces)"),s.numComps){case 1:v=i.Name.get("DeviceGray");break;case 3:v=i.Name.get("DeviceRGB");break;case 4:v=i.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(v,e,r,d),this.numComps=this.colorSpace.numComps}if(this.decode=f.getArray("Decode","D"),this.needsDecode=!1,this.decode&&(this.colorSpace&&!this.colorSpace.isDefaultDecode(this.decode,y)||u&&!n.ColorSpace.isDefaultDecode(this.decode,1))){this.needsDecode=!0;var w=(1<>3)*r,l=e.byteLength;if(!a||i&&o!==l)if(i)for((n=new Uint8ClampedArray(o)).set(e),s=l;s>7&1,o[d+1]=c>>6&1,o[d+2]=c>>5&1,o[d+3]=c>>4&1,o[d+4]=c>>3&1,o[d+5]=c>>2&1,o[d+6]=c>>1&1,o[d+7]=1&c,d+=8;if(d>=1}else{var b=0;for(c=0,d=0,l=n;d>y;r<0?r=0:r>u&&(r=u),o[d]=r,c&=(1<p[w+1]){b=255;break}}l[u]=b}}if(l)for(u=0,f=3,d=i*s;u>3;if(!e){var f;if("DeviceGray"===this.colorSpace.name&&1===u?f=a.ImageKind.GRAYSCALE_1BPP:"DeviceRGB"!==this.colorSpace.name||8!==u||this.needsDecode||(f=a.ImageKind.RGB_24BPP),f&&!this.smask&&!this.mask&&r===c&&i===h){if(n.kind=f,t=this.getImageBytes(h*d),this.image instanceof s.DecodeStream)n.data=t;else{var g=new Uint8ClampedArray(t.length);g.set(t),n.data=g}if(this.needsDecode){(0,a.assert)(f===a.ImageKind.GRAYSCALE_1BPP,"PDFImage.createImageData: The image must be grayscale.");for(var p=n.data,m=0,b=p.length;m>3,c=this.getImageBytes(s*l),h=this.getComponents(c);if(1!==o){this.needsDecode&&this.decodeBuffer(h),i=n*s;var u=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===i)r.resolve(t.data);else{if(t.callback!==n)throw new Error("Unexpected callback case");r.reject(g(t.reason))}return}const a=this.actionHandler[t.action];if(!a)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const e=this.sourceName,s=t.sourceName;new Promise((function(e){e(a(t.data))})).then((function(a){r.postMessage({sourceName:e,targetName:s,callback:i,callbackId:t.callbackId,data:a})}),(function(a){r.postMessage({sourceName:e,targetName:s,callback:n,callbackId:t.callbackId,reason:g(a)})}))}else t.streamId?this._createStreamSink(t):a(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 i=this.callbackId++,n=(0,a.createPromiseCapability)();this.callbackCapabilities[i]=n;try{this._postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:i,data:t},r)}catch(e){n.reject(e)}return n.promise}sendWithStream(e,t,r,i){const n=this.streamId++,o=this.sourceName,l=this.targetName,c=this.comObj;return new ReadableStream({start:r=>{const s=(0,a.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},i),s.promise},pull:e=>{const t=(0,a.createPromiseCapability)();return this.streamControllers[n].pullCall=t,c.postMessage({sourceName:o,targetName:l,stream:u,streamId:n,desiredSize:e.desiredSize}),t.promise},cancel:e=>{(0,a.assert)(e instanceof Error,"cancel must have a valid reason");const t=(0,a.createPromiseCapability)();return this.streamControllers[n].cancelCall=t,this.streamControllers[n].isClosed=!0,c.postMessage({sourceName:o,targetName:l,stream:s,streamId:n,reason:g(e)}),t.promise}},r)}_createStreamSink(e){const t=this,r=this.actionHandler[e.action],i=e.streamId,n=this.sourceName,s=e.sourceName,o=this.comObj,u={enqueue(e,r=1,o){if(this.isCancelled)return;const l=this.desiredSize;this.desiredSize-=r,l>0&&this.desiredSize<=0&&(this.sinkCapability=(0,a.createPromiseCapability)(),this.ready=this.sinkCapability.promise),t._postMessage({sourceName:n,targetName:s,stream:c,streamId:i,chunk:e},o)},close(){this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:n,targetName:s,stream:l,streamId:i}),delete t.streamSinks[i])},error(e){(0,a.assert)(e instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:n,targetName:s,stream:h,streamId:i,reason:g(e)}))},sinkCapability:(0,a.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};u.sinkCapability.resolve(),u.ready=u.sinkCapability.promise,this.streamSinks[i]=u,new Promise((function(t){t(r(e.data,u))})).then((function(){o.postMessage({sourceName:n,targetName:s,stream:f,streamId:i,success:!0})}),(function(e){o.postMessage({sourceName:n,targetName:s,stream:f,streamId:i,reason:g(e)})}))}_processStreamMessage(e){const t=e.streamId,r=this.sourceName,i=e.sourceName,n=this.comObj;switch(e.stream){case f:e.success?this.streamControllers[t].startCall.resolve():this.streamControllers[t].startCall.reject(g(e.reason));break;case d:e.success?this.streamControllers[t].pullCall.resolve():this.streamControllers[t].pullCall.reject(g(e.reason));break;case u:if(!this.streamSinks[t]){n.postMessage({sourceName:r,targetName:i,stream:d,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:p}=this.streamSinks[e.streamId];new Promise((function(e){e(p&&p())})).then((function(){n.postMessage({sourceName:r,targetName:i,stream:d,streamId:t,success:!0})}),(function(e){n.postMessage({sourceName:r,targetName:i,stream:d,streamId:t,reason:g(e)})}));break;case c:if((0,a.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,a.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 h:(0,a.assert)(this.streamControllers[t],"error should have stream controller"),this.streamControllers[t].controller.error(g(e.reason)),this._deleteStreamController(t);break;case o:e.success?this.streamControllers[t].cancelCall.resolve():this.streamControllers[t].cancelCall.reject(g(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(g(e.reason)))})).then((function(){n.postMessage({sourceName:r,targetName:i,stream:o,streamId:t,success:!0})}),(function(e){n.postMessage({sourceName:r,targetName:i,stream:o,streamId:t,reason:g(e)})})),this.streamSinks[t].sinkCapability.reject(g(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 a=r(2);t.PDFWorkerStream=class{constructor(e){this._msgHandler=e,this._contentLength=null,this._fullRequestReader=null,this._rangeRequestReaders=[]}getFullReader(){return(0,a.assert)(!this._fullRequestReader,"PDFWorkerStream.getFullReader can only be called once."),this._fullRequestReader=new i(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 i{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 a=this._msgHandler.sendWithStream("GetRangeReader",{begin:e,end:t});this._reader=a.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=a()},7963:function(e,t,r){var a;a=function(){return function(e){var t={};function r(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},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 a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(a,i,function(t){return e[t]}.bind(null,i));return a},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 a.AnnotationLayerBuilder}}),Object.defineProperty(t,"DefaultAnnotationLayerFactory",{enumerable:!0,get:function(){return a.DefaultAnnotationLayerFactory}}),Object.defineProperty(t,"DefaultTextLayerFactory",{enumerable:!0,get:function(){return i.DefaultTextLayerFactory}}),Object.defineProperty(t,"TextLayerBuilder",{enumerable:!0,get:function(){return i.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 h.PDFHistory}}),Object.defineProperty(t,"PDFPageView",{enumerable:!0,get:function(){return u.PDFPageView}}),Object.defineProperty(t,"PDFSinglePageViewer",{enumerable:!0,get:function(){return d.PDFSinglePageViewer}}),Object.defineProperty(t,"PDFViewer",{enumerable:!0,get:function(){return f.PDFViewer}});var a=r(1),i=r(5),n=r(3),s=r(4),o=r(6),l=r(8),c=r(10),h=r(12),u=r(13),d=r(15),f=r(17)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultAnnotationLayerFactory=t.AnnotationLayerBuilder=void 0;var a=r(2),i=r(3),n=r(4);class s{constructor({pageDiv:e,pdfPage:t,linkService:r,downloadManager:a,imageResourcesPath:n="",renderInteractiveForms:s=!1,l10n:o=i.NullL10n}){this.pageDiv=e,this.pdfPage=t,this.linkService=r,this.downloadManager=a,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)a.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,a.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="",a=!1,o=i.NullL10n){return new s({pageDiv:e,pdfPage:t,imageResourcesPath:r,renderInteractiveForms:a,linkService:new n.SimpleLinkService,l10n:o})}}},function(e,t,a){"use strict";let i;i="undefined"!=typeof window&&window["pdfjs-dist/build/pdf"]?window["pdfjs-dist/build/pdf"]:r(9299),e.exports=i},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(a).includes(e)&&e!==a.UNKNOWN},t.isValidSpreadMode=function(e){return Number.isInteger(e)&&Object.values(i).includes(e)&&e!==i.UNKNOWN},t.isPortraitOrientation=function(e){return e.width<=e.height},t.clamp=u,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?a[1]:null;r[decodeURIComponent(i)]=decodeURIComponent(n)}return r},t.backtrackBeforeAllVisibleElements=o,t.getVisibleElements=function(e,t,r=!1,a=!1){const i=e.scrollTop,n=i+e.clientHeight,l=e.scrollLeft,c=l+e.clientWidth,h=[],u=t.length;let d=0===u?0:s(t,a?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>i});d>0&&d=n&&(f=m);else if((a?o:u)>f)break;if(m<=i||u>=n||p<=l||o>=c)continue;const b=Math.max(0,i-u)+Math.max(0,m-n),y=Math.max(0,l-o)+Math.max(0,p-c),v=(g-b)*(d-y)*100/g/d|0;h.push({id:r.id,x:o,y:u,view:r,percent:v})}const g=h[0],p=h[h.length-1];return r&&h.sort((function(e,t){const r=e.percent-t.percent;return Math.abs(r)>.001?-r:e.id-t.id})),{first:g,last:p,views:h}},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[a,i,n,s]=e,o=r%180!=0,l=(n-a)/72*t,c=(s-i)/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 a,i=0,n=1,s=1,o=1;for(;;){const e=i+s,t=n+o;if(t>8)break;r<=e/t?(s=e,o=t):(i=e,n=t)}return a=r-i/nn),a.lastX=r;const s=e.scrollTop,o=a.lastY;s!==o&&(a.down=s>o),a.lastY=s,t(a)})))},a={right:!0,down:!0,lastX:e.scrollLeft,lastY:e.scrollTop,_eventHandler:r};let i=null;return e.addEventListener("scroll",r,!0),a},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 h?e._off(t,s):e.removeEventListener(t,s),c&&clearTimeout(c),a(r)}const s=n.bind(null,l.EVENT);e instanceof h?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=[],a=e.length;let i=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,a=e.length-1;if(a<0||!t(e[a]))return e.length;if(t(e[r]))return r;for(;r>1;t(e[i])?a=i:r=i+1}return r}function o(e,t,r){if(e<2)return e;let a=t[e].div,i=a.offsetTop+a.clientTop;i>=r&&(a=t[e-1].div,i=a.offsetTop+a.clientTop);for(let r=e-2;r>=0&&(a=t[r].div,!(a.offsetTop+a.clientTop+a.clientHeight<=i));--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 h{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 a;t.slice(0).forEach((function({listener:e,external:t}){if(t)return a||(a=[]),void a.push(e);e.apply(null,r)})),a&&(a.forEach((function(e){e.apply(null,r)})),a=null)}_on(e,t,r=null){let a=this._listeners[e];a||(this._listeners[e]=a=[]),a.push({listener:t,external:!0===(r&&r.external)})}_off(e,t,r=null){const a=this._listeners[e];if(a)for(let e=0,r=a.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 a=r(3);t.PDFLinkService=class{constructor({eventBus:e,externalLinkTarget:t=null,externalLinkRel:r=null,externalLinkEnabled:a=!0,ignoreDestinationZoom:i=!1}={}){this.eventBus=e,this.externalLinkTarget=t,this.externalLinkRel=r,this.externalLinkEnabled=a,this._ignoreDestinationZoom=i,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:a})=>{const i=a[0];let n;if(i instanceof Object){if(n=this._cachedPageNumber(i),null===n)return void this.pdfDocument.getPageIndex(i).then((e=>{this.cachePageRef(e+1,i),t({namedDest:r,explicitDest:a})})).catch((()=>{console.error(`PDFLinkService.navigateTo: "${i}" is not a valid page reference, for dest="${e}".`)}))}else{if(!Number.isInteger(i))return void console.error(`PDFLinkService.navigateTo: "${i}" is not a valid destination reference, for dest="${e}".`);n=i+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:a,pageNumber:n})),this.pdfViewer.scrollPageIntoView({pageNumber:n,destArray:a,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 i=(0,a.parseQueryString)(e);if("search"in i&&this.eventBus.dispatch("findfromurlhash",{source:this,query:i.search.replace(/"/g,""),phraseSearch:"true"===i.phrase}),"page"in i&&(t=0|i.page||1),"zoom"in i){const e=i.zoom.split(","),t=e[0],a=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,a?a/100:t]}r?this.pdfViewer.scrollPageIntoView({pageNumber:t||this.page,destArray:r,allowNegativeOffset:!0}):t&&(this.page=t),"pagemode"in i&&this.eventBus.dispatch("pagemode",{source:this,mode:i.pagemode}),"nameddest"in i&&this.navigateTo(i.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 a=e[1];if("object"!=typeof a||"string"!=typeof a.name)return!1;let i=!0;switch(a.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;i=!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 a=r(2);class i{constructor({textLayerDiv:e,eventBus:t,pageIndex:r,viewport:a,findController:i=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=a,this.textDivs=[],this.findController=i,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,a.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:a}=this;let i=0,n=0;const s=a.length-1,o=r.state.query.length,l=[];for(let r=0,c=e.length;r=n+a[i].length;)n+=a[i].length,i++;i===a.length&&console.error("Could not find a matching mapping");const h={begin:{divIdx:i,offset:c-n}};for(c+=t?t[r]:o;i!==s&&c>n+a[i].length;)n+=a[i].length,i++;h.end={divIdx:i,offset:c-n},l.push(h)}return l}_renderMatches(e){if(0===e.length)return;const{findController:t,pageIdx:r,textContentItemsStr:a,textDivs:i}=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;i[r].textContent="",h(r,0,e.offset,t)}function h(e,t,r,n){const s=i[e],o=a[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 u=s,d=u+1;if(t.state.highlightAll)u=0,d=e.length;else if(!n)return;for(let a=u;a{if(this.enhanceTextSelection&&this.textLayerRenderTask)return this.textLayerRenderTask.expandTextDivs(!0),void(t&&(clearTimeout(t),t=null));const a=e.querySelector(".endOfContent");if(!a)return;let i=r.target!==e;if(i=i&&"none"!==window.getComputedStyle(a).getPropertyValue("-moz-user-select"),i){const t=e.getBoundingClientRect(),i=Math.max(0,(r.pageY-t.top)/t.height);a.style.top=(100*i).toFixed(2)+"%"}a.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=i,t.DefaultTextLayerFactory=class{createTextLayerBuilder(e,t,r,a=!1,n){return new i({textLayerDiv:e,pageIndex:t,viewport:r,enhanceTextSelection:a,eventBus:n})}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DownloadManager=void 0;var a=r(2);const i=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=i}){this.disableCreateObjectURL=e}downloadUrl(e,t){(0,a.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,a.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 a=Object.create(null);{const e="undefined"!=typeof navigator&&navigator.userAgent||"",t="undefined"!=typeof navigator&&navigator.platform||"",r="undefined"!=typeof navigator&&navigator.maxTouchPoints||1,i=/Android/.test(e),n=/Trident/.test(e),s=/\b(iPad|iPhone|iPod)(?=;)/.test(e)||"MacIntel"===t&&r>1,o=/CriOS/.test(e);(n||o)&&(a.disableCreateObjectURL=!0),(s||i)&&(a.maxCanvasPixels=5242880)}const i=Object.freeze(a);t.viewerCompatibilityParams=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GenericL10n=void 0,r(9);const a=document.webL10n;t.GenericL10n=class{constructor(e){this._lang=e,this._ready=new Promise(((t,r)=>{a.setLanguage(e,(()=>{t(a)}))}))}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 a={},i="",n="textContent",s="",o={},l="loading";function c(e,t,r){t=t||function(e){},r=r||function(){};var a=new XMLHttpRequest;a.open("GET",e,!0),a.overrideMimeType&&a.overrideMimeType("text/plain; charset=utf-8"),a.onreadystatechange=function(){4==a.readyState&&(200==a.status||0===a.status?t(a.responseText):r())},a.onerror=r,a.ontimeout=r;try{a.send(null)}catch(e){r()}}function h(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){i+=e,function(e,r){var a={},i=/^\s*|\s*$/,n=/^\s*#|^\s*$/,s=/^\s*\[(.*)\]\s*$/,h=/^\s*@import\s+url\((.*)\)\s*$/i,u=/^([^=\s]*)\s*=\s*(.+)$/;function d(e,r,c){var d=e.replace(i,"").split(/[\r\n]+/),g="*",p=t.split("-",1)[0],m=!1,b="";!function e(){for(;;){if(!d.length)return void c();var i=d.shift();if(!n.test(i)){if(r){if(b=s.exec(i)){g=b[1].toLowerCase(),m="*"!==g&&g!==t&&g!==p;continue}if(m)continue;if(b=h.exec(i))return void f(o+b[1],e)}var y=i.match(u);y&&3==y.length&&(a[y[1]]=l(y[2]))}}}()}function f(e,t){c(e,(function(e){d(e,!1,t)}),(function(){console.warn(e+" not found."),t()}))}d(e,!0,(function(){r(a)}))}(e,(function(e){for(var t in e){var i,s,o=t.lastIndexOf(".");o>0?(i=t.substring(0,o),s=t.substring(o+1)):(i=t,s=n),a[i]||(a[i]={}),a[i][s]=e[t]}r&&r()}))}),s)}function u(e,r){e&&(e=e.toLowerCase()),r=r||function(){},a={},i="",s="",s=e;var n=t.querySelectorAll('link[type="application/l10n"]'),o=n.length;if(0!==o){var c,u,d=0;u=function(){++d>=o&&(r(),l="complete")};for(var f=0;f0&&(s=e.substring(i+1),e=e.substring(0,i)),r&&((a={})[s]=r);var o=d(e,t,a);return o&&s in o?o[s]:"{{"+e+"}}"},getData:function(){return a},getText:function(){return i},getLanguage:function(){return s},setLanguage:function(e,t){u(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),a=r.length,i=0;i{if(!this._pdfDocument||r&&this._pdfDocument!==r)return;this._extractText();const t=!this._highlightMatches,a=!!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?(a?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 a={top:-50,left:-400};(0,n.scrollIntoView)(e,a,!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,a.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 a(t){const r=e[t],a=e[t+1];if(t=0;a--){const t=e[a];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 i=0,n=e.length;i0){const r=e.charCodeAt(t),a=e.charCodeAt(t-1);if((0,i.getCharacterType)(r)===(0,i.getCharacterType)(a))return!1}const a=t+r-1;if(a0&&(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 a=e.items,i=[];for(let e=0,t=a.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 a=this._offset;if(this._pagesToSearch=r,null!==a.matchIdx){const t=this._pageMatches[a.pageIdx].length;if(!e&&a.matchIdx+10)return a.matchIdx=e?a.matchIdx-1:a.matchIdx+1,void this._updateMatch(!0);this._advanceOffsetPage(e)}this._nextPageMatch()}_matchesReady(e){const t=this._offset,r=e.length,a=this._state.findPrevious;return r?(t.matchIdx=a?r-1:0,this._updateMatch(!0),!0):(this._advanceOffsetPage(a),!!(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,a=this._matchesCountTotal;if(-1!==t){for(let t=0;ta)&&(r=a=0),{current:r,total:a}}_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)?a.SPACE:function(e){return e>=97&&e<=122||e>=65&&e<=90}(e)||function(e){return e>=48&&e<=57}(e)||95===e?a.ALPHA_LETTER:a.PUNCT:function(e){return 3584==(65408&e)}(e)?a.THAI_LETTER:160===e?a.SPACE:a.ALPHA_LETTER:function(e){return e>=13312&&e<=40959||e>=63744&&e<=64255}(e)?a.HAN_LETTER:function(e){return e>=12448&&e<=12543}(e)?a.KATAKANA_LETTER:function(e){return e>=12352&&e<=12447}(e)?a.HIRAGANA_LETTER:function(e){return e>=65376&&e<=65439}(e)?a.HALFWIDTH_KATAKANA_LETTER:a.ALPHA_LETTER},t.CharacterType=void 0;const a={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=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDestHashesEqual=n,t.isDestArraysEqual=s,t.PDFHistory=void 0;var a=r(3);function i(){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,a.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 a in e)if(!r(e[a],t[a]))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 a=0,i=e.length;a{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 a=""!==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=i(),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:i}=this._parseCurrentHash(!0);return!e||a||t?void this._pushOrReplaceState(null,!0):void this._pushOrReplaceState({hash:e,page:r,rotation:i},!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 a=e||JSON.stringify(t);if(!a)return;let i=!1;if(this._destination&&(n(this._destination.hash,a)||s(this._destination.dest,t))){if(this._destination.page)return;i=!0}this._popStateInProgress&&!i||(this._pushOrReplaceState({dest:t,hash:a,page:r,rotation:this.linkService.rotation},i),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,a={fingerprint:this._fingerprint,uid:r?this._uid:this._uid+1,destination:e};let i;if(this._updateInternalState(e,a.uid),this._updateUrl&&e&&e.hash){const t=document.location.href.split("#")[0];t.startsWith("file://")||(i=`${t}#${e.hash}`)}r?window.history.replaceState(a,"",i):(this._maxUid=this._uid,window.history.pushState(a,"",i))}_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(i()).substring(1),r=(0,a.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=i(),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,a.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,a.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 a=r(3),i=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||a.DEFAULT_SCALE,this.viewport=r,this.pdfPageRotate=r.rotation,this.hasRestrictedScaling=!1,this.textLayerMode=Number.isInteger(e.textLayerMode)?e.textLayerMode:a.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||a.RendererType.CANVAS,this.enableWebGL=e.enableWebGL||!1,this.l10n=e.l10n||a.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 i=document.createElement("div");i.className="page",i.style.width=Math.floor(this.viewport.width)+"px",i.style.height=Math.floor(this.viewport.height)+"px",i.setAttribute("data-page-number",this.id),this.div=i,t.appendChild(i)}setPdfPage(e){this.pdfPage=e,this.pdfPageRotate=e.rotate;const t=(this.rotation+this.pdfPageRotate)%360;this.viewport=e.getViewport({scale:this.scale*a.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 a=r.childNodes,i=e&&this.zoomLayer||null,s=t&&this.annotationLayer&&this.annotationLayer.div||null;for(let e=a.length-1;e>=0;e--){const t=a[e];i!==t&&s!==t&&r.removeChild(t)}r.removeAttribute("data-loaded"),s?this.annotationLayer.hide():this.annotationLayer&&(this.annotationLayer.cancel(),this.annotationLayer=null),i||(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*a.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 i=!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&&(i=!0)}if(this.canvas){if(this.useOnlyCssZoom||this.hasRestrictedScaling&&i)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,a=this.viewport.height,i=this.div;e.style.width=e.parentNode.style.width=i.style.width=Math.floor(r)+"px",e.style.height=e.parentNode.style.height=i.style.height=Math.floor(a)+"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=a/r,l=r/a);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,a=Math.abs(t);let i=r/e.width;90!==a&&270!==a||(i=r/e.height);const n=this.textLayer.textLayerDiv;let s,o;switch(a){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("+a+"deg) scale("+i+", "+i+") 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!==a.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===a.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 i.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===a.RendererType.SVG?this.paintOnSvg(r):this.paintOnCanvas(r);c.onRenderContinue=o,this.paintTask=c;const h=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}),h}paintOnCanvas(e){const t=(0,i.createPromiseCapability)(),r={promise:t.promise,onRenderContinue(e){e()},cancel(){g.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}),h=(0,a.getOutputScale)(c);if(this.outputScale=h,this.useOnlyCssZoom){const e=n.clone({scale:a.CSS_UNITS});h.sx*=e.width/n.width,h.sy*=e.height/n.height,h.scaled=!0}if(this.maxCanvasPixels>0){const e=n.width*n.height,t=Math.sqrt(this.maxCanvasPixels/e);h.sx>t||h.sy>t?(h.sx=t,h.sy=t,h.scaled=!0,this.hasRestrictedScaling=!0):this.hasRestrictedScaling=!1}const u=(0,a.approximateFraction)(h.sx),d=(0,a.approximateFraction)(h.sy);s.width=(0,a.roundToDivide)(n.width*h.sx,u[0]),s.height=(0,a.roundToDivide)(n.height*h.sy,d[0]),s.style.width=(0,a.roundToDivide)(n.width,u[1])+"px",s.style.height=(0,a.roundToDivide)(n.height,d[1])+"px",this.paintedViewportMap.set(s,n);const f={canvasContext:c,transform:h.scaled?[h.sx,0,0,h.sy,0,0]:null,viewport:this.viewport,enableWebGL:this.enableWebGL,renderInteractiveForms:this.renderInteractiveForms},g=this.pdfPage.render(f);return g.onContinue=function(e){l(),r.onRenderContinue?r.onRenderContinue(e):e()},g.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 i.RenderingCancelledException(`Rendering cancelled, page ${this.id}`,"svg")},s=this.pdfPage,o=this.viewport.clone({scale:a.CSS_UNITS});return{promise:s.getOperatorList().then((t=>(r(),new i.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 a={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3};t.RenderingStates=a,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 a=e.views,i=a.length;if(0===i)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 a=r(16),i=r(2);class n extends a.BaseViewer{constructor(e){super(e),this.eventBus._on("pagesinit",(e=>{this._ensurePageViewVisible()}))}get _viewerElement(){return(0,i.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 a=this._currentPageNumber>=this._previousPageNumber;this._ensurePageViewVisible(),this.update(),super._scrollIntoView({pageDiv:e,pageSpot:t,pageNumber:r}),this._updateScrollDown=()=>{this.scroll.down=a,this._updateScrollDown=null}}_getVisiblePages(){return this._getCurrentVisiblePage()}_updateHelper(e){}get _isScrollModeHorizontal(){return(0,i.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 a=r(3),i=r(14),n=r(1),s=r(2),o=r(13),l=r(4),c=r(5);function h(e){const t=[];this.push=function(r){const a=t.indexOf(r);a>=0&&t.splice(a,1),t.push(r),t.length>e&&t.shift().destroy()},this.resize=function(r,i){if(e=r,i){const e=new Set;for(let t=0,r=i.length;te;)t.shift().destroy()}}class u{constructor(e){if(this.constructor===u)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:a.TextLayerMode.ENABLE,this.imageResourcesPath=e.imageResourcesPath||"",this.renderInteractiveForms=e.renderInteractiveForms||!1,this.enablePrintAutoRotate=e.enablePrintAutoRotate||!1,this.renderer=e.renderer||a.RendererType.CANVAS,this.enableWebGL=e.enableWebGL||!1,this.useOnlyCssZoom=e.useOnlyCssZoom||!1,this.maxCanvasPixels=e.maxCanvasPixels,this.l10n=e.l10n||a.NullL10n,this.defaultRenderingQueue=!e.renderingQueue,this.defaultRenderingQueue?(this.renderingQueue=new i.PDFRenderingQueue,this.renderingQueue.setViewer(this)):this.renderingQueue=e.renderingQueue,this.scroll=(0,a.watchScroll)(this.container,this._scrollUpdate.bind(this)),this.presentationModeState=a.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!==a.UNKNOWN_SCALE?this._currentScale:a.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,a.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 i=this.currentScale,n=r.getViewport({scale:i*a.CSS_UNITS}),s=this.textLayerMode!==a.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:i,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!==a.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 a=2;a<=t;++a)e.getPage(a).then((e=>{const t=this._pages[a-1];t.pdfPage||t.setPdfPage(e),this.linkService.cachePageRef(a,e.ref),0==--r&&this._pagesCapability.resolve()}),(e=>{console.error(`Unable to get page ${a} 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 i=this._pages[this._currentPageNumber-1];if(!i)return;const n=this.isInPresentationMode||this.removePageBorders;let s=n?0:a.SCROLLBAR_PADDING,o=n?0:a.VERTICAL_PADDING;!n&&this._isScrollModeHorizontal&&([s,o]=[o,s]);const l=(this.container.clientWidth-s)/i.width*i.scale,c=(this.container.clientHeight-o)/i.height*i.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,a.isPortraitOrientation)(i)?l:Math.min(c,l);r=Math.min(a.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:i=!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,h=0,u=0;const d=n.rotation%180!=0,f=(d?n.height:n.width)/n.scale/a.CSS_UNITS,g=(d?n.width:n.height)/n.scale/a.CSS_UNITS;let p=0;switch(t[1].name){case"XYZ":l=t[2],c=t[3],p=t[4],l=null!==l?l:0,c=null!==c?c:g;break;case"Fit":case"FitB":p="page-fit";break;case"FitH":case"FitBH":c=t[2],p="page-width",null===c&&this._location&&(l=this._location.left,c=this._location.top);break;case"FitV":case"FitBV":l=t[2],h=f,u=g,p="page-height";break;case"FitR":l=t[2],c=t[3],h=t[4]-l,u=t[5]-c;const e=this.removePageBorders?0:a.SCROLLBAR_PADDING,r=this.removePageBorders?0:a.VERTICAL_PADDING;s=(this.container.clientWidth-e)/h/a.CSS_UNITS,o=(this.container.clientHeight-r)/u/a.CSS_UNITS,p=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(i||(p&&p!==this._currentScale?this.currentScaleValue=p:this._currentScale===a.UNKNOWN_SCALE&&(this.currentScaleValue=a.DEFAULT_SCALE_VALUE)),"page-fit"===p&&!t[4])return void this._scrollIntoView({pageDiv:n.div,pageNumber:e});const m=[n.viewport.convertToViewportPoint(l,c),n.viewport.convertToViewportPoint(l+h,c+u)];let b=Math.min(m[0][0],m[1][0]),y=Math.min(m[0][1],m[1][1]);r||(b=Math.max(b,0),y=Math.max(y,0)),this._scrollIntoView({pageDiv:n.div,pageSpot:{left:b,top:y},pageNumber:e})}_updateLocation(e){const t=this._currentScale,r=this._currentScaleValue,a=parseFloat(r)===t?Math.round(1e4*t)/100:r,i=e.id;let n="#page="+i;n+="&zoom="+a;const s=this._pages[i-1],o=this.container,l=s.getPagePoint(o.scrollLeft-e.x,o.scrollTop-e.y),c=Math.round(l[0]),h=Math.round(l[1]);n+=","+c+","+h,this._location={pageNumber:i,scale:a,top:h,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 a=Math.max(10,2*r+1);this._buffer.resize(a,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===a.ScrollMode.HORIZONTAL}get isInPresentationMode(){return this.presentationModeState===a.PresentationModeState.FULLSCREEN}get isChangingPresentationMode(){return this.presentationModeState===a.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,a.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,a=this.renderingQueue.getHighestPriority(t,this._pages,r);return!!a&&(this._ensurePdfPageLoaded(a).then((()=>{this.renderingQueue.renderView(a)})),!0)}createTextLayerBuilder(e,t,r,a=!1,i){return new c.TextLayerBuilder({textLayerDiv:e,eventBus:i,pageIndex:t,viewport:r,findController:this.isInPresentationMode?null:this.findController,enhanceTextSelection:!this.isInPresentationMode&&a})}createAnnotationLayerBuilder(e,t,r="",i=!1,s=a.NullL10n){return new n.AnnotationLayerBuilder({pageDiv:e,pdfPage:t,imageResourcesPath:r,renderInteractiveForms:i,linkService:this.linkService,downloadManager:this.downloadManager,l10n:s})}get hasEqualPageSizes(){const e=this._pages[0];for(let t=1,r=this._pages.length;ti+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 a of e){if(a.percent<100)break;if(a.id===t){r=!0;break}}r||(t=e[0].id),this._setCurrentPageNumber(t)}}t.PDFViewer=n}])},e.exports=a()},3390:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>k});var a=r(826),i=r(9299),n=r(7963);const s={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 o=r(3379),l=r.n(o),c=r(1238),h={insert:"head",singleton:!1};l()(c.Z,h);c.Z.locals;var u=r(1900);const d=(0,u.Z)(s,undefined,undefined,!1,null,null,null).exports;r(9016);function f(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 a=(0,i.getDocument)(r).promise;return a.__PDFDocumentLoadingTask=!0,t&&t.onPassword&&(a.onPassword=t.onPassword),t&&t.onProgress&&(a.onProgress=t.onProgress),a}const g={createLoadingTask:f,components:{resizeSensor:d},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=f(t.internalSrc),t.$emit("loading",!0));var r=this.$refs.container,a=new n.EventBus;let i,s;t.pdfLinkService=new n.PDFLinkService({eventBus:a,externalLinkTarget:2}),t.pdfFindController=new n.PDFFindController({eventBus:a,linkService:t.pdfLinkService}),t.annotation&&(i=new n.DefaultAnnotationLayerFactory),t.text&&(s=new n.DefaultTextLayerFactory),t.internalSrc.then((function(e){return t.pdf=e,e.getPage(t.page)})).then((function(e){t.pdfViewer=new n.PDFPageView({container:r,id:t.page,scale:1,defaultViewport:e.getViewport({scale:1}),eventBus:a,textLayerFactory:s,annotationLayerFactory:i}),t.pdfViewer.setPdfPage(e);var o={scrollPageIntoView:function(e){t.$emit("link-clicked",e)}};t.pdfLinkService.setDocument(t.pdf),t.pdfLinkService.setViewer(o),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 p=r(7422),m={insert:"head",singleton:!1};l()(p.Z,m);p.Z.locals;const b=(0,u.Z)(g,(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,y={name:"PdfFile",components:{pdf:b},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=b.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(),a.U.$on("document-zoom:in",(function(){return e.zoomIn()})),a.U.$on("document-zoom:out",(function(){return e.zoomOut()}))}},v=y;var w=r(7544),A={insert:"head",singleton:!1};l()(w.Z,A);w.Z.locals;const k=(0,u.Z)(v,(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},172:()=>{},2001:()=>{},3779:()=>{},6558:()=>{},2216:()=>{}}]); \ No newline at end of file diff --git a/public/3390.js.LICENSE.txt b/public/3390.js.LICENSE.txt new file mode 100644 index 00000000..dc3d9f32 --- /dev/null +++ b/public/3390.js.LICENSE.txt @@ -0,0 +1,30 @@ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ + +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ + +/** + * @licstart The following is the entire license notice for the + * Javascript code in this page + * + * Copyright 2020 Mozilla Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @licend The above is the entire license notice for the + * Javascript code in this page + */ diff --git a/public/chunks/admin-account.js b/public/chunks/admin-account.js new file mode 100644 index 00000000..2042c4c6 --- /dev/null +++ b/public/chunks/admin-account.js @@ -0,0 +1,2 @@ +/*! For license information please see admin-account.js.LICENSE.txt */ +(self.webpackChunk=self.webpackChunk||[]).push([[5065],{6632:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(3645),i=r.n(n)()((function(e){return e[1]}));i.push([e.id,".sync-alt[data-v-0249f6ea]{-webkit-animation:spin-data-v-0249f6ea 1s linear infinite;animation:spin-data-v-0249f6ea 1s linear infinite}@-webkit-keyframes spin-data-v-0249f6ea{0%{transform:rotate(0)}to{transform:rotate(1turn)}}@keyframes spin-data-v-0249f6ea{0%{transform:rotate(0)}to{transform:rotate(1turn)}}",""]);const a=i},9397:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(3645),i=r.n(n)()((function(e){return e[1]}));i.push([e.id,".info-box[data-v-4d9e9780]{background:#f4f5f6;border-radius:10px;margin-bottom:32px;padding:20px;text-align:left}.info-box.error[data-v-4d9e9780]{background:rgba(253,57,122,.1)}.info-box.error a[data-v-4d9e9780],.info-box.error p[data-v-4d9e9780]{color:#fd397a}.info-box.error a[data-v-4d9e9780]{text-decoration:underline}.info-box p[data-v-4d9e9780]{font-weight:600;line-height:1.6;word-break:break-word}.info-box p[data-v-4d9e9780],.info-box p[data-v-4d9e9780] a{font-size:15px}.info-box p[data-v-4d9e9780] b{font-size:15px;font-weight:700}.info-box a[data-v-4d9e9780],.info-box b[data-v-4d9e9780]{font-weight:700}.info-box a[data-v-4d9e9780]{font-size:.9375em;line-height:1.6}.info-box ul[data-v-4d9e9780]{margin-top:15px}.info-box ul[data-v-4d9e9780],.info-box ul li[data-v-4d9e9780],.info-box ul li a[data-v-4d9e9780]{display:block}@media only screen and (max-width:690px){.info-box[data-v-4d9e9780]{padding:15px}}.dark .info-box[data-v-4d9e9780]{background:#1e2024}.dark .info-box.error[data-v-4d9e9780]{background:rgba(253,57,122,.1)}.dark .info-box.error a[data-v-4d9e9780],.dark .info-box.error p[data-v-4d9e9780]{color:#fd397a}.dark .info-box.error a[data-v-4d9e9780]{text-decoration:underline}.dark .info-box p[data-v-4d9e9780],.dark .info-box ul li[data-v-4d9e9780]{color:#bec6cf}",""]);const a=i},5121:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(3645),i=r.n(n)()((function(e){return e[1]}));i.push([e.id,".select[data-v-7fdf4688]{position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:100%}.select-search[data-v-7fdf4688]{background:#fff;padding:13px;position:-webkit-sticky;position:sticky;top:0}.select-search .search-input[data-v-7fdf4688]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#f4f5f6;border:1px solid transparent;font-size:.875em;font-weight:700;outline:0;padding:13px 20px;transition:all .15s ease;width:100%}.input-options[data-v-7fdf4688]{background:#fff;box-shadow:0 5px 15px rgba(0,0,0,.12);left:0;max-height:295px;overflow:hidden;overflow-y:auto;position:absolute;right:0;top:65px;z-index:9}.input-options .option-item[data-v-7fdf4688]{cursor:pointer;display:block;padding:13px 20px}.input-options .option-item[data-v-7fdf4688]:hover{background:#f4f5f6;color:#00bc7e}.input-options .option-item[data-v-7fdf4688]:last-child{border-bottom:none}.input-area[data-v-7fdf4688]{align-items:center;border:1px solid transparent;cursor:pointer;display:flex;justify-content:space-between;outline:0;padding:13px 20px;width:100%}.input-area[data-v-7fdf4688],.input-area .chevron[data-v-7fdf4688]{transition:all .15s ease}.input-area.is-active .chevron[data-v-7fdf4688]{transform:rotate(180deg)}.input-area.is-error[data-v-7fdf4688]{border-color:#fd397a;box-shadow:0 0 7px rgba(253,57,122,.3)}.option-icon[data-v-7fdf4688]{display:inline-block;font-size:.625em;width:20px}.option-value[data-v-7fdf4688]{font-size:.875em;font-weight:700;vertical-align:middle}.option-value.placehoder[data-v-7fdf4688]{color:rgba(27,37,57,.5)}.slide-in-enter-active[data-v-7fdf4688]{transition:all .15s ease}.slide-in-enter[data-v-7fdf4688]{opacity:0;transform:translateY(-50px)}.dark .select-search[data-v-7fdf4688]{background:#1e2024}.dark .select-search .search-input[data-v-7fdf4688]{background:#151515}.dark .popup-wrapper .input-area[data-v-7fdf4688]{background:#25272c}.dark .input-options[data-v-7fdf4688]{background:#1e2024}.dark .input-options .option-item[data-v-7fdf4688]{border-bottom:none}.dark .input-options .option-item[data-v-7fdf4688]:hover{background:#2a2c32}.dark .input-options .option-item:hover .option-icon circle[data-v-7fdf4688],.dark .input-options .option-item:hover .option-icon path[data-v-7fdf4688]{color:inherit}.dark .input-options .option-item[data-v-7fdf4688]:last-child{border-bottom:none}.dark .option-value.placehoder[data-v-7fdf4688]{color:#7d858c}",""]);const a=i},7395:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(3645),i=r.n(n)()((function(e){return e[1]}));i.push([e.id,".input-wrapper[data-v-615ed0c1]{display:flex;width:100%}.input-wrapper .input-label[data-v-615ed0c1]{color:#1b2539}.input-wrapper .switch-content[data-v-615ed0c1]{width:100%}.input-wrapper .switch-content[data-v-615ed0c1]:last-child{width:80px}.switch[data-v-615ed0c1]{background:#f1f1f5;height:28px;position:relative;width:50px}.switch[data-v-615ed0c1],.switch .switch-button[data-v-615ed0c1]{border-radius:50px;display:block;transition:all .3s ease}.switch .switch-button[data-v-615ed0c1]{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-615ed0c1]{left:25px}.dark .switch[data-v-615ed0c1]{background:#1e2024}.dark .popup-wrapper .switch[data-v-615ed0c1]{background:#25272c}",""]);const a=i},4479:(e,t,r)=>{"use strict";r.d(t,{C1:()=>a});function n(e){return null==e}function i(e){return Array.isArray(e)&&0===e.length}var a={validate:function(e,t){var r=(void 0===t?{allowFalse:!0}:t).allowFalse,a={valid:!1,required:!0};return n(e)||i(e)?a:!1!==e||r?(a.valid=!!String(e).trim().length,a):a},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 n=r(t),i={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"}},a={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},u={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},l=function(e,t){var r=(void 0===t?{}:t).locale,n=void 0===r?"":r;return Array.isArray(e)?e.every((function(e){return l(e,{locale:n})})):n?(a[n]||a.en).test(e):Object.keys(a).some((function(t){return a[t].test(e)}))},d={validate:l,params:[{name:"locale"}]},c=function(e,t){var r=(void 0===t?{}:t).locale,n=void 0===r?"":r;return Array.isArray(e)?e.every((function(e){return c(e,{locale:n})})):n?(u[n]||u.en).test(e):Object.keys(u).some((function(t){return u[t].test(e)}))},f={validate:c,params:[{name:"locale"}]},v=function(e,t){var r=(void 0===t?{}:t).locale,n=void 0===r?"":r;return Array.isArray(e)?e.every((function(e){return v(e,{locale:n})})):n?(o[n]||o.en).test(e):Object.keys(o).some((function(t){return o[t].test(e)}))},p={validate:v,params:[{name:"locale"}]},m=function(e,t){var r=(void 0===t?{}:t).locale,n=void 0===r?"":r;return Array.isArray(e)?e.every((function(e){return m(e,{locale:n})})):n?(s[n]||s.en).test(e):Object.keys(s).some((function(t){return s[t].test(e)}))},h={validate:m,params:[{name:"locale"}]},g=function(e,t){var r=void 0===t?{}:t,n=r.min,i=r.max;return Array.isArray(e)?e.every((function(e){return!!g(e,{min:n,max:i})})):Number(n)<=e&&Number(i)>=e},b={validate:g,params:[{name:"min"},{name:"max"}]},_={validate:function(e,t){var r=t.target;return String(e)===String(r)},params:[{name:"target",isTarget:!0}]},y=function(e,t){var r=t.length;if(Array.isArray(e))return e.every((function(e){return y(e,{length:r})}));var n=String(e);return/^[0-9]*$/.test(n)&&n.length===r},x={validate:y,params:[{name:"length",cast:function(e){return Number(e)}}]},A=function(e,t,r){var n=window.URL||window.webkitURL;return new Promise((function(i){var a=new Image;a.onerror=function(){return i(!1)},a.onload=function(){return i(a.width===t&&a.height===r)},a.src=n.createObjectURL(e)}))},w=function(e,t){var r=t.width,n=t.height,i=[];e=Array.isArray(e)?e:[e];for(var a=0;a()\[\]\\.,;:\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 n.test(String(e))})):n.test(String(e))},params:[{name:"multiple",default:!1}]};function Z(e){return e!=e}function O(e){return null==e}function C(e){return Array.isArray(e)&&0===e.length}var E=function(e){return null!==e&&e&&"object"==typeof e&&!Array.isArray(e)};function S(e,t){return!(!Z(e)||!Z(t))||e===t}function R(e){return""!==e&&!O(e)}function z(e){return"function"==typeof e}function j(e){return z(e)&&!!e.__locatorRef}function I(e,t){var r=Array.isArray(e)?e:P(e);if(z(r.findIndex))return r.findIndex(t);for(var n=0;n=0:Array.isArray(e)?e.every((function(e){return ie(e,{length:r})})):String(e).length<=r},ae={validate:ie,params:[{name:"length",cast:function(e){return Number(e)}}]},se=function(e,t){var r=t.max;return!O(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)}}]},ue=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)},le={validate:ue},de=function(e,t){var r=t.length;return!O(e)&&(Array.isArray(e)?e.every((function(e){return de(e,{length:r})})):String(e).length>=r)},ce={validate:de,params:[{name:"length",cast:function(e){return Number(e)}}]},fe=function(e,t){var r=t.min;return!O(e)&&""!==e&&(Array.isArray(e)?e.length>0&&e.every((function(e){return fe(e,{min:r})})):Number(e)>=r)},ve={validate:fe,params:[{name:"min",cast:function(e){return Number(e)}}]},pe=/^[٠١٢٣٤٥٦٧٨٩]+$/,me=/^[0-9]+$/,he={validate:function(e){var t=function(e){var t=String(e);return me.test(t)||pe.test(t)};return Array.isArray(e)?e.every(t):t(e)}},ge=function(e,t){var r=t.regex;return Array.isArray(e)?e.every((function(e){return ge(e,{regex:r})})):r.test(String(e))},be={validate:ge,params:[{name:"regex",cast:function(e){return"string"==typeof e?new RegExp(e):e}}]},_e={validate:function(e,t){var r=(void 0===t?{allowFalse:!0}:t).allowFalse,n={valid:!1,required:!0};return O(e)||C(e)?n:!1!==e||r?(n.valid=!!String(e).trim().length,n):n},params:[{name:"allowFalse",default:!0}],computesRequired:!0},ye=function(e){return C(e)||q([!1,null,void 0],e)||!String(e).trim().length},xe=function(e,t){var r,n=t.target,i=t.values;return i&&i.length?(Array.isArray(i)||"string"!=typeof i||(i=[i]),r=i.some((function(e){return e==String(n).trim()}))):r=!ye(n),r?{valid:!ye(e),required:r}:{valid:!0,required:r}},Ae={validate:xe,params:[{name:"target",isTarget:!0},{name:"values"}],computesRequired:!0},we=function(e,t){var r=t.size;if(isNaN(r))return!1;var n=1024*r;if(!Array.isArray(e))return e.size<=n;for(var i=0;in)return!1;return!0},$e={validate:we,params:[{name:"size",cast:function(e){return Number(e)}}]},ke=function(e,t){var r=t||{},n=r.decimals,i=void 0===n?0:n,a=r.separator,s=new RegExp("^-?\\d+"+("comma"===(void 0===a?"dot":a)?",?":"\\.?")+(0===i?"\\d*":"(\\d{"+i+"})?")+"$");return Array.isArray(e)?e.every((function(e){return s.test(String(e))})):s.test(String(e))},Ze={validate:ke,params:[{name:"decimals",default:0},{name:"separator",default:"dot"}]},Oe=Object.freeze({__proto__:null,alpha_dash:f,alpha_num:p,alpha_spaces:h,alpha:d,between:b,confirmed:_,digits:x,dimensions:$,email:k,ext:J,image:Y,oneOf:U,integer:Q,length:ne,is_not:te,is:ee,max:ae,max_value:oe,mimes:le,min:ce,min_value:ve,excluded:X,numeric:he,regex:be,required:_e,required_if:Ae,size:$e,double:Ze}),Ce=function(){return Ce=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]=0&&Me.getRuleDefinition("max")&&(n.max=r.maxlength),r.minlength>=0&&Me.getRuleDefinition("min")&&(n.min=r.minlength),"number"===r.type&&(R(r.min)&&Me.getRuleDefinition("min_value")&&(n.min_value=Number(r.min)),R(r.max)&&Me.getRuleDefinition("max_value")&&(n.max_value=Number(r.max))),n):n}function kt(e){var t,r=["input","select","textarea"],n=null===(t=e.data)||void 0===t?void 0:t.attrs;if(!q(r,e.tag)||!n)return{};var i={};return"required"in n&&!1!==n.required&&Me.getRuleDefinition("required")&&(i.required="checkbox"!==n.type||[!0]),ct(e)?Xe(Ce(Ce({},i),$t(e))):Xe(i)}function Zt(e,t){return e.$scopedSlots.default?e.$scopedSlots.default(t)||[]:e.$slots.default||[]}function Ot(e,t){return!(e._ignoreImmediate||!e.immediate)||!(S(e.value,t)||!e.normalizedEvents.length)||!!e._needsValidation||!e.initialized&&void 0===t}function Ct(e){return Ce(Ce({},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 l=je().useConstraintAttrs?kt(e):{};ut(t._resolvedRules,l)||(t._needsValidation=!0),At(e)&&(t.fieldName=(null===(s=null===(a=e.data)||void 0===a?void 0:a.attrs)||void 0===s?void 0:s.name)||(null===(u=null===(o=e.data)||void 0===o?void 0:o.attrs)||void 0===u?void 0:u.id)),t._resolvedRules=l,jt(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=dt(e);this.value=t,this.flags.changed=!ut(this.initialValue,t)},reset:function(){var e=this;this.errors=[],this.initialValue=this.value;var t=N();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,Rt(this)]}))}))},validateSilent:function(){return Ee(this,void 0,void 0,(function(){var e,t;return Se(this,(function(r){switch(r.label){case 0:return this.setFlags({pending:!0}),e=Ce(Ce({},this._resolvedRules),this.normalizedRules),Object.defineProperty(e,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),[4,Qe(this.value,e,Ce(Ce({name:this.name||this.fieldName},Tt(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,n=e.regenerateMap;this.errors=t,this._regenerateMap=n,this.failedRules=Ce({},r||{}),this.setFlags({valid:!t.length,passed:!t.length,invalid:!!t.length,failed:!!t.length,validated:!0,changed:!ut(this.value,this.initialValue)})},registerField:function(){Dt(this)},checkComputesRequiredState:function(){var e=Ce(Ce({},this._resolvedRules),this.normalizedRules);return Object.keys(e).some(Me.isRequireRule)}}});function Pt(e,t){for(var r={},n=Object.keys(t),i=n.length,a=function(i){var a=n[i],s=e&&e[a]||a,o=t[a];return O(o)?"continue":"valid"!==a&&"invalid"!==a||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:()=>i});const n={name:"AppInputText",props:["description","isLast","title","error"]};const i=(0,r(1900).Z)(n,(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 dark:text-gray-500 text-gray-500",domProps:{innerHTML:e._s(e.description)}}):e._e()],2)}),[],!1,null,null,null).exports},2276:(e,t,r)=>{"use strict";r.d(t,{Z:()=>l});var n=r(9101);const i={name:"AuthContent",props:["loading","icon","text"],components:{ChevronRightIcon:n.XCv,RefreshCwIcon:n.Iyk},data:function(){return{isVisible:!1}},created:function(){this.isVisible=this.visible}};var a=r(3379),s=r.n(a),o=r(6632),u={insert:"head",singleton:!1};s()(o.Z,u);o.Z.locals;const l=(0,r(1900).Z)(i,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("button",{staticClass:"group mx-auto inline-block flex items-center whitespace-nowrap rounded-lg border-2 border-black px-7 py-2.5 dark:border-gray-300"},[r("span",{staticClass:"pr-1 text-lg font-extrabold"},[e._v("\n "+e._s(e.text)+"\n ")]),e._v(" "),e.loading?r("refresh-cw-icon",{staticClass:"vue-feather text-theme sync-alt -mr-1",attrs:{size:"20"}}):e._e(),e._v(" "),!e.loading&&e.icon?r("chevron-right-icon",{staticClass:"vue-feather text-theme -mr-1",attrs:{size:"20"}}):e._e()],1)}),[],!1,null,"0249f6ea",null).exports},4006:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});const n={name:"AuthContent",props:["visible","name"],data:function(){return{isVisible:!1}},created:function(){this.isVisible=this.visible}};const i=(0,r(1900).Z)(n,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return e.isVisible?r("div",{staticClass:"w-full max-w-xl text-center"},[e._t("default")],2):e._e()}),[],!1,null,null,null).exports},868:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});const n={name:"AuthContentWrapper"};const i=(0,r(1900).Z)(n,(function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{staticClass:"flex items-center justify-center px-2.5 md:px-6"},[e._t("default")],2)}),[],!1,null,null,null).exports},808:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(9101);const i={name:"FormLabel",props:["icon"],components:{ListIcon:n.DE2,MailIcon:n.bV6,InfoIcon:n.szr,DatabaseIcon:n.VHe,UsersIcon:n.oyc,CreditCardIcon:n.ciH,DollarSignIcon:n.bkH,SmartphoneIcon:n.BEV,HardDriveIcon:n.zvn,BarChartIcon:n.eJP,SettingsIcon:n.ewm,FileTextIcon:n.zPP,ShieldIcon:n.b7C,FrownIcon:n.eFi,Edit2Icon:n.me4,BellIcon:n.Dkj,KeyIcon:n._m8}};const a=(0,r(1900).Z)(i,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"mb-8 flex items-center"},[e.icon?e._e():r("edit-2-icon",{staticClass:"vue-feather text-theme dark-text-theme mr-3",attrs:{size:"22"}}),e._v(" "),"frown"===e.icon?r("frown-icon",{staticClass:"vue-feather text-theme dark-text-theme mr-3",attrs:{size:"22"}}):e._e(),e._v(" "),"list"===e.icon?r("list-icon",{staticClass:"vue-feather text-theme dark-text-theme mr-3",attrs:{size:"22"}}):e._e(),e._v(" "),"info"===e.icon?r("info-icon",{staticClass:"vue-feather text-theme dark-text-theme mr-3",attrs:{size:"22"}}):e._e(),e._v(" "),"database"===e.icon?r("database-icon",{staticClass:"vue-feather text-theme dark-text-theme mr-3",attrs:{size:"22"}}):e._e(),e._v(" "),"file-text"===e.icon?r("file-text-icon",{staticClass:"vue-feather text-theme dark-text-theme mr-3",attrs:{size:"22"}}):e._e(),e._v(" "),"dollar"===e.icon?r("dollar-sign-icon",{staticClass:"vue-feather text-theme dark-text-theme mr-3",attrs:{size:"22"}}):e._e(),e._v(" "),"credit-card"===e.icon?r("credit-card-icon",{staticClass:"vue-feather text-theme dark-text-theme mr-3",attrs:{size:"22"}}):e._e(),e._v(" "),"bar-chart"===e.icon?r("bar-chart-icon",{staticClass:"vue-feather text-theme dark-text-theme mr-3",attrs:{size:"22"}}):e._e(),e._v(" "),"settings"===e.icon?r("settings-icon",{staticClass:"vue-feather text-theme dark-text-theme mr-3",attrs:{size:"22"}}):e._e(),e._v(" "),"hard-drive"===e.icon?r("hard-drive-icon",{staticClass:"vue-feather text-theme dark-text-theme mr-3",attrs:{size:"22"}}):e._e(),e._v(" "),"mail"===e.icon?r("mail-icon",{staticClass:"vue-feather text-theme dark-text-theme mr-3",attrs:{size:"22"}}):e._e(),e._v(" "),"smartphone"===e.icon?r("smartphone-icon",{staticClass:"vue-feather text-theme dark-text-theme mr-3",attrs:{size:"22"}}):e._e(),e._v(" "),"shield"===e.icon?r("shield-icon",{staticClass:"vue-feather text-theme dark-text-theme mr-3",attrs:{size:"22"}}):e._e(),e._v(" "),"bell"===e.icon?r("bell-icon",{staticClass:"vue-feather text-theme dark-text-theme mr-3",attrs:{size:"22"}}):e._e(),e._v(" "),"key"===e.icon?r("key-icon",{staticClass:"vue-feather text-theme dark-text-theme mr-3",attrs:{size:"22"}}):e._e(),e._v(" "),"users"===e.icon?r("users-icon",{staticClass:"vue-feather text-theme dark-text-theme mr-3",attrs:{size:"22"}}):e._e(),e._v(" "),r("b",{staticClass:"text-md font-bold dark:text-gray-200 sm:text-lg"},[e._t("default")],2)],1)}),[],!1,null,null,null).exports},5939:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(9101);const i={name:"ImageInput",props:["image","error"],components:{ImageIcon:n.XBm,XIcon:n.b0D},data:function(){return{imagePreview:void 0}},computed:{isData:function(){return!(void 0===this.imagePreview||""===this.imagePreview)}},methods:{resetImage:function(){this.imagePreview=void 0,this.$emit("input",void 0)},showImagePreview:function(e){var t=this,r=e.target.files[0].name,n=r.substring(r.lastIndexOf(".")+1).toLowerCase();if(["png","jpg","jpeg","svg"].includes(n)){var i=e.target.files[0],a=new FileReader;a.onload=function(){return t.imagePreview=a.result},a.readAsDataURL(i),this.$emit("input",e.target.files[0])}else alert(this.$t("validation_errors.wrong_image"))}},created:function(){this.image&&(this.imagePreview=this.image)}};const a=(0,r(1900).Z)(i,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"relative flex h-[175px] items-center justify-center rounded-lg bg-light-background dark:bg-2x-dark-foreground",class:{"is-error":e.error}},[e.imagePreview?r("div",{staticClass:"absolute right-0 top-0 z-[9] flex h-7 w-7 -translate-y-3 translate-x-3 cursor-pointer items-center justify-center rounded-md rounded-full dark:bg-4x-dark-foreground bg-white shadow-lg",on:{click:e.resetImage}},[r("x-icon",{staticClass:"vue-feather dark:text-gray-500",attrs:{size:"14"}})],1):e._e(),e._v(" "),r("input",{ref:"file",staticClass:"absolute top-0 left-0 right-0 bottom-0 z-10 w-full cursor-pointer opacity-0",attrs:{type:"file"},on:{change:function(t){return e.showImagePreview(t)}}}),e._v(" "),e.imagePreview?r("img",{ref:"image",staticClass:"absolute h-full w-full object-contain py-4 px-12",attrs:{src:e.imagePreview}}):e._e(),e._v(" "),e.isData?e._e():r("div",{staticClass:"text-center"},[r("image-icon",{staticClass:"vue-feather text-theme mb-4 inline-block",attrs:{size:"34"}}),e._v(" "),r("b",{staticClass:"block text-base font-bold leading-3"},[e._v("\n "+e._s(e.$te("input_image.title")?e.$t("input_image.title"):"Upload Image")+"\n ")]),e._v(" "),r("small",{staticClass:"text-xs text-gray-500"},[e._v("\n "+e._s(e.$te("input_image.supported")?e.$t("input_image.supported"):"Supported formats are .png, .jpg, .jpeg.")+"\n ")])],1)])}),[],!1,null,null,null).exports},6291:(e,t,r)=>{"use strict";r.d(t,{Z:()=>u});const n={name:"InfoBox",props:["type"]};var i=r(3379),a=r.n(i),s=r(9397),o={insert:"head",singleton:!1};a()(s.Z,o);s.Z.locals;const u=(0,r(1900).Z)(n,(function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{staticClass:"info-box",class:e.type},[e._t("default")],2)}),[],!1,null,"4d9e9780",null).exports},9198:(e,t,r)=>{"use strict";r.d(t,{Z:()=>d});var n=r(9101),i=r(6486);const a={name:"SelectInput",props:["placeholder","options","isError","default"],components:{Edit2Icon:n.me4,UserIcon:n.tBG,ChevronDownIcon:n.v4q},watch:{query:(0,i.debounce)((function(e){this.searchedResults=(0,i.omitBy)(this.options,(function(t){return!t.label.toLowerCase().includes(e.toLowerCase())}))}),200)},computed:{isSearching:function(){return this.searchedResults&&""!==this.query},optionList:function(){return this.isSearching?this.searchedResults:this.options}},data:function(){return{searchedResults:void 0,selected:void 0,isOpen:!1,query:""}},methods:{selectOption:function(e){this.$emit("input",e.value),this.$emit("change",e.value),this.selected=e,this.isOpen=!1},openMenu:function(){var e=this;this.isOpen=!this.isOpen,this.$refs.search&&this.isOpen&&this.$nextTick((function(){return e.$refs.search.focus()}))}},created:function(){var e=this;this.default&&(this.selected=this.options.find((function(t){return t.value===e.default})))}};var s=r(3379),o=r.n(s),u=r(5121),l={insert:"head",singleton:!1};o()(u.Z,l);u.Z.locals;const d=(0,r(1900).Z)(a,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"select"},[r("div",{staticClass:"input-area rounded-lg bg-light-background dark:bg-2x-dark-foreground",class:{"is-active":e.isOpen,"is-error":e.isError},on:{click:e.openMenu}},[e.selected?r("div",{staticClass:"selected flex w-full items-center"},[e.selected.icon?r("div",{staticClass:"option-icon"},["user"===e.selected.icon?r("user-icon",{staticClass:"vue-feather text-theme",attrs:{size:"14"}}):e._e(),e._v(" "),"user-edit"===e.selected.icon?r("edit2-icon",{staticClass:"vue-feather text-theme",attrs:{size:"14"}}):e._e()],1):e._e(),e._v(" "),r("span",{staticClass:"option-value inline-block w-full overflow-hidden text-ellipsis whitespace-nowrap pl-2"},[e._v("\n "+e._s(e.selected.label)+"\n ")])]):e._e(),e._v(" "),e.selected?e._e():r("div",{staticClass:"not-selected"},[r("span",{staticClass:"option-value placehoder"},[e._v(e._s(e.placeholder))])]),e._v(" "),r("chevron-down-icon",{staticClass:"chevron",attrs:{size:"19"}})],1),e._v(" "),r("transition",{attrs:{name:"slide-in"}},[e.isOpen?r("div",{staticClass:"input-options rounded-lg"},[e.options.length>5?r("div",{staticClass:"select-search"},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.query,expression:"query"}],ref:"search",staticClass:"search-input focus-border-theme rounded-lg",attrs:{type:"text",placeholder:e.$t("select_search_placeholder")},domProps:{value:e.query},on:{input:function(t){t.target.composing||(e.query=t.target.value)}}})]):e._e(),e._v(" "),r("ul",{staticClass:"option-list"},e._l(e.optionList,(function(t,n){return r("li",{key:n,staticClass:"option-item",on:{click:function(r){return e.selectOption(t)}}},[t.icon?r("div",{staticClass:"option-icon"},["user"===t.icon?r("user-icon",{attrs:{size:"14"}}):e._e(),e._v(" "),"user-edit"===t.icon?r("edit2-icon",{attrs:{size:"14"}}):e._e()],1):e._e(),e._v(" "),r("span",{staticClass:"option-value"},[e._v(e._s(t.label))])])})),0)]):e._e()])],1)}),[],!1,null,"7fdf4688",null).exports},667:(e,t,r)=>{"use strict";r.d(t,{Z:()=>u});const n={name:"SwitchInput",props:["label","name","state","info","input","isDisabled"],data:function(){return{isSwitched:void 0}},methods:{changeState:function(){this.isDisabled||(this.isSwitched=!this.isSwitched,this.$emit("input",this.isSwitched))}},mounted:function(){this.isSwitched=this.state}};var i=r(3379),a=r.n(i),s=r(7395),o={insert:"head",singleton:!1};a()(s.Z,o);s.Z.locals;const u=(0,r(1900).Z)(n,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("div",{staticClass:"switch-content"},[e.label?r("label",{staticClass:"input-label"},[e._v(" "+e._s(e.label)+": ")]):e._e(),e._v(" "),e.info?r("small",{staticClass:"input-info"},[e._v("\n "+e._s(e.info)+"\n ")]):e._e()]),e._v(" "),r("div",{staticClass:"switch-content text-right"},[r("div",{staticClass:"switch",class:{active:e.state},on:{click:e.changeState}},[r("div",{staticClass:"switch-button"})])])])}),[],!1,null,"615ed0c1",null).exports},5434:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const a={name:"Headline",props:["description","title"],computed:function(e){for(var t=1;t{"use strict";r.r(t),r.d(t,{default:()=>w});var n=r(7757),i=r.n(n),a=r(4198),s=r(9495),o=r(868),u=r(9198),l=r(667),d=r(5939),c=r(808),f=r(6291),v=r(4006),p=r(2276),m=r(4479),h=r(9101),g=r(5434),b=r(826),_=r(9669),y=r.n(_);function x(e,t,r,n,i,a,s){try{var o=e[a](s),u=o.value}catch(e){return void r(e)}o.done?t(u):Promise.resolve(u).then(n,i)}const A={name:"EnvironmentSetup",components:{AuthContentWrapper:o.Z,ValidationProvider:s.ValidationProvider,ValidationObserver:s.ValidationObserver,AppInputText:a.Z,SettingsIcon:h.ewm,SelectInput:u.Z,SwitchInput:l.Z,AuthContent:v.Z,ImageInput:d.Z,AuthButton:p.Z,FormLabel:c.Z,required:m.C1,Headline:g.Z,InfoBox:f.Z},data:function(){return{isLoading:!1,admin:{name:"",email:"",avatar:void 0,password:"",password_confirmation:""}}},methods:{adminAccountSubmit:function(){var e,t=this;return(e=i().mark((function e(){var r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.$refs.adminAccount.validate();case 2:if(e.sent){e.next=5;break}return e.abrupt("return");case 5:t.isLoading=!0,(r=new FormData).append("name",t.admin.name),r.append("email",t.admin.email),r.append("password",t.admin.password),r.append("password_confirmation",t.admin.password_confirmation),r.append("license",localStorage.getItem("license")),r.append("purchase_code",localStorage.getItem("purchase_code")),t.admin.avatar&&r.append("avatar",t.admin.avatar),y().post("/admin-setup",r,{headers:{"Content-Type":"multipart/form-data"}}).then((function(e){window.location="/sign-in"})).catch((function(e){500===e.response.status&&b.U.$emit("alert:open",{emoji:"🤔",title:t.$t("popup_signup_error.title"),message:t.$t("popup_signup_error.message")}),422===e.response.status&&(e.response.data.errors.email&&t.$refs.adminAccount.setErrors({Email:e.response.data.errors.email}),e.response.data.errors.password&&t.$refs.adminAccount.setErrors({Password:e.response.data.errors.password}))})).finally((function(){return t.isLoading=!1}));case 15:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,i){var a=e.apply(t,r);function s(e){x(a,n,i,s,o,"next",e)}function o(e){x(a,n,i,s,o,"throw",e)}s(void 0)}))})()}},created:function(){this.$scrollTop(),this.$root.$data.config.isSetupWizardDebug&&(this.admin={name:"Jane Doe",email:"howdy@hi5ve.digital",avatar:void 0,password:"vuefilemanager",password_confirmation:"vuefilemanager"})}};const w=(0,r(1900).Z)(A,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("AuthContentWrapper",{ref:"auth"},[r("AuthContent",{staticClass:"mt-6 mb-12 !max-w-2xl",attrs:{name:"database-credentials",visible:!0}},[r("Headline",{staticClass:"mx-auto !mb-10 max-w-screen-sm",attrs:{title:"Setup Wizard",description:"Create your admin account."}},[r("settings-icon",{staticClass:"vue-feather text-theme mx-auto mb-3 animate-[spin_5s_linear_infinite]",attrs:{size:"40"}})],1),e._v(" "),r("ValidationObserver",{ref:"adminAccount",staticClass:"card text-left shadow-card",attrs:{tag:"form"},on:{submit:function(t){return t.preventDefault(),e.adminAccountSubmit.apply(null,arguments)}},scopedSlots:e._u([{key:"default",fn:function(t){t.invalid;return[r("FormLabel",[e._v(" Create Admin Account ")]),e._v(" "),r("ValidationProvider",{attrs:{tag:"div",mode:"passive",name:"Avatar"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.errors;return[r("AppInputText",{attrs:{title:"Avatar (optional)",error:n[0]}},[r("ImageInput",{attrs:{error:n[0]},model:{value:e.admin.avatar,callback:function(t){e.$set(e.admin,"avatar",t)},expression:"admin.avatar"}})],1)]}}],null,!0)}),e._v(" "),r("ValidationProvider",{attrs:{tag:"div",mode:"passive",name:"Full Name",rules:"required"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.errors;return[r("AppInputText",{attrs:{title:"Full Name",error:n[0]}},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.admin.name,expression:"admin.name"}],staticClass:"focus-border-theme input-dark",class:{"border-red":n[0]},attrs:{placeholder:"Type your full name",type:"text"},domProps:{value:e.admin.name},on:{input:function(t){t.target.composing||e.$set(e.admin,"name",t.target.value)}}})])]}}],null,!0)}),e._v(" "),r("ValidationProvider",{attrs:{tag:"div",mode:"passive",name:"Email",rules:"required"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.errors;return[r("AppInputText",{attrs:{title:"Email",error:n[0]}},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.admin.email,expression:"admin.email"}],staticClass:"focus-border-theme input-dark",class:{"border-red":n[0]},attrs:{placeholder:"Type your email",type:"email"},domProps:{value:e.admin.email},on:{input:function(t){t.target.composing||e.$set(e.admin,"email",t.target.value)}}})])]}}],null,!0)}),e._v(" "),r("ValidationProvider",{attrs:{tag:"div",mode:"passive",name:"Password",rules:"required|confirmed:confirmation"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.errors;return[r("AppInputText",{attrs:{title:"Password",error:n[0]}},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.admin.password,expression:"admin.password"}],staticClass:"focus-border-theme input-dark",class:{"border-red":n[0]},attrs:{placeholder:"Type your password",type:"password"},domProps:{value:e.admin.password},on:{input:function(t){t.target.composing||e.$set(e.admin,"password",t.target.value)}}})])]}}],null,!0)}),e._v(" "),r("ValidationProvider",{attrs:{tag:"div",name:"confirmation",rules:"required",vid:"confirmation"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.errors;return[r("AppInputText",{attrs:{title:"Password Confirmation",error:n[0],"is-last":!0}},[r("input",{directives:[{name:"model",rawName:"v-model",value:e.admin.password_confirmation,expression:"admin.password_confirmation"}],staticClass:"focus-border-theme input-dark",class:{"border-red":n[0]},attrs:{placeholder:"Confirm your password",type:"password"},domProps:{value:e.admin.password_confirmation},on:{input:function(t){t.target.composing||e.$set(e.admin,"password_confirmation",t.target.value)}}})])]}}],null,!0)})]}}])}),e._v(" "),r("AuthButton",{staticClass:"w-full justify-center",attrs:{icon:"chevron-right",text:"Create Admin and Login",loading:e.isLoading,disabled:e.isLoading},nativeOn:{click:function(t){return e.adminAccountSubmit.apply(null,arguments)}}})],1)],1)}),[],!1,null,null,null).exports}}]); \ No newline at end of file diff --git a/public/chunks/admin-account.js.LICENSE.txt b/public/chunks/admin-account.js.LICENSE.txt new file mode 100644 index 00000000..e369ffd8 --- /dev/null +++ b/public/chunks/admin-account.js.LICENSE.txt @@ -0,0 +1,5 @@ +/** + * vee-validate v3.4.14 + * (c) 2021 Abdelrahman Awad + * @license MIT + */ diff --git a/public/chunks/admin.js b/public/chunks/admin.js new file mode 100644 index 00000000..eb7d6773 --- /dev/null +++ b/public/chunks/admin.js @@ -0,0 +1,2 @@ +/*! For license information please see admin.js.LICENSE.txt */ +(self.webpackChunk=self.webpackChunk||[]).push([[7399],{4734:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var a=i(3645),r=i.n(a)()((function(e){return e[1]}));r.push([e.id,".emoji{font-size:inherit;height:1em;width:1em}",""]);const n=r},9660:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var a=i(3645),r=i.n(a)()((function(e){return e[1]}));r.push([e.id,".popover-wrapper[data-v-5d0dc97d]{position:relative}",""]);const n=r},6799:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var a=i(3645),r=i.n(a)()((function(e){return e[1]}));r.push([e.id,".alphabet-icon g,.alphabet-icon line,.alphabet-icon polyline{color:inherit}",""]);const n=r},3485:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var a=i(3645),r=i.n(a)()((function(e){return e[1]}));r.push([e.id,".preview-list-icon line,.preview-list-icon path{color:inherit}",""]);const n=r},3822:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var a=i(3645),r=i.n(a)()((function(e){return e[1]}));r.push([e.id,".preview-list-icon line,.preview-list-icon rect{color:inherit}",""]);const n=r},7691:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var a=i(3645),r=i.n(a)()((function(e){return e[1]}));r.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=r},6713:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var a=i(3645),r=i.n(a)()((function(e){return e[1]}));r.push([e.id,".menu-options[data-v-8c83820c]{list-style:none;margin-top:10px;width:100%}",""]);const n=r},9397:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var a=i(3645),r=i.n(a)()((function(e){return e[1]}));r.push([e.id,".info-box[data-v-4d9e9780]{background:#f4f5f6;border-radius:10px;margin-bottom:32px;padding:20px;text-align:left}.info-box.error[data-v-4d9e9780]{background:rgba(253,57,122,.1)}.info-box.error a[data-v-4d9e9780],.info-box.error p[data-v-4d9e9780]{color:#fd397a}.info-box.error a[data-v-4d9e9780]{text-decoration:underline}.info-box p[data-v-4d9e9780]{font-weight:600;line-height:1.6;word-break:break-word}.info-box p[data-v-4d9e9780],.info-box p[data-v-4d9e9780] a{font-size:15px}.info-box p[data-v-4d9e9780] b{font-size:15px;font-weight:700}.info-box a[data-v-4d9e9780],.info-box b[data-v-4d9e9780]{font-weight:700}.info-box a[data-v-4d9e9780]{font-size:.9375em;line-height:1.6}.info-box ul[data-v-4d9e9780]{margin-top:15px}.info-box ul[data-v-4d9e9780],.info-box ul li[data-v-4d9e9780],.info-box ul li a[data-v-4d9e9780]{display:block}@media only screen and (max-width:690px){.info-box[data-v-4d9e9780]{padding:15px}}.dark .info-box[data-v-4d9e9780]{background:#1e2024}.dark .info-box.error[data-v-4d9e9780]{background:rgba(253,57,122,.1)}.dark .info-box.error a[data-v-4d9e9780],.dark .info-box.error p[data-v-4d9e9780]{color:#fd397a}.dark .info-box.error a[data-v-4d9e9780]{text-decoration:underline}.dark .info-box p[data-v-4d9e9780],.dark .info-box ul li[data-v-4d9e9780]{color:#bec6cf}",""]);const n=r},5121:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var a=i(3645),r=i.n(a)()((function(e){return e[1]}));r.push([e.id,".select[data-v-7fdf4688]{position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:100%}.select-search[data-v-7fdf4688]{background:#fff;padding:13px;position:-webkit-sticky;position:sticky;top:0}.select-search .search-input[data-v-7fdf4688]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#f4f5f6;border:1px solid transparent;font-size:.875em;font-weight:700;outline:0;padding:13px 20px;transition:all .15s ease;width:100%}.input-options[data-v-7fdf4688]{background:#fff;box-shadow:0 5px 15px rgba(0,0,0,.12);left:0;max-height:295px;overflow:hidden;overflow-y:auto;position:absolute;right:0;top:65px;z-index:9}.input-options .option-item[data-v-7fdf4688]{cursor:pointer;display:block;padding:13px 20px}.input-options .option-item[data-v-7fdf4688]:hover{background:#f4f5f6;color:#00bc7e}.input-options .option-item[data-v-7fdf4688]:last-child{border-bottom:none}.input-area[data-v-7fdf4688]{align-items:center;border:1px solid transparent;cursor:pointer;display:flex;justify-content:space-between;outline:0;padding:13px 20px;width:100%}.input-area[data-v-7fdf4688],.input-area .chevron[data-v-7fdf4688]{transition:all .15s ease}.input-area.is-active .chevron[data-v-7fdf4688]{transform:rotate(180deg)}.input-area.is-error[data-v-7fdf4688]{border-color:#fd397a;box-shadow:0 0 7px rgba(253,57,122,.3)}.option-icon[data-v-7fdf4688]{display:inline-block;font-size:.625em;width:20px}.option-value[data-v-7fdf4688]{font-size:.875em;font-weight:700;vertical-align:middle}.option-value.placehoder[data-v-7fdf4688]{color:rgba(27,37,57,.5)}.slide-in-enter-active[data-v-7fdf4688]{transition:all .15s ease}.slide-in-enter[data-v-7fdf4688]{opacity:0;transform:translateY(-50px)}.dark .select-search[data-v-7fdf4688]{background:#1e2024}.dark .select-search .search-input[data-v-7fdf4688]{background:#151515}.dark .popup-wrapper .input-area[data-v-7fdf4688]{background:#25272c}.dark .input-options[data-v-7fdf4688]{background:#1e2024}.dark .input-options .option-item[data-v-7fdf4688]{border-bottom:none}.dark .input-options .option-item[data-v-7fdf4688]:hover{background:#2a2c32}.dark .input-options .option-item:hover .option-icon circle[data-v-7fdf4688],.dark .input-options .option-item:hover .option-icon path[data-v-7fdf4688]{color:inherit}.dark .input-options .option-item[data-v-7fdf4688]:last-child{border-bottom:none}.dark .option-value.placehoder[data-v-7fdf4688]{color:#7d858c}",""]);const n=r},7395:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var a=i(3645),r=i.n(a)()((function(e){return e[1]}));r.push([e.id,".input-wrapper[data-v-615ed0c1]{display:flex;width:100%}.input-wrapper .input-label[data-v-615ed0c1]{color:#1b2539}.input-wrapper .switch-content[data-v-615ed0c1]{width:100%}.input-wrapper .switch-content[data-v-615ed0c1]:last-child{width:80px}.switch[data-v-615ed0c1]{background:#f1f1f5;height:28px;position:relative;width:50px}.switch[data-v-615ed0c1],.switch .switch-button[data-v-615ed0c1]{border-radius:50px;display:block;transition:all .3s ease}.switch .switch-button[data-v-615ed0c1]{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-615ed0c1]{left:25px}.dark .switch[data-v-615ed0c1]{background:#1e2024}.dark .popup-wrapper .switch[data-v-615ed0c1]{background:#25272c}",""]);const n=r},6978:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var a=i(3645),r=i.n(a)()((function(e){return e[1]}));r.push([e.id,".popup-leave-active[data-v-5a17a1de]{animation:popup-slide-in-data-v-5a17a1de .15s ease reverse}@media only screen and (min-width:960px){.popup-enter-active[data-v-5a17a1de]{-webkit-animation:popup-slide-in-data-v-5a17a1de .25s ease .1s both;animation:popup-slide-in-data-v-5a17a1de .25s ease .1s both}@-webkit-keyframes popup-slide-in-data-v-5a17a1de{0%{opacity:0;transform:translateY(100px)}to{opacity:1;transform:translateY(0)}}@keyframes popup-slide-in-data-v-5a17a1de{0%{opacity:0;transform:translateY(100px)}to{opacity:1;transform:translateY(0)}}}@media only screen and (max-width:960px){.popup-enter-active[data-v-5a17a1de]{-webkit-animation:popup-slide-in-data-v-5a17a1de .35s ease .15s both;animation:popup-slide-in-data-v-5a17a1de .35s ease .15s both}@-webkit-keyframes popup-slide-in-data-v-5a17a1de{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes popup-slide-in-data-v-5a17a1de{0%{transform:translateY(100%)}to{transform:translateY(0)}}}",""]);const n=r},2465:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var a=i(3645),r=i.n(a)()((function(e){return e[1]}));r.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=r},6671:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var a=i(3645),r=i.n(a)()((function(e){return e[1]}));r.push([e.id,".router-link-active.home .button-icon circle[data-v-62a4bc2a],.router-link-active.home .button-icon line[data-v-62a4bc2a],.router-link-active.home .button-icon path[data-v-62a4bc2a],.router-link-active.home .button-icon polyline[data-v-62a4bc2a],.router-link-active.home .button-icon rect[data-v-62a4bc2a]{color:inherit}.router-link-active.trash .button-icon[data-v-62a4bc2a]{background:rgba(254,96,87,.1)}.router-link-active.trash .button-icon circle[data-v-62a4bc2a],.router-link-active.trash .button-icon line[data-v-62a4bc2a],.router-link-active.trash .button-icon path[data-v-62a4bc2a],.router-link-active.trash .button-icon polyline[data-v-62a4bc2a],.router-link-active.trash .button-icon rect[data-v-62a4bc2a]{stroke:#fe6057}.router-link-active.settings .button-icon[data-v-62a4bc2a]{background:rgba(157,102,254,.1)}.router-link-active.settings .button-icon circle[data-v-62a4bc2a],.router-link-active.settings .button-icon line[data-v-62a4bc2a],.router-link-active.settings .button-icon path[data-v-62a4bc2a],.router-link-active.settings .button-icon polyline[data-v-62a4bc2a],.router-link-active.settings .button-icon rect[data-v-62a4bc2a]{stroke:#9d66fe}.router-link-active.user .button-icon[data-v-62a4bc2a]{background:rgba(254,102,161,.1)}.router-link-active.user .button-icon circle[data-v-62a4bc2a],.router-link-active.user .button-icon line[data-v-62a4bc2a],.router-link-active.user .button-icon path[data-v-62a4bc2a],.router-link-active.user .button-icon polyline[data-v-62a4bc2a],.router-link-active.user .button-icon rect[data-v-62a4bc2a]{stroke:#fe66a1}",""]);const n=r},5981:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var a=i(3645),r=i.n(a)()((function(e){return e[1]}));r.push([e.id,".form-wrapper[data-v-53f929a0]{padding:0 20px}.input-wrapper[data-v-53f929a0]{margin-bottom:20px}.input-wrapper[data-v-53f929a0]:last-child{margin-bottom:0}.input-wrapper input[data-v-53f929a0]{color:#1b2539;width:100%}.input-wrapper input.is-error[data-v-53f929a0]{border-color:#fd397a}.inline-wrapper[data-v-53f929a0]{align-items:center;display:flex;justify-content:space-between}.inline-wrapper.icon-append .input-text[data-v-53f929a0]{border-bottom-right-radius:0;border-top-right-radius:0}.inline-wrapper.icon-append .icon[data-v-53f929a0]{background:#000;border-bottom-right-radius:8px;border-top-right-radius:8px;line-height:0;padding:15px 18px;text-align:center}.inline-wrapper.icon-append .icon path[data-v-53f929a0],.inline-wrapper.icon-append .icon polyline[data-v-53f929a0]{stroke:#fff}.input-label[data-v-53f929a0]{color:#1b2539;display:block;font-size:.875em;font-weight:700;margin-bottom:8px}.dark .inline-wrapper.icon-append .icon[data-v-53f929a0]{background:rgba(0,188,126,.1)}.dark .inline-wrapper.icon-append .icon path[data-v-53f929a0],.dark .inline-wrapper.icon-append .icon polyline[data-v-53f929a0]{stroke:#00bc7e}.dark .input-label[data-v-53f929a0]{color:#bec6cf}.form.inline-form[data-v-53f929a0]{display:flex;justify-content:center;margin:0 auto;position:relative}.form.inline-form .input-wrapper[data-v-53f929a0]{position:relative}.form.inline-form .input-wrapper .error-message[data-v-53f929a0]{bottom:-25px;left:0;position:absolute}.form.block-form .switch-wrapper[data-v-53f929a0]{border-bottom:1px solid #f4f5f6;margin-bottom:13px;padding-bottom:13px}.form.block-form .switch-wrapper[data-v-53f929a0]:last-child{border-bottom:none;margin-bottom:0;padding-bottom:0}.form.block-form .wrapper-inline[data-v-53f929a0]{display:flex;margin:0 -15px}.form.block-form .wrapper-inline .block-wrapper[data-v-53f929a0]{padding:0 15px;width:100%}.form.block-form .block-wrapper[data-v-53f929a0]{margin-bottom:32px}.form.block-form .block-wrapper label[data-v-53f929a0]{color:rgba(27,37,57,.8);display:block;font-size:.875em;font-weight:700;margin-bottom:7px;text-align:left}.form.block-form .block-wrapper[data-v-53f929a0]:last-child{margin-bottom:0}.form.block-form .button[data-v-53f929a0]{margin-top:50px}.form .inline-wrapper[data-v-53f929a0]{align-items:center;display:flex;justify-content:space-between}.form .inline-wrapper .switch-label .input-help[data-v-53f929a0]{padding-top:0}.form .inline-wrapper .switch-label .input-label[data-v-53f929a0]{color:#1b2539;font-size:1em;font-weight:700;margin-bottom:5px}.input-help[data-v-53f929a0]{color:rgba(27,37,57,.7);display:block;font-size:.75em;line-height:1.35;padding-top:10px}.single-line-form[data-v-53f929a0]{display:flex}.single-line-form .submit-button[data-v-53f929a0]{margin-left:20px}.error-message[data-v-53f929a0]{color:#fd397a;display:block;font-size:.875em;padding-top:5px;text-align:left}textarea[data-v-53f929a0]{width:100%}input[type=email].is-error[data-v-53f929a0],input[type=number].is-error[data-v-53f929a0],input[type=password].is-error[data-v-53f929a0],input[type=text].is-error[data-v-53f929a0],textarea.is-error[data-v-53f929a0]{border-color:#fd397a}input[type=email][data-v-53f929a0]::-moz-placeholder,input[type=number][data-v-53f929a0]::-moz-placeholder,input[type=password][data-v-53f929a0]::-moz-placeholder,input[type=text][data-v-53f929a0]::-moz-placeholder,textarea[data-v-53f929a0]::-moz-placeholder{color:rgba(27,37,57,.5);font-size:.9375em}input[type=email][data-v-53f929a0]:-ms-input-placeholder,input[type=number][data-v-53f929a0]:-ms-input-placeholder,input[type=password][data-v-53f929a0]:-ms-input-placeholder,input[type=text][data-v-53f929a0]:-ms-input-placeholder,textarea[data-v-53f929a0]:-ms-input-placeholder{color:rgba(27,37,57,.5);font-size:.9375em}input[type=email][data-v-53f929a0]::placeholder,input[type=number][data-v-53f929a0]::placeholder,input[type=password][data-v-53f929a0]::placeholder,input[type=text][data-v-53f929a0]::placeholder,textarea[data-v-53f929a0]::placeholder{color:rgba(27,37,57,.5);font-size:.9375em}input[type=email][disabled][data-v-53f929a0],input[type=number][disabled][data-v-53f929a0],input[type=password][disabled][data-v-53f929a0],input[type=text][disabled][data-v-53f929a0],textarea[disabled][data-v-53f929a0]{-webkit-text-fill-color:rgba(27,37,57,.8);color:rgba(27,37,57,.8);cursor:not-allowed;opacity:1}input[type=color][data-v-53f929a0]{background:none;border:none;height:40px;min-width:auto!important;outline:none;width:38px!important}.additional-link[data-v-53f929a0]{display:block;font-size:1em;margin-top:50px}.additional-link a[data-v-53f929a0],.additional-link b[data-v-53f929a0]{cursor:pointer}.additional-link a[data-v-53f929a0]:hover,.additional-link b[data-v-53f929a0]:hover{text-decoration:underline}@media only screen and (max-width:1024px){.form[data-v-53f929a0]{max-width:100%}}@media only screen and (max-width:960px){.form .button[data-v-53f929a0]{margin-left:0;margin-right:0;margin-top:20px;width:100%}.form input[data-v-53f929a0],.form textarea[data-v-53f929a0]{min-width:100%;width:100%}.form.block-form .block-wrapper[data-v-53f929a0]{display:block}.form.block-form .block-wrapper label[data-v-53f929a0]{display:block;font-size:.875em;margin-bottom:7px;padding-right:0;padding-top:0;text-align:left!important;width:100%}.form.block-form .button[data-v-53f929a0]{margin-left:0;margin-right:0;margin-top:25px}.form.inline-form[data-v-53f929a0]{display:block}.form.inline-form .input-wrapper .error-message[data-v-53f929a0]{bottom:0;position:relative}.form .button[data-v-53f929a0]{padding:14px 32px}.single-line-form[data-v-53f929a0]{display:block}.single-line-form .submit-button[data-v-53f929a0]{margin-left:0;margin-top:20px;width:100%}input[type=email][data-v-53f929a0],input[type=number][data-v-53f929a0],input[type=password][data-v-53f929a0],input[type=text][data-v-53f929a0],textarea[data-v-53f929a0]{padding:14px 20px}}@media only screen and (max-width:690px){.form.block-form .wrapper-inline[data-v-53f929a0]{display:block}}.dark .form .input-help[data-v-53f929a0]{color:#7d858c}.dark .form.block-form .block-wrapper label[data-v-53f929a0]{color:#bec6cf}.dark .form.block-form .switch-wrapper[data-v-53f929a0]{border-color:hsla(0,0%,100%,.02)}.dark .form .inline-wrapper .switch-label .input-label[data-v-53f929a0]{color:#bec6cf}.dark input[type=email][data-v-53f929a0],.dark input[type=number][data-v-53f929a0],.dark input[type=password][data-v-53f929a0],.dark input[type=text][data-v-53f929a0],.dark textarea[data-v-53f929a0]{background:#1e2024;border-color:#1e2024;color:#bec6cf}.dark input[type=email][data-v-53f929a0]::-moz-placeholder,.dark input[type=number][data-v-53f929a0]::-moz-placeholder,.dark input[type=password][data-v-53f929a0]::-moz-placeholder,.dark input[type=text][data-v-53f929a0]::-moz-placeholder,.dark textarea[data-v-53f929a0]::-moz-placeholder{color:#7d858c}.dark input[type=email][data-v-53f929a0]:-ms-input-placeholder,.dark input[type=number][data-v-53f929a0]:-ms-input-placeholder,.dark input[type=password][data-v-53f929a0]:-ms-input-placeholder,.dark input[type=text][data-v-53f929a0]:-ms-input-placeholder,.dark textarea[data-v-53f929a0]:-ms-input-placeholder{color:#7d858c}.dark input[type=email][data-v-53f929a0]::placeholder,.dark input[type=number][data-v-53f929a0]::placeholder,.dark input[type=password][data-v-53f929a0]::placeholder,.dark input[type=text][data-v-53f929a0]::placeholder,.dark textarea[data-v-53f929a0]::placeholder{color:#7d858c}.dark input[type=email][disabled][data-v-53f929a0],.dark input[type=number][disabled][data-v-53f929a0],.dark input[type=password][disabled][data-v-53f929a0],.dark input[type=text][disabled][data-v-53f929a0],.dark textarea[disabled][data-v-53f929a0]{-webkit-text-fill-color:hsla(208,6%,52%,.8);color:hsla(208,6%,52%,.8)}.dark .popup-wrapper input[type=email][data-v-53f929a0],.dark .popup-wrapper input[type=number][data-v-53f929a0],.dark .popup-wrapper input[type=password][data-v-53f929a0],.dark .popup-wrapper input[type=text][data-v-53f929a0],.dark .popup-wrapper textarea[data-v-53f929a0]{background:#25272c}.permission-toggle[data-v-53f929a0]{align-items:center;cursor:pointer;display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.permission-toggle .privilege[data-v-53f929a0]{color:rgba(27,37,57,.7);font-size:.8125em;margin-right:10px;white-space:nowrap}.permission-toggle path[data-v-53f929a0],.permission-toggle polyline[data-v-53f929a0]{color:#a4adb6}.dark .permission-toggle .privilege[data-v-53f929a0]{color:#7d858c}",""]);const n=r},4479:(e,t,i)=>{"use strict";i.d(t,{C1:()=>n});function a(e){return null==e}function r(e){return Array.isArray(e)&&0===e.length}var n={validate:function(e,t){var i=(void 0===t?{allowFalse:!0}:t).allowFalse,n={valid:!1,required:!0};return a(e)||r(e)?n:!1!==e||i?(n.valid=!!String(e).trim().length,n):n},params:[{name:"allowFalse",default:!0}],computesRequired:!0}},9495:function(e,t,i){!function(e,t){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=i(t),r={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},u={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},d=function(e,t){var i=(void 0===t?{}:t).locale,a=void 0===i?"":i;return Array.isArray(e)?e.every((function(e){return d(e,{locale:a})})):a?(n[a]||n.en).test(e):Object.keys(n).some((function(t){return n[t].test(e)}))},l={validate:d,params:[{name:"locale"}]},c=function(e,t){var i=(void 0===t?{}:t).locale,a=void 0===i?"":i;return Array.isArray(e)?e.every((function(e){return c(e,{locale:a})})):a?(u[a]||u.en).test(e):Object.keys(u).some((function(t){return u[t].test(e)}))},f={validate:c,params:[{name:"locale"}]},p=function(e,t){var i=(void 0===t?{}:t).locale,a=void 0===i?"":i;return Array.isArray(e)?e.every((function(e){return p(e,{locale:a})})):a?(o[a]||o.en).test(e):Object.keys(o).some((function(t){return o[t].test(e)}))},v={validate:p,params:[{name:"locale"}]},m=function(e,t){var i=(void 0===t?{}:t).locale,a=void 0===i?"":i;return Array.isArray(e)?e.every((function(e){return m(e,{locale:a})})):a?(s[a]||s.en).test(e):Object.keys(s).some((function(t){return s[t].test(e)}))},h={validate:m,params:[{name:"locale"}]},b=function(e,t){var i=void 0===t?{}:t,a=i.min,r=i.max;return Array.isArray(e)?e.every((function(e){return!!b(e,{min:a,max:r})})):Number(a)<=e&&Number(r)>=e},g={validate:b,params:[{name:"min"},{name:"max"}]},y={validate:function(e,t){var i=t.target;return String(e)===String(i)},params:[{name:"target",isTarget:!0}]},_=function(e,t){var i=t.length;if(Array.isArray(e))return e.every((function(e){return _(e,{length:i})}));var a=String(e);return/^[0-9]*$/.test(a)&&a.length===i},x={validate:_,params:[{name:"length",cast:function(e){return Number(e)}}]},k=function(e,t,i){var a=window.URL||window.webkitURL;return new Promise((function(r){var n=new Image;n.onerror=function(){return r(!1)},n.onload=function(){return r(n.width===t&&n.height===i)},n.src=a.createObjectURL(e)}))},w=function(e,t){var i=t.width,a=t.height,r=[];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 i&&!Array.isArray(e)&&(e=String(e).split(",").map((function(e){return e.trim()}))),Array.isArray(e)?e.every((function(e){return a.test(String(e))})):a.test(String(e))},params:[{name:"multiple",default:!1}]};function O(e){return e!=e}function P(e){return null==e}function A(e){return Array.isArray(e)&&0===e.length}var I=function(e){return null!==e&&e&&"object"==typeof e&&!Array.isArray(e)};function S(e,t){return!(!O(e)||!O(t))||e===t}function j(e){return""!==e&&!P(e)}function z(e){return"function"==typeof e}function F(e){return z(e)&&!!e.__locatorRef}function Z(e,t){var i=Array.isArray(e)?e:D(e);if(z(i.findIndex))return i.findIndex(t);for(var a=0;a=0:Array.isArray(e)?e.every((function(e){return re(e,{length:i})})):String(e).length<=i},ne={validate:re,params:[{name:"length",cast:function(e){return Number(e)}}]},se=function(e,t){var i=t.max;return!P(e)&&""!==e&&(Array.isArray(e)?e.length>0&&e.every((function(e){return se(e,{max:i})})):Number(e)<=i)},oe={validate:se,params:[{name:"max",cast:function(e){return Number(e)}}]},ue=function(e,t){var i=new RegExp(t.join("|").replace("*",".+")+"$","i");return Array.isArray(e)?e.every((function(e){return i.test(e.type)})):i.test(e.type)},de={validate:ue},le=function(e,t){var i=t.length;return!P(e)&&(Array.isArray(e)?e.every((function(e){return le(e,{length:i})})):String(e).length>=i)},ce={validate:le,params:[{name:"length",cast:function(e){return Number(e)}}]},fe=function(e,t){var i=t.min;return!P(e)&&""!==e&&(Array.isArray(e)?e.length>0&&e.every((function(e){return fe(e,{min:i})})):Number(e)>=i)},pe={validate:fe,params:[{name:"min",cast:function(e){return Number(e)}}]},ve=/^[٠١٢٣٤٥٦٧٨٩]+$/,me=/^[0-9]+$/,he={validate:function(e){var t=function(e){var t=String(e);return me.test(t)||ve.test(t)};return Array.isArray(e)?e.every(t):t(e)}},be=function(e,t){var i=t.regex;return Array.isArray(e)?e.every((function(e){return be(e,{regex:i})})):i.test(String(e))},ge={validate:be,params:[{name:"regex",cast:function(e){return"string"==typeof e?new RegExp(e):e}}]},ye={validate:function(e,t){var i=(void 0===t?{allowFalse:!0}:t).allowFalse,a={valid:!1,required:!0};return P(e)||A(e)?a:!1!==e||i?(a.valid=!!String(e).trim().length,a):a},params:[{name:"allowFalse",default:!0}],computesRequired:!0},_e=function(e){return A(e)||E([!1,null,void 0],e)||!String(e).trim().length},xe=function(e,t){var i,a=t.target,r=t.values;return r&&r.length?(Array.isArray(r)||"string"!=typeof r||(r=[r]),i=r.some((function(e){return e==String(a).trim()}))):i=!_e(a),i?{valid:!_e(e),required:i}:{valid:!0,required:i}},ke={validate:xe,params:[{name:"target",isTarget:!0},{name:"values"}],computesRequired:!0},we=function(e,t){var i=t.size;if(isNaN(i))return!1;var a=1024*i;if(!Array.isArray(e))return e.size<=a;for(var r=0;ra)return!1;return!0},Ce={validate:we,params:[{name:"size",cast:function(e){return Number(e)}}]},$e=function(e,t){var i=t||{},a=i.decimals,r=void 0===a?0:a,n=i.separator,s=new RegExp("^-?\\d+"+("comma"===(void 0===n?"dot":n)?",?":"\\.?")+(0===r?"\\d*":"(\\d{"+r+"})?")+"$");return Array.isArray(e)?e.every((function(e){return s.test(String(e))})):s.test(String(e))},Oe={validate:$e,params:[{name:"decimals",default:0},{name:"separator",default:"dot"}]},Pe=Object.freeze({__proto__:null,alpha_dash:f,alpha_num:v,alpha_spaces:h,alpha:l,between:g,confirmed:y,digits:x,dimensions:C,email:$,ext:Y,image:J,oneOf:H,integer:Q,length:ae,is_not:te,is:ee,max:ne,max_value:oe,mimes:de,min:ce,min_value:pe,excluded:W,numeric:he,regex:ge,required:ye,required_if:ke,size:Ce,double:Oe}),Ae=function(){return Ae=Object.assign||function(e){for(var t,i=1,a=arguments.length;i0&&r[r.length-1])||6!==n[0]&&2!==n[0])){s=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]=0&&qe.getRuleDefinition("max")&&(a.max=i.maxlength),i.minlength>=0&&qe.getRuleDefinition("min")&&(a.min=i.minlength),"number"===i.type&&(j(i.min)&&qe.getRuleDefinition("min_value")&&(a.min_value=Number(i.min)),j(i.max)&&qe.getRuleDefinition("max_value")&&(a.max_value=Number(i.max))),a):a}function $t(e){var t,i=["input","select","textarea"],a=null===(t=e.data)||void 0===t?void 0:t.attrs;if(!E(i,e.tag)||!a)return{};var r={};return"required"in a&&!1!==a.required&&qe.getRuleDefinition("required")&&(r.required="checkbox"!==a.type||[!0]),ct(e)?We(Ae(Ae({},r),Ct(e))):We(r)}function Ot(e,t){return e.$scopedSlots.default?e.$scopedSlots.default(t)||[]:e.$slots.default||[]}function Pt(e,t){return!(e._ignoreImmediate||!e.immediate)||!(S(e.value,t)||!e.normalizedEvents.length)||!!e._needsValidation||!e.initialized&&void 0===t}function At(e){return Ae(Ae({},e.flags),{errors:e.errors,classes:e.classes,failedRules:e.failedRules,reset:function(){return e.reset()},validate:function(){for(var t=[],i=0;i0)){var d=Fe().useConstraintAttrs?$t(e):{};ut(t._resolvedRules,d)||(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===(u=null===(o=e.data)||void 0===o?void 0:o.attrs)||void 0===u?void 0:u.id)),t._resolvedRules=d,Ft(t,e)}}))}return this.slim&&i.length<=1?i[0]:e(this.tag,i)},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(i){t.flags[i]=e[i]}))},syncValue:function(e){var t=lt(e);this.value=t,this.flags.changed=!ut(this.initialValue,t)},reset:function(){var e=this;this.errors=[],this.initialValue=this.value;var t=V();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,jt(this)]}))}))},validateSilent:function(){return Ie(this,void 0,void 0,(function(){var e,t;return Se(this,(function(i){switch(i.label){case 0:return this.setFlags({pending:!0}),e=Ae(Ae({},this._resolvedRules),this.normalizedRules),Object.defineProperty(e,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),[4,Qe(this.value,e,Ae(Ae({name:this.name||this.fieldName},Lt(this)),{bails:this.bails,skipIfEmpty:this.skipIfEmpty,isInitial:!this.initialized,customMessages:this.customMessages}))];case 1:return t=i.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,i=e.failedRules,a=e.regenerateMap;this.errors=t,this._regenerateMap=a,this.failedRules=Ae({},i||{}),this.setFlags({valid:!t.length,passed:!t.length,invalid:!!t.length,failed:!!t.length,validated:!0,changed:!ut(this.value,this.initialValue)})},registerField:function(){Rt(this)},checkComputesRequiredState:function(){var e=Ae(Ae({},this._resolvedRules),this.normalizedRules);return Object.keys(e).some(qe.isRequireRule)}}});function Dt(e,t){for(var i={},a=Object.keys(t),r=a.length,n=function(r){var n=a[r],s=e&&e[n]||n,o=t[n];return P(o)?"continue":"valid"!==n&&"invalid"!==n||t.validated?void("string"==typeof s?i[s]=o:Array.isArray(s)&&s.forEach((function(e){i[e]=o}))):"continue"},s=0;s{"use strict";i.d(t,{Z:()=>r});const a={name:"AppInputSwitch",props:["description","isLast","title","error"]};const r=(0,i(1900).Z)(a,(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"flex w-full items-center justify-between space-x-2 sm:space-x-8",class:{"mb-6 sm:mb-7":!e.isLast}},[i("div",{staticClass:"leading-5"},[i("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?i("span",{staticClass:"block text-xs leading-4 dark:text-gray-500 text-gray-500",domProps:{innerHTML:e._s(e.description)}}):e._e(),e._v(" "),e.error?i("span",{staticClass:"error-message"},[e._v("\n "+e._s(e.error)+"\n ")]):e._e()]),e._v(" "),i("div",[e._t("default")],2)])}),[],!1,null,null,null).exports},4198:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});const a={name:"AppInputText",props:["description","isLast","title","error"]};const r=(0,i(1900).Z)(a,(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:{"mb-6 sm:mb-7":!e.isLast}},[e.title?i("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?i("span",{staticClass:"pt-2 text-xs text-rose-600"},[e._v("\n "+e._s(e.error)+"\n ")]):e._e(),e._v(" "),e.description?i("small",{staticClass:"block pt-2 text-xs leading-4 dark:text-gray-500 text-gray-500",domProps:{innerHTML:e._s(e.description)}}):e._e()],2)}),[],!1,null,null,null).exports},3907:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});var a=i(826);const r={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;a.U.$on("popover:open",(function(t){e.name===t&&(e.isVisible=!e.isVisible)}))}};const n=(0,i(1900).Z)(r,(function(){var e=this,t=e.$createElement,i=e._self._c||t;return e.isVisible?i("div",[i("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(" "),i("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,i)=>{"use strict";i.d(t,{Z:()=>u});const a={name:"PopoverWrapper"};var r=i(3379),n=i.n(r),s=i(9660),o={insert:"head",singleton:!1};n()(s.Z,o);s.Z.locals;const u=(0,i(1900).Z)(a,(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},597:(e,t,i)=>{"use strict";i.d(t,{Z:()=>I});var a=i(144),r=i(3907),n=i(2089),s=i(9209),o=i(2784),u=i(9101),d=i(629),l=i(826);function c(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function f(e){for(var t=1;t1280?this.file.data.attributes.thumbnail.xl:this.file.data.attributes.thumbnail.lg}}};const g=(0,m.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;const y={name:"Audio",props:["file"]};const x=(0,m.Z)(y,(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 k=i(9621),w=i(7318);function C(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}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;l.U.$on("file-preview:next",(function(){return e.next()})),l.U.$on("file-preview:prev",(function(){return e.prev()})),this.getFilesForView()}};const A={name:"FilePreview",components:{FilePreviewToolbar:h,FilePreviewMedia:(0,m.Z)(P,(function(){var e=this,t=e.$createElement,i=e._self._c||t;return e.currentFile?i("div",{staticClass:"absolute top-[56px] left-0 right-0 bottom-0 select-none lg:top-[66px]"},[!e.$isMobile()&&e.files.length>1?i("div",{},[i("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)}}},[i("chevron-left-icon",{attrs:{size:"20"}})],1),e._v(" "),i("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)}}},[i("chevron-right-icon",{attrs:{size:"20"}})],1)]):e._e(),e._v(" "),!e.$isMobile()&&(e.isAudio||e.isImage||e.isVideo||e.isPDF)?i("div",{staticClass:"flex h-full w-full items-center justify-center"},[e.isPDF?i("PdfFile",{attrs:{file:e.currentFile}}):e._e(),e._v(" "),i("div",{staticClass:"flex h-full w-full items-center justify-center"},[e.isAudio?i("Audio",{attrs:{file:e.currentFile}}):e._e(),e._v(" "),e.isVideo?i("Video",{staticClass:"mx-auto max-h-full max-w-[1080px] self-center",attrs:{file:e.currentFile}}):e._e(),e._v(" "),e.isImage?i("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)?i("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,a){return i("div",{key:a,staticClass:"relative flex h-full w-screen shrink-0 snap-center items-center justify-center",attrs:{id:"group-"+t.data.id}},[e.isImage?i("ImageFile",{staticClass:"mx-auto max-h-[100%] max-w-[100%] self-center",attrs:{file:t}}):e._e(),e._v(" "),e.isAudio?i("Audio",{attrs:{file:t}}):e._e(),e._v(" "),e.isVideo?i("Video",{attrs:{file:t}}):e._e(),e._v(" "),e.isPDF?i("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(){l.U.$emit("file-preview:next")},prev:function(){l.U.$emit("file-preview:prev")}},updated:function(){this.isFullPreview&&this.$refs.filePreview.focus()},mounted:function(){var e=this;l.U.$on("file-preview:show",(function(){return e.isFullPreview=!0})),l.U.$on("file-preview:hide",(function(){return e.closeFilePreview()}))}};const I=(0,m.Z)(A,(function(){var e=this,t=e.$createElement,i=e._self._c||t;return e.isFullPreview?i("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)}]}},[i("FilePreviewToolbar"),e._v(" "),i("FilePreviewMedia")],1):e._e()}),[],!1,null,null,null).exports},9621:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});const a={name:"Video",props:["file"]};const r=(0,i(1900).Z)(a,(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,i)=>{"use strict";i.d(t,{Z:()=>r});const a={name:"CheckBox",props:["isClicked"],components:{CheckIcon:i(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 r=(0,i(1900).Z)(a,(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[i("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?i("CheckIcon",{staticClass:"vue-feather text-white",attrs:{size:"17"}}):e._e()],1)])}),[],!1,null,null,null).exports},237:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});const a={name:"FileIconThumbnail",props:["entry"]};const r=(0,i(1900).Z)(a,(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"flex items-center justify-center"},[i("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(" "),i("svg",{staticClass:"vue-feather dark:text-gray-800 text-gray-100 ",attrs:{width:"38px",height:"51px",fill:"currentColor",viewBox:"0 0 38 51",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"}},[i("path",{attrs:{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},4886:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});var a=i(8569),r=i(7212);const n={name:"FolderIcon",props:["item"],components:{VueFolderTeamIcon:a.Z,VueFolderIcon:r.Z}};const s=(0,i(1900).Z)(n,(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[e.item.data.attributes.isTeamFolder?e._e():i("VueFolderIcon"),e._v(" "),e.item.data.attributes.isTeamFolder?i("VueFolderTeamIcon",{staticStyle:{width:"53px",height:"52px"}}):e._e()],1)}),[],!1,null,null,null).exports},6354:(e,t,i)=>{"use strict";i.d(t,{Z:()=>u});const a={name:"CloudPlusIcon"};var r=i(3379),n=i.n(r),s=i(3485),o={insert:"head",singleton:!1};n()(s.Z,o);s.Z.locals;const u=(0,i(1900).Z)(a,(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("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"}},[i("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(" "),i("line",{attrs:{x1:"8.5",y1:"7",x2:"8.5",y2:"12",id:"Path"}}),e._v(" "),i("line",{attrs:{x1:"6",y1:"9.5",x2:"11",y2:"9.5",id:"Path"}})])}),[],!1,null,null,null).exports},2617:(e,t,i)=>{"use strict";i.d(t,{Z:()=>u});const a={name:"SortingIcon"};var r=i(3379),n=i.n(r),s=i(3822),o={insert:"head",singleton:!1};n()(s.Z,o);s.Z.locals;const u=(0,i(1900).Z)(a,(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("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"}},[i("rect",{attrs:{x:"9.77777778",y:"0",width:"6.22222222",height:"6.22222222"}}),e._v(" "),i("rect",{attrs:{x:"9.77777778",y:"9.77777778",width:"6.22222222",height:"6.22222222"}}),e._v(" "),i("line",{attrs:{x1:"0",y1:"2",x2:"6",y2:"2"}}),e._v(" "),i("line",{attrs:{x1:"0",y1:"8",x2:"6",y2:"8"}}),e._v(" "),i("line",{attrs:{x1:"0",y1:"14",x2:"6",y2:"14"}})])}),[],!1,null,null,null).exports},7212:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});const a={name:"VueFolderIcon"};const r=(0,i(1900).Z)(a,(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("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"}},[i("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(" "),i("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(" "),i("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,i)=>{"use strict";i.d(t,{Z:()=>r});const a={name:"VueFolderTeamIcon"};const r=(0,i(1900).Z)(a,(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("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"}},[i("g",{attrs:{id:"V2",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"}},[i("g",{attrs:{id:"team-folder"}},[i("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(" "),i("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(" "),i("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(" "),i("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"}},[i("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(" "),i("circle",{attrs:{cx:"4.79999971",cy:"2.39999986",r:"2.39999986"}}),e._v(" "),i("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(" "),i("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},1059:(e,t,i)=>{"use strict";i.d(t,{Z:()=>h});var a=i(1165),r=i(4886),n=i(9101),s=i(237),o=i(167),u=i(916),d=i(6486),l=i(629),c=i(826);function f(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,a)}return i}function p(e){for(var t=1;t