Files
validation-lab-site/node_modules/pdfjs-dist/legacy/build/pdf.renderer.min.mjs
T

24 lines
171 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* @licstart The following is the entire license notice for the
* JavaScript code in this page
*
* Copyright 2024 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* @licend The above is the entire license notice for the
* JavaScript code in this page
*/
/**
* pdfjsVersion = 6.5.438
* pdfjsBuild = 0a4153349
*/var t={463(t){var e=TypeError;t.exports=function(t){if("string"==typeof t)return t;throw new e("Argument is not a string")}},804(t){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=e+"+/",n=e+"-_",inverse=function(t){for(var e={},r=0;r<64;r++)e[t.charAt(r)]=r;return e};t.exports={i2c:r,c2i:inverse(r),i2cUrl:n,c2iUrl:inverse(n)}},529(t){t.exports=function(t,e){return{value:t,done:e}}},837(t){var e=TypeError;t.exports=function(t){if(t>9007199254740991)throw new e("Maximum allowed index exceeded");return t}},2(t){t.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},944(t){var e=TypeError;t.exports=function(t){var r=t&&t.alphabet;if(void 0===r||"base64"===r||"base64url"===r)return r||"base64";throw new e("Incorrect `alphabet` option")}},767(t){t.exports=function(t){return{iterator:t,next:t.next,done:!1}}},117(t){t.exports=function(t){return null==t}},859(t){t.exports=function(t){t.iterator=t.next=t.nextHandler=t.mapper=t.predicate=t.inner=t.iterables=t.iters=t.openIters=t.padding=t.finishResults=t.buffer=null}},684(t){t.exports=function(t,e){var r="function"==typeof Iterator&&Iterator.prototype[t];if(r)try{r.call({next:null},e).next()}catch(t){return!0}}},269(t){t.exports=Object.create?Object.create(null):{}},741(t){var e=Math.ceil,r=Math.floor;t.exports=Math.trunc||function trunc(t){var n=+t;return(n>0?r:e)(n)}},149(t){var e=RangeError;t.exports=function(t){if(t==t)return t;throw new e("NaN is not allowed")}},717(t,e){e.f=Object.getOwnPropertySymbols},103(t){t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},750(t,e,r){var n=r(117),a=TypeError;t.exports=function(t){if(n(t))throw new a("Can't call method on "+t);return t}},835(t){t.exports=function(t){try{var e=new Set,r={size:0,has:function(){return!0},keys:function(){return Object.defineProperty({},"next",{get:function(){e.clear();e.add(4);return function(){return{done:!0}}}})}},n=e[t](r);return 1===n.size&&4===n.values().next().value}catch(t){return!1}}},291(t,e,r){var n=r(741);t.exports=function(t){var e=+t;return e!=e||0===e?0:n(e)}},14(t,e,r){var n=r(291),a=Math.min;t.exports=function(t){var e=n(t);return e>0?a(e,9007199254740991):0}},981(t,e,r){var n=r(750),a=Object;t.exports=function(t){return a(n(t))}},590(t,e,r){var n=r(291),a=RangeError;t.exports=function(t){var e=n(t);if(e<0)throw new a("The argument can't be less than 0");return e}},812(t){var e=TypeError;t.exports=function(t,r){if(t<r)throw new e("Not enough arguments");return t}}};const e={};function __webpack_require__(r){const n=e[r];if(void 0!==n)return n.exports;const a=e[r]={exports:{}};t[r](a,a.exports,__webpack_require__);return a.exports}__webpack_require__.cw=t=>{var e;return()=>{if(t){var r=t;t=0;e={exports:{}};r.call(e.exports,e,e.exports)}return e.exports}};var r=__webpack_require__.cw(t=>{var e=dt(),r=be(),n=TypeError;t.exports=function(t){if(e(t))return t;throw new n(r(t)+" is not a function")}}),n=__webpack_require__.cw(t=>{var e=mt(),r=String,n=TypeError;t.exports=function(t){if(e(t))return t;throw new n("Can't set "+r(t)+" as a prototype")}}),a=__webpack_require__.cw(t=>{var e=Kt().has;t.exports=function(t){e(t);return t}}),a_string_namespaceFn=()=>__webpack_require__(463),s=__webpack_require__.cw(t=>{var e=Te(),r=new e.WeakMap,n=e.set,a=e.remove;t.exports=function(t){n(r,t,1);a(r,t);return t}}),i=__webpack_require__.cw(t=>{var e=Te().has;t.exports=function(t){e(t);return t}}),o=__webpack_require__.cw(t=>{var e=Me(),r=Pt(),n=Et().f,a=e("unscopables"),s=Array.prototype;void 0===s[a]&&n(s,a,{configurable:!0,value:r(null)});t.exports=function(t){s[a][t]=!0}}),c=__webpack_require__.cw(t=>{var e=jt(),r=TypeError;t.exports=function(t,n){if(e(n,t))return t;throw new r("Incorrect invocation")}}),l=__webpack_require__.cw(t=>{var e=gt(),r=String,n=TypeError;t.exports=function(t){if(void 0===t||e(t))return t;throw new n(r(t)+" is not an object or undefined")}}),h=__webpack_require__.cw(t=>{var e=gt(),r=String,n=TypeError;t.exports=function(t){if(e(t))return t;throw new n(r(t)+" is not an object")}}),u=__webpack_require__.cw(t=>{var e=w(),r=TypeError;t.exports=function(t){if("Uint8Array"===e(t))return t;throw new r("Argument is not an Uint8Array")}}),p=__webpack_require__.cw(t=>{t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView}),d=__webpack_require__.cw(t=>{var e=tt(),r=X(),n=v(),a=e.ArrayBuffer,s=e.TypeError;t.exports=a&&r(a.prototype,"byteLength","get")||function(t){if("ArrayBuffer"!==n(t))throw new s("ArrayBuffer expected");return t.byteLength}}),f=__webpack_require__.cw(t=>{var e=tt(),r=p(),n=d(),a=e.DataView;t.exports=function(t){if(!r||0!==n(t))return!1;try{new a(t);return!1}catch(t){return!0}}}),g=__webpack_require__.cw(t=>{var e=f(),r=TypeError;t.exports=function(t){if(e(t))throw new r("ArrayBuffer is detached");return t}}),m=__webpack_require__.cw(t=>{var e,r,n,a=p(),s=P(),i=tt(),o=dt(),c=gt(),l=et(),h=w(),u=be(),d=C(),f=O(),g=B(),m=jt(),_=Lt(),b=Wt(),x=Me(),y=xe(),v=lt(),k=v.enforce,S=v.get,T=i.Int8Array,M=T&&T.prototype,I=i.Uint8ClampedArray,A=I&&I.prototype,D=T&&_(T),E=M&&_(M),R=Object.prototype,N=i.TypeError,L=x("toStringTag"),j=y("TYPED_ARRAY_TAG"),q="TypedArrayConstructor",U=a&&!!b&&"Opera"!==h(i.opera),G=!1,W={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},z={BigInt64Array:8,BigUint64Array:8},getTypedArrayConstructor=function(t){var e=_(t);if(c(e)){var r=S(e);return r&&l(r,q)?r[q]:getTypedArrayConstructor(e)}},isTypedArray=function(t){if(!c(t))return!1;var e=h(t);return l(W,e)||l(z,e)};for(e in W)(n=(r=i[e])&&r.prototype)?k(n)[q]=r:U=!1;for(e in z)(n=(r=i[e])&&r.prototype)&&(k(n)[q]=r);if(!U||!o(D)||D===Function.prototype){D=function TypedArray(){throw new N("Incorrect invocation")};if(U)for(e in W)i[e]&&b(i[e],D)}if(!U||!E||E===R){E=D.prototype;if(U)for(e in W)i[e]&&b(i[e].prototype,E)}U&&_(A)!==E&&b(A,E);if(s&&!l(E,L)){G=!0;g(E,L,{configurable:!0,get:function(){return c(this)?this[j]:void 0}});for(e in W)i[e]&&d(i[e].prototype,j,e)}t.exports={NATIVE_ARRAY_BUFFER_VIEWS:U,TYPED_ARRAY_TAG:G&&j,aTypedArray:function(t){if(isTypedArray(t))return t;throw new N("Target is not a typed array")},aTypedArrayConstructor:function(t){if(o(t)&&(!b||m(D,t)))return t;throw new N(u(t)+" is not a typed array constructor")},exportTypedArrayMethod:function(t,e,r,n){if(s){if(r)for(var a in W){var o=i[a];if(o&&l(o.prototype,t))try{delete o.prototype[t]}catch(r){try{o.prototype[t]=e}catch(t){}}}E[t]&&!r||f(E,t,r?e:U&&M[t]||e,n)}},exportTypedArrayStaticMethod:function(t,e,r){var n,a;if(s){if(b){if(r)for(n in W)if((a=i[n])&&l(a,t))try{delete a[t]}catch(t){}if(D[t]&&!r)return;try{return f(D,t,r?e:U&&D[t]||e)}catch(t){}}for(n in W)!(a=i[n])||a[t]&&!r||f(a,t,e)}},getTypedArrayConstructor,isView:function isView(t){if(!c(t))return!1;var e=h(t);return"DataView"===e||l(W,e)||l(z,e)},isTypedArray,TypedArray:D,TypedArrayPrototype:E}}),_=__webpack_require__.cw(t=>{var e=de(),r=ue(),n=Mt(),createMethod=function(t){return function(a,s,i){var o=e(a),c=n(o);if(0===c)return!t&&-1;var l,h=r(i,c);if(t&&s!=s){for(;c>h;)if((l=o[h++])!=l)return!0}else for(;c>h;h++)if((t||h in o)&&o[h]===s)return t||h||0;return!t&&-1}};t.exports={includes:createMethod(!0),indexOf:createMethod(!1)}}),b=__webpack_require__.cw(t=>{var e=P(),r=ut(),n=TypeError,a=Object.getOwnPropertyDescriptor,s=e&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=s?function(t,e){if(r(t)&&!a(t,"length").writable)throw new n("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}}),x=__webpack_require__.cw(t=>{var e=Y();t.exports=e([].slice)}),base64_map_namespaceFn=()=>__webpack_require__(804),y=__webpack_require__.cw(t=>{var e=h(),r=kt();t.exports=function(t,n,a,s){try{return s?n(e(a)[0],a[1]):n(a)}catch(e){r(t,"throw",e)}}}),v=__webpack_require__.cw(t=>{var e=Y(),r=e({}.toString),n=e("".slice);t.exports=function(t){return n(r(t),8,-1)}}),w=__webpack_require__.cw(t=>{var e=me(),r=dt(),n=v(),a=Me()("toStringTag"),s=Object,i="Arguments"===n(function(){return arguments}());t.exports=e?n:function(t){var e,o,c;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(o=function(t,e){try{return t[e]}catch(t){}}(e=s(t),a))?o:i?n(e):"Object"===(c=n(e))&&r(e.callee)?"Arguments":c}}),k=__webpack_require__.cw(t=>{var e=et(),r=Ht(),n=Rt(),a=Et();t.exports=function(t,s,i){for(var o=r(s),c=a.f,l=n.f,h=0;h<o.length;h++){var u=o[h];e(t,u)||i&&e(i,u)||c(t,u,l(s,u))}}}),S=__webpack_require__.cw(t=>{var e=q();t.exports=!e(function(){function F(){}F.prototype.constructor=null;return Object.getPrototypeOf(new F)!==F.prototype})}),C=__webpack_require__.cw(t=>{var e=P(),r=Et(),n=T();t.exports=e?function(t,e,a){return r.f(t,e,n(1,a))}:function(t,e,r){t[e]=r;return t}}),T=__webpack_require__.cw(t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}}),M=__webpack_require__.cw(t=>{var e=P(),r=Et(),n=T();t.exports=function(t,a,s){e?r.f(t,a,n(0,s)):t[a]=s}}),B=__webpack_require__.cw(t=>{var e=Ft(),r=Et();t.exports=function(t,n,a){a.get&&e(a.get,n,{getter:!0});a.set&&e(a.set,n,{setter:!0});return r.f(t,n,a)}}),O=__webpack_require__.cw(t=>{var e=dt(),r=Et(),n=Ft(),a=A();t.exports=function(t,s,i,o){o||(o={});var c=o.enumerable,l=void 0!==o.name?o.name:s;e(i)&&n(i,l,o);if(o.global)c?t[s]=i:a(s,i);else{try{o.unsafe?t[s]&&(c=!0):delete t[s]}catch(t){}c?t[s]=i:r.f(t,s,{value:i,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return t}}),I=__webpack_require__.cw(t=>{var e=O();t.exports=function(t,r,n){for(var a in r)e(t,a,r[a],n);return t}}),A=__webpack_require__.cw(t=>{var e=tt(),r=Object.defineProperty;t.exports=function(t,n){try{r(e,t,{value:n,configurable:!0,writable:!0})}catch(r){e[t]=n}return n}}),P=__webpack_require__.cw(t=>{var e=q();t.exports=!e(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})}),D=__webpack_require__.cw(t=>{var e=tt(),r=gt(),n=e.document,a=r(n)&&r(n.createElement);t.exports=function(t){return a?n.createElement(t):{}}}),E=__webpack_require__.cw(t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]}),R=__webpack_require__.cw(t=>{var e=tt().navigator,r=e&&e.userAgent;t.exports=r?String(r):""}),N=__webpack_require__.cw(t=>{var e,r,n=tt(),a=R(),s=n.process,i=n.Deno,o=s&&s.versions||i&&i.version,c=o&&o.v8;c&&(r=(e=c.split("."))[0]>0&&e[0]<4?1:+(e[0]+e[1]));!r&&a&&(!(e=a.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=a.match(/Chrome\/(\d+)/))&&(r=+e[1]);t.exports=r}),L=__webpack_require__.cw(t=>{var e=Y(),r=Error,n=e("".replace),a=String(new r("zxcasd").stack),s=/\n\s*at [^:]*:[^\n]*/,i=s.test(a);t.exports=function(t,e){if(i&&"string"==typeof t&&!r.prepareStackTrace)for(;e--;)t=n(t,s,"");return t}}),j=__webpack_require__.cw(t=>{var e=tt(),r=Rt().f,n=C(),a=O(),s=A(),i=k(),o=ft();t.exports=function(t,c){var l,h,u,p,d,f=t.target,g=t.global,m=t.stat;if(l=g?e:m?e[f]||s(f,{}):e[f]&&e[f].prototype)for(h in c){p=c[h];u=t.dontCallGetSet?(d=r(l,h))&&d.value:l[h];if(!o(g?h:f+(m?".":"#")+h,t.forced)&&void 0!==u){if(typeof p==typeof u)continue;i(p,u)}(t.sham||u&&u.sham)&&n(p,"sham",!0);a(l,h,p,t)}}}),q=__webpack_require__.cw(t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}}),U=__webpack_require__.cw(t=>{var e=W(),r=Function.prototype,n=r.apply,a=r.call;t.exports="object"==typeof Reflect&&Reflect.apply||(e?a.bind(n):function(){return a.apply(n,arguments)})}),G=__webpack_require__.cw(t=>{var e=V(),n=r(),a=W(),s=e(e.bind);t.exports=function(t,e){n(t);return void 0===e?t:a?s(t,e):function(){return t.apply(e,arguments)}}}),W=__webpack_require__.cw(t=>{var e=q();t.exports=!e(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})}),z=__webpack_require__.cw(t=>{var e=W(),r=Function.prototype.call;t.exports=e?r.bind(r):function(){return r.apply(r,arguments)}}),H=__webpack_require__.cw(t=>{var e=P(),r=et(),n=Function.prototype,a=e&&Object.getOwnPropertyDescriptor,s=r(n,"name"),i=s&&(!e||e&&a(n,"name").configurable);t.exports={CONFIGURABLE:i}}),X=__webpack_require__.cw(t=>{var e=Y(),n=r();t.exports=function(t,r,a){try{return e(n(Object.getOwnPropertyDescriptor(t,r)[a]))}catch(t){}}}),V=__webpack_require__.cw(t=>{var e=v(),r=Y();t.exports=function(t){if("Function"===e(t))return r(t)}}),Y=__webpack_require__.cw(t=>{var e=W(),r=Function.prototype,n=r.call,a=e&&r.bind.bind(n,n);t.exports=e?a:function(t){return function(){return n.apply(t,arguments)}}}),get_alphabet_option_namespaceFn=()=>__webpack_require__(944),$=__webpack_require__.cw(t=>{var e=tt(),r=dt();t.exports=function(t,n){return arguments.length<2?(a=e[t],r(a)?a:void 0):e[t]&&e[t][n];var a}}),get_iterator_direct_namespaceFn=()=>__webpack_require__(767),K=__webpack_require__.cw(t=>{var e=z(),r=dt(),n=h(),a=be(),s=J(),i=TypeError;t.exports=function(t,o){var c=arguments.length<2?s(t):o;if(r(c))return n(e(c,t));throw new i(a(t)+" is not iterable")}}),J=__webpack_require__.cw(t=>{var e=v(),r=is_null_or_undefined_namespaceFn(),n=Z(),a=Me()("iterator"),s=Array.prototype;t.exports=function(t){if(!r(t))return n(t,a)||n(t,"@@iterator")||("Arguments"===e(t)?s[a]:void 0)}}),Z=__webpack_require__.cw(t=>{var e=r(),n=is_null_or_undefined_namespaceFn();t.exports=function(t,r){var a=t[r];return n(a)?void 0:e(a)}}),Q=__webpack_require__.cw(t=>{var e=r(),n=h(),a=z(),s=to_integer_or_infinity_namespaceFn(),i=get_iterator_direct_namespaceFn(),o="Invalid size",c=RangeError,l=TypeError,u=Math.max,SetRecord=function(t,r){this.set=t;this.size=u(r,0);this.has=e(t.has);this.keys=e(t.keys)};SetRecord.prototype={getIterator:function(){return i(n(a(this.keys,this.set)))},includes:function(t){return a(this.has,this.set,t)}};t.exports=function(t){n(t);var e=+t.size;if(e!=e)throw new l(o);var r=s(e);if(r<0)throw new c(o);return new SetRecord(t,r)}}),tt=__webpack_require__.cw(function(t){var check=function(t){return t&&t.Math===Math&&t};t.exports=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof global&&global)||check("object"==typeof this&&this)||function(){return this}()||Function("return this")()}),et=__webpack_require__.cw(t=>{var e=Y(),r=to_object_namespaceFn(),n=e({}.hasOwnProperty);t.exports=Object.hasOwn||function hasOwn(t,e){return n(r(t),e)}}),rt=__webpack_require__.cw(t=>{t.exports={}}),nt=__webpack_require__.cw(t=>{var e=$();t.exports=e("document","documentElement")}),st=__webpack_require__.cw(t=>{var e=P(),r=q(),n=D();t.exports=!e&&!r(function(){return 7!==Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a})}),it=__webpack_require__.cw(t=>{var e=Y(),r=q(),n=v(),a=Object,s=e("".split);t.exports=r(function(){return!a("z").propertyIsEnumerable(0)})?function(t){return"String"===n(t)?s(t,""):a(t)}:a}),ot=__webpack_require__.cw(t=>{var e=dt(),r=gt(),n=Wt();t.exports=function(t,a,s){var i,o;n&&e(i=a.constructor)&&i!==s&&r(o=i.prototype)&&o!==s.prototype&&n(t,o);return t}}),ct=__webpack_require__.cw(t=>{var e=Y(),r=dt(),n=oe(),a=e(Function.toString);r(n.inspectSource)||(n.inspectSource=function(t){return a(t)});t.exports=n.inspectSource}),lt=__webpack_require__.cw(t=>{var e,r,n,a=Ce(),s=tt(),i=gt(),o=C(),c=et(),l=oe(),h=ie(),u=rt(),p="Object already initialized",d=s.TypeError,f=s.WeakMap;if(a||l.state){var g=l.state||(l.state=new f);g.get=g.get;g.has=g.has;g.set=g.set;e=function(t,e){if(g.has(t))throw new d(p);e.facade=t;g.set(t,e);return e};r=function(t){return g.get(t)||{}};n=function(t){return g.has(t)}}else{var m=h("state");u[m]=!0;e=function(t,e){if(c(t,m))throw new d(p);e.facade=t;o(t,m,e);return e};r=function(t){return c(t,m)?t[m]:{}};n=function(t){return c(t,m)}}t.exports={set:e,get:r,has:n,enforce:function(t){return n(t)?r(t):e(t,{})},getterFor:function(t){return function(e){var n;if(!i(e)||(n=r(e)).type!==t)throw new d("Incompatible receiver, "+t+" required");return n}}}}),ht=__webpack_require__.cw(t=>{var e=Me(),r=iterators_namespaceFn(),n=e("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||a[n]===t)}}),ut=__webpack_require__.cw(t=>{var e=v();t.exports=Array.isArray||function isArray(t){return"Array"===e(t)}}),pt=__webpack_require__.cw(t=>{var e=w();t.exports=function(t){var r=e(t);return"BigInt64Array"===r||"BigUint64Array"===r}}),dt=__webpack_require__.cw(t=>{var e="object"==typeof document&&document.all;t.exports=void 0===e&&void 0!==e?function(t){return"function"==typeof t||t===e}:function(t){return"function"==typeof t}}),ft=__webpack_require__.cw(t=>{var e=q(),r=dt(),n=/#|\.prototype\./,isForced=function(t,n){var c=s[a(t)];return c===o||c!==i&&(r(n)?e(n):!!n)},a=isForced.normalize=function(t){return String(t).replace(n,".").toLowerCase()},s=isForced.data={},i=isForced.NATIVE="N",o=isForced.POLYFILL="P";t.exports=isForced}),is_null_or_undefined_namespaceFn=()=>__webpack_require__(117),gt=__webpack_require__.cw(t=>{var e=dt();t.exports=function(t){return"object"==typeof t?null!==t:e(t)}}),mt=__webpack_require__.cw(t=>{var e=gt();t.exports=function(t){return e(t)||null===t}}),_t=__webpack_require__.cw(t=>{t.exports=!1}),bt=__webpack_require__.cw(t=>{var e=gt(),r=lt().get;t.exports=function isRawJSON(t){if(!e(t))return!1;var n=r(t);return!!n&&"RawJSON"===n.type}}),xt=__webpack_require__.cw(t=>{var e=$(),r=dt(),n=jt(),a=ke(),s=Object;t.exports=a?function(t){return"symbol"==typeof t}:function(t){var a=e("Symbol");return r(a)&&n(a.prototype,s(t))}}),yt=__webpack_require__.cw(t=>{var e=z();t.exports=function(t,r,n){for(var a,s,i=n?t:t.iterator,o=t.next;!(a=e(o,i)).done;)if(void 0!==(s=r(a.value)))return s}}),vt=__webpack_require__.cw(t=>{var e=G(),r=z(),n=h(),a=be(),s=ht(),i=Mt(),o=jt(),c=K(),l=J(),u=kt(),p=TypeError,Result=function(t,e){this.stopped=t;this.result=e},d=Result.prototype;t.exports=function(t,h,f){var g,m,_,b,x,y,v,w=f&&f.that,k=!(!f||!f.AS_ENTRIES),S=!(!f||!f.IS_RECORD),C=!(!f||!f.IS_ITERATOR),T=!(!f||!f.INTERRUPTED),M=e(h,w),stop=function(t){var e=g;g=void 0;e&&u(e,"normal");return new Result(!0,t)},callFn=function(t){if(k){n(t);return T?M(t[0],t[1],stop):M(t[0],t[1])}return T?M(t,stop):M(t)};if(S)g=t.iterator;else if(C)g=t;else{if(!(m=l(t)))throw new p(a(t)+" is not iterable");if(s(m)){for(_=0,b=i(t);b>_;_++)if((x=callFn(t[_]))&&o(d,x))return x;return new Result(!1)}g=c(t,m)}y=S?t.next:g.next;for(;!(v=r(y,g)).done;){var B=v.value;try{x=callFn(B)}catch(t){if(!g)throw t;u(g,"throw",t)}if("object"==typeof x&&x&&o(d,x))return x}return new Result(!1)}}),wt=__webpack_require__.cw(t=>{var e=kt();t.exports=function(t,r,n){for(var a=t.length-1;a>=0;a--)if(void 0!==t[a])try{n=e(t[a].iterator,r,n)}catch(t){r="throw";n=t}if("throw"===r)throw n;return n}}),kt=__webpack_require__.cw(t=>{var e=z(),r=h(),n=Z();t.exports=function(t,a,s){var i,o;r(t);try{if(!(i=n(t,"return"))){if("throw"===a)throw s;return s}i=e(i,t)}catch(t){o=!0;i=t}if("throw"===a)throw s;if(o)throw i;r(i);return s}}),St=__webpack_require__.cw(t=>{var e=z(),r=Pt(),n=C(),a=I(),s=Me(),i=lt(),o=Z(),c=Tt().IteratorPrototype,l=__webpack_require__(529),h=kt(),u=wt(),p=__webpack_require__(859),d=s("toStringTag"),f="IteratorHelper",g="WrapForValidIterator",m="normal",_="throw",b=i.set,createIteratorProxyPrototype=function(t){var n=i.getterFor(t?g:f);return a(r(c),{next:function next(){var e=n(this);if(t)return e.nextHandler();if(e.done)return l(void 0,!0);try{var r=e.nextHandler();e.done&&p(e);return e.returnHandlerResult?r:l(r,e.done)}catch(t){e.done=!0;p(e);throw t}},return:function(){var r=n(this),a=r.iterator,s=r.inner,i=r.openIters,c=r.done;r.done=!0;if(t){var d=o(a,"return");return d?e(d,a):l(void 0,!0)}p(r);if(c)return l(void 0,!0);if(s)try{h(s.iterator,m)}catch(t){return h(a,_,t)}if(i)try{u(i,m)}catch(t){if(a)return h(a,_,t);throw t}a&&h(a,m);return l(void 0,!0)}})},x=createIteratorProxyPrototype(!0),y=createIteratorProxyPrototype(!1);n(y,d,"Iterator Helper");t.exports=function(t,e,r){var n=function Iterator(n,a){if(a){a.iterator=n.iterator;a.next=n.next}else a=n;a.type=e?g:f;a.returnHandlerResult=!!r;a.nextHandler=t;a.counter=0;a.done=!1;b(this,a)};n.prototype=e?x:y;return n}}),iterator_helper_throws_on_invalid_iterator_namespaceFn=()=>__webpack_require__(684),Ct=__webpack_require__.cw(t=>{var e=tt();t.exports=function(t,r){var n=e.Iterator,a=n&&n.prototype,s=a&&a[t],i=!1;if(s)try{s.call({next:function(){return{done:!0}},return:function(){i=!0}},-1)}catch(t){t instanceof r||(i=!1)}if(!i)return s}}),Tt=__webpack_require__.cw(t=>{var e,r,n,a=q(),s=dt(),i=gt(),o=Pt(),c=Lt(),l=O(),h=Me(),u=_t(),p=h("iterator");[].keys&&("next"in(n=[].keys())?(r=c(c(n)))!==Object.prototype&&(e=r):!0);!i(e)||a(function(){var t={};return e[p].call(t)!==t})?e={}:u&&(e=o(e));s(e[p])||l(e,p,function(){return this});t.exports={IteratorPrototype:e}}),iterators_namespaceFn=()=>__webpack_require__(269),Mt=__webpack_require__.cw(t=>{var e=to_length_namespaceFn();t.exports=function(t){return e(t.length)}}),Ft=__webpack_require__.cw(t=>{var e=Y(),r=q(),n=dt(),a=et(),s=P(),i=H().CONFIGURABLE,o=ct(),c=lt(),l=c.enforce,h=c.get,u=String,p=Object.defineProperty,d=e("".slice),f=e("".replace),g=e([].join),m=s&&!r(function(){return 8!==p(function(){},"length",{value:8}).length}),_=String(String).split("String"),b=t.exports=function(t,e,r){"Symbol("===d(u(e),0,7)&&(e="["+f(u(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]");r&&r.getter&&(e="get "+e);r&&r.setter&&(e="set "+e);(!a(t,"name")||i&&t.name!==e)&&(s?p(t,"name",{value:e,configurable:!0}):t.name=e);m&&r&&a(r,"arity")&&t.length!==r.arity&&p(t,"length",{value:r.arity});try{r&&a(r,"constructor")&&r.constructor?s&&p(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n=l(t);a(n,"source")||(n.source=g(_,"string"==typeof e?e:""));return t};Function.prototype.toString=b(function toString(){return n(this)&&h(this).source||o(this)},"toString")}),Bt=__webpack_require__.cw(t=>{var e=Y(),r=Map.prototype;t.exports={Map,set:e(r.set),get:e(r.get),has:e(r.has),remove:e(r.delete),proto:r}}),Ot=__webpack_require__.cw(t=>{var e=q();t.exports=!e(function(){var t="9007199254740993",e=JSON.rawJSON(t);return!JSON.isRawJSON(e)||JSON.stringify(e)!==t})}),It=__webpack_require__.cw(t=>{var e=r(),n=TypeError,PromiseCapability=function(t){var r,a;this.promise=new t(function(t,e){if(void 0!==r||void 0!==a)throw new n("Bad Promise constructor");r=t;a=e});this.resolve=e(r);this.reject=e(a)};t.exports.f=function(t){return new PromiseCapability(t)}}),At=__webpack_require__.cw(t=>{var e=_e();t.exports=function(t,r){return void 0===t?arguments.length<2?"":r:e(t)}}),Pt=__webpack_require__.cw(t=>{var e,r=h(),n=Dt(),a=E(),s=rt(),i=nt(),o=D(),c=ie(),l="prototype",u="script",p=c("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(t){return"<"+u+">"+t+"</"+u+">"},NullProtoObjectViaActiveX=function(t){t.write(scriptTag(""));t.close();var e=t.parentWindow.Object;t=null;return e},NullProtoObject=function(){try{e=new ActiveXObject("htmlfile")}catch(t){}NullProtoObject="undefined"!=typeof document?document.domain&&e?NullProtoObjectViaActiveX(e):function(){var t,e=o("iframe"),r="java"+u+":";e.style.display="none";i.appendChild(e);e.src=String(r);(t=e.contentWindow.document).open();t.write(scriptTag("document.F=Object"));t.close();return t.F}():NullProtoObjectViaActiveX(e);for(var t=a.length;t--;)delete NullProtoObject[l][a[t]];return NullProtoObject()};s[p]=!0;t.exports=Object.create||function create(t,e){var a;if(null!==t){EmptyConstructor[l]=r(t);a=new EmptyConstructor;EmptyConstructor[l]=null;a[p]=t}else a=NullProtoObject();return void 0===e?a:n.f(a,e)}}),Dt=__webpack_require__.cw((t,e)=>{var r=P(),n=Se(),a=Et(),s=h(),i=de(),o=Ut();e.f=r&&!n?Object.defineProperties:function defineProperties(t,e){s(t);for(var r,n=i(e),c=o(e),l=c.length,h=0;l>h;)a.f(t,r=c[h++],n[r]);return t}}),Et=__webpack_require__.cw((t,e)=>{var r=P(),n=st(),a=Se(),s=h(),i=ge(),o=TypeError,c=Object.defineProperty,l=Object.getOwnPropertyDescriptor,u="enumerable",p="configurable",d="writable";e.f=r?a?function defineProperty(t,e,r){s(t);e=i(e);s(r);if("function"==typeof t&&"prototype"===e&&"value"in r&&d in r&&!r[d]){var n=l(t,e);if(n&&n[d]){t[e]=r.value;r={configurable:p in r?r[p]:n[p],enumerable:u in r?r[u]:n[u],writable:!1}}}return c(t,e,r)}:c:function defineProperty(t,e,r){s(t);e=i(e);s(r);if(n)try{return c(t,e,r)}catch(t){}if("get"in r||"set"in r)throw new o("Accessors not supported");"value"in r&&(t[e]=r.value);return t}}),Rt=__webpack_require__.cw((t,e)=>{var r=P(),n=z(),a=Gt(),s=T(),i=de(),o=ge(),c=et(),l=st(),h=Object.getOwnPropertyDescriptor;e.f=r?h:function getOwnPropertyDescriptor(t,e){t=i(t);e=o(e);if(l)try{return h(t,e)}catch(t){}if(c(t,e))return s(!n(a.f,t,e),t[e])}}),Nt=__webpack_require__.cw((t,e)=>{var r=qt(),n=E().concat("length","prototype");e.f=Object.getOwnPropertyNames||function getOwnPropertyNames(t){return r(t,n)}}),Lt=__webpack_require__.cw(t=>{var e=et(),r=dt(),n=to_object_namespaceFn(),a=ie(),s=S(),i=a("IE_PROTO"),o=Object,c=o.prototype;t.exports=s?o.getPrototypeOf:function(t){var a=n(t);if(e(a,i))return a[i];var s=a.constructor;return r(s)&&a instanceof s?s.prototype:a instanceof o?c:null}}),jt=__webpack_require__.cw(t=>{var e=Y();t.exports=e({}.isPrototypeOf)}),qt=__webpack_require__.cw(t=>{var e=Y(),r=et(),n=de(),a=_().indexOf,s=rt(),i=e([].push);t.exports=function(t,e){var o,c=n(t),l=0,h=[];for(o in c)!r(s,o)&&r(c,o)&&i(h,o);for(;e.length>l;)r(c,o=e[l++])&&(~a(h,o)||i(h,o));return h}}),Ut=__webpack_require__.cw(t=>{var e=qt(),r=E();t.exports=Object.keys||function keys(t){return e(t,r)}}),Gt=__webpack_require__.cw((t,e)=>{var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,a=n&&!r.call({1:2},1);e.f=a?function propertyIsEnumerable(t){var e=n(this,t);return!!e&&e.enumerable}:r}),Wt=__webpack_require__.cw(t=>{var e=X(),r=gt(),a=require_object_coercible_namespaceFn(),s=n();t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,n=!1,i={};try{(t=e(Object.prototype,"__proto__","set"))(i,[]);n=i instanceof Array}catch(t){}return function setPrototypeOf(e,i){a(e);s(i);if(!r(e))return e;n?t(e,i):e.__proto__=i;return e}}():void 0)}),zt=__webpack_require__.cw(t=>{var e=z(),r=dt(),n=gt(),a=TypeError;t.exports=function(t,s){var i,o;if("string"===s&&r(i=t.toString)&&!n(o=e(i,t)))return o;if(r(i=t.valueOf)&&!n(o=e(i,t)))return o;if("string"!==s&&r(i=t.toString)&&!n(o=e(i,t)))return o;throw new a("Can't convert object to primitive value")}}),Ht=__webpack_require__.cw(t=>{var e=$(),r=Y(),n=Nt(),a=__webpack_require__(717),s=h(),i=r([].concat);t.exports=e("Reflect","ownKeys")||function ownKeys(t){var e=n.f(s(t)),r=a.f;return r?i(e,r(t)):e}}),Xt=__webpack_require__.cw(t=>{var e=Y(),r=et(),n=SyntaxError,a=parseInt,s=String.fromCharCode,i=e("".charAt),o=e("".slice),c=e(/./.exec),l={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":"\t"},h=/^[\da-f]{4}$/i,u=/^[\u0000-\u001F]$/;t.exports=function(t,e){for(var p=!0,d="";e<t.length;){var f=i(t,e);if("\\"===f){var g=o(t,e,e+2);if(r(l,g)){d+=l[g];e+=2}else{if("\\u"!==g)throw new n('Unknown escape sequence: "'+g+'"');var m=o(t,e+=2,e+4);if(!c(h,m))throw new n("Bad Unicode escape at: "+e);d+=s(a(m,16));e+=4}}else{if('"'===f){p=!1;e++;break}if(c(u,f))throw new n("Bad control character in string literal at: "+e);d+=f;e++}}if(p)throw new n("Unterminated string at: "+e);return{value:d,end:e}}}),Vt=__webpack_require__.cw(t=>{var e=h(),r=gt(),n=It();t.exports=function(t,a){e(t);if(r(a)&&a.constructor===t)return a;var s=n.f(t);(0,s.resolve)(a);return s.promise}}),require_object_coercible_namespaceFn=()=>__webpack_require__(750),Yt=__webpack_require__.cw(t=>{var e=Kt(),r=ee(),n=e.Set,a=e.add;t.exports=function(t){var e=new n;r(t,function(t){a(e,t)});return e}}),$t=__webpack_require__.cw(t=>{var e=a(),r=Kt(),n=Yt(),s=ne(),i=Q(),o=ee(),c=yt(),l=r.has,h=r.remove;t.exports=function difference(t){var r=e(this),a=i(t),u=n(r);s(u)<=a.size?o(u,function(t){a.includes(t)&&h(u,t)}):c(a.getIterator(),function(t){l(u,t)&&h(u,t)});return u}}),Kt=__webpack_require__.cw(t=>{var e=Y(),r=Set.prototype;t.exports={Set,add:e(r.add),has:e(r.has),remove:e(r.delete),proto:r}}),Jt=__webpack_require__.cw(t=>{var e=a(),r=Kt(),n=ne(),s=Q(),i=ee(),o=yt(),c=r.Set,l=r.add,h=r.has;t.exports=function intersection(t){var r=e(this),a=s(t),u=new c;n(r)>a.size?o(a.getIterator(),function(t){h(r,t)&&l(u,t)}):i(r,function(t){a.includes(t)&&l(u,t)});return u}}),Zt=__webpack_require__.cw(t=>{var e=a(),r=Kt().has,n=ne(),s=Q(),i=ee(),o=yt(),c=kt();t.exports=function isDisjointFrom(t){var a=e(this),l=s(t);if(n(a)<=l.size)return!1!==i(a,function(t){if(l.includes(t))return!1},!0);var h=l.getIterator();return!1!==o(h,function(t){if(r(a,t))return c(h.iterator,"normal",!1)})}}),Qt=__webpack_require__.cw(t=>{var e=a(),r=ne(),n=ee(),s=Q();t.exports=function isSubsetOf(t){var a=e(this),i=s(t);return!(r(a)>i.size)&&!1!==n(a,function(t){if(!i.includes(t))return!1},!0)}}),te=__webpack_require__.cw(t=>{var e=a(),r=Kt().has,n=ne(),s=Q(),i=yt(),o=kt();t.exports=function isSupersetOf(t){var a=e(this),c=s(t);if(n(a)<c.size)return!1;var l=c.getIterator();return!1!==i(l,function(t){if(!r(a,t))return o(l.iterator,"normal",!1)})}}),ee=__webpack_require__.cw(t=>{var e=Y(),r=yt(),n=Kt(),a=n.Set,s=n.proto,i=e(s.forEach),o=e(s.keys),c=o(new a).next;t.exports=function(t,e,n){return n?r({iterator:o(t),next:c},e):i(t,e)}}),re=__webpack_require__.cw(t=>{var e=$(),createSetLike=function(t){return{size:t,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},createSetLikeWithInfinitySize=function(t){return{size:t,has:function(){return!0},keys:function(){throw new Error("e")}}};t.exports=function(t,r){var n=e("Set");try{(new n)[t](createSetLike(0));try{(new n)[t](createSetLike(-1));return!1}catch(e){if(!r)return!0;try{(new n)[t](createSetLikeWithInfinitySize(-1/0));return!1}catch(e){return r(new n([1,2])[t](createSetLikeWithInfinitySize(1/0)))}}}catch(t){return!1}}}),set_method_get_keys_before_cloning_detection_namespaceFn=()=>__webpack_require__(835),ne=__webpack_require__.cw(t=>{var e=X(),r=Kt();t.exports=e(r.proto,"size","get")||function(t){return t.size}}),ae=__webpack_require__.cw(t=>{var e=a(),r=Kt(),n=Yt(),s=Q(),i=yt(),o=r.add,c=r.has,l=r.remove;t.exports=function symmetricDifference(t){var r=e(this),a=s(t).getIterator(),h=n(r);i(a,function(t){c(r,t)?l(h,t):o(h,t)});return h}}),se=__webpack_require__.cw(t=>{var e=a(),r=Kt().add,n=Yt(),s=Q(),i=yt();t.exports=function union(t){var a=e(this),o=s(t).getIterator(),c=n(a);i(o,function(t){r(c,t)});return c}}),ie=__webpack_require__.cw(t=>{var e=ce(),r=xe(),n=e("keys");t.exports=function(t){return n[t]||(n[t]=r(t))}}),oe=__webpack_require__.cw(t=>{var e=_t(),r=tt(),n=A(),a="__core-js_shared__",s=t.exports=r[a]||n(a,{});(s.versions||(s.versions=[])).push({version:"3.51.0",mode:e?"pure":"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.51.0/LICENSE",source:"https://github.com/zloirock/core-js"})}),ce=__webpack_require__.cw(t=>{var e=oe(),r=Object.create||Object;t.exports=function(t,n){return e[t]||(e[t]=n||r(null))}}),le=__webpack_require__.cw(t=>{var e=N(),r=q(),n=tt().String;t.exports=!!Object.getOwnPropertySymbols&&!r(function(){var t=Symbol("symbol detection");return!n(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41})}),he=__webpack_require__.cw(t=>{var e=Y();t.exports=e(1.1.valueOf)}),ue=__webpack_require__.cw(t=>{var e=to_integer_or_infinity_namespaceFn(),r=Math.max,n=Math.min;t.exports=function(t,a){var s=e(t);return s<0?r(s+a,0):n(s,a)}}),pe=__webpack_require__.cw(t=>{var e=fe(),r=TypeError;t.exports=function(t){var n=e(t,"number");if("number"==typeof n)throw new r("Can't convert number to bigint");return BigInt(n)}}),de=__webpack_require__.cw(t=>{var e=it(),r=require_object_coercible_namespaceFn();t.exports=function(t){return e(r(t))}}),to_integer_or_infinity_namespaceFn=()=>__webpack_require__(291),to_length_namespaceFn=()=>__webpack_require__(14),to_object_namespaceFn=()=>__webpack_require__(981),fe=__webpack_require__.cw(t=>{var e=z(),r=gt(),n=xt(),a=Z(),s=zt(),i=Me(),o=TypeError,c=i("toPrimitive");t.exports=function(t,i){if(!r(t)||n(t))return t;var l,h=a(t,c);if(h){void 0===i&&(i="default");l=e(h,t,i);if(!r(l)||n(l))return l;throw new o("Can't convert object to primitive value")}void 0===i&&(i="number");return s(t,i)}}),ge=__webpack_require__.cw(t=>{var e=fe(),r=xt();t.exports=function(t){var n=e(t,"string");return r(n)?n:n+""}}),me=__webpack_require__.cw(t=>{var e={};e[Me()("toStringTag")]="z";t.exports="[object z]"===String(e)}),_e=__webpack_require__.cw(t=>{var e=w(),r=String;t.exports=function(t){if("Symbol"===e(t))throw new TypeError("Cannot convert a Symbol value to a string");return r(t)}}),be=__webpack_require__.cw(t=>{var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}}),xe=__webpack_require__.cw(t=>{var e=Y(),r=0,n=Math.random(),a=e(1.1.toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++r+n,36)}}),ye=__webpack_require__.cw(t=>{var e=tt(),r=Y(),n=l(),a=a_string_namespaceFn(),s=et(),i=base64_map_namespaceFn(),o=get_alphabet_option_namespaceFn(),c=g(),h=i.c2i,u=i.c2iUrl,p=e.SyntaxError,d=e.TypeError,f=e.Array,m=r("".charAt),_=Math.floor,skipAsciiWhitespace=function(t,e){for(var r=t.length;e<r;e++){var n=m(t,e);if(" "!==n&&"\t"!==n&&"\n"!==n&&"\f"!==n&&"\r"!==n)break}return e},decodeBase64Chunk=function(t,e,r){var n=t.length;n<4&&(t+=2===n?"AA":"A");var a=(e[m(t,0)]<<18)+(e[m(t,1)]<<12)+(e[m(t,2)]<<6)+e[m(t,3)],s=[a>>16&255,a>>8&255,255&a];if(2===n){if(r&&0!==s[1])throw new p("Extra bits");return[s[0]]}if(3===n){if(r&&0!==s[2])throw new p("Extra bits");return[s[0],s[1]]}return s},writeBytes=function(t,e,r){for(var n=e.length,a=0;a<n;a++)t[r+a]=e[a];return r+n};t.exports=function(t,e,r,i){a(t);n(e);var l="base64"===o(e)?h:u,g=e?e.lastChunkHandling:void 0;void 0===g&&(g="loose");if("loose"!==g&&"strict"!==g&&"stop-before-partial"!==g)throw new d("Incorrect `lastChunkHandling` option");r&&c(r.buffer);var b=t.length,x=r||f(_(3*b/4)),y=0,v=0,w="",k=0;if(i)for(;;){if((k=skipAsciiWhitespace(t,k))===b){if(w.length>0){if("stop-before-partial"===g)break;if("loose"!==g)throw new p("Missing padding");if(1===w.length)throw new p("Malformed padding: exactly one additional character");y=writeBytes(x,decodeBase64Chunk(w,l,!1),y)}v=b;break}var S=m(t,k);++k;if("="===S){if(w.length<2)throw new p("Padding is too early");k=skipAsciiWhitespace(t,k);if(2===w.length){if(k===b){if("stop-before-partial"===g)break;throw new p("Malformed padding: only one =")}if("="===m(t,k)){++k;k=skipAsciiWhitespace(t,k)}}if(k<b)throw new p("Unexpected character after padding");y=writeBytes(x,decodeBase64Chunk(w,l,"strict"===g),y);v=b;break}if(!s(l,S))throw new p("Unexpected character");var C=i-y;if(1===C&&2===w.length||2===C&&3===w.length)break;if(4===(w+=S).length){y=writeBytes(x,decodeBase64Chunk(w,l,!1),y);w="";v=k;if(y===i)break}}r||(x.length=y);return{bytes:x,read:v,written:y}}}),ve=__webpack_require__.cw(t=>{var e=tt(),r=Y(),n=e.Uint8Array,a=e.SyntaxError,s=Math.min,i=r("".match);t.exports=function(t,e){var r=t.length;if(r%2!=0)throw new a("String should be an even number of characters");for(var o=e?s(e.length,r/2):r/2,c=e||new n(o),l=i(t,/[\S\s]{2}/g),h=0;h<o;h++){var u=+("0x"+l[h]+"0");if(u!=u)throw new a("String should only contain hex characters");c[h]=u>>4}return{bytes:c,read:h<<1}}}),we=__webpack_require__.cw(t=>{var e=q(),r=Me(),n=P(),a=_t(),s=r("iterator");t.exports=!e(function(){var t=new URL("b?a=1&b=2&c=3","https://a"),e=t.searchParams,r=new URLSearchParams("a=1&a=2&b=3"),i="";t.pathname="c%20d";e.forEach(function(t,r){e.delete("b");i+=r+t});r.delete("a",2);r.delete("b",void 0);return a&&(!t.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!e.size&&(a||!n)||!e.sort||"https://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[s]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("https://тест").host||"#%D0%B1"!==new URL("https://a#б").hash||"a1c3"!==i||"x"!==new URL("https://x",void 0).host})}),ke=__webpack_require__.cw(t=>{var e=le();t.exports=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}),Se=__webpack_require__.cw(t=>{var e=P(),r=q();t.exports=e&&r(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})}),Ce=__webpack_require__.cw(t=>{var e=tt(),r=dt(),n=e.WeakMap;t.exports=r(n)&&/native code/.test(String(n))}),Te=__webpack_require__.cw(t=>{var e=Y(),r=WeakMap.prototype;t.exports={WeakMap,set:e(r.set),get:e(r.get),has:e(r.has),remove:e(r.delete)}}),Me=__webpack_require__.cw(t=>{var e=tt(),r=ce(),n=et(),a=xe(),s=le(),i=ke(),o=e.Symbol,c=r("wks"),l=i?o.for||o:o&&o.withoutSetter||a;t.exports=function(t){n(c,t)||(c[t]=s&&n(o,t)?o[t]:l("Symbol."+t));return c[t]}}),Fe=__webpack_require__.cw(()=>{var t=j(),e=_().includes,r=q(),n=o(),a=r(function(){return!Array(1).includes()}),s=r(function(){return[,1].includes(void 0,1)});t({target:"Array",proto:!0,forced:a||s},{includes:function includes(t){return e(this,t,arguments.length>1?arguments[1]:void 0)}});n("includes")}),Be=__webpack_require__.cw(()=>{var t=j(),e=to_object_namespaceFn(),r=Mt(),n=b(),a=__webpack_require__(837);t({target:"Array",proto:!0,arity:1,forced:q()(function(){return 4294967297!==[].push.call({length:4294967296},1)})||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}}()},{push:function push(t){var s=e(this),i=r(s),o=arguments.length;a(i+o);for(var c=0;c<o;c++){s[i]=arguments[c];i++}n(s,i);return i}})}),Oe=__webpack_require__.cw(()=>{var t=j(),e=tt(),r=c(),n=h(),a=dt(),s=Lt(),i=B(),o=M(),l=q(),u=et(),p=Me(),d=Tt().IteratorPrototype,f=P(),g=_t(),m="constructor",_="Iterator",b=p("toStringTag"),x=TypeError,y=e[_],v=g||!a(y)||y.prototype!==d||!l(function(){y({})}),w=function Iterator(){r(this,d);if(s(this)===d)throw new x("Abstract class Iterator not directly constructable")},defineIteratorPrototypeAccessor=function(t,e){f?i(d,t,{configurable:!0,get:function(){return e},set:function(e){n(this);if(this===d)throw new x("You can't redefine this property");u(this,t)?this[t]=e:o(this,t,e)}}):d[t]=e};u(d,b)||defineIteratorPrototypeAccessor(b,_);!v&&u(d,m)&&d[m]!==Object||defineIteratorPrototypeAccessor(m,w);w.prototype=d;t({global:!0,constructor:!0,forced:v},{Iterator:w})}),Ie=__webpack_require__.cw(()=>{var t=j(),e=z(),n=r(),a=h(),s=get_iterator_direct_namespaceFn(),i=St(),o=y(),c=_t(),l=kt(),u=iterator_helper_throws_on_invalid_iterator_namespaceFn(),p=Ct(),d=!c&&!u("filter",function(){}),f=!c&&!d&&p("filter",TypeError),g=c||d||f,m=i(function(){for(var t,r,n=this.iterator,s=this.predicate,i=this.next;;){t=a(e(i,n));if(this.done=!!t.done)return;r=t.value;if(o(n,s,[r,this.counter++],!0))return r}});t({target:"Iterator",proto:!0,real:!0,forced:g},{filter:function filter(t){a(this);try{n(t)}catch(t){l(this,"throw",t)}return f?e(f,this,t):new m(s(this),{predicate:t})}})}),Ae=__webpack_require__.cw(()=>{var t=j(),e=z(),n=vt(),a=r(),s=h(),i=get_iterator_direct_namespaceFn(),o=kt(),c=Ct()("forEach",TypeError);t({target:"Iterator",proto:!0,real:!0,forced:c},{forEach:function forEach(t){s(this);try{a(t)}catch(t){o(this,"throw",t)}if(c)return e(c,this,t);var r=i(this),l=0;n(r,function(e){t(e,l++)},{IS_RECORD:!0})}})}),Pe=__webpack_require__.cw(()=>{var t=j(),e=z(),n=r(),a=h(),s=get_iterator_direct_namespaceFn(),i=St(),o=y(),c=kt(),l=iterator_helper_throws_on_invalid_iterator_namespaceFn(),u=Ct(),p=_t(),d=!p&&!l("map",function(){}),f=!p&&!d&&u("map",TypeError),g=p||d||f,m=i(function(){var t=this.iterator,r=a(e(this.next,t));if(!(this.done=!!r.done))return o(t,this.mapper,[r.value,this.counter++],!0)});t({target:"Iterator",proto:!0,real:!0,forced:g},{map:function map(t){a(this);try{n(t)}catch(t){c(this,"throw",t)}return f?e(f,this,t):new m(s(this),{mapper:t})}})}),De=__webpack_require__.cw(()=>{var t=j(),e=z(),r=h(),n=get_iterator_direct_namespaceFn(),a=__webpack_require__(149),s=__webpack_require__(590),i=St(),o=kt(),c=iterator_helper_throws_on_invalid_iterator_namespaceFn(),l=Ct(),u=_t(),p=RangeError,d=1/0,f=!u&&!c("take",1),g=!u&&!f&&l("take",RangeError),m=u||f||g||!function(){try{Iterator.prototype.take.call({next:function(){return{done:!0}}},9007199254740992)}catch(t){return t instanceof p}}(),_=i(function(){var t=this.iterator;if(!this.remaining--){this.done=!0;return o(t,"normal",void 0)}var n=r(e(this.next,t));if(!(this.done=!!n.done))return n.value});t({target:"Iterator",proto:!0,real:!0,forced:m},{take:function take(t){r(this);var i;try{if((i=s(a(+t)))>9007199254740991&&i!==d)throw new p("The argument should be a safe integer")}catch(t){o(this,"throw",t)}return g?e(g,this,i):new _(n(this),{remaining:i})}})}),Ee=__webpack_require__.cw(()=>{var t=j(),e=$(),r=z(),n=Y(),a=q(),s=ut(),i=dt(),o=gt(),c=Pt(),l=bt(),h=xt(),u=v(),p=he(),d=_().includes,f=et(),g=_e(),m=Xt(),b=xe(),x=le(),y=Ot(),w=String,k=TypeError,S=e("JSON","stringify"),C=e("BigInt"),T=n("".valueOf),M=n((!0).valueOf),B=C&&n(C.prototype.valueOf),O=n(/./.exec),I=n("".charAt),A=n("".charCodeAt),P=n("".replace),D=n("".slice),E=n([].push),R=n([].pop),N=n(1.1.toString),L=/[\uD800-\uDFFF]/g,U=/^[\uD800-\uDBFF]$/,G=/^[\uDC00-\uDFFF]$/,W=/^\d+$/,H=b(),X=b(),V=b(),K=H.length,J=X.length,Z=!x||a(function(){var t=e("Symbol")("stringify detection");return"[null]"!==S([t])||"{}"!==S({a:t})||"{}"!==S(Object(t))}),Q=a(function(){return'"\\udf06\\ud834"'!==S("\udf06\ud834")||'"\\udead"'!==S("\udead")}),tt=y?e("JSON","isRawJSON"):l,rt=Z?function(t,e,n){return S(t,function(t,n){var a=r(e,this,t,n);if(!h(a))return a},n)}:S,fixIllFormedJSON=function(t,e,r){var n=I(r,e-1),a=I(r,e+1);return O(U,t)&&!O(G,a)||O(G,t)&&!O(U,n)?"\\u"+N(A(t,0),16):t},hasInternalSlot=function(t,e){try{t(e);return!0}catch(t){return!1}},isSerializedAsObject=function(t){if(!o(t)||i(t)||s(t))return!1;try{return!function(t){var e=u(t);return"Number"===e&&hasInternalSlot(p,t)||"String"===e&&hasInternalSlot(T,t)||"Boolean"===e&&hasInternalSlot(M,t)||!!B&&"BigInt"===e&&hasInternalSlot(B,t)}(t)}catch(t){return!0}},createElementHolder=function(t,e){return{toJSON:function(){var n=t[e];if(o(n)||"bigint"==typeof n){var a=n.toJSON;i(a)&&(n=r(a,n,e))}return n}}};S&&t({target:"JSON",stat:!0,arity:3,forced:Z||Q||!y},{stringify:function stringify(t,e,n){var a,o=i(e)?e:void 0,l=o?void 0:function(t){if(s(t)){for(var e=t.length,r=[],n=c(null),a=0;a<e;a++){var i,o=t[a];if("string"==typeof o)i=o;else{if("number"!=typeof o&&"Number"!==u(o)&&"String"!==u(o))continue;i=g(o)}if(!f(n,i)){n[i]=!0;E(r,i)}}return r}}(e),h=l&&function(t){for(var e=0,r=t.length;e<r;e++)if(O(W,t[e]))return X;return""}(l),p=[],_=[],b=[],x=!1,v=!0,S=rt(t,function(t,e){t=w(t);if(l){if(t===V){R(_);a=R(b);return}if(v)v=!1;else if(this!==a&&!s(this)&&!d(l,t))return}else o&&(e=r(o,this,t,e));if(tt(e)){if(y)return e;x=!0;return H+(E(p,e.rawJSON)-1)}if(l&&isSerializedAsObject(e)){if(d(_,e))throw new k("Converting circular structure to JSON");var n=function(t,e,r){for(var n=c(null),a=0,s=e.length;a<s;a++){var i=e[a];n[r+i]=createElementHolder(t,i)}n[V]=null;return n}(e,l,h);E(_,e);E(b,a);a=n;h&&(x=!0);return n}return e},n);if("string"!=typeof S)return S;Q&&(S=P(S,L,fixIllFormedJSON));if(!x)return S;for(var C="",T=S.length,M=0;M<T;M++){var B=I(S,M);if('"'===B){var A=m(S,++M).end-1,N=D(S,M,A);D(N,0,K)===H?C+=p[D(N,K)]:D(N,0,J)===X?C+='"'+D(N,J)+'"':C+='"'+N+'"';M=A}else C+=B}return C}})}),Re=__webpack_require__.cw(()=>{var t=j(),e=r(),n=Bt(),a=_t(),s=n.get,i=n.has,o=n.set;t({target:"Map",proto:!0,real:!0,forced:a},{getOrInsertComputed:function getOrInsertComputed(t,r){var n=i(this,t);e(r);if(n)return s(this,t);0===t&&1/t==-1/0&&(t=0);var a=r(t);o(this,t,a);return a}})}),Ne=__webpack_require__.cw(()=>{var t=j(),e=Bt(),r=_t(),n=e.get,a=e.has,s=e.set;t({target:"Map",proto:!0,real:!0,forced:r},{getOrInsert:function getOrInsert(t,e){if(a(this,t))return n(this,t);s(this,t,e);return e}})}),Le=__webpack_require__.cw(()=>{var t=j(),e=tt(),n=U(),a=x(),s=Vt(),i=It(),o=r(),c=__webpack_require__(103),l=q(),h=e.Promise,u=!1;t({target:"Promise",stat:!0,forced:!h||!h.try||l(function(){var t=h.resolve();return h.try(function(e){u=8===e;return t},8)!==t})||!u},{try:function(t){var e=arguments.length>1?a(arguments,1):[],r=c(function(){return n(o(t),void 0,e)});if(!r.error)return s(this,r.value);var l=i.f(this);(0,l.reject)(r.value);return l.promise}})}),je=__webpack_require__.cw(()=>{var t=j(),e=$t(),r=q();t({target:"Set",proto:!0,real:!0,forced:!re()("difference",function(t){return 0===t.size})||r(function(){var t={size:1,has:function(){return!0},keys:function(){var t=0;return{next:function(){var r=t++>1;e.has(1)&&e.clear();return{done:r,value:2}}}}},e=new Set([1,2,3,4]);return 3!==e.difference(t).size})},{difference:e})}),qe=__webpack_require__.cw(()=>{var t=j(),e=q(),r=Jt();t({target:"Set",proto:!0,real:!0,forced:!re()("intersection",function(t){return 2===t.size&&t.has(1)&&t.has(2)})||e(function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))})},{intersection:r})}),Ue=__webpack_require__.cw(()=>{var t=j(),e=Zt();t({target:"Set",proto:!0,real:!0,forced:!re()("isDisjointFrom",function(t){return!t})},{isDisjointFrom:e})}),Ge=__webpack_require__.cw(()=>{var t=j(),e=Qt();t({target:"Set",proto:!0,real:!0,forced:!re()("isSubsetOf",function(t){return t})},{isSubsetOf:e})}),We=__webpack_require__.cw(()=>{var t=j(),e=te();t({target:"Set",proto:!0,real:!0,forced:!re()("isSupersetOf",function(t){return!t})},{isSupersetOf:e})}),ze=__webpack_require__.cw(()=>{var t=j(),e=ae(),r=set_method_get_keys_before_cloning_detection_namespaceFn();t({target:"Set",proto:!0,real:!0,forced:!re()("symmetricDifference")||!r("symmetricDifference")},{symmetricDifference:e})}),He=__webpack_require__.cw(()=>{var t=j(),e=se(),r=set_method_get_keys_before_cloning_detection_namespaceFn();t({target:"Set",proto:!0,real:!0,forced:!re()("union")||!r("union")},{union:e})}),Xe=__webpack_require__.cw(()=>{var t=m(),e=pt(),r=Mt(),n=to_integer_or_infinity_namespaceFn(),a=pe(),s=t.aTypedArray,i=t.getTypedArrayConstructor,o=t.exportTypedArrayMethod,c=RangeError,l=function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(t){return 8===t}}(),h=l&&function(){try{new Int8Array(1).with(-.5,1)}catch(t){return!0}}();o("with",{with:function(t,o){var l=s(this),h=r(l),u=n(t),p=u<0?h+u:u,d=e(l)?a(o):+o;if(p>=h||p<0)throw new c("Incorrect index");for(var f=new(i(l))(h),g=0;g<h;g++)f[g]=g===p?d:l[g];return f}}.with,!l||h)}),Ve=__webpack_require__.cw(()=>{var t=j(),e=tt(),r=ye(),n=u(),a=e.Uint8Array,s=!a||!a.prototype.setFromBase64||!function(){var t=new a([255,255,255,255,255]);try{t.setFromBase64("",null);return}catch(t){}try{t.setFromBase64("a");return}catch(t){}try{t.setFromBase64("MjYyZg===")}catch(e){return 50===t[0]&&54===t[1]&&50===t[2]&&255===t[3]&&255===t[4]}}();a&&t({target:"Uint8Array",proto:!0,forced:s},{setFromBase64:function setFromBase64(t){n(this);var e=r(t,arguments.length>1?arguments[1]:void 0,this,this.length);return{read:e.read,written:e.written}}})}),Ye=__webpack_require__.cw(()=>{var t=j(),e=tt(),r=a_string_namespaceFn(),n=u(),a=g(),s=ve();e.Uint8Array&&t({target:"Uint8Array",proto:!0,forced:function throwsOnLengthTrackingView(){try{var t=new ArrayBuffer(16,{maxByteLength:1024});new Uint8Array(t).setFromHex("cafed00d")}catch(t){return!0}}()},{setFromHex:function setFromHex(t){n(this);r(t);a(this.buffer);var e=s(t,this).read;return{read:e,written:e/2}}})}),$e=__webpack_require__.cw(()=>{var t=j(),e=tt(),r=Y(),n=l(),a=u(),s=g(),i=base64_map_namespaceFn(),o=get_alphabet_option_namespaceFn(),c=i.i2c,h=i.i2cUrl,p=Math.floor,d=Math.ceil,f=r("".charAt),m=e.Uint8Array,_=e.Array,b=r([].join),x=!m||!m.prototype.toBase64||!function(){try{(new m).toBase64(null)}catch(t){return!0}}();m&&t({target:"Uint8Array",proto:!0,forced:x},{toBase64:function toBase64(){var t=a(this),e=arguments.length?n(arguments[0]):void 0,r="base64"===o(e)?c:h,i=!!e&&!!e.omitPadding;s(this.buffer);for(var l,u=0,g=t.length,m=_(i?4*p(g/3)+(g%3?g%3+1:0):4*d(g/3)),x=0,at=function(t){return f(r,l>>6*t&63)};u+2<g;u+=3){l=(t[u]<<16)+(t[u+1]<<8)+t[u+2];m[x++]=at(3);m[x++]=at(2);m[x++]=at(1);m[x++]=at(0)}if(u+2===g){l=(t[u]<<16)+(t[u+1]<<8);m[x++]=at(3);m[x++]=at(2);m[x++]=at(1);i||(m[x++]="=")}else if(u+1===g){l=t[u]<<16;m[x++]=at(3);m[x++]=at(2);if(!i){m[x++]="=";m[x++]="="}}return b(m,"")}})}),Ke=__webpack_require__.cw(()=>{var t=j(),e=tt(),r=Y(),n=u(),a=g(),s=r(1.1.toString),i=r([].join),o=Array,c=e.Uint8Array,l=!c||!c.prototype.toHex||!function(){try{return"ffffffffffffffff"===new c([255,255,255,255,255,255,255,255]).toHex()}catch(t){return!1}}();c&&t({target:"Uint8Array",proto:!0,forced:l},{toHex:function toHex(){n(this);a(this.buffer);for(var t=o(this.length),e=0,r=this.length;e<r;e++){var c=s(this[e],16);t[e]=1===c.length?"0"+c:c}return i(t,"")}})}),Je=__webpack_require__.cw(()=>{var t=j(),e=r(),n=i(),a=s(),o=Te(),c=_t(),l=o.get,h=o.has,u=o.set;t({target:"WeakMap",proto:!0,real:!0,forced:c||!function(){try{WeakMap.prototype.getOrInsertComputed&&(new WeakMap).getOrInsertComputed(1,function(){throw 1})}catch(t){return t instanceof TypeError}}()},{getOrInsertComputed:function getOrInsertComputed(t,r){c||n(this);a(t);e(r);if(h(this,t))return l(this,t);var s=r(t);u(this,t,s);return s}})}),Ze=__webpack_require__.cw(()=>{var t=j(),e=Te(),r=_t(),n=e.get,a=e.has,s=e.set;t({target:"WeakMap",proto:!0,real:!0,forced:r},{getOrInsert:function getOrInsert(t,e){if(a(this,t))return n(this,t);s(this,t,e);return e}})}),Qe=__webpack_require__.cw(()=>{var t=j(),e=tt(),r=$(),n=T(),a=Et().f,s=et(),i=c(),o=ot(),l=At(),h=__webpack_require__(2),u=L(),p=P(),d=_t(),f="DOMException",g=r("Error"),m=r(f),_=function DOMException(){i(this,b);var t=arguments.length,e=l(t<1?void 0:arguments[0]),r=l(t<2?void 0:arguments[1],"Error"),s=new m(e,r),c=new g(e);c.name=f;a(s,"stack",n(1,u(c.stack,1)));o(s,this,_);return s},b=_.prototype=m.prototype,x="stack"in new g(f),y="stack"in new m(1,2),v=m&&p&&Object.getOwnPropertyDescriptor(e,f),w=!(!v||v.writable&&v.configurable),k=x&&!w&&!y;t({global:!0,constructor:!0,forced:d||k},{DOMException:k?_:m});var S=r(f),C=S.prototype;if(C.constructor!==S){d||a(C,"constructor",n(1,S));for(var M in h)if(s(h,M)){var B=h[M],O=B.s;s(S,O)||a(S,O,n(6,B.c))}}}),tr=__webpack_require__.cw(()=>{var t=j(),e=tt(),r=B(),n=P(),a=TypeError,s=Object.defineProperty,i=e.self!==e;try{if(n){var o=Object.getOwnPropertyDescriptor(e,"self");!i&&o&&o.get&&o.enumerable||r(e,"self",{get:function self(){return e},set:function self(t){if(this!==e)throw new a("Illegal invocation");s(e,"self",{value:t,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}else t({global:!0,simple:!0,forced:i},{self:e})}catch(t){}}),er=__webpack_require__.cw(()=>{var t=j(),e=$(),r=__webpack_require__(812),n=_e(),a=we(),s=e("URL");t({target:"URL",stat:!0,forced:!a},{parse:function parse(t){var e=r(arguments.length,1),a=n(t),i=e<2||void 0===arguments[1]?void 0:n(arguments[1]);try{return new s(a,i)}catch(t){return null}}})});Be();Oe();De();Ne();Re();Xe();Ve();Ye();$e();Ke();tr();Ie();Pe();Ee();Ze();Je();Ae();je();qe();Ue();Ge();We();ze();He();Fe();er();const rr=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type),nr=[1/0,1/0,-1/0,-1/0],ar=new Float32Array(nr),sr=[.001,0,0,.001,0,0],ir=2,or=4,cr=0,lr=1,hr=2,ur=3,pr=3,dr=4,fr=1,gr=2,mr=3,_r=1,br=5,xr={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},yr=0,vr=1,wr=2,kr=3,Sr=4;let Cr=_r;function info(t){Cr>=br&&console.info(`Info: ${t}`)}function warn(t){Cr>=_r&&console.warn(`Warning: ${t}`)}function unreachable(t){throw new Error(t)}function assert(t,e){t||unreachable(e)}function util_shadow(t,e,r,n=!1){Object.defineProperty(t,e,{value:r,enumerable:!n,configurable:!0,writable:!1});return r}const Tr=function BaseExceptionClosure(){function BaseException(t,e){this.message=t;this.name=e}BaseException.prototype=new Error;BaseException.constructor=BaseException;return BaseException}();class PasswordException extends Tr{constructor(t,e){super(t,"PasswordException");this.code=e}}class UnknownErrorException extends Tr{constructor(t,e){super(t,"UnknownErrorException");this.details=e}}class InvalidPDFException extends Tr{constructor(t){super(t,"InvalidPDFException")}}class ResponseException extends Tr{constructor(t,e,r){super(t,"ResponseException");this.status=e;this.missing=r}}class FormatError extends Tr{constructor(t){super(t,"FormatError")}}class AbortException extends Tr{constructor(t){super(t,"AbortException")}}class FeatureTest{static get isLittleEndian(){const t=new Uint8Array(4);t[0]=1;return util_shadow(this,"isLittleEndian",1===new Uint32Array(t.buffer,0,1)[0])}static get isOffscreenCanvasSupported(){return util_shadow(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get isImageDecoderSupported(){return util_shadow(this,"isImageDecoderSupported","undefined"!=typeof ImageDecoder)}static get isVideoFrameSupported(){return util_shadow(this,"isVideoFrameSupported","undefined"!=typeof VideoFrame)}static get isFloat16ArraySupported(){return util_shadow(this,"isFloat16ArraySupported","undefined"!=typeof Float16Array)}static get isSanitizerSupported(){return util_shadow(this,"isSanitizerSupported","undefined"!=typeof Sanitizer)}static get platform(){const{platform:t,userAgent:e}=navigator;return util_shadow(this,"platform",{isAndroid:e.includes("Android"),isLinux:t.includes("Linux"),isMac:t.includes("Mac"),isWindows:t.includes("Win"),isFirefox:e.includes("Firefox")})}static get isCanvasFilterSupported(){let t;this.isOffscreenCanvasSupported&&(t=new OffscreenCanvas(1,1).getContext("2d"));return util_shadow(this,"isCanvasFilterSupported",void 0!==t?.filter)}static get isAlphaColorInputSupported(){return util_shadow(this,"isAlphaColorInputSupported",!1)}static get isBackdropFilterSupported(){return util_shadow(this,"isBackdropFilterSupported","undefined"!=typeof CSS&&CSS.supports("backdrop-filter","blur(1px)"))}}class Util{static get hexNums(){return util_shadow(this,"hexNums",Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0")))}static makeHexColor(t,e,r){return`#${this.hexNums[t]}${this.hexNums[e]}${this.hexNums[r]}`}static get identity0to256Map(){return util_shadow(this,"identity0to256Map",Uint8Array.from({length:256},(t,e)=>e))}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static multiplyByDOMMatrix(t,e){return[t[0]*e.a+t[2]*e.b,t[1]*e.a+t[3]*e.b,t[0]*e.c+t[2]*e.d,t[1]*e.c+t[3]*e.d,t[0]*e.e+t[2]*e.f+t[4],t[1]*e.e+t[3]*e.f+t[5]]}static applyTransform(t,e,r=0){const n=t[r],a=t[r+1];t[r]=n*e[0]+a*e[2]+e[4];t[r+1]=n*e[1]+a*e[3]+e[5]}static applyTransformToBezier(t,e,r=0){const n=e[0],a=e[1],s=e[2],i=e[3],o=e[4],c=e[5];for(let e=0;e<6;e+=2){const l=t[r+e],h=t[r+e+1];t[r+e]=l*n+h*s+o;t[r+e+1]=l*a+h*i+c}}static applyInverseTransform(t,e){const r=t[0],n=t[1],a=e[0]*e[3]-e[1]*e[2];t[0]=(r*e[3]-n*e[2]+e[2]*e[5]-e[4]*e[3])/a;t[1]=(-r*e[1]+n*e[0]+e[4]*e[1]-e[5]*e[0])/a}static axialAlignedBoundingBox(t,e,r){const n=e[0],a=e[1],s=e[2],i=e[3],o=e[4],c=e[5],l=t[0],h=t[1],u=t[2],p=t[3];let d=n*l+o,f=d,g=n*u+o,m=g,_=i*h+c,b=_,x=i*p+c,y=x;if(0!==a||0!==s){const t=a*l,e=a*u,r=s*h,n=s*p;d+=r;m+=r;g+=n;f+=n;_+=t;y+=t;x+=e;b+=e}r[0]=Math.min(r[0],d,g,Math.min(f,m));r[1]=Math.min(r[1],_,x,Math.min(b,y));r[2]=Math.max(r[2],d,g,Math.max(f,m));r[3]=Math.max(r[3],_,x,Math.max(b,y))}static inverseTransform(t){const e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t,e){const r=t[0],n=t[1],a=t[2],s=t[3],i=r**2+n**2,o=r*a+n*s,c=a**2+s**2,l=(i+c)/2,h=Math.sqrt(l**2-(i*c-o**2));e[0]=Math.sqrt(l+h||1);e[1]=Math.sqrt(l-h||1)}static normalizeRect(t){const e=t.slice(0);if(t[0]>t[2]){e[0]=t[2];e[2]=t[0]}if(t[1]>t[3]){e[1]=t[3];e[3]=t[1]}return e}static intersect(t,e){const r=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),n=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(r>n)return null;const a=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),s=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return a>s?null:[r,a,n,s]}static pointBoundingBox(t,e,r){r[0]=Math.min(r[0],t);r[1]=Math.min(r[1],e);r[2]=Math.max(r[2],t);r[3]=Math.max(r[3],e)}static rectBoundingBox(t,e,r,n,a){a[0]=Math.min(a[0],t,r);a[1]=Math.min(a[1],e,n);a[2]=Math.max(a[2],t,r);a[3]=Math.max(a[3],e,n)}static#t(t,e,r,n,a,s,i,o,c,l){if(c<=0||c>=1)return;const h=1-c,u=c*c,p=u*c,d=h*(h*(h*t+3*c*e)+3*u*r)+p*n,f=h*(h*(h*a+3*c*s)+3*u*i)+p*o;l[0]=Math.min(l[0],d);l[1]=Math.min(l[1],f);l[2]=Math.max(l[2],d);l[3]=Math.max(l[3],f)}static#e(t,e,r,n,a,s,i,o,c,l,h,u){if(Math.abs(c)<1e-12){Math.abs(l)>=1e-12&&this.#t(t,e,r,n,a,s,i,o,-h/l,u);return}const p=l**2-4*h*c;if(p<0)return;const d=Math.sqrt(p),f=2*c;this.#t(t,e,r,n,a,s,i,o,(-l+d)/f,u);this.#t(t,e,r,n,a,s,i,o,(-l-d)/f,u)}static bezierBoundingBox(t,e,r,n,a,s,i,o,c){c[0]=Math.min(c[0],t,i);c[1]=Math.min(c[1],e,o);c[2]=Math.max(c[2],t,i);c[3]=Math.max(c[3],e,o);this.#e(t,r,a,i,e,n,s,o,3*(3*(r-a)-t+i),6*(t-2*r+a),3*(r-t),c);this.#e(t,r,a,i,e,n,s,o,3*(3*(n-s)-e+o),6*(e-2*n+s),3*(n-e),c)}}const makeArr=()=>[],makeMap=()=>new Map;"function"!=typeof Blob.prototype.bytes&&(Blob.prototype.bytes=async function(){return new Uint8Array(await this.arrayBuffer())});"function"!=typeof Response.prototype.bytes&&(Response.prototype.bytes=async function(){return new Uint8Array(await this.arrayBuffer())});"function"!=typeof Iterator.prototype.join&&(Iterator.prototype.join=function(t){return[...this].join(t)});class PixelsPerInch{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}function getRGBA(t){if(t.startsWith("#")){const e=t.slice(1);return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16),e.length>=8?parseInt(e.slice(6,8),16)/255:1]}if(t.startsWith("rgb(")){const[e,r,n]=t.slice(4,-1).split(",").map(t=>parseInt(t,10));return[e,r,n,1]}if(t.startsWith("rgba(")){const e=t.slice(5,-1).split(",");return[parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10),parseFloat(e[3])]}const e=t.match(/^color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+|none))?\)$/);return e?[Math.round(255*parseFloat(e[1])),Math.round(255*parseFloat(e[2])),Math.round(255*parseFloat(e[3])),void 0!==e[4]&&"none"!==e[4]?parseFloat(e[4]):1]:null}function getCurrentTransform(t){const{a:e,b:r,c:n,d:a,e:s,f:i}=t.getTransform();return[e,r,n,a,s,i]}function getCurrentTransformInverse(t){const{a:e,b:r,c:n,d:a,e:s,f:i}=t.getTransform().invertSelf();return[e,r,n,a,s,i]}class OutputScale{constructor(){const{pixelRatio:t}=OutputScale;this.sx=t;this.sy=t}get scaled(){return 1!==this.sx||1!==this.sy}get symmetric(){return this.sx===this.sy}limitCanvas(t,e,r,n,a=-1){return!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(t,e){return t}}new Map;function makePathFromDrawOPS(t){const e=new Path2D;if(!t)return e;for(let r=0,n=t.length;r<n;)switch(t[r++]){case yr:e.moveTo(t[r++],t[r++]);break;case vr:e.lineTo(t[r++],t[r++]);break;case wr:e.bezierCurveTo(t[r++],t[r++],t[r++],t[r++],t[r++],t[r++]);break;case kr:e.quadraticCurveTo(t[r++],t[r++],t[r++],t[r++]);break;case Sr:e.closePath();break;default:warn(`Unrecognized drawing path operator: ${t[r-1]}`)}return e}function math_clamp_MathClamp(t,e,r){return Math.min(Math.max(t,e),r)}const Mr="__forcedDependency",{floor:Fr,ceil:Br}=Math;function expandBBox(t,e,r,n,a,s){t[4*e+0]=Math.min(t[4*e+0],r);t[4*e+1]=Math.min(t[4*e+1],n);t[4*e+2]=Math.max(t[4*e+2],a);t[4*e+3]=Math.max(t[4*e+3],s)}const Or=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0];class BBoxReader{#r;#n;constructor(t,e){this.#r=t;this.#n=e}static fromBuffer(t){return new BBoxReader(new Uint32Array(t),new Uint8ClampedArray(t))}get buffer(){return this.#r.buffer}get length(){return this.#r.length}isEmpty(t){return this.#r[t]===Or}minX(t){return this.#n[4*t+0]/256}minY(t){return this.#n[4*t+1]/256}maxX(t){return(this.#n[4*t+2]+1)/256}maxY(t){return(this.#n[4*t+3]+1)/256}}const ensureDebugMetadata=(t,e)=>t?.getOrInsertComputed(e,()=>({dependencies:new Set,isRenderingOperation:!1}));class CanvasBBoxTracker{#a=[[1,0,0,1,0,0]];#s=[-1/0,-1/0,1/0,1/0];#i=new Float64Array(nr);_pendingBBoxIdx=-1;#o;#c;#l;#r;_savesStack=[];_markedContentStack=[];constructor(t,e){this.#o=t.width;this.#c=t.height;this.#h(e)}growOperationsCount(t){t>=this.#r.length&&this.#h(t,this.#r)}#h(t,e){const r=new ArrayBuffer(4*t);this.#l=new Uint8ClampedArray(r);this.#r=new Uint32Array(r);if(e&&e.length>0){this.#r.set(e);this.#r.fill(Or,e.length)}else this.#r.fill(Or)}get clipBox(){return this.#s}save(t){this.#s={__proto__:this.#s};this._savesStack.push(t);return this}restore(t,e){const r=Object.getPrototypeOf(this.#s);if(null===r)return this;this.#s=r;const n=this._savesStack.pop();if(void 0!==n){e?.(n,t);this.#r[t]=this.#r[n]}return this}recordOpenMarker(t){this._savesStack.push(t);return this}getOpenMarker(){return 0===this._savesStack.length?null:this._savesStack.at(-1)}recordCloseMarker(t,e){const r=this._savesStack.pop();if(void 0!==r){e?.(r,t);this.#r[t]=this.#r[r]}return this}beginMarkedContent(t){this._markedContentStack.push(t);return this}endMarkedContent(t,e){const r=this._markedContentStack.pop();if(void 0!==r){e?.(r,t);this.#r[t]=this.#r[r]}return this}pushBaseTransform(t){this.#a.push(Util.multiplyByDOMMatrix(this.#a.at(-1),t.getTransform()));return this}popBaseTransform(){this.#a.length>1&&this.#a.pop();return this}resetBBox(t){if(this._pendingBBoxIdx!==t){this._pendingBBoxIdx=t;this.#i.set(nr,0)}return this}recordClipBox(t,e,r,n,a,s){const i=Util.multiplyByDOMMatrix(this.#a.at(-1),e.getTransform()),o=nr.slice();Util.axialAlignedBoundingBox([r,a,n,s],i,o);const c=Util.intersect(this.#s,o);if(c){this.#s[0]=c[0];this.#s[1]=c[1];this.#s[2]=c[2];this.#s[3]=c[3]}else{this.#s[0]=this.#s[1]=1/0;this.#s[2]=this.#s[3]=-1/0}return this}recordBBox(t,e,r,n,a,s){const i=this.#s;if(i[0]===1/0)return this;const o=Util.multiplyByDOMMatrix(this.#a.at(-1),e.getTransform());if(i[0]===-1/0){Util.axialAlignedBoundingBox([r,a,n,s],o,this.#i);return this}const c=nr.slice();Util.axialAlignedBoundingBox([r,a,n,s],o,c);this.#i[0]=math_clamp_MathClamp(c[0],i[0],this.#i[0]);this.#i[1]=math_clamp_MathClamp(c[1],i[1],this.#i[1]);this.#i[2]=math_clamp_MathClamp(c[2],this.#i[2],i[2]);this.#i[3]=math_clamp_MathClamp(c[3],this.#i[3],i[3]);return this}recordFullPageBBox(t){this.#i[0]=Math.max(0,this.#s[0]);this.#i[1]=Math.max(0,this.#s[1]);this.#i[2]=Math.min(this.#o,this.#s[2]);this.#i[3]=Math.min(this.#c,this.#s[3]);return this}recordOperation(t,e=!1,r){if(this._pendingBBoxIdx!==t)return this;const n=Fr(256*this.#i[0]/this.#o),a=Fr(256*this.#i[1]/this.#c),s=Br(256*this.#i[2]/this.#o),i=Br(256*this.#i[3]/this.#c);expandBBox(this.#l,t,n,a,s,i);if(r)for(const e of r)for(const r of e)r!==t&&expandBBox(this.#l,r,n,a,s,i);e||(this._pendingBBoxIdx=-1);return this}bboxToClipBoxDropOperation(t){if(this._pendingBBoxIdx===t){this._pendingBBoxIdx=-1;this.#s[0]=Math.max(this.#s[0],this.#i[0]);this.#s[1]=Math.max(this.#s[1],this.#i[1]);this.#s[2]=Math.min(this.#s[2],this.#i[2]);this.#s[3]=Math.min(this.#s[3],this.#i[3])}return this}take(){return new BBoxReader(this.#r,this.#l)}takeDebugMetadata(){throw new Error("Unreachable")}recordSimpleData(t,e){return this}recordIncrementalData(t,e){return this}resetIncrementalData(t,e){return this}recordNamedData(t,e){return this}recordSimpleDataFromNamed(t,e,r){return this}recordFutureForcedDependency(t,e){return this}inheritSimpleDataAsFutureForcedDependencies(t){return this}inheritPendingDependenciesAsFutureForcedDependencies(){return this}recordCharacterBBox(t,e,r,n=1,a=0,s=0,i){return this}getSimpleIndex(t){}recordDependencies(t,e){return this}recordNamedDependency(t,e){return this}recordShowTextOperation(t,e=!1){return this}}class CanvasDependencyTracker{#u={__proto__:null};#p={__proto__:null,transform:[],moveText:[],sameLineText:[],[Mr]:[]};#d=new Map;#f=new Set;#g=new Map;#m;#_;#b;constructor(t,e=!1){this.#b=t;if(e){this.#m=new Map;this.#_=(t,e)=>{ensureDebugMetadata(this.#m,e).dependencies.add(t)}}}get clipBox(){return this.#b.clipBox}growOperationsCount(t){this.#b.growOperationsCount(t)}save(t){this.#u={__proto__:this.#u};this.#p={__proto__:this.#p,transform:{__proto__:this.#p.transform},moveText:{__proto__:this.#p.moveText},sameLineText:{__proto__:this.#p.sameLineText},[Mr]:{__proto__:this.#p[Mr]}};this.#b.save(t);return this}restore(t){this.#b.restore(t,this.#_);const e=Object.getPrototypeOf(this.#u);if(null===e)return this;this.#u=e;this.#p=Object.getPrototypeOf(this.#p);return this}recordOpenMarker(t){this.#b.recordOpenMarker(t,this.#_);return this}getOpenMarker(){return this.#b.getOpenMarker()}recordCloseMarker(t){this.#b.recordCloseMarker(t,this.#_);return this}beginMarkedContent(t){this.#b.beginMarkedContent(t);return this}endMarkedContent(t){this.#b.endMarkedContent(t,this.#_);return this}pushBaseTransform(t){this.#b.pushBaseTransform(t);return this}popBaseTransform(){this.#b.popBaseTransform();return this}recordSimpleData(t,e){this.#u[t]=e;return this}recordIncrementalData(t,e){this.#p[t].push(e);return this}resetIncrementalData(t,e){this.#p[t].length=0;return this}recordNamedData(t,e){this.#d.set(t,e);return this}recordSimpleDataFromNamed(t,e,r){this.#u[t]=this.#d.get(e)??r}recordFutureForcedDependency(t,e){this.recordIncrementalData(Mr,e);return this}inheritSimpleDataAsFutureForcedDependencies(t){for(const e of t)e in this.#u&&this.recordFutureForcedDependency(e,this.#u[e]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(const t of this.#f)this.recordFutureForcedDependency(Mr,t);return this}resetBBox(t){this.#b.resetBBox(t);return this}recordClipBox(t,e,r,n,a,s){this.#b.recordClipBox(t,e,r,n,a,s);return this}recordBBox(t,e,r,n,a,s){this.#b.recordBBox(t,e,r,n,a,s);return this}recordCharacterBBox(t,e,r,n=1,a=0,s=0,i){const o=r.bbox;let c,l;if(o){c=o[2]!==o[0]&&o[3]!==o[1]&&this.#g.get(r);if(!1!==c){l=[0,0,0,0];Util.axialAlignedBoundingBox(o,r.fontMatrix,l);1===n&&0===a&&0===s||function scaleCharBBox(t,e,r,n,a){let s;if(t){if(t<0){s=a[0];a[0]=a[2];a[2]=s}a[0]*=t;a[2]*=t;if(e<0){s=a[1];a[1]=a[3];a[3]=s}a[1]*=e;a[3]*=e}else a.fill(0);a[0]+=r;a[1]+=n;a[2]+=r;a[3]+=n}(n,-n,a,s,l);if(c)return this.recordBBox(t,e,l[0],l[2],l[1],l[3])}}if(!i)return this.recordFullPageBBox(t);const h=i();if(o&&l&&void 0===c){c=l[0]<=a-h.actualBoundingBoxLeft&&l[2]>=a+h.actualBoundingBoxRight&&l[1]<=s-h.actualBoundingBoxAscent&&l[3]>=s+h.actualBoundingBoxDescent;this.#g.set(r,c);if(c)return this.recordBBox(t,e,l[0],l[2],l[1],l[3])}return this.recordBBox(t,e,a-h.actualBoundingBoxLeft,a+h.actualBoundingBoxRight,s-h.actualBoundingBoxAscent,s+h.actualBoundingBoxDescent)}recordFullPageBBox(t){this.#b.recordFullPageBBox(t);return this}getSimpleIndex(t){return this.#u[t]}recordDependencies(t,e){const r=this.#f,n=this.#u,a=this.#p;for(const t of e)t in this.#u?r.add(n[t]):t in a&&a[t].forEach(r.add,r);return this}recordNamedDependency(t,e){this.#d.has(e)&&this.#f.add(this.#d.get(e));return this}recordOperation(t,e=!1){this.recordDependencies(t,[Mr]);if(this.#m){const e=ensureDebugMetadata(this.#m,t),{dependencies:r}=e;this.#f.forEach(r.add,r);this.#b._savesStack.forEach(r.add,r);this.#b._markedContentStack.forEach(r.add,r);r.delete(t);e.isRenderingOperation=!0}const r=!e&&t===this.#b._pendingBBoxIdx;this.#b.recordOperation(t,e,[this.#f,this.#b._savesStack,this.#b._markedContentStack]);r&&this.#f.clear();return this}recordShowTextOperation(t,e=!1){const r=Array.from(this.#f);this.recordOperation(t,e);this.recordIncrementalData("sameLineText",t);for(const t of r)this.recordIncrementalData("sameLineText",t);return this}bboxToClipBoxDropOperation(t,e=!1){const r=!e&&t===this.#b._pendingBBoxIdx;this.#b.bboxToClipBoxDropOperation(t);r&&this.#f.clear();return this}take(){this.#g.clear();return this.#b.take()}takeDebugMetadata(){return this.#m}}class CanvasNestedDependencyTracker{#x;#y;#v;#w=0;#k=0;constructor(t,e,r){if(t instanceof CanvasNestedDependencyTracker&&t.#v===!!r)return t;this.#x=t;this.#y=e;this.#v=!!r}get clipBox(){return this.#x.clipBox}growOperationsCount(){throw new Error("Unreachable")}save(t){this.#k++;this.#x.save(this.#y);return this}restore(t){if(this.#k>0){this.#x.restore(this.#y);this.#k--}return this}recordOpenMarker(t){this.#w++;return this}getOpenMarker(){return this.#w>0?this.#y:this.#x.getOpenMarker()}recordCloseMarker(t){this.#w--;return this}beginMarkedContent(t){return this}endMarkedContent(t){return this}pushBaseTransform(t){this.#x.pushBaseTransform(t);return this}popBaseTransform(){this.#x.popBaseTransform();return this}recordSimpleData(t,e){this.#x.recordSimpleData(t,this.#y);return this}recordIncrementalData(t,e){this.#x.recordIncrementalData(t,this.#y);return this}resetIncrementalData(t,e){this.#x.resetIncrementalData(t,this.#y);return this}recordNamedData(t,e){return this}recordSimpleDataFromNamed(t,e,r){this.#x.recordSimpleDataFromNamed(t,e,this.#y);return this}recordFutureForcedDependency(t,e){this.#x.recordFutureForcedDependency(t,this.#y);return this}inheritSimpleDataAsFutureForcedDependencies(t){this.#x.inheritSimpleDataAsFutureForcedDependencies(t);return this}inheritPendingDependenciesAsFutureForcedDependencies(){this.#x.inheritPendingDependenciesAsFutureForcedDependencies();return this}resetBBox(t){this.#v||this.#x.resetBBox(this.#y);return this}recordClipBox(t,e,r,n,a,s){this.#v||this.#x.recordClipBox(this.#y,e,r,n,a,s);return this}recordBBox(t,e,r,n,a,s){this.#v||this.#x.recordBBox(this.#y,e,r,n,a,s);return this}recordCharacterBBox(t,e,r,n,a,s,i){this.#v||this.#x.recordCharacterBBox(this.#y,e,r,n,a,s,i);return this}recordFullPageBBox(t){this.#v||this.#x.recordFullPageBBox(this.#y);return this}getSimpleIndex(t){return this.#x.getSimpleIndex(t)}recordDependencies(t,e){this.#x.recordDependencies(this.#y,e);return this}recordNamedDependency(t,e){this.#x.recordNamedDependency(this.#y,e);return this}recordOperation(t){this.#x.recordOperation(this.#y,!0);return this}recordShowTextOperation(t){this.#x.recordShowTextOperation(this.#y,!0);return this}bboxToClipBoxDropOperation(t){this.#v||this.#x.bboxToClipBoxDropOperation(this.#y,!0);return this}take(){throw new Error("Unreachable")}takeDebugMetadata(){throw new Error("Unreachable")}}const Ir=["path","transform","filter","strokeColor","strokeAlpha","lineWidth","lineCap","lineJoin","miterLimit","dash"],Ar=["path","transform","filter","fillColor","fillAlpha","globalCompositeOperation","SMask"],Pr=["transform","SMask","filter","fillAlpha","strokeAlpha","globalCompositeOperation"],Dr=["filter","fillColor","fillAlpha"],Er=["transform","leading","charSpacing","wordSpacing","hScale","textRise","moveText","textMatrix","font","fontObj","filter","fillColor","textRenderingMode","SMask","fillAlpha","strokeAlpha","globalCompositeOperation","sameLineText"],Rr=["transform"],Nr=["transform","filter","fillColor"];class CanvasImagesTracker{#o;#c;#S=4;#C=0;#n=new CanvasImagesTracker.#T(6*this.#S);static#T=FeatureTest.isFloat16ArraySupported?Float16Array:Float32Array;constructor(t){this.#o=t.width;this.#c=t.height}record(t,e,r,n){if(this.#C===this.#S){this.#S*=2;const t=new CanvasImagesTracker.#T(6*this.#S);t.set(this.#n);this.#n=t}const a=getCurrentTransform(t);let s;if(n[0]!==1/0){const t=nr.slice();Util.axialAlignedBoundingBox([0,-r,e,0],a,t);const i=Util.intersect(n,t);if(!i)return;const[o,c,l,h]=i;if(o!==t[0]||c!==t[1]||l!==t[2]||h!==t[3]){const t=Math.atan2(a[1],a[0]),e=Math.abs(Math.sin(t)),r=Math.abs(Math.cos(t));if(e<1e-6||r<1e-6||Math.abs(e-r)<1e-6)s=[o,c,o,h,l,c];else{const t=l-o,n=h-c,a=e*e,i=r*r,u=r*e,p=i-a,d=(n*i-t*u)/p;s=[o+(n*u-t*a)/p,c,o,c+d,l,h-d]}}}if(!s){s=[0,-r,0,0,e,-r];Util.applyTransform(s,a,0);Util.applyTransform(s,a,2);Util.applyTransform(s,a,4)}s[0]/=this.#o;s[1]/=this.#c;s[2]/=this.#o;s[3]/=this.#c;s[4]/=this.#o;s[5]/=this.#c;this.#n.set(s,6*this.#C);this.#C++}take(){return this.#n.subarray(0,6*this.#C)}}function convertBlackAndWhiteToRGBA({src:t,srcPos:e=0,dest:r,width:n,height:a,nonBlackColor:s=4294967295,inverseDecode:i=!1}){const o=FeatureTest.isLittleEndian?4278190080:255,[c,l]=i?[s,o]:[o,s],h=n>>3,u=7&n,p=c^l,d=t.length;r=new Uint32Array(r.buffer);let f=0;for(let n=0;n<a;++n){for(const n=e+h;e<n;++e,f+=8){const n=t[e];r[f]=c^-(n>>7&1)&p;r[f+1]=c^-(n>>6&1)&p;r[f+2]=c^-(n>>5&1)&p;r[f+3]=c^-(n>>4&1)&p;r[f+4]=c^-(n>>3&1)&p;r[f+5]=c^-(n>>2&1)&p;r[f+6]=c^-(n>>1&1)&p;r[f+7]=c^-(1&n)&p}if(0===u)continue;const n=e<d?t[e++]:255;for(let t=0;t<u;++t,++f)r[f]=c^-(n>>7-t&1)&p}return{srcPos:e,destPos:f}}function convertRGBToRGBA({src:t,srcPos:e=0,dest:r,destPos:n=0,width:a,height:s}){let i=0;const o=a*s*3,c=t.byteOffset+e,l=c%4==0?Math.floor(math_clamp_MathClamp(t.length-e,0,o)/4):0,h=l>0?new Uint32Array(t.buffer,c,l):null,u=FeatureTest.isLittleEndian?4278190080:255;if(FeatureTest.isLittleEndian){for(;i<l-2;i+=3,n+=4){const t=h[i],e=h[i+1],a=h[i+2];r[n]=t|u;r[n+1]=t>>>24|e<<8|u;r[n+2]=e>>>16|a<<16|u;r[n+3]=a>>>8|u}for(let a=e+4*i,s=e+o;a<s;a+=3)r[n++]=t[a]|t[a+1]<<8|t[a+2]<<16|u}else{for(;i<l-2;i+=3,n+=4){const t=h[i],e=h[i+1],a=h[i+2];r[n]=t|u;r[n+1]=t<<24|e>>>8|u;r[n+2]=e<<16|a>>>16|u;r[n+3]=a<<8|u}for(let a=e+4*i,s=e+o;a<s;a+=3)r[n++]=t[a]<<24|t[a+1]<<16|t[a+2]<<8|u}return{srcPos:e+o,destPos:n}}const Lr=new class WebGPU{#M=null;#F=null;#B=null;#O=null;async#I(){if(!globalThis.navigator?.gpu)return!1;try{const t=await navigator.gpu.requestAdapter();if(!t)return!1;this.#O=navigator.gpu.getPreferredCanvasFormat();this.#F=await t.requestDevice();return!0}catch{return!1}}init(){return this.#M||=this.#I()}get isReady(){return null!==this.#F}loadMeshShader(){if(!this.#F||this.#B)return;const t=this.#F.createShaderModule({code:"\nstruct Uniforms {\n offsetX : f32,\n offsetY : f32,\n scaleX : f32,\n scaleY : f32,\n paddedWidth : f32,\n paddedHeight : f32,\n borderSize : f32,\n _pad : f32,\n};\n\n@group(0) @binding(0) var<uniform> u : Uniforms;\n\nstruct VertexInput {\n @location(0) position : vec2<f32>,\n @location(1) color : vec4<f32>,\n};\n\nstruct VertexOutput {\n @builtin(position) position : vec4<f32>,\n @location(0) color : vec3<f32>,\n};\n\n@vertex\nfn vs_main(in : VertexInput) -> VertexOutput {\n var out : VertexOutput;\n let cx = (in.position.x + u.offsetX) * u.scaleX;\n let cy = (in.position.y + u.offsetY) * u.scaleY;\n out.position = vec4<f32>(\n ((cx + u.borderSize) / u.paddedWidth) * 2.0 - 1.0,\n 1.0 - ((cy + u.borderSize) / u.paddedHeight) * 2.0,\n 0.0,\n 1.0\n );\n out.color = in.color.rgb;\n return out;\n}\n\n@fragment\nfn fs_main(in : VertexOutput) -> @location(0) vec4<f32> {\n return vec4<f32>(in.color, 1.0);\n}\n"});this.#B=this.#F.createRenderPipeline({layout:"auto",vertex:{module:t,entryPoint:"vs_main",buffers:[{arrayStride:8,attributes:[{shaderLocation:0,offset:0,format:"float32x2"}]},{arrayStride:4,attributes:[{shaderLocation:1,offset:0,format:"unorm8x4"}]}]},fragment:{module:t,entryPoint:"fs_main",targets:[{format:this.#O}]},primitive:{topology:"triangle-list"}})}draw(t,e,r,n,a,s,i,o){this.loadMeshShader();const c=this.#F,{offsetX:l,offsetY:h,scaleX:u,scaleY:p}=n,d=c.createBuffer({size:Math.max(t.byteLength,4),usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST});t.byteLength>0&&c.queue.writeBuffer(d,0,t);const f=c.createBuffer({size:Math.max(e.byteLength,4),usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST});e.byteLength>0&&c.queue.writeBuffer(f,0,e);const g=c.createBuffer({size:32,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST});c.queue.writeBuffer(g,0,new Float32Array([l,h,u,p,s,i,o,0]));const m=c.createBindGroup({layout:this.#B.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:g}}]}),_=new OffscreenCanvas(s,i),b=_.getContext("webgpu");b.configure({device:c,format:this.#O,alphaMode:a?"opaque":"premultiplied"});const x=a?{r:a[0]/255,g:a[1]/255,b:a[2]/255,a:1}:{r:0,g:0,b:0,a:0},y=c.createCommandEncoder(),v=y.beginRenderPass({colorAttachments:[{view:b.getCurrentTexture().createView(),clearValue:x,loadOp:"clear",storeOp:"store"}]});if(r>0){v.setPipeline(this.#B);v.setBindGroup(0,m);v.setVertexBuffer(0,d);v.setVertexBuffer(1,f);v.draw(r)}v.end();c.queue.submit([y.finish()]);d.destroy();f.destroy();g.destroy();return _.transferToImageBitmap()}};function initGPU(){return Lr.init()}function isGPUReady(){return Lr.isReady}const jr="Fill",qr="Stroke",Ur="Shading";function applyBoundingBox(t,e){if(!e)return;const r=e[2]-e[0],n=e[3]-e[1],a=new Path2D;a.rect(e[0],e[1],r,n);t.clip(a)}class BaseShadingPattern{matrix=null;isModifyingCurrentTransform(){return!1}getPattern(){unreachable("Abstract method `getPattern` called.")}}class RadialAxialShadingPattern extends BaseShadingPattern{constructor(t){super();this._type=t[1];this._bbox=t[2];this._colorStops=t[3];this._p0=t[4];this._p1=t[5];this._r0=t[6];this._r1=t[7]}isOriginBased(){return 0===this._p0[0]&&0===this._p0[1]&&(!this.isRadial()||0===this._p1[0]&&0===this._p1[1])}isRadial(){return"radial"===this._type}areConic(){if(!this.isRadial())return!1;const t=Math.hypot(this._p0[0]-this._p1[0],this._p0[1]-this._p1[1]);return t+this._r1>this._r0&&t+this._r0>this._r1}_createGradient(t,e=null){let r,n=this._p0,a=this._p1;if(e){n=n.slice();a=a.slice();Util.applyTransform(n,e);Util.applyTransform(a,e)}if("axial"===this._type)r=t.createLinearGradient(n[0],n[1],a[0],a[1]);else if("radial"===this._type){let s=this._r0,i=this._r1;if(e){const t=new Float32Array(2);Util.singularValueDecompose2dScale(e,t);s*=t[0];i*=t[0]}r=t.createRadialGradient(n[0],n[1],s,a[0],a[1],i)}for(const t of this._colorStops)r.addColorStop(t[0],t[1]);return r}_createReversedGradient(t,e=null){let r=this._p1,n=this._p0;if(e){r=r.slice();n=n.slice();Util.applyTransform(r,e);Util.applyTransform(n,e)}let a=this._r1,s=this._r0;if(e){const t=new Float32Array(2);Util.singularValueDecompose2dScale(e,t);a*=t[0];s*=t[0]}const i=t.createRadialGradient(r[0],r[1],a,n[0],n[1],s),o=this._colorStops.map(([t,e])=>[1-t,e]).reverse();for(const[t,e]of o)i.addColorStop(t,e);return i}_createRasterPattern(t,e,r,n,a,s){const i=Math.ceil(n[2]-n[0])||1,o=Math.ceil(n[3]-n[1])||1,c=e.canvasFactory.create(i,o),l=c.context;l.clearRect(0,0,i,o);l.beginPath();l.rect(0,0,i,o);l.translate(-n[0],-n[1]);r=Util.transform(r,[1,0,0,1,n[0],n[1]]);l.transform(...a);applyBoundingBox(l,this._bbox);if(this.areConic()){l.fillStyle=this._createReversedGradient(l);l.fill()}l.fillStyle=this._createGradient(l);l.fill();s?.applyToCanvas(l);const h=t.createPattern(c.canvas,"no-repeat");e.canvasFactory.destroy(c);h.setTransform(new DOMMatrix(r));return h}getPattern(t,e,r,n){const a=e.current.transferMapsFallback;if(n===qr||n===jr){if(this.isOriginBased()&&!a){let n=Util.transform(r,e.baseTransform);this.matrix&&(n=Util.transform(n,this.matrix));const a=.001,s=Math.hypot(n[0],n[1]),i=Math.hypot(n[2],n[3]),o=(n[0]*n[2]+n[1]*n[3])/(s*i);if(Math.abs(o)<a){if(!this.isRadial())return this._createGradient(t,n);if(Math.abs(s-i)<a)return this._createGradient(t,n)}}const s=e.current.getClippedPathBoundingBox(n,getCurrentTransform(t))||[0,0,0,0],i=this.matrix?Util.transform(e.baseTransform,this.matrix):e.baseTransform;return this._createRasterPattern(t,e,r,s,i,a)}if(a&&r)return this._createRasterPattern(t,e,r,e.current.clipBox,getCurrentTransform(t),a);if(this.areConic()){t.save();applyBoundingBox(t,this._bbox);t.fillStyle=this._createReversedGradient(t);t.fillRect(-1e10,-1e10,2e10,2e10);t.restore()}applyBoundingBox(t,this._bbox);return this._createGradient(t)}}function drawTriangle(t,e,r,n,a,s,i,o){const c=e.coords,l=e.colors,h=t.data,u=4*t.width;let p;if(c[2*r+1]>c[2*n+1]){p=r;r=n;n=p;p=s;s=i;i=p}if(c[2*n+1]>c[2*a+1]){p=n;n=a;a=p;p=i;i=o;o=p}if(c[2*r+1]>c[2*n+1]){p=r;r=n;n=p;p=s;s=i;i=p}const d=(c[2*r]+e.offsetX)*e.scaleX,f=(c[2*r+1]+e.offsetY)*e.scaleY,g=(c[2*n]+e.offsetX)*e.scaleX,m=(c[2*n+1]+e.offsetY)*e.scaleY,_=(c[2*a]+e.offsetX)*e.scaleX,b=(c[2*a+1]+e.offsetY)*e.scaleY;if(f>=b)return;const x=l[4*s],y=l[4*s+1],v=l[4*s+2],w=l[4*i],k=l[4*i+1],S=l[4*i+2],C=l[4*o],T=l[4*o+1],M=l[4*o+2],B=Math.round(f),O=Math.round(b);let I,A,P,D,E,R,N,L;for(let t=B;t<=O;t++){if(t<m){const e=t<f?0:(f-t)/(f-m);I=d-(d-g)*e;A=x-(x-w)*e;P=y-(y-k)*e;D=v-(v-S)*e}else{let e;e=t>b?1:m===b?0:(m-t)/(m-b);I=g-(g-_)*e;A=w-(w-C)*e;P=k-(k-T)*e;D=S-(S-M)*e}let e;e=t<f?0:t>b?1:(f-t)/(f-b);E=d-(d-_)*e;R=x-(x-C)*e;N=y-(y-T)*e;L=v-(v-M)*e;const r=Math.round(Math.min(I,E)),n=Math.round(Math.max(I,E));let a=u*t+4*r;for(let t=r;t<=n;t++){e=(I-t)/(I-E);e<0?e=0:e>1&&(e=1);h[a++]=A-(A-R)*e|0;h[a++]=P-(P-N)*e|0;h[a++]=D-(D-L)*e|0;h[a++]=255}}}class MeshShadingPattern extends BaseShadingPattern{constructor(t){super();this._posData=t[2];this._colData=t[3];this._vertexCount=t[4];this._bounds=t[5];this._bbox=t[6];this._background=t[7];!function loadMeshShader(){Lr.loadMeshShader()}()}_createMeshCanvas(t,e,r,n=null){const a=Math.floor(this._bounds[0]),s=Math.floor(this._bounds[1]),i=Math.ceil(this._bounds[2])-a,o=Math.ceil(this._bounds[3])-s,c=Math.min(Math.ceil(Math.abs(i*t[0]*1.1)),3e3)||1,l=Math.min(Math.ceil(Math.abs(o*t[1]*1.1)),3e3)||1,h=i?i/c:1,u=o?o/l:1,p={coords:this._posData,colors:this._colData,offsetX:-a,offsetY:-s,scaleX:1/h,scaleY:1/u},d=c+4,f=l+4,g=r.create(d,f);if(isGPUReady()&&this._vertexCount>48)g.context.drawImage(function drawMeshWithGPU(t,e,r,n,a,s,i,o){return Lr.draw(t,e,r,n,a,s,i,o)}(this._posData,this._colData,this._vertexCount,p,e,d,f,2),0,0);else{const t=g.context.createImageData(c,l);if(e){const r=t.data;for(let t=0,n=r.length;t<n;t+=4){r[t]=e[0];r[t+1]=e[1];r[t+2]=e[2];r[t+3]=255}}for(let e=0,r=this._vertexCount;e<r;e+=3)drawTriangle(t,p,e,e+1,e+2,e,e+1,e+2);g.context.putImageData(t,2,2)}n?.applyToCanvas(g.context);return{canvas:g.canvas,offsetX:a-2*h,offsetY:s-2*u,scaleX:h,scaleY:u}}isModifyingCurrentTransform(){return!0}getPattern(t,e,r,n){applyBoundingBox(t,this._bbox);const a=new Float32Array(2);if(n===Ur)Util.singularValueDecompose2dScale(getCurrentTransform(t),a);else if(this.matrix){Util.singularValueDecompose2dScale(this.matrix,a);const[t,r]=a;Util.singularValueDecompose2dScale(e.baseTransform,a);a[0]*=t;a[1]*=r}else Util.singularValueDecompose2dScale(e.baseTransform,a);const s=this._createMeshCanvas(a,n===Ur?null:this._background,e.canvasFactory,e.current.transferMapsFallback);if(n!==Ur){t.setTransform(...e.baseTransform);this.matrix&&t.transform(...this.matrix)}t.translate(s.offsetX,s.offsetY);t.scale(s.scaleX,s.scaleY);const i=t.createPattern(s.canvas,"no-repeat");e.canvasFactory.destroy(s);return i}}class DummyShadingPattern extends BaseShadingPattern{getPattern(){return"hotpink"}}const Gr=1,Wr=2;class TilingPattern{static MAX_PATTERN_SIZE=3e3;constructor(t,e,r,n){this.color=t[1];this.operatorList=t[2];this.matrix=t[3];this.bbox=t[4];this.xstep=t[5];this.ystep=t[6];this.paintType=t[7];this.tilingType=t[8];this.needsIsolation=t[9]??!0;this.ctx=e;this.canvasGraphicsFactory=r;this.baseTransform=n;this.patternBaseMatrix=this.matrix?Util.transform(n,this.matrix):n}canSkipPatternCanvas([t,e,r,n]){const[a,s,i,o]=this.bbox,c=Math.abs(this.xstep),l=Math.abs(this.ystep);if(t>c+1e-6||e>l+1e-6)return null;const h=Math.floor((r-i)/c)+1,u=Math.ceil((r+t-a)/c)-1,p=Math.floor((n-o)/l)+1,d=Math.ceil((n+e-s)/l)-1;return u<=h&&d<=p?[h,p]:null}updatePatternDims(t,e){const r=nr.slice();Util.axialAlignedBoundingBox(t,Util.inverseTransform(this.patternBaseMatrix),r);e[0]=r[2]-r[0];e[1]=r[3]-r[1];e[2]=r[0];e[3]=r[1]}_renderTileCanvas(t,e,r,n){const[a,s,i,o]=this.bbox,c=t.canvasFactory.create(r.size,n.size),l=c.context,h=this.canvasGraphicsFactory.createCanvasGraphics(l,e);h.groupLevel=t.groupLevel;h.current.transferMapsFallback=t.current.transferMapsFallback;this.setFillAndStrokeStyleToContext(h,this.paintType,this.color);l.translate(-r.scale*a,-n.scale*s);h.transform(0,r.scale,0,0,n.scale,0,0);l.save();h.dependencyTracker?.save();this.clipBbox(h,a,s,i,o);h.baseTransform=getCurrentTransform(h.ctx);h.executeOperatorList(this.operatorList);h.endDrawing();h.dependencyTracker?.restore();l.restore();return c}_getCombinedScales(){const t=new Float32Array(2);Util.singularValueDecompose2dScale(this.matrix,t);const[e,r]=t;Util.singularValueDecompose2dScale(this.baseTransform,t);return[e*t[0],r*t[1]]}drawPattern(t,e,r=!1,[n,a],s){const[i,o,c,l]=this.bbox,h=t.dependencyTracker;h&&(t.dependencyTracker=new CanvasNestedDependencyTracker(h,s));try{t.save();r?t.ctx.clip(e,"evenodd"):t.ctx.clip(e);t.ctx.setTransform(...this.patternBaseMatrix);t.ctx.translate(n*this.xstep,a*this.ystep);if(this.needsIsolation||1!==t.ctx.globalAlpha||"source-over"!==t.ctx.globalCompositeOperation||t.inSMaskMode){const e=c-i,r=l-o,[n,a]=this._getCombinedScales(),h=this.getSizeAndScale(e,this.ctx.canvas.width,n),u=this.getSizeAndScale(r,this.ctx.canvas.height,a),p=this._renderTileCanvas(t,s,h,u);t.ctx.drawImage(p.canvas,i,o,e,r);t.canvasFactory.destroy(p)}else{t.resetGraphicsState();this.setFillAndStrokeStyleToContext(t,this.paintType,this.color);this.clipBbox(t,i,o,c,l);t.baseTransformStack.push(t.baseTransform);t.baseTransform=getCurrentTransform(t.ctx);t.executeOperatorList(this.operatorList);t.baseTransform=t.baseTransformStack.pop()}t.restore()}finally{h&&(t.dependencyTracker=h)}}createPatternCanvas(t,e){const[r,n,a,s]=this.bbox,i=a-r,o=s-n;let{xstep:c,ystep:l}=this;c=Math.abs(c);l=Math.abs(l);info("TilingType: "+this.tilingType);const[h,u]=this._getCombinedScales();let p=i,d=o,f=!1,g=!1;Math.ceil(c*h)>=Math.ceil(i*h)?p=c:f=!0;Math.ceil(l*u)>=Math.ceil(o*u)?d=l:g=!0;const m=this.getSizeAndScale(p,this.ctx.canvas.width,h),_=this.getSizeAndScale(d,this.ctx.canvas.height,u),b=this._renderTileCanvas(t,e,m,_);if(f||g){const e=b.canvas;f&&(p=c);g&&(d=l);const a=this.getSizeAndScale(p,this.ctx.canvas.width,h),s=this.getSizeAndScale(d,this.ctx.canvas.height,u),m=a.size,_=s.size,x=t.canvasFactory.create(m,_),y=x.context,v=f?Math.min(Math.floor(i/c),Math.ceil(e.width/m)):0,w=g?Math.min(Math.floor(o/l),Math.ceil(e.height/_)):0;let k=e,S=null;if(g){S=t.canvasFactory.create(e.width,_);const r=S.context;for(let t=w;t>=0;t--)r.drawImage(e,0,_*t,e.width,_,0,0,e.width,_);k=S.canvas}for(let t=v;t>=0;t--)y.drawImage(k,m*t,0,m,_,0,0,m,_);S&&t.canvasFactory.destroy(S);t.canvasFactory.destroy(b);return{canvas:x.canvas,canvasEntry:x,scaleX:a.scale,scaleY:s.scale,offsetX:r,offsetY:n}}return{canvas:b.canvas,canvasEntry:b,scaleX:m.scale,scaleY:_.scale,offsetX:r,offsetY:n}}getSizeAndScale(t,e,r){const n=Math.max(TilingPattern.MAX_PATTERN_SIZE,e);let a=Math.ceil(t*r);a>=n?a=n:r=a/t;return{scale:r,size:a}}clipBbox(t,e,r,n,a){const s=n-e,i=a-r,o=new Path2D;o.rect(e,r,s,i);Util.axialAlignedBoundingBox([e,r,n,a],getCurrentTransform(t.ctx),t.current.minMax);t.ctx.clip(o);t.current.updateClipFromPath()}setFillAndStrokeStyleToContext(t,e,r){switch(e){case Gr:r="#000000";break;case Wr:break;default:throw new FormatError(`Unsupported paint type: ${e}`)}const{ctx:n,current:a}=t;a.patternFill=a.patternStroke=!1;n.fillStyle=n.strokeStyle=a.transferMapsFallback?.applyToColor(r)??r;a.fillColor=a.strokeColor=r}isModifyingCurrentTransform(){return!1}getPattern(t,e,r,n,a){const s=n!==Ur?Util.transform(r,this.patternBaseMatrix):r,i=this.createPatternCanvas(e,a);let o=new DOMMatrix(s);o=o.translate(i.offsetX,i.offsetY);o=o.scale(1/i.scaleX,1/i.scaleY);const c=t.createPattern(i.canvas,"repeat");e.canvasFactory.destroy(i.canvasEntry);c.setTransform(o);return c}}const zr=16,Hr=new Float32Array(2);function mirrorContextOperations(t,e){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");const r=new Map;for(const n of["save","restore","rotate","scale","translate","transform","setTransform","resetTransform","clip","moveTo","lineTo","bezierCurveTo","quadraticCurveTo","arc","arcTo","ellipse","rect","roundRect","closePath","beginPath"]){const a=t[n];if("function"==typeof a&&"function"==typeof e[n]){r.set(n,a);t[n]=function(...t){e[n](...t);return a.apply(this,t)}}}t._removeMirroring=()=>{for(const[e,n]of r)t[e]=n;delete t._removeMirroring}}function drawImageAtIntegerCoords(t,e,r,n,a,s,i,o,c,l){const[h,u,p,d,f,g]=getCurrentTransform(t);if(0===u&&0===p){const m=i*h+f,_=Math.round(m),b=o*d+g,x=Math.round(b),y=(i+c)*h+f,v=Math.abs(Math.round(y)-_)||1,w=(o+l)*d+g,k=Math.abs(Math.round(w)-x)||1;t.setTransform(Math.sign(h),0,0,Math.sign(d),_,x);t.drawImage(e,r,n,a,s,0,0,v,k);t.setTransform(h,u,p,d,f,g);return[v,k]}if(0===h&&0===d){const m=o*p+f,_=Math.round(m),b=i*u+g,x=Math.round(b),y=(o+l)*p+f,v=Math.abs(Math.round(y)-_)||1,w=(i+c)*u+g,k=Math.abs(Math.round(w)-x)||1;t.setTransform(0,Math.sign(u),Math.sign(p),0,_,x);t.drawImage(e,r,n,a,s,0,0,k,v);t.setTransform(h,u,p,d,f,g);return[k,v]}t.drawImage(e,r,n,a,s,i,o,c,l);return[Math.hypot(h,u)*c,Math.hypot(p,d)*l]}class CanvasExtraState{alphaIsShape=!1;fontSize=0;fontSizeScale=1;textMatrix=null;textMatrixScale=1;fontMatrix=sr;leading=0;x=0;y=0;lineX=0;lineY=0;charSpacing=0;wordSpacing=0;textHScale=1;textRenderingMode=cr;textRise=0;fillColor="#000000";strokeColor="#000000";tilingPatternDims=null;patternFill=!1;patternStroke=!1;fillAlpha=1;strokeAlpha=1;lineWidth=1;activeSMask=null;transferMaps="none";transferMapsFallback=null;minMax=ar.slice();constructor(t,e){this.clipBox=new Float32Array([0,0,t,e])}clone(){const t=Object.create(this);t.clipBox=this.clipBox.slice();t.minMax=this.minMax.slice();t.tilingPatternDims=this.tilingPatternDims?.slice();return t}getPathBoundingBox(t=jr,e=null){const r=this.minMax.slice();if(t===qr){e||unreachable("Stroke bounding box must include transform.");Util.singularValueDecompose2dScale(e,Hr);const t=Hr[0]*this.lineWidth/2,n=Hr[1]*this.lineWidth/2;r[0]-=t;r[1]-=n;r[2]+=t;r[3]+=n}return r}updateClipFromPath(){const t=Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(t){this.clipBox.set(t,0);this.minMax.set(ar,0)}getClippedPathBoundingBox(t=jr,e=null){return Util.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function putBinaryImageData(t,e){const{width:r,height:n,kind:a}=e,s=n%zr,i=(n-s)/zr,o=0===s?i:i+1,c=t.createImageData(r,zr);let l=0;const h=e.data,u=c.data;let p;if(a===fr)for(p=0;p<o;p++){({srcPos:l}=convertBlackAndWhiteToRGBA({src:h,srcPos:l,dest:u,width:r,height:p<i?zr:s}));t.putImageData(c,0,p*zr)}else if(a===mr){let e=0,n=r*zr*4;for(p=0;p<i;p++){u.set(h.subarray(l,l+n));l+=n;t.putImageData(c,0,e);e+=zr}if(p<o){n=r*s*4;u.set(h.subarray(l,l+n));t.putImageData(c,0,e)}}else{if(a!==gr)throw new Error(`bad image kind: ${a}`);for(p=0;p<o;p++){({srcPos:l}=convertRGBToRGBA({src:h,srcPos:l,dest:new Uint32Array(u.buffer),width:r,height:p<i?zr:s}));t.putImageData(c,0,p*zr)}}}function putBinaryImageMask(t,e){if(e.bitmap){t.drawImage(e.bitmap,0,0);return}const{width:r,height:n}=e,a=n%zr,s=(n-a)/zr,i=0===a?s:s+1,o=t.createImageData(r,zr);let c=0;const l=e.data,h=o.data;for(let e=0;e<i;e++){({srcPos:c}=convertBlackAndWhiteToRGBA({src:l,srcPos:c,dest:h,width:r,height:e<s?zr:a,nonBlackColor:0}));t.putImageData(o,0,e*zr)}}function copyCtxState(t,e){const r=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const n of r)void 0!==t[n]&&(e[n]=t[n]);if(void 0!==t.setLineDash){e.setLineDash(t.getLineDash());e.lineDashOffset=t.lineDashOffset}}function getAnnotationCanvasName(t){return t._pdfjsCanvasName??null}function resetCtxToDefault(t){t.strokeStyle=t.fillStyle="#000000";t.fillRule="nonzero";t.globalAlpha=1;t.lineWidth=1;t.lineCap="butt";t.lineJoin="miter";t.miterLimit=10;t.globalCompositeOperation="source-over";t.font="10px sans-serif";if(void 0!==t.setLineDash){t.setLineDash([]);t.lineDashOffset=0}const{filter:e}=t;"none"!==e&&""!==e&&(t.filter="none")}class TransferMapsFallback{#A;constructor(t){const[e,r=e,n=e]=t,a=Util.identity0to256Map.slice();this.#A=[e||a,r||a,n||a]}applyToColor(t){if("string"!=typeof t||!t.startsWith("#"))return t;const[e,r,n]=getRGBA(t),[a,s,i]=this.#A;return Util.makeHexColor(a[e],s[r],i[n])}applyToImageData({data:t}){const[e,r,n]=this.#A;for(let a=0,s=t.length;a<s;a+=4){t[a]=e[t[a]];t[a+1]=r[t[a+1]];t[a+2]=n[t[a+2]]}}applyToCanvas(t){const{width:e,height:r}=t.canvas,n=t.getImageData(0,0,e,r);this.applyToImageData(n);t.putImageData(n,0,0)}}function getImageSmoothingEnabled(t,e,r){if(e)return!0;Util.singularValueDecompose2dScale(t,Hr);const n=Math.fround(r*PixelsPerInch.PDF_TO_CSS_UNITS);return Hr[0]<=n&&Hr[1]<=n}const Xr=["butt","round","square"],Vr=["miter","round","bevel"],Yr={},$r={};class CanvasGraphics{static#P=null;static#D=new WeakMap;#E=0;#R=0;#N=null;#L=null;#j=null;#q=null;#U=1;#G;#W=null;#z=[];constructor(t,e,r,n,a,{optionalContentConfig:s,markedContentStack:i=null,pixelRatio:o=OutputScale.pixelRatio},c,l,h,u){this.ctx=t;this.current=new CanvasExtraState(this.ctx.canvas.width,this.ctx.canvas.height);this.stateStack=[];this.pendingClip=null;this.pendingEOFill=!1;this.commonObjs=e;this.objs=r;this.canvasFactory=n;this.filterFactory=a;this.groupStack=[];this.baseTransform=null;this.baseTransformStack=[];this.groupLevel=0;this.smaskStack=[];this.tempSMask=null;this.smaskGroupCanvases=[];this.smaskPreparedEntry=null;this.smaskPreparedFor=null;this.smaskPreparedOffsetX=0;this.smaskPreparedOffsetY=0;this.smaskPreparedOOBAlpha=null;this.suspendedCtx=null;this.contentVisible=!0;this.markedContentStack=i||[];this.optionalContentConfig=s;this.pixelRatio=o;this.cachedPatterns=new Map;this.annotationCanvasMap=c;this.viewportScale=1;this.outputScaleX=1;this.outputScaleY=1;this.pageColors=l;this._cachedScaleForStroking=[-1,0];this._cachedBitmapsMap=new Map;this.dependencyTracker=h??null;this.imagesTracker=u??null}getObject(t,e,r=null){if("string"==typeof e){this.dependencyTracker?.recordNamedDependency(t,e);return e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e)}return r}beginDrawing({transform:t,viewport:e,transparency:r=!1,background:n=null}){const a=this.ctx.canvas.width,s=this.ctx.canvas.height,i=this.ctx.fillStyle;this.ctx.fillStyle=n||"#ffffff";this.ctx.fillRect(0,0,a,s);this.ctx.fillStyle=i;if(r){const t=this.transparentCanvasEntry=this.canvasFactory.create(a,s);this.compositeCtx=this.ctx;({canvas:this.transparentCanvas,context:this.ctx}=t);this.ctx.save();this.ctx.transform(...getCurrentTransform(this.compositeCtx))}this.ctx.save();resetCtxToDefault(this.ctx);if(t){this.ctx.transform(...t);this.outputScaleX=t[0];this.outputScaleY=t[3]}this.ctx.transform(...e.transform);this.viewportScale=e.scale;this.baseTransform=getCurrentTransform(this.ctx)}executeOperatorList(t,e,r,n,a,s){const i=t.argsArray,o=t.fnArray,c=this._pathCache;this._pathCache=t.pathCache??CanvasGraphics.#D.getOrInsertComputed(t,makeMap);try{let c=e||0;const l=i.length;if(l===c)return c;const h=l-c>10&&"function"==typeof r,u=h?Date.now()+15:0;let p=0;const d=this.commonObjs,f=this.objs;let g,m;for(;;){if(void 0!==a){if(c===a.nextBreakPoint){a.breakIt(c,r);return c}if(a.shouldSkip(c)){if(++c===l)return c;continue}}if(!s||s(c,t)){g=o[c];m=i[c]??null;if(g!==xr.dependency)null===m?this[g](c):this[g](c,...m);else for(const t of m){this.dependencyTracker?.recordNamedData(t,c);const e=t.startsWith("g_")?d:f;if(!e.has(t)){e.get(t,r,n);return c}}}c++;if(c===l)return c;if(h&&++p>10){if(Date.now()>u){r();return c}p=0}}}finally{this._pathCache=c}}#H(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null;this.ctx.restore();if(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.canvasFactory.destroy(this.transparentCanvasEntry);this.transparentCanvas=null;this.transparentCanvasEntry=null}}endDrawing(){this.#H();for(const t of this.smaskGroupCanvases)this.canvasFactory.destroy(t);this.smaskGroupCanvases.length=0;this._clearPreparedSMask();this.tempSMask=null;this.smaskStack.length=0;for(const t of this.#z)this.#X(t);this.#z.length=0;this.#N=null;this.#L=null;this.#j=null;this.#q=null;this.#U=1;this.#W=null;this.#R=0;this.#E=0;this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const e of t.values())"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear();this.#V()}#V(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==t){const e=this.ctx.filter;this.ctx.filter=t;this.ctx.drawImage(this.ctx.canvas,0,0);this.ctx.filter=e}}}_scaleImage(t,e){const r=t.width??t.displayWidth,n=t.height??t.displayHeight,a=[];let s=Math.max(Math.hypot(e[0],e[1]),1),i=Math.max(Math.hypot(e[2],e[3]),1),o=r,c=n;for(;s>2&&o>1||i>2&&c>1;){let t=o,e=c;if(s>2&&o>1){t=Math.ceil(o/2);s/=o/t}if(i>2&&c>1){e=Math.ceil(c/2);i/=c/e}a.push({newWidth:t,newHeight:e});o=t;c=e}if(0===a.length)return{img:t,paintWidth:r,paintHeight:n,tmpCanvas:null};if(1===a.length){const{newWidth:e,newHeight:s}=a[0],i=this.canvasFactory.create(e,s);i.context.drawImage(t,0,0,r,n,0,0,e,s);return{img:i.canvas,paintWidth:e,paintHeight:s,tmpCanvas:i}}let l=this.canvasFactory.create(1,1),h=this.canvasFactory.create(1,1),u=r,p=n,d=t;for(const{newWidth:t,newHeight:e}of a){this.canvasFactory.reset(h,t,e);h.context.drawImage(d,0,0,u,p,0,0,t,e);[l,h]=[h,l];d=l.canvas;u=t;p=e}this.canvasFactory.destroy(h);return{img:l.canvas,paintWidth:u,paintHeight:p,tmpCanvas:l}}_createMaskCanvas(t,e){const r=this.ctx,{width:n,height:a}=e,s=this.current.patternFill,i=s?this.current.fillColor:r.fillStyle,o=getCurrentTransform(r);let c,l,h,u;if((e.bitmap||e.data)&&e.count>1){const r=e.bitmap||e.data.buffer;l=JSON.stringify(s?o:[o.slice(0,4),i]);c=this._cachedBitmapsMap.getOrInsertComputed(r,makeMap);const n=c.get(l);if(n&&!s){const e=Math.round(Math.min(o[0],o[2])+o[4]),r=Math.round(Math.min(o[1],o[3])+o[5]);this.dependencyTracker?.recordDependencies(t,Nr);return{canvas:n,offsetX:e,offsetY:r}}h=n}if(!h){u=this.canvasFactory.create(n,a);putBinaryImageMask(u.context,e)}let p=Util.transform(o,[1/n,0,0,-1/a,0,0]);p=Util.transform(p,[1,0,0,1,0,-a]);const d=ar.slice();Util.axialAlignedBoundingBox([0,0,n,a],p,d);const[f,g,m,_]=d,b=Math.round(m-f)||1,x=Math.round(_-g)||1,y=this.canvasFactory.create(b,x),v=y.context,w=f,k=g;v.translate(-w,-k);v.transform(...p);let S=null;if(!h){const t=this._scaleImage(u.canvas,getCurrentTransformInverse(v));h=t.img;S=t.tmpCanvas;if(h!==u.canvas){this.canvasFactory.destroy(u);u=null}if(c&&s){c.set(l,h);S=null;u=null}}v.imageSmoothingEnabled=getImageSmoothingEnabled(getCurrentTransform(v),e.interpolate,this.pixelRatio);drawImageAtIntegerCoords(v,h,0,0,h.width,h.height,0,0,n,a);S&&this.canvasFactory.destroy(S);u&&this.canvasFactory.destroy(u);v.globalCompositeOperation="source-in";const C=Util.transform(getCurrentTransformInverse(v),[1,0,0,1,-w,-k]);v.fillStyle=s?i.getPattern(r,this,C,jr,t):i;v.fillRect(0,0,n,a);c&&!s&&c.set(l,y.canvas);this.dependencyTracker?.recordDependencies(t,Nr);return{canvas:y.canvas,canvasEntry:c&&!s?null:y,offsetX:Math.round(w),offsetY:Math.round(k)}}setLineWidth(t,e){this.dependencyTracker?.recordSimpleData("lineWidth",t);e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1);this.current.lineWidth=e;this.ctx.lineWidth=e}setLineCap(t,e){this.dependencyTracker?.recordSimpleData("lineCap",t);this.ctx.lineCap=Xr[e]}setLineJoin(t,e){this.dependencyTracker?.recordSimpleData("lineJoin",t);this.ctx.lineJoin=Vr[e]}setMiterLimit(t,e){this.dependencyTracker?.recordSimpleData("miterLimit",t);this.ctx.miterLimit=e}setDash(t,e,r){this.dependencyTracker?.recordSimpleData("dash",t);const n=this.ctx;if(void 0!==n.setLineDash){n.setLineDash(e);n.lineDashOffset=r}}setRenderingIntent(t,e){}setFlatness(t,e){}setGState(t,e){for(const[r,n]of e)switch(r){case"LW":this.setLineWidth(t,n);break;case"LC":this.setLineCap(t,n);break;case"LJ":this.setLineJoin(t,n);break;case"ML":this.setMiterLimit(t,n);break;case"D":this.setDash(t,n[0],n[1]);break;case"RI":this.setRenderingIntent(t,n);break;case"FL":this.setFlatness(t,n);break;case"Font":this.setFont(t,n[0],n[1]);break;case"CA":this.dependencyTracker?.recordSimpleData("strokeAlpha",t);this.current.strokeAlpha=n;break;case"ca":this.dependencyTracker?.recordSimpleData("fillAlpha",t);this.ctx.globalAlpha=this.current.fillAlpha=n;break;case"BM":this.dependencyTracker?.recordSimpleData("globalCompositeOperation",t);this.ctx.globalCompositeOperation=n;break;case"SMask":this.dependencyTracker?.recordSimpleData("SMask",t);this.current.activeSMask=n?this.tempSMask:null;this.current.activeSMask&&(this.current.activeSMask.blendMode=this.ctx.globalCompositeOperation);this.tempSMask=null;this.checkSMaskState(t);break;case"TR":{this.dependencyTracker?.recordSimpleData("filter",t);let e=this.filterFactory.addFilter(n);this.ctx.filter=e;let r=null;if(n&&("none"===e||!FeatureTest.isCanvasFilterSupported||"none"===this.ctx.filter||""===this.ctx.filter)){this.ctx.filter=e="none";r=new TransferMapsFallback(n)}this.current.transferMaps=e;if(r||this.current.transferMapsFallback){this.current.transferMapsFallback=r;this.current.patternFill||(this.ctx.fillStyle=this.#Y(this.current.fillColor));this.current.patternStroke||(this.ctx.strokeStyle=this.#Y(this.current.strokeColor))}break}}}get inSMaskMode(){return!!this.suspendedCtx}_clearPreparedSMask(){if(this.smaskPreparedEntry){this.canvasFactory.destroy(this.smaskPreparedEntry);this.smaskPreparedEntry=null}this.smaskPreparedFor=null;this.smaskPreparedOffsetX=0;this.smaskPreparedOffsetY=0;this.smaskPreparedOOBAlpha=null}_ensurePreparedSMask(t){if(t!==this.smaskPreparedFor){this._clearPreparedSMask();this._prepareSMaskCanvas(t)}}checkSMaskState(t){const e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode(t):!this.current.activeSMask&&e?this.endSMaskMode():this.current.activeSMask&&e&&this._ensurePreparedSMask(this.current.activeSMask)}_prepareSMaskCanvas(t){const{canvas:e,subtype:r,backdrop:n,transferMap:a}=t,s="Luminosity"===r||"Alpha"===r&&a;if(!(s||"Luminosity"===r&&n)){this.smaskPreparedFor=t;return}let i;if("Luminosity"===r&&n){const[t,e,r]=getRGBA(n),s=Math.round(.3*t+.59*e+.11*r);i=a?.[s]??s}else i=a?.[0]??0;const{width:o,height:c}=this.ctx.canvas,l=o*c<4*(e.width*e.height),h=s?{url:"Alpha"===r?this.filterFactory.addAlphaFilter(a):this.filterFactory.addLuminosityFilter(a),subtype:r,transferMap:a}:null,u="Luminosity"===r?n:null;let p,d,f;if(l){p=this._bakeSMaskCanvas(e,t.offsetX,t.offsetY,o,c,u,h);d=0;f=0}else{p=this._bakeSMaskCanvas(e,0,0,e.width,e.height,u,h);d=t.offsetX;f=t.offsetY}this.smaskPreparedEntry=p;this.smaskPreparedFor=t;this.smaskPreparedOffsetX=d;this.smaskPreparedOffsetY=f;this.smaskPreparedOOBAlpha=l||0===i?null:i}_bakeSMaskCanvas(t,e,r,n,a,s,i){s||i||unreachable("_bakeSMaskCanvas with neither backdrop nor filter");const o=this.canvasFactory.create(n,a),c=o.context;c.drawImage(t,e,r);if(s){c.globalCompositeOperation="destination-atop";c.fillStyle=s;c.fillRect(0,0,n,a)}if(!i)return o;const l=this.canvasFactory.create(n,a),h=l.context;h.filter=i.url;const u=FeatureTest.isCanvasFilterSupported&&"none"!==h.filter&&""!==h.filter;h.drawImage(o.canvas,0,0);FeatureTest.isCanvasFilterSupported&&(h.filter="none");if(!u){const t=h.getImageData(0,0,n,a),{data:e}=t,{transferMap:r}=i;if("Luminosity"===i.subtype)for(let t=0,n=e.length;t<n;t+=4){const n=.3*e[t]+.59*e[t+1]+.11*e[t+2]+.5|0;e[t]=e[t+1]=e[t+2]=0;e[t+3]=r?.[n]??n}else for(let t=3,n=e.length;t<n;t+=4)e[t]=r[e[t]];h.putImageData(t,0,0)}this.canvasFactory.destroy(o);return l}beginSMaskMode(t){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const{width:e,height:r}=this.ctx.canvas,n=this.canvasFactory.create(e,r);this.smaskScratchCanvas=n;this.suspendedCtx=this.ctx;const a=this.ctx=n.context;a.setTransform(this.suspendedCtx.getTransform());copyCtxState(this.suspendedCtx,a);mirrorContextOperations(a,this.suspendedCtx);this._ensurePreparedSMask(this.current.activeSMask);this.setGState(t,[["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring();copyCtxState(this.ctx,this.suspendedCtx);this.ctx=this.suspendedCtx;this.suspendedCtx=null;this.canvasFactory.destroy(this.smaskScratchCanvas);this.smaskScratchCanvas=null;this._clearPreparedSMask()}#$(t,e=null,r=1){const{width:n,height:a}=t,s=e??this.canvasFactory.create(n,a),i=s.context,o=(r=Math.round(255*r)/255)<1;o&&void 0===this.#G&&(this.#G=FeatureTest.isCanvasFilterSupported?new Map:"none");let c="none";o&&this.#G instanceof Map&&(c=this.#G.getOrInsertComputed(r,()=>this.filterFactory.addKnockoutFilter(r)));if(!o||"none"!==c){if(e){i.save();i.setTransform(1,0,0,1,0,0);i.clearRect(0,0,n,a);i.restore()}i.filter=c;i.drawImage(t,0,0);i.filter="none";return s}const l=t.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,n,a),h=i.createImageData(n,a),u=l.data,p=h.data,d=r>0?1/r:1e6;for(let t=3,e=u.length;t<e;t+=4)p[t]=Math.min(Math.round(u[t]*d),255);i.putImageData(h,0,0);return s}#K(t,e,r,n){let a=t?.[e]??null;if(a&&(a.canvas.width!==r||a.canvas.height!==n)){this.canvasFactory.destroy(a);a=null}if(!a){a=this.canvasFactory.create(r,n);t&&(t[e]=a);return a}const s=a.context;s.save();s.setTransform(1,0,0,1,0,0);s.clearRect(0,0,r,n);s.restore();return a}#J(t,e,r={}){const{backdropCanvas:n=null,destTransform:a=[1,0,0,1,0,0],backdropOffset:s=[0,0],reuseMaskEntry:i=null,poolMeta:o=null,sourceAlpha:c=1,sourceFilter:l="none",knockoutAlpha:h=1}=r,{width:u,height:p}=e,d=this.#$(e,i,h),f=t.globalCompositeOperation;t.save();t.setTransform(...a);t.globalAlpha=1;FeatureTest.isCanvasFilterSupported&&(t.filter="none");t.globalCompositeOperation="destination-out";t.drawImage(d.canvas,0,0);if(n){const[e,r]=s,a=this.#K(o,"knockoutBackdropEntry",u,p),i=a.context;i.drawImage(n,e,r,u,p,0,0,u,p);i.globalCompositeOperation="destination-in";i.drawImage(d.canvas,0,0);i.globalCompositeOperation="source-over";t.globalCompositeOperation="destination-over";t.drawImage(a.canvas,0,0);o||this.canvasFactory.destroy(a)}t.globalCompositeOperation=f;t.globalAlpha=c;FeatureTest.isCanvasFilterSupported&&(t.filter=l??"none");t.drawImage(e,0,0);t.restore();i||this.canvasFactory.destroy(d)}#Z(t=1){if(0===this.#E||this.#R>0||!this.contentVisible)return!1;this.#R++;this.#U=t;const e=this.#z.at(-1),{canvas:r}=this.ctx,n=this.#K(e,"knockoutTempEntry",r.width,r.height);this.#N=n;const a=n.context;a.save();a.setTransform(this.ctx.getTransform());copyCtxState(this.ctx,a);this.#q=a.globalCompositeOperation;a.globalCompositeOperation="source-over";mirrorContextOperations(a,this.ctx);this.#W=e;this.#L=this.ctx;this.#j=this.suspendedCtx;this.ctx=a;this.inSMaskMode&&(this.suspendedCtx=a);return!0}#Q(t){if(!t)return;const e=this.#N,r=this.#L,n=this.#j,a=e.context;this.#N=null;this.#L=null;this.#j=null;this.inSMaskMode&&this.suspendedCtx===a&&this.ctx!==a&&this.endSMaskMode();this.inSMaskMode&&(this.suspendedCtx=n);this.ctx._removeMirroring();this.ctx.globalCompositeOperation=this.#q;this.#q=null;copyCtxState(this.ctx,r);this.ctx=r;const s=this.#W;this.#W=null;const i=this.#U;this.#U=1;try{this.#J(n??r,e.canvas,{backdropCanvas:s?.backdropCtx?.canvas??null,backdropOffset:s?.backdropCtx?[s.offsetX,s.offsetY]:[0,0],reuseMaskEntry:s?.knockoutMaskEntry??null,poolMeta:s,knockoutAlpha:i})}finally{a.restore();this.#R--;s||this.canvasFactory.destroy(e)}}compose(t){if(!this.current.activeSMask)return;t=t?[Math.floor(t[0]),Math.floor(t[1]),Math.ceil(t[2]),Math.ceil(t[3])]:[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const e=this.current.activeSMask,r=this.suspendedCtx,n=this.#R>0&&r===this.ctx;this.composeSMask(n?null:r,e,this.ctx,t);if(!n){this.ctx.save();this.ctx.setTransform(1,0,0,1,0,0);this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height);this.ctx.restore()}}composeSMask(t,e,r,n){const a=n[0],s=n[1],i=n[2]-a,o=n[3]-s;if(0===i||0===o)return;const c=this.smaskPreparedEntry;if(c){let t=a,n=s,l=i,h=o;const u=this.smaskPreparedOOBAlpha,p=null!==u;if(p){t=Math.max(a,e.offsetX);n=Math.max(s,e.offsetY);l=Math.min(a+i,e.offsetX+e.canvas.width)-t;h=Math.min(s+o,e.offsetY+e.canvas.height)-n}if(l>0&&h>0){const e=t-this.smaskPreparedOffsetX,a=n-this.smaskPreparedOffsetY;r.save();r.globalAlpha=1;r.setTransform(1,0,0,1,0,0);const s=new Path2D;s.rect(t,n,l,h);r.clip(s);r.globalCompositeOperation="destination-in";r.drawImage(c.canvas,e,a,l,h,t,n,l,h);r.restore()}p&&u<255&&this._applySMaskOOBAlpha(r,a,s,i,o,t,n,t+l,n+h,u)}else this.genericComposeSMask(e,r,i,o,a,s);if(t){t.save();t.globalAlpha=1;t.globalCompositeOperation=e.blendMode||"source-over";t.setTransform(1,0,0,1,0,0);t.drawImage(r.canvas,a,s,i,o,a,s,i,o);t.restore()}}_applySMaskOOBAlpha(t,e,r,n,a,s,i,o,c,l){const h=s<o&&i<c;if(h&&s===e&&i===r&&o===e+n&&c===r+a)return;const u=new Path2D;u.rect(e,r,n,a);h&&u.rect(s,i,o-s,c-i);t.save();t.globalAlpha=l/255;t.setTransform(1,0,0,1,0,0);t.clip(u,"evenodd");t.globalCompositeOperation="destination-in";t.fillStyle="#000000";t.fillRect(e,r,n,a);t.restore()}genericComposeSMask(t,e,r,n,a,s){const{context:i,offsetX:o,offsetY:c}=t;e.save();e.globalAlpha=1;e.setTransform(1,0,0,1,0,0);const l=new Path2D;l.rect(a,s,r,n);e.clip(l);e.globalCompositeOperation="destination-in";e.drawImage(i.canvas,a-o,s-c,r,n,a,s,r,n);e.restore()}save(t){this.inSMaskMode&&copyCtxState(this.ctx,this.suspendedCtx);this.ctx.save();const e=this.current;this.stateStack.push(e);this.current=e.clone();this.dependencyTracker?.save(t)}restore(t){this.dependencyTracker?.restore(t);if(0!==this.stateStack.length){this.current=this.stateStack.pop();this.ctx.restore();if(this.inSMaskMode){copyCtxState(this.suspendedCtx,this.ctx);this.ctx.setTransform(this.suspendedCtx.getTransform())}this.checkSMaskState(t);this.pendingClip=null;this._cachedScaleForStroking[0]=-1}else this.inSMaskMode&&this.endSMaskMode()}resetGraphicsState(){const{clipBox:t,transferMaps:e,transferMapsFallback:r}=this.current,n=this.current=new CanvasExtraState(0,0);n.clipBox=t;n.transferMaps=e;n.transferMapsFallback=r;const a=this.ctx;a.lineWidth=1;a.lineCap="butt";a.lineJoin="miter";a.miterLimit=10;if(void 0!==a.setLineDash){a.setLineDash([]);a.lineDashOffset=0}this._cachedScaleForStroking[0]=-1}transform(t,e,r,n,a,s,i){this.dependencyTracker?.recordIncrementalData("transform",t);this.ctx.transform(e,r,n,a,s,i);this._cachedScaleForStroking[0]=-1}constructPath(t,e,r,n){let a=this._pathCache.get(t);if(!n){if(!a){a=new Path2D;this._pathCache.set(t,a)}e!==xr.stroke&&e!==xr.closeStroke&&(this.current.tilingPatternDims=null);this[e](t,a);return}if(null!==this.dependencyTracker){const r=e===xr.stroke?this.current.lineWidth/2:0;this.dependencyTracker.resetBBox(t).recordBBox(t,this.ctx,n[0]-r,n[2]+r,n[1]-r,n[3]+r).recordDependencies(t,["transform"])}if(!a){a=makePathFromDrawOPS(r[0]);this._pathCache.set(t,a)}Util.axialAlignedBoundingBox(n,getCurrentTransform(this.ctx),this.current.minMax);const s=this.current.tilingPatternDims;if(s&&e!==xr.stroke&&e!==xr.closeStroke&&this.current.fillColor instanceof TilingPattern){const t=Util.intersect(this.current.clipBox,this.current.minMax);t?this.current.fillColor.updatePatternDims(t,s):this.current.tilingPatternDims=null}this[e](t,a);this._pathStartIdx=t}closePath(t){this.ctx.closePath()}stroke(t,e,r=!0){const n=r&&this.#Z(this.current.strokeAlpha),a=this.ctx,s=this.current.strokeColor;a.globalAlpha=this.current.strokeAlpha;if(this.contentVisible)if("object"==typeof s&&s?.getPattern){const r=s.isModifyingCurrentTransform()?a.getTransform():null;a.save();a.strokeStyle=s.getPattern(a,this,getCurrentTransformInverse(a),qr,t);if(r){const t=new Path2D;t.addPath(e,a.getTransform().invertSelf().multiplySelf(r));e=t}this.rescaleAndStroke(e,!1);a.restore()}else this.rescaleAndStroke(e,!0);this.dependencyTracker?.recordDependencies(t,Ir);r&&this.consumePath(t,e,this.current.getClippedPathBoundingBox(qr,getCurrentTransform(this.ctx)));a.globalAlpha=this.current.fillAlpha;this.#Q(n)}closeStroke(t,e){this.stroke(t,e)}fill(t,e,r=!0){const n=r&&this.#Z(this.current.fillAlpha),a=this.ctx,s=this.current.fillColor,i=this.current.patternFill;let o=!1;const c=this.current.getClippedPathBoundingBox();this.dependencyTracker?.recordDependencies(t,Ar);if(i){const i=this.current.tilingPatternDims,l=i&&s.canSkipPatternCanvas(i);if(l){const{pendingClip:a,pendingEOFill:i}=this;this.pendingClip=null;this.pendingEOFill=!1;s.drawPattern(this,e,i,l,t);this.pendingClip=a;r&&this.consumePath(t,e,c);this.current.tilingPatternDims=null;this.#Q(n);return}const h=s.isModifyingCurrentTransform()?a.getTransform():null;this.dependencyTracker?.save(t);a.save();a.fillStyle=s.getPattern(a,this,getCurrentTransformInverse(a),jr,t);if(h){const t=new Path2D;t.addPath(e,a.getTransform().invertSelf().multiplySelf(h));e=t}o=!0}if(this.contentVisible&&null!==c)if(this.pendingEOFill){a.fill(e,"evenodd");this.pendingEOFill=!1}else a.fill(e);if(o){a.restore();this.dependencyTracker?.restore(t)}r&&this.consumePath(t,e,c);this.#Q(n)}eoFill(t,e){this.pendingEOFill=!0;this.fill(t,e)}fillStroke(t,e){const r=this.#Z(Math.min(this.current.fillAlpha,this.current.strokeAlpha));this.fill(t,e,!1);this.stroke(t,e,!1);this.consumePath(t,e);this.#Q(r)}eoFillStroke(t,e){this.pendingEOFill=!0;this.fillStroke(t,e)}closeFillStroke(t,e){this.fillStroke(t,e)}closeEOFillStroke(t,e){this.pendingEOFill=!0;this.fillStroke(t,e)}endPath(t,e){this.consumePath(t,e)}rawFillPath(t,e){const r=this.#Z(this.current.fillAlpha);this.ctx.fill(e);this.dependencyTracker?.recordDependencies(t,Dr).recordOperation(t);this.#Q(r)}clip(t){this.dependencyTracker?.recordFutureForcedDependency("clipMode",t);this.pendingClip=Yr}eoClip(t){this.dependencyTracker?.recordFutureForcedDependency("clipMode",t);this.pendingClip=$r}beginText(t){this.current.textMatrix=null;this.current.textMatrixScale=1;this.current.x=this.current.lineX=0;this.current.y=this.current.lineY=0;this.dependencyTracker?.recordOpenMarker(t).resetIncrementalData("sameLineText").resetIncrementalData("moveText",t)}endText(t){const e=this.pendingTextPaths,r=this.ctx;if(this.dependencyTracker){const{dependencyTracker:r}=this;void 0!==e&&r.recordFutureForcedDependency("textClip",r.getOpenMarker()).recordFutureForcedDependency("textClip",t);r.recordCloseMarker(t)}if(void 0!==e){const t=new Path2D,n=r.getTransform().invertSelf();for(const{transform:r,x:a,y:s,fontSize:i,path:o}of e)o&&t.addPath(o,new DOMMatrix(r).preMultiplySelf(n).translate(a,s).scale(i,-i));r.clip(t)}delete this.pendingTextPaths}setCharSpacing(t,e){this.dependencyTracker?.recordSimpleData("charSpacing",t);this.current.charSpacing=e}setWordSpacing(t,e){this.dependencyTracker?.recordSimpleData("wordSpacing",t);this.current.wordSpacing=e}setHScale(t,e){this.dependencyTracker?.recordSimpleData("hScale",t);this.current.textHScale=e/100}setLeading(t,e){this.dependencyTracker?.recordSimpleData("leading",t);this.current.leading=-e}setFont(t,e,r){this.dependencyTracker?.recordSimpleData("font",t).recordSimpleDataFromNamed("fontObj",e,t);const n=this.commonObjs.get(e),a=this.current;if(!n)throw new Error(`Can't find font for ${e}`);a.fontMatrix=n.fontMatrix||sr;0!==a.fontMatrix[0]&&0!==a.fontMatrix[3]||warn("Invalid font matrix for font "+e);if(r<0){r=-r;a.fontDirection=-1}else a.fontDirection=1;this.current.font=n;this.current.fontSize=r;if(n.isType3Font)return;const s=n.loadedName||"sans-serif",i=n.systemFontInfo?.css||`"${s}", ${n.fallbackName}`;let o="normal";n.black?o="900":n.bold&&(o="bold");const c=n.italic?"italic":"normal",l=math_clamp_MathClamp(r,16,100);this.current.fontSizeScale=r/l;this.ctx.font=`${c} ${o} ${l}px ${i}`}setTextRenderingMode(t,e){this.dependencyTracker?.recordSimpleData("textRenderingMode",t);this.current.textRenderingMode=e}setTextRise(t,e){this.dependencyTracker?.recordSimpleData("textRise",t);this.current.textRise=e}moveText(t,e,r){this.dependencyTracker?.resetIncrementalData("sameLineText").recordIncrementalData("moveText",t);this.current.x=this.current.lineX+=e;this.current.y=this.current.lineY+=r}setLeadingMoveText(t,e,r){this.setLeading(t,-r);this.moveText(t,e,r)}setTextMatrix(t,e){this.dependencyTracker?.resetIncrementalData("sameLineText").recordSimpleData("textMatrix",t);const{current:r}=this;r.textMatrix=e;r.textMatrixScale=Math.hypot(e[0],e[1]);r.x=r.lineX=0;r.y=r.lineY=0}nextLine(t){this.moveText(t,0,this.current.leading);this.dependencyTracker?.recordIncrementalData("moveText",this.dependencyTracker.getSimpleIndex("leading")??t)}#tt(t,e,r){const n=new Path2D;n.addPath(t,new DOMMatrix(r).invertSelf().multiplySelf(e));return n}paintChar(t,e,r,n,a,s){const i=this.ctx,o=this.current,c=o.font,l=o.textRenderingMode,h=o.fontSize/o.fontSizeScale,u=l&pr,p=!!(l&dr),d=o.patternFill&&!c.missingFile,f=o.patternStroke&&!c.missingFile;let g;(c.disableFontFace||p||d||f)&&!c.missingFile&&(g=c.getPathGenerator(this.commonObjs,e));if(g&&(c.disableFontFace||d||f)){i.save();i.translate(r,n);i.scale(h,-h);this.dependencyTracker?.recordCharacterBBox(t,i,c);let e;if(u===cr||u===hr)if(a){e=i.getTransform();i.setTransform(...a);const t=this.#tt(g,e,a);i.fill(t)}else i.fill(g);if(u===lr||u===hr)if(s){e||=i.getTransform();i.setTransform(...s);const{a:t,b:r,c:n,d:a}=e,o=Util.inverseTransform(s),c=Util.transform([t,r,n,a,0,0],o);Util.singularValueDecompose2dScale(c,Hr);i.lineWidth*=Math.max(Hr[0],Hr[1])/h;i.stroke(this.#tt(g,e,s))}else{i.lineWidth/=h;i.stroke(g)}i.restore()}else{if(u===cr||u===hr){i.fillText(e,r,n);this.dependencyTracker?.recordCharacterBBox(t,i,c,h,r,n,()=>i.measureText(e))}if(u===lr||u===hr){this.dependencyTracker&&this.dependencyTracker?.recordCharacterBBox(t,i,c,h,r,n,()=>i.measureText(e)).recordDependencies(t,Ir);i.strokeText(e,r,n)}}if(p){(this.pendingTextPaths||=[]).push({transform:getCurrentTransform(i),x:r,y:n,fontSize:h,path:g});this.dependencyTracker?.recordCharacterBBox(t,i,c,h,r,n)}}get isFontSubpixelAAEnabled(){const t=this.canvasFactory.create(10,10),e=t.context;e.scale(1.5,1);e.fillText("I",0,10);const r=e.getImageData(0,0,10,10).data;this.canvasFactory.destroy(t);let n=!1;for(let t=3;t<r.length;t+=4)if(r[t]>0&&r[t]<255){n=!0;break}return util_shadow(this,"isFontSubpixelAAEnabled",n)}#et(t,e,r){const n=this.ctx;n.save();const a=t.getPattern(n,this,getCurrentTransformInverse(n),e,r),s=getCurrentTransform(n);n.restore();return[a,s]}showText(t,e){if(this.dependencyTracker){this.dependencyTracker.recordDependencies(t,Er).resetBBox(t);this.current.textRenderingMode&dr&&this.dependencyTracker.recordFutureForcedDependency("textClip",t).inheritPendingDependenciesAsFutureForcedDependencies()}const r=this.current,n=r.font;if(n.isType3Font){const n=this.#Z(r.fillAlpha);this.showType3Text(t,e);this.dependencyTracker?.recordShowTextOperation(t);this.#Q(n);return}const a=r.fontSize;if(0===a){this.dependencyTracker?.recordOperation(t);return}const s=this.#Z(r.fillAlpha),i=this.ctx,o=r.fontSizeScale,c=r.charSpacing,l=r.wordSpacing,h=r.fontDirection,u=r.textHScale*h,p=e.length,d=n.vertical,f=d?1:-1,g=a*r.fontMatrix[0],m=r.textRenderingMode===cr&&!n.disableFontFace&&!r.patternFill;i.save();r.textMatrix&&i.transform(...r.textMatrix);i.translate(r.x,r.y+r.textRise);h>0?i.scale(u,-1):i.scale(u,1);let _,b;const x=r.textRenderingMode&pr,y=x===cr||x===hr,v=x===lr||x===hr;let w=r.lineWidth;const k=r.textMatrixScale;0===k||0===w?v&&(w=this.getSinglePixelWidth()):w/=k;if(1!==o){i.scale(o,o);w/=o}i.lineWidth=w;y&&r.patternFill&&([i.fillStyle,_]=this.#et(r.fillColor,jr,t));v&&r.patternStroke&&([i.strokeStyle,b]=this.#et(r.strokeColor,qr,t));if(n.isInvalidPDFjsFont){const n=[];let a=0;for(const t of e){n.push(t.unicode);a+=t.width}const o=n.join("");i.fillText(o,0,0);if(null!==this.dependencyTracker){const e=i.measureText(o);this.dependencyTracker.recordBBox(t,this.ctx,-e.actualBoundingBoxLeft,e.actualBoundingBoxRight,-e.actualBoundingBoxAscent,e.actualBoundingBoxDescent).recordShowTextOperation(t)}r.x+=a*g*u;i.restore();this.compose();this.#Q(s);return}let S,C=0,T=null;for(S=0;S<p;++S){const s=e[S];if("number"==typeof s){C+=f*s*a/1e3;continue}let u=!1;const p=(s.isSpace?l:0)+c,x=s.fontChar,y=s.accent;let v,w,k,M=s.width;if(d){const t=s.vmetric,e=-t[1]*g,r=t[2]*g;M=-t[0];v=e/o;w=(C+r)/o;if(s.isRotated){k=i.measureText(x);const t=g/o,e=s.width/2*t,r=v+e;v=w-380*t-e;w=(k.actualBoundingBoxAscent-k.actualBoundingBoxDescent)/2-r;u=!0;i.save();i.rotate(Math.PI/2)}}else{v=C/o;w=0}const B=s.isRotated?s.width:M;let O=1;if((n.remeasure||s.isRotated)&&B>0){k??=i.measureText(x);const t=1e3*k.width/a*o;if(B<t&&this.isFontSubpixelAAEnabled){O=B/t;if(!u){u=!0;i.save()}i.scale(O,1);v/=O}else B!==t&&(v+=(B-t)/2e3*a/o)}if(u&&n.missingFile&&(_||b)){T||=new Map;[i.fillStyle,i.strokeStyle]=T.getOrInsertComputed(s.isRotated?-O:O,()=>[_?this.#et(r.fillColor,jr,t)[0]:i.fillStyle,b?this.#et(r.strokeColor,qr,t)[0]:i.strokeStyle])}if(this.contentVisible&&(s.isInFont||n.missingFile))if(m&&!y){i.fillText(x,v,w);this.dependencyTracker?.recordCharacterBBox(t,i,k?{bbox:null}:n,a/o,v,w,()=>k??i.measureText(x))}else{this.paintChar(t,x,v,w,_,b);if(y){const e=v+a*y.offset.x/o,r=w-a*y.offset.y/o;this.paintChar(t,y.fontChar,e,r,_,b)}}C+=d?M*g-p*h:M*g+p*h;u&&i.restore()}d?r.y-=C:r.x+=C*u;i.restore();this.compose();this.dependencyTracker?.recordShowTextOperation(t);this.#Q(s)}showType3Text(t,e){const r=this.ctx,n=this.current,a=n.font,s=n.fontSize,i=n.fontDirection,o=a.vertical?1:-1,c=n.charSpacing,l=n.wordSpacing,h=n.textHScale*i,u=n.fontMatrix||sr,p=e.length,d=n.textRenderingMode!==ur;let f,g,m,_;if(0===s)return;this._cachedScaleForStroking[0]=-1;r.save();n.textMatrix&&r.transform(...n.textMatrix);r.translate(n.x,n.y+n.textRise);r.scale(h,i);const b=this.dependencyTracker;this.dependencyTracker=b?new CanvasNestedDependencyTracker(b,t):null;try{for(f=0;f<p;++f){g=e[f];if("number"==typeof g){_=o*g*s/1e3;this.ctx.translate(_,0);n.x+=_*h;continue}const t=(g.isSpace?l:0)+c,p=a.charProcOperatorList.get(g.operatorListId);if(p){if(this.contentVisible&&d){this.save();r.scale(s,s);r.transform(...u);this.executeOperatorList(p);this.restore()}}else warn(`Type3 character "${g.operatorListId}" is not available.`);m=g.width*u[0]*s+t*i;r.translate(m,0);n.x+=m*h}}finally{b&&(this.dependencyTracker=b)}r.restore()}setCharWidth(t,e,r){}setCharWidthAndBounds(t,e,r,n,a,s,i){const o=new Path2D;o.rect(n,a,s-n,i-a);this.ctx.clip(o);this.dependencyTracker?.recordBBox(t,this.ctx,n,s,a,i).recordClipBox(t,this.ctx,n,s,a,i);this.endPath(t)}getColorN_Pattern(t,e){let r;if("TilingPattern"===e[0]){const t=this.baseTransform||getCurrentTransform(this.ctx),n={createCanvasGraphics:(t,e)=>new CanvasGraphics(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack,pixelRatio:this.pixelRatio},void 0,void 0,this.dependencyTracker?new CanvasNestedDependencyTracker(this.dependencyTracker,e,!0):null)};r=new TilingPattern(e,this.ctx,n,t)}else r=this._getPattern(t,e[1],e[2]);return r}setStrokeColorN(t,...e){this.dependencyTracker?.recordSimpleData("strokeColor",t);this.current.strokeColor=this.getColorN_Pattern(t,e);this.current.patternStroke=!0}setFillColorN(t,...e){this.dependencyTracker?.recordSimpleData("fillColor",t);const r=this.current.fillColor=this.getColorN_Pattern(t,e);this.current.patternFill=!0;this.current.tilingPatternDims=r instanceof TilingPattern?[0,0,0,0]:null}#Y(t){return this.current.transferMapsFallback?.applyToColor(t)??t}setStrokeRGBColor(t,e){this.dependencyTracker?.recordSimpleData("strokeColor",t);this.current.strokeColor=e;this.ctx.strokeStyle=this.#Y(e);this.current.patternStroke=!1}setStrokeTransparent(t){this.dependencyTracker?.recordSimpleData("strokeColor",t);this.ctx.strokeStyle=this.current.strokeColor="transparent";this.current.patternStroke=!1}setFillRGBColor(t,e){this.dependencyTracker?.recordSimpleData("fillColor",t);this.current.fillColor=e;this.ctx.fillStyle=this.#Y(e);this.current.patternFill=!1;this.current.tilingPatternDims=null}setFillTransparent(t){this.dependencyTracker?.recordSimpleData("fillColor",t);this.ctx.fillStyle=this.current.fillColor="transparent";this.current.patternFill=!1;this.current.tilingPatternDims=null}_getPattern(t,e,r=null){const n=this.cachedPatterns.getOrInsertComputed(e,()=>function getShadingPattern(t){switch(t[0]){case"RadialAxial":return new RadialAxialShadingPattern(t);case"Mesh":return new MeshShadingPattern(t);case"Dummy":return new DummyShadingPattern}throw new Error(`Unknown IR type: ${t[0]}`)}(this.getObject(t,e)));r&&(n.matrix=r);return n}shadingFill(t,e){if(!this.contentVisible)return;const r=this.#Z(this.current.fillAlpha),n=this.ctx;this.save(t);const a=this._getPattern(t,e);n.fillStyle=a.getPattern(n,this,getCurrentTransformInverse(n),Ur,t);const s=getCurrentTransformInverse(n);if(s){const{width:t,height:e}=n.canvas,r=ar.slice();Util.axialAlignedBoundingBox([0,0,t,e],s,r);const[a,i,o,c]=r;this.ctx.fillRect(a,i,o-a,c-i)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.dependencyTracker?.resetBBox(t).recordFullPageBBox(t).recordDependencies(t,Rr).recordDependencies(t,Ar).recordOperation(t);this.compose(this.current.getClippedPathBoundingBox());this.restore(t);this.#Q(r)}beginInlineImage(){unreachable("Should not call beginInlineImage")}beginImageData(){unreachable("Should not call beginImageData")}paintFormXObjectBegin(t,e,r){if(this.contentVisible){this.save(t);this.baseTransformStack.push(this.baseTransform);e&&this.transform(t,...e);this.baseTransform=getCurrentTransform(this.ctx);if(r){Util.axialAlignedBoundingBox(r,this.baseTransform,this.current.minMax);const[e,n,a,s]=r,i=new Path2D;i.rect(e,n,a-e,s-n);this.ctx.clip(i);this.dependencyTracker?.recordClipBox(t,this.ctx,e,a,n,s);this.endPath(t)}}}paintFormXObjectEnd(t){if(this.contentVisible){this.restore(t);this.baseTransform=this.baseTransformStack.pop()}}beginGroup(t,e){if(!this.contentVisible)return;this.save(t);const{inSMaskMode:r}=this;if(r){this.endSMaskMode();this.current.activeSMask=null}const n=this.ctx;if(!(e.needsIsolation&&(e.isolated||e.hasSoftMask)||e.knockout||e.isGray||0!==this.#E||1!==n.globalAlpha||"source-over"!==n.globalCompositeOperation||r)){if(e.bbox){let t=new Path2D;const[r,a,s,i]=e.bbox;t.rect(r,a,s-r,i-a);if(e.matrix){const r=new Path2D;r.addPath(t,new DOMMatrix(e.matrix));t=r}n.clip(t)}this.groupStack.push(null);this.#z.push(null);this.groupLevel++;return}e.isolated||e.knockout||0!==this.#E||info("TODO: Fully support non-isolated non-knockout groups.");const a=getCurrentTransform(n);e.matrix&&n.transform(...e.matrix);const s=[0,0,n.canvas.width,n.canvas.height];let i;if(e.bbox){i=ar.slice();Util.axialAlignedBoundingBox(e.bbox,getCurrentTransform(n),i);i=Util.intersect(i,s)||[0,0,0,0]}else i=s;const o=Math.floor(i[0]),c=Math.floor(i[1]),l=Math.max(Math.ceil(i[2])-o,1),h=Math.max(Math.ceil(i[3])-c,1);this.current.startNewPathAndClipBox([0,0,l,h]);const u=this.canvasFactory.create(l,h);e.smask&&this.smaskGroupCanvases.push(u);const p=u.context,d=e.knockout&&!e.isolated?n:null,f=!e.isolated&&!e.knockout&&!e.smask&&e.needsIsolation&&this.#E>0,g=e.knockout?this.canvasFactory.create(l,h):null,m=this.#E;e.knockout?this.#E++:this.#E=0;p.translate(-o,-c);p.transform(...a);const _=!e.isolated&&!e.smask&&e.needsIsolation,b=_&&!r&&0===m&&!e.knockout&&!e.isGray&&e.hasSoftMask&&1===n.globalAlpha&&"source-over"===n.globalCompositeOperation&&"none"===this.current.transferMaps&&!this.current.transferMapsFallback;if(_&&(r||b)){p.save();p.setTransform(1,0,0,1,0,0);p.drawImage(n.canvas,-o,-c);p.restore()}if(e.bbox){let t=new Path2D;const[r,n,a,s]=e.bbox;t.rect(r,n,a-r,s-n);if(e.matrix){const r=new Path2D;r.addPath(t,new DOMMatrix(e.matrix));t=r}p.clip(t)}e.smask&&this.smaskStack.push({canvas:u.canvas,context:p,offsetX:o,offsetY:c,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null});if(!e.smask||this.dependencyTracker){n.setTransform(1,0,0,1,0,0);n.translate(o,c);n.save()}copyCtxState(n,p);this.ctx=p;this.dependencyTracker?.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha","strokeAlpha","globalCompositeOperation"]).pushBaseTransform(n);this.setGState(t,[["BM","source-over"],["ca",1],["CA",1],["TR",null]]);this.groupStack.push(n);this.#z.push({backdropCtx:d,savedKnockoutLevel:m,offsetX:o,offsetY:c,hasInnerBackdrop:f,replaceBackdrop:b,knockoutMaskEntry:g,knockoutTempEntry:null,knockoutBackdropEntry:null});this.groupLevel++}endGroup(t,e){if(!this.contentVisible)return;this.groupLevel--;const r=this.ctx,n=this.groupStack.pop(),a=this.#z.pop();a&&(this.#E=a.savedKnockoutLevel);if(null!==n){e.isGray&&this.#rt(r);this.ctx=n;this.ctx.imageSmoothingEnabled=!1;this.dependencyTracker?.popBaseTransform();if(e.smask){this.tempSMask=this.smaskStack.pop();this.restore(t);if(this.dependencyTracker){this.ctx.restore();this.inSMaskMode&&this.ctx.setTransform(this.suspendedCtx.getTransform())}this.#X(a)}else{this.ctx.restore();const e=getCurrentTransform(this.ctx);this.restore(t);this.current.transferMapsFallback?.applyToCanvas(r);this.ctx.save();this.ctx.setTransform(...e);const s=ar.slice();Util.axialAlignedBoundingBox([0,0,r.canvas.width,r.canvas.height],e,s);const i=this.#z.at(-1);if(this.#E>0)if(a.hasInnerBackdrop){const{width:t,height:s}=r.canvas,i=this.canvasFactory.create(t,s),o=i.context;o.drawImage(n.canvas,a.offsetX,a.offsetY,t,s,0,0,t,s);o.globalCompositeOperation="source-over";o.drawImage(r.canvas,0,0);const c=this.#$(r.canvas);o.globalCompositeOperation="destination-in";o.drawImage(c.canvas,0,0);const l=this.ctx.globalCompositeOperation,h=this.ctx.globalAlpha,u=this.ctx.filter;this.ctx.save();this.ctx.setTransform(...e);this.ctx.globalAlpha=1;FeatureTest.isCanvasFilterSupported&&(this.ctx.filter="none");this.ctx.globalCompositeOperation="destination-out";this.ctx.drawImage(c.canvas,0,0);this.ctx.globalCompositeOperation=l;this.ctx.globalAlpha=h;FeatureTest.isCanvasFilterSupported&&(this.ctx.filter=u??"none");this.ctx.drawImage(i.canvas,0,0);this.ctx.restore();this.canvasFactory.destroy(c);this.canvasFactory.destroy(i)}else{const t=i?.backdropCtx??null;this.#J(this.ctx,r.canvas,{backdropCanvas:t?.canvas??null,destTransform:e,backdropOffset:t?[i.offsetX+a.offsetX,i.offsetY+a.offsetY]:[0,0],sourceAlpha:this.ctx.globalAlpha,sourceFilter:this.ctx.filter})}else{if(a.replaceBackdrop){const t=new Path2D;t.rect(0,0,r.canvas.width,r.canvas.height);this.ctx.clip(t);this.ctx.globalCompositeOperation="copy"}this.ctx.drawImage(r.canvas,0,0)}this.ctx.restore();this.canvasFactory.destroy({canvas:r.canvas,context:r});this.#X(a);this.compose(s)}}else this.restore(t)}#rt(t){const{canvas:e}=t,{width:r,height:n}=e;if(FeatureTest.isCanvasFilterSupported){t.save();t.setTransform(1,0,0,1,0,0);t.filter="grayscale(1)";t.globalAlpha=1;t.globalCompositeOperation="copy";t.drawImage(e,0,0);t.restore();return}const a=t.getImageData(0,0,r,n),{data:s}=a;for(let t=0,e=s.length;t<e;t+=4){const e=.2126*s[t]+.7152*s[t+1]+.0722*s[t+2]+.5|0;s[t]=s[t+1]=s[t+2]=e}t.putImageData(a,0,0)}#X(t){if(t){if(t.knockoutMaskEntry){this.canvasFactory.destroy(t.knockoutMaskEntry);t.knockoutMaskEntry=null}if(t.knockoutTempEntry){this.canvasFactory.destroy(t.knockoutTempEntry);t.knockoutTempEntry=null}if(t.knockoutBackdropEntry){this.canvasFactory.destroy(t.knockoutBackdropEntry);t.knockoutBackdropEntry=null}}}beginAnnotation(t,e,r,n,a,s,i){this.#H();resetCtxToDefault(this.ctx);this.ctx.save();this.save(t);this.baseTransform&&this.ctx.setTransform(...this.baseTransform);if(r){const a=r[2]-r[0],o=r[3]-r[1];if(s&&this.annotationCanvasMap){(n=n.slice())[4]-=r[0];n[5]-=r[1];Util.singularValueDecompose2dScale(getCurrentTransform(this.ctx),Hr);const{viewportScale:t}=this,s=Math.ceil(a*this.outputScaleX*t),c=Math.ceil(o*this.outputScaleY*t);this.annotationCanvas=this.canvasFactory.create(s,c);const{canvas:l,context:h}=this.annotationCanvas;if(i){const t=this.annotationCanvasMap.getOrInsertComputed(e,makeArr);!function setAnnotationCanvasName(t,e){t.setAttribute?.("data-canvas-name",e);t._pdfjsCanvasName=e}(l,i);const r=t.findIndex(t=>getAnnotationCanvasName(t)===i);-1===r?t.push(l):t[r]=l}else this.annotationCanvasMap.set(e,l);this.annotationCanvas.savedCtx=this.ctx;this.ctx=h;this.ctx.save();this.ctx.setTransform(Hr[0],0,0,-Hr[1],0,o*Hr[1]);resetCtxToDefault(this.ctx)}else{resetCtxToDefault(this.ctx);this.endPath(t);const e=new Path2D;e.rect(r[0],r[1],a,o);this.ctx.clip(e)}}this.current=new CanvasExtraState(this.ctx.canvas.width,this.ctx.canvas.height);this.baseTransformStack.push(this.baseTransform);this.transform(t,...n);this.transform(t,...a);this.baseTransform=getCurrentTransform(this.ctx)}endAnnotation(t){if(this.annotationCanvas){this.ctx.restore();this.#V();this.ctx=this.annotationCanvas.savedCtx;delete this.annotationCanvas.savedCtx;delete this.annotationCanvas}this.baseTransform=this.baseTransformStack.pop()}paintImageMaskXObject(t,e){if(!this.contentVisible)return;const r=e.count;(e=this.getObject(t,e.data,e)).count=r;const n=this.#Z(this.current.fillAlpha),a=this.ctx,s=this._createMaskCanvas(t,e),i=s.canvas;a.save();a.setTransform(1,0,0,1,0,0);a.drawImage(i,s.offsetX,s.offsetY);this.dependencyTracker?.resetBBox(t).recordBBox(t,this.ctx,s.offsetX,s.offsetX+i.width,s.offsetY,s.offsetY+i.height).recordOperation(t);a.restore();s.canvasEntry&&this.canvasFactory.destroy(s.canvasEntry);this.compose();this.#Q(n)}paintImageMaskXObjectRepeat(t,e,r,n=0,a=0,s,i){if(!this.contentVisible)return;e=this.getObject(t,e.data,e);const o=this.#Z(this.current.fillAlpha),c=this.ctx;c.save();const l=getCurrentTransform(c);c.transform(r,n,a,s,0,0);const h=this._createMaskCanvas(t,e);c.setTransform(1,0,0,1,h.offsetX-l[4],h.offsetY-l[5]);this.dependencyTracker?.resetBBox(t);for(let e=0,o=i.length;e<o;e+=2){const o=Util.transform(l,[r,n,a,s,i[e],i[e+1]]);c.drawImage(h.canvas,o[4],o[5]);this.dependencyTracker?.recordBBox(t,this.ctx,o[4],o[4]+h.canvas.width,o[5],o[5]+h.canvas.height)}c.restore();h.canvasEntry&&this.canvasFactory.destroy(h.canvasEntry);this.compose();this.dependencyTracker?.recordOperation(t);this.#Q(o)}paintImageMaskXObjectGroup(t,e){if(!this.contentVisible)return;const r=this.#Z(this.current.fillAlpha),n=this.ctx,a=this.current.patternFill,s=a?this.current.fillColor:n.fillStyle;this.dependencyTracker?.resetBBox(t).recordDependencies(t,Nr);for(const r of e){const{data:e,width:i,height:o,transform:c}=r,l=this.canvasFactory.create(i,o),h=l.context;h.save();putBinaryImageMask(h,this.getObject(t,e,r));h.globalCompositeOperation="source-in";h.fillStyle=a?s.getPattern(h,this,getCurrentTransformInverse(n),jr,t):s;h.fillRect(0,0,i,o);h.restore();n.save();n.transform(...c);n.scale(1,-1);drawImageAtIntegerCoords(n,l.canvas,0,0,i,o,0,-1,1,1);this.canvasFactory.destroy(l);this.dependencyTracker?.recordBBox(t,n,0,i,0,o);n.restore()}this.compose();this.dependencyTracker?.recordOperation(t);this.#Q(r)}paintImageXObject(t,e){if(!this.contentVisible)return;const r=this.getObject(t,e);r?this.paintInlineImageXObject(t,r):warn("Dependent image isn't ready yet")}paintImageXObjectRepeat(t,e,r,n,a){if(!this.contentVisible)return;const s=this.getObject(t,e);if(!s){warn("Dependent image isn't ready yet");return}const i=s.width,o=s.height,c=[];for(let t=0,e=a.length;t<e;t+=2)c.push({transform:[r,0,0,n,a[t],a[t+1]],x:0,y:0,w:i,h:o});this.paintInlineImageXObjectGroup(t,s,c)}applyTransferMapsToCanvas(t){if("none"!==this.current.transferMaps){t.filter=this.current.transferMaps;t.drawImage(t.canvas,0,0);t.filter="none"}else this.current.transferMapsFallback?.applyToCanvas(t);return t.canvas}applyTransferMapsToBitmap(t){const{transferMaps:e,transferMapsFallback:r}=this.current;if("none"===e&&!r)return{img:t.bitmap,canvasEntry:null};const{bitmap:n,width:a,height:s}=t,i=this.canvasFactory.create(a,s),o=i.context;o.filter=e;o.drawImage(n,0,0);o.filter="none";r?.applyToCanvas(o);return{img:i.canvas,canvasEntry:i}}paintInlineImageXObject(t,e){if(!this.contentVisible)return;const r=e.width,n=e.height,a=this.#Z(this.current.fillAlpha),s=this.ctx;this.save(t);const{filter:i}=s;"none"!==i&&""!==i&&(s.filter="none");s.scale(1/r,-1/n);let o,c=null;if(e.bitmap){const t=this.applyTransferMapsToBitmap(e);o=t.img;c=t.canvasEntry}else{const t=this.canvasFactory.create(r,n);putBinaryImageData(t.context,e);o=this.applyTransferMapsToCanvas(t.context);c=t}const l=this._scaleImage(o,getCurrentTransformInverse(s));s.imageSmoothingEnabled=getImageSmoothingEnabled(getCurrentTransform(s),e.interpolate,this.pixelRatio);if(this.dependencyTracker){this.dependencyTracker.resetBBox(t).recordBBox(t,s,0,r,-n,0).recordDependencies(t,Pr).recordOperation(t);this.imagesTracker?.record(s,r,n,this.dependencyTracker.clipBox)}drawImageAtIntegerCoords(s,l.img,0,0,l.paintWidth,l.paintHeight,0,-n,r,n);l.tmpCanvas&&this.canvasFactory.destroy(l.tmpCanvas);c&&this.canvasFactory.destroy(c);this.compose();this.restore(t);this.#Q(a)}paintInlineImageXObjectGroup(t,e,r){if(!this.contentVisible)return;const n=this.#Z(this.current.fillAlpha),a=this.ctx;let s,i=null;if(e.bitmap&&!this.current.transferMapsFallback)s=e.bitmap;else if(e.bitmap)({img:s,canvasEntry:i}=this.applyTransferMapsToBitmap(e));else{const t=e.width,r=e.height,n=this.canvasFactory.create(t,r);putBinaryImageData(n.context,e);s=this.applyTransferMapsToCanvas(n.context);i=n}this.dependencyTracker?.resetBBox(t);for(const e of r){a.save();a.transform(...e.transform);a.scale(1,-1);drawImageAtIntegerCoords(a,s,e.x,e.y,e.w,e.h,0,-1,1,1);this.dependencyTracker?.recordBBox(t,a,0,1,-1,0);a.restore()}i&&this.canvasFactory.destroy(i);this.dependencyTracker?.recordOperation(t);this.compose();this.#Q(n)}paintSolidColorImageMask(t){if(!this.contentVisible)return;const e=this.#Z(this.current.fillAlpha);this.dependencyTracker?.resetBBox(t).recordBBox(t,this.ctx,0,1,0,1).recordDependencies(t,Ar).recordOperation(t);this.ctx.fillRect(0,0,1,1);this.compose();this.#Q(e)}markPoint(t,e){}markPointProps(t,e,r){}beginMarkedContent(t,e){this.dependencyTracker?.beginMarkedContent(t);this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e,r){this.dependencyTracker?.beginMarkedContent(t);"OC"===e?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(r)}):this.markedContentStack.push({visible:!0});this.contentVisible=this.isContentVisible()}endMarkedContent(t){this.dependencyTracker?.endMarkedContent(t);this.markedContentStack.pop();this.contentVisible=this.isContentVisible()}beginCompat(t){}endCompat(t){}consumePath(t,e,r){const n=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath();this.pendingClip||this.compose(r);const a=this.ctx;if(this.pendingClip){n||(this.pendingClip===$r?a.clip(e,"evenodd"):a.clip(e));this.pendingClip=null;this.dependencyTracker?.bboxToClipBoxDropOperation(t).recordFutureForcedDependency("clipPath",t)}else this.dependencyTracker?.recordOperation(t);this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){const t=getCurrentTransform(this.ctx);if(0===t[1]&&0===t[2])return 1/Math.min(Math.abs(t[0]),Math.abs(t[3]));const e=Math.abs(t[0]*t[3]-t[2]*t[1]),r=Math.hypot(t[0],t[2]),n=Math.hypot(t[1],t[3]);return Math.max(r,n)/e}getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){const{lineWidth:t}=this.current,{a:e,b:r,c:n,d:a}=this.ctx.getTransform();let s,i;if(0===r&&0===n){const r=Math.abs(e),n=Math.abs(a);if(r===n)if(0===t)s=i=1/r;else{const e=r*t;s=i=e<1?1/e:1}else if(0===t){s=1/r;i=1/n}else{const e=r*t,a=n*t;s=e<1?1/e:1;i=a<1?1/a:1}}else{const o=Math.abs(e*a-r*n),c=Math.hypot(e,r),l=Math.hypot(n,a);if(0===t){s=l/o;i=c/o}else{const e=t*o;s=l>e?l/e:1;i=c>e?c/e:1}}this._cachedScaleForStroking[0]=s;this._cachedScaleForStroking[1]=i}return this._cachedScaleForStroking}rescaleAndStroke(t,e){const{ctx:r,current:{lineWidth:n}}=this,[a,s]=this.getScaleForStroking();if(a===s){r.lineWidth=(n||1)*a;r.stroke(t);return}const i=CanvasGraphics.#P??=new DOMMatrix,o=r.getLineDash();e&&r.save();r.scale(a,s);i.a=1/a;i.d=1/s;const c=new Path2D;c.addPath(t,i);if(o.length>0){const t=Math.max(a,s);r.setLineDash(o.map(e=>e/t));r.lineDashOffset/=t}r.lineWidth=n||1;r.stroke(c);e&&r.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}for(const t in xr)void 0!==CanvasGraphics.prototype[t]&&(CanvasGraphics.prototype[xr[t]]=CanvasGraphics.prototype[t]);Qe();const Kr=/\p{Cc}/u;function serializeFontFamily(t){if(function isCSSString(t){const e=t[0];if(t.length<2||'"'!==e&&"'"!==e||t.at(-1)!==e)return!1;const r=t.length-1;for(let n=1;n<r;n++){const a=t[n];if(a===e||Kr.test(a))return!1;if("\\"===a&&(++n>=r||Kr.test(t[n])))return!1}return!0}(t))return t;return`"${t.replaceAll(/["\\\p{Cc}]/gu,t=>'"'===t||"\\"===t?`\\${t}`:`\\${t.codePointAt(0).toString(16)} `)}"`}class FontLoader{#nt=new Set;#at=new Set;#st=null;constructor({ownerDocument:t=globalThis.document,styleElement:e=null}){this._document=t;this.styleElement=null}addNativeFontFace(t){this.#nt.add(t);this._document.fonts.add(t)}removeNativeFontFace(t){this.#nt.delete(t);this._document.fonts.delete(t)}insertRule(t){throw new Error("Not implemented: insertRule")}#it(){throw new Error("Not implemented: #getStyleSheet")}clear(){for(const t of this.#nt)this._document.fonts.delete(t);this.#nt.clear();this.#at.clear()}async loadSystemFont({systemFontInfo:t,disableFontFace:e,_inspectFont:r}){if(t&&!this.#at.has(t.loadedName)){assert(!e,"loadSystemFont shouldn't be called when `disableFontFace` is set.");if(this.isFontLoadingAPISupported){const{loadedName:e,src:n,style:a}=t,s=new FontFace(e,n,a);this.addNativeFontFace(s);try{await s.load();this.#at.add(e);r?.(t)}catch{warn(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`);this.removeNativeFontFace(s)}return}unreachable("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(t){if(!(t.attached||t.missingFile&&!t.systemFontInfo)){t.attached=!0;if(!t.systemFontInfo){if(this.isFontLoadingAPISupported){const e=t.createNativeFontFace();if(e){this.addNativeFontFace(e);try{await e.loaded}catch(r){warn(`Failed to load font '${e.family}': '${r}'.`);t.disableFontFace=!0;throw r}}return}throw new Error("Not implemented: DOM font loading")}await this.loadSystemFont(t)}}get isFontLoadingAPISupported(){return util_shadow(this,"isFontLoadingAPISupported",!!this._document?.fonts)}get isSyncFontLoadingSupported(){return util_shadow(this,"isSyncFontLoadingSupported",rr||FeatureTest.platform.isFirefox)}#ot(t){throw new Error("Not implemented: #testFontLoaded")}}class FontFaceObject{#ct=new Map;#lt;constructor(t,e=null,r,n){this.#lt=t;this._inspectFont=e;r&&(this.charProcOperatorList=r);n&&Object.assign(this,n)}createNativeFontFace(){const{data:t}=this;if(!t||this.disableFontFace)return null;let e;if(this.cssFontInfo){const r={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(r.style=`oblique ${this.cssFontInfo.italicAngle}deg`);e=new FontFace(serializeFontFamily(this.cssFontInfo.fontFamily),t,r)}else e=new FontFace(this.loadedName,t,{});this._inspectFont?.(this);return e}createFontFaceRule(){throw new Error("Not implemented: createFontFaceRule")}getPathGenerator(t,e){let r=this.#ct.get(e);if(r)return r;const n=`${this.loadedName}_path_${e}`;let a;try{a=t.get(n)}catch(t){warn(`getPathGenerator - ignoring character: "${t}".`)}r=makePathFromDrawOPS(a?.path);this.fontExtraProperties||t.delete(n);this.#ct.set(e,r);return r}get black(){return this.#lt.black}get bold(){return this.#lt.bold}get disableFontFace(){return this.#lt.disableFontFace}set disableFontFace(t){util_shadow(this,"disableFontFace",!!t)}get fontExtraProperties(){return this.#lt.fontExtraProperties}get isInvalidPDFjsFont(){return this.#lt.isInvalidPDFjsFont}get isType3Font(){return this.#lt.isType3Font}get italic(){return this.#lt.italic}get missingFile(){return this.#lt.missingFile}get remeasure(){return this.#lt.remeasure}get vertical(){return this.#lt.vertical}get bbox(){return this.#lt.bbox}get fontMatrix(){return this.#lt.fontMatrix}get fallbackName(){return this.#lt.fallbackName}get loadedName(){return this.#lt.loadedName}get mimetype(){return this.missingFile?null:"font/opentype"}get data(){return this.#lt.data}clearData(){this.#lt.clearData()}get cssFontInfo(){return this.#lt.cssFontInfo}get systemFontInfo(){return this.#lt.systemFontInfo}}Le();const Jr=1,Zr=2,Qr=1,tn=2,en=3,rn=4,nn=5,an=6,sn=7,on=8;function onFn(){}function wrapReason(t){if(t instanceof AbortException||t instanceof InvalidPDFException||t instanceof PasswordException||t instanceof ResponseException||t instanceof UnknownErrorException)return t;if("object"!=typeof t||null===t)return new UnknownErrorException(String(t),String(t));switch(t.name){case"AbortException":return new AbortException(t.message);case"InvalidPDFException":return new InvalidPDFException(t.message);case"PasswordException":return new PasswordException(t.message,t.code);case"ResponseException":return new ResponseException(t.message,t.status,t.missing);case"UnknownErrorException":return new UnknownErrorException(t.message,t.details)}return new UnknownErrorException(t.message,t.toString())}class MessageHandler{#ht=new Map;#ut=new Map;#pt=1;#dt;#ft=new AbortController;#gt;#mt=new Map;#_t=1;#bt=new Map;#xt;constructor(t,e,r){this.#gt=t;this.#xt=e;this.#dt=r;r.addEventListener("message",this.#yt.bind(this),{signal:this.#ft.signal})}#yt({data:t}){if(t.targetName!==this.#gt)return;if(t.stream){this.#vt(t);return}if(t.callback){const{callbackId:e,callback:r}=t,n=this.#ut.get(e);if(!n)throw new Error(`Cannot resolve callback ${e}`);this.#ut.delete(e);if(r===Jr)n.resolve(t.data);else{if(r!==Zr)throw new Error("Unexpected callback case");n.reject(wrapReason(t.reason))}return}const e=this.#ht.get(t.action);if(!e)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const r=this.#gt,n=t.sourceName,a=this.#dt;Promise.try(e,t.data).then(e=>{a.postMessage({sourceName:r,targetName:n,callback:Jr,callbackId:t.callbackId,data:e})}).catch(e=>{a.postMessage({sourceName:r,targetName:n,callback:Zr,callbackId:t.callbackId,reason:wrapReason(e)})});return}t.streamId?this.#wt(t):e(t.data)}on(t,e){const r=this.#ht;if(r.has(t))throw new Error(`There is already a "${t}" handler.`);r.set(t,e)}send(t,e,r){this.#dt.postMessage({sourceName:this.#gt,targetName:this.#xt,action:t,data:e},r)}sendWithPromise(t,e,r){const n=this.#pt++,a=Promise.withResolvers();this.#ut.set(n,a);try{this.#dt.postMessage({sourceName:this.#gt,targetName:this.#xt,action:t,callbackId:n,data:e},r)}catch(t){a.reject(t)}return a.promise}sendWithStream(t,e,r,n){const a=this.#_t++,s=this.#gt,i=this.#xt,o=this.#dt;return new ReadableStream({start:r=>{const c=Promise.withResolvers();this.#mt.set(a,{controller:r,startCall:c,pullCall:null,cancelCall:null,isClosed:!1});o.postMessage({sourceName:s,targetName:i,action:t,streamId:a,data:e,desiredSize:r.desiredSize},n);return c.promise},pull:t=>{const e=Promise.withResolvers();this.#mt.get(a).pullCall=e;o.postMessage({sourceName:s,targetName:i,stream:an,streamId:a,desiredSize:t.desiredSize});return e.promise},cancel:t=>{assert(t instanceof Error,"cancel must have a valid reason");const e=Promise.withResolvers();this.#mt.get(a).cancelCall=e;this.#mt.get(a).isClosed=!0;o.postMessage({sourceName:s,targetName:i,stream:Qr,streamId:a,reason:wrapReason(t)});return e.promise}},r)}#wt(t){const e=t.streamId,r=this.#gt,n=t.sourceName,a=this.#dt,s=this.#bt,i=this.#ht.get(t.action),o={enqueue(t,s=1,i){if(this.isCancelled)return;const o=this.desiredSize;this.desiredSize-=s;if(o>0&&this.desiredSize<=0){this.sinkCapability=Promise.withResolvers();this.ready=this.sinkCapability.promise}a.postMessage({sourceName:r,targetName:n,stream:rn,streamId:e,chunk:t},i)},close(){if(!this.isCancelled){this.isCancelled=!0;a.postMessage({sourceName:r,targetName:n,stream:en,streamId:e});s.delete(e)}},error(t){if(!this.isCancelled){this.isCancelled=!0;a.postMessage({sourceName:r,targetName:n,stream:nn,streamId:e,reason:wrapReason(t)})}},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};o.sinkCapability.resolve();o.ready=o.sinkCapability.promise;s.set(e,o);Promise.try(i,t.data,o).then(()=>{a.postMessage({sourceName:r,targetName:n,stream:on,streamId:e,success:!0})},t=>{a.postMessage({sourceName:r,targetName:n,stream:on,streamId:e,reason:wrapReason(t)})})}#vt(t){const e=t.streamId,r=this.#gt,n=t.sourceName,a=this.#dt,s=this.#mt.get(e),i=this.#bt.get(e);switch(t.stream){case on:t.success?s.startCall.resolve():s.startCall.reject(wrapReason(t.reason));break;case sn:t.success?s.pullCall.resolve():s.pullCall.reject(wrapReason(t.reason));break;case an:if(!i){a.postMessage({sourceName:r,targetName:n,stream:sn,streamId:e,success:!0});break}i.desiredSize<=0&&t.desiredSize>0&&i.sinkCapability.resolve();i.desiredSize=t.desiredSize;Promise.try(i.onPull||onFn).then(()=>{a.postMessage({sourceName:r,targetName:n,stream:sn,streamId:e,success:!0})},t=>{a.postMessage({sourceName:r,targetName:n,stream:sn,streamId:e,reason:wrapReason(t)})});break;case rn:assert(s,"enqueue should have stream controller");if(s.isClosed)break;s.controller.enqueue(t.chunk);break;case en:assert(s,"close should have stream controller");if(s.isClosed)break;s.isClosed=!0;s.controller.close();this.#kt(s,e);break;case nn:assert(s,"error should have stream controller");s.controller.error(wrapReason(t.reason));this.#kt(s,e);break;case tn:t.success?s.cancelCall.resolve():s.cancelCall.reject(wrapReason(t.reason));this.#kt(s,e);break;case Qr:if(!i)break;const o=wrapReason(t.reason);Promise.try(i.onCancel||onFn,o).then(()=>{a.postMessage({sourceName:r,targetName:n,stream:tn,streamId:e,success:!0})},t=>{a.postMessage({sourceName:r,targetName:n,stream:tn,streamId:e,reason:wrapReason(t)})});i.sinkCapability.reject(o);i.isCancelled=!0;this.#bt.delete(e);break;default:throw new Error("Unexpected stream case")}}async#kt(t,e){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]);this.#mt.delete(e)}destroy(){this.#ft?.abort();this.#ft=null}get destroyed(){return!this.#ft}}class CSS_FONT_INFO{static strings=["fontFamily","fontWeight","italicAngle"]}class SYSTEM_FONT_INFO{static strings=["css","loadedName","baseFontName","src"]}class FONT_INFO{static bools=["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"];static strings=["fallbackName","loadedName"];static OFFSET_BBOX=Math.ceil(2*this.bools.length/8);static OFFSET_FONT_MATRIX=this.OFFSET_BBOX+1+8;static OFFSET_STRINGS=this.OFFSET_FONT_MATRIX+1+48}class PATTERN_INFO{static KIND=0;static HAS_BBOX=1;static HAS_BACKGROUND=2;static SHADING_TYPE=3;static N_COORD=4;static N_COLOR=8;static N_STOP=12;static N_FIGURES=16}class InfoUtils{static get decoder(){return util_shadow(this,"decoder",new TextDecoder)}static get encoder(){return util_shadow(this,"encoder",new TextEncoder)}}function readString(t,e,r,n=0){const{decoder:a}=InfoUtils;for(let t=0;t<r;t++)n+=e.getUint32(n)+4;const s=e.getUint32(n);return a.decode(new Uint8Array(t,n+4,s))}class CssFontInfo{#St;#Ct;constructor(t){this.#St=t;this.#Ct=new DataView(t)}#Tt(t){assert(t<CSS_FONT_INFO.strings.length,"Invalid string index");return readString(this.#St,this.#Ct,t)}get fontFamily(){return util_shadow(this,"fontFamily",this.#Tt(0))}get fontWeight(){return util_shadow(this,"fontWeight",this.#Tt(1))}get italicAngle(){return util_shadow(this,"italicAngle",this.#Tt(2))}}class SystemFontInfo{#St;#Ct;constructor(t){this.#St=t;this.#Ct=new DataView(t)}#Tt(t){assert(t<SYSTEM_FONT_INFO.strings.length,"Invalid string index");return readString(this.#St,this.#Ct,t,4)}get css(){return util_shadow(this,"css",this.#Tt(0))}get loadedName(){return util_shadow(this,"loadedName",this.#Tt(1))}get baseFontName(){return util_shadow(this,"baseFontName",this.#Tt(2))}get src(){return util_shadow(this,"src",this.#Tt(3))}get style(){let t=0;t+=4+this.#Ct.getUint32(t);return util_shadow(this,"style",{style:readString(this.#St,this.#Ct,0,t),weight:readString(this.#St,this.#Ct,1,t)})}}class FontInfo{#St;#Ct;constructor(t){this.#St=t;this.#Ct=new DataView(t)}#Mt(t){assert(t<FONT_INFO.bools.length,"Invalid boolean index");const e=Math.floor(t/4),r=2*t%8,n=this.#Ct.getUint8(e)>>r&3;return 0===n?void 0:2===n}get black(){return util_shadow(this,"black",this.#Mt(0))}get bold(){return util_shadow(this,"bold",this.#Mt(1))}get disableFontFace(){return util_shadow(this,"disableFontFace",this.#Mt(2))}get fontExtraProperties(){return util_shadow(this,"fontExtraProperties",this.#Mt(3))}get isInvalidPDFjsFont(){return util_shadow(this,"isInvalidPDFjsFont",this.#Mt(4))}get isType3Font(){return util_shadow(this,"isType3Font",this.#Mt(5))}get italic(){return util_shadow(this,"italic",this.#Mt(6))}get missingFile(){return util_shadow(this,"missingFile",this.#Mt(7))}get remeasure(){return util_shadow(this,"remeasure",this.#Mt(8))}get vertical(){return util_shadow(this,"vertical",this.#Mt(9))}#Ft(t,e,r,n){const a=this.#Ct.getUint8(t++);if(0===a)return;assert(a===e,"Invalid array length.");const s=new Array(a);for(let e=0;e<a;e++){s[e]=this.#Ct[r](t,!0);t+=n}return s}get bbox(){return util_shadow(this,"bbox",this.#Ft(FONT_INFO.OFFSET_BBOX,4,"getInt16",2))}get fontMatrix(){return util_shadow(this,"fontMatrix",this.#Ft(FONT_INFO.OFFSET_FONT_MATRIX,6,"getFloat64",8))}#Tt(t){assert(t<FONT_INFO.strings.length,"Invalid string index");return readString(this.#St,this.#Ct,t,FONT_INFO.OFFSET_STRINGS+4)}get fallbackName(){return util_shadow(this,"fallbackName",this.#Tt(0))}get loadedName(){return util_shadow(this,"loadedName",this.#Tt(1))}#Bt(t){let e=FONT_INFO.OFFSET_STRINGS;for(let r=0;r<=t;r++)e+=4+this.#Ct.getUint32(e);return{offset:e,length:this.#Ct.getUint32(e)}}get data(){const{offset:t,length:e}=this.#Bt(2);return e?new Uint8Array(this.#St,t+4,e):void 0}clearData(){const{offset:t,length:e}=this.#Bt(2);if(e){this.#Ct.setUint32(t,0);this.#St=new Uint8Array(this.#St,0,t+4).slice().buffer;this.#Ct=new DataView(this.#St)}}get cssFontInfo(){const{offset:t,length:e}=this.#Bt(1);let r=null;if(e){const n=new Uint8Array(this.#St,t+4,e).slice();r=new CssFontInfo(n.buffer)}return util_shadow(this,"cssFontInfo",r)}get systemFontInfo(){const{offset:t,length:e}=this.#Bt(0);let r=null;if(e){const n=new Uint8Array(this.#St,t+4,e).slice();r=new SystemFontInfo(n.buffer)}return util_shadow(this,"systemFontInfo",r)}}class PatternInfo{constructor(t){this.buffer=t;this.view=new DataView(t);this.data=new Uint8Array(t)}getIR(){const t=this.view,e=this.data[PATTERN_INFO.KIND],r=!!this.data[PATTERN_INFO.HAS_BBOX],n=!!this.data[PATTERN_INFO.HAS_BACKGROUND],a=t.getUint32(PATTERN_INFO.N_COORD,!0),s=t.getUint32(PATTERN_INFO.N_COLOR,!0),i=t.getUint32(PATTERN_INFO.N_STOP,!0);let o=20;const c=new Float32Array(this.buffer,o,2*a);o+=8*a;const l=new Uint8Array(this.buffer,o,4*s);o+=4*s;const h=[];for(let e=0;e<i;++e){const e=t.getFloat32(o,!0);o+=4;const r=t.getUint32(o,!0);o+=4;h.push([e,`#${r.toString(16).padStart(6,"0")}`])}let u=null;if(r){u=[];for(let e=0;e<4;++e){u.push(t.getFloat32(o,!0));o+=4}}let p=null;if(n){p=new Uint8Array(this.buffer,o,3);o+=3}if(1===e)return["RadialAxial","axial",u,h,[c[0],c[1]],[c[2],c[3]],null,null];if(2===e)return["RadialAxial","radial",u,h,[c[0],c[1]],[c[3],c[4]],c[2],c[5]];if(3===e){const t=this.data[PATTERN_INFO.SHADING_TYPE];let e=null;if(c.length>0){e=nr.slice();for(let t=0,r=c.length;t<r;t+=2)Util.pointBoundingBox(c[t],c[t+1],e)}return["Mesh",t,c,l,a,e,u,p]}throw new Error(`Unsupported pattern kind: ${e}`)}}class FontPathInfo{#St;constructor(t){this.#St=t}get path(){return FeatureTest.isFloat16ArraySupported?new Float16Array(this.#St):new Float32Array(this.#St)}}const cn=Symbol("INITIAL_DATA"),dataObj=()=>({...Promise.withResolvers(),data:cn});class PDFObjects{#Ot=new Map;get(t,e=null,r=null){if(e){const n=this.#Ot.getOrInsertComputed(t,dataObj);n.promise.then(()=>e(n.data),r);return null}const n=this.#Ot.get(t);if(!n||n.data===cn)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return n.data}has(t){const e=this.#Ot.get(t);return!!e&&e.data!==cn}delete(t){const e=this.#Ot.get(t);if(!e||e.data===cn)return!1;this.#Ot.delete(t);return!0}resolve(t,e=null){const r=this.#Ot.getOrInsertComputed(t,dataObj);if(r.data!==cn)throw new Error(`Object already resolved ${t}.`);r.data=e;r.resolve()}reject(t,e){const r=this.#Ot.getOrInsertComputed(t,dataObj);if(r.data===cn){r.promise.catch(()=>{});r.reject(e)}}clear(){for(const{data:t}of this.#Ot.values())t?.bitmap?.close();this.#Ot.clear()}*[Symbol.iterator](){for(const[t,{data:e}]of this.#Ot)e!==cn&&(yield[t,e])}}class ObjectHandler{constructor({messageHandler:t,commonObjs:e,fontLoader:r,pageCache:n,pdfBug:a=!1,shouldCreatePageObjs:s=!1}){this.messageHandler=t;this.commonObjs=e;this.fontLoader=r;this.pageCache=n;this.pdfBug=a;this.shouldCreatePageObjs=s}resolveCommonObject(t,e,r){if("CopyLocalImage"===e){const{imageRef:e}=r;assert(e,"The imageRef must be defined.");for(const r of this.pageCache.values()){const n=r.objs||r;for(const[,r]of n){if(r?.ref!==e)continue;if(!r.dataLen)return null;const n=structuredClone(r);this.commonObjs.resolve(t,n);return r.dataLen}}return null}switch(e){case"Font":if("error"in r){const e=r.error;warn(`Error during font loading: ${e}`);this.commonObjs.resolve(t,e);break}const n=new FontInfo(r.buffer),a=new FontFaceObject(n,null,r.charProcOperatorList,r.extra);this.fontLoader.bind(a).catch(()=>this.messageHandler.sendWithPromise("FontFallback",{id:t}).catch(e=>{warn(`FontFallback failed for "${t}": ${e}`)})).finally(()=>{a.fontExtraProperties||a.clearData();this.commonObjs.resolve(t,a)});break;case"FontPath":this.commonObjs.resolve(t,new FontPathInfo(r));break;case"Image":this.commonObjs.resolve(t,r);break;case"Pattern":const s=new PatternInfo(r);this.commonObjs.resolve(t,s.getIR());break;default:throw new Error(`Got unknown common object type ${e}`)}return null}resolveObject(t,e,r,n){let a=this.pageCache.get(e);if(!a){if(!this.shouldCreatePageObjs)return!1;a=new PDFObjects;this.pageCache.set(e,a)}const s=a.objs||a;if(s.has(t))return!1;if(0===a._intentStates?.size){n?.bitmap?.close();return!1}switch(r){case"Image":case"Pattern":s.resolve(t,n);return!0;default:throw new Error(`Got unknown object type ${r}`)}}}class BaseCanvasFactory{#It=!1;constructor({enableHWA:t=!1}){this.#It=t}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");const r=this._createCanvas(t,e);return{canvas:r,context:r.getContext("2d",{willReadFrequently:!this.#It})}}reset({canvas:t},e,r){if(!t)throw new Error("Canvas is not specified");if(e<=0||r<=0)throw new Error("Invalid canvas size");t.width=e;t.height=r}destroy(t){const{canvas:e}=t;if(!e)throw new Error("Canvas is not specified");e.width=e.height=0;t.canvas=null;t.context=null}getNoAlphaContext(t){return t.getContext("2d",{alpha:!1,willReadFrequently:!this.#It})}_createCanvas(t,e){unreachable("Abstract method `_createCanvas` called.")}}class OffscreenCanvasFactory extends BaseCanvasFactory{_createCanvas(t,e){return new OffscreenCanvas(t,e)}}const ln=3285377520,hn=4294901760,un=65535;class MurmurHash3_64{constructor(t){this.h1=t?4294967295&t:ln;this.h2=t?4294967295&t:ln}update(t){let e,r;if("string"==typeof t){e=new Uint8Array(2*t.length);r=0;for(let n=0,a=t.length;n<a;n++){const a=t.charCodeAt(n);if(a<=255)e[r++]=a;else{e[r++]=a>>>8;e[r++]=255&a}}}else{if(!ArrayBuffer.isView(t))throw new Error("Invalid data format, must be a string or TypedArray.");e=t.slice();r=e.byteLength}const n=r>>2,a=r-4*n,s=new Uint32Array(e.buffer,0,n);let i=0,o=0,c=this.h1,l=this.h2;const h=3432918353,u=461845907,p=11601,d=13715;for(let t=0;t<n;t++)if(1&t){i=s[t];i=i*h&hn|i*p&un;i=i<<15|i>>>17;i=i*u&hn|i*d&un;c^=i;c=c<<13|c>>>19;c=5*c+3864292196}else{o=s[t];o=o*h&hn|o*p&un;o=o<<15|o>>>17;o=o*u&hn|o*d&un;l^=o;l=l<<13|l>>>19;l=5*l+3864292196}i=0;switch(a){case 3:i^=e[4*n+2]<<16;case 2:i^=e[4*n+1]<<8;case 1:i^=e[4*n];i=i*h&hn|i*p&un;i=i<<15|i>>>17;i=i*u&hn|i*d&un;1&n?c^=i:l^=i}this.h1=c;this.h2=l}hexdigest(){let t=this.h1,e=this.h2;t^=e>>>1;t=3981806797*t&hn|36045*t&un;e=4283543511*e&hn|(2950163797*(e<<16|t>>>16)&hn)>>>16;t^=e>>>1;t=444984403*t&hn|60499*t&un;e=3301882366*e&hn|(3120437893*(e<<16|t>>>16)&hn)>>>16;t^=e>>>1;return(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}const pn=Symbol("INTERNAL");class OptionalContentGroup{#At=!1;#Pt=!1;#Dt=!1;#Et=!0;constructor(t,{name:e,intent:r,usage:n,rbGroups:a}){this.#At=!!(t&ir);this.#Pt=!!(t&or);this.name=e;this.intent=r;this.usage=n;this.rbGroups=a}get visible(){if(this.#Dt)return this.#Et;if(!this.#Et)return!1;const{print:t,view:e}=this.usage;return this.#At?"OFF"!==e?.viewState:!this.#Pt||"OFF"!==t?.printState}_setVisible(t,e,r=!1){t!==pn&&unreachable("Internal method `_setVisible` called.");this.#Dt=r;this.#Et=e}get serializable(){return{userSet:this.#Dt,visible:this.#Et}}}class OptionalContentConfig{#Rt=null;#Nt=new Map;#Lt=null;#jt=null;#qt;creator=null;name=null;constructor(t,e=ir,r=null){this.#qt=t;this.renderingIntent=e;if(null!==t){this.name=t.name;this.creator=t.creator;this.#jt=t.order;for(const r of t.groups)this.#Nt.set(r.id,new OptionalContentGroup(e,r));if(r){r.size!==this.#Nt.size&&unreachable("Incorrect serialized groupState.");for(const[t,e]of r)this.#Nt.get(t)._setVisible(pn,e.visible,e.userSet)}else{if("OFF"===t.baseState)for(const t of this.#Nt.values())t._setVisible(pn,!1);for(const e of t.on)this.#Nt.get(e)._setVisible(pn,!0);for(const e of t.off)this.#Nt.get(e)._setVisible(pn,!1)}this.#Lt=this.getHash()}}#Ut(t){const e=t.length;if(e<2)return!0;const r=t[0];for(let n=1;n<e;n++){const e=t[n];let a;if(Array.isArray(e))a=this.#Ut(e);else{if(!this.#Nt.has(e)){warn(`Optional content group not found: ${e}`);return!0}a=this.#Nt.get(e).visible}switch(r){case"And":if(!a)return!1;break;case"Or":if(a)return!0;break;case"Not":return!a;default:return!0}}return"And"===r}isVisible(t){if(0===this.#Nt.size)return!0;if(!t){info("Optional content group not defined.");return!0}if("OCG"===t.type){if(!this.#Nt.has(t.id)){warn(`Optional content group not found: ${t.id}`);return!0}return this.#Nt.get(t.id).visible}if("OCMD"===t.type){if(t.expression)return this.#Ut(t.expression);if(!t.policy||"AnyOn"===t.policy){for(const e of t.ids){if(!this.#Nt.has(e)){warn(`Optional content group not found: ${e}`);return!0}if(this.#Nt.get(e).visible)return!0}return!1}if("AllOn"===t.policy){for(const e of t.ids){if(!this.#Nt.has(e)){warn(`Optional content group not found: ${e}`);return!0}if(!this.#Nt.get(e).visible)return!1}return!0}if("AnyOff"===t.policy){for(const e of t.ids){if(!this.#Nt.has(e)){warn(`Optional content group not found: ${e}`);return!0}if(!this.#Nt.get(e).visible)return!0}return!1}if("AllOff"===t.policy){for(const e of t.ids){if(!this.#Nt.has(e)){warn(`Optional content group not found: ${e}`);return!0}if(this.#Nt.get(e).visible)return!1}return!0}warn(`Unknown optional content policy ${t.policy}.`);return!0}warn(`Unknown group type ${t.type}.`);return!0}setVisibility(t,e=!0,r=!0){throw new Error("Not implemented: setVisibility")}setOCGState({state:t,preserveRB:e}){throw new Error("Not implemented: setOCGState")}get hasInitialVisibility(){return null===this.#Lt||this.getHash()===this.#Lt}getOrder(){throw new Error("Not implemented: getOrder")}getGroup(t){return this.#Nt.get(t)||null}getHash(){if(null!==this.#Rt)return this.#Rt;const t=new MurmurHash3_64;for(const[e,r]of this.#Nt)t.update(`${e}:${r.visible}`);return this.#Rt=t.hexdigest()}[Symbol.iterator](){return this.#Nt.entries()}get serializable(){const t=new Map;for(const[e,r]of this.#Nt)t.set(e,r.serializable);return{data:this.#qt,renderingIntent:this.renderingIntent,groupState:t}}static fromSerializable({data:t,renderingIntent:e,groupState:r}){return new OptionalContentConfig(t,e,r)}}class BaseFilterFactory{addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addKnockoutFilter(t=0){return"none"}addHighlightHCMFilter(t,e,r,n,a){return"none"}addSelectionHCMFilter(t,e){return"none"}addSelectionFilter(){return"none"}createSelectionStyle(t=null){return null}destroy(t=!1){}}class WorkerFilterFactory extends BaseFilterFactory{}class RendererMessageHandler{static#Gt;static#Wt=new PDFObjects;static#zt=null;static#It=!1;static#Ht=!1;static#Xt;static#Vt=new FontLoader({ownerDocument:globalThis});static#Yt=!1;static#$t=new Map;static#Kt=new Map;static#Jt=new Map;static#Zt=null;static#Qt=[];static{"undefined"==typeof window&&!rr&&"undefined"!=typeof self&&"function"==typeof self.postMessage&&"onmessage"in self&&this.#te(self)}static#ee(t){return this.#$t.getOrInsertComputed(t,()=>new PDFObjects)}static#re(t,e){return this.#Kt.getOrInsertComputed(t,makeMap).getOrInsertComputed(e,()=>({fnArray:[],argsArray:[],pathCache:new Map}))}static#ne(t,e){const r=t.gfx?.annotationCanvasMap;if(!r?.size)return null;const n=[];for(const[t,a]of r)for(const r of Array.isArray(a)?a:[a]){const a=r.transferToImageBitmap();n.push([t,getAnnotationCanvasName(r),a]);e.push(a)}return n}static async#ae(t,e,r){const{canvas:n,renderTaskId:a}=e;let s=null;if(0===n.width||0===n.height){if(!r)return}else if(r)s=n.transferToImageBitmap();else{const{transparentCanvas:t}=e.gfx;if(t){const e=new OffscreenCanvas(n.width,n.height),r=e.getContext("2d");r.drawImage(n,0,0);r.drawImage(t,0,0);s=e.transferToImageBitmap();e.width=e.height=0}else{s=await createImageBitmap(n);if(e.aborted){s.close();return}}}const i=s?[s]:[],o=r?this.#ne(e,i):null;t.send("RenderFrame",{renderTaskId:a,bitmap:s,annotationBitmaps:o},i)}static async#se(t,e){if(!(!e.partialFrames||e.aborted||Date.now()-e.lastFrameTime<500||e.operatorListIdx===e.lastFrameIdx)){try{await this.#ae(t,e,!1)}catch(t){warn(`Failed to send an interim frame: ${t.message}`)}e.lastFrameTime=Date.now();e.lastFrameIdx=e.operatorListIdx}}static#ie(t){this.#$t.get(t)?.clear();this.#$t.delete(t);this.#Kt.delete(t);for(const[e,r]of this.#Jt)r.pageProxyId===t&&this.#oe(e)}static#oe(t,e=!1){const r=this.#Jt.get(t);if(r){r.aborted=!0;r.continueResolve?.();r.gfx?.endDrawing();e||this.#ce(r);this.#Jt.delete(t)}}static#ce({canvas:t,gfx:e}){t.width=t.height=0;const r=e?.annotationCanvasMap;if(r){for(const t of r.values())for(const e of Array.isArray(t)?t:[t])e.width=e.height=0;r.clear()}}static#le(t,e,r,n){const{operatorList:a,sharedOperatorList:s}=t,{fnArray:i,argsArray:o}=s;for(let t=a.fnArray.length;t<e;t++){a.fnArray.push(i[t]);a.argsArray.push(o[t])}if(r){const e=t.operationsFilterMask||=[];for(let t=0,n=r.length;t<n;t++)e.push(r[t])}a.lastChunk=n;t.dependencyTracker?.growOperationsCount(a.fnArray.length)}static async#he(t,e){const{operatorList:r,gfx:n,operationsFilterMask:a}=e,s=a?t=>a[t]:null;for(;!e.aborted;){const{promise:a,resolve:i,reject:o}=Promise.withResolvers();e.continueResolve=i;e.operatorListIdx=n.executeOperatorList(r,e.operatorListIdx,i,o,void 0,s);if(e.operatorListIdx===r.argsArray.length)return e.operatorListIdx;await this.#se(t,e);await a;if(e.aborted)break;await this.#ue()}return e.operatorListIdx}static#ue(){if(!this.#Zt){this.#Zt=new MessageChannel;this.#Zt.port1.onmessage=()=>{this.#Qt.shift()()}}const{promise:t,resolve:e}=Promise.withResolvers();this.#Qt.push(e);this.#Zt.port2.postMessage(null);return t}static#pe(t){const e=new ObjectHandler({messageHandler:t,commonObjs:this.#Wt,fontLoader:this.#Vt,pageCache:this.#$t,shouldCreatePageObjs:!0});t.on("commonobj",([t,r,n])=>{if(!this.#Wt.has(t)){e.resolveCommonObject(t,r,n);"Pattern"===r&&"Mesh"===this.#Wt.get(t)[0]&&(this.#Yt=!0)}});t.on("obj",([t,r,n,a])=>{"Pattern"===n&&"Mesh"===a[0]&&(this.#Yt=!0);e.resolveObject(t,r,n,a)});t.on("objFailed",({id:t,pageProxyId:e,reason:r})=>{const n=new Error(r);null!==e?this.#ee(e).reject(t,n):this.#Wt.reject(t,n)})}static#de(t){t.on("configure",t=>{!function setVerbosityLevel(t){Number.isInteger(t)&&(Cr=t)}(t.verbosity);this.#It=t.enableHWA;this.#Ht=t.enableWebGPU;this.#Ht&&initGPU()});this.#pe(t);t.on("cleanupPage",({pageProxyId:t})=>{this.#ie(t)});t.on("Cleanup",({keepLoadedFonts:t})=>{this.#Wt.clear();t||this.#Vt.clear();this.#Xt?.destroy(!0)});t.on("CleanupRenderTask",({renderTaskId:t})=>{this.#oe(t)});t.on("AppendOperatorList",({pageProxyId:t,operatorListId:e,fnArray:r,argsArray:n})=>{const a=this.#re(t,e);for(let t=0,e=r.length;t<e;t++){a.fnArray.push(r[t]);a.argsArray.push(n[t])}});t.on("InitializeGraphics",async t=>{const{width:e,height:r,pageProxyId:n,operatorListId:a,renderTaskId:s,hasAnnotationCanvasMap:i=!1,transform:o,viewport:c,transparency:l,background:h,pixelRatio:u,recordOperations:p=!1,recordImages:d=!1,partialFrames:f=!1}=t,g=new OffscreenCanvas(e,r),m=this.#re(n,a),_={pageProxyId:n,renderTaskId:s,canvas:g,partialFrames:f,lastFrameTime:Date.now(),gfx:null,sharedOperatorList:m,dependencyTracker:null,imagesTracker:null,operatorList:{fnArray:[],argsArray:[],lastChunk:!1,pathCache:m.pathCache},operatorListIdx:0,lastFrameIdx:0,operationsFilterMask:null,continueResolve:null,aborted:!1};this.#Jt.set(s,_);try{const e=this.#ee(n),r=OptionalContentConfig.fromSerializable(t.optionalContentConfig),a=this.#Gt??=new OffscreenCanvasFactory({enableHWA:this.#It}),s=this.#Xt??=new WorkerFilterFactory,f=i?new Map:null,{dependencyTracker:m,imagesTracker:b}=function createCanvasTrackers(t,e,{recordOperations:r=!1,recordImages:n=!1,recordDebugMetadata:a=!1}){const s=r||n?new CanvasBBoxTracker(t,e):null;return{dependencyTracker:r?new CanvasDependencyTracker(s,a):s,imagesTracker:n?new CanvasImagesTracker(t):null}}(g,0,{recordOperations:p,recordImages:d}),x=new CanvasGraphics(a.getNoAlphaContext(g),this.#Wt,e,a,s,{optionalContentConfig:r,pixelRatio:u},f,null,m,b);x.beginDrawing({transform:o,viewport:c,transparency:l,background:h});_.gfx=x;_.dependencyTracker=m;_.imagesTracker=b}catch(t){this.#oe(s);throw t}});t.on("ExecuteOperatorList",async e=>{const{renderTaskId:r,operatorListIdx:n,operatorListLength:a,operationsFilterMask:s,lastChunk:i}=e,o=this.#Jt.get(r);if(!o)return{operatorListIdx:n,aborted:!0};if(this.#Yt&&this.#Ht&&!isGPUReady()){await initGPU();if(o.aborted)return{operatorListIdx:n,aborted:!0}}o.operatorListIdx=n;this.#le(o,a,s,i);const c=await this.#he(t,o);let l=null,h=null;if(o.operatorList.lastChunk&&c===o.operatorList.argsArray.length){l=o.dependencyTracker?.take().buffer??null;h=o.imagesTracker?.take()??null;const e=o.aborted;this.#oe(r,!e);if(!e)try{await this.#ae(t,o,!0)}finally{this.#ce(o)}}else await this.#se(t,o);return{operatorListIdx:c,recordedBBoxesBuffer:l,imageCoordinates:h}})}static#te(t){const e=new MessageHandler("renderer","main",t);this.#de(e);e.on("Connect",({sourceName:e,targetName:r})=>{this.#fe();const n=new MessageHandler(e,r,t);this.#zt=n;this.#de(n);n.on("Disconnect",()=>{this.#fe()});this.#ge(n)});this.#ge(e)}static#fe(){if(this.#zt){for(const t of this.#Jt.keys())this.#oe(t);for(const t of this.#$t.values())t.clear();this.#$t.clear();this.#Kt.clear();this.#Yt=!1;this.#Wt.clear();this.#Vt.clear();this.#Wt=new PDFObjects;this.#Vt=new FontLoader({ownerDocument:globalThis});this.#Gt=null;this.#Xt?.destroy();this.#Xt=null;this.#zt.send("Disconnected",null);this.#zt.destroy();this.#zt=null}}static#ge(t){const e=new Uint8Array;t.send("ready",{testObj:e,workerVersion:"6.5.438"},[e.buffer])}}