PageSourceSearch

https://www.kreditbee.in/react/npm.react-pdf.94c5deebd9afda0ea35d.chunk.js

js kreditbee.in collected 2026-09-24 09:18:29 UTC 325,159 bytes, 2 lines download raw bytes

1/*! For license information please see npm.react-pdf.94c5deebd9afda0ea35d.chunk.js.LICENSE.txt */
2(self.webpackChunkkbyp_web=self.webpackChunkkbyp_web||[]).push([[2779],{"7132727f7f00432482ff":function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){void 0===s&&(s=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,s,r)}:function(e,t,n,s){void 0===s&&(s=n),e[s]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&s(t,e,n);return r(t,e),t},a=this&&this.__awaiter||function(e,t,n,s){return new(n||(n=Promise))(function(r,i){function a(e){try{l(s.next(e))}catch(e){i(e)}}function o(e){try{l(s.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((s=s.apply(e,t||[])).next())})},o=this&&this.__rest||function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(e);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r])&&(n[s[r]]=e[s[r]])}return n},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const c=i(n("69084d01d3449fc1bc27")),d=l(n("f1f2954cff54795efe74")),h=l(n("2689c3796547e0f5bdd2")),u=l(n("1e3ec1abca70ca5aa6d0")),p=l(n("a536c1e0d97ff92e7ee7")),f=l(n("d4f4446dc208bee82cb8")),g=l(n("8a5f988325c9849b7bc7")),m=i(n("b7fb4a1b13972a199cb6")),b=l(n("3299aa1eee097a3fe797")),_=l(n("e21b6ac294b0c2353d69")),v=l(n("c339975b0af703fc0132")),y=l(n("3fd1b99df40e95a0f8a1")),A=n("e2b736fa2bbef9223e31"),S=l(n("37eb41e344a00019d6d8")),x=n("1f819460d2d90dfb92ab"),{PDFDataRangeTransport:E}=m,C=(e,t)=>{switch(t){case y.default.NEED_PASSWORD:e(prompt("Enter the password to open this PDF file."));break;case y.default.INCORRECT_PASSWORD:e(prompt("Invalid password. Please try again."))}},P=(0,c.forwardRef)(function(e,t){var{children:n,className:s,error:r="Failed to load PDF file.",externalLinkRel:i,externalLinkTarget:l,file:d,inputRef:y,imageResourcesPath:x,loading:P="Loading PDF…",noData:w="No PDF file specified.",onItemClick:T,onLoadError:k,onLoadProgress:R,onLoadSuccess:M,onPassword:F=C,onSourceError:O,onSourceSuccess:D,options:I,renderMode:L,rotate:N}=e,j=o(e,["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate"]);const[B,U]=(0,S.default)(),{value:q,error:W}=B,[H,G]=(0,S.default)(),{value:V,error:z}=H,$=(0,c.useRef)(new v.default),X=(0,c.useRef)([]),Y=(0,c.useRef)({scrollPageIntoView:e=>{const{dest:t,pageNumber:n,pageIndex:s=n-1}=e;if(T)return void T({dest:t,pageIndex:s,pageNumber:n});const r=X.current[s];r?r.scrollIntoView():(0,g.default)(!1,`An internal link leading to page ${n} was clicked, but neither <Document> was provided with onItemClick nor it was able to find the page within itself. Either provide onItemClick to <Document> and handle navigating by yourself or ensure that all pages are rendered within <Document>.`)}});(0,c.useImperativeHandle)(t,()=>({linkService:$,pages:X,viewer:Y}),[]),(0,c.useEffect)(function(){U({type:"RESET"})},[d,U]);const K=(0,c.useCallback)(()=>a(this,void 0,void 0,function*(){if(!d)return null;if("string"==typeof d)return(0,A.isDataURI)(d)?{data:(0,A.dataURItoByteString)(d)}:((0,A.displayCORSWarning)(),{url:d});if(d instanceof E)return{range:d};if((0,A.isArrayBuffer)(d))return{data:d};if(A.isBrowser&&(0,A.isBlob)(d))return{data:yield(0,A.loadFromFile)(d)};if((0,f.default)("object"==typeof d,"Invalid parameter in file, need either Uint8Array, string or a parameter object"),(0,f.default)("data"in d||"range"in d||"url"in d,"Invalid parameter object: need either .data, .range or .url"),"url"in d&&"string"==typeof d.url){if((0,A.isDataURI)(d.url)){const{url:e}=d,t=o(d,["url"]),n=(0,A.dataURItoByteString)(e);return Object.assign({data:n},t)}(0,A.displayCORSWarning)()}return d}),[d]);function J(e,t){X.current[e]=t}function Q(e){delete X.current[e]}(0,c.useEffect)(()=>{const e=(0,u.default)(K());return e.promise.then(e=>{U({type:"RESOLVE",value:e})}).catch(e=>{U({type:"REJECT",error:e})}),()=>{(0,A.cancelRunningTask)(e)}},[K,U]),(0,c.useEffect)(()=>{void 0!==q&&(!1!==q?D&&D():W&&((0,g.default)(!1,W.toString()),O&&O(W)))},[q]),(0,c.useEffect)(function(){G({type:"RESET"})},[G,q]),(0,c.useEffect)(function(){if(!q)return;const e=I?Object.assign(Object.assign({},q),I):q,t=m.getDocument(e);R&&(t.onProgress=R),F&&(t.onPassword=F);const n=t;return n.promise.then(e=>{G({type:"RESOLVE",value:e})}).catch(e=>{n.destroyed||G({type:"REJECT",error:e})}),()=>{n.destroy()}},[I,G,q]),(0,c.useEffect)(()=>
2{void 0!==V&&(!1!==V?V&&(M&&M(V),X.current=new Array(V.numPages),$.current.setDocument(V)):z&&((0,g.default)(!1,z.toString()),k&&k(z)))},[V]),(0,c.useEffect)(function(){$.current.setViewer(Y.current),$.current.setExternalLinkRel(i),$.current.setExternalLinkTarget(l)},[i,l]);const Z=(0,c.useMemo)(()=>({imageResourcesPath:x,linkService:$.current,onItemClick:T,pdf:V,registerPage:J,renderMode:L,rotate:N,unregisterPage:Q}),[x,T,V,L,N]),ee=(0,c.useMemo)(()=>(0,h.default)(j,()=>V),[j,V]);return c.default.createElement("div",Object.assign({className:(0,p.default)("react-pdf__Document",s),ref:y,style:{"--scale-factor":"1"}},ee),d?null==V?c.default.createElement(_.default,{type:"loading"},"function"==typeof P?P():P):!1===V?c.default.createElement(_.default,{type:"error"},"function"==typeof r?r():r):c.default.createElement(b.default.Provider,{value:Z},n):c.default.createElement(_.default,{type:"no-data"},"function"==typeof w?w():w))}),w=d.default.oneOfType([d.default.func,d.default.node]);P.propTypes=Object.assign(Object.assign({},x.eventProps),{children:d.default.node,className:x.isClassName,error:w,externalLinkRel:d.default.string,externalLinkTarget:d.default.oneOf(["_self","_blank","_parent","_top"]),file:x.isFile,imageResourcesPath:d.default.string,inputRef:x.isRef,loading:w,noData:w,onItemClick:d.default.func,onLoadError:d.default.func,onLoadProgress:d.default.func,onLoadSuccess:d.default.func,onPassword:d.default.func,onSourceError:d.default.func,onSourceSuccess:d.default.func,options:d.default.shape({canvasFactory:d.default.any,canvasMaxAreaInBytes:d.default.number,cMapPacked:d.default.bool,CMapReaderFactory:d.default.any,cMapUrl:d.default.string,disableAutoFetch:d.default.bool,disableFontFace:d.default.bool,disableRange:d.default.bool,disableStream:d.default.bool,docBaseUrl:d.default.string,enableXfa:d.default.bool,filterFactory:d.default.any,fontExtraProperties:d.default.bool,httpHeaders:d.default.object,isEvalSupported:d.default.bool,isOffscreenCanvasSupported:d.default.bool,length:d.default.number,maxImageSize:d.default.number,ownerDocument:d.default.any,password:d.default.string,pdfBug:d.default.bool,rangeChunkSize:d.default.number,StandardFontDataFactory:d.default.any,standardFontDataUrl:d.default.string,stopAtErrors:d.default.bool,useSystemFonts:d.default.bool,useWorkerFetch:d.default.bool,verbosity:d.default.number,withCredentials:d.default.bool,worker:d.default.any}),rotate:d.default.number}),t.default=P},"3299aa1eee097a3fe797":(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n("69084d01d3449fc1bc27");t.default=(0,s.createContext)(null)},c339975b0af703fc0132:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=s(n("d4f4446dc208bee82cb8"));t.default=class{constructor(){this.externalLinkEnabled=!0,this.externalLinkRel=void 0,this.externalLinkTarget=void 0,this.isInPresentationMode=!1,this.pdfDocument=void 0,this.pdfViewer=void 0}setDocument(e){this.pdfDocument=e}setViewer(e){this.pdfViewer=e}setExternalLinkRel(e){this.externalLinkRel=e}setExternalLinkTarget(e){this.externalLinkTarget=e}setHistory(){}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return(0,r.default)(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber||0}set page(e){(0,r.default)(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber=e}get rotation(){return 0}set rotation(e){}goToDestination(e){return new Promise(t=>{(0,r.default)(this.pdfDocument,"PDF document not loaded."),(0,r.default)(e,"Destination is not specified."),"string"==typeof e?this.pdfDocument.getDestination(e).then(t):Array.isArray(e)?t(e):e.then(t)}).then(e=>{(0,r.default)(Array.isArray(e),`"${e}" is not a valid destination array.`);const t=e[0];new Promise(e=>{(0,r.default)(this.pdfDocument,"PDF document not loaded."),t instanceof Object?this.pdfDocument.getPageIndex(t).then(t=>{e(t)}).catch(()=>{(0,r.default)(!1,`"${t}" is not a valid page reference.`)}):"number"==typeof t?e(t):(0,r.default)(!1,`"${t}" is not a valid destination reference.`)}).then(t=>{const n=t+1;(0,r.default)(this.pdfViewer,"PDF viewer is not initialized."),(0,r.default)(n>=1&&n<=this.pagesCount,`"${n}" is not a valid page number.`),this.pdfViewer.scrollPageIntoView({dest:e,pageIndex:t,pageNumber:n})})})}navigateTo(e){this.goToDestination(e)}goToPage(e){const t=e-1;(0,r.default)(this.pdfViewer,"PDF viewer is not initialized."),(0,r.default)(e>=1&&e<=this.pagesCount,`"${e}" is not a valid page number.`),this.pdfViewer.scrollPageIntoView({pageIndex:t,pageNumber:e})}
2addLinkAttributes(e,t,n){e.href=t,e.rel=this.externalLinkRel||"noopener noreferrer nofollow",e.target=n?"_blank":this.externalLinkTarget||""}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}setHash(){}executeNamedAction(){}cachePageRef(){}isPageVisible(){return!0}isPageCached(){return!0}executeSetOCGState(){}}},e21b6ac294b0c2353d69:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=s(n("69084d01d3449fc1bc27")),i=s(n("f1f2954cff54795efe74"));function a({children:e,type:t}){return r.default.createElement("div",{className:`react-pdf__message react-pdf__message--${t}`},e)}t.default=a,a.propTypes={children:i.default.node,type:i.default.oneOf(["error","loading","no-data"]).isRequired}},e95663a7adff05da31c6:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){void 0===s&&(s=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,s,r)}:function(e,t,n,s){void 0===s&&(s=n),e[s]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&s(t,e,n);return r(t,e),t},a=this&&this.__rest||function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(e);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r])&&(n[s[r]]=e[s[r]])}return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const l=i(n("69084d01d3449fc1bc27")),c=o(n("f1f2954cff54795efe74")),d=o(n("1e3ec1abca70ca5aa6d0")),h=o(n("2689c3796547e0f5bdd2")),u=o(n("a536c1e0d97ff92e7ee7")),p=o(n("d4f4446dc208bee82cb8")),f=o(n("8a5f988325c9849b7bc7")),g=o(n("8b4c2f117325c3e2b3d0")),m=o(n("d4db80a627ba77d2b8bd")),b=n("e2b736fa2bbef9223e31"),_=o(n("a9e84e8478140cd567bb")),v=o(n("37eb41e344a00019d6d8")),y=n("1f819460d2d90dfb92ab");function A(e){const t=(0,_.default)();(0,p.default)(t,"Unable to find Document context. Did you wrap <Outline /> in <Document />?");const n=Object.assign(Object.assign({},t),e),{className:s,inputRef:r,onItemClick:i,onLoadError:o,onLoadSuccess:c,pdf:y}=n,A=a(n,["className","inputRef","onItemClick","onLoadError","onLoadSuccess","pdf"]);(0,p.default)(y,"Attempted to load an outline, but no document was specified.");const[S,x]=(0,v.default)(),{value:E,error:C}=S;(0,l.useEffect)(function(){x({type:"RESET"})},[x,y]),(0,l.useEffect)(function(){if(!y)return;const e=(0,d.default)(y.getOutline()),t=e;return e.promise.then(e=>{x({type:"RESOLVE",value:e})}).catch(e=>{x({type:"REJECT",error:e})}),()=>(0,b.cancelRunningTask)(t)},[x,y]),(0,l.useEffect)(()=>{void 0!==E&&(!1!==E?void 0!==E&&!1!==E&&c&&c(E):C&&((0,f.default)(!1,C.toString()),o&&o(C)))},[E]);const P=(0,l.useMemo)(()=>({onItemClick:i}),[i]),w=(0,l.useMemo)(()=>(0,h.default)(A,()=>E),[A,E]);return E?l.default.createElement("div",Object.assign({className:(0,u.default)("react-pdf__Outline",s),ref:r},w),l.default.createElement(g.default.Provider,{value:P},E?l.default.createElement("ul",null,E.map((e,t)=>l.default.createElement(m.default,{key:"string"==typeof e.dest?e.dest:t,item:e}))):null)):null}t.default=A,A.propTypes=Object.assign(Object.assign({},y.eventProps),{className:y.isClassName,inputRef:y.isRef,onItemClick:c.default.func,onLoadError:c.default.func,onLoadSuccess:c.default.func,pdf:y.isPdf})},"8b4c2f117325c3e2b3d0":(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n("69084d01d3449fc1bc27");t.default=(0,s.createContext)(null)},d4db80a627ba77d2b8bd:function(e,t,n){"use strict";var s=this&&this.__awaiter||function(e,t,n,s){return new(n||(n=Prom
2ise))(function(r,i){function a(e){try{l(s.next(e))}catch(e){i(e)}}function o(e){try{l(s.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((s=s.apply(e,t||[])).next())})},r=this&&this.__rest||function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(e);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r])&&(n[s[r]]=e[s[r]])}return n},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(n("69084d01d3449fc1bc27")),o=i(n("f1f2954cff54795efe74")),l=i(n("d4f4446dc208bee82cb8")),c=i(n("0c9c170572676cfbad52")),d=i(n("212498179a4ceae3f8fd")),h=i(n("a9e84e8478140cd567bb")),u=i(n("960198dd87a0d8944e14"));function p(e){const t=(0,h.default)();(0,l.default)(t,"Unable to find Document context. Did you wrap <Outline /> in <Document />?");const n=(0,u.default)();(0,l.default)(n,"Unable to find Outline context.");const i=Object.assign(Object.assign(Object.assign({},t),n),e),{item:o,linkService:f,onItemClick:g,pdf:m}=i,b=r(i,["item","linkService","onItemClick","pdf"]);(0,l.default)(m,"Attempted to load an outline, but no document was specified.");const _=(0,d.default)(()=>"string"==typeof o.dest?m.getDestination(o.dest):o.dest),v=(0,d.default)(()=>s(this,void 0,void 0,function*(){const e=yield _();if(!e)throw new Error("Destination not found.");const[t]=e;return m.getPageIndex(new c.default(t))})),y=(0,d.default)(()=>s(this,void 0,void 0,function*(){return(yield v())+1}));return a.default.createElement("li",null,a.default.createElement("a",{href:"#",onClick:function(e){e.preventDefault(),g?Promise.all([_(),v(),y()]).then(([e,t,n])=>{g({dest:e,pageIndex:t,pageNumber:n})}):f.goToDestination(o.dest)}},o.title),function(){if(!o.items||!o.items.length)return null;const{items:e}=o;return a.default.createElement("ul",null,e.map((e,t)=>a.default.createElement(p,Object.assign({key:"string"==typeof e.dest?e.dest:t,item:e},b))))}())}t.default=p;const f=o.default.oneOfType([o.default.string,o.default.arrayOf(o.default.any)]);p.propTypes={item:o.default.shape({dest:f,items:o.default.arrayOf(o.default.shape({dest:f,title:o.default.string})),title:o.default.string}).isRequired}},c81590e7bedffba5e508:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){void 0===s&&(s=n);var r=Object.getOwnPropertyDescriptor(t,n);
2r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,s,r)}:function(e,t,n,s){void 0===s&&(s=n),e[s]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&s(t,e,n);return r(t,e),t},a=this&&this.__rest||function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(e);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r])&&(n[s[r]]=e[s[r]])}return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const l=i(n("69084d01d3449fc1bc27")),c=o(n("f1f2954cff54795efe74")),d=o(n("1e3ec1abca70ca5aa6d0")),h=o(n("2689c3796547e0f5bdd2")),u=o(n("a536c1e0d97ff92e7ee7")),p=o(n("ad761e442f619b290f72")),f=o(n("d4f4446dc208bee82cb8")),g=o(n("8a5f988325c9849b7bc7")),m=o(n("dc352e49cd7449d6822c")),b=o(n("e21b6ac294b0c2353d69")),_=o(n("1e09404319304ee96caf")),v=o(n("ea235eb36fa189027c99")),y=o(n("521381f7ea2803cb8805")),A=o(n("4e124f2b0deb1bfc04dd")),S=n("e2b736fa2bbef9223e31"),x=o(n("a9e84e8478140cd567bb")),E=o(n("37eb41e344a00019d6d8")),C=n("1f819460d2d90dfb92ab"),P=1;function w(e){const t=(0,x.default)();(0,f.default)(t,"Unable to find Document context. Did you wrap <Page /> in <Document />?");const n=Object.assign(Object.assign({},t),e),{_className:s="react-pdf__Page",_enableRegisterUnregisterPage:r=!0,canvasBackground:i,canvasRef:o,children:c,className:C,customTextRenderer:w,devicePixelRatio:T,error:k="Failed to load the page.",height:R,inputRef:M,loading:F="Loading page…",noData:O="No page specified.",onGetAnnotationsError:D,onGetAnnotationsSuccess:I,onGetStructTreeError:L,onGetStructTreeSuccess:N,onGetTextError:j,onGetTextSuccess:B,onLoadError:U,onLoadSuccess:q,onRenderAnnotationLayerError:W,onRenderAnnotationLayerSuccess:H,onRenderError:G,onRenderSuccess:V,onRenderTextLayerError:z,onRenderTextLayerSuccess:$,pageIndex:X,pageNumber:Y,pdf:K,registerPage:J,renderAnnotationLayer:Q=!0,renderForms:Z=!1,renderMode:ee="canvas",renderTextLayer:te=!0,rotate:ne,scale:se=P,unregisterPage:re,width:ie}=n,ae=a(n,["_className","_enableRegisterUnregisterPage","canvasBackground","canvasRef","children","className","customTextRenderer","devicePixelRatio","error","height","inputRef","loading","noData","onGetAnnotationsError","onGetAnnotationsSuccess","onGetStructTreeError","onGetStructTreeSuccess","onGetTextError","onGetTextSuccess","onLoadError","onLoadSuccess","onRenderAnnotationLayerError","onRenderAnnotationLayerSuccess","onRenderError","onRenderSuccess","onRenderTextLayerError","onRenderTextLayerSuccess","pageIndex","pageNumber","pdf","registerPage","renderAnnotationLayer","renderForms","renderMode","renderTextLayer","rotate","scale","unregisterPage","width"]),[oe,le]=(0,E.default)(),{value:ce,error:de}=oe,he=(0,l.useRef)(null);(0,f.default)(K,"Attempted to load a page, but no document was specified.");const ue=(0,S.isProvided)(Y)?Y-1:null!=X?X:null,pe=null!=Y?Y:(0,S.isProvided)(X)?X+1:null,fe=null!=ne?ne:ce?ce.rotate:null,ge=(0,l.useMemo)(()=>{if(!ce)return null;let e=1;const t=null!=se?se:P;if(ie||R){const t=ce.getViewport({scale:1,rotation:fe});ie?e=ie/t.width:R&&(e=R/t.height)}return t*e},[R,ce,fe,se,ie]);(0,l.useEffect)(function(){return()=>{(0,S.isProvided)(ue)&&r&&re&&re(ue)}},[r,K,ue,re]),(0,l.useEffect)(function(){le({type:"RESET"})},[le,K,ue]),(0,l.useEffect)(function(){if(!K||!pe)return;const e=(0,d.default)(K.getPage(pe)),t=e;return e.promise.then(e=>{le({type:"RESOLVE",value:e})}).catch(e=>{le({type:"REJECT",error:e})}),()=>(0,S.cancelRunningTask)(t)},[le,K,ue,pe,J]),(0,l.useEffect)(()=>{void 0!==ce&&(!1!==ce?function(){if(q){if(!ce||!ge)return;q((0,S.makePageCallback)(ce,ge))}if(r&&J){if(!(0,S.isProvided)(ue)||!he.current)return;J(ue,he.current)}}():de&&((0,g.default)(!1,de.toString()),U&&U(de)))},[ce,ge]);const me=(0,l.useMemo)(()=>ce&&(0,S.isProvided)(ue)&&pe&&(0,S.isProvided)(fe)&&(0,S.isProvided)(ge)?{_className:s,canvasBackgroun
2d:i,customTextRenderer:w,devicePixelRatio:T,onGetAnnotationsError:D,onGetAnnotationsSuccess:I,onGetStructTreeError:L,onGetStructTreeSuccess:N,onGetTextError:j,onGetTextSuccess:B,onRenderAnnotationLayerError:W,onRenderAnnotationLayerSuccess:H,onRenderError:G,onRenderSuccess:V,onRenderTextLayerError:z,onRenderTextLayerSuccess:$,page:ce,pageIndex:ue,pageNumber:pe,renderForms:Z,renderTextLayer:te,rotate:fe,scale:ge}:null,[s,i,w,T,D,I,L,N,j,B,W,H,G,V,z,$,ce,ue,pe,Z,te,fe,ge]),be=(0,l.useMemo)(()=>(0,h.default)(ae,()=>ce?ge?(0,S.makePageCallback)(ce,ge):void 0:ce),[ae,ce,ge]),_e=`${ue}@${ge}/${fe}`,ve=`${ue}/${fe}`;return l.default.createElement("div",Object.assign({className:(0,u.default)(s,C),"data-page-number":pe,ref:(0,p.default)(M,he),style:{"--scale-factor":`${ge}`,backgroundColor:i||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},be),pe?null===K||null==ce?l.default.createElement(b.default,{type:"loading"},"function"==typeof F?F():F):!1===K||!1===ce?l.default.createElement(b.default,{type:"error"},"function"==typeof k?k():k):l.default.createElement(m.default.Provider,{value:me},function(){switch(ee){case"none":return null;case"svg":return l.default.createElement(v.default,{key:`${ve}_svg`});default:return l.default.createElement(_.default,{key:`${_e}_canvas`,canvasRef:o})}}(),te?l.default.createElement(y.default,{key:`${_e}_text`}):null,Q?l.default.createElement(A.default,{key:`${_e}_annotations`}):null,c):l.default.createElement(b.default,{type:"no-data"},"function"==typeof O?O():O))}t.default=w;const T=c.default.oneOfType([c.default.func,c.default.node]);w.propTypes=Object.assign(Object.assign({},C.eventProps),{canvasBackground:c.default.string,canvasRef:C.isRef,children:c.default.node,className:C.isClassName,customTextRenderer:c.default.func,devicePixelRatio:c.default.number,error:T,height:c.default.number,imageResourcesPath:c.default.string,inputRef:C.isRef,loading:T,noData:T,onGetTextError:c.default.func,onGetTextSuccess:c.default.func,onLoadError:c.default.func,onLoadSuccess:c.default.func,onRenderError:c.default.func,onRenderSuccess:c.default.func,onRenderTextLayerError:c.default.func,onRenderTextLayerSuccess:c.default.func,pageIndex:C.isPageIndex,pageNumber:C.isPageNumber,pdf:C.isPdf,renderAnnotationLayer:c.default.bool,renderForms:c.default.bool,renderMode:C.isRenderMode,renderTextLayer:c.default.bool,rotate:C.isRotate,scale:c.default.number,width:c.default.number})},"4e124f2b0deb1bfc04dd":function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){void 0===s&&(s=n);var r=Object.getOwnPropertyDescriptor(t,n);
2r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,s,r)}:function(e,t,n,s){void 0===s&&(s=n),e[s]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&s(t,e,n);return r(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(n("69084d01d3449fc1bc27")),l=a(n("1e3ec1abca70ca5aa6d0")),c=a(n("a536c1e0d97ff92e7ee7")),d=a(n("d4f4446dc208bee82cb8")),h=a(n("8a5f988325c9849b7bc7")),u=i(n("b7fb4a1b13972a199cb6")),p=a(n("a9e84e8478140cd567bb")),f=a(n("f67da49b2bed2a4ede08")),g=a(n("37eb41e344a00019d6d8")),m=n("e2b736fa2bbef9223e31");t.default=function(){const e=(0,p.default)();(0,d.default)(e,"Unable to find Document context. Did you wrap <Page /> in <Document />?");const t=(0,f.default)();(0,d.default)(t,"Unable to find Page context.");const n=Object.assign(Object.assign({},e),t),{imageResourcesPath:s,linkService:r,onGetAnnotationsError:i,onGetAnnotationsSuccess:a,onRenderAnnotationLayerError:b,onRenderAnnotationLayerSuccess:_,page:v,pdf:y,renderForms:A,rotate:S,scale:x=1}=n,[E,C]=(0,g.default)(),{value:P,error:w}=E,T=(0,o.useRef)(null);(0,d.default)(v,"Attempted to load page annotations, but no page was specified."),(0,h.default)(1===parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-annotation-layer"),10),"AnnotationLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-annotations"),(0,o.useEffect)(function(){C({type:"RESET"})},[C,v]),(0,o.useEffect)(function(){if(!v)return;const e=(0,l.default)(v.getAnnotations()),t=e;return e.promise.then(e=>{C({type:"RESOLVE",value:e})}).catch(e=>{C({type:"REJECT",error:e})}),()=>{(0,m.cancelRunningTask)(t)}},[C,v,A]),(0,o.useEffect)(()=>{void 0!==P&&(!1!==P?P&&a&&a(P):w&&((0,h.default)(!1,w.toString()),i&&i(w)))},[P]);const k=(0,o.useMemo)(()=>v.getViewport({scale:x,rotation:S}
2),[v,S,x]);return(0,o.useEffect)(function(){if(!y||!v||!P)return;const{current:e}=T;if(!e)return;const t=k.clone({dontFlip:!0}),n={annotations:P,annotationStorage:y.annotationStorage,div:e,downloadManager:null,imageResourcesPath:s,linkService:r,page:v,renderForms:A,viewport:t};e.innerHTML="";try{u.AnnotationLayer.render(n),_&&_()}catch(e){!function(e){(0,h.default)(!1,`${e}`),b&&b(e)}(e)}return()=>{}},[P,s,r,v,A,k]),o.default.createElement("div",{className:(0,c.default)("react-pdf__Page__annotations","annotationLayer"),ref:T})}},"1e09404319304ee96caf":function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){void 0===s&&(s=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,s,r)}:function(e,t,n,s){void 0===s&&(s=n),e[s]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&s(t,e,n);return r(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(n("69084d01d3449fc1bc27")),l=a(n("ad761e442f619b290f72")),c=a(n("d4f4446dc208bee82cb8")),d=a(n("8a5f988325c9849b7bc7")),h=i(n("b7fb4a1b13972a199cb6")),u=a(n("d9971c17758369aa5128")),p=a(n("f67da49b2bed2a4ede08")),f=n("e2b736fa2bbef9223e31"),g=n("1f819460d2d90dfb92ab"),m=h.AnnotationMode;function b(e){const t=(0,p.default)();(0,c.default)(t,"Unable to find Page context.");const n=Object.assign(Object.assign({},t),e),{_className:s,canvasBackground:r,devicePixelRatio:i,onRenderError:a,onRenderSuccess:h,page:g,renderForms:b,renderTextLayer:_,rotate:v,scale:y}=n,{canvasRef:A}=e,S=(0,o.useRef)(null);(0,c.default)(g,"Attempted to render page canvas, but no page was specified.");const x=i||(0,f.getDevicePixelRatio)();function E(e){(0,f.isCancelException)(e)||((0,d.default)(!1,e.toString()),a&&a(e))}const C=(0,o.useMemo)(()=>g.getViewport({scale:y*x,rotation:v}),[x,g,v,y]),P=(0,o.useMemo)(()=>g.getViewport({scale:y,rotation:v}),[g,v,y]);(0,o.useEffect)(function(){if(!g)return;g.cleanup();const{current:e}=S;if(!e)return;e.width=C.width,e.height=C.height,e.style.width=`${Math.floor(P.width)}px`,e.style.height=`${Math.floor(P.height)}px`,e.style.visibility="hidden";const t={annotationMode:b?m.ENABLE_FORMS:m.ENABLE,canvasContext:e.getContext("2d",{alpha:!1}),viewport:C};r&&(t.background=r);const n=g.render(t),s=n;return n.promise.then(()=>{e.style.visibility="",g&&h&&h((0,f.makePageCallback)(g,y))}).catch(E),()=>(0,f.cancelRunningTask)(s)},[r,S,x,g,b,C,P]);const w=(0,o.useCallback)(()=>{const{current:e}=S;e&&(e.width=0,e.height=0)},[S]);return(0,o.useEffect)(()=>w,[w]),o.default.createElement("canvas",{className:`${s}__canvas`,dir:"ltr",ref:(0,l.default)(A,S),style:{display:"block",userSelect:"none"}},_?o.default.createElement(u.default,null):null)}t.default=b,b.propTypes={canvasRef:g.isRef}},ea235eb36fa189027c99:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){void 0===s&&(s=n);var r=Object.getOwnPropertyDescriptor(t,n);
2r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,s,r)}:function(e,t,n,s){void 0===s&&(s=n),e[s]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&s(t,e,n);return r(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(n("69084d01d3449fc1bc27")),l=a(n("1e3ec1abca70ca5aa6d0")),c=a(n("d4f4446dc208bee82cb8")),d=a(n("8a5f988325c9849b7bc7")),h=i(n("b7fb4a1b13972a199cb6")),u=a(n("f67da49b2bed2a4ede08")),p=a(n("37eb41e344a00019d6d8")),f=n("e2b736fa2bbef9223e31");t.default=function(){const e=(0,u.default)();(0,c.default)(e,"Unable to find Page context.");const{_className:t,onRenderSuccess:n,onRenderError:s,page:r,rotate:i,scale:a}=e,[g,m]=(0,p.default)(),{value:b,error:_}=g;(0,c.default)(r,"Attempted to render page SVG, but no page was specified.");const v=(0,o.useMemo)(()=>r.getViewport({scale:a,rotation:i}),[r,i,a]);(0,o.useEffect)(function(){m({type:"RESET"})},[r,m,v]),(0,o.useEffect)(function(){if(!r)return;const e=(0,l.default)(r.getOperatorList());return e.promise.then(e=>{new h.SVGGraphics(r.commonObjs,r.objs).getSVG(e,v).then(e=>{m({type:"RESOLVE",value:e})}).catch(e=>{m({type:"REJECT",error:e})})}).catch(e=>{m({type:"REJECT",error:e})}),()=>(0,f.cancelRunningTask)(e)},[r,m,v]),(0,o.useEffect)(()=>{void 0!==b&&(!1!==b?r&&n&&n((0,f.makePageCallback)(r,a)):_&&((0,f.isCancelException)(_)||((0,d.default)(!1,_.toString()),s&&s(_))))},[b]);const{width:y,height:A}=v;return o.default.createElement("div",{className:`${t}__svg`,ref:e=>function(e){if(!e||!b)return;e.firstElementChild||e.appendChild(b);const{width:t,height:n}=v;b.setAttribute("width",`${t}`),b.setAttribute("height",`${n}`)}(e),style:{display:"block",backgroundColor:"white",overflow:"hidden",width:y,height:A,userSelect:"none"}})}},"521381f7ea2803cb8805":function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){void 0===s&&(s=n);var r=Object.getOwnPropertyDescriptor(t,n);
2r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,s,r)}:function(e,t,n,s){void 0===s&&(s=n),e[s]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&s(t,e,n);return r(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(n("69084d01d3449fc1bc27")),l=a(n("1e3ec1abca70ca5aa6d0")),c=a(n("a536c1e0d97ff92e7ee7")),d=a(n("d4f4446dc208bee82cb8")),h=a(n("8a5f988325c9849b7bc7")),u=i(n("b7fb4a1b13972a199cb6")),p=a(n("f67da49b2bed2a4ede08")),f=a(n("37eb41e344a00019d6d8")),g=n("e2b736fa2bbef9223e31");t.default=function(){const e=(0,p.default)();(0,d.default)(e,"Unable to find Page context.");const{customTextRenderer:t,onGetTextError:n,onGetTextSuccess:s,onRenderTextLayerError:r,onRenderTextLayerSuccess:i,page:a,pageIndex:m,pageNumber:b,rotate:_,scale:v}=e,[y,A]=(0,f.default)(),{value:S,error:x}=y,E=(0,o.useRef)(null),C=(0,o.useRef)();(0,d.default)(a,"Attempted to load page text content, but no page was specified."),(0,h.default)(1===parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-text-layer"),10),"TextLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-text-layer"),(0,o.useEffect)(function(){A({type:"RESET"})},[a,A]),(0,o.useEffect)(function(){if(!a)return;const e=(0,l.default)(a.getTextContent()),t=e;return e.promise.then(e=>{A({type:"RESOLVE",value:e})}).catch(e=>{A({type:"REJECT",error:e})}),()=>(0,g.cancelRunningTask)(t)},[a,A]),(0,o.useEffect)(()=>{void 0!==S&&(!1!==S?S&&s&&s(S):x&&((0,h.default)(!1,x.toString()),n&&n(x)))},[S]);const P=(0,o.useCallback)(()=>{i&&i()},[i]),w=(0,o.useCallback)(e=>{(0,h.default)(!1,e.toString()),r&&r(e)},[r]),T=(0,o.useMemo)(()=>a.getViewport({scale:v,rotation:_}),[a,_,v]);return(0,o.useLayoutEffect)(function(){if(!a||!S)return;const{current:e}=E;if(!e)return;e.innerHTML="";const n=a.streamTextContent({includeMarkedContent:!0}),s={container:e,textContentSource:n,viewport:T},r=u.renderTextLayer(s),i=r;return r.promise.then(()=>{const n=document.createElement("div");n.className="endOfContent",e.append(n),C.current=n;const s=Boolean(e.querySelector(".markedContent"))?e.querySelectorAll(".markedContent > *:not(.markedContent"):e.children;if(t){let e=0;S.items.forEach((n,r)=>{if(!function(e){return"str"in e}(n))return;const i=s[e];if(!i)return;const a=t(Object.assign({pageIndex:m,pageNumber:b,itemIndex:r},n));i.innerHTML=a,e+=n.str&&n.hasEOL?2:1})}P()}).catch(w),()=>(0,g.cancelRunningTask)(i)},[t,w,P,a,m,b,S,T]),o.default.createElement("div",{className:(0,c.default)("react-pdf__Page__textContent","textLayer"),onMouseUp:function(){const e=C.current;e&&e.classList.remove("active")},onMouseDown:function(){const e=C.current;e&&e.classList.add("active")},ref:E})}},dc352e49cd7449d6822c:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n("69084d01d3449fc1bc27");t.default=(0,s.createContext)(null)},"3fd1b99df40e95a0f8a1":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={NEED_PASSWORD:1,INCORRECT_PASSWORD:2}},"0c9c170572676cfbad52":(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{constructor({num:e,gen:t}){this.num=e,this.gen=t}toString(){let e=`${this.num}R`;return 0!==this.gen&&(e+=this.gen),e}}},d9971c17758369aa5128:function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){void 0===s&&(s=n);var r=Object.getOwnPropertyDescriptor(t,n);
2r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,s,r)}:function(e,t,n,s){void 0===s&&(s=n),e[s]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&s(t,e,n);return r(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(n("69084d01d3449fc1bc27")),l=a(n("1e3ec1abca70ca5aa6d0")),c=a(n("d4f4446dc208bee82cb8")),d=a(n("8a5f988325c9849b7bc7")),h=a(n("197c6b305d892524041b")),u=a(n("f67da49b2bed2a4ede08")),p=a(n("37eb41e344a00019d6d8")),f=n("e2b736fa2bbef9223e31");t.default=function(){const e=(0,u.default)();(0,c.default)(e,"Unable to find Page context.");const{onGetStructTreeError:t,onGetStructTreeSuccess:n}=e,[s,r]=(0,p.default)(),{value:i,error:a}=s,{customTextRenderer:g,page:m}=e;return(0,o.useEffect)(function(){r({type:"RESET"})},[r,m]),(0,o.useEffect)(function(){if(g)return;if(!m)return;const e=(0,l.default)(m.getStructTree()),t=e;return e.promise.then(e=>{r({type:"RESOLVE",value:e})}).catch(e=>{r({type:"REJECT",error:e})}),()=>(0,f.cancelRunningTask)(t)},[g,m,r]),(0,o.useEffect)(()=>{void 0!==i&&(!1!==i?i&&n&&n(i):a&&((0,d.default)(!1,a.toString()),t&&t(a)))},[i]),i?o.default.createElement(h.default,{className:"react-pdf__Page__structTree structTree",node:i}):null}},"197c6b305d892524041b":function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){void 0===s&&(s=n);var r=Object.getOwnPropertyDescriptor(t,n);
2r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,s,r)}:function(e,t,n,s){void 0===s&&(s=n),e[s]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&s(t,e,n);return r(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(n("69084d01d3449fc1bc27")),l=a(n("f1f2954cff54795efe74")),c=n("2937513fa97113a73311");function d({className:e,node:t}){const n=(0,o.useMemo)(()=>(0,c.getAttributes)(t),[t]),s=(0,o.useMemo)(()=>(0,c.isStructTreeNode)(t)?(0,c.isStructTreeNodeWithOnlyContentChild)(t)?null:t.children.map((e,t)=>o.default.createElement(d,{key:t,node:e})):null,[t]);return o.default.createElement("span",Object.assign({className:e},n),s)}t.default=d,d.propTypes={node:l.default.oneOfType([l.default.shape({children:l.default.object,role:l.default.string}),l.default.shape({id:l.default.string,type:l.default.string})]).isRequired}},cacab3fc74b57f37de8e:function(e,t,n){"use strict";var s=this&&this.__rest||function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(e);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r])&&(n[s[r]]=e[s[r]])}return n},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n("69084d01d3449fc1bc27")),a=r(n("a536c1e0d97ff92e7ee7")),o=r(n("d4f4446dc208bee82cb8")),l=r(n("c81590e7bedffba5e508")),c=n("e2b736fa2bbef9223e31"),d=r(n("a9e84e8478140cd567bb"));t.default=function(e){const t=(0,d.default)();(0,o.default)(t,"Unable to find Document context. Did you wrap <Page /> in <Document />?");const n=Object.assign(Object.assign({},t),e),{className:r,linkService:h,onItemClick:u,pageIndex:p,pageNumber:f}=n,g=(0,c.isProvided)(f)?f-1:null!=p?p:null,m=null!=f?f:(0,c.isProvided)(p)?p+1:null,{className:b,onItemClick:_}=e,v=s(e,["className","onItemClick"]);return i.default.createElement("a",{className:(0,a.default)("react-pdf__Thumbnail",r),href:m?"#":void 0,onClick:function(e){e.preventDefault(),(0,c.isProvided)(g)&&m&&(u?u({pageIndex:g,pageNumber:m}):h.goToPage(m))}},i.default.createElement(l.default,Object.assign({},v,{_className:"react-pdf__Thumbnail__page",_enableRegisterUnregisterPage:!1,renderAnnotationLayer:!1,renderTextLayer:!1})))}},"5f776a2d92fccc43525c":function(e,t,n){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,n,s){void 0===s&&(s=n);var r=Object.getOwnPropertyDescriptor(t,n);
2r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,s,r)}:function(e,t,n,s){void 0===s&&(s=n),e[s]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&s(t,e,n);return r(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.usePageContext=t.useOutlineContext=t.useDocumentContext=t.Thumbnail=t.Page=t.Outline=t.Document=t.pdfjs=void 0;const o=i(n("b7fb4a1b13972a199cb6"));t.pdfjs=o;const l=a(n("7132727f7f00432482ff"));t.Document=l.default;const c=a(n("e95663a7adff05da31c6"));t.Outline=c.default;const d=a(n("c81590e7bedffba5e508"));t.Page=d.default;const h=a(n("cacab3fc74b57f37de8e"));t.Thumbnail=h.default;const u=a(n("a9e84e8478140cd567bb"));t.useDocumentContext=u.default;const p=a(n("960198dd87a0d8944e14"));t.useOutlineContext=p.default;const f=a(n("f67da49b2bed2a4ede08"));t.usePageContext=f.default,(0,n("e2b736fa2bbef9223e31").displayWorkerWarning)(),o.GlobalWorkerOptions.workerSrc="pdf.worker.js"},ce198652c02a0a24bab6:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HEADING_PATTERN=t.PDF_ROLE_TO_HTML_ROLE=void 0,t.PDF_ROLE_TO_HTML_ROLE={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},t.HEADING_PATTERN=/^H(\d+)$/},"212498179a4ceae3f8fd":(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n("69084d01d3449fc1bc27"),r=n("e2b736fa2bbef9223e31");t.default=function(e){const t=(0,s.useRef)(),n=t.current;return(0,r.isDefined)(n)?()=>n:()=>{const n=e();return t.current=n,n}}},a9e84e8478140cd567bb:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n("69084d01d3449fc1bc27"),i=s(n("3299aa1eee097a3fe797"));t.default=function(){return(0,r.useContext)(i.default)}},"960198dd87a0d8944e14":function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n("69084d01d3449fc1bc27"),i=s(n("8b4c2f117325c3e2b3d0"));t.default=function(){return(0,r.useContext)(i.default)}},f67da49b2bed2a4ede08:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n("69084d01d3449fc1bc27"),i=s(n("dc352e49cd7449d6822c"));t.default=function(){return(0,r.useContext)(i.default)}},"37eb41e344a00019d6d8":(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n("69084d01d3449fc1bc27");function r(e,t){switch(t.type){case"RESOLVE":return{value:t.value,error:void 0};case"REJECT":return{value:!1,error:t.error};case"RESET":return{value:void 0,error:void 0};default:return e}}t.default=function(){return(0,s.useReducer)(r,{value:void 0,error:void 0})}},"1f819460d2d90dfb92ab":function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isRotate=t.isRenderMode=t.isRef=t.isPdf=t.isPageNumber=t.isPageIndex=t.isPage=t.isLinkTarget=t.isLinkService=t.isFile=t.isClassName=t.eventProps=void 0;const r=s(n("f1f2954cff54795efe74")),i=n("2689c3796547e0f5bdd2"),a=n("b7fb4a1b13972a199cb6"),o=n("e2b736fa2bbef9223e31"),l=s(n("c339975b0af703fc0132"));t.eventProps=(()=>{const e={};
2return i.allEvents.forEach(t=>{e[t]=r.default.func}),e})();const c=r.default.oneOfType([r.default.instanceOf(Int8Array),r.default.instanceOf(Uint8Array),r.default.instanceOf(Uint8ClampedArray),r.default.instanceOf(Int16Array),r.default.instanceOf(Uint16Array),r.default.instanceOf(Int32Array),r.default.instanceOf(Uint32Array),r.default.instanceOf(Float32Array),r.default.instanceOf(Float64Array)]),d=[r.default.string,r.default.instanceOf(ArrayBuffer),r.default.shape({data:r.default.oneOfType([r.default.string,r.default.instanceOf(ArrayBuffer),r.default.arrayOf(r.default.number.isRequired),c]).isRequired}),r.default.shape({range:r.default.instanceOf(a.PDFDataRangeTransport).isRequired}),r.default.shape({url:r.default.string.isRequired})];"undefined"!=typeof Blob&&d.push(r.default.instanceOf(Blob)),t.isClassName=r.default.oneOfType([r.default.string,r.default.arrayOf(r.default.string)]),t.isFile=r.default.oneOfType(d),t.isLinkService=r.default.instanceOf(l.default),t.isLinkTarget=r.default.oneOf(["_self","_blank","_parent","_top"]),t.isPage=r.default.shape({commonObjs:r.default.shape({}).isRequired,getAnnotations:r.default.func.isRequired,getTextContent:r.default.func.isRequired,getViewport:r.default.func.isRequired,render:r.default.func.isRequired}),t.isPageIndex=function(e,t,n){const{[t]:s,pageNumber:r,pdf:i}=e;if(!(0,o.isDefined)(i))return null;if((0,o.isDefined)(s)){if("number"!=typeof s)return new Error(`\`${t}\` of type \`${typeof s}\` supplied to \`${n}\`, expected \`number\`.`);if(s<0)return new Error(`Expected \`${t}\` to be greater or equal to 0.`);const{numPages:e}=i;if(s+1>e)return new Error(`Expected \`${t}\` to be less or equal to ${e-1}.`)}else if(!(0,o.isDefined)(r))return new Error(`\`${t}\` not supplied. Either pageIndex or pageNumber must be supplied to \`${n}\`.`);return null},t.isPageNumber=function(e,t,n){const{[t]:s,pageIndex:r,pdf:i}=e;if(!(0,o.isDefined)(i))return null;if((0,o.isDefined)(s)){if("number"!=typeof s)return new Error(`\`${t}\` of type \`${typeof s}\` supplied to \`${n}\`, expected \`number\`.`);if(s<1)return new Error(`Expected \`${t}\` to be greater or equal to 1.`);const{numPages:e}=i;if(s>e)return new Error(`Expected \`${t}\` to be less or equal to ${e}.`)}else if(!(0,o.isDefined)(r))return new Error(`\`${t}\` not supplied. Either pageIndex or pageNumber must be supplied to \`${n}\`.`);return null},t.isPdf=r.default.oneOfType([r.default.shape({getDestination:r.default.func.isRequired,getOutline:r.default.func.isRequired,getPage:r.default.func.isRequired,numPages:r.default.number.isRequired}),r.default.bool]),t.isRef=r.default.oneOfType([r.default.func,r.default.exact({current:r.default.any})]),t.isRenderMode=r.default.oneOf(["canvas","none","svg"]),t.isRotate=r.default.oneOf([0,90,180,270])},"2937513fa97113a73311":(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getAttributes=t.getBaseAttributes=t.getRoleAttributes=t.isStructTreeNodeWithOnlyContentChild=t.isStructTreeNode=t.isPdfRole=void 0;const s=n("ce198652c02a0a24bab6");function r(e){return e in s.PDF_ROLE_TO_HTML_ROLE}function i(e){return"children"in e}function a(e){return!!i(e)&&1===e.children.length&&0 in e.children&&"id"in e.children[0]}function o(e){const t={};if(i(e)){const{role:n}=e,i=n.match(s.HEADING_PATTERN);if(i)t.role="heading",t["aria-level"]=Number(i[1]);else if(r(n)){const e=s.PDF_ROLE_TO_HTML_ROLE[n];e&&(t.role=e)}}return t}function l(e){const t={};if(i(e)){if(void 0!==e.alt&&(t["aria-label"]=e.alt),void 0!==e.lang&&(t.lang=e.lang),a(e)){const[n]=e.children;if(n){const e=l(n);return Object.assign(Object.assign({},t),e)}}}else"id"in e&&(t["aria-owns"]=e.id);return t}t.isPdfRole=r,t.isStructTreeNode=i,t.isStructTreeNodeWithOnlyContentChild=a,t.getRoleAttributes=o,t.getBaseAttributes=l,t.getAttributes=function(e){return e?Object.assign(Object.assign({},o(e)),l(e)):null}},e2b736fa2bbef9223e31:function(e,t,n){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.loadFromFile=t.isCancelException=t.makePageCallback=t.cancelRunningTask=t.displayWorkerWarning=t.displayCORSWarning=t.getDevicePixelRatio=t.dataURItoByteString=t.isDataURI=t.
2isBlob=t.isArrayBuffer=t.isString=t.isProvided=t.isDefined=t.isLocalFileSystem=t.isBrowser=void 0;const r=s(n("d4f4446dc208bee82cb8")),i=s(n("8a5f988325c9849b7bc7"));function a(e){return void 0!==e}function o(e){return"string"==typeof e}function l(e){return o(e)&&/^data:/.test(e)}t.isBrowser="undefined"!=typeof document,t.isLocalFileSystem=t.isBrowser&&"file:"===window.location.protocol,t.isDefined=a,t.isProvided=function(e){return a(e)&&null!==e},t.isString=o,t.isArrayBuffer=function(e){return e instanceof ArrayBuffer},t.isBlob=function(e){return(0,r.default)(t.isBrowser,"isBlob can only be used in a browser environment"),e instanceof Blob},t.isDataURI=l,t.dataURItoByteString=function(e){(0,r.default)(l(e),"Invalid data URI.");const[t="",n=""]=e.split(",");return-1!==t.split(";").indexOf("base64")?atob(n):unescape(n)},t.getDevicePixelRatio=function(){return t.isBrowser&&window.devicePixelRatio||1};const c="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";t.displayCORSWarning=function(){(0,i.default)(!t.isLocalFileSystem,`Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ${c}`)},t.displayWorkerWarning=function(){(0,i.default)(!t.isLocalFileSystem,`Loading PDF.js worker may not work on protocols other than HTTP/HTTPS. ${c}`)},t.cancelRunningTask=function(e){e&&e.cancel&&e.cancel()},t.makePageCallback=function(e,t){return Object.defineProperty(e,"width",{get(){return this.view[2]*t},configurable:!0}),Object.defineProperty(e,"height",{get(){return this.view[3]*t},configurable:!0}),Object.defineProperty(e,"originalWidth",{get(){return this.view[2]},configurable:!0}),Object.defineProperty(e,"originalHeight",{get(){return this.view[3]},configurable:!0}),e}
2,t.isCancelException=function(e){return"RenderingCancelledException"===e.name},t.loadFromFile=function(e){return new Promise((t,n)=>{const s=new FileReader;s.onload=()=>{if(!s.result)return n(new Error("Error while reading a file."));t(s.result)},s.onerror=e=>{if(!e.target)return n(new Error("Error while reading a file."));const{error:t}=e.target;if(!t)return n(new Error("Error while reading a file."));switch(t.code){case t.NOT_FOUND_ERR:return n(new Error("Error while reading a file: File not found."));case t.SECURITY_ERR:return n(new Error("Error while reading a file: Security error."));case t.ABORT_ERR:return n(new Error("Error while reading a file: Aborted."));default:return n(new Error("Error while reading a file."))}},s.readAsArrayBuffer(e)})}},b7fb4a1b13972a199cb6:(module,__unused_webpack_exports,__webpack_require__)=>{var Buffer=__webpack_require__("ec247fcea0c84d047768").Buffer,fetch=__webpack_require__("75870528e9f34ba09adb"),process=__webpack_require__("6c0cbd92685546599563"),factory;globalThis,factory=()=>(()=>{"use strict";var __webpack_modules__=[,(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VerbosityLevel=t.Util=t.UnknownErrorException=t.UnexpectedResponseException=t.TextRenderingMode=t.RenderingIntentFlag=t.PromiseCapability=t.PermissionFlag=t.PasswordResponses=t.PasswordException=t.PageActionEventType=t.OPS=t.MissingPDFException=t.MAX_IMAGE_SIZE_TO_CACHE=t.LINE_FACTOR=t.LINE_DESCENT_FACTOR=t.InvalidPDFException=t.ImageKind=t.IDENTITY_MATRIX=t.FormatError=t.FeatureTest=t.FONT_IDENTITY_MATRIX=t.DocumentActionEventType=t.CMapCompressionType=t.BaseException=t.BASELINE_FACTOR=t.AnnotationType=t.AnnotationStateModelType=t.AnnotationReviewState=t.AnnotationReplyType=t.AnnotationMode=t.AnnotationMarkedState=t.AnnotationFlag=t.AnnotationFieldFlag=t.AnnotationEditorType=t.AnnotationEditorPrefix=t.AnnotationEditorParamsType=t.AnnotationBorderStyleType=t.AnnotationActionEventType=t.AbortException=void 0,t.assert=function(e,t){e||i(t)},t.bytesToString=function(e){"object"==typeof e&&void 0!==e?.length||i("Invalid argument for bytesToString");const t=e.length,n=8192;if(t<n)return String.fromCharCode.apply(null,e);const s=[];for(let r=0;r<t;r+=n){const i=Math.min(r+n,t),a=e.subarray(r,i);s.push(String.fromCharCode.apply(null,a))}return s.join("")},t.createValidAbsoluteUrl=function(e,t=null,n=null){if(!e)return null;try{if(n&&"string"==typeof e){if(n.addDefaultProtocol&&e.startsWith("www.")){const t=e.match(/\./g);t?.length>=2&&(e=`http://${e}`)}if(n.tryConvertEncoding)try{e=u(e)}catch(e){}}const s=t?new URL(e,t):new URL(e);if(function(e){switch(e?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(s))return s}catch(e){}return null},t.getModificationDate=function(e=new Date){return[e.getUTCFullYear().toString(),(e.getUTCMonth()+1).toString().padStart(2,"0"),e.getUTCDate().toString().padStart(2,"0"),e.getUTCHours().toString().padStart(2,"0"),e.getUTCMinutes().toString().padStart(2,"0"),e.getUTCSeconds().toString().padStart(2,"0")].join("")},t.getVerbosityLevel=function(){return s},t.info=function(e){s>=n.INFOS&&console.log(`Info: ${e}`)},t.isArrayBuffer=function(e){return"object"==typeof e&&void 0!==e?.byteLength},t.isArrayEqual=function(e,t){if(e.length!==t.length)return!1;for(let n=0,s=e.length;n<s;n++)if(e[n]!==t[n])return!1;return!0},t.normalizeUnicode=function(e){return p||(p=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,f
2=new Map([["ſt","ſt"]])),e.replaceAll(p,(e,t,n)=>t?t.normalize("NFKC"):f.get(n))},t.objectFromMap=function(e){const t=Object.create(null);for(const[n,s]of e)t[n]=s;return t},t.objectSize=function(e){return Object.keys(e).length},t.setVerbosityLevel=function(e){Number.isInteger(e)&&(s=e)},t.shadow=a,t.string32=function(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)},t.stringToBytes=l,t.stringToPDFString=function(e){if(e[0]>="ï"){let t;if("þ"===e[0]&&"ÿ"===e[1]?t="utf-16be":"ÿ"===e[0]&&"þ"===e[1]?t="utf-16le":"ï"===e[0]&&"»"===e[1]&&"¿"===e[2]&&(t="utf-8"),t)try{const n=new TextDecoder(t,{fatal:!0}),s=l(e);return n.decode(s)}catch(e){r(`stringToPDFString: "${e}".`)}}const t=[];for(let n=0,s=e.length;n<s;n++){const s=h[e.charCodeAt(n)];t.push(s?String.fromCharCode(s):e.charAt(n))}return t.join("")},t.stringToUTF8String=u,t.unreachable=i,t.utf8StringToString=function(e){return unescape(encodeURIComponent(e))},t.warn=r,t.IDENTITY_MATRIX=[1,0,0,1,0,0],t.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0],t.MAX_IMAGE_SIZE_TO_CACHE=1e7,t.LINE_FACTOR=1.35,t.LINE_DESCENT_FACTOR=.35;t.BASELINE_FACTOR=.35/1.35,t.RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256},t.AnnotationMode={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},t.AnnotationEditorPrefix="pdfjs_internal_editor_",t.AnnotationEditorType={DISABLE:-1,NONE:0,FREETEXT:3,INK:15},t.AnnotationEditorParamsType={FREETEXT_SIZE:1,FREETEXT_COLOR:2,FREETEXT_OPACITY:3,INK_COLOR:11,INK_THICKNESS:12,INK_OPACITY:13},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"};const n={ERRORS:0,WARNINGS:1,INFOS:5};t.VerbosityLevel=n,t.CMapCompressionType={NONE:0,BINARY:1},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,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91},t.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let s=n.WARNINGS;function r(e){s>=n.WARNINGS&&console.log(`Warning: ${e}`)}function i(e){throw new Error(e)}function a(e,t,n,s=!1){return Object.defineProperty(e,t,{value:n,enumerable:!s,configurable:!0,writable:!1}),n}const o=function(){function e(t,n){this.constructor===e&&i("Cannot initialize BaseException."),this.message=t,this.name=n}return e.prototype=new Error,e.constructor=e,e}();function l(e){"string"!=typeof e&&i("Invalid argument for stringToBytes");const t=e.length,n=new Uint8Array(t);for(let s=0;s<t;++s)n[s]=255&e.charCodeAt(s);return n}t.BaseException=o,t.PasswordException=class extends o{constructor(e,t){super(e,"PasswordException"),this.code=t}},t.UnknownErrorException=class extends o{constructor(e,t){super(e,"UnknownErrorException"),this.details=t}},t.InvalidPDFException=class extends o{constructor(e){super(e,"InvalidPDFException")}},t.MissingPDFException=class extends o{constructor(e){super(e,"MissingPDFException")}},t.UnexpectedResponseException=class extends o{constructor(e,t){super(e,"UnexpectedResponseException"),this.status=t}},t.FormatError=class extends o{constructor(e){super(e,"FormatError")}},t.AbortException=class extends o{constructor(e){super(e,"AbortException")}},t.FeatureTest=class{static get isLittleEndian(){return a(this,"isLittleEndian",function(){const e=new Uint8Array(4);return e[0]=1,1===new Uint32Array(e.buffer,0,1)[0]}())}static get isEvalSupported(){return a(this,"isEvalSupported",function(){try{return new Function(""),!0}catch(e){return!1}}())}static get isOffscreenCanvasSupported(){return a(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get platform(){return"undefined"==typeof navigator?a(this,"platform",{isWin:!1,isMac:!1}):a(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}};const c=[...Array(256).keys()].map(e=>e.toString(16).padStart(2,"0"));class d{static makeHexColor(e,t,n){return`#${c[e]}${c[t]}${c[n]}`}static scaleMinMax(e,t){let n;e[0]?(e[0]<0&&(n=t[0],t[0]=t[1],t[1]=n),t[0]*=e[0],t[1]*=e[0],e[3]<0&&(n=t[2],t[2]=t[3],t[3]=n),t[2]*=e[3],t[3]*=e[3]):(n=t[0],t[0]=t[2],t[2]=n,n=t[1],t[1]=t[3],t[3]=n,e[1]<0&&(n=t[2],t[2]=t[3],t[3]=n),t[2]*=e[1],t[3]*=e[1],e[2]<0&&(n=t[0],t[0]=t[1],t[1]=n),t[0]*=e[2],t[1]*=e[2]),t[0]+=e[4],t[1]+=e[4],t[2]+=e[5],t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static applyTransform(e,t){return[e[0]*t[0]+e[1]*t[2]+t[4],e[0]*t[1]+e[1]*t[3]+t[5]]}static applyInverseTransform(e,t){const n=t[0]*t[3]-t[1]*t[2];return[(e[0]*t[3]-e[1]*t[2]+t[2]*t[5]-t[4]*t[3])/n,(-e[0]*t[1]+e[1]*t[0]+t[4]*t[1]-t[5]*t[0])/n]}static getAxialAlignedBoundingBox(e,t){const n=d.applyTransform(e,t),s=d.applyTransform(e.slice(2,4),t),r=d.applyTransform([e[0],e[3]],t),i=d.applyTransform([e[2],e[1]],t);return[Math.min(n[0],s[0],r[0],i[0]),Math.min(n[1],s[1],r[1],i[1]),Math.max(n[0],s[0],r[0],i[0]),Math.max(n[1],s[1],r[1],i[1])]}static inverseTransform(e){const t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e){const t=[e[0],e[2],e[1],e[3]],n=e[0]*t[0]+e[1]*t[2],s=e[0]*t[1]+e[1]*t[3],r=e[2]*t[0]+e[3]*t[2],i=e[2]*t[1]+e[3]*t[3],a=(n+i)/2,o=Math.sqrt((n+i)**2-4*(n*i-r*s))/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){const n=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),s=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(n>s)return null;const r=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),i=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return r>i?null:[n,r,s,i]}static bezierBoundingBox(e,t,n,s,r,i,a,o){const l=[],c=[[],[]];let d,h,u,p,f,g,m,b;for(let c=0;c<2;++c)if(0===c?(h=6*e-12*n+6*r,d=-3*e+9*n-9*r+3*a,u=3*n-3*e):(h=6*t-12*s+6*i,d=-3*t+9*s-9*i+3*o,u=3*s-3*t),Math.abs(d)<1e-12){if(Math.abs(h)<1e-12)continue;p=-u/h,0<p&&p<1&&l.push(p)}else m=h*h-4*u*d,b=Math.sqrt(m),m<0||(f=(-h+b)/(2*d),0<f&&f<1&&l.push(f),g=(-h-b)/(2*d),0<g&&g<1&&l.push(g));let _,v=l.length;const y=v;for(;v--;)p=l[v],_=1-p,c[0][v]=_*_*_*e+3*_*_*p*n+3*_*p*p*r+p*p*p*a,c[1][v]=_*_*_*t+3*_*_*p*s+3*_*p*p*i+p*p*p*o;
2return c[0][y]=e,c[1][y]=t,c[0][y+1]=a,c[1][y+1]=o,c[0].length=c[1].length=y+2,[Math.min(...c[0]),Math.min(...c[1]),Math.max(...c[0]),Math.max(...c[1])]}}t.Util=d;const h=[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];function u(e){return decodeURIComponent(escape(e))}t.PromiseCapability=class{#e=!1;constructor(){this.promise=new Promise((e,t)=>{this.resolve=t=>{this.#e=!0,e(t)},this.reject=e=>{this.#e=!0,t(e)}})}get settled(){return this.#e}};let p=null,f=null},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.build=exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,exports.getDocument=getDocument,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(3),_display_utils=__w_pdfjs_require__(6),_font_loader=__w_pdfjs_require__(9),_canvas=__w_pdfjs_require__(11),_worker_options=__w_pdfjs_require__(14),_is_node=__w_pdfjs_require__(10),_message_handler=__w_pdfjs_require__(15),_metadata=__w_pdfjs_require__(16),_optional_content_config=__w_pdfjs_require__(17),_transport_stream=__w_pdfjs_require__(18),_xfa_text=__w_pdfjs_require__(19);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3;let DefaultCanvasFactory=_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;let DefaultCMapReaderFactory=_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;let DefaultFilterFactory=_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;let DefaultStandardFontDataFactory=_display_utils.DOMStandardFontDataFactory,createPDFNetworkStream;if(exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory,_is_node.isNodeJS){const{NodeCanvasFactory:e,NodeCMapReaderFactory:t,NodeFilterFactory:n,NodeStandardFontDataFactory:s}=__w_pdfjs_require__(20);exports.DefaultCanvasFactory=DefaultCanvasFactory=e,exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory=t,exports.DefaultFilterFactory=DefaultFilterFactory=n,exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory=s}if(_is_node.isNodeJS){const{PDFNodeStream:e}=__w_pdfjs_require__(21);createPDFNetworkStream=t=>new e(t)}else{const{PDFNetworkStream:e}=__w_pdfjs_require__(24),{PDFFetchStream:t}=__w_pdfjs_require__(25);createPDFNetworkStream=n=>(0,_display_utils.isValidFetchUrl)(n.url)?new t(n):new e(n)}function getDocument(e){if("string"==typeof e||e instanceof URL?e={url:e}:(0,_util.isArrayBuffer)(e)&&(e={data:e}),"object"!=typeof e)throw new Error("Invalid parameter in getDocument, need parameter object.");if(!e.url&&!e.data&&!e.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const t=new PDFDocumentLoadingTask,{docId:n}=t,s=e.url?getUrlProp(e.url):null,r=e.data?getDataProp(e.data):null,i=e.httpHeaders||null,a=!0===e.withCredentials,o=e.password??null,l=e.range instanceof PDFDataRangeTransport?e.range:null,c=Number.isInteger(e.rangeChunkSize)&&e.rangeChunkSize>0?e.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let d=e.worker instanceof PDFWorker?e.worker:null;const h=e.verbosity,u="string"!=typeof e.docBaseUrl||(0,_display_utils.isDataScheme)(e.docBaseUrl)?null:e.docBaseUrl,p="string"==typeof e.cMapUrl?e.cMapUrl:null,f=!1!==e.cMapPacked,g=e.CMapReaderFactory||DefaultCMapReaderFactory,m="string"==typeof e.standardFontDataUrl?e.standardFontDataUrl:null,b=e.StandardFontDataFactory||DefaultStandardFontDataFactory,_=!0!==e.stopAtErrors,v=Number.isInteger(e.maxImageSize)&&e.maxImageSize>-1?e.maxImageSize:-1,y=!1!==e.isEvalSupported,A="boolean"==typeof e.isOffscreenCanvasSupported?e.isOffscreenCanvasSupported:!_is_node.isNodeJS,S=Number.isInteger(e.canvasMaxAreaInBytes)?e.canvasMaxAreaInBytes:-1,x="boolean"==typeof e.disableFontFace?e.disableFontFace:_is_node.isNodeJS,E=!0===e.fontExtraProperties,C=!0===e.enableXfa,P=e.ownerDocument||globalThis.document,w=!0===e.disableRange,T=!0===e.disableStream,k=!0===e.disableAutoFetch,R=!0===e.pdfBug,M=l?l.length:e.length??NaN,F="boolean"==typeof e.useSystemFonts?e.useSystemFonts:!_is_node.isNodeJS&&!x,O="boolean"==typeof e.useWorkerFetch?e.useWorkerFetch:g===_display_utils.DOMCMapReaderFactory&&b===_display_utils.DOMStandardFontDataFactory&&(0,_display_utils.isValidFetchUrl)(p,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(m,document.baseURI),D=e.canvasFactory||new DefaultCanvasFactory({ownerDocument:P}),I=e.filterFactory||new DefaultFilterFactory({docId:n,ownerDocument:P});(0,_util.setVerbosityLevel)(h);const L={canvasFactory:D,filterFactory:I};if(O||(L.cMapReaderFactory=new g({baseUrl:p,isCompressed:f}),L.standardFontDataFactory=new b({baseUrl:m})),!d){const e={verbosity:h,port:_worker_options.GlobalWorkerOptions.workerPort};d=e.port?PDFWorker.fromPort(e):new PDFWorker(e),t._worker=d}const N={docId:n,apiVersion:"3.6.172",data:r,password:o,disableAutoFetch:k,rangeChunkSize:c,length:M,docBaseUrl:u,enableXfa:C,evaluatorOptions:{maxImageSize:v,disableFontFace:x,ignoreErrors:_,isEvalSupported:y,isOffscreenCanvasSupported:A,canvasMaxAreaInBytes:S,fontExtraProperties:E,useSystemFonts:F,cMapUrl:O?p:null,standardFontDataUrl:O?m:null}},j={ignoreErrors:_,isEvalSupported:y,disableFontFace:x,fontExtraProperties:E,enableXfa:C,ownerDocument:P,disableAutoFetch:k,pdfBug:R,styleElement:null};return d.promise.then(function(){if(t.destroyed)throw new Error("Loading aborted");const e=_fetchDocument(d,N),o=new Promise(function(e){let t;l?t=new _transport_stream.PDFDataTransportStream({length:M,initialData:l.initialData,progressiveDone:l.progressiveDone,contentDispositionFilename:l.contentDispositionFilename,disableRange:w,disableStream:T},l):r||(t=createPDFNetworkStream({url:s,length:M,httpHeaders:i,withCredentials:a,rangeChunkSize:c,disableRange:w,disableStream:T})),e(t)}
2);return Promise.all([e,o]).then(function([e,s]){if(t.destroyed)throw new Error("Loading aborted");const r=new _message_handler.MessageHandler(n,e,d.port),i=new WorkerTransport(r,t,s,j,L);t._transport=i,r.send("Ready",null)})}).catch(t._capability.reject),t}async function _fetchDocument(e,t){if(e.destroyed)throw new Error("Worker was destroyed");const n=await e.messageHandler.sendWithPromise("GetDocRequest",t,t.data?[t.data.buffer]:null);if(e.destroyed)throw new Error("Worker was destroyed");return n}function getUrlProp(e){if(e instanceof URL)return e.href;try{return new URL(e,window.location).href}catch(t){if(_is_node.isNodeJS&&"string"==typeof e)return e}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(e){if(_is_node.isNodeJS&&void 0!==Buffer&&e instanceof Buffer)return(0,_display_utils.deprecated)("Please provide binary data as `Uint8Array`, rather than `Buffer`."),new Uint8Array(e);if(e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength)return e;if("string"==typeof e)return(0,_util.stringToBytes)(e);if("object"==typeof e&&!isNaN(e?.length)||(0,_util.isArrayBuffer)(e))return new Uint8Array(e);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}class PDFDocumentLoadingTask{static#t=0;constructor(){this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId="d"+PDFDocumentLoadingTask.#t++,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0,await(this._transport?.destroy()),this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(e,t,n=!1,s=null){this.length=e,this.initialData=t,this.progressiveDone=n,this.contentDispositionFilename=s,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(e){this._rangeListeners.push(e)}addProgressListener(e){this._progressListeners.push(e)}addProgressiveReadListener(e){this._progressiveReadListeners.push(e)}addProgressiveDoneListener(e){this._progressiveDoneListeners.push(e)}onDataRange(e,t){for(const n of this._rangeListeners)n(e,t)}onDataProgress(e,t){this._readyCapability.promise.then(()=>{for(const n of this._progressListeners)n(e,t)})}onDataProgressiveRead(e){this._readyCapability.promise.then(()=>{for(const t of this._progressiveReadListeners)t(e)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const e of this._progressiveDoneListeners)e()})}transportReady(){this._readyCapability.resolve()}requestDataRange(e,t){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(e,t){this._pdfInfo=e,this._transport=t}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}
2getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJavaScript(){return this._transport.getJavaScript()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{#n=null;#s=!1;constructor(e,t,n,s=!1){this._pageIndex=e,this._pageInfo=t,this._transport=n,this._stats=s?new _display_utils.StatTimer:null,this._pdfBug=s,this.commonObjs=n.commonObjs,this.objs=new PDFObjects,this._maybeCleanupAfterRender=!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:s=0,dontFlip:r=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:e,rotation:t,offsetX:n,offsetY:s,dontFlip:r})}getAnnotations({intent:e="display"}={}){const t=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,t.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:e,viewport:t,intent:n="display",annotationMode:s=_util.AnnotationMode.ENABLE,transform:r=null,background:i=null,optionalContentConfigPromise:a=null,annotationCanvasMap:o=null,pageColors:l=null,printAnnotationStorage:c=null}){if(arguments[0]?.canvasFactory)throw new Error("render no longer accepts the `canvasFactory`-option, please pass it to the `getDocument`-function instead.");this._stats?.time("Overall");const d=this._transport.getRenderingIntent(n,s,c);this.#s=!1,this.#r(),a||(a=this._transport.getOptionalContentConfig());let h=this._intentStates.get(d.cacheKey);h||(h=Object.create(null),this._intentStates.set(d.cacheKey,h)),h.streamReaderCancelTimeout&&(clearTimeout(h.streamReaderCancelTimeout),h.streamReaderCancelTimeout=null);const u=!!(d.renderingIntent&_util.RenderingIntentFlag.PRINT);h.displayReadyCapability||(h.displayReadyCapability=new _util.PromiseCapability,h.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(d));const p=e=>{h.renderTasks.delete(f),(this._maybeCleanupAfterRender||u)&&(this.#s=!0),this.#i(!u),e?(f.capability.reject(e),this._abortOperatorList({intentState:h,reason:e instanceof Error?e:new Error(e)})):f.capability.resolve(),this._stats?.timeEnd("Rendering"),this._stats?.timeEnd("Overall")},f=new InternalRenderTask({callback:p,params:{canvasContext:e,viewport:t,transform:r,background:i},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:o,operatorList:h.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!u,pdfBug:this._pdfBug,page
2Colors:l});(h.renderTasks||=new Set).add(f);const g=f.task;return Promise.all([h.displayReadyCapability.promise,a]).then(([e,t])=>{this.#s?p():(this._stats?.time("Rendering"),f.initializeGraphics({transparency:e,optionalContentConfig:t}),f.operatorListChanged())}).catch(p),g}getOperatorList({intent:e="display",annotationMode:t=_util.AnnotationMode.ENABLE,printAnnotationStorage:n=null}={}){const s=this._transport.getRenderingIntent(e,t,n,!0);let r,i=this._intentStates.get(s.cacheKey);return i||(i=Object.create(null),this._intentStates.set(s.cacheKey,i)),i.opListReadCapability||(r=Object.create(null),r.operatorListChanged=function(){i.operatorList.lastChunk&&(i.opListReadCapability.resolve(i.operatorList),i.renderTasks.delete(r))},i.opListReadCapability=new _util.PromiseCapability,(i.renderTasks||=new Set).add(r),i.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(s)),i.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:t=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===e,disableNormalization:!0===t},{highWaterMark:100,size:e=>e.items.length})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(e=>_xfa_text.XfaText.textContent(e));const t=this.streamTextContent(e);return new Promise(function(e,n){const s=t.getReader(),r={items:[],styles:Object.create(null)};!function t(){s.read().then(function({value:n,done:s}){s?e(r):(Object.assign(r.styles,n.styles),r.items.push(...n.items),t())},n)}()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const e=[];for(const t of this._intentStates.values())if(this._abortOperatorList({intentState:t,reason:new Error("Page was destroyed."),force:!0}),!t.opListReadCapability)for(const n of t.renderTasks)e.push(n.completed),n.cancel();return this.objs.clear(),this.#s=!1,this.#r(),Promise.all(e)}cleanup(e=!1){this.#s=!0;const t=this.#i(!1);return e&&t&&(this._stats&&=new _display_utils.StatTimer),t}#i(e=!1){if(this.#r(),!this.#s)return!1;if(e)return this.#n=setTimeout(()=>{this.#n=null,this.#i(!1)},DELAYED_CLEANUP_TIMEOUT),!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.#s=!1,!0}#r(){this.#n&&(clearTimeout(this.#n),this.#n=null)}_startRenderPage(e,t){const n=this._intentStates.get(t);n&&(this._stats?.timeEnd("Page Request"),n.displayReadyCapability?.resolve(e))}_renderPageChunk(e,t){for(let n=0,s=e.length;n<s;n++)t.operatorList.fnArray.push(e.fnArray[n]),t.operatorList.argsArray.push(e.argsArray[n]);t.operatorList.lastChunk=e.lastChunk,t.operatorList.separateAnnots=e.separateAnnots;for(const e of t.renderTasks)e.operatorListChanged();e.lastChunk&&this.#i(!0)}_pumpOperatorList({renderingIntent:e,cacheKey:t,annotationStorageMap:n}){const s=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:t,annotationStorage:n}).getReader(),r=this._intentStates.get(t);r.streamReader=s;const i=()=>{s.read().then(({value:e,done:t})=>{t?r.streamReader=null:this._transport.destroyed||(this._renderPageChunk(e,r),i())},e=>{if(r.streamReader=null,!this._transport.destroyed){if(r.operatorList){r.operatorList.lastChunk=!0;for(const e of r.renderTasks)e.operatorListChanged();this.#i(!0)}if(r.displayReadyCapability)r.displayReadyCapability.reject(e);else{if(!r.opListReadCapability)throw e;r.opListReadCapability.reject(e)}}})};i()}_abortOperatorList({intentState:e,reason:t,force:n=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!n){if(e.renderTasks.size>0)return;if(t instanceof _display_utils.RenderingCancelledException){let n=RENDERING_CANCELLED_TIMEOUT;return t.extraDelay>0&&t.extraDelay<1e3&&(n+=t.extraDelay),void(e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:t,force:!0})},n))}}if(e.streamReader.cancel(new _util.AbortException(t.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(const[t,n]of this._intentStates)if(n===e){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{#a=new Set;#o=Promise.resolve();postMessage(e,t){const n={data:structuredClone(e,t?{transfer:t}:null)};this.#o.then(()=>{for(const e of this.#a)e.call(this,n)})}addEventListener(e,t){this.#a.add(t)}removeEventListener(e,t){this.#a.delete(t)}terminate(){this.#a.clear()}}exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};if(exports.PDFWorkerUtil=PDFWorkerUtil,_is_node.isNodeJS)PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if("object"==typeof document){const e=document?.currentScript?.src;e&&(PDFWorkerUtil.fallbackWorkerSrc=e.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(e,t){let n;try{if(n=new URL(e),!n.origin||"null"===n.origin)return!1}catch(e){return!1}const s=new URL(t,n);return n.origin===s.origin},PDFWorkerUtil.createCDNWrapper=function(e){const t=`importScripts("${e}");`;return URL.createObjectURL(new Blob([t]))};class PDFWorker{static#l=new WeakMap;constructor({name:e=null,port:t=null,verbosity:n=(0,_util.getVerbosityLevel)()}={}){if(t&&PDFWorker.#l.has(t))throw new Error("Cannot use more than one PDFWorker per port.");if(this.name=e,this.destroyed=!1,this.verbosity=n,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,t)return PDFWorker.#l.set(t,this),void this._initializeFromPort(t);this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(e){this._port=e,this._messageHandler=new _message_handler.MessageHandler("main","worker",e),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:e}=PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,e)||(e=PDFWorkerUtil.createCDNWrapper(new URL(e,window.location).href));const t=new Worker(e),n=new _message_handler.MessageHandler("main","worker",t),s=()=>{t.removeEventListener("error",r),n.destroy(),t.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},r=()=>{this._webWorker||s()};t.addEventListener("error",r),n.on("test",e=>{t.removeEventListener("error",r),this.destroyed?s():e?(this._messageHandler=n,this._port=t,this._webWorker=t,this._readyCapability.resolve(),n.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),n.destroy(),t.terminate())}),n.on("ready",e=>{if(t.removeEventListener("error",r),this.destroyed)s();else try{i()}catch(e){this._setupFakeWorker()}});const i=()=>{const e=new Uint8Array;n.send("test",e,[e.buffer])};return void i()}catch(e){(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),PDFWorker._setupFakeWorkerGlobal.then(e=>{if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));const t=new LoopbackPort;this._port=t;const n="fake"+PDFWorkerUtil.fakeWorkerId++,s=new _message_handler.MessageHandler(n+"_worker",n,t);e.setup(s,t);const r=new _message_handler.MessageHandler(n,n+"_worker",t);this._messageHandler=r,this._readyCapability.resolve(),r.send("configure",{verbosity:this.verbosity})}).catch(e=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${e.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),PDFWorker.#l.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(e){if(!e?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return this.#l.has(e.port)?this.#l.get(e.port):new PDFWorker(e)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(null!==PDFWorkerUtil.fallbackWorkerSrc)return _is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch(e){return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node.isNodeJS){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}}exports.PDFWorker=PDFWorker;class WorkerTransport{#c=new Map;#d=new Map;#h=new Map;constructor(e,t,n,s,r){this.messageHandler=e,this.loadingTask=t,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:s.ownerDocument,styleElement:s.styleElement}),this._params=s,this.canvasFactory=r.canvasFactory,this.filterFactory=r.filterFactory,this.cMapReaderFactory=r.cMapReaderFactory,this.standardFontDataFactory=r.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this._networkStream=n,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}#u(e,t=null){const n=this.#c.get(e);if(n)return n;
2const s=this.messageHandler.sendWithPromise(e,t);return this.#c.set(e,s),s}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(e,t=_util.AnnotationMode.ENABLE,n=null,s=!1){let r=_util.RenderingIntentFlag.DISPLAY,i=null;switch(e){case"any":r=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":r=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${e}`)}switch(t){case _util.AnnotationMode.DISABLE:r+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:r+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:r+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,i=(r&_util.RenderingIntentFlag.PRINT&&n instanceof _annotation_storage.PrintAnnotationStorage?n:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${t}`)}return s&&(r+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:r,cacheKey:`${r}_${_annotation_storage.AnnotationStorage.getHash(i)}`,annotationStorageMap:i}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const t of this.#d.values())e.push(t._destroy());this.#d.clear(),this.#h.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const t=this.messageHandler.sendWithPromise("Terminate",null);return e.push(t),Promise.all(e).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#c.clear(),this.filterFactory.destroy(),this._networkStream&&this._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:t}=this;e.on("GetReader",(e,t)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=e=>{this._lastProgress={loaded:e.loaded,total:e.total}},t.onPull=()=>{this._fullReader.read().then(function({value:e,done:n}){n?t.close():((0,_util.assert)(e instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),t.enqueue(new Uint8Array(e),1,[e]))}).catch(e=>{t.error(e)})},t.onCancel=e=>{this._fullReader.cancel(e),t.ready.catch(e=>{if(!this.destroyed)throw e})}}),e.on("ReaderHeadersReady",e=>{const n=new _util.PromiseCapability,s=this._fullReader;return s.headersReady.then(()=>{s.isStreamingSupported&&s.isRangeSupported||(this._lastProgress&&t.onProgress?.(this._lastProgress),s.onProgress=e=>{t.onProgress?.({loaded:e.loaded,total:e.total})}),n.resolve({isStreamingSupported:s.isStreamingSupported,isRangeSupported:s.isRangeSupported,contentLength:s.contentLength})},n.reject),n.promise}),e.on("GetRangeReader",(e,t)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const n=this._networkStream.getRangeReader(e.begin,e.end);n?(t.onPull=()=>{n.read().then(function({value:e,done:n}){n?t.close():((0,_util.assert)(e instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),t.enqueue(new Uint8Array(e),1,[e]))}).catch(e=>{t.error(e)})},t.onCancel=e=>{n.cancel(e),t.ready.catch(e=>{if(!this.destroyed)throw e})}):t.close()}),e.on("GetDoc",({pdfInfo:e})=>{this._numPages=e.numPages,this._htmlForXfa=e.htmlForXfa,delete e.htmlForXfa,t._capability.resolve(new PDFDocumentProxy(e,this))}),e.on("DocException",function(e){let n;switch(e.name){case"PasswordException":n=new _util.PasswordException(e.message,e.code);break;case"InvalidPDFException":n=new _util.InvalidPDFException(e.message);break;case"MissingPDFException":n=new _util.MissingPDFException(e.message);break;case"UnexpectedResponseException":n=new _util.UnexpectedResponseException(e.message,e.status);break;case"UnknownErrorException":n=new _util.UnknownErrorException(e.message,e.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}t._capability.reject(n)}),e.on("PasswordRequest",e=>{if(this._passwordCapability=new _util.PromiseCapability,t.onPassword){const n=e=>{e instanceof Error?this._passwordCapability.reject(e):this._passwordCapability.resolve({password:e})};try{t.onPassword(n,e.code)}catch(e){this._passwordCapability.reject(e)}}else this._passwordCapability.reject(new _util.PasswordException(e.message,e.code));return this._passwordCapability.promise}),e.on("DataLoaded",e=>{t.onProgress?.({loaded:e.length,total:e.length}),this.downloadInfoCapability.resolve(e)}),e.on("StartRenderPage",e=>{this.destroyed||this.#d.get(e.pageIndex)._startRenderPage(e.transparency,e.cacheKey)}),e.on("commonobj",([t,n,s])=>{if(!this.destroyed&&!this.commonObjs.has(t))switch(n){case"Font":const r=this._params;if("error"in s){const e=s.error;(0,_util.warn)(`Error during font loading: ${e}`),this.commonObjs.resolve(t,e);break}const i=r.pdfBug&&globalThis.FontInspector?.enabled?(e,t)=>globalThis.FontInspector.fontAdded(e,t):null,a=new _font_loader.FontFaceObject(s,{isEvalSupported:r.isEvalSupported,disableFontFace:r.disableFontFace,ignoreErrors:r.ignoreErrors,inspectFont:i});this.fontLoader.bind(a).catch(n=>
2e.sendWithPromise("FontFallback",{id:t})).finally(()=>{!r.fontExtraProperties&&a.data&&(a.data=null),this.commonObjs.resolve(t,a)});break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(t,s);break;default:throw new Error(`Got unknown common object type ${n}`)}}),e.on("obj",([e,t,n,s])=>{if(this.destroyed)return;const r=this.#d.get(t);if(!r.objs.has(e))switch(n){case"Image":if(r.objs.resolve(e,s),s){let e;if(s.bitmap){const{width:t,height:n}=s;e=t*n*4}else e=s.data?.length||0;e>_util.MAX_IMAGE_SIZE_TO_CACHE&&(r._maybeCleanupAfterRender=!0)}break;case"Pattern":r.objs.resolve(e,s);break;default:throw new Error(`Got unknown object type ${n}`)}}),e.on("DocProgress",e=>{this.destroyed||t.onProgress?.({loaded:e.loaded,total:e.total})}),e.on("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.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){return this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead."),this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:this.annotationStorage.serializable,filename:this._fullReader?.filename??null}).finally(()=>{this.annotationStorage.resetModified()})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));const t=e-1,n=this.#h.get(t);if(n)return n;const s=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.pdfBug);return this.#d.set(t,n),n});return this.#h.set(t,s),s}getPageIndex(e){return"object"!=typeof e||null===e||!Number.isInteger(e.num)||e.num<0||!Number.isInteger(e.gen)||e.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen})}getAnnotations(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:t})}getFieldObjects(){return this.#u("GetFieldObjects")}hasJSActions(){return this.#u("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return"string"!=typeof e?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getJavaScript(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}getDocJSActions(){return this.messageHandler.sendWithPromise("GetDocJSActions",null)}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(e=>new _optional_content_config.OptionalContentConfig(e))}
2getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata",t=this.#c.get(e);if(t)return t;const n=this.messageHandler.sendWithPromise(e,null).then(e=>({info:e[0],metadata:e[1]?new _metadata.Metadata(e[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#c.set(e,n),n}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const e of this.#d.values())if(!e.cleanup())throw new Error(`startCleanup: Page ${e.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),this.#c.clear(),this.filterFactory.destroy(!0)}}get loadingParams(){const{disableAutoFetch:e,enableXfa:t}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:e,enableXfa:t})}}class PDFObjects{#p=Object.create(null);#f(e){return this.#p[e]||(this.#p[e]={capability:new _util.PromiseCapability,data:null})}get(e,t=null){if(t){const n=this.#f(e);return n.capability.promise.then(()=>t(n.data)),null}const n=this.#p[e];if(!n?.capability.settled)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return n.data}has(e){const t=this.#p[e];return t?.capability.settled||!1}resolve(e,t=null){const n=this.#f(e);n.data=t,n.capability.resolve()}clear(){for(const e in this.#p){const{data:t}=this.#p[e];t?.bitmap?.close()}this.#p=Object.create(null)}}class RenderTask{#g=null;constructor(e){this.#g=e,this.onContinue=null}get promise(){return this.#g.capability.promise}cancel(e=0){this.#g.cancel(null,e)}get separateAnnots(){const{separateAnnots:e}=this.#g.operatorList;if(!e)return!1;const{annotationCanvasMap:t}=this.#g;return e.form||e.canvas&&t?.size>0}}exports.RenderTask=RenderTask;class InternalRenderTask{static#m=new WeakSet;constructor({callback:e,params:t,objs:n,commonObjs:s,annotationCanvasMap:r,operatorList:i,pageIndex:a,canvasFactory:o,filterFactory:l,useRequestAnimationFrame:c=!1,pdfBug:d=!1,pageColors:h=null}){this.callback=e,this.params=t,this.objs=n,this.commonObjs=s,this.annotationCanvasMap=r,this.operatorListIdx=null,this.operatorList=i,this._pageIndex=a,this.canvasFactory=o,this.filterFactory=l,this._pdfBug=d,this.pageColors=h,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===c&&"undefined"!=typeof window,this.cancelled=!1,this.capability=new _util.PromiseCapability,this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=t.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:e=!1,optionalContentConfig:t}){if(this.cancelled)return;if(this._canvas){if(InternalRenderTask.#m.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");InternalRenderTask.#m.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:n,viewport:s,transform:r,background:i}=this.params;this.gfx=new _canvas.CanvasGraphics(n,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:t},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:r,viewport:s,transparency:e,background:i}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(e=null,t=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this._canvas&&InternalRenderTask.#m.delete(this._canvas),this.callback(e||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,"canvas",t))}operatorListChanged(){this.graphicsReady?(this.stepper?.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||=this._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)}
2):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.pageColors),this._canvas&&InternalRenderTask.#m.delete(this._canvas),this.callback())))}}const version="3.6.172";exports.version=version;const build="4d3dfe254";exports.build=build},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PrintAnnotationStorage=t.AnnotationStorage=void 0;var s=n(1),r=n(4),i=n(8);class a{#b=!1;#_=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,t){const n=this.#_.get(e);return void 0===n?t:Object.assign(t,n)}getRawValue(e){return this.#_.get(e)}remove(e){if(this.#_.delete(e),0===this.#_.size&&this.resetModified(),"function"==typeof this.onAnnotationEditor){for(const e of this.#_.values())if(e instanceof r.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(e,t){const n=this.#_.get(e);let s=!1;if(void 0!==n)for(const[e,r]of Object.entries(t))n[e]!==r&&(s=!0,n[e]=r);else s=!0,this.#_.set(e,t);s&&this.#v(),t instanceof r.AnnotationEditor&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(t.constructor._type)}has(e){return this.#_.has(e)}getAll(){return this.#_.size>0?(0,s.objectFromMap)(this.#_):null}setAll(e){for(const[t,n]of Object.entries(e))this.setValue(t,n)}get size(){return this.#_.size}#v(){this.#b||(this.#b=!0,"function"==typeof this.onSetModified&&this.onSetModified())}resetModified(){this.#b&&(this.#b=!1,"function"==typeof this.onResetModified&&this.onResetModified())}get print(){return new o(this)}get serializable(){if(0===this.#_.size)return null;const e=new Map;for(const[t,n]of this.#_){const s=n instanceof r.AnnotationEditor?n.serialize():n;s&&e.set(t,s)}return e}static getHash(e){if(!e)return"";const t=new i.MurmurHash3_64;for(const[n,s]of e)t.update(`${n}:${JSON.stringify(s)}`);return t.hexdigest()}}t.AnnotationStorage=a;class o extends a{#y=null;constructor(e){super(),this.#y=structuredClone(e.serializable)}get print(){(0,s.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#y}}t.PrintAnnotationStorage=o},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationEditor=void 0;var s=n(5),r=n(1);class i{#A=this.focusin.bind(this);#S=this.focusout.bind(this);#x=!1;#E=!1;#C=!1;_uiManager=null;#P=i._zIndex++;static _colorManager=new s.ColorManager;static _zIndex=1;constructor(e){this.constructor===i&&(0,r.unreachable)("Cannot initialize AnnotationEditor."),this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager;const{rotation:t,rawDims:{pageWidth:n,pageHeight:s,pageX:a,pageY:o}}=this.parent.viewport;this.rotation=t,this.pageRotation=(360+t-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[n,s],this.pageTranslation=[a,o];const[l,c]=this.parentDimensions;this.x=e.x/l,this.y=e.y/c,this.isAttachedToDOM=!1}static get _defaultLineColor(){return(0,r.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#P}setParent(e){null!==e&&(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions),this.parent=e}focusin(e){this.#x?this.#x=!1:this.parent.setSelected(this)}focusout(e){if(!this.isAttachedToDOM)return;const t=e.relatedTarget;t?.closest(`#${this.id}`)||(e.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}dragstart(e){const t=this.parent.div.getBoundingClientRect();this.startX=e.clientX-t.x,this.startY=e.clientY-t.y,e.dataTransfer.setData("text/plain",this.id),e.dataTransfer.effectAllowed="move"}setAt(e,t,n,s){const[r,i]=this.parentDimensions;[n,s]=this.screenToPageTranslation(n,s),this.x=(e+n)/r,this.y=(t+s)/i,this.div.style.left=100*this.x+"%",this.div.style.top=100*this.y+"%"}translate(e,t){const[n,s]=this.parentDimensions;[e,t]=this.screenToPageTranslation(e,t),this.x+=e/n,this.y+=t/s,this.div.style.left=100*this.x+"%",this.div.style.top=100*this.y+"%"}screenToPageTranslation(e,t){switch(this.parentRotation){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{realScale:e}=this._uiManager.viewParameters,[t,n]=this.pageDimensions;return[t*e,n*e]}setDims(e,t){const[n,s]=this.parentDimensions;this.div.style.width=100*e/n+"%",this.div.style.height=100*t/s+"%"}fixDims(){const{style:e}=this.div,{height:t,width:n}=e,s=n.endsWith("%"),r=t.endsWith("%");if(s&&r)return;const[i,a]=this.parentDimensions;s||(e.width=100*parseFloat(n)/i+"%"),r||(e.height=100*parseFloat(t)/a+"%")}getInitialTranslation(){return[0,0]}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",this.#A),this.div.addEventListener("focusout",this.#S);const[e,t]=this.getInitialTranslation();return this.translate(e,t),(0,s.bindEvents)(this,this.div,["dragstart","pointerdown"]),this.div}pointerdown(e){const{isMac:t}=r.FeatureTest.platform;0!==e.button||e.ctrlKey&&t?e.preventDefault():(e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this),this.#x=!0)}getRect(e,t){const n=this.parentScale,[s,r]=this.pageDimensions,[i,a]=this.pageTranslation,o=e/n,l=t/n,c=this.x*s,d=this.y*r,h=this.width*s,u=this.height*r;switch(this.rotation){case 0:return[c+o+i,r-d-l-u+a,c+o+h+i,r-d-l+a];case 90:return[c+l+i,r-d+o+a,c+l+u+i,r-d+o+h+a];case 180:return[c-o-h+i,r-d+l+a,c-o+i,r-d+l+u+a];case 270:return[c-l-u+i,r-d-o-h+a,c-l+i,r-d-o+a];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,t){const[n,s,r,i]=e,a=r-n,o=i-s;switch(this.rotation){case 0:return[n,t-i,a,o];case 90:return[n,t-s,o,a];case 180:return[r,t-s,a,o];case 270:return[r,t-i,o,a];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#C=!0}disableEditMode(){this.#C=!1}isInEditMode(){return this.#C}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){this.div?.addEventListener("focusin",this.#A)}serialize(){(0,r.unreachable)("An editor must be serializable")}static deserialize(e,t,n){const s=new this.prototype.constructor({parent:t,id:t.getNextId(),uiManager:n});s.rotation=e.rotation;const[r,i]=s.pageDimensions,[a,o,l,c]=s.getRectInCurrentCoords(e.rect,i);return s.x=a/r,s.y=o/i,s.width=l/r,s.height=c/i,s}remove(){this.div.removeEventListener("focusin",this.#A),this.div.removeEventListener("focusout",this.#S),this.isEmpty()||this.commit(),this.parent.remove(this)}select(){this.div?.classList.add("selectedEditor")}unselect(){this.div?.classList.remove("selectedEditor")}updateParams(e,t){}disableEditing(){}enableEditing(){}get propertiesToUpdate(){return{}}get contentDiv(){return this.div}get isEditing(){return this.#E}set isEditing(e){this.#E=e,e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null)}}t.AnnotationEditor=i},(e,t,n)=>
2{Object.defineProperty(t,"__esModule",{value:!0}),t.KeyboardManager=t.CommandManager=t.ColorManager=t.AnnotationEditorUIManager=void 0,t.bindEvents=function(e,t,n){for(const s of n)t.addEventListener(s,e[s].bind(e))},t.opacityToHex=function(e){return Math.round(Math.min(255,Math.max(1,255*e))).toString(16).padStart(2,"0")};var s=n(1),r=n(6);class i{#w=0;getId(){return`${s.AnnotationEditorPrefix}${this.#w++}`}}class a{#T=[];#k=!1;#R;#M=-1;constructor(e=128){this.#R=e}add({cmd:e,undo:t,mustExec:n,type:s=NaN,overwriteIfSameType:r=!1,keepUndo:i=!1}){if(n&&e(),this.#k)return;const a={cmd:e,undo:t,type:s};if(-1===this.#M)return this.#T.length>0&&(this.#T.length=0),this.#M=0,void this.#T.push(a);if(r&&this.#T[this.#M].type===s)return i&&(a.undo=this.#T[this.#M].undo),void(this.#T[this.#M]=a);const o=this.#M+1;o===this.#R?this.#T.splice(0,1):(this.#M=o,o<this.#T.length&&this.#T.splice(o)),this.#T.push(a)}undo(){-1!==this.#M&&(this.#k=!0,this.#T[this.#M].undo(),this.#k=!1,this.#M-=1)}redo(){this.#M<this.#T.length-1&&(this.#M+=1,this.#k=!0,this.#T[this.#M].cmd(),this.#k=!1)}hasSomethingToUndo(){return-1!==this.#M}hasSomethingToRedo(){return this.#M<this.#T.length-1}destroy(){this.#T=null}}t.CommandManager=a;class o{constructor(e){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:t}=s.FeatureTest.platform;for(const[n,s]of e)for(const e of n){const n=e.startsWith("mac+");t&&n?(this.callbacks.set(e.slice(4),s),this.allKeys.add(e.split("+").at(-1))):t||n||(this.callbacks.set(e,s),this.allKeys.add(e.split("+").at(-1)))}}#F(e){e.altKey&&this.buffer.push("alt"),e.ctrlKey&&this.buffer.push("ctrl"),e.metaKey&&this.buffer.push("meta"),e.shiftKey&&this.buffer.push("shift"),this.buffer.push(e.key);const t=this.buffer.join("+");return this.buffer.length=0,t}exec(e,t){if(!this.allKeys.has(t.key))return;const n=this.callbacks.get(this.#F(t));n&&(n.bind(e)(),t.stopPropagation(),t.preventDefault())}}t.KeyboardManager=o;class l{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return(0,r.getColorValues)(e),(0,s.shadow)(this,"_colors",e)}convert(e){const t=(0,r.getRGB)(e);if(!window.matchMedia("(forced-colors: active)").matches)return t;for(const[e,n]of this._colors)if(n.every((e,n)=>e===t[n]))return l._colorsMapping.get(e);return t}getHexCode(e){const t=this._colors.get(e);return t?s.Util.makeHexColor(...t):e}}t.ColorManager=l;class c{#O=null;#D=new Map;#I=new Map;#L=null;#N=new a;#j=0;#B=null;#U=new Set;#q=null;#W=new i;#H=!1;#G=s.AnnotationEditorType.NONE;#V=new Set;#z=this.copy.bind(this);#$=this.cut.bind(this);#X=this.paste.bind(this);#Y=this.keydown.bind(this);#K=this.onEditingAction.bind(this);#J=this.onPageChanging.bind(this);#Q=this.onScaleChanging.bind(this);#Z=this.onRotationChanging.bind(this);#ee={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1};#te=null;static _keyboardManager=new o([[["ctrl+a","mac+meta+a"],c.prototype.selectAll],[["ctrl+z","mac+meta+z"],c.prototype.undo],[["ctrl+y","ctrl+shift+Z","mac+meta+shift+Z"],c.prototype.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete"],c.prototype.delete],[["Escape","mac+Escape"],c.prototype.unselectAll]]);constructor(e,t,n){this.#te=e,this.#q=t,this.#q._on("editingaction",this.#K),this.#q._on("pagechanging",this.#J),this.#q._on("scalechanging",this.#Q),this.#q._on("rotationchanging",this.#Z),this.#L=n,this.viewParameters={realScale:r.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}destroy(){this.#ne(),this.#q._off("editingaction",this.#K),this.#q._off("pagechanging",this.#J),this.#q._off("scalechanging",this.#Q),this.#q._off("rotationchanging",this.#Z);for(const e of this.#I.values())e.destroy();this.#I.clear(),this.#D.clear(),this.#U.clear(),this.#O=null,this.#V.clear(),this.#N.destroy()}onPageChanging({pageNumber:e}){this.#j=e-1}focusMainContainer(){this.#te.focus()}addShouldRescale(e){this.#U.add(e)}removeShouldRescale(e){this.#U.delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*r.PixelsPerInch.PDF_TO_CSS_UNITS;for(const e of this.#U)e.onScaleChanging()}
2onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}addToAnnotationStorage(e){e.isEmpty()||!this.#L||this.#L.has(e.id)||this.#L.setValue(e.id,e)}#se(){this.#te.addEventListener("keydown",this.#Y)}#ne(){this.#te.removeEventListener("keydown",this.#Y)}#re(){document.addEventListener("copy",this.#z),document.addEventListener("cut",this.#$),document.addEventListener("paste",this.#X)}#ie(){document.removeEventListener("copy",this.#z),document.removeEventListener("cut",this.#$),document.removeEventListener("paste",this.#X)}copy(e){if(e.preventDefault(),this.#O&&this.#O.commitOrRemove(),!this.hasSelection)return;const t=[];for(const e of this.#V)e.isEmpty()||t.push(e.serialize());0!==t.length&&e.clipboardData.setData("application/pdfjs",JSON.stringify(t))}cut(e){this.copy(e),this.delete()}paste(e){e.preventDefault();let t=e.clipboardData.getData("application/pdfjs");if(!t)return;try{t=JSON.parse(t)}catch(e){return void(0,s.warn)(`paste: "${e.message}".`)}if(!Array.isArray(t))return;this.unselectAll();const n=this.#I.get(this.#j);try{const e=[];for(const s of t){const t=n.deserialize(s);if(!t)return;e.push(t)}const s=()=>{for(const t of e)this.#ae(t);this.#oe(e)},r=()=>{for(const t of e)t.remove()};this.addCommands({cmd:s,undo:r,mustExec:!0})}catch(e){(0,s.warn)(`paste: "${e.message}".`)}}keydown(e){this.getActive()?.shouldGetKeyboardEvents()||c._keyboardManager.exec(this,e)}onEditingAction(e){["undo","redo","delete","selectAll"].includes(e.name)&&this[e.name]()}#le(e){Object.entries(e).some(([e,t])=>this.#ee[e]!==t)&&this.#q.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#ee,e)})}#ce(e){this.#q.dispatch("annotationeditorparamschanged",{source:this,details:e})}setEditingState(e){e?(this.#se(),this.#re(),this.#le({isEditing:this.#G!==s.AnnotationEditorType.NONE,isEmpty:this.#de(),hasSomethingToUndo:this.#N.hasSomethingToUndo(),hasSomethingToRedo:this.#N.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#ne(),this.#ie(),this.#le({isEditing:!1}))}registerEditorTypes(e){if(!this.#B){this.#B=e;for(const e of this.#B)this.#ce(e.defaultPropertiesToUpdate)}}getId(){return this.#W.getId()}get currentLayer(){return this.#I.get(this.#j)}get currentPageIndex(){return this.#j}addLayer(e){this.#I.set(e.pageIndex,e),this.#H?e.enable():e.disable()}removeLayer(e){this.#I.delete(e.pageIndex)}updateMode(e){if(this.#G=e,e===s.AnnotationEditorType.NONE)this.setEditingState(!1),this.#he();else{this.setEditingState(!0),this.#ue();for(const t of this.#I.values())t.updateMode(e)}}updateToolbar(e){e!==this.#G&&this.#q.dispatch("switchannotationeditormode",{source:this,mode:e})}updateParams(e,t){if(this.#B){for(const n of this.#V)n.updateParams(e,t);for(const n of this.#B)n.updateDefaultParams(e,t)}}#ue(){if(!this.#H){this.#H=!0;for(const e of this.#I.values())e.enable()}}#he(){if(this.unselectAll(),this.#H){this.#H=!1;for(const e of this.#I.values())e.disable()}}getEditors(e){const t=[];for(const n of this.#D.values())n.pageIndex===e&&t.push(n);return t}getEditor(e){return this.#D.get(e)}addEditor(e){this.#D.set(e.id,e)}removeEditor(e){this.#D.delete(e.id),this.unselect(e),this.#L?.remove(e.id)}#ae(e){const t=this.#I.get(e.pageIndex);t?t.addOrRebuild(e):this.addEditor(e)}setActiveEditor(e){this.#O!==e&&(this.#O=e,e&&this.#ce(e.propertiesToUpdate))}toggleSelected(e){if(this.#V.has(e))return this.#V.delete(e),e.unselect(),void this.#le({hasSelectedEditor:this.hasSelection});this.#V.add(e),e.select(),this.#ce(e.propertiesToUpdate),this.#le({hasSelectedEditor:!0})}setSelected(e){for(const t of this.#V)t!==e&&t.unselect();this.#V.clear(),this.#V.add(e),e.select(),this.#ce(e.propertiesToUpdate),this.#le({hasSelectedEditor:!0})}isSelected(e){return this.#V.has(e)}unselect(e){e.unselect(),this.#V.delete(e),this.#le({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#V.size}undo(){this.#N.undo(),this.#le({hasSomethingToUndo:this.#N.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#de()})}redo(){this.#N.redo(),this.#le({hasSomethingToUndo:!0,hasSomethingToRedo:this.#N.hasSomethingToRedo(),isEmpty:this.#de()})}addCommands(e){this.#N.add(e),this.#le({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#de()})}#de(){if(0===this.#D.size)return!0;
2if(1===this.#D.size)for(const e of this.#D.values())return e.isEmpty();return!1}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const e=[...this.#V];this.addCommands({cmd:()=>{for(const t of e)t.remove()},undo:()=>{for(const t of e)this.#ae(t)},mustExec:!0})}commitOrRemove(){this.#O?.commitOrRemove()}#oe(e){this.#V.clear();for(const t of e)t.isEmpty()||(this.#V.add(t),t.select());this.#le({hasSelectedEditor:!0})}selectAll(){for(const e of this.#V)e.commit();this.#oe(this.#D.values())}unselectAll(){if(this.#O)this.#O.commitOrRemove();else if(0!==this.#V.size){for(const e of this.#V)e.unselect();this.#V.clear(),this.#le({hasSelectedEditor:!1})}}isActive(e){return this.#O===e}getActive(){return this.#O}getMode(){return this.#G}}t.AnnotationEditorUIManager=c},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StatTimer=t.RenderingCancelledException=t.PixelsPerInch=t.PageViewport=t.PDFDateString=t.DOMStandardFontDataFactory=t.DOMSVGFactory=t.DOMFilterFactory=t.DOMCanvasFactory=t.DOMCMapReaderFactory=t.AnnotationPrefix=void 0,t.deprecated=function(e){console.log("Deprecated API usage: "+e)},t.getColorValues=function(e){const t=document.createElement("span");t.style.visibility="hidden",document.body.append(t);for(const n of e.keys()){t.style.color=n;const s=window.getComputedStyle(t).color;e.set(n,_(s))}t.remove()},t.getCurrentTransform=function(e){const{a:t,b:n,c:s,d:r,e:i,f:a}=e.getTransform();return[t,n,s,r,i,a]},t.getCurrentTransformInverse=function(e){const{a:t,b:n,c:s,d:r,e:i,f:a}=e.getTransform().invertSelf();return[t,n,s,r,i,a]},t.getFilenameFromUrl=function(e,t=!1){return t||([e]=e.split(/[#?]/,1)),e.substring(e.lastIndexOf("/")+1)},t.getPdfFilenameFromUrl=function(e,t="document.pdf"){if("string"!=typeof e)return t;if(g(e))return(0,r.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;const n=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,s=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(e);let i=n.exec(s[1])||n.exec(s[2])||n.exec(s[3]);if(i&&(i=i[0],i.includes("%")))try{i=n.exec(decodeURIComponent(i))[0]}catch(e){}return i||t},t.getRGB=_,t.getXfaPageViewport=function(e,{scale:t=1,rotation:n=0}){const{width:s,height:r}=e.attributes.style,i=[0,0,parseInt(s),parseInt(r)];return new p({viewBox:i,scale:t,rotation:n})},t.isDataScheme=g,t.isPdfFile=function(e){return"string"==typeof e&&/\.pdf$/i.test(e)},t.isValidFetchUrl=m,t.loadScript=function(e,t=!1){return new Promise((n,s)=>{const r=document.createElement("script");r.src=e,r.onload=function(e){t&&r.remove(),n(e)},r.onerror=function(){s(new Error(`Cannot load script at: ${r.src}`))},(document.head||document.documentElement).append(r)})},t.setLayerDimensions=function(e,t,n=!1,s=!0){if(t instanceof p){const{pageWidth:s,pageHeight:r}=t.rawDims,{style:i}=e,a=`calc(var(--scale-factor) * ${s}px)`,o=`calc(var(--scale-factor) * ${r}px)`;n&&t.rotation%180!=0?(i.width=o,i.height=a):(i.width=a,i.height=o)}s&&e.setAttribute("data-main-rotation",t.rotation)};var s=n(7),r=n(1);const i="http://www.w3.org/2000/svg";t.AnnotationPrefix="pdfjs_internal_id_";class a{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}t.PixelsPerInch=a;class o extends s.BaseFilterFactory{#pe;#fe;#t;#ge;#me;#be;#_e;#w=0;constructor({docId:e,ownerDocument:t=globalThis.document}={}){super(),this.#t=e,this.#ge=t}get#ve(){return this.#pe||=new Map}get#ye(){if(!this.#fe){const e=this.#ge.createElement("div"),{style:t}=e;t.visibility="hidden",t.contain="strict",t.width=t.height=0,t.position="absolute",t.top=t.left=0,t.zIndex=-1;const n=this.#ge.createElementNS(i,"svg");n.setAttribute("width",0),n.setAttribute("height",0),this.#fe=this.#ge.createElementNS(i,"defs"),e.append(n),n.append(this.#fe),this.#ge.body.append(e)}return this.#fe}#Ae(e,t,n){const s=this.#ge.createElementNS(i,t);s.setAttribute("type","discrete"),s.setAttribute("tableValues",n),e.append(s)}addFilter(e){if(!e)return"none";let t,n,s,r,a=this.#ve.get(e);if(a)return a;if(1===e.length){const i=e[0],a=new Array(256);for(let e=0;e<256;e++)a[e]=i[e]/255;r=t=n=s=a.join(",")}else{const[i,a,o]=e,l=new Array(256),c=new Array(256),d=new Array(256);for(let e=0;e<256;e++)l[e]=i[e]/255,c[e]=a[e]/255,d[e]=o[e]/255;t=l.join(","),n=c.join(","),s=d.join(","),r=`${t}${n}${s}`}if(a=this.#ve.get(r),a)return this.#ve.set(e,a),a;const o=`g_${this.#t}_transfer_map_${this.#w++}`,l=`url(#${o})`;this.#ve.set(e,l),this.#ve.set(r,l);const c=this.#ge.createElementNS(i,"filter",i);c.setAttribute("id",o),c.setAttribute("color-interpolation-filters","sRGB");const d=this.#ge.createElementNS(i,"feComponentTransfer");return c.append(d),this.#Ae(d,"feFuncR",t),this.#Ae(d,"feFuncG",n),this.#Ae(d,"feFuncB",s),this.#ye.append(c),l}addHCMFilter(e,t){const n=`${e}-${t}`;if(this.#be===n)return this.#_e;if(this.#be=n,this.#_e="none",this.#me?.remove(),!e||!t)return this.#_e;this.#ye.style.color=e;const s=_(e=getComputedStyle(this.#ye).getPropertyValue("color"));e=r.Util.makeHexColor(...s),this.#ye.style.color=t;
2const a=_(t=getComputedStyle(this.#ye).getPropertyValue("color"));if(t=r.Util.makeHexColor(...a),this.#ye.style.color="","#000000"===e&&"#ffffff"===t||e===t)return this.#_e;const o=new Array(256);for(let e=0;e<=255;e++){const t=e/255;o[e]=t<=.03928?t/12.92:((t+.055)/1.055)**2.4}const l=o.join(","),c=`g_${this.#t}_hcm_filter`,d=this.#me=this.#ge.createElementNS(i,"filter",i);d.setAttribute("id",c),d.setAttribute("color-interpolation-filters","sRGB");let h=this.#ge.createElementNS(i,"feComponentTransfer");d.append(h),this.#Ae(h,"feFuncR",l),this.#Ae(h,"feFuncG",l),this.#Ae(h,"feFuncB",l);const u=this.#ge.createElementNS(i,"feColorMatrix");u.setAttribute("type","matrix"),u.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),d.append(u),h=this.#ge.createElementNS(i,"feComponentTransfer"),d.append(h);const p=(e,t)=>{const n=s[e]/255,r=a[e]/255,i=new Array(t+1);for(let e=0;e<=t;e++)i[e]=n+e/t*(r-n);return i.join(",")};return this.#Ae(h,"feFuncR",p(0,5)),this.#Ae(h,"feFuncG",p(1,5)),this.#Ae(h,"feFuncB",p(2,5)),this.#ye.append(d),this.#_e=`url(#${c})`,this.#_e}destroy(e=!1){e&&this.#_e||(this.#fe&&(this.#fe.parentNode.parentNode.remove(),this.#fe=null),this.#pe&&(this.#pe.clear(),this.#pe=null),this.#w=0)}}t.DOMFilterFactory=o;class l extends s.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 c(e,t=!1){if(m(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,s)=>{const i=new XMLHttpRequest;i.open("GET",e,!0),t&&(i.responseType="arraybuffer"),i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE){if(200===i.status||0===i.status){let e;if(t&&i.response?e=new Uint8Array(i.response):!t&&i.responseText&&(e=(0,r.stringToBytes)(i.responseText)),e)return void n(e)}s(new Error(i.statusText))}},i.send(null)})}t.DOMCanvasFactory=l;class d extends s.BaseCMapReaderFactory{_fetchData(e,t){return c(e,this.isCompressed).then(e=>({cMapData:e,compressionType:t}))}}t.DOMCMapReaderFactory=d;class h extends s.BaseStandardFontDataFactory{_fetchData(e){return c(e,!0)}}t.DOMStandardFontDataFactory=h;class u extends s.BaseSVGFactory{_createSVG(e){return document.createElementNS(i,e)}}t.DOMSVGFactory=u;class p{constructor({viewBox:e,scale:t,rotation:n,offsetX:s=0,offsetY:r=0,dontFlip:i=!1}){this.viewBox=e,this.scale=t,this.rotation=n,this.offsetX=s,this.offsetY=r;const a=(e[2]+e[0])/2,o=(e[3]+e[1])/2;let l,c,d,h,u,p,f,g;switch((n%=360)<0&&(n+=360),n){case 180:l=-1,c=0,d=0,h=1;break;case 90:l=0,c=1,d=1,h=0;break;case 270:l=0,c=-1,d=-1,h=0;break;case 0:l=1,c=0,d=0,h=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}i&&(d=-d,h=-h),0===l?(u=Math.abs(o-e[1])*t+s,p=Math.abs(a-e[0])*t+r,f=(e[3]-e[1])*t,g=(e[2]-e[0])*t):(u=Math.abs(a-e[0])*t+s,p=Math.abs(o-e[1])*t+r,f=(e[2]-e[0])*t,g=(e[3]-e[1])*t),this.transform=[l*t,c*t,d*t,h*t,u-l*t*a-d*t*o,p-c*t*a-h*t*o],this.width=f,this.height=g}get rawDims(){const{viewBox:e}=this;return(0,r.shadow)(this,"rawDims",{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone({scale:e=this.scale,rotation:t=this.rotation,offsetX:n=this.offsetX,offsetY:s=this.offsetY,dontFlip:r=!1}={}){return new p({viewBox:this.viewBox.slice(),scale:e,rotation:t,offsetX:n,offsetY:s,dontFlip:r})}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=p;class f extends r.BaseException{constructor(e,t,n=0){super(e,"RenderingCancelledException"),this.type=t,this.extraDelay=n}}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 m(e,t){try{const{protocol:n}=t?new URL(e,t):new URL(e);return"http:"===n||"https:"===n}catch(e){return!1}}let b;function _(e){if(e.startsWith("#")){const t=parseInt(e.slice(1),16);return[(16711680&t)>>16,(65280&t)>>8,255&t]}return e.startsWith("rgb(")?e.slice(4,-1).split(",").map(e=>parseInt(e)):e.startsWith("rgba(")?e.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):((0,r.warn)(`Not a valid color format: "${e}"`),[0,0,0])}t.RenderingCancelledException=f,t.StatTimer=class{started=Object.create(null);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{name:e}of this.times)t=Math.max(e.length,t);for(const{name:n,start:s,end:r}of this.times)e.push(`${n.padEnd(t)} ${r-s}ms\n`);return e.join("")}}
2,t.PDFDateString=class{static toDateObject(e){if(!e||"string"!=typeof e)return null;b||(b=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const t=b.exec(e);if(!t)return null;const n=parseInt(t[1],10);let s=parseInt(t[2],10);s=s>=1&&s<=12?s-1:0;let r=parseInt(t[3],10);r=r>=1&&r<=31?r:1;let i=parseInt(t[4],10);i=i>=0&&i<=23?i:0;let a=parseInt(t[5],10);a=a>=0&&a<=59?a:0;let o=parseInt(t[6],10);o=o>=0&&o<=59?o:0;const l=t[7]||"Z";let c=parseInt(t[8],10);c=c>=0&&c<=23?c:0;let d=parseInt(t[9],10)||0;return d=d>=0&&d<=59?d:0,"-"===l?(i+=c,a+=d):"+"===l&&(i-=c,a-=d),new Date(Date.UTC(n,s,r,i,a,o))}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseStandardFontDataFactory=t.BaseSVGFactory=t.BaseFilterFactory=t.BaseCanvasFactory=t.BaseCMapReaderFactory=void 0;var s=n(1);class r{constructor(){this.constructor===r&&(0,s.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(e){return"none"}addHCMFilter(e,t){return"none"}destroy(e=!1){}}t.BaseFilterFactory=r;class i{constructor(){this.constructor===i&&(0,s.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,s.unreachable)("Abstract method `_createCanvas` called.")}}t.BaseCanvasFactory=i;class a{constructor({baseUrl:e=null,isCompressed:t=!0}){this.constructor===a&&(0,s.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?s.CMapCompressionType.BINARY:s.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,s.unreachable)("Abstract method `_fetchData` called.")}}t.BaseCMapReaderFactory=a;class o{constructor({baseUrl:e=null}){this.constructor===o&&(0,s.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,s.unreachable)("Abstract method `_fetchData` called.")}}t.BaseStandardFontDataFactory=o;class l{constructor(){this.constructor===l&&(0,s.unreachable)("Cannot initialize BaseSVGFactory.")}create(e,t,n=!1){if(e<=0||t<=0)throw new Error("Invalid SVG dimensions");const s=this._createSVG("svg:svg");return s.setAttribute("version","1.1"),n||(s.setAttribute("width",`${e}px`),s.setAttribute("height",`${t}px`)),s.setAttribute("preserveAspectRatio","none"),s.setAttribute("viewBox",`0 0 ${e} ${t}`),s}createElement(e){if("string"!=typeof e)throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){(0,s.unreachable)("Abstract method `_createSVG` called.")}}t.BaseSVGFactory=l},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MurmurHash3_64=void 0;var s=n(1);const r=3285377520,i=4294901760,a=65535;t.MurmurHash3_64=class{constructor(e){this.h1=e?4294967295&e:r,this.h2=e?4294967295&e:r}update(e){let t,n;if("string"==typeof e){t=new Uint8Array(2*e.length),n=0;for(let s=0,r=e.length;s<r;s++){const r=e.charCodeAt(s);r<=255?t[n++]=r:(t[n++]=r>>>8,t[n++]=255&r)}}else{if(!(0,s.isArrayBuffer)(e))throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");t=e.slice(),n=t.byteLength}const r=n>>
22,o=n-4*r,l=new Uint32Array(t.buffer,0,r);let c=0,d=0,h=this.h1,u=this.h2;const p=3432918353,f=461845907,g=11601,m=13715;for(let e=0;e<r;e++)1&e?(c=l[e],c=c*p&i|c*g&a,c=c<<15|c>>>17,c=c*f&i|c*m&a,h^=c,h=h<<13|h>>>19,h=5*h+3864292196):(d=l[e],d=d*p&i|d*g&a,d=d<<15|d>>>17,d=d*f&i|d*m&a,u^=d,u=u<<13|u>>>19,u=5*u+3864292196);switch(c=0,o){case 3:c^=t[4*r+2]<<16;case 2:c^=t[4*r+1]<<8;case 1:c^=t[4*r],c=c*p&i|c*g&a,c=c<<15|c>>>17,c=c*f&i|c*m&a,1&r?h^=c:u^=c}this.h1=h,this.h2=u}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=3981806797*e&i|36045*e&a,t=4283543511*t&i|(2950163797*(t<<16|e>>>16)&i)>>>16,e^=t>>>1,e=444984403*e&i|60499*e&a,t=3301882366*t&i|(3120437893*(t<<16|e>>>16)&i)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FontLoader=t.FontFaceObject=void 0;var s=n(1),r=n(10);t.FontLoader=class{constructor({ownerDocument:e=globalThis.document,styleElement:t=null}){this._document=e,this.nativeFontFaces=[],this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.push(e),this._document.fonts.add(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const t=this.styleElement.sheet;t.insertRule(e,t.cssRules.length)}clear(){for(const e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.length=0,this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async bind(e){if(e.attached||e.missingFile)return;if(e.attached=!0,this.isFontLoadingAPISupported){const t=e.createNativeFontFace();if(t){this.addNativeFontFace(t);try{await t.loaded}catch(n){throw(0,s.warn)(`Failed to load font '${t.family}': '${n}'.`),e.disableFontFace=!0,n}}return}const t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise(t=>{const n=this._queueLoadingCallback(t);this._prepareFontLoadEvent(e,n)})}}get isFontLoadingAPISupported(){const e=!!this._document?.fonts;return(0,s.shadow)(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){let e=!1;return(r.isNodeJS||"undefined"!=typeof navigator&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(e=!0),(0,s.shadow)(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(e){const{loadingRequests:t}=this,n={done:!1,complete:function(){for((0,s.assert)(!n.done,"completeRequest() cannot be called twice."),n.done=!0;t.length>0&&t[0].done;){const e=t.shift();setTimeout(e.callback,0)}},callback:e};return t.push(n),n}get _loadTestFont(){const e=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,s.shadow)(this,"_loadTestFont",e)}_prepareFontLoadEvent(e,t){function n(e,t){return e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|255&e.charCodeAt(t+3)}function r(e,t,n,s){return e.substring(0,t)+s+e.substring(t+n)}let i,a;const o=this._document.createElement("canvas");o.width=1,o.height=1;const l=o.getContext("2d");let c=0;const d=`lt${Date.now()}${this.loadTestFontId++}`;let h=this._loadTestFont;h=r(h,976,d.length,d);const u=1482184792;let p=n(h,16);for(i=0,a=d.length-3;i<a;i+=4)p=p-u+n(d,i)|0;i<d.length&&(p=p-u+n(d+"XXX",i)|0),h=r(h,16,4,(0,s.string32)(p));const f=`@font-face {font-family:"${d}";src:url(data:font/opentype;base64,${btoa(h)});}`;this.insertRule(f);const g=this._document.createElement("div");g.style.visibility="hidden",g.style.width=g.style.height="10px",g.style.position="absolute",g.style.top=g.style.left="0px";for(const t of[e.loadedName,d]){const e=this._document.createElement("span");e.textContent="Hi",e.style.fontFamily=t,g.append(e)}this._document.body.append(g),function e(t,n){if(++c>30)return(0,s.warn)("Load test font never loaded."),void n();l.font="30px "+t,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0?n():setTimeout(e.bind(null,t,n))}(d,()=>{g.remove(),t.complete()})}},t.FontFaceObject=class{constructor(e,{isEvalSupported:t=!0,disableFontFace:n=!1,ignoreErrors:s=!1,inspectFont:r=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===s,this._inspectFont=r}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._inspectFont?.(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const e=(0,s.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._inspectFont?.(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(0,s.warn)(`getPathGenerator - ignoring character: "${e}".`),this.compiledGlyphs[t]=function(e,t){}}if(this.isEvalSupported&&s.FeatureTest.isEvalSupported){const e=[];for(const t of n){const n=void 0!==t.args?t.args.join(","):"";e.push("c.",t.cmd,"(",n,");\n")}return this.compiledGlyphs[t]=new Function("c","size",e.join(""))}return this.compiledGlyphs[t]=function(e,t){for(const s of n)"scale"===s.cmd&&(s.args=[t,-t]),e[s.cmd
2].apply(e,s.args)}}}},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isNodeJS=void 0;const n=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type);t.isNodeJS=n},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CanvasGraphics=void 0;var s=n(1),r=n(6),i=n(12),a=n(13),o=n(10);const l=4096,c=16;class d{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,t,n){let s;return void 0!==this.cache[e]?(s=this.cache[e],this.canvasFactory.reset(s,t,n)):(s=this.canvasFactory.create(t,n),this.cache[e]=s),s}delete(e){delete this.cache[e]}clear(){for(const e in this.cache){const t=this.cache[e];this.canvasFactory.destroy(t),delete this.cache[e]}}}function h(e,t,n,s,i,a,o,l,c,d){const[h,u,p,f,g,m]=(0,r.getCurrentTransform)(e);if(0===u&&0===p){const r=o*h+g,b=Math.round(r),_=l*f+m,v=Math.round(_),y=(o+c)*h+g,A=Math.abs(Math.round(y)-b)||1,S=(l+d)*f+m,x=Math.abs(Math.round(S)-v)||1;return e.setTransform(Math.sign(h),0,0,Math.sign(f),b,v),e.drawImage(t,n,s,i,a,0,0,A,x),e.setTransform(h,u,p,f,g,m),[A,x]}if(0===h&&0===f){const r=l*p+g,b=Math.round(r),_=o*u+m,v=Math.round(_),y=(l+d)*p+g,A=Math.abs(Math.round(y)-b)||1,S=(o+c)*u+m,x=Math.abs(Math.round(S)-v)||1;return e.setTransform(0,Math.sign(u),Math.sign(p),0,b,v),e.drawImage(t,n,s,i,a,0,0,x,A),e.setTransform(h,u,p,f,g,m),[x,A]}return e.drawImage(t,n,s,i,a,o,l,c,d),[Math.hypot(h,u)*c,Math.hypot(p,f)*d]}class u{constructor(e,t){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=s.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=s.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=s.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,e,t])}clone(){const e=Object.create(this);return e.clipBox=this.clipBox.slice(),e}setCurrentPoint(e,t){this.x=e,this.y=t}updatePathMinMax(e,t,n){[t,n]=s.Util.applyTransform([t,n],e),this.minX=Math.min(this.minX,t),this.minY=Math.min(this.minY,n),this.maxX=Math.max(this.maxX,t),this.maxY=Math.max(this.maxY,n)}updateRectMinMax(e,t){const n=s.Util.applyTransform(t,e),r=s.Util.applyTransform(t.slice(2),e);this.minX=Math.min(this.minX,n[0],r[0]),this.minY=Math.min(this.minY,n[1],r[1]),this.maxX=Math.max(this.maxX,n[0],r[0]),this.maxY=Math.max(this.maxY,n[1],r[1])}updateScalingPathMinMax(e,t){s.Util.scaleMinMax(e,t),this.minX=Math.min(this.minX,t[0]),this.maxX=Math.max(this.maxX,t[1]),this.minY=Math.min(this.minY,t[2]),this.maxY=Math.max(this.maxY,t[3])}updateCurvePathMinMax(e,t,n,r,i,a,o,l,c,d){const h=s.Util.bezierBoundingBox(t,n,r,i,a,o,l,c);if(d)return d[0]=Math.min(d[0],h[0],h[2]),d[1]=Math.max(d[1],h[0],h[2]),d[2]=Math.min(d[2],h[1],h[3]),void(d[3]=Math.max(d[3],h[1],h[3]));this.updateRectMinMax(e,h)}getPathBoundingBox(e=i.PathType.FILL,t=null){const n=[this.minX,this.minY,this.maxX,this.maxY];if(e===i.PathType.STROKE){t||(0,s.unreachable)("Stroke bounding box must include transform.");const e=s.Util.singularValueDecompose2dScale(t),r=e[0]*this.lineWidth/2,i=e[1]*this.lineWidth/2;n[0]-=r,n[1]-=i,n[2]+=r,n[3]+=i}return n}updateClipFromPath(){const e=s.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(e){this.clipBox=e,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(e=i.PathType.FILL,t=null){return s.Util.intersect(this.clipBox,this.getPathBoundingBox(e,t))}}function p(e,t){if("undefined"!=typeof ImageData&&t instanceof ImageData)return void e.putImageData(t,0,0);const n=t.height,r=t.width,i=n%c,a=(n-i)/c,o=0===i?a:a+1,l=e.createImageData(r,c);let d,h=0;const u=t.data,p=l.data;let f,g,m,b;if(t.kind===s.ImageKind.GRAYSCALE_1BPP){const t=u.byteLength,n=new Uint32Array(p.buffer,0,p.byteLength>>2),b=n.length,_=r+7>>3,v=4294967295,y=s.FeatureTest.isLittleEndian?4278190080:255;for(f=0;f<o;f++){for(m=f<a?c:i,d=0,g=0;g<m;g++){const e=t-h;let s=0;const i=e>_?r:8*e-7,a=-8&i;let o=0,l=0;for(;s<a;s+=8)l=u[h++],n[d++]=128&l?v:y,n[d++]=64&l?v:y,n[d++]=32&l?v:y,n[d++]=16&l?v:y,n[d++]=8&l?v:y,n[d++]=4&l?v:y,n[d++]=2&l?v:y,n[d++]=1&l?v:y;for(;s<i;s++)0===o&&(l=u[h++],o=128),n[d++]=l&o?v:y,o>>=1}for(;d<b;)n[d++]=0;e.putImageData(l,0,f*c)}}else if(t.kind===s.ImageKind.RGBA_32BPP){for(g=0,b=r*c*4,f=0;f<a;f++)p.set(u.subarray(h,h+b)),h+=b,e.putImageData(l,0,g),g+=c;f<o&&(b=r*i*4,p.set(u.subarray(h,h+b)),e.putImageData(l,0,g))}else{if(t.kind!==s.ImageKind.RGB_24BPP)throw new Error(`bad image kind: ${t.kind}`);for(m=c,b=r*m,f=0;f<o;f++){for(f>=a&&(m=i,b=r*m),d=0,g=b;g--;)p[d++]=u[h++],p[d++]=u[h++],p[d++]=u[h++],p[d++]=255;e.putImageData(l,0,f*c)}}}function f(e,t){if(t.bitmap)return void e.drawImage(t.bitmap,0,0);const n=t.height,s=t.width,r=n%c,i=(n-r)/c,o=0===r?i:i+1,l=e.createImageData(s,c);let d=0;const h=t.data,u=l.data;for(let t=0;t<o;t++){const n=t<i?c:r;({srcPos:d}=(0,a.convertBlackAndWhiteToRGBA)({src:h,srcPos:d,dest:u,width:s,height:n,nonBlackColor:0})),e.putImageData(l,0,t*c)}}function g(e,t){const n=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const s of n)void 0!==e[s]&&(t[s]=e[s]);void 0!==e.setLineDash&&(t.setLineDash(e.getLineDash()),t.lineDashOffset=e.lineDashOffset)}function m(e){e.strokeStyle=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),o.isNodeJS||(e.filter="none")}function b(e,t,n,s){const r=e.length;for(let i=3;i<r;i+=4){const r=e[i];if(0===r)e[i-3]=t,e[i-2]=n,e[i-1]=s;else if(r<255){const a=255-r;e[i-3]=e[i-3]*r+t*a>>8,e[i-2]=e[i-2]*r+n*a>>8,e[i-1]=e[i-1]*r+s*a>>8}}}function _(e,t,n){const s=e.length,r=1/255;for(let i=3;i<s;i+=4){const s=n?n[e[i]]:e[i];t[i]=t[i]*s*r|0}}function v(e,t,n){const s=e.length;for(let r=3;r<s;r+=4){const s=77*e[r-3]+152*e[r-2]+28*e[r-1];t[r]=n?t[r]*n[s>>8]>>8:t[r]*s>>16}}function y(e,t){const n=s.Util.singularValueDecompose2dScale(e);n[0]=Math.fround(n[0]),n[1]=Math.fround(n[1]);const i=Math.fround((globalThis.devicePixelRatio||1)*r.PixelsPerInch.PDF_TO_CSS_UNITS);return void 0!==t?t:n[0]<=i||n[1]<=i}const A=["butt","round","square"],S=["miter","round","bevel"],x={},E={};class C{constructor(e,t,n,s,r,{optionalContentConfig:i,markedContentStack:a=null}
2,o,l){this.ctx=e,this.current=new u(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=t,this.objs=n,this.canvasFactory=s,this.filterFactory=r,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=a||[],this.optionalContentConfig=i,this.cachedCanvases=new d(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=o,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=l,this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(e,t=null){return"string"==typeof e?e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e):t}beginDrawing({transform:e,viewport:t,transparency:n=!1,background:s=null}){const i=this.ctx.canvas.width,a=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=s||"#ffffff",this.ctx.fillRect(0,0,i,a),this.ctx.fillStyle=o,n){const e=this.cachedCanvases.getCanvas("transparent",i,a);this.compositeCtx=this.ctx,this.transparentCanvas=e.canvas,this.ctx=e.context,this.ctx.save(),this.ctx.transform(...(0,r.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),m(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...t.transform),this.viewportScale=t.scale,this.baseTransform=(0,r.getCurrentTransform)(this.ctx)}executeOperatorList(e,t,n,r){const i=e.argsArray,a=e.fnArray;let o=t||0;const l=i.length;if(l===o)return o;const c=l-o>10&&"function"==typeof n,d=c?Date.now()+15:0;let h=0;const u=this.commonObjs,p=this.objs;let f;for(;;){if(void 0!==r&&o===r.nextBreakPoint)return r.breakIt(o,n),o;if(f=a[o],f!==s.OPS.dependency)this[f].apply(this,i[o]);else for(const e of i[o]){const t=e.startsWith("g_")?u:p;if(!t.has(e))return t.get(e,n),o}if(o++,o===l)return o;if(c&&++h>10){if(Date.now()>d)return n(),o;h=0}}}#Se(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#Se(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const t of e.values())"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement&&(t.width=t.height=0);e.clear()}this._cachedBitmapsMap.clear(),this.#xe()}#xe(){if(this.pageColors){const e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==e){const t=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=t}}}_scaleImage(e,t){const n=e.width,s=e.height;let r,i,a=Math.max(Math.hypot(t[0],t[1]),1),o=Math.max(Math.hypot(t[2],t[3]),1),l=n,c=s,d="prescale1";for(;a>2&&l>1||o>2&&c>1;){let t=l,n=c;a>2&&l>1&&(t=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l/2),a/=l/t),o>2&&c>1&&(n=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c)/2,o/=c/n),r=this.cachedCanvases.getCanvas(d,t,n),i=r.context,i.clearRect(0,0,t,n),i.drawImage(e,0,0,l,c,0,0,t,n),e=r.canvas,l=t,c=n,d="prescale1"===d?"prescale2":"prescale1"}return{img:e,paintWidth:l,paintHeight:c}}_createMaskCanvas(e){const t=this.ctx,{width:n,height:a}=e,o=this.current.fillColor,l=this.current.patternFill,c=(0,r.getCurrentTransform)(t);let d,u,p,g;if((e.bitmap||e.data)&&e.count>1){const t=e.bitmap||e.data.buffer;u=JSON.stringify(l?c:[c.slice(0,4),o]),d=this._cachedBitmapsMap.get(t),d||(d=new Map,this._cachedBitmapsMap.set(t,d));const n=d.get(u);if(n&&!l)return{canvas:n,offsetX:Math.round(Math.min(c[0],c[2])+c[4]),offsetY:Math.round(Math.min(c[1],c[3])+c[5])};p=n}p||(g=this.cachedCanvases.getCanvas("maskCanvas",n,a),f(g.context,e));let m=s.Util.transform(c,[1/n,0,0,-1/a,0,0]);m=s.Util.transform(m,[1,0,0,1,0,-a]);const b=s.Util.applyTransform([0,0],m),_=s.Util.applyTransform([n,a],m),v=s.Util.normalizeRect([b[0],b[1],_[0],_[1]]),A=Math.round(v[2]-v[0])||1,S=Math.round(v[3]-v[1])||1,x=this.cachedCanvases.getCanvas("fillCanvas",A,S),E=x.context,C=Math.min(b[0],_[0]),P=Math.min(b[1],_[1]);E.translate(-C,-P),E.transform(...m),p||(p=this._scaleImage(g.canvas,(0,r.getCurrentTransformInverse)(E)),p=p.img,d&&l&&d.set(u,p)),E.imageSmoothingEnabled=y((0,r.getCurrentTransform)(E),e.interpolate),h(E,p,0,0,p.width,p.height,0,0,n,a),E.globalCompositeOperation="source-in";const w=s.Util.transform((0,r.getCurrentTransformInverse)(E),[1,0,0,1,-C,-P]);return E.fillStyle=l?o.getPattern(t,this,w,i.PathType.FILL):o,E.fillRect(0,0,n,a),d&&!l&&(this.cachedCanvases.delete("fillCanvas"),d.set(u,x.canvas)),{canvas:x.canvas,offsetX:Math.round(C),offsetY:Math.round(P)}}setLineWidth(e){e!==this.current.lineWidth&&(this._cachedScaleForStroking=null),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(e){this.ctx.lineCap=A[e]}setLineJoin(e){this.ctx.lineJoin=S[e]}setMiterLimit(e){this.ctx.miterLimit=e}setDash(e,t){const n=this.ctx;void 0!==n.setLineDash&&(n.setLineDash(e),n.lineDashOffset=t)}
2setRenderingIntent(e){}setFlatness(e){}setGState(e){for(const[t,n]of e)switch(t){case"LW":this.setLineWidth(n);break;case"LC":this.setLineCap(n);break;case"LJ":this.setLineJoin(n);break;case"ML":this.setMiterLimit(n);break;case"D":this.setDash(n[0],n[1]);break;case"RI":this.setRenderingIntent(n);break;case"FL":this.setFlatness(n);break;case"Font":this.setFont(n[0],n[1]);break;case"CA":this.current.strokeAlpha=n;break;case"ca":this.current.fillAlpha=n,this.ctx.globalAlpha=n;break;case"BM":this.ctx.globalCompositeOperation=n;break;case"SMask":this.current.activeSMask=n?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(n)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const e=this.ctx.canvas.width,t=this.ctx.canvas.height,n="smaskGroupAt"+this.groupLevel,s=this.cachedCanvases.getCanvas(n,e,t);this.suspendedCtx=this.ctx,this.ctx=s.context;const i=this.ctx;i.setTransform(...(0,r.getCurrentTransform)(this.suspendedCtx)),g(this.suspendedCtx,i),function(e,t){if(e._removeMirroring)throw new Error("Context is already forwarding operations.");e.__originalSave=e.save,e.__originalRestore=e.restore,e.__originalRotate=e.rotate,e.__originalScale=e.scale,e.__originalTranslate=e.translate,e.__originalTransform=e.transform,e.__originalSetTransform=e.setTransform,e.__originalResetTransform=e.resetTransform,e.__originalClip=e.clip,e.__originalMoveTo=e.moveTo,e.__originalLineTo=e.lineTo,e.__originalBezierCurveTo=e.bezierCurveTo,e.__originalRect=e.rect,e.__originalClosePath=e.closePath,e.__originalBeginPath=e.beginPath,e._removeMirroring=()=>{e.save=e.__originalSave,e.restore=e.__originalRestore,e.rotate=e.__originalRotate,e.scale=e.__originalScale,e.translate=e.__originalTranslate,e.transform=e.__originalTransform,e.setTransform=e.__originalSetTransform,e.resetTransform=e.__originalResetTransform,e.clip=e.__originalClip,e.moveTo=e.__originalMoveTo,e.lineTo=e.__originalLineTo,e.bezierCurveTo=e.__originalBezierCurveTo,e.rect=e.__originalRect,e.closePath=e.__originalClosePath,e.beginPath=e.__originalBeginPath,delete e._removeMirroring},e.save=function(){t.save(),this.__originalSave()},e.restore=function(){t.restore(),this.__originalRestore()},e.translate=function(e,n){t.translate(e,n),this.__originalTranslate(e,n)},e.scale=function(e,n){t.scale(e,n),this.__originalScale(e,n)},e.transform=function(e,n,s,r,i,a){t.transform(e,n,s,r,i,a),this.__originalTransform(e,n,s,r,i,a)},e.setTransform=function(e,n,s,r,i,a){t.setTransform(e,n,s,r,i,a),this.__originalSetTransform(e,n,s,r,i,a)},e.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},e.rotate=function(e){t.rotate(e),this.__originalRotate(e)},e.clip=function(e){t.clip(e),this.__originalClip(e)},e.moveTo=function(e,n){t.moveTo(e,n),this.__originalMoveTo(e,n)},e.lineTo=function(e,n){t.lineTo(e,n),this.__originalLineTo(e,n)},e.bezierCurveTo=function(e,n,s,r,i,a){t.bezierCurveTo(e,n,s,r,i,a),this.__originalBezierCurveTo(e,n,s,r,i,a)},e.rect=function(e,n,s,r){t.rect(e,n,s,r),this.__originalRect(e,n,s,r)},e.closePath=function(){t.closePath(),this.__originalClosePath()},e.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}(i,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),g(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const t=this.current.activeSMask;(function(e,t,n,s){const r=s[0],i=s[1],a=s[2]-r,o=s[3]-i;0!==a&&0!==o&&(function(e,t,n,s,r,i,a,o,l,c,d){const h=!!i,u=h?i[0]:0,p=h?i[1]:0,f=h?i[2]:0;let g;g="Luminosity"===r?v:_;const m=Math.min(s,Math.ceil(1048576/n));for(let r=0;r<s;r+=m){const i=Math.min(m,s-r),_=e.getImageData(o-c,r+(l-d),n,i),v=t.getImageData(o,r+l,n,i);h&&b(_.data,u,p,f),g(_.data,v.data,a),t.putImageData(v,o,r+l)}}(t.context,n,a,o,t.subtype,t.backdrop,t.transferMap,r,i,t.offsetX,t.offsetY),e.save(),e.globalAlpha=1,e.globalCompositeOperation="source-over",e.setTransform(1,0,0,1,0,0),e.drawImage(n.canvas,0,0),e.restore(
2))})(this.suspendedCtx,t,this.ctx,e),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}save(){this.inSMaskMode?(g(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const e=this.current;this.stateStack.push(e),this.current=e.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),g(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null)}transform(e,t,n,s,r,i){this.ctx.transform(e,t,n,s,r,i),this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null}constructPath(e,t,n){const i=this.ctx,a=this.current;let o,l,c=a.x,d=a.y;const h=(0,r.getCurrentTransform)(i),u=0===h[0]&&0===h[3]||0===h[1]&&0===h[2],p=u?n.slice(0):null;for(let n=0,r=0,f=e.length;n<f;n++)switch(0|e[n]){case s.OPS.rectangle:c=t[r++],d=t[r++];const e=t[r++],n=t[r++],f=c+e,g=d+n;i.moveTo(c,d),0===e||0===n?i.lineTo(f,g):(i.lineTo(f,d),i.lineTo(f,g),i.lineTo(c,g)),u||a.updateRectMinMax(h,[c,d,f,g]),i.closePath();break;case s.OPS.moveTo:c=t[r++],d=t[r++],i.moveTo(c,d),u||a.updatePathMinMax(h,c,d);break;case s.OPS.lineTo:c=t[r++],d=t[r++],i.lineTo(c,d),u||a.updatePathMinMax(h,c,d);break;case s.OPS.curveTo:o=c,l=d,c=t[r+4],d=t[r+5],i.bezierCurveTo(t[r],t[r+1],t[r+2],t[r+3],c,d),a.updateCurvePathMinMax(h,o,l,t[r],t[r+1],t[r+2],t[r+3],c,d,p),r+=6;break;case s.OPS.curveTo2:o=c,l=d,i.bezierCurveTo(c,d,t[r],t[r+1],t[r+2],t[r+3]),a.updateCurvePathMinMax(h,o,l,c,d,t[r],t[r+1],t[r+2],t[r+3],p),c=t[r+2],d=t[r+3],r+=4;break;case s.OPS.curveTo3:o=c,l=d,c=t[r+2],d=t[r+3],i.bezierCurveTo(t[r],t[r+1],c,d,c,d),a.updateCurvePathMinMax(h,o,l,t[r],t[r+1],c,d,c,d,p),r+=4;break;case s.OPS.closePath:i.closePath()}u&&a.updateScalingPathMinMax(h,p),a.setCurrentPoint(c,d)}closePath(){this.ctx.closePath()}stroke(e=!0){const t=this.ctx,n=this.current.strokeColor;t.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"==typeof n&&n?.getPattern?(t.save(),t.strokeStyle=n.getPattern(t,this,(0,r.getCurrentTransformInverse)(t),i.PathType.STROKE),this.rescaleAndStroke(!1),t.restore()):this.rescaleAndStroke(!0)),e&&this.consumePath(this.current.getClippedPathBoundingBox()),t.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(e=!0){const t=this.ctx,n=this.current.fillColor;let s=!1;this.current.patternFill&&(t.save(),t.fillStyle=n.getPattern(t,this,(0,r.getCurrentTransformInverse)(t),i.PathType.FILL),s=!0);const a=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==a&&(this.pendingEOFill?(t.fill("evenodd"),this.pendingEOFill=!1):t.fill()),s&&t.restore(),e&&this.consumePath(a)}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=x}eoClip(){this.pendingClip=E}beginText(){this.current.textMatrix=s.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(const n of e)t.setTransform(...n.transform),t.translate(n.x,n.y),n.addToPath(t,n.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),r=this.current;if(!n)throw new Error(`Can't find font for ${e}`);if(r.fontMatrix=n.fontMatrix||s.FONT_IDENTITY_MATRIX,0!==r.fontMatrix[0]&&0!==r.fontMatrix[3]||(0,s.warn)("Invalid font matrix for font "+e),t<0?(t=-t,r.fontDirection=-1):r.fontDirection=1,this.current.font=n,this.current.fontSize=t,n.isType3Font)return;const i=n.loadedName||"sans-serif";let a="normal";n.black?a="900":n.bold&&(a="bold");const o=n.italic?"italic":"normal",l=`"${i}", ${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,s,r,i){this.current.textMatrix=[e,t,n,s,r,i],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){const a=this.ctx,o=this.current,l=o.font,c=o.textRenderingMode,d=o.fontSize/o.fontSizeScale,h=c&s.TextRenderingMode.FILL_STROKE_MASK,u=!!(c&s.TextRenderingMode.ADD_TO_PATH_FLAG),p=o.patternFill&&!l.missingFile;let f;(l.disableFontFace||u||p)&&(f=l.getPathGenerator(this.commonObjs,e)),l.disableFontFace||p?(a.save(),a.translate(t,n),a.beginPath(),f(a,d),i&&a.setTransform(...i),h!==s.TextRenderingMode.FILL&&h!==s.TextRenderingMode.FILL_STROKE||a.fill(),h!==s.TextRenderingMode.STROKE&&h!==s.TextRenderingMode.FILL_STROKE||a.stroke(),a.restore(
2)):(h!==s.TextRenderingMode.FILL&&h!==s.TextRenderingMode.FILL_STROKE||a.fillText(e,t,n),h!==s.TextRenderingMode.STROKE&&h!==s.TextRenderingMode.FILL_STROKE||a.strokeText(e,t,n)),u&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,r.getCurrentTransform)(a),x:t,y:n,fontSize:d,addToPath:f})}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,s.shadow)(this,"isFontSubpixelAAEnabled",n)}showText(e){const t=this.current,n=t.font;if(n.isType3Font)return this.showType3Text(e);const a=t.fontSize;if(0===a)return;const o=this.ctx,l=t.fontSizeScale,c=t.charSpacing,d=t.wordSpacing,h=t.fontDirection,u=t.textHScale*h,p=e.length,f=n.vertical,g=f?1:-1,m=n.defaultVMetrics,b=a*t.fontMatrix[0],_=t.textRenderingMode===s.TextRenderingMode.FILL&&!n.disableFontFace&&!t.patternFill;let v;if(o.save(),o.transform(...t.textMatrix),o.translate(t.x,t.y+t.textRise),h>0?o.scale(u,-1):o.scale(u,1),t.patternFill){o.save();const e=t.fillColor.getPattern(o,this,(0,r.getCurrentTransformInverse)(o),i.PathType.FILL);v=(0,r.getCurrentTransform)(o),o.restore(),o.fillStyle=e}let y=t.lineWidth;const A=t.textMatrixScale;if(0===A||0===y){const e=t.textRenderingMode&s.TextRenderingMode.FILL_STROKE_MASK;e!==s.TextRenderingMode.STROKE&&e!==s.TextRenderingMode.FILL_STROKE||(y=this.getSinglePixelWidth())}else y/=A;if(1!==l&&(o.scale(l,l),y/=l),o.lineWidth=y,n.isInvalidPDFjsFont){const n=[];let s=0;for(const t of e)n.push(t.unicode),s+=t.width;
2return o.fillText(n.join(""),0,0),t.x+=s*b*u,o.restore(),void this.compose()}let S,x=0;for(S=0;S<p;++S){const t=e[S];if("number"==typeof t){x+=g*t*a/1e3;continue}let s=!1;const r=(t.isSpace?d:0)+c,i=t.fontChar,u=t.accent;let p,y,A,E=t.width;if(f){const e=t.vmetric||m,n=-(t.vmetric?e[1]:.5*E)*b,s=e[2]*b;E=e?-e[0]:E,p=n/l,y=(x+s)/l}else p=x/l,y=0;if(n.remeasure&&E>0){const e=1e3*o.measureText(i).width/a*l;if(E<e&&this.isFontSubpixelAAEnabled){const t=E/e;s=!0,o.save(),o.scale(t,1),p/=t}else E!==e&&(p+=(E-e)/2e3*a/l)}if(this.contentVisible&&(t.isInFont||n.missingFile))if(_&&!u)o.fillText(i,p,y);else if(this.paintChar(i,p,y,v),u){const e=p+a*u.offset.x/l,t=y-a*u.offset.y/l;this.paintChar(u.fontChar,e,t,v)}A=f?E*b-r*h:E*b+r*h,x+=A,s&&o.restore()}f?t.y-=x:t.x+=x*u,o.restore(),this.compose()}showType3Text(e){const t=this.ctx,n=this.current,r=n.font,i=n.fontSize,a=n.fontDirection,o=r.vertical?1:-1,l=n.charSpacing,c=n.wordSpacing,d=n.textHScale*a,h=n.fontMatrix||s.FONT_IDENTITY_MATRIX,u=e.length;let p,f,g,m;if(n.textRenderingMode!==s.TextRenderingMode.INVISIBLE&&0!==i){for(this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null,t.save(),t.transform(...n.textMatrix),t.translate(n.x,n.y),t.scale(d,a),p=0;p<u;++p){if(f=e[p],"number"==typeof f){m=o*f*i/1e3,this.ctx.translate(m,0),n.x+=m*d;continue}const a=(f.isSpace?c:0)+l,u=r.charProcOperatorList[f.operatorListId];u?(this.contentVisible&&(this.processingType3=f,this.save(),t.scale(i,i),t.transform(...h),this.executeOperatorList(u),this.restore()),g=s.Util.applyTransform([f.width,0],h)[0]*i+a,t.translate(g,0),n.x+=g*d):(0,s.warn)(`Type3 character "${f.operatorListId}" is not available.`)}t.restore(),this.processingType3=null}}setCharWidth(e,t){}setCharWidthAndBounds(e,t,n,s,r,i){this.ctx.rect(n,s,r-n,i-s),this.ctx.clip(),this.endPath()}getColorN_Pattern(e){let t;if("TilingPattern"===e[0]){const n=e[1],s=this.baseTransform||(0,r.getCurrentTransform)(this.ctx),a={createCanvasGraphics:e=>new C(e,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};t=new i.TilingPattern(e,n,this.ctx,a,s)}else t=this._getPattern(e[1],e[2]);return t}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(e,t,n){const r=s.Util.makeHexColor(e,t,n);this.ctx.strokeStyle=r,this.current.strokeColor=r}setFillRGBColor(e,t,n){const r=s.Util.makeHexColor(e,t,n);this.ctx.fillStyle=r,this.current.fillColor=r,this.current.patternFill=!1}_getPattern(e,t=null){let n;return this.cachedPatterns.has(e)?n=this.cachedPatterns.get(e):(n=(0,i.getShadingPattern)(this.getObject(e)),this.cachedPatterns.set(e,n)),t&&(n.matrix=t),n}shadingFill(e){if(!this.contentVisible)return;const t=this.ctx;this.save();const n=this._getPattern(e);t.fillStyle=n.getPattern(t,this,(0,r.getCurrentTransformInverse)(t),i.PathType.SHADING);const a=(0,r.getCurrentTransformInverse)(t);if(a){const e=t.canvas,n=e.width,r=e.height,i=s.Util.applyTransform([0,0],a),o=s.Util.applyTransform([0,r],a),l=s.Util.applyTransform([n,0],a),c=s.Util.applyTransform([n,r],a),d=Math.min(i[0],o[0],l[0],c[0]),h=Math.min(i[1],o[1],l[1],c[1]),u=Math.max(i[0],o[0],l[0],c[0]),p=Math.max(i[1],o[1],l[1],c[1]);this.ctx.fillRect(d,h,u-d,p-h)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,s.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,s.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(e,t){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(e)&&6===e.length&&this.transform(...e),this.baseTransform=(0,r.getCurrentTransform)(this.ctx),t)){const e=t[2]-t[0],n=t[3]-t[1];this.ctx.rect(t[0],t[1],e,n),this.current.updateRectMinMax((0,r.getCurrentTransform)(this.ctx),t),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const t=this.ctx;
2e.isolated||(0,s.info)("TODO: Support non-isolated groups."),e.knockout&&(0,s.warn)("Knockout groups not supported.");const n=(0,r.getCurrentTransform)(t);if(e.matrix&&t.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let i=s.Util.getAxialAlignedBoundingBox(e.bbox,(0,r.getCurrentTransform)(t));const a=[0,0,t.canvas.width,t.canvas.height];i=s.Util.intersect(i,a)||[0,0,0,0];const o=Math.floor(i[0]),c=Math.floor(i[1]);let d=Math.max(Math.ceil(i[2])-o,1),h=Math.max(Math.ceil(i[3])-c,1),u=1,p=1;d>l&&(u=d/l,d=l),h>l&&(p=h/l,h=l),this.current.startNewPathAndClipBox([0,0,d,h]);let f="groupAt"+this.groupLevel;e.smask&&(f+="_smask_"+this.smaskCounter++%2);const m=this.cachedCanvases.getCanvas(f,d,h),b=m.context;b.scale(1/u,1/p),b.translate(-o,-c),b.transform(...n),e.smask?this.smaskStack.push({canvas:m.canvas,context:b,offsetX:o,offsetY:c,scaleX:u,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(o,c),t.scale(u,p),t.save()),g(t,b),this.ctx=b,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(t),this.groupLevel++}endGroup(e){if(!this.contentVisible)return;this.groupLevel--;const t=this.ctx,n=this.groupStack.pop();if(this.ctx=n,this.ctx.imageSmoothingEnabled=!1,e.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const e=(0,r.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...e);const n=s.Util.getAxialAlignedBoundingBox([0,0,t.canvas.width,t.canvas.height],e);this.ctx.drawImage(t.canvas,0,0),this.ctx.restore(),this.compose(n)}}beginAnnotation(e,t,n,i,a){if(this.#Se(),m(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(t)&&4===t.length){const i=t[2]-t[0],o=t[3]-t[1];if(a&&this.annotationCanvasMap){(n=n.slice())[4]-=t[0],n[5]-=t[1],(t=t.slice())[0]=t[1]=0,t[2]=i,t[3]=o;const[a,l]=s.Util.singularValueDecompose2dScale((0,r.getCurrentTransform)(this.ctx)),{viewportScale:c}=this,d=Math.ceil(i*this.outputScaleX*c),h=Math.ceil(o*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(d,h);const{canvas:u,context:p}=this.annotationCanvas;this.annotationCanvasMap.set(e,u),this.annotationCanvas.savedCtx=this.ctx,this.ctx=p,this.ctx.save(),this.ctx.setTransform(a,0,0,-l,0,o*l),m(this.ctx)}else m(this.ctx),this.ctx.rect(t[0],t[1],i,o),this.ctx.clip(),this.endPath()}this.current=new u(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...n),this.transform(...i)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#xe(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e){if(!this.contentVisible)return;const t=e.count;(e=this.getObject(e.data,e)).count=t;const n=this.ctx,s=this.processingType3;if(s&&(void 0===s.compiled&&(s.compiled=function(e){const{width:t,height:n}=e;if(t>1e3||n>1e3)return null;const s=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),r=t+1;let i,a,o,l=new Uint8Array(r*(n+1));const c=t+7&-8;let d=new Uint8Array(c*n),h=0;for(const t of e.data){let e=128;for(;e>0;)d[h++]=t&e?0:255,e>>=1}let u=0;for(h=0,0!==d[h]&&(l[0]=1,++u),a=1;a<t;a++)d[h]!==d[h+1]&&(l[a]=d[h]?2:1,++u),h++;for(0!==d[h]&&(l[a]=2,++u),i=1;i<n;i++){h=i*c,o=i*r,d[h-c]!==d[h]&&(l[o]=d[h]?1:8,++u);let e=(d[h]?4:0)+(d[h-c]?8:0);for(a=1;a<t;a++)e=(e>>2)+(d[h+1]?4:0)+(d[h-c+1]?8:0),s[e]&&(l[o+a]=s[e],++u),h++;if(d[h-c]!==d[h]&&(l[o+a]=d[h]?2:4,++u),u>1e3)return null}for(h=c*(n-1),o=i*r,0!==d[h]&&(l[o]=8,++u),a=1;a<t;a++)d[h]!==d[h+1]&&(l[o+a]=d[h]?4:8,++u),h++;if(0!==d[h]&&(l[o+a]=4,++u),u>1e3)return null;const p=new Int32Array([0,r,-1,0,-r,0,0,0,1]),f=new Path2D;for(i=0;u&&i<=n;i++){let e=i*r;const n=e+t;for(;e<n&&!l[e];)e++;if(e===n)continue;f.moveTo(e%r,i);const s=e;let a=l[e];do{const t=p[a];do{e+=t}while(!l[e]);const n=l[e];5!==n&&10!==n?(a=n,l[e]=0):(a=n&51*a>>4,l[e]&=a>>2|a<<2),f.lineTo(e%r,e/r|0),l[e]||--u}while(s!==e);--i}return d=null,l=null,function(e){e.save(),e.scale(1/t,-1/n),e.translate(0,-n),e.fill(f),e.beginPath(),e.restore(
2)}}(e)),s.compiled))return void s.compiled(n);const r=this._createMaskCanvas(e),i=r.canvas;n.save(),n.setTransform(1,0,0,1,0,0),n.drawImage(i,r.offsetX,r.offsetY),n.restore(),this.compose()}paintImageMaskXObjectRepeat(e,t,n=0,i=0,a,o){if(!this.contentVisible)return;e=this.getObject(e.data,e);const l=this.ctx;l.save();const c=(0,r.getCurrentTransform)(l);l.transform(t,n,i,a,0,0);const d=this._createMaskCanvas(e);l.setTransform(1,0,0,1,d.offsetX-c[4],d.offsetY-c[5]);for(let e=0,r=o.length;e<r;e+=2){const r=s.Util.transform(c,[t,n,i,a,o[e],o[e+1]]),[h,u]=s.Util.applyTransform([0,0],r);l.drawImage(d.canvas,h,u)}l.restore(),this.compose()}paintImageMaskXObjectGroup(e){if(!this.contentVisible)return;const t=this.ctx,n=this.current.fillColor,s=this.current.patternFill;for(const a of e){const{data:e,width:o,height:l,transform:c}=a,d=this.cachedCanvases.getCanvas("maskCanvas",o,l),u=d.context;u.save(),f(u,this.getObject(e,a)),u.globalCompositeOperation="source-in",u.fillStyle=s?n.getPattern(u,this,(0,r.getCurrentTransformInverse)(t),i.PathType.FILL):n,u.fillRect(0,0,o,l),u.restore(),t.save(),t.transform(...c),t.scale(1,-1),h(t,d.canvas,0,0,o,l,0,-1,1,1),t.restore()}this.compose()}paintImageXObject(e){if(!this.contentVisible)return;const t=this.getObject(e);t?this.paintInlineImageXObject(t):(0,s.warn)("Dependent image isn't ready yet")}paintImageXObjectRepeat(e,t,n,r){if(!this.contentVisible)return;const i=this.getObject(e);if(!i)return void(0,s.warn)("Dependent image isn't ready yet");const a=i.width,o=i.height,l=[];for(let e=0,s=r.length;e<s;e+=2)l.push({transform:[t,0,0,n,r[e],r[e+1]],x:0,y:0,w:a,h:o});this.paintInlineImageXObjectGroup(i,l)}applyTransferMapsToCanvas(e){return"none"!==this.current.transferMaps&&(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter="none"),e.canvas}applyTransferMapsToBitmap(e){if("none"===this.current.transferMaps)return e.bitmap;const{bitmap:t,width:n,height:s}=e,r=this.cachedCanvases.getCanvas("inlineImage",n,s),i=r.context;return i.filter=this.current.transferMaps,i.drawImage(t,0,0),i.filter="none",r.canvas}paintInlineImageXObject(e){if(!this.contentVisible)return;const t=e.width,n=e.height,s=this.ctx;let i;if(this.save(),o.isNodeJS||(s.filter="none"),s.scale(1/t,-1/n),e.bitmap)i=this.applyTransferMapsToBitmap(e);else if("function"==typeof HTMLElement&&e instanceof HTMLElement||!e.data)i=e;else{const s=this.cachedCanvases.getCanvas("inlineImage",t,n).context;p(s,e),i=this.applyTransferMapsToCanvas(s)}const a=this._scaleImage(i,(0,r.getCurrentTransformInverse)(s));s.imageSmoothingEnabled=y((0,r.getCurrentTransform)(s),e.interpolate),h(s,a.img,0,0,a.paintWidth,a.paintHeight,0,-n,t,n),this.compose(),this.restore()}paintInlineImageXObjectGroup(e,t){if(!this.contentVisible)return;const n=this.ctx;let s;if(e.bitmap)s=e.bitmap;else{const t=e.width,n=e.height,r=this.cachedCanvases.getCanvas("inlineImage",t,n).context;p(r,e),s=this.applyTransferMapsToCanvas(r)}for(const e of t)n.save(),n.transform(...e.transform),n.scale(1,-1),h(n,s,e.x,e.y,e.w,e.h,0,-1,1,1),n.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}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(e){const t=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(e);const n=this.ctx;this.pendingClip&&(t||(this.pendingClip===E?n.clip("evenodd"):n.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),n.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const e=(0,r.getCurrentTransform)(this.ctx);if(0===e[1]&&0===e[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(e[0]),Math.abs(e[3]));else{const t=Math.abs(e[0]*e[3]-e[2]*e[1]),n=Math.hypot(e[0],e[2]),s=Math.hypot(e[1],e[3]);this._cachedGetSinglePixelWidth=Math.max(n,s)/t}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(!this._cachedScaleForStroking){const{lineWidth:e}=this.current,t=(0,r.getCurrentTransform)(this.ctx);let n,s;if(0===t[1]&&0===t[2]){const r=Math.abs(t[0]),i=Math.abs(t[3]);if(0===e)n=1/r,s=1/i;else{const t=r*e,a=i*e;n=t<1?1/t:1,s=a<1?1/a:1}}else{const r=Math.abs(t[0]*t[3]-t[2]*t[1]),i=Math.hypot(t[0],t[1]),a=Math.hypot(t[2],t[3]);if(0===e)n=a/r,s=i/r;else{const t=e*r;n=a>t?a/t:1,s=i>t?i/t:1}}this._cachedScaleForStroking=[n,s]}return this._cachedScaleForStroking}rescaleAndStroke(e){const{ctx:t}=this,{lineWidth:n}=this.current,[s,i]=this.getScaleForStroking();if(t.lineWidth=n||1,1===s&&1===i)return void t.stroke();let a,o,l;e&&(a=(0,r.getCurrentTransform)(t),o=t.getLineDash().slice(),l=t.lineDashOffset),t.scale(s,i);const c=Math.max(s,i);t.setLineDash(t.getLineDash().map(e=>e/c)),t.lineDashOffset/=c,t.stroke(),e&&(t.setTransform(...a),t.setLineDash(o),t.lineDashOffset=l)}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}}t.CanvasGraphics=C;for(const e in s.OPS)void 0!==C.prototype[e]&&(C.prototype[s.OPS[e]]=C.prototype[e])},(e,t,n)=>
vendor: 4,263 bytes, line 2
2{Object.defineProperty(t,"__esModule",{value:!0}),t.TilingPattern=t.PathType=void 0,t.getShadingPattern=function(e){switch(e[0]){case"RadialAxial":return new l(e);case"Mesh":return new h(e);case"Dummy":return new u}throw new Error(`Unknown IR type: ${e[0]}`)};var s=n(1),r=n(6);const i={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function a(e,t){if(!t)return;const n=t[2]-t[0],s=t[3]-t[1],r=new Path2D;r.rect(t[0],t[1],n,s),e.clip(r)}t.PathType=i;class o{constructor(){this.constructor===o&&(0,s.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,s.unreachable)("Abstract method `getPattern` called.")}}class l extends o{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}_createGradient(e){let t;"axial"===this._type?t=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(t=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const e of this._colorStops)t.addColorStop(e[0],e[1]);return t}getPattern(e,t,n,o){let l;if(o===i.STROKE||o===i.FILL){const i=t.current.getClippedPathBoundingBox(o,(0,r.getCurrentTransform)(e))||[0,0,0,0],c=Math.ceil(i[2]-i[0])||1,d=Math.ceil(i[3]-i[1])||1,h=t.cachedCanvases.getCanvas("pattern",c,d,!0),u=h.context;u.clearRect(0,0,u.canvas.width,u.canvas.height),u.beginPath(),u.rect(0,0,u.canvas.width,u.canvas.height),u.translate(-i[0],-i[1]),n=s.Util.transform(n,[1,0,0,1,i[0],i[1]]),u.transform(...t.baseTransform),this.matrix&&u.transform(...this.matrix),a(u,this._bbox),u.fillStyle=this._createGradient(u),u.fill(),l=e.createPattern(h.canvas,"no-repeat");const p=new DOMMatrix(n);l.setTransform(p)}else a(e,this._bbox),l=this._createGradient(e);return l}}function c(e,t,n,s,r,i,a,o){const l=t.coords,c=t.colors,d=e.data,h=4*e.width;let u;l[n+1]>l[s+1]&&(u=n,n=s,s=u,u=i,i=a,a=u),l[s+1]>l[r+1]&&(u=s,s=r,r=u,u=a,a=o,o=u),l[n+1]>l[s+1]&&(u=n,n=s,s=u,u=i,i=a,a=u);const p=(l[n]+t.offsetX)*t.scaleX,f=(l[n+1]+t.offsetY)*t.scaleY,g=(l[s]+t.offsetX)*t.scaleX,m=(l[s+1]+t.offsetY)*t.scaleY,b=(l[r]+t.offsetX)*t.scaleX,_=(l[r+1]+t.offsetY)*t.scaleY;if(f>=_)return;const v=c[i],y=c[i+1],A=c[i+2],S=c[a],x=c[a+1],E=c[a+2],C=c[o],P=c[o+1],w=c[o+2],T=Math.round(f),k=Math.round(_);let R,M,F,O,D,I,L,N;for(let e=T;e<=k;e++){if(e<m){let t;t=e<f?0:(f-e)/(f-m),R=p-(p-g)*t,M=v-(v-S)*t,F=y-(y-x)*t,O=A-(A-E)*t}else{let t;t=e>_?1:m===_?0:(m-e)/(m-_),R=g-(g-b)*t,M=S-(S-C)*t,F=x-(x-P)*t,O=E-(E-w)*t}let t;t=e<f?0:e>_?1:(f-e)/(f-_),D=p-(p-b)*t,I=v-(v-C)*t,L=y-(y-P)*t,N=A-(A-w)*t;const n=Math.round(Math.min(R,D)),s=Math.round(Math.max(R,D));let r=h*e+4*n;for(let e=n;e<=s;e++)t=(R-e)/(R-D),t<0?t=0:t>1&&(t=1),d[r++]=M-(M-I)*t|0,d[r++]=F-(F-L)*t|0,d[r++]=O-(O-N)*t|0,d[r++]=255}}function d(e,t,n){const s=t.coords,r=t.colors;let i,a;switch(t.type){case"lattice":const o=t.verticesPerRow,l=Math.floor(s.length/o)-1,d=o-1;for(i=0;i<l;i++){let t=i*o;for(let i=0;i<d;i++,t++)c(e,n,s[t],s[t+1],s[t+o],r[t],r[t+1],r[t+o]),c(e,n,s[t+o+1],s[t+1],s[t+o],r[t+o+1],r[t+1],r[t+o])}break;case"triangles":for(i=0,a=s.length;i<a;i+=3)c(e,n,s[i],s[i+1],s[i+2],r[i],r[i+1],r[i+2]);break;default:throw new Error("illegal figure")}}class h extends o{constructor(e){super(),this._coords=e[2],this._colors=e[3],this._figures=e[4],this._bounds=e[5],this._bbox=e[7],this._background=e[8],this.matrix=null}_createMeshCanvas(e,t,n){const s=Math.floor(this._bounds[0]),r=Math.floor(this._bounds[1]),i=Math.ceil(this._bounds[2])-s,a=Math.ceil(this._bounds[3])-r,o=Math.min(Math.ceil(Math.abs(i*e[0]*1.1)),3e3),l=Math.min(Math.ceil(Math.abs(a*e[1]*1.1)),3e3),c=i/o,h=a/l,u={coords:this._coords,colors:this._colors,offsetX:-s,offsetY:-r,scaleX:1/c,scaleY:1/h},p=o+4,f=l+4,g=n.getCanvas("mesh",p,f,!1),m=g.context,b=m.createImageData(o,l);if(t){const e=b.data;for(let n=0,s=e.length;n<s;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)d(b,e,u);return m.putImageData(b,2,2),{canvas:g.canvas,offsetX:s-2*c,offsetY:r-2*h,scaleX:c,scaleY:h}}getPattern(e,t,n,o){let l;if(a(e,this._bbox),o===i.SHADING)l=s.Util.singularValueDecompose2dScale((0,r.getCurrentTransform)(e));else if(l=s.Util.singularValueDecompose2dScale(t.baseTransform),this.matrix
2){const e=s.Util.singularValueDecompose2dScale(this.matrix);l=[l[0]*e[0],l[1]*e[1]]}const c=this._createMeshCanvas(l,o===i.SHADING?null:this._background,t.cachedCanvases);return o!==i.SHADING&&(e.setTransform(...t.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(c.offsetX,c.offsetY),e.scale(c.scaleX,c.scaleY),e.createPattern(c.canvas,"no-repeat")}}class u extends o{getPattern(){return"hotpink"}}class p{static MAX_PATTERN_SIZE=3e3;constructor(e,t,n,s,r){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=s,this.baseTransform=r}createPatternCanvas(e){const t=this.operatorList,n=this.bbox,i=this.xstep,a=this.ystep,o=this.paintType,l=this.tilingType,c=this.color,d=this.canvasGraphicsFactory;(0,s.info)("TilingType: "+l);const h=n[0],u=n[1],p=n[2],f=n[3],g=s.Util.singularValueDecompose2dScale(this.matrix),m=s.Util.singularValueDecompose2dScale(this.baseTransform),b=[g[0]*m[0],g[1]*m[1]],_=this.getSizeAndScale(i,this.ctx.canvas.width,b[0]),v=this.getSizeAndScale(a,this.ctx.canvas.height,b[1]),y=e.cachedCanvases.getCanvas("pattern",_.size,v.size,!0),A=y.context,S=d.createCanvasGraphics(A);S.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(S,o,c);let x=h,E=u,C=p,P=f;return h<0&&(x=0,C+=Math.abs(h)),u<0&&(E=0,P+=Math.abs(u)),A.translate(-_.scale*x,-v.scale*E),S.transform(_.scale,0,0,v.scale,0,0),A.save(),this.clipBbox(S,x,E,C,P),S.baseTransform=(0,r.getCurrentTransform)(S.ctx),S.executeOperatorList(t),S.endDrawing(),{canvas:y.canvas,scaleX:_.scale,scaleY:v.scale,offsetX:x,offsetY:E}}getSizeAndScale(e,t,n){e=Math.abs(e);const s=Math.max(p.MAX_PATTERN_SIZE,t);let r=Math.ceil(e*n);return r>=s?r=s:n=r/e,{scale:n,size:r}}clipBbox(e,t,n,s,i){const a=s-t,o=i-n;e.ctx.rect(t,n,a,o),e.current.updateRectMinMax((0,r.getCurrentTransform)(e.ctx),[t,n,s,i]),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,t,n){const r=e.ctx,i=e.current;switch(t){case 1:const e=this.ctx;r.fillStyle=e.fillStyle,r.strokeStyle=e.strokeStyle,i.fillColor=e.fillStyle,i.strokeColor=e.strokeStyle;break;case 2:const a=s.Util.makeHexColor(n[0],n[1],n[2]);r.fillStyle=a,r.strokeStyle=a,i.fillColor=a,i.strokeColor=a;break;default:throw new s.FormatError(`Unsupported paint type: ${t}`)}}getPattern(e,t,n,r){let a=n;r!==i.SHADING&&(a=s.Util.transform(a,t.baseTransform),this.matrix&&(a=s.Util.transform(a,this.matrix)));const o=this.createPatternCanvas(t);let l=new DOMMatrix(a);l=l.translate(o.offsetX,o.offsetY),l=l.scale(1/o.scaleX,1/o.scaleY);const c=e.createPattern(o.canvas,"repeat");return c.setTransform(l),c}}t.TilingPattern=p},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.convertBlackAndWhiteToRGBA=r,t.convertToRGBA=function(e){switch(e.kind){case s.ImageKind.GRAYSCALE_1BPP:return r(e);case s.ImageKind.RGB_24BPP:return function({src:e,srcPos:t=0,dest:n,destPos:r=0,width:i,height:a}){let o=0;const l=e.length>>2,c=new Uint32Array(e.buffer,t,l);if(s.FeatureTest.isLittleEndian){for(;o<l-2;o+=3,r+=4){const e=c[o],t=c[o+1],s=c[o+2];n[r]=4278190080|e,n[r+1]=e>>>24|t<<8|4278190080,n[r+2]=t>>>16|s<<16|4278190080,n[r+3]=s>>>8|4278190080}for(let t=4*o,s=e.length;t<s;t+=3)n[r++]=e[t]|e[t+1]<<8|e[t+2]<<16|4278190080}else{for(;o<l-2;o+=3,r+=4){const e=c[o],t=c[o+1],s=c[o+2];n[r]=255|e,n[r+1]=e<<24|t>>>8|255,n[r+2]=t<<16|s>>>16|255,n[r+3]=s<<8|255}for(let t=4*o,s=e.length;t<s;t+=3)n[r++]=e[t]<<24|e[t+1]<<16|e[t+2]<<8|255}return{srcPos:t,destPos:r}}(e)}return null},t.grayToRGBA=function(e,t){if(s.FeatureTest.isLittleEndian)for(let n=0,s=e.length;n<s;n++)t[n]=65793*e[n]|4278190080;else for(let n=0,s=e.length;n<s;n++)t[n]=16843008*e[n]|255};var s=n(1);function r({src:e,srcPos:t=0,dest:n,width:r,height:i,nonBlackColor:a=4294967295,inverseDecode:o=!1}){const l=s.FeatureTest.isLittleEndian?4278190080:255,[c,d]=o?[a,l]:[l,a],h=r>>3,u=7&r,p=e.length;n=new Uint32Array(n.buffer);let f=0;for(let s=0;s<i;s++){for(const s=t+h;t<s;t++){const s=t<p?e[t]:255;n[f++]=128&s?d:c,n[f++]=64&s?d:c,n[f++]=32&s?d:c,n[f++]=16&s?d:c,n[f++]=8&s?d:c,n[f++]=4&s?d:c,n[f++]=2&s?d:c,n[f++]=1&s?d:c}if(0===u)continue;const s=t<p?e[t++]:255;for(let e=0;e<u;e++)n[f++]=s&1<<7-e?d:c}return{srcPos:t,destPos:f}}},(e,t)=>
2{Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalWorkerOptions=void 0;const n=Object.create(null);t.GlobalWorkerOptions=n,n.workerPort=null,n.workerSrc=""},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MessageHandler=void 0;var s=n(1);function r(e){switch(e instanceof Error||"object"==typeof e&&null!==e||(0,s.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),e.name){case"AbortException":return new s.AbortException(e.message);case"MissingPDFException":return new s.MissingPDFException(e.message);case"PasswordException":return new s.PasswordException(e.message,e.code);case"UnexpectedResponseException":return new s.UnexpectedResponseException(e.message,e.status);case"UnknownErrorException":return new s.UnknownErrorException(e.message,e.details);default:return new s.UnknownErrorException(e.message,e.toString())}}t.MessageHandler=class{constructor(e,t,n){this.sourceName=e,this.targetName=t,this.comObj=n,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=e=>{const t=e.data;if(t.targetName!==this.sourceName)return;if(t.stream)return void this.#Ee(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(r(t.reason))}return}const s=this.actionHandler[t.action];if(!s)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const e=this.sourceName,i=t.sourceName;return void new Promise(function(e){e(s(t.data))}).then(function(s){n.postMessage({sourceName:e,targetName:i,callback:1,callbackId:t.callbackId,data:s})},function(s){n.postMessage({sourceName:e,targetName:i,callback:2,callbackId:t.callbackId,reason:r(s)})})}t.streamId?this.#Ce(t):s(t.data)},n.addEventListener("message",this._onComObjOnMessage)}on(e,t){const n=this.actionHandler;if(n[e])throw new Error(`There is already an actionName called "${e}"`);n[e]=t}send(e,t,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},n)}sendWithPromise(e,t,n){const r=this.callbackId++,i=new s.PromiseCapability;this.callbackCapabilities[r]=i;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:r,data:t},n)}catch(e){i.reject(e)}return i.promise}sendWithStream(e,t,n,i){const a=this.streamId++,o=this.sourceName,l=this.targetName,c=this.comObj;return new ReadableStream({start:n=>{const r=new s.PromiseCapability;return this.streamControllers[a]={controller:n,startCall:r,pullCall:null,cancelCall:null,isClosed:!1},c.postMessage({sourceName:o,targetName:l,action:e,streamId:a,data:t,desiredSize:n.desiredSize},i),r.promise},pull:e=>{const t=new s.PromiseCapability;return this.streamControllers[a].pullCall=t,c.postMessage({sourceName:o,targetName:l,stream:6,streamId:a,desiredSize:e.desiredSize}),t.promise},cancel:e=>{(0,s.assert)(e instanceof Error,"cancel must have a valid reason");const t=new s.PromiseCapability;return this.streamControllers[a].cancelCall=t,this.streamControllers[a].isClosed=!0,c.postMessage({sourceName:o,targetName:l,stream:1,streamId:a,reason:r(e)}),t.promise}},n)}#Ce(e){const t=e.streamId,n=this.sourceName,i=e.sourceName,a=this.comObj,o=this,l=this.actionHandler[e.action],c={enqueue(e,r=1,o){if(this.isCancelled)return;const l=this.desiredSize;this.desiredSize-=r,l>0&&this.desiredSize<=0&&(this.sinkCapability=new s.PromiseCapability,this.ready=this.sinkCapability.promise),a.postMessage({sourceName:n,targetName:i,stream:4,streamId:t,chunk:e},o)},close(){this.isCancelled||(this.isCancelled=!0,a.postMessage({sourceName:n,targetName:i,stream:3,streamId:t}),delete o.streamSinks[t])},error(e){(0,s.assert)(e instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,a.postMessage({sourceName:n,targetName:i,stream:5,streamId:t,reason:r(e)}))},sinkCapability:new s.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};c.sinkCapability.resolve(),c.ready=c.sinkCapability.promise,this.streamSinks[t]=c,new Promise(function(t){t(l(e.data,c))}).then(function(){a.postMessage({sourceName:n,targetName:i,stream:8,streamId:t,success:!0})},function(e){a.postMessage({sourceName:n,targetName:i,stream:8,streamId:t,reason:r(e)})})}#Ee(e){const t=e.streamId,n=this.sourceName,i=e.sourceName,a=this.comObj,o=this.streamControllers[t],l=this.streamSinks[t];switch(e.stream){case 8:e.success?o.startCall.resolve():o.startCall.reject(r(e.reason));break;case 7:e.success?o.pullCall.resolve():o.pullCall.reject(r(e.reason));break;case 6:if(!l){a.postMessage({sourceName:n,targetName:i,stream:7,streamId:t,success:!0});break}l.desiredSize<=0&&e.desiredSize>0&&l.sinkCapability.resolve(),l.desiredSize=e.desiredSize,new Promise(function(e){e(l.onPull?.())}).then(function(){a.postMessage({sourceName:n,targetName:i,stream:7,streamId:t,success:!0})},function(e){a.postMessage({sourceName:n,targetName:i,stream:7,streamId:t,reason:r(e)})});break;case 4:if((0,s.assert)(o,"enqueue should have stream controller"),o.isClosed)break;o.controller.enqueue(e.chunk);break;case 3:if((0,s.assert)(o,"close should have stream controller"),o.isClosed)break;o.isClosed=!0,o.controller.close(),this.#Pe(o,t);break;case 5:(0,s.assert)(o,"error should have stream controller"),o.controller.error(r(e.reason)),this.#Pe(o,t);break;case 2:e.success?o.cancelCall.resolve():o.cancelCall.reject(r(e.reason)),this.#Pe(o,t);break;case 1:if(!l)break;new Promise(function(t){t(l.onCancel?.(r(e.reason)))}).then(function(){a.postMessage({sourceName:n,targetName:i,stream:2,streamId:t,success:!0})},function(e){a.postMessage({sourceName:n,targetName:i,stream:2,streamId:t,reason:r(e)})}),l.sinkCapability.reject(r(e.reason)),l.isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}async#Pe(e,t){await Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]),delete this.streamControllers[t]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},(e,t,n)=>
2{Object.defineProperty(t,"__esModule",{value:!0}),t.Metadata=void 0;var s=n(1);t.Metadata=class{#we;#Te;constructor({parsedData:e,rawData:t}){this.#we=e,this.#Te=t}getRaw(){return this.#Te}get(e){return this.#we.get(e)??null}getAll(){return(0,s.objectFromMap)(this.#we)}has(e){return this.#we.has(e)}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OptionalContentConfig=void 0;var s=n(1),r=n(8);const i=Symbol("INTERNAL");class a{#ke=!0;constructor(e,t){this.name=e,this.intent=t}get visible(){return this.#ke}_setVisible(e,t){e!==i&&(0,s.unreachable)("Internal method `_setVisible` called."),this.#ke=t}}t.OptionalContentConfig=class{#Re=null;#Me=new Map;#Fe=null;#Oe=null;constructor(e){if(this.name=null,this.creator=null,null!==e){this.name=e.name,this.creator=e.creator,this.#Oe=e.order;for(const t of e.groups)this.#Me.set(t.id,new a(t.name,t.intent));if("OFF"===e.baseState)for(const e of this.#Me.values())e._setVisible(i,!1);for(const t of e.on)this.#Me.get(t)._setVisible(i,!0);for(const t of e.off)this.#Me.get(t)._setVisible(i,!1);this.#Fe=this.getHash()}}#De(e){const t=e.length;if(t<2)return!0;const n=e[0];for(let r=1;r<t;r++){const t=e[r];let i;if(Array.isArray(t))i=this.#De(t);else{if(!this.#Me.has(t))return(0,s.warn)(`Optional content group not found: ${t}`),!0;i=this.#Me.get(t).visible}switch(n){case"And":if(!i)return!1;break;case"Or":if(i)return!0;break;case"Not":return!i;default:return!0}}return"And"===n}isVisible(e){if(0===this.#Me.size)return!0;if(!e)return(0,s.warn)("Optional content group not defined."),!0;if("OCG"===e.type)return this.#Me.has(e.id)?this.#Me.get(e.id).visible:((0,s.warn)(`Optional content group not found: ${e.id}`),!0);if("OCMD"===e.type){if(e.expression)return this.#De(e.expression);if(!e.policy||"AnyOn"===e.policy){for(const t of e.ids){if(!this.#Me.has(t))return(0,s.warn)(`Optional content group not found: ${t}`),!0;if(this.#Me.get(t).visible)return!0}return!1}if("AllOn"===e.policy){for(const t of e.ids){if(!this.#Me.has(t))return(0,s.warn)(`Optional content group not found: ${t}`),!0;if(!this.#Me.get(t).visible)return!1}return!0}if("AnyOff"===e.policy){for(const t of e.ids){if(!this.#Me.has(t))return(0,s.warn)(`Optional content group not found: ${t}`),!0;if(!this.#Me.get(t).visible)return!0}return!1}if("AllOff"===e.policy){for(const t of e.ids){if(!this.#Me.has(t))return(0,s.warn)(`Optional content group not found: ${t}`),!0;if(this.#Me.get(t).visible)return!1}return!0}return(0,s.warn)(`Unknown optional content policy ${e.policy}.`),!0}return(0,s.warn)(`Unknown group type ${e.type}.`),!0}setVisibility(e,t=!0){this.#Me.has(e)?(this.#Me.get(e)._setVisible(i,!!t),this.#Re=null):(0,s.warn)(`Optional content group not found: ${e}`)}get hasInitialVisibility(){return this.getHash()===this.#Fe}getOrder(){return this.#Me.size?this.#Oe?this.#Oe.slice():[...this.#Me.keys()]:null}getGroups(){return this.#Me.size>0?(0,s.objectFromMap)(this.#Me):null}getGroup(e){return this.#Me.get(e)||null}getHash(){if(null!==this.#Re)return this.#Re;const e=new r.MurmurHash3_64;for(const[t,n]of this.#Me)e.update(`${t}:${n.visible}`);return this.#Re=e.hexdigest()}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}
2),t.PDFDataTransportStream=void 0;var s=n(1),r=n(6);t.PDFDataTransportStream=class{constructor({length:e,initialData:t,progressiveDone:n=!1,contentDispositionFilename:r=null,disableRange:i=!1,disableStream:a=!1},o){if((0,s.assert)(o,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=n,this._contentDispositionFilename=r,t?.length>0){const e=t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer;this._queuedChunks.push(e)}this._pdfDataRangeTransport=o,this._isStreamingSupported=!a,this._isRangeSupported=!i,this._contentLength=e,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((e,t)=>{this._onReceiveData({begin:e,chunk:t})}),this._pdfDataRangeTransport.addProgressListener((e,t)=>{this._onProgress({loaded:e,total:t})}),this._pdfDataRangeTransport.addProgressiveReadListener(e=>{this._onReceiveData({chunk:e})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData({begin:e,chunk:t}){const n=t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer;if(void 0===e)this._fullRequestReader?this._fullRequestReader._enqueue(n):this._queuedChunks.push(n);else{const t=this._rangeReaders.some(function(t){return t._begin===e&&(t._enqueue(n),!0)});(0,s.assert)(t,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(e){void 0===e.total?this._rangeReaders[0]?.onProgress?.({loaded:e.loaded}):this._fullRequestReader?.onProgress?.({loaded:e.loaded,total:e.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){const t=this._rangeReaders.indexOf(e);t>=0&&this._rangeReaders.splice(t,1)}getFullReader(){(0,s.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new i(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?.cancel(e);for(const t of this._rangeReaders.slice(0))t.cancel(e);this._pdfDataRangeTransport.abort()}};class i{constructor(e,t,n=!1,s=null){this._stream=e,this._done=n||!1,this._filename=(0,r.isPdfFile)(s)?s: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=new s.PromiseCapability;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=new s.PromiseCapability;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)=>
2{Object.defineProperty(t,"__esModule",{value:!0}),t.XfaText=void 0;class n{static textContent(e){const t=[],s={items:t,styles:Object.create(null)};return function e(s){if(!s)return;let r=null;const i=s.name;if("#text"===i)r=s.value;else{if(!n.shouldBuildText(i))return;s?.attributes?.textContent?r=s.attributes.textContent:s.value&&(r=s.value)}if(null!==r&&t.push({str:r}),s.children)for(const t of s.children)e(t)}(e),s}static shouldBuildText(e){return!("textarea"===e||"input"===e||"option"===e||"select"===e)}}t.XfaText=n},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeStandardFontDataFactory=t.NodeFilterFactory=t.NodeCanvasFactory=t.NodeCMapReaderFactory=void 0;var s=n(7);const r=function(e){return new Promise((t,n)=>{__webpack_require__("dc22aa3325dcc187556c").readFile(e,(e,s)=>{!e&&s?t(new Uint8Array(s)):n(new Error(e))})})};class i extends s.BaseFilterFactory{}t.NodeFilterFactory=i;class a extends s.BaseCanvasFactory{_createCanvas(e,t){return __webpack_require__("f02338735652ee17f15c").createCanvas(e,t)}}t.NodeCanvasFactory=a;class o extends s.BaseCMapReaderFactory{_fetchData(e,t){return r(e).then(e=>({cMapData:e,compressionType:t}))}}t.NodeCMapReaderFactory=o;class l extends s.BaseStandardFontDataFactory{_fetchData(e){return r(e)}}t.NodeStandardFontDataFactory=l},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFNodeStream=void 0;var s=n(1),r=n(22);const i=__webpack_require__("dc22aa3325dcc187556c"),a=__webpack_require__("8ceafd859ff6b35d1b16"),o=__webpack_require__("d13d1f869c5ac784d367"),l=__webpack_require__("2f9c1ca3d899a4257d6c"),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,s.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new g(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 f(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}};class d{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=new s.PromiseCapability,this._headersCapability=new s.PromiseCapability}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=new s.PromiseCapability,this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",e=>{this._error(e)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new s.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class h{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new s.PromiseCapability;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=new s.PromiseCapability,this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",e=>{this._error(e)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function u(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 d{constructor(e){super(e);const t=t=>
2{if(404===t.statusCode){const e=new s.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:i,suggestedLength:a}=(0,r.validateRangeRequestCapabilities)({getResponseHeader:n,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=i,this._contentLength=a||this._contentLength,this._filename=(0,r.extractFilenameFromHeader)(n)};this._request=null,"http:"===this._url.protocol?this._request=a.request(u(this._url,e.httpHeaders),t):this._request=o.request(u(this._url,e.httpHeaders),t),this._request.on("error",e=>{this._storedError=e,this._headersCapability.reject(e)}),this._request.end()}}class f extends h{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 r=e=>{if(404===e.statusCode){const e=new s.MissingPDFException(`Missing PDF "${this._url}".`);return void(this._storedError=e)}this._setReadableStream(e)};this._request=null,"http:"===this._url.protocol?this._request=a.request(u(this._url,this._httpHeaders),r):this._request=o.request(u(this._url,this._httpHeaders),r),this._request.on("error",e=>{this._storedError=e}),this._request.end()}}class g extends d{constructor(e){super(e);let t=decodeURIComponent(this._url.path);c.test(this._url.href)&&(t=t.replace(/^\//,"")),i.lstat(t,(e,n)=>{if(e)return"ENOENT"===e.code&&(e=new s.MissingPDFException(`Missing PDF "${t}".`)),this._storedError=e,void this._headersCapability.reject(e);this._contentLength=n.size,this._setReadableStream(i.createReadStream(t)),this._headersCapability.resolve()})}}class m extends h{constructor(e,t,n){super(e);let s=decodeURIComponent(this._url.path);c.test(this._url.href)&&(s=s.replace(/^\//,"")),this._setReadableStream(i.createReadStream(s,{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 s.MissingPDFException('Missing PDF "'+t+'".'):new s.UnexpectedResponseException(`Unexpected server response (${e}) while retrieving PDF "${t}".`,e)},t.extractFilenameFromHeader=function(e){const t=e("Content-Disposition");if(t){let e=(0,r.getFilenameFromContentDispositionHeader)(t);if(e.includes("%"))try{e=decodeURIComponent(e)}catch(e){}if((0,i.isPdfFile)(e))return e}return null},t.validateRangeRequestCapabilities=function({getResponseHeader:e,isHttp:t,rangeChunkSize:n,disableRange:s}){const r={allowRangeRequests:!1,suggestedLength:void 0},i=parseInt(e("Content-Length"),10);return Number.isInteger(i)?(r.suggestedLength=i,i<=2*n||s||!t||"bytes"!==e("Accept-Ranges")||"identity"!==(e("Content-Encoding")||"identity")||(r.allowRangeRequests=!0),r):r},t.validateResponseStatus=function(e){return 200===e||206===e};var s=n(1),r=n(23),i=n(6)},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getFilenameFromContentDispositionHeader=function(e){let t=!0,n=r("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 s=r("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(n=s.exec(e));){let[,e,s,r]=n;if(e=parseInt(e,10),e in t){if(0===e)break}else t[e]=[s,r]}const i=[];for(let e=0;e<t.length&&e in t;++e){let[n,s]=t[e];s=o(s),n&&(s=unescape(s),0===e&&(s=l(s))),i.push(s)}return i.join("")}(e),n)return a(c(n));if(n=r("filename","i").exec(e),n){n=n[1];let e=o(n);return e=c(e),a(e)}function r(e,t){return new RegExp("(?:^|;)\\s*"+e+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',t)}function i(e,n){if(e){if(!/^[\x00-\xFF]+$/.test(n))return n;try{const r=new TextDecoder(e,{fatal:!0}),i=(0,s.stringToBytes)(n);n=r.decode(i),t=!1}catch(e){}}return n}function a(e){return t&&/[\x80-\xff]/.test(e)&&(e=i("utf-8",e),t&&(e=i("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].replaceAll(/\\(.)/g,"$1")}e=t.join('"')}return e}function l(e){const t=e.indexOf("'");return-1===t?e:i(e.slice(0,t),e.slice(t+1).replace(/^[^']*'/,""))}function c(e){return!e.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(e)?e:e.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(e,t,n,s){if("q"===n||"Q"===n)return i(t,s=(s=s.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,function(e,t){return String.fromCharCode(parseInt(t,16))}));try{s=atob(s)}catch(e){}return i(t,s)})}return""};var s=n(1)},(e,t,n)=>
2{Object.defineProperty(t,"__esModule",{value:!0}),t.PDFNetworkStream=void 0;var s=n(1),r=n(22);class i{constructor(e,t={}){this.url=e,this.isHttp=/^https?:/i.test(e),this.httpHeaders=this.isHttp&&t.httpHeaders||Object.create(null),this.withCredentials=t.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(e,t,n){const s={begin:e,end:t};for(const e in n)s[e]=n[e];return this.request(s)}requestFull(e){return this.request(e)}request(e){const t=new XMLHttpRequest,n=this.currXhrId++,s=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}`),s.expectedStatus=206):s.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),s.onHeadersReceived=e.onHeadersReceived,s.onDone=e.onDone,s.onError=e.onError,s.onProgress=e.onProgress,t.send(null),n}onProgress(e,t){const n=this.pendingRequests[e];n&&n.onProgress?.(t)}onStateChange(e,t){const n=this.pendingRequests[e];if(!n)return;const r=n.xhr;if(r.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),4!==r.readyState)return;if(!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],0===r.status&&this.isHttp)return void n.onError?.(r.status);const i=r.status||200;if((200!==i||206!==n.expectedStatus)&&i!==n.expectedStatus)return void n.onError?.(r.status);const a=function(e){const t=e.response;return"string"!=typeof t?t:(0,s.stringToBytes)(t).buffer}(r);if(206===i){const e=r.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?.(r.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 i(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,s.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?.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=new s.PromiseCapability,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:s,suggestedLength:i}=(0,r.validateRangeRequestCapabilities)({getResponseHeader:n,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});s&&(this._isRangeSupported=!0),this._contentLength=i||this._contentLength,this._filename=(0,r.extractFilenameFromHeader)(n),this._isRangeSupported&&this._manager.abortRequest
2(e),this._headersReceivedCapability.resolve()}_onDone(e){if(e&&(this._requests.length>0?this._requests.shift().resolve({value:e.chunk,done:!1}):this._cachedChunks.push(e.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=(0,r.createResponseStatusError)(e,this._url),this._headersReceivedCapability.reject(this._storedError);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){this.onProgress?.({loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=new s.PromiseCapability;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 s={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._requestId=e.requestRange(t,n,s),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(e){const t=e.chunk;this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunk=t,this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError=(0,r.createResponseStatusError)(e,this._url);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){this.isStreamingSupported||this.onProgress?.({loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const e=new s.PromiseCapability;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 s=n(1),r=n(22);function i(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 s=e[n];void 0!==s&&t.append(n,s)}return t}function o(e){return e instanceof Uint8Array?e.buffer:e instanceof ArrayBuffer?e:((0,s.warn)(`getArrayBuffer - unexpected data format: ${e}`),new Uint8Array(e).buffer)}t.PDFFetchStream=class{constructor(e){this.source=e,this.isHttp=/^https?:/i.test(e.url),this.httpHeaders=this.isHttp&&e.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,s.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new l(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=new c(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}};class l{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;const t=e.source;this._withCredentials=t.withCredentials||!1,this._contentLength=t.length,this._headersCapability=new s.PromiseCapability,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._headers=a(this._stream.httpHeaders);const n=t.url;fetch(n,i(this._headers,this._withCredentials,this._abortController)).then(e=>{if(!(0,r.validateResponseStatus)(e.status))throw(0,r.createResponseStatusError)(e.status,n);this._reader=e.body.getReader(),this._headersCapability.resolve();const t=t=>e.headers.get(t),{allowRangeRequests:i,suggestedLength:a}=(0,r.validateRangeRequestCapabilities)({getResponseHeader:t,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=i,this._contentLength=a||this._contentLength,this._filename=(0,r.extractFilenameFromHeader)(t),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new s.AbortException("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:o(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}class c{constructor(e,t,n){this._stream=e,this._reader=null,this._loaded=0;const o=e.source;this._withCredentials=o.withCredentials||!1,this._readCapability=new s.PromiseCapability,this._isStreamingSupported=!o.disableStream,this._abortController=new AbortController,this._headers=a(this._stream.httpHeaders),this._headers.append("Range",`bytes=${t}-${n-1}`);const l=o.url;fetch(l,i(this._headers,this._withCredentials,this._abortController)).then(e=>{if(!(0,r.validateResponseStatus)(e.status))throw(0,r.createResponseStatusError)(e.status,l);this._readCapability.resolve(),this._reader=e.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded}),{value:o(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}},(e,t,n)=>
2{Object.defineProperty(t,"__esModule",{value:!0}),t.TextLayerRenderTask=void 0,t.renderTextLayer=function(e){e.textContentSource||!e.textContent&&!e.textContentStream||((0,r.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),e.textContentSource=e.textContent||e.textContentStream);const{container:t,viewport:n}=e,s=getComputedStyle(t),i=s.getPropertyValue("visibility"),a=parseFloat(s.getPropertyValue("--scale-factor"));"visible"===i&&(!a||Math.abs(a-n.scale)>1e-5)&&console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM.");const o=new d(e);return o._render(),o},t.updateTextLayer=function({container:e,viewport:t,textDivs:n,textDivProperties:s,isOffscreenCanvasSupported:i,mustRotate:a=!0,mustRescale:l=!0}){if(a&&(0,r.setLayerDimensions)(e,{rotation:t.rotation}),l){const e=o(0,i),r={prevFontSize:null,prevFontFamily:null,div:null,scale:t.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:e};for(const e of n)r.properties=s.get(e),r.div=e,c(r)}};var s=n(1),r=n(6);const i=30,a=new Map;function o(e,t){let n;if(t&&s.FeatureTest.isOffscreenCanvasSupported)n=new OffscreenCanvas(e,e).getContext("2d",{alpha:!1});else{const t=document.createElement("canvas");t.width=t.height=e,n=t.getContext("2d",{alpha:!1})}return n}function l(e,t,n){const r=document.createElement("span"),l={angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};e._textDivs.push(r);const c=s.Util.transform(e._transform,t.transform);let d=Math.atan2(c[1],c[0]);const h=n[t.fontName];h.vertical&&(d+=Math.PI/2);const u=Math.hypot(c[2],c[3]),p=u*function(e,t){const n=a.get(e);if(n)return n;const s=o(i,t);s.font=`30px ${e}`;const r=s.measureText("");let l=r.fontBoundingBoxAscent,c=Math.abs(r.fontBoundingBoxDescent);if(l){const t=l/(l+c);return a.set(e,t),s.canvas.width=s.canvas.height=0,t}s.strokeStyle="red",s.clearRect(0,0,i,i),s.strokeText("g",0,0);let d=s.getImageData(0,0,i,i).data;c=0;for(let e=d.length-1-3;e>=0;e-=4)if(d[e]>0){c=Math.ceil(e/4/i);break}s.clearRect(0,0,i,i),s.strokeText("A",0,i),d=s.getImageData(0,0,i,i).data,l=0;for(let e=0,t=d.length;e<t;e+=4)if(d[e]>0){l=i-Math.floor(e/4/i);break}if(s.canvas.width=s.canvas.height=0,l){const t=l/(l+c);return a.set(e,t),t}return a.set(e,.8),.8}(h.fontFamily,e._isOffscreenCanvasSupported);let f,g;0===d?(f=c[4],g=c[5]-p):(f=c[4]+p*Math.sin(d),g=c[5]-p*Math.cos(d));const m="calc(var(--scale-factor)*",b=r.style;e._container===e._rootContainer?(b.left=`${(100*f/e._pageWidth).toFixed(2)}%`,b.top=`${(100*g/e._pageHeight).toFixed(2)}%`):(b.left=`${m}${f.toFixed(2)}px)`,b.top=`${m}${g.toFixed(2)}px)`),b.fontSize=`${m}${u.toFixed(2)}px)`,b.fontFamily=h.fontFamily,l.fontSize=u,r.setAttribute("role","presentation"),r.textContent=t.str,r.dir=t.dir,e._fontInspectorEnabled&&(r.dataset.fontName=t.fontName),0!==d&&(l.angle=d*(180/Math.PI));let _=!1;if(t.str.length>1)_=!0;else if(" "!==t.str&&t.transform[0]!==t.transform[3]){const e=Math.abs(t.transform[0]),n=Math.abs(t.transform[3]);e!==n&&Math.max(e,n)/Math.min(e,n)>1.5&&(_=!0)}_&&(l.canvasWidth=h.vertical?t.height:t.width),e._textDivProperties.set(r,l),e._isReadableStream&&e._layoutText(r)}function c(e){const{div:t,scale:n,properties:s,ctx:r,prevFontSize:i,prevFontFamily:a}=e,{style:o}=t;let l="";if(0!==s.canvasWidth&&s.hasText){const{fontFamily:c}=o,{canvasWidth:d,fontSize:h}=s;i===h&&a===c||(r.font=`${h*n}px ${c}`,e.prevFontSize=h,e.prevFontFamily=c);const{width:u}=r.measureText(t.textContent);u>0&&(l=`scaleX(${d*n/u})`)}0!==s.angle&&(l=`rotate(${s.angle}deg) ${l}`),l.length>0&&(o.transform=l)}class d{constructor({textContentSource:e,container:t,viewport:n,textDivs:i,textDivProperties:a,textContentItemsStr:l,isOffscreenCanvasSupported:c}){this._textContentSource=e,this._isReadableStream=e instanceof ReadableStream,this._container=this._rootContainer=t,this._textDivs=i||[],this._textContentItemsStr=l||[],this._isOffscreenCanvasSupported=c,this._fontInspectorEnabled=!!globalThis.FontInspector?.enabled,this._reader=null,this._textDivProperties=a||new WeakMap,this._canceled=!1,this._capability=new s.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:n.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:o(0,c)};const{pageWidth:d,pageHeight:h,pageX:u,pageY:p}=n.rawDims;this._transform=[1,0,0,-1,-u,p+h],this._pageWidth=d,this._pageHeight=h,(0,r.setLayerDimensions)(t,n),this._capability.promise.finally(()=>{this._layoutTextParams=null}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new s.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._capability.reject(new s.AbortException("TextLayer task cancelled."))}_processItems(e,t){for(const n of e)if(void 0!==n.str)this._textContentItemsStr.push(n.str),l(this,n,t);else if("beginMarkedContentProps"===n.type||"beginMarkedContent"===n.type){const e=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),null!==n.id&&this._container.setAttribute("id",`${n.id}`),e.append(this._container)}else"endMarkedContent"===n.type&&(this._container=this._container.parentNode)}_layoutText(e){const t=this._layoutTextParams.properties=this._textDivProperties.get(e);if(this._layoutTextParams.div=e,c(this._layoutTextParams),t.hasText&&this._container.append(e),t.hasEOL){const e=document.createElement("br");e.setAttribute("role","presentation"),this._container.append(e)}}_render(){const e=new s.PromiseCapability;let t=Object.create(null);if(this._isReadableStream){const n=()=>{this._reader.read().then(({value:s,done:r})=>{r?e.resolve():(Object.assign(t,s.styles),this._processItems(s.items,t),n())},e.reject)};this._reader=this._textContentSource.getReader(),n()}else{if(!this._textContentSource)throw new Error('No "textContentSource" parameter specified.');{const{items:t,styles:n}=this._textContentSource;this._processItems(t,n),e.resolve()}}e.promise.then(()=>{t=null,function(e){if(e._canceled)return;const t=e._textDivs,n=e._capability;if(t.length>1e5)n.resolve();else{if(!e._isReadableStream)for(const n of t)e._layoutText(n);n.resolve()}}(this)},this._capability.reject)}}t.TextLayerRenderTask=d},(e,t,n)=>
2{Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationEditorLayer=void 0;var s=n(1),r=n(5),i=n(28),a=n(29),o=n(6);class l{#Ie;#Le=!1;#Ne=this.pointerup.bind(this);#je=this.pointerdown.bind(this);#Be=new Map;#Ue=!1;#qe=!1;#We;static _initialized=!1;constructor(e){l._initialized||(l._initialized=!0,i.FreeTextEditor.initialize(e.l10n),a.InkEditor.initialize(e.l10n)),e.uiManager.registerEditorTypes([i.FreeTextEditor,a.InkEditor]),this.#We=e.uiManager,this.pageIndex=e.pageIndex,this.div=e.div,this.#Ie=e.accessibilityManager,this.#We.addLayer(this)}get isEmpty(){return 0===this.#Be.size}updateToolbar(e){this.#We.updateToolbar(e)}updateMode(e=this.#We.getMode()){this.#He(),e===s.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),this.#We.unselectAll(),e!==s.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",e===s.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",e===s.AnnotationEditorType.INK),this.div.hidden=!1)}addInkEditorIfNeeded(e){if(e||this.#We.getMode()===s.AnnotationEditorType.INK){if(!e)for(const e of this.#Be.values())if(e.isEmpty())return void e.setInBackground();this.#Ge({offsetX:0,offsetY:0}).setInBackground()}}setEditingState(e){this.#We.setEditingState(e)}addCommands(e){this.#We.addCommands(e)}enable(){this.div.style.pointerEvents="auto";for(const e of this.#Be.values())e.enableEditing()}disable(){this.div.style.pointerEvents="none";for(const e of this.#Be.values())e.disableEditing();this.#He(),this.isEmpty&&(this.div.hidden=!0)}setActiveEditor(e){this.#We.getActive()!==e&&this.#We.setActiveEditor(e)}enableClick(){this.div.addEventListener("pointerdown",this.#je),this.div.addEventListener("pointerup",this.#Ne)}disableClick(){this.div.removeEventListener("pointerdown",this.#je),this.div.removeEventListener("pointerup",this.#Ne)}attach(e){this.#Be.set(e.id,e)}detach(e){this.#Be.delete(e.id),this.#Ie?.removePointerInTextLayer(e.contentDiv)}remove(e){this.#We.removeEditor(e),this.detach(e),e.div.style.display="none",setTimeout(()=>{e.div.style.display="",e.div.remove(),e.isAttachedToDOM=!1,document.activeElement===document.body&&this.#We.focusMainContainer()},0),this.#qe||this.addInkEditorIfNeeded(!1)}#Ve(e){e.parent!==this&&(this.attach(e),e.parent?.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}add(e){if(this.#Ve(e),this.#We.addEditor(e),this.attach(e),!e.isAttachedToDOM){const t=e.render();this.div.append(t),e.isAttachedToDOM=!0}this.moveEditorInDOM(e),e.onceAdded(),this.#We.addToAnnotationStorage(e)}moveEditorInDOM(e){this.#Ie?.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?e.rebuild():this.add(e)}addANewEditor(e){this.addCommands({cmd:()=>{this.addOrRebuild(e)},undo:()=>{e.remove()},mustExec:!0})}addUndoableEditor(e){this.addCommands({cmd:()=>{this.addOrRebuild(e)},undo:()=>{e.remove()},mustExec:!1})}getNextId(){return this.#We.getId()}#ze(e){switch(this.#We.getMode()){case s.AnnotationEditorType.FREETEXT:return new i.FreeTextEditor(e);case s.AnnotationEditorType.INK:return new a.InkEditor(e)}return null}deserialize(e){switch(e.annotationType){case s.AnnotationEditorType.FREETEXT:return i.FreeTextEditor.deserialize(e,this,this.#We);case s.AnnotationEditorType.INK:return a.InkEditor.deserialize(e,this,this.#We)}return null}#Ge(e){const t=this.getNextId(),n=this.#ze({parent:this,id:t,x:e.offsetX,y:e.offsetY,uiManager:this.#We});return n&&this.add(n),n}setSelected(e){this.#We.setSelected(e)}toggleSelected(e){this.#We.toggleSelected(e)}isSelected(e){return this.#We.isSelected(e)}unselect(e){this.#We.unselect(e)}pointerup(e){const{isMac:t}=s.FeatureTest.platform;0!==e.button||e.ctrlKey&&t||e.target===this.div&&this.#Ue&&(this.#Ue=!1,this.#Le?this.#Ge(e):this.#Le=!0)}pointerdown(e){const{isMac:t}=s.FeatureTest.platform;if(0!==e.button||e.ctrlKey&&t)return;if(e.target!==this.div)return;this.#Ue=!0;const n=this.#We.getActive();this.#Le=!n||n.isEmpty()}drop(e){const t=e.dataTransfer.getData("text/plain"),n=this.#We.getEditor(t);if(!n)return;e.preventDefault(),e.dataTransfer.dropEffect="move",this.#Ve(n);const s=this.div.getBoundingClientRect(),r=e.clientX-s.x,i=e.clientY-s.y;n.translate(r-n.startX,i-n.startY),this.moveEditorInDOM(n),n.div.focus()}dragover(e){e.preventDefault()}destroy(){this.#We.getActive()?.parent===this&&this.#We.setActiveEditor(null);for(const e of this.#Be.values())this.#Ie?.removePointerInTextLayer(e.contentDiv),e.setParent(null),e.isAttachedToDOM=!1,e.div.remove();this.div=null,this.#Be.clear(),this.#We.removeLayer(this)}#He(){this.#qe=!0;for(const e of this.#Be.values())e.isEmpty()&&e.remove();this.#qe=!1}render({viewport:e}){this.viewport=e,(0,o.setLayerDimensions)(this.div,e),(0,r.bindEvents)(this,this.div,["dragover","drop"]);for(const e of this.#We.getEditors(this.pageIndex))this.add(e);this.updateMode()}update({viewport:e}){this.#We.commitOrRemove(),this.viewport=e,(0,o.setLayerDimensions)(this.div,{rotation:e.rotation}),this.updateMode()}get pageDimensions(){const{pageWidth:e,pageHeight:t}=this.viewport.rawDims;return[e,t]}}t.AnnotationEditorLayer=l},(e,t,n)=>
2{Object.defineProperty(t,"__esModule",{value:!0}),t.FreeTextEditor=void 0;var s=n(1),r=n(5),i=n(4);class a extends i.AnnotationEditor{#$e=this.editorDivBlur.bind(this);#Xe=this.editorDivFocus.bind(this);#Ye=this.editorDivInput.bind(this);#Ke=this.editorDivKeydown.bind(this);#Je;#Qe="";#Ze=`${this.id}-editor`;#et=!1;#tt;static _freeTextDefaultContent="";static _l10nPromise;static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static _keyboardManager=new r.KeyboardManager([[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],a.prototype.commitOrRemove]]);static _type="freetext";constructor(e){super({...e,name:"freeTextEditor"}),this.#Je=e.color||a._defaultColor||i.AnnotationEditor._defaultLineColor,this.#tt=e.fontSize||a._defaultFontSize}static initialize(e){this._l10nPromise=new Map(["free_text2_default_content","editor_free_text2_aria_label"].map(t=>[t,e.get(t)]));const t=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(t.getPropertyValue("--freetext-padding"))}static updateDefaultParams(e,t){switch(e){case s.AnnotationEditorParamsType.FREETEXT_SIZE:a._defaultFontSize=t;break;case s.AnnotationEditorParamsType.FREETEXT_COLOR:a._defaultColor=t}}updateParams(e,t){switch(e){case s.AnnotationEditorParamsType.FREETEXT_SIZE:this.#nt(t);break;case s.AnnotationEditorParamsType.FREETEXT_COLOR:this.#st(t)}}static get defaultPropertiesToUpdate(){return[[s.AnnotationEditorParamsType.FREETEXT_SIZE,a._defaultFontSize],[s.AnnotationEditorParamsType.FREETEXT_COLOR,a._defaultColor||i.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[s.AnnotationEditorParamsType.FREETEXT_SIZE,this.#tt],[s.AnnotationEditorParamsType.FREETEXT_COLOR,this.#Je]]}#nt(e){const t=e=>{this.editorDiv.style.fontSize=`calc(${e}px * var(--scale-factor))`,this.translate(0,-(e-this.#tt)*this.parentScale),this.#tt=e,this.#rt()},n=this.#tt;this.addCommands({cmd:()=>{t(e)},undo:()=>{t(n)},mustExec:!0,type:s.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#st(e){const t=this.#Je;this.addCommands({cmd:()=>{this.#Je=this.editorDiv.style.color=e},undo:()=>{this.#Je=this.editorDiv.style.color=t},mustExec:!0,type:s.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}getInitialTranslation(){const e=this.parentScale;return[-a._internalPadding*e,-(a._internalPadding+this.#tt)*e]}rebuild(){super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(s.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this.div.draggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",this.#Ke),this.editorDiv.addEventListener("focus",this.#Xe),this.editorDiv.addEventListener("blur",this.#$e),this.editorDiv.addEventListener("input",this.#Ye))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#Ze),this.div.draggable=!0,this.editorDiv.removeEventListener("keydown",this.#Ke),this.editorDiv.removeEventListener("focus",this.#Xe),this.editorDiv.removeEventListener("blur",this.#$e),this.editorDiv.removeEventListener("input",this.#Ye),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(e){super.focusin(e),e.target!==this.editorDiv&&this.editorDiv.focus()}onceAdded(){this.width||(this.enableEditMode(),this.editorDiv.focus())}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent.setEditingState(!0),this.parent.div.classList.add("freeTextEditing"),super.remove()}#it(){const e=this.editorDiv.getElementsByTagName("div");if(0===e.length)return this.editorDiv.innerText;const t=[];for(const n of e)t.push(n.innerText.replace(/\r\n?|\n/,""));return t.join("\n")}#rt(){const[e,t]=this.parentDimensions;let n;if(this.isAttachedToDOM)n=this.div.getBoundingClientRect();else{const{currentLayer:e,div:t}=this,s=t.style.display;t.style.display="hidden",e.div.append(this.div),n=t.getBoundingClientRect(),t.remove(),t.style.display=s}this.width=n.width/e,this.height=n.height/t}commit(){this.isInEditMode()&&(super.commit(),this.#et||(this.#et=!0,this.parent.addUndoableEditor(this)),this.disableEditMode(),this.#Qe=this.#it().trimEnd(),this.#rt())}
2shouldGetKeyboardEvents(){return this.isInEditMode()}dblclick(e){this.enableEditMode(),this.editorDiv.focus()}keydown(e){e.target===this.div&&"Enter"===e.key&&(this.enableEditMode(),this.editorDiv.focus())}editorDivKeydown(e){a._keyboardManager.exec(this,e)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){this.parent.div.classList.toggle("freeTextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let e,t;this.width&&(e=this.x,t=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#Ze),this.enableEditing(),a._l10nPromise.get("editor_free_text2_aria_label").then(e=>this.editorDiv?.setAttribute("aria-label",e)),a._l10nPromise.get("free_text2_default_content").then(e=>this.editorDiv?.setAttribute("default-content",e)),this.editorDiv.contentEditable=!0;const{style:n}=this.editorDiv;if(n.fontSize=`calc(${this.#tt}px * var(--scale-factor))`,n.color=this.#Je,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,r.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[n,s]=this.parentDimensions;this.setAt(e*n,t*s,this.width*n,this.height*s);for(const e of this.#Qe.split("\n")){const t=document.createElement("div");t.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(t)}this.div.draggable=!0,this.editorDiv.contentEditable=!1}else this.div.draggable=!1,this.editorDiv.contentEditable=!0;return this.div}get contentDiv(){return this.editorDiv}static deserialize(e,t,n){const r=super.deserialize(e,t,n);return r.#tt=e.fontSize,r.#Je=s.Util.makeHexColor(...e.color),r.#Qe=e.value,r}serialize(){if(this.isEmpty())return null;const e=a._internalPadding*this.parentScale,t=this.getRect(e,e),n=i.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#Je);return{annotationType:s.AnnotationEditorType.FREETEXT,color:n,fontSize:this.#tt,value:this.#Qe,pageIndex:this.pageIndex,rect:t,rotation:this.rotation}}}t.FreeTextEditor=a},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InkEditor=void 0,Object.defineProperty(t,"fitCurve",{enumerable:!0,get:function(){return i.fitCurve}});var s=n(1),r=n(4),i=n(30),a=n(5);const o=16;class l extends r.AnnotationEditor{#at=0;#ot=0;#lt=0;#ct=this.canvasPointermove.bind(this);#dt=this.canvasPointerleave.bind(this);#ht=this.canvasPointerup.bind(this);#ut=this.canvasPointerdown.bind(this);#pt=!1;#ft=!1;#gt=null;#mt=null;#bt=0;#_t=0;#vt=null;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=1;static _l10nPromise;static _type="ink";constructor(e){super({...e,name:"inkEditor"}),this.color=e.color||null,this.thickness=e.thickness||null,this.opacity=e.opacity||null,this.paths=[],this.bezierPath2D=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0}static initialize(e){this._l10nPromise=new Map(["editor_ink_canvas_aria_label","editor_ink2_aria_label"].map(t=>[t,e.get(t)]))}static updateDefaultParams(e,t){switch(e){case s.AnnotationEditorParamsType.INK_THICKNESS:l._defaultThickness=t;break;case s.AnnotationEditorParamsType.INK_COLOR:l._defaultColor=t;break;case s.AnnotationEditorParamsType.INK_OPACITY:l._defaultOpacity=t/100}}updateParams(e,t){switch(e){case s.AnnotationEditorParamsType.INK_THICKNESS:this.#yt(t);break;case s.AnnotationEditorParamsType.INK_COLOR:this.#st(t);break;case s.AnnotationEditorParamsType.INK_OPACITY:this.#At(t)}}static get defaultPropertiesToUpdate(){return[[s.AnnotationEditorParamsType.INK_THICKNESS,l._defaultThickness],[s.AnnotationEditorParamsType.INK_COLOR,l._defaultColor||r.AnnotationEditor._defaultLineColor],[s.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*l._defaultOpacity)]]}get propertiesToUpdate(){return[[s.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||l._defaultThickness],[s.AnnotationEditorParamsType.INK_COLOR,this.color||l._defaultColor||r.AnnotationEditor._defaultLineColor],[s.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??l._defaultOpacity))]]}#yt(e){const t=this.thickness;this.addCommands({cmd:()=>{this.thickness=e,this.#St()},undo:()=>{this.thickness=t,this.#St()},mustExec:!0,type:s.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}
2#st(e){const t=this.color;this.addCommands({cmd:()=>{this.color=e,this.#xt()},undo:()=>{this.color=t,this.#xt()},mustExec:!0,type:s.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}#At(e){e/=100;const t=this.opacity;this.addCommands({cmd:()=>{this.opacity=e,this.#xt()},undo:()=>{this.opacity=t,this.#xt()},mustExec:!0,type:s.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}rebuild(){super.rebuild(),null!==this.div&&(this.canvas||(this.#Et(),this.#Ct()),this.isAttachedToDOM||(this.parent.add(this),this.#Pt()),this.#St())}remove(){null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,this.#mt.disconnect(),this.#mt=null,super.remove())}setParent(e){!this.parent&&e?this._uiManager.removeShouldRescale(this):this.parent&&null===e&&this._uiManager.addShouldRescale(this),super.setParent(e)}onScaleChanging(){const[e,t]=this.parentDimensions,n=this.width*e,s=this.height*t;this.setDimensions(n,s)}enableEditMode(){this.#pt||null===this.canvas||(super.enableEditMode(),this.div.draggable=!1,this.canvas.addEventListener("pointerdown",this.#ut),this.canvas.addEventListener("pointerup",this.#ht))}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this.div.draggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",this.#ut),this.canvas.removeEventListener("pointerup",this.#ht))}onceAdded(){this.div.draggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}#wt(){const{parentRotation:e,parentDimensions:[t,n]}=this;switch(e){case 90:return[0,n,n,t];case 180:return[t,n,t,n];case 270:return[t,0,n,t];default:return[0,0,t,n]}}#Tt(){const{ctx:e,color:t,opacity:n,thickness:s,parentScale:r,scaleFactor:i}=this;e.lineWidth=s*r/i,e.lineCap="round",e.lineJoin="round",e.miterLimit=10,e.strokeStyle=`${t}${(0,a.opacityToHex)(n)}`}#kt(e,t){this.isEditing=!0,this.#ft||(this.#ft=!0,this.#Pt(),this.thickness||=l._defaultThickness,this.color||=l._defaultColor||r.AnnotationEditor._defaultLineColor,this.opacity??=l._defaultOpacity),this.currentPath.push([e,t]),this.#gt=null,this.#Tt(),this.ctx.beginPath(),this.ctx.moveTo(e,t),this.#vt=()=>{this.#vt&&(this.#gt&&(this.isEmpty()?(this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)):this.#xt(),this.ctx.lineTo(...this.#gt),this.#gt=null,this.ctx.stroke()),window.requestAnimationFrame(this.#vt))},window.requestAnimationFrame(this.#vt)}#Rt(e,t){const[n,s]=this.currentPath.at(-1);e===n&&t===s||(this.currentPath.push([e,t]),this.#gt=[e,t])}#Mt(e,t){this.ctx.closePath(),this.#vt=null,e=Math.min(Math.max(e,0),this.canvas.width),t=Math.min(Math.max(t,0),this.canvas.height);const[n,s]=this.currentPath.at(-1);let r;if(e===n&&t===s||this.currentPath.push([e,t]),1!==this.currentPath.length)r=(0,i.fitCurve)(this.currentPath,30,null);else{const n=[e,t];r=[[n,n.slice(),n.slice(),n]]}const a=l.#Ft(r);this.currentPath.length=0,this.addCommands({cmd:()=>{this.paths.push(r),this.bezierPath2D.push(a),this.rebuild()},undo:()=>{this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(this.#Et(),this.#Ct()),this.#St())},mustExec:!0})}#xt(){if(this.isEmpty())return void this.#Ot();this.#Tt();const{canvas:e,ctx:t}=this;t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,e.width,e.height),this.#Ot();for(const e of this.bezierPath2D)t.stroke(e)}commit(){this.#pt||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),this.#pt=!0,this.div.classList.add("disabled"),this.#St(!0),this.parent.addInkEditorIfNeeded(!0),this.parent.moveEditorInDOM(this),this.div.focus({preventScroll:!0}))}focusin(e){super.focusin(e),this.enableEditMode()}canvasPointerdown(e){0===e.button&&this.isInEditMode()&&!this.#pt&&(this.setInForeground(),"mouse"!==e.type&&this.div.focus(),e.stopPropagation(),this.canvas.addEventListener("pointerleave",this.#dt),this.canvas.addEventListener("pointermove",this.#ct),this.#kt(e.offsetX,e.offsetY))}canvasPointermove(e){e.stopPropagation(),this.#Rt(e.offsetX,e.offsetY)}canvasPointerup(e){0===e.button&&this.isInEditMode()&&0!==this.currentPath.length&&(e.stopPropagation(),this.#Dt(e),this.setInBackgroun
2d())}canvasPointerleave(e){this.#Dt(e),this.setInBackground()}#Dt(e){this.#Mt(e.offsetX,e.offsetY),this.canvas.removeEventListener("pointerleave",this.#dt),this.canvas.removeEventListener("pointermove",this.#ct),this.addToAnnotationStorage()}#Et(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",l._l10nPromise.get("editor_ink_canvas_aria_label").then(e=>this.canvas?.setAttribute("aria-label",e)),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}#Ct(){this.#mt=new ResizeObserver(e=>{const t=e[0].contentRect;t.width&&t.height&&this.setDimensions(t.width,t.height)}),this.#mt.observe(this.div)}render(){if(this.div)return this.div;let e,t;this.width&&(e=this.x,t=this.y),super.render(),l._l10nPromise.get("editor_ink2_aria_label").then(e=>this.div?.setAttribute("aria-label",e));const[n,s,r,i]=this.#wt();if(this.setAt(n,s,0,0),this.setDims(r,i),this.#Et(),this.width){const[n,s]=this.parentDimensions;this.setAt(e*n,t*s,this.width*n,this.height*s),this.#ft=!0,this.#Pt(),this.setDims(this.width*n,this.height*s),this.#xt(),this.#It(),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return this.#Ct(),this.div}#Pt(){if(!this.#ft)return;const[e,t]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*e),this.canvas.height=Math.ceil(this.height*t),this.#Ot()}setDimensions(e,t){const n=Math.round(e),s=Math.round(t);if(this.#bt===n&&this.#_t===s)return;this.#bt=n,this.#_t=s,this.canvas.style.visibility="hidden",this.#at&&Math.abs(this.#at-e/t)>.01&&(t=Math.ceil(e/this.#at),this.setDims(e,t));const[r,i]=this.parentDimensions;this.width=e/r,this.height=t/i,this.#pt&&this.#Lt(e,t),this.#Pt(),this.#xt(),this.canvas.style.visibility="visible",this.fixDims()}#Lt(e,t){const n=this.#Nt(),s=(e-n)/this.#lt,r=(t-n)/this.#ot;this.scaleFactor=Math.min(s,r)}#Ot(){const e=this.#Nt()/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+e,this.translationY*this.scaleFactor+e)}static#Ft(e){const t=new Path2D;for(let n=0,s=e.length;n<s;n++){const[s,r,i,a]=e[n];0===n&&t.moveTo(...s),t.bezierCurveTo(r[0],r[1],i[0],i[1],a[0],a[1])}return t}#jt(e,t,n,s){const r=[],i=this.thickness/2;let a,o;for(const l of this.paths){a=[],o=[];for(let r=0,c=l.length;r<c;r++){const[c,d,h,u]=l[r],p=e*(c[0]+t)+i,f=s-e*(c[1]+n)-i,g=e*(d[0]+t)+i,m=s-e*(d[1]+n)-i,b=e*(h[0]+t)+i,_=s-e*(h[1]+n)-i,v=e*(u[0]+t)+i,y=s-e*(u[1]+n)-i;0===r&&(a.push(p,f),o.push(p,f)),a.push(g,m,b,_,v,y),this.#Bt(p,f,g,m,b,_,v,y,4,o)}r.push({bezier:a,points:o})}return r}#Bt(e,t,n,s,r,i,a,o,l,c){if(this.#Ut(e,t,n,s,r,i,a,o))c.push(a,o);else{for(let d=1;d<l-1;d++){const h=d/l,u=1-h;let p=h*e+u*n,f=h*t+u*s,g=h*n+u*r,m=h*s+u*i;p=h*p+u*g,f=h*f+u*m,g=h*g+u*(h*r+u*a),m=h*m+u*(h*i+u*o),p=h*p+u*g,f=h*f+u*m,c.push(p,f)}c.push(a,o)}}#Ut(e,t,n,s,r,i,a,o){const l=(3*n-2*e-a)**2,c=(3*s-2*t-o)**2,d=(3*r-e-2*a)**2,h=(3*i-t-2*o)**2;return Math.max(l,d)+Math.max(c,h)<=10}#qt(){let e=1/0,t=-1/0,n=1/0,r=-1/0;for(const i of this.paths)for(const[a,o,l,c]of i){const i=s.Util.bezierBoundingBox(...a,...o,...l,...c);e=Math.min(e,i[0]),n=Math.min(n,i[1]),t=Math.max(t,i[2]),r=Math.max(r,i[3])}return[e,n,t,r]}#Nt(){return this.#pt?Math.ceil(this.thickness*this.parentScale):0}#St(e=!1){if(this.isEmpty())return;if(!this.#pt)return void this.#xt();const t=this.#qt(),n=this.#Nt();this.#lt=Math.max(o,t[2]-t[0]),this.#ot=Math.max(o,t[3]-t[1]);const s=Math.ceil(n+this.#lt*this.scaleFactor),r=Math.ceil(n+this.#ot*this.scaleFactor),[i,a]=this.parentDimensions;this.width=s/i,this.height=r/a,this.#at=s/r,this.#It();const l=this.translationX,c=this.translationY;this.translationX=-t[0],this.translationY=-t[1],this.#Pt(),this.#xt(),this.#bt=s,this.#_t=r,this.setDims(s,r);const d=e?n/this.scaleFactor/2:0;this.translate(l-this.translationX-d,c-this.translationY-d)}#It(){const{style:e}=this.div;this.#at>=1?(e.minHeight="16px",e.minWidth=`${Math.round(this.#at*o)}px`):(e.minWidth="16px",e.minHeight=`${Math.round(o/this.#at)}px`)}static deserialize(e,t,n){const r=super.deserialize(e,t,n);r.thickness=e.thickness,r.color=s.Util.makeHexColor(...e.color),r.opacity=e.opacity;const[i,a]=r.pageDimensions,l=r.width*i,c=r.height*a,d=r.parentScale,h=e.thickness/2;r.#at=l/c,r.#pt=!0,r.#bt=Math.round(l),r.#_t=Math.round(c);for(const{bezier:t}of e.paths){const e=[];r.paths.push(e);
2let n=d*(t[0]-h),s=d*(c-t[1]-h);for(let r=2,i=t.length;r<i;r+=6){const i=d*(t[r]-h),a=d*(c-t[r+1]-h),o=d*(t[r+2]-h),l=d*(c-t[r+3]-h),u=d*(t[r+4]-h),p=d*(c-t[r+5]-h);e.push([[n,s],[i,a],[o,l],[u,p]]),n=u,s=p}const i=this.#Ft(e);r.bezierPath2D.push(i)}const u=r.#qt();return r.#lt=Math.max(o,u[2]-u[0]),r.#ot=Math.max(o,u[3]-u[1]),r.#Lt(l,c),r}serialize(){if(this.isEmpty())return null;const e=this.getRect(0,0),t=this.rotation%180==0?e[3]-e[1]:e[2]-e[0],n=r.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:s.AnnotationEditorType.INK,color:n,thickness:this.thickness,opacity:this.opacity,paths:this.#jt(this.scaleFactor/this.parentScale,this.translationX,this.translationY,t),pageIndex:this.pageIndex,rect:e,rotation:this.rotation}}}t.InkEditor=l},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.fitCurve=void 0;const s=n(31);t.fitCurve=s},e=>{function t(e,r,i,a,o){var c,d,h,u,p,f,g,m,b,_,v,y,A;if(2===e.length)return y=l.vectorLen(l.subtract(e[0],e[1]))/3,[c=[e[0],l.addArrays(e[0],l.mulItems(r,y)),l.addArrays(e[1],l.mulItems(i,y)),e[1]]];if(d=function(e){var t,n,s,r=[];return e.forEach((e,i)=>{t=i?n+l.vectorLen(l.subtract(e,s)):0,r.push(t),n=t,s=e}),r=r.map(e=>e/n)}(e),[c,u,f]=n(e,d,d,r,i,o),0===u||u<a)return[c];if(u<a*a)for(h=d,p=u,g=f,A=0;A<20;A++){if(h=s(c,e,h),[c,u,f]=n(e,d,h,r,i,o),u<a)return[c];if(f===g){let e=u/p;if(e>.9999&&e<1.0001)break}p=u,g=f}return v=[],(m=l.subtract(e[f-1],e[f+1])).every(e=>0===e)&&(m=l.subtract(e[f-1],e[f]),[m[0],m[1]]=[-m[1],m[0]]),b=l.normalize(m),_=l.mulItems(b,-1),(v=v.concat(t(e.slice(0,f+1),r,b,a,o))).concat(t(e.slice(f),_,i,a,o))}function n(e,t,n,s,r,o){var d,h,u;return d=function(e,t,n,s){var r,i,a,o,d,h,u,p,f,g,m,b,_,v,y,A,S,x=e[0],E=e[e.length-1];for(r=[x,null,null,E],i=l.zeros_Xx2x2(t.length),_=0,v=t.length;_<v;_++)S=1-(A=t[_]),(a=i[_])[0]=l.mulItems(n,3*A*(S*S)),a[1]=l.mulItems(s,3*S*(A*A));for(o=[[0,0],[0,0]],d=[0,0],_=0,v=e.length;_<v;_++)A=t[_],a=i[_],o[0][0]+=l.dot(a[0],a[0]),o[0][1]+=l.dot(a[0],a[1]),o[1][0]+=l.dot(a[0],a[1]),o[1][1]+=l.dot(a[1],a[1]),y=l.subtract(e[_],c.q([x,x,E,E],A)),d[0]+=l.dot(a[0],y),d[1]+=l.dot(a[1],y);return h=o[0][0]*o[1][1]-o[1][0]*o[0][1],u=o[0][0]*d[1]-o[1][0]*d[0],p=d[0]*o[1][1]-d[1]*o[0][1],g=0===h?0:u/h,(f=0===h?0:p/h)<(m=1e-6*(b=l.vectorLen(l.subtract(x,E))))||g<m?(r[1]=l.addArrays(x,l.mulItems(n,b/3)),r[2]=l.addArrays(E,l.mulItems(s,b/3))):(r[1]=l.addArrays(x,l.mulItems(n,f)),r[2]=l.addArrays(E,l.mulItems(s,g))),r}(e,n,s,r),[h,u]=function(e,t,n){var s,r,o,d,h,u,p,f;r=0,o=Math.floor(e.length/2);const g=i(t,10);for(h=0,u=e.length;h<u;h++)p=e[h],f=a(0,n[h],g,10),(s=(d=l.subtract(c.q(t,f),p))[0]*d[0]+d[1]*d[1])>r&&(r=s,o=h);return[r,o]}(e,d,t),o&&o({bez:d,points:e,params:t,maxErr:h,maxPoint:u}),[d,h,u]}function s(e,t,n){return n.map((n,s)=>r(e,t[s],n))}function r(e,t,n){var s=l.subtract(c.q(e,n),t),r=c.qprime(e,n),i=l.mulMatrix(s,r),a=l.sum(l.squareItems(r))+2*l.mulMatrix(s,c.qprimeprime(e,n));return 0===a?n:n-i/a}var i=function(e,t){for(var n,s=[0],r=e[0],i=0,a=1;a<=t;a++)n=c.q(e,a/t),i+=l.vectorLen(l.subtract(n,r)),s.push(i),r=n;return s.map(e=>e/i)};function a(e,t,n,s){if(t<0)return 0;if(t>1)return 1;for(var r,i,a,o,l=1;l<=s;l++)if(t<=n[l]){a=(l-1)/s,i=l/s,o=(t-(r=n[l-1]))/(n[l]-r)*(i-a)+a;break}return o}function o(e,t){return l.normalize(l.subtract(e,t))}class l{static zeros_Xx2x2(e){for(var t=[];e--;)t.push([0,0]);return t}static mulItems(e,t){return e.map(e=>e*t)}static mulMatrix(e,t){return e.reduce((e,n,s)=>e+n*t[s],0)}static subtract(e,t){return e.map((e,n)=>e-t[n])}static addArrays(e,t){return e.map((e,n)=>e+t[n])}static addItems(e,t){return e.map(e=>e+t)}static sum(e){return e.reduce((e,t)=>e+t)}static dot(e,t){return l.mulMatrix(e,t)}static vectorLen(e){return Math.hypot(...e)}static divItems(e,t){return e.map(e=>e/t)}static squareItems(e){return e.map(e=>e*e)}static normalize(e){return this.divItems(e,this.vectorLen(e))}}
2class c{static q(e,t){var n=1-t,s=l.mulItems(e[0],n*n*n),r=l.mulItems(e[1],3*n*n*t),i=l.mulItems(e[2],3*n*t*t),a=l.mulItems(e[3],t*t*t);return l.addArrays(l.addArrays(s,r),l.addArrays(i,a))}static qprime(e,t){var n=1-t,s=l.mulItems(l.subtract(e[1],e[0]),3*n*n),r=l.mulItems(l.subtract(e[2],e[1]),6*n*t),i=l.mulItems(l.subtract(e[3],e[2]),3*t*t);return l.addArrays(l.addArrays(s,r),i)}static qprimeprime(e,t){return l.addArrays(l.mulItems(l.addArrays(l.subtract(e[2],l.mulItems(e[1],2)),e[0]),6*(1-t)),l.mulItems(l.addArrays(l.subtract(e[3],l.mulItems(e[2],2)),e[1]),6*t))}}e.exports=function(e,n,s){if(!Array.isArray(e))throw new TypeError("First argument should be an array");if(e.forEach(t=>{if(!Array.isArray(t)||t.some(e=>"number"!=typeof e)||t.length!==e[0].length)throw Error("Each point should be an array of numbers. Each point should have the same amount of numbers.")}),(e=e.filter((t,n)=>0===n||!t.every((t,s)=>t===e[n-1][s]))).length<2)return[];const r=e.length,i=o(e[1],e[0]),a=o(e[r-2],e[r-1]);return t(e,i,a,n,s)},e.exports.fitCubic=t,e.exports.createTangent=o},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationLayer=void 0;var s=n(1),r=n(6),i=n(3),a=n(33),o=n(34);const l=1e3,c=new WeakSet;function d(e){return{width:e[2]-e[0],height:e[3]-e[1]}}class h{static create(e){switch(e.data.annotationType){case s.AnnotationType.LINK:return new p(e);case s.AnnotationType.TEXT:return new f(e);case s.AnnotationType.WIDGET:switch(e.data.fieldType){case"Tx":return new m(e);case"Btn":return e.data.radioButton?new _(e):e.data.checkBox?new b(e):new v(e);case"Ch":return new y(e)}return new g(e);case s.AnnotationType.POPUP:return new A(e);case s.AnnotationType.FREETEXT:return new x(e);case s.AnnotationType.LINE:return new E(e);case s.AnnotationType.SQUARE:return new C(e);case s.AnnotationType.CIRCLE:return new P(e);case s.AnnotationType.POLYLINE:return new w(e);case s.AnnotationType.CARET:return new k(e);case s.AnnotationType.INK:return new R(e);case s.AnnotationType.POLYGON:return new T(e);case s.AnnotationType.HIGHLIGHT:return new M(e);case s.AnnotationType.UNDERLINE:return new F(e);case s.AnnotationType.SQUIGGLY:return new O(e);case s.AnnotationType.STRIKEOUT:return new D(e);case s.AnnotationType.STAMP:return new I(e);case s.AnnotationType.FILEATTACHMENT:return new L(e);default:return new u(e)}}}class u{constructor(e,{isRenderable:t=!1,ignoreBorder:n=!1,createQuadrilaterals:s=!1}={}){this.isRenderable=t,this.data=e.data,this.layer=e.layer,this.page=e.page,this.viewport=e.viewport,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,t&&(this.container=this._createContainer(n)),s&&(this.quadrilaterals=this._createQuadrilaterals(n))}_createContainer(e=!1){const{data:t,page:n,viewport:r}=this,i=document.createElement("section");i.setAttribute("data-annotation-id",t.id),t.noRotate&&i.classList.add("norotate");const{pageWidth:a,pageHeight:o,pageX:l,pageY:c}=r.rawDims,{width:h,height:u}=d(t.rect),p=s.Util.normalizeRect([t.rect[0],n.view[3]-t.rect[1]+n.view[1],t.rect[2],n.view[3]-t.rect[3]+n.view[1]]);if(!e&&t.borderStyle.width>0){i.style.borderWidth=`${t.borderStyle.width}px`;const e=t.borderStyle.horizontalCornerRadius,n=t.borderStyle.verticalCornerRadius;if(e>0||n>0){const t=`calc(${e}px * var(--scale-factor)) / calc(${n}px * var(--scale-factor))`;i.style.borderRadius=t}else if(this instanceof _){const e=`calc(${h}px * var(--scale-factor)) / calc(${u}px * var(--scale-factor))`;i.style.borderRadius=e}switch(t.borderStyle.style){case s.AnnotationBorderStyleType.SOLID:i.style.borderStyle="solid";break;case s.AnnotationBorderStyleType.DASHED:i.style.borderStyle="dashed";break;case s.AnnotationBorderStyleType.BEVELED:(0,s.warn)("Unimplemented border style: beveled");break;case s.AnnotationBorderStyleType.INSET:(0,s.warn)("Unimplemented border style: inset");break;case s.AnnotationBorderStyleType.UNDERLINE:i.style.borderBottomStyle="solid"}const r=t.borderColor||null;r?i.style.borderColor=s.Util.makeHexColor(0|r[0],0|r[1],0|r[2]):i.style.borderWidth=0}i.style.left=100*(p[0]-l)/a+"%",i.style.top=100*(p[1]-c)/o+"%";const{rotation:f}=t;return t.hasOwnCanvas||0===f?(i.style.width=100*h/a+"%",i.style.height=100*u/o+"%"):this.setRotation(f,i),i}setRotation(e,t=this.container){const{pageWidth:n,pageHeight:s}=this.viewport.rawDims,{width:r,height:i}=d(this.data.rect);let a,o;e%180==0?(a=100*r/n,o=100*i/s):(a=100*i/n,o=100*r/s),t.style.width=`${a}%`,t.style.height=`${o}%`,t.setAttribute("data-main-rotation",(360-e)%360)}
2get _commonActions(){const e=(e,t,n)=>{const s=n.detail[e];n.target.style[t]=a.ColorConverters[`${s[0]}_HTML`](s.slice(1))};return(0,s.shadow)(this,"_commonActions",{display:e=>{const t=e.detail.display%2==1;this.container.style.visibility=t?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:t,print:0===e.detail.display||3===e.detail.display})},print:e=>{this.annotationStorage.setValue(this.data.id,{print:e.detail.print})},hidden:e=>{this.container.style.visibility=e.detail.hidden?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:e.detail.hidden})},focus:e=>{setTimeout(()=>e.target.focus({preventScroll:!1}),0)},userName:e=>{e.target.title=e.detail.userName},readonly:e=>{e.detail.readonly?e.target.setAttribute("readonly",""):e.target.removeAttribute("readonly")},required:e=>{this._setRequired(e.target,e.detail.required)},bgColor:t=>{e("bgColor","backgroundColor",t)},fillColor:t=>{e("fillColor","backgroundColor",t)},fgColor:t=>{e("fgColor","color",t)},textColor:t=>{e("textColor","color",t)},borderColor:t=>{e("borderColor","borderColor",t)},strokeColor:t=>{e("strokeColor","borderColor",t)},rotation:e=>{const t=e.detail.rotation;this.setRotation(t),this.annotationStorage.setValue(this.data.id,{rotation:t})}})}_dispatchEventFromSandbox(e,t){const n=this._commonActions;for(const s of Object.keys(t.detail)){const r=e[s]||n[s];r?.(t)}}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;const t=this.annotationStorage.getRawValue(this.data.id);if(!t)return;const n=this._commonActions;for(const[s,r]of Object.entries(t)){const i=n[s];i&&(i({detail:{[s]:r},target:e}),delete t[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||=this.quadrilaterals,n=this.quadrilaterals[0]),e||((e=document.createElement("div")).classList.add("popupTriggerArea"),n.append(e));const s=new S({container:n,trigger:e,color:t.color,titleObj:t.titleObj,modificationDate:t.modificationDate,contentsObj:t.contentsObj,richText:t.richText,hideWrapper:!0}).render();s.style.left="100%",n.append(s)}_renderQuadrilaterals(e){for(const t of this.quadrilaterals)t.classList.add(e);return this.quadrilaterals}render(){(0,s.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,t=null){const n=[];if(this._fieldObjects){const r=this._fieldObjects[e];if(r)for(const{page:e,id:i,exportValues:a}of r){if(-1===e)continue;if(i===t)continue;const r="string"==typeof a?a:null,o=document.querySelector(`[data-element-id="${i}"]`);!o||c.has(o)?n.push({id:i,exportValue:r,domElement:o}):(0,s.warn)(`_getElementsByName - element not allowed: ${i}`)}return n}for(const s of document.getElementsByName(e)){const{exportValue:e}=s,r=s.getAttribute("data-element-id");r!==t&&c.has(s)&&n.push({id:r,exportValue:e,domElement:s})}return n}}class p extends u{constructor(e,t=null){super(e,{isRenderable:!0,ignoreBorder:!!t?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=e.data.isTooltipOnly}render(){const{data:e,linkService:t}=this,n=document.createElement("a");n.setAttribute("data-element-id",e.id);let s=!1;return e.url?(t.addLinkAttributes(n,e.url,e.newWindow),s=!0):e.action?(this._bindNamedAction(n,e.action),s=!0):e.attachment?(this._bindAttachment(n,e.attachment),s=!0):e.setOCGState?(this.#Wt(n,e.setOCGState),s=!0):e.dest?(this._bindLink(n,e.dest),s=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(n,e),s=!0),e.resetForm?(this._bindResetFormAction(n,e.resetForm),s=!0):this.isTooltipOnly&&!s&&(this._bindLink(n,""),s=!0)),this.quadrilaterals?this._renderQuadrilaterals("linkAnnotation").map((e,t)=>{const s=0===t?n:n.cloneNode();return e.append(s),e}):(this.container.classList.add("linkAnnotation"),s&&this.container.append(n),this.container)}#Ht(){this.container.setAttribute("data-internal-link","")}_bindLink(e,t){e.href=this.linkService.getDestinationHash(t),e.onclick=()=>(t&&this.linkService.goToDestination(t),!1),(t||""===t)&&this.#Ht()}_bindNamedAction(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(t),!1),this.#Ht()}_bindAttachment(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.downloadManager?.openOrDownloadData(this.container,t.content,t.filename),!1),this.#Ht()}#Wt(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeSetOCGState(t),!1),this.#Ht()}_bindJSAction(e,t){e.href=this.linkService.getAnchorUrl("");const n=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const s of Object.keys(t.actions)){const r=n.get(s);r&&(e[r]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t.id,name:s}}),!1))}e.onclick||(e.onclick=()=>!1),this.#Ht()}
2_bindResetFormAction(e,t){const n=e.onclick;if(n||(e.href=this.linkService.getAnchorUrl("")),this.#Ht(),!this._fieldObjects)return(0,s.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(n||(e.onclick=()=>!1));e.onclick=()=>{n?.();const{fields:e,refs:r,include:i}=t,a=[];if(0!==e.length||0!==r.length){const t=new Set(r);for(const n of e){const e=this._fieldObjects[n]||[];for(const{id:n}of e)t.add(n)}for(const e of Object.values(this._fieldObjects))for(const n of e)t.has(n.id)===i&&a.push(n)}else for(const e of Object.values(this._fieldObjects))a.push(...e);const o=this.annotationStorage,l=[];for(const e of a){const{id:t}=e;switch(l.push(t),e.type){case"text":{const n=e.defaultValue||"";o.setValue(t,{value:n});break}case"checkbox":case"radiobutton":{const n=e.defaultValue===e.exportValues;o.setValue(t,{value:n});break}case"combobox":case"listbox":{const n=e.defaultValue||"";o.setValue(t,{value:n});break}default:continue}const n=document.querySelector(`[data-element-id="${t}"]`);n&&(c.has(n)?n.dispatchEvent(new Event("resetform")):(0,s.warn)(`_bindResetFormAction - element not allowed: ${t}`))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:l,name:"ResetForm"}}),!1}}}class f extends u{constructor(e){super(e,{isRenderable:!!(e.data.hasPopup||e.data.titleObj?.str||e.data.contentsObj?.str||e.data.richText?.str)})}render(){this.container.classList.add("textAnnotation");const e=document.createElement("img");return e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.alt="[{{type}} Annotation]",e.dataset.l10nId="text_annotation_type",e.dataset.l10nArgs=JSON.stringify({type:this.data.name}),this.data.hasPopup||this._createPopup(e,this.data),this.container.append(e),this.container}}class g extends u{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}showElementAndHideCanvas(e){this.data.hasOwnCanvas&&("CANVAS"===e.previousSibling?.nodeName&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){const{isWin:t,isMac:n}=s.FeatureTest.platform;return t&&e.ctrlKey||n&&e.metaKey}_setEventListener(e,t,n,s){t.includes("mouse")?e.addEventListener(t,e=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:s(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:s(e)}})})}_setEventListeners(e,t,n){for(const[s,r]of t)("Action"===r||this.data.actions?.[r])&&this._setEventListener(e,s,r,n)}_setBackgroundColor(e){const t=this.data.backgroundColor||null;e.style.backgroundColor=null===t?"transparent":s.Util.makeHexColor(t[0],t[1],t[2])}_setTextStyle(e){const{fontColor:t}=this.data.defaultAppearanceData,n=this.data.defaultAppearanceData.fontSize||9,r=e.style;let i;const a=e=>Math.round(10*e)/10;if(this.data.multiLine){const e=Math.abs(this.data.rect[3]-this.data.rect[1]-2),t=e/(Math.round(e/(s.LINE_FACTOR*n))||1);i=Math.min(n,a(t/s.LINE_FACTOR))}else{const e=Math.abs(this.data.rect[3]-this.data.rect[1]-2);i=Math.min(n,a(e/s.LINE_FACTOR))}r.fontSize=`calc(${i}px * var(--scale-factor))`,r.color=s.Util.makeHexColor(t[0],t[1],t[2]),null!==this.data.textAlignment&&(r.textAlign=["left","center","right"][this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",t)}}class m extends g{constructor(e){super(e,{isRenderable:e.renderForms||!e.data.hasAppearance&&!!e.data.fieldValue})}setPropertyOnSiblings(e,t,n,s){const r=this.annotationStorage;
vendor: 8,692 bytes, line 2
2for(const i of this._getElementsByName(e.name,e.id))i.domElement&&(i.domElement[t]=n),r.setValue(i.id,{[s]:n})}render(){const e=this.annotationStorage,t=this.data.id;this.container.classList.add("textWidgetAnnotation");let n=null;if(this.renderForms){const s=e.getValue(t,{value:this.data.fieldValue});let r=s.formattedValue||s.value||"";const i=e.getValue(t,{charLimit:this.data.maxLen}).charLimit;i&&r.length>i&&(r=r.slice(0,i));const a={userValue:r,formattedValue:null,lastCommittedValue:null,commitKey:1};this.data.multiLine?(n=document.createElement("textarea"),n.textContent=r,this.data.doNotScroll&&(n.style.overflowY="hidden")):(n=document.createElement("input"),n.type="text",n.setAttribute("value",r),this.data.doNotScroll&&(n.style.overflowX="hidden")),this.data.hasOwnCanvas&&(n.hidden=!0),c.add(n),n.setAttribute("data-element-id",t),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=l,this._setRequired(n,this.data.required),i&&(n.maxLength=i),n.addEventListener("input",s=>{e.setValue(t,{value:s.target.value}),this.setPropertyOnSiblings(n,"value",s.target.value,"value")}),n.addEventListener("resetform",e=>{const t=this.data.defaultFieldValue??"";n.value=a.userValue=t,a.formattedValue=null});let o=e=>{const{formattedValue:t}=a;null!=t&&(e.target.value=t),e.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){n.addEventListener("focus",e=>{const{target:t}=e;a.userValue&&(t.value=a.userValue),a.lastCommittedValue=t.value,a.commitKey=1}),n.addEventListener("updatefromsandbox",n=>{this.showElementAndHideCanvas(n.target);const s={value(n){a.userValue=n.detail.value??"",e.setValue(t,{value:a.userValue.toString()}),n.target.value=a.userValue},formattedValue(n){const{formattedValue:s}=n.detail;a.formattedValue=s,null!=s&&n.target!==document.activeElement&&(n.target.value=s),e.setValue(t,{formattedValue:s})},selRange(e){e.target.setSelectionRange(...e.detail.selRange)},charLimit:n=>{const{charLimit:s}=n.detail,{target:r}=n;if(0===s)return void r.removeAttribute("maxLength");r.setAttribute("maxLength",s);let i=a.userValue;!i||i.length<=s||(i=i.slice(0,s),r.value=a.userValue=i,e.setValue(t,{value:i}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:i,willCommit:!0,commitKey:1,selStart:r.selectionStart,selEnd:r.selectionEnd}}))}};this._dispatchEventFromSandbox(s,n)}),n.addEventListener("keydown",e=>{a.commitKey=1;let n=-1;if("Escape"===e.key?n=0:"Enter"!==e.key||this.data.multiLine?"Tab"===e.key&&(a.commitKey=3):n=2,-1===n)return;const{value:s}=e.target;a.lastCommittedValue!==s&&(a.lastCommittedValue=s,a.userValue=s,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:s,willCommit:!0,commitKey:n,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}))});const s=o;o=null,n.addEventListener("blur",e=>{if(!e.relatedTarget)return;const{value:n}=e.target;a.userValue=n,a.lastCommittedValue!==n&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:n,willCommit:!0,commitKey:a.commitKey,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}),s(e)}),this.data.actions?.Keystroke&&n.addEventListener("beforeinput",e=>{a.lastCommittedValue=null;const{data:n,target:s}=e,{value:r,selectionStart:i,selectionEnd:o}=s;let l=i,c=o;switch(e.inputType){case"deleteWordBackward":{const e=r.substring(0,i).match(/\w*[^\w]*$/);e&&(l-=e[0].length);break}case"deleteWordForward":{const e=r.substring(i).match(/^[^\w]*\w*/);e&&(c+=e[0].length);break}case"deleteContentBackward":i===o&&(l-=1);break;case"deleteContentForward":i===o&&(c+=1)}e.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:r,change:n||"",willCommit:!1,selStart:l,selEnd:c}})}),this._setEventListeners(n,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],e=>e.target.value)}if(o&&n.addEventListener("blur",o),this.data.comb){const e=(this.data.rect[2]-this.data.rect[0])/i;n.classList.add("comb"),n.style.letterSpacing=`calc(${e}px * var(--scale-factor) - 1ch)`}}else n=document.createElement("div"),n.textContent=this.data.fieldValue,n.style.verticalAlign="middle",n.style.display="table-cell";return this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class b extends g{constructor(e){super(e,{isRenderable:e.renderForms})}render(){const e=this.annotationStorage,t=this.data,n=t.id;let s=e.getValue(n,{value:t.exportValue===t.fieldValue}).value;"string"==typeof s&&(s="Off"!==s,e.setValue(n,{value:s})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const r=document.createElement("input");return c.add(r),r.setAttribute("data-element-id",n),r.disabled=t.readOnly,this._setRequired(r,this.data.required),r.type="checkbox",r.name=t.fieldName,s&&r.setAttribute("checked",!0),r.setAttribute("exportValue",t.exportValue),r.tabIndex=l,r.addEventListener("change",s=>{const{name:r,checked:i}=s.target;for(const s of this._getElementsByName(r,n)){const n=i&&s.exportValue===t.exportValue;s.domElement&&(s.domElement.checked=n),e.setValue(s.id,{value:n})}e.setValue(n,{value:i})}),r.addEventListener("resetform",e=>{const n=t.defaultFieldValue||"Off";e.target.checked=n===t.exportValue}),this.enableScripting&&this.hasJSActions&&(r.addEventListener("updatefromsandbox",t=>{const s={value(t){t.target.checked="Off"!==t.detail.value,e.setValue(n,{value:t.target.checked})}};this._dispatchEventFromSandbox(s,t)}),this._setEventListeners(r,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],e=>e.target.checked)),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class _ extends g{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const e=this.annotationStorage,t=this.data,n=t.id;let s=e.getValue(n,{value:t.fieldValue===t.buttonValue}).value;"string"==typeof s&&(s=s!==t.buttonValue,e.setValue(n,{value:s}));const r=document.createElement("input");if(c.add(r),r.setAttribute("data-element-id",n),r.disabled=t.readOnly,this._setRequired(r,this.data.required),r.type="radio",r.name=t.fieldName,s&&r.setAttribute("checked",!0),r.tabIndex=l,r.addEventListener("change",t=>{const{name:s,checked:r}=t.target;for(const t of this._getElementsByName(s,n))e.setValue(t.id,{value:!1});e.setValue(n,{value:r})}),r.addEventListener("resetform",e=>{const n=t.defaultFieldValue;e.target.checked=null!=n&&n===t.buttonValue}),this.enableScripting&&this.hasJSActions){const s=t.buttonValue;r.addEventListener("updatefromsandbox",t=>{const r={value:t=>{const r=s===t.detail.value;for(const s of this._getElementsByName(t.target.name)){const t=r&&s.id===n;s.domElement&&(s.domElement.checked=t),e.setValue(s.id,{value:t})}}};this._dispatchEventFromSandbox(r,t)}),this._setEventListeners(r,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],e=>e.target.checked)}return this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class v extends p{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){const e=super.render();e.classList.add("buttonWidgetAnnotation","pushButton"),this.data.alternativeText&&(e.title=this.data.alternativeText);const t=e.lastChild;return this.enableScripting&&this.hasJSActions&&t&&(this._setDefaultPropertiesFromJS(t),t.addEventListener("updatefromsandbox",e=>{this._dispatchEventFromSandbox({},e)})),e}}class y extends g{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const e=this.annotationStorage,t=this.data.id,n=e.getValue(t,{value:this.data.fieldValue}),s=document.createElement("select");c.add(s),s.setAttribute("data-element-id",t),s.disabled=this.data.readOnly,this._setRequired(s,this.data.required),s.name=this.data.fieldName,s.tabIndex=l;let r=this.data.combo&&this.data.options.length>0;this.data.combo||(s.size=this.data.options.length,this.data.multiSelect&&(s.multiple=!0)),s.addEventListener("resetform",e=>{const t=this.data.defaultFieldValue;for(const e of s.options)e.selected=e.value===t});for(const e of this.data.options){const t=document.createElement("option");
2t.textContent=e.displayValue,t.value=e.exportValue,n.value.includes(e.exportValue)&&(t.setAttribute("selected",!0),r=!1),s.append(t)}let i=null;if(r){const e=document.createElement("option");e.value=" ",e.setAttribute("hidden",!0),e.setAttribute("selected",!0),s.prepend(e),i=()=>{e.remove(),s.removeEventListener("input",i),i=null},s.addEventListener("input",i)}const a=e=>{const t=e?"value":"textContent",{options:n,multiple:r}=s;return r?Array.prototype.filter.call(n,e=>e.selected).map(e=>e[t]):-1===n.selectedIndex?null:n[n.selectedIndex][t]};let o=a(!1);const d=e=>{const t=e.target.options;return Array.prototype.map.call(t,e=>({displayValue:e.textContent,exportValue:e.value}))};return this.enableScripting&&this.hasJSActions?(s.addEventListener("updatefromsandbox",n=>{const r={value(n){i?.();const r=n.detail.value,l=new Set(Array.isArray(r)?r:[r]);for(const e of s.options)e.selected=l.has(e.value);e.setValue(t,{value:a(!0)}),o=a(!1)},multipleSelection(e){s.multiple=!0},remove(n){const r=s.options,i=n.detail.remove;r[i].selected=!1,s.remove(i),r.length>0&&-1===Array.prototype.findIndex.call(r,e=>e.selected)&&(r[0].selected=!0),e.setValue(t,{value:a(!0),items:d(n)}),o=a(!1)},clear(n){for(;0!==s.length;)s.remove(0);e.setValue(t,{value:null,items:[]}),o=a(!1)},insert(n){const{index:r,displayValue:i,exportValue:l}=n.detail.insert,c=s.children[r],h=document.createElement("option");h.textContent=i,h.value=l,c?c.before(h):s.append(h),e.setValue(t,{value:a(!0),items:d(n)}),o=a(!1)},items(n){const{items:r}=n.detail;for(;0!==s.length;)s.remove(0);for(const e of r){const{displayValue:t,exportValue:n}=e,r=document.createElement("option");r.textContent=t,r.value=n,s.append(r)}s.options.length>0&&(s.options[0].selected=!0),e.setValue(t,{value:a(!0),items:d(n)}),o=a(!1)},indices(n){const s=new Set(n.detail.indices);for(const e of n.target.options)e.selected=s.has(e.index);e.setValue(t,{value:a(!0)}),o=a(!1)},editable(e){e.target.disabled=!e.detail.editable}};this._dispatchEventFromSandbox(r,n)}),s.addEventListener("input",n=>{const s=a(!0);e.setValue(t,{value:s}),n.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:o,changeEx:s,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(s,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],e=>e.target.value)):s.addEventListener("input",function(n){e.setValue(t,{value:a(!0)})}),this.data.combo&&this._setTextStyle(s),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class A extends u{static IGNORE_TYPES=new Set(["Line","Square","Circle","PolyLine","Polygon","Ink"]);constructor(e){const{data:t}=e;super(e,{isRenderable:!A.IGNORE_TYPES.has(t.parentType)&&!!(t.titleObj?.str||t.contentsObj?.str||t.richText?.str)})}render(){this.container.classList.add("popupAnnotation");const e=this.layer.querySelectorAll(`[data-annotation-id="${this.data.parentId}"]`);if(0===e.length)return this.container;const t=new S({container:this.container,trigger:Array.from(e),color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText}),n=this.page,r=s.Util.normalizeRect([this.data.parentRect[0],n.view[3]-this.data.parentRect[1]+n.view[1],this.data.parentRect[2],n.view[3]-this.data.parentRect[3]+n.view[1]]),i=r[0]+this.data.parentRect[2]-this.data.parentRect[0],a=r[1],{pageWidth:o,pageHeight:l,pageX:c,pageY:d}=this.viewport.rawDims;return this.container.style.left=100*(i-c)/o+"%",this.container.style.top=100*(a-d)/l+"%",this.container.append(t.render()),this.container}}class S{constructor(e){this.container=e.container,this.trigger=e.trigger,this.color=e.color,this.titleObj=e.titleObj,this.modificationDate=e.modificationDate,this.contentsObj=e.contentsObj,this.richText=e.richText,this.hideWrapper=e.hideWrapper||!1,this.pinned=!1}render(){const e=document.createElement("div");e.classList.add("popupWrapper"),this.hideElement=this.hideWrapper?e:this.container,this.hideElement.hidden=!0;const t=document.createElement("div");t.classList.add("popup");const n=this.color;if(n){const e=.7*(255-n[0])+n[0],r=.7*(255-n[1])+n[1],i=.7*(255-n[2])+n[2];t.style.backgroundColor=s.Util.makeHexColor(0|e,0|r,0|i)}const i=document.createElement("h1");i.dir=this.titleObj.dir,i.textContent=this.titleObj.str,t.append(i);const a=r.PDFDateString.toDateObject(this.modificationDate);if(a){const e=document.createElement("span");e.classList.add("popupDate"),e.textContent="{{date}}, {{time}}",e.dataset.l10nId="annotation_date_string",e.dataset.l10nArgs=JSON.stringify({date:a.toLocaleDateString(),time:a.toLocaleTimeString()}),t.append(e)}if(!this.richText?.str||this.contentsObj?.str&&this.contentsObj.str!==this.richText.str){const e=this._formatContents(this.contentsObj);t.append(e)}else o.XfaLayer.render({xfaHtml:this.richText.html,intent:"richText",div:t}),t.lastChild.classList.add("richText","popupContent");Array.isArray(this.trigger)||(this.trigger=[this.trigger]);for(const e of this.trigger)e.addEventListener("click",this._toggle.bind(this)),e.addEventListener("mouseover",this._show.bind(this,!1)),e.addEventListener("mouseout",this._hide.bind(this,!1));return t.addEventListener("click",this._hide.bind(this,!0)),e.append(t),e}_formatContents({str:e,dir:t}){const n=document.createElement("p");n.classList.add("popupContent"),n.dir=t;
2const s=e.split(/(?:\r\n?|\n)/);for(let e=0,t=s.length;e<t;++e){const r=s[e];n.append(document.createTextNode(r)),e<t-1&&n.append(document.createElement("br"))}return n}_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=parseInt(this.container.style.zIndex)+1e3)}_hide(e=!0){e&&(this.pinned=!1),this.hideElement.hidden||this.pinned||(this.hideElement.hidden=!0,this.container.style.zIndex=parseInt(this.container.style.zIndex)-1e3)}}class x extends u{constructor(e){super(e,{isRenderable:!!(e.data.hasPopup||e.data.titleObj?.str||e.data.contentsObj?.str||e.data.richText?.str),ignoreBorder:!0}),this.textContent=e.data.textContent}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const e=document.createElement("div");e.classList.add("annotationTextContent"),e.setAttribute("role","comment");for(const t of this.textContent){const n=document.createElement("span");n.textContent=t,e.append(n)}this.container.append(e)}return this.data.hasPopup||this._createPopup(null,this.data),this.container}}class E extends u{constructor(e){super(e,{isRenderable:!!(e.data.hasPopup||e.data.titleObj?.str||e.data.contentsObj?.str||e.data.richText?.str),ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const e=this.data,{width:t,height:n}=d(e.rect),s=this.svgFactory.create(t,n,!0),r=this.svgFactory.createElement("svg:line");return r.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),r.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),r.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),r.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),r.setAttribute("stroke-width",e.borderStyle.width||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),s.append(r),this.container.append(s),this._createPopup(r,e),this.container}}class C extends u{constructor(e){super(e,{isRenderable:!!(e.data.hasPopup||e.data.titleObj?.str||e.data.contentsObj?.str||e.data.richText?.str),ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const e=this.data,{width:t,height:n}=d(e.rect),s=this.svgFactory.create(t,n,!0),r=e.borderStyle.width,i=this.svgFactory.createElement("svg:rect");return i.setAttribute("x",r/2),i.setAttribute("y",r/2),i.setAttribute("width",t-r),i.setAttribute("height",n-r),i.setAttribute("stroke-width",r||1),i.setAttribute("stroke","transparent"),i.setAttribute("fill","transparent"),s.append(i),this.container.append(s),this._createPopup(i,e),this.container}}class P extends u{constructor(e){super(e,{isRenderable:!!(e.data.hasPopup||e.data.titleObj?.str||e.data.contentsObj?.str||e.data.richText?.str),ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const e=this.data,{width:t,height:n}=d(e.rect),s=this.svgFactory.create(t,n,!0),r=e.borderStyle.width,i=this.svgFactory.createElement("svg:ellipse");return i.setAttribute("cx",t/2),i.setAttribute("cy",n/2),i.setAttribute("rx",t/2-r/2),i.setAttribute("ry",n/2-r/2),i.setAttribute("stroke-width",r||1),i.setAttribute("stroke","transparent"),i.setAttribute("fill","transparent"),s.append(i),this.container.append(s),this._createPopup(i,e),this.container}}class w extends u{constructor(e){super(e,{isRenderable:!!(e.data.hasPopup||e.data.titleObj?.str||e.data.contentsObj?.str||e.data.richText?.str),ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const e=this.data,{width:t,height:n}=d(e.rect),s=this.svgFactory.create(t,n,!0);let r=[];for(const t of e.vertices){const n=t.x-e.rect[0],s=e.rect[3]-t.y;r.push(n+","+s)}r=r.join(" ");const i=this.svgFactory.createElement(this.svgElementName);return i.setAttribute("points",r),i.setAttribute("stroke-width",e.borderStyle.width||1),i.setAttribute("stroke","transparent"),i.setAttribute("fill","transparent"),s.append(i),this.container.append(s),this._createPopup(i,e),this.container}}class T extends w{constructor(e){super(e),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class k extends u{constructor(e){super(e,{isRenderable:!!(e.data.hasPopup||e.data.titleObj?.str||e.data.contentsObj?.str||e.data.r
2ichText?.str),ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),this.data.hasPopup||this._createPopup(null,this.data),this.container}}class R extends u{constructor(e){super(e,{isRenderable:!!(e.data.hasPopup||e.data.titleObj?.str||e.data.contentsObj?.str||e.data.richText?.str),ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const e=this.data,{width:t,height:n}=d(e.rect),s=this.svgFactory.create(t,n,!0);for(const t of e.inkLists){let n=[];for(const s of t){const t=s.x-e.rect[0],r=e.rect[3]-s.y;n.push(`${t},${r}`)}n=n.join(" ");const r=this.svgFactory.createElement(this.svgElementName);r.setAttribute("points",n),r.setAttribute("stroke-width",e.borderStyle.width||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),this._createPopup(r,e),s.append(r)}return this.container.append(s),this.container}}class M extends u{constructor(e){super(e,{isRenderable:!!(e.data.hasPopup||e.data.titleObj?.str||e.data.contentsObj?.str||e.data.richText?.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("highlightAnnotation"):(this.container.classList.add("highlightAnnotation"),this.container)}}class F extends u{constructor(e){super(e,{isRenderable:!!(e.data.hasPopup||e.data.titleObj?.str||e.data.contentsObj?.str||e.data.richText?.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("underlineAnnotation"):(this.container.classList.add("underlineAnnotation"),this.container)}}class O extends u{constructor(e){super(e,{isRenderable:!!(e.data.hasPopup||e.data.titleObj?.str||e.data.contentsObj?.str||e.data.richText?.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("squigglyAnnotation"):(this.container.classList.add("squigglyAnnotation"),this.container)}}class D extends u{constructor(e){super(e,{isRenderable:!!(e.data.hasPopup||e.data.titleObj?.str||e.data.contentsObj?.str||e.data.richText?.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("strikeoutAnnotation"):(this.container.classList.add("strikeoutAnnotation"),this.container)}}class I extends u{constructor(e){super(e,{isRenderable:!!(e.data.hasPopup||e.data.titleObj?.str||e.data.contentsObj?.str||e.data.richText?.str),ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),this.data.hasPopup||this._createPopup(null,this.data),this.container}}class L extends u{constructor(e){super(e,{isRenderable:!0});const{filename:t,content:n}=this.data.file;this.filename=(0,r.getFilenameFromUrl)(t,!0),this.content=n,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,filename:t,content:n})}render(){let e;return this.container.classList.add("fileAttachmentAnnotation"),this.data.hasAppearance?e=document.createElement("div"):(e=document.createElement("img"),e.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(this.data.name)?"paperclip":"pushpin"}.svg`),e.classList.add("popupTriggerArea"),e.addEventListener("dblclick",this._download.bind(this)),!this.data.hasPopup&&(this.data.titleObj?.str||this.data.contentsObj?.str||this.data.richText)&&this._createPopup(e,this.data),this.container.append(e),this.container}_download(){this.downloadManager?.openOrDownloadData(this.container,this.content,this.filename)}}class N{static#Gt(e,t,n,s){const i=e.firstChild||e;i.id=`${r.AnnotationPrefix}${t}`,n.append(e),s?.moveElementInDOM(n,e,i,!1)}static render(e){const{annotations:t,div:n,viewport:a,accessibilityManager:o}=e;(0,r.setLayerDimensions)(n,a);
2const l={data:null,layer:n,page:e.page,viewport:a,linkService:e.linkService,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderForms:!1!==e.renderForms,svgFactory:new r.DOMSVGFactory,annotationStorage:e.annotationStorage||new i.AnnotationStorage,enableScripting:!0===e.enableScripting,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects};let c=0;for(const e of t){if(e.noHTML)continue;if(e.annotationType!==s.AnnotationType.POPUP){const{width:t,height:n}=d(e.rect);if(t<=0||n<=0)continue}l.data=e;const t=h.create(l);if(!t.isRenderable)continue;const r=t.render();if(e.hidden&&(r.style.visibility="hidden"),Array.isArray(r))for(const t of r)t.style.zIndex=c++,N.#Gt(t,e.id,n,o);else r.style.zIndex=c++,t instanceof A?n.prepend(r):N.#Gt(r,e.id,n,o)}this.#Vt(n,e.annotationCanvasMap)}static update(e){const{annotationCanvasMap:t,div:n,viewport:s}=e;(0,r.setLayerDimensions)(n,{rotation:s.rotation}),this.#Vt(n,t),n.hidden=!1}static#Vt(e,t){if(t){for(const[n,s]of t){const t=e.querySelector(`[data-annotation-id="${n}"]`);if(!t)continue;const{firstChild:r}=t;r?"CANVAS"===r.nodeName?r.replaceWith(s):r.before(s):t.append(s)}t.clear()}}}t.AnnotationLayer=N},(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,s]){return["G",1-Math.min(1,.3*e+.59*n+.11*t+s)]}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,s]){return`#${n(e)}${n(t)}${n(s)}`}static T_HTML(){return"#00000000"}static CMYK_RGB([e,t,n,s]){return["RGB",1-Math.min(1,e+s),1-Math.min(1,n+s),1-Math.min(1,t+s)]}static CMYK_HTML(e){const t=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(t)}static RGB_CMYK([e,t,n]){const s=1-e,r=1-t,i=1-n;return["CMYK",s,r,i,Math.min(s,r,i)]}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.XfaLayer=void 0;var s=n(19);t.XfaLayer=class{static setupStorage(e,t,n,s,r){const i=s.getValue(t,{value:null});switch(n.name){case"textarea":if(null!==i.value&&(e.textContent=i.value),"print"===r)break;e.addEventListener("input",e=>{s.setValue(t,{value:e.target.value})});break;case"input":if("radio"===n.attributes.type||"checkbox"===n.attributes.type){if(i.value===n.attributes.xfaOn?e.setAttribute("checked",!0):i.value===n.attributes.xfaOff&&e.removeAttribute("checked"),"print"===r)break;e.addEventListener("change",e=>{s.setValue(t,{value:e.target.checked?e.target.getAttribute("xfaOn"):e.target.getAttribute("xfaOff")})})}else{if(null!==i.value&&e.setAttribute("value",i.value),"print"===r)break;e.addEventListener("input",e=>{s.setValue(t,{value:e.target.value})})}break;case"select":if(null!==i.value)for(const e of n.children)e.attributes.value===i.value&&(e.attributes.selected=!0);e.addEventListener("input",e=>{const n=e.target.options,r=-1===n.selectedIndex?"":n[n.selectedIndex].value;s.setValue(t,{value:r})})}}static setAttributes({html:e,element:t,storage:n=null,intent:s,linkService:r}){const{attributes:i}=t,a=e instanceof HTMLAnchorElement;"radio"===i.type&&(i.name=`${i.name}-${s}`);for(const[t,n]of Object.entries(i))if(null!=n)switch(t){case"class":n.length&&e.setAttribute(t,n.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",n);break;case"style":Object.assign(e.style,n);break;case"textContent":e.textContent=n;break;default:(!a||"href"!==t&&"newWindow"!==t)&&e.setAttribute(t,n)}a&&r.addLinkAttributes(e,i.href,i.newWindow),n&&i.dataId&&this.setupStorage(e,i.dataId,t,n)}static render(e){const t=e.annotationStorage,n=e.linkService,r=e.xfaHtml,i=e.intent||"display",a=document.createElement(r.name);r.attributes&&this.setAttributes({html:a,element:r,intent:i,linkService:n});const o=[[r,-1,a]],l=e.div;if(l.append(a),e.viewport){const t=`matrix(${e.viewport.transform.join(",")})`;l.style.transform=t}"richText"!==i&&l.setAttribute("class","xfaLayer xfaFont");const c=[];for(;o.length>0;){const[e,r,a]=o.at(-1);if(r+1===e.children.length){o.pop();continue}const l=e.children[++o.at(-1)[1]];if(null===l)continue;const{name:d}=l;if("#text"===d){const e=document.createTextNode(l.value);c.push(e),a.append(e);continue}let h;
2if(h=l?.attributes?.xmlns?document.createElementNS(l.attributes.xmlns,d):document.createElement(d),a.append(h),l.attributes&&this.setAttributes({html:h,element:l,storage:t,intent:i,linkService:n}),l.children&&l.children.length>0)o.push([l,-1,h]);else if(l.value){const e=document.createTextNode(l.value);s.XfaText.shouldBuildText(d)&&c.push(e),h.append(e)}}for(const e of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))e.setAttribute("readOnly",!0);return{textDivs:c}}static update(e){const t=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=t,e.div.hidden=!1}}},(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SVGGraphics=void 0;var s=n(6),r=n(1),i=n(10);let a=class{constructor(){(0,r.unreachable)("Not implemented: SVGGraphics")}};t.SVGGraphics=a;{const o={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},l="http://www.w3.org/XML/1998/namespace",c="http://www.w3.org/1999/xlink",d=["butt","round","square"],h=["miter","round","bevel"],u=function(e,t="",n=!1){if(URL.createObjectURL&&"undefined"!=typeof Blob&&!n)return URL.createObjectURL(new Blob([e],{type:t}));const s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let r=`data:${t};base64,`;for(let t=0,n=e.length;t<n;t+=3){const i=255&e[t],a=255&e[t+1],o=255&e[t+2];r+=s[i>>2]+s[(3&i)<<4|a>>4]+s[t+1<n?(15&a)<<2|o>>6:64]+s[t+2<n?63&o:64]}return r},p=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,s,r){let i=r;const a=n.length;s[i]=a>>24&255,s[i+1]=a>>16&255,s[i+2]=a>>8&255,s[i+3]=255&a,i+=4,s[i]=255&e.charCodeAt(0),s[i+1]=255&e.charCodeAt(1),s[i+2]=255&e.charCodeAt(2),s[i+3]=255&e.charCodeAt(3),i+=4,s.set(n,i),i+=n.length;const o=function(e,n,s){let r=-1;for(let i=n;i<s;i++){const n=255&(r^e[i]);r=r>>>8^t[n]}return-1^r}(s,r+4,i);s[i]=o>>24&255,s[i+1]=o>>16&255,s[i+2]=o>>8&255,s[i+3]=255&o}function s(e){let t=e.length;const n=65535,s=Math.ceil(t/n),r=new Uint8Array(2+t+5*s+4);let i=0;r[i++]=120,r[i++]=156;let a=0;for(;t>n;)r[i++]=0,r[i++]=255,r[i++]=255,r[i++]=0,r[i++]=0,r.set(e.subarray(a,a+n),i),i+=n,a+=n,t-=n;r[i++]=1,r[i++]=255&t,r[i++]=t>>8&255,r[i++]=255&~t,r[i++]=(65535&~t)>>8&255,r.set(e.subarray(a),i),i+=e.length-a;const o=function(e,t,n){let s=1,r=0;for(let t=0;t<n;++t)s=(s+(255&e[t]))%65521,r=(r+s)%65521;return r<<16|s}(e,0,e.length);return r[i++]=o>>24&255,r[i++]=o>>16&255,r[i++]=o>>8&255,r[i++]=255&o,r}return function(t,a,o){return function(t,a,o,l){const c=t.width,d=t.height;let h,p,f;const g=t.data;switch(a){case r.ImageKind.GRAYSCALE_1BPP:p=0,h=1,f=c+7>>3;break;case r.ImageKind.RGB_24BPP:p=2,h=8,f=3*c;break;case r.ImageKind.RGBA_32BPP:p=6,h=8,f=4*c;break;default:throw new Error("invalid format")}const m=new Uint8Array((1+f)*d);let b=0,_=0;for(let e=0;e<d;++e)m[b++]=0,m.set(g.subarray(_,_+f),b),_+=f,b+=f;if(a===r.ImageKind.GRAYSCALE_1BPP&&l){b=0;for(let e=0;e<d;e++){b++;for(let e=0;e<f;e++)m[b++]^=255}}const v=new Uint8Array([c>>24&255,c>>16&255,c>>8&255,255&c,d>>24&255,d>>16&255,d>>8&255,255&d,h,p,0,0,0]),y=function(e){if(!i.isNodeJS)return s(e);try{let t;t=parseInt(process.versions.node)>=8?e:Buffer.from(e);const n=__webpack_require__("0d3c624c09d9a5cc7229").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 s(e)}(m),A=e.length+36+v.length+y.length,S=new Uint8Array(A);let x=0;return S.set(e,x),x+=e.length,n("IHDR",v,S,x),x+=12+v.length,n("IDATA",y,S,x),x+=12+y.length,n("IEND",new Uint8Array(0),S,x),u(S,"image/png",o)}(t,void 0===t.kind?r.ImageKind.GRAYSCALE_1BPP:t.kind,a,o)}}();class f{constructor(){this.fontSizeScale=1,this.fontWeight=o.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=o.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 g(e){let t=[];const n=[];for(const s of e)"save"!==s.fn?"restore"===s.fn?t=n.pop():t.push(s):(t.push({fnId:92,fn:"group",items:[]}),n.push(t),t=t.at(-1).items);return t}function m(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 b(e){if(0===e[4]&&0===e[5]){if(0===e[1]&&0===e[2])return 1===e[0]&&1===e[3]?"":`scale(${m(e[0])} ${m(e[3])})`;if(e[0]===e[3]&&e[1]===-e[2])return`rotate(${m(180*Math.acos(e[0])/Math.PI)})`}else if(1===e[0]&&0===e[1]&&0===e[2]&&1===e[3])return`translate(${m(e[4])} ${m(e[5])})`;return`matrix(${m(e[0])} ${m(e[1])} ${m(e[2])} ${m(e[3])} ${m(e[4])} ${m(e[5])})`}let _=0,v=0,y=0;t.SVGGraphics=a=class{constructor(e,t,n=!1){(0,s.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new s.DOMSVGFactory,this.current=ne
2w f,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}getObject(e,t=null){return"string"==typeof e?e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e):t}save(){this.transformStack.push(this.transformMatrix);const e=this.current;this.extraStack.push(e),this.current=e.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(e){this.save(),this.executeOpTree(e),this.restore()}loadDependencies(e){const t=e.fnArray,n=e.argsArray;for(let e=0,s=t.length;e<s;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,s,i,a){const o=[e,t,n,s,i,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,s=e.fnArray,r=[];for(let e=0,i=s.length;e<i;e++){const i=s[e];r.push({fnId:i,fn:t[i],args:n[e]})}return g(r)}executeOpTree(e){for(const t of e){const e=t.fn,n=t.fnId,s=t.args;switch(0|n){case r.OPS.beginText:this.beginText();break;case r.OPS.dependency:break;case r.OPS.setLeading:this.setLeading(s);break;case r.OPS.setLeadingMoveText:this.setLeadingMoveText(s[0],s[1]);break;case r.OPS.setFont:this.setFont(s);break;case r.OPS.showText:case r.OPS.showSpacedText:this.showText(s[0]);break;case r.OPS.endText:this.endText();break;case r.OPS.moveText:this.moveText(s[0],s[1]);break;case r.OPS.setCharSpacing:this.setCharSpacing(s[0]);break;case r.OPS.setWordSpacing:this.setWordSpacing(s[0]);break;case r.OPS.setHScale:this.setHScale(s[0]);break;case r.OPS.setTextMatrix:this.setTextMatrix(s[0],s[1],s[2],s[3],s[4],s[5]);break;case r.OPS.setTextRise:this.setTextRise(s[0]);break;case r.OPS.setTextRenderingMode:this.setTextRenderingMode(s[0]);break;case r.OPS.setLineWidth:this.setLineWidth(s[0]);break;case r.OPS.setLineJoin:this.setLineJoin(s[0]);break;case r.OPS.setLineCap:this.setLineCap(s[0]);break;case r.OPS.setMiterLimit:this.setMiterLimit(s[0]);break;case r.OPS.setFillRGBColor:this.setFillRGBColor(s[0],s[1],s[2]);break;case r.OPS.setStrokeRGBColor:this.setStrokeRGBColor(s[0],s[1],s[2]);break;case r.OPS.setStrokeColorN:this.setStrokeColorN(s);break;case r.OPS.setFillColorN:this.setFillColorN(s);break;case r.OPS.shadingFill:this.shadingFill(s[0]);break;case r.OPS.setDash:this.setDash(s[0],s[1]);break;case r.OPS.setRenderingIntent:this.setRenderingIntent(s[0]);break;case r.OPS.setFlatness:this.setFlatness(s[0]);break;case r.OPS.setGState:this.setGState(s[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(s[0]);break;case r.OPS.paintInlineImageXObject:this.paintInlineImageXObject(s[0]);break;case r.OPS.paintImageMaskXObject:this.paintImageMaskXObject(s[0]);break;case r.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(s[0],s[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(s[0],s[1],s[2],s[3],s[4],s[5]);break;case r.OPS.constructPath:this.constructPath(s[0],s[1]);break;case r.OPS.endPath:this.endPath();break;case 92:this.group(t.items);break;
2default:(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,s,r,i){const a=this.current;a.textMatrix=a.lineMatrix=[e,t,n,s,r,i],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",`${m(a.fontSize)}px`),a.tspan.setAttributeNS(null,"y",m(-a.y)),a.txtElement=this.svgFactory.createElement("svg:text"),a.txtElement.append(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",`${m(n.fontSize)}px`),n.tspan.setAttributeNS(null,"y",m(-n.y))}showText(e){const t=this.current,n=t.font,s=t.fontSize;if(0===s)return;const i=t.fontSizeScale,a=t.charSpacing,c=t.wordSpacing,d=t.fontDirection,h=t.textHScale*d,u=n.vertical,p=u?1:-1,f=n.defaultVMetrics,g=s*t.fontMatrix[0];let _=0;for(const r of e){if(null===r){_+=d*c;continue}if("number"==typeof r){_+=p*r*s/1e3;continue}const e=(r.isSpace?c:0)+a,o=r.fontChar;let l,h,m,b=r.width;if(u){let e;const t=r.vmetric||f;e=r.vmetric?t[1]:.5*b,e=-e*g;const n=t[2]*g;b=t?-t[0]:b,l=e/i,h=(_+n)/i}else l=_/i,h=0;(r.isInFont||n.missingFile)&&(t.xcoords.push(t.x+l),u&&t.ycoords.push(-t.y+h),t.tspan.textContent+=o),m=u?b*g-e*d:b*g+e*d,_+=m}t.tspan.setAttributeNS(null,"x",t.xcoords.map(m).join(" ")),u?t.tspan.setAttributeNS(null,"y",t.ycoords.map(m).join(" ")):t.tspan.setAttributeNS(null,"y",m(-t.y)),u?t.y-=_:t.x+=_*h,t.tspan.setAttributeNS(null,"font-family",t.fontFamily),t.tspan.setAttributeNS(null,"font-size",`${m(t.fontSize)}px`),t.fontStyle!==o.fontStyle&&t.tspan.setAttributeNS(null,"font-style",t.fontStyle),t.fontWeight!==o.fontWeight&&t.tspan.setAttributeNS(null,"font-weight",t.fontWeight);const v=t.textRenderingMode&r.TextRenderingMode.FILL_STROKE_MASK;if(v===r.TextRenderingMode.FILL||v===r.TextRenderingMode.FILL_STROKE?(t.fillColor!==o.fillColor&&t.tspan.setAttributeNS(null,"fill",t.fillColor),t.fillAlpha<1&&t.tspan.setAttributeNS(null,"fill-opacity",t.fillAlpha)):t.textRenderingMode===r.TextRenderingMode.ADD_TO_PATH?t.tspan.setAttributeNS(null,"fill","transparent"):t.tspan.setAttributeNS(null,"fill","none"),v===r.TextRenderingMode.STROKE||v===r.TextRenderingMode.FILL_STROKE){const e=1/(t.textMatrixScale||1);this._setStrokeAttributes(t.tspan,e)}let y=t.textMatrix;0!==t.textRise&&(y=y.slice(),y[5]+=t.textRise),t.txtElement.setAttributeNS(null,"transform",`${b(y)} scale(${m(h)}, -1)`),t.txtElement.setAttributeNS(l,"xml:space","preserve"),t.txtElement.append(t.tspan),t.txtgrp.append(t.txtElement),this._ensureTransformGroup().append(t.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.append(this.cssStyle));const t=u(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 s=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 i="normal";n.black?i="900":n.bold&&(i="bold");const a=n.italic?"italic":"normal";s<0?(s=-s,t.fontDirection=-1):t.fontDirection=1,t.fontSize=s,t.fontFamily=n.loadedName,t.fontWeight=i,t.fontStyle=a,t.tspan=this.svgFactory.createElement("svg:tspan"),t.tspan.setAttributeNS(null,"y",m(-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=d[e]}
2setLineJoin(e){this.current.lineJoin=h[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,s=r.Util.inverseTransform(this.transformMatrix),i=r.Util.applyTransform([0,0],s),a=r.Util.applyTransform([0,n],s),o=r.Util.applyTransform([t,0],s),l=r.Util.applyTransform([t,n],s),c=Math.min(i[0],a[0],o[0],l[0]),d=Math.min(i[1],a[1],o[1],l[1]),h=Math.max(i[0],a[0],o[0],l[0]),u=Math.max(i[1],a[1],o[1],l[1]),p=this.svgFactory.createElement("svg:rect");p.setAttributeNS(null,"x",c),p.setAttributeNS(null,"y",d),p.setAttributeNS(null,"width",h-c),p.setAttributeNS(null,"height",u-d),p.setAttributeNS(null,"fill",this._makeShadingPattern(e)),this.current.fillAlpha<1&&p.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(p)}_makeColorN_Pattern(e){return"TilingPattern"===e[0]?this._makeTilingPattern(e):this._makeShadingPattern(e)}_makeTilingPattern(e){const t=e[1],n=e[2],s=e[3]||r.IDENTITY_MATRIX,[i,a,o,l]=e[4],c=e[5],d=e[6],h=e[7],u="shading"+y++,[p,f,g,m]=r.Util.normalizeRect([...r.Util.applyTransform([i,a],s),...r.Util.applyTransform([o,l],s)]),[b,_]=r.Util.singularValueDecompose2dScale(s),v=c*b,A=d*_,S=this.svgFactory.createElement("svg:pattern");S.setAttributeNS(null,"id",u),S.setAttributeNS(null,"patternUnits","userSpaceOnUse"),S.setAttributeNS(null,"width",v),S.setAttributeNS(null,"height",A),S.setAttributeNS(null,"x",`${p}`),S.setAttributeNS(null,"y",`${f}`);const x=this.svg,E=this.transformMatrix,C=this.current.fillColor,P=this.current.strokeColor,w=this.svgFactory.create(g-p,m-f);if(this.svg=w,this.transformMatrix=s,2===h){const e=r.Util.makeHexColor(...t);this.current.fillColor=e,this.current.strokeColor=e}return this.executeOpTree(this.convertOpList(n)),this.svg=x,this.transformMatrix=E,this.current.fillColor=C,this.current.strokeColor=P,S.append(w.childNodes[0]),this.defs.append(S),`url(#${u})`}_makeShadingPattern(e){switch("string"==typeof e&&(e=this.objs.get(e)),e[0]){case"RadialAxial":const t="shading"+y++,n=e[3];let s;switch(e[1]){case"axial":const n=e[4],r=e[5];s=this.svgFactory.createElement("svg:linearGradient"),s.setAttributeNS(null,"id",t),s.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),s.setAttributeNS(null,"x1",n[0]),s.setAttributeNS(null,"y1",n[1]),s.setAttributeNS(null,"x2",r[0]),s.setAttributeNS(null,"y2",r[1]);break;case"radial":const i=e[4],a=e[5],o=e[6],l=e[7];s=this.svgFactory.createElement("svg:radialGradient"),s.setAttributeNS(null,"id",t),s.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),s.setAttributeNS(null,"cx",a[0]),s.setAttributeNS(null,"cy",a[1]),s.setAttributeNS(null,"r",l),s.setAttributeNS(null,"fx",i[0]),s.setAttributeNS(null,"fy",i[1]),s.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]),s.append(t)}return this.defs.append(s),`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 s=n.x,i=n.y,a=[],o=0;for(const n of e)switch(0|n){case r.OPS.rectangle:s=t[o++],i=t[o++];const e=s+t[o++],n=i+t[o++];a.push("M",m(s),m(i),"L",m(e),m(i),"L",m(e),m(n),"L",m(s),m(n),"Z");break;case r.OPS.moveTo:s=t[o++],i=t[o++],a.push("M",m(s),m(i));break;case r.OPS.lineTo:s=t[o++],i=t[o++],a.push("L",m(s),m(i));break;case r.OPS.curveTo:s=t[o+4],i=t[o+5],a.push("C",m(t[o]),m(t[o+1]),m(t[o+2]),m(t[o+3]),m(s),m(i)),o+=6;break;case r.OPS.curveTo2:a.push("C",m(s),m(i),m(t[o]),m(t[o+1]),m(t[o+2]),m(t[o+3])),s=t[o+2],i=t[o+3],o+=4;break;case r.OPS.curveTo3:s=t[o+2],i=t[o+3],a.push("C",m(t[o]),m(t[o+1]),m(s),m(i),m(s),m(i)),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().append(n.path)),n.path.setAttributeNS(null,"d",a),n.path.setAttributeNS(null,"fill","none"),n.element=n.path,n.setCurrentPoint(s,i)}endPath(){const e=this.current;if(e.path=null,!this.pendingClip)return;if(!e.element)return void(this.pendingClip=null);const t="clippath"+_++,n=this.svgFactory.createElement("svg:clipPath");n.setAttributeNS(null,"id",t),n.setAttributeNS(null,"transform",b(this.transformMatrix));const s=e.element.cloneNode(!0);if("evenodd"===this.pendingClip?s.setAttributeNS(null,"clip-rule","evenodd"):s.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,n.append(s),this.defs.append(n),e.activeClipUrl){e.clipGroup=null;for(const e of this.extraStack)e.clipGroup=null;n.setAttributeNS(null,"clip-path",e.activeClipUrl)}e.activeClipUrl=`url(#${t})`,this.tgrp=null}clip(e){this.pendingClip=e}closePath(){const e=this.current;if(e.path){const t=`${e.path.getAttributeNS(null,"d")}Z`;e.path.setAttributeNS(null,"d",t)}}setLeading(e){this.current.leading=-e}setTextRise(e){this.current.textRise=e}setTextRenderingMode(e){this.current.textRenderingMode=e}setHScale(e){this.current.textHScale=e/100}
2setRenderingIntent(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 s=n.dashArray;1!==t&&s.length>0&&(s=s.map(function(e){return t*e})),e.setAttributeNS(null,"stroke",n.strokeColor),e.setAttributeNS(null,"stroke-opacity",n.strokeAlpha),e.setAttributeNS(null,"stroke-miterlimit",m(n.miterLimit)),e.setAttributeNS(null,"stroke-linecap",n.lineCap),e.setAttributeNS(null,"stroke-linejoin",n.lineJoin),e.setAttributeNS(null,"stroke-width",m(t*n.lineWidth)+"px"),e.setAttributeNS(null,"stroke-dasharray",s.map(m).join(" ")),e.setAttributeNS(null,"stroke-dashoffset",m(t*n.dashPhase)+"px")}eoFill(){this.current.element?.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){this.current.element?.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const e=this.svgFactory.createElement("svg:rect");e.setAttributeNS(null,"x","0"),e.setAttributeNS(null,"y","0"),e.setAttributeNS(null,"width","1px"),e.setAttributeNS(null,"height","1px"),e.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(e)}paintImageXObject(e){const t=this.getObject(e);t?this.paintInlineImageXObject(t):(0,r.warn)(`Dependent image with object ID ${e} is not ready yet`)}paintInlineImageXObject(e,t){const n=e.width,s=e.height,r=p(e,this.forceDataSchema,!!t),i=this.svgFactory.createElement("svg:rect");i.setAttributeNS(null,"x","0"),i.setAttributeNS(null,"y","0"),i.setAttributeNS(null,"width",m(n)),i.setAttributeNS(null,"height",m(s)),this.current.element=i,this.clip("nonzero");const a=this.svgFactory.createElement("svg:image");a.setAttributeNS(c,"xlink:href",r),a.setAttributeNS(null,"x","0"),a.setAttributeNS(null,"y",m(-s)),a.setAttributeNS(null,"width",m(n)+"px"),a.setAttributeNS(null,"height",m(s)+"px"),a.setAttributeNS(null,"transform",`scale(${m(1/n)} ${m(-1/s)})`),t?t.append(a):this._ensureTransformGroup().append(a)}paintImageMaskXObject(e){const t=this.getObject(e.data,e);if(t.bitmap)return void(0,r.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");const n=this.current,s=t.width,i=t.height,a=n.fillColor;n.maskId="mask"+v++;const o=this.svgFactory.createElement("svg:mask");o.setAttributeNS(null,"id",n.maskId);const l=this.svgFactory.createElement("svg:rect");l.setAttributeNS(null,"x","0"),l.setAttributeNS(null,"y","0"),l.setAttributeNS(null,"width",m(s)),l.setAttributeNS(null,"height",m(i)),l.setAttributeNS(null,"fill",a),l.setAttributeNS(null,"mask",`url(#${n.maskId})`),this.defs.append(o),this._ensureTransformGroup().append(l),this.paintInlineImageXObject(t,o)}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],s=this.svgFactory.createElement("svg:rect");s.setAttributeNS(null,"x",t[0]),s.setAttributeNS(null,"y",t[1]),s.setAttributeNS(null,"width",m(e)),s.setAttributeNS(null,"height",m(n)),this.current.element=s,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(e){const t=this.svgFactory.create(e.width,e.height),n=this.svgFactory.createElement("svg:defs");t.append(n),this.defs=n;const s=this.svgFactory.createElement("svg:g");return s.setAttributeNS(null,"transform",b(e.transform)),t.append(s),this.svg=s,t}_ensureClipGroup(){if(!this.current.clipGroup){const e=this.svgFactory.createElement("svg:g");e.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(e),this.current.clipGroup=e}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",b(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}}}],__webpack_module_cache__={};function __w_pdfjs_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__w_pdfjs_require__),n.exports}var __webpack_exports__={};return(()=>{var e=__webpack_exports__;
2Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"AbortException",{enumerable:!0,get:function(){return t.AbortException}}),Object.defineProperty(e,"AnnotationEditorLayer",{enumerable:!0,get:function(){return i.AnnotationEditorLayer}}),Object.defineProperty(e,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return t.AnnotationEditorParamsType}}),Object.defineProperty(e,"AnnotationEditorType",{enumerable:!0,get:function(){return t.AnnotationEditorType}}),Object.defineProperty(e,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return a.AnnotationEditorUIManager}}),Object.defineProperty(e,"AnnotationLayer",{enumerable:!0,get:function(){return o.AnnotationLayer}}),Object.defineProperty(e,"AnnotationMode",{enumerable:!0,get:function(){return t.AnnotationMode}}),Object.defineProperty(e,"CMapCompressionType",{enumerable:!0,get:function(){return t.CMapCompressionType}}),Object.defineProperty(e,"FeatureTest",{enumerable:!0,get:function(){return t.FeatureTest}}),Object.defineProperty(e,"GlobalWorkerOptions",{enumerable:!0,get:function(){return l.GlobalWorkerOptions}}),Object.defineProperty(e,"InvalidPDFException",{enumerable:!0,get:function(){return t.InvalidPDFException}}),Object.defineProperty(e,"MissingPDFException",{enumerable:!0,get:function(){return t.MissingPDFException}}),Object.defineProperty(e,"OPS",{enumerable:!0,get:function(){return t.OPS}}),Object.defineProperty(e,"PDFDataRangeTransport",{enumerable:!0,get:function(){return n.PDFDataRangeTransport}}),Object.defineProperty(e,"PDFDateString",{enumerable:!0,get:function(){return s.PDFDateString}}),Object.defineProperty(e,"PDFWorker",{enumerable:!0,get:function(){return n.PDFWorker}}),Object.defineProperty(e,"PasswordResponses",{enumerable:!0,get:function(){return t.PasswordResponses}}),Object.defineProperty(e,"PermissionFlag",{enumerable:!0,get:function(){return t.PermissionFlag}}),Object.defineProperty(e,"PixelsPerInch",{enumerable:!0,get:function(){return s.PixelsPerInch}}),Object.defineProperty(e,"PromiseCapability",{enumerable:!0,get:function(){return t.PromiseCapability}}),Object.defineProperty(e,"RenderingCancelledException",{enumerable:!0,get:function(){return s.RenderingCancelledException}}),Object.defineProperty(e,"SVGGraphics",{enumerable:!0,get:function(){return c.SVGGraphics}}),Object.defineProperty(e,"UnexpectedResponseException",{enumerable:!0,get:function(){return t.UnexpectedResponseException}}),Object.defineProperty(e,"Util",{enumerable:!0,get:function(){return t.Util}}),Object.defineProperty(e,"VerbosityLevel",{enumerable:!0,get:function(){return t.VerbosityLevel}}),Object.defineProperty(e,"XfaLayer",{enumerable:!0,get:function(){return d.XfaLayer}}),Object.defineProperty(e,"build",{enumerable:!0,get:function(){return n.build}}),Object.defineProperty(e,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return t.createValidAbsoluteUrl}}),Object.defineProperty(e,"getDocument",{enumerable:!0,get:function(){return n.getDocument}}),Object.defineProperty(e,"getFilenameFromUrl",{enumerable:!0,get:function(){return s.getFilenameFromUrl}}),Object.defineProperty(e,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return s.getPdfFilenameFromUrl}}),Object.defineProperty(e,"getXfaPageViewport",{enumerable:!0,get:function(){return s.getXfaPageViewport}}),Object.defineProperty(e,"isDataScheme",{enumerable:!0,get:function(){return s.isDataScheme}}),Object.defineProperty(e,"isPdfFile",{enumerable:!0,get:function(){return s.isPdfFile}}),Object.defineProperty(e,"loadScript",{enumerable:!0,get:function(){return s.loadScript}}),Object.defineProperty(e,"normalizeUnicode",{enumerable:!0,get:function(){return t.normalizeUnicode}}),Object.defineProperty(e,"renderTextLayer",{enumerable:!0,get:function(){return r.renderTextLayer}}),Object.defineProperty(e,"setLayerDimensions",{enumerable:!0,get:function(){return s.setLayerDimensions}}),Object.defineProperty(e,"shadow",{enumerable:!0,get:function(){return t.shadow}}),Object.defineProperty(e,"updateTextLayer",{enumerable:!0,get:function(){return r.updateTextLayer}}),Object.defineProperty(e,"version",{enumerable:!0,get:function(){return n.version}});var t=__w_pdfjs_require__(1),n=__w_pdfjs_require__(2),s=__w_pdfjs_require__(6),r=__w_pdfjs_require__(26),i=__w_pdfjs_require__(27),a=__w_pdfjs_require__(5),o=__w_pdfjs_require__(32),l=__w_pdfjs_require__(14),c=__w_pdfjs_require__(35),d=__w_pdfjs_require__(34)})(),__webpack_exports__})(),module.exports=factory()}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.