diff --git a/static/js/_commons.js b/static/js/_commons.js index fd596f50..b85f0301 100644 --- a/static/js/_commons.js +++ b/static/js/_commons.js @@ -1,2 +1,2 @@ /*! For license information please see _commons.js.LICENSE.txt */ -(self.webpackChunkmediacms_frontend=self.webpackChunkmediacms_frontend||[]).push([[276],{133:function(e){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},158:function(e){"use strict";var t,n,r=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw n}}),n={},i(function(){throw 42},null,t)}catch(e){e!==n&&(i=null)}else i=null;var a=/^\s*class\b/,o=function(e){try{var t=r.call(e);return a.test(t)}catch(e){return!1}},s=function(e){try{return!o(e)&&(r.call(e),!0)}catch(e){return!1}},l=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,u=!(0 in[,]),d=function(){return!1};if("object"==typeof document){var h=document.all;l.call(h)===l.call(document.all)&&(d=function(e){if((u||!e)&&(void 0===e||"object"==typeof e))try{var t=l.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=i?function(e){if(d(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{i(e,null,t)}catch(e){if(e!==n)return!1}return!o(e)&&s(e)}:function(e){if(d(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(c)return s(e);if(o(e))return!1;var t=l.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&s(e)}},160:function(e){"use strict";e.exports=function(e,t,n,r,i,a,o,s){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,i,a,o,s],u=0;(l=new Error(t.replace(/%s/g,function(){return c[u++]}))).name="Invariant Violation"}throw l.framesToPop=1,l}}},197:function(e,t,n){"use strict";var r=n(5697);const i=n(8444),a=n(4233),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=c,t.IS=50;const s=2147483647;function l(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return h(e)}return u(e,t,n)}function u(e,t,n){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|g(e,t);let r=l(n);const i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(K(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(K(e,ArrayBuffer)||e&&K(e.buffer,ArrayBuffer))return p(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(K(e,SharedArrayBuffer)||e&&K(e.buffer,SharedArrayBuffer)))return p(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return c.from(r,t,n);const i=function(e){if(c.isBuffer(e)){const t=0|m(e.length),n=l(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||Q(e.length)?l(0):f(e):"Buffer"===e.type&&Array.isArray(e.data)?f(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function d(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function h(e){return d(e),l(e<0?0:0|m(e))}function f(e){const t=e.length<0?0:0|m(e.length),n=l(t);for(let r=0;r=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(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||K(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return $(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Y(e).length;default:if(i)return r?-1:$(e).length;t=(""+t).toLowerCase(),i=!0}}function v(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,n);case"utf8":case"utf-8":return x(this,t,n);case"ascii":return M(this,t,n);case"latin1":case"binary":return T(this,t,n);case"base64":return A(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function y(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),Q(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:E(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):E(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function E(e,t,n,r,i){let a,o=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,n/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){let r=-1;for(a=n;as&&(n=s-l),a=n;a>=0;a--){let n=!0;for(let r=0;ri&&(r=i):r=i;const a=t.length;let o;for(r>a/2&&(r=a/2),o=0;o>8,i=n%256,a.push(i),a.push(r);return a}(t,e.length-n),e,n,r)}function A(e,t,n){return 0===t&&n===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,n))}function x(e,t,n){n=Math.min(e.length,n);const r=[];let i=t;for(;i239?4:t>223?3:t>191?2:1;if(i+o<=n){let n,r,s,l;switch(o){case 1:t<128&&(a=t);break;case 2:n=e[i+1],128==(192&n)&&(l=(31&t)<<6|63&n,l>127&&(a=l));break;case 3:n=e[i+1],r=e[i+2],128==(192&n)&&128==(192&r)&&(l=(15&t)<<12|(63&n)<<6|63&r,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:n=e[i+1],r=e[i+2],s=e[i+3],128==(192&n)&&128==(192&r)&&128==(192&s)&&(l=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&s,l>65535&&l<1114112&&(a=l))}}null===a?(a=65533,o=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),i+=o}return function(e){const t=e.length;if(t<=P)return String.fromCharCode.apply(String,e);let n="",r=0;for(;rr.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,i)}i+=t.length}return r},c.byteLength=g,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tn&&(e+=" ... "),""},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(e,t,n,r,i){if(K(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;let a=(i>>>=0)-(r>>>=0),o=(n>>>=0)-(t>>>=0);const s=Math.min(a,o),l=this.slice(r,i),u=e.slice(t,n);for(let e=0;e>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let a=!1;for(;;)switch(r){case"hex":return _(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":case"latin1":case"binary":return S(this,e,t,n);case"base64":return C(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const P=4096;function M(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;ir)&&(n=r);let i="";for(let r=t;rn)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,n,r,i,a){if(!c.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 L(e,t,n,r,i){V(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,n}function N(e,t,n,r,i){V(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n+7]=a,a>>=8,e[n+6]=a,a>>=8,e[n+5]=a,a>>=8,e[n+4]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=o,o>>=8,e[n+2]=o,o>>=8,e[n+1]=o,o>>=8,e[n]=o,n+8}function F(e,t,n,r,i,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function j(e,t,n,r,i){return t=+t,n>>>=0,i||F(e,0,n,4),a.write(e,t,n,r,23,4),n+4}function B(e,t,n,r,i){return t=+t,n>>>=0,i||F(e,0,n,8),a.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||I(e,t,this.length);let r=this[e],i=1,a=0;for(;++a>>=0,t>>>=0,n||I(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||I(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||I(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||I(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||I(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=Z(function(e){H(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(i)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<>>=0,t>>>=0,n||I(e,t,this.length);let r=this[e],i=1,a=0;for(;++a=i&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||I(e,t,this.length);let r=t,i=1,a=this[e+--r];for(;r>0&&(i*=256);)a+=this[e+--r]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*t)),a},c.prototype.readInt8=function(e,t){return e>>>=0,t||I(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||I(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){e>>>=0,t||I(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=Z(function(e){H(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||W(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<>>=0,t||I(e,4,this.length),a.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||I(e,4,this.length),a.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||I(e,8,this.length),a.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||I(e,8,this.length),a.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||D(this,e,t,n,Math.pow(2,8*n)-1,0);let i=1,a=0;for(this[t]=255&e;++a>>=0,n>>>=0,r||D(this,e,t,n,Math.pow(2,8*n)-1,0);let i=n-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=Z(function(e,t=0){return L(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=Z(function(e,t=0){return N(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);D(this,e,t,n,r-1,-r)}let i=0,a=1,o=0;for(this[t]=255&e;++i>>=0,!r){const r=Math.pow(2,8*n-1);D(this,e,t,n,r-1,-r)}let i=n-1,a=1,o=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===o&&0!==this[t+i+1]&&(o=1),this[t+i]=(e/a|0)-o&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=Z(function(e,t=0){return L(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=Z(function(e,t=0){return N(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeFloatLE=function(e,t,n){return j(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return j(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return B(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return B(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function V(e,t,n,r,i,a){if(e>n||e3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(a+1)}${r}`:`>= -(2${r} ** ${8*(a+1)-1}${r}) and < 2 ** ${8*(a+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new U.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,n){H(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||W(t,e.length-(n+1))}(r,i,a)}function H(e,t){if("number"!=typeof e)throw new U.ERR_INVALID_ARG_TYPE(t,"number",e)}function W(e,t,n){if(Math.floor(e)!==e)throw H(e,n),new U.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new U.ERR_BUFFER_OUT_OF_BOUNDS;throw new U.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}z("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),z("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),z("ERR_OUT_OF_RANGE",function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=q(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=q(i)),i+="n"),r+=` It must be ${t}. Received ${i}`,r},RangeError);const G=/[^+/0-9A-Za-z-_]/g;function $(e,t){let n;t=t||1/0;const r=e.length;let i=null;const a=[];for(let o=0;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function Y(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(G,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function X(e,t,n,r){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function K(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Q(e){return e!=e}const J=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t}();function Z(e){return"undefined"==typeof BigInt?ee:e}function ee(){throw new Error("BigInt not supported")}},206:function(e,t,n){"use strict";var r=n(1730),i=n(4042),a=n(4314);e.exports=r?function(e){return r(e)}:i?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return i(e)}:a?function(e){return a(e)}:null},209:function(e,t,n){"use strict";function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,o,s=[],l=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n10)return!0;for(var t=0;t57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function I(e){return Object.keys(e).filter(O).concat(u(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function D(e,t){if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i{h()},[o]),[s,o,l,c,f,n,t,d,u,function(){return null},function(){return l?1>l.totalPages()||l.loadedAllItems()?null:r.createElement("button",{className:"load-more",onClick:p},(0,a.translateString)("SHOW MORE")):null}]}},401:function(e){"use strict";e.exports=Error},419:function(e,t,n){"use strict";n.d(t,{jV:function(){return u},pl:function(){return l},r1:function(){return c}});var r=n(338),i=n.n(r);if(201==n.j)var a=n(8255);if(201==n.j)var o=n(5474);var s=function(e){return e.replace(/-(\w)/g,function(e,t){return t.toUpperCase()})},l=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=(0,a.HP)(e),r={},i=0,o=n.length;i=0)&&(r[s]=e[s])}return r},c=function(e,t){for(var n=t.map(s),r=(0,a.HP)(e),i={},o=0,l=r.length;o=0||n.indexOf(s(c))>=0)&&(i[c]=e[c])}return i},u=function e(t,n){for(var r=a.h1.apply(void 0,[{},(0,a.cJ)(t,n)].concat(i()((0,a.zu)(c(t,n))))),s=(0,a.HP)(r).filter(o.Y),l=0,u=s.length;l=0?(delete r[d],r=(0,a.h1)({},r,h)):r[d]=h}return r}},463:function(e,t,n){"use strict";n.d(t,{c:function(){return a}});var r=n(4571),i=n.n(r);function a(e,t){let n=i()(e,{});return""!==n.origin&&"null"!==n.origin&&n.origin||(n=i()(t+"/"+e.replace(/^\//g,""),{})),n.toString()}},519:function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}n.d(t,{A:function(){return r}})},795:function(e,t,n){"use strict";n.d(t,{E:function(){return g}});var r=n(9471),i=n(5338),a=n(7460),o=n(4571),s=n.n(o),l=n(8790),c=n(7664),u=n(1838);function d(){const{userCan:e,isAnonymous:t,pages:n}=(0,i.useUser)(),o=(0,r.useContext)(l.LinksContext),d=(0,r.useContext)(l.SidebarContext),h=s()(window.location.href),f=(h.host+h.pathname).replace(/\/+$/,"");function p(e){return e.map(e=>{const t=s()(e.link);return{active:f===t.host+t.pathname,itemType:"link",link:e.link||"#",icon:e.icon||null,iconPos:"left",text:e.text||e.link||"#",itemAttr:{className:e.className||""}}})}return[function(){const t=[];return d.hideHomeLink||t.push({link:o.home,icon:"home",text:(0,u.translateString)("Home"),className:"nav-item-home"}),a.PageStore.get("config-enabled").pages.featured&&a.PageStore.get("config-enabled").pages.featured.enabled&&t.push({link:o.featured,icon:"star",text:(0,u.translateString)("Featured"),className:"nav-item-featured"}),a.PageStore.get("config-enabled").pages.recommended&&a.PageStore.get("config-enabled").pages.recommended.enabled&&t.push({link:o.recommended,icon:"done_outline",text:(0,u.translateString)("Recommended"),className:"nav-item-recommended"}),a.PageStore.get("config-enabled").pages.latest&&a.PageStore.get("config-enabled").pages.latest.enabled&&t.push({link:o.latest,icon:"new_releases",text:(0,u.translateString)("Latest"),className:"nav-item-latest"}),!d.hideTagsLink&&a.PageStore.get("config-enabled").taxonomies.tags&&a.PageStore.get("config-enabled").taxonomies.tags.enabled&&t.push({link:o.archive.tags,icon:"local_offer",text:(0,u.translateString)("Tags"),className:"nav-item-tags"}),!d.hideCategoriesLink&&a.PageStore.get("config-enabled").taxonomies.categories&&a.PageStore.get("config-enabled").taxonomies.categories.enabled&&t.push({link:o.archive.categories,icon:"list_alt",text:(0,u.translateString)("Categories"),className:"nav-item-categories"}),a.PageStore.get("config-enabled").pages.members&&a.PageStore.get("config-enabled").pages.members.enabled&&e.canSeeMembersPage&&t.push({link:o.members,icon:"people",text:(0,u.translateString)("Members"),className:"nav-item-members"}),a.PageStore.get("config-contents").sidebar.mainMenuExtra.items.forEach(e=>{t.push({link:e.link,icon:e.icon,text:e.text,className:e.className})}),t.length?r.createElement(c.NavigationMenuList,{key:"main-first",items:p(t)}):null}(),function(){const i=[];return t||(e.addMedia&&(i.push({link:o.user.addMedia,icon:"video_call",text:(0,u.translateString)("Upload"),className:"nav-item-upload-media"}),n.media&&i.push({link:n.media,icon:"video_library",text:(0,u.translateString)("My media"),className:"nav-item-my-media"})),e.saveMedia&&i.push({link:n.playlists,icon:"playlist_play",text:(0,u.translateString)("My playlists"),className:"nav-item-my-playlists"})),i.length?r.createElement(c.NavigationMenuList,{key:"main-second",items:p(i)}):null}(),function(){const t=[];return a.PageStore.get("config-enabled").pages.history&&a.PageStore.get("config-enabled").pages.history.enabled&&t.push({link:o.user.history,icon:"history",text:(0,u.translateString)("History"),className:"nav-item-history"}),e.likeMedia&&a.PageStore.get("config-enabled").pages.liked&&a.PageStore.get("config-enabled").pages.liked.enabled&&t.push({link:o.user.liked,icon:"thumb_up",text:(0,u.translateString)("Liked media"),className:"nav-item-liked"}),t.length?r.createElement(c.NavigationMenuList,{key:"user",items:p(t)}):null}(),function(){const e=[];return e.push({link:"/about",icon:"contact_support",text:(0,u.translateString)("About"),className:"nav-item-about"}),e.push({link:"/tos",icon:"description",text:(0,u.translateString)("Terms"),className:"nav-item-terms"}),e.push({link:"/contact",icon:"alternate_email",text:(0,u.translateString)("Contact"),className:"nav-item-contact"}),e.push({link:"/setlanguage",icon:"language",text:(0,u.translateString)("Language"),className:"nav-item-language"}),e.length?r.createElement(c.NavigationMenuList,{key:"custom",items:p(e)}):null}(),function(){const t=[];return e.manageMedia&&t.push({link:o.manage.media,icon:"miscellaneous_services",text:(0,u.translateString)("Manage media"),className:"nav-item-manage-media"}),e.manageUsers&&t.push({link:o.manage.users,icon:"miscellaneous_services",text:(0,u.translateString)("Manage users"),className:"nav-item-manage-users"}),e.manageComments&&t.push({link:o.manage.comments,icon:"miscellaneous_services",text:(0,u.translateString)("Manage comments"),className:"nav-item-manage-comments"}),t.length?r.createElement(c.NavigationMenuList,{key:"admin",items:p(t)}):null}()]}function h(){const e=a.PageStore.get("config-contents").sidebar.belowNavMenu;return e?r.createElement("div",{className:"page-sidebar-under-nav-menus",dangerouslySetInnerHTML:{__html:e}}):null}function f(){const e=a.PageStore.get("config-contents").sidebar.belowThemeSwitcher;return e?r.createElement("div",{className:"page-sidebar-below-theme-switcher",dangerouslySetInnerHTML:{__html:e}}):null}var p=n(2140);function m(){const e=a.PageStore.get("config-contents").sidebar.footer;return e?r.createElement("div",{className:"page-sidebar-bottom",dangerouslySetInnerHTML:{__html:e}}):null}function g(){const{visibleSidebar:e,toggleSidebar:t}=(0,i.useLayout)(),n=(0,r.useRef)(null),[o,s]=(0,r.useState)(e||492>window.innerWidth),[l,c]=(0,r.useState)(!0);let u=null,g=null,v=!1,y=!1;function b(){if(v||!a.PageStore.get("config-contents").sidebar.footer)return;u=document.querySelector(".page-sidebar-bottom"),g=u.previousSibling,"relative"!==getComputedStyle(g).position&&(y=!0),v=!0,a.PageStore.on("window_resize",E);let e=0,t=0,n=0;!function r(){const i=g.offsetTop+g.offsetHeight;i!==n?n=i:t+=1,e+=1,10>t&&50>e&&setTimeout(r,10),E()}()}function E(){let e=g,t=u.offsetHeight;y&&(t+=e.offsetHeight,e=e.previousSibling),c(!(e.offsetTop+e.offsetHeight+t>window.innerHeight-n.current.offsetTop))}function _(e){e.preventDefault(),e.stopPropagation(),t()}return(0,r.useEffect)(()=>{s(!0),setTimeout(b,20)},[e]),(0,r.useEffect)(()=>{(e||o)&&b();const t=document.querySelector(".page-sidebar-content-overlay");return t&&t.addEventListener("click",_),()=>{v&&a.PageStore.removeListener("window_resize",E),t&&t.removeEventListener("click",_)}},[]),r.createElement("div",{ref:n,className:"page-sidebar"+(l?" fixed-bottom":"")},r.createElement("div",{className:"page-sidebar-inner"},e||o?r.createElement(r.Fragment,null,r.createElement(d,null),r.createElement(h,null),r.createElement(p.SidebarThemeSwitcher,null),r.createElement(f,null),r.createElement(m,null)):null))}},821:function(e){"use strict";var t=function(e){return e!=e};e.exports=function(e,n){return 0===e&&0===n?1/e==1/n:e===n||!(!t(e)||!t(n))}},837:function(e,t,n){"use strict";var r=n(7067),i=n(1277),a=n(1724),o=n(5927);e.exports=function(e){var t=a(arguments),n=e.length-(arguments.length-1);return r(t,1+(n>0?n:0),!0)},i?i(e.exports,"apply",{value:o}):e.exports.apply=o},878:function(e,t,n){"use strict";n.d(t,{c:function(){return c}});var r=n(9471),i=n(8713),a=n.n(i),o=n(6387),s=n(5321),l=n(2828);function c(e){const{thumbnail:t}=(0,o.useUser)(),n={"aria-label":"Account profile photo that opens list of options and settings pages links",className:"thumbnail"};switch(e.isButton?void 0!==e.onClick&&(n.onClick=e.onClick):n.type="span",e.size){case"small":case"large":n.className+=" "+e.size+"-thumb"}return r.createElement(s.i,n,t?r.createElement("img",{src:t,alt:""}):r.createElement(l.Z,{type:"person"}))}c.propTypes={isButton:a().bool,size:a().oneOf(["small","medium","large"]),onClick:a().func},c.defaultProps={isButton:!1,size:"medium"}},977:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n(7143);function i(e,t){return r.register(e[t].bind(e)),e}},994:function(e,t,n){"use strict";var r=n(3616),i=n(5697);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function o(e,t){for(var n=0;n1?n-1:0),i=1;i1?n-1:0),i=1;i1?n-1:0),i=1;i1?n-1:0),i=1;i0){var r=t[0];r.focus(),r.setAttribute("tabindex","0")}}},[]),i.createElement("div",{"data-testid":"attachment__list",className:r.classNames({"rpv-attachment__list":!0,"rpv-attachment__list--rtl":o}),ref:n,tabIndex:-1,onKeyDown:function(e){switch(e.key){case"ArrowDown":e.preventDefault(),c(function(e,t){return e.indexOf(t)+1});break;case"ArrowUp":e.preventDefault(),c(function(e,t){return e.indexOf(t)-1});break;case"End":e.preventDefault(),c(function(e,t){return e.length-1});break;case"Home":e.preventDefault(),c(function(e,t){return 0})}}},t.map(function(e){return i.createElement("button",{className:"rpv-attachment__item",key:e.fileName,tabIndex:-1,title:l,type:"button",onClick:function(){return t=e.fileName,r="string"==typeof(n=e.data)?"":URL.createObjectURL(new Blob([n],{type:""})),(i=document.createElement("a")).style.display="none",i.href=r||t,i.setAttribute("download",function(e){var t=e.split("/").pop();return t?t.split("#")[0].split("?")[0]:e}(t)),document.body.appendChild(i),i.click(),document.body.removeChild(i),void(r&&URL.revokeObjectURL(r));var t,n,r,i}},e.fileName)}))},o=function(e){var t=e.doc,n=i.useContext(r.LocalizationContext).l10n,o=i.useContext(r.ThemeContext).direction===r.TextDirection.RightToLeft,s=n&&n.attachment?n.attachment.noAttachment:"There is no attachment",l=i.useState({files:[],isLoaded:!1}),c=l[0],u=l[1];return i.useEffect(function(){t.getAttachments().then(function(e){var t=e?Object.keys(e).map(function(t){return{data:e[t].content,fileName:e[t].filename}}):[];u({files:t,isLoaded:!0})})},[t]),c.isLoaded?0===c.files.length?i.createElement("div",{"data-testid":"attachment__empty",className:r.classNames({"rpv-attachment__empty":!0,"rpv-attachment__empty--rtl":o})},s):i.createElement(a,{files:c.files}):i.createElement(r.Spinner,null)},s=function(e){var t=e.store,n=i.useState(t.get("doc")),a=n[0],s=n[1],l=function(e){s(e)};return i.useEffect(function(){return t.subscribe("doc",l),function(){t.unsubscribe("doc",l)}},[]),a?i.createElement(o,{doc:a}):i.createElement("div",{className:"rpv-attachment__loader"},i.createElement(r.Spinner,null))};t.attachmentPlugin=function(){var e=i.useMemo(function(){return r.createStore({})},[]);return{onDocumentLoad:function(t){e.update("doc",t.doc)},Attachments:function(){return i.createElement(s,{store:e})}}}},1134:function(e,t,n){"use strict";function r(){return document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1")}function i(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," ")}function a(e,t){e.classList?e.classList.add(t):e.className+=" "+t}function o(e,t){return e.className&&new RegExp("(\\s|^)"+t+"(\\s|$)").test(e.className)}n.d(t,{CX:function(){return o},GT:function(){return c},kN:function(){return r},qk:function(){return i},uU:function(){return s},xi:function(){return l},zc:function(){return a}});const s=window.cancelAnimationFrame||window.mozCancelAnimationFrame,l=window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame;function c(){const e={document:{visibility:[]},window:{resize:[],scroll:[]}};return document.addEventListener("visibilitychange",function(){e.document.visibility.map(e=>e())}),window.addEventListener("resize",function(){e.window.resize.map(e=>e())}),window.addEventListener("scroll",function(){e.window.scroll.map(e=>e())}),{doc:function(t){"function"==typeof t&&e.document.visibility.push(t)},win:function(t,n){"function"==typeof t&&e.window.resize.push(t),"function"==typeof n&&e.window.scroll.push(n)}}}},1177:function(e,t,n){"use strict";n.d(t,{A:function(){return E}});var r=n(9471),i=n(8713),a=n.n(i),o=n(5338),s=n(8790),l=n(7460),c=n(285),u=n(7664),d=n(5289),h=n(1838),f=n(5697);class p extends r.PureComponent{constructor(e){super(e),this.state={visibleForm:!1,queryVal:l.ProfilePageStore.get("author-query")||""},this.onChange=this.onChange.bind(this),this.onInputFocus=this.onInputFocus.bind(this),this.onInputBlur=this.onInputBlur.bind(this),this.showForm=this.showForm.bind(this),this.hideForm=this.hideForm.bind(this),this.onFormSubmit=this.onFormSubmit.bind(this),this.updateTimeout=null,this.pendingUpdate=!1}updateQuery(e){this.pendingUpdateValue=null,this.setState({queryVal:e},function(){"function"==typeof this.props.onQueryChange&&this.props.onQueryChange(this.state.queryVal)})}onChange(e){this.pendingEvent=e,this.setState({queryVal:e.target.value||""},function(){this.updateTimeout||(this.pendingEvent=null,"function"==typeof this.props.onQueryChange&&this.props.onQueryChange(this.state.queryVal),this.updateTimeout=setTimeout(function(){this.updateTimeout=null,this.pendingEvent&&this.onChange(this.pendingEvent)}.bind(this),100))})}onInputFocus(){}onInputBlur(){this.hideForm()}showForm(){this.setState({visibleForm:!0},function(){"function"==typeof this.props.toggleSearchField&&this.props.toggleSearchField()})}hideForm(){this.setState({visibleForm:!1},function(){"function"==typeof this.props.toggleSearchField&&this.props.toggleSearchField()})}onFormSubmit(e){""===this.refs.SearchInput.value.trim()&&(e.preventDefault(),e.stopPropagation())}render(){return this.state.visibleForm?r.createElement("form",{method:"get",action:s.LinksContext._currentValue.profile.media,onSubmit:this.onFormSubmit},r.createElement("span",null,r.createElement(u.CircleIconButton,{buttonShadow:!1},r.createElement("i",{className:"material-icons"},"search"))),r.createElement("span",null,r.createElement("input",{autoFocus:!0,ref:"SearchInput",type:"text",name:"aq",placeholder:"Search","aria-label":"Search",value:this.state.queryVal,onChange:this.onChange,onFocus:this.onInputFocus,onBlur:this.onInputBlur}))):r.createElement("div",null,r.createElement("span",null,r.createElement(u.CircleIconButton,{buttonShadow:!1,onClick:this.showForm},r.createElement("i",{className:"material-icons"},"search"))))}}function m(e){return r.createElement("li",{className:e.isActive?"active":null},r.createElement("a",{href:e.link,title:e.label},e.label))}p.propTypes={onQueryChange:a().func},p.defaultProps={},m.propTypes={id:a().string.isRequired,label:a().string.isRequired,link:a().string.isRequired,isActive:a().bool.isRequired};class g extends r.PureComponent{constructor(e){super(e),this.state={displayNext:!1,displayPrev:!1},this.inlineSlider=null,this.nextSlide=this.nextSlide.bind(this),this.prevSlide=this.prevSlide.bind(this),this.updateSlider=this.updateSlider.bind(this,!1),this.onToggleSearchField=this.onToggleSearchField.bind(this),l.PageStore.on("window_resize",this.updateSlider),this.sliderRecalTimeout=null,l.PageStore.on("changed_page_sidebar_visibility",function(){clearTimeout(this.sliderRecalTimeout),this.sliderRecalTimeout=setTimeout(function(){this.updateSliderButtonsView(),this.sliderRecalTimeout=setTimeout(function(){this.sliderRecalTimeout=null,this.updateSlider()}.bind(this),50)}.bind(this),150)}.bind(this)),this.previousBtn=r.createElement("span",{className:"previous-slide"},r.createElement(u.CircleIconButton,{buttonShadow:!1,onClick:this.prevSlide},r.createElement("i",{className:"material-icons"},"keyboard_arrow_left"))),this.nextBtn=r.createElement("span",{className:"next-slide"},r.createElement(u.CircleIconButton,{buttonShadow:!1,onClick:this.nextSlide},r.createElement("i",{className:"material-icons"},"keyboard_arrow_right"))),this.userIsAuthor=!s.MemberContext._currentValue.is.anonymous&&l.ProfilePageStore.get("author-data").username===s.MemberContext._currentValue.username}componentDidMount(){this.updateSlider()}nextSlide(){this.inlineSlider.nextSlide(),this.updateSliderButtonsView(),this.inlineSlider.scrollToCurrentSlide()}prevSlide(){this.inlineSlider.previousSlide(),this.updateSliderButtonsView(),this.inlineSlider.scrollToCurrentSlide()}updateSlider(e){this.inlineSlider||(this.inlineSlider=new d.A(this.refs.itemsListWrap,".profile-nav ul li")),this.inlineSlider.updateDataState(document.querySelectorAll(".profile-nav ul li").length,!0,!e),this.updateSliderButtonsView(),this.pendingChangeSlide&&(this.pendingChangeSlide=!1,this.inlineSlider.scrollToCurrentSlide())}updateSliderButtonsView(){this.setState({displayPrev:this.inlineSlider.hasPreviousSlide(),displayNext:this.inlineSlider.hasNextSlide()})}onToggleSearchField(){this.updateSlider()}render(){return r.createElement("nav",{ref:"tabsNav",className:"profile-nav items-list-outer list-inline list-slider"},r.createElement("div",{className:"profile-nav-inner items-list-outer"},this.state.displayPrev?this.previousBtn:null,r.createElement("ul",{className:"items-list-wrap",ref:"itemsListWrap"},r.createElement(m,{id:"about",isActive:"about"===this.props.type,label:(0,h.translateString)("About"),link:s.LinksContext._currentValue.profile.about}),r.createElement(m,{id:"media",isActive:"media"===this.props.type,label:(0,h.translateString)("Media"),link:s.LinksContext._currentValue.profile.media}),s.MemberContext._currentValue.can.saveMedia?r.createElement(m,{id:"playlists",isActive:"playlists"===this.props.type,label:(0,h.translateString)("Playlists"),link:s.LinksContext._currentValue.profile.playlists}):null,l.PageStore.get("config-options").pages.profile.includeHistory&&this.userIsAuthor?r.createElement(m,{id:"history",isActive:"history"===this.props.type,label:l.PageStore.get("config-enabled").pages.history.title,link:s.LinksContext._currentValue.user.history}):null,l.PageStore.get("config-options").pages.profile.includeLikedMedia&&this.userIsAuthor?r.createElement(m,{id:"liked",isActive:"liked"===this.props.type,label:l.PageStore.get("config-enabled").pages.liked.title,link:s.LinksContext._currentValue.user.liked}):null,r.createElement("li",{className:"media-search"},r.createElement(p,{onQueryChange:this.props.onQueryChange,toggleSearchField:this.onToggleSearchField}))),this.state.displayNext?this.nextBtn:null))}}function v(e){let t=e.link;return window.MediaCMS.site.devEnv&&(t="/edit-channel.html"),r.createElement("a",{href:t,className:"edit-channel",title:"Add banner"},"ADD BANNER")}function y(e){let t=e.link;return window.MediaCMS.site.devEnv&&(t="/edit-channel.html"),r.createElement("a",{href:t,className:"edit-channel",title:"Edit banner"},"EDIT BANNER")}function b(e){let t=e.link;return window.MediaCMS.site.devEnv&&(t="/edit-profile.html"),r.createElement("a",{href:t,className:"edit-profile",title:"Edit profile"},"EDIT PROFILE")}function E(e){const[t,n,i]=(0,o.usePopup)(),a=(0,r.useRef)(null),d=(0,r.useRef)(null),[h,p]=(0,r.useState)(!1),m={profileNavTop:0},E=!s.MemberContext._currentValue.is.anonymous&&s.MemberContext._currentValue.is.admin,_=!s.MemberContext._currentValue.is.anonymous&&l.ProfilePageStore.get("author-data").username===s.MemberContext._currentValue.username,w=_||!s.MemberContext._currentValue.is.anonymous&&s.MemberContext._currentValue.can.editProfile,S=E||_||!s.MemberContext._currentValue.is.anonymous&&s.MemberContext._currentValue.can.deleteProfile;function C(){m.profileHeaderTop=a.current.offsetTop,m.profileNavTop=m.profileHeaderTop+a.current.offsetHeight-d.current.refs.tabsNav.offsetHeight}function k(){p(m.profileHeaderTop+window.scrollY>m.profileNavTop)}function A(e){setTimeout(function(){c.PageActions.addNotification("Profile removed. Redirecting...","profileDelete"),setTimeout(function(){window.location.href=s.SiteContext._currentValue.url},2e3)},100),void 0!==e&&f.info("Removed user's profile '"+e+'"')}function x(e){setTimeout(function(){c.PageActions.addNotification("Profile removal failed","profileDeleteFail")},100),void 0!==e&&f.info('Profile "'+e+'" removal failed')}function P(){C(),k()}function M(){k()}return(0,r.useEffect)(()=>(S&&(l.ProfilePageStore.on("profile_delete",A),l.ProfilePageStore.on("profile_delete_fail",x)),l.PageStore.on("resize",P),l.PageStore.on("changed_page_sidebar_visibility",P),l.PageStore.on("window_scroll",M),C(),k(),()=>{S&&(l.ProfilePageStore.removeListener("profile_delete",A),l.ProfilePageStore.removeListener("profile_delete_fail",x)),l.PageStore.removeListener("resize",P),l.PageStore.removeListener("changed_page_sidebar_visibility",P),l.PageStore.removeListener("window_scroll",M)}),[]),r.createElement("div",{ref:a,className:"profile-page-header"+(h?" fixed-nav":"")},r.createElement("span",{className:"profile-banner-wrap"},e.author.banner_thumbnail_url?r.createElement("span",{className:"profile-banner",style:{backgroundImage:"url("+s.SiteContext._currentValue.url+"/"+e.author.banner_thumbnail_url.replace(/^\//g,"")+")"}}):null,S?r.createElement("span",{className:"delete-profile-wrap"},r.createElement(i,{contentRef:t},r.createElement("button",{className:"delete-profile",title:""},"REMOVE PROFILE")),r.createElement(n,{contentRef:t},r.createElement(u.PopupMain,null,r.createElement("div",{className:"popup-message"},r.createElement("span",{className:"popup-message-title"},"Profile removal"),r.createElement("span",{className:"popup-message-main"},"You're willing to remove profile permanently?")),r.createElement("hr",null),r.createElement("span",{className:"popup-message-bottom"},r.createElement("button",{className:"button-link cancel-profile-removal",onClick:function(){t.current.toggle()}},"CANCEL"),r.createElement("button",{className:"button-link proceed-profile-removal",onClick:function(){c.ProfilePageActions.remove_profile(),t.current.toggle()}},"PROCEED"))))):null,w?e.author.banner_thumbnail_url?r.createElement(y,{link:l.ProfilePageStore.get("author-data").default_channel_edit_url}):r.createElement(v,{link:l.ProfilePageStore.get("author-data").default_channel_edit_url}):null),r.createElement("div",{className:"profile-info-nav-wrap"},e.author.thumbnail_url||e.author.name?r.createElement("div",{className:"profile-info"},r.createElement("div",{className:"profile-info-inner"},r.createElement("div",null,e.author.thumbnail_url?r.createElement("img",{src:e.author.thumbnail_url,alt:""}):null),r.createElement("div",null,e.author.name?r.createElement("h1",null,e.author.name):null,w?r.createElement(b,{link:l.ProfilePageStore.get("author-data").edit_url}):null))):null,r.createElement(g,{ref:d,type:e.type,onQueryChange:e.onQueryChange})))}g.propTypes={type:a().string.isRequired,onQueryChange:a().func},E.propTypes={author:a().object.isRequired,type:a().string.isRequired,onQueryChange:a().func},E.defaultProps={type:"media"}},1254:function(e,t,n){"use strict";n.d(t,{z:function(){return w}});var r=n(9471),i=n(7460),a=n(5338),o=n(1838),s=n(8790),l=n(285),c=n(7664);function u(e,t,n){let r,i=[];for(n=!!n,r=0;rwindow.innerHeight-98,n=()=>o(t()),[a,o]=(0,r.useState)(t());return(0,r.useEffect)(()=>(i.PageStore.on("window_resize",n),()=>i.PageStore.removeListener("window_resize",n))),r.createElement("div",{className:"search-predictions-list",style:{maxHeight:a+"px"}},e.children||null)}function h(e){const t=(0,r.useRef)(null);function n(t){let n;switch(t.keyCode||t.charCode){case 13:i();break;case 38:n=e.itemsDomArray(e.previousIndex);break;case 40:n=e.itemsDomArray(e.nextIndex)}void 0!==n&&(n.focus(),t.preventDefault(),t.stopPropagation())}function i(){e.onSelect instanceof Function&&e.onSelect(e.value)}return(0,r.useEffect)(()=>{e.onPredictionItemLoad(e.index,t.current)}),r.createElement("div",{ref:t,tabIndex:"0",className:"search-predictions-item",onFocus:function(e){e.target.onkeydown=n},onBlur:function(e){e.target.onkeydown=null},onClick:i},r.createElement("span",{dangerouslySetInnerHTML:{__html:e.children||""}}))}function f(e){const t=(0,r.useRef)(null),n=(0,r.useRef)(null),[f,p,m]=(0,a.usePopup)(),[g,v]=(0,r.useState)([]),[y,b]=(0,r.useState)([]),[E,_]=(0,r.useState)(i.SearchFieldStore.get("search-query")),{visibleMobileSearch:w}=(0,a.useLayout)();function S(e){return-1===e?t.current:g[e]}function C(e){let t=!1;switch(e.keyCode||e.charCode){case 38:t=S(y.length-1);break;case 40:t=S(0)}t&&(t.focus(),e.preventDefault(),e.stopPropagation())}function k(e){b([]),_(e),setTimeout(function(){n.current.submit()},50)}function A(e,t){const n=g;n[e]=t,v(n)}function x(e,t){let n,i,a,o,s,l,c,d=[];if(e){for(a=[],n=0;n=0;)o=o.substring(0,s[i])+""+o.substring(s[i],s[i]+e.length)+""+o.substring(s[i]+e.length),i--;a.push([t[n],o]),n+=1}for(n=0;n{w&&t.current.focus()},[w]),(0,r.useEffect)(()=>{y.length?(t.current.onkeydown=t.current.onkeydown||C,f.current.tryToShow()):(t.current.onkeydown=null,f.current.tryToHide())},[y]),(0,r.useEffect)(()=>(i.SearchFieldStore.on("load_predictions",x),()=>{i.SearchFieldStore.removeListener("load_predictions",x)}),[]),r.createElement("div",{className:"search-field-wrap"},r.createElement("div",null,r.createElement("form",{ref:n,method:"get",action:s.LinksContext._currentValue.search.base,autoComplete:"off",onSubmit:function(e){""===t.current.value.trim()&&(e.preventDefault(),e.stopPropagation())}},r.createElement("div",null,r.createElement("div",{className:"text-field-wrap"},r.createElement("input",{ref:t,type:"text",placeholder:(0,o.translateString)("Search"),"aria-label":"Search",name:"q",value:E,onChange:function(e){let t=e.target.value;t="string"!=typeof t?t.toString():t,_(t),""!==t.trim()&&l.SearchFieldActions.requestPredictions(t.trim())},onFocus:function(){y.length&&(t.current.onkeydown=t.current.onkeydown||C)},onBlur:function(){t.current.onkeydown=null}}),r.createElement(p,{contentRef:f,hideCallback:function(){b([])}},r.createElement(c.PopupMain,null,r.createElement(d,null,y)))),r.createElement("button",{type:"submit","aria-label":"Search"},r.createElement(c.MaterialIcon,{type:"search"}))))))}function p(){const{currentThemeMode:e,changeThemeMode:t}=(0,a.useTheme)(),n=(0,r.useRef)(null);return r.createElement("div",{className:"theme-switch",tabIndex:0,onKeyPress:function(e){0===e.keyCode&&t()},onClick:function(e){e.target!==n.current&&t()}},r.createElement("span",null,"Dark Theme"),r.createElement("span",null,r.createElement("label",{className:"checkbox-label right-selectbox"},r.createElement("span",{className:"checkbox-switcher-wrap"},r.createElement("span",{className:"checkbox-switcher"},r.createElement("input",{ref:n,type:"checkbox",tabIndex:-1,checked:"dark"===e,onChange:function(e){e.stopPropagation(),t()}}))))))}function m(e,t,n){const i={main:null};if(e.is.anonymous)i.main=r.createElement("div",null,r.createElement(c.PopupMain,null,r.createElement(c.NavigationMenuList,{items:t.middle})));else{const a=[];function o(e,t){t.length&&(a.length&&a.push(r.createElement("hr",{key:e+"-nav-seperator"})),a.push(r.createElement(c.NavigationMenuList,{key:e+"-nav",items:t})))}o("top",t.top),o("middle",t.middle),o("bottom",t.bottom),i.main=r.createElement("div",null,r.createElement(c.PopupTop,null,r.createElement("a",{className:"user-menu-top-link",href:e.pages.about,title:e.username},r.createElement("span",null,r.createElement(c.UserThumbnail,{size:"medium"})),r.createElement("span",null,r.createElement("span",{className:"username"},e?.name||e?.email||e?.username||"User")))),a.length?r.createElement(c.PopupMain,null,a):null)}return n&&(i["switch-theme"]=r.createElement("div",null,r.createElement(c.PopupTop,null,r.createElement("div",null,r.createElement("span",null,r.createElement(c.CircleIconButton,{className:"menu-item-icon change-page","data-page-id":"main","aria-label":"Switch theme"},r.createElement("i",{className:"material-icons"},"arrow_back"))),r.createElement("span",null,"Switch theme"))),r.createElement(c.PopupMain,null,r.createElement(p,null)))),i}function g({user:e,links:t}){const[n,i,s]=(0,a.usePopup)(),l=[{link:t.user.addMedia,icon:"upload",text:(0,o.translateString)("Upload")},{link:"/record_screen",icon:"videocam",text:(0,o.translateString)("Record Screen")}];return!e.is.anonymous&&e.can.addMedia?r.createElement("div",null,r.createElement(s,{contentRef:n},r.createElement(c.CircleIconButton,{title:(0,o.translateString)("Upload media")},r.createElement(c.MaterialIcon,{type:"video_call"}),r.createElement("span",{className:"hidden-txt"},(0,o.translateString)("Upload media")))),r.createElement(i,{contentRef:n},r.createElement(c.PopupMain,null,r.createElement(c.NavigationMenuList,{items:l})))):null}function v({user:e,link:t,hasHeaderThemeSwitcher:n}){return e.is.anonymous&&e.can.login?r.createElement("div",{className:"sign-in-wrap"},r.createElement("a",{href:t,rel:"noffolow",className:"button-link sign-in"+(n?" hidden-only-in-small":" hidden-only-in-extra-small"),title:(0,o.translateString)("Sign in")},(0,o.translateString)("Sign in"))):null}function y({user:e,link:t,hasHeaderThemeSwitcher:n}){return e.is.anonymous&&e.can.register?r.createElement("div",{className:"register-wrap"},r.createElement("a",{href:t,className:"button-link register-link"+(n?" hidden-only-in-small":" hidden-only-in-extra-small"),title:(0,o.translateString)("Register")},(0,o.translateString)("Register"))):null}function b(e){const{toggleMobileSearch:t}=(0,a.useLayout)(),[n,o,l]=(0,a.usePopup)();return r.createElement(s.HeaderConsumer,null,e=>r.createElement(s.MemberConsumer,null,a=>r.createElement(s.LinksConsumer,null,s=>r.createElement("div",{className:"page-header-right"},r.createElement("div",null,r.createElement("div",{className:"mobile-search-toggle"},r.createElement(c.CircleIconButton,{onClick:t,"aria-label":"Search"},r.createElement(c.MaterialIcon,{type:"search"}))),r.createElement(g,{user:a,links:s}),r.createElement("div",{className:(a.is.anonymous?"user-options":"user-thumb")+(!a.is.anonymous||e.hasThemeSwitcher?"":" visible-only-in-extra-small")},r.createElement(l,{contentRef:n},a.is.anonymous?r.createElement(c.CircleIconButton,{"aria-label":"Settings"},r.createElement(c.MaterialIcon,{type:"more_vert"})):r.createElement(c.UserThumbnail,{size:"small",isButton:!0})),r.createElement(o,{contentRef:n},r.createElement(c.NavigationContentApp,{initPage:"main",pages:m(a,e.popupNavItems,e.hasThemeSwitcher),pageChangeSelector:".change-page",pageIdSelectorAttr:"data-page-id"}))),r.createElement(v,{user:a,link:s.signin,hasHeaderThemeSwitcher:e.hasThemeSwitcher}),r.createElement(y,{user:a,link:s.register,hasHeaderThemeSwitcher:e.hasThemeSwitcher}),i.PageStore.get("config-contents").header.right?r.createElement("div",{className:"on-header-right",dangerouslySetInnerHTML:{__html:i.PageStore.get("config-contents").header.right}}):null)))))}const E=({src:e,loading:t="lazy",title:n,alt:i,href:a="#"})=>e?r.createElement("div",{className:"logo"},r.createElement("a",{href:a,title:n},r.createElement("span",null,r.createElement("img",{src:e,alt:i||n,title:n,loading:t})))):null;function _(){const{logo:e}=(0,a.useTheme)(),{enabledSidebar:t,toggleMobileSearch:n,toggleSidebar:o}=(0,a.useLayout)();return r.createElement(s.SiteConsumer,null,a=>r.createElement(s.LinksConsumer,null,s=>r.createElement("div",{className:"page-header-left"},r.createElement("div",null,r.createElement("div",{className:"close-search-field"},r.createElement(c.CircleIconButton,{onClick:n},r.createElement("i",{className:"material-icons"},"arrow_back"))),t?r.createElement("div",{className:"toggle-sidebar"},r.createElement(c.CircleIconButton,{onClick:o},r.createElement("i",{className:"material-icons"},"menu"))):null,r.createElement(E,{src:e,href:s.home,title:a.title}),i.PageStore.get("config-contents").header.onLogoRight?r.createElement("div",{className:"on-logo-right",dangerouslySetInnerHTML:{__html:i.PageStore.get("config-contents").header.onLogoRight}}):null))))}function w(e){const{isAnonymous:t}=(0,a.useUser)(),{visibleMobileSearch:n}=(0,a.useLayout)();return(0,r.useEffect)(()=>{!function(){function e(){const e=this.parentNode;(0,o.addClassname)(e,"hiding"),setTimeout(function(){e&&e.parentNode&&e.parentNode.removeChild(e)}.bind(this),400)}setTimeout(function(){const t=document.querySelectorAll(".alert.alert-dismissible .close");let n;if(t.length)for(n=0;n(()=>{"use strict";var __webpack_modules__=[,(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VerbosityLevel=t.Util=t.UnknownErrorException=t.UnexpectedResponseException=t.UNSUPPORTED_FEATURES=t.TextRenderingMode=t.RenderingIntentFlag=t.PermissionFlag=t.PasswordResponses=t.PasswordException=t.PageActionEventType=t.OPS=t.MissingPDFException=t.LINE_FACTOR=t.LINE_DESCENT_FACTOR=t.InvalidPDFException=t.ImageKind=t.IDENTITY_MATRIX=t.FormatError=t.FeatureTest=t.FONT_IDENTITY_MATRIX=t.DocumentActionEventType=t.CMapCompressionType=t.BaseException=t.BASELINE_FACTOR=t.AnnotationType=t.AnnotationStateModelType=t.AnnotationReviewState=t.AnnotationReplyType=t.AnnotationMode=t.AnnotationMarkedState=t.AnnotationFlag=t.AnnotationFieldFlag=t.AnnotationEditorType=t.AnnotationEditorPrefix=t.AnnotationEditorParamsType=t.AnnotationBorderStyleType=t.AnnotationActionEventType=t.AbortException=void 0,t.assert=function(e,t){e||a(t)},t.bytesToString=function(e){"object"==typeof e&&null!==e&&void 0!==e.length||a("Invalid argument for bytesToString");const t=e.length,n=8192;if(t=2&&(e=`http://${e}`)}if(n.tryConvertEncoding)try{e=h(e)}catch(e){}}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.getModificationDate=function(e=new Date){return[e.getUTCFullYear().toString(),(e.getUTCMonth()+1).toString().padStart(2,"0"),e.getUTCDate().toString().padStart(2,"0"),e.getUTCHours().toString().padStart(2,"0"),e.getUTCMinutes().toString().padStart(2,"0"),e.getUTCSeconds().toString().padStart(2,"0")].join("")},t.getVerbosityLevel=function(){return r},t.info=function(e){r>=n.INFOS&&console.log(`Info: ${e}`)},t.isArrayBuffer=function(e){return"object"==typeof e&&null!==e&&void 0!==e.byteLength},t.isArrayEqual=function(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n>24&255,e>>16&255,e>>8&255,255&e)},t.stringToBytes=l,t.stringToPDFString=function(e){if(e[0]>="ï"){let t;if("þ"===e[0]&&"ÿ"===e[1]?t="utf-16be":"ÿ"===e[0]&&"þ"===e[1]?t="utf-16le":"ï"===e[0]&&"»"===e[1]&&"¿"===e[2]&&(t="utf-8"),t)try{const n=new TextDecoder(t,{fatal:!0}),r=l(e);return n.decode(r)}catch(e){i(`stringToPDFString: "${e}".`)}}const t=[];for(let n=0,r=e.length;n=n.WARNINGS&&console.log(`Warning: ${e}`)}function a(e){throw new Error(e)}function o(e,t,n,r=!1){return Object.defineProperty(e,t,{value:n,enumerable:!r,configurable:!0,writable:!1}),n}const s=function(){function e(t,n){this.constructor===e&&a("Cannot initialize BaseException."),this.message=t,this.name=n}return e.prototype=new Error,e.constructor=e,e}();function l(e){"string"!=typeof e&&a("Invalid argument for stringToBytes");const t=e.length,n=new Uint8Array(t);for(let r=0;re.toString(16).padStart(2,"0"));class u{static makeHexColor(e,t,n){return`#${c[e]}${c[t]}${c[n]}`}static scaleMinMax(e,t){let n;e[0]?(e[0]<0&&(n=t[0],t[0]=t[1],t[1]=n),t[0]*=e[0],t[1]*=e[0],e[3]<0&&(n=t[2],t[2]=t[3],t[3]=n),t[2]*=e[3],t[3]*=e[3]):(n=t[0],t[0]=t[2],t[2]=n,n=t[1],t[1]=t[3],t[3]=n,e[1]<0&&(n=t[2],t[2]=t[3],t[3]=n),t[2]*=e[1],t[3]*=e[1],e[2]<0&&(n=t[0],t[0]=t[1],t[1]=n),t[0]*=e[2],t[1]*=e[2]),t[0]+=e[4],t[1]+=e[4],t[2]+=e[5],t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static applyTransform(e,t){return[e[0]*t[0]+e[1]*t[2]+t[4],e[0]*t[1]+e[1]*t[3]+t[5]]}static applyInverseTransform(e,t){const n=t[0]*t[3]-t[1]*t[2];return[(e[0]*t[3]-e[1]*t[2]+t[2]*t[5]-t[4]*t[3])/n,(-e[0]*t[1]+e[1]*t[0]+t[4]*t[1]-t[5]*t[0])/n]}static getAxialAlignedBoundingBox(e,t){const n=u.applyTransform(e,t),r=u.applyTransform(e.slice(2,4),t),i=u.applyTransform([e[0],e[3]],t),a=u.applyTransform([e[2],e[1]],t);return[Math.min(n[0],r[0],i[0],a[0]),Math.min(n[1],r[1],i[1],a[1]),Math.max(n[0],r[0],i[0],a[0]),Math.max(n[1],r[1],i[1],a[1])]}static inverseTransform(e){const t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e){const t=[e[0],e[2],e[1],e[3]],n=e[0]*t[0]+e[1]*t[2],r=e[0]*t[1]+e[1]*t[3],i=e[2]*t[0]+e[3]*t[2],a=e[2]*t[1]+e[3]*t[3],o=(n+a)/2,s=Math.sqrt((n+a)**2-4*(n*a-i*r))/2,l=o+s||1,c=o-s||1;return[Math.sqrt(l),Math.sqrt(c)]}static normalizeRect(e){const t=e.slice(0);return e[0]>e[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){const n=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),r=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(n>r)return null;const i=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),a=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return i>a?null:[n,i,r,a]}static bezierBoundingBox(e,t,n,r,i,a,o,s){const l=[],c=[[],[]];let u,d,h,f,p,m,g,v;for(let c=0;c<2;++c)if(0===c?(d=6*e-12*n+6*i,u=-3*e+9*n-9*i+3*o,h=3*n-3*e):(d=6*t-12*r+6*a,u=-3*t+9*r-9*a+3*s,h=3*r-3*t),Math.abs(u)<1e-12){if(Math.abs(d)<1e-12)continue;f=-h/d,0{Object.defineProperty(exports,"__esModule",{value:!0}),exports.build=exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,exports.getDocument=getDocument,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(3),_display_utils=__w_pdfjs_require__(6),_font_loader=__w_pdfjs_require__(9),_canvas=__w_pdfjs_require__(11),_worker_options=__w_pdfjs_require__(14),_is_node=__w_pdfjs_require__(10),_message_handler=__w_pdfjs_require__(15),_metadata=__w_pdfjs_require__(16),_optional_content_config=__w_pdfjs_require__(17),_transport_stream=__w_pdfjs_require__(18),_xfa_text=__w_pdfjs_require__(19);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100;let DefaultCanvasFactory=_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;let DefaultCMapReaderFactory=_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;let DefaultStandardFontDataFactory=_display_utils.DOMStandardFontDataFactory,createPDFNetworkStream;if(exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory,_is_node.isNodeJS){const{NodeCanvasFactory:e,NodeCMapReaderFactory:t,NodeStandardFontDataFactory:n}=__w_pdfjs_require__(20);exports.DefaultCanvasFactory=DefaultCanvasFactory=e,exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory=t,exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory=n}if(_is_node.isNodeJS){const{PDFNodeStream:e}=__w_pdfjs_require__(21);createPDFNetworkStream=t=>new e(t)}else{const{PDFNetworkStream:e}=__w_pdfjs_require__(24),{PDFFetchStream:t}=__w_pdfjs_require__(25);createPDFNetworkStream=n=>(0,_display_utils.isValidFetchUrl)(n.url)?new t(n):new e(n)}function getDocument(e){if("string"==typeof e||e instanceof URL)e={url:e};else if((0,_util.isArrayBuffer)(e))e={data:e};else if(e instanceof PDFDataRangeTransport)(0,_display_utils.deprecated)("`PDFDataRangeTransport`-instance, please use a parameter object with `range`-property instead."),e={range:e};else if("object"!=typeof e)throw new Error("Invalid parameter in getDocument, need either string, URL, TypedArray, or parameter object.");if(!e.url&&!e.data&&!e.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const t=new PDFDocumentLoadingTask,n=e.url?getUrlProp(e.url):null,r=e.data?getDataProp(e.data):null,i=e.httpHeaders||null,a=!0===e.withCredentials,o=e.password??null,s=e.range instanceof PDFDataRangeTransport?e.range:null,l=Number.isInteger(e.rangeChunkSize)&&e.rangeChunkSize>0?e.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let c=e.worker instanceof PDFWorker?e.worker:null;const u=e.verbosity,d="string"!=typeof e.docBaseUrl||(0,_display_utils.isDataScheme)(e.docBaseUrl)?null:e.docBaseUrl,h="string"==typeof e.cMapUrl?e.cMapUrl:null,f=!1!==e.cMapPacked,p=e.CMapReaderFactory||DefaultCMapReaderFactory,m="string"==typeof e.standardFontDataUrl?e.standardFontDataUrl:null,g=e.StandardFontDataFactory||DefaultStandardFontDataFactory,v=!0!==e.stopAtErrors,y=Number.isInteger(e.maxImageSize)&&e.maxImageSize>-1?e.maxImageSize:-1,b=!1!==e.isEvalSupported,E="boolean"==typeof e.isOffscreenCanvasSupported?e.isOffscreenCanvasSupported:!_is_node.isNodeJS,_="boolean"==typeof e.disableFontFace?e.disableFontFace:_is_node.isNodeJS,w=!0===e.fontExtraProperties,S=!0===e.enableXfa,C=e.ownerDocument||globalThis.document,k=!0===e.disableRange,A=!0===e.disableStream,x=!0===e.disableAutoFetch,P=!0===e.pdfBug,M=s?s.length:e.length??NaN,T="boolean"==typeof e.useSystemFonts?e.useSystemFonts:!_is_node.isNodeJS&&!_,R="boolean"==typeof e.useWorkerFetch?e.useWorkerFetch:p===_display_utils.DOMCMapReaderFactory&&g===_display_utils.DOMStandardFontDataFactory&&(0,_display_utils.isValidFetchUrl)(h,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(m,document.baseURI);(0,_util.setVerbosityLevel)(u);const O=R?null:{cMapReaderFactory:new p({baseUrl:h,isCompressed:f}),standardFontDataFactory:new g({baseUrl:m})};if(!c){const e={verbosity:u,port:_worker_options.GlobalWorkerOptions.workerPort};c=e.port?PDFWorker.fromPort(e):new PDFWorker(e),t._worker=c}const I=t.docId,D={docId:I,apiVersion:"3.4.120",data:r,password:o,disableAutoFetch:x,rangeChunkSize:l,length:M,docBaseUrl:d,enableXfa:S,evaluatorOptions:{maxImageSize:y,disableFontFace:_,ignoreErrors:v,isEvalSupported:b,isOffscreenCanvasSupported:E,fontExtraProperties:w,useSystemFonts:T,cMapUrl:R?h:null,standardFontDataUrl:R?m:null}},L={ignoreErrors:v,isEvalSupported:b,disableFontFace:_,fontExtraProperties:w,enableXfa:S,ownerDocument:C,disableAutoFetch:x,pdfBug:P,styleElement:null};return c.promise.then(function(){if(t.destroyed)throw new Error("Loading aborted");const e=_fetchDocument(c,D),o=new Promise(function(e){let t;s?t=new _transport_stream.PDFDataTransportStream({length:M,initialData:s.initialData,progressiveDone:s.progressiveDone,contentDispositionFilename:s.contentDispositionFilename,disableRange:k,disableStream:A},s):r||(t=createPDFNetworkStream({url:n,length:M,httpHeaders:i,withCredentials:a,rangeChunkSize:l,disableRange:k,disableStream:A})),e(t)});return Promise.all([e,o]).then(function([e,n]){if(t.destroyed)throw new Error("Loading aborted");const r=new _message_handler.MessageHandler(I,e,c.port),i=new WorkerTransport(r,t,n,L,O);t._transport=i,r.send("Ready",null)})}).catch(t._capability.reject),t}async function _fetchDocument(e,t){if(e.destroyed)throw new Error("Worker was destroyed");const n=await e.messageHandler.sendWithPromise("GetDocRequest",t,t.data?[t.data.buffer]:null);if(e.destroyed)throw new Error("Worker was destroyed");return n}function getUrlProp(e){if(e instanceof URL)return e.href;try{return new URL(e,window.location).href}catch(t){if(_is_node.isNodeJS&&"string"==typeof e)return e}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(e){if(_is_node.isNodeJS&&void 0!==Buffer&&e instanceof Buffer)return(0,_display_utils.deprecated)("Please provide binary data as `Uint8Array`, rather than `Buffer`."),new Uint8Array(e);if(e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength)return e;if("string"==typeof e)return(0,_util.stringToBytes)(e);if("object"==typeof e&&!isNaN(e?.length)||(0,_util.isArrayBuffer)(e))return new Uint8Array(e);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}class PDFDocumentLoadingTask{static#e=0;#t=null;constructor(){this._capability=(0,_util.createPromiseCapability)(),this._transport=null,this._worker=null,this.docId="d"+PDFDocumentLoadingTask.#e++,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get onUnsupportedFeature(){return this.#t}set onUnsupportedFeature(e){(0,_display_utils.deprecated)("The PDFDocumentLoadingTask onUnsupportedFeature property will be removed in the future."),this.#t=e}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0,await(this._transport?.destroy()),this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(e,t,n=!1,r=null){this.length=e,this.initialData=t,this.progressiveDone=n,this.contentDispositionFilename=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 n of this._rangeListeners)n(e,t)}onDataProgress(e,t){this._readyCapability.promise.then(()=>{for(const n of this._progressListeners)n(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 annotationStorage(){return this._transport.annotationStorage}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}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()}getAttachments(){return this._transport.getAttachments()}getJavaScript(){return this._transport.getJavaScript()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(e,t,n,r,i=!1){this._pageIndex=e,this._pageInfo=t,this._ownerDocument=r,this._transport=n,this._stats=i?new _display_utils.StatTimer:null,this._pdfBug=i,this.commonObjs=n.commonObjs,this.objs=new PDFObjects,this.cleanupAfterRender=!1,this.pendingCleanup=!1,this._intentStates=new Map,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:n=0,offsetY:r=0,dontFlip:i=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:e,rotation:t,offsetX:n,offsetY:r,dontFlip:i})}getAnnotations({intent:e="display"}={}){const t=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,t.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:e,viewport:t,intent:n="display",annotationMode:r=_util.AnnotationMode.ENABLE,transform:i=null,canvasFactory:a=null,background:o=null,optionalContentConfigPromise:s=null,annotationCanvasMap:l=null,pageColors:c=null,printAnnotationStorage:u=null}){this._stats?.time("Overall");const d=this._transport.getRenderingIntent(n,r,u);this.pendingCleanup=!1,s||(s=this._transport.getOptionalContentConfig());let h=this._intentStates.get(d.cacheKey);h||(h=Object.create(null),this._intentStates.set(d.cacheKey,h)),h.streamReaderCancelTimeout&&(clearTimeout(h.streamReaderCancelTimeout),h.streamReaderCancelTimeout=null);const f=a||new DefaultCanvasFactory({ownerDocument:this._ownerDocument}),p=!!(d.renderingIntent&_util.RenderingIntentFlag.PRINT);h.displayReadyCapability||(h.displayReadyCapability=(0,_util.createPromiseCapability)(),h.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(d));const m=e=>{h.renderTasks.delete(g),(this.cleanupAfterRender||p)&&(this.pendingCleanup=!0),this._tryCleanup(),e?(g.capability.reject(e),this._abortOperatorList({intentState:h,reason:e instanceof Error?e:new Error(e)})):g.capability.resolve(),this._stats?.timeEnd("Rendering"),this._stats?.timeEnd("Overall")},g=new InternalRenderTask({callback:m,params:{canvasContext:e,viewport:t,transform:i,background:o},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:l,operatorList:h.operatorList,pageIndex:this._pageIndex,canvasFactory:f,useRequestAnimationFrame:!p,pdfBug:this._pdfBug,pageColors:c});(h.renderTasks||=new Set).add(g);const v=g.task;return Promise.all([h.displayReadyCapability.promise,s]).then(([e,t])=>{this.pendingCleanup?m():(this._stats?.time("Rendering"),g.initializeGraphics({transparency:e,optionalContentConfig:t}),g.operatorListChanged())}).catch(m),v}getOperatorList({intent:e="display",annotationMode:t=_util.AnnotationMode.ENABLE,printAnnotationStorage:n=null}={}){const r=this._transport.getRenderingIntent(e,t,n,!0);let i,a=this._intentStates.get(r.cacheKey);return a||(a=Object.create(null),this._intentStates.set(r.cacheKey,a)),a.opListReadCapability||(i=Object.create(null),i.operatorListChanged=function(){a.operatorList.lastChunk&&(a.opListReadCapability.resolve(a.operatorList),a.renderTasks.delete(i))},a.opListReadCapability=(0,_util.createPromiseCapability)(),(a.renderTasks||=new Set).add(i),a.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(r)),a.opListReadCapability.promise}streamTextContent({disableCombineTextItems:e=!1,includeMarkedContent:t=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,combineTextItems:!0!==e,includeMarkedContent:!0===t},{highWaterMark:100,size(e){return e.items.length}})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(e=>_xfa_text.XfaText.textContent(e));const t=this.streamTextContent(e);return new Promise(function(e,n){const r=t.getReader(),i={items:[],styles:Object.create(null)};!function t(){r.read().then(function({value:n,done:r}){r?e(i):(Object.assign(i.styles,n.styles),i.items.push(...n.items),t())},n)}()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const e=[];for(const t of this._intentStates.values())if(this._abortOperatorList({intentState:t,reason:new Error("Page was destroyed."),force:!0}),!t.opListReadCapability)for(const n of t.renderTasks)e.push(n.completed),n.cancel();return this.objs.clear(),this.pendingCleanup=!1,Promise.all(e)}cleanup(e=!1){return this.pendingCleanup=!0,this._tryCleanup(e)}_tryCleanup(e=!1){if(!this.pendingCleanup)return!1;for(const{renderTasks:e,operatorList:t}of this._intentStates.values())if(e.size>0||!t.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),e&&this._stats&&(this._stats=new _display_utils.StatTimer),this.pendingCleanup=!1,!0}_startRenderPage(e,t){const n=this._intentStates.get(t);n&&(this._stats?.timeEnd("Page Request"),n.displayReadyCapability?.resolve(e))}_renderPageChunk(e,t){for(let n=0,r=e.length;n{r.read().then(({value:e,done:t})=>{t?i.streamReader=null:this._transport.destroyed||(this._renderPageChunk(e,i),a())},e=>{if(i.streamReader=null,!this._transport.destroyed){if(i.operatorList){i.operatorList.lastChunk=!0;for(const e of i.renderTasks)e.operatorListChanged();this._tryCleanup()}if(i.displayReadyCapability)i.displayReadyCapability.reject(e);else{if(!i.opListReadCapability)throw e;i.opListReadCapability.reject(e)}}})};a()}_abortOperatorList({intentState:e,reason:t,force:n=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!n){if(e.renderTasks.size>0)return;if(t instanceof _display_utils.RenderingCancelledException){let n=RENDERING_CANCELLED_TIMEOUT;return t.extraDelay>0&&t.extraDelay<1e3&&(n+=t.extraDelay),void(e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:t,force:!0})},n))}}if(e.streamReader.cancel(new _util.AbortException(t.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(const[t,n]of this._intentStates)if(n===e){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{#n=new Set;#r=Promise.resolve();postMessage(e,t){const n={data:structuredClone(e,t)};this.#r.then(()=>{for(const e of this.#n)e.call(this,n)})}addEventListener(e,t){this.#n.add(t)}removeEventListener(e,t){this.#n.delete(t)}terminate(){this.#n.clear()}}exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};if(exports.PDFWorkerUtil=PDFWorkerUtil,_is_node.isNodeJS)PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if("object"==typeof document){const e=document?.currentScript?.src;e&&(PDFWorkerUtil.fallbackWorkerSrc=e.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(e,t){let n;try{if(n=new URL(e),!n.origin||"null"===n.origin)return!1}catch(e){return!1}const r=new URL(t,n);return n.origin===r.origin},PDFWorkerUtil.createCDNWrapper=function(e){const t=`importScripts("${e}");`;return URL.createObjectURL(new Blob([t]))};class PDFWorker{static#i=new WeakMap;constructor({name:e=null,port:t=null,verbosity:n=(0,_util.getVerbosityLevel)()}={}){if(t&&PDFWorker.#i.has(t))throw new Error("Cannot use more than one PDFWorker per port.");if(this.name=e,this.destroyed=!1,this.verbosity=n,this._readyCapability=(0,_util.createPromiseCapability)(),this._port=null,this._webWorker=null,this._messageHandler=null,t)return PDFWorker.#i.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(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:e}=PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,e)||(e=PDFWorkerUtil.createCDNWrapper(new URL(e,window.location).href));const t=new Worker(e),n=new _message_handler.MessageHandler("main","worker",t),r=()=>{t.removeEventListener("error",i),n.destroy(),t.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},i=()=>{this._webWorker||r()};t.addEventListener("error",i),n.on("test",e=>{t.removeEventListener("error",i),this.destroyed?r():e?(this._messageHandler=n,this._port=t,this._webWorker=t,this._readyCapability.resolve(),n.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),n.destroy(),t.terminate())}),n.on("ready",e=>{if(t.removeEventListener("error",i),this.destroyed)r();else try{a()}catch(e){this._setupFakeWorker()}});const a=()=>{const e=new Uint8Array;n.send("test",e,[e.buffer])};return void a()}catch(e){(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),PDFWorker._setupFakeWorkerGlobal.then(e=>{if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));const t=new LoopbackPort;this._port=t;const n="fake"+PDFWorkerUtil.fakeWorkerId++,r=new _message_handler.MessageHandler(n+"_worker",n,t);e.setup(r,t);const i=new _message_handler.MessageHandler(n,n+"_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),PDFWorker.#i.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(e){if(!e?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return this.#i.has(e.port)?this.#i.get(e.port):new PDFWorker(e)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(null!==PDFWorkerUtil.fallbackWorkerSrc)return _is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch(e){return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node.isNodeJS){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}}exports.PDFWorker=PDFWorker;class WorkerTransport{#a=new Map;#o=new Map;#s=new Map;constructor(e,t,n,r,i){this.messageHandler=e,this.loadingTask=t,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({onUnsupportedFeature:this._onUnsupportedFeature.bind(this),ownerDocument:r.ownerDocument,styleElement:r.styleElement}),this._params=r,this.cMapReaderFactory=i?.cMapReaderFactory,this.standardFontDataFactory=i?.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this._networkStream=n,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=(0,_util.createPromiseCapability)(),this.setupMessageHandler()}#l(e,t=null){const n=this.#a.get(e);if(n)return n;const r=this.messageHandler.sendWithPromise(e,t);return this.#a.set(e,r),r}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(e,t=_util.AnnotationMode.ENABLE,n=null,r=!1){let i=_util.RenderingIntentFlag.DISPLAY,a=null;switch(e){case"any":i=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":i=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${e}`)}switch(t){case _util.AnnotationMode.DISABLE:i+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:i+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:i+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,a=(i&_util.RenderingIntentFlag.PRINT&&n instanceof _annotation_storage.PrintAnnotationStorage?n:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${t}`)}return r&&(i+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:i,cacheKey:`${i}_${_annotation_storage.AnnotationStorage.getHash(a)}`,annotationStorageMap:a}}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=[];for(const t of this.#o.values())e.push(t._destroy());this.#o.clear(),this.#s.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const t=this.messageHandler.sendWithPromise("Terminate",null);return e.push(t),Promise.all(e).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#a.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:n}){n?t.close():((0,_util.assert)(e instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),t.enqueue(new Uint8Array(e),1,[e]))}).catch(e=>{t.error(e)})},t.onCancel=e=>{this._fullReader.cancel(e),t.ready.catch(e=>{if(!this.destroyed)throw e})}}),e.on("ReaderHeadersReady",e=>{const n=(0,_util.createPromiseCapability)(),r=this._fullReader;return r.headersReady.then(()=>{r.isStreamingSupported&&r.isRangeSupported||(this._lastProgress&&t.onProgress?.(this._lastProgress),r.onProgress=e=>{t.onProgress?.({loaded:e.loaded,total:e.total})}),n.resolve({isStreamingSupported:r.isStreamingSupported,isRangeSupported:r.isRangeSupported,contentLength:r.contentLength})},n.reject),n.promise}),e.on("GetRangeReader",(e,t)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const n=this._networkStream.getRangeReader(e.begin,e.end);n?(t.onPull=()=>{n.read().then(function({value:e,done:n}){n?t.close():((0,_util.assert)(e instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),t.enqueue(new Uint8Array(e),1,[e]))}).catch(e=>{t.error(e)})},t.onCancel=e=>{n.cancel(e),t.ready.catch(e=>{if(!this.destroyed)throw e})}):t.close()}),e.on("GetDoc",({pdfInfo:e})=>{this._numPages=e.numPages,this._htmlForXfa=e.htmlForXfa,delete e.htmlForXfa,t._capability.resolve(new PDFDocumentProxy(e,this))}),e.on("DocException",function(e){let n;switch(e.name){case"PasswordException":n=new _util.PasswordException(e.message,e.code);break;case"InvalidPDFException":n=new _util.InvalidPDFException(e.message);break;case"MissingPDFException":n=new _util.MissingPDFException(e.message);break;case"UnexpectedResponseException":n=new _util.UnexpectedResponseException(e.message,e.status);break;case"UnknownErrorException":n=new _util.UnknownErrorException(e.message,e.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}t._capability.reject(n)}),e.on("PasswordRequest",e=>{if(this._passwordCapability=(0,_util.createPromiseCapability)(),t.onPassword){const n=e=>{e instanceof Error?this._passwordCapability.reject(e):this._passwordCapability.resolve({password:e})};try{t.onPassword(n,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?.({loaded:e.length,total:e.length}),this.downloadInfoCapability.resolve(e)}),e.on("StartRenderPage",e=>{this.destroyed||this.#o.get(e.pageIndex)._startRenderPage(e.transparency,e.cacheKey)}),e.on("commonobj",([t,n,r])=>{if(!this.destroyed&&!this.commonObjs.has(t))switch(n){case"Font":const i=this._params;if("error"in r){const e=r.error;(0,_util.warn)(`Error during font loading: ${e}`),this.commonObjs.resolve(t,e);break}let a=null;i.pdfBug&&globalThis.FontInspector?.enabled&&(a={registerFont(e,t){globalThis.FontInspector.fontAdded(e,t)}});const o=new _font_loader.FontFaceObject(r,{isEvalSupported:i.isEvalSupported,disableFontFace:i.disableFontFace,ignoreErrors:i.ignoreErrors,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),fontRegistry:a});this.fontLoader.bind(o).catch(n=>e.sendWithPromise("FontFallback",{id:t})).finally(()=>{!i.fontExtraProperties&&o.data&&(o.data=null),this.commonObjs.resolve(t,o)});break;case"FontPath":case"Image":this.commonObjs.resolve(t,r);break;default:throw new Error(`Got unknown common object type ${n}`)}}),e.on("obj",([e,t,n,r])=>{if(this.destroyed)return;const i=this.#o.get(t);if(!i.objs.has(e))switch(n){case"Image":i.objs.resolve(e,r);const t=8e6;if(r){let e;if(r.bitmap){const{width:t,height:n}=r;e=t*n*4}else e=r.data?.length||0;e>t&&(i.cleanupAfterRender=!0)}break;case"Pattern":i.objs.resolve(e,r);break;default:throw new Error(`Got unknown object type ${n}`)}}),e.on("DocProgress",e=>{this.destroyed||t.onProgress?.({loaded:e.loaded,total:e.total})}),e.on("UnsupportedFeature",this._onUnsupportedFeature.bind(this)),e.on("FetchBuiltInCMap",e=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(e):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),e.on("FetchStandardFontData",e=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(e):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}_onUnsupportedFeature({featureId:e}){this.destroyed||this.loadingTask.onUnsupportedFeature?.(e)}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){return this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead."),this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:this.annotationStorage.serializable,filename:this._fullReader?.filename??null}).finally(()=>{this.annotationStorage.resetModified()})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));const t=e-1,n=this.#s.get(t);if(n)return n;const r=this.messageHandler.sendWithPromise("GetPage",{pageIndex:t}).then(e=>{if(this.destroyed)throw new Error("Transport destroyed");const n=new PDFPageProxy(t,e,this,this._params.ownerDocument,this._params.pdfBug);return this.#o.set(t,n),n});return this.#s.set(t,r),r}getPageIndex(e){return"object"!=typeof e||null===e||!Number.isInteger(e.num)||e.num<0||!Number.isInteger(e.gen)||e.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen})}getAnnotations(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:t})}getFieldObjects(){return this.#l("GetFieldObjects")}hasJSActions(){return this.#l("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}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)}getDocJSActions(){return this.messageHandler.sendWithPromise("GetDocJSActions",null)}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(e=>new _optional_content_config.OptionalContentConfig(e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata",t=this.#a.get(e);if(t)return t;const n=this.messageHandler.sendWithPromise(e,null).then(e=>({info:e[0],metadata:e[1]?new _metadata.Metadata(e[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#a.set(e,n),n}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const e of this.#o.values())if(!e.cleanup())throw new Error(`startCleanup: Page ${e.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),this.#a.clear()}}get loadingParams(){const{disableAutoFetch:e,enableXfa:t}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:e,enableXfa:t})}}class PDFObjects{#c=Object.create(null);#u(e){return this.#c[e]||(this.#c[e]={capability:(0,_util.createPromiseCapability)(),data:null})}get(e,t=null){if(t){const n=this.#u(e);return n.capability.promise.then(()=>t(n.data)),null}const n=this.#c[e];if(!n?.capability.settled)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return n.data}has(e){const t=this.#c[e];return t?.capability.settled||!1}resolve(e,t=null){const n=this.#u(e);n.data=t,n.capability.resolve()}clear(){for(const e in this.#c){const{data:t}=this.#c[e];t?.bitmap?.close()}this.#c=Object.create(null)}}class RenderTask{#d=null;constructor(e){this.#d=e,this.onContinue=null}get promise(){return this.#d.capability.promise}cancel(e=0){this.#d.cancel(null,e)}get separateAnnots(){const{separateAnnots:e}=this.#d.operatorList;if(!e)return!1;const{annotationCanvasMap:t}=this.#d;return e.form||e.canvas&&t?.size>0}}exports.RenderTask=RenderTask;class InternalRenderTask{static#h=new WeakSet;constructor({callback:e,params:t,objs:n,commonObjs:r,annotationCanvasMap:i,operatorList:a,pageIndex:o,canvasFactory:s,useRequestAnimationFrame:l=!1,pdfBug:c=!1,pageColors:u=null}){this.callback=e,this.params=t,this.objs=n,this.commonObjs=r,this.annotationCanvasMap=i,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=o,this.canvasFactory=s,this._pdfBug=c,this.pageColors=u,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===l&&"undefined"!=typeof window,this.cancelled=!1,this.capability=(0,_util.createPromiseCapability)(),this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=t.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:e=!1,optionalContentConfig:t}){if(this.cancelled)return;if(this._canvas){if(InternalRenderTask.#h.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");InternalRenderTask.#h.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:n,viewport:r,transform:i,background:a}=this.params;this.gfx=new _canvas.CanvasGraphics(n,this.commonObjs,this.objs,this.canvasFactory,{optionalContentConfig:t},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:i,viewport:r,transparency:e,background:a}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(e=null,t=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this._canvas&&InternalRenderTask.#h.delete(this._canvas),this.callback(e||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,"canvas",t))}operatorListChanged(){this.graphicsReady?(this.stepper?.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound)}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}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&&InternalRenderTask.#h.delete(this._canvas),this.callback())))}}const version="3.4.120";exports.version=version;const build="af6414988";exports.build=build},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PrintAnnotationStorage=t.AnnotationStorage=void 0;var r=n(1),i=n(4),a=n(8);class o{#f=!1;#p=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,t){const n=this.#p.get(e);return void 0===n?t:Object.assign(t,n)}getRawValue(e){return this.#p.get(e)}remove(e){if(this.#p.delete(e),0===this.#p.size&&this.resetModified(),"function"==typeof this.onAnnotationEditor){for(const e of this.#p.values())if(e instanceof i.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(e,t){const n=this.#p.get(e);let r=!1;if(void 0!==n)for(const[e,i]of Object.entries(t))n[e]!==i&&(r=!0,n[e]=i);else r=!0,this.#p.set(e,t);r&&this.#m(),t instanceof i.AnnotationEditor&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(t.constructor._type)}has(e){return this.#p.has(e)}getAll(){return this.#p.size>0?(0,r.objectFromMap)(this.#p):null}setAll(e){for(const[t,n]of Object.entries(e))this.setValue(t,n)}get size(){return this.#p.size}#m(){this.#f||(this.#f=!0,"function"==typeof this.onSetModified&&this.onSetModified())}resetModified(){this.#f&&(this.#f=!1,"function"==typeof this.onResetModified&&this.onResetModified())}get print(){return new s(this)}get serializable(){if(0===this.#p.size)return null;const e=new Map;for(const[t,n]of this.#p){const r=n instanceof i.AnnotationEditor?n.serialize():n;r&&e.set(t,r)}return e}static getHash(e){if(!e)return"";const t=new a.MurmurHash3_64;for(const[n,r]of e)t.update(`${n}:${JSON.stringify(r)}`);return t.hexdigest()}}t.AnnotationStorage=o;class s extends o{#g=null;constructor(e){super(),this.#g=structuredClone(e.serializable)}get print(){(0,r.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#g}}t.PrintAnnotationStorage=s},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationEditor=void 0;var r=n(5),i=n(1);class a{#v=this.focusin.bind(this);#y=this.focusout.bind(this);#b=!1;#E=!1;#_=!1;_uiManager=null;#w=a._zIndex++;static _colorManager=new r.ColorManager;static _zIndex=1;constructor(e){this.constructor===a&&(0,i.unreachable)("Cannot initialize AnnotationEditor."),this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager;const{rotation:t,rawDims:{pageWidth:n,pageHeight:r,pageX:o,pageY:s}}=this.parent.viewport;this.rotation=t,this.pageDimensions=[n,r],this.pageTranslation=[o,s];const[l,c]=this.parentDimensions;this.x=e.x/l,this.y=e.y/c,this.isAttachedToDOM=!1}static get _defaultLineColor(){return(0,i.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#w}setParent(e){null!==e&&(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions),this.parent=e}focusin(e){this.#b?this.#b=!1:this.parent.setSelected(this)}focusout(e){if(!this.isAttachedToDOM)return;const t=e.relatedTarget;t?.closest(`#${this.id}`)||(e.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}dragstart(e){const t=this.parent.div.getBoundingClientRect();this.startX=e.clientX-t.x,this.startY=e.clientY-t.y,e.dataTransfer.setData("text/plain",this.id),e.dataTransfer.effectAllowed="move"}setAt(e,t,n,r){const[i,a]=this.parentDimensions;[n,r]=this.screenToPageTranslation(n,r),this.x=(e+n)/i,this.y=(t+r)/a,this.div.style.left=100*this.x+"%",this.div.style.top=100*this.y+"%"}translate(e,t){const[n,r]=this.parentDimensions;[e,t]=this.screenToPageTranslation(e,t),this.x+=e/n,this.y+=t/r,this.div.style.left=100*this.x+"%",this.div.style.top=100*this.y+"%"}screenToPageTranslation(e,t){switch(this.parentRotation){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return this._uiManager.viewParameters.rotation}get parentDimensions(){const{realScale:e}=this._uiManager.viewParameters,[t,n]=this.pageDimensions;return[t*e,n*e]}setDims(e,t){const[n,r]=this.parentDimensions;this.div.style.width=100*e/n+"%",this.div.style.height=100*t/r+"%"}fixDims(){const{style:e}=this.div,{height:t,width:n}=e,r=n.endsWith("%"),i=t.endsWith("%");if(r&&i)return;const[a,o]=this.parentDimensions;r||(e.width=100*parseFloat(n)/a+"%"),i||(e.height=100*parseFloat(t)/o+"%")}getInitialTranslation(){return[0,0]}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",this.#v),this.div.addEventListener("focusout",this.#y);const[e,t]=this.getInitialTranslation();return this.translate(e,t),(0,r.bindEvents)(this,this.div,["dragstart","pointerdown"]),this.div}pointerdown(e){const{isMac:t}=i.FeatureTest.platform;0!==e.button||e.ctrlKey&&t?e.preventDefault():(e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this),this.#b=!0)}getRect(e,t){const n=this.parentScale,[r,i]=this.pageDimensions,[a,o]=this.pageTranslation,s=e/n,l=t/n,c=this.x*r,u=this.y*i,d=this.width*r,h=this.height*i;switch(this.rotation){case 0:return[c+s+a,i-u-l-h+o,c+s+d+a,i-u-l+o];case 90:return[c+l+a,i-u+s+o,c+l+h+a,i-u+s+d+o];case 180:return[c-s-d+a,i-u+l+o,c-s+a,i-u+l+h+o];case 270:return[c-l-h+a,i-u-s-d+o,c-l+a,i-u-s+o];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,t){const[n,r,i,a]=e,o=i-n,s=a-r;switch(this.rotation){case 0:return[n,t-a,o,s];case 90:return[n,t-r,s,o];case 180:return[i,t-r,o,s];case 270:return[i,t-a,s,o];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#_=!0}disableEditMode(){this.#_=!1}isInEditMode(){return this.#_}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){this.div?.addEventListener("focusin",this.#v)}serialize(){(0,i.unreachable)("An editor must be serializable")}static deserialize(e,t,n){const r=new this.prototype.constructor({parent:t,id:t.getNextId(),uiManager:n});r.rotation=e.rotation;const[i,a]=r.pageDimensions,[o,s,l,c]=r.getRectInCurrentCoords(e.rect,a);return r.x=o/i,r.y=s/a,r.width=l/i,r.height=c/a,r}remove(){this.div.removeEventListener("focusin",this.#v),this.div.removeEventListener("focusout",this.#y),this.isEmpty()||this.commit(),this.parent.remove(this)}select(){this.div?.classList.add("selectedEditor")}unselect(){this.div?.classList.remove("selectedEditor")}updateParams(e,t){}disableEditing(){}enableEditing(){}get propertiesToUpdate(){return{}}get contentDiv(){return this.div}get isEditing(){return this.#E}set isEditing(e){this.#E=e,e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null)}}t.AnnotationEditor=a},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.KeyboardManager=t.CommandManager=t.ColorManager=t.AnnotationEditorUIManager=void 0,t.bindEvents=function(e,t,n){for(const r of n)t.addEventListener(r,e[r].bind(e))},t.opacityToHex=function(e){return Math.round(Math.min(255,Math.max(1,255*e))).toString(16).padStart(2,"0")};var r=n(1),i=n(6);class a{#S=0;getId(){return`${r.AnnotationEditorPrefix}${this.#S++}`}}class o{#C=[];#k=!1;#A;#x=-1;constructor(e=128){this.#A=e}add({cmd:e,undo:t,mustExec:n,type:r=NaN,overwriteIfSameType:i=!1,keepUndo:a=!1}){if(n&&e(),this.#k)return;const o={cmd:e,undo:t,type:r};if(-1===this.#x)return this.#C.length>0&&(this.#C.length=0),this.#x=0,void this.#C.push(o);if(i&&this.#C[this.#x].type===r)return a&&(o.undo=this.#C[this.#x].undo),void(this.#C[this.#x]=o);const s=this.#x+1;s===this.#A?this.#C.splice(0,1):(this.#x=s,se===t[n]))return l._colorsMapping.get(e);return t}getHexCode(e){const t=this._colors.get(e);return t?r.Util.makeHexColor(...t):e}}t.ColorManager=l;class c{#M=null;#T=new Map;#R=new Map;#O=null;#I=new o;#D=0;#L=null;#N=new Set;#F=null;#j=new a;#B=!1;#U=r.AnnotationEditorType.NONE;#z=new Set;#q=this.copy.bind(this);#V=this.cut.bind(this);#H=this.paste.bind(this);#W=this.keydown.bind(this);#G=this.onEditingAction.bind(this);#$=this.onPageChanging.bind(this);#Y=this.onScaleChanging.bind(this);#X=this.onRotationChanging.bind(this);#K={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1};#Q=null;static _keyboardManager=new s([[["ctrl+a","mac+meta+a"],c.prototype.selectAll],[["ctrl+z","mac+meta+z"],c.prototype.undo],[["ctrl+y","ctrl+shift+Z","mac+meta+shift+Z"],c.prototype.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete"],c.prototype.delete],[["Escape","mac+Escape"],c.prototype.unselectAll]]);constructor(e,t,n){this.#Q=e,this.#F=t,this.#F._on("editingaction",this.#G),this.#F._on("pagechanging",this.#$),this.#F._on("scalechanging",this.#Y),this.#F._on("rotationchanging",this.#X),this.#O=n,this.viewParameters={realScale:i.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}destroy(){this.#J(),this.#F._off("editingaction",this.#G),this.#F._off("pagechanging",this.#$),this.#F._off("scalechanging",this.#Y),this.#F._off("rotationchanging",this.#X);for(const e of this.#R.values())e.destroy();this.#R.clear(),this.#T.clear(),this.#N.clear(),this.#M=null,this.#z.clear(),this.#I.destroy()}onPageChanging({pageNumber:e}){this.#D=e-1}focusMainContainer(){this.#Q.focus()}addShouldRescale(e){this.#N.add(e)}removeShouldRescale(e){this.#N.delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*i.PixelsPerInch.PDF_TO_CSS_UNITS;for(const e of this.#N)e.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}addToAnnotationStorage(e){e.isEmpty()||!this.#O||this.#O.has(e.id)||this.#O.setValue(e.id,e)}#Z(){this.#Q.addEventListener("keydown",this.#W)}#J(){this.#Q.removeEventListener("keydown",this.#W)}#ee(){document.addEventListener("copy",this.#q),document.addEventListener("cut",this.#V),document.addEventListener("paste",this.#H)}#te(){document.removeEventListener("copy",this.#q),document.removeEventListener("cut",this.#V),document.removeEventListener("paste",this.#H)}copy(e){if(e.preventDefault(),this.#M&&this.#M.commitOrRemove(),!this.hasSelection)return;const t=[];for(const e of this.#z)e.isEmpty()||t.push(e.serialize());0!==t.length&&e.clipboardData.setData("application/pdfjs",JSON.stringify(t))}cut(e){this.copy(e),this.delete()}paste(e){e.preventDefault();let t=e.clipboardData.getData("application/pdfjs");if(!t)return;try{t=JSON.parse(t)}catch(e){return void(0,r.warn)(`paste: "${e.message}".`)}if(!Array.isArray(t))return;this.unselectAll();const n=this.#R.get(this.#D);try{const e=[];for(const r of t){const t=n.deserialize(r);if(!t)return;e.push(t)}const r=()=>{for(const t of e)this.#ne(t);this.#re(e)},i=()=>{for(const t of e)t.remove()};this.addCommands({cmd:r,undo:i,mustExec:!0})}catch(e){(0,r.warn)(`paste: "${e.message}".`)}}keydown(e){this.getActive()?.shouldGetKeyboardEvents()||c._keyboardManager.exec(this,e)}onEditingAction(e){["undo","redo","delete","selectAll"].includes(e.name)&&this[e.name]()}#ie(e){Object.entries(e).some(([e,t])=>this.#K[e]!==t)&&this.#F.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#K,e)})}#ae(e){this.#F.dispatch("annotationeditorparamschanged",{source:this,details:e})}setEditingState(e){e?(this.#Z(),this.#ee(),this.#ie({isEditing:this.#U!==r.AnnotationEditorType.NONE,isEmpty:this.#oe(),hasSomethingToUndo:this.#I.hasSomethingToUndo(),hasSomethingToRedo:this.#I.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#J(),this.#te(),this.#ie({isEditing:!1}))}registerEditorTypes(e){if(!this.#L){this.#L=e;for(const e of this.#L)this.#ae(e.defaultPropertiesToUpdate)}}getId(){return this.#j.getId()}get currentLayer(){return this.#R.get(this.#D)}get currentPageIndex(){return this.#D}addLayer(e){this.#R.set(e.pageIndex,e),this.#B?e.enable():e.disable()}removeLayer(e){this.#R.delete(e.pageIndex)}updateMode(e){if(this.#U=e,e===r.AnnotationEditorType.NONE)this.setEditingState(!1),this.#se();else{this.setEditingState(!0),this.#le();for(const t of this.#R.values())t.updateMode(e)}}updateToolbar(e){e!==this.#U&&this.#F.dispatch("switchannotationeditormode",{source:this,mode:e})}updateParams(e,t){if(this.#L){for(const n of this.#z)n.updateParams(e,t);for(const n of this.#L)n.updateDefaultParams(e,t)}}#le(){if(!this.#B){this.#B=!0;for(const e of this.#R.values())e.enable()}}#se(){if(this.unselectAll(),this.#B){this.#B=!1;for(const e of this.#R.values())e.disable()}}getEditors(e){const t=[];for(const n of this.#T.values())n.pageIndex===e&&t.push(n);return t}getEditor(e){return this.#T.get(e)}addEditor(e){this.#T.set(e.id,e)}removeEditor(e){this.#T.delete(e.id),this.unselect(e),this.#O?.remove(e.id)}#ne(e){const t=this.#R.get(e.pageIndex);t?t.addOrRebuild(e):this.addEditor(e)}setActiveEditor(e){this.#M!==e&&(this.#M=e,e&&this.#ae(e.propertiesToUpdate))}toggleSelected(e){if(this.#z.has(e))return this.#z.delete(e),e.unselect(),void this.#ie({hasSelectedEditor:this.hasSelection});this.#z.add(e),e.select(),this.#ae(e.propertiesToUpdate),this.#ie({hasSelectedEditor:!0})}setSelected(e){for(const t of this.#z)t!==e&&t.unselect();this.#z.clear(),this.#z.add(e),e.select(),this.#ae(e.propertiesToUpdate),this.#ie({hasSelectedEditor:!0})}isSelected(e){return this.#z.has(e)}unselect(e){e.unselect(),this.#z.delete(e),this.#ie({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#z.size}undo(){this.#I.undo(),this.#ie({hasSomethingToUndo:this.#I.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#oe()})}redo(){this.#I.redo(),this.#ie({hasSomethingToUndo:!0,hasSomethingToRedo:this.#I.hasSomethingToRedo(),isEmpty:this.#oe()})}addCommands(e){this.#I.add(e),this.#ie({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#oe()})}#oe(){if(0===this.#T.size)return!0;if(1===this.#T.size)for(const e of this.#T.values())return e.isEmpty();return!1}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const e=[...this.#z];this.addCommands({cmd:()=>{for(const t of e)t.remove()},undo:()=>{for(const t of e)this.#ne(t)},mustExec:!0})}commitOrRemove(){this.#M?.commitOrRemove()}#re(e){this.#z.clear();for(const t of e)t.isEmpty()||(this.#z.add(t),t.select());this.#ie({hasSelectedEditor:!0})}selectAll(){for(const e of this.#z)e.commit();this.#re(this.#T.values())}unselectAll(){if(this.#M)this.#M.commitOrRemove();else if(0!==this.#z.size){for(const e of this.#z)e.unselect();this.#z.clear(),this.#ie({hasSelectedEditor:!1})}}isActive(e){return this.#M===e}getActive(){return this.#M}getMode(){return this.#U}}t.AnnotationEditorUIManager=c},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StatTimer=t.RenderingCancelledException=t.PixelsPerInch=t.PageViewport=t.PDFDateString=t.DOMStandardFontDataFactory=t.DOMSVGFactory=t.DOMCanvasFactory=t.DOMCMapReaderFactory=t.AnnotationPrefix=void 0,t.deprecated=function(e){console.log("Deprecated API usage: "+e)},t.getColorValues=function(e){const t=document.createElement("span");t.style.visibility="hidden",document.body.append(t);for(const n of e.keys()){t.style.color=n;const r=window.getComputedStyle(t).color;e.set(n,g(r))}t.remove()},t.getCurrentTransform=function(e){const{a:t,b:n,c:r,d:i,e:a,f:o}=e.getTransform();return[t,n,r,i,a,o]},t.getCurrentTransformInverse=function(e){const{a:t,b:n,c:r,d:i,e:a,f:o}=e.getTransform().invertSelf();return[t,n,r,i,a,o]},t.getFilenameFromUrl=function(e,t=!1){return t||([e]=e.split(/[#?]/,1)),e.substring(e.lastIndexOf("/")+1)},t.getPdfFilenameFromUrl=function(e,t="document.pdf"){if("string"!=typeof e)return t;if(f(e))return(0,i.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;const n=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,r=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(e);let a=n.exec(r[1])||n.exec(r[2])||n.exec(r[3]);if(a&&(a=a[0],a.includes("%")))try{a=n.exec(decodeURIComponent(a))[0]}catch(e){}return a||t},t.getRGB=g,t.getXfaPageViewport=function(e,{scale:t=1,rotation:n=0}){const{width:r,height:i}=e.attributes.style,a=[0,0,parseInt(r),parseInt(i)];return new d({viewBox:a,scale:t,rotation:n})},t.isDataScheme=f,t.isPdfFile=function(e){return"string"==typeof e&&/\.pdf$/i.test(e)},t.isValidFetchUrl=p,t.loadScript=function(e,t=!1){return new Promise((n,r)=>{const i=document.createElement("script");i.src=e,i.onload=function(e){t&&i.remove(),n(e)},i.onerror=function(){r(new Error(`Cannot load script at: ${i.src}`))},(document.head||document.documentElement).append(i)})},t.setLayerDimensions=function(e,t,n=!1,r=!0){if(t instanceof d){const{pageWidth:r,pageHeight:i}=t.rawDims,{style:a}=e,o=`calc(var(--scale-factor) * ${r}px)`,s=`calc(var(--scale-factor) * ${i}px)`;n&&t.rotation%180!=0?(a.width=s,a.height=o):(a.width=o,a.height=s)}r&&e.setAttribute("data-main-rotation",t.rotation)};var r=n(7),i=n(1);t.AnnotationPrefix="pdfjs_internal_id_";class a{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}t.PixelsPerInch=a;class o extends r.BaseCanvasFactory{constructor({ownerDocument:e=globalThis.document}={}){super(),this._document=e}_createCanvas(e,t){const n=this._document.createElement("canvas");return n.width=e,n.height=t,n}}async function s(e,t=!1){if(p(e,document.baseURI)){const n=await fetch(e);if(!n.ok)throw new Error(n.statusText);return t?new Uint8Array(await n.arrayBuffer()):(0,i.stringToBytes)(await n.text())}return new Promise((n,r)=>{const a=new XMLHttpRequest;a.open("GET",e,!0),t&&(a.responseType="arraybuffer"),a.onreadystatechange=()=>{if(a.readyState===XMLHttpRequest.DONE){if(200===a.status||0===a.status){let e;if(t&&a.response?e=new Uint8Array(a.response):!t&&a.responseText&&(e=(0,i.stringToBytes)(a.responseText)),e)return void n(e)}r(new Error(a.statusText))}},a.send(null)})}t.DOMCanvasFactory=o;class l extends r.BaseCMapReaderFactory{_fetchData(e,t){return s(e,this.isCompressed).then(e=>({cMapData:e,compressionType:t}))}}t.DOMCMapReaderFactory=l;class c extends r.BaseStandardFontDataFactory{_fetchData(e){return s(e,!0)}}t.DOMStandardFontDataFactory=c;class u extends r.BaseSVGFactory{_createSVG(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}}t.DOMSVGFactory=u;class d{constructor({viewBox:e,scale:t,rotation:n,offsetX:r=0,offsetY:i=0,dontFlip:a=!1}){this.viewBox=e,this.scale=t,this.rotation=n,this.offsetX=r,this.offsetY=i;const o=(e[2]+e[0])/2,s=(e[3]+e[1])/2;let l,c,u,d,h,f,p,m;switch((n%=360)<0&&(n+=360),n){case 180:l=-1,c=0,u=0,d=1;break;case 90:l=0,c=1,u=1,d=0;break;case 270:l=0,c=-1,u=-1,d=0;break;case 0:l=1,c=0,u=0,d=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}a&&(u=-u,d=-d),0===l?(h=Math.abs(s-e[1])*t+r,f=Math.abs(o-e[0])*t+i,p=(e[3]-e[1])*t,m=(e[2]-e[0])*t):(h=Math.abs(o-e[0])*t+r,f=Math.abs(s-e[1])*t+i,p=(e[2]-e[0])*t,m=(e[3]-e[1])*t),this.transform=[l*t,c*t,u*t,d*t,h-l*t*o-u*t*s,f-c*t*o-d*t*s],this.width=p,this.height=m}get rawDims(){const{viewBox:e}=this;return(0,i.shadow)(this,"rawDims",{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone({scale:e=this.scale,rotation:t=this.rotation,offsetX:n=this.offsetX,offsetY:r=this.offsetY,dontFlip:i=!1}={}){return new d({viewBox:this.viewBox.slice(),scale:e,rotation:t,offsetX:n,offsetY:r,dontFlip:i})}convertToViewportPoint(e,t){return i.Util.applyTransform([e,t],this.transform)}convertToViewportRectangle(e){const t=i.Util.applyTransform([e[0],e[1]],this.transform),n=i.Util.applyTransform([e[2],e[3]],this.transform);return[t[0],t[1],n[0],n[1]]}convertToPdfPoint(e,t){return i.Util.applyInverseTransform([e,t],this.transform)}}t.PageViewport=d;class h extends i.BaseException{constructor(e,t,n=0){super(e,"RenderingCancelledException"),this.type=t,this.extraDelay=n}}function f(e){const t=e.length;let n=0;for(;n>16,(65280&t)>>8,255&t]}return e.startsWith("rgb(")?e.slice(4,-1).split(",").map(e=>parseInt(e)):e.startsWith("rgba(")?e.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):((0,i.warn)(`Not a valid color format: "${e}"`),[0,0,0])}t.RenderingCancelledException=h,t.StatTimer=class{started=Object.create(null);times=[];time(e){e in this.started&&(0,i.warn)(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||(0,i.warn)(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){const e=[];let t=0;for(const{name:e}of this.times)t=Math.max(e.length,t);for(const{name:n,start:r,end:i}of this.times)e.push(`${n.padEnd(t)} ${i-r}ms\n`);return e.join("")}},t.PDFDateString=class{static toDateObject(e){if(!e||"string"!=typeof e)return null;m||(m=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const t=m.exec(e);if(!t)return null;const n=parseInt(t[1],10);let r=parseInt(t[2],10);r=r>=1&&r<=12?r-1:0;let i=parseInt(t[3],10);i=i>=1&&i<=31?i:1;let a=parseInt(t[4],10);a=a>=0&&a<=23?a:0;let o=parseInt(t[5],10);o=o>=0&&o<=59?o:0;let s=parseInt(t[6],10);s=s>=0&&s<=59?s:0;const l=t[7]||"Z";let c=parseInt(t[8],10);c=c>=0&&c<=23?c:0;let u=parseInt(t[9],10)||0;return u=u>=0&&u<=59?u:0,"-"===l?(a+=c,o+=u):"+"===l&&(a-=c,o-=u),new Date(Date.UTC(n,r,i,a,o,s))}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseStandardFontDataFactory=t.BaseSVGFactory=t.BaseCanvasFactory=t.BaseCMapReaderFactory=void 0;var r=n(1);class i{constructor(){this.constructor===i&&(0,r.unreachable)("Cannot initialize BaseCanvasFactory.")}create(e,t){if(e<=0||t<=0)throw new Error("Invalid canvas size");const n=this._createCanvas(e,t);return{canvas:n,context:n.getContext("2d")}}reset(e,t,n){if(!e.canvas)throw new Error("Canvas is not specified");if(t<=0||n<=0)throw new Error("Invalid canvas size");e.canvas.width=t,e.canvas.height=n}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}_createCanvas(e,t){(0,r.unreachable)("Abstract method `_createCanvas` called.")}}t.BaseCanvasFactory=i;class a{constructor({baseUrl:e=null,isCompressed:t=!0}){this.constructor===a&&(0,r.unreachable)("Cannot initialize BaseCMapReaderFactory."),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":""),n=this.isCompressed?r.CMapCompressionType.BINARY:r.CMapCompressionType.NONE;return this._fetchData(t,n).catch(e=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${t}`)})}_fetchData(e,t){(0,r.unreachable)("Abstract method `_fetchData` called.")}}t.BaseCMapReaderFactory=a;class o{constructor({baseUrl:e=null}){this.constructor===o&&(0,r.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!e)throw new Error("Font filename must be specified.");const t=`${this.baseUrl}${e}`;return this._fetchData(t).catch(e=>{throw new Error(`Unable to load font data at: ${t}`)})}_fetchData(e){(0,r.unreachable)("Abstract method `_fetchData` called.")}}t.BaseStandardFontDataFactory=o;class s{constructor(){this.constructor===s&&(0,r.unreachable)("Cannot initialize BaseSVGFactory.")}create(e,t,n=!1){if(e<=0||t<=0)throw new Error("Invalid SVG dimensions");const r=this._createSVG("svg:svg");return r.setAttribute("version","1.1"),n||(r.setAttribute("width",`${e}px`),r.setAttribute("height",`${t}px`)),r.setAttribute("preserveAspectRatio","none"),r.setAttribute("viewBox",`0 0 ${e} ${t}`),r}createElement(e){if("string"!=typeof e)throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){(0,r.unreachable)("Abstract method `_createSVG` called.")}}t.BaseSVGFactory=s},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MurmurHash3_64=void 0;var r=n(1);const i=3285377520,a=4294901760,o=65535;t.MurmurHash3_64=class{constructor(e){this.h1=e?4294967295&e:i,this.h2=e?4294967295&e:i}update(e){let t,n;if("string"==typeof e){t=new Uint8Array(2*e.length),n=0;for(let r=0,i=e.length;r>>8,t[n++]=255&i)}}else{if(!(0,r.isArrayBuffer)(e))throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");t=e.slice(),n=t.byteLength}const i=n>>2,s=n-4*i,l=new Uint32Array(t.buffer,0,i);let c=0,u=0,d=this.h1,h=this.h2;const f=3432918353,p=461845907,m=11601,g=13715;for(let e=0;e>>17,c=c*p&a|c*g&o,d^=c,d=d<<13|d>>>19,d=5*d+3864292196):(u=l[e],u=u*f&a|u*m&o,u=u<<15|u>>>17,u=u*p&a|u*g&o,h^=u,h=h<<13|h>>>19,h=5*h+3864292196);switch(c=0,s){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&a|c*m&o,c=c<<15|c>>>17,c=c*p&a|c*g&o,1&i?d^=c:h^=c}this.h1=d,this.h2=h}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=3981806797*e&a|36045*e&o,t=4283543511*t&a|(2950163797*(t<<16|e>>>16)&a)>>>16,e^=t>>>1,e=444984403*e&a|60499*e&o,t=3301882366*t&a|(3120437893*(t<<16|e>>>16)&a)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FontLoader=t.FontFaceObject=void 0;var r=n(1),i=n(10);t.FontLoader=class{constructor({onUnsupportedFeature:e,ownerDocument:t=globalThis.document,styleElement:n=null}){this._onUnsupportedFeature=e,this._document=t,this.nativeFontFaces=[],this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.push(e),this._document.fonts.add(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const t=this.styleElement.sheet;t.insertRule(e,t.cssRules.length)}clear(){for(const e of this.nativeFontFaces)this._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(n){throw this._onUnsupportedFeature({featureId:r.UNSUPPORTED_FEATURES.errorFontLoadNative}),(0,r.warn)(`Failed to load font '${t.family}': '${n}'.`),e.disableFontFace=!0,n}}return}const t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise(t=>{const n=this._queueLoadingCallback(t);this._prepareFontLoadEvent(e,n)})}}get isFontLoadingAPISupported(){const e=!!this._document?.fonts;return(0,r.shadow)(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){let e=!1;return(i.isNodeJS||"undefined"!=typeof navigator&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(e=!0),(0,r.shadow)(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(e){const{loadingRequests:t}=this,n={done:!1,complete:function(){for((0,r.assert)(!n.done,"completeRequest() cannot be called twice."),n.done=!0;t.length>0&&t[0].done;){const e=t.shift();setTimeout(e.callback,0)}},callback:e};return t.push(n),n}get _loadTestFont(){const e=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,r.shadow)(this,"_loadTestFont",e)}_prepareFontLoadEvent(e,t){function n(e,t){return e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|255&e.charCodeAt(t+3)}function i(e,t,n,r){return e.substring(0,t)+r+e.substring(t+n)}let a,o;const s=this._document.createElement("canvas");s.width=1,s.height=1;const l=s.getContext("2d");let c=0;const u=`lt${Date.now()}${this.loadTestFontId++}`;let d=this._loadTestFont;d=i(d,976,u.length,u);const h=1482184792;let f=n(d,16);for(a=0,o=u.length-3;a30)return(0,r.warn)("Load test font never loaded."),void n();l.font="30px "+t,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0?n():setTimeout(e.bind(null,t,n))}(u,()=>{m.remove(),t.complete()})}},t.FontFaceObject=class{constructor(e,{isEvalSupported:t=!0,disableFontFace:n=!1,ignoreErrors:r=!1,onUnsupportedFeature:i,fontRegistry:a=null}){this.compiledGlyphs=Object.create(null);for(const t in e)this[t]=e[t];this.isEvalSupported=!1!==t,this.disableFontFace=!0===n,this.ignoreErrors=!0===r,this._onUnsupportedFeature=i,this.fontRegistry=a}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let e;if(this.cssFontInfo){const t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}else e=new FontFace(this.loadedName,this.data,{});return this.fontRegistry?.registerFont(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const e=(0,r.bytesToString)(this.data),t=`url(data:${this.mimetype};base64,${btoa(e)});`;let n;if(this.cssFontInfo){let e=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(e+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),n=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${e}src:${t}}`}else n=`@font-face {font-family:"${this.loadedName}";src:${t}}`;return this.fontRegistry?.registerFont(this,t),n}getPathGenerator(e,t){if(void 0!==this.compiledGlyphs[t])return this.compiledGlyphs[t];let n;try{n=e.get(this.loadedName+"_path_"+t)}catch(e){if(!this.ignoreErrors)throw e;return this._onUnsupportedFeature({featureId:r.UNSUPPORTED_FEATURES.errorFontGetPath}),(0,r.warn)(`getPathGenerator - ignoring character: "${e}".`),this.compiledGlyphs[t]=function(e,t){}}if(this.isEvalSupported&&r.FeatureTest.isEvalSupported){const e=[];for(const t of n){const n=void 0!==t.args?t.args.join(","):"";e.push("c.",t.cmd,"(",n,");\n")}return this.compiledGlyphs[t]=new Function("c","size",e.join(""))}return this.compiledGlyphs[t]=function(e,t){for(const r of n)"scale"===r.cmd&&(r.args=[t,-t]),e[r.cmd].apply(e,r.args)}}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isNodeJS=void 0;const n=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type);t.isNodeJS=n},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CanvasGraphics=void 0;var r=n(1),i=n(6),a=n(12),o=n(13);const s=4096,l=16;class c{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,t,n){let r;return void 0!==this.cache[e]?(r=this.cache[e],this.canvasFactory.reset(r,t,n)):(r=this.canvasFactory.create(t,n),this.cache[e]=r),r}delete(e){delete this.cache[e]}clear(){for(const e in this.cache){const t=this.cache[e];this.canvasFactory.destroy(t),delete this.cache[e]}}}function u(e,t,n,r,a,o,s,l,c,u){const[d,h,f,p,m,g]=(0,i.getCurrentTransform)(e);if(0===h&&0===f){const i=s*d+m,v=Math.round(i),y=l*p+g,b=Math.round(y),E=(s+c)*d+m,_=Math.abs(Math.round(E)-v)||1,w=(l+u)*p+g,S=Math.abs(Math.round(w)-b)||1;return e.setTransform(Math.sign(d),0,0,Math.sign(p),v,b),e.drawImage(t,n,r,a,o,0,0,_,S),e.setTransform(d,h,f,p,m,g),[_,S]}if(0===d&&0===p){const i=l*f+m,v=Math.round(i),y=s*h+g,b=Math.round(y),E=(l+u)*f+m,_=Math.abs(Math.round(E)-v)||1,w=(s+c)*h+g,S=Math.abs(Math.round(w)-b)||1;return e.setTransform(0,Math.sign(h),Math.sign(f),0,v,b),e.drawImage(t,n,r,a,o,0,0,S,_),e.setTransform(d,h,f,p,m,g),[S,_]}return e.drawImage(t,n,r,a,o,s,l,c,u),[Math.hypot(d,h)*c,Math.hypot(f,p)*u]}class d{constructor(e,t){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=r.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=r.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=r.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps=null,this.startNewPathAndClipBox([0,0,e,t])}clone(){const e=Object.create(this);return e.clipBox=this.clipBox.slice(),e}setCurrentPoint(e,t){this.x=e,this.y=t}updatePathMinMax(e,t,n){[t,n]=r.Util.applyTransform([t,n],e),this.minX=Math.min(this.minX,t),this.minY=Math.min(this.minY,n),this.maxX=Math.max(this.maxX,t),this.maxY=Math.max(this.maxY,n)}updateRectMinMax(e,t){const n=r.Util.applyTransform(t,e),i=r.Util.applyTransform(t.slice(2),e);this.minX=Math.min(this.minX,n[0],i[0]),this.minY=Math.min(this.minY,n[1],i[1]),this.maxX=Math.max(this.maxX,n[0],i[0]),this.maxY=Math.max(this.maxY,n[1],i[1])}updateScalingPathMinMax(e,t){r.Util.scaleMinMax(e,t),this.minX=Math.min(this.minX,t[0]),this.maxX=Math.max(this.maxX,t[1]),this.minY=Math.min(this.minY,t[2]),this.maxY=Math.max(this.maxY,t[3])}updateCurvePathMinMax(e,t,n,i,a,o,s,l,c,u){const d=r.Util.bezierBoundingBox(t,n,i,a,o,s,l,c);if(u)return u[0]=Math.min(u[0],d[0],d[2]),u[1]=Math.max(u[1],d[0],d[2]),u[2]=Math.min(u[2],d[1],d[3]),void(u[3]=Math.max(u[3],d[1],d[3]));this.updateRectMinMax(e,d)}getPathBoundingBox(e=a.PathType.FILL,t=null){const n=[this.minX,this.minY,this.maxX,this.maxY];if(e===a.PathType.STROKE){t||(0,r.unreachable)("Stroke bounding box must include transform.");const e=r.Util.singularValueDecompose2dScale(t),i=e[0]*this.lineWidth/2,a=e[1]*this.lineWidth/2;n[0]-=i,n[1]-=a,n[2]+=i,n[3]+=a}return n}updateClipFromPath(){const e=r.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(e){this.clipBox=e,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(e=a.PathType.FILL,t=null){return r.Util.intersect(this.clipBox,this.getPathBoundingBox(e,t))}}function h(e,t,n=null){if("undefined"!=typeof ImageData&&t instanceof ImageData)return void e.putImageData(t,0,0);const i=t.height,a=t.width,o=i%l,s=(i-o)/l,c=0===o?s:s+1,u=e.createImageData(a,l);let d,h=0;const f=t.data,p=u.data;let m,g,v,y,b,E,_,w;if(n)switch(n.length){case 1:b=n[0],E=n[0],_=n[0],w=n[0];break;case 4:b=n[0],E=n[1],_=n[2],w=n[3]}if(t.kind===r.ImageKind.GRAYSCALE_1BPP){const t=f.byteLength,n=new Uint32Array(p.buffer,0,p.byteLength>>2),i=n.length,y=a+7>>3;let b=4294967295,E=r.FeatureTest.isLittleEndian?4278190080:255;for(w&&255===w[0]&&0===w[255]&&([b,E]=[E,b]),m=0;my?a:8*e-7,o=-8&i;let s=0,l=0;for(;r>=1}for(;d=s&&(v=o,y=a*v),d=0,g=y;g--;)p[d++]=f[h++],p[d++]=f[h++],p[d++]=f[h++],p[d++]=255;if(t)for(let e=0;e>8,e[a-2]=e[a-2]*i+n*o>>8,e[a-1]=e[a-1]*i+r*o>>8}}}function v(e,t,n){const r=e.length,i=1/255;for(let a=3;a>8]>>8:t[i]*r>>16}}function b(e,t){const n=r.Util.singularValueDecompose2dScale(e);n[0]=Math.fround(n[0]),n[1]=Math.fround(n[1]);const a=Math.fround((globalThis.devicePixelRatio||1)*i.PixelsPerInch.PDF_TO_CSS_UNITS);return void 0!==t?t:n[0]<=a||n[1]<=a}const E=["butt","round","square"],_=["miter","round","bevel"],w={},S={};class C{constructor(e,t,n,r,{optionalContentConfig:i,markedContentStack:a=null},o,s){this.ctx=e,this.current=new d(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=t,this.objs=n,this.canvasFactory=r,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=a||[],this.optionalContentConfig=i,this.cachedCanvases=new c(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=o,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.backgroundColor=s?.background||null,this.foregroundColor=s?.foreground||null,this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(e,t=null){return"string"==typeof e?e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e):t}beginDrawing({transform:e,viewport:t,transparency:n=!1,background:r=null}){const a=this.ctx.canvas.width,o=this.ctx.canvas.height,s=r||"#ffffff";if(this.ctx.save(),this.foregroundColor&&this.backgroundColor){this.ctx.fillStyle=this.foregroundColor;const e=this.foregroundColor=this.ctx.fillStyle;this.ctx.fillStyle=this.backgroundColor;const t=this.backgroundColor=this.ctx.fillStyle;let n=!0,r=s;if(this.ctx.fillStyle=s,r=this.ctx.fillStyle,n="string"==typeof r&&/^#[0-9A-Fa-f]{6}$/.test(r),"#000000"===e&&"#ffffff"===t||e===t||!n)this.foregroundColor=this.backgroundColor=null;else{const[n,a,o]=(0,i.getRGB)(r),s=e=>(e/=255)<=.03928?e/12.92:((e+.055)/1.055)**2.4,l=Math.round(.2126*s(n)+.7152*s(a)+.0722*s(o));this.selectColor=(n,r,i)=>{const a=.2126*s(n)+.7152*s(r)+.0722*s(i);return Math.round(a)===l?t:e}}}if(this.ctx.fillStyle=this.backgroundColor||s,this.ctx.fillRect(0,0,a,o),this.ctx.restore(),n){const e=this.cachedCanvases.getCanvas("transparent",a,o);this.compositeCtx=this.ctx,this.transparentCanvas=e.canvas,this.ctx=e.context,this.ctx.save(),this.ctx.transform(...(0,i.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),m(this.ctx,this.foregroundColor),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...t.transform),this.viewportScale=t.scale,this.baseTransform=(0,i.getCurrentTransform)(this.ctx)}executeOperatorList(e,t,n,i){const a=e.argsArray,o=e.fnArray;let s=t||0;const l=a.length;if(l===s)return s;const c=l-s>10&&"function"==typeof n,u=c?Date.now()+15:0;let d=0;const h=this.commonObjs,f=this.objs;let p;for(;;){if(void 0!==i&&s===i.nextBreakPoint)return i.breakIt(s,n),s;if(p=o[s],p!==r.OPS.dependency)this[p].apply(this,a[s]);else for(const e of a[s]){const t=e.startsWith("g_")?h:f;if(!t.has(e))return t.get(e,n),s}if(s++,s===l)return s;if(c&&++d>10){if(Date.now()>u)return n(),s;d=0}}}#ce(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();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)}endDrawing(){this.#ce(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const t of e.values())"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement&&(t.width=t.height=0);e.clear()}this._cachedBitmapsMap.clear()}_scaleImage(e,t){const n=e.width,r=e.height;let i,a,o=Math.max(Math.hypot(t[0],t[1]),1),s=Math.max(Math.hypot(t[2],t[3]),1),l=n,c=r,u="prescale1";for(;o>2&&l>1||s>2&&c>1;){let t=l,n=c;o>2&&l>1&&(t=Math.ceil(l/2),o/=l/t),s>2&&c>1&&(n=Math.ceil(c/2),s/=c/n),i=this.cachedCanvases.getCanvas(u,t,n),a=i.context,a.clearRect(0,0,t,n),a.drawImage(e,0,0,l,c,0,0,t,n),e=i.canvas,l=t,c=n,u="prescale1"===u?"prescale2":"prescale1"}return{img:e,paintWidth:l,paintHeight:c}}_createMaskCanvas(e){const t=this.ctx,{width:n,height:o}=e,s=this.current.fillColor,l=this.current.patternFill,c=(0,i.getCurrentTransform)(t);let d,h,p,m;if((e.bitmap||e.data)&&e.count>1){const t=e.bitmap||e.data.buffer;h=JSON.stringify(l?c:[c.slice(0,4),s]),d=this._cachedBitmapsMap.get(t),d||(d=new Map,this._cachedBitmapsMap.set(t,d));const n=d.get(h);if(n&&!l)return{canvas:n,offsetX:Math.round(Math.min(c[0],c[2])+c[4]),offsetY:Math.round(Math.min(c[1],c[3])+c[5])};p=n}p||(m=this.cachedCanvases.getCanvas("maskCanvas",n,o),f(m.context,e));let g=r.Util.transform(c,[1/n,0,0,-1/o,0,0]);g=r.Util.transform(g,[1,0,0,1,0,-o]);const v=r.Util.applyTransform([0,0],g),y=r.Util.applyTransform([n,o],g),E=r.Util.normalizeRect([v[0],v[1],y[0],y[1]]),_=Math.round(E[2]-E[0])||1,w=Math.round(E[3]-E[1])||1,S=this.cachedCanvases.getCanvas("fillCanvas",_,w),C=S.context,k=Math.min(v[0],y[0]),A=Math.min(v[1],y[1]);C.translate(-k,-A),C.transform(...g),p||(p=this._scaleImage(m.canvas,(0,i.getCurrentTransformInverse)(C)),p=p.img,d&&l&&d.set(h,p)),C.imageSmoothingEnabled=b((0,i.getCurrentTransform)(C),e.interpolate),u(C,p,0,0,p.width,p.height,0,0,n,o),C.globalCompositeOperation="source-in";const x=r.Util.transform((0,i.getCurrentTransformInverse)(C),[1,0,0,1,-k,-A]);return C.fillStyle=l?s.getPattern(t,this,x,a.PathType.FILL):s,C.fillRect(0,0,n,o),d&&!l&&(this.cachedCanvases.delete("fillCanvas"),d.set(h,S.canvas)),{canvas:S.canvas,offsetX:Math.round(k),offsetY:Math.round(A)}}setLineWidth(e){e!==this.current.lineWidth&&(this._cachedScaleForStroking=null),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(e){this.ctx.lineCap=E[e]}setLineJoin(e){this.ctx.lineJoin=_[e]}setMiterLimit(e){this.ctx.miterLimit=e}setDash(e,t){const n=this.ctx;void 0!==n.setLineDash&&(n.setLineDash(e),n.lineDashOffset=t)}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(const[t,n]of e)switch(t){case"LW":this.setLineWidth(n);break;case"LC":this.setLineCap(n);break;case"LJ":this.setLineJoin(n);break;case"ML":this.setMiterLimit(n);break;case"D":this.setDash(n[0],n[1]);break;case"RI":this.setRenderingIntent(n);break;case"FL":this.setFlatness(n);break;case"Font":this.setFont(n[0],n[1]);break;case"CA":this.current.strokeAlpha=n;break;case"ca":this.current.fillAlpha=n,this.ctx.globalAlpha=n;break;case"BM":this.ctx.globalCompositeOperation=n;break;case"SMask":this.current.activeSMask=n?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.current.transferMaps=n}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const e=this.ctx.canvas.width,t=this.ctx.canvas.height,n="smaskGroupAt"+this.groupLevel,r=this.cachedCanvases.getCanvas(n,e,t);this.suspendedCtx=this.ctx,this.ctx=r.context;const a=this.ctx;a.setTransform(...(0,i.getCurrentTransform)(this.suspendedCtx)),p(this.suspendedCtx,a),function(e,t){if(e._removeMirroring)throw new Error("Context is already forwarding operations.");e.__originalSave=e.save,e.__originalRestore=e.restore,e.__originalRotate=e.rotate,e.__originalScale=e.scale,e.__originalTranslate=e.translate,e.__originalTransform=e.transform,e.__originalSetTransform=e.setTransform,e.__originalResetTransform=e.resetTransform,e.__originalClip=e.clip,e.__originalMoveTo=e.moveTo,e.__originalLineTo=e.lineTo,e.__originalBezierCurveTo=e.bezierCurveTo,e.__originalRect=e.rect,e.__originalClosePath=e.closePath,e.__originalBeginPath=e.beginPath,e._removeMirroring=()=>{e.save=e.__originalSave,e.restore=e.__originalRestore,e.rotate=e.__originalRotate,e.scale=e.__originalScale,e.translate=e.__originalTranslate,e.transform=e.__originalTransform,e.setTransform=e.__originalSetTransform,e.resetTransform=e.__originalResetTransform,e.clip=e.__originalClip,e.moveTo=e.__originalMoveTo,e.lineTo=e.__originalLineTo,e.bezierCurveTo=e.__originalBezierCurveTo,e.rect=e.__originalRect,e.closePath=e.__originalClosePath,e.beginPath=e.__originalBeginPath,delete e._removeMirroring},e.save=function(){t.save(),this.__originalSave()},e.restore=function(){t.restore(),this.__originalRestore()},e.translate=function(e,n){t.translate(e,n),this.__originalTranslate(e,n)},e.scale=function(e,n){t.scale(e,n),this.__originalScale(e,n)},e.transform=function(e,n,r,i,a,o){t.transform(e,n,r,i,a,o),this.__originalTransform(e,n,r,i,a,o)},e.setTransform=function(e,n,r,i,a,o){t.setTransform(e,n,r,i,a,o),this.__originalSetTransform(e,n,r,i,a,o)},e.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},e.rotate=function(e){t.rotate(e),this.__originalRotate(e)},e.clip=function(e){t.clip(e),this.__originalClip(e)},e.moveTo=function(e,n){t.moveTo(e,n),this.__originalMoveTo(e,n)},e.lineTo=function(e,n){t.lineTo(e,n),this.__originalLineTo(e,n)},e.bezierCurveTo=function(e,n,r,i,a,o){t.bezierCurveTo(e,n,r,i,a,o),this.__originalBezierCurveTo(e,n,r,i,a,o)},e.rect=function(e,n,r,i){t.rect(e,n,r,i),this.__originalRect(e,n,r,i)},e.closePath=function(){t.closePath(),this.__originalClosePath()},e.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}(a,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),p(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const t=this.current.activeSMask;(function(e,t,n,r){const i=r[0],a=r[1],o=r[2]-i,s=r[3]-a;0!==o&&0!==s&&(function(e,t,n,r,i,a,o,s,l,c,u){const d=!!a,h=d?a[0]:0,f=d?a[1]:0,p=d?a[2]:0;let m;m="Luminosity"===i?y:v;const b=Math.min(r,Math.ceil(1048576/n));for(let i=0;i100&&(c=100),this.current.fontSizeScale=t/c,this.ctx.font=`${s} ${o} ${c}px ${l}`}setTextRenderingMode(e){this.current.textRenderingMode=e}setTextRise(e){this.current.textRise=e}moveText(e,t){this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=t}setLeadingMoveText(e,t){this.setLeading(-t),this.moveText(e,t)}setTextMatrix(e,t,n,r,i,a){this.current.textMatrix=[e,t,n,r,i,a],this.current.textMatrixScale=Math.hypot(e,t),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(e,t,n,a){const o=this.ctx,s=this.current,l=s.font,c=s.textRenderingMode,u=s.fontSize/s.fontSizeScale,d=c&r.TextRenderingMode.FILL_STROKE_MASK,h=!!(c&r.TextRenderingMode.ADD_TO_PATH_FLAG),f=s.patternFill&&!l.missingFile;let p;(l.disableFontFace||h||f)&&(p=l.getPathGenerator(this.commonObjs,e)),l.disableFontFace||f?(o.save(),o.translate(t,n),o.beginPath(),p(o,u),a&&o.setTransform(...a),d!==r.TextRenderingMode.FILL&&d!==r.TextRenderingMode.FILL_STROKE||o.fill(),d!==r.TextRenderingMode.STROKE&&d!==r.TextRenderingMode.FILL_STROKE||o.stroke(),o.restore()):(d!==r.TextRenderingMode.FILL&&d!==r.TextRenderingMode.FILL_STROKE||o.fillText(e,t,n),d!==r.TextRenderingMode.STROKE&&d!==r.TextRenderingMode.FILL_STROKE||o.strokeText(e,t,n)),h&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,i.getCurrentTransform)(o),x:t,y:n,fontSize:u,addToPath:p})}get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);const t=e.getImageData(0,0,10,10).data;let n=!1;for(let e=3;e0&&t[e]<255){n=!0;break}return(0,r.shadow)(this,"isFontSubpixelAAEnabled",n)}showText(e){const t=this.current,n=t.font;if(n.isType3Font)return this.showType3Text(e);const o=t.fontSize;if(0===o)return;const s=this.ctx,l=t.fontSizeScale,c=t.charSpacing,u=t.wordSpacing,d=t.fontDirection,h=t.textHScale*d,f=e.length,p=n.vertical,m=p?1:-1,g=n.defaultVMetrics,v=o*t.fontMatrix[0],y=t.textRenderingMode===r.TextRenderingMode.FILL&&!n.disableFontFace&&!t.patternFill;let b;if(s.save(),s.transform(...t.textMatrix),s.translate(t.x,t.y+t.textRise),d>0?s.scale(h,-1):s.scale(h,1),t.patternFill){s.save();const e=t.fillColor.getPattern(s,this,(0,i.getCurrentTransformInverse)(s),a.PathType.FILL);b=(0,i.getCurrentTransform)(s),s.restore(),s.fillStyle=e}let E=t.lineWidth;const _=t.textMatrixScale;if(0===_||0===E){const e=t.textRenderingMode&r.TextRenderingMode.FILL_STROKE_MASK;e!==r.TextRenderingMode.STROKE&&e!==r.TextRenderingMode.FILL_STROKE||(E=this.getSinglePixelWidth())}else E/=_;if(1!==l&&(s.scale(l,l),E/=l),s.lineWidth=E,n.isInvalidPDFjsFont){const n=[];let r=0;for(const t of e)n.push(t.unicode),r+=t.width;return s.fillText(n.join(""),0,0),t.x+=r*v*h,s.restore(),void this.compose()}let w,S=0;for(w=0;w0){const e=1e3*s.measureText(a).width/o*l;if(Cnew C(e,this.commonObjs,this.objs,this.canvasFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};t=new a.TilingPattern(e,n,this.ctx,o,r)}else t=this._getPattern(e[1],e[2]);return t}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(e,t,n){const i=this.selectColor?.(e,t,n)||r.Util.makeHexColor(e,t,n);this.ctx.strokeStyle=i,this.current.strokeColor=i}setFillRGBColor(e,t,n){const i=this.selectColor?.(e,t,n)||r.Util.makeHexColor(e,t,n);this.ctx.fillStyle=i,this.current.fillColor=i,this.current.patternFill=!1}_getPattern(e,t=null){let n;return this.cachedPatterns.has(e)?n=this.cachedPatterns.get(e):(n=(0,a.getShadingPattern)(this.objs.get(e)),this.cachedPatterns.set(e,n)),t&&(n.matrix=t),n}shadingFill(e){if(!this.contentVisible)return;const t=this.ctx;this.save();const n=this._getPattern(e);t.fillStyle=n.getPattern(t,this,(0,i.getCurrentTransformInverse)(t),a.PathType.SHADING);const o=(0,i.getCurrentTransformInverse)(t);if(o){const e=t.canvas,n=e.width,i=e.height,a=r.Util.applyTransform([0,0],o),s=r.Util.applyTransform([0,i],o),l=r.Util.applyTransform([n,0],o),c=r.Util.applyTransform([n,i],o),u=Math.min(a[0],s[0],l[0],c[0]),d=Math.min(a[1],s[1],l[1],c[1]),h=Math.max(a[0],s[0],l[0],c[0]),f=Math.max(a[1],s[1],l[1],c[1]);this.ctx.fillRect(u,d,h-u,f-d)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,r.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,r.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(e,t){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(e)&&6===e.length&&this.transform(...e),this.baseTransform=(0,i.getCurrentTransform)(this.ctx),t)){const e=t[2]-t[0],n=t[3]-t[1];this.ctx.rect(t[0],t[1],e,n),this.current.updateRectMinMax((0,i.getCurrentTransform)(this.ctx),t),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const t=this.ctx;e.isolated||(0,r.info)("TODO: Support non-isolated groups."),e.knockout&&(0,r.warn)("Knockout groups not supported.");const n=(0,i.getCurrentTransform)(t);if(e.matrix&&t.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let a=r.Util.getAxialAlignedBoundingBox(e.bbox,(0,i.getCurrentTransform)(t));const o=[0,0,t.canvas.width,t.canvas.height];a=r.Util.intersect(a,o)||[0,0,0,0];const l=Math.floor(a[0]),c=Math.floor(a[1]);let u=Math.max(Math.ceil(a[2])-l,1),d=Math.max(Math.ceil(a[3])-c,1),h=1,f=1;u>s&&(h=u/s,u=s),d>s&&(f=d/s,d=s),this.current.startNewPathAndClipBox([0,0,u,d]);let m="groupAt"+this.groupLevel;e.smask&&(m+="_smask_"+this.smaskCounter++%2);const g=this.cachedCanvases.getCanvas(m,u,d),v=g.context;v.scale(1/h,1/f),v.translate(-l,-c),v.transform(...n),e.smask?this.smaskStack.push({canvas:g.canvas,context:v,offsetX:l,offsetY:c,scaleX:h,scaleY:f,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}):(t.setTransform(1,0,0,1,0,0),t.translate(l,c),t.scale(h,f),t.save()),p(t,v),this.ctx=v,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(t),this.groupLevel++}endGroup(e){if(!this.contentVisible)return;this.groupLevel--;const t=this.ctx,n=this.groupStack.pop();if(this.ctx=n,this.ctx.imageSmoothingEnabled=!1,e.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const e=(0,i.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...e);const n=r.Util.getAxialAlignedBoundingBox([0,0,t.canvas.width,t.canvas.height],e);this.ctx.drawImage(t.canvas,0,0),this.ctx.restore(),this.compose(n)}}beginAnnotation(e,t,n,a,o){if(this.#ce(),m(this.ctx,this.foregroundColor),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(t)&&4===t.length){const a=t[2]-t[0],s=t[3]-t[1];if(o&&this.annotationCanvasMap){(n=n.slice())[4]-=t[0],n[5]-=t[1],(t=t.slice())[0]=t[1]=0,t[2]=a,t[3]=s;const[o,l]=r.Util.singularValueDecompose2dScale((0,i.getCurrentTransform)(this.ctx)),{viewportScale:c}=this,u=Math.ceil(a*this.outputScaleX*c),d=Math.ceil(s*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(u,d);const{canvas:h,context:f}=this.annotationCanvas;this.annotationCanvasMap.set(e,h),this.annotationCanvas.savedCtx=this.ctx,this.ctx=f,this.ctx.setTransform(o,0,0,-l,0,s*l),m(this.ctx,this.foregroundColor)}else m(this.ctx,this.foregroundColor),this.ctx.rect(t[0],t[1],a,s),this.ctx.clip(),this.endPath()}this.current=new d(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...n),this.transform(...a)}endAnnotation(){this.annotationCanvas&&(this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e){if(!this.contentVisible)return;const t=e.count;(e=this.getObject(e.data,e)).count=t;const n=this.ctx,r=this.processingType3;if(r&&(void 0===r.compiled&&(r.compiled=function(e){const{width:t,height:n}=e;if(t>1e3||n>1e3)return null;const r=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),i=t+1;let a,o,s,l=new Uint8Array(i*(n+1));const c=t+7&-8;let u=new Uint8Array(c*n),d=0;for(const t of e.data){let e=128;for(;e>0;)u[d++]=t&e?0:255,e>>=1}let h=0;for(d=0,0!==u[d]&&(l[0]=1,++h),o=1;o>2)+(u[d+1]?4:0)+(u[d-c+1]?8:0),r[e]&&(l[s+o]=r[e],++h),d++;if(u[d-c]!==u[d]&&(l[s+o]=u[d]?2:4,++h),h>1e3)return null}for(d=c*(n-1),s=a*i,0!==u[d]&&(l[s]=8,++h),o=1;o1e3)return null;const f=new Int32Array([0,i,-1,0,-i,0,0,0,1]),p=new Path2D;for(a=0;h&&a<=n;a++){let e=a*i;const n=e+t;for(;e>4,l[e]&=o>>2|o<<2),p.lineTo(e%i,e/i|0),l[e]||--h}while(r!==e);--a}return u=null,l=null,function(e){e.save(),e.scale(1/t,-1/n),e.translate(0,-n),e.fill(p),e.beginPath(),e.restore()}}(e)),r.compiled))return void r.compiled(n);const i=this._createMaskCanvas(e),a=i.canvas;n.save(),n.setTransform(1,0,0,1,0,0),n.drawImage(a,i.offsetX,i.offsetY),n.restore(),this.compose()}paintImageMaskXObjectRepeat(e,t,n=0,a=0,o,s){if(!this.contentVisible)return;e=this.getObject(e.data,e);const l=this.ctx;l.save();const c=(0,i.getCurrentTransform)(l);l.transform(t,n,a,o,0,0);const u=this._createMaskCanvas(e);l.setTransform(1,0,0,1,u.offsetX-c[4],u.offsetY-c[5]);for(let e=0,i=s.length;et?o/t:1,r=a>t?a/t:1}}this._cachedScaleForStroking=[n,r]}return this._cachedScaleForStroking}rescaleAndStroke(e){const{ctx:t}=this,{lineWidth:n}=this.current,[r,a]=this.getScaleForStroking();if(t.lineWidth=n||1,1===r&&1===a)return void t.stroke();let o,s,l;e&&(o=(0,i.getCurrentTransform)(t),s=t.getLineDash().slice(),l=t.lineDashOffset),t.scale(r,a);const c=Math.max(r,a);t.setLineDash(t.getLineDash().map(e=>e/c)),t.lineDashOffset/=c,t.stroke(),e&&(t.setTransform(...o),t.setLineDash(s),t.lineDashOffset=l)}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}}t.CanvasGraphics=C;for(const e in r.OPS)void 0!==C.prototype[e]&&(C.prototype[r.OPS[e]]=C.prototype[e])},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TilingPattern=t.PathType=void 0,t.getShadingPattern=function(e){switch(e[0]){case"RadialAxial":return new l(e);case"Mesh":return new d(e);case"Dummy":return new h}throw new Error(`Unknown IR type: ${e[0]}`)};var r=n(1),i=n(6);const a={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function o(e,t){if(!t)return;const n=t[2]-t[0],r=t[3]-t[1],i=new Path2D;i.rect(t[0],t[1],n,r),e.clip(i)}t.PathType=a;class s{constructor(){this.constructor===s&&(0,r.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,r.unreachable)("Abstract method `getPattern` called.")}}class l extends s{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}_createGradient(e){let t;"axial"===this._type?t=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(t=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const e of this._colorStops)t.addColorStop(e[0],e[1]);return t}getPattern(e,t,n,s){let l;if(s===a.STROKE||s===a.FILL){const a=t.current.getClippedPathBoundingBox(s,(0,i.getCurrentTransform)(e))||[0,0,0,0],c=Math.ceil(a[2]-a[0])||1,u=Math.ceil(a[3]-a[1])||1,d=t.cachedCanvases.getCanvas("pattern",c,u,!0),h=d.context;h.clearRect(0,0,h.canvas.width,h.canvas.height),h.beginPath(),h.rect(0,0,h.canvas.width,h.canvas.height),h.translate(-a[0],-a[1]),n=r.Util.transform(n,[1,0,0,1,a[0],a[1]]),h.transform(...t.baseTransform),this.matrix&&h.transform(...this.matrix),o(h,this._bbox),h.fillStyle=this._createGradient(h),h.fill(),l=e.createPattern(d.canvas,"no-repeat");const f=new DOMMatrix(n);l.setTransform(f)}else o(e,this._bbox),l=this._createGradient(e);return l}}function c(e,t,n,r,i,a,o,s){const l=t.coords,c=t.colors,u=e.data,d=4*e.width;let h;l[n+1]>l[r+1]&&(h=n,n=r,r=h,h=a,a=o,o=h),l[r+1]>l[i+1]&&(h=r,r=i,i=h,h=o,o=s,s=h),l[n+1]>l[r+1]&&(h=n,n=r,r=h,h=a,a=o,o=h);const f=(l[n]+t.offsetX)*t.scaleX,p=(l[n+1]+t.offsetY)*t.scaleY,m=(l[r]+t.offsetX)*t.scaleX,g=(l[r+1]+t.offsetY)*t.scaleY,v=(l[i]+t.offsetX)*t.scaleX,y=(l[i+1]+t.offsetY)*t.scaleY;if(p>=y)return;const b=c[a],E=c[a+1],_=c[a+2],w=c[o],S=c[o+1],C=c[o+2],k=c[s],A=c[s+1],x=c[s+2],P=Math.round(p),M=Math.round(y);let T,R,O,I,D,L,N,F;for(let e=P;e<=M;e++){if(ey?1:g===y?0:(g-e)/(g-y),T=m-(m-v)*t,R=w-(w-k)*t,O=S-(S-A)*t,I=C-(C-x)*t}let t;t=ey?1:(p-e)/(p-y),D=f-(f-v)*t,L=b-(b-k)*t,N=E-(E-A)*t,F=_-(_-x)*t;const n=Math.round(Math.min(T,D)),r=Math.round(Math.max(T,D));let i=d*e+4*n;for(let e=n;e<=r;e++)t=(T-e)/(T-D),t<0?t=0:t>1&&(t=1),u[i++]=R-(R-L)*t|0,u[i++]=O-(O-N)*t|0,u[i++]=I-(I-F)*t|0,u[i++]=255}}function u(e,t,n){const r=t.coords,i=t.colors;let a,o;switch(t.type){case"lattice":const s=t.verticesPerRow,l=Math.floor(r.length/s)-1,u=s-1;for(a=0;a=r?i=r:n=i/e,{scale:n,size:i}}clipBbox(e,t,n,r,a){const o=r-t,s=a-n;e.ctx.rect(t,n,o,s),e.current.updateRectMinMax((0,i.getCurrentTransform)(e.ctx),[t,n,r,a]),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,t,n){const i=e.ctx,a=e.current;switch(t){case 1:const e=this.ctx;i.fillStyle=e.fillStyle,i.strokeStyle=e.strokeStyle,a.fillColor=e.fillStyle,a.strokeColor=e.strokeStyle;break;case 2:const o=r.Util.makeHexColor(n[0],n[1],n[2]);i.fillStyle=o,i.strokeStyle=o,a.fillColor=o,a.strokeColor=o;break;default:throw new r.FormatError(`Unsupported paint type: ${t}`)}}getPattern(e,t,n,i){let o=n;i!==a.SHADING&&(o=r.Util.transform(o,t.baseTransform),this.matrix&&(o=r.Util.transform(o,this.matrix)));const s=this.createPatternCanvas(t);let l=new DOMMatrix(o);l=l.translate(s.offsetX,s.offsetY),l=l.scale(1/s.scaleX,1/s.scaleY);const c=e.createPattern(s.canvas,"repeat");return c.setTransform(l),c}}t.TilingPattern=f},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.applyMaskImageData=function({src:e,srcPos:t=0,dest:n,destPos:i=0,width:a,height:o,inverseDecode:s=!1}){const l=r.FeatureTest.isLittleEndian?4278190080:255,[c,u]=s?[0,l]:[l,0],d=a>>3,h=7&a,f=e.length;n=new Uint32Array(n.buffer);for(let r=0;r{Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalWorkerOptions=void 0;const n=Object.create(null);t.GlobalWorkerOptions=n,n.workerPort=null,n.workerSrc=""},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MessageHandler=void 0;var r=n(1);function i(e){switch(e instanceof Error||"object"==typeof e&&null!==e||(0,r.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),e.name){case"AbortException":return new r.AbortException(e.message);case"MissingPDFException":return new r.MissingPDFException(e.message);case"PasswordException":return new r.PasswordException(e.message,e.code);case"UnexpectedResponseException":return new r.UnexpectedResponseException(e.message,e.status);case"UnknownErrorException":return new r.UnknownErrorException(e.message,e.details);default:return new r.UnknownErrorException(e.message,e.toString())}}t.MessageHandler=class{constructor(e,t,n){this.sourceName=e,this.targetName=t,this.comObj=n,this.callbackId=1,this.streamId=1,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,n=this.callbackCapabilities[e];if(!n)throw new Error(`Cannot resolve callback ${e}`);if(delete this.callbackCapabilities[e],1===t.callback)n.resolve(t.data);else{if(2!==t.callback)throw new Error("Unexpected callback case");n.reject(i(t.reason))}return}const r=this.actionHandler[t.action];if(!r)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const e=this.sourceName,a=t.sourceName;return void new Promise(function(e){e(r(t.data))}).then(function(r){n.postMessage({sourceName:e,targetName:a,callback:1,callbackId:t.callbackId,data:r})},function(r){n.postMessage({sourceName:e,targetName:a,callback:2,callbackId:t.callbackId,reason:i(r)})})}t.streamId?this._createStreamSink(t):r(t.data)},n.addEventListener("message",this._onComObjOnMessage)}on(e,t){const n=this.actionHandler;if(n[e])throw new Error(`There is already an actionName called "${e}"`);n[e]=t}send(e,t,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},n)}sendWithPromise(e,t,n){const i=this.callbackId++,a=(0,r.createPromiseCapability)();this.callbackCapabilities[i]=a;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:i,data:t},n)}catch(e){a.reject(e)}return a.promise}sendWithStream(e,t,n,a){const o=this.streamId++,s=this.sourceName,l=this.targetName,c=this.comObj;return new ReadableStream({start:n=>{const i=(0,r.createPromiseCapability)();return this.streamControllers[o]={controller:n,startCall:i,pullCall:null,cancelCall:null,isClosed:!1},c.postMessage({sourceName:s,targetName:l,action:e,streamId:o,data:t,desiredSize:n.desiredSize},a),i.promise},pull:e=>{const t=(0,r.createPromiseCapability)();return this.streamControllers[o].pullCall=t,c.postMessage({sourceName:s,targetName:l,stream:6,streamId:o,desiredSize:e.desiredSize}),t.promise},cancel:e=>{(0,r.assert)(e instanceof Error,"cancel must have a valid reason");const t=(0,r.createPromiseCapability)();return this.streamControllers[o].cancelCall=t,this.streamControllers[o].isClosed=!0,c.postMessage({sourceName:s,targetName:l,stream:1,streamId:o,reason:i(e)}),t.promise}},n)}_createStreamSink(e){const t=e.streamId,n=this.sourceName,a=e.sourceName,o=this.comObj,s=this,l=this.actionHandler[e.action],c={enqueue(e,i=1,s){if(this.isCancelled)return;const l=this.desiredSize;this.desiredSize-=i,l>0&&this.desiredSize<=0&&(this.sinkCapability=(0,r.createPromiseCapability)(),this.ready=this.sinkCapability.promise),o.postMessage({sourceName:n,targetName:a,stream:4,streamId:t,chunk:e},s)},close(){this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:n,targetName:a,stream:3,streamId:t}),delete s.streamSinks[t])},error(e){(0,r.assert)(e instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:n,targetName:a,stream:5,streamId:t,reason:i(e)}))},sinkCapability:(0,r.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};c.sinkCapability.resolve(),c.ready=c.sinkCapability.promise,this.streamSinks[t]=c,new Promise(function(t){t(l(e.data,c))}).then(function(){o.postMessage({sourceName:n,targetName:a,stream:8,streamId:t,success:!0})},function(e){o.postMessage({sourceName:n,targetName:a,stream:8,streamId:t,reason:i(e)})})}_processStreamMessage(e){const t=e.streamId,n=this.sourceName,a=e.sourceName,o=this.comObj,s=this.streamControllers[t],l=this.streamSinks[t];switch(e.stream){case 8:e.success?s.startCall.resolve():s.startCall.reject(i(e.reason));break;case 7:e.success?s.pullCall.resolve():s.pullCall.reject(i(e.reason));break;case 6:if(!l){o.postMessage({sourceName:n,targetName:a,stream:7,streamId:t,success:!0});break}l.desiredSize<=0&&e.desiredSize>0&&l.sinkCapability.resolve(),l.desiredSize=e.desiredSize,new Promise(function(e){e(l.onPull&&l.onPull())}).then(function(){o.postMessage({sourceName:n,targetName:a,stream:7,streamId:t,success:!0})},function(e){o.postMessage({sourceName:n,targetName:a,stream:7,streamId:t,reason:i(e)})});break;case 4:if((0,r.assert)(s,"enqueue should have stream controller"),s.isClosed)break;s.controller.enqueue(e.chunk);break;case 3:if((0,r.assert)(s,"close should have stream controller"),s.isClosed)break;s.isClosed=!0,s.controller.close(),this._deleteStreamController(s,t);break;case 5:(0,r.assert)(s,"error should have stream controller"),s.controller.error(i(e.reason)),this._deleteStreamController(s,t);break;case 2:e.success?s.cancelCall.resolve():s.cancelCall.reject(i(e.reason)),this._deleteStreamController(s,t);break;case 1:if(!l)break;new Promise(function(t){t(l.onCancel&&l.onCancel(i(e.reason)))}).then(function(){o.postMessage({sourceName:n,targetName:a,stream:2,streamId:t,success:!0})},function(e){o.postMessage({sourceName:n,targetName:a,stream:2,streamId:t,reason:i(e)})}),l.sinkCapability.reject(i(e.reason)),l.isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}async _deleteStreamController(e,t){await Promise.allSettled([e.startCall&&e.startCall.promise,e.pullCall&&e.pullCall.promise,e.cancelCall&&e.cancelCall.promise]),delete this.streamControllers[t]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Metadata=void 0;var r=n(1);t.Metadata=class{#ue;#de;constructor({parsedData:e,rawData:t}){this.#ue=e,this.#de=t}getRaw(){return this.#de}get(e){return this.#ue.get(e)??null}getAll(){return(0,r.objectFromMap)(this.#ue)}has(e){return this.#ue.has(e)}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OptionalContentConfig=void 0;var r=n(1),i=n(8);const a=Symbol("INTERNAL");class o{#he=!0;constructor(e,t){this.name=e,this.intent=t}get visible(){return this.#he}_setVisible(e,t){e!==a&&(0,r.unreachable)("Internal method `_setVisible` called."),this.#he=t}}t.OptionalContentConfig=class{#fe=null;#pe=new Map;#me=null;#ge=null;constructor(e){if(this.name=null,this.creator=null,null!==e){this.name=e.name,this.creator=e.creator,this.#ge=e.order;for(const t of e.groups)this.#pe.set(t.id,new o(t.name,t.intent));if("OFF"===e.baseState)for(const e of this.#pe.values())e._setVisible(a,!1);for(const t of e.on)this.#pe.get(t)._setVisible(a,!0);for(const t of e.off)this.#pe.get(t)._setVisible(a,!1);this.#me=this.getHash()}}#ve(e){const t=e.length;if(t<2)return!0;const n=e[0];for(let i=1;i0?(0,r.objectFromMap)(this.#pe):null}getGroup(e){return this.#pe.get(e)||null}getHash(){if(null!==this.#fe)return this.#fe;const e=new i.MurmurHash3_64;for(const[t,n]of this.#pe)e.update(`${t}:${n.visible}`);return this.#fe=e.hexdigest()}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFDataTransportStream=void 0;var r=n(1),i=n(6);t.PDFDataTransportStream=class{constructor({length:e,initialData:t,progressiveDone:n=!1,contentDispositionFilename:i=null,disableRange:a=!1,disableStream:o=!1},s){if((0,r.assert)(s,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=n,this._contentDispositionFilename=i,t?.length>0){const e=t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer;this._queuedChunks.push(e)}this._pdfDataRangeTransport=s,this._isStreamingSupported=!o,this._isRangeSupported=!a,this._contentLength=e,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({begin:e,chunk:t}){const n=t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer;if(void 0===e)this._fullRequestReader?this._fullRequestReader._enqueue(n):this._queuedChunks.push(n);else{const t=this._rangeReaders.some(function(t){return t._begin===e&&(t._enqueue(n),!0)});(0,r.assert)(t,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(e){void 0===e.total?this._rangeReaders[0]?.onProgress?.({loaded:e.loaded}):this._fullRequestReader?.onProgress?.({loaded:e.loaded,total:e.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){const t=this._rangeReaders.indexOf(e);t>=0&&this._rangeReaders.splice(t,1)}getFullReader(){(0,r.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new a(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=new o(this,e,t);return this._pdfDataRangeTransport.requestDataRange(e,t),this._rangeReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeReaders.slice(0))t.cancel(e);this._pdfDataRangeTransport.abort()}};class a{constructor(e,t,n=!1,r=null){this._stream=e,this._done=n||!1,this._filename=(0,i.isPdfFile)(r)?r: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,r.createPromiseCapability)();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class o{constructor(e,t,n){this._stream=e,this._begin=t,this._end=n,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(0===this._requests.length)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}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,r.createPromiseCapability)();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.XfaText=void 0;class n{static textContent(e){const t=[],r={items:t,styles:Object.create(null)};return function e(r){if(!r)return;let i=null;const a=r.name;if("#text"===a)i=r.value;else{if(!n.shouldBuildText(a))return;r?.attributes?.textContent?i=r.attributes.textContent:r.value&&(i=r.value)}if(null!==i&&t.push({str:i}),r.children)for(const t of r.children)e(t)}(e),r}static shouldBuildText(e){return!("textarea"===e||"input"===e||"option"===e||"select"===e)}}t.XfaText=n},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeStandardFontDataFactory=t.NodeCanvasFactory=t.NodeCMapReaderFactory=void 0;var r=n(7);const i=function(e){return new Promise((t,n)=>{__webpack_require__(3237).readFile(e,(e,r)=>{!e&&r?t(new Uint8Array(r)):n(new Error(e))})})};class a extends r.BaseCanvasFactory{_createCanvas(e,t){return __webpack_require__(7640).createCanvas(e,t)}}t.NodeCanvasFactory=a;class o extends r.BaseCMapReaderFactory{_fetchData(e,t){return i(e).then(e=>({cMapData:e,compressionType:t}))}}t.NodeCMapReaderFactory=o;class s extends r.BaseStandardFontDataFactory{_fetchData(e){return i(e)}}t.NodeStandardFontDataFactory=s},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFNodeStream=void 0;var r=n(1),i=n(22);const a=__webpack_require__(3237),o=__webpack_require__(7492),s=__webpack_require__(1815),l=__webpack_require__(6671),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?._loaded??0}getFullReader(){return(0,r.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new m(this):new f(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=this.isFsUrl?new g(this,e,t):new p(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}};class u{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;const t=e.source;this._contentLength=t.length,this._loaded=0,this._filename=null,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._readableStream=null,this._readCapability=(0,r.createPromiseCapability)(),this._headersCapability=(0,r.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,r.createPromiseCapability)(),this.read()):(this._loaded+=e.length,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 r.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class d{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=(0,r.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,r.createPromiseCapability)(),this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",e=>{this._error(e)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function h(e,t){return{protocol:e.protocol,auth:e.auth,host:e.hostname,port:e.port,path:e.path,method:"GET",headers:t}}class f extends u{constructor(e){super(e);const t=t=>{if(404===t.statusCode){const e=new r.MissingPDFException(`Missing PDF "${this._url}".`);return this._storedError=e,void this._headersCapability.reject(e)}this._headersCapability.resolve(),this._setReadableStream(t);const n=e=>this._readableStream.headers[e.toLowerCase()],{allowRangeRequests:a,suggestedLength:o}=(0,i.validateRangeRequestCapabilities)({getResponseHeader:n,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=a,this._contentLength=o||this._contentLength,this._filename=(0,i.extractFilenameFromHeader)(n)};this._request=null,"http:"===this._url.protocol?this._request=o.request(h(this._url,e.httpHeaders),t):this._request=s.request(h(this._url,e.httpHeaders),t),this._request.on("error",e=>{this._storedError=e,this._headersCapability.reject(e)}),this._request.end()}}class p extends d{constructor(e,t,n){super(e),this._httpHeaders={};for(const t in e.httpHeaders){const n=e.httpHeaders[t];void 0!==n&&(this._httpHeaders[t]=n)}this._httpHeaders.Range=`bytes=${t}-${n-1}`;const i=e=>{if(404===e.statusCode){const e=new r.MissingPDFException(`Missing PDF "${this._url}".`);return void(this._storedError=e)}this._setReadableStream(e)};this._request=null,"http:"===this._url.protocol?this._request=o.request(h(this._url,this._httpHeaders),i):this._request=s.request(h(this._url,this._httpHeaders),i),this._request.on("error",e=>{this._storedError=e}),this._request.end()}}class m extends u{constructor(e){super(e);let t=decodeURIComponent(this._url.path);c.test(this._url.href)&&(t=t.replace(/^\//,"")),a.lstat(t,(e,n)=>{if(e)return"ENOENT"===e.code&&(e=new r.MissingPDFException(`Missing PDF "${t}".`)),this._storedError=e,void this._headersCapability.reject(e);this._contentLength=n.size,this._setReadableStream(a.createReadStream(t)),this._headersCapability.resolve()})}}class g extends d{constructor(e,t,n){super(e);let r=decodeURIComponent(this._url.path);c.test(this._url.href)&&(r=r.replace(/^\//,"")),this._setReadableStream(a.createReadStream(r,{start:t,end:n-1}))}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createResponseStatusError=function(e,t){return 404===e||0===e&&t.startsWith("file:")?new r.MissingPDFException('Missing PDF "'+t+'".'):new r.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((0,a.isPdfFile)(e))return e}return null},t.validateRangeRequestCapabilities=function({getResponseHeader:e,isHttp:t,rangeChunkSize:n,disableRange:r}){const i={allowRangeRequests:!1,suggestedLength:void 0},a=parseInt(e("Content-Length"),10);return Number.isInteger(a)?(i.suggestedLength=a,a<=2*n||r||!t||"bytes"!==e("Accept-Ranges")||"identity"!==(e("Content-Encoding")||"identity")||(i.allowRangeRequests=!0),i):i},t.validateResponseStatus=function(e){return 200===e||206===e};var r=n(1),i=n(23),a=n(6)},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getFilenameFromContentDispositionHeader=function(e){let t=!0,n=i("filename\\*","i").exec(e);if(n){n=n[1];let e=s(n);return e=unescape(e),e=l(e),e=c(e),o(e)}if(n=function(e){const t=[];let n;const r=i("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(n=r.exec(e));){let[,e,r,i]=n;if(e=parseInt(e,10),e in t){if(0===e)break}else t[e]=[r,i]}const a=[];for(let e=0;e{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFNetworkStream=void 0;var r=n(1),i=n(22);class a{constructor(e,t={}){this.url=e,this.isHttp=/^https?:/i.test(e),this.httpHeaders=this.isHttp&&t.httpHeaders||Object.create(null),this.withCredentials=t.withCredentials||!1,this.getXhr=t.getXhr||function(){return new XMLHttpRequest},this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(e,t,n){const r={begin:e,end:t};for(const e in n)r[e]=n[e];return this.request(r)}requestFull(e){return this.request(e)}request(e){const t=this.getXhr(),n=this.currXhrId++,r=this.pendingRequests[n]={xhr:t};t.open("GET",this.url),t.withCredentials=this.withCredentials;for(const e in this.httpHeaders){const n=this.httpHeaders[e];void 0!==n&&t.setRequestHeader(e,n)}return this.isHttp&&"begin"in e&&"end"in e?(t.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`),r.expectedStatus=206):r.expectedStatus=200,t.responseType="arraybuffer",e.onError&&(t.onerror=function(n){e.onError(t.status)}),t.onreadystatechange=this.onStateChange.bind(this,n),t.onprogress=this.onProgress.bind(this,n),r.onHeadersReceived=e.onHeadersReceived,r.onDone=e.onDone,r.onError=e.onError,r.onProgress=e.onProgress,t.send(null),n}onProgress(e,t){const n=this.pendingRequests[e];n&&n.onProgress?.(t)}onStateChange(e,t){const n=this.pendingRequests[e];if(!n)return;const i=n.xhr;if(i.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),4!==i.readyState)return;if(!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],0===i.status&&this.isHttp)return void n.onError?.(i.status);const a=i.status||200;if((200!==a||206!==n.expectedStatus)&&a!==n.expectedStatus)return void n.onError?.(i.status);const o=function(e){const t=e.response;return"string"!=typeof t?t:(0,r.stringToBytes)(t).buffer}(i);if(206===a){const e=i.getResponseHeader("Content-Range"),t=/bytes (\d+)-(\d+)\/(\d+)/.exec(e);n.onDone({begin:parseInt(t[1],10),chunk:o})}else o?n.onDone({begin:0,chunk:o}):n.onError?.(i.status)}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}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 a(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,r.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new o(this._manager,this._source),this._fullRequestReader}getRangeReader(e,t){const n=new s(this._manager,e,t);return n.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}};class o{constructor(e,t){this._manager=e;const n={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(n),this._headersReceivedCapability=(0,r.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),n=e=>t.getResponseHeader(e),{allowRangeRequests:r,suggestedLength:a}=(0,i.validateRangeRequestCapabilities)({getResponseHeader:n,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});r&&(this._isRangeSupported=!0),this._contentLength=a||this._contentLength,this._filename=(0,i.extractFilenameFromHeader)(n),this._isRangeSupported&&this._manager.abortRequest(e),this._headersReceivedCapability.resolve()}_onDone(e){if(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)){for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=(0,i.createResponseStatusError)(e,this._url),this._headersReceivedCapability.reject(this._storedError);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){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,r.createPromiseCapability)();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersReceivedCapability.reject(e);for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class s{constructor(e,t,n){this._manager=e;const r={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._requestId=e.requestRange(t,n,r),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){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;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError=(0,i.createResponseStatusError)(e,this._url);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){this.isStreamingSupported||this.onProgress?.({loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;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,r.createPromiseCapability)();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFFetchStream=void 0;var r=n(1),i=n(22);function a(e,t,n){return{method:"GET",headers:e,signal:n.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function o(e){const t=new Headers;for(const n in e){const r=e[n];void 0!==r&&t.append(n,r)}return t}function s(e){return e instanceof Uint8Array?e.buffer:e instanceof ArrayBuffer?e:((0,r.warn)(`getArrayBuffer - unexpected data format: ${e}`),new Uint8Array(e).buffer)}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?._loaded??0}getFullReader(){return(0,r.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new l(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=new c(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}};class l{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,r.createPromiseCapability)(),this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._headers=o(this._stream.httpHeaders);const n=t.url;fetch(n,a(this._headers,this._withCredentials,this._abortController)).then(e=>{if(!(0,i.validateResponseStatus)(e.status))throw(0,i.createResponseStatusError)(e.status,n);this._reader=e.body.getReader(),this._headersCapability.resolve();const t=t=>e.headers.get(t),{allowRangeRequests:a,suggestedLength:o}=(0,i.validateRangeRequestCapabilities)({getResponseHeader:t,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=a,this._contentLength=o||this._contentLength,this._filename=(0,i.extractFilenameFromHeader)(t),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new r.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?.({loaded:this._loaded,total:this._contentLength}),{value:s(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}class c{constructor(e,t,n){this._stream=e,this._reader=null,this._loaded=0;const s=e.source;this._withCredentials=s.withCredentials||!1,this._readCapability=(0,r.createPromiseCapability)(),this._isStreamingSupported=!s.disableStream,this._abortController=new AbortController,this._headers=o(this._stream.httpHeaders),this._headers.append("Range",`bytes=${t}-${n-1}`);const l=s.url;fetch(l,a(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()}).catch(this._readCapability.reject),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?.({loaded:this._loaded}),{value:s(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextLayerRenderTask=void 0,t.renderTextLayer=function(e){e.textContentSource||!e.textContent&&!e.textContentStream||((0,i.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),e.textContentSource=e.textContent||e.textContentStream);const t=new u(e);return t._render(),t},t.updateTextLayer=function({container:e,viewport:t,textDivs:n,textDivProperties:r,isOffscreenCanvasSupported:a,mustRotate:o=!0,mustRescale:l=!0}){if(o&&(0,i.setLayerDimensions)(e,{rotation:t.rotation}),l){const e=s(0,a),i={prevFontSize:null,prevFontFamily:null,div:null,scale:t.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:e};for(const e of n)i.properties=r.get(e),i.div=e,c(i)}};var r=n(1),i=n(6);const a=30,o=new Map;function s(e,t){let n;if(t&&r.FeatureTest.isOffscreenCanvasSupported)n=new OffscreenCanvas(e,e).getContext("2d",{alpha:!1});else{const t=document.createElement("canvas");t.width=t.height=e,n=t.getContext("2d",{alpha:!1})}return n}function l(e,t,n){const i=document.createElement("span"),l={angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};e._textDivs.push(i);const c=r.Util.transform(e._transform,t.transform);let u=Math.atan2(c[1],c[0]);const d=n[t.fontName];d.vertical&&(u+=Math.PI/2);const h=Math.hypot(c[2],c[3]),f=h*function(e,t){const n=o.get(e);if(n)return n;const r=s(a,t);r.font=`30px ${e}`;const i=r.measureText("");let l=i.fontBoundingBoxAscent,c=Math.abs(i.fontBoundingBoxDescent);if(l){const t=l/(l+c);return o.set(e,t),r.canvas.width=r.canvas.height=0,t}r.strokeStyle="red",r.clearRect(0,0,a,a),r.strokeText("g",0,0);let u=r.getImageData(0,0,a,a).data;c=0;for(let e=u.length-1-3;e>=0;e-=4)if(u[e]>0){c=Math.ceil(e/4/a);break}r.clearRect(0,0,a,a),r.strokeText("A",0,a),u=r.getImageData(0,0,a,a).data,l=0;for(let e=0,t=u.length;e0){l=a-Math.floor(e/4/a);break}if(r.canvas.width=r.canvas.height=0,l){const t=l/(l+c);return o.set(e,t),t}return o.set(e,.8),.8}(d.fontFamily,e._isOffscreenCanvasSupported);let p,m;0===u?(p=c[4],m=c[5]-f):(p=c[4]+f*Math.sin(u),m=c[5]-f*Math.cos(u));const g="calc(var(--scale-factor)*",v=i.style;e._container===e._rootContainer?(v.left=`${(100*p/e._pageWidth).toFixed(2)}%`,v.top=`${(100*m/e._pageHeight).toFixed(2)}%`):(v.left=`${g}${p.toFixed(2)}px)`,v.top=`${g}${m.toFixed(2)}px)`),v.fontSize=`${g}${h.toFixed(2)}px)`,v.fontFamily=d.fontFamily,l.fontSize=h,i.setAttribute("role","presentation"),i.textContent=t.str,i.dir=t.dir,e._fontInspectorEnabled&&(i.dataset.fontName=t.fontName),0!==u&&(l.angle=u*(180/Math.PI));let y=!1;if(t.str.length>1)y=!0;else if(" "!==t.str&&t.transform[0]!==t.transform[3]){const e=Math.abs(t.transform[0]),n=Math.abs(t.transform[3]);e!==n&&Math.max(e,n)/Math.min(e,n)>1.5&&(y=!0)}y&&(l.canvasWidth=d.vertical?t.height:t.width),e._textDivProperties.set(i,l),e._isReadableStream&&e._layoutText(i)}function c(e){const{div:t,scale:n,properties:r,ctx:i,prevFontSize:a,prevFontFamily:o}=e,{style:s}=t;let l="";if(0!==r.canvasWidth&&r.hasText){const{fontFamily:c}=s,{canvasWidth:u,fontSize:d}=r;a===d&&o===c||(i.font=`${d*n}px ${c}`,e.prevFontSize=d,e.prevFontFamily=c);const{width:h}=i.measureText(t.textContent);h>0&&(l=`scaleX(${u*n/h})`)}0!==r.angle&&(l=`rotate(${r.angle}deg) ${l}`),l.length>0&&(s.transform=l)}class u{constructor({textContentSource:e,container:t,viewport:n,textDivs:a,textDivProperties:o,textContentItemsStr:l,isOffscreenCanvasSupported:c}){this._textContentSource=e,this._isReadableStream=e instanceof ReadableStream,this._container=this._rootContainer=t,this._textDivs=a||[],this._textContentItemsStr=l||[],this._isOffscreenCanvasSupported=c,this._fontInspectorEnabled=!!globalThis.FontInspector?.enabled,this._reader=null,this._textDivProperties=o||new WeakMap,this._canceled=!1,this._capability=(0,r.createPromiseCapability)(),this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:n.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:s(0,c)};const{pageWidth:u,pageHeight:d,pageX:h,pageY:f}=n.rawDims;this._transform=[1,0,0,-1,-h,f+d],this._pageWidth=u,this._pageHeight=d,(0,i.setLayerDimensions)(t,n),this._capability.promise.finally(()=>{this._layoutTextParams=null}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new r.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._capability.reject(new r.AbortException("TextLayer task cancelled."))}_processItems(e,t){for(const n of e)if(void 0!==n.str)this._textContentItemsStr.push(n.str),l(this,n,t);else if("beginMarkedContentProps"===n.type||"beginMarkedContent"===n.type){const e=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),null!==n.id&&this._container.setAttribute("id",`${n.id}`),e.append(this._container)}else"endMarkedContent"===n.type&&(this._container=this._container.parentNode)}_layoutText(e){const t=this._layoutTextParams.properties=this._textDivProperties.get(e);if(this._layoutTextParams.div=e,c(this._layoutTextParams),t.hasText&&this._container.append(e),t.hasEOL){const e=document.createElement("br");e.setAttribute("role","presentation"),this._container.append(e)}}_render(){const e=(0,r.createPromiseCapability)();let t=Object.create(null);if(this._isReadableStream){const n=()=>{this._reader.read().then(({value:r,done:i})=>{i?e.resolve():(Object.assign(t,r.styles),this._processItems(r.items,t),n())},e.reject)};this._reader=this._textContentSource.getReader(),n()}else{if(!this._textContentSource)throw new Error('No "textContentSource" parameter specified.');{const{items:t,styles:n}=this._textContentSource;this._processItems(t,n),e.resolve()}}e.promise.then(()=>{t=null,function(e){if(e._canceled)return;const t=e._textDivs,n=e._capability;if(t.length>1e5)n.resolve();else{if(!e._isReadableStream)for(const n of t)e._layoutText(n);n.resolve()}}(this)},this._capability.reject)}}t.TextLayerRenderTask=u},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationEditorLayer=void 0;var r=n(1),i=n(5),a=n(28),o=n(29),s=n(6);class l{#ye;#be=!1;#Ee=this.pointerup.bind(this);#_e=this.pointerdown.bind(this);#we=new Map;#Se=!1;#Ce=!1;#ke;static _initialized=!1;constructor(e){l._initialized||(l._initialized=!0,a.FreeTextEditor.initialize(e.l10n),o.InkEditor.initialize(e.l10n)),e.uiManager.registerEditorTypes([a.FreeTextEditor,o.InkEditor]),this.#ke=e.uiManager,this.pageIndex=e.pageIndex,this.div=e.div,this.#ye=e.accessibilityManager,this.#ke.addLayer(this)}get isEmpty(){return 0===this.#we.size}updateToolbar(e){this.#ke.updateToolbar(e)}updateMode(e=this.#ke.getMode()){this.#Ae(),e===r.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),this.#ke.unselectAll(),e!==r.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",e===r.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",e===r.AnnotationEditorType.INK),this.div.hidden=!1)}addInkEditorIfNeeded(e){if(e||this.#ke.getMode()===r.AnnotationEditorType.INK){if(!e)for(const e of this.#we.values())if(e.isEmpty())return void e.setInBackground();this.#xe({offsetX:0,offsetY:0}).setInBackground()}}setEditingState(e){this.#ke.setEditingState(e)}addCommands(e){this.#ke.addCommands(e)}enable(){this.div.style.pointerEvents="auto";for(const e of this.#we.values())e.enableEditing()}disable(){this.div.style.pointerEvents="none";for(const e of this.#we.values())e.disableEditing();this.#Ae(),this.isEmpty&&(this.div.hidden=!0)}setActiveEditor(e){this.#ke.getActive()!==e&&this.#ke.setActiveEditor(e)}enableClick(){this.div.addEventListener("pointerdown",this.#_e),this.div.addEventListener("pointerup",this.#Ee)}disableClick(){this.div.removeEventListener("pointerdown",this.#_e),this.div.removeEventListener("pointerup",this.#Ee)}attach(e){this.#we.set(e.id,e)}detach(e){this.#we.delete(e.id),this.#ye?.removePointerInTextLayer(e.contentDiv)}remove(e){this.#ke.removeEditor(e),this.detach(e),e.div.style.display="none",setTimeout(()=>{e.div.style.display="",e.div.remove(),e.isAttachedToDOM=!1,document.activeElement===document.body&&this.#ke.focusMainContainer()},0),this.#Ce||this.addInkEditorIfNeeded(!1)}#Pe(e){e.parent!==this&&(this.attach(e),e.parent?.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}add(e){if(this.#Pe(e),this.#ke.addEditor(e),this.attach(e),!e.isAttachedToDOM){const t=e.render();this.div.append(t),e.isAttachedToDOM=!0}this.moveEditorInDOM(e),e.onceAdded(),this.#ke.addToAnnotationStorage(e)}moveEditorInDOM(e){this.#ye?.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?e.rebuild():this.add(e)}addANewEditor(e){this.addCommands({cmd:()=>{this.addOrRebuild(e)},undo:()=>{e.remove()},mustExec:!0})}addUndoableEditor(e){this.addCommands({cmd:()=>{this.addOrRebuild(e)},undo:()=>{e.remove()},mustExec:!1})}getNextId(){return this.#ke.getId()}#Me(e){switch(this.#ke.getMode()){case r.AnnotationEditorType.FREETEXT:return new a.FreeTextEditor(e);case r.AnnotationEditorType.INK:return new o.InkEditor(e)}return null}deserialize(e){switch(e.annotationType){case r.AnnotationEditorType.FREETEXT:return a.FreeTextEditor.deserialize(e,this,this.#ke);case r.AnnotationEditorType.INK:return o.InkEditor.deserialize(e,this,this.#ke)}return null}#xe(e){const t=this.getNextId(),n=this.#Me({parent:this,id:t,x:e.offsetX,y:e.offsetY,uiManager:this.#ke});return n&&this.add(n),n}setSelected(e){this.#ke.setSelected(e)}toggleSelected(e){this.#ke.toggleSelected(e)}isSelected(e){return this.#ke.isSelected(e)}unselect(e){this.#ke.unselect(e)}pointerup(e){const{isMac:t}=r.FeatureTest.platform;0!==e.button||e.ctrlKey&&t||e.target===this.div&&this.#Se&&(this.#Se=!1,this.#be?this.#xe(e):this.#be=!0)}pointerdown(e){const{isMac:t}=r.FeatureTest.platform;if(0!==e.button||e.ctrlKey&&t)return;if(e.target!==this.div)return;this.#Se=!0;const n=this.#ke.getActive();this.#be=!n||n.isEmpty()}drop(e){const t=e.dataTransfer.getData("text/plain"),n=this.#ke.getEditor(t);if(!n)return;e.preventDefault(),e.dataTransfer.dropEffect="move",this.#Pe(n);const r=this.div.getBoundingClientRect(),i=e.clientX-r.x,a=e.clientY-r.y;n.translate(i-n.startX,a-n.startY),this.moveEditorInDOM(n),n.div.focus()}dragover(e){e.preventDefault()}destroy(){this.#ke.getActive()?.parent===this&&this.#ke.setActiveEditor(null);for(const e of this.#we.values())this.#ye?.removePointerInTextLayer(e.contentDiv),e.setParent(null),e.isAttachedToDOM=!1,e.div.remove();this.div=null,this.#we.clear(),this.#ke.removeLayer(this)}#Ae(){this.#Ce=!0;for(const e of this.#we.values())e.isEmpty()&&e.remove();this.#Ce=!1}render({viewport:e}){this.viewport=e,(0,s.setLayerDimensions)(this.div,e),(0,i.bindEvents)(this,this.div,["dragover","drop"]);for(const e of this.#ke.getEditors(this.pageIndex))this.add(e);this.updateMode()}update({viewport:e}){this.#ke.commitOrRemove(),this.viewport=e,(0,s.setLayerDimensions)(this.div,{rotation:e.rotation}),this.updateMode()}get pageDimensions(){const{pageWidth:e,pageHeight:t}=this.viewport.rawDims;return[e,t]}}t.AnnotationEditorLayer=l},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FreeTextEditor=void 0;var r=n(1),i=n(5),a=n(4);class o extends a.AnnotationEditor{#Te=this.editorDivBlur.bind(this);#Re=this.editorDivFocus.bind(this);#Oe=this.editorDivInput.bind(this);#Ie=this.editorDivKeydown.bind(this);#De;#Le="";#Ne=`${this.id}-editor`;#Fe=!1;#je;static _freeTextDefaultContent="";static _l10nPromise;static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static _keyboardManager=new i.KeyboardManager([[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],o.prototype.commitOrRemove]]);static _type="freetext";constructor(e){super({...e,name:"freeTextEditor"}),this.#De=e.color||o._defaultColor||a.AnnotationEditor._defaultLineColor,this.#je=e.fontSize||o._defaultFontSize}static initialize(e){this._l10nPromise=new Map(["free_text2_default_content","editor_free_text2_aria_label"].map(t=>[t,e.get(t)]));const t=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(t.getPropertyValue("--freetext-padding"))}static updateDefaultParams(e,t){switch(e){case r.AnnotationEditorParamsType.FREETEXT_SIZE:o._defaultFontSize=t;break;case r.AnnotationEditorParamsType.FREETEXT_COLOR:o._defaultColor=t}}updateParams(e,t){switch(e){case r.AnnotationEditorParamsType.FREETEXT_SIZE:this.#Be(t);break;case r.AnnotationEditorParamsType.FREETEXT_COLOR:this.#Ue(t)}}static get defaultPropertiesToUpdate(){return[[r.AnnotationEditorParamsType.FREETEXT_SIZE,o._defaultFontSize],[r.AnnotationEditorParamsType.FREETEXT_COLOR,o._defaultColor||a.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[r.AnnotationEditorParamsType.FREETEXT_SIZE,this.#je],[r.AnnotationEditorParamsType.FREETEXT_COLOR,this.#De]]}#Be(e){const t=e=>{this.editorDiv.style.fontSize=`calc(${e}px * var(--scale-factor))`,this.translate(0,-(e-this.#je)*this.parentScale),this.#je=e,this.#ze()},n=this.#je;this.addCommands({cmd:()=>{t(e)},undo:()=>{t(n)},mustExec:!0,type:r.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#Ue(e){const t=this.#De;this.addCommands({cmd:()=>{this.#De=this.editorDiv.style.color=e},undo:()=>{this.#De=this.editorDiv.style.color=t},mustExec:!0,type:r.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}getInitialTranslation(){const e=this.parentScale;return[-o._internalPadding*e,-(o._internalPadding+this.#je)*e]}rebuild(){super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(r.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this.div.draggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",this.#Ie),this.editorDiv.addEventListener("focus",this.#Re),this.editorDiv.addEventListener("blur",this.#Te),this.editorDiv.addEventListener("input",this.#Oe))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#Ne),this.div.draggable=!0,this.editorDiv.removeEventListener("keydown",this.#Ie),this.editorDiv.removeEventListener("focus",this.#Re),this.editorDiv.removeEventListener("blur",this.#Te),this.editorDiv.removeEventListener("input",this.#Oe),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(e){super.focusin(e),e.target!==this.editorDiv&&this.editorDiv.focus()}onceAdded(){this.width||(this.enableEditMode(),this.editorDiv.focus())}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent.setEditingState(!0),this.parent.div.classList.add("freeTextEditing"),super.remove()}#qe(){const e=this.editorDiv.getElementsByTagName("div");if(0===e.length)return this.editorDiv.innerText;const t=[];for(const n of e)t.push(n.innerText.replace(/\r\n?|\n/,""));return t.join("\n")}#ze(){const[e,t]=this.parentDimensions;let n;if(this.isAttachedToDOM)n=this.div.getBoundingClientRect();else{const{currentLayer:e,div:t}=this,r=t.style.display;t.style.display="hidden",e.div.append(this.div),n=t.getBoundingClientRect(),t.remove(),t.style.display=r}this.width=n.width/e,this.height=n.height/t}commit(){this.isInEditMode()&&(super.commit(),this.#Fe||(this.#Fe=!0,this.parent.addUndoableEditor(this)),this.disableEditMode(),this.#Le=this.#qe().trimEnd(),this.#ze())}shouldGetKeyboardEvents(){return this.isInEditMode()}dblclick(e){this.enableEditMode(),this.editorDiv.focus()}keydown(e){e.target===this.div&&"Enter"===e.key&&(this.enableEditMode(),this.editorDiv.focus())}editorDivKeydown(e){o._keyboardManager.exec(this,e)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){this.parent.div.classList.toggle("freeTextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let e,t;this.width&&(e=this.x,t=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#Ne),this.enableEditing(),o._l10nPromise.get("editor_free_text2_aria_label").then(e=>this.editorDiv?.setAttribute("aria-label",e)),o._l10nPromise.get("free_text2_default_content").then(e=>this.editorDiv?.setAttribute("default-content",e)),this.editorDiv.contentEditable=!0;const{style:n}=this.editorDiv;if(n.fontSize=`calc(${this.#je}px * var(--scale-factor))`,n.color=this.#De,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,i.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[n,r]=this.parentDimensions;this.setAt(e*n,t*r,this.width*n,this.height*r);for(const e of this.#Le.split("\n")){const t=document.createElement("div");t.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(t)}this.div.draggable=!0,this.editorDiv.contentEditable=!1}else this.div.draggable=!1,this.editorDiv.contentEditable=!0;return this.div}get contentDiv(){return this.editorDiv}static deserialize(e,t,n){const i=super.deserialize(e,t,n);return i.#je=e.fontSize,i.#De=r.Util.makeHexColor(...e.color),i.#Le=e.value,i}serialize(){if(this.isEmpty())return null;const e=o._internalPadding*this.parentScale,t=this.getRect(e,e),n=a.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#De);return{annotationType:r.AnnotationEditorType.FREETEXT,color:n,fontSize:this.#je,value:this.#Le,pageIndex:this.pageIndex,rect:t,rotation:this.rotation}}}t.FreeTextEditor=o},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InkEditor=void 0,Object.defineProperty(t,"fitCurve",{enumerable:!0,get:function(){return a.fitCurve}});var r=n(1),i=n(4),a=n(30),o=n(5);const s=16;class l extends i.AnnotationEditor{#Ve=0;#He=0;#We=0;#Ge=this.canvasPointermove.bind(this);#$e=this.canvasPointerleave.bind(this);#Ye=this.canvasPointerup.bind(this);#Xe=this.canvasPointerdown.bind(this);#Ke=!1;#Qe=!1;#Je=null;#Ze=null;#et=0;#tt=0;#nt=null;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=1;static _l10nPromise;static _type="ink";constructor(e){super({...e,name:"inkEditor"}),this.color=e.color||null,this.thickness=e.thickness||null,this.opacity=e.opacity||null,this.paths=[],this.bezierPath2D=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0}static initialize(e){this._l10nPromise=new Map(["editor_ink_canvas_aria_label","editor_ink2_aria_label"].map(t=>[t,e.get(t)]))}static updateDefaultParams(e,t){switch(e){case r.AnnotationEditorParamsType.INK_THICKNESS:l._defaultThickness=t;break;case r.AnnotationEditorParamsType.INK_COLOR:l._defaultColor=t;break;case r.AnnotationEditorParamsType.INK_OPACITY:l._defaultOpacity=t/100}}updateParams(e,t){switch(e){case r.AnnotationEditorParamsType.INK_THICKNESS:this.#rt(t);break;case r.AnnotationEditorParamsType.INK_COLOR:this.#Ue(t);break;case r.AnnotationEditorParamsType.INK_OPACITY:this.#it(t)}}static get defaultPropertiesToUpdate(){return[[r.AnnotationEditorParamsType.INK_THICKNESS,l._defaultThickness],[r.AnnotationEditorParamsType.INK_COLOR,l._defaultColor||i.AnnotationEditor._defaultLineColor],[r.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*l._defaultOpacity)]]}get propertiesToUpdate(){return[[r.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||l._defaultThickness],[r.AnnotationEditorParamsType.INK_COLOR,this.color||l._defaultColor||i.AnnotationEditor._defaultLineColor],[r.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??l._defaultOpacity))]]}#rt(e){const t=this.thickness;this.addCommands({cmd:()=>{this.thickness=e,this.#at()},undo:()=>{this.thickness=t,this.#at()},mustExec:!0,type:r.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}#Ue(e){const t=this.color;this.addCommands({cmd:()=>{this.color=e,this.#ot()},undo:()=>{this.color=t,this.#ot()},mustExec:!0,type:r.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}#it(e){e/=100;const t=this.opacity;this.addCommands({cmd:()=>{this.opacity=e,this.#ot()},undo:()=>{this.opacity=t,this.#ot()},mustExec:!0,type:r.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}rebuild(){super.rebuild(),null!==this.div&&(this.canvas||(this.#st(),this.#lt()),this.isAttachedToDOM||(this.parent.add(this),this.#ct()),this.#at())}remove(){null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,this.#Ze.disconnect(),this.#Ze=null,super.remove())}setParent(e){!this.parent&&e?this._uiManager.removeShouldRescale(this):this.parent&&null===e&&this._uiManager.addShouldRescale(this),super.setParent(e)}onScaleChanging(){const[e,t]=this.parentDimensions,n=this.width*e,r=this.height*t;this.setDimensions(n,r)}enableEditMode(){this.#Ke||null===this.canvas||(super.enableEditMode(),this.div.draggable=!1,this.canvas.addEventListener("pointerdown",this.#Xe),this.canvas.addEventListener("pointerup",this.#Ye))}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this.div.draggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",this.#Xe),this.canvas.removeEventListener("pointerup",this.#Ye))}onceAdded(){this.div.draggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}#ut(){const{parentRotation:e,parentDimensions:[t,n]}=this;switch(e){case 90:return[0,n,n,t];case 180:return[t,n,t,n];case 270:return[t,0,n,t];default:return[0,0,t,n]}}#dt(){const{ctx:e,color:t,opacity:n,thickness:r,parentScale:i,scaleFactor:a}=this;e.lineWidth=r*i/a,e.lineCap="round",e.lineJoin="round",e.miterLimit=10,e.strokeStyle=`${t}${(0,o.opacityToHex)(n)}`}#ht(e,t){this.isEditing=!0,this.#Qe||(this.#Qe=!0,this.#ct(),this.thickness||=l._defaultThickness,this.color||=l._defaultColor||i.AnnotationEditor._defaultLineColor,this.opacity??=l._defaultOpacity),this.currentPath.push([e,t]),this.#Je=null,this.#dt(),this.ctx.beginPath(),this.ctx.moveTo(e,t),this.#nt=()=>{this.#nt&&(this.#Je&&(this.isEmpty()?(this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)):this.#ot(),this.ctx.lineTo(...this.#Je),this.#Je=null,this.ctx.stroke()),window.requestAnimationFrame(this.#nt))},window.requestAnimationFrame(this.#nt)}#ft(e,t){const[n,r]=this.currentPath.at(-1);e===n&&t===r||(this.currentPath.push([e,t]),this.#Je=[e,t])}#pt(e,t){this.ctx.closePath(),this.#nt=null,e=Math.min(Math.max(e,0),this.canvas.width),t=Math.min(Math.max(t,0),this.canvas.height);const[n,r]=this.currentPath.at(-1);let i;if(e===n&&t===r||this.currentPath.push([e,t]),1!==this.currentPath.length)i=(0,a.fitCurve)(this.currentPath,30,null);else{const n=[e,t];i=[[n,n.slice(),n.slice(),n]]}const o=l.#mt(i);this.currentPath.length=0,this.addCommands({cmd:()=>{this.paths.push(i),this.bezierPath2D.push(o),this.rebuild()},undo:()=>{this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(this.#st(),this.#lt()),this.#at())},mustExec:!0})}#ot(){if(this.isEmpty())return void this.#gt();this.#dt();const{canvas:e,ctx:t}=this;t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,e.width,e.height),this.#gt();for(const e of this.bezierPath2D)t.stroke(e)}commit(){this.#Ke||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),this.#Ke=!0,this.div.classList.add("disabled"),this.#at(!0),this.parent.addInkEditorIfNeeded(!0),this.parent.moveEditorInDOM(this),this.div.focus({preventScroll:!0}))}focusin(e){super.focusin(e),this.enableEditMode()}canvasPointerdown(e){0===e.button&&this.isInEditMode()&&!this.#Ke&&(this.setInForeground(),"mouse"!==e.type&&this.div.focus(),e.stopPropagation(),this.canvas.addEventListener("pointerleave",this.#$e),this.canvas.addEventListener("pointermove",this.#Ge),this.#ht(e.offsetX,e.offsetY))}canvasPointermove(e){e.stopPropagation(),this.#ft(e.offsetX,e.offsetY)}canvasPointerup(e){0===e.button&&this.isInEditMode()&&0!==this.currentPath.length&&(e.stopPropagation(),this.#vt(e),this.setInBackground())}canvasPointerleave(e){this.#vt(e),this.setInBackground()}#vt(e){this.#pt(e.offsetX,e.offsetY),this.canvas.removeEventListener("pointerleave",this.#$e),this.canvas.removeEventListener("pointermove",this.#Ge),this.addToAnnotationStorage()}#st(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",l._l10nPromise.get("editor_ink_canvas_aria_label").then(e=>this.canvas?.setAttribute("aria-label",e)),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}#lt(){let e=null;this.#Ze=new ResizeObserver(t=>{const n=t[0].contentRect;n.width&&n.height&&(null!==e&&clearTimeout(e),e=setTimeout(()=>{this.fixDims(),e=null},100),this.setDimensions(n.width,n.height))}),this.#Ze.observe(this.div)}render(){if(this.div)return this.div;let e,t;this.width&&(e=this.x,t=this.y),super.render(),l._l10nPromise.get("editor_ink2_aria_label").then(e=>this.div?.setAttribute("aria-label",e));const[n,r,i,a]=this.#ut();if(this.setAt(n,r,0,0),this.setDims(i,a),this.#st(),this.width){const[n,r]=this.parentDimensions;this.setAt(e*n,t*r,this.width*n,this.height*r),this.#Qe=!0,this.#ct(),this.setDims(this.width*n,this.height*r),this.#ot(),this.#yt(),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return this.#lt(),this.div}#ct(){if(!this.#Qe)return;const[e,t]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*e),this.canvas.height=Math.ceil(this.height*t),this.#gt()}setDimensions(e,t){const n=Math.round(e),r=Math.round(t);if(this.#et===n&&this.#tt===r)return;this.#et=n,this.#tt=r,this.canvas.style.visibility="hidden",this.#Ve&&Math.abs(this.#Ve-e/t)>.01&&(t=Math.ceil(e/this.#Ve),this.setDims(e,t));const[i,a]=this.parentDimensions;this.width=e/i,this.height=t/a,this.#Ke&&this.#bt(e,t),this.#ct(),this.#ot(),this.canvas.style.visibility="visible"}#bt(e,t){const n=this.#Et(),r=(e-n)/this.#We,i=(t-n)/this.#He;this.scaleFactor=Math.min(r,i)}#gt(){const e=this.#Et()/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+e,this.translationY*this.scaleFactor+e)}static#mt(e){const t=new Path2D;for(let n=0,r=e.length;n=1?(e.minHeight="16px",e.minWidth=`${Math.round(this.#Ve*s)}px`):(e.minWidth="16px",e.minHeight=`${Math.round(s/this.#Ve)}px`)}static deserialize(e,t,n){const i=super.deserialize(e,t,n);i.thickness=e.thickness,i.color=r.Util.makeHexColor(...e.color),i.opacity=e.opacity;const[a,o]=i.pageDimensions,l=i.width*a,c=i.height*o,u=i.parentScale,d=e.thickness/2;i.#Ve=l/c,i.#Ke=!0,i.#et=Math.round(l),i.#tt=Math.round(c);for(const{bezier:t}of e.paths){const e=[];i.paths.push(e);let n=u*(t[0]-d),r=u*(c-t[1]-d);for(let i=2,a=t.length;i{Object.defineProperty(t,"__esModule",{value:!0}),t.fitCurve=void 0;const r=n(31);t.fitCurve=r},e=>{function t(e,i,a,o,s){var c,u,d,h,f,p,m,g,v,y,b,E,_;if(2===e.length)return E=l.vectorLen(l.subtract(e[0],e[1]))/3,[c=[e[0],l.addArrays(e[0],l.mulItems(i,E)),l.addArrays(e[1],l.mulItems(a,E)),e[1]]];if(u=function(e){var t,n,r,i=[];return e.forEach((e,a)=>{t=a?n+l.vectorLen(l.subtract(e,r)):0,i.push(t),n=t,r=e}),i=i.map(e=>e/n)}(e),[c,h,p]=n(e,u,u,i,a,s),0===h||h.9999&&e<1.0001)break}f=h,m=p}return b=[],(g=l.subtract(e[p-1],e[p+1])).every(e=>0===e)&&(g=l.subtract(e[p-1],e[p]),[g[0],g[1]]=[-g[1],g[0]]),v=l.normalize(g),y=l.mulItems(v,-1),(b=b.concat(t(e.slice(0,p+1),i,v,o,s))).concat(t(e.slice(p),y,a,o,s))}function n(e,t,n,r,i,s){var u,d,h;return u=function(e,t,n,r){var i,a,o,s,u,d,h,f,p,m,g,v,y,b,E,_,w,S=e[0],C=e[e.length-1];for(i=[S,null,null,C],a=l.zeros_Xx2x2(t.length),y=0,b=t.length;yi&&(i=r,s=d);return[i,s]}(e,u,t),s&&s({bez:u,points:e,params:t,maxErr:d,maxPoint:h}),[u,d,h]}function r(e,t,n){return n.map((n,r)=>i(e,t[r],n))}function i(e,t,n){var r=l.subtract(c.q(e,n),t),i=c.qprime(e,n),a=l.mulMatrix(r,i),o=l.sum(l.squareItems(i))+2*l.mulMatrix(r,c.qprimeprime(e,n));return 0===o?n:n-a/o}var a=function(e,t){for(var n,r=[0],i=e[0],a=0,o=1;o<=t;o++)n=c.q(e,o/t),a+=l.vectorLen(l.subtract(n,i)),r.push(a),i=n;return r.map(e=>e/a)};function o(e,t,n,r){if(t<0)return 0;if(t>1)return 1;for(var i,a,o,s,l=1;l<=r;l++)if(t<=n[l]){o=(l-1)/r,a=l/r,s=(t-(i=n[l-1]))/(n[l]-i)*(a-o)+o;break}return s}function s(e,t){return l.normalize(l.subtract(e,t))}class l{static zeros_Xx2x2(e){for(var t=[];e--;)t.push([0,0]);return t}static mulItems(e,t){return e.map(e=>e*t)}static mulMatrix(e,t){return e.reduce((e,n,r)=>e+n*t[r],0)}static subtract(e,t){return e.map((e,n)=>e-t[n])}static addArrays(e,t){return e.map((e,n)=>e+t[n])}static addItems(e,t){return e.map(e=>e+t)}static sum(e){return e.reduce((e,t)=>e+t)}static dot(e,t){return l.mulMatrix(e,t)}static vectorLen(e){return Math.hypot(...e)}static divItems(e,t){return e.map(e=>e/t)}static squareItems(e){return e.map(e=>e*e)}static normalize(e){return this.divItems(e,this.vectorLen(e))}}class c{static q(e,t){var n=1-t,r=l.mulItems(e[0],n*n*n),i=l.mulItems(e[1],3*n*n*t),a=l.mulItems(e[2],3*n*t*t),o=l.mulItems(e[3],t*t*t);return l.addArrays(l.addArrays(r,i),l.addArrays(a,o))}static qprime(e,t){var n=1-t,r=l.mulItems(l.subtract(e[1],e[0]),3*n*n),i=l.mulItems(l.subtract(e[2],e[1]),6*n*t),a=l.mulItems(l.subtract(e[3],e[2]),3*t*t);return l.addArrays(l.addArrays(r,i),a)}static qprimeprime(e,t){return l.addArrays(l.mulItems(l.addArrays(l.subtract(e[2],l.mulItems(e[1],2)),e[0]),6*(1-t)),l.mulItems(l.addArrays(l.subtract(e[3],l.mulItems(e[2],2)),e[1]),6*t))}}e.exports=function(e,n,r){if(!Array.isArray(e))throw new TypeError("First argument should be an array");if(e.forEach(t=>{if(!Array.isArray(t)||t.some(e=>"number"!=typeof e)||t.length!==e[0].length)throw Error("Each point should be an array of numbers. Each point should have the same amount of numbers.")}),(e=e.filter((t,n)=>0===n||!t.every((t,r)=>t===e[n-1][r]))).length<2)return[];const i=e.length,a=s(e[1],e[0]),o=s(e[i-2],e[i-1]);return t(e,a,o,n,r)},e.exports.fitCubic=t,e.exports.createTangent=s},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationLayer=void 0;var r=n(1),i=n(6),a=n(3),o=n(33),s=n(34);const l=1e3,c=new WeakSet;function u(e){return{width:e[2]-e[0],height:e[3]-e[1]}}class d{static create(e){switch(e.data.annotationType){case r.AnnotationType.LINK:return new f(e);case r.AnnotationType.TEXT:return new p(e);case r.AnnotationType.WIDGET:switch(e.data.fieldType){case"Tx":return new g(e);case"Btn":return e.data.radioButton?new y(e):e.data.checkBox?new v(e):new b(e);case"Ch":return new E(e)}return new m(e);case r.AnnotationType.POPUP:return new _(e);case r.AnnotationType.FREETEXT:return new S(e);case r.AnnotationType.LINE:return new C(e);case r.AnnotationType.SQUARE:return new k(e);case r.AnnotationType.CIRCLE:return new A(e);case r.AnnotationType.POLYLINE:return new x(e);case r.AnnotationType.CARET:return new M(e);case r.AnnotationType.INK:return new T(e);case r.AnnotationType.POLYGON:return new P(e);case r.AnnotationType.HIGHLIGHT:return new R(e);case r.AnnotationType.UNDERLINE:return new O(e);case r.AnnotationType.SQUIGGLY:return new I(e);case r.AnnotationType.STRIKEOUT:return new D(e);case r.AnnotationType.STAMP:return new L(e);case r.AnnotationType.FILEATTACHMENT:return new N(e);default:return new h(e)}}}class h{constructor(e,{isRenderable:t=!1,ignoreBorder:n=!1,createQuadrilaterals:r=!1}={}){this.isRenderable=t,this.data=e.data,this.layer=e.layer,this.page=e.page,this.viewport=e.viewport,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,t&&(this.container=this._createContainer(n)),r&&(this.quadrilaterals=this._createQuadrilaterals(n))}_createContainer(e=!1){const{data:t,page:n,viewport:i}=this,a=document.createElement("section");a.setAttribute("data-annotation-id",t.id);const{pageWidth:o,pageHeight:s,pageX:l,pageY:c}=i.rawDims,{width:d,height:h}=u(t.rect),f=r.Util.normalizeRect([t.rect[0],n.view[3]-t.rect[1]+n.view[1],t.rect[2],n.view[3]-t.rect[3]+n.view[1]]);if(!e&&t.borderStyle.width>0){a.style.borderWidth=`${t.borderStyle.width}px`;const e=t.borderStyle.horizontalCornerRadius,n=t.borderStyle.verticalCornerRadius;if(e>0||n>0){const t=`calc(${e}px * var(--scale-factor)) / calc(${n}px * var(--scale-factor))`;a.style.borderRadius=t}else if(this instanceof y){const e=`calc(${d}px * var(--scale-factor)) / calc(${h}px * var(--scale-factor))`;a.style.borderRadius=e}switch(t.borderStyle.style){case r.AnnotationBorderStyleType.SOLID:a.style.borderStyle="solid";break;case r.AnnotationBorderStyleType.DASHED:a.style.borderStyle="dashed";break;case r.AnnotationBorderStyleType.BEVELED:(0,r.warn)("Unimplemented border style: beveled");break;case r.AnnotationBorderStyleType.INSET:(0,r.warn)("Unimplemented border style: inset");break;case r.AnnotationBorderStyleType.UNDERLINE:a.style.borderBottomStyle="solid"}const i=t.borderColor||null;i?a.style.borderColor=r.Util.makeHexColor(0|i[0],0|i[1],0|i[2]):a.style.borderWidth=0}a.style.left=100*(f[0]-l)/o+"%",a.style.top=100*(f[1]-c)/s+"%";const{rotation:p}=t;return t.hasOwnCanvas||0===p?(a.style.width=100*d/o+"%",a.style.height=100*h/s+"%"):this.setRotation(p,a),a}setRotation(e,t=this.container){const{pageWidth:n,pageHeight:r}=this.viewport.rawDims,{width:i,height:a}=u(this.data.rect);let o,s;e%180==0?(o=100*i/n,s=100*a/r):(o=100*a/n,s=100*i/r),t.style.width=`${o}%`,t.style.height=`${s}%`,t.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const e=(e,t,n)=>{const r=n.detail[e];n.target.style[t]=o.ColorConverters[`${r[0]}_HTML`](r.slice(1))};return(0,r.shadow)(this,"_commonActions",{display:e=>{const t=e.detail.display%2==1;this.container.style.visibility=t?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:t,print:0===e.detail.display||3===e.detail.display})},print:e=>{this.annotationStorage.setValue(this.data.id,{print:e.detail.print})},hidden:e=>{this.container.style.visibility=e.detail.hidden?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:e.detail.hidden})},focus:e=>{setTimeout(()=>e.target.focus({preventScroll:!1}),0)},userName:e=>{e.target.title=e.detail.userName},readonly:e=>{e.detail.readonly?e.target.setAttribute("readonly",""):e.target.removeAttribute("readonly")},required:e=>{this._setRequired(e.target,e.detail.required)},bgColor:t=>{e("bgColor","backgroundColor",t)},fillColor:t=>{e("fillColor","backgroundColor",t)},fgColor:t=>{e("fgColor","color",t)},textColor:t=>{e("textColor","color",t)},borderColor:t=>{e("borderColor","borderColor",t)},strokeColor:t=>{e("strokeColor","borderColor",t)},rotation:e=>{const t=e.detail.rotation;this.setRotation(t),this.annotationStorage.setValue(this.data.id,{rotation:t})}})}_dispatchEventFromSandbox(e,t){const n=this._commonActions;for(const r of Object.keys(t.detail)){const i=e[r]||n[r];i?.(t)}}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;const t=this.annotationStorage.getRawValue(this.data.id);if(!t)return;const n=this._commonActions;for(const[r,i]of Object.entries(t)){const a=n[r];a&&(a({detail:{[r]:i},target:e}),delete t[r])}}_createQuadrilaterals(e=!1){if(!this.data.quadPoints)return null;const t=[],n=this.data.rect;for(const n of this.data.quadPoints)this.data.rect=[n[2].x,n[2].y,n[1].x,n[1].y],t.push(this._createContainer(e));return this.data.rect=n,t}_createPopup(e,t){let n=this.container;this.quadrilaterals&&(e=e||this.quadrilaterals,n=this.quadrilaterals[0]),e||((e=document.createElement("div")).className="popupTriggerArea",n.append(e));const r=new w({container:n,trigger:e,color:t.color,titleObj:t.titleObj,modificationDate:t.modificationDate,contentsObj:t.contentsObj,richText:t.richText,hideWrapper:!0}).render();r.style.left="100%",n.append(r)}_renderQuadrilaterals(e){for(const t of this.quadrilaterals)t.className=e;return this.quadrilaterals}render(){(0,r.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,t=null){const n=[];if(this._fieldObjects){const i=this._fieldObjects[e];if(i)for(const{page:e,id:a,exportValues:o}of i){if(-1===e)continue;if(a===t)continue;const i="string"==typeof o?o:null,s=document.querySelector(`[data-element-id="${a}"]`);!s||c.has(s)?n.push({id:a,exportValue:i,domElement:s}):(0,r.warn)(`_getElementsByName - element not allowed: ${a}`)}return n}for(const r of document.getElementsByName(e)){const{exportValue:e}=r,i=r.getAttribute("data-element-id");i!==t&&c.has(r)&&n.push({id:i,exportValue:e,domElement:r})}return n}}class f extends h{constructor(e,t=null){super(e,{isRenderable:!0,ignoreBorder:!!t?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=e.data.isTooltipOnly}render(){const{data:e,linkService:t}=this,n=document.createElement("a");n.setAttribute("data-element-id",e.id);let r=!1;return e.url?(t.addLinkAttributes(n,e.url,e.newWindow),r=!0):e.action?(this._bindNamedAction(n,e.action),r=!0):e.attachment?(this._bindAttachment(n,e.attachment),r=!0):e.setOCGState?(this.#kt(n,e.setOCGState),r=!0):e.dest?(this._bindLink(n,e.dest),r=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(n,e),r=!0),e.resetForm?(this._bindResetFormAction(n,e.resetForm),r=!0):this.isTooltipOnly&&!r&&(this._bindLink(n,""),r=!0)),this.quadrilaterals?this._renderQuadrilaterals("linkAnnotation").map((e,t)=>{const r=0===t?n:n.cloneNode();return e.append(r),e}):(this.container.className="linkAnnotation",r&&this.container.append(n),this.container)}#At(){this.container.setAttribute("data-internal-link","")}_bindLink(e,t){e.href=this.linkService.getDestinationHash(t),e.onclick=()=>(t&&this.linkService.goToDestination(t),!1),(t||""===t)&&this.#At()}_bindNamedAction(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(t),!1),this.#At()}_bindAttachment(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.downloadManager?.openOrDownloadData(this.container,t.content,t.filename),!1),this.#At()}#kt(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeSetOCGState(t),!1),this.#At()}_bindJSAction(e,t){e.href=this.linkService.getAnchorUrl("");const n=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const r of Object.keys(t.actions)){const i=n.get(r);i&&(e[i]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t.id,name:r}}),!1))}e.onclick||(e.onclick=()=>!1),this.#At()}_bindResetFormAction(e,t){const n=e.onclick;if(n||(e.href=this.linkService.getAnchorUrl("")),this.#At(),!this._fieldObjects)return(0,r.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(n||(e.onclick=()=>!1));e.onclick=()=>{n?.();const{fields:e,refs:i,include:a}=t,o=[];if(0!==e.length||0!==i.length){const t=new Set(i);for(const n of e){const e=this._fieldObjects[n]||[];for(const{id:n}of e)t.add(n)}for(const e of Object.values(this._fieldObjects))for(const n of e)t.has(n.id)===a&&o.push(n)}else for(const e of Object.values(this._fieldObjects))o.push(...e);const s=this.annotationStorage,l=[];for(const e of o){const{id:t}=e;switch(l.push(t),e.type){case"text":{const n=e.defaultValue||"";s.setValue(t,{value:n});break}case"checkbox":case"radiobutton":{const n=e.defaultValue===e.exportValues;s.setValue(t,{value:n});break}case"combobox":case"listbox":{const n=e.defaultValue||"";s.setValue(t,{value:n});break}default:continue}const n=document.querySelector(`[data-element-id="${t}"]`);n&&(c.has(n)?n.dispatchEvent(new Event("resetform")):(0,r.warn)(`_bindResetFormAction - element not allowed: ${t}`))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:l,name:"ResetForm"}}),!1}}}class p extends h{constructor(e){super(e,{isRenderable:!!(e.data.hasPopup||e.data.titleObj?.str||e.data.contentsObj?.str||e.data.richText?.str)})}render(){this.container.className="textAnnotation";const e=document.createElement("img");return 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(e,this.data),this.container.append(e),this.container}}class m extends h{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}_getKeyModifier(e){const{isWin:t,isMac:n}=r.FeatureTest.platform;return t&&e.ctrlKey||n&&e.metaKey}_setEventListener(e,t,n,r){t.includes("mouse")?e.addEventListener(t,e=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:r(e),shift:e.shiftKey,modifier:this._getKeyModifier(e)}})}):e.addEventListener(t,e=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:r(e)}})})}_setEventListeners(e,t,n){for(const[r,i]of t)("Action"===i||this.data.actions?.[i])&&this._setEventListener(e,r,i,n)}_setBackgroundColor(e){const t=this.data.backgroundColor||null;e.style.backgroundColor=null===t?"transparent":r.Util.makeHexColor(t[0],t[1],t[2])}_setTextStyle(e){const{fontColor:t}=this.data.defaultAppearanceData,n=this.data.defaultAppearanceData.fontSize||9,i=e.style;let a;const o=e=>Math.round(10*e)/10;if(this.data.multiLine){const e=Math.abs(this.data.rect[3]-this.data.rect[1]-2),t=e/(Math.round(e/(r.LINE_FACTOR*n))||1);a=Math.min(n,o(t/r.LINE_FACTOR))}else{const e=Math.abs(this.data.rect[3]-this.data.rect[1]-2);a=Math.min(n,o(e/r.LINE_FACTOR))}i.fontSize=`calc(${a}px * var(--scale-factor))`,i.color=r.Util.makeHexColor(t[0],t[1],t[2]),null!==this.data.textAlignment&&(i.textAlign=["left","center","right"][this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",t)}}class g extends m{constructor(e){super(e,{isRenderable:e.renderForms||!e.data.hasAppearance&&!!e.data.fieldValue})}setPropertyOnSiblings(e,t,n,r){const i=this.annotationStorage;for(const a of this._getElementsByName(e.name,e.id))a.domElement&&(a.domElement[t]=n),i.setValue(a.id,{[r]:n})}render(){const e=this.annotationStorage,t=this.data.id;this.container.className="textWidgetAnnotation";let n=null;if(this.renderForms){const r=e.getValue(t,{value:this.data.fieldValue});let i=r.formattedValue||r.value||"";const a=e.getValue(t,{charLimit:this.data.maxLen}).charLimit;a&&i.length>a&&(i=i.slice(0,a));const o={userValue:i,formattedValue:null,lastCommittedValue:null,commitKey:1};this.data.multiLine?(n=document.createElement("textarea"),n.textContent=i,this.data.doNotScroll&&(n.style.overflowY="hidden")):(n=document.createElement("input"),n.type="text",n.setAttribute("value",i),this.data.doNotScroll&&(n.style.overflowX="hidden")),c.add(n),n.setAttribute("data-element-id",t),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=l,this._setRequired(n,this.data.required),a&&(n.maxLength=a),n.addEventListener("input",r=>{e.setValue(t,{value:r.target.value}),this.setPropertyOnSiblings(n,"value",r.target.value,"value")}),n.addEventListener("resetform",e=>{const t=this.data.defaultFieldValue??"";n.value=o.userValue=t,o.formattedValue=null});let s=e=>{const{formattedValue:t}=o;null!=t&&(e.target.value=t),e.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){n.addEventListener("focus",e=>{const{target:t}=e;o.userValue&&(t.value=o.userValue),o.lastCommittedValue=t.value,o.commitKey=1}),n.addEventListener("updatefromsandbox",n=>{const r={value(n){o.userValue=n.detail.value??"",e.setValue(t,{value:o.userValue.toString()}),n.target.value=o.userValue},formattedValue(n){const{formattedValue:r}=n.detail;o.formattedValue=r,null!=r&&n.target!==document.activeElement&&(n.target.value=r),e.setValue(t,{formattedValue:r})},selRange(e){e.target.setSelectionRange(...e.detail.selRange)},charLimit:n=>{const{charLimit:r}=n.detail,{target:i}=n;if(0===r)return void i.removeAttribute("maxLength");i.setAttribute("maxLength",r);let a=o.userValue;!a||a.length<=r||(a=a.slice(0,r),i.value=o.userValue=a,e.setValue(t,{value:a}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:a,willCommit:!0,commitKey:1,selStart:i.selectionStart,selEnd:i.selectionEnd}}))}};this._dispatchEventFromSandbox(r,n)}),n.addEventListener("keydown",e=>{o.commitKey=1;let n=-1;if("Escape"===e.key?n=0:"Enter"!==e.key||this.data.multiLine?"Tab"===e.key&&(o.commitKey=3):n=2,-1===n)return;const{value:r}=e.target;o.lastCommittedValue!==r&&(o.lastCommittedValue=r,o.userValue=r,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:r,willCommit:!0,commitKey:n,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}))});const r=s;s=null,n.addEventListener("blur",e=>{if(!e.relatedTarget)return;const{value:n}=e.target;o.userValue=n,o.lastCommittedValue!==n&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:n,willCommit:!0,commitKey:o.commitKey,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}),r(e)}),this.data.actions?.Keystroke&&n.addEventListener("beforeinput",e=>{o.lastCommittedValue=null;const{data:n,target:r}=e,{value:i,selectionStart:a,selectionEnd:s}=r;let l=a,c=s;switch(e.inputType){case"deleteWordBackward":{const e=i.substring(0,a).match(/\w*[^\w]*$/);e&&(l-=e[0].length);break}case"deleteWordForward":{const e=i.substring(a).match(/^[^\w]*\w*/);e&&(c+=e[0].length);break}case"deleteContentBackward":a===s&&(l-=1);break;case"deleteContentForward":a===s&&(c+=1)}e.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:i,change:n||"",willCommit:!1,selStart:l,selEnd:c}})}),this._setEventListeners(n,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],e=>e.target.value)}if(s&&n.addEventListener("blur",s),this.data.comb){const e=(this.data.rect[2]-this.data.rect[0])/a;n.classList.add("comb"),n.style.letterSpacing=`calc(${e}px * var(--scale-factor) - 1ch)`}}else n=document.createElement("div"),n.textContent=this.data.fieldValue,n.style.verticalAlign="middle",n.style.display="table-cell";return this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class v extends m{constructor(e){super(e,{isRenderable:e.renderForms})}render(){const e=this.annotationStorage,t=this.data,n=t.id;let r=e.getValue(n,{value:t.exportValue===t.fieldValue}).value;"string"==typeof r&&(r="Off"!==r,e.setValue(n,{value:r})),this.container.className="buttonWidgetAnnotation checkBox";const i=document.createElement("input");return c.add(i),i.setAttribute("data-element-id",n),i.disabled=t.readOnly,this._setRequired(i,this.data.required),i.type="checkbox",i.name=t.fieldName,r&&i.setAttribute("checked",!0),i.setAttribute("exportValue",t.exportValue),i.tabIndex=l,i.addEventListener("change",r=>{const{name:i,checked:a}=r.target;for(const r of this._getElementsByName(i,n)){const n=a&&r.exportValue===t.exportValue;r.domElement&&(r.domElement.checked=n),e.setValue(r.id,{value:n})}e.setValue(n,{value:a})}),i.addEventListener("resetform",e=>{const n=t.defaultFieldValue||"Off";e.target.checked=n===t.exportValue}),this.enableScripting&&this.hasJSActions&&(i.addEventListener("updatefromsandbox",t=>{const r={value(t){t.target.checked="Off"!==t.detail.value,e.setValue(n,{value:t.target.checked})}};this._dispatchEventFromSandbox(r,t)}),this._setEventListeners(i,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],e=>e.target.checked)),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class y extends m{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.className="buttonWidgetAnnotation radioButton";const e=this.annotationStorage,t=this.data,n=t.id;let r=e.getValue(n,{value:t.fieldValue===t.buttonValue}).value;"string"==typeof r&&(r=r!==t.buttonValue,e.setValue(n,{value:r}));const i=document.createElement("input");if(c.add(i),i.setAttribute("data-element-id",n),i.disabled=t.readOnly,this._setRequired(i,this.data.required),i.type="radio",i.name=t.fieldName,r&&i.setAttribute("checked",!0),i.tabIndex=l,i.addEventListener("change",t=>{const{name:r,checked:i}=t.target;for(const t of this._getElementsByName(r,n))e.setValue(t.id,{value:!1});e.setValue(n,{value:i})}),i.addEventListener("resetform",e=>{const n=t.defaultFieldValue;e.target.checked=null!=n&&n===t.buttonValue}),this.enableScripting&&this.hasJSActions){const r=t.buttonValue;i.addEventListener("updatefromsandbox",t=>{const i={value:t=>{const i=r===t.detail.value;for(const r of this._getElementsByName(t.target.name)){const t=i&&r.id===n;r.domElement&&(r.domElement.checked=t),e.setValue(r.id,{value:t})}}};this._dispatchEventFromSandbox(i,t)}),this._setEventListeners(i,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],e=>e.target.checked)}return this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class b extends f{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){const e=super.render();e.className="buttonWidgetAnnotation pushButton",this.data.alternativeText&&(e.title=this.data.alternativeText);const t=e.lastChild;return this.enableScripting&&this.hasJSActions&&t&&(this._setDefaultPropertiesFromJS(t),t.addEventListener("updatefromsandbox",e=>{this._dispatchEventFromSandbox({},e)})),e}}class E extends m{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.className="choiceWidgetAnnotation";const e=this.annotationStorage,t=this.data.id,n=e.getValue(t,{value:this.data.fieldValue}),r=document.createElement("select");c.add(r),r.setAttribute("data-element-id",t),r.disabled=this.data.readOnly,this._setRequired(r,this.data.required),r.name=this.data.fieldName,r.tabIndex=l;let i=this.data.combo&&this.data.options.length>0;this.data.combo||(r.size=this.data.options.length,this.data.multiSelect&&(r.multiple=!0)),r.addEventListener("resetform",e=>{const t=this.data.defaultFieldValue;for(const e of r.options)e.selected=e.value===t});for(const e of this.data.options){const t=document.createElement("option");t.textContent=e.displayValue,t.value=e.exportValue,n.value.includes(e.exportValue)&&(t.setAttribute("selected",!0),i=!1),r.append(t)}let a=null;if(i){const e=document.createElement("option");e.value=" ",e.setAttribute("hidden",!0),e.setAttribute("selected",!0),r.prepend(e),a=()=>{e.remove(),r.removeEventListener("input",a),a=null},r.addEventListener("input",a)}const o=e=>{const t=e?"value":"textContent",{options:n,multiple:i}=r;return i?Array.prototype.filter.call(n,e=>e.selected).map(e=>e[t]):-1===n.selectedIndex?null:n[n.selectedIndex][t]};let s=o(!1);const u=e=>{const t=e.target.options;return Array.prototype.map.call(t,e=>({displayValue:e.textContent,exportValue:e.value}))};return this.enableScripting&&this.hasJSActions?(r.addEventListener("updatefromsandbox",n=>{const i={value(n){a?.();const i=n.detail.value,l=new Set(Array.isArray(i)?i:[i]);for(const e of r.options)e.selected=l.has(e.value);e.setValue(t,{value:o(!0)}),s=o(!1)},multipleSelection(e){r.multiple=!0},remove(n){const i=r.options,a=n.detail.remove;i[a].selected=!1,r.remove(a),i.length>0&&-1===Array.prototype.findIndex.call(i,e=>e.selected)&&(i[0].selected=!0),e.setValue(t,{value:o(!0),items:u(n)}),s=o(!1)},clear(n){for(;0!==r.length;)r.remove(0);e.setValue(t,{value:null,items:[]}),s=o(!1)},insert(n){const{index:i,displayValue:a,exportValue:l}=n.detail.insert,c=r.children[i],d=document.createElement("option");d.textContent=a,d.value=l,c?c.before(d):r.append(d),e.setValue(t,{value:o(!0),items:u(n)}),s=o(!1)},items(n){const{items:i}=n.detail;for(;0!==r.length;)r.remove(0);for(const e of i){const{displayValue:t,exportValue:n}=e,i=document.createElement("option");i.textContent=t,i.value=n,r.append(i)}r.options.length>0&&(r.options[0].selected=!0),e.setValue(t,{value:o(!0),items:u(n)}),s=o(!1)},indices(n){const r=new Set(n.detail.indices);for(const e of n.target.options)e.selected=r.has(e.index);e.setValue(t,{value:o(!0)}),s=o(!1)},editable(e){e.target.disabled=!e.detail.editable}};this._dispatchEventFromSandbox(i,n)}),r.addEventListener("input",n=>{const r=o(!0);e.setValue(t,{value:r}),n.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:s,changeEx:r,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(r,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],e=>e.target.value)):r.addEventListener("input",function(n){e.setValue(t,{value:o(!0)})}),this.data.combo&&this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class _ extends h{static IGNORE_TYPES=new Set(["Line","Square","Circle","PolyLine","Polygon","Ink"]);constructor(e){const{data:t}=e;super(e,{isRenderable:!_.IGNORE_TYPES.has(t.parentType)&&!!(t.titleObj?.str||t.contentsObj?.str||t.richText?.str)})}render(){this.container.className="popupAnnotation";const e=this.layer.querySelectorAll(`[data-annotation-id="${this.data.parentId}"]`);if(0===e.length)return this.container;const t=new w({container:this.container,trigger:Array.from(e),color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText}),n=this.page,i=r.Util.normalizeRect([this.data.parentRect[0],n.view[3]-this.data.parentRect[1]+n.view[1],this.data.parentRect[2],n.view[3]-this.data.parentRect[3]+n.view[1]]),a=i[0]+this.data.parentRect[2]-this.data.parentRect[0],o=i[1],{pageWidth:s,pageHeight:l,pageX:c,pageY:u}=this.viewport.rawDims;return this.container.style.left=100*(a-c)/s+"%",this.container.style.top=100*(o-u)/l+"%",this.container.append(t.render()),this.container}}class w{constructor(e){this.container=e.container,this.trigger=e.trigger,this.color=e.color,this.titleObj=e.titleObj,this.modificationDate=e.modificationDate,this.contentsObj=e.contentsObj,this.richText=e.richText,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.hidden=!0;const t=document.createElement("div");t.className="popup";const n=this.color;if(n){const e=.7*(255-n[0])+n[0],i=.7*(255-n[1])+n[1],a=.7*(255-n[2])+n[2];t.style.backgroundColor=r.Util.makeHexColor(0|e,0|i,0|a)}const a=document.createElement("h1");a.dir=this.titleObj.dir,a.textContent=this.titleObj.str,t.append(a);const o=i.PDFDateString.toDateObject(this.modificationDate);if(o){const e=document.createElement("span");e.className="popupDate",e.textContent="{{date}}, {{time}}",e.dataset.l10nId="annotation_date_string",e.dataset.l10nArgs=JSON.stringify({date:o.toLocaleDateString(),time:o.toLocaleTimeString()}),t.append(e)}if(!this.richText?.str||this.contentsObj?.str&&this.contentsObj.str!==this.richText.str){const e=this._formatContents(this.contentsObj);t.append(e)}else s.XfaLayer.render({xfaHtml:this.richText.html,intent:"richText",div:t}),t.lastChild.className="richText popupContent";Array.isArray(this.trigger)||(this.trigger=[this.trigger]);for(const e of this.trigger)e.addEventListener("click",this._toggle.bind(this)),e.addEventListener("mouseover",this._show.bind(this,!1)),e.addEventListener("mouseout",this._hide.bind(this,!1));return t.addEventListener("click",this._hide.bind(this,!0)),e.append(t),e}_formatContents({str:e,dir:t}){const n=document.createElement("p");n.className="popupContent",n.dir=t;const r=e.split(/(?:\r\n?|\n)/);for(let e=0,t=r.length;e{function n(e){return Math.floor(255*Math.max(0,Math.min(1,e))).toString(16).padStart(2,"0")}Object.defineProperty(t,"__esModule",{value:!0}),t.ColorConverters=void 0,t.ColorConverters=class{static CMYK_G([e,t,n,r]){return["G",1-Math.min(1,.3*e+.59*n+.11*t+r)]}static G_CMYK([e]){return["CMYK",0,0,0,1-e]}static G_RGB([e]){return["RGB",e,e,e]}static G_HTML([e]){const t=n(e);return`#${t}${t}${t}`}static RGB_G([e,t,n]){return["G",.3*e+.59*t+.11*n]}static RGB_HTML([e,t,r]){return`#${n(e)}${n(t)}${n(r)}`}static T_HTML(){return"#00000000"}static CMYK_RGB([e,t,n,r]){return["RGB",1-Math.min(1,e+r),1-Math.min(1,n+r),1-Math.min(1,t+r)]}static CMYK_HTML(e){const t=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(t)}static RGB_CMYK([e,t,n]){const r=1-e,i=1-t,a=1-n;return["CMYK",r,i,a,Math.min(r,i,a)]}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.XfaLayer=void 0;var r=n(19);t.XfaLayer=class{static setupStorage(e,t,n,r,i){const a=r.getValue(t,{value:null});switch(n.name){case"textarea":if(null!==a.value&&(e.textContent=a.value),"print"===i)break;e.addEventListener("input",e=>{r.setValue(t,{value:e.target.value})});break;case"input":if("radio"===n.attributes.type||"checkbox"===n.attributes.type){if(a.value===n.attributes.xfaOn?e.setAttribute("checked",!0):a.value===n.attributes.xfaOff&&e.removeAttribute("checked"),"print"===i)break;e.addEventListener("change",e=>{r.setValue(t,{value:e.target.checked?e.target.getAttribute("xfaOn"):e.target.getAttribute("xfaOff")})})}else{if(null!==a.value&&e.setAttribute("value",a.value),"print"===i)break;e.addEventListener("input",e=>{r.setValue(t,{value:e.target.value})})}break;case"select":if(null!==a.value)for(const e of n.children)e.attributes.value===a.value&&(e.attributes.selected=!0);e.addEventListener("input",e=>{const n=e.target.options,i=-1===n.selectedIndex?"":n[n.selectedIndex].value;r.setValue(t,{value:i})})}}static setAttributes({html:e,element:t,storage:n=null,intent:r,linkService:i}){const{attributes:a}=t,o=e instanceof HTMLAnchorElement;"radio"===a.type&&(a.name=`${a.name}-${r}`);for(const[t,n]of Object.entries(a))if(null!=n)switch(t){case"class":n.length&&e.setAttribute(t,n.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",n);break;case"style":Object.assign(e.style,n);break;case"textContent":e.textContent=n;break;default:(!o||"href"!==t&&"newWindow"!==t)&&e.setAttribute(t,n)}o&&i.addLinkAttributes(e,a.href,a.newWindow),n&&a.dataId&&this.setupStorage(e,a.dataId,t,n)}static render(e){const t=e.annotationStorage,n=e.linkService,i=e.xfaHtml,a=e.intent||"display",o=document.createElement(i.name);i.attributes&&this.setAttributes({html:o,element:i,intent:a,linkService:n});const s=[[i,-1,o]],l=e.div;if(l.append(o),e.viewport){const t=`matrix(${e.viewport.transform.join(",")})`;l.style.transform=t}"richText"!==a&&l.setAttribute("class","xfaLayer xfaFont");const c=[];for(;s.length>0;){const[e,i,o]=s.at(-1);if(i+1===e.children.length){s.pop();continue}const l=e.children[++s.at(-1)[1]];if(null===l)continue;const{name:u}=l;if("#text"===u){const e=document.createTextNode(l.value);c.push(e),o.append(e);continue}let d;if(d=l?.attributes?.xmlns?document.createElementNS(l.attributes.xmlns,u):document.createElement(u),o.append(d),l.attributes&&this.setAttributes({html:d,element:l,storage:t,intent:a,linkService:n}),l.children&&l.children.length>0)s.push([l,-1,d]);else if(l.value){const e=document.createTextNode(l.value);r.XfaText.shouldBuildText(u)&&c.push(e),d.append(e)}}for(const e of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))e.setAttribute("readOnly",!0);return{textDivs:c}}static update(e){const t=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=t,e.div.hidden=!1}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SVGGraphics=void 0;var r=n(6),i=n(1),a=n(10);let o=class{constructor(){(0,i.unreachable)("Not implemented: SVGGraphics")}};t.SVGGraphics=o;{const s={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},l="http://www.w3.org/XML/1998/namespace",c="http://www.w3.org/1999/xlink",u=["butt","round","square"],d=["miter","round","bevel"],h=function(e,t="",n=!1){if(URL.createObjectURL&&"undefined"!=typeof Blob&&!n)return URL.createObjectURL(new Blob([e],{type:t}));const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let i=`data:${t};base64,`;for(let t=0,n=e.length;t>2]+r[(3&a)<<4|o>>4]+r[t+1>6:64]+r[t+2>1&2147483647:n>>1&2147483647;t[e]=n}function n(e,n,r,i){let a=i;const o=n.length;r[a]=o>>24&255,r[a+1]=o>>16&255,r[a+2]=o>>8&255,r[a+3]=255&o,a+=4,r[a]=255&e.charCodeAt(0),r[a+1]=255&e.charCodeAt(1),r[a+2]=255&e.charCodeAt(2),r[a+3]=255&e.charCodeAt(3),a+=4,r.set(n,a),a+=n.length;const s=function(e,n,r){let i=-1;for(let a=n;a>>8^t[n]}return-1^i}(r,i+4,a);r[a]=s>>24&255,r[a+1]=s>>16&255,r[a+2]=s>>8&255,r[a+3]=255&s}function r(e){let t=e.length;const n=65535,r=Math.ceil(t/n),i=new Uint8Array(2+t+5*r+4);let a=0;i[a++]=120,i[a++]=156;let o=0;for(;t>n;)i[a++]=0,i[a++]=255,i[a++]=255,i[a++]=0,i[a++]=0,i.set(e.subarray(o,o+n),a),a+=n,o+=n,t-=n;i[a++]=1,i[a++]=255&t,i[a++]=t>>8&255,i[a++]=255&~t,i[a++]=(65535&~t)>>8&255,i.set(e.subarray(o),a),a+=e.length-o;const s=function(e,t,n){let r=1,i=0;for(let t=0;t>24&255,i[a++]=s>>16&255,i[a++]=s>>8&255,i[a++]=255&s,i}return function(t,o,s){return function(t,o,s,l){const c=t.width,u=t.height;let d,f,p;const m=t.data;switch(o){case i.ImageKind.GRAYSCALE_1BPP:f=0,d=1,p=c+7>>3;break;case i.ImageKind.RGB_24BPP:f=2,d=8,p=3*c;break;case i.ImageKind.RGBA_32BPP:f=6,d=8,p=4*c;break;default:throw new Error("invalid format")}const g=new Uint8Array((1+p)*u);let v=0,y=0;for(let e=0;e>24&255,c>>16&255,c>>8&255,255&c,u>>24&255,u>>16&255,u>>8&255,255&u,d,f,0,0,0]),E=function(e){if(!a.isNodeJS)return r(e);try{let t;t=parseInt(process.versions.node)>=8?e:Buffer.from(e);const n=__webpack_require__(2787).deflateSync(t,{level:9});return n instanceof Uint8Array?n:new Uint8Array(n)}catch(e){(0,i.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+e)}return r(e)}(g),_=e.length+36+b.length+E.length,w=new Uint8Array(_);let S=0;return w.set(e,S),S+=e.length,n("IHDR",b,w,S),S+=12+b.length,n("IDATA",E,w,S),S+=12+E.length,n("IEND",new Uint8Array(0),w,S),h(w,"image/png",s)}(t,void 0===t.kind?i.ImageKind.GRAYSCALE_1BPP:t.kind,o,s)}}();class p{constructor(){this.fontSizeScale=1,this.fontWeight=s.fontWeight,this.fontSize=0,this.textMatrix=i.IDENTITY_MATRIX,this.fontMatrix=i.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=i.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=s.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 m(e){let t=[];const n=[];for(const r of e)"save"!==r.fn?"restore"===r.fn?t=n.pop():t.push(r):(t.push({fnId:92,fn:"group",items:[]}),n.push(t),t=t.at(-1).items);return t}function g(e){if(Number.isInteger(e))return e.toString();const t=e.toFixed(10);let n=t.length-1;if("0"!==t[n])return t;do{n--}while("0"===t[n]);return t.substring(0,"."===t[n]?n:n+1)}function v(e){if(0===e[4]&&0===e[5]){if(0===e[1]&&0===e[2])return 1===e[0]&&1===e[3]?"":`scale(${g(e[0])} ${g(e[3])})`;if(e[0]===e[3]&&e[1]===-e[2])return`rotate(${g(180*Math.acos(e[0])/Math.PI)})`}else if(1===e[0]&&0===e[1]&&0===e[2]&&1===e[3])return`translate(${g(e[4])} ${g(e[5])})`;return`matrix(${g(e[0])} ${g(e[1])} ${g(e[2])} ${g(e[3])} ${g(e[4])} ${g(e[5])})`}let y=0,b=0,E=0;t.SVGGraphics=o=class{constructor(e,t,n=!1){(0,r.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new r.DOMSVGFactory,this.current=new p,this.transformMatrix=i.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=e,this.objs=t,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!n,this._operatorIdMapping=[];for(const e in i.OPS)this._operatorIdMapping[i.OPS[e]]=e}getObject(e,t=null){return"string"==typeof e?e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e):t}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,n=e.argsArray;for(let e=0,r=t.length;e{e.get(t,n)});this.current.dependencies.push(n)}return Promise.all(this.current.dependencies)}transform(e,t,n,r,a,o){const s=[e,t,n,r,a,o];this.transformMatrix=i.Util.transform(this.transformMatrix,s),this.tgrp=null}getSVG(e,t){this.viewport=t;const n=this._initialize(t);return this.loadDependencies(e).then(()=>(this.transformMatrix=i.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(e)),n))}convertOpList(e){const t=this._operatorIdMapping,n=e.argsArray,r=e.fnArray,i=[];for(let e=0,a=r.length;e0&&(this.current.lineWidth=e)}setLineCap(e){this.current.lineCap=u[e]}setLineJoin(e){this.current.lineJoin=d[e]}setMiterLimit(e){this.current.miterLimit=e}setStrokeAlpha(e){this.current.strokeAlpha=e}setStrokeRGBColor(e,t,n){this.current.strokeColor=i.Util.makeHexColor(e,t,n)}setFillAlpha(e){this.current.fillAlpha=e}setFillRGBColor(e,t,n){this.current.fillColor=i.Util.makeHexColor(e,t,n),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,n=this.viewport.height,r=i.Util.inverseTransform(this.transformMatrix),a=i.Util.applyTransform([0,0],r),o=i.Util.applyTransform([0,n],r),s=i.Util.applyTransform([t,0],r),l=i.Util.applyTransform([t,n],r),c=Math.min(a[0],o[0],s[0],l[0]),u=Math.min(a[1],o[1],s[1],l[1]),d=Math.max(a[0],o[0],s[0],l[0]),h=Math.max(a[1],o[1],s[1],l[1]),f=this.svgFactory.createElement("svg:rect");f.setAttributeNS(null,"x",c),f.setAttributeNS(null,"y",u),f.setAttributeNS(null,"width",d-c),f.setAttributeNS(null,"height",h-u),f.setAttributeNS(null,"fill",this._makeShadingPattern(e)),this.current.fillAlpha<1&&f.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(f)}_makeColorN_Pattern(e){return"TilingPattern"===e[0]?this._makeTilingPattern(e):this._makeShadingPattern(e)}_makeTilingPattern(e){const t=e[1],n=e[2],r=e[3]||i.IDENTITY_MATRIX,[a,o,s,l]=e[4],c=e[5],u=e[6],d=e[7],h="shading"+E++,[f,p,m,g]=i.Util.normalizeRect([...i.Util.applyTransform([a,o],r),...i.Util.applyTransform([s,l],r)]),[v,y]=i.Util.singularValueDecompose2dScale(r),b=c*v,_=u*y,w=this.svgFactory.createElement("svg:pattern");w.setAttributeNS(null,"id",h),w.setAttributeNS(null,"patternUnits","userSpaceOnUse"),w.setAttributeNS(null,"width",b),w.setAttributeNS(null,"height",_),w.setAttributeNS(null,"x",`${f}`),w.setAttributeNS(null,"y",`${p}`);const S=this.svg,C=this.transformMatrix,k=this.current.fillColor,A=this.current.strokeColor,x=this.svgFactory.create(m-f,g-p);if(this.svg=x,this.transformMatrix=r,2===d){const e=i.Util.makeHexColor(...t);this.current.fillColor=e,this.current.strokeColor=e}return this.executeOpTree(this.convertOpList(n)),this.svg=S,this.transformMatrix=C,this.current.fillColor=k,this.current.strokeColor=A,w.append(x.childNodes[0]),this.defs.append(w),`url(#${h})`}_makeShadingPattern(e){switch("string"==typeof e&&(e=this.objs.get(e)),e[0]){case"RadialAxial":const t="shading"+E++,n=e[3];let r;switch(e[1]){case"axial":const n=e[4],i=e[5];r=this.svgFactory.createElement("svg:linearGradient"),r.setAttributeNS(null,"id",t),r.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),r.setAttributeNS(null,"x1",n[0]),r.setAttributeNS(null,"y1",n[1]),r.setAttributeNS(null,"x2",i[0]),r.setAttributeNS(null,"y2",i[1]);break;case"radial":const a=e[4],o=e[5],s=e[6],l=e[7];r=this.svgFactory.createElement("svg:radialGradient"),r.setAttributeNS(null,"id",t),r.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),r.setAttributeNS(null,"cx",o[0]),r.setAttributeNS(null,"cy",o[1]),r.setAttributeNS(null,"r",l),r.setAttributeNS(null,"fx",a[0]),r.setAttributeNS(null,"fy",a[1]),r.setAttributeNS(null,"fr",s);break;default:throw new Error(`Unknown RadialAxial type: ${e[1]}`)}for(const e of n){const t=this.svgFactory.createElement("svg:stop");t.setAttributeNS(null,"offset",e[0]),t.setAttributeNS(null,"stop-color",e[1]),r.append(t)}return this.defs.append(r),`url(#${t})`;case"Mesh":return(0,i.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${e[0]}`)}}setDash(e,t){this.current.dashArray=e,this.current.dashPhase=t}constructPath(e,t){const n=this.current;let r=n.x,a=n.y,o=[],s=0;for(const n of e)switch(0|n){case i.OPS.rectangle:r=t[s++],a=t[s++];const e=r+t[s++],n=a+t[s++];o.push("M",g(r),g(a),"L",g(e),g(a),"L",g(e),g(n),"L",g(r),g(n),"Z");break;case i.OPS.moveTo:r=t[s++],a=t[s++],o.push("M",g(r),g(a));break;case i.OPS.lineTo:r=t[s++],a=t[s++],o.push("L",g(r),g(a));break;case i.OPS.curveTo:r=t[s+4],a=t[s+5],o.push("C",g(t[s]),g(t[s+1]),g(t[s+2]),g(t[s+3]),g(r),g(a)),s+=6;break;case i.OPS.curveTo2:o.push("C",g(r),g(a),g(t[s]),g(t[s+1]),g(t[s+2]),g(t[s+3])),r=t[s+2],a=t[s+3],s+=4;break;case i.OPS.curveTo3:r=t[s+2],a=t[s+3],o.push("C",g(t[s]),g(t[s+1]),g(r),g(a),g(r),g(a)),s+=4;break;case i.OPS.closePath:o.push("Z")}o=o.join(" "),n.path&&e.length>0&&e[0]!==i.OPS.rectangle&&e[0]!==i.OPS.moveTo?o=n.path.getAttributeNS(null,"d")+o:(n.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(n.path)),n.path.setAttributeNS(null,"d",o),n.path.setAttributeNS(null,"fill","none"),n.element=n.path,n.setCurrentPoint(r,a)}endPath(){const e=this.current;if(e.path=null,!this.pendingClip)return;if(!e.element)return void(this.pendingClip=null);const t="clippath"+y++,n=this.svgFactory.createElement("svg:clipPath");n.setAttributeNS(null,"id",t),n.setAttributeNS(null,"transform",v(this.transformMatrix));const r=e.element.cloneNode(!0);if("evenodd"===this.pendingClip?r.setAttributeNS(null,"clip-rule","evenodd"):r.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,n.append(r),this.defs.append(n),e.activeClipUrl){e.clipGroup=null;for(const e of this.extraStack)e.clipGroup=null;n.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,n]of e)switch(t){case"LW":this.setLineWidth(n);break;case"LC":this.setLineCap(n);break;case"LJ":this.setLineJoin(n);break;case"ML":this.setMiterLimit(n);break;case"D":this.setDash(n[0],n[1]);break;case"RI":this.setRenderingIntent(n);break;case"FL":this.setFlatness(n);break;case"Font":this.setFont(n);break;case"CA":this.setStrokeAlpha(n);break;case"ca":this.setFillAlpha(n);break;default:(0,i.warn)(`Unimplemented graphic state operator ${t}`)}}fill(){const e=this.current;e.element&&(e.element.setAttributeNS(null,"fill",e.fillColor),e.element.setAttributeNS(null,"fill-opacity",e.fillAlpha),this.endPath())}stroke(){const e=this.current;e.element&&(this._setStrokeAttributes(e.element),e.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(e,t=1){const n=this.current;let r=n.dashArray;1!==t&&r.length>0&&(r=r.map(function(e){return t*e})),e.setAttributeNS(null,"stroke",n.strokeColor),e.setAttributeNS(null,"stroke-opacity",n.strokeAlpha),e.setAttributeNS(null,"stroke-miterlimit",g(n.miterLimit)),e.setAttributeNS(null,"stroke-linecap",n.lineCap),e.setAttributeNS(null,"stroke-linejoin",n.lineJoin),e.setAttributeNS(null,"stroke-width",g(t*n.lineWidth)+"px"),e.setAttributeNS(null,"stroke-dasharray",r.map(g).join(" ")),e.setAttributeNS(null,"stroke-dashoffset",g(t*n.dashPhase)+"px")}eoFill(){this.current.element?.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){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().append(e)}paintImageXObject(e){const t=this.getObject(e);t?this.paintInlineImageXObject(t):(0,i.warn)(`Dependent image with object ID ${e} is not ready yet`)}paintInlineImageXObject(e,t){const n=e.width,r=e.height,i=f(e,this.forceDataSchema,!!t),a=this.svgFactory.createElement("svg:rect");a.setAttributeNS(null,"x","0"),a.setAttributeNS(null,"y","0"),a.setAttributeNS(null,"width",g(n)),a.setAttributeNS(null,"height",g(r)),this.current.element=a,this.clip("nonzero");const o=this.svgFactory.createElement("svg:image");o.setAttributeNS(c,"xlink:href",i),o.setAttributeNS(null,"x","0"),o.setAttributeNS(null,"y",g(-r)),o.setAttributeNS(null,"width",g(n)+"px"),o.setAttributeNS(null,"height",g(r)+"px"),o.setAttributeNS(null,"transform",`scale(${g(1/n)} ${g(-1/r)})`),t?t.append(o):this._ensureTransformGroup().append(o)}paintImageMaskXObject(e){const t=this.getObject(e.data,e);if(t.bitmap)return void(0,i.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");const n=this.current,r=t.width,a=t.height,o=n.fillColor;n.maskId="mask"+b++;const s=this.svgFactory.createElement("svg:mask");s.setAttributeNS(null,"id",n.maskId);const l=this.svgFactory.createElement("svg:rect");l.setAttributeNS(null,"x","0"),l.setAttributeNS(null,"y","0"),l.setAttributeNS(null,"width",g(r)),l.setAttributeNS(null,"height",g(a)),l.setAttributeNS(null,"fill",o),l.setAttributeNS(null,"mask",`url(#${n.maskId})`),this.defs.append(s),this._ensureTransformGroup().append(l),this.paintInlineImageXObject(t,s)}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],n=t[3]-t[1],r=this.svgFactory.createElement("svg:rect");r.setAttributeNS(null,"x",t[0]),r.setAttributeNS(null,"y",t[1]),r.setAttributeNS(null,"width",g(e)),r.setAttributeNS(null,"height",g(n)),this.current.element=r,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(e){const t=this.svgFactory.create(e.width,e.height),n=this.svgFactory.createElement("svg:defs");t.append(n),this.defs=n;const r=this.svgFactory.createElement("svg:g");return r.setAttributeNS(null,"transform",v(e.transform)),t.append(r),this.svg=r,t}_ensureClipGroup(){if(!this.current.clipGroup){const e=this.svgFactory.createElement("svg:g");e.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(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",v(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}}}],__webpack_module_cache__={};function __w_pdfjs_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__w_pdfjs_require__),n.exports}var __nested_webpack_exports__={};return(()=>{var e=__nested_webpack_exports__;Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"AbortException",{enumerable:!0,get:function(){return t.AbortException}}),Object.defineProperty(e,"AnnotationEditorLayer",{enumerable:!0,get:function(){return a.AnnotationEditorLayer}}),Object.defineProperty(e,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return t.AnnotationEditorParamsType}}),Object.defineProperty(e,"AnnotationEditorType",{enumerable:!0,get:function(){return t.AnnotationEditorType}}),Object.defineProperty(e,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return o.AnnotationEditorUIManager}}),Object.defineProperty(e,"AnnotationLayer",{enumerable:!0,get:function(){return s.AnnotationLayer}}),Object.defineProperty(e,"AnnotationMode",{enumerable:!0,get:function(){return t.AnnotationMode}}),Object.defineProperty(e,"CMapCompressionType",{enumerable:!0,get:function(){return t.CMapCompressionType}}),Object.defineProperty(e,"FeatureTest",{enumerable:!0,get:function(){return t.FeatureTest}}),Object.defineProperty(e,"GlobalWorkerOptions",{enumerable:!0,get:function(){return l.GlobalWorkerOptions}}),Object.defineProperty(e,"InvalidPDFException",{enumerable:!0,get:function(){return t.InvalidPDFException}}),Object.defineProperty(e,"MissingPDFException",{enumerable:!0,get:function(){return t.MissingPDFException}}),Object.defineProperty(e,"OPS",{enumerable:!0,get:function(){return t.OPS}}),Object.defineProperty(e,"PDFDataRangeTransport",{enumerable:!0,get:function(){return n.PDFDataRangeTransport}}),Object.defineProperty(e,"PDFDateString",{enumerable:!0,get:function(){return r.PDFDateString}}),Object.defineProperty(e,"PDFWorker",{enumerable:!0,get:function(){return n.PDFWorker}}),Object.defineProperty(e,"PasswordResponses",{enumerable:!0,get:function(){return t.PasswordResponses}}),Object.defineProperty(e,"PermissionFlag",{enumerable:!0,get:function(){return t.PermissionFlag}}),Object.defineProperty(e,"PixelsPerInch",{enumerable:!0,get:function(){return r.PixelsPerInch}}),Object.defineProperty(e,"RenderingCancelledException",{enumerable:!0,get:function(){return r.RenderingCancelledException}}),Object.defineProperty(e,"SVGGraphics",{enumerable:!0,get:function(){return c.SVGGraphics}}),Object.defineProperty(e,"UNSUPPORTED_FEATURES",{enumerable:!0,get:function(){return t.UNSUPPORTED_FEATURES}}),Object.defineProperty(e,"UnexpectedResponseException",{enumerable:!0,get:function(){return t.UnexpectedResponseException}}),Object.defineProperty(e,"Util",{enumerable:!0,get:function(){return t.Util}}),Object.defineProperty(e,"VerbosityLevel",{enumerable:!0,get:function(){return t.VerbosityLevel}}),Object.defineProperty(e,"XfaLayer",{enumerable:!0,get:function(){return u.XfaLayer}}),Object.defineProperty(e,"build",{enumerable:!0,get:function(){return n.build}}),Object.defineProperty(e,"createPromiseCapability",{enumerable:!0,get:function(){return t.createPromiseCapability}}),Object.defineProperty(e,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return t.createValidAbsoluteUrl}}),Object.defineProperty(e,"getDocument",{enumerable:!0,get:function(){return n.getDocument}}),Object.defineProperty(e,"getFilenameFromUrl",{enumerable:!0,get:function(){return r.getFilenameFromUrl}}),Object.defineProperty(e,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return r.getPdfFilenameFromUrl}}),Object.defineProperty(e,"getXfaPageViewport",{enumerable:!0,get:function(){return r.getXfaPageViewport}}),Object.defineProperty(e,"isDataScheme",{enumerable:!0,get:function(){return r.isDataScheme}}),Object.defineProperty(e,"isPdfFile",{enumerable:!0,get:function(){return r.isPdfFile}}),Object.defineProperty(e,"loadScript",{enumerable:!0,get:function(){return r.loadScript}}),Object.defineProperty(e,"renderTextLayer",{enumerable:!0,get:function(){return i.renderTextLayer}}),Object.defineProperty(e,"setLayerDimensions",{enumerable:!0,get:function(){return r.setLayerDimensions}}),Object.defineProperty(e,"shadow",{enumerable:!0,get:function(){return t.shadow}}),Object.defineProperty(e,"updateTextLayer",{enumerable:!0,get:function(){return i.updateTextLayer}}),Object.defineProperty(e,"version",{enumerable:!0,get:function(){return n.version}});var t=__w_pdfjs_require__(1),n=__w_pdfjs_require__(2),r=__w_pdfjs_require__(6),i=__w_pdfjs_require__(26),a=__w_pdfjs_require__(27),o=__w_pdfjs_require__(5),s=__w_pdfjs_require__(32),l=__w_pdfjs_require__(14),c=__w_pdfjs_require__(35),u=__w_pdfjs_require__(34)})(),__nested_webpack_exports__})(),module.exports=factory()},1410:function(e,t,n){"use strict";var r=n(6281);e.exports=function(e){return!!r(e)}},1453:function(e,t,n){"use strict";function r(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function i(e,t,n){var a;return e.length,tr.createElement("div",{className:"page-sidebar-content-overlay"})},1535:function(e,t,n){"use strict";n.r(t),n.d(t,{useItem:function(){return s}});var r=n(9471),i=n(1838),a=n(5630),o=n(6371);function s(e){const[t,n]=(0,r.useState)(""),[s,l]=(0,r.useState)(""),[c,u]=(0,r.useState)(""),d=(e.type,e.singleLinkContent?a.cN:a.p9),h=""===e.thumbnail?null:(0,i.formatInnerLink)(e.thumbnail,o.default.get("config-site").url);return(0,r.useEffect)(()=>{void 0!==e.onMount&&e.onMount()},[]),{titleComponent:function(){let n=e.title;return""!==s&&(n+=" "+s),""!==t&&(n+=" "+t),e.singleLinkContent?r.createElement(a.Et,{title:e.title,ariaLabel:n}):r.createElement(a.w3,{title:e.title,ariaLabel:n,link:e.link})},descriptionComponent:function(){return e.hasMediaViewer&&e.hasMediaViewerDescr?[r.createElement(a.gR,{key:"1",description:e.meta_description?e.meta_description.trim():" "}),r.createElement(a.gR,{key:"2",description:e.description?e.description.trim():" "})]:r.createElement(a.gR,{description:e.description.trim()})},thumbnailUrl:h,UnderThumbWrapper:d}}},1554:function(e,t,n){"use strict";n.d(t,{t:function(){return r}});const r=e=>{if(!e)return;const t=e.split(".");return t[t.length-1]}},1610:function(e,t,n){"use strict";n.r(t),n.d(t,{usePopup:function(){return c}});var r=n(9471),i=n(9834),a=n(1134),o=n(2901);function s(e){const t=(0,r.useRef)(null),[n,s]=(0,r.useState)(!1),l=(0,r.useCallback)(e=>{if((0,a.CX)(e.target,"popup-fullscreen-overlay"))return void d();const n=(0,i.findDOMNode)(t.current),r=e.target;n&&!n.contains(r)&&d()},[]),c=(0,r.useCallback)(e=>{27===(e.keyCode||e.charCode)&&l(e)},[]);function u(){s(!0)}function d(){document.removeEventListener("mousedown",l),document.removeEventListener("keydown",c),s(!1)}function h(){n?d():u()}function f(){n&&d()}function p(){n||u()}return(0,r.useEffect)(()=>{n?(document.addEventListener("mousedown",l),document.addEventListener("keydown",c),"function"==typeof e.showCallback&&e.showCallback()):"function"==typeof e.hideCallback&&e.hideCallback()},[n]),(0,r.useImperativeHandle)(e.contentRef,()=>({toggle:h,tryToHide:f,tryToShow:p})),n?r.createElement(o.Ay,{ref:t,className:e.className,style:e.style},e.children):null}function l(e){return r.cloneElement(e.children,{onClick:()=>e.contentRef.current.toggle()})}function c(){return[(0,r.useRef)(null),s,l]}},1635:function(e,t,n){"use strict";var r=n(2206),i=n(837),a=n(821),o=n(304),s=n(8122),l=i(o(),Object);r(l,{getPolyfill:o,implementation:a,shim:s}),e.exports=l},1661:function(e,t,n){"use strict";e.exports=n(9249)},1662:function(e,t,n){"use strict";e.exports=n(1993)},1701:function(e,t,n){"use strict";var r,i=n(8666),a=n(2358)(),o=n(3875),s=n(2673);if(a){var l=i("RegExp.prototype.exec"),c={},u=function(){throw c},d={toString:u,valueOf:u};"symbol"==typeof Symbol.toPrimitive&&(d[Symbol.toPrimitive]=u),r=function(e){if(!e||"object"!=typeof e)return!1;var t=s(e,"lastIndex");if(!t||!o(t,"value"))return!1;try{l(e,d)}catch(e){return e===c}}}else{var h=i("Object.prototype.toString");r=function(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&"[object RegExp]"===h(e)}}e.exports=r},1702:function(e,t,n){"use strict";n.d(t,{R:function(){return a},e:function(){return o}});var r=n(6403),i=n(8354);const a=function(e,t,n){return void 0===e[t]||(0,i.tR)(e[t])?null:(0,r.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(n||"N/A")+"`, expected `positive integer or zero` ("+e[t]+")."])},o=function(e,t,n){return void 0===e[t]||(0,i.q6)(e[t])?null:(0,r.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(n||"N/A")+"`, expected `positive integer` ("+e[t]+")."])}},1710:function(e){"use strict";e.exports=Math.pow},1724:function(e,t,n){"use strict";var r=n(8581),i=n(3845),a=n(1050),o=n(9150);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new i("a function is required");return o(r,a,e)}},1730:function(e){"use strict";e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},1805:function(e,t,n){"use strict";var r=n(9671),i=n(4239)(),a=n(8666),o=n(6194),s=a("Array.prototype.push"),l=a("Object.prototype.propertyIsEnumerable"),c=i?o.getOwnPropertySymbols:null;e.exports=function(e,t){if(null==e)throw new TypeError("target must be an object");var n=o(e);if(1===arguments.length)return n;for(var a=1;ae.length)){var t=e[k];t.setAttribute("tabindex","0"),t.focus()}},[k]),i.useIsomorphicLayoutEffect(function(){var e=w.current,r=S.current;if(!(!e||0===r.length||n<0||n>r.length)){var i=r[n].closest(".rpv-thumbnail__items");i&&(m===t.ThumbnailDirection.Vertical?function(e,t){var n=e.getBoundingClientRect().top-t.getBoundingClientRect().top,r=e.clientHeight,i=t.clientHeight;n<0?t.scrollTop+=n:n+r<=i||(t.scrollTop+=n+r-i)}(i,e):function(e,t){var n=e.getBoundingClientRect().left-t.getBoundingClientRect().left,r=e.clientWidth,i=t.clientWidth;n<0?t.scrollLeft+=n:n+r<=i||(t.scrollLeft+=n+r-i)}(i,e))}},[n,m]);var F=a.useCallback(function(e){R.current&&(D.markRendered(e),I.current=!1,B())},[_]),j=a.useCallback(function(e,t){t.isVisible?D.setVisibility(e,t.ratio):D.setOutOfRange(e),B()},[_]),B=a.useCallback(function(){if(!I.current){var e=D.getHighestPriorityPage();e>-1&&(D.markRendering(e),I.current=!0,T(e))}},[_]);return a.useEffect(function(){h>=0&&(D.markRendering(h),I.current=!0,T(h))},[_,h]),i.useIsomorphicLayoutEffect(function(){O!==v&&(D.markNotRendered(),B())},[v]),a.createElement("div",{ref:w,"data-testid":"thumbnail__list",className:i.classNames({"rpv-thumbnail__list":!0,"rpv-thumbnail__list--horizontal":m===t.ThumbnailDirection.Horizontal,"rpv-thumbnail__list--rtl":x,"rpv-thumbnail__list--vertical":m===t.ThumbnailDirection.Vertical}),onKeyDown:function(e){switch(e.key){case"ArrowDown":!function(){if(w.current){var e=S.current,t=k+1;t=0&&e[k].setAttribute("tabindex","-1"),A(t))}}();break;case"ArrowUp":!function(){if(w.current){var e=S.current,t=k-1;t>=0&&(k>=0&&e[k].setAttribute("tabindex","-1"),A(t))}}();break;case"Enter":k>=0&&k0&&n===2*t-1||t>0&&n===2*t;break;case i.ViewMode.SinglePage:default:h=n===t}return a.createElement("div",{className:i.classNames({"rpv-thumbnail__items":!0,"rpv-thumbnail__items--dual":v===i.ViewMode.DualPage,"rpv-thumbnail__items--dual-cover":v===i.ViewMode.DualPageWithCover,"rpv-thumbnail__items--single":v===i.ViewMode.SinglePage,"rpv-thumbnail__items--selected":h}),key:"".concat(t,"___").concat(v)},e.map(function(e){return function(e){var t=v===i.ViewMode.DualPageWithCover&&(0===e||E%2==0&&e===E-1),h="".concat(r.loadingTask.docId,"___").concat(e),m=o.length===E?o[e]:"".concat(e+1),_=u?u({currentPage:n,pageIndex:e,numPages:E,pageLabel:m}):m,w=s.has(e)?s.get(e):0,S=a.createElement(f,{doc:r,pageHeight:l,pageIndex:e,pageRotation:w,pageWidth:c,rotation:p,shouldRender:M===e,thumbnailWidth:g,onRenderCompleted:F,onVisibilityChanged:j});return d?d({currentPage:n,key:h,numPages:E,pageIndex:e,renderPageLabel:a.createElement(a.Fragment,null,_),renderPageThumbnail:S,onJumpToPage:function(){return y(e)},onRotatePage:function(t){return b(e,t)}}):a.createElement("div",{key:h},a.createElement("div",{className:i.classNames({"rpv-thumbnail__item":!0,"rpv-thumbnail__item--dual-even":v===i.ViewMode.DualPage&&e%2==0,"rpv-thumbnail__item--dual-odd":v===i.ViewMode.DualPage&&e%2==1,"rpv-thumbnail__item--dual-cover":t,"rpv-thumbnail__item--dual-cover-even":v===i.ViewMode.DualPageWithCover&&!t&&e%2==0,"rpv-thumbnail__item--dual-cover-odd":v===i.ViewMode.DualPageWithCover&&!t&&e%2==1,"rpv-thumbnail__item--single":v===i.ViewMode.SinglePage,"rpv-thumbnail__item--selected":n===e}),role:"button",tabIndex:n===e?0:-1,onClick:function(){return y(e)}},S),a.createElement("div",{"data-testid":"thumbnail__label-".concat(e),className:"rpv-thumbnail__label"},_))}(e)}))}))},m=function(e){var t=e.renderCurrentPageLabel,n=e.renderThumbnailItem,r=e.store,o=e.thumbnailDirection,s=e.thumbnailWidth,l=a.useState(r.get("doc")),c=l[0],h=l[1],f=a.useState(r.get("currentPage")||0),m=f[0],g=f[1],v=a.useState(r.get("pageHeight")||0),y=v[0],b=v[1],E=a.useState(r.get("pageWidth")||0),_=E[0],w=E[1],S=a.useState(r.get("rotation")||0),C=S[0],k=S[1],A=a.useState(r.get("pagesRotation")||new Map),x=A[0],P=A[1],M=a.useState(r.get("rotatedPage")||-1),T=M[0],R=M[1],O=a.useState(r.get("viewMode")),I=O[0],D=O[1],L=function(e){g(e)},N=function(e){h(e)},F=function(e){b(e)},j=function(e){w(e)},B=function(e){k(e)},U=function(e){P(e)},z=function(e){R(e)},q=function(e){D(e)},V=function(e){var t=r.get("jumpToPage");t&&t(e)},H=function(e,t){r.get("rotatePage")(e,t)};return a.useEffect(function(){return r.subscribe("doc",N),r.subscribe("pageHeight",F),r.subscribe("pageWidth",j),r.subscribe("rotatedPage",z),r.subscribe("rotation",B),r.subscribe("pagesRotation",U),r.subscribe("viewMode",q),function(){r.unsubscribe("doc",N),r.unsubscribe("pageHeight",F),r.unsubscribe("pageWidth",j),r.unsubscribe("rotatedPage",z),r.unsubscribe("rotation",B),r.unsubscribe("pagesRotation",U),r.unsubscribe("viewMode",q)}},[]),i.useIsomorphicLayoutEffect(function(){return r.subscribe("currentPage",L),function(){r.unsubscribe("currentPage",L)}},[]),c?a.createElement(i.LazyRender,{testId:"thumbnail__list-container",attrs:{className:"rpv-thumbnail__list-container"}},a.createElement(d,{doc:c},function(e){return a.createElement(p,{currentPage:m,doc:c,labels:e,pagesRotation:x,pageHeight:y,pageWidth:_,renderCurrentPageLabel:t,renderThumbnailItem:n,rotatedPage:T,rotation:C,thumbnailDirection:o,thumbnailWidth:s,viewMode:I,onJumpToPage:V,onRotatePage:H})})):a.createElement("div",{"data-testid":"thumbnail-list__loader",className:"rpv-thumbnail__loader"},a.useContext(u).renderSpinner())};t.thumbnailPlugin=function(e){var n=a.useMemo(function(){return i.createStore({rotatePage:function(){},viewMode:i.ViewMode.SinglePage})},[]),r=a.useState(""),s=r[0],d=r[1];return{install:function(e){n.update("jumpToPage",e.jumpToPage),n.update("rotatePage",e.rotatePage)},onDocumentLoad:function(e){d(e.doc.loadingTask.docId),n.update("doc",e.doc)},onViewerStateChange:function(e){return n.update("currentPage",e.pageIndex),n.update("pagesRotation",e.pagesRotation),n.update("pageHeight",e.pageHeight),n.update("pageWidth",e.pageWidth),n.update("rotation",e.rotation),n.update("rotatedPage",e.rotatedPage),n.update("viewMode",e.viewMode),e},Cover:function(t){return a.createElement(l,o({},t,{renderSpinner:null==e?void 0:e.renderSpinner,store:n}))},Thumbnails:a.useCallback(function(r){return a.createElement(u.Provider,{value:{renderSpinner:(null==e?void 0:e.renderSpinner)||c}},a.createElement(m,{renderCurrentPageLabel:null==e?void 0:e.renderCurrentPageLabel,renderThumbnailItem:null==r?void 0:r.renderThumbnailItem,store:n,thumbnailDirection:(null==r?void 0:r.thumbnailDirection)||t.ThumbnailDirection.Vertical,thumbnailWidth:(null==e?void 0:e.thumbnailWidth)||100}))},[s])}}},2063:function(e,t,n){e.exports.Dispatcher=n(5986)},2078:function(e,t,n){"use strict";function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}n.d(t,{A:function(){return r}})},2099:function(e,t,n){"use strict";var r=n(7118),i=function(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}(n(9471)),a=function(){return i.createElement(r.Icon,{ignoreDirection:!0,size:16},i.createElement("path",{d:"M10.5,0.499c5.523,0,10,4.477,10,10s-4.477,10-10,10s-10-4.477-10-10S4.977,0.499,10.5,0.499z\n M23.5,23.499\n l-5.929-5.929\n M5.5,10.499h10\n M10.5,5.499v10"}))},o=function(){return i.createElement(r.Icon,{ignoreDirection:!0,size:16},i.createElement("path",{d:"M10.5,0.499c5.523,0,10,4.477,10,10s-4.477,10-10,10s-10-4.477-10-10S4.977,0.499,10.5,0.499z\n M23.5,23.499\n l-5.929-5.929\n M5.5,10.499h10"}))},s=function(){return s=Object.assign||function(e){for(var t,n=1,r=arguments.length;ne})||e},m=function(e){var t=f.findIndex(function(t){return t>=e});return-1===t||0===t?e:f[t-1]},g=function(e){var t=e.containerRef,n=e.store,a=function(e){if(!e.shiftKey&&!e.altKey&&(r.isMac()?e.metaKey:e.ctrlKey)){var i=t.current;if(i&&document.activeElement&&i.contains(document.activeElement)){var a=n.get("zoom");if(a){var o=n.get("scale")||1,s=1;switch(e.key){case"-":s=m(o);break;case"=":s=p(o);break;case"0":s=1;break;default:s=o}s!==o&&(e.preventDefault(),a(s))}}}};return i.useEffect(function(){if(t.current)return document.addEventListener("keydown",a),function(){document.removeEventListener("keydown",a)}},[t.current]),i.createElement(i.Fragment,null)},v=[.5,.75,1,1.25,1.5,2,3,4],y={left:0,top:8},b=function(e){var t=e.levels,n=void 0===t?v:t,a=e.scale,o=e.onZoom,s=i.useContext(r.LocalizationContext).l10n,l=i.useContext(r.ThemeContext).direction===r.TextDirection.RightToLeft,c=s&&s.zoom?s.zoom.zoomDocument:"Zoom document";return i.createElement(r.Popover,{ariaControlsSuffix:"zoom",ariaHasPopup:"menu",position:r.Position.BottomCenter,target:function(e){return i.createElement(r.MinimalButton,{ariaLabel:c,testId:"zoom__popover-target",onClick:function(){e()}},i.createElement("span",{className:"rpv-zoom__popover-target"},i.createElement("span",{"data-testid":"zoom__popover-target-scale",className:r.classNames({"rpv-zoom__popover-target-scale":!0,"rpv-zoom__popover-target-scale--ltr":!l,"rpv-zoom__popover-target-scale--rtl":l})},Math.round(100*a),"%"),i.createElement("span",{className:"rpv-zoom__popover-target-arrow"})))},content:function(e){return i.createElement(r.Menu,null,Object.keys(r.SpecialZoomLevel).map(function(t){var n=t;return i.createElement(r.MenuItem,{key:n,onClick:function(){e(),o(n)}},function(e){switch(e){case r.SpecialZoomLevel.ActualSize:return s&&s.zoom?s.zoom.actualSize:"Actual size";case r.SpecialZoomLevel.PageFit:return s&&s.zoom?s.zoom.pageFit:"Page fit";case r.SpecialZoomLevel.PageWidth:return s&&s.zoom?s.zoom.pageWidth:"Page width"}}(n))}),i.createElement(r.MenuDivider,null),n.map(function(t){return i.createElement(r.MenuItem,{key:t,onClick:function(){e(),o(t)}},"".concat(Math.round(100*t),"%"))}))},offset:y,closeOnClickOutside:!0,closeOnEscape:!0})},E=function(e){var t=e.children,n=e.levels,r=e.store;return(t||function(e){return i.createElement(b,{levels:n,scale:e.scale,onZoom:e.onZoom})})({scale:l(r).scale,onZoom:function(e){var t=r.get("zoom");t&&t(e)}})},_={left:0,top:8},w=function(e){var t=e.enableShortcuts,n=e.onClick,o=i.useContext(r.LocalizationContext).l10n,s=o&&o.zoom?o.zoom.zoomIn:"Zoom in",l=t?r.isMac()?"Meta+=":"Ctrl+=":"";return i.createElement(r.Tooltip,{ariaControlsSuffix:"zoom-in",position:r.Position.BottomCenter,target:i.createElement(r.MinimalButton,{ariaKeyShortcuts:l,ariaLabel:s,testId:"zoom__in-button",onClick:n},i.createElement(a,null)),content:function(){return s},offset:_})},S=function(e){var t=e.children,n=e.enableShortcuts,r=e.store,i=l(r).scale;return(t||w)({enableShortcuts:n,onClick:function(){var e=r.get("zoom");e&&e(p(i))}})},C=function(e){var t=e.onClick,n=i.useContext(r.LocalizationContext).l10n,o=n&&n.zoom?n.zoom.zoomIn:"Zoom in";return i.createElement(r.MenuItem,{icon:i.createElement(a,null),testId:"zoom__in-menu",onClick:t},o)},k={left:0,top:8},A=function(e){var t=e.enableShortcuts,n=e.onClick,a=i.useContext(r.LocalizationContext).l10n,s=a&&a.zoom?a.zoom.zoomOut:"Zoom out",l=t?r.isMac()?"Meta+-":"Ctrl+-":"";return i.createElement(r.Tooltip,{ariaControlsSuffix:"zoom-out",position:r.Position.BottomCenter,target:i.createElement(r.MinimalButton,{ariaKeyShortcuts:l,ariaLabel:s,testId:"zoom__out-button",onClick:n},i.createElement(o,null)),content:function(){return s},offset:k})},x=function(e){var t=e.children,n=e.enableShortcuts,r=e.store,i=l(r).scale;return(t||A)({enableShortcuts:n,onClick:function(){var e=r.get("zoom");e&&e(m(i))}})},P=function(e){var t=e.onClick,n=i.useContext(r.LocalizationContext).l10n,a=n&&n.zoom?n.zoom.zoomOut:"Zoom out";return i.createElement(r.MenuItem,{icon:i.createElement(o,null),testId:"zoom__out-menu",onClick:t},a)};t.ZoomInIcon=a,t.ZoomOutIcon=o,t.zoomPlugin=function(e){var t=i.useMemo(function(){return Object.assign({},{enableShortcuts:!0},e)},[]),n=i.useMemo(function(){return r.createStore({})},[]),a=function(e){return i.createElement(S,s({enableShortcuts:t.enableShortcuts},e,{store:n}))},o=function(e){return i.createElement(x,s({enableShortcuts:t.enableShortcuts},e,{store:n}))},l=function(e){return i.createElement(E,s({},e,{store:n}))};return{renderViewer:function(e){var r=e.slot;if(!t.enableShortcuts)return r;var a={children:i.createElement(i.Fragment,null,i.createElement(g,{containerRef:e.containerRef,store:n}),i.createElement(h,{pagesContainerRef:e.pagesContainerRef,store:n}),r.children)};return s(s({},r),a)},install:function(e){n.update("zoom",e.zoom)},onViewerStateChange:function(e){return n.update("scale",e.scale),e},zoomTo:function(e){var t=n.get("zoom");t&&t(e)},CurrentScale:function(e){return i.createElement(c,s({},e,{store:n}))},ZoomIn:a,ZoomInButton:function(){return i.createElement(a,null,function(e){return i.createElement(w,s({},e))})},ZoomInMenuItem:function(e){return i.createElement(a,null,function(t){return i.createElement(C,{onClick:function(){t.onClick(),e.onClick()}})})},ZoomOut:o,ZoomOutButton:function(){return i.createElement(o,null,function(e){return i.createElement(A,s({},e))})},ZoomOutMenuItem:function(e){return i.createElement(o,null,function(t){return i.createElement(P,{onClick:function(){t.onClick(),e.onClick()}})})},Zoom:l,ZoomPopover:function(e){return i.createElement(l,null,function(t){return i.createElement(b,s({levels:null==e?void 0:e.levels},t))})}}}},2127:function(e,t,n){"use strict";n.r(t);var r=n(9032),i=n.n(r),a=n(1838),o=n(3997),s=n(4571),l=n.n(s),c=n(6371),u=n(5697);const d={};class h extends(i()){constructor(){super(),this.mediacms_config=(0,o.$)(window.MediaCMS),this._MEDIA=null,this.pagePlaylistId=null,this.pagePlaylistData=null,this.userList=null,d[Object.defineProperty(this,"id",{value:"MediaPageStoreData_"+Object.keys(d).length}).id]={likedMedia:!1,dislikedMedia:!1,reported_times:0,while:{deleteMedia:!1,submitComment:!1,deleteCommentId:null}},this.removeMediaResponse=this.removeMediaResponse.bind(this),this.removeMediaFail=this.removeMediaFail.bind(this),this.submitCommentFail=this.submitCommentFail.bind(this),this.submitCommentResponse=this.submitCommentResponse.bind(this),this.removeCommentFail=this.removeCommentFail.bind(this),this.removeCommentResponse=this.removeCommentResponse.bind(this)}loadData(){if(!d[this.id].mediaId){let e=function(){let e=new(l())(window.location.href).query;return e?(e=e.substring(1),e.split("&"),e=e.length?e.split("="):[]):e=[],e}();if(e.length){let t=0;for(;t2?arguments[2]:{},a=r(t);i&&(a=o.call(a,Object.getOwnPropertySymbols(t)));for(var s=0;s"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(e){return!1}return!1}}function b(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function E(e,t,n,r){if(e){n=n||document;do{if(null!=t&&(">"===t[0]?e.parentNode===n&&y(e,t):y(e,t))||r&&e===n)return e;if(e===n)break}while(e=b(e))}return null}var _,w=/\s+/g;function S(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var r=(" "+e.className+" ").replace(w," ").replace(" "+t+" "," ");e.className=(r+(n?" "+t:"")).replace(w," ")}}function C(e,t,n){var r=e&&e.style;if(r){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),void 0===t?n:n[t];t in r||-1!==t.indexOf("webkit")||(t="-webkit-"+t),r[t]=n+("string"==typeof n?"":"px")}}function k(e,t){var n="";if("string"==typeof e)n=e;else do{var r=C(e,"transform");r&&"none"!==r&&(n=r+" "+n)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function A(e,t,n){if(e){var r=e.getElementsByTagName(t),i=0,a=r.length;if(n)for(;i=a:i<=a))return r;if(r===x())break;r=D(r,!1)}return!1}function T(e,t,n,r){for(var i=0,a=0,o=e.children;a2&&void 0!==arguments[2]?arguments[2]:{},r=n.evt,a=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(n,H);V.pluginEvent.bind(Fe)(e,t,i({dragEl:$,parentEl:Y,ghostEl:X,rootEl:K,nextEl:Q,lastDownEl:J,cloneEl:Z,cloneHidden:ee,dragStarted:fe,putSortable:oe,activeSortable:Fe.active,originalEvent:r,oldIndex:te,oldDraggableIndex:re,newIndex:ne,newDraggableIndex:ie,hideGhostForTarget:Ie,unhideGhostForTarget:De,cloneNowHidden:function(){ee=!0},cloneNowShown:function(){ee=!1},dispatchSortableEvent:function(e){G({sortable:t,name:e,originalEvent:r})}},a))};function G(e){!function(e){var t=e.sortable,n=e.rootEl,r=e.name,a=e.targetEl,o=e.cloneEl,s=e.toEl,l=e.fromEl,d=e.oldIndex,h=e.newIndex,f=e.oldDraggableIndex,p=e.newDraggableIndex,m=e.originalEvent,g=e.putSortable,v=e.extraEventProperties;if(t=t||n&&n[U]){var y,b=t.options,E="on"+r.charAt(0).toUpperCase()+r.substr(1);!window.CustomEvent||c||u?(y=document.createEvent("Event")).initEvent(r,!0,!0):y=new CustomEvent(r,{bubbles:!0,cancelable:!0}),y.to=s||n,y.from=l||n,y.item=a||n,y.clone=o,y.oldIndex=d,y.newIndex=h,y.oldDraggableIndex=f,y.newDraggableIndex=p,y.originalEvent=m,y.pullMode=g?g.lastPutMode:void 0;var _=i(i({},v),V.getEventProperties(r,t));for(var w in _)y[w]=_[w];n&&n.dispatchEvent(y),b[E]&&b[E].call(t,y)}}(i({putSortable:oe,cloneEl:Z,targetEl:$,rootEl:K,oldIndex:te,oldDraggableIndex:re,newIndex:ne,newDraggableIndex:ie},e))}var $,Y,X,K,Q,J,Z,ee,te,ne,re,ie,ae,oe,se,le,ce,ue,de,he,fe,pe,me,ge,ve,ye=!1,be=!1,Ee=[],_e=!1,we=!1,Se=[],Ce=!1,ke=[],Ae="undefined"!=typeof document,xe=f,Pe=u||c?"cssFloat":"float",Me=Ae&&!p&&!f&&"draggable"in document.createElement("div"),Te=function(){if(Ae){if(c)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}(),Re=function(e,t){var n=C(e),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=T(e,0,t),a=T(e,1,t),o=i&&C(i),s=a&&C(a),l=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+P(i).width,c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+P(a).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&o.float&&"none"!==o.float){var u="left"===o.float?"left":"right";return!a||"both"!==s.clear&&s.clear!==u?"horizontal":"vertical"}return i&&("block"===o.display||"flex"===o.display||"table"===o.display||"grid"===o.display||l>=r&&"none"===n[Pe]||a&&"none"===n[Pe]&&l+c>r)?"vertical":"horizontal"},Oe=function(e){function t(e,n){return function(r,i,a,o){var s=r.options.group.name&&i.options.group.name&&r.options.group.name===i.options.group.name;if(null==e&&(n||s))return!0;if(null==e||!1===e)return!1;if(n&&"clone"===e)return e;if("function"==typeof e)return t(e(r,i,a,o),n)(r,i,a,o);var l=(n?r:i).options.group.name;return!0===e||"string"==typeof e&&e===l||e.join&&e.indexOf(l)>-1}}var n={},r=e.group;r&&"object"==a(r)||(r={name:r}),n.name=r.name,n.checkPull=t(r.pull,!0),n.checkPut=t(r.put),n.revertClone=r.revertClone,e.group=n},Ie=function(){!Te&&X&&C(X,"display","none")},De=function(){!Te&&X&&C(X,"display","")};Ae&&!p&&document.addEventListener("click",function(e){if(be)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),be=!1,!1},!0);var Le=function(e){if($){e=e.touches?e.touches[0]:e;var t=(i=e.clientX,a=e.clientY,Ee.some(function(e){var t=e[U].options.emptyInsertThreshold;if(t&&!R(e)){var n=P(e),r=i>=n.left-t&&i<=n.right+t,s=a>=n.top-t&&a<=n.bottom+t;return r&&s?o=e:void 0}}),o);if(t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[U]._onDragOver(n)}}var i,a,o},Ne=function(e){$&&$.parentNode[U]._isOutsideThisEl(e.target)};function Fe(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=s({},t),e[U]=this;var n,r,a={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Re(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Fe.supportPointer&&"PointerEvent"in window&&(!h||f),emptyInsertThreshold:5};for(var o in V.initializePlugins(this,e,a),a)!(o in t)&&(t[o]=a[o]);for(var l in Oe(t),this)"_"===l.charAt(0)&&"function"==typeof this[l]&&(this[l]=this[l].bind(this));this.nativeDraggable=!t.forceFallback&&Me,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?g(e,"pointerdown",this._onTapStart):(g(e,"mousedown",this._onTapStart),g(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(g(e,"dragover",this),g(e,"dragenter",this)),Ee.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),s(this,(r=[],{captureAnimationState:function(){r=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(e){if("none"!==C(e,"display")&&e!==Fe.ghost){r.push({target:e,rect:P(e)});var t=i({},r[r.length-1].rect);if(e.thisAnimationDuration){var n=k(e,!0);n&&(t.top-=n.f,t.left-=n.e)}e.fromRect=t}})},addAnimationState:function(e){r.push(e)},removeAnimationState:function(e){r.splice(function(e,t){for(var n in e)if(e.hasOwnProperty(n))for(var r in t)if(t.hasOwnProperty(r)&&t[r]===e[n][r])return Number(n);return-1}(r,{target:e}),1)},animateAll:function(e){var t=this;if(!this.options.animation)return clearTimeout(n),void("function"==typeof e&&e());var i=!1,a=0;r.forEach(function(e){var n=0,r=e.target,o=r.fromRect,s=P(r),l=r.prevFromRect,c=r.prevToRect,u=e.rect,d=k(r,!0);d&&(s.top-=d.f,s.left-=d.e),r.toRect=s,r.thisAnimationDuration&&L(l,s)&&!L(o,s)&&(u.top-s.top)/(u.left-s.left)===(o.top-s.top)/(o.left-s.left)&&(n=function(e,t,n,r){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*r.animation}(u,l,c,t.options)),L(s,o)||(r.prevFromRect=o,r.prevToRect=s,n||(n=t.options.animation),t.animate(r,u,s,n)),n&&(i=!0,a=Math.max(a,n),clearTimeout(r.animationResetTimer),r.animationResetTimer=setTimeout(function(){r.animationTime=0,r.prevFromRect=null,r.fromRect=null,r.prevToRect=null,r.thisAnimationDuration=null},n),r.thisAnimationDuration=n)}),clearTimeout(n),i?n=setTimeout(function(){"function"==typeof e&&e()},a):"function"==typeof e&&e(),r=[]},animate:function(e,t,n,r){if(r){C(e,"transition",""),C(e,"transform","");var i=k(this.el),a=i&&i.a,o=i&&i.d,s=(t.left-n.left)/(a||1),l=(t.top-n.top)/(o||1);e.animatingX=!!s,e.animatingY=!!l,C(e,"transform","translate3d("+s+"px,"+l+"px,0)"),this.forRepaintDummy=function(e){return e.offsetWidth}(e),C(e,"transition","transform "+r+"ms"+(this.options.easing?" "+this.options.easing:"")),C(e,"transform","translate3d(0,0,0)"),"number"==typeof e.animated&&clearTimeout(e.animated),e.animated=setTimeout(function(){C(e,"transition",""),C(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1},r)}}}))}function je(e,t,n,r,i,a,o,s){var l,d,h=e[U],f=h.options.onMove;return!window.CustomEvent||c||u?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=t,l.from=e,l.dragged=n,l.draggedRect=r,l.related=i||t,l.relatedRect=a||P(t),l.willInsertAfter=s,l.originalEvent=o,e.dispatchEvent(l),f&&(d=f.call(h,l,o)),d}function Be(e){e.draggable=!1}function Ue(){Ce=!1}function ze(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,r=0;n--;)r+=t.charCodeAt(n);return r.toString(36)}function qe(e){return setTimeout(e,0)}function Ve(e){return clearTimeout(e)}Fe.prototype={constructor:Fe,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(pe=null)},_getDirection:function(e,t){return"function"==typeof this.options.direction?this.options.direction.call(this,e,t,$):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,r=this.options,i=r.preventOnFilter,a=e.type,o=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,s=(o||e).target,l=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,c=r.filter;if(function(e){ke.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var r=t[n];r.checked&&ke.push(r)}}(n),!$&&!(/mousedown|pointerdown/.test(a)&&0!==e.button||r.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!h||!s||"SELECT"!==s.tagName.toUpperCase())&&!((s=E(s,r.draggable,n,!1))&&s.animated||J===s)){if(te=O(s),re=O(s,r.draggable),"function"==typeof c){if(c.call(this,e,s,this))return G({sortable:t,rootEl:l,name:"filter",targetEl:s,toEl:n,fromEl:n}),W("filter",t,{evt:e}),void(i&&e.preventDefault())}else if(c&&(c=c.split(",").some(function(r){if(r=E(l,r.trim(),n,!1))return G({sortable:t,rootEl:r,name:"filter",targetEl:s,fromEl:n,toEl:n}),W("filter",t,{evt:e}),!0})))return void(i&&e.preventDefault());r.handle&&!E(l,r.handle,n,!1)||this._prepareDragStart(e,o,s)}}},_prepareDragStart:function(e,t,n){var r,i=this,a=i.el,o=i.options,s=a.ownerDocument;if(n&&!$&&n.parentNode===a){var l=P(n);if(K=a,Y=($=n).parentNode,Q=$.nextSibling,J=n,ae=o.group,Fe.dragged=$,se={target:$,clientX:(t||e).clientX,clientY:(t||e).clientY},de=se.clientX-l.left,he=se.clientY-l.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,$.style["will-change"]="all",r=function(){W("delayEnded",i,{evt:e}),Fe.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!d&&i.nativeDraggable&&($.draggable=!0),i._triggerDragStart(e,t),G({sortable:i,name:"choose",originalEvent:e}),S($,o.chosenClass,!0))},o.ignore.split(",").forEach(function(e){A($,e.trim(),Be)}),g(s,"dragover",Le),g(s,"mousemove",Le),g(s,"touchmove",Le),o.supportPointer?(g(s,"pointerup",i._onDrop),!this.nativeDraggable&&g(s,"pointercancel",i._onDrop)):(g(s,"mouseup",i._onDrop),g(s,"touchend",i._onDrop),g(s,"touchcancel",i._onDrop)),d&&this.nativeDraggable&&(this.options.touchStartThreshold=4,$.draggable=!0),W("delayStart",this,{evt:e}),!o.delay||o.delayOnTouchOnly&&!t||this.nativeDraggable&&(u||c))r();else{if(Fe.eventCanceled)return void this._onDrop();o.supportPointer?(g(s,"pointerup",i._disableDelayedDrag),g(s,"pointercancel",i._disableDelayedDrag)):(g(s,"mouseup",i._disableDelayedDrag),g(s,"touchend",i._disableDelayedDrag),g(s,"touchcancel",i._disableDelayedDrag)),g(s,"mousemove",i._delayedDragTouchMoveHandler),g(s,"touchmove",i._delayedDragTouchMoveHandler),o.supportPointer&&g(s,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(r,o.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){$&&Be($),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;v(e,"mouseup",this._disableDelayedDrag),v(e,"touchend",this._disableDelayedDrag),v(e,"touchcancel",this._disableDelayedDrag),v(e,"pointerup",this._disableDelayedDrag),v(e,"pointercancel",this._disableDelayedDrag),v(e,"mousemove",this._delayedDragTouchMoveHandler),v(e,"touchmove",this._delayedDragTouchMoveHandler),v(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?g(document,"pointermove",this._onTouchMove):g(document,t?"touchmove":"mousemove",this._onTouchMove):(g($,"dragend",this),g(K,"dragstart",this._onDragStart));try{document.selection?qe(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(e,t){if(ye=!1,K&&$){W("dragStarted",this,{evt:t}),this.nativeDraggable&&g(document,"dragover",Ne);var n=this.options;!e&&S($,n.dragClass,!1),S($,n.ghostClass,!0),Fe.active=this,e&&this._appendGhost(),G({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(le){this._lastX=le.clientX,this._lastY=le.clientY,Ie();for(var e=document.elementFromPoint(le.clientX,le.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(le.clientX,le.clientY))!==t;)t=e;if($.parentNode[U]._isOutsideThisEl(e),t)do{if(t[U]&&t[U]._onDragOver({clientX:le.clientX,clientY:le.clientY,target:e,rootEl:t})&&!this.options.dragoverBubble)break;e=t}while(t=b(t));De()}},_onTouchMove:function(e){if(se){var t=this.options,n=t.fallbackTolerance,r=t.fallbackOffset,i=e.touches?e.touches[0]:e,a=X&&k(X,!0),o=X&&a&&a.a,s=X&&a&&a.d,l=xe&&ve&&I(ve),c=(i.clientX-se.clientX+r.x)/(o||1)+(l?l[0]-Se[0]:0)/(o||1),u=(i.clientY-se.clientY+r.y)/(s||1)+(l?l[1]-Se[1]:0)/(s||1);if(!Fe.active&&!ye){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))i.right+10||e.clientY>r.bottom&&e.clientX>r.left:e.clientY>i.bottom+10||e.clientX>r.right&&e.clientY>r.top}(e,a,this)&&!g.animated){if(g===$)return V(!1);if(g&&o===e.target&&(s=g),s&&(n=P(s)),!1!==je(K,o,$,t,s,n,e,!!s))return q(),g&&g.nextSibling?o.insertBefore($,g.nextSibling):o.appendChild($),Y=o,H(),V(!0)}else if(g&&function(e,t,n){var r=P(T(n.el,0,n.options,!0)),i=B(n.el,n.options,X);return t?e.clientXu+c*a/2:ld-ge)return-me}else if(l>u+c*(1-i)/2&&ld-c*a/2)?l>u+c/2?1:-1:0}(e,s,n,a,k?1:l.swapThreshold,null==l.invertedSwapThreshold?l.swapThreshold:l.invertedSwapThreshold,we,pe===s),0!==y){var D=O($);do{D-=y,_=Y.children[D]}while(_&&("none"===C(_,"display")||_===X))}if(0===y||_===s)return V(!1);pe=s,me=y;var L=s.nextElementSibling,N=!1,j=je(K,o,$,t,s,n,e,N=1===y);if(!1!==j)return 1!==j&&-1!==j||(N=1===j),Ce=!0,setTimeout(Ue,30),q(),N&&!L?o.appendChild($):s.parentNode.insertBefore($,N?L:s),x&&F(x,0,I-x.scrollTop),Y=$.parentNode,void 0===b||we||(ge=Math.abs(b-P(s)[A])),H(),V(!0)}if(o.contains($))return V(!1)}return!1}function z(l,c){W(l,p,i({evt:e,isOwner:d,axis:a?"vertical":"horizontal",revert:r,dragRect:t,targetRect:n,canSort:h,fromSortable:f,target:s,completed:V,onMove:function(n,r){return je(K,o,$,t,n,P(n),e,r)},changed:H},c))}function q(){z("dragOverAnimationCapture"),p.captureAnimationState(),p!==f&&f.captureAnimationState()}function V(t){return z("dragOverCompleted",{insertion:t}),t&&(d?u._hideClone():u._showClone(p),p!==f&&(S($,oe?oe.options.ghostClass:u.options.ghostClass,!1),S($,l.ghostClass,!0)),oe!==p&&p!==Fe.active?oe=p:p===Fe.active&&oe&&(oe=null),f===p&&(p._ignoreWhileAnimating=s),p.animateAll(function(){z("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==f&&(f.animateAll(),f._ignoreWhileAnimating=null)),(s===$&&!$.animated||s===o&&!s.animated)&&(pe=null),l.dragoverBubble||e.rootEl||s===document||($.parentNode[U]._isOutsideThisEl(e.target),!t&&Le(e)),!l.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),m=!0}function H(){ne=O($),ie=O($,l.draggable),G({sortable:p,name:"change",toEl:o,newIndex:ne,newDraggableIndex:ie,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){v(document,"mousemove",this._onTouchMove),v(document,"touchmove",this._onTouchMove),v(document,"pointermove",this._onTouchMove),v(document,"dragover",Le),v(document,"mousemove",Le),v(document,"touchmove",Le)},_offUpEvents:function(){var e=this.el.ownerDocument;v(e,"mouseup",this._onDrop),v(e,"touchend",this._onDrop),v(e,"pointerup",this._onDrop),v(e,"pointercancel",this._onDrop),v(e,"touchcancel",this._onDrop),v(document,"selectstart",this)},_onDrop:function(e){var t=this.el,n=this.options;ne=O($),ie=O($,n.draggable),W("drop",this,{evt:e}),Y=$&&$.parentNode,ne=O($),ie=O($,n.draggable),Fe.eventCanceled||(ye=!1,we=!1,_e=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Ve(this.cloneId),Ve(this._dragStartId),this.nativeDraggable&&(v(document,"drop",this),v(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),h&&C(document.body,"user-select",""),C($,"transform",""),e&&(fe&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),X&&X.parentNode&&X.parentNode.removeChild(X),(K===Y||oe&&"clone"!==oe.lastPutMode)&&Z&&Z.parentNode&&Z.parentNode.removeChild(Z),$&&(this.nativeDraggable&&v($,"dragend",this),Be($),$.style["will-change"]="",fe&&!ye&&S($,oe?oe.options.ghostClass:this.options.ghostClass,!1),S($,this.options.chosenClass,!1),G({sortable:this,name:"unchoose",toEl:Y,newIndex:null,newDraggableIndex:null,originalEvent:e}),K!==Y?(ne>=0&&(G({rootEl:Y,name:"add",toEl:Y,fromEl:K,originalEvent:e}),G({sortable:this,name:"remove",toEl:Y,originalEvent:e}),G({rootEl:Y,name:"sort",toEl:Y,fromEl:K,originalEvent:e}),G({sortable:this,name:"sort",toEl:Y,originalEvent:e})),oe&&oe.save()):ne!==te&&ne>=0&&(G({sortable:this,name:"update",toEl:Y,originalEvent:e}),G({sortable:this,name:"sort",toEl:Y,originalEvent:e})),Fe.active&&(null!=ne&&-1!==ne||(ne=te,ie=re),G({sortable:this,name:"end",toEl:Y,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){W("nulling",this),K=$=Y=X=Q=Z=J=ee=se=le=fe=ne=ie=te=re=pe=me=oe=ae=Fe.dragged=Fe.ghost=Fe.clone=Fe.active=null,ke.forEach(function(e){e.checked=!0}),ke.length=ce=ue=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":$&&(this._onDragOver(e),function(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}(e));break;case"selectstart":e.preventDefault()}},toArray:function(){for(var e,t=[],n=this.el.children,r=0,i=n.length,a=this.options;r0&&!i.call(e,0))for(var m=0;m0)for(var g=0;ge?r.createElement("i",{className:"material-icons","data-icon":e}):null},2855:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MediaListWrapper=void 0;var i=r(n(9471)),a=n(6190);n(5050),t.MediaListWrapper=function(e){var t=e.title,n=e.viewAllLink,r=e.viewAllText,o=e.className,s=e.style,l=e.children;return i.default.createElement("div",{className:(o?o+" ":"")+"media-list-wrapper",style:s},i.default.createElement(a.MediaListRow,{title:t,viewAllLink:n,viewAllText:r},l||null))}},2901:function(e,t,n){"use strict";n.d(t,{AP:function(){return o},cp:function(){return a}});var r=n(9471);const i=r.forwardRef((e,t)=>void 0!==e.children?r.createElement("div",{ref:t,className:"popup"+(void 0!==e.className?" "+e.className:""),style:e.style},e.children):null);function a(e){return void 0!==e.children?r.createElement("div",{className:"popup-top"+(void 0!==e.className?" "+e.className:""),style:e.style},e.children):null}function o(e){return void 0!==e.children?r.createElement("div",{className:"popup-main"+(void 0!==e.className?" "+e.className:""),style:e.style},e.children):null}t.Ay=i},2907:function(e,t,n){"use strict";n.r(t),n.d(t,{useItemListInlineSlider:function(){return l}});var r=n(9471),i=n(1838),a=n(7664),o=n(5289),s=n(4876);function l(e){const t=(0,r.useRef)(null),n=(0,r.useRef)(null),[l,c,u,d,h,f,p]=(0,s.useItemList)(e,t),[m,g]=(0,r.useState)(null),[v,y]=(0,r.useState)(!1),[b,E]=(0,r.useState)(!1),[_,w]=(0,r.useState)(null),[S,C]=(0,r.useState)(null);let k=null,A=null,x=!0,P={list:"items-list",listOuter:"items-list-outer list-inline list-slider"+(e.className?" "+e.className:"")};function M(){m.updateDataStateOnResize(l.length,u.loadedAllItems()),m.scrollToCurrentSlide(),(0,i.removeClassname)(n.current,"resizing"),k=null}function T(){m.nextSlide(),I(),!u.loadedAllItems()&&m.loadMoreItems()?(x=!0,u.loadItems(m.itemsFit())):m.scrollToCurrentSlide()}function R(){m.previousSlide(),I(),m.scrollToCurrentSlide()}function O(e){null!==m?(m.updateDataState(l.length,u.loadedAllItems(),!e),!u.loadedAllItems()&&m.loadItemsToFit()?u.loadItems(m.itemsFit()):(I(),x&&(x=!1,m.scrollToCurrentSlide()))):n.current&&g(new o.A(n.current,".item"))}function I(){m&&(y(m.hasNextSlide()),E(m.hasPreviousSlide()))}return(0,r.useEffect)(()=>{p(),O(!0)},[l]),(0,r.useEffect)(()=>{O(!0)},[m]),(0,r.useEffect)(()=>{null!==m?(clearTimeout(k),(0,i.addClassname)(n.current,"resizing"),m.updateDataStateOnResize(l.length,u.loadedAllItems()),m.scrollToCurrentSlide(),k=setTimeout(M,200)):O(!1)},[_]),(0,r.useEffect)(()=>{clearTimeout(A),A=setTimeout(function(){I(),A=setTimeout(function(){A=null,O()},50)},150)},[S]),[l,c,u,P,d,f,h,function(){w(new Date)},function(){C(new Date)},n,t,function(){return b?r.createElement("span",{className:"previous-slide"},r.createElement(a.CircleIconButton,{buttonShadow:!0,onClick:R},r.createElement("i",{className:"material-icons"},"keyboard_arrow_left"))):null},function(){return v?r.createElement("span",{className:"next-slide"},r.createElement(a.CircleIconButton,{buttonShadow:!0,onClick:T},r.createElement("i",{className:"material-icons"},"keyboard_arrow_right"))):null}]}},2985:function(e,t,n){"use strict";n.d(t,{C:function(){return u},z:function(){return d}});var r=n(9471),i=n(9834),a=n(5465),o=n(5320),s=n(4463),l=n(1936);const c=({children:e})=>r.createElement(o.LayoutProvider,null,r.createElement(a.ThemeProvider,null,r.createElement(s.UserProvider,null,e)));function u(e,t){const n=document.getElementById("app-header"),u=document.getElementById("app-sidebar"),d=e?document.getElementById(e):void 0;d&&t?i.render(r.createElement(c,null,n?i.createPortal(r.createElement(l.PageHeader,null),n):null,u?i.createPortal(r.createElement(l.PageSidebar,null),u):null,r.createElement(t,null)),d):n&&u?i.render(r.createElement(c,null,i.createPortal(r.createElement(l.PageHeader,null),n),r.createElement(l.PageSidebar,null)),u):n?i.render(r.createElement(o.LayoutProvider,null,r.createElement(a.ThemeProvider,null,r.createElement(s.UserProvider,null,r.createElement(l.PageHeader,null)))),u):u&&i.render(r.createElement(c,null,r.createElement(l.PageSidebar,null)),u)}function d(e,t){const n=e?document.getElementById(e):void 0;n&&t&&i.render(r.createElement(t,null),n)}},3063:function(e,t,n){"use strict";e.exports=n(1095)},3114:function(e,t,n){"use strict";e.exports=n(6881)},3129:function(e,t,n){"use strict";var r,i=n(7118),a=function(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}(n(9471)),o=function(){return a.createElement(i.Icon,{size:16},a.createElement("path",{d:"M11.5,5.5v-2C11.5,2.672,12.172,2,13,2s1.5,0.672,1.5,1.5v2 M14.5,11.5v-6C14.5,4.672,15.172,4,16,4\n c0.828,0,1.5,0.672,1.5,1.5v3 M17.5,13V8.5C17.5,7.672,18.172,7,19,7s1.5,0.672,1.5,1.5v10c0,2.761-2.239,5-5,5h-3.335\n c-1.712-0.001-3.305-0.876-4.223-2.321C6.22,18.467,4.083,14,4.083,14c-0.378-0.545-0.242-1.292,0.303-1.67\n c0.446-0.309,1.044-0.281,1.458,0.07L8.5,15.5v-10C8.5,4.672,9.172,4,10,4s1.5,0.672,1.5,1.5v6"}))},s=function(){return s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n(0,r.useContext)(i.LayoutContext)},3291:function(e,t,n){"use strict";var r=n(9029);e.exports=function(e){return r(e)||0===e?e:e<0?-1:1}},3337:function(e,t,n){"use strict";n.r(t),n.d(t,{UpNextLoaderView:function(){return i}});var r=n(1838);function i(e){var t,n=function(){window.location.href=e.url},i=function(){(0,r.removeClassname)(this.vjsPlayerElem,"vjs-mediacms-up-next-hidden")}.bind(this),a=function(){this.cancelTimer(),(0,r.addClassname)(this.vjsPlayerElem,"vjs-mediacms-up-next-hidden")}.bind(this),o={nextMediaPoster:document.createElement("div"),wrapper:document.createElement("div"),inner:document.createElement("div"),innerContent:document.createElement("div"),upNextLabel:document.createElement("div"),nextMediaTitle:document.createElement("div"),nextMediaAuthor:document.createElement("div"),cancelNext:document.createElement("div"),cancelNextButton:document.createElement("button"),goNext:document.createElement("div")};o.nextMediaPoster.setAttribute("class","next-media-poster"),o.wrapper.setAttribute("class","up-next-loader"),o.inner.setAttribute("class","up-next-loader-inner"),o.goNext.setAttribute("class","go-next"),o.cancelNext.setAttribute("class","up-next-cancel"),o.upNextLabel.setAttribute("class","up-next-label"),o.nextMediaTitle.setAttribute("class","next-media-title"),o.nextMediaAuthor.setAttribute("class","next-media-author"),o.upNextLabel.innerHTML=(0,r.translateString)("Up Next"),o.nextMediaTitle.innerHTML=e.title,o.nextMediaAuthor.innerHTML=e.author_name,o.goNext.innerHTML='skip_next',o.cancelNextButton.innerHTML="CANCEL",o.cancelNextButton.addEventListener("click",a),o.nextMediaPoster.style.backgroundImage="url('"+e.thumbnail_url+"')",o.cancelNext.appendChild(o.cancelNextButton),o.innerContent.appendChild(o.upNextLabel),o.innerContent.appendChild(o.nextMediaTitle),o.innerContent.appendChild(o.nextMediaAuthor),o.innerContent.appendChild(o.goNext),o.innerContent.appendChild(o.cancelNext),o.inner.appendChild(o.innerContent),o.wrapper.appendChild(o.nextMediaPoster),o.wrapper.appendChild(o.inner);var s=!1;function l(){var e=this.vjsPlayerElem.getBoundingClientRect();window.pageYOffset||document.documentElement.scrollTop,0>=this.vjsPlayerElem.offsetHeight-56+e.top?(s||this.cancelTimer(!0),s=!0):(s&&this.startTimer(),s=!1)}l=l.bind(this),this.vjsPlayerElem=null,this.html=function(){return o.wrapper},this.startTimer=function(){i(),t=setTimeout(n,1e4),this.vjsPlayerElem&&(0,r.removeClassname)(this.vjsPlayerElem,"vjs-mediacms-canceled-next"),window.addEventListener("scroll",l)},this.cancelTimer=function(e){(e=!!e)||window.removeEventListener("scroll",l),clearTimeout(t),t=null,this.vjsPlayerElem&&(0,r.addClassname)(this.vjsPlayerElem,"vjs-mediacms-canceled-next")},this.setVideoJsPlayerElem=function(e){e&&(this.vjsPlayerElem=e,(0,r.addClassname)(this.vjsPlayerElem,"vjs-mediacms-has-up-next-view"))},this.showTimerView=function(e){(e=!!e)?this.startTimer():i()},this.hideTimerView=function(){a()}}},3369:function(e,t,n){"use strict";var r=n(7118),i=function(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}(n(9471)),a=function(){return i.createElement(r.Icon,{size:16},i.createElement("path",{d:"M0.541,5.627L11.666,18.2c0.183,0.207,0.499,0.226,0.706,0.043c0.015-0.014,0.03-0.028,0.043-0.043\n L23.541,5.627"}))},o=function(){return i.createElement(r.Icon,{size:16},i.createElement("path",{d:"M23.535,18.373L12.409,5.8c-0.183-0.207-0.499-0.226-0.706-0.043C11.688,5.77,11.674,5.785,11.66,5.8\n L0.535,18.373"}))},s=function(){return i.createElement(r.Icon,{ignoreDirection:!0,size:16},i.createElement("path",{d:"M10.5,0.5c5.523,0,10,4.477,10,10s-4.477,10-10,10s-10-4.477-10-10S4.977,0.5,10.5,0.5z\n M23.5,23.5\n l-5.929-5.929"}))},l=function(){return l=Object.assign||function(e){for(var t,n=1,r=arguments.length;nt.top?1:e.leftt.left?1:0},m=function(e){var t=e.numPages,n=e.pageIndex,a=e.renderHighlights,o=e.store,s=e.onHighlightKeyword,l=i.useRef(),h=i.useCallback(function(e){return i.createElement(i.Fragment,null,e.highlightAreas.map(function(e,t){return i.createElement(d,{index:t,key:t,area:e,onHighlightKeyword:s})}))},[]),m=a||h,g=i.useState(o.get("matchPosition")),v=g[0],y=g[1],b=i.useState(o.get("keyword")||[c]),E=b[0],_=b[1],w=i.useState({pageIndex:n,scale:1,status:r.LayerRenderStatus.PreRender}),S=w[0],C=w[1],k=i.useRef(null),A=i.useRef([]),x=i.useState([]),P=x[0],M=x[1],T=function(){return!0},R=i.useCallback(function(){return o.get("targetPageFilter")||T},[o.get("targetPageFilter")]),O=function(e){e&&e.length>0&&_(e)},I=function(e){return y(e)},D=function(e){if(e.has(n)){var t=e.get(n);t&&C({ele:t.ele,pageIndex:n,scale:t.scale,status:t.status})}},L=function(){return 0===E.length||1===E.length&&""===E[0].keyword.trim()};return i.useEffect(function(){if(!L()&&S.status===r.LayerRenderStatus.DidRender&&!A.current.length){var e=S.ele,t=[].slice.call(e.querySelectorAll(".rpv-core__text-layer-text")).map(function(e){return e.textContent}).reduce(function(e,t,n){return e.concat(t.split("").map(function(e,t){return{char:e,charIndexInSpan:t,spanIndex:n}}))},[{char:"",charIndexInSpan:0,spanIndex:0}]).slice(1);A.current=t}},[E,S.status]),i.useEffect(function(){if(!L()&&S.ele&&S.status===r.LayerRenderStatus.DidRender&&R()({pageIndex:n,numPages:t})){var e=function(e){var r=A.current;if(0===r.length)return[];var i=[],a=[].slice.call(e.querySelectorAll(".rpv-core__text-layer-text")),o=r.map(function(e){return e.char}).join("");return E.forEach(function(s){var l=s.keyword;if(l.trim()){for(var c,u=-1===s.regExp.flags.indexOf("g")?new RegExp(s.regExp,"".concat(s.regExp.flags,"g")):s.regExp,d=[];null!==(c=u.exec(o));)d.push({keyword:u,startIndex:c.index,endIndex:u.lastIndex});d.map(function(e){return{keyword:e.keyword,indexes:r.slice(e.startIndex,e.endIndex)}}).forEach(function(r){var o=r.indexes.reduce(function(e,t){return e[t.spanIndex]=(e[t.spanIndex]||[]).concat([t]),e},{});Object.values(o).forEach(function(o){if(1!==o.length||""!==o[0].char.trim()){var c=s.wholeWords?o.slice(1,-1):o,u=function(e,r,i,a,o){var s=document.createRange(),l=a.firstChild;if(!l||l.nodeType!==Node.TEXT_NODE)return null;var c=l.textContent.length,u=o[0].charIndexInSpan,d=1===o.length?u:o[o.length-1].charIndexInSpan;if(u>c||d+1>c)return null;s.setStart(l,u),s.setEnd(l,d+1);var h=document.createElement("span");s.surroundContents(h);var p=h.getBoundingClientRect(),m=i.getBoundingClientRect(),g=m.height,v=m.width,y=100*(p.left-m.left)/v,b=100*(p.top-m.top)/g,E=100*p.height/g,_=100*p.width/v;return f(h),{keyword:r,keywordStr:e,numPages:t,pageIndex:n,left:y,top:b,height:E,width:_,pageHeight:g,pageWidth:v}}(l,r.keyword,e,a[c[0].spanIndex],c);u&&i.push(u)}})})}}),i.sort(p)}(S.ele);M(e)}},[E,v,S.status,A.current]),i.useEffect(function(){L()&&S.ele&&S.status===r.LayerRenderStatus.DidRender&&M([])},[E,S.status]),i.useEffect(function(){if(0!==P.length){var e=l.current;if(v.pageIndex===n&&e&&S.status===r.LayerRenderStatus.DidRender){var t=e.querySelector('.rpv-search__highlight[data-index="'.concat(v.matchIndex,'"]'));if(t){var i=function(e,t){for(var n=e.offsetTop,r=e.offsetLeft,i=e.parentElement;i&&i!==t;)n+=i.offsetTop,r+=i.offsetLeft,i=i.parentElement;return{left:r,top:n}}(t,e),a=i.left,s=i.top,c=o.get("jumpToDestination");c&&(c({pageIndex:n,bottomOffset:(e.getBoundingClientRect().height-s)/S.scale,leftOffset:a/S.scale,scaleTo:S.scale}),k.current&&k.current.classList.remove("rpv-search__highlight--current"),k.current=t,t.classList.add("rpv-search__highlight--current"))}}}},[P,v]),i.useEffect(function(){return o.subscribe("keyword",O),o.subscribe("matchPosition",I),o.subscribe("renderStatus",D),function(){o.unsubscribe("keyword",O),o.unsubscribe("matchPosition",I),o.unsubscribe("renderStatus",D)}},[]),i.createElement("div",{className:"rpv-search__highlights","data-testid":"search__highlights-".concat(n),ref:l},m({getCssProperties:u,highlightAreas:P}))},g=function(e){var t,n=e.wholeWords?" ".concat(e.keyword," "):e.keyword,r=e.matchCase?"g":"gi";return{keyword:e.keyword,regExp:new RegExp((t=n,t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),r),wholeWords:e.wholeWords||!1}},v=function(e,t,n){return e instanceof RegExp?{keyword:e.source,regExp:e,wholeWords:n||!1}:"string"==typeof e?""===e?c:g({keyword:e,matchCase:t||!1,wholeWords:n||!1}):(void 0!==t&&(e.matchCase=t),void 0!==n&&(e.wholeWords=n),g(e))},y=function(e){var t,n=e.get("initialKeyword"),a=i.useMemo(function(){if(n&&1===n.length){var e=v(n[0]);return{matchCase:-1===e.regExp.flags.indexOf("i"),wholeWords:e.wholeWords}}return{matchCase:!1,wholeWords:!1}},[]),o=function(e){var t=i.useRef(e.get("doc")),n=function(e){t.current=e};return i.useEffect(function(){return e.subscribe("doc",n),function(){e.unsubscribe("doc",n)}},[]),t}(e),s=i.useState(n),l=s[0],u=s[1],d=i.useState([]),h=d[0],f=d[1],p=i.useState(0),m=p[0],g=p[1],y=i.useState(a.matchCase),b=y[0],E=y[1],_=i.useRef([]),w=i.useState(a.wholeWords),S=w[0],C=w[1],k=function(){return!0},A=i.useCallback(function(){return e.get("targetPageFilter")||k},[e.get("targetPageFilter")]),x=function(e){var t=h.length;if(0===l.length||0===t)return null;var n=e===t+1?1:Math.max(1,Math.min(t,e));return g(n),M(h[n-1])},P=function(e){return u(""===e?[]:[e])},M=function(t){var n=e.get("jumpToPage");return n&&n(t.pageIndex),e.update("matchPosition",{matchIndex:t.matchIndex,pageIndex:t.pageIndex}),t},T=function(t,n,i){var a=o.current;if(!a)return Promise.resolve([]);var s=a.numPages,l=t.map(function(e){return v(e,n,i)});return e.update("keyword",l),g(0),f([]),new Promise(function(e,t){var n=0===_.current.length?function(){var e=o.current;if(!e)return Promise.resolve([]);var t=Array(e.numPages).fill(0).map(function(t,n){return r.getPage(e,n).then(function(e){return e.getTextContent()}).then(function(e){var t=e.items.map(function(e){return e.str||""}).join("");return Promise.resolve({pageContent:t,pageIndex:n})})});return Promise.all(t).then(function(e){return e.sort(function(e,t){return e.pageIndex-t.pageIndex}),Promise.resolve(e.map(function(e){return e.pageContent}))})}().then(function(e){return _.current=e,Promise.resolve(e)}):Promise.resolve(_.current);n.then(function(t){var n=[];t.forEach(function(e,t){A()({pageIndex:t,numPages:s})&&l.forEach(function(r){for(var i,a=0;null!==(i=r.regExp.exec(e));)n.push({keyword:r.regExp,matchIndex:a,pageIndex:t,pageText:e,startIndex:i.index,endIndex:r.regExp.lastIndex}),a++})}),f(n),n.length>0&&(g(1),M(n[0])),e(n)})})};return i.useEffect(function(){_.current=[]},[o.current]),{clearKeyword:function(){e.update("keyword",[c]),P(""),g(0),f([]),E(!1),C(!1)},changeMatchCase:function(e){E(e),l.length>0&&T(l,e,S)},changeWholeWords:function(e){C(e),l.length>0&&T(l,b,e)},currentMatch:m,jumpToMatch:x,jumpToNextMatch:function(){return x(m+1)},jumpToPreviousMatch:function(){return x(m-1)},keywords:l,matchCase:b,numberOfMatches:h.length,wholeWords:S,search:function(){return T(l,b,S)},searchFor:T,setKeywords:u,keyword:0===l.length?"":(t=l[0],t instanceof RegExp?t.source:"string"==typeof t?t:t.keyword),setKeyword:P,setTargetPages:function(t){e.update("targetPageFilter",t)}}},b=function(e){var t=e.children,n=e.store,r=y(n),a=i.useState(!1),o=a[0],s=a[1],c=function(e){return s(!0)};return i.useEffect(function(){return n.subscribe("doc",c),function(){n.unsubscribe("doc",c)}},[]),t(l(l({},r),{isDocumentLoaded:o}))},E=function(e){var t=e.containerRef,n=e.store,a=i.useRef(!1),o=function(){a.current=!0},s=function(){a.current=!1},l=function(e){var i=t.current;i&&(e.shiftKey||e.altKey||"f"!==e.key||(r.isMac()?e.metaKey&&!e.ctrlKey:e.ctrlKey)&&(a.current||document.activeElement&&i.contains(document.activeElement))&&(e.preventDefault(),n.update("areShortcutsPressed",!0)))};return i.useEffect(function(){var e=t.current;if(e)return document.addEventListener("keydown",l),e.addEventListener("mouseenter",o),e.addEventListener("mouseleave",s),function(){document.removeEventListener("keydown",l),e.removeEventListener("mouseenter",o),e.removeEventListener("mouseleave",s)}},[t.current]),i.createElement(i.Fragment,null)},_={left:0,top:8},w=function(e){var t=e.store,n=e.onToggle,s=i.useContext(r.LocalizationContext).l10n,l=i.useContext(r.ThemeContext).direction,c=i.useState(!1),u=c[0],d=c[1],h=i.useState(!1),f=h[0],p=h[1],m=l===r.TextDirection.RightToLeft,g=y(t),v=g.clearKeyword,b=g.changeMatchCase,E=g.changeWholeWords,w=g.currentMatch,S=g.jumpToNextMatch,C=g.jumpToPreviousMatch,k=g.keyword,A=g.matchCase,x=g.numberOfMatches,P=g.wholeWords,M=g.search,T=g.setKeyword,R=function(e){d(!0),M().then(function(t){d(!1),p(!0),e&&e()})};i.useEffect(function(){var e=t.get("initialKeyword");e&&1===e.length&&k&&R(function(){t.update("initialKeyword",[])})},[]);var O=s&&s.search?s.search.enterToSearch:"Enter to search",I=s&&s.search?s.search.previousMatch:"Previous match",D=s&&s.search?s.search.nextMatch:"Next match",L=s&&s.search?s.search.close:"Close";return i.createElement("div",{className:"rpv-search__popover"},i.createElement("div",{className:"rpv-search__popover-input-counter"},i.createElement(r.TextBox,{ariaLabel:O,autoFocus:!0,placeholder:O,type:"text",value:k,onChange:function(e){p(!1),T(e)},onKeyDown:function(e){"Enter"===e.key&&k&&(f?S():R())}}),i.createElement("div",{className:r.classNames({"rpv-search__popover-counter":!0,"rpv-search__popover-counter--ltr":!m,"rpv-search__popover-counter--rtl":m})},u&&i.createElement(r.Spinner,{testId:"search__popover-searching",size:"1rem"}),!u&&i.createElement("span",{"data-testid":"search__popover-num-matches"},w,"/",x))),i.createElement("label",{className:"rpv-search__popover-label"},i.createElement("input",{className:"rpv-search__popover-label-checkbox","data-testid":"search__popover-match-case",checked:A,type:"checkbox",onChange:function(e){p(!1),b(e.target.checked)}})," ",s&&s.search?s.search.matchCase:"Match case"),i.createElement("label",{className:"rpv-search__popover-label"},i.createElement("input",{className:"rpv-search__popover-label-checkbox",checked:P,"data-testid":"search__popover-whole-words",type:"checkbox",onChange:function(e){p(!1),E(e.target.checked)}})," ",s&&s.search?s.search.wholeWords:"Whole words"),i.createElement("div",{className:"rpv-search__popover-footer"},i.createElement("div",{className:"rpv-search__popover-footer-item"},i.createElement(r.Tooltip,{ariaControlsSuffix:"search-previous-match",position:m?r.Position.BottomRight:r.Position.BottomCenter,target:i.createElement(r.MinimalButton,{ariaLabel:I,isDisabled:w<=1,onClick:C},i.createElement(o,null)),content:function(){return I},offset:_})),i.createElement("div",{className:"rpv-search__popover-footer-item"},i.createElement(r.Tooltip,{ariaControlsSuffix:"search-next-match",position:r.Position.BottomCenter,target:i.createElement(r.MinimalButton,{ariaLabel:D,isDisabled:w>x-1,onClick:S},i.createElement(a,null)),content:function(){return D},offset:_})),i.createElement("div",{className:r.classNames({"rpv-search__popover-footer-button":!0,"rpv-search__popover-footer-button--ltr":!m,"rpv-search__popover-footer-button--rtl":m})},i.createElement(r.Button,{onClick:function(){n(),v()}},L))))},S=function(e){var t=e.children,n=e.onClick,a=i.useContext(r.LocalizationContext).l10n,o=a&&a.search?a.search.search:"Search";return t({icon:i.createElement(s,null),label:o,onClick:n})},C={left:0,top:8},k=function(e){var t=e.enableShortcuts,n=e.store,a=e.onClick,o=t?r.isMac()?"Meta+F":"Ctrl+F":"",s=function(e){e&&a()};return i.useEffect(function(){return n.subscribe("areShortcutsPressed",s),function(){n.unsubscribe("areShortcutsPressed",s)}},[]),i.createElement(S,{onClick:a},function(e){return i.createElement(r.Tooltip,{ariaControlsSuffix:"search-popover",position:r.Position.BottomCenter,target:i.createElement(r.MinimalButton,{ariaKeyShortcuts:o,ariaLabel:e.label,testId:"search__popover-button",onClick:a},e.icon),content:function(){return e.label},offset:C})})},A={left:0,top:8},x=function(e){var t=e.children,n=e.enableShortcuts,a=e.store,o=i.useContext(r.ThemeContext).direction===r.TextDirection.RightToLeft?r.Position.BottomRight:r.Position.BottomLeft,s=t||function(e){return i.createElement(k,l({enableShortcuts:n,store:a},e))};return i.createElement(r.Popover,{ariaControlsSuffix:"search",lockScroll:!1,position:o,target:function(e){return s({onClick:e})},content:function(e){return i.createElement(w,{store:a,onToggle:e})},offset:A,closeOnClickOutside:!1,closeOnEscape:!0})},P=function(e){return Array.isArray(e)?e.map(function(e){return v(e)}):[v(e)]};t.NextIcon=a,t.PreviousIcon=o,t.SearchIcon=s,t.searchPlugin=function(e){var t=i.useMemo(function(){return Object.assign({},{enableShortcuts:!0,onHighlightKeyword:function(){}},e)},[]),n=i.useMemo(function(){return r.createStore({initialKeyword:e&&e.keyword?Array.isArray(e.keyword)?e.keyword:[e.keyword]:[],keyword:e&&e.keyword?P(e.keyword):[c],matchPosition:{matchIndex:-1,pageIndex:-1},renderStatus:new Map})},[]),a=y(n),o=a.clearKeyword,s=a.jumpToMatch,u=a.jumpToNextMatch,d=a.jumpToPreviousMatch,h=a.searchFor,f=a.setKeywords,p=a.setTargetPages,g=function(e){return i.createElement(x,l({enableShortcuts:t.enableShortcuts},e,{store:n}))};return{install:function(t){var r=e&&e.keyword?Array.isArray(e.keyword)?e.keyword:[e.keyword]:[],i=e&&e.keyword?P(e.keyword):[c];n.update("initialKeyword",r),n.update("jumpToDestination",t.jumpToDestination),n.update("jumpToPage",t.jumpToPage),n.update("keyword",i)},renderPageLayer:function(r){return i.createElement(m,{key:r.pageIndex,numPages:r.doc.numPages,pageIndex:r.pageIndex,renderHighlights:null==e?void 0:e.renderHighlights,store:n,onHighlightKeyword:t.onHighlightKeyword})},renderViewer:function(e){var r=e.slot;return r.subSlot&&(r.subSlot.children=i.createElement(i.Fragment,null,t.enableShortcuts&&i.createElement(E,{containerRef:e.containerRef,store:n}),r.subSlot.children)),r},uninstall:function(e){var t=n.get("renderStatus");t&&t.clear()},onDocumentLoad:function(e){n.update("doc",e.doc)},onTextLayerRender:function(e){var t=n.get("renderStatus");t&&(t=t.set(e.pageIndex,e),n.update("renderStatus",t))},Search:function(e){return i.createElement(b,l({},e,{store:n}))},ShowSearchPopover:g,ShowSearchPopoverButton:function(){return i.createElement(g,null,function(e){return i.createElement(k,l({enableShortcuts:t.enableShortcuts,store:n},e))})},clearHighlights:function(){o()},highlight:function(e){var t=Array.isArray(e)?e:[e];return f(t),h(t)},jumpToMatch:s,jumpToNextMatch:u,jumpToPreviousMatch:d,setTargetPages:p}}},3432:function(e){"use strict";e.exports=Math.abs},3447:function(e,t,n){"use strict";var r,i=n(6194),a=n(401),o=n(3851),s=n(2508),l=n(2744),c=n(7566),u=n(3845),d=n(9643),h=n(3432),f=n(7798),p=n(6562),m=n(9436),g=n(1710),v=n(8264),y=n(3291),b=Function,E=function(e){try{return b('"use strict"; return ('+e+").constructor;")()}catch(e){}},_=n(2673),w=n(1277),S=function(){throw new u},C=_?function(){try{return S}catch(e){try{return _(arguments,"callee").get}catch(e){return S}}}():S,k=n(9085)(),A=n(206),x=n(4042),P=n(1730),M=n(5304),T=n(1050),R={},O="undefined"!=typeof Uint8Array&&A?A(Uint8Array):r,I={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":k&&A?A([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":R,"%AsyncGenerator%":R,"%AsyncGeneratorFunction%":R,"%AsyncIteratorPrototype%":R,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?r:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":a,"%eval%":eval,"%EvalError%":o,"%Float16Array%":"undefined"==typeof Float16Array?r:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":b,"%GeneratorFunction%":R,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":k&&A?A(A([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&k&&A?A((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":i,"%Object.getOwnPropertyDescriptor%":_,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":s,"%ReferenceError%":l,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&k&&A?A((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":k&&A?A(""[Symbol.iterator]()):r,"%Symbol%":k?Symbol:r,"%SyntaxError%":c,"%ThrowTypeError%":C,"%TypedArray%":O,"%TypeError%":u,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":d,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet,"%Function.prototype.call%":T,"%Function.prototype.apply%":M,"%Object.defineProperty%":w,"%Object.getPrototypeOf%":x,"%Math.abs%":h,"%Math.floor%":f,"%Math.max%":p,"%Math.min%":m,"%Math.pow%":g,"%Math.round%":v,"%Math.sign%":y,"%Reflect.getPrototypeOf%":P};if(A)try{null.error}catch(e){var D=A(A(e));I["%Error.prototype%"]=D}var L=function e(t){var n;if("%AsyncFunction%"===t)n=E("async function () {}");else if("%GeneratorFunction%"===t)n=E("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=E("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&A&&(n=A(i.prototype))}return I[t]=n,n},N={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},F=n(8581),j=n(3875),B=F.call(T,Array.prototype.concat),U=F.call(M,Array.prototype.splice),z=F.call(T,String.prototype.replace),q=F.call(T,String.prototype.slice),V=F.call(T,RegExp.prototype.exec),H=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,W=/\\(\\)?/g,G=function(e,t){var n,r=e;if(j(N,r)&&(r="%"+(n=N[r])[0]+"%"),j(I,r)){var i=I[r];if(i===R&&(i=L(r)),void 0===i&&!t)throw new u("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:i}}throw new c("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new u('"allowMissing" argument must be a boolean');if(null===V(/^%?[^%]*%?$/,e))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(e){var t=q(e,0,1),n=q(e,-1);if("%"===t&&"%"!==n)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new c("invalid intrinsic syntax, expected opening `%`");var r=[];return z(e,H,function(e,t,n,i){r[r.length]=n?z(i,W,"$1"):t||e}),r}(e),r=n.length>0?n[0]:"",i=G("%"+r+"%",t),a=i.name,o=i.value,s=!1,l=i.alias;l&&(r=l[0],U(n,B([0,1],l)));for(var d=1,h=!0;d=n.length){var g=_(o,f);o=(h=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:o[f]}else h=j(o,f),o=o[f];h&&!s&&(I[a]=o)}}return o}},3496:function(e,t,n){"use strict";n.r(t),n.d(t,{MemberConsumer:function(){return o},MemberContext:function(){return a}});var r=n(9471),i=n(3997);const a=(0,r.createContext)((0,i.$)(window.MediaCMS).member),o=a.Consumer},3534:function(e,t,n){"use strict";var r=n(9383),i=60103,a=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var o=60109,s=60110,l=60112;t.Suspense=60113;var c=60115,u=60116;if("function"==typeof Symbol&&Symbol.for){var d=Symbol.for;i=d("react.element"),a=d("react.portal"),t.Fragment=d("react.fragment"),t.StrictMode=d("react.strict_mode"),t.Profiler=d("react.profiler"),o=d("react.provider"),s=d("react.context"),l=d("react.forward_ref"),t.Suspense=d("react.suspense"),c=d("react.memo"),u=d("react.lazy")}var h="function"==typeof Symbol&&Symbol.iterator;function f(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n1)for(var n=1;n(0,r.useContext)(i.ThemeContext)},3640:function(e,t,n){"use strict";var r=n(6035),i=n.n(r);if(201==n.j)var a=n(419);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s(e){for(var t=1;t(s.MediaPageStore.on("playlist_creation_completed",v),s.MediaPageStore.on("playlist_creation_failed",y),n.current.focus(),()=>{s.MediaPageStore.removeListener("playlist_creation_completed",v),s.MediaPageStore.removeListener("playlist_creation_failed",y)}),[]),r.createElement("div",{className:"playlist-form-wrap"},r.createElement("div",{className:"playlist-form-field playlist-title",ref:t},r.createElement("span",{className:"playlist-form-label"},"Title"),r.createElement("input",{ref:n,type:"text",placeholder:"Enter playlist title...",value:d,onChange:function(){h(n.current.value)},onFocus:function(){(0,l.addClassname)(t.current,"focused")},onBlur:function(){(0,l.removeClassname)(t.current,"focused")},onClick:function(){(0,l.removeClassname)(t.current,"invalid")}})),r.createElement("div",{className:"playlist-form-field playlist-description",ref:i},r.createElement("span",{className:"playlist-form-label"},"Description"),r.createElement("textarea",{ref:a,rows:"1",placeholder:"Enter playlist description...",value:f,onChange:function(){a.current.style.height="";const e=a.current.scrollHeight-2,t=0{a(function(e,t,n){if(void 0!==e){let r=null;return r=void 0!==t&&t>e?t:e,r=void 0!==n&&n>1,u=-7,d=n?i-1:0,h=n?-1:1,f=e[t+d];for(d+=h,a=f&(1<<-u)-1,f>>=-u,u+=s;u>0;a=256*a+e[t+d],d+=h,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;u>0;o=256*o+e[t+d],d+=h,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,r),a-=c}return(f?-1:1)*o*Math.pow(2,a-r)},t.write=function(e,t,n,r,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:a-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+d>=1?h/l:h*Math.pow(2,1-d))*l>=2&&(o++,l/=2),o+d>=u?(s=0,o=u):o+d>=1?(s=(t*l-1)*Math.pow(2,i),o+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;e[n+f]=255&s,f+=p,s/=256,i-=8);for(o=o<0;e[n+f]=255&o,f+=p,o/=256,c-=8);e[n+f-p]|=128*m}},4239:function(e){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(var r in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var i=Object.getOwnPropertySymbols(e);if(1!==i.length||i[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var a=Object.getOwnPropertyDescriptor(e,t);if(42!==a.value||!0!==a.enumerable)return!1}return!0}},4247:function(e,t,n){"use strict";n.r(t),n.d(t,{MediaDurationInfo:function(){return a}});var r=n(1838);const i={};class a{constructor(e){i[Object.defineProperty(this,"id",{value:"MediaDurationInfo_"+Object.keys(i).length}).id]={fn:{infoToString:function(e){return e<10?"0"+e:e}}},(0,r.isPositiveIntegerOrZero)(e)&&this.update(e)}update(e){i[this.id].toString=void 0,i[this.id].ariaLabel=void 0,(0,r.isPositiveIntegerOrZero)(e)&&(i[this.id].days=Math.floor(e/86400),i[this.id].seconds=e%86400,i[this.id].date=i[this.id].seconds?new Date(1e3*i[this.id].seconds):null,i[this.id].hours=i[this.id].date?24*i[this.id].days+i[this.id].date.getUTCHours():0,i[this.id].minutes=i[this.id].date?i[this.id].date.getUTCMinutes():0,i[this.id].seconds=i[this.id].date?i[this.id].date.getSeconds():0)}toString(){return void 0===i[this.id].toString&&(i[this.id].toString=(0i[this.id].minutes?"0":"")+i[this.id].minutes+":"+i[this.id].fn.infoToString(i[this.id].seconds)),i[this.id].toString}ariaLabel(){if(void 0===i[this.id].ariaLabel){let e=[];02?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}c("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),c("ERR_INVALID_ARG_TYPE",function(e,t,i){var a,s,l,c,d;if(void 0===o&&(o=n(994)),o("string"==typeof e,"'name' must be a string"),"string"==typeof t&&(s="not ",t.substr(0,4)===s)?(a="must not be",t=t.replace(/^not /,"")):a="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-9,n)===t}(e," argument"))l="The ".concat(e," ").concat(a," ").concat(u(t,"type"));else{var h=("number"!=typeof d&&(d=0),d+1>(c=e).length||-1===c.indexOf(".",d)?"argument":"property");l='The "'.concat(e,'" ').concat(h," ").concat(a," ").concat(u(t,"type"))}return l+". Received type ".concat(r(i))},TypeError),c("ERR_INVALID_ARG_VALUE",function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===s&&(s=n(7391));var i=s.inspect(t);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(r,". Received ").concat(i)},TypeError,RangeError),c("ERR_INVALID_RETURN_VALUE",function(e,t,n){var i;return i=n&&n.constructor&&n.constructor.name?"instance of ".concat(n.constructor.name):"type ".concat(r(n)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(i,".")},TypeError),c("ERR_MISSING_ARGS",function(){for(var e=arguments.length,t=new Array(e),r=0;r0,"At least one arg needs to be specified");var i="The ",a=t.length;switch(t=t.map(function(e){return'"'.concat(e,'"')}),a){case 1:i+="".concat(t[0]," argument");break;case 2:i+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:i+=t.slice(0,a-1).join(", "),i+=", and ".concat(t[a-1]," arguments")}return"".concat(i," must be specified")},TypeError),e.exports.codes=l},4267:function(e){"use strict";e.exports=Object.getOwnPropertyDescriptor},4301:function(e,t,n){"use strict";e.exports=n(2099)},4314:function(e,t,n){"use strict";var r,i=n(1724),a=n(2673);try{r=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var o=!!r&&a&&a(Object.prototype,"__proto__"),s=Object,l=s.getPrototypeOf;e.exports=o&&"function"==typeof o.get?i([o.get]):"function"==typeof l&&function(e){return l(null==e?e:s(e))}},4343:function(e){"use strict";var t=Object.prototype.toString;e.exports=function(e){var n=t.call(e),r="[object Arguments]"===n;return r||(r="[object Array]"!==n&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),r}},4350:function(e,t,n){"use strict";n.d(t,{GP:function(){return c}});var r=["second","minute","hour","day","week","month","year"],i=["秒","分钟","小时","天","周","个月","年"],a={},o=function(e,t){a[e]=t},s=[60,60,24,7,365/7/12,12];function l(e){return e instanceof Date?e:!isNaN(e)||/^\d+$/.test(e)?new Date(parseInt(e)):(e=(e||"").trim().replace(/\.\d+/,"").replace(/-/,"/").replace(/-/,"/").replace(/(\d)T(\d)/,"$1 $2").replace(/Z/," UTC").replace(/([+-]\d\d):?(\d\d)/," $1$2"),new Date(e))}var c=function(e,t,n){var r=function(e,t){return(+(t?l(t):new Date)-+l(e))/1e3}(e,n&&n.relativeDate);return function(e,t){for(var n=e<0?1:0,r=e=Math.abs(e),i=0;e>=s[i]&&i(0==(i*=2)?9:1)&&(i+=1),t(e,i,r)[n].replace("%s",e.toString())}(r,function(e){return a[e]||a.en_US}(t))};o("en_US",function(e,t){if(0===t)return["just now","right now"];var n=r[Math.floor(t/2)];return e>1&&(n+="s"),[e+" "+n+" ago","in "+e+" "+n]}),o("zh_CN",function(e,t){if(0===t)return["刚刚","片刻后"];var n=i[~~(t/2)];return[e+" "+n+"前",e+" "+n+"后"]})},4388:function(e,t,n){"use strict";n.r(t),n.d(t,{addMediaToPlaylist:function(){return m},addNewPlaylist:function(){return v},copyEmbedMediaCode:function(){return u},copyShareLink:function(){return c},createPlaylist:function(){return p},deleteComment:function(){return f},dislikeMedia:function(){return s},likeMedia:function(){return o},loadMediaData:function(){return a},removeMedia:function(){return d},removeMediaFromPlaylist:function(){return g},reportMedia:function(){return l},submitComment:function(){return h}});var r=n(7143),i=n.n(r);function a(){i().dispatch({type:"LOAD_MEDIA_DATA"})}function o(){i().dispatch({type:"LIKE_MEDIA"})}function s(){i().dispatch({type:"DISLIKE_MEDIA"})}function l(e){i().dispatch({type:"REPORT_MEDIA",reportDescription:e?e.replace(/\s/g,""):""})}function c(e){i().dispatch({type:"COPY_SHARE_LINK",inputElement:e})}function u(e){i().dispatch({type:"COPY_EMBED_MEDIA_CODE",inputElement:e})}function d(){i().dispatch({type:"REMOVE_MEDIA"})}function h(e){i().dispatch({type:"SUBMIT_COMMENT",commentText:e})}function f(e){i().dispatch({type:"DELETE_COMMENT",commentId:e})}function p(e){i().dispatch({type:"CREATE_PLAYLIST",playlist_data:e})}function m(e,t){i().dispatch({type:"ADD_MEDIA_TO_PLAYLIST",playlist_id:e,media_id:t})}function g(e,t){i().dispatch({type:"REMOVE_MEDIA_FROM_PLAYLIST",playlist_id:e,media_id:t})}function v(e){i().dispatch({type:"APPEND_NEW_PLAYLIST",playlist_data:e})}},4389:function(e,t,n){"use strict";var r,i=n(7118),a=function(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}(n(9471)),o=function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0)return!1;var r=n.length;if(0===r)return!1;for(var i=n.concat([]);i.length>0;){var a=i.shift(),o=a.items;a.count&&o&&a.count>0&&o.length>0&&(r+=o.length,i=i.concat(o))}return Math.abs(t)===r}(t)},[t]),y=m.get("bookmarkExpandedMap"),b=d?d({bookmark:t,doc:r,depth:n,index:c}):y.has(g)?y.get(g):!v,E=a.useState(b),_=E[0],w=E[1],S=t.items&&t.items.length>0,C=function(){var e=!_;m.updateCurrentValue("bookmarkExpandedMap",function(t){return t.set(g,e)}),w(e)},k=function(){var e=t.dest,n=m.get("jumpToDestination");i.getDestination(r,e).then(function(e){n&&n(o({label:t.title},e))})},A=function(){S&&t.dest&&k()},x=function(){!S&&t.dest&&k()},P=function(e,t){return a.createElement("div",{className:"rpv-bookmark__item",style:{paddingLeft:"".concat(1.25*n,"rem")},onClick:e},t)},M=function(e,t){return S?a.createElement("span",{className:"rpv-bookmark__toggle","data-testid":"bookmark__toggle-".concat(n,"-").concat(c),onClick:C},_?e:t):a.createElement("span",{className:"rpv-bookmark__toggle"})},T=function(e){return t.url?a.createElement("a",{className:"rpv-bookmark__title",href:t.url,rel:"noopener noreferrer nofollow",target:t.newWindow?"_blank":""},t.title):a.createElement("div",{className:"rpv-bookmark__title","aria-label":t.title,onClick:e},t.title)};return a.createElement("li",{"aria-expanded":_?"true":"false","aria-label":t.title,"aria-level":n+1,"aria-posinset":c+1,"aria-setsize":h,role:"treeitem",tabIndex:-1},p?p({bookmark:t,depth:n,hasSubItems:S,index:c,isExpanded:_,path:g,defaultRenderItem:P,defaultRenderTitle:T,defaultRenderToggle:M,onClickItem:x,onClickTitle:A,onToggleSubItems:C}):P(x,a.createElement(a.Fragment,null,M(a.createElement(s,null),a.createElement(l,null)),T(A))),S&&_&&a.createElement(u,{bookmarks:t.items,depth:n+1,doc:r,isBookmarkExpanded:d,isRoot:!1,pathFromRoot:g,renderBookmarkItem:p,store:m}))},u=function(e){var t=e.bookmarks,n=e.depth,r=void 0===n?0:n,i=e.doc,o=e.isBookmarkExpanded,s=e.isRoot,l=e.pathFromRoot,u=e.renderBookmarkItem,d=e.store;return a.createElement("ul",{className:"rpv-bookmark__list",role:s?"tree":"group",tabIndex:-1},t.map(function(e,n){return a.createElement(c,{bookmark:e,depth:r,doc:i,index:n,isBookmarkExpanded:o,key:n,numberOfSiblings:t.length,pathFromRoot:l,renderBookmarkItem:u,store:d})}))};!function(e){e[e.Collapse=0]="Collapse",e[e.Expand=1]="Expand"}(r||(r={}));var d=function(e){var t=e.bookmarks,n=e.doc,i=e.isBookmarkExpanded,o=e.renderBookmarkItem,s=e.store,l=a.useRef(),c=function(e){var t=l.current;if(t&&e.target instanceof HTMLElement&&t.contains(e.target))switch(e.key){case"ArrowDown":e.preventDefault(),h(function(e,t){return e.indexOf(t)+1});break;case"ArrowLeft":e.preventDefault(),f(r.Collapse);break;case"ArrowRight":e.preventDefault(),f(r.Expand);break;case"ArrowUp":e.preventDefault,h(function(e,t){return e.indexOf(t)-1});break;case"End":e.preventDefault(),h(function(e,t){return e.length-1});break;case" ":case"Enter":case"Space":e.preventDefault(),d();break;case"Home":e.preventDefault(),h(function(e,t){return 0})}},d=function(){var e=document.activeElement.closest(".rpv-bookmark__item").querySelector(".rpv-bookmark__title");e&&e.click()},h=function(e){var t=l.current,n=[].slice.call(t.getElementsByClassName("rpv-bookmark__item"));if(0!==n.length){var r=document.activeElement,i=n[Math.min(n.length-1,Math.max(0,e(n,r)))];r.setAttribute("tabindex","-1"),i.setAttribute("tabindex","0"),i.focus()}},f=function(e){var t=l.current;if(0!==[].slice.call(t.getElementsByClassName("rpv-bookmark__item")).length){var n=document.activeElement.closest(".rpv-bookmark__item"),i=e===r.Collapse?"true":"false";if(n&&n.parentElement.getAttribute("aria-expanded")===i){var a=n.querySelector(".rpv-bookmark__toggle");a&&a.click()}}};return a.useEffect(function(){return document.addEventListener("keydown",c),function(){document.removeEventListener("keydown",c)}},[]),a.useEffect(function(){var e=l.current;if(e){var t=[].slice.call(e.getElementsByClassName("rpv-bookmark__item"));t.length>0&&(t[0].focus(),t[0].setAttribute("tabindex","0"))}},[]),a.createElement("div",{ref:l},a.createElement(u,{bookmarks:t,depth:0,doc:n,isBookmarkExpanded:i,isRoot:!0,pathFromRoot:"",renderBookmarkItem:o,store:s}))},h=function(e){var t=e.doc,n=e.isBookmarkExpanded,r=e.renderBookmarkItem,o=e.store,s=a.useContext(i.LocalizationContext).l10n,l=a.useContext(i.ThemeContext).direction===i.TextDirection.RightToLeft,c=a.useState({isLoaded:!1,items:[]}),u=c[0],h=c[1];return a.useEffect(function(){h({isLoaded:!1,items:[]}),t.getOutline().then(function(e){h({isLoaded:!0,items:e||[]})})},[t]),u.isLoaded?0===u.items.length?a.createElement("div",{"data-testid":"bookmark__empty",className:i.classNames({"rpv-bookmark__empty":!0,"rpv-bookmark__empty--rtl":l})},s&&s.bookmark?s.bookmark.noBookmark:"There is no bookmark"):a.createElement("div",{"data-testid":"bookmark__container",className:i.classNames({"rpv-bookmark__container":!0,"rpv-bookmark__container--rtl":l})},a.createElement(d,{bookmarks:u.items,doc:t,isBookmarkExpanded:n,renderBookmarkItem:r,store:o})):a.createElement("div",{className:"rpv-bookmark__loader"},a.createElement(i.Spinner,null))},f=function(e){var t=e.isBookmarkExpanded,n=e.renderBookmarkItem,r=e.store,o=a.useState(r.get("doc")),s=o[0],l=o[1],c=function(e){l(e)};return a.useEffect(function(){return r.subscribe("doc",c),function(){r.unsubscribe("doc",c)}},[]),s?a.createElement(h,{doc:s,isBookmarkExpanded:t,renderBookmarkItem:n,store:r}):a.createElement("div",{className:"rpv-bookmark__loader"},a.createElement(i.Spinner,null))};t.DownArrowIcon=s,t.RightArrowIcon=l,t.bookmarkPlugin=function(){var e=a.useMemo(function(){return i.createStore({bookmarkExpandedMap:new Map})},[]);return{install:function(t){e.update("jumpToDestination",t.jumpToDestination)},onDocumentLoad:function(t){e.update("doc",t.doc)},Bookmarks:function(t){return a.createElement(f,{isBookmarkExpanded:null==t?void 0:t.isBookmarkExpanded,renderBookmarkItem:null==t?void 0:t.renderBookmarkItem,store:e})}}}},4402:function(e,t,n){"use strict";n.r(t);var r=n(9032),i=n.n(r),a=n(1838),o=n(3997);const s={};class l extends(i()){constructor(){super(),this.mediacms_config=(0,o.$)(window.MediaCMS);const e=(t={},window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,function(e,n,r){t[n]=r}),t);var t;const n=e.q,r=e.c,i=e.t;s[Object.defineProperty(this,"id",{value:"SearchFieldStoreData_"+Object.keys(s).length}).id]={searchQuery:n?decodeURIComponent(n).replace(/\+/g," "):"",categoriesQuery:r?decodeURIComponent(r).replace(/\+/g," "):"",tagsQuery:i?decodeURIComponent(i).replace(/\+/g," "):"",predictions:[]},this.dataResponse=this.dataResponse.bind(this)}dataResponse(e){if(e&&e.data){let t=0;for(s[this.id].predictions=[];t]+)>)/gi,""),S.description=m,e.summary&&(g=e.summary.trim(),g=null===g?g:g.replace(/(<([^>]+)>)/gi,""),S.meta_description=g)):(m=e.preferSummary&&"string"==typeof e.summary?e.summary.trim():"string"==typeof t.description?t.description.trim():null,m=null===m?m:m.replace(/(<([^>]+)>)/gi,""),l||e.inCategoriesList||"user"===h?S.description=m:S.meta_description=m),"video"===h&&(S.previewThumbnail=d),"video"!==h&&"audio"!==h||(S.duration=t.duration),!r&&!o||isNaN(t.media_count)||(S.media_count=parseInt(t.media_count,10)),s&&(w.date=e.hideDate||!1,w.views=e.hideViews||!1,w.author=e.hideAuthor||!1),S={...S,hide:w},S}function A(e){let t=!1;const n={order:e.order,title:e.title,link:e.url.view,thumbnail:e.thumbnail,publish_date:e.date,singleLinkContent:e.singleLinkContent,hasMediaViewer:e.hasMediaViewer,hasMediaViewerDescr:e.hasMediaViewerDescr};switch(e.type){case"user":case"playlist":break;case"video":t=!0,n.duration=e.duration,n.preview_thumbnail=e.previewThumbnail;break;case"audio":t=!0,n.duration=e.duration;break;case"image":case"pdf":t=!0}if(void 0!==e.description&&(n.description=e.description),void 0!==e.meta_description&&(n.meta_description=e.meta_description),!e.taxonomyPage.current&&"playlist"!==e.type||isNaN(e.media_count)||(n.media_count=e.media_count),n.hideAllMeta=e.hide.allMeta,t&&(n.views=e.stats.views,n.author_name=e.author.name,n.author_link=e.author.url,n.hideDate=e.hide.date,n.hideViews=e.hide.views,n.hideAuthor=e.hide.author),(e.playlistPage.current||e.playlistPlayback.current)&&(n.playlistOrder=e.order,e.playlistPlayback.current?(n.playlist_id=e.playlistPlayback.id,n.playlistActiveItem=e.playlistPlayback.activeItem,n.hidePlaylistOrderNumber=e.playlistPlayback.hideOrderNumber):(n.playlist_id=e.playlistPage.id,n.hidePlaylistOptions=e.playlistPage.hideOptions,n.hidePlaylistOrderNumber=e.playlistPage.hideOrderNumber)),e.canEdit&&(n.editLink=e.url.edit),e.taxonomyPage.current)switch(e.taxonomyPage.type){case"categories":return r.createElement(_,S({},n,{type:"category"}));case"tags":return r.createElement(_,S({},n,{type:"tag"}))}switch(e.type){case"user":return r.createElement(w,n);case"playlist":return window.MediaCMS.site.devEnv&&(n.link=n.link.replace("/playlists/","playlist.html?pl=")),r.createElement(E,n);case"video":return r.createElement(y,n);case"audio":return r.createElement(v,n);case"image":return r.createElement(g,S({},n,{type:"image"}));case"pdf":return r.createElement(g,S({},n,{type:"pdf"}))}return r.createElement(g,S({},n,{type:"attachment"}))}E.propTypes={...m.propTypes,media_count:c.PositiveIntegerOrZero},E.defaultProps={...m.defaultProps,media_count:0},_.propTypes={...m.propTypes,type:s().string.isRequired,class_name:s().string,media_count:c.PositiveIntegerOrZero},_.defaultProps={...m.defaultProps,class_name:"",media_count:0},w.propTypes={...m.propTypes},w.defaultProps={...m.defaultProps}},4463:function(e,t,n){"use strict";n.r(t),n.d(t,{UserConsumer:function(){return l},UserContext:function(){return a},UserProvider:function(){return s}});var r=n(9471),i=n(3997);const a=(0,r.createContext)(),o=(0,i.$)(window.MediaCMS).member,s=({children:e})=>{const t={isAnonymous:o.is.anonymous,username:o.username,thumbnail:o.thumbnail,userCan:o.can,pages:o.pages};return r.createElement(a.Provider,{value:t},e)},l=a.Consumer;t.default=a},4470:function(e,t,n){"use strict";function r(e){for(const t in window.REPLACEMENTS)e=e.replace(t,window.REPLACEMENTS[t]);return e}n.d(t,{u:function(){return r}})},4473:function(e,t,n){"use strict";var r,i=n(3616),a=n(7118),o=n(9471),s=n(9834),l=function(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}(o),c=function(){return l.createElement(a.Icon,{size:16},l.createElement("path",{d:"M7.5,19.499h9 M7.5,16.499h9 M5.5,16.5h-3c-1.103-0.003-1.997-0.897-2-2v-6c0.003-1.103,0.897-1.997,2-2h19\n c1.103,0.003,1.997,0.897,2,2v6c-0.003,1.103-0.897,1.997-2,2h-3\n M5.5,4.5v-4h9.586c0.265,0,0.52,0.105,0.707,0.293l2.414,2.414\n C18.395,3.394,18.5,3.649,18.5,3.914V4.5\n M18.5,22.5c0,0.552-0.448,1-1,1h-11c-0.552,0-1-0.448-1-1v-9h13V22.5z\n M3.5,8.499\n c0.552,0,1,0.448,1,1s-0.448,1-1,1s-1-0.448-1-1S2.948,8.499,3.5,8.499z\n M14.5,0.499v4h4"}))},u=function(){return u=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0&&t=0&&e=2&&(n=n.slice(2)):m(i)?n=r[4]:i?a&&(n=n.slice(2)):l>=2&&m(t.protocol)&&(n=r[4]),{protocol:i,slashes:a||m(i),slashesCount:l,rest:n}}function v(e,t,n){if(e=(e=d(e)).replace(o,""),!(this instanceof v))return new v(e,t,n);var a,s,l,c,f,y,b=h.slice(),E=typeof t,_=this,w=0;for("object"!==E&&"string"!==E&&(n=t,t=null),n&&"function"!=typeof n&&(n=i.parse),a=!(s=g(e||"",t=p(t))).protocol&&!s.slashes,_.slashes=s.slashes||a&&t.slashes,_.protocol=s.protocol||t.protocol||"",e=s.rest,("file:"===s.protocol&&(2!==s.slashesCount||u.test(e))||!s.slashes&&(s.protocol||s.slashesCount<2||!m(_.protocol)))&&(b[3]=[/(.*)/,"pathname"]);w=i;)a*=r,i*=r,e+=1;return e=0&&"[object Array]"!==i(e)&&"callee"in e&&"[object Function]"===i(e.callee)},s=function(){return a(arguments)}();a.isLegacyArguments=o,e.exports=s?a:o},4685:function(e,t,n){"use strict";n.r(t),n.d(t,{ItemListAsync:function(){return h}});var r=n(9471),i=n(8713),a=n.n(i),o=n(5338),s=n(4737),l=n(2495),c=n(4433),u=n(5633);function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t(a(new u.B(e.pageItems,e.maxItems,e.firstItemRequestUrl,e.requestUrl,p,m)),()=>{i&&(i.cancelAll(),a(null))}),[]),t?n.length?r.createElement("div",{className:s.listOuter},g(),r.createElement("div",{ref:h,className:"items-list-wrap"},r.createElement("div",{ref:f,className:s.list},n.map((t,n)=>r.createElement(c.c,d({key:n},(0,c.k)(e,t,n)))))),v()):null:r.createElement(l.e,{className:s.listOuter})}h.propTypes={...s.k.propTypes,items:a().array,requestUrl:a().string.isRequired,firstItemRequestUrl:a().string},h.defaultProps={...s.k.defaultProps,requestUrl:null,firstItemRequestUrl:null,pageItems:24}},4737:function(e,t,n){"use strict";n.d(t,{k:function(){return h}});var r=n(9471),i=n(8713),a=n.n(i),o=n(5338),s=n(1838),l=n(2495),c=n(4433);function u(e,t,n,r,i){const a={maxItems:n||255,pageItems:t?Math.min(n,t):1},o={totalItems:0,totalPages:0};let s=e;const l=[],c=[];function u(e){e=isNaN(e)?a.pageItems:e;let t=Math.min(e,c.length);if(t){let e=0;for(;ec.length;)c.push(s[d]),d+=1;return o.totalItems=Math.min(a.maxItems,s.length),o.totalPages=Math.ceil(o.totalItems/a.pageItems),"function"==typeof r&&r(o.totalItems),u(),{loadItems:function(e){l.length(a(new u(e.items,e.pageItems,e.maxItems,p,m)),()=>{i&&(i.cancelAll(),a(null))}),[]),t?n.length?r.createElement("div",{className:s.listOuter},g(),r.createElement("div",{ref:h,className:"items-list-wrap"},r.createElement("div",{ref:f,className:s.list},n.map((t,n)=>r.createElement(c.c,d({key:n},(0,c.k)(e,t,n)))))),v()):null:r.createElement(l.e,{className:s.listOuter})}h.propTypes={items:a().array.isRequired,className:a().string,hideDate:a().bool,hideViews:a().bool,hideAuthor:a().bool,hidePlaylistOptions:a().bool,hidePlaylistOrderNumber:a().bool,hideAllMeta:a().bool,preferSummary:a().bool,inPlaylistView:a().bool,inPlaylistPage:a().bool,playlistActiveItem:s.PositiveIntegerOrZero,playlistId:a().string,maxItems:a().number.isRequired,pageItems:a().number.isRequired,horizontalItemsOrientation:a().bool.isRequired,singleLinkContent:a().bool.isRequired,inTagsList:a().bool,inCategoriesList:a().bool,itemsCountCallback:a().func,itemsLoadCallback:a().func,firstItemViewer:a().bool,firstItemDescr:a().bool,canEdit:a().bool},h.defaultProps={hideDate:!1,hideViews:!1,hideAuthor:!1,hidePlaylistOptions:!0,hidePlaylistOrderNumber:!0,hideAllMeta:!1,preferSummary:!1,inPlaylistView:!1,inPlaylistPage:!1,playlistActiveItem:1,playlistId:void 0,maxItems:99999,pageItems:24,horizontalItemsOrientation:!1,singleLinkContent:!1,inTagsList:!1,inCategoriesList:!1,firstItemViewer:!1,firstItemDescr:!1,canEdit:!1}},4845:function(e,t,n){"use strict";function r(e,t,n){let r=e;return""!==t&&(r+=" "+t),n&&(r+=" pl-active-item"),r}n.d(t,{$:function(){return r}})},4876:function(e,t,n){"use strict";n.r(t),n.d(t,{useItemList:function(){return g}});var r,i,a=n(9471),o=n(7460),s=n(1838);Array.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};var l=".item-img-preview";class c{constructor(e){if(!Array.isArray(e))return null;this.extensions={};const t=["png","jpg","jpeg"];let n,r;if(this.element=null,-1{void 0!==e.itemsLoadCallback&&e.itemsLoadCallback()},[i]),[i,s,c,u,function(e){o([...e])},function(t){l(!0),void 0!==e.itemsCountCallback&&e.itemsCountCallback(t)},function(){if(n=this.state.currentSlide?1:this.state.currentSlide},i.prototype.updateDataState=function(e,t,n){!n&&this.state.initedAllStateValues||(this.state.initedAllStateValues=!0,this.state.wrapper.width=this.data.dom.wrapper.offsetWidth,this.state.wrapper.scrollWidth=this.data.dom.wrapper.scrollWidth,this.state.slideItemsFit=Math.floor(this.state.wrapper.width/this.data.item.width),this.state.slideItems=Math.max(1,this.state.slideItemsFit),t&&this.state.slideItems<=this.state.slideItemsFit&&(this.state.itemsLengthFit=this.state.slideItems)),this.state.totalItems=e,this.state.maxSlideIndex=Math.max(1,this.state.totalItems-this.state.slideItemsFit+1),this.state.currentSlide=Math.min(this.state.currentSlide,this.state.maxSlideIndex),this.state.currentSlide=0>=this.state.currentSlide?1:this.state.currentSlide},i.prototype.nextSlide=function(){this.state.currentSlide=Math.min(r(this.data.dom.wrapper,this.data.item.width,this.state.currentSlide)+this.state.slideItems,this.state.maxSlideIndex)},i.prototype.previousSlide=function(){this.state.currentSlide=Math.max(1,r(this.data.dom.wrapper,this.data.item.width,this.state.currentSlide)-this.state.slideItems)},i.prototype.scrollToCurrentSlide=function(){this.data.dom.wrapper.scrollLeft=this.data.item.width*(this.state.currentSlide-1)},i.prototype.hasNextSlide=function(){return this.state.currentSlidethis.state.totalItems},i.prototype.loadMoreItems=function(){return this.state.currentSlide+this.state.slideItemsFit>=this.state.maxSlideIndex},i.prototype.itemsFit=function(){return this.state.slideItemsFit}},5304:function(e){"use strict";e.exports=Function.prototype.apply},5305:function(e,t,n){"use strict";n.d(t,{V:function(){return s}});var r=n(9471),i=n(9834),a=n(8713),o=n.n(a);function s(e){const t=(0,r.useRef)(null),[n,a]=(0,r.useState)(null);let o=[];function s(t,n){var r;n.preventDefault(),n.stopPropagation(),r=o[t].id,void 0!==e.pages[r]&&a(r)}return(0,r.useEffect)(()=>{void 0!==e.pages[e.initPage]?a(e.initPage):Object.keys(e.pages).length?a(Object.keys(e.pages)[0]):a(null)},[e.initPage]),(0,r.useEffect)(()=>{!function(){let e=0;for(;et=>s(e,t))(n),o[n].elem.addEventListener("click",o[n].listener)),n+=1;e.focusFirstItemOnPageChange&&a.focus()}(),"function"==typeof e.pageChangeCallback&&e.pageChangeCallback(n))},[n]),n?r.createElement("div",{ref:t},r.cloneElement(e.pages[n])):null}s.propTypes={initPage:o().string,pages:o().object.isRequired,pageChangeSelector:o().string.isRequired,pageIdSelectorAttr:o().string.isRequired,focusFirstItemOnPageChange:o().bool,pageChangeCallback:o().func},s.defaultProps={focusFirstItemOnPageChange:!0}},5320:function(e,t,n){"use strict";n.r(t),n.d(t,{LayoutConsumer:function(){return d},LayoutContext:function(){return c},LayoutProvider:function(){return u}});var r=n(9471),i=n(7154),a=n(7460),o=n(1838),s=n(8899);let l;const c=(0,r.createContext)(),u=({children:e})=>{const t=(0,r.useContext)(s.default),n=new i.BrowserCache("MediaCMS["+t.id+"][layout]",86400),u=!(!document.getElementById("app-sidebar")&&!document.querySelector(".page-sidebar")),[d,h]=(0,r.useState)(n.get("visible-sidebar")),[f,p]=(0,r.useState)(!1);(0,r.useEffect)(()=>{d?(0,o.addClassname)(document.body,"visible-sidebar"):(0,o.removeClassname)(document.body,"visible-sidebar"),"media"!==a.PageStore.get("current-page")&&1023{a.PageStore.once("page_init",()=>{"media"===a.PageStore.get("current-page")&&(h(!1),(0,o.removeClassname)(document.body,"visible-sidebar"))}),h("media"!==a.PageStore.get("current-page")&&1023{p(!f)},toggleSidebar:()=>{const e=!d;!function(e){clearTimeout(l),(0,o.addClassname)(document.body,"sliding-sidebar"),l=setTimeout(function(){"media"===a.PageStore.get("current-page")?e?(0,o.addClassname)(document.body,"overflow-hidden"):(0,o.removeClassname)(document.body,"overflow-hidden"):!e||767{const t=(0,r.useContext)(s.default),n=new i.BrowserCache("MediaCMS["+t.id+"][theme]",86400),[o,u]=(0,r.useState)((d=n.get("mode"),h=l.theme.mode,"light"===d||"dark"===d?d:h));var d,h;const f=function(e){let t=null,n=null;return void 0!==e.darkMode&&((0,a.supportsSvgAsImg)()&&void 0!==e.darkMode.svg&&""!==e.darkMode.svg?n=e.darkMode.svg:void 0!==e.darkMode.img&&""!==e.darkMode.img&&(n=e.darkMode.img)),void 0!==e.lightMode&&((0,a.supportsSvgAsImg)()&&void 0!==e.lightMode.svg&&""!==e.lightMode.svg?t=e.lightMode.svg:void 0!==e.lightMode.img&&""!==e.lightMode.img&&(t=e.lightMode.img)),null===t&&null===n||(null===t?t=n:null===n&&(n=t)),{light:t,dark:n}}(l.theme.logo),[p,m]=(0,r.useState)(f[o]);(0,r.useEffect)(()=>{"dark"===o?(0,a.addClassname)(document.body,"dark_theme"):(0,a.removeClassname)(document.body,"dark_theme"),n.set("mode",o),m(f[o])},[o]);const g={logo:p,currentThemeMode:o,changeThemeMode:()=>{u("light"===o?"dark":"light")},themeModeSwitcher:l.theme.switch};return r.createElement(c.Provider,{value:g},e)},d=c.Consumer},5474:function(e,t,n){"use strict";n.d(t,{Y:function(){return r},v:function(){return i}});var r=function(e){return"&"===e[0]},i=function(e){return!r(e)}},5503:function(e,t,n){"use strict";n.r(t);var r=n(9032),i=n.n(r),a=n(1838),o=n(6371),s=n(2127);class l extends(i()){constructor(){super(),this.data={playlistId:null,enabledLoop:null,enabledShuffle:null,savedPlaylist:!1,response:null},this.browserCache=o.default.get("browser-cache")}get(e){switch(e){case"logged-in-user-playlist":return!1;case"enabled-loop":return null===this.data.playlistId&&(this.data.playlistId=s.default.get("playlist-id"),this.data.enabledLoop=this.browserCache.get("loopPlaylist["+this.data.playlistId+"]"),this.data.enabledLoop=null===this.data.enabledLoop||this.data.enabledLoop),this.data.enabledLoop;case"enabled-shuffle":return null===this.data.playlistId&&(this.data.playlistId=s.default.get("playlist-id"),this.data.enabledShuffle=this.browserCache.get("shufflePlaylist["+this.data.playlistId+"]"),this.data.enabledShuffle=null!==this.data.enabledShuffle&&this.data.enabledShuffle),this.data.enabledShuffle;case"saved-playlist":return this.data.savedPlaylist}return null}actions_handler(e){switch(e.type){case"TOGGLE_LOOP":null===this.data.playlistId&&(this.data.playlistId=s.default.get("playlist-id"),this.data.enabledLoop=this.browserCache.get("loopPlaylist["+this.data.playlistId+"]"),this.data.enabledLoop=null===this.data.enabledLoop||this.data.enabledLoop),this.data.enabledLoop=!this.data.enabledLoop,this.browserCache.set("loopPlaylist["+this.data.playlistId+"]",this.data.enabledLoop),this.emit("loop-repeat-updated");break;case"TOGGLE_SHUFFLE":null===this.data.playlistId&&(this.data.playlistId=s.default.get("playlist-id"),this.data.enabledShuffle=this.browserCache.get("shufflePlaylist["+this.data.playlistId+"]"),this.data.enabledShuffle=null!==this.data.enabledShuffle&&this.data.enabledShuffle),this.data.enabledShuffle=!this.data.enabledShuffle,this.browserCache.set("shufflePlaylist["+this.data.playlistId+"]",this.data.enabledShuffle),this.emit("shuffle-updated");break;case"TOGGLE_SAVE":this.data.savedPlaylist=!this.data.savedPlaylist,this.emit("saved-updated")}}}t.default=(0,a.exportStore)(new l,"actions_handler")},5510:function(e,t,n){"use strict";n.r(t),n.d(t,{useManagementTableHeader:function(){return i}});var r=n(9471);function i(e){const[t,n]=(0,r.useState)(e.sort),[i,a]=(0,r.useState)(e.order),[o,s]=(0,r.useState)(e.selected);return(0,r.useEffect)(()=>{n(e.sort)},[e.sort]),(0,r.useEffect)(()=>{a(e.order)},[e.order]),(0,r.useEffect)(()=>{s(e.selected)},[e.selected]),[t,i,o,function(r){const o=r.currentTarget.getAttribute("id"),s=o,l=t===o&&"desc"===i?"asc":"desc";n(s),a(l),void 0!==e.onClickColumnSort&&e.onClickColumnSort(s,l)},function(){const t=!o;s(!t),void 0!==e.onCheckAllRows&&e.onCheckAllRows(t,e.type)}]}},5518:function(e,t,n){"use strict";function r(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw a}}return n}n.d(t,{A:function(){return r}})},5541:function(e){e.exports=function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}},5630:function(e,t,n){"use strict";n.d(t,{gR:function(){return o},p9:function(){return s},cN:function(){return l},Et:function(){return c},w3:function(){return u},rc:function(){return v},$2:function(){return y},st:function(){return _},Aj:function(){return p},fR:function(){return E},jf:function(){return b},MU:function(){return C},wN:function(){return m},s0:function(){return S},aH:function(){return w},Tl:function(){return f},A6:function(){return h},z_:function(){return d},fC:function(){return g},$h:function(){return k.$}});var r=n(9471),i=n(4350),a=n(1838);function o(e){return""===e.description?null:r.createElement("div",{className:"item-description"},r.createElement("div",null,e.description))}function s(e){return r.createElement("div",{className:"item-main"},e.children)}function l(e){return r.createElement(s,null,r.createElement("a",{className:"item-content-link",href:e.link,title:e.title},e.children))}function c(e){return""===e.title?null:r.createElement("h3",null,r.createElement("span",{"aria-label":e.ariaLabel},e.title))}function u(e){return""===e.title?null:r.createElement("h3",null,r.createElement("a",{href:e.link,title:e.title},r.createElement("span",{"aria-label":e.ariaLabel},e.title)))}function d(e){return r.createElement("time",{key:"member-since"},"Member for ",(0,i.GP)(new Date(e.date)).replace(" ago",""))}function h(e){return r.createElement("span",{key:"item-media-count",className:"item-media-count"}," "+e.count," media")}function f(e){return r.createElement("span",{className:"item-meta"},r.createElement("span",{className:"playlist-date"},r.createElement("time",{dateTime:e.dateTime},e.text)))}function p(e){let t=e.link;return t&&window.MediaCMS.site.devEnv&&(t="/edit-media.html"),t?r.createElement("a",{href:t,title:(0,a.translateString)("Edit media"),className:"item-edit-link"},(0,a.translateString)("EDIT MEDIA")):null}function m(e){const t={key:"item-thumb",href:e.link,title:e.title,tabIndex:"-1","aria-hidden":!0,className:"item-thumb"+(e.src?"":" no-thumb"),style:e.src?{backgroundImage:"url('"+e.src+"')"}:null};return r.createElement("a",t,e.src?r.createElement("div",{key:"item-type-icon",className:"item-type-icon"},r.createElement("div",null)):null)}function g(e){const t={key:"item-thumb",href:e.link,title:e.title,tabIndex:"-1","aria-hidden":!0,className:"item-thumb"+(e.src?"":" no-thumb"),style:e.src?{backgroundImage:"url('"+e.src+"')"}:null};return r.createElement("a",t)}function v(e){return""===e.name?null:r.createElement("span",{className:"item-author"},r.createElement("span",null,e.name))}function y(e){return""===e.name?null:r.createElement("span",{className:"item-author"},r.createElement("a",{href:e.link,title:e.name},r.createElement("span",null,e.name)))}function b(e){return r.createElement("span",{className:"item-views"},(0,a.formatViewsNumber)(e.views)+" "+(1>=e.views?(0,a.translateString)("view"):(0,a.translateString)("views")))}function E(e){return r.createElement("span",{className:"item-date"},r.createElement("time",{dateTime:e.dateTime,content:e.time},e.text))}function _(e){return r.createElement("span",{className:"item-duration"},r.createElement("span",{"aria-label":e.ariaLabel,content:e.time},e.text))}function w(e){if(""===e.url)return null;const t=e.url.split(".").slice(0,-1).join("."),n=(0,a.imageExtension)(e.url);return r.createElement("span",{className:"item-img-preview","data-src":t,"data-ext":n})}function S(e){return r.createElement("div",{className:"item-player-wrapper"},r.createElement("div",{className:"item-player-wrapper-inner"},"stop component tou VideoPlayerByPageLink"))}function C(e){return r.createElement("div",{className:"item-order-number"},r.createElement("div",null,r.createElement("div",{"data-order":e.index,"data-id":e.media_id},e.inPlayback&&e.index===e.activeIndex?r.createElement("i",{className:"material-icons"},"play_arrow"):e.index)))}if(!/^((10|40|42)1|152|543|594|722)$/.test(n.j))var k=n(4845)},5633:function(e,t,n){"use strict";n.d(t,{B:function(){return a}});var r=n(7460),i=n(1838);function a(e,t,n,a,o,s){const l={maxItems:t||255,pageItems:e?Math.min(t,e):1},c={totalItems:0,totalPages:0,nextRequestUrl:(0,i.formatInnerLink)(a,r.PageStore.get("config-site").url)},u={pageItems:0,requestResponse:!1};let d=null;const h=[],f=[];function p(e){let t,n;if(e=isNaN(e)?l.pageItems:e,u.pageItems&&u.pageItems<=f.length?(t=u.pageItems,n=!1,u.pageItems=0):(t=Math.min(e,f.length),n=e>f.length&&!!c.nextRequestUrl,u.pageItems=n?e-f.length:0),t){let e=0;for(;ef.length;)null!==d&&d===r[i].url||f.push(r[i]),i+=1;c.nextRequestUrl=n.next&&l.maxItems>f.length?n.next:null,e&&(c.totalItems=n.count?n.count:f.length,c.totalItems=Math.min(l.maxItems,c.totalItems),c.totalPages=Math.ceil(c.totalItems/l.pageItems),"function"==typeof o&&o(c.totalItems)),p()}),c.nextRequestUrl=null}return null!=n?(0,i.getRequest)((0,i.formatInnerLink)(n,r.PageStore.get("config-site").url),!1,function(e){if(e&&e.data){let t=e.data,n=void 0!==t.results?t.results:t;n.length&&(d=n[0].url,h.push(n[0]))}m(!0)}):m(!0),{loadItems:function(e){!u.requestResponse&&h.length(new Date).getTime()?n.value:null:n},clear:function(){var t;if(a&&Object.keys(localStorage).length)for(t in localStorage)localStorage.hasOwnProperty(t)&&0===t.indexOf(e)&&localStorage.removeItem(t);return!0}}:(0,r.logErrorAndReturnError)(["Cache object prefix is required"])}},6089:function(e,t,n){"use strict";n.d(t,{$:function(){return s}});var r=n(9471),i=n(6371);let a=/^(152|543|594|722)$/.test(n.j)?null:[];function o(e){const[t,n]=(0,r.useState)(!1),[i,a]=(0,r.useState)(!0);let o=null,s=null;return(0,r.useEffect)(()=>(o=setTimeout(function(){s=setTimeout(function(){a(!1),s=null},1e3),o=null,n(!0),e.onHide(e.id)},5e3),()=>{o&&clearTimeout(o),s&&clearTimeout(s)}),[]),i?r.createElement("div",{className:"notification-item"+(t?" hidden":"")},r.createElement("div",null,e.children||null)):null}function s(){const[e,t]=(0,r.useState)(a.length);function n(){t(i.default.get("notifications-size")+a.length)}function s(e){const t=[];a.map(n=>{n[0]!==e&&t.push(n)}),a=t}return(0,r.useEffect)(()=>(n(),i.default.on("added_notification",n),()=>i.default.removeListener("added_notification",n)),[]),e?r.createElement("div",{className:"notifications"},r.createElement("div",null,function(){const e=i.default.get("notifications");return[...a.map(e=>r.createElement(o,{key:e[0],id:e[0],onHide:s},e[1])),...e.map(e=>(a.push(e),r.createElement(o,{key:e[0],id:e[0],onHide:s},e[1])))]}())," "):null}},6109:function(e,t,n){"use strict";var r=n(7118),i=function(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}(n(9471)),a=function(){return i.createElement(r.Icon,{size:16},i.createElement("path",{d:"M19.5,15.106l2.4-2.4a1,1,0,0,0,0-1.414l-2.4-2.4V5.5a1,1,0,0,0-1-1H15.106l-2.4-2.4a1,1,0,0,0-1.414,0l-2.4,2.4H5.5a1,1,0,0,0-1,1V8.894l-2.4,2.4a1,1,0,0,0,0,1.414l2.4,2.4V18.5a1,1,0,0,0,1,1H8.894l2.4,2.4a1,1,0,0,0,1.414,0l2.4-2.4H18.5a1,1,0,0,0,1-1Z"}),i.createElement("path",{d:"M10,6.349a6,6,0,0,1,0,11.3,6,6,0,1,0,0-11.3Z"}))},o=function(){return i.createElement(r.Icon,{size:16},i.createElement("path",{d:"M19.491,15.106l2.4-2.4a1,1,0,0,0,0-1.414l-2.4-2.4V5.5a1,1,0,0,0-1-1H15.1L12.7,2.1a1,1,0,0,0-1.414,0l-2.4,2.4H5.491a1,1,0,0,0-1,1V8.894l-2.4,2.4a1,1,0,0,0,0,1.414l2.4,2.4V18.5a1,1,0,0,0,1,1H8.885l2.4,2.4a1,1,0,0,0,1.414,0l2.4-2.4h3.394a1,1,0,0,0,1-1Z"}),i.createElement("path",{d:"M11.491,6c4,0,6,2.686,6,6s-2,6-6,6Z"}))},s=function(){return s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n-1?t:"Object"===t&&function(e){var t=!1;return r(m,function(n,r){if(!t)try{n(e),t=f(r,1)}catch(e){}}),t}(e)}return s?function(e){var t=!1;return r(m,function(n,r){if(!t)try{"$"+n(e)===r&&(t=f(r,1))}catch(e){}}),t}(e):null}},6308:function(e,t,n){"use strict";e.exports=n(3129)},6371:function(e,t,n){"use strict";n.r(t);var r=n(9032),i=n.n(r),a=n(7154),o=n(1838),s=n(3997);function l(){let e=new Uint32Array(3);return window.crypto.getRandomValues(e),(performance.now().toString(36)+Array.from(e).map(e=>e.toString(36)).join("")).replace(/./g,""+Math.random()+Intl.DateTimeFormat().resolvedOptions().timeZone+Date.now())}let c,u=null,d=null;class h extends(i()){constructor(e){super(),d=(0,s.$)(window.MediaCMS),c=new a.BrowserCache(d.site.id,86400),u={mediaAutoPlay:c.get("media-auto-play")},u.mediaAutoPlay=null===u.mediaAutoPlay||u.mediaAutoPlay,this.browserEvents=(0,o.BrowserEvents)(),this.browserEvents.doc(this.onDocumentVisibilityChange.bind(this)),this.browserEvents.win(this.onWindowResize.bind(this),this.onWindowScroll.bind(this)),this.notifications=function(e){let t=[];function n(e){"string"==typeof e&&t.push([l(),e])}return e.map(n),{size:function(){return t.length},push:n,clear:function(){t=[]},messages:function(){return[...t]}}}(void 0!==window.MediaCMS&&void 0!==window.MediaCMS.notifications?window.MediaCMS.notifications:[])}onDocumentVisibilityChange(){this.emit("document_visibility_change")}onWindowScroll(){this.emit("window_scroll")}onWindowResize(){this.emit("window_resize")}initPage(e){u.currentPage=e}get(e){let t;switch(e){case"browser-cache":t=c;break;case"media-auto-play":t=u.mediaAutoPlay;break;case"config-contents":t=d.contents;break;case"config-enabled":t=d.enabled;break;case"config-media-item":t=d.media.item;break;case"config-options":t=d.options;break;case"config-site":t=d.site;break;case"api-playlists":n=e.split("-")[1],t=d.api[n]||null;break;case"notifications-size":t=this.notifications.size();break;case"notifications":t=this.notifications.messages(),this.notifications.clear();break;case"current-page":t=u.currentPage}var n;return t}actions_handler(e){switch(e.type){case"INIT_PAGE":this.initPage(e.page),this.emit("page_init");break;case"TOGGLE_AUTO_PLAY":u.mediaAutoPlay=!u.mediaAutoPlay,c.set("media-auto-play",u.mediaAutoPlay),this.emit("switched_media_auto_play");break;case"ADD_NOTIFICATION":this.notifications.push(e.notification),this.emit("added_notification")}}}t.default=(0,o.exportStore)(new h,"actions_handler")},6387:function(e,t,n){"use strict";n.r(t),n.d(t,{useUser:function(){return a}});var r=n(9471),i=n(4463);const a=()=>(0,r.useContext)(i.default)},6403:function(e,t,n){"use strict";n.d(t,{g:function(){return o},m:function(){return a}});var r=n(8004);function i(e,t,n){let r;switch(n){case TypeError:case RangeError:case SyntaxError:case ReferenceError:r=new n(t[0]);break;default:r=new Error(t[0])}return e(r.message,...t.slice(1)),r}function a(e,t){return i(r.z,e,t)}function o(e,t){return i(r.R,e,t)}},6493:function(e,t,n){"use strict";var r=n(3447),i=n(837),a=i(r("String.prototype.indexOf"));e.exports=function(e,t){var n=r(e,!!t);return"function"==typeof n&&a(e,".prototype.")>-1?i(n):n}},6550:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},6552:function(e,t,n){"use strict";n.r(t),n.d(t,{useMediaFilter:function(){return a}});var r=n(9471),i=n(1610);function a(e){const t=(0,r.useRef)(null),[n,a]=(0,r.useState)(e),[o,s,l]=(0,i.usePopup)();return[t,n,a,o,s,l]}},6562:function(e){"use strict";e.exports=Math.max},6568:function(e,t,n){"use strict";n.d(t,{x:function(){return o}});var r=n(9471),i=n(8713),a=n.n(i);function o(e){let t="spinner-loader";switch(e.size){case"tiny":case"x-small":case"small":case"large":case"x-large":t+=" "+e.size}return r.createElement("div",{className:t},r.createElement("svg",{className:"circular",viewBox:"25 25 50 50"},r.createElement("circle",{className:"path",cx:"50",cy:"50",r:"20",fill:"none",strokeWidth:"1.5",strokeMiterlimit:"10"})))}o.propTypes={size:a().oneOf(["tiny","x-small","small","medium","large","x-large"])},o.defaultProps={size:"medium"}},6619:function(e,t,n){"use strict";n.d(t,{P:function(){return ye},G:function(){return ge}});var r=n(9191),i=n(5385),a=n(2531);function o(e){return(0,r.A)(e)||(0,i.A)(e)||(0,a.A)()}function s(){return s=Object.assign||function(e){for(var t=1;t=0&&t++,e.indexOf("__display__")>=0&&t++,t},L=function(){},N=function(e,t,n){for(var r,i,a,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:L,s=(r=t.map(function(e){return e.regex}),i=/^\/(.+)\/(\w+)?$/,new RegExp(r.map(function(e){var t=E(i.exec(e.toString()),3),n=t[1],r=t[2];return g()(!r,"RegExp flags are not supported. Change /".concat(n,"/").concat(r," into /").concat(n,"/")),"(".concat(n,")")}).join("|"),"g")),l=2,c=t.map(function(e){var t=e.markup,n=l;return l+=D(t)+1,n}),u=0,d=0;null!==(a=s.exec(e));){var h=c.find(function(e){return!!a[e]}),f=c.indexOf(h),p=t[f],m=p.markup,v=p.displayTransform,y=h+I(m,"id"),b=h+I(m,"display"),_=a[y],w=v(_,a[b]),S=e.substring(u,a.index);o(S,u,d),d+=S.length,n(a[0],a.index,d,_,w,f,u),d+=w.length,u=s.lastIndex}u3&&void 0!==arguments[3]?arguments[3]:"START";return"number"!=typeof n?n:(N(e,t,function(e,t,a,o,s,l,c){void 0===r&&a+s.length>n&&(r="NULL"===i?null:t+("END"===i?e.length:0))},function(e,t,i){void 0===r&&i+e.length>=n&&(r=t+n-i)}),void 0===r?e.length:r)},B=function(e,t,n,r){return e.substring(0,t)+r+e.substring(n)},U=function(e,t,n){var r=n,i=!1;if(N(e,t,function(e,t,a,o,s,l,c){a<=n&&a+s.length>n&&(r=a,i=!0)}),i)return r},z=function(e,t){var n=[];return N(e,t,function(e,t,r,i,a,o,s){n.push({id:i,display:a,childIndex:o,index:t,plainTextIndex:r})}),n},q=function(e,t){return"".concat(e,"-").concat(t)},V=function(e){return Object.values(e).reduce(function(e,t){return e+t.results.length},0)},H=function(e){var t=T(e),n=e[e.indexOf(O)+11],r=e[e.indexOf(R)+6];return new RegExp(t.replace(O,"([^".concat(T(n||""),"]+?)")).replace(R,"([^".concat(T(r||""),"]+?)")))},W=function(e){return p.Children.toArray(e).map(function(e){var t=e.props,n=t.markup,r=t.regex,i=t.displayTransform;return{markup:n,regex:r?G(r,n):H(n),displayTransform:i||function(e,t){return t||e}}})},G=function(e,t){var n=new RegExp(e.toString()+"|").exec("").length-1,r=D(t);return g()(n===r,"Number of capturing groups in RegExp ".concat(e.toString()," (").concat(n,") does not match the number of placeholders in the markup '").concat(t,"' (").concat(r,")")),e},$=[{base:"A",letters:/(A|Ⓐ|A|À|Á|Â|Ầ|Ấ|Ẫ|Ẩ|Ã|Ā|Ă|Ằ|Ắ|Ẵ|Ẳ|Ȧ|Ǡ|Ä|Ǟ|Ả|Å|Ǻ|Ǎ|Ȁ|Ȃ|Ạ|Ậ|Ặ|Ḁ|Ą|Ⱥ|Ɐ|[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F])/g},{base:"AA",letters:/(Ꜳ|[\uA732])/g},{base:"AE",letters:/(Æ|Ǽ|Ǣ|[\u00C6\u01FC\u01E2])/g},{base:"AO",letters:/(Ꜵ|[\uA734])/g},{base:"AU",letters:/(Ꜷ|[\uA736])/g},{base:"AV",letters:/(Ꜹ|Ꜻ|[\uA738\uA73A])/g},{base:"AY",letters:/(Ꜽ|[\uA73C])/g},{base:"B",letters:/(B|Ⓑ|B|Ḃ|Ḅ|Ḇ|Ƀ|Ƃ|Ɓ|[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181])/g},{base:"C",letters:/(C|Ⓒ|C|Ć|Ĉ|Ċ|Č|Ç|Ḉ|Ƈ|Ȼ|Ꜿ|[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E])/g},{base:"D",letters:/(D|Ⓓ|D|Ḋ|Ď|Ḍ|Ḑ|Ḓ|Ḏ|Đ|Ƌ|Ɗ|Ɖ|Ꝺ|Ð|[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779\u00D0])/g},{base:"DZ",letters:/(DZ|DŽ|[\u01F1\u01C4])/g},{base:"Dz",letters:/(Dz|Dž|[\u01F2\u01C5])/g},{base:"E",letters:/(E|Ⓔ|E|È|É|Ê|Ề|Ế|Ễ|Ể|Ẽ|Ē|Ḕ|Ḗ|Ĕ|Ė|Ë|Ẻ|Ě|Ȅ|Ȇ|Ẹ|Ệ|Ȩ|Ḝ|Ę|Ḙ|Ḛ|Ɛ|Ǝ|[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E])/g},{base:"F",letters:/(F|Ⓕ|F|Ḟ|Ƒ|Ꝼ|[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B])/g},{base:"G",letters:/(G|Ⓖ|G|Ǵ|Ĝ|Ḡ|Ğ|Ġ|Ǧ|Ģ|Ǥ|Ɠ|Ꞡ|Ᵹ|Ꝿ|[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E])/g},{base:"H",letters:/(H|Ⓗ|H|Ĥ|Ḣ|Ḧ|Ȟ|Ḥ|Ḩ|Ḫ|Ħ|Ⱨ|Ⱶ|Ɥ|[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D])/g},{base:"I",letters:/(I|Ⓘ|I|Ì|Í|Î|Ĩ|Ī|Ĭ|İ|Ï|Ḯ|Ỉ|Ǐ|Ȉ|Ȋ|Ị|Į|Ḭ|Ɨ|[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197])/g},{base:"J",letters:/(J|Ⓙ|J|Ĵ|Ɉ|[\u004A\u24BF\uFF2A\u0134\u0248])/g},{base:"K",letters:/(K|Ⓚ|K|Ḱ|Ǩ|Ḳ|Ķ|Ḵ|Ƙ|Ⱪ|Ꝁ|Ꝃ|Ꝅ|Ꞣ|[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2])/g},{base:"L",letters:/(L|Ⓛ|L|Ŀ|Ĺ|Ľ|Ḷ|Ḹ|Ļ|Ḽ|Ḻ|Ł|Ƚ|Ɫ|Ⱡ|Ꝉ|Ꝇ|Ꞁ|[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780])/g},{base:"LJ",letters:/(LJ|[\u01C7])/g},{base:"Lj",letters:/(Lj|[\u01C8])/g},{base:"M",letters:/(M|Ⓜ|M|Ḿ|Ṁ|Ṃ|Ɱ|Ɯ|[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C])/g},{base:"N",letters:/(N|Ⓝ|N|Ǹ|Ń|Ñ|Ṅ|Ň|Ṇ|Ņ|Ṋ|Ṉ|Ƞ|Ɲ|Ꞑ|Ꞥ|Ŋ|[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4\u014A])/g},{base:"NJ",letters:/(NJ|[\u01CA])/g},{base:"Nj",letters:/(Nj|[\u01CB])/g},{base:"O",letters:/(O|Ⓞ|O|Ò|Ó|Ô|Ồ|Ố|Ỗ|Ổ|Õ|Ṍ|Ȭ|Ṏ|Ō|Ṑ|Ṓ|Ŏ|Ȯ|Ȱ|Ö|Ȫ|Ỏ|Ő|Ǒ|Ȍ|Ȏ|Ơ|Ờ|Ớ|Ỡ|Ở|Ợ|Ọ|Ộ|Ǫ|Ǭ|Ø|Ǿ|Ɔ|Ɵ|Ꝋ|Ꝍ|[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C])/g},{base:"OE",letters:/(Œ|[\u0152])/g},{base:"OI",letters:/(Ƣ|[\u01A2])/g},{base:"OO",letters:/(Ꝏ|[\uA74E])/g},{base:"OU",letters:/(Ȣ|[\u0222])/g},{base:"P",letters:/(P|Ⓟ|P|Ṕ|Ṗ|Ƥ|Ᵽ|Ꝑ|Ꝓ|Ꝕ|[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754])/g},{base:"Q",letters:/(Q|Ⓠ|Q|Ꝗ|Ꝙ|Ɋ|[\u0051\u24C6\uFF31\uA756\uA758\u024A])/g},{base:"R",letters:/(R|Ⓡ|R|Ŕ|Ṙ|Ř|Ȑ|Ȓ|Ṛ|Ṝ|Ŗ|Ṟ|Ɍ|Ɽ|Ꝛ|Ꞧ|Ꞃ|[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782])/g},{base:"S",letters:/(S|Ⓢ|S|ẞ|Ś|Ṥ|Ŝ|Ṡ|Š|Ṧ|Ṣ|Ṩ|Ș|Ş|Ȿ|Ꞩ|Ꞅ|[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784])/g},{base:"T",letters:/(T|Ⓣ|T|Ṫ|Ť|Ṭ|Ț|Ţ|Ṱ|Ṯ|Ŧ|Ƭ|Ʈ|Ⱦ|Ꞇ|[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786])/g},{base:"TH",letters:/(Þ|[\u00DE])/g},{base:"TZ",letters:/(Ꜩ|[\uA728])/g},{base:"U",letters:/(U|Ⓤ|U|Ù|Ú|Û|Ũ|Ṹ|Ū|Ṻ|Ŭ|Ü|Ǜ|Ǘ|Ǖ|Ǚ|Ủ|Ů|Ű|Ǔ|Ȕ|Ȗ|Ư|Ừ|Ứ|Ữ|Ử|Ự|Ụ|Ṳ|Ų|Ṷ|Ṵ|Ʉ|[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244])/g},{base:"V",letters:/(V|Ⓥ|V|Ṽ|Ṿ|Ʋ|Ꝟ|Ʌ|[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245])/g},{base:"VY",letters:/(Ꝡ|[\uA760])/g},{base:"W",letters:/(W|Ⓦ|W|Ẁ|Ẃ|Ŵ|Ẇ|Ẅ|Ẉ|Ⱳ|[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72])/g},{base:"X",letters:/(X|Ⓧ|X|Ẋ|Ẍ|[\u0058\u24CD\uFF38\u1E8A\u1E8C])/g},{base:"Y",letters:/(Y|Ⓨ|Y|Ỳ|Ý|Ŷ|Ỹ|Ȳ|Ẏ|Ÿ|Ỷ|Ỵ|Ƴ|Ɏ|Ỿ|[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE])/g},{base:"Z",letters:/(Z|Ⓩ|Z|Ź|Ẑ|Ż|Ž|Ẓ|Ẕ|Ƶ|Ȥ|Ɀ|Ⱬ|Ꝣ|[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762])/g},{base:"a",letters:/(a|ⓐ|a|ẚ|à|á|â|ầ|ấ|ẫ|ẩ|ã|ā|ă|ằ|ắ|ẵ|ẳ|ȧ|ǡ|ä|ǟ|ả|å|ǻ|ǎ|ȁ|ȃ|ạ|ậ|ặ|ḁ|ą|ⱥ|ɐ|[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250])/g},{base:"aa",letters:/(ꜳ|[\uA733])/g},{base:"ae",letters:/(æ|ǽ|ǣ|[\u00E6\u01FD\u01E3])/g},{base:"ao",letters:/(ꜵ|[\uA735])/g},{base:"au",letters:/(ꜷ|[\uA737])/g},{base:"av",letters:/(ꜹ|ꜻ|[\uA739\uA73B])/g},{base:"ay",letters:/(ꜽ|[\uA73D])/g},{base:"b",letters:/(b|ⓑ|b|ḃ|ḅ|ḇ|ƀ|ƃ|ɓ|[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253])/g},{base:"c",letters:/(c|ⓒ|c|ć|ĉ|ċ|č|ç|ḉ|ƈ|ȼ|ꜿ|ↄ|[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184])/g},{base:"d",letters:/(d|ⓓ|d|ḋ|ď|ḍ|ḑ|ḓ|ḏ|đ|ƌ|ɖ|ɗ|ꝺ|ð|[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A\u00F0])/g},{base:"dz",letters:/(dz|dž|[\u01F3\u01C6])/g},{base:"e",letters:/(e|ⓔ|e|è|é|ê|ề|ế|ễ|ể|ẽ|ē|ḕ|ḗ|ĕ|ė|ë|ẻ|ě|ȅ|ȇ|ẹ|ệ|ȩ|ḝ|ę|ḙ|ḛ|ɇ|ɛ|ǝ|[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD])/g},{base:"f",letters:/(f|ⓕ|f|ḟ|ƒ|ꝼ|[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C])/g},{base:"g",letters:/(g|ⓖ|g|ǵ|ĝ|ḡ|ğ|ġ|ǧ|ģ|ǥ|ɠ|ꞡ|ᵹ|ꝿ|[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F])/g},{base:"h",letters:/(h|ⓗ|h|ĥ|ḣ|ḧ|ȟ|ḥ|ḩ|ḫ|ẖ|ħ|ⱨ|ⱶ|ɥ|[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265])/g},{base:"hv",letters:/(ƕ|[\u0195])/g},{base:"i",letters:/(i|ⓘ|i|ì|í|î|ĩ|ī|ĭ|ï|ḯ|ỉ|ǐ|ȉ|ȋ|ị|į|ḭ|ɨ|ı|[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131])/g},{base:"ij",letters:/(ij|[\u0133])/g},{base:"j",letters:/(j|ⓙ|j|ĵ|ǰ|ɉ|[\u006A\u24D9\uFF4A\u0135\u01F0\u0249])/g},{base:"k",letters:/(k|ⓚ|k|ḱ|ǩ|ḳ|ķ|ḵ|ƙ|ⱪ|ꝁ|ꝃ|ꝅ|ꞣ|[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3])/g},{base:"l",letters:/(l|ⓛ|l|ŀ|ĺ|ľ|ḷ|ḹ|ļ|ḽ|ḻ|ł|ƚ|ɫ|ⱡ|ꝉ|ꞁ|ꝇ|[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u0142\u019A\u026B\u2C61\uA749\uA781\uA747])/g},{base:"lj",letters:/(lj|[\u01C9])/g},{base:"m",letters:/(m|ⓜ|m|ḿ|ṁ|ṃ|ɱ|ɯ|[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F])/g},{base:"n",letters:/(n|ⓝ|n|ǹ|ń|ñ|ṅ|ň|ṇ|ņ|ṋ|ṉ|ƞ|ɲ|ʼn|ꞑ|ꞥ|ŋ|[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5\u014B])/g},{base:"nj",letters:/(nj|[\u01CC])/g},{base:"o",letters:/(o|ⓞ|o|ò|ó|ô|ồ|ố|ỗ|ổ|õ|ṍ|ȭ|ṏ|ō|ṑ|ṓ|ŏ|ȯ|ȱ|ö|ȫ|ỏ|ő|ǒ|ȍ|ȏ|ơ|ờ|ớ|ỡ|ở|ợ|ọ|ộ|ǫ|ǭ|ø|ǿ|ɔ|ꝋ|ꝍ|ɵ|[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275])/g},{base:"oe",letters:/(œ|[\u0153])/g},{base:"oi",letters:/(ƣ|[\u01A3])/g},{base:"ou",letters:/(ȣ|[\u0223])/g},{base:"oo",letters:/(ꝏ|[\uA74F])/g},{base:"p",letters:/(p|ⓟ|p|ṕ|ṗ|ƥ|ᵽ|ꝑ|ꝓ|ꝕ|[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755])/g},{base:"q",letters:/(q|ⓠ|q|ɋ|ꝗ|ꝙ|[\u0071\u24E0\uFF51\u024B\uA757\uA759])/g},{base:"r",letters:/(r|ⓡ|r|ŕ|ṙ|ř|ȑ|ȓ|ṛ|ṝ|ŗ|ṟ|ɍ|ɽ|ꝛ|ꞧ|ꞃ|[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783])/g},{base:"s",letters:/(s|ⓢ|s|ś|ṥ|ŝ|ṡ|š|ṧ|ṣ|ṩ|ș|ş|ȿ|ꞩ|ꞅ|ẛ|ſ|[\u0073\u24E2\uFF53\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B\u017F])/g},{base:"ss",letters:/(ß|[\u00DF])/g},{base:"t",letters:/(t|ⓣ|t|ṫ|ẗ|ť|ṭ|ț|ţ|ṱ|ṯ|ŧ|ƭ|ʈ|ⱦ|ꞇ|[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787])/g},{base:"th",letters:/(þ|[\u00FE])/g},{base:"tz",letters:/(ꜩ|[\uA729])/g},{base:"u",letters:/(u|ⓤ|u|ù|ú|û|ũ|ṹ|ū|ṻ|ŭ|ü|ǜ|ǘ|ǖ|ǚ|ủ|ů|ű|ǔ|ȕ|ȗ|ư|ừ|ứ|ữ|ử|ự|ụ|ṳ|ų|ṷ|ṵ|ʉ|[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289])/g},{base:"v",letters:/(v|ⓥ|v|ṽ|ṿ|ʋ|ꝟ|ʌ|[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C])/g},{base:"vy",letters:/(ꝡ|[\uA761])/g},{base:"w",letters:/(w|ⓦ|w|ẁ|ẃ|ŵ|ẇ|ẅ|ẘ|ẉ|ⱳ|[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73])/g},{base:"x",letters:/(x|ⓧ|x|ẋ|ẍ|[\u0078\u24E7\uFF58\u1E8B\u1E8D])/g},{base:"y",letters:/(y|ⓨ|y|ỳ|ý|ŷ|ỹ|ȳ|ẏ|ÿ|ỷ|ẙ|ỵ|ƴ|ɏ|ỿ|[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF])/g},{base:"z",letters:/(z|ⓩ|z|ź|ẑ|ż|ž|ẓ|ẕ|ƶ|ȥ|ɀ|ⱬ|ꝣ|[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763])/g}],Y=function(e){return function(e){var t=e;return $.forEach(function(e){t=t.replace(e.letters,e.base)}),t}(e).toLowerCase()},X=function(e,t,n){return n?Y(e).indexOf(Y(t)):e.toLowerCase().indexOf(t.toLowerCase())},K=function(e){return"number"==typeof e},Q=["style","className","classNames"];function J(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Z(e){for(var t=1;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(r,Q),c=t?t(l):void 0,u=w(e,{style:i,className:a,classNames:o},c);return p.createElement(n,s({},l,{style:u}))},i=n.displayName||n.name||"Component";return r.displayName="defaultStyle(".concat(i,")"),p.forwardRef(function(e,t){return r(Z(Z({},e),{},{ref:t}))})}}function te(e){var t=e.selectionStart,n=e.selectionEnd,r=e.value,i=void 0===r?"":r,a=e.onCaretPositionChange,o=e.containerRef,l=e.children,c=(e.singleLine,e.style),u=E((0,p.useState)({left:void 0,top:void 0}),2),d=u[0],h=u[1],f=E((0,p.useState)(),2),m=f[0],g=f[1];(0,p.useEffect)(function(){y()});var v,y=function(){if(m){var e=m.offsetLeft,t=m.offsetTop;if(d.left!==e||d.top!==t){var n={left:e,top:t};h(n),a(n)}}},b=W(l);n===t&&(v=j(i,b,t,"START"));var _=[],w={},S=_,C=0,k=function(e,t){return p.createElement("span",s({},c("substring"),{key:t}),e)};return N(i,b,function(e,t,n,r,i,a,o){var s=function(e,t){return e.hasOwnProperty(t)?e[t]++:e[t]=0,t+"_"+e[t]}(w,r);S.push(function(e,t,n,r){var i={id:e,display:t,key:r},a=p.Children.toArray(l)[n];return p.cloneElement(a,i)}(r,i,a,s))},function(e,t,n){if(K(v)&&v>=t&&v<=t+e.length){var r=v-t;S.push(k(e.substring(0,r),C)),S=[k(e.substring(r),C)]}else S.push(k(e,C));C++}),S.push(" "),S!==_&&_.push(function(e){return p.createElement("span",s({},c("caret"),{ref:g,key:"caret"}),e)}(S)),p.createElement("div",s({},c,{ref:o}),_)}te.propTypes={selectionStart:P().number,selectionEnd:P().number,value:P().string.isRequired,onCaretPositionChange:P().func.isRequired,containerRef:P().oneOfType([P().func,P().shape({current:"undefined"==typeof Element?P().any:P().instanceOf(Element)})]),children:P().oneOfType([P().element,P().arrayOf(P().element)]).isRequired};var ne=ee({position:"relative",boxSizing:"border-box",width:"100%",color:"transparent",overflow:"hidden",whiteSpace:"pre-wrap",wordWrap:"break-word",border:"1px solid transparent",textAlign:"start","&singleLine":{whiteSpace:"pre",wordWrap:null},substring:{visibility:"hidden"}},function(e){return{"&singleLine":e.singleLine}})(te);function re(e){var t,n,r=e.id,i=e.focused,a=e.ignoreAccents,o=e.index,l=e.onClick,c=e.onMouseEnter,u=e.query,d=e.renderSuggestion,h=e.suggestion,f=e.style,m=(e.className,e.classNames,{onClick:l,onMouseEnter:c});return p.createElement("li",s({id:r,role:"option","aria-selected":i},m,f),(t=function(){if("string"==typeof h)return h;var e=h.id,t=h.display;return void 0!==e&&t?t:e}(),n=function(e){var t=X(e,u,a);return-1===t?p.createElement("span",f("display"),e):p.createElement("span",f("display"),e.substring(0,t),p.createElement("b",f("highlight"),e.substring(t,t+u.length)),e.substring(t+u.length))}(t),d?d(h,u,n,o,i):n))}re.propTypes={id:P().string.isRequired,query:P().string.isRequired,index:P().number.isRequired,ignoreAccents:P().bool,suggestion:P().oneOfType([P().string,P().shape({id:P().oneOfType([P().string,P().number]).isRequired,display:P().string})]).isRequired,renderSuggestion:P().func,focused:P().bool};var ie=ee({cursor:"pointer"},function(e){return{"&focused":e.focused}})(re);function ae(e){var t=e.style,n=e.className,r=e.classNames,i=w(oe,{style:t,className:n,classNames:r}),a=i("spinner");return p.createElement("div",i,p.createElement("div",a,p.createElement("div",a(["element","element1"])),p.createElement("div",a(["element","element2"])),p.createElement("div",a(["element","element3"])),p.createElement("div",a(["element","element4"])),p.createElement("div",a(["element","element5"]))))}var oe={};function se(e){var t=e.id,n=e.suggestions,r=void 0===n?{}:n,i=e.a11ySuggestionsListLabel,a=e.focusIndex,l=e.position,c=e.left,u=e.right,d=e.top,h=e.scrollFocusedIntoView,f=e.isLoading,m=e.isOpened,g=e.onSelect,v=void 0===g?function(){return null}:g,y=e.ignoreAccents,b=e.containerRef,_=e.children,w=e.style,S=e.customSuggestionsContainer,C=e.onMouseDown,k=e.onMouseEnter,x=E((0,p.useState)(void 0),2),P=x[0],M=x[1];(0,p.useEffect)(function(){if(P&&!(P.offsetHeight>=P.scrollHeight)&&h){var e=P.scrollTop,t=P.children[a].getBoundingClientRect(),n=t.top,r=t.bottom,i=P.getBoundingClientRect().top;r=r-i+e,(n=n-i+e)P.offsetHeight&&(P.scrollTop=r-P.offsetHeight)}},[a,h,P]);var T,R=function(e,t){k&&k(e)},O=function(e,t){v(e,t)},I=function(e){return"string"==typeof e?e:e.id};return m?p.createElement("div",s({},function(){for(var e=arguments.length,t=new Array(e),n=0;n1?n-1:0),i=1;i1?n-1:0),i=1;id&&(c=l=d+(e.nativeEvent.data?e.nativeEvent.data.length:0),u=!0),t.setState({selectionStart:l,selectionEnd:c,setSelectionAfterMentionChange:u});var h=z(s,r);e.nativeEvent.isComposing&&l===c&&t.updateMentionsQueries(t.inputElement.value,l);var f={target:{value:s}};t.executeOnChange(f,s,i,h)}}),f((0,c.A)(t),"handleSelect",function(e){if(t.setState({selectionStart:e.target.selectionStart,selectionEnd:e.target.selectionEnd}),!he){var n=t.inputElement;e.target.selectionStart===e.target.selectionEnd?t.updateMentionsQueries(n.value,e.target.selectionStart):t.clearSuggestions(),t.updateHighlighterScroll(),t.props.onSelect(e)}}),f((0,c.A)(t),"handleKeyDown",function(e){if(0!==V(t.state.suggestions)&&t.suggestionsElement)switch(Object.values(de).indexOf(e.keyCode)>=0&&(e.preventDefault(),e.stopPropagation()),e.keyCode){case de.ESC:return void t.clearSuggestions();case de.DOWN:return void t.shiftFocus(1);case de.UP:return void t.shiftFocus(-1);case de.RETURN:case de.TAB:return void t.selectFocused();default:return}else t.props.onKeyDown(e)}),f((0,c.A)(t),"shiftFocus",function(e){var n=V(t.state.suggestions);t.setState({focusIndex:(n+t.state.focusIndex+e)%n,scrollFocusedIntoView:!0})}),f((0,c.A)(t),"selectFocused",function(){var e=t.state,n=e.suggestions,r=e.focusIndex,i=Object.values(n).reduce(function(e,t){var n=t.results,r=t.queryInfo;return[].concat(o(e),o(n.map(function(e){return{result:e,queryInfo:r}})))},[])[r],a=i.result,s=i.queryInfo;t.addMention(a,s),t.setState({focusIndex:0})}),f((0,c.A)(t),"handleBlur",function(e){var n=t._suggestionsMouseDown;t._suggestionsMouseDown=!1,n||t.setState({selectionStart:null,selectionEnd:null}),window.setTimeout(function(){t.updateHighlighterScroll()},1),t.props.onBlur(e,n)}),f((0,c.A)(t),"handleSuggestionsMouseDown",function(e){t._suggestionsMouseDown=!0}),f((0,c.A)(t),"handleSuggestionsMouseEnter",function(e){t.setState({focusIndex:e,scrollFocusedIntoView:!1})}),f((0,c.A)(t),"updateSuggestionsPosition",function(){var e=t.state.caretPosition,n=t.props,r=n.suggestionsPortalHost,i=n.allowSuggestionsAboveCursor,a=n.forceSuggestionsAboveCursor;if(e&&t.suggestionsElement){var o=t.suggestionsElement,s=t.highlighterElement,l=s.getBoundingClientRect(),c=me(s,"font-size"),u={left:l.left+e.left,top:l.top+e.top+c},d=Math.max(document.documentElement.clientHeight,window.innerHeight||0);if(o){var h={};if(r){h.position="fixed";var f=u.left,p=u.top;f-=me(o,"margin-left"),p-=me(o,"margin-top"),f-=s.scrollLeft,p-=s.scrollTop;var m=Math.max(document.documentElement.clientWidth,window.innerWidth||0);f+o.offsetWidth>m?h.left=Math.max(0,m-o.offsetWidth):h.left=f,i&&p+o.offsetHeight>d&&o.offsetHeightt.containerElement.offsetWidth?h.right=0:h.left=g,i&&u.top-s.scrollTop+o.offsetHeight>d&&o.offsetHeight1&&void 0!==arguments[1]?arguments[1]:{}).allowSpaceInQuery,n=T(e);return new RegExp("(?:^|\\s)(".concat(n,"([^").concat(t?"":"\\s").concat(n,"]*))$"))}(n.props.trigger,t.props),a=l.match(i);if(a){var o=s+l.indexOf(a[1],a.index);t.queryData(a[2],r,o,o+a[1].length,e)}}})}}),f((0,c.A)(t),"clearSuggestions",function(){t._queryId++,t.suggestions={},t.setState({suggestions:{},focusIndex:0})}),f((0,c.A)(t),"queryData",function(e,n,r,i,a){var o=t.props,s=o.children,l=o.ignoreAccents,c=function(e,t){return e instanceof Array?function(n,r){for(var i=[],a=0,o=e.length;a=0&&i.push(e[a])}return i}:e}(p.Children.toArray(s)[n].props.data,l),u=c(e,t.updateSuggestions.bind(null,t._queryId,n,e,r,i,a));u instanceof Array&&t.updateSuggestions(t._queryId,n,e,r,i,a,u)}),f((0,c.A)(t),"updateSuggestions",function(e,n,r,i,a,o,s){if(e===t._queryId){t.suggestions=ue(ue({},t.suggestions),{},f({},n,{queryInfo:{childIndex:n,query:r,querySequenceStart:i,querySequenceEnd:a,plainTextValue:o},results:s}));var l=t.state.focusIndex,c=V(t.suggestions);t.setState({suggestions:t.suggestions,focusIndex:l>=c?Math.max(c-1,0):l})}}),f((0,c.A)(t),"addMention",function(e,n){var r=e.id,i=e.display,a=n.childIndex,o=n.querySequenceStart,s=n.querySequenceEnd,l=n.plainTextValue,c=t.props.value||"",u=W(t.props.children),d=p.Children.toArray(t.props.children)[a].props,h=d.markup,f=d.displayTransform,m=d.appendSpaceOnAdd,g=d.onAdd,v=j(c,u,o,"START"),y=v+s-o,b=function(e,t,n){return e.replace(R,t).replace(O,n)}(h,r,i);m&&(b+=" ");var E=B(c,v,y,b);t.inputElement.focus();var _=f(r,i);m&&(_+=" ");var w=o+_.length;t.setState({selectionStart:w,selectionEnd:w,setSelectionAfterMentionChange:!0});var S={target:{value:E}},C=z(E,u),k=B(l,o,s,_);t.executeOnChange(S,E,k,C),g&&g(r,i,v,y),t.clearSuggestions()}),f((0,c.A)(t),"isLoading",function(){var e=!1;return p.Children.forEach(t.props.children,function(t){e=e||t&&t.props.isLoading}),e}),f((0,c.A)(t),"isOpened",function(){return K(t.state.selectionStart)&&(0!==V(t.state.suggestions)||t.isLoading())}),f((0,c.A)(t),"_queryId",0),t.suggestions={},t.uuidSuggestionsOverlay=Math.random().toString(16).substring(2),t.handleCopy=t.handleCopy.bind((0,c.A)(t)),t.handleCut=t.handleCut.bind((0,c.A)(t)),t.handlePaste=t.handlePaste.bind((0,c.A)(t)),t.state={focusIndex:0,selectionStart:null,selectionEnd:null,suggestions:{},caretPosition:null,suggestionsPosition:{},setSelectionAfterHandlePaste:!1},t}return t=m,(n=[{key:"componentDidMount",value:function(){document.addEventListener("copy",this.handleCopy),document.addEventListener("cut",this.handleCut),document.addEventListener("paste",this.handlePaste),this.updateSuggestionsPosition()}},{key:"componentDidUpdate",value:function(e,t){t.suggestionsPosition===this.state.suggestionsPosition&&this.updateSuggestionsPosition(),this.state.setSelectionAfterMentionChange&&(this.setState({setSelectionAfterMentionChange:!1}),this.setSelection(this.state.selectionStart,this.state.selectionEnd)),this.state.setSelectionAfterHandlePaste&&(this.setState({setSelectionAfterHandlePaste:!1}),this.setSelection(this.state.selectionStart,this.state.selectionEnd))}},{key:"componentWillUnmount",value:function(){document.removeEventListener("copy",this.handleCopy),document.removeEventListener("cut",this.handleCut),document.removeEventListener("paste",this.handlePaste)}},{key:"render",value:function(){return p.createElement("div",s({ref:this.setContainerElement},this.props.style),this.renderControl(),this.renderSuggestionsOverlay())}},{key:"handlePaste",value:function(e){if(e.target===this.inputElement&&this.supportsClipboardActions(e)){e.preventDefault();var t=this.state,n=t.selectionStart,r=t.selectionEnd,i=this.props,a=i.value,o=i.children,s=W(o),l=j(a,s,n,"START"),c=j(a,s,r,"END"),u=e.clipboardData.getData("text/react-mentions"),d=e.clipboardData.getData("text/plain"),h=B(a,l,c,u||d).replace(/\r/g,""),f=F(h,s),p={target:ue(ue({},e.target),{},{value:h})};this.executeOnChange(p,h,f,z(h,s));var m=(U(a,s,n)||n)+F(u||d,s).length;this.setState({selectionStart:m,selectionEnd:m,setSelectionAfterHandlePaste:!0})}}},{key:"saveSelectionToClipboard",value:function(e){var t=this.inputElement.selectionStart,n=this.inputElement.selectionEnd,r=this.props,i=r.children,a=r.value,o=W(i),s=j(a,o,t,"START"),l=j(a,o,n,"END");e.clipboardData.setData("text/plain",e.target.value.slice(t,n)),e.clipboardData.setData("text/react-mentions",a.slice(s,l))}},{key:"supportsClipboardActions",value:function(e){return!!e.clipboardData}},{key:"handleCopy",value:function(e){e.target===this.inputElement&&this.supportsClipboardActions(e)&&(e.preventDefault(),this.saveSelectionToClipboard(e))}},{key:"handleCut",value:function(e){if(e.target===this.inputElement&&this.supportsClipboardActions(e)){e.preventDefault(),this.saveSelectionToClipboard(e);var t=this.state,n=t.selectionStart,r=t.selectionEnd,i=this.props,a=i.children,o=i.value,s=W(a),l=j(o,s,n,"START"),c=j(o,s,r,"END"),u=[o.slice(0,l),o.slice(c)].join(""),d=F(u,s),h={target:ue(ue({},e.target),{},{value:d})};this.executeOnChange(h,u,d,z(o,s))}}}])&&l(t.prototype,n),m}(p.Component);f(pe,"propTypes",fe),f(pe,"defaultProps",{ignoreAccents:!1,singleLine:!1,allowSuggestionsAboveCursor:!1,onKeyDown:function(){return null},onSelect:function(){return null},onBlur:function(){return null}});var me=function(e,t){var n=parseFloat(window.getComputedStyle(e,null).getPropertyValue(t));return isFinite(n)?n:0},ge=ee({position:"relative",overflowY:"visible",input:{display:"block",width:"100%",position:"absolute",margin:0,top:0,left:0,boxSizing:"border-box",backgroundColor:"transparent",fontFamily:"inherit",fontSize:"inherit",letterSpacing:"inherit"},"&multiLine":{input:ue({height:"100%",bottom:0,overflow:"hidden",resize:"none"},"undefined"!=typeof navigator&&/iPhone|iPad|iPod/i.test(navigator.userAgent)?{marginTop:1,marginLeft:-3}:null)}},function(e){var t=e.singleLine;return{"&singleLine":t,"&multiLine":!t}})(pe),ve={fontWeight:"inherit"},ye=function(e){var t=e.display,n=e.style,r=e.className,i=e.classNames,a=w(ve,{style:n,className:r,classNames:i});return p.createElement("strong",a,t)};ye.propTypes={onAdd:P().func,onRemove:P().func,renderSuggestion:P().func,trigger:P().oneOfType([P().string,P().instanceOf(RegExp)]),markup:P().string,displayTransform:P().func,allowSpaceInQuery:P().bool,isLoading:P().bool},ye.defaultProps={trigger:"@",markup:"@[__display__](__id__)",displayTransform:function(e,t){return t||e},onAdd:function(){return null},onRemove:function(){return null},renderSuggestion:null,isLoading:!1,appendSpaceOnAdd:!1}},6653:function(e,t,n){"use strict";var r=n(7118),i=n(6308),a=n(9471),o=n(8474),s=n(8183),l=n(8558),c=n(3114),u=n(9281),d=n(7911),h=n(4581),f=n(1661),p=n(6830),m=n(8915),g=n(4301),v=function(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}(a),y=function(){return v.createElement(r.Icon,{size:16},v.createElement("path",{d:"M12,0.5c1.381,0,2.5,1.119,2.5,2.5S13.381,5.5,12,5.5S9.5,4.381,9.5,3S10.619,0.5,12,0.5z\n M12,9.5\n c1.381,0,2.5,1.119,2.5,2.5s-1.119,2.5-2.5,2.5S9.5,13.381,9.5,12S10.619,9.5,12,9.5z\n M12,18.5c1.381,0,2.5,1.119,2.5,2.5\n s-1.119,2.5-2.5,2.5S9.5,22.381,9.5,21S10.619,18.5,12,18.5z"}))},b={left:0,top:8},E=function(e){var t=e.toolbarSlot,n=v.useContext(r.LocalizationContext).l10n,a=v.useContext(r.ThemeContext).direction===r.TextDirection.RightToLeft?r.Position.BottomLeft:r.Position.BottomRight,o=t.DownloadMenuItem,s=t.EnterFullScreenMenuItem,l=t.GoToFirstPageMenuItem,c=t.GoToLastPageMenuItem,u=t.GoToNextPageMenuItem,d=t.GoToPreviousPageMenuItem,h=t.OpenMenuItem,f=t.PrintMenuItem,p=t.RotateBackwardMenuItem,m=t.RotateForwardMenuItem,g=t.ShowPropertiesMenuItem,E=t.SwitchScrollModeMenuItem,_=t.SwitchSelectionModeMenuItem,w=t.SwitchViewModeMenuItem,S=t.SwitchThemeMenuItem;return v.createElement(r.Popover,{ariaControlsSuffix:"toolbar-more-actions",ariaHasPopup:"menu",position:a,target:function(e,t){var i=n&&n.toolbar?n.toolbar.moreActions:"More actions";return v.createElement(r.Tooltip,{ariaControlsSuffix:"toolbar-more-actions",position:a,target:v.createElement(r.MinimalButton,{ariaLabel:i,isSelected:t,testId:"toolbar__more-actions-popover-target",onClick:e},v.createElement(y,null)),content:function(){return i},offset:b})},content:function(e){return v.createElement(r.Menu,null,v.createElement("div",{className:"rpv-core__display--block rpv-core__display--hidden-medium"},v.createElement(S,{onClick:e})),v.createElement("div",{className:"rpv-core__display--block rpv-core__display--hidden-medium"},v.createElement(s,{onClick:e})),v.createElement("div",{className:"rpv-core__display--block rpv-core__display--hidden-medium"},v.createElement(h,null)),v.createElement("div",{className:"rpv-core__display--block rpv-core__display--hidden-medium"},v.createElement(f,{onClick:e})),v.createElement("div",{className:"rpv-core__display--block rpv-core__display--hidden-medium"},v.createElement(o,{onClick:e})),v.createElement("div",{className:"rpv-core__display--block rpv-core__display--hidden-medium"},v.createElement(r.MenuDivider,null)),v.createElement(l,{onClick:e}),v.createElement("div",{className:"rpv-core__display--block rpv-core__display--hidden-medium"},v.createElement(d,{onClick:e})),v.createElement("div",{className:"rpv-core__display--block rpv-core__display--hidden-medium"},v.createElement(u,{onClick:e})),v.createElement(c,{onClick:e}),v.createElement(r.MenuDivider,null),v.createElement(m,{onClick:e}),v.createElement(p,{onClick:e}),v.createElement(r.MenuDivider,null),v.createElement(_,{mode:i.SelectionMode.Text,onClick:e}),v.createElement(_,{mode:i.SelectionMode.Hand,onClick:e}),v.createElement(r.MenuDivider,null),v.createElement(E,{mode:r.ScrollMode.Page,onClick:e}),v.createElement(E,{mode:r.ScrollMode.Vertical,onClick:e}),v.createElement(E,{mode:r.ScrollMode.Horizontal,onClick:e}),v.createElement(E,{mode:r.ScrollMode.Wrapped,onClick:e}),v.createElement(r.MenuDivider,null),v.createElement("div",{className:"rpv-core__display--hidden rpv-core__display--block-small"},v.createElement(w,{mode:r.ViewMode.SinglePage,onClick:e})),v.createElement("div",{className:"rpv-core__display--hidden rpv-core__display--block-small"},v.createElement(w,{mode:r.ViewMode.DualPage,onClick:e})),v.createElement("div",{className:"rpv-core__display--hidden rpv-core__display--block-small"},v.createElement(w,{mode:r.ViewMode.DualPageWithCover,onClick:e})),v.createElement("div",{className:"rpv-core__display--hidden rpv-core__display--block-small"},v.createElement(r.MenuDivider,null)),v.createElement(g,{onClick:e}))},offset:b,closeOnClickOutside:!0,closeOnEscape:!0})},_=function(){return _=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0&&(s("".concat(r+1)),h(r));break;case"ArrowDown":(n=u+1)d?s("".concat(u+1)):h(t-1)}var t,n,r}}))},d=function(e){var t=e.children,n=e.doc,a=r.useIsMounted(),o=i.useState({loading:!0,labels:[]}),s=o[0],l=o[1];return i.useEffect(function(){n.getPageLabels().then(function(e){a.current&&l({loading:!1,labels:e||[]})})},[n.loadingTask.docId]),s.loading?i.createElement(i.Fragment,null):t(s.labels)},h=function(e){var t=e.children,n=e.store,r=function(e){var t=i.useState(e.get("doc")),n=t[0],r=t[1],a=function(e){r(e)};return i.useEffect(function(){return e.subscribe("doc",a),function(){e.unsubscribe("doc",a)}},[]),n}(n),a=l(n).currentPage,o=c(n).numberOfPages,s=t||function(e){return i.createElement(i.Fragment,null,e.currentPage+1)};return r?i.createElement(d,{doc:r},function(e){var t=e.length===o&&o>0?e[a]:"";return s({currentPage:a,numberOfPages:o,pageLabel:t})}):i.createElement(i.Fragment,null)},f=function(){return i.createElement(r.Icon,{size:16},i.createElement("path",{d:"M21.783,21.034H2.332c-0.552,0-1-0.448-1-1c0-0.182,0.05-0.361,0.144-0.517L11.2,3.448\n c0.286-0.472,0.901-0.624,1.373-0.338c0.138,0.084,0.254,0.2,0.338,0.338l9.726,16.069c0.286,0.473,0.134,1.087-0.339,1.373\n C22.143,20.984,21.965,21.034,21.783,21.034z"}))},p={left:0,top:8},m=function(e){var t=e.isDisabled,n=e.onClick,a=i.useContext(r.LocalizationContext).l10n,o=a&&a.pageNavigation?a.pageNavigation.goToFirstPage:"First page";return i.createElement(r.Tooltip,{ariaControlsSuffix:"page-navigation-first",position:r.Position.BottomCenter,target:i.createElement(r.MinimalButton,{ariaLabel:o,isDisabled:t,testId:"page-navigation__first-button",onClick:n},i.createElement(f,null)),content:function(){return o},offset:p})},g=function(e){var t=e.children,n=e.store;return(t||function(e){return i.createElement(m,{isDisabled:e.isDisabled,onClick:e.onClick})})({isDisabled:0===l(n).currentPage,onClick:function(){var e=n.get("jumpToPage");e&&e(0)}})},v=function(e){var t=e.isDisabled,n=e.onClick,a=i.useContext(r.LocalizationContext).l10n,o=a&&a.pageNavigation?a.pageNavigation.goToFirstPage:"First page";return i.createElement(r.MenuItem,{icon:i.createElement(f,null),isDisabled:t,testId:"page-navigation__first-menu",onClick:n},o)},y={left:0,top:8},b=function(e){var t=e.isDisabled,n=e.onClick,o=i.useContext(r.LocalizationContext).l10n,s=o&&o.pageNavigation?o.pageNavigation.goToLastPage:"Last page";return i.createElement(r.Tooltip,{ariaControlsSuffix:"page-navigation-last",position:r.Position.BottomCenter,target:i.createElement(r.MinimalButton,{ariaLabel:s,isDisabled:t,testId:"page-navigation__last-button",onClick:n},i.createElement(a,null)),content:function(){return s},offset:y})},E=function(e){var t=e.children,n=e.store,r=l(n).currentPage,a=c(n).numberOfPages;return(t||function(e){return i.createElement(b,{isDisabled:e.isDisabled,onClick:e.onClick})})({isDisabled:r+1>=a,onClick:function(){var e=n.get("jumpToPage");e&&e(a-1)}})},_=function(e){var t=e.isDisabled,n=e.onClick,o=i.useContext(r.LocalizationContext).l10n,s=o&&o.pageNavigation?o.pageNavigation.goToLastPage:"Last page";return i.createElement(r.MenuItem,{icon:i.createElement(a,null),isDisabled:t,testId:"page-navigation__last-menu",onClick:n},s)},w={left:0,top:8},S=function(e){var t=e.isDisabled,n=e.onClick,a=i.useContext(r.LocalizationContext).l10n,s=a&&a.pageNavigation?a.pageNavigation.goToNextPage:"Next page";return i.createElement(r.Tooltip,{ariaControlsSuffix:"page-navigation-next",position:r.Position.BottomCenter,target:i.createElement(r.MinimalButton,{ariaLabel:s,isDisabled:t,testId:"page-navigation__next-button",onClick:n},i.createElement(o,null)),content:function(){return s},offset:w})},C=function(e){var t=e.children,n=e.store;return(t||function(e){return i.createElement(S,{onClick:e.onClick,isDisabled:e.isDisabled})})({isDisabled:l(n).currentPage+1>=c(n).numberOfPages,onClick:function(){var e=n.get("jumpToNextPage");e&&e()}})},k=function(e){var t=e.isDisabled,n=e.onClick,a=i.useContext(r.LocalizationContext).l10n,s=a&&a.pageNavigation?a.pageNavigation.goToNextPage:"Next page";return i.createElement(r.MenuItem,{icon:i.createElement(o,null),isDisabled:t,testId:"page-navigation__next-menu",onClick:n},s)},A=function(){return i.createElement(r.Icon,{size:16},i.createElement("path",{d:"M23.535,18.373L12.409,5.8c-0.183-0.207-0.499-0.226-0.706-0.043C11.688,5.77,11.674,5.785,11.66,5.8\n L0.535,18.373"}))},x={left:0,top:8},P=function(e){var t=e.isDisabled,n=e.onClick,a=i.useContext(r.LocalizationContext).l10n,o=a&&a.pageNavigation?a.pageNavigation.goToPreviousPage:"Previous page";return i.createElement(r.Tooltip,{ariaControlsSuffix:"page-navigation-previous",position:r.Position.BottomCenter,target:i.createElement(r.MinimalButton,{ariaLabel:o,isDisabled:t,testId:"page-navigation__previous-button",onClick:n},i.createElement(A,null)),content:function(){return o},offset:x})},M=function(e){var t=e.store;return(e.children||function(e){return i.createElement(P,{isDisabled:e.isDisabled,onClick:e.onClick})})({isDisabled:l(t).currentPage<=0,onClick:function(){var e=t.get("jumpToPreviousPage");e&&e()}})},T=function(e){var t=e.isDisabled,n=e.onClick,a=i.useContext(r.LocalizationContext).l10n,o=a&&a.pageNavigation?a.pageNavigation.goToPreviousPage:"Previous page";return i.createElement(r.MenuItem,{icon:i.createElement(A,null),isDisabled:t,testId:"page-navigation__previous-menu",onClick:n},o)},R=function(e){var t=e.children,n=e.store,r=c(n).numberOfPages;return t?t({numberOfPages:r}):i.createElement(i.Fragment,null,r)},O=function(e){var t=e.containerRef,n=e.numPages,a=e.store,o=l(a).currentPage,s=i.useRef(o);s.current=o;var c=i.useRef(!1),u=function(){c.current=!0},d=function(){c.current=!1},h=function(e){var i=t.current,o=c.current||document.activeElement&&i.contains(document.activeElement);if(i&&o){var l,u,d=e.altKey&&"ArrowDown"===e.key||!e.shiftKey&&!e.altKey&&"PageDown"===e.key,h=e.altKey&&"ArrowUp"===e.key||!e.shiftKey&&!e.altKey&&"PageUp"===e.key;if(d)return e.preventDefault(),l=a.get("jumpToPage"),u=s.current+1,void(l&&u=0&&e(t)}();if(r.isMac()?e.metaKey&&!e.ctrlKey:e.altKey)switch(e.key){case"ArrowLeft":e.preventDefault(),function(){var e=a.get("jumpToPreviousDestination");e&&e()}();break;case"ArrowRight":e.preventDefault(),function(){var e=a.get("jumpToNextDestination");e&&e()}()}}};return i.useEffect(function(){var e=t.current;if(e)return document.addEventListener("keydown",h),e.addEventListener("mouseenter",u),e.addEventListener("mouseleave",d),function(){document.removeEventListener("keydown",h),e.removeEventListener("mouseenter",u),e.removeEventListener("mouseleave",d)}},[t.current]),i.createElement(i.Fragment,null)};t.DownArrowIcon=a,t.NextIcon=o,t.PreviousIcon=A,t.UpArrowIcon=f,t.pageNavigationPlugin=function(e){var t=i.useMemo(function(){return Object.assign({},{enableShortcuts:!0},e)},[]),n=i.useMemo(function(){return r.createStore()},[]),a=function(e){return i.createElement(g,s({},e,{store:n}))},o=function(e){return i.createElement(E,s({},e,{store:n}))},l=function(e){return i.createElement(C,s({},e,{store:n}))},c=function(e){return i.createElement(M,s({},e,{store:n}))};return{install:function(e){n.update("jumpToDestination",e.jumpToDestination),n.update("jumpToNextDestination",e.jumpToNextDestination),n.update("jumpToNextPage",e.jumpToNextPage),n.update("jumpToPage",e.jumpToPage),n.update("jumpToPreviousDestination",e.jumpToPreviousDestination),n.update("jumpToPreviousPage",e.jumpToPreviousPage)},renderViewer:function(e){var r=e.slot;if(!t.enableShortcuts)return r;var a={children:i.createElement(i.Fragment,null,i.createElement(O,{containerRef:e.containerRef,numPages:e.doc.numPages,store:n}),r.children)};return s(s({},r),a)},onDocumentLoad:function(e){n.update("doc",e.doc),n.update("numberOfPages",e.doc.numPages)},onViewerStateChange:function(e){return n.update("currentPage",e.pageIndex),e},jumpToNextPage:function(){var e=n.get("jumpToNextPage");e&&e()},jumpToPage:function(e){var t=n.get("jumpToPage");t&&t(e)},jumpToPreviousPage:function(){var e=n.get("jumpToPreviousPage");e&&e()},CurrentPageInput:function(){return i.createElement(u,{store:n})},CurrentPageLabel:function(e){return i.createElement(h,s({},e,{store:n}))},GoToFirstPage:a,GoToFirstPageButton:function(){return i.createElement(a,null,function(e){return i.createElement(m,s({},e))})},GoToFirstPageMenuItem:function(e){return i.createElement(a,null,function(t){return i.createElement(v,{isDisabled:t.isDisabled,onClick:function(){t.onClick(),e.onClick()}})})},GoToLastPage:o,GoToLastPageButton:function(){return i.createElement(o,null,function(e){return i.createElement(b,s({},e))})},GoToLastPageMenuItem:function(e){return i.createElement(o,null,function(t){return i.createElement(_,{isDisabled:t.isDisabled,onClick:function(){t.onClick(),e.onClick()}})})},GoToNextPage:l,GoToNextPageButton:function(){return i.createElement(l,null,function(e){return i.createElement(S,s({},e))})},GoToNextPageMenuItem:function(e){return i.createElement(l,null,function(t){return i.createElement(k,{isDisabled:t.isDisabled,onClick:function(){t.onClick(),e.onClick()}})})},GoToPreviousPage:c,GoToPreviousPageButton:function(){return i.createElement(c,null,function(e){return i.createElement(P,s({},e))})},GoToPreviousPageMenuItem:function(e){return i.createElement(c,null,function(t){return i.createElement(T,{isDisabled:t.isDisabled,onClick:function(){t.onClick(),e.onClick()}})})},NumberOfPages:function(e){return i.createElement(R,s({},e,{store:n}))}}}},7067:function(e,t,n){"use strict";var r=n(3447),i=n(9867),a=n(2814)(),o=n(2673),s=n(3845),l=r("%Math.floor%");e.exports=function(e,t){if("function"!=typeof e)throw new s("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||l(t)!==t)throw new s("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],r=!0,c=!0;if("length"in e&&o){var u=o(e,"length");u&&!u.configurable&&(r=!1),u&&!u.writable&&(c=!1)}return(r||c||!n)&&(a?i(e,"length",t,!0,!0):i(e,"length",t)),e}},7118:function(e,t,n){"use strict";e.exports=n(8851)},7143:function(e,t,n){const r=n(2063).Dispatcher;e.exports=new r},7154:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(6077),t),i(n(4247),t),i(n(3337),t)},7171:function(e,t,n){"use strict";var r=n(7118),i=function(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}(n(9471)),a=function(){return i.createElement(r.Icon,{size:16},i.createElement("path",{d:"M12,1.001c6.075,0,11,4.925,11,11s-4.925,11-11,11s-11-4.925-11-11S5.925,1.001,12,1.001z\n M14.5,17.005H13\n c-0.552,0-1-0.448-1-1v-6.5c0-0.276-0.224-0.5-0.5-0.5H10\n M11.745,6.504L11.745,6.504\n M11.745,6.5c-0.138,0-0.25,0.112-0.25,0.25\n S11.607,7,11.745,7s0.25-0.112,0.25-0.25S11.883,6.5,11.745,6.5"}))},o=function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=t&&i<=n?i:r},d=function(e){var t=e.doc,n=e.fileName,a=e.onToggle,o=i.useContext(r.LocalizationContext).l10n,d=function(e){var t=function(e){var t=c.exec(e);if(!t)return null;var n=parseInt(t[1],10),r=u(t[2],1,12,1)-1,i=u(t[3],1,31,1),a=u(t[4],0,23,0),o=u(t[5],0,59,0),s=u(t[6],0,59,0),l=t[7]||"Z",d=u(t[8],0,23,0),h=u(t[9],0,59,0);switch(l){case"-":a+=d,o+=h;break;case"+":a-=d,o-=h}return new Date(Date.UTC(n,r,i,a,o,s))}(e);return t?"".concat(t.toLocaleDateString(),", ").concat(t.toLocaleTimeString()):""};return i.createElement("div",{className:"rpv-properties__modal"},i.createElement(s,{doc:t,render:function(e){return i.createElement(i.Fragment,null,i.createElement("div",{className:"rpv-properties__modal-section"},i.createElement(l,{label:o&&o.properties?o.properties.fileName:"File name",value:e.fileName||(c=n,u=c.split("/").pop(),u?u.split("#")[0].split("?")[0]:c)}),i.createElement(l,{label:o&&o.properties?o.properties.fileSize:"File size",value:(a=e.length,s=Math.floor(Math.log(a)/Math.log(1024)),"".concat((a/Math.pow(1024,s)).toFixed(2)," ").concat(["B","kB","MB","GB","TB"][s]))})),i.createElement(r.Separator,null),i.createElement("div",{className:"rpv-properties__modal-section"},i.createElement(l,{label:o&&o.properties?o.properties.title:"Title",value:e.info.Title}),i.createElement(l,{label:o&&o.properties?o.properties.author:"Author",value:e.info.Author}),i.createElement(l,{label:o&&o.properties?o.properties.subject:"Subject",value:e.info.Subject}),i.createElement(l,{label:o&&o.properties?o.properties.keywords:"Keywords",value:e.info.Keywords}),i.createElement(l,{label:o&&o.properties?o.properties.creator:"Creator",value:e.info.Creator}),i.createElement(l,{label:o&&o.properties?o.properties.creationDate:"Creation date",value:d(e.info.CreationDate)}),i.createElement(l,{label:o&&o.properties?o.properties.modificationDate:"Modification date",value:d(e.info.ModDate)})),i.createElement(r.Separator,null),i.createElement("div",{className:"rpv-properties__modal-section"},i.createElement(l,{label:o&&o.properties?o.properties.pdfProducer:"PDF producer",value:e.info.Producer}),i.createElement(l,{label:o&&o.properties?o.properties.pdfVersion:"PDF version",value:e.info.PDFFormatVersion}),i.createElement(l,{label:o&&o.properties?o.properties.pageCount:"Page count",value:"".concat(t.numPages)})));var a,s,c,u}}),i.createElement("div",{className:"rpv-properties__modal-footer"},i.createElement(r.Button,{onClick:a},o&&o.properties?o.properties.close:"Close")))},h={left:0,top:8},f=function(e){var t=e.onClick,n=i.useContext(r.LocalizationContext).l10n,o=n&&n.properties?n.properties.showProperties:"Show properties";return i.createElement(r.Tooltip,{ariaControlsSuffix:"properties",position:r.Position.BottomCenter,target:i.createElement(r.MinimalButton,{ariaLabel:o,testId:"properties__button",onClick:t},i.createElement(a,null)),content:function(){return o},offset:h})},p=function(e){var t=e.children,n=e.store,a=function(e){var t=i.useState(e.get("doc")),n=t[0],r=t[1],a=function(e){r(e)};return i.useEffect(function(){return e.subscribe("doc",a),function(){e.unsubscribe("doc",a)}},[]),{currentDoc:n}}(n).currentDoc,s=n.get("fileName")||"",l=t||function(e){return i.createElement(f,o({},e))};return a?i.createElement(r.Modal,{ariaControlsSuffix:"properties",target:function(e){return l({onClick:e})},content:function(e){return i.createElement(d,{doc:a,fileName:s,onToggle:e})},closeOnClickOutside:!0,closeOnEscape:!0}):i.createElement(i.Fragment,null)},m=function(e){var t=e.onClick,n=i.useContext(r.LocalizationContext).l10n,o=n&&n.properties?n.properties.showProperties:"Show properties";return i.createElement(r.MenuItem,{icon:i.createElement(a,null),testId:"properties__menu",onClick:t},o)};t.InfoIcon=a,t.propertiesPlugin=function(){var e=i.useMemo(function(){return r.createStore({fileName:""})},[]),t=function(t){return i.createElement(p,o({},t,{store:e}))};return{onDocumentLoad:function(t){e.update("doc",t.doc)},onViewerStateChange:function(t){return e.update("fileName",t.file.name),t},ShowProperties:t,ShowPropertiesButton:function(){return i.createElement(p,{store:e})},ShowPropertiesMenuItem:function(e){return i.createElement(t,null,function(e){return i.createElement(m,o({},e))})}}}},7190:function(e,t,n){"use strict";e.exports=n(4389)},7201:function(e,t,n){"use strict";n.d(t,{S:function(){return c}});var r=n(9471),i=n(8713),a=n.n(i),o=n(2828);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;tr.createElement(l,s({key:t},e)));return t.length?r.createElement("div",{className:"nav-menu"+(e.removeVerticalPadding?" pv0":"")},r.createElement("nav",null,r.createElement("ul",null,t))):null}l.propTypes={itemType:a().oneOf(["link","open-subpage","button","label","div"]),link:a().string,icon:a().string,iconPos:a().oneOf(["left","right"]),text:a().string,active:a().bool,divAttr:a().object,buttonAttr:a().object,itemAttr:a().object,linkAttr:a().object},l.defaultProps={itemType:"link",iconPos:"left",active:!1},c.propTypes={removeVerticalPadding:a().bool,items:a().arrayOf(a().shape(l.propTypes)).isRequired},c.defaultProps={removeVerticalPadding:!1}},7216:function(e){"use strict";e.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},7230:function(e,t,n){"use strict";var r=n(5697),i=n(9471),a=n(9383),o=n(9817);function s(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n