/** * name: pdf-document-viewer * version: v0.8.67 * description: * author: */ (function(Dr,yi){typeof exports=="object"&&typeof module<"u"?yi(exports):typeof define=="function"&&define.amd?define(["exports"],yi):(Dr=typeof globalThis<"u"?globalThis:Dr||self,yi(Dr.ImageViewer={}))})(this,function(exports){"use strict";var Qs=Object.defineProperty;var ea=(Dr,yi,vi)=>yi in Dr?Qs(Dr,yi,{enumerable:!0,configurable:!0,writable:!0,value:vi}):Dr[yi]=vi;var es=(Dr,yi,vi)=>(ea(Dr,typeof yi!="symbol"?yi+"":yi,vi),vi),bs=(Dr,yi,vi)=>{if(!yi.has(Dr))throw TypeError("Cannot "+vi)};var Cr=(Dr,yi,vi)=>(bs(Dr,yi,"read from private field"),vi?vi.call(Dr):yi.get(Dr)),Er=(Dr,yi,vi)=>{if(yi.has(Dr))throw TypeError("Cannot add the same private member more than once");yi instanceof WeakSet?yi.add(Dr):yi.set(Dr,vi)},Nr=(Dr,yi,vi,bi)=>(bs(Dr,yi,"write to private field"),bi?bi.call(Dr,vi):yi.set(Dr,vi),vi);var xr=(Dr,yi,vi)=>(bs(Dr,yi,"access private method"),vi);const component_viewer$1="",index="";if(typeof window<"u"){let yi=function(){var vi=document.body,bi=document.getElementById("__svg__viewer_0_8_67__icons__dom__");bi||(bi=document.createElementNS("http://www.w3.org/2000/svg","svg"),bi.style.position="absolute",bi.style.width="0",bi.style.height="0",bi.id="__svg__viewer_0_8_67__icons__dom__",bi.setAttribute("xmlns","http://www.w3.org/2000/svg"),bi.setAttribute("xmlns:link","http://www.w3.org/1999/xlink")),bi.innerHTML='',vi.insertBefore(bi,vi.lastChild)};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",yi):yi()}window.requestIdleCallback=window.requestIdleCallback||(yi=>{const vi=Date.now();return setTimeout(()=>{yi({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-vi))})},1)}),window.cancelIdleCallback=window.cancelIdleCallback||(yi=>{clearTimeout(yi)});var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getAugmentedNamespace(yi){if(yi.__esModule)return yi;var vi=yi.default;if(typeof vi=="function"){var bi=function _i(){if(this instanceof _i){var $i=[null];$i.push.apply($i,arguments);var Pi=Function.bind.apply(vi,$i);return new Pi}return vi.apply(this,arguments)};bi.prototype=vi.prototype}else bi={};return Object.defineProperty(bi,"__esModule",{value:!0}),Object.keys(yi).forEach(function(_i){var $i=Object.getOwnPropertyDescriptor(yi,_i);Object.defineProperty(bi,_i,$i.get?$i:{enumerable:!0,get:function(){return yi[_i]}})}),bi}var arrayBufferBasicDetection=typeof ArrayBuffer<"u"&&typeof DataView<"u",fails$d=function(yi){try{return!!yi()}catch{return!0}},fails$c=fails$d,descriptors=!fails$c(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),check=function(yi){return yi&&yi.Math==Math&&yi},global$h=check(typeof globalThis=="object"&&globalThis)||check(typeof window=="object"&&window)||check(typeof self=="object"&&self)||check(typeof commonjsGlobal=="object"&&commonjsGlobal)||function(){return this}()||commonjsGlobal||Function("return this")(),documentAll$2=typeof document=="object"&&document.all,IS_HTMLDDA=typeof documentAll$2>"u"&&documentAll$2!==void 0,documentAll_1={all:documentAll$2,IS_HTMLDDA},$documentAll$1=documentAll_1,documentAll$1=$documentAll$1.all,isCallable$h=$documentAll$1.IS_HTMLDDA?function(yi){return typeof yi=="function"||yi===documentAll$1}:function(yi){return typeof yi=="function"},isCallable$g=isCallable$h,$documentAll=documentAll_1,documentAll=$documentAll.all,isObject$j=$documentAll.IS_HTMLDDA?function(yi){return typeof yi=="object"?yi!==null:isCallable$g(yi)||yi===documentAll}:function(yi){return typeof yi=="object"?yi!==null:isCallable$g(yi)},fails$b=fails$d,functionBindNative=!fails$b(function(){var yi=function(){}.bind();return typeof yi!="function"||yi.hasOwnProperty("prototype")}),NATIVE_BIND$3=functionBindNative,FunctionPrototype$2=Function.prototype,call$b=FunctionPrototype$2.call,uncurryThisWithBind=NATIVE_BIND$3&&FunctionPrototype$2.bind.bind(call$b,call$b),functionUncurryThis=NATIVE_BIND$3?uncurryThisWithBind:function(yi){return function(){return call$b.apply(yi,arguments)}},isNullOrUndefined$3=function(yi){return yi==null},isNullOrUndefined$2=isNullOrUndefined$3,$TypeError$a=TypeError,requireObjectCoercible$2=function(yi){if(isNullOrUndefined$2(yi))throw $TypeError$a("Can't call method on "+yi);return yi},requireObjectCoercible$1=requireObjectCoercible$2,$Object$4=Object,toObject$4=function(yi){return $Object$4(requireObjectCoercible$1(yi))},uncurryThis$f=functionUncurryThis,toObject$3=toObject$4,hasOwnProperty$e=uncurryThis$f({}.hasOwnProperty),hasOwnProperty_1=Object.hasOwn||function(vi,bi){return hasOwnProperty$e(toObject$3(vi),bi)},sharedExports={},shared$3={get exports(){return sharedExports},set exports(yi){sharedExports=yi}},global$g=global$h,defineProperty$7=Object.defineProperty,defineGlobalProperty$3=function(yi,vi){try{defineProperty$7(global$g,yi,{value:vi,configurable:!0,writable:!0})}catch{global$g[yi]=vi}return vi},global$f=global$h,defineGlobalProperty$2=defineGlobalProperty$3,SHARED="__core-js_shared__",store$3=global$f[SHARED]||defineGlobalProperty$2(SHARED,{}),sharedStore=store$3,store$2=sharedStore;(shared$3.exports=function(yi,vi){return store$2[yi]||(store$2[yi]=vi!==void 0?vi:{})})("versions",[]).push({version:"3.32.0",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.32.0/LICENSE",source:"https://github.com/zloirock/core-js"});var uncurryThis$e=functionUncurryThis,id=0,postfix=Math.random(),toString$5=uncurryThis$e(1 .toString),uid$3=function(yi){return"Symbol("+(yi===void 0?"":yi)+")_"+toString$5(++id+postfix,36)},engineUserAgent=typeof navigator<"u"&&String(navigator.userAgent)||"",global$e=global$h,userAgent$2=engineUserAgent,process$1=global$e.process,Deno$1=global$e.Deno,versions=process$1&&process$1.versions||Deno$1&&Deno$1.version,v8=versions&&versions.v8,match,version;v8&&(match=v8.split("."),version=match[0]>0&&match[0]<4?1:+(match[0]+match[1])),!version&&userAgent$2&&(match=userAgent$2.match(/Edge\/(\d+)/),(!match||match[1]>=74)&&(match=userAgent$2.match(/Chrome\/(\d+)/),match&&(version=+match[1])));var engineV8Version=version,V8_VERSION$1=engineV8Version,fails$a=fails$d,global$d=global$h,$String$6=global$d.String,symbolConstructorDetection=!!Object.getOwnPropertySymbols&&!fails$a(function(){var yi=Symbol();return!$String$6(yi)||!(Object(yi)instanceof Symbol)||!Symbol.sham&&V8_VERSION$1&&V8_VERSION$1<41}),NATIVE_SYMBOL$2=symbolConstructorDetection,useSymbolAsUid=NATIVE_SYMBOL$2&&!Symbol.sham&&typeof Symbol.iterator=="symbol",global$c=global$h,shared$2=sharedExports,hasOwn$9=hasOwnProperty_1,uid$2=uid$3,NATIVE_SYMBOL$1=symbolConstructorDetection,USE_SYMBOL_AS_UID$1=useSymbolAsUid,Symbol$7=global$c.Symbol,WellKnownSymbolsStore=shared$2("wks"),createWellKnownSymbol=USE_SYMBOL_AS_UID$1?Symbol$7.for||Symbol$7:Symbol$7&&Symbol$7.withoutSetter||uid$2,wellKnownSymbol$a=function(yi){return hasOwn$9(WellKnownSymbolsStore,yi)||(WellKnownSymbolsStore[yi]=NATIVE_SYMBOL$1&&hasOwn$9(Symbol$7,yi)?Symbol$7[yi]:createWellKnownSymbol("Symbol."+yi)),WellKnownSymbolsStore[yi]},wellKnownSymbol$9=wellKnownSymbol$a,TO_STRING_TAG$3=wellKnownSymbol$9("toStringTag"),test={};test[TO_STRING_TAG$3]="z";var toStringTagSupport=String(test)==="[object z]",uncurryThis$d=functionUncurryThis,toString$4=uncurryThis$d({}.toString),stringSlice$1=uncurryThis$d("".slice),classofRaw$2=function(yi){return stringSlice$1(toString$4(yi),8,-1)},TO_STRING_TAG_SUPPORT=toStringTagSupport,isCallable$f=isCallable$h,classofRaw$1=classofRaw$2,wellKnownSymbol$8=wellKnownSymbol$a,TO_STRING_TAG$2=wellKnownSymbol$8("toStringTag"),$Object$3=Object,CORRECT_ARGUMENTS=classofRaw$1(function(){return arguments}())=="Arguments",tryGet=function(yi,vi){try{return yi[vi]}catch{}},classof$7=TO_STRING_TAG_SUPPORT?classofRaw$1:function(yi){var vi,bi,_i;return yi===void 0?"Undefined":yi===null?"Null":typeof(bi=tryGet(vi=$Object$3(yi),TO_STRING_TAG$2))=="string"?bi:CORRECT_ARGUMENTS?classofRaw$1(vi):(_i=classofRaw$1(vi))=="Object"&&isCallable$f(vi.callee)?"Arguments":_i},$String$5=String,tryToString$4=function(yi){try{return $String$5(yi)}catch{return"Object"}},objectDefineProperty={},global$b=global$h,isObject$i=isObject$j,document$1=global$b.document,EXISTS$1=isObject$i(document$1)&&isObject$i(document$1.createElement),documentCreateElement$1=function(yi){return EXISTS$1?document$1.createElement(yi):{}},DESCRIPTORS$8=descriptors,fails$9=fails$d,createElement=documentCreateElement$1,ie8DomDefine=!DESCRIPTORS$8&&!fails$9(function(){return Object.defineProperty(createElement("div"),"a",{get:function(){return 7}}).a!=7}),DESCRIPTORS$7=descriptors,fails$8=fails$d,v8PrototypeDefineBug=DESCRIPTORS$7&&fails$8(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),isObject$h=isObject$j,$String$4=String,$TypeError$9=TypeError,anObject$8=function(yi){if(isObject$h(yi))return yi;throw $TypeError$9($String$4(yi)+" is not an object")},NATIVE_BIND$2=functionBindNative,call$a=Function.prototype.call,functionCall=NATIVE_BIND$2?call$a.bind(call$a):function(){return call$a.apply(call$a,arguments)},global$a=global$h,isCallable$e=isCallable$h,aFunction=function(yi){return isCallable$e(yi)?yi:void 0},getBuiltIn$4=function(yi,vi){return arguments.length<2?aFunction(global$a[yi]):global$a[yi]&&global$a[yi][vi]},uncurryThis$c=functionUncurryThis,objectIsPrototypeOf=uncurryThis$c({}.isPrototypeOf),getBuiltIn$3=getBuiltIn$4,isCallable$d=isCallable$h,isPrototypeOf$2=objectIsPrototypeOf,USE_SYMBOL_AS_UID=useSymbolAsUid,$Object$2=Object,isSymbol$9=USE_SYMBOL_AS_UID?function(yi){return typeof yi=="symbol"}:function(yi){var vi=getBuiltIn$3("Symbol");return isCallable$d(vi)&&isPrototypeOf$2(vi.prototype,$Object$2(yi))},isCallable$c=isCallable$h,tryToString$3=tryToString$4,$TypeError$8=TypeError,aCallable$8=function(yi){if(isCallable$c(yi))return yi;throw $TypeError$8(tryToString$3(yi)+" is not a function")},aCallable$7=aCallable$8,isNullOrUndefined$1=isNullOrUndefined$3,getMethod$3=function(yi,vi){var bi=yi[vi];return isNullOrUndefined$1(bi)?void 0:aCallable$7(bi)},call$9=functionCall,isCallable$b=isCallable$h,isObject$g=isObject$j,$TypeError$7=TypeError,ordinaryToPrimitive$1=function(yi,vi){var bi,_i;if(vi==="string"&&isCallable$b(bi=yi.toString)&&!isObject$g(_i=call$9(bi,yi))||isCallable$b(bi=yi.valueOf)&&!isObject$g(_i=call$9(bi,yi))||vi!=="string"&&isCallable$b(bi=yi.toString)&&!isObject$g(_i=call$9(bi,yi)))return _i;throw $TypeError$7("Can't convert object to primitive value")},call$8=functionCall,isObject$f=isObject$j,isSymbol$8=isSymbol$9,getMethod$2=getMethod$3,ordinaryToPrimitive=ordinaryToPrimitive$1,wellKnownSymbol$7=wellKnownSymbol$a,$TypeError$6=TypeError,TO_PRIMITIVE=wellKnownSymbol$7("toPrimitive"),toPrimitive$1=function(yi,vi){if(!isObject$f(yi)||isSymbol$8(yi))return yi;var bi=getMethod$2(yi,TO_PRIMITIVE),_i;if(bi){if(vi===void 0&&(vi="default"),_i=call$8(bi,yi,vi),!isObject$f(_i)||isSymbol$8(_i))return _i;throw $TypeError$6("Can't convert object to primitive value")}return vi===void 0&&(vi="number"),ordinaryToPrimitive(yi,vi)},toPrimitive=toPrimitive$1,isSymbol$7=isSymbol$9,toPropertyKey$3=function(yi){var vi=toPrimitive(yi,"string");return isSymbol$7(vi)?vi:vi+""},DESCRIPTORS$6=descriptors,IE8_DOM_DEFINE$1=ie8DomDefine,V8_PROTOTYPE_DEFINE_BUG$1=v8PrototypeDefineBug,anObject$7=anObject$8,toPropertyKey$2=toPropertyKey$3,$TypeError$5=TypeError,$defineProperty=Object.defineProperty,$getOwnPropertyDescriptor$1=Object.getOwnPropertyDescriptor,ENUMERABLE="enumerable",CONFIGURABLE$1="configurable",WRITABLE="writable";objectDefineProperty.f=DESCRIPTORS$6?V8_PROTOTYPE_DEFINE_BUG$1?function(vi,bi,_i){if(anObject$7(vi),bi=toPropertyKey$2(bi),anObject$7(_i),typeof vi=="function"&&bi==="prototype"&&"value"in _i&&WRITABLE in _i&&!_i[WRITABLE]){var $i=$getOwnPropertyDescriptor$1(vi,bi);$i&&$i[WRITABLE]&&(vi[bi]=_i.value,_i={configurable:CONFIGURABLE$1 in _i?_i[CONFIGURABLE$1]:$i[CONFIGURABLE$1],enumerable:ENUMERABLE in _i?_i[ENUMERABLE]:$i[ENUMERABLE],writable:!1})}return $defineProperty(vi,bi,_i)}:$defineProperty:function(vi,bi,_i){if(anObject$7(vi),bi=toPropertyKey$2(bi),anObject$7(_i),IE8_DOM_DEFINE$1)try{return $defineProperty(vi,bi,_i)}catch{}if("get"in _i||"set"in _i)throw $TypeError$5("Accessors not supported");return"value"in _i&&(vi[bi]=_i.value),vi};var createPropertyDescriptor$3=function(yi,vi){return{enumerable:!(yi&1),configurable:!(yi&2),writable:!(yi&4),value:vi}},DESCRIPTORS$5=descriptors,definePropertyModule$4=objectDefineProperty,createPropertyDescriptor$2=createPropertyDescriptor$3,createNonEnumerableProperty$3=DESCRIPTORS$5?function(yi,vi,bi){return definePropertyModule$4.f(yi,vi,createPropertyDescriptor$2(1,bi))}:function(yi,vi,bi){return yi[vi]=bi,yi},makeBuiltInExports={},makeBuiltIn$3={get exports(){return makeBuiltInExports},set exports(yi){makeBuiltInExports=yi}},DESCRIPTORS$4=descriptors,hasOwn$8=hasOwnProperty_1,FunctionPrototype$1=Function.prototype,getDescriptor=DESCRIPTORS$4&&Object.getOwnPropertyDescriptor,EXISTS=hasOwn$8(FunctionPrototype$1,"name"),PROPER=EXISTS&&function(){}.name==="something",CONFIGURABLE=EXISTS&&(!DESCRIPTORS$4||DESCRIPTORS$4&&getDescriptor(FunctionPrototype$1,"name").configurable),functionName={EXISTS,PROPER,CONFIGURABLE},uncurryThis$b=functionUncurryThis,isCallable$a=isCallable$h,store$1=sharedStore,functionToString=uncurryThis$b(Function.toString);isCallable$a(store$1.inspectSource)||(store$1.inspectSource=function(yi){return functionToString(yi)});var inspectSource$2=store$1.inspectSource,global$9=global$h,isCallable$9=isCallable$h,WeakMap$4=global$9.WeakMap,weakMapBasicDetection=isCallable$9(WeakMap$4)&&/native code/.test(String(WeakMap$4)),shared$1=sharedExports,uid$1=uid$3,keys$4=shared$1("keys"),sharedKey$3=function(yi){return keys$4[yi]||(keys$4[yi]=uid$1(yi))},hiddenKeys$4={},NATIVE_WEAK_MAP=weakMapBasicDetection,global$8=global$h,isObject$e=isObject$j,createNonEnumerableProperty$2=createNonEnumerableProperty$3,hasOwn$7=hasOwnProperty_1,shared=sharedStore,sharedKey$2=sharedKey$3,hiddenKeys$3=hiddenKeys$4,OBJECT_ALREADY_INITIALIZED="Object already initialized",TypeError$2=global$8.TypeError,WeakMap$3=global$8.WeakMap,set,get$2,has,enforce=function(yi){return has(yi)?get$2(yi):set(yi,{})},getterFor=function(yi){return function(vi){var bi;if(!isObject$e(vi)||(bi=get$2(vi)).type!==yi)throw TypeError$2("Incompatible receiver, "+yi+" required");return bi}};if(NATIVE_WEAK_MAP||shared.state){var store=shared.state||(shared.state=new WeakMap$3);store.get=store.get,store.has=store.has,store.set=store.set,set=function(yi,vi){if(store.has(yi))throw TypeError$2(OBJECT_ALREADY_INITIALIZED);return vi.facade=yi,store.set(yi,vi),vi},get$2=function(yi){return store.get(yi)||{}},has=function(yi){return store.has(yi)}}else{var STATE=sharedKey$2("state");hiddenKeys$3[STATE]=!0,set=function(yi,vi){if(hasOwn$7(yi,STATE))throw TypeError$2(OBJECT_ALREADY_INITIALIZED);return vi.facade=yi,createNonEnumerableProperty$2(yi,STATE,vi),vi},get$2=function(yi){return hasOwn$7(yi,STATE)?yi[STATE]:{}},has=function(yi){return hasOwn$7(yi,STATE)}}var internalState={set,get:get$2,has,enforce,getterFor},uncurryThis$a=functionUncurryThis,fails$7=fails$d,isCallable$8=isCallable$h,hasOwn$6=hasOwnProperty_1,DESCRIPTORS$3=descriptors,CONFIGURABLE_FUNCTION_NAME=functionName.CONFIGURABLE,inspectSource$1=inspectSource$2,InternalStateModule$1=internalState,enforceInternalState$1=InternalStateModule$1.enforce,getInternalState$1=InternalStateModule$1.get,$String$3=String,defineProperty$6=Object.defineProperty,stringSlice=uncurryThis$a("".slice),replace$1=uncurryThis$a("".replace),join=uncurryThis$a([].join),CONFIGURABLE_LENGTH=DESCRIPTORS$3&&!fails$7(function(){return defineProperty$6(function(){},"length",{value:8}).length!==8}),TEMPLATE=String(String).split("String"),makeBuiltIn$2=makeBuiltIn$3.exports=function(yi,vi,bi){stringSlice($String$3(vi),0,7)==="Symbol("&&(vi="["+replace$1($String$3(vi),/^Symbol\(([^)]*)\)/,"$1")+"]"),bi&&bi.getter&&(vi="get "+vi),bi&&bi.setter&&(vi="set "+vi),(!hasOwn$6(yi,"name")||CONFIGURABLE_FUNCTION_NAME&&yi.name!==vi)&&(DESCRIPTORS$3?defineProperty$6(yi,"name",{value:vi,configurable:!0}):yi.name=vi),CONFIGURABLE_LENGTH&&bi&&hasOwn$6(bi,"arity")&&yi.length!==bi.arity&&defineProperty$6(yi,"length",{value:bi.arity});try{bi&&hasOwn$6(bi,"constructor")&&bi.constructor?DESCRIPTORS$3&&defineProperty$6(yi,"prototype",{writable:!1}):yi.prototype&&(yi.prototype=void 0)}catch{}var _i=enforceInternalState$1(yi);return hasOwn$6(_i,"source")||(_i.source=join(TEMPLATE,typeof vi=="string"?vi:"")),yi};Function.prototype.toString=makeBuiltIn$2(function(){return isCallable$8(this)&&getInternalState$1(this).source||inspectSource$1(this)},"toString");var isCallable$7=isCallable$h,definePropertyModule$3=objectDefineProperty,makeBuiltIn$1=makeBuiltInExports,defineGlobalProperty$1=defineGlobalProperty$3,defineBuiltIn$2=function(yi,vi,bi,_i){_i||(_i={});var $i=_i.enumerable,Pi=_i.name!==void 0?_i.name:vi;if(isCallable$7(bi)&&makeBuiltIn$1(bi,Pi,_i),_i.global)$i?yi[vi]=bi:defineGlobalProperty$1(vi,bi);else{try{_i.unsafe?yi[vi]&&($i=!0):delete yi[vi]}catch{}$i?yi[vi]=bi:definePropertyModule$3.f(yi,vi,{value:bi,enumerable:!1,configurable:!_i.nonConfigurable,writable:!_i.nonWritable})}return yi},makeBuiltIn=makeBuiltInExports,defineProperty$5=objectDefineProperty,defineBuiltInAccessor$1=function(yi,vi,bi){return bi.get&&makeBuiltIn(bi.get,vi,{getter:!0}),bi.set&&makeBuiltIn(bi.set,vi,{setter:!0}),defineProperty$5.f(yi,vi,bi)},fails$6=fails$d,correctPrototypeGetter=!fails$6(function(){function yi(){}return yi.prototype.constructor=null,Object.getPrototypeOf(new yi)!==yi.prototype}),hasOwn$5=hasOwnProperty_1,isCallable$6=isCallable$h,toObject$2=toObject$4,sharedKey$1=sharedKey$3,CORRECT_PROTOTYPE_GETTER=correctPrototypeGetter,IE_PROTO$1=sharedKey$1("IE_PROTO"),$Object$1=Object,ObjectPrototype$1=$Object$1.prototype,objectGetPrototypeOf=CORRECT_PROTOTYPE_GETTER?$Object$1.getPrototypeOf:function(yi){var vi=toObject$2(yi);if(hasOwn$5(vi,IE_PROTO$1))return vi[IE_PROTO$1];var bi=vi.constructor;return isCallable$6(bi)&&vi instanceof bi?bi.prototype:vi instanceof $Object$1?ObjectPrototype$1:null},uncurryThis$9=functionUncurryThis,aCallable$6=aCallable$8,functionUncurryThisAccessor=function(yi,vi,bi){try{return uncurryThis$9(aCallable$6(Object.getOwnPropertyDescriptor(yi,vi)[bi]))}catch{}},isCallable$5=isCallable$h,$String$2=String,$TypeError$4=TypeError,aPossiblePrototype$1=function(yi){if(typeof yi=="object"||isCallable$5(yi))return yi;throw $TypeError$4("Can't set "+$String$2(yi)+" as a prototype")},uncurryThisAccessor=functionUncurryThisAccessor,anObject$6=anObject$8,aPossiblePrototype=aPossiblePrototype$1,objectSetPrototypeOf=Object.setPrototypeOf||("__proto__"in{}?function(){var yi=!1,vi={},bi;try{bi=uncurryThisAccessor(Object.prototype,"__proto__","set"),bi(vi,[]),yi=vi instanceof Array}catch{}return function($i,Pi){return anObject$6($i),aPossiblePrototype(Pi),yi?bi($i,Pi):$i.__proto__=Pi,$i}}():void 0),NATIVE_ARRAY_BUFFER=arrayBufferBasicDetection,DESCRIPTORS$2=descriptors,global$7=global$h,isCallable$4=isCallable$h,isObject$d=isObject$j,hasOwn$4=hasOwnProperty_1,classof$6=classof$7,tryToString$2=tryToString$4,createNonEnumerableProperty$1=createNonEnumerableProperty$3,defineBuiltIn$1=defineBuiltIn$2,defineBuiltInAccessor=defineBuiltInAccessor$1,isPrototypeOf$1=objectIsPrototypeOf,getPrototypeOf=objectGetPrototypeOf,setPrototypeOf=objectSetPrototypeOf,wellKnownSymbol$6=wellKnownSymbol$a,uid=uid$3,InternalStateModule=internalState,enforceInternalState=InternalStateModule.enforce,getInternalState=InternalStateModule.get,Int8Array$1=global$7.Int8Array,Int8ArrayPrototype$1=Int8Array$1&&Int8Array$1.prototype,Uint8ClampedArray$1=global$7.Uint8ClampedArray,Uint8ClampedArrayPrototype=Uint8ClampedArray$1&&Uint8ClampedArray$1.prototype,TypedArray=Int8Array$1&&getPrototypeOf(Int8Array$1),TypedArrayPrototype=Int8ArrayPrototype$1&&getPrototypeOf(Int8ArrayPrototype$1),ObjectPrototype=Object.prototype,TypeError$1=global$7.TypeError,TO_STRING_TAG$1=wellKnownSymbol$6("toStringTag"),TYPED_ARRAY_TAG=uid("TYPED_ARRAY_TAG"),TYPED_ARRAY_CONSTRUCTOR="TypedArrayConstructor",NATIVE_ARRAY_BUFFER_VIEWS=NATIVE_ARRAY_BUFFER&&!!setPrototypeOf&&classof$6(global$7.opera)!=="Opera",TYPED_ARRAY_TAG_REQUIRED=!1,NAME,Constructor,Prototype,TypedArrayConstructorsList={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},BigIntArrayConstructorsList={BigInt64Array:8,BigUint64Array:8},isView=function(vi){if(!isObject$d(vi))return!1;var bi=classof$6(vi);return bi==="DataView"||hasOwn$4(TypedArrayConstructorsList,bi)||hasOwn$4(BigIntArrayConstructorsList,bi)},getTypedArrayConstructor=function(yi){var vi=getPrototypeOf(yi);if(isObject$d(vi)){var bi=getInternalState(vi);return bi&&hasOwn$4(bi,TYPED_ARRAY_CONSTRUCTOR)?bi[TYPED_ARRAY_CONSTRUCTOR]:getTypedArrayConstructor(vi)}},isTypedArray$5=function(yi){if(!isObject$d(yi))return!1;var vi=classof$6(yi);return hasOwn$4(TypedArrayConstructorsList,vi)||hasOwn$4(BigIntArrayConstructorsList,vi)},aTypedArray$3=function(yi){if(isTypedArray$5(yi))return yi;throw TypeError$1("Target is not a typed array")},aTypedArrayConstructor=function(yi){if(isCallable$4(yi)&&(!setPrototypeOf||isPrototypeOf$1(TypedArray,yi)))return yi;throw TypeError$1(tryToString$2(yi)+" is not a typed array constructor")},exportTypedArrayMethod$3=function(yi,vi,bi,_i){if(DESCRIPTORS$2){if(bi)for(var $i in TypedArrayConstructorsList){var Pi=global$7[$i];if(Pi&&hasOwn$4(Pi.prototype,yi))try{delete Pi.prototype[yi]}catch{try{Pi.prototype[yi]=vi}catch{}}}(!TypedArrayPrototype[yi]||bi)&&defineBuiltIn$1(TypedArrayPrototype,yi,bi?vi:NATIVE_ARRAY_BUFFER_VIEWS&&Int8ArrayPrototype$1[yi]||vi,_i)}},exportTypedArrayStaticMethod=function(yi,vi,bi){var _i,$i;if(DESCRIPTORS$2){if(setPrototypeOf){if(bi){for(_i in TypedArrayConstructorsList)if($i=global$7[_i],$i&&hasOwn$4($i,yi))try{delete $i[yi]}catch{}}if(!TypedArray[yi]||bi)try{return defineBuiltIn$1(TypedArray,yi,bi?vi:NATIVE_ARRAY_BUFFER_VIEWS&&TypedArray[yi]||vi)}catch{}else return}for(_i in TypedArrayConstructorsList)$i=global$7[_i],$i&&(!$i[yi]||bi)&&defineBuiltIn$1($i,yi,vi)}};for(NAME in TypedArrayConstructorsList)Constructor=global$7[NAME],Prototype=Constructor&&Constructor.prototype,Prototype?enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR]=Constructor:NATIVE_ARRAY_BUFFER_VIEWS=!1;for(NAME in BigIntArrayConstructorsList)Constructor=global$7[NAME],Prototype=Constructor&&Constructor.prototype,Prototype&&(enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR]=Constructor);if((!NATIVE_ARRAY_BUFFER_VIEWS||!isCallable$4(TypedArray)||TypedArray===Function.prototype)&&(TypedArray=function(){throw TypeError$1("Incorrect invocation")},NATIVE_ARRAY_BUFFER_VIEWS))for(NAME in TypedArrayConstructorsList)global$7[NAME]&&setPrototypeOf(global$7[NAME],TypedArray);if((!NATIVE_ARRAY_BUFFER_VIEWS||!TypedArrayPrototype||TypedArrayPrototype===ObjectPrototype)&&(TypedArrayPrototype=TypedArray.prototype,NATIVE_ARRAY_BUFFER_VIEWS))for(NAME in TypedArrayConstructorsList)global$7[NAME]&&setPrototypeOf(global$7[NAME].prototype,TypedArrayPrototype);if(NATIVE_ARRAY_BUFFER_VIEWS&&getPrototypeOf(Uint8ClampedArrayPrototype)!==TypedArrayPrototype&&setPrototypeOf(Uint8ClampedArrayPrototype,TypedArrayPrototype),DESCRIPTORS$2&&!hasOwn$4(TypedArrayPrototype,TO_STRING_TAG$1)){TYPED_ARRAY_TAG_REQUIRED=!0,defineBuiltInAccessor(TypedArrayPrototype,TO_STRING_TAG$1,{configurable:!0,get:function(){return isObject$d(this)?this[TYPED_ARRAY_TAG]:void 0}});for(NAME in TypedArrayConstructorsList)global$7[NAME]&&createNonEnumerableProperty$1(global$7[NAME],TYPED_ARRAY_TAG,NAME)}var arrayBufferViewCore={NATIVE_ARRAY_BUFFER_VIEWS,TYPED_ARRAY_TAG:TYPED_ARRAY_TAG_REQUIRED&&TYPED_ARRAY_TAG,aTypedArray:aTypedArray$3,aTypedArrayConstructor,exportTypedArrayMethod:exportTypedArrayMethod$3,exportTypedArrayStaticMethod,getTypedArrayConstructor,isView,isTypedArray:isTypedArray$5,TypedArray,TypedArrayPrototype},ceil=Math.ceil,floor$1=Math.floor,mathTrunc=Math.trunc||function(vi){var bi=+vi;return(bi>0?floor$1:ceil)(bi)},trunc=mathTrunc,toIntegerOrInfinity$5=function(yi){var vi=+yi;return vi!==vi||vi===0?0:trunc(vi)},toIntegerOrInfinity$4=toIntegerOrInfinity$5,min$1=Math.min,toLength$1=function(yi){return yi>0?min$1(toIntegerOrInfinity$4(yi),9007199254740991):0},toLength=toLength$1,lengthOfArrayLike$7=function(yi){return toLength(yi.length)},ArrayBufferViewCore$2=arrayBufferViewCore,lengthOfArrayLike$6=lengthOfArrayLike$7,toIntegerOrInfinity$3=toIntegerOrInfinity$5,aTypedArray$2=ArrayBufferViewCore$2.aTypedArray,exportTypedArrayMethod$2=ArrayBufferViewCore$2.exportTypedArrayMethod;exportTypedArrayMethod$2("at",function(vi){var bi=aTypedArray$2(this),_i=lengthOfArrayLike$6(bi),$i=toIntegerOrInfinity$3(vi),Pi=$i>=0?$i:_i+$i;return Pi<0||Pi>=_i?void 0:bi[Pi]});var toIntegerOrInfinity$2=toIntegerOrInfinity$5,$RangeError$1=RangeError,toPositiveInteger$1=function(yi){var vi=toIntegerOrInfinity$2(yi);if(vi<0)throw $RangeError$1("The argument can't be less than 0");return vi},toPositiveInteger=toPositiveInteger$1,$RangeError=RangeError,toOffset$1=function(yi,vi){var bi=toPositiveInteger(yi);if(bi%vi)throw $RangeError("Wrong offset");return bi},global$6=global$h,call$7=functionCall,ArrayBufferViewCore$1=arrayBufferViewCore,lengthOfArrayLike$5=lengthOfArrayLike$7,toOffset=toOffset$1,toIndexedObject$5=toObject$4,fails$5=fails$d,RangeError$1=global$6.RangeError,Int8Array=global$6.Int8Array,Int8ArrayPrototype=Int8Array&&Int8Array.prototype,$set=Int8ArrayPrototype&&Int8ArrayPrototype.set,aTypedArray$1=ArrayBufferViewCore$1.aTypedArray,exportTypedArrayMethod$1=ArrayBufferViewCore$1.exportTypedArrayMethod,WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS=!fails$5(function(){var yi=new Uint8ClampedArray(2);return call$7($set,yi,{length:1,0:3},1),yi[1]!==3}),TO_OBJECT_BUG=WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS&&ArrayBufferViewCore$1.NATIVE_ARRAY_BUFFER_VIEWS&&fails$5(function(){var yi=new Int8Array(2);return yi.set(1),yi.set("2",1),yi[0]!==0||yi[1]!==2});exportTypedArrayMethod$1("set",function(vi){aTypedArray$1(this);var bi=toOffset(arguments.length>1?arguments[1]:void 0,1),_i=toIndexedObject$5(vi);if(WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS)return call$7($set,this,_i,bi);var $i=this.length,Pi=lengthOfArrayLike$5(_i),Ai=0;if(Pi+bi>$i)throw RangeError$1("Wrong length");for(;Ai0;)yi[Pi]=yi[--Pi];Pi!==_i++&&(yi[Pi]=$i)}return yi},merge=function(yi,vi,bi,_i){for(var $i=vi.length,Pi=bi.length,Ai=0,Si=0;Ai<$i||Si0&&1/bi<0?1:-1:vi>bi}};exportTypedArrayMethod("sort",function(vi){return vi!==void 0&&aCallable$5(vi),STABLE_SORT?nativeSort(this,vi):internalSort(aTypedArray(this),getSortCompare(vi))},!STABLE_SORT||ACCEPT_INCORRECT_ARGUMENTS);var objectDefineProperties={},uncurryThis$6=functionUncurryThis,fails$3=fails$d,classof$5=classofRaw$2,$Object=Object,split=uncurryThis$6("".split),indexedObject=fails$3(function(){return!$Object("z").propertyIsEnumerable(0)})?function(yi){return classof$5(yi)=="String"?split(yi,""):$Object(yi)}:$Object,IndexedObject$1=indexedObject,requireObjectCoercible=requireObjectCoercible$2,toIndexedObject$4=function(yi){return IndexedObject$1(requireObjectCoercible(yi))},toIndexedObject$3=toIndexedObject$4,toAbsoluteIndex=toAbsoluteIndex$2,lengthOfArrayLike$3=lengthOfArrayLike$7,createMethod$1=function(yi){return function(vi,bi,_i){var $i=toIndexedObject$3(vi),Pi=lengthOfArrayLike$3($i),Ai=toAbsoluteIndex(_i,Pi),Si;if(yi&&bi!=bi){for(;Pi>Ai;)if(Si=$i[Ai++],Si!=Si)return!0}else for(;Pi>Ai;Ai++)if((yi||Ai in $i)&&$i[Ai]===bi)return yi||Ai||0;return!yi&&-1}},arrayIncludes$2={includes:createMethod$1(!0),indexOf:createMethod$1(!1)},uncurryThis$5=functionUncurryThis,hasOwn$3=hasOwnProperty_1,toIndexedObject$2=toIndexedObject$4,indexOf=arrayIncludes$2.indexOf,hiddenKeys$2=hiddenKeys$4,push$1=uncurryThis$5([].push),objectKeysInternal=function(yi,vi){var bi=toIndexedObject$2(yi),_i=0,$i=[],Pi;for(Pi in bi)!hasOwn$3(hiddenKeys$2,Pi)&&hasOwn$3(bi,Pi)&&push$1($i,Pi);for(;vi.length>_i;)hasOwn$3(bi,Pi=vi[_i++])&&(~indexOf($i,Pi)||push$1($i,Pi));return $i},enumBugKeys$3=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],internalObjectKeys$1=objectKeysInternal,enumBugKeys$2=enumBugKeys$3,objectKeys$1=Object.keys||function(vi){return internalObjectKeys$1(vi,enumBugKeys$2)},DESCRIPTORS$1=descriptors,V8_PROTOTYPE_DEFINE_BUG=v8PrototypeDefineBug,definePropertyModule$1=objectDefineProperty,anObject$5=anObject$8,toIndexedObject$1=toIndexedObject$4,objectKeys=objectKeys$1;objectDefineProperties.f=DESCRIPTORS$1&&!V8_PROTOTYPE_DEFINE_BUG?Object.defineProperties:function(vi,bi){anObject$5(vi);for(var _i=toIndexedObject$1(bi),$i=objectKeys(bi),Pi=$i.length,Ai=0,Si;Pi>Ai;)definePropertyModule$1.f(vi,Si=$i[Ai++],_i[Si]);return vi};var getBuiltIn$2=getBuiltIn$4,html$1=getBuiltIn$2("document","documentElement"),anObject$4=anObject$8,definePropertiesModule=objectDefineProperties,enumBugKeys$1=enumBugKeys$3,hiddenKeys$1=hiddenKeys$4,html=html$1,documentCreateElement=documentCreateElement$1,sharedKey=sharedKey$3,GT=">",LT="<",PROTOTYPE="prototype",SCRIPT="script",IE_PROTO=sharedKey("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(yi){return LT+SCRIPT+GT+yi+LT+"/"+SCRIPT+GT},NullProtoObjectViaActiveX=function(yi){yi.write(scriptTag("")),yi.close();var vi=yi.parentWindow.Object;return yi=null,vi},NullProtoObjectViaIFrame=function(){var yi=documentCreateElement("iframe"),vi="java"+SCRIPT+":",bi;return yi.style.display="none",html.appendChild(yi),yi.src=String(vi),bi=yi.contentWindow.document,bi.open(),bi.write(scriptTag("document.F=Object")),bi.close(),bi.F},activeXDocument,NullProtoObject=function(){try{activeXDocument=new ActiveXObject("htmlfile")}catch{}NullProtoObject=typeof document<"u"?document.domain&&activeXDocument?NullProtoObjectViaActiveX(activeXDocument):NullProtoObjectViaIFrame():NullProtoObjectViaActiveX(activeXDocument);for(var yi=enumBugKeys$1.length;yi--;)delete NullProtoObject[PROTOTYPE][enumBugKeys$1[yi]];return NullProtoObject()};hiddenKeys$1[IE_PROTO]=!0;var objectCreate$1=Object.create||function(vi,bi){var _i;return vi!==null?(EmptyConstructor[PROTOTYPE]=anObject$4(vi),_i=new EmptyConstructor,EmptyConstructor[PROTOTYPE]=null,_i[IE_PROTO]=vi):_i=NullProtoObject(),bi===void 0?_i:definePropertiesModule.f(_i,bi)},wellKnownSymbol$5=wellKnownSymbol$a,create=objectCreate$1,defineProperty$4=objectDefineProperty.f,UNSCOPABLES=wellKnownSymbol$5("unscopables"),ArrayPrototype$1=Array.prototype;ArrayPrototype$1[UNSCOPABLES]==null&&defineProperty$4(ArrayPrototype$1,UNSCOPABLES,{configurable:!0,value:create(null)});var addToUnscopables$2=function(yi){ArrayPrototype$1[UNSCOPABLES][yi]=!0},addToUnscopables$1=addToUnscopables$2;addToUnscopables$1("flat");var objectGetOwnPropertyDescriptor={},objectPropertyIsEnumerable={},$propertyIsEnumerable={}.propertyIsEnumerable,getOwnPropertyDescriptor$1=Object.getOwnPropertyDescriptor,NASHORN_BUG=getOwnPropertyDescriptor$1&&!$propertyIsEnumerable.call({1:2},1);objectPropertyIsEnumerable.f=NASHORN_BUG?function(vi){var bi=getOwnPropertyDescriptor$1(this,vi);return!!bi&&bi.enumerable}:$propertyIsEnumerable;var DESCRIPTORS=descriptors,call$6=functionCall,propertyIsEnumerableModule=objectPropertyIsEnumerable,createPropertyDescriptor=createPropertyDescriptor$3,toIndexedObject=toIndexedObject$4,toPropertyKey=toPropertyKey$3,hasOwn$2=hasOwnProperty_1,IE8_DOM_DEFINE=ie8DomDefine,$getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor;objectGetOwnPropertyDescriptor.f=DESCRIPTORS?$getOwnPropertyDescriptor:function(vi,bi){if(vi=toIndexedObject(vi),bi=toPropertyKey(bi),IE8_DOM_DEFINE)try{return $getOwnPropertyDescriptor(vi,bi)}catch{}if(hasOwn$2(vi,bi))return createPropertyDescriptor(!call$6(propertyIsEnumerableModule.f,vi,bi),vi[bi])};var objectGetOwnPropertyNames={},internalObjectKeys=objectKeysInternal,enumBugKeys=enumBugKeys$3,hiddenKeys=enumBugKeys.concat("length","prototype");objectGetOwnPropertyNames.f=Object.getOwnPropertyNames||function(vi){return internalObjectKeys(vi,hiddenKeys)};var objectGetOwnPropertySymbols={};objectGetOwnPropertySymbols.f=Object.getOwnPropertySymbols;var getBuiltIn$1=getBuiltIn$4,uncurryThis$4=functionUncurryThis,getOwnPropertyNamesModule=objectGetOwnPropertyNames,getOwnPropertySymbolsModule=objectGetOwnPropertySymbols,anObject$3=anObject$8,concat=uncurryThis$4([].concat),ownKeys$1=getBuiltIn$1("Reflect","ownKeys")||function(vi){var bi=getOwnPropertyNamesModule.f(anObject$3(vi)),_i=getOwnPropertySymbolsModule.f;return _i?concat(bi,_i(vi)):bi},hasOwn$1=hasOwnProperty_1,ownKeys=ownKeys$1,getOwnPropertyDescriptorModule=objectGetOwnPropertyDescriptor,definePropertyModule=objectDefineProperty,copyConstructorProperties$1=function(yi,vi,bi){for(var _i=ownKeys(vi),$i=definePropertyModule.f,Pi=getOwnPropertyDescriptorModule.f,Ai=0;Ai<_i.length;Ai++){var Si=_i[Ai];!hasOwn$1(yi,Si)&&!(bi&&hasOwn$1(bi,Si))&&$i(yi,Si,Pi(vi,Si))}},fails$2=fails$d,isCallable$3=isCallable$h,replacement=/#|\.prototype\./,isForced$2=function(yi,vi){var bi=data[normalize(yi)];return bi==POLYFILL?!0:bi==NATIVE?!1:isCallable$3(vi)?fails$2(vi):!!vi},normalize=isForced$2.normalize=function(yi){return String(yi).replace(replacement,".").toLowerCase()},data=isForced$2.data={},NATIVE=isForced$2.NATIVE="N",POLYFILL=isForced$2.POLYFILL="P",isForced_1=isForced$2,global$4=global$h,getOwnPropertyDescriptor=objectGetOwnPropertyDescriptor.f,createNonEnumerableProperty=createNonEnumerableProperty$3,defineBuiltIn=defineBuiltIn$2,defineGlobalProperty=defineGlobalProperty$3,copyConstructorProperties=copyConstructorProperties$1,isForced$1=isForced_1,_export=function(yi,vi){var bi=yi.target,_i=yi.global,$i=yi.stat,Pi,Ai,Si,Ei,wi,Ci;if(_i?Ai=global$4:$i?Ai=global$4[bi]||defineGlobalProperty(bi,{}):Ai=(global$4[bi]||{}).prototype,Ai)for(Si in vi){if(wi=vi[Si],yi.dontCallGetSet?(Ci=getOwnPropertyDescriptor(Ai,Si),Ei=Ci&&Ci.value):Ei=Ai[Si],Pi=isForced$1(_i?Si:bi+($i?".":"#")+Si,yi.forced),!Pi&&Ei!==void 0){if(typeof wi==typeof Ei)continue;copyConstructorProperties(wi,Ei)}(yi.sham||Ei&&Ei.sham)&&createNonEnumerableProperty(wi,"sham",!0),defineBuiltIn(Ai,Si,wi,yi)}},defineProperty$3=objectDefineProperty.f,hasOwn=hasOwnProperty_1,wellKnownSymbol$4=wellKnownSymbol$a,TO_STRING_TAG=wellKnownSymbol$4("toStringTag"),setToStringTag$1=function(yi,vi,bi){yi&&!bi&&(yi=yi.prototype),yi&&!hasOwn(yi,TO_STRING_TAG)&&defineProperty$3(yi,TO_STRING_TAG,{configurable:!0,value:vi})},$$k=_export,global$3=global$h,setToStringTag=setToStringTag$1;$$k({global:!0},{Reflect:{}}),setToStringTag(global$3.Reflect,"Reflect",!0);var aCallable$4=aCallable$8,toObject$1=toObject$4,IndexedObject=indexedObject,lengthOfArrayLike$2=lengthOfArrayLike$7,$TypeError$3=TypeError,createMethod=function(yi){return function(vi,bi,_i,$i){aCallable$4(bi);var Pi=toObject$1(vi),Ai=IndexedObject(Pi),Si=lengthOfArrayLike$2(Pi),Ei=yi?Si-1:0,wi=yi?-1:1;if(_i<2)for(;;){if(Ei in Ai){$i=Ai[Ei],Ei+=wi;break}if(Ei+=wi,yi?Ei<0:Si<=Ei)throw $TypeError$3("Reduce of empty array with no initial value")}for(;yi?Ei>=0:Si>Ei;Ei+=wi)Ei in Ai&&($i=bi($i,Ai[Ei],Ei,Pi));return $i}},arrayReduce={left:createMethod(!1),right:createMethod(!0)},fails$1=fails$d,arrayMethodIsStrict$1=function(yi,vi){var bi=[][yi];return!!bi&&fails$1(function(){bi.call(null,vi||function(){return 1},1)})},classof$4=classofRaw$2,engineIsNode=typeof process<"u"&&classof$4(process)=="process",$$j=_export,$reduce=arrayReduce.left,arrayMethodIsStrict=arrayMethodIsStrict$1,CHROME_VERSION=engineV8Version,IS_NODE$1=engineIsNode,CHROME_BUG=!IS_NODE$1&&CHROME_VERSION>79&&CHROME_VERSION<83,FORCED=CHROME_BUG||!arrayMethodIsStrict("reduce");$$j({target:"Array",proto:!0,forced:FORCED},{reduce:function(vi){var bi=arguments.length;return $reduce(this,vi,bi,bi>1?arguments[1]:void 0)}});const RenderingStates={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3};new Promise(function(yi){if(typeof PDFJSDev<"u"&&PDFJSDev.test("LIB")&&typeof window>"u"){setTimeout(yi,20);return}window.requestAnimationFrame(yi)});function unreachable(yi){throw new Error(yi)}(function(){function vi(bi,_i){this.constructor===vi&&unreachable("Cannot initialize BaseException."),this.message=bi,this.name=_i}return vi.prototype=new Error,vi.constructor=vi,vi})(),[...Array(256).keys()].map(yi=>yi.toString(16).padStart(2,"0"));const Dr=class{};let PixelsPerInch=Dr;es(PixelsPerInch,"CSS",96),es(PixelsPerInch,"PDF",72),es(PixelsPerInch,"PDF_TO_CSS_UNITS",Dr.CSS/Dr.PDF);let random=yi=>crypto.getRandomValues(new Uint8Array(yi)),customRandom=(yi,vi,bi)=>{let _i=(2<{let Ai="";for(;;){let Si=bi($i),Ei=$i;for(;Ei--;)if(Ai+=yi[Si[Ei]&_i]||"",Ai.length===Pi)return Ai}}},customAlphabet=(yi,vi=21)=>customRandom(yi,vi,random);var $$i=_export,toObject=toObject$4,lengthOfArrayLike$1=lengthOfArrayLike$7,toIntegerOrInfinity=toIntegerOrInfinity$5,addToUnscopables=addToUnscopables$2;$$i({target:"Array",proto:!0},{at:function(vi){var bi=toObject(this),_i=lengthOfArrayLike$1(bi),$i=toIntegerOrInfinity(vi),Pi=$i>=0?$i:_i+$i;return Pi<0||Pi>=_i?void 0:bi[Pi]}}),addToUnscopables("at");function identity$4(yi){return yi}var identity_1=identity$4;function arrayPush$2(yi,vi){for(var bi=-1,_i=vi.length,$i=yi.length;++bi<_i;)yi[$i+bi]=vi[bi];return yi}var _arrayPush=arrayPush$2,freeGlobal$1=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,_freeGlobal=freeGlobal$1,freeGlobal=_freeGlobal,freeSelf=typeof self=="object"&&self&&self.Object===Object&&self,root$9=freeGlobal||freeSelf||Function("return this")(),_root=root$9,root$8=_root,Symbol$6=root$8.Symbol,_Symbol=Symbol$6,Symbol$5=_Symbol,objectProto$g=Object.prototype,hasOwnProperty$d=objectProto$g.hasOwnProperty,nativeObjectToString$1=objectProto$g.toString,symToStringTag$1=Symbol$5?Symbol$5.toStringTag:void 0;function getRawTag$1(yi){var vi=hasOwnProperty$d.call(yi,symToStringTag$1),bi=yi[symToStringTag$1];try{yi[symToStringTag$1]=void 0;var _i=!0}catch{}var $i=nativeObjectToString$1.call(yi);return _i&&(vi?yi[symToStringTag$1]=bi:delete yi[symToStringTag$1]),$i}var _getRawTag=getRawTag$1,objectProto$f=Object.prototype,nativeObjectToString=objectProto$f.toString;function objectToString$1(yi){return nativeObjectToString.call(yi)}var _objectToString=objectToString$1,Symbol$4=_Symbol,getRawTag=_getRawTag,objectToString=_objectToString,nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=Symbol$4?Symbol$4.toStringTag:void 0;function baseGetTag$6(yi){return yi==null?yi===void 0?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(yi)?getRawTag(yi):objectToString(yi)}var _baseGetTag=baseGetTag$6;function isObjectLike$7(yi){return yi!=null&&typeof yi=="object"}var isObjectLike_1=isObjectLike$7,baseGetTag$5=_baseGetTag,isObjectLike$6=isObjectLike_1,argsTag$2="[object Arguments]";function baseIsArguments$1(yi){return isObjectLike$6(yi)&&baseGetTag$5(yi)==argsTag$2}var _baseIsArguments=baseIsArguments$1,baseIsArguments=_baseIsArguments,isObjectLike$5=isObjectLike_1,objectProto$e=Object.prototype,hasOwnProperty$c=objectProto$e.hasOwnProperty,propertyIsEnumerable$1=objectProto$e.propertyIsEnumerable,isArguments$5=baseIsArguments(function(){return arguments}())?baseIsArguments:function(yi){return isObjectLike$5(yi)&&hasOwnProperty$c.call(yi,"callee")&&!propertyIsEnumerable$1.call(yi,"callee")},isArguments_1=isArguments$5,isArray$f=Array.isArray,isArray_1=isArray$f,Symbol$3=_Symbol,isArguments$4=isArguments_1,isArray$e=isArray_1,spreadableSymbol=Symbol$3?Symbol$3.isConcatSpreadable:void 0;function isFlattenable$1(yi){return isArray$e(yi)||isArguments$4(yi)||!!(spreadableSymbol&&yi&&yi[spreadableSymbol])}var _isFlattenable=isFlattenable$1,arrayPush$1=_arrayPush,isFlattenable=_isFlattenable;function baseFlatten$3(yi,vi,bi,_i,$i){var Pi=-1,Ai=yi.length;for(bi||(bi=isFlattenable),$i||($i=[]);++Pi0&&bi(Si)?vi>1?baseFlatten$3(Si,vi-1,bi,_i,$i):arrayPush$1($i,Si):_i||($i[$i.length]=Si)}return $i}var _baseFlatten=baseFlatten$3;function arrayMap$2(yi,vi){for(var bi=-1,_i=yi==null?0:yi.length,$i=Array(_i);++bi<_i;)$i[bi]=vi(yi[bi],bi,yi);return $i}var _arrayMap=arrayMap$2,baseGetTag$4=_baseGetTag,isObjectLike$4=isObjectLike_1,symbolTag$1="[object Symbol]";function isSymbol$6(yi){return typeof yi=="symbol"||isObjectLike$4(yi)&&baseGetTag$4(yi)==symbolTag$1}var isSymbol_1=isSymbol$6,isArray$d=isArray_1,isSymbol$5=isSymbol_1,reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey$3(yi,vi){if(isArray$d(yi))return!1;var bi=typeof yi;return bi=="number"||bi=="symbol"||bi=="boolean"||yi==null||isSymbol$5(yi)?!0:reIsPlainProp.test(yi)||!reIsDeepProp.test(yi)||vi!=null&&yi in Object(vi)}var _isKey=isKey$3;function isObject$c(yi){var vi=typeof yi;return yi!=null&&(vi=="object"||vi=="function")}var isObject_1=isObject$c,baseGetTag$3=_baseGetTag,isObject$b=isObject_1,asyncTag="[object AsyncFunction]",funcTag$1="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction$3(yi){if(!isObject$b(yi))return!1;var vi=baseGetTag$3(yi);return vi==funcTag$1||vi==genTag||vi==asyncTag||vi==proxyTag}var isFunction_1=isFunction$3,root$7=_root,coreJsData$1=root$7["__core-js_shared__"],_coreJsData=coreJsData$1,coreJsData=_coreJsData,maskSrcKey=function(){var yi=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return yi?"Symbol(src)_1."+yi:""}();function isMasked$1(yi){return!!maskSrcKey&&maskSrcKey in yi}var _isMasked=isMasked$1,funcProto$2=Function.prototype,funcToString$2=funcProto$2.toString;function toSource$2(yi){if(yi!=null){try{return funcToString$2.call(yi)}catch{}try{return yi+""}catch{}}return""}var _toSource=toSource$2,isFunction$2=isFunction_1,isMasked=_isMasked,isObject$a=isObject_1,toSource$1=_toSource,reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto$1=Function.prototype,objectProto$d=Object.prototype,funcToString$1=funcProto$1.toString,hasOwnProperty$b=objectProto$d.hasOwnProperty,reIsNative=RegExp("^"+funcToString$1.call(hasOwnProperty$b).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative$1(yi){if(!isObject$a(yi)||isMasked(yi))return!1;var vi=isFunction$2(yi)?reIsNative:reIsHostCtor;return vi.test(toSource$1(yi))}var _baseIsNative=baseIsNative$1;function getValue$1(yi,vi){return yi==null?void 0:yi[vi]}var _getValue=getValue$1,baseIsNative=_baseIsNative,getValue=_getValue;function getNative$7(yi,vi){var bi=getValue(yi,vi);return baseIsNative(bi)?bi:void 0}var _getNative=getNative$7,getNative$6=_getNative,nativeCreate$4=getNative$6(Object,"create"),_nativeCreate=nativeCreate$4,nativeCreate$3=_nativeCreate;function hashClear$1(){this.__data__=nativeCreate$3?nativeCreate$3(null):{},this.size=0}var _hashClear=hashClear$1;function hashDelete$1(yi){var vi=this.has(yi)&&delete this.__data__[yi];return this.size-=vi?1:0,vi}var _hashDelete=hashDelete$1,nativeCreate$2=_nativeCreate,HASH_UNDEFINED$2="__lodash_hash_undefined__",objectProto$c=Object.prototype,hasOwnProperty$a=objectProto$c.hasOwnProperty;function hashGet$1(yi){var vi=this.__data__;if(nativeCreate$2){var bi=vi[yi];return bi===HASH_UNDEFINED$2?void 0:bi}return hasOwnProperty$a.call(vi,yi)?vi[yi]:void 0}var _hashGet=hashGet$1,nativeCreate$1=_nativeCreate,objectProto$b=Object.prototype,hasOwnProperty$9=objectProto$b.hasOwnProperty;function hashHas$1(yi){var vi=this.__data__;return nativeCreate$1?vi[yi]!==void 0:hasOwnProperty$9.call(vi,yi)}var _hashHas=hashHas$1,nativeCreate=_nativeCreate,HASH_UNDEFINED$1="__lodash_hash_undefined__";function hashSet$1(yi,vi){var bi=this.__data__;return this.size+=this.has(yi)?0:1,bi[yi]=nativeCreate&&vi===void 0?HASH_UNDEFINED$1:vi,this}var _hashSet=hashSet$1,hashClear=_hashClear,hashDelete=_hashDelete,hashGet=_hashGet,hashHas=_hashHas,hashSet=_hashSet;function Hash$1(yi){var vi=-1,bi=yi==null?0:yi.length;for(this.clear();++vi-1}var _listCacheHas=listCacheHas$1,assocIndexOf=_assocIndexOf;function listCacheSet$1(yi,vi){var bi=this.__data__,_i=assocIndexOf(bi,yi);return _i<0?(++this.size,bi.push([yi,vi])):bi[_i][1]=vi,this}var _listCacheSet=listCacheSet$1,listCacheClear=_listCacheClear,listCacheDelete=_listCacheDelete,listCacheGet=_listCacheGet,listCacheHas=_listCacheHas,listCacheSet=_listCacheSet;function ListCache$4(yi){var vi=-1,bi=yi==null?0:yi.length;for(this.clear();++viSi))return!1;var wi=Pi.get(yi),Ci=Pi.get(vi);if(wi&&Ci)return wi==vi&&Ci==yi;var ki=-1,xi=!0,Ti=bi&COMPARE_UNORDERED_FLAG$3?new SetCache$1:void 0;for(Pi.set(yi,vi),Pi.set(vi,yi);++ki-1&&yi%1==0&&yi-1&&yi%1==0&&yi<=MAX_SAFE_INTEGER}var isLength_1=isLength$3,baseGetTag$2=_baseGetTag,isLength$2=isLength_1,isObjectLike$3=isObjectLike_1,argsTag$1="[object Arguments]",arrayTag$1="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",mapTag$2="[object Map]",numberTag="[object Number]",objectTag$3="[object Object]",regexpTag="[object RegExp]",setTag$2="[object Set]",stringTag="[object String]",weakMapTag$1="[object WeakMap]",arrayBufferTag="[object ArrayBuffer]",dataViewTag$1="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=!0,typedArrayTags[argsTag$1]=typedArrayTags[arrayTag$1]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag$1]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag$2]=typedArrayTags[numberTag]=typedArrayTags[objectTag$3]=typedArrayTags[regexpTag]=typedArrayTags[setTag$2]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag$1]=!1;function baseIsTypedArray$1(yi){return isObjectLike$3(yi)&&isLength$2(yi.length)&&!!typedArrayTags[baseGetTag$2(yi)]}var _baseIsTypedArray=baseIsTypedArray$1;function baseUnary$2(yi){return function(vi){return yi(vi)}}var _baseUnary=baseUnary$2,_nodeUtilExports={},_nodeUtil={get exports(){return _nodeUtilExports},set exports(yi){_nodeUtilExports=yi}};(function(yi,vi){var bi=_freeGlobal,_i=vi&&!vi.nodeType&&vi,$i=_i&&!0&&yi&&!yi.nodeType&&yi,Pi=$i&&$i.exports===_i,Ai=Pi&&bi.process,Si=function(){try{var Ei=$i&&$i.require&&$i.require("util").types;return Ei||Ai&&Ai.binding&&Ai.binding("util")}catch{}}();yi.exports=Si})(_nodeUtil,_nodeUtilExports);var baseIsTypedArray=_baseIsTypedArray,baseUnary$1=_baseUnary,nodeUtil=_nodeUtilExports,nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,isTypedArray$4=nodeIsTypedArray?baseUnary$1(nodeIsTypedArray):baseIsTypedArray,isTypedArray_1=isTypedArray$4,baseTimes=_baseTimes,isArguments$3=isArguments_1,isArray$9=isArray_1,isBuffer$3=isBufferExports,isIndex$3=_isIndex,isTypedArray$3=isTypedArray_1,objectProto$9=Object.prototype,hasOwnProperty$8=objectProto$9.hasOwnProperty;function arrayLikeKeys$2(yi,vi){var bi=isArray$9(yi),_i=!bi&&isArguments$3(yi),$i=!bi&&!_i&&isBuffer$3(yi),Pi=!bi&&!_i&&!$i&&isTypedArray$3(yi),Ai=bi||_i||$i||Pi,Si=Ai?baseTimes(yi.length,String):[],Ei=Si.length;for(var wi in yi)(vi||hasOwnProperty$8.call(yi,wi))&&!(Ai&&(wi=="length"||$i&&(wi=="offset"||wi=="parent")||Pi&&(wi=="buffer"||wi=="byteLength"||wi=="byteOffset")||isIndex$3(wi,Ei)))&&Si.push(wi);return Si}var _arrayLikeKeys=arrayLikeKeys$2,objectProto$8=Object.prototype;function isPrototype$4(yi){var vi=yi&&yi.constructor,bi=typeof vi=="function"&&vi.prototype||objectProto$8;return yi===bi}var _isPrototype=isPrototype$4;function overArg$2(yi,vi){return function(bi){return yi(vi(bi))}}var _overArg=overArg$2,overArg$1=_overArg,nativeKeys$1=overArg$1(Object.keys,Object),_nativeKeys=nativeKeys$1,isPrototype$3=_isPrototype,nativeKeys=_nativeKeys,objectProto$7=Object.prototype,hasOwnProperty$7=objectProto$7.hasOwnProperty;function baseKeys$2(yi){if(!isPrototype$3(yi))return nativeKeys(yi);var vi=[];for(var bi in Object(yi))hasOwnProperty$7.call(yi,bi)&&bi!="constructor"&&vi.push(bi);return vi}var _baseKeys=baseKeys$2,isFunction$1=isFunction_1,isLength$1=isLength_1;function isArrayLike$7(yi){return yi!=null&&isLength$1(yi.length)&&!isFunction$1(yi)}var isArrayLike_1=isArrayLike$7,arrayLikeKeys$1=_arrayLikeKeys,baseKeys$1=_baseKeys,isArrayLike$6=isArrayLike_1;function keys$3(yi){return isArrayLike$6(yi)?arrayLikeKeys$1(yi):baseKeys$1(yi)}var keys_1=keys$3,baseGetAllKeys=_baseGetAllKeys,getSymbols=_getSymbols,keys$2=keys_1;function getAllKeys$1(yi){return baseGetAllKeys(yi,keys$2,getSymbols)}var _getAllKeys=getAllKeys$1,getAllKeys=_getAllKeys,COMPARE_PARTIAL_FLAG$3=1,objectProto$6=Object.prototype,hasOwnProperty$6=objectProto$6.hasOwnProperty;function equalObjects$1(yi,vi,bi,_i,$i,Pi){var Ai=bi&COMPARE_PARTIAL_FLAG$3,Si=getAllKeys(yi),Ei=Si.length,wi=getAllKeys(vi),Ci=wi.length;if(Ei!=Ci&&!Ai)return!1;for(var ki=Ei;ki--;){var xi=Si[ki];if(!(Ai?xi in vi:hasOwnProperty$6.call(vi,xi)))return!1}var Ti=Pi.get(yi),Oi=Pi.get(vi);if(Ti&&Oi)return Ti==vi&&Oi==yi;var ji=!0;Pi.set(yi,vi),Pi.set(vi,yi);for(var Li=Ai;++kivi||Pi&&Ai&&Ei&&!Si&&!wi||_i&&Ai&&Ei||!bi&&Ei||!$i)return 1;if(!_i&&!Pi&&!wi&&yi=Si)return Ei;var wi=bi[_i];return Ei*(wi=="desc"?-1:1)}}return yi.index-vi.index}var _compareMultiple=compareMultiple$1,arrayMap=_arrayMap,baseGet$1=_baseGet,baseIteratee$2=_baseIteratee,baseMap=_baseMap,baseSortBy=_baseSortBy,baseUnary=_baseUnary,compareMultiple=_compareMultiple,identity$2=identity_1,isArray$5=isArray_1;function baseOrderBy$1(yi,vi,bi){vi.length?vi=arrayMap(vi,function(Pi){return isArray$5(Pi)?function(Ai){return baseGet$1(Ai,Pi.length===1?Pi[0]:Pi)}:Pi}):vi=[identity$2];var _i=-1;vi=arrayMap(vi,baseUnary(baseIteratee$2));var $i=baseMap(yi,function(Pi,Ai,Si){var Ei=arrayMap(vi,function(wi){return wi(Pi)});return{criteria:Ei,index:++_i,value:Pi}});return baseSortBy($i,function(Pi,Ai){return compareMultiple(Pi,Ai,bi)})}var _baseOrderBy=baseOrderBy$1;function apply$3(yi,vi,bi){switch(bi.length){case 0:return yi.call(vi);case 1:return yi.call(vi,bi[0]);case 2:return yi.call(vi,bi[0],bi[1]);case 3:return yi.call(vi,bi[0],bi[1],bi[2])}return yi.apply(vi,bi)}var _apply=apply$3,apply$2=_apply,nativeMax$1=Math.max;function overRest$2(yi,vi,bi){return vi=nativeMax$1(vi===void 0?yi.length-1:vi,0),function(){for(var _i=arguments,$i=-1,Pi=nativeMax$1(_i.length-vi,0),Ai=Array(Pi);++$i0){if(++vi>=HOT_COUNT)return arguments[0]}else vi=0;return yi.apply(void 0,arguments)}}var _shortOut=shortOut$1,baseSetToString=_baseSetToString,shortOut=_shortOut,setToString$2=shortOut(baseSetToString),_setToString=setToString$2,identity=identity_1,overRest$1=_overRest,setToString$1=_setToString;function baseRest$3(yi,vi){return setToString$1(overRest$1(yi,vi,identity),yi+"")}var _baseRest=baseRest$3,eq$2=eq_1,isArrayLike$3=isArrayLike_1,isIndex$1=_isIndex,isObject$8=isObject_1;function isIterateeCall$2(yi,vi,bi){if(!isObject$8(bi))return!1;var _i=typeof vi;return(_i=="number"?isArrayLike$3(bi)&&isIndex$1(vi,bi.length):_i=="string"&&vi in bi)?eq$2(bi[vi],yi):!1}var _isIterateeCall=isIterateeCall$2,baseFlatten$2=_baseFlatten,baseOrderBy=_baseOrderBy,baseRest$2=_baseRest,isIterateeCall$1=_isIterateeCall,sortBy=baseRest$2(function(yi,vi){if(yi==null)return[];var bi=vi.length;return bi>1&&isIterateeCall$1(yi,vi[0],vi[1])?vi=[]:bi>2&&isIterateeCall$1(vi[0],vi[1],vi[2])&&(vi=[vi[0]]),baseOrderBy(yi,baseFlatten$2(vi,1),[])}),sortBy_1=sortBy;function isNil(yi){return yi==null}var isNil_1=isNil;new TextDecoder("utf-16");function M$l(yi,vi="auto"){const bi=document.createElement("div"),_i=` `;return bi.innerHTML=_i,bi.firstElementChild}function j$g(yi){const vi=yi.slice(),bi=[];vi.sort(($i,Pi)=>$i[0]-Pi[0]);let _i=vi[0].slice();for(let $i=1;$i=Pi[0]?_i[1]=Math.max(Pi[1],_i[1]):(bi.push(_i),_i=Pi)}return bi.push(_i),bi}function P$r(yi){return new Worker(yi)}function S$r(yi){const vi="application/l10n",bi=document.querySelector(`link[type="${vi}"]`);if((bi==null?void 0:bi.href)===yi)return;const _i=document.createElement("link");_i.rel="resource",_i.type=vi,_i.href=yi,document.head.appendChild(_i)}function D$q(yi,vi){return new URL(`${yi}?version=0.8.67`,vi).href}function W$n(yi,vi,bi,_i){return Math.sqrt((yi-bi)**2+(vi-_i)**2)}function x$m(yi){return yi&&yi.type==="TABLE_CELL"}function y$s(yi,vi,bi=.7,_i=.4){const $i=Math.max(yi[0],vi[0]),Pi=Math.max(yi[1],vi[1]),Ai=Math.min(yi[2],vi[2]),Si=Math.min(yi[3],vi[3]);if($i>=Ai||Pi>=Si)return!1;const Ei=yi[2]-yi[0],wi=yi[3]-yi[1],Ci=Ai-$i,ki=Si-Pi,xi=Ci/Ei,Ti=ki/wi;return xi>bi&&Ti>_i}function I$o(yi,vi){return y$s(yi,vi,.7,.4)}function z$g(yi,vi){const bi=x$m(vi)&&vi.rowOutline||vi.outline;return I$o(yi,bi)}function F$l(yi){const vi=yi.grid.columns.length;return`${yi.grid.rows.length}_${vi}`}function R$m({outline:yi,rows:vi}){const bi=[];return vi.length===0?[[yi[0],yi[1],yi[2],yi[3]]]:(vi.forEach((_i,$i)=>{const Pi=vi[$i-1]||0,Ai=yi[0],Si=yi[2],Ei=yi[1]+Pi,wi=yi[1]+_i;bi.push([Ai,Ei,Si,wi])}),bi.push([yi[0],yi[1]+vi.at(-1),yi[2],yi[3]]),bi)}function m$w(yi,vi,bi,_i){var $i;if(_i){var Pi;return(Pi=vi.cells[yi])===null||Pi===void 0?void 0:Pi.text}return($i=bi[yi])===null||$i===void 0?void 0:$i.text}function X$h(yi,vi,bi,_i){const $i=[],Pi=sortBy_1(yi,({cell:wi})=>Number(wi.split("_")[0])),Ai=Number(Pi[0].cell.split("_")[0]),Si=Number(Pi.at(-1).cell.split("_")[0]),Ei=vi.grid.columns.length;for(let wi=Ai;wi<=Si;wi+=1){const Ci=[];for(let ki=0;ki<=Ei;ki+=1){let xi=`${wi}_${ki}`,Ti=m$w(xi,vi,bi,_i);if(Ti!==void 0)Ci.push({text:Ti,col:ki});else{const Oi=vi.merged.find(ji=>ji.find(Li=>Li[0]===wi&&Li[1]===ki));Oi?(xi=`${Oi[0][0]}_${Oi[0][1]}`,Ti=m$w(xi,vi,bi,_i),Ci.push({text:Ti,col:ki})):Ci.push({text:"",col:ki})}}$i.push({row:wi,cols:Ci})}return $i}function J$i(yi){return yi.map(vi=>{if(x$m(vi)){const bi=R$m({outline:vi.table.outline,rows:vi.table.grid.rows});return{...vi,rowOutline:bi[vi.row]}}return vi})}function _$p(yi){return Number(yi.split("_")[0])}function C$p(yi,vi){const bi=[...yi[0].rows],_i=vi==null?void 0:vi.table.page_merged_table.cells_idx;return yi.forEach(($i,Pi)=>{if(Pi>0)if(!_i)bi.push(...$i.rows);else{const Ai=Object.entries(_i[$i.index]),Si=Object.entries(_i[yi[Pi-1].index]),Ei=_$p(Ai[0][0]),wi=_$p(Si.at(-1)[0]);Ei===wi?(bi.at(-1).cols.forEach((Ci,ki)=>{Ci.text=`${Ci.text} ${$i.rows[0].cols[ki].text}`}),bi.push(...$i.rows.slice(1))):bi.push(...$i.rows)}}),bi}function Q$e(yi,vi){const bi=[];return yi.forEach(_i=>{var $i,Pi;if(($i=_i.type)!==null&&$i!==void 0&&$i.startsWith("PARAGRAPH")){const Ai=bi.findIndex(Si=>{var Ei;return(Ei=Si.page_merged_paragraph)===null||Ei===void 0||(Ei=Ei.paragraph_indices)===null||Ei===void 0?void 0:Ei.includes(_i.index)});Ai!==-1?bi[Ai].selectedText=`${bi[Ai].selectedText} ${_i.selectedText}`:bi.push(_i)}else if(isNil_1((Pi=_i.table)===null||Pi===void 0?void 0:Pi.page_merged_table))bi.push(_i);else{const Ai=_i.table.page_merged_table;let Si=[],Ei=_i;if(typeof Ai=="object"){const Ci=Object.keys(Ai.cells_idx).map(Number);Si=yi.filter(ki=>Ci.includes(ki.index))}else Si=yi.filter(Ci=>{var ki;return((ki=Ci.table)===null||ki===void 0?void 0:ki.page_merged_table)===Ai}),Ei=vi.find(Ci=>Ci.index===Ai);const wi=Si.map(Ci=>Ci.index);if(!bi.find(Ci=>{var ki;return(ki=Ci.mergedTableIndexs)===null||ki===void 0?void 0:ki.includes(_i.index)})){const Ci=C$p(Si,Ei);bi.push({..._i,rows:Ci,mergedTableIndexs:wi})}}}),bi}const E$q=async(yi,vi)=>{if(yi.page_merged_table){var bi;if(typeof yi.page_merged_table=="object")return Object.keys(yi.page_merged_table.cells_idx).map(Number);let $i=await vi(yi.page),Pi=(bi=$i.find(Ai=>x$m(Ai)&&Ai.table.index===yi.page_merged_table))===null||bi===void 0?void 0:bi.table;if(!Pi){var _i;$i=await vi(yi.page-1),Pi=(_i=$i.find(Ai=>x$m(Ai)&&(Ai.table.index===yi.page_merged_table||Ai.table.page_merged_table===yi.page_merged_table)))===null||_i===void 0?void 0:_i.table}if(Pi)return E$q(Pi,vi)}return[yi.index]};var E$p=(yi=>(yi[yi.Text=1]="Text",yi[yi.Link=2]="Link",yi[yi.Line=4]="Line",yi[yi.Square=5]="Square",yi[yi.Polygon=7]="Polygon",yi[yi.PolyLine=8]="PolyLine",yi[yi.Highlight=9]="Highlight",yi[yi.Underline=10]="Underline",yi[yi.StrikeOut=12]="StrikeOut",yi[yi.Stamp=13]="Stamp",yi[yi.Ink=15]="Ink",yi[yi.Popup=16]="Popup",yi[yi.Table=27]="Table",yi[yi.SelectText=28]="SelectText",yi[yi.Null=29]="Null",yi[yi.TextDiff=101]="TextDiff",yi))(E$p||{});const s$f={PDF_VIEWER_EDIT_TEXT_RECT:"pdf-viewer-edit-text-rect"},_$o={PDF_VIEWER_EDIT_TEXT_RECT_ID:`${s$f.PDF_VIEWER_EDIT_TEXT_RECT}-ui-manager`},N$k="pdf-document-viewer",T$m=[{customClass:"resize-point-bc",position:[.5,1]},{customClass:"resize-point-rc",position:[1,.5]},{customClass:"resize-point-br",position:[1,1]},{customClass:"resize-point-tc",position:[.5,0]},{customClass:"resize-point-rt",position:[1,0]},{customClass:"resize-point-lb",position:[0,1]},{customClass:"resize-point-lc",position:[0,.5]},{customClass:"resize-point-lt",position:[0,0]}];var c$q=(yi=>(yi[yi.S=1]="S",yi[yi.D=2]="D",yi[yi.B=3]="B",yi[yi.I=4]="I",yi[yi.U=5]="U",yi))(c$q||{});const D$p=[27],O$t=[28,101],p$j=20,C$o={TABLE_CELL:"TABLE_CELL"},S$q="disable-drawing",d$h="disable-destroy-selection",i$c="annot-updated",R$l="annot-removed",P$q="annot-focus",g$m="blur",u$i="annot-created",m$v="resize-end",n$9="move-end",A$r="vertex-changed",a$i="show-ctrl",G$d="show-widget-toolbar",U$h="hide-ctrl",W$m="hide-widget-toolbar",b$l="annot-destroyed",w$s="outline-change",H$g="change-custom-type",h$i="annot-mousedown",V$k="annot-rendered",X$g="selection-changed",f$k="widget-destroyed",v$p="annot-table-cell-active",F$k="annot-table-span-cell",k$o="annot-table-split-cell",B$f="annot-table-line-changed",Z$d="text-selected",q$e="text-copied",K$a=15,j$f="widget-polygon-vertex-changed",$$h="widget-polyline-vertex-changed",J$h="widget-created",Q$d="widget-drawing-end",y$r="update-widget-toolbar",ee$5="across-page-widgets-drawing-end",te$5=Object.freeze([72,145,243]);var o$d=(yi=>(yi.SelectElement="SelectElement",yi.SelectWord="SelectWord",yi.SelectTable="SelectTable",yi.SelectCell="SelectCell",yi))(o$d||{});function M$k(yi,...vi){const bi=document.createElementNS("http://www.w3.org/2000/svg",yi);return bi.classList.add(...vi),bi}const xt$4=yi=>{const vi=T$l(yi),bi=document.createDocumentFragment();return yi.forEach(_i=>{const $i=M$k("rect","text-box");$i.setAttribute("width",_i[2]-_i[0]),$i.setAttribute("height",_i[3]-_i[1]),$i.setAttribute("x",_i[0]-vi[0]),$i.setAttribute("y",_i[1]-vi[1]),bi.appendChild($i)}),bi};function dt$6(){const yi=document.createElementNS("http://www.w3.org/2000/svg","svg");return yi.setAttribute("xmlns","http://www.w3.org/2000/svg"),yi.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),yi}function yt$3(yi,vi=0){return yi.map(bi=>{const _i=M$k("circle","resize-point",bi.customClass),$i=Math.max(vi+3,5);return _i.setAttribute("r",String($i)),_i.dataset.position=`${bi.position[0]},${bi.position[1]}`,_i.setAttribute(`data-${S$q}`,"true"),_i})}function mt$5(yi){return yi/PixelsPerInch.PDF_TO_CSS_UNITS}function ht$7(yi){return yi*PixelsPerInch.PDF_TO_CSS_UNITS}function gt$6(yi,vi,bi,_i){if(_i%360===0)return yi;const $i=Math.sign(_i),Pi=Math.abs(_i/90),Ai=Si=>Si.map(([Ei,wi])=>($i===1?Ei=vi-1-Ei:wi=bi-1-wi,[wi,Ei]));for(let Si=0;Si$i==="H"?vi-Ei:yi-Ei;for(let Ei=0;Eiyi>=360?yi%360:yi;function Mt$2({width:yi,height:vi,rotation:bi},_i){if(bi%360===0)return _i;bi=X$f(bi);const $i=Math.sign(bi),Pi=90*(Math.PI/180)*$i,Ai=Math.cos(Pi),Si=Math.sin(Pi),Ei=Math.abs(bi/90);(bi===-90||bi===-270)&&([yi,vi]=[vi,yi]);const wi=([Ci,ki],xi)=>{const Ti=Ci*Ai-ki*Si,Oi=ki*Ai+Ci*Si;return[Ti-xi,Oi+xi]};for(let Ci=0;Ci{const ji=Ci*Ai-ki*Si,Li=ki*Ai+Ci*Si,Ii=xi*Ai-Ti*Si,Mi=Ti*Ai+xi*Si;return $i===1?[Ii-Oi,Li+Oi,ji-Oi,Mi+Oi]:[ji-Oi,Mi+Oi,Ii-Oi,Li+Oi]};for(let Ci=0;Ci0?Ei=`-${String(Si/60).padStart(2,"0")}`:Ei=`+${String(-Si/60).padStart(2,"0")}`,`D:${vi}${bi}${_i}${$i}${Pi}${Ai}${Ei}'00'`}function V$j(yi=[],vi){const bi=[];return yi.forEach(_i=>{_i.forEach(({x:$i,y:Pi})=>{const[,Ai,,Si]=vi;bi.push({_type:2,data:$i},{_type:2,data:Si-Pi})})}),bi.length?bi:void 0}function B$e(yi,vi){const[bi,_i,$i,Pi]=yi,[,Ai,,Si]=vi;return[{data:bi,_type:2},{data:Si-_i,_type:2},{data:$i,_type:2},{data:Si-Pi,_type:2}]}function j$e(yi,vi){const[,bi,,_i]=vi;return yi.map($i=>{const Pi={data:[],_type:5};return $i.forEach(({x:Ai,y:Si})=>{Pi.data.push({_type:2,data:Ai}),Pi.data.push({_type:2,data:_i-Si})}),Pi})}function F$j(yi,vi){const[,bi,,_i]=vi;return yi.flat().map(($i,Pi)=>Pi%2!==0?{_type:2,data:_i-$i}:{_type:2,data:$i})}const U$g=yi=>{Object.keys(yi).forEach(vi=>{var bi;(bi=yi[vi])!==null&&bi!==void 0||Reflect.deleteProperty(yi,vi)})};function St$4({objects:yi},vi){const bi={};return Object.keys(yi).forEach(_i=>{if(_i.startsWith("page"))bi[_i]=yi[_i];else{var $i,Pi,Ai,Si,Ei;const wi=typeof yi[_i]=="string"?JSON.parse(yi[_i]):yi[_i],{borderStyle:Ci,pageNumber:ki}=wi,xi=vi[ki-1];bi[wi.id]={generationID:0,Type:{_type:4,data:"Annot"},ID:wi.id,Rect:{_type:5,data:H$f(wi.rect,xi).map(Ti=>({_type:2,data:Ti}))},Subtype:{_type:4,data:wi.subtype},F:{_type:2,data:($i=wi.annotationFlags)!==null&&$i!==void 0?$i:0},M:{_type:3,data:wi.modificationDate?I$n(new Date(wi.modificationDate)):""},CreationDate:{_type:3,data:wi.creationDate?I$n(new Date(wi.creationDate)):""},T:{_type:3,data:wi.titleObj.str},Contents:{_type:3,data:wi.contentsObj.str},Popup:wi.popupId?{_type:9,data:{ref_id:wi.popupId}}:null,BS:{_type:6,data:{W:{_type:2,data:(Pi=Ci==null?void 0:Ci.width)!==null&&Pi!==void 0?Pi:1},D:{_type:5,data:(Ai=Ci==null?void 0:Ci.dashArray.map(Ti=>({_type:2,data:Ti})))!==null&&Ai!==void 0?Ai:[]},S:{_type:4,data:c$q[(Si=Ci==null?void 0:Ci.style)!==null&&Si!==void 0?Si:1]}}},Parent:wi.parentId?{_type:9,data:{ref_id:wi.parentId}}:null,IRT:wi.inReplyTo?{_type:9,data:{ref_id:wi.inReplyTo}}:null,RT:wi.inReplyTo?{_type:4,data:wi.replyType}:null,Name:{_type:4,data:(Ei=wi.name)!==null&&Ei!==void 0?Ei:""},Subj:wi.subj?{_type:3,data:wi.subj}:null,C:{_type:5,data:(wi.color||te$5).map(Ti=>({_type:2,data:Ti/255}))},QuadPoints:wi.quadPoints?{_type:5,data:V$j(wi.quadPoints,xi)}:null,L:wi.lineCoordinates?{_type:5,data:B$e(wi.lineCoordinates,xi)}:null,InkList:wi.inkLists?{_type:5,data:j$e(JSON.parse(wi.inkLists),xi)}:null,LE:wi.lineEndpoints?{_type:5,data:wi.lineEndpoints.map(Ti=>({_type:4,data:Ti}))}:null,Vertices:wi.vertices?{_type:5,data:F$j(wi.vertices,xi)}:null,AP:wi.AP,CA:wi.CA,RC:wi.RC,HideInf:wi.HideInf,NM:wi.NM,P:wi.P,HighDpi:wi.HighDpi},U$g(bi[_i])}}),{objects:bi}}function k$n(yi){return D$p.includes(yi)}function Pt$3(yi){const vi=P$p();return k$n(yi)?`pai_${vi}`:`ann_${vi}`}function It$3(yi=""){const vi=P$p();return yi?`${yi}_${vi}`:vi}function Lt$2(yi){if(yi)if(navigator.clipboard){const vi=new Blob([yi],{type:"text/plain"});navigator.clipboard.write([new ClipboardItem({[vi.type]:vi})]).then(()=>{},bi=>{console.error(bi)})}else{const vi=document.createRange();window.getSelection().removeAllRanges();const bi=document.createElement("pre");bi.innerText=yi,document.body.appendChild(bi),vi.selectNode(bi),window.getSelection().addRange(vi),document.execCommand("copy"),window.getSelection().removeAllRanges(),bi.remove()}}function D$o(yi){const[,vi,,bi]=yi,_i=bi-vi;return[_i,Math.max(6,_i*.382)]}function Ct$2(yi,vi,bi){var _i;(_i=bi)!==null&&_i!==void 0||(bi=M$k("line","text-cursor"));const[$i,Pi,Ai,Si]=vi,[Ei]=D$o(vi);let wi,Ci;const ki=Pi,xi=Pi+Ei;return yi==="start"?(wi=$i,Ci=$i):yi==="end"&&(wi=Ai,Ci=Ai),bi.setAttribute("x1",wi),bi.setAttribute("y1",ki),bi.setAttribute("x2",Ci),bi.setAttribute("y2",xi),bi.dataset.pos=yi,bi}function Tt$3(yi){return yi&&!Array.isArray(yi[0])?yi.map(({key:vi,value:bi})=>[vi,bi]):yi}const R$k=(yi,vi,bi=3)=>{const[,_i,,$i]=yi,[Pi,Ai,,Si]=vi;return Math.abs(Si-$i)<=bi&&Math.abs(Ai-_i)<=bi},q$d=(yi,vi=3,bi=_i=>_i)=>{const{lines:_i}=yi.reduce((Pi,Ai)=>(Pi.prevItem&&!R$k(Pi.prevItem,Ai,vi)&&(Pi.lineNumber+=1),Pi.prevItem=Ai,Pi.lines[Pi.lineNumber]||(Pi.lines[Pi.lineNumber]=[]),Pi.lines[Pi.lineNumber].push(Ai),Pi),{lineNumber:0,lines:[],prevItem:null}),$i=[];return _i.forEach(Pi=>{const Ai=Math.min(...Pi.map(Ei=>Ei[1])),Si=Math.max(...Pi.map(Ei=>Ei[3]));Pi=bi(Pi),Pi.forEach(Ei=>{$i.push([Ei[0],Ai,Ei[2],Si])})}),$i},Xt$2=(yi,vi,bi=1)=>{const[_i,$i]=yi;return vi.some(Pi=>{const[Ai,Si,Ei,wi]=Pi;return _i>=Ai-bi&&_i<=Ei+bi&&$i>=Si-bi&&$i<=wi+bi})},tt$a=yi=>{let[vi,bi,_i,$i]=yi;return vi>_i&&([vi,_i]=[_i,vi]),bi>$i&&([bi,$i]=[$i,bi]),[vi,bi,_i,$i]},T$l=yi=>{if(!yi.length)return[0,0,0,0];const[vi,bi,_i,$i]=[[],[],[],[]];yi.forEach(wi=>{const[Ci,ki,xi,Ti]=tt$a(wi);vi.push(Ci),bi.push(ki),_i.push(xi),$i.push(Ti)});const Pi=Math.min(...vi),Ai=Math.min(...bi),Si=Math.max(..._i),Ei=Math.max(...$i);return[Pi,Ai,Si,Ei]},Vt$2=(yi,vi)=>{const[bi,_i,$i,Pi]=yi,[Ai,Si]=vi;return Ai>=bi&&Si>=_i&&Ai<=$i&&Si<=Pi},Bt$2=(yi,vi)=>{const[bi,_i,$i,Pi]=yi,[Ai,Si,Ei,wi]=vi;return!($i<=Ai||bi>=Ei||_i>=wi||Pi<=Si)},et$a=(yi,vi,bi=7,_i=3)=>{const[,,$i]=yi,[Pi]=vi,Ai=Math.abs(Pi-$i)<=bi;return R$k(yi,vi,_i)&&Ai},jt$2=(yi,vi=7,bi=3,_i=1.9)=>{let $i=[];const Pi=new Set;for(let Ai=0;AiAi[2]-Ai[0]>=_i),$i},Ft$2=yi=>{const vi=yi.map(([Si])=>Si).flat(),bi=yi.map(([,Si])=>Si).flat(),_i=Math.min(...vi),$i=Math.min(...bi),Pi=Math.max(...vi),Ai=Math.max(...bi);return[_i,$i,Pi,Ai]},Ut$2=yi=>{const{x:vi,y:bi}=yi[0],_i=[`M${vi} ${bi}`];for(let $i=1;$i(()=>{var __webpack_modules__=[,(yi,vi,bi)=>{Object.defineProperty(vi,"__esModule",{value:!0}),vi.VerbosityLevel=vi.Util=vi.UnknownErrorException=vi.UnexpectedResponseException=vi.UNSUPPORTED_FEATURES=vi.TextRenderingMode=vi.StreamType=vi.RenderingIntentFlag=vi.PermissionFlag=vi.PasswordResponses=vi.PasswordException=vi.PageActionEventType=vi.OPS=vi.MissingPDFException=vi.IsLittleEndianCached=vi.IsEvalSupportedCached=vi.InvalidPDFException=vi.ImageKind=vi.IDENTITY_MATRIX=vi.FormatError=vi.FontType=vi.FONT_IDENTITY_MATRIX=vi.DocumentActionEventType=vi.CMapCompressionType=vi.BaseException=vi.AnnotationType=vi.AnnotationStateModelType=vi.AnnotationReviewState=vi.AnnotationReplyType=vi.AnnotationMode=vi.AnnotationMarkedState=vi.AnnotationFlag=vi.AnnotationFieldFlag=vi.AnnotationBorderStyleType=vi.AnnotationActionEventType=vi.AbortException=void 0,vi.addParamsToUrl=function(Ii,Mi){const Fi=new URL(Ii);return Object.keys(Mi).forEach(Bi=>Fi.searchParams.append(Bi,Mi[Bi])),Fi.toString()},vi.arrayByteLength=Ci,vi.arraysToBytes=function(Ii){const Mi=Ii.length;if(Mi===1&&Ii[0]instanceof Uint8Array)return Ii[0];let Fi=0;for(let Vi=0;ViMi}),Ii.promise=new Promise(function(Fi,Bi){Ii.resolve=function(Ri){Mi=!0,Fi(Ri)},Ii.reject=function(Ri){Mi=!0,Bi(Ri)}}),Ii},vi.createValidAbsoluteUrl=function(Ii,Mi=null,Fi=null){if(!Ii)return null;try{if(Fi&&typeof Ii=="string"){if(Fi.addDefaultProtocol&&Ii.startsWith("www.")){const Ri=Ii.match(/\./g);Ri&&Ri.length>=2&&(Ii=`http://${Ii}`)}if(Fi.tryConvertEncoding)try{Ii=Li(Ii)}catch{}}const Bi=Mi?new URL(Ii,Mi):new URL(Ii);if(function(Ri){if(!Ri)return!1;switch(Ri.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(Bi))return Bi}catch{}return null},vi.escapeString=function(Ii){return Ii.replace(/([()\\\n\r])/g,Mi=>Mi===` `?"\\n":Mi==="\r"?"\\r":`\\${Mi}`)},vi.getModificationDate=function(Ii=new Date){return[Ii.getUTCFullYear().toString(),(Ii.getUTCMonth()+1).toString().padStart(2,"0"),Ii.getUTCDate().toString().padStart(2,"0"),Ii.getUTCHours().toString().padStart(2,"0"),Ii.getUTCMinutes().toString().padStart(2,"0"),Ii.getUTCSeconds().toString().padStart(2,"0")].join("")},vi.getVerbosityLevel=function(){return $i},vi.info=function(Ii){},vi.isArrayBuffer=function(Ii){return typeof Ii=="object"&&Ii!==null&&Ii.byteLength!==void 0},vi.isArrayEqual=function(Ii,Mi){if(Ii.length!==Mi.length)return!1;for(let Fi=0,Bi=Ii.length;Fi>24&255,Ii>>16&255,Ii>>8&255,255&Ii)},vi.stringToBytes=wi,vi.stringToPDFString=function(Ii){if(Ii[0]>="ï"){let Fi;if(Ii[0]==="þ"&&Ii[1]==="ÿ"?Fi="utf-16be":Ii[0]==="ÿ"&&Ii[1]==="þ"?Fi="utf-16le":Ii[0]==="ï"&&Ii[1]==="»"&&Ii[2]==="¿"&&(Fi="utf-8"),Fi)try{const Bi=new TextDecoder(Fi,{fatal:!0}),Ri=wi(Ii);return Bi.decode(Ri)}catch{}}const Mi=[];for(let Fi=0,Bi=Ii.length;Fi>8&255),String.fromCharCode(255&Ri))}return Mi.join("")},vi.stringToUTF8String=Li,vi.unreachable=Ai,vi.utf8StringToString=function(Ii){return unescape(encodeURIComponent(Ii))},vi.warn=Pi,bi(2),vi.IDENTITY_MATRIX=[1,0,0,1,0,0],vi.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0],vi.RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256},vi.AnnotationMode={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},vi.PermissionFlag={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},vi.TextRenderingMode={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},vi.ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},vi.AnnotationType={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},vi.AnnotationStateModelType={MARKED:"Marked",REVIEW:"Review"},vi.AnnotationMarkedState={MARKED:"Marked",UNMARKED:"Unmarked"},vi.AnnotationReviewState={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"},vi.AnnotationReplyType={GROUP:"Group",REPLY:"R"},vi.AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512},vi.AnnotationFieldFlag={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864},vi.AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},vi.AnnotationActionEventType={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"},vi.DocumentActionEventType={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"},vi.PageActionEventType={O:"PageOpen",C:"PageClose"},vi.StreamType={UNKNOWN:"UNKNOWN",FLATE:"FLATE",LZW:"LZW",DCT:"DCT",JPX:"JPX",JBIG:"JBIG",A85:"A85",AHX:"AHX",CCF:"CCF",RLX:"RLX"},vi.FontType={UNKNOWN:"UNKNOWN",TYPE1:"TYPE1",TYPE1STANDARD:"TYPE1STANDARD",TYPE1C:"TYPE1C",CIDFONTTYPE0:"CIDFONTTYPE0",CIDFONTTYPE0C:"CIDFONTTYPE0C",TRUETYPE:"TRUETYPE",CIDFONTTYPE2:"CIDFONTTYPE2",TYPE3:"TYPE3",OPENTYPE:"OPENTYPE",TYPE0:"TYPE0",MMTYPE1:"MMTYPE1"};const _i={ERRORS:0,WARNINGS:1,INFOS:5};vi.VerbosityLevel=_i,vi.CMapCompressionType={NONE:0,BINARY:1,STREAM:2},vi.OPS={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,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91},vi.UNSUPPORTED_FEATURES={unknown:"unknown",forms:"forms",javaScript:"javaScript",signatures:"signatures",smask:"smask",shadingPattern:"shadingPattern",font:"font",errorTilingPattern:"errorTilingPattern",errorExtGState:"errorExtGState",errorXObject:"errorXObject",errorFontLoadType3:"errorFontLoadType3",errorFontState:"errorFontState",errorFontMissing:"errorFontMissing",errorFontTranslate:"errorFontTranslate",errorColorSpace:"errorColorSpace",errorOperatorList:"errorOperatorList",errorFontToUnicode:"errorFontToUnicode",errorFontLoadNative:"errorFontLoadNative",errorFontBuildPath:"errorFontBuildPath",errorFontGetPath:"errorFontGetPath",errorMarkedContent:"errorMarkedContent",errorContentSubStream:"errorContentSubStream"},vi.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let $i=_i.WARNINGS;function Pi(Ii){}function Ai(Ii){throw new Error(Ii)}function Si(Ii,Mi,Fi){return Object.defineProperty(Ii,Mi,{value:Fi,enumerable:!0,configurable:!0,writable:!1}),Fi}const Ei=function(){function Ii(Mi,Fi){this.constructor===Ii&&Ai("Cannot initialize BaseException."),this.message=Mi,this.name=Fi}return Ii.prototype=new Error,Ii.constructor=Ii,Ii}();vi.BaseException=Ei,vi.PasswordException=class extends Ei{constructor(Ii,Mi){super(Ii,"PasswordException"),this.code=Mi}},vi.UnknownErrorException=class extends Ei{constructor(Ii,Mi){super(Ii,"UnknownErrorException"),this.details=Mi}},vi.InvalidPDFException=class extends Ei{constructor(Ii){super(Ii,"InvalidPDFException")}},vi.MissingPDFException=class extends Ei{constructor(Ii){super(Ii,"MissingPDFException")}},vi.UnexpectedResponseException=class extends Ei{constructor(Ii,Mi){super(Ii,"UnexpectedResponseException"),this.status=Mi}},vi.FormatError=class extends Ei{constructor(Ii){super(Ii,"FormatError")}},vi.AbortException=class extends Ei{constructor(Ii){super(Ii,"AbortException")}};function wi(Ii){typeof Ii!="string"&&Ai("Invalid argument for stringToBytes");const Mi=Ii.length,Fi=new Uint8Array(Mi);for(let Bi=0;BiIi.toString(16).padStart(2,"0"));class Oi{static makeHexColor(Mi,Fi,Bi){return`#${Ti[Mi]}${Ti[Fi]}${Ti[Bi]}`}static transform(Mi,Fi){return[Mi[0]*Fi[0]+Mi[2]*Fi[1],Mi[1]*Fi[0]+Mi[3]*Fi[1],Mi[0]*Fi[2]+Mi[2]*Fi[3],Mi[1]*Fi[2]+Mi[3]*Fi[3],Mi[0]*Fi[4]+Mi[2]*Fi[5]+Mi[4],Mi[1]*Fi[4]+Mi[3]*Fi[5]+Mi[5]]}static applyTransform(Mi,Fi){return[Mi[0]*Fi[0]+Mi[1]*Fi[2]+Fi[4],Mi[0]*Fi[1]+Mi[1]*Fi[3]+Fi[5]]}static applyInverseTransform(Mi,Fi){const Bi=Fi[0]*Fi[3]-Fi[1]*Fi[2];return[(Mi[0]*Fi[3]-Mi[1]*Fi[2]+Fi[2]*Fi[5]-Fi[4]*Fi[3])/Bi,(-Mi[0]*Fi[1]+Mi[1]*Fi[0]+Fi[4]*Fi[1]-Fi[5]*Fi[0])/Bi]}static getAxialAlignedBoundingBox(Mi,Fi){const Bi=Oi.applyTransform(Mi,Fi),Ri=Oi.applyTransform(Mi.slice(2,4),Fi),Vi=Oi.applyTransform([Mi[0],Mi[3]],Fi),Ni=Oi.applyTransform([Mi[2],Mi[1]],Fi);return[Math.min(Bi[0],Ri[0],Vi[0],Ni[0]),Math.min(Bi[1],Ri[1],Vi[1],Ni[1]),Math.max(Bi[0],Ri[0],Vi[0],Ni[0]),Math.max(Bi[1],Ri[1],Vi[1],Ni[1])]}static inverseTransform(Mi){const Fi=Mi[0]*Mi[3]-Mi[1]*Mi[2];return[Mi[3]/Fi,-Mi[1]/Fi,-Mi[2]/Fi,Mi[0]/Fi,(Mi[2]*Mi[5]-Mi[4]*Mi[3])/Fi,(Mi[4]*Mi[1]-Mi[5]*Mi[0])/Fi]}static apply3dTransform(Mi,Fi){return[Mi[0]*Fi[0]+Mi[1]*Fi[1]+Mi[2]*Fi[2],Mi[3]*Fi[0]+Mi[4]*Fi[1]+Mi[5]*Fi[2],Mi[6]*Fi[0]+Mi[7]*Fi[1]+Mi[8]*Fi[2]]}static singularValueDecompose2dScale(Mi){const Fi=[Mi[0],Mi[2],Mi[1],Mi[3]],Bi=Mi[0]*Fi[0]+Mi[1]*Fi[2],Ri=Mi[0]*Fi[1]+Mi[1]*Fi[3],Vi=Mi[2]*Fi[0]+Mi[3]*Fi[2],Ni=Mi[2]*Fi[1]+Mi[3]*Fi[3],Wi=(Bi+Ni)/2,zi=Math.sqrt((Bi+Ni)**2-4*(Bi*Ni-Vi*Ri))/2,Di=Wi+zi||1,Ui=Wi-zi||1;return[Math.sqrt(Di),Math.sqrt(Ui)]}static normalizeRect(Mi){const Fi=Mi.slice(0);return Mi[0]>Mi[2]&&(Fi[0]=Mi[2],Fi[2]=Mi[0]),Mi[1]>Mi[3]&&(Fi[1]=Mi[3],Fi[3]=Mi[1]),Fi}static intersect(Mi,Fi){function Bi(Wi,zi){return Wi-zi}const Ri=[Mi[0],Mi[2],Fi[0],Fi[2]].sort(Bi),Vi=[Mi[1],Mi[3],Fi[1],Fi[3]].sort(Bi),Ni=[];return Mi=Oi.normalizeRect(Mi),Fi=Oi.normalizeRect(Fi),!(Ri[0]===Mi[0]&&Ri[1]===Fi[0]||Ri[0]===Fi[0]&&Ri[1]===Mi[0])||(Ni[0]=Ri[1],Ni[2]=Ri[2],!(Vi[0]===Mi[1]&&Vi[1]===Fi[1]||Vi[0]===Fi[1]&&Vi[1]===Mi[1]))?null:(Ni[1]=Vi[1],Ni[3]=Vi[2],Ni)}static bezierBoundingBox(Mi,Fi,Bi,Ri,Vi,Ni,Wi,zi){const Di=[],Ui=[[],[]];let Hi,qi,Gi,Ki,Qi,Xi,rr,ar;for(let mr=0;mr<2;++mr)if(mr===0?(qi=6*Mi-12*Bi+6*Vi,Hi=-3*Mi+9*Bi-9*Vi+3*Wi,Gi=3*Bi-3*Mi):(qi=6*Fi-12*Ri+6*Ni,Hi=-3*Fi+9*Ri-9*Ni+3*zi,Gi=3*Ri-3*Fi),Math.abs(Hi)<1e-12){if(Math.abs(qi)<1e-12)continue;Ki=-Gi/qi,0{bi(3)},(yi,vi)=>{Object.defineProperty(vi,"__esModule",{value:!0}),vi.isNodeJS=void 0;const bi=!(typeof process!="object"||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&process.type!=="browser");vi.isNodeJS=bi},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{var yi,vi,bi,_i,$i,Pi,Ai,_s;Object.defineProperty(exports,"__esModule",{value:!0}),exports.build=exports.WorkerTransport=exports.RenderTask=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,exports.getDocument=getDocument,exports.setPDFNetworkStreamFactory=setPDFNetworkStreamFactory,exports.version=void 0;var _util=__w_pdfjs_require__(1),_display_utils=__w_pdfjs_require__(5),_font_loader=__w_pdfjs_require__(7),_node_utils=__w_pdfjs_require__(8),_annotation_storage=__w_pdfjs_require__(9),_canvas=__w_pdfjs_require__(10),_worker_options=__w_pdfjs_require__(12),_is_node=__w_pdfjs_require__(3),_message_handler=__w_pdfjs_require__(13),_metadata=__w_pdfjs_require__(14),_optional_content_config=__w_pdfjs_require__(15),_transport_stream=__w_pdfjs_require__(16),_xfa_text=__w_pdfjs_require__(17);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DefaultCanvasFactory=_is_node.isNodeJS?_node_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;const DefaultCMapReaderFactory=_is_node.isNodeJS?_node_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;const DefaultStandardFontDataFactory=_is_node.isNodeJS?_node_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;let createPDFNetworkStream;function setPDFNetworkStreamFactory(Ei){createPDFNetworkStream=Ei}function getDocument(Ei,wi){const Ci=new PDFDocumentLoadingTask;let ki;if(typeof Ei=="string"||Ei instanceof URL)ki={url:Ei};else if((0,_util.isArrayBuffer)(Ei))ki={data:Ei};else if(Ei instanceof PDFDataRangeTransport)ki={range:Ei};else{if(typeof Ei!="object")throw new Error("Invalid parameter in getDocument, need either string, URL, Uint8Array, or parameter object.");if(!Ei.url&&!Ei.data&&!Ei.range)throw new Error("Invalid parameter object: need either .data, .range or .url");ki=Ei}const xi=Object.create(null);let Ti=null,Oi=null;for(const Li in ki){const Ii=ki[Li];switch(Li){case"url":if(typeof window<"u")try{xi[Li]=new URL(Ii,window.location).href;continue}catch(Mi){(0,_util.warn)(`Cannot create valid URL: "${Mi}".`)}else if(typeof Ii=="string"||Ii instanceof URL){xi[Li]=Ii.toString();continue}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.");case"range":Ti=Ii;continue;case"worker":Oi=Ii;continue;case"data":if(_is_node.isNodeJS&&typeof Buffer<"u"&&Ii instanceof Buffer)xi[Li]=new Uint8Array(Ii);else{if(Ii instanceof Uint8Array)break;if(typeof Ii=="string")xi[Li]=(0,_util.stringToBytes)(Ii);else if(typeof Ii!="object"||Ii===null||isNaN(Ii.length)){if(!(0,_util.isArrayBuffer)(Ii))throw new Error("Invalid PDF binary data: either typed array, string, or array-like object is expected in the data property.");xi[Li]=new Uint8Array(Ii)}else xi[Li]=new Uint8Array(Ii)}continue}xi[Li]=Ii}if(xi.rangeChunkSize=xi.rangeChunkSize||DEFAULT_RANGE_CHUNK_SIZE,xi.CMapReaderFactory=xi.CMapReaderFactory||DefaultCMapReaderFactory,xi.StandardFontDataFactory=xi.StandardFontDataFactory||DefaultStandardFontDataFactory,xi.ignoreErrors=xi.stopAtErrors!==!0,xi.fontExtraProperties=xi.fontExtraProperties===!0,xi.pdfBug=xi.pdfBug===!0,xi.enableXfa=xi.enableXfa===!0,(typeof xi.docBaseUrl!="string"||(0,_display_utils.isDataScheme)(xi.docBaseUrl))&&(xi.docBaseUrl=null),Number.isInteger(xi.maxImageSize)||(xi.maxImageSize=-1),typeof xi.useWorkerFetch!="boolean"&&(xi.useWorkerFetch=xi.CMapReaderFactory===_display_utils.DOMCMapReaderFactory&&xi.StandardFontDataFactory===_display_utils.DOMStandardFontDataFactory),typeof xi.isEvalSupported!="boolean"&&(xi.isEvalSupported=!0),typeof xi.disableFontFace!="boolean"&&(xi.disableFontFace=_is_node.isNodeJS),typeof xi.useSystemFonts!="boolean"&&(xi.useSystemFonts=!_is_node.isNodeJS&&!xi.disableFontFace),xi.ownerDocument===void 0&&(xi.ownerDocument=globalThis.document),typeof xi.disableRange!="boolean"&&(xi.disableRange=!1),typeof xi.disableStream!="boolean"&&(xi.disableStream=!1),typeof xi.disableAutoFetch!="boolean"&&(xi.disableAutoFetch=!1),(0,_util.setVerbosityLevel)(xi.verbosity),Oi)Ci._worker=Oi;else{const Li={verbosity:xi.verbosity,port:_worker_options.GlobalWorkerOptions.workerPort};Oi=Li.port?_PDFWorker.fromPort(Li):new _PDFWorker(Li),Ci._worker=Oi}const ji=Ci.docId;return Oi.promise.then(function(){if(Ci.destroyed)throw new Error("Loading aborted");const Li=_fetchDocument(Oi,xi,Ti,ji),Ii=new Promise(function(Mi){let Fi;Ti?Fi=new _transport_stream.PDFDataTransportStream({length:xi.length,initialData:xi.initialData,progressiveDone:xi.progressiveDone,contentDispositionFilename:xi.contentDispositionFilename,disableRange:xi.disableRange,disableStream:xi.disableStream,inspectFetchUrl:xi.inspectFetchUrl},Ti):xi.data||(Fi=createPDFNetworkStream({url:xi.url,length:xi.length,httpHeaders:xi.httpHeaders,withCredentials:xi.withCredentials,rangeChunkSize:xi.rangeChunkSize,disableRange:xi.disableRange,disableStream:xi.disableStream,streamHttpMethod:xi.streamHttpMethod,inspectFetchUrl:xi.inspectFetchUrl})),Mi(Fi)});return Promise.all([Li,Ii]).then(function([Mi,Fi]){if(Ci.destroyed)throw new Error("Loading aborted");const Bi=new _message_handler.MessageHandler(ji,Mi,Oi.port);let Ri,Vi=null;wi!==null&&(Vi=async function(Ni){return wi(Ni,Bi)}),Ri=xi.createWorkerTransport?xi.createWorkerTransport(Bi,Ci,Fi,xi,Vi):new WorkerTransport(Bi,Ci,Fi,xi,Vi),Ci.setTransport(Ri),Bi.send("Ready",null)})}).catch(Ci._capability.reject),Ci}async function _fetchDocument(Ei,wi,Ci,ki){if(Ei.destroyed)throw new Error("Worker was destroyed");Ci&&(wi.length=Ci.length,wi.initialData=Ci.initialData,wi.progressiveDone=Ci.progressiveDone,wi.contentDispositionFilename=Ci.contentDispositionFilename);const xi=await Ei.messageHandler.sendWithPromise("GetDocRequest",{docId:ki,apiVersion:"2.13.217-alpha.85",source:{data:wi.data,url:wi.url,password:wi.password,disableAutoFetch:wi.disableAutoFetch,rangeChunkSize:wi.rangeChunkSize,length:wi.length},maxImageSize:wi.maxImageSize,disableFontFace:wi.disableFontFace,docBaseUrl:wi.docBaseUrl,ignoreErrors:wi.ignoreErrors,isEvalSupported:wi.isEvalSupported,fontExtraProperties:wi.fontExtraProperties,enableXfa:wi.enableXfa,useSystemFonts:wi.useSystemFonts,cMapUrl:wi.useWorkerFetch?wi.cMapUrl:null,standardFontDataUrl:wi.useWorkerFetch?wi.standardFontDataUrl:null});if(Ei.destroyed)throw new Error("Worker was destroyed");return xi}class PDFDocumentLoadingTask{static get idCounters(){return(0,_util.shadow)(this,"idCounters",{doc:0})}constructor(){this._capability=(0,_util.createPromiseCapability)(),this._transportCapability=(0,_util.createPromiseCapability)(),this._transport=null,this._worker=null,this.docId="d"+PDFDocumentLoadingTask.idCounters.doc++,this.destroyed=!1,this.onPassword=null,this.onProgress=null,this.onUnsupportedFeature=null}get promise(){return this._capability.promise}setTransport(wi){this._transport=wi,this._transportCapability.resolve(wi)}get transportPromise(){return this._transportCapability.promise}async destroy(){var wi;this.destroyed=!0,await((wi=this._transport)==null?void 0:wi.destroy()),this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(wi,Ci,ki=!1,xi=null){this.length=wi,this.initialData=Ci,this.progressiveDone=ki,this.contentDispositionFilename=xi,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=(0,_util.createPromiseCapability)()}addRangeListener(wi){this._rangeListeners.push(wi)}addProgressListener(wi){this._progressListeners.push(wi)}addProgressiveReadListener(wi){this._progressiveReadListeners.push(wi)}addProgressiveDoneListener(wi){this._progressiveDoneListeners.push(wi)}onDataRange(wi,Ci){for(const ki of this._rangeListeners)ki(wi,Ci)}onDataProgress(wi,Ci){this._readyCapability.promise.then(()=>{for(const ki of this._progressListeners)ki(wi,Ci)})}onDataProgressiveRead(wi){this._readyCapability.promise.then(()=>{for(const Ci of this._progressiveReadListeners)Ci(wi)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const wi of this._progressiveDoneListeners)wi()})}transportReady(){this._readyCapability.resolve()}requestDataRange(wi,Ci){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(wi,Ci){this._pdfInfo=wi,this._transport=Ci,Object.defineProperty(this,"fingerprint",{get(){return(0,_display_utils.deprecated)("`PDFDocumentProxy.fingerprint`, please use `PDFDocumentProxy.fingerprints` instead."),this.fingerprints[0]}}),Object.defineProperty(this,"getStats",{value:async()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getStats`, please use the `PDFDocumentProxy.stats`-getter instead."),this.stats||{streamTypes:{},fontTypes:{}})})}get annotationStorage(){return this._transport.annotationStorage}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get stats(){return this._transport.stats}get isPureXfa(){return!!this._transport._htmlForXfa}get allXfaHtml(){return this._transport._htmlForXfa}getPage(wi){return this._transport.getPage(wi)}getPageIndex(wi){return this._transport.getPageIndex(wi)}getDestinations(){return this._transport.getDestinations()}getDestination(wi){return this._transport.getDestination(wi)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJavaScript(){return this._transport.getJavaScript()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(wi=!1){return this._transport.startCleanup(wi||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}saveDocument(){return this._transport.annotationStorage.size<=0&&(0,_display_utils.deprecated)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead."),this._transport.saveDocument()}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(wi,Ci,ki,xi,Ti=!1){this._pageIndex=wi,this._pageInfo=Ci,this._ownerDocument=xi,this._transport=ki,this._stats=Ti?new _display_utils.StatTimer:null,this._pdfBug=Ti,this.commonObjs=ki.commonObjs,this.objs=new PDFObjects,this.cleanupAfterRender=!1,this.pendingCleanup=!1,this._intentStates=new Map,this._annotationPromises=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:wi,rotation:Ci=this.rotate,offsetX:ki=0,offsetY:xi=0,dontFlip:Ti=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:wi,rotation:Ci,offsetX:ki,offsetY:xi,dontFlip:Ti})}getAnnotations({intent:wi="display"}={}){const Ci=this._transport.getRenderingIntent(wi);let ki=this._annotationPromises.get(Ci.cacheKey);return ki||(ki=this._transport.getAnnotations(this._pageIndex,Ci.renderingIntent),this._annotationPromises.set(Ci.cacheKey,ki),ki=ki.then(xi=>{for(const Ti of xi)Ti.titleObj!==void 0&&Object.defineProperty(Ti,"title",{get(){return(0,_display_utils.deprecated)("`title`-property on annotation, please use `titleObj` instead."),Ti.titleObj.str}}),Ti.contentsObj!==void 0&&Object.defineProperty(Ti,"contents",{get(){return(0,_display_utils.deprecated)("`contents`-property on annotation, please use `contentsObj` instead."),Ti.contentsObj.str}});return xi})),ki}getJSActions(){return this._jsActionsPromise||(this._jsActionsPromise=this._transport.getPageJSActions(this._pageIndex))}async getXfa(){var wi;return((wi=this._transport._htmlForXfa)==null?void 0:wi.children[this._pageIndex])||null}render({canvasContext:wi,viewport:Ci,intent:ki="display",annotationMode:xi=_util.AnnotationMode.ENABLE,transform:Ti=null,imageLayer:Oi=null,canvasFactory:ji=null,background:Li=null,optionalContentConfigPromise:Ii=null,annotationCanvasMap:Mi=null}){var Di,Ui;((Di=arguments[0])==null?void 0:Di.renderInteractiveForms)!==void 0&&((0,_display_utils.deprecated)("render no longer accepts the `renderInteractiveForms`-option, please use the `annotationMode`-option instead."),arguments[0].renderInteractiveForms===!0&&xi===_util.AnnotationMode.ENABLE&&(xi=_util.AnnotationMode.ENABLE_FORMS)),((Ui=arguments[0])==null?void 0:Ui.includeAnnotationStorage)!==void 0&&((0,_display_utils.deprecated)("render no longer accepts the `includeAnnotationStorage`-option, please use the `annotationMode`-option instead."),arguments[0].includeAnnotationStorage===!0&&xi===_util.AnnotationMode.ENABLE&&(xi=_util.AnnotationMode.ENABLE_STORAGE)),this._stats&&this._stats.time("Overall");const Fi=this._transport.getRenderingIntent(ki,xi);this.pendingCleanup=!1,Ii||(Ii=this._transport.getOptionalContentConfig());let Bi=this._intentStates.get(Fi.cacheKey);Bi||(Bi=Object.create(null),this._intentStates.set(Fi.cacheKey,Bi)),Bi.streamReaderCancelTimeout&&(clearTimeout(Bi.streamReaderCancelTimeout),Bi.streamReaderCancelTimeout=null);const Ri=ji||new DefaultCanvasFactory({ownerDocument:this._ownerDocument}),Vi=!!(Fi.renderingIntent&_util.RenderingIntentFlag.PRINT);Bi.displayReadyCapability||(Bi.displayReadyCapability=(0,_util.createPromiseCapability)(),Bi.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList(Fi));const Ni=Hi=>{Bi.renderTasks.delete(Wi),(this.cleanupAfterRender||Vi)&&(this.pendingCleanup=!0),this._tryCleanup(),Hi?(Wi.capability.reject(Hi),this._abortOperatorList({intentState:Bi,reason:Hi instanceof Error?Hi:new Error(Hi)})):Wi.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"))},Wi=new InternalRenderTask({callback:Ni,params:{canvasContext:wi,viewport:Ci,transform:Ti,imageLayer:Oi,background:Li},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:Mi,operatorList:Bi.operatorList,pageIndex:this._pageIndex,canvasFactory:Ri,useRequestAnimationFrame:!Vi,pdfBug:this._pdfBug});(Bi.renderTasks||(Bi.renderTasks=new Set)).add(Wi);const zi=Wi.task;return Promise.all([Bi.displayReadyCapability.promise,Ii]).then(([Hi,qi])=>{this.pendingCleanup?Ni():(this._stats&&this._stats.time("Rendering"),Wi.initializeGraphics({transparency:Hi,optionalContentConfig:qi}),Wi.operatorListChanged())}).catch(Ni),zi}getOperatorList({intent:wi="display",annotationMode:Ci=_util.AnnotationMode.ENABLE}={}){const ki=this._transport.getRenderingIntent(wi,Ci,!0);let xi,Ti=this._intentStates.get(ki.cacheKey);return Ti||(Ti=Object.create(null),this._intentStates.set(ki.cacheKey,Ti)),Ti.opListReadCapability||(xi=Object.create(null),xi.operatorListChanged=function(){Ti.operatorList.lastChunk&&(Ti.opListReadCapability.resolve(Ti.operatorList),Ti.renderTasks.delete(xi))},Ti.opListReadCapability=(0,_util.createPromiseCapability)(),(Ti.renderTasks||(Ti.renderTasks=new Set)).add(xi),Ti.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList(ki)),Ti.opListReadCapability.promise}streamTextContent({disableCombineTextItems:wi=!1,includeMarkedContent:Ci=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,combineTextItems:wi!==!0,includeMarkedContent:Ci===!0},{highWaterMark:100,size:ki=>ki.items.length})}getTextContent(wi={}){if(this._transport._htmlForXfa)return this.getXfa().then(ki=>_xfa_text.XfaText.textContent(ki));const Ci=this.streamTextContent(wi);return new Promise(function(ki,xi){const Ti=Ci.getReader(),Oi={items:[],styles:Object.create(null)};(function ji(){Ti.read().then(function({value:Li,done:Ii}){Ii?ki(Oi):(Object.assign(Oi.styles,Li.styles),Oi.items.push(...Li.items),ji())},xi)})()})}getStructTree(){return this._structTreePromise||(this._structTreePromise=this._transport.getStructTree(this._pageIndex))}_destroy(){this.destroyed=!0;const wi=[];for(const Ci of this._intentStates.values())if(this._abortOperatorList({intentState:Ci,reason:new Error("Page was destroyed."),force:!0}),!Ci.opListReadCapability)for(const ki of Ci.renderTasks)wi.push(ki.completed),ki.cancel();return this.objs.clear(),this._annotationPromises.clear(),this._jsActionsPromise=null,this._structTreePromise=null,this.pendingCleanup=!1,Promise.all(wi)}cleanup(wi=!1){return this.pendingCleanup=!0,this._tryCleanup(wi)}_tryCleanup(wi=!1){if(!this.pendingCleanup)return!1;for(const{renderTasks:Ci,operatorList:ki}of this._intentStates.values())if(Ci.size>0||!ki.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this._annotationPromises.clear(),this._jsActionsPromise=null,this._structTreePromise=null,wi&&this._stats&&(this._stats=new _display_utils.StatTimer),this.pendingCleanup=!1,!0}_startRenderPage(wi,Ci){const ki=this._intentStates.get(Ci);ki&&(this._stats&&this._stats.timeEnd("Page Request"),ki.displayReadyCapability&&ki.displayReadyCapability.resolve(wi))}_renderPageChunk(wi,Ci){for(let ki=0,xi=wi.length;ki{ki.read().then(({value:Oi,done:ji})=>{ji?xi.streamReader=null:this._transport.destroyed||(this._renderPageChunk(Oi,xi),Ti())},Oi=>{if(xi.streamReader=null,!this._transport.destroyed){if(xi.operatorList){xi.operatorList.lastChunk=!0;for(const ji of xi.renderTasks)ji.operatorListChanged();this._tryCleanup()}if(xi.displayReadyCapability)xi.displayReadyCapability.reject(Oi);else{if(!xi.opListReadCapability)throw Oi;xi.opListReadCapability.reject(Oi)}}})};Ti()}_abortOperatorList({intentState:wi,reason:Ci,force:ki=!1}){if(wi.streamReader){if(!ki){if(wi.renderTasks.size>0)return;if(Ci instanceof _display_utils.RenderingCancelledException){wi.streamReaderCancelTimeout=setTimeout(()=>{this._abortOperatorList({intentState:wi,reason:Ci,force:!0}),wi.streamReaderCancelTimeout=null},RENDERING_CANCELLED_TIMEOUT);return}}if(wi.streamReader.cancel(new _util.AbortException(Ci.message)).catch(()=>{}),wi.streamReader=null,!this._transport.destroyed){for(const[xi,Ti]of this._intentStates)if(Ti===wi){this._intentStates.delete(xi);break}this.cleanup()}}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){this._listeners=[],this._deferred=Promise.resolve()}postMessage(wi,Ci){const ki={data:structuredClone(wi,Ci||null)};this._deferred.then(()=>{for(const xi of this._listeners)xi.call(this,ki)})}addEventListener(wi,Ci){this._listeners.push(Ci)}removeEventListener(wi,Ci){const ki=this._listeners.indexOf(Ci);this._listeners.splice(ki,1)}terminate(){this._listeners.length=0}}exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};if(_is_node.isNodeJS&&typeof require=="function")PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if(typeof document=="object"){const Ei=(yi=document==null?void 0:document.currentScript)==null?void 0:yi.src;Ei&&(PDFWorkerUtil.fallbackWorkerSrc=Ei.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.createCDNWrapper=function(Ei){const wi=`importScripts("${Ei}");`;return URL.createObjectURL(new Blob([wi]))};class _PDFWorker{static get _workerPorts(){return(0,_util.shadow)(this,"_workerPorts",new WeakMap)}constructor({name:Ei=null,port:wi=null,verbosity:Ci=(0,_util.getVerbosityLevel)()}={}){if(wi&&_PDFWorker._workerPorts.has(wi))throw new Error("Cannot use more than one PDFWorker per port.");this.name=Ei,this.destroyed=!1,this.verbosity=Ci,this._readyCapability=(0,_util.createPromiseCapability)(),this._port=null,this._webWorker=null,this._messageHandler=null,wi?(_PDFWorker._workerPorts.set(wi,this),this._initializeFromPort(wi)):this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(Ei){this._port=Ei,this._messageHandler=new _message_handler.MessageHandler("main","worker",Ei),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve()}_initialize(){if(typeof Worker<"u"&&!PDFWorkerUtil.isWorkerDisabled&&!_PDFWorker._mainThreadWorkerMessageHandler){let Ei=_PDFWorker.workerSrc;try{(0,_util.isSameOrigin)(window.location.href,Ei)||(Ei=PDFWorkerUtil.createCDNWrapper(new URL(Ei,window.location).href));const wi=new Worker(Ei,{type:"module"}),Ci=new _message_handler.MessageHandler("main","worker",wi),ki=()=>{wi.removeEventListener("error",xi),Ci.destroy(),wi.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},xi=()=>{this._webWorker||ki()};wi.addEventListener("error",xi),Ci.on("test",Oi=>{wi.removeEventListener("error",xi),this.destroyed?ki():Oi?(this._messageHandler=Ci,this._port=wi,this._webWorker=wi,this._readyCapability.resolve(),Ci.send("configure",this.getWorkerConfiguration())):(this._setupFakeWorker(),Ci.destroy(),wi.terminate())}),Ci.on("ready",Oi=>{if(wi.removeEventListener("error",xi),this.destroyed)ki();else try{Ti()}catch{this._setupFakeWorker()}});const Ti=()=>{const Oi=new Uint8Array([255]);try{Ci.send("test",Oi,[Oi.buffer])}catch{(0,_util.warn)("Cannot use postMessage transfers."),Oi[0]=0,Ci.send("test",Oi)}};Ti();return}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}getWorkerConfiguration(){return{verbosity:this.verbosity}}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),_PDFWorker._setupFakeWorkerGlobal.then(Ei=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const wi=new LoopbackPort;this._port=wi;const Ci="fake"+PDFWorkerUtil.fakeWorkerId++,ki=new _message_handler.MessageHandler(Ci+"_worker",Ci,wi);Ei.setup(ki,wi);const xi=new _message_handler.MessageHandler(Ci,Ci+"_worker",wi);this._messageHandler=xi,this._readyCapability.resolve(),xi.send("configure",{verbosity:this.verbosity})}).catch(Ei=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${Ei.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),_PDFWorker._workerPorts.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(Ei){if(!(Ei!=null&&Ei.port))throw new Error("PDFWorker.fromPort - invalid method signature.");return this._workerPorts.has(Ei.port)?this._workerPorts.get(Ei.port):new _PDFWorker(Ei)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(PDFWorkerUtil.fallbackWorkerSrc!==null)return _is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){var Ei;try{return((Ei=globalThis.pdfjsWorker)==null?void 0:Ei.WorkerMessageHandler)||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node.isNodeJS&&typeof require=="function"){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}}exports.PDFWorker=_PDFWorker,_PDFWorker.getWorkerSrc=function(){return(0,_display_utils.deprecated)("`PDFWorker.getWorkerSrc()`, please use `PDFWorker.workerSrc` instead."),this.workerSrc};class WorkerTransport{constructor(wi,Ci,ki,xi,Ti){Er(this,vi,null);Er(this,bi,new Map);Er(this,_i,new Map);Er(this,$i,null);this.messageHandler=wi,this.loadingTask=Ci,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({docId:Ci.docId,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),ownerDocument:xi.ownerDocument,styleElement:xi.styleElement}),this._params=xi,this._readRange=Ti,xi.useWorkerFetch||(this.CMapReaderFactory=new xi.CMapReaderFactory({baseUrl:xi.cMapUrl,isCompressed:xi.cMapPacked}),this.StandardFontDataFactory=new xi.StandardFontDataFactory({baseUrl:xi.standardFontDataUrl})),this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this._networkStream=ki,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=(0,_util.createPromiseCapability)(),this.setupMessageHandler()}get pageCache(){return Cr(this,bi)}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}get stats(){return Cr(this,vi)}getRenderingIntent(wi,Ci=_util.AnnotationMode.ENABLE,ki=!1){let xi=_util.RenderingIntentFlag.DISPLAY,Ti="";switch(wi){case"any":xi=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":xi=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${wi}`)}switch(Ci){case _util.AnnotationMode.DISABLE:xi+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:xi+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:xi+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,Ti=this.annotationStorage.lastModified;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${Ci}`)}return ki&&(xi+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:xi,cacheKey:`${xi}_${Ti}`}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=(0,_util.createPromiseCapability)(),this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));const wi=[];for(const ki of Cr(this,bi).values())wi.push(ki._destroy());Cr(this,bi).clear(),Cr(this,_i).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const Ci=this.messageHandler.sendWithPromise("Terminate",null);return wi.push(Ci),Promise.all(wi).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),Nr(this,$i,null),this._getFieldObjectsPromise=null,this._hasJSActionsPromise=null,this._networkStream&&this._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:wi,loadingTask:Ci}=this;wi.on("GetReader",(xi,Ti)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=Oi=>{this._lastProgress={loaded:Oi.loaded,total:Oi.total}},Ti.onPull=()=>{this._fullReader.read().then(function({value:Oi,done:ji}){ji?Ti.close():((0,_util.assert)((0,_util.isArrayBuffer)(Oi),"GetReader - expected an ArrayBuffer."),Ti.enqueue(new Uint8Array(Oi),1,[Oi]))}).catch(Oi=>{Ti.error(Oi)})},Ti.onCancel=Oi=>{this._fullReader.cancel(Oi),Ti.ready.catch(ji=>{if(!this.destroyed)throw ji})}}),wi.on("ReaderHeadersReady",xi=>{const Ti=(0,_util.createPromiseCapability)(),Oi=this._fullReader;return Oi.headersReady.then(()=>{var ji;(!Oi.isStreamingSupported||!Oi.isRangeSupported)&&(this._lastProgress&&((ji=Ci.onProgress)==null||ji.call(Ci,this._lastProgress)),Oi.onProgress=Li=>{var Ii;(Ii=Ci.onProgress)==null||Ii.call(Ci,{loaded:Li.loaded,total:Li.total})}),Ti.resolve({isStreamingSupported:Oi.isStreamingSupported,isRangeSupported:Oi.isRangeSupported,contentLength:Oi.contentLength})},Ti.reject),Ti.promise});const ki={};wi.on("GetRangeReader",(xi,Ti)=>{if(this._readRange){Ti.onPull=()=>{this._readRange(xi).then(ji=>{const Li=`${xi.begin}-${xi.end}`;ki[Li]?Ti.close():(ki[Li]=!0,Ti.enqueue(new Uint8Array(ji),1,[ji]))}).catch(ji=>{Ti.error(ji)})},Ti.onCancel=ji=>{Ti.ready.catch(Li=>{if(!this.destroyed)throw Li})};return}(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const Oi=this._networkStream.getRangeReader(xi.begin,xi.end,xi.cause);Oi?(Ti.onPull=()=>{Oi.read().then(function({value:ji,done:Li}){Li?Ti.close():((0,_util.assert)((0,_util.isArrayBuffer)(ji),"GetRangeReader - expected an ArrayBuffer."),Ti.enqueue(new Uint8Array(ji),1,[ji]))}).catch(ji=>{Ti.error(ji)})},Ti.onCancel=ji=>{Oi.cancel(ji),Ti.ready.catch(Li=>{if(!this.destroyed)throw Li})}):Ti.close()}),wi.on("GetDoc",({pdfInfo:xi})=>{this._numPages=xi.numPages,this._htmlForXfa=xi.htmlForXfa,delete xi.htmlForXfa;let Ti;Ti=this._params.createDocumentProxy?this._params.createDocumentProxy(xi,this):new PDFDocumentProxy(xi,this),Ci._capability.resolve(Ti)}),wi.on("DocException",function(xi){let Ti;switch(xi.name){case"PasswordException":Ti=new _util.PasswordException(xi.message,xi.code);break;case"InvalidPDFException":Ti=new _util.InvalidPDFException(xi.message);break;case"MissingPDFException":Ti=new _util.MissingPDFException(xi.message);break;case"UnexpectedResponseException":Ti=new _util.UnexpectedResponseException(xi.message,xi.status);break;case"UnknownErrorException":Ti=new _util.UnknownErrorException(xi.message,xi.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}Ci._capability.reject(Ti)}),wi.on("PasswordRequest",xi=>{if(this._passwordCapability=(0,_util.createPromiseCapability)(),Ci.onPassword){const Ti=Oi=>{Oi instanceof Error?this._passwordCapability.reject(Oi):this._passwordCapability.resolve({password:Oi})};try{Ci.onPassword(Ti,xi.code)}catch(Oi){this._passwordCapability.reject(Oi)}}else this._passwordCapability.reject(new _util.PasswordException(xi.message,xi.code));return this._passwordCapability.promise}),wi.on("DataLoaded",xi=>{var Ti;(Ti=Ci.onProgress)==null||Ti.call(Ci,{loaded:xi.length,total:xi.length}),this.downloadInfoCapability.resolve(xi)}),wi.on("StartRenderPage",xi=>{this.destroyed||Cr(this,bi).get(xi.pageIndex)._startRenderPage(xi.transparency,xi.cacheKey)}),wi.on("commonobj",([xi,Ti,Oi])=>{var ji;if(!this.destroyed&&!this.commonObjs.has(xi))switch(Ti){case"Font":const Li=this._params;if("error"in Oi){const Fi=Oi.error;(0,_util.warn)(`Error during font loading: ${Fi}`),this.commonObjs.resolve(xi,Fi);break}let Ii=null;Li.pdfBug&&((ji=globalThis.FontInspector)!=null&&ji.enabled)&&(Ii={registerFont(Fi,Bi){globalThis.FontInspector.fontAdded(Fi,Bi)}});const Mi=new _font_loader.FontFaceObject(Oi,{isEvalSupported:Li.isEvalSupported,disableFontFace:Li.disableFontFace,ignoreErrors:Li.ignoreErrors,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),fontRegistry:Ii});this.fontLoader.bind(Mi).catch(Fi=>wi.sendWithPromise("FontFallback",{id:xi})).finally(()=>{!Li.fontExtraProperties&&Mi.data&&(Mi.data=null),this.commonObjs.resolve(xi,Mi)});break;case"FontPath":case"Image":this.commonObjs.resolve(xi,Oi);break;default:throw new Error(`Got unknown common object type ${Ti}`)}}),wi.on("obj",([xi,Ti,Oi,ji])=>{var Ii;if(this.destroyed)return;const Li=Cr(this,bi).get(Ti);if(!Li.objs.has(xi))switch(Oi){case"Image":Li.objs.resolve(xi,ji);const Mi=8e6;((Ii=ji==null?void 0:ji.data)==null?void 0:Ii.length)>Mi&&(Li.cleanupAfterRender=!0);break;case"Pattern":Li.objs.resolve(xi,ji);break;default:throw new Error(`Got unknown object type ${Oi}`)}}),wi.on("DocProgress",xi=>{var Ti;this.destroyed||((Ti=Ci.onProgress)==null||Ti.call(Ci,{loaded:xi.loaded,total:xi.total}))}),wi.on("DocStats",xi=>{this.destroyed||Nr(this,vi,Object.freeze({streamTypes:Object.freeze(xi.streamTypes),fontTypes:Object.freeze(xi.fontTypes)}))}),wi.on("UnsupportedFeature",this._onUnsupportedFeature.bind(this)),wi.on("FetchBuiltInCMap",xi=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.CMapReaderFactory?this.CMapReaderFactory.fetch(xi):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),wi.on("FetchStandardFontData",xi=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.StandardFontDataFactory?this.StandardFontDataFactory.fetch(xi):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}_onUnsupportedFeature({featureId:wi}){var Ci,ki;this.destroyed||((ki=(Ci=this.loadingTask).onUnsupportedFeature)==null||ki.call(Ci,wi))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}getRangeData(wi){return this.messageHandler.sendWithPromise("GetRangeData",wi)}ensureRangesData(wi){return this.messageHandler.sendWithPromise("EnsureRangesData",wi)}prefetchPageData(wi){return this.messageHandler.sendWithPromise("EnsurePageData",wi)}getPage(wi){if(!Number.isInteger(wi)||wi<=0||wi>this._numPages)return Promise.reject(new Error("Invalid page request."));const Ci=wi-1,ki=Cr(this,_i).get(Ci);if(ki)return ki;const xi=this.messageHandler.sendWithPromise("GetPage",{pageIndex:Ci}).then(Ti=>{if(this.destroyed)throw new Error("Transport destroyed");let Oi;return Oi=this._params.createPDFPageProxy?this._params.createPDFPageProxy(Ci,Ti,this,this._params.ownerDocument,this._params.pdfBug):new PDFPageProxy(Ci,Ti,this,this._params.ownerDocument,this._params.pdfBug),Cr(this,bi).set(Ci,Oi),Oi});return Cr(this,_i).set(Ci,xi),xi}getPageIndex(wi){return typeof wi!="object"||wi===null||!Number.isInteger(wi.num)||wi.num<0||!Number.isInteger(wi.gen)||wi.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:wi.num,gen:wi.gen})}getAnnotations(wi,Ci){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:wi,intent:Ci})}saveDocument(){var wi,Ci;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:this.annotationStorage.serializable,filename:(Ci=(wi=this._fullReader)==null?void 0:wi.filename)!=null?Ci:null}).finally(()=>{this.annotationStorage.resetModified()})}getFieldObjects(){return this._getFieldObjectsPromise||(this._getFieldObjectsPromise=this.messageHandler.sendWithPromise("GetFieldObjects",null))}hasJSActions(){return this._hasJSActionsPromise||(this._hasJSActionsPromise=this.messageHandler.sendWithPromise("HasJSActions",null))}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(wi){return typeof wi!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:wi})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getJavaScript(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}getDocJSActions(){return this.messageHandler.sendWithPromise("GetDocJSActions",null)}getPageJSActions(wi){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:wi})}getStructTree(wi){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:wi})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(wi=>new _optional_content_config.OptionalContentConfig(wi))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){return Cr(this,$i)||Nr(this,$i,this.messageHandler.sendWithPromise("GetMetadata",null).then(wi=>{var Ci,ki,xi,Ti;return{info:wi[0],metadata:wi[1]?new _metadata.Metadata(wi[1]):null,contentDispositionFilename:(ki=(Ci=this._fullReader)==null?void 0:Ci.filename)!=null?ki:null,contentLength:(Ti=(xi=this._fullReader)==null?void 0:xi.contentLength)!=null?Ti:null}}))}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(wi=!1){if(await this.messageHandler.sendWithPromise("Cleanup",null),!this.destroyed){for(const Ci of Cr(this,bi).values())if(!Ci.cleanup())throw new Error(`startCleanup: Page ${Ci.pageNumber} is currently rendering.`);this.commonObjs.clear(),wi||this.fontLoader.clear(),Nr(this,$i,null),this._getFieldObjectsPromise=null,this._hasJSActionsPromise=null}}get loadingParams(){const wi=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:wi.disableAutoFetch,enableXfa:wi.enableXfa})}}vi=new WeakMap,bi=new WeakMap,_i=new WeakMap,$i=new WeakMap,exports.WorkerTransport=WorkerTransport;class PDFObjects{constructor(){Er(this,Ai);Er(this,Pi,Object.create(null))}get(wi,Ci=null){if(Ci){const xi=xr(this,Ai,_s).call(this,wi);return xi.capability.promise.then(()=>Ci(xi.data)),null}const ki=Cr(this,Pi)[wi];if(!(ki!=null&&ki.capability.settled))throw new Error(`Requesting object that isn't resolved yet ${wi}.`);return ki.data}has(wi){var Ci;return((Ci=Cr(this,Pi)[wi])==null?void 0:Ci.capability.settled)||!1}resolve(wi,Ci=null){const ki=xr(this,Ai,_s).call(this,wi);ki.data=Ci,ki.capability.resolve()}clear(){Nr(this,Pi,Object.create(null))}}Pi=new WeakMap,Ai=new WeakSet,_s=function(wi){return Cr(this,Pi)[wi]||(Cr(this,Pi)[wi]={capability:(0,_util.createPromiseCapability)(),data:null})};class RenderTask{constructor(wi){this._internalRenderTask=wi,this.onContinue=null}get promise(){return this._internalRenderTask.capability.promise}cancel(){this._internalRenderTask.cancel()}}exports.RenderTask=RenderTask;class InternalRenderTask{static get canvasInUse(){return(0,_util.shadow)(this,"canvasInUse",new WeakSet)}constructor({callback:wi,params:Ci,objs:ki,commonObjs:xi,annotationCanvasMap:Ti,operatorList:Oi,pageIndex:ji,canvasFactory:Li,useRequestAnimationFrame:Ii=!1,pdfBug:Mi=!1}){this.callback=wi,this.params=Ci,this.objs=ki,this.commonObjs=xi,this.annotationCanvasMap=Ti,this.operatorListIdx=null,this.operatorList=Oi,this._pageIndex=ji,this.canvasFactory=Li,this._pdfBug=Mi,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=Ii===!0&&typeof window<"u",this.cancelled=!1,this.capability=(0,_util.createPromiseCapability)(),this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=Ci.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:wi=!1,optionalContentConfig:Ci}){var Li;if(this.cancelled)return;if(this._canvas){if(InternalRenderTask.canvasInUse.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");InternalRenderTask.canvasInUse.add(this._canvas)}this._pdfBug&&((Li=globalThis.StepperManager)!=null&&Li.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:ki,viewport:xi,transform:Ti,imageLayer:Oi,background:ji}=this.params;this.gfx=new _canvas.CanvasGraphics(ki,this.commonObjs,this.objs,this.canvasFactory,Oi,Ci,this.annotationCanvasMap),this.gfx.beginDrawing({transform:Ti,viewport:xi,transparency:wi,background:ji}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback&&this.graphicsReadyCallback()}cancel(wi=null){this.running=!1,this.cancelled=!0,this.gfx&&this.gfx.endDrawing(),this._canvas&&InternalRenderTask.canvasInUse.delete(this._canvas),this.callback(wi||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,"canvas"))}operatorListChanged(){this.graphicsReady?(this.stepper&&this.stepper.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound)}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),this._canvas&&InternalRenderTask.canvasInUse.delete(this._canvas),this.callback())))}}const version="2.13.217-alpha.85";exports.version=version;const build="bbff5b618";exports.build=build},(yi,vi,bi)=>{Object.defineProperty(vi,"__esModule",{value:!0}),vi.StatTimer=vi.RenderingCancelledException=vi.PixelsPerInch=vi.PageViewport=vi.PDFDateString=vi.DOMStandardFontDataFactory=vi.DOMSVGFactory=vi.DOMCanvasFactory=vi.DOMCMapReaderFactory=void 0,vi.deprecated=function(Ii){},vi.getFilenameFromUrl=function(Ii){const Mi=Ii.indexOf("#"),Fi=Ii.indexOf("?"),Bi=Math.min(Mi>0?Mi:Ii.length,Fi>0?Fi:Ii.length);return Ii.substring(Ii.lastIndexOf("/",Bi)+1,Bi)},vi.getPdfFilenameFromUrl=function(Ii,Mi="document.pdf"){if(typeof Ii!="string")return Mi;if(Ti(Ii))return(0,$i.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),Mi;const Fi=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,Bi=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(Ii);let Ri=Fi.exec(Bi[1])||Fi.exec(Bi[2])||Fi.exec(Bi[3]);if(Ri&&(Ri=Ri[0],Ri.includes("%")))try{Ri=Fi.exec(decodeURIComponent(Ri))[0]}catch{}return Ri||Mi},vi.getXfaPageViewport=function(Ii,{scale:Mi=1,rotation:Fi=0}){const{width:Bi,height:Ri}=Ii.attributes.style,Vi=[0,0,parseInt(Bi),parseInt(Ri)];return new ki({viewBox:Vi,scale:Mi,rotation:Fi})},vi.isDataScheme=Ti,vi.isPdfFile=function(Ii){return typeof Ii=="string"&&/\.pdf$/i.test(Ii)},vi.isValidFetchUrl=Oi,vi.loadScript=function(Ii,Mi=!1,Fi=!1){return new Promise((Bi,Ri)=>{const Vi=document.createElement("script");Vi.src=Ii,Fi&&(Vi.crossOrigin="anonymous"),Vi.onload=function(Ni){Mi&&Vi.remove(),Bi(Ni)},Vi.onerror=function(){Ri(new Error(`Cannot load script at: ${Vi.src}`))},(document.head||document.documentElement).appendChild(Vi)})};var _i=bi(6),$i=bi(1);const Li=class{};let Pi=Li;es(Pi,"CSS",96),es(Pi,"PDF",72),es(Pi,"PDF_TO_CSS_UNITS",Li.CSS/Li.PDF),vi.PixelsPerInch=Pi;class Ai extends _i.BaseCanvasFactory{constructor({ownerDocument:Mi=globalThis.document}={}){super(),this._document=Mi}_createCanvas(Mi,Fi){const Bi=this._document.createElement("canvas");return Bi.width=Mi,Bi.height=Fi,Bi}}vi.DOMCanvasFactory=Ai;async function Si(Ii,Mi=!1){if(Oi(Ii,document.baseURI)){const Fi=await fetch(Ii);if(!Fi.ok)throw new Error(Fi.statusText);return Mi?new Uint8Array(await Fi.arrayBuffer()):(0,$i.stringToBytes)(await Fi.text())}return new Promise((Fi,Bi)=>{const Ri=new XMLHttpRequest;Ri.open("GET",Ii,!0),Mi&&(Ri.responseType="arraybuffer"),Ri.onreadystatechange=()=>{if(Ri.readyState===XMLHttpRequest.DONE){if(Ri.status===200||Ri.status===0){let Vi;if(Mi&&Ri.response?Vi=new Uint8Array(Ri.response):!Mi&&Ri.responseText&&(Vi=(0,$i.stringToBytes)(Ri.responseText)),Vi){Fi(Vi);return}}Bi(new Error(Ri.statusText))}},Ri.send(null)})}class Ei extends _i.BaseCMapReaderFactory{_fetchData(Mi,Fi){return Si(Mi,this.isCompressed).then(Bi=>({cMapData:Bi,compressionType:Fi}))}}vi.DOMCMapReaderFactory=Ei;class wi extends _i.BaseStandardFontDataFactory{_fetchData(Mi){return Si(Mi,!0)}}vi.DOMStandardFontDataFactory=wi;class Ci extends _i.BaseSVGFactory{_createSVG(Mi){return document.createElementNS("http://www.w3.org/2000/svg",Mi)}}vi.DOMSVGFactory=Ci;class ki{constructor({viewBox:Mi,scale:Fi,rotation:Bi,offsetX:Ri=0,offsetY:Vi=0,dontFlip:Ni=!1}){this.viewBox=Mi,this.scale=Fi,this.rotation=Bi,this.offsetX=Ri,this.offsetY=Vi;const Wi=(Mi[2]+Mi[0])/2,zi=(Mi[3]+Mi[1])/2;let Di,Ui,Hi,qi,Gi,Ki,Qi,Xi;switch((Bi%=360)<0&&(Bi+=360),Bi){case 180:Di=-1,Ui=0,Hi=0,qi=1;break;case 90:Di=0,Ui=1,Hi=1,qi=0;break;case 270:Di=0,Ui=-1,Hi=-1,qi=0;break;case 0:Di=1,Ui=0,Hi=0,qi=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}Ni&&(Hi=-Hi,qi=-qi),Di===0?(Gi=Math.abs(zi-Mi[1])*Fi+Ri,Ki=Math.abs(Wi-Mi[0])*Fi+Vi,Qi=Math.abs(Mi[3]-Mi[1])*Fi,Xi=Math.abs(Mi[2]-Mi[0])*Fi):(Gi=Math.abs(Wi-Mi[0])*Fi+Ri,Ki=Math.abs(zi-Mi[1])*Fi+Vi,Qi=Math.abs(Mi[2]-Mi[0])*Fi,Xi=Math.abs(Mi[3]-Mi[1])*Fi),this.transform=[Di*Fi,Ui*Fi,Hi*Fi,qi*Fi,Gi-Di*Fi*Wi-Hi*Fi*zi,Ki-Ui*Fi*Wi-qi*Fi*zi],this.width=Qi,this.height=Xi}clone({scale:Mi=this.scale,rotation:Fi=this.rotation,offsetX:Bi=this.offsetX,offsetY:Ri=this.offsetY,dontFlip:Vi=!1}={}){return new ki({viewBox:this.viewBox.slice(),scale:Mi,rotation:Fi,offsetX:Bi,offsetY:Ri,dontFlip:Vi})}convertToViewportPoint(Mi,Fi){return $i.Util.applyTransform([Mi,Fi],this.transform)}convertToViewportRectangle(Mi){const Fi=$i.Util.applyTransform([Mi[0],Mi[1]],this.transform),Bi=$i.Util.applyTransform([Mi[2],Mi[3]],this.transform);return[Fi[0],Fi[1],Bi[0],Bi[1]]}convertToPdfPoint(Mi,Fi){return $i.Util.applyInverseTransform([Mi,Fi],this.transform)}convertToPdfRectangle(Mi){let[Fi,Bi,Ri,Vi]=Mi;return[Fi,Bi]=$i.Util.applyInverseTransform([Fi,Bi],this.transform),[Ri,Vi]=$i.Util.applyInverseTransform([Ri,Vi],this.transform),[Fi,Bi,Ri,Vi]}}vi.PageViewport=ki;class xi extends $i.BaseException{constructor(Mi,Fi){super(Mi,"RenderingCancelledException"),this.type=Fi}}vi.RenderingCancelledException=xi;function Ti(Ii){const Mi=Ii.length;let Fi=0;for(;FiMi&&(Mi=Bi.length)}for(const Fi of this.times){const Bi=Fi.end-Fi.start;Ii.push(`${Fi.name.padEnd(Mi)} ${Bi}ms `)}return Ii.join("")}};function Oi(Ii,Mi){try{const{protocol:Fi}=Mi?new URL(Ii,Mi):new URL(Ii);return Fi==="http:"||Fi==="https:"}catch{return!1}}let ji;vi.PDFDateString=class{static toDateObject(Ii){if(!Ii||typeof Ii!="string")return null;ji||(ji=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const Mi=ji.exec(Ii);if(!Mi)return null;const Fi=parseInt(Mi[1],10);let Bi=parseInt(Mi[2],10);Bi=Bi>=1&&Bi<=12?Bi-1:0;let Ri=parseInt(Mi[3],10);Ri=Ri>=1&&Ri<=31?Ri:1;let Vi=parseInt(Mi[4],10);Vi=Vi>=0&&Vi<=23?Vi:0;let Ni=parseInt(Mi[5],10);Ni=Ni>=0&&Ni<=59?Ni:0;let Wi=parseInt(Mi[6],10);Wi=Wi>=0&&Wi<=59?Wi:0;const zi=Mi[7]||"Z";let Di=parseInt(Mi[8],10);Di=Di>=0&&Di<=23?Di:0;let Ui=parseInt(Mi[9],10)||0;return Ui=Ui>=0&&Ui<=59?Ui:0,zi==="-"?(Vi+=Di,Ni+=Ui):zi==="+"&&(Vi-=Di,Ni-=Ui),new Date(Date.UTC(Fi,Bi,Ri,Vi,Ni,Wi))}}},(yi,vi,bi)=>{Object.defineProperty(vi,"__esModule",{value:!0}),vi.BaseStandardFontDataFactory=vi.BaseSVGFactory=vi.BaseCanvasFactory=vi.BaseCMapReaderFactory=void 0;var _i=bi(1);class $i{constructor(){this.constructor===$i&&(0,_i.unreachable)("Cannot initialize BaseCanvasFactory.")}create(wi,Ci){if(wi<=0||Ci<=0)throw new Error("Invalid canvas size");const ki=this._createCanvas(wi,Ci);return{canvas:ki,context:ki.getContext("2d")}}reset(wi,Ci,ki){if(!wi.canvas)throw new Error("Canvas is not specified");if(Ci<=0||ki<=0)throw new Error("Invalid canvas size");wi.canvas.width=Ci,wi.canvas.height=ki}destroy(wi){if(!wi.canvas)throw new Error("Canvas is not specified");wi.canvas.width=0,wi.canvas.height=0,wi.canvas=null,wi.context=null}_createCanvas(wi,Ci){(0,_i.unreachable)("Abstract method `_createCanvas` called.")}}vi.BaseCanvasFactory=$i;class Pi{constructor({baseUrl:wi=null,isCompressed:Ci=!1}){this.constructor===Pi&&(0,_i.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=wi,this.isCompressed=Ci}async fetch({name:wi}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!wi)throw new Error("CMap name must be specified.");const Ci=this.baseUrl+wi+(this.isCompressed?".bcmap":""),ki=this.isCompressed?_i.CMapCompressionType.BINARY:_i.CMapCompressionType.NONE;return this._fetchData(Ci,ki).catch(xi=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${Ci}`)})}_fetchData(wi,Ci){(0,_i.unreachable)("Abstract method `_fetchData` called.")}}vi.BaseCMapReaderFactory=Pi;class Ai{constructor({baseUrl:wi=null}){this.constructor===Ai&&(0,_i.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=wi}async fetch({filename:wi}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!wi)throw new Error("Font filename must be specified.");const Ci=`${this.baseUrl}${wi}`;return this._fetchData(Ci).catch(ki=>{throw new Error(`Unable to load font data at: ${Ci}`)})}_fetchData(wi){(0,_i.unreachable)("Abstract method `_fetchData` called.")}}vi.BaseStandardFontDataFactory=Ai;class Si{constructor(){this.constructor===Si&&(0,_i.unreachable)("Cannot initialize BaseSVGFactory.")}create(wi,Ci){if(wi<=0||Ci<=0)throw new Error("Invalid SVG dimensions");const ki=this._createSVG("svg:svg");return ki.setAttribute("version","1.1"),ki.setAttribute("width",`${wi}px`),ki.setAttribute("height",`${Ci}px`),ki.setAttribute("preserveAspectRatio","none"),ki.setAttribute("viewBox",`0 0 ${wi} ${Ci}`),ki}createElement(wi){if(typeof wi!="string")throw new Error("Invalid SVG element type");return this._createSVG(wi)}_createSVG(wi){(0,_i.unreachable)("Abstract method `_createSVG` called.")}}vi.BaseSVGFactory=Si},(yi,vi,bi)=>{Object.defineProperty(vi,"__esModule",{value:!0}),vi.FontLoader=vi.FontFaceObject=void 0;var _i=bi(1);class $i{constructor({docId:Si,onUnsupportedFeature:Ei,ownerDocument:wi=globalThis.document,styleElement:Ci=null}){this.constructor===$i&&(0,_i.unreachable)("Cannot initialize BaseFontLoader."),this.docId=Si,this._onUnsupportedFeature=Ei,this._document=wi,this.nativeFontFaces=[],this.styleElement=null}addNativeFontFace(Si){this.nativeFontFaces.push(Si),this._document.fonts.add(Si)}insertRule(Si){let Ei=this.styleElement;Ei||(Ei=this.styleElement=this._document.createElement("style"),Ei.id=`PDFJS_FONT_STYLE_TAG_${this.docId}`,this._document.documentElement.getElementsByTagName("head")[0].appendChild(Ei));const wi=Ei.sheet;wi.insertRule(Si,wi.cssRules.length)}clear(){for(const Si of this.nativeFontFaces)this._document.fonts.delete(Si);this.nativeFontFaces.length=0,this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async bind(Si){if(Si.attached||Si.missingFile)return;if(Si.attached=!0,this.isFontLoadingAPISupported){const wi=Si.createNativeFontFace();if(wi){this.addNativeFontFace(wi);try{await wi.loaded}catch(Ci){throw this._onUnsupportedFeature({featureId:_i.UNSUPPORTED_FEATURES.errorFontLoadNative}),(0,_i.warn)(`Failed to load font '${wi.family}': '${Ci}'.`),Si.disableFontFace=!0,Ci}}return}const Ei=Si.createFontFaceRule();if(Ei){if(this.insertRule(Ei),this.isSyncFontLoadingSupported)return;await new Promise(wi=>{const Ci=this._queueLoadingCallback(wi);this._prepareFontLoadEvent([Ei],[Si],Ci)})}}_queueLoadingCallback(Si){(0,_i.unreachable)("Abstract method `_queueLoadingCallback`.")}get isFontLoadingAPISupported(){var Ei;const Si=!!((Ei=this._document)!=null&&Ei.fonts);return(0,_i.shadow)(this,"isFontLoadingAPISupported",Si)}get isSyncFontLoadingSupported(){(0,_i.unreachable)("Abstract method `isSyncFontLoadingSupported`.")}get _loadTestFont(){(0,_i.unreachable)("Abstract method `_loadTestFont`.")}_prepareFontLoadEvent(Si,Ei,wi){(0,_i.unreachable)("Abstract method `_prepareFontLoadEvent`.")}}let Pi;vi.FontLoader=Pi,vi.FontLoader=Pi=class extends $i{constructor(Ai){super(Ai),this.loadingContext={requests:[],nextRequestId:0},this.loadTestFontId=0}get isSyncFontLoadingSupported(){var Si;let Ai=!1;return(typeof navigator>"u"||((Si=/Mozilla\/5.0.*?rv:(\d+).*? Gecko/.exec(navigator.userAgent))==null?void 0:Si[1])>=14)&&(Ai=!0),(0,_i.shadow)(this,"isSyncFontLoadingSupported",Ai)}_queueLoadingCallback(Ai){const Si=this.loadingContext,Ei={id:"pdfjs-font-loading-"+Si.nextRequestId++,done:!1,complete:function(){for((0,_i.assert)(!Ei.done,"completeRequest() cannot be called twice."),Ei.done=!0;Si.requests.length>0&&Si.requests[0].done;){const wi=Si.requests.shift();setTimeout(wi.callback,0)}},callback:Ai};return Si.requests.push(Ei),Ei}get _loadTestFont(){return(0,_i.shadow)(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}_prepareFontLoadEvent(Ai,Si,Ei){function wi(Ni,Wi){return Ni.charCodeAt(Wi)<<24|Ni.charCodeAt(Wi+1)<<16|Ni.charCodeAt(Wi+2)<<8|255&Ni.charCodeAt(Wi+3)}function Ci(Ni,Wi,zi,Di){return Ni.substring(0,Wi)+Di+Ni.substring(Wi+zi)}let ki,xi;const Ti=this._document.createElement("canvas");Ti.width=1,Ti.height=1;const Oi=Ti.getContext("2d");let ji=0;const Li=`lt${Date.now()}${this.loadTestFontId++}`;let Ii=this._loadTestFont;Ii=Ci(Ii,976,Li.length,Li);const Mi=1482184792;let Fi=wi(Ii,16);for(ki=0,xi=Li.length-3;ki30){(0,_i.warn)("Load test font never loaded."),zi();return}Oi.font="30px "+Wi,Oi.fillText(".",0,20),Oi.getImageData(0,0,1,1).data[3]>0?zi():setTimeout(Ni.bind(null,Wi,zi))}(Li,()=>{Vi.remove(),Ei.complete()})}},vi.FontFaceObject=class{constructor(Ai,{isEvalSupported:Si=!0,disableFontFace:Ei=!1,ignoreErrors:wi=!1,onUnsupportedFeature:Ci,fontRegistry:ki=null}){this.compiledGlyphs=Object.create(null);for(const xi in Ai)this[xi]=Ai[xi];this.isEvalSupported=Si!==!1,this.disableFontFace=Ei===!0,this.ignoreErrors=wi===!0,this._onUnsupportedFeature=Ci,this.fontRegistry=ki}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let Ai;if(this.cssFontInfo){const Si={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(Si.style=`oblique ${this.cssFontInfo.italicAngle}deg`),Ai=new FontFace(this.cssFontInfo.fontFamily,this.data,Si)}else Ai=new FontFace(this.loadedName,this.data,{});return this.fontRegistry&&this.fontRegistry.registerFont(this),Ai}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const Ai=(0,_i.bytesToString)(this.data),Si=`url(data:${this.mimetype};base64,${btoa(Ai)});`;let Ei;if(this.cssFontInfo){let wi=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(wi+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),Ei=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${wi}src:${Si}}`}else Ei=`@font-face {font-family:"${this.loadedName}";src:${Si}}`;return this.fontRegistry&&this.fontRegistry.registerFont(this,Si),Ei}getPathGenerator(Ai,Si){if(this.compiledGlyphs[Si]!==void 0)return this.compiledGlyphs[Si];let Ei;try{Ei=Ai.get(this.loadedName+"_path_"+Si)}catch(wi){if(!this.ignoreErrors)throw wi;return this._onUnsupportedFeature({featureId:_i.UNSUPPORTED_FEATURES.errorFontGetPath}),(0,_i.warn)(`getPathGenerator - ignoring character: "${wi}".`),this.compiledGlyphs[Si]=function(Ci,ki){}}if(this.isEvalSupported&&_i.IsEvalSupportedCached.value){const wi=[];for(const Ci of Ei){const ki=Ci.args!==void 0?Ci.args.join(","):"";wi.push("c.",Ci.cmd,"(",ki,`); `)}return this.compiledGlyphs[Si]=new Function("c","size",wi.join(""))}return this.compiledGlyphs[Si]=function(wi,Ci){for(const ki of Ei)ki.cmd==="scale"&&(ki.args=[Ci,-Ci]),wi[ki.cmd].apply(wi,ki.args)}}}},(yi,vi,bi)=>{Object.defineProperty(vi,"__esModule",{value:!0}),vi.NodeStandardFontDataFactory=vi.NodeCanvasFactory=vi.NodeCMapReaderFactory=void 0;var _i=bi(6),$i=bi(3),Pi=bi(1);let Ai=class{constructor(){(0,Pi.unreachable)("Not implemented: NodeCanvasFactory")}};vi.NodeCanvasFactory=Ai;let Si=class{constructor(){(0,Pi.unreachable)("Not implemented: NodeCMapReaderFactory")}};vi.NodeCMapReaderFactory=Si;let Ei=class{constructor(){(0,Pi.unreachable)("Not implemented: NodeStandardFontDataFactory")}};if(vi.NodeStandardFontDataFactory=Ei,$i.isNodeJS){const wi=function(Ci){return new Promise((ki,xi)=>{require$$5.readFile(Ci,(Ti,Oi)=>{!Ti&&Oi?ki(new Uint8Array(Oi)):xi(new Error(Ti))})})};vi.NodeCanvasFactory=Ai=class extends _i.BaseCanvasFactory{_createCanvas(Ci,ki){try{return require("canvas").createCanvas(Ci,ki)}catch{}}},vi.NodeCMapReaderFactory=Si=class extends _i.BaseCMapReaderFactory{_fetchData(Ci,ki){return wi(Ci).then(xi=>({cMapData:xi,compressionType:ki}))}},vi.NodeStandardFontDataFactory=Ei=class extends _i.BaseStandardFontDataFactory{_fetchData(Ci){return wi(Ci)}}}},(yi,vi,bi)=>{Object.defineProperty(vi,"__esModule",{value:!0}),vi.AnnotationStorage=void 0;var _i=bi(1);vi.AnnotationStorage=class{constructor(){this._storage=new Map,this._timeStamp=Date.now(),this._modified=!1,this.onSetModified=null,this.onResetModified=null}getValue($i,Pi){const Ai=this._storage.get($i);return Ai===void 0?Pi:Object.assign(Pi,Ai)}setValue($i,Pi){const Ai=this._storage.get($i);let Si=!1;if(Ai!==void 0)for(const[Ei,wi]of Object.entries(Pi))Ai[Ei]!==wi&&(Si=!0,Ai[Ei]=wi);else Si=!0,this._storage.set($i,Pi);Si&&(this._timeStamp=Date.now(),this._setModified())}getAll(){return this._storage.size>0?(0,_i.objectFromMap)(this._storage):null}get size(){return this._storage.size}_setModified(){this._modified||(this._modified=!0,typeof this.onSetModified=="function"&&this.onSetModified())}resetModified(){this._modified&&(this._modified=!1,typeof this.onResetModified=="function"&&this.onResetModified())}get serializable(){return this._storage.size>0?this._storage:null}get lastModified(){return this._timeStamp.toString()}}},(yi,vi,bi)=>{Object.defineProperty(vi,"__esModule",{value:!0}),vi.CanvasGraphics=void 0;var _i=bi(1),$i=bi(11),Pi=bi(5);const Ai=4096,Si=16;function Ei(zi){if(zi._transformStack&&(zi._transformStack=[]),!zi.mozCurrentTransform){zi._originalSave=zi.save,zi._originalRestore=zi.restore,zi._originalRotate=zi.rotate,zi._originalScale=zi.scale,zi._originalTranslate=zi.translate,zi._originalTransform=zi.transform,zi._originalSetTransform=zi.setTransform,zi._originalResetTransform=zi.resetTransform,zi._transformMatrix=zi._transformMatrix||[1,0,0,1,0,0],zi._transformStack=[];try{const Di=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(zi),"lineWidth");zi._setLineWidth=Di.set,zi._getLineWidth=Di.get,Object.defineProperty(zi,"lineWidth",{set:function(Ui){this._setLineWidth(1.000001*Ui)},get:function(){return this._getLineWidth()}})}catch{}Object.defineProperty(zi,"mozCurrentTransform",{get:function(){return this._transformMatrix}}),Object.defineProperty(zi,"mozCurrentTransformInverse",{get:function(){const[Di,Ui,Hi,qi,Gi,Ki]=this._transformMatrix,Qi=Di*qi-Ui*Hi,Xi=Ui*Hi-Di*qi;return[qi/Qi,Ui/Xi,Hi/Xi,Di/Qi,(qi*Gi-Hi*Ki)/Xi,(Ui*Gi-Di*Ki)/Qi]}}),zi.save=function(){const Di=this._transformMatrix;this._transformStack.push(Di),this._transformMatrix=Di.slice(0,6),this._originalSave()},zi.restore=function(){this._transformStack.length===0&&(0,_i.warn)("Tried to restore a ctx when the stack was already empty.");const Di=this._transformStack.pop();Di&&(this._transformMatrix=Di,this._originalRestore())},zi.translate=function(Di,Ui){const Hi=this._transformMatrix;Hi[4]=Hi[0]*Di+Hi[2]*Ui+Hi[4],Hi[5]=Hi[1]*Di+Hi[3]*Ui+Hi[5],this._originalTranslate(Di,Ui)},zi.scale=function(Di,Ui){const Hi=this._transformMatrix;Hi[0]*=Di,Hi[1]*=Di,Hi[2]*=Ui,Hi[3]*=Ui,this._originalScale(Di,Ui)},zi.transform=function(Di,Ui,Hi,qi,Gi,Ki){const Qi=this._transformMatrix;this._transformMatrix=[Qi[0]*Di+Qi[2]*Ui,Qi[1]*Di+Qi[3]*Ui,Qi[0]*Hi+Qi[2]*qi,Qi[1]*Hi+Qi[3]*qi,Qi[0]*Gi+Qi[2]*Ki+Qi[4],Qi[1]*Gi+Qi[3]*Ki+Qi[5]],zi._originalTransform(Di,Ui,Hi,qi,Gi,Ki)},zi.setTransform=function(Di,Ui,Hi,qi,Gi,Ki){this._transformMatrix=[Di,Ui,Hi,qi,Gi,Ki],zi._originalSetTransform(Di,Ui,Hi,qi,Gi,Ki)},zi.resetTransform=function(){this._transformMatrix=[1,0,0,1,0,0],zi._originalResetTransform()},zi.rotate=function(Di){const Ui=Math.cos(Di),Hi=Math.sin(Di),qi=this._transformMatrix;this._transformMatrix=[qi[0]*Ui+qi[2]*Hi,qi[1]*Ui+qi[3]*Hi,qi[0]*-Hi+qi[2]*Ui,qi[1]*-Hi+qi[3]*Ui,qi[4],qi[5]],this._originalRotate(Di)}}}class wi{constructor(Di){this.canvasFactory=Di,this.cache=Object.create(null)}getCanvas(Di,Ui,Hi,qi){let Gi;return this.cache[Di]!==void 0?(Gi=this.cache[Di],this.canvasFactory.reset(Gi,Ui,Hi),Gi.context.setTransform(1,0,0,1,0,0)):(Gi=this.canvasFactory.create(Ui,Hi),this.cache[Di]=Gi),qi&&Ei(Gi.context),Gi}clear(){for(const Di in this.cache){const Ui=this.cache[Di];this.canvasFactory.destroy(Ui),delete this.cache[Di]}}}class Ci{constructor(Di,Ui){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=_i.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=_i.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=_i.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps=null,this.startNewPathAndClipBox([0,0,Di,Ui])}clone(){const Di=Object.create(this);return Di.clipBox=this.clipBox.slice(),Di}setCurrentPoint(Di,Ui){this.x=Di,this.y=Ui}updatePathMinMax(Di,Ui,Hi){[Ui,Hi]=_i.Util.applyTransform([Ui,Hi],Di),this.minX=Math.min(this.minX,Ui),this.minY=Math.min(this.minY,Hi),this.maxX=Math.max(this.maxX,Ui),this.maxY=Math.max(this.maxY,Hi)}updateCurvePathMinMax(Di,Ui,Hi,qi,Gi,Ki,Qi,Xi,rr){const ar=_i.Util.bezierBoundingBox(Ui,Hi,qi,Gi,Ki,Qi,Xi,rr);this.updatePathMinMax(Di,ar[0],ar[1]),this.updatePathMinMax(Di,ar[2],ar[3])}getPathBoundingBox(Di=$i.PathType.FILL,Ui=null){const Hi=[this.minX,this.minY,this.maxX,this.maxY];if(Di===$i.PathType.STROKE){Ui||(0,_i.unreachable)("Stroke bounding box must include transform.");const qi=_i.Util.singularValueDecompose2dScale(Ui),Gi=qi[0]*this.lineWidth/2,Ki=qi[1]*this.lineWidth/2;Hi[0]-=Gi,Hi[1]-=Ki,Hi[2]+=Gi,Hi[3]+=Ki}return Hi}updateClipFromPath(){const Di=_i.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(Di||[0,0,0,0])}startNewPathAndClipBox(Di){this.clipBox=Di,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(Di=$i.PathType.FILL,Ui=null){return _i.Util.intersect(this.clipBox,this.getPathBoundingBox(Di,Ui))}}function ki(zi,Di,Ui=null){if(typeof ImageData<"u"&&Di instanceof ImageData){zi.putImageData(Di,0,0);return}const Hi=Di.height,qi=Di.width,Gi=Hi%Si,Ki=(Hi-Gi)/Si,Qi=Gi===0?Ki:Ki+1,Xi=zi.createImageData(qi,Si);let rr,ar=0;const gr=Di.data,fr=Xi.data;let lr,mr,vr,Yi,nr,ir,cr,tr;if(Ui)switch(Ui.length){case 1:nr=Ui[0],ir=Ui[0],cr=Ui[0],tr=Ui[0];break;case 4:nr=Ui[0],ir=Ui[1],cr=Ui[2],tr=Ui[3]}if(Di.kind===_i.ImageKind.GRAYSCALE_1BPP){const dr=gr.byteLength,Ji=new Uint32Array(fr.buffer,0,fr.byteLength>>2),sr=Ji.length,pr=qi+7>>3;let or=4294967295,Zi=_i.IsLittleEndianCached.value?4278190080:255;for(tr&&tr[0]===255&&tr[255]===0&&([or,Zi]=[Zi,or]),lr=0;lrpr?qi:8*er-7,_r=-8&ur;let $r=0,Pr=0;for(;hr<_r;hr+=8)Pr=gr[ar++],Ji[rr++]=128&Pr?or:Zi,Ji[rr++]=64&Pr?or:Zi,Ji[rr++]=32&Pr?or:Zi,Ji[rr++]=16&Pr?or:Zi,Ji[rr++]=8&Pr?or:Zi,Ji[rr++]=4&Pr?or:Zi,Ji[rr++]=2&Pr?or:Zi,Ji[rr++]=1&Pr?or:Zi;for(;hr>=1}for(;rr=Ki&&(vr=Gi,Yi=qi*vr),rr=0,mr=Yi;mr--;)fr[rr++]=gr[ar++],fr[rr++]=gr[ar++],fr[rr++]=gr[ar++],fr[rr++]=255;if(dr)for(let Ji=0;Ji>=1}zi.putImageData(Qi,0,gr*Si)}}function Ti(zi,Di){const Ui=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"];for(let Hi=0,qi=Ui.length;Hi>8,zi[Gi-2]=zi[Gi-2]*Ki+Ui*Qi>>8,zi[Gi-1]=zi[Gi-1]*Ki+Hi*Qi>>8}}}function Li(zi,Di,Ui){const Hi=zi.length;for(let qi=3;qi>8]>>8:Di[qi]*Gi>>16}}function Mi(zi,Di,Ui,Hi){const qi=Hi[0],Gi=Hi[1],Ki=Hi[2]-qi,Qi=Hi[3]-Gi;Ki!==0&&Qi!==0&&(function(Xi,rr,ar,gr,fr,lr,mr,vr,Yi,nr,ir){const cr=!!lr,tr=cr?lr[0]:0,dr=cr?lr[1]:0,Ji=cr?lr[2]:0;let sr;sr=fr==="Luminosity"?Ii:Li;const pr=Math.min(gr,Math.ceil(1048576/ar));for(let or=0;or10&&typeof Hi=="function",ar=rr?Date.now()+15:0;let gr=0;const fr=this.commonObjs,lr=this.objs;let mr;for(;;){if(qi!==void 0&&Qi===qi.nextBreakPoint)return qi.breakIt(Qi,Hi),Qi;if(mr=Ki[Qi],mr!==_i.OPS.dependency)this[mr].apply(this,Gi[Qi]);else for(const vr of Gi[Qi]){const Yi=vr.startsWith("g_")?fr:lr;if(!Yi.has(vr))return Yi.get(vr,Hi),Qi}if(Qi++,Qi===Xi)return Qi;if(rr&&++gr>10){if(Date.now()>ar)return Hi(),Qi;gr=0}}}endDrawing(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null),this.cachedCanvases.clear(),this.cachedPatterns.clear(),this.imageLayer&&this.imageLayer.endLayout()}_scaleImage(Di,Ui){const Hi=Di.width,qi=Di.height;let Gi,Ki,Qi=Math.max(Math.hypot(Ui[0],Ui[1]),1),Xi=Math.max(Math.hypot(Ui[2],Ui[3]),1),rr=Hi,ar=qi,gr="prescale1";for(;Qi>2&&rr>1||Xi>2&&ar>1;){let fr=rr,lr=ar;Qi>2&&rr>1&&(fr=Math.ceil(rr/2),Qi/=rr/fr),Xi>2&&ar>1&&(lr=Math.ceil(ar/2),Xi/=ar/lr),Gi=this.cachedCanvases.getCanvas(gr,fr,lr),Ki=Gi.context,Ki.clearRect(0,0,fr,lr),Ki.drawImage(Di,0,0,rr,ar,0,0,fr,lr),Di=Gi.canvas,rr=fr,ar=lr,gr=gr==="prescale1"?"prescale2":"prescale1"}return{img:Di,paintWidth:rr,paintHeight:ar}}_createMaskCanvas(Di){const Ui=this.ctx,Hi=Di.width,qi=Di.height,Gi=this.current.fillColor,Ki=this.current.patternFill,Qi=this.cachedCanvases.getCanvas("maskCanvas",Hi,qi);xi(Qi.context,Di);const Xi=Ui.mozCurrentTransform;let rr=_i.Util.transform(Xi,[1/Hi,0,0,-1/qi,0,0]);rr=_i.Util.transform(rr,[1,0,0,1,0,-qi]);const ar=_i.Util.applyTransform([0,0],rr),gr=_i.Util.applyTransform([Hi,qi],rr),fr=_i.Util.normalizeRect([ar[0],ar[1],gr[0],gr[1]]),lr=Math.ceil(fr[2]-fr[0]),mr=Math.ceil(fr[3]-fr[1]),vr=this.cachedCanvases.getCanvas("fillCanvas",lr,mr,!0),Yi=vr.context,nr=Math.min(ar[0],gr[0]),ir=Math.min(ar[1],gr[1]);Yi.translate(-nr,-ir),Yi.transform.apply(Yi,rr);const cr=this._scaleImage(Qi.canvas,Yi.mozCurrentTransformInverse);Yi.imageSmoothingEnabled=Fi(Yi.mozCurrentTransform,Di.interpolate),Yi.drawImage(cr.img,0,0,cr.img.width,cr.img.height,0,0,Hi,qi),Yi.globalCompositeOperation="source-in";const tr=_i.Util.transform(Yi.mozCurrentTransformInverse,[1,0,0,1,-nr,-ir]);return Yi.fillStyle=Ki?Gi.getPattern(Ui,this,tr,$i.PathType.FILL):Gi,Yi.fillRect(0,0,Hi,qi),{canvas:vr.canvas,offsetX:Math.round(nr),offsetY:Math.round(ir)}}setLineWidth(Di){this.current.lineWidth=Di,this.ctx.lineWidth=Di}setLineCap(Di){this.ctx.lineCap=Bi[Di]}setLineJoin(Di){this.ctx.lineJoin=Ri[Di]}setMiterLimit(Di){this.ctx.miterLimit=Di}setDash(Di,Ui){const Hi=this.ctx;Hi.setLineDash!==void 0&&(Hi.setLineDash(Di),Hi.lineDashOffset=Ui)}setRenderingIntent(Di){}setFlatness(Di){}setGState(Di){for(let Ui=0,Hi=Di.length;Ui{Ki.save=Ki.__originalSave,Ki.restore=Ki.__originalRestore,Ki.rotate=Ki.__originalRotate,Ki.scale=Ki.__originalScale,Ki.translate=Ki.__originalTranslate,Ki.transform=Ki.__originalTransform,Ki.setTransform=Ki.__originalSetTransform,Ki.resetTransform=Ki.__originalResetTransform,Ki.clip=Ki.__originalClip,Ki.moveTo=Ki.__originalMoveTo,Ki.lineTo=Ki.__originalLineTo,Ki.bezierCurveTo=Ki.__originalBezierCurveTo,Ki.rect=Ki.__originalRect,Ki.closePath=Ki.__originalClosePath,Ki.beginPath=Ki.__originalBeginPath,delete Ki._removeMirroring},Ki.save=function(){Qi.save(),this.__originalSave()},Ki.restore=function(){Qi.restore(),this.__originalRestore()},Ki.translate=function(Xi,rr){Qi.translate(Xi,rr),this.__originalTranslate(Xi,rr)},Ki.scale=function(Xi,rr){Qi.scale(Xi,rr),this.__originalScale(Xi,rr)},Ki.transform=function(Xi,rr,ar,gr,fr,lr){Qi.transform(Xi,rr,ar,gr,fr,lr),this.__originalTransform(Xi,rr,ar,gr,fr,lr)},Ki.setTransform=function(Xi,rr,ar,gr,fr,lr){Qi.setTransform(Xi,rr,ar,gr,fr,lr),this.__originalSetTransform(Xi,rr,ar,gr,fr,lr)},Ki.resetTransform=function(){Qi.resetTransform(),this.__originalResetTransform()},Ki.rotate=function(Xi){Qi.rotate(Xi),this.__originalRotate(Xi)},Ki.clip=function(Xi){Qi.clip(Xi),this.__originalClip(Xi)},Ki.moveTo=function(Xi,rr){Qi.moveTo(Xi,rr),this.__originalMoveTo(Xi,rr)},Ki.lineTo=function(Xi,rr){Qi.lineTo(Xi,rr),this.__originalLineTo(Xi,rr)},Ki.bezierCurveTo=function(Xi,rr,ar,gr,fr,lr){Qi.bezierCurveTo(Xi,rr,ar,gr,fr,lr),this.__originalBezierCurveTo(Xi,rr,ar,gr,fr,lr)},Ki.rect=function(Xi,rr,ar,gr){Qi.rect(Xi,rr,ar,gr),this.__originalRect(Xi,rr,ar,gr)},Ki.closePath=function(){Qi.closePath(),this.__originalClosePath()},Ki.beginPath=function(){Qi.beginPath(),this.__originalBeginPath()}}(Gi,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),Ti(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(Di){if(!this.current.activeSMask)return;Di?(Di[0]=Math.floor(Di[0]),Di[1]=Math.floor(Di[1]),Di[2]=Math.ceil(Di[2]),Di[3]=Math.ceil(Di[3])):Di=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const Ui=this.current.activeSMask;Mi(this.suspendedCtx,Ui,this.ctx,Di),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()}save(){this.inSMaskMode?(Ti(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const Di=this.current;this.stateStack.push(Di),this.current=Di.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),Ti(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedGetSinglePixelWidth=null)}transform(Di,Ui,Hi,qi,Gi,Ki){this.ctx.transform(Di,Ui,Hi,qi,Gi,Ki),this._cachedGetSinglePixelWidth=null}constructPath(Di,Ui){const Hi=this.ctx,qi=this.current;let Gi,Ki,Qi=qi.x,Xi=qi.y;for(let rr=0,ar=0,gr=Di.length;rr=this.current.lineWidth?(Ui.save(),Ui.resetTransform(),Ui.lineWidth=Math.floor(this._combinedScaleFactor),Ui.stroke(),Ui.restore()):(Ui.lineWidth=Math.max(qi,this.current.lineWidth),Ui.stroke())}Di&&this.consumePath(this.current.getClippedPathBoundingBox()),Ui.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(Di){Di=Di===void 0||Di;const Ui=this.ctx,Hi=this.current.fillColor;let qi=!1;this.current.patternFill&&(Ui.save(),Ui.fillStyle=Hi.getPattern(Ui,this,Ui.mozCurrentTransformInverse,$i.PathType.FILL),qi=!0);const Gi=this.current.getClippedPathBoundingBox();this.contentVisible&&Gi!==null&&(this.pendingEOFill?(Ui.fill("evenodd"),this.pendingEOFill=!1):Ui.fill()),qi&&Ui.restore(),Di&&this.consumePath(Gi)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=Vi}eoClip(){this.pendingClip=Ni}beginText(){this.current.textMatrix=_i.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const Di=this.pendingTextPaths,Ui=this.ctx;if(Di!==void 0){Ui.save(),Ui.beginPath();for(let Hi=0;Hi100&&(rr=100),this.current.fontSizeScale=Ui/rr,this.ctx.font=`${Qi} ${Ki} ${rr}px ${Xi}`}setTextRenderingMode(Di){this.current.textRenderingMode=Di}setTextRise(Di){this.current.textRise=Di}moveText(Di,Ui){this.current.x=this.current.lineX+=Di,this.current.y=this.current.lineY+=Ui}setLeadingMoveText(Di,Ui){this.setLeading(-Ui),this.moveText(Di,Ui)}setTextMatrix(Di,Ui,Hi,qi,Gi,Ki){this.current.textMatrix=[Di,Ui,Hi,qi,Gi,Ki],this.current.textMatrixScale=Math.hypot(Di,Ui),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(Di,Ui,Hi,qi,Gi){const Ki=this.ctx,Qi=this.current,Xi=Qi.font,rr=Qi.textRenderingMode,ar=Qi.fontSize/Qi.fontSizeScale,gr=rr&_i.TextRenderingMode.FILL_STROKE_MASK,fr=!!(rr&_i.TextRenderingMode.ADD_TO_PATH_FLAG),lr=Qi.patternFill&&!Xi.missingFile;let mr;(Xi.disableFontFace||fr||lr)&&(mr=Xi.getPathGenerator(this.commonObjs,Di)),Xi.disableFontFace||lr?(Ki.save(),Ki.translate(Ui,Hi),Ki.beginPath(),mr(Ki,ar),qi&&Ki.setTransform.apply(Ki,qi),gr!==_i.TextRenderingMode.FILL&&gr!==_i.TextRenderingMode.FILL_STROKE||Ki.fill(),(gr===_i.TextRenderingMode.STROKE||gr===_i.TextRenderingMode.FILL_STROKE)&&(Gi&&(Ki.resetTransform(),Ki.lineWidth=Math.floor(this._combinedScaleFactor)),Ki.stroke()),Ki.restore()):(gr!==_i.TextRenderingMode.FILL&&gr!==_i.TextRenderingMode.FILL_STROKE||Ki.fillText(Di,Ui,Hi),(gr===_i.TextRenderingMode.STROKE||gr===_i.TextRenderingMode.FILL_STROKE)&&(Gi?(Ki.save(),Ki.moveTo(Ui,Hi),Ki.resetTransform(),Ki.lineWidth=Math.floor(this._combinedScaleFactor),Ki.strokeText(Di,0,0),Ki.restore()):Ki.strokeText(Di,Ui,Hi))),fr&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:Ki.mozCurrentTransform,x:Ui,y:Hi,fontSize:ar,addToPath:mr})}get isFontSubpixelAAEnabled(){const{context:Di}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);Di.scale(1.5,1),Di.fillText("I",0,10);const Ui=Di.getImageData(0,0,10,10).data;let Hi=!1;for(let qi=3;qi0&&Ui[qi]<255){Hi=!0;break}return(0,_i.shadow)(this,"isFontSubpixelAAEnabled",Hi)}showText(Di){const Ui=this.current,Hi=Ui.font;if(Hi.isType3Font)return this.showType3Text(Di);const qi=Ui.fontSize;if(qi===0)return;const Gi=this.ctx,Ki=Ui.fontSizeScale,Qi=Ui.charSpacing,Xi=Ui.wordSpacing,rr=Ui.fontDirection,ar=Ui.textHScale*rr,gr=Di.length,fr=Hi.vertical,lr=fr?1:-1,mr=Hi.defaultVMetrics,vr=qi*Ui.fontMatrix[0],Yi=Ui.textRenderingMode===_i.TextRenderingMode.FILL&&!Hi.disableFontFace&&!Ui.patternFill;Gi.save(),Gi.transform.apply(Gi,Ui.textMatrix),Gi.translate(Ui.x,Ui.y+Ui.textRise),rr>0?Gi.scale(ar,-1):Gi.scale(ar,1);let nr;if(Ui.patternFill){Gi.save();const sr=Ui.fillColor.getPattern(Gi,this,Gi.mozCurrentTransformInverse,$i.PathType.FILL);nr=Gi.mozCurrentTransform,Gi.restore(),Gi.fillStyle=sr}let ir=Ui.lineWidth,cr=!1;const tr=Ui.textMatrixScale;if(tr===0||ir===0){const sr=Ui.textRenderingMode&_i.TextRenderingMode.FILL_STROKE_MASK;(sr===_i.TextRenderingMode.STROKE||sr===_i.TextRenderingMode.FILL_STROKE)&&(this._cachedGetSinglePixelWidth=null,ir=this.getSinglePixelWidth(),cr=ir<0)}else ir/=tr;Ki!==1&&(Gi.scale(Ki,Ki),ir/=Ki),Gi.lineWidth=ir;let dr,Ji=0;for(dr=0;dr0){const Pr=1e3*Gi.measureText(Zi).width/qi*Ki;if($rnew Wi(Ki,this.commonObjs,this.objs,this.canvasFactory)};Ui=new $i.TilingPattern(Di,Hi,this.ctx,Gi,qi)}else Ui=this._getPattern(Di[1],Di[2]);return Ui}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(Di,Ui,Hi){const qi=_i.Util.makeHexColor(Di,Ui,Hi);this.ctx.strokeStyle=qi,this.current.strokeColor=qi}setFillRGBColor(Di,Ui,Hi){const qi=_i.Util.makeHexColor(Di,Ui,Hi);this.ctx.fillStyle=qi,this.current.fillColor=qi,this.current.patternFill=!1}_getPattern(Di,Ui=null){let Hi;return this.cachedPatterns.has(Di)?Hi=this.cachedPatterns.get(Di):(Hi=(0,$i.getShadingPattern)(this.objs.get(Di)),this.cachedPatterns.set(Di,Hi)),Ui&&(Hi.matrix=Ui),Hi}shadingFill(Di){if(!this.contentVisible)return;const Ui=this.ctx;this.save();const Hi=this._getPattern(Di);Ui.fillStyle=Hi.getPattern(Ui,this,Ui.mozCurrentTransformInverse,$i.PathType.SHADING);const qi=Ui.mozCurrentTransformInverse;if(qi){const Gi=Ui.canvas,Ki=Gi.width,Qi=Gi.height,Xi=_i.Util.applyTransform([0,0],qi),rr=_i.Util.applyTransform([0,Qi],qi),ar=_i.Util.applyTransform([Ki,0],qi),gr=_i.Util.applyTransform([Ki,Qi],qi),fr=Math.min(Xi[0],rr[0],ar[0],gr[0]),lr=Math.min(Xi[1],rr[1],ar[1],gr[1]),mr=Math.max(Xi[0],rr[0],ar[0],gr[0]),vr=Math.max(Xi[1],rr[1],ar[1],gr[1]);this.ctx.fillRect(fr,lr,mr-fr,vr-lr)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,_i.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,_i.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(Di,Ui){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(Di)&&Di.length===6&&this.transform.apply(this,Di),this.baseTransform=this.ctx.mozCurrentTransform,Ui)){const Hi=Ui[2]-Ui[0],qi=Ui[3]-Ui[1];this.ctx.rect(Ui[0],Ui[1],Hi,qi),this.current.updatePathMinMax(this.ctx.mozCurrentTransform,Ui[0],Ui[1]),this.current.updatePathMinMax(this.ctx.mozCurrentTransform,Ui[2],Ui[3]),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(Di){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const Ui=this.ctx;Di.isolated||(0,_i.info)("TODO: Support non-isolated groups."),Di.knockout&&(0,_i.warn)("Knockout groups not supported.");const Hi=Ui.mozCurrentTransform;if(Di.matrix&&Ui.transform.apply(Ui,Di.matrix),!Di.bbox)throw new Error("Bounding box is required.");let qi=_i.Util.getAxialAlignedBoundingBox(Di.bbox,Ui.mozCurrentTransform);const Gi=[0,0,Ui.canvas.width,Ui.canvas.height];qi=_i.Util.intersect(qi,Gi)||[0,0,0,0];const Ki=Math.floor(qi[0]),Qi=Math.floor(qi[1]);let Xi=Math.max(Math.ceil(qi[2])-Ki,1),rr=Math.max(Math.ceil(qi[3])-Qi,1),ar=1,gr=1;Xi>Ai&&(ar=Xi/Ai,Xi=Ai),rr>Ai&&(gr=rr/Ai,rr=Ai),this.current.startNewPathAndClipBox([0,0,Xi,rr]);let fr="groupAt"+this.groupLevel;Di.smask&&(fr+="_smask_"+this.smaskCounter++%2);const lr=this.cachedCanvases.getCanvas(fr,Xi,rr,!0),mr=lr.context;mr.scale(1/ar,1/gr),mr.translate(-Ki,-Qi),mr.transform.apply(mr,Hi),Di.smask?this.smaskStack.push({canvas:lr.canvas,context:mr,offsetX:Ki,offsetY:Qi,scaleX:ar,scaleY:gr,subtype:Di.smask.subtype,backdrop:Di.smask.backdrop,transferMap:Di.smask.transferMap||null,startTransformInverse:null}):(Ui.setTransform(1,0,0,1,0,0),Ui.translate(Ki,Qi),Ui.scale(ar,gr),Ui.save()),Ti(Ui,mr),this.ctx=mr,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(Ui),this.groupLevel++}endGroup(Di){if(!this.contentVisible)return;this.groupLevel--;const Ui=this.ctx,Hi=this.groupStack.pop();if(this.ctx=Hi,this.ctx.imageSmoothingEnabled=!1,Di.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const qi=this.ctx.mozCurrentTransform;this.restore(),this.ctx.save(),this.ctx.setTransform.apply(this.ctx,qi);const Gi=_i.Util.getAxialAlignedBoundingBox([0,0,Ui.canvas.width,Ui.canvas.height],qi);this.ctx.drawImage(Ui.canvas,0,0),this.ctx.restore(),this.compose(Gi)}}beginAnnotations(){this.save(),this.baseTransform&&this.ctx.setTransform.apply(this.ctx,this.baseTransform)}endAnnotations(){this.restore()}beginAnnotation(Di,Ui,Hi,qi,Gi){if(this.save(),Array.isArray(Ui)&&Ui.length===4){const Ki=Ui[2]-Ui[0],Qi=Ui[3]-Ui[1];if(Gi&&this.annotationCanvasMap){(Hi=Hi.slice())[4]-=Ui[0],Hi[5]-=Ui[1],(Ui=Ui.slice())[0]=Ui[1]=0,Ui[2]=Ki,Ui[3]=Qi;const[Xi,rr]=_i.Util.singularValueDecompose2dScale(this.ctx.mozCurrentTransform),{viewportScale:ar}=this,gr=Math.ceil(Ki*this.outputScaleX*ar),fr=Math.ceil(Qi*this.outputScaleY*ar);this.annotationCanvas=this.canvasFactory.create(gr,fr);const{canvas:lr,context:mr}=this.annotationCanvas;lr.style.width=`calc(${Ki}px * var(--viewport-scale-factor))`,lr.style.height=`calc(${Qi}px * var(--viewport-scale-factor))`,this.annotationCanvasMap.set(Di,lr),this.annotationCanvas.savedCtx=this.ctx,this.ctx=mr,this.ctx.setTransform(Xi,0,0,-rr,0,Qi*rr),Ei(this.ctx),Oi(this.ctx)}else Oi(this.ctx),this.ctx.rect(Ui[0],Ui[1],Ki,Qi),this.clip(),this.endPath()}this.current=new Ci(this.ctx.canvas.width,this.ctx.canvas.height),this.transform.apply(this,Hi),this.transform.apply(this,qi)}endAnnotation(){this.annotationCanvas&&(this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas),this.restore()}paintImageMaskXObject(Di){if(!this.contentVisible)return;const Ui=this.ctx,Hi=Di.width,qi=Di.height,Gi=this.processingType3;if(Gi&&Gi.compiled===void 0&&(Gi.compiled=Hi<=1e3&&qi<=1e3?function(Xi){const rr=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),ar=Xi.width,gr=Xi.height,fr=ar+1;let lr,mr,vr,Yi;const nr=new Uint8Array(fr*(gr+1)),ir=ar+7&-8,cr=Xi.data,tr=new Uint8Array(ir*gr);let dr=0;for(lr=0,mr=cr.length;lr0;)tr[dr++]=or&Zi?0:255,Zi>>=1}let Ji=0;for(dr=0,tr[dr]!==0&&(nr[0]=1,++Ji),vr=1;vr>2)+(tr[dr+1]?4:0)+(tr[dr-ir+1]?8:0),rr[or]&&(nr[Yi+vr]=rr[or],++Ji),dr++;if(tr[dr-ir]!==tr[dr]&&(nr[Yi+vr]=tr[dr]?2:4,++Ji),Ji>1e3)return null}for(dr=ir*(gr-1),Yi=lr*fr,tr[dr]!==0&&(nr[Yi]=8,++Ji),vr=1;vr1e3)return null;const sr=new Int32Array([0,fr,-1,0,-fr,0,0,0,1]),pr=[];for(lr=0;Ji&&lr<=gr;lr++){let or=lr*fr;const Zi=or+ar;for(;or>4,nr[or]&=ur>>2|ur<<2),er.push(or%fr,or/fr|0),nr[or]||--Ji}while(hr!==or);pr.push(er),--lr}return function(or){or.save(),or.scale(1/ar,-1/gr),or.translate(0,-gr),or.beginPath();for(let Zi=0,er=pr.length;Zi1?this._cachedGetSinglePixelWidth=-this._combinedScaleFactor*Gi:Ui>Number.EPSILON?this._cachedGetSinglePixelWidth=Gi:this._cachedGetSinglePixelWidth=1}return this._cachedGetSinglePixelWidth}getCanvasPosition(Di,Ui){const Hi=this.ctx.mozCurrentTransform;return[Hi[0]*Di+Hi[2]*Ui+Hi[4],Hi[1]*Di+Hi[3]*Ui+Hi[5]]}isContentVisible(){for(let Di=this.markedContentStack.length-1;Di>=0;Di--)if(!this.markedContentStack[Di].visible)return!1;return!0}}vi.CanvasGraphics=Wi;for(const zi in _i.OPS)Wi.prototype[zi]!==void 0&&(Wi.prototype[_i.OPS[zi]]=Wi.prototype[zi])},(yi,vi,bi)=>{Object.defineProperty(vi,"__esModule",{value:!0}),vi.TilingPattern=vi.PathType=void 0,vi.getShadingPattern=function(ji){switch(ji[0]){case"RadialAxial":return new Si(ji);case"Mesh":return new Ci(ji);case"Dummy":return new ki}throw new Error(`Unknown IR type: ${ji[0]}`)};var _i=bi(1);const $i={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};vi.PathType=$i;function Pi(ji,Li){if(!Li||typeof Path2D>"u")return;const Ii=Li[2]-Li[0],Mi=Li[3]-Li[1],Fi=new Path2D;Fi.rect(Li[0],Li[1],Ii,Mi),ji.clip(Fi)}class Ai{constructor(){this.constructor===Ai&&(0,_i.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,_i.unreachable)("Abstract method `getPattern` called.")}}class Si extends Ai{constructor(Li){super(),this._type=Li[1],this._bbox=Li[2],this._colorStops=Li[3],this._p0=Li[4],this._p1=Li[5],this._r0=Li[6],this._r1=Li[7],this.matrix=null}_createGradient(Li){let Ii;this._type==="axial"?Ii=Li.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(Ii=Li.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const Mi of this._colorStops)Ii.addColorStop(Mi[0],Mi[1]);return Ii}getPattern(Li,Ii,Mi,Fi){let Bi;if(Fi===$i.STROKE||Fi===$i.FILL){const Ri=Ii.current.getClippedPathBoundingBox(Fi,Li.mozCurrentTransform)||[0,0,0,0],Vi=Math.ceil(Ri[2]-Ri[0])||1,Ni=Math.ceil(Ri[3]-Ri[1])||1,Wi=Ii.cachedCanvases.getCanvas("pattern",Vi,Ni,!0),zi=Wi.context;zi.clearRect(0,0,zi.canvas.width,zi.canvas.height),zi.beginPath(),zi.rect(0,0,zi.canvas.width,zi.canvas.height),zi.translate(-Ri[0],-Ri[1]),Mi=_i.Util.transform(Mi,[1,0,0,1,Ri[0],Ri[1]]),zi.transform.apply(zi,Ii.baseTransform),this.matrix&&zi.transform.apply(zi,this.matrix),Pi(zi,this._bbox),zi.fillStyle=this._createGradient(zi),zi.fill(),Bi=Li.createPattern(Wi.canvas,"no-repeat");const Di=new DOMMatrix(Mi);try{Bi.setTransform(Di)}catch(Ui){(0,_i.warn)(`RadialAxialShadingPattern.getPattern: "${Ui==null?void 0:Ui.message}".`)}}else Pi(Li,this._bbox),Bi=this._createGradient(Li);return Bi}}function Ei(ji,Li,Ii,Mi,Fi,Bi,Ri,Vi){const Ni=Li.coords,Wi=Li.colors,zi=ji.data,Di=4*ji.width;let Ui;Ni[Ii+1]>Ni[Mi+1]&&(Ui=Ii,Ii=Mi,Mi=Ui,Ui=Bi,Bi=Ri,Ri=Ui),Ni[Mi+1]>Ni[Fi+1]&&(Ui=Mi,Mi=Fi,Fi=Ui,Ui=Ri,Ri=Vi,Vi=Ui),Ni[Ii+1]>Ni[Mi+1]&&(Ui=Ii,Ii=Mi,Mi=Ui,Ui=Bi,Bi=Ri,Ri=Ui);const Hi=(Ni[Ii]+Li.offsetX)*Li.scaleX,qi=(Ni[Ii+1]+Li.offsetY)*Li.scaleY,Gi=(Ni[Mi]+Li.offsetX)*Li.scaleX,Ki=(Ni[Mi+1]+Li.offsetY)*Li.scaleY,Qi=(Ni[Fi]+Li.offsetX)*Li.scaleX,Xi=(Ni[Fi+1]+Li.offsetY)*Li.scaleY;if(qi>=Xi)return;const rr=Wi[Bi],ar=Wi[Bi+1],gr=Wi[Bi+2],fr=Wi[Ri],lr=Wi[Ri+1],mr=Wi[Ri+2],vr=Wi[Vi],Yi=Wi[Vi+1],nr=Wi[Vi+2],ir=Math.round(qi),cr=Math.round(Xi);let tr,dr,Ji,sr,pr,or,Zi,er;for(let hr=ir;hr<=cr;hr++){if(hrXi?1:Ki===Xi?0:(Ki-hr)/(Ki-Xi),tr=Gi-(Gi-Qi)*Sr,dr=fr-(fr-vr)*Sr,Ji=lr-(lr-Yi)*Sr,sr=mr-(mr-nr)*Sr}let ur;ur=hrXi?1:(qi-hr)/(qi-Xi),pr=Hi-(Hi-Qi)*ur,or=rr-(rr-vr)*ur,Zi=ar-(ar-Yi)*ur,er=gr-(gr-nr)*ur;const _r=Math.round(Math.min(tr,pr)),$r=Math.round(Math.max(tr,pr));let Pr=Di*hr+4*_r;for(let Sr=_r;Sr<=$r;Sr++)ur=(tr-Sr)/(tr-pr),ur<0?ur=0:ur>1&&(ur=1),zi[Pr++]=dr-(dr-or)*ur|0,zi[Pr++]=Ji-(Ji-Zi)*ur|0,zi[Pr++]=sr-(sr-er)*ur|0,zi[Pr++]=255}}function wi(ji,Li,Ii){const Mi=Li.coords,Fi=Li.colors;let Bi,Ri;switch(Li.type){case"lattice":const Vi=Li.verticesPerRow,Ni=Math.floor(Mi.length/Vi)-1,Wi=Vi-1;for(Bi=0;Bi=Fi?Bi=Fi:Mi=Bi/Li,{scale:Mi,size:Bi}}clipBbox(Li,Ii,Mi,Fi,Bi){const Ri=Fi-Ii,Vi=Bi-Mi;Li.ctx.rect(Ii,Mi,Ri,Vi),Li.clip(),Li.endPath()}setFillAndStrokeStyleToContext(Li,Ii,Mi){const Fi=Li.ctx,Bi=Li.current;switch(Ii){case xi:const Ri=this.ctx;Fi.fillStyle=Ri.fillStyle,Fi.strokeStyle=Ri.strokeStyle,Bi.fillColor=Ri.fillStyle,Bi.strokeColor=Ri.strokeStyle;break;case Ti:const Vi=_i.Util.makeHexColor(Mi[0],Mi[1],Mi[2]);Fi.fillStyle=Vi,Fi.strokeStyle=Vi,Bi.fillColor=Vi,Bi.strokeColor=Vi;break;default:throw new _i.FormatError(`Unsupported paint type: ${Ii}`)}}getPattern(Li,Ii,Mi,Fi){let Bi=Mi;Fi!==$i.SHADING&&(Bi=_i.Util.transform(Bi,Ii.baseTransform),this.matrix&&(Bi=_i.Util.transform(Bi,this.matrix)));const Ri=this.createPatternCanvas(Ii);let Vi=new DOMMatrix(Bi);Vi=Vi.translate(Ri.offsetX,Ri.offsetY),Vi=Vi.scale(1/Ri.scaleX,1/Ri.scaleY);const Ni=Li.createPattern(Ri.canvas,"repeat");try{Ni.setTransform(Vi)}catch(Wi){(0,_i.warn)(`TilingPattern.getPattern: "${Wi==null?void 0:Wi.message}".`)}return Ni}}vi.TilingPattern=Oi},(yi,vi)=>{Object.defineProperty(vi,"__esModule",{value:!0}),vi.GlobalWorkerOptions=void 0;const bi=Object.create(null);vi.GlobalWorkerOptions=bi,bi.workerPort=bi.workerPort===void 0?null:bi.workerPort,bi.workerSrc=bi.workerSrc===void 0?"":bi.workerSrc},(yi,vi,bi)=>{Object.defineProperty(vi,"__esModule",{value:!0}),vi.MessageHandler=void 0;var _i=bi(1);const $i=1,Pi=2,Ai=1,Si=2,Ei=3,wi=4,Ci=5,ki=6,xi=7,Ti=8;function Oi(ji){switch(ji instanceof Error||typeof ji=="object"&&ji!==null||(0,_i.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),ji.name){case"AbortException":return new _i.AbortException(ji.message);case"MissingPDFException":return new _i.MissingPDFException(ji.message);case"PasswordException":return new _i.PasswordException(ji.message,ji.code);case"UnexpectedResponseException":return new _i.UnexpectedResponseException(ji.message,ji.status);case"UnknownErrorException":return new _i.UnknownErrorException(ji.message,ji.details);default:return new _i.UnknownErrorException(ji.message,ji.toString())}}vi.MessageHandler=class{constructor(ji,Li,Ii){this.sourceName=ji,this.targetName=Li,this.comObj=Ii,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=Mi=>{const Fi=Mi.data;if(Fi.targetName!==this.sourceName)return;if(Fi.stream){this._processStreamMessage(Fi);return}if(Fi.callback){const Ri=Fi.callbackId,Vi=this.callbackCapabilities[Ri];if(!Vi)throw new Error(`Cannot resolve callback ${Ri}`);if(delete this.callbackCapabilities[Ri],Fi.callback===$i)Vi.resolve(Fi.data);else{if(Fi.callback!==Pi)throw new Error("Unexpected callback case");Vi.reject(Oi(Fi.reason))}return}const Bi=this.actionHandler[Fi.action];if(!Bi)throw new Error(`Unknown action from worker: ${Fi.action}`);if(Fi.callbackId){const Ri=this.sourceName,Vi=Fi.sourceName;new Promise(function(Ni){Ni(Bi(Fi.data))}).then(function(Ni){Ii.postMessage({sourceName:Ri,targetName:Vi,callback:$i,callbackId:Fi.callbackId,data:Ni})},function(Ni){Ii.postMessage({sourceName:Ri,targetName:Vi,callback:Pi,callbackId:Fi.callbackId,reason:Oi(Ni)})})}else Fi.streamId?this._createStreamSink(Fi):Bi(Fi.data)},Ii.addEventListener("message",this._onComObjOnMessage)}on(ji,Li){const Ii=this.actionHandler;if(Ii[ji])throw new Error(`There is already an actionName called "${ji}"`);Ii[ji]=Li}send(ji,Li,Ii){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:ji,data:Li},Ii)}sendWithPromise(ji,Li,Ii){const Mi=this.callbackId++,Fi=(0,_i.createPromiseCapability)();this.callbackCapabilities[Mi]=Fi;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:ji,callbackId:Mi,data:Li},Ii)}catch(Bi){Fi.reject(Bi)}return Fi.promise}sendWithStream(ji,Li,Ii,Mi){const Fi=this.streamId++,Bi=this.sourceName,Ri=this.targetName,Vi=this.comObj;return new ReadableStream({start:Ni=>{const Wi=(0,_i.createPromiseCapability)();return this.streamControllers[Fi]={controller:Ni,startCall:Wi,pullCall:null,cancelCall:null,isClosed:!1},Vi.postMessage({sourceName:Bi,targetName:Ri,action:ji,streamId:Fi,data:Li,desiredSize:Ni.desiredSize},Mi),Wi.promise},pull:Ni=>{const Wi=(0,_i.createPromiseCapability)();return this.streamControllers[Fi].pullCall=Wi,Vi.postMessage({sourceName:Bi,targetName:Ri,stream:ki,streamId:Fi,desiredSize:Ni.desiredSize}),Wi.promise},cancel:Ni=>{(0,_i.assert)(Ni instanceof Error,"cancel must have a valid reason");const Wi=(0,_i.createPromiseCapability)();return this.streamControllers[Fi].cancelCall=Wi,this.streamControllers[Fi].isClosed=!0,Vi.postMessage({sourceName:Bi,targetName:Ri,stream:Ai,streamId:Fi,reason:Oi(Ni)}),Wi.promise}},Ii)}_createStreamSink(ji){const Li=ji.streamId,Ii=this.sourceName,Mi=ji.sourceName,Fi=this.comObj,Bi=this,Ri=this.actionHandler[ji.action],Vi={enqueue(Ni,Wi=1,zi){if(this.isCancelled)return;const Di=this.desiredSize;this.desiredSize-=Wi,Di>0&&this.desiredSize<=0&&(this.sinkCapability=(0,_i.createPromiseCapability)(),this.ready=this.sinkCapability.promise),Fi.postMessage({sourceName:Ii,targetName:Mi,stream:wi,streamId:Li,chunk:Ni},zi)},close(){this.isCancelled||(this.isCancelled=!0,Fi.postMessage({sourceName:Ii,targetName:Mi,stream:Ei,streamId:Li}),delete Bi.streamSinks[Li])},error(Ni){(0,_i.assert)(Ni instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,Fi.postMessage({sourceName:Ii,targetName:Mi,stream:Ci,streamId:Li,reason:Oi(Ni)}))},sinkCapability:(0,_i.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:ji.desiredSize,ready:null};Vi.sinkCapability.resolve(),Vi.ready=Vi.sinkCapability.promise,this.streamSinks[Li]=Vi,new Promise(function(Ni){Ni(Ri(ji.data,Vi))}).then(function(){Fi.postMessage({sourceName:Ii,targetName:Mi,stream:Ti,streamId:Li,success:!0})},function(Ni){Fi.postMessage({sourceName:Ii,targetName:Mi,stream:Ti,streamId:Li,reason:Oi(Ni)})})}_processStreamMessage(ji){const Li=ji.streamId,Ii=this.sourceName,Mi=ji.sourceName,Fi=this.comObj,Bi=this.streamControllers[Li],Ri=this.streamSinks[Li];switch(ji.stream){case Ti:ji.success?Bi.startCall.resolve():Bi.startCall.reject(Oi(ji.reason));break;case xi:ji.success?Bi.pullCall.resolve():Bi.pullCall.reject(Oi(ji.reason));break;case ki:if(!Ri){Fi.postMessage({sourceName:Ii,targetName:Mi,stream:xi,streamId:Li,success:!0});break}Ri.desiredSize<=0&&ji.desiredSize>0&&Ri.sinkCapability.resolve(),Ri.desiredSize=ji.desiredSize,new Promise(function(Vi){Vi(Ri.onPull&&Ri.onPull())}).then(function(){Fi.postMessage({sourceName:Ii,targetName:Mi,stream:xi,streamId:Li,success:!0})},function(Vi){Fi.postMessage({sourceName:Ii,targetName:Mi,stream:xi,streamId:Li,reason:Oi(Vi)})});break;case wi:if((0,_i.assert)(Bi,"enqueue should have stream controller"),Bi.isClosed)break;Bi.controller.enqueue(ji.chunk);break;case Ei:if((0,_i.assert)(Bi,"close should have stream controller"),Bi.isClosed)break;Bi.isClosed=!0,Bi.controller.close(),this._deleteStreamController(Bi,Li);break;case Ci:(0,_i.assert)(Bi,"error should have stream controller"),Bi.controller.error(Oi(ji.reason)),this._deleteStreamController(Bi,Li);break;case Si:ji.success?Bi.cancelCall.resolve():Bi.cancelCall.reject(Oi(ji.reason)),this._deleteStreamController(Bi,Li);break;case Ai:if(!Ri)break;new Promise(function(Vi){Vi(Ri.onCancel&&Ri.onCancel(Oi(ji.reason)))}).then(function(){Fi.postMessage({sourceName:Ii,targetName:Mi,stream:Si,streamId:Li,success:!0})},function(Vi){Fi.postMessage({sourceName:Ii,targetName:Mi,stream:Si,streamId:Li,reason:Oi(Vi)})}),Ri.sinkCapability.reject(Oi(ji.reason)),Ri.isCancelled=!0,delete this.streamSinks[Li];break;default:throw new Error("Unexpected stream case")}}async _deleteStreamController(ji,Li){await Promise.allSettled([ji.startCall&&ji.startCall.promise,ji.pullCall&&ji.pullCall.promise,ji.cancelCall&&ji.cancelCall.promise]),delete this.streamControllers[Li]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},(yi,vi,bi)=>{var $i,Pi,Ai;Object.defineProperty(vi,"__esModule",{value:!0}),vi.Metadata=void 0;var _i=bi(1);vi.Metadata=(Ai=class{constructor({parsedData:Si,rawData:Ei}){Er(this,$i,void 0);Er(this,Pi,void 0);Nr(this,$i,Si),Nr(this,Pi,Ei)}getRaw(){return Cr(this,Pi)}get(Si){var Ei;return(Ei=Cr(this,$i).get(Si))!=null?Ei:null}getAll(){return(0,_i.objectFromMap)(Cr(this,$i))}has(Si){return Cr(this,$i).has(Si)}},$i=new WeakMap,Pi=new WeakMap,Ai)},(yi,vi,bi)=>{Object.defineProperty(vi,"__esModule",{value:!0}),vi.OptionalContentConfig=void 0;var _i=bi(1);class $i{constructor(Ai,Si){this.visible=!0,this.name=Ai,this.intent=Si}}vi.OptionalContentConfig=class{constructor(Pi){if(this.name=null,this.creator=null,this._order=null,this._groups=new Map,Pi!==null){this.name=Pi.name,this.creator=Pi.creator,this._order=Pi.order;for(const Ai of Pi.groups)this._groups.set(Ai.id,new $i(Ai.name,Ai.intent));if(Pi.baseState==="OFF")for(const Ai of this._groups)Ai.visible=!1;for(const Ai of Pi.on)this._groups.get(Ai).visible=!0;for(const Ai of Pi.off)this._groups.get(Ai).visible=!1}}_evaluateVisibilityExpression(Pi){const Ai=Pi.length;if(Ai<2)return!0;const Si=Pi[0];for(let Ei=1;Ei0?(0,_i.objectFromMap)(this._groups):null}getGroup(Pi){return this._groups.get(Pi)||null}}},(yi,vi,bi)=>{Object.defineProperty(vi,"__esModule",{value:!0}),vi.PDFDataTransportStream=void 0;var _i=bi(1),$i=bi(5);vi.PDFDataTransportStream=class{constructor(Si,Ei){(0,_i.assert)(Ei,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=Si.progressiveDone||!1,this._contentDispositionFilename=Si.contentDispositionFilename||null;const wi=Si.initialData;if((wi==null?void 0:wi.length)>0){const Ci=new Uint8Array(wi).buffer;this._queuedChunks.push(Ci)}this._pdfDataRangeTransport=Ei,this._isStreamingSupported=!Si.disableStream,this._isRangeSupported=!Si.disableRange,this._contentLength=Si.length,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((Ci,ki)=>{this._onReceiveData({begin:Ci,chunk:ki})}),this._pdfDataRangeTransport.addProgressListener((Ci,ki)=>{this._onProgress({loaded:Ci,total:ki})}),this._pdfDataRangeTransport.addProgressiveReadListener(Ci=>{this._onReceiveData({chunk:Ci})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData(Si){const Ei=new Uint8Array(Si.chunk).buffer;if(Si.begin===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(Ei):this._queuedChunks.push(Ei);else{const wi=this._rangeReaders.some(function(Ci){return Ci._begin!==Si.begin?!1:(Ci._enqueue(Ei),!0)});(0,_i.assert)(wi,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var Si,Ei;return(Ei=(Si=this._fullRequestReader)==null?void 0:Si._loaded)!=null?Ei:0}_onProgress(Si){if(Si.total===void 0){const Ei=this._rangeReaders[0];Ei!=null&&Ei.onProgress&&Ei.onProgress({loaded:Si.loaded})}else{const Ei=this._fullRequestReader;Ei!=null&&Ei.onProgress&&Ei.onProgress({loaded:Si.loaded,total:Si.total})}}_onProgressiveDone(){this._fullRequestReader&&this._fullRequestReader.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(Si){const Ei=this._rangeReaders.indexOf(Si);Ei>=0&&this._rangeReaders.splice(Ei,1)}getFullReader(){(0,_i.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const Si=this._queuedChunks;return this._queuedChunks=null,new Pi(this,Si,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(Si,Ei){if(Ei<=this._progressiveDataLength)return null;const wi=new Ai(this,Si,Ei);return this._pdfDataRangeTransport.requestDataRange(Si,Ei),this._rangeReaders.push(wi),wi}cancelAllRequests(Si){this._fullRequestReader&&this._fullRequestReader.cancel(Si);for(const Ei of this._rangeReaders.slice(0))Ei.cancel(Si);this._pdfDataRangeTransport.abort()}};class Pi{constructor(Ei,wi,Ci=!1,ki=null){this._stream=Ei,this._done=Ci||!1,this._filename=(0,$i.isPdfFile)(ki)?ki:null,this._queuedChunks=wi||[],this._loaded=0;for(const xi of this._queuedChunks)this._loaded+=xi.byteLength;this._requests=[],this._headersReady=Promise.resolve(),Ei._fullRequestReader=this,this.onProgress=null}_enqueue(Ei){this._done||(this._requests.length>0?this._requests.shift().resolve({value:Ei,done:!1}):this._queuedChunks.push(Ei),this._loaded+=Ei.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const Ei=(0,_i.createPromiseCapability)();return this._requests.push(Ei),Ei.promise}cancel(Ei){this._done=!0;for(const wi of this._requests)wi.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class Ai{constructor(Ei,wi,Ci){this._stream=Ei,this._begin=wi,this._end=Ci,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(Ei){if(!this._done){if(this._requests.length===0)this._queuedChunk=Ei;else{this._requests.shift().resolve({value:Ei,done:!1});for(const wi of this._requests)wi.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const wi=this._queuedChunk;return this._queuedChunk=null,{value:wi,done:!1}}if(this._done)return{value:void 0,done:!0};const Ei=(0,_i.createPromiseCapability)();return this._requests.push(Ei),Ei.promise}cancel(Ei){this._done=!0;for(const wi of this._requests)wi.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(yi,vi)=>{Object.defineProperty(vi,"__esModule",{value:!0}),vi.XfaText=void 0;class bi{static textContent($i){const Pi=[],Ai={items:Pi,styles:Object.create(null)};return function Si(Ei){var ki;if(!Ei)return;let wi=null;const Ci=Ei.name;if(Ci==="#text")wi=Ei.value;else{if(!bi.shouldBuildText(Ci))return;(ki=Ei==null?void 0:Ei.attributes)!=null&&ki.textContent?wi=Ei.attributes.textContent:Ei.value&&(wi=Ei.value)}if(wi!==null&&Pi.push({str:wi}),Ei.children)for(const xi of Ei.children)Si(xi)}($i),Ai}static shouldBuildText($i){return!($i==="textarea"||$i==="input"||$i==="option"||$i==="select")}}vi.XfaText=bi},(yi,vi,bi)=>{var fr,lr,$s;Object.defineProperty(vi,"__esModule",{value:!0}),vi.AnnotationLayer=void 0;var _i=bi(1),$i=bi(5),Pi=bi(9),Ai=bi(19),Si=bi(20);const Ei=1e3,wi=new WeakSet;function Ci(vr){return{width:vr[2]-vr[0],height:vr[3]-vr[1]}}class ki{static create(Yi){switch(Yi.data.annotationType){case _i.AnnotationType.LINK:return new Ti(Yi);case _i.AnnotationType.TEXT:return new Oi(Yi);case _i.AnnotationType.WIDGET:switch(Yi.data.fieldType){case"Tx":return new Li(Yi);case"Btn":return Yi.data.radioButton?new Mi(Yi):Yi.data.checkBox?new Ii(Yi):new Fi(Yi);case"Ch":return new Bi(Yi)}return new ji(Yi);case _i.AnnotationType.POPUP:return new Ri(Yi);case _i.AnnotationType.FREETEXT:return new Ni(Yi);case _i.AnnotationType.LINE:return new Wi(Yi);case _i.AnnotationType.SQUARE:return new zi(Yi);case _i.AnnotationType.CIRCLE:return new Di(Yi);case _i.AnnotationType.POLYLINE:return new Ui(Yi);case _i.AnnotationType.CARET:return new qi(Yi);case _i.AnnotationType.INK:return new Gi(Yi);case _i.AnnotationType.POLYGON:return new Hi(Yi);case _i.AnnotationType.HIGHLIGHT:return new Ki(Yi);case _i.AnnotationType.UNDERLINE:return new Qi(Yi);case _i.AnnotationType.SQUIGGLY:return new Xi(Yi);case _i.AnnotationType.STRIKEOUT:return new rr(Yi);case _i.AnnotationType.STAMP:return new ar(Yi);case _i.AnnotationType.FILEATTACHMENT:return new gr(Yi);default:return new xi(Yi)}}}class xi{constructor(Yi,{isRenderable:nr=!1,ignoreBorder:ir=!1,createQuadrilaterals:cr=!1}={}){this.isRenderable=nr,this.data=Yi.data,this.layer=Yi.layer,this.page=Yi.page,this.viewport=Yi.viewport,this.linkService=Yi.linkService,this.downloadManager=Yi.downloadManager,this.imageResourcesPath=Yi.imageResourcesPath,this.renderForms=Yi.renderForms,this.svgFactory=Yi.svgFactory,this.annotationStorage=Yi.annotationStorage,this.enableScripting=Yi.enableScripting,this.hasJSActions=Yi.hasJSActions,this._fieldObjects=Yi.fieldObjects,this._mouseState=Yi.mouseState,nr&&(this.container=this._createContainer(ir)),cr&&(this.quadrilaterals=this._createQuadrilaterals(ir))}_createContainer(Yi=!1){const nr=this.data,ir=this.page,cr=this.viewport,tr=document.createElement("section");let{width:dr,height:Ji}=Ci(nr.rect);tr.setAttribute("data-annotation-id",nr.id);const sr=_i.Util.normalizeRect([nr.rect[0],ir.view[3]-nr.rect[1]+ir.view[1],nr.rect[2],ir.view[3]-nr.rect[3]+ir.view[1]]);if(nr.hasOwnCanvas){const pr=cr.transform.slice(),[or,Zi]=_i.Util.singularValueDecompose2dScale(pr);dr=Math.ceil(dr*or),Ji=Math.ceil(Ji*Zi),sr[0]*=or,sr[1]*=Zi;for(let er=0;er<4;er++)pr[er]=Math.sign(pr[er]);tr.style.transform=`matrix(${pr.join(",")})`}else tr.style.transform=`matrix(${cr.transform.join(",")})`;if(tr.style.transformOrigin=`${-sr[0]}px ${-sr[1]}px`,!Yi&&nr.borderStyle.width>0){tr.style.borderWidth=`${nr.borderStyle.width}px`,nr.borderStyle.style!==_i.AnnotationBorderStyleType.UNDERLINE&&(dr-=2*nr.borderStyle.width,Ji-=2*nr.borderStyle.width);const pr=nr.borderStyle.horizontalCornerRadius,or=nr.borderStyle.verticalCornerRadius;if(pr>0||or>0){const Zi=`${pr}px / ${or}px`;tr.style.borderRadius=Zi}switch(nr.borderStyle.style){case _i.AnnotationBorderStyleType.SOLID:tr.style.borderStyle="solid";break;case _i.AnnotationBorderStyleType.DASHED:tr.style.borderStyle="dashed";break;case _i.AnnotationBorderStyleType.BEVELED:(0,_i.warn)("Unimplemented border style: beveled");break;case _i.AnnotationBorderStyleType.INSET:(0,_i.warn)("Unimplemented border style: inset");break;case _i.AnnotationBorderStyleType.UNDERLINE:tr.style.borderBottomStyle="solid"}nr.borderColor||nr.color?tr.style.borderColor=_i.Util.makeHexColor(0|nr.color[0],0|nr.color[1],0|nr.color[2]):tr.style.borderWidth=0}return tr.style.left=`${sr[0]}px`,tr.style.top=`${sr[1]}px`,nr.hasOwnCanvas?tr.style.width=tr.style.height="auto":(tr.style.width=`${dr}px`,tr.style.height=`${Ji}px`),tr}_createQuadrilaterals(Yi=!1){if(!this.data.quadPoints)return null;const nr=[],ir=this.data.rect;for(const cr of this.data.quadPoints)this.data.rect=[cr[2].x,cr[2].y,cr[1].x,cr[1].y],nr.push(this._createContainer(Yi));return this.data.rect=ir,nr}_createPopup(Yi,nr){let ir=this.container;this.quadrilaterals&&(Yi=Yi||this.quadrilaterals,ir=this.quadrilaterals[0]),Yi||((Yi=document.createElement("div")).style.height=ir.style.height,Yi.style.width=ir.style.width,ir.appendChild(Yi));const cr=new Vi({container:ir,trigger:Yi,color:nr.color,titleObj:nr.titleObj,modificationDate:nr.modificationDate,contentsObj:nr.contentsObj,richText:nr.richText,hideWrapper:!0}).render();cr.style.left=ir.style.width,ir.appendChild(cr)}_renderQuadrilaterals(Yi){for(const nr of this.quadrilaterals)nr.className=Yi;return this.quadrilaterals}render(){(0,_i.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(Yi,nr=null){const ir=[];if(this._fieldObjects){const cr=this._fieldObjects[Yi];if(cr)for(const{page:tr,id:dr,exportValues:Ji}of cr){if(tr===-1||dr===nr)continue;const sr=typeof Ji=="string"?Ji:null,pr=document.getElementById(dr);!pr||wi.has(pr)?ir.push({id:dr,exportValue:sr,domElement:pr}):(0,_i.warn)(`_getElementsByName - element not allowed: ${dr}`)}return ir}for(const cr of document.getElementsByName(Yi)){const{id:tr,exportValue:dr}=cr;tr!==nr&&wi.has(cr)&&ir.push({id:tr,exportValue:dr,domElement:cr})}return ir}static get platform(){const Yi=typeof navigator<"u"?navigator.platform:"";return(0,_i.shadow)(this,"platform",{isWin:Yi.includes("Win"),isMac:Yi.includes("Mac")})}}class Ti extends xi{constructor(Yi,nr=null){super(Yi,{isRenderable:!!(Yi.data.url||Yi.data.dest||Yi.data.action||Yi.data.isTooltipOnly||Yi.data.resetForm||Yi.data.actions&&(Yi.data.actions.Action||Yi.data.actions["Mouse Up"]||Yi.data.actions["Mouse Down"])),ignoreBorder:!!(nr!=null&&nr.ignoreBorder),createQuadrilaterals:!0})}render(){var cr;const{data:Yi,linkService:nr}=this,ir=document.createElement("a");if(Yi.url)nr.addLinkAttributes||(0,_i.warn)("LinkAnnotationElement.render - missing `addLinkAttributes`-method on the `linkService`-instance."),(cr=nr.addLinkAttributes)==null||cr.call(nr,ir,Yi.url,Yi.newWindow);else if(Yi.action)this._bindNamedAction(ir,Yi.action);else if(Yi.dest)this._bindLink(ir,Yi.dest);else{let tr=!1;Yi.actions&&(Yi.actions.Action||Yi.actions["Mouse Up"]||Yi.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(tr=!0,this._bindJSAction(ir,Yi)),Yi.resetForm?this._bindResetFormAction(ir,Yi.resetForm):tr||this._bindLink(ir,"")}return this.quadrilaterals?this._renderQuadrilaterals("linkAnnotation").map((tr,dr)=>{const Ji=dr===0?ir:ir.cloneNode();return tr.appendChild(Ji),tr}):(this.container.className="linkAnnotation",this.container.appendChild(ir),this.container)}_bindLink(Yi,nr){Yi.href=this.linkService.getDestinationHash(nr),Yi.onclick=()=>(nr&&this.linkService.goToDestination(nr),!1),(nr||nr==="")&&(Yi.className="internalLink")}_bindNamedAction(Yi,nr){Yi.href=this.linkService.getAnchorUrl(""),Yi.onclick=()=>(this.linkService.executeNamedAction(nr),!1),Yi.className="internalLink"}_bindJSAction(Yi,nr){Yi.href=this.linkService.getAnchorUrl("");const ir=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const cr of Object.keys(nr.actions)){const tr=ir.get(cr);tr&&(Yi[tr]=()=>{var dr;return(dr=this.linkService.eventBus)==null||dr.dispatch("dispatcheventinsandbox",{source:this,detail:{id:nr.id,name:cr}}),!1})}Yi.onclick||(Yi.onclick=()=>!1),Yi.className="internalLink"}_bindResetFormAction(Yi,nr){const ir=Yi.onclick;ir||(Yi.href=this.linkService.getAnchorUrl("")),Yi.className="internalLink",this._fieldObjects?Yi.onclick=()=>{var or;ir&&ir();const{fields:cr,refs:tr,include:dr}=nr,Ji=[];if(cr.length!==0||tr.length!==0){const Zi=new Set(tr);for(const er of cr){const hr=this._fieldObjects[er]||[];for(const{id:ur}of hr)Zi.add(ur)}for(const er of Object.values(this._fieldObjects))for(const hr of er)Zi.has(hr.id)===dr&&Ji.push(hr)}else for(const Zi of Object.values(this._fieldObjects))Ji.push(...Zi);const sr=this.annotationStorage,pr=[];for(const Zi of Ji){const{id:er}=Zi;switch(pr.push(er),Zi.type){case"text":{const ur=Zi.defaultValue||"";sr.setValue(er,{value:ur,valueAsString:ur});break}case"checkbox":case"radiobutton":{const ur=Zi.defaultValue===Zi.exportValues;sr.setValue(er,{value:ur});break}case"combobox":case"listbox":{const ur=Zi.defaultValue||"";sr.setValue(er,{value:ur});break}default:continue}const hr=document.getElementById(er);hr&&wi.has(hr)&&hr.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((or=this.linkService.eventBus)==null||or.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:pr,name:"ResetForm"}})),!1}:((0,_i.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),ir||(Yi.onclick=()=>!1))}}class Oi extends xi{constructor(Yi){var nr,ir,cr;super(Yi,{isRenderable:!!(Yi.data.hasPopup||(nr=Yi.data.titleObj)!=null&&nr.str||(ir=Yi.data.contentsObj)!=null&&ir.str||(cr=Yi.data.richText)!=null&&cr.str)})}render(){this.container.className="textAnnotation";const Yi=document.createElement("img");return Yi.style.height=this.container.style.height,Yi.style.width=this.container.style.width,Yi.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",Yi.alt="[{{type}} Annotation]",Yi.dataset.l10nId="text_annotation_type",Yi.dataset.l10nArgs=JSON.stringify({type:this.data.name}),this.data.hasPopup||this._createPopup(Yi,this.data),this.container.appendChild(Yi),this.container}}class ji extends xi{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}_getKeyModifier(Yi){const{isWin:nr,isMac:ir}=xi.platform;return nr&&Yi.ctrlKey||ir&&Yi.metaKey}_setEventListener(Yi,nr,ir,cr){nr.includes("mouse")?Yi.addEventListener(nr,tr=>{var dr;(dr=this.linkService.eventBus)==null||dr.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:ir,value:cr(tr),shift:tr.shiftKey,modifier:this._getKeyModifier(tr)}})}):Yi.addEventListener(nr,tr=>{var dr;(dr=this.linkService.eventBus)==null||dr.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:ir,value:cr(tr)}})})}_setEventListeners(Yi,nr,ir){var cr;for(const[tr,dr]of nr)(dr==="Action"||(cr=this.data.actions)!=null&&cr[dr])&&this._setEventListener(Yi,tr,dr,ir)}_setBackgroundColor(Yi){const nr=this.data.backgroundColor||null;Yi.style.backgroundColor=nr===null?"transparent":_i.Util.makeHexColor(nr[0],nr[1],nr[2])}_dispatchEventFromSandbox(Yi,nr){const ir=(tr,dr,Ji)=>{const sr=Ji.detail[tr];Ji.target.style[dr]=Ai.ColorConverters[`${sr[0]}_HTML`](sr.slice(1))},cr={display:tr=>{const dr=tr.detail.display%2==1;tr.target.style.visibility=dr?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:dr,print:tr.detail.display===0||tr.detail.display===3})},print:tr=>{this.annotationStorage.setValue(this.data.id,{print:tr.detail.print})},hidden:tr=>{tr.target.style.visibility=tr.detail.hidden?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:tr.detail.hidden})},focus:tr=>{setTimeout(()=>tr.target.focus({preventScroll:!1}),0)},userName:tr=>{tr.target.title=tr.detail.userName},readonly:tr=>{tr.detail.readonly?tr.target.setAttribute("readonly",""):tr.target.removeAttribute("readonly")},required:tr=>{tr.detail.required?tr.target.setAttribute("required",""):tr.target.removeAttribute("required")},bgColor:tr=>{ir("bgColor","backgroundColor",tr)},fillColor:tr=>{ir("fillColor","backgroundColor",tr)},fgColor:tr=>{ir("fgColor","color",tr)},textColor:tr=>{ir("textColor","color",tr)},borderColor:tr=>{ir("borderColor","borderColor",tr)},strokeColor:tr=>{ir("strokeColor","borderColor",tr)}};for(const tr of Object.keys(nr.detail)){const dr=Yi[tr]||cr[tr];dr&&dr(nr)}}}class Li extends ji{constructor(Yi){super(Yi,{isRenderable:Yi.renderForms||!Yi.data.hasAppearance&&!!Yi.data.fieldValue})}setPropertyOnSiblings(Yi,nr,ir,cr){const tr=this.annotationStorage;for(const dr of this._getElementsByName(Yi.name,Yi.id))dr.domElement&&(dr.domElement[nr]=ir),tr.setValue(dr.id,{[cr]:ir})}render(){var cr;const Yi=this.annotationStorage,nr=this.data.id;this.container.className="textWidgetAnnotation";let ir=null;if(this.renderForms){const tr=Yi.getValue(nr,{value:this.data.fieldValue,valueAsString:this.data.fieldValue}),dr=tr.valueAsString||tr.value||"",Ji={userValue:null,formattedValue:null};this.data.multiLine?(ir=document.createElement("textarea"),ir.textContent=dr):(ir=document.createElement("input"),ir.type="text",ir.setAttribute("value",dr)),wi.add(ir),ir.disabled=this.data.readOnly,ir.name=this.data.fieldName,ir.tabIndex=Ei,Ji.userValue=dr,ir.setAttribute("id",nr),ir.addEventListener("input",pr=>{Yi.setValue(nr,{value:pr.target.value}),this.setPropertyOnSiblings(ir,"value",pr.target.value,"value")}),ir.addEventListener("resetform",pr=>{const or=this.data.defaultFieldValue||"";ir.value=Ji.userValue=or,delete Ji.formattedValue});let sr=pr=>{Ji.formattedValue&&(pr.target.value=Ji.formattedValue),pr.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){ir.addEventListener("focus",or=>{Ji.userValue&&(or.target.value=Ji.userValue)}),ir.addEventListener("updatefromsandbox",or=>{const Zi={value(er){Ji.userValue=er.detail.value||"",Yi.setValue(nr,{value:Ji.userValue.toString()}),Ji.formattedValue||(er.target.value=Ji.userValue)},valueAsString(er){Ji.formattedValue=er.detail.valueAsString||"",er.target!==document.activeElement&&(er.target.value=Ji.formattedValue),Yi.setValue(nr,{formattedValue:Ji.formattedValue})},selRange(er){const[hr,ur]=er.detail.selRange;hr>=0&&ur{var er;let Zi=-1;or.key==="Escape"?Zi=0:or.key==="Enter"?Zi=2:or.key==="Tab"&&(Zi=3),Zi!==-1&&(Ji.userValue=or.target.value,(er=this.linkService.eventBus)==null||er.dispatch("dispatcheventinsandbox",{source:this,detail:{id:nr,name:"Keystroke",value:or.target.value,willCommit:!0,commitKey:Zi,selStart:or.target.selectionStart,selEnd:or.target.selectionEnd}}))});const pr=sr;sr=null,ir.addEventListener("blur",or=>{var Zi;Ji.userValue=or.target.value,this._mouseState.isDown&&((Zi=this.linkService.eventBus)==null||Zi.dispatch("dispatcheventinsandbox",{source:this,detail:{id:nr,name:"Keystroke",value:or.target.value,willCommit:!0,commitKey:1,selStart:or.target.selectionStart,selEnd:or.target.selectionEnd}})),pr(or)}),(cr=this.data.actions)!=null&&cr.Keystroke&&ir.addEventListener("beforeinput",or=>{var $r;Ji.formattedValue="";const{data:Zi,target:er}=or,{value:hr,selectionStart:ur,selectionEnd:_r}=er;($r=this.linkService.eventBus)==null||$r.dispatch("dispatcheventinsandbox",{source:this,detail:{id:nr,name:"Keystroke",value:hr,change:Zi,willCommit:!1,selStart:ur,selEnd:_r}})}),this._setEventListeners(ir,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],or=>or.target.value)}if(sr&&ir.addEventListener("blur",sr),this.data.maxLen!==null&&(ir.maxLength=this.data.maxLen),this.data.comb){const pr=(this.data.rect[2]-this.data.rect[0])/this.data.maxLen;ir.classList.add("comb"),ir.style.letterSpacing=`calc(${pr}px - 1ch)`}}else ir=document.createElement("div"),ir.textContent=this.data.fieldValue,ir.style.verticalAlign="middle",ir.style.display="table-cell";return this._setTextStyle(ir),this._setBackgroundColor(ir),this.container.appendChild(ir),this.container}_setTextStyle(Yi){const nr=["left","center","right"],{fontSize:ir,fontColor:cr}=this.data.defaultAppearanceData,tr=Yi.style;ir&&(tr.fontSize=`${ir}px`),tr.color=_i.Util.makeHexColor(cr[0],cr[1],cr[2]),this.data.textAlignment!==null&&(tr.textAlign=nr[this.data.textAlignment])}}class Ii extends ji{constructor(Yi){super(Yi,{isRenderable:Yi.renderForms})}render(){const Yi=this.annotationStorage,nr=this.data,ir=nr.id;let cr=Yi.getValue(ir,{value:nr.exportValue===nr.fieldValue}).value;typeof cr=="string"&&(cr=cr!=="Off",Yi.setValue(ir,{value:cr})),this.container.className="buttonWidgetAnnotation checkBox";const tr=document.createElement("input");return wi.add(tr),tr.disabled=nr.readOnly,tr.type="checkbox",tr.name=nr.fieldName,cr&&tr.setAttribute("checked",!0),tr.setAttribute("id",ir),tr.setAttribute("exportValue",nr.exportValue),tr.tabIndex=Ei,tr.addEventListener("change",dr=>{const{name:Ji,checked:sr}=dr.target;for(const pr of this._getElementsByName(Ji,ir)){const or=sr&&pr.exportValue===nr.exportValue;pr.domElement&&(pr.domElement.checked=or),Yi.setValue(pr.id,{value:or})}Yi.setValue(ir,{value:sr})}),tr.addEventListener("resetform",dr=>{const Ji=nr.defaultFieldValue||"Off";dr.target.checked=Ji===nr.exportValue}),this.enableScripting&&this.hasJSActions&&(tr.addEventListener("updatefromsandbox",dr=>{const Ji={value(sr){sr.target.checked=sr.detail.value!=="Off",Yi.setValue(ir,{value:sr.target.checked})}};this._dispatchEventFromSandbox(Ji,dr)}),this._setEventListeners(tr,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],dr=>dr.target.checked)),this._setBackgroundColor(tr),this.container.appendChild(tr),this.container}}class Mi extends ji{constructor(Yi){super(Yi,{isRenderable:Yi.renderForms})}render(){this.container.className="buttonWidgetAnnotation radioButton";const Yi=this.annotationStorage,nr=this.data,ir=nr.id;let cr=Yi.getValue(ir,{value:nr.fieldValue===nr.buttonValue}).value;typeof cr=="string"&&(cr=cr!==nr.buttonValue,Yi.setValue(ir,{value:cr}));const tr=document.createElement("input");if(wi.add(tr),tr.disabled=nr.readOnly,tr.type="radio",tr.name=nr.fieldName,cr&&tr.setAttribute("checked",!0),tr.setAttribute("id",ir),tr.tabIndex=Ei,tr.addEventListener("change",dr=>{const{name:Ji,checked:sr}=dr.target;for(const pr of this._getElementsByName(Ji,ir))Yi.setValue(pr.id,{value:!1});Yi.setValue(ir,{value:sr})}),tr.addEventListener("resetform",dr=>{const Ji=nr.defaultFieldValue;dr.target.checked=Ji!=null&&Ji===nr.buttonValue}),this.enableScripting&&this.hasJSActions){const dr=nr.buttonValue;tr.addEventListener("updatefromsandbox",Ji=>{const sr={value:pr=>{const or=dr===pr.detail.value;for(const Zi of this._getElementsByName(pr.target.name)){const er=or&&Zi.id===ir;Zi.domElement&&(Zi.domElement.checked=er),Yi.setValue(Zi.id,{value:er})}}};this._dispatchEventFromSandbox(sr,Ji)}),this._setEventListeners(tr,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],Ji=>Ji.target.checked)}return this._setBackgroundColor(tr),this.container.appendChild(tr),this.container}}class Fi extends Ti{constructor(Yi){super(Yi,{ignoreBorder:Yi.data.hasAppearance})}render(){const Yi=super.render();return Yi.className="buttonWidgetAnnotation pushButton",this.data.alternativeText&&(Yi.title=this.data.alternativeText),Yi}}class Bi extends ji{constructor(Yi){super(Yi,{isRenderable:Yi.renderForms})}render(){this.container.className="choiceWidgetAnnotation";const Yi=this.annotationStorage,nr=this.data.id;Yi.getValue(nr,{value:this.data.fieldValue.length>0?this.data.fieldValue[0]:void 0});let{fontSize:ir}=this.data.defaultAppearanceData;ir||(ir=9);const cr=`calc(${ir}px * var(--zoom-factor))`,tr=document.createElement("select");wi.add(tr),tr.disabled=this.data.readOnly,tr.name=this.data.fieldName,tr.setAttribute("id",nr),tr.tabIndex=Ei,tr.style.fontSize=`${ir}px`,this.data.combo||(tr.size=this.data.options.length,this.data.multiSelect&&(tr.multiple=!0)),tr.addEventListener("resetform",sr=>{const pr=this.data.defaultFieldValue;for(const or of tr.options)or.selected=or.value===pr});for(const sr of this.data.options){const pr=document.createElement("option");pr.textContent=sr.displayValue,pr.value=sr.exportValue,this.data.combo&&(pr.style.fontSize=cr),this.data.fieldValue.includes(sr.exportValue)&&pr.setAttribute("selected",!0),tr.appendChild(pr)}const dr=(sr,pr)=>{const or=pr?"value":"textContent",Zi=sr.target.options;return sr.target.multiple?Array.prototype.filter.call(Zi,er=>er.selected).map(er=>er[or]):Zi.selectedIndex===-1?null:Zi[Zi.selectedIndex][or]},Ji=sr=>{const pr=sr.target.options;return Array.prototype.map.call(pr,or=>({displayValue:or.textContent,exportValue:or.value}))};return this.enableScripting&&this.hasJSActions?(tr.addEventListener("updatefromsandbox",sr=>{const pr={value(or){const Zi=or.detail.value,er=new Set(Array.isArray(Zi)?Zi:[Zi]);for(const hr of tr.options)hr.selected=er.has(hr.value);Yi.setValue(nr,{value:dr(or,!0)})},multipleSelection(or){tr.multiple=!0},remove(or){const Zi=tr.options,er=or.detail.remove;Zi[er].selected=!1,tr.remove(er),Zi.length>0&&Array.prototype.findIndex.call(Zi,hr=>hr.selected)===-1&&(Zi[0].selected=!0),Yi.setValue(nr,{value:dr(or,!0),items:Ji(or)})},clear(or){for(;tr.length!==0;)tr.remove(0);Yi.setValue(nr,{value:null,items:[]})},insert(or){const{index:Zi,displayValue:er,exportValue:hr}=or.detail.insert,ur=document.createElement("option");ur.textContent=er,ur.value=hr,tr.insertBefore(ur,tr.children[Zi]),Yi.setValue(nr,{value:dr(or,!0),items:Ji(or)})},items(or){const{items:Zi}=or.detail;for(;tr.length!==0;)tr.remove(0);for(const er of Zi){const{displayValue:hr,exportValue:ur}=er,_r=document.createElement("option");_r.textContent=hr,_r.value=ur,tr.appendChild(_r)}tr.options.length>0&&(tr.options[0].selected=!0),Yi.setValue(nr,{value:dr(or,!0),items:Ji(or)})},indices(or){const Zi=new Set(or.detail.indices);for(const er of or.target.options)er.selected=Zi.has(er.index);Yi.setValue(nr,{value:dr(or,!0)})},editable(or){or.target.disabled=!or.detail.editable}};this._dispatchEventFromSandbox(pr,sr)}),tr.addEventListener("input",sr=>{var Zi;const pr=dr(sr,!0),or=dr(sr,!1);Yi.setValue(nr,{value:pr}),(Zi=this.linkService.eventBus)==null||Zi.dispatch("dispatcheventinsandbox",{source:this,detail:{id:nr,name:"Keystroke",value:or,changeEx:pr,willCommit:!0,commitKey:1,keyDown:!1}})}),this._setEventListeners(tr,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"]],sr=>sr.target.checked)):tr.addEventListener("input",function(sr){Yi.setValue(nr,{value:dr(sr)})}),this._setBackgroundColor(tr),this.container.appendChild(tr),this.container}}class Ri extends xi{constructor(Yi){var nr,ir,cr;super(Yi,{isRenderable:!!((nr=Yi.data.titleObj)!=null&&nr.str||(ir=Yi.data.contentsObj)!=null&&ir.str||(cr=Yi.data.richText)!=null&&cr.str)})}render(){if(this.container.className="popupAnnotation",["Line","Square","Circle","PolyLine","Polygon","Ink"].includes(this.data.parentType))return this.container;const Yi=`[data-annotation-id="${this.data.parentId}"]`,nr=this.layer.querySelectorAll(Yi);if(nr.length===0)return this.container;const ir=new Vi({container:this.container,trigger:Array.from(nr),color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText}),cr=this.page,tr=_i.Util.normalizeRect([this.data.parentRect[0],cr.view[3]-this.data.parentRect[1]+cr.view[1],this.data.parentRect[2],cr.view[3]-this.data.parentRect[3]+cr.view[1]]),dr=tr[0]+this.data.parentRect[2]-this.data.parentRect[0],Ji=tr[1];return this.container.style.transformOrigin=`${-dr}px ${-Ji}px`,this.container.style.left=`${dr}px`,this.container.style.top=`${Ji}px`,this.container.appendChild(ir.render()),this.container}}class Vi{constructor(Yi){this.container=Yi.container,this.trigger=Yi.trigger,this.color=Yi.color,this.titleObj=Yi.titleObj,this.modificationDate=Yi.modificationDate,this.contentsObj=Yi.contentsObj,this.richText=Yi.richText,this.hideWrapper=Yi.hideWrapper||!1,this.pinned=!1}render(){var dr,Ji;const Yi=document.createElement("div");Yi.className="popupWrapper",this.hideElement=this.hideWrapper?Yi:this.container,this.hideElement.hidden=!0;const nr=document.createElement("div");nr.className="popup";const ir=this.color;if(ir){const sr=.7*(255-ir[0])+ir[0],pr=.7*(255-ir[1])+ir[1],or=.7*(255-ir[2])+ir[2];nr.style.backgroundColor=_i.Util.makeHexColor(0|sr,0|pr,0|or)}const cr=document.createElement("h1");cr.dir=this.titleObj.dir,cr.textContent=this.titleObj.str,nr.appendChild(cr);const tr=$i.PDFDateString.toDateObject(this.modificationDate);if(tr){const sr=document.createElement("span");sr.className="popupDate",sr.textContent="{{date}}, {{time}}",sr.dataset.l10nId="annotation_date_string",sr.dataset.l10nArgs=JSON.stringify({date:tr.toLocaleDateString(),time:tr.toLocaleTimeString()}),nr.appendChild(sr)}if(!((dr=this.richText)!=null&&dr.str)||(Ji=this.contentsObj)!=null&&Ji.str&&this.contentsObj.str!==this.richText.str){const sr=this._formatContents(this.contentsObj);nr.appendChild(sr)}else Si.XfaLayer.render({xfaHtml:this.richText.html,intent:"richText",div:nr}),nr.lastChild.className="richText popupContent";Array.isArray(this.trigger)||(this.trigger=[this.trigger]);for(const sr of this.trigger)sr.addEventListener("click",this._toggle.bind(this)),sr.addEventListener("mouseover",this._show.bind(this,!1)),sr.addEventListener("mouseout",this._hide.bind(this,!1));return nr.addEventListener("click",this._hide.bind(this,!0)),Yi.appendChild(nr),Yi}_formatContents({str:Yi,dir:nr}){const ir=document.createElement("p");ir.className="popupContent",ir.dir=nr;const cr=Yi.split(/(?:\r\n?|\n)/);for(let tr=0,dr=cr.length;tr{Object.defineProperty(vi,"__esModule",{value:!0}),vi.ColorConverters=void 0;function bi(_i){return Math.floor(255*Math.max(0,Math.min(1,_i))).toString(16).padStart(2,"0")}vi.ColorConverters=class{static CMYK_G([_i,$i,Pi,Ai]){return["G",1-Math.min(1,.3*_i+.59*Pi+.11*$i+Ai)]}static G_CMYK([_i]){return["CMYK",0,0,0,1-_i]}static G_RGB([_i]){return["RGB",_i,_i,_i]}static G_HTML([_i]){const $i=bi(_i);return`#${$i}${$i}${$i}`}static RGB_G([_i,$i,Pi]){return["G",.3*_i+.59*$i+.11*Pi]}static RGB_HTML([_i,$i,Pi]){return`#${bi(_i)}${bi($i)}${bi(Pi)}`}static T_HTML(){return"#00000000"}static CMYK_RGB([_i,$i,Pi,Ai]){return["RGB",1-Math.min(1,_i+Ai),1-Math.min(1,Pi+Ai),1-Math.min(1,$i+Ai)]}static CMYK_HTML(_i){return this.RGB_HTML(this.CMYK_RGB(_i))}static RGB_CMYK([_i,$i,Pi]){const Ai=1-_i,Si=1-$i,Ei=1-Pi;return["CMYK",Ai,Si,Ei,Math.min(Ai,Si,Ei)]}}},(yi,vi,bi)=>{Object.defineProperty(vi,"__esModule",{value:!0}),vi.XfaLayer=void 0;var _i=bi(1),$i=bi(17);vi.XfaLayer=class{static setupStorage(Pi,Ai,Si,Ei,wi){const Ci=Ei.getValue(Ai,{value:null});switch(Si.name){case"textarea":if(Ci.value!==null&&(Pi.textContent=Ci.value),wi==="print")break;Pi.addEventListener("input",ki=>{Ei.setValue(Ai,{value:ki.target.value})});break;case"input":if(Si.attributes.type==="radio"||Si.attributes.type==="checkbox"){if(Ci.value===Si.attributes.xfaOn?Pi.setAttribute("checked",!0):Ci.value===Si.attributes.xfaOff&&Pi.removeAttribute("checked"),wi==="print")break;Pi.addEventListener("change",ki=>{Ei.setValue(Ai,{value:ki.target.checked?ki.target.getAttribute("xfaOn"):ki.target.getAttribute("xfaOff")})})}else{if(Ci.value!==null&&Pi.setAttribute("value",Ci.value),wi==="print")break;Pi.addEventListener("input",ki=>{Ei.setValue(Ai,{value:ki.target.value})})}break;case"select":if(Ci.value!==null)for(const ki of Si.children)ki.attributes.value===Ci.value&&(ki.attributes.selected=!0);Pi.addEventListener("input",ki=>{const xi=ki.target.options,Ti=xi.selectedIndex===-1?"":xi[xi.selectedIndex].value;Ei.setValue(Ai,{value:Ti})})}}static setAttributes({html:Pi,element:Ai,storage:Si=null,intent:Ei,linkService:wi}){var xi;const{attributes:Ci}=Ai,ki=Pi instanceof HTMLAnchorElement;Ci.type==="radio"&&(Ci.name=`${Ci.name}-${Ei}`);for(const[Ti,Oi]of Object.entries(Ci))if(Oi!=null&&Ti!=="dataId")if(Ti!=="style")if(Ti==="textContent")Pi.textContent=Oi;else if(Ti==="class")Oi.length&&Pi.setAttribute(Ti,Oi.join(" "));else{if(ki&&(Ti==="href"||Ti==="newWindow"))continue;Pi.setAttribute(Ti,Oi)}else Object.assign(Pi.style,Oi);ki&&(wi.addLinkAttributes||(0,_i.warn)("XfaLayer.setAttribute - missing `addLinkAttributes`-method on the `linkService`-instance."),(xi=wi.addLinkAttributes)==null||xi.call(wi,Pi,Ci.href,Ci.newWindow)),Si&&Ci.dataId&&this.setupStorage(Pi,Ci.dataId,Ai,Si)}static render(Pi){var Oi;const Ai=Pi.annotationStorage,Si=Pi.linkService,Ei=Pi.xfaHtml,wi=Pi.intent||"display",Ci=document.createElement(Ei.name);Ei.attributes&&this.setAttributes({html:Ci,element:Ei,intent:wi,linkService:Si});const ki=[[Ei,-1,Ci]],xi=Pi.div;if(xi.appendChild(Ci),Pi.viewport){const ji=`matrix(${Pi.viewport.transform.join(",")})`;xi.style.transform=ji}wi!=="richText"&&xi.setAttribute("class","xfaLayer xfaFont");const Ti=[];for(;ki.length>0;){const[ji,Li,Ii]=ki[ki.length-1];if(Li+1===ji.children.length){ki.pop();continue}const Mi=ji.children[++ki[ki.length-1][1]];if(Mi===null)continue;const{name:Fi}=Mi;if(Fi==="#text"){const Ri=document.createTextNode(Mi.value);Ti.push(Ri),Ii.appendChild(Ri);continue}let Bi;if(Bi=(Oi=Mi==null?void 0:Mi.attributes)!=null&&Oi.xmlns?document.createElementNS(Mi.attributes.xmlns,Fi):document.createElement(Fi),Ii.appendChild(Bi),Mi.attributes&&this.setAttributes({html:Bi,element:Mi,storage:Ai,intent:wi,linkService:Si}),Mi.children&&Mi.children.length>0)ki.push([Mi,-1,Bi]);else if(Mi.value){const Ri=document.createTextNode(Mi.value);$i.XfaText.shouldBuildText(Fi)&&Ti.push(Ri),Bi.appendChild(Ri)}}for(const ji of xi.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))ji.setAttribute("readOnly",!0);return{textDivs:Ti}}static update(Pi){const Ai=`matrix(${Pi.viewport.transform.join(",")})`;Pi.div.style.transform=Ai,Pi.div.hidden=!1}}},(yi,vi,bi)=>{Object.defineProperty(vi,"__esModule",{value:!0}),vi.renderTextLayer=function(Ti){const Oi=new xi({textContent:Ti.textContent,textContentStream:Ti.textContentStream,container:Ti.container,viewport:Ti.viewport,textDivs:Ti.textDivs,textContentItemsStr:Ti.textContentItemsStr,enhanceTextSelection:Ti.enhanceTextSelection});return Oi._render(Ti.timeout),Oi};var _i=bi(1);const $i=30,Pi=new Map,Ai=/^\s+$/g;function Si(Ti,Oi,ji,Li){const Ii=document.createElement("span"),Mi=Ti._enhanceTextSelection?{angle:0,canvasWidth:0,hasText:Oi.str!=="",hasEOL:Oi.hasEOL,originalTransform:null,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0,scale:1}:{angle:0,canvasWidth:0,hasText:Oi.str!=="",hasEOL:Oi.hasEOL};Ti._textDivs.push(Ii);const Fi=_i.Util.transform(Ti._viewport.transform,Oi.transform);let Bi=Math.atan2(Fi[1],Fi[0]);const Ri=ji[Oi.fontName];Ri.vertical&&(Bi+=Math.PI/2);const Vi=Math.hypot(Fi[2],Fi[3]),Ni=Vi*function(Ui,Hi){const qi=Pi.get(Ui);if(qi)return qi;Hi.save(),Hi.font=`30px ${Ui}`;const Gi=Hi.measureText("");let Ki=Gi.fontBoundingBoxAscent,Qi=Math.abs(Gi.fontBoundingBoxDescent);if(Ki){Hi.restore();const rr=Ki/(Ki+Qi);return Pi.set(Ui,rr),rr}Hi.strokeStyle="red",Hi.clearRect(0,0,$i,$i),Hi.strokeText("g",0,0);let Xi=Hi.getImageData(0,0,$i,$i).data;Qi=0;for(let rr=Xi.length-1-3;rr>=0;rr-=4)if(Xi[rr]>0){Qi=Math.ceil(rr/4/$i);break}Hi.clearRect(0,0,$i,$i),Hi.strokeText("A",0,$i),Xi=Hi.getImageData(0,0,$i,$i).data,Ki=0;for(let rr=0,ar=Xi.length;rr0){Ki=$i-Math.floor(rr/4/$i);break}if(Hi.restore(),Ki){const rr=Ki/(Ki+Qi);return Pi.set(Ui,rr),rr}return Pi.set(Ui,.8),.8}(Ri.fontFamily,Li);let Wi,zi;Bi===0?(Wi=Fi[4],zi=Fi[5]-Ni):(Wi=Fi[4]+Ni*Math.sin(Bi),zi=Fi[5]-Ni*Math.cos(Bi)),Ii.style.left=`${Wi}px`,Ii.style.top=`${zi}px`,Ii.style.fontSize=`${Vi}px`,Ii.style.fontFamily=Ri.fontFamily,Ii.setAttribute("role","presentation"),Ii.textContent=Oi.str,Ii.dir=Oi.dir,Ti._fontInspectorEnabled&&(Ii.dataset.fontName=Oi.fontName),Bi!==0&&(Mi.angle=Bi*(180/Math.PI));let Di=!1;if(Oi.str.length>1||Ti._enhanceTextSelection&&Ai.test(Oi.str))Di=!0;else if(Oi.str!==" "&&Oi.transform[0]!==Oi.transform[3]){const Ui=Math.abs(Oi.transform[0]),Hi=Math.abs(Oi.transform[3]);Ui!==Hi&&Math.max(Ui,Hi)/Math.min(Ui,Hi)>1.5&&(Di=!0)}if(Di&&(Ri.vertical?Mi.canvasWidth=Oi.height*Ti._viewport.scale:Mi.canvasWidth=Oi.width*Ti._viewport.scale),Ti._textDivProperties.set(Ii,Mi),Ti._textContentStream&&Ti._layoutText(Ii),Ti._enhanceTextSelection&&Mi.hasText){let Ui=1,Hi=0;Bi!==0&&(Ui=Math.cos(Bi),Hi=Math.sin(Bi));const qi=(Ri.vertical?Oi.height:Oi.width)*Ti._viewport.scale,Gi=Vi;let Ki,Qi;Bi!==0?(Ki=[Ui,Hi,-Hi,Ui,Wi,zi],Qi=_i.Util.getAxialAlignedBoundingBox([0,0,qi,Gi],Ki)):Qi=[Wi,zi,Wi+qi,zi+Gi],Ti._bounds.push({left:Qi[0],top:Qi[1],right:Qi[2],bottom:Qi[3],div:Ii,size:[qi,Gi],m:Ki})}}function Ei(Ti){if(Ti._canceled)return;const Oi=Ti._textDivs,ji=Ti._capability,Li=Oi.length;if(Li>1e5)Ti._renderingDone=!0,ji.resolve();else{if(!Ti._textContentStream)for(let Ii=0;Ii0&&(Li=Li?Math.min(Mi,Li):Mi)}return Li}function Ci(Ti){const Oi=Ti._bounds,ji=Ti._viewport,Li=function(Ii,Mi,Fi){const Bi=Fi.map(function(Vi,Ni){return{x1:Vi.left,y1:Vi.top,x2:Vi.right,y2:Vi.bottom,index:Ni,x1New:void 0,x2New:void 0}});ki(Ii,Bi);const Ri=new Array(Fi.length);for(const Vi of Bi){const Ni=Vi.index;Ri[Ni]={left:Vi.x1New,top:0,right:Vi.x2New,bottom:0}}Fi.map(function(Vi,Ni){const Wi=Ri[Ni],zi=Bi[Ni];zi.x1=Vi.top,zi.y1=Ii-Wi.right,zi.x2=Vi.bottom,zi.y2=Ii-Wi.left,zi.index=Ni,zi.x1New=void 0,zi.x2New=void 0}),ki(Mi,Bi);for(const Vi of Bi){const Ni=Vi.index;Ri[Ni].top=Vi.x1New,Ri[Ni].bottom=Vi.x2New}return Ri}(ji.width,ji.height,Oi);for(let Ii=0;Ii=0&&ji[Bi].start>=Li.y2;)Bi--;let Ri,Vi,Ni=-1/0;for(Ri=Ii;Ri<=Bi;Ri++){Mi=ji[Ri],Fi=Mi.boundary;let Di;Di=Fi.x2>Li.x1?Fi.index>Li.index?Fi.x1New:Li.x1:Fi.x2New===void 0?(Fi.x2+Li.x1)/2:Fi.x2New,Di>Ni&&(Ni=Di)}for(Li.x1New=Ni,Ri=Ii;Ri<=Bi;Ri++)Mi=ji[Ri],Fi=Mi.boundary,Fi.x2New===void 0?Fi.x2>Li.x1?Fi.index>Li.index&&(Fi.x2New=Fi.x2):Fi.x2New=Ni:Fi.x2New>Ni&&(Fi.x2New=Math.max(Ni,Fi.x2));const Wi=[];let zi=null;for(Ri=Ii;Ri<=Bi;Ri++){Mi=ji[Ri],Fi=Mi.boundary;const Di=Fi.x2>Li.x2?Fi:Li;zi===Di?Wi[Wi.length-1].end=Mi.end:(Wi.push({start:Mi.start,end:Mi.end,boundary:Di}),zi=Di)}for(ji[Ii].start=0&&ji[Vi].start>=Fi.y1;Vi--)Di=ji[Vi].boundary===Fi;for(Vi=Bi+1;!Di&&Vi{this._enhanceTextSelection||(this._textDivProperties=null),this._layoutTextCtx&&(this._layoutTextCtx.canvas.width=0,this._layoutTextCtx.canvas.height=0,this._layoutTextCtx=null)}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new _i.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._renderTimer!==null&&(clearTimeout(this._renderTimer),this._renderTimer=null),this._capability.reject(new Error("TextLayer task cancelled."))}_processItems(Oi,ji){for(let Li=0,Ii=Oi.length;Li0){let Bi=ji.canvasWidth/Fi;if(this._enhanceTextSelection&&(ji.scale=Bi),navigator.userAgent.indexOf("Chrome")>-1){const Ri=Number.parseFloat(Ii);Ri<12&&(Bi*=Ri/12),Li=`scale(${Bi})`}else Li=`scaleX(${Bi})`}}if(ji.angle!==0&&(Li=`rotate(${ji.angle}deg) ${Li}`),Li.length>0&&(this._enhanceTextSelection&&(ji.originalTransform=Li),Oi.style.transform=Li),ji.hasText&&this._container.appendChild(Oi),ji.hasEOL){const Ii=document.createElement("br");Ii.setAttribute("role","presentation"),this._container.appendChild(Ii)}}_render(Oi=0){const ji=(0,_i.createPromiseCapability)();let Li=Object.create(null);const Ii=this._document.createElement("canvas");if(Ii.height=Ii.width=$i,Ii.mozOpaque=!0,this._layoutTextCtx=Ii.getContext("2d",{alpha:!1}),this._textContent){const Mi=this._textContent.items,Fi=this._textContent.styles;this._processItems(Mi,Fi),ji.resolve()}else{if(!this._textContentStream)throw new Error('Neither "textContent" nor "textContentStream" parameters specified.');{const Mi=()=>{this._reader.read().then(({value:Fi,done:Bi})=>{Bi?ji.resolve():(Object.assign(Li,Fi.styles),this._processItems(Fi.items,Li),Mi())},ji.reject)};this._reader=this._textContentStream.getReader(),Mi()}}ji.promise.then(()=>{Li=null,Oi?this._renderTimer=setTimeout(()=>{Ei(this),this._renderTimer=null},Oi):Ei(this)},this._capability.reject)}expandTextDivs(Oi=!1){if(!this._enhanceTextSelection||!this._renderingDone)return;this._bounds!==null&&(Ci(this),this._bounds=null);const ji=[],Li=[];for(let Ii=0,Mi=this._textDivs.length;Ii0?(Li.push(`${Bi.paddingTop}px`),ji.push(`translateY(${-Bi.paddingTop}px)`)):Li.push(0),Bi.paddingRight>0?Li.push(Bi.paddingRight/Bi.scale+"px"):Li.push(0),Bi.paddingBottom>0?Li.push(`${Bi.paddingBottom}px`):Li.push(0),Bi.paddingLeft>0?(Li.push(Bi.paddingLeft/Bi.scale+"px"),ji.push(`translateX(${-Bi.paddingLeft/Bi.scale}px)`)):Li.push(0),Fi.style.padding=Li.join(" "),ji.length&&(Fi.style.transform=ji.join(" "))):(Fi.style.padding=null,Fi.style.transform=Bi.originalTransform))}}}},(yi,vi,bi)=>{Object.defineProperty(vi,"__esModule",{value:!0}),vi.SVGGraphics=void 0;var _i=bi(1),$i=bi(5),Pi=bi(3);let Ai=class{constructor(){(0,_i.unreachable)("Not implemented: SVGGraphics")}};vi.SVGGraphics=Ai;{let ji=function(Ri){let Vi=[];const Ni=[];for(const Wi of Ri)Wi.fn!=="save"?Wi.fn==="restore"?Vi=Ni.pop():Vi.push(Wi):(Vi.push({fnId:92,fn:"group",items:[]}),Ni.push(Vi),Vi=Vi[Vi.length-1].items);return Vi},Li=function(Ri){if(Number.isInteger(Ri))return Ri.toString();const Vi=Ri.toFixed(10);let Ni=Vi.length-1;if(Vi[Ni]!=="0")return Vi;do Ni--;while(Vi[Ni]==="0");return Vi.substring(0,Vi[Ni]==="."?Ni:Ni+1)},Ii=function(Ri){if(Ri[4]===0&&Ri[5]===0){if(Ri[1]===0&&Ri[2]===0)return Ri[0]===1&&Ri[3]===1?"":`scale(${Li(Ri[0])} ${Li(Ri[3])})`;if(Ri[0]===Ri[3]&&Ri[1]===-Ri[2])return`rotate(${Li(180*Math.acos(Ri[0])/Math.PI)})`}else if(Ri[0]===1&&Ri[1]===0&&Ri[2]===0&&Ri[3]===1)return`translate(${Li(Ri[4])} ${Li(Ri[5])})`;return`matrix(${Li(Ri[0])} ${Li(Ri[1])} ${Li(Ri[2])} ${Li(Ri[3])} ${Li(Ri[4])} ${Li(Ri[5])})`};const Si={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},Ei="http://www.w3.org/XML/1998/namespace",wi="http://www.w3.org/1999/xlink",Ci=["butt","round","square"],ki=["miter","round","bevel"],xi=function(Ri,Vi="",Ni=!1){if(URL.createObjectURL&&typeof Blob<"u"&&!Ni)return URL.createObjectURL(new Blob([Ri],{type:Vi}));const Wi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let zi=`data:${Vi};base64,`;for(let Di=0,Ui=Ri.length;Di>2]+Wi[(3&Hi)<<4|qi>>4]+Wi[Di+1>6:64]+Wi[Di+2>1&2147483647:Ui>>1&2147483647;Vi[Di]=Ui}function Ni(Di,Ui,Hi,qi){let Gi=qi;const Ki=Ui.length;Hi[Gi]=Ki>>24&255,Hi[Gi+1]=Ki>>16&255,Hi[Gi+2]=Ki>>8&255,Hi[Gi+3]=255&Ki,Gi+=4,Hi[Gi]=255&Di.charCodeAt(0),Hi[Gi+1]=255&Di.charCodeAt(1),Hi[Gi+2]=255&Di.charCodeAt(2),Hi[Gi+3]=255&Di.charCodeAt(3),Gi+=4,Hi.set(Ui,Gi),Gi+=Ui.length;const Qi=function(Xi,rr,ar){let gr=-1;for(let fr=rr;fr>>8^Vi[lr]}return-1^gr}(Hi,qi+4,Gi);Hi[Gi]=Qi>>24&255,Hi[Gi+1]=Qi>>16&255,Hi[Gi+2]=Qi>>8&255,Hi[Gi+3]=255&Qi}function Wi(Di){let Ui=Di.length;const Hi=65535,qi=Math.ceil(Ui/Hi),Gi=new Uint8Array(2+Ui+5*qi+4);let Ki=0;Gi[Ki++]=120,Gi[Ki++]=156;let Qi=0;for(;Ui>Hi;)Gi[Ki++]=0,Gi[Ki++]=255,Gi[Ki++]=255,Gi[Ki++]=0,Gi[Ki++]=0,Gi.set(Di.subarray(Qi,Qi+Hi),Ki),Ki+=Hi,Qi+=Hi,Ui-=Hi;Gi[Ki++]=1,Gi[Ki++]=255&Ui,Gi[Ki++]=Ui>>8&255,Gi[Ki++]=255&~Ui,Gi[Ki++]=(65535&~Ui)>>8&255,Gi.set(Di.subarray(Qi),Ki),Ki+=Di.length-Qi;const Xi=function(rr,ar,gr){let fr=1,lr=0;for(let mr=ar;mr>24&255,Gi[Ki++]=Xi>>16&255,Gi[Ki++]=Xi>>8&255,Gi[Ki++]=255&Xi,Gi}function zi(Di,Ui,Hi,qi){const Gi=Di.width,Ki=Di.height;let Qi,Xi,rr;const ar=Di.data;switch(Ui){case _i.ImageKind.GRAYSCALE_1BPP:Xi=0,Qi=1,rr=Gi+7>>3;break;case _i.ImageKind.RGB_24BPP:Xi=2,Qi=8,rr=3*Gi;break;case _i.ImageKind.RGBA_32BPP:Xi=6,Qi=8,rr=4*Gi;break;default:throw new Error("invalid format")}const gr=new Uint8Array((1+rr)*Ki);let fr=0,lr=0;for(let cr=0;cr>24&255,Gi>>16&255,Gi>>8&255,255&Gi,Ki>>24&255,Ki>>16&255,Ki>>8&255,255&Ki,Qi,Xi,0,0,0]),vr=function(cr){if(!Pi.isNodeJS)return Wi(cr);try{let tr;tr=parseInt(process.versions.node)>=8?cr:Buffer.from(cr);const dr=require$$5.deflateSync(tr,{level:9});return dr instanceof Uint8Array?dr:new Uint8Array(dr)}catch(tr){(0,_i.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+tr)}return Wi(cr)}(gr),Yi=Ri.length+36+mr.length+vr.length,nr=new Uint8Array(Yi);let ir=0;return nr.set(Ri,ir),ir+=Ri.length,Ni("IHDR",mr,nr,ir),ir+=12+mr.length,Ni("IDATA",vr,nr,ir),ir+=12+vr.length,Ni("IEND",new Uint8Array(0),nr,ir),xi(nr,"image/png",Hi)}return function(Di,Ui,Hi){return zi(Di,Di.kind===void 0?_i.ImageKind.GRAYSCALE_1BPP:Di.kind,Ui,Hi)}}();class Oi{constructor(){this.fontSizeScale=1,this.fontWeight=Si.fontWeight,this.fontSize=0,this.textMatrix=_i.IDENTITY_MATRIX,this.fontMatrix=_i.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=_i.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=Si.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(Vi,Ni){this.x=Vi,this.y=Ni}}let Mi=0,Fi=0,Bi=0;vi.SVGGraphics=Ai=class{constructor(Ri,Vi,Ni=!1){this.svgFactory=new $i.DOMSVGFactory,this.current=new Oi,this.transformMatrix=_i.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=Ri,this.objs=Vi,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!Ni,this._operatorIdMapping=[];for(const Wi in _i.OPS)this._operatorIdMapping[_i.OPS[Wi]]=Wi}save(){this.transformStack.push(this.transformMatrix);const Ri=this.current;this.extraStack.push(Ri),this.current=Ri.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(Ri){this.save(),this.executeOpTree(Ri),this.restore()}loadDependencies(Ri){const Vi=Ri.fnArray,Ni=Ri.argsArray;for(let Wi=0,zi=Vi.length;Wi{Ui.get(Di,qi)});this.current.dependencies.push(Hi)}return Promise.all(this.current.dependencies)}transform(Ri,Vi,Ni,Wi,zi,Di){const Ui=[Ri,Vi,Ni,Wi,zi,Di];this.transformMatrix=_i.Util.transform(this.transformMatrix,Ui),this.tgrp=null}getSVG(Ri,Vi){this.viewport=Vi;const Ni=this._initialize(Vi);return this.loadDependencies(Ri).then(()=>(this.transformMatrix=_i.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(Ri)),Ni))}convertOpList(Ri){const Vi=this._operatorIdMapping,Ni=Ri.argsArray,Wi=Ri.fnArray,zi=[];for(let Di=0,Ui=Wi.length;Di0&&(this.current.lineWidth=Ri)}setLineCap(Ri){this.current.lineCap=Ci[Ri]}setLineJoin(Ri){this.current.lineJoin=ki[Ri]}setMiterLimit(Ri){this.current.miterLimit=Ri}setStrokeAlpha(Ri){this.current.strokeAlpha=Ri}setStrokeRGBColor(Ri,Vi,Ni){this.current.strokeColor=_i.Util.makeHexColor(Ri,Vi,Ni)}setFillAlpha(Ri){this.current.fillAlpha=Ri}setFillRGBColor(Ri,Vi,Ni){this.current.fillColor=_i.Util.makeHexColor(Ri,Vi,Ni),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(Ri){this.current.strokeColor=this._makeColorN_Pattern(Ri)}setFillColorN(Ri){this.current.fillColor=this._makeColorN_Pattern(Ri)}shadingFill(Ri){const Vi=this.viewport.width,Ni=this.viewport.height,Wi=_i.Util.inverseTransform(this.transformMatrix),zi=_i.Util.applyTransform([0,0],Wi),Di=_i.Util.applyTransform([0,Ni],Wi),Ui=_i.Util.applyTransform([Vi,0],Wi),Hi=_i.Util.applyTransform([Vi,Ni],Wi),qi=Math.min(zi[0],Di[0],Ui[0],Hi[0]),Gi=Math.min(zi[1],Di[1],Ui[1],Hi[1]),Ki=Math.max(zi[0],Di[0],Ui[0],Hi[0]),Qi=Math.max(zi[1],Di[1],Ui[1],Hi[1]),Xi=this.svgFactory.createElement("svg:rect");Xi.setAttributeNS(null,"x",qi),Xi.setAttributeNS(null,"y",Gi),Xi.setAttributeNS(null,"width",Ki-qi),Xi.setAttributeNS(null,"height",Qi-Gi),Xi.setAttributeNS(null,"fill",this._makeShadingPattern(Ri)),this.current.fillAlpha<1&&Xi.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().appendChild(Xi)}_makeColorN_Pattern(Ri){return Ri[0]==="TilingPattern"?this._makeTilingPattern(Ri):this._makeShadingPattern(Ri)}_makeTilingPattern(Ri){const Vi=Ri[1],Ni=Ri[2],Wi=Ri[3]||_i.IDENTITY_MATRIX,[zi,Di,Ui,Hi]=Ri[4],qi=Ri[5],Gi=Ri[6],Ki=Ri[7],Qi="shading"+Bi++,[Xi,rr,ar,gr]=_i.Util.normalizeRect([..._i.Util.applyTransform([zi,Di],Wi),..._i.Util.applyTransform([Ui,Hi],Wi)]),[fr,lr]=_i.Util.singularValueDecompose2dScale(Wi),mr=qi*fr,vr=Gi*lr,Yi=this.svgFactory.createElement("svg:pattern");Yi.setAttributeNS(null,"id",Qi),Yi.setAttributeNS(null,"patternUnits","userSpaceOnUse"),Yi.setAttributeNS(null,"width",mr),Yi.setAttributeNS(null,"height",vr),Yi.setAttributeNS(null,"x",`${Xi}`),Yi.setAttributeNS(null,"y",`${rr}`);const nr=this.svg,ir=this.transformMatrix,cr=this.current.fillColor,tr=this.current.strokeColor,dr=this.svgFactory.create(ar-Xi,gr-rr);if(this.svg=dr,this.transformMatrix=Wi,Ki===2){const Ji=_i.Util.makeHexColor(...Vi);this.current.fillColor=Ji,this.current.strokeColor=Ji}return this.executeOpTree(this.convertOpList(Ni)),this.svg=nr,this.transformMatrix=ir,this.current.fillColor=cr,this.current.strokeColor=tr,Yi.appendChild(dr.childNodes[0]),this.defs.appendChild(Yi),`url(#${Qi})`}_makeShadingPattern(Ri){switch(typeof Ri=="string"&&(Ri=this.objs.get(Ri)),Ri[0]){case"RadialAxial":const Vi="shading"+Bi++,Ni=Ri[3];let Wi;switch(Ri[1]){case"axial":const zi=Ri[4],Di=Ri[5];Wi=this.svgFactory.createElement("svg:linearGradient"),Wi.setAttributeNS(null,"id",Vi),Wi.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),Wi.setAttributeNS(null,"x1",zi[0]),Wi.setAttributeNS(null,"y1",zi[1]),Wi.setAttributeNS(null,"x2",Di[0]),Wi.setAttributeNS(null,"y2",Di[1]);break;case"radial":const Ui=Ri[4],Hi=Ri[5],qi=Ri[6],Gi=Ri[7];Wi=this.svgFactory.createElement("svg:radialGradient"),Wi.setAttributeNS(null,"id",Vi),Wi.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),Wi.setAttributeNS(null,"cx",Hi[0]),Wi.setAttributeNS(null,"cy",Hi[1]),Wi.setAttributeNS(null,"r",Gi),Wi.setAttributeNS(null,"fx",Ui[0]),Wi.setAttributeNS(null,"fy",Ui[1]),Wi.setAttributeNS(null,"fr",qi);break;default:throw new Error(`Unknown RadialAxial type: ${Ri[1]}`)}for(const zi of Ni){const Di=this.svgFactory.createElement("svg:stop");Di.setAttributeNS(null,"offset",zi[0]),Di.setAttributeNS(null,"stop-color",zi[1]),Wi.appendChild(Di)}return this.defs.appendChild(Wi),`url(#${Vi})`;case"Mesh":return(0,_i.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${Ri[0]}`)}}setDash(Ri,Vi){this.current.dashArray=Ri,this.current.dashPhase=Vi}constructPath(Ri,Vi){const Ni=this.current;let Wi=Ni.x,zi=Ni.y,Di=[],Ui=0;for(const Hi of Ri)switch(0|Hi){case _i.OPS.rectangle:Wi=Vi[Ui++],zi=Vi[Ui++];const qi=Wi+Vi[Ui++],Gi=zi+Vi[Ui++];Di.push("M",Li(Wi),Li(zi),"L",Li(qi),Li(zi),"L",Li(qi),Li(Gi),"L",Li(Wi),Li(Gi),"Z");break;case _i.OPS.moveTo:Wi=Vi[Ui++],zi=Vi[Ui++],Di.push("M",Li(Wi),Li(zi));break;case _i.OPS.lineTo:Wi=Vi[Ui++],zi=Vi[Ui++],Di.push("L",Li(Wi),Li(zi));break;case _i.OPS.curveTo:Wi=Vi[Ui+4],zi=Vi[Ui+5],Di.push("C",Li(Vi[Ui]),Li(Vi[Ui+1]),Li(Vi[Ui+2]),Li(Vi[Ui+3]),Li(Wi),Li(zi)),Ui+=6;break;case _i.OPS.curveTo2:Di.push("C",Li(Wi),Li(zi),Li(Vi[Ui]),Li(Vi[Ui+1]),Li(Vi[Ui+2]),Li(Vi[Ui+3])),Wi=Vi[Ui+2],zi=Vi[Ui+3],Ui+=4;break;case _i.OPS.curveTo3:Wi=Vi[Ui+2],zi=Vi[Ui+3],Di.push("C",Li(Vi[Ui]),Li(Vi[Ui+1]),Li(Wi),Li(zi),Li(Wi),Li(zi)),Ui+=4;break;case _i.OPS.closePath:Di.push("Z")}Di=Di.join(" "),Ni.path&&Ri.length>0&&Ri[0]!==_i.OPS.rectangle&&Ri[0]!==_i.OPS.moveTo?Di=Ni.path.getAttributeNS(null,"d")+Di:(Ni.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().appendChild(Ni.path)),Ni.path.setAttributeNS(null,"d",Di),Ni.path.setAttributeNS(null,"fill","none"),Ni.element=Ni.path,Ni.setCurrentPoint(Wi,zi)}endPath(){const Ri=this.current;if(Ri.path=null,!this.pendingClip)return;if(!Ri.element){this.pendingClip=null;return}const Vi="clippath"+Mi++,Ni=this.svgFactory.createElement("svg:clipPath");Ni.setAttributeNS(null,"id",Vi),Ni.setAttributeNS(null,"transform",Ii(this.transformMatrix));const Wi=Ri.element.cloneNode(!0);if(this.pendingClip==="evenodd"?Wi.setAttributeNS(null,"clip-rule","evenodd"):Wi.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,Ni.appendChild(Wi),this.defs.appendChild(Ni),Ri.activeClipUrl){Ri.clipGroup=null;for(const zi of this.extraStack)zi.clipGroup=null;Ni.setAttributeNS(null,"clip-path",Ri.activeClipUrl)}Ri.activeClipUrl=`url(#${Vi})`,this.tgrp=null}clip(Ri){this.pendingClip=Ri}closePath(){const Ri=this.current;if(Ri.path){const Vi=`${Ri.path.getAttributeNS(null,"d")}Z`;Ri.path.setAttributeNS(null,"d",Vi)}}setLeading(Ri){this.current.leading=-Ri}setTextRise(Ri){this.current.textRise=Ri}setTextRenderingMode(Ri){this.current.textRenderingMode=Ri}setHScale(Ri){this.current.textHScale=Ri/100}setRenderingIntent(Ri){}setFlatness(Ri){}setGState(Ri){for(const[Vi,Ni]of Ri)switch(Vi){case"LW":this.setLineWidth(Ni);break;case"LC":this.setLineCap(Ni);break;case"LJ":this.setLineJoin(Ni);break;case"ML":this.setMiterLimit(Ni);break;case"D":this.setDash(Ni[0],Ni[1]);break;case"RI":this.setRenderingIntent(Ni);break;case"FL":this.setFlatness(Ni);break;case"Font":this.setFont(Ni);break;case"CA":this.setStrokeAlpha(Ni);break;case"ca":this.setFillAlpha(Ni);break;default:(0,_i.warn)(`Unimplemented graphic state operator ${Vi}`)}}fill(){const Ri=this.current;Ri.element&&(Ri.element.setAttributeNS(null,"fill",Ri.fillColor),Ri.element.setAttributeNS(null,"fill-opacity",Ri.fillAlpha),this.endPath())}stroke(){const Ri=this.current;Ri.element&&(this._setStrokeAttributes(Ri.element),Ri.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(Ri,Vi=1){const Ni=this.current;let Wi=Ni.dashArray;Vi!==1&&Wi.length>0&&(Wi=Wi.map(function(zi){return Vi*zi})),Ri.setAttributeNS(null,"stroke",Ni.strokeColor),Ri.setAttributeNS(null,"stroke-opacity",Ni.strokeAlpha),Ri.setAttributeNS(null,"stroke-miterlimit",Li(Ni.miterLimit)),Ri.setAttributeNS(null,"stroke-linecap",Ni.lineCap),Ri.setAttributeNS(null,"stroke-linejoin",Ni.lineJoin),Ri.setAttributeNS(null,"stroke-width",Li(Vi*Ni.lineWidth)+"px"),Ri.setAttributeNS(null,"stroke-dasharray",Wi.map(Li).join(" ")),Ri.setAttributeNS(null,"stroke-dashoffset",Li(Vi*Ni.dashPhase)+"px")}eoFill(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const Ri=this.svgFactory.createElement("svg:rect");Ri.setAttributeNS(null,"x","0"),Ri.setAttributeNS(null,"y","0"),Ri.setAttributeNS(null,"width","1px"),Ri.setAttributeNS(null,"height","1px"),Ri.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().appendChild(Ri)}paintImageXObject(Ri){const Vi=Ri.startsWith("g_")?this.commonObjs.get(Ri):this.objs.get(Ri);Vi?this.paintInlineImageXObject(Vi):(0,_i.warn)(`Dependent image with object ID ${Ri} is not ready yet`)}paintInlineImageXObject(Ri,Vi){const Ni=Ri.width,Wi=Ri.height,zi=Ti(Ri,this.forceDataSchema,!!Vi),Di=this.svgFactory.createElement("svg:rect");Di.setAttributeNS(null,"x","0"),Di.setAttributeNS(null,"y","0"),Di.setAttributeNS(null,"width",Li(Ni)),Di.setAttributeNS(null,"height",Li(Wi)),this.current.element=Di,this.clip("nonzero");const Ui=this.svgFactory.createElement("svg:image");Ui.setAttributeNS(wi,"xlink:href",zi),Ui.setAttributeNS(null,"x","0"),Ui.setAttributeNS(null,"y",Li(-Wi)),Ui.setAttributeNS(null,"width",Li(Ni)+"px"),Ui.setAttributeNS(null,"height",Li(Wi)+"px"),Ui.setAttributeNS(null,"transform",`scale(${Li(1/Ni)} ${Li(-1/Wi)})`),Vi?Vi.appendChild(Ui):this._ensureTransformGroup().appendChild(Ui)}paintImageMaskXObject(Ri){const Vi=this.current,Ni=Ri.width,Wi=Ri.height,zi=Vi.fillColor;Vi.maskId="mask"+Fi++;const Di=this.svgFactory.createElement("svg:mask");Di.setAttributeNS(null,"id",Vi.maskId);const Ui=this.svgFactory.createElement("svg:rect");Ui.setAttributeNS(null,"x","0"),Ui.setAttributeNS(null,"y","0"),Ui.setAttributeNS(null,"width",Li(Ni)),Ui.setAttributeNS(null,"height",Li(Wi)),Ui.setAttributeNS(null,"fill",zi),Ui.setAttributeNS(null,"mask",`url(#${Vi.maskId})`),this.defs.appendChild(Di),this._ensureTransformGroup().appendChild(Ui),this.paintInlineImageXObject(Ri,Di)}paintFormXObjectBegin(Ri,Vi){if(Array.isArray(Ri)&&Ri.length===6&&this.transform(Ri[0],Ri[1],Ri[2],Ri[3],Ri[4],Ri[5]),Vi){const Ni=Vi[2]-Vi[0],Wi=Vi[3]-Vi[1],zi=this.svgFactory.createElement("svg:rect");zi.setAttributeNS(null,"x",Vi[0]),zi.setAttributeNS(null,"y",Vi[1]),zi.setAttributeNS(null,"width",Li(Ni)),zi.setAttributeNS(null,"height",Li(Wi)),this.current.element=zi,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(Ri){const Vi=this.svgFactory.create(Ri.width,Ri.height),Ni=this.svgFactory.createElement("svg:defs");Vi.appendChild(Ni),this.defs=Ni;const Wi=this.svgFactory.createElement("svg:g");return Wi.setAttributeNS(null,"transform",Ii(Ri.transform)),Vi.appendChild(Wi),this.svg=Wi,Vi}_ensureClipGroup(){if(!this.current.clipGroup){const Ri=this.svgFactory.createElement("svg:g");Ri.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.appendChild(Ri),this.current.clipGroup=Ri}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",Ii(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().appendChild(this.tgrp):this.svg.appendChild(this.tgrp)),this.tgrp}}}},(yi,vi,bi)=>{Object.defineProperty(vi,"__esModule",{value:!0}),vi.PDFNodeStream=void 0;var _i=bi(1),$i=bi(24);const Pi=require$$5,Ai=require$$5,Si=require$$5,Ei=require$$5,wi=/^file:\/\/\/[a-zA-Z]:\//;vi.PDFNodeStream=class{constructor(Ii){this.source=Ii,this.url=function(Mi){const Fi=Ei.parse(Mi);return Fi.protocol==="file:"||Fi.host?Fi:/^[a-z]:[/\\]/i.test(Mi)?Ei.parse(`file:///${Mi}`):(Fi.host||(Fi.protocol="file:"),Fi)}(Ii.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&Ii.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var Ii,Mi;return(Mi=(Ii=this._fullRequestReader)==null?void 0:Ii._loaded)!=null?Mi:0}getFullReader(){return(0,_i.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new ji(this):new Ti(this),this._fullRequestReader}getRangeReader(Ii,Mi){if(Mi<=this._progressiveDataLength)return null;const Fi=this.isFsUrl?new Li(this,Ii,Mi):new Oi(this,Ii,Mi);return this._rangeRequestReaders.push(Fi),Fi}cancelAllRequests(Ii){this._fullRequestReader&&this._fullRequestReader.cancel(Ii);for(const Mi of this._rangeRequestReaders.slice(0))Mi.cancel(Ii)}};class Ci{constructor(Mi){this._url=Mi.url,this._done=!1,this._storedError=null,this.onProgress=null;const Fi=Mi.source;this._contentLength=Fi.length,this._loaded=0,this._filename=null,this._disableRange=Fi.disableRange||!1,this._rangeChunkSize=Fi.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!Fi.disableStream,this._isRangeSupported=!Fi.disableRange,this._readableStream=null,this._readCapability=(0,_i.createPromiseCapability)(),this._headersCapability=(0,_i.createPromiseCapability)()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const Mi=this._readableStream.read();return Mi===null?(this._readCapability=(0,_i.createPromiseCapability)(),this.read()):(this._loaded+=Mi.length,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(Mi).buffer,done:!1})}cancel(Mi){this._readableStream?this._readableStream.destroy(Mi):this._error(Mi)}_error(Mi){this._storedError=Mi,this._readCapability.resolve()}_setReadableStream(Mi){this._readableStream=Mi,Mi.on("readable",()=>{this._readCapability.resolve()}),Mi.on("end",()=>{Mi.destroy(),this._done=!0,this._readCapability.resolve()}),Mi.on("error",Fi=>{this._error(Fi)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new _i.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class ki{constructor(Mi){this._url=Mi.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=(0,_i.createPromiseCapability)();const Fi=Mi.source;this._isStreamingSupported=!Fi.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const Mi=this._readableStream.read();return Mi===null?(this._readCapability=(0,_i.createPromiseCapability)(),this.read()):(this._loaded+=Mi.length,this.onProgress&&this.onProgress({loaded:this._loaded}),{value:new Uint8Array(Mi).buffer,done:!1})}cancel(Mi){this._readableStream?this._readableStream.destroy(Mi):this._error(Mi)}_error(Mi){this._storedError=Mi,this._readCapability.resolve()}_setReadableStream(Mi){this._readableStream=Mi,Mi.on("readable",()=>{this._readCapability.resolve()}),Mi.on("end",()=>{Mi.destroy(),this._done=!0,this._readCapability.resolve()}),Mi.on("error",Fi=>{this._error(Fi)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function xi(Ii,Mi){return{protocol:Ii.protocol,auth:Ii.auth,host:Ii.hostname,port:Ii.port,path:Ii.path,method:"GET",headers:Mi}}class Ti extends Ci{constructor(Mi){super(Mi);const Fi=Bi=>{if(Bi.statusCode===404){const Wi=new _i.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=Wi,this._headersCapability.reject(Wi);return}this._headersCapability.resolve(),this._setReadableStream(Bi);const Ri=Wi=>this._readableStream.headers[Wi.toLowerCase()],{allowRangeRequests:Vi,suggestedLength:Ni}=(0,$i.validateRangeRequestCapabilities)({getResponseHeader:Ri,isHttp:Mi.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=Vi,this._contentLength=Ni||this._contentLength,this._filename=(0,$i.extractFilenameFromHeader)(Ri)};this._request=null,this._url.protocol==="http:"?this._request=Ai.request(xi(this._url,Mi.httpHeaders),Fi):this._request=Si.request(xi(this._url,Mi.httpHeaders),Fi),this._request.on("error",Bi=>{this._storedError=Bi,this._headersCapability.reject(Bi)}),this._request.end()}}class Oi extends ki{constructor(Mi,Fi,Bi){super(Mi),this._httpHeaders={};for(const Vi in Mi.httpHeaders){const Ni=Mi.httpHeaders[Vi];Ni!==void 0&&(this._httpHeaders[Vi]=Ni)}this._httpHeaders.Range=`bytes=${Fi}-${Bi-1}`;const Ri=Vi=>{if(Vi.statusCode!==404)this._setReadableStream(Vi);else{const Ni=new _i.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=Ni}};this._request=null,this._url.protocol==="http:"?this._request=Ai.request(xi(this._url,this._httpHeaders),Ri):this._request=Si.request(xi(this._url,this._httpHeaders),Ri),this._request.on("error",Vi=>{this._storedError=Vi}),this._request.end()}}class ji extends Ci{constructor(Mi){super(Mi);let Fi=decodeURIComponent(this._url.path);wi.test(this._url.href)&&(Fi=Fi.replace(/^\//,"")),Pi.lstat(Fi,(Bi,Ri)=>{Bi?(Bi.code==="ENOENT"&&(Bi=new _i.MissingPDFException(`Missing PDF "${Fi}".`)),this._storedError=Bi,this._headersCapability.reject(Bi)):(this._contentLength=Ri.size,this._setReadableStream(Pi.createReadStream(Fi)),this._headersCapability.resolve())})}}class Li extends ki{constructor(Mi,Fi,Bi){super(Mi);let Ri=decodeURIComponent(this._url.path);wi.test(this._url.href)&&(Ri=Ri.replace(/^\//,"")),this._setReadableStream(Pi.createReadStream(Ri,{start:Fi,end:Bi-1}))}}},(yi,vi,bi)=>{Object.defineProperty(vi,"__esModule",{value:!0}),vi.createResponseStatusError=function(Ai,Si){return Ai===404||Ai===0&&Si.startsWith("file:")?new _i.MissingPDFException('Missing PDF "'+Si+'".'):new _i.UnexpectedResponseException(`Unexpected server response (${Ai}) while retrieving PDF "${Si}".`,Ai)},vi.extractFilenameFromHeader=function(Ai){const Si=Ai("Content-Disposition");if(Si){let Ei=(0,$i.getFilenameFromContentDispositionHeader)(Si);if(Ei.includes("%"))try{Ei=decodeURIComponent(Ei)}catch{}if((0,Pi.isPdfFile)(Ei))return Ei}return null},vi.validateRangeRequestCapabilities=function({getResponseHeader:Ai,isHttp:Si,rangeChunkSize:Ei,disableRange:wi}){(0,_i.assert)(Ei>0,"Range chunk size must be larger than zero");const Ci={allowRangeRequests:!1,suggestedLength:void 0},ki=parseInt(Ai("Content-Length"),10);return!Number.isInteger(ki)||(Ci.suggestedLength=ki,ki<=2*Ei)||wi||!Si||Ai("Accept-Ranges")!=="bytes"||(Ai("Content-Encoding")||"identity")!=="identity"||(Ci.allowRangeRequests=!0),Ci},vi.validateResponseStatus=function(Ai){return Ai===200||Ai===206};var _i=bi(1),$i=bi(25),Pi=bi(5)},(yi,vi,bi)=>{Object.defineProperty(vi,"__esModule",{value:!0}),vi.getFilenameFromContentDispositionHeader=function($i){let Pi=!0,Ai=Si("filename\\*","i").exec($i);if(Ai){Ai=Ai[1];let Ti=Ci(Ai);return Ti=unescape(Ti),Ti=ki(Ti),Ti=xi(Ti),wi(Ti)}if(Ai=function(Ti){const Oi=[];let ji;const Li=Si("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(ji=Li.exec(Ti))!==null;){let[,Mi,Fi,Bi]=ji;if(Mi=parseInt(Mi,10),Mi in Oi){if(Mi===0)break}else Oi[Mi]=[Fi,Bi]}const Ii=[];for(let Mi=0;Mi{Object.defineProperty(vi,"__esModule",{value:!0}),vi.PDFNetworkStream=void 0;var _i=bi(1),$i=bi(24);class Pi{constructor(wi,Ci={}){this.url=wi,this.isHttp=/^https?:/i.test(wi),this.httpHeaders=this.isHttp&&Ci.httpHeaders||Object.create(null),this.withCredentials=Ci.withCredentials||!1,this.getXhr=Ci.getXhr||function(){return new XMLHttpRequest},this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(wi,Ci,ki){const xi={begin:wi,end:Ci};for(const Ti in ki)xi[Ti]=ki[Ti];return this.request(xi)}requestFull(wi){return this.request(wi)}request(wi){const Ci=this.getXhr(),ki=this.currXhrId++,xi=this.pendingRequests[ki]={xhr:Ci};Ci.open("GET",this.url),Ci.withCredentials=this.withCredentials;for(const Ti in this.httpHeaders){const Oi=this.httpHeaders[Ti];Oi!==void 0&&Ci.setRequestHeader(Ti,Oi)}return this.isHttp&&"begin"in wi&&"end"in wi?(Ci.setRequestHeader("Range",`bytes=${wi.begin}-${wi.end-1}`),xi.expectedStatus=206):xi.expectedStatus=200,Ci.responseType="arraybuffer",wi.onError&&(Ci.onerror=function(Ti){wi.onError(Ci.status)}),Ci.onreadystatechange=this.onStateChange.bind(this,ki),Ci.onprogress=this.onProgress.bind(this,ki),xi.onHeadersReceived=wi.onHeadersReceived,xi.onDone=wi.onDone,xi.onError=wi.onError,xi.onProgress=wi.onProgress,Ci.send(null),ki}onProgress(wi,Ci){var xi;const ki=this.pendingRequests[wi];ki&&((xi=ki.onProgress)==null||xi.call(ki,Ci))}onStateChange(wi,Ci){var ji,Li,Ii;const ki=this.pendingRequests[wi];if(!ki)return;const xi=ki.xhr;if(xi.readyState>=2&&ki.onHeadersReceived&&(ki.onHeadersReceived(),delete ki.onHeadersReceived),xi.readyState!==4||!(wi in this.pendingRequests))return;if(delete this.pendingRequests[wi],xi.status===0&&this.isHttp){(ji=ki.onError)==null||ji.call(ki,xi.status);return}const Ti=xi.status||200;if(!(Ti===200&&ki.expectedStatus===206)&&Ti!==ki.expectedStatus){(Li=ki.onError)==null||Li.call(ki,xi.status);return}const Oi=function(Mi){const Fi=Mi.response;return typeof Fi!="string"?Fi:(0,_i.stringToBytes)(Fi).buffer}(xi);if(Ti===206){const Mi=xi.getResponseHeader("Content-Range"),Fi=/bytes (\d+)-(\d+)\/(\d+)/.exec(Mi);ki.onDone({begin:parseInt(Fi[1],10),chunk:Oi})}else Oi?ki.onDone({begin:0,chunk:Oi}):(Ii=ki.onError)==null||Ii.call(ki,xi.status)}getRequestXhr(wi){return this.pendingRequests[wi].xhr}isPendingRequest(wi){return wi in this.pendingRequests}abortRequest(wi){const Ci=this.pendingRequests[wi].xhr;delete this.pendingRequests[wi],Ci.abort()}}vi.PDFNetworkStream=class{constructor(Ei){this._source=Ei,this._manager=new Pi(Ei.url,{httpHeaders:Ei.httpHeaders,withCredentials:Ei.withCredentials}),this._rangeChunkSize=Ei.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(Ei){const wi=this._rangeRequestReaders.indexOf(Ei);wi>=0&&this._rangeRequestReaders.splice(wi,1)}getFullReader(){return(0,_i.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new Ai(this._manager,this._source),this._fullRequestReader}getRangeReader(Ei,wi,Ci=""){const ki=new Si(this._manager,Ei,wi);return ki.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(ki),ki}cancelAllRequests(Ei){var wi;(wi=this._fullRequestReader)==null||wi.cancel(Ei);for(const Ci of this._rangeRequestReaders.slice(0))Ci.cancel(Ei)}};class Ai{constructor(wi,Ci){this._manager=wi;const ki={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=Ci.url,this._fullRequestId=wi.requestFull(ki),this._headersReceivedCapability=(0,_i.createPromiseCapability)(),this._disableRange=Ci.disableRange||!1,this._contentLength=Ci.length,this._rangeChunkSize=Ci.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const wi=this._fullRequestId,Ci=this._manager.getRequestXhr(wi),ki=Oi=>Ci.getResponseHeader(Oi),{allowRangeRequests:xi,suggestedLength:Ti}=(0,$i.validateRangeRequestCapabilities)({getResponseHeader:ki,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});xi&&(this._isRangeSupported=!0),this._contentLength=Ti||this._contentLength,this._filename=(0,$i.extractFilenameFromHeader)(ki),this._isRangeSupported&&this._manager.abortRequest(wi),this._headersReceivedCapability.resolve()}_onDone(wi){if(wi&&(this._requests.length>0?this._requests.shift().resolve({value:wi.chunk,done:!1}):this._cachedChunks.push(wi.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const Ci of this._requests)Ci.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(wi){this._storedError=(0,$i.createResponseStatusError)(wi,this._url),this._headersReceivedCapability.reject(this._storedError);for(const Ci of this._requests)Ci.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(wi){var Ci;(Ci=this.onProgress)==null||Ci.call(this,{loaded:wi.loaded,total:wi.lengthComputable?wi.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const wi=(0,_i.createPromiseCapability)();return this._requests.push(wi),wi.promise}cancel(wi){this._done=!0,this._headersReceivedCapability.reject(wi);for(const Ci of this._requests)Ci.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class Si{constructor(wi,Ci,ki){this._manager=wi;const xi={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=wi.url,this._requestId=wi.requestRange(Ci,ki,xi),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var wi;(wi=this.onClosed)==null||wi.call(this,this)}_onDone(wi){const Ci=wi.chunk;this._requests.length>0?this._requests.shift().resolve({value:Ci,done:!1}):this._queuedChunk=Ci,this._done=!0;for(const ki of this._requests)ki.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(wi){this._storedError=(0,$i.createResponseStatusError)(wi,this._url);for(const Ci of this._requests)Ci.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(wi){var Ci;this.isStreamingSupported||((Ci=this.onProgress)==null||Ci.call(this,{loaded:wi.loaded}))}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const Ci=this._queuedChunk;return this._queuedChunk=null,{value:Ci,done:!1}}if(this._done)return{value:void 0,done:!0};const wi=(0,_i.createPromiseCapability)();return this._requests.push(wi),wi.promise}cancel(wi){this._done=!0;for(const Ci of this._requests)Ci.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(yi,vi,bi)=>{Object.defineProperty(vi,"__esModule",{value:!0}),vi.PDFFetchStream=void 0;var _i=bi(1),$i=bi(24);function Pi(wi,Ci,ki,xi="GET"){return{method:xi,headers:wi,signal:ki==null?void 0:ki.signal,mode:"cors",credentials:Ci?"include":"same-origin",redirect:"follow"}}function Ai(wi){const Ci=new Headers;for(const ki in wi){const xi=wi[ki];xi!==void 0&&Ci.append(ki,xi)}return Ci}vi.PDFFetchStream=class{constructor(wi){this.source=wi,this.isHttp=/^https?:/i.test(wi.url),this.httpHeaders=this.isHttp&&wi.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var wi,Ci;return(Ci=(wi=this._fullRequestReader)==null?void 0:wi._loaded)!=null?Ci:0}getFullReader(){return(0,_i.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new Si(this),this._fullRequestReader}getRangeReader(wi,Ci,ki=""){if(Ci<=this._progressiveDataLength)return null;const xi=new Ei(this,wi,Ci,ki);return this._rangeRequestReaders.push(xi),xi}cancelAllRequests(wi){this._fullRequestReader&&this._fullRequestReader.cancel(wi);for(const Ci of this._rangeRequestReaders.slice(0))Ci.cancel(wi)}};class Si{constructor(Ci){this._stream=Ci,this._reader=null,this._loaded=0,this._filename=null;const ki=Ci.source;this._withCredentials=ki.withCredentials||!1,this._contentLength=ki.length,this._headersCapability=(0,_i.createPromiseCapability)(),this._disableRange=ki.disableRange||!1,this._rangeChunkSize=ki.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),typeof AbortController<"u"&&(this._abortController=new AbortController),this._isStreamingSupported=!ki.disableStream,this._isRangeSupported=!ki.disableRange,this._headers=Ai(this._stream.httpHeaders);const xi=ki.url,Ti=ki.streamHttpMethod||"GET";fetch(xi,Pi(this._headers,this._withCredentials,this._abortController,Ti)).then(Oi=>{if(Oi.redirected&&(Ci.source.url=Oi.url),!(0,$i.validateResponseStatus)(Oi.status))throw(0,$i.createResponseStatusError)(Oi.status,xi);this._reader=Oi.body.getReader(),this._headersCapability.resolve();const ji=Mi=>Oi.headers.get(Mi),{allowRangeRequests:Li,suggestedLength:Ii}=(0,$i.validateRangeRequestCapabilities)({getResponseHeader:ji,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=Li,this._contentLength=Ii||this._contentLength,this._filename=(0,$i.extractFilenameFromHeader)(ji),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new _i.AbortException("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:Ci,done:ki}=await this._reader.read();return ki?{value:Ci,done:ki}:(this._loaded+=Ci.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(Ci).buffer,done:!1})}cancel(Ci){this._reader&&this._reader.cancel(Ci),this._abortController&&this._abortController.abort()}}class Ei{constructor(Ci,ki,xi,Ti=""){this._stream=Ci,this._reader=null,this._loaded=0;const Oi=Ci.source;this._withCredentials=Oi.withCredentials||!1,this._readCapability=(0,_i.createPromiseCapability)(),this._isStreamingSupported=!Oi.disableStream,typeof AbortController<"u"&&(this._abortController=new AbortController),this._headers=Ai(this._stream.httpHeaders),this._headers.append("Range",`bytes=${ki}-${xi-1}`);let ji=Oi.url;if(Oi.inspectFetchUrl&&Ti){const Li={causedBy:`${Ti}:${this._headers.get("range")}`};ji=(0,_i.addParamsToUrl)(ji,Li)}fetch(ji,Pi(this._headers,this._withCredentials,this._abortController)).then(Li=>{if(!(0,$i.validateResponseStatus)(Li.status))throw(0,$i.createResponseStatusError)(Li.status,ji);this._readCapability.resolve(),this._reader=Li.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:Ci,done:ki}=await this._reader.read();return ki?{value:Ci,done:ki}:(this._loaded+=Ci.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded}),{value:new Uint8Array(Ci).buffer,done:!1})}cancel(Ci){this._reader&&this._reader.cancel(Ci),this._abortController&&this._abortController.abort()}}}],__webpack_module_cache__={};function __w_pdfjs_require__(yi){var vi=__webpack_module_cache__[yi];if(vi!==void 0)return vi.exports;var bi=__webpack_module_cache__[yi]={exports:{}};return __webpack_modules__[yi](bi,bi.exports,__w_pdfjs_require__),bi.exports}var __webpack_exports__={};return(()=>{var yi=__webpack_exports__;Object.defineProperty(yi,"__esModule",{value:!0}),Object.defineProperty(yi,"AnnotationLayer",{enumerable:!0,get:function(){return $i.AnnotationLayer}}),Object.defineProperty(yi,"AnnotationMode",{enumerable:!0,get:function(){return vi.AnnotationMode}}),Object.defineProperty(yi,"CMapCompressionType",{enumerable:!0,get:function(){return vi.CMapCompressionType}}),Object.defineProperty(yi,"GlobalWorkerOptions",{enumerable:!0,get:function(){return Pi.GlobalWorkerOptions}}),Object.defineProperty(yi,"InvalidPDFException",{enumerable:!0,get:function(){return vi.InvalidPDFException}}),Object.defineProperty(yi,"LoopbackPort",{enumerable:!0,get:function(){return bi.LoopbackPort}}),Object.defineProperty(yi,"MissingPDFException",{enumerable:!0,get:function(){return vi.MissingPDFException}}),Object.defineProperty(yi,"OPS",{enumerable:!0,get:function(){return vi.OPS}}),Object.defineProperty(yi,"PDFDataRangeTransport",{enumerable:!0,get:function(){return bi.PDFDataRangeTransport}}),Object.defineProperty(yi,"PDFDateString",{enumerable:!0,get:function(){return _i.PDFDateString}}),Object.defineProperty(yi,"PDFDocumentLoadingTask",{enumerable:!0,get:function(){return bi.PDFDocumentLoadingTask}}),Object.defineProperty(yi,"PDFDocumentProxy",{enumerable:!0,get:function(){return bi.PDFDocumentProxy}}),Object.defineProperty(yi,"PDFPageProxy",{enumerable:!0,get:function(){return bi.PDFPageProxy}}),Object.defineProperty(yi,"PDFWorker",{enumerable:!0,get:function(){return bi.PDFWorker}}),Object.defineProperty(yi,"PasswordResponses",{enumerable:!0,get:function(){return vi.PasswordResponses}}),Object.defineProperty(yi,"PermissionFlag",{enumerable:!0,get:function(){return vi.PermissionFlag}}),Object.defineProperty(yi,"PixelsPerInch",{enumerable:!0,get:function(){return _i.PixelsPerInch}}),Object.defineProperty(yi,"RenderingCancelledException",{enumerable:!0,get:function(){return _i.RenderingCancelledException}}),Object.defineProperty(yi,"SVGGraphics",{enumerable:!0,get:function(){return Ei.SVGGraphics}}),Object.defineProperty(yi,"UNSUPPORTED_FEATURES",{enumerable:!0,get:function(){return vi.UNSUPPORTED_FEATURES}}),Object.defineProperty(yi,"UnexpectedResponseException",{enumerable:!0,get:function(){return vi.UnexpectedResponseException}}),Object.defineProperty(yi,"Util",{enumerable:!0,get:function(){return vi.Util}}),Object.defineProperty(yi,"VerbosityLevel",{enumerable:!0,get:function(){return vi.VerbosityLevel}}),Object.defineProperty(yi,"WorkerTransport",{enumerable:!0,get:function(){return bi.WorkerTransport}}),Object.defineProperty(yi,"XfaLayer",{enumerable:!0,get:function(){return wi.XfaLayer}}),Object.defineProperty(yi,"build",{enumerable:!0,get:function(){return bi.build}}),Object.defineProperty(yi,"createPromiseCapability",{enumerable:!0,get:function(){return vi.createPromiseCapability}}),Object.defineProperty(yi,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return vi.createValidAbsoluteUrl}}),Object.defineProperty(yi,"getDocument",{enumerable:!0,get:function(){return bi.getDocument}}),Object.defineProperty(yi,"getFilenameFromUrl",{enumerable:!0,get:function(){return _i.getFilenameFromUrl}}),Object.defineProperty(yi,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return _i.getPdfFilenameFromUrl}}),Object.defineProperty(yi,"getXfaPageViewport",{enumerable:!0,get:function(){return _i.getXfaPageViewport}}),Object.defineProperty(yi,"isPdfFile",{enumerable:!0,get:function(){return _i.isPdfFile}}),Object.defineProperty(yi,"loadScript",{enumerable:!0,get:function(){return _i.loadScript}}),Object.defineProperty(yi,"renderTextLayer",{enumerable:!0,get:function(){return Si.renderTextLayer}}),Object.defineProperty(yi,"shadow",{enumerable:!0,get:function(){return vi.shadow}}),Object.defineProperty(yi,"version",{enumerable:!0,get:function(){return bi.version}}),Object.defineProperty(yi,"warn",{enumerable:!0,get:function(){return vi.warn}});var vi=__w_pdfjs_require__(1),bi=__w_pdfjs_require__(4),_i=__w_pdfjs_require__(5),$i=__w_pdfjs_require__(18),Pi=__w_pdfjs_require__(12),Ai=__w_pdfjs_require__(3),Si=__w_pdfjs_require__(21),Ei=__w_pdfjs_require__(22),wi=__w_pdfjs_require__(20);if(Ai.isNodeJS){const{PDFNodeStream:Ci}=__w_pdfjs_require__(23);(0,bi.setPDFNetworkStreamFactory)(ki=>new Ci(ki))}else{const{PDFNetworkStream:Ci}=__w_pdfjs_require__(26),{PDFFetchStream:ki}=__w_pdfjs_require__(27);(0,bi.setPDFNetworkStreamFactory)(xi=>(0,_i.isValidFetchUrl)(xi.url)?new ki(xi):new Ci(xi))}})(),__webpack_exports__})())}(pdf)),pdfExports$1}(function(yi,vi){(function(bi,_i){yi.exports=_i()})(commonjsGlobal,()=>(()=>{var bi=[,(Ai,Si)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.animationStarted=Si.VERTICAL_PADDING=Si.UNKNOWN_SCALE=Si.TextLayerMode=Si.SpreadMode=Si.SidebarView=Si.ScrollMode=Si.SCROLLBAR_PADDING=Si.RenderingStates=Si.RendererType=Si.ProgressBar=Si.PresentationModeState=Si.OutputScale=Si.MIN_SCALE=Si.MAX_SCALE=Si.MAX_AUTO_SCALE=Si.DEFAULT_SCALE_VALUE=Si.DEFAULT_SCALE_DELTA=Si.DEFAULT_SCALE=Si.AutoPrintRegExp=void 0,Si.apiPageLayoutToViewerModes=function(Ii){let Mi=wi.VERTICAL,Fi=Ci.NONE;switch(Ii){case"SinglePage":Mi=wi.PAGE;break;case"OneColumn":break;case"TwoPageLeft":Mi=wi.PAGE;case"TwoColumnLeft":Fi=Ci.ODD;break;case"TwoPageRight":Mi=wi.PAGE;case"TwoColumnRight":Fi=Ci.EVEN}return{scrollMode:Mi,spreadMode:Fi}},Si.apiPageModeToSidebarView=function(Ii){switch(Ii){case"UseNone":return Ei.NONE;case"UseThumbs":return Ei.THUMBS;case"UseOutlines":return Ei.OUTLINE;case"UseAttachments":return Ei.ATTACHMENTS;case"UseOC":return Ei.LAYERS}return Ei.NONE},Si.approximateFraction=function(Ii){if(Math.floor(Ii)===Ii)return[Ii,1];const Mi=1/Ii;if(Mi>8)return[1,8];if(Math.floor(Mi)===Mi)return[1,Mi];const Fi=Ii>1?Mi:Ii;let Bi,Ri=0,Vi=1,Ni=1,Wi=1;for(;;){const zi=Ri+Ni,Di=Vi+Wi;if(Di>8)break;Fi<=zi/Di?(Ni=zi,Wi=Di):(Ri=zi,Vi=Di)}return Bi=Fi-Ri/ViWi}:function(Xi){const rr=Xi.div;return rr.offsetTop+rr.clientTop+rr.clientHeight>Vi});qi>0&&qi=Ni&&(Gi=Yi);else if((Bi?gr:fr)>Gi)break;if(Yi<=Vi||fr>=Ni||vr<=Wi||gr>=zi)continue;const nr=Math.max(0,Vi-fr)+Math.max(0,Yi-Ni),ir=(lr-(Math.max(0,Wi-gr)+Math.max(0,vr-zi)))/lr,cr=(mr-nr)/mr*ir*100|0;Di.push({id:rr.id,x:gr,y:fr,view:rr,percent:cr,widthPercent:100*ir|0}),Ui.add(rr.id)}const Ki=Di[0],Qi=Di[Di.length-1];return Fi&&Di.sort(function(Xi,rr){const ar=Xi.percent-rr.percent;return Math.abs(ar)>.001?-ar:Xi.id-rr.id}),{first:Ki,last:Qi,views:Di,ids:Ui}},Si.isPortraitOrientation=function(Ii){return Ii.width<=Ii.height},Si.isValidRotation=function(Ii){return Number.isInteger(Ii)&&Ii%90==0},Si.isValidScrollMode=function(Ii){return Number.isInteger(Ii)&&Object.values(wi).includes(Ii)&&Ii!==wi.UNKNOWN},Si.isValidSpreadMode=function(Ii){return Number.isInteger(Ii)&&Object.values(Ci).includes(Ii)&&Ii!==Ci.UNKNOWN},Si.noContextMenuHandler=function(Ii){Ii.preventDefault()},Si.normalizeWheelEventDelta=function(Ii){let Mi=ji(Ii);return Ii.deltaMode===0?Mi/=900:Ii.deltaMode===1&&(Mi/=30),Mi},Si.normalizeWheelEventDirection=ji,Si.parseQueryString=function(Ii){const Mi=new Map;for(const[Fi,Bi]of new URLSearchParams(Ii))Mi.set(Fi.toLowerCase(),Bi);return Mi},Si.removeNullCharacters=function(Ii,Mi=!1){return typeof Ii!="string"?Ii:(Mi&&(Ii=Ii.replace(xi," ")),Ii.replace(ki,""))},Si.roundToDivide=function(Ii,Mi){const Fi=Ii%Mi;return Fi===0?Ii:Math.round(Ii-Fi+Mi)},Si.scrollIntoView=function(Ii,Mi,Fi=!1){let Bi=Ii.offsetParent;if(!Bi)return;let Ri=Ii.offsetTop+Ii.clientTop,Vi=Ii.offsetLeft+Ii.clientLeft;for(;Bi.clientHeight===Bi.scrollHeight&&Bi.clientWidth===Bi.scrollWidth||Fi&&(Bi.classList.contains("markedContent")||getComputedStyle(Bi).overflow==="hidden");)if(Ri+=Bi.offsetTop,Vi+=Bi.offsetLeft,Bi=Bi.offsetParent,!Bi)return;Mi&&(Mi.top!==void 0&&(Ri+=Mi.top),Mi.left!==void 0&&(Vi+=Mi.left,Bi.scrollLeft=Vi)),Bi.scrollTop=Ri},Si.watchScroll=function(Ii,Mi){const Fi=function(Vi){Ri||(Ri=window.requestAnimationFrame(function(){Ri=null;const Ni=Ii.scrollLeft,Wi=Bi.lastX;Ni!==Wi&&(Bi.right=Ni>Wi),Bi.lastX=Ni;const zi=Ii.scrollTop,Di=Bi.lastY;zi!==Di&&(Bi.down=zi>Di),Bi.lastY=zi,Mi(Bi)}))},Bi={right:!0,down:!0,lastX:Ii.scrollLeft,lastY:Ii.scrollTop,_eventHandler:Fi};let Ri=null;return Ii.addEventListener("scroll",Fi,!0),Bi},Si.DEFAULT_SCALE_VALUE="auto",Si.DEFAULT_SCALE=1,Si.DEFAULT_SCALE_DELTA=1.1,Si.MIN_SCALE=.1,Si.MAX_SCALE=10,Si.UNKNOWN_SCALE=0,Si.MAX_AUTO_SCALE=1.25,Si.SCROLLBAR_PADDING=40,Si.VERTICAL_PADDING=5,Si.RenderingStates={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3},Si.PresentationModeState={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3};const Ei={UNKNOWN:-1,NONE:0,THUMBS:1,OUTLINE:2,ATTACHMENTS:3,LAYERS:4};Si.SidebarView=Ei,Si.RendererType={CANVAS:"canvas",SVG:"svg"},Si.TextLayerMode={DISABLE:0,ENABLE:1,ENABLE_ENHANCE:2};const wi={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2,PAGE:3};Si.ScrollMode=wi;const Ci={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2};Si.SpreadMode=Ci,Si.AutoPrintRegExp=/\bprint\s*\(/,Si.OutputScale=class{constructor(){const Ii=window.devicePixelRatio||1;this.sx=Ii,this.sy=Ii}get scaled(){return this.sx!==1||this.sy!==1}};const ki=/\x00/g,xi=/[\x01-\x1F]/g;function Ti(Ii,Mi,Fi=0){let Bi=Fi,Ri=Ii.length-1;if(Ri<0||!Mi(Ii[Ri]))return Ii.length;if(Mi(Ii[Bi]))return Bi;for(;Bi>1;Mi(Ii[Vi])?Ri=Vi:Bi=Vi+1}return Bi}function Oi(Ii,Mi,Fi){if(Ii<2)return Ii;let Bi=Mi[Ii].div,Ri=Bi.offsetTop+Bi.clientTop;Ri>=Fi&&(Bi=Mi[Ii-1].div,Ri=Bi.offsetTop+Bi.clientTop);for(let Vi=Ii-2;Vi>=0&&(Bi=Mi[Vi].div,!(Bi.offsetTop+Bi.clientTop+Bi.clientHeight<=Ri));--Vi)Ii=Vi;return Ii}function ji(Ii){let Mi=Math.hypot(Ii.deltaX,Ii.deltaY);const Fi=Math.atan2(Ii.deltaY,Ii.deltaX);return-.25*Math.PI0&&document.documentElement.style.setProperty("--loadingBar-end-offset",`${Mi}px`)}hide(){this.visible&&(this.visible=!1,this.bar.classList.add("hidden"))}show(){this.visible||(this.visible=!0,this.bar.classList.remove("hidden"))}}},(Ai,Si)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.WaitOnType=Si.EventBus=Si.AutomationEventBus=void 0,Si.waitOnEventOrTimeout=function({target:Ci,name:ki,delay:xi=0}){return new Promise(function(Ti,Oi){if(typeof Ci!="object"||!ki||typeof ki!="string"||!(Number.isInteger(xi)&&xi>=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");function ji(Fi){Ci instanceof wi?Ci._off(ki,Li):Ci.removeEventListener(ki,Li),Mi&&clearTimeout(Mi),Ti(Fi)}const Li=ji.bind(null,Ei.EVENT);Ci instanceof wi?Ci._on(ki,Li):Ci.addEventListener(ki,Li);const Ii=ji.bind(null,Ei.TIMEOUT),Mi=setTimeout(Ii,xi)})};const Ei={EVENT:"event",TIMEOUT:"timeout"};Si.WaitOnType=Ei;class wi{constructor(){this._listeners=Object.create(null)}on(ki,xi,Ti=null){this._on(ki,xi,{external:!0,once:Ti==null?void 0:Ti.once})}off(ki,xi,Ti=null){this._off(ki,xi,{external:!0,once:Ti==null?void 0:Ti.once})}dispatch(ki,xi){const Ti=this._listeners[ki];if(!Ti||Ti.length===0)return;let Oi;for(const{listener:ji,external:Li,once:Ii}of Ti.slice(0))Ii&&this._off(ki,ji),Li?(Oi||(Oi=[])).push(ji):ji(xi);if(Oi){for(const ji of Oi)ji(xi);Oi=null}}_on(ki,xi,Ti=null){var Oi;((Oi=this._listeners)[ki]||(Oi[ki]=[])).push({listener:xi,external:(Ti==null?void 0:Ti.external)===!0,once:(Ti==null?void 0:Ti.once)===!0})}_off(ki,xi,Ti=null){const Oi=this._listeners[ki];if(Oi){for(let ji=0,Li=Oi.length;ji{Object.defineProperty(Si,"__esModule",{value:!0}),Si.compatibilityParams=Si.OptionKind=Si.AppOptions=void 0;const Ei=Object.create(null);Si.compatibilityParams=Ei;{const ki=navigator.userAgent||"",xi=navigator.platform||"",Ti=navigator.maxTouchPoints||1,Oi=/Android/.test(ki);(/\b(iPad|iPhone|iPod)(?=;)/.test(ki)||xi==="MacIntel"&&Ti>1||Oi)&&(Ei.maxCanvasPixels=5242880)}const wi={VIEWER:2,API:4,WORKER:8,PREFERENCE:128};Si.OptionKind=wi;const Ci={annotationMode:{value:2,kind:wi.VIEWER+wi.PREFERENCE},cursorToolOnLoad:{value:0,kind:wi.VIEWER+wi.PREFERENCE},defaultUrl:{value:"compressed.tracemonkey-pldi-09.pdf",kind:wi.VIEWER},defaultZoomValue:{value:"",kind:wi.VIEWER+wi.PREFERENCE},disableHistory:{value:!1,kind:wi.VIEWER},disablePageLabels:{value:!1,kind:wi.VIEWER+wi.PREFERENCE},enablePermissions:{value:!1,kind:wi.VIEWER+wi.PREFERENCE},enablePrintAutoRotate:{value:!0,kind:wi.VIEWER+wi.PREFERENCE},enableScripting:{value:!0,kind:wi.VIEWER+wi.PREFERENCE},externalLinkRel:{value:"noopener noreferrer nofollow",kind:wi.VIEWER},externalLinkTarget:{value:0,kind:wi.VIEWER+wi.PREFERENCE},historyUpdateUrl:{value:!1,kind:wi.VIEWER+wi.PREFERENCE},ignoreDestinationZoom:{value:!1,kind:wi.VIEWER+wi.PREFERENCE},imageResourcesPath:{value:"./images/",kind:wi.VIEWER},maxCanvasPixels:{value:16777216,compatibility:Ei.maxCanvasPixels,kind:wi.VIEWER},pdfBugEnabled:{value:!1,kind:wi.VIEWER+wi.PREFERENCE},printResolution:{value:150,kind:wi.VIEWER},renderer:{value:"canvas",kind:wi.VIEWER},sidebarViewOnLoad:{value:-1,kind:wi.VIEWER+wi.PREFERENCE},scrollModeOnLoad:{value:-1,kind:wi.VIEWER+wi.PREFERENCE},spreadModeOnLoad:{value:-1,kind:wi.VIEWER+wi.PREFERENCE},textLayerMode:{value:1,kind:wi.VIEWER+wi.PREFERENCE},useOnlyCssZoom:{value:!1,kind:wi.VIEWER+wi.PREFERENCE},viewerCssTheme:{value:0,kind:wi.VIEWER+wi.PREFERENCE},viewOnLoad:{value:0,kind:wi.VIEWER+wi.PREFERENCE},cMapPacked:{value:!0,kind:wi.API},cMapUrl:{value:"../web/cmaps/",kind:wi.API},disableAutoFetch:{value:!1,kind:wi.API+wi.PREFERENCE},disableFontFace:{value:!1,kind:wi.API+wi.PREFERENCE},disableRange:{value:!1,kind:wi.API+wi.PREFERENCE},disableStream:{value:!1,kind:wi.API+wi.PREFERENCE},docBaseUrl:{value:"",kind:wi.API},enableXfa:{value:!0,kind:wi.API+wi.PREFERENCE},fontExtraProperties:{value:!1,kind:wi.API},isEvalSupported:{value:!0,kind:wi.API},maxImageSize:{value:-1,kind:wi.API},pdfBug:{value:!1,kind:wi.API},standardFontDataUrl:{value:"../web/standard_fonts/",kind:wi.API},verbosity:{value:1,kind:wi.API},workerPort:{value:null,kind:wi.WORKER},workerSrc:{value:"../build/pdf.worker.js",kind:wi.WORKER}};Ci.disablePreferences={value:!1,kind:wi.VIEWER},Ci.locale={value:navigator.language||"en-US",kind:wi.VIEWER},Ci.sandboxBundleSrc={value:"../build/pdf.sandbox.js",kind:wi.VIEWER},Ci.renderer.kind+=wi.PREFERENCE,Si.AppOptions=class{constructor(){this.userOptions=Object.create(null)}get(ki){var Oi;const xi=this.userOptions[ki];if(xi!==void 0)return xi;const Ti=Ci[ki];return Ti!==void 0?(Oi=Ti.compatibility)!=null?Oi:Ti.value:void 0}getAll(ki=null){var Ti;const xi=Object.create(null);for(const Oi in Ci){const ji=Ci[Oi];if(ki){if(!(ki&ji.kind))continue;if(ki===wi.PREFERENCE){const Ii=ji.value,Mi=typeof Ii;if(Mi==="boolean"||Mi==="string"||Mi==="number"&&Number.isInteger(Ii)){xi[Oi]=Ii;continue}throw new Error(`Invalid type for preference: ${Oi}`)}}const Li=this.userOptions[Oi];xi[Oi]=Li!==void 0?Li:(Ti=ji.compatibility)!=null?Ti:ji.value}return xi}set(ki,xi){this.userOptions[ki]=xi}setAll(ki){for(const xi in ki)this.userOptions[xi]=ki[xi]}remove(ki){delete this.userOptions[ki]}_hasUserOptions(){return Object.keys(this.userOptions).length>0}}},(Ai,Si,Ei)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.getActiveApp=function(){return Ci},Si.initManager=function(xi){return ki||(ki={createApp(Ti,Oi){const ji=wi.ViewerApplication.create(Ti,Oi);return this._register(ji),ji},_register(Ti){let Oi=null;Ti.initializedPromise.then(()=>{xi.forEach(ji=>{Ti.appConfig.sidebar.outerContainer.addEventListener(ji,()=>{Li=Ti,Oi||(Oi=window.requestAnimationFrame(()=>{Oi=null,ki.activateApp(Li)}));var Li})})})},activateApp(Ti){Ci&&window.removeEventListener("keydown",Ci.helper.webViewerKeyDown),Ci=Ti,window.addEventListener("keydown",Ci.helper.webViewerKeyDown)}},ki)};var wi=Ei(5);let Ci=null,ki=null},(Ai,Si,Ei)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.ViewerApplication=void 0;var wi,Ci=Ei(1),ki=Ei(3),xi=Ei(2),Ti=Ei(6),Oi=Ei(7),ji=(wi=Ei(8))&&wi.__esModule?wi:{default:wi},Li=Ei(11),Ii=Ei(12),Mi=Ei(14),Fi=Ei(15),Bi=Ei(25),Ri=Ei(27),Vi=Ei(28),Ni=Ei(29),Wi=Ei(9),zi=Ei(30),Di=Ei(31),Ui=Ei(32),Hi=Ei(20),qi=Ei(33),Gi=Ei(34),Ki=Ei(36),Qi=Ei(37),Xi=Ei(38),rr=Ei(39),ar=Ei(40),gr=Ei(41),fr=Ei(42);const lr={instance:{supportsPrinting:!1,createPrintService(){throw new Error("Not implemented: createPrintService")}}},mr=dr=>(dr.preventDefault(),dr.returnValue="",!1),vr=-1,Yi=1,nr={AUTOMATIC:0,LIGHT:1,DARK:2},ir=["1.0","1.1","1.2","1.3","1.4","1.5","1.6","1.7","1.8","1.9","2.0","2.1","2.2","2.3"],cr=["acrobat distiller","acrobat pdfwriter","adobe livecycle","adobe pdf library","adobe photoshop","ghostscript","tcpdf","cairo","dvipdfm","dvips","pdftex","pdfkit","itext","prince","quarkxpress","mac os x","microsoft","openoffice","oracle","luradocument","pdf-xchange","antenna house","aspose.cells","fpdf"];class tr{constructor(Ji,sr){this.initFields(),this.appConfig=Ji,this.AppOptions=sr,this.helper=(0,ji.default)(this,this.AppOptions),this.bindService();const pr=this.externalServices.isInAutomation?new xi.AutomationEventBus:Ji.eventBus||new xi.EventBus;this.eventBus=pr,this.onCreate()}onCreate(){const{webViewerInitialized:Ji}=this.helper;this.initialize(this.appConfig).then(Ji)}initFields(){this.initialBookmark=document.location.hash.substring(1),this._initializedCapability=(0,Ti.createPromiseCapability)(),this._fellback=!1,this.appConfig=null,this.pdfDocument=null,this.pdfLoadingTask=null,this.printService=null,this.pdfViewer=null,this.pdfThumbnailViewer=null,this.pdfRenderingQueue=null,this.pdfPresentationMode=null,this.pdfDocumentProperties=null,this.pdfLinkService=null,this.pdfHistory=null,this.pdfSidebar=null,this.pdfSidebarResizer=null,this.pdfOutlineViewer=null,this.pdfAttachmentViewer=null,this.pdfLayerViewer=null,this.pdfCursorTools=null,this.pdfScriptingManager=null,this.store=null,this.downloadManager=null,this.overlayManager=null,this.preferences=null,this.toolbar=null,this.secondaryToolbar=null,this.eventBus=null,this.l10n=null,this.isInitialViewSet=!1,this.downloadComplete=!1,this.isViewerEmbedded=window.parent!==window,this.url="",this.baseUrl="",this._downloadUrl="",this.externalServices=gr.DefaultExternalServices,this._boundEvents=Object.create(null),this.documentInfo=null,this.metadata=null,this._contentDispositionFilename=null,this._contentLength=null,this._saveInProgress=!1,this._docStats=null,this._wheelUnusedTicks=0,this._idleCallbacks=new Set}bindService(){(0,fr.bindPrintServiceFactory)(lr),(0,fr.bindExternalService)(this)}static create(Ji,sr){return new tr(Ji,sr)}async initialize(Ji){const{AppOptions:sr}=this;this.preferences=this.externalServices.createPreferences(),await this._readPreferences(),await this._parseHashParameters(),this._forceCssTheme(),await this._initializeL10n(),this.isViewerEmbedded&&sr.get("externalLinkTarget")===Oi.LinkTarget.NONE&&sr.set("externalLinkTarget",Oi.LinkTarget.TOP),await this._initializeViewerComponents(),this.bindEvents(),this.bindWindowEvents();const pr=Ji.appContainer||document.documentElement;this.l10n.translate(pr).then(()=>{this.eventBus.dispatch("localized",{source:this})}),this._initializedCapability.resolve()}async _readPreferences(){const{AppOptions:Ji}=this;if(!Ji.get("disablePreferences")){Ji._hasUserOptions();try{Ji.setAll(await this.preferences.getAll())}catch{}}}async _parseHashParameters(){const{AppOptions:Ji}=this,{loadFakeWorker:sr,initPDFBug:pr}=this.helper;if(!Ji.get("pdfBugEnabled"))return;const or=document.location.hash.substring(1);if(!or)return;const Zi=(0,Ci.parseQueryString)(or),er=[];if(Zi.get("disableworker")==="true"&&er.push(sr()),Zi.has("disablerange")&&Ji.set("disableRange",Zi.get("disablerange")==="true"),Zi.has("disablestream")&&Ji.set("disableStream",Zi.get("disablestream")==="true"),Zi.has("disableautofetch")&&Ji.set("disableAutoFetch",Zi.get("disableautofetch")==="true"),Zi.has("disablefontface")&&Ji.set("disableFontFace",Zi.get("disablefontface")==="true"),Zi.has("disablehistory")&&Ji.set("disableHistory",Zi.get("disablehistory")==="true"),Zi.has("verbosity")&&Ji.set("verbosity",0|Zi.get("verbosity")),Zi.has("textlayer"))switch(Zi.get("textlayer")){case"off":Ji.set("textLayerMode",Ci.TextLayerMode.DISABLE);break;case"visible":case"shadow":case"hover":this.appConfig.viewerContainer.classList.add(`textLayer-${Zi.get("textlayer")}`)}if(Zi.has("pdfbug")){Ji.set("pdfBug",!0),Ji.set("fontExtraProperties",!0);const hr=Zi.get("pdfbug").split(",");er.push(pr(hr))}if(Zi.has("locale")&&Ji.set("locale",Zi.get("locale")),er.length!==0)try{await Promise.all(er)}catch{}}async _initializeL10n(){const{AppOptions:Ji}=this;this.l10n=this.externalServices.createL10n({locale:Ji.get("locale")});const sr=await this.l10n.getDirection();document.getElementsByTagName("html")[0].dir=sr}_forceCssTheme(){var pr;const{AppOptions:Ji}=this,sr=Ji.get("viewerCssTheme");if(sr!==nr.AUTOMATIC&&Object.values(nr).includes(sr))try{const or=document.styleSheets[0],Zi=(or==null?void 0:or.cssRules)||[];for(let er=0,hr=Zi.length;er0&&this._annotationStorageModified)try{await this.save({sourceEventType:"save"})}catch{}const sr=[];sr.push(this.pdfLoadingTask.destroy()),this.pdfLoadingTask=null,this.pdfDocument&&(this.pdfDocument=null,this.pdfThumbnailViewer.setDocument(null),this.pdfViewer.setDocument(null),this.pdfLinkService.setDocument(null),this.pdfDocumentProperties.setDocument(null)),this.pdfLinkService.externalLinkEnabled=!0,this._fellback=!1,this.store=null,this.isInitialViewSet=!1,this.downloadComplete=!1,this.url="",this.baseUrl="",this._downloadUrl="",this.documentInfo=null,this.metadata=null,this._contentDispositionFilename=null,this._contentLength=null,this._saveInProgress=!1,this._docStats=null,this._cancelIdleCallbacks(),sr.push(this.pdfScriptingManager.destroyPromise),this.pdfSidebar.reset(),this.pdfOutlineViewer.reset(),this.pdfAttachmentViewer.reset(),this.pdfLayerViewer.reset(),(or=this.pdfHistory)==null||or.reset(),(Zi=this.findBar)==null||Zi.reset(),this.toolbar.reset(),this.secondaryToolbar.reset(),typeof PDFBug<"u"&&PDFBug.cleanup(),await Promise.all(sr)}async open(Ji,sr){const{AppOptions:pr}=this;this.pdfLoadingTask&&await this.close();const or=pr.getAll(ki.OptionKind.WORKER);for(const ur in or)Ti.GlobalWorkerOptions[ur]=or[ur];const Zi=Object.create(null);typeof Ji=="string"?(this.setTitleUsingUrl(Ji,Ji),Zi.url=Ji):Ji&&"byteLength"in Ji?Zi.data=Ji:Ji.url&&Ji.originalUrl&&(this.setTitleUsingUrl(Ji.originalUrl,Ji.url),Zi.url=Ji.url);const er=pr.getAll(ki.OptionKind.API);for(const ur in er){let _r=er[ur];Zi[ur]=_r}if(sr)for(const ur in sr)Zi[ur]=sr[ur];const hr=await this.getDocument(Zi);return this.pdfLoadingTask=hr,hr.onPassword=(ur,_r)=>{this.pdfLinkService.externalLinkEnabled=!1,this.passwordPrompt.setUpdateCallback(ur,_r),this.passwordPrompt.open()},hr.onProgress=({loaded:ur,total:_r})=>{this.progress(ur/_r)},hr.onUnsupportedFeature=this.fallback.bind(this),hr.promise.then(ur=>{this.load(ur)},ur=>{if(hr!==this.pdfLoadingTask)return;let _r="loading_error";return ur instanceof Ti.InvalidPDFException?_r="invalid_file_error":ur instanceof Ti.MissingPDFException?_r="missing_file_error":ur instanceof Ti.UnexpectedResponseException&&(_r="unexpected_response_error"),this.l10n.get(_r).then($r=>{throw this._documentError($r,{message:ur==null?void 0:ur.message}),ur})})}async getDocument(Ji){return(0,Ti.getDocument)(Ji)}_ensureDownloadComplete(){if(!this.pdfDocument||!this.downloadComplete)throw new Error("PDF document not downloaded.")}async download({sourceEventType:Ji="download"}={}){const sr=this._downloadUrl,pr=this._docFilename;try{this._ensureDownloadComplete();const or=await this.pdfDocument.getData(),Zi=new Blob([or],{type:"application/pdf"});await this.downloadManager.download(Zi,sr,pr,Ji)}catch{await this.downloadManager.downloadUrl(sr,pr)}}async save({sourceEventType:Ji="download"}={}){if(this._saveInProgress)return;this._saveInProgress=!0,await this.pdfScriptingManager.dispatchWillSave();const sr=this._downloadUrl,pr=this._docFilename;try{this._ensureDownloadComplete();const or=await this.pdfDocument.saveDocument(),Zi=new Blob([or],{type:"application/pdf"});await this.downloadManager.download(Zi,sr,pr,Ji)}catch{await this.download({sourceEventType:Ji})}finally{await this.pdfScriptingManager.dispatchDidSave(),this._saveInProgress=!1}}downloadOrSave(Ji){var sr;((sr=this.pdfDocument)==null?void 0:sr.annotationStorage.size)>0?this.save(Ji):this.download(Ji)}fallback(Ji){this.externalServices.reportTelemetry({type:"unsupportedFeature",featureId:Ji}),this._fellback||(this._fellback=!0,this.externalServices.fallback({featureId:Ji,url:this.baseUrl}).then(sr=>{sr&&this.download({sourceEventType:"download"})}))}_documentError(Ji,sr=null){var pr;this._unblockDocumentLoadEvent(),this._otherError(Ji,sr),this.eventBus.dispatch("documenterror",{source:this,message:Ji,reason:(pr=sr==null?void 0:sr.message)!=null?pr:null})}_otherError(Ji,sr=null){const pr=[this.l10n.get("error_version_info",{version:Ti.version||"?",build:Ti.build||"?"})];sr&&(pr.push(this.l10n.get("error_message",{message:sr.message})),sr.stack?pr.push(this.l10n.get("error_stack",{stack:sr.stack})):(sr.filename&&pr.push(this.l10n.get("error_file",{file:sr.filename})),sr.lineNumber&&pr.push(this.l10n.get("error_line",{line:sr.lineNumber}))));const or=this.appConfig.errorWrapper,Zi=or.container;Zi.hidden=!1,or.errorMessage.textContent=Ji;const er=or.closeButton;er.onclick=function(){Zi.hidden=!0};const hr=or.errorMoreInfo,ur=or.moreInfoButton,_r=or.lessInfoButton;ur.onclick=function(){hr.hidden=!1,ur.hidden=!0,_r.hidden=!1,hr.style.height=hr.scrollHeight+"px"},_r.onclick=function(){hr.hidden=!0,ur.hidden=!1,_r.hidden=!0},ur.oncontextmenu=Ci.noContextMenuHandler,_r.oncontextmenu=Ci.noContextMenuHandler,er.oncontextmenu=Ci.noContextMenuHandler,ur.hidden=!1,_r.hidden=!0,Promise.all(pr).then($r=>{hr.value=$r.join(` `)})}progress(Ji){const{AppOptions:sr}=this;if(this.downloadComplete)return;const pr=Math.round(100*Ji);(pr>this.loadingBar.percent||isNaN(pr))&&(this.loadingBar.percent=pr,(this.pdfDocument?this.pdfDocument.loadingParams.disableAutoFetch:sr.get("disableAutoFetch"))&&pr&&(this.disableAutoFetchLoadingBarTimeout&&(clearTimeout(this.disableAutoFetchLoadingBarTimeout),this.disableAutoFetchLoadingBarTimeout=null),this.loadingBar.show(),this.disableAutoFetchLoadingBarTimeout=setTimeout(()=>{this.loadingBar.hide(),this.disableAutoFetchLoadingBarTimeout=null},5e3)))}load(Ji){const{AppOptions:sr}=this;this.pdfDocument=Ji,Ji.getDownloadInfo().then(({length:Pr})=>{this._contentLength=Pr,this.downloadComplete=!0,this.loadingBar.hide(),hr.then(()=>{this.eventBus.dispatch("documentloaded",{source:this})})});const pr=Ji.getPageLayout().catch(function(){}),or=Ji.getPageMode().catch(function(){}),Zi=Ji.getOpenAction().catch(function(){});this.toolbar.setPagesCount(Ji.numPages,!1),this.secondaryToolbar.setPagesCount(Ji.numPages),this.pdfLinkService.setDocument(Ji,null),this.pdfDocumentProperties.setDocument(Ji,this.url);const er=this.pdfViewer;er.setDocument(Ji);const{firstPagePromise:hr,onePageRendered:ur,pagesPromise:_r}=er;this.pdfThumbnailViewer.setDocument(Ji);const $r=(this.store=new ar.ViewHistory(Ji.fingerprints[0])).getMultiple({page:null,zoom:Ci.DEFAULT_SCALE_VALUE,scrollLeft:"0",scrollTop:"0",rotation:null,sidebarView:Ci.SidebarView.UNKNOWN,scrollMode:Ci.ScrollMode.UNKNOWN,spreadMode:Ci.SpreadMode.UNKNOWN}).catch(()=>Object.create(null));hr.then(Pr=>{this.loadingBar.setWidth(this.appConfig.viewerContainer),this._initializeAnnotationStorageCallbacks(Ji),Promise.all([Ci.animationStarted,$r,pr,or,Zi]).then(async([Sr,Tr,kr,Rr,Vr])=>{const Hr=sr.get("viewOnLoad");this._initializePdfHistory({fingerprint:Ji.fingerprints[0],viewOnLoad:Hr,initialDest:Vr==null?void 0:Vr.dest});const Wr=this.initialBookmark,Fr=sr.get("defaultZoomValue");let Lr=Fr?`zoom=${Fr}`:null,Br=null,zr=sr.get("sidebarViewOnLoad"),jr=sr.get("scrollModeOnLoad"),Gr=sr.get("spreadModeOnLoad");Tr.page&&Hr!==Yi&&(Lr=`page=${Tr.page}&zoom=${Fr||Tr.zoom},${Tr.scrollLeft},${Tr.scrollTop}`,Br=parseInt(Tr.rotation,10),zr===Ci.SidebarView.UNKNOWN&&(zr=0|Tr.sidebarView),jr===Ci.ScrollMode.UNKNOWN&&(jr=0|Tr.scrollMode),Gr===Ci.SpreadMode.UNKNOWN&&(Gr=0|Tr.spreadMode)),Rr&&zr===Ci.SidebarView.UNKNOWN&&(zr=(0,Ci.apiPageModeToSidebarView)(Rr)),kr&&jr===Ci.ScrollMode.UNKNOWN&&Gr===Ci.SpreadMode.UNKNOWN&&(Gr=(0,Ci.apiPageLayoutToViewerModes)(kr).spreadMode),this.setInitialView(Lr,{rotation:Br,sidebarView:zr,scrollMode:jr,spreadMode:Gr}),this.eventBus.dispatch("documentinit",{source:this}),this.isViewerEmbedded||er.focus(),await Promise.race([_r,new Promise(Xr=>{setTimeout(Xr,1e4)})]),(Wr||Lr)&&!er.hasEqualPageSizes&&(this.initialBookmark=Wr,er.currentScaleValue=er.currentScaleValue,this.setInitialView(Lr))}).catch(()=>{this.setInitialView()}).then(function(){er.update()})}),_r.then(()=>{this._unblockDocumentLoadEvent(),this._initializeAutoPrint(Ji,Zi)},Pr=>{this.l10n.get("loading_error").then(Sr=>{this._documentError(Sr,{message:Pr==null?void 0:Pr.message})})}),ur.then(Pr=>{if(this.externalServices.reportTelemetry({type:"pageInfo",timestamp:Pr.timestamp}),Ji.getOutline().then(Sr=>{Ji===this.pdfDocument&&this.pdfOutlineViewer.render({outline:Sr,pdfDocument:Ji})}),Ji.getAttachments().then(Sr=>{Ji===this.pdfDocument&&this.pdfAttachmentViewer.render({attachments:Sr})}),er.optionalContentConfigPromise.then(Sr=>{Ji===this.pdfDocument&&this.pdfLayerViewer.render({optionalContentConfig:Sr,pdfDocument:Ji})}),"requestIdleCallback"in window){const Sr=window.requestIdleCallback(()=>{this._collectTelemetry(Ji),this._idleCallbacks.delete(Sr)},{timeout:1e3});this._idleCallbacks.add(Sr)}}),this._initializePageLabels(Ji),this._initializeMetadata(Ji)}async _scriptingDocProperties(Ji){var sr,pr;return!this.documentInfo&&(await new Promise(or=>{this.eventBus._on("metadataloaded",or,{once:!0})}),Ji!==this.pdfDocument)||!this._contentLength&&(await new Promise(or=>{this.eventBus._on("documentloaded",or,{once:!0})}),Ji!==this.pdfDocument)?null:{...this.documentInfo,baseURL:this.baseUrl,filesize:this._contentLength,filename:this._docFilename,metadata:(sr=this.metadata)==null?void 0:sr.getRaw(),authors:(pr=this.metadata)==null?void 0:pr.get("dc:creator"),numPages:this.pagesCount,URL:this.url}}async _collectTelemetry(Ji){const sr=await this.pdfDocument.getMarkInfo();if(Ji!==this.pdfDocument)return;const pr=(sr==null?void 0:sr.Marked)||!1;this.externalServices.reportTelemetry({type:"tagged",tagged:pr})}async _initializeAutoPrint(Ji,sr){const[pr,or]=await Promise.all([sr,this.pdfViewer.enableScripting?null:Ji.getJavaScript()]);if(Ji!==this.pdfDocument)return;let Zi=!1;if((pr==null?void 0:pr.action)==="Print"&&(Zi=!0),or&&(or.some(er=>er?(this.fallback(Ti.UNSUPPORTED_FEATURES.javaScript),!0):!1),!Zi)){for(const er of or)if(er&&Ci.AutoPrintRegExp.test(er)){Zi=!0;break}}Zi&&this.triggerPrinting()}async _initializeMetadata(Ji){var Pr,Sr;const{info:sr,metadata:pr,contentDispositionFilename:or,contentLength:Zi}=await Ji.getMetadata();if(Ji!==this.pdfDocument)return;this.documentInfo=sr,this.metadata=pr,(Pr=this._contentDispositionFilename)!=null||(this._contentDispositionFilename=or),(Sr=this._contentLength)!=null||(this._contentLength=Zi);let er=sr==null?void 0:sr.Title;const hr=pr==null?void 0:pr.get("dc:title");hr&&(hr==="Untitled"||/[\uFFF0-\uFFFF]/g.test(hr)||(er=hr)),er?this.setTitle(`${er} - ${or||document.title}`):or&&this.setTitle(or),!sr.IsXFAPresent||sr.IsAcroFormPresent||Ji.isPureXfa?!sr.IsAcroFormPresent&&!sr.IsXFAPresent||this.pdfViewer.renderForms||this.fallback(Ti.UNSUPPORTED_FEATURES.forms):(Ji.loadingParams.enableXfa,this.fallback(Ti.UNSUPPORTED_FEATURES.forms)),sr.IsSignaturesPresent&&this.fallback(Ti.UNSUPPORTED_FEATURES.signatures);let ur="other";ir.includes(sr.PDFFormatVersion)&&(ur=`v${sr.PDFFormatVersion.replace(".","_")}`);let _r="other";if(sr.Producer){const Tr=sr.Producer.toLowerCase();cr.some(function(kr){return Tr.includes(kr)?(_r=kr.replace(/[ .-]/g,"_"),!0):!1})}let $r=null;sr.IsXFAPresent?$r="xfa":sr.IsAcroFormPresent&&($r="acroform"),this.externalServices.reportTelemetry({type:"documentInfo",version:ur,generator:_r,formType:$r}),this.eventBus.dispatch("metadataloaded",{source:this})}async _initializePageLabels(Ji){const{AppOptions:sr}=this,pr=await Ji.getPageLabels();if(Ji!==this.pdfDocument||!pr||sr.get("disablePageLabels"))return;const or=pr.length;let Zi=0,er=0;for(let $r=0;$r=or||er>=or)return;const{pdfViewer:hr,pdfThumbnailViewer:ur,toolbar:_r}=this;hr.setPageLabels(pr),ur.setPageLabels(pr),_r.setPagesCount(or,!0),_r.setPageNumber(hr.currentPageNumber,hr.currentPageLabel)}_initializePdfHistory({fingerprint:Ji,viewOnLoad:sr,initialDest:pr=null}){const{AppOptions:or}=this;this.pdfHistory&&(this.pdfHistory.initialize({fingerprint:Ji,resetHistory:sr===Yi,updateUrl:or.get("historyUpdateUrl")}),this.pdfHistory.initialBookmark&&(this.initialBookmark=this.pdfHistory.initialBookmark,this.initialRotation=this.pdfHistory.initialRotation),pr&&!this.initialBookmark&&sr===vr&&(this.initialBookmark=JSON.stringify(pr),this.pdfHistory.push({explicitDest:pr,pageNumber:null})))}_initializeAnnotationStorageCallbacks(Ji){if(Ji!==this.pdfDocument)return;const{annotationStorage:sr}=Ji;sr.onSetModified=()=>{window.addEventListener("beforeunload",mr),this._annotationStorageModified=!0},sr.onResetModified=()=>{window.removeEventListener("beforeunload",mr),delete this._annotationStorageModified}}setInitialView(Ji,{rotation:sr,sidebarView:pr,scrollMode:or,spreadMode:Zi}={}){const er=hr=>{(0,Ci.isValidRotation)(hr)&&(this.pdfViewer.pagesRotation=hr)};this.isInitialViewSet=!0,this.pdfSidebar.setInitialView(pr),((hr,ur)=>{(0,Ci.isValidScrollMode)(hr)&&(this.pdfViewer.scrollMode=hr),(0,Ci.isValidSpreadMode)(ur)&&(this.pdfViewer.spreadMode=ur)})(or,Zi),this.initialBookmark?(er(this.initialRotation),delete this.initialRotation,this.pdfLinkService.setHash(this.initialBookmark),this.initialBookmark=null):Ji&&(er(sr),this.pdfLinkService.setHash(Ji,{isStoredHash:!0})),this.toolbar.setPageNumber(this.pdfViewer.currentPageNumber,this.pdfViewer.currentPageLabel),this.secondaryToolbar.setPageNumber(this.pdfViewer.currentPageNumber),this.pdfViewer.currentScaleValue||(this.pdfViewer.currentScaleValue=Ci.DEFAULT_SCALE_VALUE)}_cleanup(){this.pdfDocument&&(this.pdfViewer.cleanup(),this.pdfThumbnailViewer.cleanup(),this.pdfDocument.cleanup(this.pdfViewer.renderer===Ci.RendererType.SVG))}forceRendering(){this.pdfRenderingQueue.printing=!!this.printService,this.pdfRenderingQueue.isThumbnailViewEnabled=this.pdfSidebar.isThumbnailViewVisible,this.pdfRenderingQueue.renderHighestPriority()}beforePrint(){const{AppOptions:Ji}=this;if(this.pdfScriptingManager.dispatchWillPrint(),this.printService)return;if(!this.supportsPrinting){this.l10n.get("printing_not_supported").then(ur=>{this._otherError(ur)});return}if(!this.pdfViewer.pageViewsReady){this.l10n.get("printing_not_ready").then(ur=>{window.alert(ur)});return}const sr=this.pdfViewer.getPagesOverview(),pr=this.appConfig.printContainer,or=this.appConfig.printServiceOverlay,Zi=Ji.get("printResolution"),er=this.pdfViewer.optionalContentConfigPromise,hr=lr.instance.createPrintService(this.pdfDocument,sr,pr,Zi,er,this.l10n,or);this.printService=hr,this.forceRendering(),hr.layout(),this.externalServices.reportTelemetry({type:"print"})}afterPrint(){var Ji;this.pdfScriptingManager.dispatchDidPrint(),this.printService&&(this.printService.destroy(),this.printService=null,(Ji=this.pdfDocument)==null||Ji.annotationStorage.resetModified()),this.forceRendering()}rotatePages(Ji){this.pdfViewer.pagesRotation+=Ji}requestPresentationMode(){var Ji;(Ji=this.pdfPresentationMode)==null||Ji.request()}triggerPrinting(){this.supportsPrinting&&window.print()}bindEvents(){const{eventBus:Ji,_boundEvents:sr,AppOptions:pr}=this,{webViewerResize:or,webViewerHashchange:Zi,webViewerPageRendered:er,webViewerUpdateViewarea:hr,webViewerPageChanging:ur,webViewerScaleChanging:_r,webViewerRotationChanging:$r,webViewerSidebarViewChanged:Pr,webViewerPageMode:Sr,webViewerNamedAction:Tr,webViewerPresentationModeChanged:kr,webViewerPresentationMode:Rr,webViewerPrint:Vr,webViewerDownload:Hr,webViewerSave:Wr,webViewerFirstPage:Fr,webViewerLastPage:Lr,webViewerNextPage:Br,webViewerPreviousPage:zr,webViewerZoomIn:jr,webViewerZoomOut:Gr,webViewerZoomReset:Xr,webViewerPageNumberChanged:ns,webViewerScaleChanged:is,webViewerRotateCw:rs,webViewerRotateCcw:ss,webViewerOptionalContentConfig:as,webViewerSwitchScrollMode:os,webViewerSwitchSpreadMode:wr,webViewerDocumentProperties:yr,webViewerUpdateFindMatchesCount:br,webViewerUpdateFindControlState:Ar,webViewerScrollModeChanged:Ir,webViewerSpreadModeChanged:Mr,reportPageStatsPDFBug:Or,webViewerFindFromUrlHash:qr,webViewerFileInputChange:Jr,webViewerOpenFile:Zr}=this.helper;sr.beforePrint=this.beforePrint.bind(this),sr.afterPrint=this.afterPrint.bind(this),Ji._on("resize",or),Ji._on("hashchange",Zi),Ji._on("beforeprint",sr.beforePrint),Ji._on("afterprint",sr.afterPrint),Ji._on("pagerendered",er),Ji._on("updateviewarea",hr),Ji._on("pagechanging",ur),Ji._on("scalechanging",_r),Ji._on("rotationchanging",$r),Ji._on("sidebarviewchanged",Pr),Ji._on("pagemode",Sr),Ji._on("namedaction",Tr),Ji._on("presentationmodechanged",kr),Ji._on("presentationmode",Rr),Ji._on("print",Vr),Ji._on("download",Hr),Ji._on("save",Wr),Ji._on("firstpage",Fr),Ji._on("lastpage",Lr),Ji._on("nextpage",Br),Ji._on("previouspage",zr),Ji._on("zoomin",jr),Ji._on("zoomout",Gr),Ji._on("zoomreset",Xr),Ji._on("pagenumberchanged",ns),Ji._on("scalechanged",is),Ji._on("rotatecw",rs),Ji._on("rotateccw",ss),Ji._on("optionalcontentconfig",as),Ji._on("switchscrollmode",os),Ji._on("scrollmodechanged",Ir),Ji._on("switchspreadmode",wr),Ji._on("spreadmodechanged",Mr),Ji._on("documentproperties",yr),Ji._on("findfromurlhash",qr),Ji._on("updatefindmatchescount",br),Ji._on("updatefindcontrolstate",Ar),pr.get("pdfBug")&&(sr.reportPageStatsPDFBug=Or,Ji._on("pagerendered",sr.reportPageStatsPDFBug),Ji._on("pagechanging",sr.reportPageStatsPDFBug)),Ji._on("fileinputchange",Jr),Ji._on("openfile",Zr)}bindWindowEvents(){const{eventBus:Ji,_boundEvents:sr}=this,{webViewerVisibilityChange:pr,webViewerWheel:or,webViewerTouchStart:Zi,webViewerClick:er,webViewerKeyDown:hr}=this.helper;sr.windowResize=()=>{Ji.dispatch("resize",{source:window})},sr.windowHashChange=()=>{Ji.dispatch("hashchange",{source:window,hash:document.location.hash.substring(1)})},sr.windowBeforePrint=()=>{Ji.dispatch("beforeprint",{source:window})},sr.windowAfterPrint=()=>{Ji.dispatch("afterprint",{source:window})},sr.windowUpdateFromSandbox=ur=>{Ji.dispatch("updatefromsandbox",{source:window,detail:ur.detail})},window.addEventListener("visibilitychange",pr),window.addEventListener("wheel",or,{passive:!1}),window.addEventListener("touchstart",Zi,{passive:!1}),window.addEventListener("click",er),window.addEventListener("resize",sr.windowResize),window.addEventListener("hashchange",sr.windowHashChange),window.addEventListener("beforeprint",sr.windowBeforePrint),window.addEventListener("afterprint",sr.windowAfterPrint),window.addEventListener("updatefromsandbox",sr.windowUpdateFromSandbox)}unbindEvents(){const{eventBus:Ji,_boundEvents:sr}=this,{webViewerResize:pr,webViewerHashchange:or,webViewerPageRendered:Zi,webViewerUpdateViewarea:er,webViewerPageChanging:hr,webViewerScaleChanging:ur,webViewerRotationChanging:_r,webViewerSidebarViewChanged:$r,webViewerPageMode:Pr,webViewerNamedAction:Sr,webViewerPresentationModeChanged:Tr,webViewerPresentationMode:kr,webViewerPrint:Rr,webViewerDownload:Vr,webViewerSave:Hr,webViewerFirstPage:Wr,webViewerLastPage:Fr,webViewerNextPage:Lr,webViewerPreviousPage:Br,webViewerZoomIn:zr,webViewerZoomOut:jr,webViewerZoomReset:Gr,webViewerPageNumberChanged:Xr,webViewerScaleChanged:ns,webViewerRotateCw:is,webViewerRotateCcw:rs,webViewerOptionalContentConfig:ss,webViewerSwitchScrollMode:as,webViewerSwitchSpreadMode:os,webViewerDocumentProperties:wr,webViewerUpdateFindMatchesCount:yr,webViewerUpdateFindControlState:br,webViewerScrollModeChanged:Ar,webViewerSpreadModeChanged:Ir,webViewerFindFromUrlHash:Mr,webViewerFileInputChange:Or,webViewerOpenFile:qr}=this.helper;Ji._off("resize",pr),Ji._off("hashchange",or),Ji._off("beforeprint",sr.beforePrint),Ji._off("afterprint",sr.afterPrint),Ji._off("pagerendered",Zi),Ji._off("updateviewarea",er),Ji._off("pagechanging",hr),Ji._off("scalechanging",ur),Ji._off("rotationchanging",_r),Ji._off("sidebarviewchanged",$r),Ji._off("pagemode",Pr),Ji._off("namedaction",Sr),Ji._off("presentationmodechanged",Tr),Ji._off("presentationmode",kr),Ji._off("print",Rr),Ji._off("download",Vr),Ji._off("save",Hr),Ji._off("firstpage",Wr),Ji._off("lastpage",Fr),Ji._off("nextpage",Lr),Ji._off("previouspage",Br),Ji._off("zoomin",zr),Ji._off("zoomout",jr),Ji._off("zoomreset",Gr),Ji._off("pagenumberchanged",Xr),Ji._off("scalechanged",ns),Ji._off("rotatecw",is),Ji._off("rotateccw",rs),Ji._off("optionalcontentconfig",ss),Ji._off("switchscrollmode",as),Ji._off("scrollmodechanged",Ar),Ji._off("switchspreadmode",os),Ji._off("spreadmodechanged",Ir),Ji._off("documentproperties",wr),Ji._off("findfromurlhash",Mr),Ji._off("updatefindmatchescount",yr),Ji._off("updatefindcontrolstate",br),sr.reportPageStatsPDFBug&&(Ji._off("pagerendered",sr.reportPageStatsPDFBug),Ji._off("pagechanging",sr.reportPageStatsPDFBug),sr.reportPageStatsPDFBug=null),Ji._off("fileinputchange",Or),Ji._off("openfile",qr),sr.beforePrint=null,sr.afterPrint=null}unbindWindowEvents(){const{_boundEvents:Ji}=this,{webViewerVisibilityChange:sr,webViewerWheel:pr,webViewerTouchStart:or,webViewerClick:Zi,webViewerKeyDown:er}=this.helper;window.removeEventListener("visibilitychange",sr),window.removeEventListener("wheel",pr,{passive:!1}),window.removeEventListener("touchstart",or,{passive:!1}),window.removeEventListener("click",Zi),window.removeEventListener("resize",Ji.windowResize),window.removeEventListener("hashchange",Ji.windowHashChange),window.removeEventListener("beforeprint",Ji.windowBeforePrint),window.removeEventListener("afterprint",Ji.windowAfterPrint),window.removeEventListener("updatefromsandbox",Ji.windowUpdateFromSandbox),Ji.windowResize=null,Ji.windowHashChange=null,Ji.windowBeforePrint=null,Ji.windowAfterPrint=null,Ji.windowUpdateFromSandbox=null}accumulateWheelTicks(Ji){(this._wheelUnusedTicks>0&&Ji<0||this._wheelUnusedTicks<0&&Ji>0)&&(this._wheelUnusedTicks=0),this._wheelUnusedTicks+=Ji;const sr=Math.sign(this._wheelUnusedTicks)*Math.floor(Math.abs(this._wheelUnusedTicks));return this._wheelUnusedTicks-=sr,sr}_unblockDocumentLoadEvent(){document.blockUnblockOnload&&document.blockUnblockOnload(!1),this._unblockDocumentLoadEvent=()=>{}}_reportDocumentStatsTelemetry(){const{stats:Ji}=this.pdfDocument;Ji!==this._docStats&&(this._docStats=Ji,this.externalServices.reportTelemetry({type:"documentStats",stats:Ji}))}get scriptingReady(){return this.pdfScriptingManager.ready}createSidebar(Ji){return new Xi.PDFSidebar(Ji)}createPDFViewer(Ji){return new Fi.PDFViewer(Ji)}}Si.ViewerApplication=tr},Ai=>{let Si;Si=typeof window<"u"&&window["paoding-pdfjs-dist/build/pdf"]?window["paoding-pdfjs-dist/build/pdf"]:requirePdf(),Ai.exports=Si},(Ai,Si,Ei)=>{var Ti,Oi,ws,Li,Ts;Object.defineProperty(Si,"__esModule",{value:!0}),Si.SimpleLinkService=Si.PDFLinkService=Si.LinkTarget=void 0;var wi=Ei(1);const Ci={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};Si.LinkTarget=Ci;function ki(Fi,{url:Bi,target:Ri,rel:Vi,enabled:Ni=!0}={}){if(!Bi||typeof Bi!="string")throw new Error('A valid "url" parameter must provided.');const Wi=(0,wi.removeNullCharacters)(Bi);Ni?Fi.href=Fi.title=Wi:(Fi.href="",Fi.title=`Disabled: ${Wi}`,Fi.onclick=()=>!1);let zi="";switch(Ri){case Ci.NONE:break;case Ci.SELF:zi="_self";break;case Ci.BLANK:zi="_blank";break;case Ci.PARENT:zi="_parent";break;case Ci.TOP:zi="_top"}Fi.target=zi,Fi.rel=typeof Vi=="string"?Vi:"noopener noreferrer nofollow"}const Mi=class{constructor({eventBus:Bi,externalLinkTarget:Ri=null,externalLinkRel:Vi=null,ignoreDestinationZoom:Ni=!1}={}){Er(this,Oi);Er(this,Ti,new Map);this.eventBus=Bi,this.externalLinkTarget=Ri,this.externalLinkRel=Vi,this.externalLinkEnabled=!0,this._ignoreDestinationZoom=Ni,this.baseUrl=null,this.pdfDocument=null,this.pdfViewer=null,this.pdfHistory=null}setDocument(Bi,Ri=null){this.baseUrl=Ri,this.pdfDocument=Bi,Cr(this,Ti).clear()}setViewer(Bi){this.pdfViewer=Bi}setHistory(Bi){this.pdfHistory=Bi}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return this.pdfViewer.currentPageNumber}set page(Bi){this.pdfViewer.currentPageNumber=Bi}get rotation(){return this.pdfViewer.pagesRotation}set rotation(Bi){this.pdfViewer.pagesRotation=Bi}async goToDestination(Bi){if(!this.pdfDocument)return;let Ri,Vi;typeof Bi=="string"?(Ri=Bi,Vi=await this.pdfDocument.getDestination(Bi)):(Ri=null,Vi=await Bi),Array.isArray(Vi)&&xr(this,Oi,ws).call(this,Bi,Ri,Vi)}goToPage(Bi){if(!this.pdfDocument)return;const Ri=typeof Bi=="string"&&this.pdfViewer.pageLabelToPageNumber(Bi)||0|Bi;Number.isInteger(Ri)&&Ri>0&&Ri<=this.pagesCount&&(this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.pushPage(Ri)),this.pdfViewer.scrollPageIntoView({pageNumber:Ri}))}addLinkAttributes(Bi,Ri,Vi=!1){ki(Bi,{url:Ri,target:Vi?Ci.BLANK:this.externalLinkTarget,rel:this.externalLinkRel,enabled:this.externalLinkEnabled})}getDestinationHash(Bi){if(typeof Bi=="string"){if(Bi.length>0)return this.getAnchorUrl("#"+escape(Bi))}else if(Array.isArray(Bi)){const Ri=JSON.stringify(Bi);if(Ri.length>0)return this.getAnchorUrl("#"+escape(Ri))}return this.getAnchorUrl("")}getAnchorUrl(Bi){return(this.baseUrl||"")+Bi}setHash(Bi,Ri={isStoredHash:!1}){var Wi;if(!this.pdfDocument)return;let Vi,Ni;if(Bi.includes("=")){const zi=(0,wi.parseQueryString)(Bi);if(zi.has("search")&&this.eventBus.dispatch("findfromurlhash",{source:this,query:zi.get("search").replace(/"/g,""),phraseSearch:zi.get("phrase")==="true"}),zi.has("page")&&(Vi=0|zi.get("page")||1),zi.has("zoom")){const Di=zi.get("zoom").split(","),Ui=Di[0],Hi=parseFloat(Ui);Ui.includes("Fit")?Ui==="Fit"||Ui==="FitB"?Ni=[null,{name:Ui}]:Ui==="FitH"||Ui==="FitBH"||Ui==="FitV"||Ui==="FitBV"?Ni=[null,{name:Ui},Di.length>1?0|Di[1]:null]:Ui==="FitR"&&(Di.length!==5||(Ni=[null,{name:Ui},0|Di[1],0|Di[2],0|Di[3],0|Di[4]])):Ni=[null,{name:"XYZ"},Di.length>1?0|Di[1]:null,Di.length>2?0|Di[2]:null,Hi?Hi/100:Ui]}Ni?this.pdfViewer.scrollPageIntoView({pageNumber:Vi||this.page,destArray:Ni,allowNegativeOffset:!0,hashOptions:Ri}):Vi&&(this.page=Vi),zi.has("pagemode")&&this.eventBus.dispatch("pagemode",{source:this,mode:zi.get("pagemode")}),zi.has("nameddest")&&this.goToDestination(zi.get("nameddest"))}else{Ni=unescape(Bi);try{Ni=JSON.parse(Ni),Array.isArray(Ni)||(Ni=Ni.toString())}catch{}if(typeof Ni=="string"||xr(Wi=Mi,Li,Ts).call(Wi,Ni)){this.goToDestination(Ni);return}}}executeNamedAction(Bi){var Ri,Vi;switch(Bi){case"GoBack":(Ri=this.pdfHistory)==null||Ri.back();break;case"GoForward":(Vi=this.pdfHistory)==null||Vi.forward();break;case"NextPage":this.pdfViewer.nextPage();break;case"PrevPage":this.pdfViewer.previousPage();break;case"LastPage":this.page=this.pagesCount;break;case"FirstPage":this.page=1}this.eventBus.dispatch("namedaction",{source:this,action:Bi})}cachePageRef(Bi,Ri){if(!Ri)return;const Vi=Ri.gen===0?`${Ri.num}R`:`${Ri.num}R${Ri.gen}`;Cr(this,Ti).set(Vi,Bi)}_cachedPageNumber(Bi){if(!Bi)return null;const Ri=Bi.gen===0?`${Bi.num}R`:`${Bi.num}R${Bi.gen}`;return Cr(this,Ti).get(Ri)||null}isPageVisible(Bi){return this.pdfViewer.isPageVisible(Bi)}isPageCached(Bi){return this.pdfViewer.isPageCached(Bi)}};let xi=Mi;Ti=new WeakMap,Oi=new WeakSet,ws=function(Bi,Ri=null,Vi){const Ni=Vi[0];let Wi;if(typeof Ni=="object"&&Ni!==null){if(Wi=this._cachedPageNumber(Ni),!Wi){this.pdfDocument.getPageIndex(Ni).then(zi=>{this.cachePageRef(zi+1,Ni),xr(this,Oi,ws).call(this,Bi,Ri,Vi)}).catch(()=>{});return}}else{if(!Number.isInteger(Ni))return;Wi=Ni+1}!Wi||Wi<1||Wi>this.pagesCount||(this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.push({namedDest:Ri,explicitDest:Vi,pageNumber:Wi})),this.pdfViewer.scrollPageIntoView({pageNumber:Wi,destArray:Vi,ignoreDestinationZoom:this._ignoreDestinationZoom}))},Li=new WeakSet,Ts=function(Bi){if(!Array.isArray(Bi))return!1;const Ri=Bi.length;if(Ri<2)return!1;const Vi=Bi[0];if(!(typeof Vi=="object"&&Number.isInteger(Vi.num)&&Number.isInteger(Vi.gen)||Number.isInteger(Vi)&&Vi>=0))return!1;const Ni=Bi[1];if(typeof Ni!="object"||typeof Ni.name!="string")return!1;let Wi=!0;switch(Ni.name){case"XYZ":if(Ri!==5)return!1;break;case"Fit":case"FitB":return Ri===2;case"FitH":case"FitBH":case"FitV":case"FitBV":if(Ri!==3)return!1;break;case"FitR":if(Ri!==6)return!1;Wi=!1;break;default:return!1}for(let zi=2;zi{Object.defineProperty(Si,"__esModule",{value:!0}),Si.default=void 0;var wi=Ei(1),Ci=Ei(6),ki=Ei(9),xi=function(Ti,Oi){let ji;const Li=["null","http://mozilla.github.io","https://mozilla.github.io"];ji=function(Ni){if(Ni!==void 0)try{const Wi=new URL(window.location.href).origin||"null";if(Li.includes(Wi)||Oi.get("disableCORSOriginCheck"))return;if(new URL(Ni,window.location.href).origin!==Wi)throw new Error("file origin does not match viewer's")}catch(Wi){throw Ti.l10n.get("loading_error").then(zi=>{Ti._documentError(zi,{message:Wi==null?void 0:Wi.message})}),Wi}};function Ii(Ni){Ni?Ti.open(Ni):Ti._hideViewBookmark()}let Mi,Fi;Mi=function(Ni){var Di;if((Di=Ti.pdfViewer)!=null&&Di.isInPresentationMode)return;const Wi=Ni.fileInput.files[0];let zi=URL.createObjectURL(Wi);Wi.name&&(zi={url:zi,originalUrl:Wi.name}),Ti.open(zi)},Fi=function(Ni){const Wi=Ti.appConfig.openFileInputName;document.querySelector(`[data-id="${Wi}"]`).click()};function Bi(){Ti.downloadOrSave({sourceEventType:"save"})}let Ri=null;function Vi(){Ri&&clearTimeout(Ri),Ri=setTimeout(function(){Ri=null},1e3)}return{validateFileURL:ji,loadFakeWorker:async function(){GlobalWorkerOptions.workerSrc||(GlobalWorkerOptions.workerSrc=Oi.get("workerSrc")),await(0,Ci.loadScript)(Ci.PDFWorker.workerSrc)},initPDFBug:async function(Ni){const{debuggerScriptPath:Wi,mainContainer:zi}=Ti.appConfig;await(0,Ci.loadScript)(Wi),PDFBug.init({OPS:Ci.OPS},zi,Ni)},reportPageStatsPDFBug:function({pageNumber:Ni}){var zi,Di;if(typeof Stats>"u"||!Stats.enabled)return;const Wi=(Di=(zi=Ti.pdfViewer.getPageView(Ni-1))==null?void 0:zi.pdfPage)==null?void 0:Di.stats;Wi&&Stats.add(Ni,Wi)},webViewerInitialized:function(){var Ui;const Ni=Ti.appConfig;let Wi;const zi=document.location.search.substring(1);Wi=(Ui=(0,wi.parseQueryString)(zi).get("file"))!=null?Ui:Oi.get("defaultUrl"),ji(Wi);const Di=document.createElement("input");Di.dataset.id=Ni.openFileInputName,Di.className="fileInput",Di.setAttribute("type","file"),Di.oncontextmenu=wi.noContextMenuHandler,document.body.appendChild(Di),window.File&&window.FileReader&&window.FileList&&window.Blob?Di.value=null:(Ni.toolbar.openFile.hidden=!0,Ni.secondaryToolbar.openFileButton.hidden=!0),Di.addEventListener("change",function(Hi){const qi=Hi.target.files;qi&&qi.length!==0&&Ti.eventBus.dispatch("fileinputchange",{source:this,fileInput:Hi.target})}),Oi.get("disableDraggingAndDropping")||(Ni.mainContainer.addEventListener("dragover",function(Hi){Hi.preventDefault(),Hi.dataTransfer.dropEffect="move"}),Ni.mainContainer.addEventListener("drop",function(Hi){Hi.preventDefault();const qi=Hi.dataTransfer.files;qi&&qi.length!==0&&Ti.eventBus.dispatch("fileinputchange",{source:this,fileInput:Hi.dataTransfer})})),Ti.supportsDocumentFonts||(Oi.set("disableFontFace",!0),Ti.l10n.get("web_fonts_disabled").then(Hi=>{})),Ti.supportsPrinting||(Ni.toolbar.print.classList.add("hidden"),Ni.secondaryToolbar.printButton.classList.add("hidden")),Ti.supportsFullscreen||(Ni.toolbar.presentationModeButton.classList.add("hidden"),Ni.secondaryToolbar.presentationModeButton.classList.add("hidden")),Ti.supportsIntegratedFind&&Ni.toolbar.viewFind.classList.add("hidden"),Ni.mainContainer.addEventListener("transitionend",function(Hi){Hi.target===this&&Ti.eventBus.dispatch("resize",{source:this})},!0);try{Ii(Wi)}catch(Hi){Ti.l10n.get("loading_error").then(qi=>{Ti._documentError(qi,Hi)})}},webViewerOpenFileViaURL:Ii,webViewerPageRendered:function({pageNumber:Ni,error:Wi}){if(Ni===Ti.page&&Ti.toolbar.updateLoadingIndicatorState(!1),Ti.pdfSidebar.isThumbnailViewVisible){const zi=Ti.pdfViewer.getPageView(Ni-1),Di=Ti.pdfThumbnailViewer.getThumbnail(Ni-1);zi&&Di&&Di.setImage(zi)}Wi&&Ti.l10n.get("rendering_error").then(zi=>{Ti._otherError(zi,Wi)}),Ti._reportDocumentStatsTelemetry()},webViewerPageMode:function({mode:Ni}){let Wi;switch(Ni){case"thumbs":Wi=wi.SidebarView.THUMBS;break;case"bookmarks":case"outline":Wi=wi.SidebarView.OUTLINE;break;case"attachments":Wi=wi.SidebarView.ATTACHMENTS;break;case"layers":Wi=wi.SidebarView.LAYERS;break;case"none":Wi=wi.SidebarView.NONE;break;default:return}Ti.pdfSidebar.switchView(Wi,!0)},webViewerNamedAction:function(Ni){switch(Ni.action){case"GoToPage":Ti.appConfig.toolbar.pageNumber.select();break;case"Find":Ti.supportsIntegratedFind||Ti.findBar.toggle();break;case"Print":Ti.triggerPrinting();break;case"SaveAs":Bi()}},webViewerPresentationModeChanged:function(Ni){Ti.pdfViewer.presentationModeState=Ni.state},webViewerSidebarViewChanged:function(Ni){var Wi;Ti.pdfRenderingQueue.isThumbnailViewEnabled=Ti.pdfSidebar.isThumbnailViewVisible,Ti.isInitialViewSet&&((Wi=Ti.store)==null||Wi.set("sidebarView",Ni.view).catch(()=>{}))},webViewerUpdateViewarea:function(Ni){var Ui,Hi;const Wi=Ni.location;Ti.isInitialViewSet&&((Ui=Ti.store)==null||Ui.setMultiple({page:Wi.pageNumber,zoom:Wi.scale,scrollLeft:Wi.left,scrollTop:Wi.top,rotation:Wi.rotation}).catch(()=>{}));const zi=Ti.pdfLinkService.getAnchorUrl(Wi.pdfOpenParams);Ti.appConfig.toolbar.viewBookmark.href=zi,Ti.appConfig.secondaryToolbar.viewBookmarkButton.href=zi;const Di=((Hi=Ti.pdfViewer.getPageView(Ti.page-1))==null?void 0:Hi.renderingState)!==wi.RenderingStates.FINISHED;Ti.toolbar.updateLoadingIndicatorState(Di)},webViewerScrollModeChanged:function(Ni){var Wi;Ti.isInitialViewSet&&((Wi=Ti.store)==null||Wi.set("scrollMode",Ni.mode).catch(()=>{}))},webViewerSpreadModeChanged:function(Ni){var Wi;Ti.isInitialViewSet&&((Wi=Ti.store)==null||Wi.set("spreadMode",Ni.mode).catch(()=>{}))},webViewerResize:function(){const{pdfDocument:Ni,pdfViewer:Wi}=Ti;if(!Ni)return;const zi=Wi.currentScaleValue;zi!=="auto"&&zi!=="page-fit"&&zi!=="page-width"||(Wi.currentScaleValue=zi),Wi.update()},webViewerHashchange:function(Ni){var zi;const Wi=Ni.hash;Wi&&(Ti.isInitialViewSet?(zi=Ti.pdfHistory)!=null&&zi.popStateInProgress||Ti.pdfLinkService.setHash(Wi):Ti.initialBookmark=Wi)},webViewerFileInputChange:Mi,webViewerPresentationMode:function(){Ti.requestPresentationMode()},webViewerPrint:function(){Ti.triggerPrinting()},webViewerDownload:function(){Ti.downloadOrSave({sourceEventType:"download"})},webViewerSave:Bi,webViewerFirstPage:function(){Ti.pdfDocument&&(Ti.page=1)},webViewerLastPage:function(){Ti.pdfDocument&&(Ti.page=Ti.pagesCount)},webViewerNextPage:function(){Ti.pdfViewer.nextPage()},webViewerPreviousPage:function(){Ti.pdfViewer.previousPage()},webViewerZoomIn:function(){Ti.zoomIn()},webViewerZoomOut:function(){Ti.zoomOut()},webViewerZoomReset:function(){Ti.zoomReset()},webViewerPageNumberChanged:function(Ni){const Wi=Ti.pdfViewer;Ni.value!==""&&Ti.pdfLinkService.goToPage(Ni.value),Ni.value!==Wi.currentPageNumber.toString()&&Ni.value!==Wi.currentPageLabel&&Ti.toolbar.setPageNumber(Wi.currentPageNumber,Wi.currentPageLabel)},webViewerScaleChanged:function(Ni){Ti.pdfViewer.currentScaleValue=Ni.value},webViewerRotateCw:function(){Ti.rotatePages(90)},webViewerRotateCcw:function(){Ti.rotatePages(-90)},webViewerOptionalContentConfig:function(Ni){Ti.pdfViewer.optionalContentConfigPromise=Ni.promise},webViewerSwitchScrollMode:function(Ni){Ti.pdfViewer.scrollMode=Ni.mode},webViewerSwitchSpreadMode:function(Ni){Ti.pdfViewer.spreadMode=Ni.mode},webViewerDocumentProperties:function(){Ti.pdfDocumentProperties.open()},webViewerUpdateFindMatchesCount:function({matchesCount:Ni}){Ti.supportsIntegratedFind?Ti.externalServices.updateFindMatchesCount(Ni):Ti.findBar.updateResultsCount(Ni)},webViewerUpdateFindControlState:function({state:Ni,previous:Wi,matchesCount:zi,rawQuery:Di}){Ti.supportsIntegratedFind?Ti.externalServices.updateFindControlState({result:Ni,findPrevious:Wi,matchesCount:zi,rawQuery:Di}):Ti.findBar.updateUIState(Ni,Wi,zi)},webViewerScaleChanging:function(Ni){Ti.toolbar.setPageScale(Ni.presetValue,Ni.scale),Ti.pdfViewer.update()},webViewerRotationChanging:function(Ni){Ti.pdfThumbnailViewer.pagesRotation=Ni.pagesRotation,Ti.forceRendering(),Ti.pdfViewer.currentPageNumber=Ni.pageNumber},webViewerPageChanging:function({pageNumber:Ni,pageLabel:Wi}){Ti.toolbar.setPageNumber(Ni,Wi),Ti.secondaryToolbar.setPageNumber(Ni),Ti.pdfSidebar.isThumbnailViewVisible&&Ti.pdfThumbnailViewer.scrollThumbnailIntoView(Ni)},webViewerVisibilityChange:function(Ni){document.visibilityState==="visible"&&Vi()},setZoomDisabledTimeout:Vi,webViewerWheel:function(Ni){const{pdfViewer:Wi,supportedMouseWheelZoomModifierKeys:zi}=Ti;if(!Wi.isInPresentationMode)if(Ni.ctrlKey&&zi.ctrlKey||Ni.metaKey&&zi.metaKey){if(Ni.preventDefault(),Ri||document.visibilityState==="hidden")return;const Di=Ni.deltaMode,Ui=(0,wi.normalizeWheelEventDirection)(Ni),Hi=Wi.currentScale;let qi=0;Di===WheelEvent.DOM_DELTA_LINE||Di===WheelEvent.DOM_DELTA_PAGE?qi=Math.abs(Ui)>=1?Math.sign(Ui):Ti.accumulateWheelTicks(Ui):qi=Ti.accumulateWheelTicks(Ui/30),qi<0?Ti.zoomOut(-qi):qi>0&&Ti.zoomIn(qi);const Gi=Wi.currentScale;if(Hi!==Gi){const Ki=Gi/Hi-1,Qi=Wi.container.getBoundingClientRect(),Xi=Ni.clientX-Qi.left,rr=Ni.clientY-Qi.top;Wi.container.scrollLeft+=Xi*Ki,Wi.container.scrollTop+=rr*Ki}}else Vi()},webViewerTouchStart:function(Ni){Ni.touches.length>1&&Ni.preventDefault()},webViewerClick:function(Ni){if(!Ti.secondaryToolbar.isOpen)return;const Wi=Ti.appConfig;(Ti.pdfViewer.containsElement(Ni.target)||Wi.toolbar.container.contains(Ni.target)&&Ni.target!==Wi.secondaryToolbar.toggleButton)&&Ti.secondaryToolbar.close()},webViewerKeyDown:function(Ni){if(Ti.overlayManager.active)return;const{eventBus:Wi,pdfViewer:zi}=Ti,Di=zi.isInPresentationMode;let Ui=!1,Hi=!1;const qi=(Ni.ctrlKey?1:0)|(Ni.altKey?2:0)|(Ni.shiftKey?4:0)|(Ni.metaKey?8:0);if(qi===1||qi===8||qi===5||qi===12)switch(Ni.keyCode){case 70:!Ti.supportsIntegratedFind&&!Ni.shiftKey&&(Ti.findBar.open(),Ui=!0);break;case 71:if(!Ti.supportsIntegratedFind){const{state:Qi}=Ti.findController;if(Qi){const Xi=Object.assign(Object.create(null),Qi,{source:window,type:"again",findPrevious:qi===5||qi===12});Wi.dispatch("find",Xi)}Ui=!0}break;case 61:case 107:case 187:case 171:Di||Ti.zoomIn(),Ui=!0;break;case 173:case 109:case 189:Di||Ti.zoomOut(),Ui=!0;break;case 48:case 96:Di||(setTimeout(function(){Ti.zoomReset()}),Ui=!1);break;case 38:(Di||Ti.page>1)&&(Ti.page=1,Ui=!0,Hi=!0);break;case 40:(Di||Ti.page1)&&(Ti.page=1,Ui=!0,Hi=!0);break;case 35:(Di||Ti.page0?zi.nextPage():zi.previousPage(),Ui=!0)}if(qi===4)switch(Ni.keyCode){case 13:case 32:if(!Di&&zi.currentScaleValue!=="page-fit")break;zi.previousPage(),Ui=!0;break;case 82:Ti.rotatePages(-90)}Ui||Di||(Ni.keyCode>=33&&Ni.keyCode<=40||Ni.keyCode===32&&Ki!=="BUTTON")&&(Hi=!0),Hi&&!zi.containsElement(Gi)&&zi.focus(),Ui&&Ni.preventDefault()}},beforeUnload:function(Ni){return Ni.preventDefault(),Ni.returnValue="",!1},webViewerFindFromUrlHash:function(Ni){Ti.eventBus.dispatch("find",{source:Ni.source,type:"",query:Ni.query,phraseSearch:Ni.phraseSearch,caseSensitive:!1,entireWord:!1,highlightAll:!0,findPrevious:!1,matchDiacritics:!0})},webViewerOpenFile:Fi}};Si.default=xi},(Ai,Si,Ei)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.PDFCursorTools=Si.CursorTool=void 0;var wi=Ei(10),Ci=Ei(1);const ki={SELECT:0,HAND:1,ZOOM:2};Si.CursorTool=ki,Si.PDFCursorTools=class{constructor({container:xi,eventBus:Ti,cursorToolOnLoad:Oi=ki.SELECT}){this.container=xi,this.eventBus=Ti,this.active=ki.SELECT,this.activeBeforePresentationMode=null,this.handTool=new wi.GrabToPan({element:this.container}),this._addEventListeners(),Promise.resolve().then(()=>{this.switchTool(Oi)})}get activeTool(){return this.active}switchTool(xi){if(this.activeBeforePresentationMode!==null||xi===this.active)return;const Ti=()=>{switch(this.active){case ki.SELECT:break;case ki.HAND:this.handTool.deactivate()}};switch(xi){case ki.SELECT:Ti();break;case ki.HAND:Ti(),this.handTool.activate();break;default:return}this.active=xi,this._dispatchEvent()}_dispatchEvent(){this.eventBus.dispatch("cursortoolchanged",{source:this,tool:this.active})}_addEventListeners(){this.eventBus._on("switchcursortool",xi=>{this.switchTool(xi.tool)}),this.eventBus._on("presentationmodechanged",xi=>{switch(xi.state){case Ci.PresentationModeState.FULLSCREEN:{const Ti=this.active;this.switchTool(ki.SELECT),this.activeBeforePresentationMode=Ti;break}case Ci.PresentationModeState.NORMAL:{const Ti=this.activeBeforePresentationMode;this.activeBeforePresentationMode=null,this.switchTool(Ti);break}}})}}},(Ai,Si)=>{var wi,xs,ki,Is,Ti,ks,ji;Object.defineProperty(Si,"__esModule",{value:!0}),Si.GrabToPan=void 0;const Ei="grab-to-pan-grab";Si.GrabToPan=(ji=class{constructor(Li){Er(this,wi);Er(this,ki);Er(this,Ti);this.element=Li.element,this.document=Li.element.ownerDocument,typeof Li.ignoreTarget=="function"&&(this.ignoreTarget=Li.ignoreTarget),this.onActiveChanged=Li.onActiveChanged,this.activate=this.activate.bind(this),this.deactivate=this.deactivate.bind(this),this.toggle=this.toggle.bind(this),this._onMouseDown=xr(this,wi,xs).bind(this),this._onMouseMove=xr(this,ki,Is).bind(this),this._endPan=xr(this,Ti,ks).bind(this),(this.overlay=document.createElement("div")).className="grab-to-pan-grabbing"}activate(){var Li;this.active||(this.active=!0,this.element.addEventListener("mousedown",this._onMouseDown,!0),this.element.classList.add(Ei),(Li=this.onActiveChanged)==null||Li.call(this,!0))}deactivate(){var Li;this.active&&(this.active=!1,this.element.removeEventListener("mousedown",this._onMouseDown,!0),this._endPan(),this.element.classList.remove(Ei),(Li=this.onActiveChanged)==null||Li.call(this,!1))}toggle(){this.active?this.deactivate():this.activate()}ignoreTarget(Li){return Li.matches("a[href], a[href] *, input, textarea, button, button *, select, option")}},wi=new WeakSet,xs=function(Li){if(Li.button!==0||this.ignoreTarget(Li.target))return;if(Li.originalTarget)try{Li.originalTarget.tagName}catch{return}this.scrollLeftStart=this.element.scrollLeft,this.scrollTopStart=this.element.scrollTop,this.clientXStart=Li.clientX,this.clientYStart=Li.clientY,this.document.addEventListener("mousemove",this._onMouseMove,!0),this.document.addEventListener("mouseup",this._endPan,!0),this.element.addEventListener("scroll",this._endPan,!0),Li.preventDefault(),Li.stopPropagation();const Ii=document.activeElement;Ii&&!Ii.contains(Li.target)&&Ii.blur()},ki=new WeakSet,Is=function(Li){if(this.element.removeEventListener("scroll",this._endPan,!0),!(1&Li.buttons)){this._endPan();return}const Ii=Li.clientX-this.clientXStart,Mi=Li.clientY-this.clientYStart,Fi=this.scrollTopStart-Mi,Bi=this.scrollLeftStart-Ii;this.element.scrollTo?this.element.scrollTo({top:Fi,left:Bi,behavior:"instant"}):(this.element.scrollTop=Fi,this.element.scrollLeft=Bi),this.overlay.parentNode||document.body.appendChild(this.overlay)},Ti=new WeakSet,ks=function(){this.element.removeEventListener("scroll",this._endPan,!0),this.document.removeEventListener("mousemove",this._onMouseMove,!0),this.document.removeEventListener("mouseup",this._endPan,!0),this.overlay.remove()},ji)},(Ai,Si)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.OverlayManager=void 0,Si.OverlayManager=class{constructor(){this._overlays={},this._active=null,this._keyDownBound=this._keyDown.bind(this)}get active(){return this._active}async register(Ei,wi,Ci=null,ki=!1){let xi;if(!(Ei&&wi&&(xi=wi.parentNode)))throw new Error("Not enough parameters.");if(this._overlays[Ei])throw new Error("The overlay is already registered.");this._overlays[Ei]={element:wi,container:xi,callerCloseMethod:Ci,canForceClose:ki}}async unregister(Ei){if(!this._overlays[Ei])throw new Error("The overlay does not exist.");if(this._active===Ei)throw new Error("The overlay cannot be removed while it is active.");delete this._overlays[Ei]}async open(Ei){if(!this._overlays[Ei])throw new Error("The overlay does not exist.");if(this._active){if(!this._overlays[Ei].canForceClose)throw this._active===Ei?new Error("The overlay is already active."):new Error("Another overlay is currently active.");this._closeThroughCaller()}this._active=Ei,this._overlays[this._active].element.classList.remove("hidden"),this._overlays[this._active].container.classList.remove("hidden"),window.addEventListener("keydown",this._keyDownBound)}async close(Ei){if(!this._overlays[Ei])throw new Error("The overlay does not exist.");if(!this._active)throw new Error("The overlay is currently not active.");if(this._active!==Ei)throw new Error("Another overlay is currently active.");this._overlays[this._active].container.classList.add("hidden"),this._overlays[this._active].element.classList.add("hidden"),this._active=null,window.removeEventListener("keydown",this._keyDownBound)}_keyDown(Ei){this._active&&Ei.keyCode===27&&(this._closeThroughCaller(),Ei.preventDefault())}_closeThroughCaller(){this._overlays[this._active].callerCloseMethod&&this._overlays[this._active].callerCloseMethod(),this._active&&this.close(this._active)}}},(Ai,Si,Ei)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.PDFFindController=Si.FindState=void 0;var wi=Ei(1),Ci=Ei(6),ki=Ei(13);const xi={FOUND:0,NOT_FOUND:1,WRAPPED:2,PENDING:3};Si.FindState=xi;const Ti={"‐":"-","‘":"'","’":"'","‚":"'","‛":"'","“":'"',"”":'"',"„":'"',"‟":'"',"¼":"1/4","½":"1/2","¾":"3/4"},Oi=new Set([12441,12442,2381,2509,2637,2765,2893,3021,3149,3277,3387,3388,3405,3530,3642,3770,3972,4153,4154,5908,5940,6098,6752,6980,7082,7083,7154,7155,11647,43014,43052,43204,43347,43456,43766,44013,3158,3953,3954,3962,3963,3964,3965,3968,3956]),ji=[...Oi.values()].map(Ni=>String.fromCharCode(Ni)).join(""),Li=/\p{M}+/gu,Ii=/([.*+?^${}()|[\]\\])|(\p{P})|(\s+)|(\p{M})|(\p{L})/gu,Mi=/([^\p{M}])\p{M}*$/u,Fi=/^\p{M}*([^\p{M}])/u;let Bi=null;function Ri(Ni){if(!Bi){const Xi=Object.keys(Ti).join("");Bi=new RegExp(`([${Xi}])|(\\p{M}+(?:-\\n)?)|(\\S-\\n)|(\\n)`,"gum")}const Wi=[];let zi;for(;(zi=Li.exec(Ni))!==null;)Wi.push([zi[0].length,zi.index]);let Di=Ni.normalize("NFD");const Ui=[[0,0]];let Hi=0,qi=0,Gi=0,Ki=0,Qi=!1;return Di=Di.replace(Bi,(Xi,rr,ar,gr,fr,lr)=>{var mr;if(lr-=Gi,rr){const vr=Ti[Xi],Yi=vr.length;for(let nr=1;nrGi[0]>=Di);Ni[Hi][0]>Di&&--Hi;let qi=(0,wi.binarySearchFirstItem)(Ni,Gi=>Gi[0]>=Ui,Hi);return Ni[qi][0]>Ui&&--qi,[Di+Ni[Hi][1],zi+Ni[qi][1]-Ni[Hi][1]]}Si.PDFFindController=class{constructor({linkService:Ni,eventBus:Wi}){this._linkService=Ni,this._eventBus=Wi,this._reset(),Wi._on("find",this._onFind.bind(this)),Wi._on("findbarclose",this._onFindBarClose.bind(this)),this.executeCommand=(zi,Di)=>{const Ui=Object.assign(Object.create(null),Di,{type:zi.substring(4)});this._onFind(Ui)}}get highlightMatches(){return this._highlightMatches}get pageMatches(){return this._pageMatches}get pageMatchesLength(){return this._pageMatchesLength}get selected(){return this._selected}get state(){return this._state}setDocument(Ni){this._pdfDocument&&this._reset(),Ni&&(this._pdfDocument=Ni,this._firstPageCapability.resolve())}_onFind(Ni){if(!Ni)return;const Wi=this._pdfDocument,{type:zi}=Ni;(this._state===null||this._shouldDirtyMatch(Ni))&&(this._dirtyMatch=!0),this._state=Ni,zi!=="highlightallchange"&&this._updateUIState(xi.PENDING),this._firstPageCapability.promise.then(()=>{if(!this._pdfDocument||Wi&&this._pdfDocument!==Wi)return;this._extractText();const Di=!this._highlightMatches,Ui=!!this._findTimeout;this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),zi?this._dirtyMatch?this._nextMatch():zi==="again"?(this._nextMatch(),Di&&this._state.highlightAll&&this._updateAllPages()):zi==="highlightallchange"?(Ui?this._nextMatch():this._highlightMatches=!0,this._updateAllPages()):this._nextMatch():this._findTimeout=setTimeout(()=>{this._nextMatch(),this._findTimeout=null},250)})}scrollMatchIntoView({element:Ni=null,selectedLeft:Wi=0,pageIndex:zi=-1,matchIndex:Di=-1}){if(!this._scrollMatches||!Ni||Di===-1||Di!==this._selected.matchIdx||zi===-1||zi!==this._selected.pageIdx)return;this._scrollMatches=!1;const Ui={top:-150,left:Wi+-400};(0,wi.scrollIntoView)(Ni,Ui,!0)}_reset(){this._highlightMatches=!1,this._scrollMatches=!1,this._pdfDocument=null,this._pageMatches=[],this._pageMatchesLength=[],this._state=null,this._selected={pageIdx:-1,matchIdx:-1},this._offset={pageIdx:null,matchIdx:null,wrapped:!1},this._extractTextPromises=[],this._pageContents=[],this._pageDiffs=[],this._hasDiacritics=[],this._matchesCountTotal=0,this._pagesToSearch=null,this._pendingFindMatches=new Set,this._resumePageIdx=null,this._dirtyMatch=!1,clearTimeout(this._findTimeout),this._findTimeout=null,this._firstPageCapability=(0,Ci.createPromiseCapability)()}get _query(){return this._state.query!==this._rawQuery&&(this._rawQuery=this._state.query,[this._normalizedQuery]=Ri(this._state.query)),this._normalizedQuery}_shouldDirtyMatch(Ni){if(Ni.query!==this._state.query)return!0;switch(Ni.type){case"again":const Wi=this._selected.pageIdx+1,zi=this._linkService;return Wi>=1&&Wi<=zi.pagesCount&&Wi!==zi.page&&!zi.isPageVisible(Wi);case"highlightallchange":return!1}return!0}_isEntireWord(Ni,Wi,zi){let Di=Ni.slice(0,Wi).match(Mi);if(Di){const Ui=Ni.charCodeAt(Wi),Hi=Di[1].charCodeAt(0);if((0,ki.getCharacterType)(Ui)===(0,ki.getCharacterType)(Hi))return!1}if(Di=Ni.slice(Wi+zi).match(Fi),Di){const Ui=Ni.charCodeAt(Wi+zi-1),Hi=Di[1].charCodeAt(0);if((0,ki.getCharacterType)(Ui)===(0,ki.getCharacterType)(Hi))return!1}return!0}_calculateRegExpMatch(Ni,Wi,zi,Di){const Ui=[],Hi=[],qi=this._pageDiffs[zi];let Gi;for(;(Gi=Ni.exec(Di))!==null;){if(Wi&&!this._isEntireWord(Di,Gi.index,Gi[0].length))continue;const[Ki,Qi]=Vi(qi,Gi.index,Gi[0].length);Qi&&(Ui.push(Ki),Hi.push(Qi))}this._pageMatches[zi]=Ui,this._pageMatchesLength[zi]=Hi}_convertToRegExpString(Ni,Wi){const{matchDiacritics:zi}=this._state;let Di=!1;const Ui="[ ]*";return(Ni=Ni.replace(Ii,(Hi,qi,Gi,Ki,Qi,Xi)=>qi?`[ ]*\\${qi}[ ]*`:Gi?`[ ]*${Gi}[ ]*`:Ki?"[ ]+":zi?Qi||Xi:Qi?Oi.has(Qi.charCodeAt(0))?Qi:"":Wi?(Di=!0,`${Xi}\\p{M}*`):Xi)).endsWith(Ui)&&(Ni=Ni.slice(0,Ni.length-Ui.length)),zi&&Wi&&(Di=!0,Ni=`${Ni}(?=[${ji}]|[^\\p{M}]|$)`),[Di,Ni]}_calculateMatch(Ni){let Wi=this._query;if(Wi.length===0)return;const{caseSensitive:zi,entireWord:Di,phraseSearch:Ui}=this._state,Hi=this._pageContents[Ni],qi=this._hasDiacritics[Ni];let Gi=!1;if(Ui)[Gi,Wi]=this._convertToRegExpString(Wi,qi);else{const Qi=Wi.match(/\S+/g);Qi&&(Wi=Qi.sort().reverse().map(Xi=>{const[rr,ar]=this._convertToRegExpString(Xi,qi);return Gi||(Gi=rr),`(${ar})`}).join("|"))}Wi=new RegExp(Wi,`g${Gi?"u":""}${zi?"":"i"}`),this._calculateRegExpMatch(Wi,Di,Ni,Hi),this._state.highlightAll&&this._updatePage(Ni),this._resumePageIdx===Ni&&(this._resumePageIdx=null,this._nextPageMatch());const Ki=this._pageMatches[Ni].length;Ki>0&&(this._matchesCountTotal+=Ki,this._updateUIResultsCount())}_extractText(){if(this._extractTextPromises.length>0)return;let Ni=Promise.resolve();for(let Wi=0,zi=this._linkService.pagesCount;Withis._pdfDocument.getPage(Wi+1).then(Ui=>Ui.getTextContent()).then(Ui=>{const Hi=Ui.items,qi=[];for(let Gi=0,Ki=Hi.length;Gi{this._pageContents[Wi]="",this._pageDiffs[Wi]=null,this._hasDiacritics[Wi]=!1,Di.resolve(Wi)}))}}_updatePage(Ni){this._scrollMatches&&this._selected.pageIdx===Ni&&(this._linkService.page=Ni+1),this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:Ni})}_updateAllPages(){this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:-1})}_nextMatch(){const Ni=this._state.findPrevious,Wi=this._linkService.page-1,zi=this._linkService.pagesCount;if(this._highlightMatches=!0,this._dirtyMatch){this._dirtyMatch=!1,this._selected.pageIdx=this._selected.matchIdx=-1,this._offset.pageIdx=Wi,this._offset.matchIdx=null,this._offset.wrapped=!1,this._resumePageIdx=null,this._pageMatches.length=0,this._pageMatchesLength.length=0,this._matchesCountTotal=0,this._updateAllPages();for(let Ui=0;Ui{this._pendingFindMatches.delete(Hi),this._calculateMatch(Hi)}))}if(this._query===""){this._updateUIState(xi.FOUND);return}if(this._resumePageIdx)return;const Di=this._offset;if(this._pagesToSearch=zi,Di.matchIdx!==null){const Ui=this._pageMatches[Di.pageIdx].length;if(!Ni&&Di.matchIdx+10){Di.matchIdx=Ni?Di.matchIdx-1:Di.matchIdx+1,this._updateMatch(!0);return}this._advanceOffsetPage(Ni)}this._nextPageMatch()}_matchesReady(Ni){const Wi=this._offset,zi=Ni.length,Di=this._state.findPrevious;return zi?(Wi.matchIdx=Di?zi-1:0,this._updateMatch(!0),!0):(this._advanceOffsetPage(Di),Wi.wrapped&&(Wi.matchIdx=null,this._pagesToSearch<0)?(this._updateMatch(!1),!0):!1)}_nextPageMatch(){this._resumePageIdx;let Ni=null;do{const Wi=this._offset.pageIdx;if(Ni=this._pageMatches[Wi],!Ni){this._resumePageIdx=Wi;break}}while(!this._matchesReady(Ni))}_advanceOffsetPage(Ni){const Wi=this._offset,zi=this._linkService.pagesCount;Wi.pageIdx=Ni?Wi.pageIdx-1:Wi.pageIdx+1,Wi.matchIdx=null,this._pagesToSearch--,(Wi.pageIdx>=zi||Wi.pageIdx<0)&&(Wi.pageIdx=Ni?zi-1:0,Wi.wrapped=!0)}_updateMatch(Ni=!1){let Wi=xi.NOT_FOUND;const zi=this._offset.wrapped;if(this._offset.wrapped=!1,Ni){const Di=this._selected.pageIdx;this._selected.pageIdx=this._offset.pageIdx,this._selected.matchIdx=this._offset.matchIdx,Wi=zi?xi.WRAPPED:xi.FOUND,Di!==-1&&Di!==this._selected.pageIdx&&this._updatePage(Di)}this._updateUIState(Wi,this._state.findPrevious),this._selected.pageIdx!==-1&&(this._scrollMatches=!0,this._updatePage(this._selected.pageIdx))}_onFindBarClose(Ni){const Wi=this._pdfDocument;this._firstPageCapability.promise.then(()=>{this._pdfDocument&&(!Wi||this._pdfDocument===Wi)&&(this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),this._resumePageIdx&&(this._resumePageIdx=null,this._dirtyMatch=!0),this._updateUIState(xi.FOUND),this._highlightMatches=!1,this._updateAllPages())})}_requestMatchesCount(){var Ui;const{pageIdx:Ni,matchIdx:Wi}=this._selected;let zi=0,Di=this._matchesCountTotal;if(Wi!==-1){for(let Hi=0;HiDi)&&(zi=Di=0),{current:zi,total:Di}}_updateUIResultsCount(){this._eventBus.dispatch("updatefindmatchescount",{source:this,matchesCount:this._requestMatchesCount()})}_updateUIState(Ni,Wi=!1){var zi,Di;this._eventBus.dispatch("updatefindcontrolstate",{source:this,state:Ni,previous:Wi,matchesCount:this._requestMatchesCount(),rawQuery:(Di=(zi=this._state)==null?void 0:zi.query)!=null?Di:null})}}},(Ai,Si)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.CharacterType=void 0,Si.getCharacterType=function(wi){return function(Ci){return Ci<11904}(wi)?function(Ci){return(65408&Ci)==0}(wi)?function(Ci){return Ci===32||Ci===9||Ci===13||Ci===10}(wi)?Ei.SPACE:function(Ci){return Ci>=97&&Ci<=122||Ci>=65&&Ci<=90}(wi)||function(Ci){return Ci>=48&&Ci<=57}(wi)||wi===95?Ei.ALPHA_LETTER:Ei.PUNCT:function(Ci){return(65408&Ci)==3584}(wi)?Ei.THAI_LETTER:wi===160?Ei.SPACE:Ei.ALPHA_LETTER:function(Ci){return Ci>=13312&&Ci<=40959||Ci>=63744&&Ci<=64255}(wi)?Ei.HAN_LETTER:function(Ci){return Ci>=12448&&Ci<=12543}(wi)?Ei.KATAKANA_LETTER:function(Ci){return Ci>=12352&&Ci<=12447}(wi)?Ei.HIRAGANA_LETTER:function(Ci){return Ci>=65376&&Ci<=65439}(wi)?Ei.HALFWIDTH_KATAKANA_LETTER:Ei.ALPHA_LETTER};const Ei={SPACE:0,ALPHA_LETTER:1,PUNCT:2,HAN_LETTER:3,KATAKANA_LETTER:4,HIRAGANA_LETTER:5,HALFWIDTH_KATAKANA_LETTER:6,THAI_LETTER:7};Si.CharacterType=Ei},(Ai,Si,Ei)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.PDFScriptingManager=void 0;var wi=Ei(1),Ci=Ei(6);Si.PDFScriptingManager=class{constructor({eventBus:ki,sandboxBundleSrc:xi=null,scriptingFactory:Ti=null,docPropertiesLookup:Oi=null}){this._pdfDocument=null,this._pdfViewer=null,this._closeCapability=null,this._destroyCapability=null,this._scripting=null,this._mouseState=Object.create(null),this._ready=!1,this._eventBus=ki,this._sandboxBundleSrc=xi,this._scriptingFactory=Ti,this._docPropertiesLookup=Oi}setViewer(ki){this._pdfViewer=ki}async setDocument(ki){var ji;if(this._pdfDocument&&await this._destroyScripting(),this._pdfDocument=ki,!ki)return;const[xi,Ti,Oi]=await Promise.all([ki.getFieldObjects(),ki.getCalculationOrderIds(),ki.getJSActions()]);if(xi||Oi){if(ki===this._pdfDocument){try{this._scripting=this._createScripting()}catch{await this._destroyScripting();return}this._internalEvents.set("updatefromsandbox",Li=>{(Li==null?void 0:Li.source)===window&&this._updateFromSandbox(Li.detail)}),this._internalEvents.set("dispatcheventinsandbox",Li=>{var Ii;(Ii=this._scripting)==null||Ii.dispatchEventInSandbox(Li.detail)}),this._internalEvents.set("pagechanging",({pageNumber:Li,previous:Ii})=>{Li!==Ii&&(this._dispatchPageClose(Ii),this._dispatchPageOpen(Li))}),this._internalEvents.set("pagerendered",({pageNumber:Li})=>{this._pageOpenPending.has(Li)&&Li===this._pdfViewer.currentPageNumber&&this._dispatchPageOpen(Li)}),this._internalEvents.set("pagesdestroy",async Li=>{var Ii,Mi;await this._dispatchPageClose(this._pdfViewer.currentPageNumber),await((Ii=this._scripting)==null?void 0:Ii.dispatchEventInSandbox({id:"doc",name:"WillClose"})),(Mi=this._closeCapability)==null||Mi.resolve()}),this._domEvents.set("mousedown",Li=>{this._mouseState.isDown=!0}),this._domEvents.set("mouseup",Li=>{this._mouseState.isDown=!1});for(const[Li,Ii]of this._internalEvents)this._eventBus._on(Li,Ii);for(const[Li,Ii]of this._domEvents)window.addEventListener(Li,Ii);try{const Li=await this._getDocProperties();if(ki!==this._pdfDocument)return;await this._scripting.createSandbox({objects:xi,calculationOrder:Ti,appInfo:{platform:navigator.platform,language:navigator.language},docInfo:{...Li,actions:Oi}}),this._eventBus.dispatch("sandboxcreated",{source:this})}catch{await this._destroyScripting();return}await((ji=this._scripting)==null?void 0:ji.dispatchEventInSandbox({id:"doc",name:"Open"})),await this._dispatchPageOpen(this._pdfViewer.currentPageNumber,!0),Promise.resolve().then(()=>{ki===this._pdfDocument&&(this._ready=!0)})}}else await this._destroyScripting()}async dispatchWillSave(ki){var xi;return(xi=this._scripting)==null?void 0:xi.dispatchEventInSandbox({id:"doc",name:"WillSave"})}async dispatchDidSave(ki){var xi;return(xi=this._scripting)==null?void 0:xi.dispatchEventInSandbox({id:"doc",name:"DidSave"})}async dispatchWillPrint(ki){var xi;return(xi=this._scripting)==null?void 0:xi.dispatchEventInSandbox({id:"doc",name:"WillPrint"})}async dispatchDidPrint(ki){var xi;return(xi=this._scripting)==null?void 0:xi.dispatchEventInSandbox({id:"doc",name:"DidPrint"})}get mouseState(){return this._mouseState}get destroyPromise(){var ki;return((ki=this._destroyCapability)==null?void 0:ki.promise)||null}get ready(){return this._ready}get _internalEvents(){return(0,Ci.shadow)(this,"_internalEvents",new Map)}get _domEvents(){return(0,Ci.shadow)(this,"_domEvents",new Map)}get _pageOpenPending(){return(0,Ci.shadow)(this,"_pageOpenPending",new Set)}get _visitedPages(){return(0,Ci.shadow)(this,"_visitedPages",new Map)}async _updateFromSandbox(ki){var Mi;const xi=this._pdfViewer.isInPresentationMode||this._pdfViewer.isChangingPresentationMode,{id:Ti,siblings:Oi,command:ji,value:Li}=ki;if(!Ti){switch(ji){case"clear":case"error":case"println":break;case"layout":if(xi)return;const Fi=(0,wi.apiPageLayoutToViewerModes)(Li);this._pdfViewer.spreadMode=Fi.spreadMode;break;case"page-num":this._pdfViewer.currentPageNumber=Li+1;break;case"print":await this._pdfViewer.pagesPromise,this._eventBus.dispatch("print",{source:this});break;case"zoom":if(xi)return;this._pdfViewer.currentScaleValue=Li;break;case"SaveAs":this._eventBus.dispatch("save",{source:this});break;case"FirstPage":this._pdfViewer.currentPageNumber=1;break;case"LastPage":this._pdfViewer.currentPageNumber=this._pdfViewer.pagesCount;break;case"NextPage":this._pdfViewer.nextPage();break;case"PrevPage":this._pdfViewer.previousPage();break;case"ZoomViewIn":if(xi)return;this._pdfViewer.increaseScale();break;case"ZoomViewOut":if(xi)return;this._pdfViewer.decreaseScale()}return}if(xi&&ki.focus)return;delete ki.id,delete ki.siblings;const Ii=Oi?[Ti,...Oi]:[Ti];for(const Fi of Ii){const Bi=document.getElementById(Fi);Bi?Bi.dispatchEvent(new CustomEvent("updatefromsandbox",{detail:ki})):(Mi=this._pdfDocument)==null||Mi.annotationStorage.setValue(Fi,ki)}}async _dispatchPageOpen(ki,xi=!1){const Ti=this._pdfDocument,Oi=this._visitedPages;if(xi&&(this._closeCapability=(0,Ci.createPromiseCapability)()),!this._closeCapability)return;const ji=this._pdfViewer.getPageView(ki-1);if((ji==null?void 0:ji.renderingState)!==wi.RenderingStates.FINISHED){this._pageOpenPending.add(ki);return}this._pageOpenPending.delete(ki);const Li=(async()=>{var Mi,Fi;const Ii=await(Oi.has(ki)?null:(Mi=ji.pdfPage)==null?void 0:Mi.getJSActions());Ti===this._pdfDocument&&await((Fi=this._scripting)==null?void 0:Fi.dispatchEventInSandbox({id:"page",name:"PageOpen",pageNumber:ki,actions:Ii}))})();Oi.set(ki,Li)}async _dispatchPageClose(ki){var ji;const xi=this._pdfDocument,Ti=this._visitedPages;if(!this._closeCapability||this._pageOpenPending.has(ki))return;const Oi=Ti.get(ki);Oi&&(Ti.set(ki,null),await Oi,xi===this._pdfDocument&&await((ji=this._scripting)==null?void 0:ji.dispatchEventInSandbox({id:"page",name:"PageClose",pageNumber:ki})))}async _getDocProperties(){if(this._docPropertiesLookup)return this._docPropertiesLookup(this._pdfDocument);throw new Error("_getDocProperties: Unable to lookup properties.")}_createScripting(){if(this._destroyCapability=(0,Ci.createPromiseCapability)(),this._scripting)throw new Error("_createScripting: Scripting already exists.");if(this._scriptingFactory)return this._scriptingFactory.createScripting({sandboxBundleSrc:this._sandboxBundleSrc});throw new Error("_createScripting: Cannot create scripting.")}async _destroyScripting(){var ki,xi;if(this._scripting){this._closeCapability&&(await Promise.race([this._closeCapability.promise,new Promise(Ti=>{setTimeout(Ti,1e3)})]).catch(Ti=>{}),this._closeCapability=null),this._pdfDocument=null;try{await this._scripting.destroySandbox()}catch{}for(const[Ti,Oi]of this._internalEvents)this._eventBus._off(Ti,Oi);this._internalEvents.clear();for(const[Ti,Oi]of this._domEvents)window.removeEventListener(Ti,Oi);this._domEvents.clear(),this._pageOpenPending.clear(),this._visitedPages.clear(),this._scripting=null,delete this._mouseState.isDown,this._ready=!1,(ki=this._destroyCapability)==null||ki.resolve()}else this._pdfDocument=null,(xi=this._destroyCapability)==null||xi.resolve()}}},(Ai,Si,Ei)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.PDFViewer=Si.PDFSinglePageViewer=void 0;var wi=Ei(1),Ci=Ei(16);class ki extends Ci.BaseViewer{}Si.PDFViewer=ki;class xi extends Ci.BaseViewer{_resetView(){super._resetView(),this._scrollMode=wi.ScrollMode.PAGE,this._spreadMode=wi.SpreadMode.NONE}set scrollMode(Oi){}_updateScrollMode(){}set spreadMode(Oi){}_updateSpreadMode(){}}Si.PDFSinglePageViewer=xi},(Ai,Si,Ei)=>{var Wi,zi,Di,Ps,Hi,qi,Gi,Ki,Qi,Xi,rr,ar,Ms,fr,Os,mr,hs,Yi,Ls,ir,Ds,tr,Rs,Ji,Fs;Object.defineProperty(Si,"__esModule",{value:!0}),Si.PagesCountLimit=Si.PDFPageViewBuffer=Si.BaseViewer=void 0;var wi=Ei(6),Ci=Ei(1),ki=Ei(17),xi=Ei(18),Ti=Ei(19),Oi=Ei(20),ji=Ei(7),Li=Ei(21),Ii=Ei(22),Mi=Ei(23),Fi=Ei(24);const Bi="enablePermissions",Ri={FORCE_SCROLL_MODE_PAGE:15e3,FORCE_LAZY_PAGE_INIT:7500,PAUSE_EAGER_PAGE_INIT:250};Si.PagesCountLimit=Ri;class Vi{constructor(Zi){Er(this,Di);Er(this,Wi,new Set);Er(this,zi,0);Nr(this,zi,Zi)}push(Zi){const er=Cr(this,Wi);er.has(Zi)&&er.delete(Zi),er.add(Zi),er.size>Cr(this,zi)&&xr(this,Di,Ps).call(this)}resize(Zi,er=null){Nr(this,zi,Zi);const hr=Cr(this,Wi);if(er){const ur=hr.size;let _r=1;for(const $r of hr)if(er.has($r.id)&&(hr.delete($r),hr.add($r)),++_r>ur)break}for(;hr.size>Cr(this,zi);)xr(this,Di,Ps).call(this)}has(Zi){return Cr(this,Wi).has(Zi)}[Symbol.iterator](){return Cr(this,Wi).keys()}}Wi=new WeakMap,zi=new WeakMap,Di=new WeakSet,Ps=function(){const Zi=Cr(this,Wi).keys().next().value;Zi==null||Zi.destroy(),Cr(this,Wi).delete(Zi)},Si.PDFPageViewBuffer=Vi;const pr=class{constructor(Zi){Er(this,ar);Er(this,fr);Er(this,mr);Er(this,Yi);Er(this,ir);Er(this,tr);Er(this,Ji);Er(this,Hi,null);Er(this,qi,wi.AnnotationMode.ENABLE_FORMS);Er(this,Gi,null);Er(this,Ki,!1);Er(this,Qi,0);Er(this,Xi,null);Er(this,rr,null);var hr,ur,_r,$r;if(this.constructor===pr)throw new Error("Cannot initialize BaseViewer.");const er="2.13.217-alpha.85";if(wi.version!==er)throw new Error(`The API version "${wi.version}" does not match the Viewer version "${er}".`);if(this.container=Zi.container,this.viewer=Zi.viewer||Zi.container.firstElementChild,((hr=this.container)==null?void 0:hr.tagName.toUpperCase())!=="DIV"||((ur=this.viewer)==null?void 0:ur.tagName.toUpperCase())!=="DIV")throw new Error("Invalid `container` and/or `viewer` option.");if(this.container.offsetParent&&getComputedStyle(this.container).position!=="absolute")throw new Error("The `container` must be absolutely positioned.");this.eventBus=Zi.eventBus,this.linkService=Zi.linkService||new ji.SimpleLinkService,this.downloadManager=Zi.downloadManager||null,this.findController=Zi.findController||null,this._scriptingManager=Zi.scriptingManager||null,this.removePageBorders=Zi.removePageBorders||!1,this.textLayerMode=(_r=Zi.textLayerMode)!=null?_r:Ci.TextLayerMode.ENABLE,Nr(this,qi,($r=Zi.annotationMode)!=null?$r:wi.AnnotationMode.ENABLE_FORMS),this.imageResourcesPath=Zi.imageResourcesPath||"",this.enablePrintAutoRotate=Zi.enablePrintAutoRotate||!1,this.renderer=Zi.renderer||Ci.RendererType.CANVAS,this.useOnlyCssZoom=Zi.useOnlyCssZoom||!1,this.maxCanvasPixels=Zi.maxCanvasPixels,this.l10n=Zi.l10n||xi.NullL10n,Nr(this,Ki,Zi.enablePermissions||!1),this.defaultRenderingQueue=!Zi.renderingQueue,this.defaultRenderingQueue?(this.renderingQueue=new Oi.PDFRenderingQueue,this.renderingQueue.setViewer(this)):this.renderingQueue=Zi.renderingQueue,this._doc=document.documentElement,this.scroll=(0,Ci.watchScroll)(this.container,this._scrollUpdate.bind(this)),this.presentationModeState=Ci.PresentationModeState.UNKNOWN,this._onBeforeDraw=this._onAfterDraw=null,this._resetView(),this.removePageBorders&&this.viewer.classList.add("removePageBorders"),Promise.resolve().then(()=>{this.eventBus.dispatch("baseviewerinit",{source:this})})}get pagesCount(){return this._pages.length}getPageView(Zi){return this._pages[Zi]}get pageViewsReady(){return!!this._pagesCapability.settled&&this._pages.every(function(Zi){return Zi==null?void 0:Zi.pdfPage})}get renderForms(){return Cr(this,qi)===wi.AnnotationMode.ENABLE_FORMS}get enableScripting(){return!!this._scriptingManager}get currentPageNumber(){return this._currentPageNumber}set currentPageNumber(Zi){if(!Number.isInteger(Zi))throw new Error("Invalid page number.");this.pdfDocument&&this._setCurrentPageNumber(Zi,!0)}_setCurrentPageNumber(Zi,er=!1){var ur,_r;if(this._currentPageNumber===Zi)return er&&this._resetCurrentPageView(),!0;if(!(0=0&&(er=hr+1)}this._setCurrentPageNumber(er,!0)}get currentScale(){return this._currentScale!==Ci.UNKNOWN_SCALE?this._currentScale:Ci.DEFAULT_SCALE}set currentScale(Zi){if(isNaN(Zi))throw new Error("Invalid numeric scale.");this.pdfDocument&&this._setScale(Zi,!1)}get currentScaleValue(){return this._currentScaleValue}set currentScaleValue(Zi){this.pdfDocument&&this._setScale(Zi,!1)}get pagesRotation(){return this._pagesRotation}set pagesRotation(Zi){if(!(0,Ci.isValidRotation)(Zi))throw new Error("Invalid pages rotation angle.");if(!this.pdfDocument||((Zi%=360)<0&&(Zi+=360),this._pagesRotation===Zi))return;this._pagesRotation=Zi;const er=this._currentPageNumber,hr={rotation:Zi};for(const ur of this._pages)ur.update(hr);this._currentScaleValue&&this._setScale(this._currentScaleValue,!0),this.eventBus.dispatch("rotationchanging",{source:this,pagesRotation:Zi,pageNumber:er}),this.defaultRenderingQueue&&this.update()}get firstPagePromise(){return this.pdfDocument?this._firstPageCapability.promise:null}get onePageRendered(){return this.pdfDocument?this._onePageRenderedCapability.promise:null}get pagesPromise(){return this.pdfDocument?this._pagesCapability.promise:null}setDocument(Zi){if(this.pdfDocument&&(this.eventBus.dispatch("pagesdestroy",{source:this}),this._cancelRendering(),this._resetView(),this.findController&&this.findController.setDocument(null),this._scriptingManager&&this._scriptingManager.setDocument(null)),this.pdfDocument=Zi,!Zi)return;const er=Zi.isPureXfa,hr=Zi.numPages,ur=Zi.getPage(1),_r=Zi.getOptionalContentConfig(),$r=Cr(this,Ki)?Zi.getPermissions():Promise.resolve();if(hr>Ri.FORCE_SCROLL_MODE_PAGE){const Pr=this._scrollMode=Ci.ScrollMode.PAGE;this.eventBus.dispatch("scrollmodechanged",{source:this,mode:Pr})}this._pagesCapability.promise.then(()=>{this.eventBus.dispatch("pagesloaded",{source:this,pagesCount:hr})},()=>{}),this._onBeforeDraw=Pr=>{const Sr=this._pages[Pr.pageNumber-1];Sr&&Cr(this,Hi).push(Sr)},this.eventBus._on("pagerender",this._onBeforeDraw),this._onAfterDraw=Pr=>{!Pr.cssTransform&&!this._onePageRenderedCapability.settled&&(this._onePageRenderedCapability.resolve({timestamp:Pr.timestamp}),this.eventBus._off("pagerendered",this._onAfterDraw),this._onAfterDraw=null,Cr(this,rr)&&(document.removeEventListener("visibilitychange",Cr(this,rr)),Nr(this,rr,null)))},this.eventBus._on("pagerendered",this._onAfterDraw),Promise.all([ur,$r]).then(([Pr,Sr])=>{if(Zi!==this.pdfDocument)return;this._firstPageCapability.resolve(Pr),this._optionalContentConfigPromise=_r,xr(this,ar,Ms).call(this,Sr);const Tr=this._scrollMode===Ci.ScrollMode.PAGE?null:this.viewer,kr=this.currentScale,Rr=Pr.getViewport({scale:kr*wi.PixelsPerInch.PDF_TO_CSS_UNITS}),Vr=this.textLayerMode===Ci.TextLayerMode.DISABLE||er?null:this,Hr=Cr(this,qi)!==wi.AnnotationMode.DISABLE?this:null,Wr=er?this:null;for(let Lr=1;Lr<=hr;++Lr){const Br=new Ti.PDFPageView({container:Tr,eventBus:this.eventBus,id:Lr,scale:kr,defaultViewport:Rr.clone(),optionalContentConfigPromise:_r,renderingQueue:this.renderingQueue,textLayerFactory:Vr,textLayerMode:this.textLayerMode,annotationLayerFactory:Hr,annotationMode:Cr(this,qi),xfaLayerFactory:Wr,textHighlighterFactory:this,structTreeLayerFactory:this,imageResourcesPath:this.imageResourcesPath,renderer:this.renderer,useOnlyCssZoom:this.useOnlyCssZoom,maxCanvasPixels:this.maxCanvasPixels,l10n:this.l10n});this._pages.push(Br)}const Fr=this._pages[0];Fr&&(Fr.setPdfPage(Pr),this.linkService.cachePageRef(1,Pr.ref)),this._scrollMode===Ci.ScrollMode.PAGE?xr(this,mr,hs).call(this):this._spreadMode!==Ci.SpreadMode.NONE&&this._updateSpreadMode(),xr(this,fr,Os).call(this).then(async()=>{if(this.findController&&this.findController.setDocument(Zi),this._scriptingManager&&this._scriptingManager.setDocument(Zi),Zi.loadingParams.disableAutoFetch||hr>Ri.FORCE_LAZY_PAGE_INIT){this._pagesCapability.resolve();return}let Lr=hr-1;if(Lr<=0)this._pagesCapability.resolve();else for(let Br=2;Br<=hr;++Br){const zr=Zi.getPage(Br).then(jr=>{const Gr=this._pages[Br-1];Gr.pdfPage||Gr.setPdfPage(jr),this.linkService.cachePageRef(Br,jr.ref),--Lr==0&&this._pagesCapability.resolve()},jr=>{--Lr==0&&this._pagesCapability.resolve()});Br%Ri.PAUSE_EAGER_PAGE_INIT==0&&await zr}}),this.eventBus.dispatch("pagesinit",{source:this}),Zi.getMetadata().then(({info:Lr})=>{Zi===this.pdfDocument&&Lr.Language&&(this.viewer.lang=Lr.Language)}),this.defaultRenderingQueue&&this.update()}).catch(Pr=>{this._pagesCapability.reject(Pr)})}setPageLabels(Zi){var er,hr;if(this.pdfDocument){Zi&&Array.isArray(Zi)&&this.pdfDocument.numPages===Zi.length?this._pageLabels=Zi:this._pageLabels=null;for(let ur=0,_r=this._pages.length;ur<_r;ur++)this._pages[ur].setPageLabel((hr=(er=this._pageLabels)==null?void 0:er[ur])!=null?hr:null)}}_resetView(){this._pages=[],this._currentPageNumber=1,this._currentScale=Ci.UNKNOWN_SCALE,this._currentScaleValue=null,this._pageLabels=null,Nr(this,Hi,new Vi(10)),this._location=null,this._pagesRotation=0,this._optionalContentConfigPromise=null,this._firstPageCapability=(0,wi.createPromiseCapability)(),this._onePageRenderedCapability=(0,wi.createPromiseCapability)(),this._pagesCapability=(0,wi.createPromiseCapability)(),this._scrollMode=Ci.ScrollMode.VERTICAL,this._previousScrollMode=Ci.ScrollMode.UNKNOWN,this._spreadMode=Ci.SpreadMode.NONE,Nr(this,Xi,{previousPageNumber:1,scrollDown:!0,pages:[]}),this._onBeforeDraw&&(this.eventBus._off("pagerender",this._onBeforeDraw),this._onBeforeDraw=null),this._onAfterDraw&&(this.eventBus._off("pagerendered",this._onAfterDraw),this._onAfterDraw=null),Cr(this,rr)&&(document.removeEventListener("visibilitychange",Cr(this,rr)),Nr(this,rr,null)),this.viewer.textContent="",this._updateScrollMode(),this.viewer.removeAttribute("lang"),this.viewer.classList.remove(Bi),Cr(this,Gi)!==null&&(Nr(this,qi,Cr(this,Gi)),Nr(this,Gi,null))}_scrollUpdate(){this.pagesCount!==0&&this.update()}_scrollIntoView({pageDiv:Zi,pageSpot:er=null,pageNumber:hr=null}){if(this._scrollMode===Ci.ScrollMode.PAGE&&(hr&&this._setCurrentPageNumber(hr),xr(this,mr,hs).call(this),this.update()),!er&&!this.isInPresentationMode){const ur=Zi.offsetLeft+Zi.clientLeft,_r=ur+Zi.clientWidth,{scrollLeft:$r,clientWidth:Pr}=this.container;(this._scrollMode===Ci.ScrollMode.HORIZONTAL||ur<$r||_r>$r+Pr)&&(er={left:0,top:0})}(0,Ci.scrollIntoView)(Zi,er)}_setScaleUpdatePages(Zi,er,hr=!1,ur=!1){if(this._currentScaleValue=er.toString(),xr(this,Yi,Ls).call(this,Zi)){ur&&this.eventBus.dispatch("scalechanging",{source:this,scale:Zi,presetValue:er});return}this._doc.style.setProperty("--zoom-factor",Zi),this._doc.style.setProperty("--viewport-scale-factor",Zi*wi.PixelsPerInch.PDF_TO_CSS_UNITS);const _r={scale:Zi};for(const $r of this._pages)$r.update(_r);if(this._currentScale=Zi,!hr){let $r,Pr=this._currentPageNumber;this._location&&!this.isInPresentationMode&&!this.isChangingPresentationMode&&(Pr=this._location.pageNumber,$r=[null,{name:"XYZ"},this._location.left,this._location.top,null]),this.scrollPageIntoView({pageNumber:Pr,destArray:$r,allowNegativeOffset:!0})}this.eventBus.dispatch("scalechanging",{source:this,scale:Zi,presetValue:ur?er:void 0}),this.defaultRenderingQueue&&this.update(),Nr(this,Qi,this.container.clientHeight)}get _pageWidthScaleFactor(){return this._spreadMode!==Ci.SpreadMode.NONE&&this._scrollMode!==Ci.ScrollMode.HORIZONTAL?2:1}_setScale(Zi,er=!1){let hr=parseFloat(Zi);if(hr>0)this._setScaleUpdatePages(hr,Zi,er,!1);else{const ur=this._pages[this._currentPageNumber-1];if(!ur)return;let _r=Ci.SCROLLBAR_PADDING,$r=Ci.VERTICAL_PADDING;this.isInPresentationMode?_r=$r=4:this.removePageBorders&&(_r=$r=0),this._scrollMode===Ci.ScrollMode.HORIZONTAL&&([_r,$r]=[$r,_r]);const Pr=(this.container.clientWidth-_r)/ur.width*ur.scale/this._pageWidthScaleFactor,Sr=(this.container.clientHeight-$r)/ur.height*ur.scale;switch(Zi){case"page-actual":hr=1;break;case"page-width":hr=Pr;break;case"page-height":hr=Sr;break;case"page-fit":hr=Math.min(Pr,Sr);break;case"auto":const Tr=(0,Ci.isPortraitOrientation)(ur)?Pr:Math.min(Sr,Pr);hr=Math.min(Ci.MAX_AUTO_SCALE,Tr);break;default:return}this._setScaleUpdatePages(hr,Zi,er,!0)}}_resetCurrentPageView(){this.isInPresentationMode&&this._setScale(this._currentScaleValue,!0);const Zi=this._pages[this._currentPageNumber-1];this._scrollIntoView({pageDiv:Zi.div})}pageLabelToPageNumber(Zi){if(!this._pageLabels)return null;const er=this._pageLabels.indexOf(Zi);return er<0?null:er+1}scrollPageIntoView({pageNumber:Zi,destArray:er=null,allowNegativeOffset:hr=!1,ignoreDestinationZoom:ur=!1,hashOptions:_r={isStoredHash:!1}}){if(!this.pdfDocument)return;const $r=Number.isInteger(Zi)&&this._pages[Zi-1];if(!$r)return;if(this.isInPresentationMode||!er){this._setCurrentPageNumber(Zi,!0);return}let Pr,Sr,Tr=0,kr=0,Rr=0,Vr=0;const Hr=$r.rotation%180!=0,Wr=(Hr?$r.height:$r.width)/$r.scale/wi.PixelsPerInch.PDF_TO_CSS_UNITS,Fr=(Hr?$r.width:$r.height)/$r.scale/wi.PixelsPerInch.PDF_TO_CSS_UNITS;let Lr=0;switch(er[1].name){case"XYZ":Tr=er[2],kr=er[3],Lr=er[4],Tr=Tr!==null?Tr:0,kr=kr!==null?kr:Fr;break;case"Fit":case"FitB":Lr="page-fit";break;case"FitH":case"FitBH":kr=er[2],Lr="page-width",kr===null&&this._location?(Tr=this._location.left,kr=this._location.top):(typeof kr!="number"||kr<0)&&(kr=Fr);break;case"FitV":case"FitBV":Tr=er[2],Rr=Wr,Vr=Fr,Lr="page-height";break;case"FitR":Tr=er[2],kr=er[3],Rr=er[4]-Tr,Vr=er[5]-kr;const Gr=this.removePageBorders?0:Ci.SCROLLBAR_PADDING,Xr=this.removePageBorders?0:Ci.VERTICAL_PADDING;Pr=(this.container.clientWidth-Gr)/Rr/wi.PixelsPerInch.PDF_TO_CSS_UNITS,Sr=(this.container.clientHeight-Xr)/Vr/wi.PixelsPerInch.PDF_TO_CSS_UNITS,Lr=Math.min(Math.abs(Pr),Math.abs(Sr));break;default:return}if(ur||(Lr&&Lr!==this._currentScale?this.currentScaleValue=Lr:this._currentScale===Ci.UNKNOWN_SCALE&&(this.currentScaleValue=Ci.DEFAULT_SCALE_VALUE)),Lr==="page-fit"&&!er[4]){this._scrollIntoView({pageDiv:$r.div,pageNumber:Zi});return}const Br=[$r.viewport.convertToViewportPoint(Tr,kr),$r.viewport.convertToViewportPoint(Tr+Rr,kr+Vr)];let zr=Math.min(Br[0][0],Br[1][0]),jr=Math.min(Br[0][1],Br[1][1]);hr||(zr=Math.max(zr,0),jr=Math.max(jr,0)),_r.isStoredHash&&er[1].name==="XYZ"&&er[3]===null&&(jr=0),this._scrollIntoView({pageDiv:$r.div,pageSpot:{left:zr,top:jr},pageNumber:Zi})}_updateLocation(Zi){const er=this._currentScale,hr=this._currentScaleValue,ur=parseFloat(hr)===er?Math.round(1e4*er)/100:hr,_r=Zi.id;let $r="#page="+_r;$r+="&zoom="+ur;const Pr=this._pages[_r-1],Sr=this.container,Tr=Pr.getPagePoint(Sr.scrollLeft-Zi.x,Sr.scrollTop-Zi.y),kr=Math.round(Tr[0]),Rr=Math.round(Tr[1]);$r+=","+kr+","+Rr,this._location={pageNumber:_r,scale:ur,top:Rr,left:kr,rotation:this._pagesRotation,pdfOpenParams:$r}}update(){const Zi=this._getVisiblePages(),er=Zi.views,hr=er.length;if(hr===0)return;const ur=Math.max(10,2*hr+1);if(Cr(this,Hi).resize(ur,Zi.ids),this.renderingQueue.renderHighestPriority(Zi),!this.isInPresentationMode){const _r=this._spreadMode===Ci.SpreadMode.NONE&&(this._scrollMode===Ci.ScrollMode.PAGE||this._scrollMode===Ci.ScrollMode.VERTICAL);let $r=this._currentPageNumber,Pr=!1;for(const Sr of er){if(Sr.percent<100)break;if(Sr.id===$r&&_r){Pr=!0;break}}Pr||($r=er[0].id),this._setCurrentPageNumber($r)}this._updateLocation(Zi.first),this.eventBus.dispatch("updateviewarea",{source:this,location:this._location})}containsElement(Zi){return this.container.contains(Zi)}focus(){this.container.focus()}get _isContainerRtl(){return getComputedStyle(this.container).direction==="rtl"}get isInPresentationMode(){return this.presentationModeState===Ci.PresentationModeState.FULLSCREEN}get isChangingPresentationMode(){return this.presentationModeState===Ci.PresentationModeState.CHANGING}get isHorizontalScrollbarEnabled(){return!this.isInPresentationMode&&this.container.scrollWidth>this.container.clientWidth}get isVerticalScrollbarEnabled(){return!this.isInPresentationMode&&this.container.scrollHeight>this.container.clientHeight}_getCurrentVisiblePage(){if(!this.pagesCount)return{views:[]};const Zi=this._pages[this._currentPageNumber-1],er=Zi.div,hr={id:Zi.id,x:er.offsetLeft+er.clientLeft,y:er.offsetTop+er.clientTop,view:Zi};return{first:hr,last:hr,views:[hr],ids:new Set([Zi.id])}}_getVisiblePages(){if(this.isInPresentationMode)return this._getCurrentVisiblePage();const Zi=this._scrollMode===Ci.ScrollMode.PAGE?Cr(this,Xi).pages:this._pages,er=this._scrollMode===Ci.ScrollMode.HORIZONTAL,hr=er&&this._isContainerRtl;return(0,Ci.getVisibleElements)({scrollEl:this.container,views:Zi,sortByVisibility:!0,horizontal:er,rtl:hr})}isPageVisible(Zi){return!!this.pdfDocument&&!!(Number.isInteger(Zi)&&Zi>0&&Zi<=this.pagesCount)&&this._getVisiblePages().ids.has(Zi)}isPageCached(Zi){if(!this.pdfDocument||!(Number.isInteger(Zi)&&Zi>0&&Zi<=this.pagesCount))return!1;const er=this._pages[Zi-1];return Cr(this,Hi).has(er)}cleanup(){for(let Zi=0,er=this._pages.length;Zi{this.renderingQueue.renderView(_r)}),!0):!1}createTextLayerBuilder(Zi,er,hr,ur=!1,_r,$r){return new Mi.TextLayerBuilder({textLayerDiv:Zi,eventBus:_r,pageIndex:er,viewport:hr,enhanceTextSelection:!this.isInPresentationMode&&ur,highlighter:$r})}createTextHighlighter(Zi,er){return new Ii.TextHighlighter({eventBus:er,pageIndex:Zi,findController:this.isInPresentationMode?null:this.findController})}createAnnotationLayerBuilder(Zi,er,hr=null,ur="",_r=!0,$r=xi.NullL10n,Pr=null,Sr=null,Tr=null,kr=null,Rr=null){var Vr,Hr,Wr,Fr;return new ki.AnnotationLayerBuilder({pageDiv:Zi,pdfPage:er,annotationStorage:hr||((Vr=this.pdfDocument)==null?void 0:Vr.annotationStorage),imageResourcesPath:ur,renderForms:_r,linkService:this.linkService,downloadManager:this.downloadManager,l10n:$r,enableScripting:Pr!=null?Pr:this.enableScripting,hasJSActionsPromise:Sr||((Hr=this.pdfDocument)==null?void 0:Hr.hasJSActions()),fieldObjectsPromise:kr||((Wr=this.pdfDocument)==null?void 0:Wr.getFieldObjects()),mouseState:Tr||((Fr=this._scriptingManager)==null?void 0:Fr.mouseState),annotationCanvasMap:Rr})}createXfaLayerBuilder(Zi,er,hr=null){var ur;return new Fi.XfaLayerBuilder({pageDiv:Zi,pdfPage:er,annotationStorage:hr||((ur=this.pdfDocument)==null?void 0:ur.annotationStorage),linkService:this.linkService})}createStructTreeLayerBuilder(Zi){return new Li.StructTreeLayerBuilder({pdfPage:Zi})}get hasEqualPageSizes(){const Zi=this._pages[0];for(let er=1,hr=this._pages.length;er{const er=Zi.pdfPage.getViewport({scale:1});return!this.enablePrintAutoRotate||(0,Ci.isPortraitOrientation)(er)?{width:er.width,height:er.height,rotation:er.rotation}:{width:er.height,height:er.width,rotation:(er.rotation-90)%360}})}get optionalContentConfigPromise(){return this.pdfDocument?this._optionalContentConfigPromise?this._optionalContentConfigPromise:this.pdfDocument.getOptionalContentConfig():Promise.resolve(null)}set optionalContentConfigPromise(Zi){if(!(Zi instanceof Promise))throw new Error(`Invalid optionalContentConfigPromise: ${Zi}`);if(!this.pdfDocument||!this._optionalContentConfigPromise)return;this._optionalContentConfigPromise=Zi;const er={optionalContentConfigPromise:Zi};for(const hr of this._pages)hr.update(er);this.update(),this.eventBus.dispatch("optionalcontentconfigchanged",{source:this,promise:Zi})}get scrollMode(){return this._scrollMode}set scrollMode(Zi){if(this._scrollMode!==Zi){if(!(0,Ci.isValidScrollMode)(Zi))throw new Error(`Invalid scroll mode: ${Zi}`);this.pagesCount>Ri.FORCE_SCROLL_MODE_PAGE||(this._previousScrollMode=this._scrollMode,this._scrollMode=Zi,this.eventBus.dispatch("scrollmodechanged",{source:this,mode:Zi}),this._updateScrollMode(this._currentPageNumber))}}_updateScrollMode(Zi=null){const er=this._scrollMode,hr=this.viewer;hr.classList.toggle("scrollHorizontal",er===Ci.ScrollMode.HORIZONTAL),hr.classList.toggle("scrollWrapped",er===Ci.ScrollMode.WRAPPED),this.pdfDocument&&Zi&&(er===Ci.ScrollMode.PAGE?xr(this,mr,hs).call(this):this._previousScrollMode===Ci.ScrollMode.PAGE&&this._updateSpreadMode(),this._currentScaleValue&&isNaN(this._currentScaleValue)&&this._setScale(this._currentScaleValue,!0),this._setCurrentPageNumber(Zi,!0),this.update())}get spreadMode(){return this._spreadMode}set spreadMode(Zi){if(this._spreadMode!==Zi){if(!(0,Ci.isValidSpreadMode)(Zi))throw new Error(`Invalid spread mode: ${Zi}`);this._spreadMode=Zi,this.eventBus.dispatch("spreadmodechanged",{source:this,mode:Zi}),this._updateSpreadMode(this._currentPageNumber)}}_updateSpreadMode(Zi=null){if(!this.pdfDocument)return;const er=this.viewer,hr=this._pages;if(this._scrollMode===Ci.ScrollMode.PAGE)xr(this,mr,hs).call(this);else if(er.textContent="",this._spreadMode===Ci.SpreadMode.NONE)for(let ur=0,_r=hr.length;ur<_r;++ur)er.appendChild(hr[ur].div);else{const ur=this._spreadMode-1;let _r=null;for(let $r=0,Pr=hr.length;$r=Tr;Sr--){const kr=_r[Sr],Rr=_r[Sr+1]-1;if(krRr)return Rr-Zi}if(er){const Sr=_r[0];if(SrZi)return Sr-Zi+1}break}break}case Ci.ScrollMode.HORIZONTAL:break;case Ci.ScrollMode.PAGE:case Ci.ScrollMode.VERTICAL:{if(this._spreadMode===Ci.SpreadMode.NONE)break;const hr=this._spreadMode-1;if(er&&Zi%2!==hr||!er&&Zi%2===hr)break;const{views:ur}=this._getVisiblePages(),_r=er?Zi-1:Zi+1;for(const{id:$r,percent:Pr,widthPercent:Sr}of ur)if($r===_r){if(Pr>0&&Sr===100)return 2;break}break}}return 1}nextPage(){const Zi=this._currentPageNumber,er=this.pagesCount;if(Zi>=er)return!1;const hr=this._getPageAdvance(Zi,!1)||1;return this.currentPageNumber=Math.min(Zi+hr,er),!0}previousPage(){const Zi=this._currentPageNumber;if(Zi<=1)return!1;const er=this._getPageAdvance(Zi,!0)||1;return this.currentPageNumber=Math.max(Zi-er,1),!0}increaseScale(Zi=1){let er=this._currentScale;do er=(er*Ci.DEFAULT_SCALE_DELTA).toFixed(2),er=Math.ceil(10*er)/10,er=Math.min(Ci.MAX_SCALE,er);while(--Zi>0&&er0&&er>Ci.MIN_SCALE);this.currentScaleValue=er}get scrollModePageState(){return Cr(this,Xi)||{previousPageNumber:1,scrollDown:!0,pages:[]}}};let Ni=pr;Hi=new WeakMap,qi=new WeakMap,Gi=new WeakMap,Ki=new WeakMap,Qi=new WeakMap,Xi=new WeakMap,rr=new WeakMap,ar=new WeakSet,Ms=function(Zi){Zi&&(Zi.includes(wi.PermissionFlag.COPY)||this.viewer.classList.add(Bi),!Zi.includes(wi.PermissionFlag.MODIFY_ANNOTATIONS)&&!Zi.includes(wi.PermissionFlag.FILL_INTERACTIVE_FORMS)&&Cr(this,qi)===wi.AnnotationMode.ENABLE_FORMS&&(Nr(this,Gi,Cr(this,qi)),Nr(this,qi,wi.AnnotationMode.ENABLE)))},fr=new WeakSet,Os=function(){if(document.visibilityState==="hidden"||!this.container.offsetParent||this._getVisiblePages().views.length===0)return Promise.resolve();const Zi=new Promise(er=>{Nr(this,rr,()=>{document.visibilityState==="hidden"&&(er(),document.removeEventListener("visibilitychange",Cr(this,rr)),Nr(this,rr,null))}),document.addEventListener("visibilitychange",Cr(this,rr))});return Promise.race([this._onePageRenderedCapability.promise,Zi])},mr=new WeakSet,hs=function(){if(this._scrollMode!==Ci.ScrollMode.PAGE)throw new Error("#ensurePageViewVisible: Invalid scrollMode value.");const Zi=this._currentPageNumber,er=Cr(this,Xi),hr=this.viewer;if(hr.textContent="",er.pages.length=0,this._spreadMode===Ci.SpreadMode.NONE){const ur=this._pages[Zi-1];if(this.isInPresentationMode){const _r=document.createElement("div");_r.className="spread";const $r=document.createElement("div");$r.className="dummyPage",$r.style.height=`${this.container.clientHeight}px`,_r.appendChild($r),_r.appendChild(ur.div),hr.appendChild(_r)}else hr.appendChild(ur.div);er.pages.push(ur)}else{const ur=new Set,_r=this._spreadMode-1;Zi%2!==_r?(ur.add(Zi-1),ur.add(Zi)):(ur.add(Zi-2),ur.add(Zi-1));let $r=null;for(const Pr of ur){const Sr=this._pages[Pr];Sr&&($r===null?($r=document.createElement("div"),$r.className="spread",hr.appendChild($r)):Pr%2===_r&&($r=$r.cloneNode(!1),hr.appendChild($r)),$r.appendChild(Sr.div),er.pages.push(Sr))}}er.scrollDown=Zi>=er.previousPageNumber,er.previousPageNumber=Zi},Yi=new WeakSet,Ls=function(Zi){return(!this.isInPresentationMode||this.container.clientHeight===Cr(this,Qi))&&(Zi===this._currentScale||Math.abs(Zi-this._currentScale)<1e-15)},ir=new WeakSet,Ds=async function(Zi){var er,hr;if(Zi.pdfPage)return Zi.pdfPage;try{const ur=await this.pdfDocument.getPage(Zi.id);return Zi.pdfPage||Zi.setPdfPage(ur),(hr=(er=this.linkService)._cachedPageNumber)!=null&&hr.call(er,ur.ref)||this.linkService.cachePageRef(Zi.id,ur.ref),ur}catch{return null}},tr=new WeakSet,Rs=function(Zi){var er,hr;if(((er=Zi.first)==null?void 0:er.id)===1)return!0;if(((hr=Zi.last)==null?void 0:hr.id)===this.pagesCount)return!1;switch(this._scrollMode){case Ci.ScrollMode.PAGE:return Cr(this,Xi).scrollDown;case Ci.ScrollMode.HORIZONTAL:return this.scroll.right}return this.scroll.down},Ji=new WeakSet,Fs=function(Zi){var er;for(const hr of Zi)(er=this._pages[hr-1])==null||er.toggleLoadingIconSpinner(!0);for(const hr of Cr(this,Hi))Zi.has(hr.id)||hr.toggleLoadingIconSpinner(!1)},Si.BaseViewer=Ni},(Ai,Si,Ei)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.AnnotationLayerBuilder=void 0;var wi=Ei(6),Ci=Ei(18);Si.AnnotationLayerBuilder=class{constructor({pageDiv:ki,pdfPage:xi,linkService:Ti,downloadManager:Oi,annotationStorage:ji=null,imageResourcesPath:Li="",renderForms:Ii=!0,l10n:Mi=Ci.NullL10n,enableScripting:Fi=!1,hasJSActionsPromise:Bi=null,fieldObjectsPromise:Ri=null,mouseState:Vi=null,annotationCanvasMap:Ni=null}){this.pageDiv=ki,this.pdfPage=xi,this.linkService=Ti,this.downloadManager=Oi,this.imageResourcesPath=Li,this.renderForms=Ii,this.l10n=Mi,this.annotationStorage=ji,this.enableScripting=Fi,this._hasJSActionsPromise=Bi,this._fieldObjectsPromise=Ri,this._mouseState=Vi,this._annotationCanvasMap=Ni,this.div=null,this._cancelled=!1}async render(ki,xi="display"){const[Ti,Oi=!1,ji=null]=await Promise.all([this.pdfPage.getAnnotations({intent:xi}),this._hasJSActionsPromise,this._fieldObjectsPromise]);if(this._cancelled||Ti.length===0)return;const Li={viewport:ki.clone({dontFlip:!0}),div:this.div,annotations:Ti,page:this.pdfPage,imageResourcesPath:this.imageResourcesPath,renderForms:this.renderForms,linkService:this.linkService,downloadManager:this.downloadManager,annotationStorage:this.annotationStorage,enableScripting:this.enableScripting,hasJSActions:Oi,fieldObjects:ji,mouseState:this._mouseState,annotationCanvasMap:this._annotationCanvasMap};this.div?wi.AnnotationLayer.update(Li):(this.div=document.createElement("div"),this.div.className="annotationLayer",this.pageDiv.appendChild(this.div),Li.div=this.div,wi.AnnotationLayer.render(Li),this.l10n.translate(this.div))}cancel(){this._cancelled=!0}hide(){this.div&&(this.div.hidden=!0)}}},(Ai,Si)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.NullL10n=void 0,Si.fixupLangCode=function(xi){return Ci[xi==null?void 0:xi.toLowerCase()]||xi},Si.getL10nFallback=wi;const Ei={of_pages:"of {{pagesCount}}",page_of_pages:"({{pageNumber}} of {{pagesCount}})",document_properties_kb:"{{size_kb}} KB ({{size_b}} bytes)",document_properties_mb:"{{size_mb}} MB ({{size_b}} bytes)",document_properties_date_string:"{{date}}, {{time}}",document_properties_page_size_unit_inches:"in",document_properties_page_size_unit_millimeters:"mm",document_properties_page_size_orientation_portrait:"portrait",document_properties_page_size_orientation_landscape:"landscape",document_properties_page_size_name_a3:"A3",document_properties_page_size_name_a4:"A4",document_properties_page_size_name_letter:"Letter",document_properties_page_size_name_legal:"Legal",document_properties_page_size_dimension_string:"{{width}} × {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})",document_properties_linearized_yes:"Yes",document_properties_linearized_no:"No",print_progress_percent:"{{progress}}%","toggle_sidebar.title":"Toggle Sidebar","toggle_sidebar_notification2.title":"Toggle Sidebar (document contains outline/attachments/layers)",additional_layers:"Additional Layers",page_landmark:"Page {{page}}",thumb_page_title:"Page {{page}}",thumb_page_canvas:"Thumbnail of Page {{page}}",find_reached_top:"Reached top of document, continued from bottom",find_reached_bottom:"Reached end of document, continued from top","find_match_count[one]":"{{current}} of {{total}} match","find_match_count[other]":"{{current}} of {{total}} matches","find_match_count_limit[one]":"More than {{limit}} match","find_match_count_limit[other]":"More than {{limit}} matches",find_not_found:"Phrase not found",error_version_info:"PDF.js v{{version}} (build: {{build}})",error_message:"Message: {{message}}",error_stack:"Stack: {{stack}}",error_file:"File: {{file}}",error_line:"Line: {{line}}",rendering_error:"An error occurred while rendering the page.",page_scale_width:"Page Width",page_scale_fit:"Page Fit",page_scale_auto:"Automatic Zoom",page_scale_actual:"Actual Size",page_scale_percent:"{{scale}}%",loading:"Loading…",loading_error:"An error occurred while loading the PDF.",invalid_file_error:"Invalid or corrupted PDF file.",missing_file_error:"Missing PDF file.",unexpected_response_error:"Unexpected server response.",printing_not_supported:"Warning: Printing is not fully supported by this browser.",printing_not_ready:"Warning: The PDF is not fully loaded for printing.",web_fonts_disabled:"Web fonts are disabled: unable to use embedded PDF fonts."};function wi(xi,Ti){switch(xi){case"find_match_count":xi=`find_match_count[${Ti.total===1?"one":"other"}]`;break;case"find_match_count_limit":xi=`find_match_count_limit[${Ti.limit===1?"one":"other"}]`}return Ei[xi]||""}const Ci={en:"en-US",es:"es-ES",fy:"fy-NL",ga:"ga-IE",gu:"gu-IN",hi:"hi-IN",hy:"hy-AM",nb:"nb-NO",ne:"ne-NP",nn:"nn-NO",pa:"pa-IN",pt:"pt-PT",sv:"sv-SE",zh:"zh-CN"},ki={getLanguage:async()=>"en-us",getDirection:async()=>"ltr",get:async(xi,Ti=null,Oi=wi(xi,Ti))=>function(ji,Li){return Li?ji.replace(/\{\{\s*(\w+)\s*\}\}/g,(Ii,Mi)=>Mi in Li?Li[Mi]:"{{"+Mi+"}}"):ji}(Oi,Ti),async translate(xi){}};Si.NullL10n=ki},(Ai,Si,Ei)=>{var Oi,ji;Object.defineProperty(Si,"__esModule",{value:!0}),Si.PDFPageView=void 0;var wi=Ei(6),Ci=Ei(1),ki=Ei(3),xi=Ei(18);const Ti=ki.compatibilityParams.maxCanvasPixels||16777216;Si.PDFPageView=(ji=class{constructor(Li){Er(this,Oi,wi.AnnotationMode.ENABLE_FORMS);var Bi,Ri,Vi,Ni;const Ii=Li.container,Mi=Li.defaultViewport;this.id=Li.id,this.renderingId="page"+this.id,this.pdfPage=null,this.pageLabel=null,this.rotation=0,this.scale=Li.scale||Ci.DEFAULT_SCALE,this.viewport=Mi,this.pdfPageRotate=Mi.rotation,this._optionalContentConfigPromise=Li.optionalContentConfigPromise||null,this.hasRestrictedScaling=!1,this.textLayerMode=(Bi=Li.textLayerMode)!=null?Bi:Ci.TextLayerMode.ENABLE,Nr(this,Oi,(Ri=Li.annotationMode)!=null?Ri:wi.AnnotationMode.ENABLE_FORMS),this.imageResourcesPath=Li.imageResourcesPath||"",this.useOnlyCssZoom=Li.useOnlyCssZoom||!1,this.maxCanvasPixels=Li.maxCanvasPixels||Ti,this.eventBus=Li.eventBus,this.renderingQueue=Li.renderingQueue,this.textLayerFactory=Li.textLayerFactory,this.annotationLayerFactory=Li.annotationLayerFactory,this.xfaLayerFactory=Li.xfaLayerFactory,this.textHighlighter=(Vi=Li.textHighlighterFactory)==null?void 0:Vi.createTextHighlighter(this.id-1,this.eventBus),this.structTreeLayerFactory=Li.structTreeLayerFactory,this.renderer=Li.renderer||Ci.RendererType.CANVAS,this.l10n=Li.l10n||xi.NullL10n,this.paintTask=null,this.paintedViewportMap=new WeakMap,this.renderingState=Ci.RenderingStates.INITIAL,this.resume=null,this._renderError=null,this._isStandalone=!((Ni=this.renderingQueue)!=null&&Ni.hasViewer()),this._annotationCanvasMap=null,this.annotationLayer=null,this.textLayer=null,this.zoomLayer=null,this.xfaLayer=null,this.structTreeLayer=null;const Fi=document.createElement("div");Fi.className="page",Fi.style.width=Math.floor(this.viewport.width)+"px",Fi.style.height=Math.floor(this.viewport.height)+"px",Fi.setAttribute("data-page-number",this.id),Fi.setAttribute("role","region"),this.l10n.get("page_landmark",{page:this.id}).then(Wi=>{Fi.setAttribute("aria-label",Wi)}),this.div=Fi,Ii==null||Ii.appendChild(Fi)}set renderingState(Li){this._renderingState=Li}get renderingState(){var Li;return this._renderingState!==Ci.RenderingStates.FINISHED||(Li=this.div)!=null&&Li.dataset.loaded||(this._renderingState=Ci.RenderingStates.INITIAL),this._renderingState}setPdfPage(Li){this.pdfPage=Li,this.pdfPageRotate=Li.rotate;const Ii=(this.rotation+this.pdfPageRotate)%360;this.viewport=Li.getViewport({scale:this.scale*wi.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:Ii}),this.reset()}destroy(){this.reset(),this.pdfPage&&this.pdfPage.cleanup(),this.eventBus.dispatch("pageunmounted",{source:this,pageNumber:this.id})}async _renderAnnotationLayer(){let Li=null;try{await this.annotationLayer.render(this.viewport,"display")}catch(Ii){Li=Ii}finally{this.eventBus.dispatch("annotationlayerrendered",{source:this,pageNumber:this.id,error:Li})}}async _renderXfaLayer(){let Li=null;try{const Ii=await this.xfaLayer.render(this.viewport,"display");this.textHighlighter&&this._buildXfaTextContentItems(Ii.textDivs)}catch(Ii){Li=Ii}finally{this.eventBus.dispatch("xfalayerrendered",{source:this,pageNumber:this.id,error:Li})}}async _buildXfaTextContentItems(Li){const Ii=await this.pdfPage.getTextContent(),Mi=[];for(const Fi of Ii.items)Mi.push(Fi.str);this.textHighlighter.setTextMapping(Li,Mi),this.textHighlighter.enable()}_resetZoomLayer(Li=!1){if(!this.zoomLayer)return;const Ii=this.zoomLayer.firstChild;this.paintedViewportMap.delete(Ii),Ii.width=0,Ii.height=0,Li&&this.zoomLayer.remove(),this.zoomLayer=null}reset({keepZoomLayer:Li=!1,keepAnnotationLayer:Ii=!1,keepXfaLayer:Mi=!1}={}){var Wi,zi;this.cancelRendering({keepAnnotationLayer:Ii,keepXfaLayer:Mi}),this.renderingState=Ci.RenderingStates.INITIAL;const Fi=this.div;Fi.style.width=Math.floor(this.viewport.width)+"px",Fi.style.height=Math.floor(this.viewport.height)+"px";const Bi=Fi.childNodes,Ri=Li&&this.zoomLayer||null,Vi=Ii&&((Wi=this.annotationLayer)==null?void 0:Wi.div)||null,Ni=Mi&&((zi=this.xfaLayer)==null?void 0:zi.div)||null;for(let Di=Bi.length-1;Di>=0;Di--){const Ui=Bi[Di];switch(Ui){case Ri:case Vi:case Ni:continue}Ui.remove()}Fi.removeAttribute("data-loaded"),Vi&&this.annotationLayer.hide(),Ni&&this.xfaLayer.hide(),Ri||(this.canvas&&(this.paintedViewportMap.delete(this.canvas),this.canvas.width=0,this.canvas.height=0,delete this.canvas),this._resetZoomLayer()),this.svg&&(this.paintedViewportMap.delete(this.svg),delete this.svg),this.loadingIconDiv=document.createElement("div"),this.loadingIconDiv.className="loadingIcon notVisible",this._isStandalone&&this.toggleLoadingIconSpinner(!0),this.loadingIconDiv.setAttribute("role","img"),this.l10n.get("loading").then(Di=>{var Ui;(Ui=this.loadingIconDiv)==null||Ui.setAttribute("aria-label",Di)}),Fi.appendChild(this.loadingIconDiv)}update({scale:Li=0,rotation:Ii=null,optionalContentConfigPromise:Mi=null}){if(typeof arguments[0]!="object"){this.update({scale:arguments[0],rotation:arguments[1],optionalContentConfigPromise:arguments[2]});return}this.scale=Li||this.scale,typeof Ii=="number"&&(this.rotation=Ii),Mi instanceof Promise&&(this._optionalContentConfigPromise=Mi);const Fi=(this.rotation+this.pdfPageRotate)%360,Bi=this.scale*wi.PixelsPerInch.PDF_TO_CSS_UNITS;if(this.viewport=this.viewport.clone({scale:Bi,rotation:Fi}),this._isStandalone){const{style:Vi}=document.documentElement;Vi.setProperty("--zoom-factor",this.scale),Vi.setProperty("--viewport-scale-factor",Bi)}if(this.svg){this.cssTransform({target:this.svg,redrawAnnotationLayer:!0,redrawXfaLayer:!0}),this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!0,timestamp:performance.now(),error:this._renderError});return}let Ri=!1;if(this.canvas&&this.maxCanvasPixels>0){const Vi=this.outputScale;(Math.floor(this.viewport.width)*Vi.sx|0)*(Math.floor(this.viewport.height)*Vi.sy|0)>this.maxCanvasPixels&&(Ri=!0)}if(this.canvas){if(this.useOnlyCssZoom||this.hasRestrictedScaling&&Ri){this.cssTransform({target:this.canvas,redrawAnnotationLayer:!0,redrawXfaLayer:!0}),this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!0,timestamp:performance.now(),error:this._renderError});return}!this.zoomLayer&&!this.canvas.hidden&&(this.zoomLayer=this.canvas.parentNode,this.zoomLayer.style.position="absolute")}this.zoomLayer&&this.cssTransform({target:this.zoomLayer.firstChild}),this.reset({keepZoomLayer:!0,keepAnnotationLayer:!0,keepXfaLayer:!0})}cancelRendering({keepAnnotationLayer:Li=!1,keepXfaLayer:Ii=!1}={}){var Mi;this.paintTask&&(this.paintTask.cancel(),this.paintTask=null),this.resume=null,this.textLayer&&(this.textLayer.cancel(),this.textLayer=null),this.annotationLayer&&(!Li||!this.annotationLayer.div)&&(this.annotationLayer.cancel(),this.annotationLayer=null,this._annotationCanvasMap=null),this.xfaLayer&&(!Ii||!this.xfaLayer.div)&&(this.xfaLayer.cancel(),this.xfaLayer=null,(Mi=this.textHighlighter)==null||Mi.disable()),this._onTextLayerRendered&&(this.eventBus._off("textlayerrendered",this._onTextLayerRendered),this._onTextLayerRendered=null)}cssTransform({target:Li,redrawAnnotationLayer:Ii=!1,redrawXfaLayer:Mi=!1}){const Fi=this.viewport.width,Bi=this.viewport.height,Ri=this.div;Li.style.width=Li.parentNode.style.width=Ri.style.width=Math.floor(Fi)+"px",Li.style.height=Li.parentNode.style.height=Ri.style.height=Math.floor(Bi)+"px";const Vi=this.viewport.rotation-this.paintedViewportMap.get(Li).rotation,Ni=Math.abs(Vi);let Wi=1,zi=1;if((Ni===90||Ni===270)&&(Wi=Bi/Fi,zi=Fi/Bi),Li.style.transform=`rotate(${Vi}deg) scale(${Wi}, ${zi})`,this.textLayer){const Di=this.textLayer.viewport,Ui=this.viewport.rotation-Di.rotation,Hi=Math.abs(Ui);let qi=Fi/Di.width;Hi!==90&&Hi!==270||(qi=Fi/Di.height);const Gi=this.textLayer.textLayerDiv;let Ki,Qi;switch(Hi){case 0:Ki=Qi=0;break;case 90:Ki=0,Qi="-"+Gi.style.height;break;case 180:Ki="-"+Gi.style.width,Qi="-"+Gi.style.height;break;case 270:Ki="-"+Gi.style.width,Qi=0}Gi.style.transform=`rotate(${Hi}deg) scale(${qi}) translate(${Ki}, ${Qi})`,Gi.style.transformOrigin="0% 0%"}Ii&&this.annotationLayer&&this._renderAnnotationLayer(),Mi&&this.xfaLayer&&this._renderXfaLayer()}get width(){return this.viewport.width}get height(){return this.viewport.height}getPagePoint(Li,Ii){return this.viewport.convertToPdfPoint(Li,Ii)}toggleLoadingIconSpinner(Li=!1){var Ii;(Ii=this.loadingIconDiv)==null||Ii.classList.toggle("notVisible",!Li)}draw(){var Wi,zi,Di;this.renderingState!==Ci.RenderingStates.INITIAL&&this.reset();const{div:Li,pdfPage:Ii}=this;if(!Ii)return this.renderingState=Ci.RenderingStates.FINISHED,this.loadingIconDiv&&(this.loadingIconDiv.remove(),delete this.loadingIconDiv),Promise.reject(new Error("pdfPage is not loaded"));this.renderingState=Ci.RenderingStates.RUNNING;const Mi=document.createElement("div");Mi.style.width=Li.style.width,Mi.style.height=Li.style.height,Mi.classList.add("canvasWrapper"),(Wi=this.annotationLayer)!=null&&Wi.div?Li.insertBefore(Mi,this.annotationLayer.div):Li.appendChild(Mi);let Fi=null;if(this.textLayerMode!==Ci.TextLayerMode.DISABLE&&this.textLayerFactory){const Ui=document.createElement("div");Ui.className="textLayer",Ui.style.width=Mi.style.width,Ui.style.height=Mi.style.height,(zi=this.annotationLayer)!=null&&zi.div?Li.insertBefore(Ui,this.annotationLayer.div):Li.appendChild(Ui),Fi=this.textLayerFactory.createTextLayerBuilder(Ui,this.id-1,this.viewport,this.textLayerMode===Ci.TextLayerMode.ENABLE_ENHANCE,this.eventBus,this.textHighlighter)}this.textLayer=Fi,Cr(this,Oi)!==wi.AnnotationMode.DISABLE&&this.annotationLayerFactory&&(this._annotationCanvasMap||(this._annotationCanvasMap=new Map),this.annotationLayer||(this.annotationLayer=this.annotationLayerFactory.createAnnotationLayerBuilder(Li,Ii,null,this.imageResourcesPath,Cr(this,Oi)===wi.AnnotationMode.ENABLE_FORMS,this.l10n,null,null,null,null,this._annotationCanvasMap))),(Di=this.xfaLayer)!=null&&Di.div&&Li.appendChild(this.xfaLayer.div);let Bi=null;this.renderingQueue&&(Bi=Ui=>{this.renderingQueue.isHighestPriority(this)?Ui():(this.renderingState=Ci.RenderingStates.PAUSED,this.resume=()=>{this.renderingState=Ci.RenderingStates.RUNNING,Ui()})});const Ri=async(Ui=null)=>{if(Vi===this.paintTask&&(this.paintTask=null),Ui instanceof wi.RenderingCancelledException)this._renderError=null;else if(this._renderError=Ui,this.renderingState=Ci.RenderingStates.FINISHED,this.loadingIconDiv&&(this.loadingIconDiv.remove(),delete this.loadingIconDiv),this._resetZoomLayer(!0),this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!1,timestamp:performance.now(),error:this._renderError}),Ui)throw Ui},Vi=this.renderer===Ci.RendererType.SVG?this.paintOnSvg(Mi):this.paintOnCanvas(Mi);Vi.onRenderContinue=Bi,this.paintTask=Vi;const Ni=Vi.promise.then(()=>Ri(null).then(()=>{if(Fi){const Ui=Ii.streamTextContent({includeMarkedContent:!0});Fi.setTextContentStream(Ui),Fi.render()}this.annotationLayer&&this._renderAnnotationLayer()}),function(Ui){return Ri(Ui)});return this.xfaLayerFactory&&(this.xfaLayer||(this.xfaLayer=this.xfaLayerFactory.createXfaLayerBuilder(Li,Ii,null)),this._renderXfaLayer()),this.structTreeLayerFactory&&this.textLayer&&this.canvas&&(this._onTextLayerRendered=Ui=>{Ui.pageNumber===this.id&&(this.eventBus._off("textlayerrendered",this._onTextLayerRendered),this._onTextLayerRendered=null,this.canvas&&this.pdfPage.getStructTree().then(Hi=>{if(!Hi||!this.canvas)return;const qi=this.structTreeLayer.render(Hi);qi.classList.add("structTree"),this.canvas.appendChild(qi)}))},this.eventBus._on("textlayerrendered",this._onTextLayerRendered),this.structTreeLayer=this.structTreeLayerFactory.createStructTreeLayerBuilder(Ii)),Li.setAttribute("data-loaded",!0),this.eventBus.dispatch("pagerender",{source:this,pageNumber:this.id}),Ni}paintOnCanvas(Li){const Ii=(0,wi.createPromiseCapability)(),Mi={promise:Ii.promise,onRenderContinue(qi){qi()},cancel(){Hi.cancel()}},Fi=this.viewport,Bi=document.createElement("canvas");Bi.hidden=!0;let Ri=!0;const Vi=function(){Ri&&(Bi.hidden=!1,Ri=!1)};Li.appendChild(Bi),this.canvas=Bi,Bi.mozOpaque=!0;const Ni=Bi.getContext("2d",{alpha:!1}),Wi=this.outputScale=new Ci.OutputScale;if(this.useOnlyCssZoom){const qi=Fi.clone({scale:wi.PixelsPerInch.PDF_TO_CSS_UNITS});Wi.sx*=qi.width/Fi.width,Wi.sy*=qi.height/Fi.height}if(this.maxCanvasPixels>0){const qi=Fi.width*Fi.height,Gi=Math.sqrt(this.maxCanvasPixels/qi);Wi.sx>Gi||Wi.sy>Gi?(Wi.sx=Gi,Wi.sy=Gi,this.hasRestrictedScaling=!0):this.hasRestrictedScaling=!1}const zi=(0,Ci.approximateFraction)(Wi.sx),Di=(0,Ci.approximateFraction)(Wi.sy);Bi.width=(0,Ci.roundToDivide)(Fi.width*Wi.sx,zi[0]),Bi.height=(0,Ci.roundToDivide)(Fi.height*Wi.sy,Di[0]),Bi.style.width=(0,Ci.roundToDivide)(Fi.width,zi[1])+"px",Bi.style.height=(0,Ci.roundToDivide)(Fi.height,Di[1])+"px",this.paintedViewportMap.set(Bi,Fi);const Ui={canvasContext:Ni,transform:Wi.scaled?[Wi.sx,0,0,Wi.sy,0,0]:null,viewport:this.viewport,annotationMode:Cr(this,Oi),optionalContentConfigPromise:this._optionalContentConfigPromise,annotationCanvasMap:this._annotationCanvasMap},Hi=this.pdfPage.render(Ui);return Hi.onContinue=function(qi){Vi(),Mi.onRenderContinue?Mi.onRenderContinue(qi):qi()},Hi.promise.then(function(){Vi(),Ii.resolve()},function(qi){Vi(),Ii.reject(qi)}),Mi}paintOnSvg(Li){let Ii=!1;const Mi=()=>{if(Ii)throw new wi.RenderingCancelledException(`Rendering cancelled, page ${this.id}`,"svg")},Fi=this.pdfPage,Bi=this.viewport.clone({scale:wi.PixelsPerInch.PDF_TO_CSS_UNITS});return{promise:Fi.getOperatorList({annotationMode:Cr(this,Oi)}).then(Ri=>(Mi(),new wi.SVGGraphics(Fi.commonObjs,Fi.objs).getSVG(Ri,Bi).then(Vi=>{Mi(),this.svg=Vi,this.paintedViewportMap.set(Vi,Bi),Vi.style.width=Li.style.width,Vi.style.height=Li.style.height,this.renderingState=Ci.RenderingStates.FINISHED,Li.appendChild(Vi)}))),onRenderContinue(Ri){Ri()},cancel(){Ii=!0}}}setPageLabel(Li){this.pageLabel=typeof Li=="string"?Li:null,this.pageLabel!==null?this.div.setAttribute("data-page-label",this.pageLabel):this.div.removeAttribute("data-page-label")}},Oi=new WeakMap,ji)},(Ai,Si,Ei)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.PDFRenderingQueue=void 0;var wi=Ei(6),Ci=Ei(1);Si.PDFRenderingQueue=class{constructor(){this.pdfViewer=null,this.pdfThumbnailViewer=null,this.onIdle=null,this.highestPriorityPage=null,this.idleTimeout=null,this.printing=!1,this.isThumbnailViewEnabled=!1}setViewer(ki){this.pdfViewer=ki}setThumbnailViewer(ki){this.pdfThumbnailViewer=ki}isHighestPriority(ki){return this.highestPriorityPage===ki.renderingId}hasViewer(){return!!this.pdfViewer}renderHighestPriority(ki){var xi;this.idleTimeout&&(clearTimeout(this.idleTimeout),this.idleTimeout=null),this.pdfViewer.forceRendering(ki)||this.isThumbnailViewEnabled&&((xi=this.pdfThumbnailViewer)!=null&&xi.forceRendering())||this.printing||this.onIdle&&(this.idleTimeout=setTimeout(this.onIdle.bind(this),3e4))}getHighestPriority(ki,xi,Ti,Oi=!1){const ji=ki.views,Li=ji.length;if(Li===0)return null;for(let Ri=0;RiLi){const Ri=ki.ids;for(let Vi=1,Ni=Mi-Ii;Vi{this.renderHighestPriority()}).catch(xi=>{wi.RenderingCancelledException})}return!0}}},(Ai,Si)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.StructTreeLayerBuilder=void 0;const Ei={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},wi=/^H(\d+)$/;Si.StructTreeLayerBuilder=class{constructor({pdfPage:Ci}){this.pdfPage=Ci}render(Ci){return this._walk(Ci)}_setAttributes(Ci,ki){Ci.alt!==void 0&&ki.setAttribute("aria-label",Ci.alt),Ci.id!==void 0&&ki.setAttribute("aria-owns",Ci.id),Ci.lang!==void 0&&ki.setAttribute("lang",Ci.lang)}_walk(Ci){if(!Ci)return null;const ki=document.createElement("span");if("role"in Ci){const{role:xi}=Ci,Ti=xi.match(wi);Ti?(ki.setAttribute("role","heading"),ki.setAttribute("aria-level",Ti[1])):Ei[xi]&&ki.setAttribute("role",Ei[xi])}if(this._setAttributes(Ci,ki),Ci.children)if(Ci.children.length===1&&"id"in Ci.children[0])this._setAttributes(Ci.children[0],ki);else for(const xi of Ci.children)ki.appendChild(this._walk(xi));return ki}}}, (Ai,Si)=>{Object.defineProperty(Si,"__esModule",{value:!0}), Si.TextHighlighter=void 0, Si.TextHighlighter=class { constructor({ findController, eventBus, pageIndex }) { this.findController = findController; this.matches = []; this.eventBus = eventBus; this.pageIdx = pageIndex; this._onUpdateTextLayerMatches = null; this.textDivs = null; this.textContentItemsStr = null; this.enabled = false; this.defaultPagesMatches = null; this.defaultPagesMatchesIsFocus = false; // 没有则创建 _onUpdatePagesMatches if (!this._onUpdatePagesMatches) { this._onUpdatePagesMatches = (evt) => { if (evt.pagesMatches !== this.defaultPagesMatches) { this.defaultPagesMatches = evt.pagesMatches; this.defaultPagesMatchesIsFocus = true; sessionStorage.removeItem("pdfFindBar"); } this._updateMatches(false); }; this.eventBus._on("updatePagesMatches", this._onUpdatePagesMatches); } } setTextMapping(divs, texts) { this.textDivs = divs; this.textContentItemsStr = texts; } enable() { // 页面渲染时调用,初始化绑定事件,调用页面渲染更新 if (!this.textDivs || !this.textContentItemsStr) { throw new Error("Text divs and strings have not been set."); } if (this.enabled) { throw new Error("TextHighlighter is already enabled."); } this.enabled = true; if (!this._onUpdateTextLayerMatches) { this._onUpdateTextLayerMatches = evt => { if (evt.pageIndex === this.pageIdx || evt.pageIndex === -1) { this._updateMatches(); } }; this.eventBus._on("updatetextlayermatches", this._onUpdateTextLayerMatches); } if (!this._onUpdatePagesMatches) { this._onUpdatePagesMatches = (evt) => { if (evt.pagesMatches !== this.defaultPagesMatches) { this.defaultPagesMatches = evt.pagesMatches; this.defaultPagesMatchesIsFocus = true; sessionStorage.removeItem("pdfFindBar"); } this._updateMatches(false); }; this.eventBus._on("updatePagesMatches", this._onUpdatePagesMatches); } this._updateMatches(); } disable() { if (!this.enabled) { return; } this.enabled = false; if (this._onUpdateTextLayerMatches) { this.eventBus._off("updatetextlayermatches", this._onUpdateTextLayerMatches); this._onUpdateTextLayerMatches = null; } // disable时候移除监听方法 if (this._onUpdatePagesMatches) { this.eventBus._off("updatePagesMatches", this._onUpdatePagesMatches); this._onUpdatePagesMatches = null; } this._updateMatches(true); } _convertMatches(matches, matchesLength) { // _convertMatches:将数据转换成begin end 格式 if (!matches) { return []; } const { textContentItemsStr } = this; let i = 0 let iIndex = 0; const end = textContentItemsStr.length - 1; const result = []; try { for (let m = 0, mm = matches.length; m < mm; m++) { let matchIdx = matches[m]; while (i !== end && matchIdx >= iIndex + textContentItemsStr[i].length) { iIndex += textContentItemsStr[i].length; i++; } if (i === textContentItemsStr.length) { console.error("Could not find a matching mapping"); } const match = { begin: { divIdx: i, offset: matchIdx - iIndex } }; matchIdx += matchesLength[m]; while (i !== end && matchIdx > iIndex + textContentItemsStr[i].length) { iIndex += textContentItemsStr[i].length; i++; } match.end = { divIdx: i, offset: matchIdx - iIndex }; result.push(match); } } catch { } return result; } _renderMatches(matches) { // Early exit if there is nothing to render. if (matches.length === 0) { return; } const isPagesMatch = sessionStorage.getItem("pdfFindBar") !== "pdfFindBar"; const { textContentItemsStr, textDivs, findController, pageIdx } = this; if (!textDivs?.length) { return; } const isSelectedPage = findController?.selected ? pageIdx === findController.selected.pageIdx : true; const selectedMatchIdx = findController?.selected?.matchIdx ?? 0; // const highlightAll = !options ? findController.state.highlightAll : true; const highlightAll = true; let prevEnd = null; const infinity = { divIdx: -1, offset: undefined, }; function beginText(begin, className, styles) { const divIdx = begin.divIdx; if (!textDivs[divIdx]) { return; } textDivs[divIdx].textContent = ""; return appendTextToDiv(divIdx, 0, begin.offset, className, styles); } function appendTextToDiv(divIdx, fromOffset, toOffset, className, styles) { let div = textDivs[divIdx]; if (!div) { return; } if (div.nodeType === Node.TEXT_NODE) { const span = document.createElement("span"); div.before(span); span.append(div); textDivs[divIdx] = span; div = span; } const content = textContentItemsStr[divIdx].substring( fromOffset, toOffset ); const node = document.createTextNode(content); if (className) { const span = document.createElement("span"); if (styles && span) { for (let p in styles) { span.style[p] = styles[p]; } } span.className = `${className} appended`; span.append(node); div.append(span); return className.includes("selected") ? span.offsetLeft : 0; } div.append(node); return 0; } let i0 = selectedMatchIdx, i1 = i0 + 1; if (highlightAll) { i0 = 0; i1 = matches.length; } else if (!isSelectedPage) { // Not highlighting all and this isn't the selected page, so do nothing. return; } let lastDivIdx = -1; let lastOffset = -1; let selectedElement; let findIndex = -1; for (let i = i0; i < i1; i++) { const match = matches[i]; const begin = match.begin; if (begin.divIdx === lastDivIdx && begin.offset === lastOffset) { // It's possible to be in this situation if we searched for a 'f' and we // have a ligature 'ff' in the text. The 'ff' has to be highlighted two // times. continue; } lastDivIdx = begin.divIdx; lastOffset = begin.offset; const end = match.end; if (match.sectionIndex === undefined) { findIndex += 1; } const isSelected = isPagesMatch ? match.isSelected : isSelectedPage && findIndex === selectedMatchIdx; const highlightSuffix = " " + match.className; let selectedLeft = 0; // Match inside new div. if (!prevEnd || begin.divIdx !== prevEnd.divIdx) { // If there was a previous div, then add the text at the end. if (prevEnd !== null) { appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset); } // Clear the divs and set the content until the starting point. beginText(begin); } else { appendTextToDiv(prevEnd.divIdx, prevEnd.offset, begin.offset); } if (begin.divIdx === end.divIdx) { selectedLeft = appendTextToDiv( begin.divIdx, begin.offset, end.offset, "highlight" + highlightSuffix, match.styles ); } else { selectedLeft = appendTextToDiv( begin.divIdx, begin.offset, infinity.offset, "highlight begin" + highlightSuffix, match.styles ); for (let n0 = begin.divIdx + 1, n1 = end.divIdx; n0 < n1; n0++) { if (textDivs[n0]) { if (match.styles) { for (let p in match.styles) { textDivs[n0].style[p] = match.styles[p]; } } textDivs[n0].className = "highlight middle" + highlightSuffix; } } beginText(end, "highlight end" + highlightSuffix, match.styles); } prevEnd = end; if (!selectedElement && isSelected) { let divIdx = begin.divIdx; while (!textContentItemsStr[divIdx] && divIdx <= end.divIdx) { divIdx++; } const div = textDivs[divIdx]; let isOut = false; // 定位元素需要在可视区域内 try{ const divStyle = div.style; let textLayerNode = div; while ( !textLayerNode.classList.contains("textLayer") && textLayerNode.parentElement ) { textLayerNode = textLayerNode.parentElement; } let left = parseFloat(divStyle.left.match(/\d+/g)[0] || "0"); let top = parseFloat(divStyle.top.match(/\d+/g)[0] || "0"); if ( (divStyle.left.includes("%") && left >= 100) || (divStyle.top.includes("%") && top >= 100) ) { isOut = true; } if (textLayerNode.classList.contains("textLayer")) { let width = parseFloat(textLayerNode.style.width.match(/\d+/g)[0] || "0"); let height = parseFloat(textLayerNode.style.height.match(/\d+/g)[0] || "0"); if ( (divStyle.left.includes("px") && left > width) || (!divStyle.top.includes("px") && top > height) ) { isOut = true; } } } catch(e) { console.error(e) } if (!isOut && this.defaultPagesMatchesIsFocus && isPagesMatch) { selectedElement = div; } else if (!isOut && !isPagesMatch) { selectedElement = div; } } } if (selectedElement && findController) { findController.scrollMatchIntoView({ element: selectedElement, selectedLeft: 0, pageIndex: pageIdx, matchIndex: selectedMatchIdx, }); this.defaultPagesMatchesIsFocus = false; } if (prevEnd) { appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset); } } /** * * @desc 合并数据方法 * @returns */ _merageMatches(baseMatchs, matches) { while (matches.length) { const match = matches[0]; const beginIndex = baseMatchs.findIndex((item) => { return ( (item.begin.divIdx < match.begin.divIdx || (item.begin.divIdx === match.begin.divIdx && item.begin.offset <= match.begin.offset)) && (item.end.divIdx > match.begin.divIdx || (item.end.divIdx === match.begin.divIdx && item.end.offset > match.begin.offset)) ); }); const endIndex = baseMatchs.findIndex((item) => { return ( (item.begin.divIdx < match.end.divIdx || (item.begin.divIdx === match.end.divIdx && item.begin.offset <= match.end.offset)) && (item.end.divIdx > match.end.divIdx || (item.end.divIdx === match.end.divIdx && item.end.offset >= match.end.offset)) ); }); if (endIndex === -1 && beginIndex === -1) { baseMatchs.push({ ...match, }); matches.shift(); continue; } if (endIndex !== 1 && beginIndex !== -1 && endIndex !== beginIndex) { baseMatchs[beginIndex].end = { ...match.begin }; baseMatchs[endIndex].begin = { ...match.end }; baseMatchs.splice(beginIndex + 1, endIndex - beginIndex - 1, match); matches.shift(); continue; } if (endIndex !== -1 && beginIndex !== -1 && endIndex === beginIndex) { baseMatchs.splice( beginIndex, 1, { ...baseMatchs[beginIndex], end: { ...match.begin }, }, match, { ...baseMatchs[beginIndex], begin: { ...match.end }, } ); matches.shift(); continue; } if (endIndex !== -1 && beginIndex === -1) { baseMatchs[endIndex].begin = { ...match.end }; baseMatchs.splice(0, 0, match); matches.shift(); continue; } if (endIndex === -1 && beginIndex !== -1) { baseMatchs[beginIndex].end = { ...match.begin }; baseMatchs.push(match); matches.shift(); continue; } matches.shift(); console.log("没有处理的", endIndex, beginIndex); } baseMatchs.sort((a, b) => { return a.begin.divIdx - b.begin.divIdx; }); return baseMatchs.filter((item) => { if (item.begin.divIdx === item.end.divIdx && item.begin.offset === item.end.offset) { return false } return true }) } _updateMatches(reset = false) { // 清空原高亮筛选逻辑,调用_renderMatches渲染新高亮样式 if (!this.enabled && !reset) { return; } // this.pageIdx 当前页数index const { findController, pageIdx } = this; const { textContentItemsStr, textDivs, matches = [] } = this; // 清楚匹配项 for (let i = 0, ii = matches.length; i < ii; i++) { const match = matches[i]; const begin = match.begin.divIdx; for (let n = begin, end = match.end.divIdx; n <= end; n++) { const div = textDivs[n]; if (div) { div.textContent = textContentItemsStr[n]; div.className = ""; } } } let sectionMatches = [...(this.defaultPagesMatches?.[this.pageIdx] || [])]; if (findController?.highlightMatches && !reset) { const pageMatches = findController.pageMatches[pageIdx] || null; const pageMatchesLength = findController.pageMatchesLength[pageIdx] || null; const findMatches = this._convertMatches(pageMatches, pageMatchesLength); const selectedMatchIdx = findController.selected.matchIdx; pageIdx === findController.selected.pageIdx && findMatches[selectedMatchIdx] && (findMatches[selectedMatchIdx].className = "selected"); this.matches = this._merageMatches(sectionMatches, findMatches); this._renderMatches(this.matches || []); return; } this.matches = sectionMatches; this._renderMatches(sectionMatches || []); } } }, (Ai,Si,Ei)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.TextLayerBuilder=void 0;var wi=Ei(6);Si.TextLayerBuilder=class{constructor({textLayerDiv:Ci,eventBus:ki,pageIndex:xi,viewport:Ti,highlighter:Oi=null,enhanceTextSelection:ji=!1}){this.textLayerDiv=Ci,this.eventBus=ki,this.textContent=null,this.textContentItemsStr=[],this.textContentStream=null,this.renderingDone=!1,this.pageNumber=xi+1,this.viewport=Ti,this.textDivs=[],this.textLayerRenderTask=null,this.highlighter=Oi,this.enhanceTextSelection=ji,this._bindMouse()}_finishRendering(){if(this.renderingDone=!0,!this.enhanceTextSelection){const Ci=document.createElement("div");Ci.className="endOfContent",this.textLayerDiv.appendChild(Ci)}this.eventBus.dispatch("textlayerrendered",{source:this,pageNumber:this.pageNumber,numTextDivs:this.textDivs.length})}render(Ci=0){var xi;if(!this.textContent&&!this.textContentStream||this.renderingDone)return;this.cancel(),this.textDivs.length=0,(xi=this.highlighter)==null||xi.setTextMapping(this.textDivs,this.textContentItemsStr);const ki=document.createDocumentFragment();this.textLayerRenderTask=(0,wi.renderTextLayer)({textContent:this.textContent,textContentStream:this.textContentStream,container:ki,viewport:this.viewport,textDivs:this.textDivs,textContentItemsStr:this.textContentItemsStr,timeout:Ci,enhanceTextSelection:this.enhanceTextSelection}),this.textLayerRenderTask.promise.then(()=>{var Ti;this.textLayerDiv.appendChild(ki),this._finishRendering(),(Ti=this.highlighter)==null||Ti.enable()},function(Ti){})}cancel(){var Ci;this.textLayerRenderTask&&(this.textLayerRenderTask.cancel(),this.textLayerRenderTask=null),(Ci=this.highlighter)==null||Ci.disable()}setTextContentStream(Ci){this.cancel(),this.textContentStream=Ci}setTextContent(Ci){this.cancel(),this.textContent=Ci}_bindMouse(){const Ci=this.textLayerDiv;let ki=null;Ci.addEventListener("mousedown",xi=>{if(this.enhanceTextSelection&&this.textLayerRenderTask){this.textLayerRenderTask.expandTextDivs(!0),ki&&(clearTimeout(ki),ki=null);return}const Ti=Ci.querySelector(".endOfContent");if(!Ti)return;let Oi=xi.target!==Ci;if(Oi=Oi&&window.getComputedStyle(Ti).getPropertyValue("-moz-user-select")!=="none",Oi){const ji=Ci.getBoundingClientRect(),Li=Math.max(0,(xi.pageY-ji.top)/ji.height);Ti.style.top=(100*Li).toFixed(2)+"%"}Ti.classList.add("active")}),Ci.addEventListener("mouseup",()=>{if(this.enhanceTextSelection&&this.textLayerRenderTask){ki=setTimeout(()=>{this.textLayerRenderTask&&this.textLayerRenderTask.expandTextDivs(!1),ki=null},300);return}const xi=Ci.querySelector(".endOfContent");xi&&(xi.style.top="",xi.classList.remove("active"))})}}},(Ai,Si,Ei)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.XfaLayerBuilder=void 0;var wi=Ei(6);Si.XfaLayerBuilder=class{constructor({pageDiv:Ci,pdfPage:ki,annotationStorage:xi=null,linkService:Ti,xfaHtml:Oi=null}){this.pageDiv=Ci,this.pdfPage=ki,this.annotationStorage=xi,this.linkService=Ti,this.xfaHtml=Oi,this.div=null,this._cancelled=!1}render(Ci,ki="display"){if(ki==="print"){const xi={viewport:Ci.clone({dontFlip:!0}),div:this.div,xfaHtml:this.xfaHtml,annotationStorage:this.annotationStorage,linkService:this.linkService,intent:ki},Ti=document.createElement("div");this.pageDiv.appendChild(Ti),xi.div=Ti;const Oi=wi.XfaLayer.render(xi);return Promise.resolve(Oi)}return this.pdfPage.getXfa().then(xi=>{if(this._cancelled||!xi)return{textDivs:[]};const Ti={viewport:Ci.clone({dontFlip:!0}),div:this.div,xfaHtml:xi,annotationStorage:this.annotationStorage,linkService:this.linkService,intent:ki};return this.div?wi.XfaLayer.update(Ti):(this.div=document.createElement("div"),this.pageDiv.appendChild(this.div),Ti.div=this.div,wi.XfaLayer.render(Ti))}).catch(xi=>{})}cancel(){this._cancelled=!0}hide(){this.div&&(this.div.hidden=!0)}}},(Ai,Si,Ei)=>{var xi,Ns,Oi,Bs,Li;Object.defineProperty(Si,"__esModule",{value:!0}),Si.PDFThumbnailViewer=void 0;var wi=Ei(1),Ci=Ei(26);const ki="selected";Si.PDFThumbnailViewer=(Li=class{constructor({container:Ii,eventBus:Mi,linkService:Fi,renderingQueue:Bi,l10n:Ri}){Er(this,xi);Er(this,Oi);this.container=Ii,this.linkService=Fi,this.renderingQueue=Bi,this.l10n=Ri,this.scroll=(0,wi.watchScroll)(this.container,this._scrollUpdated.bind(this)),this._resetView(),Mi._on("optionalcontentconfigchanged",()=>{this._setImageDisabled=!0})}_scrollUpdated(){this.renderingQueue.renderHighestPriority()}getThumbnail(Ii){return this._thumbnails[Ii]}_getVisibleThumbs(){return(0,wi.getVisibleElements)({scrollEl:this.container,views:this._thumbnails})}scrollThumbnailIntoView(Ii){if(!this.pdfDocument)return;const Mi=this._thumbnails[Ii-1];if(!Mi)return;Ii!==this._currentPageNumber&&(this._thumbnails[this._currentPageNumber-1].div.classList.remove(ki),Mi.div.classList.add(ki));const{first:Fi,last:Bi,views:Ri}=this._getVisibleThumbs();if(Ri.length>0){let Vi=!1;if(Ii<=Fi.id||Ii>=Bi.id)Vi=!0;else for(const{id:Ni,percent:Wi}of Ri)if(Ni===Ii){Vi=Wi<100;break}Vi&&(0,wi.scrollIntoView)(Mi.div,{top:-19})}this._currentPageNumber=Ii}get pagesRotation(){return this._pagesRotation}set pagesRotation(Ii){if(!(0,wi.isValidRotation)(Ii))throw new Error("Invalid thumbnails rotation angle.");if(!this.pdfDocument||this._pagesRotation===Ii)return;this._pagesRotation=Ii;const Mi={rotation:Ii};for(const Fi of this._thumbnails)Fi.update(Mi)}cleanup(){for(let Ii=0,Mi=this._thumbnails.length;Ii{this._optionalContentConfigPromise=Fi;const Ri=Ii.numPages,Vi=Bi.getViewport({scale:1}),Ni=()=>this._setImageDisabled;for(let zi=1;zi<=Ri;++zi){const Di=new Ci.PDFThumbnailView({container:this.container,id:zi,defaultViewport:Vi.clone(),optionalContentConfigPromise:Fi,linkService:this.linkService,renderingQueue:this.renderingQueue,checkSetImageDisabled:Ni,l10n:this.l10n});this._thumbnails.push(Di)}const Wi=this._thumbnails[0];Wi&&Wi.setPdfPage(Bi),this._thumbnails[this._currentPageNumber-1].div.classList.add(ki)}).catch(Bi=>{})}_cancelRendering(){for(let Ii=0,Mi=this._thumbnails.length;Ii{this.renderingQueue.renderView(Fi)}),!0):!1}},xi=new WeakSet,Ns=async function(Ii){if(Ii.pdfPage)return Ii.pdfPage;try{const Mi=await this.pdfDocument.getPage(Ii.id);return Ii.pdfPage||Ii.setPdfPage(Mi),Mi}catch{return null}},Oi=new WeakSet,Bs=function(Ii){var Mi,Fi;return((Mi=Ii.first)==null?void 0:Mi.id)===1||((Fi=Ii.last)==null?void 0:Fi.id)!==this._thumbnails.length&&this.scroll.down},Li)},(Ai,Si,Ei)=>{var xi;Object.defineProperty(Si,"__esModule",{value:!0}),Si.TempImageFactory=Si.PDFThumbnailView=void 0;var wi=Ei(1),Ci=Ei(6);class ki{static getCanvas(Oi,ji){const Li=Cr(this,xi)||Nr(this,xi,document.createElement("canvas"));Li.width=Oi,Li.height=ji,Li.mozOpaque=!0;const Ii=Li.getContext("2d",{alpha:!1});return Ii.save(),Ii.fillStyle="rgb(255, 255, 255)",Ii.fillRect(0,0,Oi,ji),Ii.restore(),[Li,Li.getContext("2d")]}static destroyCanvas(){const Oi=Cr(this,xi);Oi&&(Oi.width=0,Oi.height=0),Nr(this,xi,null)}}xi=new WeakMap,Er(ki,xi,null),Si.TempImageFactory=ki,Si.PDFThumbnailView=class{constructor({container:Ti,id:Oi,defaultViewport:ji,optionalContentConfigPromise:Li,linkService:Ii,renderingQueue:Mi,checkSetImageDisabled:Fi,l10n:Bi}){this.id=Oi,this.renderingId="thumbnail"+Oi,this.pageLabel=null,this.pdfPage=null,this.rotation=0,this.viewport=ji,this.pdfPageRotate=ji.rotation,this._optionalContentConfigPromise=Li||null,this.linkService=Ii,this.renderingQueue=Mi,this.renderTask=null,this.renderingState=wi.RenderingStates.INITIAL,this.resume=null,this._checkSetImageDisabled=Fi||function(){return!1};const Ri=this.viewport.width,Vi=Ri/this.viewport.height;this.canvasWidth=98,this.canvasHeight=this.canvasWidth/Vi|0,this.scale=this.canvasWidth/Ri,this.l10n=Bi;const Ni=document.createElement("a");Ni.href=Ii.getAnchorUrl("#page="+Oi),this._thumbPageTitle.then(Di=>{Ni.title=Di}),Ni.onclick=function(){return Ii.goToPage(Oi),!1},this.anchor=Ni;const Wi=document.createElement("div");Wi.className="thumbnail",Wi.setAttribute("data-page-number",this.id),this.div=Wi;const zi=document.createElement("div");zi.className="thumbnailSelectionRing",zi.style.width=this.canvasWidth+2+"px",zi.style.height=this.canvasHeight+2+"px",this.ring=zi,Wi.appendChild(zi),Ni.appendChild(Wi),Ti.appendChild(Ni)}setPdfPage(Ti){this.pdfPage=Ti,this.pdfPageRotate=Ti.rotate;const Oi=(this.rotation+this.pdfPageRotate)%360;this.viewport=Ti.getViewport({scale:1,rotation:Oi}),this.reset()}reset(){this.cancelRendering(),this.renderingState=wi.RenderingStates.INITIAL;const Ti=this.viewport.width,Oi=Ti/this.viewport.height;this.canvasHeight=this.canvasWidth/Oi|0,this.scale=this.canvasWidth/Ti,this.div.removeAttribute("data-loaded");const ji=this.ring;ji.textContent="",ji.style.width=this.canvasWidth+2+"px",ji.style.height=this.canvasHeight+2+"px",this.canvas&&(this.canvas.width=0,this.canvas.height=0,delete this.canvas),this.image&&(this.image.removeAttribute("src"),delete this.image)}update({rotation:Ti=null}){typeof Ti=="number"&&(this.rotation=Ti);const Oi=(this.rotation+this.pdfPageRotate)%360;this.viewport=this.viewport.clone({scale:1,rotation:Oi}),this.reset()}cancelRendering(){this.renderTask&&(this.renderTask.cancel(),this.renderTask=null),this.resume=null}_getPageDrawContext(Ti=1){const Oi=document.createElement("canvas");Oi.mozOpaque=!0;const ji=Oi.getContext("2d",{alpha:!1}),Li=new wi.OutputScale;return Oi.width=Ti*this.canvasWidth*Li.sx|0,Oi.height=Ti*this.canvasHeight*Li.sy|0,{ctx:ji,canvas:Oi,transform:Li.scaled?[Li.sx,0,0,Li.sy,0,0]:null}}_convertCanvasToImage(Ti){if(this.renderingState!==wi.RenderingStates.FINISHED)throw new Error("_convertCanvasToImage: Rendering has not finished.");const Oi=this._reduceImage(Ti),ji=document.createElement("img");ji.className="thumbnailImage",this._thumbPageCanvas.then(Li=>{ji.setAttribute("aria-label",Li)}),ji.style.width=this.canvasWidth+"px",ji.style.height=this.canvasHeight+"px",ji.src=Oi.toDataURL(),this.image=ji,this.div.setAttribute("data-loaded",!0),this.ring.appendChild(ji),Oi.width=0,Oi.height=0}draw(){if(this.renderingState!==wi.RenderingStates.INITIAL)return Promise.resolve();const{pdfPage:Ti}=this;if(!Ti)return this.renderingState=wi.RenderingStates.FINISHED,Promise.reject(new Error("pdfPage is not loaded"));this.renderingState=wi.RenderingStates.RUNNING;const Oi=async(Ri=null)=>{if(Fi===this.renderTask&&(this.renderTask=null),!(Ri instanceof Ci.RenderingCancelledException)&&(this.renderingState=wi.RenderingStates.FINISHED,this._convertCanvasToImage(Li),Ri))throw Ri},{ctx:ji,canvas:Li,transform:Ii}=this._getPageDrawContext(2),Mi={canvasContext:ji,transform:Ii,viewport:this.viewport.clone({scale:2*this.scale}),optionalContentConfigPromise:this._optionalContentConfigPromise},Fi=this.renderTask=Ti.render(Mi);Fi.onContinue=Ri=>{this.renderingQueue.isHighestPriority(this)?Ri():(this.renderingState=wi.RenderingStates.PAUSED,this.resume=()=>{this.renderingState=wi.RenderingStates.RUNNING,Ri()})};const Bi=Fi.promise.then(function(){return Oi(null)},function(Ri){return Oi(Ri)});return Bi.finally(()=>{var Ri;Li.width=0,Li.height=0,this.linkService.isPageCached(this.id)||((Ri=this.pdfPage)==null||Ri.cleanup())}),Bi}setImage(Ti){if(this._checkSetImageDisabled()||this.renderingState!==wi.RenderingStates.INITIAL)return;const{canvas:Oi,pdfPage:ji}=Ti;Oi&&(this.pdfPage||this.setPdfPage(ji),this.renderingState=wi.RenderingStates.FINISHED,this._convertCanvasToImage(Oi))}_reduceImage(Ti){const{ctx:Oi,canvas:ji}=this._getPageDrawContext();if(Ti.width<=2*ji.width)return Oi.drawImage(Ti,0,0,Ti.width,Ti.height,0,0,ji.width,ji.height),ji;let Li=ji.width<<3,Ii=ji.height<<3;const[Mi,Fi]=ki.getCanvas(Li,Ii);for(;Li>Ti.width||Ii>Ti.height;)Li>>=1,Ii>>=1;for(Fi.drawImage(Ti,0,0,Ti.width,Ti.height,0,0,Li,Ii);Li>2*ji.width;)Fi.drawImage(Mi,0,0,Li,Ii,0,0,Li>>1,Ii>>1),Li>>=1,Ii>>=1;return Oi.drawImage(Mi,0,0,Li,Ii,0,0,ji.width,ji.height),ji}get _thumbPageTitle(){var Ti;return this.l10n.get("thumb_page_title",{page:(Ti=this.pageLabel)!=null?Ti:this.id})}get _thumbPageCanvas(){var Ti;return this.l10n.get("thumb_page_canvas",{page:(Ti=this.pageLabel)!=null?Ti:this.id})}setPageLabel(Ti){this.pageLabel=typeof Ti=="string"?Ti:null,this._thumbPageTitle.then(Oi=>{this.anchor.title=Oi}),this.renderingState===wi.RenderingStates.FINISHED&&this._thumbPageCanvas.then(Oi=>{var ji;(ji=this.image)==null||ji.setAttribute("aria-label",Oi)})}}},(Ai,Si,Ei)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.PDFHistory=void 0,Si.isDestArraysEqual=Ti,Si.isDestHashesEqual=xi;var wi=Ei(1),Ci=Ei(2);function ki(){return document.location.hash}Si.PDFHistory=class{constructor({linkService:Oi,eventBus:ji}){this.linkService=Oi,this.eventBus=ji,this._initialized=!1,this._fingerprint="",this.reset(),this._boundEvents=null,this._isViewerInPresentationMode=!1,this.eventBus._on("presentationmodechanged",Li=>{this._isViewerInPresentationMode=Li.state!==wi.PresentationModeState.NORMAL}),this.eventBus._on("pagesinit",()=>{this._isPagesLoaded=!1,this.eventBus._on("pagesloaded",Li=>{this._isPagesLoaded=!!Li.pagesCount},{once:!0})})}initialize({fingerprint:Oi,resetHistory:ji=!1,updateUrl:Li=!1}){if(!Oi||typeof Oi!="string")return;this._initialized&&this.reset();const Ii=this._fingerprint!==""&&this._fingerprint!==Oi;this._fingerprint=Oi,this._updateUrl=Li===!0,this._initialized=!0,this._bindEvents();const Mi=window.history.state;if(this._popStateInProgress=!1,this._blockHashChange=0,this._currentHash=ki(),this._numPositionUpdates=0,this._uid=this._maxUid=0,this._destination=null,this._position=null,!this._isValidState(Mi,!0)||ji){const{hash:Bi,page:Ri,rotation:Vi}=this._parseCurrentHash(!0);if(!Bi||Ii||ji){this._pushOrReplaceState(null,!0);return}this._pushOrReplaceState({hash:Bi,page:Ri,rotation:Vi},!0);return}const Fi=Mi.destination;this._updateInternalState(Fi,Mi.uid,!0),Fi.rotation!==void 0&&(this._initialRotation=Fi.rotation),Fi.dest?(this._initialBookmark=JSON.stringify(Fi.dest),this._destination.page=null):Fi.hash?this._initialBookmark=Fi.hash:Fi.page&&(this._initialBookmark=`page=${Fi.page}`)}reset(){this._initialized&&(this._pageHide(),this._initialized=!1,this._unbindEvents()),this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._initialBookmark=null,this._initialRotation=null}push({namedDest:Oi=null,explicitDest:ji,pageNumber:Li}){if(!this._initialized||Oi&&typeof Oi!="string"||!Array.isArray(ji)||!this._isValidPage(Li)&&(Li!==null||this._destination))return;const Ii=Oi||JSON.stringify(ji);if(!Ii)return;let Mi=!1;if(this._destination&&(xi(this._destination.hash,Ii)||Ti(this._destination.dest,ji))){if(this._destination.page)return;Mi=!0}(!this._popStateInProgress||Mi)&&(this._pushOrReplaceState({dest:ji,hash:Ii,page:Li,rotation:this.linkService.rotation},Mi),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then(()=>{this._popStateInProgress=!1})))}pushPage(Oi){var Ii;if(!this._initialized||!this._isValidPage(Oi)||((Ii=this._destination)==null?void 0:Ii.page)===Oi||this._popStateInProgress)return;let ji=`page=${Oi}`;const Li=(0,wi.parseQueryString)(this._destination.hash);Li.has("zoom")&&(ji+=`&zoom=${Li.get("zoom")}`),this._pushOrReplaceState({dest:null,hash:ji,page:Oi,rotation:this.linkService.rotation}),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then(()=>{this._popStateInProgress=!1}))}pushCurrentPosition(){this._initialized&&!this._popStateInProgress&&this._tryPushCurrentPosition()}back(){if(!this._initialized||this._popStateInProgress)return;const Oi=window.history.state;this._isValidState(Oi)&&Oi.uid>0&&window.history.back()}forward(){if(!this._initialized||this._popStateInProgress)return;const Oi=window.history.state;this._isValidState(Oi)&&Oi.uid0)}get initialBookmark(){return this._initialized?this._initialBookmark:null}get initialRotation(){return this._initialized?this._initialRotation:null}_pushOrReplaceState(Oi,ji=!1){const Li=ji||!this._destination,Ii={fingerprint:this._fingerprint,uid:Li?this._uid:this._uid+1,destination:Oi};this._updateInternalState(Oi,Ii.uid);let Mi;if(this._updateUrl&&(Oi!=null&&Oi.hash)){const Fi=document.location.href.split("#")[0];Fi.startsWith("file://")||(Mi=`${Fi}#${Oi.hash}`)}Li?window.history.replaceState(Ii,"",Mi):window.history.pushState(Ii,"",Mi)}_tryPushCurrentPosition(Oi=!1){if(!this._position)return;let ji=this._position;if(Oi&&(ji=Object.assign(Object.create(null),this._position),ji.temporary=!0),!this._destination){this._pushOrReplaceState(ji);return}if(this._destination.temporary){this._pushOrReplaceState(ji,!0);return}if(this._destination.hash===ji.hash||!this._destination.page&&this._numPositionUpdates<=50)return;let Li=!1;if(this._destination.page>=ji.first&&this._destination.page<=ji.page){if(this._destination.dest!==void 0||!this._destination.first)return;Li=!0}this._pushOrReplaceState(ji,Li)}_isValidPage(Oi){return Number.isInteger(Oi)&&Oi>0&&Oi<=this.linkService.pagesCount}_isValidState(Oi,ji=!1){if(!Oi)return!1;if(Oi.fingerprint!==this._fingerprint){if(!ji)return!1;{if(typeof Oi.fingerprint!="string"||Oi.fingerprint.length!==this._fingerprint.length||new Date().getTime()-performance.timing.loadEventEnd>200)return!1;const[Li]=performance.getEntriesByType("navigation");if((Li==null?void 0:Li.type)!=="reload")return!1}}return!(!Number.isInteger(Oi.uid)||Oi.uid<0)&&Oi.destination!==null&&typeof Oi.destination=="object"}_updateInternalState(Oi,ji,Li=!1){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),Li&&(Oi!=null&&Oi.temporary)&&delete Oi.temporary,this._destination=Oi,this._uid=ji,this._maxUid=Math.max(this._maxUid,ji),this._numPositionUpdates=0}_parseCurrentHash(Oi=!1){const ji=unescape(ki()).substring(1),Li=(0,wi.parseQueryString)(ji),Ii=Li.get("nameddest")||"";let Mi=0|Li.get("page");return(!this._isValidPage(Mi)||Oi&&Ii.length>0)&&(Mi=null),{hash:ji,page:Mi,rotation:this.linkService.rotation}}_updateViewarea({location:Oi}){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._position={hash:this._isViewerInPresentationMode?`page=${Oi.pageNumber}`:Oi.pdfOpenParams.substring(1),page:this.linkService.page,first:Oi.pageNumber,rotation:Oi.rotation},this._popStateInProgress||(this._isPagesLoaded&&this._destination&&!this._destination.page&&this._numPositionUpdates++,this._updateViewareaTimeout=setTimeout(()=>{this._popStateInProgress||this._tryPushCurrentPosition(!0),this._updateViewareaTimeout=null},1e3))}_popState({state:Oi}){const ji=ki(),Li=this._currentHash!==ji;if(this._currentHash=ji,!Oi){this._uid++;const{hash:Mi,page:Fi,rotation:Bi}=this._parseCurrentHash();this._pushOrReplaceState({hash:Mi,page:Fi,rotation:Bi},!0);return}if(!this._isValidState(Oi))return;this._popStateInProgress=!0,Li&&(this._blockHashChange++,(0,Ci.waitOnEventOrTimeout)({target:window,name:"hashchange",delay:1e3}).then(()=>{this._blockHashChange--}));const Ii=Oi.destination;this._updateInternalState(Ii,Oi.uid,!0),(0,wi.isValidRotation)(Ii.rotation)&&(this.linkService.rotation=Ii.rotation),Ii.dest?this.linkService.goToDestination(Ii.dest):Ii.hash?this.linkService.setHash(Ii.hash):Ii.page&&(this.linkService.page=Ii.page),Promise.resolve().then(()=>{this._popStateInProgress=!1})}_pageHide(){this._destination&&!this._destination.temporary||this._tryPushCurrentPosition()}_bindEvents(){this._boundEvents||(this._boundEvents={updateViewarea:this._updateViewarea.bind(this),popState:this._popState.bind(this),pageHide:this._pageHide.bind(this)},this.eventBus._on("updateviewarea",this._boundEvents.updateViewarea),window.addEventListener("popstate",this._boundEvents.popState),window.addEventListener("pagehide",this._boundEvents.pageHide))}_unbindEvents(){this._boundEvents&&(this.eventBus._off("updateviewarea",this._boundEvents.updateViewarea),window.removeEventListener("popstate",this._boundEvents.popState),window.removeEventListener("pagehide",this._boundEvents.pageHide),this._boundEvents=null)}};function xi(Oi,ji){return typeof Oi!="string"||typeof ji!="string"?!1:Oi===ji?!0:(0,wi.parseQueryString)(Oi).get("nameddest")===ji}function Ti(Oi,ji){function Li(Ii,Mi){if(typeof Ii!=typeof Mi||Array.isArray(Ii)||Array.isArray(Mi))return!1;if(Ii!==null&&typeof Ii=="object"&&Mi!==null){if(Object.keys(Ii).length!==Object.keys(Mi).length)return!1;for(const Fi in Ii)if(!Li(Ii[Fi],Mi[Fi]))return!1;return!0}return Ii===Mi||Number.isNaN(Ii)&&Number.isNaN(Mi)}if(!Array.isArray(Oi)||!Array.isArray(ji)||Oi.length!==ji.length)return!1;for(let Ii=0,Mi=Oi.length;Ii{Object.defineProperty(Si,"__esModule",{value:!0}),Si.PDFFindBar=void 0;var wi=Ei(12);Si.PDFFindBar=class{constructor(Ci,ki,xi){this.opened=!1,this.bar=Ci.bar,this.toggleButton=Ci.toggleButton,this.findField=Ci.findField,this.highlightAll=Ci.highlightAllCheckbox,this.caseSensitive=Ci.caseSensitiveCheckbox,this.matchDiacritics=Ci.matchDiacriticsCheckbox,this.entireWord=Ci.entireWordCheckbox,this.findMsg=Ci.findMsg,this.findResultsCount=Ci.findResultsCount,this.findPreviousButton=Ci.findPreviousButton,this.findNextButton=Ci.findNextButton,this.eventBus=ki,this.l10n=xi,this.toggleButton.addEventListener("click",()=>{this.toggle()}),this.findField.addEventListener("input",()=>{this.dispatchEvent("")}),this.bar.addEventListener("keydown",Ti=>{switch(Ti.keyCode){case 13:Ti.target===this.findField&&this.dispatchEvent("again",Ti.shiftKey);break;case 27:this.close()}}),this.findPreviousButton.addEventListener("click",()=>{this.dispatchEvent("again",!0)}),this.findNextButton.addEventListener("click",()=>{this.dispatchEvent("again",!1)}),this.highlightAll.addEventListener("click",()=>{this.dispatchEvent("highlightallchange")}),this.caseSensitive.addEventListener("click",()=>{this.dispatchEvent("casesensitivitychange")}),this.entireWord.addEventListener("click",()=>{this.dispatchEvent("entirewordchange")}),this.matchDiacritics.addEventListener("click",()=>{this.dispatchEvent("diacriticmatchingchange")}),this.eventBus._on("resize",this._adjustWidth.bind(this))}reset(){this.updateUIState()}dispatchEvent(Ci,ki=!1){this.eventBus.dispatch("find",{source:this,type:Ci,query:this.findField.value,phraseSearch:!0,caseSensitive:this.caseSensitive.checked,entireWord:this.entireWord.checked,highlightAll:this.highlightAll.checked,findPrevious:ki,matchDiacritics:this.matchDiacritics.checked})}updateUIState(Ci,ki,xi){let Ti=Promise.resolve(""),Oi="";switch(Ci){case wi.FindState.FOUND:break;case wi.FindState.PENDING:Oi="pending";break;case wi.FindState.NOT_FOUND:Ti=this.l10n.get("find_not_found"),Oi="notFound";break;case wi.FindState.WRAPPED:Ti=this.l10n.get("find_reached_"+(ki?"top":"bottom"))}this.findField.setAttribute("data-status",Oi),Ti.then(ji=>{this.findMsg.textContent=ji,this._adjustWidth()}),this.updateResultsCount(xi)}updateResultsCount({current:Ci=0,total:ki=0}={}){let xi=Promise.resolve("");if(ki>0)if(ki>1e3){let Ti="find_match_count_limit";xi=this.l10n.get(Ti,{limit:1e3})}else{let Ti="find_match_count";xi=this.l10n.get(Ti,{current:Ci,total:ki})}xi.then(Ti=>{this.findResultsCount.textContent=Ti,this._adjustWidth()})}open(){this.opened||(this.opened=!0,this.toggleButton.classList.add("toggled"),this.toggleButton.setAttribute("aria-expanded","true"),this.bar.classList.remove("hidden")),this.findField.select(),this.findField.focus(),this._adjustWidth()}close(){this.opened&&(this.opened=!1,this.toggleButton.classList.remove("toggled"),this.toggleButton.setAttribute("aria-expanded","false"),this.bar.classList.add("hidden"),this.eventBus.dispatch("findbarclose",{source:this}))}toggle(){this.opened?this.close():this.open()}_adjustWidth(){this.opened&&(this.bar.classList.remove("wrapContainers"),this.bar.clientHeight>this.bar.firstElementChild.clientHeight&&this.bar.classList.add("wrapContainers"))}}},(Ai,Si,Ei)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.PDFDocumentProperties=void 0;var wi=Ei(6),Ci=Ei(1);const ki=["en-us","en-lr","my"],xi={"8.5x11":"Letter","8.5x14":"Legal"},Ti={"297x420":"A3","210x297":"A4"};function Oi(ji,Li,Ii){return Ii[`${Li?ji.width:ji.height}x${Li?ji.height:ji.width}`]}Si.PDFDocumentProperties=class{constructor({overlayName:ji,fields:Li,container:Ii,closeButton:Mi},Fi,Bi,Ri){this.overlayName=ji,this.fields=Li,this.container=Ii,this.overlayManager=Fi,this.l10n=Ri,this._reset(),Mi.addEventListener("click",this.close.bind(this)),this.overlayManager.register(this.overlayName,this.container,this.close.bind(this)),Bi._on("pagechanging",Vi=>{this._currentPageNumber=Vi.pageNumber}),Bi._on("rotationchanging",Vi=>{this._pagesRotation=Vi.pagesRotation}),this._isNonMetricLocale=!0,Ri.getLanguage().then(Vi=>{this._isNonMetricLocale=ki.includes(Vi)})}async open(){const ji=qi=>{Object.defineProperty(this,"fieldData",{value:Object.freeze(qi),writable:!1,enumerable:!0,configurable:!0})};await Promise.all([this.overlayManager.open(this.overlayName),this._dataAvailableCapability.promise]);const Li=this._currentPageNumber,Ii=this._pagesRotation;if(this.fieldData&&Li===this.fieldData._currentPageNumber&&Ii===this.fieldData._pagesRotation){this._updateUI();return}const{info:Mi,contentDispositionFilename:Fi,contentLength:Bi}=await this.pdfDocument.getMetadata(),[Ri,Vi,Ni,Wi,zi,Di]=await Promise.all([Fi||(0,wi.getPdfFilenameFromUrl)(this.url),this._parseFileSize(Bi),this._parseDate(Mi.CreationDate),this._parseDate(Mi.ModDate),this.pdfDocument.getPage(Li).then(qi=>this._parsePageSize((0,Ci.getPageSizeInches)(qi),Ii)),this._parseLinearization(Mi.IsLinearized)]);ji({fileName:Ri,fileSize:Vi,title:Mi.Title,author:Mi.Author,subject:Mi.Subject,keywords:Mi.Keywords,creationDate:Ni,modificationDate:Wi,creator:Mi.Creator,producer:Mi.Producer,version:Mi.PDFFormatVersion,pageCount:this.pdfDocument.numPages,pageSize:zi,linearized:Di,_currentPageNumber:Li,_pagesRotation:Ii}),this._updateUI();const{length:Ui}=await this.pdfDocument.getDownloadInfo();if(Bi===Ui)return;const Hi=Object.assign(Object.create(null),this.fieldData);Hi.fileSize=await this._parseFileSize(Ui),ji(Hi),this._updateUI()}close(){this.overlayManager.close(this.overlayName)}setDocument(ji,Li=null){this.pdfDocument&&(this._reset(),this._updateUI(!0)),ji&&(this.pdfDocument=ji,this.url=Li,this._dataAvailableCapability.resolve())}_reset(){this.pdfDocument=null,this.url=null,delete this.fieldData,this._dataAvailableCapability=(0,wi.createPromiseCapability)(),this._currentPageNumber=1,this._pagesRotation=0}_updateUI(ji=!1){if(!ji&&this.fieldData){if(this.overlayManager.active===this.overlayName)for(const Li in this.fields){const Ii=this.fieldData[Li];this.fields[Li].textContent=Ii||Ii===0?Ii:"-"}}else for(const Li in this.fields)this.fields[Li].textContent="-"}async _parseFileSize(ji=0){const Li=ji/1024,Ii=Li/1024;if(Li)return this.l10n.get("document_properties_"+(Ii>=1?"mb":"kb"),{size_mb:Ii>=1&&(+Ii.toPrecision(3)).toLocaleString(),size_kb:Ii<1&&(+Li.toPrecision(3)).toLocaleString(),size_b:ji.toLocaleString()})}async _parsePageSize(ji,Li){if(!ji)return;Li%180!=0&&(ji={width:ji.height,height:ji.width});const Ii=(0,Ci.isPortraitOrientation)(ji);let Mi={width:Math.round(100*ji.width)/100,height:Math.round(100*ji.height)/100},Fi={width:Math.round(25.4*ji.width*10)/10,height:Math.round(25.4*ji.height*10)/10},Bi=Oi(Mi,Ii,xi)||Oi(Fi,Ii,Ti);if(!(Bi||Number.isInteger(Fi.width)&&Number.isInteger(Fi.height))){const Di={width:25.4*ji.width,height:25.4*ji.height},Ui={width:Math.round(Fi.width),height:Math.round(Fi.height)};Math.abs(Di.width-Ui.width)<.1&&Math.abs(Di.height-Ui.height)<.1&&(Bi=Oi(Ui,Ii,Ti),Bi&&(Mi={width:Math.round(Ui.width/25.4*100)/100,height:Math.round(Ui.height/25.4*100)/100},Fi=Ui))}const[{width:Ri,height:Vi},Ni,Wi,zi]=await Promise.all([this._isNonMetricLocale?Mi:Fi,this.l10n.get("document_properties_page_size_unit_"+(this._isNonMetricLocale?"inches":"millimeters")),Bi&&this.l10n.get(`document_properties_page_size_name_${Bi.toLowerCase()}`),this.l10n.get("document_properties_page_size_orientation_"+(Ii?"portrait":"landscape"))]);return this.l10n.get(`document_properties_page_size_dimension_${Wi?"name_":""}string`,{width:Ri.toLocaleString(),height:Vi.toLocaleString(),unit:Ni,name:Wi,orientation:zi})}async _parseDate(ji){const Li=wi.PDFDateString.toDateObject(ji);if(Li)return this.l10n.get("document_properties_date_string",{date:Li.toLocaleDateString(),time:Li.toLocaleTimeString()})}_parseLinearization(ji){return this.l10n.get("document_properties_linearized_"+(ji?"yes":"no"))}}},(Ai,Si,Ei)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.Toolbar=void 0;var wi=Ei(1);Si.Toolbar=class{constructor(Ci,ki,xi){this.toolbar=Ci.container,this.eventBus=ki,this.l10n=xi,this.buttons=[{element:Ci.previous,eventName:"previouspage"},{element:Ci.next,eventName:"nextpage"},{element:Ci.zoomIn,eventName:"zoomin"},{element:Ci.zoomOut,eventName:"zoomout"},{element:Ci.openFile,eventName:"openfile"},{element:Ci.print,eventName:"print"},{element:Ci.presentationModeButton,eventName:"presentationmode"},{element:Ci.download,eventName:"download"},{element:Ci.viewBookmark,eventName:null}],this.items={numPages:Ci.numPages,pageNumber:Ci.pageNumber,scaleSelect:Ci.scaleSelect,customScaleOption:Ci.customScaleOption,previous:Ci.previous,next:Ci.next,zoomIn:Ci.zoomIn,zoomOut:Ci.zoomOut},this._wasLocalized=!1,this.reset(),this._bindListeners()}setPageNumber(Ci,ki){this.pageNumber=Ci,this.pageLabel=ki-10,this._updateUIState(!1)}setPagesCount(Ci,ki){this.pagesCount=Ci,this.hasPageLabels=ki,this._updateUIState(!0)}setPageScale(Ci,ki){this.pageScaleValue=(Ci||ki).toString(),this.pageScale=ki,this._updateUIState(!1)}reset(){this.pageNumber=0,this.pageLabel=null,this.hasPageLabels=!1,this.pagesCount=0,this.pageScaleValue=wi.DEFAULT_SCALE_VALUE,this.pageScale=wi.DEFAULT_SCALE,this._updateUIState(!0),this.updateLoadingIndicatorState()}_bindListeners(){const{pageNumber:Ci,scaleSelect:ki}=this.items,xi=this;for(const{element:Ti,eventName:Oi}of this.buttons)Ti.addEventListener("click",ji=>{Oi!==null&&this.eventBus.dispatch(Oi,{source:this})});Ci.addEventListener("click",function(){this.select()}),Ci.addEventListener("change",function(){xi.eventBus.dispatch("pagenumberchanged",{source:xi,value:this.value})}),ki.addEventListener("change",function(){this.value!=="custom"&&xi.eventBus.dispatch("scalechanged",{source:xi,value:this.value})}),ki.addEventListener("click",function(Ti){const Oi=Ti.target;this.value===xi.pageScaleValue&&Oi.tagName.toUpperCase()==="OPTION"&&this.blur()}),ki.oncontextmenu=wi.noContextMenuHandler,this.eventBus._on("localized",()=>{this._wasLocalized=!0,this._adjustScaleWidth(),this._updateUIState(!0)})}_updateUIState(Ci=!1){if(!this._wasLocalized)return;const{pageNumber:ki,pagesCount:xi,pageScaleValue:Ti,pageScale:Oi,items:ji}=this;Ci&&(this.hasPageLabels?ji.pageNumber.type="text":(ji.pageNumber.type="number",this.l10n.get("of_pages",{pagesCount:xi}).then(Li=>{ji.numPages.textContent=Li})),ji.pageNumber.max=xi),this.hasPageLabels?(ji.pageNumber.value=this.pageLabel,this.l10n.get("page_of_pages",{pageNumber:ki,pagesCount:xi}).then(Li=>{ji.numPages.textContent=Li})):ji.pageNumber.value=ki,ji.previous.disabled=ki<=1,ji.next.disabled=ki>=xi,ji.zoomOut.disabled=Oi<=wi.MIN_SCALE,ji.zoomIn.disabled=Oi>=wi.MAX_SCALE,this.l10n.get("page_scale_percent",{scale:Math.round(1e4*Oi)/100}).then(Li=>{let Ii=!1;for(const Mi of ji.scaleSelect.options)Mi.value===Ti?(Mi.selected=!0,Ii=!0):Mi.selected=!1;Ii||(ji.customScaleOption.textContent=Li,ji.customScaleOption.selected=!0)})}updateLoadingIndicatorState(Ci=!1){this.items.pageNumber.classList.toggle("visiblePageIsLoading",Ci)}async _adjustScaleWidth(){const{items:Ci,l10n:ki}=this,xi=Promise.all([ki.get("page_scale_auto"),ki.get("page_scale_actual"),ki.get("page_scale_fit"),ki.get("page_scale_width")]),Ti=getComputedStyle(Ci.scaleSelect),Oi=parseInt(Ti.getPropertyValue("--scale-select-container-width"),10),ji=parseInt(Ti.getPropertyValue("--scale-select-overflow"),10);let Li=document.createElement("canvas");Li.mozOpaque=!0;let Ii=Li.getContext("2d",{alpha:!1});await wi.animationStarted,Ii.font=`${Ti.fontSize} ${Ti.fontFamily}`;let Mi=0;for(const Fi of await xi){const{width:Bi}=Ii.measureText(Fi);Bi>Mi&&(Mi=Bi)}Mi+=2*ji,Mi>Oi&&document.documentElement.style.setProperty("--scale-select-container-width",`${Mi}px`),Li.width=0,Li.height=0,Li=Ii=null}}},(Ai,Si,Ei)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.SecondaryToolbar=void 0;var wi=Ei(1),Ci=Ei(9),ki=Ei(16);Si.SecondaryToolbar=class{constructor(xi,Ti,Oi){this.toolbar=xi.toolbar,this.toggleButton=xi.toggleButton,this.toolbarButtonContainer=xi.toolbarButtonContainer,this.buttons=[{element:xi.presentationModeButton,eventName:"presentationmode",close:!0},{element:xi.openFileButton,eventName:"openfile",close:!0},{element:xi.printButton,eventName:"print",close:!0},{element:xi.downloadButton,eventName:"download",close:!0},{element:xi.viewBookmarkButton,eventName:null,close:!0},{element:xi.firstPageButton,eventName:"firstpage",close:!0},{element:xi.lastPageButton,eventName:"lastpage",close:!0},{element:xi.pageRotateCwButton,eventName:"rotatecw",close:!1},{element:xi.pageRotateCcwButton,eventName:"rotateccw",close:!1},{element:xi.cursorSelectToolButton,eventName:"switchcursortool",eventDetails:{tool:Ci.CursorTool.SELECT},close:!0},{element:xi.cursorHandToolButton,eventName:"switchcursortool",eventDetails:{tool:Ci.CursorTool.HAND},close:!0},{element:xi.scrollPageButton,eventName:"switchscrollmode",eventDetails:{mode:wi.ScrollMode.PAGE},close:!0},{element:xi.scrollVerticalButton,eventName:"switchscrollmode",eventDetails:{mode:wi.ScrollMode.VERTICAL},close:!0},{element:xi.scrollHorizontalButton,eventName:"switchscrollmode",eventDetails:{mode:wi.ScrollMode.HORIZONTAL},close:!0},{element:xi.scrollWrappedButton,eventName:"switchscrollmode",eventDetails:{mode:wi.ScrollMode.WRAPPED},close:!0},{element:xi.spreadNoneButton,eventName:"switchspreadmode",eventDetails:{mode:wi.SpreadMode.NONE},close:!0},{element:xi.spreadOddButton,eventName:"switchspreadmode",eventDetails:{mode:wi.SpreadMode.ODD},close:!0},{element:xi.spreadEvenButton,eventName:"switchspreadmode",eventDetails:{mode:wi.SpreadMode.EVEN},close:!0},{element:xi.documentPropertiesButton,eventName:"documentproperties",close:!0}],this.items={firstPage:xi.firstPageButton,lastPage:xi.lastPageButton,pageRotateCw:xi.pageRotateCwButton,pageRotateCcw:xi.pageRotateCcwButton},this.mainContainer=Ti,this.eventBus=Oi,this.opened=!1,this.containerHeight=null,this.previousContainerHeight=null,this.reset(),this._bindClickListeners(),this._bindCursorToolsListener(xi),this._bindScrollModeListener(xi),this._bindSpreadModeListener(xi),this.eventBus._on("resize",this._setMaxHeight.bind(this))}get isOpen(){return this.opened}setPageNumber(xi){this.pageNumber=xi,this._updateUIState()}setPagesCount(xi){this.pagesCount=xi,this._updateUIState()}reset(){this.pageNumber=0,this.pagesCount=0,this._updateUIState(),this.eventBus.dispatch("secondarytoolbarreset",{source:this})}_updateUIState(){this.items.firstPage.disabled=this.pageNumber<=1,this.items.lastPage.disabled=this.pageNumber>=this.pagesCount,this.items.pageRotateCw.disabled=this.pagesCount===0,this.items.pageRotateCcw.disabled=this.pagesCount===0}_bindClickListeners(){this.toggleButton.addEventListener("click",this.toggle.bind(this));for(const{element:xi,eventName:Ti,close:Oi,eventDetails:ji}of this.buttons)xi.addEventListener("click",Li=>{if(Ti!==null){const Ii={source:this};for(const Mi in ji)Ii[Mi]=ji[Mi];this.eventBus.dispatch(Ti,Ii)}Oi&&this.close()})}_bindCursorToolsListener(xi){this.eventBus._on("cursortoolchanged",function({tool:Ti}){xi.cursorSelectToolButton.classList.toggle("toggled",Ti===Ci.CursorTool.SELECT),xi.cursorHandToolButton.classList.toggle("toggled",Ti===Ci.CursorTool.HAND)})}_bindScrollModeListener(xi){const Ti=({mode:Oi})=>{xi.scrollPageButton.classList.toggle("toggled",Oi===wi.ScrollMode.PAGE),xi.scrollVerticalButton.classList.toggle("toggled",Oi===wi.ScrollMode.VERTICAL),xi.scrollHorizontalButton.classList.toggle("toggled",Oi===wi.ScrollMode.HORIZONTAL),xi.scrollWrappedButton.classList.toggle("toggled",Oi===wi.ScrollMode.WRAPPED);const ji=this.pagesCount>ki.PagesCountLimit.FORCE_SCROLL_MODE_PAGE;xi.scrollPageButton.disabled=ji,xi.scrollVerticalButton.disabled=ji,xi.scrollHorizontalButton.disabled=ji,xi.scrollWrappedButton.disabled=ji;const Li=Oi===wi.ScrollMode.HORIZONTAL;xi.spreadNoneButton.disabled=Li,xi.spreadOddButton.disabled=Li,xi.spreadEvenButton.disabled=Li};this.eventBus._on("scrollmodechanged",Ti),this.eventBus._on("secondarytoolbarreset",Oi=>{Oi.source===this&&Ti({mode:wi.ScrollMode.VERTICAL})})}_bindSpreadModeListener(xi){function Ti({mode:Oi}){xi.spreadNoneButton.classList.toggle("toggled",Oi===wi.SpreadMode.NONE),xi.spreadOddButton.classList.toggle("toggled",Oi===wi.SpreadMode.ODD),xi.spreadEvenButton.classList.toggle("toggled",Oi===wi.SpreadMode.EVEN)}this.eventBus._on("spreadmodechanged",Ti),this.eventBus._on("secondarytoolbarreset",Oi=>{Oi.source===this&&Ti({mode:wi.SpreadMode.NONE})})}open(){this.opened||(this.opened=!0,this._setMaxHeight(),this.toggleButton.classList.add("toggled"),this.toggleButton.setAttribute("aria-expanded","true"),this.toolbar.classList.remove("hidden"))}close(){this.opened&&(this.opened=!1,this.toolbar.classList.add("hidden"),this.toggleButton.classList.remove("toggled"),this.toggleButton.setAttribute("aria-expanded","false"))}toggle(){this.opened?this.close():this.open()}_setMaxHeight(){this.opened&&(this.containerHeight=this.mainContainer.clientHeight,this.containerHeight!==this.previousContainerHeight&&(this.toolbarButtonContainer.style.maxHeight=this.containerHeight-wi.SCROLLBAR_PADDING+"px",this.previousContainerHeight=this.containerHeight))}}},(Ai,Si,Ei)=>{var Ti,Vs,ji,ds,Ii,js,Fi,Us,Ri,Ws,Ni,zs,zi,Hs,Ui,Gs,qi,Ss,Ki,qs,Xi,us,ar,Ks,fr,Ys,mr,Xs,Yi,Js,ir,Zs,tr,As,Ji;Object.defineProperty(Si,"__esModule",{value:!0}),Si.PDFPresentationMode=void 0;var wi=Ei(1);const Ci="pdfPresentationMode",ki="pdfPresentationModeControls",xi=Math.PI/6;Si.PDFPresentationMode=(Ji=class{constructor({container:sr,pdfViewer:pr,eventBus:or}){Er(this,Ti);Er(this,ji);Er(this,Ii);Er(this,Fi);Er(this,Ri);Er(this,Ni);Er(this,zi);Er(this,Ui);Er(this,qi);Er(this,Ki);Er(this,Xi);Er(this,ar);Er(this,fr);Er(this,mr);Er(this,Yi);Er(this,ir);Er(this,tr);this.container=sr,this.pdfViewer=pr,this.eventBus=or,this.active=!1,this.args=null,this.contextMenuOpen=!1,this.mouseScrollTimeStamp=0,this.mouseScrollDelta=0,this.touchSwipeState=null}request(){return this.switchInProgress||this.active||!this.pdfViewer.pagesCount||!this.container.requestFullscreen?!1:(xr(this,ir,Zs).call(this),xr(this,Ii,js).call(this),xr(this,ji,ds).call(this),this.container.requestFullscreen(),this.args={pageNumber:this.pdfViewer.currentPageNumber,scaleValue:this.pdfViewer.currentScaleValue,scrollMode:this.pdfViewer.scrollMode,spreadMode:this.pdfViewer.spreadMode},!0)}},Ti=new WeakSet,Vs=function(sr){if(!this.active)return;sr.preventDefault();const pr=(0,wi.normalizeWheelEventDelta)(sr),or=Date.now(),Zi=this.mouseScrollTimeStamp;if(!(or>Zi&&or-Zi<50)&&((this.mouseScrollDelta>0&&pr<0||this.mouseScrollDelta<0&&pr>0)&&xr(this,Xi,us).call(this),this.mouseScrollDelta+=pr,Math.abs(this.mouseScrollDelta)>=.1)){const er=this.mouseScrollDelta;xr(this,Xi,us).call(this),(er>0?this.pdfViewer.previousPage():this.pdfViewer.nextPage())&&(this.mouseScrollTimeStamp=or)}},ji=new WeakSet,ds=function(){let sr=wi.PresentationModeState.NORMAL;this.switchInProgress?sr=wi.PresentationModeState.CHANGING:this.active&&(sr=wi.PresentationModeState.FULLSCREEN),this.eventBus.dispatch("presentationmodechanged",{source:this,state:sr})},Ii=new WeakSet,js=function(){this.switchInProgress&&clearTimeout(this.switchInProgress),this.switchInProgress=setTimeout(()=>{xr(this,tr,As).call(this),delete this.switchInProgress,xr(this,ji,ds).call(this)},1500)},Fi=new WeakSet,Us=function(){this.switchInProgress&&(clearTimeout(this.switchInProgress),delete this.switchInProgress)},Ri=new WeakSet,Ws=function(){this.active=!0,xr(this,Fi,Us).call(this),xr(this,ji,ds).call(this),this.container.classList.add(Ci),setTimeout(()=>{this.pdfViewer.scrollMode=wi.ScrollMode.PAGE,this.pdfViewer.spreadMode=wi.SpreadMode.NONE,this.pdfViewer.currentPageNumber=this.args.pageNumber,this.pdfViewer.currentScaleValue="page-fit"},0),xr(this,fr,Ys).call(this),xr(this,qi,Ss).call(this),this.contextMenuOpen=!1,window.getSelection().removeAllRanges()},Ni=new WeakSet,zs=function(){const sr=this.pdfViewer.currentPageNumber;this.container.classList.remove(Ci),setTimeout(()=>{this.active=!1,xr(this,tr,As).call(this),xr(this,ji,ds).call(this),this.pdfViewer.scrollMode=this.args.scrollMode,this.pdfViewer.spreadMode=this.args.spreadMode,this.pdfViewer.currentScaleValue=this.args.scaleValue,this.pdfViewer.currentPageNumber=sr,this.args=null},0),xr(this,mr,Xs).call(this),xr(this,Ki,qs).call(this),xr(this,Xi,us).call(this),this.contextMenuOpen=!1},zi=new WeakSet,Hs=function(sr){this.contextMenuOpen?(this.contextMenuOpen=!1,sr.preventDefault()):sr.button===0&&(sr.target.href&&sr.target.classList.contains("internalLink")||(sr.preventDefault(),sr.shiftKey?this.pdfViewer.previousPage():this.pdfViewer.nextPage()))},Ui=new WeakSet,Gs=function(){this.contextMenuOpen=!0},qi=new WeakSet,Ss=function(){this.controlsTimeout?clearTimeout(this.controlsTimeout):this.container.classList.add(ki),this.controlsTimeout=setTimeout(()=>{this.container.classList.remove(ki),delete this.controlsTimeout},3e3)},Ki=new WeakSet,qs=function(){this.controlsTimeout&&(clearTimeout(this.controlsTimeout),this.container.classList.remove(ki),delete this.controlsTimeout)},Xi=new WeakSet,us=function(){this.mouseScrollTimeStamp=0,this.mouseScrollDelta=0},ar=new WeakSet,Ks=function(sr){if(this.active)if(sr.touches.length>1)this.touchSwipeState=null;else switch(sr.type){case"touchstart":this.touchSwipeState={startX:sr.touches[0].pageX,startY:sr.touches[0].pageY,endX:sr.touches[0].pageX,endY:sr.touches[0].pageY};break;case"touchmove":if(this.touchSwipeState===null)return;this.touchSwipeState.endX=sr.touches[0].pageX,this.touchSwipeState.endY=sr.touches[0].pageY,sr.preventDefault();break;case"touchend":if(this.touchSwipeState===null)return;let pr=0;const or=this.touchSwipeState.endX-this.touchSwipeState.startX,Zi=this.touchSwipeState.endY-this.touchSwipeState.startY,er=Math.abs(Math.atan2(Zi,or));Math.abs(or)>50&&(er<=xi||er>=Math.PI-xi)?pr=or:Math.abs(Zi)>50&&Math.abs(er-Math.PI/2)<=xi&&(pr=Zi),pr>0?this.pdfViewer.previousPage():pr<0&&this.pdfViewer.nextPage()}},fr=new WeakSet,Ys=function(){this.showControlsBind=xr(this,qi,Ss).bind(this),this.mouseDownBind=xr(this,zi,Hs).bind(this),this.mouseWheelBind=xr(this,Ti,Vs).bind(this),this.resetMouseScrollStateBind=xr(this,Xi,us).bind(this),this.contextMenuBind=xr(this,Ui,Gs).bind(this),this.touchSwipeBind=xr(this,ar,Ks).bind(this),window.addEventListener("mousemove",this.showControlsBind),window.addEventListener("mousedown",this.mouseDownBind),window.addEventListener("wheel",this.mouseWheelBind,{passive:!1}),window.addEventListener("keydown",this.resetMouseScrollStateBind),window.addEventListener("contextmenu",this.contextMenuBind),window.addEventListener("touchstart",this.touchSwipeBind),window.addEventListener("touchmove",this.touchSwipeBind),window.addEventListener("touchend",this.touchSwipeBind)},mr=new WeakSet,Xs=function(){window.removeEventListener("mousemove",this.showControlsBind),window.removeEventListener("mousedown",this.mouseDownBind),window.removeEventListener("wheel",this.mouseWheelBind,{passive:!1}),window.removeEventListener("keydown",this.resetMouseScrollStateBind),window.removeEventListener("contextmenu",this.contextMenuBind),window.removeEventListener("touchstart",this.touchSwipeBind),window.removeEventListener("touchmove",this.touchSwipeBind),window.removeEventListener("touchend",this.touchSwipeBind),delete this.showControlsBind,delete this.mouseDownBind,delete this.mouseWheelBind,delete this.resetMouseScrollStateBind,delete this.contextMenuBind,delete this.touchSwipeBind},Yi=new WeakSet,Js=function(){document.fullscreenElement?xr(this,Ri,Ws).call(this):xr(this,Ni,zs).call(this)},ir=new WeakSet,Zs=function(){this.fullscreenChangeBind=xr(this,Yi,Js).bind(this),window.addEventListener("fullscreenchange",this.fullscreenChangeBind)},tr=new WeakSet,As=function(){window.removeEventListener("fullscreenchange",this.fullscreenChangeBind),delete this.fullscreenChangeBind},Ji)},(Ai,Si,Ei)=>{var Ci,Cs,xi,Es,Oi;Object.defineProperty(Si,"__esModule",{value:!0}),Si.PasswordPrompt=void 0;var wi=Ei(6);Si.PasswordPrompt=(Oi=class{constructor(ji,Li,Ii,Mi=!1){Er(this,Ci);Er(this,xi);this.overlayName=ji.overlayName,this.container=ji.container,this.label=ji.label,this.input=ji.input,this.submitButton=ji.submitButton,this.cancelButton=ji.cancelButton,this.overlayManager=Li,this.l10n=Ii,this._isViewerEmbedded=Mi,this.updateCallback=null,this.reason=null,this.submitButton.addEventListener("click",xr(this,Ci,Cs).bind(this)),this.cancelButton.addEventListener("click",xr(this,xi,Es).bind(this)),this.input.addEventListener("keydown",Fi=>{Fi.keyCode===13&&xr(this,Ci,Cs).call(this)}),this.overlayManager.register(this.overlayName,this.container,xr(this,xi,Es).bind(this),!0)}async open(){await this.overlayManager.open(this.overlayName);const ji=this.reason===wi.PasswordResponses.INCORRECT_PASSWORD;this._isViewerEmbedded&&!ji||this.input.focus(),this.label.textContent=await this.l10n.get("password_"+(ji?"invalid":"label"))}async close(){await this.overlayManager.close(this.overlayName),this.input.value=""}setUpdateCallback(ji,Li){this.updateCallback=ji,this.reason=Li}},Ci=new WeakSet,Cs=function(){const ji=this.input.value;(ji==null?void 0:ji.length)>0&&(this.close(),this.updateCallback(ji))},xi=new WeakSet,Es=function(){this.close(),this.updateCallback(new Error("PasswordPrompt cancelled."))},Oi)},(Ai,Si,Ei)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.PDFOutlineViewer=void 0;var wi=Ei(35),Ci=Ei(6),ki=Ei(1);class xi extends wi.BaseTreeViewer{constructor(Oi){super(Oi),this.linkService=Oi.linkService,this.eventBus._on("toggleoutlinetree",this._toggleAllTreeItems.bind(this)),this.eventBus._on("currentoutlineitem",this._currentOutlineItem.bind(this)),this.eventBus._on("pagechanging",ji=>{this._currentPageNumber=ji.pageNumber}),this.eventBus._on("pagesloaded",ji=>{this._isPagesLoaded=!!ji.pagesCount,this._currentOutlineItemCapability&&!this._currentOutlineItemCapability.settled&&this._currentOutlineItemCapability.resolve(this._isPagesLoaded)}),this.eventBus._on("sidebarviewchanged",ji=>{this._sidebarView=ji.view})}reset(){super.reset(),this._outline=null,this._pageNumberToDestHashCapability=null,this._currentPageNumber=1,this._isPagesLoaded=null,this._currentOutlineItemCapability&&!this._currentOutlineItemCapability.settled&&this._currentOutlineItemCapability.resolve(!1),this._currentOutlineItemCapability=null}_dispatchEvent(Oi){var ji;this._currentOutlineItemCapability=(0,Ci.createPromiseCapability)(),Oi===0||(ji=this._pdfDocument)!=null&&ji.loadingParams.disableAutoFetch?this._currentOutlineItemCapability.resolve(!1):this._isPagesLoaded!==null&&this._currentOutlineItemCapability.resolve(this._isPagesLoaded),this.eventBus.dispatch("outlineloaded",{source:this,outlineCount:Oi,currentOutlineItemPromise:this._currentOutlineItemCapability.promise})}_bindLink(Oi,{url:ji,newWindow:Li,dest:Ii}){const{linkService:Mi}=this;ji?Mi.addLinkAttributes(Oi,ji,Li):(Oi.href=Mi.getDestinationHash(Ii),Oi.onclick=Fi=>(this._updateCurrentTreeItem(Fi.target.parentNode),Ii&&Mi.goToDestination(Ii),!1))}_setStyles(Oi,{bold:ji,italic:Li}){ji&&(Oi.style.fontWeight="bold"),Li&&(Oi.style.fontStyle="italic")}_addToggleButton(Oi,{count:ji,items:Li}){let Ii=!1;if(ji<0){let Mi=Li.length;if(Mi>0){const Fi=[...Li];for(;Fi.length>0;){const{count:Bi,items:Ri}=Fi.shift();Bi>0&&Ri.length>0&&(Mi+=Ri.length,Fi.push(...Ri))}}Math.abs(ji)===Mi&&(Ii=!0)}super._addToggleButton(Oi,Ii)}_toggleAllTreeItems(){this._outline&&super._toggleAllTreeItems()}render({outline:Oi,pdfDocument:ji}){if(this._outline&&this.reset(),this._outline=Oi||null,this._pdfDocument=ji||null,!Oi){this._dispatchEvent(0);return}const Li=document.createDocumentFragment(),Ii=[{parent:Li,items:Oi}];let Mi=0,Fi=!1;for(;Ii.length>0;){const Bi=Ii.shift();for(const Ri of Bi.items){const Vi=document.createElement("div");Vi.className="treeItem";const Ni=document.createElement("a");if(this._bindLink(Ni,Ri),this._setStyles(Ni,Ri),Ni.textContent=this._normalizeTextContent(Ri.title),Vi.appendChild(Ni),Ri.items.length>0){Fi=!0,this._addToggleButton(Vi,Ri);const Wi=document.createElement("div");Wi.className="treeItems",Vi.appendChild(Wi),Ii.push({parent:Wi,items:Ri.items})}Bi.parent.appendChild(Vi),Mi++}}this._finishRendering(Li,Mi,Fi)}async _currentOutlineItem(){if(!this._isPagesLoaded)throw new Error("_currentOutlineItem: All pages have not been loaded.");if(!this._outline||!this._pdfDocument)return;const Oi=await this._getPageNumberToDestHash(this._pdfDocument);if(Oi&&(this._updateCurrentTreeItem(null),this._sidebarView===ki.SidebarView.OUTLINE))for(let ji=this._currentPageNumber;ji>0;ji--){const Li=Oi.get(ji);if(!Li)continue;const Ii=this.container.querySelector(`a[href="${Li}"]`);if(Ii){this._scrollToCurrentTreeItem(Ii.parentNode);break}}}async _getPageNumberToDestHash(Oi){if(this._pageNumberToDestHashCapability)return this._pageNumberToDestHashCapability.promise;this._pageNumberToDestHashCapability=(0,Ci.createPromiseCapability)();const ji=new Map,Li=new Map,Ii=[{nesting:0,items:this._outline}];for(;Ii.length>0;){const Mi=Ii.shift(),Fi=Mi.nesting;for(const{dest:Bi,items:Ri}of Mi.items){let Vi,Ni;if(typeof Bi=="string"){if(Vi=await Oi.getDestination(Bi),Oi!==this._pdfDocument)return null}else Vi=Bi;if(Array.isArray(Vi)){const[Wi]=Vi;if(typeof Wi=="object"&&Wi!==null){if(Ni=this.linkService._cachedPageNumber(Wi),!Ni)try{if(Ni=await Oi.getPageIndex(Wi)+1,Oi!==this._pdfDocument)return null;this.linkService.cachePageRef(Ni,Wi)}catch{}}else Number.isInteger(Wi)&&(Ni=Wi+1);if(Number.isInteger(Ni)&&(!ji.has(Ni)||Fi>Li.get(Ni))){const zi=this.linkService.getDestinationHash(Bi);ji.set(Ni,zi),Li.set(Ni,Fi)}}Ri.length>0&&Ii.push({nesting:Fi+1,items:Ri})}}return this._pageNumberToDestHashCapability.resolve(ji.size>0?ji:null),this._pageNumberToDestHashCapability.promise}}Si.PDFOutlineViewer=xi},(Ai,Si,Ei)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.BaseTreeViewer=void 0;var wi=Ei(1);const Ci="selected";class ki{constructor(Ti){if(this.constructor===ki)throw new Error("Cannot initialize BaseTreeViewer.");this.container=Ti.container,this.eventBus=Ti.eventBus,this.reset()}reset(){this._pdfDocument=null,this._lastToggleIsShow=!0,this._currentTreeItem=null,this.container.textContent="",this.container.classList.remove("treeWithDeepNesting")}_dispatchEvent(Ti){throw new Error("Not implemented: _dispatchEvent")}_bindLink(Ti,Oi){throw new Error("Not implemented: _bindLink")}_normalizeTextContent(Ti){return(0,wi.removeNullCharacters)(Ti,!0)||"–"}_addToggleButton(Ti,Oi=!1){const ji=document.createElement("div");ji.className="treeItemToggler",Oi&&ji.classList.add("treeItemsHidden"),ji.onclick=Li=>{if(Li.stopPropagation(),ji.classList.toggle("treeItemsHidden"),Li.shiftKey){const Ii=!ji.classList.contains("treeItemsHidden");this._toggleTreeItem(Ti,Ii)}},Ti.insertBefore(ji,Ti.firstChild)}_toggleTreeItem(Ti,Oi=!1){this._lastToggleIsShow=Oi;for(const ji of Ti.querySelectorAll(".treeItemToggler"))ji.classList.toggle("treeItemsHidden",!Oi)}_toggleAllTreeItems(){this._toggleTreeItem(this.container,!this._lastToggleIsShow)}_finishRendering(Ti,Oi,ji=!1){ji&&(this.container.classList.add("treeWithDeepNesting"),this._lastToggleIsShow=!Ti.querySelector(".treeItemsHidden")),this.container.appendChild(Ti),this._dispatchEvent(Oi)}render(Ti){throw new Error("Not implemented: render")}_updateCurrentTreeItem(Ti=null){this._currentTreeItem&&(this._currentTreeItem.classList.remove(Ci),this._currentTreeItem=null),Ti&&(Ti.classList.add(Ci),this._currentTreeItem=Ti)}_scrollToCurrentTreeItem(Ti){var ji;if(!Ti)return;let Oi=Ti.parentNode;for(;Oi&&Oi!==this.container;)Oi.classList.contains("treeItem")&&((ji=Oi.firstElementChild)==null||ji.classList.remove("treeItemsHidden")),Oi=Oi.parentNode;this._updateCurrentTreeItem(Ti),this.container.scrollTo(Ti.offsetLeft,Ti.offsetTop+-100)}}Si.BaseTreeViewer=ki},(Ai,Si,Ei)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.PDFAttachmentViewer=void 0;var wi=Ei(6),Ci=Ei(35);class ki extends Ci.BaseTreeViewer{constructor(Ti){super(Ti),this.downloadManager=Ti.downloadManager,this.eventBus._on("fileattachmentannotation",this._appendAttachment.bind(this))}reset(Ti=!1){super.reset(),this._attachments=null,Ti||(this._renderedCapability=(0,wi.createPromiseCapability)()),this._pendingDispatchEvent&&clearTimeout(this._pendingDispatchEvent),this._pendingDispatchEvent=null}_dispatchEvent(Ti){this._renderedCapability.resolve(),this._pendingDispatchEvent&&(clearTimeout(this._pendingDispatchEvent),this._pendingDispatchEvent=null),Ti!==0?this.eventBus.dispatch("attachmentsloaded",{source:this,attachmentsCount:Ti}):this._pendingDispatchEvent=setTimeout(()=>{this.eventBus.dispatch("attachmentsloaded",{source:this,attachmentsCount:0}),this._pendingDispatchEvent=null})}_bindLink(Ti,{content:Oi,filename:ji}){Ti.onclick=()=>(this.downloadManager.openOrDownloadData(Ti,Oi,ji),!1)}render({attachments:Ti,keepRenderedCapability:Oi=!1}){if(this._attachments&&this.reset(Oi),this._attachments=Ti||null,!Ti){this._dispatchEvent(0);return}const ji=Object.keys(Ti).sort(function(Mi,Fi){return Mi.toLowerCase().localeCompare(Fi.toLowerCase())}),Li=document.createDocumentFragment();let Ii=0;for(const Mi of ji){const Fi=Ti[Mi],Bi=Fi.content,Ri=(0,wi.getFilenameFromUrl)(Fi.filename),Vi=document.createElement("div");Vi.className="treeItem";const Ni=document.createElement("a");this._bindLink(Ni,{content:Bi,filename:Ri}),Ni.textContent=this._normalizeTextContent(Ri),Vi.appendChild(Ni),Li.appendChild(Vi),Ii++}this._finishRendering(Li,Ii)}_appendAttachment({id:Ti,filename:Oi,content:ji}){const Li=this._renderedCapability.promise;Li.then(()=>{if(Li!==this._renderedCapability.promise)return;let Ii=this._attachments;if(Ii){for(const Mi in Ii)if(Ti===Mi)return}else Ii=Object.create(null);Ii[Ti]={filename:Oi,content:ji},this.render({attachments:Ii,keepRenderedCapability:!0})})}}Si.PDFAttachmentViewer=ki},(Ai,Si,Ei)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.PDFLayerViewer=void 0;var wi=Ei(35);class Ci extends wi.BaseTreeViewer{constructor(xi){super(xi),this.l10n=xi.l10n,this.eventBus._on("resetlayers",this._resetLayers.bind(this)),this.eventBus._on("togglelayerstree",this._toggleAllTreeItems.bind(this))}reset(){super.reset(),this._optionalContentConfig=null}_dispatchEvent(xi){this.eventBus.dispatch("layersloaded",{source:this,layersCount:xi})}_bindLink(xi,{groupId:Ti,input:Oi}){const ji=()=>{this._optionalContentConfig.setVisibility(Ti,Oi.checked),this.eventBus.dispatch("optionalcontentconfig",{source:this,promise:Promise.resolve(this._optionalContentConfig)})};xi.onclick=Li=>Li.target===Oi?(ji(),!0):Li.target!==xi?!0:(Oi.checked=!Oi.checked,ji(),!1)}async _setNestedName(xi,{name:Ti=null}){typeof Ti!="string"?(xi.textContent=await this.l10n.get("additional_layers"),xi.style.fontStyle="italic"):xi.textContent=this._normalizeTextContent(Ti)}_addToggleButton(xi,{name:Ti=null}){super._addToggleButton(xi,Ti===null)}_toggleAllTreeItems(){this._optionalContentConfig&&super._toggleAllTreeItems()}render({optionalContentConfig:xi,pdfDocument:Ti}){this._optionalContentConfig&&this.reset(),this._optionalContentConfig=xi||null,this._pdfDocument=Ti||null;const Oi=xi==null?void 0:xi.getOrder();if(!Oi){this._dispatchEvent(0);return}const ji=document.createDocumentFragment(),Li=[{parent:ji,groups:Oi}];let Ii=0,Mi=!1;for(;Li.length>0;){const Fi=Li.shift();for(const Bi of Fi.groups){const Ri=document.createElement("div");Ri.className="treeItem";const Vi=document.createElement("a");if(Ri.appendChild(Vi),typeof Bi=="object"){Mi=!0,this._addToggleButton(Ri,Bi),this._setNestedName(Vi,Bi);const Ni=document.createElement("div");Ni.className="treeItems",Ri.appendChild(Ni),Li.push({parent:Ni,groups:Bi.order})}else{const Ni=xi.getGroup(Bi),Wi=document.createElement("input");this._bindLink(Vi,{groupId:Bi,input:Wi}),Wi.type="checkbox",Wi.id=Bi,Wi.checked=Ni.visible;const zi=document.createElement("label");zi.setAttribute("for",Bi),zi.textContent=this._normalizeTextContent(Ni.name),Vi.appendChild(Wi),Vi.appendChild(zi),Ii++}Fi.parent.appendChild(Ri)}}this._finishRendering(ji,Ii,Mi)}async _resetLayers(){if(!this._optionalContentConfig)return;const xi=await this._pdfDocument.getOptionalContentConfig();this.eventBus.dispatch("optionalcontentconfig",{source:this,promise:Promise.resolve(xi)}),this.render({optionalContentConfig:xi,pdfDocument:this._pdfDocument})}}Si.PDFLayerViewer=Ci},(Ai,Si,Ei)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.PDFSidebar=void 0;var wi=Ei(1);const Ci="pdfSidebarNotification";Si.PDFSidebar=class{constructor({elements:ki,pdfViewer:xi,pdfThumbnailViewer:Ti,eventBus:Oi,l10n:ji}){this.isOpen=!1,this.active=wi.SidebarView.THUMBS,this.isInitialViewSet=!1,this.onToggled=null,this.pdfViewer=xi,this.pdfThumbnailViewer=Ti,this.outerContainer=ki.outerContainer,this.viewerContainer=ki.viewerContainer,this.toggleButton=ki.toggleButton,this.thumbnailButton=ki.thumbnailButton,this.outlineButton=ki.outlineButton,this.attachmentsButton=ki.attachmentsButton,this.layersButton=ki.layersButton,this.thumbnailView=ki.thumbnailView,this.outlineView=ki.outlineView,this.attachmentsView=ki.attachmentsView,this.layersView=ki.layersView,this._outlineOptionsContainer=ki.outlineOptionsContainer,this._currentOutlineItemButton=ki.currentOutlineItemButton,this.eventBus=Oi,this.l10n=ji,this._addEventListeners()}reset(){this.isInitialViewSet=!1,this._hideUINotification(!0),this.switchView(wi.SidebarView.THUMBS),this.outlineButton.disabled=!1,this.attachmentsButton.disabled=!1,this.layersButton.disabled=!1,this._currentOutlineItemButton.disabled=!0}get visibleView(){return this.isOpen?this.active:wi.SidebarView.NONE}get isThumbnailViewVisible(){return this.isOpen&&this.active===wi.SidebarView.THUMBS}get isOutlineViewVisible(){return this.isOpen&&this.active===wi.SidebarView.OUTLINE}get isAttachmentsViewVisible(){return this.isOpen&&this.active===wi.SidebarView.ATTACHMENTS}get isLayersViewVisible(){return this.isOpen&&this.active===wi.SidebarView.LAYERS}setInitialView(ki=wi.SidebarView.NONE){this.isInitialViewSet||(this.isInitialViewSet=!0,ki!==wi.SidebarView.NONE&&ki!==wi.SidebarView.UNKNOWN&&this._switchView(ki,!0)||this._dispatchEvent())}switchView(ki,xi=!1){this._switchView(ki,xi)}_switchView(ki,xi=!1){const Ti=ki!==this.active;let Oi=!1;switch(ki){case wi.SidebarView.NONE:return this.isOpen?(this.close(),!0):!1;case wi.SidebarView.THUMBS:this.isOpen&&Ti&&(Oi=!0);break;case wi.SidebarView.OUTLINE:if(this.outlineButton.disabled)return!1;break;case wi.SidebarView.ATTACHMENTS:if(this.attachmentsButton.disabled)return!1;break;case wi.SidebarView.LAYERS:if(this.layersButton.disabled)return!1;break;default:return!1}return this.active=ki,this.thumbnailButton.classList.toggle("toggled",ki===wi.SidebarView.THUMBS),this.outlineButton.classList.toggle("toggled",ki===wi.SidebarView.OUTLINE),this.attachmentsButton.classList.toggle("toggled",ki===wi.SidebarView.ATTACHMENTS),this.layersButton.classList.toggle("toggled",ki===wi.SidebarView.LAYERS),this.thumbnailView.classList.toggle("hidden",ki!==wi.SidebarView.THUMBS),this.outlineView.classList.toggle("hidden",ki!==wi.SidebarView.OUTLINE),this.attachmentsView.classList.toggle("hidden",ki!==wi.SidebarView.ATTACHMENTS),this.layersView.classList.toggle("hidden",ki!==wi.SidebarView.LAYERS),this._outlineOptionsContainer.classList.toggle("hidden",ki!==wi.SidebarView.OUTLINE),xi&&!this.isOpen?(this.open(),!0):(Oi&&(this._updateThumbnailViewer(),this._forceRendering()),Ti&&this._dispatchEvent(),Ti)}open(){this.isOpen||(this.isOpen=!0,this.toggleButton.classList.add("toggled"),this.toggleButton.setAttribute("aria-expanded","true"),this.outerContainer.classList.add("sidebarMoving","sidebarOpen"),this.active===wi.SidebarView.THUMBS&&this._updateThumbnailViewer(),this._forceRendering(),this._dispatchEvent(),this._hideUINotification())}close(){this.isOpen&&(this.isOpen=!1,this.toggleButton.classList.remove("toggled"),this.toggleButton.setAttribute("aria-expanded","false"),this.outerContainer.classList.add("sidebarMoving"),this.outerContainer.classList.remove("sidebarOpen"),this._forceRendering(),this._dispatchEvent())}toggle(){this.isOpen?this.close():this.open()}_dispatchEvent(){this.eventBus.dispatch("sidebarviewchanged",{source:this,view:this.visibleView})}_forceRendering(){this.onToggled?this.onToggled():(this.pdfViewer.forceRendering(),this.pdfThumbnailViewer.forceRendering())}_updateThumbnailViewer(){const{pdfViewer:ki,pdfThumbnailViewer:xi}=this,Ti=ki.pagesCount;for(let Oi=0;Oi{this.toggleButton.title=ki}),this.isOpen||this.toggleButton.classList.add(Ci)}_hideUINotification(ki=!1){(this.isOpen||ki)&&this.toggleButton.classList.remove(Ci),ki&&this.l10n.get("toggle_sidebar.title").then(xi=>{this.toggleButton.title=xi})}_addEventListeners(){this.viewerContainer.addEventListener("transitionend",xi=>{xi.target===this.viewerContainer&&this.outerContainer.classList.remove("sidebarMoving")}),this.toggleButton.addEventListener("click",()=>{this.toggle()}),this.thumbnailButton.addEventListener("click",()=>{this.switchView(wi.SidebarView.THUMBS)}),this.outlineButton.addEventListener("click",()=>{this.switchView(wi.SidebarView.OUTLINE)}),this.outlineButton.addEventListener("dblclick",()=>{this.eventBus.dispatch("toggleoutlinetree",{source:this})}),this.attachmentsButton.addEventListener("click",()=>{this.switchView(wi.SidebarView.ATTACHMENTS)}),this.layersButton.addEventListener("click",()=>{this.switchView(wi.SidebarView.LAYERS)}),this.layersButton.addEventListener("dblclick",()=>{this.eventBus.dispatch("resetlayers",{source:this})}),this._currentOutlineItemButton.addEventListener("click",()=>{this.eventBus.dispatch("currentoutlineitem",{source:this})});const ki=(xi,Ti,Oi)=>{Ti.disabled=!xi,xi?this._showUINotification():this.active===Oi&&this.switchView(wi.SidebarView.THUMBS)};this.eventBus._on("outlineloaded",xi=>{ki(xi.outlineCount,this.outlineButton,wi.SidebarView.OUTLINE),xi.currentOutlineItemPromise.then(Ti=>{this.isInitialViewSet&&(this._currentOutlineItemButton.disabled=!Ti)})}),this.eventBus._on("attachmentsloaded",xi=>{ki(xi.attachmentsCount,this.attachmentsButton,wi.SidebarView.ATTACHMENTS)}),this.eventBus._on("layersloaded",xi=>{ki(xi.layersCount,this.layersButton,wi.SidebarView.LAYERS)}),this.eventBus._on("presentationmodechanged",xi=>{xi.state===wi.PresentationModeState.NORMAL&&this.isThumbnailViewVisible&&this._updateThumbnailViewer()})}}},(Ai,Si)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.PDFSidebarResizer=void 0;const Ei="sidebarResizing";Si.PDFSidebarResizer=class{constructor(wi,Ci,ki){this.isRTL=!1,this.sidebarOpen=!1,this.doc=document.documentElement,this._width=null,this._outerContainerWidth=null,this._boundEvents=Object.create(null),this.outerContainer=wi.outerContainer,this.resizer=wi.resizer,this.eventBus=Ci,ki.getDirection().then(xi=>{this.isRTL=xi==="rtl"}),this._addEventListeners()}get outerContainerWidth(){return this._outerContainerWidth||(this._outerContainerWidth=this.outerContainer.clientWidth)}_updateWidth(wi=0){const Ci=Math.floor(this.outerContainerWidth/2);return wi>Ci&&(wi=Ci),wi<200&&(wi=200),wi===this._width?!1:(this._width=wi,this.doc.style.setProperty("--sidebar-width",`${wi}px`),!0)}_mouseMove(wi){let Ci=wi.clientX;this.isRTL&&(Ci=this.outerContainerWidth-Ci),this._updateWidth(Ci)}_mouseUp(wi){this.outerContainer.classList.remove(Ei),this.eventBus.dispatch("resize",{source:this});const Ci=this._boundEvents;window.removeEventListener("mousemove",Ci.mouseMove),window.removeEventListener("mouseup",Ci.mouseUp)}_addEventListeners(){const wi=this._boundEvents;wi.mouseMove=this._mouseMove.bind(this),wi.mouseUp=this._mouseUp.bind(this),this.resizer.addEventListener("mousedown",Ci=>{Ci.button===0&&(this.outerContainer.classList.add(Ei),window.addEventListener("mousemove",wi.mouseMove),window.addEventListener("mouseup",wi.mouseUp))}),this.eventBus._on("sidebarviewchanged",Ci=>{this.sidebarOpen=!!(Ci!=null&&Ci.view)}),this.eventBus._on("resize",Ci=>{if((Ci==null?void 0:Ci.source)!==window||(this._outerContainerWidth=null,!this._width))return;if(!this.sidebarOpen){this._updateWidth(this._width);return}this.outerContainer.classList.add(Ei);const ki=this._updateWidth(this._width);Promise.resolve().then(()=>{this.outerContainer.classList.remove(Ei),ki&&this.eventBus.dispatch("resize",{source:this})})})}}},(Ai,Si)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.ViewHistory=void 0,Si.ViewHistory=class{constructor(Ei,wi=20){this.fingerprint=Ei,this.cacheSize=wi,this._initializedPromise=this._readFromStorage().then(Ci=>{const ki=JSON.parse(Ci||"{}");let xi=-1;if(Array.isArray(ki.files)){for(;ki.files.length>=this.cacheSize;)ki.files.shift();for(let Ti=0,Oi=ki.files.length;Ti{Object.defineProperty(Si,"__esModule",{value:!0}),Si.DefaultExternalServices=void 0;var wi=Ei(6);Si.DefaultExternalServices=class{constructor(){throw new Error("Cannot initialize DefaultExternalServices.")}static updateFindControlState(Ci){}static updateFindMatchesCount(Ci){}static initPassiveLoading(Ci){}static async fallback(Ci){}static reportTelemetry(Ci){}static createDownloadManager(Ci){throw new Error("Not implemented: createDownloadManager")}static createPreferences(){throw new Error("Not implemented: createPreferences")}static createL10n(Ci){throw new Error("Not implemented: createL10n")}static createScripting(Ci){throw new Error("Not implemented: createScripting")}static get supportsIntegratedFind(){return(0,wi.shadow)(this,"supportsIntegratedFind",!1)}static get supportsDocumentFonts(){return(0,wi.shadow)(this,"supportsDocumentFonts",!0)}static get supportedMouseWheelZoomModifierKeys(){return(0,wi.shadow)(this,"supportedMouseWheelZoomModifierKeys",{ctrlKey:!0,metaKey:!0})}static get isInAutomation(){return(0,wi.shadow)(this,"isInAutomation",!1)}}},(Ai,Si,Ei)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.bindPrintServiceFactory=Si.bindExternalService=void 0;let wi,Ci;Si.bindPrintServiceFactory=wi,Si.bindExternalService=Ci,Si.bindExternalService=Ci=Ei(43).bindExternalService,Si.bindPrintServiceFactory=wi=Ei(49).bindPrintServiceFactory,document.blockUnblockOnload&&document.blockUnblockOnload(!0)},(Ai,Si,Ei)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.GenericCom=void 0,Si.bindExternalService=function(Li){Li.externalServices=ji};var wi=Ei(41),Ci=Ei(44),ki=Ei(45),xi=Ei(46),Ti=Ei(48);Si.GenericCom={};class Oi extends Ci.BasePreferences{async _writeToStorage(Ii){localStorage.setItem("pdfjs.preferences",JSON.stringify(Ii))}async _readFromStorage(Ii){return JSON.parse(localStorage.getItem("pdfjs.preferences"))}}class ji extends wi.DefaultExternalServices{static createDownloadManager(Ii){return new ki.DownloadManager}static createPreferences(){return new Oi}static createL10n({locale:Ii="en-US"}){return new xi.GenericL10n(Ii)}static createScripting({sandboxBundleSrc:Ii}){return new Ti.GenericScripting(Ii)}}},(Ai,Si,Ei)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.BasePreferences=void 0,Ei(3);class wi{constructor(){if(this.constructor===wi)throw new Error("Cannot initialize BasePreferences.");Object.defineProperty(this,"defaults",{value:Object.freeze({annotationMode:2,cursorToolOnLoad:0,defaultZoomValue:"",disablePageLabels:!1,enablePermissions:!1,enablePrintAutoRotate:!0,enableScripting:!0,externalLinkTarget:0,historyUpdateUrl:!1,ignoreDestinationZoom:!1,pdfBugEnabled:!1,renderer:"canvas",sidebarViewOnLoad:-1,scrollModeOnLoad:-1,spreadModeOnLoad:-1,textLayerMode:1,useOnlyCssZoom:!1,viewerCssTheme:0,viewOnLoad:0,disableAutoFetch:!1,disableFontFace:!1,disableRange:!1,disableStream:!1,enableXfa:!0}),writable:!1,enumerable:!0,configurable:!1}),this.prefs=Object.create(null),this._initializedPromise=this._readFromStorage(this.defaults).then(ki=>{for(const xi in this.defaults){const Ti=ki==null?void 0:ki[xi];typeof Ti==typeof this.defaults[xi]&&(this.prefs[xi]=Ti)}})}async _writeToStorage(ki){throw new Error("Not implemented: _writeToStorage")}async _readFromStorage(ki){throw new Error("Not implemented: _readFromStorage")}async reset(){return await this._initializedPromise,this.prefs=Object.create(null),this._writeToStorage(this.defaults)}async set(ki,xi){await this._initializedPromise;const Ti=this.defaults[ki];if(Ti===void 0)throw new Error(`Set preference: "${ki}" is undefined.`);if(xi===void 0)throw new Error("Set preference: no value is specified.");const Oi=typeof xi,ji=typeof Ti;if(Oi!==ji){if(Oi!=="number"||ji!=="string")throw new Error(`Set preference: "${xi}" is a ${Oi}, expected a ${ji}.`);xi=xi.toString()}else if(Oi==="number"&&!Number.isInteger(xi))throw new Error(`Set preference: "${xi}" must be an integer.`);return this.prefs[ki]=xi,this._writeToStorage(this.prefs)}async get(ki){await this._initializedPromise;const xi=this.defaults[ki],Ti=this.prefs[ki];if(xi===void 0)throw new Error(`Get preference: "${ki}" is undefined.`);return Ti!==void 0?Ti:xi}async getAll(){await this._initializedPromise;const ki=Object.create(null);for(const xi in this.defaults){const Ti=this.prefs[xi];ki[xi]=Ti!==void 0?Ti:this.defaults[xi]}return ki}}Si.BasePreferences=wi},(Ai,Si,Ei)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.DownloadManager=void 0;var wi=Ei(6);function Ci(ki,xi){const Ti=document.createElement("a");if(!Ti.click)throw new Error('DownloadManager: "a.click()" is not supported.');Ti.href=ki,Ti.target="_parent","download"in Ti&&(Ti.download=xi),(document.body||document.documentElement).appendChild(Ti),Ti.click(),Ti.remove()}Si.DownloadManager=class{constructor(){this._openBlobUrls=new WeakMap}downloadUrl(ki,xi){(0,wi.createValidAbsoluteUrl)(ki,"http://example.com")&&Ci(ki+"#pdfjs.action=download",xi)}downloadData(ki,xi,Ti){Ci(URL.createObjectURL(new Blob([ki],{type:Ti})),xi)}openOrDownloadData(ki,xi,Ti){const Oi=(0,wi.isPdfFile)(Ti),ji=Oi?"application/pdf":"";if(Oi){let Li,Ii=this._openBlobUrls.get(ki);Ii||(Ii=URL.createObjectURL(new Blob([xi],{type:ji})),this._openBlobUrls.set(ki,Ii)),Li="?file="+encodeURIComponent(Ii+"#"+Ti);try{return window.open(Li),!0}catch{URL.revokeObjectURL(Ii),this._openBlobUrls.delete(ki)}}return this.downloadData(xi,Ti,ji),!1}download(ki,xi,Ti,Oi="download"){Ci(URL.createObjectURL(ki),Ti)}}},(Ai,Si,Ei)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.GenericL10n=void 0,Ei(47);var wi=Ei(18);const Ci=document.webL10n;Si.GenericL10n=class{constructor(ki){this._lang=ki,this._ready=new Promise((xi,Ti)=>{Ci.setLanguage((0,wi.fixupLangCode)(ki),()=>{xi(Ci)})})}async getLanguage(){return(await this._ready).getLanguage()}async getDirection(){return(await this._ready).getDirection()}async get(ki,xi=null,Ti=(0,wi.getL10nFallback)(ki,xi)){return(await this._ready).get(ki,xi,Ti)}async translate(ki){return(await this._ready).translate(ki)}}},()=>{document.webL10n=function(Ai,Si,Ei){var wi={},Ci="",ki="textContent",xi="",Ti={},Oi="loading";function ji(Vi,Ni,Wi){Ni=Ni||function(Di){},Wi=Wi||function(){};var zi=new XMLHttpRequest;zi.open("GET",Vi,!0),zi.overrideMimeType&&zi.overrideMimeType("text/plain; charset=utf-8"),zi.onreadystatechange=function(){zi.readyState==4&&(zi.status==200||zi.status===0?Ni(zi.responseText):Wi())},zi.onerror=Wi,zi.ontimeout=Wi;try{zi.send(null)}catch{Wi()}}function Li(Vi,Ni,Wi,zi){var Di=Vi.replace(/[^\/]*$/,"")||"./";function Ui(Hi){return Hi.lastIndexOf("\\")<0?Hi:Hi.replace(/\\\\/g,"\\").replace(/\\n/g,` `).replace(/\\r/g,"\r").replace(/\\t/g," ").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\{/g,"{").replace(/\\}/g,"}").replace(/\\"/g,'"').replace(/\\'/g,"'")}ji(Vi,function(Hi){Ci+=Hi,function(qi,Gi){var Ki={},Qi=/^\s*|\s*$/,Xi=/^\s*#|^\s*$/,rr=/^\s*\[(.*)\]\s*$/,ar=/^\s*@import\s+url\((.*)\)\s*$/i,gr=/^([^=\s]*)\s*=\s*(.+)$/;function fr(mr,vr,Yi){var nr=mr.replace(Qi,"").split(/[\r\n]+/),ir="*",cr=Ni.split("-",1)[0],tr=!1,dr="";(function Ji(){for(;;){if(!nr.length){Yi();return}var sr=nr.shift();if(!Xi.test(sr)){if(vr){if(dr=rr.exec(sr)){ir=dr[1].toLowerCase(),tr=ir!=="*"&&ir!==Ni&&ir!==cr;continue}if(tr)continue;if(dr=ar.exec(sr)){lr(Di+dr[1],Ji);return}}var pr=sr.match(gr);pr&&pr.length==3&&(Ki[pr[1]]=Ui(pr[2]))}}})()}function lr(mr,vr){ji(mr,function(Yi){fr(Yi,!1,vr)},function(){vr()})}fr(qi,!0,function(){Gi(Ki)})}(Hi,function(qi){for(var Gi in qi){var Ki,Qi,Xi=Gi.lastIndexOf(".");Xi>0?(Ki=Gi.substring(0,Xi),Qi=Gi.substring(Xi+1)):(Ki=Gi,Qi=ki),wi[Ki]||(wi[Ki]={}),wi[Ki][Qi]=qi[Gi]}Wi&&Wi()})},zi)}function Ii(Vi,Ni){Vi&&(Vi=Vi.toLowerCase()),Ni=Ni||function(){},function(){wi={},Ci="",xi=""}(),xi=Vi;var Wi=Si.querySelectorAll('link[type="application/l10n"]'),zi=Wi.length;if(zi!==0){var Di,Ui,Hi=0;Ui=function(){++Hi>=zi&&(Ni(),Oi="complete")};for(var qi=0;qi0&&(Ui=Vi.substring(Di+1),Vi=Vi.substring(0,Di)),Wi&&((zi={})[Ui]=Wi);var Hi=Mi(Vi,Ni,zi);return Hi&&Ui in Hi?Hi[Ui]:"{{"+Vi+"}}"},getData:function(){return wi},getText:function(){return Ci},getLanguage:function(){return xi},setLanguage:function(Vi,Ni){Ii(Vi,function(){Ni&&Ni()})},getDirection:function(){var Vi=xi.split("-",1)[0];return["ar","he","fa","ps","ur"].indexOf(Vi)>=0?"rtl":"ltr"},translate:function(Vi){for(var Ni=function(Di){return Di?Di.querySelectorAll("*[data-l10n-id]"):[]}(Vi=Vi||Si.documentElement),Wi=Ni.length,zi=0;zi{Object.defineProperty(Si,"__esModule",{value:!0}),Si.GenericScripting=void 0,Si.docPropertiesLookup=async function(Ci){const ki="".split("#")[0];let{info:xi,metadata:Ti,contentDispositionFilename:Oi,contentLength:ji}=await Ci.getMetadata();if(!ji){const{length:Li}=await Ci.getDownloadInfo();ji=Li}return{...xi,baseURL:ki,filesize:ji,filename:Oi||(0,wi.getPdfFilenameFromUrl)(""),metadata:Ti==null?void 0:Ti.getRaw(),authors:Ti==null?void 0:Ti.get("dc:creator"),numPages:Ci.numPages,URL:""}};var wi=Ei(6);Si.GenericScripting=class{constructor(Ci){this._ready=(0,wi.loadScript)(Ci,!0,!0).then(()=>window.pdfjsSandbox.QuickJSSandbox())}async createSandbox(Ci){(await this._ready).create(Ci)}async dispatchEventInSandbox(Ci){const ki=await this._ready;setTimeout(()=>ki.dispatchEvent(Ci),0)}async destroySandbox(){(await this._ready).nukeSandbox()}}},(Ai,Si,Ei)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.PDFPrintService=ji,Si.bindPrintServiceFactory=function(Vi){Vi.instance={supportsPrinting:!0,createPrintService(Ni,Wi,zi,Di,Ui,Hi,qi){if(Ti)throw new Error("The print service is created and active.");return Ti=new ji(Ni,Wi,zi,Di,Ui,Hi,qi),Ti}}};var wi=Ei(6),Ci=Ei(3),ki=Ei(50),xi=Ei(4);let Ti=null,Oi=null;function ji(Vi,Ni,Wi,zi,Di=null,Ui,Hi){this.pdfDocument=Vi,this.pagesOverview=Ni,this.printContainer=Wi,this.printServiceOverlay=Hi,this._printResolution=zi||150,this._optionalContentConfigPromise=Di||Vi.getOptionalContentConfig(),this.l10n=Ui,this.currentPage=-1,this.scratchCanvas=document.createElement("canvas")}ji.prototype={layout(){this.throwIfInactive();const Vi=document.querySelector("body");Vi.setAttribute("data-pdfjsprinting",!0),this.pagesOverview.every(function(Wi){return Wi.width===this.pagesOverview[0].width&&Wi.height===this.pagesOverview[0].height},this),this.pageStyleSheet=document.createElement("style");const Ni=this.pagesOverview[0];this.pageStyleSheet.textContent="@page { size: "+Ni.width+"pt "+Ni.height+"pt;}",Vi.appendChild(this.pageStyleSheet)},destroy(){Ti===this&&(this.printContainer.textContent="",document.querySelector("body").removeAttribute("data-pdfjsprinting"),this.pageStyleSheet&&(this.pageStyleSheet.remove(),this.pageStyleSheet=null),this.scratchCanvas.width=this.scratchCanvas.height=0,this.scratchCanvas=null,Ti=null,Ri().then(function(){Oi.active==="printServiceOverlay"&&Oi.close("printServiceOverlay")}))},renderPages(){if(this.pdfDocument.isPureXfa)return(0,ki.getXfaHtmlForPrinting)(this.printContainer,this.pdfDocument),Promise.resolve();const Vi=this.pagesOverview.length,Ni=(Wi,zi)=>{if(this.throwIfInactive(),++this.currentPage>=Vi){Fi(Vi,Vi,this.l10n,this.printServiceOverlay),Wi();return}const Di=this.currentPage;Fi(Di,Vi,this.l10n,this.printServiceOverlay),function(Ui,Hi,qi,Gi,Ki,Qi){const Xi=Ti.scratchCanvas,rr=Ki/wi.PixelsPerInch.PDF;Xi.width=Math.floor(Gi.width*rr),Xi.height=Math.floor(Gi.height*rr);const ar=Xi.getContext("2d");return ar.save(),ar.fillStyle="rgb(255, 255, 255)",ar.fillRect(0,0,Xi.width,Xi.height),ar.restore(),Hi.getPage(qi).then(function(gr){const fr={canvasContext:ar,transform:[rr,0,0,rr,0,0],viewport:gr.getViewport({scale:1,rotation:Gi.rotation}),intent:"print",annotationMode:wi.AnnotationMode.ENABLE_STORAGE,optionalContentConfigPromise:Qi};return gr.render(fr).promise})}(0,this.pdfDocument,Di+1,this.pagesOverview[Di],this._printResolution,this._optionalContentConfigPromise).then(this.useRenderedPage.bind(this)).then(function(){Ni(Wi,zi)},zi)};return new Promise(Ni)},useRenderedPage(){this.throwIfInactive();const Vi=document.createElement("img"),Ni=this.scratchCanvas;"toBlob"in Ni&&!Ci.compatibilityParams.disableCreateObjectURL?Ni.toBlob(function(zi){Vi.src=URL.createObjectURL(zi)}):Vi.src=Ni.toDataURL();const Wi=document.createElement("div");return Wi.className="printedPage",Wi.appendChild(Vi),this.printContainer.appendChild(Wi),new Promise(function(zi,Di){Vi.onload=zi,Vi.onerror=Di})},performPrint(){return this.throwIfInactive(),new Promise(Vi=>{setTimeout(()=>{this.active?(Li.call(window),setTimeout(Vi,20)):Vi()},0)})},get active(){return this===Ti},throwIfInactive(){if(!this.active)throw new Error("This print request was cancelled or completed.")}};const Li=window.print;window.print=function(){if(!Ti){Ri().then(function(){Ti&&Oi.open("printServiceOverlay")});try{Ii("beforeprint")}finally{if(!Ti){Ri().then(function(){Oi.active==="printServiceOverlay"&&Oi.close("printServiceOverlay")});return}const Vi=Ti;Ti.renderPages().then(function(){return Vi.performPrint()}).catch(function(){}).then(function(){Vi.active&&Mi()})}}};function Ii(Vi){const Ni=document.createEvent("CustomEvent");Ni.initCustomEvent(Vi,!1,!1,"custom"),window.dispatchEvent(Ni)}function Mi(){Ti&&(Ti.destroy(),Ii("afterprint"))}function Fi(Vi,Ni,Wi,zi){const Di=Math.round(100*Vi/Ni),Ui=zi.querySelector("progress"),Hi=zi.querySelector(".relative-progress");Ui.value=Di,Wi.get("print_progress_percent",{progress:Di}).then(qi=>{Hi.textContent=qi})}if(window.addEventListener("keydown",function(Vi){Vi.keyCode===80&&(Vi.ctrlKey||Vi.metaKey)&&!Vi.altKey&&(!Vi.shiftKey||window.chrome||window.opera)&&(window.print(),Vi.preventDefault(),Vi.stopImmediatePropagation?Vi.stopImmediatePropagation():Vi.stopPropagation())},!0),"onbeforeprint"in window){const Vi=function(Ni){Ni.detail!=="custom"&&Ni.stopImmediatePropagation&&Ni.stopImmediatePropagation()};window.addEventListener("beforeprint",Vi),window.addEventListener("afterprint",Vi)}let Bi;function Ri(){if(!Bi){const Vi=(0,xi.getActiveApp)(),Ni=Vi.appConfig.printServiceOverlay;if(Oi=Vi.overlayManager,!Oi)throw new Error("The overlay manager has not yet been initialized.");Bi=Oi.register("printServiceOverlay",Ni,Mi,!0),Ni.querySelector("[data-id='printCancel']").onclick=Mi}return Bi}},(Ai,Si,Ei)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.getXfaHtmlForPrinting=function(xi,Ti){const Oi=Ti.allXfaHtml,ji=new Ci.SimpleLinkService,Li=Math.round(100*wi.PixelsPerInch.PDF_TO_CSS_UNITS)/100;for(const Ii of Oi.children){const Mi=document.createElement("div");Mi.className="xfaPrintedPage",xi.appendChild(Mi);const Fi=new ki.XfaLayerBuilder({pageDiv:Mi,pdfPage:null,annotationStorage:Ti.annotationStorage,linkService:ji,xfaHtml:Ii}),Bi=(0,wi.getXfaPageViewport)(Ii,{scale:Li});Fi.render(Bi,"print")}};var wi=Ei(6),Ci=Ei(7),ki=Ei(24)},(Ai,Si)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.default=void 0,Si.default=`
Current View
`}],_i={};function $i(Ai){var Si=_i[Ai];if(Si!==void 0)return Si.exports;var Ei=_i[Ai]={exports:{}};return bi[Ai](Ei,Ei.exports,$i),Ei.exports}var Pi={};return(()=>{var Ai=Pi;Object.defineProperty(Ai,"__esModule",{value:!0}),Object.defineProperty(Ai,"AnnotationLayerBuilder",{enumerable:!0,get:function(){return Ti.AnnotationLayerBuilder}}),Object.defineProperty(Ai,"EventBus",{enumerable:!0,get:function(){return wi.EventBus}}),Object.defineProperty(Ai,"GlobalAppOptions",{enumerable:!0,get:function(){return Ci.AppOptions}}),Object.defineProperty(Ai,"MAX_SCALE",{enumerable:!0,get:function(){return Ei.MAX_SCALE}}),Object.defineProperty(Ai,"MIN_SCALE",{enumerable:!0,get:function(){return Ei.MIN_SCALE}}),Object.defineProperty(Ai,"NullL10n",{enumerable:!0,get:function(){return ji.NullL10n}}),Object.defineProperty(Ai,"PDFViewer",{enumerable:!0,get:function(){return xi.PDFViewer}}),Object.defineProperty(Ai,"ViewerApplication",{enumerable:!0,get:function(){return Oi.ViewerApplication}}),Ai.appManager=void 0,Ai.getViewerConfiguration=function(Mi){let Fi=null;const Bi=Mi.querySelector("[data-id='outerContainer']");return Fi={container:Bi.querySelector("[data-id='errorWrapper']"),errorMessage:Bi.querySelector("[data-id='errorMessage']"),closeButton:Bi.querySelector("[data-id='errorClose']"),errorMoreInfo:Bi.querySelector("[data-id='errorMoreInfo']"),moreInfoButton:Bi.querySelector("[data-id='errorShowMore']"),lessInfoButton:Bi.querySelector("[data-id='errorShowLess']")},{appContainer:Mi,mainContainer:Bi.querySelector("[data-id='viewerContainer']"),viewerContainer:Bi.querySelector("[data-id='viewer']"),toolbar:{container:Bi.querySelector("[data-id='toolbarViewer']"),numPages:Bi.querySelector("[data-id='numPages']"),pageNumber:Bi.querySelector("[data-id='pageNumber']"),scaleSelect:Bi.querySelector("[data-id='scaleSelect']"),customScaleOption:Bi.querySelector("[data-id='customScaleOption']"),previous:Bi.querySelector("[data-id='previous']"),next:Bi.querySelector("[data-id='next']"),zoomIn:Bi.querySelector("[data-id='zoomIn']"),zoomOut:Bi.querySelector("[data-id='zoomOut']"),viewFind:Bi.querySelector("[data-id='viewFind']"),openFile:Bi.querySelector("[data-id='openFile']"),print:Bi.querySelector("[data-id='print']"),presentationModeButton:Bi.querySelector("[data-id='presentationMode']"),download:Bi.querySelector("[data-id='download']"),viewBookmark:Bi.querySelector("[data-id='viewBookmark']")},secondaryToolbar:{toolbar:Bi.querySelector("[data-id='secondaryToolbar']"),toggleButton:Bi.querySelector("[data-id='secondaryToolbarToggle']"),toolbarButtonContainer:Bi.querySelector("[data-id='secondaryToolbarButtonContainer']"),presentationModeButton:Bi.querySelector("[data-id='secondaryPresentationMode']"),openFileButton:Bi.querySelector("[data-id='secondaryOpenFile']"),printButton:Bi.querySelector("[data-id='secondaryPrint']"),downloadButton:Bi.querySelector("[data-id='secondaryDownload']"),viewBookmarkButton:Bi.querySelector("[data-id='secondaryViewBookmark']"),firstPageButton:Bi.querySelector("[data-id='firstPage']"),lastPageButton:Bi.querySelector("[data-id='lastPage']"),pageRotateCwButton:Bi.querySelector("[data-id='pageRotateCw']"),pageRotateCcwButton:Bi.querySelector("[data-id='pageRotateCcw']"),cursorSelectToolButton:Bi.querySelector("[data-id='cursorSelectTool']"),cursorHandToolButton:Bi.querySelector("[data-id='cursorHandTool']"),scrollPageButton:Bi.querySelector("[data-id='scrollPage']"),scrollVerticalButton:Bi.querySelector("[data-id='scrollVertical']"),scrollHorizontalButton:Bi.querySelector("[data-id='scrollHorizontal']"),scrollWrappedButton:Bi.querySelector("[data-id='scrollWrapped']"),spreadNoneButton:Bi.querySelector("[data-id='spreadNone']"),spreadOddButton:Bi.querySelector("[data-id='spreadOdd']"),spreadEvenButton:Bi.querySelector("[data-id='spreadEven']"),documentPropertiesButton:Bi.querySelector("[data-id='documentProperties']")},sidebar:{outerContainer:Bi,viewerContainer:Bi.querySelector("[data-id='viewerContainer']"),toggleButton:Bi.querySelector("[data-id='sidebarToggle']"),thumbnailButton:Bi.querySelector("[data-id='viewThumbnail']"),outlineButton:Bi.querySelector("[data-id='viewOutline']"),attachmentsButton:Bi.querySelector("[data-id='viewAttachments']"),layersButton:Bi.querySelector("[data-id='viewLayers']"),thumbnailView:Bi.querySelector("[data-id='thumbnailView']"),outlineView:Bi.querySelector("[data-id='outlineView']"),attachmentsView:Bi.querySelector("[data-id='attachmentsView']"),layersView:Bi.querySelector("[data-id='layersView']"),outlineOptionsContainer:Bi.querySelector("[data-id='outlineOptionsContainer']"),currentOutlineItemButton:Bi.querySelector("[data-id='currentOutlineItem']")},sidebarResizer:{outerContainer:Bi,resizer:Bi.querySelector("[data-id='sidebarResizer']")},findBar:{bar:Bi.querySelector("[data-id='findbar']"),toggleButton:Bi.querySelector("[data-id='viewFind']"),findField:Bi.querySelector("[data-id='findInput']"),highlightAllCheckbox:Bi.querySelector("[data-id='findHighlightAll']"),caseSensitiveCheckbox:Bi.querySelector("[data-id='findMatchCase']"),matchDiacriticsCheckbox:Bi.querySelector("[data-id='findMatchDiacritics']"),entireWordCheckbox:Bi.querySelector("[data-id='findEntireWord']"),findMsg:Bi.querySelector("[data-id='findMsg']"),findResultsCount:Bi.querySelector("[data-id='findResultsCount']"),findPreviousButton:Bi.querySelector("[data-id='findPrevious']"),findNextButton:Bi.querySelector("[data-id='findNext']")},passwordOverlay:{overlayName:"passwordOverlay",container:Bi.querySelector("[data-id='passwordOverlay']"),label:Bi.querySelector("[data-id='passwordText']"),input:Bi.querySelector("[data-id='password']"),submitButton:Bi.querySelector("[data-id='passwordSubmit']"),cancelButton:Bi.querySelector("[data-id='passwordCancel']")},documentProperties:{overlayName:"documentPropertiesOverlay",container:Bi.querySelector("[data-id='documentPropertiesOverlay']"),closeButton:Bi.querySelector("[data-id='documentPropertiesClose']"),fields:{fileName:Bi.querySelector("[data-id='fileNameField']"),fileSize:Bi.querySelector("[data-id='fileSizeField']"),title:Bi.querySelector("[data-id='titleField']"),author:Bi.querySelector("[data-id='authorField']"),subject:Bi.querySelector("[data-id='subjectField']"),keywords:Bi.querySelector("[data-id='keywordsField']"),creationDate:Bi.querySelector("[data-id='creationDateField']"),modificationDate:Bi.querySelector("[data-id='modificationDateField']"),creator:Bi.querySelector("[data-id='creatorField']"),producer:Bi.querySelector("[data-id='producerField']"),version:Bi.querySelector("[data-id='versionField']"),pageCount:Bi.querySelector("[data-id='pageCountField']"),pageSize:Bi.querySelector("[data-id='pageSizeField']"),linearized:Bi.querySelector("[data-id='linearizedField']")}},errorWrapper:Fi,printContainer:Bi.parentElement.querySelector("[data-id='printContainer']"),printServiceOverlay:Bi.querySelector("[data-id='printServiceOverlay']"),openFileInputName:"fileInput",debuggerScriptPath:"./debugger.js"}},Object.defineProperty(Ai,"viewerTemplate",{enumerable:!0,get:function(){return Li.default}});var Si,Ei=$i(1),wi=$i(2),Ci=$i(3),ki=$i(4),xi=$i(15),Ti=$i(17),Oi=$i(5),ji=$i(18),Li=(Si=$i(51))&&Si.__esModule?Si:{default:Si};const Ii=(0,ki.initManager)(["mousemove","click","mousedown","touchstart"]);Ai.appManager=Ii,document.blockUnblockOnload&&document.blockUnblockOnload(!0)})(),Pi})())})(component_viewer);function _defineProperty(yi,vi,bi){return vi=_toPropertyKey(vi),vi in yi?Object.defineProperty(yi,vi,{value:bi,enumerable:!0,configurable:!0,writable:!0}):yi[vi]=bi,yi}function _getPrototypeOf(yi){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(bi){return bi.__proto__||Object.getPrototypeOf(bi)},_getPrototypeOf(yi)}function _superPropBase(yi,vi){for(;!Object.prototype.hasOwnProperty.call(yi,vi)&&(yi=_getPrototypeOf(yi),yi!==null););return yi}function _get(){return typeof Reflect<"u"&&Reflect.get?_get=Reflect.get.bind():_get=function(vi,bi,_i){var $i=_superPropBase(vi,bi);if($i){var Pi=Object.getOwnPropertyDescriptor($i,bi);return Pi.get?Pi.get.call(arguments.length<3?vi:_i):Pi.value}},_get.apply(this,arguments)}function _toPrimitive(yi,vi){if(typeof yi!="object"||yi===null)return yi;var bi=yi[Symbol.toPrimitive];if(bi!==void 0){var _i=bi.call(yi,vi||"default");if(typeof _i!="object")return _i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(vi==="string"?String:Number)(yi)}function _toPropertyKey(yi){var vi=_toPrimitive(yi,"string");return typeof vi=="symbol"?vi:String(vi)}function _classPrivateFieldGet(yi,vi){var bi=_classExtractFieldDescriptor(yi,vi,"get");return _classApplyDescriptorGet(yi,bi)}function _classPrivateFieldSet(yi,vi,bi){var _i=_classExtractFieldDescriptor(yi,vi,"set");return _classApplyDescriptorSet(yi,_i,bi),bi}function _classExtractFieldDescriptor(yi,vi,bi){if(!vi.has(yi))throw new TypeError("attempted to "+bi+" private field on non-instance");return vi.get(yi)}function _classApplyDescriptorGet(yi,vi){return vi.get?vi.get.call(yi):vi.value}function _classApplyDescriptorSet(yi,vi,bi){if(vi.set)vi.set.call(yi,bi);else{if(!vi.writable)throw new TypeError("attempted to set read only private field");vi.value=bi}}function _classPrivateMethodGet(yi,vi,bi){if(!vi.has(yi))throw new TypeError("attempted to get private field on non-instance");return bi}function _checkPrivateRedeclaration(yi,vi){if(vi.has(yi))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldInitSpec(yi,vi,bi){_checkPrivateRedeclaration(yi,vi),vi.set(yi,bi)}function _classPrivateMethodInitSpec(yi,vi){_checkPrivateRedeclaration(yi,vi),vi.add(yi)}var NATIVE_BIND$1=functionBindNative,FunctionPrototype=Function.prototype,apply$1=FunctionPrototype.apply,call$5=FunctionPrototype.call,functionApply=typeof Reflect=="object"&&Reflect.apply||(NATIVE_BIND$1?call$5.bind(apply$1):function(){return call$5.apply(apply$1,arguments)}),uncurryThis$3=functionUncurryThis,arraySlice$1=uncurryThis$3([].slice),classof$3=classofRaw$2,isArray$4=Array.isArray||function yi(vi){return classof$3(vi)=="Array"},classof$2=classof$7,$String$1=String,toString$1=function(yi){if(classof$2(yi)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return $String$1(yi)},uncurryThis$2=functionUncurryThis,isArray$3=isArray$4,isCallable$2=isCallable$h,classof$1=classofRaw$2,toString=toString$1,push=uncurryThis$2([].push),getJsonReplacerFunction=function(yi){if(isCallable$2(yi))return yi;if(isArray$3(yi)){for(var vi=yi.length,bi=[],_i=0;_i-1}var _arrayIncludes=arrayIncludes$1;function arrayIncludesWith$1(yi,vi,bi){for(var _i=-1,$i=yi==null?0:yi.length;++_i<$i;)if(bi(vi,yi[_i]))return!0;return!1}var _arrayIncludesWith=arrayIncludesWith$1;function noop$2(){}var noop_1=noop$2,Set$1=_Set,noop$1=noop_1,setToArray$1=_setToArray,INFINITY=1/0,createSet$1=Set$1&&1/setToArray$1(new Set$1([,-0]))[1]==INFINITY?function(yi){return new Set$1(yi)}:noop$1,_createSet=createSet$1,SetCache=_SetCache,arrayIncludes=_arrayIncludes,arrayIncludesWith=_arrayIncludesWith,cacheHas=_cacheHas,createSet=_createSet,setToArray=_setToArray,LARGE_ARRAY_SIZE=200;function baseUniq$1(yi,vi,bi){var _i=-1,$i=arrayIncludes,Pi=yi.length,Ai=!0,Si=[],Ei=Si;if(bi)Ai=!1,$i=arrayIncludesWith;else if(Pi>=LARGE_ARRAY_SIZE){var wi=vi?null:createSet(yi);if(wi)return setToArray(wi);Ai=!1,$i=cacheHas,Ei=new SetCache}else Ei=vi?[]:Si;e:for(;++_i(()=>{var bi=[,(Ai,Si,Ei)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.VerbosityLevel=Si.Util=Si.UnknownErrorException=Si.UnexpectedResponseException=Si.UNSUPPORTED_FEATURES=Si.TextRenderingMode=Si.StreamType=Si.RenderingIntentFlag=Si.PermissionFlag=Si.PasswordResponses=Si.PasswordException=Si.PageActionEventType=Si.OPS=Si.MissingPDFException=Si.IsLittleEndianCached=Si.IsEvalSupportedCached=Si.InvalidPDFException=Si.ImageKind=Si.IDENTITY_MATRIX=Si.FormatError=Si.FontType=Si.FONT_IDENTITY_MATRIX=Si.DocumentActionEventType=Si.CMapCompressionType=Si.BaseException=Si.AnnotationType=Si.AnnotationStateModelType=Si.AnnotationReviewState=Si.AnnotationReplyType=Si.AnnotationMode=Si.AnnotationMarkedState=Si.AnnotationFlag=Si.AnnotationFieldFlag=Si.AnnotationBorderStyleType=Si.AnnotationActionEventType=Si.AbortException=void 0,Si.addParamsToUrl=os,Si.arrayByteLength=_r,Si.arraysToBytes=$r,Si.assert=vr,Si.bytesToString=hr,Si.createPromiseCapability=as,Si.createValidAbsoluteUrl=ir,Si.escapeString=zr,Si.getModificationDate=ss,Si.getVerbosityLevel=gr,Si.info=fr,Si.isArrayBuffer=is,Si.isArrayEqual=rs,Si.isAscii=jr,Si.isSameOrigin=Yi,Si.objectFromMap=Tr,Si.objectSize=Sr,Si.setVerbosityLevel=ar,Si.shadow=cr,Si.string32=Pr,Si.stringToBytes=ur,Si.stringToPDFString=Br,Si.stringToUTF16BEString=Gr,Si.stringToUTF8String=Xr,Si.unreachable=mr,Si.utf8StringToString=ns,Si.warn=lr,Ei(2);const wi=[1,0,0,1,0,0];Si.IDENTITY_MATRIX=wi;const Ci=[.001,0,0,.001,0,0];Si.FONT_IDENTITY_MATRIX=Ci;const ki={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};Si.RenderingIntentFlag=ki;const xi={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};Si.AnnotationMode=xi;const Ti={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};Si.PermissionFlag=Ti;const Oi={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};Si.TextRenderingMode=Oi;const ji={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};Si.ImageKind=ji;const Li={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};Si.AnnotationType=Li;const Ii={MARKED:"Marked",REVIEW:"Review"};Si.AnnotationStateModelType=Ii;const Mi={MARKED:"Marked",UNMARKED:"Unmarked"};Si.AnnotationMarkedState=Mi;const Fi={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"};Si.AnnotationReviewState=Fi;const Bi={GROUP:"Group",REPLY:"R"};Si.AnnotationReplyType=Bi;const Ri={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};Si.AnnotationFlag=Ri;const Vi={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};Si.AnnotationFieldFlag=Vi;const Ni={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};Si.AnnotationBorderStyleType=Ni;const Wi={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};Si.AnnotationActionEventType=Wi;const zi={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};Si.DocumentActionEventType=zi;const Di={O:"PageOpen",C:"PageClose"};Si.PageActionEventType=Di;const Ui={UNKNOWN:"UNKNOWN",FLATE:"FLATE",LZW:"LZW",DCT:"DCT",JPX:"JPX",JBIG:"JBIG",A85:"A85",AHX:"AHX",CCF:"CCF",RLX:"RLX"};Si.StreamType=Ui;const Hi={UNKNOWN:"UNKNOWN",TYPE1:"TYPE1",TYPE1STANDARD:"TYPE1STANDARD",TYPE1C:"TYPE1C",CIDFONTTYPE0:"CIDFONTTYPE0",CIDFONTTYPE0C:"CIDFONTTYPE0C",TRUETYPE:"TRUETYPE",CIDFONTTYPE2:"CIDFONTTYPE2",TYPE3:"TYPE3",OPENTYPE:"OPENTYPE",TYPE0:"TYPE0",MMTYPE1:"MMTYPE1"};Si.FontType=Hi;const qi={ERRORS:0,WARNINGS:1,INFOS:5};Si.VerbosityLevel=qi;const Gi={NONE:0,BINARY:1,STREAM:2};Si.CMapCompressionType=Gi;const Ki={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,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};Si.OPS=Ki;const Qi={unknown:"unknown",forms:"forms",javaScript:"javaScript",signatures:"signatures",smask:"smask",shadingPattern:"shadingPattern",font:"font",errorTilingPattern:"errorTilingPattern",errorExtGState:"errorExtGState",errorXObject:"errorXObject",errorFontLoadType3:"errorFontLoadType3",errorFontState:"errorFontState",errorFontMissing:"errorFontMissing",errorFontTranslate:"errorFontTranslate",errorColorSpace:"errorColorSpace",errorOperatorList:"errorOperatorList",errorFontToUnicode:"errorFontToUnicode",errorFontLoadNative:"errorFontLoadNative",errorFontBuildPath:"errorFontBuildPath",errorFontGetPath:"errorFontGetPath",errorMarkedContent:"errorMarkedContent",errorContentSubStream:"errorContentSubStream"};Si.UNSUPPORTED_FEATURES=Qi;const Xi={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};Si.PasswordResponses=Xi;let rr=qi.WARNINGS;function ar(wr){Number.isInteger(wr)&&(rr=wr)}function gr(){return rr}function fr(wr){rr>=qi.INFOS&&`${wr}`}function lr(wr){rr>=qi.WARNINGS&&`${wr}`}function mr(wr){throw new Error(wr)}function vr(wr,yr){wr||mr(yr)}function Yi(wr,yr){let br;try{if(br=new URL(wr),!br.origin||br.origin==="null")return!1}catch{return!1}const Ar=new URL(yr,br);return br.origin===Ar.origin}function nr(wr){if(!wr)return!1;switch(wr.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function ir(wr,yr=null,br=null){if(!wr)return null;try{if(br&&typeof wr=="string"){if(br.addDefaultProtocol&&wr.startsWith("www.")){const Ir=wr.match(/\./g);Ir&&Ir.length>=2&&(wr=`http://${wr}`)}if(br.tryConvertEncoding)try{wr=Xr(wr)}catch{}}const Ar=yr?new URL(wr,yr):new URL(wr);if(nr(Ar))return Ar}catch{}return null}function cr(wr,yr,br){return Object.defineProperty(wr,yr,{value:br,enumerable:!0,configurable:!0,writable:!1}),br}const tr=function(){function yr(br,Ar){this.constructor===yr&&mr("Cannot initialize BaseException."),this.message=br,this.name=Ar}return yr.prototype=new Error,yr.constructor=yr,yr}();Si.BaseException=tr;class dr extends tr{constructor(yr,br){super(yr,"PasswordException"),this.code=br}}Si.PasswordException=dr;class Ji extends tr{constructor(yr,br){super(yr,"UnknownErrorException"),this.details=br}}Si.UnknownErrorException=Ji;class sr extends tr{constructor(yr){super(yr,"InvalidPDFException")}}Si.InvalidPDFException=sr;class pr extends tr{constructor(yr){super(yr,"MissingPDFException")}}Si.MissingPDFException=pr;class or extends tr{constructor(yr,br){super(yr,"UnexpectedResponseException"),this.status=br}}Si.UnexpectedResponseException=or;class Zi extends tr{constructor(yr){super(yr,"FormatError")}}Si.FormatError=Zi;class er extends tr{constructor(yr){super(yr,"AbortException")}}Si.AbortException=er;function hr(wr){(typeof wr!="object"||wr===null||wr.length===void 0)&&mr("Invalid argument for bytesToString");const yr=wr.length,br=8192;if(yr>24&255,wr>>16&255,wr>>8&255,wr&255)}function Sr(wr){return Object.keys(wr).length}function Tr(wr){const yr=Object.create(null);for(const[br,Ar]of wr)yr[br]=Ar;return yr}function kr(){const wr=new Uint8Array(4);return wr[0]=1,new Uint32Array(wr.buffer,0,1)[0]===1}const Rr={get value(){return cr(this,"value",kr())}};Si.IsLittleEndianCached=Rr;function Vr(){try{return new Function(""),!0}catch{return!1}}const Hr={get value(){return cr(this,"value",Vr())}};Si.IsEvalSupportedCached=Hr;const Wr=[...Array(256).keys()].map(wr=>wr.toString(16).padStart(2,"0"));class Fr{static makeHexColor(yr,br,Ar){return`#${Wr[yr]}${Wr[br]}${Wr[Ar]}`}static transform(yr,br){return[yr[0]*br[0]+yr[2]*br[1],yr[1]*br[0]+yr[3]*br[1],yr[0]*br[2]+yr[2]*br[3],yr[1]*br[2]+yr[3]*br[3],yr[0]*br[4]+yr[2]*br[5]+yr[4],yr[1]*br[4]+yr[3]*br[5]+yr[5]]}static applyTransform(yr,br){const Ar=yr[0]*br[0]+yr[1]*br[2]+br[4],Ir=yr[0]*br[1]+yr[1]*br[3]+br[5];return[Ar,Ir]}static applyInverseTransform(yr,br){const Ar=br[0]*br[3]-br[1]*br[2],Ir=(yr[0]*br[3]-yr[1]*br[2]+br[2]*br[5]-br[4]*br[3])/Ar,Mr=(-yr[0]*br[1]+yr[1]*br[0]+br[4]*br[1]-br[5]*br[0])/Ar;return[Ir,Mr]}static getAxialAlignedBoundingBox(yr,br){const Ar=Fr.applyTransform(yr,br),Ir=Fr.applyTransform(yr.slice(2,4),br),Mr=Fr.applyTransform([yr[0],yr[3]],br),Or=Fr.applyTransform([yr[2],yr[1]],br);return[Math.min(Ar[0],Ir[0],Mr[0],Or[0]),Math.min(Ar[1],Ir[1],Mr[1],Or[1]),Math.max(Ar[0],Ir[0],Mr[0],Or[0]),Math.max(Ar[1],Ir[1],Mr[1],Or[1])]}static inverseTransform(yr){const br=yr[0]*yr[3]-yr[1]*yr[2];return[yr[3]/br,-yr[1]/br,-yr[2]/br,yr[0]/br,(yr[2]*yr[5]-yr[4]*yr[3])/br,(yr[4]*yr[1]-yr[5]*yr[0])/br]}static apply3dTransform(yr,br){return[yr[0]*br[0]+yr[1]*br[1]+yr[2]*br[2],yr[3]*br[0]+yr[4]*br[1]+yr[5]*br[2],yr[6]*br[0]+yr[7]*br[1]+yr[8]*br[2]]}static singularValueDecompose2dScale(yr){const br=[yr[0],yr[2],yr[1],yr[3]],Ar=yr[0]*br[0]+yr[1]*br[2],Ir=yr[0]*br[1]+yr[1]*br[3],Mr=yr[2]*br[0]+yr[3]*br[2],Or=yr[2]*br[1]+yr[3]*br[3],qr=(Ar+Or)/2,Jr=Math.sqrt((Ar+Or)**2-4*(Ar*Or-Mr*Ir))/2,Zr=qr+Jr||1,Kr=qr-Jr||1;return[Math.sqrt(Zr),Math.sqrt(Kr)]}static normalizeRect(yr){const br=yr.slice(0);return yr[0]>yr[2]&&(br[0]=yr[2],br[2]=yr[0]),yr[1]>yr[3]&&(br[1]=yr[3],br[3]=yr[1]),br}static intersect(yr,br){function Ar(qr,Jr){return qr-Jr}const Ir=[yr[0],yr[2],br[0],br[2]].sort(Ar),Mr=[yr[1],yr[3],br[1],br[3]].sort(Ar),Or=[];if(yr=Fr.normalizeRect(yr),br=Fr.normalizeRect(br),Ir[0]===yr[0]&&Ir[1]===br[0]||Ir[0]===br[0]&&Ir[1]===yr[0])Or[0]=Ir[1],Or[2]=Ir[2];else return null;if(Mr[0]===yr[1]&&Mr[1]===br[1]||Mr[0]===br[1]&&Mr[1]===yr[1])Or[1]=Mr[1],Or[3]=Mr[2];else return null;return Or}static bezierBoundingBox(yr,br,Ar,Ir,Mr,Or,qr,Jr){const Zr=[],Kr=[[],[]];let ts,Qr,ps,Ur,fs,gs,ms,vs;for(let ys=0;ys<2;++ys){if(ys===0?(Qr=6*yr-12*Ar+6*Mr,ts=-3*yr+9*Ar-9*Mr+3*qr,ps=3*Ar-3*yr):(Qr=6*br-12*Ir+6*Or,ts=-3*br+9*Ir-9*Or+3*Jr,ps=3*Ir-3*br),Math.abs(ts)<1e-12){if(Math.abs(Qr)<1e-12)continue;Ur=-ps/Qr,0="ï"){let br;if(wr[0]==="þ"&&wr[1]==="ÿ"?br="utf-16be":wr[0]==="ÿ"&&wr[1]==="þ"?br="utf-16le":wr[0]==="ï"&&wr[1]==="»"&&wr[2]==="¿"&&(br="utf-8"),br)try{const Ar=new TextDecoder(br,{fatal:!0}),Ir=ur(wr);return Ar.decode(Ir)}catch(Ar){lr(`stringToPDFString: "${Ar}".`)}}const yr=[];for(let br=0,Ar=wr.length;bryr===` `?"\\n":yr==="\r"?"\\r":`\\${yr}`)}function jr(wr){return/^[\x00-\x7F]*$/.test(wr)}function Gr(wr){const yr=["þÿ"];for(let br=0,Ar=wr.length;br>8&255),String.fromCharCode(Ir&255))}return yr.join("")}function Xr(wr){return decodeURIComponent(escape(wr))}function ns(wr){return unescape(encodeURIComponent(wr))}function is(wr){return typeof wr=="object"&&wr!==null&&wr.byteLength!==void 0}function rs(wr,yr){if(wr.length!==yr.length)return!1;for(let br=0,Ar=wr.length;brbr.searchParams.append(Ar,yr[Ar])),br.toString()}},(Ai,Si,Ei)=>{Ei(3)},(Ai,Si)=>{Object.defineProperty(Si,"__esModule",{value:!0}),Si.isNodeJS=void 0;const Ei=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");Si.isNodeJS=Ei}],_i={};function $i(Ai){var Si=_i[Ai];if(Si!==void 0)return Si.exports;var Ei=_i[Ai]={exports:{}};return bi[Ai](Ei,Ei.exports,$i),Ei.exports}var Pi={};return(()=>{var Ai=Pi;Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.MessageHandler=void 0;var Si=$i(1);const Ei={UNKNOWN:0,DATA:1,ERROR:2},wi={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function Ci(xi){switch(xi instanceof Error||typeof xi=="object"&&xi!==null||(0,Si.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),xi.name){case"AbortException":return new Si.AbortException(xi.message);case"MissingPDFException":return new Si.MissingPDFException(xi.message);case"PasswordException":return new Si.PasswordException(xi.message,xi.code);case"UnexpectedResponseException":return new Si.UnexpectedResponseException(xi.message,xi.status);case"UnknownErrorException":return new Si.UnknownErrorException(xi.message,xi.details);default:return new Si.UnknownErrorException(xi.message,xi.toString())}}class ki{constructor(Ti,Oi,ji){this.sourceName=Ti,this.targetName=Oi,this.comObj=ji,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=Li=>{const Ii=Li.data;if(Ii.targetName!==this.sourceName)return;if(Ii.stream){this._processStreamMessage(Ii);return}if(Ii.callback){const Fi=Ii.callbackId,Bi=this.callbackCapabilities[Fi];if(!Bi)throw new Error(`Cannot resolve callback ${Fi}`);if(delete this.callbackCapabilities[Fi],Ii.callback===Ei.DATA)Bi.resolve(Ii.data);else if(Ii.callback===Ei.ERROR)Bi.reject(Ci(Ii.reason));else throw new Error("Unexpected callback case");return}const Mi=this.actionHandler[Ii.action];if(!Mi)throw new Error(`Unknown action from worker: ${Ii.action}`);if(Ii.callbackId){const Fi=this.sourceName,Bi=Ii.sourceName;new Promise(function(Ri){Ri(Mi(Ii.data))}).then(function(Ri){ji.postMessage({sourceName:Fi,targetName:Bi,callback:Ei.DATA,callbackId:Ii.callbackId,data:Ri})},function(Ri){ji.postMessage({sourceName:Fi,targetName:Bi,callback:Ei.ERROR,callbackId:Ii.callbackId,reason:Ci(Ri)})});return}if(Ii.streamId){this._createStreamSink(Ii);return}Mi(Ii.data)},ji.addEventListener("message",this._onComObjOnMessage)}on(Ti,Oi){const ji=this.actionHandler;if(ji[Ti])throw new Error(`There is already an actionName called "${Ti}"`);ji[Ti]=Oi}send(Ti,Oi,ji){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:Ti,data:Oi},ji)}sendWithPromise(Ti,Oi,ji){const Li=this.callbackId++,Ii=(0,Si.createPromiseCapability)();this.callbackCapabilities[Li]=Ii;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:Ti,callbackId:Li,data:Oi},ji)}catch(Mi){Ii.reject(Mi)}return Ii.promise}sendWithStream(Ti,Oi,ji,Li){const Ii=this.streamId++,Mi=this.sourceName,Fi=this.targetName,Bi=this.comObj;return new ReadableStream({start:Ri=>{const Vi=(0,Si.createPromiseCapability)();return this.streamControllers[Ii]={controller:Ri,startCall:Vi,pullCall:null,cancelCall:null,isClosed:!1},Bi.postMessage({sourceName:Mi,targetName:Fi,action:Ti,streamId:Ii,data:Oi,desiredSize:Ri.desiredSize},Li),Vi.promise},pull:Ri=>{const Vi=(0,Si.createPromiseCapability)();return this.streamControllers[Ii].pullCall=Vi,Bi.postMessage({sourceName:Mi,targetName:Fi,stream:wi.PULL,streamId:Ii,desiredSize:Ri.desiredSize}),Vi.promise},cancel:Ri=>{(0,Si.assert)(Ri instanceof Error,"cancel must have a valid reason");const Vi=(0,Si.createPromiseCapability)();return this.streamControllers[Ii].cancelCall=Vi,this.streamControllers[Ii].isClosed=!0,Bi.postMessage({sourceName:Mi,targetName:Fi,stream:wi.CANCEL,streamId:Ii,reason:Ci(Ri)}),Vi.promise}},ji)}_createStreamSink(Ti){const Oi=Ti.streamId,ji=this.sourceName,Li=Ti.sourceName,Ii=this.comObj,Mi=this,Fi=this.actionHandler[Ti.action],Bi={enqueue(Ri,Vi=1,Ni){if(this.isCancelled)return;const Wi=this.desiredSize;this.desiredSize-=Vi,Wi>0&&this.desiredSize<=0&&(this.sinkCapability=(0,Si.createPromiseCapability)(),this.ready=this.sinkCapability.promise),Ii.postMessage({sourceName:ji,targetName:Li,stream:wi.ENQUEUE,streamId:Oi,chunk:Ri},Ni)},close(){this.isCancelled||(this.isCancelled=!0,Ii.postMessage({sourceName:ji,targetName:Li,stream:wi.CLOSE,streamId:Oi}),delete Mi.streamSinks[Oi])},error(Ri){(0,Si.assert)(Ri instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,Ii.postMessage({sourceName:ji,targetName:Li,stream:wi.ERROR,streamId:Oi,reason:Ci(Ri)}))},sinkCapability:(0,Si.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:Ti.desiredSize,ready:null};Bi.sinkCapability.resolve(),Bi.ready=Bi.sinkCapability.promise,this.streamSinks[Oi]=Bi,new Promise(function(Ri){Ri(Fi(Ti.data,Bi))}).then(function(){Ii.postMessage({sourceName:ji,targetName:Li,stream:wi.START_COMPLETE,streamId:Oi,success:!0})},function(Ri){Ii.postMessage({sourceName:ji,targetName:Li,stream:wi.START_COMPLETE,streamId:Oi,reason:Ci(Ri)})})}_processStreamMessage(Ti){const Oi=Ti.streamId,ji=this.sourceName,Li=Ti.sourceName,Ii=this.comObj,Mi=this.streamControllers[Oi],Fi=this.streamSinks[Oi];switch(Ti.stream){case wi.START_COMPLETE:Ti.success?Mi.startCall.resolve():Mi.startCall.reject(Ci(Ti.reason));break;case wi.PULL_COMPLETE:Ti.success?Mi.pullCall.resolve():Mi.pullCall.reject(Ci(Ti.reason));break;case wi.PULL:if(!Fi){Ii.postMessage({sourceName:ji,targetName:Li,stream:wi.PULL_COMPLETE,streamId:Oi,success:!0});break}Fi.desiredSize<=0&&Ti.desiredSize>0&&Fi.sinkCapability.resolve(),Fi.desiredSize=Ti.desiredSize,new Promise(function(Bi){Bi(Fi.onPull&&Fi.onPull())}).then(function(){Ii.postMessage({sourceName:ji,targetName:Li,stream:wi.PULL_COMPLETE,streamId:Oi,success:!0})},function(Bi){Ii.postMessage({sourceName:ji,targetName:Li,stream:wi.PULL_COMPLETE,streamId:Oi,reason:Ci(Bi)})});break;case wi.ENQUEUE:if((0,Si.assert)(Mi,"enqueue should have stream controller"),Mi.isClosed)break;Mi.controller.enqueue(Ti.chunk);break;case wi.CLOSE:if((0,Si.assert)(Mi,"close should have stream controller"),Mi.isClosed)break;Mi.isClosed=!0,Mi.controller.close(),this._deleteStreamController(Mi,Oi);break;case wi.ERROR:(0,Si.assert)(Mi,"error should have stream controller"),Mi.controller.error(Ci(Ti.reason)),this._deleteStreamController(Mi,Oi);break;case wi.CANCEL_COMPLETE:Ti.success?Mi.cancelCall.resolve():Mi.cancelCall.reject(Ci(Ti.reason)),this._deleteStreamController(Mi,Oi);break;case wi.CANCEL:if(!Fi)break;new Promise(function(Bi){Bi(Fi.onCancel&&Fi.onCancel(Ci(Ti.reason)))}).then(function(){Ii.postMessage({sourceName:ji,targetName:Li,stream:wi.CANCEL_COMPLETE,streamId:Oi,success:!0})},function(Bi){Ii.postMessage({sourceName:ji,targetName:Li,stream:wi.CANCEL_COMPLETE,streamId:Oi,reason:Ci(Bi)})}),Fi.sinkCapability.reject(Ci(Ti.reason)),Fi.isCancelled=!0,delete this.streamSinks[Oi];break;default:throw new Error("Unexpected stream case")}}async _deleteStreamController(Ti,Oi){await Promise.allSettled([Ti.startCall&&Ti.startCall.promise,Ti.pullCall&&Ti.pullCall.promise,Ti.cancelCall&&Ti.cancelCall.promise]),delete this.streamControllers[Oi]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}Ai.MessageHandler=ki})(),Pi})())})(message_handler);var defineProperty=_defineProperty$1;function baseAssignValue$4(yi,vi,bi){vi=="__proto__"&&defineProperty?defineProperty(yi,vi,{configurable:!0,enumerable:!0,value:bi,writable:!0}):yi[vi]=bi}var _baseAssignValue=baseAssignValue$4,baseAssignValue$3=_baseAssignValue,eq$1=eq_1,objectProto$3=Object.prototype,hasOwnProperty$3=objectProto$3.hasOwnProperty;function assignValue$2(yi,vi,bi){var _i=yi[vi];(!(hasOwnProperty$3.call(yi,vi)&&eq$1(_i,bi))||bi===void 0&&!(vi in yi))&&baseAssignValue$3(yi,vi,bi)}var _assignValue=assignValue$2,assignValue$1=_assignValue,castPath$1=_castPath,isIndex=_isIndex,isObject$7=isObject_1,toKey=_toKey;function baseSet$1(yi,vi,bi,_i){if(!isObject$7(yi))return yi;vi=castPath$1(vi,yi);for(var $i=-1,Pi=vi.length,Ai=Pi-1,Si=yi;Si!=null&&++$i1?bi[$i-1]:void 0,Ai=$i>2?bi[2]:void 0;for(Pi=yi.length>3&&typeof Pi=="function"?($i--,Pi):void 0,Ai&&isIterateeCall(bi[0],bi[1],Ai)&&(Pi=$i<3?void 0:Pi,$i=1),vi=Object(vi);++_i<$i;){var Si=bi[_i];Si&&yi(vi,Si,_i,Pi)}return vi})}var _createAssigner=createAssigner$1,baseMerge=_baseMerge,createAssigner=_createAssigner,mergeWith=createAssigner(function(yi,vi,bi,_i){baseMerge(yi,vi,bi,_i)}),mergeWith_1=mergeWith;function i$b(yi,vi,bi){this.pdfluxTransport=yi}async function s$e(yi){const{prefetchStrategy:vi}=this.pdfluxTransport;return vi&&vi.isValid()&&(vi.isResolved(yi)||await vi.ensurePageData(yi)),pdfExports.PDFDocumentProxy.prototype.getPage.call(this,yi)}async function c$p(){return this.pdfluxTransport.getDocumentOutline(!1)}async function l$i(yi,vi,bi){const _i=new Map;let $i=vi;for await(const Pi of yi){if($i=Pi.page+1,$i<=0)break;_i.has($i)||_i.set($i,[]),_i.get($i).push({pageNumber:$i,index:Pi.index})}return[..._i.values()]}let m$u=class extends pdfExports.PDFDocumentProxy{constructor(vi,bi,_i){return super(bi,_i),i$b.call(this,vi,bi,_i)}async getPage(vi){return s$e.call(this,vi)}async getPdfiumOutline(){return c$p.call(this)}async getPageInfoElements(vi,bi,_i=-1){return l$i.call(this,vi,bi,_i)}};function P$o(yi,vi,bi){return new m$u(yi,vi,bi)}function X$e(yi=[],vi){const bi=[];for(let _i=0;_i{const Ai=[];let Si=0;for(;Siir.data),nr={id:rr,rect:H$f(Yi,bi),subtype:ar.data,annotationFlags:($i=yi.F)===null||$i===void 0?void 0:$i.data,creationDate:F$i(gr==null?void 0:gr.data),modificationDate:fr!=null&&fr.data?F$i(fr==null?void 0:fr.data):F$i(gr==null?void 0:gr.data),annotationType:E$p[ar.data],titleObj:{str:(Pi=(Ai=yi.T)===null||Ai===void 0?void 0:Ai.data)!==null&&Pi!==void 0?Pi:"",dir:"ltr"},contentsObj:{str:(Si=(Ei=yi.Contents)===null||Ei===void 0?void 0:Ei.data)!==null&&Si!==void 0?Si:"",dir:"ltr"},hasAppearance:!!(!((wi=yi.AP)===null||wi===void 0)&&wi.data),pageNumber:vi,popupId:(Ci=yi.Popup)===null||Ci===void 0?void 0:Ci.data.ref_id,hasPopup:!!(!((ki=yi.Popup)===null||ki===void 0)&&ki.data),borderStyle:{width:(xi=(Ti=yi.BS)===null||Ti===void 0||(Ti=Ti.data.W)===null||Ti===void 0?void 0:Ti.data)!==null&&xi!==void 0?xi:0,dashArray:(Oi=(ji=yi.BS)===null||ji===void 0||(ji=ji.data.D)===null||ji===void 0?void 0:ji.data)!==null&&Oi!==void 0?Oi:[],horizontalCornerRadius:0,verticalCornerRadius:0,style:(Li=c$q[(Ii=yi.BS)===null||Ii===void 0||(Ii=Ii.data.S)===null||Ii===void 0?void 0:Ii.data])!==null&&Li!==void 0?Li:1},parentId:vr,parentType:vr?(Mi=_i[vr])===null||Mi===void 0?void 0:Mi.Subtype.data:null,inReplyTo:(Fi=yi.IRT)===null||Fi===void 0?void 0:Fi.data.ref_id,replyType:yi.IRT&&((Bi=(Ri=yi.RT)===null||Ri===void 0?void 0:Ri.data)!==null&&Bi!==void 0?Bi:"R"),name:(Vi=yi.Name)===null||Vi===void 0?void 0:Vi.data,subj:(Ni=yi.Subj)===null||Ni===void 0?void 0:Ni.data,color:(Wi=yi.C)===null||Wi===void 0?void 0:Wi.data.map(ir=>255*ir.data|0),quadPoints:(zi=yi.QuadPoints)!==null&&zi!==void 0&&zi.data?X$e((Di=yi.QuadPoints)===null||Di===void 0?void 0:Di.data,bi):void 0,lineCoordinates:(Ui=yi.L)!==null&&Ui!==void 0&&Ui.data?Y$e(yi.L.data,bi):void 0,inkLists:(Hi=yi.InkList)!==null&&Hi!==void 0&&Hi.data?Z$c(yi.InkList.data,bi):void 0,lineEndpoints:(qi=yi.LE)!==null&&qi!==void 0&&qi.data?[(Gi=yi.LE)===null||Gi===void 0?void 0:Gi.data[0].data,(Ki=yi.LE)===null||Ki===void 0?void 0:Ki.data[1].data]:void 0,vertices:(Qi=yi.Vertices)!==null&&Qi!==void 0&&Qi.data?tt$9(yi.Vertices.data,bi):void 0,A:yi.A,AP:yi.AP,CA:yi.CA,RC:yi.RC,HideInf:yi.HideInf,NM:yi.NM,P:yi.P,LL:yi.LL,LLE:yi.LLE,LLO:yi.LLO,HighDpi:yi.HighDpi};if(((Xi=yi.A)===null||Xi===void 0||(Xi=Xi.data.S)===null||Xi===void 0?void 0:Xi.data)==="URI"){nr.unsafeUrl=yi.A.data.URI.data;const ir=pdfExports.createValidAbsoluteUrl(nr.unsafeUrl,void 0,{addDefaultProtocol:!0,tryConvertEncoding:!0});ir&&(nr.url=ir.href)}return U$g(nr),nr}function et$9(yi,vi=0){if(!yi)return null;const bi=vi*(255-yi[0])+yi[0],_i=vi*(255-yi[1])+yi[1],$i=vi*(255-yi[2])+yi[2];let Pi=pdfExports.Util.makeHexColor(bi|0,_i|0,$i|0);if(yi.length===4){const Ai=yi[3];let Si=Math.round(Ai*255).toString(16);Si.length===1&&(Si=`0${Si}`),Pi+=Si}return Pi}function o$c(){const yi=Object.create(null);let vi=!1;return Object.defineProperty(yi,"settled",{get(){return vi}}),yi.promise=new Promise((bi,_i)=>{yi.resolve=function($i){vi=!0,bi($i)},yi.reject=function($i){vi=!0,_i($i)}}),yi}function A$q(yi){this._internalRenderTask=yi,this.onContinue=null}function W$l(){return this._internalRenderTask.capability.promise}function L$h(){this._internalRenderTask.cancel()}let N$j=class{constructor(vi){return A$q.call(this,vi)}get promise(){return W$l.call(this)}cancel(){return L$h.call(this)}};var S$p=new WeakMap,m$t=new WeakMap,I$m=new WeakMap,C$n=new WeakMap;function U$f(){return pdfExports.shadow(this,"canvasInUse",new WeakSet)}function M$j(yi,vi,bi,_i,$i){_classPrivateFieldInitSpec(this,S$p,{writable:!0,value:!1}),_classPrivateFieldInitSpec(this,m$t,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(this,I$m,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(this,C$n,{writable:!0,value:void 0}),_defineProperty(this,"running",!1),_defineProperty(this,"cancelled",!1),_defineProperty(this,"capability",o$c()),_defineProperty(this,"gfx",null),this.callback=yi,this.params=vi,_classPrivateFieldSet(this,S$p,_i),_classPrivateFieldSet(this,I$m,bi),this.task=new N$j(this),_classPrivateFieldSet(this,m$t,vi.canvasContext.canvas),_classPrivateFieldSet(this,C$n,$i)}function O$s(){return this.capability.promise.catch(()=>{})}function $$f(yi){if(this.cancelled)return;if(_classPrivateFieldGet(this,m$t)){if(v$o.canvasInUse.has(_classPrivateFieldGet(this,m$t)))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");v$o.canvasInUse.add(_classPrivateFieldGet(this,m$t))}this.gfx={beginDrawing:async({canvasContext:_i,page:$i})=>{const{canvas:Pi}=_i,{width:Ai,height:Si}=Pi,{rotation:Ei}=yi.app.pages[$i],wi=`${$i}_${Ai}_${Si}_${Ei}`,Ci=yi.app.imageCache.get(wi);if(Ci){_i.drawImage(Ci,0,0),this.capability.resolve(void 0);return}const ki=async()=>{try{if(this.cancelled){this.capability.resolve(void 0);return}yi.app.rendering=!0;const xi=yi.app.layers?{layers:yi.app.layers}:{},Ti=await yi.pdfiumTransport.getImageData({index:$i,width:Ai,height:Si,rotation:Ei,devicePixelRatio:window.devicePixelRatio,...xi,watermark:_classPrivateFieldGet(this,C$n)});_i.drawImage(Ti,0,0),yi.app.imageCache.set(wi,Ti),this.capability.resolve(void 0)}catch(xi){yi.app.destroyed||console.error(xi)}finally{yi.app.renderStack.length&&yi.app.renderStack.pop()(),yi.app.rendering=!1}};yi.app.rendering?yi.app.renderStack.push(ki):await ki()}};const{canvasContext:vi,viewport:bi}=this.params;this.gfx.beginDrawing({viewport:bi,canvasContext:vi,page:_classPrivateFieldGet(this,I$m)})}function j$d(yi){this.running=!1,this.cancelled=!0,_classPrivateFieldGet(this,m$t)&&v$o.canvasInUse.delete(_classPrivateFieldGet(this,m$t)),this.callback(yi||new pdfExports.RenderingCancelledException(`Rendering cancelled, page ${_classPrivateFieldGet(this,I$m)+1}`,"canvas"))}let v$o=class{static get canvasInUse(){return U$f.call(this)}constructor({callback:vi,params:bi,pageIndex:_i,pdfDebug:$i=!1,watermark:Pi=0}){return M$j.call(this,vi,bi,_i,$i,Pi)}get completed(){return O$s.call(this)}initializeGraphics(vi){return $$f.call(this,vi)}cancel(vi=null){return j$d.call(this,vi)}};var R$j=new WeakMap;function z$f(yi,vi,bi,_i,$i,Pi){_classPrivateFieldInitSpec(this,R$j,{writable:!0,value:void 0}),_defineProperty(this,"charCount",null),this.context=yi}async function K$9(){if(this.app.AppOptions.get("disableDocAnnotation"))return[];const{objects:yi}=await this.pdfiumTransport.getPageAnnotations(this._pageIndex),vi=[],bi=[];return Object.keys(yi).forEach(_i=>{const $i=yi[_i];$i.Type==="Page"&&vi.push($i)}),vi.forEach(({Annots:_i,pai_annots:$i})=>{const Pi=this._pageIndex+1,Ai=[];let Si=[];const Ei=[];[..._i,...$i].forEach(wi=>{const Ci=yi[wi];if(!E$p[Ci.Subtype.data])return;if(Ci.Subtype.data==="Popup"&&Ci.Parent){const xi=Ci.Parent.data.ref_id,Ti=yi[xi];if(!E$p[Ti.Subtype.data])return}const ki=lt$8(Ci,Pi,this.view,yi);if(ki){const{annotationType:xi,inReplyTo:Ti}=ki;xi===E$p.Popup?Ei.push(ki):xi===E$p.Text&&Ti?Si.push(ki):Ai.push(ki)}}),Si=Si.filter(wi=>{const{inReplyTo:Ci}=wi,ki=Ai.find(xi=>xi.id===Ci);return!(ki&&ki.popupId&&!Ei.find(xi=>xi.id===ki.popupId))}),Si.forEach(wi=>{const{id:Ci,inReplyTo:ki}=wi,xi=Ai.find(Oi=>Oi.id===ki),Ti=(xi==null?void 0:xi.replyIds)||[];xi&&!Ti.includes(Ci)&&(Ti.push(Ci),xi.replyIds=Ti)}),Si.sort((wi,Ci)=>wi.modificationDate-Ci.modificationDate),bi.push(...Ai,...Ei,...Si)}),bi}function H$e(){return this.context.app}function V$i(){return this.context.transport}function q$c(){return this.context.app.selectTextService(this._pageIndex)}function J$g(yi,vi){const bi=$i=>{this.cleanupAfterRender&&(this.pendingCleanup=!0),$i||_i.capability.resolve(void 0),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"))},_i=new v$o({callback:bi,params:{canvasContext:yi,viewport:vi},pageIndex:this._pageIndex,pdfBug:this._pdfBug,watermark:this.app.AppOptions.get("watermark")});return Promise.resolve().then(()=>{_i.initializeGraphics(this)}),_i.task}async function Q$c(){return await this.getPdfiumAnnotations()}function X$d(yi){return this.pdfiumTransport.cleanup(this._pageIndex),pdfExports.PDFPageProxy.prototype.cleanup.call(this,yi)}async function Y$d(){return _classPrivateFieldGet(this,R$j)===void 0&&_classPrivateFieldSet(this,R$j,await this.pdfiumTransport.getPageScannedResult(this._pageIndex)),_classPrivateFieldGet(this,R$j)}async function Z$b(){return this.charCount===null&&(this.charCount=await this.selectTextService.getCountChars(this._pageIndex)),this.charCount}async function ee$4(yi,vi,bi){return this.selectTextService.getText({pageIndex:this._pageIndex,index:yi,count:vi,withNewline:bi})}async function te$4(yi,vi){return this.selectTextService.getRects({pageIndex:this._pageIndex,index:yi,count:vi})}async function ne$4(yi){return this.selectTextService.getExpandSentence({pageIndex:this._pageIndex,startIndex:yi})}async function ae$3(yi){return this.selectTextService.selectTextInElementBlock({pageIndex:this._pageIndex,startIndex:yi})}async function se$4(yi,vi){const bi=[],_i=async $i=>{const Pi=[this.getRangeText($i,1),this.getRangeRects($i,1)],[Ai,Si]=await Promise.all(Pi);return{index:$i,text:Ai,rects:Si}};for(let $i=yi;$i{if(!_i.includes($i.text))return $i;const Ai=Pi>0?yi[Pi-1]:null;if(Ai){const Ei=Ai.rects.at(-1),wi=$i.rects.at(0);R$k(Ei,wi,2)&&wi[0]-Ei[2]>bi&&(wi[0]=Ei[2]+bi)}const Si=Pibi&&(Ei[2]=wi[0]-bi)}return $i})}async function re$3(yi,vi){const[bi,_i]=yi;let $i=await this.getEachCharInfosByIdxRange(bi,_i);vi&&($i=this.repairSpaceRect($i));const Pi=[];let Ai=1,Si=0;return $i.forEach((Ei,wi)=>{let Ci=!1;if(Ei.text===""&&wi!==$i.length-1){const Ti=$i[wi+1],[[Oi,,,ji]]=Ei.rects,[[,Li,Ii]]=Ti.rects;Ci=jiIi}const ki=Ci?" ":Ei.text,xi=!["",` `].includes(Ei.text);Pi.push({lineNumber:Ai,charIdx:Si,index:Ei.index,text:ki,rects:Ei.rects,isBreak:Ci,isValidChar:xi}),Ci?(Si+=1,Ai+=1):xi&&(Si+=1)}),Pi}async function ce$3(){return this.pdfiumTransport.getElementBlockInfos(this._pageIndex)}async function oe$3(yi,vi){const bi=await this.getRangeText(yi,vi-yi);return this.selectTextService.getSentenceCountInText(bi)}async function le$3(yi,vi,bi,_i){const[$i]=await this.selectTextService.getNearPointIndexes({index:this._pageIndex,x:yi,y:vi,xTolerance:bi,yTolerance:_i});return this.getElementBlockCharRange($i)}async function he$3(yi,vi){const[bi]=await this.selectTextService.getNearPointIndexes({index:this._pageIndex,x:yi,y:vi,xTolerance:10,yTolerance:10});return this.getSentenceCharRange(bi)}async function ue$2(yi,vi,bi,_i){const $i=await this.selectTextService.getNearPointIndexes({index:this._pageIndex,x:yi,y:vi,xTolerance:bi,yTolerance:_i});if($i[0]!==$i[1])return $i;const[Pi]=await this.getRangeRects($i[0],1);if(!Pi)return $i;const[Ai,Si,Ei,wi]=Pi;if(!(yi+bi>=Ai&&yi-bi<=Ei&&vi+_i>=Si&&vi-_i<=wi))return $i;const Ci=Ei-Ai;return yi-Ai>Ci/2?$i.map(ki=>ki+1):$i}async function pe$1(){return(await this.getElementBlockInfos()).filter(yi=>yi.type!=="PAGE_BLOCK_ITEM")}async function de$2(){return(await this.getElementBlockInfos()).filter(yi=>yi.type.startsWith("PARAGRAPH"))}async function ge$1(yi,vi){return this.selectTextService.getTextInRectWithoutLineBreak({pageIndex:yi,rect:vi})}let fe$1=class extends pdfExports.PDFPageProxy{constructor(vi,bi,_i,$i,Pi,Ai){return super(bi,_i,$i,Pi,Ai),z$f.call(this,vi,bi,_i,$i,Pi,Ai)}async getPdfiumAnnotations(){return K$9.call(this)}get app(){return H$e.call(this)}get pdfiumTransport(){return V$i.call(this)}get selectTextService(){return q$c.call(this)}render({canvasContext:vi,viewport:bi}){return J$g.call(this,vi,bi)}async getAnnotations(){return Q$c.call(this)}cleanup(vi=!1){return X$d.call(this,vi)}async isScanned(){return Y$d.call(this)}async getCharCount(){return Z$b.call(this)}async getRangeText(vi,bi,_i=!1){return ee$4.call(this,vi,bi,_i)}async getRangeRects(vi,bi){return te$4.call(this,vi,bi)}async getSentenceCharRange(vi){return ne$4.call(this,vi)}async getElementBlockCharRange(vi){return ae$3.call(this,vi)}async getEachCharInfosByIdxRange(vi,bi){return se$4.call(this,vi,bi)}repairSpaceRect(vi){return ie$4.call(this,vi)}async getEachCharInfo(vi,bi=!1){return re$3.call(this,vi,bi)}async getElementBlockInfos(){return ce$3.call(this)}async getSentenceCountByIndexes(vi,bi){return oe$3.call(this,vi,bi)}async getElementBlockIndexesByPoint(vi,bi,_i=10,$i=10){return le$3.call(this,vi,bi,_i,$i)}async getExpandSentenceIndexesByPoint(vi,bi){return he$3.call(this,vi,bi)}async getNearPointExactIndexes(vi,bi,_i=10,$i=10){return ue$2.call(this,vi,bi,_i,$i)}async getTextElementBlocks(){return pe$1.call(this)}async getParagraphInfos(){return de$2.call(this)}async getTextInRectWithoutLineBreak(vi,bi){return ge$1.call(this,vi,bi)}};function Ce$2(yi,vi,bi,_i,$i,Pi){if(yi.renderEngine!=="pdf.js")return new fe$1(yi,vi,bi,_i,$i,Pi);const Ai=new pdfExports.PDFPageProxy(vi,bi,_i,$i,Pi);return Ai.app=yi.app,Ai.pdfiumTransport=yi.transport,Ai}var newPromiseCapability={},aCallable$3=aCallable$8,$TypeError$2=TypeError,PromiseCapability=function(yi){var vi,bi;this.promise=new yi(function(_i,$i){if(vi!==void 0||bi!==void 0)throw $TypeError$2("Bad Promise constructor");vi=_i,bi=$i}),this.resolve=aCallable$3(vi),this.reject=aCallable$3(bi)};newPromiseCapability.f=function(yi){return new PromiseCapability(yi)};var perform$1=function(yi){try{return{error:!1,value:yi()}}catch(vi){return{error:!0,value:vi}}},uncurryThis=functionUncurryThisClause,aCallable$2=aCallable$8,NATIVE_BIND=functionBindNative,bind$1=uncurryThis(uncurryThis.bind),functionBindContext=function(yi,vi){return aCallable$2(yi),vi===void 0?yi:NATIVE_BIND?bind$1(yi,vi):function(){return yi.apply(vi,arguments)}},iterators={},wellKnownSymbol$3=wellKnownSymbol$a,Iterators$1=iterators,ITERATOR$2=wellKnownSymbol$3("iterator"),ArrayPrototype=Array.prototype,isArrayIteratorMethod$1=function(yi){return yi!==void 0&&(Iterators$1.Array===yi||ArrayPrototype[ITERATOR$2]===yi)},classof=classof$7,getMethod$1=getMethod$3,isNullOrUndefined=isNullOrUndefined$3,Iterators=iterators,wellKnownSymbol$2=wellKnownSymbol$a,ITERATOR$1=wellKnownSymbol$2("iterator"),getIteratorMethod$2=function(yi){if(!isNullOrUndefined(yi))return getMethod$1(yi,ITERATOR$1)||getMethod$1(yi,"@@iterator")||Iterators[classof(yi)]},call$3=functionCall,aCallable$1=aCallable$8,anObject$2=anObject$8,tryToString$1=tryToString$4,getIteratorMethod$1=getIteratorMethod$2,$TypeError$1=TypeError,getIterator$1=function(yi,vi){var bi=arguments.length<2?getIteratorMethod$1(yi):vi;if(aCallable$1(bi))return anObject$2(call$3(bi,yi));throw $TypeError$1(tryToString$1(yi)+" is not iterable")},call$2=functionCall,anObject$1=anObject$8,getMethod=getMethod$3,iteratorClose$1=function(yi,vi,bi){var _i,$i;anObject$1(yi);try{if(_i=getMethod(yi,"return"),!_i){if(vi==="throw")throw bi;return bi}_i=call$2(_i,yi)}catch(Pi){$i=!0,_i=Pi}if(vi==="throw")throw bi;if($i)throw _i;return anObject$1(_i),bi},bind=functionBindContext,call$1=functionCall,anObject=anObject$8,tryToString=tryToString$4,isArrayIteratorMethod=isArrayIteratorMethod$1,lengthOfArrayLike=lengthOfArrayLike$7,isPrototypeOf=objectIsPrototypeOf,getIterator=getIterator$1,getIteratorMethod=getIteratorMethod$2,iteratorClose=iteratorClose$1,$TypeError=TypeError,Result=function(yi,vi){this.stopped=yi,this.result=vi},ResultPrototype=Result.prototype,iterate$1=function(yi,vi,bi){var _i=bi&&bi.that,$i=!!(bi&&bi.AS_ENTRIES),Pi=!!(bi&&bi.IS_RECORD),Ai=!!(bi&&bi.IS_ITERATOR),Si=!!(bi&&bi.INTERRUPTED),Ei=bind(vi,_i),wi,Ci,ki,xi,Ti,Oi,ji,Li=function(Mi){return wi&&iteratorClose(wi,"normal",Mi),new Result(!0,Mi)},Ii=function(Mi){return $i?(anObject(Mi),Si?Ei(Mi[0],Mi[1],Li):Ei(Mi[0],Mi[1])):Si?Ei(Mi,Li):Ei(Mi)};if(Pi)wi=yi.iterator;else if(Ai)wi=yi;else{if(Ci=getIteratorMethod(yi),!Ci)throw $TypeError(tryToString(yi)+" is not iterable");if(isArrayIteratorMethod(Ci)){for(ki=0,xi=lengthOfArrayLike(yi);xi>ki;ki++)if(Ti=Ii(yi[ki]),Ti&&isPrototypeOf(ResultPrototype,Ti))return Ti;return new Result(!1)}wi=getIterator(yi,Ci)}for(Oi=Pi?yi.next:wi.next;!(ji=call$1(Oi,wi)).done;){try{Ti=Ii(ji.value)}catch(Mi){iteratorClose(wi,"throw",Mi)}if(typeof Ti=="object"&&Ti&&isPrototypeOf(ResultPrototype,Ti))return Ti}return new Result(!1)},global$2=global$h,promiseNativeConstructor=global$2.Promise,wellKnownSymbol$1=wellKnownSymbol$a,ITERATOR=wellKnownSymbol$1("iterator"),SAFE_CLOSING=!1;try{var called=0,iteratorWithReturn={next:function(){return{done:!!called++}},return:function(){SAFE_CLOSING=!0}};iteratorWithReturn[ITERATOR]=function(){return this},Array.from(iteratorWithReturn,function(){throw 2})}catch(yi){}var checkCorrectnessOfIteration$1=function(yi,vi){if(!vi&&!SAFE_CLOSING)return!1;var bi=!1;try{var _i={};_i[ITERATOR]=function(){return{next:function(){return{done:bi=!0}}}},yi(_i)}catch{}return bi},engineIsDeno=typeof Deno=="object"&&Deno&&typeof Deno.version=="object",IS_DENO$1=engineIsDeno,IS_NODE=engineIsNode,engineIsBrowser=!IS_DENO$1&&!IS_NODE&&typeof window=="object"&&typeof document=="object",global$1=global$h,NativePromiseConstructor$1=promiseNativeConstructor,isCallable=isCallable$h,isForced=isForced_1,inspectSource=inspectSource$2,wellKnownSymbol=wellKnownSymbol$a,IS_BROWSER=engineIsBrowser,IS_DENO=engineIsDeno,V8_VERSION=engineV8Version;NativePromiseConstructor$1&&NativePromiseConstructor$1.prototype;var SPECIES=wellKnownSymbol("species"),SUBCLASSING=!1,NATIVE_PROMISE_REJECTION_EVENT=isCallable(global$1.PromiseRejectionEvent),FORCED_PROMISE_CONSTRUCTOR$1=isForced("Promise",function(){var yi=inspectSource(NativePromiseConstructor$1),vi=yi!==String(NativePromiseConstructor$1);if(!vi&&V8_VERSION===66)return!0;if(!V8_VERSION||V8_VERSION<51||!/native code/.test(yi)){var bi=new NativePromiseConstructor$1(function(Pi){Pi(1)}),_i=function(Pi){Pi(function(){},function(){})},$i=bi.constructor={};if($i[SPECIES]=_i,SUBCLASSING=bi.then(function(){})instanceof _i,!SUBCLASSING)return!0}return!vi&&(IS_BROWSER||IS_DENO)&&!NATIVE_PROMISE_REJECTION_EVENT}),promiseConstructorDetection={CONSTRUCTOR:FORCED_PROMISE_CONSTRUCTOR$1,REJECTION_EVENT:NATIVE_PROMISE_REJECTION_EVENT,SUBCLASSING},NativePromiseConstructor=promiseNativeConstructor,checkCorrectnessOfIteration=checkCorrectnessOfIteration$1,FORCED_PROMISE_CONSTRUCTOR=promiseConstructorDetection.CONSTRUCTOR,promiseStaticsIncorrectIteration=FORCED_PROMISE_CONSTRUCTOR||!checkCorrectnessOfIteration(function(yi){NativePromiseConstructor.all(yi).then(void 0,function(){})}),$$e=_export,call=functionCall,aCallable=aCallable$8,newPromiseCapabilityModule=newPromiseCapability,perform=perform$1,iterate=iterate$1,PROMISE_STATICS_INCORRECT_ITERATION=promiseStaticsIncorrectIteration;$$e({target:"Promise",stat:!0,forced:PROMISE_STATICS_INCORRECT_ITERATION},{allSettled:function yi(vi){var bi=this,_i=newPromiseCapabilityModule.f(bi),$i=_i.resolve,Pi=_i.reject,Ai=perform(function(){var Si=aCallable(bi.resolve),Ei=[],wi=0,Ci=1;iterate(vi,function(ki){var xi=wi++,Ti=!1;Ci++,call(Si,bi,ki).then(function(Oi){Ti||(Ti=!0,Ei[xi]={status:"fulfilled",value:Oi},--Ci||$i(Ei))},function(Oi){Ti||(Ti=!0,Ei[xi]={status:"rejected",reason:Oi},--Ci||$i(Ei))})}),--Ci||$i(Ei)});return Ai.error&&Pi(Ai.value),_i.promise}});const r$e="pdfjs.password";function o$b(yi,vi){return yi.findIndex(bi=>bi.url===vi)}function e$2(){const yi=window.localStorage.getItem(r$e);let vi=[];return yi&&(vi=JSON.parse(yi)),vi}function i$a(yi){const vi=e$2(),bi=o$b(vi,yi.url);return bi>=0?vi[bi]=yi:vi.push(yi),window.localStorage.setItem(r$e,JSON.stringify(vi)),yi}function a$h(yi){const vi=e$2(),bi=o$b(vi,yi);return bi>=0?vi[bi].password:""}function r$d(){return typeof SharedArrayBuffer=="function"}const S$o={DISABLE:0,USE_JSON:1};function w$r(yi){this.loadingTask=null,this.pdfiumTransport=yi}function T$k(yi){this.loadingTask=yi}let U$e=class{constructor(vi){return w$r.call(this,vi)}setLoadingTask(vi){return T$k.call(this,vi)}};var l$h=new WeakMap,n$8=new WeakMap,p$i=new WeakMap;function k$m(){return _classPrivateFieldGet(this,n$8).promise}function J$f(yi,vi){_classPrivateFieldInitSpec(this,l$h,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(this,n$8,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(this,p$i,{writable:!0,value:new Map}),_classPrivateFieldSet(this,n$8,o$c()),this.getDocData=vi;const{appOptions:bi}=this.pdfiumTransport;if(vi&&typeof this.getDocData=="function"){const _i=bi.get("defaultUrl");this.getDocData(_i).then($i=>{_classPrivateFieldSet(this,l$h,$i),_classPrivateFieldGet(this,n$8).resolve($i)}).catch(()=>{_classPrivateFieldSet(this,l$h,null),_classPrivateFieldGet(this,n$8).resolve(_classPrivateFieldGet(this,l$h))})}}function F$h(yi){return!1}function M$i(){return this.getDocData!==null&&typeof this.getDocData=="function"}async function b$k(yi){await this._ensurePageData(yi)}async function E$o(yi){const vi=await _classPrivateFieldGet(this,n$8).promise;if(vi===null||vi.ranges===null)return!1;const bi=_classPrivateFieldGet(this,p$i).get(yi);if(bi)return bi;const _i=vi.ranges[yi];if(!_i||_i.length===0)return!1;const{appOptions:$i}=this.pdfiumTransport;let Pi;const Ai=_i.map(Ti=>({begin:Ti[0],end:Ti[1]})),Si=$i.get("pdfBugEnabled"),Ei=$i.get("supportMultipleRange"),wi=$i.get("resolvePageDataUrl"),Ci=$i.get("defaultUrl"),ki=wi?wi(Ci):Ci,xi={ranges:Ai,pageNumber:yi,cause:Si?`ensurePage${yi}`:"",supportMultipleRange:Ei,pdfUrl:ki};return r$d()?Pi=this.loadingTask._transport.prefetchPageData(xi):Pi=this.pdfiumTransport.prefetchPageData(xi),_classPrivateFieldGet(this,p$i).set(yi,Pi),Pi}let I$l=class extends U$e{get promise(){return k$m.call(this)}constructor(vi,bi=null){return super(vi),J$f.call(this,vi,bi)}isResolved(vi){return F$h.call(this,vi)}isValid(){return M$i.call(this)}async ensurePageData(vi){return b$k.call(this,vi)}async _ensurePageData(vi){return E$o.call(this,vi)}};function w$q(){_defineProperty(this,"chunkSize",65536),_defineProperty(this,"bytes",null),_defineProperty(this,"loadedChunks",new Set)}function W$k(yi){return Math.floor(yi/this.chunkSize)}function R$i(yi){return Math.floor((yi-1)/this.chunkSize)+1}function C$m(yi,vi){const bi=this.getBeginChunk(yi),_i=this.getEndChunk(vi),$i=[];for(let Pi=bi;Pi<_i;++Pi)$i.push(Pi);return $i}let T$j=class{constructor(){return w$q.call(this)}getBeginChunk(vi){return W$k.call(this,vi)}getEndChunk(vi){return R$i.call(this,vi)}getChunks(vi,bi){return C$m.call(this,vi,bi)}};function S$n(yi,vi){if(_defineProperty(this,"workerIsReady",o$c()),_defineProperty(this,"_docHandlerCapability",o$c()),_defineProperty(this,"docHandler",null),_defineProperty(this,"_docLoadedCapability",o$c()),_defineProperty(this,"prefetchStrategy",null),!(!vi||!yi)){this.messageHandler=yi,this.appOptions=vi;try{const bi=this.appOptions.get("wasmPath")||"/static/pdflux.wasm",_i=this.appOptions.get("isDesktopEnv")||!1,$i=this.appOptions.get("disableExternalFont")||!1,Pi=this.appOptions.get("defaultUrl"),Ai=this.appOptions.get("rangeChunkSize");yi.send("4b3a00a1594c8be0500ce1a724448d61",{rangeChunkSize:Ai,defaultUrl:Pi,wasmPath:bi,isDesktopEnv:_i,disableExternalFont:$i})}catch(bi){console.error(bi)}if(vi.get("prefetchStrategy")===S$o.USE_JSON){const bi=vi.get("prefetchPageData");typeof bi=="function"&&(this.prefetchStrategy=new I$l(this,bi))}yi.on("4e545ebce9d8a341b0449fc2627b2776",()=>{this.workerIsReady.resolve(null)})}}function $$d(yi){const{messageHandler:vi}=this,bi=new message_handlerExports.MessageHandler(yi,`${yi}_worker`,vi.comObj),_i=new T$j;bi.on("bd067cd4c0b5d62681e3c43871bb88a1",()=>{var $i;this._docHandlerCapability.resolve(bi),($i=this.docHandler)===null||$i===void 0||$i.destroy(),this.docHandler=bi}),bi.on("ea5e203bd5dd55a4f278aebf828fe3a8",()=>{this._docLoadedCapability.resolve(null)}),bi.on("4b0cae975a3f8a937176a16a24a5951e",async $i=>{var Pi,Ai;if(await((Pi=this._loadingTask)===null||Pi===void 0?void 0:Pi.promise),((Ai=this._loadingTask)===null||Ai===void 0?void 0:Ai.destroyed)!==!0){var Si;const wi=(Si=this._loadingTask)===null||Si===void 0?void 0:Si._transport,Ci=_i.getChunks($i.start,$i.end);if(!(_i.bytes!==null&&Ci.every(ki=>_i.loadedChunks.has(ki)))){const{bytes:ki,loadedChunks:xi,chunkSize:Ti}=await wi.getRangeData($i);_i.bytes=ki,_i.chunkSize=Ti,_i.loadedChunks=xi}}const Ei=new Int32Array($i.sab);if(_i.bytes){const wi=new Uint32Array(_i.bytes.subarray($i.start,$i.end));Ei.set(wi,1)}Ei[0]=1,Atomics.notify(Ei,0)})}function D$n(yi){if(this._loadingTask)throw new Error("there is already a loadingTask");this._loadingTask=yi,this.prefetchStrategy&&this.prefetchStrategy.setLoadingTask(yi),yi.transportPromise.then(()=>{const{prefetchStrategy:vi}=this;yi._transport.messageHandler.on("PrefetchPage0Data",async()=>{if(!vi||!vi.isValid())return null;await vi.ensurePageData(0)}),yi._transport.messageHandler.on("PrefetchFirstViewData",async bi=>{if(!vi||!vi.isValid())return null;await vi.ensurePageData(1);try{const _i=Number(bi);Number.isNaN(_i)||await(vi==null?void 0:vi.ensurePageData(_i))}catch{console.error("Prefetch the last page data failed!")}})}),this.workerIsReady.promise.then(()=>{const{messageHandler:vi}=this,{docId:bi}=yi,_i=this.appOptions.get("systemFontListURL"),$i=this.appOptions.get("fontHostServer");vi.send("40b3dae6c20fa5c6a8a0f334f35b7554",{docId:bi,appOptions:{enableAutoRotateScannedPage:this.appOptions.userOptions.enableAutoRotateScannedPage,apiDocId:this.appOptions.userOptions.apiDocId,apiPrefix:this.appOptions.userOptions.apiPrefix},systemFontListURL:_i,fontHostServer:$i,wordsFileSrc:this.appOptions.get("wordsFileSrc")}),this.setMessageHandler(bi)}),this.workerIsReady.promise.then(()=>{yi.promise.then(async vi=>{var bi;if(yi.destroyed)return;const _i=yi._transport._fullReader;await _i._headersReady;let $i=new Uint8Array(_i.contentLength);_i.isRangeSupported||($i=await vi.getData());const Pi=await this._docHandlerCapability.promise,Ai=this.appOptions.get("wasmPath")||"/static/pdflux.wasm",Si=this.appOptions.get("isDesktopEnv")||!1,Ei=this.appOptions.get("disableExternalFont")||!1,wi=this.appOptions.get("enableWordSegmentation")||!1,Ci=this.appOptions.get("enableLoadLinearizedPdf")||!1,ki=this.appOptions.get("enableCachePassword")||!1,xi=this.appOptions.get("defaultUrl"),Ti=(bi=this._loadingTask)===null||bi===void 0?void 0:bi._transport,Oi=this.appOptions.get("keepInvisibleText");let ji={password:""};ki&&(ji.password=a$h(xi));try{Ti._passwordCapability&&(ji=await Ti._passwordCapability.promise,ki&&i$a({url:xi,password:ji.password}))}catch{console.error("wrong password")}const Li={data:$i,wasmPath:Ai,password:ji.password,isDesktopEnv:Si,disableExternalFont:Ei,isRangeSupported:_i.isRangeSupported,enableWordSegmentation:wi,enableLoadLinearizedPdf:Ci,keepInvisibleText:Oi};Pi==null||Pi.send("4866e9e33c823a8d5543744fd5903c3c",Li,[Li.data.buffer])})})}function x$l(){const yi=[this._docHandlerCapability.promise,this._docLoadedCapability.promise];return Promise.allSettled(yi)}async function G$c(){var yi;await this.idPdfiumReady,(yi=this.docHandler)===null||yi===void 0||yi.sendWithPromise("30ad8f8fbccac7cf713be9b3090f9662")}async function O$r(yi){var vi;return await this.idPdfiumReady,await((vi=this.docHandler)===null||vi===void 0?void 0:vi.sendWithPromise("993f1dddc1bf76a22938fa27725e597e",yi))}async function I$k(yi){var vi;return await this.idPdfiumReady,(vi=this.docHandler)===null||vi===void 0?void 0:vi.sendWithPromise("82d89d9fd09ee4f56b14f75fc6fab5ea",yi)}async function L$g(yi){var vi;return await this.idPdfiumReady,(vi=this.docHandler)===null||vi===void 0?void 0:vi.sendWithPromise("7038fc11b29eb81569e11289014c2015",yi)}async function E$n(yi){var vi;return await this.idPdfiumReady,(vi=this.docHandler)===null||vi===void 0?void 0:vi.sendWithPromise("14d81fb0dbb80c9d327ff3202f7cbd28",yi)}async function A$p(yi){var vi;return await this.idPdfiumReady,(vi=this.docHandler)===null||vi===void 0?void 0:vi.sendWithPromise("1bf93ea6c204608162f7e7717d2fd45c",yi)}async function B$d(yi){var vi;return await this.idPdfiumReady,(vi=this.docHandler)===null||vi===void 0?void 0:vi.sendWithPromise("451168b6d282bacc0510744c102ae60d",yi)}async function M$h(yi){var vi;return await this.idPdfiumReady,(vi=this.docHandler)===null||vi===void 0?void 0:vi.sendWithPromise("59d138d9b2b320b0bf6dae632d236d6b",yi)}async function N$i(yi){var vi;return await this.idPdfiumReady,(vi=this.docHandler)===null||vi===void 0?void 0:vi.sendWithPromise("5b7a21e557bd9012720100308697f769",yi)}async function z$e(yi){var vi;return await this.idPdfiumReady,(vi=this.docHandler)===null||vi===void 0?void 0:vi.sendWithPromise("ab0a04dc5f03993a613c50e4b255a72c",yi)}async function F$g(yi){var vi;return await this.idPdfiumReady,(vi=this.docHandler)===null||vi===void 0?void 0:vi.sendWithPromise("fd5eb71dab9211618a58554653bea150",yi)}async function U$d(yi){var vi;return await this.idPdfiumReady,(vi=this.docHandler)===null||vi===void 0?void 0:vi.sendWithPromise("e92b72b7ee074427f0038ecf00683bb5",yi)}async function V$h(yi){var vi;return await this.idPdfiumReady,(vi=this.docHandler)===null||vi===void 0?void 0:vi.sendWithPromise("707eef544def53bbc37844acb70516cf",yi)}async function q$b(yi){var vi;return await this.idPdfiumReady,(vi=this.docHandler)===null||vi===void 0?void 0:vi.sendWithPromise("e9b1d1a07e51f90da8941042dbebee85",yi)}async function J$e(yi){var vi;return await this.idPdfiumReady,(vi=this.docHandler)===null||vi===void 0?void 0:vi.sendWithPromise("6bf92e81b46261875d8622f2673fbc23",yi)}async function j$c(yi){var vi;return await this.idPdfiumReady,(vi=this.docHandler)===null||vi===void 0?void 0:vi.sendWithPromise("d9c3a1fe81a4e9e9f06effa3e5dfe3cc",yi)}async function K$8(yi){var vi;return await this.idPdfiumReady,(vi=this.docHandler)===null||vi===void 0?void 0:vi.sendWithPromise("885aa83539a116e7087b8344ca89ba7e",yi)}async function Q$b(yi){var vi;return await this.idPdfiumReady,(vi=this.docHandler)===null||vi===void 0?void 0:vi.sendWithPromise("edee9e85ea9cea876be620473f9b3e21",yi)}async function X$c(yi){var vi;return await this.idPdfiumReady,(vi=this.docHandler)===null||vi===void 0?void 0:vi.sendWithPromise("c79c0780a929b1632065e380d9a5d17f",yi)}async function Y$c(yi){var vi;return await this.idPdfiumReady,(vi=this.docHandler)===null||vi===void 0?void 0:vi.sendWithPromise("5988cfdd48320d172689295e648b257f",yi)}async function Z$a(){var yi;return await this.idPdfiumReady,(yi=this.docHandler)===null||yi===void 0?void 0:yi.sendWithPromise("1023b99daf7726d96d4977bcbb25a3fb")}async function ee$3(yi){var vi;return await this.idPdfiumReady,(vi=this.docHandler)===null||vi===void 0?void 0:vi.sendWithPromise("227505aee1e83523e717dc06ffe040ad",yi)}async function te$3(yi){var vi;return await this.idPdfiumReady,(vi=this.docHandler)===null||vi===void 0?void 0:vi.sendWithPromise("1a0f2218baaca445f45bd32738ce41d2",yi)}async function ae$2(yi){var vi;return await this.idPdfiumReady,(vi=this.docHandler)===null||vi===void 0?void 0:vi.sendWithPromise("50d8f6f253df9db505f7ee240bec61ea",yi)}async function ne$3(){var yi;return await this.idPdfiumReady,(yi=this.docHandler)===null||yi===void 0?void 0:yi.sendWithPromise("2dde3edd42abf97b616f21a36cb1e9f2")}async function re$2(yi){var vi;return await this.idPdfiumReady,(vi=this.docHandler)===null||vi===void 0?void 0:vi.sendWithPromise("7a6248b086e1d0da242222904ce5de34",yi)}async function ie$3(){var yi,vi,bi;await this.idPdfiumReady;const _i=await((yi=this.docHandler)===null||yi===void 0?void 0:yi.sendWithPromise("a05e73a4384a93c5f25834399b168945"));return(vi=this.docHandler)===null||vi===void 0||vi.destroy(),(bi=this.messageHandler)===null||bi===void 0||bi.destroy(),_i}async function se$3(yi){var vi,bi;(vi=this.messageHandler)===null||vi===void 0||vi.send("8ecfc86efc208e0b82806e097950c6d9",yi),await this.idPdfiumReady,await((bi=this.docHandler)===null||bi===void 0?void 0:bi.sendWithPromise("8ecfc86efc208e0b82806e097950c6d9",yi))}async function de$1(){var yi;return await this.idPdfiumReady,(yi=this.docHandler)===null||yi===void 0?void 0:yi.sendWithPromise("c8c97234b5bfe8b2df8ee8a73b16b8ac")}async function oe$2(yi){var vi;return await this.idPdfiumReady,(vi=this.docHandler)===null||vi===void 0?void 0:vi.sendWithPromise("47c0201f546dfff5d39071e8008029eb",yi)}async function ce$2(yi){var vi;return await this.idPdfiumReady,(vi=this.docHandler)===null||vi===void 0?void 0:vi.sendWithPromise("62735b06496c06e838be629eb4fd1133",yi)}async function le$2(yi){var vi;return await this.idPdfiumReady,(vi=this.docHandler)===null||vi===void 0?void 0:vi.sendWithPromise("e82b44a353fe682eecb8ae34e94b7861",yi)}async function he$2(yi){var vi;return await this._docHandlerCapability.promise,(vi=this.docHandler)===null||vi===void 0?void 0:vi.sendWithPromise("8344edd7d7b90479d064e9d17a5b8736",yi)}async function ue$1(yi){var vi;return await this._docHandlerCapability.promise,(vi=this.docHandler)===null||vi===void 0?void 0:vi.sendWithPromise("c0dc801a102b706b6570b6072765a887",yi)}async function fe(yi){var vi;return await this._docHandlerCapability.promise,(vi=this.docHandler)===null||vi===void 0?void 0:vi.sendWithPromise("b78143d7db40fb3e614820887af3352e",yi)}class pe{constructor(vi,bi){return S$n.call(this,vi,bi)}setMessageHandler(vi){return $$d.call(this,vi)}set loadingTask(vi){return D$n.call(this,vi)}get idPdfiumReady(){return x$l.call(this)}async loadDocSegment(){return G$c.call(this)}async getImageData(vi){return O$r.call(this,vi)}async getPageScannedResult(vi){return I$k.call(this,vi)}async getDocumentOutline(vi=!1){return L$g.call(this,vi)}async getTextAtRect(vi){return E$n.call(this,vi)}async getIndexNearPoint(vi){return A$p.call(this,vi)}async getTextInRectWithoutLineBreak(vi){return B$d.call(this,vi)}async getCharBox(vi){return M$h.call(this,vi)}async getPageAngle(vi){return N$i.call(this,vi)}async getText(vi){return z$e.call(this,vi)}async getCountChars(vi){return F$g.call(this,vi)}async getExpandWord(vi){return U$d.call(this,vi)}async getExpandSentence(vi){return V$h.call(this,vi)}async getSentenceCountInText(vi){return q$b.call(this,vi)}async selectTextInElementBlock(vi){return J$e.call(this,vi)}async getRects(vi){return j$c.call(this,vi)}async getCharRects(vi){return K$8.call(this,vi)}async getNeighborIndexes(vi){return Q$b.call(this,vi)}async setElementBlock(vi){return X$c.call(this,vi)}async cleanup(vi){return Y$c.call(this,vi)}async getAnnotations(){return Z$a.call(this)}async getPageAnnotations(vi){return ee$3.call(this,vi)}async getElementBlockInfos(vi){return te$3.call(this,vi)}async setAnnotations(vi){return ae$2.call(this,vi)}async saveDocument(){return ne$3.call(this)}async loadPage(vi){return re$2.call(this,vi)}async destroyLibrary(){return ie$3.call(this)}async setWasmConfig(vi){return se$3.call(this,vi)}async getDocLayers(){return de$1.call(this)}async getCharStyle(vi){return oe$2.call(this,vi)}async getColorAtPoint(vi){return ce$2.call(this,vi)}async getPageRotation(vi){return le$2.call(this,vi)}async getRange(vi){return he$2.call(this,vi)}async prefetchPageData(vi){return ue$1.call(this,vi)}async getWordSegment(vi){return fe.call(this,vi)}}var We$2=pe;function s$d(yi){_defineProperty(this,"MAX_SCALE",component_viewerExports.MAX_SCALE),_defineProperty(this,"MIN_SCALE",component_viewerExports.MIN_SCALE),this.viewerApp=yi,this.helper=yi.helper;const{helper:vi}=this;this.zoomIn=vi.webViewerZoomIn,this.zoomOut=vi.webViewerZoomOut,this.zoomReset=vi.webViewerZoomReset,this.goPreviousPage=vi.webViewerPreviousPage,this.goNextPage=vi.webViewerNextPage,this.goFirstPage=vi.webViewerFirstPage,this.goLastPage=vi.webViewerLastPage,this.print=vi.webViewerPrint,this.download=vi.webViewerDownload,this.openFile=vi.webViewerOpenFile}function l$g(){return[...this.viewerApp.toolbar.items.scaleSelect.options].map(yi=>({value:yi.value,label:yi.innerText}))}function a$g(yi){this.helper.webViewerScaleChanged({value:yi})}function n$7(yi){this.helper.webViewerPageNumberChanged({value:yi})}function h$h(yi){yi===1?this.helper.webViewerRotateCw():this.helper.webViewerRotateCcw()}let w$p=class{constructor(vi){return s$d.call(this,vi)}getScalePresetValues(){return l$g.call(this)}setViewerScale(vi){return a$g.call(this,vi)}goPageByNumber(vi){return n$7.call(this,vi)}rotate(vi=1){return h$h.call(this,vi)}};var b$j=w$p;function o$a(yi,vi,bi){component_viewerExports.EventBus.prototype.on.call(this,yi,vi,bi)}function i$9(yi,vi){component_viewerExports.EventBus.prototype.off.call(this,yi,vi)}function r$c(yi,vi){component_viewerExports.EventBus.prototype.dispatch.call(this,yi,vi)}function c$o(yi){yi?this._listeners[yi]=[]:this._listeners=Object.create(null)}let h$g=class extends component_viewerExports.EventBus{on(vi,bi,_i){return o$a.call(this,vi,bi,_i)}off(vi,bi){return i$9.call(this,vi,bi)}dispatch(vi,bi){return r$c.call(this,vi,bi)}clear(vi){return c$o.call(this,vi)}};const m$s=[{icon:"text-box",widgetType:E$p[28],title:"选择文本"},{icon:"vector-square-solid",widgetType:E$p[5],title:"矩形"},{icon:"table-solid",widgetType:E$p[27],title:"表格"},{icon:"comments",widgetType:E$p[1],title:"Note"},{icon:"line",widgetType:E$p[4],title:"直线"},{icon:"Ink",widgetType:E$p[15],title:"画笔"},{icon:"polygon",widgetType:E$p[7],title:"多边形"},{icon:"polyline",widgetType:E$p[8],title:"折线"},{icon:"text-diff",widgetType:E$p[101],title:"编辑文本"}];var n$6=new WeakMap;function g$l(yi){_defineProperty(this,"dom",null),_defineProperty(this,"isOpened",!1),_classPrivateFieldInitSpec(this,n$6,{writable:!0,value:null}),_defineProperty(this,"eventBus",new h$g),_defineProperty(this,"menuItems",[...m$s]),this.options=yi,this.dom=this.createView()}function w$o(yi){this.dom&&(this.isOpened=yi,yi?this.dom.classList.add("mark-opened"):this.dom.classList.remove("mark-opened"))}function v$n(){const yi=document.createElement("div"),vi=["mark-buttons-wrapper","menu"];yi.classList.add(...vi);const bi=M$l("marker-solid");bi.classList.add("marker-icon"),bi.addEventListener("click",()=>{this.setOpen(!this.isOpened)});const _i=document.createElement("ul");return _i.addEventListener("click",$i=>{const Pi=$i.target.closest("li");if(Pi){const{widgetType:Ai}=Pi.dataset;this.handleUpdate(Ai)}}),m$s.forEach($i=>{const Pi=document.createElement("li");Pi.dataset.widgetType=$i.widgetType,Pi.setAttribute("title",$i.title);const Ai=M$l($i.icon);Pi.appendChild(Ai),$i.el=Pi,_i.append(Pi)}),yi.appendChild(bi),yi.appendChild(_i),yi}function _$n(yi){if(!yi)this.selected=null;else{const vi=this.menuItems.find(bi=>bi.widgetType===yi);if(vi)this.selected=vi;else throw new Error(`不被支持的控件类型 ${yi}`)}}function y$q(){return _classPrivateFieldGet(this,n$6)}function I$j(yi){if(this.menuItems.forEach(bi=>{var _i;(_i=bi.el)===null||_i===void 0||_i.classList.remove("widget-icon-selected")}),_classPrivateFieldGet(this,n$6)===yi)_classPrivateFieldSet(this,n$6,null);else if(_classPrivateFieldSet(this,n$6,yi),_classPrivateFieldGet(this,n$6)){var vi;(vi=_classPrivateFieldGet(this,n$6).el)===null||vi===void 0||vi.classList.add("widget-icon-selected")}this.eventBus.dispatch("widgetMenuItemChange",{..._classPrivateFieldGet(this,n$6)})}function T$i(){this.selected=null}function M$g(){var yi;(yi=this.dom)===null||yi===void 0||yi.remove()}let k$l=class{constructor(vi){return g$l.call(this,vi)}setOpen(vi){return w$o.call(this,vi)}createView(){return v$n.call(this)}handleUpdate(vi){return _$n.call(this,vi)}get selected(){return y$q.call(this)}set selected(vi){return I$j.call(this,vi)}reset(){return T$i.call(this)}destroy(){return M$g.call(this)}};var f$j=new WeakMap,P$n=new WeakSet,A$o=new WeakSet;function M$f(){return this.config.dom}function x$k(yi){_classPrivateMethodInitSpec(this,A$o),_classPrivateMethodInitSpec(this,P$n),_classPrivateFieldInitSpec(this,f$j,{writable:!0,value:void 0}),_defineProperty(this,"outline",[0,0,0,0]),_defineProperty(this,"originalOutline",[0,0,0,0]),_defineProperty(this,"activated",!1),this.config=yi,_classPrivateFieldSet(this,f$j,_classPrivateMethodGet(this,P$n,G$b).bind(this))}function E$m(){const yi=this.config.getContext();return this.originalOutline=yi.outline,this.outline=yi.outline,yi}function w$n(yi){const{outline:vi}=this.config.getContext(),[bi,_i]=yi.dataset.position.split(",").map(Number),$i=Math.abs(vi[2]-vi[0]),Pi=Math.abs(vi[3]-vi[1]);yi.setAttribute("cx",`${$i*bi}`),yi.setAttribute("cy",`${Pi*_i}`)}function U$c(){this.activated=!0,this.setup();const{resizePoints:yi}=this.config.getContext(),vi=document.createDocumentFragment();yt$3(yi).forEach(bi=>{this.updateCirclePosition(bi),bi.addEventListener("mousedown",_classPrivateFieldGet(this,f$j)),vi.appendChild(bi)}),this.container.appendChild(vi)}function F$f(){this.activated=!1,this.container.querySelectorAll(".resize-point").forEach(yi=>{yi.removeEventListener("mousedown",_classPrivateFieldGet(this,f$j)),yi.remove()}),this.cleanup()}function I$i(){this.container.querySelectorAll(".resize-point").forEach(yi=>{this.updateCirclePosition(yi)})}function O$q(yi,vi,bi){const[_i,$i]=bi,{outline:Pi}=this,Ai=this.originalOutline.slice(0,2),Si=this.originalOutline.slice(2,4);if($i===.5){if(_i===0){[,vi]=Pi,this.outline=[yi,vi,...Si];return}if(_i===1){[,,,vi]=Pi,this.outline=[...Ai,yi,vi];return}}if(_i===.5){if($i===0){[yi]=Pi,this.outline=[yi,vi,...Si];return}if($i===1){[,,yi]=Pi,this.outline=[...Ai,yi,vi];return}}if(_i===0&&$i===0){this.outline=[yi,vi,...Si];return}if(_i===1&&$i===1){this.outline=[...Ai,yi,vi];return}if(_i===0&&$i===1){this.outline=[yi,Ai[1],Si[0],vi];return}_i===1&&$i===0&&(this.outline=[Ai[0],vi,yi,Si[1]])}function D$m(){this.currentResizePoint=void 0,this.outline=[0,0,0,0],this.originalOutline=[0,0,0,0]}function k$k(){this.config.onDimensionsUpdated(this.outline)}let R$h=class{get container(){return M$f.call(this)}constructor(vi){return x$k.call(this,vi)}setup(){return E$m.call(this)}updateCirclePosition(vi){return w$n.call(this,vi)}enable(){return U$c.call(this)}disable(){return F$f.call(this)}updatePoints(){return I$i.call(this)}resize(vi,bi,_i=[1,1]){return O$q.call(this,vi,bi,_i)}cleanup(){return D$m.call(this)}handleUpdate(){return k$k.call(this)}};function G$b(yi){this.setup();const vi=yi.target,bi=_classPrivateMethodGet(this,A$o,N$h).bind(this),_i=this.container.closest(".annotationLayer");this.container.classList.add("resizing"),vi.dataset&&vi.dataset.position&&(_i.addEventListener("mousemove",bi),this.currentResizePoint=vi.dataset.position.split(",").map(Number),document.addEventListener("mouseup",()=>{_i.removeEventListener("mousemove",bi),this.config.onResizeDone(),this.container.classList.remove("resizing")},{once:!0}))}function N$h(yi){if(yi.stopPropagation(),!this.currentResizePoint)return;const vi=this.currentResizePoint;if(localStorage.getItem("USE_OCR_LABEL_RESIZE")){const{movementX:bi,movementY:_i}=yi,[$i,Pi,Ai,Si]=this.outline,[Ei,wi]=vi,Ci=$i+(Ai-$i)*Ei+bi,ki=Pi+(Si-Pi)*wi+_i;this.resize(Ci,ki,vi)}else{const bi=this.container.closest(".annotationLayer").getBoundingClientRect(),{clientX:_i,clientY:$i}=yi;this.resize(_i-bi.left,$i-bi.top,vi)}this.updatePoints(),this.handleUpdate()}var c$n=new WeakMap;function W$j(yi){_classPrivateFieldInitSpec(this,c$n,{writable:!0,value:[]})}function X$b(){const yi=R$h.prototype.setup.call(this);_classPrivateFieldSet(this,c$n,yi.lineCoordinates)}function Y$b(yi,vi,bi){const[_i,$i]=bi,[Pi,Ai,Si,Ei]=_classPrivateFieldGet(this,c$n);_i===0&&$i===0?_classPrivateFieldSet(this,c$n,[yi,vi,Si,Ei]):_classPrivateFieldSet(this,c$n,[Pi,Ai,yi,vi])}function $$c(yi){const vi=this.config.getContext(),[bi,_i]=vi.outline,[$i,Pi]=yi.dataset.position.split(",").map(Number),[Ai,Si,Ei,wi]=vi.lineCoordinates;let Ci=0,ki=0;const xi=Math.sqrt((Ei-Ai)**2+(wi-Si)**2);if(xi>0){const Ti=Number(yi.getAttribute("r")),Oi=(Ei-Ai)/xi,ji=(wi-Si)/xi;Ci=Oi*Ti,ki=ji*Ti}$i===0&&Pi===0?(yi.setAttribute("cx",String(Ai-Ci)),yi.setAttribute("cy",String(Si-ki))):(yi.setAttribute("cx",String(Ei+Ci)),yi.setAttribute("cy",String(wi+ki))),yi.setAttribute("transform",`translate(-${bi},-${_i})`)}function q$a(){this.config.onDimensionsUpdated(_classPrivateFieldGet(this,c$n))}let Q$a=class extends R$h{constructor(...vi){return super(...vi),W$j.call(this,vi)}setup(){return X$b.call(this)}resize(vi,bi,_i=[1,1]){return Y$b.call(this,vi,bi,_i)}updateCirclePosition(vi){return $$c.call(this,vi)}handleUpdate(){return q$a.call(this)}};function H$d(yi){return yi.map(vi=>`
  • ${vi}
  • `).join("")}const T$h=document.createElement("ul");T$h.classList.add("annotation-tag-list");const f$i=Symbol("identification"),j$b=["click","mouseenter","mouseleave","dblclick","mousedown"],P$m=["annotation"];var A$n=new WeakMap,g$k=new WeakMap,E$l=new WeakMap,p$h=new WeakMap,w$m=new WeakMap,v$m=new WeakMap,C$l=new WeakSet,y$p=new WeakSet;function Z$9(){return this.widget.contentEl}function q$9(){return{x:this.outline[0],y:this.outline[1]}}function J$d(yi){this.data.annotationType!==E$p.Popup&&(this.widget.zIndex=yi)}function Y$a(){return this.data.annotationType!==E$p.Popup?this.widget.zIndex:0}function Q$9(yi){const{x:vi,y:bi}=this.transformCoordinates;return yi>0?`translate(${vi}, ${bi})`:`translate(${-vi}, ${-bi})`}function K$7(yi){return et$9(yi,0)}function X$a(yi,vi,bi,_i){var $i;_classPrivateMethodInitSpec(this,y$p),_classPrivateMethodInitSpec(this,C$l),_classPrivateFieldInitSpec(this,A$n,{writable:!0,value:void 0}),_defineProperty(this,"resizePoints",T$m),_defineProperty(this,"isResizeEnable",!0),_classPrivateFieldInitSpec(this,g$k,{writable:!0,value:!0}),_classPrivateFieldInitSpec(this,E$l,{writable:!0,value:!1}),_defineProperty(this,"autoFocusOnClick",!0),_defineProperty(this,"autoFocusOnEnter",!1),_defineProperty(this,"initialized",!1),_classPrivateFieldInitSpec(this,p$h,{writable:!0,value:!1}),_defineProperty(this,"className",[...P$m]),_defineProperty(this,"dataset",[]),_defineProperty(this,"destroyed",!1),_classPrivateFieldInitSpec(this,w$m,{writable:!0,value:[]}),_defineProperty(this,"ignoreBorder",!1),_defineProperty(this,"editable",!0),_defineProperty(this,"resizeAbility",null),_defineProperty(this,"events",[...j$b]),_defineProperty(this,f$i,!1),_classPrivateFieldInitSpec(this,v$m,{writable:!0,value:Ai=>{const Si=`annot-${Ai.type}`;if(this.eventBus.dispatch(Si,{eventName:Si,annotation:this,event:Ai}),Ai.type==="click"){this.autoFocusOnClick&&(this.focus=!0),localStorage.getItem("PDF_VIEWER_DEBUG");return}Ai.type==="mouseenter"&&this.autoFocusOnEnter&&(this.focus=!0)}}),_classPrivateFieldSet(this,A$n,yi.data.id),this.subtype=E$p[yi.data.annotationType],this.parameters=yi,this.setCommonFieldsBasedData(yi.data),this.author=yi.author(),this.ignoreBorder=bi,this.annotationService=yi.annotationService,this.data.dataset&&(this.dataset=[...this.dataset,...this.data.dataset||[]]),this.data.classNames&&(this.className=[...this.className,...this.data.classNames||[]]),this.tagsContainer=yi.tagsContainer,this.layer=yi.layer,this.editable=this.checkEditable(yi.data.authorID),this[f$i]=($i=yi.data.identification||/pdflux-identification/.test(yi.data.customType||""))!==null&&$i!==void 0?$i:!1,this.isResizeEnable=!this[f$i];const Pi=!!this[f$i];this.widget=this.createWidget({...this.parameters,zIndex:this.annotationService.getWidgetMaxZIndex(this.pageNumber)+1},{ignoreBorder:bi,useViewRotation:Pi,allowCrossPageBoundary:Pi}),this.widget&&(yi.annotationService.UIEventBus.dispatch(J$h,this.widget),this.tags=yi.data.tags||[])}function tt$8(yi){var vi;const bi={borderWidth:(vi=this.data.borderStyle)===null||vi===void 0?void 0:vi.width,dom:this.widget.svg,onDimensionsUpdated:$i=>{this.setOutline($i)},onResizeDone:()=>{this.eventBus.dispatch(m$v,this)},getContext:()=>({outline:this.outline,resizePoints:this.resizePoints})};yi&&Object.assign(bi,yi);const _i=new R$h(bi);return this.widget.resizeAbility=_i,_i}function et$8(yi){return this.quadrilaterals&&this.widget.svg.append(...this.quadrilaterals),this.addAttributes(this.widget.dom,yi),this.widget.dom}function it$8(yi,vi){const{customType:bi,subj:_i}=vi;yi.classList.add(...this.className),yi.dataset.subtype=this.subtype,bi&&(yi.dataset.customType=bi),_i&&(yi.dataset.subj=_i),this.dataset.forEach(([$i,Pi])=>{yi.dataset[$i]=Pi||""})}function nt$8(yi,vi){const{customType:bi,subj:_i}=vi;yi.classList.add(...this.className),bi&&(yi.dataset.customType=bi),_i&&(yi.dataset.subj=_i),this.dataset.forEach(([$i,Pi])=>{yi.dataset[$i]=Pi}),this.widget.applyStyles(yi,vi)}function st$8(yi,vi){if(yi){if(E$p[yi]!==void 0)throw new Error(`Unexpected custom type "${yi}", please use registered custom type`);const{customAnnotClassMap:bi}=this.parameters.annotationService;if(!bi.has(yi))throw new Error(`the custom type "${yi}" is not registered, please check`);if(vi&&E$p[bi.get(yi).ParentType]!==this.subtype)throw new Error(`The current custom type '${yi}' does not match the parent type '${this.subtype}'`)}}function at$8(yi){const vi=yi[2]-yi[0],bi=yi[3]-yi[1];return vi!==0&&bi!==0&&(yi=vt$3(this.viewportInfo,yi)),yi.map(_i=>_i*this.pageInfo.viewport.scale)}function ot$8(yi){const{customType:vi}=yi;yi.dataset=Tt$3(yi.dataset),this.data=yi,this.customType=vi}function rt$8(yi){this.widget.updateByData(yi),this.onOutlineUpdated()}function lt$7(yi){const{customType:vi}=yi;this.validateCustomType(vi);const bi=this.getPopupAnnotationElement();bi&&(bi==null||bi.update())}function ht$6(yi){const{tags:vi=[],customType:bi}=yi;this.validateCustomType(bi,!0);const _i=this.customType;yi.dataset=Tt$3(yi.dataset),this.data=yi,this.customType=bi,this.tags=vi,this.updateViewByData(this.data);const $i=this.getPopupAnnotationElement();if($i&&$i.update(),_i!==bi&&(this.eventBus.dispatch(H$g,this),bi)){const{customAnnotConfigMap:Pi}=this.parameters.annotationService,{classNames:Ai=[],dataset:Si=[]}=Pi.get(bi);this.container.classList.remove(...this.className),this.dataset.forEach(([Ei])=>{delete this.container.dataset[Ei]}),this.className=[...P$m,...Ai],this.dataset=[...yi.dataset||[],...Si]}return this.updateAttributes(this.container,yi),this.container}function ut$7(){return _classPrivateFieldGet(this,g$k)&&(this.container.classList.add("always-show"),this.setTagVisible(!0)),_classPrivateMethodGet(this,C$l,se$2).call(this),this.initialized=!0,this.eventBus.dispatch(V$k,this),this.container}function ct$7(){return this.parameters.annotationService.APPEventBus}function dt$5(){return _classPrivateFieldGet(this,A$n)}function mt$4(){return this.pageInfo.scale}function ft$4(){return this.pageInfo.pageNumber}function gt$5(){return this.widget.outline}function pt$5(){return this.subtype===E$p[16]}async function _t$4(){const{authorID:yi}=this.parameters.data;let vi;return yi&&(vi=await this.parameters.annotationService.getAvatar(yi)),vi}function At$1(yi){this.widget.setOutline(yi),this.onOutlineUpdated()}function Et$2(){this.isPopup||_classPrivateMethodGet(this,y$p,I$h).call(this),this.syncWithPopupAnnotationView(),this.initialized&&this.eventBus.dispatch(w$s,this)}function wt$3(){const yi=this.getPopupAnnotationElement();yi&&(!yi.alignAnnotInfo||yi.alignAnnotInfo.id===this.id)&&(yi==null||yi.setAlignAnnotInfo(this))}function vt$2(){return this.widget.width}function yt$2(){return this.widget.height}function bt$2(yi){yi?this.container.classList.add("always-show"):(this.isAlwaysShowControlBar=yi,this.container.classList.remove("always-show")),_classPrivateFieldSet(this,g$k,yi),this.setTagVisible(yi)}function St$3(){return _classPrivateFieldGet(this,g$k)}function Tt$2(yi){if(yi&&!this.isAlwaysShow)throw new Error('Property "isAlwaysShow" must first be set to true');_classPrivateFieldSet(this,E$l,yi),this.setCtrlBarVisibility(yi)}function Pt$2(){return _classPrivateFieldGet(this,E$l)}function Ct$1(){return this.parameters.getPageInfo()}function It$2(){return this.pageInfo.viewport}function Bt$1(){let{viewBox:yi,rotation:vi,scale:bi}=this.viewport;this[f$i]&&(vi=this.pageInfo.rotation);const[_i,$i,Pi,Ai]=yi,Si=Pi-_i,Ei=Ai-$i;return{width:Si,height:Ei,rotation:vi,scale:bi}}function Lt$1(yi,vi){this.widget.move(yi,vi),this.onOutlineUpdated()}function Nt$1(yi){this.widget.moveEnd(yi),this.eventBus.dispatch(n$9,this)}function Dt$1(yi,vi,bi,_i){this.widget.drawing(yi,vi,bi,_i)}async function Rt$2(yi,vi){if(vi&&!this.check()){this.destroy();return}this.widget.handleDrawEnd(),this.focus=yi!=null?yi:this.focus,this.eventBus.dispatch(u$i,this)}function Ut$1(){return this.widget.isDrawing}function zt$1(){return[this.widget.outline[0],this.widget.outline[1]]}function Ot$1(){return[this.widget.outline[0],this.widget.outline[1]]}function xt$3(yi){yi?this.eventBus.dispatch(a$i,this):this.eventBus.dispatch(U$h,this)}function Vt$1(yi){if(this.tagUL){if(this.focus||this.isAlwaysShow||yi){this.tagUL.classList.add("show");return}!this.focus&&!this.isAlwaysShow&&this.tagUL.classList.remove("show")}}function kt$1(){var yi;this.destroyed||((yi=this.tagUL)===null||yi===void 0||yi.remove(),this.destroyed=!0,this.tagUL=void 0,this.tagsContainer=void 0,this.parameters.annotationService.removeAnnotation(this.id),this.eventBus.dispatch(b$l,this))}function Ft$1(){return _classPrivateFieldGet(this,p$h)}function Mt$1(yi){if(_classPrivateFieldGet(this,p$h)===yi)return;_classPrivateFieldSet(this,p$h,yi),yi?(this.container.classList.add("focus"),this.enableResize(),this.eventBus.dispatch(P$q,this)):(this.container.classList.remove("focus"),this.disableResize(),this.eventBus.dispatch(g$m,this)),this.setTagVisible(yi);const vi=this.getPopupAnnotationElement();vi&&(yi&&vi.setAlignAnnotInfo(this),vi.toggleVisible(yi))}function Wt$1(){if(this.editable&&this.isResizeEnable){var yi;this.addClass("resizable"),(yi=this.resizeAbility)===null||yi===void 0||yi.enable()}}function Gt$1(){if(this.editable){var yi;this.removeClass("resizable"),(yi=this.resizeAbility)===null||yi===void 0||yi.disable()}}function $t$1(yi){yi?this.widget.freeze():this.widget.unfreeze()}function Ht$1(){return this.widget.isFrozen}function jt$1(yi){if(_classPrivateFieldSet(this,w$m,yi),this.tagUL&&(this.tagUL.remove(),this.tagUL=void 0),yi.length){var vi,bi;this.tagUL=T$h.cloneNode(),_classPrivateMethodGet(this,y$p,I$h).call(this),this.tagUL.innerHTML=H$d(this.tags),this.tagUL.dataset.annot=this.id,this.tagUL.dataset.annotType=(vi=this.customType)!==null&&vi!==void 0?vi:this.subtype,this.setTagVisible(this.focus),(bi=this.tagsContainer)===null||bi===void 0||bi.appendChild(this.tagUL)}}function Zt$1(){return _classPrivateFieldGet(this,w$m)}function qt$2(yi){this.container.classList.add(...yi)}function Jt$1(yi){this.container.classList.remove(...yi)}function Yt$1(){return{...this.data,rect:this.widget.getViewBoxRect(),tags:this.tags}}function Qt$1(yi){_classPrivateFieldGet(this,v$m).call(this,yi)}function Kt$1(){return this.parameters.data.parentId?this.annotationService.getAnnotations(yi=>yi.id===this.parameters.data.parentId)[0]:this.parameters.data.inReplyTo?this.annotationService.getAnnotations(yi=>yi.id===this.parameters.data.inReplyTo)[0]:null}function Xt$1(){return this.parameters.data.popupId?this.annotationService.getAnnotations(yi=>yi.id===this.parameters.data.popupId)[0]:null}function te$2(yi){return yi?yi===this.parameters.authorID():!0}function ee$2(){return this.widget.getText()}function ie$2(yi){this.controlBar=yi}let ne$2=class{get content(){return Z$9.call(this)}get transformCoordinates(){return q$9.call(this)}set zIndex(vi){return J$d.call(this,vi)}get zIndex(){return Y$a.call(this)}getTransformStyleAttr(vi=1){return Q$9.call(this,vi)}parseColor(vi){return K$7.call(this,vi)}constructor(vi,{isRenderable:bi=!1,ignoreBorder:_i=!1,createQuadrilaterals:$i=!1}={}){return X$a.call(this,vi,bi,_i,$i)}createResizeAbility(vi){return tt$8.call(this,vi)}createView(vi){return et$8.call(this,vi)}addAttributes(vi,bi){return it$8.call(this,vi,bi)}updateAttributes(vi,bi){return nt$8.call(this,vi,bi)}validateCustomType(vi,bi=!1){return st$8.call(this,vi,bi)}parseRect(vi){return at$8.call(this,vi)}setCommonFieldsBasedData(vi){return ot$8.call(this,vi)}updateViewByData(vi){return rt$8.call(this,vi)}initialize(vi){return lt$7.call(this,vi)}update(vi){return ht$6.call(this,vi)}render(){return ut$7.call(this)}get eventBus(){return ct$7.call(this)}get id(){return dt$5.call(this)}get scale(){return mt$4.call(this)}get pageNumber(){return ft$4.call(this)}get outline(){return gt$5.call(this)}get isPopup(){return pt$5.call(this)}async getAvatar(){return _t$4.call(this)}setOutline(vi){return At$1.call(this,vi)}onOutlineUpdated(){return Et$2.call(this)}syncWithPopupAnnotationView(){return wt$3.call(this)}get width(){return vt$2.call(this)}get height(){return yt$2.call(this)}set isAlwaysShow(vi){return bt$2.call(this,vi)}get isAlwaysShow(){return St$3.call(this)}set isAlwaysShowControlBar(vi){return Tt$2.call(this,vi)}get isAlwaysShowControlBar(){return Pt$2.call(this)}get pageInfo(){return Ct$1.call(this)}get viewport(){return It$2.call(this)}get viewportInfo(){return Bt$1.call(this)}move(vi,bi){return Lt$1.call(this,vi,bi)}moveEnd(vi){return Nt$1.call(this,vi)}drawing(vi,bi,_i,$i){return Dt$1.call(this,vi,bi,_i,$i)}async drawingEnd(vi,bi=!0){return Rt$2.call(this,vi,bi)}get isDrawing(){return Ut$1.call(this)}get startPoint(){return zt$1.call(this)}get ctrlBarPoint(){return Ot$1.call(this)}setCtrlBarVisibility(vi=!1){return xt$3.call(this,vi)}setTagVisible(vi=!1){return Vt$1.call(this,vi)}destroy(){return kt$1.call(this)}get focus(){return Ft$1.call(this)}set focus(vi){return Mt$1.call(this,vi)}enableResize(){return Wt$1.call(this)}disableResize(){return Gt$1.call(this)}set locked(vi){return $t$1.call(this,vi)}get locked(){return Ht$1.call(this)}set tags(vi){return jt$1.call(this,vi)}get tags(){return Zt$1.call(this)}addClass(...vi){return qt$2.call(this,vi)}removeClass(...vi){return Jt$1.call(this,vi)}toJSON(){return Yt$1.call(this)}triggerEvent(vi){return Qt$1.call(this,vi)}getParentAnnotationElement(){return Kt$1.call(this)}getPopupAnnotationElement(){return Xt$1.call(this)}checkEditable(vi){return te$2.call(this,vi)}getText(){return ee$2.call(this)}setControlBar(vi){return ie$2.call(this,vi)}};function se$2(){this.locked||this.subtype==="SelectText"||this.events.forEach(yi=>{this.container.addEventListener(yi,_classPrivateFieldGet(this,v$m))})}function I$h(){const{tagUL:yi,width:vi,height:bi}=this,_i=[this.widget.outline[0],this.widget.outline[1]];yi&&(yi.style.setProperty("--top",`${_i[1]}px`),yi.style.setProperty("--left",`${_i[0]}px`),yi.style.setProperty("--width",`${vi}px`),yi.style.setProperty("--height",`${bi}px`))}const L$f=T$m,F$e=["widget"],N$g=["widget-content"];var d$g=new WeakMap,c$m=new WeakMap,C$k=new WeakSet;function q$8(){var yi;return(yi=this.parameters.data.selection)===null||yi===void 0?void 0:yi.pageView}function H$c(){return this.dom.firstChild||this.dom}function K$6(yi){_classPrivateFieldSet(this,c$m,yi),this.dom.dataset.zIndex=String(_classPrivateFieldGet(this,c$m))}function k$j(){return _classPrivateFieldGet(this,c$m)}function $$b(){var yi;return(yi=this.config.allowCrossPageBoundary)!==null&&yi!==void 0?yi:!1}function Z$8(){return this.config.ignoreBorder}function j$a(){var yi;return(yi=this.config.useViewRotation)!==null&&yi!==void 0?yi:!1}function Y$9(){return this.parameters.getPageInfo()}function X$9(){const{viewBox:yi}=this.pageInfo.viewport;return{width:yi[2]-yi[0],height:yi[3]-yi[1]}}function J$c(){let{viewBox:yi,rotation:vi,scale:bi}=this.pageInfo.viewport;this.useViewRotation&&(vi=this.pageInfo.rotation);const[_i,$i,Pi,Ai]=yi,Si=Pi-_i,Ei=Ai-$i;return{width:Si,height:Ei,rotation:vi,scale:bi}}function Q$8(){return this.parameters.data.pageNumber}function tt$7(){return Math.abs(this.outline[2]-this.outline[0])}function et$7(){return Math.abs(this.outline[3]-this.outline[1])}function it$7(){return F$e}function nt$7(){return _classPrivateFieldGet(this,d$g)}function st$7(){return N$g}function rt$7(){if(this.parameters.data.borderStyle){var yi;return(yi=this.parameters.data.borderStyle.width)!==null&&yi!==void 0?yi:2}return 2}function ot$7(){return this.dom.querySelector(".widget-content")}function at$7(){return this.parameters.annotationService.UIEventBus}function lt$6(){return this.parameters.annotationService.getAuthorInfo()}function ht$5(){return this.parameters.data}function ut$6(){return this.config.ctrlKey||!1}function dt$4(){return this.config.altKey||!1}function ct$6(){return this.config.shiftKey||!1}function gt$4(yi){return et$9(yi,0)}async function ft$3(){return[this.outline[0],this.outline[1]]}function _t$3(yi,vi){_classPrivateMethodInitSpec(this,C$k),_defineProperty(this,"destroyed",!1),_defineProperty(this,"isDrawing",!1),_defineProperty(this,"resizeAbility",null),_classPrivateFieldInitSpec(this,d$g,{writable:!0,value:[0,0,0,0]}),_defineProperty(this,"isFrozen",!1),_defineProperty(this,"moving",!1),_classPrivateFieldInitSpec(this,c$m,{writable:!0,value:0}),_defineProperty(this,"editable",!0),this.id=yi.data.id,this.config=vi,this.parameters=yi,_classPrivateFieldSet(this,c$m,yi.zIndex),this.dom=_classPrivateMethodGet(this,C$k,Qt).call(this)}function pt$4(yi){const vi=yi[2]-yi[0],bi=yi[3]-yi[1];return vi!==0&&bi!==0&&(yi=vt$3(this.viewportInfo,yi)),yi.map(_i=>_i*this.pageInfo.viewport.scale)}function mt$3(yi){const vi=this.createContent(yi);return this.svg.append(vi),this.addAttributes(this.dom,yi),this.dom}function vt$1(yi){const vi=M$k("rect",...this.defaultContentClasses),bi=document.createDocumentFragment();return bi.append(vi),bi}function yt$1(yi){const vi={borderWidth:this.borderWidth,dom:this.svg,onDimensionsUpdated:bi=>{this.setOutline(bi)},onResizeDone:()=>{},getContext:()=>({outline:this.outline,resizePoints:L$f})};return yi&&Object.assign(vi,yi),new R$h(vi)}function Wt(yi){this.setOutline(this.parseRect(yi.rect)),this.onOutlineUpdated()}function wt$2(){const yi=this.toData();this.updateByData(yi),this.updateToolbar()}function bt$1(){return!0}function xt$2(yi,vi){this.dom.style.left=`${yi}px`,this.dom.style.top=`${vi}px`}function St$2(yi,vi){this.moving=!0;const[bi,_i,$i,Pi]=_classPrivateFieldGet(this,d$g),Ai=[bi+yi,_i+vi,$i+yi,Pi+vi];this.onUserMove(Ai)}function It$1(yi){this.setOutline(yi)}function Tt$1(yi){this.moving=!1,_classPrivateFieldSet(this,d$g,this.outline)}function Ct(yi){this.updateOutline(yi),this.onOutlineUpdated()}function Pt$1(){var yi;this.moveTo(this.outline[0],this.outline[1]),this.updateViewDimensions(),(yi=this.resizeAbility)!==null&&yi!==void 0&&yi.activated&&this.resizeAbility.updatePoints()}function Dt(yi,vi){this.svg.setAttribute("width",vi),this.svg.setAttribute("height",yi),this.dom.style.height=yi,this.dom.style.width=vi}function Ot(){const yi=this.dom.querySelector(".widget-content");if(!yi)return;let{width:vi}=this;this.ignoreBorder&&(vi+=8,yi.setAttribute("transform","translate(-4, -4)")),yi.setAttribute("width",`${Math.max(0,vi)}`);let{height:bi}=this;this.ignoreBorder&&(bi+=8),yi.setAttribute("height",`${Math.max(0,bi)}`),this.updateContainerSize({width:`${Math.max(1,vi)}px`,height:`${Math.max(1,bi)}px`})}function At(yi,vi){yi.dataset.zIndex=String(_classPrivateFieldGet(this,c$m)),vi.id&&(yi.dataset.id=this.id),this.ignoreBorder&&yi.classList.add("ignoreBorder"),this.applyStyles(yi,vi)}function Bt(yi,vi){if(vi.borderStyle){const{scale:bi}=this.pageInfo.viewport,{style:_i,dashArray:$i,width:Pi}=vi.borderStyle;yi.style.setProperty("--border-width",String(Pi*bi)),_i&&_i===c$q.D&&yi.style.setProperty("--border-dasharray",$i.join(" "))}vi.color&&yi.style.setProperty("--color",this.parseColor(vi.color))}function Et$1(){if(this.editable){var yi;(yi=this.resizeAbility)===null||yi===void 0||yi.enable()}}function zt(){if(this.editable){var yi;(yi=this.resizeAbility)===null||yi===void 0||yi.disable()}}function Rt$1(){const{viewportInfo:yi}=this,{scale:vi}=yi;let bi=this.outline.map(_i=>_i/vi);return bi=vt$3({...yi,rotation:-yi.rotation},bi),bi}function Vt(){this.destroyed=!0,this.dom.remove(),this.eventBus.dispatch(f$k,this)}function Ut(yi){yi=tt$a(yi);let[vi,bi,_i,$i]=yi;if(_classPrivateFieldSet(this,d$g,[vi,bi,_i,$i]),!this.allowCrossPageBoundary){const{currentWidth:Pi,currentHeight:Ai}=this.pageInfo;vi<0&&(_i-=vi,vi=0),bi<0&&($i-=bi,bi=0),_i>Pi&&(vi=Pi-(_i-vi),_i=Pi),$i>Ai&&(bi=Ai-($i-bi),$i=Ai)}this.outline=[vi,bi,_i,$i]}function Mt(yi){this.dom.classList.add(...yi)}function Gt(yi){this.dom.classList.remove(...yi)}function Lt(){this.isDrawing=!0,this.addClass("drawing")}function Ft(){this.isDrawing=!1,this.removeClass("drawing"),_classPrivateFieldSet(this,d$g,this.outline.slice())}function Nt(){this.addClass("locked","frozen"),this.isFrozen=!0}function qt$1(){this.removeClass("locked","frozen"),this.isFrozen=!1}function Ht(){return this.getOutlines()}async function Kt(){const yi=this.getOutlines();if(!yi.length)return"";const vi=[];yi.forEach(_i=>{const $i=this.parameters.pdfPage.selectTextService.convertToPdfRectangle(_i,this.pageInfo);vi.push(this.parameters.pdfPage.selectTextService.getTextInRect($i,this.pageNumber-1))});let bi="";for await(const _i of vi)bi+=_i;return bi}async function kt(){const yi=[];this.outlines.forEach(bi=>{const _i=this.parameters.pdfPage.selectTextService.convertToPdfRectangle(bi,this.pageInfo);yi.push(this.parameters.pdfPage.selectTextService.getTextInRect(_i,this.pageNumber-1))});const vi=[];for await(const bi of yi)vi.push(bi);return vi}function $t(){if(!this.parameters.data.quadPoints)return[];const yi=[],{viewportInfo:vi}=this,{scale:bi}=vi;for(const _i of this.parameters.data.quadPoints){let $i=[_i[0].x,_i[0].y,_i[3].x,_i[3].y];$i=tt$a($i),$i=vt$3(vi,$i),$i=$i.map(Pi=>Pi*bi),yi.push($i)}return yi}function Zt(yi){const vi=[];if(!yi.quadPoints)return[];const bi=yi.annotationType===E$p.StrikeOut,{scale:_i}=this.viewportInfo,{rotation:$i}=this.pageInfo,[Pi,Ai]=this.outline;for(const Si of yi.quadPoints){let[Ei,wi]=[Si[0].x,Si[0].y],[Ci,ki]=[Si[2].x,Si[2].y],[xi,Ti]=[Si[3].x,Si[3].y];[Ei,wi]=Mt$2(this.viewportInfo,[Ei,wi]).map(Li=>Li*_i),[Ci,ki]=Mt$2(this.viewportInfo,[Ci,ki]).map(Li=>Li*_i),[xi,Ti]=Mt$2(this.viewportInfo,[xi,Ti]).map(Li=>Li*_i),bi&&($i===90||$i===270?(Ci-=(Ci-Ei)/2,xi-=(xi-Ei)/2):(ki-=(ki-wi)/2,Ti-=(Ti-wi)/2));const Oi=M$k("line","annotation-line");Oi.setAttribute("x1",String(Ci)),Oi.setAttribute("y1",String(ki)),Oi.setAttribute("x2",String(xi)),Oi.setAttribute("y2",String(Ti)),Oi.setAttribute("transform",`translate(${-Pi},${-Ai})`);const ji=Oi.cloneNode(!0);ji.classList.add("front"),vi.push(Oi,ji)}return vi}function jt(){return{rect:this.getViewBoxRect(),pageNumber:this.pageNumber,subtype:this.parameters.data.subtype,customType:this.parameters.data.customType}}function Yt(){this.eventBus.dispatch(W$m,this)}function Xt(){this.eventBus.dispatch(G$d,this)}function Jt(){this.eventBus.dispatch(y$r,this)}class ue{get pageView(){return q$8.call(this)}get svg(){return H$c.call(this)}set zIndex(vi){return K$6.call(this,vi)}get zIndex(){return k$j.call(this)}get allowCrossPageBoundary(){return $$b.call(this)}get ignoreBorder(){return Z$8.call(this)}get useViewRotation(){return j$a.call(this)}get pageInfo(){return Y$9.call(this)}get viewBoxDimensions(){return X$9.call(this)}get viewportInfo(){return J$c.call(this)}get pageNumber(){return Q$8.call(this)}get width(){return tt$7.call(this)}get height(){return et$7.call(this)}get defaultClasses(){return it$7.call(this)}get prevOutline(){return nt$7.call(this)}get defaultContentClasses(){return st$7.call(this)}get borderWidth(){return rt$7.call(this)}get contentEl(){return ot$7.call(this)}get eventBus(){return at$7.call(this)}get authorInfo(){return lt$6.call(this)}get data(){return ht$5.call(this)}get ctrlKey(){return ut$6.call(this)}get altKey(){return dt$4.call(this)}get shiftKey(){return ct$6.call(this)}parseColor(vi){return gt$4.call(this,vi)}async getToolbarPosition(){return ft$3.call(this)}constructor(vi,bi){return _t$3.call(this,vi,bi)}parseRect(vi){return pt$4.call(this,vi)}createView(vi){return mt$3.call(this,vi)}createContent(vi){return vt$1.call(this,vi)}createResizeAbility(vi){return yt$1.call(this,vi)}updateByData(vi){return Wt.call(this,vi)}update(){return wt$2.call(this)}validate(){return bt$1.call(this)}moveTo(vi,bi){return xt$2.call(this,vi,bi)}move(vi,bi){return St$2.call(this,vi,bi)}onUserMove(vi){return It$1.call(this,vi)}moveEnd(vi){return Tt$1.call(this,vi)}setOutline(vi){return Ct.call(this,vi)}onOutlineUpdated(){return Pt$1.call(this)}updateContainerSize({height:vi,width:bi}){return Dt.call(this,vi,bi)}updateViewDimensions(){return Ot.call(this)}addAttributes(vi,bi){return At.call(this,vi,bi)}applyStyles(vi,bi){return Bt.call(this,vi,bi)}enableResize(){return Et$1.call(this)}disableResize(){return zt.call(this)}getViewBoxRect(){return Rt$1.call(this)}destroy(){return Vt.call(this)}updateOutline(vi){return Ut.call(this,vi)}addClass(...vi){return Mt.call(this,vi)}removeClass(...vi){return Gt.call(this,vi)}handleDrawStart(){return Lt.call(this)}handleDrawEnd(){return Ft.call(this)}freeze(){return Nt.call(this)}unfreeze(){return qt$1.call(this)}get outlines(){return Ht.call(this)}async getText(){return Kt.call(this)}async getOutlinesText(){return kt.call(this)}getOutlines(){return $t.call(this)}createLines(vi){return Zt.call(this,vi)}toData(){return jt.call(this)}hideToolbar(){return Yt.call(this)}showToolbar(){return Xt.call(this)}updateToolbar(){return Jt.call(this)}}function Qt(){const yi=document.createElement("div"),vi=dt$6();return this.defaultClasses.forEach(bi=>{yi.classList.add(bi)}),yi.appendChild(vi),yi}const h$f=10,l$f=10;function c$l(){return F$e.concat("square-widget")}function d$f(yi,vi){_defineProperty(this,"front",M$k("rect","annotation-border","front")),this.initializeByData(yi.data),this.resizeAbility=this.createResizeAbility()}function f$h(){ue.prototype.onOutlineUpdated.call(this);const{width:yi,height:vi}=this;this.front.setAttribute("width",`${Math.max(0,yi)}`),this.front.setAttribute("height",`${Math.max(0,vi)}`)}function _$m(yi){this.updateOutline(this.parseRect(yi.rect)),this.createView(yi),this.onOutlineUpdated()}function p$g(yi){const vi=ue.prototype.createContent.call(this,yi);return vi.append(this.front),vi}function g$j(yi,vi,bi,_i){this.setOutline([yi,vi,bi,_i])}function m$r(){const{outline:yi}=this,vi=yi[2]-yi[0],bi=yi[3]-yi[1];return!(Math.abs(vi)yi.removeEventListener(vi,bi,_i)}function attr(yi,vi,bi){bi==null?yi.removeAttribute(vi):yi.getAttribute(vi)!==bi&&yi.setAttribute(vi,bi)}function children(yi){return Array.from(yi.childNodes)}function set_data(yi,vi){vi=""+vi,yi.data!==vi&&(yi.data=vi)}function set_input_value(yi,vi){yi.value=vi==null?"":vi}function set_style(yi,vi,bi,_i){bi==null?yi.style.removeProperty(vi):yi.style.setProperty(vi,bi,_i?"important":"")}function toggle_class(yi,vi,bi){yi.classList[bi?"add":"remove"](vi)}function custom_event(yi,vi,{bubbles:bi=!1,cancelable:_i=!1}={}){const $i=document.createEvent("CustomEvent");return $i.initCustomEvent(yi,bi,_i,vi),$i}let current_component;function set_current_component(yi){current_component=yi}function get_current_component(){if(!current_component)throw new Error("Function called outside component initialization");return current_component}function onMount(yi){get_current_component().$$.on_mount.push(yi)}function createEventDispatcher(){const yi=get_current_component();return(vi,bi,{cancelable:_i=!1}={})=>{const $i=yi.$$.callbacks[vi];if($i){const Pi=custom_event(vi,bi,{cancelable:_i});return $i.slice().forEach(Ai=>{Ai.call(yi,Pi)}),!Pi.defaultPrevented}return!0}}const dirty_components=[],binding_callbacks=[];let render_callbacks=[];const flush_callbacks=[],resolved_promise=Promise.resolve();let update_scheduled=!1;function schedule_update(){update_scheduled||(update_scheduled=!0,resolved_promise.then(flush))}function tick(){return schedule_update(),resolved_promise}function add_render_callback(yi){render_callbacks.push(yi)}const seen_callbacks=new Set;let flushidx=0;function flush(){if(flushidx!==0)return;const yi=current_component;do{try{for(;flushidxyi.indexOf(_i)===-1?vi.push(_i):bi.push(_i)),bi.forEach(_i=>_i()),render_callbacks=vi}const outroing=new Set;let outros;function group_outros(){outros={r:0,c:[],p:outros}}function check_outros(){outros.r||run_all(outros.c),outros=outros.p}function transition_in(yi,vi){yi&&yi.i&&(outroing.delete(yi),yi.i(vi))}function transition_out(yi,vi,bi,_i){if(yi&&yi.o){if(outroing.has(yi))return;outroing.add(yi),outros.c.push(()=>{outroing.delete(yi),_i&&(bi&&yi.d(1),_i())}),yi.o(vi)}else _i&&_i()}function outro_and_destroy_block(yi,vi){transition_out(yi,1,1,()=>{vi.delete(yi.key)})}function update_keyed_each(yi,vi,bi,_i,$i,Pi,Ai,Si,Ei,wi,Ci,ki){let xi=yi.length,Ti=Pi.length,Oi=xi;const ji={};for(;Oi--;)ji[yi[Oi].key]=Oi;const Li=[],Ii=new Map,Mi=new Map,Fi=[];for(Oi=Ti;Oi--;){const Ni=ki($i,Pi,Oi),Wi=bi(Ni);let zi=Ai.get(Wi);zi?_i&&Fi.push(()=>zi.p(Ni,vi)):(zi=wi(Wi,Ni),zi.c()),Ii.set(Wi,Li[Oi]=zi),Wi in ji&&Mi.set(Wi,Math.abs(Oi-ji[Wi]))}const Bi=new Set,Ri=new Set;function Vi(Ni){transition_in(Ni,1),Ni.m(Si,Ci),Ai.set(Ni.key,Ni),Ci=Ni.first,Ti--}for(;xi&&Ti;){const Ni=Li[Ti-1],Wi=yi[xi-1],zi=Ni.key,Di=Wi.key;Ni===Wi?(Ci=Ni.first,xi--,Ti--):Ii.has(Di)?!Ai.has(zi)||Bi.has(zi)?Vi(Ni):Ri.has(Di)?xi--:Mi.get(zi)>Mi.get(Di)?(Ri.add(zi),Vi(Ni)):(Bi.add(Di),xi--):(Ei(Wi,Ai),xi--)}for(;xi--;){const Ni=yi[xi];Ii.has(Ni.key)||Ei(Ni,Ai)}for(;Ti;)Vi(Li[Ti-1]);return run_all(Fi),Li}function get_spread_update(yi,vi){const bi={},_i={},$i={$$scope:1};let Pi=yi.length;for(;Pi--;){const Ai=yi[Pi],Si=vi[Pi];if(Si){for(const Ei in Ai)Ei in Si||(_i[Ei]=1);for(const Ei in Si)$i[Ei]||(bi[Ei]=Si[Ei],$i[Ei]=1);yi[Pi]=Si}else for(const Ei in Ai)$i[Ei]=1}for(const Ai in _i)Ai in bi||(bi[Ai]=void 0);return bi}function get_spread_object(yi){return typeof yi=="object"&&yi!==null?yi:{}}function create_component(yi){yi&&yi.c()}function mount_component(yi,vi,bi,_i){const{fragment:$i,after_update:Pi}=yi.$$;$i&&$i.m(vi,bi),_i||add_render_callback(()=>{const Ai=yi.$$.on_mount.map(run).filter(is_function);yi.$$.on_destroy?yi.$$.on_destroy.push(...Ai):run_all(Ai),yi.$$.on_mount=[]}),Pi.forEach(add_render_callback)}function destroy_component(yi,vi){const bi=yi.$$;bi.fragment!==null&&(flush_render_callbacks(bi.after_update),run_all(bi.on_destroy),bi.fragment&&bi.fragment.d(vi),bi.on_destroy=bi.fragment=null,bi.ctx=[])}function make_dirty(yi,vi){yi.$$.dirty[0]===-1&&(dirty_components.push(yi),schedule_update(),yi.$$.dirty.fill(0)),yi.$$.dirty[vi/31|0]|=1<{const Oi=Ti.length?Ti[0]:xi;return wi.ctx&&$i(wi.ctx[ki],wi.ctx[ki]=Oi)&&(!wi.skip_bound&&wi.bound[ki]&&wi.bound[ki](Oi),Ci&&make_dirty(yi,ki)),xi}):[],wi.update(),Ci=!0,run_all(wi.before_update),wi.fragment=_i?_i(wi.ctx):!1,vi.target){if(vi.hydrate){const ki=children(vi.target);wi.fragment&&wi.fragment.l(ki),ki.forEach(detach)}else wi.fragment&&wi.fragment.c();vi.intro&&transition_in(yi.$$.fragment),mount_component(yi,vi.target,vi.anchor,vi.customElement),flush()}set_current_component(Ei)}class SvelteComponent{$destroy(){destroy_component(this,1),this.$destroy=noop}$on(vi,bi){if(!is_function(bi))return noop;const _i=this.$$.callbacks[vi]||(this.$$.callbacks[vi]=[]);return _i.push(bi),()=>{const $i=_i.indexOf(bi);$i!==-1&&_i.splice($i,1)}}$set(vi){this.$$set&&!is_empty(vi)&&(this.$$.skip_bound=!0,this.$$set(vi),this.$$.skip_bound=!1)}}var dayjs_minExports={},dayjs_min={get exports(){return dayjs_minExports},set exports(yi){dayjs_minExports=yi}};(function(yi,vi){(function(bi,_i){yi.exports=_i()})(commonjsGlobal,function(){var bi=1e3,_i=6e4,$i=36e5,Pi="millisecond",Ai="second",Si="minute",Ei="hour",wi="day",Ci="week",ki="month",xi="quarter",Ti="year",Oi="date",ji="Invalid Date",Li=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,Ii=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,Mi={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(qi){var Gi=["th","st","nd","rd"],Ki=qi%100;return"["+qi+(Gi[(Ki-20)%10]||Gi[Ki]||Gi[0])+"]"}},Fi=function(qi,Gi,Ki){var Qi=String(qi);return!Qi||Qi.length>=Gi?qi:""+Array(Gi+1-Qi.length).join(Ki)+qi},Bi={s:Fi,z:function(qi){var Gi=-qi.utcOffset(),Ki=Math.abs(Gi),Qi=Math.floor(Ki/60),Xi=Ki%60;return(Gi<=0?"+":"-")+Fi(Qi,2,"0")+":"+Fi(Xi,2,"0")},m:function qi(Gi,Ki){if(Gi.date()1)return qi(ar[0])}else{var gr=Gi.name;Vi[gr]=Gi,Xi=gr}return!Qi&&Xi&&(Ri=Xi),Xi||!Qi&&Ri},zi=function(qi,Gi){if(Ni(qi))return qi.clone();var Ki=typeof Gi=="object"?Gi:{};return Ki.date=qi,Ki.args=arguments,new Ui(Ki)},Di=Bi;Di.l=Wi,Di.i=Ni,Di.w=function(qi,Gi){return zi(qi,{locale:Gi.$L,utc:Gi.$u,x:Gi.$x,$offset:Gi.$offset})};var Ui=function(){function qi(Ki){this.$L=Wi(Ki.locale,null,!0),this.parse(Ki)}var Gi=qi.prototype;return Gi.parse=function(Ki){this.$d=function(Qi){var Xi=Qi.date,rr=Qi.utc;if(Xi===null)return new Date(NaN);if(Di.u(Xi))return new Date;if(Xi instanceof Date)return new Date(Xi);if(typeof Xi=="string"&&!/Z$/i.test(Xi)){var ar=Xi.match(Li);if(ar){var gr=ar[2]-1||0,fr=(ar[7]||"0").substring(0,3);return rr?new Date(Date.UTC(ar[1],gr,ar[3]||1,ar[4]||0,ar[5]||0,ar[6]||0,fr)):new Date(ar[1],gr,ar[3]||1,ar[4]||0,ar[5]||0,ar[6]||0,fr)}}return new Date(Xi)}(Ki),this.$x=Ki.x||{},this.init()},Gi.init=function(){var Ki=this.$d;this.$y=Ki.getFullYear(),this.$M=Ki.getMonth(),this.$D=Ki.getDate(),this.$W=Ki.getDay(),this.$H=Ki.getHours(),this.$m=Ki.getMinutes(),this.$s=Ki.getSeconds(),this.$ms=Ki.getMilliseconds()},Gi.$utils=function(){return Di},Gi.isValid=function(){return this.$d.toString()!==ji},Gi.isSame=function(Ki,Qi){var Xi=zi(Ki);return this.startOf(Qi)<=Xi&&Xi<=this.endOf(Qi)},Gi.isAfter=function(Ki,Qi){return zi(Ki)