/*! For license information please see document_pdfjs.js.LICENSE.txt */
(()=>{var __webpack_modules__={902:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(469),i={assetsPath:"/plugins/web-gallery/assets",api:{baseUrl:"/web-gallery",basePath:"",ajaxSetup:{accept:"application/json",contentType:"application/json",async:!0,cache:!1,dataType:"json",complete:function(){},error:function(e,t,n){var r;return console.log("ajax failed",e,t,n),(e.getResponseHeader("content-type")||"").indexOf("json")>-1&&(r=$.parseJSON(e.responseText)),r}}}},s=window.envConfiguration;void 0!==s&&(i=r.extend(i,s)),t.default=i},82:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var s=n(788),a=n(902),o=null,l=function(e){function t(){var t=e.call(this,a.default)||this;return o||(o=t),o}return i(t,e),t}(s.default);t.default=l},788:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(469),i=function(){function e(e){this.configuration=e}return e.prototype.get=function(e){if(void 0!==e){var t=this._findKeyValue(e||this.configuration);return"string"==typeof t?t:t||null}return this.configuration},e.prototype.set=function(e,t){void 0!==e&&(this.configuration[e]=t)},e.prototype._findKeyValue=function(e){if(e){var t=r.isString(e),n=t?e:e.name;if(e.indexOf(".")>0)return this._search(this.configuration,n);var i=this.configuration[n];return i&&(t||!t&&i===e)||t?i:void 0}},e.prototype._search=function(e,t){if(r.isNumber(t)&&(t=[t]),r.isEmpty(t))return e;if(r.isEmpty(e))return null;if(r.isString(t))return this._search(e,t.split("."));var n=t[0];return 1===t.length?void 0===e[n]?null:e[n]:this._search(e[n],t.slice(1))},e}();t.default=i},521:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0}),n(762);var s=n(299),a=n(963),o=a.NullL10n;s.GlobalWorkerOptions.workerSrc="/assets/vendors/alchemy-embed-medias/pdf.worker.js";var l=n(469),c=n(82),h=n(517),u=n(821),d=function(){var e=this,t=.25,n=!1;this.configService=new c.default;var d=this,p=document.getElementsByClassName("document-player");this.$documentContainer=p[0],this.$documentContainer.insertAdjacentHTML("afterbegin",h(this.configService.get("resource"))),this.$embedContainer=document.getElementById("embed-content"),this.resourceOriginalWidth=this.configService.get("resource.width"),this.resourceOriginalHeight=this.configService.get("resource.height"),!0!==this.configService.get("isStandalone")&&(this.pymChild=new u.Child({id:"phraseanet-embed-frame",renderCallback:function(e){var t=d.resourceOriginalHeight/d.resourceOriginalWidth,n=e>0?e*t:d.resourceOriginalHeight;d.$embedContainer.style.height=n+"px"}}),this.pymChild.onMessage("shouldResize",(function(t){e.pymChild.sendHeight()})));var g=this.configService.get("resource.url"),f=document.getElementById("viewer"),m=document.getElementById("viewerContainer"),_=document.getElementById("zoomIn"),b=document.getElementById("zoomOut"),y=document.getElementById("reset"),v=document.getElementById("viewFind"),A=document.getElementById("findbar"),S=document.getElementById("findInput"),w=document.getElementById("findNext"),x=document.getElementById("findPrevious"),P=document.getElementById("findMatchCase"),C=document.getElementById("findHighlightAll"),T=document.getElementById("findResultsCount"),k=document.getElementById("findMsg"),L=document.getElementById("presentationMode"),E=new a.EventBus({}),R=new a.PDFLinkService({eventBus:E}),M=new a.PDFFindController({linkService:R,eventBus:E}),F=new a.PDFViewer({container:m,renderer:"canvas",eventBus:E,linkService:R,findController:M,l10n:void 0});function I(){var e=window.document,t=e.webkitIsFullScreen||e.mozFullScreen||e.msFullscreenElement;F.currentScaleValue=t?"auto":"page-width"}function D(e,t){M.executeCommand("find"+e,{query:S.value,phraseSearch:!0,caseSensitive:P.checked,highlightAll:C.checked,findPrevious:t})}function N(e){e>=2.5?_.setAttribute("disabled","disabled"):_.removeAttribute("disabled"),e<=t?b.setAttribute("disabled","disabled"):b.removeAttribute("disabled")}function O(){n&&(A.classList.remove("wrapContainers"),A.clientHeight>A.firstElementChild.clientHeight&&A.classList.add("wrapContainers"))}function j(e){T&&(e?(T.textContent=e.toLocaleString(),T.classList.remove("hidden")):T.classList.add("hidden"))}R.setViewer(F),window.addEventListener("resize",l.debounce((function(){void 0!==e.pymChild&&e.pymChild.sendHeight(),F.currentScaleValue="page-width"}),200),!1),E._on("pagesinit",(function(){F.currentScaleValue="page-width",void 0!==e.pymChild&&e.pymChild.sendHeight()})),E._on("updatefindmatchescount",(function(e){j(e.matchesCount.total)})),E._on("updatefindcontrolstate",(function(e){!function(e,t,n){r(this,void 0,void 0,(function(){var r,s,a;return i(this,(function(i){switch(i.label){case 0:switch(r=!1,s="",a="",e){case 0:return[3,1];case 3:return[3,2];case 1:return[3,3];case 2:return[3,5]}return[3,10];case 1:return[3,10];case 2:return a="pending",[3,10];case 3:return[4,o.get("find_not_found")];case 4:return s=i.sent(),r=!0,[3,10];case 5:return t?[4,o.get("find_reached_top")]:[3,7];case 6:return s=i.sent(),[3,9];case 7:return[4,o.get("find_reached_bottom")];case 8:s=i.sent(),i.label=9;case 9:return[3,10];case 10:return r?S.classList.add("notFound"):S.classList.remove("notFound"),S.setAttribute("data-status",a),k.textContent=s,j(n),O(),[2]}}))}))}(e.state,e.previous,e.matchesCount.total)})),_.addEventListener("click",(function(){var e=1.5*F.currentScale;F.currentScale=e>2.5?2.5:e,N(e)})),b.addEventListener("click",(function(){var e=F.currentScale/1.5;F.currentScale=e<t?t:e,N(e)})),y.addEventListener("click",(function(){F.currentScaleValue="page-width",N(F.currentScale)})),v.addEventListener("click",(function(){n?n&&(n=!1,v.classList.remove("toggled"),A.classList.add("hidden")):(n||(n=!0,v.classList.add("toggled"),A.classList.remove("hidden")),null==sessionStorage.getItem("search")&&""===sessionStorage.getItem("search")||!(parent.document.body.getElementsByClassName("documentTips")[0].parentElement.parentElement.getAttribute("class").indexOf("preview_col_cont")>0||parent.document.body.getElementsByClassName("popover-content").length>0)||(S.value=JSON.parse(sessionStorage.getItem("search")),D("",!1)),S.select(),S.focus(),O())})),S.addEventListener("input",(function(){S.value.length>2&&D("",!1)})),w.addEventListener("click",(function(){D("again",!1)})),x.addEventListener("click",(function(){D("again",!0)})),C.addEventListener("click",(function(){D("highlightallchange",!1)})),P.addEventListener("click",(function(){D("casesensitivitychange",!1)})),L.addEventListener("click",(function(){var e;e=f,window.document,e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.msRequestFullscreen&&e.msRequestFullscreen()})),document.addEventListener("webkitfullscreenchange",I,!1),document.addEventListener("mozfullscreenchange",I,!1),document.addEventListener("fullscreenchange",I,!1),document.addEventListener("MSFullscreenChange",I,!1),m.addEventListener("pagesinit",(function(){F.currentScaleValue="page-width"})),s.getDocument(g).promise.then((function(e){console.log("render"),F.setDocument(e),R.setDocument(e),void 0!==d.pymChild&&d.pymChild.sendHeight()}))};t.default=d,window.embedPlugin=new d},299:function(module,__unused_webpack_exports,__webpack_require__){var factory;factory=function(){return(()=>{"use strict";var __webpack_modules__=[,(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.addLinkAttributes=function(e,{url:t,target:n,rel:i,enabled:a=!0}={}){(0,r.assert)(t&&"string"==typeof t,'addLinkAttributes: A valid "url" parameter must provided.');const o=(0,r.removeNullCharacters)(t);a?e.href=e.title=o:(e.href="",e.title=`Disabled: ${o}`,e.onclick=()=>!1);let l="";switch(n){case p.NONE:break;case p.SELF:l="_self";break;case p.BLANK:l="_blank";break;case p.PARENT:l="_parent";break;case p.TOP:l="_top"}e.target=l,e.rel="string"==typeof i?i:s},t.deprecated=function(e){console.log("Deprecated API usage: "+e)},t.getFilenameFromUrl=function(e){const t=e.indexOf("#"),n=e.indexOf("?"),r=Math.min(t>0?t:e.length,n>0?n:e.length);return e.substring(e.lastIndexOf("/",r)+1,r)},t.getPdfFilenameFromUrl=function(e,t="document.pdf"){if("string"!=typeof e)return t;if(g(e))return(0,r.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;const n=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,i=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(e);let s=n.exec(i[1])||n.exec(i[2])||n.exec(i[3]);if(s&&(s=s[0],s.includes("%")))try{s=n.exec(decodeURIComponent(s))[0]}catch(e){}return s||t},t.getXfaPageViewport=function(e,{scale:t=1,rotation:n=0}){const{width:r,height:i}=e.attributes.style,s=[0,0,parseInt(r),parseInt(i)];return new u({viewBox:s,scale:t,rotation:n})},t.isDataScheme=g,t.isPdfFile=function(e){return"string"==typeof e&&/\.pdf$/i.test(e)},t.isValidFetchUrl=f,t.loadScript=function(e,t=!1){return new Promise(((n,r)=>{const i=document.createElement("script");i.src=e,i.onload=function(e){t&&i.remove(),n(e)},i.onerror=function(){r(new Error(`Cannot load script at: ${i.src}`))},(document.head||document.documentElement).appendChild(i)}))},t.StatTimer=t.RenderingCancelledException=t.PDFDateString=t.PageViewport=t.LinkTarget=t.DOMSVGFactory=t.DOMStandardFontDataFactory=t.DOMCMapReaderFactory=t.DOMCanvasFactory=t.DEFAULT_LINK_REL=void 0;var r=n(2),i=n(5);const s="noopener noreferrer nofollow";t.DEFAULT_LINK_REL=s;class a extends i.BaseCanvasFactory{constructor({ownerDocument:e=globalThis.document}={}){super(),this._document=e}_createCanvas(e,t){const n=this._document.createElement("canvas");return n.width=e,n.height=t,n}}async function o(e,t=!1){if(f(e,document.baseURI)){const n=await fetch(e);if(!n.ok)throw new Error(n.statusText);return t?new Uint8Array(await n.arrayBuffer()):(0,r.stringToBytes)(await n.text())}return new Promise(((n,i)=>{const s=new XMLHttpRequest;s.open("GET",e,!0),t&&(s.responseType="arraybuffer"),s.onreadystatechange=()=>{if(s.readyState===XMLHttpRequest.DONE){if(200===s.status||0===s.status){let e;if(t&&s.response?e=new Uint8Array(s.response):!t&&s.responseText&&(e=(0,r.stringToBytes)(s.responseText)),e)return void n(e)}i(new Error(s.statusText))}},s.send(null)}))}t.DOMCanvasFactory=a;class l extends i.BaseCMapReaderFactory{_fetchData(e,t){return o(e,this.isCompressed).then((e=>({cMapData:e,compressionType:t})))}}t.DOMCMapReaderFactory=l;class c extends i.BaseStandardFontDataFactory{_fetchData(e){return o(e,!0)}}t.DOMStandardFontDataFactory=c;class h extends i.BaseSVGFactory{_createSVG(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}}t.DOMSVGFactory=h;class u{constructor({viewBox:e,scale:t,rotation:n,offsetX:r=0,offsetY:i=0,dontFlip:s=!1}){this.viewBox=e,this.scale=t,this.rotation=n,this.offsetX=r,this.offsetY=i;const a=(e[2]+e[0])/2,o=(e[3]+e[1])/2;let l,c,h,u,d,p,g,f;switch((n%=360)<0&&(n+=360),n){case 180:l=-1,c=0,h=0,u=1;break;case 90:l=0,c=1,h=1,u=0;break;case 270:l=0,c=-1,h=-1,u=0;break;case 0:l=1,c=0,h=0,u=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}s&&(h=-h,u=-u),0===l?(d=Math.abs(o-e[1])*t+r,p=Math.abs(a-e[0])*t+i,g=Math.abs(e[3]-e[1])*t,f=Math.abs(e[2]-e[0])*t):(d=Math.abs(a-e[0])*t+r,p=Math.abs(o-e[1])*t+i,g=Math.abs(e[2]-e[0])*t,f=Math.abs(e[3]-e[1])*t),this.transform=[l*t,c*t,h*t,u*t,d-l*t*a-h*t*o,p-c*t*a-u*t*o],this.width=g,this.height=f}clone({scale:e=this.scale,rotation:t=this.rotation,offsetX:n=this.offsetX,offsetY:r=this.offsetY,dontFlip:i=!1}={}){return new u({viewBox:this.viewBox.slice(),scale:e,rotation:t,offsetX:n,offsetY:r,dontFlip:i})}convertToViewportPoint(e,t){return r.Util.applyTransform([e,t],this.transform)}convertToViewportRectangle(e){const t=r.Util.applyTransform([e[0],e[1]],this.transform),n=r.Util.applyTransform([e[2],e[3]],this.transform);return[t[0],t[1],n[0],n[1]]}convertToPdfPoint(e,t){return r.Util.applyInverseTransform([e,t],this.transform)}}t.PageViewport=u;class d extends r.BaseException{constructor(e,t){super(e),this.type=t}}t.RenderingCancelledException=d;const p={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};function g(e){const t=e.length;let n=0;for(;n<t&&""===e[n].trim();)n++;return"data:"===e.substring(n,n+5).toLowerCase()}function f(e,t){try{const{protocol:n}=t?new URL(e,t):new URL(e);return"http:"===n||"https:"===n}catch(e){return!1}}let m;t.LinkTarget=p,t.StatTimer=class{constructor(){this.started=Object.create(null),this.times=[]}time(e){e in this.started&&(0,r.warn)(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||(0,r.warn)(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){const e=[];let t=0;for(const e of this.times){const n=e.name;n.length>t&&(t=n.length)}for(const n of this.times){const r=n.end-n.start;e.push(`${n.name.padEnd(t)} ${r}ms\n`)}return e.join("")}},t.PDFDateString=class{static toDateObject(e){if(!e||!(0,r.isString)(e))return null;m||(m=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const t=m.exec(e);if(!t)return null;const n=parseInt(t[1],10);let i=parseInt(t[2],10);i=i>=1&&i<=12?i-1:0;let s=parseInt(t[3],10);s=s>=1&&s<=31?s:1;let a=parseInt(t[4],10);a=a>=0&&a<=23?a:0;let o=parseInt(t[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(t[6],10);l=l>=0&&l<=59?l:0;const c=t[7]||"Z";let h=parseInt(t[8],10);h=h>=0&&h<=23?h:0;let u=parseInt(t[9],10)||0;return u=u>=0&&u<=59?u:0,"-"===c?(a+=h,o+=u):"+"===c&&(a-=h,o-=u),new Date(Date.UTC(n,i,s,a,o,l))}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.arrayByteLength=d,t.arraysToBytes=function(e){const t=e.length;if(1===t&&e[0]instanceof Uint8Array)return e[0];let n=0;for(let r=0;r<t;r++)n+=d(e[r]);let r=0;const i=new Uint8Array(n);for(let n=0;n<t;n++){let t=e[n];t instanceof Uint8Array||(t="string"==typeof t?u(t):new Uint8Array(t));const s=t.byteLength;i.set(t,r),r+=s}return i},t.assert=o,t.bytesToString=function(e){o(null!==e&&"object"==typeof e&&void 0!==e.length,"Invalid argument for bytesToString");const t=e.length,n=8192;if(t<n)return String.fromCharCode.apply(null,e);const r=[];for(let i=0;i<t;i+=n){const s=Math.min(i+n,t),a=e.subarray(i,s);r.push(String.fromCharCode.apply(null,a))}return r.join("")},t.createObjectURL=function(e,t="",n=!1){if(URL.createObjectURL&&!n)return URL.createObjectURL(new Blob([e],{type:t}));const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let i=`data:${t};base64,`;for(let t=0,n=e.length;t<n;t+=3){const s=255&e[t],a=255&e[t+1],o=255&e[t+2];i+=r[s>>2]+r[(3&s)<<4|a>>4]+r[t+1<n?(15&a)<<2|o>>6:64]+r[t+2<n?63&o:64]}return i},t.createPromiseCapability=function(){const e=Object.create(null);let t=!1;return Object.defineProperty(e,"settled",{get:()=>t}),e.promise=new Promise((function(n,r){e.resolve=function(e){t=!0,n(e)},e.reject=function(e){t=!0,r(e)}})),e},t.createValidAbsoluteUrl=function(e,t){if(!e)return null;try{const n=t?new URL(e,t):new URL(e);if(function(e){if(!e)return!1;switch(e.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(n))return n}catch(e){}return null},t.escapeString=function(e){return e.replace(/([()\\\n\r])/g,(e=>"\n"===e?"\\n":"\r"===e?"\\r":`\\${e}`))},t.getModificationDate=function(e=new Date){return[e.getUTCFullYear().toString(),(e.getUTCMonth()+1).toString().padStart(2,"0"),e.getUTCDate().toString().padStart(2,"0"),e.getUTCHours().toString().padStart(2,"0"),e.getUTCMinutes().toString().padStart(2,"0"),e.getUTCSeconds().toString().padStart(2,"0")].join("")},t.getVerbosityLevel=function(){return i},t.info=function(e){i>=r.INFOS&&console.log(`Info: ${e}`)},t.isArrayBuffer=function(e){return"object"==typeof e&&null!==e&&void 0!==e.byteLength},t.isArrayEqual=function(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0},t.isAscii=function(e){return/^[\x00-\x7F]*$/.test(e)},t.isBool=function(e){return"boolean"==typeof e},t.isNum=function(e){return"number"==typeof e},t.isSameOrigin=function(e,t){let n;try{if(n=new URL(e),!n.origin||"null"===n.origin)return!1}catch(e){return!1}const r=new URL(t,n);return n.origin===r.origin},t.isString=function(e){return"string"==typeof e},t.objectFromMap=function(e){const t=Object.create(null);for(const[n,r]of e)t[n]=r;return t},t.objectSize=function(e){return Object.keys(e).length},t.removeNullCharacters=function(e){return"string"!=typeof e?(s("The argument for removeNullCharacters must be a string."),e):e.replace(h,"")},t.setVerbosityLevel=function(e){Number.isInteger(e)&&(i=e)},t.shadow=l,t.string32=function(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)},t.stringToBytes=u,t.stringToPDFString=function(e){const t=e.length,n=[];if("þ"===e[0]&&"ÿ"===e[1])for(let r=2;r<t;r+=2)n.push(String.fromCharCode(e.charCodeAt(r)<<8|e.charCodeAt(r+1)));else if("ÿ"===e[0]&&"þ"===e[1])for(let r=2;r<t;r+=2)n.push(String.fromCharCode(e.charCodeAt(r+1)<<8|e.charCodeAt(r)));else for(let r=0;r<t;++r){const t=_[e.charCodeAt(r)];n.push(t?String.fromCharCode(t):e.charAt(r))}return n.join("")},t.stringToUTF16BEString=function(e){const t=["þÿ"];for(let n=0,r=e.length;n<r;n++){const r=e.charCodeAt(n);t.push(String.fromCharCode(r>>8&255),String.fromCharCode(255&r))}return t.join("")},t.stringToUTF8String=function(e){return decodeURIComponent(escape(e))},t.unreachable=a,t.utf8StringToString=function(e){return unescape(encodeURIComponent(e))},t.warn=s,t.VerbosityLevel=t.Util=t.UNSUPPORTED_FEATURES=t.UnknownErrorException=t.UnexpectedResponseException=t.TextRenderingMode=t.StreamType=t.PermissionFlag=t.PasswordResponses=t.PasswordException=t.PageActionEventType=t.OPS=t.MissingPDFException=t.IsLittleEndianCached=t.IsEvalSupportedCached=t.InvalidPDFException=t.ImageKind=t.IDENTITY_MATRIX=t.FormatError=t.FontType=t.FONT_IDENTITY_MATRIX=t.DocumentActionEventType=t.CMapCompressionType=t.BaseException=t.AnnotationType=t.AnnotationStateModelType=t.AnnotationReviewState=t.AnnotationReplyType=t.AnnotationMarkedState=t.AnnotationFlag=t.AnnotationFieldFlag=t.AnnotationBorderStyleType=t.AnnotationActionEventType=t.AbortException=void 0,n(3),t.IDENTITY_MATRIX=[1,0,0,1,0,0],t.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0],t.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},t.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},t.ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},t.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},t.AnnotationStateModelType={MARKED:"Marked",REVIEW:"Review"},t.AnnotationMarkedState={MARKED:"Marked",UNMARKED:"Unmarked"},t.AnnotationReviewState={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"},t.AnnotationReplyType={GROUP:"Group",REPLY:"R"},t.AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512},t.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},t.AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},t.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"},t.DocumentActionEventType={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"},t.PageActionEventType={O:"PageOpen",C:"PageClose"},t.StreamType={UNKNOWN:"UNKNOWN",FLATE:"FLATE",LZW:"LZW",DCT:"DCT",JPX:"JPX",JBIG:"JBIG",A85:"A85",AHX:"AHX",CCF:"CCF",RLX:"RLX"},t.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 r={ERRORS:0,WARNINGS:1,INFOS:5};t.VerbosityLevel=r,t.CMapCompressionType={NONE:0,BINARY:1,STREAM:2},t.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},t.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"},t.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let i=r.WARNINGS;function s(e){i>=r.WARNINGS&&console.log(`Warning: ${e}`)}function a(e){throw new Error(e)}function o(e,t){e||a(t)}function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!1}),n}const c=function(){function e(t){this.constructor===e&&a("Cannot initialize BaseException."),this.message=t,this.name=this.constructor.name}return e.prototype=new Error,e.constructor=e,e}();t.BaseException=c,t.PasswordException=class extends c{constructor(e,t){super(e),this.code=t}},t.UnknownErrorException=class extends c{constructor(e,t){super(e),this.details=t}},t.InvalidPDFException=class extends c{},t.MissingPDFException=class extends c{},t.UnexpectedResponseException=class extends c{constructor(e,t){super(e),this.status=t}},t.FormatError=class extends c{},t.AbortException=class extends c{};const h=/\x00/g;function u(e){o("string"==typeof e,"Invalid argument for stringToBytes");const t=e.length,n=new Uint8Array(t);for(let r=0;r<t;++r)n[r]=255&e.charCodeAt(r);return n}function d(e){return void 0!==e.length?e.length:(o(void 0!==e.byteLength,"arrayByteLength - invalid argument."),e.byteLength)}const p={get value(){return l(this,"value",function(){const e=new Uint8Array(4);return e[0]=1,1===new Uint32Array(e.buffer,0,1)[0]}())}};t.IsLittleEndianCached=p;const g={get value(){return l(this,"value",function(){try{return new Function(""),!0}catch(e){return!1}}())}};t.IsEvalSupportedCached=g;const f=[...Array(256).keys()].map((e=>e.toString(16).padStart(2,"0")));class m{static makeHexColor(e,t,n){return`#${f[e]}${f[t]}${f[n]}`}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static applyTransform(e,t){return[e[0]*t[0]+e[1]*t[2]+t[4],e[0]*t[1]+e[1]*t[3]+t[5]]}static applyInverseTransform(e,t){const n=t[0]*t[3]-t[1]*t[2];return[(e[0]*t[3]-e[1]*t[2]+t[2]*t[5]-t[4]*t[3])/n,(-e[0]*t[1]+e[1]*t[0]+t[4]*t[1]-t[5]*t[0])/n]}static getAxialAlignedBoundingBox(e,t){const n=m.applyTransform(e,t),r=m.applyTransform(e.slice(2,4),t),i=m.applyTransform([e[0],e[3]],t),s=m.applyTransform([e[2],e[1]],t);return[Math.min(n[0],r[0],i[0],s[0]),Math.min(n[1],r[1],i[1],s[1]),Math.max(n[0],r[0],i[0],s[0]),Math.max(n[1],r[1],i[1],s[1])]}static inverseTransform(e){const t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static apply3dTransform(e,t){return[e[0]*t[0]+e[1]*t[1]+e[2]*t[2],e[3]*t[0]+e[4]*t[1]+e[5]*t[2],e[6]*t[0]+e[7]*t[1]+e[8]*t[2]]}static singularValueDecompose2dScale(e){const t=[e[0],e[2],e[1],e[3]],n=e[0]*t[0]+e[1]*t[2],r=e[0]*t[1]+e[1]*t[3],i=e[2]*t[0]+e[3]*t[2],s=e[2]*t[1]+e[3]*t[3],a=(n+s)/2,o=Math.sqrt((n+s)**2-4*(n*s-i*r))/2,l=a+o||1,c=a-o||1;return[Math.sqrt(l),Math.sqrt(c)]}static normalizeRect(e){const t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){function n(e,t){return e-t}const r=[e[0],e[2],t[0],t[2]].sort(n),i=[e[1],e[3],t[1],t[3]].sort(n),s=[];return e=m.normalizeRect(e),t=m.normalizeRect(t),r[0]===e[0]&&r[1]===t[0]||r[0]===t[0]&&r[1]===e[0]?(s[0]=r[1],s[2]=r[2],i[0]===e[1]&&i[1]===t[1]||i[0]===t[1]&&i[1]===e[1]?(s[1]=i[1],s[3]=i[2],s):null):null}}t.Util=m;const _=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364]},(e,t,n)=>{n(4)},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isNodeJS=void 0;const n=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type);t.isNodeJS=n},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseSVGFactory=t.BaseStandardFontDataFactory=t.BaseCMapReaderFactory=t.BaseCanvasFactory=void 0;var r=n(2);class i{constructor(){this.constructor===i&&(0,r.unreachable)("Cannot initialize BaseCanvasFactory.")}create(e,t){if(e<=0||t<=0)throw new Error("Invalid canvas size");const n=this._createCanvas(e,t);return{canvas:n,context:n.getContext("2d")}}reset(e,t,n){if(!e.canvas)throw new Error("Canvas is not specified");if(t<=0||n<=0)throw new Error("Invalid canvas size");e.canvas.width=t,e.canvas.height=n}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,t){(0,r.unreachable)("Abstract method `_createCanvas` called.")}}t.BaseCanvasFactory=i;class s{constructor({baseUrl:e=null,isCompressed:t=!1}){this.constructor===s&&(0,r.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=e,this.isCompressed=t}async fetch({name:e}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!e)throw new Error("CMap name must be specified.");const t=this.baseUrl+e+(this.isCompressed?".bcmap":""),n=this.isCompressed?r.CMapCompressionType.BINARY:r.CMapCompressionType.NONE;return this._fetchData(t,n).catch((e=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${t}`)}))}_fetchData(e,t){(0,r.unreachable)("Abstract method `_fetchData` called.")}}t.BaseCMapReaderFactory=s;class a{constructor({baseUrl:e=null}){this.constructor===a&&(0,r.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!e)throw new Error("Font filename must be specified.");const t=`${this.baseUrl}${e}`;return this._fetchData(t).catch((e=>{throw new Error(`Unable to load font data at: ${t}`)}))}_fetchData(e){(0,r.unreachable)("Abstract method `_fetchData` called.")}}t.BaseStandardFontDataFactory=a;class o{constructor(){this.constructor===o&&(0,r.unreachable)("Cannot initialize BaseSVGFactory.")}create(e,t){if(e<=0||t<=0)throw new Error("Invalid SVG dimensions");const n=this._createSVG("svg:svg");return n.setAttribute("version","1.1"),n.setAttribute("width",`${e}px`),n.setAttribute("height",`${t}px`),n.setAttribute("preserveAspectRatio","none"),n.setAttribute("viewBox",`0 0 ${e} ${t}`),n}createElement(e){if("string"!=typeof e)throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){(0,r.unreachable)("Abstract method `_createSVG` called.")}}t.BaseSVGFactory=o},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.getDocument=getDocument,exports.setPDFNetworkStreamFactory=setPDFNetworkStreamFactory,exports.version=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultCMapReaderFactory=exports.DefaultCanvasFactory=exports.build=void 0;var _util=__w_pdfjs_require__(2),_display_utils=__w_pdfjs_require__(1),_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__(4),_message_handler=__w_pdfjs_require__(13),_metadata=__w_pdfjs_require__(14),_optional_content_config=__w_pdfjs_require__(15),_transport_stream=__w_pdfjs_require__(16);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;let createPDFNetworkStream;function setPDFNetworkStreamFactory(e){createPDFNetworkStream=e}function getDocument(e){const t=new PDFDocumentLoadingTask;let n;if("string"==typeof e||e instanceof URL)n={url:e};else if((0,_util.isArrayBuffer)(e))n={data:e};else if(e instanceof PDFDataRangeTransport)n={range:e};else{if("object"!=typeof e)throw new Error("Invalid parameter in getDocument, need either string, URL, Uint8Array, or parameter object.");if(!e.url&&!e.data&&!e.range)throw new Error("Invalid parameter object: need either .data, .range or .url");n=e}const r=Object.create(null);let i=null,s=null;for(const e in n){const t=n[e];switch(e){case"url":if("undefined"!=typeof window)try{r[e]=new URL(t,window.location).href;continue}catch(e){(0,_util.warn)(`Cannot create valid URL: "${e}".`)}else if("string"==typeof t||t instanceof URL){r[e]=t.toString();continue}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.");case"range":i=t;continue;case"worker":s=t;continue;case"data":if(_is_node.isNodeJS&&"undefined"!=typeof Buffer&&t instanceof Buffer)r[e]=new Uint8Array(t);else{if(t instanceof Uint8Array)break;if("string"==typeof t)r[e]=(0,_util.stringToBytes)(t);else if("object"!=typeof t||null===t||isNaN(t.length)){if(!(0,_util.isArrayBuffer)(t))throw new Error("Invalid PDF binary data: either typed array, string, or array-like object is expected in the data property.");r[e]=new Uint8Array(t)}else r[e]=new Uint8Array(t)}continue}r[e]=t}if(r.rangeChunkSize=r.rangeChunkSize||DEFAULT_RANGE_CHUNK_SIZE,r.CMapReaderFactory=r.CMapReaderFactory||DefaultCMapReaderFactory,r.StandardFontDataFactory=r.StandardFontDataFactory||DefaultStandardFontDataFactory,r.ignoreErrors=!0!==r.stopAtErrors,r.fontExtraProperties=!0===r.fontExtraProperties,r.pdfBug=!0===r.pdfBug,r.enableXfa=!0===r.enableXfa,("string"!=typeof r.docBaseUrl||(0,_display_utils.isDataScheme)(r.docBaseUrl))&&(r.docBaseUrl=null),Number.isInteger(r.maxImageSize)||(r.maxImageSize=-1),"boolean"!=typeof r.useWorkerFetch&&(r.useWorkerFetch=r.CMapReaderFactory===_display_utils.DOMCMapReaderFactory&&r.StandardFontDataFactory===_display_utils.DOMStandardFontDataFactory),"boolean"!=typeof r.isEvalSupported&&(r.isEvalSupported=!0),"boolean"!=typeof r.disableFontFace&&(r.disableFontFace=_is_node.isNodeJS),"boolean"!=typeof r.useSystemFonts&&(r.useSystemFonts=!_is_node.isNodeJS&&!r.disableFontFace),void 0===r.ownerDocument&&(r.ownerDocument=globalThis.document),"boolean"!=typeof r.disableRange&&(r.disableRange=!1),"boolean"!=typeof r.disableStream&&(r.disableStream=!1),"boolean"!=typeof r.disableAutoFetch&&(r.disableAutoFetch=!1),(0,_util.setVerbosityLevel)(r.verbosity),!s){const e={verbosity:r.verbosity,port:_worker_options.GlobalWorkerOptions.workerPort};s=e.port?PDFWorker.fromPort(e):new PDFWorker(e),t._worker=s}const a=t.docId;return s.promise.then((function(){if(t.destroyed)throw new Error("Loading aborted");const e=_fetchDocument(s,r,i,a),n=new Promise((function(e){let t;i?t=new _transport_stream.PDFDataTransportStream({length:r.length,initialData:r.initialData,progressiveDone:r.progressiveDone,contentDispositionFilename:r.contentDispositionFilename,disableRange:r.disableRange,disableStream:r.disableStream},i):r.data||(t=createPDFNetworkStream({url:r.url,length:r.length,httpHeaders:r.httpHeaders,withCredentials:r.withCredentials,rangeChunkSize:r.rangeChunkSize,disableRange:r.disableRange,disableStream:r.disableStream})),e(t)}));return Promise.all([e,n]).then((function([e,n]){if(t.destroyed)throw new Error("Loading aborted");const i=new _message_handler.MessageHandler(a,e,s.port);i.postMessageTransfers=s.postMessageTransfers;const o=new WorkerTransport(i,t,n,r);t._transport=o,i.send("Ready",null)}))})).catch(t._capability.reject),t}function _fetchDocument(e,t,n,r){return e.destroyed?Promise.reject(new Error("Worker was destroyed")):(n&&(t.length=n.length,t.initialData=n.initialData,t.progressiveDone=n.progressiveDone,t.contentDispositionFilename=n.contentDispositionFilename),e.messageHandler.sendWithPromise("GetDocRequest",{docId:r,apiVersion:"2.10.377",source:{data:t.data,url:t.url,password:t.password,disableAutoFetch:t.disableAutoFetch,rangeChunkSize:t.rangeChunkSize,length:t.length},maxImageSize:t.maxImageSize,disableFontFace:t.disableFontFace,postMessageTransfers:e.postMessageTransfers,docBaseUrl:t.docBaseUrl,ignoreErrors:t.ignoreErrors,isEvalSupported:t.isEvalSupported,fontExtraProperties:t.fontExtraProperties,enableXfa:t.enableXfa,useSystemFonts:t.useSystemFonts,cMapUrl:t.useWorkerFetch?t.cMapUrl:null,standardFontDataUrl:t.useWorkerFetch?t.standardFontDataUrl:null}).then((function(t){if(e.destroyed)throw new Error("Worker was destroyed");return t})))}exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;const PDFDocumentLoadingTask=function(){let e=0;return class{constructor(){this._capability=(0,_util.createPromiseCapability)(),this._transport=null,this._worker=null,this.docId="d"+e++,this.destroyed=!1,this.onPassword=null,this.onProgress=null,this.onUnsupportedFeature=null}get promise(){return this._capability.promise}destroy(){return this.destroyed=!0,(this._transport?this._transport.destroy():Promise.resolve()).then((()=>{this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}))}}}();class PDFDataRangeTransport{constructor(e,t,n=!1,r=null){this.length=e,this.initialData=t,this.progressiveDone=n,this.contentDispositionFilename=r,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=(0,_util.createPromiseCapability)()}addRangeListener(e){this._rangeListeners.push(e)}addProgressListener(e){this._progressListeners.push(e)}addProgressiveReadListener(e){this._progressiveReadListeners.push(e)}addProgressiveDoneListener(e){this._progressiveDoneListeners.push(e)}onDataRange(e,t){for(const n of this._rangeListeners)n(e,t)}onDataProgress(e,t){this._readyCapability.promise.then((()=>{for(const n of this._progressListeners)n(e,t)}))}onDataProgressiveRead(e){this._readyCapability.promise.then((()=>{for(const t of this._progressiveReadListeners)t(e)}))}onDataProgressiveDone(){this._readyCapability.promise.then((()=>{for(const e of this._progressiveDoneListeners)e()}))}transportReady(){this._readyCapability.resolve()}requestDataRange(e,t){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(e,t){this._pdfInfo=e,this._transport=t,Object.defineProperty(this,"fingerprint",{get(){return(0,_display_utils.deprecated)("`PDFDocumentProxy.fingerprint`, please use `PDFDocumentProxy.fingerprints` instead."),this.fingerprints[0]}})}get annotationStorage(){return this._transport.annotationStorage}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return!!this._transport._htmlForXfa}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJavaScript(){return this._transport.getJavaScript()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}getStats(){return this._transport.getStats()}cleanup(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}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(e,t,n,r,i=!1){this._pageIndex=e,this._pageInfo=t,this._ownerDocument=r,this._transport=n,this._stats=i?new _display_utils.StatTimer:null,this._pdfBug=i,this.commonObjs=n.commonObjs,this.objs=new PDFObjects,this.cleanupAfterRender=!1,this.pendingCleanup=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:e,rotation:t=this.rotate,offsetX:n=0,offsetY:r=0,dontFlip:i=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:e,rotation:t,offsetX:n,offsetY:r,dontFlip:i})}getAnnotations({intent:e=null}={}){const t="display"===e||"print"===e?e:null;return this._annotationsPromise&&this._annotationsIntent===t||(this._annotationsPromise=this._transport.getAnnotations(this._pageIndex,t),this._annotationsIntent=t),this._annotationsPromise}getJSActions(){return this._jsActionsPromise||(this._jsActionsPromise=this._transport.getPageJSActions(this._pageIndex))}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:e,viewport:t,intent:n="display",renderInteractiveForms:r=!1,transform:i=null,imageLayer:s=null,canvasFactory:a=null,background:o=null,includeAnnotationStorage:l=!1,optionalContentConfigPromise:c=null}){var h;this._stats&&this._stats.time("Overall");const u="print"===n?"print":"display";this.pendingCleanup=!1,c||(c=this._transport.getOptionalContentConfig());let d=this._intentStates.get(u);d||(d=Object.create(null),this._intentStates.set(u,d)),d.streamReaderCancelTimeout&&(clearTimeout(d.streamReaderCancelTimeout),d.streamReaderCancelTimeout=null);const p=a||new DefaultCanvasFactory({ownerDocument:this._ownerDocument}),g=l?this._transport.annotationStorage.serializable:null;d.displayReadyCapability||(d.displayReadyCapability=(0,_util.createPromiseCapability)(),d.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList({pageIndex:this._pageIndex,intent:u,renderInteractiveForms:!0===r,annotationStorage:g}));const f=e=>{d.renderTasks.delete(m),(this.cleanupAfterRender||"print"===u)&&(this.pendingCleanup=!0),this._tryCleanup(),e?(m.capability.reject(e),this._abortOperatorList({intentState:d,reason:e})):m.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"))},m=new InternalRenderTask({callback:f,params:{canvasContext:e,viewport:t,transform:i,imageLayer:s,background:o},objs:this.objs,commonObjs:this.commonObjs,operatorList:d.operatorList,pageIndex:this._pageIndex,canvasFactory:p,useRequestAnimationFrame:"print"!==u,pdfBug:this._pdfBug});((h=d).renderTasks||(h.renderTasks=new Set)).add(m);const _=m.task;return Promise.all([d.displayReadyCapability.promise,c]).then((([e,t])=>{this.pendingCleanup?f():(this._stats&&this._stats.time("Rendering"),m.initializeGraphics({transparency:e,optionalContentConfig:t}),m.operatorListChanged())})).catch(f),_}getOperatorList({intent:e="display"}={}){const t="oplist-"+("print"===e?"print":"display");let n,r=this._intentStates.get(t);var i;return r||(r=Object.create(null),this._intentStates.set(t,r)),r.opListReadCapability||(n=Object.create(null),n.operatorListChanged=function(){r.operatorList.lastChunk&&(r.opListReadCapability.resolve(r.operatorList),r.renderTasks.delete(n))},r.opListReadCapability=(0,_util.createPromiseCapability)(),((i=r).renderTasks||(i.renderTasks=new Set)).add(n),r.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList({pageIndex:this._pageIndex,intent:t})),r.opListReadCapability.promise}streamTextContent({normalizeWhitespace:e=!1,disableCombineTextItems:t=!1,includeMarkedContent:n=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,normalizeWhitespace:!0===e,combineTextItems:!0!==t,includeMarkedContent:!0===n},{highWaterMark:100,size:e=>e.items.length})}getTextContent(e={}){const t=this.streamTextContent(e);return new Promise((function(e,n){const r=t.getReader(),i={items:[],styles:Object.create(null)};!function t(){r.read().then((function({value:n,done:r}){r?e(i):(Object.assign(i.styles,n.styles),i.items.push(...n.items),t())}),n)}()}))}getStructTree(){return this._structTreePromise||(this._structTreePromise=this._transport.getStructTree(this._pageIndex))}_destroy(){this.destroyed=!0,this._transport.pageCache[this._pageIndex]=null;const e=[];for(const[t,n]of this._intentStates)if(this._abortOperatorList({intentState:n,reason:new Error("Page was destroyed."),force:!0}),!t.startsWith("oplist-"))for(const t of n.renderTasks)e.push(t.completed),t.cancel();return this.objs.clear(),this._annotationsPromise=null,this._jsActionsPromise=null,this._structTreePromise=null,this.pendingCleanup=!1,Promise.all(e)}cleanup(e=!1){return this.pendingCleanup=!0,this._tryCleanup(e)}_tryCleanup(e=!1){if(!this.pendingCleanup)return!1;for(const{renderTasks:e,operatorList:t}of this._intentStates.values())if(e.size>0||!t.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this._annotationsPromise=null,this._jsActionsPromise=null,this._structTreePromise=null,e&&this._stats&&(this._stats=new _display_utils.StatTimer),this.pendingCleanup=!1,!0}_startRenderPage(e,t){const n=this._intentStates.get(t);n&&(this._stats&&this._stats.timeEnd("Page Request"),n.displayReadyCapability&&n.displayReadyCapability.resolve(e))}_renderPageChunk(e,t){for(let n=0,r=e.length;n<r;n++)t.operatorList.fnArray.push(e.fnArray[n]),t.operatorList.argsArray.push(e.argsArray[n]);t.operatorList.lastChunk=e.lastChunk;for(const e of t.renderTasks)e.operatorListChanged();e.lastChunk&&this._tryCleanup()}_pumpOperatorList(e){(0,_util.assert)(e.intent,'PDFPageProxy._pumpOperatorList: Expected "intent" argument.');const t=this._transport.messageHandler.sendWithStream("GetOperatorList",e).getReader(),n=this._intentStates.get(e.intent);n.streamReader=t;const r=()=>{t.read().then((({value:e,done:t})=>{t?n.streamReader=null:this._transport.destroyed||(this._renderPageChunk(e,n),r())}),(e=>{if(n.streamReader=null,!this._transport.destroyed){if(n.operatorList){n.operatorList.lastChunk=!0;for(const e of n.renderTasks)e.operatorListChanged();this._tryCleanup()}if(n.displayReadyCapability)n.displayReadyCapability.reject(e);else{if(!n.opListReadCapability)throw e;n.opListReadCapability.reject(e)}}}))};r()}_abortOperatorList({intentState:e,reason:t,force:n=!1}){if((0,_util.assert)(t instanceof Error||"object"==typeof t&&null!==t,'PDFPageProxy._abortOperatorList: Expected "reason" argument.'),e.streamReader){if(!n){if(e.renderTasks.size>0)return;if(t instanceof _display_utils.RenderingCancelledException)return void(e.streamReaderCancelTimeout=setTimeout((()=>{this._abortOperatorList({intentState:e,reason:t,force:!0}),e.streamReaderCancelTimeout=null}),RENDERING_CANCELLED_TIMEOUT))}if(e.streamReader.cancel(new _util.AbortException(t?.message)),e.streamReader=null,!this._transport.destroyed){for(const[t,n]of this._intentStates)if(n===e){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){this._listeners=[],this._deferred=Promise.resolve(void 0)}postMessage(e,t){const n=new WeakMap,r={data:function e(r){if("function"==typeof r||"symbol"==typeof r||r instanceof URL)throw new Error(`LoopbackPort.postMessage - cannot clone: ${r?.toString()}`);if("object"!=typeof r||null===r)return r;if(n.has(r))return n.get(r);let i,s;if((i=r.buffer)&&(0,_util.isArrayBuffer)(i))return s=t?.includes(i)?new r.constructor(i,r.byteOffset,r.byteLength):new r.constructor(r),n.set(r,s),s;if(r instanceof Map){s=new Map,n.set(r,s);for(const[t,n]of r)s.set(t,e(n));return s}if(r instanceof Set){s=new Set,n.set(r,s);for(const t of r)s.add(e(t));return s}s=Array.isArray(r)?[]:Object.create(null),n.set(r,s);for(const t in r){let n,i=r;for(;!(n=Object.getOwnPropertyDescriptor(i,t));)i=Object.getPrototypeOf(i);void 0!==n.value&&("function"!=typeof n.value||r.hasOwnProperty?.(t))&&(s[t]=e(n.value))}return s}(e)};this._deferred.then((()=>{for(const e of this._listeners)e.call(this,r)}))}addEventListener(e,t){this._listeners.push(t)}removeEventListener(e,t){const n=this._listeners.indexOf(t);this._listeners.splice(n,1)}terminate(){this._listeners.length=0}}exports.LoopbackPort=LoopbackPort;const PDFWorker=function PDFWorkerClosure(){const pdfWorkerPorts=new WeakMap;let isWorkerDisabled=!1,fallbackWorkerSrc,nextFakeWorkerId=0,fakeWorkerCapability;if(_is_node.isNodeJS)isWorkerDisabled=!0,fallbackWorkerSrc="./pdf.worker.js";else if("object"==typeof document&&"currentScript"in document){const e=document.currentScript?.src;e&&(fallbackWorkerSrc=e.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}function getWorkerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(void 0!==fallbackWorkerSrc)return _is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}function getMainThreadWorkerMessageHandler(){let e;try{e=globalThis.pdfjsWorker?.WorkerMessageHandler}catch(e){}return e||null}function setupFakeWorkerGlobal(){if(fakeWorkerCapability)return fakeWorkerCapability.promise;fakeWorkerCapability=(0,_util.createPromiseCapability)();const loader=async function(){const mainWorkerMessageHandler=getMainThreadWorkerMessageHandler();if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node.isNodeJS){const worker=eval("require")(getWorkerSrc());return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(getWorkerSrc()),window.pdfjsWorker.WorkerMessageHandler};return loader().then(fakeWorkerCapability.resolve,fakeWorkerCapability.reject),fakeWorkerCapability.promise}function createCDNWrapper(e){const t="importScripts('"+e+"');";return URL.createObjectURL(new Blob([t]))}class PDFWorker{constructor({name:e=null,port:t=null,verbosity:n=(0,_util.getVerbosityLevel)()}={}){if(t&&pdfWorkerPorts.has(t))throw new Error("Cannot use more than one PDFWorker per port");if(this.name=e,this.destroyed=!1,this.postMessageTransfers=!0,this.verbosity=n,this._readyCapability=(0,_util.createPromiseCapability)(),this._port=null,this._webWorker=null,this._messageHandler=null,t)return pdfWorkerPorts.set(t,this),void this._initializeFromPort(t);this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(e){this._port=e,this._messageHandler=new _message_handler.MessageHandler("main","worker",e),this._messageHandler.on("ready",(function(){})),this._readyCapability.resolve()}_initialize(){if("undefined"!=typeof Worker&&!isWorkerDisabled&&!getMainThreadWorkerMessageHandler()){let e=getWorkerSrc();try{(0,_util.isSameOrigin)(window.location.href,e)||(e=createCDNWrapper(new URL(e,window.location).href));const t=new Worker(e),n=new _message_handler.MessageHandler("main","worker",t),r=()=>{t.removeEventListener("error",i),n.destroy(),t.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},i=()=>{this._webWorker||r()};t.addEventListener("error",i),n.on("test",(e=>{t.removeEventListener("error",i),this.destroyed?r():e?(this._messageHandler=n,this._port=t,this._webWorker=t,e.supportTransfers||(this.postMessageTransfers=!1),this._readyCapability.resolve(),n.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),n.destroy(),t.terminate())})),n.on("ready",(e=>{if(t.removeEventListener("error",i),this.destroyed)r();else try{s()}catch(e){this._setupFakeWorker()}}));const s=()=>{const e=new Uint8Array([this.postMessageTransfers?255:0]);try{n.send("test",e,[e.buffer])}catch(t){(0,_util.warn)("Cannot use postMessage transfers."),e[0]=0,n.send("test",e)}};return void s()}catch(e){(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),isWorkerDisabled=!0),setupFakeWorkerGlobal().then((e=>{if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));const t=new LoopbackPort;this._port=t;const n="fake"+nextFakeWorkerId++,r=new _message_handler.MessageHandler(n+"_worker",n,t);e.setup(r,t);const i=new _message_handler.MessageHandler(n,n+"_worker",t);this._messageHandler=i,this._readyCapability.resolve(),i.send("configure",{verbosity:this.verbosity})})).catch((e=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${e.message}".`))}))}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),pdfWorkerPorts.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(e){if(!e||!e.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return pdfWorkerPorts.has(e.port)?pdfWorkerPorts.get(e.port):new PDFWorker(e)}static getWorkerSrc(){return getWorkerSrc()}}return PDFWorker}();exports.PDFWorker=PDFWorker;class WorkerTransport{constructor(e,t,n,r){this.messageHandler=e,this.loadingTask=t,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({docId:t.docId,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),ownerDocument:r.ownerDocument,styleElement:r.styleElement}),this._params=r,r.useWorkerFetch||(this.CMapReaderFactory=new r.CMapReaderFactory({baseUrl:r.cMapUrl,isCompressed:r.cMapPacked}),this.StandardFontDataFactory=new r.StandardFontDataFactory({baseUrl:r.standardFontDataUrl})),this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this._networkStream=n,this._fullReader=null,this._lastProgress=null,this.pageCache=[],this.pagePromises=[],this.downloadInfoCapability=(0,_util.createPromiseCapability)(),this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=(0,_util.createPromiseCapability)(),this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const t of this.pageCache)t&&e.push(t._destroy());this.pageCache.length=0,this.pagePromises.length=0,this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const t=this.messageHandler.sendWithPromise("Terminate",null);return e.push(t),Promise.all(e).then((()=>{this.commonObjs.clear(),this.fontLoader.clear(),this._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:e,loadingTask:t}=this;e.on("GetReader",((e,t)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=e=>{this._lastProgress={loaded:e.loaded,total:e.total}},t.onPull=()=>{this._fullReader.read().then((function({value:e,done:n}){n?t.close():((0,_util.assert)((0,_util.isArrayBuffer)(e),"GetReader - expected an ArrayBuffer."),t.enqueue(new Uint8Array(e),1,[e]))})).catch((e=>{t.error(e)}))},t.onCancel=e=>{this._fullReader.cancel(e),t.ready.catch((e=>{if(!this.destroyed)throw e}))}})),e.on("ReaderHeadersReady",(e=>{const n=(0,_util.createPromiseCapability)(),r=this._fullReader;return r.headersReady.then((()=>{r.isStreamingSupported&&r.isRangeSupported||(this._lastProgress&&t.onProgress&&t.onProgress(this._lastProgress),r.onProgress=e=>{t.onProgress&&t.onProgress({loaded:e.loaded,total:e.total})}),n.resolve({isStreamingSupported:r.isStreamingSupported,isRangeSupported:r.isRangeSupported,contentLength:r.contentLength})}),n.reject),n.promise})),e.on("GetRangeReader",((e,t)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const n=this._networkStream.getRangeReader(e.begin,e.end);n?(t.onPull=()=>{n.read().then((function({value:e,done:n}){n?t.close():((0,_util.assert)((0,_util.isArrayBuffer)(e),"GetRangeReader - expected an ArrayBuffer."),t.enqueue(new Uint8Array(e),1,[e]))})).catch((e=>{t.error(e)}))},t.onCancel=e=>{n.cancel(e),t.ready.catch((e=>{if(!this.destroyed)throw e}))}):t.close()})),e.on("GetDoc",(({pdfInfo:e})=>{this._numPages=e.numPages,this._htmlForXfa=e.htmlForXfa,delete e.htmlForXfa,t._capability.resolve(new PDFDocumentProxy(e,this))})),e.on("DocException",(function(e){let n;switch(e.name){case"PasswordException":n=new _util.PasswordException(e.message,e.code);break;case"InvalidPDFException":n=new _util.InvalidPDFException(e.message);break;case"MissingPDFException":n=new _util.MissingPDFException(e.message);break;case"UnexpectedResponseException":n=new _util.UnexpectedResponseException(e.message,e.status);break;case"UnknownErrorException":n=new _util.UnknownErrorException(e.message,e.details)}if(!(n instanceof Error)){const e="DocException - expected a valid Error.";(0,_util.warn)(e)}t._capability.reject(n)})),e.on("PasswordRequest",(e=>{if(this._passwordCapability=(0,_util.createPromiseCapability)(),t.onPassword){const n=e=>{this._passwordCapability.resolve({password:e})};try{t.onPassword(n,e.code)}catch(e){this._passwordCapability.reject(e)}}else this._passwordCapability.reject(new _util.PasswordException(e.message,e.code));return this._passwordCapability.promise})),e.on("DataLoaded",(e=>{t.onProgress&&t.onProgress({loaded:e.length,total:e.length}),this.downloadInfoCapability.resolve(e)})),e.on("StartRenderPage",(e=>{this.destroyed||this.pageCache[e.pageIndex]._startRenderPage(e.transparency,e.intent)})),e.on("commonobj",(t=>{if(this.destroyed)return;const[n,r,i]=t;if(!this.commonObjs.has(n))switch(r){case"Font":const t=this._params;if("error"in i){const e=i.error;(0,_util.warn)(`Error during font loading: ${e}`),this.commonObjs.resolve(n,e);break}let s=null;t.pdfBug&&globalThis.FontInspector?.enabled&&(s={registerFont(e,t){globalThis.FontInspector.fontAdded(e,t)}});const a=new _font_loader.FontFaceObject(i,{isEvalSupported:t.isEvalSupported,disableFontFace:t.disableFontFace,ignoreErrors:t.ignoreErrors,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),fontRegistry:s});this.fontLoader.bind(a).catch((t=>e.sendWithPromise("FontFallback",{id:n}))).finally((()=>{!t.fontExtraProperties&&a.data&&(a.data=null),this.commonObjs.resolve(n,a)}));break;case"FontPath":case"Image":this.commonObjs.resolve(n,i);break;default:throw new Error(`Got unknown common object type ${r}`)}})),e.on("obj",(e=>{if(this.destroyed)return;const[t,n,r,i]=e,s=this.pageCache[n];if(!s.objs.has(t))switch(r){case"Image":s.objs.resolve(t,i);const e=8e6;i?.data?.length>e&&(s.cleanupAfterRender=!0);break;case"Pattern":s.objs.resolve(t,i);break;default:throw new Error(`Got unknown object type ${r}`)}})),e.on("DocProgress",(e=>{this.destroyed||t.onProgress&&t.onProgress({loaded:e.loaded,total:e.total})})),e.on("UnsupportedFeature",this._onUnsupportedFeature.bind(this)),e.on("FetchBuiltInCMap",(e=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.CMapReaderFactory?this.CMapReaderFactory.fetch(e):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.")))),e.on("FetchStandardFontData",(e=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.StandardFontDataFactory?this.StandardFontDataFactory.fetch(e):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter."))))}_onUnsupportedFeature({featureId:e}){this.destroyed||this.loadingTask.onUnsupportedFeature&&this.loadingTask.onUnsupportedFeature(e)}getData(){return this.messageHandler.sendWithPromise("GetData",null)}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request"));const t=e-1;if(t in this.pagePromises)return this.pagePromises[t];const n=this.messageHandler.sendWithPromise("GetPage",{pageIndex:t}).then((e=>{if(this.destroyed)throw new Error("Transport destroyed");const n=new PDFPageProxy(t,e,this,this._params.ownerDocument,this._params.pdfBug);return this.pageCache[t]=n,n}));return this.pagePromises[t]=n,n}getPageIndex(e){return this.messageHandler.sendWithPromise("GetPageIndex",{ref:e}).catch((function(e){return Promise.reject(new Error(e))}))}getAnnotations(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:t})}saveDocument(){return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:this.annotationStorage.serializable,filename:this._fullReader?.filename??null}).finally((()=>{this.annotationStorage.resetModified()}))}getFieldObjects(){return 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(e){return"string"!=typeof e?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getJavaScript(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}getDocJSActions(){return this.messageHandler.sendWithPromise("GetDocJSActions",null)}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then((e=>new _optional_content_config.OptionalContentConfig(e)))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){return this.messageHandler.sendWithPromise("GetMetadata",null).then((e=>({info:e[0],metadata:e[1]?new _metadata.Metadata(e[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null})))}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}getStats(){return this.messageHandler.sendWithPromise("GetStats",null)}async startCleanup(e=!1){if(await this.messageHandler.sendWithPromise("Cleanup",null),!this.destroyed){for(let e=0,t=this.pageCache.length;e<t;e++){const t=this.pageCache[e];if(t&&!t.cleanup())throw new Error(`startCleanup: Page ${e+1} is currently rendering.`)}this.commonObjs.clear(),e||this.fontLoader.clear(),this._hasJSActionsPromise=null}}get loadingParams(){const e=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:e.disableAutoFetch})}}class PDFObjects{constructor(){this._objs=Object.create(null)}_ensureObj(e){return this._objs[e]?this._objs[e]:this._objs[e]={capability:(0,_util.createPromiseCapability)(),data:null,resolved:!1}}get(e,t=null){if(t)return this._ensureObj(e).capability.promise.then(t),null;const n=this._objs[e];if(!n||!n.resolved)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return n.data}has(e){return this._objs[e]?.resolved||!1}resolve(e,t){const n=this._ensureObj(e);n.resolved=!0,n.data=t,n.capability.resolve(t)}clear(){this._objs=Object.create(null)}}class RenderTask{constructor(e){this._internalRenderTask=e,this.onContinue=null}get promise(){return this._internalRenderTask.capability.promise}cancel(){this._internalRenderTask.cancel()}}const InternalRenderTask=function(){const e=new WeakSet;return class{constructor({callback:e,params:t,objs:n,commonObjs:r,operatorList:i,pageIndex:s,canvasFactory:a,useRequestAnimationFrame:o=!1,pdfBug:l=!1}){this.callback=e,this.params=t,this.objs=n,this.commonObjs=r,this.operatorListIdx=null,this.operatorList=i,this._pageIndex=s,this.canvasFactory=a,this._pdfBug=l,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===o&&"undefined"!=typeof window,this.cancelled=!1,this.capability=(0,_util.createPromiseCapability)(),this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=t.canvasContext.canvas}get completed(){return this.capability.promise.catch((function(){}))}initializeGraphics({transparency:t=!1,optionalContentConfig:n}){if(this.cancelled)return;if(this._canvas){if(e.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.");e.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:r,viewport:i,transform:s,imageLayer:a,background:o}=this.params;this.gfx=new _canvas.CanvasGraphics(r,this.commonObjs,this.objs,this.canvasFactory,a,n),this.gfx.beginDrawing({transform:s,viewport:i,transparency:t,background:o}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback&&this.graphicsReadyCallback()}cancel(t=null){this.running=!1,this.cancelled=!0,this.gfx&&this.gfx.endDrawing(),this._canvas&&e.delete(this._canvas),this.callback(t||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&&e.delete(this._canvas),this.callback())))}}}(),version="2.10.377";exports.version=version;const build="156762c48";exports.build=build},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FontLoader=t.FontFaceObject=void 0;var r=n(2);class i{constructor({docId:e,onUnsupportedFeature:t,ownerDocument:n=globalThis.document,styleElement:s=null}){this.constructor===i&&(0,r.unreachable)("Cannot initialize BaseFontLoader."),this.docId=e,this._onUnsupportedFeature=t,this._document=n,this.nativeFontFaces=[],this.styleElement=null}addNativeFontFace(e){this.nativeFontFaces.push(e),this._document.fonts.add(e)}insertRule(e){let t=this.styleElement;t||(t=this.styleElement=this._document.createElement("style"),t.id=`PDFJS_FONT_STYLE_TAG_${this.docId}`,this._document.documentElement.getElementsByTagName("head")[0].appendChild(t));const n=t.sheet;n.insertRule(e,n.cssRules.length)}clear(){for(const e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.length=0,this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async bind(e){if(e.attached||e.missingFile)return;if(e.attached=!0,this.isFontLoadingAPISupported){const t=e.createNativeFontFace();if(t){this.addNativeFontFace(t);try{await t.loaded}catch(n){throw this._onUnsupportedFeature({featureId:r.UNSUPPORTED_FEATURES.errorFontLoadNative}),(0,r.warn)(`Failed to load font '${t.family}': '${n}'.`),e.disableFontFace=!0,n}}return}const t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise((n=>{const r=this._queueLoadingCallback(n);this._prepareFontLoadEvent([t],[e],r)}))}}_queueLoadingCallback(e){(0,r.unreachable)("Abstract method `_queueLoadingCallback`.")}get isFontLoadingAPISupported(){const e=!!this._document?.fonts;return(0,r.shadow)(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){(0,r.unreachable)("Abstract method `isSyncFontLoadingSupported`.")}get _loadTestFont(){(0,r.unreachable)("Abstract method `_loadTestFont`.")}_prepareFontLoadEvent(e,t,n){(0,r.unreachable)("Abstract method `_prepareFontLoadEvent`.")}}let s;t.FontLoader=s,t.FontLoader=s=class extends i{constructor(e){super(e),this.loadingContext={requests:[],nextRequestId:0},this.loadTestFontId=0}get isSyncFontLoadingSupported(){let e=!1;return("undefined"==typeof navigator||/Mozilla\/5.0.*?rv:(\d+).*? Gecko/.exec(navigator.userAgent)?.[1]>=14)&&(e=!0),(0,r.shadow)(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(e){const t=this.loadingContext,n={id:"pdfjs-font-loading-"+t.nextRequestId++,done:!1,complete:function(){for((0,r.assert)(!n.done,"completeRequest() cannot be called twice."),n.done=!0;t.requests.length>0&&t.requests[0].done;){const e=t.requests.shift();setTimeout(e.callback,0)}},callback:e};return t.requests.push(n),n}get _loadTestFont(){return(0,r.shadow)(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}_prepareFontLoadEvent(e,t,n){function i(e,t){return e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|255&e.charCodeAt(t+3)}function s(e,t,n,r){return e.substring(0,t)+r+e.substring(t+n)}let a,o;const l=this._document.createElement("canvas");l.width=1,l.height=1;const c=l.getContext("2d");let h=0;const u=`lt${Date.now()}${this.loadTestFontId++}`;let d=this._loadTestFont;d=s(d,976,u.length,u);const p=1482184792;let g=i(d,16);for(a=0,o=u.length-3;a<o;a+=4)g=g-p+i(u,a)|0;a<u.length&&(g=g-p+i(u+"XXX",a)|0),d=s(d,16,4,(0,r.string32)(g));const f=`@font-face {font-family:"${u}";src:url(data:font/opentype;base64,${btoa(d)});}`;this.insertRule(f);const m=[];for(const e of t)m.push(e.loadedName);m.push(u);const _=this._document.createElement("div");_.style.visibility="hidden",_.style.width=_.style.height="10px",_.style.position="absolute",_.style.top=_.style.left="0px";for(const e of m){const t=this._document.createElement("span");t.textContent="Hi",t.style.fontFamily=e,_.appendChild(t)}this._document.body.appendChild(_),function e(t,n){if(h++,h>30)return(0,r.warn)("Load test font never loaded."),void n();c.font="30px "+t,c.fillText(".",0,20),c.getImageData(0,0,1,1).data[3]>0?n():setTimeout(e.bind(null,t,n))}(u,(()=>{this._document.body.removeChild(_),n.complete()}))}},t.FontFaceObject=class{constructor(e,{isEvalSupported:t=!0,disableFontFace:n=!1,ignoreErrors:r=!1,onUnsupportedFeature:i,fontRegistry:s=null}){this.compiledGlyphs=Object.create(null);for(const t in e)this[t]=e[t];this.isEvalSupported=!1!==t,this.disableFontFace=!0===n,this.ignoreErrors=!0===r,this._onUnsupportedFeature=i,this.fontRegistry=s}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let e;if(this.cssFontInfo){const t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}else e=new FontFace(this.loadedName,this.data,{});return this.fontRegistry&&this.fontRegistry.registerFont(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const e=(0,r.bytesToString)(this.data),t=`url(data:${this.mimetype};base64,${btoa(e)});`;let n;if(this.cssFontInfo){let e=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(e+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),n=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${e}src:${t}}`}else n=`@font-face {font-family:"${this.loadedName}";src:${t}}`;return this.fontRegistry&&this.fontRegistry.registerFont(this,t),n}getPathGenerator(e,t){if(void 0!==this.compiledGlyphs[t])return this.compiledGlyphs[t];let n;try{n=e.get(this.loadedName+"_path_"+t)}catch(e){if(!this.ignoreErrors)throw e;return this._onUnsupportedFeature({featureId:r.UNSUPPORTED_FEATURES.errorFontGetPath}),(0,r.warn)(`getPathGenerator - ignoring character: "${e}".`),this.compiledGlyphs[t]=function(e,t){}}if(this.isEvalSupported&&r.IsEvalSupportedCached.value){const e=[];for(const t of n){const n=void 0!==t.args?t.args.join(","):"";e.push("c.",t.cmd,"(",n,");\n")}return this.compiledGlyphs[t]=new Function("c","size",e.join(""))}return this.compiledGlyphs[t]=function(e,t){for(const r of n)"scale"===r.cmd&&(r.args=[t,-t]),e[r.cmd].apply(e,r.args)}}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeStandardFontDataFactory=t.NodeCMapReaderFactory=t.NodeCanvasFactory=void 0;var r=n(5),i=n(4),s=n(2);let a=class{constructor(){(0,s.unreachable)("Not implemented: NodeCanvasFactory")}};t.NodeCanvasFactory=a;let o=class{constructor(){(0,s.unreachable)("Not implemented: NodeCMapReaderFactory")}};t.NodeCMapReaderFactory=o;let l=class{constructor(){(0,s.unreachable)("Not implemented: NodeStandardFontDataFactory")}};if(t.NodeStandardFontDataFactory=l,i.isNodeJS){const e=function(e){return new Promise(((t,n)=>{__webpack_require__(172).readFile(e,((e,r)=>{!e&&r?t(new Uint8Array(r)):n(new Error(e))}))}))};t.NodeCanvasFactory=a=class extends r.BaseCanvasFactory{_createCanvas(e,t){return __webpack_require__(414).createCanvas(e,t)}},t.NodeCMapReaderFactory=o=class extends r.BaseCMapReaderFactory{_fetchData(t,n){return e(t).then((e=>({cMapData:e,compressionType:n})))}},t.NodeStandardFontDataFactory=l=class extends r.BaseStandardFontDataFactory{_fetchData(t){return e(t)}}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationStorage=void 0;var r=n(2);t.AnnotationStorage=class{constructor(){this._storage=new Map,this._modified=!1,this.onSetModified=null,this.onResetModified=null}getValue(e,t){const n=this._storage.get(e);return void 0!==n?n:t}setValue(e,t){const n=this._storage.get(e);let r=!1;if(void 0!==n)for(const[e,i]of Object.entries(t))n[e]!==i&&(r=!0,n[e]=i);else this._storage.set(e,t),r=!0;r&&this._setModified()}getAll(){return this._storage.size>0?(0,r.objectFromMap)(this._storage):null}get size(){return this._storage.size}_setModified(){this._modified||(this._modified=!0,"function"==typeof this.onSetModified&&this.onSetModified())}resetModified(){this._modified&&(this._modified=!1,"function"==typeof this.onResetModified&&this.onResetModified())}get serializable(){return this._storage.size>0?this._storage:null}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CanvasGraphics=void 0;var r=n(2),i=n(11);const s=4096,a=16;function o(e){if(!e.mozCurrentTransform){e._originalSave=e.save,e._originalRestore=e.restore,e._originalRotate=e.rotate,e._originalScale=e.scale,e._originalTranslate=e.translate,e._originalTransform=e.transform,e._originalSetTransform=e.setTransform,e._originalResetTransform=e.resetTransform,e._transformMatrix=e._transformMatrix||[1,0,0,1,0,0],e._transformStack=[];try{const t=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),"lineWidth");e._setLineWidth=t.set,e._getLineWidth=t.get,Object.defineProperty(e,"lineWidth",{set:function(e){this._setLineWidth(1.000001*e)},get:function(){return this._getLineWidth()}})}catch(e){}Object.defineProperty(e,"mozCurrentTransform",{get:function(){return this._transformMatrix}}),Object.defineProperty(e,"mozCurrentTransformInverse",{get:function(){const[e,t,n,r,i,s]=this._transformMatrix,a=e*r-t*n,o=t*n-e*r;return[r/a,t/o,n/o,e/a,(r*i-n*s)/o,(t*i-e*s)/a]}}),e.save=function(){const e=this._transformMatrix;this._transformStack.push(e),this._transformMatrix=e.slice(0,6),this._originalSave()},e.restore=function(){const e=this._transformStack.pop();e&&(this._transformMatrix=e,this._originalRestore())},e.translate=function(e,t){const n=this._transformMatrix;n[4]=n[0]*e+n[2]*t+n[4],n[5]=n[1]*e+n[3]*t+n[5],this._originalTranslate(e,t)},e.scale=function(e,t){const n=this._transformMatrix;n[0]*=e,n[1]*=e,n[2]*=t,n[3]*=t,this._originalScale(e,t)},e.transform=function(t,n,r,i,s,a){const o=this._transformMatrix;this._transformMatrix=[o[0]*t+o[2]*n,o[1]*t+o[3]*n,o[0]*r+o[2]*i,o[1]*r+o[3]*i,o[0]*s+o[2]*a+o[4],o[1]*s+o[3]*a+o[5]],e._originalTransform(t,n,r,i,s,a)},e.setTransform=function(t,n,r,i,s,a){this._transformMatrix=[t,n,r,i,s,a],e._originalSetTransform(t,n,r,i,s,a)},e.resetTransform=function(){this._transformMatrix=[1,0,0,1,0,0],e._originalResetTransform()},e.rotate=function(e){const t=Math.cos(e),n=Math.sin(e),r=this._transformMatrix;this._transformMatrix=[r[0]*t+r[2]*n,r[1]*t+r[3]*n,r[0]*-n+r[2]*t,r[1]*-n+r[3]*t,r[4],r[5]],this._originalRotate(e)}}}class l{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,t,n,r){let i;return void 0!==this.cache[e]?(i=this.cache[e],this.canvasFactory.reset(i,t,n),i.context.setTransform(1,0,0,1,0,0)):(i=this.canvasFactory.create(t,n),this.cache[e]=i),r&&o(i.context),i}clear(){for(const e in this.cache){const t=this.cache[e];this.canvasFactory.destroy(t),delete this.cache[e]}}}class c{constructor(){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=r.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=r.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=r.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.resumeSMaskCtx=null,this.transferMaps=null}clone(){return Object.create(this)}setCurrentPoint(e,t){this.x=e,this.y=t}}const h=function(){function e(e,t,n=null){if("undefined"!=typeof ImageData&&t instanceof ImageData)return void e.putImageData(t,0,0);const i=t.height,s=t.width,o=i%a,l=(i-o)/a,c=0===o?l:l+1,h=e.createImageData(s,a);let u,d=0;const p=t.data,g=h.data;let f,m,_,b,y,v,A,S;if(n)switch(n.length){case 1:y=n[0],v=n[0],A=n[0],S=n[0];break;case 4:y=n[0],v=n[1],A=n[2],S=n[3]}if(t.kind===r.ImageKind.GRAYSCALE_1BPP){const t=p.byteLength,n=new Uint32Array(g.buffer,0,g.byteLength>>2),i=n.length,b=s+7>>3;let y=4294967295,v=r.IsLittleEndianCached.value?4278190080:255;for(S&&255===S[0]&&0===S[255]&&([y,v]=[v,y]),f=0;f<c;f++){for(_=f<l?a:o,u=0,m=0;m<_;m++){const e=t-d;let r=0;const i=e>b?s:8*e-7,a=-8&i;let o=0,l=0;for(;r<a;r+=8)l=p[d++],n[u++]=128&l?y:v,n[u++]=64&l?y:v,n[u++]=32&l?y:v,n[u++]=16&l?y:v,n[u++]=8&l?y:v,n[u++]=4&l?y:v,n[u++]=2&l?y:v,n[u++]=1&l?y:v;for(;r<i;r++)0===o&&(l=p[d++],o=128),n[u++]=l&o?y:v,o>>=1}for(;u<i;)n[u++]=0;e.putImageData(h,0,f*a)}}else if(t.kind===r.ImageKind.RGBA_32BPP){const t=!!(y||v||A);for(m=0,b=s*a*4,f=0;f<l;f++){if(g.set(p.subarray(d,d+b)),d+=b,t)for(let e=0;e<b;e+=4)y&&(g[e+0]=y[g[e+0]]),v&&(g[e+1]=v[g[e+1]]),A&&(g[e+2]=A[g[e+2]]);e.putImageData(h,0,m),m+=a}if(f<c){if(b=s*o*4,g.set(p.subarray(d,d+b)),t)for(let e=0;e<b;e+=4)y&&(g[e+0]=y[g[e+0]]),v&&(g[e+1]=v[g[e+1]]),A&&(g[e+2]=A[g[e+2]]);e.putImageData(h,0,m)}}else{if(t.kind!==r.ImageKind.RGB_24BPP)throw new Error(`bad image kind: ${t.kind}`);{const t=!!(y||v||A);for(_=a,b=s*_,f=0;f<c;f++){for(f>=l&&(_=o,b=s*_),u=0,m=b;m--;)g[u++]=p[d++],g[u++]=p[d++],g[u++]=p[d++],g[u++]=255;if(t)for(let e=0;e<u;e+=4)y&&(g[e+0]=y[g[e+0]]),v&&(g[e+1]=v[g[e+1]]),A&&(g[e+2]=A[g[e+2]]);e.putImageData(h,0,f*a)}}}}function t(e,t){const n=t.height,r=t.width,i=n%a,s=(n-i)/a,o=0===i?s:s+1,l=e.createImageData(r,a);let c=0;const h=t.data,u=l.data;for(let t=0;t<o;t++){const n=t<s?a:i;let o=3;for(let e=0;e<n;e++){let e,t=0;for(let n=0;n<r;n++)t||(e=h[c++],t=128),u[o]=e&t?0:255,o+=4,t>>=1}e.putImageData(l,0,t*a)}}function n(e,t){const n=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"];for(let r=0,i=n.length;r<i;r++){const i=n[r];void 0!==e[i]&&(t[i]=e[i])}void 0!==e.setLineDash&&(t.setLineDash(e.getLineDash()),t.lineDashOffset=e.lineDashOffset)}function h(e){e.strokeStyle="#000000",e.fillStyle="#000000",e.fillRule="nonzero",e.globalAlpha=1,e.lineWidth=1,e.lineCap="butt",e.lineJoin="miter",e.miterLimit=10,e.globalCompositeOperation="source-over",e.font="10px sans-serif",void 0!==e.setLineDash&&(e.setLineDash([]),e.lineDashOffset=0)}function u(e,t,n,r){const i=e.length;for(let s=3;s<i;s+=4){const i=e[s];if(0===i)e[s-3]=t,e[s-2]=n,e[s-1]=r;else if(i<255){const a=255-i;e[s-3]=e[s-3]*i+t*a>>8,e[s-2]=e[s-2]*i+n*a>>8,e[s-1]=e[s-1]*i+r*a>>8}}}function d(e,t,n){const r=e.length;for(let i=3;i<r;i+=4){const r=n?n[e[i]]:e[i];t[i]=t[i]*r*.00392156862745098|0}}function p(e,t,n){const r=e.length;for(let i=3;i<r;i+=4){const r=77*e[i-3]+152*e[i-2]+28*e[i-1];t[i]=n?t[i]*n[r>>8]>>8:t[i]*r>>16}}function g(e,t,n){const r=t.canvas,i=t.context;e.setTransform(t.scaleX,0,0,t.scaleY,t.offsetX,t.offsetY),function(e,t,n,r,i,s,a){const o=!!s,l=o?s[0]:0,c=o?s[1]:0,h=o?s[2]:0;let g;g="Luminosity"===i?p:d;const f=Math.min(r,Math.ceil(1048576/n));for(let i=0;i<r;i+=f){const s=Math.min(f,r-i),d=e.getImageData(0,i,n,s),p=t.getImageData(0,i,n,s);o&&u(d.data,l,c,h),g(d.data,p.data,a),e.putImageData(p,0,i)}}(i,n,r.width,r.height,t.subtype,t.backdrop,t.transferMap),e.drawImage(r,0,0)}const f=["butt","round","square"],m=["miter","round","bevel"],_={},b={};class y{constructor(e,t,n,r,i,s){this.ctx=e,this.current=new c,this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=t,this.objs=n,this.canvasFactory=r,this.imageLayer=i,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.contentVisible=!0,this.markedContentStack=[],this.optionalContentConfig=s,this.cachedCanvases=new l(this.canvasFactory),this.cachedPatterns=new Map,e&&o(e),this._cachedGetSinglePixelWidth=null}beginDrawing({transform:e,viewport:t,transparency:n=!1,background:r=null}){const i=this.ctx.canvas.width,s=this.ctx.canvas.height;if(this.ctx.save(),this.ctx.fillStyle=r||"rgb(255, 255, 255)",this.ctx.fillRect(0,0,i,s),this.ctx.restore(),n){const e=this.cachedCanvases.getCanvas("transparent",i,s,!0);this.compositeCtx=this.ctx,this.transparentCanvas=e.canvas,this.ctx=e.context,this.ctx.save(),this.ctx.transform.apply(this.ctx,this.compositeCtx.mozCurrentTransform)}this.ctx.save(),h(this.ctx),e&&this.ctx.transform.apply(this.ctx,e),this.ctx.transform.apply(this.ctx,t.transform),this.baseTransform=this.ctx.mozCurrentTransform.slice(),this._combinedScaleFactor=Math.hypot(this.baseTransform[0],this.baseTransform[2]),this.imageLayer&&this.imageLayer.beginLayout()}executeOperatorList(e,t,n,i){const s=e.argsArray,a=e.fnArray;let o=t||0;const l=s.length;if(l===o)return o;const c=l-o>10&&"function"==typeof n,h=c?Date.now()+15:0;let u=0;const d=this.commonObjs,p=this.objs;let g;for(;;){if(void 0!==i&&o===i.nextBreakPoint)return i.breakIt(o,n),o;if(g=a[o],g!==r.OPS.dependency)this[g].apply(this,s[o]);else for(const e of s[o]){const t=e.startsWith("g_")?d:p;if(!t.has(e))return t.get(e,n),o}if(o++,o===l)return o;if(c&&++u>10){if(Date.now()>h)return n(),o;u=0}}}endDrawing(){for(;this.stateStack.length||null!==this.current.activeSMask;)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(e,t){const n=e.width,r=e.height;let i,s,a=Math.max(Math.hypot(t[0],t[1]),1),o=Math.max(Math.hypot(t[2],t[3]),1),l=n,c=r,h="prescale1";for(;a>2&&l>1||o>2&&c>1;){let t=l,n=c;a>2&&l>1&&(t=Math.ceil(l/2),a/=l/t),o>2&&c>1&&(n=Math.ceil(c/2),o/=c/n),i=this.cachedCanvases.getCanvas(h,t,n),s=i.context,s.clearRect(0,0,t,n),s.drawImage(e,0,0,l,c,0,0,t,n),e=i.canvas,l=t,c=n,h="prescale1"===h?"prescale2":"prescale1"}return{img:e,paintWidth:l,paintHeight:c}}_createMaskCanvas(e){const n=this.ctx,i=e.width,s=e.height,a=this.current.fillColor,o=this.current.patternFill,l=this.cachedCanvases.getCanvas("maskCanvas",i,s);t(l.context,e);const c=n.mozCurrentTransform;let h=r.Util.transform(c,[1/i,0,0,-1/s,0,0]);h=r.Util.transform(h,[1,0,0,1,0,-s]);const u=r.Util.applyTransform([0,0],h),d=r.Util.applyTransform([i,s],h),p=r.Util.normalizeRect([u[0],u[1],d[0],d[1]]),g=Math.ceil(p[2]-p[0]),f=Math.ceil(p[3]-p[1]),m=this.cachedCanvases.getCanvas("fillCanvas",g,f,!0),_=m.context,b=Math.min(u[0],d[0]),y=Math.min(u[1],d[1]);_.translate(-b,-y),_.transform.apply(_,h);const v=this._scaleImage(l.canvas,_.mozCurrentTransformInverse);_.drawImage(v.img,0,0,v.img.width,v.img.height,0,0,i,s),_.globalCompositeOperation="source-in";const A=r.Util.transform(_.mozCurrentTransformInverse,[1,0,0,1,-b,-y]);return _.fillStyle=o?a.getPattern(n,this,A,!1):a,_.fillRect(0,0,i,s),{canvas:m.canvas,offsetX:Math.round(b),offsetY:Math.round(y)}}setLineWidth(e){this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(e){this.ctx.lineCap=f[e]}setLineJoin(e){this.ctx.lineJoin=m[e]}setMiterLimit(e){this.ctx.miterLimit=e}setDash(e,t){const n=this.ctx;void 0!==n.setLineDash&&(n.setLineDash(e),n.lineDashOffset=t)}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(let t=0,n=e.length;t<n;t++){const n=e[t],r=n[0],i=n[1];switch(r){case"LW":this.setLineWidth(i);break;case"LC":this.setLineCap(i);break;case"LJ":this.setLineJoin(i);break;case"ML":this.setMiterLimit(i);break;case"D":this.setDash(i[0],i[1]);break;case"RI":this.setRenderingIntent(i);break;case"FL":this.setFlatness(i);break;case"Font":this.setFont(i[0],i[1]);break;case"CA":this.current.strokeAlpha=n[1];break;case"ca":this.current.fillAlpha=n[1],this.ctx.globalAlpha=n[1];break;case"BM":this.ctx.globalCompositeOperation=i;break;case"SMask":this.current.activeSMask&&(this.stateStack.length>0&&this.stateStack[this.stateStack.length-1].activeSMask===this.current.activeSMask?this.suspendSMaskGroup():this.endSMaskGroup()),this.current.activeSMask=i?this.tempSMask:null,this.current.activeSMask&&this.beginSMaskGroup(),this.tempSMask=null;break;case"TR":this.current.transferMaps=i}}}beginSMaskGroup(){const e=this.current.activeSMask,t=e.canvas.width,r=e.canvas.height,i="smaskGroupAt"+this.groupLevel,s=this.cachedCanvases.getCanvas(i,t,r,!0),a=this.ctx,o=a.mozCurrentTransform;this.ctx.save();const l=s.context;l.scale(1/e.scaleX,1/e.scaleY),l.translate(-e.offsetX,-e.offsetY),l.transform.apply(l,o),e.startTransformInverse=l.mozCurrentTransformInverse,n(a,l),this.ctx=l,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(a),this.groupLevel++}suspendSMaskGroup(){const e=this.ctx;this.groupLevel--,this.ctx=this.groupStack.pop(),g(this.ctx,this.current.activeSMask,e),this.ctx.restore(),this.ctx.save(),n(e,this.ctx),this.current.resumeSMaskCtx=e;const t=r.Util.transform(this.current.activeSMask.startTransformInverse,e.mozCurrentTransform);this.ctx.transform.apply(this.ctx,t),e.save(),e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,e.canvas.width,e.canvas.height),e.restore()}resumeSMaskGroup(){const e=this.current.resumeSMaskCtx,t=this.ctx;this.ctx=e,this.groupStack.push(t),this.groupLevel++}endSMaskGroup(){const e=this.ctx;this.groupLevel--,this.ctx=this.groupStack.pop(),g(this.ctx,this.current.activeSMask,e),this.ctx.restore(),n(e,this.ctx);const t=r.Util.transform(this.current.activeSMask.startTransformInverse,e.mozCurrentTransform);this.ctx.transform.apply(this.ctx,t)}save(){this.ctx.save();const e=this.current;this.stateStack.push(e),this.current=e.clone(),this.current.resumeSMaskCtx=null}restore(){this.current.resumeSMaskCtx&&this.resumeSMaskGroup(),null===this.current.activeSMask||0!==this.stateStack.length&&this.stateStack[this.stateStack.length-1].activeSMask===this.current.activeSMask||this.endSMaskGroup(),0!==this.stateStack.length?(this.current=this.stateStack.pop(),this.ctx.restore(),this.pendingClip=null,this._cachedGetSinglePixelWidth=null):this.current.activeSMask=null}transform(e,t,n,r,i,s){this.ctx.transform(e,t,n,r,i,s),this._cachedGetSinglePixelWidth=null}constructPath(e,t){const n=this.ctx,i=this.current;let s=i.x,a=i.y;for(let i=0,o=0,l=e.length;i<l;i++)switch(0|e[i]){case r.OPS.rectangle:s=t[o++],a=t[o++];const e=t[o++],i=t[o++],l=s+e,c=a+i;n.moveTo(s,a),0===e||0===i?n.lineTo(l,c):(n.lineTo(l,a),n.lineTo(l,c),n.lineTo(s,c)),n.closePath();break;case r.OPS.moveTo:s=t[o++],a=t[o++],n.moveTo(s,a);break;case r.OPS.lineTo:s=t[o++],a=t[o++],n.lineTo(s,a);break;case r.OPS.curveTo:s=t[o+4],a=t[o+5],n.bezierCurveTo(t[o],t[o+1],t[o+2],t[o+3],s,a),o+=6;break;case r.OPS.curveTo2:n.bezierCurveTo(s,a,t[o],t[o+1],t[o+2],t[o+3]),s=t[o+2],a=t[o+3],o+=4;break;case r.OPS.curveTo3:s=t[o+2],a=t[o+3],n.bezierCurveTo(t[o],t[o+1],s,a,s,a),o+=4;break;case r.OPS.closePath:n.closePath()}i.setCurrentPoint(s,a)}closePath(){this.ctx.closePath()}stroke(e){e=void 0===e||e;const t=this.ctx,n=this.current.strokeColor;if(t.globalAlpha=this.current.strokeAlpha,this.contentVisible)if("object"==typeof n&&n?.getPattern){const e=this.getSinglePixelWidth();t.save(),t.strokeStyle=n.getPattern(t,this,t.mozCurrentTransformInverse),t.lineWidth=Math.max(e,this.current.lineWidth),t.stroke(),t.restore()}else{const e=this.getSinglePixelWidth();e<0&&-e>=this.current.lineWidth?(t.save(),t.resetTransform(),t.lineWidth=Math.round(this._combinedScaleFactor),t.stroke(),t.restore()):(t.lineWidth=Math.max(e,this.current.lineWidth),t.stroke())}e&&this.consumePath(),t.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(e){e=void 0===e||e;const t=this.ctx,n=this.current.fillColor;let r=!1;this.current.patternFill&&(t.save(),t.fillStyle=n.getPattern(t,this,t.mozCurrentTransformInverse),r=!0),this.contentVisible&&(this.pendingEOFill?(t.fill("evenodd"),this.pendingEOFill=!1):t.fill()),r&&t.restore(),e&&this.consumePath()}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=_}eoClip(){this.pendingClip=b}beginText(){this.current.textMatrix=r.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const e=this.pendingTextPaths,t=this.ctx;if(void 0!==e){t.save(),t.beginPath();for(let n=0;n<e.length;n++){const r=e[n];t.setTransform.apply(t,r.transform),t.translate(r.x,r.y),r.addToPath(t,r.fontSize)}t.restore(),t.clip(),t.beginPath(),delete this.pendingTextPaths}else t.beginPath()}setCharSpacing(e){this.current.charSpacing=e}setWordSpacing(e){this.current.wordSpacing=e}setHScale(e){this.current.textHScale=e/100}setLeading(e){this.current.leading=-e}setFont(e,t){const n=this.commonObjs.get(e),i=this.current;if(!n)throw new Error(`Can't find font for ${e}`);if(i.fontMatrix=n.fontMatrix||r.FONT_IDENTITY_MATRIX,0!==i.fontMatrix[0]&&0!==i.fontMatrix[3]||(0,r.warn)("Invalid font matrix for font "+e),t<0?(t=-t,i.fontDirection=-1):i.fontDirection=1,this.current.font=n,this.current.fontSize=t,n.isType3Font)return;const s=n.loadedName||"sans-serif";let a="normal";n.black?a="900":n.bold&&(a="bold");const o=n.italic?"italic":"normal",l=`"${s}", ${n.fallbackName}`;let c=t;t<16?c=16:t>100&&(c=100),this.current.fontSizeScale=t/c,this.ctx.font=`${o} ${a} ${c}px ${l}`}setTextRenderingMode(e){this.current.textRenderingMode=e}setTextRise(e){this.current.textRise=e}moveText(e,t){this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=t}setLeadingMoveText(e,t){this.setLeading(-t),this.moveText(e,t)}setTextMatrix(e,t,n,r,i,s){this.current.textMatrix=[e,t,n,r,i,s],this.current.textMatrixScale=Math.hypot(e,t),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(e,t,n,i,s){const a=this.ctx,o=this.current,l=o.font,c=o.textRenderingMode,h=o.fontSize/o.fontSizeScale,u=c&r.TextRenderingMode.FILL_STROKE_MASK,d=!!(c&r.TextRenderingMode.ADD_TO_PATH_FLAG),p=o.patternFill&&!l.missingFile;let g;(l.disableFontFace||d||p)&&(g=l.getPathGenerator(this.commonObjs,e)),l.disableFontFace||p?(a.save(),a.translate(t,n),a.beginPath(),g(a,h),i&&a.setTransform.apply(a,i),u!==r.TextRenderingMode.FILL&&u!==r.TextRenderingMode.FILL_STROKE||a.fill(),u!==r.TextRenderingMode.STROKE&&u!==r.TextRenderingMode.FILL_STROKE||(s&&(a.resetTransform(),a.lineWidth=Math.round(this._combinedScaleFactor)),a.stroke()),a.restore()):(u!==r.TextRenderingMode.FILL&&u!==r.TextRenderingMode.FILL_STROKE||a.fillText(e,t,n),u!==r.TextRenderingMode.STROKE&&u!==r.TextRenderingMode.FILL_STROKE||(s?(a.save(),a.moveTo(t,n),a.resetTransform(),a.lineWidth=Math.round(this._combinedScaleFactor),a.strokeText(e,0,0),a.restore()):a.strokeText(e,t,n))),d&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:a.mozCurrentTransform,x:t,y:n,fontSize:h,addToPath:g})}get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);const t=e.getImageData(0,0,10,10).data;let n=!1;for(let e=3;e<t.length;e+=4)if(t[e]>0&&t[e]<255){n=!0;break}return(0,r.shadow)(this,"isFontSubpixelAAEnabled",n)}showText(e){const t=this.current,n=t.font;if(n.isType3Font)return this.showType3Text(e);const i=t.fontSize;if(0===i)return;const s=this.ctx,a=t.fontSizeScale,o=t.charSpacing,l=t.wordSpacing,c=t.fontDirection,h=t.textHScale*c,u=e.length,d=n.vertical,p=d?1:-1,g=n.defaultVMetrics,f=i*t.fontMatrix[0],m=t.textRenderingMode===r.TextRenderingMode.FILL&&!n.disableFontFace&&!t.patternFill;let _;if(s.save(),t.patternFill){s.save();const e=t.fillColor.getPattern(s,this,s.mozCurrentTransformInverse);_=s.mozCurrentTransform,s.restore(),s.fillStyle=e}s.transform.apply(s,t.textMatrix),s.translate(t.x,t.y+t.textRise),c>0?s.scale(h,-1):s.scale(h,1);let b=t.lineWidth,y=!1;const v=t.textMatrixScale;if(0===v||0===b){const e=t.textRenderingMode&r.TextRenderingMode.FILL_STROKE_MASK;e!==r.TextRenderingMode.STROKE&&e!==r.TextRenderingMode.FILL_STROKE||(this._cachedGetSinglePixelWidth=null,b=this.getSinglePixelWidth(),y=b<0)}else b/=v;1!==a&&(s.scale(a,a),b/=a),s.lineWidth=b;let A,S=0;for(A=0;A<u;++A){const t=e[A];if((0,r.isNum)(t)){S+=p*t*i/1e3;continue}let h=!1;const u=(t.isSpace?l:0)+o,b=t.fontChar,v=t.accent;let w,x,P,C=t.width;if(d){const e=t.vmetric||g,n=-(t.vmetric?e[1]:.5*C)*f,r=e[2]*f;C=e?-e[0]:C,w=n/a,x=(S+r)/a}else w=S/a,x=0;if(n.remeasure&&C>0){const e=1e3*s.measureText(b).width/i*a;if(C<e&&this.isFontSubpixelAAEnabled){const t=C/e;h=!0,s.save(),s.scale(t,1),w/=t}else C!==e&&(w+=(C-e)/2e3*i/a)}if(this.contentVisible&&(t.isInFont||n.missingFile))if(m&&!v)s.fillText(b,w,x);else if(this.paintChar(b,w,x,_,y),v){const e=w+i*v.offset.x/a,t=x-i*v.offset.y/a;this.paintChar(v.fontChar,e,t,_,y)}P=d?C*f-u*c:C*f+u*c,S+=P,h&&s.restore()}d?t.y-=S:t.x+=S*h,s.restore()}showType3Text(e){const t=this.ctx,n=this.current,i=n.font,s=n.fontSize,a=n.fontDirection,o=i.vertical?1:-1,l=n.charSpacing,c=n.wordSpacing,h=n.textHScale*a,u=n.fontMatrix||r.FONT_IDENTITY_MATRIX,d=e.length;let p,g,f,m;if(n.textRenderingMode!==r.TextRenderingMode.INVISIBLE&&0!==s){for(this._cachedGetSinglePixelWidth=null,t.save(),t.transform.apply(t,n.textMatrix),t.translate(n.x,n.y),t.scale(h,a),p=0;p<d;++p){if(g=e[p],(0,r.isNum)(g)){m=o*g*s/1e3,this.ctx.translate(m,0),n.x+=m*h;continue}const a=(g.isSpace?c:0)+l,d=i.charProcOperatorList[g.operatorListId];d?(this.contentVisible&&(this.processingType3=g,this.save(),t.scale(s,s),t.transform.apply(t,u),this.executeOperatorList(d),this.restore()),f=r.Util.applyTransform([g.width,0],u)[0]*s+a,t.translate(f,0),n.x+=f*h):(0,r.warn)(`Type3 character "${g.operatorListId}" is not available.`)}t.restore(),this.processingType3=null}}setCharWidth(e,t){}setCharWidthAndBounds(e,t,n,r,i,s){this.ctx.rect(n,r,i-n,s-r),this.clip(),this.endPath()}getColorN_Pattern(e){let t;if("TilingPattern"===e[0]){const n=e[1],r=this.baseTransform||this.ctx.mozCurrentTransform.slice(),s={createCanvasGraphics:e=>new y(e,this.commonObjs,this.objs,this.canvasFactory)};t=new i.TilingPattern(e,n,this.ctx,s,r)}else t=this._getPattern(e[1]);return t}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(e,t,n){const i=r.Util.makeHexColor(e,t,n);this.ctx.strokeStyle=i,this.current.strokeColor=i}setFillRGBColor(e,t,n){const i=r.Util.makeHexColor(e,t,n);this.ctx.fillStyle=i,this.current.fillColor=i,this.current.patternFill=!1}_getPattern(e){if(this.cachedPatterns.has(e))return this.cachedPatterns.get(e);const t=(0,i.getShadingPattern)(this.objs.get(e));return this.cachedPatterns.set(e,t),t}shadingFill(e){if(!this.contentVisible)return;const t=this.ctx;this.save();const n=this._getPattern(e);t.fillStyle=n.getPattern(t,this,t.mozCurrentTransformInverse,!0);const i=t.mozCurrentTransformInverse;if(i){const e=t.canvas,n=e.width,s=e.height,a=r.Util.applyTransform([0,0],i),o=r.Util.applyTransform([0,s],i),l=r.Util.applyTransform([n,0],i),c=r.Util.applyTransform([n,s],i),h=Math.min(a[0],o[0],l[0],c[0]),u=Math.min(a[1],o[1],l[1],c[1]),d=Math.max(a[0],o[0],l[0],c[0]),p=Math.max(a[1],o[1],l[1],c[1]);this.ctx.fillRect(h,u,d-h,p-u)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.restore()}beginInlineImage(){(0,r.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,r.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(e,t){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(e)&&6===e.length&&this.transform.apply(this,e),this.baseTransform=this.ctx.mozCurrentTransform,t)){const e=t[2]-t[0],n=t[3]-t[1];this.ctx.rect(t[0],t[1],e,n),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e){if(!this.contentVisible)return;this.save();const t=this.ctx;e.isolated||(0,r.info)("TODO: Support non-isolated groups."),e.knockout&&(0,r.warn)("Knockout groups not supported.");const i=t.mozCurrentTransform;if(e.matrix&&t.transform.apply(t,e.matrix),!e.bbox)throw new Error("Bounding box is required.");let a=r.Util.getAxialAlignedBoundingBox(e.bbox,t.mozCurrentTransform);const o=[0,0,t.canvas.width,t.canvas.height];a=r.Util.intersect(a,o)||[0,0,0,0];const l=Math.floor(a[0]),c=Math.floor(a[1]);let h=Math.max(Math.ceil(a[2])-l,1),u=Math.max(Math.ceil(a[3])-c,1),d=1,p=1;h>s&&(d=h/s,h=s),u>s&&(p=u/s,u=s);let g="groupAt"+this.groupLevel;e.smask&&(g+="_smask_"+this.smaskCounter++%2);const f=this.cachedCanvases.getCanvas(g,h,u,!0),m=f.context;m.scale(1/d,1/p),m.translate(-l,-c),m.transform.apply(m,i),e.smask?this.smaskStack.push({canvas:f.canvas,context:m,offsetX:l,offsetY:c,scaleX:d,scaleY:p,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}):(t.setTransform(1,0,0,1,0,0),t.translate(l,c),t.scale(d,p)),n(t,m),this.ctx=m,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(t),this.groupLevel++,this.current.activeSMask=null}endGroup(e){if(!this.contentVisible)return;this.groupLevel--;const t=this.ctx;this.ctx=this.groupStack.pop(),void 0!==this.ctx.imageSmoothingEnabled?this.ctx.imageSmoothingEnabled=!1:this.ctx.mozImageSmoothingEnabled=!1,e.smask?this.tempSMask=this.smaskStack.pop():this.ctx.drawImage(t.canvas,0,0),this.restore()}beginAnnotations(){this.save(),this.baseTransform&&this.ctx.setTransform.apply(this.ctx,this.baseTransform)}endAnnotations(){this.restore()}beginAnnotation(e,t,n,r){if(this.save(),h(this.ctx),this.current=new c,Array.isArray(t)&&4===t.length){const e=t[2]-t[0],n=t[3]-t[1];this.ctx.rect(t[0],t[1],e,n),this.clip(),this.endPath()}this.transform.apply(this,n),this.transform.apply(this,r)}endAnnotation(){this.restore()}paintImageMaskXObject(e){if(!this.contentVisible)return;const t=this.ctx,n=e.width,r=e.height,i=this.processingType3;if(i&&void 0===i.compiled&&(i.compiled=n<=1e3&&r<=1e3?function(e){const t=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),n=e.width,r=e.height,i=n+1;let s,a,o,l;const c=new Uint8Array(i*(r+1)),h=n+7&-8,u=e.data,d=new Uint8Array(h*r);let p=0;for(s=0,a=u.length;s<a;s++){const e=u[s];let t=128;for(;t>0;)d[p++]=e&t?0:255,t>>=1}let g=0;for(p=0,0!==d[p]&&(c[0]=1,++g),o=1;o<n;o++)d[p]!==d[p+1]&&(c[o]=d[p]?2:1,++g),p++;for(0!==d[p]&&(c[o]=2,++g),s=1;s<r;s++){p=s*h,l=s*i,d[p-h]!==d[p]&&(c[l]=d[p]?1:8,++g);let e=(d[p]?4:0)+(d[p-h]?8:0);for(o=1;o<n;o++)e=(e>>2)+(d[p+1]?4:0)+(d[p-h+1]?8:0),t[e]&&(c[l+o]=t[e],++g),p++;if(d[p-h]!==d[p]&&(c[l+o]=d[p]?2:4,++g),g>1e3)return null}for(p=h*(r-1),l=s*i,0!==d[p]&&(c[l]=8,++g),o=1;o<n;o++)d[p]!==d[p+1]&&(c[l+o]=d[p]?4:8,++g),p++;if(0!==d[p]&&(c[l+o]=4,++g),g>1e3)return null;const f=new Int32Array([0,i,-1,0,-i,0,0,0,1]),m=[];for(s=0;g&&s<=r;s++){let e=s*i;const t=e+n;for(;e<t&&!c[e];)e++;if(e===t)continue;const r=[e%i,s],a=e;let o=c[e];do{const t=f[o];do{e+=t}while(!c[e]);const n=c[e];5!==n&&10!==n?(o=n,c[e]=0):(o=n&51*o>>4,c[e]&=o>>2|o<<2),r.push(e%i,e/i|0),c[e]||--g}while(a!==e);m.push(r),--s}return function(e){e.save(),e.scale(1/n,-1/r),e.translate(0,-r),e.beginPath();for(let t=0,n=m.length;t<n;t++){const n=m[t];e.moveTo(n[0],n[1]);for(let t=2,r=n.length;t<r;t+=2)e.lineTo(n[t],n[t+1])}e.fill(),e.beginPath(),e.restore()}}({data:e.data,width:n,height:r}):null),i?.compiled)return void i.compiled(t);const s=this._createMaskCanvas(e),a=s.canvas;t.save(),t.setTransform(1,0,0,1,0,0),t.drawImage(a,s.offsetX,s.offsetY),t.restore()}paintImageMaskXObjectRepeat(e,t,n=0,i=0,s,a){if(!this.contentVisible)return;const o=this.ctx;o.save();const l=o.mozCurrentTransform;o.transform(t,n,i,s,0,0);const c=this._createMaskCanvas(e);o.setTransform(1,0,0,1,0,0);for(let e=0,h=a.length;e<h;e+=2){const h=r.Util.transform(l,[t,n,i,s,a[e],a[e+1]]),[u,d]=r.Util.applyTransform([0,0],h);o.drawImage(c.canvas,u,d)}o.restore()}paintImageMaskXObjectGroup(e){if(!this.contentVisible)return;const n=this.ctx,r=this.current.fillColor,i=this.current.patternFill;for(let s=0,a=e.length;s<a;s++){const a=e[s],o=a.width,l=a.height,c=this.cachedCanvases.getCanvas("maskCanvas",o,l),h=c.context;h.save(),t(h,a),h.globalCompositeOperation="source-in",h.fillStyle=i?r.getPattern(h,this,n.mozCurrentTransformInverse,!1):r,h.fillRect(0,0,o,l),h.restore(),n.save(),n.transform.apply(n,a.transform),n.scale(1,-1),n.drawImage(c.canvas,0,0,o,l,0,-1,1,1),n.restore()}}paintImageXObject(e){if(!this.contentVisible)return;const t=e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e);t?this.paintInlineImageXObject(t):(0,r.warn)("Dependent image isn't ready yet")}paintImageXObjectRepeat(e,t,n,i){if(!this.contentVisible)return;const s=e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e);if(!s)return void(0,r.warn)("Dependent image isn't ready yet");const a=s.width,o=s.height,l=[];for(let e=0,r=i.length;e<r;e+=2)l.push({transform:[t,0,0,n,i[e],i[e+1]],x:0,y:0,w:a,h:o});this.paintInlineImageXObjectGroup(s,l)}paintInlineImageXObject(t){if(!this.contentVisible)return;const n=t.width,r=t.height,i=this.ctx;let s;if(this.save(),i.scale(1/n,-1/r),"function"==typeof HTMLElement&&t instanceof HTMLElement||!t.data)s=t;else{const i=this.cachedCanvases.getCanvas("inlineImage",n,r);e(i.context,t,this.current.transferMaps),s=i.canvas}const a=this._scaleImage(s,i.mozCurrentTransformInverse);if(i.drawImage(a.img,0,0,a.paintWidth,a.paintHeight,0,-r,n,r),this.imageLayer){const e=this.getCanvasPosition(0,-r);this.imageLayer.appendImage({imgData:t,left:e[0],top:e[1],width:n/i.mozCurrentTransformInverse[0],height:r/i.mozCurrentTransformInverse[3]})}this.restore()}paintInlineImageXObjectGroup(t,n){if(!this.contentVisible)return;const r=this.ctx,i=t.width,s=t.height,a=this.cachedCanvases.getCanvas("inlineImage",i,s);e(a.context,t,this.current.transferMaps);for(let e=0,o=n.length;e<o;e++){const o=n[e];if(r.save(),r.transform.apply(r,o.transform),r.scale(1,-1),r.drawImage(a.canvas,o.x,o.y,o.w,o.h,0,-1,1,1),this.imageLayer){const e=this.getCanvasPosition(o.x,o.y);this.imageLayer.appendImage({imgData:t,left:e[0],top:e[1],width:i,height:s})}r.restore()}}paintSolidColorImageMask(){this.contentVisible&&this.ctx.fillRect(0,0,1,1)}markPoint(e){}markPointProps(e,t){}beginMarkedContent(e){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,t){"OC"===e?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(t)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(){const e=this.ctx;this.pendingClip&&(this.pendingClip===b?e.clip("evenodd"):e.clip(),this.pendingClip=null),e.beginPath()}getSinglePixelWidth(){if(null===this._cachedGetSinglePixelWidth){const e=this.ctx.mozCurrentTransform,t=Math.abs(e[0]*e[3]-e[2]*e[1]),n=e[0]**2+e[2]**2,r=e[1]**2+e[3]**2,i=Math.sqrt(Math.max(n,r))/t;n!==r&&this._combinedScaleFactor*i>1?this._cachedGetSinglePixelWidth=-this._combinedScaleFactor*i:t>Number.EPSILON?this._cachedGetSinglePixelWidth=i:this._cachedGetSinglePixelWidth=1}return this._cachedGetSinglePixelWidth}getCanvasPosition(e,t){const n=this.ctx.mozCurrentTransform;return[n[0]*e+n[2]*t+n[4],n[1]*e+n[3]*t+n[5]]}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}}for(const e in r.OPS)y.prototype[r.OPS[e]]=y.prototype[e];return y}();t.CanvasGraphics=h},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getShadingPattern=function(e){switch(e[0]){case"RadialAxial":return new a(e);case"Mesh":return new c(e);case"Dummy":return new h}throw new Error(`Unknown IR type: ${e[0]}`)},t.TilingPattern=void 0;var r=n(2);function i(e,t){if(!t||"undefined"==typeof Path2D)return;const n=t[2]-t[0],r=t[3]-t[1],i=new Path2D;i.rect(t[0],t[1],n,r),e.clip(i)}class s{constructor(){this.constructor===s&&(0,r.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,r.unreachable)("Abstract method `getPattern` called.")}}class a extends s{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this._matrix=e[8],this._patternCache=null}_createGradient(e){let t;"axial"===this._type?t=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(t=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const e of this._colorStops)t.addColorStop(e[0],e[1]);return t}getPattern(e,t,n,s=!1){let a;if(this._patternCache)a=this._patternCache;else{if(s)i(e,this._bbox),a=this._createGradient(e);else{const n=t.cachedCanvases.getCanvas("pattern",t.ctx.canvas.width,t.ctx.canvas.height,!0),r=n.context;r.clearRect(0,0,r.canvas.width,r.canvas.height),r.beginPath(),r.rect(0,0,r.canvas.width,r.canvas.height),r.setTransform.apply(r,t.baseTransform),this._matrix&&r.transform.apply(r,this._matrix),i(r,this._bbox),r.fillStyle=this._createGradient(r),r.fill(),a=e.createPattern(n.canvas,"repeat")}this._patternCache=a}if(!s){const e=new DOMMatrix(n);try{a.setTransform(e)}catch(e){(0,r.warn)(`RadialAxialShadingPattern.getPattern: "${e?.message}".`)}}return a}}function o(e,t,n,r,i,s,a,o){const l=t.coords,c=t.colors,h=e.data,u=4*e.width;let d;l[n+1]>l[r+1]&&(d=n,n=r,r=d,d=s,s=a,a=d),l[r+1]>l[i+1]&&(d=r,r=i,i=d,d=a,a=o,o=d),l[n+1]>l[r+1]&&(d=n,n=r,r=d,d=s,s=a,a=d);const p=(l[n]+t.offsetX)*t.scaleX,g=(l[n+1]+t.offsetY)*t.scaleY,f=(l[r]+t.offsetX)*t.scaleX,m=(l[r+1]+t.offsetY)*t.scaleY,_=(l[i]+t.offsetX)*t.scaleX,b=(l[i+1]+t.offsetY)*t.scaleY;if(g>=b)return;const y=c[s],v=c[s+1],A=c[s+2],S=c[a],w=c[a+1],x=c[a+2],P=c[o],C=c[o+1],T=c[o+2],k=Math.round(g),L=Math.round(b);let E,R,M,F,I,D,N,O;for(let e=k;e<=L;e++){if(e<m){let t;t=e<g?0:(g-e)/(g-m),E=p-(p-f)*t,R=y-(y-S)*t,M=v-(v-w)*t,F=A-(A-x)*t}else{let t;t=e>b?1:m===b?0:(m-e)/(m-b),E=f-(f-_)*t,R=S-(S-P)*t,M=w-(w-C)*t,F=x-(x-T)*t}let t;t=e<g?0:e>b?1:(g-e)/(g-b),I=p-(p-_)*t,D=y-(y-P)*t,N=v-(v-C)*t,O=A-(A-T)*t;const n=Math.round(Math.min(E,I)),r=Math.round(Math.max(E,I));let i=u*e+4*n;for(let e=n;e<=r;e++)t=(E-e)/(E-I),t<0?t=0:t>1&&(t=1),h[i++]=R-(R-D)*t|0,h[i++]=M-(M-N)*t|0,h[i++]=F-(F-O)*t|0,h[i++]=255}}function l(e,t,n){const r=t.coords,i=t.colors;let s,a;switch(t.type){case"lattice":const l=t.verticesPerRow,c=Math.floor(r.length/l)-1,h=l-1;for(s=0;s<c;s++){let t=s*l;for(let s=0;s<h;s++,t++)o(e,n,r[t],r[t+1],r[t+l],i[t],i[t+1],i[t+l]),o(e,n,r[t+l+1],r[t+1],r[t+l],i[t+l+1],i[t+1],i[t+l])}break;case"triangles":for(s=0,a=r.length;s<a;s+=3)o(e,n,r[s],r[s+1],r[s+2],i[s],i[s+1],i[s+2]);break;default:throw new Error("illegal figure")}}class c extends s{constructor(e){super(),this._coords=e[2],this._colors=e[3],this._figures=e[4],this._bounds=e[5],this._matrix=e[6],this._bbox=e[7],this._background=e[8]}_createMeshCanvas(e,t,n){const r=Math.floor(this._bounds[0]),i=Math.floor(this._bounds[1]),s=Math.ceil(this._bounds[2])-r,a=Math.ceil(this._bounds[3])-i,o=Math.min(Math.ceil(Math.abs(s*e[0]*1.1)),3e3),c=Math.min(Math.ceil(Math.abs(a*e[1]*1.1)),3e3),h=s/o,u=a/c,d={coords:this._coords,colors:this._colors,offsetX:-r,offsetY:-i,scaleX:1/h,scaleY:1/u},p=o+4,g=c+4,f=n.getCanvas("mesh",p,g,!1),m=f.context,_=m.createImageData(o,c);if(t){const e=_.data;for(let n=0,r=e.length;n<r;n+=4)e[n]=t[0],e[n+1]=t[1],e[n+2]=t[2],e[n+3]=255}for(const e of this._figures)l(_,e,d);return m.putImageData(_,2,2),{canvas:f.canvas,offsetX:r-2*h,offsetY:i-2*u,scaleX:h,scaleY:u}}getPattern(e,t,n,s=!1){let a;if(i(e,this._bbox),s)a=r.Util.singularValueDecompose2dScale(e.mozCurrentTransform);else if(a=r.Util.singularValueDecompose2dScale(t.baseTransform),this._matrix){const e=r.Util.singularValueDecompose2dScale(this._matrix);a=[a[0]*e[0],a[1]*e[1]]}const o=this._createMeshCanvas(a,s?null:this._background,t.cachedCanvases);return s||(e.setTransform.apply(e,t.baseTransform),this._matrix&&e.transform.apply(e,this._matrix)),e.translate(o.offsetX,o.offsetY),e.scale(o.scaleX,o.scaleY),e.createPattern(o.canvas,"no-repeat")}}class h extends s{getPattern(){return"hotpink"}}class u{static get MAX_PATTERN_SIZE(){return(0,r.shadow)(this,"MAX_PATTERN_SIZE",3e3)}constructor(e,t,n,r,i){this.operatorList=e[2],this.matrix=e[3]||[1,0,0,1,0,0],this.bbox=e[4],this.xstep=e[5],this.ystep=e[6],this.paintType=e[7],this.tilingType=e[8],this.color=t,this.ctx=n,this.canvasGraphicsFactory=r,this.baseTransform=i}createPatternCanvas(e){const t=this.operatorList,n=this.bbox,i=this.xstep,s=this.ystep,a=this.paintType,o=this.tilingType,l=this.color,c=this.canvasGraphicsFactory;(0,r.info)("TilingType: "+o);const h=n[0],u=n[1],d=n[2],p=n[3],g=r.Util.singularValueDecompose2dScale(this.matrix),f=r.Util.singularValueDecompose2dScale(this.baseTransform),m=[g[0]*f[0],g[1]*f[1]],_=this.getSizeAndScale(i,this.ctx.canvas.width,m[0]),b=this.getSizeAndScale(s,this.ctx.canvas.height,m[1]),y=e.cachedCanvases.getCanvas("pattern",_.size,b.size,!0),v=y.context,A=c.createCanvasGraphics(v);A.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(A,a,l);let S=h,w=u,x=d,P=p;return h<0&&(S=0,x+=Math.abs(h)),u<0&&(w=0,P+=Math.abs(u)),v.translate(-_.scale*S,-b.scale*w),A.transform(_.scale,0,0,b.scale,0,0),this.clipBbox(A,S,w,x,P),A.baseTransform=A.ctx.mozCurrentTransform.slice(),A.executeOperatorList(t),A.endDrawing(),{canvas:y.canvas,scaleX:_.scale,scaleY:b.scale,offsetX:S,offsetY:w}}getSizeAndScale(e,t,n){e=Math.abs(e);const r=Math.max(u.MAX_PATTERN_SIZE,t);let i=Math.ceil(e*n);return i>=r?i=r:n=i/e,{scale:n,size:i}}clipBbox(e,t,n,r,i){const s=r-t,a=i-n;e.ctx.rect(t,n,s,a),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,t,n){const i=e.ctx,s=e.current;switch(t){case 1:const e=this.ctx;i.fillStyle=e.fillStyle,i.strokeStyle=e.strokeStyle,s.fillColor=e.fillStyle,s.strokeColor=e.strokeStyle;break;case 2:const a=r.Util.makeHexColor(n[0],n[1],n[2]);i.fillStyle=a,i.strokeStyle=a,s.fillColor=a,s.strokeColor=a;break;default:throw new r.FormatError(`Unsupported paint type: ${t}`)}}getPattern(e,t,n,i=!1){let s=n;i||(s=r.Util.transform(s,t.baseTransform),this.matrix&&(s=r.Util.transform(s,this.matrix)));const a=this.createPatternCanvas(t);let o=new DOMMatrix(s);o=o.translate(a.offsetX,a.offsetY),o=o.scale(1/a.scaleX,1/a.scaleY);const l=e.createPattern(a.canvas,"repeat");try{l.setTransform(o)}catch(e){(0,r.warn)(`TilingPattern.getPattern: "${e?.message}".`)}return l}}t.TilingPattern=u},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalWorkerOptions=void 0;const n=Object.create(null);t.GlobalWorkerOptions=n,n.workerPort=void 0===n.workerPort?null:n.workerPort,n.workerSrc=void 0===n.workerSrc?"":n.workerSrc},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MessageHandler=void 0;var r=n(2);function i(e){if("object"!=typeof e||null===e)return e;switch(e.name){case"AbortException":return new r.AbortException(e.message);case"MissingPDFException":return new r.MissingPDFException(e.message);case"UnexpectedResponseException":return new r.UnexpectedResponseException(e.message,e.status);case"UnknownErrorException":return new r.UnknownErrorException(e.message,e.details);default:return new r.UnknownErrorException(e.message,e.toString())}}t.MessageHandler=class{constructor(e,t,n){this.sourceName=e,this.targetName=t,this.comObj=n,this.callbackId=1,this.streamId=1,this.postMessageTransfers=!0,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=e=>{const t=e.data;if(t.targetName!==this.sourceName)return;if(t.stream)return void this._processStreamMessage(t);if(t.callback){const e=t.callbackId,n=this.callbackCapabilities[e];if(!n)throw new Error(`Cannot resolve callback ${e}`);if(delete this.callbackCapabilities[e],1===t.callback)n.resolve(t.data);else{if(2!==t.callback)throw new Error("Unexpected callback case");n.reject(i(t.reason))}return}const r=this.actionHandler[t.action];if(!r)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const e=this.sourceName,s=t.sourceName;new Promise((function(e){e(r(t.data))})).then((function(r){n.postMessage({sourceName:e,targetName:s,callback:1,callbackId:t.callbackId,data:r})}),(function(r){n.postMessage({sourceName:e,targetName:s,callback:2,callbackId:t.callbackId,reason:i(r)})}))}else t.streamId?this._createStreamSink(t):r(t.data)},n.addEventListener("message",this._onComObjOnMessage)}on(e,t){const n=this.actionHandler;if(n[e])throw new Error(`There is already an actionName called "${e}"`);n[e]=t}send(e,t,n){this._postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},n)}sendWithPromise(e,t,n){const i=this.callbackId++,s=(0,r.createPromiseCapability)();this.callbackCapabilities[i]=s;try{this._postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:i,data:t},n)}catch(e){s.reject(e)}return s.promise}sendWithStream(e,t,n,s){const a=this.streamId++,o=this.sourceName,l=this.targetName,c=this.comObj;return new ReadableStream({start:n=>{const i=(0,r.createPromiseCapability)();return this.streamControllers[a]={controller:n,startCall:i,pullCall:null,cancelCall:null,isClosed:!1},this._postMessage({sourceName:o,targetName:l,action:e,streamId:a,data:t,desiredSize:n.desiredSize},s),i.promise},pull:e=>{const t=(0,r.createPromiseCapability)();return this.streamControllers[a].pullCall=t,c.postMessage({sourceName:o,targetName:l,stream:6,streamId:a,desiredSize:e.desiredSize}),t.promise},cancel:e=>{(0,r.assert)(e instanceof Error,"cancel must have a valid reason");const t=(0,r.createPromiseCapability)();return this.streamControllers[a].cancelCall=t,this.streamControllers[a].isClosed=!0,c.postMessage({sourceName:o,targetName:l,stream:1,streamId:a,reason:i(e)}),t.promise}},n)}_createStreamSink(e){const t=this,n=this.actionHandler[e.action],s=e.streamId,a=this.sourceName,o=e.sourceName,l=this.comObj,c={enqueue(e,n=1,i){if(this.isCancelled)return;const l=this.desiredSize;this.desiredSize-=n,l>0&&this.desiredSize<=0&&(this.sinkCapability=(0,r.createPromiseCapability)(),this.ready=this.sinkCapability.promise),t._postMessage({sourceName:a,targetName:o,stream:4,streamId:s,chunk:e},i)},close(){this.isCancelled||(this.isCancelled=!0,l.postMessage({sourceName:a,targetName:o,stream:3,streamId:s}),delete t.streamSinks[s])},error(e){(0,r.assert)(e instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,l.postMessage({sourceName:a,targetName:o,stream:5,streamId:s,reason:i(e)}))},sinkCapability:(0,r.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};c.sinkCapability.resolve(),c.ready=c.sinkCapability.promise,this.streamSinks[s]=c,new Promise((function(t){t(n(e.data,c))})).then((function(){l.postMessage({sourceName:a,targetName:o,stream:8,streamId:s,success:!0})}),(function(e){l.postMessage({sourceName:a,targetName:o,stream:8,streamId:s,reason:i(e)})}))}_processStreamMessage(e){const t=e.streamId,n=this.sourceName,s=e.sourceName,a=this.comObj;switch(e.stream){case 8:e.success?this.streamControllers[t].startCall.resolve():this.streamControllers[t].startCall.reject(i(e.reason));break;case 7:e.success?this.streamControllers[t].pullCall.resolve():this.streamControllers[t].pullCall.reject(i(e.reason));break;case 6:if(!this.streamSinks[t]){a.postMessage({sourceName:n,targetName:s,stream:7,streamId:t,success:!0});break}this.streamSinks[t].desiredSize<=0&&e.desiredSize>0&&this.streamSinks[t].sinkCapability.resolve(),this.streamSinks[t].desiredSize=e.desiredSize;const{onPull:o}=this.streamSinks[e.streamId];new Promise((function(e){e(o&&o())})).then((function(){a.postMessage({sourceName:n,targetName:s,stream:7,streamId:t,success:!0})}),(function(e){a.postMessage({sourceName:n,targetName:s,stream:7,streamId:t,reason:i(e)})}));break;case 4:if((0,r.assert)(this.streamControllers[t],"enqueue should have stream controller"),this.streamControllers[t].isClosed)break;this.streamControllers[t].controller.enqueue(e.chunk);break;case 3:if((0,r.assert)(this.streamControllers[t],"close should have stream controller"),this.streamControllers[t].isClosed)break;this.streamControllers[t].isClosed=!0,this.streamControllers[t].controller.close(),this._deleteStreamController(t);break;case 5:(0,r.assert)(this.streamControllers[t],"error should have stream controller"),this.streamControllers[t].controller.error(i(e.reason)),this._deleteStreamController(t);break;case 2:e.success?this.streamControllers[t].cancelCall.resolve():this.streamControllers[t].cancelCall.reject(i(e.reason)),this._deleteStreamController(t);break;case 1:if(!this.streamSinks[t])break;const{onCancel:l}=this.streamSinks[e.streamId];new Promise((function(t){t(l&&l(i(e.reason)))})).then((function(){a.postMessage({sourceName:n,targetName:s,stream:2,streamId:t,success:!0})}),(function(e){a.postMessage({sourceName:n,targetName:s,stream:2,streamId:t,reason:i(e)})})),this.streamSinks[t].sinkCapability.reject(i(e.reason)),this.streamSinks[t].isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}async _deleteStreamController(e){await Promise.allSettled([this.streamControllers[e].startCall,this.streamControllers[e].pullCall,this.streamControllers[e].cancelCall].map((function(e){return e&&e.promise}))),delete this.streamControllers[e]}_postMessage(e,t){t&&this.postMessageTransfers?this.comObj.postMessage(e,t):this.comObj.postMessage(e)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Metadata=void 0;var r=n(2);t.Metadata=class{constructor({parsedData:e,rawData:t}){this._metadataMap=e,this._data=t}getRaw(){return this._data}get(e){return this._metadataMap.get(e)??null}getAll(){return(0,r.objectFromMap)(this._metadataMap)}has(e){return this._metadataMap.has(e)}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OptionalContentConfig=void 0;var r=n(2);class i{constructor(e,t){this.visible=!0,this.name=e,this.intent=t}}t.OptionalContentConfig=class{constructor(e){if(this.name=null,this.creator=null,this._order=null,this._groups=new Map,null!==e){this.name=e.name,this.creator=e.creator,this._order=e.order;for(const t of e.groups)this._groups.set(t.id,new i(t.name,t.intent));if("OFF"===e.baseState)for(const e of this._groups)e.visible=!1;for(const t of e.on)this._groups.get(t).visible=!0;for(const t of e.off)this._groups.get(t).visible=!1}}_evaluateVisibilityExpression(e){const t=e.length;if(t<2)return!0;const n=e[0];for(let i=1;i<t;i++){const t=e[i];let s;if(Array.isArray(t))s=this._evaluateVisibilityExpression(t);else{if(!this._groups.has(t))return(0,r.warn)(`Optional content group not found: ${t}`),!0;s=this._groups.get(t).visible}switch(n){case"And":if(!s)return!1;break;case"Or":if(s)return!0;break;case"Not":return!s;default:return!0}}return"And"===n}isVisible(e){if("OCG"===e.type)return this._groups.has(e.id)?this._groups.get(e.id).visible:((0,r.warn)(`Optional content group not found: ${e.id}`),!0);if("OCMD"===e.type){if(e.expression)return this._evaluateVisibilityExpression(e.expression);if(!e.policy||"AnyOn"===e.policy){for(const t of e.ids){if(!this._groups.has(t))return(0,r.warn)(`Optional content group not found: ${t}`),!0;if(this._groups.get(t).visible)return!0}return!1}if("AllOn"===e.policy){for(const t of e.ids){if(!this._groups.has(t))return(0,r.warn)(`Optional content group not found: ${t}`),!0;if(!this._groups.get(t).visible)return!1}return!0}if("AnyOff"===e.policy){for(const t of e.ids){if(!this._groups.has(t))return(0,r.warn)(`Optional content group not found: ${t}`),!0;if(!this._groups.get(t).visible)return!0}return!1}if("AllOff"===e.policy){for(const t of e.ids){if(!this._groups.has(t))return(0,r.warn)(`Optional content group not found: ${t}`),!0;if(this._groups.get(t).visible)return!1}return!0}return(0,r.warn)(`Unknown optional content policy ${e.policy}.`),!0}return(0,r.warn)(`Unknown group type ${e.type}.`),!0}setVisibility(e,t=!0){this._groups.has(e)?this._groups.get(e).visible=!!t:(0,r.warn)(`Optional content group not found: ${e}`)}getOrder(){return this._groups.size?this._order?this._order.slice():Array.from(this._groups.keys()):null}getGroups(){return this._groups.size>0?(0,r.objectFromMap)(this._groups):null}getGroup(e){return this._groups.get(e)||null}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFDataTransportStream=void 0;var r=n(2),i=n(1);t.PDFDataTransportStream=class{constructor(e,t){(0,r.assert)(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=e.progressiveDone||!1,this._contentDispositionFilename=e.contentDispositionFilename||null;const n=e.initialData;if(n?.length>0){const e=new Uint8Array(n).buffer;this._queuedChunks.push(e)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._contentLength=e.length,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener(((e,t)=>{this._onReceiveData({begin:e,chunk:t})})),this._pdfDataRangeTransport.addProgressListener(((e,t)=>{this._onProgress({loaded:e,total:t})})),this._pdfDataRangeTransport.addProgressiveReadListener((e=>{this._onReceiveData({chunk:e})})),this._pdfDataRangeTransport.addProgressiveDoneListener((()=>{this._onProgressiveDone()})),this._pdfDataRangeTransport.transportReady()}_onReceiveData(e){const t=new Uint8Array(e.chunk).buffer;if(void 0===e.begin)this._fullRequestReader?this._fullRequestReader._enqueue(t):this._queuedChunks.push(t);else{const n=this._rangeReaders.some((function(n){return n._begin===e.begin&&(n._enqueue(t),!0)}));(0,r.assert)(n,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(e){if(void 0===e.total){const t=this._rangeReaders[0];t?.onProgress&&t.onProgress({loaded:e.loaded})}else{const t=this._fullRequestReader;t?.onProgress&&t.onProgress({loaded:e.loaded,total:e.total})}}_onProgressiveDone(){this._fullRequestReader&&this._fullRequestReader.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){const t=this._rangeReaders.indexOf(e);t>=0&&this._rangeReaders.splice(t,1)}getFullReader(){(0,r.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new s(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=new a(this,e,t);return this._pdfDataRangeTransport.requestDataRange(e,t),this._rangeReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader&&this._fullRequestReader.cancel(e);for(const t of this._rangeReaders.slice(0))t.cancel(e);this._pdfDataRangeTransport.abort()}};class s{constructor(e,t,n=!1,r=null){this._stream=e,this._done=n||!1,this._filename=(0,i.isPdfFile)(r)?r:null,this._queuedChunks=t||[],this._loaded=0;for(const e of this._queuedChunks)this._loaded+=e.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=(0,r.createPromiseCapability)();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class a{constructor(e,t,n){this._stream=e,this._begin=t,this._end=n,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(0===this._requests.length)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const e=(0,r.createPromiseCapability)();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationLayer=void 0;var r=n(1),i=n(2),s=n(9),a=n(18);class o{static create(e){switch(e.data.annotationType){case i.AnnotationType.LINK:return new c(e);case i.AnnotationType.TEXT:return new h(e);case i.AnnotationType.WIDGET:switch(e.data.fieldType){case"Tx":return new d(e);case"Btn":return e.data.radioButton?new g(e):e.data.checkBox?new p(e):new f(e);case"Ch":return new m(e)}return new u(e);case i.AnnotationType.POPUP:return new _(e);case i.AnnotationType.FREETEXT:return new y(e);case i.AnnotationType.LINE:return new v(e);case i.AnnotationType.SQUARE:return new A(e);case i.AnnotationType.CIRCLE:return new S(e);case i.AnnotationType.POLYLINE:return new w(e);case i.AnnotationType.CARET:return new P(e);case i.AnnotationType.INK:return new C(e);case i.AnnotationType.POLYGON:return new x(e);case i.AnnotationType.HIGHLIGHT:return new T(e);case i.AnnotationType.UNDERLINE:return new k(e);case i.AnnotationType.SQUIGGLY:return new L(e);case i.AnnotationType.STRIKEOUT:return new E(e);case i.AnnotationType.STAMP:return new R(e);case i.AnnotationType.FILEATTACHMENT:return new M(e);default:return new l(e)}}}class l{constructor(e,{isRenderable:t=!1,ignoreBorder:n=!1,createQuadrilaterals:r=!1}={}){this.isRenderable=t,this.data=e.data,this.layer=e.layer,this.page=e.page,this.viewport=e.viewport,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderInteractiveForms=e.renderInteractiveForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._mouseState=e.mouseState,t&&(this.container=this._createContainer(n)),r&&(this.quadrilaterals=this._createQuadrilaterals(n))}_createContainer(e=!1){const t=this.data,n=this.page,r=this.viewport,s=document.createElement("section");let a=t.rect[2]-t.rect[0],o=t.rect[3]-t.rect[1];s.setAttribute("data-annotation-id",t.id);const l=i.Util.normalizeRect([t.rect[0],n.view[3]-t.rect[1]+n.view[1],t.rect[2],n.view[3]-t.rect[3]+n.view[1]]);if(s.style.transform=`matrix(${r.transform.join(",")})`,s.style.transformOrigin=`${-l[0]}px ${-l[1]}px`,!e&&t.borderStyle.width>0){s.style.borderWidth=`${t.borderStyle.width}px`,t.borderStyle.style!==i.AnnotationBorderStyleType.UNDERLINE&&(a-=2*t.borderStyle.width,o-=2*t.borderStyle.width);const e=t.borderStyle.horizontalCornerRadius,n=t.borderStyle.verticalCornerRadius;if(e>0||n>0){const t=`${e}px / ${n}px`;s.style.borderRadius=t}switch(t.borderStyle.style){case i.AnnotationBorderStyleType.SOLID:s.style.borderStyle="solid";break;case i.AnnotationBorderStyleType.DASHED:s.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:s.style.borderBottomStyle="solid"}t.color?s.style.borderColor=i.Util.makeHexColor(0|t.color[0],0|t.color[1],0|t.color[2]):s.style.borderWidth=0}return s.style.left=`${l[0]}px`,s.style.top=`${l[1]}px`,s.style.width=`${a}px`,s.style.height=`${o}px`,s}_createQuadrilaterals(e=!1){if(!this.data.quadPoints)return null;const t=[],n=this.data.rect;for(const n of this.data.quadPoints)this.data.rect=[n[2].x,n[2].y,n[1].x,n[1].y],t.push(this._createContainer(e));return this.data.rect=n,t}_createPopup(e,t){let n=this.container;this.quadrilaterals&&(e=e||this.quadrilaterals,n=this.quadrilaterals[0]),e||((e=document.createElement("div")).style.height=n.style.height,e.style.width=n.style.width,n.appendChild(e));const r=new b({container:n,trigger:e,color:t.color,title:t.title,modificationDate:t.modificationDate,contents:t.contents,hideWrapper:!0}).render();r.style.left=n.style.width,n.appendChild(r)}_renderQuadrilaterals(e){for(const t of this.quadrilaterals)t.className=e;return this.quadrilaterals}render(){(0,i.unreachable)("Abstract method `AnnotationElement.render` called")}}class c extends l{constructor(e){super(e,{isRenderable:!!(e.data.url||e.data.dest||e.data.action||e.data.isTooltipOnly||e.data.actions&&(e.data.actions.Action||e.data.actions["Mouse Up"]||e.data.actions["Mouse Down"])),createQuadrilaterals:!0})}render(){const{data:e,linkService:t}=this,n=document.createElement("a");return e.url?(0,r.addLinkAttributes)(n,{url:e.url,target:e.newWindow?r.LinkTarget.BLANK:t.externalLinkTarget,rel:t.externalLinkRel,enabled:t.externalLinkEnabled}):e.action?this._bindNamedAction(n,e.action):e.dest?this._bindLink(n,e.dest):e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions?this._bindJSAction(n,e):this._bindLink(n,""),this.quadrilaterals?this._renderQuadrilaterals("linkAnnotation").map(((e,t)=>{const r=0===t?n:n.cloneNode();return e.appendChild(r),e})):(this.container.className="linkAnnotation",this.container.appendChild(n),this.container)}_bindLink(e,t){e.href=this.linkService.getDestinationHash(t),e.onclick=()=>(t&&this.linkService.goToDestination(t),!1),(t||""===t)&&(e.className="internalLink")}_bindNamedAction(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(t),!1),e.className="internalLink"}_bindJSAction(e,t){e.href=this.linkService.getAnchorUrl("");const n=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const r of Object.keys(t.actions)){const i=n.get(r);i&&(e[i]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t.id,name:r}}),!1))}e.className="internalLink"}}class h extends l{constructor(e){super(e,{isRenderable:!!(e.data.hasPopup||e.data.title||e.data.contents)})}render(){this.container.className="textAnnotation";const e=document.createElement("img");return e.style.height=this.container.style.height,e.style.width=this.container.style.width,e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.alt="[{{type}} Annotation]",e.dataset.l10nId="text_annotation_type",e.dataset.l10nArgs=JSON.stringify({type:this.data.name}),this.data.hasPopup||this._createPopup(e,this.data),this.container.appendChild(e),this.container}}class u extends l{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}_getKeyModifier(e){return navigator.platform.includes("Win")&&e.ctrlKey||navigator.platform.includes("Mac")&&e.metaKey}_setEventListener(e,t,n,r){t.includes("mouse")?e.addEventListener(t,(e=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:r(e),shift:e.shiftKey,modifier:this._getKeyModifier(e)}})})):e.addEventListener(t,(e=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:e.target.checked}})}))}_setEventListeners(e,t,n){for(const[r,i]of t)("Action"===i||this.data.actions?.[i])&&this._setEventListener(e,r,i,n)}_dispatchEventFromSandbox(e,t){const n=(e,t,n)=>{const r=n.detail[e];n.target.style[t]=a.ColorConverters[`${r[0]}_HTML`](r.slice(1))},r={display:e=>{const t=e.detail.display%2==1;e.target.style.visibility=t?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:t,print:0===e.detail.display||3===e.detail.display})},print:e=>{this.annotationStorage.setValue(this.data.id,{print:e.detail.print})},hidden:e=>{e.target.style.visibility=e.detail.hidden?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:e.detail.hidden})},focus:e=>{setTimeout((()=>e.target.focus({preventScroll:!1})),0)},userName:e=>{e.target.title=e.detail.userName},readonly:e=>{e.detail.readonly?e.target.setAttribute("readonly",""):e.target.removeAttribute("readonly")},required:e=>{e.detail.required?e.target.setAttribute("required",""):e.target.removeAttribute("required")},bgColor:e=>{n("bgColor","backgroundColor",e)},fillColor:e=>{n("fillColor","backgroundColor",e)},fgColor:e=>{n("fgColor","color",e)},textColor:e=>{n("textColor","color",e)},borderColor:e=>{n("borderColor","borderColor",e)},strokeColor:e=>{n("strokeColor","borderColor",e)}};for(const n of Object.keys(t.detail)){const i=e[n]||r[n];i&&i(t)}}}class d extends u{constructor(e){super(e,{isRenderable:e.renderInteractiveForms||!e.data.hasAppearance&&!!e.data.fieldValue})}setPropertyOnSiblings(e,t,n,r){const i=this.annotationStorage;for(const s of document.getElementsByName(e.name))if(s!==e){s[t]=n;const e=Object.create(null);e[r]=n,i.setValue(s.getAttribute("id"),e)}}render(){const e=this.annotationStorage,t=this.data.id;this.container.className="textWidgetAnnotation";let n=null;if(this.renderInteractiveForms){const r=e.getValue(t,{value:this.data.fieldValue,valueAsString:this.data.fieldValue}),i=r.valueAsString||r.value||"",s={userValue:null,formattedValue:null,beforeInputSelectionRange:null,beforeInputValue:null};this.data.multiLine?(n=document.createElement("textarea"),n.textContent=i):(n=document.createElement("input"),n.type="text",n.setAttribute("value",i)),s.userValue=i,n.setAttribute("id",t),n.addEventListener("input",(r=>{e.setValue(t,{value:r.target.value}),this.setPropertyOnSiblings(n,"value",r.target.value,"value")}));let a=e=>{s.formattedValue&&(e.target.value=s.formattedValue),e.target.scrollLeft=0,s.beforeInputSelectionRange=null};if(this.enableScripting&&this.hasJSActions){n.addEventListener("focus",(e=>{s.userValue&&(e.target.value=s.userValue)})),n.addEventListener("updatefromsandbox",(n=>{const r={value(n){s.userValue=n.detail.value||"",e.setValue(t,{value:s.userValue.toString()}),s.formattedValue||(n.target.value=s.userValue)},valueAsString(n){s.formattedValue=n.detail.valueAsString||"",n.target!==document.activeElement&&(n.target.value=s.formattedValue),e.setValue(t,{formattedValue:s.formattedValue})},selRange(e){const[t,n]=e.detail.selRange;t>=0&&n<e.target.value.length&&e.target.setSelectionRange(t,n)}};this._dispatchEventFromSandbox(r,n)})),n.addEventListener("keydown",(e=>{s.beforeInputValue=e.target.value;let n=-1;"Escape"===e.key?n=0:"Enter"===e.key?n=2:"Tab"===e.key&&(n=3),-1!==n&&(s.userValue=e.target.value,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:e.target.value,willCommit:!0,commitKey:n,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}))}));const r=a;a=null,n.addEventListener("blur",(e=>{this._mouseState.isDown&&(s.userValue=e.target.value,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:e.target.value,willCommit:!0,commitKey:1,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}})),r(e)})),n.addEventListener("mousedown",(e=>{s.beforeInputValue=e.target.value,s.beforeInputSelectionRange=null})),n.addEventListener("keyup",(e=>{e.target.selectionStart===e.target.selectionEnd&&(s.beforeInputSelectionRange=null)})),n.addEventListener("select",(e=>{s.beforeInputSelectionRange=[e.target.selectionStart,e.target.selectionEnd]})),this.data.actions?.Keystroke&&n.addEventListener("input",(e=>{let n=-1,r=-1;s.beforeInputSelectionRange&&([n,r]=s.beforeInputSelectionRange),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:s.beforeInputValue,change:e.data,willCommit:!1,selStart:n,selEnd:r}})})),this._setEventListeners(n,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(e=>e.target.value))}if(a&&n.addEventListener("blur",a),n.disabled=this.data.readOnly,n.name=this.data.fieldName,null!==this.data.maxLen&&(n.maxLength=this.data.maxLen),this.data.comb){const e=(this.data.rect[2]-this.data.rect[0])/this.data.maxLen;n.classList.add("comb"),n.style.letterSpacing=`calc(${e}px - 1ch)`}}else n=document.createElement("div"),n.textContent=this.data.fieldValue,n.style.verticalAlign="middle",n.style.display="table-cell";return this._setTextStyle(n),this.container.appendChild(n),this.container}_setTextStyle(e){const{fontSize:t,fontColor:n}=this.data.defaultAppearanceData,r=e.style;t&&(r.fontSize=`${t}px`),r.color=i.Util.makeHexColor(n[0],n[1],n[2]),null!==this.data.textAlignment&&(r.textAlign=["left","center","right"][this.data.textAlignment])}}class p extends u{constructor(e){super(e,{isRenderable:e.renderInteractiveForms})}render(){const e=this.annotationStorage,t=this.data,n=t.id;let r=e.getValue(n,{value:t.fieldValue&&(t.exportValue&&t.exportValue===t.fieldValue||!t.exportValue&&"Off"!==t.fieldValue)}).value;"string"==typeof r&&(r="Off"!==r,e.setValue(n,{value:r})),this.container.className="buttonWidgetAnnotation checkBox";const i=document.createElement("input");return i.disabled=t.readOnly,i.type="checkbox",i.name=this.data.fieldName,r&&i.setAttribute("checked",!0),i.setAttribute("id",n),i.addEventListener("change",(function(t){const r=t.target.name;for(const n of document.getElementsByName(r))n!==t.target&&(n.checked=!1,e.setValue(n.parentNode.getAttribute("data-annotation-id"),{value:!1}));e.setValue(n,{value:t.target.checked})})),this.enableScripting&&this.hasJSActions&&(i.addEventListener("updatefromsandbox",(t=>{const r={value(t){t.target.checked="Off"!==t.detail.value,e.setValue(n,{value:t.target.checked})}};this._dispatchEventFromSandbox(r,t)})),this._setEventListeners(i,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(e=>e.target.checked))),this.container.appendChild(i),this.container}}class g extends u{constructor(e){super(e,{isRenderable:e.renderInteractiveForms})}render(){this.container.className="buttonWidgetAnnotation radioButton";const e=this.annotationStorage,t=this.data,n=t.id;let r=e.getValue(n,{value:t.fieldValue===t.buttonValue}).value;"string"==typeof r&&(r=r!==t.buttonValue,e.setValue(n,{value:r}));const i=document.createElement("input");if(i.disabled=t.readOnly,i.type="radio",i.name=t.fieldName,r&&i.setAttribute("checked",!0),i.setAttribute("id",n),i.addEventListener("change",(function(t){const{target:r}=t;for(const t of document.getElementsByName(r.name))t!==r&&e.setValue(t.getAttribute("id"),{value:!1});e.setValue(n,{value:r.checked})})),this.enableScripting&&this.hasJSActions){const r=t.buttonValue;i.addEventListener("updatefromsandbox",(t=>{const i={value(t){const i=r===t.detail.value;for(const r of document.getElementsByName(t.target.name)){const t=r.getAttribute("id");r.checked=t===n&&i,e.setValue(t,{value:r.checked})}}};this._dispatchEventFromSandbox(i,t)})),this._setEventListeners(i,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(e=>e.target.checked))}return this.container.appendChild(i),this.container}}class f extends c{render(){const e=super.render();return e.className="buttonWidgetAnnotation pushButton",this.data.alternativeText&&(e.title=this.data.alternativeText),e}}class m extends u{constructor(e){super(e,{isRenderable:e.renderInteractiveForms})}render(){this.container.className="choiceWidgetAnnotation";const e=this.annotationStorage,t=this.data.id;e.getValue(t,{value:this.data.fieldValue.length>0?this.data.fieldValue[0]:void 0});const n=document.createElement("select");n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.setAttribute("id",t),this.data.combo||(n.size=this.data.options.length,this.data.multiSelect&&(n.multiple=!0));for(const e of this.data.options){const t=document.createElement("option");t.textContent=e.displayValue,t.value=e.exportValue,this.data.fieldValue.includes(e.exportValue)&&t.setAttribute("selected",!0),n.appendChild(t)}const r=(e,t)=>{const n=t?"value":"textContent",r=e.target.options;return e.target.multiple?Array.prototype.filter.call(r,(e=>e.selected)).map((e=>e[n])):-1===r.selectedIndex?null:r[r.selectedIndex][n]},i=e=>{const t=e.target.options;return Array.prototype.map.call(t,(e=>({displayValue:e.textContent,exportValue:e.value})))};return this.enableScripting&&this.hasJSActions?(n.addEventListener("updatefromsandbox",(s=>{const a={value(i){const s=n.options,a=i.detail.value,o=new Set(Array.isArray(a)?a:[a]);Array.prototype.forEach.call(s,(e=>{e.selected=o.has(e.value)})),e.setValue(t,{value:r(i,!0)})},multipleSelection(e){n.multiple=!0},remove(s){const a=n.options,o=s.detail.remove;a[o].selected=!1,n.remove(o),a.length>0&&-1===Array.prototype.findIndex.call(a,(e=>e.selected))&&(a[0].selected=!0),e.setValue(t,{value:r(s,!0),items:i(s)})},clear(r){for(;0!==n.length;)n.remove(0);e.setValue(t,{value:null,items:[]})},insert(s){const{index:a,displayValue:o,exportValue:l}=s.detail.insert,c=document.createElement("option");c.textContent=o,c.value=l,n.insertBefore(c,n.children[a]),e.setValue(t,{value:r(s,!0),items:i(s)})},items(s){const{items:a}=s.detail;for(;0!==n.length;)n.remove(0);for(const e of a){const{displayValue:t,exportValue:r}=e,i=document.createElement("option");i.textContent=t,i.value=r,n.appendChild(i)}n.options.length>0&&(n.options[0].selected=!0),e.setValue(t,{value:r(s,!0),items:i(s)})},indices(n){const i=new Set(n.detail.indices),s=n.target.options;Array.prototype.forEach.call(s,((e,t)=>{e.selected=i.has(t)})),e.setValue(t,{value:r(n,!0)})},editable(e){e.target.disabled=!e.detail.editable}};this._dispatchEventFromSandbox(a,s)})),n.addEventListener("input",(n=>{const i=r(n,!0),s=r(n,!1);e.setValue(t,{value:i}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:s,changeEx:i,willCommit:!0,commitKey:1,keyDown:!1}})})),this._setEventListeners(n,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"]],(e=>e.target.checked))):n.addEventListener("input",(function(n){e.setValue(t,{value:r(n)})})),this.container.appendChild(n),this.container}}class _ extends l{constructor(e){super(e,{isRenderable:!(!e.data.title&&!e.data.contents)})}render(){if(this.container.className="popupAnnotation",["Line","Square","Circle","PolyLine","Polygon","Ink"].includes(this.data.parentType))return this.container;const e=`[data-annotation-id="${this.data.parentId}"]`,t=this.layer.querySelectorAll(e);if(0===t.length)return this.container;const n=new b({container:this.container,trigger:Array.from(t),color:this.data.color,title:this.data.title,modificationDate:this.data.modificationDate,contents:this.data.contents}),r=this.page,s=i.Util.normalizeRect([this.data.parentRect[0],r.view[3]-this.data.parentRect[1]+r.view[1],this.data.parentRect[2],r.view[3]-this.data.parentRect[3]+r.view[1]]),a=s[0]+this.data.parentRect[2]-this.data.parentRect[0],o=s[1];return this.container.style.transformOrigin=`${-a}px ${-o}px`,this.container.style.left=`${a}px`,this.container.style.top=`${o}px`,this.container.appendChild(n.render()),this.container}}class b{constructor(e){this.container=e.container,this.trigger=e.trigger,this.color=e.color,this.title=e.title,this.modificationDate=e.modificationDate,this.contents=e.contents,this.hideWrapper=e.hideWrapper||!1,this.pinned=!1}render(){const e=document.createElement("div");e.className="popupWrapper",this.hideElement=this.hideWrapper?e:this.container,this.hideElement.hidden=!0;const t=document.createElement("div");t.className="popup";const n=this.color;if(n){const e=.7*(255-n[0])+n[0],r=.7*(255-n[1])+n[1],s=.7*(255-n[2])+n[2];t.style.backgroundColor=i.Util.makeHexColor(0|e,0|r,0|s)}const s=document.createElement("h1");s.textContent=this.title,t.appendChild(s);const a=r.PDFDateString.toDateObject(this.modificationDate);if(a){const e=document.createElement("span");e.textContent="{{date}}, {{time}}",e.dataset.l10nId="annotation_date_string",e.dataset.l10nArgs=JSON.stringify({date:a.toLocaleDateString(),time:a.toLocaleTimeString()}),t.appendChild(e)}const o=this._formatContents(this.contents);t.appendChild(o),Array.isArray(this.trigger)||(this.trigger=[this.trigger]);for(const e of this.trigger)e.addEventListener("click",this._toggle.bind(this)),e.addEventListener("mouseover",this._show.bind(this,!1)),e.addEventListener("mouseout",this._hide.bind(this,!1));return t.addEventListener("click",this._hide.bind(this,!0)),e.appendChild(t),e}_formatContents(e){const t=document.createElement("p"),n=e.split(/(?:\r\n?|\n)/);for(let e=0,r=n.length;e<r;++e){const i=n[e];t.appendChild(document.createTextNode(i)),e<r-1&&t.appendChild(document.createElement("br"))}return t}_toggle(){this.pinned?this._hide(!0):this._show(!0)}_show(e=!1){e&&(this.pinned=!0),this.hideElement.hidden&&(this.hideElement.hidden=!1,this.container.style.zIndex+=1)}_hide(e=!0){e&&(this.pinned=!1),this.hideElement.hidden||this.pinned||(this.hideElement.hidden=!0,this.container.style.zIndex-=1)}}class y extends l{constructor(e){super(e,{isRenderable:!!(e.data.hasPopup||e.data.title||e.data.contents),ignoreBorder:!0})}render(){return this.container.className="freeTextAnnotation",this.data.hasPopup||this._createPopup(null,this.data),this.container}}class v extends l{constructor(e){super(e,{isRenderable:!!(e.data.hasPopup||e.data.title||e.data.contents),ignoreBorder:!0})}render(){this.container.className="lineAnnotation";const e=this.data,t=e.rect[2]-e.rect[0],n=e.rect[3]-e.rect[1],r=this.svgFactory.create(t,n),i=this.svgFactory.createElement("svg:line");return i.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),i.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),i.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),i.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),i.setAttribute("stroke-width",e.borderStyle.width||1),i.setAttribute("stroke","transparent"),r.appendChild(i),this.container.append(r),this._createPopup(i,e),this.container}}class A extends l{constructor(e){super(e,{isRenderable:!!(e.data.hasPopup||e.data.title||e.data.contents),ignoreBorder:!0})}render(){this.container.className="squareAnnotation";const e=this.data,t=e.rect[2]-e.rect[0],n=e.rect[3]-e.rect[1],r=this.svgFactory.create(t,n),i=e.borderStyle.width,s=this.svgFactory.createElement("svg:rect");return s.setAttribute("x",i/2),s.setAttribute("y",i/2),s.setAttribute("width",t-i),s.setAttribute("height",n-i),s.setAttribute("stroke-width",i||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","none"),r.appendChild(s),this.container.append(r),this._createPopup(s,e),this.container}}class S extends l{constructor(e){super(e,{isRenderable:!!(e.data.hasPopup||e.data.title||e.data.contents),ignoreBorder:!0})}render(){this.container.className="circleAnnotation";const e=this.data,t=e.rect[2]-e.rect[0],n=e.rect[3]-e.rect[1],r=this.svgFactory.create(t,n),i=e.borderStyle.width,s=this.svgFactory.createElement("svg:ellipse");return s.setAttribute("cx",t/2),s.setAttribute("cy",n/2),s.setAttribute("rx",t/2-i/2),s.setAttribute("ry",n/2-i/2),s.setAttribute("stroke-width",i||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","none"),r.appendChild(s),this.container.append(r),this._createPopup(s,e),this.container}}class w extends l{constructor(e){super(e,{isRenderable:!!(e.data.hasPopup||e.data.title||e.data.contents),ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;const e=this.data,t=e.rect[2]-e.rect[0],n=e.rect[3]-e.rect[1],r=this.svgFactory.create(t,n);let i=[];for(const t of e.vertices){const n=t.x-e.rect[0],r=e.rect[3]-t.y;i.push(n+","+r)}i=i.join(" ");const s=this.svgFactory.createElement(this.svgElementName);return s.setAttribute("points",i),s.setAttribute("stroke-width",e.borderStyle.width||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","none"),r.appendChild(s),this.container.append(r),this._createPopup(s,e),this.container}}class x extends w{constructor(e){super(e),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class P extends l{constructor(e){super(e,{isRenderable:!!(e.data.hasPopup||e.data.title||e.data.contents),ignoreBorder:!0})}render(){return this.container.className="caretAnnotation",this.data.hasPopup||this._createPopup(null,this.data),this.container}}class C extends l{constructor(e){super(e,{isRenderable:!!(e.data.hasPopup||e.data.title||e.data.contents),ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;const e=this.data,t=e.rect[2]-e.rect[0],n=e.rect[3]-e.rect[1],r=this.svgFactory.create(t,n);for(const t of e.inkLists){let n=[];for(const r of t){const t=r.x-e.rect[0],i=e.rect[3]-r.y;n.push(`${t},${i}`)}n=n.join(" ");const i=this.svgFactory.createElement(this.svgElementName);i.setAttribute("points",n),i.setAttribute("stroke-width",e.borderStyle.width||1),i.setAttribute("stroke","transparent"),i.setAttribute("fill","none"),this._createPopup(i,e),r.appendChild(i)}return this.container.append(r),this.container}}class T extends l{constructor(e){super(e,{isRenderable:!!(e.data.hasPopup||e.data.title||e.data.contents),ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("highlightAnnotation"):(this.container.className="highlightAnnotation",this.container)}}class k extends l{constructor(e){super(e,{isRenderable:!!(e.data.hasPopup||e.data.title||e.data.contents),ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("underlineAnnotation"):(this.container.className="underlineAnnotation",this.container)}}class L extends l{constructor(e){super(e,{isRenderable:!!(e.data.hasPopup||e.data.title||e.data.contents),ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("squigglyAnnotation"):(this.container.className="squigglyAnnotation",this.container)}}class E extends l{constructor(e){super(e,{isRenderable:!!(e.data.hasPopup||e.data.title||e.data.contents),ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("strikeoutAnnotation"):(this.container.className="strikeoutAnnotation",this.container)}}class R extends l{constructor(e){super(e,{isRenderable:!!(e.data.hasPopup||e.data.title||e.data.contents),ignoreBorder:!0})}render(){return this.container.className="stampAnnotation",this.data.hasPopup||this._createPopup(null,this.data),this.container}}class M extends l{constructor(e){super(e,{isRenderable:!0});const{filename:t,content:n}=this.data.file;this.filename=(0,r.getFilenameFromUrl)(t),this.content=n,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,id:(0,i.stringToPDFString)(t),filename:t,content:n})}render(){this.container.className="fileAttachmentAnnotation";const e=document.createElement("div");return e.style.height=this.container.style.height,e.style.width=this.container.style.width,e.addEventListener("dblclick",this._download.bind(this)),this.data.hasPopup||!this.data.title&&!this.data.contents||this._createPopup(e,this.data),this.container.appendChild(e),this.container}_download(){this.downloadManager?.openOrDownloadData(this.container,this.content,this.filename)}}t.AnnotationLayer=class{static render(e){const t=[],n=[];for(const r of e.annotations)r&&(r.annotationType!==i.AnnotationType.POPUP?t.push(r):n.push(r));n.length&&t.push(...n);for(const n of t){const t=o.create({data:n,layer:e.div,page:e.page,viewport:e.viewport,linkService:e.linkService,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderInteractiveForms:!1!==e.renderInteractiveForms,svgFactory:new r.DOMSVGFactory,annotationStorage:e.annotationStorage||new s.AnnotationStorage,enableScripting:e.enableScripting,hasJSActions:e.hasJSActions,mouseState:e.mouseState||{isDown:!1}});if(t.isRenderable){const r=t.render();if(n.hidden&&(r.style.visibility="hidden"),Array.isArray(r))for(const t of r)e.div.appendChild(t);else t instanceof _?e.div.prepend(r):e.div.appendChild(r)}}}static update(e){const t=`matrix(${e.viewport.transform.join(",")})`;for(const n of e.annotations){const r=e.div.querySelectorAll(`[data-annotation-id="${n.id}"]`);if(r)for(const e of r)e.style.transform=t}e.div.hidden=!1}}},(e,t)=>{function n(e){return Math.floor(255*Math.max(0,Math.min(1,e))).toString(16).padStart(2,"0")}Object.defineProperty(t,"__esModule",{value:!0}),t.ColorConverters=void 0,t.ColorConverters=class{static CMYK_G([e,t,n,r]){return["G",1-Math.min(1,.3*e+.59*n+.11*t+r)]}static G_CMYK([e]){return["CMYK",0,0,0,1-e]}static G_RGB([e]){return["RGB",e,e,e]}static G_HTML([e]){const t=n(e);return`#${t}${t}${t}`}static RGB_G([e,t,n]){return["G",.3*e+.59*t+.11*n]}static RGB_HTML([e,t,r]){return`#${n(e)}${n(t)}${n(r)}`}static T_HTML(){return"#00000000"}static CMYK_RGB([e,t,n,r]){return["RGB",1-Math.min(1,e+r),1-Math.min(1,n+r),1-Math.min(1,t+r)]}static CMYK_HTML(e){return this.RGB_HTML(this.CMYK_RGB(e))}static RGB_CMYK([e,t,n]){const r=1-e,i=1-t,s=1-n;return["CMYK",r,i,s,Math.min(r,i,s)]}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.renderTextLayer=function(e){const t=new u({textContent:e.textContent,textContentStream:e.textContentStream,container:e.container,viewport:e.viewport,textDivs:e.textDivs,textContentItemsStr:e.textContentItemsStr,enhanceTextSelection:e.enhanceTextSelection});return t._render(e.timeout),t};var r=n(2);const i=30,s=new Map,a=/^\s+$/g;function o(e,t,n,o){const l=document.createElement("span"),c={angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,originalTransform:null,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0,scale:1};e._textDivs.push(l);const h=r.Util.transform(e._viewport.transform,t.transform);let u=Math.atan2(h[1],h[0]);const d=n[t.fontName];d.vertical&&(u+=Math.PI/2);const p=Math.hypot(h[2],h[3]),g=p*function(e,t){const n=s.get(e);if(n)return n;t.save(),t.font=`30px ${e}`;const r=t.measureText("");let a=r.fontBoundingBoxAscent,o=Math.abs(r.fontBoundingBoxDescent);if(a){t.restore();const n=a/(a+o);return s.set(e,n),n}t.strokeStyle="red",t.clearRect(0,0,i,i),t.strokeText("g",0,0);let l=t.getImageData(0,0,i,i).data;o=0;for(let e=l.length-1-3;e>=0;e-=4)if(l[e]>0){o=Math.ceil(e/4/i);break}t.clearRect(0,0,i,i),t.strokeText("A",0,i),l=t.getImageData(0,0,i,i).data,a=0;for(let e=0,t=l.length;e<t;e+=4)if(l[e]>0){a=i-Math.floor(e/4/i);break}if(t.restore(),a){const t=a/(a+o);return s.set(e,t),t}return s.set(e,.8),.8}(d.fontFamily,o);let f,m;0===u?(f=h[4],m=h[5]-g):(f=h[4]+g*Math.sin(u),m=h[5]-g*Math.cos(u)),l.style.left=`${f}px`,l.style.top=`${m}px`,l.style.fontSize=`${p}px`,l.style.fontFamily=d.fontFamily,l.setAttribute("role","presentation"),l.textContent=t.str,l.dir=t.dir,e._fontInspectorEnabled&&(l.dataset.fontName=t.fontName),0!==u&&(c.angle=u*(180/Math.PI));let _=!1;if(t.str.length>1||e._enhanceTextSelection&&a.test(t.str))_=!0;else if(t.transform[0]!==t.transform[3]){const e=Math.abs(t.transform[0]),n=Math.abs(t.transform[3]);e!==n&&Math.max(e,n)/Math.min(e,n)>1.5&&(_=!0)}if(_&&(d.vertical?c.canvasWidth=t.height*e._viewport.scale:c.canvasWidth=t.width*e._viewport.scale),e._textDivProperties.set(l,c),e._textContentStream&&e._layoutText(l),e._enhanceTextSelection&&c.hasText){let n=1,i=0;0!==u&&(n=Math.cos(u),i=Math.sin(u));const s=(d.vertical?t.height:t.width)*e._viewport.scale,a=p;let o,c;0!==u?(o=[n,i,-i,n,f,m],c=r.Util.getAxialAlignedBoundingBox([0,0,s,a],o)):c=[f,m,f+s,m+a],e._bounds.push({left:c[0],top:c[1],right:c[2],bottom:c[3],div:l,size:[s,a],m:o})}}function l(e){if(e._canceled)return;const t=e._textDivs,n=e._capability,r=t.length;if(r>1e5)return e._renderingDone=!0,void n.resolve();if(!e._textContentStream)for(let n=0;n<r;n++)e._layoutText(t[n]);e._renderingDone=!0,n.resolve()}function c(e,t,n){let r=0;for(let i=0;i<n;i++){const n=e[t++];n>0&&(r=r?Math.min(n,r):n)}return r}function h(e,t){t.sort((function(e,t){return e.x1-t.x1||e.index-t.index}));const n=[{start:-1/0,end:1/0,boundary:{x1:-1/0,y1:-1/0,x2:0,y2:1/0,index:-1,x1New:0,x2New:0}}];for(const e of t){let t=0;for(;t<n.length&&n[t].end<=e.y1;)t++;let r,i,s=n.length-1;for(;s>=0&&n[s].start>=e.y2;)s--;let a,o,l=-1/0;for(a=t;a<=s;a++){let t;r=n[a],i=r.boundary,t=i.x2>e.x1?i.index>e.index?i.x1New:e.x1:void 0===i.x2New?(i.x2+e.x1)/2:i.x2New,t>l&&(l=t)}for(e.x1New=l,a=t;a<=s;a++)r=n[a],i=r.boundary,void 0===i.x2New?i.x2>e.x1?i.index>e.index&&(i.x2New=i.x2):i.x2New=l:i.x2New>l&&(i.x2New=Math.max(l,i.x2));const c=[];let h=null;for(a=t;a<=s;a++){r=n[a],i=r.boundary;const t=i.x2>e.x2?i:e;h===t?c[c.length-1].end=r.end:(c.push({start:r.start,end:r.end,boundary:t}),h=t)}for(n[t].start<e.y1&&(c[0].start=e.y1,c.unshift({start:n[t].start,end:e.y1,boundary:n[t].boundary})),e.y2<n[s].end&&(c[c.length-1].end=e.y2,c.push({start:e.y2,end:n[s].end,boundary:n[s].boundary})),a=t;a<=s;a++){if(r=n[a],i=r.boundary,void 0!==i.x2New)continue;let e=!1;for(o=t-1;!e&&o>=0&&n[o].start>=i.y1;o--)e=n[o].boundary===i;for(o=s+1;!e&&o<n.length&&n[o].end<=i.y2;o++)e=n[o].boundary===i;for(o=0;!e&&o<c.length;o++)e=c[o].boundary===i;e||(i.x2New=l)}Array.prototype.splice.apply(n,[t,s-t+1].concat(c))}for(const t of n){const n=t.boundary;void 0===n.x2New&&(n.x2New=Math.max(e,n.x2))}}class u{constructor({textContent:e,textContentStream:t,container:n,viewport:i,textDivs:s,textContentItemsStr:a,enhanceTextSelection:o}){this._textContent=e,this._textContentStream=t,this._container=n,this._document=n.ownerDocument,this._viewport=i,this._textDivs=s||[],this._textContentItemsStr=a||[],this._enhanceTextSelection=!!o,this._fontInspectorEnabled=!!globalThis.FontInspector?.enabled,this._reader=null,this._layoutTextLastFontSize=null,this._layoutTextLastFontFamily=null,this._layoutTextCtx=null,this._textDivProperties=new WeakMap,this._renderingDone=!1,this._canceled=!1,this._capability=(0,r.createPromiseCapability)(),this._renderTimer=null,this._bounds=[],this._capability.promise.finally((()=>{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 r.AbortException("TextLayer task cancelled.")),this._reader=null),null!==this._renderTimer&&(clearTimeout(this._renderTimer),this._renderTimer=null),this._capability.reject(new Error("TextLayer task cancelled."))}_processItems(e,t){for(let n=0,r=e.length;n<r;n++)if(void 0!==e[n].str)this._textContentItemsStr.push(e[n].str),o(this,e[n],t,this._layoutTextCtx);else if("beginMarkedContentProps"===e[n].type||"beginMarkedContent"===e[n].type){const t=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),null!==e[n].id&&this._container.setAttribute("id",`${e[n].id}`),t.appendChild(this._container)}else"endMarkedContent"===e[n].type&&(this._container=this._container.parentNode)}_layoutText(e){const t=this._textDivProperties.get(e);let n="";if(0!==t.canvasWidth&&t.hasText){const{fontSize:r,fontFamily:i}=e.style;r===this._layoutTextLastFontSize&&i===this._layoutTextLastFontFamily||(this._layoutTextCtx.font=`${r} ${i}`,this._layoutTextLastFontSize=r,this._layoutTextLastFontFamily=i);const{width:s}=this._layoutTextCtx.measureText(e.textContent);s>0&&(t.scale=t.canvasWidth/s,n=`scaleX(${t.scale})`)}if(0!==t.angle&&(n=`rotate(${t.angle}deg) ${n}`),n.length>0&&(this._enhanceTextSelection&&(t.originalTransform=n),e.style.transform=n),t.hasText&&this._container.appendChild(e),t.hasEOL){const e=document.createElement("br");e.setAttribute("role","presentation"),this._container.appendChild(e)}}_render(e=0){const t=(0,r.createPromiseCapability)();let n=Object.create(null);const s=this._document.createElement("canvas");if(s.height=s.width=i,s.mozOpaque=!0,this._layoutTextCtx=s.getContext("2d",{alpha:!1}),this._textContent){const e=this._textContent.items,n=this._textContent.styles;this._processItems(e,n),t.resolve()}else{if(!this._textContentStream)throw new Error('Neither "textContent" nor "textContentStream" parameters specified.');{const e=()=>{this._reader.read().then((({value:r,done:i})=>{i?t.resolve():(Object.assign(n,r.styles),this._processItems(r.items,n),e())}),t.reject)};this._reader=this._textContentStream.getReader(),e()}}t.promise.then((()=>{n=null,e?this._renderTimer=setTimeout((()=>{l(this),this._renderTimer=null}),e):l(this)}),this._capability.reject)}expandTextDivs(e=!1){if(!this._enhanceTextSelection||!this._renderingDone)return;null!==this._bounds&&(function(e){const t=e._bounds,n=e._viewport,i=function(e,t,n){const r=n.map((function(e,t){return{x1:e.left,y1:e.top,x2:e.right,y2:e.bottom,index:t,x1New:void 0,x2New:void 0}}));h(e,r);const i=new Array(n.length);for(const e of r){const t=e.index;i[t]={left:e.x1New,top:0,right:e.x2New,bottom:0}}n.map((function(t,n){const s=i[n],a=r[n];a.x1=t.top,a.y1=e-s.right,a.x2=t.bottom,a.y2=e-s.left,a.index=n,a.x1New=void 0,a.x2New=void 0})),h(t,r);for(const e of r){const t=e.index;i[t].top=e.x1New,i[t].bottom=e.x2New}return i}(n.width,n.height,t);for(let n=0;n<i.length;n++){const s=t[n].div,a=e._textDivProperties.get(s);if(0===a.angle){a.paddingLeft=t[n].left-i[n].left,a.paddingTop=t[n].top-i[n].top,a.paddingRight=i[n].right-t[n].right,a.paddingBottom=i[n].bottom-t[n].bottom,e._textDivProperties.set(s,a);continue}const o=i[n],l=t[n],h=l.m,u=h[0],d=h[1],p=[[0,0],[0,l.size[1]],[l.size[0],0],l.size],g=new Float64Array(64);for(let e=0,t=p.length;e<t;e++){const t=r.Util.applyTransform(p[e],h);g[e+0]=u&&(o.left-t[0])/u,g[e+4]=d&&(o.top-t[1])/d,g[e+8]=u&&(o.right-t[0])/u,g[e+12]=d&&(o.bottom-t[1])/d,g[e+16]=d&&(o.left-t[0])/-d,g[e+20]=u&&(o.top-t[1])/u,g[e+24]=d&&(o.right-t[0])/-d,g[e+28]=u&&(o.bottom-t[1])/u,g[e+32]=u&&(o.left-t[0])/-u,g[e+36]=d&&(o.top-t[1])/-d,g[e+40]=u&&(o.right-t[0])/-u,g[e+44]=d&&(o.bottom-t[1])/-d,g[e+48]=d&&(o.left-t[0])/d,g[e+52]=u&&(o.top-t[1])/-u,g[e+56]=d&&(o.right-t[0])/d,g[e+60]=u&&(o.bottom-t[1])/-u}const f=1+Math.min(Math.abs(u),Math.abs(d));a.paddingLeft=c(g,32,16)/f,a.paddingTop=c(g,48,16)/f,a.paddingRight=c(g,0,16)/f,a.paddingBottom=c(g,16,16)/f,e._textDivProperties.set(s,a)}}(this),this._bounds=null);const t=[],n=[];for(let r=0,i=this._textDivs.length;r<i;r++){const i=this._textDivs[r],s=this._textDivProperties.get(i);s.hasText&&(e?(t.length=0,n.length=0,s.originalTransform&&t.push(s.originalTransform),s.paddingTop>0?(n.push(`${s.paddingTop}px`),t.push(`translateY(${-s.paddingTop}px)`)):n.push(0),s.paddingRight>0?n.push(s.paddingRight/s.scale+"px"):n.push(0),s.paddingBottom>0?n.push(`${s.paddingBottom}px`):n.push(0),s.paddingLeft>0?(n.push(s.paddingLeft/s.scale+"px"),t.push(`translateX(${-s.paddingLeft/s.scale}px)`)):n.push(0),i.style.padding=n.join(" "),t.length&&(i.style.transform=t.join(" "))):(i.style.padding=null,i.style.transform=s.originalTransform))}}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SVGGraphics=void 0;var r=n(2),i=n(1),s=n(4);let a=class{constructor(){(0,r.unreachable)("Not implemented: SVGGraphics")}};t.SVGGraphics=a;{const e={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},n="http://www.w3.org/XML/1998/namespace",o="http://www.w3.org/1999/xlink",l=["butt","round","square"],c=["miter","round","bevel"],h=function(){const e=new Uint8Array([137,80,78,71,13,10,26,10]),t=new Int32Array(256);for(let e=0;e<256;e++){let n=e;for(let e=0;e<8;e++)n=1&n?3988292384^n>>1&2147483647:n>>1&2147483647;t[e]=n}function n(e,n,r,i){let s=i;const a=n.length;r[s]=a>>24&255,r[s+1]=a>>16&255,r[s+2]=a>>8&255,r[s+3]=255&a,s+=4,r[s]=255&e.charCodeAt(0),r[s+1]=255&e.charCodeAt(1),r[s+2]=255&e.charCodeAt(2),r[s+3]=255&e.charCodeAt(3),s+=4,r.set(n,s),s+=n.length;const o=function(e,n,r){let i=-1;for(let s=n;s<r;s++){const n=255&(i^e[s]);i=i>>>8^t[n]}return-1^i}(r,i+4,s);r[s]=o>>24&255,r[s+1]=o>>16&255,r[s+2]=o>>8&255,r[s+3]=255&o}function i(e){let t=e.length;const n=65535,r=Math.ceil(t/n),i=new Uint8Array(2+t+5*r+4);let s=0;i[s++]=120,i[s++]=156;let a=0;for(;t>n;)i[s++]=0,i[s++]=255,i[s++]=255,i[s++]=0,i[s++]=0,i.set(e.subarray(a,a+n),s),s+=n,a+=n,t-=n;i[s++]=1,i[s++]=255&t,i[s++]=t>>8&255,i[s++]=255&~t,i[s++]=(65535&~t)>>8&255,i.set(e.subarray(a),s),s+=e.length-a;const o=function(e,t,n){let r=1,i=0;for(let t=0;t<n;++t)r=(r+(255&e[t]))%65521,i=(i+r)%65521;return i<<16|r}(e,0,e.length);return i[s++]=o>>24&255,i[s++]=o>>16&255,i[s++]=o>>8&255,i[s++]=255&o,i}return function(t,a,o){return function(t,a,o,l){const c=t.width,h=t.height;let u,d,p;const g=t.data;switch(a){case r.ImageKind.GRAYSCALE_1BPP:d=0,u=1,p=c+7>>3;break;case r.ImageKind.RGB_24BPP:d=2,u=8,p=3*c;break;case r.ImageKind.RGBA_32BPP:d=6,u=8,p=4*c;break;default:throw new Error("invalid format")}const f=new Uint8Array((1+p)*h);let m=0,_=0;for(let e=0;e<h;++e)f[m++]=0,f.set(g.subarray(_,_+p),m),_+=p,m+=p;if(a===r.ImageKind.GRAYSCALE_1BPP&&l){m=0;for(let e=0;e<h;e++){m++;for(let e=0;e<p;e++)f[m++]^=255}}const b=new Uint8Array([c>>24&255,c>>16&255,c>>8&255,255&c,h>>24&255,h>>16&255,h>>8&255,255&h,u,d,0,0,0]),y=function(e){if(!s.isNodeJS)return i(e);try{let t;t=parseInt(process.versions.node)>=8?e:Buffer.from(e);const n=__webpack_require__(258).deflateSync(t,{level:9});return n instanceof Uint8Array?n:new Uint8Array(n)}catch(e){(0,r.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+e)}return i(e)}(f),v=e.length+36+b.length+y.length,A=new Uint8Array(v);let S=0;return A.set(e,S),S+=e.length,n("IHDR",b,A,S),S+=12+b.length,n("IDATA",y,A,S),S+=12+y.length,n("IEND",new Uint8Array(0),A,S),(0,r.createObjectURL)(A,"image/png",o)}(t,void 0===t.kind?r.ImageKind.GRAYSCALE_1BPP:t.kind,a,o)}}();class u{constructor(){this.fontSizeScale=1,this.fontWeight=e.fontWeight,this.fontSize=0,this.textMatrix=r.IDENTITY_MATRIX,this.fontMatrix=r.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=r.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=e.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(e,t){this.x=e,this.y=t}}function d(e){let t=[];const n=[];for(const r of e)"save"!==r.fn?"restore"===r.fn?t=n.pop():t.push(r):(t.push({fnId:92,fn:"group",items:[]}),n.push(t),t=t[t.length-1].items);return t}function p(e){if(Number.isInteger(e))return e.toString();const t=e.toFixed(10);let n=t.length-1;if("0"!==t[n])return t;do{n--}while("0"===t[n]);return t.substring(0,"."===t[n]?n:n+1)}function g(e){if(0===e[4]&&0===e[5]){if(0===e[1]&&0===e[2])return 1===e[0]&&1===e[3]?"":`scale(${p(e[0])} ${p(e[3])})`;if(e[0]===e[3]&&e[1]===-e[2])return`rotate(${p(180*Math.acos(e[0])/Math.PI)})`}else if(1===e[0]&&0===e[1]&&0===e[2]&&1===e[3])return`translate(${p(e[4])} ${p(e[5])})`;return`matrix(${p(e[0])} ${p(e[1])} ${p(e[2])} ${p(e[3])} ${p(e[4])} ${p(e[5])})`}let f=0,m=0,_=0;t.SVGGraphics=a=class{constructor(e,t,n=!1){this.svgFactory=new i.DOMSVGFactory,this.current=new u,this.transformMatrix=r.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=e,this.objs=t,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!n,this._operatorIdMapping=[];for(const e in r.OPS)this._operatorIdMapping[r.OPS[e]]=e}save(){this.transformStack.push(this.transformMatrix);const e=this.current;this.extraStack.push(e),this.current=e.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(e){this.save(),this.executeOpTree(e),this.restore()}loadDependencies(e){const t=e.fnArray,n=e.argsArray;for(let e=0,i=t.length;e<i;e++)if(t[e]===r.OPS.dependency)for(const t of n[e]){const e=t.startsWith("g_")?this.commonObjs:this.objs,n=new Promise((n=>{e.get(t,n)}));this.current.dependencies.push(n)}return Promise.all(this.current.dependencies)}transform(e,t,n,i,s,a){const o=[e,t,n,i,s,a];this.transformMatrix=r.Util.transform(this.transformMatrix,o),this.tgrp=null}getSVG(e,t){this.viewport=t;const n=this._initialize(t);return this.loadDependencies(e).then((()=>(this.transformMatrix=r.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(e)),n)))}convertOpList(e){const t=this._operatorIdMapping,n=e.argsArray,r=e.fnArray,i=[];for(let e=0,s=r.length;e<s;e++){const s=r[e];i.push({fnId:s,fn:t[s],args:n[e]})}return d(i)}executeOpTree(e){for(const t of e){const e=t.fn,n=t.fnId,i=t.args;switch(0|n){case r.OPS.beginText:this.beginText();break;case r.OPS.dependency:break;case r.OPS.setLeading:this.setLeading(i);break;case r.OPS.setLeadingMoveText:this.setLeadingMoveText(i[0],i[1]);break;case r.OPS.setFont:this.setFont(i);break;case r.OPS.showText:case r.OPS.showSpacedText:this.showText(i[0]);break;case r.OPS.endText:this.endText();break;case r.OPS.moveText:this.moveText(i[0],i[1]);break;case r.OPS.setCharSpacing:this.setCharSpacing(i[0]);break;case r.OPS.setWordSpacing:this.setWordSpacing(i[0]);break;case r.OPS.setHScale:this.setHScale(i[0]);break;case r.OPS.setTextMatrix:this.setTextMatrix(i[0],i[1],i[2],i[3],i[4],i[5]);break;case r.OPS.setTextRise:this.setTextRise(i[0]);break;case r.OPS.setTextRenderingMode:this.setTextRenderingMode(i[0]);break;case r.OPS.setLineWidth:this.setLineWidth(i[0]);break;case r.OPS.setLineJoin:this.setLineJoin(i[0]);break;case r.OPS.setLineCap:this.setLineCap(i[0]);break;case r.OPS.setMiterLimit:this.setMiterLimit(i[0]);break;case r.OPS.setFillRGBColor:this.setFillRGBColor(i[0],i[1],i[2]);break;case r.OPS.setStrokeRGBColor:this.setStrokeRGBColor(i[0],i[1],i[2]);break;case r.OPS.setStrokeColorN:this.setStrokeColorN(i);break;case r.OPS.setFillColorN:this.setFillColorN(i);break;case r.OPS.shadingFill:this.shadingFill(i[0]);break;case r.OPS.setDash:this.setDash(i[0],i[1]);break;case r.OPS.setRenderingIntent:this.setRenderingIntent(i[0]);break;case r.OPS.setFlatness:this.setFlatness(i[0]);break;case r.OPS.setGState:this.setGState(i[0]);break;case r.OPS.fill:this.fill();break;case r.OPS.eoFill:this.eoFill();break;case r.OPS.stroke:this.stroke();break;case r.OPS.fillStroke:this.fillStroke();break;case r.OPS.eoFillStroke:this.eoFillStroke();break;case r.OPS.clip:this.clip("nonzero");break;case r.OPS.eoClip:this.clip("evenodd");break;case r.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case r.OPS.paintImageXObject:this.paintImageXObject(i[0]);break;case r.OPS.paintInlineImageXObject:this.paintInlineImageXObject(i[0]);break;case r.OPS.paintImageMaskXObject:this.paintImageMaskXObject(i[0]);break;case r.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(i[0],i[1]);break;case r.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case r.OPS.closePath:this.closePath();break;case r.OPS.closeStroke:this.closeStroke();break;case r.OPS.closeFillStroke:this.closeFillStroke();break;case r.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case r.OPS.nextLine:this.nextLine();break;case r.OPS.transform:this.transform(i[0],i[1],i[2],i[3],i[4],i[5]);break;case r.OPS.constructPath:this.constructPath(i[0],i[1]);break;case r.OPS.endPath:this.endPath();break;case 92:this.group(t.items);break;default:(0,r.warn)(`Unimplemented operator ${e}`)}}}setWordSpacing(e){this.current.wordSpacing=e}setCharSpacing(e){this.current.charSpacing=e}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(e,t,n,r,i,s){const a=this.current;a.textMatrix=a.lineMatrix=[e,t,n,r,i,s],a.textMatrixScale=Math.hypot(e,t),a.x=a.lineX=0,a.y=a.lineY=0,a.xcoords=[],a.ycoords=[],a.tspan=this.svgFactory.createElement("svg:tspan"),a.tspan.setAttributeNS(null,"font-family",a.fontFamily),a.tspan.setAttributeNS(null,"font-size",`${p(a.fontSize)}px`),a.tspan.setAttributeNS(null,"y",p(-a.y)),a.txtElement=this.svgFactory.createElement("svg:text"),a.txtElement.appendChild(a.tspan)}beginText(){const e=this.current;e.x=e.lineX=0,e.y=e.lineY=0,e.textMatrix=r.IDENTITY_MATRIX,e.lineMatrix=r.IDENTITY_MATRIX,e.textMatrixScale=1,e.tspan=this.svgFactory.createElement("svg:tspan"),e.txtElement=this.svgFactory.createElement("svg:text"),e.txtgrp=this.svgFactory.createElement("svg:g"),e.xcoords=[],e.ycoords=[]}moveText(e,t){const n=this.current;n.x=n.lineX+=e,n.y=n.lineY+=t,n.xcoords=[],n.ycoords=[],n.tspan=this.svgFactory.createElement("svg:tspan"),n.tspan.setAttributeNS(null,"font-family",n.fontFamily),n.tspan.setAttributeNS(null,"font-size",`${p(n.fontSize)}px`),n.tspan.setAttributeNS(null,"y",p(-n.y))}showText(t){const i=this.current,s=i.font,a=i.fontSize;if(0===a)return;const o=i.fontSizeScale,l=i.charSpacing,c=i.wordSpacing,h=i.fontDirection,u=i.textHScale*h,d=s.vertical,f=d?1:-1,m=s.defaultVMetrics,_=a*i.fontMatrix[0];let b=0;for(const e of t){if(null===e){b+=h*c;continue}if((0,r.isNum)(e)){b+=f*e*a/1e3;continue}const t=(e.isSpace?c:0)+l,n=e.fontChar;let u,p,g,y=e.width;if(d){let t;const n=e.vmetric||m;t=e.vmetric?n[1]:.5*y,t=-t*_;const r=n[2]*_;y=n?-n[0]:y,u=t/o,p=(b+r)/o}else u=b/o,p=0;(e.isInFont||s.missingFile)&&(i.xcoords.push(i.x+u),d&&i.ycoords.push(-i.y+p),i.tspan.textContent+=n),g=d?y*_-t*h:y*_+t*h,b+=g}i.tspan.setAttributeNS(null,"x",i.xcoords.map(p).join(" ")),d?i.tspan.setAttributeNS(null,"y",i.ycoords.map(p).join(" ")):i.tspan.setAttributeNS(null,"y",p(-i.y)),d?i.y-=b:i.x+=b*u,i.tspan.setAttributeNS(null,"font-family",i.fontFamily),i.tspan.setAttributeNS(null,"font-size",`${p(i.fontSize)}px`),i.fontStyle!==e.fontStyle&&i.tspan.setAttributeNS(null,"font-style",i.fontStyle),i.fontWeight!==e.fontWeight&&i.tspan.setAttributeNS(null,"font-weight",i.fontWeight);const y=i.textRenderingMode&r.TextRenderingMode.FILL_STROKE_MASK;if(y===r.TextRenderingMode.FILL||y===r.TextRenderingMode.FILL_STROKE?(i.fillColor!==e.fillColor&&i.tspan.setAttributeNS(null,"fill",i.fillColor),i.fillAlpha<1&&i.tspan.setAttributeNS(null,"fill-opacity",i.fillAlpha)):i.textRenderingMode===r.TextRenderingMode.ADD_TO_PATH?i.tspan.setAttributeNS(null,"fill","transparent"):i.tspan.setAttributeNS(null,"fill","none"),y===r.TextRenderingMode.STROKE||y===r.TextRenderingMode.FILL_STROKE){const e=1/(i.textMatrixScale||1);this._setStrokeAttributes(i.tspan,e)}let v=i.textMatrix;0!==i.textRise&&(v=v.slice(),v[5]+=i.textRise),i.txtElement.setAttributeNS(null,"transform",`${g(v)} scale(${p(u)}, -1)`),i.txtElement.setAttributeNS(n,"xml:space","preserve"),i.txtElement.appendChild(i.tspan),i.txtgrp.appendChild(i.txtElement),this._ensureTransformGroup().appendChild(i.txtElement)}setLeadingMoveText(e,t){this.setLeading(-t),this.moveText(e,t)}addFontStyle(e){if(!e.data)throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');this.cssStyle||(this.cssStyle=this.svgFactory.createElement("svg:style"),this.cssStyle.setAttributeNS(null,"type","text/css"),this.defs.appendChild(this.cssStyle));const t=(0,r.createObjectURL)(e.data,e.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${e.loadedName}"; src: url(${t}); }\n`}setFont(e){const t=this.current,n=this.commonObjs.get(e[0]);let i=e[1];t.font=n,!this.embedFonts||n.missingFile||this.embeddedFonts[n.loadedName]||(this.addFontStyle(n),this.embeddedFonts[n.loadedName]=n),t.fontMatrix=n.fontMatrix||r.FONT_IDENTITY_MATRIX;let s="normal";n.black?s="900":n.bold&&(s="bold");const a=n.italic?"italic":"normal";i<0?(i=-i,t.fontDirection=-1):t.fontDirection=1,t.fontSize=i,t.fontFamily=n.loadedName,t.fontWeight=s,t.fontStyle=a,t.tspan=this.svgFactory.createElement("svg:tspan"),t.tspan.setAttributeNS(null,"y",p(-t.y)),t.xcoords=[],t.ycoords=[]}endText(){const e=this.current;e.textRenderingMode&r.TextRenderingMode.ADD_TO_PATH_FLAG&&e.txtElement?.hasChildNodes()&&(e.element=e.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(e){e>0&&(this.current.lineWidth=e)}setLineCap(e){this.current.lineCap=l[e]}setLineJoin(e){this.current.lineJoin=c[e]}setMiterLimit(e){this.current.miterLimit=e}setStrokeAlpha(e){this.current.strokeAlpha=e}setStrokeRGBColor(e,t,n){this.current.strokeColor=r.Util.makeHexColor(e,t,n)}setFillAlpha(e){this.current.fillAlpha=e}setFillRGBColor(e,t,n){this.current.fillColor=r.Util.makeHexColor(e,t,n),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(e){this.current.strokeColor=this._makeColorN_Pattern(e)}setFillColorN(e){this.current.fillColor=this._makeColorN_Pattern(e)}shadingFill(e){const t=this.viewport.width,n=this.viewport.height,i=r.Util.inverseTransform(this.transformMatrix),s=r.Util.applyTransform([0,0],i),a=r.Util.applyTransform([0,n],i),o=r.Util.applyTransform([t,0],i),l=r.Util.applyTransform([t,n],i),c=Math.min(s[0],a[0],o[0],l[0]),h=Math.min(s[1],a[1],o[1],l[1]),u=Math.max(s[0],a[0],o[0],l[0]),d=Math.max(s[1],a[1],o[1],l[1]),p=this.svgFactory.createElement("svg:rect");p.setAttributeNS(null,"x",c),p.setAttributeNS(null,"y",h),p.setAttributeNS(null,"width",u-c),p.setAttributeNS(null,"height",d-h),p.setAttributeNS(null,"fill",this._makeShadingPattern(e)),this.current.fillAlpha<1&&p.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().appendChild(p)}_makeColorN_Pattern(e){return"TilingPattern"===e[0]?this._makeTilingPattern(e):this._makeShadingPattern(e)}_makeTilingPattern(e){const t=e[1],n=e[2],i=e[3]||r.IDENTITY_MATRIX,[s,a,o,l]=e[4],c=e[5],h=e[6],u=e[7],d="shading"+_++,[p,g,f,m]=r.Util.normalizeRect([...r.Util.applyTransform([s,a],i),...r.Util.applyTransform([o,l],i)]),[b,y]=r.Util.singularValueDecompose2dScale(i),v=c*b,A=h*y,S=this.svgFactory.createElement("svg:pattern");S.setAttributeNS(null,"id",d),S.setAttributeNS(null,"patternUnits","userSpaceOnUse"),S.setAttributeNS(null,"width",v),S.setAttributeNS(null,"height",A),S.setAttributeNS(null,"x",`${p}`),S.setAttributeNS(null,"y",`${g}`);const w=this.svg,x=this.transformMatrix,P=this.current.fillColor,C=this.current.strokeColor,T=this.svgFactory.create(f-p,m-g);if(this.svg=T,this.transformMatrix=i,2===u){const e=r.Util.makeHexColor(...t);this.current.fillColor=e,this.current.strokeColor=e}return this.executeOpTree(this.convertOpList(n)),this.svg=w,this.transformMatrix=x,this.current.fillColor=P,this.current.strokeColor=C,S.appendChild(T.childNodes[0]),this.defs.appendChild(S),`url(#${d})`}_makeShadingPattern(e){switch(e[0]){case"RadialAxial":const t="shading"+_++,n=e[3];let i;switch(e[1]){case"axial":const n=e[4],r=e[5];i=this.svgFactory.createElement("svg:linearGradient"),i.setAttributeNS(null,"id",t),i.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),i.setAttributeNS(null,"x1",n[0]),i.setAttributeNS(null,"y1",n[1]),i.setAttributeNS(null,"x2",r[0]),i.setAttributeNS(null,"y2",r[1]);break;case"radial":const s=e[4],a=e[5],o=e[6],l=e[7];i=this.svgFactory.createElement("svg:radialGradient"),i.setAttributeNS(null,"id",t),i.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),i.setAttributeNS(null,"cx",a[0]),i.setAttributeNS(null,"cy",a[1]),i.setAttributeNS(null,"r",l),i.setAttributeNS(null,"fx",s[0]),i.setAttributeNS(null,"fy",s[1]),i.setAttributeNS(null,"fr",o);break;default:throw new Error(`Unknown RadialAxial type: ${e[1]}`)}for(const e of n){const t=this.svgFactory.createElement("svg:stop");t.setAttributeNS(null,"offset",e[0]),t.setAttributeNS(null,"stop-color",e[1]),i.appendChild(t)}return this.defs.appendChild(i),`url(#${t})`;case"Mesh":return(0,r.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${e[0]}`)}}setDash(e,t){this.current.dashArray=e,this.current.dashPhase=t}constructPath(e,t){const n=this.current;let i=n.x,s=n.y,a=[],o=0;for(const n of e)switch(0|n){case r.OPS.rectangle:i=t[o++],s=t[o++];const e=i+t[o++],n=s+t[o++];a.push("M",p(i),p(s),"L",p(e),p(s),"L",p(e),p(n),"L",p(i),p(n),"Z");break;case r.OPS.moveTo:i=t[o++],s=t[o++],a.push("M",p(i),p(s));break;case r.OPS.lineTo:i=t[o++],s=t[o++],a.push("L",p(i),p(s));break;case r.OPS.curveTo:i=t[o+4],s=t[o+5],a.push("C",p(t[o]),p(t[o+1]),p(t[o+2]),p(t[o+3]),p(i),p(s)),o+=6;break;case r.OPS.curveTo2:a.push("C",p(i),p(s),p(t[o]),p(t[o+1]),p(t[o+2]),p(t[o+3])),i=t[o+2],s=t[o+3],o+=4;break;case r.OPS.curveTo3:i=t[o+2],s=t[o+3],a.push("C",p(t[o]),p(t[o+1]),p(i),p(s),p(i),p(s)),o+=4;break;case r.OPS.closePath:a.push("Z")}a=a.join(" "),n.path&&e.length>0&&e[0]!==r.OPS.rectangle&&e[0]!==r.OPS.moveTo?a=n.path.getAttributeNS(null,"d")+a:(n.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().appendChild(n.path)),n.path.setAttributeNS(null,"d",a),n.path.setAttributeNS(null,"fill","none"),n.element=n.path,n.setCurrentPoint(i,s)}endPath(){const e=this.current;if(e.path=null,!this.pendingClip)return;if(!e.element)return void(this.pendingClip=null);const t="clippath"+f++,n=this.svgFactory.createElement("svg:clipPath");n.setAttributeNS(null,"id",t),n.setAttributeNS(null,"transform",g(this.transformMatrix));const r=e.element.cloneNode(!0);if("evenodd"===this.pendingClip?r.setAttributeNS(null,"clip-rule","evenodd"):r.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,n.appendChild(r),this.defs.appendChild(n),e.activeClipUrl){e.clipGroup=null;for(const e of this.extraStack)e.clipGroup=null;n.setAttributeNS(null,"clip-path",e.activeClipUrl)}e.activeClipUrl=`url(#${t})`,this.tgrp=null}clip(e){this.pendingClip=e}closePath(){const e=this.current;if(e.path){const t=`${e.path.getAttributeNS(null,"d")}Z`;e.path.setAttributeNS(null,"d",t)}}setLeading(e){this.current.leading=-e}setTextRise(e){this.current.textRise=e}setTextRenderingMode(e){this.current.textRenderingMode=e}setHScale(e){this.current.textHScale=e/100}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(const[t,n]of e)switch(t){case"LW":this.setLineWidth(n);break;case"LC":this.setLineCap(n);break;case"LJ":this.setLineJoin(n);break;case"ML":this.setMiterLimit(n);break;case"D":this.setDash(n[0],n[1]);break;case"RI":this.setRenderingIntent(n);break;case"FL":this.setFlatness(n);break;case"Font":this.setFont(n);break;case"CA":this.setStrokeAlpha(n);break;case"ca":this.setFillAlpha(n);break;default:(0,r.warn)(`Unimplemented graphic state operator ${t}`)}}fill(){const e=this.current;e.element&&(e.element.setAttributeNS(null,"fill",e.fillColor),e.element.setAttributeNS(null,"fill-opacity",e.fillAlpha),this.endPath())}stroke(){const e=this.current;e.element&&(this._setStrokeAttributes(e.element),e.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(e,t=1){const n=this.current;let r=n.dashArray;1!==t&&r.length>0&&(r=r.map((function(e){return t*e}))),e.setAttributeNS(null,"stroke",n.strokeColor),e.setAttributeNS(null,"stroke-opacity",n.strokeAlpha),e.setAttributeNS(null,"stroke-miterlimit",p(n.miterLimit)),e.setAttributeNS(null,"stroke-linecap",n.lineCap),e.setAttributeNS(null,"stroke-linejoin",n.lineJoin),e.setAttributeNS(null,"stroke-width",p(t*n.lineWidth)+"px"),e.setAttributeNS(null,"stroke-dasharray",r.map(p).join(" ")),e.setAttributeNS(null,"stroke-dashoffset",p(t*n.dashPhase)+"px")}eoFill(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const e=this.svgFactory.createElement("svg:rect");e.setAttributeNS(null,"x","0"),e.setAttributeNS(null,"y","0"),e.setAttributeNS(null,"width","1px"),e.setAttributeNS(null,"height","1px"),e.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().appendChild(e)}paintImageXObject(e){const t=e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e);t?this.paintInlineImageXObject(t):(0,r.warn)(`Dependent image with object ID ${e} is not ready yet`)}paintInlineImageXObject(e,t){const n=e.width,r=e.height,i=h(e,this.forceDataSchema,!!t),s=this.svgFactory.createElement("svg:rect");s.setAttributeNS(null,"x","0"),s.setAttributeNS(null,"y","0"),s.setAttributeNS(null,"width",p(n)),s.setAttributeNS(null,"height",p(r)),this.current.element=s,this.clip("nonzero");const a=this.svgFactory.createElement("svg:image");a.setAttributeNS(o,"xlink:href",i),a.setAttributeNS(null,"x","0"),a.setAttributeNS(null,"y",p(-r)),a.setAttributeNS(null,"width",p(n)+"px"),a.setAttributeNS(null,"height",p(r)+"px"),a.setAttributeNS(null,"transform",`scale(${p(1/n)} ${p(-1/r)})`),t?t.appendChild(a):this._ensureTransformGroup().appendChild(a)}paintImageMaskXObject(e){const t=this.current,n=e.width,r=e.height,i=t.fillColor;t.maskId="mask"+m++;const s=this.svgFactory.createElement("svg:mask");s.setAttributeNS(null,"id",t.maskId);const a=this.svgFactory.createElement("svg:rect");a.setAttributeNS(null,"x","0"),a.setAttributeNS(null,"y","0"),a.setAttributeNS(null,"width",p(n)),a.setAttributeNS(null,"height",p(r)),a.setAttributeNS(null,"fill",i),a.setAttributeNS(null,"mask",`url(#${t.maskId})`),this.defs.appendChild(s),this._ensureTransformGroup().appendChild(a),this.paintInlineImageXObject(e,s)}paintFormXObjectBegin(e,t){if(Array.isArray(e)&&6===e.length&&this.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t){const e=t[2]-t[0],n=t[3]-t[1],r=this.svgFactory.createElement("svg:rect");r.setAttributeNS(null,"x",t[0]),r.setAttributeNS(null,"y",t[1]),r.setAttributeNS(null,"width",p(e)),r.setAttributeNS(null,"height",p(n)),this.current.element=r,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(e){const t=this.svgFactory.create(e.width,e.height),n=this.svgFactory.createElement("svg:defs");t.appendChild(n),this.defs=n;const r=this.svgFactory.createElement("svg:g");return r.setAttributeNS(null,"transform",g(e.transform)),t.appendChild(r),this.svg=r,t}_ensureClipGroup(){if(!this.current.clipGroup){const e=this.svgFactory.createElement("svg:g");e.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.appendChild(e),this.current.clipGroup=e}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",g(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().appendChild(this.tgrp):this.svg.appendChild(this.tgrp)),this.tgrp}}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.XfaLayer=void 0,t.XfaLayer=class{static setupStorage(e,t,n,r,i){const s=r.getValue(t,{value:null});switch(n.name){case"textarea":if(null!==s.value&&(e.textContent=s.value),"print"===i)break;e.addEventListener("input",(e=>{r.setValue(t,{value:e.target.value})}));break;case"input":if("radio"===n.attributes.type||"checkbox"===n.attributes.type){if(s.value===n.attributes.xfaOn&&e.setAttribute("checked",!0),"print"===i)break;e.addEventListener("change",(e=>{r.setValue(t,{value:e.target.getAttribute("xfaOn")})}))}else{if(null!==s.value&&e.setAttribute("value",s.value),"print"===i)break;e.addEventListener("input",(e=>{r.setValue(t,{value:e.target.value})}))}break;case"select":if(null!==s.value)for(const e of n.children)e.attributes.value===s.value&&(e.attributes.selected=!0);e.addEventListener("input",(e=>{const n=e.target.options,i=-1===n.selectedIndex?"":n[n.selectedIndex].value;r.setValue(t,{value:i})}))}}static setAttributes(e,t,n,r){const{attributes:i}=t;"radio"===i.type&&(i.name=`${i.name}-${r}`);for(const[t,n]of Object.entries(i))null!=n&&"dataId"!==t&&("style"!==t?"textContent"===t?e.textContent=n:"class"===t?e.setAttribute(t,n.join(" ")):e.setAttribute(t,n):Object.assign(e.style,n));n&&i.dataId&&this.setupStorage(e,i.dataId,t,n)}static render(e){const t=e.annotationStorage,n=e.xfa,r=e.intent||"display",i=document.createElement(n.name);n.attributes&&this.setAttributes(i,n);const s=[[n,-1,i]],a=e.div;a.appendChild(i);const o=`matrix(${e.viewport.transform.join(",")})`;for(a.style.transform=o,a.setAttribute("class","xfaLayer xfaFont");s.length>0;){const[e,n,i]=s[s.length-1];if(n+1===e.children.length){s.pop();continue}const a=e.children[++s[s.length-1][1]];if(null===a)continue;const{name:o}=a;if("#text"===o){i.appendChild(document.createTextNode(a.value));continue}let l;l=a?.attributes?.xmlns?document.createElementNS(a.attributes.xmlns,o):document.createElement(o),i.appendChild(l),a.attributes&&this.setAttributes(l,a,t,r),a.children&&a.children.length>0?s.push([a,-1,l]):a.value&&l.appendChild(document.createTextNode(a.value))}for(const e of a.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))e.setAttribute("readOnly",!0)}static update(e){const t=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=t,e.div.hidden=!1}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFNodeStream=void 0;var r=n(2),i=n(23);const s=__webpack_require__(172),a=__webpack_require__(1),o=__webpack_require__(779),l=__webpack_require__(558),c=/^file:\/\/\/[a-zA-Z]:\//;t.PDFNodeStream=class{constructor(e){this.source=e,this.url=function(e){const t=l.parse(e);return"file:"===t.protocol||t.host?t:/^[a-z]:[/\\]/i.test(e)?l.parse(`file:///${e}`):(t.host||(t.protocol="file:"),t)}(e.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.httpHeaders=this.isHttp&&e.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,r.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new f(this):new p(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=this.isFsUrl?new m(this,e,t):new g(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader&&this._fullRequestReader.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}};class h{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;const t=e.source;this._contentLength=t.length,this._loaded=0,this._filename=null,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._readableStream=null,this._readCapability=(0,r.createPromiseCapability)(),this._headersCapability=(0,r.createPromiseCapability)()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return null===e?(this._readCapability=(0,r.createPromiseCapability)(),this.read()):(this._loaded+=e.length,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",(()=>{this._readCapability.resolve()})),e.on("end",(()=>{e.destroy(),this._done=!0,this._readCapability.resolve()})),e.on("error",(e=>{this._error(e)})),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new r.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class u{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=(0,r.createPromiseCapability)();const t=e.source;this._isStreamingSupported=!t.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return null===e?(this._readCapability=(0,r.createPromiseCapability)(),this.read()):(this._loaded+=e.length,this.onProgress&&this.onProgress({loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",(()=>{this._readCapability.resolve()})),e.on("end",(()=>{e.destroy(),this._done=!0,this._readCapability.resolve()})),e.on("error",(e=>{this._error(e)})),this._storedError&&this._readableStream.destroy(this._storedError)}}function d(e,t){return{protocol:e.protocol,auth:e.auth,host:e.hostname,port:e.port,path:e.path,method:"GET",headers:t}}class p extends h{constructor(e){super(e);const t=t=>{if(404===t.statusCode){const e=new r.MissingPDFException(`Missing PDF "${this._url}".`);return this._storedError=e,void this._headersCapability.reject(e)}this._headersCapability.resolve(),this._setReadableStream(t);const n=e=>this._readableStream.headers[e.toLowerCase()],{allowRangeRequests:s,suggestedLength:a}=(0,i.validateRangeRequestCapabilities)({getResponseHeader:n,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=s,this._contentLength=a||this._contentLength,this._filename=(0,i.extractFilenameFromHeader)(n)};this._request=null,"http:"===this._url.protocol?this._request=a.request(d(this._url,e.httpHeaders),t):this._request=o.request(d(this._url,e.httpHeaders),t),this._request.on("error",(e=>{this._storedError=e,this._headersCapability.reject(e)})),this._request.end()}}class g extends u{constructor(e,t,n){super(e),this._httpHeaders={};for(const t in e.httpHeaders){const n=e.httpHeaders[t];void 0!==n&&(this._httpHeaders[t]=n)}this._httpHeaders.Range=`bytes=${t}-${n-1}`;const i=e=>{if(404!==e.statusCode)this._setReadableStream(e);else{const e=new r.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=e}};this._request=null,"http:"===this._url.protocol?this._request=a.request(d(this._url,this._httpHeaders),i):this._request=o.request(d(this._url,this._httpHeaders),i),this._request.on("error",(e=>{this._storedError=e})),this._request.end()}}class f extends h{constructor(e){super(e);let t=decodeURIComponent(this._url.path);c.test(this._url.href)&&(t=t.replace(/^\//,"")),s.lstat(t,((e,n)=>{if(e)return"ENOENT"===e.code&&(e=new r.MissingPDFException(`Missing PDF "${t}".`)),this._storedError=e,void this._headersCapability.reject(e);this._contentLength=n.size,this._setReadableStream(s.createReadStream(t)),this._headersCapability.resolve()}))}}class m extends u{constructor(e,t,n){super(e);let r=decodeURIComponent(this._url.path);c.test(this._url.href)&&(r=r.replace(/^\//,"")),this._setReadableStream(s.createReadStream(r,{start:t,end:n-1}))}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createResponseStatusError=function(e,t){return 404===e||0===e&&t.startsWith("file:")?new r.MissingPDFException('Missing PDF "'+t+'".'):new r.UnexpectedResponseException(`Unexpected server response (${e}) while retrieving PDF "${t}".`,e)},t.extractFilenameFromHeader=function(e){const t=e("Content-Disposition");if(t){let e=(0,i.getFilenameFromContentDispositionHeader)(t);if(e.includes("%"))try{e=decodeURIComponent(e)}catch(e){}if((0,s.isPdfFile)(e))return e}return null},t.validateRangeRequestCapabilities=function({getResponseHeader:e,isHttp:t,rangeChunkSize:n,disableRange:i}){(0,r.assert)(n>0,"Range chunk size must be larger than zero");const s={allowRangeRequests:!1,suggestedLength:void 0},a=parseInt(e("Content-Length"),10);return Number.isInteger(a)?(s.suggestedLength=a,a<=2*n||i||!t||"bytes"!==e("Accept-Ranges")||"identity"!==(e("Content-Encoding")||"identity")||(s.allowRangeRequests=!0),s):s},t.validateResponseStatus=function(e){return 200===e||206===e};var r=n(2),i=n(24),s=n(1)},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getFilenameFromContentDispositionHeader=function(e){let t=!0,n=i("filename\\*","i").exec(e);if(n){n=n[1];let e=o(n);return e=unescape(e),e=l(e),e=c(e),a(e)}if(n=function(e){const t=[];let n;const r=i("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(n=r.exec(e));){let[,e,r,i]=n;if(e=parseInt(e,10),e in t){if(0===e)break}else t[e]=[r,i]}const s=[];for(let e=0;e<t.length&&e in t;++e){let[n,r]=t[e];r=o(r),n&&(r=unescape(r),0===e&&(r=l(r))),s.push(r)}return s.join("")}(e),n)return a(c(n));if(n=i("filename","i").exec(e),n){n=n[1];let e=o(n);return e=c(e),a(e)}function i(e,t){return new RegExp("(?:^|;)\\s*"+e+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',t)}function s(e,n){if(e){if(!/^[\x00-\xFF]+$/.test(n))return n;try{const i=new TextDecoder(e,{fatal:!0}),s=(0,r.stringToBytes)(n);n=i.decode(s),t=!1}catch(r){if(/^utf-?8$/i.test(e))try{n=decodeURIComponent(escape(n)),t=!1}catch(e){}}}return n}function a(e){return t&&/[\x80-\xff]/.test(e)&&(e=s("utf-8",e),t&&(e=s("iso-8859-1",e))),e}function o(e){if(e.startsWith('"')){const t=e.slice(1).split('\\"');for(let e=0;e<t.length;++e){const n=t[e].indexOf('"');-1!==n&&(t[e]=t[e].slice(0,n),t.length=e+1),t[e]=t[e].replace(/\\(.)/g,"$1")}e=t.join('"')}return e}function l(e){const t=e.indexOf("'");return-1===t?e:s(e.slice(0,t),e.slice(t+1).replace(/^[^']*'/,""))}function c(e){return!e.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(e)?e:e.replace(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,(function(e,t,n,r){if("q"===n||"Q"===n)return s(t,r=(r=r.replace(/_/g," ")).replace(/=([0-9a-fA-F]{2})/g,(function(e,t){return String.fromCharCode(parseInt(t,16))})));try{r=atob(r)}catch(e){}return s(t,r)}))}return""};var r=n(2)},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFNetworkStream=void 0;var r=n(2),i=n(23);class s{constructor(e,t){this.url=e,t=t||{},this.isHttp=/^https?:/i.test(e),this.httpHeaders=this.isHttp&&t.httpHeaders||{},this.withCredentials=t.withCredentials||!1,this.getXhr=t.getXhr||function(){return new XMLHttpRequest},this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(e,t,n){const r={begin:e,end:t};for(const e in n)r[e]=n[e];return this.request(r)}requestFull(e){return this.request(e)}request(e){const t=this.getXhr(),n=this.currXhrId++,r=this.pendingRequests[n]={xhr:t};t.open("GET",this.url),t.withCredentials=this.withCredentials;for(const e in this.httpHeaders){const n=this.httpHeaders[e];void 0!==n&&t.setRequestHeader(e,n)}return this.isHttp&&"begin"in e&&"end"in e?(t.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`),r.expectedStatus=206):r.expectedStatus=200,t.responseType="arraybuffer",e.onError&&(t.onerror=function(n){e.onError(t.status)}),t.onreadystatechange=this.onStateChange.bind(this,n),t.onprogress=this.onProgress.bind(this,n),r.onHeadersReceived=e.onHeadersReceived,r.onDone=e.onDone,r.onError=e.onError,r.onProgress=e.onProgress,t.send(null),n}onProgress(e,t){const n=this.pendingRequests[e];n&&n.onProgress&&n.onProgress(t)}onStateChange(e,t){const n=this.pendingRequests[e];if(!n)return;const i=n.xhr;if(i.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),4!==i.readyState)return;if(!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],0===i.status&&this.isHttp)return void(n.onError&&n.onError(i.status));const s=i.status||200;if((200!==s||206!==n.expectedStatus)&&s!==n.expectedStatus)return void(n.onError&&n.onError(i.status));const a=function(e){const t=e.response;return"string"!=typeof t?t:(0,r.stringToBytes)(t).buffer}(i);if(206===s){const e=i.getResponseHeader("Content-Range"),t=/bytes (\d+)-(\d+)\/(\d+)/.exec(e);n.onDone({begin:parseInt(t[1],10),chunk:a})}else a?n.onDone({begin:0,chunk:a}):n.onError&&n.onError(i.status)}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortRequest(e){const t=this.pendingRequests[e].xhr;delete this.pendingRequests[e],t.abort()}}t.PDFNetworkStream=class{constructor(e){this._source=e,this._manager=new s(e.url,{httpHeaders:e.httpHeaders,withCredentials:e.withCredentials}),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){const t=this._rangeRequestReaders.indexOf(e);t>=0&&this._rangeRequestReaders.splice(t,1)}getFullReader(){return(0,r.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new a(this._manager,this._source),this._fullRequestReader}getRangeReader(e,t){const n=new o(this._manager,e,t);return n.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader&&this._fullRequestReader.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}};class a{constructor(e,t){this._manager=e;const n={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._fullRequestId=e.requestFull(n),this._headersReceivedCapability=(0,r.createPromiseCapability)(),this._disableRange=t.disableRange||!1,this._contentLength=t.length,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const e=this._fullRequestId,t=this._manager.getRequestXhr(e),n=e=>t.getResponseHeader(e),{allowRangeRequests:r,suggestedLength:s}=(0,i.validateRangeRequestCapabilities)({getResponseHeader:n,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});r&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=(0,i.extractFilenameFromHeader)(n),this._isRangeSupported&&this._manager.abortRequest(e),this._headersReceivedCapability.resolve()}_onDone(e){if(e&&(this._requests.length>0?this._requests.shift().resolve({value:e.chunk,done:!1}):this._cachedChunks.push(e.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){const t=this._url,n=(0,i.createResponseStatusError)(e,t);this._storedError=n,this._headersReceivedCapability.reject(n);for(const e of this._requests)e.reject(n);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){this.onProgress&&this.onProgress({loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=(0,r.createPromiseCapability)();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersReceivedCapability.reject(e);for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class o{constructor(e,t,n){this._manager=e;const r={onDone:this._onDone.bind(this),onProgress:this._onProgress.bind(this)};this._requestId=e.requestRange(t,n,r),this._requests=[],this._queuedChunk=null,this._done=!1,this.onProgress=null,this.onClosed=null}_close(){this.onClosed&&this.onClosed(this)}_onDone(e){const t=e.chunk;this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunk=t,this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onProgress(e){!this.isStreamingSupported&&this.onProgress&&this.onProgress({loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(null!==this._queuedChunk){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const e=(0,r.createPromiseCapability)();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFFetchStream=void 0;var r=n(2),i=n(23);function s(e,t,n){return{method:"GET",headers:e,signal:n?.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function a(e){const t=new Headers;for(const n in e){const r=e[n];void 0!==r&&t.append(n,r)}return t}t.PDFFetchStream=class{constructor(e){this.source=e,this.isHttp=/^https?:/i.test(e.url),this.httpHeaders=this.isHttp&&e.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,r.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new o(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=new l(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader&&this._fullRequestReader.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}};class o{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;const t=e.source;this._withCredentials=t.withCredentials||!1,this._contentLength=t.length,this._headersCapability=(0,r.createPromiseCapability)(),this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),"undefined"!=typeof AbortController&&(this._abortController=new AbortController),this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._headers=a(this._stream.httpHeaders);const n=t.url;fetch(n,s(this._headers,this._withCredentials,this._abortController)).then((e=>{if(!(0,i.validateResponseStatus)(e.status))throw(0,i.createResponseStatusError)(e.status,n);this._reader=e.body.getReader(),this._headersCapability.resolve();const t=t=>e.headers.get(t),{allowRangeRequests:s,suggestedLength:a}=(0,i.validateRangeRequestCapabilities)({getResponseHeader:t,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=s,this._contentLength=a||this._contentLength,this._filename=(0,i.extractFilenameFromHeader)(t),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new r.AbortException("Streaming is disabled."))})).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._reader&&this._reader.cancel(e),this._abortController&&this._abortController.abort()}}class l{constructor(e,t,n){this._stream=e,this._reader=null,this._loaded=0;const o=e.source;this._withCredentials=o.withCredentials||!1,this._readCapability=(0,r.createPromiseCapability)(),this._isStreamingSupported=!o.disableStream,"undefined"!=typeof AbortController&&(this._abortController=new AbortController),this._headers=a(this._stream.httpHeaders),this._headers.append("Range",`bytes=${t}-${n-1}`);const l=o.url;fetch(l,s(this._headers,this._withCredentials,this._abortController)).then((e=>{if(!(0,i.validateResponseStatus)(e.status))throw(0,i.createResponseStatusError)(e.status,l);this._readCapability.resolve(),this._reader=e.body.getReader()})).catch((e=>{if("AbortError"!==e?.name)throw e})),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._reader&&this._reader.cancel(e),this._abortController&&this._abortController.abort()}}}],__webpack_module_cache__={};function __w_pdfjs_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__w_pdfjs_require__),n.exports}var __webpack_exports__={};return(()=>{var e=__webpack_exports__;Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"addLinkAttributes",{enumerable:!0,get:function(){return t.addLinkAttributes}}),Object.defineProperty(e,"getFilenameFromUrl",{enumerable:!0,get:function(){return t.getFilenameFromUrl}}),Object.defineProperty(e,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return t.getPdfFilenameFromUrl}}),Object.defineProperty(e,"getXfaPageViewport",{enumerable:!0,get:function(){return t.getXfaPageViewport}}),Object.defineProperty(e,"isPdfFile",{enumerable:!0,get:function(){return t.isPdfFile}}),Object.defineProperty(e,"LinkTarget",{enumerable:!0,get:function(){return t.LinkTarget}}),Object.defineProperty(e,"loadScript",{enumerable:!0,get:function(){return t.loadScript}}),Object.defineProperty(e,"PDFDateString",{enumerable:!0,get:function(){return t.PDFDateString}}),Object.defineProperty(e,"RenderingCancelledException",{enumerable:!0,get:function(){return t.RenderingCancelledException}}),Object.defineProperty(e,"build",{enumerable:!0,get:function(){return n.build}}),Object.defineProperty(e,"getDocument",{enumerable:!0,get:function(){return n.getDocument}}),Object.defineProperty(e,"LoopbackPort",{enumerable:!0,get:function(){return n.LoopbackPort}}),Object.defineProperty(e,"PDFDataRangeTransport",{enumerable:!0,get:function(){return n.PDFDataRangeTransport}}),Object.defineProperty(e,"PDFWorker",{enumerable:!0,get:function(){return n.PDFWorker}}),Object.defineProperty(e,"version",{enumerable:!0,get:function(){return n.version}}),Object.defineProperty(e,"CMapCompressionType",{enumerable:!0,get:function(){return r.CMapCompressionType}}),Object.defineProperty(e,"createObjectURL",{enumerable:!0,get:function(){return r.createObjectURL}}),Object.defineProperty(e,"createPromiseCapability",{enumerable:!0,get:function(){return r.createPromiseCapability}}),Object.defineProperty(e,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return r.createValidAbsoluteUrl}}),Object.defineProperty(e,"InvalidPDFException",{enumerable:!0,get:function(){return r.InvalidPDFException}}),Object.defineProperty(e,"MissingPDFException",{enumerable:!0,get:function(){return r.MissingPDFException}}),Object.defineProperty(e,"OPS",{enumerable:!0,get:function(){return r.OPS}}),Object.defineProperty(e,"PasswordResponses",{enumerable:!0,get:function(){return r.PasswordResponses}}),Object.defineProperty(e,"PermissionFlag",{enumerable:!0,get:function(){return r.PermissionFlag}}),Object.defineProperty(e,"removeNullCharacters",{enumerable:!0,get:function(){return r.removeNullCharacters}}),Object.defineProperty(e,"shadow",{enumerable:!0,get:function(){return r.shadow}}),Object.defineProperty(e,"UnexpectedResponseException",{enumerable:!0,get:function(){return r.UnexpectedResponseException}}),Object.defineProperty(e,"UNSUPPORTED_FEATURES",{enumerable:!0,get:function(){return r.UNSUPPORTED_FEATURES}}),Object.defineProperty(e,"Util",{enumerable:!0,get:function(){return r.Util}}),Object.defineProperty(e,"VerbosityLevel",{enumerable:!0,get:function(){return r.VerbosityLevel}}),Object.defineProperty(e,"AnnotationLayer",{enumerable:!0,get:function(){return i.AnnotationLayer}}),Object.defineProperty(e,"GlobalWorkerOptions",{enumerable:!0,get:function(){return s.GlobalWorkerOptions}}),Object.defineProperty(e,"renderTextLayer",{enumerable:!0,get:function(){return o.renderTextLayer}}),Object.defineProperty(e,"SVGGraphics",{enumerable:!0,get:function(){return l.SVGGraphics}}),Object.defineProperty(e,"XfaLayer",{enumerable:!0,get:function(){return c.XfaLayer}});var t=__w_pdfjs_require__(1),n=__w_pdfjs_require__(6),r=__w_pdfjs_require__(2),i=__w_pdfjs_require__(17),s=__w_pdfjs_require__(12),a=__w_pdfjs_require__(4),o=__w_pdfjs_require__(19),l=__w_pdfjs_require__(20),c=__w_pdfjs_require__(21);if(a.isNodeJS){const{PDFNodeStream:e}=__w_pdfjs_require__(22);(0,n.setPDFNetworkStreamFactory)((t=>new e(t)))}else{const{PDFNetworkStream:e}=__w_pdfjs_require__(25),{PDFFetchStream:r}=__w_pdfjs_require__(26);(0,n.setPDFNetworkStreamFactory)((n=>(0,t.isValidFetchUrl)(n.url)?new r(n):new e(n)))}})(),__webpack_exports__})()},module.exports=factory()},963:function(e,t,n){var r;r=function(){return(()=>{"use strict";var e=[,(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultAnnotationLayerFactory=t.AnnotationLayerBuilder=void 0;var r=n(2),i=n(3),s=n(4);class a{constructor({pageDiv:e,pdfPage:t,linkService:n,downloadManager:r,annotationStorage:s=null,imageResourcesPath:a="",renderInteractiveForms:o=!0,l10n:l=i.NullL10n,enableScripting:c=!1,hasJSActionsPromise:h=null,mouseState:u=null}){this.pageDiv=e,this.pdfPage=t,this.linkService=n,this.downloadManager=r,this.imageResourcesPath=a,this.renderInteractiveForms=o,this.l10n=l,this.annotationStorage=s,this.enableScripting=c,this._hasJSActionsPromise=h,this._mouseState=u,this.div=null,this._cancelled=!1}render(e,t="display"){return Promise.all([this.pdfPage.getAnnotations({intent:t}),this._hasJSActionsPromise]).then((([t,n=!1])=>{if(this._cancelled)return;if(0===t.length)return;const i={viewport:e.clone({dontFlip:!0}),div:this.div,annotations:t,page:this.pdfPage,imageResourcesPath:this.imageResourcesPath,renderInteractiveForms:this.renderInteractiveForms,linkService:this.linkService,downloadManager:this.downloadManager,annotationStorage:this.annotationStorage,enableScripting:this.enableScripting,hasJSActions:n,mouseState:this._mouseState};this.div?r.AnnotationLayer.update(i):(this.div=document.createElement("div"),this.div.className="annotationLayer",this.pageDiv.appendChild(this.div),i.div=this.div,r.AnnotationLayer.render(i),this.l10n.translate(this.div))}))}cancel(){this._cancelled=!0}hide(){this.div&&(this.div.hidden=!0)}}t.AnnotationLayerBuilder=a,t.DefaultAnnotationLayerFactory=class{createAnnotationLayerBuilder(e,t,n=null,r="",o=!0,l=i.NullL10n,c=!1,h=null,u=null){return new a({pageDiv:e,pdfPage:t,imageResourcesPath:r,renderInteractiveForms:o,linkService:new s.SimpleLinkService,l10n:l,annotationStorage:n,enableScripting:c,hasJSActionsPromise:h,mouseState:u})}}},e=>{let t;t="undefined"!=typeof window&&window["pdfjs-dist/build/pdf"]?window["pdfjs-dist/build/pdf"]:n(299),e.exports=t},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.fixupLangCode=function(e){return i[e?.toLowerCase()]||e},t.getL10nFallback=r,t.NullL10n=void 0;const n={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 r(e,t){switch(e){case"find_match_count":e=`find_match_count[${1===t.total?"one":"other"}]`;break;case"find_match_count_limit":e=`find_match_count_limit[${1===t.limit?"one":"other"}]`}return n[e]||""}const i={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"},s={getLanguage:async()=>"en-us",getDirection:async()=>"ltr",get:async(e,t=null,n=r(e,t))=>function(e,t){return t?e.replace(/\{\{\s*(\w+)\s*\}\}/g,((e,n)=>n in t?t[n]:"{{"+n+"}}")):e}(n,t),async translate(e){}};t.NullL10n=s},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SimpleLinkService=t.PDFLinkService=void 0;var r=n(5);t.PDFLinkService=class{constructor({eventBus:e,externalLinkTarget:t=null,externalLinkRel:n=null,ignoreDestinationZoom:r=!1}={}){this.eventBus=e,this.externalLinkTarget=t,this.externalLinkRel=n,this.externalLinkEnabled=!0,this._ignoreDestinationZoom=r,this.baseUrl=null,this.pdfDocument=null,this.pdfViewer=null,this.pdfHistory=null,this._pagesRefCache=null}setDocument(e,t=null){this.baseUrl=t,this.pdfDocument=e,this._pagesRefCache=Object.create(null)}setViewer(e){this.pdfViewer=e}setHistory(e){this.pdfHistory=e}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return this.pdfViewer.currentPageNumber}set page(e){this.pdfViewer.currentPageNumber=e}get rotation(){return this.pdfViewer.pagesRotation}set rotation(e){this.pdfViewer.pagesRotation=e}_goToDestinationHelper(e,t=null,n){const r=n[0];let i;if("object"==typeof r&&null!==r){if(i=this._cachedPageNumber(r),null===i)return void this.pdfDocument.getPageIndex(r).then((i=>{this.cachePageRef(i+1,r),this._goToDestinationHelper(e,t,n)})).catch((()=>{console.error(`PDFLinkService._goToDestinationHelper: "${r}" is not a valid page reference, for dest="${e}".`)}))}else{if(!Number.isInteger(r))return void console.error(`PDFLinkService._goToDestinationHelper: "${r}" is not a valid destination reference, for dest="${e}".`);i=r+1}!i||i<1||i>this.pagesCount?console.error(`PDFLinkService._goToDestinationHelper: "${i}" is not a valid page number, for dest="${e}".`):(this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.push({namedDest:t,explicitDest:n,pageNumber:i})),this.pdfViewer.scrollPageIntoView({pageNumber:i,destArray:n,ignoreDestinationZoom:this._ignoreDestinationZoom}))}async goToDestination(e){if(!this.pdfDocument)return;let t,n;"string"==typeof e?(t=e,n=await this.pdfDocument.getDestination(e)):(t=null,n=await e),Array.isArray(n)?this._goToDestinationHelper(e,t,n):console.error(`PDFLinkService.goToDestination: "${n}" is not a valid destination array, for dest="${e}".`)}goToPage(e){if(!this.pdfDocument)return;const t="string"==typeof e&&this.pdfViewer.pageLabelToPageNumber(e)||0|e;Number.isInteger(t)&&t>0&&t<=this.pagesCount?(this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.pushPage(t)),this.pdfViewer.scrollPageIntoView({pageNumber:t})):console.error(`PDFLinkService.goToPage: "${e}" is not a valid page.`)}getDestinationHash(e){if("string"==typeof e){if(e.length>0)return this.getAnchorUrl("#"+escape(e))}else if(Array.isArray(e)){const t=JSON.stringify(e);if(t.length>0)return this.getAnchorUrl("#"+escape(t))}return this.getAnchorUrl("")}getAnchorUrl(e){return(this.baseUrl||"")+e}setHash(e){if(!this.pdfDocument)return;let t,n;if(e.includes("=")){const i=(0,r.parseQueryString)(e);if("search"in i&&this.eventBus.dispatch("findfromurlhash",{source:this,query:i.search.replace(/"/g,""),phraseSearch:"true"===i.phrase}),"page"in i&&(t=0|i.page||1),"zoom"in i){const e=i.zoom.split(","),t=e[0],r=parseFloat(t);t.includes("Fit")?"Fit"===t||"FitB"===t?n=[null,{name:t}]:"FitH"===t||"FitBH"===t||"FitV"===t||"FitBV"===t?n=[null,{name:t},e.length>1?0|e[1]:null]:"FitR"===t?5!==e.length?console.error('PDFLinkService.setHash: Not enough parameters for "FitR".'):n=[null,{name:t},0|e[1],0|e[2],0|e[3],0|e[4]]:console.error(`PDFLinkService.setHash: "${t}" is not a valid zoom value.`):n=[null,{name:"XYZ"},e.length>1?0|e[1]:null,e.length>2?0|e[2]:null,r?r/100:t]}n?this.pdfViewer.scrollPageIntoView({pageNumber:t||this.page,destArray:n,allowNegativeOffset:!0}):t&&(this.page=t),"pagemode"in i&&this.eventBus.dispatch("pagemode",{source:this,mode:i.pagemode}),"nameddest"in i&&this.goToDestination(i.nameddest)}else{n=unescape(e);try{n=JSON.parse(n),Array.isArray(n)||(n=n.toString())}catch(e){}if("string"==typeof n||function(e){if(!Array.isArray(e))return!1;const t=e.length;if(t<2)return!1;const n=e[0];if(!("object"==typeof n&&Number.isInteger(n.num)&&Number.isInteger(n.gen)||Number.isInteger(n)&&n>=0))return!1;const r=e[1];if("object"!=typeof r||"string"!=typeof r.name)return!1;let i=!0;switch(r.name){case"XYZ":if(5!==t)return!1;break;case"Fit":case"FitB":return 2===t;case"FitH":case"FitBH":case"FitV":case"FitBV":if(3!==t)return!1;break;case"FitR":if(6!==t)return!1;i=!1;break;default:return!1}for(let n=2;n<t;n++){const t=e[n];if(!("number"==typeof t||i&&null===t))return!1}return!0}(n))return void this.goToDestination(n);console.error(`PDFLinkService.setHash: "${unescape(e)}" is not a valid destination.`)}}executeNamedAction(e){switch(e){case"GoBack":this.pdfHistory&&this.pdfHistory.back();break;case"GoForward":this.pdfHistory&&this.pdfHistory.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:e})}cachePageRef(e,t){if(!t)return;const n=0===t.gen?`${t.num}R`:`${t.num}R${t.gen}`;this._pagesRefCache[n]=e}_cachedPageNumber(e){const t=0===e.gen?`${e.num}R`:`${e.num}R${e.gen}`;return this._pagesRefCache?.[t]||null}isPageVisible(e){return this.pdfViewer.isPageVisible(e)}isPageCached(e){return this.pdfViewer.isPageCached(e)}},t.SimpleLinkService=class{constructor(){this.externalLinkTarget=null,this.externalLinkRel=null,this.externalLinkEnabled=!0,this._ignoreDestinationZoom=!1}get pagesCount(){return 0}get page(){return 0}set page(e){}get rotation(){return 0}set rotation(e){}async goToDestination(e){}goToPage(e){}getDestinationHash(e){return"#"}getAnchorUrl(e){return"#"}setHash(e){}executeNamedAction(e){}cachePageRef(e,t){}isPageVisible(e){return!0}isPageCached(e){return!0}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.apiPageLayoutToSpreadMode=function(e){switch(e){case"SinglePage":case"OneColumn":return i.NONE;case"TwoColumnLeft":case"TwoPageLeft":return i.ODD;case"TwoColumnRight":case"TwoPageRight":return i.EVEN}return i.NONE},t.apiPageModeToSidebarView=function(e){switch(e){case"UseNone":return n.NONE;case"UseThumbs":return n.THUMBS;case"UseOutlines":return n.OUTLINE;case"UseAttachments":return n.ATTACHMENTS;case"UseOC":return n.LAYERS}return n.NONE},t.approximateFraction=function(e){if(Math.floor(e)===e)return[e,1];const t=1/e;if(t>8)return[1,8];if(Math.floor(t)===t)return[1,t];const n=e>1?t:e;let r,i=0,s=1,a=1,o=1;for(;;){const e=i+a,t=s+o;if(t>8)break;n<=e/t?(a=e,o=t):(i=e,s=t)}return r=n-i/s<a/o-n?n===e?[i,s]:[s,i]:n===e?[a,o]:[o,a],r},t.backtrackBeforeAllVisibleElements=a,t.binarySearchFirstItem=s,t.getActiveOrFocusedElement=function(){let e=document,t=e.activeElement||e.querySelector(":focus");for(;t?.shadowRoot;)e=t.shadowRoot,t=e.activeElement||e.querySelector(":focus");return t},t.getOutputScale=function(e){const t=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.backingStorePixelRatio||1);return{sx:t,sy:t,scaled:1!==t}},t.getPageSizeInches=function({view:e,userUnit:t,rotate:n}){const[r,i,s,a]=e,o=n%180!=0,l=(s-r)/72*t,c=(a-i)/72*t;return{width:o?c:l,height:o?l:c}},t.getVisibleElements=function({scrollEl:e,views:t,sortByVisibility:n=!1,horizontal:r=!1,rtl:i=!1}){const o=e.scrollTop,l=o+e.clientHeight,c=e.scrollLeft,h=c+e.clientWidth,u=[],d=t.length;let p=s(t,r?function(e){const t=e.div,n=t.offsetLeft+t.clientLeft,r=n+t.clientWidth;return i?n<h:r>c}:function(e){const t=e.div;return t.offsetTop+t.clientTop+t.clientHeight>o});p>0&&p<d&&!r&&(p=a(p,t,o));let g=r?h:-1;for(let e=p;e<d;e++){const n=t[e],i=n.div,s=i.offsetLeft+i.clientLeft,a=i.offsetTop+i.clientTop,d=i.clientWidth,p=i.clientHeight,f=s+d,m=a+p;if(-1===g)m>=l&&(g=m);else if((r?s:a)>g)break;if(m<=o||a>=l||f<=c||s>=h)continue;const _=Math.max(0,o-a)+Math.max(0,m-l),b=(d-(Math.max(0,c-s)+Math.max(0,f-h)))/d,y=(p-_)/p*b*100|0;u.push({id:n.id,x:s,y:a,view:n,percent:y,widthPercent:100*b|0})}const f=u[0],m=u[u.length-1];return n&&u.sort((function(e,t){const n=e.percent-t.percent;return Math.abs(n)>.001?-n:e.id-t.id})),{first:f,last:m,views:u}},t.isPortraitOrientation=function(e){return e.width<=e.height},t.isValidRotation=function(e){return Number.isInteger(e)&&e%90==0},t.isValidScrollMode=function(e){return Number.isInteger(e)&&Object.values(r).includes(e)&&e!==r.UNKNOWN},t.isValidSpreadMode=function(e){return Number.isInteger(e)&&Object.values(i).includes(e)&&e!==i.UNKNOWN},t.moveToEndOfArray=function(e,t){const n=[],r=e.length;let i=0;for(let s=0;s<r;++s)t(e[s])?n.push(e[s]):(e[i]=e[s],++i);for(let t=0;i<r;++t,++i)e[i]=n[t]},t.noContextMenuHandler=function(e){e.preventDefault()},t.normalizeWheelEventDelta=function(e){let t=o(e);return 0===e.deltaMode?t/=900:1===e.deltaMode&&(t/=30),t},t.normalizeWheelEventDirection=o,t.parseQueryString=function(e){const t=e.split("&"),n=Object.create(null);for(let e=0,r=t.length;e<r;++e){const r=t[e].split("="),i=r[0].toLowerCase(),s=r.length>1?r[1]:null;n[decodeURIComponent(i)]=decodeURIComponent(s)}return n},t.roundToDivide=function(e,t){const n=e%t;return 0===n?e:Math.round(e-n+t)},t.scrollIntoView=function(e,t,n=!1){let r=e.offsetParent;if(!r)return void console.error("offsetParent is not set -- cannot scroll");let i=e.offsetTop+e.clientTop,s=e.offsetLeft+e.clientLeft;for(;r.clientHeight===r.scrollHeight&&r.clientWidth===r.scrollWidth||n&&(r.classList.contains("markedContent")||"hidden"===getComputedStyle(r).overflow);)if(i+=r.offsetTop,s+=r.offsetLeft,r=r.offsetParent,!r)return;t&&(void 0!==t.top&&(i+=t.top),void 0!==t.left&&(s+=t.left,r.scrollLeft=s)),r.scrollTop=i},t.waitOnEventOrTimeout=function({target:e,name:t,delay:n=0}){return new Promise((function(r,i){if("object"!=typeof e||!t||"string"!=typeof t||!(Number.isInteger(n)&&n>=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");function s(n){e instanceof h?e._off(t,a):e.removeEventListener(t,a),c&&clearTimeout(c),r(n)}const a=s.bind(null,l.EVENT);e instanceof h?e._on(t,a):e.addEventListener(t,a);const o=s.bind(null,l.TIMEOUT),c=setTimeout(o,n)}))},t.watchScroll=function(e,t){const n=function(n){i||(i=window.requestAnimationFrame((function(){i=null;const n=e.scrollLeft,s=r.lastX;n!==s&&(r.right=n>s),r.lastX=n;const a=e.scrollTop,o=r.lastY;a!==o&&(r.down=a>o),r.lastY=a,t(r)})))},r={right:!0,down:!0,lastX:e.scrollLeft,lastY:e.scrollTop,_eventHandler:n};let i=null;return e.addEventListener("scroll",n,!0),r},t.WaitOnType=t.VERTICAL_PADDING=t.UNKNOWN_SCALE=t.TextLayerMode=t.SpreadMode=t.SidebarView=t.ScrollMode=t.SCROLLBAR_PADDING=t.RendererType=t.ProgressBar=t.PresentationModeState=t.MIN_SCALE=t.MAX_SCALE=t.MAX_AUTO_SCALE=t.EventBus=t.DEFAULT_SCALE_VALUE=t.DEFAULT_SCALE=t.CSS_UNITS=t.AutoPrintRegExp=t.animationStarted=void 0,t.CSS_UNITS=96/72,t.DEFAULT_SCALE_VALUE="auto",t.DEFAULT_SCALE=1,t.MIN_SCALE=.1,t.MAX_SCALE=10,t.UNKNOWN_SCALE=0,t.MAX_AUTO_SCALE=1.25,t.SCROLLBAR_PADDING=40,t.VERTICAL_PADDING=5,t.PresentationModeState={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3};const n={UNKNOWN:-1,NONE:0,THUMBS:1,OUTLINE:2,ATTACHMENTS:3,LAYERS:4};t.SidebarView=n,t.RendererType={CANVAS:"canvas",SVG:"svg"},t.TextLayerMode={DISABLE:0,ENABLE:1,ENABLE_ENHANCE:2};const r={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2};t.ScrollMode=r;const i={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2};function s(e,t){let n=0,r=e.length-1;if(r<0||!t(e[r]))return e.length;if(t(e[n]))return n;for(;n<r;){const i=n+r>>1;t(e[i])?r=i:n=i+1}return n}function a(e,t,n){if(e<2)return e;let r=t[e].div,i=r.offsetTop+r.clientTop;i>=n&&(r=t[e-1].div,i=r.offsetTop+r.clientTop);for(let n=e-2;n>=0&&(r=t[n].div,!(r.offsetTop+r.clientTop+r.clientHeight<=i));--n)e=n;return e}function o(e){let t=Math.hypot(e.deltaX,e.deltaY);const n=Math.atan2(e.deltaY,e.deltaX);return-.25*Math.PI<n&&n<.75*Math.PI&&(t=-t),t}t.SpreadMode=i,t.AutoPrintRegExp=/\bprint\s*\(/;const l={EVENT:"event",TIMEOUT:"timeout"};t.WaitOnType=l;const c=new Promise((function(e){window.requestAnimationFrame(e)}));t.animationStarted=c;class h{constructor(e){this._listeners=Object.create(null)}on(e,t,n=null){this._on(e,t,{external:!0,once:n?.once})}off(e,t,n=null){this._off(e,t,{external:!0,once:n?.once})}dispatch(e){const t=this._listeners[e];if(!t||0===t.length)return;const n=Array.prototype.slice.call(arguments,1);let r;for(const{listener:i,external:s,once:a}of t.slice(0))a&&this._off(e,i),s?(r||(r=[])).push(i):i.apply(null,n);if(r){for(const e of r)e.apply(null,n);r=null}}_on(e,t,n=null){var r;((r=this._listeners)[e]||(r[e]=[])).push({listener:t,external:!0===n?.external,once:!0===n?.once})}_off(e,t,n=null){const r=this._listeners[e];if(r)for(let e=0,n=r.length;e<n;e++)if(r[e].listener===t)return void r.splice(e,1)}}t.EventBus=h,t.ProgressBar=class{constructor(e,{height:t,width:n,units:r}={}){this.visible=!0,this.div=document.querySelector(e+" .progress"),this.bar=this.div.parentNode,this.height=t||100,this.width=n||100,this.units=r||"%",this.div.style.height=this.height+this.units,this.percent=0}_updateBar(){if(this._indeterminate)return this.div.classList.add("indeterminate"),void(this.div.style.width=this.width+this.units);this.div.classList.remove("indeterminate");const e=this.width*this._percent/100;this.div.style.width=e+this.units}get percent(){return this._percent}set percent(e){var t;this._indeterminate=isNaN(e),this._percent=(t=e,0,100,Math.min(Math.max(t,0),100)),this._updateBar()}setWidth(e){if(!e)return;const t=e.parentNode.offsetWidth-e.offsetWidth;t>0&&document.documentElement.style.setProperty("--loadingBar-end-offset",`${t}px`)}hide(){this.visible&&(this.visible=!1,this.bar.classList.add("hidden"))}show(){this.visible||(this.visible=!0,this.bar.classList.remove("hidden"))}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextLayerBuilder=t.DefaultTextLayerFactory=void 0;var r=n(2);class i{constructor({textLayerDiv:e,eventBus:t,pageIndex:n,viewport:r,findController:i=null,enhanceTextSelection:s=!1}){this.textLayerDiv=e,this.eventBus=t,this.textContent=null,this.textContentItemsStr=[],this.textContentStream=null,this.renderingDone=!1,this.pageIdx=n,this.pageNumber=this.pageIdx+1,this.matches=[],this.viewport=r,this.textDivs=[],this.findController=i,this.textLayerRenderTask=null,this.enhanceTextSelection=s,this._onUpdateTextLayerMatches=null,this._bindMouse()}_finishRendering(){if(this.renderingDone=!0,!this.enhanceTextSelection){const e=document.createElement("div");e.className="endOfContent",this.textLayerDiv.appendChild(e)}this.eventBus.dispatch("textlayerrendered",{source:this,pageNumber:this.pageNumber,numTextDivs:this.textDivs.length})}render(e=0){if(!this.textContent&&!this.textContentStream||this.renderingDone)return;this.cancel(),this.textDivs=[];const t=document.createDocumentFragment();this.textLayerRenderTask=(0,r.renderTextLayer)({textContent:this.textContent,textContentStream:this.textContentStream,container:t,viewport:this.viewport,textDivs:this.textDivs,textContentItemsStr:this.textContentItemsStr,timeout:e,enhanceTextSelection:this.enhanceTextSelection}),this.textLayerRenderTask.promise.then((()=>{this.textLayerDiv.appendChild(t),this._finishRendering(),this._updateMatches()}),(function(e){})),this._onUpdateTextLayerMatches||(this._onUpdateTextLayerMatches=e=>{e.pageIndex!==this.pageIdx&&-1!==e.pageIndex||this._updateMatches()},this.eventBus._on("updatetextlayermatches",this._onUpdateTextLayerMatches))}cancel(){this.textLayerRenderTask&&(this.textLayerRenderTask.cancel(),this.textLayerRenderTask=null),this._onUpdateTextLayerMatches&&(this.eventBus._off("updatetextlayermatches",this._onUpdateTextLayerMatches),this._onUpdateTextLayerMatches=null)}setTextContentStream(e){this.cancel(),this.textContentStream=e}setTextContent(e){this.cancel(),this.textContent=e}_convertMatches(e,t){if(!e)return[];const{textContentItemsStr:n}=this;let r=0,i=0;const s=n.length-1,a=[];for(let o=0,l=e.length;o<l;o++){let l=e[o];for(;r!==s&&l>=i+n[r].length;)i+=n[r].length,r++;r===n.length&&console.error("Could not find a matching mapping");const c={begin:{divIdx:r,offset:l-i}};for(l+=t[o];r!==s&&l>i+n[r].length;)i+=n[r].length,r++;c.end={divIdx:r,offset:l-i},a.push(c)}return a}_renderMatches(e){if(0===e.length)return;const{findController:t,pageIdx:n,textContentItemsStr:r,textDivs:i}=this,s=n===t.selected.pageIdx,a=t.selected.matchIdx;let o=null;const l=void 0;function c(e,t){const n=e.divIdx;return i[n].textContent="",h(n,0,e.offset,t)}function h(e,t,n,s){const a=i[e],o=r[e].substring(t,n),l=document.createTextNode(o);if(s){const e=document.createElement("span");return e.className=`${s} appended`,e.appendChild(l),a.appendChild(e),s.includes("selected")?e.offsetLeft:0}return a.appendChild(l),0}let u=a,d=u+1;if(t.state.highlightAll)u=0,d=e.length;else if(!s)return;for(let r=u;r<d;r++){const u=e[r],d=u.begin,p=u.end,g=s&&r===a,f=g?" selected":"";let m=0;if(o&&d.divIdx===o.divIdx?h(o.divIdx,o.offset,d.offset):(null!==o&&h(o.divIdx,o.offset,l),c(d)),d.divIdx===p.divIdx)m=h(d.divIdx,d.offset,p.offset,"highlight"+f);else{m=h(d.divIdx,d.offset,l,"highlight begin"+f);for(let e=d.divIdx+1,t=p.divIdx;e<t;e++)i[e].className="highlight middle"+f;c(p,"highlight end"+f)}o=p,g&&t.scrollMatchIntoView({element:i[d.divIdx],selectedLeft:m,pageIndex:n,matchIndex:a})}o&&h(o.divIdx,o.offset,l)}_updateMatches(){if(!this.renderingDone)return;const{findController:e,matches:t,pageIdx:n,textContentItemsStr:r,textDivs:i}=this;let s=-1;for(let e=0,n=t.length;e<n;e++){const n=t[e];for(let e=Math.max(s,n.begin.divIdx),t=n.end.divIdx;e<=t;e++){const t=i[e];t.textContent=r[e],t.className=""}s=n.end.divIdx+1}if(!e?.highlightMatches)return;const a=e.pageMatches[n]||null,o=e.pageMatchesLength[n]||null;this.matches=this._convertMatches(a,o),this._renderMatches(this.matches)}_bindMouse(){const e=this.textLayerDiv;let t=null;e.addEventListener("mousedown",(n=>{if(this.enhanceTextSelection&&this.textLayerRenderTask)return this.textLayerRenderTask.expandTextDivs(!0),void(t&&(clearTimeout(t),t=null));const r=e.querySelector(".endOfContent");if(!r)return;let i=n.target!==e;if(i=i&&"none"!==window.getComputedStyle(r).getPropertyValue("-moz-user-select"),i){const t=e.getBoundingClientRect(),i=Math.max(0,(n.pageY-t.top)/t.height);r.style.top=(100*i).toFixed(2)+"%"}r.classList.add("active")})),e.addEventListener("mouseup",(()=>{if(this.enhanceTextSelection&&this.textLayerRenderTask)return void(t=setTimeout((()=>{this.textLayerRenderTask&&this.textLayerRenderTask.expandTextDivs(!1),t=null}),300));const n=e.querySelector(".endOfContent");n&&(n.style.top="",n.classList.remove("active"))}))}}t.TextLayerBuilder=i,t.DefaultTextLayerFactory=class{createTextLayerBuilder(e,t,n,r=!1,s){return new i({textLayerDiv:e,pageIndex:t,viewport:n,enhanceTextSelection:r,eventBus:s})}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DownloadManager=void 0;var r=n(2),i=n(8);function s(e,t){const n=document.createElement("a");if(!n.click)throw new Error('DownloadManager: "a.click()" is not supported.');n.href=e,n.target="_parent","download"in n&&(n.download=t),(document.body||document.documentElement).appendChild(n),n.click(),n.remove()}t.DownloadManager=class{constructor(){this._openBlobUrls=new WeakMap}downloadUrl(e,t){(0,r.createValidAbsoluteUrl)(e,"http://example.com")&&s(e+"#pdfjs.action=download",t)}downloadData(e,t,n){s((0,r.createObjectURL)(e,n,i.viewerCompatibilityParams.disableCreateObjectURL),t)}openOrDownloadData(e,t,n){const s=(0,r.isPdfFile)(n),a=s?"application/pdf":"";if(s&&!i.viewerCompatibilityParams.disableCreateObjectURL){let r,i=this._openBlobUrls.get(e);i||(i=URL.createObjectURL(new Blob([t],{type:a})),this._openBlobUrls.set(e,i)),r="?file="+encodeURIComponent(i+"#"+n);try{return window.open(r),!0}catch(t){console.error(`openOrDownloadData: ${t}`),URL.revokeObjectURL(i),this._openBlobUrls.delete(e)}}return this.downloadData(t,n,a),!1}download(e,t,n,r="download"){i.viewerCompatibilityParams.disableCreateObjectURL?this.downloadUrl(t,n):s(URL.createObjectURL(e),n)}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.viewerCompatibilityParams=void 0;const n=Object.create(null);{const e="undefined"!=typeof navigator&&navigator.userAgent||"",t="undefined"!=typeof navigator&&navigator.platform||"",r="undefined"!=typeof navigator&&navigator.maxTouchPoints||1,i=/Android/.test(e),s=/\b(iPad|iPhone|iPod)(?=;)/.test(e)||"MacIntel"===t&&r>1;/CriOS/.test(e)&&(n.disableCreateObjectURL=!0),(s||i)&&(n.maxCanvasPixels=5242880)}const r=Object.freeze(n);t.viewerCompatibilityParams=r},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GenericL10n=void 0,n(10);var r=n(3);const i=document.webL10n;t.GenericL10n=class{constructor(e){this._lang=e,this._ready=new Promise(((t,n)=>{i.setLanguage((0,r.fixupLangCode)(e),(()=>{t(i)}))}))}async getLanguage(){return(await this._ready).getLanguage()}async getDirection(){return(await this._ready).getDirection()}async get(e,t=null,n=(0,r.getL10nFallback)(e,t)){return(await this._ready).get(e,t,n)}async translate(e){return(await this._ready).translate(e)}}},()=>{document.webL10n=function(e,t,n){var r={},i="",s="textContent",a="",o={},l="loading";function c(e,t,n){t=t||function(e){},n=n||function(){};var r=new XMLHttpRequest;r.open("GET",e,!0),r.overrideMimeType&&r.overrideMimeType("text/plain; charset=utf-8"),r.onreadystatechange=function(){4==r.readyState&&(200==r.status||0===r.status?t(r.responseText):n())},r.onerror=n,r.ontimeout=n;try{r.send(null)}catch(e){n()}}function h(e,t,n,a){var o=e.replace(/[^\/]*$/,"")||"./";function l(e){return e.lastIndexOf("\\")<0?e:e.replace(/\\\\/g,"\\").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\{/g,"{").replace(/\\}/g,"}").replace(/\\"/g,'"').replace(/\\'/g,"'")}c(e,(function(e){i+=e,function(e,i){var a={},h=/^\s*|\s*$/,u=/^\s*#|^\s*$/,d=/^\s*\[(.*)\]\s*$/,p=/^\s*@import\s+url\((.*)\)\s*$/i,g=/^([^=\s]*)\s*=\s*(.+)$/;function f(e,n,r){var i=e.replace(h,"").split(/[\r\n]+/),s="*",c=t.split("-",1)[0],f=!1,_="";!function e(){for(;;){if(!i.length)return void r();var h=i.shift();if(!u.test(h)){if(n){if(_=d.exec(h)){s=_[1].toLowerCase(),f="*"!==s&&s!==t&&s!==c;continue}if(f)continue;if(_=p.exec(h))return void m(o+_[1],e)}var b=h.match(g);b&&3==b.length&&(a[b[1]]=l(b[2]))}}}()}function m(e,t){c(e,(function(e){f(e,!1,t)}),(function(){console.warn(e+" not found."),t()}))}f(e,!0,(function(){!function(e){for(var t in e){var i,a,o=t.lastIndexOf(".");o>0?(i=t.substring(0,o),a=t.substring(o+1)):(i=t,a=s),r[i]||(r[i]={}),r[i][a]=e[t]}n&&n()}(a)}))}(e)}),a)}function u(e,t,n){var i=r[e];if(!i){if(console.warn("#"+e+" is undefined."),!n)return null;i=n}var s={};for(var a in i){var o=i[a];o=p(o=d(o,t,e,a),t,e),s[a]=o}return s}function d(e,t,n,i){var s=/\{\[\s*([a-zA-Z]+)\(([a-zA-Z]+)\)\s*\]\}/.exec(e);if(!s||!s.length)return e;var a,l=s[1],c=s[2];return t&&c in t?a=t[c]:c in r&&(a=r[c]),l in o&&(e=(0,o[l])(e,a,n,i)),e}function p(e,t,n){return e.replace(/\{\{\s*(.+?)\s*\}\}/g,(function(e,i){return t&&i in t?t[i]:i in r?r[i]:(console.log("argument {{"+i+"}} for #"+n+" is undefined."),e)}))}function g(e){var n=function(e){if(!e)return{};var t=e.getAttribute("data-l10n-id"),n=e.getAttribute("data-l10n-args"),r={};if(n)try{r=JSON.parse(n)}catch(e){console.warn("could not parse arguments for #"+t)}return{id:t,args:r}}(e);if(n.id){var r=u(n.id,n.args);if(r){if(r[s]){if(0===function(e){if(e.children)return e.children.length;if(void 0!==e.childElementCount)return e.childElementCount;for(var t=0,n=0;n<e.childNodes.length;n++)t+=1===e.nodeType?1:0;return t}(e))e[s]=r[s];else{for(var i=e.childNodes,a=!1,o=0,l=i.length;o<l;o++)3===i[o].nodeType&&/\S/.test(i[o].nodeValue)&&(a?i[o].nodeValue="":(i[o].nodeValue=r[s],a=!0));if(!a){var c=t.createTextNode(r[s]);e.insertBefore(c,e.firstChild)}}delete r[s]}for(var h in r)e[h]=r[h]}else console.warn("#"+n.id+" is undefined.")}}return o.plural=function(e,t,n,i){var l=parseFloat(t);if(isNaN(l))return e;if(i!=s)return e;o._pluralRules||(o._pluralRules=function(e){function t(e,t){return-1!==t.indexOf(e)}function n(e,t,n){return t<=e&&e<=n}var r={0:function(e){return"other"},1:function(e){return n(e%100,3,10)?"few":0===e?"zero":n(e%100,11,99)?"many":2==e?"two":1==e?"one":"other"},2:function(e){return 0!==e&&e%10==0?"many":2==e?"two":1==e?"one":"other"},3:function(e){return 1==e?"one":"other"},4:function(e){return n(e,0,1)?"one":"other"},5:function(e){return n(e,0,2)&&2!=e?"one":"other"},6:function(e){return 0===e?"zero":e%10==1&&e%100!=11?"one":"other"},7:function(e){return 2==e?"two":1==e?"one":"other"},8:function(e){return n(e,3,6)?"few":n(e,7,10)?"many":2==e?"two":1==e?"one":"other"},9:function(e){return 0===e||1!=e&&n(e%100,1,19)?"few":1==e?"one":"other"},10:function(e){return n(e%10,2,9)&&!n(e%100,11,19)?"few":e%10!=1||n(e%100,11,19)?"other":"one"},11:function(e){return n(e%10,2,4)&&!n(e%100,12,14)?"few":e%10==0||n(e%10,5,9)||n(e%100,11,14)?"many":e%10==1&&e%100!=11?"one":"other"},12:function(e){return n(e,2,4)?"few":1==e?"one":"other"},13:function(e){return n(e%10,2,4)&&!n(e%100,12,14)?"few":1!=e&&n(e%10,0,1)||n(e%10,5,9)||n(e%100,12,14)?"many":1==e?"one":"other"},14:function(e){return n(e%100,3,4)?"few":e%100==2?"two":e%100==1?"one":"other"},15:function(e){return 0===e||n(e%100,2,10)?"few":n(e%100,11,19)?"many":1==e?"one":"other"},16:function(e){return e%10==1&&11!=e?"one":"other"},17:function(e){return 3==e?"few":0===e?"zero":6==e?"many":2==e?"two":1==e?"one":"other"},18:function(e){return 0===e?"zero":n(e,0,2)&&0!==e&&2!=e?"one":"other"},19:function(e){return n(e,2,10)?"few":n(e,0,1)?"one":"other"},20:function(e){return!n(e%10,3,4)&&e%10!=9||n(e%100,10,19)||n(e%100,70,79)||n(e%100,90,99)?e%1e6==0&&0!==e?"many":e%10!=2||t(e%100,[12,72,92])?e%10!=1||t(e%100,[11,71,91])?"other":"one":"two":"few"},21:function(e){return 0===e?"zero":1==e?"one":"other"},22:function(e){return n(e,0,1)||n(e,11,99)?"one":"other"},23:function(e){return n(e%10,1,2)||e%20==0?"one":"other"},24:function(e){return n(e,3,10)||n(e,13,19)?"few":t(e,[2,12])?"two":t(e,[1,11])?"one":"other"}},i={af:3,ak:4,am:4,ar:1,asa:3,az:0,be:11,bem:3,bez:3,bg:3,bh:4,bm:0,bn:3,bo:0,br:20,brx:3,bs:11,ca:3,cgg:3,chr:3,cs:12,cy:17,da:3,de:3,dv:3,dz:0,ee:3,el:3,en:3,eo:3,es:3,et:3,eu:3,fa:0,ff:5,fi:3,fil:4,fo:3,fr:5,fur:3,fy:3,ga:8,gd:24,gl:3,gsw:3,gu:3,guw:4,gv:23,ha:3,haw:3,he:2,hi:4,hr:11,hu:0,id:0,ig:0,ii:0,is:3,it:3,iu:7,ja:0,jmc:3,jv:0,ka:0,kab:5,kaj:3,kcg:3,kde:0,kea:0,kk:3,kl:3,km:0,kn:0,ko:0,ksb:3,ksh:21,ku:3,kw:7,lag:18,lb:3,lg:3,ln:4,lo:0,lt:10,lv:6,mas:3,mg:4,mk:16,ml:3,mn:3,mo:9,mr:3,ms:0,mt:15,my:0,nah:3,naq:7,nb:3,nd:3,ne:3,nl:3,nn:3,no:3,nr:3,nso:4,ny:3,nyn:3,om:3,or:3,pa:3,pap:3,pl:13,ps:3,pt:3,rm:3,ro:9,rof:3,ru:11,rwk:3,sah:0,saq:3,se:7,seh:3,ses:0,sg:0,sh:11,shi:19,sk:12,sl:14,sma:7,smi:7,smj:7,smn:7,sms:7,sn:3,so:3,sq:3,sr:11,ss:3,ssy:3,st:3,sv:3,sw:3,syr:3,ta:3,te:3,teo:3,th:0,ti:4,tig:3,tk:3,tl:4,tn:3,to:0,tr:0,ts:3,tzm:22,uk:11,ur:3,ve:3,vi:0,vun:3,wa:4,wae:3,wo:0,xh:3,xog:3,yo:0,zh:0,zu:3}[e.replace(/-.*$/,"")];return i in r?r[i]:(console.warn("plural form unknown for ["+e+"]"),function(){return"other"})}(a));var c="["+o._pluralRules(l)+"]";return 0===l&&n+"[zero]"in r?e=r[n+"[zero]"][i]:1==l&&n+"[one]"in r?e=r[n+"[one]"][i]:2==l&&n+"[two]"in r?e=r[n+"[two]"][i]:n+c in r?e=r[n+c][i]:n+"[other]"in r&&(e=r[n+"[other]"][i]),e},{get:function(e,t,n){var r,i=e.lastIndexOf("."),a=s;i>0&&(a=e.substring(i+1),e=e.substring(0,i)),n&&((r={})[a]=n);var o=u(e,t,r);return o&&a in o?o[a]:"{{"+e+"}}"},getData:function(){return r},getText:function(){return i},getLanguage:function(){return a},setLanguage:function(e,n){!function(e,n){e&&(e=e.toLowerCase()),n=n||function(){},r={},i="",a="",a=e;var s=t.querySelectorAll('link[type="application/l10n"]'),o=s.length;if(0!==o){var c,u,d=0;u=function(){++d>=o&&(n(),l="complete")};for(var p=0;p<o;p++)new _(s[p]).load(e,u)}else{var g=(c=t.querySelector('script[type="application/l10n"]'))?JSON.parse(c.innerHTML):null;if(g&&g.locales&&g.default_locale){if(console.log("using the embedded JSON directory, early way out"),!(r=g.locales[e])){var f=g.default_locale.toLowerCase();for(var m in g.locales){if((m=m.toLowerCase())===e){r=g.locales[e];break}m===f&&(r=g.locales[f])}}n()}else console.log("no resource to load, early way out");l="complete"}function _(e){var t=e.href;this.load=function(e,n){h(t,e,n,(function(){console.warn(t+" not found."),console.warn('"'+e+'" resource not found'),a="",n()}))}}}(e,(function(){n&&n()}))},getDirection:function(){var e=a.split("-",1)[0];return["ar","he","fa","ps","ur"].indexOf(e)>=0?"rtl":"ltr"},translate:function(e){for(var n=function(e){return e?e.querySelectorAll("*[data-l10n-id]"):[]}(e=e||t.documentElement),r=n.length,i=0;i<r;i++)g(n[i]);g(e)},getReadyState:function(){return l},ready:function(n){n&&("complete"==l||"interactive"==l?e.setTimeout((function(){n()})):t.addEventListener&&t.addEventListener("localized",(function e(){t.removeEventListener("localized",e),n()})))}}}(window,document)},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFFindController=t.FindState=void 0;var r=n(2),i=n(12),s=n(5);const a={FOUND:0,NOT_FOUND:1,WRAPPED:2,PENDING:3};t.FindState=a;const o={"‐":"-","‘":"'","’":"'","‚":"'","‛":"'","“":'"',"”":'"',"„":'"',"‟":'"',"¼":"1/4","½":"1/2","¾":"3/4"};let l=null;function c(e){if(!l){const e=Object.keys(o).join("");l=new RegExp(`[${e}]`,"g")}let t=null;return[e.replace(l,(function(e,n){const r=o[e],i=r.length-e.length;return 0!==i&&(t||(t=[])).push([n,i]),r})),t]}function h(e,t=null){if(!t)return e;let n=0;for(const[r,i]of t){const t=r+n;if(t>=e)break;if(t+i>e){n+=e-t;break}n+=i}return e-n}t.PDFFindController=class{constructor({linkService:e,eventBus:t}){this._linkService=e,this._eventBus=t,this._reset(),t._on("findbarclose",this._onFindBarClose.bind(this))}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(e){this._pdfDocument&&this._reset(),e&&(this._pdfDocument=e,this._firstPageCapability.resolve())}executeCommand(e,t){if(!t)return;const n=this._pdfDocument;(null===this._state||this._shouldDirtyMatch(e,t))&&(this._dirtyMatch=!0),this._state=t,"findhighlightallchange"!==e&&this._updateUIState(a.PENDING),this._firstPageCapability.promise.then((()=>{if(!this._pdfDocument||n&&this._pdfDocument!==n)return;this._extractText();const t=!this._highlightMatches,r=!!this._findTimeout;this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),"find"===e?this._findTimeout=setTimeout((()=>{this._nextMatch(),this._findTimeout=null}),250):this._dirtyMatch?this._nextMatch():"findagain"===e?(this._nextMatch(),t&&this._state.highlightAll&&this._updateAllPages()):"findhighlightallchange"===e?(r?this._nextMatch():this._highlightMatches=!0,this._updateAllPages()):this._nextMatch()}))}scrollMatchIntoView({element:e=null,selectedLeft:t=0,pageIndex:n=-1,matchIndex:r=-1}){if(!this._scrollMatches||!e)return;if(-1===r||r!==this._selected.matchIdx)return;if(-1===n||n!==this._selected.pageIdx)return;this._scrollMatches=!1;const i={top:-50,left:t+-400};(0,s.scrollIntoView)(e,i,!0)}_reset(){this._highlightMatches=!1,this._scrollMatches=!1,this._pdfDocument=null,this._pageMatches=[],this._pageMatchesLength=[],this._state=null,this._selected={pageIdx:-1,matchIdx:-1},this._offset={pageIdx:null,matchIdx:null,wrapped:!1},this._extractTextPromises=[],this._pageContents=[],this._pageDiffs=[],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,r.createPromiseCapability)()}get _query(){return this._state.query!==this._rawQuery&&(this._rawQuery=this._state.query,[this._normalizedQuery]=c(this._state.query)),this._normalizedQuery}_shouldDirtyMatch(e,t){if(t.query!==this._state.query)return!0;switch(e){case"findagain":const e=this._selected.pageIdx+1,t=this._linkService;return e>=1&&e<=t.pagesCount&&e!==t.page&&!t.isPageVisible(e);case"findhighlightallchange":return!1}return!0}_prepareMatches(e,t,n){function r(t){const n=e[t],r=e[t+1];if(t<e.length-1&&n.match===r.match)return n.skipped=!0,!0;for(let r=t-1;r>=0;r--){const t=e[r];if(!t.skipped){if(t.match+t.matchLength<n.match)break;if(t.match+t.matchLength>=n.match+n.matchLength)return n.skipped=!0,!0}}return!1}e.sort((function(e,t){return e.match===t.match?e.matchLength-t.matchLength:e.match-t.match}));for(let i=0,s=e.length;i<s;i++)r(i)||(t.push(e[i].match),n.push(e[i].matchLength))}_isEntireWord(e,t,n){if(t>0){const n=e.charCodeAt(t),r=e.charCodeAt(t-1);if((0,i.getCharacterType)(n)===(0,i.getCharacterType)(r))return!1}const r=t+n-1;if(r<e.length-1){const t=e.charCodeAt(r),n=e.charCodeAt(r+1);if((0,i.getCharacterType)(t)===(0,i.getCharacterType)(n))return!1}return!0}_calculatePhraseMatch(e,t,n,r,i){const s=[],a=[],o=e.length;let l=-o;for(;l=n.indexOf(e,l+o),-1!==l;){if(i&&!this._isEntireWord(n,l,o))continue;const e=h(l,r),t=h(l+o-1,r)-e+1;s.push(e),a.push(t)}this._pageMatches[t]=s,this._pageMatchesLength[t]=a}_calculateWordMatch(e,t,n,r,i){const s=[],a=e.match(/\S+/g);for(let e=0,t=a.length;e<t;e++){const t=a[e],o=t.length;let l=-o;for(;l=n.indexOf(t,l+o),-1!==l;){if(i&&!this._isEntireWord(n,l,o))continue;const e=h(l,r),t=h(l+o-1,r)-e+1;s.push({match:e,matchLength:t,skipped:!1})}}this._pageMatchesLength[t]=[],this._pageMatches[t]=[],this._prepareMatches(s,this._pageMatches[t],this._pageMatchesLength[t])}_calculateMatch(e){let t=this._pageContents[e];const n=this._pageDiffs[e];let r=this._query;const{caseSensitive:i,entireWord:s,phraseSearch:a}=this._state;if(0===r.length)return;i||(t=t.toLowerCase(),r=r.toLowerCase()),a?this._calculatePhraseMatch(r,e,t,n,s):this._calculateWordMatch(r,e,t,n,s),this._state.highlightAll&&this._updatePage(e),this._resumePageIdx===e&&(this._resumePageIdx=null,this._nextPageMatch());const o=this._pageMatches[e].length;o>0&&(this._matchesCountTotal+=o,this._updateUIResultsCount())}_extractText(){if(this._extractTextPromises.length>0)return;let e=Promise.resolve();for(let t=0,n=this._linkService.pagesCount;t<n;t++){const n=(0,r.createPromiseCapability)();this._extractTextPromises[t]=n.promise,e=e.then((()=>this._pdfDocument.getPage(t+1).then((e=>e.getTextContent({normalizeWhitespace:!0}))).then((e=>{const r=e.items,i=[];for(let e=0,t=r.length;e<t;e++)i.push(r[e].str);[this._pageContents[t],this._pageDiffs[t]]=c(i.join("")),n.resolve(t)}),(e=>{console.error(`Unable to get text content for page ${t+1}`,e),this._pageContents[t]="",this._pageDiffs[t]=null,n.resolve(t)}))))}}_updatePage(e){this._scrollMatches&&this._selected.pageIdx===e&&(this._linkService.page=e+1),this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:e})}_updateAllPages(){this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:-1})}_nextMatch(){const e=this._state.findPrevious,t=this._linkService.page-1,n=this._linkService.pagesCount;if(this._highlightMatches=!0,this._dirtyMatch){this._dirtyMatch=!1,this._selected.pageIdx=this._selected.matchIdx=-1,this._offset.pageIdx=t,this._offset.matchIdx=null,this._offset.wrapped=!1,this._resumePageIdx=null,this._pageMatches.length=0,this._pageMatchesLength.length=0,this._matchesCountTotal=0,this._updateAllPages();for(let e=0;e<n;e++)this._pendingFindMatches.has(e)||(this._pendingFindMatches.add(e),this._extractTextPromises[e].then((e=>{this._pendingFindMatches.delete(e),this._calculateMatch(e)})))}if(""===this._query)return void this._updateUIState(a.FOUND);if(this._resumePageIdx)return;const r=this._offset;if(this._pagesToSearch=n,null!==r.matchIdx){const t=this._pageMatches[r.pageIdx].length;if(!e&&r.matchIdx+1<t||e&&r.matchIdx>0)return r.matchIdx=e?r.matchIdx-1:r.matchIdx+1,void this._updateMatch(!0);this._advanceOffsetPage(e)}this._nextPageMatch()}_matchesReady(e){const t=this._offset,n=e.length,r=this._state.findPrevious;return n?(t.matchIdx=r?n-1:0,this._updateMatch(!0),!0):(this._advanceOffsetPage(r),!!(t.wrapped&&(t.matchIdx=null,this._pagesToSearch<0))&&(this._updateMatch(!1),!0))}_nextPageMatch(){null!==this._resumePageIdx&&console.error("There can only be one pending page.");let e=null;do{const t=this._offset.pageIdx;if(e=this._pageMatches[t],!e){this._resumePageIdx=t;break}}while(!this._matchesReady(e))}_advanceOffsetPage(e){const t=this._offset,n=this._linkService.pagesCount;t.pageIdx=e?t.pageIdx-1:t.pageIdx+1,t.matchIdx=null,this._pagesToSearch--,(t.pageIdx>=n||t.pageIdx<0)&&(t.pageIdx=e?n-1:0,t.wrapped=!0)}_updateMatch(e=!1){let t=a.NOT_FOUND;const n=this._offset.wrapped;if(this._offset.wrapped=!1,e){const e=this._selected.pageIdx;this._selected.pageIdx=this._offset.pageIdx,this._selected.matchIdx=this._offset.matchIdx,t=n?a.WRAPPED:a.FOUND,-1!==e&&e!==this._selected.pageIdx&&this._updatePage(e)}this._updateUIState(t,this._state.findPrevious),-1!==this._selected.pageIdx&&(this._scrollMatches=!0,this._updatePage(this._selected.pageIdx))}_onFindBarClose(e){const t=this._pdfDocument;this._firstPageCapability.promise.then((()=>{!this._pdfDocument||t&&this._pdfDocument!==t||(this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),this._resumePageIdx&&(this._resumePageIdx=null,this._dirtyMatch=!0),this._updateUIState(a.FOUND),this._highlightMatches=!1,this._updateAllPages())}))}_requestMatchesCount(){const{pageIdx:e,matchIdx:t}=this._selected;let n=0,r=this._matchesCountTotal;if(-1!==t){for(let t=0;t<e;t++)n+=this._pageMatches[t]?.length||0;n+=t+1}return(n<1||n>r)&&(n=r=0),{current:n,total:r}}_updateUIResultsCount(){this._eventBus.dispatch("updatefindmatchescount",{source:this,matchesCount:this._requestMatchesCount()})}_updateUIState(e,t){this._eventBus.dispatch("updatefindcontrolstate",{source:this,state:e,previous:t,matchesCount:this._requestMatchesCount(),rawQuery:this._state?.query??null})}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getCharacterType=function(e){return function(e){return e<11904}(e)?function(e){return 0==(65408&e)}(e)?function(e){return 32===e||9===e||13===e||10===e}(e)?n.SPACE:function(e){return e>=97&&e<=122||e>=65&&e<=90}(e)||function(e){return e>=48&&e<=57}(e)||95===e?n.ALPHA_LETTER:n.PUNCT:function(e){return 3584==(65408&e)}(e)?n.THAI_LETTER:160===e?n.SPACE:n.ALPHA_LETTER:function(e){return e>=13312&&e<=40959||e>=63744&&e<=64255}(e)?n.HAN_LETTER:function(e){return e>=12448&&e<=12543}(e)?n.KATAKANA_LETTER:function(e){return e>=12352&&e<=12447}(e)?n.HIRAGANA_LETTER:function(e){return e>=65376&&e<=65439}(e)?n.HALFWIDTH_KATAKANA_LETTER:n.ALPHA_LETTER},t.CharacterType=void 0;const n={SPACE:0,ALPHA_LETTER:1,PUNCT:2,HAN_LETTER:3,KATAKANA_LETTER:4,HIRAGANA_LETTER:5,HALFWIDTH_KATAKANA_LETTER:6,THAI_LETTER:7};t.CharacterType=n},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isDestArraysEqual=a,t.isDestHashesEqual=s,t.PDFHistory=void 0;var r=n(5);function i(){return document.location.hash}function s(e,t){if("string"!=typeof e||"string"!=typeof t)return!1;if(e===t)return!0;const{nameddest:n}=(0,r.parseQueryString)(e);return n===t}function a(e,t){function n(e,t){if(typeof e!=typeof t)return!1;if(Array.isArray(e)||Array.isArray(t))return!1;if(null!==e&&"object"==typeof e&&null!==t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(!n(e[r],t[r]))return!1;return!0}return e===t||Number.isNaN(e)&&Number.isNaN(t)}if(!Array.isArray(e)||!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!n(e[r],t[r]))return!1;return!0}t.PDFHistory=class{constructor({linkService:e,eventBus:t}){this.linkService=e,this.eventBus=t,this._initialized=!1,this._fingerprint="",this.reset(),this._boundEvents=null,this._isViewerInPresentationMode=!1,this.eventBus._on("presentationmodechanged",(e=>{this._isViewerInPresentationMode=e.state!==r.PresentationModeState.NORMAL})),this.eventBus._on("pagesinit",(()=>{this._isPagesLoaded=!1,this.eventBus._on("pagesloaded",(e=>{this._isPagesLoaded=!!e.pagesCount}),{once:!0})}))}initialize({fingerprint:e,resetHistory:t=!1,updateUrl:n=!1}){if(!e||"string"!=typeof e)return void console.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.');this._initialized&&this.reset();const r=""!==this._fingerprint&&this._fingerprint!==e;this._fingerprint=e,this._updateUrl=!0===n,this._initialized=!0,this._bindEvents();const s=window.history.state;if(this._popStateInProgress=!1,this._blockHashChange=0,this._currentHash=i(),this._numPositionUpdates=0,this._uid=this._maxUid=0,this._destination=null,this._position=null,!this._isValidState(s,!0)||t){const{hash:e,page:n,rotation:i}=this._parseCurrentHash(!0);return!e||r||t?void this._pushOrReplaceState(null,!0):void this._pushOrReplaceState({hash:e,page:n,rotation:i},!0)}const a=s.destination;this._updateInternalState(a,s.uid,!0),void 0!==a.rotation&&(this._initialRotation=a.rotation),a.dest?(this._initialBookmark=JSON.stringify(a.dest),this._destination.page=null):a.hash?this._initialBookmark=a.hash:a.page&&(this._initialBookmark=`page=${a.page}`)}reset(){this._initialized&&(this._pageHide(),this._initialized=!1,this._unbindEvents()),this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._initialBookmark=null,this._initialRotation=null}push({namedDest:e=null,explicitDest:t,pageNumber:n}){if(!this._initialized)return;if(e&&"string"!=typeof e)return void console.error(`PDFHistory.push: "${e}" is not a valid namedDest parameter.`);if(!Array.isArray(t))return void console.error(`PDFHistory.push: "${t}" is not a valid explicitDest parameter.`);if(!this._isValidPage(n)&&(null!==n||this._destination))return void console.error(`PDFHistory.push: "${n}" is not a valid pageNumber parameter.`);const r=e||JSON.stringify(t);if(!r)return;let i=!1;if(this._destination&&(s(this._destination.hash,r)||a(this._destination.dest,t))){if(this._destination.page)return;i=!0}this._popStateInProgress&&!i||(this._pushOrReplaceState({dest:t,hash:r,page:n,rotation:this.linkService.rotation},i),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then((()=>{this._popStateInProgress=!1}))))}pushPage(e){this._initialized&&(this._isValidPage(e)?this._destination?.page!==e&&(this._popStateInProgress||(this._pushOrReplaceState({dest:null,hash:`page=${e}`,page:e,rotation:this.linkService.rotation}),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then((()=>{this._popStateInProgress=!1}))))):console.error(`PDFHistory.pushPage: "${e}" is not a valid page number.`))}pushCurrentPosition(){this._initialized&&!this._popStateInProgress&&this._tryPushCurrentPosition()}back(){if(!this._initialized||this._popStateInProgress)return;const e=window.history.state;this._isValidState(e)&&e.uid>0&&window.history.back()}forward(){if(!this._initialized||this._popStateInProgress)return;const e=window.history.state;this._isValidState(e)&&e.uid<this._maxUid&&window.history.forward()}get popStateInProgress(){return this._initialized&&(this._popStateInProgress||this._blockHashChange>0)}get initialBookmark(){return this._initialized?this._initialBookmark:null}get initialRotation(){return this._initialized?this._initialRotation:null}_pushOrReplaceState(e,t=!1){const n=t||!this._destination,r={fingerprint:this._fingerprint,uid:n?this._uid:this._uid+1,destination:e};let i;if(this._updateInternalState(e,r.uid),this._updateUrl&&e?.hash){const t=document.location.href.split("#")[0];t.startsWith("file://")||(i=`${t}#${e.hash}`)}n?window.history.replaceState(r,"",i):window.history.pushState(r,"",i)}_tryPushCurrentPosition(e=!1){if(!this._position)return;let t=this._position;if(e&&(t=Object.assign(Object.create(null),this._position),t.temporary=!0),!this._destination)return void this._pushOrReplaceState(t);if(this._destination.temporary)return void this._pushOrReplaceState(t,!0);if(this._destination.hash===t.hash)return;if(!this._destination.page&&this._numPositionUpdates<=50)return;let n=!1;if(this._destination.page>=t.first&&this._destination.page<=t.page){if(void 0!==this._destination.dest||!this._destination.first)return;n=!0}this._pushOrReplaceState(t,n)}_isValidPage(e){return Number.isInteger(e)&&e>0&&e<=this.linkService.pagesCount}_isValidState(e,t=!1){if(!e)return!1;if(e.fingerprint!==this._fingerprint){if(!t)return!1;{if("string"!=typeof e.fingerprint||e.fingerprint.length!==this._fingerprint.length)return!1;const[t]=performance.getEntriesByType("navigation");if("reload"!==t?.type)return!1}}return!(!Number.isInteger(e.uid)||e.uid<0)&&null!==e.destination&&"object"==typeof e.destination}_updateInternalState(e,t,n=!1){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),n&&e?.temporary&&delete e.temporary,this._destination=e,this._uid=t,this._maxUid=Math.max(this._maxUid,t),this._numPositionUpdates=0}_parseCurrentHash(e=!1){const t=unescape(i()).substring(1),n=(0,r.parseQueryString)(t),s=n.nameddest||"";let a=0|n.page;return(!this._isValidPage(a)||e&&s.length>0)&&(a=null),{hash:t,page:a,rotation:this.linkService.rotation}}_updateViewarea({location:e}){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._position={hash:this._isViewerInPresentationMode?`page=${e.pageNumber}`:e.pdfOpenParams.substring(1),page:this.linkService.page,first:e.pageNumber,rotation:e.rotation},this._popStateInProgress||(this._isPagesLoaded&&this._destination&&!this._destination.page&&this._numPositionUpdates++,this._updateViewareaTimeout=setTimeout((()=>{this._popStateInProgress||this._tryPushCurrentPosition(!0),this._updateViewareaTimeout=null}),1e3))}_popState({state:e}){const t=i(),n=this._currentHash!==t;if(this._currentHash=t,!e){this._uid++;const{hash:e,page:t,rotation:n}=this._parseCurrentHash();return void this._pushOrReplaceState({hash:e,page:t,rotation:n},!0)}if(!this._isValidState(e))return;this._popStateInProgress=!0,n&&(this._blockHashChange++,(0,r.waitOnEventOrTimeout)({target:window,name:"hashchange",delay:1e3}).then((()=>{this._blockHashChange--})));const s=e.destination;this._updateInternalState(s,e.uid,!0),(0,r.isValidRotation)(s.rotation)&&(this.linkService.rotation=s.rotation),s.dest?this.linkService.goToDestination(s.dest):s.hash?this.linkService.setHash(s.hash):s.page&&(this.linkService.page=s.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)}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFPageView=void 0;var r=n(5),i=n(2),s=n(3),a=n(15),o=n(8);const l=o.viewerCompatibilityParams.maxCanvasPixels||16777216;t.PDFPageView=class{constructor(e){const t=e.container,n=e.defaultViewport;this.id=e.id,this.renderingId="page"+this.id,this.pdfPage=null,this.pageLabel=null,this.rotation=0,this.scale=e.scale||r.DEFAULT_SCALE,this.viewport=n,this.pdfPageRotate=n.rotation,this._optionalContentConfigPromise=e.optionalContentConfigPromise||null,this.hasRestrictedScaling=!1,this.textLayerMode=Number.isInteger(e.textLayerMode)?e.textLayerMode:r.TextLayerMode.ENABLE,this.imageResourcesPath=e.imageResourcesPath||"",this.renderInteractiveForms=!1!==e.renderInteractiveForms,this.useOnlyCssZoom=e.useOnlyCssZoom||!1,this.maxCanvasPixels=e.maxCanvasPixels||l,this.eventBus=e.eventBus,this.renderingQueue=e.renderingQueue,this.textLayerFactory=e.textLayerFactory,this.annotationLayerFactory=e.annotationLayerFactory,this.xfaLayerFactory=e.xfaLayerFactory,this.structTreeLayerFactory=e.structTreeLayerFactory,this.renderer=e.renderer||r.RendererType.CANVAS,this.l10n=e.l10n||s.NullL10n,this.paintTask=null,this.paintedViewportMap=new WeakMap,this.renderingState=a.RenderingStates.INITIAL,this.resume=null,this._renderError=null,this.annotationLayer=null,this.textLayer=null,this.zoomLayer=null,this.xfaLayer=null,this.structTreeLayer=null;const i=document.createElement("div");i.className="page",i.style.width=Math.floor(this.viewport.width)+"px",i.style.height=Math.floor(this.viewport.height)+"px",i.setAttribute("data-page-number",this.id),i.setAttribute("role","region"),this.l10n.get("page_landmark",{page:this.id}).then((e=>{i.setAttribute("aria-label",e)})),this.div=i,t.appendChild(i)}setPdfPage(e){this.pdfPage=e,this.pdfPageRotate=e.rotate;const t=(this.rotation+this.pdfPageRotate)%360;this.viewport=e.getViewport({scale:this.scale*r.CSS_UNITS,rotation:t}),this.reset()}destroy(){this.reset(),this.pdfPage&&this.pdfPage.cleanup()}async _renderAnnotationLayer(){let e=null;try{await this.annotationLayer.render(this.viewport,"display")}catch(t){e=t}finally{this.eventBus.dispatch("annotationlayerrendered",{source:this,pageNumber:this.id,error:e})}}async _renderXfaLayer(){let e=null;try{await this.xfaLayer.render(this.viewport,"display")}catch(t){e=t}finally{this.eventBus.dispatch("xfalayerrendered",{source:this,pageNumber:this.id,error:e})}}_resetZoomLayer(e=!1){if(!this.zoomLayer)return;const t=this.zoomLayer.firstChild;this.paintedViewportMap.delete(t),t.width=0,t.height=0,e&&this.zoomLayer.remove(),this.zoomLayer=null}reset({keepZoomLayer:e=!1,keepAnnotationLayer:t=!1,keepXfaLayer:n=!1}={}){this.cancelRendering({keepAnnotationLayer:t,keepXfaLayer:n}),this.renderingState=a.RenderingStates.INITIAL;const r=this.div;r.style.width=Math.floor(this.viewport.width)+"px",r.style.height=Math.floor(this.viewport.height)+"px";const i=r.childNodes,s=e&&this.zoomLayer||null,o=t&&this.annotationLayer?.div||null,l=n&&this.xfaLayer?.div||null;for(let e=i.length-1;e>=0;e--){const t=i[e];switch(t){case s:case o:case l:continue}r.removeChild(t)}r.removeAttribute("data-loaded"),o&&this.annotationLayer.hide(),l&&this.xfaLayer.hide(),s||(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",this.loadingIconDiv.setAttribute("role","img"),this.l10n.get("loading").then((e=>{this.loadingIconDiv?.setAttribute("aria-label",e)})),r.appendChild(this.loadingIconDiv)}update(e,t,n=null){this.scale=e||this.scale,void 0!==t&&(this.rotation=t),n instanceof Promise&&(this._optionalContentConfigPromise=n);const i=(this.rotation+this.pdfPageRotate)%360;if(this.viewport=this.viewport.clone({scale:this.scale*r.CSS_UNITS,rotation:i}),this.svg)return this.cssTransform({target:this.svg,redrawAnnotationLayer:!0,redrawXfaLayer:!0}),void this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!0,timestamp:performance.now(),error:this._renderError});let s=!1;if(this.canvas&&this.maxCanvasPixels>0){const e=this.outputScale;(Math.floor(this.viewport.width)*e.sx|0)*(Math.floor(this.viewport.height)*e.sy|0)>this.maxCanvasPixels&&(s=!0)}if(this.canvas){if(this.useOnlyCssZoom||this.hasRestrictedScaling&&s)return this.cssTransform({target:this.canvas,redrawAnnotationLayer:!0,redrawXfaLayer:!0}),void this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!0,timestamp:performance.now(),error:this._renderError});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:e=!1,keepXfaLayer:t=!1}={}){this.paintTask&&(this.paintTask.cancel(),this.paintTask=null),this.resume=null,this.textLayer&&(this.textLayer.cancel(),this.textLayer=null),!this.annotationLayer||e&&this.annotationLayer.div||(this.annotationLayer.cancel(),this.annotationLayer=null),!this.xfaLayer||t&&this.xfaLayer.div||(this.xfaLayer.cancel(),this.xfaLayer=null),this._onTextLayerRendered&&(this.eventBus._off("textlayerrendered",this._onTextLayerRendered),this._onTextLayerRendered=null)}cssTransform({target:e,redrawAnnotationLayer:t=!1,redrawXfaLayer:n=!1}){const r=this.viewport.width,i=this.viewport.height,s=this.div;e.style.width=e.parentNode.style.width=s.style.width=Math.floor(r)+"px",e.style.height=e.parentNode.style.height=s.style.height=Math.floor(i)+"px";const a=this.viewport.rotation-this.paintedViewportMap.get(e).rotation,o=Math.abs(a);let l=1,c=1;if(90!==o&&270!==o||(l=i/r,c=r/i),e.style.transform=`rotate(${a}deg) scale(${l}, ${c})`,this.textLayer){const e=this.textLayer.viewport,t=this.viewport.rotation-e.rotation,n=Math.abs(t);let i=r/e.width;90!==n&&270!==n||(i=r/e.height);const s=this.textLayer.textLayerDiv;let a,o;switch(n){case 0:a=o=0;break;case 90:a=0,o="-"+s.style.height;break;case 180:a="-"+s.style.width,o="-"+s.style.height;break;case 270:a="-"+s.style.width,o=0;break;default:console.error("Bad rotation value.")}s.style.transform=`rotate(${n}deg) scale(${i}) translate(${a}, ${o})`,s.style.transformOrigin="0% 0%"}t&&this.annotationLayer&&this._renderAnnotationLayer(),n&&this.xfaLayer&&this._renderXfaLayer()}get width(){return this.viewport.width}get height(){return this.viewport.height}getPagePoint(e,t){return this.viewport.convertToPdfPoint(e,t)}draw(){this.renderingState!==a.RenderingStates.INITIAL&&(console.error("Must be in new state before drawing"),this.reset());const{div:e,pdfPage:t}=this;if(!t)return this.renderingState=a.RenderingStates.FINISHED,this.loadingIconDiv&&(e.removeChild(this.loadingIconDiv),delete this.loadingIconDiv),Promise.reject(new Error("pdfPage is not loaded"));this.renderingState=a.RenderingStates.RUNNING;const n=document.createElement("div");n.style.width=e.style.width,n.style.height=e.style.height,n.classList.add("canvasWrapper"),this.annotationLayer?.div?e.insertBefore(n,this.annotationLayer.div):e.appendChild(n);let s=null;if(this.textLayerMode!==r.TextLayerMode.DISABLE&&this.textLayerFactory){const t=document.createElement("div");t.className="textLayer",t.style.width=n.style.width,t.style.height=n.style.height,this.annotationLayer?.div?e.insertBefore(t,this.annotationLayer.div):e.appendChild(t),s=this.textLayerFactory.createTextLayerBuilder(t,this.id-1,this.viewport,this.textLayerMode===r.TextLayerMode.ENABLE_ENHANCE,this.eventBus)}this.textLayer=s,this.xfaLayer?.div&&e.appendChild(this.xfaLayer.div);let o=null;this.renderingQueue&&(o=e=>{if(!this.renderingQueue.isHighestPriority(this))return this.renderingState=a.RenderingStates.PAUSED,void(this.resume=()=>{this.renderingState=a.RenderingStates.RUNNING,e()});e()});const l=async(t=null)=>{if(c===this.paintTask&&(this.paintTask=null),t instanceof i.RenderingCancelledException)this._renderError=null;else if(this._renderError=t,this.renderingState=a.RenderingStates.FINISHED,this.loadingIconDiv&&(e.removeChild(this.loadingIconDiv),delete this.loadingIconDiv),this._resetZoomLayer(!0),this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!1,timestamp:performance.now(),error:this._renderError}),t)throw t},c=this.renderer===r.RendererType.SVG?this.paintOnSvg(n):this.paintOnCanvas(n);c.onRenderContinue=o,this.paintTask=c;const h=c.promise.then((()=>l(null).then((()=>{if(s){const e=t.streamTextContent({normalizeWhitespace:!0,includeMarkedContent:!0});s.setTextContentStream(e),s.render()}}))),(function(e){return l(e)}));return this.annotationLayerFactory&&(this.annotationLayer||(this.annotationLayer=this.annotationLayerFactory.createAnnotationLayerBuilder(e,t,null,this.imageResourcesPath,this.renderInteractiveForms,this.l10n,null,null,null)),this._renderAnnotationLayer()),this.xfaLayerFactory&&(this.xfaLayer||(this.xfaLayer=this.xfaLayerFactory.createXfaLayerBuilder(e,t,null)),this._renderXfaLayer()),this.structTreeLayerFactory&&this.textLayer&&this.canvas&&(this._onTextLayerRendered=e=>{e.pageNumber===this.id&&(this.eventBus._off("textlayerrendered",this._onTextLayerRendered),this._onTextLayerRendered=null,this.canvas&&this.pdfPage.getStructTree().then((e=>{if(!e)return;if(!this.canvas)return;const t=this.structTreeLayer.render(e);t.classList.add("structTree"),this.canvas.appendChild(t)})))},this.eventBus._on("textlayerrendered",this._onTextLayerRendered),this.structTreeLayer=this.structTreeLayerFactory.createStructTreeLayerBuilder(t)),e.setAttribute("data-loaded",!0),this.eventBus.dispatch("pagerender",{source:this,pageNumber:this.id}),h}paintOnCanvas(e){const t=(0,i.createPromiseCapability)(),n={promise:t.promise,onRenderContinue(e){e()},cancel(){g.cancel()}},s=this.viewport,a=document.createElement("canvas");a.hidden=!0;let o=!0;const l=function(){o&&(a.hidden=!1,o=!1)};e.appendChild(a),this.canvas=a,a.mozOpaque=!0;const c=a.getContext("2d",{alpha:!1}),h=(0,r.getOutputScale)(c);if(this.outputScale=h,this.useOnlyCssZoom){const e=s.clone({scale:r.CSS_UNITS});h.sx*=e.width/s.width,h.sy*=e.height/s.height,h.scaled=!0}if(this.maxCanvasPixels>0){const e=s.width*s.height,t=Math.sqrt(this.maxCanvasPixels/e);h.sx>t||h.sy>t?(h.sx=t,h.sy=t,h.scaled=!0,this.hasRestrictedScaling=!0):this.hasRestrictedScaling=!1}const u=(0,r.approximateFraction)(h.sx),d=(0,r.approximateFraction)(h.sy);a.width=(0,r.roundToDivide)(s.width*h.sx,u[0]),a.height=(0,r.roundToDivide)(s.height*h.sy,d[0]),a.style.width=(0,r.roundToDivide)(s.width,u[1])+"px",a.style.height=(0,r.roundToDivide)(s.height,d[1])+"px",this.paintedViewportMap.set(a,s);const p={canvasContext:c,transform:h.scaled?[h.sx,0,0,h.sy,0,0]:null,viewport:this.viewport,renderInteractiveForms:this.renderInteractiveForms,optionalContentConfigPromise:this._optionalContentConfigPromise},g=this.pdfPage.render(p);return g.onContinue=function(e){l(),n.onRenderContinue?n.onRenderContinue(e):e()},g.promise.then((function(){l(),t.resolve(void 0)}),(function(e){l(),t.reject(e)})),n}paintOnSvg(e){let t=!1;const n=()=>{if(t)throw new i.RenderingCancelledException(`Rendering cancelled, page ${this.id}`,"svg")},s=this.pdfPage,l=this.viewport.clone({scale:r.CSS_UNITS});return{promise:s.getOperatorList().then((t=>(n(),new i.SVGGraphics(s.commonObjs,s.objs,o.viewerCompatibilityParams.disableCreateObjectURL).getSVG(t,l).then((t=>{n(),this.svg=t,this.paintedViewportMap.set(t,l),t.style.width=e.style.width,t.style.height=e.style.height,this.renderingState=a.RenderingStates.FINISHED,e.appendChild(t)}))))),onRenderContinue(e){e()},cancel(){t=!0}}}setPageLabel(e){this.pageLabel="string"==typeof e?e:null,null!==this.pageLabel?this.div.setAttribute("data-page-label",this.pageLabel):this.div.removeAttribute("data-page-label")}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RenderingStates=t.PDFRenderingQueue=void 0;var r=n(2);const i={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3};t.RenderingStates=i,t.PDFRenderingQueue=class{constructor(){this.pdfViewer=null,this.pdfThumbnailViewer=null,this.onIdle=null,this.highestPriorityPage=null,this.idleTimeout=null,this.printing=!1,this.isThumbnailViewEnabled=!1}setViewer(e){this.pdfViewer=e}setThumbnailViewer(e){this.pdfThumbnailViewer=e}isHighestPriority(e){return this.highestPriorityPage===e.renderingId}renderHighestPriority(e){this.idleTimeout&&(clearTimeout(this.idleTimeout),this.idleTimeout=null),this.pdfViewer.forceRendering(e)||this.pdfThumbnailViewer&&this.isThumbnailViewEnabled&&this.pdfThumbnailViewer.forceRendering()||this.printing||this.onIdle&&(this.idleTimeout=setTimeout(this.onIdle.bind(this),3e4))}getHighestPriority(e,t,n){const r=e.views,i=r.length;if(0===i)return null;for(let e=0;e<i;++e){const t=r[e].view;if(!this.isViewFinished(t))return t}if(n){const n=e.last.id;if(t[n]&&!this.isViewFinished(t[n]))return t[n]}else{const n=e.first.id-2;if(t[n]&&!this.isViewFinished(t[n]))return t[n]}return null}isViewFinished(e){return e.renderingState===i.FINISHED}renderView(e){switch(e.renderingState){case i.FINISHED:return!1;case i.PAUSED:this.highestPriorityPage=e.renderingId,e.resume();break;case i.RUNNING:this.highestPriorityPage=e.renderingId;break;case i.INITIAL:this.highestPriorityPage=e.renderingId,e.draw().finally((()=>{this.renderHighestPriority()})).catch((e=>{e instanceof r.RenderingCancelledException||console.error(`renderView: "${e}"`)}))}return!0}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFScriptingManager=void 0;var r=n(2),i=n(5),s=n(15);t.PDFScriptingManager=class{constructor({eventBus:e,sandboxBundleSrc:t=null,scriptingFactory:n=null,docPropertiesLookup:r=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=e,this._sandboxBundleSrc=t,this._scriptingFactory=n,this._docPropertiesLookup=r,this._scriptingFactory||window.addEventListener("updatefromsandbox",(e=>{this._eventBus.dispatch("updatefromsandbox",{source:window,detail:e.detail})}))}setViewer(e){this._pdfViewer=e}async setDocument(e){if(this._pdfDocument&&await this._destroyScripting(),this._pdfDocument=e,!e)return;const[t,n,r]=await Promise.all([e.getFieldObjects(),e.getCalculationOrderIds(),e.getJSActions()]);if(t||r){if(e===this._pdfDocument){try{this._scripting=this._createScripting()}catch(e){return console.error(`PDFScriptingManager.setDocument: "${e?.message}".`),void await this._destroyScripting()}this._internalEvents.set("updatefromsandbox",(e=>{e?.source===window&&this._updateFromSandbox(e.detail)})),this._internalEvents.set("dispatcheventinsandbox",(e=>{this._scripting?.dispatchEventInSandbox(e.detail)})),this._internalEvents.set("pagechanging",(({pageNumber:e,previous:t})=>{e!==t&&(this._dispatchPageClose(t),this._dispatchPageOpen(e))})),this._internalEvents.set("pagerendered",(({pageNumber:e})=>{this._pageOpenPending.has(e)&&e===this._pdfViewer.currentPageNumber&&this._dispatchPageOpen(e)})),this._internalEvents.set("pagesdestroy",(async e=>{await this._dispatchPageClose(this._pdfViewer.currentPageNumber),await(this._scripting?.dispatchEventInSandbox({id:"doc",name:"WillClose"})),this._closeCapability?.resolve()})),this._domEvents.set("mousedown",(e=>{this._mouseState.isDown=!0})),this._domEvents.set("mouseup",(e=>{this._mouseState.isDown=!1}));for(const[e,t]of this._internalEvents)this._eventBus._on(e,t);for(const[e,t]of this._domEvents)window.addEventListener(e,t);try{const i=await this._getDocProperties();if(e!==this._pdfDocument)return;await this._scripting.createSandbox({objects:t,calculationOrder:n,appInfo:{platform:navigator.platform,language:navigator.language},docInfo:{...i,actions:r}}),this._eventBus.dispatch("sandboxcreated",{source:this})}catch(e){return console.error(`PDFScriptingManager.setDocument: "${e?.message}".`),void await this._destroyScripting()}await(this._scripting?.dispatchEventInSandbox({id:"doc",name:"Open"})),await this._dispatchPageOpen(this._pdfViewer.currentPageNumber,!0),Promise.resolve().then((()=>{e===this._pdfDocument&&(this._ready=!0)}))}}else await this._destroyScripting()}async dispatchWillSave(e){return this._scripting?.dispatchEventInSandbox({id:"doc",name:"WillSave"})}async dispatchDidSave(e){return this._scripting?.dispatchEventInSandbox({id:"doc",name:"DidSave"})}async dispatchWillPrint(e){return this._scripting?.dispatchEventInSandbox({id:"doc",name:"WillPrint"})}async dispatchDidPrint(e){return this._scripting?.dispatchEventInSandbox({id:"doc",name:"DidPrint"})}get mouseState(){return this._mouseState}get destroyPromise(){return this._destroyCapability?.promise||null}get ready(){return this._ready}get _internalEvents(){return(0,r.shadow)(this,"_internalEvents",new Map)}get _domEvents(){return(0,r.shadow)(this,"_domEvents",new Map)}get _pageOpenPending(){return(0,r.shadow)(this,"_pageOpenPending",new Set)}get _visitedPages(){return(0,r.shadow)(this,"_visitedPages",new Map)}async _updateFromSandbox(e){const t=this._pdfViewer.isInPresentationMode||this._pdfViewer.isChangingPresentationMode,{id:n,siblings:r,command:s,value:a}=e;if(!n){switch(s){case"clear":console.clear();break;case"error":console.error(a);break;case"layout":this._pdfViewer.spreadMode=(0,i.apiPageLayoutToSpreadMode)(a);break;case"page-num":this._pdfViewer.currentPageNumber=a+1;break;case"print":await this._pdfViewer.pagesPromise,this._eventBus.dispatch("print",{source:this});break;case"println":console.log(a);break;case"zoom":if(t)return;this._pdfViewer.currentScaleValue=a}return}if(t&&e.focus)return;delete e.id,delete e.siblings;const o=r?[n,...r]:[n];for(const t of o){const n=document.getElementById(t);n?n.dispatchEvent(new CustomEvent("updatefromsandbox",{detail:e})):this._pdfDocument?.annotationStorage.setValue(t,e)}}async _dispatchPageOpen(e,t=!1){const n=this._pdfDocument,i=this._visitedPages;if(t&&(this._closeCapability=(0,r.createPromiseCapability)()),!this._closeCapability)return;const a=this._pdfViewer.getPageView(e-1);if(a?.renderingState!==s.RenderingStates.FINISHED)return void this._pageOpenPending.add(e);this._pageOpenPending.delete(e);const o=(async()=>{const t=await(i.has(e)?null:a.pdfPage?.getJSActions());n===this._pdfDocument&&await(this._scripting?.dispatchEventInSandbox({id:"page",name:"PageOpen",pageNumber:e,actions:t}))})();i.set(e,o)}async _dispatchPageClose(e){const t=this._pdfDocument,n=this._visitedPages;if(!this._closeCapability)return;if(this._pageOpenPending.has(e))return;const r=n.get(e);r&&(n.set(e,null),await r,t===this._pdfDocument&&await(this._scripting?.dispatchEventInSandbox({id:"page",name:"PageClose",pageNumber:e})))}async _getDocProperties(){if(this._docPropertiesLookup)return this._docPropertiesLookup(this._pdfDocument);const{docPropertiesLookup:e}=n(17);return e(this._pdfDocument)}_createScripting(){if(this._destroyCapability=(0,r.createPromiseCapability)(),this._scripting)throw new Error("_createScripting: Scripting already exists.");if(this._scriptingFactory)return this._scriptingFactory.createScripting({sandboxBundleSrc:this._sandboxBundleSrc});const{GenericScripting:e}=n(17);return new e(this._sandboxBundleSrc)}async _destroyScripting(){if(!this._scripting)return this._pdfDocument=null,void this._destroyCapability?.resolve();this._closeCapability&&(await Promise.race([this._closeCapability.promise,new Promise((e=>{setTimeout(e,1e3)}))]).catch((e=>{})),this._closeCapability=null),this._pdfDocument=null;try{await this._scripting.destroySandbox()}catch(e){}for(const[e,t]of this._internalEvents)this._eventBus._off(e,t);this._internalEvents.clear();for(const[e,t]of this._domEvents)window.removeEventListener(e,t);this._domEvents.clear(),this._pageOpenPending.clear(),this._visitedPages.clear(),this._scripting=null,delete this._mouseState.isDown,this._ready=!1,this._destroyCapability?.resolve()}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.docPropertiesLookup=async function(e){const t="".split("#")[0];let{info:n,metadata:i,contentDispositionFilename:s,contentLength:a}=await e.getMetadata();if(!a){const{length:t}=await e.getDownloadInfo();a=t}return{...n,baseURL:t,filesize:a,filename:s||(0,r.getPdfFilenameFromUrl)(""),metadata:i?.getRaw(),authors:i?.get("dc:creator"),numPages:e.numPages,URL:""}},t.GenericScripting=void 0;var r=n(2);t.GenericScripting=class{constructor(e){this._ready=(0,r.loadScript)(e,!0).then((()=>window.pdfjsSandbox.QuickJSSandbox()))}async createSandbox(e){(await this._ready).create(e)}async dispatchEventInSandbox(e){(await this._ready).dispatchEvent(e)}async destroySandbox(){(await this._ready).nukeSandbox()}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFSinglePageViewer=void 0;var r=n(19),i=n(2);class s extends r.BaseViewer{constructor(e){super(e),this.eventBus._on("pagesinit",(e=>{this._ensurePageViewVisible()}))}get _viewerElement(){return(0,i.shadow)(this,"_viewerElement",this._shadowViewer)}get _pageWidthScaleFactor(){return 1}_resetView(){super._resetView(),this._previousPageNumber=1,this._shadowViewer=document.createDocumentFragment(),this._updateScrollDown=null}_ensurePageViewVisible(){const e=this._pages[this._currentPageNumber-1],t=this._pages[this._previousPageNumber-1],n=this.viewer.childNodes;switch(n.length){case 0:this.viewer.appendChild(e.div);break;case 1:if(n[0]!==t.div)throw new Error("_ensurePageViewVisible: Unexpected previously visible page.");if(e===t)break;this._shadowViewer.appendChild(t.div),this.viewer.appendChild(e.div),this.container.scrollTop=0;break;default:throw new Error("_ensurePageViewVisible: Only one page should be visible at a time.")}this._previousPageNumber=this._currentPageNumber}_scrollUpdate(){this._updateScrollDown&&this._updateScrollDown(),super._scrollUpdate()}_scrollIntoView({pageDiv:e,pageSpot:t=null,pageNumber:n=null}){n&&this._setCurrentPageNumber(n);const r=this._currentPageNumber>=this._previousPageNumber;this._ensurePageViewVisible(),this.update(),super._scrollIntoView({pageDiv:e,pageSpot:t,pageNumber:n}),this._updateScrollDown=()=>{this.scroll.down=r,this._updateScrollDown=null}}_getVisiblePages(){return this._getCurrentVisiblePage()}_updateHelper(e){}get _isScrollModeHorizontal(){return(0,i.shadow)(this,"_isScrollModeHorizontal",!1)}_updateScrollMode(){}_updateSpreadMode(){}_getPageAdvance(){return 1}}t.PDFSinglePageViewer=s},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseViewer=void 0;var r=n(2),i=n(5),s=n(15),a=n(1),o=n(3),l=n(14),c=n(4),h=n(20),u=n(6),d=n(21);function p(e){const t=[];this.push=function(n){const r=t.indexOf(n);r>=0&&t.splice(r,1),t.push(n),t.length>e&&t.shift().destroy()},this.resize=function(n,r){if(e=n,r){const e=new Set;for(let t=0,n=r.length;t<n;++t)e.add(r[t].id);(0,i.moveToEndOfArray)(t,(function(t){return e.has(t.id)}))}for(;t.length>e;)t.shift().destroy()},this.has=function(e){return t.includes(e)}}class g{constructor(e){if(this.constructor===g)throw new Error("Cannot initialize BaseViewer.");if("2.10.377"!==r.version)throw new Error(`The API version "${r.version}" does not match the Viewer version "2.10.377".`);if(this._name=this.constructor.name,this.container=e.container,this.viewer=e.viewer||e.container.firstElementChild,"DIV"!==this.container?.tagName.toUpperCase()||"DIV"!==this.viewer?.tagName.toUpperCase())throw new Error("Invalid `container` and/or `viewer` option.");if(this.container.offsetParent&&"absolute"!==getComputedStyle(this.container).position)throw new Error("The `container` must be absolutely positioned.");this.eventBus=e.eventBus,this.linkService=e.linkService||new c.SimpleLinkService,this.downloadManager=e.downloadManager||null,this.findController=e.findController||null,this._scriptingManager=e.scriptingManager||null,this.removePageBorders=e.removePageBorders||!1,this.textLayerMode=Number.isInteger(e.textLayerMode)?e.textLayerMode:i.TextLayerMode.ENABLE,this.imageResourcesPath=e.imageResourcesPath||"",this.renderInteractiveForms=!1!==e.renderInteractiveForms,this.enablePrintAutoRotate=e.enablePrintAutoRotate||!1,this.renderer=e.renderer||i.RendererType.CANVAS,this.useOnlyCssZoom=e.useOnlyCssZoom||!1,this.maxCanvasPixels=e.maxCanvasPixels,this.l10n=e.l10n||o.NullL10n,this.enableScripting=!0===e.enableScripting&&!!this._scriptingManager,this.defaultRenderingQueue=!e.renderingQueue,this.defaultRenderingQueue?(this.renderingQueue=new s.PDFRenderingQueue,this.renderingQueue.setViewer(this)):this.renderingQueue=e.renderingQueue,this.scroll=(0,i.watchScroll)(this.container,this._scrollUpdate.bind(this)),this.presentationModeState=i.PresentationModeState.UNKNOWN,this._onBeforeDraw=this._onAfterDraw=null,this._resetView(),this.removePageBorders&&this.viewer.classList.add("removePageBorders"),Promise.resolve().then((()=>{this.eventBus.dispatch("baseviewerinit",{source:this})}))}get pagesCount(){return this._pages.length}getPageView(e){return this._pages[e]}get pageViewsReady(){return!!this._pagesCapability.settled&&this._pages.every((function(e){return e?.pdfPage}))}get currentPageNumber(){return this._currentPageNumber}set currentPageNumber(e){if(!Number.isInteger(e))throw new Error("Invalid page number.");this.pdfDocument&&(this._setCurrentPageNumber(e,!0)||console.error(`${this._name}.currentPageNumber: "${e}" is not a valid page.`))}_setCurrentPageNumber(e,t=!1){if(this._currentPageNumber===e)return t&&this._resetCurrentPageView(),!0;if(!(0<e&&e<=this.pagesCount))return!1;const n=this._currentPageNumber;return this._currentPageNumber=e,this.eventBus.dispatch("pagechanging",{source:this,pageNumber:e,pageLabel:this._pageLabels?.[e-1]??null,previous:n}),t&&this._resetCurrentPageView(),!0}get currentPageLabel(){return this._pageLabels?.[this._currentPageNumber-1]??null}set currentPageLabel(e){if(!this.pdfDocument)return;let t=0|e;if(this._pageLabels){const n=this._pageLabels.indexOf(e);n>=0&&(t=n+1)}this._setCurrentPageNumber(t,!0)||console.error(`${this._name}.currentPageLabel: "${e}" is not a valid page.`)}get currentScale(){return this._currentScale!==i.UNKNOWN_SCALE?this._currentScale:i.DEFAULT_SCALE}set currentScale(e){if(isNaN(e))throw new Error("Invalid numeric scale.");this.pdfDocument&&this._setScale(e,!1)}get currentScaleValue(){return this._currentScaleValue}set currentScaleValue(e){this.pdfDocument&&this._setScale(e,!1)}get pagesRotation(){return this._pagesRotation}set pagesRotation(e){if(!(0,i.isValidRotation)(e))throw new Error("Invalid pages rotation angle.");if(!this.pdfDocument)return;if((e%=360)<0&&(e+=360),this._pagesRotation===e)return;this._pagesRotation=e;const t=this._currentPageNumber;for(let t=0,n=this._pages.length;t<n;t++){const n=this._pages[t];n.update(n.scale,e)}this._currentScaleValue&&this._setScale(this._currentScaleValue,!0),this.eventBus.dispatch("rotationchanging",{source:this,pagesRotation:e,pageNumber:t}),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}get _viewerElement(){throw new Error("Not implemented: _viewerElement")}_onePageRenderedOrForceFetch(){return this.container.offsetParent&&0!==this._getVisiblePages().views.length?this._onePageRenderedCapability.promise:Promise.resolve()}setDocument(e){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=e,!e)return;const t=e.isPureXfa,n=e.numPages,r=e.getPage(1),s=e.getOptionalContentConfig();this._pagesCapability.promise.then((()=>{this.eventBus.dispatch("pagesloaded",{source:this,pagesCount:n})})),this._onBeforeDraw=e=>{const t=this._pages[e.pageNumber-1];t&&this._buffer.push(t)},this.eventBus._on("pagerender",this._onBeforeDraw),this._onAfterDraw=e=>{e.cssTransform||this._onePageRenderedCapability.settled||(this._onePageRenderedCapability.resolve(),this.eventBus._off("pagerendered",this._onAfterDraw),this._onAfterDraw=null)},this.eventBus._on("pagerendered",this._onAfterDraw),r.then((r=>{this._firstPageCapability.resolve(r),this._optionalContentConfigPromise=s;const a=this.currentScale,o=r.getViewport({scale:a*i.CSS_UNITS}),c=this.textLayerMode!==i.TextLayerMode.DISABLE?this:null,h=t?this:null;for(let e=1;e<=n;++e){const t=new l.PDFPageView({container:this._viewerElement,eventBus:this.eventBus,id:e,scale:a,defaultViewport:o.clone(),optionalContentConfigPromise:s,renderingQueue:this.renderingQueue,textLayerFactory:c,textLayerMode:this.textLayerMode,annotationLayerFactory:this,xfaLayerFactory:h,structTreeLayerFactory:this,imageResourcesPath:this.imageResourcesPath,renderInteractiveForms:this.renderInteractiveForms,renderer:this.renderer,useOnlyCssZoom:this.useOnlyCssZoom,maxCanvasPixels:this.maxCanvasPixels,l10n:this.l10n});this._pages.push(t)}const u=this._pages[0];u&&(u.setPdfPage(r),this.linkService.cachePageRef(1,r.ref)),this._spreadMode!==i.SpreadMode.NONE&&this._updateSpreadMode(),this._onePageRenderedOrForceFetch().then((()=>{if(this.findController&&this.findController.setDocument(e),this.enableScripting&&this._scriptingManager.setDocument(e),e.loadingParams.disableAutoFetch||n>7500)return void this._pagesCapability.resolve();let t=n-1;if(t<=0)this._pagesCapability.resolve();else for(let r=2;r<=n;++r)e.getPage(r).then((e=>{const n=this._pages[r-1];n.pdfPage||n.setPdfPage(e),this.linkService.cachePageRef(r,e.ref),0==--t&&this._pagesCapability.resolve()}),(e=>{console.error(`Unable to get page ${r} to initialize viewer`,e),0==--t&&this._pagesCapability.resolve()}))})),this.eventBus.dispatch("pagesinit",{source:this}),this.defaultRenderingQueue&&this.update()})).catch((e=>{console.error("Unable to initialize viewer",e)}))}setPageLabels(e){if(this.pdfDocument){e?Array.isArray(e)&&this.pdfDocument.numPages===e.length?this._pageLabels=e:(this._pageLabels=null,console.error(`${this._name}.setPageLabels: Invalid page labels.`)):this._pageLabels=null;for(let e=0,t=this._pages.length;e<t;e++)this._pages[e].setPageLabel(this._pageLabels?.[e]??null)}}_resetView(){this._pages=[],this._currentPageNumber=1,this._currentScale=i.UNKNOWN_SCALE,this._currentScaleValue=null,this._pageLabels=null,this._buffer=new p(10),this._location=null,this._pagesRotation=0,this._optionalContentConfigPromise=null,this._pagesRequests=new WeakMap,this._firstPageCapability=(0,r.createPromiseCapability)(),this._onePageRenderedCapability=(0,r.createPromiseCapability)(),this._pagesCapability=(0,r.createPromiseCapability)(),this._scrollMode=i.ScrollMode.VERTICAL,this._spreadMode=i.SpreadMode.NONE,this._onBeforeDraw&&(this.eventBus._off("pagerender",this._onBeforeDraw),this._onBeforeDraw=null),this._onAfterDraw&&(this.eventBus._off("pagerendered",this._onAfterDraw),this._onAfterDraw=null),this.viewer.textContent="",this._updateScrollMode()}_scrollUpdate(){0!==this.pagesCount&&this.update()}_scrollIntoView({pageDiv:e,pageSpot:t=null,pageNumber:n=null}){(0,i.scrollIntoView)(e,t)}_setScaleUpdatePages(e,t,n=!1,r=!1){if(this._currentScaleValue=t.toString(),function(e,t){return t===e||Math.abs(t-e)<1e-15}(this._currentScale,e))r&&this.eventBus.dispatch("scalechanging",{source:this,scale:e,presetValue:t});else{for(let t=0,n=this._pages.length;t<n;t++)this._pages[t].update(e);if(this._currentScale=e,!n){let e,t=this._currentPageNumber;!this._location||this.isInPresentationMode||this.isChangingPresentationMode||(t=this._location.pageNumber,e=[null,{name:"XYZ"},this._location.left,this._location.top,null]),this.scrollPageIntoView({pageNumber:t,destArray:e,allowNegativeOffset:!0})}this.eventBus.dispatch("scalechanging",{source:this,scale:e,presetValue:r?t:void 0}),this.defaultRenderingQueue&&this.update()}}get _pageWidthScaleFactor(){return this._spreadMode===i.SpreadMode.NONE||this._scrollMode===i.ScrollMode.HORIZONTAL||this.isInPresentationMode?1:2}_setScale(e,t=!1){let n=parseFloat(e);if(n>0)this._setScaleUpdatePages(n,e,t,!1);else{const r=this._pages[this._currentPageNumber-1];if(!r)return;const s=this.isInPresentationMode||this.removePageBorders;let a=s?0:i.SCROLLBAR_PADDING,o=s?0:i.VERTICAL_PADDING;!s&&this._isScrollModeHorizontal&&([a,o]=[o,a]);const l=(this.container.clientWidth-a)/r.width*r.scale/this._pageWidthScaleFactor,c=(this.container.clientHeight-o)/r.height*r.scale;switch(e){case"page-actual":n=1;break;case"page-width":n=l;break;case"page-height":n=c;break;case"page-fit":n=Math.min(l,c);break;case"auto":const t=(0,i.isPortraitOrientation)(r)?l:Math.min(c,l);n=Math.min(i.MAX_AUTO_SCALE,t);break;default:return void console.error(`${this._name}._setScale: "${e}" is an unknown zoom value.`)}this._setScaleUpdatePages(n,e,t,!0)}}_resetCurrentPageView(){this.isInPresentationMode&&this._setScale(this._currentScaleValue,!0);const e=this._pages[this._currentPageNumber-1];this._scrollIntoView({pageDiv:e.div})}pageLabelToPageNumber(e){if(!this._pageLabels)return null;const t=this._pageLabels.indexOf(e);return t<0?null:t+1}scrollPageIntoView({pageNumber:e,destArray:t=null,allowNegativeOffset:n=!1,ignoreDestinationZoom:r=!1}){if(!this.pdfDocument)return;const s=Number.isInteger(e)&&this._pages[e-1];if(!s)return void console.error(`${this._name}.scrollPageIntoView: "${e}" is not a valid pageNumber parameter.`);if(this.isInPresentationMode||!t)return void this._setCurrentPageNumber(e,!0);let a,o,l=0,c=0,h=0,u=0;const d=s.rotation%180!=0,p=(d?s.height:s.width)/s.scale/i.CSS_UNITS,g=(d?s.width:s.height)/s.scale/i.CSS_UNITS;let f=0;switch(t[1].name){case"XYZ":l=t[2],c=t[3],f=t[4],l=null!==l?l:0,c=null!==c?c:g;break;case"Fit":case"FitB":f="page-fit";break;case"FitH":case"FitBH":c=t[2],f="page-width",null===c&&this._location?(l=this._location.left,c=this._location.top):"number"!=typeof c&&(c=g);break;case"FitV":case"FitBV":l=t[2],h=p,u=g,f="page-height";break;case"FitR":l=t[2],c=t[3],h=t[4]-l,u=t[5]-c;const e=this.removePageBorders?0:i.SCROLLBAR_PADDING,n=this.removePageBorders?0:i.VERTICAL_PADDING;a=(this.container.clientWidth-e)/h/i.CSS_UNITS,o=(this.container.clientHeight-n)/u/i.CSS_UNITS,f=Math.min(Math.abs(a),Math.abs(o));break;default:return void console.error(`${this._name}.scrollPageIntoView: "${t[1].name}" is not a valid destination type.`)}if(r||(f&&f!==this._currentScale?this.currentScaleValue=f:this._currentScale===i.UNKNOWN_SCALE&&(this.currentScaleValue=i.DEFAULT_SCALE_VALUE)),"page-fit"===f&&!t[4])return void this._scrollIntoView({pageDiv:s.div,pageNumber:e});const m=[s.viewport.convertToViewportPoint(l,c),s.viewport.convertToViewportPoint(l+h,c+u)];let _=Math.min(m[0][0],m[1][0]),b=Math.min(m[0][1],m[1][1]);n||(_=Math.max(_,0),b=Math.max(b,0)),this._scrollIntoView({pageDiv:s.div,pageSpot:{left:_,top:b},pageNumber:e})}_updateLocation(e){const t=this._currentScale,n=this._currentScaleValue,r=parseFloat(n)===t?Math.round(1e4*t)/100:n,i=e.id;let s="#page="+i;s+="&zoom="+r;const a=this._pages[i-1],o=this.container,l=a.getPagePoint(o.scrollLeft-e.x,o.scrollTop-e.y),c=Math.round(l[0]),h=Math.round(l[1]);s+=","+c+","+h,this._location={pageNumber:i,scale:r,top:h,left:c,rotation:this._pagesRotation,pdfOpenParams:s}}_updateHelper(e){throw new Error("Not implemented: _updateHelper")}update(){const e=this._getVisiblePages(),t=e.views,n=t.length;if(0===n)return;const r=Math.max(10,2*n+1);this._buffer.resize(r,t),this.renderingQueue.renderHighestPriority(e),this._updateHelper(t),this._updateLocation(e.first),this.eventBus.dispatch("updateviewarea",{source:this,location:this._location})}containsElement(e){return this.container.contains(e)}focus(){this.container.focus()}get _isScrollModeHorizontal(){return!this.isInPresentationMode&&this._scrollMode===i.ScrollMode.HORIZONTAL}get _isContainerRtl(){return"rtl"===getComputedStyle(this.container).direction}get isInPresentationMode(){return this.presentationModeState===i.PresentationModeState.FULLSCREEN}get isChangingPresentationMode(){return this.presentationModeState===i.PresentationModeState.CHANGING}get isHorizontalScrollbarEnabled(){return!this.isInPresentationMode&&this.container.scrollWidth>this.container.clientWidth}get isVerticalScrollbarEnabled(){return!this.isInPresentationMode&&this.container.scrollHeight>this.container.clientHeight}_getCurrentVisiblePage(){if(!this.pagesCount)return{views:[]};const e=this._pages[this._currentPageNumber-1],t=e.div,n={id:e.id,x:t.offsetLeft+t.clientLeft,y:t.offsetTop+t.clientTop,view:e};return{first:n,last:n,views:[n]}}_getVisiblePages(){return(0,i.getVisibleElements)({scrollEl:this.container,views:this._pages,sortByVisibility:!0,horizontal:this._isScrollModeHorizontal,rtl:this._isScrollModeHorizontal&&this._isContainerRtl})}isPageVisible(e){return!!this.pdfDocument&&(Number.isInteger(e)&&e>0&&e<=this.pagesCount?this._getVisiblePages().views.some((function(t){return t.id===e})):(console.error(`${this._name}.isPageVisible: "${e}" is not a valid page.`),!1))}isPageCached(e){if(!this.pdfDocument||!this._buffer)return!1;if(!(Number.isInteger(e)&&e>0&&e<=this.pagesCount))return console.error(`${this._name}.isPageCached: "${e}" is not a valid page.`),!1;const t=this._pages[e-1];return!!t&&this._buffer.has(t)}cleanup(){for(let e=0,t=this._pages.length;e<t;e++)this._pages[e]&&this._pages[e].renderingState!==s.RenderingStates.FINISHED&&this._pages[e].reset()}_cancelRendering(){for(let e=0,t=this._pages.length;e<t;e++)this._pages[e]&&this._pages[e].cancelRendering()}_ensurePdfPageLoaded(e){if(e.pdfPage)return Promise.resolve(e.pdfPage);if(this._pagesRequests.has(e))return this._pagesRequests.get(e);const t=this.pdfDocument.getPage(e.id).then((t=>(e.pdfPage||e.setPdfPage(t),this._pagesRequests.delete(e),t))).catch((t=>{console.error("Unable to get page for page view",t),this._pagesRequests.delete(e)}));return this._pagesRequests.set(e,t),t}forceRendering(e){const t=e||this._getVisiblePages(),n=this._isScrollModeHorizontal?this.scroll.right:this.scroll.down,r=this.renderingQueue.getHighestPriority(t,this._pages,n);return!!r&&(this._ensurePdfPageLoaded(r).then((()=>{this.renderingQueue.renderView(r)})),!0)}createTextLayerBuilder(e,t,n,r=!1,i){return new u.TextLayerBuilder({textLayerDiv:e,eventBus:i,pageIndex:t,viewport:n,findController:this.isInPresentationMode?null:this.findController,enhanceTextSelection:!this.isInPresentationMode&&r})}createAnnotationLayerBuilder(e,t,n=null,r="",i=!1,s=o.NullL10n,l=null,c=null,h=null){return new a.AnnotationLayerBuilder({pageDiv:e,pdfPage:t,annotationStorage:n||this.pdfDocument?.annotationStorage,imageResourcesPath:r,renderInteractiveForms:i,linkService:this.linkService,downloadManager:this.downloadManager,l10n:s,enableScripting:l??this.enableScripting,hasJSActionsPromise:c||this.pdfDocument?.hasJSActions(),mouseState:h||this._scriptingManager?.mouseState})}createXfaLayerBuilder(e,t,n=null){return new d.XfaLayerBuilder({pageDiv:e,pdfPage:t,annotationStorage:n||this.pdfDocument?.annotationStorage})}createStructTreeLayerBuilder(e){return new h.StructTreeLayerBuilder({pdfPage:e})}get hasEqualPageSizes(){const e=this._pages[0];for(let t=1,n=this._pages.length;t<n;++t){const n=this._pages[t];if(n.width!==e.width||n.height!==e.height)return!1}return!0}getPagesOverview(){return this._pages.map((e=>{const t=e.pdfPage.getViewport({scale:1});return!this.enablePrintAutoRotate||(0,i.isPortraitOrientation)(t)?{width:t.width,height:t.height,rotation:t.rotation}:{width:t.height,height:t.width,rotation:(t.rotation-90)%360}}))}get optionalContentConfigPromise(){return this.pdfDocument?this._optionalContentConfigPromise?this._optionalContentConfigPromise:this.pdfDocument.getOptionalContentConfig():Promise.resolve(null)}set optionalContentConfigPromise(e){if(!(e instanceof Promise))throw new Error(`Invalid optionalContentConfigPromise: ${e}`);if(this.pdfDocument&&this._optionalContentConfigPromise){this._optionalContentConfigPromise=e;for(const t of this._pages)t.update(t.scale,t.rotation,e);this.update(),this.eventBus.dispatch("optionalcontentconfigchanged",{source:this,promise:e})}}get scrollMode(){return this._scrollMode}set scrollMode(e){if(this._scrollMode!==e){if(!(0,i.isValidScrollMode)(e))throw new Error(`Invalid scroll mode: ${e}`);this._scrollMode=e,this.eventBus.dispatch("scrollmodechanged",{source:this,mode:e}),this._updateScrollMode(this._currentPageNumber)}}_updateScrollMode(e=null){const t=this._scrollMode,n=this.viewer;n.classList.toggle("scrollHorizontal",t===i.ScrollMode.HORIZONTAL),n.classList.toggle("scrollWrapped",t===i.ScrollMode.WRAPPED),this.pdfDocument&&e&&(this._currentScaleValue&&isNaN(this._currentScaleValue)&&this._setScale(this._currentScaleValue,!0),this._setCurrentPageNumber(e,!0),this.update())}get spreadMode(){return this._spreadMode}set spreadMode(e){if(this._spreadMode!==e){if(!(0,i.isValidSpreadMode)(e))throw new Error(`Invalid spread mode: ${e}`);this._spreadMode=e,this.eventBus.dispatch("spreadmodechanged",{source:this,mode:e}),this._updateSpreadMode(this._currentPageNumber)}}_updateSpreadMode(e=null){if(!this.pdfDocument)return;const t=this.viewer,n=this._pages;if(t.textContent="",this._spreadMode===i.SpreadMode.NONE)for(let e=0,r=n.length;e<r;++e)t.appendChild(n[e].div);else{const e=this._spreadMode-1;let r=null;for(let i=0,s=n.length;i<s;++i)null===r?(r=document.createElement("div"),r.className="spread",t.appendChild(r)):i%2===e&&(r=r.cloneNode(!1),t.appendChild(r)),r.appendChild(n[i].div)}e&&(this._currentScaleValue&&isNaN(this._currentScaleValue)&&this._setScale(this._currentScaleValue,!0),this._setCurrentPageNumber(e,!0),this.update())}_getPageAdvance(e,t=!1){if(this.isInPresentationMode)return 1;switch(this._scrollMode){case i.ScrollMode.WRAPPED:{const{views:n}=this._getVisiblePages(),r=new Map;for(const{id:e,y:t,percent:i,widthPercent:s}of n){if(0===i||s<100)continue;let n=r.get(t);n||r.set(t,n||(n=[])),n.push(e)}for(const n of r.values()){const r=n.indexOf(e);if(-1===r)continue;const i=n.length;if(1===i)break;if(t)for(let t=r-1,i=0;t>=i;t--){const r=n[t],i=n[t+1]-1;if(r<i)return e-i}else for(let t=r+1,s=i;t<s;t++){const r=n[t],i=n[t-1]+1;if(r>i)return i-e}if(t){const t=n[0];if(t<e)return e-t+1}else{const t=n[i-1];if(t>e)return t-e+1}break}break}case i.ScrollMode.HORIZONTAL:break;case i.ScrollMode.VERTICAL:{if(this._spreadMode===i.SpreadMode.NONE)break;const n=this._spreadMode-1;if(t&&e%2!==n)break;if(!t&&e%2===n)break;const{views:r}=this._getVisiblePages(),s=t?e-1:e+1;for(const{id:e,percent:t,widthPercent:n}of r)if(e===s){if(t>0&&100===n)return 2;break}break}}return 1}nextPage(){const e=this._currentPageNumber,t=this.pagesCount;if(e>=t)return!1;const n=this._getPageAdvance(e,!1)||1;return this.currentPageNumber=Math.min(e+n,t),!0}previousPage(){const e=this._currentPageNumber;if(e<=1)return!1;const t=this._getPageAdvance(e,!0)||1;return this.currentPageNumber=Math.max(e-t,1),!0}}t.BaseViewer=g},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StructTreeLayerBuilder=t.DefaultStructTreeLayerFactory=void 0;const n={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},r=/^H(\d+)$/;class i{constructor({pdfPage:e}){this.pdfPage=e}render(e){return this._walk(e)}_setAttributes(e,t){void 0!==e.alt&&t.setAttribute("aria-label",e.alt),void 0!==e.id&&t.setAttribute("aria-owns",e.id)}_walk(e){if(!e)return null;const t=document.createElement("span");if("role"in e){const{role:i}=e,s=i.match(r);s?(t.setAttribute("role","heading"),t.setAttribute("aria-level",s[1])):n[i]&&t.setAttribute("role",n[i])}if(this._setAttributes(e,t),e.children)if(1===e.children.length&&"id"in e.children[0])this._setAttributes(e.children[0],t);else for(const n of e.children)t.appendChild(this._walk(n));return t}}t.StructTreeLayerBuilder=i,t.DefaultStructTreeLayerFactory=class{createStructTreeLayerBuilder(e){return new i({pdfPage:e})}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.XfaLayerBuilder=t.DefaultXfaLayerFactory=void 0;var r=n(2);class i{constructor({pageDiv:e,pdfPage:t,xfaHtml:n,annotationStorage:r}){this.pageDiv=e,this.pdfPage=t,this.xfaHtml=n,this.annotationStorage=r,this.div=null,this._cancelled=!1}render(e,t="display"){if("print"===t){const n={viewport:e.clone({dontFlip:!0}),div:this.div,xfa:this.xfaHtml,page:null,annotationStorage:this.annotationStorage,intent:t},i=document.createElement("div");return this.pageDiv.appendChild(i),n.div=i,r.XfaLayer.render(n),Promise.resolve()}return this.pdfPage.getXfa().then((n=>{if(this._cancelled)return;const i={viewport:e.clone({dontFlip:!0}),div:this.div,xfa:n,page:this.pdfPage,annotationStorage:this.annotationStorage,intent:t};this.div?r.XfaLayer.update(i):(this.div=document.createElement("div"),this.pageDiv.appendChild(this.div),i.div=this.div,r.XfaLayer.render(i))})).catch((e=>{console.error(e)}))}cancel(){this._cancelled=!0}hide(){this.div&&(this.div.hidden=!0)}}t.XfaLayerBuilder=i,t.DefaultXfaLayerFactory=class{createXfaLayerBuilder(e,t,n=null,r=null){return new i({pageDiv:e,pdfPage:t,annotationStorage:n,xfaHtml:r})}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFViewer=void 0;var r=n(5),i=n(19),s=n(2);class a extends i.BaseViewer{get _viewerElement(){return(0,s.shadow)(this,"_viewerElement",this.viewer)}_scrollIntoView({pageDiv:e,pageSpot:t=null,pageNumber:n=null}){if(!t&&!this.isInPresentationMode){const n=e.offsetLeft+e.clientLeft,r=n+e.clientWidth,{scrollLeft:i,clientWidth:s}=this.container;(this._isScrollModeHorizontal||n<i||r>i+s)&&(t={left:0,top:0})}super._scrollIntoView({pageDiv:e,pageSpot:t,pageNumber:n})}_getVisiblePages(){return this.isInPresentationMode?this._getCurrentVisiblePage():super._getVisiblePages()}_updateHelper(e){if(this.isInPresentationMode)return;let t=this._currentPageNumber,n=!1;for(const i of e){if(i.percent<100)break;if(i.id===t&&this._scrollMode===r.ScrollMode.VERTICAL&&this._spreadMode===r.SpreadMode.NONE){n=!0;break}}n||(t=e[0].id),this._setCurrentPageNumber(t)}}t.PDFViewer=a}],t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}var i={};return(()=>{var e=i;Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"AnnotationLayerBuilder",{enumerable:!0,get:function(){return t.AnnotationLayerBuilder}}),Object.defineProperty(e,"DefaultAnnotationLayerFactory",{enumerable:!0,get:function(){return t.DefaultAnnotationLayerFactory}}),Object.defineProperty(e,"DefaultTextLayerFactory",{enumerable:!0,get:function(){return n.DefaultTextLayerFactory}}),Object.defineProperty(e,"TextLayerBuilder",{enumerable:!0,get:function(){return n.TextLayerBuilder}}),Object.defineProperty(e,"EventBus",{enumerable:!0,get:function(){return s.EventBus}}),Object.defineProperty(e,"ProgressBar",{enumerable:!0,get:function(){return s.ProgressBar}}),Object.defineProperty(e,"PDFLinkService",{enumerable:!0,get:function(){return a.PDFLinkService}}),Object.defineProperty(e,"SimpleLinkService",{enumerable:!0,get:function(){return a.SimpleLinkService}}),Object.defineProperty(e,"DownloadManager",{enumerable:!0,get:function(){return o.DownloadManager}}),Object.defineProperty(e,"GenericL10n",{enumerable:!0,get:function(){return l.GenericL10n}}),Object.defineProperty(e,"NullL10n",{enumerable:!0,get:function(){return c.NullL10n}}),Object.defineProperty(e,"PDFFindController",{enumerable:!0,get:function(){return h.PDFFindController}}),Object.defineProperty(e,"PDFHistory",{enumerable:!0,get:function(){return u.PDFHistory}}),Object.defineProperty(e,"PDFPageView",{enumerable:!0,get:function(){return d.PDFPageView}}),Object.defineProperty(e,"PDFScriptingManager",{enumerable:!0,get:function(){return p.PDFScriptingManager}}),Object.defineProperty(e,"PDFSinglePageViewer",{enumerable:!0,get:function(){return g.PDFSinglePageViewer}}),Object.defineProperty(e,"PDFViewer",{enumerable:!0,get:function(){return f.PDFViewer}});var t=r(1),n=r(6),s=r(5),a=r(4),o=r(7),l=r(9),c=r(3),h=r(11),u=r(13),d=r(14),p=r(16),g=r(18),f=r(22)})(),i})()},e.exports=r()},821:(e,t,n)=>{var r;void 0===(r=function(){var e="xPYMx",t={},n=function(e){var t=document.createEvent("Event");t.initEvent("pym:"+e,!0,!0),document.dispatchEvent(t)},r=function(e){var t=new RegExp("[\\?&]"+e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]")+"=([^&#]*)").exec(location.search);return null===t?"":decodeURIComponent(t[1].replace(/\+/g," "))},i=function(e,t){if(("*"===t.xdomain||e.origin.match(new RegExp(t.xdomain+"$")))&&"string"==typeof e.data)return!0},s=function(t,n,r){return["pym",t,n,r].join(e)},a=Date.now||function(){return(new Date).getTime()},o=function(){for(var e=t.autoInitInstances.length-1;e>=0;e--){var n=t.autoInitInstances[e];n.el.getElementsByTagName("iframe").length&&n.el.getElementsByTagName("iframe")[0].contentWindow||t.autoInitInstances.splice(e,1)}};return t.autoInitInstances=[],t.autoInit=function(e){var r=document.querySelectorAll("[data-pym-src]:not([data-pym-auto-initialized])"),i=r.length;o();for(var s=0;s<i;++s){var a=r[s];a.setAttribute("data-pym-auto-initialized",""),""===a.id&&(a.id="pym-"+s+"-"+Math.random().toString(36).substr(2,5));var l=a.getAttribute("data-pym-src"),c={xdomain:"string",title:"string",name:"string",id:"string",sandbox:"string",allowfullscreen:"boolean",parenturlparam:"string",parenturlvalue:"string",optionalparams:"boolean",trackscroll:"boolean",scrollwait:"number"},h={};for(var u in c)if(null!==a.getAttribute("data-pym-"+u))switch(c[u]){case"boolean":h[u]=!("false"===a.getAttribute("data-pym-"+u));break;case"string":h[u]=a.getAttribute("data-pym-"+u);break;case"number":var d=Number(a.getAttribute("data-pym-"+u));isNaN(d)||(h[u]=d);break;default:console.err("unrecognized attribute type")}var p=new t.Parent(a.id,l,h);t.autoInitInstances.push(p)}return e||n("pym-initialized"),t.autoInitInstances},t.Parent=function(t,n,r){for(var l in this.id=t,this.url=n,this.el=document.getElementById(t),this.iframe=null,this.settings={xdomain:"*",optionalparams:!0,parenturlparam:"parentUrl",parenturlvalue:window.location.href,trackscroll:!1,scrollwait:100},this.messageRegex=function(t){return new RegExp("^"+["pym",t,"(\\S+)","(.*)"].join(e)+"$")}(this.id),this.messageHandlers={},r=r||{},this._constructIframe=function(){var e=this.el.offsetWidth.toString();this.iframe=document.createElement("iframe");var t="",n=this.url.indexOf("#");for(n>-1&&(t=this.url.substring(n,this.url.length),this.url=this.url.substring(0,n)),this.url.indexOf("?")<0?this.url+="?":this.url+="&",this.iframe.src=this.url+"initialWidth="+e+"&childId="+this.id,this.settings.optionalparams&&(this.iframe.src+="&parentTitle="+encodeURIComponent(document.title),this.iframe.src+="&"+this.settings.parenturlparam+"="+encodeURIComponent(this.settings.parenturlvalue)),this.iframe.src+=t,this.iframe.setAttribute("width","100%"),this.iframe.setAttribute("scrolling","no"),this.iframe.setAttribute("marginheight","0"),this.iframe.setAttribute("frameborder","0"),this.settings.title&&this.iframe.setAttribute("title",this.settings.title),void 0!==this.settings.allowfullscreen&&!1!==this.settings.allowfullscreen&&this.iframe.setAttribute("allowfullscreen",""),void 0!==this.settings.sandbox&&"string"==typeof this.settings.sandbox&&this.iframe.setAttribute("sandbox",this.settings.sandbox),this.settings.id&&(document.getElementById(this.settings.id)||this.iframe.setAttribute("id",this.settings.id)),this.settings.name&&this.iframe.setAttribute("name",this.settings.name);this.el.firstChild;)this.el.removeChild(this.el.firstChild);this.el.appendChild(this.iframe),window.addEventListener("resize",this._onResize),this.settings.trackscroll&&window.addEventListener("scroll",this._throttleOnScroll)},this._onResize=function(){this.sendWidth(),this.settings.trackscroll&&this.sendViewportAndIFramePosition()}.bind(this),this._onScroll=function(){this.sendViewportAndIFramePosition()}.bind(this),this._fire=function(e,t){if(e in this.messageHandlers)for(var n=0;n<this.messageHandlers[e].length;n++)this.messageHandlers[e][n].call(this,t)},this.remove=function(){window.removeEventListener("message",this._processMessage),window.removeEventListener("resize",this._onResize),this.el.removeChild(this.iframe),o()},this._processMessage=function(e){if(i(e,this.settings)&&"string"==typeof e.data){var t=e.data.match(this.messageRegex);if(!t||3!==t.length)return!1;var n=t[1],r=t[2];this._fire(n,r)}}.bind(this),this._onHeightMessage=function(e){var t=parseInt(e);this.iframe.setAttribute("height",t+"px")},this._onNavigateToMessage=function(e){(function(e){if(e.match(/^(?:(?:https?|mailto|ftp):|[^&:/?#]*(?:[/?#]|$))/gi))return!0})(e)&&(document.location.href=e)},this._onScrollToChildPosMessage=function(e){var t=document.getElementById(this.id).getBoundingClientRect().top+window.pageYOffset+parseInt(e);window.scrollTo(0,t)},this.onMessage=function(e,t){e in this.messageHandlers||(this.messageHandlers[e]=[]),this.messageHandlers[e].push(t)},this.sendMessage=function(e,t){this.el.getElementsByTagName("iframe").length&&(this.el.getElementsByTagName("iframe")[0].contentWindow?this.el.getElementsByTagName("iframe")[0].contentWindow.postMessage(s(this.id,e,t),"*"):this.remove())},this.sendWidth=function(){var e=this.el.offsetWidth.toString();this.sendMessage("width",e)},this.sendViewportAndIFramePosition=function(){var e=this.iframe.getBoundingClientRect(),t=(window.innerWidth||document.documentElement.clientWidth)+" "+(window.innerHeight||document.documentElement.clientHeight);t+=" "+e.top+" "+e.left,t+=" "+e.bottom+" "+e.right,this.sendMessage("viewport-iframe-position",t)},r)this.settings[l]=r[l];return this._throttleOnScroll=function(e,t,n){var r,i,s,o=null,l=0;n||(n={});var c=function(){l=!1===n.leading?0:a(),o=null,s=e.apply(r,i),o||(r=i=null)};return function(){var h=a();l||!1!==n.leading||(l=h);var u=t-(h-l);return r=this,i=arguments,u<=0||u>t?(o&&(clearTimeout(o),o=null),l=h,s=e.apply(r,i),o||(r=i=null)):o||!1===n.trailing||(o=setTimeout(c,u)),s}}(this._onScroll.bind(this),this.settings.scrollwait),this.onMessage("height",this._onHeightMessage),this.onMessage("navigateTo",this._onNavigateToMessage),this.onMessage("scrollToChildPos",this._onScrollToChildPosMessage),this.onMessage("parentPositionInfo",this.sendViewportAndIFramePosition),window.addEventListener("message",this._processMessage,!1),this._constructIframe(),this},t.Child=function(e){this.parentWidth=null,this.id=null,this.parentTitle=null,this.parentUrl=null,this.settings={renderCallback:null,xdomain:"*",polling:0,parenturlparam:"parentUrl"},this.timerId=null,this.messageRegex=null,this.messageHandlers={},e=e||{},this.onMessage=function(e,t){e in this.messageHandlers||(this.messageHandlers[e]=[]),this.messageHandlers[e].push(t)},this._fire=function(e,t){if(e in this.messageHandlers)for(var n=0;n<this.messageHandlers[e].length;n++)this.messageHandlers[e][n].call(this,t)},this._processMessage=function(e){if(i(e,this.settings)&&"string"==typeof e.data){var t=e.data.match(this.messageRegex);if(t&&3===t.length){var n=t[1],r=t[2];this._fire(n,r)}}}.bind(this),this._onWidthMessage=function(e){var t=parseInt(e);t!==this.parentWidth&&(this.parentWidth=t,this.settings.renderCallback&&this.settings.renderCallback(t),this.sendHeight())},this.sendMessage=function(e,t){window.parent.postMessage(s(this.id,e,t),"*")},this.sendHeight=function(){var e=document.getElementsByTagName("body")[0].offsetHeight.toString();return this.sendMessage("height",e),e}.bind(this),this.getParentPositionInfo=function(){this.sendMessage("parentPositionInfo")},this.scrollParentTo=function(e){this.sendMessage("navigateTo","#"+e)},this.navigateParentTo=function(e){this.sendMessage("navigateTo",e)},this.scrollParentToChildEl=function(e){var t=document.getElementById(e).getBoundingClientRect().top+window.pageYOffset;this.scrollParentToChildPos(t)},this.scrollParentToChildPos=function(e){this.sendMessage("scrollToChildPos",e.toString())};for(var t in this.remove=function(){window.removeEventListener("message",this._processMessage),this.timerId&&clearInterval(this.timerId)},e)this.settings[t]=e[t];this.id=r("childId")||e.id,this.messageRegex=new RegExp("^pymxPYMx"+this.id+"xPYMx(\\S+)"+"xPYMx(.*)$");var a=parseInt(r("initialWidth"));return this.parentUrl=r(this.settings.parenturlparam),this.parentTitle=r("parentTitle"),this.onMessage("width",this._onWidthMessage),window.addEventListener("message",this._processMessage,!1),this.settings.renderCallback&&this.settings.renderCallback(a),this.sendHeight(),this.settings.polling&&(this.timerId=window.setInterval(this.sendHeight,this.settings.polling)),function(e){var t,r=document.getElementsByTagName("html")[0],i=r.className;try{t=window.self!==window.top?"embedded":"not-embedded"}catch(e){t="embedded"}i.indexOf(t)<0&&(r.className=i?i+" "+t:t,e&&e(t),n("marked-embedded"))}(e.onMarkedEmbeddedStatus),this},"undefined"!=typeof document&&t.autoInit(!0),t}.call(t,n,t,e))||(e.exports=r)},517:module=>{module.exports=function(obj){var __t,__p="",__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,"")};with(obj||{})__p+='<div class="mContainer">\n\n    <div class="findbar hidden doorHanger" id="findbar">\n        <div id="findbarInputContainer">\n            <input id="findInput" class="toolbarField" title="Find" placeholder="Find in document…" tabindex="91" data-l10n-id="find_input">\n            <div class="splitToolbarButton">\n                <button id="findPrevious" class="toolbarButton findPrevious" title="Find the previous occurrence of the phrase" tabindex="92" data-l10n-id="find_previous">\n                    <span data-l10n-id="find_previous_label">Previous</span>\n                </button>\n                <div class="splitToolbarButtonSeparator"></div>\n                <button id="findNext" class="toolbarButton findNext" title="Find the next occurrence of the phrase" tabindex="93" data-l10n-id="find_next">\n                    <span data-l10n-id="find_next_label">Next</span>\n                </button>\n            </div>\n        </div>\n\n        <div id="findbarOptionsContainer">\n            <input type="checkbox" id="findHighlightAll" class="toolbarField" tabindex="94">\n            <label for="findHighlightAll" class="toolbarLabel" data-l10n-id="find_highlight">Highlight all</label>\n            <input type="checkbox" id="findMatchCase" class="toolbarField" tabindex="95">\n            <label for="findMatchCase" class="toolbarLabel" data-l10n-id="find_match_case_label">Match case</label>\n            <span id="findResultsCount" class="toolbarLabel hidden"></span>\n        </div>\n\n        <div id="findbarMessageContainer">\n            <span id="findMsg" class="toolbarLabel"></span>\n        </div>\n    </div>  \x3c!-- findbar --\x3e\n\n\n    <div class="toolbar">\n        <div id="toolbarContainer">\n            <div id="toolbarViewer">\n                <div id="toolbarViewerLeft">\n                    <button id="viewFind" class="toolbarButton" title="Find in Document" tabindex="12" data-l10n-id="findbar">\n                        <span data-l10n-id="findbar_label">Find</span>\n                    </button>\n                    <button id="presentationMode" class="toolbarButton presentationMode hiddenLargeView" title="Switch to Presentation Mode" tabindex="31" data-l10n-id="presentation_mode">\n                        <span data-l10n-id="presentation_mode_label">Presentation Mode</span>\n                    </button>\n                </div>\n                <div id="toolbarViewerMiddle">\n                    <div class="splitToolbarButton">\n                        <button id="zoomOut" class="toolbarButton zoomOut" title="Zoom Out" tabindex="21" data-l10n-id="zoom_out">\n                            <span data-l10n-id="zoom_out_label">Zoom Out</span>\n                        </button>\n                        <div class="splitToolbarButtonSeparator"></div>\n                        <button id="zoomIn" class="toolbarButton zoomIn" title="Zoom In" tabindex="22" data-l10n-id="zoom_in">\n                            <span data-l10n-id="zoom_in_label">Zoom In</span>\n                        </button>\n                        <div class="splitToolbarButtonSeparator"></div>\n                    </div>\n                    <button id="reset" class="toolbarButton reset" title="Reset" tabindex="23" data-l10n-id="reset">\n                        <span data-l10n-id="reset_label">Reset</span>\n                    </button>\n                </div>\n            </div>\n        </div>\n    </div>\n    <div id="viewerContainer" tabindex="0">\n        <div id="viewer" class="pdfViewer"></div>\n    </div>\n</div>\n';return __p}},469:(e,t,n)=>{var r;e=n.nmd(e),function(){var i="object"==typeof self&&self.self===self&&self||"object"==typeof n.g&&n.g.global===n.g&&n.g||this||{},s=i._,a=Array.prototype,o=Object.prototype,l="undefined"!=typeof Symbol?Symbol.prototype:null,c=a.push,h=a.slice,u=o.toString,d=o.hasOwnProperty,p=Array.isArray,g=Object.keys,f=Object.create,m=function(){},_=function(e){return e instanceof _?e:this instanceof _?void(this._wrapped=e):new _(e)};t.nodeType?i._=_:(!e.nodeType&&e.exports&&(t=e.exports=_),t._=_),_.VERSION="1.9.1";var b,y=function(e,t,n){if(void 0===t)return e;switch(null==n?3:n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,s){return e.call(t,n,r,i,s)}}return function(){return e.apply(t,arguments)}},v=function(e,t,n){return _.iteratee!==b?_.iteratee(e,t):null==e?_.identity:_.isFunction(e)?y(e,t,n):_.isObject(e)&&!_.isArray(e)?_.matcher(e):_.property(e)};_.iteratee=b=function(e,t){return v(e,t,1/0)};var A=function(e,t){return t=null==t?e.length-1:+t,function(){for(var n=Math.max(arguments.length-t,0),r=Array(n),i=0;i<n;i++)r[i]=arguments[i+t];switch(t){case 0:return e.call(this,r);case 1:return e.call(this,arguments[0],r);case 2:return e.call(this,arguments[0],arguments[1],r)}var s=Array(t+1);for(i=0;i<t;i++)s[i]=arguments[i];return s[t]=r,e.apply(this,s)}},S=function(e){if(!_.isObject(e))return{};if(f)return f(e);m.prototype=e;var t=new m;return m.prototype=null,t},w=function(e){return function(t){return null==t?void 0:t[e]}},x=function(e,t){return null!=e&&d.call(e,t)},P=function(e,t){for(var n=t.length,r=0;r<n;r++){if(null==e)return;e=e[t[r]]}return n?e:void 0},C=Math.pow(2,53)-1,T=w("length"),k=function(e){var t=T(e);return"number"==typeof t&&t>=0&&t<=C};_.each=_.forEach=function(e,t,n){var r,i;if(t=y(t,n),k(e))for(r=0,i=e.length;r<i;r++)t(e[r],r,e);else{var s=_.keys(e);for(r=0,i=s.length;r<i;r++)t(e[s[r]],s[r],e)}return e},_.map=_.collect=function(e,t,n){t=v(t,n);for(var r=!k(e)&&_.keys(e),i=(r||e).length,s=Array(i),a=0;a<i;a++){var o=r?r[a]:a;s[a]=t(e[o],o,e)}return s};var L=function(e){var t=function(t,n,r,i){var s=!k(t)&&_.keys(t),a=(s||t).length,o=e>0?0:a-1;for(i||(r=t[s?s[o]:o],o+=e);o>=0&&o<a;o+=e){var l=s?s[o]:o;r=n(r,t[l],l,t)}return r};return function(e,n,r,i){var s=arguments.length>=3;return t(e,y(n,i,4),r,s)}};_.reduce=_.foldl=_.inject=L(1),_.reduceRight=_.foldr=L(-1),_.find=_.detect=function(e,t,n){var r=(k(e)?_.findIndex:_.findKey)(e,t,n);if(void 0!==r&&-1!==r)return e[r]},_.filter=_.select=function(e,t,n){var r=[];return t=v(t,n),_.each(e,(function(e,n,i){t(e,n,i)&&r.push(e)})),r},_.reject=function(e,t,n){return _.filter(e,_.negate(v(t)),n)},_.every=_.all=function(e,t,n){t=v(t,n);for(var r=!k(e)&&_.keys(e),i=(r||e).length,s=0;s<i;s++){var a=r?r[s]:s;if(!t(e[a],a,e))return!1}return!0},_.some=_.any=function(e,t,n){t=v(t,n);for(var r=!k(e)&&_.keys(e),i=(r||e).length,s=0;s<i;s++){var a=r?r[s]:s;if(t(e[a],a,e))return!0}return!1},_.contains=_.includes=_.include=function(e,t,n,r){return k(e)||(e=_.values(e)),("number"!=typeof n||r)&&(n=0),_.indexOf(e,t,n)>=0},_.invoke=A((function(e,t,n){var r,i;return _.isFunction(t)?i=t:_.isArray(t)&&(r=t.slice(0,-1),t=t[t.length-1]),_.map(e,(function(e){var s=i;if(!s){if(r&&r.length&&(e=P(e,r)),null==e)return;s=e[t]}return null==s?s:s.apply(e,n)}))})),_.pluck=function(e,t){return _.map(e,_.property(t))},_.where=function(e,t){return _.filter(e,_.matcher(t))},_.findWhere=function(e,t){return _.find(e,_.matcher(t))},_.max=function(e,t,n){var r,i,s=-1/0,a=-1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var o=0,l=(e=k(e)?e:_.values(e)).length;o<l;o++)null!=(r=e[o])&&r>s&&(s=r);else t=v(t,n),_.each(e,(function(e,n,r){((i=t(e,n,r))>a||i===-1/0&&s===-1/0)&&(s=e,a=i)}));return s},_.min=function(e,t,n){var r,i,s=1/0,a=1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var o=0,l=(e=k(e)?e:_.values(e)).length;o<l;o++)null!=(r=e[o])&&r<s&&(s=r);else t=v(t,n),_.each(e,(function(e,n,r){((i=t(e,n,r))<a||i===1/0&&s===1/0)&&(s=e,a=i)}));return s},_.shuffle=function(e){return _.sample(e,1/0)},_.sample=function(e,t,n){if(null==t||n)return k(e)||(e=_.values(e)),e[_.random(e.length-1)];var r=k(e)?_.clone(e):_.values(e),i=T(r);t=Math.max(Math.min(t,i),0);for(var s=i-1,a=0;a<t;a++){var o=_.random(a,s),l=r[a];r[a]=r[o],r[o]=l}return r.slice(0,t)},_.sortBy=function(e,t,n){var r=0;return t=v(t,n),_.pluck(_.map(e,(function(e,n,i){return{value:e,index:r++,criteria:t(e,n,i)}})).sort((function(e,t){var n=e.criteria,r=t.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(n<r||void 0===r)return-1}return e.index-t.index})),"value")};var E=function(e,t){return function(n,r,i){var s=t?[[],[]]:{};return r=v(r,i),_.each(n,(function(t,i){var a=r(t,i,n);e(s,t,a)})),s}};_.groupBy=E((function(e,t,n){x(e,n)?e[n].push(t):e[n]=[t]})),_.indexBy=E((function(e,t,n){e[n]=t})),_.countBy=E((function(e,t,n){x(e,n)?e[n]++:e[n]=1}));var R=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;_.toArray=function(e){return e?_.isArray(e)?h.call(e):_.isString(e)?e.match(R):k(e)?_.map(e,_.identity):_.values(e):[]},_.size=function(e){return null==e?0:k(e)?e.length:_.keys(e).length},_.partition=E((function(e,t,n){e[n?0:1].push(t)}),!0),_.first=_.head=_.take=function(e,t,n){return null==e||e.length<1?null==t?void 0:[]:null==t||n?e[0]:_.initial(e,e.length-t)},_.initial=function(e,t,n){return h.call(e,0,Math.max(0,e.length-(null==t||n?1:t)))},_.last=function(e,t,n){return null==e||e.length<1?null==t?void 0:[]:null==t||n?e[e.length-1]:_.rest(e,Math.max(0,e.length-t))},_.rest=_.tail=_.drop=function(e,t,n){return h.call(e,null==t||n?1:t)},_.compact=function(e){return _.filter(e,Boolean)};var M=function(e,t,n,r){for(var i=(r=r||[]).length,s=0,a=T(e);s<a;s++){var o=e[s];if(k(o)&&(_.isArray(o)||_.isArguments(o)))if(t)for(var l=0,c=o.length;l<c;)r[i++]=o[l++];else M(o,t,n,r),i=r.length;else n||(r[i++]=o)}return r};_.flatten=function(e,t){return M(e,t,!1)},_.without=A((function(e,t){return _.difference(e,t)})),_.uniq=_.unique=function(e,t,n,r){_.isBoolean(t)||(r=n,n=t,t=!1),null!=n&&(n=v(n,r));for(var i=[],s=[],a=0,o=T(e);a<o;a++){var l=e[a],c=n?n(l,a,e):l;t&&!n?(a&&s===c||i.push(l),s=c):n?_.contains(s,c)||(s.push(c),i.push(l)):_.contains(i,l)||i.push(l)}return i},_.union=A((function(e){return _.uniq(M(e,!0,!0))})),_.intersection=function(e){for(var t=[],n=arguments.length,r=0,i=T(e);r<i;r++){var s=e[r];if(!_.contains(t,s)){var a;for(a=1;a<n&&_.contains(arguments[a],s);a++);a===n&&t.push(s)}}return t},_.difference=A((function(e,t){return t=M(t,!0,!0),_.filter(e,(function(e){return!_.contains(t,e)}))})),_.unzip=function(e){for(var t=e&&_.max(e,T).length||0,n=Array(t),r=0;r<t;r++)n[r]=_.pluck(e,r);return n},_.zip=A(_.unzip),_.object=function(e,t){for(var n={},r=0,i=T(e);r<i;r++)t?n[e[r]]=t[r]:n[e[r][0]]=e[r][1];return n};var F=function(e){return function(t,n,r){n=v(n,r);for(var i=T(t),s=e>0?0:i-1;s>=0&&s<i;s+=e)if(n(t[s],s,t))return s;return-1}};_.findIndex=F(1),_.findLastIndex=F(-1),_.sortedIndex=function(e,t,n,r){for(var i=(n=v(n,r,1))(t),s=0,a=T(e);s<a;){var o=Math.floor((s+a)/2);n(e[o])<i?s=o+1:a=o}return s};var I=function(e,t,n){return function(r,i,s){var a=0,o=T(r);if("number"==typeof s)e>0?a=s>=0?s:Math.max(s+o,a):o=s>=0?Math.min(s+1,o):s+o+1;else if(n&&s&&o)return r[s=n(r,i)]===i?s:-1;if(i!=i)return(s=t(h.call(r,a,o),_.isNaN))>=0?s+a:-1;for(s=e>0?a:o-1;s>=0&&s<o;s+=e)if(r[s]===i)return s;return-1}};_.indexOf=I(1,_.findIndex,_.sortedIndex),_.lastIndexOf=I(-1,_.findLastIndex),_.range=function(e,t,n){null==t&&(t=e||0,e=0),n||(n=t<e?-1:1);for(var r=Math.max(Math.ceil((t-e)/n),0),i=Array(r),s=0;s<r;s++,e+=n)i[s]=e;return i},_.chunk=function(e,t){if(null==t||t<1)return[];for(var n=[],r=0,i=e.length;r<i;)n.push(h.call(e,r,r+=t));return n};var D=function(e,t,n,r,i){if(!(r instanceof t))return e.apply(n,i);var s=S(e.prototype),a=e.apply(s,i);return _.isObject(a)?a:s};_.bind=A((function(e,t,n){if(!_.isFunction(e))throw new TypeError("Bind must be called on a function");var r=A((function(i){return D(e,r,t,this,n.concat(i))}));return r})),_.partial=A((function(e,t){var n=_.partial.placeholder,r=function(){for(var i=0,s=t.length,a=Array(s),o=0;o<s;o++)a[o]=t[o]===n?arguments[i++]:t[o];for(;i<arguments.length;)a.push(arguments[i++]);return D(e,r,this,this,a)};return r})),_.partial.placeholder=_,_.bindAll=A((function(e,t){var n=(t=M(t,!1,!1)).length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var r=t[n];e[r]=_.bind(e[r],e)}})),_.memoize=function(e,t){var n=function(r){var i=n.cache,s=""+(t?t.apply(this,arguments):r);return x(i,s)||(i[s]=e.apply(this,arguments)),i[s]};return n.cache={},n},_.delay=A((function(e,t,n){return setTimeout((function(){return e.apply(null,n)}),t)})),_.defer=_.partial(_.delay,_,1),_.throttle=function(e,t,n){var r,i,s,a,o=0;n||(n={});var l=function(){o=!1===n.leading?0:_.now(),r=null,a=e.apply(i,s),r||(i=s=null)},c=function(){var c=_.now();o||!1!==n.leading||(o=c);var h=t-(c-o);return i=this,s=arguments,h<=0||h>t?(r&&(clearTimeout(r),r=null),o=c,a=e.apply(i,s),r||(i=s=null)):r||!1===n.trailing||(r=setTimeout(l,h)),a};return c.cancel=function(){clearTimeout(r),o=0,r=i=s=null},c},_.debounce=function(e,t,n){var r,i,s=function(t,n){r=null,n&&(i=e.apply(t,n))},a=A((function(a){if(r&&clearTimeout(r),n){var o=!r;r=setTimeout(s,t),o&&(i=e.apply(this,a))}else r=_.delay(s,t,this,a);return i}));return a.cancel=function(){clearTimeout(r),r=null},a},_.wrap=function(e,t){return _.partial(t,e)},_.negate=function(e){return function(){return!e.apply(this,arguments)}},_.compose=function(){var e=arguments,t=e.length-1;return function(){for(var n=t,r=e[t].apply(this,arguments);n--;)r=e[n].call(this,r);return r}},_.after=function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},_.before=function(e,t){var n;return function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=null),n}},_.once=_.partial(_.before,2),_.restArguments=A;var N=!{toString:null}.propertyIsEnumerable("toString"),O=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],j=function(e,t){var n=O.length,r=e.constructor,i=_.isFunction(r)&&r.prototype||o,s="constructor";for(x(e,s)&&!_.contains(t,s)&&t.push(s);n--;)(s=O[n])in e&&e[s]!==i[s]&&!_.contains(t,s)&&t.push(s)};_.keys=function(e){if(!_.isObject(e))return[];if(g)return g(e);var t=[];for(var n in e)x(e,n)&&t.push(n);return N&&j(e,t),t},_.allKeys=function(e){if(!_.isObject(e))return[];var t=[];for(var n in e)t.push(n);return N&&j(e,t),t},_.values=function(e){for(var t=_.keys(e),n=t.length,r=Array(n),i=0;i<n;i++)r[i]=e[t[i]];return r},_.mapObject=function(e,t,n){t=v(t,n);for(var r=_.keys(e),i=r.length,s={},a=0;a<i;a++){var o=r[a];s[o]=t(e[o],o,e)}return s},_.pairs=function(e){for(var t=_.keys(e),n=t.length,r=Array(n),i=0;i<n;i++)r[i]=[t[i],e[t[i]]];return r},_.invert=function(e){for(var t={},n=_.keys(e),r=0,i=n.length;r<i;r++)t[e[n[r]]]=n[r];return t},_.functions=_.methods=function(e){var t=[];for(var n in e)_.isFunction(e[n])&&t.push(n);return t.sort()};var B=function(e,t){return function(n){var r=arguments.length;if(t&&(n=Object(n)),r<2||null==n)return n;for(var i=1;i<r;i++)for(var s=arguments[i],a=e(s),o=a.length,l=0;l<o;l++){var c=a[l];t&&void 0!==n[c]||(n[c]=s[c])}return n}};_.extend=B(_.allKeys),_.extendOwn=_.assign=B(_.keys),_.findKey=function(e,t,n){t=v(t,n);for(var r,i=_.keys(e),s=0,a=i.length;s<a;s++)if(t(e[r=i[s]],r,e))return r};var U,V,H=function(e,t,n){return t in n};_.pick=A((function(e,t){var n={},r=t[0];if(null==e)return n;_.isFunction(r)?(t.length>1&&(r=y(r,t[1])),t=_.allKeys(e)):(r=H,t=M(t,!1,!1),e=Object(e));for(var i=0,s=t.length;i<s;i++){var a=t[i],o=e[a];r(o,a,e)&&(n[a]=o)}return n})),_.omit=A((function(e,t){var n,r=t[0];return _.isFunction(r)?(r=_.negate(r),t.length>1&&(n=t[1])):(t=_.map(M(t,!1,!1),String),r=function(e,n){return!_.contains(t,n)}),_.pick(e,r,n)})),_.defaults=B(_.allKeys,!0),_.create=function(e,t){var n=S(e);return t&&_.extendOwn(n,t),n},_.clone=function(e){return _.isObject(e)?_.isArray(e)?e.slice():_.extend({},e):e},_.tap=function(e,t){return t(e),e},_.isMatch=function(e,t){var n=_.keys(t),r=n.length;if(null==e)return!r;for(var i=Object(e),s=0;s<r;s++){var a=n[s];if(t[a]!==i[a]||!(a in i))return!1}return!0},U=function(e,t,n,r){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return!1;if(e!=e)return t!=t;var i=typeof e;return("function"===i||"object"===i||"object"==typeof t)&&V(e,t,n,r)},V=function(e,t,n,r){e instanceof _&&(e=e._wrapped),t instanceof _&&(t=t._wrapped);var i=u.call(e);if(i!==u.call(t))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:0==+e?1/+e==1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return l.valueOf.call(e)===l.valueOf.call(t)}var s="[object Array]"===i;if(!s){if("object"!=typeof e||"object"!=typeof t)return!1;var a=e.constructor,o=t.constructor;if(a!==o&&!(_.isFunction(a)&&a instanceof a&&_.isFunction(o)&&o instanceof o)&&"constructor"in e&&"constructor"in t)return!1}r=r||[];for(var c=(n=n||[]).length;c--;)if(n[c]===e)return r[c]===t;if(n.push(e),r.push(t),s){if((c=e.length)!==t.length)return!1;for(;c--;)if(!U(e[c],t[c],n,r))return!1}else{var h,d=_.keys(e);if(c=d.length,_.keys(t).length!==c)return!1;for(;c--;)if(h=d[c],!x(t,h)||!U(e[h],t[h],n,r))return!1}return n.pop(),r.pop(),!0},_.isEqual=function(e,t){return U(e,t)},_.isEmpty=function(e){return null==e||(k(e)&&(_.isArray(e)||_.isString(e)||_.isArguments(e))?0===e.length:0===_.keys(e).length)},_.isElement=function(e){return!(!e||1!==e.nodeType)},_.isArray=p||function(e){return"[object Array]"===u.call(e)},_.isObject=function(e){var t=typeof e;return"function"===t||"object"===t&&!!e},_.each(["Arguments","Function","String","Number","Date","RegExp","Error","Symbol","Map","WeakMap","Set","WeakSet"],(function(e){_["is"+e]=function(t){return u.call(t)==="[object "+e+"]"}})),_.isArguments(arguments)||(_.isArguments=function(e){return x(e,"callee")});var W=i.document&&i.document.childNodes;"object"!=typeof Int8Array&&"function"!=typeof W&&(_.isFunction=function(e){return"function"==typeof e||!1}),_.isFinite=function(e){return!_.isSymbol(e)&&isFinite(e)&&!isNaN(parseFloat(e))},_.isNaN=function(e){return _.isNumber(e)&&isNaN(e)},_.isBoolean=function(e){return!0===e||!1===e||"[object Boolean]"===u.call(e)},_.isNull=function(e){return null===e},_.isUndefined=function(e){return void 0===e},_.has=function(e,t){if(!_.isArray(t))return x(e,t);for(var n=t.length,r=0;r<n;r++){var i=t[r];if(null==e||!d.call(e,i))return!1;e=e[i]}return!!n},_.noConflict=function(){return i._=s,this},_.identity=function(e){return e},_.constant=function(e){return function(){return e}},_.noop=function(){},_.property=function(e){return _.isArray(e)?function(t){return P(t,e)}:w(e)},_.propertyOf=function(e){return null==e?function(){}:function(t){return _.isArray(t)?P(e,t):e[t]}},_.matcher=_.matches=function(e){return e=_.extendOwn({},e),function(t){return _.isMatch(t,e)}},_.times=function(e,t,n){var r=Array(Math.max(0,e));t=y(t,n,1);for(var i=0;i<e;i++)r[i]=t(i);return r},_.random=function(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))},_.now=Date.now||function(){return(new Date).getTime()};var q={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},z=_.invert(q),G=function(e){var t=function(t){return e[t]},n="(?:"+_.keys(e).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(e){return e=null==e?"":""+e,r.test(e)?e.replace(i,t):e}};_.escape=G(q),_.unescape=G(z),_.result=function(e,t,n){_.isArray(t)||(t=[t]);var r=t.length;if(!r)return _.isFunction(n)?n.call(e):n;for(var i=0;i<r;i++){var s=null==e?void 0:e[t[i]];void 0===s&&(s=n,i=r),e=_.isFunction(s)?s.call(e):s}return e};var $=0;_.uniqueId=function(e){var t=++$+"";return e?e+t:t},_.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var X=/(.)^/,Y={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},K=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(e){return"\\"+Y[e]};_.template=function(e,t,n){!t&&n&&(t=n),t=_.defaults({},t,_.templateSettings);var r,i=RegExp([(t.escape||X).source,(t.interpolate||X).source,(t.evaluate||X).source].join("|")+"|$","g"),s=0,a="__p+='";e.replace(i,(function(t,n,r,i,o){return a+=e.slice(s,o).replace(K,Q),s=o+t.length,n?a+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?a+="'+\n((__t=("+r+"))==null?'':__t)+\n'":i&&(a+="';\n"+i+"\n__p+='"),t})),a+="';\n",t.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{r=new Function(t.variable||"obj","_",a)}catch(e){throw e.source=a,e}var o=function(e){return r.call(this,e,_)},l=t.variable||"obj";return o.source="function("+l+"){\n"+a+"}",o},_.chain=function(e){var t=_(e);return t._chain=!0,t};var J=function(e,t){return e._chain?_(t).chain():t};_.mixin=function(e){return _.each(_.functions(e),(function(t){var n=_[t]=e[t];_.prototype[t]=function(){var e=[this._wrapped];return c.apply(e,arguments),J(this,n.apply(_,e))}})),_},_.mixin(_),_.each(["pop","push","reverse","shift","sort","splice","unshift"],(function(e){var t=a[e];_.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),"shift"!==e&&"splice"!==e||0!==n.length||delete n[0],J(this,n)}})),_.each(["concat","join","slice"],(function(e){var t=a[e];_.prototype[e]=function(){return J(this,t.apply(this._wrapped,arguments))}})),_.prototype.value=function(){return this._wrapped},_.prototype.valueOf=_.prototype.toJSON=_.prototype.value,_.prototype.toString=function(){return String(this._wrapped)},void 0===(r=function(){return _}.apply(t,[]))||(e.exports=r)}()},762:()=>{"use strict";if(document.webL10n=function(window,document,undefined){var gL10nData={},gTextData="",gTextProp="textContent",gLanguage="",gMacros={},gReadyState="loading",gAsyncResourceLoading=!0,gDEBUG=1;function consoleLog(e){gDEBUG>=2&&console.log("[l10n] "+e)}function consoleWarn(e){gDEBUG&&console.warn("[l10n] "+e)}function getL10nResourceLinks(){return document.querySelectorAll('link[type="application/l10n"]')}function getL10nDictionary(){var e=document.querySelector('script[type="application/l10n"]');return e?JSON.parse(e.innerHTML):null}function getTranslatableChildren(e){return e?e.querySelectorAll("*[data-l10n-id]"):[]}function getL10nAttributes(e){if(!e)return{};var t=e.getAttribute("data-l10n-id"),n=e.getAttribute("data-l10n-args"),r={};if(n)try{r=JSON.parse(n)}catch(e){consoleWarn("could not parse arguments for #"+t)}return{id:t,args:r}}function fireL10nReadyEvent(e){var t=document.createEvent("Event");t.initEvent("localized",!0,!1),t.language=e,document.dispatchEvent(t)}function xhrLoadText(e,t,n){t=t||function(e){},n=n||function(){consoleWarn(e+" not found.")};var r=new XMLHttpRequest;r.open("GET",e,gAsyncResourceLoading),r.overrideMimeType&&r.overrideMimeType("text/plain; charset=utf-8"),r.onreadystatechange=function(){4==r.readyState&&(200==r.status||0===r.status?t(r.responseText):n())},r.onerror=n,r.ontimeout=n;try{r.send(null)}catch(e){n()}}function parseResource(e,t,n,r){var i=e.replace(/[^\/]*$/,"")||"./";function s(e){return e.lastIndexOf("\\")<0?e:e.replace(/\\\\/g,"\\").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\{/g,"{").replace(/\\}/g,"}").replace(/\\"/g,'"').replace(/\\'/g,"'")}xhrLoadText(e,(function(e){gTextData+=e,function(e,r){var a={},o=/^\s*|\s*$/,l=/^\s*#|^\s*$/,c=/^\s*\[(.*)\]\s*$/,h=/^\s*@import\s+url\((.*)\)\s*$/i,u=/^([^=\s]*)\s*=\s*(.+)$/;function d(e,n,r){var d=e.replace(o,"").split(/[\r\n]+/),g="*",f=t.split("-",1)[0],m=!1,_="";!function e(){for(;;){if(!d.length)return void r();var o=d.shift();if(!l.test(o)){if(n){if(_=c.exec(o)){g=_[1].toLowerCase(),m="*"!==g&&g!==t&&g!==f;continue}if(m)continue;if(_=h.exec(o))return void p(i+_[1],e)}var b=o.match(u);b&&3==b.length&&(a[b[1]]=s(b[2]))}}}()}function p(e,t){xhrLoadText(e,(function(e){d(e,!1,t)}),null)}d(e,!0,(function(){!function(e){for(var t in e){var r,i,s=t.lastIndexOf(".");s>0?(r=t.substring(0,s),i=t.substr(s+1)):(r=t,i=gTextProp),gL10nData[r]||(gL10nData[r]={}),gL10nData[r][i]=e[t]}n&&n()}(a)}))}(e)}),r)}function loadLocale(e,t){e&&(e=e.toLowerCase()),t=t||function(){},clear(),gLanguage=e;var n=getL10nResourceLinks(),r=n.length;if(0===r){var i=getL10nDictionary();if(i&&i.locales&&i.default_locale){if(consoleLog("using the embedded JSON directory, early way out"),!(gL10nData=i.locales[e])){var s=i.default_locale.toLowerCase();for(var a in i.locales){if((a=a.toLowerCase())===e){gL10nData=i.locales[e];break}a===s&&(gL10nData=i.locales[s])}}t()}else consoleLog("no resource to load, early way out");return fireL10nReadyEvent(e),void(gReadyState="complete")}var o,l=0;function c(e){var t=e.href;this.load=function(e,n){parseResource(t,e,n,(function(){consoleWarn(t+" not found."),consoleWarn('"'+e+'" resource not found'),gLanguage="",n()}))}}o=function(){++l>=r&&(t(),fireL10nReadyEvent(e),gReadyState="complete")};for(var h=0;h<r;h++)new c(n[h]).load(e,o)}function clear(){gL10nData={},gTextData="",gLanguage=""}function getPluralRules(e){function t(e,t){return-1!==t.indexOf(e)}function n(e,t,n){return t<=e&&e<=n}var r={0:function(e){return"other"},1:function(e){return n(e%100,3,10)?"few":0===e?"zero":n(e%100,11,99)?"many":2==e?"two":1==e?"one":"other"},2:function(e){return 0!==e&&e%10==0?"many":2==e?"two":1==e?"one":"other"},3:function(e){return 1==e?"one":"other"},4:function(e){return n(e,0,1)?"one":"other"},5:function(e){return n(e,0,2)&&2!=e?"one":"other"},6:function(e){return 0===e?"zero":e%10==1&&e%100!=11?"one":"other"},7:function(e){return 2==e?"two":1==e?"one":"other"},8:function(e){return n(e,3,6)?"few":n(e,7,10)?"many":2==e?"two":1==e?"one":"other"},9:function(e){return 0===e||1!=e&&n(e%100,1,19)?"few":1==e?"one":"other"},10:function(e){return n(e%10,2,9)&&!n(e%100,11,19)?"few":e%10!=1||n(e%100,11,19)?"other":"one"},11:function(e){return n(e%10,2,4)&&!n(e%100,12,14)?"few":e%10==0||n(e%10,5,9)||n(e%100,11,14)?"many":e%10==1&&e%100!=11?"one":"other"},12:function(e){return n(e,2,4)?"few":1==e?"one":"other"},13:function(e){return n(e%10,2,4)&&!n(e%100,12,14)?"few":1!=e&&n(e%10,0,1)||n(e%10,5,9)||n(e%100,12,14)?"many":1==e?"one":"other"},14:function(e){return n(e%100,3,4)?"few":e%100==2?"two":e%100==1?"one":"other"},15:function(e){return 0===e||n(e%100,2,10)?"few":n(e%100,11,19)?"many":1==e?"one":"other"},16:function(e){return e%10==1&&11!=e?"one":"other"},17:function(e){return 3==e?"few":0===e?"zero":6==e?"many":2==e?"two":1==e?"one":"other"},18:function(e){return 0===e?"zero":n(e,0,2)&&0!==e&&2!=e?"one":"other"},19:function(e){return n(e,2,10)?"few":n(e,0,1)?"one":"other"},20:function(e){return!n(e%10,3,4)&&e%10!=9||n(e%100,10,19)||n(e%100,70,79)||n(e%100,90,99)?e%1e6==0&&0!==e?"many":e%10!=2||t(e%100,[12,72,92])?e%10!=1||t(e%100,[11,71,91])?"other":"one":"two":"few"},21:function(e){return 0===e?"zero":1==e?"one":"other"},22:function(e){return n(e,0,1)||n(e,11,99)?"one":"other"},23:function(e){return n(e%10,1,2)||e%20==0?"one":"other"},24:function(e){return n(e,3,10)||n(e,13,19)?"few":t(e,[2,12])?"two":t(e,[1,11])?"one":"other"}},i={af:3,ak:4,am:4,ar:1,asa:3,az:0,be:11,bem:3,bez:3,bg:3,bh:4,bm:0,bn:3,bo:0,br:20,brx:3,bs:11,ca:3,cgg:3,chr:3,cs:12,cy:17,da:3,de:3,dv:3,dz:0,ee:3,el:3,en:3,eo:3,es:3,et:3,eu:3,fa:0,ff:5,fi:3,fil:4,fo:3,fr:5,fur:3,fy:3,ga:8,gd:24,gl:3,gsw:3,gu:3,guw:4,gv:23,ha:3,haw:3,he:2,hi:4,hr:11,hu:0,id:0,ig:0,ii:0,is:3,it:3,iu:7,ja:0,jmc:3,jv:0,ka:0,kab:5,kaj:3,kcg:3,kde:0,kea:0,kk:3,kl:3,km:0,kn:0,ko:0,ksb:3,ksh:21,ku:3,kw:7,lag:18,lb:3,lg:3,ln:4,lo:0,lt:10,lv:6,mas:3,mg:4,mk:16,ml:3,mn:3,mo:9,mr:3,ms:0,mt:15,my:0,nah:3,naq:7,nb:3,nd:3,ne:3,nl:3,nn:3,no:3,nr:3,nso:4,ny:3,nyn:3,om:3,or:3,pa:3,pap:3,pl:13,ps:3,pt:3,rm:3,ro:9,rof:3,ru:11,rwk:3,sah:0,saq:3,se:7,seh:3,ses:0,sg:0,sh:11,shi:19,sk:12,sl:14,sma:7,smi:7,smj:7,smn:7,sms:7,sn:3,so:3,sq:3,sr:11,ss:3,ssy:3,st:3,sv:3,sw:3,syr:3,ta:3,te:3,teo:3,th:0,ti:4,tig:3,tk:3,tl:4,tn:3,to:0,tr:0,ts:3,tzm:22,uk:11,ur:3,ve:3,vi:0,vun:3,wa:4,wae:3,wo:0,xh:3,xog:3,yo:0,zh:0,zu:3}[e.replace(/-.*$/,"")];return i in r?r[i]:(consoleWarn("plural form unknown for ["+e+"]"),function(){return"other"})}function getL10nData(e,t,n){var r=gL10nData[e];if(!r){if(consoleWarn("#"+e+" is undefined."),!n)return null;r=n}var i={};for(var s in r){var a=r[s];a=substArguments(a=substIndexes(a,t,e,s),t,e),i[s]=a}return i}function substIndexes(e,t,n,r){var i=/\{\[\s*([a-zA-Z]+)\(([a-zA-Z]+)\)\s*\]\}/.exec(e);if(!i||!i.length)return e;var s,a=i[1],o=i[2];return t&&o in t?s=t[o]:o in gL10nData&&(s=gL10nData[o]),a in gMacros&&(e=(0,gMacros[a])(e,s,n,r)),e}function substArguments(e,t,n){return e.replace(/\{\{\s*(.+?)\s*\}\}/g,(function(e,r){return t&&r in t?t[r]:r in gL10nData?gL10nData[r]:(consoleLog("argument {{"+r+"}} for #"+n+" is undefined."),e)}))}function translateElement(e){var t=getL10nAttributes(e);if(t.id){var n=getL10nData(t.id,t.args);if(n){if(n[gTextProp]){if(0===getChildElementCount(e))e[gTextProp]=n[gTextProp];else{for(var r=e.childNodes,i=!1,s=0,a=r.length;s<a;s++)3===r[s].nodeType&&/\S/.test(r[s].nodeValue)&&(i?r[s].nodeValue="":(r[s].nodeValue=n[gTextProp],i=!0));if(!i){var o=document.createTextNode(n[gTextProp]);e.insertBefore(o,e.firstChild)}}delete n[gTextProp]}for(var l in n)e[l]=n[l]}else consoleWarn("#"+t.id+" is undefined.")}}function getChildElementCount(e){if(e.children)return e.children.length;if(void 0!==e.childElementCount)return e.childElementCount;for(var t=0,n=0;n<e.childNodes.length;n++)t+=1===e.nodeType?1:0;return t}function translateFragment(e){for(var t=getTranslatableChildren(e=e||document.documentElement),n=t.length,r=0;r<n;r++)translateElement(t[r]);translateElement(e)}function l10nStartup(){gReadyState="interactive";var e=navigator.language||navigator.userLanguage;consoleLog("loading ["+e+"] resources, "+(gAsyncResourceLoading?"asynchronously.":"synchronously.")),document.documentElement.lang===e?loadLocale(e):loadLocale(e,translateFragment)}return gMacros.plural=function(e,t,n,r){var i=parseFloat(t);if(isNaN(i))return e;if(r!=gTextProp)return e;gMacros._pluralRules||(gMacros._pluralRules=getPluralRules(gLanguage));var s="["+gMacros._pluralRules(i)+"]";return 0===i&&n+"[zero]"in gL10nData?e=gL10nData[n+"[zero]"][r]:1==i&&n+"[one]"in gL10nData?e=gL10nData[n+"[one]"][r]:2==i&&n+"[two]"in gL10nData?e=gL10nData[n+"[two]"][r]:n+s in gL10nData?e=gL10nData[n+s][r]:n+"[other]"in gL10nData&&(e=gL10nData[n+"[other]"][r]),e},document.addEventListener?"loading"===document.readyState?document.addEventListener("DOMContentLoaded",l10nStartup):window.setTimeout(l10nStartup):window.attachEvent&&(window.console||(consoleLog=function(e){},consoleWarn=function(e){gDEBUG&&alert("[l10n] "+e)}),window.XMLHttpRequest||(xhrLoadText=function(e,t,n){t=t||function(e){},n=n||function(){consoleWarn(e+" not found.")};var r=new ActiveXObject("Microsoft.XMLHTTP");r.open("GET",e,gAsyncResourceLoading),r.onreadystatechange=function(){4==r.readyState&&(200==r.status?t(r.responseText):n())},r.send(null)}),window.JSON||(getL10nAttributes=function(element){if(!element)return{};var l10nId=element.getAttribute("data-l10n-id"),l10nArgs=element.getAttribute("data-l10n-args"),args={};if(l10nArgs)try{args=eval(l10nArgs)}catch(e){consoleWarn("could not parse arguments for #"+l10nId)}return{id:l10nId,args}}),document.querySelectorAll||(getTranslatableChildren=function(e){if(!e)return[];for(var t=e.getElementsByTagName("*"),n=[],r=t.length,i=0;i<r;i++)t[i].getAttribute("data-l10n-id")&&n.push(t[i]);return n},getL10nResourceLinks=function(){for(var e=document.getElementsByTagName("link"),t=[],n=e.length,r=0;r<n;r++)"application/l10n"==e[r].type&&t.push(e[r]);return t}),window.JSON&&document.querySelectorAll||(getL10nDictionary=function(){for(var scripts=document.getElementsByName("script"),i=0;i<scripts.length;i++)if("application/l10n"==scripts[i].type)return eval(scripts[i].innerHTML);return null}),document.createEventObject&&!document.createEvent&&(fireL10nReadyEvent=function(e){document.documentElement.localized=1}),window.attachEvent("onload",(function(){gTextProp=null===document.textContent?"textContent":"innerText",l10nStartup()}))),{get:function(e,t,n){var r,i=e.lastIndexOf("."),s=gTextProp;i>0&&(s=e.substr(i+1),e=e.substring(0,i)),n&&((r={})[s]=n);var a=getL10nData(e,t,r);return a&&s in a?a[s]:"{{"+e+"}}"},getData:function(){return gL10nData},getText:function(){return gTextData},getLanguage:function(){return gLanguage},setLanguage:function(e,t){loadLocale(e,(function(){t&&t(),translateFragment()}))},getDirection:function(){return["ar","he","fa","ps","ur"].indexOf(gLanguage)>=0?"rtl":"ltr"},translate:translateFragment,getReadyState:function(){return gReadyState},ready:function(e){e&&("complete"==gReadyState||"interactive"==gReadyState?window.setTimeout((function(){e()})):document.addEventListener?document.addEventListener("localized",(function t(){document.removeEventListener("localized",t),e()})):document.attachEvent&&document.documentElement.attachEvent("onpropertychange",(function t(n){"localized"===n.propertyName&&(document.documentElement.detachEvent("onpropertychange",t),e())})))}}}(window,document),void 0===window._)var _=document.webL10n.get},414:()=>{},172:()=>{},1:()=>{},779:()=>{},558:()=>{},258:()=>{}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.loaded=!0,n.exports}__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__=__webpack_require__(521)})();