????
Current Path : C:/inetpub/vhost/gdnn.gdtsolutions.vn/build/assets/ |
Current File : C:/inetpub/vhost/gdnn.gdtsolutions.vn/build/assets/PDF-b6dcf679.js |
var Ei=Object.defineProperty;var Si=(t,n,a)=>n in t?Ei(t,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[n]=a;var an=(t,n,a)=>(Si(t,typeof n!="symbol"?n+"":n,a),a),ga=(t,n,a)=>{if(!n.has(t))throw TypeError("Cannot "+a)};var B=(t,n,a)=>(ga(t,n,"read from private field"),a?a.call(t):n.get(t)),De=(t,n,a)=>{if(n.has(t))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(t):n.set(t,a)},rt=(t,n,a,r)=>(ga(t,n,"write to private field"),r?r.call(t,a):n.set(t,a),a);var _a=(t,n,a,r)=>({set _(e){rt(t,n,e,a)},get _(){return B(t,n,r)}}),qe=(t,n,a)=>(ga(t,n,"access private method"),a);import{r as reactExports,a as reactDomExports,R as React$g,j as jsxDevRuntimeExports}from"./index-fa055cb8.js";import{c as commonjsRequire}from"./_commonjs-dynamic-modules-302442b1.js";import{r as require$$5}from"./___vite-browser-external_commonjs-proxy-5cb935fc.js";var pdf={exports:{}};(function(module,exports){(function(n,a){module.exports=a()})(globalThis,()=>(()=>{var __webpack_modules__=[,(t,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.VerbosityLevel=n.Util=n.UnknownErrorException=n.UnexpectedResponseException=n.UNSUPPORTED_FEATURES=n.TextRenderingMode=n.StreamType=n.RenderingIntentFlag=n.PermissionFlag=n.PasswordResponses=n.PasswordException=n.PageActionEventType=n.OPS=n.MissingPDFException=n.LINE_FACTOR=n.LINE_DESCENT_FACTOR=n.InvalidPDFException=n.ImageKind=n.IDENTITY_MATRIX=n.FormatError=n.FontType=n.FeatureTest=n.FONT_IDENTITY_MATRIX=n.DocumentActionEventType=n.CMapCompressionType=n.BaseException=n.BASELINE_FACTOR=n.AnnotationType=n.AnnotationStateModelType=n.AnnotationReviewState=n.AnnotationReplyType=n.AnnotationMode=n.AnnotationMarkedState=n.AnnotationFlag=n.AnnotationFieldFlag=n.AnnotationEditorType=n.AnnotationEditorPrefix=n.AnnotationEditorParamsType=n.AnnotationBorderStyleType=n.AnnotationActionEventType=n.AbortException=void 0,n.arrayByteLength=I,n.arraysToBytes=G,n.assert=T,n.bytesToString=ze,n.createPromiseCapability=ct,n.createValidAbsoluteUrl=$,n.getModificationDate=kt,n.getVerbosityLevel=oe,n.info=Me,n.isArrayBuffer=ut,n.isArrayEqual=Et,n.objectFromMap=ge,n.objectSize=q,n.setVerbosityLevel=_e,n.shadow=Y,n.string32=z,n.stringToBytes=C,n.stringToPDFString=ce,n.stringToUTF8String=We,n.unreachable=K,n.utf8StringToString=nt,n.warn=xe;const a=[1,0,0,1,0,0];n.IDENTITY_MATRIX=a;const r=[.001,0,0,.001,0,0];n.FONT_IDENTITY_MATRIX=r;const e=1.35;n.LINE_FACTOR=e;const p=.35;n.LINE_DESCENT_FACTOR=p;const k=p/e;n.BASELINE_FACTOR=k;const E={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};n.RenderingIntentFlag=E;const b={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};n.AnnotationMode=b;const R="pdfjs_internal_editor_";n.AnnotationEditorPrefix=R;const S={DISABLE:-1,NONE:0,FREETEXT:3,INK:15};n.AnnotationEditorType=S;const A={FREETEXT_SIZE:1,FREETEXT_COLOR:2,FREETEXT_OPACITY:3,INK_COLOR:11,INK_THICKNESS:12,INK_OPACITY:13};n.AnnotationEditorParamsType=A;const y={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};n.PermissionFlag=y;const _={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};n.TextRenderingMode=_;const h={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};n.ImageKind=h;const l={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};n.AnnotationType=l;const o={MARKED:"Marked",REVIEW:"Review"};n.AnnotationStateModelType=o;const s={MARKED:"Marked",UNMARKED:"Unmarked"};n.AnnotationMarkedState=s;const f={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"};n.AnnotationReviewState=f;const g={GROUP:"Group",REPLY:"R"};n.AnnotationReplyType=g;const v={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};n.AnnotationFlag=v;const c={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};n.AnnotationFieldFlag=c;const d={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};n.AnnotationBorderStyleType=d;const x={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"};n.AnnotationActionEventType=x;const L={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};n.DocumentActionEventType=L;const X={O:"PageOpen",C:"PageClose"};n.PageActionEventType=X;const N={UNKNOWN:"UNKNOWN",FLATE:"FLATE",LZW:"LZW",DCT:"DCT",JPX:"JPX",JBIG:"JBIG",A85:"A85",AHX:"AHX",CCF:"CCF",RLX:"RLX"};n.StreamType=N;const D={UNKNOWN:"UNKNOWN",TYPE1:"TYPE1",TYPE1STANDARD:"TYPE1STANDARD",TYPE1C:"TYPE1C",CIDFONTTYPE0:"CIDFONTTYPE0",CIDFONTTYPE0C:"CIDFONTTYPE0C",TRUETYPE:"TRUETYPE",CIDFONTTYPE2:"CIDFONTTYPE2",TYPE3:"TYPE3",OPENTYPE:"OPENTYPE",TYPE0:"TYPE0",MMTYPE1:"MMTYPE1"};n.FontType=D;const se={ERRORS:0,WARNINGS:1,INFOS:5};n.VerbosityLevel=se;const Ae={NONE:0,BINARY:1};n.CMapCompressionType=Ae;const Te={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};n.OPS=Te;const le={forms:"forms",javaScript:"javaScript",signatures:"signatures",smask:"smask",shadingPattern:"shadingPattern",errorTilingPattern:"errorTilingPattern",errorExtGState:"errorExtGState",errorXObject:"errorXObject",errorFontLoadType3:"errorFontLoadType3",errorFontState:"errorFontState",errorFontMissing:"errorFontMissing",errorFontTranslate:"errorFontTranslate",errorColorSpace:"errorColorSpace",errorOperatorList:"errorOperatorList",errorFontToUnicode:"errorFontToUnicode",errorFontLoadNative:"errorFontLoadNative",errorFontBuildPath:"errorFontBuildPath",errorFontGetPath:"errorFontGetPath",errorMarkedContent:"errorMarkedContent",errorContentSubStream:"errorContentSubStream"};n.UNSUPPORTED_FEATURES=le;const ie={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};n.PasswordResponses=ie;let fe=se.WARNINGS;function _e(Ve){Number.isInteger(Ve)&&(fe=Ve)}function oe(){return fe}function Me(Ve){fe>=se.INFOS&&console.log(`Info: ${Ve}`)}function xe(Ve){fe>=se.WARNINGS&&console.log(`Warning: ${Ve}`)}function K(Ve){throw new Error(Ve)}function T(Ve,be){Ve||K(be)}function P(Ve){if(!Ve)return!1;switch(Ve.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function $(Ve,be=null,j=null){if(!Ve)return null;try{if(j&&typeof Ve=="string"){if(j.addDefaultProtocol&&Ve.startsWith("www.")){const Ge=Ve.match(/\./g);Ge&&Ge.length>=2&&(Ve=`http://${Ve}`)}if(j.tryConvertEncoding)try{Ve=We(Ve)}catch{}}const ye=be?new URL(Ve,be):new URL(Ve);if(P(ye))return ye}catch{}return null}function Y(Ve,be,j,ye=!1){return Object.defineProperty(Ve,be,{value:j,enumerable:!ye,configurable:!0,writable:!1}),j}const J=function(){function be(j,ye){this.constructor===be&&K("Cannot initialize BaseException."),this.message=j,this.name=ye}return be.prototype=new Error,be.constructor=be,be}();n.BaseException=J;class te extends J{constructor(be,j){super(be,"PasswordException"),this.code=j}}n.PasswordException=te;class he extends J{constructor(be,j){super(be,"UnknownErrorException"),this.details=j}}n.UnknownErrorException=he;class ve extends J{constructor(be){super(be,"InvalidPDFException")}}n.InvalidPDFException=ve;class Ne extends J{constructor(be){super(be,"MissingPDFException")}}n.MissingPDFException=Ne;class Se extends J{constructor(be,j){super(be,"UnexpectedResponseException"),this.status=j}}n.UnexpectedResponseException=Se;class je extends J{constructor(be){super(be,"FormatError")}}n.FormatError=je;class Ie extends J{constructor(be){super(be,"AbortException")}}n.AbortException=Ie;function ze(Ve){(typeof Ve!="object"||Ve===null||Ve.length===void 0)&&K("Invalid argument for bytesToString");const be=Ve.length,j=8192;if(be<j)return String.fromCharCode.apply(null,Ve);const ye=[];for(let Ge=0;Ge<be;Ge+=j){const ht=Math.min(Ge+j,be),st=Ve.subarray(Ge,ht);ye.push(String.fromCharCode.apply(null,st))}return ye.join("")}function C(Ve){typeof Ve!="string"&&K("Invalid argument for stringToBytes");const be=Ve.length,j=new Uint8Array(be);for(let ye=0;ye<be;++ye)j[ye]=Ve.charCodeAt(ye)&255;return j}function I(Ve){if(Ve.length!==void 0)return Ve.length;if(Ve.byteLength!==void 0)return Ve.byteLength;K("Invalid argument for arrayByteLength")}function G(Ve){const be=Ve.length;if(be===1&&Ve[0]instanceof Uint8Array)return Ve[0];let j=0;for(let ht=0;ht<be;ht++)j+=I(Ve[ht]);let ye=0;const Ge=new Uint8Array(j);for(let ht=0;ht<be;ht++){let st=Ve[ht];st instanceof Uint8Array||(typeof st=="string"?st=C(st):st=new Uint8Array(st));const Ct=st.byteLength;Ge.set(st,ye),ye+=Ct}return Ge}function z(Ve){return String.fromCharCode(Ve>>24&255,Ve>>16&255,Ve>>8&255,Ve&255)}function q(Ve){return Object.keys(Ve).length}function ge(Ve){const be=Object.create(null);for(const[j,ye]of Ve)be[j]=ye;return be}function Be(){const Ve=new Uint8Array(4);return Ve[0]=1,new Uint32Array(Ve.buffer,0,1)[0]===1}function Ze(){try{return new Function(""),!0}catch{return!1}}class pe{static get isLittleEndian(){return Y(this,"isLittleEndian",Be())}static get isEvalSupported(){return Y(this,"isEvalSupported",Ze())}static get isOffscreenCanvasSupported(){return Y(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}}n.FeatureTest=pe;const ot=[...Array(256).keys()].map(Ve=>Ve.toString(16).padStart(2,"0"));class Le{static makeHexColor(be,j,ye){return`#${ot[be]}${ot[j]}${ot[ye]}`}static scaleMinMax(be,j){let ye;be[0]?(be[0]<0&&(ye=j[0],j[0]=j[1],j[1]=ye),j[0]*=be[0],j[1]*=be[0],be[3]<0&&(ye=j[2],j[2]=j[3],j[3]=ye),j[2]*=be[3],j[3]*=be[3]):(ye=j[0],j[0]=j[2],j[2]=ye,ye=j[1],j[1]=j[3],j[3]=ye,be[1]<0&&(ye=j[2],j[2]=j[3],j[3]=ye),j[2]*=be[1],j[3]*=be[1],be[2]<0&&(ye=j[0],j[0]=j[1],j[1]=ye),j[0]*=be[2],j[1]*=be[2]),j[0]+=be[4],j[1]+=be[4],j[2]+=be[5],j[3]+=be[5]}static transform(be,j){return[be[0]*j[0]+be[2]*j[1],be[1]*j[0]+be[3]*j[1],be[0]*j[2]+be[2]*j[3],be[1]*j[2]+be[3]*j[3],be[0]*j[4]+be[2]*j[5]+be[4],be[1]*j[4]+be[3]*j[5]+be[5]]}static applyTransform(be,j){const ye=be[0]*j[0]+be[1]*j[2]+j[4],Ge=be[0]*j[1]+be[1]*j[3]+j[5];return[ye,Ge]}static applyInverseTransform(be,j){const ye=j[0]*j[3]-j[1]*j[2],Ge=(be[0]*j[3]-be[1]*j[2]+j[2]*j[5]-j[4]*j[3])/ye,ht=(-be[0]*j[1]+be[1]*j[0]+j[4]*j[1]-j[5]*j[0])/ye;return[Ge,ht]}static getAxialAlignedBoundingBox(be,j){const ye=Le.applyTransform(be,j),Ge=Le.applyTransform(be.slice(2,4),j),ht=Le.applyTransform([be[0],be[3]],j),st=Le.applyTransform([be[2],be[1]],j);return[Math.min(ye[0],Ge[0],ht[0],st[0]),Math.min(ye[1],Ge[1],ht[1],st[1]),Math.max(ye[0],Ge[0],ht[0],st[0]),Math.max(ye[1],Ge[1],ht[1],st[1])]}static inverseTransform(be){const j=be[0]*be[3]-be[1]*be[2];return[be[3]/j,-be[1]/j,-be[2]/j,be[0]/j,(be[2]*be[5]-be[4]*be[3])/j,(be[4]*be[1]-be[5]*be[0])/j]}static singularValueDecompose2dScale(be){const j=[be[0],be[2],be[1],be[3]],ye=be[0]*j[0]+be[1]*j[2],Ge=be[0]*j[1]+be[1]*j[3],ht=be[2]*j[0]+be[3]*j[2],st=be[2]*j[1]+be[3]*j[3],Ct=(ye+st)/2,gt=Math.sqrt((ye+st)**2-4*(ye*st-ht*Ge))/2,bt=Ct+gt||1,wt=Ct-gt||1;return[Math.sqrt(bt),Math.sqrt(wt)]}static normalizeRect(be){const j=be.slice(0);return be[0]>be[2]&&(j[0]=be[2],j[2]=be[0]),be[1]>be[3]&&(j[1]=be[3],j[3]=be[1]),j}static intersect(be,j){const ye=Math.max(Math.min(be[0],be[2]),Math.min(j[0],j[2])),Ge=Math.min(Math.max(be[0],be[2]),Math.max(j[0],j[2]));if(ye>Ge)return null;const ht=Math.max(Math.min(be[1],be[3]),Math.min(j[1],j[3])),st=Math.min(Math.max(be[1],be[3]),Math.max(j[1],j[3]));return ht>st?null:[ye,ht,Ge,st]}static bezierBoundingBox(be,j,ye,Ge,ht,st,Ct,gt){const bt=[],wt=[[],[]];let Rt,Xt,It,_t,$t,Ot,dn,Yt;for(let Pn=0;Pn<2;++Pn){if(Pn===0?(Xt=6*be-12*ye+6*ht,Rt=-3*be+9*ye-9*ht+3*Ct,It=3*ye-3*be):(Xt=6*j-12*Ge+6*st,Rt=-3*j+9*Ge-9*st+3*gt,It=3*Ge-3*j),Math.abs(Rt)<1e-12){if(Math.abs(Xt)<1e-12)continue;_t=-It/Xt,0<_t&&_t<1&&bt.push(_t);continue}dn=Xt*Xt-4*It*Rt,Yt=Math.sqrt(dn),!(dn<0)&&($t=(-Xt+Yt)/(2*Rt),0<$t&&$t<1&&bt.push($t),Ot=(-Xt-Yt)/(2*Rt),0<Ot&&Ot<1&&bt.push(Ot))}let tn=bt.length,Tt;const bn=tn;for(;tn--;)_t=bt[tn],Tt=1-_t,wt[0][tn]=Tt*Tt*Tt*be+3*Tt*Tt*_t*ye+3*Tt*_t*_t*ht+_t*_t*_t*Ct,wt[1][tn]=Tt*Tt*Tt*j+3*Tt*Tt*_t*Ge+3*Tt*_t*_t*st+_t*_t*_t*gt;return wt[0][bn]=be,wt[1][bn]=j,wt[0][bn+1]=Ct,wt[1][bn+1]=gt,wt[0].length=wt[1].length=bn+2,[Math.min(...wt[0]),Math.min(...wt[1]),Math.max(...wt[0]),Math.max(...wt[1])]}}n.Util=Le;const Ye=[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 ce(Ve){if(Ve[0]>="ï"){let j;if(Ve[0]==="þ"&&Ve[1]==="ÿ"?j="utf-16be":Ve[0]==="ÿ"&&Ve[1]==="þ"?j="utf-16le":Ve[0]==="ï"&&Ve[1]==="»"&&Ve[2]==="¿"&&(j="utf-8"),j)try{const ye=new TextDecoder(j,{fatal:!0}),Ge=C(Ve);return ye.decode(Ge)}catch(ye){xe(`stringToPDFString: "${ye}".`)}}const be=[];for(let j=0,ye=Ve.length;j<ye;j++){const Ge=Ye[Ve.charCodeAt(j)];be.push(Ge?String.fromCharCode(Ge):Ve.charAt(j))}return be.join("")}function We(Ve){return decodeURIComponent(escape(Ve))}function nt(Ve){return unescape(encodeURIComponent(Ve))}function ut(Ve){return typeof Ve=="object"&&Ve!==null&&Ve.byteLength!==void 0}function Et(Ve,be){if(Ve.length!==be.length)return!1;for(let j=0,ye=Ve.length;j<ye;j++)if(Ve[j]!==be[j])return!1;return!0}function kt(Ve=new Date){return[Ve.getUTCFullYear().toString(),(Ve.getUTCMonth()+1).toString().padStart(2,"0"),Ve.getUTCDate().toString().padStart(2,"0"),Ve.getUTCHours().toString().padStart(2,"0"),Ve.getUTCMinutes().toString().padStart(2,"0"),Ve.getUTCSeconds().toString().padStart(2,"0")].join("")}function ct(){const Ve=Object.create(null);let be=!1;return Object.defineProperty(Ve,"settled",{get(){return be}}),Ve.promise=new Promise(function(j,ye){Ve.resolve=function(Ge){be=!0,j(Ge)},Ve.reject=function(Ge){be=!0,ye(Ge)}}),Ve}},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{var t,a,r,e,p,k,E,b,R,S,A,ba,_,h;Object.defineProperty(exports,"__esModule",{value:!0}),exports.build=exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,exports.getDocument=getDocument,exports.setPDFNetworkStreamFactory=setPDFNetworkStreamFactory,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__(10),_worker_options=__w_pdfjs_require__(14),_is_node=__w_pdfjs_require__(12),_message_handler=__w_pdfjs_require__(15),_metadata=__w_pdfjs_require__(16),_optional_content_config=__w_pdfjs_require__(17),_transport_stream=__w_pdfjs_require__(18),_xfa_text=__w_pdfjs_require__(19);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100;let DefaultCanvasFactory=_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;let DefaultCMapReaderFactory=_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;let DefaultStandardFontDataFactory=_display_utils.DOMStandardFontDataFactory;if(exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory,_is_node.isNodeJS){const{NodeCanvasFactory:o,NodeCMapReaderFactory:s,NodeStandardFontDataFactory:f}=__w_pdfjs_require__(20);exports.DefaultCanvasFactory=DefaultCanvasFactory=o,exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory=s,exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory=f}let createPDFNetworkStream;function setPDFNetworkStreamFactory(o){createPDFNetworkStream=o}function getDocument(o){const s=new PDFDocumentLoadingTask;let f;if(typeof o=="string"||o instanceof URL)f={url:o};else if((0,_util.isArrayBuffer)(o))f={data:o};else if(o instanceof PDFDataRangeTransport)f={range:o};else{if(typeof o!="object")throw new Error("Invalid parameter in getDocument, need either string, URL, TypedArray, or parameter object.");if(!o.url&&!o.data&&!o.range)throw new Error("Invalid parameter object: need either .data, .range or .url");f=o}const g=Object.create(null);let v=null,c=null;for(const x in f){const L=f[x];switch(x){case"url":if(typeof window<"u")try{g[x]=new URL(L,window.location).href;continue}catch(X){(0,_util.warn)(`Cannot create valid URL: "${X}".`)}else if(typeof L=="string"||L instanceof URL){g[x]=L.toString();continue}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.");case"range":v=L;continue;case"worker":c=L;continue;case"data":if(_is_node.isNodeJS&&typeof Buffer<"u"&&L instanceof Buffer)g[x]=new Uint8Array(L);else{if(L instanceof Uint8Array)break;if(typeof L=="string")g[x]=(0,_util.stringToBytes)(L);else if(typeof L=="object"&&L!==null&&!isNaN(L.length))g[x]=new Uint8Array(L);else if((0,_util.isArrayBuffer)(L))g[x]=new Uint8Array(L);else throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}continue}g[x]=L}if(g.CMapReaderFactory=g.CMapReaderFactory||DefaultCMapReaderFactory,g.StandardFontDataFactory=g.StandardFontDataFactory||DefaultStandardFontDataFactory,g.ignoreErrors=g.stopAtErrors!==!0,g.fontExtraProperties=g.fontExtraProperties===!0,g.pdfBug=g.pdfBug===!0,g.enableXfa=g.enableXfa===!0,(!Number.isInteger(g.rangeChunkSize)||g.rangeChunkSize<1)&&(g.rangeChunkSize=DEFAULT_RANGE_CHUNK_SIZE),(typeof g.docBaseUrl!="string"||(0,_display_utils.isDataScheme)(g.docBaseUrl))&&(g.docBaseUrl=null),(!Number.isInteger(g.maxImageSize)||g.maxImageSize<-1)&&(g.maxImageSize=-1),typeof g.cMapUrl!="string"&&(g.cMapUrl=null),typeof g.standardFontDataUrl!="string"&&(g.standardFontDataUrl=null),typeof g.useWorkerFetch!="boolean"&&(g.useWorkerFetch=g.CMapReaderFactory===_display_utils.DOMCMapReaderFactory&&g.StandardFontDataFactory===_display_utils.DOMStandardFontDataFactory),typeof g.isEvalSupported!="boolean"&&(g.isEvalSupported=!0),typeof g.isOffscreenCanvasSupported!="boolean"&&(g.isOffscreenCanvasSupported=!_is_node.isNodeJS),typeof g.disableFontFace!="boolean"&&(g.disableFontFace=_is_node.isNodeJS),typeof g.useSystemFonts!="boolean"&&(g.useSystemFonts=!_is_node.isNodeJS&&!g.disableFontFace),(typeof g.ownerDocument!="object"||g.ownerDocument===null)&&(g.ownerDocument=globalThis.document),typeof g.disableRange!="boolean"&&(g.disableRange=!1),typeof g.disableStream!="boolean"&&(g.disableStream=!1),typeof g.disableAutoFetch!="boolean"&&(g.disableAutoFetch=!1),(0,_util.setVerbosityLevel)(g.verbosity),!c){const x={verbosity:g.verbosity,port:_worker_options.GlobalWorkerOptions.workerPort};c=x.port?PDFWorker.fromPort(x):new PDFWorker(x),s._worker=c}const d=s.docId;return c.promise.then(function(){if(s.destroyed)throw new Error("Loading aborted");const x=_fetchDocument(c,g,v,d),L=new Promise(function(X){let N;v?N=new _transport_stream.PDFDataTransportStream({length:g.length,initialData:g.initialData,progressiveDone:g.progressiveDone,contentDispositionFilename:g.contentDispositionFilename,disableRange:g.disableRange,disableStream:g.disableStream},v):g.data||(N=createPDFNetworkStream({url:g.url,length:g.length,httpHeaders:g.httpHeaders,withCredentials:g.withCredentials,rangeChunkSize:g.rangeChunkSize,disableRange:g.disableRange,disableStream:g.disableStream})),X(N)});return Promise.all([x,L]).then(function([X,N]){if(s.destroyed)throw new Error("Loading aborted");const D=new _message_handler.MessageHandler(d,X,c.port),se=new WorkerTransport(D,s,N,g);s._transport=se,D.send("Ready",null)})}).catch(s._capability.reject),s}async function _fetchDocument(o,s,f,g){if(o.destroyed)throw new Error("Worker was destroyed");f&&(s.length=f.length,s.initialData=f.initialData,s.progressiveDone=f.progressiveDone,s.contentDispositionFilename=f.contentDispositionFilename);const v=await o.messageHandler.sendWithPromise("GetDocRequest",{docId:g,apiVersion:"3.1.81",data:s.data,password:s.password,disableAutoFetch:s.disableAutoFetch,rangeChunkSize:s.rangeChunkSize,length:s.length,docBaseUrl:s.docBaseUrl,enableXfa:s.enableXfa,evaluatorOptions:{maxImageSize:s.maxImageSize,disableFontFace:s.disableFontFace,ignoreErrors:s.ignoreErrors,isEvalSupported:s.isEvalSupported,isOffscreenCanvasSupported:s.isOffscreenCanvasSupported,fontExtraProperties:s.fontExtraProperties,useSystemFonts:s.useSystemFonts,cMapUrl:s.useWorkerFetch?s.cMapUrl:null,standardFontDataUrl:s.useWorkerFetch?s.standardFontDataUrl:null}});if(s.data&&(s.data=null),o.destroyed)throw new Error("Worker was destroyed");return v}const n=class n{constructor(){this._capability=(0,_util.createPromiseCapability)(),this._transport=null,this._worker=null,this.docId=`d${_a(n,t)._++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null,this.onUnsupportedFeature=null}get promise(){return this._capability.promise}async destroy(){var s;this.destroyed=!0,await((s=this._transport)==null?void 0:s.destroy()),this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}};t=new WeakMap,De(n,t,0);let PDFDocumentLoadingTask=n;exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(s,f,g=!1,v=null){this.length=s,this.initialData=f,this.progressiveDone=g,this.contentDispositionFilename=v,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=(0,_util.createPromiseCapability)()}addRangeListener(s){this._rangeListeners.push(s)}addProgressListener(s){this._progressListeners.push(s)}addProgressiveReadListener(s){this._progressiveReadListeners.push(s)}addProgressiveDoneListener(s){this._progressiveDoneListeners.push(s)}onDataRange(s,f){for(const g of this._rangeListeners)g(s,f)}onDataProgress(s,f){this._readyCapability.promise.then(()=>{for(const g of this._progressListeners)g(s,f)})}onDataProgressiveRead(s){this._readyCapability.promise.then(()=>{for(const f of this._progressiveReadListeners)f(s)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const s of this._progressiveDoneListeners)s()})}transportReady(){this._readyCapability.resolve()}requestDataRange(s,f){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(s,f){this._pdfInfo=s,this._transport=f}get annotationStorage(){return this._transport.annotationStorage}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get stats(){return this._transport.stats}get isPureXfa(){return!!this._transport._htmlForXfa}get allXfaHtml(){return this._transport._htmlForXfa}getPage(s){return this._transport.getPage(s)}getPageIndex(s){return this._transport.getPageIndex(s)}getDestinations(){return this._transport.getDestinations()}getDestination(s){return this._transport.getDestination(s)}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(s=!1){return this._transport.startCleanup(s||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(s,f,g,v,c=!1){this._pageIndex=s,this._pageInfo=f,this._ownerDocument=v,this._transport=g,this._stats=c?new _display_utils.StatTimer:null,this._pdfBug=c,this.commonObjs=g.commonObjs,this.objs=new PDFObjects,this._bitmaps=new Set,this.cleanupAfterRender=!1,this.pendingCleanup=!1,this._intentStates=new Map,this._annotationPromises=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:s,rotation:f=this.rotate,offsetX:g=0,offsetY:v=0,dontFlip:c=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:s,rotation:f,offsetX:g,offsetY:v,dontFlip:c})}getAnnotations({intent:s="display"}={}){const f=this._transport.getRenderingIntent(s);let g=this._annotationPromises.get(f.cacheKey);return g||(g=this._transport.getAnnotations(this._pageIndex,f.renderingIntent),this._annotationPromises.set(f.cacheKey,g)),g}getJSActions(){return this._jsActionsPromise||(this._jsActionsPromise=this._transport.getPageJSActions(this._pageIndex))}async getXfa(){var s;return((s=this._transport._htmlForXfa)==null?void 0:s.children[this._pageIndex])||null}render({canvasContext:s,viewport:f,intent:g="display",annotationMode:v=_util.AnnotationMode.ENABLE,transform:c=null,canvasFactory:d=null,background:x=null,optionalContentConfigPromise:L=null,annotationCanvasMap:X=null,pageColors:N=null,printAnnotationStorage:D=null}){var oe,Me;(oe=this._stats)==null||oe.time("Overall");const se=this._transport.getRenderingIntent(g,v,D);this.pendingCleanup=!1,L||(L=this._transport.getOptionalContentConfig());let Ae=this._intentStates.get(se.cacheKey);Ae||(Ae=Object.create(null),this._intentStates.set(se.cacheKey,Ae)),Ae.streamReaderCancelTimeout&&(clearTimeout(Ae.streamReaderCancelTimeout),Ae.streamReaderCancelTimeout=null);const Te=d||new DefaultCanvasFactory({ownerDocument:this._ownerDocument}),le=!!(se.renderingIntent&_util.RenderingIntentFlag.PRINT);Ae.displayReadyCapability||(Ae.displayReadyCapability=(0,_util.createPromiseCapability)(),Ae.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(Me=this._stats)==null||Me.time("Page Request"),this._pumpOperatorList(se));const ie=xe=>{var K,T;Ae.renderTasks.delete(fe),(this.cleanupAfterRender||le)&&(this.pendingCleanup=!0),this._tryCleanup(),xe?(fe.capability.reject(xe),this._abortOperatorList({intentState:Ae,reason:xe instanceof Error?xe:new Error(xe)})):fe.capability.resolve(),(K=this._stats)==null||K.timeEnd("Rendering"),(T=this._stats)==null||T.timeEnd("Overall")},fe=new InternalRenderTask({callback:ie,params:{canvasContext:s,viewport:f,transform:c,background:x},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:X,operatorList:Ae.operatorList,pageIndex:this._pageIndex,canvasFactory:Te,useRequestAnimationFrame:!le,pdfBug:this._pdfBug,pageColors:N});(Ae.renderTasks||(Ae.renderTasks=new Set)).add(fe);const _e=fe.task;return Promise.all([Ae.displayReadyCapability.promise,L]).then(([xe,K])=>{var T;if(this.pendingCleanup){ie();return}(T=this._stats)==null||T.time("Rendering"),fe.initializeGraphics({transparency:xe,optionalContentConfig:K}),fe.operatorListChanged()}).catch(ie),_e}getOperatorList({intent:s="display",annotationMode:f=_util.AnnotationMode.ENABLE,printAnnotationStorage:g=null}={}){var L;function v(){d.operatorList.lastChunk&&(d.opListReadCapability.resolve(d.operatorList),d.renderTasks.delete(x))}const c=this._transport.getRenderingIntent(s,f,g,!0);let d=this._intentStates.get(c.cacheKey);d||(d=Object.create(null),this._intentStates.set(c.cacheKey,d));let x;return d.opListReadCapability||(x=Object.create(null),x.operatorListChanged=v,d.opListReadCapability=(0,_util.createPromiseCapability)(),(d.renderTasks||(d.renderTasks=new Set)).add(x),d.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(L=this._stats)==null||L.time("Page Request"),this._pumpOperatorList(c)),d.opListReadCapability.promise}streamTextContent({disableCombineTextItems:s=!1,includeMarkedContent:f=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,combineTextItems:s!==!0,includeMarkedContent:f===!0},{highWaterMark:100,size(v){return v.items.length}})}getTextContent(s={}){if(this._transport._htmlForXfa)return this.getXfa().then(g=>_xfa_text.XfaText.textContent(g));const f=this.streamTextContent(s);return new Promise(function(g,v){function c(){d.read().then(function({value:L,done:X}){if(X){g(x);return}Object.assign(x.styles,L.styles),x.items.push(...L.items),c()},v)}const d=f.getReader(),x={items:[],styles:Object.create(null)};c()})}getStructTree(){return this._structTreePromise||(this._structTreePromise=this._transport.getStructTree(this._pageIndex))}_destroy(){this.destroyed=!0;const s=[];for(const f of this._intentStates.values())if(this._abortOperatorList({intentState:f,reason:new Error("Page was destroyed."),force:!0}),!f.opListReadCapability)for(const g of f.renderTasks)s.push(g.completed),g.cancel();this.objs.clear();for(const f of this._bitmaps)f.close();return this._bitmaps.clear(),this._annotationPromises.clear(),this._jsActionsPromise=null,this._structTreePromise=null,this.pendingCleanup=!1,Promise.all(s)}cleanup(s=!1){return this.pendingCleanup=!0,this._tryCleanup(s)}_tryCleanup(s=!1){if(!this.pendingCleanup)return!1;for(const{renderTasks:f,operatorList:g}of this._intentStates.values())if(f.size>0||!g.lastChunk)return!1;this._intentStates.clear(),this.objs.clear(),this._annotationPromises.clear(),this._jsActionsPromise=null,this._structTreePromise=null,s&&this._stats&&(this._stats=new _display_utils.StatTimer);for(const f of this._bitmaps)f.close();return this._bitmaps.clear(),this.pendingCleanup=!1,!0}_startRenderPage(s,f){var v,c;const g=this._intentStates.get(f);g&&((v=this._stats)==null||v.timeEnd("Page Request"),(c=g.displayReadyCapability)==null||c.resolve(s))}_renderPageChunk(s,f){for(let g=0,v=s.length;g<v;g++)f.operatorList.fnArray.push(s.fnArray[g]),f.operatorList.argsArray.push(s.argsArray[g]);f.operatorList.lastChunk=s.lastChunk,f.operatorList.separateAnnots=s.separateAnnots;for(const g of f.renderTasks)g.operatorListChanged();s.lastChunk&&this._tryCleanup()}_pumpOperatorList({renderingIntent:s,cacheKey:f,annotationStorageMap:g}){const c=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:s,cacheKey:f,annotationStorage:g}).getReader(),d=this._intentStates.get(f);d.streamReader=c;const x=()=>{c.read().then(({value:L,done:X})=>{if(X){d.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(L,d),x())},L=>{if(d.streamReader=null,!this._transport.destroyed){if(d.operatorList){d.operatorList.lastChunk=!0;for(const X of d.renderTasks)X.operatorListChanged();this._tryCleanup()}if(d.displayReadyCapability)d.displayReadyCapability.reject(L);else if(d.opListReadCapability)d.opListReadCapability.reject(L);else throw L}})};x()}_abortOperatorList({intentState:s,reason:f,force:g=!1}){if(s.streamReader){if(!g){if(s.renderTasks.size>0)return;if(f instanceof _display_utils.RenderingCancelledException){s.streamReaderCancelTimeout=setTimeout(()=>{this._abortOperatorList({intentState:s,reason:f,force:!0}),s.streamReaderCancelTimeout=null},RENDERING_CANCELLED_TIMEOUT);return}}if(s.streamReader.cancel(new _util.AbortException(f.message)).catch(()=>{}),s.streamReader=null,!this._transport.destroyed){for(const[v,c]of this._intentStates)if(c===s){this._intentStates.delete(v);break}this.cleanup()}}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){De(this,a,[]);De(this,r,Promise.resolve())}postMessage(s,f){const g={data:structuredClone(s,f)};B(this,r).then(()=>{for(const v of B(this,a))v.call(this,g)})}addEventListener(s,f){B(this,a).push(f)}removeEventListener(s,f){const g=B(this,a).indexOf(f);B(this,a).splice(g,1)}terminate(){B(this,a).length=0}}a=new WeakMap,r=new WeakMap,exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports.PDFWorkerUtil=PDFWorkerUtil;{if(_is_node.isNodeJS&&typeof commonjsRequire=="function")PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if(typeof document=="object"){const o=(e=document==null?void 0:document.currentScript)==null?void 0:e.src;o&&(PDFWorkerUtil.fallbackWorkerSrc=o.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(o,s){let f;try{if(f=new URL(o),!f.origin||f.origin==="null")return!1}catch{return!1}const g=new URL(s,f);return f.origin===g.origin},PDFWorkerUtil.createCDNWrapper=function(o){const s=`importScripts("${o}");`;return URL.createObjectURL(new Blob([s]))}}const _PDFWorker=class _PDFWorker{constructor({name:o=null,port:s=null,verbosity:f=(0,_util.getVerbosityLevel)()}={}){if(s&&B(_PDFWorker,p).has(s))throw new Error("Cannot use more than one PDFWorker per port.");if(this.name=o,this.destroyed=!1,this.verbosity=f,this._readyCapability=(0,_util.createPromiseCapability)(),this._port=null,this._webWorker=null,this._messageHandler=null,s){B(_PDFWorker,p).set(s,this),this._initializeFromPort(s);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(o){this._port=o,this._messageHandler=new _message_handler.MessageHandler("main","worker",o),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!_PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:o}=_PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,o)||(o=PDFWorkerUtil.createCDNWrapper(new URL(o,window.location).href));const s=new Worker(o),f=new _message_handler.MessageHandler("main","worker",s),g=()=>{s.removeEventListener("error",v),f.destroy(),s.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},v=()=>{this._webWorker||g()};s.addEventListener("error",v),f.on("test",d=>{if(s.removeEventListener("error",v),this.destroyed){g();return}d?(this._messageHandler=f,this._port=s,this._webWorker=s,this._readyCapability.resolve(),f.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),f.destroy(),s.terminate())}),f.on("ready",d=>{if(s.removeEventListener("error",v),this.destroyed){g();return}try{c()}catch{this._setupFakeWorker()}});const c=()=>{const d=new Uint8Array;f.send("test",d,[d.buffer])};c();return}catch{(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(o=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const s=new LoopbackPort;this._port=s;const f=`fake${PDFWorkerUtil.fakeWorkerId++}`,g=new _message_handler.MessageHandler(f+"_worker",f,s);o.setup(g,s);const v=new _message_handler.MessageHandler(f,f+"_worker",s);this._messageHandler=v,this._readyCapability.resolve(),v.send("configure",{verbosity:this.verbosity})}).catch(o=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${o.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),B(_PDFWorker,p).delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(o){if(!(o!=null&&o.port))throw new Error("PDFWorker.fromPort - invalid method signature.");return B(this,p).has(o.port)?B(this,p).get(o.port):new _PDFWorker(o)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(PDFWorkerUtil.fallbackWorkerSrc!==null)return _is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){var o;try{return((o=globalThis.pdfjsWorker)==null?void 0:o.WorkerMessageHandler)||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node.isNodeJS&&typeof commonjsRequire=="function"){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}};p=new WeakMap,De(_PDFWorker,p,new WeakMap);let PDFWorker=_PDFWorker;exports.PDFWorker=PDFWorker;class WorkerTransport{constructor(s,f,g,v){De(this,k,null);De(this,E,new Map);De(this,b,new Map);De(this,R,null);this.messageHandler=s,this.loadingTask=f,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({onUnsupportedFeature:this._onUnsupportedFeature.bind(this),ownerDocument:v.ownerDocument,styleElement:v.styleElement}),this._params=v,v.useWorkerFetch||(this.CMapReaderFactory=new v.CMapReaderFactory({baseUrl:v.cMapUrl,isCompressed:v.cMapPacked}),this.StandardFontDataFactory=new v.StandardFontDataFactory({baseUrl:v.standardFontDataUrl})),this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this._networkStream=g,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=(0,_util.createPromiseCapability)(),this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}get stats(){return B(this,k)}getRenderingIntent(s,f=_util.AnnotationMode.ENABLE,g=null,v=!1){let c=_util.RenderingIntentFlag.DISPLAY,d=null;switch(s){case"any":c=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":c=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${s}`)}switch(f){case _util.AnnotationMode.DISABLE:c+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:c+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:c+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,d=(c&_util.RenderingIntentFlag.PRINT&&g instanceof _annotation_storage.PrintAnnotationStorage?g:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${f}`)}return v&&(c+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:c,cacheKey:`${c}_${_annotation_storage.AnnotationStorage.getHash(d)}`,annotationStorageMap:d}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=(0,_util.createPromiseCapability)(),this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));const s=[];for(const g of B(this,E).values())s.push(g._destroy());B(this,E).clear(),B(this,b).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const f=this.messageHandler.sendWithPromise("Terminate",null);return s.push(f),Promise.all(s).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),rt(this,R,null),this._getFieldObjectsPromise=null,this._hasJSActionsPromise=null,this._networkStream&&this._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:s,loadingTask:f}=this;s.on("GetReader",(g,v)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=c=>{this._lastProgress={loaded:c.loaded,total:c.total}},v.onPull=()=>{this._fullReader.read().then(function({value:c,done:d}){if(d){v.close();return}(0,_util.assert)((0,_util.isArrayBuffer)(c),"GetReader - expected an ArrayBuffer."),v.enqueue(new Uint8Array(c),1,[c])}).catch(c=>{v.error(c)})},v.onCancel=c=>{this._fullReader.cancel(c),v.ready.catch(d=>{if(!this.destroyed)throw d})}}),s.on("ReaderHeadersReady",g=>{const v=(0,_util.createPromiseCapability)(),c=this._fullReader;return c.headersReady.then(()=>{var d;(!c.isStreamingSupported||!c.isRangeSupported)&&(this._lastProgress&&((d=f.onProgress)==null||d.call(f,this._lastProgress)),c.onProgress=x=>{var L;(L=f.onProgress)==null||L.call(f,{loaded:x.loaded,total:x.total})}),v.resolve({isStreamingSupported:c.isStreamingSupported,isRangeSupported:c.isRangeSupported,contentLength:c.contentLength})},v.reject),v.promise}),s.on("GetRangeReader",(g,v)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const c=this._networkStream.getRangeReader(g.begin,g.end);if(!c){v.close();return}v.onPull=()=>{c.read().then(function({value:d,done:x}){if(x){v.close();return}(0,_util.assert)((0,_util.isArrayBuffer)(d),"GetRangeReader - expected an ArrayBuffer."),v.enqueue(new Uint8Array(d),1,[d])}).catch(d=>{v.error(d)})},v.onCancel=d=>{c.cancel(d),v.ready.catch(x=>{if(!this.destroyed)throw x})}}),s.on("GetDoc",({pdfInfo:g})=>{this._numPages=g.numPages,this._htmlForXfa=g.htmlForXfa,delete g.htmlForXfa,f._capability.resolve(new PDFDocumentProxy(g,this))}),s.on("DocException",function(g){let v;switch(g.name){case"PasswordException":v=new _util.PasswordException(g.message,g.code);break;case"InvalidPDFException":v=new _util.InvalidPDFException(g.message);break;case"MissingPDFException":v=new _util.MissingPDFException(g.message);break;case"UnexpectedResponseException":v=new _util.UnexpectedResponseException(g.message,g.status);break;case"UnknownErrorException":v=new _util.UnknownErrorException(g.message,g.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}f._capability.reject(v)}),s.on("PasswordRequest",g=>{if(this._passwordCapability=(0,_util.createPromiseCapability)(),f.onPassword){const v=c=>{c instanceof Error?this._passwordCapability.reject(c):this._passwordCapability.resolve({password:c})};try{f.onPassword(v,g.code)}catch(c){this._passwordCapability.reject(c)}}else this._passwordCapability.reject(new _util.PasswordException(g.message,g.code));return this._passwordCapability.promise}),s.on("DataLoaded",g=>{var v;(v=f.onProgress)==null||v.call(f,{loaded:g.length,total:g.length}),this.downloadInfoCapability.resolve(g)}),s.on("StartRenderPage",g=>{if(this.destroyed)return;B(this,E).get(g.pageIndex)._startRenderPage(g.transparency,g.cacheKey)}),s.on("commonobj",([g,v,c])=>{var d;if(!this.destroyed&&!this.commonObjs.has(g))switch(v){case"Font":const x=this._params;if("error"in c){const N=c.error;(0,_util.warn)(`Error during font loading: ${N}`),this.commonObjs.resolve(g,N);break}let L=null;x.pdfBug&&((d=globalThis.FontInspector)!=null&&d.enabled)&&(L={registerFont(N,D){globalThis.FontInspector.fontAdded(N,D)}});const X=new _font_loader.FontFaceObject(c,{isEvalSupported:x.isEvalSupported,disableFontFace:x.disableFontFace,ignoreErrors:x.ignoreErrors,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),fontRegistry:L});this.fontLoader.bind(X).catch(N=>s.sendWithPromise("FontFallback",{id:g})).finally(()=>{!x.fontExtraProperties&&X.data&&(X.data=null),this.commonObjs.resolve(g,X)});break;case"FontPath":case"Image":this.commonObjs.resolve(g,c);break;default:throw new Error(`Got unknown common object type ${v}`)}}),s.on("obj",([g,v,c,d])=>{var L;if(this.destroyed)return;const x=B(this,E).get(v);if(!x.objs.has(g))switch(c){case"Image":x.objs.resolve(g,d);const X=8e6;if(d){let N;if(d.bitmap){const{bitmap:D,width:se,height:Ae}=d;N=se*Ae*4,x._bitmaps.add(D)}else N=((L=d.data)==null?void 0:L.length)||0;N>X&&(x.cleanupAfterRender=!0)}break;case"Pattern":x.objs.resolve(g,d);break;default:throw new Error(`Got unknown object type ${c}`)}}),s.on("DocProgress",g=>{var v;this.destroyed||(v=f.onProgress)==null||v.call(f,{loaded:g.loaded,total:g.total})}),s.on("DocStats",g=>{this.destroyed||rt(this,k,Object.freeze({streamTypes:Object.freeze(g.streamTypes),fontTypes:Object.freeze(g.fontTypes)}))}),s.on("UnsupportedFeature",this._onUnsupportedFeature.bind(this)),s.on("FetchBuiltInCMap",g=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.CMapReaderFactory?this.CMapReaderFactory.fetch(g):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),s.on("FetchStandardFontData",g=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.StandardFontDataFactory?this.StandardFontDataFactory.fetch(g):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}_onUnsupportedFeature({featureId:s}){var f,g;this.destroyed||(g=(f=this.loadingTask).onUnsupportedFeature)==null||g.call(f,s)}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var s;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:((s=this._fullReader)==null?void 0:s.filename)??null}).finally(()=>{this.annotationStorage.resetModified()})}getPage(s){if(!Number.isInteger(s)||s<=0||s>this._numPages)return Promise.reject(new Error("Invalid page request."));const f=s-1,g=B(this,b).get(f);if(g)return g;const v=this.messageHandler.sendWithPromise("GetPage",{pageIndex:f}).then(c=>{if(this.destroyed)throw new Error("Transport destroyed");const d=new PDFPageProxy(f,c,this,this._params.ownerDocument,this._params.pdfBug);return B(this,E).set(f,d),d});return B(this,b).set(f,v),v}getPageIndex(s){return typeof s!="object"||s===null||!Number.isInteger(s.num)||s.num<0||!Number.isInteger(s.gen)||s.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:s.num,gen:s.gen})}getAnnotations(s,f){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:s,intent:f})}getFieldObjects(){return this._getFieldObjectsPromise||(this._getFieldObjectsPromise=this.messageHandler.sendWithPromise("GetFieldObjects",null))}hasJSActions(){return this._hasJSActionsPromise||(this._hasJSActionsPromise=this.messageHandler.sendWithPromise("HasJSActions",null))}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(s){return typeof s!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:s})}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(s){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:s})}getStructTree(s){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:s})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(s=>new _optional_content_config.OptionalContentConfig(s))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){return B(this,R)||rt(this,R,this.messageHandler.sendWithPromise("GetMetadata",null).then(s=>{var f,g;return{info:s[0],metadata:s[1]?new _metadata.Metadata(s[1]):null,contentDispositionFilename:((f=this._fullReader)==null?void 0:f.filename)??null,contentLength:((g=this._fullReader)==null?void 0:g.contentLength)??null}}))}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(s=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const f of B(this,E).values())if(!f.cleanup())throw new Error(`startCleanup: Page ${f.pageNumber} is currently rendering.`);this.commonObjs.clear(),s||this.fontLoader.clear(),rt(this,R,null),this._getFieldObjectsPromise=null,this._hasJSActionsPromise=null}}get loadingParams(){const s=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:s.disableAutoFetch,enableXfa:s.enableXfa})}}k=new WeakMap,E=new WeakMap,b=new WeakMap,R=new WeakMap;class PDFObjects{constructor(){De(this,A);De(this,S,Object.create(null))}get(s,f=null){if(f){const v=qe(this,A,ba).call(this,s);return v.capability.promise.then(()=>f(v.data)),null}const g=B(this,S)[s];if(!(g!=null&&g.capability.settled))throw new Error(`Requesting object that isn't resolved yet ${s}.`);return g.data}has(s){const f=B(this,S)[s];return(f==null?void 0:f.capability.settled)||!1}resolve(s,f=null){const g=qe(this,A,ba).call(this,s);g.data=f,g.capability.resolve()}clear(){rt(this,S,Object.create(null))}}S=new WeakMap,A=new WeakSet,ba=function(s){const f=B(this,S)[s];return f||(B(this,S)[s]={capability:(0,_util.createPromiseCapability)(),data:null})};class RenderTask{constructor(s){De(this,_,null);rt(this,_,s),this.onContinue=null}get promise(){return B(this,_).capability.promise}cancel(){B(this,_).cancel()}get separateAnnots(){const{separateAnnots:s}=B(this,_).operatorList;if(!s)return!1;const{annotationCanvasMap:f}=B(this,_);return s.form||s.canvas&&(f==null?void 0:f.size)>0}}_=new WeakMap,exports.RenderTask=RenderTask;const l=class l{constructor({callback:s,params:f,objs:g,commonObjs:v,annotationCanvasMap:c,operatorList:d,pageIndex:x,canvasFactory:L,useRequestAnimationFrame:X=!1,pdfBug:N=!1,pageColors:D=null}){this.callback=s,this.params=f,this.objs=g,this.commonObjs=v,this.annotationCanvasMap=c,this.operatorListIdx=null,this.operatorList=d,this._pageIndex=x,this.canvasFactory=L,this._pdfBug=N,this.pageColors=D,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=X===!0&&typeof window<"u",this.cancelled=!1,this.capability=(0,_util.createPromiseCapability)(),this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=f.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:s=!1,optionalContentConfig:f}){var x,L;if(this.cancelled)return;if(this._canvas){if(B(l,h).has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");B(l,h).add(this._canvas)}this._pdfBug&&((x=globalThis.StepperManager)!=null&&x.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:g,viewport:v,transform:c,background:d}=this.params;this.gfx=new _canvas.CanvasGraphics(g,this.commonObjs,this.objs,this.canvasFactory,{optionalContentConfig:f},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:c,viewport:v,transparency:s,background:d}),this.operatorListIdx=0,this.graphicsReady=!0,(L=this.graphicsReadyCallback)==null||L.call(this)}cancel(s=null){var f;this.running=!1,this.cancelled=!0,(f=this.gfx)==null||f.endDrawing(),this._canvas&&B(l,h).delete(this._canvas),this.callback(s||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,"canvas"))}operatorListChanged(){var s;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(s=this.stepper)==null||s.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),this._canvas&&B(l,h).delete(this._canvas),this.callback())))}};h=new WeakMap,De(l,h,new WeakSet);let InternalRenderTask=l;const version="3.1.81";exports.version=version;const build="0766898d5";exports.build=build},(t,n,a)=>{var b,R,S,za,y;Object.defineProperty(n,"__esModule",{value:!0}),n.PrintAnnotationStorage=n.AnnotationStorage=void 0;var r=a(1),e=a(4),p=a(8);class k{constructor(){De(this,S);De(this,b,!1);De(this,R,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(h,l){const o=B(this,R).get(h);return o===void 0?l:Object.assign(l,o)}getRawValue(h){return B(this,R).get(h)}remove(h){if(B(this,R).delete(h),B(this,R).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const l of B(this,R).values())if(l instanceof e.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(h,l){const o=B(this,R).get(h);let s=!1;if(o!==void 0)for(const[f,g]of Object.entries(l))o[f]!==g&&(s=!0,o[f]=g);else s=!0,B(this,R).set(h,l);s&&qe(this,S,za).call(this),l instanceof e.AnnotationEditor&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(l.constructor._type)}has(h){return B(this,R).has(h)}getAll(){return B(this,R).size>0?(0,r.objectFromMap)(B(this,R)):null}get size(){return B(this,R).size}resetModified(){B(this,b)&&(rt(this,b,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new E(this)}get serializable(){if(B(this,R).size===0)return null;const h=new Map;for(const[l,o]of B(this,R)){const s=o instanceof e.AnnotationEditor?o.serialize():o;s&&h.set(l,s)}return h}static getHash(h){if(!h)return"";const l=new p.MurmurHash3_64;for(const[o,s]of h)l.update(`${o}:${JSON.stringify(s)}`);return l.hexdigest()}}b=new WeakMap,R=new WeakMap,S=new WeakSet,za=function(){B(this,b)||(rt(this,b,!0),typeof this.onSetModified=="function"&&this.onSetModified())},n.AnnotationStorage=k;class E extends k{constructor(l){super();De(this,y,null);rt(this,y,structuredClone(l.serializable))}get print(){(0,r.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return B(this,y)}}y=new WeakMap,n.PrintAnnotationStorage=E},(t,n,a)=>{var k,E,b,R,S,A;Object.defineProperty(n,"__esModule",{value:!0}),n.AnnotationEditor=void 0;var r=a(5),e=a(1);const y=class y{constructor(h){De(this,k,this.focusin.bind(this));De(this,E,this.focusout.bind(this));De(this,b,!1);De(this,R,!1);De(this,S,!1);De(this,A,y._zIndex++);this.constructor===y&&(0,e.unreachable)("Cannot initialize AnnotationEditor."),this.parent=h.parent,this.id=h.id,this.width=this.height=null,this.pageIndex=h.parent.pageIndex,this.name=h.name,this.div=null;const[l,o]=this.parent.viewportBaseDimensions;this.x=h.x/l,this.y=h.y/o,this.rotation=this.parent.viewport.rotation,this.isAttachedToDOM=!1}static get _defaultLineColor(){return(0,e.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=B(this,A)}focusin(h){B(this,b)?rt(this,b,!1):this.parent.setSelected(this)}focusout(h){if(!this.isAttachedToDOM)return;const l=h.relatedTarget;l!=null&&l.closest(`#${this.id}`)||(h.preventDefault(),this.parent.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.parent.addToAnnotationStorage(this)}dragstart(h){const l=this.parent.div.getBoundingClientRect();this.startX=h.clientX-l.x,this.startY=h.clientY-l.y,h.dataTransfer.setData("text/plain",this.id),h.dataTransfer.effectAllowed="move"}setAt(h,l,o,s){const[f,g]=this.parent.viewportBaseDimensions;[o,s]=this.screenToPageTranslation(o,s),this.x=(h+o)/f,this.y=(l+s)/g,this.div.style.left=`${100*this.x}%`,this.div.style.top=`${100*this.y}%`}translate(h,l){const[o,s]=this.parent.viewportBaseDimensions;[h,l]=this.screenToPageTranslation(h,l),this.x+=h/o,this.y+=l/s,this.div.style.left=`${100*this.x}%`,this.div.style.top=`${100*this.y}%`}screenToPageTranslation(h,l){const{rotation:o}=this.parent.viewport;switch(o){case 90:return[l,-h];case 180:return[-h,-l];case 270:return[-l,h];default:return[h,l]}}setDims(h,l){const[o,s]=this.parent.viewportBaseDimensions;this.div.style.width=`${100*h/o}%`,this.div.style.height=`${100*l/s}%`}fixDims(){const{style:h}=this.div,{height:l,width:o}=h,s=o.endsWith("%"),f=l.endsWith("%");if(s&&f)return;const[g,v]=this.parent.viewportBaseDimensions;s||(h.width=`${100*parseFloat(o)/g}%`),f||(h.height=`${100*parseFloat(l)/v}%`)}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",B(this,k)),this.div.addEventListener("focusout",B(this,E));const[h,l]=this.getInitialTranslation();return this.translate(h,l),(0,r.bindEvents)(this,this.div,["dragstart","pointerdown"]),this.div}pointerdown(h){const l=r.KeyboardManager.platform.isMac;if(h.button!==0||h.ctrlKey&&l){h.preventDefault();return}h.ctrlKey&&!l||h.shiftKey||h.metaKey&&l?this.parent.toggleSelected(this):this.parent.setSelected(this),rt(this,b,!0)}getRect(h,l){const[o,s]=this.parent.viewportBaseDimensions,[f,g]=this.parent.pageDimensions,v=f*h/o,c=g*l/s,d=this.x*f,x=this.y*g,L=this.width*f,X=this.height*g;switch(this.rotation){case 0:return[d+v,g-x-c-X,d+v+L,g-x-c];case 90:return[d+c,g-x+v,d+c+X,g-x+v+L];case 180:return[d-v-L,g-x+c,d-v,g-x+c+X];case 270:return[d-c-X,g-x-v-L,d-c,g-x-v];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(h,l){const[o,s,f,g]=h,v=f-o,c=g-s;switch(this.rotation){case 0:return[o,l-g,v,c];case 90:return[o,l-s,c,v];case 180:return[f,l-s,v,c];case 270:return[f,l-g,c,v];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){rt(this,S,!0)}disableEditMode(){rt(this,S,!1)}isInEditMode(){return B(this,S)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var h;(h=this.div)==null||h.addEventListener("focusin",B(this,k))}serialize(){(0,e.unreachable)("An editor must be serializable")}static deserialize(h,l){const o=new this.prototype.constructor({parent:l,id:l.getNextId()});o.rotation=h.rotation;const[s,f]=l.pageDimensions,[g,v,c,d]=o.getRectInCurrentCoords(h.rect,f);return o.x=g/s,o.y=v/f,o.width=c/s,o.height=d/f,o}remove(){this.div.removeEventListener("focusin",B(this,k)),this.div.removeEventListener("focusout",B(this,E)),this.isEmpty()||this.commit(),this.parent.remove(this)}select(){var h;(h=this.div)==null||h.classList.add("selectedEditor")}unselect(){var h;(h=this.div)==null||h.classList.remove("selectedEditor")}updateParams(h,l){}disableEditing(){}enableEditing(){}get propertiesToUpdate(){return{}}get contentDiv(){return this.div}get isEditing(){return B(this,R)}set isEditing(h){rt(this,R,h),h?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null)}};k=new WeakMap,E=new WeakMap,b=new WeakMap,R=new WeakMap,S=new WeakMap,A=new WeakMap,an(y,"_colorManager",new r.ColorManager),an(y,"_zIndex",1);let p=y;n.AnnotationEditor=p},(t,n,a)=>{var y,_,h,l,o,s,Wa,c,d,x,L,X,N,D,se,Ae,Te,le,ie,fe,_e,oe,Me,xe,K,T,P,Ua,Y,Ea,te,Ga,ve,qa,Se,An,Ie,fr,C,Ka,G,Xa,q,Sa,Be,pr,pe,Ra;Object.defineProperty(n,"__esModule",{value:!0}),n.KeyboardManager=n.CommandManager=n.ColorManager=n.AnnotationEditorUIManager=void 0,n.bindEvents=p,n.opacityToHex=k;var r=a(1),e=a(6);function p(Ye,ce,We){for(const nt of We)ce.addEventListener(nt,Ye[nt].bind(Ye))}function k(Ye){return Math.round(Math.min(255,Math.max(1,255*Ye))).toString(16).padStart(2,"0")}class E{constructor(){De(this,y,0)}getId(){return`${r.AnnotationEditorPrefix}${_a(this,y)._++}`}}y=new WeakMap;class b{constructor(ce=128){De(this,_,[]);De(this,h,!1);De(this,l,void 0);De(this,o,-1);rt(this,l,ce)}add({cmd:ce,undo:We,mustExec:nt,type:ut=NaN,overwriteIfSameType:Et=!1,keepUndo:kt=!1}){if(nt&&ce(),B(this,h))return;const ct={cmd:ce,undo:We,type:ut};if(B(this,o)===-1){B(this,_).length>0&&(B(this,_).length=0),rt(this,o,0),B(this,_).push(ct);return}if(Et&&B(this,_)[B(this,o)].type===ut){kt&&(ct.undo=B(this,_)[B(this,o)].undo),B(this,_)[B(this,o)]=ct;return}const Ve=B(this,o)+1;Ve===B(this,l)?B(this,_).splice(0,1):(rt(this,o,Ve),Ve<B(this,_).length&&B(this,_).splice(Ve)),B(this,_).push(ct)}undo(){B(this,o)!==-1&&(rt(this,h,!0),B(this,_)[B(this,o)].undo(),rt(this,h,!1),rt(this,o,B(this,o)-1))}redo(){B(this,o)<B(this,_).length-1&&(rt(this,o,B(this,o)+1),rt(this,h,!0),B(this,_)[B(this,o)].cmd(),rt(this,h,!1))}hasSomethingToUndo(){return B(this,o)!==-1}hasSomethingToRedo(){return B(this,o)<B(this,_).length-1}destroy(){rt(this,_,null)}}_=new WeakMap,h=new WeakMap,l=new WeakMap,o=new WeakMap,n.CommandManager=b;const g=class g{constructor(ce){De(this,s);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const We=g.platform.isMac;for(const[nt,ut]of ce)for(const Et of nt){const kt=Et.startsWith("mac+");We&&kt?(this.callbacks.set(Et.slice(4),ut),this.allKeys.add(Et.split("+").at(-1))):!We&&!kt&&(this.callbacks.set(Et,ut),this.allKeys.add(Et.split("+").at(-1)))}}static get platform(){const ce=typeof navigator<"u"?navigator.platform:"";return(0,r.shadow)(this,"platform",{isWin:ce.includes("Win"),isMac:ce.includes("Mac")})}exec(ce,We){if(!this.allKeys.has(We.key))return;const nt=this.callbacks.get(qe(this,s,Wa).call(this,We));nt&&(nt.bind(ce)(),We.stopPropagation(),We.preventDefault())}};s=new WeakSet,Wa=function(ce){ce.altKey&&this.buffer.push("alt"),ce.ctrlKey&&this.buffer.push("ctrl"),ce.metaKey&&this.buffer.push("meta"),ce.shiftKey&&this.buffer.push("shift"),this.buffer.push(ce.key);const We=this.buffer.join("+");return this.buffer.length=0,We};let R=g;n.KeyboardManager=R;const v=class v{get _colors(){const ce=new Map([["CanvasText",null],["Canvas",null]]);return(0,e.getColorValues)(ce),(0,r.shadow)(this,"_colors",ce)}convert(ce){const We=(0,e.getRGB)(ce);if(!window.matchMedia("(forced-colors: active)").matches)return We;for(const[nt,ut]of this._colors)if(ut.every((Et,kt)=>Et===We[kt]))return v._colorsMapping.get(nt);return We}getHexCode(ce){const We=this._colors.get(ce);return We?r.Util.makeHexColor(...We):ce}};an(v,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let S=v;n.ColorManager=S;const Le=class Le{constructor(ce,We){De(this,P);De(this,Y);De(this,te);De(this,ve);De(this,Se);De(this,Ie);De(this,C);De(this,G);De(this,q);De(this,Be);De(this,pe);De(this,c,null);De(this,d,new Map);De(this,x,new Map);De(this,L,new b);De(this,X,0);De(this,N,null);De(this,D,null);De(this,se,new E);De(this,Ae,!1);De(this,Te,r.AnnotationEditorType.NONE);De(this,le,new Set);De(this,ie,this.copy.bind(this));De(this,fe,this.cut.bind(this));De(this,_e,this.paste.bind(this));De(this,oe,this.keydown.bind(this));De(this,Me,this.onEditingAction.bind(this));De(this,xe,this.onPageChanging.bind(this));De(this,K,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1});De(this,T,null);rt(this,T,ce),rt(this,D,We),B(this,D)._on("editingaction",B(this,Me)),B(this,D)._on("pagechanging",B(this,xe))}destroy(){qe(this,Y,Ea).call(this),B(this,D)._off("editingaction",B(this,Me)),B(this,D)._off("pagechanging",B(this,xe));for(const ce of B(this,x).values())ce.destroy();B(this,x).clear(),B(this,d).clear(),rt(this,c,null),B(this,le).clear(),B(this,L).destroy()}onPageChanging({pageNumber:ce}){rt(this,X,ce-1)}focusMainContainer(){B(this,T).focus()}copy(ce){if(ce.preventDefault(),B(this,c)&&B(this,c).commitOrRemove(),!this.hasSelection)return;const We=[];for(const nt of B(this,le))nt.isEmpty()||We.push(nt.serialize());We.length!==0&&ce.clipboardData.setData("application/pdfjs",JSON.stringify(We))}cut(ce){this.copy(ce),this.delete()}paste(ce){ce.preventDefault();let We=ce.clipboardData.getData("application/pdfjs");if(!We)return;try{We=JSON.parse(We)}catch(ut){(0,r.warn)(`paste: "${ut.message}".`);return}if(!Array.isArray(We))return;this.unselectAll();const nt=B(this,x).get(B(this,X));try{const ut=[];for(const ct of We){const Ve=nt.deserialize(ct);if(!Ve)return;ut.push(Ve)}const Et=()=>{for(const ct of ut)qe(this,q,Sa).call(this,ct);qe(this,pe,Ra).call(this,ut)},kt=()=>{for(const ct of ut)ct.remove()};this.addCommands({cmd:Et,undo:kt,mustExec:!0})}catch(ut){(0,r.warn)(`paste: "${ut.message}".`)}}keydown(ce){var We;(We=this.getActive())!=null&&We.shouldGetKeyboardEvents()||Le._keyboardManager.exec(this,ce)}onEditingAction(ce){["undo","redo","delete","selectAll"].includes(ce.name)&&this[ce.name]()}setEditingState(ce){ce?(qe(this,P,Ua).call(this),qe(this,te,Ga).call(this),qe(this,Se,An).call(this,{isEditing:B(this,Te)!==r.AnnotationEditorType.NONE,isEmpty:qe(this,Be,pr).call(this),hasSomethingToUndo:B(this,L).hasSomethingToUndo(),hasSomethingToRedo:B(this,L).hasSomethingToRedo(),hasSelectedEditor:!1})):(qe(this,Y,Ea).call(this),qe(this,ve,qa).call(this),qe(this,Se,An).call(this,{isEditing:!1}))}registerEditorTypes(ce){if(!B(this,N)){rt(this,N,ce);for(const We of B(this,N))qe(this,Ie,fr).call(this,We.defaultPropertiesToUpdate)}}getId(){return B(this,se).getId()}addLayer(ce){B(this,x).set(ce.pageIndex,ce),B(this,Ae)?ce.enable():ce.disable()}removeLayer(ce){B(this,x).delete(ce.pageIndex)}updateMode(ce){if(rt(this,Te,ce),ce===r.AnnotationEditorType.NONE)this.setEditingState(!1),qe(this,G,Xa).call(this);else{this.setEditingState(!0),qe(this,C,Ka).call(this);for(const We of B(this,x).values())We.updateMode(ce)}}updateToolbar(ce){ce!==B(this,Te)&&B(this,D).dispatch("switchannotationeditormode",{source:this,mode:ce})}updateParams(ce,We){if(B(this,N)){for(const nt of B(this,le))nt.updateParams(ce,We);for(const nt of B(this,N))nt.updateDefaultParams(ce,We)}}getEditors(ce){const We=[];for(const nt of B(this,d).values())nt.pageIndex===ce&&We.push(nt);return We}getEditor(ce){return B(this,d).get(ce)}addEditor(ce){B(this,d).set(ce.id,ce)}removeEditor(ce){B(this,d).delete(ce.id),this.unselect(ce)}setActiveEditor(ce){B(this,c)!==ce&&(rt(this,c,ce),ce&&qe(this,Ie,fr).call(this,ce.propertiesToUpdate))}toggleSelected(ce){if(B(this,le).has(ce)){B(this,le).delete(ce),ce.unselect(),qe(this,Se,An).call(this,{hasSelectedEditor:this.hasSelection});return}B(this,le).add(ce),ce.select(),qe(this,Ie,fr).call(this,ce.propertiesToUpdate),qe(this,Se,An).call(this,{hasSelectedEditor:!0})}setSelected(ce){for(const We of B(this,le))We!==ce&&We.unselect();B(this,le).clear(),B(this,le).add(ce),ce.select(),qe(this,Ie,fr).call(this,ce.propertiesToUpdate),qe(this,Se,An).call(this,{hasSelectedEditor:!0})}isSelected(ce){return B(this,le).has(ce)}unselect(ce){ce.unselect(),B(this,le).delete(ce),qe(this,Se,An).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return B(this,le).size!==0}undo(){B(this,L).undo(),qe(this,Se,An).call(this,{hasSomethingToUndo:B(this,L).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:qe(this,Be,pr).call(this)})}redo(){B(this,L).redo(),qe(this,Se,An).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:B(this,L).hasSomethingToRedo(),isEmpty:qe(this,Be,pr).call(this)})}addCommands(ce){B(this,L).add(ce),qe(this,Se,An).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:qe(this,Be,pr).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const ce=[...B(this,le)],We=()=>{for(const ut of ce)ut.remove()},nt=()=>{for(const ut of ce)qe(this,q,Sa).call(this,ut)};this.addCommands({cmd:We,undo:nt,mustExec:!0})}commitOrRemove(){var ce;(ce=B(this,c))==null||ce.commitOrRemove()}selectAll(){for(const ce of B(this,le))ce.commit();qe(this,pe,Ra).call(this,B(this,d).values())}unselectAll(){if(B(this,c)){B(this,c).commitOrRemove();return}if(B(this,le).size!==0){for(const ce of B(this,le))ce.unselect();B(this,le).clear(),qe(this,Se,An).call(this,{hasSelectedEditor:!1})}}isActive(ce){return B(this,c)===ce}getActive(){return B(this,c)}getMode(){return B(this,Te)}};c=new WeakMap,d=new WeakMap,x=new WeakMap,L=new WeakMap,X=new WeakMap,N=new WeakMap,D=new WeakMap,se=new WeakMap,Ae=new WeakMap,Te=new WeakMap,le=new WeakMap,ie=new WeakMap,fe=new WeakMap,_e=new WeakMap,oe=new WeakMap,Me=new WeakMap,xe=new WeakMap,K=new WeakMap,T=new WeakMap,P=new WeakSet,Ua=function(){B(this,T).addEventListener("keydown",B(this,oe))},Y=new WeakSet,Ea=function(){B(this,T).removeEventListener("keydown",B(this,oe))},te=new WeakSet,Ga=function(){document.addEventListener("copy",B(this,ie)),document.addEventListener("cut",B(this,fe)),document.addEventListener("paste",B(this,_e))},ve=new WeakSet,qa=function(){document.removeEventListener("copy",B(this,ie)),document.removeEventListener("cut",B(this,fe)),document.removeEventListener("paste",B(this,_e))},Se=new WeakSet,An=function(ce){Object.entries(ce).some(([nt,ut])=>B(this,K)[nt]!==ut)&&B(this,D).dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(B(this,K),ce)})},Ie=new WeakSet,fr=function(ce){B(this,D).dispatch("annotationeditorparamschanged",{source:this,details:ce})},C=new WeakSet,Ka=function(){if(!B(this,Ae)){rt(this,Ae,!0);for(const ce of B(this,x).values())ce.enable()}},G=new WeakSet,Xa=function(){if(this.unselectAll(),B(this,Ae)){rt(this,Ae,!1);for(const ce of B(this,x).values())ce.disable()}},q=new WeakSet,Sa=function(ce){const We=B(this,x).get(ce.pageIndex);We?We.addOrRebuild(ce):this.addEditor(ce)},Be=new WeakSet,pr=function(){if(B(this,d).size===0)return!0;if(B(this,d).size===1)for(const ce of B(this,d).values())return ce.isEmpty();return!1},pe=new WeakSet,Ra=function(ce){B(this,le).clear();for(const We of ce)We.isEmpty()||(B(this,le).add(We),We.select());qe(this,Se,An).call(this,{hasSelectedEditor:!0})},an(Le,"_keyboardManager",new R([[["ctrl+a","mac+meta+a"],Le.prototype.selectAll],[["ctrl+z","mac+meta+z"],Le.prototype.undo],[["ctrl+y","ctrl+shift+Z","mac+meta+shift+Z"],Le.prototype.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete"],Le.prototype.delete],[["Escape","mac+Escape"],Le.prototype.unselectAll]]));let A=Le;n.AnnotationEditorUIManager=A},(t,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.StatTimer=n.RenderingCancelledException=n.PixelsPerInch=n.PageViewport=n.PDFDateString=n.DOMStandardFontDataFactory=n.DOMSVGFactory=n.DOMCanvasFactory=n.DOMCMapReaderFactory=n.AnnotationPrefix=void 0,n.deprecated=d,n.getColorValues=D,n.getCurrentTransform=se,n.getCurrentTransformInverse=Ae,n.getFilenameFromUrl=s,n.getPdfFilenameFromUrl=f,n.getRGB=N,n.getXfaPageViewport=X,n.isDataScheme=l,n.isPdfFile=o,n.isValidFetchUrl=v,n.loadScript=c;var r=a(7),e=a(1);const p="http://www.w3.org/2000/svg",k="pdfjs_internal_id_";n.AnnotationPrefix=k;const Te=class Te{};an(Te,"CSS",96),an(Te,"PDF",72),an(Te,"PDF_TO_CSS_UNITS",Te.CSS/Te.PDF);let E=Te;n.PixelsPerInch=E;class b extends r.BaseCanvasFactory{constructor({ownerDocument:ie=globalThis.document}={}){super(),this._document=ie}_createCanvas(ie,fe){const _e=this._document.createElement("canvas");return _e.width=ie,_e.height=fe,_e}}n.DOMCanvasFactory=b;async function R(le,ie=!1){if(v(le,document.baseURI)){const fe=await fetch(le);if(!fe.ok)throw new Error(fe.statusText);return ie?new Uint8Array(await fe.arrayBuffer()):(0,e.stringToBytes)(await fe.text())}return new Promise((fe,_e)=>{const oe=new XMLHttpRequest;oe.open("GET",le,!0),ie&&(oe.responseType="arraybuffer"),oe.onreadystatechange=()=>{if(oe.readyState===XMLHttpRequest.DONE){if(oe.status===200||oe.status===0){let Me;if(ie&&oe.response?Me=new Uint8Array(oe.response):!ie&&oe.responseText&&(Me=(0,e.stringToBytes)(oe.responseText)),Me){fe(Me);return}}_e(new Error(oe.statusText))}},oe.send(null)})}class S extends r.BaseCMapReaderFactory{_fetchData(ie,fe){return R(ie,this.isCompressed).then(_e=>({cMapData:_e,compressionType:fe}))}}n.DOMCMapReaderFactory=S;class A extends r.BaseStandardFontDataFactory{_fetchData(ie){return R(ie,!0)}}n.DOMStandardFontDataFactory=A;class y extends r.BaseSVGFactory{_createSVG(ie){return document.createElementNS(p,ie)}}n.DOMSVGFactory=y;class _{constructor({viewBox:ie,scale:fe,rotation:_e,offsetX:oe=0,offsetY:Me=0,dontFlip:xe=!1}){this.viewBox=ie,this.scale=fe,this.rotation=_e,this.offsetX=oe,this.offsetY=Me;const K=(ie[2]+ie[0])/2,T=(ie[3]+ie[1])/2;let P,$,Y,J;switch(_e%=360,_e<0&&(_e+=360),_e){case 180:P=-1,$=0,Y=0,J=1;break;case 90:P=0,$=1,Y=1,J=0;break;case 270:P=0,$=-1,Y=-1,J=0;break;case 0:P=1,$=0,Y=0,J=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}xe&&(Y=-Y,J=-J);let te,he,ve,Ne;P===0?(te=Math.abs(T-ie[1])*fe+oe,he=Math.abs(K-ie[0])*fe+Me,ve=Math.abs(ie[3]-ie[1])*fe,Ne=Math.abs(ie[2]-ie[0])*fe):(te=Math.abs(K-ie[0])*fe+oe,he=Math.abs(T-ie[1])*fe+Me,ve=Math.abs(ie[2]-ie[0])*fe,Ne=Math.abs(ie[3]-ie[1])*fe),this.transform=[P*fe,$*fe,Y*fe,J*fe,te-P*fe*K-Y*fe*T,he-$*fe*K-J*fe*T],this.width=ve,this.height=Ne}clone({scale:ie=this.scale,rotation:fe=this.rotation,offsetX:_e=this.offsetX,offsetY:oe=this.offsetY,dontFlip:Me=!1}={}){return new _({viewBox:this.viewBox.slice(),scale:ie,rotation:fe,offsetX:_e,offsetY:oe,dontFlip:Me})}convertToViewportPoint(ie,fe){return e.Util.applyTransform([ie,fe],this.transform)}convertToViewportRectangle(ie){const fe=e.Util.applyTransform([ie[0],ie[1]],this.transform),_e=e.Util.applyTransform([ie[2],ie[3]],this.transform);return[fe[0],fe[1],_e[0],_e[1]]}convertToPdfPoint(ie,fe){return e.Util.applyInverseTransform([ie,fe],this.transform)}}n.PageViewport=_;class h extends e.BaseException{constructor(ie,fe){super(ie,"RenderingCancelledException"),this.type=fe}}n.RenderingCancelledException=h;function l(le){const ie=le.length;let fe=0;for(;fe<ie&&le[fe].trim()==="";)fe++;return le.substring(fe,fe+5).toLowerCase()==="data:"}function o(le){return typeof le=="string"&&/\.pdf$/i.test(le)}function s(le,ie=!1){return ie||([le]=le.split(/[#?]/,1)),le.substring(le.lastIndexOf("/")+1)}function f(le,ie="document.pdf"){if(typeof le!="string")return ie;if(l(le))return(0,e.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),ie;const fe=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,_e=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,oe=fe.exec(le);let Me=_e.exec(oe[1])||_e.exec(oe[2])||_e.exec(oe[3]);if(Me&&(Me=Me[0],Me.includes("%")))try{Me=_e.exec(decodeURIComponent(Me))[0]}catch{}return Me||ie}class g{constructor(){an(this,"started",Object.create(null));an(this,"times",[])}time(ie){ie in this.started&&(0,e.warn)(`Timer is already running for ${ie}`),this.started[ie]=Date.now()}timeEnd(ie){ie in this.started||(0,e.warn)(`Timer has not been started for ${ie}`),this.times.push({name:ie,start:this.started[ie],end:Date.now()}),delete this.started[ie]}toString(){const ie=[];let fe=0;for(const{name:_e}of this.times)fe=Math.max(_e.length,fe);for(const{name:_e,start:oe,end:Me}of this.times)ie.push(`${_e.padEnd(fe)} ${Me-oe}ms `);return ie.join("")}}n.StatTimer=g;function v(le,ie){try{const{protocol:fe}=ie?new URL(le,ie):new URL(le);return fe==="http:"||fe==="https:"}catch{return!1}}function c(le,ie=!1){return new Promise((fe,_e)=>{const oe=document.createElement("script");oe.src=le,oe.onload=function(Me){ie&&oe.remove(),fe(Me)},oe.onerror=function(){_e(new Error(`Cannot load script at: ${oe.src}`))},(document.head||document.documentElement).append(oe)})}function d(le){console.log("Deprecated API usage: "+le)}let x;class L{static toDateObject(ie){if(!ie||typeof ie!="string")return null;x||(x=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const fe=x.exec(ie);if(!fe)return null;const _e=parseInt(fe[1],10);let oe=parseInt(fe[2],10);oe=oe>=1&&oe<=12?oe-1:0;let Me=parseInt(fe[3],10);Me=Me>=1&&Me<=31?Me:1;let xe=parseInt(fe[4],10);xe=xe>=0&&xe<=23?xe:0;let K=parseInt(fe[5],10);K=K>=0&&K<=59?K:0;let T=parseInt(fe[6],10);T=T>=0&&T<=59?T:0;const P=fe[7]||"Z";let $=parseInt(fe[8],10);$=$>=0&&$<=23?$:0;let Y=parseInt(fe[9],10)||0;return Y=Y>=0&&Y<=59?Y:0,P==="-"?(xe+=$,K+=Y):P==="+"&&(xe-=$,K-=Y),new Date(Date.UTC(_e,oe,Me,xe,K,T))}}n.PDFDateString=L;function X(le,{scale:ie=1,rotation:fe=0}){const{width:_e,height:oe}=le.attributes.style,Me=[0,0,parseInt(_e),parseInt(oe)];return new _({viewBox:Me,scale:ie,rotation:fe})}function N(le){if(le.startsWith("#")){const ie=parseInt(le.slice(1),16);return[(ie&16711680)>>16,(ie&65280)>>8,ie&255]}return le.startsWith("rgb(")?le.slice(4,-1).split(",").map(ie=>parseInt(ie)):le.startsWith("rgba(")?le.slice(5,-1).split(",").map(ie=>parseInt(ie)).slice(0,3):((0,e.warn)(`Not a valid color format: "${le}"`),[0,0,0])}function D(le){const ie=document.createElement("span");ie.style.visibility="hidden",document.body.append(ie);for(const fe of le.keys()){ie.style.color=fe;const _e=window.getComputedStyle(ie).color;le.set(fe,N(_e))}ie.remove()}function se(le){const{a:ie,b:fe,c:_e,d:oe,e:Me,f:xe}=le.getTransform();return[ie,fe,_e,oe,Me,xe]}function Ae(le){const{a:ie,b:fe,c:_e,d:oe,e:Me,f:xe}=le.getTransform().invertSelf();return[ie,fe,_e,oe,Me,xe]}},(t,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BaseStandardFontDataFactory=n.BaseSVGFactory=n.BaseCanvasFactory=n.BaseCMapReaderFactory=void 0;var r=a(1);class e{constructor(){this.constructor===e&&(0,r.unreachable)("Cannot initialize BaseCanvasFactory.")}create(R,S){if(R<=0||S<=0)throw new Error("Invalid canvas size");const A=this._createCanvas(R,S);return{canvas:A,context:A.getContext("2d")}}reset(R,S,A){if(!R.canvas)throw new Error("Canvas is not specified");if(S<=0||A<=0)throw new Error("Invalid canvas size");R.canvas.width=S,R.canvas.height=A}destroy(R){if(!R.canvas)throw new Error("Canvas is not specified");R.canvas.width=0,R.canvas.height=0,R.canvas=null,R.context=null}_createCanvas(R,S){(0,r.unreachable)("Abstract method `_createCanvas` called.")}}n.BaseCanvasFactory=e;class p{constructor({baseUrl:R=null,isCompressed:S=!1}){this.constructor===p&&(0,r.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=R,this.isCompressed=S}async fetch({name:R}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!R)throw new Error("CMap name must be specified.");const S=this.baseUrl+R+(this.isCompressed?".bcmap":""),A=this.isCompressed?r.CMapCompressionType.BINARY:r.CMapCompressionType.NONE;return this._fetchData(S,A).catch(y=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${S}`)})}_fetchData(R,S){(0,r.unreachable)("Abstract method `_fetchData` called.")}}n.BaseCMapReaderFactory=p;class k{constructor({baseUrl:R=null}){this.constructor===k&&(0,r.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=R}async fetch({filename:R}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!R)throw new Error("Font filename must be specified.");const S=`${this.baseUrl}${R}`;return this._fetchData(S).catch(A=>{throw new Error(`Unable to load font data at: ${S}`)})}_fetchData(R){(0,r.unreachable)("Abstract method `_fetchData` called.")}}n.BaseStandardFontDataFactory=k;class E{constructor(){this.constructor===E&&(0,r.unreachable)("Cannot initialize BaseSVGFactory.")}create(R,S,A=!1){if(R<=0||S<=0)throw new Error("Invalid SVG dimensions");const y=this._createSVG("svg:svg");return y.setAttribute("version","1.1"),A||(y.setAttribute("width",`${R}px`),y.setAttribute("height",`${S}px`)),y.setAttribute("preserveAspectRatio","none"),y.setAttribute("viewBox",`0 0 ${R} ${S}`),y}createElement(R){if(typeof R!="string")throw new Error("Invalid SVG element type");return this._createSVG(R)}_createSVG(R){(0,r.unreachable)("Abstract method `_createSVG` called.")}}n.BaseSVGFactory=E},(t,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.MurmurHash3_64=void 0;var r=a(1);const e=3285377520,p=4294901760,k=65535;class E{constructor(R){this.h1=R?R&4294967295:e,this.h2=R?R&4294967295:e}update(R){let S,A;if(typeof R=="string"){S=new Uint8Array(R.length*2),A=0;for(let x=0,L=R.length;x<L;x++){const X=R.charCodeAt(x);X<=255?S[A++]=X:(S[A++]=X>>>8,S[A++]=X&255)}}else if((0,r.isArrayBuffer)(R))S=R.slice(),A=S.byteLength;else throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");const y=A>>2,_=A-y*4,h=new Uint32Array(S.buffer,0,y);let l=0,o=0,s=this.h1,f=this.h2;const g=3432918353,v=461845907,c=g&k,d=v&k;for(let x=0;x<y;x++)x&1?(l=h[x],l=l*g&p|l*c&k,l=l<<15|l>>>17,l=l*v&p|l*d&k,s^=l,s=s<<13|s>>>19,s=s*5+3864292196):(o=h[x],o=o*g&p|o*c&k,o=o<<15|o>>>17,o=o*v&p|o*d&k,f^=o,f=f<<13|f>>>19,f=f*5+3864292196);switch(l=0,_){case 3:l^=S[y*4+2]<<16;case 2:l^=S[y*4+1]<<8;case 1:l^=S[y*4],l=l*g&p|l*c&k,l=l<<15|l>>>17,l=l*v&p|l*d&k,y&1?s^=l:f^=l}this.h1=s,this.h2=f}hexdigest(){let R=this.h1,S=this.h2;return R^=S>>>1,R=R*3981806797&p|R*36045&k,S=S*4283543511&p|((S<<16|R>>>16)*2950163797&p)>>>16,R^=S>>>1,R=R*444984403&p|R*60499&k,S=S*3301882366&p|((S<<16|R>>>16)*3120437893&p)>>>16,R^=S>>>1,(R>>>0).toString(16).padStart(8,"0")+(S>>>0).toString(16).padStart(8,"0")}}n.MurmurHash3_64=E},(t,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FontLoader=n.FontFaceObject=void 0;var r=a(1);class e{constructor({onUnsupportedFeature:E,ownerDocument:b=globalThis.document,styleElement:R=null}){this._onUnsupportedFeature=E,this._document=b,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 b=this.styleElement.sheet;b.insertRule(E,b.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 R=E.createNativeFontFace();if(R){this.addNativeFontFace(R);try{await R.loaded}catch(S){throw this._onUnsupportedFeature({featureId:r.UNSUPPORTED_FEATURES.errorFontLoadNative}),(0,r.warn)(`Failed to load font '${R.family}': '${S}'.`),E.disableFontFace=!0,S}}return}const b=E.createFontFaceRule();if(b){if(this.insertRule(b),this.isSyncFontLoadingSupported)return;await new Promise(R=>{const S=this._queueLoadingCallback(R);this._prepareFontLoadEvent(E,S)})}}get isFontLoadingAPISupported(){var b;const E=!!((b=this._document)!=null&&b.fonts);return(0,r.shadow)(this,"isFontLoadingAPISupported",E)}get isSyncFontLoadingSupported(){let E=!1;if(typeof navigator>"u")E=!0;else{const b=/Mozilla\/5.0.*?rv:(\d+).*? Gecko/.exec(navigator.userAgent);(b==null?void 0:b[1])>=14&&(E=!0)}return(0,r.shadow)(this,"isSyncFontLoadingSupported",E)}_queueLoadingCallback(E){function b(){for((0,r.assert)(!S.done,"completeRequest() cannot be called twice."),S.done=!0;R.length>0&&R[0].done;){const A=R.shift();setTimeout(A.callback,0)}}const{loadingRequests:R}=this,S={done:!1,complete:b,callback:E};return R.push(S),S}get _loadTestFont(){const E=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,r.shadow)(this,"_loadTestFont",E)}_prepareFontLoadEvent(E,b){function R(N,D){return N.charCodeAt(D)<<24|N.charCodeAt(D+1)<<16|N.charCodeAt(D+2)<<8|N.charCodeAt(D+3)&255}function S(N,D,se,Ae){const Te=N.substring(0,D),le=N.substring(D+se);return Te+Ae+le}let A,y;const _=this._document.createElement("canvas");_.width=1,_.height=1;const h=_.getContext("2d");let l=0;function o(N,D){if(++l>30){(0,r.warn)("Load test font never loaded."),D();return}if(h.font="30px "+N,h.fillText(".",0,20),h.getImageData(0,0,1,1).data[3]>0){D();return}setTimeout(o.bind(null,N,D))}const s=`lt${Date.now()}${this.loadTestFontId++}`;let f=this._loadTestFont;f=S(f,976,s.length,s);const v=16,c=1482184792;let d=R(f,v);for(A=0,y=s.length-3;A<y;A+=4)d=d-c+R(s,A)|0;A<s.length&&(d=d-c+R(s+"XXX",A)|0),f=S(f,v,4,(0,r.string32)(d));const x=`url(data:font/opentype;base64,${btoa(f)});`,L=`@font-face {font-family:"${s}";src:${x}}`;this.insertRule(L);const X=this._document.createElement("div");X.style.visibility="hidden",X.style.width=X.style.height="10px",X.style.position="absolute",X.style.top=X.style.left="0px";for(const N of[E.loadedName,s]){const D=this._document.createElement("span");D.textContent="Hi",D.style.fontFamily=N,X.append(D)}this._document.body.append(X),o(s,()=>{X.remove(),b.complete()})}}n.FontLoader=e;class p{constructor(E,{isEvalSupported:b=!0,disableFontFace:R=!1,ignoreErrors:S=!1,onUnsupportedFeature:A,fontRegistry:y=null}){this.compiledGlyphs=Object.create(null);for(const _ in E)this[_]=E[_];this.isEvalSupported=b!==!1,this.disableFontFace=R===!0,this.ignoreErrors=S===!0,this._onUnsupportedFeature=A,this.fontRegistry=y}createNativeFontFace(){var b;if(!this.data||this.disableFontFace)return null;let E;if(!this.cssFontInfo)E=new FontFace(this.loadedName,this.data,{});else{const R={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(R.style=`oblique ${this.cssFontInfo.italicAngle}deg`),E=new FontFace(this.cssFontInfo.fontFamily,this.data,R)}return(b=this.fontRegistry)==null||b.registerFont(this),E}createFontFaceRule(){var S;if(!this.data||this.disableFontFace)return null;const E=(0,r.bytesToString)(this.data),b=`url(data:${this.mimetype};base64,${btoa(E)});`;let R;if(!this.cssFontInfo)R=`@font-face {font-family:"${this.loadedName}";src:${b}}`;else{let A=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(A+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),R=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${A}src:${b}}`}return(S=this.fontRegistry)==null||S.registerFont(this,b),R}getPathGenerator(E,b){if(this.compiledGlyphs[b]!==void 0)return this.compiledGlyphs[b];let R;try{R=E.get(this.loadedName+"_path_"+b)}catch(S){if(!this.ignoreErrors)throw S;return this._onUnsupportedFeature({featureId:r.UNSUPPORTED_FEATURES.errorFontGetPath}),(0,r.warn)(`getPathGenerator - ignoring character: "${S}".`),this.compiledGlyphs[b]=function(A,y){}}if(this.isEvalSupported&&r.FeatureTest.isEvalSupported){const S=[];for(const A of R){const y=A.args!==void 0?A.args.join(","):"";S.push("c.",A.cmd,"(",y,`); `)}return this.compiledGlyphs[b]=new Function("c","size",S.join(""))}return this.compiledGlyphs[b]=function(S,A){for(const y of R)y.cmd==="scale"&&(y.args=[A,-A]),S[y.cmd].apply(S,y.args)}}}n.FontFaceObject=p},(t,n,a)=>{var oe,ya;Object.defineProperty(n,"__esModule",{value:!0}),n.CanvasGraphics=void 0;var r=a(1),e=a(6),p=a(11),k=a(13),E=a(12);const b=16,R=100,S=4096,A=15,y=10,_=E.isNodeJS&&typeof Path2D>"u"?-1:1e3,h=16;function l(K,T){if(K._removeMirroring)throw new Error("Context is already forwarding operations.");K.__originalSave=K.save,K.__originalRestore=K.restore,K.__originalRotate=K.rotate,K.__originalScale=K.scale,K.__originalTranslate=K.translate,K.__originalTransform=K.transform,K.__originalSetTransform=K.setTransform,K.__originalResetTransform=K.resetTransform,K.__originalClip=K.clip,K.__originalMoveTo=K.moveTo,K.__originalLineTo=K.lineTo,K.__originalBezierCurveTo=K.bezierCurveTo,K.__originalRect=K.rect,K.__originalClosePath=K.closePath,K.__originalBeginPath=K.beginPath,K._removeMirroring=()=>{K.save=K.__originalSave,K.restore=K.__originalRestore,K.rotate=K.__originalRotate,K.scale=K.__originalScale,K.translate=K.__originalTranslate,K.transform=K.__originalTransform,K.setTransform=K.__originalSetTransform,K.resetTransform=K.__originalResetTransform,K.clip=K.__originalClip,K.moveTo=K.__originalMoveTo,K.lineTo=K.__originalLineTo,K.bezierCurveTo=K.__originalBezierCurveTo,K.rect=K.__originalRect,K.closePath=K.__originalClosePath,K.beginPath=K.__originalBeginPath,delete K._removeMirroring},K.save=function(){T.save(),this.__originalSave()},K.restore=function(){T.restore(),this.__originalRestore()},K.translate=function($,Y){T.translate($,Y),this.__originalTranslate($,Y)},K.scale=function($,Y){T.scale($,Y),this.__originalScale($,Y)},K.transform=function($,Y,J,te,he,ve){T.transform($,Y,J,te,he,ve),this.__originalTransform($,Y,J,te,he,ve)},K.setTransform=function($,Y,J,te,he,ve){T.setTransform($,Y,J,te,he,ve),this.__originalSetTransform($,Y,J,te,he,ve)},K.resetTransform=function(){T.resetTransform(),this.__originalResetTransform()},K.rotate=function($){T.rotate($),this.__originalRotate($)},K.clip=function($){T.clip($),this.__originalClip($)},K.moveTo=function(P,$){T.moveTo(P,$),this.__originalMoveTo(P,$)},K.lineTo=function(P,$){T.lineTo(P,$),this.__originalLineTo(P,$)},K.bezierCurveTo=function(P,$,Y,J,te,he){T.bezierCurveTo(P,$,Y,J,te,he),this.__originalBezierCurveTo(P,$,Y,J,te,he)},K.rect=function(P,$,Y,J){T.rect(P,$,Y,J),this.__originalRect(P,$,Y,J)},K.closePath=function(){T.closePath(),this.__originalClosePath()},K.beginPath=function(){T.beginPath(),this.__originalBeginPath()}}class o{constructor(T){this.canvasFactory=T,this.cache=Object.create(null)}getCanvas(T,P,$){let Y;return this.cache[T]!==void 0?(Y=this.cache[T],this.canvasFactory.reset(Y,P,$)):(Y=this.canvasFactory.create(P,$),this.cache[T]=Y),Y}delete(T){delete this.cache[T]}clear(){for(const T in this.cache){const P=this.cache[T];this.canvasFactory.destroy(P),delete this.cache[T]}}}function s(K,T,P,$,Y,J,te,he,ve,Ne){const[Se,je,Ie,ze,C,I]=(0,e.getCurrentTransform)(K);if(je===0&&Ie===0){const q=te*Se+C,ge=Math.round(q),Be=he*ze+I,Ze=Math.round(Be),pe=(te+ve)*Se+C,ot=Math.abs(Math.round(pe)-ge)||1,Le=(he+Ne)*ze+I,Ye=Math.abs(Math.round(Le)-Ze)||1;return K.setTransform(Math.sign(Se),0,0,Math.sign(ze),ge,Ze),K.drawImage(T,P,$,Y,J,0,0,ot,Ye),K.setTransform(Se,je,Ie,ze,C,I),[ot,Ye]}if(Se===0&&ze===0){const q=he*Ie+C,ge=Math.round(q),Be=te*je+I,Ze=Math.round(Be),pe=(he+Ne)*Ie+C,ot=Math.abs(Math.round(pe)-ge)||1,Le=(te+ve)*je+I,Ye=Math.abs(Math.round(Le)-Ze)||1;return K.setTransform(0,Math.sign(je),Math.sign(Ie),0,ge,Ze),K.drawImage(T,P,$,Y,J,0,0,Ye,ot),K.setTransform(Se,je,Ie,ze,C,I),[Ye,ot]}K.drawImage(T,P,$,Y,J,te,he,ve,Ne);const G=Math.hypot(Se,je),z=Math.hypot(Ie,ze);return[G*ve,z*Ne]}function f(K){const{width:T,height:P}=K;if(T>_||P>_)return null;const $=1e3,Y=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),J=T+1;let te=new Uint8Array(J*(P+1)),he,ve,Ne;const Se=T+7&-8;let je=new Uint8Array(Se*P),Ie=0;for(const z of K.data){let q=128;for(;q>0;)je[Ie++]=z&q?0:255,q>>=1}let ze=0;for(Ie=0,je[Ie]!==0&&(te[0]=1,++ze),ve=1;ve<T;ve++)je[Ie]!==je[Ie+1]&&(te[ve]=je[Ie]?2:1,++ze),Ie++;for(je[Ie]!==0&&(te[ve]=2,++ze),he=1;he<P;he++){Ie=he*Se,Ne=he*J,je[Ie-Se]!==je[Ie]&&(te[Ne]=je[Ie]?1:8,++ze);let z=(je[Ie]?4:0)+(je[Ie-Se]?8:0);for(ve=1;ve<T;ve++)z=(z>>2)+(je[Ie+1]?4:0)+(je[Ie-Se+1]?8:0),Y[z]&&(te[Ne+ve]=Y[z],++ze),Ie++;if(je[Ie-Se]!==je[Ie]&&(te[Ne+ve]=je[Ie]?2:4,++ze),ze>$)return null}for(Ie=Se*(P-1),Ne=he*J,je[Ie]!==0&&(te[Ne]=8,++ze),ve=1;ve<T;ve++)je[Ie]!==je[Ie+1]&&(te[Ne+ve]=je[Ie]?4:8,++ze),Ie++;if(je[Ie]!==0&&(te[Ne+ve]=4,++ze),ze>$)return null;const C=new Int32Array([0,J,-1,0,-J,0,0,0,1]),I=new Path2D;for(he=0;ze&&he<=P;he++){let z=he*J;const q=z+T;for(;z<q&&!te[z];)z++;if(z===q)continue;I.moveTo(z%J,he);const ge=z;let Be=te[z];do{const Ze=C[Be];do z+=Ze;while(!te[z]);const pe=te[z];pe!==5&&pe!==10?(Be=pe,te[z]=0):(Be=pe&51*Be>>4,te[z]&=Be>>2|Be<<2),I.lineTo(z%J,z/J|0),te[z]||--ze}while(ge!==z);--he}return je=null,te=null,function(z){z.save(),z.scale(1/T,-1/P),z.translate(0,-P),z.fill(I),z.beginPath(),z.restore()}}class g{constructor(T,P){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=r.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=r.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=r.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps=null,this.startNewPathAndClipBox([0,0,T,P])}clone(){const T=Object.create(this);return T.clipBox=this.clipBox.slice(),T}setCurrentPoint(T,P){this.x=T,this.y=P}updatePathMinMax(T,P,$){[P,$]=r.Util.applyTransform([P,$],T),this.minX=Math.min(this.minX,P),this.minY=Math.min(this.minY,$),this.maxX=Math.max(this.maxX,P),this.maxY=Math.max(this.maxY,$)}updateRectMinMax(T,P){const $=r.Util.applyTransform(P,T),Y=r.Util.applyTransform(P.slice(2),T);this.minX=Math.min(this.minX,$[0],Y[0]),this.minY=Math.min(this.minY,$[1],Y[1]),this.maxX=Math.max(this.maxX,$[0],Y[0]),this.maxY=Math.max(this.maxY,$[1],Y[1])}updateScalingPathMinMax(T,P){r.Util.scaleMinMax(T,P),this.minX=Math.min(this.minX,P[0]),this.maxX=Math.max(this.maxX,P[1]),this.minY=Math.min(this.minY,P[2]),this.maxY=Math.max(this.maxY,P[3])}updateCurvePathMinMax(T,P,$,Y,J,te,he,ve,Ne,Se){const je=r.Util.bezierBoundingBox(P,$,Y,J,te,he,ve,Ne);if(Se){Se[0]=Math.min(Se[0],je[0],je[2]),Se[1]=Math.max(Se[1],je[0],je[2]),Se[2]=Math.min(Se[2],je[1],je[3]),Se[3]=Math.max(Se[3],je[1],je[3]);return}this.updateRectMinMax(T,je)}getPathBoundingBox(T=p.PathType.FILL,P=null){const $=[this.minX,this.minY,this.maxX,this.maxY];if(T===p.PathType.STROKE){P||(0,r.unreachable)("Stroke bounding box must include transform.");const Y=r.Util.singularValueDecompose2dScale(P),J=Y[0]*this.lineWidth/2,te=Y[1]*this.lineWidth/2;$[0]-=J,$[1]-=te,$[2]+=J,$[3]+=te}return $}updateClipFromPath(){const T=r.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(T||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(T){this.clipBox=T,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(T=p.PathType.FILL,P=null){return r.Util.intersect(this.clipBox,this.getPathBoundingBox(T,P))}}function v(K,T,P=null){if(typeof ImageData<"u"&&T instanceof ImageData){K.putImageData(T,0,0);return}const $=T.height,Y=T.width,J=$%h,te=($-J)/h,he=J===0?te:te+1,ve=K.createImageData(Y,h);let Ne=0,Se;const je=T.data,Ie=ve.data;let ze,C,I,G,z,q,ge,Be;if(P)switch(P.length){case 1:z=P[0],q=P[0],ge=P[0],Be=P[0];break;case 4:z=P[0],q=P[1],ge=P[2],Be=P[3];break}if(T.kind===r.ImageKind.GRAYSCALE_1BPP){const Ze=je.byteLength,pe=new Uint32Array(Ie.buffer,0,Ie.byteLength>>2),ot=pe.length,Le=Y+7>>3;let Ye=4294967295,ce=r.FeatureTest.isLittleEndian?4278190080:255;for(Be&&Be[0]===255&&Be[255]===0&&([Ye,ce]=[ce,Ye]),ze=0;ze<he;ze++){for(I=ze<te?h:J,Se=0,C=0;C<I;C++){const We=Ze-Ne;let nt=0;const ut=We>Le?Y:We*8-7,Et=ut&-8;let kt=0,ct=0;for(;nt<Et;nt+=8)ct=je[Ne++],pe[Se++]=ct&128?Ye:ce,pe[Se++]=ct&64?Ye:ce,pe[Se++]=ct&32?Ye:ce,pe[Se++]=ct&16?Ye:ce,pe[Se++]=ct&8?Ye:ce,pe[Se++]=ct&4?Ye:ce,pe[Se++]=ct&2?Ye:ce,pe[Se++]=ct&1?Ye:ce;for(;nt<ut;nt++)kt===0&&(ct=je[Ne++],kt=128),pe[Se++]=ct&kt?Ye:ce,kt>>=1}for(;Se<ot;)pe[Se++]=0;K.putImageData(ve,0,ze*h)}}else if(T.kind===r.ImageKind.RGBA_32BPP){const Ze=!!(z||q||ge);for(C=0,G=Y*h*4,ze=0;ze<te;ze++){if(Ie.set(je.subarray(Ne,Ne+G)),Ne+=G,Ze)for(let pe=0;pe<G;pe+=4)z&&(Ie[pe+0]=z[Ie[pe+0]]),q&&(Ie[pe+1]=q[Ie[pe+1]]),ge&&(Ie[pe+2]=ge[Ie[pe+2]]);K.putImageData(ve,0,C),C+=h}if(ze<he){if(G=Y*J*4,Ie.set(je.subarray(Ne,Ne+G)),Ze)for(let pe=0;pe<G;pe+=4)z&&(Ie[pe+0]=z[Ie[pe+0]]),q&&(Ie[pe+1]=q[Ie[pe+1]]),ge&&(Ie[pe+2]=ge[Ie[pe+2]]);K.putImageData(ve,0,C)}}else if(T.kind===r.ImageKind.RGB_24BPP){const Ze=!!(z||q||ge);for(I=h,G=Y*I,ze=0;ze<he;ze++){for(ze>=te&&(I=J,G=Y*I),Se=0,C=G;C--;)Ie[Se++]=je[Ne++],Ie[Se++]=je[Ne++],Ie[Se++]=je[Ne++],Ie[Se++]=255;if(Ze)for(let pe=0;pe<Se;pe+=4)z&&(Ie[pe+0]=z[Ie[pe+0]]),q&&(Ie[pe+1]=q[Ie[pe+1]]),ge&&(Ie[pe+2]=ge[Ie[pe+2]]);K.putImageData(ve,0,ze*h)}}else throw new Error(`bad image kind: ${T.kind}`)}function c(K,T){if(T.bitmap){K.drawImage(T.bitmap,0,0);return}const P=T.height,$=T.width,Y=P%h,J=(P-Y)/h,te=Y===0?J:J+1,he=K.createImageData($,h);let ve=0;const Ne=T.data,Se=he.data;for(let je=0;je<te;je++){const Ie=je<J?h:Y;({srcPos:ve}=(0,k.applyMaskImageData)({src:Ne,srcPos:ve,dest:Se,width:$,height:Ie})),K.putImageData(he,0,je*h)}}function d(K,T){const P=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"];for(const $ of P)K[$]!==void 0&&(T[$]=K[$]);K.setLineDash!==void 0&&(T.setLineDash(K.getLineDash()),T.lineDashOffset=K.lineDashOffset)}function x(K,T){K.strokeStyle=K.fillStyle=T||"#000000",K.fillRule="nonzero",K.globalAlpha=1,K.lineWidth=1,K.lineCap="butt",K.lineJoin="miter",K.miterLimit=10,K.globalCompositeOperation="source-over",K.font="10px sans-serif",K.setLineDash!==void 0&&(K.setLineDash([]),K.lineDashOffset=0)}function L(K,T,P,$){const Y=K.length;for(let J=3;J<Y;J+=4){const te=K[J];if(te===0)K[J-3]=T,K[J-2]=P,K[J-1]=$;else if(te<255){const he=255-te;K[J-3]=K[J-3]*te+T*he>>8,K[J-2]=K[J-2]*te+P*he>>8,K[J-1]=K[J-1]*te+$*he>>8}}}function X(K,T,P){const $=K.length,Y=1/255;for(let J=3;J<$;J+=4){const te=P?P[K[J]]:K[J];T[J]=T[J]*te*Y|0}}function N(K,T,P){const $=K.length;for(let Y=3;Y<$;Y+=4){const J=K[Y-3]*77+K[Y-2]*152+K[Y-1]*28;T[Y]=P?T[Y]*P[J>>8]>>8:T[Y]*J>>16}}function D(K,T,P,$,Y,J,te,he,ve,Ne,Se){const je=!!J,Ie=je?J[0]:0,ze=je?J[1]:0,C=je?J[2]:0;let I;Y==="Luminosity"?I=N:I=X;const z=Math.min($,Math.ceil(1048576/P));for(let q=0;q<$;q+=z){const ge=Math.min(z,$-q),Be=K.getImageData(he-Ne,q+(ve-Se),P,ge),Ze=T.getImageData(he,q+ve,P,ge);je&&L(Be.data,Ie,ze,C),I(Be.data,Ze.data,te),T.putImageData(Ze,he,q+ve)}}function se(K,T,P,$){const Y=$[0],J=$[1],te=$[2]-Y,he=$[3]-J;te===0||he===0||(D(T.context,P,te,he,T.subtype,T.backdrop,T.transferMap,Y,J,T.offsetX,T.offsetY),K.save(),K.globalAlpha=1,K.globalCompositeOperation="source-over",K.setTransform(1,0,0,1,0,0),K.drawImage(P.canvas,0,0),K.restore())}function Ae(K,T){const P=r.Util.singularValueDecompose2dScale(K);P[0]=Math.fround(P[0]),P[1]=Math.fround(P[1]);const $=Math.fround((globalThis.devicePixelRatio||1)*e.PixelsPerInch.PDF_TO_CSS_UNITS);return T!==void 0?T:P[0]<=$||P[1]<=$}const Te=["butt","round","square"],le=["miter","round","bevel"],ie={},fe={},xe=class xe{constructor(T,P,$,Y,{optionalContentConfig:J,markedContentStack:te=null},he,ve){De(this,oe);this.ctx=T,this.current=new g(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=P,this.objs=$,this.canvasFactory=Y,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=te||[],this.optionalContentConfig=J,this.cachedCanvases=new o(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=he,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.backgroundColor=(ve==null?void 0:ve.background)||null,this.foregroundColor=(ve==null?void 0:ve.foreground)||null,this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(T,P=null){return typeof T=="string"?T.startsWith("g_")?this.commonObjs.get(T):this.objs.get(T):P}beginDrawing({transform:T,viewport:P,transparency:$=!1,background:Y=null}){const J=this.ctx.canvas.width,te=this.ctx.canvas.height,he=Y||"#ffffff";if(this.ctx.save(),this.foregroundColor&&this.backgroundColor){this.ctx.fillStyle=this.foregroundColor;const ve=this.foregroundColor=this.ctx.fillStyle;this.ctx.fillStyle=this.backgroundColor;const Ne=this.backgroundColor=this.ctx.fillStyle;let Se=!0,je=he;if(this.ctx.fillStyle=he,je=this.ctx.fillStyle,Se=typeof je=="string"&&/^#[0-9A-Fa-f]{6}$/.test(je),ve==="#000000"&&Ne==="#ffffff"||ve===Ne||!Se)this.foregroundColor=this.backgroundColor=null;else{const[Ie,ze,C]=(0,e.getRGB)(je),I=z=>(z/=255,z<=.03928?z/12.92:((z+.055)/1.055)**2.4),G=Math.round(.2126*I(Ie)+.7152*I(ze)+.0722*I(C));this.selectColor=(z,q,ge)=>{const Be=.2126*I(z)+.7152*I(q)+.0722*I(ge);return Math.round(Be)===G?Ne:ve}}}if(this.ctx.fillStyle=this.backgroundColor||he,this.ctx.fillRect(0,0,J,te),this.ctx.restore(),$){const ve=this.cachedCanvases.getCanvas("transparent",J,te);this.compositeCtx=this.ctx,this.transparentCanvas=ve.canvas,this.ctx=ve.context,this.ctx.save(),this.ctx.transform(...(0,e.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),x(this.ctx,this.foregroundColor),T&&(this.ctx.transform(...T),this.outputScaleX=T[0],this.outputScaleY=T[0]),this.ctx.transform(...P.transform),this.viewportScale=P.scale,this.baseTransform=(0,e.getCurrentTransform)(this.ctx)}executeOperatorList(T,P,$,Y){const J=T.argsArray,te=T.fnArray;let he=P||0;const ve=J.length;if(ve===he)return he;const Ne=ve-he>y&&typeof $=="function",Se=Ne?Date.now()+A:0;let je=0;const Ie=this.commonObjs,ze=this.objs;let C;for(;;){if(Y!==void 0&&he===Y.nextBreakPoint)return Y.breakIt(he,$),he;if(C=te[he],C!==r.OPS.dependency)this[C].apply(this,J[he]);else for(const I of J[he]){const G=I.startsWith("g_")?Ie:ze;if(!G.has(I))return G.get(I,$),he}if(he++,he===ve)return he;if(Ne&&++je>y){if(Date.now()>Se)return $(),he;je=0}}}endDrawing(){qe(this,oe,ya).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const T of this._cachedBitmapsMap.values()){for(const P of T.values())typeof HTMLCanvasElement<"u"&&P instanceof HTMLCanvasElement&&(P.width=P.height=0);T.clear()}this._cachedBitmapsMap.clear()}_scaleImage(T,P){const $=T.width,Y=T.height;let J=Math.max(Math.hypot(P[0],P[1]),1),te=Math.max(Math.hypot(P[2],P[3]),1),he=$,ve=Y,Ne="prescale1",Se,je;for(;J>2&&he>1||te>2&&ve>1;){let Ie=he,ze=ve;J>2&&he>1&&(Ie=Math.ceil(he/2),J/=he/Ie),te>2&&ve>1&&(ze=Math.ceil(ve/2),te/=ve/ze),Se=this.cachedCanvases.getCanvas(Ne,Ie,ze),je=Se.context,je.clearRect(0,0,Ie,ze),je.drawImage(T,0,0,he,ve,0,0,Ie,ze),T=Se.canvas,he=Ie,ve=ze,Ne=Ne==="prescale1"?"prescale2":"prescale1"}return{img:T,paintWidth:he,paintHeight:ve}}_createMaskCanvas(T){const P=this.ctx,{width:$,height:Y}=T,J=this.current.fillColor,te=this.current.patternFill,he=(0,e.getCurrentTransform)(P);let ve,Ne,Se,je;if((T.bitmap||T.data)&&T.count>1){const ot=T.bitmap||T.data.buffer;Ne=JSON.stringify(te?he:[he.slice(0,4),J]),ve=this._cachedBitmapsMap.get(ot),ve||(ve=new Map,this._cachedBitmapsMap.set(ot,ve));const Le=ve.get(Ne);if(Le&&!te){const Ye=Math.round(Math.min(he[0],he[2])+he[4]),ce=Math.round(Math.min(he[1],he[3])+he[5]);return{canvas:Le,offsetX:Ye,offsetY:ce}}Se=Le}Se||(je=this.cachedCanvases.getCanvas("maskCanvas",$,Y),c(je.context,T));let Ie=r.Util.transform(he,[1/$,0,0,-1/Y,0,0]);Ie=r.Util.transform(Ie,[1,0,0,1,0,-Y]);const ze=r.Util.applyTransform([0,0],Ie),C=r.Util.applyTransform([$,Y],Ie),I=r.Util.normalizeRect([ze[0],ze[1],C[0],C[1]]),G=Math.round(I[2]-I[0])||1,z=Math.round(I[3]-I[1])||1,q=this.cachedCanvases.getCanvas("fillCanvas",G,z),ge=q.context,Be=Math.min(ze[0],C[0]),Ze=Math.min(ze[1],C[1]);ge.translate(-Be,-Ze),ge.transform(...Ie),Se||(Se=this._scaleImage(je.canvas,(0,e.getCurrentTransformInverse)(ge)),Se=Se.img,ve&&te&&ve.set(Ne,Se)),ge.imageSmoothingEnabled=Ae((0,e.getCurrentTransform)(ge),T.interpolate),s(ge,Se,0,0,Se.width,Se.height,0,0,$,Y),ge.globalCompositeOperation="source-in";const pe=r.Util.transform((0,e.getCurrentTransformInverse)(ge),[1,0,0,1,-Be,-Ze]);return ge.fillStyle=te?J.getPattern(P,this,pe,p.PathType.FILL):J,ge.fillRect(0,0,$,Y),ve&&!te&&(this.cachedCanvases.delete("fillCanvas"),ve.set(Ne,q.canvas)),{canvas:q.canvas,offsetX:Math.round(Be),offsetY:Math.round(Ze)}}setLineWidth(T){T!==this.current.lineWidth&&(this._cachedScaleForStroking=null),this.current.lineWidth=T,this.ctx.lineWidth=T}setLineCap(T){this.ctx.lineCap=Te[T]}setLineJoin(T){this.ctx.lineJoin=le[T]}setMiterLimit(T){this.ctx.miterLimit=T}setDash(T,P){const $=this.ctx;$.setLineDash!==void 0&&($.setLineDash(T),$.lineDashOffset=P)}setRenderingIntent(T){}setFlatness(T){}setGState(T){for(const[P,$]of T)switch(P){case"LW":this.setLineWidth($);break;case"LC":this.setLineCap($);break;case"LJ":this.setLineJoin($);break;case"ML":this.setMiterLimit($);break;case"D":this.setDash($[0],$[1]);break;case"RI":this.setRenderingIntent($);break;case"FL":this.setFlatness($);break;case"Font":this.setFont($[0],$[1]);break;case"CA":this.current.strokeAlpha=$;break;case"ca":this.current.fillAlpha=$,this.ctx.globalAlpha=$;break;case"BM":this.ctx.globalCompositeOperation=$;break;case"SMask":this.current.activeSMask=$?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.current.transferMaps=$}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const T=this.inSMaskMode;this.current.activeSMask&&!T?this.beginSMaskMode():!this.current.activeSMask&&T&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const T=this.ctx.canvas.width,P=this.ctx.canvas.height,$="smaskGroupAt"+this.groupLevel,Y=this.cachedCanvases.getCanvas($,T,P);this.suspendedCtx=this.ctx,this.ctx=Y.context;const J=this.ctx;J.setTransform(...(0,e.getCurrentTransform)(this.suspendedCtx)),d(this.suspendedCtx,J),l(J,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(),d(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(T){if(!this.current.activeSMask)return;T?(T[0]=Math.floor(T[0]),T[1]=Math.floor(T[1]),T[2]=Math.ceil(T[2]),T[3]=Math.ceil(T[3])):T=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const P=this.current.activeSMask,$=this.suspendedCtx;se($,P,this.ctx,T),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?(d(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const T=this.current;this.stateStack.push(T),this.current=T.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),d(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null)}transform(T,P,$,Y,J,te){this.ctx.transform(T,P,$,Y,J,te),this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null}constructPath(T,P,$){const Y=this.ctx,J=this.current;let te=J.x,he=J.y,ve,Ne;const Se=(0,e.getCurrentTransform)(Y),je=Se[0]===0&&Se[3]===0||Se[1]===0&&Se[2]===0,Ie=je?$.slice(0):null;for(let ze=0,C=0,I=T.length;ze<I;ze++)switch(T[ze]|0){case r.OPS.rectangle:te=P[C++],he=P[C++];const G=P[C++],z=P[C++],q=te+G,ge=he+z;Y.moveTo(te,he),G===0||z===0?Y.lineTo(q,ge):(Y.lineTo(q,he),Y.lineTo(q,ge),Y.lineTo(te,ge)),je||J.updateRectMinMax(Se,[te,he,q,ge]),Y.closePath();break;case r.OPS.moveTo:te=P[C++],he=P[C++],Y.moveTo(te,he),je||J.updatePathMinMax(Se,te,he);break;case r.OPS.lineTo:te=P[C++],he=P[C++],Y.lineTo(te,he),je||J.updatePathMinMax(Se,te,he);break;case r.OPS.curveTo:ve=te,Ne=he,te=P[C+4],he=P[C+5],Y.bezierCurveTo(P[C],P[C+1],P[C+2],P[C+3],te,he),J.updateCurvePathMinMax(Se,ve,Ne,P[C],P[C+1],P[C+2],P[C+3],te,he,Ie),C+=6;break;case r.OPS.curveTo2:ve=te,Ne=he,Y.bezierCurveTo(te,he,P[C],P[C+1],P[C+2],P[C+3]),J.updateCurvePathMinMax(Se,ve,Ne,te,he,P[C],P[C+1],P[C+2],P[C+3],Ie),te=P[C+2],he=P[C+3],C+=4;break;case r.OPS.curveTo3:ve=te,Ne=he,te=P[C+2],he=P[C+3],Y.bezierCurveTo(P[C],P[C+1],te,he,te,he),J.updateCurvePathMinMax(Se,ve,Ne,P[C],P[C+1],te,he,te,he,Ie),C+=4;break;case r.OPS.closePath:Y.closePath();break}je&&J.updateScalingPathMinMax(Se,Ie),J.setCurrentPoint(te,he)}closePath(){this.ctx.closePath()}stroke(T){T=typeof T<"u"?T:!0;const P=this.ctx,$=this.current.strokeColor;P.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof $=="object"&&($!=null&&$.getPattern)?(P.save(),P.strokeStyle=$.getPattern(P,this,(0,e.getCurrentTransformInverse)(P),p.PathType.STROKE),this.rescaleAndStroke(!1),P.restore()):this.rescaleAndStroke(!0)),T&&this.consumePath(this.current.getClippedPathBoundingBox()),P.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(T){T=typeof T<"u"?T:!0;const P=this.ctx,$=this.current.fillColor,Y=this.current.patternFill;let J=!1;Y&&(P.save(),P.fillStyle=$.getPattern(P,this,(0,e.getCurrentTransformInverse)(P),p.PathType.FILL),J=!0);const te=this.current.getClippedPathBoundingBox();this.contentVisible&&te!==null&&(this.pendingEOFill?(P.fill("evenodd"),this.pendingEOFill=!1):P.fill()),J&&P.restore(),T&&this.consumePath(te)}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=ie}eoClip(){this.pendingClip=fe}beginText(){this.current.textMatrix=r.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const T=this.pendingTextPaths,P=this.ctx;if(T===void 0){P.beginPath();return}P.save(),P.beginPath();for(const $ of T)P.setTransform(...$.transform),P.translate($.x,$.y),$.addToPath(P,$.fontSize);P.restore(),P.clip(),P.beginPath(),delete this.pendingTextPaths}setCharSpacing(T){this.current.charSpacing=T}setWordSpacing(T){this.current.wordSpacing=T}setHScale(T){this.current.textHScale=T/100}setLeading(T){this.current.leading=-T}setFont(T,P){const $=this.commonObjs.get(T),Y=this.current;if(!$)throw new Error(`Can't find font for ${T}`);if(Y.fontMatrix=$.fontMatrix||r.FONT_IDENTITY_MATRIX,(Y.fontMatrix[0]===0||Y.fontMatrix[3]===0)&&(0,r.warn)("Invalid font matrix for font "+T),P<0?(P=-P,Y.fontDirection=-1):Y.fontDirection=1,this.current.font=$,this.current.fontSize=P,$.isType3Font)return;const J=$.loadedName||"sans-serif";let te="normal";$.black?te="900":$.bold&&(te="bold");const he=$.italic?"italic":"normal",ve=`"${J}", ${$.fallbackName}`;let Ne=P;P<b?Ne=b:P>R&&(Ne=R),this.current.fontSizeScale=P/Ne,this.ctx.font=`${he} ${te} ${Ne}px ${ve}`}setTextRenderingMode(T){this.current.textRenderingMode=T}setTextRise(T){this.current.textRise=T}moveText(T,P){this.current.x=this.current.lineX+=T,this.current.y=this.current.lineY+=P}setLeadingMoveText(T,P){this.setLeading(-P),this.moveText(T,P)}setTextMatrix(T,P,$,Y,J,te){this.current.textMatrix=[T,P,$,Y,J,te],this.current.textMatrixScale=Math.hypot(T,P),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(T,P,$,Y){const J=this.ctx,te=this.current,he=te.font,ve=te.textRenderingMode,Ne=te.fontSize/te.fontSizeScale,Se=ve&r.TextRenderingMode.FILL_STROKE_MASK,je=!!(ve&r.TextRenderingMode.ADD_TO_PATH_FLAG),Ie=te.patternFill&&!he.missingFile;let ze;(he.disableFontFace||je||Ie)&&(ze=he.getPathGenerator(this.commonObjs,T)),he.disableFontFace||Ie?(J.save(),J.translate(P,$),J.beginPath(),ze(J,Ne),Y&&J.setTransform(...Y),(Se===r.TextRenderingMode.FILL||Se===r.TextRenderingMode.FILL_STROKE)&&J.fill(),(Se===r.TextRenderingMode.STROKE||Se===r.TextRenderingMode.FILL_STROKE)&&J.stroke(),J.restore()):((Se===r.TextRenderingMode.FILL||Se===r.TextRenderingMode.FILL_STROKE)&&J.fillText(T,P,$),(Se===r.TextRenderingMode.STROKE||Se===r.TextRenderingMode.FILL_STROKE)&&J.strokeText(T,P,$)),je&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,e.getCurrentTransform)(J),x:P,y:$,fontSize:Ne,addToPath:ze})}get isFontSubpixelAAEnabled(){const{context:T}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);T.scale(1.5,1),T.fillText("I",0,10);const P=T.getImageData(0,0,10,10).data;let $=!1;for(let Y=3;Y<P.length;Y+=4)if(P[Y]>0&&P[Y]<255){$=!0;break}return(0,r.shadow)(this,"isFontSubpixelAAEnabled",$)}showText(T){const P=this.current,$=P.font;if($.isType3Font)return this.showType3Text(T);const Y=P.fontSize;if(Y===0)return;const J=this.ctx,te=P.fontSizeScale,he=P.charSpacing,ve=P.wordSpacing,Ne=P.fontDirection,Se=P.textHScale*Ne,je=T.length,Ie=$.vertical,ze=Ie?1:-1,C=$.defaultVMetrics,I=Y*P.fontMatrix[0],G=P.textRenderingMode===r.TextRenderingMode.FILL&&!$.disableFontFace&&!P.patternFill;J.save(),J.transform(...P.textMatrix),J.translate(P.x,P.y+P.textRise),Ne>0?J.scale(Se,-1):J.scale(Se,1);let z;if(P.patternFill){J.save();const pe=P.fillColor.getPattern(J,this,(0,e.getCurrentTransformInverse)(J),p.PathType.FILL);z=(0,e.getCurrentTransform)(J),J.restore(),J.fillStyle=pe}let q=P.lineWidth;const ge=P.textMatrixScale;if(ge===0||q===0){const pe=P.textRenderingMode&r.TextRenderingMode.FILL_STROKE_MASK;(pe===r.TextRenderingMode.STROKE||pe===r.TextRenderingMode.FILL_STROKE)&&(q=this.getSinglePixelWidth())}else q/=ge;if(te!==1&&(J.scale(te,te),q/=te),J.lineWidth=q,$.isInvalidPDFjsFont){const pe=[];let ot=0;for(const Le of T)pe.push(Le.unicode),ot+=Le.width;J.fillText(pe.join(""),0,0),P.x+=ot*I*Se,J.restore(),this.compose();return}let Be=0,Ze;for(Ze=0;Ze<je;++Ze){const pe=T[Ze];if(typeof pe=="number"){Be+=ze*pe*Y/1e3;continue}let ot=!1;const Le=(pe.isSpace?ve:0)+he,Ye=pe.fontChar,ce=pe.accent;let We,nt,ut=pe.width;if(Ie){const kt=pe.vmetric||C,ct=-(pe.vmetric?kt[1]:ut*.5)*I,Ve=kt[2]*I;ut=kt?-kt[0]:ut,We=ct/te,nt=(Be+Ve)/te}else We=Be/te,nt=0;if($.remeasure&&ut>0){const kt=J.measureText(Ye).width*1e3/Y*te;if(ut<kt&&this.isFontSubpixelAAEnabled){const ct=ut/kt;ot=!0,J.save(),J.scale(ct,1),We/=ct}else ut!==kt&&(We+=(ut-kt)/2e3*Y/te)}if(this.contentVisible&&(pe.isInFont||$.missingFile)){if(G&&!ce)J.fillText(Ye,We,nt);else if(this.paintChar(Ye,We,nt,z),ce){const kt=We+Y*ce.offset.x/te,ct=nt-Y*ce.offset.y/te;this.paintChar(ce.fontChar,kt,ct,z)}}let Et;Ie?Et=ut*I-Le*Ne:Et=ut*I+Le*Ne,Be+=Et,ot&&J.restore()}Ie?P.y-=Be:P.x+=Be*Se,J.restore(),this.compose()}showType3Text(T){const P=this.ctx,$=this.current,Y=$.font,J=$.fontSize,te=$.fontDirection,he=Y.vertical?1:-1,ve=$.charSpacing,Ne=$.wordSpacing,Se=$.textHScale*te,je=$.fontMatrix||r.FONT_IDENTITY_MATRIX,Ie=T.length,ze=$.textRenderingMode===r.TextRenderingMode.INVISIBLE;let C,I,G,z;if(!(ze||J===0)){for(this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null,P.save(),P.transform(...$.textMatrix),P.translate($.x,$.y),P.scale(Se,te),C=0;C<Ie;++C){if(I=T[C],typeof I=="number"){z=he*I*J/1e3,this.ctx.translate(z,0),$.x+=z*Se;continue}const q=(I.isSpace?Ne:0)+ve,ge=Y.charProcOperatorList[I.operatorListId];if(!ge){(0,r.warn)(`Type3 character "${I.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=I,this.save(),P.scale(J,J),P.transform(...je),this.executeOperatorList(ge),this.restore()),G=r.Util.applyTransform([I.width,0],je)[0]*J+q,P.translate(G,0),$.x+=G*Se}P.restore(),this.processingType3=null}}setCharWidth(T,P){}setCharWidthAndBounds(T,P,$,Y,J,te){this.ctx.rect($,Y,J-$,te-Y),this.ctx.clip(),this.endPath()}getColorN_Pattern(T){let P;if(T[0]==="TilingPattern"){const $=T[1],Y=this.baseTransform||(0,e.getCurrentTransform)(this.ctx),J={createCanvasGraphics:te=>new xe(te,this.commonObjs,this.objs,this.canvasFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};P=new p.TilingPattern(T,$,this.ctx,J,Y)}else P=this._getPattern(T[1],T[2]);return P}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(T,P,$){var J;const Y=((J=this.selectColor)==null?void 0:J.call(this,T,P,$))||r.Util.makeHexColor(T,P,$);this.ctx.strokeStyle=Y,this.current.strokeColor=Y}setFillRGBColor(T,P,$){var J;const Y=((J=this.selectColor)==null?void 0:J.call(this,T,P,$))||r.Util.makeHexColor(T,P,$);this.ctx.fillStyle=Y,this.current.fillColor=Y,this.current.patternFill=!1}_getPattern(T,P=null){let $;return this.cachedPatterns.has(T)?$=this.cachedPatterns.get(T):($=(0,p.getShadingPattern)(this.objs.get(T)),this.cachedPatterns.set(T,$)),P&&($.matrix=P),$}shadingFill(T){if(!this.contentVisible)return;const P=this.ctx;this.save();const $=this._getPattern(T);P.fillStyle=$.getPattern(P,this,(0,e.getCurrentTransformInverse)(P),p.PathType.SHADING);const Y=(0,e.getCurrentTransformInverse)(P);if(Y){const J=P.canvas,te=J.width,he=J.height,ve=r.Util.applyTransform([0,0],Y),Ne=r.Util.applyTransform([0,he],Y),Se=r.Util.applyTransform([te,0],Y),je=r.Util.applyTransform([te,he],Y),Ie=Math.min(ve[0],Ne[0],Se[0],je[0]),ze=Math.min(ve[1],Ne[1],Se[1],je[1]),C=Math.max(ve[0],Ne[0],Se[0],je[0]),I=Math.max(ve[1],Ne[1],Se[1],je[1]);this.ctx.fillRect(Ie,ze,C-Ie,I-ze)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,r.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,r.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(T,P){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(T)&&T.length===6&&this.transform(...T),this.baseTransform=(0,e.getCurrentTransform)(this.ctx),P)){const $=P[2]-P[0],Y=P[3]-P[1];this.ctx.rect(P[0],P[1],$,Y),this.current.updateRectMinMax((0,e.getCurrentTransform)(this.ctx),P),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(T){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const P=this.ctx;T.isolated||(0,r.info)("TODO: Support non-isolated groups."),T.knockout&&(0,r.warn)("Knockout groups not supported.");const $=(0,e.getCurrentTransform)(P);if(T.matrix&&P.transform(...T.matrix),!T.bbox)throw new Error("Bounding box is required.");let Y=r.Util.getAxialAlignedBoundingBox(T.bbox,(0,e.getCurrentTransform)(P));const J=[0,0,P.canvas.width,P.canvas.height];Y=r.Util.intersect(Y,J)||[0,0,0,0];const te=Math.floor(Y[0]),he=Math.floor(Y[1]);let ve=Math.max(Math.ceil(Y[2])-te,1),Ne=Math.max(Math.ceil(Y[3])-he,1),Se=1,je=1;ve>S&&(Se=ve/S,ve=S),Ne>S&&(je=Ne/S,Ne=S),this.current.startNewPathAndClipBox([0,0,ve,Ne]);let Ie="groupAt"+this.groupLevel;T.smask&&(Ie+="_smask_"+this.smaskCounter++%2);const ze=this.cachedCanvases.getCanvas(Ie,ve,Ne),C=ze.context;C.scale(1/Se,1/je),C.translate(-te,-he),C.transform(...$),T.smask?this.smaskStack.push({canvas:ze.canvas,context:C,offsetX:te,offsetY:he,scaleX:Se,scaleY:je,subtype:T.smask.subtype,backdrop:T.smask.backdrop,transferMap:T.smask.transferMap||null,startTransformInverse:null}):(P.setTransform(1,0,0,1,0,0),P.translate(te,he),P.scale(Se,je),P.save()),d(P,C),this.ctx=C,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(P),this.groupLevel++}endGroup(T){if(!this.contentVisible)return;this.groupLevel--;const P=this.ctx,$=this.groupStack.pop();if(this.ctx=$,this.ctx.imageSmoothingEnabled=!1,T.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const Y=(0,e.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...Y);const J=r.Util.getAxialAlignedBoundingBox([0,0,P.canvas.width,P.canvas.height],Y);this.ctx.drawImage(P.canvas,0,0),this.ctx.restore(),this.compose(J)}}beginAnnotation(T,P,$,Y,J){if(qe(this,oe,ya).call(this),x(this.ctx,this.foregroundColor),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(P)&&P.length===4){const te=P[2]-P[0],he=P[3]-P[1];if(J&&this.annotationCanvasMap){$=$.slice(),$[4]-=P[0],$[5]-=P[1],P=P.slice(),P[0]=P[1]=0,P[2]=te,P[3]=he;const[ve,Ne]=r.Util.singularValueDecompose2dScale((0,e.getCurrentTransform)(this.ctx)),{viewportScale:Se}=this,je=Math.ceil(te*this.outputScaleX*Se),Ie=Math.ceil(he*this.outputScaleY*Se);this.annotationCanvas=this.canvasFactory.create(je,Ie);const{canvas:ze,context:C}=this.annotationCanvas;this.annotationCanvasMap.set(T,ze),this.annotationCanvas.savedCtx=this.ctx,this.ctx=C,this.ctx.setTransform(ve,0,0,-Ne,0,he*Ne),x(this.ctx,this.foregroundColor)}else x(this.ctx,this.foregroundColor),this.ctx.rect(P[0],P[1],te,he),this.ctx.clip(),this.endPath()}this.current=new g(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...$),this.transform(...Y)}endAnnotation(){this.annotationCanvas&&(this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(T){if(!this.contentVisible)return;const P=T.count;T=this.getObject(T.data,T),T.count=P;const $=this.ctx,Y=this.processingType3;if(Y&&(Y.compiled===void 0&&(Y.compiled=f(T)),Y.compiled)){Y.compiled($);return}const J=this._createMaskCanvas(T),te=J.canvas;$.save(),$.setTransform(1,0,0,1,0,0),$.drawImage(te,J.offsetX,J.offsetY),$.restore(),this.compose()}paintImageMaskXObjectRepeat(T,P,$=0,Y=0,J,te){if(!this.contentVisible)return;T=this.getObject(T.data,T);const he=this.ctx;he.save();const ve=(0,e.getCurrentTransform)(he);he.transform(P,$,Y,J,0,0);const Ne=this._createMaskCanvas(T);he.setTransform(1,0,0,1,Ne.offsetX-ve[4],Ne.offsetY-ve[5]);for(let Se=0,je=te.length;Se<je;Se+=2){const Ie=r.Util.transform(ve,[P,$,Y,J,te[Se],te[Se+1]]),[ze,C]=r.Util.applyTransform([0,0],Ie);he.drawImage(Ne.canvas,ze,C)}he.restore(),this.compose()}paintImageMaskXObjectGroup(T){if(!this.contentVisible)return;const P=this.ctx,$=this.current.fillColor,Y=this.current.patternFill;for(const J of T){const{data:te,width:he,height:ve,transform:Ne}=J,Se=this.cachedCanvases.getCanvas("maskCanvas",he,ve),je=Se.context;je.save();const Ie=this.getObject(te,J);c(je,Ie),je.globalCompositeOperation="source-in",je.fillStyle=Y?$.getPattern(je,this,(0,e.getCurrentTransformInverse)(P),p.PathType.FILL):$,je.fillRect(0,0,he,ve),je.restore(),P.save(),P.transform(...Ne),P.scale(1,-1),s(P,Se.canvas,0,0,he,ve,0,-1,1,1),P.restore()}this.compose()}paintImageXObject(T){if(!this.contentVisible)return;const P=this.getObject(T);if(!P){(0,r.warn)("Dependent image isn't ready yet");return}this.paintInlineImageXObject(P)}paintImageXObjectRepeat(T,P,$,Y){if(!this.contentVisible)return;const J=this.getObject(T);if(!J){(0,r.warn)("Dependent image isn't ready yet");return}const te=J.width,he=J.height,ve=[];for(let Ne=0,Se=Y.length;Ne<Se;Ne+=2)ve.push({transform:[P,0,0,$,Y[Ne],Y[Ne+1]],x:0,y:0,w:te,h:he});this.paintInlineImageXObjectGroup(J,ve)}paintInlineImageXObject(T){if(!this.contentVisible)return;const P=T.width,$=T.height,Y=this.ctx;this.save(),Y.scale(1/P,-1/$);let J;if(typeof HTMLElement=="function"&&T instanceof HTMLElement||!T.data)J=T;else{const he=this.cachedCanvases.getCanvas("inlineImage",P,$),ve=he.context;v(ve,T,this.current.transferMaps),J=he.canvas}const te=this._scaleImage(J,(0,e.getCurrentTransformInverse)(Y));Y.imageSmoothingEnabled=Ae((0,e.getCurrentTransform)(Y),T.interpolate),s(Y,te.img,0,0,te.paintWidth,te.paintHeight,0,-$,P,$),this.compose(),this.restore()}paintInlineImageXObjectGroup(T,P){if(!this.contentVisible)return;const $=this.ctx,Y=T.width,J=T.height,te=this.cachedCanvases.getCanvas("inlineImage",Y,J),he=te.context;v(he,T,this.current.transferMaps);for(const ve of P)$.save(),$.transform(...ve.transform),$.scale(1,-1),s($,te.canvas,ve.x,ve.y,ve.w,ve.h,0,-1,1,1),$.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(T){}markPointProps(T,P){}beginMarkedContent(T){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(T,P){T==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(P)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(T){const P=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(T);const $=this.ctx;this.pendingClip&&(P||(this.pendingClip===fe?$.clip("evenodd"):$.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),$.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const T=(0,e.getCurrentTransform)(this.ctx);if(T[1]===0&&T[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(T[0]),Math.abs(T[3]));else{const P=Math.abs(T[0]*T[3]-T[2]*T[1]),$=Math.hypot(T[0],T[2]),Y=Math.hypot(T[1],T[3]);this._cachedGetSinglePixelWidth=Math.max($,Y)/P}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(!this._cachedScaleForStroking){const{lineWidth:T}=this.current,P=(0,e.getCurrentTransform)(this.ctx);let $,Y;if(P[1]===0&&P[2]===0){const J=Math.abs(P[0]),te=Math.abs(P[3]);if(T===0)$=1/J,Y=1/te;else{const he=J*T,ve=te*T;$=he<1?1/he:1,Y=ve<1?1/ve:1}}else{const J=Math.abs(P[0]*P[3]-P[2]*P[1]),te=Math.hypot(P[0],P[1]),he=Math.hypot(P[2],P[3]);if(T===0)$=he/J,Y=te/J;else{const ve=T*J;$=he>ve?he/ve:1,Y=te>ve?te/ve:1}}this._cachedScaleForStroking=[$,Y]}return this._cachedScaleForStroking}rescaleAndStroke(T){const{ctx:P}=this,{lineWidth:$}=this.current,[Y,J]=this.getScaleForStroking();if(P.lineWidth=$||1,Y===1&&J===1){P.stroke();return}let te,he,ve;T&&(te=(0,e.getCurrentTransform)(P),he=P.getLineDash().slice(),ve=P.lineDashOffset),P.scale(Y,J);const Ne=Math.max(Y,J);P.setLineDash(P.getLineDash().map(Se=>Se/Ne)),P.lineDashOffset/=Ne,P.stroke(),T&&(P.setTransform(...te),P.setLineDash(he),P.lineDashOffset=ve)}isContentVisible(){for(let T=this.markedContentStack.length-1;T>=0;T--)if(!this.markedContentStack[T].visible)return!1;return!0}};oe=new WeakSet,ya=function(){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)};let _e=xe;n.CanvasGraphics=_e;for(const K in r.OPS)_e.prototype[K]!==void 0&&(_e.prototype[r.OPS[K]]=_e.prototype[K])},(t,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TilingPattern=n.PathType=void 0,n.getShadingPattern=h;var r=a(1),e=a(6),p=a(12);const k={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};n.PathType=k;function E(s,f){if(!f||p.isNodeJS)return;const g=f[2]-f[0],v=f[3]-f[1],c=new Path2D;c.rect(f[0],f[1],g,v),s.clip(c)}class b{constructor(){this.constructor===b&&(0,r.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,r.unreachable)("Abstract method `getPattern` called.")}}class R extends b{constructor(f){super(),this._type=f[1],this._bbox=f[2],this._colorStops=f[3],this._p0=f[4],this._p1=f[5],this._r0=f[6],this._r1=f[7],this.matrix=null}_createGradient(f){let g;this._type==="axial"?g=f.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(g=f.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const v of this._colorStops)g.addColorStop(v[0],v[1]);return g}getPattern(f,g,v,c){let d;if(c===k.STROKE||c===k.FILL){const x=g.current.getClippedPathBoundingBox(c,(0,e.getCurrentTransform)(f))||[0,0,0,0],L=Math.ceil(x[2]-x[0])||1,X=Math.ceil(x[3]-x[1])||1,N=g.cachedCanvases.getCanvas("pattern",L,X,!0),D=N.context;D.clearRect(0,0,D.canvas.width,D.canvas.height),D.beginPath(),D.rect(0,0,D.canvas.width,D.canvas.height),D.translate(-x[0],-x[1]),v=r.Util.transform(v,[1,0,0,1,x[0],x[1]]),D.transform(...g.baseTransform),this.matrix&&D.transform(...this.matrix),E(D,this._bbox),D.fillStyle=this._createGradient(D),D.fill(),d=f.createPattern(N.canvas,"no-repeat");const se=new DOMMatrix(v);d.setTransform(se)}else E(f,this._bbox),d=this._createGradient(f);return d}}function S(s,f,g,v,c,d,x,L){const X=f.coords,N=f.colors,D=s.data,se=s.width*4;let Ae;X[g+1]>X[v+1]&&(Ae=g,g=v,v=Ae,Ae=d,d=x,x=Ae),X[v+1]>X[c+1]&&(Ae=v,v=c,c=Ae,Ae=x,x=L,L=Ae),X[g+1]>X[v+1]&&(Ae=g,g=v,v=Ae,Ae=d,d=x,x=Ae);const Te=(X[g]+f.offsetX)*f.scaleX,le=(X[g+1]+f.offsetY)*f.scaleY,ie=(X[v]+f.offsetX)*f.scaleX,fe=(X[v+1]+f.offsetY)*f.scaleY,_e=(X[c]+f.offsetX)*f.scaleX,oe=(X[c+1]+f.offsetY)*f.scaleY;if(le>=oe)return;const Me=N[d],xe=N[d+1],K=N[d+2],T=N[x],P=N[x+1],$=N[x+2],Y=N[L],J=N[L+1],te=N[L+2],he=Math.round(le),ve=Math.round(oe);let Ne,Se,je,Ie,ze,C,I,G;for(let z=he;z<=ve;z++){if(z<fe){let pe;z<le?pe=0:pe=(le-z)/(le-fe),Ne=Te-(Te-ie)*pe,Se=Me-(Me-T)*pe,je=xe-(xe-P)*pe,Ie=K-(K-$)*pe}else{let pe;z>oe?pe=1:fe===oe?pe=0:pe=(fe-z)/(fe-oe),Ne=ie-(ie-_e)*pe,Se=T-(T-Y)*pe,je=P-(P-J)*pe,Ie=$-($-te)*pe}let q;z<le?q=0:z>oe?q=1:q=(le-z)/(le-oe),ze=Te-(Te-_e)*q,C=Me-(Me-Y)*q,I=xe-(xe-J)*q,G=K-(K-te)*q;const ge=Math.round(Math.min(Ne,ze)),Be=Math.round(Math.max(Ne,ze));let Ze=se*z+ge*4;for(let pe=ge;pe<=Be;pe++)q=(Ne-pe)/(Ne-ze),q<0?q=0:q>1&&(q=1),D[Ze++]=Se-(Se-C)*q|0,D[Ze++]=je-(je-I)*q|0,D[Ze++]=Ie-(Ie-G)*q|0,D[Ze++]=255}}function A(s,f,g){const v=f.coords,c=f.colors;let d,x;switch(f.type){case"lattice":const L=f.verticesPerRow,X=Math.floor(v.length/L)-1,N=L-1;for(d=0;d<X;d++){let D=d*L;for(let se=0;se<N;se++,D++)S(s,g,v[D],v[D+1],v[D+L],c[D],c[D+1],c[D+L]),S(s,g,v[D+L+1],v[D+1],v[D+L],c[D+L+1],c[D+1],c[D+L])}break;case"triangles":for(d=0,x=v.length;d<x;d+=3)S(s,g,v[d],v[d+1],v[d+2],c[d],c[d+1],c[d+2]);break;default:throw new Error("illegal figure")}}class y extends b{constructor(f){super(),this._coords=f[2],this._colors=f[3],this._figures=f[4],this._bounds=f[5],this._bbox=f[7],this._background=f[8],this.matrix=null}_createMeshCanvas(f,g,v){const L=Math.floor(this._bounds[0]),X=Math.floor(this._bounds[1]),N=Math.ceil(this._bounds[2])-L,D=Math.ceil(this._bounds[3])-X,se=Math.min(Math.ceil(Math.abs(N*f[0]*1.1)),3e3),Ae=Math.min(Math.ceil(Math.abs(D*f[1]*1.1)),3e3),Te=N/se,le=D/Ae,ie={coords:this._coords,colors:this._colors,offsetX:-L,offsetY:-X,scaleX:1/Te,scaleY:1/le},fe=se+2*2,_e=Ae+2*2,oe=v.getCanvas("mesh",fe,_e,!1),Me=oe.context,xe=Me.createImageData(se,Ae);if(g){const T=xe.data;for(let P=0,$=T.length;P<$;P+=4)T[P]=g[0],T[P+1]=g[1],T[P+2]=g[2],T[P+3]=255}for(const T of this._figures)A(xe,T,ie);return Me.putImageData(xe,2,2),{canvas:oe.canvas,offsetX:L-2*Te,offsetY:X-2*le,scaleX:Te,scaleY:le}}getPattern(f,g,v,c){E(f,this._bbox);let d;if(c===k.SHADING)d=r.Util.singularValueDecompose2dScale((0,e.getCurrentTransform)(f));else if(d=r.Util.singularValueDecompose2dScale(g.baseTransform),this.matrix){const L=r.Util.singularValueDecompose2dScale(this.matrix);d=[d[0]*L[0],d[1]*L[1]]}const x=this._createMeshCanvas(d,c===k.SHADING?null:this._background,g.cachedCanvases);return c!==k.SHADING&&(f.setTransform(...g.baseTransform),this.matrix&&f.transform(...this.matrix)),f.translate(x.offsetX,x.offsetY),f.scale(x.scaleX,x.scaleY),f.createPattern(x.canvas,"no-repeat")}}class _ extends b{getPattern(){return"hotpink"}}function h(s){switch(s[0]){case"RadialAxial":return new R(s);case"Mesh":return new y(s);case"Dummy":return new _}throw new Error(`Unknown IR type: ${s[0]}`)}const l={COLORED:1,UNCOLORED:2};class o{static get MAX_PATTERN_SIZE(){return(0,r.shadow)(this,"MAX_PATTERN_SIZE",3e3)}constructor(f,g,v,c,d){this.operatorList=f[2],this.matrix=f[3]||[1,0,0,1,0,0],this.bbox=f[4],this.xstep=f[5],this.ystep=f[6],this.paintType=f[7],this.tilingType=f[8],this.color=g,this.ctx=v,this.canvasGraphicsFactory=c,this.baseTransform=d}createPatternCanvas(f){const g=this.operatorList,v=this.bbox,c=this.xstep,d=this.ystep,x=this.paintType,L=this.tilingType,X=this.color,N=this.canvasGraphicsFactory;(0,r.info)("TilingType: "+L);const D=v[0],se=v[1],Ae=v[2],Te=v[3],le=r.Util.singularValueDecompose2dScale(this.matrix),ie=r.Util.singularValueDecompose2dScale(this.baseTransform),fe=[le[0]*ie[0],le[1]*ie[1]],_e=this.getSizeAndScale(c,this.ctx.canvas.width,fe[0]),oe=this.getSizeAndScale(d,this.ctx.canvas.height,fe[1]),Me=f.cachedCanvases.getCanvas("pattern",_e.size,oe.size,!0),xe=Me.context,K=N.createCanvasGraphics(xe);K.groupLevel=f.groupLevel,this.setFillAndStrokeStyleToContext(K,x,X);let T=D,P=se,$=Ae,Y=Te;return D<0&&(T=0,$+=Math.abs(D)),se<0&&(P=0,Y+=Math.abs(se)),xe.translate(-(_e.scale*T),-(oe.scale*P)),K.transform(_e.scale,0,0,oe.scale,0,0),xe.save(),this.clipBbox(K,T,P,$,Y),K.baseTransform=(0,e.getCurrentTransform)(K.ctx),K.executeOperatorList(g),K.endDrawing(),{canvas:Me.canvas,scaleX:_e.scale,scaleY:oe.scale,offsetX:T,offsetY:P}}getSizeAndScale(f,g,v){f=Math.abs(f);const c=Math.max(o.MAX_PATTERN_SIZE,g);let d=Math.ceil(f*v);return d>=c?d=c:v=d/f,{scale:v,size:d}}clipBbox(f,g,v,c,d){const x=c-g,L=d-v;f.ctx.rect(g,v,x,L),f.current.updateRectMinMax((0,e.getCurrentTransform)(f.ctx),[g,v,c,d]),f.clip(),f.endPath()}setFillAndStrokeStyleToContext(f,g,v){const c=f.ctx,d=f.current;switch(g){case l.COLORED:const x=this.ctx;c.fillStyle=x.fillStyle,c.strokeStyle=x.strokeStyle,d.fillColor=x.fillStyle,d.strokeColor=x.strokeStyle;break;case l.UNCOLORED:const L=r.Util.makeHexColor(v[0],v[1],v[2]);c.fillStyle=L,c.strokeStyle=L,d.fillColor=L,d.strokeColor=L;break;default:throw new r.FormatError(`Unsupported paint type: ${g}`)}}getPattern(f,g,v,c){let d=v;c!==k.SHADING&&(d=r.Util.transform(d,g.baseTransform),this.matrix&&(d=r.Util.transform(d,this.matrix)));const x=this.createPatternCanvas(g);let L=new DOMMatrix(d);L=L.translate(x.offsetX,x.offsetY),L=L.scale(1/x.scaleX,1/x.scaleY);const X=f.createPattern(x.canvas,"repeat");return X.setTransform(L),X}}n.TilingPattern=o},(t,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.isNodeJS=void 0;const a=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");n.isNodeJS=a},(t,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.applyMaskImageData=e;var r=a(1);function e({src:p,srcPos:k=0,dest:E,destPos:b=0,width:R,height:S,inverseDecode:A=!1}){const y=r.FeatureTest.isLittleEndian?4278190080:255,[_,h]=A?[0,y]:[y,0],l=R>>3,o=R&7,s=p.length;E=new Uint32Array(E.buffer);for(let f=0;f<S;f++){for(const v=k+l;k<v;k++){const c=k<s?p[k]:255;E[b++]=c&128?h:_,E[b++]=c&64?h:_,E[b++]=c&32?h:_,E[b++]=c&16?h:_,E[b++]=c&8?h:_,E[b++]=c&4?h:_,E[b++]=c&2?h:_,E[b++]=c&1?h:_}if(o===0)continue;const g=k<s?p[k++]:255;for(let v=0;v<o;v++)E[b++]=g&1<<7-v?h:_}return{srcPos:k,destPos:b}}},(t,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.GlobalWorkerOptions=void 0;const a=Object.create(null);n.GlobalWorkerOptions=a,a.workerPort=a.workerPort===void 0?null:a.workerPort,a.workerSrc=a.workerSrc===void 0?"":a.workerSrc},(t,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.MessageHandler=void 0;var r=a(1);const e={UNKNOWN:0,DATA:1,ERROR:2},p={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function k(b){switch(b instanceof Error||typeof b=="object"&&b!==null||(0,r.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),b.name){case"AbortException":return new r.AbortException(b.message);case"MissingPDFException":return new r.MissingPDFException(b.message);case"PasswordException":return new r.PasswordException(b.message,b.code);case"UnexpectedResponseException":return new r.UnexpectedResponseException(b.message,b.status);case"UnknownErrorException":return new r.UnknownErrorException(b.message,b.details);default:return new r.UnknownErrorException(b.message,b.toString())}}class E{constructor(R,S,A){this.sourceName=R,this.targetName=S,this.comObj=A,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=y=>{const _=y.data;if(_.targetName!==this.sourceName)return;if(_.stream){this._processStreamMessage(_);return}if(_.callback){const l=_.callbackId,o=this.callbackCapabilities[l];if(!o)throw new Error(`Cannot resolve callback ${l}`);if(delete this.callbackCapabilities[l],_.callback===e.DATA)o.resolve(_.data);else if(_.callback===e.ERROR)o.reject(k(_.reason));else throw new Error("Unexpected callback case");return}const h=this.actionHandler[_.action];if(!h)throw new Error(`Unknown action from worker: ${_.action}`);if(_.callbackId){const l=this.sourceName,o=_.sourceName;new Promise(function(s){s(h(_.data))}).then(function(s){A.postMessage({sourceName:l,targetName:o,callback:e.DATA,callbackId:_.callbackId,data:s})},function(s){A.postMessage({sourceName:l,targetName:o,callback:e.ERROR,callbackId:_.callbackId,reason:k(s)})});return}if(_.streamId){this._createStreamSink(_);return}h(_.data)},A.addEventListener("message",this._onComObjOnMessage)}on(R,S){const A=this.actionHandler;if(A[R])throw new Error(`There is already an actionName called "${R}"`);A[R]=S}send(R,S,A){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:R,data:S},A)}sendWithPromise(R,S,A){const y=this.callbackId++,_=(0,r.createPromiseCapability)();this.callbackCapabilities[y]=_;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:R,callbackId:y,data:S},A)}catch(h){_.reject(h)}return _.promise}sendWithStream(R,S,A,y){const _=this.streamId++,h=this.sourceName,l=this.targetName,o=this.comObj;return new ReadableStream({start:s=>{const f=(0,r.createPromiseCapability)();return this.streamControllers[_]={controller:s,startCall:f,pullCall:null,cancelCall:null,isClosed:!1},o.postMessage({sourceName:h,targetName:l,action:R,streamId:_,data:S,desiredSize:s.desiredSize},y),f.promise},pull:s=>{const f=(0,r.createPromiseCapability)();return this.streamControllers[_].pullCall=f,o.postMessage({sourceName:h,targetName:l,stream:p.PULL,streamId:_,desiredSize:s.desiredSize}),f.promise},cancel:s=>{(0,r.assert)(s instanceof Error,"cancel must have a valid reason");const f=(0,r.createPromiseCapability)();return this.streamControllers[_].cancelCall=f,this.streamControllers[_].isClosed=!0,o.postMessage({sourceName:h,targetName:l,stream:p.CANCEL,streamId:_,reason:k(s)}),f.promise}},A)}_createStreamSink(R){const S=R.streamId,A=this.sourceName,y=R.sourceName,_=this.comObj,h=this,l=this.actionHandler[R.action],o={enqueue(s,f=1,g){if(this.isCancelled)return;const v=this.desiredSize;this.desiredSize-=f,v>0&&this.desiredSize<=0&&(this.sinkCapability=(0,r.createPromiseCapability)(),this.ready=this.sinkCapability.promise),_.postMessage({sourceName:A,targetName:y,stream:p.ENQUEUE,streamId:S,chunk:s},g)},close(){this.isCancelled||(this.isCancelled=!0,_.postMessage({sourceName:A,targetName:y,stream:p.CLOSE,streamId:S}),delete h.streamSinks[S])},error(s){(0,r.assert)(s instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,_.postMessage({sourceName:A,targetName:y,stream:p.ERROR,streamId:S,reason:k(s)}))},sinkCapability:(0,r.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:R.desiredSize,ready:null};o.sinkCapability.resolve(),o.ready=o.sinkCapability.promise,this.streamSinks[S]=o,new Promise(function(s){s(l(R.data,o))}).then(function(){_.postMessage({sourceName:A,targetName:y,stream:p.START_COMPLETE,streamId:S,success:!0})},function(s){_.postMessage({sourceName:A,targetName:y,stream:p.START_COMPLETE,streamId:S,reason:k(s)})})}_processStreamMessage(R){const S=R.streamId,A=this.sourceName,y=R.sourceName,_=this.comObj,h=this.streamControllers[S],l=this.streamSinks[S];switch(R.stream){case p.START_COMPLETE:R.success?h.startCall.resolve():h.startCall.reject(k(R.reason));break;case p.PULL_COMPLETE:R.success?h.pullCall.resolve():h.pullCall.reject(k(R.reason));break;case p.PULL:if(!l){_.postMessage({sourceName:A,targetName:y,stream:p.PULL_COMPLETE,streamId:S,success:!0});break}l.desiredSize<=0&&R.desiredSize>0&&l.sinkCapability.resolve(),l.desiredSize=R.desiredSize,new Promise(function(o){o(l.onPull&&l.onPull())}).then(function(){_.postMessage({sourceName:A,targetName:y,stream:p.PULL_COMPLETE,streamId:S,success:!0})},function(o){_.postMessage({sourceName:A,targetName:y,stream:p.PULL_COMPLETE,streamId:S,reason:k(o)})});break;case p.ENQUEUE:if((0,r.assert)(h,"enqueue should have stream controller"),h.isClosed)break;h.controller.enqueue(R.chunk);break;case p.CLOSE:if((0,r.assert)(h,"close should have stream controller"),h.isClosed)break;h.isClosed=!0,h.controller.close(),this._deleteStreamController(h,S);break;case p.ERROR:(0,r.assert)(h,"error should have stream controller"),h.controller.error(k(R.reason)),this._deleteStreamController(h,S);break;case p.CANCEL_COMPLETE:R.success?h.cancelCall.resolve():h.cancelCall.reject(k(R.reason)),this._deleteStreamController(h,S);break;case p.CANCEL:if(!l)break;new Promise(function(o){o(l.onCancel&&l.onCancel(k(R.reason)))}).then(function(){_.postMessage({sourceName:A,targetName:y,stream:p.CANCEL_COMPLETE,streamId:S,success:!0})},function(o){_.postMessage({sourceName:A,targetName:y,stream:p.CANCEL_COMPLETE,streamId:S,reason:k(o)})}),l.sinkCapability.reject(k(R.reason)),l.isCancelled=!0,delete this.streamSinks[S];break;default:throw new Error("Unexpected stream case")}}async _deleteStreamController(R,S){await Promise.allSettled([R.startCall&&R.startCall.promise,R.pullCall&&R.pullCall.promise,R.cancelCall&&R.cancelCall.promise]),delete this.streamControllers[S]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}n.MessageHandler=E},(t,n,a)=>{var p,k;Object.defineProperty(n,"__esModule",{value:!0}),n.Metadata=void 0;var r=a(1);class e{constructor({parsedData:b,rawData:R}){De(this,p,void 0);De(this,k,void 0);rt(this,p,b),rt(this,k,R)}getRaw(){return B(this,k)}get(b){return B(this,p).get(b)??null}getAll(){return(0,r.objectFromMap)(B(this,p))}has(b){return B(this,p).has(b)}}p=new WeakMap,k=new WeakMap,n.Metadata=e},(t,n,a)=>{var b,R,S,A,y,_,Pa;Object.defineProperty(n,"__esModule",{value:!0}),n.OptionalContentConfig=void 0;var r=a(1),e=a(8);const p=Symbol("INTERNAL");class k{constructor(o,s){De(this,b,!0);this.name=o,this.intent=s}get visible(){return B(this,b)}_setVisible(o,s){o!==p&&(0,r.unreachable)("Internal method `_setVisible` called."),rt(this,b,s)}}b=new WeakMap;class E{constructor(o){De(this,_);De(this,R,null);De(this,S,new Map);De(this,A,null);De(this,y,null);if(this.name=null,this.creator=null,o!==null){this.name=o.name,this.creator=o.creator,rt(this,y,o.order);for(const s of o.groups)B(this,S).set(s.id,new k(s.name,s.intent));if(o.baseState==="OFF")for(const s of B(this,S).values())s._setVisible(p,!1);for(const s of o.on)B(this,S).get(s)._setVisible(p,!0);for(const s of o.off)B(this,S).get(s)._setVisible(p,!1);rt(this,A,this.getHash())}}isVisible(o){if(B(this,S).size===0)return!0;if(!o)return(0,r.warn)("Optional content group not defined."),!0;if(o.type==="OCG")return B(this,S).has(o.id)?B(this,S).get(o.id).visible:((0,r.warn)(`Optional content group not found: ${o.id}`),!0);if(o.type==="OCMD"){if(o.expression)return qe(this,_,Pa).call(this,o.expression);if(!o.policy||o.policy==="AnyOn"){for(const s of o.ids){if(!B(this,S).has(s))return(0,r.warn)(`Optional content group not found: ${s}`),!0;if(B(this,S).get(s).visible)return!0}return!1}else if(o.policy==="AllOn"){for(const s of o.ids){if(!B(this,S).has(s))return(0,r.warn)(`Optional content group not found: ${s}`),!0;if(!B(this,S).get(s).visible)return!1}return!0}else if(o.policy==="AnyOff"){for(const s of o.ids){if(!B(this,S).has(s))return(0,r.warn)(`Optional content group not found: ${s}`),!0;if(!B(this,S).get(s).visible)return!0}return!1}else if(o.policy==="AllOff"){for(const s of o.ids){if(!B(this,S).has(s))return(0,r.warn)(`Optional content group not found: ${s}`),!0;if(B(this,S).get(s).visible)return!1}return!0}return(0,r.warn)(`Unknown optional content policy ${o.policy}.`),!0}return(0,r.warn)(`Unknown group type ${o.type}.`),!0}setVisibility(o,s=!0){if(!B(this,S).has(o)){(0,r.warn)(`Optional content group not found: ${o}`);return}B(this,S).get(o)._setVisible(p,!!s),rt(this,R,null)}get hasInitialVisibility(){return this.getHash()===B(this,A)}getOrder(){return B(this,S).size?B(this,y)?B(this,y).slice():[...B(this,S).keys()]:null}getGroups(){return B(this,S).size>0?(0,r.objectFromMap)(B(this,S)):null}getGroup(o){return B(this,S).get(o)||null}getHash(){if(B(this,R)!==null)return B(this,R);const o=new e.MurmurHash3_64;for(const[s,f]of B(this,S))o.update(`${s}:${f.visible}`);return rt(this,R,o.hexdigest())}}R=new WeakMap,S=new WeakMap,A=new WeakMap,y=new WeakMap,_=new WeakSet,Pa=function(o){const s=o.length;if(s<2)return!0;const f=o[0];for(let g=1;g<s;g++){const v=o[g];let c;if(Array.isArray(v))c=qe(this,_,Pa).call(this,v);else if(B(this,S).has(v))c=B(this,S).get(v).visible;else return(0,r.warn)(`Optional content group not found: ${v}`),!0;switch(f){case"And":if(!c)return!1;break;case"Or":if(c)return!0;break;case"Not":return!c;default:return!0}}return f==="And"},n.OptionalContentConfig=E},(t,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.PDFDataTransportStream=void 0;var r=a(1),e=a(6);class p{constructor(R,S){(0,r.assert)(S,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=R.progressiveDone||!1,this._contentDispositionFilename=R.contentDispositionFilename||null;const A=R.initialData;if((A==null?void 0:A.length)>0){const y=new Uint8Array(A).buffer;this._queuedChunks.push(y)}this._pdfDataRangeTransport=S,this._isStreamingSupported=!R.disableStream,this._isRangeSupported=!R.disableRange,this._contentLength=R.length,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((y,_)=>{this._onReceiveData({begin:y,chunk:_})}),this._pdfDataRangeTransport.addProgressListener((y,_)=>{this._onProgress({loaded:y,total:_})}),this._pdfDataRangeTransport.addProgressiveReadListener(y=>{this._onReceiveData({chunk:y})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData(R){const S=new Uint8Array(R.chunk).buffer;if(R.begin===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(S):this._queuedChunks.push(S);else{const A=this._rangeReaders.some(function(y){return y._begin!==R.begin?!1:(y._enqueue(S),!0)});(0,r.assert)(A,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var R;return((R=this._fullRequestReader)==null?void 0:R._loaded)??0}_onProgress(R){var S,A,y,_;R.total===void 0?(A=(S=this._rangeReaders[0])==null?void 0:S.onProgress)==null||A.call(S,{loaded:R.loaded}):(_=(y=this._fullRequestReader)==null?void 0:y.onProgress)==null||_.call(y,{loaded:R.loaded,total:R.total})}_onProgressiveDone(){var R;(R=this._fullRequestReader)==null||R.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(R){const S=this._rangeReaders.indexOf(R);S>=0&&this._rangeReaders.splice(S,1)}getFullReader(){(0,r.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const R=this._queuedChunks;return this._queuedChunks=null,new k(this,R,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(R,S){if(S<=this._progressiveDataLength)return null;const A=new E(this,R,S);return this._pdfDataRangeTransport.requestDataRange(R,S),this._rangeReaders.push(A),A}cancelAllRequests(R){var S;(S=this._fullRequestReader)==null||S.cancel(R);for(const A of this._rangeReaders.slice(0))A.cancel(R);this._pdfDataRangeTransport.abort()}}n.PDFDataTransportStream=p;class k{constructor(R,S,A=!1,y=null){this._stream=R,this._done=A||!1,this._filename=(0,e.isPdfFile)(y)?y:null,this._queuedChunks=S||[],this._loaded=0;for(const _ of this._queuedChunks)this._loaded+=_.byteLength;this._requests=[],this._headersReady=Promise.resolve(),R._fullRequestReader=this,this.onProgress=null}_enqueue(R){this._done||(this._requests.length>0?this._requests.shift().resolve({value:R,done:!1}):this._queuedChunks.push(R),this._loaded+=R.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 R=(0,r.createPromiseCapability)();return this._requests.push(R),R.promise}cancel(R){this._done=!0;for(const S of this._requests)S.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class E{constructor(R,S,A){this._stream=R,this._begin=S,this._end=A,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(R){if(!this._done){if(this._requests.length===0)this._queuedChunk=R;else{this._requests.shift().resolve({value:R,done:!1});for(const A of this._requests)A.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 S=this._queuedChunk;return this._queuedChunk=null,{value:S,done:!1}}if(this._done)return{value:void 0,done:!0};const R=(0,r.createPromiseCapability)();return this._requests.push(R),R.promise}cancel(R){this._done=!0;for(const S of this._requests)S.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(t,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.XfaText=void 0;class a{static textContent(e){const p=[],k={items:p,styles:Object.create(null)};function E(b){var A;if(!b)return;let R=null;const S=b.name;if(S==="#text")R=b.value;else if(a.shouldBuildText(S))(A=b==null?void 0:b.attributes)!=null&&A.textContent?R=b.attributes.textContent:b.value&&(R=b.value);else return;if(R!==null&&p.push({str:R}),!!b.children)for(const y of b.children)E(y)}return E(e),k}static shouldBuildText(e){return!(e==="textarea"||e==="input"||e==="option"||e==="select")}}n.XfaText=a},(t,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.NodeStandardFontDataFactory=n.NodeCanvasFactory=n.NodeCMapReaderFactory=void 0;var r=a(7);const e=function(b){return new Promise((R,S)=>{require$$5.readFile(b,(y,_)=>{if(y||!_){S(new Error(y));return}R(new Uint8Array(_))})})};class p extends r.BaseCanvasFactory{_createCanvas(R,S){return require$$5.createCanvas(R,S)}}n.NodeCanvasFactory=p;class k extends r.BaseCMapReaderFactory{_fetchData(R,S){return e(R).then(A=>({cMapData:A,compressionType:S}))}}n.NodeCMapReaderFactory=k;class E extends r.BaseStandardFontDataFactory{_fetchData(R){return e(R)}}n.NodeStandardFontDataFactory=E},(t,n,a)=>{var b,R,S,A,y,_,h,l,o,wa,f,Ya,v,Ca,d,Za;Object.defineProperty(n,"__esModule",{value:!0}),n.AnnotationEditorLayer=void 0;var r=a(5),e=a(1),p=a(22),k=a(23);const L=class L{constructor(N){De(this,o);De(this,f);De(this,v);De(this,d);De(this,b,void 0);De(this,R,!1);De(this,S,this.pointerup.bind(this));De(this,A,this.pointerdown.bind(this));De(this,y,new Map);De(this,_,!1);De(this,h,!1);De(this,l,void 0);L._initialized||(L._initialized=!0,p.FreeTextEditor.initialize(N.l10n),k.InkEditor.initialize(N.l10n)),N.uiManager.registerEditorTypes([p.FreeTextEditor,k.InkEditor]),rt(this,l,N.uiManager),this.annotationStorage=N.annotationStorage,this.pageIndex=N.pageIndex,this.div=N.div,rt(this,b,N.accessibilityManager),B(this,l).addLayer(this)}updateToolbar(N){B(this,l).updateToolbar(N)}updateMode(N=B(this,l).getMode()){qe(this,d,Za).call(this),N===e.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),B(this,l).unselectAll(),this.div.classList.toggle("freeTextEditing",N===e.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",N===e.AnnotationEditorType.INK)}addInkEditorIfNeeded(N){if(!N&&B(this,l).getMode()!==e.AnnotationEditorType.INK)return;if(!N){for(const se of B(this,y).values())if(se.isEmpty()){se.setInBackground();return}}qe(this,v,Ca).call(this,{offsetX:0,offsetY:0}).setInBackground()}setEditingState(N){B(this,l).setEditingState(N)}addCommands(N){B(this,l).addCommands(N)}enable(){this.div.style.pointerEvents="auto";for(const N of B(this,y).values())N.enableEditing()}disable(){this.div.style.pointerEvents="none";for(const N of B(this,y).values())N.disableEditing()}setActiveEditor(N){B(this,l).getActive()!==N&&B(this,l).setActiveEditor(N)}enableClick(){this.div.addEventListener("pointerdown",B(this,A)),this.div.addEventListener("pointerup",B(this,S))}disableClick(){this.div.removeEventListener("pointerdown",B(this,A)),this.div.removeEventListener("pointerup",B(this,S))}attach(N){B(this,y).set(N.id,N)}detach(N){var D;B(this,y).delete(N.id),(D=B(this,b))==null||D.removePointerInTextLayer(N.contentDiv)}remove(N){B(this,l).removeEditor(N),this.detach(N),this.annotationStorage.remove(N.id),N.div.style.display="none",setTimeout(()=>{N.div.style.display="",N.div.remove(),N.isAttachedToDOM=!1,document.activeElement===document.body&&B(this,l).focusMainContainer()},0),B(this,h)||this.addInkEditorIfNeeded(!1)}add(N){if(qe(this,o,wa).call(this,N),B(this,l).addEditor(N),this.attach(N),!N.isAttachedToDOM){const D=N.render();this.div.append(D),N.isAttachedToDOM=!0}this.moveEditorInDOM(N),N.onceAdded(),this.addToAnnotationStorage(N)}moveEditorInDOM(N){var D;(D=B(this,b))==null||D.moveElementInDOM(this.div,N.div,N.contentDiv,!0)}addToAnnotationStorage(N){!N.isEmpty()&&!this.annotationStorage.has(N.id)&&this.annotationStorage.setValue(N.id,N)}addOrRebuild(N){N.needsToBeRebuilt()?N.rebuild():this.add(N)}addANewEditor(N){const D=()=>{this.addOrRebuild(N)},se=()=>{N.remove()};this.addCommands({cmd:D,undo:se,mustExec:!0})}addUndoableEditor(N){const D=()=>{this.addOrRebuild(N)},se=()=>{N.remove()};this.addCommands({cmd:D,undo:se,mustExec:!1})}getNextId(){return B(this,l).getId()}deserialize(N){switch(N.annotationType){case e.AnnotationEditorType.FREETEXT:return p.FreeTextEditor.deserialize(N,this);case e.AnnotationEditorType.INK:return k.InkEditor.deserialize(N,this)}return null}setSelected(N){B(this,l).setSelected(N)}toggleSelected(N){B(this,l).toggleSelected(N)}isSelected(N){return B(this,l).isSelected(N)}unselect(N){B(this,l).unselect(N)}pointerup(N){const D=r.KeyboardManager.platform.isMac;if(!(N.button!==0||N.ctrlKey&&D)&&N.target===this.div&&B(this,_)){if(rt(this,_,!1),!B(this,R)){rt(this,R,!0);return}qe(this,v,Ca).call(this,N)}}pointerdown(N){const D=r.KeyboardManager.platform.isMac;if(N.button!==0||N.ctrlKey&&D||N.target!==this.div)return;rt(this,_,!0);const se=B(this,l).getActive();rt(this,R,!se||se.isEmpty())}drop(N){const D=N.dataTransfer.getData("text/plain"),se=B(this,l).getEditor(D);if(!se)return;N.preventDefault(),N.dataTransfer.dropEffect="move",qe(this,o,wa).call(this,se);const Ae=this.div.getBoundingClientRect(),Te=N.clientX-Ae.x,le=N.clientY-Ae.y;se.translate(Te-se.startX,le-se.startY),this.moveEditorInDOM(se),se.div.focus()}dragover(N){N.preventDefault()}destroy(){var N,D;((N=B(this,l).getActive())==null?void 0:N.parent)===this&&B(this,l).setActiveEditor(null);for(const se of B(this,y).values())(D=B(this,b))==null||D.removePointerInTextLayer(se.contentDiv),se.isAttachedToDOM=!1,se.div.remove(),se.parent=null;this.div=null,B(this,y).clear(),B(this,l).removeLayer(this)}render(N){this.viewport=N.viewport,(0,r.bindEvents)(this,this.div,["dragover","drop"]),this.setDimensions();for(const D of B(this,l).getEditors(this.pageIndex))this.add(D);this.updateMode()}update(N){B(this,l).commitOrRemove(),this.viewport=N.viewport,this.setDimensions(),this.updateMode()}get scaleFactor(){return this.viewport.scale}get pageDimensions(){const[N,D,se,Ae]=this.viewport.viewBox,Te=se-N,le=Ae-D;return[Te,le]}get viewportBaseDimensions(){const{width:N,height:D,rotation:se}=this.viewport;return se%180===0?[N,D]:[D,N]}setDimensions(){const{width:N,height:D,rotation:se}=this.viewport,Ae=se%180!==0,Te=Math.floor(N)+"px",le=Math.floor(D)+"px";this.div.style.width=Ae?le:Te,this.div.style.height=Ae?Te:le,this.div.setAttribute("data-main-rotation",se)}};b=new WeakMap,R=new WeakMap,S=new WeakMap,A=new WeakMap,y=new WeakMap,_=new WeakMap,h=new WeakMap,l=new WeakMap,o=new WeakSet,wa=function(N){var D;N.parent!==this&&(this.attach(N),N.pageIndex=this.pageIndex,(D=N.parent)==null||D.detach(N),N.parent=this,N.div&&N.isAttachedToDOM&&(N.div.remove(),this.div.append(N.div)))},f=new WeakSet,Ya=function(N){switch(B(this,l).getMode()){case e.AnnotationEditorType.FREETEXT:return new p.FreeTextEditor(N);case e.AnnotationEditorType.INK:return new k.InkEditor(N)}return null},v=new WeakSet,Ca=function(N){const D=this.getNextId(),se=qe(this,f,Ya).call(this,{parent:this,id:D,x:N.offsetX,y:N.offsetY});return se&&this.add(se),se},d=new WeakSet,Za=function(){rt(this,h,!0);for(const N of B(this,y).values())N.isEmpty()&&N.remove();rt(this,h,!1)},an(L,"_initialized",!1);let E=L;n.AnnotationEditorLayer=E},(t,n,a)=>{var E,b,R,S,A,y,_,h,l,o,Ja,f,Qa,v,ei,d,ka;Object.defineProperty(n,"__esModule",{value:!0}),n.FreeTextEditor=void 0;var r=a(1),e=a(5),p=a(4);const L=class L extends p.AnnotationEditor{constructor(D){super({...D,name:"freeTextEditor"});De(this,o);De(this,f);De(this,v);De(this,d);De(this,E,this.editorDivBlur.bind(this));De(this,b,this.editorDivFocus.bind(this));De(this,R,this.editorDivInput.bind(this));De(this,S,this.editorDivKeydown.bind(this));De(this,A,void 0);De(this,y,"");De(this,_,`${this.id}-editor`);De(this,h,!1);De(this,l,void 0);rt(this,A,D.color||L._defaultColor||p.AnnotationEditor._defaultLineColor),rt(this,l,D.fontSize||L._defaultFontSize)}static initialize(D){this._l10nPromise=new Map(["free_text2_default_content","editor_free_text2_aria_label"].map(Ae=>[Ae,D.get(Ae)]));const se=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(se.getPropertyValue("--freetext-padding"))}static updateDefaultParams(D,se){switch(D){case r.AnnotationEditorParamsType.FREETEXT_SIZE:L._defaultFontSize=se;break;case r.AnnotationEditorParamsType.FREETEXT_COLOR:L._defaultColor=se;break}}updateParams(D,se){switch(D){case r.AnnotationEditorParamsType.FREETEXT_SIZE:qe(this,o,Ja).call(this,se);break;case r.AnnotationEditorParamsType.FREETEXT_COLOR:qe(this,f,Qa).call(this,se);break}}static get defaultPropertiesToUpdate(){return[[r.AnnotationEditorParamsType.FREETEXT_SIZE,L._defaultFontSize],[r.AnnotationEditorParamsType.FREETEXT_COLOR,L._defaultColor||p.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[r.AnnotationEditorParamsType.FREETEXT_SIZE,B(this,l)],[r.AnnotationEditorParamsType.FREETEXT_COLOR,B(this,A)]]}getInitialTranslation(){return[-L._internalPadding*this.parent.scaleFactor,-(L._internalPadding+B(this,l))*this.parent.scaleFactor]}rebuild(){super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(r.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this.div.draggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",B(this,S)),this.editorDiv.addEventListener("focus",B(this,b)),this.editorDiv.addEventListener("blur",B(this,E)),this.editorDiv.addEventListener("input",B(this,R)))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",B(this,_)),this.div.draggable=!0,this.editorDiv.removeEventListener("keydown",B(this,S)),this.editorDiv.removeEventListener("focus",B(this,b)),this.editorDiv.removeEventListener("blur",B(this,E)),this.editorDiv.removeEventListener("input",B(this,R)),this.div.focus(),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(D){super.focusin(D),D.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()}commit(){super.commit(),B(this,h)||(rt(this,h,!0),this.parent.addUndoableEditor(this)),this.disableEditMode(),rt(this,y,qe(this,v,ei).call(this).trimEnd()),qe(this,d,ka).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}dblclick(D){this.enableEditMode(),this.editorDiv.focus()}keydown(D){D.target===this.div&&D.key==="Enter"&&(this.enableEditMode(),this.editorDiv.focus())}editorDivKeydown(D){L._keyboardManager.exec(this,D)}editorDivFocus(D){this.isEditing=!0}editorDivBlur(D){this.isEditing=!1}editorDivInput(D){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 D,se;this.width&&(D=this.x,se=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",B(this,_)),this.enableEditing(),L._l10nPromise.get("editor_free_text2_aria_label").then(Te=>{var le;return(le=this.editorDiv)==null?void 0:le.setAttribute("aria-label",Te)}),L._l10nPromise.get("free_text2_default_content").then(Te=>{var le;return(le=this.editorDiv)==null?void 0:le.setAttribute("default-content",Te)}),this.editorDiv.contentEditable=!0;const{style:Ae}=this.editorDiv;if(Ae.fontSize=`calc(${B(this,l)}px * var(--scale-factor))`,Ae.color=B(this,A),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,e.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[Te,le]=this.parent.viewportBaseDimensions;this.setAt(D*Te,se*le,this.width*Te,this.height*le);for(const ie of B(this,y).split(` `)){const fe=document.createElement("div");fe.append(ie?document.createTextNode(ie):document.createElement("br")),this.editorDiv.append(fe)}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(D,se){const Ae=super.deserialize(D,se);return rt(Ae,l,D.fontSize),rt(Ae,A,r.Util.makeHexColor(...D.color)),rt(Ae,y,D.value),Ae}serialize(){if(this.isEmpty())return null;const D=L._internalPadding*this.parent.scaleFactor,se=this.getRect(D,D),Ae=p.AnnotationEditor._colorManager.convert(getComputedStyle(this.editorDiv).color);return{annotationType:r.AnnotationEditorType.FREETEXT,color:Ae,fontSize:B(this,l),value:B(this,y),pageIndex:this.parent.pageIndex,rect:se,rotation:this.rotation}}};E=new WeakMap,b=new WeakMap,R=new WeakMap,S=new WeakMap,A=new WeakMap,y=new WeakMap,_=new WeakMap,h=new WeakMap,l=new WeakMap,o=new WeakSet,Ja=function(D){const se=Te=>{this.editorDiv.style.fontSize=`calc(${Te}px * var(--scale-factor))`,this.translate(0,-(Te-B(this,l))*this.parent.scaleFactor),rt(this,l,Te),qe(this,d,ka).call(this)},Ae=B(this,l);this.parent.addCommands({cmd:()=>{se(D)},undo:()=>{se(Ae)},mustExec:!0,type:r.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},f=new WeakSet,Qa=function(D){const se=B(this,A);this.parent.addCommands({cmd:()=>{rt(this,A,D),this.editorDiv.style.color=D},undo:()=>{rt(this,A,se),this.editorDiv.style.color=se},mustExec:!0,type:r.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},v=new WeakSet,ei=function(){const D=this.editorDiv.getElementsByTagName("div");if(D.length===0)return this.editorDiv.innerText;const se=[];for(const Ae of D)se.push(Ae.innerText.replace(/\r\n?|\n/,""));return se.join(` `)},d=new WeakSet,ka=function(){const[D,se]=this.parent.viewportBaseDimensions,Ae=this.div.getBoundingClientRect();this.width=Ae.width/D,this.height=Ae.height/se},an(L,"_freeTextDefaultContent",""),an(L,"_l10nPromise"),an(L,"_internalPadding",0),an(L,"_defaultColor",null),an(L,"_defaultFontSize",10),an(L,"_keyboardManager",new e.KeyboardManager([[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],L.prototype.commitOrRemove]])),an(L,"_type","freetext");let k=L;n.FreeTextEditor=k},(t,n,a)=>{var S,A,y,_,h,l,o,s,f,g,v,c,d,x,L,ti,N,ni,se,ri,Te,ai,ie,Ta,_e,ii,Me,oi,K,si,P,Ln,Y,Aa,te,kr,ve,Tr,Se,ar,Ie,Ma,C,Ar,G,xa,q,ci,Be,li,pe,ui,Le,Ia,ce,Mr,nt,ir,Et,$a;Object.defineProperty(n,"__esModule",{value:!0}),n.InkEditor=void 0,Object.defineProperty(n,"fitCurve",{enumerable:!0,get:function(){return p.fitCurve}});var r=a(1),e=a(4),p=a(24),k=a(5);const E=16,b=100,ct=class ct extends e.AnnotationEditor{constructor(j){super({...j,name:"inkEditor"});De(this,L);De(this,N);De(this,se);De(this,Te);De(this,ie);De(this,_e);De(this,Me);De(this,K);De(this,P);De(this,Y);De(this,te);De(this,ve);De(this,Se);De(this,Ie);De(this,C);De(this,q);De(this,Be);De(this,pe);De(this,Le);De(this,ce);De(this,nt);De(this,Et);De(this,S,0);De(this,A,0);De(this,y,0);De(this,_,this.canvasPointermove.bind(this));De(this,h,this.canvasPointerleave.bind(this));De(this,l,this.canvasPointerup.bind(this));De(this,o,this.canvasPointerdown.bind(this));De(this,s,!1);De(this,f,!1);De(this,g,null);De(this,v,null);De(this,c,0);De(this,d,0);De(this,x,null);this.color=j.color||null,this.thickness=j.thickness||null,this.opacity=j.opacity||null,this.paths=[],this.bezierPath2D=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0}static initialize(j){this._l10nPromise=new Map(["editor_ink_canvas_aria_label","editor_ink2_aria_label"].map(ye=>[ye,j.get(ye)]))}static updateDefaultParams(j,ye){switch(j){case r.AnnotationEditorParamsType.INK_THICKNESS:ct._defaultThickness=ye;break;case r.AnnotationEditorParamsType.INK_COLOR:ct._defaultColor=ye;break;case r.AnnotationEditorParamsType.INK_OPACITY:ct._defaultOpacity=ye/100;break}}updateParams(j,ye){switch(j){case r.AnnotationEditorParamsType.INK_THICKNESS:qe(this,L,ti).call(this,ye);break;case r.AnnotationEditorParamsType.INK_COLOR:qe(this,N,ni).call(this,ye);break;case r.AnnotationEditorParamsType.INK_OPACITY:qe(this,se,ri).call(this,ye);break}}static get defaultPropertiesToUpdate(){return[[r.AnnotationEditorParamsType.INK_THICKNESS,ct._defaultThickness],[r.AnnotationEditorParamsType.INK_COLOR,ct._defaultColor||e.AnnotationEditor._defaultLineColor],[r.AnnotationEditorParamsType.INK_OPACITY,Math.round(ct._defaultOpacity*100)]]}get propertiesToUpdate(){return[[r.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||ct._defaultThickness],[r.AnnotationEditorParamsType.INK_COLOR,this.color||ct._defaultColor||e.AnnotationEditor._defaultLineColor],[r.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??ct._defaultOpacity))]]}rebuild(){super.rebuild(),this.div!==null&&(this.canvas||(qe(this,te,kr).call(this),qe(this,ve,Tr).call(this)),this.isAttachedToDOM||(this.parent.add(this),qe(this,Se,ar).call(this)),qe(this,nt,ir).call(this))}remove(){this.canvas!==null&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,B(this,v).disconnect(),rt(this,v,null),super.remove())}enableEditMode(){B(this,s)||this.canvas===null||(super.enableEditMode(),this.div.draggable=!1,this.canvas.addEventListener("pointerdown",B(this,o)),this.canvas.addEventListener("pointerup",B(this,l)))}disableEditMode(){!this.isInEditMode()||this.canvas===null||(super.disableEditMode(),this.div.draggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",B(this,o)),this.canvas.removeEventListener("pointerup",B(this,l)))}onceAdded(){this.div.draggable=!this.isEmpty()}isEmpty(){return this.paths.length===0||this.paths.length===1&&this.paths[0].length===0}commit(){B(this,s)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),rt(this,s,!0),this.div.classList.add("disabled"),qe(this,nt,ir).call(this,!0),this.parent.addInkEditorIfNeeded(!0),this.parent.moveEditorInDOM(this),this.div.focus())}focusin(j){super.focusin(j),this.enableEditMode()}canvasPointerdown(j){j.button!==0||!this.isInEditMode()||B(this,s)||(this.setInForeground(),j.type!=="mouse"&&this.div.focus(),j.stopPropagation(),this.canvas.addEventListener("pointerleave",B(this,h)),this.canvas.addEventListener("pointermove",B(this,_)),qe(this,_e,ii).call(this,j.offsetX,j.offsetY))}canvasPointermove(j){j.stopPropagation(),qe(this,Me,oi).call(this,j.offsetX,j.offsetY)}canvasPointerup(j){j.button===0&&this.isInEditMode()&&this.currentPath.length!==0&&(j.stopPropagation(),qe(this,Y,Aa).call(this,j),this.setInBackground())}canvasPointerleave(j){qe(this,Y,Aa).call(this,j),this.setInBackground()}render(){if(this.div)return this.div;let j,ye;this.width&&(j=this.x,ye=this.y),super.render(),ct._l10nPromise.get("editor_ink2_aria_label").then(gt=>{var bt;return(bt=this.div)==null?void 0:bt.setAttribute("aria-label",gt)});const[Ge,ht,st,Ct]=qe(this,Te,ai).call(this);if(this.setAt(Ge,ht,0,0),this.setDims(st,Ct),qe(this,te,kr).call(this),this.width){const[gt,bt]=this.parent.viewportBaseDimensions;this.setAt(j*gt,ye*bt,this.width*gt,this.height*bt),rt(this,f,!0),qe(this,Se,ar).call(this),this.setDims(this.width*gt,this.height*bt),qe(this,P,Ln).call(this),qe(this,Et,$a).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return qe(this,ve,Tr).call(this),this.div}setDimensions(j,ye){const Ge=Math.round(j),ht=Math.round(ye);if(B(this,c)===Ge&&B(this,d)===ht)return;rt(this,c,Ge),rt(this,d,ht),this.canvas.style.visibility="hidden",B(this,S)&&Math.abs(B(this,S)-j/ye)>.01&&(ye=Math.ceil(j/B(this,S)),this.setDims(j,ye));const[st,Ct]=this.parent.viewportBaseDimensions;this.width=j/st,this.height=ye/Ct,B(this,s)&&qe(this,Ie,Ma).call(this,j,ye),qe(this,Se,ar).call(this),qe(this,P,Ln).call(this),this.canvas.style.visibility="visible"}static deserialize(j,ye){var Xt,It;const Ge=super.deserialize(j,ye);Ge.thickness=j.thickness,Ge.color=r.Util.makeHexColor(...j.color),Ge.opacity=j.opacity;const[ht,st]=ye.pageDimensions,Ct=Ge.width*ht,gt=Ge.height*st,bt=ye.scaleFactor,wt=j.thickness/2;rt(Ge,S,Ct/gt),rt(Ge,s,!0),rt(Ge,c,Math.round(Ct)),rt(Ge,d,Math.round(gt));for(const{bezier:_t}of j.paths){const $t=[];Ge.paths.push($t);let Ot=bt*(_t[0]-wt),dn=bt*(gt-_t[1]-wt);for(let tn=2,Tt=_t.length;tn<Tt;tn+=6){const bn=bt*(_t[tn]-wt),Pn=bt*(gt-_t[tn+1]-wt),Nn=bt*(_t[tn+2]-wt),Bn=bt*(gt-_t[tn+3]-wt),Fn=bt*(_t[tn+4]-wt),Xn=bt*(gt-_t[tn+5]-wt);$t.push([[Ot,dn],[bn,Pn],[Nn,Bn],[Fn,Xn]]),Ot=Fn,dn=Xn}const Yt=qe(this,G,xa).call(this,$t);Ge.bezierPath2D.push(Yt)}const Rt=qe(Xt=Ge,Le,Ia).call(Xt);return rt(Ge,y,Math.max(E,Rt[2]-Rt[0])),rt(Ge,A,Math.max(E,Rt[3]-Rt[1])),qe(It=Ge,Ie,Ma).call(It,Ct,gt),Ge}serialize(){if(this.isEmpty())return null;const j=this.getRect(0,0),ye=this.rotation%180===0?j[3]-j[1]:j[2]-j[0],Ge=e.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:r.AnnotationEditorType.INK,color:Ge,thickness:this.thickness,opacity:this.opacity,paths:qe(this,q,ci).call(this,this.scaleFactor/this.parent.scaleFactor,this.translationX,this.translationY,ye),pageIndex:this.parent.pageIndex,rect:j,rotation:this.rotation}}};S=new WeakMap,A=new WeakMap,y=new WeakMap,_=new WeakMap,h=new WeakMap,l=new WeakMap,o=new WeakMap,s=new WeakMap,f=new WeakMap,g=new WeakMap,v=new WeakMap,c=new WeakMap,d=new WeakMap,x=new WeakMap,L=new WeakSet,ti=function(j){const ye=this.thickness;this.parent.addCommands({cmd:()=>{this.thickness=j,qe(this,nt,ir).call(this)},undo:()=>{this.thickness=ye,qe(this,nt,ir).call(this)},mustExec:!0,type:r.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})},N=new WeakSet,ni=function(j){const ye=this.color;this.parent.addCommands({cmd:()=>{this.color=j,qe(this,P,Ln).call(this)},undo:()=>{this.color=ye,qe(this,P,Ln).call(this)},mustExec:!0,type:r.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})},se=new WeakSet,ri=function(j){j/=100;const ye=this.opacity;this.parent.addCommands({cmd:()=>{this.opacity=j,qe(this,P,Ln).call(this)},undo:()=>{this.opacity=ye,qe(this,P,Ln).call(this)},mustExec:!0,type:r.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})},Te=new WeakSet,ai=function(){const{width:j,height:ye,rotation:Ge}=this.parent.viewport;switch(Ge){case 90:return[0,j,j,ye];case 180:return[j,ye,j,ye];case 270:return[ye,0,j,ye];default:return[0,0,j,ye]}},ie=new WeakSet,Ta=function(){this.ctx.lineWidth=this.thickness*this.parent.scaleFactor/this.scaleFactor,this.ctx.lineCap="round",this.ctx.lineJoin="round",this.ctx.miterLimit=10,this.ctx.strokeStyle=`${this.color}${(0,k.opacityToHex)(this.opacity)}`},_e=new WeakSet,ii=function(j,ye){this.isEditing=!0,B(this,f)||(rt(this,f,!0),qe(this,Se,ar).call(this),this.thickness||(this.thickness=ct._defaultThickness),this.color||(this.color=ct._defaultColor||e.AnnotationEditor._defaultLineColor),this.opacity??(this.opacity=ct._defaultOpacity)),this.currentPath.push([j,ye]),rt(this,g,null),qe(this,ie,Ta).call(this),this.ctx.beginPath(),this.ctx.moveTo(j,ye),rt(this,x,()=>{B(this,x)&&(B(this,g)&&(this.isEmpty()?(this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)):qe(this,P,Ln).call(this),this.ctx.lineTo(...B(this,g)),rt(this,g,null),this.ctx.stroke()),window.requestAnimationFrame(B(this,x)))}),window.requestAnimationFrame(B(this,x))},Me=new WeakSet,oi=function(j,ye){const[Ge,ht]=this.currentPath.at(-1);j===Ge&&ye===ht||(this.currentPath.push([j,ye]),rt(this,g,[j,ye]))},K=new WeakSet,si=function(j,ye){var wt;this.ctx.closePath(),rt(this,x,null),j=Math.min(Math.max(j,0),this.canvas.width),ye=Math.min(Math.max(ye,0),this.canvas.height);const[Ge,ht]=this.currentPath.at(-1);(j!==Ge||ye!==ht)&&this.currentPath.push([j,ye]);let st;if(this.currentPath.length!==1)st=(0,p.fitCurve)(this.currentPath,30,null);else{const Rt=[j,ye];st=[[Rt,Rt.slice(),Rt.slice(),Rt]]}const Ct=qe(wt=ct,G,xa).call(wt,st);this.currentPath.length=0;const gt=()=>{this.paths.push(st),this.bezierPath2D.push(Ct),this.rebuild()},bt=()=>{this.paths.pop(),this.bezierPath2D.pop(),this.paths.length===0?this.remove():(this.canvas||(qe(this,te,kr).call(this),qe(this,ve,Tr).call(this)),qe(this,nt,ir).call(this))};this.parent.addCommands({cmd:gt,undo:bt,mustExec:!0})},P=new WeakSet,Ln=function(){if(this.isEmpty()){qe(this,C,Ar).call(this);return}qe(this,ie,Ta).call(this);const{canvas:j,ctx:ye}=this;ye.setTransform(1,0,0,1,0,0),ye.clearRect(0,0,j.width,j.height),qe(this,C,Ar).call(this);for(const Ge of this.bezierPath2D)ye.stroke(Ge)},Y=new WeakSet,Aa=function(j){qe(this,K,si).call(this,j.offsetX,j.offsetY),this.canvas.removeEventListener("pointerleave",B(this,h)),this.canvas.removeEventListener("pointermove",B(this,_)),this.parent.addToAnnotationStorage(this)},te=new WeakSet,kr=function(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",ct._l10nPromise.get("editor_ink_canvas_aria_label").then(j=>{var ye;return(ye=this.canvas)==null?void 0:ye.setAttribute("aria-label",j)}),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")},ve=new WeakSet,Tr=function(){let j=null;rt(this,v,new ResizeObserver(ye=>{const Ge=ye[0].contentRect;Ge.width&&Ge.height&&(j!==null&&clearTimeout(j),j=setTimeout(()=>{this.fixDims(),j=null},b),this.setDimensions(Ge.width,Ge.height))})),B(this,v).observe(this.div)},Se=new WeakSet,ar=function(){if(!B(this,f))return;const[j,ye]=this.parent.viewportBaseDimensions;this.canvas.width=Math.ceil(this.width*j),this.canvas.height=Math.ceil(this.height*ye),qe(this,C,Ar).call(this)},Ie=new WeakSet,Ma=function(j,ye){const Ge=qe(this,ce,Mr).call(this),ht=(j-Ge)/B(this,y),st=(ye-Ge)/B(this,A);this.scaleFactor=Math.min(ht,st)},C=new WeakSet,Ar=function(){const j=qe(this,ce,Mr).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+j,this.translationY*this.scaleFactor+j)},G=new WeakSet,xa=function(j){const ye=new Path2D;for(let Ge=0,ht=j.length;Ge<ht;Ge++){const[st,Ct,gt,bt]=j[Ge];Ge===0&&ye.moveTo(...st),ye.bezierCurveTo(Ct[0],Ct[1],gt[0],gt[1],bt[0],bt[1])}return ye},q=new WeakSet,ci=function(j,ye,Ge,ht){const Ct=[],gt=this.thickness/2;let bt,wt;for(const Rt of this.paths){bt=[],wt=[];for(let Xt=0,It=Rt.length;Xt<It;Xt++){const[_t,$t,Ot,dn]=Rt[Xt],Yt=j*(_t[0]+ye)+gt,tn=ht-j*(_t[1]+Ge)-gt,Tt=j*($t[0]+ye)+gt,bn=ht-j*($t[1]+Ge)-gt,Pn=j*(Ot[0]+ye)+gt,Nn=ht-j*(Ot[1]+Ge)-gt,Bn=j*(dn[0]+ye)+gt,Fn=ht-j*(dn[1]+Ge)-gt;Xt===0&&(bt.push(Yt,tn),wt.push(Yt,tn)),bt.push(Tt,bn,Pn,Nn,Bn,Fn),qe(this,Be,li).call(this,Yt,tn,Tt,bn,Pn,Nn,Bn,Fn,4,wt)}Ct.push({bezier:bt,points:wt})}return Ct},Be=new WeakSet,li=function(j,ye,Ge,ht,st,Ct,gt,bt,wt,Rt){if(qe(this,pe,ui).call(this,j,ye,Ge,ht,st,Ct,gt,bt)){Rt.push(gt,bt);return}for(let Xt=1;Xt<wt-1;Xt++){const It=Xt/wt,_t=1-It;let $t=It*j+_t*Ge,Ot=It*ye+_t*ht,dn=It*Ge+_t*st,Yt=It*ht+_t*Ct;const tn=It*st+_t*gt,Tt=It*Ct+_t*bt;$t=It*$t+_t*dn,Ot=It*Ot+_t*Yt,dn=It*dn+_t*tn,Yt=It*Yt+_t*Tt,$t=It*$t+_t*dn,Ot=It*Ot+_t*Yt,Rt.push($t,Ot)}Rt.push(gt,bt)},pe=new WeakSet,ui=function(j,ye,Ge,ht,st,Ct,gt,bt){const Rt=(3*Ge-2*j-gt)**2,Xt=(3*ht-2*ye-bt)**2,It=(3*st-j-2*gt)**2,_t=(3*Ct-ye-2*bt)**2;return Math.max(Rt,It)+Math.max(Xt,_t)<=10},Le=new WeakSet,Ia=function(){let j=1/0,ye=-1/0,Ge=1/0,ht=-1/0;for(const st of this.paths)for(const[Ct,gt,bt,wt]of st){const Rt=r.Util.bezierBoundingBox(...Ct,...gt,...bt,...wt);j=Math.min(j,Rt[0]),Ge=Math.min(Ge,Rt[1]),ye=Math.max(ye,Rt[2]),ht=Math.max(ht,Rt[3])}return[j,Ge,ye,ht]},ce=new WeakSet,Mr=function(){return B(this,s)?Math.ceil(this.thickness*this.parent.scaleFactor):0},nt=new WeakSet,ir=function(j=!1){if(this.isEmpty())return;if(!B(this,s)){qe(this,P,Ln).call(this);return}const ye=qe(this,Le,Ia).call(this),Ge=qe(this,ce,Mr).call(this);rt(this,y,Math.max(E,ye[2]-ye[0])),rt(this,A,Math.max(E,ye[3]-ye[1]));const ht=Math.ceil(Ge+B(this,y)*this.scaleFactor),st=Math.ceil(Ge+B(this,A)*this.scaleFactor),[Ct,gt]=this.parent.viewportBaseDimensions;this.width=ht/Ct,this.height=st/gt,rt(this,S,ht/st),qe(this,Et,$a).call(this);const bt=this.translationX,wt=this.translationY;this.translationX=-ye[0],this.translationY=-ye[1],qe(this,Se,ar).call(this),qe(this,P,Ln).call(this),rt(this,c,ht),rt(this,d,st),this.setDims(ht,st);const Rt=j?Ge/this.scaleFactor/2:0;this.translate(bt-this.translationX-Rt,wt-this.translationY-Rt)},Et=new WeakSet,$a=function(){const{style:j}=this.div;B(this,S)>=1?(j.minHeight=`${E}px`,j.minWidth=`${Math.round(B(this,S)*E)}px`):(j.minWidth=`${E}px`,j.minHeight=`${Math.round(E/B(this,S))}px`)},De(ct,G),an(ct,"_defaultColor",null),an(ct,"_defaultOpacity",1),an(ct,"_defaultThickness",1),an(ct,"_l10nPromise"),an(ct,"_type","ink");let R=ct;n.InkEditor=R},(t,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.fitCurve=void 0;const r=a(25);n.fitCurve=r},t=>{function n(h,l,o){if(!Array.isArray(h))throw new TypeError("First argument should be an array");if(h.forEach(v=>{if(!Array.isArray(v)||v.some(c=>typeof c!="number")||v.length!==h[0].length)throw Error("Each point should be an array of numbers. Each point should have the same amount of numbers.")}),h=h.filter((v,c)=>c===0||!v.every((d,x)=>d===h[c-1][x])),h.length<2)return[];const s=h.length,f=A(h[1],h[0]),g=A(h[s-2],h[s-1]);return a(h,f,g,l,o)}function a(h,l,o,s,f){var v,c,d,x,L,X,N,D,se,Ae,Te,le,ie;if(h.length===2)return le=y.vectorLen(y.subtract(h[0],h[1]))/3,v=[h[0],y.addArrays(h[0],y.mulItems(l,le)),y.addArrays(h[1],y.mulItems(o,le)),h[1]],[v];if(c=E(h),[v,x,X]=r(h,c,c,l,o,f),x===0||x<s)return[v];if(x<s*s)for(d=c,L=x,N=X,ie=0;ie<20;ie++){if(d=p(v,h,d),[v,x,X]=r(h,c,d,l,o,f),x<s)return[v];if(X===N){let fe=x/L;if(fe>.9999&&fe<1.0001)break}L=x,N=X}return Te=[],D=y.subtract(h[X-1],h[X+1]),D.every(fe=>fe===0)&&(D=y.subtract(h[X-1],h[X]),[D[0],D[1]]=[-D[1],D[0]]),se=y.normalize(D),Ae=y.mulItems(se,-1),Te=Te.concat(a(h.slice(0,X+1),l,se,s,f)),Te=Te.concat(a(h.slice(X),Ae,o,s,f)),Te}function r(h,l,o,s,f,g){var v,c,d;return v=e(h,o,s,f),[c,d]=b(h,v,l),g&&g({bez:v,points:h,params:l,maxErr:c,maxPoint:d}),[v,c,d]}function e(h,l,o,s){var f,g,v,c,d,x,L,X,N,D,se,Ae,Te,le,ie,fe,_e,oe=h[0],Me=h[h.length-1];for(f=[oe,null,null,Me],g=y.zeros_Xx2x2(l.length),Te=0,le=l.length;Te<le;Te++)fe=l[Te],_e=1-fe,v=g[Te],v[0]=y.mulItems(o,3*fe*(_e*_e)),v[1]=y.mulItems(s,3*_e*(fe*fe));for(c=[[0,0],[0,0]],d=[0,0],Te=0,le=h.length;Te<le;Te++)fe=l[Te],v=g[Te],c[0][0]+=y.dot(v[0],v[0]),c[0][1]+=y.dot(v[0],v[1]),c[1][0]+=y.dot(v[0],v[1]),c[1][1]+=y.dot(v[1],v[1]),ie=y.subtract(h[Te],_.q([oe,oe,Me,Me],fe)),d[0]+=y.dot(v[0],ie),d[1]+=y.dot(v[1],ie);return x=c[0][0]*c[1][1]-c[1][0]*c[0][1],L=c[0][0]*d[1]-c[1][0]*d[0],X=d[0]*c[1][1]-d[1]*c[0][1],N=x===0?0:X/x,D=x===0?0:L/x,Ae=y.vectorLen(y.subtract(oe,Me)),se=1e-6*Ae,N<se||D<se?(f[1]=y.addArrays(oe,y.mulItems(o,Ae/3)),f[2]=y.addArrays(Me,y.mulItems(s,Ae/3))):(f[1]=y.addArrays(oe,y.mulItems(o,N)),f[2]=y.addArrays(Me,y.mulItems(s,D))),f}function p(h,l,o){return o.map((s,f)=>k(h,l[f],s))}function k(h,l,o){var s=y.subtract(_.q(h,o),l),f=_.qprime(h,o),g=y.mulMatrix(s,f),v=y.sum(y.squareItems(f))+2*y.mulMatrix(s,_.qprimeprime(h,o));return v===0?o:o-g/v}function E(h){var l=[],o,s,f;return h.forEach((g,v)=>{o=v?s+y.vectorLen(y.subtract(g,f)):0,l.push(o),s=o,f=g}),l=l.map(g=>g/s),l}function b(h,l,o){var s,f,g,v,c,d,x,L;f=0,g=Math.floor(h.length/2);const X=R(l,10);for(c=0,d=h.length;c<d;c++)x=h[c],L=S(l,o[c],X,10),v=y.subtract(_.q(l,L),x),s=v[0]*v[0]+v[1]*v[1],s>f&&(f=s,g=c);return[f,g]}var R=function(h,l){for(var o,s=[0],f=h[0],g=0,v=1;v<=l;v++)o=_.q(h,v/l),g+=y.vectorLen(y.subtract(o,f)),s.push(g),f=o;return s=s.map(c=>c/g),s};function S(h,l,o,s){if(l<0)return 0;if(l>1)return 1;for(var f,g,v,c,d,x=1;x<=s;x++)if(l<=o[x]){c=(x-1)/s,v=x/s,g=o[x-1],f=o[x],d=(l-g)/(f-g)*(v-c)+c;break}return d}function A(h,l){return y.normalize(y.subtract(h,l))}class y{static zeros_Xx2x2(l){for(var o=[];l--;)o.push([0,0]);return o}static mulItems(l,o){return l.map(s=>s*o)}static mulMatrix(l,o){return l.reduce((s,f,g)=>s+f*o[g],0)}static subtract(l,o){return l.map((s,f)=>s-o[f])}static addArrays(l,o){return l.map((s,f)=>s+o[f])}static addItems(l,o){return l.map(s=>s+o)}static sum(l){return l.reduce((o,s)=>o+s)}static dot(l,o){return y.mulMatrix(l,o)}static vectorLen(l){return Math.hypot(...l)}static divItems(l,o){return l.map(s=>s/o)}static squareItems(l){return l.map(o=>o*o)}static normalize(l){return this.divItems(l,this.vectorLen(l))}}class _{static q(l,o){var s=1-o,f=y.mulItems(l[0],s*s*s),g=y.mulItems(l[1],3*s*s*o),v=y.mulItems(l[2],3*s*o*o),c=y.mulItems(l[3],o*o*o);return y.addArrays(y.addArrays(f,g),y.addArrays(v,c))}static qprime(l,o){var s=1-o,f=y.mulItems(y.subtract(l[1],l[0]),3*s*s),g=y.mulItems(y.subtract(l[2],l[1]),6*s*o),v=y.mulItems(y.subtract(l[3],l[2]),3*o*o);return y.addArrays(y.addArrays(f,g),v)}static qprimeprime(l,o){return y.addArrays(y.mulItems(y.addArrays(y.subtract(l[2],y.mulItems(l[1],2)),l[0]),6*(1-o)),y.mulItems(y.addArrays(y.subtract(l[3],y.mulItems(l[2],2)),l[1]),6*o))}}t.exports=n,t.exports.fitCubic=a,t.exports.createTangent=A},(t,n,a)=>{var T,Kn,$,di,te,Oa,ve,La,Se,Fa;Object.defineProperty(n,"__esModule",{value:!0}),n.AnnotationLayer=void 0;var r=a(1),e=a(6),p=a(3),k=a(27),E=a(28);const b=1e3,R=9,S=new WeakSet;function A(ze){return{width:ze[2]-ze[0],height:ze[3]-ze[1]}}class y{static create(C){switch(C.data.annotationType){case r.AnnotationType.LINK:return new h(C);case r.AnnotationType.TEXT:return new l(C);case r.AnnotationType.WIDGET:switch(C.data.fieldType){case"Tx":return new s(C);case"Btn":return C.data.radioButton?new g(C):C.data.checkBox?new f(C):new v(C);case"Ch":return new c(C)}return new o(C);case r.AnnotationType.POPUP:return new d(C);case r.AnnotationType.FREETEXT:return new L(C);case r.AnnotationType.LINE:return new X(C);case r.AnnotationType.SQUARE:return new N(C);case r.AnnotationType.CIRCLE:return new D(C);case r.AnnotationType.POLYLINE:return new se(C);case r.AnnotationType.CARET:return new Te(C);case r.AnnotationType.INK:return new le(C);case r.AnnotationType.POLYGON:return new Ae(C);case r.AnnotationType.HIGHLIGHT:return new ie(C);case r.AnnotationType.UNDERLINE:return new fe(C);case r.AnnotationType.SQUIGGLY:return new _e(C);case r.AnnotationType.STRIKEOUT:return new oe(C);case r.AnnotationType.STAMP:return new Me(C);case r.AnnotationType.FILEATTACHMENT:return new xe(C);default:return new _(C)}}}class _{constructor(C,{isRenderable:I=!1,ignoreBorder:G=!1,createQuadrilaterals:z=!1}={}){this.isRenderable=I,this.data=C.data,this.layer=C.layer,this.page=C.page,this.viewport=C.viewport,this.linkService=C.linkService,this.downloadManager=C.downloadManager,this.imageResourcesPath=C.imageResourcesPath,this.renderForms=C.renderForms,this.svgFactory=C.svgFactory,this.annotationStorage=C.annotationStorage,this.enableScripting=C.enableScripting,this.hasJSActions=C.hasJSActions,this._fieldObjects=C.fieldObjects,this._mouseState=C.mouseState,I&&(this.container=this._createContainer(G)),z&&(this.quadrilaterals=this._createQuadrilaterals(G))}_createContainer(C=!1){const I=this.data,G=this.page,z=this.viewport,q=document.createElement("section"),{width:ge,height:Be}=A(I.rect),[Ze,pe,ot,Le]=z.viewBox,Ye=ot-Ze,ce=Le-pe;q.setAttribute("data-annotation-id",I.id);const We=r.Util.normalizeRect([I.rect[0],G.view[3]-I.rect[1]+G.view[1],I.rect[2],G.view[3]-I.rect[3]+G.view[1]]);if(!C&&I.borderStyle.width>0){q.style.borderWidth=`${I.borderStyle.width}px`;const ut=I.borderStyle.horizontalCornerRadius,Et=I.borderStyle.verticalCornerRadius;if(ut>0||Et>0){const ct=`calc(${ut}px * var(--scale-factor)) / calc(${Et}px * var(--scale-factor))`;q.style.borderRadius=ct}else if(this instanceof g){const ct=`calc(${ge}px * var(--scale-factor)) / calc(${Be}px * var(--scale-factor))`;q.style.borderRadius=ct}switch(I.borderStyle.style){case r.AnnotationBorderStyleType.SOLID:q.style.borderStyle="solid";break;case r.AnnotationBorderStyleType.DASHED:q.style.borderStyle="dashed";break;case r.AnnotationBorderStyleType.BEVELED:(0,r.warn)("Unimplemented border style: beveled");break;case r.AnnotationBorderStyleType.INSET:(0,r.warn)("Unimplemented border style: inset");break;case r.AnnotationBorderStyleType.UNDERLINE:q.style.borderBottomStyle="solid";break}const kt=I.borderColor||null;kt?q.style.borderColor=r.Util.makeHexColor(kt[0]|0,kt[1]|0,kt[2]|0):q.style.borderWidth=0}q.style.left=`${100*(We[0]-Ze)/Ye}%`,q.style.top=`${100*(We[1]-pe)/ce}%`;const{rotation:nt}=I;return I.hasOwnCanvas||nt===0?(q.style.width=`${100*ge/Ye}%`,q.style.height=`${100*Be/ce}%`):this.setRotation(nt,q),q}setRotation(C,I=this.container){const[G,z,q,ge]=this.viewport.viewBox,Be=q-G,Ze=ge-z,{width:pe,height:ot}=A(this.data.rect);let Le,Ye;C%180===0?(Le=100*pe/Be,Ye=100*ot/Ze):(Le=100*ot/Be,Ye=100*pe/Ze),I.style.width=`${Le}%`,I.style.height=`${Ye}%`,I.setAttribute("data-main-rotation",(360-C)%360)}get _commonActions(){const C=(I,G,z)=>{const q=z.detail[I];z.target.style[G]=k.ColorConverters[`${q[0]}_HTML`](q.slice(1))};return(0,r.shadow)(this,"_commonActions",{display:I=>{const G=I.detail.display%2===1;this.container.style.visibility=G?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:G,print:I.detail.display===0||I.detail.display===3})},print:I=>{this.annotationStorage.setValue(this.data.id,{print:I.detail.print})},hidden:I=>{this.container.style.visibility=I.detail.hidden?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:I.detail.hidden})},focus:I=>{setTimeout(()=>I.target.focus({preventScroll:!1}),0)},userName:I=>{I.target.title=I.detail.userName},readonly:I=>{I.detail.readonly?I.target.setAttribute("readonly",""):I.target.removeAttribute("readonly")},required:I=>{this._setRequired(I.target,I.detail.required)},bgColor:I=>{C("bgColor","backgroundColor",I)},fillColor:I=>{C("fillColor","backgroundColor",I)},fgColor:I=>{C("fgColor","color",I)},textColor:I=>{C("textColor","color",I)},borderColor:I=>{C("borderColor","borderColor",I)},strokeColor:I=>{C("strokeColor","borderColor",I)},rotation:I=>{const G=I.detail.rotation;this.setRotation(G),this.annotationStorage.setValue(this.data.id,{rotation:G})}})}_dispatchEventFromSandbox(C,I){const G=this._commonActions;for(const z of Object.keys(I.detail)){const q=C[z]||G[z];q==null||q(I)}}_setDefaultPropertiesFromJS(C){if(!this.enableScripting)return;const I=this.annotationStorage.getRawValue(this.data.id);if(!I)return;const G=this._commonActions;for(const[z,q]of Object.entries(I)){const ge=G[z];if(ge){const Be={detail:{[z]:q},target:C};ge(Be),delete I[z]}}}_createQuadrilaterals(C=!1){if(!this.data.quadPoints)return null;const I=[],G=this.data.rect;for(const z of this.data.quadPoints)this.data.rect=[z[2].x,z[2].y,z[1].x,z[1].y],I.push(this._createContainer(C));return this.data.rect=G,I}_createPopup(C,I){let G=this.container;this.quadrilaterals&&(C=C||this.quadrilaterals,G=this.quadrilaterals[0]),C||(C=document.createElement("div"),C.className="popupTriggerArea",G.append(C));const q=new x({container:G,trigger:C,color:I.color,titleObj:I.titleObj,modificationDate:I.modificationDate,contentsObj:I.contentsObj,richText:I.richText,hideWrapper:!0}).render();q.style.left="100%",G.append(q)}_renderQuadrilaterals(C){for(const I of this.quadrilaterals)I.className=C;return this.quadrilaterals}render(){(0,r.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(C,I=null){const G=[];if(this._fieldObjects){const z=this._fieldObjects[C];if(z)for(const{page:q,id:ge,exportValues:Be}of z){if(q===-1||ge===I)continue;const Ze=typeof Be=="string"?Be:null,pe=document.querySelector(`[data-element-id="${ge}"]`);if(pe&&!S.has(pe)){(0,r.warn)(`_getElementsByName - element not allowed: ${ge}`);continue}G.push({id:ge,exportValue:Ze,domElement:pe})}return G}for(const z of document.getElementsByName(C)){const{exportValue:q}=z,ge=z.getAttribute("data-element-id");ge!==I&&S.has(z)&&G.push({id:ge,exportValue:q,domElement:z})}return G}static get platform(){const C=typeof navigator<"u"?navigator.platform:"";return(0,r.shadow)(this,"platform",{isWin:C.includes("Win"),isMac:C.includes("Mac")})}}class h extends _{constructor(I,G=null){super(I,{isRenderable:!0,ignoreBorder:!!(G!=null&&G.ignoreBorder),createQuadrilaterals:!0});De(this,T);De(this,$);this.isTooltipOnly=I.data.isTooltipOnly}render(){const{data:I,linkService:G}=this,z=document.createElement("a");z.setAttribute("data-element-id",I.id);let q=!1;return I.url?(G.addLinkAttributes(z,I.url,I.newWindow),q=!0):I.action?(this._bindNamedAction(z,I.action),q=!0):I.attachment?(this._bindAttachment(z,I.attachment),q=!0):I.setOCGState?(qe(this,$,di).call(this,z,I.setOCGState),q=!0):I.dest?(this._bindLink(z,I.dest),q=!0):(I.actions&&(I.actions.Action||I.actions["Mouse Up"]||I.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(z,I),q=!0),I.resetForm?(this._bindResetFormAction(z,I.resetForm),q=!0):this.isTooltipOnly&&!q&&(this._bindLink(z,""),q=!0)),this.quadrilaterals?this._renderQuadrilaterals("linkAnnotation").map((ge,Be)=>{const Ze=Be===0?z:z.cloneNode();return ge.append(Ze),ge}):(this.container.className="linkAnnotation",q&&this.container.append(z),this.container)}_bindLink(I,G){I.href=this.linkService.getDestinationHash(G),I.onclick=()=>(G&&this.linkService.goToDestination(G),!1),(G||G==="")&&qe(this,T,Kn).call(this)}_bindNamedAction(I,G){I.href=this.linkService.getAnchorUrl(""),I.onclick=()=>(this.linkService.executeNamedAction(G),!1),qe(this,T,Kn).call(this)}_bindAttachment(I,G){I.href=this.linkService.getAnchorUrl(""),I.onclick=()=>{var z;return(z=this.downloadManager)==null||z.openOrDownloadData(this.container,G.content,G.filename),!1},qe(this,T,Kn).call(this)}_bindJSAction(I,G){I.href=this.linkService.getAnchorUrl("");const z=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const q of Object.keys(G.actions)){const ge=z.get(q);ge&&(I[ge]=()=>{var Be;return(Be=this.linkService.eventBus)==null||Be.dispatch("dispatcheventinsandbox",{source:this,detail:{id:G.id,name:q}}),!1})}I.onclick||(I.onclick=()=>!1),qe(this,T,Kn).call(this)}_bindResetFormAction(I,G){const z=I.onclick;if(z||(I.href=this.linkService.getAnchorUrl("")),qe(this,T,Kn).call(this),!this._fieldObjects){(0,r.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),z||(I.onclick=()=>!1);return}I.onclick=()=>{var Le;z==null||z();const{fields:q,refs:ge,include:Be}=G,Ze=[];if(q.length!==0||ge.length!==0){const Ye=new Set(ge);for(const ce of q){const We=this._fieldObjects[ce]||[];for(const{id:nt}of We)Ye.add(nt)}for(const ce of Object.values(this._fieldObjects))for(const We of ce)Ye.has(We.id)===Be&&Ze.push(We)}else for(const Ye of Object.values(this._fieldObjects))Ze.push(...Ye);const pe=this.annotationStorage,ot=[];for(const Ye of Ze){const{id:ce}=Ye;switch(ot.push(ce),Ye.type){case"text":{const nt=Ye.defaultValue||"";pe.setValue(ce,{value:nt});break}case"checkbox":case"radiobutton":{const nt=Ye.defaultValue===Ye.exportValues;pe.setValue(ce,{value:nt});break}case"combobox":case"listbox":{const nt=Ye.defaultValue||"";pe.setValue(ce,{value:nt});break}default:continue}const We=document.querySelector(`[data-element-id="${ce}"]`);if(We){if(!S.has(We)){(0,r.warn)(`_bindResetFormAction - element not allowed: ${ce}`);continue}}else continue;We.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((Le=this.linkService.eventBus)==null||Le.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:ot,name:"ResetForm"}})),!1}}}T=new WeakSet,Kn=function(){this.container.setAttribute("data-internal-link","")},$=new WeakSet,di=function(I,G){I.href=this.linkService.getAnchorUrl(""),I.onclick=()=>(this.linkService.executeSetOCGState(G),!1),qe(this,T,Kn).call(this)};class l extends _{constructor(C){var G,z,q;const I=!!(C.data.hasPopup||(G=C.data.titleObj)!=null&&G.str||(z=C.data.contentsObj)!=null&&z.str||(q=C.data.richText)!=null&&q.str);super(C,{isRenderable:I})}render(){this.container.className="textAnnotation";const C=document.createElement("img");return C.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",C.alt="[{{type}} Annotation]",C.dataset.l10nId="text_annotation_type",C.dataset.l10nArgs=JSON.stringify({type:this.data.name}),this.data.hasPopup||this._createPopup(C,this.data),this.container.append(C),this.container}}class o extends _{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}_getKeyModifier(C){const{isWin:I,isMac:G}=_.platform;return I&&C.ctrlKey||G&&C.metaKey}_setEventListener(C,I,G,z){I.includes("mouse")?C.addEventListener(I,q=>{var ge;(ge=this.linkService.eventBus)==null||ge.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:G,value:z(q),shift:q.shiftKey,modifier:this._getKeyModifier(q)}})}):C.addEventListener(I,q=>{var ge;(ge=this.linkService.eventBus)==null||ge.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:G,value:z(q)}})})}_setEventListeners(C,I,G){var z;for(const[q,ge]of I)(ge==="Action"||(z=this.data.actions)!=null&&z[ge])&&this._setEventListener(C,q,ge,G)}_setBackgroundColor(C){const I=this.data.backgroundColor||null;C.style.backgroundColor=I===null?"transparent":r.Util.makeHexColor(I[0],I[1],I[2])}_setTextStyle(C){const I=["left","center","right"],{fontColor:G}=this.data.defaultAppearanceData,z=this.data.defaultAppearanceData.fontSize||R,q=C.style;let ge;const Be=2,Ze=pe=>Math.round(10*pe)/10;if(this.data.multiLine){const pe=Math.abs(this.data.rect[3]-this.data.rect[1]-Be),ot=Math.round(pe/(r.LINE_FACTOR*z))||1,Le=pe/ot;ge=Math.min(z,Ze(Le/r.LINE_FACTOR))}else{const pe=Math.abs(this.data.rect[3]-this.data.rect[1]-Be);ge=Math.min(z,Ze(pe/r.LINE_FACTOR))}q.fontSize=`calc(${ge}px * var(--scale-factor))`,q.color=r.Util.makeHexColor(G[0],G[1],G[2]),this.data.textAlignment!==null&&(q.textAlign=I[this.data.textAlignment])}_setRequired(C,I){I?C.setAttribute("required",!0):C.removeAttribute("required"),C.setAttribute("aria-required",I)}}class s extends o{constructor(C){const I=C.renderForms||!C.data.hasAppearance&&!!C.data.fieldValue;super(C,{isRenderable:I})}setPropertyOnSiblings(C,I,G,z){const q=this.annotationStorage;for(const ge of this._getElementsByName(C.name,C.id))ge.domElement&&(ge.domElement[I]=G),q.setValue(ge.id,{[z]:G})}render(){var z;const C=this.annotationStorage,I=this.data.id;this.container.className="textWidgetAnnotation";let G=null;if(this.renderForms){const q=C.getValue(I,{value:this.data.fieldValue});let ge=q.formattedValue||q.value||"";const Be=C.getValue(I,{charLimit:this.data.maxLen}).charLimit;Be&&ge.length>Be&&(ge=ge.slice(0,Be));const Ze={userValue:ge,formattedValue:null,valueOnFocus:""};this.data.multiLine?(G=document.createElement("textarea"),G.textContent=ge,this.data.doNotScroll&&(G.style.overflowY="hidden")):(G=document.createElement("input"),G.type="text",G.setAttribute("value",ge),this.data.doNotScroll&&(G.style.overflowX="hidden")),S.add(G),G.setAttribute("data-element-id",I),G.disabled=this.data.readOnly,G.name=this.data.fieldName,G.tabIndex=b,this._setRequired(G,this.data.required),Be&&(G.maxLength=Be),G.addEventListener("input",ot=>{C.setValue(I,{value:ot.target.value}),this.setPropertyOnSiblings(G,"value",ot.target.value,"value")}),G.addEventListener("resetform",ot=>{const Le=this.data.defaultFieldValue??"";G.value=Ze.userValue=Le,Ze.formattedValue=null});let pe=ot=>{const{formattedValue:Le}=Ze;Le!=null&&(ot.target.value=Le),ot.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){G.addEventListener("focus",Le=>{Ze.userValue&&(Le.target.value=Ze.userValue),Ze.valueOnFocus=Le.target.value}),G.addEventListener("updatefromsandbox",Le=>{const Ye={value(ce){Ze.userValue=ce.detail.value??"",C.setValue(I,{value:Ze.userValue.toString()}),ce.target.value=Ze.userValue},formattedValue(ce){const{formattedValue:We}=ce.detail;Ze.formattedValue=We,We!=null&&ce.target!==document.activeElement&&(ce.target.value=We),C.setValue(I,{formattedValue:We})},selRange(ce){ce.target.setSelectionRange(...ce.detail.selRange)},charLimit:ce=>{var Et;const{charLimit:We}=ce.detail,{target:nt}=ce;if(We===0){nt.removeAttribute("maxLength");return}nt.setAttribute("maxLength",We);let ut=Ze.userValue;!ut||ut.length<=We||(ut=ut.slice(0,We),nt.value=Ze.userValue=ut,C.setValue(I,{value:ut}),(Et=this.linkService.eventBus)==null||Et.dispatch("dispatcheventinsandbox",{source:this,detail:{id:I,name:"Keystroke",value:ut,willCommit:!0,commitKey:1,selStart:nt.selectionStart,selEnd:nt.selectionEnd}}))}};this._dispatchEventFromSandbox(Ye,Le)}),G.addEventListener("keydown",Le=>{var We;let Ye=-1;if(Le.key==="Escape"?Ye=0:Le.key==="Enter"&&!this.data.multiLine?Ye=2:Le.key==="Tab"&&(Ye=3),Ye===-1)return;const{value:ce}=Le.target;Ze.valueOnFocus!==ce&&(Ze.userValue=ce,(We=this.linkService.eventBus)==null||We.dispatch("dispatcheventinsandbox",{source:this,detail:{id:I,name:"Keystroke",value:ce,willCommit:!0,commitKey:Ye,selStart:Le.target.selectionStart,selEnd:Le.target.selectionEnd}}))});const ot=pe;pe=null,G.addEventListener("blur",Le=>{var ce;const{value:Ye}=Le.target;Ze.userValue=Ye,this._mouseState.isDown&&Ze.valueOnFocus!==Ye&&((ce=this.linkService.eventBus)==null||ce.dispatch("dispatcheventinsandbox",{source:this,detail:{id:I,name:"Keystroke",value:Ye,willCommit:!0,commitKey:1,selStart:Le.target.selectionStart,selEnd:Le.target.selectionEnd}})),ot(Le)}),(z=this.data.actions)!=null&&z.Keystroke&&G.addEventListener("beforeinput",Le=>{var ct;const{data:Ye,target:ce}=Le,{value:We,selectionStart:nt,selectionEnd:ut}=ce;let Et=nt,kt=ut;switch(Le.inputType){case"deleteWordBackward":{const Ve=We.substring(0,nt).match(/\w*[^\w]*$/);Ve&&(Et-=Ve[0].length);break}case"deleteWordForward":{const Ve=We.substring(nt).match(/^[^\w]*\w*/);Ve&&(kt+=Ve[0].length);break}case"deleteContentBackward":nt===ut&&(Et-=1);break;case"deleteContentForward":nt===ut&&(kt+=1);break}Le.preventDefault(),(ct=this.linkService.eventBus)==null||ct.dispatch("dispatcheventinsandbox",{source:this,detail:{id:I,name:"Keystroke",value:We,change:Ye||"",willCommit:!1,selStart:Et,selEnd:kt}})}),this._setEventListeners(G,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],Le=>Le.target.value)}if(pe&&G.addEventListener("blur",pe),this.data.comb){const Le=(this.data.rect[2]-this.data.rect[0])/Be;G.classList.add("comb"),G.style.letterSpacing=`calc(${Le}px * var(--scale-factor) - 1ch)`}}else G=document.createElement("div"),G.textContent=this.data.fieldValue,G.style.verticalAlign="middle",G.style.display="table-cell";return this._setTextStyle(G),this._setBackgroundColor(G),this._setDefaultPropertiesFromJS(G),this.container.append(G),this.container}}class f extends o{constructor(C){super(C,{isRenderable:C.renderForms})}render(){const C=this.annotationStorage,I=this.data,G=I.id;let z=C.getValue(G,{value:I.exportValue===I.fieldValue}).value;typeof z=="string"&&(z=z!=="Off",C.setValue(G,{value:z})),this.container.className="buttonWidgetAnnotation checkBox";const q=document.createElement("input");return S.add(q),q.setAttribute("data-element-id",G),q.disabled=I.readOnly,this._setRequired(q,this.data.required),q.type="checkbox",q.name=I.fieldName,z&&q.setAttribute("checked",!0),q.setAttribute("exportValue",I.exportValue),q.tabIndex=b,q.addEventListener("change",ge=>{const{name:Be,checked:Ze}=ge.target;for(const pe of this._getElementsByName(Be,G)){const ot=Ze&&pe.exportValue===I.exportValue;pe.domElement&&(pe.domElement.checked=ot),C.setValue(pe.id,{value:ot})}C.setValue(G,{value:Ze})}),q.addEventListener("resetform",ge=>{const Be=I.defaultFieldValue||"Off";ge.target.checked=Be===I.exportValue}),this.enableScripting&&this.hasJSActions&&(q.addEventListener("updatefromsandbox",ge=>{const Be={value(Ze){Ze.target.checked=Ze.detail.value!=="Off",C.setValue(G,{value:Ze.target.checked})}};this._dispatchEventFromSandbox(Be,ge)}),this._setEventListeners(q,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],ge=>ge.target.checked)),this._setBackgroundColor(q),this._setDefaultPropertiesFromJS(q),this.container.append(q),this.container}}class g extends o{constructor(C){super(C,{isRenderable:C.renderForms})}render(){this.container.className="buttonWidgetAnnotation radioButton";const C=this.annotationStorage,I=this.data,G=I.id;let z=C.getValue(G,{value:I.fieldValue===I.buttonValue}).value;typeof z=="string"&&(z=z!==I.buttonValue,C.setValue(G,{value:z}));const q=document.createElement("input");if(S.add(q),q.setAttribute("data-element-id",G),q.disabled=I.readOnly,this._setRequired(q,this.data.required),q.type="radio",q.name=I.fieldName,z&&q.setAttribute("checked",!0),q.tabIndex=b,q.addEventListener("change",ge=>{const{name:Be,checked:Ze}=ge.target;for(const pe of this._getElementsByName(Be,G))C.setValue(pe.id,{value:!1});C.setValue(G,{value:Ze})}),q.addEventListener("resetform",ge=>{const Be=I.defaultFieldValue;ge.target.checked=Be!=null&&Be===I.buttonValue}),this.enableScripting&&this.hasJSActions){const ge=I.buttonValue;q.addEventListener("updatefromsandbox",Be=>{const Ze={value:pe=>{const ot=ge===pe.detail.value;for(const Le of this._getElementsByName(pe.target.name)){const Ye=ot&&Le.id===G;Le.domElement&&(Le.domElement.checked=Ye),C.setValue(Le.id,{value:Ye})}}};this._dispatchEventFromSandbox(Ze,Be)}),this._setEventListeners(q,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],Be=>Be.target.checked)}return this._setBackgroundColor(q),this._setDefaultPropertiesFromJS(q),this.container.append(q),this.container}}class v extends h{constructor(C){super(C,{ignoreBorder:C.data.hasAppearance})}render(){const C=super.render();C.className="buttonWidgetAnnotation pushButton",this.data.alternativeText&&(C.title=this.data.alternativeText);const I=C.lastChild;return this.enableScripting&&this.hasJSActions&&I&&(this._setDefaultPropertiesFromJS(I),I.addEventListener("updatefromsandbox",G=>{this._dispatchEventFromSandbox({},G)})),C}}class c extends o{constructor(C){super(C,{isRenderable:C.renderForms})}render(){this.container.className="choiceWidgetAnnotation";const C=this.annotationStorage,I=this.data.id,G=C.getValue(I,{value:this.data.fieldValue}),z=document.createElement("select");S.add(z),z.setAttribute("data-element-id",I),z.disabled=this.data.readOnly,this._setRequired(z,this.data.required),z.name=this.data.fieldName,z.tabIndex=b;let q=this.data.combo&&this.data.options.length>0;this.data.combo||(z.size=this.data.options.length,this.data.multiSelect&&(z.multiple=!0)),z.addEventListener("resetform",pe=>{const ot=this.data.defaultFieldValue;for(const Le of z.options)Le.selected=Le.value===ot});for(const pe of this.data.options){const ot=document.createElement("option");ot.textContent=pe.displayValue,ot.value=pe.exportValue,G.value.includes(pe.exportValue)&&(ot.setAttribute("selected",!0),q=!1),z.append(ot)}let ge=null;if(q){const pe=document.createElement("option");pe.value=" ",pe.setAttribute("hidden",!0),pe.setAttribute("selected",!0),z.prepend(pe),ge=()=>{pe.remove(),z.removeEventListener("input",ge),ge=null},z.addEventListener("input",ge)}const Be=(pe,ot)=>{const Le=ot?"value":"textContent",Ye=pe.target.options;return pe.target.multiple?Array.prototype.filter.call(Ye,ce=>ce.selected).map(ce=>ce[Le]):Ye.selectedIndex===-1?null:Ye[Ye.selectedIndex][Le]},Ze=pe=>{const ot=pe.target.options;return Array.prototype.map.call(ot,Le=>({displayValue:Le.textContent,exportValue:Le.value}))};return this.enableScripting&&this.hasJSActions?(z.addEventListener("updatefromsandbox",pe=>{const ot={value(Le){ge==null||ge();const Ye=Le.detail.value,ce=new Set(Array.isArray(Ye)?Ye:[Ye]);for(const We of z.options)We.selected=ce.has(We.value);C.setValue(I,{value:Be(Le,!0)})},multipleSelection(Le){z.multiple=!0},remove(Le){const Ye=z.options,ce=Le.detail.remove;Ye[ce].selected=!1,z.remove(ce),Ye.length>0&&Array.prototype.findIndex.call(Ye,nt=>nt.selected)===-1&&(Ye[0].selected=!0),C.setValue(I,{value:Be(Le,!0),items:Ze(Le)})},clear(Le){for(;z.length!==0;)z.remove(0);C.setValue(I,{value:null,items:[]})},insert(Le){const{index:Ye,displayValue:ce,exportValue:We}=Le.detail.insert,nt=z.children[Ye],ut=document.createElement("option");ut.textContent=ce,ut.value=We,nt?nt.before(ut):z.append(ut),C.setValue(I,{value:Be(Le,!0),items:Ze(Le)})},items(Le){const{items:Ye}=Le.detail;for(;z.length!==0;)z.remove(0);for(const ce of Ye){const{displayValue:We,exportValue:nt}=ce,ut=document.createElement("option");ut.textContent=We,ut.value=nt,z.append(ut)}z.options.length>0&&(z.options[0].selected=!0),C.setValue(I,{value:Be(Le,!0),items:Ze(Le)})},indices(Le){const Ye=new Set(Le.detail.indices);for(const ce of Le.target.options)ce.selected=Ye.has(ce.index);C.setValue(I,{value:Be(Le,!0)})},editable(Le){Le.target.disabled=!Le.detail.editable}};this._dispatchEventFromSandbox(ot,pe)}),z.addEventListener("input",pe=>{var Ye;const ot=Be(pe,!0),Le=Be(pe,!1);C.setValue(I,{value:ot}),(Ye=this.linkService.eventBus)==null||Ye.dispatch("dispatcheventinsandbox",{source:this,detail:{id:I,name:"Keystroke",value:Le,changeEx:ot,willCommit:!0,commitKey:1,keyDown:!1}})}),this._setEventListeners(z,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"]],pe=>pe.target.checked)):z.addEventListener("input",function(pe){C.setValue(I,{value:Be(pe,!0)})}),this.data.combo&&this._setTextStyle(z),this._setBackgroundColor(z),this._setDefaultPropertiesFromJS(z),this.container.append(z),this.container}}const J=class J extends _{constructor(C){var z,q,ge;const{data:I}=C,G=!J.IGNORE_TYPES.has(I.parentType)&&!!((z=I.titleObj)!=null&&z.str||(q=I.contentsObj)!=null&&q.str||(ge=I.richText)!=null&&ge.str);super(C,{isRenderable:G})}render(){this.container.className="popupAnnotation";const C=this.layer.querySelectorAll(`[data-annotation-id="${this.data.parentId}"]`);if(C.length===0)return this.container;const I=new x({container:this.container,trigger:Array.from(C),color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText}),G=this.page,z=r.Util.normalizeRect([this.data.parentRect[0],G.view[3]-this.data.parentRect[1]+G.view[1],this.data.parentRect[2],G.view[3]-this.data.parentRect[3]+G.view[1]]),q=z[0]+this.data.parentRect[2]-this.data.parentRect[0],ge=z[1],[Be,Ze,pe,ot]=this.viewport.viewBox,Le=pe-Be,Ye=ot-Ze;return this.container.style.left=`${100*(q-Be)/Le}%`,this.container.style.top=`${100*(ge-Ze)/Ye}%`,this.container.append(I.render()),this.container}};an(J,"IGNORE_TYPES",new Set(["Line","Square","Circle","PolyLine","Polygon","Ink"]));let d=J;class x{constructor(C){this.container=C.container,this.trigger=C.trigger,this.color=C.color,this.titleObj=C.titleObj,this.modificationDate=C.modificationDate,this.contentsObj=C.contentsObj,this.richText=C.richText,this.hideWrapper=C.hideWrapper||!1,this.pinned=!1}render(){var Be,Ze;const I=document.createElement("div");I.className="popupWrapper",this.hideElement=this.hideWrapper?I:this.container,this.hideElement.hidden=!0;const G=document.createElement("div");G.className="popup";const z=this.color;if(z){const pe=.7*(255-z[0])+z[0],ot=.7*(255-z[1])+z[1],Le=.7*(255-z[2])+z[2];G.style.backgroundColor=r.Util.makeHexColor(pe|0,ot|0,Le|0)}const q=document.createElement("h1");q.dir=this.titleObj.dir,q.textContent=this.titleObj.str,G.append(q);const ge=e.PDFDateString.toDateObject(this.modificationDate);if(ge){const pe=document.createElement("span");pe.className="popupDate",pe.textContent="{{date}}, {{time}}",pe.dataset.l10nId="annotation_date_string",pe.dataset.l10nArgs=JSON.stringify({date:ge.toLocaleDateString(),time:ge.toLocaleTimeString()}),G.append(pe)}if((Be=this.richText)!=null&&Be.str&&(!((Ze=this.contentsObj)!=null&&Ze.str)||this.contentsObj.str===this.richText.str))E.XfaLayer.render({xfaHtml:this.richText.html,intent:"richText",div:G}),G.lastChild.className="richText popupContent";else{const pe=this._formatContents(this.contentsObj);G.append(pe)}Array.isArray(this.trigger)||(this.trigger=[this.trigger]);for(const pe of this.trigger)pe.addEventListener("click",this._toggle.bind(this)),pe.addEventListener("mouseover",this._show.bind(this,!1)),pe.addEventListener("mouseout",this._hide.bind(this,!1));return G.addEventListener("click",this._hide.bind(this,!0)),I.append(G),I}_formatContents({str:C,dir:I}){const G=document.createElement("p");G.className="popupContent",G.dir=I;const z=C.split(/(?:\r\n?|\n)/);for(let q=0,ge=z.length;q<ge;++q){const Be=z[q];G.append(document.createTextNode(Be)),q<ge-1&&G.append(document.createElement("br"))}return G}_toggle(){this.pinned?this._hide(!0):this._show(!0)}_show(C=!1){C&&(this.pinned=!0),this.hideElement.hidden&&(this.hideElement.hidden=!1,this.container.style.zIndex=parseInt(this.container.style.zIndex)+1e3)}_hide(C=!0){C&&(this.pinned=!1),!this.hideElement.hidden&&!this.pinned&&(this.hideElement.hidden=!0,this.container.style.zIndex=parseInt(this.container.style.zIndex)-1e3)}}class L extends _{constructor(C){var G,z,q;const I=!!(C.data.hasPopup||(G=C.data.titleObj)!=null&&G.str||(z=C.data.contentsObj)!=null&&z.str||(q=C.data.richText)!=null&&q.str);super(C,{isRenderable:I,ignoreBorder:!0}),this.textContent=C.data.textContent}render(){if(this.container.className="freeTextAnnotation",this.textContent){const C=document.createElement("div");C.className="annotationTextContent",C.setAttribute("role","comment");for(const I of this.textContent){const G=document.createElement("span");G.textContent=I,C.append(G)}this.container.append(C)}return this.data.hasPopup||this._createPopup(null,this.data),this.container}}class X extends _{constructor(C){var G,z,q;const I=!!(C.data.hasPopup||(G=C.data.titleObj)!=null&&G.str||(z=C.data.contentsObj)!=null&&z.str||(q=C.data.richText)!=null&&q.str);super(C,{isRenderable:I,ignoreBorder:!0})}render(){this.container.className="lineAnnotation";const C=this.data,{width:I,height:G}=A(C.rect),z=this.svgFactory.create(I,G,!0),q=this.svgFactory.createElement("svg:line");return q.setAttribute("x1",C.rect[2]-C.lineCoordinates[0]),q.setAttribute("y1",C.rect[3]-C.lineCoordinates[1]),q.setAttribute("x2",C.rect[2]-C.lineCoordinates[2]),q.setAttribute("y2",C.rect[3]-C.lineCoordinates[3]),q.setAttribute("stroke-width",C.borderStyle.width||1),q.setAttribute("stroke","transparent"),q.setAttribute("fill","transparent"),z.append(q),this.container.append(z),this._createPopup(q,C),this.container}}class N extends _{constructor(C){var G,z,q;const I=!!(C.data.hasPopup||(G=C.data.titleObj)!=null&&G.str||(z=C.data.contentsObj)!=null&&z.str||(q=C.data.richText)!=null&&q.str);super(C,{isRenderable:I,ignoreBorder:!0})}render(){this.container.className="squareAnnotation";const C=this.data,{width:I,height:G}=A(C.rect),z=this.svgFactory.create(I,G,!0),q=C.borderStyle.width,ge=this.svgFactory.createElement("svg:rect");return ge.setAttribute("x",q/2),ge.setAttribute("y",q/2),ge.setAttribute("width",I-q),ge.setAttribute("height",G-q),ge.setAttribute("stroke-width",q||1),ge.setAttribute("stroke","transparent"),ge.setAttribute("fill","transparent"),z.append(ge),this.container.append(z),this._createPopup(ge,C),this.container}}class D extends _{constructor(C){var G,z,q;const I=!!(C.data.hasPopup||(G=C.data.titleObj)!=null&&G.str||(z=C.data.contentsObj)!=null&&z.str||(q=C.data.richText)!=null&&q.str);super(C,{isRenderable:I,ignoreBorder:!0})}render(){this.container.className="circleAnnotation";const C=this.data,{width:I,height:G}=A(C.rect),z=this.svgFactory.create(I,G,!0),q=C.borderStyle.width,ge=this.svgFactory.createElement("svg:ellipse");return ge.setAttribute("cx",I/2),ge.setAttribute("cy",G/2),ge.setAttribute("rx",I/2-q/2),ge.setAttribute("ry",G/2-q/2),ge.setAttribute("stroke-width",q||1),ge.setAttribute("stroke","transparent"),ge.setAttribute("fill","transparent"),z.append(ge),this.container.append(z),this._createPopup(ge,C),this.container}}class se extends _{constructor(C){var G,z,q;const I=!!(C.data.hasPopup||(G=C.data.titleObj)!=null&&G.str||(z=C.data.contentsObj)!=null&&z.str||(q=C.data.richText)!=null&&q.str);super(C,{isRenderable:I,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;const C=this.data,{width:I,height:G}=A(C.rect),z=this.svgFactory.create(I,G,!0);let q=[];for(const Be of C.vertices){const Ze=Be.x-C.rect[0],pe=C.rect[3]-Be.y;q.push(Ze+","+pe)}q=q.join(" ");const ge=this.svgFactory.createElement(this.svgElementName);return ge.setAttribute("points",q),ge.setAttribute("stroke-width",C.borderStyle.width||1),ge.setAttribute("stroke","transparent"),ge.setAttribute("fill","transparent"),z.append(ge),this.container.append(z),this._createPopup(ge,C),this.container}}class Ae extends se{constructor(C){super(C),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class Te extends _{constructor(C){var G,z,q;const I=!!(C.data.hasPopup||(G=C.data.titleObj)!=null&&G.str||(z=C.data.contentsObj)!=null&&z.str||(q=C.data.richText)!=null&&q.str);super(C,{isRenderable:I,ignoreBorder:!0})}render(){return this.container.className="caretAnnotation",this.data.hasPopup||this._createPopup(null,this.data),this.container}}class le extends _{constructor(C){var G,z,q;const I=!!(C.data.hasPopup||(G=C.data.titleObj)!=null&&G.str||(z=C.data.contentsObj)!=null&&z.str||(q=C.data.richText)!=null&&q.str);super(C,{isRenderable:I,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;const C=this.data,{width:I,height:G}=A(C.rect),z=this.svgFactory.create(I,G,!0);for(const q of C.inkLists){let ge=[];for(const Ze of q){const pe=Ze.x-C.rect[0],ot=C.rect[3]-Ze.y;ge.push(`${pe},${ot}`)}ge=ge.join(" ");const Be=this.svgFactory.createElement(this.svgElementName);Be.setAttribute("points",ge),Be.setAttribute("stroke-width",C.borderStyle.width||1),Be.setAttribute("stroke","transparent"),Be.setAttribute("fill","transparent"),this._createPopup(Be,C),z.append(Be)}return this.container.append(z),this.container}}class ie extends _{constructor(C){var G,z,q;const I=!!(C.data.hasPopup||(G=C.data.titleObj)!=null&&G.str||(z=C.data.contentsObj)!=null&&z.str||(q=C.data.richText)!=null&&q.str);super(C,{isRenderable:I,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("highlightAnnotation"):(this.container.className="highlightAnnotation",this.container)}}class fe extends _{constructor(C){var G,z,q;const I=!!(C.data.hasPopup||(G=C.data.titleObj)!=null&&G.str||(z=C.data.contentsObj)!=null&&z.str||(q=C.data.richText)!=null&&q.str);super(C,{isRenderable:I,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("underlineAnnotation"):(this.container.className="underlineAnnotation",this.container)}}class _e extends _{constructor(C){var G,z,q;const I=!!(C.data.hasPopup||(G=C.data.titleObj)!=null&&G.str||(z=C.data.contentsObj)!=null&&z.str||(q=C.data.richText)!=null&&q.str);super(C,{isRenderable:I,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("squigglyAnnotation"):(this.container.className="squigglyAnnotation",this.container)}}class oe extends _{constructor(C){var G,z,q;const I=!!(C.data.hasPopup||(G=C.data.titleObj)!=null&&G.str||(z=C.data.contentsObj)!=null&&z.str||(q=C.data.richText)!=null&&q.str);super(C,{isRenderable:I,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("strikeoutAnnotation"):(this.container.className="strikeoutAnnotation",this.container)}}class Me extends _{constructor(C){var G,z,q;const I=!!(C.data.hasPopup||(G=C.data.titleObj)!=null&&G.str||(z=C.data.contentsObj)!=null&&z.str||(q=C.data.richText)!=null&&q.str);super(C,{isRenderable:I,ignoreBorder:!0})}render(){return this.container.className="stampAnnotation",this.data.hasPopup||this._createPopup(null,this.data),this.container}}class xe extends _{constructor(C){var z;super(C,{isRenderable:!0});const{filename:I,content:G}=this.data.file;this.filename=(0,e.getFilenameFromUrl)(I,!0),this.content=G,(z=this.linkService.eventBus)==null||z.dispatch("fileattachmentannotation",{source:this,filename:I,content:G})}render(){var I,G;this.container.className="fileAttachmentAnnotation";const C=document.createElement("div");return C.className="popupTriggerArea",C.addEventListener("dblclick",this._download.bind(this)),!this.data.hasPopup&&((I=this.data.titleObj)!=null&&I.str||(G=this.data.contentsObj)!=null&&G.str||this.data.richText)&&this._createPopup(C,this.data),this.container.append(C),this.container}_download(){var C;(C=this.downloadManager)==null||C.openOrDownloadData(this.container,this.content,this.filename)}}const Ie=class Ie{static render(C){var Be,Ze;const{annotations:I,div:G,viewport:z,accessibilityManager:q}=C;qe(this,ve,La).call(this,G,z);let ge=0;for(const pe of I){if(pe.annotationType!==r.AnnotationType.POPUP){const{width:Le,height:Ye}=A(pe.rect);if(Le<=0||Ye<=0)continue}const ot=y.create({data:pe,layer:G,page:C.page,viewport:z,linkService:C.linkService,downloadManager:C.downloadManager,imageResourcesPath:C.imageResourcesPath||"",renderForms:C.renderForms!==!1,svgFactory:new e.DOMSVGFactory,annotationStorage:C.annotationStorage||new p.AnnotationStorage,enableScripting:C.enableScripting,hasJSActions:C.hasJSActions,fieldObjects:C.fieldObjects,mouseState:C.mouseState||{isDown:!1}});if(ot.isRenderable){const Le=ot.render();if(pe.hidden&&(Le.style.visibility="hidden"),Array.isArray(Le))for(const Ye of Le)Ye.style.zIndex=ge++,qe(Be=Ie,te,Oa).call(Be,Ye,pe.id,G,q);else Le.style.zIndex=ge++,ot instanceof d?G.prepend(Le):qe(Ze=Ie,te,Oa).call(Ze,Le,pe.id,G,q)}}qe(this,Se,Fa).call(this,G,C.annotationCanvasMap)}static update(C){const{annotationCanvasMap:I,div:G,viewport:z}=C;qe(this,ve,La).call(this,G,z),qe(this,Se,Fa).call(this,G,I),G.hidden=!1}};te=new WeakSet,Oa=function(C,I,G,z){const q=C.firstChild||C;q.id=`${e.AnnotationPrefix}${I}`,G.append(C),z==null||z.moveElementInDOM(G,C,q,!1)},ve=new WeakSet,La=function(C,{width:I,height:G,rotation:z}){const{style:q}=C,ge=z%180!==0,Be=Math.floor(I)+"px",Ze=Math.floor(G)+"px";q.width=ge?Ze:Be,q.height=ge?Be:Ze,C.setAttribute("data-main-rotation",z)},Se=new WeakSet,Fa=function(C,I){if(I){for(const[G,z]of I){const q=C.querySelector(`[data-annotation-id="${G}"]`);if(!q)continue;const{firstChild:ge}=q;ge?ge.nodeName==="CANVAS"?ge.replaceWith(z):ge.before(z):q.append(z)}I.clear()}},De(Ie,te),De(Ie,ve),De(Ie,Se);let K=Ie;n.AnnotationLayer=K},(t,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorConverters=void 0;function a(e){return Math.floor(Math.max(0,Math.min(1,e))*255).toString(16).padStart(2,"0")}class r{static CMYK_G([p,k,E,b]){return["G",1-Math.min(1,.3*p+.59*E+.11*k+b)]}static G_CMYK([p]){return["CMYK",0,0,0,1-p]}static G_RGB([p]){return["RGB",p,p,p]}static G_HTML([p]){const k=a(p);return`#${k}${k}${k}`}static RGB_G([p,k,E]){return["G",.3*p+.59*k+.11*E]}static RGB_HTML([p,k,E]){const b=a(p),R=a(k),S=a(E);return`#${b}${R}${S}`}static T_HTML(){return"#00000000"}static CMYK_RGB([p,k,E,b]){return["RGB",1-Math.min(1,p+b),1-Math.min(1,E+b),1-Math.min(1,k+b)]}static CMYK_HTML(p){const k=this.CMYK_RGB(p).slice(1);return this.RGB_HTML(k)}static RGB_CMYK([p,k,E]){const b=1-p,R=1-k,S=1-E,A=Math.min(b,R,S);return["CMYK",b,R,S,A]}}n.ColorConverters=r},(t,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.XfaLayer=void 0;var r=a(19);class e{static setupStorage(k,E,b,R,S){const A=R.getValue(E,{value:null});switch(b.name){case"textarea":if(A.value!==null&&(k.textContent=A.value),S==="print")break;k.addEventListener("input",y=>{R.setValue(E,{value:y.target.value})});break;case"input":if(b.attributes.type==="radio"||b.attributes.type==="checkbox"){if(A.value===b.attributes.xfaOn?k.setAttribute("checked",!0):A.value===b.attributes.xfaOff&&k.removeAttribute("checked"),S==="print")break;k.addEventListener("change",y=>{R.setValue(E,{value:y.target.checked?y.target.getAttribute("xfaOn"):y.target.getAttribute("xfaOff")})})}else{if(A.value!==null&&k.setAttribute("value",A.value),S==="print")break;k.addEventListener("input",y=>{R.setValue(E,{value:y.target.value})})}break;case"select":if(A.value!==null)for(const y of b.children)y.attributes.value===A.value&&(y.attributes.selected=!0);k.addEventListener("input",y=>{const _=y.target.options,h=_.selectedIndex===-1?"":_[_.selectedIndex].value;R.setValue(E,{value:h})});break}}static setAttributes({html:k,element:E,storage:b=null,intent:R,linkService:S}){const{attributes:A}=E,y=k instanceof HTMLAnchorElement;A.type==="radio"&&(A.name=`${A.name}-${R}`);for(const[_,h]of Object.entries(A))if(h!=null)switch(_){case"class":h.length&&k.setAttribute(_,h.join(" "));break;case"dataId":break;case"id":k.setAttribute("data-element-id",h);break;case"style":Object.assign(k.style,h);break;case"textContent":k.textContent=h;break;default:(!y||_!=="href"&&_!=="newWindow")&&k.setAttribute(_,h)}y&&S.addLinkAttributes(k,A.href,A.newWindow),b&&A.dataId&&this.setupStorage(k,A.dataId,E,b)}static render(k){var l;const E=k.annotationStorage,b=k.linkService,R=k.xfaHtml,S=k.intent||"display",A=document.createElement(R.name);R.attributes&&this.setAttributes({html:A,element:R,intent:S,linkService:b});const y=[[R,-1,A]],_=k.div;if(_.append(A),k.viewport){const o=`matrix(${k.viewport.transform.join(",")})`;_.style.transform=o}S!=="richText"&&_.setAttribute("class","xfaLayer xfaFont");const h=[];for(;y.length>0;){const[o,s,f]=y.at(-1);if(s+1===o.children.length){y.pop();continue}const g=o.children[++y.at(-1)[1]];if(g===null)continue;const{name:v}=g;if(v==="#text"){const d=document.createTextNode(g.value);h.push(d),f.append(d);continue}let c;if((l=g==null?void 0:g.attributes)!=null&&l.xmlns?c=document.createElementNS(g.attributes.xmlns,v):c=document.createElement(v),f.append(c),g.attributes&&this.setAttributes({html:c,element:g,storage:E,intent:S,linkService:b}),g.children&&g.children.length>0)y.push([g,-1,c]);else if(g.value){const d=document.createTextNode(g.value);r.XfaText.shouldBuildText(v)&&h.push(d),c.append(d)}}for(const o of _.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))o.setAttribute("readOnly",!0);return{textDivs:h}}static update(k){const E=`matrix(${k.viewport.transform.join(",")})`;k.div.style.transform=E,k.div.hidden=!1}}n.XfaLayer=e},(t,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TextLayerRenderTask=void 0,n.renderTextLayer=_;var r=a(1),e=a(6);const p=1e5,k=30,E=.8,b=new Map;function R(h,l){const o=b.get(h);if(o)return o;l.save(),l.font=`${k}px ${h}`;const s=l.measureText("");let f=s.fontBoundingBoxAscent,g=Math.abs(s.fontBoundingBoxDescent);if(f){l.restore();const c=f/(f+g);return b.set(h,c),c}l.strokeStyle="red",l.clearRect(0,0,k,k),l.strokeText("g",0,0);let v=l.getImageData(0,0,k,k).data;g=0;for(let c=v.length-1-3;c>=0;c-=4)if(v[c]>0){g=Math.ceil(c/4/k);break}l.clearRect(0,0,k,k),l.strokeText("A",0,k),v=l.getImageData(0,0,k,k).data,f=0;for(let c=0,d=v.length;c<d;c+=4)if(v[c]>0){f=k-Math.floor(c/4/k);break}if(l.restore(),f){const c=f/(f+g);return b.set(h,c),c}return b.set(h,E),E}function S(h,l,o,s){const f=document.createElement("span"),g={angle:0,canvasWidth:0,hasText:l.str!=="",hasEOL:l.hasEOL,fontSize:0};h._textDivs.push(f);const v=r.Util.transform(h._viewport.transform,l.transform);let c=Math.atan2(v[1],v[0]);const d=o[l.fontName];d.vertical&&(c+=Math.PI/2);const x=Math.hypot(v[2],v[3]),L=x*R(d.fontFamily,s);let X,N;c===0?(X=v[4],N=v[5]-L):(X=v[4]+L*Math.sin(c),N=v[5]-L*Math.cos(c)),f.style.left=`${X}px`,f.style.top=`${N}px`,f.style.fontSize=`${x}px`,f.style.fontFamily=d.fontFamily,g.fontSize=x,f.setAttribute("role","presentation"),f.textContent=l.str,f.dir=l.dir,h._fontInspectorEnabled&&(f.dataset.fontName=l.fontName),c!==0&&(g.angle=c*(180/Math.PI));let D=!1;if(l.str.length>1)D=!0;else if(l.str!==" "&&l.transform[0]!==l.transform[3]){const se=Math.abs(l.transform[0]),Ae=Math.abs(l.transform[3]);se!==Ae&&Math.max(se,Ae)/Math.min(se,Ae)>1.5&&(D=!0)}D&&(d.vertical?g.canvasWidth=l.height*h._viewport.scale:g.canvasWidth=l.width*h._viewport.scale),h._textDivProperties.set(f,g),h._textContentStream&&h._layoutText(f)}function A(h){if(h._canceled)return;const l=h._textDivs,o=h._capability;if(l.length>p){h._renderingDone=!0,o.resolve();return}if(!h._textContentStream)for(const f of l)h._layoutText(f);h._renderingDone=!0,o.resolve()}class y{constructor({textContent:l,textContentStream:o,container:s,viewport:f,textDivs:g,textContentItemsStr:v}){var c;this._textContent=l,this._textContentStream=o,this._container=s,this._document=s.ownerDocument,this._viewport=f,this._textDivs=g||[],this._textContentItemsStr=v||[],this._fontInspectorEnabled=!!((c=globalThis.FontInspector)!=null&&c.enabled),this._reader=null,this._layoutTextLastFontSize=null,this._layoutTextLastFontFamily=null,this._layoutTextCtx=null,this._textDivProperties=new WeakMap,this._renderingDone=!1,this._canceled=!1,this._capability=(0,r.createPromiseCapability)(),this._renderTimer=null,this._devicePixelRatio=globalThis.devicePixelRatio||1,this._capability.promise.finally(()=>{this._textDivProperties=null,this._layoutTextCtx&&(this._layoutTextCtx.canvas.width=0,this._layoutTextCtx.canvas.height=0,this._layoutTextCtx=null)}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new r.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._renderTimer!==null&&(clearTimeout(this._renderTimer),this._renderTimer=null),this._capability.reject(new Error("TextLayer task cancelled."))}_processItems(l,o){for(const s of l){if(s.str===void 0){if(s.type==="beginMarkedContentProps"||s.type==="beginMarkedContent"){const f=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),s.id!==null&&this._container.setAttribute("id",`${s.id}`),f.append(this._container)}else s.type==="endMarkedContent"&&(this._container=this._container.parentNode);continue}this._textContentItemsStr.push(s.str),S(this,s,o,this._layoutTextCtx)}}_layoutText(l){const o=this._textDivProperties.get(l);let s="";if(o.canvasWidth!==0&&o.hasText){const{fontFamily:f}=l.style,{fontSize:g}=o;(g!==this._layoutTextLastFontSize||f!==this._layoutTextLastFontFamily)&&(this._layoutTextCtx.font=`${g*this._devicePixelRatio}px ${f}`,this._layoutTextLastFontSize=g,this._layoutTextLastFontFamily=f);const{width:v}=this._layoutTextCtx.measureText(l.textContent);v>0&&(s=`scaleX(${this._devicePixelRatio*o.canvasWidth/v})`)}if(o.angle!==0&&(s=`rotate(${o.angle}deg) ${s}`),s.length>0&&(l.style.transform=s),o.hasText&&this._container.append(l),o.hasEOL){const f=document.createElement("br");f.setAttribute("role","presentation"),this._container.append(f)}}_render(l=0){const o=(0,r.createPromiseCapability)();let s=Object.create(null);const f=this._document.createElement("canvas");if(f.height=f.width=k,this._layoutTextCtx=f.getContext("2d",{alpha:!1}),this._textContent){const g=this._textContent.items,v=this._textContent.styles;this._processItems(g,v),o.resolve()}else if(this._textContentStream){const g=()=>{this._reader.read().then(({value:v,done:c})=>{if(c){o.resolve();return}Object.assign(s,v.styles),this._processItems(v.items,s),g()},o.reject)};this._reader=this._textContentStream.getReader(),g()}else throw new Error('Neither "textContent" nor "textContentStream" parameters specified.');o.promise.then(()=>{s=null,l?((0,e.deprecated)("The TextLayerRender `timeout` parameter will be removed in the future, since streaming of textContent has made it obsolete."),this._renderTimer=setTimeout(()=>{A(this),this._renderTimer=null},l)):A(this)},this._capability.reject)}}n.TextLayerRenderTask=y;function _(h){const l=new y({textContent:h.textContent,textContentStream:h.textContentStream,container:h.container,viewport:h.viewport,textDivs:h.textDivs,textContentItemsStr:h.textContentItemsStr});return l._render(h.timeout),l}},(t,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SVGGraphics=void 0;var r=a(6),e=a(1),p=a(12);let k=class{constructor(){(0,e.unreachable)("Not implemented: SVGGraphics")}};n.SVGGraphics=k;{let l=function(c){let d=[];const x=[];for(const L of c){if(L.fn==="save"){d.push({fnId:92,fn:"group",items:[]}),x.push(d),d=d.at(-1).items;continue}L.fn==="restore"?d=x.pop():d.push(L)}return d},o=function(c){if(Number.isInteger(c))return c.toString();const d=c.toFixed(10);let x=d.length-1;if(d[x]!=="0")return d;do x--;while(d[x]==="0");return d.substring(0,d[x]==="."?x:x+1)},s=function(c){if(c[4]===0&&c[5]===0){if(c[1]===0&&c[2]===0)return c[0]===1&&c[3]===1?"":`scale(${o(c[0])} ${o(c[3])})`;if(c[0]===c[3]&&c[1]===-c[2]){const d=Math.acos(c[0])*180/Math.PI;return`rotate(${o(d)})`}}else if(c[0]===1&&c[1]===0&&c[2]===0&&c[3]===1)return`translate(${o(c[4])} ${o(c[5])})`;return`matrix(${o(c[0])} ${o(c[1])} ${o(c[2])} ${o(c[3])} ${o(c[4])} ${o(c[5])})`};const E={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},b="http://www.w3.org/XML/1998/namespace",R="http://www.w3.org/1999/xlink",S=["butt","round","square"],A=["miter","round","bevel"],y=function(c,d="",x=!1){if(URL.createObjectURL&&typeof Blob<"u"&&!x)return URL.createObjectURL(new Blob([c],{type:d}));const L="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let X=`data:${d};base64,`;for(let N=0,D=c.length;N<D;N+=3){const se=c[N]&255,Ae=c[N+1]&255,Te=c[N+2]&255,le=se>>2,ie=(se&3)<<4|Ae>>4,fe=N+1<D?(Ae&15)<<2|Te>>6:64,_e=N+2<D?Te&63:64;X+=L[le]+L[ie]+L[fe]+L[_e]}return X},_=function(){const c=new Uint8Array([137,80,78,71,13,10,26,10]),d=12,x=new Int32Array(256);for(let Te=0;Te<256;Te++){let le=Te;for(let ie=0;ie<8;ie++)le&1?le=3988292384^le>>1&2147483647:le=le>>1&2147483647;x[Te]=le}function L(Te,le,ie){let fe=-1;for(let _e=le;_e<ie;_e++){const oe=(fe^Te[_e])&255,Me=x[oe];fe=fe>>>8^Me}return fe^-1}function X(Te,le,ie,fe){let _e=fe;const oe=le.length;ie[_e]=oe>>24&255,ie[_e+1]=oe>>16&255,ie[_e+2]=oe>>8&255,ie[_e+3]=oe&255,_e+=4,ie[_e]=Te.charCodeAt(0)&255,ie[_e+1]=Te.charCodeAt(1)&255,ie[_e+2]=Te.charCodeAt(2)&255,ie[_e+3]=Te.charCodeAt(3)&255,_e+=4,ie.set(le,_e),_e+=le.length;const Me=L(ie,fe+4,_e);ie[_e]=Me>>24&255,ie[_e+1]=Me>>16&255,ie[_e+2]=Me>>8&255,ie[_e+3]=Me&255}function N(Te,le,ie){let fe=1,_e=0;for(let oe=le;oe<ie;++oe)fe=(fe+(Te[oe]&255))%65521,_e=(_e+fe)%65521;return _e<<16|fe}function D(Te){if(!p.isNodeJS)return se(Te);try{let le;parseInt(process.versions.node)>=8?le=Te:le=Buffer.from(Te);const ie=require$$5.deflateSync(le,{level:9});return ie instanceof Uint8Array?ie:new Uint8Array(ie)}catch(le){(0,e.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+le)}return se(Te)}function se(Te){let le=Te.length;const ie=65535,fe=Math.ceil(le/ie),_e=new Uint8Array(2+le+fe*5+4);let oe=0;_e[oe++]=120,_e[oe++]=156;let Me=0;for(;le>ie;)_e[oe++]=0,_e[oe++]=255,_e[oe++]=255,_e[oe++]=0,_e[oe++]=0,_e.set(Te.subarray(Me,Me+ie),oe),oe+=ie,Me+=ie,le-=ie;_e[oe++]=1,_e[oe++]=le&255,_e[oe++]=le>>8&255,_e[oe++]=~le&65535&255,_e[oe++]=(~le&65535)>>8&255,_e.set(Te.subarray(Me),oe),oe+=Te.length-Me;const xe=N(Te,0,Te.length);return _e[oe++]=xe>>24&255,_e[oe++]=xe>>16&255,_e[oe++]=xe>>8&255,_e[oe++]=xe&255,_e}function Ae(Te,le,ie,fe){const _e=Te.width,oe=Te.height;let Me,xe,K;const T=Te.data;switch(le){case e.ImageKind.GRAYSCALE_1BPP:xe=0,Me=1,K=_e+7>>3;break;case e.ImageKind.RGB_24BPP:xe=2,Me=8,K=_e*3;break;case e.ImageKind.RGBA_32BPP:xe=6,Me=8,K=_e*4;break;default:throw new Error("invalid format")}const P=new Uint8Array((1+K)*oe);let $=0,Y=0;for(let Se=0;Se<oe;++Se)P[$++]=0,P.set(T.subarray(Y,Y+K),$),Y+=K,$+=K;if(le===e.ImageKind.GRAYSCALE_1BPP&&fe){$=0;for(let Se=0;Se<oe;Se++){$++;for(let je=0;je<K;je++)P[$++]^=255}}const J=new Uint8Array([_e>>24&255,_e>>16&255,_e>>8&255,_e&255,oe>>24&255,oe>>16&255,oe>>8&255,oe&255,Me,xe,0,0,0]),te=D(P),he=c.length+d*3+J.length+te.length,ve=new Uint8Array(he);let Ne=0;return ve.set(c,Ne),Ne+=c.length,X("IHDR",J,ve,Ne),Ne+=d+J.length,X("IDATA",te,ve,Ne),Ne+=d+te.length,X("IEND",new Uint8Array(0),ve,Ne),y(ve,"image/png",ie)}return function(le,ie,fe){const _e=le.kind===void 0?e.ImageKind.GRAYSCALE_1BPP:le.kind;return Ae(le,_e,ie,fe)}}();class h{constructor(){this.fontSizeScale=1,this.fontWeight=E.fontWeight,this.fontSize=0,this.textMatrix=e.IDENTITY_MATRIX,this.fontMatrix=e.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=e.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=E.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(d,x){this.x=d,this.y=x}}let f=0,g=0,v=0;n.SVGGraphics=k=class{constructor(c,d,x=!1){(0,r.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new r.DOMSVGFactory,this.current=new h,this.transformMatrix=e.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=c,this.objs=d,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!x,this._operatorIdMapping=[];for(const L in e.OPS)this._operatorIdMapping[e.OPS[L]]=L}getObject(c,d=null){return typeof c=="string"?c.startsWith("g_")?this.commonObjs.get(c):this.objs.get(c):d}save(){this.transformStack.push(this.transformMatrix);const c=this.current;this.extraStack.push(c),this.current=c.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(c){this.save(),this.executeOpTree(c),this.restore()}loadDependencies(c){const d=c.fnArray,x=c.argsArray;for(let L=0,X=d.length;L<X;L++)if(d[L]===e.OPS.dependency)for(const N of x[L]){const D=N.startsWith("g_")?this.commonObjs:this.objs,se=new Promise(Ae=>{D.get(N,Ae)});this.current.dependencies.push(se)}return Promise.all(this.current.dependencies)}transform(c,d,x,L,X,N){const D=[c,d,x,L,X,N];this.transformMatrix=e.Util.transform(this.transformMatrix,D),this.tgrp=null}getSVG(c,d){this.viewport=d;const x=this._initialize(d);return this.loadDependencies(c).then(()=>(this.transformMatrix=e.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(c)),x))}convertOpList(c){const d=this._operatorIdMapping,x=c.argsArray,L=c.fnArray,X=[];for(let N=0,D=L.length;N<D;N++){const se=L[N];X.push({fnId:se,fn:d[se],args:x[N]})}return l(X)}executeOpTree(c){for(const d of c){const x=d.fn,L=d.fnId,X=d.args;switch(L|0){case e.OPS.beginText:this.beginText();break;case e.OPS.dependency:break;case e.OPS.setLeading:this.setLeading(X);break;case e.OPS.setLeadingMoveText:this.setLeadingMoveText(X[0],X[1]);break;case e.OPS.setFont:this.setFont(X);break;case e.OPS.showText:this.showText(X[0]);break;case e.OPS.showSpacedText:this.showText(X[0]);break;case e.OPS.endText:this.endText();break;case e.OPS.moveText:this.moveText(X[0],X[1]);break;case e.OPS.setCharSpacing:this.setCharSpacing(X[0]);break;case e.OPS.setWordSpacing:this.setWordSpacing(X[0]);break;case e.OPS.setHScale:this.setHScale(X[0]);break;case e.OPS.setTextMatrix:this.setTextMatrix(X[0],X[1],X[2],X[3],X[4],X[5]);break;case e.OPS.setTextRise:this.setTextRise(X[0]);break;case e.OPS.setTextRenderingMode:this.setTextRenderingMode(X[0]);break;case e.OPS.setLineWidth:this.setLineWidth(X[0]);break;case e.OPS.setLineJoin:this.setLineJoin(X[0]);break;case e.OPS.setLineCap:this.setLineCap(X[0]);break;case e.OPS.setMiterLimit:this.setMiterLimit(X[0]);break;case e.OPS.setFillRGBColor:this.setFillRGBColor(X[0],X[1],X[2]);break;case e.OPS.setStrokeRGBColor:this.setStrokeRGBColor(X[0],X[1],X[2]);break;case e.OPS.setStrokeColorN:this.setStrokeColorN(X);break;case e.OPS.setFillColorN:this.setFillColorN(X);break;case e.OPS.shadingFill:this.shadingFill(X[0]);break;case e.OPS.setDash:this.setDash(X[0],X[1]);break;case e.OPS.setRenderingIntent:this.setRenderingIntent(X[0]);break;case e.OPS.setFlatness:this.setFlatness(X[0]);break;case e.OPS.setGState:this.setGState(X[0]);break;case e.OPS.fill:this.fill();break;case e.OPS.eoFill:this.eoFill();break;case e.OPS.stroke:this.stroke();break;case e.OPS.fillStroke:this.fillStroke();break;case e.OPS.eoFillStroke:this.eoFillStroke();break;case e.OPS.clip:this.clip("nonzero");break;case e.OPS.eoClip:this.clip("evenodd");break;case e.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case e.OPS.paintImageXObject:this.paintImageXObject(X[0]);break;case e.OPS.paintInlineImageXObject:this.paintInlineImageXObject(X[0]);break;case e.OPS.paintImageMaskXObject:this.paintImageMaskXObject(X[0]);break;case e.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(X[0],X[1]);break;case e.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case e.OPS.closePath:this.closePath();break;case e.OPS.closeStroke:this.closeStroke();break;case e.OPS.closeFillStroke:this.closeFillStroke();break;case e.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case e.OPS.nextLine:this.nextLine();break;case e.OPS.transform:this.transform(X[0],X[1],X[2],X[3],X[4],X[5]);break;case e.OPS.constructPath:this.constructPath(X[0],X[1]);break;case e.OPS.endPath:this.endPath();break;case 92:this.group(d.items);break;default:(0,e.warn)(`Unimplemented operator ${x}`);break}}}setWordSpacing(c){this.current.wordSpacing=c}setCharSpacing(c){this.current.charSpacing=c}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(c,d,x,L,X,N){const D=this.current;D.textMatrix=D.lineMatrix=[c,d,x,L,X,N],D.textMatrixScale=Math.hypot(c,d),D.x=D.lineX=0,D.y=D.lineY=0,D.xcoords=[],D.ycoords=[],D.tspan=this.svgFactory.createElement("svg:tspan"),D.tspan.setAttributeNS(null,"font-family",D.fontFamily),D.tspan.setAttributeNS(null,"font-size",`${o(D.fontSize)}px`),D.tspan.setAttributeNS(null,"y",o(-D.y)),D.txtElement=this.svgFactory.createElement("svg:text"),D.txtElement.append(D.tspan)}beginText(){const c=this.current;c.x=c.lineX=0,c.y=c.lineY=0,c.textMatrix=e.IDENTITY_MATRIX,c.lineMatrix=e.IDENTITY_MATRIX,c.textMatrixScale=1,c.tspan=this.svgFactory.createElement("svg:tspan"),c.txtElement=this.svgFactory.createElement("svg:text"),c.txtgrp=this.svgFactory.createElement("svg:g"),c.xcoords=[],c.ycoords=[]}moveText(c,d){const x=this.current;x.x=x.lineX+=c,x.y=x.lineY+=d,x.xcoords=[],x.ycoords=[],x.tspan=this.svgFactory.createElement("svg:tspan"),x.tspan.setAttributeNS(null,"font-family",x.fontFamily),x.tspan.setAttributeNS(null,"font-size",`${o(x.fontSize)}px`),x.tspan.setAttributeNS(null,"y",o(-x.y))}showText(c){const d=this.current,x=d.font,L=d.fontSize;if(L===0)return;const X=d.fontSizeScale,N=d.charSpacing,D=d.wordSpacing,se=d.fontDirection,Ae=d.textHScale*se,Te=x.vertical,le=Te?1:-1,ie=x.defaultVMetrics,fe=L*d.fontMatrix[0];let _e=0;for(const xe of c){if(xe===null){_e+=se*D;continue}else if(typeof xe=="number"){_e+=le*xe*L/1e3;continue}const K=(xe.isSpace?D:0)+N,T=xe.fontChar;let P,$,Y=xe.width;if(Te){let te;const he=xe.vmetric||ie;te=xe.vmetric?he[1]:Y*.5,te=-te*fe;const ve=he[2]*fe;Y=he?-he[0]:Y,P=te/X,$=(_e+ve)/X}else P=_e/X,$=0;(xe.isInFont||x.missingFile)&&(d.xcoords.push(d.x+P),Te&&d.ycoords.push(-d.y+$),d.tspan.textContent+=T);let J;Te?J=Y*fe-K*se:J=Y*fe+K*se,_e+=J}d.tspan.setAttributeNS(null,"x",d.xcoords.map(o).join(" ")),Te?d.tspan.setAttributeNS(null,"y",d.ycoords.map(o).join(" ")):d.tspan.setAttributeNS(null,"y",o(-d.y)),Te?d.y-=_e:d.x+=_e*Ae,d.tspan.setAttributeNS(null,"font-family",d.fontFamily),d.tspan.setAttributeNS(null,"font-size",`${o(d.fontSize)}px`),d.fontStyle!==E.fontStyle&&d.tspan.setAttributeNS(null,"font-style",d.fontStyle),d.fontWeight!==E.fontWeight&&d.tspan.setAttributeNS(null,"font-weight",d.fontWeight);const oe=d.textRenderingMode&e.TextRenderingMode.FILL_STROKE_MASK;if(oe===e.TextRenderingMode.FILL||oe===e.TextRenderingMode.FILL_STROKE?(d.fillColor!==E.fillColor&&d.tspan.setAttributeNS(null,"fill",d.fillColor),d.fillAlpha<1&&d.tspan.setAttributeNS(null,"fill-opacity",d.fillAlpha)):d.textRenderingMode===e.TextRenderingMode.ADD_TO_PATH?d.tspan.setAttributeNS(null,"fill","transparent"):d.tspan.setAttributeNS(null,"fill","none"),oe===e.TextRenderingMode.STROKE||oe===e.TextRenderingMode.FILL_STROKE){const xe=1/(d.textMatrixScale||1);this._setStrokeAttributes(d.tspan,xe)}let Me=d.textMatrix;d.textRise!==0&&(Me=Me.slice(),Me[5]+=d.textRise),d.txtElement.setAttributeNS(null,"transform",`${s(Me)} scale(${o(Ae)}, -1)`),d.txtElement.setAttributeNS(b,"xml:space","preserve"),d.txtElement.append(d.tspan),d.txtgrp.append(d.txtElement),this._ensureTransformGroup().append(d.txtElement)}setLeadingMoveText(c,d){this.setLeading(-d),this.moveText(c,d)}addFontStyle(c){if(!c.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 d=y(c.data,c.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${c.loadedName}"; src: url(${d}); } `}setFont(c){const d=this.current,x=this.commonObjs.get(c[0]);let L=c[1];d.font=x,this.embedFonts&&!x.missingFile&&!this.embeddedFonts[x.loadedName]&&(this.addFontStyle(x),this.embeddedFonts[x.loadedName]=x),d.fontMatrix=x.fontMatrix||e.FONT_IDENTITY_MATRIX;let X="normal";x.black?X="900":x.bold&&(X="bold");const N=x.italic?"italic":"normal";L<0?(L=-L,d.fontDirection=-1):d.fontDirection=1,d.fontSize=L,d.fontFamily=x.loadedName,d.fontWeight=X,d.fontStyle=N,d.tspan=this.svgFactory.createElement("svg:tspan"),d.tspan.setAttributeNS(null,"y",o(-d.y)),d.xcoords=[],d.ycoords=[]}endText(){var d;const c=this.current;c.textRenderingMode&e.TextRenderingMode.ADD_TO_PATH_FLAG&&((d=c.txtElement)!=null&&d.hasChildNodes())&&(c.element=c.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(c){c>0&&(this.current.lineWidth=c)}setLineCap(c){this.current.lineCap=S[c]}setLineJoin(c){this.current.lineJoin=A[c]}setMiterLimit(c){this.current.miterLimit=c}setStrokeAlpha(c){this.current.strokeAlpha=c}setStrokeRGBColor(c,d,x){this.current.strokeColor=e.Util.makeHexColor(c,d,x)}setFillAlpha(c){this.current.fillAlpha=c}setFillRGBColor(c,d,x){this.current.fillColor=e.Util.makeHexColor(c,d,x),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(c){this.current.strokeColor=this._makeColorN_Pattern(c)}setFillColorN(c){this.current.fillColor=this._makeColorN_Pattern(c)}shadingFill(c){const d=this.viewport.width,x=this.viewport.height,L=e.Util.inverseTransform(this.transformMatrix),X=e.Util.applyTransform([0,0],L),N=e.Util.applyTransform([0,x],L),D=e.Util.applyTransform([d,0],L),se=e.Util.applyTransform([d,x],L),Ae=Math.min(X[0],N[0],D[0],se[0]),Te=Math.min(X[1],N[1],D[1],se[1]),le=Math.max(X[0],N[0],D[0],se[0]),ie=Math.max(X[1],N[1],D[1],se[1]),fe=this.svgFactory.createElement("svg:rect");fe.setAttributeNS(null,"x",Ae),fe.setAttributeNS(null,"y",Te),fe.setAttributeNS(null,"width",le-Ae),fe.setAttributeNS(null,"height",ie-Te),fe.setAttributeNS(null,"fill",this._makeShadingPattern(c)),this.current.fillAlpha<1&&fe.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(fe)}_makeColorN_Pattern(c){return c[0]==="TilingPattern"?this._makeTilingPattern(c):this._makeShadingPattern(c)}_makeTilingPattern(c){const d=c[1],x=c[2],L=c[3]||e.IDENTITY_MATRIX,[X,N,D,se]=c[4],Ae=c[5],Te=c[6],le=c[7],ie=`shading${v++}`,[fe,_e,oe,Me]=e.Util.normalizeRect([...e.Util.applyTransform([X,N],L),...e.Util.applyTransform([D,se],L)]),[xe,K]=e.Util.singularValueDecompose2dScale(L),T=Ae*xe,P=Te*K,$=this.svgFactory.createElement("svg:pattern");$.setAttributeNS(null,"id",ie),$.setAttributeNS(null,"patternUnits","userSpaceOnUse"),$.setAttributeNS(null,"width",T),$.setAttributeNS(null,"height",P),$.setAttributeNS(null,"x",`${fe}`),$.setAttributeNS(null,"y",`${_e}`);const Y=this.svg,J=this.transformMatrix,te=this.current.fillColor,he=this.current.strokeColor,ve=this.svgFactory.create(oe-fe,Me-_e);if(this.svg=ve,this.transformMatrix=L,le===2){const Ne=e.Util.makeHexColor(...d);this.current.fillColor=Ne,this.current.strokeColor=Ne}return this.executeOpTree(this.convertOpList(x)),this.svg=Y,this.transformMatrix=J,this.current.fillColor=te,this.current.strokeColor=he,$.append(ve.childNodes[0]),this.defs.append($),`url(#${ie})`}_makeShadingPattern(c){switch(typeof c=="string"&&(c=this.objs.get(c)),c[0]){case"RadialAxial":const d=`shading${v++}`,x=c[3];let L;switch(c[1]){case"axial":const X=c[4],N=c[5];L=this.svgFactory.createElement("svg:linearGradient"),L.setAttributeNS(null,"id",d),L.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),L.setAttributeNS(null,"x1",X[0]),L.setAttributeNS(null,"y1",X[1]),L.setAttributeNS(null,"x2",N[0]),L.setAttributeNS(null,"y2",N[1]);break;case"radial":const D=c[4],se=c[5],Ae=c[6],Te=c[7];L=this.svgFactory.createElement("svg:radialGradient"),L.setAttributeNS(null,"id",d),L.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),L.setAttributeNS(null,"cx",se[0]),L.setAttributeNS(null,"cy",se[1]),L.setAttributeNS(null,"r",Te),L.setAttributeNS(null,"fx",D[0]),L.setAttributeNS(null,"fy",D[1]),L.setAttributeNS(null,"fr",Ae);break;default:throw new Error(`Unknown RadialAxial type: ${c[1]}`)}for(const X of x){const N=this.svgFactory.createElement("svg:stop");N.setAttributeNS(null,"offset",X[0]),N.setAttributeNS(null,"stop-color",X[1]),L.append(N)}return this.defs.append(L),`url(#${d})`;case"Mesh":return(0,e.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${c[0]}`)}}setDash(c,d){this.current.dashArray=c,this.current.dashPhase=d}constructPath(c,d){const x=this.current;let L=x.x,X=x.y,N=[],D=0;for(const se of c)switch(se|0){case e.OPS.rectangle:L=d[D++],X=d[D++];const Ae=d[D++],Te=d[D++],le=L+Ae,ie=X+Te;N.push("M",o(L),o(X),"L",o(le),o(X),"L",o(le),o(ie),"L",o(L),o(ie),"Z");break;case e.OPS.moveTo:L=d[D++],X=d[D++],N.push("M",o(L),o(X));break;case e.OPS.lineTo:L=d[D++],X=d[D++],N.push("L",o(L),o(X));break;case e.OPS.curveTo:L=d[D+4],X=d[D+5],N.push("C",o(d[D]),o(d[D+1]),o(d[D+2]),o(d[D+3]),o(L),o(X)),D+=6;break;case e.OPS.curveTo2:N.push("C",o(L),o(X),o(d[D]),o(d[D+1]),o(d[D+2]),o(d[D+3])),L=d[D+2],X=d[D+3],D+=4;break;case e.OPS.curveTo3:L=d[D+2],X=d[D+3],N.push("C",o(d[D]),o(d[D+1]),o(L),o(X),o(L),o(X)),D+=4;break;case e.OPS.closePath:N.push("Z");break}N=N.join(" "),x.path&&c.length>0&&c[0]!==e.OPS.rectangle&&c[0]!==e.OPS.moveTo?N=x.path.getAttributeNS(null,"d")+N:(x.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(x.path)),x.path.setAttributeNS(null,"d",N),x.path.setAttributeNS(null,"fill","none"),x.element=x.path,x.setCurrentPoint(L,X)}endPath(){const c=this.current;if(c.path=null,!this.pendingClip)return;if(!c.element){this.pendingClip=null;return}const d=`clippath${f++}`,x=this.svgFactory.createElement("svg:clipPath");x.setAttributeNS(null,"id",d),x.setAttributeNS(null,"transform",s(this.transformMatrix));const L=c.element.cloneNode(!0);if(this.pendingClip==="evenodd"?L.setAttributeNS(null,"clip-rule","evenodd"):L.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,x.append(L),this.defs.append(x),c.activeClipUrl){c.clipGroup=null;for(const X of this.extraStack)X.clipGroup=null;x.setAttributeNS(null,"clip-path",c.activeClipUrl)}c.activeClipUrl=`url(#${d})`,this.tgrp=null}clip(c){this.pendingClip=c}closePath(){const c=this.current;if(c.path){const d=`${c.path.getAttributeNS(null,"d")}Z`;c.path.setAttributeNS(null,"d",d)}}setLeading(c){this.current.leading=-c}setTextRise(c){this.current.textRise=c}setTextRenderingMode(c){this.current.textRenderingMode=c}setHScale(c){this.current.textHScale=c/100}setRenderingIntent(c){}setFlatness(c){}setGState(c){for(const[d,x]of c)switch(d){case"LW":this.setLineWidth(x);break;case"LC":this.setLineCap(x);break;case"LJ":this.setLineJoin(x);break;case"ML":this.setMiterLimit(x);break;case"D":this.setDash(x[0],x[1]);break;case"RI":this.setRenderingIntent(x);break;case"FL":this.setFlatness(x);break;case"Font":this.setFont(x);break;case"CA":this.setStrokeAlpha(x);break;case"ca":this.setFillAlpha(x);break;default:(0,e.warn)(`Unimplemented graphic state operator ${d}`);break}}fill(){const c=this.current;c.element&&(c.element.setAttributeNS(null,"fill",c.fillColor),c.element.setAttributeNS(null,"fill-opacity",c.fillAlpha),this.endPath())}stroke(){const c=this.current;c.element&&(this._setStrokeAttributes(c.element),c.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(c,d=1){const x=this.current;let L=x.dashArray;d!==1&&L.length>0&&(L=L.map(function(X){return d*X})),c.setAttributeNS(null,"stroke",x.strokeColor),c.setAttributeNS(null,"stroke-opacity",x.strokeAlpha),c.setAttributeNS(null,"stroke-miterlimit",o(x.miterLimit)),c.setAttributeNS(null,"stroke-linecap",x.lineCap),c.setAttributeNS(null,"stroke-linejoin",x.lineJoin),c.setAttributeNS(null,"stroke-width",o(d*x.lineWidth)+"px"),c.setAttributeNS(null,"stroke-dasharray",L.map(o).join(" ")),c.setAttributeNS(null,"stroke-dashoffset",o(d*x.dashPhase)+"px")}eoFill(){var c;(c=this.current.element)==null||c.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){var c;(c=this.current.element)==null||c.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const c=this.svgFactory.createElement("svg:rect");c.setAttributeNS(null,"x","0"),c.setAttributeNS(null,"y","0"),c.setAttributeNS(null,"width","1px"),c.setAttributeNS(null,"height","1px"),c.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(c)}paintImageXObject(c){const d=this.getObject(c);if(!d){(0,e.warn)(`Dependent image with object ID ${c} is not ready yet`);return}this.paintInlineImageXObject(d)}paintInlineImageXObject(c,d){const x=c.width,L=c.height,X=_(c,this.forceDataSchema,!!d),N=this.svgFactory.createElement("svg:rect");N.setAttributeNS(null,"x","0"),N.setAttributeNS(null,"y","0"),N.setAttributeNS(null,"width",o(x)),N.setAttributeNS(null,"height",o(L)),this.current.element=N,this.clip("nonzero");const D=this.svgFactory.createElement("svg:image");D.setAttributeNS(R,"xlink:href",X),D.setAttributeNS(null,"x","0"),D.setAttributeNS(null,"y",o(-L)),D.setAttributeNS(null,"width",o(x)+"px"),D.setAttributeNS(null,"height",o(L)+"px"),D.setAttributeNS(null,"transform",`scale(${o(1/x)} ${o(-1/L)})`),d?d.append(D):this._ensureTransformGroup().append(D)}paintImageMaskXObject(c){const d=this.getObject(c.data,c);if(d.bitmap){(0,e.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");return}const x=this.current,L=d.width,X=d.height,N=x.fillColor;x.maskId=`mask${g++}`;const D=this.svgFactory.createElement("svg:mask");D.setAttributeNS(null,"id",x.maskId);const se=this.svgFactory.createElement("svg:rect");se.setAttributeNS(null,"x","0"),se.setAttributeNS(null,"y","0"),se.setAttributeNS(null,"width",o(L)),se.setAttributeNS(null,"height",o(X)),se.setAttributeNS(null,"fill",N),se.setAttributeNS(null,"mask",`url(#${x.maskId})`),this.defs.append(D),this._ensureTransformGroup().append(se),this.paintInlineImageXObject(d,D)}paintFormXObjectBegin(c,d){if(Array.isArray(c)&&c.length===6&&this.transform(c[0],c[1],c[2],c[3],c[4],c[5]),d){const x=d[2]-d[0],L=d[3]-d[1],X=this.svgFactory.createElement("svg:rect");X.setAttributeNS(null,"x",d[0]),X.setAttributeNS(null,"y",d[1]),X.setAttributeNS(null,"width",o(x)),X.setAttributeNS(null,"height",o(L)),this.current.element=X,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(c){const d=this.svgFactory.create(c.width,c.height),x=this.svgFactory.createElement("svg:defs");d.append(x),this.defs=x;const L=this.svgFactory.createElement("svg:g");return L.setAttributeNS(null,"transform",s(c.transform)),d.append(L),this.svg=L,d}_ensureClipGroup(){if(!this.current.clipGroup){const c=this.svgFactory.createElement("svg:g");c.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(c),this.current.clipGroup=c}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",s(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}}},(t,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.PDFNodeStream=void 0;var r=a(1),e=a(32);const p=require$$5,k=require$$5,E=require$$5,b=require$$5,R=/^file:\/\/\/[a-zA-Z]:\//;function S(g){const v=b.parse(g);return v.protocol==="file:"||v.host?v:/^[a-z]:[/\\]/i.test(g)?b.parse(`file:///${g}`):(v.host||(v.protocol="file:"),v)}class A{constructor(v){this.source=v,this.url=S(v.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&v.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var v;return((v=this._fullRequestReader)==null?void 0:v._loaded)??0}getFullReader(){return(0,r.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new s(this):new l(this),this._fullRequestReader}getRangeReader(v,c){if(c<=this._progressiveDataLength)return null;const d=this.isFsUrl?new f(this,v,c):new o(this,v,c);return this._rangeRequestReaders.push(d),d}cancelAllRequests(v){var c;(c=this._fullRequestReader)==null||c.cancel(v);for(const d of this._rangeRequestReaders.slice(0))d.cancel(v)}}n.PDFNodeStream=A;class y{constructor(v){this._url=v.url,this._done=!1,this._storedError=null,this.onProgress=null;const c=v.source;this._contentLength=c.length,this._loaded=0,this._filename=null,this._disableRange=c.disableRange||!1,this._rangeChunkSize=c.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!c.disableStream,this._isRangeSupported=!c.disableRange,this._readableStream=null,this._readCapability=(0,r.createPromiseCapability)(),this._headersCapability=(0,r.createPromiseCapability)()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var d;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const v=this._readableStream.read();return v===null?(this._readCapability=(0,r.createPromiseCapability)(),this.read()):(this._loaded+=v.length,(d=this.onProgress)==null||d.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(v).buffer,done:!1})}cancel(v){if(!this._readableStream){this._error(v);return}this._readableStream.destroy(v)}_error(v){this._storedError=v,this._readCapability.resolve()}_setReadableStream(v){this._readableStream=v,v.on("readable",()=>{this._readCapability.resolve()}),v.on("end",()=>{v.destroy(),this._done=!0,this._readCapability.resolve()}),v.on("error",c=>{this._error(c)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new r.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class _{constructor(v){this._url=v.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=(0,r.createPromiseCapability)();const c=v.source;this._isStreamingSupported=!c.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var d;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const v=this._readableStream.read();return v===null?(this._readCapability=(0,r.createPromiseCapability)(),this.read()):(this._loaded+=v.length,(d=this.onProgress)==null||d.call(this,{loaded:this._loaded}),{value:new Uint8Array(v).buffer,done:!1})}cancel(v){if(!this._readableStream){this._error(v);return}this._readableStream.destroy(v)}_error(v){this._storedError=v,this._readCapability.resolve()}_setReadableStream(v){this._readableStream=v,v.on("readable",()=>{this._readCapability.resolve()}),v.on("end",()=>{v.destroy(),this._done=!0,this._readCapability.resolve()}),v.on("error",c=>{this._error(c)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function h(g,v){return{protocol:g.protocol,auth:g.auth,host:g.hostname,port:g.port,path:g.path,method:"GET",headers:v}}class l extends y{constructor(v){super(v);const c=d=>{if(d.statusCode===404){const N=new r.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=N,this._headersCapability.reject(N);return}this._headersCapability.resolve(),this._setReadableStream(d);const x=N=>this._readableStream.headers[N.toLowerCase()],{allowRangeRequests:L,suggestedLength:X}=(0,e.validateRangeRequestCapabilities)({getResponseHeader:x,isHttp:v.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=L,this._contentLength=X||this._contentLength,this._filename=(0,e.extractFilenameFromHeader)(x)};this._request=null,this._url.protocol==="http:"?this._request=k.request(h(this._url,v.httpHeaders),c):this._request=E.request(h(this._url,v.httpHeaders),c),this._request.on("error",d=>{this._storedError=d,this._headersCapability.reject(d)}),this._request.end()}}class o extends _{constructor(v,c,d){super(v),this._httpHeaders={};for(const L in v.httpHeaders){const X=v.httpHeaders[L];typeof X>"u"||(this._httpHeaders[L]=X)}this._httpHeaders.Range=`bytes=${c}-${d-1}`;const x=L=>{if(L.statusCode===404){const X=new r.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=X;return}this._setReadableStream(L)};this._request=null,this._url.protocol==="http:"?this._request=k.request(h(this._url,this._httpHeaders),x):this._request=E.request(h(this._url,this._httpHeaders),x),this._request.on("error",L=>{this._storedError=L}),this._request.end()}}class s extends y{constructor(v){super(v);let c=decodeURIComponent(this._url.path);R.test(this._url.href)&&(c=c.replace(/^\//,"")),p.lstat(c,(d,x)=>{if(d){d.code==="ENOENT"&&(d=new r.MissingPDFException(`Missing PDF "${c}".`)),this._storedError=d,this._headersCapability.reject(d);return}this._contentLength=x.size,this._setReadableStream(p.createReadStream(c)),this._headersCapability.resolve()})}}class f extends _{constructor(v,c,d){super(v);let x=decodeURIComponent(this._url.path);R.test(this._url.href)&&(x=x.replace(/^\//,"")),this._setReadableStream(p.createReadStream(x,{start:c,end:d-1}))}}},(t,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createResponseStatusError=b,n.extractFilenameFromHeader=E,n.validateRangeRequestCapabilities=k,n.validateResponseStatus=R;var r=a(1),e=a(33),p=a(6);function k({getResponseHeader:S,isHttp:A,rangeChunkSize:y,disableRange:_}){const h={allowRangeRequests:!1,suggestedLength:void 0},l=parseInt(S("Content-Length"),10);return!Number.isInteger(l)||(h.suggestedLength=l,l<=2*y)||_||!A||S("Accept-Ranges")!=="bytes"||(S("Content-Encoding")||"identity")!=="identity"||(h.allowRangeRequests=!0),h}function E(S){const A=S("Content-Disposition");if(A){let y=(0,e.getFilenameFromContentDispositionHeader)(A);if(y.includes("%"))try{y=decodeURIComponent(y)}catch{}if((0,p.isPdfFile)(y))return y}return null}function b(S,A){return S===404||S===0&&A.startsWith("file:")?new r.MissingPDFException('Missing PDF "'+A+'".'):new r.UnexpectedResponseException(`Unexpected server response (${S}) while retrieving PDF "${A}".`,S)}function R(S){return S===200||S===206}},(t,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.getFilenameFromContentDispositionHeader=e;var r=a(1);function e(p){let k=!0,E=b("filename\\*","i").exec(p);if(E){E=E[1];let l=y(E);return l=unescape(l),l=_(l),l=h(l),S(l)}if(E=A(p),E){const l=h(E);return S(l)}if(E=b("filename","i").exec(p),E){E=E[1];let l=y(E);return l=h(l),S(l)}function b(l,o){return new RegExp("(?:^|;)\\s*"+l+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',o)}function R(l,o){if(l){if(!/^[\x00-\xFF]+$/.test(o))return o;try{const s=new TextDecoder(l,{fatal:!0}),f=(0,r.stringToBytes)(o);o=s.decode(f),k=!1}catch{}}return o}function S(l){return k&&/[\x80-\xff]/.test(l)&&(l=R("utf-8",l),k&&(l=R("iso-8859-1",l))),l}function A(l){const o=[];let s;const f=b("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(s=f.exec(l))!==null;){let[,v,c,d]=s;if(v=parseInt(v,10),v in o){if(v===0)break;continue}o[v]=[c,d]}const g=[];for(let v=0;v<o.length&&v in o;++v){let[c,d]=o[v];d=y(d),c&&(d=unescape(d),v===0&&(d=_(d))),g.push(d)}return g.join("")}function y(l){if(l.startsWith('"')){const o=l.slice(1).split('\\"');for(let s=0;s<o.length;++s){const f=o[s].indexOf('"');f!==-1&&(o[s]=o[s].slice(0,f),o.length=s+1),o[s]=o[s].replace(/\\(.)/g,"$1")}l=o.join('"')}return l}function _(l){const o=l.indexOf("'");if(o===-1)return l;const s=l.slice(0,o),g=l.slice(o+1).replace(/^[^']*'/,"");return R(s,g)}function h(l){return!l.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(l)?l:l.replace(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(o,s,f,g){if(f==="q"||f==="Q")return g=g.replace(/_/g," "),g=g.replace(/=([0-9a-fA-F]{2})/g,function(v,c){return String.fromCharCode(parseInt(c,16))}),R(s,g);try{g=atob(g)}catch{}return R(s,g)})}return""}},(t,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.PDFNetworkStream=void 0;var r=a(1),e=a(32);const p=200,k=206;function E(y){const _=y.response;return typeof _!="string"?_:(0,r.stringToBytes)(_).buffer}class b{constructor(_,h={}){this.url=_,this.isHttp=/^https?:/i.test(_),this.httpHeaders=this.isHttp&&h.httpHeaders||Object.create(null),this.withCredentials=h.withCredentials||!1,this.getXhr=h.getXhr||function(){return new XMLHttpRequest},this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(_,h,l){const o={begin:_,end:h};for(const s in l)o[s]=l[s];return this.request(o)}requestFull(_){return this.request(_)}request(_){const h=this.getXhr(),l=this.currXhrId++,o=this.pendingRequests[l]={xhr:h};h.open("GET",this.url),h.withCredentials=this.withCredentials;for(const s in this.httpHeaders){const f=this.httpHeaders[s];typeof f>"u"||h.setRequestHeader(s,f)}return this.isHttp&&"begin"in _&&"end"in _?(h.setRequestHeader("Range",`bytes=${_.begin}-${_.end-1}`),o.expectedStatus=k):o.expectedStatus=p,h.responseType="arraybuffer",_.onError&&(h.onerror=function(s){_.onError(h.status)}),h.onreadystatechange=this.onStateChange.bind(this,l),h.onprogress=this.onProgress.bind(this,l),o.onHeadersReceived=_.onHeadersReceived,o.onDone=_.onDone,o.onError=_.onError,o.onProgress=_.onProgress,h.send(null),l}onProgress(_,h){var o;const l=this.pendingRequests[_];l&&((o=l.onProgress)==null||o.call(l,h))}onStateChange(_,h){var v,c,d;const l=this.pendingRequests[_];if(!l)return;const o=l.xhr;if(o.readyState>=2&&l.onHeadersReceived&&(l.onHeadersReceived(),delete l.onHeadersReceived),o.readyState!==4||!(_ in this.pendingRequests))return;if(delete this.pendingRequests[_],o.status===0&&this.isHttp){(v=l.onError)==null||v.call(l,o.status);return}const s=o.status||p;if(!(s===p&&l.expectedStatus===k)&&s!==l.expectedStatus){(c=l.onError)==null||c.call(l,o.status);return}const g=E(o);if(s===k){const x=o.getResponseHeader("Content-Range"),L=/bytes (\d+)-(\d+)\/(\d+)/.exec(x);l.onDone({begin:parseInt(L[1],10),chunk:g})}else g?l.onDone({begin:0,chunk:g}):(d=l.onError)==null||d.call(l,o.status)}getRequestXhr(_){return this.pendingRequests[_].xhr}isPendingRequest(_){return _ in this.pendingRequests}abortRequest(_){const h=this.pendingRequests[_].xhr;delete this.pendingRequests[_],h.abort()}}class R{constructor(_){this._source=_,this._manager=new b(_.url,{httpHeaders:_.httpHeaders,withCredentials:_.withCredentials}),this._rangeChunkSize=_.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(_){const h=this._rangeRequestReaders.indexOf(_);h>=0&&this._rangeRequestReaders.splice(h,1)}getFullReader(){return(0,r.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new S(this._manager,this._source),this._fullRequestReader}getRangeReader(_,h){const l=new A(this._manager,_,h);return l.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(l),l}cancelAllRequests(_){var h;(h=this._fullRequestReader)==null||h.cancel(_);for(const l of this._rangeRequestReaders.slice(0))l.cancel(_)}}n.PDFNetworkStream=R;class S{constructor(_,h){this._manager=_;const l={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=h.url,this._fullRequestId=_.requestFull(l),this._headersReceivedCapability=(0,r.createPromiseCapability)(),this._disableRange=h.disableRange||!1,this._contentLength=h.length,this._rangeChunkSize=h.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 _=this._fullRequestId,h=this._manager.getRequestXhr(_),l=f=>h.getResponseHeader(f),{allowRangeRequests:o,suggestedLength:s}=(0,e.validateRangeRequestCapabilities)({getResponseHeader:l,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});o&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=(0,e.extractFilenameFromHeader)(l),this._isRangeSupported&&this._manager.abortRequest(_),this._headersReceivedCapability.resolve()}_onDone(_){if(_&&(this._requests.length>0?this._requests.shift().resolve({value:_.chunk,done:!1}):this._cachedChunks.push(_.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const h of this._requests)h.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(_){this._storedError=(0,e.createResponseStatusError)(_,this._url),this._headersReceivedCapability.reject(this._storedError);for(const h of this._requests)h.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(_){var h;(h=this.onProgress)==null||h.call(this,{loaded:_.loaded,total:_.lengthComputable?_.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 _=(0,r.createPromiseCapability)();return this._requests.push(_),_.promise}cancel(_){this._done=!0,this._headersReceivedCapability.reject(_);for(const h of this._requests)h.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class A{constructor(_,h,l){this._manager=_;const o={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=_.url,this._requestId=_.requestRange(h,l,o),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var _;(_=this.onClosed)==null||_.call(this,this)}_onDone(_){const h=_.chunk;this._requests.length>0?this._requests.shift().resolve({value:h,done:!1}):this._queuedChunk=h,this._done=!0;for(const l of this._requests)l.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(_){this._storedError=(0,e.createResponseStatusError)(_,this._url);for(const h of this._requests)h.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(_){var h;this.isStreamingSupported||(h=this.onProgress)==null||h.call(this,{loaded:_.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const h=this._queuedChunk;return this._queuedChunk=null,{value:h,done:!1}}if(this._done)return{value:void 0,done:!0};const _=(0,r.createPromiseCapability)();return this._requests.push(_),_.promise}cancel(_){this._done=!0;for(const h of this._requests)h.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(t,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.PDFFetchStream=void 0;var r=a(1),e=a(32);function p(S,A,y){return{method:"GET",headers:S,signal:y.signal,mode:"cors",credentials:A?"include":"same-origin",redirect:"follow"}}function k(S){const A=new Headers;for(const y in S){const _=S[y];typeof _>"u"||A.append(y,_)}return A}class E{constructor(A){this.source=A,this.isHttp=/^https?:/i.test(A.url),this.httpHeaders=this.isHttp&&A.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var A;return((A=this._fullRequestReader)==null?void 0:A._loaded)??0}getFullReader(){return(0,r.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new b(this),this._fullRequestReader}getRangeReader(A,y){if(y<=this._progressiveDataLength)return null;const _=new R(this,A,y);return this._rangeRequestReaders.push(_),_}cancelAllRequests(A){var y;(y=this._fullRequestReader)==null||y.cancel(A);for(const _ of this._rangeRequestReaders.slice(0))_.cancel(A)}}n.PDFFetchStream=E;class b{constructor(A){this._stream=A,this._reader=null,this._loaded=0,this._filename=null;const y=A.source;this._withCredentials=y.withCredentials||!1,this._contentLength=y.length,this._headersCapability=(0,r.createPromiseCapability)(),this._disableRange=y.disableRange||!1,this._rangeChunkSize=y.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!y.disableStream,this._isRangeSupported=!y.disableRange,this._headers=k(this._stream.httpHeaders);const _=y.url;fetch(_,p(this._headers,this._withCredentials,this._abortController)).then(h=>{if(!(0,e.validateResponseStatus)(h.status))throw(0,e.createResponseStatusError)(h.status,_);this._reader=h.body.getReader(),this._headersCapability.resolve();const l=f=>h.headers.get(f),{allowRangeRequests:o,suggestedLength:s}=(0,e.validateRangeRequestCapabilities)({getResponseHeader:l,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=o,this._contentLength=s||this._contentLength,this._filename=(0,e.extractFilenameFromHeader)(l),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new r.AbortException("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var h;await this._headersCapability.promise;const{value:A,done:y}=await this._reader.read();return y?{value:A,done:y}:(this._loaded+=A.byteLength,(h=this.onProgress)==null||h.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(A).buffer,done:!1})}cancel(A){var y;(y=this._reader)==null||y.cancel(A),this._abortController.abort()}}class R{constructor(A,y,_){this._stream=A,this._reader=null,this._loaded=0;const h=A.source;this._withCredentials=h.withCredentials||!1,this._readCapability=(0,r.createPromiseCapability)(),this._isStreamingSupported=!h.disableStream,this._abortController=new AbortController,this._headers=k(this._stream.httpHeaders),this._headers.append("Range",`bytes=${y}-${_-1}`);const l=h.url;fetch(l,p(this._headers,this._withCredentials,this._abortController)).then(o=>{if(!(0,e.validateResponseStatus)(o.status))throw(0,e.createResponseStatusError)(o.status,l);this._readCapability.resolve(),this._reader=o.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var h;await this._readCapability.promise;const{value:A,done:y}=await this._reader.read();return y?{value:A,done:y}:(this._loaded+=A.byteLength,(h=this.onProgress)==null||h.call(this,{loaded:this._loaded}),{value:new Uint8Array(A).buffer,done:!1})}cancel(A){var y;(y=this._reader)==null||y.cancel(A),this._abortController.abort()}}}],__webpack_module_cache__={};function __w_pdfjs_require__(t){var n=__webpack_module_cache__[t];if(n!==void 0)return n.exports;var a=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t](a,a.exports,__w_pdfjs_require__),a.exports}var __webpack_exports__={};return(()=>{var t=__webpack_exports__;Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AnnotationEditorLayer",{enumerable:!0,get:function(){return e.AnnotationEditorLayer}}),Object.defineProperty(t,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return n.AnnotationEditorParamsType}}),Object.defineProperty(t,"AnnotationEditorType",{enumerable:!0,get:function(){return n.AnnotationEditorType}}),Object.defineProperty(t,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return p.AnnotationEditorUIManager}}),Object.defineProperty(t,"AnnotationLayer",{enumerable:!0,get:function(){return k.AnnotationLayer}}),Object.defineProperty(t,"AnnotationMode",{enumerable:!0,get:function(){return n.AnnotationMode}}),Object.defineProperty(t,"CMapCompressionType",{enumerable:!0,get:function(){return n.CMapCompressionType}}),Object.defineProperty(t,"GlobalWorkerOptions",{enumerable:!0,get:function(){return E.GlobalWorkerOptions}}),Object.defineProperty(t,"InvalidPDFException",{enumerable:!0,get:function(){return n.InvalidPDFException}}),Object.defineProperty(t,"MissingPDFException",{enumerable:!0,get:function(){return n.MissingPDFException}}),Object.defineProperty(t,"OPS",{enumerable:!0,get:function(){return n.OPS}}),Object.defineProperty(t,"PDFDataRangeTransport",{enumerable:!0,get:function(){return a.PDFDataRangeTransport}}),Object.defineProperty(t,"PDFDateString",{enumerable:!0,get:function(){return r.PDFDateString}}),Object.defineProperty(t,"PDFWorker",{enumerable:!0,get:function(){return a.PDFWorker}}),Object.defineProperty(t,"PasswordResponses",{enumerable:!0,get:function(){return n.PasswordResponses}}),Object.defineProperty(t,"PermissionFlag",{enumerable:!0,get:function(){return n.PermissionFlag}}),Object.defineProperty(t,"PixelsPerInch",{enumerable:!0,get:function(){return r.PixelsPerInch}}),Object.defineProperty(t,"RenderingCancelledException",{enumerable:!0,get:function(){return r.RenderingCancelledException}}),Object.defineProperty(t,"SVGGraphics",{enumerable:!0,get:function(){return S.SVGGraphics}}),Object.defineProperty(t,"UNSUPPORTED_FEATURES",{enumerable:!0,get:function(){return n.UNSUPPORTED_FEATURES}}),Object.defineProperty(t,"UnexpectedResponseException",{enumerable:!0,get:function(){return n.UnexpectedResponseException}}),Object.defineProperty(t,"Util",{enumerable:!0,get:function(){return n.Util}}),Object.defineProperty(t,"VerbosityLevel",{enumerable:!0,get:function(){return n.VerbosityLevel}}),Object.defineProperty(t,"XfaLayer",{enumerable:!0,get:function(){return A.XfaLayer}}),Object.defineProperty(t,"build",{enumerable:!0,get:function(){return a.build}}),Object.defineProperty(t,"createPromiseCapability",{enumerable:!0,get:function(){return n.createPromiseCapability}}),Object.defineProperty(t,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return n.createValidAbsoluteUrl}}),Object.defineProperty(t,"getDocument",{enumerable:!0,get:function(){return a.getDocument}}),Object.defineProperty(t,"getFilenameFromUrl",{enumerable:!0,get:function(){return r.getFilenameFromUrl}}),Object.defineProperty(t,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return r.getPdfFilenameFromUrl}}),Object.defineProperty(t,"getXfaPageViewport",{enumerable:!0,get:function(){return r.getXfaPageViewport}}),Object.defineProperty(t,"isPdfFile",{enumerable:!0,get:function(){return r.isPdfFile}}),Object.defineProperty(t,"loadScript",{enumerable:!0,get:function(){return r.loadScript}}),Object.defineProperty(t,"renderTextLayer",{enumerable:!0,get:function(){return R.renderTextLayer}}),Object.defineProperty(t,"shadow",{enumerable:!0,get:function(){return n.shadow}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return a.version}});var n=__w_pdfjs_require__(1),a=__w_pdfjs_require__(2),r=__w_pdfjs_require__(6),e=__w_pdfjs_require__(21),p=__w_pdfjs_require__(5),k=__w_pdfjs_require__(26),E=__w_pdfjs_require__(14),b=__w_pdfjs_require__(12),R=__w_pdfjs_require__(29),S=__w_pdfjs_require__(30),A=__w_pdfjs_require__(28);if(b.isNodeJS){const{PDFNodeStream:y}=__w_pdfjs_require__(31);(0,a.setPDFNetworkStreamFactory)(_=>new y(_))}else{const{PDFNetworkStream:y}=__w_pdfjs_require__(34),{PDFFetchStream:_}=__w_pdfjs_require__(35);(0,a.setPDFNetworkStreamFactory)(h=>(0,r.isValidFetchUrl)(h.url)?new _(h):new y(h))}})(),__webpack_exports__})())})(pdf);var pdfExports=pdf.exports;const pdfjsWorker="/assets/pdf.worker-87da22bf.js";var lib$i={exports:{}},core$i={};(function(t){var n=reactExports,a=pdfExports;function r(u){var w=Object.create(null);return u&&Object.keys(u).forEach(function(H){if(H!=="default"){var W=Object.getOwnPropertyDescriptor(u,H);Object.defineProperty(w,H,W.get?W:{enumerable:!0,get:function(){return u[H]}})}}),w.default=u,Object.freeze(w)}var e=r(n),p=r(a);t.AnnotationType=void 0,function(u){u[u.Text=1]="Text",u[u.Link=2]="Link",u[u.FreeText=3]="FreeText",u[u.Line=4]="Line",u[u.Square=5]="Square",u[u.Circle=6]="Circle",u[u.Polygon=7]="Polygon",u[u.Polyline=8]="Polyline",u[u.Highlight=9]="Highlight",u[u.Underline=10]="Underline",u[u.Squiggly=11]="Squiggly",u[u.StrikeOut=12]="StrikeOut",u[u.Stamp=13]="Stamp",u[u.Caret=14]="Caret",u[u.Ink=15]="Ink",u[u.Popup=16]="Popup",u[u.FileAttachment=17]="FileAttachment"}(t.AnnotationType||(t.AnnotationType={}));var k=function(u,w){return k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(H,W){H.__proto__=W}||function(H,W){for(var Z in W)Object.prototype.hasOwnProperty.call(W,Z)&&(H[Z]=W[Z])},k(u,w)};function E(u,w){if(typeof w!="function"&&w!==null)throw new TypeError("Class extends value "+String(w)+" is not a constructor or null");k(u,w);function H(){this.constructor=u}u.prototype=w===null?Object.create(w):(H.prototype=w.prototype,new H)}var b=function(){return b=Object.assign||function(w){for(var H,W=1,Z=arguments.length;W<Z;W++){H=arguments[W];for(var re in H)Object.prototype.hasOwnProperty.call(H,re)&&(w[re]=H[re])}return w},b.apply(this,arguments)};t.TextDirection=void 0,function(u){u.RightToLeft="RTL",u.LeftToRight="LTR"}(t.TextDirection||(t.TextDirection={}));var R=e.createContext({currentTheme:"light",direction:t.TextDirection.LeftToRight,setCurrentTheme:function(){}}),S=function(u){var w=[];return Object.keys(u).forEach(function(H){H&&u[H]&&w.push(H)}),w.join(" ")},A=function(u){var w=u.children,H=u.testId,W=u.onClick,Z=e.useContext(R).direction,re=Z===t.TextDirection.RightToLeft,de=H?{"data-testid":H}:{};return e.createElement("button",b({className:S({"rpv-core__button":!0,"rpv-core__button--rtl":re}),type:"button",onClick:W},de),w)},y=typeof window<"u"?e.useLayoutEffect:e.useEffect,_=function(u){var w=e.useRef(null),H=u.once,W=u.threshold,Z=u.onVisibilityChanged;return y(function(){var re=w.current;if(re){var de=new IntersectionObserver(function(Ee){Ee.forEach(function(ne){var ue=ne.isIntersecting,Ce=ne.intersectionRatio;Z({isVisible:ue,ratio:Ce}),ue&&H&&(de.unobserve(re),de.disconnect())})},{threshold:W||0});return de.observe(re),function(){de.unobserve(re),de.disconnect()}}},[]),w},h=function(u){var w=u.attrs,H=u.children,W=u.testId,Z=e.useState(!1),re=Z[0],de=Z[1],Ee=W?b(b({},w),{"data-testid":W}):w,ne=function(Ce){Ce.isVisible&&de(!0)},ue=_({once:!0,onVisibilityChanged:ne});return e.createElement("div",b({ref:ue},Ee),re&&H)},l=function(u){var w=u.children,H=e.useRef(),W=e.useRef([]),Z=e.useContext(R).direction,re=Z===t.TextDirection.RightToLeft,de=function(ue){var Ce=H.current;if(Ce)switch(ue.key){case"Tab":ue.preventDefault();break;case"ArrowDown":ue.preventDefault(),Ee(function(we,Oe){return Oe+1});break;case"ArrowUp":ue.preventDefault(),Ee(function(we,Oe){return Oe-1});break;case"End":ue.preventDefault(),Ee(function(we,Oe){return we.length-1});break;case"Home":ue.preventDefault(),Ee(function(we,Oe){return 0});break}},Ee=function(ue){var Ce=H.current;if(Ce){var we=W.current,Oe=we.findIndex(function(Xe){return Xe.getAttribute("tabindex")==="0"}),Ue=Math.min(we.length-1,Math.max(0,ue(we,Oe)));Oe>=0&&Oe<=we.length-1&&we[Oe].setAttribute("tabindex","-1"),we[Ue].setAttribute("tabindex","0"),we[Ue].focus()}},ne=function(ue){var Ce=[];return ue.querySelectorAll('.rpv-core__menu-item[role="menuitem"]').forEach(function(we){if(we instanceof HTMLElement){var Oe=we.parentElement;(Oe===ue||window.getComputedStyle(Oe).display!=="none")&&Ce.push(we)}}),Ce};return y(function(){var ue=H.current;if(ue){var Ce=ne(ue);W.current=Ce}},[]),y(function(){return document.addEventListener("keydown",de),function(){document.removeEventListener("keydown",de)}},[]),e.createElement("div",{ref:H,"aria-orientation":"vertical",className:S({"rpv-core__menu":!0,"rpv-core__menu--rtl":re}),role:"menu",tabIndex:0},w)},o=function(){return e.createElement("div",{"aria-orientation":"horizontal",className:"rpv-core__menu-divider",role:"separator"})},s=function(u){var w=u.children,H=u.ignoreDirection,W=H===void 0?!1:H,Z=u.size,re=Z===void 0?24:Z,de=e.useContext(R).direction,Ee=!W&&de===t.TextDirection.RightToLeft,ne="".concat(re||24,"px");return e.createElement("svg",{"aria-hidden":"true",className:S({"rpv-core__icon":!0,"rpv-core__icon--rtl":Ee}),focusable:"false",height:ne,viewBox:"0 0 24 24",width:ne},w)},f=function(){return e.createElement(s,{size:16},e.createElement("path",{d:"M23.5,0.499l-16.5,23l-6.5-6.5"}))},g=function(u){var w=u.checked,H=w===void 0?!1:w,W=u.children,Z=u.icon,re=Z===void 0?null:Z,de=u.isDisabled,Ee=de===void 0?!1:de,ne=u.testId,ue=u.onClick,Ce=e.useContext(R).direction,we=Ce===t.TextDirection.RightToLeft,Oe=ne?{"data-testid":ne}:{};return e.createElement("button",b({className:S({"rpv-core__menu-item":!0,"rpv-core__menu-item--disabled":Ee,"rpv-core__menu-item--ltr":!we,"rpv-core__menu-item--rtl":we}),role:"menuitem",tabIndex:-1,type:"button",onClick:ue},Oe),e.createElement("div",{className:S({"rpv-core__menu-item-icon":!0,"rpv-core__menu-item-icon--ltr":!we,"rpv-core__menu-item-icon--rtl":we})},re),e.createElement("div",{className:S({"rpv-core__menu-item-label":!0,"rpv-core__menu-item-label--ltr":!we,"rpv-core__menu-item-label--rtl":we})},W),e.createElement("div",{className:S({"rpv-core__menu-item-check":!0,"rpv-core__menu-item-check--ltr":!we,"rpv-core__menu-item-check--rtl":we})},H&&e.createElement(f,null)))},v=function(u){var w=u.ariaLabel,H=w===void 0?"":w,W=u.ariaKeyShortcuts,Z=W===void 0?"":W,re=u.children,de=u.isDisabled,Ee=de===void 0?!1:de,ne=u.isSelected,ue=ne===void 0?!1:ne,Ce=u.testId,we=u.onClick,Oe=e.useContext(R).direction,Ue=Oe===t.TextDirection.RightToLeft,Xe=Ce?{"data-testid":Ce}:{};return e.createElement("button",b({"aria-label":H},Z&&{"aria-keyshortcuts":Z},Ee&&{"aria-disabled":!0},{className:S({"rpv-core__minimal-button":!0,"rpv-core__minimal-button--disabled":Ee,"rpv-core__minimal-button--rtl":Ue,"rpv-core__minimal-button--selected":ue}),type:"button",onClick:we},Xe),re)},c=function(u){var w=u.children,H=u.testId,W=u.onClick,Z=e.useContext(R).direction,re=Z===t.TextDirection.RightToLeft,de=H?{"data-testid":H}:{};return e.createElement("button",b({className:S({"rpv-core__primary-button":!0,"rpv-core__primary-button--rtl":re}),type:"button",onClick:W},de),w)},d=function(u){var w=u.progress,H=e.useContext(R).direction,W=H===t.TextDirection.RightToLeft;return e.createElement("div",{className:S({"rpv-core__progress-bar":!0,"rpv-core__progress-bar--rtl":W})},e.createElement("div",{className:"rpv-core__progress-bar-progress",style:{width:"".concat(w,"%")}},w,"%"))},x=function(){return e.createElement("div",{className:"rpv-core__separator"})},L=function(u){var w=u.size,H=w===void 0?"4rem":w,W=u.testId,Z=e.useState(!1),re=Z[0],de=Z[1],Ee=W?{"data-testid":W}:{},ne=function(Ce){de(Ce.isVisible)},ue=_({onVisibilityChanged:ne});return e.createElement("div",b({},Ee,{className:S({"rpv-core__spinner":!0,"rpv-core__spinner--animating":re}),ref:ue,style:{height:H,width:H}}))},X=function(u){var w=u.constrain,H=e.useContext(R).direction,W=H===t.TextDirection.RightToLeft,Z=e.useRef(),re=e.useRef(),de=e.useRef(),Ee=e.useRef(0),ne=e.useRef(0),ue=e.useRef(0),Ce=e.useRef(0),we={capture:!0},Oe=function(Fe){var it=Z.current,ft=re.current,lt=de.current;if(!(!it||!ft||!lt)){var vt=Ce.current,Lt=Fe.clientX-Ee.current,Ft=ue.current+(W?-Lt:Lt),i=it.parentElement.getBoundingClientRect().width,m=Ft*100/i;if(it.classList.add("rpv-core__splitter--resizing"),w){var M=i-Ft-vt,F=M*100/i;if(!w({firstHalfPercentage:m,firstHalfSize:Ft,secondHalfPercentage:F,secondHalfSize:M}))return}ft.style.width="".concat(m,"%"),document.body.classList.add("rpv-core__splitter-body--resizing"),ft.classList.add("rpv-core__splitter-sibling--resizing"),lt.classList.add("rpv-core__splitter-sibling--resizing")}},Ue=function(Fe){var it=Z.current,ft=re.current,lt=de.current;!it||!ft||!lt||(document.body.classList.remove("rpv-core__splitter-body--resizing"),it.classList.remove("rpv-core__splitter--resizing"),ft.classList.remove("rpv-core__splitter-sibling--resizing"),lt.classList.remove("rpv-core__splitter-sibling--resizing"),document.removeEventListener("mousemove",Oe,we),document.removeEventListener("mouseup",Ue,we))},Xe=function(Fe){var it=re.current;it&&(Ee.current=Fe.clientX,ne.current=Fe.clientY,ue.current=it.getBoundingClientRect().width,document.addEventListener("mousemove",Oe,we),document.addEventListener("mouseup",Ue,we))};return e.useEffect(function(){var Fe=Z.current;Fe&&(Ce.current=Fe.getBoundingClientRect().width,re.current=Fe.previousElementSibling,de.current=Fe.nextElementSibling)},[]),e.createElement("div",{ref:Z,className:"rpv-core__splitter",onMouseDown:Xe})},N=function(u){var w=u.ariaLabel,H=w===void 0?"":w,W=u.autoFocus,Z=W===void 0?!1:W,re=u.placeholder,de=re===void 0?"":re,Ee=u.testId,ne=u.type,ue=ne===void 0?"text":ne,Ce=u.value,we=Ce===void 0?"":Ce,Oe=u.onChange,Ue=u.onKeyDown,Xe=Ue===void 0?function(){}:Ue,Fe=e.useContext(R).direction,it=e.useRef(),ft=Fe===t.TextDirection.RightToLeft,lt={ref:it,"data-testid":"","aria-label":H,className:S({"rpv-core__textbox":!0,"rpv-core__textbox--rtl":ft}),placeholder:de,value:we,onChange:function(vt){return Oe(vt.target.value)},onKeyDown:Xe};return Ee&&(lt["data-testid"]=Ee),y(function(){if(Z){var vt=it.current;if(vt){var Lt=window.scrollX,Ft=window.scrollY;vt.focus(),window.scrollTo(Lt,Ft)}}},[]),ue==="text"?e.createElement("input",b({type:"text"},lt)):e.createElement("input",b({type:"password"},lt))},D=function(){var u=e.useRef(!1);return e.useEffect(function(){return u.current=!0,function(){u.current=!1}},[]),u},se;(function(u){u.NotRenderedYet="NotRenderedYet",u.Rendering="Rendering",u.Rendered="Rendered"})(se||(se={}));var Ae=-9999,Te=function(u){var w=u.doc,H=w.numPages,W=w.loadingTask.docId,Z=e.useMemo(function(){return Array(H).fill(null).map(function(Xe,Fe){return{pageIndex:Fe,renderStatus:se.NotRenderedYet,visibility:Ae}})},[W]),re=e.useRef({currentRenderingPage:-1,startRange:0,endRange:H-1,visibilities:Z}),de=function(){for(var Xe=0;Xe<H;Xe++)re.current.visibilities[Xe].renderStatus=se.NotRenderedYet},Ee=function(Xe){re.current.visibilities[Xe].renderStatus=se.Rendered},ne=function(Xe){re.current.currentRenderingPage!==-1&&re.current.currentRenderingPage!==Xe&&re.current.visibilities[re.current.currentRenderingPage].renderStatus===se.Rendering&&(re.current.visibilities[re.current.currentRenderingPage].renderStatus=se.NotRenderedYet),re.current.visibilities[Xe].renderStatus=se.Rendering,re.current.currentRenderingPage=Xe},ue=function(Xe,Fe){re.current.startRange=Xe,re.current.endRange=Fe;for(var it=0;it<H;it++)(it<Xe||it>Fe)&&(re.current.visibilities[it].visibility=Ae,re.current.visibilities[it].renderStatus=se.NotRenderedYet)},Ce=function(Xe){we(Xe,Ae)},we=function(Xe,Fe){re.current.visibilities[Xe].visibility=Fe},Oe=function(){var Xe=re.current.visibilities.slice(re.current.startRange,re.current.endRange+1).filter(function(vt){return vt.visibility>Ae});if(!Xe.length)return-1;for(var Fe=Xe[0].pageIndex,it=Xe[Xe.length-1].pageIndex,ft=Xe.length,lt=0;lt<ft;lt++){if(Xe[lt].renderStatus===se.Rendering)return-1;if(Xe[lt].renderStatus===se.NotRenderedYet)return Xe[lt].pageIndex}return it+1<H&&re.current.visibilities[it+1].renderStatus!==se.Rendered?it+1:Fe-1>=0&&re.current.visibilities[Fe-1].renderStatus!==se.Rendered?Fe-1:-1},Ue=function(Xe){return Xe>=re.current.startRange&&Xe<=re.current.endRange};return{getHighestPriorityPage:Oe,isInRange:Ue,markNotRendered:de,markRendered:Ee,markRendering:ne,setOutOfRange:Ce,setRange:ue,setVisibility:we}},le={askingPassword:{requirePasswordToOpen:"This document requires a password to open",submit:"Submit"},wrongPassword:{tryAgain:"The password is wrong. Please try again"},pageLabel:"Page {{pageIndex}}"},ie={core:le},fe=ie,_e=e.createContext({l10n:fe,setL10n:function(){}}),oe=0,Me=function(){return oe++},xe=function(u,w,H){var W=function(Z){var re=w.current;if(re){var de=Z.target;if(de instanceof Element&&de.shadowRoot){var Ee=Z.composedPath();Ee.length>0&&!re.contains(Ee[0])&&H()}else re.contains(de)||H()}};e.useEffect(function(){if(u){var Z={capture:!0};return document.addEventListener("click",W,Z),function(){document.removeEventListener("click",W,Z)}}},[])},K=function(u){var w=function(H){H.key==="Escape"&&u()};e.useEffect(function(){return document.addEventListener("keyup",w),function(){document.removeEventListener("keyup",w)}},[])},T=function(){e.useEffect(function(){var u=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",function(){document.body.style.overflow=u}},[])},P=function(u){var w=u.ariaControlsSuffix,H=u.children,W=u.closeOnClickOutside,Z=u.closeOnEscape,re=u.onToggle,de=e.useRef(),Ee=e.useContext(R).direction,ne=Ee===t.TextDirection.RightToLeft;return T(),K(function(){de.current&&Z&&re()}),xe(W,de,re),y(function(){var ue=de.current;if(ue){var Ce=document.body.clientHeight*.75;ue.getBoundingClientRect().height>=Ce&&(ue.style.overflow="auto",ue.style.maxHeight="".concat(Ce,"px"))}},[]),e.createElement("div",{"aria-modal":"true",className:S({"rpv-core__modal-body":!0,"rpv-core__modal-body--rtl":ne}),id:"rpv-core__modal-body-".concat(w),ref:de,role:"dialog",tabIndex:-1},H)},$=function(u){var w=u.children;return e.createElement("div",{className:"rpv-core__modal-overlay"},w)};t.ToggleStatus=void 0,function(u){u.Close="Close",u.Open="Open",u.Toggle="Toggle"}(t.ToggleStatus||(t.ToggleStatus={}));var Y=function(u){var w=e.useState(u),H=w[0],W=w[1],Z=function(re){switch(re){case t.ToggleStatus.Close:W(!1);break;case t.ToggleStatus.Open:W(!0);break;case t.ToggleStatus.Toggle:default:W(function(de){return!de});break}};return{opened:H,toggle:Z}},J=function(u){var w=u.content,H=u.isOpened,W=H===void 0?!1:H,Z=u.target,re=Y(W),de=re.opened,Ee=re.toggle;return e.createElement(e.Fragment,null,Z&&Z(Ee,de),de&&w(Ee))},te=function(u){var w=u.ariaControlsSuffix,H=u.closeOnClickOutside,W=u.closeOnEscape,Z=u.content,re=u.isOpened,de=re===void 0?!1:re,Ee=u.target,ne=w||"".concat(Me()),ue=function(we,Oe){return e.createElement("div",{"aria-expanded":Oe?"true":"false","aria-haspopup":"dialog","aria-controls":"rpv-core__modal-body-".concat(ne)},Ee(we,Oe))},Ce=function(we){return e.createElement($,null,e.createElement(P,{ariaControlsSuffix:ne,closeOnClickOutside:H,closeOnEscape:W,onToggle:we},Z(we)))};return e.createElement(J,{target:Ee?ue:null,content:Ce,isOpened:de})};t.Position=void 0,function(u){u.TopLeft="TOP_LEFT",u.TopCenter="TOP_CENTER",u.TopRight="TOP_RIGHT",u.RightTop="RIGHT_TOP",u.RightCenter="RIGHT_CENTER",u.RightBottom="RIGHT_BOTTOM",u.BottomLeft="BOTTOM_LEFT",u.BottomCenter="BOTTOM_CENTER",u.BottomRight="BOTTOM_RIGHT",u.LeftTop="LEFT_TOP",u.LeftCenter="LEFT_CENTER",u.LeftBottom="LEFT_BOTTOM"}(t.Position||(t.Position={}));var he=function(u,w,H,W){var Z=w.getBoundingClientRect(),re=u.getBoundingClientRect(),de=re.height,Ee=re.width,ne=0,ue=0;switch(H){case t.Position.TopLeft:ne=Z.top-de,ue=Z.left;break;case t.Position.TopCenter:ne=Z.top-de,ue=Z.left+Z.width/2-Ee/2;break;case t.Position.TopRight:ne=Z.top-de,ue=Z.left+Z.width-Ee;break;case t.Position.RightTop:ne=Z.top,ue=Z.left+Z.width;break;case t.Position.RightCenter:ne=Z.top+Z.height/2-de/2,ue=Z.left+Z.width;break;case t.Position.RightBottom:ne=Z.top+Z.height-de,ue=Z.left+Z.width;break;case t.Position.BottomLeft:ne=Z.top+Z.height,ue=Z.left;break;case t.Position.BottomCenter:ne=Z.top+Z.height,ue=Z.left+Z.width/2-Ee/2;break;case t.Position.BottomRight:ne=Z.top+Z.height,ue=Z.left+Z.width-Ee;break;case t.Position.LeftTop:ne=Z.top,ue=Z.left-Ee;break;case t.Position.LeftCenter:ne=Z.top+Z.height/2-de/2,ue=Z.left-Ee;break;case t.Position.LeftBottom:ne=Z.top+Z.height-de,ue=Z.left-Ee;break}return{left:ue+(W.left||0),top:ne+(W.top||0)}},ve=function(u,w,H,W,Z){y(function(){var re=w.current,de=u.current,Ee=H.current;if(!(!de||!re||!Ee)){var ne=Ee.getBoundingClientRect(),ue=he(de,re,W,Z),Ce=ue.top,we=ue.left;de.style.top="".concat(Ce-ne.top,"px"),de.style.left="".concat(we-ne.left,"px")}},[])},Ne=function(u){var w,H=u.customClassName,W=u.position;return e.createElement("div",{className:S((w={"rpv-core__arrow":!0,"rpv-core__arrow--tl":W===t.Position.TopLeft,"rpv-core__arrow--tc":W===t.Position.TopCenter,"rpv-core__arrow--tr":W===t.Position.TopRight,"rpv-core__arrow--rt":W===t.Position.RightTop,"rpv-core__arrow--rc":W===t.Position.RightCenter,"rpv-core__arrow--rb":W===t.Position.RightBottom,"rpv-core__arrow--bl":W===t.Position.BottomLeft,"rpv-core__arrow--bc":W===t.Position.BottomCenter,"rpv-core__arrow--br":W===t.Position.BottomRight,"rpv-core__arrow--lt":W===t.Position.LeftTop,"rpv-core__arrow--lc":W===t.Position.LeftCenter,"rpv-core__arrow--lb":W===t.Position.LeftBottom},w["".concat(H)]=H!=="",w))})},Se=function(u){var w=u.ariaControlsSuffix,H=u.children,W=u.closeOnClickOutside,Z=u.offset,re=u.position,de=u.targetRef,Ee=u.onClose,ne=e.useRef(),ue=e.useRef(),Ce=e.useRef(),we=e.useContext(R).direction,Oe=we===t.TextDirection.RightToLeft;xe(W,ne,Ee),ve(ne,de,Ce,re,Z),y(function(){var Xe=ue.current;if(Xe){var Fe=document.body.clientHeight*.75;Xe.getBoundingClientRect().height>=Fe&&(Xe.style.overflow="auto",Xe.style.maxHeight="".concat(Fe,"px"))}},[]);var Ue="rpv-core__popover-body-inner-".concat(w);return e.createElement(e.Fragment,null,e.createElement("div",{ref:Ce,style:{left:0,position:"absolute",top:0}}),e.createElement("div",{"aria-describedby":Ue,className:S({"rpv-core__popover-body":!0,"rpv-core__popover-body--rtl":Oe}),id:"rpv-core__popover-body-".concat(w),ref:ne,role:"dialog",tabIndex:-1},e.createElement(Ne,{customClassName:"rpv-core__popover-body-arrow",position:re}),e.createElement("div",{id:Ue,ref:ue},H)))},je=function(u){var w=u.closeOnEscape,H=u.onClose,W=e.useRef();return K(function(){W.current&&w&&H()}),e.createElement("div",{className:"rpv-core__popover-overlay",ref:W})},Ie=function(u){var w=u.ariaHasPopup,H=w===void 0?"dialog":w,W=u.ariaControlsSuffix,Z=u.closeOnClickOutside,re=u.closeOnEscape,de=u.content,Ee=u.lockScroll,ne=Ee===void 0?!0:Ee,ue=u.offset,Ce=u.position,we=u.target,Oe=Y(!1),Ue=Oe.opened,Xe=Oe.toggle,Fe=e.useRef(),it=e.useMemo(function(){return W||"".concat(Me())},[]);return e.createElement("div",{ref:Fe,"aria-expanded":Ue?"true":"false","aria-haspopup":H,"aria-controls":"rpv-core__popver-body-".concat(it)},we(Xe,Ue),Ue&&e.createElement(e.Fragment,null,ne&&e.createElement(je,{closeOnEscape:re,onClose:Xe}),e.createElement(Se,{ariaControlsSuffix:it,closeOnClickOutside:Z,offset:ue,position:Ce,targetRef:Fe,onClose:Xe},de(Xe))))},ze=function(u){var w=u.ariaControlsSuffix,H=u.children,W=u.contentRef,Z=u.offset,re=u.position,de=u.targetRef,Ee=e.useRef(),ne=e.useContext(R).direction,ue=ne===t.TextDirection.RightToLeft;return ve(W,de,Ee,re,Z),e.createElement(e.Fragment,null,e.createElement("div",{ref:Ee,style:{left:0,position:"absolute",top:0}}),e.createElement("div",{className:S({"rpv-core__tooltip-body":!0,"rpv-core__tooltip-body--rtl":ue}),id:"rpv-core__tooltip-body-".concat(w),ref:W,role:"tooltip"},e.createElement(Ne,{customClassName:"rpv-core__tooltip-body-arrow",position:re}),e.createElement("div",{className:"rpv-core__tooltip-body-content"},H)))},C=function(u){var w=u.ariaControlsSuffix,H=u.content,W=u.offset,Z=u.position,re=u.target,de=Y(!1),Ee=de.opened,ne=de.toggle,ue=e.useRef(),Ce=e.useRef(),we=e.useMemo(function(){return w||"".concat(Me())},[]);K(function(){ue.current&&document.activeElement&&ue.current.contains(document.activeElement)&&Ue()});var Oe=function(){ne(t.ToggleStatus.Open)},Ue=function(){ne(t.ToggleStatus.Close)},Xe=function(Fe){var it=Fe.relatedTarget instanceof HTMLElement&&Fe.currentTarget.parentElement&&Fe.currentTarget.parentElement.contains(Fe.relatedTarget);it?Ce.current&&(Ce.current.style.display="none"):Ue()};return e.createElement(e.Fragment,null,e.createElement("div",{ref:ue,"aria-describedby":"rpv-core__tooltip-body-".concat(we),onBlur:Xe,onFocus:Oe,onMouseEnter:Oe,onMouseLeave:Ue},re),Ee&&e.createElement(ze,{ariaControlsSuffix:we,contentRef:Ce,offset:W,position:Z,targetRef:ue},H()))};function I(u){var w=u||{},H={},W=function(re,de){var Ee;w=b(b({},w),(Ee={},Ee[re]=de,Ee)),(H[re]||[]).forEach(function(ne){return ne(w[re])})},Z=function(re){return w[re]};return{subscribe:function(re,de){H[re]=(H[re]||[]).concat(de)},unsubscribe:function(re,de){H[re]=(H[re]||[]).filter(function(Ee){return Ee!==de})},update:function(re,de){W(re,de)},updateCurrentValue:function(re,de){var Ee=Z(re);Ee!==void 0&&W(re,de(Ee))},get:function(re){return Z(re)}}}t.LayerRenderStatus=void 0,function(u){u[u.PreRender=0]="PreRender",u[u.DidRender=1]="DidRender"}(t.LayerRenderStatus||(t.LayerRenderStatus={})),t.PageMode=void 0,function(u){u.Attachments="UseAttachments",u.Bookmarks="UseOutlines",u.ContentGroup="UseOC",u.Default="UserNone",u.FullScreen="FullScreen",u.Thumbnails="UseThumbs"}(t.PageMode||(t.PageMode={})),t.RotateDirection=void 0,function(u){u.Backward="Backward",u.Forward="Forward"}(t.RotateDirection||(t.RotateDirection={})),t.ScrollMode=void 0,function(u){u.Horizontal="Horizontal",u.Vertical="Vertical",u.Wrapped="Wrapped"}(t.ScrollMode||(t.ScrollMode={})),t.SpecialZoomLevel=void 0,function(u){u.ActualSize="ActualSize",u.PageFit="PageFit",u.PageWidth="PageWidth"}(t.SpecialZoomLevel||(t.SpecialZoomLevel={}));var G=function(){return typeof window<"u"?/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform):!1},z=function(u,w){switch(w[1].name){case"XYZ":return{bottomOffset:function(H,W){return w[3]===null?W:w[3]},leftOffset:function(H,W){return w[2]===null?0:w[2]},pageIndex:u,scaleTo:w[4]};case"Fit":case"FitB":return{bottomOffset:0,leftOffset:0,pageIndex:u,scaleTo:t.SpecialZoomLevel.PageFit};case"FitH":case"FitBH":return{bottomOffset:w[2],leftOffset:0,pageIndex:u,scaleTo:t.SpecialZoomLevel.PageWidth};default:return{bottomOffset:0,leftOffset:0,pageIndex:u,scaleTo:1}}},q=new Map,ge=new Map,Be=function(u,w){return"".concat(u.loadingTask.docId,"___").concat(w.num,"R").concat(w.gen===0?"":w.gen)},Ze=function(u,w){var H=Be(u,w);return q.has(H)?q.get(H):null},pe=function(u,w,H){q.set(Be(u,w),H)},ot=function(){q.clear(),ge.clear()},Le=function(u,w){if(!u)return Promise.reject("The document is not loaded yet");var H="".concat(u.loadingTask.docId,"___").concat(w),W=ge.get(H);return W?Promise.resolve(W):new Promise(function(Z,re){u.getPage(w+1).then(function(de){ge.set(H,de),de.ref&&pe(u,de.ref,w),Z(de)})})},Ye=function(u,w){return new Promise(function(H){new Promise(function(W){typeof w=="string"?u.getDestination(w).then(function(Z){W(Z)}):W(w)}).then(function(W){if(typeof W[0]=="object"&&W[0]!==null){var Z=W[0],re=Ze(u,Z);re===null?u.getPageIndex(Z).then(function(Ee){pe(u,Z,Ee),Ye(u,w).then(function(ne){return H(ne)})}):H(z(re,W))}else{var de=z(W[0],W);H(de)}})})};function ce(u){var w=e.useRef(u);return e.useEffect(function(){w.current=u},[u]),w.current}var We=function(u,w){var H=e.useRef(),W=function(){H.current&&clearTimeout(H.current)};return e.useEffect(function(){return function(){return W()}},[]),e.useCallback(function(){for(var Z=[],re=0;re<arguments.length;re++)Z[re]=arguments[re];W(),H.current=setTimeout(function(){u.apply(void 0,Z)},w)},[u,w])},nt=function(u){var w=u.targetRef,H=u.onResize;y(function(){var W=new ResizeObserver(function(re){re.forEach(function(de){H(de.target)})}),Z=w.current;if(Z)return W.observe(Z),function(){W.unobserve(Z)}},[])},ut=function(u,w,H){return Math.max(u,Math.min(H,w))},Et=function(u,w,H,W){for(;u<=w;){var Z=(u+w)/2|0,re=W(Z);if(re<H)u=Z+1;else if(re>H)w=Z-1;else return Z}return u>0?u-1:0},kt=function(u,w){var H=w.rect;return u.height!==H.height||u.width!==H.width?H:u},ct=function(u){var w=u.elementRef,H=e.useState(w.current),W=H[0],Z=H[1],re=e.useRef(!1),de=e.useReducer(kt,{height:0,width:0}),Ee=de[0],ne=de[1];return y(function(){w.current!==W&&Z(w.current)}),y(function(){if(W&&!re.current){re.current=!0;var ue=W.getBoundingClientRect(),Ce=ue.height,we=ue.width;ne({rect:{height:Ce,width:we}})}},[W]),e.useEffect(function(){if(W){var ue=new ResizeObserver(function(Ce,we){Ce.forEach(function(Oe){if(Oe.target===W){var Ue=Oe.contentRect,Xe=Ue.height,Fe=Ue.width;ne({rect:{height:Xe,width:Fe}})}})});return ue.observe(W),function(){ue.unobserve(W)}}},[W]),Ee},Ve=function(u){return 1-Math.pow(1-u,4)},be=function(u,w,H,W,Z,re){Z===void 0&&(Z=function(we){return we}),re===void 0&&(re=function(){});var de=0;switch(w){case t.ScrollMode.Horizontal:de=u.scrollLeft;case t.ScrollMode.Vertical:default:de=u.scrollTop;break}var Ee=-1,ne,ue=de-H;if(ue!==0){var Ce=function(we){Ee===-1&&(Ee=we);var Oe=we-Ee,Ue=Math.min(Oe/W,1),Xe=Z(Ue),Fe=de-ue*Xe;switch(w){case t.ScrollMode.Horizontal:u.scrollLeft=Fe;case t.ScrollMode.Vertical:default:u.scrollTop=Fe;break}Fe===H&&re(),Oe<W?ne=window.requestAnimationFrame(Ce):window.cancelAnimationFrame(ne)};ne=window.requestAnimationFrame(Ce)}},j=function(u){var w=D(),H=e.useRef(0),W=e.useState(u),Z=W[0],re=W[1],de=e.useCallback(function(Ee){cancelAnimationFrame(H.current),H.current=requestAnimationFrame(function(){w.current&&re(Ee)})},[]);return e.useEffect(function(){return function(){cancelAnimationFrame(H.current)}},[]),[Z,de]},ye={left:0,top:0},Ge={capture:!1,passive:!0},ht=400,st=function(u){var w=u.elementRef,H=u.isRtl,W=u.scrollMode,Z=u.onSmoothScroll,re=j(ye),de=re[0],Ee=re[1],ne=e.useState(w.current),ue=ne[0],Ce=ne[1],we=H?-1:1,Oe=e.useRef(W);Oe.current=W;var Ue=e.useCallback(function(){return Z(!1)},[]),Xe=e.useCallback(function(){if(ue)switch(Oe.current){case t.ScrollMode.Horizontal:Ee({left:we*ue.scrollLeft,top:0});break;case t.ScrollMode.Vertical:default:Ee({left:0,top:ue.scrollTop});break}},[ue]);y(function(){Ce(w.current)}),y(function(){if(ue)return ue.addEventListener("scroll",Xe,Ge),function(){ue.removeEventListener("scroll",Xe,Ge)}},[ue]);var Fe=e.useCallback(function(it,ft){var lt=w.current;if(lt){var vt=0,Lt=t.ScrollMode.Vertical;switch(Oe.current){case t.ScrollMode.Horizontal:vt=we*it.left,Lt=t.ScrollMode.Horizontal;break;case t.ScrollMode.Vertical:default:vt=it.top,Lt=t.ScrollMode.Vertical;break}if(ft)Z(!0),be(lt,Lt,vt,ht,Ve,Ue);else switch(Oe.current){case t.ScrollMode.Horizontal:lt.scrollLeft=vt;break;case t.ScrollMode.Vertical:default:lt.scrollTop=vt;break}}},[w]);return{scrollOffset:de,scrollTo:Fe}},Ct={height:0,width:0},gt={left:0,top:0},bt=function(u,w,H,W){var Z=0;switch(u){case t.ScrollMode.Horizontal:Z=W.left;break;case t.ScrollMode.Vertical:default:Z=W.top;break}var re=w.length-1,de=function(vt){switch(u){case t.ScrollMode.Horizontal:return w[vt].start.left;case t.ScrollMode.Wrapped:case t.ScrollMode.Vertical:default:return w[vt].start.top}},Ee=Et(0,re,Z,de);if(u===t.ScrollMode.Wrapped)for(var ne=w[Ee].start.top;Ee-1>=0&&w[Ee-1].start.top===ne&&w[Ee-1].start.left>=W.left;)Ee--;for(var ue=Ee,Ce={},we=Ee,Oe=-1;ue<=re;){var Ue=w[ue].size,Xe=Ct,Fe={top:w[ue].start.top-W.top,left:w[ue].start.left-W.left},it={height:H.height-Fe.top,width:H.width-Fe.left};if(u===t.ScrollMode.Horizontal&&it.width<0){ue--;break}if(u===t.ScrollMode.Vertical&&it.height<0){ue--;break}if(u===t.ScrollMode.Wrapped&&(it.width<0||it.height<0)){ue--;break}if(u===t.ScrollMode.Vertical)Xe.width=1;else if(Fe.left<0){var ft=Ue.width- -Fe.left;Xe.width=ft<=H.width?ft/H.width:1}else Xe.width=Ue.width<=it.width?1:it.width/Ue.width;if(u===t.ScrollMode.Horizontal)Xe.height=1;else if(Fe.top<0){var lt=Ue.height- -Fe.top;Xe.height=lt<=H.height?lt/H.height:1}else Xe.height=Ue.height<=it.height?1:it.height/Ue.height;Ce[ue]=Xe.width*Xe.height,Oe<Ce[ue]&&(Oe=Ce[ue],we=ue),ue++}return{start:Ee,end:ue,maxVisbilityIndex:we,visibilities:Ce}},wt=function(u){var w=u.estimateSize,H=u.isRtl,W=u.numberOfItems,Z=u.setStartRange,re=u.setEndRange,de=u.parentRef,Ee=u.scrollMode,ne=u.transformSize,ue=e.useState(!1),Ce=ue[0],we=ue[1],Oe=e.useCallback(function($e){return we($e)},[]),Ue=st({elementRef:de,isRtl:H,scrollMode:Ee,onSmoothScroll:Oe}),Xe=Ue.scrollOffset,Fe=Ue.scrollTo,it=ct({elementRef:de}),ft=e.useRef({scrollOffset:gt,measurements:[],parentRect:Ct,totalSize:Ct});ft.current.scrollOffset=Xe,ft.current.parentRect=it;var lt=e.useState({}),vt=lt[0],Lt=lt[1],Ft=e.useMemo(function(){for(var $e=[],He=0,ke={left:0,top:0},Ke=0,at=0;at<W;at++){var Je=vt[at]||ne(at,w(at)),tt=gt;if(at===0)He=Je.width,ke={left:0,top:0},Ke=Je.height;else switch(Ee){case t.ScrollMode.Wrapped:He+=Je.width,He<it.width?(tt={left:$e[at-1].end.left,top:ke.top},Ke=Math.max(Ke,Je.height)):(He=Je.width,tt={left:ke.left,top:ke.top+Ke},ke={left:tt.left,top:tt.top},Ke=Je.height);break;case t.ScrollMode.Horizontal:case t.ScrollMode.Vertical:default:tt=$e[at-1].end;break}var dt={left:tt.left+Je.width,top:tt.top+Je.height};$e[at]={index:at,start:tt,size:Je,end:dt,visibility:-1}}return $e},[w,Ee,it,vt,ne]),i=Ft[W-1]?{height:Ft[W-1].end.top,width:Ft[W-1].end.left}:Ct;ft.current.measurements=Ft,ft.current.totalSize=i;var m=bt(Ee,ft.current.measurements,ft.current.parentRect,ft.current.scrollOffset),M=m.maxVisbilityIndex,F=m.visibilities,O=m.start,U=m.end,Q=Z(O),ae=re(U),V=e.useMemo(function(){for(var $e=[],He=function(Ke){var at=Ft[Ke],Je=b(b({},at),{visibility:F[Ke]!==void 0?F[Ke]:-1,measureRef:function(tt){if(tt){var dt=tt.getBoundingClientRect();if(!(dt.height===0&&dt.width===0)){var Mt=ne(Ke,{height:dt.height,width:dt.width});(Mt.height!==at.size.height||Mt.width!==at.size.width)&&Lt(function(jt){var mt;return b(b({},jt),(mt={},mt[Ke]=Mt,mt))})}}}});$e.push(Je)},ke=Q;ke<=ae;ke++)He(ke);return $e},[ne,F,Ft]),ee=e.useCallback(function($e,He){var ke=ft.current.measurements,Ke=ut(0,W-1,$e),at=ke[Ke];at&&Fe({left:He.left+at.start.left,top:He.top+at.start.top},!0)},[Fe]),Re=e.useCallback(function(){switch(Ee){case t.ScrollMode.Horizontal:return{position:"relative",height:"100%",width:"".concat(i.width,"px")};case t.ScrollMode.Vertical:default:return{position:"relative",height:"".concat(i.height,"px"),width:"100%"}}},[Ee,i]),me=e.useCallback(function($e){var He,ke,Ke,at=H?"right":"left",Je=H?-1:1;switch(Ee){case t.ScrollMode.Horizontal:return He={height:"100%",width:"".concat($e.size.width,"px")},He[at]=0,He.position="absolute",He.top=0,He.transform="translateX(".concat($e.start.left*Je,"px)"),He;case t.ScrollMode.Wrapped:return ke={height:"".concat($e.size.height,"px"),width:"".concat($e.size.width,"px")},ke[at]=0,ke.position="absolute",ke.top=0,ke.transform="translate(".concat($e.start.left*Je,"px, ").concat($e.start.top,"px)"),ke;case t.ScrollMode.Vertical:default:return Ke={height:"".concat($e.size.height,"px"),width:"100%"},Ke[at]=0,Ke.position="absolute",Ke.top=0,Ke.transform="translateY(".concat($e.start.top,"px)"),Ke}},[H,Ee]),Pe=e.useCallback(function($e){Lt({});var He=ft.current.scrollOffset,ke={left:He.left*$e,top:He.top*$e};Fe(ke,!1)},[]);return{isSmoothScrolling:Ce,startIndex:O,startRange:Q,endIndex:U,endRange:ae,maxVisbilityIndex:M,virtualItems:V,getContainerStyles:Re,getItemStyles:me,scrollToItem:ee,zoom:Pe}},Rt;(function(u){u[u.Solid=1]="Solid",u[u.Dashed=2]="Dashed",u[u.Beveled=3]="Beveled",u[u.Inset=4]="Inset",u[u.Underline=5]="Underline"})(Rt||(Rt={}));var Xt=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"),It=function(u,w,H,W){var Z=parseInt(u,10);return Z>=w&&Z<=H?Z:W},_t=function(u){var w=Xt.exec(u);if(!w)return null;var H=parseInt(w[1],10),W=It(w[2],1,12,1)-1,Z=It(w[3],1,31,1),re=It(w[4],0,23,0),de=It(w[5],0,59,0),Ee=It(w[6],0,59,0),ne=w[7]||"Z",ue=It(w[8],0,23,0),Ce=It(w[9],0,59,0);switch(ne){case"-":re+=ue,de+=Ce;break;case"+":re-=ue,de-=Ce;break}return new Date(Date.UTC(H,W,Z,re,de,Ee))},$t=function(u){return u.contentsObj?u.contentsObj.str:u.contents||""},Ot=function(u){return u.titleObj?u.titleObj.str:u.title||""},dn=function(u){var w=u.annotation,H=e.useContext(R).direction,W=Ot(w),Z=$t(w),re=H===t.TextDirection.RightToLeft,de=e.useRef(),Ee="";if(w.modificationDate){var ne=_t(w.modificationDate);Ee=ne?"".concat(ne.toLocaleDateString(),", ").concat(ne.toLocaleTimeString()):""}return e.useLayoutEffect(function(){var ue=de.current;if(ue){var Ce=document.querySelector('[data-annotation-id="'.concat(w.id,'"]'));if(Ce){var we=Ce;return we.style.zIndex+=1,function(){we.style.zIndex="".concat(parseInt(we.style.zIndex,10)-1)}}}},[]),e.createElement("div",{ref:de,className:S({"rpv-core__annotation-popup-wrapper":!0,"rpv-core__annotation-popup-wrapper--rtl":re}),style:{top:w.annotationType===t.AnnotationType.Popup?"":"100%"}},W&&e.createElement(e.Fragment,null,e.createElement("div",{className:S({"rpv-core__annotation-popup-title":!0,"rpv-core__annotation-popup-title--ltr":!re,"rpv-core__annotation-popup-title--rtl":re})},W),e.createElement("div",{className:"rpv-core__annotation-popup-date"},Ee)),Z&&e.createElement("div",{className:"rpv-core__annotation-popup-content"},Z.split(` `).map(function(ue,Ce){return e.createElement(e.Fragment,{key:Ce},ue,e.createElement("br",null))})))},Yt;(function(u){u.Click="Click",u.Hover="Hover"})(Yt||(Yt={}));var tn=function(){var u=Y(!1),w=u.opened,H=u.toggle,W=e.useState(Yt.Hover),Z=W[0],re=W[1],de=function(){switch(Z){case Yt.Click:w&&re(Yt.Hover),H(t.ToggleStatus.Toggle);break;case Yt.Hover:re(Yt.Click),H(t.ToggleStatus.Open);break}},Ee=function(){Z===Yt.Hover&&H(t.ToggleStatus.Open)},ne=function(){Z===Yt.Hover&&H(t.ToggleStatus.Close)};return{opened:w,closeOnHover:ne,openOnHover:Ee,toggleOnClick:de}},Tt=function(u){var w=u.annotation,H=u.children,W=u.ignoreBorder,Z=u.hasPopup,re=u.isRenderable,de=u.page,Ee=u.viewport,ne=w.rect,ue=tn(),Ce=ue.closeOnHover,we=ue.opened,Oe=ue.openOnHover,Ue=ue.toggleOnClick,Xe=function(m){return[Math.min(m[0],m[2]),Math.min(m[1],m[3]),Math.max(m[0],m[2]),Math.max(m[1],m[3])]},Fe=Xe([ne[0],de.view[3]+de.view[1]-ne[1],ne[2],de.view[3]+de.view[1]-ne[3]]),it=ne[2]-ne[0],ft=ne[3]-ne[1],lt={borderColor:"",borderRadius:"",borderStyle:"",borderWidth:""};if(!W&&w.borderStyle.width>0){switch(w.borderStyle.style){case Rt.Dashed:lt.borderStyle="dashed";break;case Rt.Solid:lt.borderStyle="solid";break;case Rt.Underline:lt=Object.assign({borderBottomStyle:"solid"},lt);break;case Rt.Beveled:case Rt.Inset:}var vt=w.borderStyle.width;lt.borderWidth="".concat(vt,"px"),w.borderStyle.style!==Rt.Underline&&(it=it-2*vt,ft=ft-2*vt);var Lt=w.borderStyle,Ft=Lt.horizontalCornerRadius,i=Lt.verticalCornerRadius;(Ft>0||i>0)&&(lt.borderRadius="".concat(Ft,"px / ").concat(i,"px")),w.color?lt.borderColor="rgb(".concat(w.color[0]|0,", ").concat(w.color[1]|0,", ").concat(w.color[2]|0,")"):lt.borderWidth="0"}return e.createElement(e.Fragment,null,re&&H({popup:{opened:we,closeOnHover:Ce,openOnHover:Oe,toggleOnClick:Ue},slot:{attrs:{style:Object.assign({height:"".concat(ft,"px"),left:"".concat(Fe[0],"px"),top:"".concat(Fe[1],"px"),transform:"matrix(".concat(Ee.transform.join(","),")"),transformOrigin:"-".concat(Fe[0],"px -").concat(Fe[1],"px"),width:"".concat(it,"px")},lt)},children:e.createElement(e.Fragment,null,Z&&we&&e.createElement(dn,{annotation:w}))}}))},bn=function(u){var w=u.annotation,H=u.page,W=u.viewport,Z=w.hasPopup===!1,re=Ot(w),de=$t(w),Ee=!!(w.hasPopup||re||de);return e.createElement(Tt,{annotation:w,hasPopup:Z,ignoreBorder:!0,isRenderable:Ee,page:H,viewport:W},function(ne){return e.createElement("div",b({},ne.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--caret","data-annotation-id":w.id,onClick:ne.popup.toggleOnClick,onMouseEnter:ne.popup.openOnHover,onMouseLeave:ne.popup.closeOnHover}),ne.slot.children)})},Pn=function(u){var w=u.annotation,H=u.page,W=u.viewport,Z=w.hasPopup===!1,re=Ot(w),de=$t(w),Ee=!!(w.hasPopup||re||de),ne=w.rect,ue=ne[2]-ne[0],Ce=ne[3]-ne[1],we=w.borderStyle.width;return e.createElement(Tt,{annotation:w,hasPopup:Z,ignoreBorder:!0,isRenderable:Ee,page:H,viewport:W},function(Oe){return e.createElement("div",b({},Oe.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--circle","data-annotation-id":w.id,onClick:Oe.popup.toggleOnClick,onMouseEnter:Oe.popup.openOnHover,onMouseLeave:Oe.popup.closeOnHover}),e.createElement("svg",{height:"".concat(Ce,"px"),preserveAspectRatio:"none",version:"1.1",viewBox:"0 0 ".concat(ue," ").concat(Ce),width:"".concat(ue,"px")},e.createElement("circle",{cy:Ce/2,fill:"none",rx:ue/2-we/2,ry:Ce/2-we/2,stroke:"transparent",strokeWidth:we||1})),Oe.slot.children)})},Nn=function(u){var w=u.split("/").pop();return w?w.split("#")[0].split("?")[0]:u},Bn=function(u,w){var H=typeof w=="string"?"":URL.createObjectURL(new Blob([w],{type:""})),W=document.createElement("a");W.style.display="none",W.href=H||u,W.setAttribute("download",Nn(u)),document.body.appendChild(W),W.click(),document.body.removeChild(W),H&&URL.revokeObjectURL(H)},Fn=function(u){var w=u.annotation,H=u.page,W=u.viewport,Z=Ot(w),re=$t(w),de=w.hasPopup===!1&&(!!Z||!!re),Ee=function(){var ne=w.file;ne&&Bn(ne.filename,ne.content)};return e.createElement(Tt,{annotation:w,hasPopup:de,ignoreBorder:!0,isRenderable:!0,page:H,viewport:W},function(ne){return e.createElement("div",b({},ne.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--file-attachment","data-annotation-id":w.id,onClick:ne.popup.toggleOnClick,onDoubleClick:Ee,onMouseEnter:ne.popup.openOnHover,onMouseLeave:ne.popup.closeOnHover}),ne.slot.children)})},Xn=function(u){var w=u.annotation,H=u.page,W=u.viewport,Z=w.hasPopup===!1,re=Ot(w),de=$t(w),Ee=!!(w.hasPopup||re||de);return e.createElement(Tt,{annotation:w,hasPopup:Z,ignoreBorder:!0,isRenderable:Ee,page:H,viewport:W},function(ne){return e.createElement("div",b({},ne.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--free-text","data-annotation-id":w.id,onClick:ne.popup.toggleOnClick,onMouseEnter:ne.popup.openOnHover,onMouseLeave:ne.popup.closeOnHover}),ne.slot.children)})},or=function(u){var w=u.annotation,H=u.page,W=u.viewport,Z=Ot(w),re=$t(w),de=!!(Z||re),Ee=["Circle","Ink","Line","Polygon","PolyLine","Square"],ne=!w.parentType||Ee.indexOf(w.parentType)!==-1;return y(function(){if(w.parentId){var ue=document.querySelector('[data-annotation-id="'.concat(w.parentId,'"]')),Ce=document.querySelector('[data-annotation-id="'.concat(w.id,'"]'));if(!(!ue||!Ce)){var we=parseFloat(ue.style.left),Oe=parseFloat(ue.style.top)+parseFloat(ue.style.height);Ce.style.left="".concat(we,"px"),Ce.style.top="".concat(Oe,"px"),Ce.style.transformOrigin="-".concat(we,"px -").concat(Oe,"px")}}},[]),e.createElement(Tt,{annotation:w,hasPopup:ne,ignoreBorder:!1,isRenderable:de,page:H,viewport:W},function(ue){return e.createElement("div",b({},ue.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--popup","data-annotation-id":w.id}),e.createElement(dn,{annotation:w}))})},mr=function(u){var w=u.annotation,H=u.childAnnotation,W=u.page,Z=u.viewport,re=w.hasPopup===!1,de=Ot(w),Ee=$t(w),ne=!!(w.hasPopup||de||Ee),ue=w.quadPoints&&w.quadPoints.length>0;if(ue){var Ce=w.quadPoints.map(function(we){return Object.assign({},w,{rect:[we[2].x,we[2].y,we[1].x,we[1].y],quadPoints:[]})});return e.createElement(e.Fragment,null,Ce.map(function(we,Oe){return e.createElement(mr,{key:Oe,annotation:we,childAnnotation:H,page:W,viewport:Z})}))}return e.createElement(Tt,{annotation:w,hasPopup:re,ignoreBorder:!0,isRenderable:ne,page:W,viewport:Z},function(we){return e.createElement(e.Fragment,null,e.createElement("div",b({},we.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--highlight","data-annotation-id":w.id,onClick:we.popup.toggleOnClick,onMouseEnter:we.popup.openOnHover,onMouseLeave:we.popup.closeOnHover}),we.slot.children),H&&H.annotationType===t.AnnotationType.Popup&&we.popup.opened&&e.createElement(or,{annotation:H,page:W,viewport:Z}))})},xr=function(u){var w=u.annotation,H=u.page,W=u.viewport,Z=w.hasPopup===!1,re=Ot(w),de=$t(w),Ee=!!(w.hasPopup||re||de),ne=w.rect,ue=ne[2]-ne[0],Ce=ne[3]-ne[1],we=w.borderStyle.width;return e.createElement(Tt,{annotation:w,hasPopup:Z,ignoreBorder:!0,isRenderable:Ee,page:H,viewport:W},function(Oe){return e.createElement("div",b({},Oe.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--ink","data-annotation-id":w.id,onClick:Oe.popup.toggleOnClick,onMouseEnter:Oe.popup.openOnHover,onMouseLeave:Oe.popup.closeOnHover}),w.inkLists&&w.inkLists.length&&e.createElement("svg",{height:"".concat(Ce,"px"),preserveAspectRatio:"none",version:"1.1",viewBox:"0 0 ".concat(ue," ").concat(Ce),width:"".concat(ue,"px")},w.inkLists.map(function(Ue,Xe){return e.createElement("polyline",{key:Xe,fill:"none",stroke:"transparent",strokeWidth:we||1,points:Ue.map(function(Fe){return"".concat(Fe.x-ne[0],",").concat(ne[3]-Fe.y)}).join(" ")})})),Oe.slot.children)})},Ir=function(u){var w=u.annotation,H=u.page,W=u.viewport,Z=w.hasPopup===!1,re=Ot(w),de=$t(w),Ee=!!(w.hasPopup||re||de),ne=w.rect,ue=ne[2]-ne[0],Ce=ne[3]-ne[1],we=w.borderStyle.width;return e.createElement(Tt,{annotation:w,hasPopup:Z,ignoreBorder:!0,isRenderable:Ee,page:H,viewport:W},function(Oe){return e.createElement("div",b({},Oe.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--line","data-annotation-id":w.id,onClick:Oe.popup.toggleOnClick,onMouseEnter:Oe.popup.openOnHover,onMouseLeave:Oe.popup.closeOnHover}),e.createElement("svg",{height:"".concat(Ce,"px"),preserveAspectRatio:"none",version:"1.1",viewBox:"0 0 ".concat(ue," ").concat(Ce),width:"".concat(ue,"px")},e.createElement("line",{stroke:"transparent",strokeWidth:we||1,x1:ne[2]-w.lineCoordinates[0],x2:ne[2]-w.lineCoordinates[2],y1:ne[3]-w.lineCoordinates[1],y2:ne[3]-w.lineCoordinates[3]})),Oe.slot.children)})},$r=/^([^\w]*)(javascript|data|vbscript)/im,Or=/&#(\w+)(^\w|;)?/g,Lr=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,Fr=/^([^:]+):/gm,Dr=function(u){return u.replace(Or,function(w,H){return String.fromCharCode(H)})},Nr=function(u,w){w===void 0&&(w="about:blank");var H=Dr(u||"").replace(Lr,"").trim();if(!H)return w;var W=H[0];if(W==="."||W==="/")return H;var Z=H.match(Fr);if(!Z)return H;var re=Z[0];return $r.test(re)?w:H},Br=function(u){var w,H=u.annotation,W=u.doc,Z=u.outlines,re=u.page,de=u.viewport,Ee=u.onExecuteNamedAction,ne=u.onJumpToDest,ue=function(Xe){Xe.preventDefault(),H.action?Ee(H.action):Ye(W,H.dest).then(function(Fe){var it=Fe.pageIndex,ft=Fe.bottomOffset,lt=Fe.leftOffset,vt=Fe.scaleTo;ne(it,ft,lt,vt)})},Ce=!!(H.url||H.dest||H.action||H.unsafeUrl),we={};if(H.url||H.unsafeUrl){var Oe=Nr(H.url||H.unsafeUrl,"");Oe?we={"data-target":"external",href:Oe,rel:"noopener noreferrer nofollow",target:H.newWindow?"_blank":"",title:Oe}:Ce=!1}else we={href:"","data-annotation-link":H.id,onClick:ue};var Ue=Z&&Z.length&&H.dest&&typeof H.dest=="string"?(w=Z.find(function(Xe){return Xe.dest===H.dest}))===null||w===void 0?void 0:w.title:"";return Ue&&(we=Object.assign({},we,{title:Ue,"aria-label":Ue})),e.createElement(Tt,{annotation:H,hasPopup:!1,ignoreBorder:!1,isRenderable:Ce,page:re,viewport:de},function(Xe){return e.createElement("div",b({},Xe.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--link","data-annotation-id":H.id,"data-testid":"core__annotation--link-".concat(H.id)}),e.createElement("a",b({},we)))})},jr=function(u){var w=u.annotation,H=u.page,W=u.viewport,Z=w.hasPopup===!1,re=Ot(w),de=$t(w),Ee=!!(w.hasPopup||re||de),ne=w.rect,ue=ne[2]-ne[0],Ce=ne[3]-ne[1],we=w.borderStyle.width;return e.createElement(Tt,{annotation:w,hasPopup:Z,ignoreBorder:!0,isRenderable:Ee,page:H,viewport:W},function(Oe){return e.createElement("div",b({},Oe.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--polygon","data-annotation-id":w.id,onClick:Oe.popup.toggleOnClick,onMouseEnter:Oe.popup.openOnHover,onMouseLeave:Oe.popup.closeOnHover}),w.vertices&&w.vertices.length&&e.createElement("svg",{height:"".concat(Ce,"px"),preserveAspectRatio:"none",version:"1.1",viewBox:"0 0 ".concat(ue," ").concat(Ce),width:"".concat(ue,"px")},e.createElement("polygon",{fill:"none",stroke:"transparent",strokeWidth:we||1,points:w.vertices.map(function(Ue){return"".concat(Ue.x-ne[0],",").concat(ne[3]-Ue.y)}).join(" ")})),Oe.slot.children)})},Hr=function(u){var w=u.annotation,H=u.page,W=u.viewport,Z=w.hasPopup===!1,re=Ot(w),de=$t(w),Ee=!!(w.hasPopup||re||de),ne=w.rect,ue=ne[2]-ne[0],Ce=ne[3]-ne[1],we=w.borderStyle.width;return e.createElement(Tt,{annotation:w,hasPopup:Z,ignoreBorder:!0,isRenderable:Ee,page:H,viewport:W},function(Oe){return e.createElement("div",b({},Oe.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--polyline","data-annotation-id":w.id,onClick:Oe.popup.toggleOnClick,onMouseEnter:Oe.popup.openOnHover,onMouseLeave:Oe.popup.closeOnHover}),w.vertices&&w.vertices.length&&e.createElement("svg",{height:"".concat(Ce,"px"),preserveAspectRatio:"none",version:"1.1",viewBox:"0 0 ".concat(ue," ").concat(Ce),width:"".concat(ue,"px")},e.createElement("polyline",{fill:"none",stroke:"transparent",strokeWidth:we||1,points:w.vertices.map(function(Ue){return"".concat(Ue.x-ne[0],",").concat(ne[3]-Ue.y)}).join(" ")})),Oe.slot.children)})},Vr=function(u){var w=u.annotation,H=u.page,W=u.viewport,Z=w.hasPopup===!1,re=Ot(w),de=$t(w),Ee=!!(w.hasPopup||re||de),ne=w.rect,ue=ne[2]-ne[0],Ce=ne[3]-ne[1],we=w.borderStyle.width;return e.createElement(Tt,{annotation:w,hasPopup:Z,ignoreBorder:!0,isRenderable:Ee,page:H,viewport:W},function(Oe){return e.createElement("div",b({},Oe.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--square","data-annotation-id":w.id,onClick:Oe.popup.toggleOnClick,onMouseEnter:Oe.popup.openOnHover,onMouseLeave:Oe.popup.closeOnHover}),e.createElement("svg",{height:"".concat(Ce,"px"),preserveAspectRatio:"none",version:"1.1",viewBox:"0 0 ".concat(ue," ").concat(Ce),width:"".concat(ue,"px")},e.createElement("rect",{height:Ce-we,fill:"none",stroke:"transparent",strokeWidth:we||1,x:we/2,y:we/2,width:ue-we})),Oe.slot.children)})},zr=function(u){var w=u.annotation,H=u.page,W=u.viewport,Z=w.hasPopup===!1,re=Ot(w),de=$t(w),Ee=!!(w.hasPopup||re||de);return e.createElement(Tt,{annotation:w,hasPopup:Z,ignoreBorder:!0,isRenderable:Ee,page:H,viewport:W},function(ne){return e.createElement("div",b({},ne.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--squiggly","data-annotation-id":w.id,onClick:ne.popup.toggleOnClick,onMouseEnter:ne.popup.openOnHover,onMouseLeave:ne.popup.closeOnHover}),ne.slot.children)})},Yn=function(u){var w=u.annotation,H=u.page,W=u.viewport,Z=w.hasPopup===!1,re=Ot(w),de=$t(w),Ee=!!(w.hasPopup||re||de);return e.createElement(Tt,{annotation:w,hasPopup:Z,ignoreBorder:!0,isRenderable:Ee,page:H,viewport:W},function(ne){return e.createElement("div",b({},ne.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--stamp","data-annotation-id":w.id,onClick:ne.popup.toggleOnClick,onMouseEnter:ne.popup.openOnHover,onMouseLeave:ne.popup.closeOnHover}),ne.slot.children)})},Wr=function(u){var w=u.annotation,H=u.page,W=u.viewport,Z=w.hasPopup===!1,re=Ot(w),de=$t(w),Ee=!!(w.hasPopup||re||de);return e.createElement(Tt,{annotation:w,hasPopup:Z,ignoreBorder:!0,isRenderable:Ee,page:H,viewport:W},function(ne){return e.createElement("div",b({},ne.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--strike-out","data-annotation-id":w.id,onClick:ne.popup.toggleOnClick,onMouseEnter:ne.popup.openOnHover,onMouseLeave:ne.popup.closeOnHover}),ne.slot.children)})},Ur=function(){return e.createElement(s,{size:16},e.createElement("path",{d:"M.5,16.5a1,1,0,0,0,1,1h2v4l4-4h15a1,1,0,0,0,1-1V3.5a1,1,0,0,0-1-1H1.5a1,1,0,0,0-1,1Z"}),e.createElement("path",{d:"M7.25,9.75A.25.25,0,1,1,7,10a.25.25,0,0,1,.25-.25"}),e.createElement("path",{d:"M12,9.75a.25.25,0,1,1-.25.25A.25.25,0,0,1,12,9.75"}),e.createElement("path",{d:"M16.75,9.75a.25.25,0,1,1-.25.25.25.25,0,0,1,.25-.25"}))},Gr=function(){return e.createElement(s,{size:16},e.createElement("path",{d:"M0.500 12.001 A11.500 11.500 0 1 0 23.500 12.001 A11.500 11.500 0 1 0 0.500 12.001 Z"}),e.createElement("path",{d:"M6.000 12.001 A6.000 6.000 0 1 0 18.000 12.001 A6.000 6.000 0 1 0 6.000 12.001 Z"}),e.createElement("path",{d:"M21.423 5.406L17.415 9.414"}),e.createElement("path",{d:"M14.587 6.585L18.607 2.565"}),e.createElement("path",{d:"M5.405 21.424L9.413 17.416"}),e.createElement("path",{d:"M6.585 14.588L2.577 18.596"}),e.createElement("path",{d:"M18.602 21.419L14.595 17.412"}),e.createElement("path",{d:"M17.419 14.58L21.428 18.589"}),e.createElement("path",{d:"M2.582 5.399L6.588 9.406"}),e.createElement("path",{d:"M9.421 6.581L5.412 2.572"}))},qr=function(){return e.createElement(s,{size:16},e.createElement("path",{d:"M4.000 18.500 A1.500 1.500 0 1 0 7.000 18.500 A1.500 1.500 0 1 0 4.000 18.500 Z"}),e.createElement("path",{d:"M20.5.5l-9.782,9.783a7,7,0,1,0,3,3L17,10h1.5V8.5L19,8h1.5V6.5L21,6h1.5V4.5l1-1V.5Z"}))},Kr=function(){return e.createElement(s,{size:16},e.createElement("path",{d:"M2.000 2.500 L22.000 2.500 L22.000 23.500 L2.000 23.500 Z"}),e.createElement("path",{d:"M6 4.5L6 0.5"}),e.createElement("path",{d:"M18 4.5L18 0.5"}),e.createElement("path",{d:"M10 4.5L10 0.5"}),e.createElement("path",{d:"M14 4.5L14 0.5"}))},zn=function(){return e.createElement(s,{size:16},e.createElement("path",{d:"M17.5 0.498L17.5 23.498"}),e.createElement("path",{d:"M10.5 0.498L10.5 23.498"}),e.createElement("path",{d:"M23.5.5H6.5a6,6,0,0,0,0,12h4"}))},Xr=function(){return e.createElement(s,{size:16},e.createElement("path",{d:"M2.5 22.995L12 6.005 21.5 22.995 2.5 22.995z"}))},Yr=function(u){var w=u.annotation,H=u.childAnnotation,W=u.page,Z=u.viewport,re=w.hasPopup===!1,de=Ot(w),Ee=$t(w),ne=!!(w.hasPopup||de||Ee),ue=w.name?w.name.toLowerCase():"";return e.createElement(Tt,{annotation:w,hasPopup:re,ignoreBorder:!1,isRenderable:ne,page:W,viewport:Z},function(Ce){return e.createElement(e.Fragment,null,e.createElement("div",b({},Ce.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--text","data-annotation-id":w.id,onClick:Ce.popup.toggleOnClick,onMouseEnter:Ce.popup.openOnHover,onMouseLeave:Ce.popup.closeOnHover}),ue&&e.createElement("div",{className:"rpv-core__annotation-text-icon"},ue==="check"&&e.createElement(f,null),ue==="comment"&&e.createElement(Ur,null),ue==="help"&&e.createElement(Gr,null),ue==="insert"&&e.createElement(Xr,null),ue==="key"&&e.createElement(qr,null),ue==="note"&&e.createElement(Kr,null),(ue==="newparagraph"||ue==="paragraph")&&e.createElement(zn,null)),Ce.slot.children),H&&H.annotationType===t.AnnotationType.Popup&&Ce.popup.opened&&e.createElement(or,{annotation:H,page:W,viewport:Z}))})},Zr=function(u){var w=u.annotation,H=u.page,W=u.viewport,Z=w.hasPopup===!1,re=Ot(w),de=$t(w),Ee=!!(w.hasPopup||re||de);return e.createElement(Tt,{annotation:w,hasPopup:Z,ignoreBorder:!0,isRenderable:Ee,page:H,viewport:W},function(ne){return e.createElement("div",b({},ne.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--underline","data-annotation-id":w.id,onClick:ne.popup.toggleOnClick,onMouseEnter:ne.popup.openOnHover,onMouseLeave:ne.popup.closeOnHover}),ne.slot.children)})},Vt=function(u){var w=u.annotations,H=u.doc,W=u.outlines,Z=u.page,re=u.pageIndex,de=u.plugins,Ee=u.rotation,ne=u.scale,ue=u.onExecuteNamedAction,Ce=u.onJumpToDest,we=e.useRef(),Oe=Z.getViewport({rotation:Ee,scale:ne}),Ue=Oe.clone({dontFlip:!0}),Xe=w.filter(function(Fe){return!Fe.parentId});return y(function(){var Fe=we.current;Fe&&de.forEach(function(it){it.onAnnotationLayerRender&&it.onAnnotationLayerRender({annotations:Xe,container:Fe,pageIndex:re,rotation:Ee,scale:ne})})},[]),e.createElement("div",{ref:we,className:"rpv-core__annotation-layer","data-testid":"core__annotation-layer-".concat(re)},Xe.map(function(Fe){var it=w.find(function(ft){return ft.parentId===Fe.id});switch(Fe.annotationType){case t.AnnotationType.Caret:return e.createElement(bn,{key:Fe.id,annotation:Fe,page:Z,viewport:Ue});case t.AnnotationType.Circle:return e.createElement(Pn,{key:Fe.id,annotation:Fe,page:Z,viewport:Ue});case t.AnnotationType.FileAttachment:return e.createElement(Fn,{key:Fe.id,annotation:Fe,page:Z,viewport:Ue});case t.AnnotationType.FreeText:return e.createElement(Xn,{key:Fe.id,annotation:Fe,page:Z,viewport:Ue});case t.AnnotationType.Highlight:return e.createElement(mr,{key:Fe.id,annotation:Fe,childAnnotation:it,page:Z,viewport:Ue});case t.AnnotationType.Ink:return e.createElement(xr,{key:Fe.id,annotation:Fe,page:Z,viewport:Ue});case t.AnnotationType.Line:return e.createElement(Ir,{key:Fe.id,annotation:Fe,page:Z,viewport:Ue});case t.AnnotationType.Link:return e.createElement(Br,{key:Fe.id,annotation:Fe,doc:H,outlines:W,page:Z,viewport:Ue,onExecuteNamedAction:ue,onJumpToDest:Ce});case t.AnnotationType.Polygon:return e.createElement(jr,{key:Fe.id,annotation:Fe,page:Z,viewport:Ue});case t.AnnotationType.Polyline:return e.createElement(Hr,{key:Fe.id,annotation:Fe,page:Z,viewport:Ue});case t.AnnotationType.Popup:return e.createElement(or,{key:Fe.id,annotation:Fe,page:Z,viewport:Ue});case t.AnnotationType.Square:return e.createElement(Vr,{key:Fe.id,annotation:Fe,page:Z,viewport:Ue});case t.AnnotationType.Squiggly:return e.createElement(zr,{key:Fe.id,annotation:Fe,page:Z,viewport:Ue});case t.AnnotationType.Stamp:return e.createElement(Yn,{key:Fe.id,annotation:Fe,page:Z,viewport:Ue});case t.AnnotationType.StrikeOut:return e.createElement(Wr,{key:Fe.id,annotation:Fe,page:Z,viewport:Ue});case t.AnnotationType.Text:return e.createElement(Yr,{key:Fe.id,annotation:Fe,childAnnotation:it,page:Z,viewport:Ue});case t.AnnotationType.Underline:return e.createElement(Zr,{key:Fe.id,annotation:Fe,page:Z,viewport:Ue});default:return e.createElement(e.Fragment,{key:Fe.id})}}))},Jr=function(u){var w=u.page,H=u.renderAnnotations,W=D(),Z=e.useState({loading:!0,annotations:[]}),re=Z[0],de=Z[1];return e.useEffect(function(){w.getAnnotations({intent:"display"}).then(function(Ee){W.current&&de({loading:!1,annotations:Ee})})},[]),re.loading?e.createElement(e.Fragment,null):H(re.annotations)},vr=function(u){var w=u.doc,H=u.outlines,W=u.page,Z=u.pageIndex,re=u.plugins,de=u.rotation,Ee=u.scale,ne=u.onExecuteNamedAction,ue=u.onJumpToDest,Ce=function(we){return e.createElement(Vt,{annotations:we,doc:w,outlines:H,page:W,pageIndex:Z,plugins:re,rotation:de,scale:Ee,onExecuteNamedAction:ne,onJumpToDest:ue})};return e.createElement(Jr,{page:W,renderAnnotations:Ce})},Qr=function(u,w){var H,W;if(Math.floor(u)===u)return[u,1];var Z=1/u;if(Z>w)return[1,w];if(Math.floor(Z)===Z)return[1,Z];for(var re=u>1?Z:u,de=0,Ee=1,ne=1,ue=1;;){var Ce=de+ne,we=Ee+ue;if(we>w)break;re<=Ce/we?(H=[Ce,we],ne=H[0],ue=H[1]):(W=[Ce,we],de=W[0],Ee=W[1])}var Oe=(de/Ee+ne/ue)/2;return re<Oe?re===u?[de,Ee]:[Ee,de]:re===u?[ne,ue]:[ue,ne]},Zn=function(u,w){var H=u%w;return H===0?u:Math.floor(u-H)},ea=4096*4096,gr=function(u){var w=u.canvasLayerRef,H=u.height,W=u.page,Z=u.pageIndex,re=u.plugins,de=u.rotation,Ee=u.scale,ne=u.width,ue=u.onRenderCanvasCompleted,Ce=e.useRef();return y(function(){var we=Ce.current;we&&we.cancel();var Oe=w.current;re.forEach(function(m){m.onCanvasLayerRender&&m.onCanvasLayerRender({ele:Oe,pageIndex:Z,rotation:de,scale:Ee,status:t.LayerRenderStatus.PreRender})});var Ue=W.getViewport({rotation:de,scale:Ee}),Xe=window.devicePixelRatio||1,Fe=Math.sqrt(ea/(Ue.width*Ue.height)),it=Xe>Fe;it?Oe.style.transform="scale(1, 1)":Oe.style.removeProperty("transform");var ft=Math.min(Fe,Xe),lt=Qr(ft,8),vt=lt[0],Lt=lt[1];Oe.width=Zn(Ue.width*ft,vt),Oe.height=Zn(Ue.height*ft,vt),Oe.style.width="".concat(Zn(Ue.width,Lt),"px"),Oe.style.height="".concat(Zn(Ue.height,Lt),"px"),Oe.hidden=!0;var Ft=Oe.getContext("2d",{alpha:!1}),i=it||Xe!==1?[ft,0,0,ft,0,0]:null;return Ce.current=W.render({canvasContext:Ft,transform:i,viewport:Ue}),Ce.current.promise.then(function(){Oe.hidden=!1,re.forEach(function(m){m.onCanvasLayerRender&&m.onCanvasLayerRender({ele:Oe,pageIndex:Z,rotation:de,scale:Ee,status:t.LayerRenderStatus.DidRender})}),ue()},function(){ue()}),function(){Oe&&(Oe.width=0,Oe.height=0)}},[]),e.createElement("div",{className:"rpv-core__canvas-layer",style:{height:"".concat(H,"px"),width:"".concat(ne,"px")}},e.createElement("canvas",{ref:w}))},ta=function(u){var w=u.height,H=u.page,W=u.rotation,Z=u.scale,re=u.width,de=e.useRef(),Ee=function(){var ne=de.current;ne&&(ne.innerHTML="")};return y(function(){var ne=de.current,ue=H.getViewport({rotation:W,scale:Z});H.getOperatorList().then(function(Ce){Ee();var we=new p.SVGGraphics(H.commonObjs,H.objs);we.getSVG(Ce,ue).then(function(Oe){Oe.style.height="".concat(w,"px"),Oe.style.width="".concat(re,"px"),ne.appendChild(Oe)})})},[]),e.createElement("div",{className:"rpv-core__svg-layer",ref:de})},na=function(u){var w=u.containerRef,H=u.page,W=u.pageIndex,Z=u.plugins,re=u.rotation,de=u.scale,Ee=u.onRenderTextCompleted,ne=e.useRef(),ue=function(){var Ce=w.current;if(Ce){var we=[].slice.call(Ce.querySelectorAll(".rpv-core__text-layer-text"));we.forEach(function(Ue){return Ce.removeChild(Ue)});var Oe=[].slice.call(Ce.querySelectorAll('br[role="presentation"]'));Oe.forEach(function(Ue){return Ce.removeChild(Ue)})}};return y(function(){var Ce=ne.current;Ce&&Ce.cancel();var we=w.current;if(we){we.removeAttribute("data-testid");var Oe=H.getViewport({rotation:re,scale:de});return Z.forEach(function(Ue){Ue.onTextLayerRender&&Ue.onTextLayerRender({ele:we,pageIndex:W,scale:de,status:t.LayerRenderStatus.PreRender})}),H.getTextContent().then(function(Ue){ue(),ne.current=p.renderTextLayer({container:we,textContent:Ue,viewport:Oe}),ne.current.promise.then(function(){we.setAttribute("data-testid","core__text-layer-".concat(W));var Xe=[].slice.call(we.children);Xe.forEach(function(Fe){Fe.classList.contains("rpv-core__text-layer-text--not")||Fe.classList.add("rpv-core__text-layer-text")}),Z.forEach(function(Fe){Fe.onTextLayerRender&&Fe.onTextLayerRender({ele:we,pageIndex:W,scale:de,status:t.LayerRenderStatus.DidRender})}),Ee()},function(){we.removeAttribute("data-testid"),Ee()})}),function(){var Ue;ue(),(Ue=ne.current)===null||Ue===void 0||Ue.cancel()}}},[]),e.createElement("div",{className:"rpv-core__text-layer",ref:w})},Wn=function(u){var w=u.doc,H=u.outlines,W=u.pageIndex,Z=u.pageRotation,re=u.pageSize,de=u.plugins,Ee=u.renderPage,ne=u.renderQueueKey,ue=u.rotation,Ce=u.scale,we=u.shouldRender,Oe=u.onExecuteNamedAction,Ue=u.onJumpToDest,Xe=u.onRenderCompleted,Fe=u.onRotatePage,it=D(),ft=e.useState(null),lt=ft[0],vt=ft[1],Lt=e.useState(!1),Ft=Lt[0],i=Lt[1],m=e.useState(!1),M=m[0],F=m[1],O=e.useRef(),U=e.useRef(),Q=Math.abs(ue+Z)%180===0,ae=re.pageWidth*Ce,V=re.pageHeight*Ce,ee=Q?ae:V,Re=Q?V:ae,me=(re.rotation+ue+Z)%360,Pe=e.useRef(0),$e=function(){Le(w,W).then(function(Je){it.current&&(Pe.current=ne,vt(Je))})},He=function(Je){return e.createElement(e.Fragment,null,Je.canvasLayer.children,Je.textLayer.children,Je.annotationLayer.children)},ke=Ee||He,Ke=function(){it.current&&i(!0)},at=function(){it.current&&F(!0)};return e.useEffect(function(){vt(null),i(!1),F(!1)},[Z,ue,Ce]),e.useEffect(function(){we&&it.current&&!lt&&$e()},[we,lt]),e.useEffect(function(){Ft&&M&&(ne!==Pe.current?(vt(null),i(!1),F(!1)):Xe(W))},[Ft,M]),e.createElement("div",{className:"rpv-core__page-layer","data-testid":"core__page-layer-".concat(W),style:{height:"".concat(Re,"px"),width:"".concat(ee,"px")}},lt?e.createElement(e.Fragment,null,ke({annotationLayer:{attrs:{},children:e.createElement(vr,{doc:w,outlines:H,page:lt,pageIndex:W,plugins:de,rotation:me,scale:Ce,onExecuteNamedAction:Oe,onJumpToDest:Ue})},canvasLayer:{attrs:{},children:e.createElement(gr,{canvasLayerRef:O,height:Re,page:lt,pageIndex:W,plugins:de,rotation:me,scale:Ce,width:ee,onRenderCanvasCompleted:Ke})},canvasLayerRendered:Ft,doc:w,height:Re,pageIndex:W,rotation:me,scale:Ce,svgLayer:{attrs:{},children:e.createElement(ta,{height:Re,page:lt,rotation:me,scale:Ce,width:ee})},textLayer:{attrs:{},children:e.createElement(na,{containerRef:U,page:lt,pageIndex:W,plugins:de,rotation:me,scale:Ce,onRenderTextCompleted:at})},textLayerRendered:M,width:ee,markRendered:Xe,onRotatePage:function(Je){return Fe(W,Je)}}),de.map(function(Je,tt){return Je.renderPageLayer?e.createElement(e.Fragment,{key:tt},Je.renderPageLayer({canvasLayerRef:O,canvasLayerRendered:Ft,doc:w,height:Re,pageIndex:W,rotation:me,scale:Ce,textLayerRef:U,textLayerRendered:M,width:ee})):e.createElement(e.Fragment,{key:tt})})):e.createElement(L,{testId:"core__page-layer-loading-".concat(W)}))},ra=function(u){var w=u.split(/\./).pop();return w?w.toLowerCase():""},_r=17,aa=8,sr=function(u,w,H,W){switch(W){case t.SpecialZoomLevel.ActualSize:return 1;case t.SpecialZoomLevel.PageFit:return Math.min((u.clientWidth-_r)/H,(u.clientHeight-2*aa)/w);case t.SpecialZoomLevel.PageWidth:return(u.clientWidth-_r)/H}},ia=function(u){var w=[];return u.items&&u.items.length>0&&(w=w.concat(br(u.items))),w},br=function(u){var w=[];return u.map(function(H){w=w.concat(H).concat(ia(H))}),w},oa=function(u){var w=D(),H=e.useState([]),W=H[0],Z=H[1];return e.useEffect(function(){u.getOutline().then(function(re){if(w.current&&re!==null){var de=br(re);Z(de)}})},[]),W},Er=3,sa={buildPageStyles:function(){return{}},tranformSize:function(u){var w=u.size;return w}},ca=function(u){var w=u.currentFile,H=u.defaultScale,W=u.doc,Z=u.initialPage,re=u.initialRotation,de=u.initialScale,Ee=u.pageLayout,ne=u.pageSizes,ue=u.plugins,Ce=u.renderPage,we=u.scrollMode,Oe=u.viewerState,Ue=u.onDocumentLoad,Xe=u.onOpenFile,Fe=u.onPageChange,it=u.onRotate,ft=u.onRotatePage,lt=u.onZoom,vt=W.numPages,Lt=W.loadingTask.docId,Ft=e.useContext(_e).l10n,i=e.useContext(R),m=i.direction===t.TextDirection.RightToLeft,M=e.useRef(),F=e.useRef(),O=e.useState(Z),U=O[0],Q=O[1],ae=e.useRef(null),V=e.useState(re),ee=V[0],Re=V[1],me=ce(ee),Pe=e.useState(!1),$e=Pe[0],He=Pe[1],ke=e.useState(new Map),Ke=ke[0],at=ke[1],Je=e.useState(we),tt=Je[0],dt=Je[1],Mt=ce(tt),jt=oa(W),mt=e.useState(de),Zt=mt[0],mn=mt[1],At=e.useRef(Oe),hn=e.useRef(typeof H=="string"?H:null),ln=e.useState(-1),_n=ln[0],fn=ln[1],cn=e.useState(0),Dt=cn[0],un=cn[1],Ut=Te({doc:W});e.useEffect(function(){return function(){ot()}},[Lt]);var qt=e.useMemo(function(){return Object.assign({},sa,Ee)},[]),$n=e.useCallback(function(et){var St=[ne[et].pageHeight,ne[et].pageWidth],yt=Math.abs(ee)%180===0?{height:St[0],width:St[1]}:{height:St[1],width:St[0]};return{height:yt.height*Zt,width:yt.width*Zt}},[ee,Zt]),En=e.useCallback(function(et){return Math.max(et-Er,0)},[]),Mn=e.useCallback(function(et){return Math.min(et+Er,vt-1)},[vt]),Sn=e.useCallback(function(et,St){return qt.tranformSize({numPages:vt,pageIndex:et,size:St})},[]),Gt=wt({estimateSize:$n,isRtl:m,numberOfItems:vt,parentRef:F,scrollMode:tt,setStartRange:En,setEndRange:Mn,transformSize:Sn}),wn=We(function(et){hn.current&&(fn(-1),xt(hn.current))},200);nt({targetRef:F,onResize:wn});var zt=function(et){var St=et;ue.forEach(function(yt){yt.onViewerStateChange&&(St=yt.onViewerStateChange(St))}),At.current=St},xn=function(){return F.current},jn=function(){return At.current},Dn=e.useCallback(function(et,St,yt,pn){var kn=F.current,vn=At.current;!kn||!vn||Le(W,et).then(function(Tn){var nn=Tn.getViewport({scale:1}),On=0,tr=(typeof St=="function"?St(nn.width,nn.height):St)||0,Hn=(typeof yt=="function"?yt(nn.width,nn.height):yt)||0,Vn=vn.scale;switch(pn){case t.SpecialZoomLevel.PageFit:On=0,Hn=0,xt(t.SpecialZoomLevel.PageFit);break;case t.SpecialZoomLevel.PageWidth:Vn=sr(kn,ne[et].pageHeight,ne[et].pageWidth,t.SpecialZoomLevel.PageWidth),On=(nn.height-tr)*Vn,Hn=Hn*Vn,xt(Vn);break;default:On=(nn.height-tr)*Vn,Hn=Hn*Vn;break}switch(vn.scrollMode){case t.ScrollMode.Horizontal:Gt.scrollToItem(et,{left:Hn,top:0});break;case t.ScrollMode.Vertical:default:Gt.scrollToItem(et,{left:0,top:On});break}})},[]),pt=e.useCallback(function(et){0<=et&&et<vt&&Gt.scrollToItem(et,{left:0,top:0})},[]),Jt=e.useCallback(function(et){ra(et.name).toLowerCase()==="pdf"&&new Promise(function(St){var yt=new FileReader;yt.readAsArrayBuffer(et),yt.onload=function(){var pn=new Uint8Array(yt.result);St(pn)}}).then(function(St){Xe(et.name,St)})},[Xe]),Kt=e.useCallback(function(et){var St=et===t.RotateDirection.Backward?-90:90,yt=At.current.rotation,pn=yt===360||yt===-360?St:yt+St;Ut.markNotRendered(),Re(pn),zt(b(b({},At.current),{rotation:pn})),it({direction:et,doc:W,rotation:pn})},[]),on=e.useCallback(function(et,St){var yt=St===t.RotateDirection.Backward?-90:90,pn=At.current.pagesRotation,kn=pn.has(et)?pn.get(et):re,vn=kn+yt,Tn=pn.set(et,vn);at(Tn),He(function(nn){return!nn}),zt(b(b({},At.current),{pagesRotation:Tn,rotatedPage:et})),ft({direction:St,doc:W,pageIndex:et,rotation:vn}),Ut.markRendering(et),fn(et)},[]),Nt=e.useCallback(function(et){zt(b(b({},At.current),{scrollMode:et})),dt(et)},[]),xt=e.useCallback(function(et){var St=F.current,yt=At.current.pageIndex;if(!(yt<0||yt>=vt)){var pn=ne[yt].pageHeight,kn=ne[yt].pageWidth,vn=St?typeof et=="string"?sr(St,pn,kn,et):et:1;hn.current=typeof et=="string"?et:null,vn!==At.current.scale&&(Gt.zoom(vn/At.current.scale),un(function(Tn){return Tn+1}),Ut.markNotRendered(),mn(vn),lt({doc:W,scale:vn}),zt(b(b({},At.current),{scale:vn})))}},[]);e.useEffect(function(){var et={getPagesContainer:xn,getViewerState:jn,jumpToDestination:Dn,jumpToPage:pt,openFile:Jt,rotate:Kt,rotatePage:on,setViewerState:zt,switchScrollMode:Nt,zoom:xt};return ue.forEach(function(St){St.install&&St.install(et)}),function(){ue.forEach(function(St){St.uninstall&&St.uninstall(et)})}},[Lt]),e.useEffect(function(){Ue({doc:W,file:w}),ue.forEach(function(et){et.onDocumentLoad&&et.onDocumentLoad({doc:W,file:w})}),Z&&pt(Z)},[Lt]),y(function(){var et=At.current.pageIndex;et>-1&&Mt!==tt&&Gt.scrollToItem(et,{left:0,top:0})},[tt]),y(function(){var et=At.current.pageIndex;et>-1&&me!==ee&&Gt.scrollToItem(et,{left:0,top:0})},[ee]),e.useEffect(function(){var et=Gt.isSmoothScrolling;et||(ae.current===null||ae.current!==U)&&(ae.current=U,Fe({currentPage:U,doc:W}))},[U,Gt.isSmoothScrolling]),e.useEffect(function(){var et=Gt.startRange,St=Gt.endRange,yt=Gt.maxVisbilityIndex,pn=Gt.virtualItems,kn=yt;Q(kn),zt(b(b({},At.current),{pageIndex:kn})),Ut.setRange(et,St);for(var vn=function(nn){var On=pn.find(function(tr){return tr.index===nn});On&&Ut.setVisibility(nn,On.visibility)},Tn=et;Tn<=St;Tn++)vn(Tn);Rn()},[Gt.startRange,Gt.endRange,Gt.maxVisbilityIndex,$e,ee,Zt]);var en=e.useCallback(function(et){Ut.markRendered(et),Rn()},[Dt]),Rn=function(){var et=Ut.getHighestPriorityPage();et>-1&&Ut.isInRange(et)&&(Ut.markRendering(et),fn(et))},er=function(et){var St=U-1,yt=U+1;switch(et){case"FirstPage":pt(0);break;case"LastPage":pt(vt-1);break;case"NextPage":yt<vt&&pt(yt);break;case"PrevPage":St>=0&&pt(St);break}},Cn=e.useCallback(function(){var et=Ft&&Ft.core?Ft.core.pageLabel:"Page {{pageIndex}}",St={attrs:{"data-testid":"core__inner-container",ref:M,style:{height:"100%"}},children:e.createElement(e.Fragment,null),subSlot:{attrs:{"data-testid":"core__inner-pages",className:S({"rpv-core__inner-pages":!0,"rpv-core__inner-pages--horizontal":tt===t.ScrollMode.Horizontal,"rpv-core__inner-pages--rtl":m,"rpv-core__inner-pages--vertical":tt===t.ScrollMode.Vertical,"rpv-core__inner-pages--wrapped":tt===t.ScrollMode.Wrapped}),ref:F,style:{height:"100%",overflow:"auto",position:"relative"}},children:e.createElement("div",{style:Gt.getContainerStyles()},Gt.virtualItems.map(function(yt){return e.createElement("div",{"aria-label":et.replace("{{pageIndex}}","".concat(yt.index+1)),className:"rpv-core__inner-page",key:yt.index,role:"region",style:Object.assign({},Gt.getItemStyles(yt),qt.buildPageStyles({numPages:vt,pageIndex:yt.index}))},e.createElement(Wn,{doc:W,outlines:jt,pageIndex:yt.index,pageRotation:Ke.has(yt.index)?Ke.get(yt.index):0,pageSize:ne[yt.index],plugins:ue,renderPage:Ce,renderQueueKey:Dt,rotation:ee,scale:Zt,shouldRender:_n===yt.index,onExecuteNamedAction:er,onJumpToDest:Dn,onRenderCompleted:en,onRotatePage:on}))}))}};return ue.forEach(function(yt){yt.renderViewer&&(St=yt.renderViewer({containerRef:M,doc:W,pagesRotation:Ke,pageSizes:ne,rotation:ee,slot:St,themeContext:i,jumpToPage:pt,openFile:Jt,rotate:Kt,rotatePage:on,switchScrollMode:Nt,zoom:xt}))}),St},[ue,Gt]),Ht=e.useCallback(function(et){return e.createElement("div",b({},et.attrs,{style:et.attrs&&et.attrs.style?et.attrs.style:{}}),et.children,et.subSlot&&Ht(et.subSlot))},[]);return Ht(Cn())},Sr=[.1,.2,.3,.4,.5,.6,.7,.8,.9,1,1.1,1.3,1.5,1.7,1.9,2.1,2.4,2.7,3,3.3,3.7,4.1,4.6,5.1,5.7,6.3,7,7.7,8.5,9.4,10],la=function(u){var w=Sr.findIndex(function(H){return H>=u});return w===-1||w===0?u:Sr[w-1]},cr=45,ua=45,da=function(u){var w=u.defaultScale,H=u.doc,W=u.render,Z=u.scrollMode,re=e.useRef(),de=e.useState(1),Ee=de[0],ne=de[1],ue=e.useState([]),Ce=ue[0],we=ue[1];return e.useLayoutEffect(function(){var Oe=Array(H.numPages).fill(0).map(function(Ue,Xe){return new Promise(function(Fe,it){Le(H,Xe).then(function(ft){var lt=ft.getViewport({scale:1});Fe({pageHeight:lt.height,pageWidth:lt.width,rotation:lt.rotation})})})});Promise.all(Oe).then(function(Ue){we(Ue);var Xe=re.current;if(!(!Xe||Ue.length===0)){var Fe=Ue[0].pageWidth,it=Ue[0].pageHeight,ft=Xe.parentElement,lt=(ft.clientWidth-ua)/Fe,vt=(ft.clientHeight-cr)/it,Lt=lt;switch(Z){case t.ScrollMode.Horizontal:Lt=Math.min(lt,vt);break;case t.ScrollMode.Vertical:default:Lt=lt;break}var Ft=w?typeof w=="string"?sr(ft,it,Fe,w):w:la(Lt);ne(Ft)}})},[H.loadingTask.docId]),Ce.length===0?e.createElement("div",{className:"rpv-core__page-size-calculator","data-testid":"core__page-size-calculating",ref:re},e.createElement(L,null)):W(Ce,Ee)},Jn=function(){function u(){}return u}(),In;(function(u){u[u.REQUIRE_PASSWORD=0]="REQUIRE_PASSWORD",u[u.WRONG_PASSWORD=1]="WRONG_PASSWORD"})(In||(In={}));var Qn=function(u){E(w,u);function w(H,W){var Z=u.call(this)||this;return Z.verifyPassword=H,Z.submitPassword=W,Z}return w}(Jn),Rr=function(u){var w=u.submitPassword,H=u.verifyPassword,W=u.onDocumentAskPassword,Z=e.useContext(_e).l10n,re=e.useState(""),de=re[0],Ee=re[1],ne=e.useContext(R).direction,ue=ne===t.TextDirection.RightToLeft,Ce=function(){return H(de)},we=function(Oe){Oe.key==="Enter"&&Ce()};return e.useEffect(function(){W&&W({verifyPassword:H})},[]),e.createElement("div",{className:"rpv-core__asking-password-wrapper"},e.createElement("div",{className:S({"rpv-core__asking-password":!0,"rpv-core__asking-password--rtl":ue})},e.createElement("div",{className:"rpv-core__asking-password-message"},w===In.REQUIRE_PASSWORD&&Z.core.askingPassword.requirePasswordToOpen,w===In.WRONG_PASSWORD&&Z.core.wrongPassword.tryAgain),e.createElement("div",{className:"rpv-core__asking-password-body"},e.createElement("div",{className:S({"rpv-core__asking-password-input":!0,"rpv-core__asking-password-input--ltr":!ue,"rpv-core__asking-password-input--rtl":ue})},e.createElement(N,{testId:"core__asking-password-input",type:"password",value:de,onChange:Ee,onKeyDown:we})),e.createElement(c,{onClick:Ce},Z.core.askingPassword.submit))))},lr=function(u){E(w,u);function w(H){var W=u.call(this)||this;return W.doc=H,W}return w}(Jn),yr=function(u){E(w,u);function w(H){var W=u.call(this)||this;return W.error=H,W}return w}(Jn),ur=function(u){E(w,u);function w(H){var W=u.call(this)||this;return W.percentages=H,W}return w}(Jn),Pr=function(u){var w=u.characterMap,H=u.file,W=u.httpHeaders,Z=u.render,re=u.renderError,de=u.renderLoader,Ee=u.transformGetDocumentParams,ne=u.withCredentials,ue=u.onDocumentAskPassword,Ce=e.useContext(R).direction,we=Ce===t.TextDirection.RightToLeft,Oe=e.useState(new ur(0)),Ue=Oe[0],Xe=Oe[1],Fe=e.useState(0);Fe[0],Fe[1];var it=e.useRef(""),ft=e.useState(null);ft[0],ft[1];var lt=D();return e.useEffect(function(){it.current="",Xe(new ur(0));var vt=new p.PDFWorker({name:"PDFWorker_".concat(Date.now())}),Lt=Object.assign({httpHeaders:W,withCredentials:ne,worker:vt},typeof H=="string"?{url:H}:{data:H},w?{cMapUrl:w.url,cMapPacked:w.isCompressed}:{}),Ft=Ee?Ee(Lt):Lt,i=p.getDocument(Ft);return i.onPassword=function(m,M){switch(M){case p.PasswordResponses.NEED_PASSWORD:lt.current&&Xe(new Qn(m,In.REQUIRE_PASSWORD));break;case p.PasswordResponses.INCORRECT_PASSWORD:lt.current&&Xe(new Qn(m,In.WRONG_PASSWORD));break}},i.onProgress=function(m){var M=m.total>0?Math.min(100,100*m.loaded/m.total):100;lt.current&&it.current===""&&Xe(new ur(M))},i.promise.then(function(m){it.current=m.loadingTask.docId,lt.current&&Xe(new lr(m))},function(m){return lt.current&&!vt.destroyed&&Xe(new yr({message:m.message||"Cannot load document",name:m.name}))}),function(){i.destroy(),vt.destroy()}},[H]),Ue instanceof Qn?e.createElement(Rr,{submitPassword:Ue.submitPassword,verifyPassword:Ue.verifyPassword,onDocumentAskPassword:ue}):Ue instanceof lr?Z(Ue.doc):Ue instanceof yr?re?re(Ue.error):e.createElement("div",{className:S({"rpv-core__doc-error":!0,"rpv-core__doc-error--rtl":we})},e.createElement("div",{className:"rpv-core__doc-error-text"},Ue.error.message)):e.createElement("div",{"data-testid":"core__doc-loading",className:S({"rpv-core__doc-loading":!0,"rpv-core__doc-loading--rtl":we})},de?de(Ue.percentages):e.createElement(L,null))},ha=function(){return typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches},dr=function(u,w){var H=e.useMemo(function(){return u==="auto"?ha()?"dark":"light":u},[]),W=e.useState(H),Z=W[0],re=W[1],de=ce(Z);return e.useEffect(function(){if(u==="auto"){var Ee=window.matchMedia("(prefers-color-scheme: dark)"),ne=function(ue){re(ue.matches?"dark":"light")};return Ee.addEventListener("change",ne),function(){return Ee.removeEventListener("change",ne)}}},[]),e.useEffect(function(){Z!==de&&w&&w(Z)},[Z]),e.useEffect(function(){u!==Z&&re(u)},[u]),{currentTheme:Z,setCurrentTheme:re}},fa=function(u,w){var H=typeof u,W=typeof w;return H==="string"&&W==="string"&&u===w?!0:H==="object"&&W==="object"?u.length===w.length&&u.every(function(Z,re){return Z===w[re]}):!1},wr=function(u){var w=u.characterMap,H=u.defaultScale,W=u.fileUrl,Z=u.httpHeaders,re=Z===void 0?{}:Z,de=u.initialPage,Ee=de===void 0?0:de,ne=u.pageLayout,ue=u.initialRotation,Ce=ue===void 0?0:ue,we=u.localization,Oe=u.plugins,Ue=Oe===void 0?[]:Oe,Xe=u.renderError,Fe=u.renderPage,it=u.renderLoader,ft=u.scrollMode,lt=ft===void 0?t.ScrollMode.Vertical:ft,vt=u.transformGetDocumentParams,Lt=u.theme,Ft=Lt===void 0?{direction:t.TextDirection.LeftToRight,theme:"light"}:Lt,i=u.withCredentials,m=i===void 0?!1:i,M=u.onDocumentAskPassword,F=u.onDocumentLoad,O=F===void 0?function(){}:F,U=u.onPageChange,Q=U===void 0?function(){}:U,ae=u.onRotate,V=ae===void 0?function(){}:ae,ee=u.onRotatePage,Re=ee===void 0?function(){}:ee,me=u.onSwitchTheme,Pe=me===void 0?function(){}:me,$e=u.onZoom,He=$e===void 0?function(){}:$e,ke=e.useState({data:W,name:typeof W=="string"?W:"",shouldLoad:!1}),Ke=ke[0],at=ke[1],Je=function(cn,Dt){at({data:Dt,name:cn,shouldLoad:!0})},tt=e.useState(!1),dt=tt[0],Mt=tt[1],jt=ce(Ke);e.useEffect(function(){fa(jt.data,W)||at({data:W,name:typeof W=="string"?W:"",shouldLoad:dt})},[W,dt]);var mt=function(cn){Mt(cn.isVisible),cn.isVisible&&at(function(Dt){return Object.assign({},Dt,{shouldLoad:!0})})},Zt=_({onVisibilityChanged:mt}),mn=typeof Ft=="string"?{direction:t.TextDirection.LeftToRight,theme:Ft}:Ft,At=e.useState(we||fe),hn=At[0],ln=At[1],_n={l10n:hn,setL10n:ln},fn=Object.assign({},{direction:mn.direction},dr(mn.theme||"light",Pe));return e.useEffect(function(){we&&ln(we)},[we]),e.createElement(_e.Provider,{value:_n},e.createElement(R.Provider,{value:fn},e.createElement("div",{ref:Zt,className:"rpv-core__viewer rpv-core__viewer--".concat(fn.currentTheme),"data-testid":"core__viewer",style:{height:"100%",width:"100%"}},Ke.shouldLoad&&e.createElement(Pr,{characterMap:w,file:Ke.data,httpHeaders:re,render:function(cn){return e.createElement(da,{defaultScale:H,doc:cn,render:function(Dt,un){return e.createElement(ca,{currentFile:{data:Ke.data,name:Ke.name},defaultScale:H,doc:cn,initialPage:Ee,initialRotation:Ce,initialScale:un,pageLayout:ne,pageSizes:Dt,plugins:Ue,renderPage:Fe,scrollMode:lt,viewerState:{file:Ke,pageIndex:-1,pageHeight:Dt[0].pageHeight,pageWidth:Dt[0].pageWidth,pagesRotation:new Map,rotation:Ce,scale:un,scrollMode:lt},onDocumentLoad:O,onOpenFile:Je,onPageChange:Q,onRotate:V,onRotatePage:Re,onZoom:He})},scrollMode:lt})},renderError:Xe,renderLoader:it,transformGetDocumentParams:vt,withCredentials:m,onDocumentAskPassword:M}))))},pa=function(u){var w=u.children,H=u.workerUrl;return p.GlobalWorkerOptions.workerSrc=H,e.createElement(e.Fragment,null,w)};t.Button=A,t.Icon=s,t.LazyRender=h,t.LocalizationContext=_e,t.Menu=l,t.MenuDivider=o,t.MenuItem=g,t.MinimalButton=v,t.Modal=te,t.Popover=Ie,t.PrimaryButton=c,t.ProgressBar=d,t.Separator=x,t.Spinner=L,t.Splitter=X,t.TextBox=N,t.ThemeContext=R,t.Tooltip=C,t.Viewer=wr,t.Worker=pa,t.classNames=S,t.createStore=I,t.getDestination=Ye,t.getPage=Le,t.isMac=G,t.useIntersectionObserver=_,t.useIsMounted=D,t.useIsomorphicLayoutEffect=y,t.useRenderQueue=Te})(core$i);/** * A React component to view a PDF document * * @see https://react-pdf-viewer.dev * @license https://react-pdf-viewer.dev/license * @copyright 2019-2022 Nguyen Huu Phuoc <me@phuoc.ng> */lib$i.exports=core$i;var libExports$i=lib$i.exports,lib$h={exports:{}},defaultLayout$1={},lib$g={exports:{}},core$h={};(function(t){var n=reactExports,a=pdfExports;function r(i){var m=Object.create(null);return i&&Object.keys(i).forEach(function(M){if(M!=="default"){var F=Object.getOwnPropertyDescriptor(i,M);Object.defineProperty(m,M,F.get?F:{enumerable:!0,get:function(){return i[M]}})}}),m.default=i,Object.freeze(m)}var e=r(n),p=r(a);t.AnnotationType=void 0,function(i){i[i.Text=1]="Text",i[i.Link=2]="Link",i[i.FreeText=3]="FreeText",i[i.Line=4]="Line",i[i.Square=5]="Square",i[i.Circle=6]="Circle",i[i.Polygon=7]="Polygon",i[i.Polyline=8]="Polyline",i[i.Highlight=9]="Highlight",i[i.Underline=10]="Underline",i[i.Squiggly=11]="Squiggly",i[i.StrikeOut=12]="StrikeOut",i[i.Stamp=13]="Stamp",i[i.Caret=14]="Caret",i[i.Ink=15]="Ink",i[i.Popup=16]="Popup",i[i.FileAttachment=17]="FileAttachment"}(t.AnnotationType||(t.AnnotationType={}));var k=function(i,m){return k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(M,F){M.__proto__=F}||function(M,F){for(var O in F)Object.prototype.hasOwnProperty.call(F,O)&&(M[O]=F[O])},k(i,m)};function E(i,m){if(typeof m!="function"&&m!==null)throw new TypeError("Class extends value "+String(m)+" is not a constructor or null");k(i,m);function M(){this.constructor=i}i.prototype=m===null?Object.create(m):(M.prototype=m.prototype,new M)}var b=function(){return b=Object.assign||function(m){for(var M,F=1,O=arguments.length;F<O;F++){M=arguments[F];for(var U in M)Object.prototype.hasOwnProperty.call(M,U)&&(m[U]=M[U])}return m},b.apply(this,arguments)};function R(i,m,M){if(M||arguments.length===2)for(var F=0,O=m.length,U;F<O;F++)(U||!(F in m))&&(U||(U=Array.prototype.slice.call(m,0,F)),U[F]=m[F]);return i.concat(U||Array.prototype.slice.call(m))}t.TextDirection=void 0,function(i){i.RightToLeft="RTL",i.LeftToRight="LTR"}(t.TextDirection||(t.TextDirection={}));var S=e.createContext({currentTheme:"light",direction:t.TextDirection.LeftToRight,setCurrentTheme:function(){}}),A=function(i){var m=[];return Object.keys(i).forEach(function(M){M&&i[M]&&m.push(M)}),m.join(" ")},y=function(i){var m=i.children,M=i.testId,F=i.onClick,O=e.useContext(S).direction,U=O===t.TextDirection.RightToLeft,Q=M?{"data-testid":M}:{};return e.createElement("button",b({className:A({"rpv-core__button":!0,"rpv-core__button--rtl":U}),type:"button",onClick:F},Q),m)},_=typeof window<"u"?e.useLayoutEffect:e.useEffect,h=function(i){var m=e.useRef(null),M=i.once,F=i.threshold,O=i.onVisibilityChanged;return _(function(){var U=m.current;if(U){var Q=new IntersectionObserver(function(ae){ae.forEach(function(V){var ee=V.isIntersecting,Re=V.intersectionRatio;O({isVisible:ee,ratio:Re}),ee&&M&&(Q.unobserve(U),Q.disconnect())})},{threshold:F||0});return Q.observe(U),function(){Q.unobserve(U),Q.disconnect()}}},[]),m},l=function(i){var m=i.attrs,M=i.children,F=i.testId,O=e.useState(!1),U=O[0],Q=O[1],ae=F?b(b({},m),{"data-testid":F}):m,V=function(Re){Re.isVisible&&Q(!0)},ee=h({once:!0,onVisibilityChanged:V});return e.createElement("div",b({ref:ee},ae),U&&M)},o=function(i){var m=i.children,M=e.useRef(),F=e.useRef([]),O=e.useContext(S).direction,U=O===t.TextDirection.RightToLeft,Q=function(ee){var Re=M.current;if(Re)switch(ee.key){case"Tab":ee.preventDefault();break;case"ArrowDown":ee.preventDefault(),ae(function(me,Pe){return Pe+1});break;case"ArrowUp":ee.preventDefault(),ae(function(me,Pe){return Pe-1});break;case"End":ee.preventDefault(),ae(function(me,Pe){return me.length-1});break;case"Home":ee.preventDefault(),ae(function(me,Pe){return 0});break}},ae=function(ee){var Re=M.current;if(Re){var me=F.current,Pe=me.findIndex(function(He){return He.getAttribute("tabindex")==="0"}),$e=Math.min(me.length-1,Math.max(0,ee(me,Pe)));Pe>=0&&Pe<=me.length-1&&me[Pe].setAttribute("tabindex","-1"),me[$e].setAttribute("tabindex","0"),me[$e].focus()}},V=function(ee){var Re=[];return ee.querySelectorAll('.rpv-core__menu-item[role="menuitem"]').forEach(function(me){if(me instanceof HTMLElement){var Pe=me.parentElement;(Pe===ee||window.getComputedStyle(Pe).display!=="none")&&Re.push(me)}}),Re};return _(function(){var ee=M.current;if(ee){var Re=V(ee);F.current=Re}},[]),_(function(){return document.addEventListener("keydown",Q),function(){document.removeEventListener("keydown",Q)}},[]),e.createElement("div",{ref:M,"aria-orientation":"vertical",className:A({"rpv-core__menu":!0,"rpv-core__menu--rtl":U}),role:"menu",tabIndex:0},m)},s=function(){return e.createElement("div",{"aria-orientation":"horizontal",className:"rpv-core__menu-divider",role:"separator"})},f=function(i){var m=i.children,M=i.ignoreDirection,F=M===void 0?!1:M,O=i.size,U=O===void 0?24:O,Q=e.useContext(S).direction,ae=!F&&Q===t.TextDirection.RightToLeft,V="".concat(U||24,"px");return e.createElement("svg",{"aria-hidden":"true",className:A({"rpv-core__icon":!0,"rpv-core__icon--rtl":ae}),focusable:"false",height:V,viewBox:"0 0 24 24",width:V},m)},g=function(){return e.createElement(f,{size:16},e.createElement("path",{d:"M23.5,0.499l-16.5,23l-6.5-6.5"}))},v=function(i){var m=i.checked,M=m===void 0?!1:m,F=i.children,O=i.icon,U=O===void 0?null:O,Q=i.isDisabled,ae=Q===void 0?!1:Q,V=i.testId,ee=i.onClick,Re=e.useContext(S).direction,me=Re===t.TextDirection.RightToLeft,Pe=V?{"data-testid":V}:{};return e.createElement("button",b({className:A({"rpv-core__menu-item":!0,"rpv-core__menu-item--disabled":ae,"rpv-core__menu-item--ltr":!me,"rpv-core__menu-item--rtl":me}),role:"menuitem",tabIndex:-1,type:"button",onClick:ee},Pe),e.createElement("div",{className:A({"rpv-core__menu-item-icon":!0,"rpv-core__menu-item-icon--ltr":!me,"rpv-core__menu-item-icon--rtl":me})},U),e.createElement("div",{className:A({"rpv-core__menu-item-label":!0,"rpv-core__menu-item-label--ltr":!me,"rpv-core__menu-item-label--rtl":me})},F),e.createElement("div",{className:A({"rpv-core__menu-item-check":!0,"rpv-core__menu-item-check--ltr":!me,"rpv-core__menu-item-check--rtl":me})},M&&e.createElement(g,null)))},c=function(i){var m=i.ariaLabel,M=m===void 0?"":m,F=i.ariaKeyShortcuts,O=F===void 0?"":F,U=i.children,Q=i.isDisabled,ae=Q===void 0?!1:Q,V=i.isSelected,ee=V===void 0?!1:V,Re=i.testId,me=i.onClick,Pe=e.useContext(S).direction,$e=Pe===t.TextDirection.RightToLeft,He=Re?{"data-testid":Re}:{};return e.createElement("button",b({"aria-label":M},O&&{"aria-keyshortcuts":O},ae&&{"aria-disabled":!0},{className:A({"rpv-core__minimal-button":!0,"rpv-core__minimal-button--disabled":ae,"rpv-core__minimal-button--rtl":$e,"rpv-core__minimal-button--selected":ee}),type:"button",onClick:me},He),U)},d=function(i){var m=i.children,M=i.testId,F=i.onClick,O=e.useContext(S).direction,U=O===t.TextDirection.RightToLeft,Q=M?{"data-testid":M}:{};return e.createElement("button",b({className:A({"rpv-core__primary-button":!0,"rpv-core__primary-button--rtl":U}),type:"button",onClick:F},Q),m)},x=function(i){var m=i.progress,M=e.useContext(S).direction,F=M===t.TextDirection.RightToLeft;return e.createElement("div",{className:A({"rpv-core__progress-bar":!0,"rpv-core__progress-bar--rtl":F})},e.createElement("div",{className:"rpv-core__progress-bar-progress",style:{width:"".concat(m,"%")}},m,"%"))},L=function(){return e.createElement("div",{className:"rpv-core__separator"})},X=function(i){var m=i.size,M=m===void 0?"4rem":m,F=i.testId,O=e.useState(!1),U=O[0],Q=O[1],ae=F?{"data-testid":F}:{},V=function(Re){Q(Re.isVisible)},ee=h({onVisibilityChanged:V});return e.createElement("div",b({},ae,{className:A({"rpv-core__spinner":!0,"rpv-core__spinner--animating":U}),ref:ee,style:{height:M,width:M}}))},N=function(i){var m=i.constrain,M=e.useContext(S).direction,F=M===t.TextDirection.RightToLeft,O=e.useRef(),U=e.useRef(),Q=e.useRef(),ae=e.useRef(0),V=e.useRef(0),ee=e.useRef(0),Re=e.useRef(0),me={capture:!0},Pe=function(ke){var Ke=O.current,at=U.current,Je=Q.current;if(!(!Ke||!at||!Je)){var tt=Re.current,dt=ke.clientX-ae.current,Mt=ee.current+(F?-dt:dt),jt=Ke.parentElement.getBoundingClientRect().width,mt=Mt*100/jt;if(Ke.classList.add("rpv-core__splitter--resizing"),m){var Zt=jt-Mt-tt,mn=Zt*100/jt;if(!m({firstHalfPercentage:mt,firstHalfSize:Mt,secondHalfPercentage:mn,secondHalfSize:Zt}))return}at.style.width="".concat(mt,"%"),document.body.classList.add("rpv-core__splitter-body--resizing"),at.classList.add("rpv-core__splitter-sibling--resizing"),Je.classList.add("rpv-core__splitter-sibling--resizing")}},$e=function(ke){var Ke=O.current,at=U.current,Je=Q.current;!Ke||!at||!Je||(document.body.classList.remove("rpv-core__splitter-body--resizing"),Ke.classList.remove("rpv-core__splitter--resizing"),at.classList.remove("rpv-core__splitter-sibling--resizing"),Je.classList.remove("rpv-core__splitter-sibling--resizing"),document.removeEventListener("mousemove",Pe,me),document.removeEventListener("mouseup",$e,me))},He=function(ke){var Ke=U.current;Ke&&(ae.current=ke.clientX,V.current=ke.clientY,ee.current=Ke.getBoundingClientRect().width,document.addEventListener("mousemove",Pe,me),document.addEventListener("mouseup",$e,me))};return e.useEffect(function(){var ke=O.current;ke&&(Re.current=ke.getBoundingClientRect().width,U.current=ke.previousElementSibling,Q.current=ke.nextElementSibling)},[]),e.createElement("div",{ref:O,className:"rpv-core__splitter",onMouseDown:He})},D=function(i){var m=i.ariaLabel,M=m===void 0?"":m,F=i.autoFocus,O=F===void 0?!1:F,U=i.placeholder,Q=U===void 0?"":U,ae=i.testId,V=i.type,ee=V===void 0?"text":V,Re=i.value,me=Re===void 0?"":Re,Pe=i.onChange,$e=i.onKeyDown,He=$e===void 0?function(){}:$e,ke=e.useContext(S).direction,Ke=e.useRef(),at=ke===t.TextDirection.RightToLeft,Je={ref:Ke,"data-testid":"","aria-label":M,className:A({"rpv-core__textbox":!0,"rpv-core__textbox--rtl":at}),placeholder:Q,value:me,onChange:function(tt){return Pe(tt.target.value)},onKeyDown:He};return ae&&(Je["data-testid"]=ae),_(function(){if(O){var tt=Ke.current;if(tt){var dt=window.scrollX,Mt=window.scrollY;tt.focus(),window.scrollTo(dt,Mt)}}},[]),ee==="text"?e.createElement("input",b({type:"text"},Je)):e.createElement("input",b({type:"password"},Je))},se=function(){var i=e.useRef(!1);return e.useEffect(function(){return i.current=!0,function(){i.current=!1}},[]),i},Ae;(function(i){i.NotRenderedYet="NotRenderedYet",i.Rendering="Rendering",i.Rendered="Rendered"})(Ae||(Ae={}));var Te=-9999,le=function(i){var m=i.doc,M=m.numPages,F=m.loadingTask.docId,O=e.useMemo(function(){return Array(M).fill(null).map(function(He,ke){return{pageIndex:ke,renderStatus:Ae.NotRenderedYet,visibility:Te}})},[F]),U=e.useRef({currentRenderingPage:-1,startRange:0,endRange:M-1,visibilities:O}),Q=function(){for(var He=0;He<M;He++)U.current.visibilities[He].renderStatus=Ae.NotRenderedYet},ae=function(He){U.current.visibilities[He].renderStatus=Ae.Rendered},V=function(He){U.current.currentRenderingPage!==-1&&U.current.currentRenderingPage!==He&&U.current.visibilities[U.current.currentRenderingPage].renderStatus===Ae.Rendering&&(U.current.visibilities[U.current.currentRenderingPage].renderStatus=Ae.NotRenderedYet),U.current.visibilities[He].renderStatus=Ae.Rendering,U.current.currentRenderingPage=He},ee=function(He,ke){U.current.startRange=He,U.current.endRange=ke;for(var Ke=0;Ke<M;Ke++)(Ke<He||Ke>ke)&&(U.current.visibilities[Ke].visibility=Te,U.current.visibilities[Ke].renderStatus=Ae.NotRenderedYet)},Re=function(He){me(He,Te)},me=function(He,ke){U.current.visibilities[He].visibility=ke},Pe=function(){var He=U.current.visibilities.slice(U.current.startRange,U.current.endRange+1).filter(function(tt){return tt.visibility>Te});if(!He.length)return-1;for(var ke=He[0].pageIndex,Ke=He[He.length-1].pageIndex,at=He.length,Je=0;Je<at;Je++){if(He[Je].renderStatus===Ae.Rendering)return-1;if(He[Je].renderStatus===Ae.NotRenderedYet)return He[Je].pageIndex}return Ke+1<M&&U.current.visibilities[Ke+1].renderStatus!==Ae.Rendered?Ke+1:ke-1>=0&&U.current.visibilities[ke-1].renderStatus!==Ae.Rendered?ke-1:-1},$e=function(He){return He>=U.current.startRange&&He<=U.current.endRange};return{getHighestPriorityPage:Pe,isInRange:$e,markNotRendered:Q,markRendered:ae,markRendering:V,setOutOfRange:Re,setRange:ee,setVisibility:me}},ie={askingPassword:{requirePasswordToOpen:"This document requires a password to open",submit:"Submit"},wrongPassword:{tryAgain:"The password is wrong. Please try again"},pageLabel:"Page {{pageIndex}}"},fe={core:ie},_e=fe,oe=e.createContext({l10n:_e,setL10n:function(){}}),Me=0,xe=function(){return Me++},K=function(i,m,M){var F=function(O){var U=m.current;if(U){var Q=O.target;if(Q instanceof Element&&Q.shadowRoot){var ae=O.composedPath();ae.length>0&&!U.contains(ae[0])&&M()}else U.contains(Q)||M()}};e.useEffect(function(){if(i){var O={capture:!0};return document.addEventListener("click",F,O),function(){document.removeEventListener("click",F,O)}}},[])},T=function(i){var m=function(M){M.key==="Escape"&&i()};e.useEffect(function(){return document.addEventListener("keyup",m),function(){document.removeEventListener("keyup",m)}},[])},P=function(){e.useEffect(function(){var i=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",function(){document.body.style.overflow=i}},[])},$=function(i){var m=i.ariaControlsSuffix,M=i.children,F=i.closeOnClickOutside,O=i.closeOnEscape,U=i.onToggle,Q=e.useRef(),ae=e.useContext(S).direction,V=ae===t.TextDirection.RightToLeft;return P(),T(function(){Q.current&&O&&U()}),K(F,Q,U),_(function(){var ee=Q.current;if(ee){var Re=document.body.clientHeight*.75;ee.getBoundingClientRect().height>=Re&&(ee.style.overflow="auto",ee.style.maxHeight="".concat(Re,"px"))}},[]),e.createElement("div",{"aria-modal":"true",className:A({"rpv-core__modal-body":!0,"rpv-core__modal-body--rtl":V}),id:"rpv-core__modal-body-".concat(m),ref:Q,role:"dialog",tabIndex:-1},M)},Y=function(i){var m=i.children;return e.createElement("div",{className:"rpv-core__modal-overlay"},m)};t.ToggleStatus=void 0,function(i){i.Close="Close",i.Open="Open",i.Toggle="Toggle"}(t.ToggleStatus||(t.ToggleStatus={}));var J=function(i){var m=e.useState(i),M=m[0],F=m[1],O=function(U){switch(U){case t.ToggleStatus.Close:F(!1);break;case t.ToggleStatus.Open:F(!0);break;case t.ToggleStatus.Toggle:default:F(function(Q){return!Q});break}};return{opened:M,toggle:O}},te=function(i){var m=i.content,M=i.isOpened,F=M===void 0?!1:M,O=i.target,U=J(F),Q=U.opened,ae=U.toggle;return e.createElement(e.Fragment,null,O&&O(ae,Q),Q&&m(ae))},he=function(i){var m=i.ariaControlsSuffix,M=i.closeOnClickOutside,F=i.closeOnEscape,O=i.content,U=i.isOpened,Q=U===void 0?!1:U,ae=i.target,V=m||"".concat(xe()),ee=function(me,Pe){return e.createElement("div",{"aria-expanded":Pe?"true":"false","aria-haspopup":"dialog","aria-controls":"rpv-core__modal-body-".concat(V)},ae(me,Pe))},Re=function(me){return e.createElement(Y,null,e.createElement($,{ariaControlsSuffix:V,closeOnClickOutside:M,closeOnEscape:F,onToggle:me},O(me)))};return e.createElement(te,{target:ae?ee:null,content:Re,isOpened:Q})};t.Position=void 0,function(i){i.TopLeft="TOP_LEFT",i.TopCenter="TOP_CENTER",i.TopRight="TOP_RIGHT",i.RightTop="RIGHT_TOP",i.RightCenter="RIGHT_CENTER",i.RightBottom="RIGHT_BOTTOM",i.BottomLeft="BOTTOM_LEFT",i.BottomCenter="BOTTOM_CENTER",i.BottomRight="BOTTOM_RIGHT",i.LeftTop="LEFT_TOP",i.LeftCenter="LEFT_CENTER",i.LeftBottom="LEFT_BOTTOM"}(t.Position||(t.Position={}));var ve=function(i,m,M,F){var O=m.getBoundingClientRect(),U=i.getBoundingClientRect(),Q=U.height,ae=U.width,V=0,ee=0;switch(M){case t.Position.TopLeft:V=O.top-Q,ee=O.left;break;case t.Position.TopCenter:V=O.top-Q,ee=O.left+O.width/2-ae/2;break;case t.Position.TopRight:V=O.top-Q,ee=O.left+O.width-ae;break;case t.Position.RightTop:V=O.top,ee=O.left+O.width;break;case t.Position.RightCenter:V=O.top+O.height/2-Q/2,ee=O.left+O.width;break;case t.Position.RightBottom:V=O.top+O.height-Q,ee=O.left+O.width;break;case t.Position.BottomLeft:V=O.top+O.height,ee=O.left;break;case t.Position.BottomCenter:V=O.top+O.height,ee=O.left+O.width/2-ae/2;break;case t.Position.BottomRight:V=O.top+O.height,ee=O.left+O.width-ae;break;case t.Position.LeftTop:V=O.top,ee=O.left-ae;break;case t.Position.LeftCenter:V=O.top+O.height/2-Q/2,ee=O.left-ae;break;case t.Position.LeftBottom:V=O.top+O.height-Q,ee=O.left-ae;break}return{left:ee+(F.left||0),top:V+(F.top||0)}},Ne=function(i,m,M,F,O){_(function(){var U=m.current,Q=i.current,ae=M.current;if(!(!Q||!U||!ae)){var V=ae.getBoundingClientRect(),ee=ve(Q,U,F,O),Re=ee.top,me=ee.left;Q.style.top="".concat(Re-V.top,"px"),Q.style.left="".concat(me-V.left,"px")}},[])},Se=function(i){var m,M=i.customClassName,F=i.position;return e.createElement("div",{className:A((m={"rpv-core__arrow":!0,"rpv-core__arrow--tl":F===t.Position.TopLeft,"rpv-core__arrow--tc":F===t.Position.TopCenter,"rpv-core__arrow--tr":F===t.Position.TopRight,"rpv-core__arrow--rt":F===t.Position.RightTop,"rpv-core__arrow--rc":F===t.Position.RightCenter,"rpv-core__arrow--rb":F===t.Position.RightBottom,"rpv-core__arrow--bl":F===t.Position.BottomLeft,"rpv-core__arrow--bc":F===t.Position.BottomCenter,"rpv-core__arrow--br":F===t.Position.BottomRight,"rpv-core__arrow--lt":F===t.Position.LeftTop,"rpv-core__arrow--lc":F===t.Position.LeftCenter,"rpv-core__arrow--lb":F===t.Position.LeftBottom},m["".concat(M)]=M!=="",m))})},je=function(i){var m=i.ariaControlsSuffix,M=i.children,F=i.closeOnClickOutside,O=i.offset,U=i.position,Q=i.targetRef,ae=i.onClose,V=e.useRef(),ee=e.useRef(),Re=e.useRef(),me=e.useContext(S).direction,Pe=me===t.TextDirection.RightToLeft;K(F,V,ae),Ne(V,Q,Re,U,O),_(function(){var He=ee.current;if(He){var ke=document.body.clientHeight*.75;He.getBoundingClientRect().height>=ke&&(He.style.overflow="auto",He.style.maxHeight="".concat(ke,"px"))}},[]);var $e="rpv-core__popover-body-inner-".concat(m);return e.createElement(e.Fragment,null,e.createElement("div",{ref:Re,style:{left:0,position:"absolute",top:0}}),e.createElement("div",{"aria-describedby":$e,className:A({"rpv-core__popover-body":!0,"rpv-core__popover-body--rtl":Pe}),id:"rpv-core__popover-body-".concat(m),ref:V,role:"dialog",tabIndex:-1},e.createElement(Se,{customClassName:"rpv-core__popover-body-arrow",position:U}),e.createElement("div",{id:$e,ref:ee},M)))},Ie=function(i){var m=i.closeOnEscape,M=i.onClose,F=e.useRef();return T(function(){F.current&&m&&M()}),e.createElement("div",{className:"rpv-core__popover-overlay",ref:F})},ze=function(i){var m=i.ariaHasPopup,M=m===void 0?"dialog":m,F=i.ariaControlsSuffix,O=i.closeOnClickOutside,U=i.closeOnEscape,Q=i.content,ae=i.lockScroll,V=ae===void 0?!0:ae,ee=i.offset,Re=i.position,me=i.target,Pe=J(!1),$e=Pe.opened,He=Pe.toggle,ke=e.useRef(),Ke=e.useMemo(function(){return F||"".concat(xe())},[]);return e.createElement("div",{ref:ke,"aria-expanded":$e?"true":"false","aria-haspopup":M,"aria-controls":"rpv-core__popver-body-".concat(Ke)},me(He,$e),$e&&e.createElement(e.Fragment,null,V&&e.createElement(Ie,{closeOnEscape:U,onClose:He}),e.createElement(je,{ariaControlsSuffix:Ke,closeOnClickOutside:O,offset:ee,position:Re,targetRef:ke,onClose:He},Q(He))))},C=function(i){var m=i.ariaControlsSuffix,M=i.children,F=i.contentRef,O=i.offset,U=i.position,Q=i.targetRef,ae=e.useRef(),V=e.useContext(S).direction,ee=V===t.TextDirection.RightToLeft;return Ne(F,Q,ae,U,O),e.createElement(e.Fragment,null,e.createElement("div",{ref:ae,style:{left:0,position:"absolute",top:0}}),e.createElement("div",{className:A({"rpv-core__tooltip-body":!0,"rpv-core__tooltip-body--rtl":ee}),id:"rpv-core__tooltip-body-".concat(m),ref:F,role:"tooltip"},e.createElement(Se,{customClassName:"rpv-core__tooltip-body-arrow",position:U}),e.createElement("div",{className:"rpv-core__tooltip-body-content"},M)))},I=function(i){var m=i.ariaControlsSuffix,M=i.content,F=i.offset,O=i.position,U=i.target,Q=J(!1),ae=Q.opened,V=Q.toggle,ee=e.useRef(),Re=e.useRef(),me=e.useMemo(function(){return m||"".concat(xe())},[]);T(function(){ee.current&&document.activeElement&&ee.current.contains(document.activeElement)&&$e()});var Pe=function(){V(t.ToggleStatus.Open)},$e=function(){V(t.ToggleStatus.Close)},He=function(ke){var Ke=ke.relatedTarget instanceof HTMLElement&&ke.currentTarget.parentElement&&ke.currentTarget.parentElement.contains(ke.relatedTarget);Ke?Re.current&&(Re.current.style.display="none"):$e()};return e.createElement(e.Fragment,null,e.createElement("div",{ref:ee,"aria-describedby":"rpv-core__tooltip-body-".concat(me),onBlur:He,onFocus:Pe,onMouseEnter:Pe,onMouseLeave:$e},U),ae&&e.createElement(C,{ariaControlsSuffix:me,contentRef:Re,offset:F,position:O,targetRef:ee},M()))};function G(i){var m=i||{},M={},F=function(U,Q){var ae;m=b(b({},m),(ae={},ae[U]=Q,ae)),(M[U]||[]).forEach(function(V){return V(m[U])})},O=function(U){return m[U]};return{subscribe:function(U,Q){M[U]=(M[U]||[]).concat(Q)},unsubscribe:function(U,Q){M[U]=(M[U]||[]).filter(function(ae){return ae!==Q})},update:function(U,Q){F(U,Q)},updateCurrentValue:function(U,Q){var ae=O(U);ae!==void 0&&F(U,Q(ae))},get:function(U){return O(U)}}}t.LayerRenderStatus=void 0,function(i){i[i.PreRender=0]="PreRender",i[i.DidRender=1]="DidRender"}(t.LayerRenderStatus||(t.LayerRenderStatus={})),t.PageMode=void 0,function(i){i.Attachments="UseAttachments",i.Bookmarks="UseOutlines",i.ContentGroup="UseOC",i.Default="UserNone",i.FullScreen="FullScreen",i.Thumbnails="UseThumbs"}(t.PageMode||(t.PageMode={})),t.RotateDirection=void 0,function(i){i.Backward="Backward",i.Forward="Forward"}(t.RotateDirection||(t.RotateDirection={})),t.ScrollMode=void 0,function(i){i.Page="Page",i.Horizontal="Horizontal",i.Vertical="Vertical",i.Wrapped="Wrapped"}(t.ScrollMode||(t.ScrollMode={})),t.SpecialZoomLevel=void 0,function(i){i.ActualSize="ActualSize",i.PageFit="PageFit",i.PageWidth="PageWidth"}(t.SpecialZoomLevel||(t.SpecialZoomLevel={})),t.ViewMode=void 0,function(i){i.DualPage="DualPage",i.DualPageWithCover="DualPageWithCover",i.SinglePage="SinglePage"}(t.ViewMode||(t.ViewMode={}));var z=function(){return typeof window<"u"?/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform):!1},q=function(i,m){switch(m[1].name){case"XYZ":return{bottomOffset:function(M,F){return m[3]===null?F:m[3]},leftOffset:function(M,F){return m[2]===null?0:m[2]},pageIndex:i,scaleTo:m[4]};case"Fit":case"FitB":return{bottomOffset:0,leftOffset:0,pageIndex:i,scaleTo:t.SpecialZoomLevel.PageFit};case"FitH":case"FitBH":return{bottomOffset:m[2],leftOffset:0,pageIndex:i,scaleTo:t.SpecialZoomLevel.PageWidth};default:return{bottomOffset:0,leftOffset:0,pageIndex:i,scaleTo:1}}},ge=new Map,Be=new Map,Ze=function(i,m){return"".concat(i.loadingTask.docId,"___").concat(m.num,"R").concat(m.gen===0?"":m.gen)},pe=function(i,m){var M=Ze(i,m);return ge.has(M)?ge.get(M):null},ot=function(i,m,M){ge.set(Ze(i,m),M)},Le=function(){ge.clear(),Be.clear()},Ye=function(i,m){if(!i)return Promise.reject("The document is not loaded yet");var M="".concat(i.loadingTask.docId,"___").concat(m),F=Be.get(M);return F?Promise.resolve(F):new Promise(function(O,U){i.getPage(m+1).then(function(Q){Be.set(M,Q),Q.ref&&ot(i,Q.ref,m),O(Q)})})},ce=function(i,m){return new Promise(function(M){new Promise(function(F){typeof m=="string"?i.getDestination(m).then(function(O){F(O)}):F(m)}).then(function(F){if(typeof F[0]=="object"&&F[0]!==null){var O=F[0],U=pe(i,O);U===null?i.getPageIndex(O).then(function(ae){ot(i,O,ae),ce(i,m).then(function(V){return M(V)})}):M(q(U,F))}else{var Q=q(F[0],F);M(Q)}})})};function We(i){var m=e.useRef(i);return e.useEffect(function(){m.current=i},[i]),m.current}var nt=function(i,m){var M=e.useRef(),F=function(){M.current&&clearTimeout(M.current)};return e.useEffect(function(){return function(){return F()}},[]),e.useCallback(function(){for(var O=[],U=0;U<arguments.length;U++)O[U]=arguments[U];F(),M.current=setTimeout(function(){i.apply(void 0,O)},m)},[i,m])},ut=function(i){var m=i.targetRef,M=i.onResize;_(function(){var F=new ResizeObserver(function(U){U.forEach(function(Q){M(Q.target)})}),O=m.current;if(O)return F.observe(O),function(){F.unobserve(O)}},[])},Et;(function(i){i[i.Solid=1]="Solid",i[i.Dashed=2]="Dashed",i[i.Beveled=3]="Beveled",i[i.Inset=4]="Inset",i[i.Underline=5]="Underline"})(Et||(Et={}));var kt=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"),ct=function(i,m,M,F){var O=parseInt(i,10);return O>=m&&O<=M?O:F},Ve=function(i){var m=kt.exec(i);if(!m)return null;var M=parseInt(m[1],10),F=ct(m[2],1,12,1)-1,O=ct(m[3],1,31,1),U=ct(m[4],0,23,0),Q=ct(m[5],0,59,0),ae=ct(m[6],0,59,0),V=m[7]||"Z",ee=ct(m[8],0,23,0),Re=ct(m[9],0,59,0);switch(V){case"-":U+=ee,Q+=Re;break;case"+":U-=ee,Q-=Re;break}return new Date(Date.UTC(M,F,O,U,Q,ae))},be=function(i){return i.contentsObj?i.contentsObj.str:i.contents||""},j=function(i){return i.titleObj?i.titleObj.str:i.title||""},ye=function(i){var m=i.annotation,M=e.useContext(S).direction,F=j(m),O=be(m),U=M===t.TextDirection.RightToLeft,Q=e.useRef(),ae="";if(m.modificationDate){var V=Ve(m.modificationDate);ae=V?"".concat(V.toLocaleDateString(),", ").concat(V.toLocaleTimeString()):""}return e.useLayoutEffect(function(){var ee=Q.current;if(ee){var Re=document.querySelector('[data-annotation-id="'.concat(m.id,'"]'));if(Re){var me=Re;return me.style.zIndex+=1,function(){me.style.zIndex="".concat(parseInt(me.style.zIndex,10)-1)}}}},[]),e.createElement("div",{ref:Q,className:A({"rpv-core__annotation-popup-wrapper":!0,"rpv-core__annotation-popup-wrapper--rtl":U}),style:{top:m.annotationType===t.AnnotationType.Popup?"":"100%"}},F&&e.createElement(e.Fragment,null,e.createElement("div",{className:A({"rpv-core__annotation-popup-title":!0,"rpv-core__annotation-popup-title--ltr":!U,"rpv-core__annotation-popup-title--rtl":U})},F),e.createElement("div",{className:"rpv-core__annotation-popup-date"},ae)),O&&e.createElement("div",{className:"rpv-core__annotation-popup-content"},O.split(` `).map(function(ee,Re){return e.createElement(e.Fragment,{key:Re},ee,e.createElement("br",null))})))},Ge;(function(i){i.Click="Click",i.Hover="Hover"})(Ge||(Ge={}));var ht=function(){var i=J(!1),m=i.opened,M=i.toggle,F=e.useState(Ge.Hover),O=F[0],U=F[1],Q=function(){switch(O){case Ge.Click:m&&U(Ge.Hover),M(t.ToggleStatus.Toggle);break;case Ge.Hover:U(Ge.Click),M(t.ToggleStatus.Open);break}},ae=function(){O===Ge.Hover&&M(t.ToggleStatus.Open)},V=function(){O===Ge.Hover&&M(t.ToggleStatus.Close)};return{opened:m,closeOnHover:V,openOnHover:ae,toggleOnClick:Q}},st=function(i){var m=i.annotation,M=i.children,F=i.ignoreBorder,O=i.hasPopup,U=i.isRenderable,Q=i.page,ae=i.viewport,V=m.rect,ee=ht(),Re=ee.closeOnHover,me=ee.opened,Pe=ee.openOnHover,$e=ee.toggleOnClick,He=function(mt){return[Math.min(mt[0],mt[2]),Math.min(mt[1],mt[3]),Math.max(mt[0],mt[2]),Math.max(mt[1],mt[3])]},ke=He([V[0],Q.view[3]+Q.view[1]-V[1],V[2],Q.view[3]+Q.view[1]-V[3]]),Ke=V[2]-V[0],at=V[3]-V[1],Je={borderColor:"",borderRadius:"",borderStyle:"",borderWidth:""};if(!F&&m.borderStyle.width>0){switch(m.borderStyle.style){case Et.Dashed:Je.borderStyle="dashed";break;case Et.Solid:Je.borderStyle="solid";break;case Et.Underline:Je=Object.assign({borderBottomStyle:"solid"},Je);break;case Et.Beveled:case Et.Inset:}var tt=m.borderStyle.width;Je.borderWidth="".concat(tt,"px"),m.borderStyle.style!==Et.Underline&&(Ke=Ke-2*tt,at=at-2*tt);var dt=m.borderStyle,Mt=dt.horizontalCornerRadius,jt=dt.verticalCornerRadius;(Mt>0||jt>0)&&(Je.borderRadius="".concat(Mt,"px / ").concat(jt,"px")),m.color?Je.borderColor="rgb(".concat(m.color[0]|0,", ").concat(m.color[1]|0,", ").concat(m.color[2]|0,")"):Je.borderWidth="0"}return e.createElement(e.Fragment,null,U&&M({popup:{opened:me,closeOnHover:Re,openOnHover:Pe,toggleOnClick:$e},slot:{attrs:{style:Object.assign({height:"".concat(at,"px"),left:"".concat(ke[0],"px"),top:"".concat(ke[1],"px"),transform:"matrix(".concat(ae.transform.join(","),")"),transformOrigin:"-".concat(ke[0],"px -").concat(ke[1],"px"),width:"".concat(Ke,"px")},Je)},children:e.createElement(e.Fragment,null,O&&me&&e.createElement(ye,{annotation:m}))}}))},Ct=function(i){var m=i.annotation,M=i.page,F=i.viewport,O=m.hasPopup===!1,U=j(m),Q=be(m),ae=!!(m.hasPopup||U||Q);return e.createElement(st,{annotation:m,hasPopup:O,ignoreBorder:!0,isRenderable:ae,page:M,viewport:F},function(V){return e.createElement("div",b({},V.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--caret","data-annotation-id":m.id,onClick:V.popup.toggleOnClick,onMouseEnter:V.popup.openOnHover,onMouseLeave:V.popup.closeOnHover}),V.slot.children)})},gt=function(i){var m=i.annotation,M=i.page,F=i.viewport,O=m.hasPopup===!1,U=j(m),Q=be(m),ae=!!(m.hasPopup||U||Q),V=m.rect,ee=V[2]-V[0],Re=V[3]-V[1],me=m.borderStyle.width;return e.createElement(st,{annotation:m,hasPopup:O,ignoreBorder:!0,isRenderable:ae,page:M,viewport:F},function(Pe){return e.createElement("div",b({},Pe.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--circle","data-annotation-id":m.id,onClick:Pe.popup.toggleOnClick,onMouseEnter:Pe.popup.openOnHover,onMouseLeave:Pe.popup.closeOnHover}),e.createElement("svg",{height:"".concat(Re,"px"),preserveAspectRatio:"none",version:"1.1",viewBox:"0 0 ".concat(ee," ").concat(Re),width:"".concat(ee,"px")},e.createElement("circle",{cy:Re/2,fill:"none",rx:ee/2-me/2,ry:Re/2-me/2,stroke:"transparent",strokeWidth:me||1})),Pe.slot.children)})},bt=function(i){var m=i.split("/").pop();return m?m.split("#")[0].split("?")[0]:i},wt=function(i,m){var M=typeof m=="string"?"":URL.createObjectURL(new Blob([m],{type:""})),F=document.createElement("a");F.style.display="none",F.href=M||i,F.setAttribute("download",bt(i)),document.body.appendChild(F),F.click(),document.body.removeChild(F),M&&URL.revokeObjectURL(M)},Rt=function(i){var m=i.annotation,M=i.page,F=i.viewport,O=j(m),U=be(m),Q=m.hasPopup===!1&&(!!O||!!U),ae=function(){var V=m.file;V&&wt(V.filename,V.content)};return e.createElement(st,{annotation:m,hasPopup:Q,ignoreBorder:!0,isRenderable:!0,page:M,viewport:F},function(V){return e.createElement("div",b({},V.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--file-attachment","data-annotation-id":m.id,onClick:V.popup.toggleOnClick,onDoubleClick:ae,onMouseEnter:V.popup.openOnHover,onMouseLeave:V.popup.closeOnHover}),V.slot.children)})},Xt=function(i){var m=i.annotation,M=i.page,F=i.viewport,O=m.hasPopup===!1,U=j(m),Q=be(m),ae=!!(m.hasPopup||U||Q);return e.createElement(st,{annotation:m,hasPopup:O,ignoreBorder:!0,isRenderable:ae,page:M,viewport:F},function(V){return e.createElement("div",b({},V.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--free-text","data-annotation-id":m.id,onClick:V.popup.toggleOnClick,onMouseEnter:V.popup.openOnHover,onMouseLeave:V.popup.closeOnHover}),V.slot.children)})},It=function(i){var m=i.annotation,M=i.page,F=i.viewport,O=j(m),U=be(m),Q=!!(O||U),ae=["Circle","Ink","Line","Polygon","PolyLine","Square"],V=!m.parentType||ae.indexOf(m.parentType)!==-1;return _(function(){if(m.parentId){var ee=document.querySelector('[data-annotation-id="'.concat(m.parentId,'"]')),Re=document.querySelector('[data-annotation-id="'.concat(m.id,'"]'));if(!(!ee||!Re)){var me=parseFloat(ee.style.left),Pe=parseFloat(ee.style.top)+parseFloat(ee.style.height);Re.style.left="".concat(me,"px"),Re.style.top="".concat(Pe,"px"),Re.style.transformOrigin="-".concat(me,"px -").concat(Pe,"px")}}},[]),e.createElement(st,{annotation:m,hasPopup:V,ignoreBorder:!1,isRenderable:Q,page:M,viewport:F},function(ee){return e.createElement("div",b({},ee.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--popup","data-annotation-id":m.id}),e.createElement(ye,{annotation:m}))})},_t=function(i){var m=i.annotation,M=i.childAnnotation,F=i.page,O=i.viewport,U=m.hasPopup===!1,Q=j(m),ae=be(m),V=!!(m.hasPopup||Q||ae),ee=m.quadPoints&&m.quadPoints.length>0;if(ee){var Re=m.quadPoints.map(function(me){return Object.assign({},m,{rect:[me[2].x,me[2].y,me[1].x,me[1].y],quadPoints:[]})});return e.createElement(e.Fragment,null,Re.map(function(me,Pe){return e.createElement(_t,{key:Pe,annotation:me,childAnnotation:M,page:F,viewport:O})}))}return e.createElement(st,{annotation:m,hasPopup:U,ignoreBorder:!0,isRenderable:V,page:F,viewport:O},function(me){return e.createElement(e.Fragment,null,e.createElement("div",b({},me.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--highlight","data-annotation-id":m.id,onClick:me.popup.toggleOnClick,onMouseEnter:me.popup.openOnHover,onMouseLeave:me.popup.closeOnHover}),me.slot.children),M&&M.annotationType===t.AnnotationType.Popup&&me.popup.opened&&e.createElement(It,{annotation:M,page:F,viewport:O}))})},$t=function(i){var m=i.annotation,M=i.page,F=i.viewport,O=m.hasPopup===!1,U=j(m),Q=be(m),ae=!!(m.hasPopup||U||Q),V=m.rect,ee=V[2]-V[0],Re=V[3]-V[1],me=m.borderStyle.width;return e.createElement(st,{annotation:m,hasPopup:O,ignoreBorder:!0,isRenderable:ae,page:M,viewport:F},function(Pe){return e.createElement("div",b({},Pe.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--ink","data-annotation-id":m.id,onClick:Pe.popup.toggleOnClick,onMouseEnter:Pe.popup.openOnHover,onMouseLeave:Pe.popup.closeOnHover}),m.inkLists&&m.inkLists.length&&e.createElement("svg",{height:"".concat(Re,"px"),preserveAspectRatio:"none",version:"1.1",viewBox:"0 0 ".concat(ee," ").concat(Re),width:"".concat(ee,"px")},m.inkLists.map(function($e,He){return e.createElement("polyline",{key:He,fill:"none",stroke:"transparent",strokeWidth:me||1,points:$e.map(function(ke){return"".concat(ke.x-V[0],",").concat(V[3]-ke.y)}).join(" ")})})),Pe.slot.children)})},Ot=function(i){var m=i.annotation,M=i.page,F=i.viewport,O=m.hasPopup===!1,U=j(m),Q=be(m),ae=!!(m.hasPopup||U||Q),V=m.rect,ee=V[2]-V[0],Re=V[3]-V[1],me=m.borderStyle.width;return e.createElement(st,{annotation:m,hasPopup:O,ignoreBorder:!0,isRenderable:ae,page:M,viewport:F},function(Pe){return e.createElement("div",b({},Pe.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--line","data-annotation-id":m.id,onClick:Pe.popup.toggleOnClick,onMouseEnter:Pe.popup.openOnHover,onMouseLeave:Pe.popup.closeOnHover}),e.createElement("svg",{height:"".concat(Re,"px"),preserveAspectRatio:"none",version:"1.1",viewBox:"0 0 ".concat(ee," ").concat(Re),width:"".concat(ee,"px")},e.createElement("line",{stroke:"transparent",strokeWidth:me||1,x1:V[2]-m.lineCoordinates[0],x2:V[2]-m.lineCoordinates[2],y1:V[3]-m.lineCoordinates[1],y2:V[3]-m.lineCoordinates[3]})),Pe.slot.children)})},dn=/^([^\w]*)(javascript|data|vbscript)/im,Yt=/&#(\w+)(^\w|;)?/g,tn=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,Tt=/^([^:]+):/gm,bn=function(i){return i.replace(Yt,function(m,M){return String.fromCharCode(M)})},Pn=function(i,m){m===void 0&&(m="about:blank");var M=bn(i||"").replace(tn,"").trim();if(!M)return m;var F=M[0];if(F==="."||F==="/")return M;var O=M.match(Tt);if(!O)return M;var U=O[0];return dn.test(U)?m:M},Nn=function(i){var m,M=i.annotation,F=i.doc,O=i.outlines,U=i.page,Q=i.viewport,ae=i.onExecuteNamedAction,V=i.onJumpToDest,ee=function(He){He.preventDefault(),M.action?ae(M.action):ce(F,M.dest).then(function(ke){var Ke=ke.pageIndex,at=ke.bottomOffset,Je=ke.leftOffset,tt=ke.scaleTo;V(Ke,at,Je,tt)})},Re=!!(M.url||M.dest||M.action||M.unsafeUrl),me={};if(M.url||M.unsafeUrl){var Pe=Pn(M.url||M.unsafeUrl,"");Pe?me={"data-target":"external",href:Pe,rel:"noopener noreferrer nofollow",target:M.newWindow?"_blank":"",title:Pe}:Re=!1}else me={href:"","data-annotation-link":M.id,onClick:ee};var $e=O&&O.length&&M.dest&&typeof M.dest=="string"?(m=O.find(function(He){return He.dest===M.dest}))===null||m===void 0?void 0:m.title:"";return $e&&(me=Object.assign({},me,{title:$e,"aria-label":$e})),e.createElement(st,{annotation:M,hasPopup:!1,ignoreBorder:!1,isRenderable:Re,page:U,viewport:Q},function(He){return e.createElement("div",b({},He.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--link","data-annotation-id":M.id,"data-testid":"core__annotation--link-".concat(M.id)}),e.createElement("a",b({},me)))})},Bn=function(i){var m=i.annotation,M=i.page,F=i.viewport,O=m.hasPopup===!1,U=j(m),Q=be(m),ae=!!(m.hasPopup||U||Q),V=m.rect,ee=V[2]-V[0],Re=V[3]-V[1],me=m.borderStyle.width;return e.createElement(st,{annotation:m,hasPopup:O,ignoreBorder:!0,isRenderable:ae,page:M,viewport:F},function(Pe){return e.createElement("div",b({},Pe.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--polygon","data-annotation-id":m.id,onClick:Pe.popup.toggleOnClick,onMouseEnter:Pe.popup.openOnHover,onMouseLeave:Pe.popup.closeOnHover}),m.vertices&&m.vertices.length&&e.createElement("svg",{height:"".concat(Re,"px"),preserveAspectRatio:"none",version:"1.1",viewBox:"0 0 ".concat(ee," ").concat(Re),width:"".concat(ee,"px")},e.createElement("polygon",{fill:"none",stroke:"transparent",strokeWidth:me||1,points:m.vertices.map(function($e){return"".concat($e.x-V[0],",").concat(V[3]-$e.y)}).join(" ")})),Pe.slot.children)})},Fn=function(i){var m=i.annotation,M=i.page,F=i.viewport,O=m.hasPopup===!1,U=j(m),Q=be(m),ae=!!(m.hasPopup||U||Q),V=m.rect,ee=V[2]-V[0],Re=V[3]-V[1],me=m.borderStyle.width;return e.createElement(st,{annotation:m,hasPopup:O,ignoreBorder:!0,isRenderable:ae,page:M,viewport:F},function(Pe){return e.createElement("div",b({},Pe.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--polyline","data-annotation-id":m.id,onClick:Pe.popup.toggleOnClick,onMouseEnter:Pe.popup.openOnHover,onMouseLeave:Pe.popup.closeOnHover}),m.vertices&&m.vertices.length&&e.createElement("svg",{height:"".concat(Re,"px"),preserveAspectRatio:"none",version:"1.1",viewBox:"0 0 ".concat(ee," ").concat(Re),width:"".concat(ee,"px")},e.createElement("polyline",{fill:"none",stroke:"transparent",strokeWidth:me||1,points:m.vertices.map(function($e){return"".concat($e.x-V[0],",").concat(V[3]-$e.y)}).join(" ")})),Pe.slot.children)})},Xn=function(i){var m=i.annotation,M=i.page,F=i.viewport,O=m.hasPopup===!1,U=j(m),Q=be(m),ae=!!(m.hasPopup||U||Q),V=m.rect,ee=V[2]-V[0],Re=V[3]-V[1],me=m.borderStyle.width;return e.createElement(st,{annotation:m,hasPopup:O,ignoreBorder:!0,isRenderable:ae,page:M,viewport:F},function(Pe){return e.createElement("div",b({},Pe.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--square","data-annotation-id":m.id,onClick:Pe.popup.toggleOnClick,onMouseEnter:Pe.popup.openOnHover,onMouseLeave:Pe.popup.closeOnHover}),e.createElement("svg",{height:"".concat(Re,"px"),preserveAspectRatio:"none",version:"1.1",viewBox:"0 0 ".concat(ee," ").concat(Re),width:"".concat(ee,"px")},e.createElement("rect",{height:Re-me,fill:"none",stroke:"transparent",strokeWidth:me||1,x:me/2,y:me/2,width:ee-me})),Pe.slot.children)})},or=function(i){var m=i.annotation,M=i.page,F=i.viewport,O=m.hasPopup===!1,U=j(m),Q=be(m),ae=!!(m.hasPopup||U||Q);return e.createElement(st,{annotation:m,hasPopup:O,ignoreBorder:!0,isRenderable:ae,page:M,viewport:F},function(V){return e.createElement("div",b({},V.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--squiggly","data-annotation-id":m.id,onClick:V.popup.toggleOnClick,onMouseEnter:V.popup.openOnHover,onMouseLeave:V.popup.closeOnHover}),V.slot.children)})},mr=function(i){var m=i.annotation,M=i.page,F=i.viewport,O=m.hasPopup===!1,U=j(m),Q=be(m),ae=!!(m.hasPopup||U||Q);return e.createElement(st,{annotation:m,hasPopup:O,ignoreBorder:!0,isRenderable:ae,page:M,viewport:F},function(V){return e.createElement("div",b({},V.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--stamp","data-annotation-id":m.id,onClick:V.popup.toggleOnClick,onMouseEnter:V.popup.openOnHover,onMouseLeave:V.popup.closeOnHover}),V.slot.children)})},xr=function(i){var m=i.annotation,M=i.page,F=i.viewport,O=m.hasPopup===!1,U=j(m),Q=be(m),ae=!!(m.hasPopup||U||Q);return e.createElement(st,{annotation:m,hasPopup:O,ignoreBorder:!0,isRenderable:ae,page:M,viewport:F},function(V){return e.createElement("div",b({},V.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--strike-out","data-annotation-id":m.id,onClick:V.popup.toggleOnClick,onMouseEnter:V.popup.openOnHover,onMouseLeave:V.popup.closeOnHover}),V.slot.children)})},Ir=function(){return e.createElement(f,{size:16},e.createElement("path",{d:"M.5,16.5a1,1,0,0,0,1,1h2v4l4-4h15a1,1,0,0,0,1-1V3.5a1,1,0,0,0-1-1H1.5a1,1,0,0,0-1,1Z"}),e.createElement("path",{d:"M7.25,9.75A.25.25,0,1,1,7,10a.25.25,0,0,1,.25-.25"}),e.createElement("path",{d:"M12,9.75a.25.25,0,1,1-.25.25A.25.25,0,0,1,12,9.75"}),e.createElement("path",{d:"M16.75,9.75a.25.25,0,1,1-.25.25.25.25,0,0,1,.25-.25"}))},$r=function(){return e.createElement(f,{size:16},e.createElement("path",{d:"M0.500 12.001 A11.500 11.500 0 1 0 23.500 12.001 A11.500 11.500 0 1 0 0.500 12.001 Z"}),e.createElement("path",{d:"M6.000 12.001 A6.000 6.000 0 1 0 18.000 12.001 A6.000 6.000 0 1 0 6.000 12.001 Z"}),e.createElement("path",{d:"M21.423 5.406L17.415 9.414"}),e.createElement("path",{d:"M14.587 6.585L18.607 2.565"}),e.createElement("path",{d:"M5.405 21.424L9.413 17.416"}),e.createElement("path",{d:"M6.585 14.588L2.577 18.596"}),e.createElement("path",{d:"M18.602 21.419L14.595 17.412"}),e.createElement("path",{d:"M17.419 14.58L21.428 18.589"}),e.createElement("path",{d:"M2.582 5.399L6.588 9.406"}),e.createElement("path",{d:"M9.421 6.581L5.412 2.572"}))},Or=function(){return e.createElement(f,{size:16},e.createElement("path",{d:"M4.000 18.500 A1.500 1.500 0 1 0 7.000 18.500 A1.500 1.500 0 1 0 4.000 18.500 Z"}),e.createElement("path",{d:"M20.5.5l-9.782,9.783a7,7,0,1,0,3,3L17,10h1.5V8.5L19,8h1.5V6.5L21,6h1.5V4.5l1-1V.5Z"}))},Lr=function(){return e.createElement(f,{size:16},e.createElement("path",{d:"M2.000 2.500 L22.000 2.500 L22.000 23.500 L2.000 23.500 Z"}),e.createElement("path",{d:"M6 4.5L6 0.5"}),e.createElement("path",{d:"M18 4.5L18 0.5"}),e.createElement("path",{d:"M10 4.5L10 0.5"}),e.createElement("path",{d:"M14 4.5L14 0.5"}))},Fr=function(){return e.createElement(f,{size:16},e.createElement("path",{d:"M17.5 0.498L17.5 23.498"}),e.createElement("path",{d:"M10.5 0.498L10.5 23.498"}),e.createElement("path",{d:"M23.5.5H6.5a6,6,0,0,0,0,12h4"}))},Dr=function(){return e.createElement(f,{size:16},e.createElement("path",{d:"M2.5 22.995L12 6.005 21.5 22.995 2.5 22.995z"}))},Nr=function(i){var m=i.annotation,M=i.childAnnotation,F=i.page,O=i.viewport,U=m.hasPopup===!1,Q=j(m),ae=be(m),V=!!(m.hasPopup||Q||ae),ee=m.name?m.name.toLowerCase():"";return e.createElement(st,{annotation:m,hasPopup:U,ignoreBorder:!1,isRenderable:V,page:F,viewport:O},function(Re){return e.createElement(e.Fragment,null,e.createElement("div",b({},Re.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--text","data-annotation-id":m.id,onClick:Re.popup.toggleOnClick,onMouseEnter:Re.popup.openOnHover,onMouseLeave:Re.popup.closeOnHover}),ee&&e.createElement("div",{className:"rpv-core__annotation-text-icon"},ee==="check"&&e.createElement(g,null),ee==="comment"&&e.createElement(Ir,null),ee==="help"&&e.createElement($r,null),ee==="insert"&&e.createElement(Dr,null),ee==="key"&&e.createElement(Or,null),ee==="note"&&e.createElement(Lr,null),(ee==="newparagraph"||ee==="paragraph")&&e.createElement(Fr,null)),Re.slot.children),M&&M.annotationType===t.AnnotationType.Popup&&Re.popup.opened&&e.createElement(It,{annotation:M,page:F,viewport:O}))})},Br=function(i){var m=i.annotation,M=i.page,F=i.viewport,O=m.hasPopup===!1,U=j(m),Q=be(m),ae=!!(m.hasPopup||U||Q);return e.createElement(st,{annotation:m,hasPopup:O,ignoreBorder:!0,isRenderable:ae,page:M,viewport:F},function(V){return e.createElement("div",b({},V.slot.attrs,{className:"rpv-core__annotation rpv-core__annotation--underline","data-annotation-id":m.id,onClick:V.popup.toggleOnClick,onMouseEnter:V.popup.openOnHover,onMouseLeave:V.popup.closeOnHover}),V.slot.children)})},jr=function(i){var m=i.annotations,M=i.doc,F=i.outlines,O=i.page,U=i.pageIndex,Q=i.plugins,ae=i.rotation,V=i.scale,ee=i.onExecuteNamedAction,Re=i.onJumpToDest,me=e.useRef(),Pe=O.getViewport({rotation:ae,scale:V}),$e=Pe.clone({dontFlip:!0}),He=m.filter(function(ke){return!ke.parentId});return _(function(){var ke=me.current;ke&&Q.forEach(function(Ke){Ke.onAnnotationLayerRender&&Ke.onAnnotationLayerRender({annotations:He,container:ke,pageIndex:U,rotation:ae,scale:V})})},[]),e.createElement("div",{ref:me,className:"rpv-core__annotation-layer","data-testid":"core__annotation-layer-".concat(U)},He.map(function(ke){var Ke=m.find(function(at){return at.parentId===ke.id});switch(ke.annotationType){case t.AnnotationType.Caret:return e.createElement(Ct,{key:ke.id,annotation:ke,page:O,viewport:$e});case t.AnnotationType.Circle:return e.createElement(gt,{key:ke.id,annotation:ke,page:O,viewport:$e});case t.AnnotationType.FileAttachment:return e.createElement(Rt,{key:ke.id,annotation:ke,page:O,viewport:$e});case t.AnnotationType.FreeText:return e.createElement(Xt,{key:ke.id,annotation:ke,page:O,viewport:$e});case t.AnnotationType.Highlight:return e.createElement(_t,{key:ke.id,annotation:ke,childAnnotation:Ke,page:O,viewport:$e});case t.AnnotationType.Ink:return e.createElement($t,{key:ke.id,annotation:ke,page:O,viewport:$e});case t.AnnotationType.Line:return e.createElement(Ot,{key:ke.id,annotation:ke,page:O,viewport:$e});case t.AnnotationType.Link:return e.createElement(Nn,{key:ke.id,annotation:ke,doc:M,outlines:F,page:O,viewport:$e,onExecuteNamedAction:ee,onJumpToDest:Re});case t.AnnotationType.Polygon:return e.createElement(Bn,{key:ke.id,annotation:ke,page:O,viewport:$e});case t.AnnotationType.Polyline:return e.createElement(Fn,{key:ke.id,annotation:ke,page:O,viewport:$e});case t.AnnotationType.Popup:return e.createElement(It,{key:ke.id,annotation:ke,page:O,viewport:$e});case t.AnnotationType.Square:return e.createElement(Xn,{key:ke.id,annotation:ke,page:O,viewport:$e});case t.AnnotationType.Squiggly:return e.createElement(or,{key:ke.id,annotation:ke,page:O,viewport:$e});case t.AnnotationType.Stamp:return e.createElement(mr,{key:ke.id,annotation:ke,page:O,viewport:$e});case t.AnnotationType.StrikeOut:return e.createElement(xr,{key:ke.id,annotation:ke,page:O,viewport:$e});case t.AnnotationType.Text:return e.createElement(Nr,{key:ke.id,annotation:ke,childAnnotation:Ke,page:O,viewport:$e});case t.AnnotationType.Underline:return e.createElement(Br,{key:ke.id,annotation:ke,page:O,viewport:$e});default:return e.createElement(e.Fragment,{key:ke.id})}}))},Hr=function(i){var m=i.page,M=i.renderAnnotations,F=se(),O=e.useState({loading:!0,annotations:[]}),U=O[0],Q=O[1];return e.useEffect(function(){m.getAnnotations({intent:"display"}).then(function(ae){F.current&&Q({loading:!1,annotations:ae})})},[]),U.loading?e.createElement(e.Fragment,null):M(U.annotations)},Vr=function(i){var m=i.doc,M=i.outlines,F=i.page,O=i.pageIndex,U=i.plugins,Q=i.rotation,ae=i.scale,V=i.onExecuteNamedAction,ee=i.onJumpToDest,Re=function(me){return e.createElement(jr,{annotations:me,doc:m,outlines:M,page:F,pageIndex:O,plugins:U,rotation:Q,scale:ae,onExecuteNamedAction:V,onJumpToDest:ee})};return e.createElement(Hr,{page:F,renderAnnotations:Re})},zr=function(i,m){var M,F;if(Math.floor(i)===i)return[i,1];var O=1/i;if(O>m)return[1,m];if(Math.floor(O)===O)return[1,O];for(var U=i>1?O:i,Q=0,ae=1,V=1,ee=1;;){var Re=Q+V,me=ae+ee;if(me>m)break;U<=Re/me?(M=[Re,me],V=M[0],ee=M[1]):(F=[Re,me],Q=F[0],ae=F[1])}var Pe=(Q/ae+V/ee)/2;return U<Pe?U===i?[Q,ae]:[ae,Q]:U===i?[V,ee]:[ee,V]},Yn=function(i,m){var M=i%m;return M===0?i:Math.floor(i-M)},Wr=4096*4096,Ur=function(i){var m=i.canvasLayerRef,M=i.height,F=i.page,O=i.pageIndex,U=i.plugins,Q=i.rotation,ae=i.scale,V=i.width,ee=i.onRenderCanvasCompleted,Re=e.useRef();return _(function(){var me=Re.current;me&&me.cancel();var Pe=m.current;Pe.removeAttribute("data-testid"),U.forEach(function(mt){mt.onCanvasLayerRender&&mt.onCanvasLayerRender({ele:Pe,pageIndex:O,rotation:Q,scale:ae,status:t.LayerRenderStatus.PreRender})});var $e=F.getViewport({rotation:Q,scale:ae}),He=window.devicePixelRatio||1,ke=Math.sqrt(Wr/($e.width*$e.height)),Ke=He>ke;Ke?Pe.style.transform="scale(1, 1)":Pe.style.removeProperty("transform");var at=Math.min(ke,He),Je=zr(at,8),tt=Je[0],dt=Je[1];Pe.width=Yn($e.width*at,tt),Pe.height=Yn($e.height*at,tt),Pe.style.width="".concat(Yn($e.width,dt),"px"),Pe.style.height="".concat(Yn($e.height,dt),"px"),Pe.hidden=!0;var Mt=Pe.getContext("2d",{alpha:!1}),jt=Ke||He!==1?[at,0,0,at,0,0]:null;return Re.current=F.render({canvasContext:Mt,transform:jt,viewport:$e}),Re.current.promise.then(function(){Pe.hidden=!1,Pe.setAttribute("data-testid","core__canvas-layer-".concat(O)),U.forEach(function(mt){mt.onCanvasLayerRender&&mt.onCanvasLayerRender({ele:Pe,pageIndex:O,rotation:Q,scale:ae,status:t.LayerRenderStatus.DidRender})}),ee()},function(){ee()}),function(){Pe&&(Pe.width=0,Pe.height=0)}},[]),e.createElement("div",{className:"rpv-core__canvas-layer",style:{height:"".concat(M,"px"),width:"".concat(V,"px")}},e.createElement("canvas",{ref:m}))},Gr=function(i){var m=i.height,M=i.page,F=i.rotation,O=i.scale,U=i.width,Q=e.useRef(),ae=function(){var V=Q.current;V&&(V.innerHTML="")};return _(function(){var V=Q.current,ee=M.getViewport({rotation:F,scale:O});M.getOperatorList().then(function(Re){ae();var me=new p.SVGGraphics(M.commonObjs,M.objs);me.getSVG(Re,ee).then(function(Pe){Pe.style.height="".concat(m,"px"),Pe.style.width="".concat(U,"px"),V.appendChild(Pe)})})},[]),e.createElement("div",{className:"rpv-core__svg-layer",ref:Q})},qr=function(i){var m=i.containerRef,M=i.page,F=i.pageIndex,O=i.plugins,U=i.rotation,Q=i.scale,ae=i.onRenderTextCompleted,V=e.useRef(),ee=function(){var Re=m.current;if(Re){var me=[].slice.call(Re.querySelectorAll(".rpv-core__text-layer-text"));me.forEach(function($e){return Re.removeChild($e)});var Pe=[].slice.call(Re.querySelectorAll('br[role="presentation"]'));Pe.forEach(function($e){return Re.removeChild($e)})}};return _(function(){var Re=V.current;Re&&Re.cancel();var me=m.current;if(me){me.removeAttribute("data-testid");var Pe=M.getViewport({rotation:U,scale:Q});return O.forEach(function($e){$e.onTextLayerRender&&$e.onTextLayerRender({ele:me,pageIndex:F,scale:Q,status:t.LayerRenderStatus.PreRender})}),M.getTextContent().then(function($e){ee(),V.current=p.renderTextLayer({container:me,textContent:$e,viewport:Pe}),V.current.promise.then(function(){me.setAttribute("data-testid","core__text-layer-".concat(F));var He=[].slice.call(me.children);He.forEach(function(ke){ke.classList.contains("rpv-core__text-layer-text--not")||ke.classList.add("rpv-core__text-layer-text")}),O.forEach(function(ke){ke.onTextLayerRender&&ke.onTextLayerRender({ele:me,pageIndex:F,scale:Q,status:t.LayerRenderStatus.DidRender})}),ae()},function(){me.removeAttribute("data-testid"),ae()})}),function(){var $e;ee(),($e=V.current)===null||$e===void 0||$e.cancel()}}},[]),e.createElement("div",{className:"rpv-core__text-layer",ref:m})},Kr=function(i){var m=i.doc,M=i.measureRef,F=i.outlines,O=i.pageIndex,U=i.pageRotation,Q=i.pageSize,ae=i.plugins,V=i.renderPage,ee=i.renderQueueKey,Re=i.rotation,me=i.scale,Pe=i.shouldRender,$e=i.viewMode,He=i.onExecuteNamedAction,ke=i.onJumpToDest,Ke=i.onRenderCompleted,at=i.onRotatePage,Je=se(),tt=e.useState(null),dt=tt[0],Mt=tt[1],jt=e.useState(!1),mt=jt[0],Zt=jt[1],mn=e.useState(!1),At=mn[0],hn=mn[1],ln=e.useRef(),_n=e.useRef(),fn=Math.abs(Re+U)%180===0,cn=Q.pageWidth*me,Dt=Q.pageHeight*me,un=fn?cn:Dt,Ut=fn?Dt:cn,qt=(Q.rotation+Re+U)%360,$n=e.useRef(0),En=function(){Ye(m,O).then(function(zt){Je.current&&($n.current=ee,Mt(zt))})},Mn=function(zt){return e.createElement(e.Fragment,null,zt.canvasLayer.children,zt.textLayer.children,zt.annotationLayer.children)},Sn=V||Mn,Gt=function(){Je.current&&Zt(!0)},wn=function(){Je.current&&hn(!0)};return e.useEffect(function(){Mt(null),Zt(!1),hn(!1)},[U,Re,me]),e.useEffect(function(){Pe&&Je.current&&!dt&&En()},[Pe,dt]),e.useEffect(function(){mt&&At&&(ee!==$n.current?(Mt(null),Zt(!1),hn(!1)):Ke(O))},[mt,At]),e.createElement("div",{className:A({"rpv-core__page-layer":!0,"rpv-core__page-layer--dual":$e===t.ViewMode.DualPage,"rpv-core__page-layer--dual-cover":$e===t.ViewMode.DualPageWithCover,"rpv-core__page-layer--single":$e===t.ViewMode.SinglePage}),"data-testid":"core__page-layer-".concat(O),ref:M,style:{height:"".concat(Ut,"px"),width:"".concat(un,"px")}},dt?e.createElement(e.Fragment,null,Sn({annotationLayer:{attrs:{},children:e.createElement(Vr,{doc:m,outlines:F,page:dt,pageIndex:O,plugins:ae,rotation:qt,scale:me,onExecuteNamedAction:He,onJumpToDest:ke})},canvasLayer:{attrs:{},children:e.createElement(Ur,{canvasLayerRef:ln,height:Ut,page:dt,pageIndex:O,plugins:ae,rotation:qt,scale:me,width:un,onRenderCanvasCompleted:Gt})},canvasLayerRendered:mt,doc:m,height:Ut,pageIndex:O,rotation:qt,scale:me,svgLayer:{attrs:{},children:e.createElement(Gr,{height:Ut,page:dt,rotation:qt,scale:me,width:un})},textLayer:{attrs:{},children:e.createElement(qr,{containerRef:_n,page:dt,pageIndex:O,plugins:ae,rotation:qt,scale:me,onRenderTextCompleted:wn})},textLayerRendered:At,width:un,markRendered:Ke,onRotatePage:function(zt){return at(O,zt)}}),ae.map(function(zt,xn){return zt.renderPageLayer?e.createElement(e.Fragment,{key:xn},zt.renderPageLayer({canvasLayerRef:ln,canvasLayerRendered:mt,doc:m,height:Ut,pageIndex:O,rotation:qt,scale:me,textLayerRef:_n,textLayerRendered:At,width:un})):e.createElement(e.Fragment,{key:xn})})):e.createElement(X,{testId:"core__page-layer-loading-".concat(O)}))},zn=function(i,m){return i.reduce(function(M,F,O){return O%m?M[M.length-1].push(F):M.push([F]),M},[])},Xr=function(i){var m=i.split(/\./).pop();return m?m.toLowerCase():""},Yr=function(i,m){var M=m.rect;return i.height!==M.height||i.width!==M.width?M:i},Zr=function(i){var m=i.elementRef,M=e.useState(m.current),F=M[0],O=M[1],U=e.useRef(!1),Q=e.useReducer(Yr,{height:0,width:0}),ae=Q[0],V=Q[1];return _(function(){m.current!==F&&O(m.current)}),_(function(){if(F&&!U.current){U.current=!0;var ee=F.getBoundingClientRect(),Re=ee.height,me=ee.width;V({rect:{height:Re,width:me}})}},[F]),e.useEffect(function(){if(F){var ee=new ResizeObserver(function(Re,me){Re.forEach(function(Pe){if(Pe.target===F){var $e=Pe.contentRect,He=$e.height,ke=$e.width;V({rect:{height:He,width:ke}})}})});return ee.observe(F),function(){ee.unobserve(F)}}},[F]),ae},Vt;(function(i){i.Horizontal="Horizontal",i.Vertical="Vertical",i.Both="Both"})(Vt||(Vt={}));var Jr=function(i){return 1-Math.pow(1-i,4)},vr=1e-4,Qr=function(i,m,M,F,O,U){O===void 0&&(O=function(Pe){return Pe}),U===void 0&&(U=function(){});var Q=0,ae=0;switch(m){case Vt.Horizontal:ae=i.scrollLeft,Q=0;case Vt.Both:ae=i.scrollLeft,Q=i.scrollTop;break;case Vt.Vertical:default:ae=0,Q=i.scrollTop;break}if(!(Q===M.top&&m===Vt.Vertical)&&!(ae===M.left&&m===Vt.Horizontal)){var V=-1,ee,Re={left:ae-M.left,top:Q-M.top},me=function(Pe){V===-1&&(V=Pe);var $e=Pe-V,He=Math.min($e/F,1),ke=O(He),Ke={left:ae-Re.left*ke,top:Q-Re.top*ke};switch(m){case Vt.Horizontal:i.scrollLeft=Ke.left;break;case Vt.Both:i.scrollLeft=Ke.left,i.scrollTop=Ke.top;break;case Vt.Vertical:default:i.scrollTop=Ke.top;break}Math.abs(Ke.top-M.top)<=vr&&Math.abs(Ke.left-M.left)<=vr&&U(),$e<F?ee=window.requestAnimationFrame(me):window.cancelAnimationFrame(ee)};ee=window.requestAnimationFrame(me)}},Zn=function(i){var m=se(),M=e.useRef(0),F=e.useState(i),O=F[0],U=F[1],Q=e.useCallback(function(ae){cancelAnimationFrame(M.current),M.current=requestAnimationFrame(function(){m.current&&U(ae)})},[]);return e.useEffect(function(){return function(){cancelAnimationFrame(M.current)}},[]),[O,Q]},ea={left:0,top:0},gr={capture:!1,passive:!0},ta=400,na=function(i){var m=i.elementRef,M=i.isRtl,F=i.scrollDirection,O=i.onSmoothScroll,U=Zn(ea),Q=U[0],ae=U[1],V=e.useState(m.current),ee=V[0],Re=V[1],me=M?-1:1,Pe=e.useRef(F);Pe.current=F;var $e=e.useCallback(function(){return O(!1)},[]),He=e.useCallback(function(){if(ee)switch(Pe.current){case Vt.Horizontal:ae({left:me*ee.scrollLeft,top:0});break;case Vt.Both:ae({left:me*ee.scrollLeft,top:ee.scrollTop});break;case Vt.Vertical:default:ae({left:0,top:ee.scrollTop});break}},[ee]);_(function(){Re(m.current)}),_(function(){if(ee)return ee.addEventListener("scroll",He,gr),function(){ee.removeEventListener("scroll",He,gr)}},[ee]);var ke=e.useCallback(function(Ke,at){var Je=m.current;if(Je){var tt={left:0,top:0};switch(Pe.current){case Vt.Horizontal:tt.left=me*Ke.left;break;case Vt.Both:tt.left=me*Ke.left,tt.top=Ke.top;break;case Vt.Vertical:default:tt.top=Ke.top;break}if(at)O(!0),Qr(Je,Pe.current,tt,ta,Jr,$e);else switch(Pe.current){case Vt.Horizontal:Je.scrollLeft=tt.left;break;case Vt.Both:Je.scrollLeft=tt.left,Je.scrollTop=tt.top;break;case Vt.Vertical:default:Je.scrollTop=tt.top;break}}},[m]);return{scrollOffset:Q,scrollTo:ke}},Wn=function(i,m,M){return Math.max(i,Math.min(M,m))},ra=function(i){return i.reduce(function(m,M,F,O){return M>O[m]?F:m},0)},_r=function(i,m){switch(m){case t.ScrollMode.Horizontal:return{position:"relative",height:"100%",width:"".concat(i.width,"px")};case t.ScrollMode.Vertical:default:return{position:"relative",height:"".concat(i.height,"px"),width:"100%"}}},aa=function(i,m,M){return M!==t.ScrollMode.Page?{}:{height:"".concat(m.height,"px"),width:"100%",position:"absolute",top:0,transform:"translateY(".concat(i.start.top,"px)")}},sr=function(i){var m=i.length;if(m===1)return!1;for(var M=1;M<m;M++)if(i[M].height!==i[0].height||i[M].width!==i[0].width)return!0;return!1},ia=function(i,m){if(m!==t.ViewMode.DualPageWithCover)return 0;if(!sr(i))return 2*i[0].width;var M=zn(i.slice(1),2).map(function(O){return O.length===2?O[0].width+O[1].width:O[0].width}),F=[i[0].width].concat(M);return Math.max.apply(Math,F)},br=function(i,m,M,F,O){var U,Q,ae,V,ee,Re,me,Pe=m?"right":"left",$e=m?-1:1,He=M.length,ke=i.start.left*$e,Ke=i.size,at=Ke.height,Je=Ke.width;if(F===t.ViewMode.DualPageWithCover){var tt=O===t.ScrollMode.Page?0:i.start.top;return i.index===0||He%2===0&&i.index===He-1?(U={height:"".concat(at,"px"),minWidth:"".concat(ia(M,F),"px"),width:"100%"},U[Pe]=0,U.position="absolute",U.top=0,U.transform="translate(".concat(ke,"px, ").concat(tt,"px)"),U):(Q={height:"".concat(at,"px"),width:"".concat(Je,"px")},Q[Pe]=0,Q.position="absolute",Q.top=0,Q.transform="translate(".concat(ke,"px, ").concat(tt,"px)"),Q)}if(F===t.ViewMode.DualPage)return ae={height:"".concat(at,"px"),width:"".concat(Je,"px")},ae[Pe]=0,ae.position="absolute",ae.top=0,ae.transform="translate(".concat(ke,"px, ").concat(O===t.ScrollMode.Page?0:i.start.top,"px)"),ae;switch(O){case t.ScrollMode.Horizontal:return V={height:"100%",width:"".concat(Je,"px")},V[Pe]=0,V.position="absolute",V.top=0,V.transform="translateX(".concat(ke,"px)"),V;case t.ScrollMode.Page:return ee={height:"".concat(at,"px"),width:"".concat(Je,"px")},ee[Pe]=0,ee.position="absolute",ee.top=0,ee;case t.ScrollMode.Wrapped:return Re={height:"".concat(at,"px"),width:"".concat(Je,"px")},Re[Pe]=0,Re.position="absolute",Re.top=0,Re.transform="translate(".concat(ke,"px, ").concat(i.start.top,"px)"),Re;case t.ScrollMode.Vertical:default:return me={height:"".concat(at,"px"),width:"100%"},me[Pe]=0,me.position="absolute",me.top=0,me.transform="translateY(".concat(i.start.top,"px)"),me}},oa=function(i,m,M,F){for(;i<=m;){var O=(i+m)/2|0,U=F(O);if(U<M)i=O+1;else if(U>M)m=O-1;else return O}return i>0?i-1:0},Er=function(i,m,M,F){var O=0;switch(i){case Vt.Horizontal:O=F.left;break;case Vt.Vertical:default:O=F.top;break}var U=m.length-1,Q=function(Pe){switch(i){case Vt.Horizontal:return m[Pe].start.left;case Vt.Both:case Vt.Vertical:default:return m[Pe].start.top}},ae=oa(0,U,O,Q);if(i===Vt.Both)for(var V=m[ae].start.top;ae-1>=0&&m[ae-1].start.top===V&&m[ae-1].start.left>=F.left;)ae--;for(var ee=ae;ee<=U;){var Re={top:m[ee].start.top-F.top,left:m[ee].start.left-F.left},me={height:M.height-Re.top,width:M.width-Re.left};if(i===Vt.Horizontal&&me.width<0||i===Vt.Vertical&&me.height<0||i===Vt.Both&&(me.width<0||me.height<0))break;ee++}return{start:ae,end:ee}},sa={left:0,top:0},ca=function(i,m,M,F){for(var O=[],U=0,Q={left:0,top:0},ae=0,V=sa,ee=0;ee<i;ee++){var Re=M[ee];if(ee===0)U=Re.width,Q={left:0,top:0},ae=Re.height;else switch(F){case t.ScrollMode.Wrapped:U+=Re.width,U<m.width?(V={left:O[ee-1].end.left,top:Q.top},ae=Math.max(ae,Re.height)):(U=Re.width,V={left:Q.left,top:Q.top+ae},Q={left:V.left,top:V.top},ae=Re.height);break;case t.ScrollMode.Horizontal:case t.ScrollMode.Vertical:default:V=O[ee-1].end;break}var me={left:V.left+Re.width,top:V.top+Re.height};O[ee]={index:ee,start:V,size:Re,end:me,visibility:-1}}return O},Sr={left:0,top:0},la=function(i,m,M,F){for(var O=[],U=0,Q=0,ae=Sr,V=0;V<i;V++){var ee={height:F===t.ScrollMode.Page?Math.max(m.height,M[V].height):M[V].height,width:Math.max(m.width/2,M[V].width)};F===t.ScrollMode.Page?ae={left:V%2===0?0:ee.width,top:Math.floor(V/2)*ee.height}:V%2===0?(U=U+Q,ae={left:0,top:U},Q=V===i-1?M[V].height:Math.max(M[V].height,M[V+1].height)):ae={left:O[V-1].end.left,top:U};var Re={left:ae.left+ee.width,top:ae.top+ee.height};O[V]={index:V,start:ae,size:ee,end:Re,visibility:-1}}return O},cr={left:0,top:0},ua=function(i,m,M,F){for(var O=[],U=0,Q=0,ae=cr,V=0;V<i;V++){var ee=V===0?{height:F===t.ScrollMode.Page?Math.max(m.height,M[V].height):M[V].height,width:F===t.ScrollMode.Page?Math.max(m.width,M[V].width):M[V].width}:{height:F===t.ScrollMode.Page?Math.max(m.height,M[V].height):M[V].height,width:Math.max(m.width/2,M[V].width)};F===t.ScrollMode.Page?ae=V===0?cr:{left:V%2===0?ee.width:0,top:Math.floor((V-1)/2)*ee.height+O[0].end.top}:V===0?(ae=cr,U=M[0].height,Q=0):V%2===1?(U=U+Q,ae={left:0,top:U},Q=V===i-1?M[V].height:Math.max(M[V].height,M[V+1].height)):ae={left:O[V-1].end.left,top:U};var Re={left:ae.left+ee.width,top:ae.top+ee.height};O[V]={index:V,start:ae,size:ee,end:Re,visibility:-1}}return O},da={left:0,top:0},Jn=function(i,m,M){for(var F=[],O=0;O<i;O++){var U={height:Math.max(m.height,M[O].height),width:Math.max(m.width,M[O].width)},Q=O===0?da:F[O-1].end,ae={left:Q.left+U.width,top:Q.top+U.height};F[O]={index:O,start:Q,size:U,end:ae,visibility:-1}}return F},In={height:0,width:0},Qn={left:0,top:0},Rr=1e-12,lr="data-virtual-index",yr=[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1],ur=function(i){var m=i.isRtl,M=i.numberOfItems,F=i.parentRef,O=i.setStartRange,U=i.setEndRange,Q=i.sizes,ae=i.scrollMode,V=i.viewMode,ee=e.useState(!1),Re=ee[0],me=ee[1],Pe=e.useCallback(function(pt){return me(pt)},[]),$e=e.useRef(ae);$e.current=ae;var He=e.useRef(V);He.current=V;var ke=ae===t.ScrollMode.Wrapped||V===t.ViewMode.DualPageWithCover||V===t.ViewMode.DualPage?Vt.Both:ae===t.ScrollMode.Horizontal?Vt.Horizontal:Vt.Vertical,Ke=na({elementRef:F,isRtl:m,scrollDirection:ke,onSmoothScroll:Pe}),at=Ke.scrollOffset,Je=Ke.scrollTo,tt=Zr({elementRef:F}),dt=e.useRef({scrollOffset:Qn,measurements:[],parentRect:In,totalSize:In});dt.current.scrollOffset=at,dt.current.parentRect=tt;var Mt=e.useMemo(function(){return Array(M).fill(-1)},[]),jt=e.useState(Mt),mt=jt[0],Zt=jt[1],mn=e.useMemo(function(){var pt=new IntersectionObserver(function(Jt){Jt.forEach(function(Kt){var on=Kt.isIntersecting?Kt.intersectionRatio:-1,Nt=Kt.target,xt=Nt.getAttribute(lr);if(xt){var en=parseInt(xt,10);0<=en&&en<M&&Zt(function(Rn){return Rn[en]=on,R([],Rn,!0)})}})},{threshold:yr});return pt},[]),At=e.useMemo(function(){return ae===t.ScrollMode.Page&&V===t.ViewMode.SinglePage?Jn(M,tt,Q):V===t.ViewMode.DualPageWithCover?ua(M,tt,Q,ae):V===t.ViewMode.DualPage?la(M,tt,Q,ae):ca(M,tt,Q,ae)},[ae,Q,V,tt]),hn=At[M-1]?{height:At[M-1].end.top,width:At[M-1].end.left}:In;dt.current.measurements=At,dt.current.totalSize=hn;var ln=Er(ke,dt.current.measurements,dt.current.parentRect,dt.current.scrollOffset),_n=ln.start,fn=ln.end,cn=mt.slice(Wn(0,M-1,_n),Wn(0,M-1,fn)),Dt=_n+ra(cn);Dt=Wn(0,M-1,Dt);var un=Dt,Ut=O(_n),qt=U(fn);switch(V){case t.ViewMode.DualPageWithCover:Dt>0&&(un=Dt%2===1?Dt:Dt-1),Ut=Ut===0?0:Ut%2===1?Ut:Ut-1,qt=qt%2===1?qt-1:qt,M-qt<=2&&(qt=M-1);break;case t.ViewMode.DualPage:un=Dt%2===0?Dt:Dt-1,Ut=Ut%2===0?Ut:Ut-1,qt=qt%2===1?qt:qt-1;break;case t.ViewMode.SinglePage:default:un=Dt;break}var $n=e.useMemo(function(){for(var pt=[],Jt=function(on){var Nt=At[on],xt=b(b({},Nt),{visibility:mt[on]!==void 0?mt[on]:-1,measureRef:function(en){en&&(en.setAttribute(lr,"".concat(on)),mn.observe(en))}});pt.push(xt)},Kt=Ut;Kt<=qt;Kt++)Jt(Kt);return pt},[Ut,qt,mt,At]),En=e.useCallback(function(pt,Jt){var Kt=dt.current.measurements,on=Wn(0,M-1,pt),Nt=Kt[on],xt=$e.current===t.ScrollMode.Page?Qn:Jt;Nt&&Je({left:xt.left+Nt.start.left,top:xt.top+Nt.start.top},!0)},[Je]),Mn=e.useCallback(function(pt,Jt){var Kt=dt.current.measurements,on=Kt[pt].start,Nt=Kt.find(function(en){return en.start.top-on.top>Rr});if(Nt){var xt=Nt.index;switch(He.current){case t.ViewMode.DualPage:xt=xt%2===0?xt:xt+1;break;case t.ViewMode.DualPageWithCover:xt=xt%2===1?xt:xt+1;break}En(xt,Jt)}},[]),Sn=e.useCallback(function(pt,Jt){for(var Kt=dt.current.measurements,on=Kt[pt].start,Nt=pt,xt=!1,en=M-1;en>=0;en--)if(on.top-Kt[en].start.top>Rr){xt=!0,Nt=Kt[en].index;break}if(xt){switch(He.current){case t.ViewMode.DualPage:Nt=Nt%2===0?Nt:Nt-1;break;case t.ViewMode.DualPageWithCover:Nt=Nt%2===0?Nt-1:Nt;break}Nt===pt&&(Nt=pt-1),En(Nt,Jt)}},[]),Gt=e.useCallback(function(pt,Jt){if(He.current===t.ViewMode.DualPageWithCover||He.current===t.ViewMode.DualPage){Mn(pt,Jt);return}switch($e.current){case t.ScrollMode.Wrapped:Mn(pt,Jt);break;case t.ScrollMode.Horizontal:case t.ScrollMode.Vertical:default:En(pt+1,Jt);break}},[]),wn=e.useCallback(function(pt,Jt){if(He.current===t.ViewMode.DualPageWithCover||He.current===t.ViewMode.DualPage){Sn(pt,Jt);return}switch($e.current){case t.ScrollMode.Wrapped:Sn(pt,Jt);break;case t.ScrollMode.Horizontal:case t.ScrollMode.Vertical:default:En(pt-1,Jt);break}},[]),zt=e.useCallback(function(){return _r(hn,$e.current)},[hn]),xn=e.useCallback(function(pt){return aa(pt,tt,$e.current)},[tt]),jn=e.useCallback(function(pt){return br(pt,m,Q,He.current,$e.current)},[m,Q]),Dn=e.useCallback(function(pt,Jt){var Kt=dt.current,on=Kt.measurements,Nt=Kt.scrollOffset,xt=Wn(0,M-1,Jt),en=on[xt];if(en){var Rn=$e.current===t.ScrollMode.Page?{left:en.start.left,top:en.start.top}:{left:Nt.left*pt,top:Nt.top*pt};Je(Rn,!1)}},[]);return e.useEffect(function(){return function(){mn.disconnect()}},[]),{isSmoothScrolling:Re,startIndex:_n,startRange:Ut,endIndex:fn,endRange:qt,maxVisbilityIndex:un,virtualItems:$n,getContainerStyles:zt,getItemContainerStyles:xn,getItemStyles:jn,scrollToItem:En,scrollToNextItem:Gt,scrollToPreviousItem:wn,zoom:Dn}},Pr=17,ha=8,dr=function(i,m,M,F,O,U){var Q=M;switch(!0){case(O===t.ViewMode.DualPageWithCover&&U>=3):case(O===t.ViewMode.DualPage&&U>=3):Q=2*M;break;default:Q=M;break}switch(F){case t.SpecialZoomLevel.ActualSize:return 1;case t.SpecialZoomLevel.PageFit:return Math.min((i.clientWidth-Pr)/Q,(i.clientHeight-2*ha)/m);case t.SpecialZoomLevel.PageWidth:return(i.clientWidth-Pr)/Q}},fa=function(i){var m=[];return i.items&&i.items.length>0&&(m=m.concat(wr(i.items))),m},wr=function(i){var m=[];return i.map(function(M){m=m.concat(M).concat(fa(M))}),m},pa=function(i){var m=se(),M=e.useState([]),F=M[0],O=M[1];return e.useEffect(function(){i.getOutline().then(function(U){if(m.current&&U!==null){var Q=wr(U);O(Q)}})},[]),F},u=3,w={buildPageStyles:function(){return{}},tranformSize:function(i){var m=i.size;return m}},H={left:0,top:0},W=function(i){var m=i.currentFile,M=i.defaultScale,F=i.doc,O=i.initialPage,U=i.initialRotation,Q=i.initialScale,ae=i.pageLayout,V=i.pageSizes,ee=i.plugins,Re=i.renderPage,me=i.scrollMode,Pe=i.viewMode,$e=i.viewerState,He=i.onDocumentLoad,ke=i.onOpenFile,Ke=i.onPageChange,at=i.onRotate,Je=i.onRotatePage,tt=i.onZoom,dt=F.numPages,Mt=F.loadingTask.docId,jt=e.useContext(oe).l10n,mt=e.useContext(S),Zt=mt.direction===t.TextDirection.RightToLeft,mn=e.useRef(),At=e.useRef(),hn=e.useState(O),ln=hn[0],_n=hn[1],fn=e.useRef(null),cn=e.useState(U),Dt=cn[0],un=cn[1],Ut=We(Dt),qt=e.useState(!1),$n=qt[0],En=qt[1],Mn=e.useState(new Map),Sn=Mn[0],Gt=Mn[1],wn=e.useState(me),zt=wn[0],xn=wn[1],jn=We(zt),Dn=e.useState(Pe),pt=Dn[0],Jt=Dn[1],Kt=We(pt),on=pa(F),Nt=e.useState(Q),xt=Nt[0],en=Nt[1],Rn=We(xt),er=e.useMemo(function(){return Array(dt).fill(-1)},[]),Cn=e.useState(er);Cn[0],Cn[1];var Ht=e.useRef($e),et=e.useRef(typeof M=="string"?M:null),St=e.useState(-1),yt=St[0],pn=St[1],kn=e.useState(0),vn=kn[0],Tn=kn[1],nn=le({doc:F});e.useEffect(function(){return function(){Le()}},[Mt]);var On=e.useMemo(function(){return Object.assign({},w,ae)},[]),tr=e.useMemo(function(){return Array(dt).fill(0).map(function(Qe,Pt){var Bt=[V[Pt].pageHeight,V[Pt].pageWidth],rn=Math.abs(Dt)%180===0?{height:Bt[0],width:Bt[1]}:{height:Bt[1],width:Bt[0]},sn={height:rn.height*xt,width:rn.width*xt};return On.tranformSize({numPages:dt,pageIndex:Pt,size:sn})})},[Dt,xt]),Hn=e.useCallback(function(Qe){return Math.max(Qe-u,0)},[]),Vn=e.useCallback(function(Qe){return Math.min(Qe+u,dt-1)},[dt]),Qt=ur({isRtl:Zt,numberOfItems:dt,parentRef:At,scrollMode:zt,setStartRange:Hn,setEndRange:Vn,sizes:tr,viewMode:pt}),hi=nt(function(Qe){et.current&&(pn(-1),hr(et.current))},200);ut({targetRef:At,onResize:hi});var Un=function(Qe){var Pt=Qe;ee.forEach(function(Bt){Bt.onViewerStateChange&&(Pt=Bt.onViewerStateChange(Pt))}),Ht.current=Pt},fi=function(){return At.current},pi=function(){return Ht.current},Da=e.useCallback(function(Qe,Pt,Bt,rn){var sn=At.current,Wt=Ht.current;!sn||!Wt||Ye(F,Qe).then(function(gn){var yn=gn.getViewport({scale:1}),qn=0,Cr=(typeof Pt=="function"?Pt(yn.width,yn.height):Pt)||0,nr=(typeof Bt=="function"?Bt(yn.width,yn.height):Bt)||0,rr=Wt.scale;switch(rn){case t.SpecialZoomLevel.PageFit:qn=0,nr=0,hr(t.SpecialZoomLevel.PageFit);break;case t.SpecialZoomLevel.PageWidth:rr=dr(sn,V[Qe].pageHeight,V[Qe].pageWidth,t.SpecialZoomLevel.PageWidth,Pe,dt),qn=(yn.height-Cr)*rr,nr=nr*rr,hr(rr);break;default:qn=(yn.height-Cr)*rr,nr=nr*rr;break}switch(Wt.scrollMode){case t.ScrollMode.Horizontal:Qt.scrollToItem(Qe,{left:nr,top:0});break;case t.ScrollMode.Vertical:default:Qt.scrollToItem(Qe,{left:0,top:qn});break}})},[]),mi=e.useCallback(function(){Qt.scrollToNextItem(Ht.current.pageIndex,H)},[]),Gn=e.useCallback(function(Qe){0<=Qe&&Qe<dt&&Qt.scrollToItem(Qe,H)},[]),vi=e.useCallback(function(){Qt.scrollToPreviousItem(Ht.current.pageIndex,H)},[]),Na=e.useCallback(function(Qe){Xr(Qe.name).toLowerCase()==="pdf"&&new Promise(function(Pt){var Bt=new FileReader;Bt.readAsArrayBuffer(Qe),Bt.onload=function(){var rn=new Uint8Array(Bt.result);Pt(rn)}}).then(function(Pt){ke(Qe.name,Pt)})},[ke]),Ba=e.useCallback(function(Qe){var Pt=Qe===t.RotateDirection.Backward?-90:90,Bt=Ht.current.rotation,rn=Bt===360||Bt===-360?Pt:Bt+Pt;nn.markNotRendered(),un(rn),Un(b(b({},Ht.current),{rotation:rn})),at({direction:Qe,doc:F,rotation:rn})},[]),ma=e.useCallback(function(Qe,Pt){var Bt=Pt===t.RotateDirection.Backward?-90:90,rn=Ht.current.pagesRotation,sn=rn.has(Qe)?rn.get(Qe):U,Wt=sn+Bt,gn=rn.set(Qe,Wt);Gt(gn),En(function(yn){return!yn}),Un(b(b({},Ht.current),{pagesRotation:gn,rotatedPage:Qe})),Je({direction:Pt,doc:F,pageIndex:Qe,rotation:Wt}),nn.markRendering(Qe),pn(Qe)},[]),ja=e.useCallback(function(Qe){Un(b(b({},Ht.current),{scrollMode:Qe})),xn(Qe)},[]),Ha=e.useCallback(function(Qe){Un(b(b({},Ht.current),{viewMode:Qe})),Jt(Qe)},[]),hr=e.useCallback(function(Qe){var Pt=At.current,Bt=Ht.current.pageIndex;if(!(Bt<0||Bt>=dt)){var rn=V[Bt].pageHeight,sn=V[Bt].pageWidth,Wt=Pt?typeof Qe=="string"?dr(Pt,rn,sn,Qe,Ht.current.viewMode,dt):Qe:1;et.current=typeof Qe=="string"?Qe:null,Wt!==Ht.current.scale&&(Tn(function(gn){return gn+1}),nn.markNotRendered(),en(Wt),tt({doc:F,scale:Wt}),Un(b(b({},Ht.current),{scale:Wt})))}},[]);e.useEffect(function(){var Qe={getPagesContainer:fi,getViewerState:pi,jumpToDestination:Da,jumpToNextPage:mi,jumpToPreviousPage:vi,jumpToPage:Gn,openFile:Na,rotate:Ba,rotatePage:ma,setViewerState:Un,switchScrollMode:ja,switchViewMode:Ha,zoom:hr};return ee.forEach(function(Pt){Pt.install&&Pt.install(Qe)}),function(){ee.forEach(function(Pt){Pt.uninstall&&Pt.uninstall(Qe)})}},[Mt]),e.useEffect(function(){He({doc:F,file:m}),ee.forEach(function(Qe){Qe.onDocumentLoad&&Qe.onDocumentLoad({doc:F,file:m})}),O&&Gn(O)},[Mt]),_(function(){var Qe=Ht.current.pageIndex;Qe>-1&&jn!==zt&&Qt.scrollToItem(Qe,H)},[zt]),_(function(){var Qe=Ht.current.pageIndex;Qe>-1&&Ut!==Dt&&Qt.scrollToItem(Qe,H)},[Dt]),_(function(){Rn!=0&&Rn!=Ht.current.scale&&Qt.zoom(Ht.current.scale/Rn,Ht.current.pageIndex)},[xt]),_(function(){if(Kt!==Ht.current.viewMode){var Qe=Qt.startRange,Pt=Qt.endRange,Bt=Qt.virtualItems;nn.markNotRendered(),nn.setRange(Qe,Pt);for(var rn=function(Wt){var gn=Bt.find(function(yn){return yn.index===Wt});gn&&nn.setVisibility(Wt,gn.visibility)},sn=Qe;sn<=Pt;sn++)rn(sn);va()}},[pt]),_(function(){var Qe=Ht.current.pageIndex;Qe>-1&&Kt!==pt&&Qt.scrollToItem(Qe,H)},[pt]),e.useEffect(function(){var Qe=Qt.isSmoothScrolling;Qe||(fn.current===null||fn.current!==ln)&&(fn.current=ln,Ke({currentPage:ln,doc:F}))},[ln,Qt.isSmoothScrolling]),e.useEffect(function(){var Qe=Qt.startRange,Pt=Qt.endRange,Bt=Qt.maxVisbilityIndex,rn=Qt.virtualItems,sn=Bt;_n(sn),Un(b(b({},Ht.current),{pageIndex:sn})),nn.setRange(Qe,Pt);for(var Wt=function(yn){var qn=rn.find(function(Cr){return Cr.index===yn});qn&&nn.setVisibility(yn,qn.visibility)},gn=Qe;gn<=Pt;gn++)Wt(gn);va()},[Qt.startRange,Qt.endRange,Qt.maxVisbilityIndex,$n,Dt,xt]);var gi=e.useCallback(function(Qe){nn.markRendered(Qe),va()},[vn]),va=function(){var Qe=nn.getHighestPriorityPage();Qe>-1&&nn.isInRange(Qe)&&(nn.markRendering(Qe),pn(Qe))},_i=function(Qe){var Pt=ln-1,Bt=ln+1;switch(Qe){case"FirstPage":Gn(0);break;case"LastPage":Gn(dt-1);break;case"NextPage":Bt<dt&&Gn(Bt);break;case"PrevPage":Pt>=0&&Gn(Pt);break}},bi=e.useCallback(function(){var Qe=Qt.virtualItems,Pt=[];switch(pt){case t.ViewMode.DualPage:Pt=zn(Qe,2);break;case t.ViewMode.DualPageWithCover:Qe.length&&(Pt=Qe[0].index===0?[[Qe[0]]].concat(zn(Qe.slice(1),2)):zn(Qe,2));break;case t.ViewMode.SinglePage:default:Pt=zn(Qe,1);break}var Bt=jt&&jt.core?jt.core.pageLabel:"Page {{pageIndex}}",rn={attrs:{"data-testid":"core__inner-container",ref:mn,style:{height:"100%"}},children:e.createElement(e.Fragment,null),subSlot:{attrs:{"data-testid":"core__inner-pages",className:A({"rpv-core__inner-pages":!0,"rpv-core__inner-pages--horizontal":zt===t.ScrollMode.Horizontal,"rpv-core__inner-pages--rtl":Zt,"rpv-core__inner-pages--single":zt===t.ScrollMode.Page,"rpv-core__inner-pages--vertical":zt===t.ScrollMode.Vertical,"rpv-core__inner-pages--wrapped":zt===t.ScrollMode.Wrapped}),ref:At,style:{height:"100%",position:"relative"}},children:e.createElement("div",{style:Qt.getContainerStyles()},Pt.map(function(sn){return e.createElement("div",{className:A({"rpv-core__inner-page-container":!0,"rpv-core__inner-page-container--single":zt===t.ScrollMode.Page}),style:Qt.getItemContainerStyles(sn[0]),key:"".concat(sn[0].index,"-").concat(pt)},sn.map(function(Wt){var gn=pt===t.ViewMode.DualPageWithCover&&(Wt.index===0||dt%2===0&&Wt.index===dt-1);return e.createElement("div",{"aria-label":Bt.replace("{{pageIndex}}","".concat(Wt.index+1)),className:A({"rpv-core__inner-page":!0,"rpv-core__inner-page--dual-even":pt===t.ViewMode.DualPage&&Wt.index%2===0,"rpv-core__inner-page--dual-odd":pt===t.ViewMode.DualPage&&Wt.index%2===1,"rpv-core__inner-page--dual-cover":gn,"rpv-core__inner-page--dual-cover-even":pt===t.ViewMode.DualPageWithCover&&!gn&&Wt.index%2===0,"rpv-core__inner-page--dual-cover-odd":pt===t.ViewMode.DualPageWithCover&&!gn&&Wt.index%2===1,"rpv-core__inner-page--single":pt===t.ViewMode.SinglePage&&zt===t.ScrollMode.Page}),role:"region",key:"".concat(Wt.index,"-").concat(pt),style:Object.assign({},Qt.getItemStyles(Wt),On.buildPageStyles({numPages:dt,pageIndex:Wt.index,scrollMode:zt,viewMode:pt}))},e.createElement(Kr,{doc:F,measureRef:Wt.measureRef,outlines:on,pageIndex:Wt.index,pageRotation:Sn.has(Wt.index)?Sn.get(Wt.index):0,pageSize:V[Wt.index],plugins:ee,renderPage:Re,renderQueueKey:vn,rotation:Dt,scale:xt,shouldRender:yt===Wt.index,viewMode:pt,onExecuteNamedAction:_i,onJumpToDest:Da,onRenderCompleted:gi,onRotatePage:ma}))}))}))}};return ee.forEach(function(sn){sn.renderViewer&&(rn=sn.renderViewer({containerRef:mn,doc:F,pagesRotation:Sn,pageSizes:V,rotation:Dt,slot:rn,themeContext:mt,jumpToPage:Gn,openFile:Na,rotate:Ba,rotatePage:ma,switchScrollMode:ja,switchViewMode:Ha,zoom:hr}))}),rn},[ee,Qt]),Va=e.useCallback(function(Qe){return e.createElement("div",b({},Qe.attrs,{style:Qe.attrs&&Qe.attrs.style?Qe.attrs.style:{}}),Qe.children,Qe.subSlot&&Va(Qe.subSlot))},[]);return Va(bi())},Z=[.1,.2,.3,.4,.5,.6,.7,.8,.9,1,1.1,1.3,1.5,1.7,1.9,2.1,2.4,2.7,3,3.3,3.7,4.1,4.6,5.1,5.7,6.3,7,7.7,8.5,9.4,10],re=function(i){var m=Z.findIndex(function(M){return M>=i});return m===-1||m===0?i:Z[m-1]},de=45,Ee=45,ne=function(i){var m=i.defaultScale,M=i.doc,F=i.render,O=i.scrollMode,U=i.viewMode,Q=e.useRef(),ae=e.useState(1),V=ae[0],ee=ae[1],Re=e.useState([]),me=Re[0],Pe=Re[1];return e.useLayoutEffect(function(){var $e=Array(M.numPages).fill(0).map(function(He,ke){return new Promise(function(Ke,at){Ye(M,ke).then(function(Je){var tt=Je.getViewport({scale:1});Ke({pageHeight:tt.height,pageWidth:tt.width,rotation:tt.rotation})})})});Promise.all($e).then(function(He){Pe(He);var ke=Q.current;if(!(!ke||He.length===0)){var Ke=He[0].pageWidth,at=He[0].pageHeight,Je=ke.parentElement,tt=(Je.clientWidth-Ee)/Ke,dt=(Je.clientHeight-de)/at,Mt=tt;switch(O){case t.ScrollMode.Horizontal:Mt=Math.min(tt,dt);break;case t.ScrollMode.Vertical:default:Mt=tt;break}var jt=m?typeof m=="string"?dr(Je,at,Ke,m,U,M.numPages):m:re(Mt);ee(jt)}})},[M.loadingTask.docId]),me.length===0?e.createElement("div",{className:"rpv-core__page-size-calculator","data-testid":"core__page-size-calculating",ref:Q},e.createElement(X,null)):F(me,V)},ue=function(){function i(){}return i}(),Ce;(function(i){i[i.REQUIRE_PASSWORD=0]="REQUIRE_PASSWORD",i[i.WRONG_PASSWORD=1]="WRONG_PASSWORD"})(Ce||(Ce={}));var we=function(i){E(m,i);function m(M,F){var O=i.call(this)||this;return O.verifyPassword=M,O.submitPassword=F,O}return m}(ue),Oe=function(i){var m=i.submitPassword,M=i.verifyPassword,F=i.onDocumentAskPassword,O=e.useContext(oe).l10n,U=e.useState(""),Q=U[0],ae=U[1],V=e.useContext(S).direction,ee=V===t.TextDirection.RightToLeft,Re=function(){return M(Q)},me=function(Pe){Pe.key==="Enter"&&Re()};return e.useEffect(function(){F&&F({verifyPassword:M})},[]),e.createElement("div",{className:"rpv-core__asking-password-wrapper"},e.createElement("div",{className:A({"rpv-core__asking-password":!0,"rpv-core__asking-password--rtl":ee})},e.createElement("div",{className:"rpv-core__asking-password-message"},m===Ce.REQUIRE_PASSWORD&&O.core.askingPassword.requirePasswordToOpen,m===Ce.WRONG_PASSWORD&&O.core.wrongPassword.tryAgain),e.createElement("div",{className:"rpv-core__asking-password-body"},e.createElement("div",{className:A({"rpv-core__asking-password-input":!0,"rpv-core__asking-password-input--ltr":!ee,"rpv-core__asking-password-input--rtl":ee})},e.createElement(D,{testId:"core__asking-password-input",type:"password",value:Q,onChange:ae,onKeyDown:me})),e.createElement(d,{onClick:Re},O.core.askingPassword.submit))))},Ue=function(i){E(m,i);function m(M){var F=i.call(this)||this;return F.doc=M,F}return m}(ue),Xe=function(i){E(m,i);function m(M){var F=i.call(this)||this;return F.error=M,F}return m}(ue),Fe=function(i){E(m,i);function m(M){var F=i.call(this)||this;return F.percentages=M,F}return m}(ue),it=function(i){var m=i.characterMap,M=i.file,F=i.httpHeaders,O=i.render,U=i.renderError,Q=i.renderLoader,ae=i.transformGetDocumentParams,V=i.withCredentials,ee=i.onDocumentAskPassword,Re=e.useContext(S).direction,me=Re===t.TextDirection.RightToLeft,Pe=e.useState(new Fe(0)),$e=Pe[0],He=Pe[1],ke=e.useState(0);ke[0],ke[1];var Ke=e.useRef(""),at=e.useState(null);at[0],at[1];var Je=se();return e.useEffect(function(){Ke.current="",He(new Fe(0));var tt=new p.PDFWorker({name:"PDFWorker_".concat(Date.now())}),dt=Object.assign({httpHeaders:F,withCredentials:V,worker:tt},typeof M=="string"?{url:M}:{data:M},m?{cMapUrl:m.url,cMapPacked:m.isCompressed}:{}),Mt=ae?ae(dt):dt,jt=p.getDocument(Mt);return jt.onPassword=function(mt,Zt){switch(Zt){case p.PasswordResponses.NEED_PASSWORD:Je.current&&He(new we(mt,Ce.REQUIRE_PASSWORD));break;case p.PasswordResponses.INCORRECT_PASSWORD:Je.current&&He(new we(mt,Ce.WRONG_PASSWORD));break}},jt.onProgress=function(mt){var Zt=mt.total>0?Math.min(100,100*mt.loaded/mt.total):100;Je.current&&Ke.current===""&&He(new Fe(Zt))},jt.promise.then(function(mt){Ke.current=mt.loadingTask.docId,Je.current&&He(new Ue(mt))},function(mt){return Je.current&&!tt.destroyed&&He(new Xe({message:mt.message||"Cannot load document",name:mt.name}))}),function(){jt.destroy(),tt.destroy()}},[M]),$e instanceof we?e.createElement(Oe,{submitPassword:$e.submitPassword,verifyPassword:$e.verifyPassword,onDocumentAskPassword:ee}):$e instanceof Ue?O($e.doc):$e instanceof Xe?U?U($e.error):e.createElement("div",{className:A({"rpv-core__doc-error":!0,"rpv-core__doc-error--rtl":me})},e.createElement("div",{className:"rpv-core__doc-error-text"},$e.error.message)):e.createElement("div",{"data-testid":"core__doc-loading",className:A({"rpv-core__doc-loading":!0,"rpv-core__doc-loading--rtl":me})},Q?Q($e.percentages):e.createElement(X,null))},ft=function(){return typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches},lt=function(i,m){var M=e.useMemo(function(){return i==="auto"?ft()?"dark":"light":i},[]),F=e.useState(M),O=F[0],U=F[1],Q=We(O);return e.useEffect(function(){if(i==="auto"){var ae=window.matchMedia("(prefers-color-scheme: dark)"),V=function(ee){U(ee.matches?"dark":"light")};return ae.addEventListener("change",V),function(){return ae.removeEventListener("change",V)}}},[]),e.useEffect(function(){O!==Q&&m&&m(O)},[O]),e.useEffect(function(){i!==O&&U(i)},[i]),{currentTheme:O,setCurrentTheme:U}},vt=function(i,m){var M=typeof i,F=typeof m;return M==="string"&&F==="string"&&i===m?!0:M==="object"&&F==="object"?i.length===m.length&&i.every(function(O,U){return O===m[U]}):!1},Lt=function(i){var m=i.characterMap,M=i.defaultScale,F=i.fileUrl,O=i.httpHeaders,U=O===void 0?{}:O,Q=i.initialPage,ae=Q===void 0?0:Q,V=i.pageLayout,ee=i.initialRotation,Re=ee===void 0?0:ee,me=i.localization,Pe=i.plugins,$e=Pe===void 0?[]:Pe,He=i.renderError,ke=i.renderPage,Ke=i.renderLoader,at=i.scrollMode,Je=at===void 0?t.ScrollMode.Vertical:at,tt=i.transformGetDocumentParams,dt=i.theme,Mt=dt===void 0?{direction:t.TextDirection.LeftToRight,theme:"light"}:dt,jt=i.viewMode,mt=jt===void 0?t.ViewMode.SinglePage:jt,Zt=i.withCredentials,mn=Zt===void 0?!1:Zt,At=i.onDocumentAskPassword,hn=i.onDocumentLoad,ln=hn===void 0?function(){}:hn,_n=i.onPageChange,fn=_n===void 0?function(){}:_n,cn=i.onRotate,Dt=cn===void 0?function(){}:cn,un=i.onRotatePage,Ut=un===void 0?function(){}:un,qt=i.onSwitchTheme,$n=qt===void 0?function(){}:qt,En=i.onZoom,Mn=En===void 0?function(){}:En,Sn=e.useState({data:F,name:typeof F=="string"?F:"",shouldLoad:!1}),Gt=Sn[0],wn=Sn[1],zt=function(Cn,Ht){wn({data:Ht,name:Cn,shouldLoad:!0})},xn=e.useState(!1),jn=xn[0],Dn=xn[1],pt=We(Gt);e.useEffect(function(){vt(pt.data,F)||wn({data:F,name:typeof F=="string"?F:"",shouldLoad:jn})},[F,jn]);var Jt=function(Cn){Dn(Cn.isVisible),Cn.isVisible&&wn(function(Ht){return Object.assign({},Ht,{shouldLoad:!0})})},Kt=h({onVisibilityChanged:Jt}),on=typeof Mt=="string"?{direction:t.TextDirection.LeftToRight,theme:Mt}:Mt,Nt=e.useState(me||_e),xt=Nt[0],en=Nt[1],Rn={l10n:xt,setL10n:en},er=Object.assign({},{direction:on.direction},lt(on.theme||"light",$n));return e.useEffect(function(){me&&en(me)},[me]),e.createElement(oe.Provider,{value:Rn},e.createElement(S.Provider,{value:er},e.createElement("div",{ref:Kt,className:"rpv-core__viewer rpv-core__viewer--".concat(er.currentTheme),"data-testid":"core__viewer",style:{height:"100%",width:"100%"}},Gt.shouldLoad&&e.createElement(it,{characterMap:m,file:Gt.data,httpHeaders:U,render:function(Cn){return e.createElement(ne,{defaultScale:M,doc:Cn,render:function(Ht,et){return e.createElement(W,{currentFile:{data:Gt.data,name:Gt.name},defaultScale:M,doc:Cn,initialPage:ae,initialRotation:Re,initialScale:et,pageLayout:V,pageSizes:Ht,plugins:$e,renderPage:ke,scrollMode:Je,viewMode:mt,viewerState:{file:Gt,pageIndex:-1,pageHeight:Ht[0].pageHeight,pageWidth:Ht[0].pageWidth,pagesRotation:new Map,rotation:Re,scale:et,scrollMode:Je,viewMode:mt},onDocumentLoad:ln,onOpenFile:zt,onPageChange:fn,onRotate:Dt,onRotatePage:Ut,onZoom:Mn})},scrollMode:Je,viewMode:mt})},renderError:He,renderLoader:Ke,transformGetDocumentParams:tt,withCredentials:mn,onDocumentAskPassword:At}))))},Ft=function(i){var m=i.children,M=i.workerUrl;return p.GlobalWorkerOptions.workerSrc=M,e.createElement(e.Fragment,null,m)};t.Button=y,t.Icon=f,t.LazyRender=l,t.LocalizationContext=oe,t.Menu=o,t.MenuDivider=s,t.MenuItem=v,t.MinimalButton=c,t.Modal=he,t.Popover=ze,t.PrimaryButton=d,t.ProgressBar=x,t.Separator=L,t.Spinner=X,t.Splitter=N,t.TextBox=D,t.ThemeContext=S,t.Tooltip=I,t.Viewer=Lt,t.Worker=Ft,t.classNames=A,t.createStore=G,t.getDestination=ce,t.getPage=Ye,t.isMac=z,t.useIntersectionObserver=h,t.useIsMounted=se,t.useIsomorphicLayoutEffect=_,t.useRenderQueue=le})(core$h);/** * A React component to view a PDF document * * @see https://react-pdf-viewer.dev * @license https://react-pdf-viewer.dev/license * @copyright 2019-2022 Nguyen Huu Phuoc <me@phuoc.ng> */lib$g.exports=core$h;var libExports$h=lib$g.exports,lib$f={exports:{}},attachment$2={},core$g=libExports$h,React$f=reactExports;function _interopNamespaceDefault$f(t){var n=Object.create(null);return t&&Object.keys(t).forEach(function(a){if(a!=="default"){var r=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(n,a,r.get?r:{enumerable:!0,get:function(){return t[a]}})}}),n.default=t,Object.freeze(n)}var React__namespace$f=_interopNamespaceDefault$f(React$f),getFileName$2=function(t){var n=t.split("/").pop();return n?n.split("#")[0].split("?")[0]:t},downloadFile$1=function(t,n){var a=typeof n=="string"?"":URL.createObjectURL(new Blob([n],{type:""})),r=document.createElement("a");r.style.display="none",r.href=a||t,r.setAttribute("download",getFileName$2(t)),document.body.appendChild(r),r.click(),document.body.removeChild(r),a&&URL.revokeObjectURL(a)},AttachmentList=function(t){var n=t.files,a=React__namespace$f.useRef(),r=React__namespace$f.useContext(core$g.LocalizationContext).l10n,e=React__namespace$f.useContext(core$g.ThemeContext).direction,p=e===core$g.TextDirection.RightToLeft,k=React__namespace$f.useRef([]),E=r&&r.attachment?r.attachment.clickToDownload:"Click to download",b=function(S){switch(S.key){case"ArrowDown":S.preventDefault(),R(function(A,y){return A.indexOf(y)+1});break;case"ArrowUp":S.preventDefault(),R(function(A,y){return A.indexOf(y)-1});break;case"End":S.preventDefault(),R(function(A,y){return A.length-1});break;case"Home":S.preventDefault(),R(function(A,y){return 0});break}},R=function(S){var A=a.current,y=[].slice.call(A.getElementsByClassName("rpv-attachment__item"));if(y.length!==0){y.forEach(function(o){return o.setAttribute("tabindex","-1")});var _=document.activeElement,h=Math.min(y.length-1,Math.max(0,S(y,_))),l=y[h];l.setAttribute("tabindex","0"),l.focus()}};return core$g.useIsomorphicLayoutEffect(function(){var S=a.current;if(S){var A=[].slice.call(S.getElementsByClassName("rpv-attachment__item"));if(k.current=A,A.length>0){var y=A[0];y.focus(),y.setAttribute("tabindex","0")}}},[]),React__namespace$f.createElement("div",{"data-testid":"attachment__list",className:core$g.classNames({"rpv-attachment__list":!0,"rpv-attachment__list--rtl":p}),ref:a,tabIndex:-1,onKeyDown:b},n.map(function(S){return React__namespace$f.createElement("button",{className:"rpv-attachment__item",key:S.fileName,tabIndex:-1,title:E,type:"button",onClick:function(){return downloadFile$1(S.fileName,S.data)}},S.fileName)}))},AttachmentLoader=function(t){var n=t.doc,a=React__namespace$f.useContext(core$g.LocalizationContext).l10n,r=React__namespace$f.useContext(core$g.ThemeContext).direction,e=r===core$g.TextDirection.RightToLeft,p=a&&a.attachment?a.attachment.noAttachment:"There is no attachment",k=React__namespace$f.useState({files:[],isLoaded:!1}),E=k[0],b=k[1];return React__namespace$f.useEffect(function(){n.getAttachments().then(function(R){var S=R?Object.keys(R).map(function(A){return{data:R[A].content,fileName:R[A].filename}}):[];b({files:S,isLoaded:!0})})},[n]),E.isLoaded?E.files.length===0?React__namespace$f.createElement("div",{"data-testid":"attachment__empty",className:core$g.classNames({"rpv-attachment__empty":!0,"rpv-attachment__empty--rtl":e})},p):React__namespace$f.createElement(AttachmentList,{files:E.files}):React__namespace$f.createElement(core$g.Spinner,null)},AttachmentListWithStore=function(t){var n=t.store,a=React__namespace$f.useState(n.get("doc")),r=a[0],e=a[1],p=function(k){e(k)};return React__namespace$f.useEffect(function(){return n.subscribe("doc",p),function(){n.unsubscribe("doc",p)}},[]),r?React__namespace$f.createElement(AttachmentLoader,{doc:r}):React__namespace$f.createElement("div",{className:"rpv-attachment__loader"},React__namespace$f.createElement(core$g.Spinner,null))},attachmentPlugin=function(){var t=React__namespace$f.useMemo(function(){return core$g.createStore({})},[]),n=function(){return React__namespace$f.createElement(AttachmentListWithStore,{store:t})};return{onDocumentLoad:function(a){t.update("doc",a.doc)},Attachments:n}};attachment$2.attachmentPlugin=attachmentPlugin;/** * A React component to view a PDF document * * @see https://react-pdf-viewer.dev * @license https://react-pdf-viewer.dev/license * @copyright 2019-2022 Nguyen Huu Phuoc <me@phuoc.ng> */lib$f.exports=attachment$2;var libExports$g=lib$f.exports,lib$e={exports:{}},bookmark$2={},core$f=libExports$h,React$e=reactExports;function _interopNamespaceDefault$e(t){var n=Object.create(null);return t&&Object.keys(t).forEach(function(a){if(a!=="default"){var r=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(n,a,r.get?r:{enumerable:!0,get:function(){return t[a]}})}}),n.default=t,Object.freeze(n)}var React__namespace$e=_interopNamespaceDefault$e(React$e),DownArrowIcon$1=function(){return React__namespace$e.createElement(core$f.Icon,{size:16},React__namespace$e.createElement("path",{d:"M6.427,8.245A.5.5,0,0,1,6.862,7.5H17.138a.5.5,0,0,1,.435.749l-5.139,9a.5.5,0,0,1-.868,0Z"}))},RightArrowIcon=function(){return React__namespace$e.createElement(core$f.Icon,{size:16},React__namespace$e.createElement("path",{d:"M9.248,17.572a.5.5,0,0,1-.748-.434V6.862a.5.5,0,0,1,.748-.434l8.992,5.138a.5.5,0,0,1,0,.868Z"}))},shouldBeCollapsed=function(t){var n=t.count,a=t.items;if(n>=0)return!1;var r=a.length;if(r===0)return!1;for(var e=a.concat([]);e.length>0;){var p=e.shift(),k=p.items;p.count&&k&&p.count>0&&k.length>0&&(r+=k.length,e=e.concat(k))}return Math.abs(n)===r},BookmarkItem=function(t){var n=t.bookmark,a=t.depth,r=t.doc,e=t.index,p=t.isBookmarkExpanded,k=t.numberOfSiblings,E=t.pathFromRoot,b=t.renderBookmarkItem,R=t.store,S=t.onJumpToDest,A=E?"".concat(E,".").concat(e):"".concat(e),y=React__namespace$e.useMemo(function(){return shouldBeCollapsed(n)},[n]),_=R.get("bookmarkExpandedMap"),h=p?p({bookmark:n,doc:r,depth:a,index:e}):_.has(A)?_.get(A):!y,l=React__namespace$e.useState(h),o=l[0],s=l[1],f=n.items&&n.items.length>0,g=function(){var X=!o;R.updateCurrentValue("bookmarkExpandedMap",function(N){return N.set(A,X)}),s(X)},v=function(){f&&n.dest&&S(n.dest)},c=function(){!f&&n.dest&&S(n.dest)},d=function(X,N){return React__namespace$e.createElement("div",{className:"rpv-bookmark__item",style:{paddingLeft:"".concat(a*1.25,"rem")},onClick:X},N)},x=function(X,N){return f?React__namespace$e.createElement("span",{className:"rpv-bookmark__toggle","data-testid":"bookmark__toggle-".concat(a,"-").concat(e),onClick:g},o?X:N):React__namespace$e.createElement("span",{className:"rpv-bookmark__toggle"})},L=function(X){return n.url?React__namespace$e.createElement("a",{className:"rpv-bookmark__title",href:n.url,rel:"noopener noreferrer nofollow",target:n.newWindow?"_blank":""},n.title):React__namespace$e.createElement("div",{className:"rpv-bookmark__title","aria-label":n.title,onClick:X},n.title)};return React__namespace$e.createElement("li",{"aria-expanded":o?"true":"false","aria-label":n.title,"aria-level":a+1,"aria-posinset":e+1,"aria-setsize":k,role:"treeitem",tabIndex:-1},b?b({bookmark:n,depth:a,hasSubItems:f,index:e,isExpanded:o,path:A,defaultRenderItem:d,defaultRenderTitle:L,defaultRenderToggle:x,onClickItem:c,onClickTitle:v,onToggleSubItems:g}):d(c,React__namespace$e.createElement(React__namespace$e.Fragment,null,x(React__namespace$e.createElement(DownArrowIcon$1,null),React__namespace$e.createElement(RightArrowIcon,null)),L(v))),f&&o&&React__namespace$e.createElement(BookmarkList,{bookmarks:n.items,depth:a+1,doc:r,isBookmarkExpanded:p,isRoot:!1,pathFromRoot:A,renderBookmarkItem:b,store:R,onJumpToDest:S}))},BookmarkList=function(t){var n=t.bookmarks,a=t.depth,r=a===void 0?0:a,e=t.doc,p=t.isBookmarkExpanded,k=t.isRoot,E=t.pathFromRoot,b=t.renderBookmarkItem,R=t.store,S=t.onJumpToDest;return React__namespace$e.createElement("ul",{className:"rpv-bookmark__list",role:k?"tree":"group",tabIndex:-1},n.map(function(A,y){return React__namespace$e.createElement(BookmarkItem,{bookmark:A,depth:r,doc:e,index:y,isBookmarkExpanded:p,key:y,numberOfSiblings:n.length,pathFromRoot:E,renderBookmarkItem:b,store:R,onJumpToDest:S})}))},Toggle;(function(t){t[t.Collapse=0]="Collapse",t[t.Expand=1]="Expand"})(Toggle||(Toggle={}));var BookmarkListRoot=function(t){var n=t.bookmarks,a=t.doc,r=t.isBookmarkExpanded,e=t.renderBookmarkItem,p=t.store,k=t.onJumpToDest,E=React__namespace$e.useRef(),b=function(_){core$f.getDestination(a,_).then(function(h){var l=h.pageIndex,o=h.bottomOffset,s=h.leftOffset,f=h.scaleTo;k(l,o,s,f)})},R=function(_){var h=E.current;if(!(!h||!(_.target instanceof HTMLElement)||!h.contains(_.target)))switch(_.key){case"ArrowDown":_.preventDefault(),A(function(l,o){return l.indexOf(o)+1});break;case"ArrowLeft":_.preventDefault(),y(Toggle.Collapse);break;case"ArrowRight":_.preventDefault(),y(Toggle.Expand);break;case"ArrowUp":_.preventDefault,A(function(l,o){return l.indexOf(o)-1});break;case"End":_.preventDefault(),A(function(l,o){return l.length-1});break;case" ":case"Enter":case"Space":_.preventDefault(),S();break;case"Home":_.preventDefault(),A(function(l,o){return 0});break}},S=function(){var _=document.activeElement.closest(".rpv-bookmark__item"),h=_.querySelector(".rpv-bookmark__title");h&&h.click()},A=function(_){var h=E.current,l=[].slice.call(h.getElementsByClassName("rpv-bookmark__item"));if(l.length!==0){var o=document.activeElement,s=Math.min(l.length-1,Math.max(0,_(l,o))),f=l[s];o.setAttribute("tabindex","-1"),f.setAttribute("tabindex","0"),f.focus()}},y=function(_){var h=E.current,l=[].slice.call(h.getElementsByClassName("rpv-bookmark__item"));if(l.length!==0){var o=document.activeElement.closest(".rpv-bookmark__item"),s=_===Toggle.Collapse?"true":"false";if(o&&o.parentElement.getAttribute("aria-expanded")===s){var f=o.querySelector(".rpv-bookmark__toggle");f&&f.click()}}};return React__namespace$e.useEffect(function(){return document.addEventListener("keydown",R),function(){document.removeEventListener("keydown",R)}},[]),React__namespace$e.useEffect(function(){var _=E.current;if(_){var h=[].slice.call(_.getElementsByClassName("rpv-bookmark__item"));h.length>0&&(h[0].focus(),h[0].setAttribute("tabindex","0"))}},[]),React__namespace$e.createElement("div",{ref:E},React__namespace$e.createElement(BookmarkList,{bookmarks:n,depth:0,doc:a,isBookmarkExpanded:r,isRoot:!0,pathFromRoot:"",renderBookmarkItem:e,store:p,onJumpToDest:b}))},BookmarkLoader=function(t){var n=t.doc,a=t.isBookmarkExpanded,r=t.renderBookmarkItem,e=t.store,p=t.onJumpToDest,k=React__namespace$e.useContext(core$f.LocalizationContext).l10n,E=React__namespace$e.useContext(core$f.ThemeContext).direction,b=E===core$f.TextDirection.RightToLeft,R=React__namespace$e.useState({isLoaded:!1,items:[]}),S=R[0],A=R[1];return React__namespace$e.useEffect(function(){A({isLoaded:!1,items:[]}),n.getOutline().then(function(y){A({isLoaded:!0,items:y||[]})})},[n]),S.isLoaded?S.items.length===0?React__namespace$e.createElement("div",{"data-testid":"bookmark__empty",className:core$f.classNames({"rpv-bookmark__empty":!0,"rpv-bookmark__empty--rtl":b})},k&&k.bookmark?k.bookmark.noBookmark:"There is no bookmark"):React__namespace$e.createElement("div",{"data-testid":"bookmark__container",className:core$f.classNames({"rpv-bookmark__container":!0,"rpv-bookmark__container--rtl":b})},React__namespace$e.createElement(BookmarkListRoot,{bookmarks:S.items,doc:n,isBookmarkExpanded:a,renderBookmarkItem:r,store:e,onJumpToDest:p})):React__namespace$e.createElement("div",{className:"rpv-bookmark__loader"},React__namespace$e.createElement(core$f.Spinner,null))},BookmarkListWithStore=function(t){var n=t.isBookmarkExpanded,a=t.renderBookmarkItem,r=t.store,e=React__namespace$e.useState(r.get("doc")),p=e[0],k=e[1],E=function(R){k(R)},b=function(R,S,A,y){var _=r.get("jumpToDestination");_&&_(R,S,A,y)};return React__namespace$e.useEffect(function(){return r.subscribe("doc",E),function(){r.unsubscribe("doc",E)}},[]),p?React__namespace$e.createElement(BookmarkLoader,{doc:p,isBookmarkExpanded:n,renderBookmarkItem:a,store:r,onJumpToDest:b}):React__namespace$e.createElement("div",{className:"rpv-bookmark__loader"},React__namespace$e.createElement(core$f.Spinner,null))},bookmarkPlugin=function(){var t=React__namespace$e.useMemo(function(){return core$f.createStore({bookmarkExpandedMap:new Map})},[]),n=function(a){return React__namespace$e.createElement(BookmarkListWithStore,{isBookmarkExpanded:a==null?void 0:a.isBookmarkExpanded,renderBookmarkItem:a==null?void 0:a.renderBookmarkItem,store:t})};return{install:function(a){t.update("jumpToDestination",a.jumpToDestination)},onDocumentLoad:function(a){t.update("doc",a.doc)},Bookmarks:n}};bookmark$2.DownArrowIcon=DownArrowIcon$1;bookmark$2.RightArrowIcon=RightArrowIcon;bookmark$2.bookmarkPlugin=bookmarkPlugin;/** * A React component to view a PDF document * * @see https://react-pdf-viewer.dev * @license https://react-pdf-viewer.dev/license * @copyright 2019-2022 Nguyen Huu Phuoc <me@phuoc.ng> */lib$e.exports=bookmark$2;var libExports$f=lib$e.exports,lib$d={exports:{}},thumbnail$1={},core$e=libExports$h,React$d=reactExports;function _interopNamespaceDefault$d(t){var n=Object.create(null);return t&&Object.keys(t).forEach(function(a){if(a!=="default"){var r=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(n,a,r.get?r:{enumerable:!0,get:function(){return t[a]}})}}),n.default=t,Object.freeze(n)}var React__namespace$d=_interopNamespaceDefault$d(React$d),__assign$d=function(){return __assign$d=Object.assign||function(n){for(var a,r=1,e=arguments.length;r<e;r++){a=arguments[r];for(var p in a)Object.prototype.hasOwnProperty.call(a,p)&&(n[p]=a[p])}return n},__assign$d.apply(this,arguments)},CoverInner=function(t){var n=t.doc,a=t.getPageIndex,r=t.renderSpinner,e=t.store,p=n.numPages,k=a?a({numPages:p}):0,E=Math.max(0,Math.min(k,p-1)),b=e.get("pagesRotation")||new Map,R=b.has(E)?b.get(E):0,S=React__namespace$d.useState(""),A=S[0],y=S[1],_=core$e.useIsMounted(),h=React__namespace$d.useRef(),l=React__namespace$d.useState(e.get("rotation")||0),o=l[0],s=l[1],f=React__namespace$d.useState(R),g=f[0],v=f[1],c=React__namespace$d.useState(!1),d=c[0],x=c[1],L=function(se){var Ae=se.has(E)?se.get(E):0;v(Ae)},X=function(se){s(se)},N=function(se){x(se.isVisible)},D=core$e.useIntersectionObserver({onVisibilityChanged:N});return React__namespace$d.useEffect(function(){if(d){var se=D.current;se&&(y(""),core$e.getPage(n,E).then(function(Ae){var Te=Ae.getViewport({scale:1}),le=Te.rotation,ie=(le+o+g)%360,fe=Math.abs(o+g)%180===0,_e=fe?Te.width:Te.height,oe=fe?Te.height:Te.width,Me=document.createElement("canvas"),xe=Me.getContext("2d",{alpha:!1}),K=se.clientWidth,T=se.clientHeight,P=Math.min(K/_e,T/oe),$=P*_e,Y=P*oe;Me.height=Y,Me.width=$,Me.style.opacity="0";var J=Ae.getViewport({rotation:ie,scale:P});h.current=Ae.render({canvasContext:xe,viewport:J}),h.current.promise.then(function(){_.current&&y(Me.toDataURL()),Me.width=0,Me.height=0},function(){})}))}},[g,d]),React__namespace$d.useEffect(function(){return e.subscribe("pagesRotation",L),e.subscribe("rotation",X),function(){e.unsubscribe("pagesRotation",L),e.unsubscribe("rotation",X)}},[]),React__namespace$d.useEffect(function(){return function(){var se;(se=h.current)===null||se===void 0||se.cancel()}},[]),React__namespace$d.createElement("div",{ref:D,className:"rpv-thumbnail__cover-inner","data-testid":"thumbnail__cover-inner"},A?React__namespace$d.createElement("img",{className:"rpv-thumbnail__cover-image","data-testid":"thumbnail__cover-image",src:A}):React__namespace$d.createElement("div",{className:"rpv-thumbnail__cover-loader","data-testid":"thumbnail__cover-loader"},r?r():React__namespace$d.createElement(core$e.Spinner,null)))},Cover=function(t){var n=t.getPageIndex,a=t.renderSpinner,r=t.store,e=React__namespace$d.useState(r.get("doc")),p=e[0],k=e[1],E=function(b){k(b)};return React__namespace$d.useEffect(function(){return r.subscribe("doc",E),function(){r.unsubscribe("doc",E)}},[]),React__namespace$d.createElement("div",{className:"rpv-thumbnail__cover"},p?React__namespace$d.createElement(CoverInner,{doc:p,getPageIndex:n,renderSpinner:a,store:r}):React__namespace$d.createElement("div",{className:"rpv-thumbnail__cover-loader"},a?a():React__namespace$d.createElement(core$e.Spinner,null)))},defaultSpinner=function(){return React__namespace$d.createElement(core$e.Spinner,null)},SpinnerContext=React__namespace$d.createContext({renderSpinner:defaultSpinner}),FetchLabels$1=function(t){var n=t.children,a=t.doc,r=core$e.useIsMounted(),e=React__namespace$d.useState({loading:!0,labels:[]}),p=e[0],k=e[1];return React__namespace$d.useEffect(function(){a.getPageLabels().then(function(E){r.current&&k({loading:!1,labels:E||[]})})},[a.loadingTask.docId]),p.loading?React__namespace$d.createElement(React__namespace$d.Fragment,null):n(p.labels)},scrollToBeVisible=function(t,n){var a=t.getBoundingClientRect().top-n.getBoundingClientRect().top,r=t.clientHeight,e=n.clientHeight;if(a<0){n.scrollTop+=a;return}a+r<=e||(n.scrollTop+=a+r-e)},ThumbnailItem=function(t){var n=t.page,a=t.pageHeight,r=t.pageIndex,e=t.pageWidth,p=t.rotation,k=t.thumbnailHeight,E=t.thumbnailWidth,b=t.onRenderCompleted,R=React__namespace$d.useContext(core$e.LocalizationContext).l10n,S=React__namespace$d.useRef(),A=React__namespace$d.useState(""),y=A[0],_=A[1],h=R&&R.thumbnail?R.thumbnail.thumbnailLabel:"Thumbnail of page {{pageIndex}}";return React__namespace$d.useEffect(function(){var l=S.current;l&&l.cancel();var o=document.createElement("canvas"),s=o.getContext("2d",{alpha:!1}),f=E,g=f/(e/a),v=f/e;o.height=g,o.width=f,o.style.height="".concat(g,"px"),o.style.width="".concat(f,"px");var c=n.getViewport({rotation:p,scale:v});return S.current=n.render({canvasContext:s,viewport:c}),S.current.promise.then(function(){_(o.toDataURL()),b(r)},function(){b(r)}),function(){var d;(d=S.current)===null||d===void 0||d.cancel()}},[p]),y?React__namespace$d.createElement("img",{"aria-label":h.replace("{{pageIndex}}","".concat(r+1)),src:y,height:"".concat(k,"px"),width:"".concat(E,"px")}):React__namespace$d.useContext(SpinnerContext).renderSpinner()},ThumbnailContainer=function(t){var n=t.doc,a=t.pageHeight,r=t.pageIndex,e=t.pageRotation,p=t.pageWidth,k=t.rotation,E=t.shouldRender,b=t.thumbnailWidth,R=t.onRenderCompleted,S=t.onVisibilityChanged,A=core$e.useIsMounted(),y=React__namespace$d.useState({height:a,page:null,viewportRotation:0,width:p}),_=y[0],h=y[1],l=_.page,o=_.height,s=_.width,f=s/o,g=Math.abs(k+e)%180===0,v=g?b:b/f,c=g?b/f:b;React__namespace$d.useEffect(function(){E&&core$e.getPage(n,r).then(function(L){var X=L.getViewport({scale:1});A.current&&h({height:X.height,page:L,viewportRotation:X.rotation,width:X.width})})},[E]);var d=(_.viewportRotation+k+e)%360,x=core$e.useIntersectionObserver({onVisibilityChanged:function(L){S(r,L)}});return React__namespace$d.createElement("div",{className:"rpv-thumbnail__container","data-testid":"thumbnail__container-".concat(r),ref:x,style:{height:"".concat(c,"px"),width:"".concat(v,"px")}},l?React__namespace$d.createElement(ThumbnailItem,{page:l,pageHeight:g?o:s,pageIndex:r,pageWidth:g?s:o,rotation:d,thumbnailHeight:c,thumbnailWidth:v,onRenderCompleted:R}):React__namespace$d.useContext(SpinnerContext).renderSpinner())},ThumbnailList=function(t){var n=t.currentPage,a=t.doc,r=t.labels,e=t.pagesRotation,p=t.pageHeight,k=t.pageWidth,E=t.renderCurrentPageLabel,b=t.renderThumbnailItem,R=t.rotatedPage,S=t.rotation,A=t.thumbnailWidth,y=t.onJumpToPage,_=t.onRotatePage,h=a.numPages,l=a.loadingTask.docId,o=React__namespace$d.useRef(null),s=React__namespace$d.useRef([]),f=React__namespace$d.useState(n),g=f[0],v=f[1],c=React__namespace$d.useContext(core$e.ThemeContext).direction,d=c===core$e.TextDirection.RightToLeft,x=React__namespace$d.useState(-1),L=x[0],X=x[1],N=core$e.useIsMounted(),D=React__namespace$d.useRef(!1),se=core$e.useRenderQueue({doc:a}),Ae=React__namespace$d.useMemo(function(){return Array(h).fill(0).map(function(xe,K){return K})},[l]),Te=function(xe){switch(xe.key){case"ArrowDown":le();break;case"ArrowUp":ie();break;case"Enter":fe();break}},le=function(){var xe=o.current;if(xe){var K=s.current,T=g+1;T<K.length&&(g>=0&&K[g].setAttribute("tabindex","-1"),v(T))}},ie=function(){var xe=o.current;if(xe){var K=s.current,T=g-1;T>=0&&(g>=0&&K[g].setAttribute("tabindex","-1"),v(T))}},fe=function(){g>=0&&g<h&&y(g)};core$e.useIsomorphicLayoutEffect(function(){var xe=o.current;xe&&(s.current=Array.from(xe.querySelectorAll(".rpv-thumbnail__item")))},[]),React__namespace$d.useEffect(function(){var xe=s.current;if(!(xe.length===0||g<0||g>xe.length)){var K=xe[g];K.setAttribute("tabindex","0"),K.focus()}},[g]),core$e.useIsomorphicLayoutEffect(function(){var xe=o.current;if(xe){var K=xe.children;n<K.length&&scrollToBeVisible(K.item(n),xe)}},[n]);var _e=React__namespace$d.useCallback(function(xe){N.current&&(se.markRendered(xe),D.current=!1,Me())},[l]),oe=React__namespace$d.useCallback(function(xe,K){K.isVisible?se.setVisibility(xe,K.ratio):se.setOutOfRange(xe),Me()},[l]),Me=React__namespace$d.useCallback(function(){if(!D.current){var xe=se.getHighestPriorityPage();xe>-1&&(se.markRendering(xe),D.current=!0,X(xe))}},[l]);return React__namespace$d.useEffect(function(){R>=0&&(se.markRendering(R),D.current=!0,X(R))},[l,R]),React__namespace$d.createElement("div",{ref:o,"data-testid":"thumbnail__list",className:core$e.classNames({"rpv-thumbnail__list":!0,"rpv-thumbnail__list--rtl":d}),onKeyDown:Te},Ae.map(function(xe){var K="".concat(a.loadingTask.docId,"___").concat(xe),T=r.length===h?r[xe]:"".concat(xe+1),P=E?E({currentPage:n,pageIndex:xe,numPages:h,pageLabel:T}):T,$=e.has(xe)?e.get(xe):0,Y=React__namespace$d.createElement(ThumbnailContainer,{doc:a,pageHeight:p,pageIndex:xe,pageRotation:$,pageWidth:k,rotation:S,shouldRender:L===xe,thumbnailWidth:A,onRenderCompleted:_e,onVisibilityChanged:oe});return b?b({currentPage:n,key:K,numPages:h,pageIndex:xe,renderPageLabel:React__namespace$d.createElement(React__namespace$d.Fragment,null,P),renderPageThumbnail:Y,onJumpToPage:function(){return y(xe)},onRotatePage:function(J){return _(xe,J)}}):React__namespace$d.createElement("div",{key:K},React__namespace$d.createElement("div",{className:core$e.classNames({"rpv-thumbnail__item":!0,"rpv-thumbnail__item--selected":n===xe}),role:"button",tabIndex:n===xe?0:-1,onClick:function(){return y(xe)}},Y),React__namespace$d.createElement("div",{"data-testid":"thumbnail__label-".concat(xe),className:"rpv-thumbnail__label"},P))}))},ThumbnailListWithStore=function(t){var n=t.renderCurrentPageLabel,a=t.renderThumbnailItem,r=t.store,e=t.thumbnailWidth,p=React__namespace$d.useState(r.get("doc")),k=p[0],E=p[1],b=React__namespace$d.useState(r.get("currentPage")||0),R=b[0],S=b[1],A=React__namespace$d.useState(r.get("pageHeight")||0),y=A[0],_=A[1],h=React__namespace$d.useState(r.get("pageWidth")||0),l=h[0],o=h[1],s=React__namespace$d.useState(r.get("rotation")||0),f=s[0],g=s[1],v=React__namespace$d.useState(r.get("pagesRotation")||new Map),c=v[0],d=v[1],x=React__namespace$d.useState(r.get("rotatedPage")||-1),L=x[0],X=x[1],N=function(oe){S(oe)},D=function(oe){E(oe)},se=function(oe){_(oe)},Ae=function(oe){o(oe)},Te=function(oe){g(oe)},le=function(oe){d(oe)},ie=function(oe){X(oe)},fe=function(oe){var Me=r.get("jumpToPage");Me&&Me(oe)},_e=function(oe,Me){r.get("rotatePage")(oe,Me)};return React__namespace$d.useEffect(function(){return r.subscribe("doc",D),r.subscribe("pageHeight",se),r.subscribe("pageWidth",Ae),r.subscribe("rotatedPage",ie),r.subscribe("rotation",Te),r.subscribe("pagesRotation",le),function(){r.unsubscribe("doc",D),r.unsubscribe("pageHeight",se),r.unsubscribe("pageWidth",Ae),r.unsubscribe("rotatedPage",ie),r.unsubscribe("rotation",Te),r.unsubscribe("pagesRotation",le)}},[]),core$e.useIsomorphicLayoutEffect(function(){return r.subscribe("currentPage",N),function(){r.unsubscribe("currentPage",N)}},[]),k?React__namespace$d.createElement(core$e.LazyRender,{testId:"thumbnail__list-container",attrs:{className:"rpv-thumbnail__list-container"}},React__namespace$d.createElement(FetchLabels$1,{doc:k},function(oe){return React__namespace$d.createElement(ThumbnailList,{currentPage:R,doc:k,labels:oe,pagesRotation:c,pageHeight:y,pageWidth:l,renderCurrentPageLabel:n,renderThumbnailItem:a,rotatedPage:L,rotation:f,thumbnailWidth:e,onJumpToPage:fe,onRotatePage:_e})})):React__namespace$d.createElement("div",{"data-testid":"thumbnail-list__loader",className:"rpv-thumbnail__loader"},React__namespace$d.useContext(SpinnerContext).renderSpinner())},thumbnailPlugin=function(t){var n=React__namespace$d.useMemo(function(){return core$e.createStore({rotatePage:function(){}})},[]),a=React__namespace$d.useState(""),r=a[0],e=a[1],p=function(E){return React__namespace$d.createElement(Cover,__assign$d({},E,{renderSpinner:t==null?void 0:t.renderSpinner,store:n}))},k=React__namespace$d.useCallback(function(E){return React__namespace$d.createElement(SpinnerContext.Provider,{value:{renderSpinner:(t==null?void 0:t.renderSpinner)||defaultSpinner}},React__namespace$d.createElement(ThumbnailListWithStore,{renderCurrentPageLabel:t==null?void 0:t.renderCurrentPageLabel,renderThumbnailItem:E==null?void 0:E.renderThumbnailItem,store:n,thumbnailWidth:(t==null?void 0:t.thumbnailWidth)||100}))},[r]);return{install:function(E){n.update("jumpToPage",E.jumpToPage),n.update("rotatePage",E.rotatePage)},onDocumentLoad:function(E){e(E.doc.loadingTask.docId),n.update("doc",E.doc)},onViewerStateChange:function(E){return n.update("currentPage",E.pageIndex),n.update("pagesRotation",E.pagesRotation),n.update("pageHeight",E.pageHeight),n.update("pageWidth",E.pageWidth),n.update("rotation",E.rotation),n.update("rotatedPage",E.rotatedPage),E},Cover:p,Thumbnails:k}};thumbnail$1.thumbnailPlugin=thumbnailPlugin;/** * A React component to view a PDF document * * @see https://react-pdf-viewer.dev * @license https://react-pdf-viewer.dev/license * @copyright 2019-2022 Nguyen Huu Phuoc <me@phuoc.ng> */lib$d.exports=thumbnail$1;var libExports$e=lib$d.exports,lib$c={exports:{}},toolbar$2={},lib$b={exports:{}},selectionMode$2={};(function(t){var n=libExports$h,a=reactExports;function r(l){var o=Object.create(null);return l&&Object.keys(l).forEach(function(s){if(s!=="default"){var f=Object.getOwnPropertyDescriptor(l,s);Object.defineProperty(o,s,f.get?f:{enumerable:!0,get:function(){return l[s]}})}}),o.default=l,Object.freeze(o)}var e=r(a),p=function(){return e.createElement(n.Icon,{size:16},e.createElement("path",{d:`M11.5,5.5v-2C11.5,2.672,12.172,2,13,2s1.5,0.672,1.5,1.5v2 M14.5,11.5v-6C14.5,4.672,15.172,4,16,4 c0.828,0,1.5,0.672,1.5,1.5v3 M17.5,13V8.5C17.5,7.672,18.172,7,19,7s1.5,0.672,1.5,1.5v10c0,2.761-2.239,5-5,5h-3.335 c-1.712-0.001-3.305-0.876-4.223-2.321C6.22,18.467,4.083,14,4.083,14c-0.378-0.545-0.242-1.292,0.303-1.67 c0.446-0.309,1.044-0.281,1.458,0.07L8.5,15.5v-10C8.5,4.672,9.172,4,10,4s1.5,0.672,1.5,1.5v6`}))},k=function(){return k=Object.assign||function(o){for(var s,f=1,g=arguments.length;f<g;f++){s=arguments[f];for(var v in s)Object.prototype.hasOwnProperty.call(s,v)&&(o[v]=s[v])}return o},k.apply(this,arguments)};t.SelectionMode=void 0,function(l){l.Hand="Hand",l.Text="Text"}(t.SelectionMode||(t.SelectionMode={}));var E=function(){return e.createElement(n.Icon,{size:16},e.createElement("path",{d:`M13.675,11.671l2.941-2.941c0.195-0.196,0.195-0.512-0.001-0.707C16.563,7.971,16.5,7.931,16.43,7.906 L4.168,3.527C3.908,3.434,3.622,3.57,3.529,3.83c-0.039,0.109-0.039,0.228,0,0.336l4.379,12.262 c0.093,0.26,0.379,0.396,0.639,0.303c0.07-0.025,0.133-0.065,0.185-0.117l2.943-2.943l6.146,6.146c0.195,0.195,0.512,0.195,0.707,0 l1.293-1.293c0.195-0.195,0.195-0.512,0-0.707L13.675,11.671z`}))},b=function(l){var o=l.children,s=l.mode,f=l.onClick,g=e.useContext(n.LocalizationContext).l10n,v="",c=e.createElement(E,null);switch(s){case t.SelectionMode.Hand:v=g&&g.selectionMode?g.selectionMode.handTool:"Hand tool",c=e.createElement(p,null);break;case t.SelectionMode.Text:default:v=g&&g.selectionMode?g.selectionMode.textSelectionTool:"Text selection tool",c=e.createElement(E,null);break}return o({icon:c,label:v,onClick:f})},R={left:0,top:8},S=function(l){var o=l.isSelected,s=l.mode,f=l.onClick,g="";switch(s){case t.SelectionMode.Hand:g="selection-mode__hand-button";break;case t.SelectionMode.Text:default:g="selection-mode__text-button"}return e.createElement(b,{mode:s,onClick:f},function(v){return e.createElement(n.Tooltip,{ariaControlsSuffix:"selection-mode-switch",position:n.Position.BottomCenter,target:e.createElement(n.MinimalButton,{ariaLabel:v.label,isSelected:o,testId:g,onClick:v.onClick},v.icon),content:function(){return v.label},offset:R})})},A=function(l){var o=l.children,s=l.mode,f=l.store,g=function(){return f.update("selectionMode",s)},v=s===f.get("selectionMode"),c=function(x){return e.createElement(S,{isSelected:v,mode:x.mode,onClick:x.onClick})},d=o||c;return d({isSelected:v,mode:s,onClick:g})},y=function(l){var o=l.isSelected,s=l.mode,f=l.onClick,g="";switch(s){case t.SelectionMode.Hand:g="selection-mode__hand-menu";break;case t.SelectionMode.Text:default:g="selection-mode__text-menu"}return e.createElement(b,{mode:s,onClick:f},function(v){return e.createElement(n.MenuItem,{checked:o,icon:v.icon,testId:g,onClick:v.onClick},v.label)})},_=function(l){var o=l.store,s=e.useRef(null),f=e.useState(t.SelectionMode.Text),g=f[0],v=f[1],c=e.useRef({top:0,left:0,x:0,y:0}),d=function(D){var se=s.current;se&&(se.scrollTop=c.current.top-(D.clientY-c.current.y),se.scrollLeft=c.current.left-(D.clientX-c.current.x))},x=function(){var D=s.current;D&&(D.classList.add("rpv-selection-mode__grab"),D.classList.remove("rpv-selection-mode__grabbing"),document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",x))},L=function(D){var se=s.current;!se||g===t.SelectionMode.Text||(se.classList.remove("rpv-selection-mode__grab"),se.classList.add("rpv-selection-mode__grabbing"),D.preventDefault(),D.stopPropagation(),c.current={left:se.scrollLeft,top:se.scrollTop,x:D.clientX,y:D.clientY},document.addEventListener("mousemove",d),document.addEventListener("mouseup",x))},X=function(D){s.current=D()},N=function(D){v(D)};return e.useEffect(function(){var D=s.current;if(D)return g===t.SelectionMode.Hand?D.classList.add("rpv-selection-mode__grab"):D.classList.remove("rpv-selection-mode__grab"),D.addEventListener("mousedown",L),function(){D.removeEventListener("mousedown",L)}},[g]),e.useEffect(function(){return o.subscribe("getPagesContainer",X),o.subscribe("selectionMode",N),function(){o.unsubscribe("getPagesContainer",X),o.unsubscribe("selectionMode",N)}},[]),e.createElement(e.Fragment,null)},h=function(l){var o=e.useMemo(function(){return n.createStore()},[]),s=function(c){return e.createElement(A,k({},c,{store:o}))},f=function(c){return e.createElement(s,{mode:c.mode},function(d){return e.createElement(S,{isSelected:d.isSelected,mode:d.mode,onClick:function(){d.onClick()}})})},g=function(c){return e.createElement(s,{mode:c.mode},function(d){return e.createElement(y,{isSelected:d.isSelected,mode:d.mode,onClick:function(){d.onClick(),c.onClick()}})})},v=function(c){var d=c.slot;return d.subSlot&&d.subSlot.children&&(d.subSlot.children=e.createElement(e.Fragment,null,e.createElement(_,{store:o}),d.subSlot.children)),d};return{install:function(c){o.update("selectionMode",l&&l.selectionMode?l.selectionMode:t.SelectionMode.Text),o.update("getPagesContainer",c.getPagesContainer)},renderViewer:v,SwitchSelectionMode:s,SwitchSelectionModeButton:f,SwitchSelectionModeMenuItem:g}};t.HandToolIcon=p,t.TextSelectionIcon=E,t.selectionModePlugin=h})(selectionMode$2);/** * A React component to view a PDF document * * @see https://react-pdf-viewer.dev * @license https://react-pdf-viewer.dev/license * @copyright 2019-2022 Nguyen Huu Phuoc <me@phuoc.ng> */lib$b.exports=selectionMode$2;var libExports$d=lib$b.exports,lib$a={exports:{}},fullScreen$2={},core$d=libExports$h,React$c=reactExports;function _interopNamespaceDefault$c(t){var n=Object.create(null);return t&&Object.keys(t).forEach(function(a){if(a!=="default"){var r=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(n,a,r.get?r:{enumerable:!0,get:function(){return t[a]}})}}),n.default=t,Object.freeze(n)}var React__namespace$c=_interopNamespaceDefault$c(React$c),ExitFullScreenIcon=function(){return React__namespace$c.createElement(core$d.Icon,{size:16},React__namespace$c.createElement("path",{d:"M11.5 23.499L11.5 14.499"}),React__namespace$c.createElement("path",{d:"M7.5 18.499L11.5 14.499 15.5 18.499"}),React__namespace$c.createElement("path",{d:"M11.5 1.499L11.5 10.499"}),React__namespace$c.createElement("path",{d:"M7.5 6.499L11.5 10.499 15.5 6.499"}),React__namespace$c.createElement("path",{d:"M20.5 12.499L1.5 12.499"}))},FullScreenIcon=function(){return React__namespace$c.createElement(core$d.Icon,{size:16},React__namespace$c.createElement("path",{d:"M0.5 12L23.5 12"}),React__namespace$c.createElement("path",{d:"M11.5 1L11.5 23"}),React__namespace$c.createElement("path",{d:"M8.5 4L11.5 1 14.5 4"}),React__namespace$c.createElement("path",{d:"M20.5 9L23.5 12 20.5 15"}),React__namespace$c.createElement("path",{d:"M3.5 15L0.5 12 3.5 9"}),React__namespace$c.createElement("path",{d:"M14.5 20L11.5 23 8.5 20"}))},__assign$c=function(){return __assign$c=Object.assign||function(n){for(var a,r=1,e=arguments.length;r<e;r++){a=arguments[r];for(var p in a)Object.prototype.hasOwnProperty.call(a,p)&&(n[p]=a[p])}return n},__assign$c.apply(this,arguments)},Api;(function(t){t[t.ExitFullScreen=0]="ExitFullScreen",t[t.FullScreenChange=1]="FullScreenChange",t[t.FullScreenElement=2]="FullScreenElement",t[t.FullScreenEnabled=3]="FullScreenEnabled",t[t.RequestFullScreen=4]="RequestFullScreen"})(Api||(Api={}));var defaultVendor={ExitFullScreen:"exitFullscreen",FullScreenChange:"fullscreenchange",FullScreenElement:"fullscreenElement",FullScreenEnabled:"fullscreenEnabled",RequestFullScreen:"requestFullscreen"},webkitVendor={ExitFullScreen:"webkitExitFullscreen",FullScreenChange:"webkitfullscreenchange",FullScreenElement:"webkitFullscreenElement",FullScreenEnabled:"webkitFullscreenEnabled",RequestFullScreen:"webkitRequestFullscreen"},msVendor={ExitFullScreen:"msExitFullscreen",FullScreenChange:"msFullscreenChange",FullScreenElement:"msFullscreenElement",FullScreenEnabled:"msFullscreenEnabled",RequestFullScreen:"msRequestFullscreen"},isBrowser=typeof window<"u",vendor=isBrowser&&(Api.FullScreenEnabled in document&&defaultVendor||webkitVendor.FullScreenEnabled in document&&webkitVendor||msVendor.FullScreenEnabled in document&&msVendor)||defaultVendor,isFullScreenEnabled=function(){return isBrowser&&vendor.FullScreenEnabled in document&&document[vendor.FullScreenEnabled]===!0},addFullScreenChangeListener=function(t){isBrowser&&document.addEventListener(vendor.FullScreenChange,t)},exitFullScreenMode=function(t){return isBrowser?t[vendor.ExitFullScreen]():Promise.resolve({})},getFullScreenElement=function(){return isBrowser?document[vendor.FullScreenElement]:null},requestFullScreen=function(t){isBrowser&&t[vendor.RequestFullScreen]()},TOOLTIP_OFFSET$1$3={left:0,top:8},EnterFullScreenButton=function(t){var n=t.enableShortcuts,a=t.onClick,r=React__namespace$c.useContext(core$d.LocalizationContext).l10n,e=r&&r.fullScreen?r.fullScreen.enterFullScreen:"Full screen",p=n?core$d.isMac()?"Meta+Ctrl+F":"F11":"";return React__namespace$c.createElement(core$d.Tooltip,{ariaControlsSuffix:"full-screen-enter",position:core$d.Position.BottomCenter,target:React__namespace$c.createElement(core$d.MinimalButton,{ariaKeyShortcuts:p,ariaLabel:e,isDisabled:!isFullScreenEnabled(),testId:"full-screen__enter-button",onClick:a},React__namespace$c.createElement(FullScreenIcon,null)),content:function(){return e},offset:TOOLTIP_OFFSET$1$3})},TOOLTIP_OFFSET$b={left:0,top:8},ExitFullScreenButtonWithTooltip=function(t){var n=t.onClick,a=React__namespace$c.useContext(core$d.LocalizationContext).l10n,r=a&&a.fullScreen?a.fullScreen.exitFullScreen:"Exit full screen";return React__namespace$c.createElement(core$d.Tooltip,{ariaControlsSuffix:"full-screen-exit",position:core$d.Position.BottomCenter,target:React__namespace$c.createElement(core$d.MinimalButton,{ariaKeyShortcuts:"Esc",ariaLabel:r,testId:"full-screen__exit-button-with-tooltip",onClick:n},React__namespace$c.createElement(ExitFullScreenIcon,null)),content:function(){return r},offset:TOOLTIP_OFFSET$b})},useEnterFullScreen=function(t,n,a,r){var e=React__namespace$c.useState(!1),p=e[0],k=e[1],E=React__namespace$c.useRef(n.get("getPagesContainer")?n.get("getPagesContainer")():null),b=function(){var h=E.current;if(!h)return Promise.resolve();var l=getFullScreenElement();return l&&l!==t(h)?exitFullScreenMode(l):Promise.resolve()},R=function(){if(isFullScreenEnabled()){var h=E.current;h&&b().then(function(){requestFullScreen(t(h))})}},S=function(){var h=getFullScreenElement(),l=E.current,o=h===t(l);n.update("isFullScreen",o),o?l.classList.add("rpv-full-screen__pages"):l.classList.remove("rpv-full-screen__pages");var s=n.get("zoom");s&&(o?a(s):r(s))},A=function(h){E.current=h(),addFullScreenChangeListener(S)},y=function(h){k(h)},_=function(){k(!1);var h=n.get("getPagesContainer");if(h){var l=h();if(l){var o=getFullScreenElement();o&&o===t(l)&&exitFullScreenMode(document)}}};return React__namespace$c.useEffect(function(){return n.subscribe("isFullScreen",y),n.subscribe("getPagesContainer",A),function(){n.unsubscribe("getPagesContainer",A),n.unsubscribe("isFullScreen",y)}},[]),{enterFullScreen:R,exitFullScreen:_,isFullScreen:p}},EnterFullScreen=function(t){var n=t.children,a=t.enableShortcuts,r=t.getFullScreenTarget,e=t.store,p=t.onEnterFullScreen,k=t.onExitFullScreen,E=useEnterFullScreen(r,e,p,k),b=E.enterFullScreen,R=E.exitFullScreen,S=E.isFullScreen,A=function(_){return S?React__namespace$c.createElement(ExitFullScreenButtonWithTooltip,{onClick:_.onClick}):React__namespace$c.createElement(EnterFullScreenButton,{enableShortcuts:a,onClick:_.onClick})},y=n||A;return y({onClick:S?R:b})},EnterFullScreenMenuItem=function(t){var n=t.onClick,a=React__namespace$c.useContext(core$d.LocalizationContext).l10n,r=a&&a.fullScreen?a.fullScreen.enterFullScreen:"Full screen";return React__namespace$c.createElement(core$d.MenuItem,{icon:React__namespace$c.createElement(FullScreenIcon,null),isDisabled:!isFullScreenEnabled(),testId:"full-screen__enter-menu",onClick:n},r)},ExitFullScreenButton=function(t){var n=t.onClick,a=React__namespace$c.useContext(core$d.LocalizationContext).l10n,r=React__namespace$c.useContext(core$d.ThemeContext).direction,e=r===core$d.TextDirection.RightToLeft,p=a&&a.fullScreen?a.fullScreen.exitFullScreen:"Exit full screen";return React__namespace$c.createElement("div",{className:core$d.classNames({"rpv-full-screen__exit-button":!0,"rpv-full-screen__exit-button--ltr":!e,"rpv-full-screen__exit-button--rtl":e})},React__namespace$c.createElement(core$d.MinimalButton,{ariaLabel:p,testId:"full-screen__exit-button",onClick:n},React__namespace$c.createElement(ExitFullScreenIcon,null)))},ExitFullScreen=function(t){var n=t.children,a=t.getFullScreenTarget,r=t.store,e=t.onEnterFullScreen,p=t.onExitFullScreen,k=useEnterFullScreen(a,r,e,p),E=k.enterFullScreen,b=k.exitFullScreen,R=k.isFullScreen,S=function(y){return React__namespace$c.createElement(ExitFullScreenButton,{onClick:y.onClick})},A=n||S;return R&&A({onClick:R?b:E})},ShortcutHandler$5=function(t){var n=t.containerRef,a=t.getFullScreenTarget,r=t.store,e=t.onEnterFullScreen,p=t.onExitFullScreen,k=useEnterFullScreen(a,r,e,p).enterFullScreen,E=function(b){if(!(b.shiftKey||b.altKey)){var R=core$d.isMac()?b.metaKey&&b.ctrlKey&&b.key==="f":b.key==="F11";if(R){var S=n.current;!S||!document.activeElement||!S.contains(document.activeElement)||(b.preventDefault(),k())}}};return React__namespace$c.useEffect(function(){var b=n.current;if(b)return document.addEventListener("keydown",E),function(){document.removeEventListener("keydown",E)}},[n.current]),React__namespace$c.createElement(React__namespace$c.Fragment,null)},fullScreenPlugin=function(t){var n=function(S){return S},a=(t==null?void 0:t.getFullScreenTarget)||n,r=React__namespace$c.useMemo(function(){return Object.assign({},{enableShortcuts:!0,onEnterFullScreen:function(){},onExitFullScreen:function(){}},t)},[]),e=React__namespace$c.useMemo(function(){return core$d.createStore({})},[]),p=function(S){return React__namespace$c.createElement(EnterFullScreen,__assign$c({},S,{enableShortcuts:r.enableShortcuts,getFullScreenTarget:a,store:e,onEnterFullScreen:r.onEnterFullScreen,onExitFullScreen:r.onExitFullScreen}))},k=function(){return React__namespace$c.createElement(p,null,function(S){return React__namespace$c.createElement(EnterFullScreenButton,__assign$c({enableShortcuts:r.enableShortcuts},S))})},E=function(S){return React__namespace$c.createElement(p,null,function(A){return React__namespace$c.createElement(EnterFullScreenMenuItem,{onClick:function(){A.onClick(),S.onClick()}})})},b=function(){return React__namespace$c.createElement(ExitFullScreen,{getFullScreenTarget:a,store:e,onEnterFullScreen:r.onEnterFullScreen,onExitFullScreen:r.onExitFullScreen},t==null?void 0:t.renderExitFullScreenButton)},R=function(S){var A=S.slot;return A.subSlot&&(A.subSlot.children=React__namespace$c.createElement(React__namespace$c.Fragment,null,r.enableShortcuts&&React__namespace$c.createElement(ShortcutHandler$5,{containerRef:S.containerRef,getFullScreenTarget:a,store:e,onEnterFullScreen:r.onEnterFullScreen,onExitFullScreen:r.onExitFullScreen}),React__namespace$c.createElement(b,null),A.subSlot.children)),A};return{install:function(S){e.update("getPagesContainer",S.getPagesContainer),e.update("zoom",S.zoom)},renderViewer:R,EnterFullScreen:p,EnterFullScreenButton:k,EnterFullScreenMenuItem:E}};fullScreen$2.ExitFullScreenIcon=ExitFullScreenIcon;fullScreen$2.FullScreenIcon=FullScreenIcon;fullScreen$2.fullScreenPlugin=fullScreenPlugin;/** * A React component to view a PDF document * * @see https://react-pdf-viewer.dev * @license https://react-pdf-viewer.dev/license * @copyright 2019-2022 Nguyen Huu Phuoc <me@phuoc.ng> */lib$a.exports=fullScreen$2;var libExports$c=lib$a.exports,lib$9={exports:{}},getFile$1={},core$c=libExports$h,React$b=reactExports;function _interopNamespaceDefault$b(t){var n=Object.create(null);return t&&Object.keys(t).forEach(function(a){if(a!=="default"){var r=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(n,a,r.get?r:{enumerable:!0,get:function(){return t[a]}})}}),n.default=t,Object.freeze(n)}var React__namespace$b=_interopNamespaceDefault$b(React$b),DownloadIcon=function(){return React__namespace$b.createElement(core$c.Icon,{size:16},React__namespace$b.createElement("path",{d:"M5.5,11.5c-.275,0-.341.159-.146.354l6.292,6.293a.5.5,0,0,0,.709,0l6.311-6.275c.2-.193.13-.353-.145-.355L15.5,11.5V1.5a1,1,0,0,0-1-1h-5a1,1,0,0,0-1,1V11a.5.5,0,0,1-.5.5Z"}),React__namespace$b.createElement("path",{d:"M23.5,18.5v4a1,1,0,0,1-1,1H1.5a1,1,0,0,1-1-1v-4"}))},__assign$b=function(){return __assign$b=Object.assign||function(n){for(var a,r=1,e=arguments.length;r<e;r++){a=arguments[r];for(var p in a)Object.prototype.hasOwnProperty.call(a,p)&&(n[p]=a[p])}return n},__assign$b.apply(this,arguments)},TOOLTIP_OFFSET$a={left:0,top:8},DownloadButton=function(t){var n=t.onClick,a=React__namespace$b.useContext(core$c.LocalizationContext).l10n,r=a&&a.download?a.download.download:"Download";return React__namespace$b.createElement(core$c.Tooltip,{ariaControlsSuffix:"get-file",position:core$c.Position.BottomCenter,target:React__namespace$b.createElement(core$c.MinimalButton,{ariaLabel:r,testId:"get-file__download-button",onClick:n},React__namespace$b.createElement(DownloadIcon,null)),content:function(){return r},offset:TOOLTIP_OFFSET$a})},isChromeIOS=function(){return/iphone|ipod|ipad/i.test(navigator.userAgent)&&/CriOS/i.test(navigator.userAgent)},isSafariIOS=function(){return/iphone|ipod|ipad/i.test(navigator.userAgent)&&!/CriOS/i.test(navigator.userAgent)},encodeUint8Array=function(t){return btoa(Array(t.length).fill("").map(function(n,a){return String.fromCharCode(t[a])}).join(""))},download$1=function(t,n){var a=document.createElement("a");a.style.display="none",a.href=t,a.setAttribute("download",n),document.body.appendChild(a),a.click(),document.body.removeChild(a)},downloadBlob=function(t,n,a){var r=URL.createObjectURL(new Blob([t],{type:a}));download$1(r,n),r&&URL.revokeObjectURL(r)},downloadFile=function(t,n){t.getData().then(function(a){isSafariIOS()?downloadBlob(a,n,"application/octet-stream"):isChromeIOS()?download$1("data:application/pdf;base64,".concat(encodeUint8Array(a)),n):downloadBlob(a,n,"application/pdf")})},Download=function(t){var n=t.children,a=t.fileNameGenerator,r=t.store,e=React__namespace$b.useState(r.get("file")),p=e[0],k=e[1],E=React__namespace$b.useState(r.get("doc")),b=E[0],R=E[1],S=function(l){R(l)},A=function(l){k(l)};React__namespace$b.useEffect(function(){return r.subscribe("doc",S),r.subscribe("file",A),function(){r.subscribe("doc",S),r.unsubscribe("file",A)}},[]);var y=function(){b&&p&&downloadFile(b,a(p))},_=function(l){return React__namespace$b.createElement(DownloadButton,{onClick:l.onClick})},h=n||_;return h({onClick:y})},DownloadMenuItem=function(t){var n=t.onClick,a=React__namespace$b.useContext(core$c.LocalizationContext).l10n,r=a&&a.download?a.download.download:"Download";return React__namespace$b.createElement(core$c.MenuItem,{icon:React__namespace$b.createElement(DownloadIcon,null),testId:"get-file__download-menu",onClick:n},r)},getFileName$1=function(t){var n=t.split("/").pop();return n?n.split("#")[0].split("?")[0]:t},getFilePlugin=function(t){var n=React__namespace$b.useMemo(function(){return core$c.createStore({})},[]),a=function(k){return k.name?getFileName$1(k.name):"document.pdf"},r=function(k){return React__namespace$b.createElement(Download,__assign$b({},k,{fileNameGenerator:t&&t.fileNameGenerator||a,store:n}))},e=function(){return React__namespace$b.createElement(r,null,function(k){return React__namespace$b.createElement(DownloadButton,__assign$b({},k))})},p=function(k){return React__namespace$b.createElement(r,null,function(E){return React__namespace$b.createElement(DownloadMenuItem,{onClick:function(){E.onClick(),k.onClick()}})})};return{onDocumentLoad:function(k){n.update("doc",k.doc),n.update("file",k.file)},Download:r,DownloadButton:e,DownloadMenuItem:p}};getFile$1.DownloadIcon=DownloadIcon;getFile$1.getFilePlugin=getFilePlugin;/** * A React component to view a PDF document * * @see https://react-pdf-viewer.dev * @license https://react-pdf-viewer.dev/license * @copyright 2019-2022 Nguyen Huu Phuoc <me@phuoc.ng> */lib$9.exports=getFile$1;var libExports$b=lib$9.exports,lib$8={exports:{}},open$2={},core$b=libExports$h,React$a=reactExports;function _interopNamespaceDefault$a(t){var n=Object.create(null);return t&&Object.keys(t).forEach(function(a){if(a!=="default"){var r=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(n,a,r.get?r:{enumerable:!0,get:function(){return t[a]}})}}),n.default=t,Object.freeze(n)}var React__namespace$a=_interopNamespaceDefault$a(React$a),OpenFileIcon=function(){return React__namespace$a.createElement(core$b.Icon,{size:16},React__namespace$a.createElement("path",{d:"M18.5,7.5c.275,0,.341-.159.146-.354L12.354.854a.5.5,0,0,0-.708,0L5.354,7.147c-.2.195-.129.354.146.354h3v10a1,1,0,0,0,1,1h5a1,1,0,0,0,1-1V7.5Z"}),React__namespace$a.createElement("path",{d:"M23.5,18.5v4a1,1,0,0,1-1,1H1.5a1,1,0,0,1-1-1v-4"}))},__assign$a=function(){return __assign$a=Object.assign||function(n){for(var a,r=1,e=arguments.length;r<e;r++){a=arguments[r];for(var p in a)Object.prototype.hasOwnProperty.call(a,p)&&(n[p]=a[p])}return n},__assign$a.apply(this,arguments)},useTriggerOpen=function(t){var n=React__namespace$a.useRef(),a=function(){var e=n.current;e&&(e.click(),t.get("triggerOpenFile")&&t.update("triggerOpenFile",!1))},r=function(e){e&&a()};return React__namespace$a.useEffect(function(){return t.subscribe("triggerOpenFile",r),function(){t.unsubscribe("triggerOpenFile",r)}},[]),{inputRef:n,openFile:a}},TOOLTIP_OFFSET$9={left:0,top:8},OpenButton=function(t){var n=t.enableShortcuts,a=t.store,r=t.onClick,e=React__namespace$a.useContext(core$b.LocalizationContext).l10n,p=e&&e.open?e.open.openFile:"Open file",k=useTriggerOpen(a),E=k.inputRef,b=k.openFile,R=n?core$b.isMac()?"Meta+O":"Ctrl+O":"";return React__namespace$a.createElement(core$b.Tooltip,{ariaControlsSuffix:"open",position:core$b.Position.BottomCenter,target:React__namespace$a.createElement("div",{className:"rpv-open__input-wrapper"},React__namespace$a.createElement("input",{accept:".pdf",ref:E,className:"rpv-open__input",multiple:!1,tabIndex:-1,title:"",type:"file",onChange:r}),React__namespace$a.createElement(core$b.MinimalButton,{ariaKeyShortcuts:R,ariaLabel:p,testId:"open__button",onClick:b},React__namespace$a.createElement(OpenFileIcon,null))),content:function(){return p},offset:TOOLTIP_OFFSET$9})},Open=function(t){var n=t.children,a=t.enableShortcuts,r=t.store,e=function(E){var b=E.target.files;if(!(!b||!b.length)){var R=r.get("openFile");R&&R(b[0])}},p=function(E){return React__namespace$a.createElement(OpenButton,{enableShortcuts:a,store:r,onClick:E.onClick})},k=n||p;return k({onClick:e})},OpenMenuItem=function(t){var n=t.store,a=t.onClick,r=React__namespace$a.useContext(core$b.LocalizationContext).l10n,e=r&&r.open?r.open.openFile:"Open file",p=useTriggerOpen(n),k=p.inputRef,E=p.openFile;return React__namespace$a.createElement(core$b.MenuItem,{icon:React__namespace$a.createElement(OpenFileIcon,null),testId:"open__menu",onClick:E},React__namespace$a.createElement("div",{className:"rpv-open__input-wrapper"},React__namespace$a.createElement("input",{accept:".pdf",ref:k,className:"rpv-open__input",multiple:!1,tabIndex:-1,title:"",type:"file",onChange:a}),e))},ShortcutHandler$4=function(t){var n=t.containerRef,a=t.store,r=function(e){if(!(e.shiftKey||e.altKey||e.key!=="o")){var p=core$b.isMac()?e.metaKey:e.ctrlKey;if(p){var k=n.current;!k||!document.activeElement||!k.contains(document.activeElement)||(e.preventDefault(),a.update("triggerOpenFile",!0))}}};return React__namespace$a.useEffect(function(){var e=n.current;if(e)return document.addEventListener("keydown",r),function(){document.removeEventListener("keydown",r)}},[n.current]),React__namespace$a.createElement(React__namespace$a.Fragment,null)},openPlugin=function(t){var n=React__namespace$a.useMemo(function(){return Object.assign({},{enableShortcuts:!0},t)},[]),a=React__namespace$a.useMemo(function(){return core$b.createStore({})},[]),r=function(E){return React__namespace$a.createElement(Open,__assign$a({enableShortcuts:n.enableShortcuts},E,{store:a}))},e=function(){return React__namespace$a.createElement(r,null)},p=function(){return React__namespace$a.createElement(r,null,function(E){return React__namespace$a.createElement(OpenMenuItem,{store:a,onClick:E.onClick})})},k=function(E){var b=E.slot,R={children:React__namespace$a.createElement(React__namespace$a.Fragment,null,n.enableShortcuts&&React__namespace$a.createElement(ShortcutHandler$4,{containerRef:E.containerRef,store:a}),b.children)};return __assign$a(__assign$a({},b),R)};return{install:function(E){a.update("openFile",E.openFile)},renderViewer:k,Open:r,OpenButton:e,OpenMenuItem:p}};open$2.OpenFileIcon=OpenFileIcon;open$2.openPlugin=openPlugin;/** * A React component to view a PDF document * * @see https://react-pdf-viewer.dev * @license https://react-pdf-viewer.dev/license * @copyright 2019-2022 Nguyen Huu Phuoc <me@phuoc.ng> */lib$8.exports=open$2;var libExports$a=lib$8.exports,lib$7={exports:{}},pageNavigation$2={},core$a=libExports$h,React$9=reactExports;function _interopNamespaceDefault$9(t){var n=Object.create(null);return t&&Object.keys(t).forEach(function(a){if(a!=="default"){var r=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(n,a,r.get?r:{enumerable:!0,get:function(){return t[a]}})}}),n.default=t,Object.freeze(n)}var React__namespace$9=_interopNamespaceDefault$9(React$9),DownArrowIcon=function(){return React__namespace$9.createElement(core$a.Icon,{size:16},React__namespace$9.createElement("path",{d:`M2.32,2.966h19.452c0.552,0.001,1,0.449,0.999,1.001c0,0.182-0.05,0.36-0.144,0.516L12.9,20.552 c-0.286,0.472-0.901,0.624-1.373,0.338c-0.138-0.084-0.254-0.2-0.338-0.338L1.465,4.483C1.179,4.01,1.331,3.396,1.804,3.11 C1.96,3.016,2.138,2.966,2.32,2.966z`}))},NextIcon$1=function(){return React__namespace$9.createElement(core$a.Icon,{size:16},React__namespace$9.createElement("path",{d:`M0.541,5.627L11.666,18.2c0.183,0.207,0.499,0.226,0.706,0.043c0.015-0.014,0.03-0.028,0.043-0.043 L23.541,5.627`}))},__assign$9=function(){return __assign$9=Object.assign||function(n){for(var a,r=1,e=arguments.length;r<e;r++){a=arguments[r];for(var p in a)Object.prototype.hasOwnProperty.call(a,p)&&(n[p]=a[p])}return n},__assign$9.apply(this,arguments)},useCurrentPage=function(t){var n=React__namespace$9.useState(t.get("currentPage")||0),a=n[0],r=n[1],e=function(p){r(p)};return core$a.useIsomorphicLayoutEffect(function(){return t.subscribe("currentPage",e),function(){t.unsubscribe("currentPage",e)}},[]),{currentPage:a}},useNumberOfPages=function(t){var n=React__namespace$9.useState(t.get("numberOfPages")||0),a=n[0],r=n[1],e=function(p){r(p)};return React__namespace$9.useEffect(function(){return t.subscribe("numberOfPages",e),function(){t.unsubscribe("numberOfPages",e)}},[]),{numberOfPages:a}},CurrentPageInput=function(t){var n=t.store,a=React__namespace$9.useContext(core$a.LocalizationContext).l10n,r=React__namespace$9.useState("1"),e=r[0],p=r[1],k=useCurrentPage(n).currentPage,E=useNumberOfPages(n).numberOfPages;React__namespace$9.useEffect(function(){return p("".concat(k+1))},[k]);var b=function(){var h=k+1;h<E&&(p("".concat(h+1)),S(h))},R=function(){var h=k-1;h>=0&&(p("".concat(h+1)),S(h))},S=function(h){var l=n.get("jumpToPage");l&&l(h)},A=function(){var h=parseInt(e,10);e===""||h<1||h>E?p("".concat(k+1)):S(h-1)},y=function(h){switch(h.key){case"ArrowUp":R();break;case"ArrowDown":b();break;case"Enter":A();break}},_=a&&a.pageNavigation?a.pageNavigation.enterPageNumber:"Enter a page number";return React__namespace$9.createElement("span",{className:"rpv-page-navigation__current-page-input"},React__namespace$9.createElement(core$a.TextBox,{ariaLabel:_,testId:"page-navigation__current-page-input",type:"text",value:e,onChange:p,onKeyDown:y}))},FetchLabels=function(t){var n=t.children,a=t.doc,r=core$a.useIsMounted(),e=React__namespace$9.useState({loading:!0,labels:[]}),p=e[0],k=e[1];return React__namespace$9.useEffect(function(){a.getPageLabels().then(function(E){r.current&&k({loading:!1,labels:E||[]})})},[a.loadingTask.docId]),p.loading?React__namespace$9.createElement(React__namespace$9.Fragment,null):n(p.labels)},useDocument$2=function(t){var n=React__namespace$9.useState(t.get("doc")),a=n[0],r=n[1],e=function(p){r(p)};return React__namespace$9.useEffect(function(){return t.subscribe("doc",e),function(){t.unsubscribe("doc",e)}},[]),a},CurrentPageLabel=function(t){var n=t.children,a=t.store,r=useDocument$2(a),e=useCurrentPage(a).currentPage,p=useNumberOfPages(a).numberOfPages,k=function(b){return React__namespace$9.createElement(React__namespace$9.Fragment,null,b.currentPage+1)},E=n||k;return r?React__namespace$9.createElement(FetchLabels,{doc:r},function(b){var R=b.length===p&&p>0?b[e]:"";return E({currentPage:e,numberOfPages:p,pageLabel:R})}):React__namespace$9.createElement(React__namespace$9.Fragment,null)},UpArrowIcon=function(){return React__namespace$9.createElement(core$a.Icon,{size:16},React__namespace$9.createElement("path",{d:`M21.783,21.034H2.332c-0.552,0-1-0.448-1-1c0-0.182,0.05-0.361,0.144-0.517L11.2,3.448 c0.286-0.472,0.901-0.624,1.373-0.338c0.138,0.084,0.254,0.2,0.338,0.338l9.726,16.069c0.286,0.473,0.134,1.087-0.339,1.373 C22.143,20.984,21.965,21.034,21.783,21.034z`}))},TOOLTIP_OFFSET$3$1={left:0,top:8},GoToFirstPageButton=function(t){var n=t.isDisabled,a=t.onClick,r=React__namespace$9.useContext(core$a.LocalizationContext).l10n,e=r&&r.pageNavigation?r.pageNavigation.goToFirstPage:"First page";return React__namespace$9.createElement(core$a.Tooltip,{ariaControlsSuffix:"page-navigation-first",position:core$a.Position.BottomCenter,target:React__namespace$9.createElement(core$a.MinimalButton,{ariaLabel:e,isDisabled:n,testId:"page-navigation__first-button",onClick:a},React__namespace$9.createElement(UpArrowIcon,null)),content:function(){return e},offset:TOOLTIP_OFFSET$3$1})},GoToFirstPage=function(t){var n=t.children,a=t.store,r=useCurrentPage(a).currentPage,e=function(){var E=a.get("jumpToPage");E&&E(0)},p=function(E){return React__namespace$9.createElement(GoToFirstPageButton,{isDisabled:E.isDisabled,onClick:E.onClick})},k=n||p;return k({isDisabled:r===0,onClick:e})},GoToFirstPageMenuItem=function(t){var n=t.isDisabled,a=t.onClick,r=React__namespace$9.useContext(core$a.LocalizationContext).l10n,e=r&&r.pageNavigation?r.pageNavigation.goToFirstPage:"First page";return React__namespace$9.createElement(core$a.MenuItem,{icon:React__namespace$9.createElement(UpArrowIcon,null),isDisabled:n,testId:"page-navigation__first-menu",onClick:a},e)},TOOLTIP_OFFSET$2$1={left:0,top:8},GoToLastPageButton=function(t){var n=t.isDisabled,a=t.onClick,r=React__namespace$9.useContext(core$a.LocalizationContext).l10n,e=r&&r.pageNavigation?r.pageNavigation.goToLastPage:"Last page";return React__namespace$9.createElement(core$a.Tooltip,{ariaControlsSuffix:"page-navigation-last",position:core$a.Position.BottomCenter,target:React__namespace$9.createElement(core$a.MinimalButton,{ariaLabel:e,isDisabled:n,testId:"page-navigation__last-button",onClick:a},React__namespace$9.createElement(DownArrowIcon,null)),content:function(){return e},offset:TOOLTIP_OFFSET$2$1})},GoToLastPage=function(t){var n=t.children,a=t.store,r=useCurrentPage(a).currentPage,e=useNumberOfPages(a).numberOfPages,p=function(){var b=a.get("jumpToPage");b&&b(e-1)},k=function(b){return React__namespace$9.createElement(GoToLastPageButton,{isDisabled:b.isDisabled,onClick:b.onClick})},E=n||k;return E({isDisabled:r+1>=e,onClick:p})},GoToLastPageMenuItem=function(t){var n=t.isDisabled,a=t.onClick,r=React__namespace$9.useContext(core$a.LocalizationContext).l10n,e=r&&r.pageNavigation?r.pageNavigation.goToLastPage:"Last page";return React__namespace$9.createElement(core$a.MenuItem,{icon:React__namespace$9.createElement(DownArrowIcon,null),isDisabled:n,testId:"page-navigation__last-menu",onClick:a},e)},TOOLTIP_OFFSET$1$2={left:0,top:8},GoToNextPageButton=function(t){var n=t.isDisabled,a=t.onClick,r=React__namespace$9.useContext(core$a.LocalizationContext).l10n,e=r&&r.pageNavigation?r.pageNavigation.goToNextPage:"Next page";return React__namespace$9.createElement(core$a.Tooltip,{ariaControlsSuffix:"page-navigation-next",position:core$a.Position.BottomCenter,target:React__namespace$9.createElement(core$a.MinimalButton,{ariaLabel:e,isDisabled:n,testId:"page-navigation__next-button",onClick:a},React__namespace$9.createElement(NextIcon$1,null)),content:function(){return e},offset:TOOLTIP_OFFSET$1$2})},GoToNextPage=function(t){var n=t.children,a=t.store,r=useCurrentPage(a).currentPage,e=useNumberOfPages(a).numberOfPages,p=function(){var b=a.get("jumpToNextPage");b&&b()},k=function(b){return React__namespace$9.createElement(GoToNextPageButton,{onClick:b.onClick,isDisabled:b.isDisabled})},E=n||k;return E({isDisabled:r+1>=e,onClick:p})},GoToNextPageMenuItem=function(t){var n=t.isDisabled,a=t.onClick,r=React__namespace$9.useContext(core$a.LocalizationContext).l10n,e=r&&r.pageNavigation?r.pageNavigation.goToNextPage:"Next page";return React__namespace$9.createElement(core$a.MenuItem,{icon:React__namespace$9.createElement(NextIcon$1,null),isDisabled:n,testId:"page-navigation__next-menu",onClick:a},e)},PreviousIcon$1=function(){return React__namespace$9.createElement(core$a.Icon,{size:16},React__namespace$9.createElement("path",{d:`M23.535,18.373L12.409,5.8c-0.183-0.207-0.499-0.226-0.706-0.043C11.688,5.77,11.674,5.785,11.66,5.8 L0.535,18.373`}))},TOOLTIP_OFFSET$8={left:0,top:8},GoToPreviousPageButton=function(t){var n=t.isDisabled,a=t.onClick,r=React__namespace$9.useContext(core$a.LocalizationContext).l10n,e=r&&r.pageNavigation?r.pageNavigation.goToPreviousPage:"Previous page";return React__namespace$9.createElement(core$a.Tooltip,{ariaControlsSuffix:"page-navigation-previous",position:core$a.Position.BottomCenter,target:React__namespace$9.createElement(core$a.MinimalButton,{ariaLabel:e,isDisabled:n,testId:"page-navigation__previous-button",onClick:a},React__namespace$9.createElement(PreviousIcon$1,null)),content:function(){return e},offset:TOOLTIP_OFFSET$8})},GoToPreviousPage=function(t){var n=t.store,a=t.children,r=useCurrentPage(n).currentPage,e=function(){var E=n.get("jumpToPreviousPage");E&&E()},p=function(E){return React__namespace$9.createElement(GoToPreviousPageButton,{isDisabled:E.isDisabled,onClick:E.onClick})},k=a||p;return k({isDisabled:r<=0,onClick:e})},GoToPreviousPageMenuItem=function(t){var n=t.isDisabled,a=t.onClick,r=React__namespace$9.useContext(core$a.LocalizationContext).l10n,e=r&&r.pageNavigation?r.pageNavigation.goToPreviousPage:"Previous page";return React__namespace$9.createElement(core$a.MenuItem,{icon:React__namespace$9.createElement(PreviousIcon$1,null),isDisabled:n,testId:"page-navigation__previous-menu",onClick:a},e)},NumberOfPages=function(t){var n=t.children,a=t.store,r=useNumberOfPages(a).numberOfPages;return n?n({numberOfPages:r}):React__namespace$9.createElement(React__namespace$9.Fragment,null,r)},ShortcutHandler$3=function(t){var n=t.containerRef,a=t.numPages,r=t.store,e=React__namespace$9.useRef(r.get("jumpFromAnnotation")||{bottomOffset:0,dest:"",leftOffset:0,pageIndex:-1}),p=useCurrentPage(r).currentPage,k=React__namespace$9.useRef(p);k.current=p;var E=React__namespace$9.useRef(!1),b=function(){E.current=!0},R=function(){E.current=!1},S=function(){var l=r.get("jumpToPage"),o=k.current+1;l&&o<a&&l(o)},A=function(){var l=r.get("jumpToPage"),o=k.current-1;l&&o>=0&&l(o)},y=function(l){var o=r.get("jumpToDestination");if(o){var s=l.pageIndex,f=l.bottomOffset,g=l.leftOffset;o(s,f,g)}},_=function(l){var o=n.current,s=E.current||document.activeElement&&o.contains(document.activeElement);if(!(!o||!s)){var f=l.altKey&&l.key==="ArrowDown"||!l.shiftKey&&!l.altKey&&l.key==="PageDown",g=l.altKey&&l.key==="ArrowUp"||!l.shiftKey&&!l.altKey&&l.key==="PageUp",v=core$a.isMac()?l.metaKey&&!l.ctrlKey:l.ctrlKey,c=v&&l.key==="ArrowUp";f?(l.preventDefault(),S()):g?(l.preventDefault(),A()):c&&e.current&&e.current.dest&&(l.preventDefault(),y(e.current))}},h=function(l){e.current=l};return React__namespace$9.useEffect(function(){return r.subscribe("jumpFromAnnotation",h),function(){r.unsubscribe("jumpFromAnnotation",h)}},[]),React__namespace$9.useEffect(function(){var l=n.current;if(l)return document.addEventListener("keydown",_),l.addEventListener("mouseenter",b),l.addEventListener("mouseleave",R),function(){document.removeEventListener("keydown",_),l.removeEventListener("mouseenter",b),l.removeEventListener("mouseleave",R)}},[n.current]),React__namespace$9.createElement(React__namespace$9.Fragment,null)},pageNavigationPlugin=function(t){var n=React__namespace$9.useMemo(function(){return Object.assign({},{enableShortcuts:!0},t)},[]),a=React__namespace$9.useMemo(function(){return core$a.createStore()},[]),r=function(){return React__namespace$9.createElement(CurrentPageInput,{store:a})},e=function(v){return React__namespace$9.createElement(CurrentPageLabel,__assign$9({},v,{store:a}))},p=function(v){return React__namespace$9.createElement(GoToFirstPage,__assign$9({},v,{store:a}))},k=function(){return React__namespace$9.createElement(p,null,function(v){return React__namespace$9.createElement(GoToFirstPageButton,__assign$9({},v))})},E=function(v){return React__namespace$9.createElement(p,null,function(c){return React__namespace$9.createElement(GoToFirstPageMenuItem,{isDisabled:c.isDisabled,onClick:function(){c.onClick(),v.onClick()}})})},b=function(v){return React__namespace$9.createElement(GoToLastPage,__assign$9({},v,{store:a}))},R=function(){return React__namespace$9.createElement(b,null,function(v){return React__namespace$9.createElement(GoToLastPageButton,__assign$9({},v))})},S=function(v){return React__namespace$9.createElement(b,null,function(c){return React__namespace$9.createElement(GoToLastPageMenuItem,{isDisabled:c.isDisabled,onClick:function(){c.onClick(),v.onClick()}})})},A=function(v){return React__namespace$9.createElement(GoToNextPage,__assign$9({},v,{store:a}))},y=function(){return React__namespace$9.createElement(A,null,function(v){return React__namespace$9.createElement(GoToNextPageButton,__assign$9({},v))})},_=function(v){return React__namespace$9.createElement(A,null,function(c){return React__namespace$9.createElement(GoToNextPageMenuItem,{isDisabled:c.isDisabled,onClick:function(){c.onClick(),v.onClick()}})})},h=function(v){return React__namespace$9.createElement(GoToPreviousPage,__assign$9({},v,{store:a}))},l=function(){return React__namespace$9.createElement(h,null,function(v){return React__namespace$9.createElement(GoToPreviousPageButton,__assign$9({},v))})},o=function(v){return React__namespace$9.createElement(h,null,function(c){return React__namespace$9.createElement(GoToPreviousPageMenuItem,{isDisabled:c.isDisabled,onClick:function(){c.onClick(),v.onClick()}})})},s=function(v){return React__namespace$9.createElement(NumberOfPages,__assign$9({},v,{store:a}))},f=function(v){if(v.annotations.length){var c=v.annotations.filter(function(d){return d.subtype==="Link"&&!d.url&&!d.unsafeUrl&&!d.action&&d.dest});c.length&&c.forEach(function(d){var x=v.container.querySelector('a[data-annotation-link="'.concat(d.id,'"]'));x&&x.addEventListener("click",function(){v.container.style.setProperty("height","100%"),v.container.style.setProperty("width","100%");var L=v.container.getBoundingClientRect();v.container.style.removeProperty("height"),v.container.style.removeProperty("width");var X=x.getBoundingClientRect(),N=X.left-L.left,D=L.bottom-X.bottom+X.height;a.update("jumpFromAnnotation",{bottomOffset:D/v.scale,dest:d.dest,leftOffset:N/v.scale,pageIndex:v.pageIndex})})})}},g=function(v){var c=v.slot;if(!n.enableShortcuts)return c;var d={children:React__namespace$9.createElement(React__namespace$9.Fragment,null,React__namespace$9.createElement(ShortcutHandler$3,{containerRef:v.containerRef,numPages:v.doc.numPages,store:a}),c.children)};return __assign$9(__assign$9({},c),d)};return{install:function(v){a.update("jumpToDestination",v.jumpToDestination),a.update("jumpToNextPage",v.jumpToNextPage),a.update("jumpToPage",v.jumpToPage),a.update("jumpToPreviousPage",v.jumpToPreviousPage)},renderViewer:g,onAnnotationLayerRender:f,onDocumentLoad:function(v){a.update("doc",v.doc),a.update("numberOfPages",v.doc.numPages)},onViewerStateChange:function(v){return a.update("currentPage",v.pageIndex),v},jumpToPage:function(v){var c=a.get("jumpToPage");c&&c(v)},CurrentPageInput:r,CurrentPageLabel:e,GoToFirstPage:p,GoToFirstPageButton:k,GoToFirstPageMenuItem:E,GoToLastPage:b,GoToLastPageButton:R,GoToLastPageMenuItem:S,GoToNextPage:A,GoToNextPageButton:y,GoToNextPageMenuItem:_,GoToPreviousPage:h,GoToPreviousPageButton:l,GoToPreviousPageMenuItem:o,NumberOfPages:s}};pageNavigation$2.DownArrowIcon=DownArrowIcon;pageNavigation$2.NextIcon=NextIcon$1;pageNavigation$2.PreviousIcon=PreviousIcon$1;pageNavigation$2.UpArrowIcon=UpArrowIcon;pageNavigation$2.pageNavigationPlugin=pageNavigationPlugin;/** * A React component to view a PDF document * * @see https://react-pdf-viewer.dev * @license https://react-pdf-viewer.dev/license * @copyright 2019-2022 Nguyen Huu Phuoc <me@phuoc.ng> */lib$7.exports=pageNavigation$2;var libExports$9=lib$7.exports,lib$6={exports:{}},print$2={},core$9=libExports$h,React$8=reactExports,reactDom=reactDomExports;function _interopNamespaceDefault$8(t){var n=Object.create(null);return t&&Object.keys(t).forEach(function(a){if(a!=="default"){var r=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(n,a,r.get?r:{enumerable:!0,get:function(){return t[a]}})}}),n.default=t,Object.freeze(n)}var React__namespace$8=_interopNamespaceDefault$8(React$8),getAllPagesNumbers=function(t){return Array(t.numPages).fill(0).map(function(n,a){return a})},generateRange=function(t,n){return Array(n-t+1).fill(0).map(function(a,r){return t+r})},removeDuplicate=function(t){return t.filter(function(n){return t.indexOf(n)===t.lastIndexOf(n)})},getCustomPagesNumbers=function(t){return function(n){var a=[];return t.replace(/\s+/g,"").split(",").forEach(function(r){var e=r.split("-").map(function(p){return parseInt(p,10)}).filter(function(p){return Number.isInteger(p)});e.length===1?a.push(e[0]-1):e.length===2&&a.push.apply(a,generateRange(e[0]-1,e[1]-1))}),removeDuplicate(a).filter(function(r){return r>=0&&r<n.numPages})}},getEvenPagesNumbers=function(t){return Array(t.numPages).fill(0).map(function(n,a){return a}).filter(function(n){return(n+1)%2===0})},getOddPagesNumbers=function(t){return Array(t.numPages).fill(0).map(function(n,a){return a}).filter(function(n){return(n+1)%2===1})},PrintIcon=function(){return React__namespace$8.createElement(core$9.Icon,{size:16},React__namespace$8.createElement("path",{d:`M7.5,19.499h9 M7.5,16.499h9 M5.5,16.5h-3c-1.103-0.003-1.997-0.897-2-2v-6c0.003-1.103,0.897-1.997,2-2h19 c1.103,0.003,1.997,0.897,2,2v6c-0.003,1.103-0.897,1.997-2,2h-3 M5.5,4.5v-4h9.586c0.265,0,0.52,0.105,0.707,0.293l2.414,2.414 C18.395,3.394,18.5,3.649,18.5,3.914V4.5 M18.5,22.5c0,0.552-0.448,1-1,1h-11c-0.552,0-1-0.448-1-1v-9h13V22.5z M3.5,8.499 c0.552,0,1,0.448,1,1s-0.448,1-1,1s-1-0.448-1-1S2.948,8.499,3.5,8.499z M14.5,0.499v4h4`}))},__assign$8=function(){return __assign$8=Object.assign||function(n){for(var a,r=1,e=arguments.length;r<e;r++){a=arguments[r];for(var p in a)Object.prototype.hasOwnProperty.call(a,p)&&(n[p]=a[p])}return n},__assign$8.apply(this,arguments)},TOOLTIP_OFFSET$7={left:0,top:8},PrintButton=function(t){var n=t.enableShortcuts,a=t.onClick,r=React__namespace$8.useContext(core$9.LocalizationContext).l10n,e=r&&r.print?r.print.print:"Print",p=n?core$9.isMac()?"Meta+P":"Ctrl+P":"";return React__namespace$8.createElement(core$9.Tooltip,{ariaControlsSuffix:"print",position:core$9.Position.BottomCenter,target:React__namespace$8.createElement(core$9.MinimalButton,{ariaKeyShortcuts:p,ariaLabel:e,testId:"print__button",onClick:a},React__namespace$8.createElement(PrintIcon,null)),content:function(){return e},offset:TOOLTIP_OFFSET$7})},PrintStatus;(function(t){t.CheckingPermission="CheckingPermission",t.Inactive="Inactive",t.Preparing="Preparing",t.Cancelled="Cancelled",t.Ready="Ready"})(PrintStatus||(PrintStatus={}));var Print=function(t){var n=t.children,a=t.enableShortcuts,r=t.store,e=function(){r.update("printStatus",PrintStatus.CheckingPermission)},p=n||PrintButton;return p({enableShortcuts:a,onClick:e})},PERMISSION_PRINT=4,PERMISSION_PRINT_HIGHT_QUALITY=2048,CheckPrintPermission=function(t){var n=t.doc,a=t.store,r=React__namespace$8.useContext(core$9.LocalizationContext).l10n,e=React__namespace$8.useState(!0),p=e[0],k=e[1];return React__namespace$8.useEffect(function(){n.getPermissions().then(function(E){var b=E===null||E.includes(PERMISSION_PRINT)||E.includes(PERMISSION_PRINT_HIGHT_QUALITY);b?a.update("printStatus",PrintStatus.Preparing):k(!1)})},[]),p?React__namespace$8.createElement(React__namespace$8.Fragment,null):React__namespace$8.createElement(core$9.Modal,{ariaControlsSuffix:"print-permission",closeOnClickOutside:!1,closeOnEscape:!1,content:function(E){var b=function(){E(),a.update("printStatus",PrintStatus.Cancelled)};return React__namespace$8.createElement(React__namespace$8.Fragment,null,React__namespace$8.createElement("div",{className:"rpv-print__permission-body"},r&&r.print?r.print.disallowPrint:"The document does not allow to print"),React__namespace$8.createElement("div",{className:"rpv-print__permission-footer"},React__namespace$8.createElement(core$9.Button,{onClick:b},r&&r.print?r.print.close:"Close")))},isOpened:!0})},PrintProgress=function(t){var n=t.numLoadedPages,a=t.numPages,r=t.onCancel,e=React__namespace$8.useContext(core$9.LocalizationContext).l10n,p=React__namespace$8.useContext(core$9.ThemeContext).direction,k=p===core$9.TextDirection.RightToLeft,E=Math.floor(n*100/a);return React__namespace$8.createElement("div",{className:"rpv-print__progress"},React__namespace$8.createElement("div",{className:core$9.classNames({"rpv-print__progress-body":!0,"rpv-print__progress-body--rtl":k})},React__namespace$8.createElement("div",{className:"rpv-print__progress-message"},e&&e.print?e.print.preparingDocument:"Preparing document ..."),React__namespace$8.createElement("div",{className:"rpv-print__progress-bar"},React__namespace$8.createElement(core$9.ProgressBar,{progress:E})),React__namespace$8.createElement(core$9.Button,{onClick:r},e&&e.print?e.print.cancel:"Cancel")))},isRunningInJest=function(){return typeof process<"u"&&{}.JEST_WORKER_ID!==void 0},PageThumbnail=function(t){var n=t.canvas,a=t.page,r=t.pageHeight,e=t.pageIndex,p=t.pageWidth,k=t.rotation,E=t.onLoad,b=core$9.useIsMounted(),R=React__namespace$8.useRef(),S=React__namespace$8.useState(""),A=S[0],y=S[1],_=React__namespace$8.useMemo(function(){return isRunningInJest()},[]),h=function(){_||E()};return React__namespace$8.useEffect(function(){var l=R.current;l&&l.cancel();var o=150/72;n.height=Math.floor(r*o),n.width=Math.floor(p*o);var s=n.getContext("2d");s.save(),s.fillStyle="rgb(255, 255, 255)",s.fillRect(0,0,n.width,n.height),s.restore();var f=a.getViewport({rotation:k,scale:1});R.current=a.render({canvasContext:s,intent:"print",transform:[o,0,0,o,0,0],viewport:f}),R.current.promise.then(function(){"toBlob"in n&&"createObjectURL"in URL?n.toBlob(function(g){b.current&&y(URL.createObjectURL(g)),_&&E()}):(b.current&&y(n.toDataURL()),_&&E())},function(){})},[]),A&&React__namespace$8.createElement("div",{className:"rpv-print__page"},React__namespace$8.createElement("img",{"data-testid":"print__thumbnail-".concat(e),src:A,onLoad:h}))},PageThumbnailContainer=function(t){var n=t.canvas,a=t.doc,r=t.pageIndex,e=t.pageRotation,p=t.pageSize,k=t.rotation,E=t.shouldRender,b=t.onLoad,R=core$9.useIsMounted(),S=React__namespace$8.useState(null),A=S[0],y=S[1],_=Math.abs(k+e)%180===0;React__namespace$8.useEffect(function(){E&&core$9.getPage(a,r).then(function(l){R.current&&y(l)})},[E]);var h=(p.rotation+k+e)%360;return A&&React__namespace$8.createElement(PageThumbnail,{canvas:n,page:A,pageHeight:_?p.pageHeight:p.pageWidth,pageIndex:r,pageWidth:_?p.pageWidth:p.pageHeight,rotation:h,onLoad:b})},PrintZone=function(t){var n=t.doc,a=t.numLoadedPages,r=t.pagesRotation,e=t.pageSizes,p=t.printPages,k=t.printStatus,E=t.rotation,b=t.onCancel,R=t.onLoad,S=React__namespace$8.useMemo(function(){return document.createElement("canvas")},[]),A=React__namespace$8.useMemo(function(){var h=document.querySelector(".rpv-print__zone");if(h)return h;var l=document.createElement("div");return l.classList.add("rpv-print__zone"),l.setAttribute("data-testid","print__zone"),document.body.appendChild(l),l},[]);React__namespace$8.useEffect(function(){k===PrintStatus.Ready&&(document.documentElement.classList.add("rpv-print__html-printing"),document.body.classList.add("rpv-print__body-printing"),window.print());var h=function(){if(k===PrintStatus.Ready){document.documentElement.classList.remove("rpv-print__html-printing"),document.body.classList.remove("rpv-print__body-printing");var l=document.querySelectorAll(".rpv-print__zone");l&&l.forEach(function(o){o.parentElement.removeChild(o)}),S.height=0,S.width=0,document.removeEventListener("mousemove",h),b()}};return document.addEventListener("mousemove",h),function(){return document.removeEventListener("mousemove",h)}},[k]);var y=e[0].pageHeight,_=e[0].pageWidth;return reactDom.createPortal(React__namespace$8.createElement(React__namespace$8.Fragment,null,p.map(function(h,l){return React__namespace$8.createElement(PageThumbnailContainer,{key:h,canvas:S,doc:n,pageIndex:h,pageRotation:r.has(h)?r.get(h):0,pageSize:e[h],rotation:E,shouldRender:l===a,onLoad:R})}),React__namespace$8.createElement("style",{dangerouslySetInnerHTML:{__html:"@page { size: ".concat(_,"pt ").concat(y,"pt }")}})),A)},PrintContainer=function(t){var n=t.doc,a=t.pagesRotation,r=t.pageSizes,e=t.renderProgressBar,p=t.rotation,k=t.setPages,E=t.store,b=React__namespace$8.useState(PrintStatus.Inactive),R=b[0],S=b[1],A=React__namespace$8.useState(0),y=A[0],_=A[1],h=React__namespace$8.useMemo(function(){var g=n.numPages;return k(n).filter(function(v){return v>=0&&v<g})},[n,k]),l=h.length,o=function(){_(0),S(PrintStatus.Inactive)},s=function(g){return S(g)},f=function(){var g=y+1;g<=l&&(_(g),g===l&&S(PrintStatus.Ready))};return React__namespace$8.useEffect(function(){return E.subscribe("printStatus",s),function(){E.unsubscribe("printStatus",s)}},[]),React__namespace$8.createElement(React__namespace$8.Fragment,null,R===PrintStatus.CheckingPermission&&React__namespace$8.createElement(CheckPrintPermission,{doc:n,store:E}),R===PrintStatus.Preparing&&(e?e(y,l,o):React__namespace$8.createElement(PrintProgress,{numLoadedPages:y,numPages:l,onCancel:o})),(R===PrintStatus.Preparing||R===PrintStatus.Ready)&&y<=l&&React__namespace$8.createElement(PrintZone,{doc:n,numLoadedPages:y,pagesRotation:a,pageSizes:r,printPages:h,printStatus:R,rotation:p,onCancel:o,onLoad:f}))},PrintMenuItem=function(t){var n=t.onClick,a=React__namespace$8.useContext(core$9.LocalizationContext).l10n,r=a&&a.print?a.print.print:"Print";return React__namespace$8.createElement(core$9.MenuItem,{icon:React__namespace$8.createElement(PrintIcon,null),testId:"print__menu",onClick:n},r)},ShortcutHandler$2=function(t){var n=t.containerRef,a=t.store,r=function(e){if(!(e.shiftKey||e.altKey||e.key!=="p")){var p=core$9.isMac()?e.metaKey:e.ctrlKey;if(p){var k=n.current;!k||!document.activeElement||!k.contains(document.activeElement)||(e.preventDefault(),a.update("printStatus",PrintStatus.Preparing))}}};return React__namespace$8.useEffect(function(){var e=n.current;if(e)return document.addEventListener("keydown",r),function(){document.removeEventListener("keydown",r)}},[n.current]),React__namespace$8.createElement(React__namespace$8.Fragment,null)},printPlugin=function(t){var n=React__namespace$8.useMemo(function(){return Object.assign({},{enableShortcuts:!0,setPages:function(R){return Array(R.numPages).fill(0).map(function(S,A){return A})}},t)},[]),a=React__namespace$8.useMemo(function(){return core$9.createStore({printStatus:PrintStatus.Inactive})},[]),r=function(){a.update("printStatus",PrintStatus.CheckingPermission)},e=function(R){return React__namespace$8.createElement(Print,__assign$8({enableShortcuts:n.enableShortcuts},R,{store:a}))},p=function(){return React__namespace$8.createElement(e,null,function(R){return React__namespace$8.createElement(PrintButton,__assign$8({},R))})},k=function(R){return React__namespace$8.createElement(e,null,function(S){return React__namespace$8.createElement(PrintMenuItem,{onClick:function(){S.onClick(),R.onClick()}})})},E=function(R){var S=R.slot,A={children:React__namespace$8.createElement(React__namespace$8.Fragment,null,n.enableShortcuts&&React__namespace$8.createElement(ShortcutHandler$2,{containerRef:R.containerRef,store:a}),React__namespace$8.createElement(PrintContainer,{doc:R.doc,pagesRotation:R.pagesRotation,pageSizes:R.pageSizes,renderProgressBar:t==null?void 0:t.renderProgressBar,rotation:R.rotation,setPages:n.setPages,store:a}),S.children)};return __assign$8(__assign$8({},S),A)},b=function(R){n.setPages=R};return{print:r,renderViewer:E,Print:e,PrintButton:p,PrintMenuItem:k,setPages:b}};print$2.PrintIcon=PrintIcon;print$2.getAllPagesNumbers=getAllPagesNumbers;print$2.getCustomPagesNumbers=getCustomPagesNumbers;print$2.getEvenPagesNumbers=getEvenPagesNumbers;print$2.getOddPagesNumbers=getOddPagesNumbers;print$2.printPlugin=printPlugin;/** * A React component to view a PDF document * * @see https://react-pdf-viewer.dev * @license https://react-pdf-viewer.dev/license * @copyright 2019-2022 Nguyen Huu Phuoc <me@phuoc.ng> */lib$6.exports=print$2;var libExports$8=lib$6.exports,lib$5={exports:{}},properties$2={},core$8=libExports$h,React$7=reactExports;function _interopNamespaceDefault$7(t){var n=Object.create(null);return t&&Object.keys(t).forEach(function(a){if(a!=="default"){var r=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(n,a,r.get?r:{enumerable:!0,get:function(){return t[a]}})}}),n.default=t,Object.freeze(n)}var React__namespace$7=_interopNamespaceDefault$7(React$7),InfoIcon=function(){return React__namespace$7.createElement(core$8.Icon,{size:16},React__namespace$7.createElement("path",{d:`M12,1.001c6.075,0,11,4.925,11,11s-4.925,11-11,11s-11-4.925-11-11S5.925,1.001,12,1.001z M14.5,17.005H13 c-0.552,0-1-0.448-1-1v-6.5c0-0.276-0.224-0.5-0.5-0.5H10 M11.745,6.504L11.745,6.504 M11.745,6.5c-0.138,0-0.25,0.112-0.25,0.25 S11.607,7,11.745,7s0.25-0.112,0.25-0.25S11.883,6.5,11.745,6.5`}))},__assign$7=function(){return __assign$7=Object.assign||function(n){for(var a,r=1,e=arguments.length;r<e;r++){a=arguments[r];for(var p in a)Object.prototype.hasOwnProperty.call(a,p)&&(n[p]=a[p])}return n},__assign$7.apply(this,arguments)},PropertiesLoader=function(t){var n=t.doc,a=t.render,r=React__namespace$7.useState(),e=r[0],p=r[1];return React__namespace$7.useEffect(function(){n.getMetadata().then(function(k){return Promise.resolve(k)}).then(function(k){return n.getDownloadInfo().then(function(E){return Promise.resolve({fileName:k.contentDispositionFilename||"",info:k.info,length:E.length})})}).then(function(k){p(k)})},[]),e?a(e):React__namespace$7.createElement("div",{className:"rpv-properties__loader"},React__namespace$7.createElement(core$8.Spinner,null))},PropertyItem=function(t){var n=t.label,a=t.value,r=React__namespace$7.useContext(core$8.ThemeContext).direction,e=r===core$8.TextDirection.RightToLeft;return React__namespace$7.createElement("dl",{className:core$8.classNames({"rpv-properties__item":!0,"rpv-properties__item--rtl":e})},React__namespace$7.createElement("dt",{className:"rpv-properties__item-label"},n,":"),React__namespace$7.createElement("dd",{className:"rpv-properties__item-value"},a||"-"))},dateRegex=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"),parse=function(t,n,a,r){var e=parseInt(t,10);return e>=n&&e<=a?e:r},convertDate=function(t){var n=dateRegex.exec(t);if(!n)return null;var a=parseInt(n[1],10),r=parse(n[2],1,12,1)-1,e=parse(n[3],1,31,1),p=parse(n[4],0,23,0),k=parse(n[5],0,59,0),E=parse(n[6],0,59,0),b=n[7]||"Z",R=parse(n[8],0,23,0),S=parse(n[9],0,59,0);switch(b){case"-":p+=R,k+=S;break;case"+":p-=R,k-=S;break}return new Date(Date.UTC(a,r,e,p,k,E))},getFileName=function(t){var n=t.split("/").pop();return n?n.split("#")[0].split("?")[0]:t},getFileSize=function(t){var n=["B","kB","MB","GB","TB"],a=Math.floor(Math.log(t)/Math.log(1024));return"".concat((t/Math.pow(1024,a)).toFixed(2)," ").concat(n[a])},PropertiesModal=function(t){var n=t.doc,a=t.fileName,r=t.onToggle,e=React__namespace$7.useContext(core$8.LocalizationContext).l10n,p=function(E){var b=convertDate(E);return b?"".concat(b.toLocaleDateString(),", ").concat(b.toLocaleTimeString()):""},k=function(E){return React__namespace$7.createElement(React__namespace$7.Fragment,null,React__namespace$7.createElement("div",{className:"rpv-properties__modal-section"},React__namespace$7.createElement(PropertyItem,{label:e&&e.properties?e.properties.fileName:"File name",value:E.fileName||getFileName(a)}),React__namespace$7.createElement(PropertyItem,{label:e&&e.properties?e.properties.fileSize:"File size",value:getFileSize(E.length)})),React__namespace$7.createElement(core$8.Separator,null),React__namespace$7.createElement("div",{className:"rpv-properties__modal-section"},React__namespace$7.createElement(PropertyItem,{label:e&&e.properties?e.properties.title:"Title",value:E.info.Title}),React__namespace$7.createElement(PropertyItem,{label:e&&e.properties?e.properties.author:"Author",value:E.info.Author}),React__namespace$7.createElement(PropertyItem,{label:e&&e.properties?e.properties.subject:"Subject",value:E.info.Subject}),React__namespace$7.createElement(PropertyItem,{label:e&&e.properties?e.properties.keywords:"Keywords",value:E.info.Keywords}),React__namespace$7.createElement(PropertyItem,{label:e&&e.properties?e.properties.creator:"Creator",value:E.info.Creator}),React__namespace$7.createElement(PropertyItem,{label:e&&e.properties?e.properties.creationDate:"Creation date",value:p(E.info.CreationDate)}),React__namespace$7.createElement(PropertyItem,{label:e&&e.properties?e.properties.modificationDate:"Modification date",value:p(E.info.ModDate)})),React__namespace$7.createElement(core$8.Separator,null),React__namespace$7.createElement("div",{className:"rpv-properties__modal-section"},React__namespace$7.createElement(PropertyItem,{label:e&&e.properties?e.properties.pdfProducer:"PDF producer",value:E.info.Producer}),React__namespace$7.createElement(PropertyItem,{label:e&&e.properties?e.properties.pdfVersion:"PDF version",value:E.info.PDFFormatVersion}),React__namespace$7.createElement(PropertyItem,{label:e&&e.properties?e.properties.pageCount:"Page count",value:"".concat(n.numPages)})))};return React__namespace$7.createElement("div",{className:"rpv-properties__modal"},React__namespace$7.createElement(PropertiesLoader,{doc:n,render:k}),React__namespace$7.createElement("div",{className:"rpv-properties__modal-footer"},React__namespace$7.createElement(core$8.Button,{onClick:r},e&&e.properties?e.properties.close:"Close")))},TOOLTIP_OFFSET$6={left:0,top:8},ShowPropertiesButton=function(t){var n=t.onClick,a=React__namespace$7.useContext(core$8.LocalizationContext).l10n,r=a&&a.properties?a.properties.showProperties:"Show properties";return React__namespace$7.createElement(core$8.Tooltip,{ariaControlsSuffix:"properties",position:core$8.Position.BottomCenter,target:React__namespace$7.createElement(core$8.MinimalButton,{ariaLabel:r,testId:"properties__button",onClick:n},React__namespace$7.createElement(InfoIcon,null)),content:function(){return r},offset:TOOLTIP_OFFSET$6})},useDocument$1=function(t){var n=React__namespace$7.useState(t.get("doc")),a=n[0],r=n[1],e=function(p){r(p)};return React__namespace$7.useEffect(function(){return t.subscribe("doc",e),function(){t.unsubscribe("doc",e)}},[]),{currentDoc:a}},ShowProperties=function(t){var n=t.children,a=t.store,r=useDocument$1(a).currentDoc,e=a.get("fileName")||"",p=function(E){return React__namespace$7.createElement(ShowPropertiesButton,__assign$7({},E))},k=n||p;return r?React__namespace$7.createElement(core$8.Modal,{ariaControlsSuffix:"properties",target:function(E){return k({onClick:E})},content:function(E){return React__namespace$7.createElement(PropertiesModal,{doc:r,fileName:e,onToggle:E})},closeOnClickOutside:!0,closeOnEscape:!0}):React__namespace$7.createElement(React__namespace$7.Fragment,null)},ShowPropertiesMenuItem=function(t){var n=t.onClick,a=React__namespace$7.useContext(core$8.LocalizationContext).l10n,r=a&&a.properties?a.properties.showProperties:"Show properties";return React__namespace$7.createElement(core$8.MenuItem,{icon:React__namespace$7.createElement(InfoIcon,null),testId:"properties__menu",onClick:n},r)},propertiesPlugin=function(){var t=React__namespace$7.useMemo(function(){return core$8.createStore({fileName:""})},[]),n=function(e){return React__namespace$7.createElement(ShowProperties,__assign$7({},e,{store:t}))},a=function(){return React__namespace$7.createElement(ShowProperties,{store:t})},r=function(e){return React__namespace$7.createElement(n,null,function(p){return React__namespace$7.createElement(ShowPropertiesMenuItem,__assign$7({},p))})};return{onDocumentLoad:function(e){t.update("doc",e.doc)},onViewerStateChange:function(e){return t.update("fileName",e.file.name),e},ShowProperties:n,ShowPropertiesButton:a,ShowPropertiesMenuItem:r}};properties$2.InfoIcon=InfoIcon;properties$2.propertiesPlugin=propertiesPlugin;/** * A React component to view a PDF document * * @see https://react-pdf-viewer.dev * @license https://react-pdf-viewer.dev/license * @copyright 2019-2022 Nguyen Huu Phuoc <me@phuoc.ng> */lib$5.exports=properties$2;var libExports$7=lib$5.exports,lib$4={exports:{}},rotate$2={},core$7=libExports$h,React$6=reactExports;function _interopNamespaceDefault$6(t){var n=Object.create(null);return t&&Object.keys(t).forEach(function(a){if(a!=="default"){var r=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(n,a,r.get?r:{enumerable:!0,get:function(){return t[a]}})}}),n.default=t,Object.freeze(n)}var React__namespace$6=_interopNamespaceDefault$6(React$6),RotateBackwardIcon=function(){return React__namespace$6.createElement(core$7.Icon,{ignoreDirection:!0,size:16},React__namespace$6.createElement("path",{d:`M3.434,10.537c0.141-0.438,0.316-0.864,0.523-1.274 M3.069,14.425C3.023,14.053,3,13.679,3,13.305 c0-0.291,0.014-0.579,0.041-0.863 M4.389,18.111c-0.341-0.539-0.623-1.112-0.843-1.711 M7.163,20.9 c-0.543-0.345-1.048-0.747-1.506-1.2 M10.98,22.248c-0.65-0.074-1.29-0.218-1.909-0.431 M10,4.25h2 c4.987,0.015,9.017,4.069,9.003,9.055c-0.013,4.581-3.456,8.426-8.008,8.945 M13.5,1.75L10,4.25l3.5,2.5`}))},RotateForwardIcon=function(){return React__namespace$6.createElement(core$7.Icon,{ignoreDirection:!0,size:16},React__namespace$6.createElement("path",{d:`M20.566,10.537c-0.141-0.438-0.316-0.864-0.523-1.274 M20.931,14.425C20.977,14.053,21,13.679,21,13.305 c0-0.291-0.014-0.579-0.041-0.863 M19.611,18.111c0.341-0.539,0.624-1.114,0.843-1.713 M16.837,20.9 c0.543-0.345,1.048-0.747,1.506-1.2 M13.02,22.248c0.65-0.074,1.29-0.218,1.909-0.431 M14,4.25h-2 c-4.987,0.015-9.017,4.069-9.003,9.055c0.013,4.581,3.456,8.426,8.008,8.945 M10.5,1.75l3.5,2.5l-3.5,2.5`}))},__assign$6=function(){return __assign$6=Object.assign||function(n){for(var a,r=1,e=arguments.length;r<e;r++){a=arguments[r];for(var p in a)Object.prototype.hasOwnProperty.call(a,p)&&(n[p]=a[p])}return n},__assign$6.apply(this,arguments)},TOOLTIP_OFFSET$5={left:0,top:8},RotateButton=function(t){var n=t.direction,a=t.onClick,r=React__namespace$6.useContext(core$7.LocalizationContext).l10n,e=r&&r.rotate?r.rotate.rotateBackward:"Rotate counterclockwise",p=r&&r.rotate?r.rotate.rotateForward:"Rotate clockwise",k=n===core$7.RotateDirection.Backward?e:p,E=n===core$7.RotateDirection.Backward?React__namespace$6.createElement(RotateBackwardIcon,null):React__namespace$6.createElement(RotateForwardIcon,null);return React__namespace$6.createElement(core$7.Tooltip,{ariaControlsSuffix:"rotate",position:core$7.Position.BottomCenter,target:React__namespace$6.createElement(core$7.MinimalButton,{ariaLabel:k,testId:n===core$7.RotateDirection.Backward?"rotate__backward-button":"rotate__forward-button",onClick:a},E),content:function(){return k},offset:TOOLTIP_OFFSET$5})},Rotate=function(t){var n=t.children,a=t.direction,r=t.store,e=function(){var E=r.get("rotate");E&&E(a)},p=function(E){return React__namespace$6.createElement(RotateButton,{direction:E.direction,onClick:E.onClick})},k=n||p;return k({direction:a,onClick:e})},RotateMenuItem=function(t){var n=t.direction,a=t.onClick,r=React__namespace$6.useContext(core$7.LocalizationContext).l10n,e=r&&r.rotate?r.rotate.rotateBackward:"Rotate counterclockwise",p=r&&r.rotate?r.rotate.rotateForward:"Rotate clockwise",k=n===core$7.RotateDirection.Backward?e:p,E=n===core$7.RotateDirection.Backward?React__namespace$6.createElement(RotateBackwardIcon,null):React__namespace$6.createElement(RotateForwardIcon,null);return React__namespace$6.createElement(core$7.MenuItem,{icon:E,testId:n===core$7.RotateDirection.Backward?"rotate__backward-menu":"rotate__forward-menu",onClick:a},k)},RotatePage=function(t){var n=t.children,a=t.store,r=function(e,p){var k=a.get("rotatePage");k&&k(e,p)};return n({onRotatePage:r})},rotatePlugin=function(){var t=React__namespace$6.useMemo(function(){return core$7.createStore()},[]),n=function(E){return React__namespace$6.createElement(Rotate,__assign$6({},E,{store:t}))},a=function(){return React__namespace$6.createElement(n,{direction:core$7.RotateDirection.Backward},function(E){return React__namespace$6.createElement(RotateButton,__assign$6({},E))})},r=function(E){return React__namespace$6.createElement(n,{direction:core$7.RotateDirection.Backward},function(b){return React__namespace$6.createElement(RotateMenuItem,{direction:b.direction,onClick:function(){b.onClick(),E.onClick()}})})},e=function(){return React__namespace$6.createElement(n,{direction:core$7.RotateDirection.Forward},function(E){return React__namespace$6.createElement(RotateButton,__assign$6({},E))})},p=function(E){return React__namespace$6.createElement(n,{direction:core$7.RotateDirection.Forward},function(b){return React__namespace$6.createElement(RotateMenuItem,{direction:b.direction,onClick:function(){b.onClick(),E.onClick()}})})},k=function(E){return React__namespace$6.createElement(RotatePage,__assign$6({},E,{store:t}))};return{install:function(E){t.update("rotate",E.rotate),t.update("rotatePage",E.rotatePage)},Rotate:n,RotateBackwardButton:a,RotateBackwardMenuItem:r,RotateForwardButton:e,RotateForwardMenuItem:p,RotatePage:k}};rotate$2.RotateBackwardIcon=RotateBackwardIcon;rotate$2.RotateForwardIcon=RotateForwardIcon;rotate$2.rotatePlugin=rotatePlugin;/** * A React component to view a PDF document * * @see https://react-pdf-viewer.dev * @license https://react-pdf-viewer.dev/license * @copyright 2019-2022 Nguyen Huu Phuoc <me@phuoc.ng> */lib$4.exports=rotate$2;var libExports$6=lib$4.exports,lib$3={exports:{}},scrollMode$2={},core$6=libExports$h,React$5=reactExports;function _interopNamespaceDefault$5(t){var n=Object.create(null);return t&&Object.keys(t).forEach(function(a){if(a!=="default"){var r=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(n,a,r.get?r:{enumerable:!0,get:function(){return t[a]}})}}),n.default=t,Object.freeze(n)}var React__namespace$5=_interopNamespaceDefault$5(React$5),DualPageCoverViewModeIcon=function(){return React__namespace$5.createElement(core$6.Icon,{size:16},React__namespace$5.createElement("rect",{x:"0.5",y:"0.497",width:"22",height:"22",rx:"1",ry:"1"}),React__namespace$5.createElement("line",{x1:"0.5",y1:"6.497",x2:"22.5",y2:"6.497"}),React__namespace$5.createElement("line",{x1:"11.5",y1:"6.497",x2:"11.5",y2:"22.497"}))},DualPageViewModeIcon=function(){return React__namespace$5.createElement(core$6.Icon,{size:16},React__namespace$5.createElement("rect",{x:"0.5",y:"0.497",width:"22",height:"22",rx:"1",ry:"1"}),React__namespace$5.createElement("line",{x1:"11.5",y1:"0.497",x2:"11.5",y2:"22.497"}))},HorizontalScrollingIcon=function(){return React__namespace$5.createElement(core$6.Icon,{size:16},React__namespace$5.createElement("path",{d:`M6.5,21.5c0,0.552-0.448,1-1,1h-4c-0.552,0-1-0.448-1-1v-20c0-0.552,0.448-1,1-1h4c0.552,0,1,0.448,1,1V21.5z M14.5,21.5c0,0.552-0.448,1-1,1h-4c-0.552,0-1-0.448-1-1v-20c0-0.552,0.448-1,1-1h4c0.552,0,1,0.448,1,1V21.5z M22.5,21.5 c0,0.552-0.448,1-1,1h-4c-0.552,0-1-0.448-1-1v-20c0-0.552,0.448-1,1-1h4c0.552,0,1,0.448,1,1V21.5z`}))},PageScrollingIcon=function(){return React__namespace$5.createElement(core$6.Icon,{size:16},React__namespace$5.createElement("rect",{x:"0.5",y:"0.497",width:"22",height:"22",rx:"1",ry:"1"}))},__assign$5=function(){return __assign$5=Object.assign||function(n){for(var a,r=1,e=arguments.length;r<e;r++){a=arguments[r];for(var p in a)Object.prototype.hasOwnProperty.call(a,p)&&(n[p]=a[p])}return n},__assign$5.apply(this,arguments)},switchScrollMode=function(t,n){t.get("switchScrollMode")(n);var a=t.get("viewMode");(n===core$6.ScrollMode.Horizontal||n===core$6.ScrollMode.Wrapped)&&a!==core$6.ViewMode.SinglePage&&t.get("switchViewMode")(core$6.ViewMode.SinglePage)},VerticalScrollingIcon=function(){return React__namespace$5.createElement(core$6.Icon,{size:16},React__namespace$5.createElement("path",{d:`M23.5,5.5c0,0.552-0.448,1-1,1h-21c-0.552,0-1-0.448-1-1v-3c0-0.552,0.448-1,1-1h21c0.552,0,1,0.448,1,1V5.5z M23.5,13.5c0,0.552-0.448,1-1,1h-21c-0.552,0-1-0.448-1-1v-3c0-0.552,0.448-1,1-1h21c0.552,0,1,0.448,1,1V13.5z M23.5,21.5 c0,0.552-0.448,1-1,1h-21c-0.552,0-1-0.448-1-1v-3c0-0.552,0.448-1,1-1h21c0.552,0,1,0.448,1,1V21.5z`}))},WrappedScrollingIcon=function(){return React__namespace$5.createElement(core$6.Icon,{size:16},React__namespace$5.createElement("path",{d:`M10.5,9.5c0,0.552-0.448,1-1,1h-8c-0.552,0-1-0.448-1-1v-8c0-0.552,0.448-1,1-1h8c0.552,0,1,0.448,1,1V9.5z M23.5,9.5c0,0.552-0.448,1-1,1h-8c-0.552,0-1-0.448-1-1v-8c0-0.552,0.448-1,1-1h8c0.552,0,1,0.448,1,1V9.5z M10.5,22.5 c0,0.552-0.448,1-1,1h-8c-0.552,0-1-0.448-1-1v-8c0-0.552,0.448-1,1-1h8c0.552,0,1,0.448,1,1V22.5z M23.5,22.5c0,0.552-0.448,1-1,1 h-8c-0.552,0-1-0.448-1-1v-8c0-0.552,0.448-1,1-1h8c0.552,0,1,0.448,1,1V22.5z`}))},SwitchScrollModeDecorator=function(t){var n=t.children,a=t.mode,r=t.onClick,e=React__namespace$5.useContext(core$6.LocalizationContext).l10n,p="",k=React__namespace$5.createElement(VerticalScrollingIcon,null);switch(a){case core$6.ScrollMode.Horizontal:p=e&&e.scrollMode?e.scrollMode.horizontalScrolling:"Horizontal scrolling",k=React__namespace$5.createElement(HorizontalScrollingIcon,null);break;case core$6.ScrollMode.Page:p=e&&e.scrollMode?e.scrollMode.pageScrolling:"Page scrolling",k=React__namespace$5.createElement(PageScrollingIcon,null);break;case core$6.ScrollMode.Wrapped:p=e&&e.scrollMode?e.scrollMode.wrappedScrolling:"Wrapped scrolling",k=React__namespace$5.createElement(WrappedScrollingIcon,null);break;case core$6.ScrollMode.Vertical:default:p=e&&e.scrollMode?e.scrollMode.verticalScrolling:"Vertical scrolling",k=React__namespace$5.createElement(VerticalScrollingIcon,null);break}return n({icon:k,label:p,onClick:r})},TOOLTIP_OFFSET$1$1={left:0,top:8},SwitchScrollModeButton=function(t){var n=t.isDisabled,a=t.isSelected,r=t.mode,e=t.onClick,p="";switch(r){case core$6.ScrollMode.Horizontal:p="scroll-mode__horizontal-button";break;case core$6.ScrollMode.Page:p="scroll-mode__page-button";break;case core$6.ScrollMode.Wrapped:p="scroll-mode__wrapped-button";break;case core$6.ScrollMode.Vertical:default:p="scroll-mode__vertical-button";break}return React__namespace$5.createElement(SwitchScrollModeDecorator,{mode:r,onClick:e},function(k){return React__namespace$5.createElement(core$6.Tooltip,{ariaControlsSuffix:"scroll-mode-switch",position:core$6.Position.BottomCenter,target:React__namespace$5.createElement(core$6.MinimalButton,{ariaLabel:k.label,isDisabled:n,isSelected:a,testId:p,onClick:k.onClick},k.icon),content:function(){return k.label},offset:TOOLTIP_OFFSET$1$1})})},useScrollMode=function(t){var n=React__namespace$5.useState(t.get("scrollMode")||core$6.ScrollMode.Vertical),a=n[0],r=n[1],e=function(p){r(p)};return React__namespace$5.useEffect(function(){return t.subscribe("scrollMode",e),function(){t.unsubscribe("scrollMode",e)}},[]),{scrollMode:a}},useViewMode=function(t){var n=React__namespace$5.useState(t.get("viewMode")||core$6.ViewMode.SinglePage),a=n[0],r=n[1],e=function(p){r(p)};return React__namespace$5.useEffect(function(){return t.subscribe("viewMode",e),function(){t.unsubscribe("viewMode",e)}},[]),{viewMode:a}},SwitchScrollMode=function(t){var n=t.children,a=t.mode,r=t.store,e=useViewMode(r).viewMode,p=useScrollMode(r).scrollMode,k=function(){switchScrollMode(r,a)},E=p===a,b=(a===core$6.ScrollMode.Horizontal||a===core$6.ScrollMode.Wrapped)&&e!==core$6.ViewMode.SinglePage,R=function(A){return React__namespace$5.createElement(SwitchScrollModeButton,{isDisabled:b,isSelected:E,mode:A.mode,onClick:A.onClick})},S=n||R;return S({isDisabled:b,isSelected:E,mode:a,onClick:k})},SwitchScrollModeMenuItem=function(t){var n=t.isDisabled,a=t.isSelected,r=t.mode,e=t.onClick,p="";switch(r){case core$6.ScrollMode.Horizontal:p="scroll-mode__horizontal-menu";break;case core$6.ScrollMode.Page:p="scroll-mode__page-menu";break;case core$6.ScrollMode.Wrapped:p="scroll-mode__wrapped-menu";break;case core$6.ScrollMode.Vertical:default:p="scroll-mode__vertical-menu";break}return React__namespace$5.createElement(SwitchScrollModeDecorator,{mode:r,onClick:e},function(k){return React__namespace$5.createElement(core$6.MenuItem,{checked:a,icon:k.icon,isDisabled:n,testId:p,onClick:k.onClick},k.label)})},switchViewMode=function(t,n){t.get("switchViewMode")(n);var a=t.get("scrollMode");(a===core$6.ScrollMode.Horizontal||a===core$6.ScrollMode.Wrapped)&&n!==core$6.ViewMode.SinglePage&&t.get("switchScrollMode")(core$6.ScrollMode.Vertical)},SwitchViewModeDecorator=function(t){var n=t.children,a=t.mode,r=t.onClick,e=React__namespace$5.useContext(core$6.LocalizationContext).l10n,p="",k=React__namespace$5.createElement(PageScrollingIcon,null);switch(a){case core$6.ViewMode.DualPage:p=e&&e.scrollMode?e.scrollMode.dualPage:"Dual page",k=React__namespace$5.createElement(DualPageViewModeIcon,null);break;case core$6.ViewMode.DualPageWithCover:p=e&&e.scrollMode?e.scrollMode.dualPageCover:"Dual page with cover",k=React__namespace$5.createElement(DualPageCoverViewModeIcon,null);break;case core$6.ViewMode.SinglePage:default:p=e&&e.scrollMode?e.scrollMode.singlePage:"Single page",k=React__namespace$5.createElement(PageScrollingIcon,null);break}return n({icon:k,label:p,onClick:r})},TOOLTIP_OFFSET$4={left:0,top:8},SwitchViewModeButton=function(t){var n=t.isDisabled,a=t.isSelected,r=t.mode,e=t.onClick,p="";switch(r){case core$6.ViewMode.DualPage:p="view-mode__dual-button";break;case core$6.ViewMode.DualPageWithCover:p="view-mode__dual-cover-button";break;case core$6.ViewMode.SinglePage:default:p="view-mode__single-button";break}return React__namespace$5.createElement(SwitchViewModeDecorator,{mode:r,onClick:e},function(k){return React__namespace$5.createElement(core$6.Tooltip,{ariaControlsSuffix:"view-mode-switch",position:core$6.Position.BottomCenter,target:React__namespace$5.createElement(core$6.MinimalButton,{ariaLabel:k.label,isDisabled:n,isSelected:a,testId:p,onClick:k.onClick},k.icon),content:function(){return k.label},offset:TOOLTIP_OFFSET$4})})},SwitchViewMode=function(t){var n=t.children,a=t.mode,r=t.store,e=useViewMode(r).viewMode,p=useScrollMode(r).scrollMode,k=function(){switchViewMode(r,a)},E=e===a,b=(p===core$6.ScrollMode.Horizontal||p===core$6.ScrollMode.Wrapped)&&a!==core$6.ViewMode.SinglePage,R=function(A){return React__namespace$5.createElement(SwitchViewModeButton,{isDisabled:b,isSelected:E,mode:A.mode,onClick:A.onClick})},S=n||R;return S({isDisabled:b,isSelected:E,mode:a,onClick:k})},SwitchViewModeMenuItem=function(t){var n=t.isDisabled,a=t.isSelected,r=t.mode,e=t.onClick,p="";switch(r){case core$6.ViewMode.DualPage:p="view-mode__dual-menu";break;case core$6.ViewMode.DualPageWithCover:p="view-mode__dual-cover-menu";break;case core$6.ViewMode.SinglePage:default:p="view-mode__single-menu";break}return React__namespace$5.createElement(SwitchViewModeDecorator,{mode:r,onClick:e},function(k){return React__namespace$5.createElement(core$6.MenuItem,{checked:a,icon:k.icon,isDisabled:n,testId:p,onClick:k.onClick},k.label)})},scrollModePlugin=function(){var t=React__namespace$5.useMemo(function(){return core$6.createStore({scrollMode:core$6.ScrollMode.Vertical,viewMode:core$6.ViewMode.SinglePage,switchScrollMode:function(){},switchViewMode:function(){}})},[]),n=function(E){return React__namespace$5.createElement(SwitchScrollMode,__assign$5({},E,{store:t}))},a=function(E){return React__namespace$5.createElement(n,{mode:E.mode},function(b){return React__namespace$5.createElement(SwitchScrollModeButton,{isDisabled:b.isDisabled,isSelected:b.isSelected,mode:b.mode,onClick:function(){b.onClick()}})})},r=function(E){return React__namespace$5.createElement(n,{mode:E.mode},function(b){return React__namespace$5.createElement(SwitchScrollModeMenuItem,{isDisabled:b.isDisabled,isSelected:b.isSelected,mode:b.mode,onClick:function(){b.onClick(),E.onClick()}})})},e=function(E){return React__namespace$5.createElement(SwitchViewMode,__assign$5({},E,{store:t}))},p=function(E){return React__namespace$5.createElement(e,{mode:E.mode},function(b){return React__namespace$5.createElement(SwitchViewModeButton,{isDisabled:b.isDisabled,isSelected:b.isSelected,mode:b.mode,onClick:function(){b.onClick()}})})},k=function(E){return React__namespace$5.createElement(e,{mode:E.mode},function(b){return React__namespace$5.createElement(SwitchViewModeMenuItem,{isDisabled:b.isDisabled,isSelected:b.isSelected,mode:b.mode,onClick:function(){b.onClick(),E.onClick()}})})};return{install:function(E){t.update("switchScrollMode",E.switchScrollMode),t.update("switchViewMode",E.switchViewMode)},onViewerStateChange:function(E){return t.update("scrollMode",E.scrollMode),t.update("viewMode",E.viewMode),E},switchScrollMode:function(E){switchScrollMode(t,E)},switchViewMode:function(E){switchViewMode(t,E)},SwitchScrollMode:n,SwitchScrollModeButton:a,SwitchScrollModeMenuItem:r,SwitchViewMode:e,SwitchViewModeButton:p,SwitchViewModeMenuItem:k}};scrollMode$2.DualPageCoverViewModeIcon=DualPageCoverViewModeIcon;scrollMode$2.DualPageViewModeIcon=DualPageViewModeIcon;scrollMode$2.HorizontalScrollingIcon=HorizontalScrollingIcon;scrollMode$2.PageScrollingIcon=PageScrollingIcon;scrollMode$2.VerticalScrollingIcon=VerticalScrollingIcon;scrollMode$2.WrappedScrollingIcon=WrappedScrollingIcon;scrollMode$2.scrollModePlugin=scrollModePlugin;/** * A React component to view a PDF document * * @see https://react-pdf-viewer.dev * @license https://react-pdf-viewer.dev/license * @copyright 2019-2022 Nguyen Huu Phuoc <me@phuoc.ng> */lib$3.exports=scrollMode$2;var libExports$5=lib$3.exports,lib$2={exports:{}},search$2={},core$5=libExports$h,React$4=reactExports;function _interopNamespaceDefault$4(t){var n=Object.create(null);return t&&Object.keys(t).forEach(function(a){if(a!=="default"){var r=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(n,a,r.get?r:{enumerable:!0,get:function(){return t[a]}})}}),n.default=t,Object.freeze(n)}var React__namespace$4=_interopNamespaceDefault$4(React$4),NextIcon=function(){return React__namespace$4.createElement(core$5.Icon,{size:16},React__namespace$4.createElement("path",{d:`M0.541,5.627L11.666,18.2c0.183,0.207,0.499,0.226,0.706,0.043c0.015-0.014,0.03-0.028,0.043-0.043 L23.541,5.627`}))},PreviousIcon=function(){return React__namespace$4.createElement(core$5.Icon,{size:16},React__namespace$4.createElement("path",{d:`M23.535,18.373L12.409,5.8c-0.183-0.207-0.499-0.226-0.706-0.043C11.688,5.77,11.674,5.785,11.66,5.8 L0.535,18.373`}))},SearchIcon=function(){return React__namespace$4.createElement(core$5.Icon,{ignoreDirection:!0,size:16},React__namespace$4.createElement("path",{d:`M10.5,0.5c5.523,0,10,4.477,10,10s-4.477,10-10,10s-10-4.477-10-10S4.977,0.5,10.5,0.5z M23.5,23.5 l-5.929-5.929`}))},__assign$4=function(){return __assign$4=Object.assign||function(n){for(var a,r=1,e=arguments.length;r<e;r++){a=arguments[r];for(var p in a)Object.prototype.hasOwnProperty.call(a,p)&&(n[p]=a[p])}return n},__assign$4.apply(this,arguments)},EMPTY_KEYWORD_REGEXP={keyword:"",regExp:new RegExp(" "),wholeWords:!1},calculateOffset=function(t,n){for(var a=t.offsetTop,r=t.offsetLeft,e=t.parentElement;e&&e!==n;)a+=e.offsetTop,r+=e.offsetLeft,e=e.parentElement;return{left:r,top:a}},getCssProperties=function(t){return{left:"".concat(t.left,"%"),top:"".concat(t.top,"%"),height:"".concat(t.height,"%"),width:"".concat(t.width,"%")}},HightlightItem=function(t){var n=t.index,a=t.area,r=t.onHighlightKeyword,e=React__namespace$4.useRef();return core$5.useIsomorphicLayoutEffect(function(){var p=e.current;r&&p&&r({highlightEle:p,keyword:a.keyword})},[]),React__namespace$4.createElement("div",{className:"rpv-search__highlight","data-index":n,ref:e,style:getCssProperties(a),title:a.keywordStr.trim()})},removeNode=function(t){var n=t.parentNode;n&&n.removeChild(t)},replaceNode=function(t,n){removeNode(t);var a=n.parentNode;a&&a.insertBefore(t,n),removeNode(n)},unwrap=function(t){var n=t.parentNode;if(n){var a=document.createRange();a.selectNodeContents(t),replaceNode(a.extractContents(),t),n.normalize()}},sortHighlightPosition=function(t,n){return t.top<n.top?-1:t.top>n.top?1:t.left<n.left?-1:t.left>n.left?1:0},Highlights=function(t){var n=t.numPages,a=t.pageIndex,r=t.renderHighlights,e=t.store,p=t.onHighlightKeyword,k=React__namespace$4.useRef(),E=React__namespace$4.useCallback(function(le){return React__namespace$4.createElement(React__namespace$4.Fragment,null,le.highlightAreas.map(function(ie,fe){return React__namespace$4.createElement(HightlightItem,{index:fe,key:fe,area:ie,onHighlightKeyword:p})}))},[]),b=r||E,R=React__namespace$4.useState(e.get("matchPosition")),S=R[0],A=R[1],y=React__namespace$4.useState(e.get("keyword")||[EMPTY_KEYWORD_REGEXP]),_=y[0],h=y[1],l=React__namespace$4.useState({pageIndex:a,scale:1,status:core$5.LayerRenderStatus.PreRender}),o=l[0],s=l[1],f=React__namespace$4.useRef(null),g=React__namespace$4.useRef([]),v=React__namespace$4.useState([]),c=v[0],d=v[1],x=function(){return!0},L=React__namespace$4.useCallback(function(){return e.get("targetPageFilter")||x},[e.get("targetPageFilter")]),X=function(le,ie,fe,_e,oe){var Me=document.createRange(),xe=_e.firstChild;if(!xe||xe.nodeType!==Node.TEXT_NODE)return null;var K=xe.textContent.length,T=oe[0].charIndexInSpan,P=oe.length===1?T:oe[oe.length-1].charIndexInSpan;if(T>K||P+1>K)return null;Me.setStart(xe,T),Me.setEnd(xe,P+1);var $=document.createElement("span");Me.surroundContents($);var Y=$.getBoundingClientRect(),J=fe.getBoundingClientRect(),te=J.height,he=J.width,ve=100*(Y.left-J.left)/he,Ne=100*(Y.top-J.top)/te,Se=100*Y.height/te,je=100*Y.width/he;return unwrap($),{keyword:ie,keywordStr:le,numPages:n,pageIndex:a,left:ve,top:Ne,height:Se,width:je,pageHeight:te,pageWidth:he}},N=function(le){var ie=g.current;if(ie.length===0)return[];var fe=[],_e=[].slice.call(le.querySelectorAll(".rpv-core__text-layer-text")),oe=ie.map(function(Me){return Me.char}).join("");return _.forEach(function(Me){var xe=Me.keyword;if(xe.trim()){for(var K=Me.regExp.flags.indexOf("g")===-1?new RegExp(Me.regExp,"".concat(Me.regExp.flags,"g")):Me.regExp,T,P=[];(T=K.exec(oe))!==null;)P.push({keyword:K,startIndex:T.index,endIndex:K.lastIndex});P.map(function($){return{keyword:$.keyword,indexes:ie.slice($.startIndex,$.endIndex)}}).forEach(function($){var Y=$.indexes.reduce(function(J,te){return J[te.spanIndex]=(J[te.spanIndex]||[]).concat([te]),J},{});Object.values(Y).forEach(function(J){if(J.length!==1||J[0].char.trim()!==""){var te=Me.wholeWords?J.slice(1,-1):J,he=X(xe,$.keyword,le,_e[te[0].spanIndex],te);he&&fe.push(he)}})})}}),fe.sort(sortHighlightPosition)},D=function(le){le&&le.length>0&&h(le)},se=function(le){return A(le)},Ae=function(le){if(le.has(a)){var ie=le.get(a);ie&&s({ele:ie.ele,pageIndex:a,scale:ie.scale,status:ie.status})}},Te=function(){return _.length===0||_.length===1&&_[0].keyword.trim()===""};return React__namespace$4.useEffect(function(){if(!(Te()||o.status!==core$5.LayerRenderStatus.DidRender||g.current.length)){var le=o.ele,ie=[].slice.call(le.querySelectorAll(".rpv-core__text-layer-text")),fe=ie.map(function(_e){return _e.textContent}).reduce(function(_e,oe,Me){return _e.concat(oe.split("").map(function(xe,K){return{char:xe,charIndexInSpan:K,spanIndex:Me}}))},[{char:"",charIndexInSpan:0,spanIndex:0}]).slice(1);g.current=fe}},[_,o.status]),React__namespace$4.useEffect(function(){if(!(Te()||!o.ele||o.status!==core$5.LayerRenderStatus.DidRender||!L()({pageIndex:a,numPages:n}))){var le=o.ele,ie=N(le);d(ie)}},[_,S,o.status,g.current]),React__namespace$4.useEffect(function(){Te()&&o.ele&&o.status===core$5.LayerRenderStatus.DidRender&&d([])},[_,o.status]),React__namespace$4.useEffect(function(){if(c.length!==0){var le=k.current;if(!(S.pageIndex!==a||!le||o.status!==core$5.LayerRenderStatus.DidRender)){var ie=le.querySelector('.rpv-search__highlight[data-index="'.concat(S.matchIndex,'"]'));if(ie){var fe=calculateOffset(ie,le),_e=fe.left,oe=fe.top,Me=e.get("jumpToDestination");Me&&(Me(a,(le.getBoundingClientRect().height-oe)/o.scale,_e/o.scale,o.scale),f.current&&f.current.classList.remove("rpv-search__highlight--current"),f.current=ie,ie.classList.add("rpv-search__highlight--current"))}}}},[c,S]),React__namespace$4.useEffect(function(){return e.subscribe("keyword",D),e.subscribe("matchPosition",se),e.subscribe("renderStatus",Ae),function(){e.unsubscribe("keyword",D),e.unsubscribe("matchPosition",se),e.unsubscribe("renderStatus",Ae)}},[]),React__namespace$4.createElement("div",{className:"rpv-search__highlights","data-testid":"search__highlights-".concat(a),ref:k},b({getCssProperties,highlightAreas:c}))},escapeRegExp=function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},normalizeFlagKeyword=function(t){var n=t.wholeWords?" ".concat(t.keyword," "):t.keyword,a=t.matchCase?"g":"gi";return{keyword:t.keyword,regExp:new RegExp(escapeRegExp(n),a),wholeWords:t.wholeWords||!1}},normalizeSingleKeyword=function(t,n,a){return t instanceof RegExp?{keyword:t.source,regExp:t,wholeWords:a||!1}:typeof t=="string"?t===""?EMPTY_KEYWORD_REGEXP:normalizeFlagKeyword({keyword:t,matchCase:n||!1,wholeWords:a||!1}):(typeof n<"u"&&(t.matchCase=n),typeof a<"u"&&(t.wholeWords=a),normalizeFlagKeyword(t))},useDocument=function(t){var n=React__namespace$4.useRef(t.get("doc")),a=function(r){n.current=r};return React__namespace$4.useEffect(function(){return t.subscribe("doc",a),function(){t.unsubscribe("doc",a)}},[]),n},useSearch=function(t){var n=t.get("initialKeyword"),a=React__namespace$4.useMemo(function(){if(n&&n.length===1){var oe=normalizeSingleKeyword(n[0]);return{matchCase:oe.regExp.flags.indexOf("i")===-1,wholeWords:oe.wholeWords}}else return{matchCase:!1,wholeWords:!1}},[]),r=useDocument(t),e=React__namespace$4.useState(n),p=e[0],k=e[1],E=React__namespace$4.useState([]),b=E[0],R=E[1],S=React__namespace$4.useState(0),A=S[0],y=S[1],_=React__namespace$4.useState(a.matchCase),h=_[0],l=_[1],o=React__namespace$4.useRef([]),s=React__namespace$4.useState(a.wholeWords),f=s[0],g=s[1],v=function(){return!0},c=React__namespace$4.useCallback(function(){return t.get("targetPageFilter")||v},[t.get("targetPageFilter")]),d=function(oe){l(oe),p.length>0&&_e(p,oe,f)},x=function(oe){g(oe),p.length>0&&_e(p,h,oe)},L=function(oe){var Me=b.length;if(p.length===0||Me===0)return null;var xe=oe===Me+1?1:Math.max(1,Math.min(Me,oe));return y(xe),ie(b[xe-1])},X=function(){return L(A-1)},N=function(){return L(A+1)},D=function(){t.update("keyword",[EMPTY_KEYWORD_REGEXP]),Ae(""),y(0),R([]),l(!1),g(!1)},se=function(){return _e(p,h,f)},Ae=function(oe){return k(oe===""?[]:[oe])},Te=function(oe){t.update("targetPageFilter",oe)},le=function(){var oe=r.current;if(!oe)return Promise.resolve([]);var Me=Array(oe.numPages).fill(0).map(function(xe,K){return core$5.getPage(oe,K).then(function(T){return T.getTextContent()}).then(function(T){var P=T.items.map(function($){return $.str||""}).join("");return Promise.resolve({pageContent:P,pageIndex:K})})});return Promise.all(Me).then(function(xe){return xe.sort(function(K,T){return K.pageIndex-T.pageIndex}),Promise.resolve(xe.map(function(K){return K.pageContent}))})},ie=function(oe){var Me=t.get("jumpToPage");return Me&&Me(oe.pageIndex),t.update("matchPosition",{matchIndex:oe.matchIndex,pageIndex:oe.pageIndex}),oe},fe=function(oe){return oe instanceof RegExp?oe.source:typeof oe=="string"?oe:oe.keyword},_e=function(oe,Me,xe){var K=r.current;if(!K)return Promise.resolve([]);var T=K.numPages,P=oe.map(function($){return normalizeSingleKeyword($,Me,xe)});return t.update("keyword",P),y(0),R([]),new Promise(function($,Y){var J=o.current.length===0?le().then(function(te){return o.current=te,Promise.resolve(te)}):Promise.resolve(o.current);J.then(function(te){var he=[];te.forEach(function(ve,Ne){c()({pageIndex:Ne,numPages:T})&&P.forEach(function(Se){for(var je=0,Ie;(Ie=Se.regExp.exec(ve))!==null;)he.push({keyword:Se.regExp,matchIndex:je,pageIndex:Ne,pageText:ve,startIndex:Ie.index,endIndex:Se.regExp.lastIndex}),je++})}),R(he),he.length>0&&(y(1),ie(he[0])),$(he)})})};return React__namespace$4.useEffect(function(){o.current=[]},[r.current]),{clearKeyword:D,changeMatchCase:d,changeWholeWords:x,currentMatch:A,jumpToMatch:L,jumpToNextMatch:N,jumpToPreviousMatch:X,keywords:p,matchCase:h,numberOfMatches:b.length,wholeWords:f,search:se,searchFor:_e,setKeywords:k,keyword:p.length===0?"":fe(p[0]),setKeyword:Ae,setTargetPages:Te}},Search=function(t){var n=t.children,a=t.store,r=useSearch(a),e=React__namespace$4.useState(!1),p=e[0],k=e[1],E=function(b){return k(!0)};return React__namespace$4.useEffect(function(){return a.subscribe("doc",E),function(){a.unsubscribe("doc",E)}},[]),n(__assign$4(__assign$4({},r),{isDocumentLoaded:p}))},ShortcutHandler$1=function(t){var n=t.containerRef,a=t.store,r=React__namespace$4.useRef(!1),e=function(){r.current=!0},p=function(){r.current=!1},k=function(E){var b=n.current;if(b&&!(E.shiftKey||E.altKey||E.key!=="f")){var R=core$5.isMac()?E.metaKey&&!E.ctrlKey:E.ctrlKey;R&&(r.current||document.activeElement&&b.contains(document.activeElement))&&(E.preventDefault(),a.update("areShortcutsPressed",!0))}};return React__namespace$4.useEffect(function(){var E=n.current;if(E)return document.addEventListener("keydown",k),E.addEventListener("mouseenter",e),E.addEventListener("mouseleave",p),function(){document.removeEventListener("keydown",k),E.removeEventListener("mouseenter",e),E.removeEventListener("mouseleave",p)}},[n.current]),React__namespace$4.createElement(React__namespace$4.Fragment,null)},PORTAL_OFFSET$1$1={left:0,top:8},SearchPopover=function(t){var n=t.store,a=t.onToggle,r=React__namespace$4.useContext(core$5.LocalizationContext).l10n,e=React__namespace$4.useContext(core$5.ThemeContext).direction,p=React__namespace$4.useState(!1),k=p[0],E=p[1],b=React__namespace$4.useState(!1),R=b[0],S=b[1],A=e===core$5.TextDirection.RightToLeft,y=useSearch(n),_=y.clearKeyword,h=y.changeMatchCase,l=y.changeWholeWords,o=y.currentMatch,s=y.jumpToNextMatch,f=y.jumpToPreviousMatch,g=y.keyword,v=y.matchCase,c=y.numberOfMatches,d=y.wholeWords,x=y.search,L=y.setKeyword,X=function(oe){E(!0),x().then(function(Me){E(!1),S(!0),oe&&oe()})},N=function(oe){oe.key==="Enter"&&g&&(R?s():X())},D=function(oe){S(!1),h(oe.target.checked)},se=function(oe){S(!1),l(oe.target.checked)},Ae=function(){a(),_()},Te=function(oe){S(!1),L(oe)};React__namespace$4.useEffect(function(){var oe=n.get("initialKeyword");oe&&oe.length===1&&g&&X(function(){n.update("initialKeyword",[])})},[]);var le=r&&r.search?r.search.enterToSearch:"Enter to search",ie=r&&r.search?r.search.previousMatch:"Previous match",fe=r&&r.search?r.search.nextMatch:"Next match",_e=r&&r.search?r.search.close:"Close";return React__namespace$4.createElement("div",{className:"rpv-search__popover"},React__namespace$4.createElement("div",{className:"rpv-search__popover-input-counter"},React__namespace$4.createElement(core$5.TextBox,{ariaLabel:le,autoFocus:!0,placeholder:le,type:"text",value:g,onChange:Te,onKeyDown:N}),React__namespace$4.createElement("div",{className:core$5.classNames({"rpv-search__popover-counter":!0,"rpv-search__popover-counter--ltr":!A,"rpv-search__popover-counter--rtl":A})},k&&React__namespace$4.createElement(core$5.Spinner,{testId:"search__popover-searching",size:"1rem"}),!k&&React__namespace$4.createElement("span",{"data-testid":"search__popover-num-matches"},o,"/",c))),React__namespace$4.createElement("label",{className:"rpv-search__popover-label"},React__namespace$4.createElement("input",{className:"rpv-search__popover-label-checkbox","data-testid":"search__popover-match-case",checked:v,type:"checkbox",onChange:D})," ",r&&r.search?r.search.matchCase:"Match case"),React__namespace$4.createElement("label",{className:"rpv-search__popover-label"},React__namespace$4.createElement("input",{className:"rpv-search__popover-label-checkbox",checked:d,"data-testid":"search__popover-whole-words",type:"checkbox",onChange:se})," ",r&&r.search?r.search.wholeWords:"Whole words"),React__namespace$4.createElement("div",{className:"rpv-search__popover-footer"},React__namespace$4.createElement("div",{className:"rpv-search__popover-footer-item"},React__namespace$4.createElement(core$5.Tooltip,{ariaControlsSuffix:"search-previous-match",position:A?core$5.Position.BottomRight:core$5.Position.BottomCenter,target:React__namespace$4.createElement(core$5.MinimalButton,{ariaLabel:ie,isDisabled:o<=1,onClick:f},React__namespace$4.createElement(PreviousIcon,null)),content:function(){return ie},offset:PORTAL_OFFSET$1$1})),React__namespace$4.createElement("div",{className:"rpv-search__popover-footer-item"},React__namespace$4.createElement(core$5.Tooltip,{ariaControlsSuffix:"search-next-match",position:core$5.Position.BottomCenter,target:React__namespace$4.createElement(core$5.MinimalButton,{ariaLabel:fe,isDisabled:o>c-1,onClick:s},React__namespace$4.createElement(NextIcon,null)),content:function(){return fe},offset:PORTAL_OFFSET$1$1})),React__namespace$4.createElement("div",{className:core$5.classNames({"rpv-search__popover-footer-button":!0,"rpv-search__popover-footer-button--ltr":!A,"rpv-search__popover-footer-button--rtl":A})},React__namespace$4.createElement(core$5.Button,{onClick:Ae},_e))))},ShowSearchPopoverDecorator=function(t){var n=t.children,a=t.onClick,r=React__namespace$4.useContext(core$5.LocalizationContext).l10n,e=r&&r.search?r.search.search:"Search",p=React__namespace$4.createElement(SearchIcon,null);return n({icon:p,label:e,onClick:a})},TOOLTIP_OFFSET$3={left:0,top:8},ShowSearchPopoverButton=function(t){var n=t.enableShortcuts,a=t.store,r=t.onClick,e=n?core$5.isMac()?"Meta+F":"Ctrl+F":"",p=function(k){k&&r()};return React__namespace$4.useEffect(function(){return a.subscribe("areShortcutsPressed",p),function(){a.unsubscribe("areShortcutsPressed",p)}},[]),React__namespace$4.createElement(ShowSearchPopoverDecorator,{onClick:r},function(k){return React__namespace$4.createElement(core$5.Tooltip,{ariaControlsSuffix:"search-popover",position:core$5.Position.BottomCenter,target:React__namespace$4.createElement(core$5.MinimalButton,{ariaKeyShortcuts:e,ariaLabel:k.label,testId:"search__popover-button",onClick:r},k.icon),content:function(){return k.label},offset:TOOLTIP_OFFSET$3})})},PORTAL_OFFSET$2={left:0,top:8},ShowSearchPopover=function(t){var n=t.children,a=t.enableShortcuts,r=t.store,e=React__namespace$4.useContext(core$5.ThemeContext).direction,p=e===core$5.TextDirection.RightToLeft?core$5.Position.BottomRight:core$5.Position.BottomLeft,k=function(b){return React__namespace$4.createElement(ShowSearchPopoverButton,__assign$4({enableShortcuts:a,store:r},b))},E=n||k;return React__namespace$4.createElement(core$5.Popover,{ariaControlsSuffix:"search",lockScroll:!1,position:p,target:function(b){return E({onClick:b})},content:function(b){return React__namespace$4.createElement(SearchPopover,{store:r,onToggle:b})},offset:PORTAL_OFFSET$2,closeOnClickOutside:!1,closeOnEscape:!0})},normalizeKeywords=function(t){return Array.isArray(t)?t.map(function(n){return normalizeSingleKeyword(n)}):[normalizeSingleKeyword(t)]},searchPlugin=function(t){var n=React__namespace$4.useMemo(function(){return Object.assign({},{enableShortcuts:!0,onHighlightKeyword:function(){}},t)},[]),a=React__namespace$4.useMemo(function(){return core$5.createStore({initialKeyword:t&&t.keyword?Array.isArray(t.keyword)?t.keyword:[t.keyword]:[],keyword:t&&t.keyword?normalizeKeywords(t.keyword):[EMPTY_KEYWORD_REGEXP],matchPosition:{matchIndex:-1,pageIndex:-1},renderStatus:new Map})},[]),r=useSearch(a),e=r.clearKeyword,p=r.jumpToMatch,k=r.jumpToNextMatch,E=r.jumpToPreviousMatch,b=r.searchFor,R=r.setKeywords,S=r.setTargetPages,A=function(o){return React__namespace$4.createElement(Search,__assign$4({},o,{store:a}))},y=function(o){return React__namespace$4.createElement(ShowSearchPopover,__assign$4({enableShortcuts:n.enableShortcuts},o,{store:a}))},_=function(){return React__namespace$4.createElement(y,null,function(o){return React__namespace$4.createElement(ShowSearchPopoverButton,__assign$4({enableShortcuts:n.enableShortcuts,store:a},o))})},h=function(o){var s=o.slot;return s.subSlot&&(s.subSlot.children=React__namespace$4.createElement(React__namespace$4.Fragment,null,n.enableShortcuts&&React__namespace$4.createElement(ShortcutHandler$1,{containerRef:o.containerRef,store:a}),s.subSlot.children)),s},l=function(o){return React__namespace$4.createElement(Highlights,{key:o.pageIndex,numPages:o.doc.numPages,pageIndex:o.pageIndex,renderHighlights:t==null?void 0:t.renderHighlights,store:a,onHighlightKeyword:n.onHighlightKeyword})};return{install:function(o){var s=t&&t.keyword?Array.isArray(t.keyword)?t.keyword:[t.keyword]:[],f=t&&t.keyword?normalizeKeywords(t.keyword):[EMPTY_KEYWORD_REGEXP];a.update("initialKeyword",s),a.update("jumpToDestination",o.jumpToDestination),a.update("jumpToPage",o.jumpToPage),a.update("keyword",f)},renderPageLayer:l,renderViewer:h,uninstall:function(o){var s=a.get("renderStatus");s&&s.clear()},onDocumentLoad:function(o){a.update("doc",o.doc)},onTextLayerRender:function(o){var s=a.get("renderStatus");s&&(s=s.set(o.pageIndex,o),a.update("renderStatus",s))},Search:A,ShowSearchPopover:y,ShowSearchPopoverButton:_,clearHighlights:function(){e()},highlight:function(o){var s=Array.isArray(o)?o:[o];return R(s),b(s)},jumpToMatch:p,jumpToNextMatch:k,jumpToPreviousMatch:E,setTargetPages:S}};search$2.NextIcon=NextIcon;search$2.PreviousIcon=PreviousIcon;search$2.SearchIcon=SearchIcon;search$2.searchPlugin=searchPlugin;/** * A React component to view a PDF document * * @see https://react-pdf-viewer.dev * @license https://react-pdf-viewer.dev/license * @copyright 2019-2022 Nguyen Huu Phuoc <me@phuoc.ng> */lib$2.exports=search$2;var libExports$4=lib$2.exports,lib$1={exports:{}},theme$2={},core$4=libExports$h,React$3=reactExports;function _interopNamespaceDefault$3(t){var n=Object.create(null);return t&&Object.keys(t).forEach(function(a){if(a!=="default"){var r=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(n,a,r.get?r:{enumerable:!0,get:function(){return t[a]}})}}),n.default=t,Object.freeze(n)}var React__namespace$3=_interopNamespaceDefault$3(React$3),DarkIcon=function(){return React__namespace$3.createElement(core$4.Icon,{size:16},React__namespace$3.createElement("path",{d:"M19.5,15.106l2.4-2.4a1,1,0,0,0,0-1.414l-2.4-2.4V5.5a1,1,0,0,0-1-1H15.106l-2.4-2.4a1,1,0,0,0-1.414,0l-2.4,2.4H5.5a1,1,0,0,0-1,1V8.894l-2.4,2.4a1,1,0,0,0,0,1.414l2.4,2.4V18.5a1,1,0,0,0,1,1H8.894l2.4,2.4a1,1,0,0,0,1.414,0l2.4-2.4H18.5a1,1,0,0,0,1-1Z"}),React__namespace$3.createElement("path",{d:"M10,6.349a6,6,0,0,1,0,11.3,6,6,0,1,0,0-11.3Z"}))},LightIcon=function(){return React__namespace$3.createElement(core$4.Icon,{size:16},React__namespace$3.createElement("path",{d:"M19.491,15.106l2.4-2.4a1,1,0,0,0,0-1.414l-2.4-2.4V5.5a1,1,0,0,0-1-1H15.1L12.7,2.1a1,1,0,0,0-1.414,0l-2.4,2.4H5.491a1,1,0,0,0-1,1V8.894l-2.4,2.4a1,1,0,0,0,0,1.414l2.4,2.4V18.5a1,1,0,0,0,1,1H8.885l2.4,2.4a1,1,0,0,0,1.414,0l2.4-2.4h3.394a1,1,0,0,0,1-1Z"}),React__namespace$3.createElement("path",{d:"M11.491,6c4,0,6,2.686,6,6s-2,6-6,6Z"}))},__assign$3=function(){return __assign$3=Object.assign||function(n){for(var a,r=1,e=arguments.length;r<e;r++){a=arguments[r];for(var p in a)Object.prototype.hasOwnProperty.call(a,p)&&(n[p]=a[p])}return n},__assign$3.apply(this,arguments)},TOOLTIP_OFFSET$2={left:0,top:8},SwitchThemeButton=function(t){var n=t.onClick,a=React__namespace$3.useContext(core$4.ThemeContext),r=React__namespace$3.useContext(core$4.LocalizationContext).l10n,e=a.currentTheme==="dark",p=r&&r.theme?e?r.theme.switchLightTheme:r.theme.switchDarkTheme:e?"Switch to the light theme":"Switch to the dark theme";return React__namespace$3.createElement(core$4.Tooltip,{ariaControlsSuffix:"theme-switch",position:core$4.Position.BottomCenter,target:React__namespace$3.createElement(core$4.MinimalButton,{ariaLabel:p,testId:"theme__switch-button",onClick:n},e?React__namespace$3.createElement(LightIcon,null):React__namespace$3.createElement(DarkIcon,null)),content:function(){return p},offset:TOOLTIP_OFFSET$2})},SwitchTheme=function(t){var n=t.children,a=React__namespace$3.useContext(core$4.ThemeContext),r=function(p){return React__namespace$3.createElement(SwitchThemeButton,{onClick:p.onClick})},e=n||r;return e({onClick:function(){return a.setCurrentTheme(a.currentTheme==="dark"?"light":"dark")}})},SwitchThemeMenuItem=function(t){var n=t.onClick,a=React__namespace$3.useContext(core$4.ThemeContext),r=React__namespace$3.useContext(core$4.LocalizationContext).l10n,e=a.currentTheme==="dark",p=r&&r.theme?e?r.theme.switchLightTheme:r.theme.switchDarkTheme:e?"Switch to the light theme":"Switch to the dark theme";return React__namespace$3.createElement(core$4.MenuItem,{icon:e?React__namespace$3.createElement(LightIcon,null):React__namespace$3.createElement(DarkIcon,null),testId:"theme__switch-menu",onClick:n},p)},themePlugin=function(){var t=function(r){return React__namespace$3.createElement(SwitchTheme,__assign$3({},r))},n=function(){return React__namespace$3.createElement(t,null,function(r){return React__namespace$3.createElement(SwitchThemeButton,__assign$3({},r))})},a=function(r){return React__namespace$3.createElement(t,null,function(e){return React__namespace$3.createElement(SwitchThemeMenuItem,{onClick:function(){e.onClick(),r.onClick()}})})};return{SwitchTheme:t,SwitchThemeButton:n,SwitchThemeMenuItem:a}};theme$2.DarkIcon=DarkIcon;theme$2.LightIcon=LightIcon;theme$2.themePlugin=themePlugin;/** * A React component to view a PDF document * * @see https://react-pdf-viewer.dev * @license https://react-pdf-viewer.dev/license * @copyright 2019-2022 Nguyen Huu Phuoc <me@phuoc.ng> */lib$1.exports=theme$2;var libExports$3=lib$1.exports,lib={exports:{}},zoom$2={},core$3=libExports$h,React$2=reactExports;function _interopNamespaceDefault$2(t){var n=Object.create(null);return t&&Object.keys(t).forEach(function(a){if(a!=="default"){var r=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(n,a,r.get?r:{enumerable:!0,get:function(){return t[a]}})}}),n.default=t,Object.freeze(n)}var React__namespace$2=_interopNamespaceDefault$2(React$2),ZoomInIcon=function(){return React__namespace$2.createElement(core$3.Icon,{ignoreDirection:!0,size:16},React__namespace$2.createElement("path",{d:`M10.5,0.499c5.523,0,10,4.477,10,10s-4.477,10-10,10s-10-4.477-10-10S4.977,0.499,10.5,0.499z M23.5,23.499 l-5.929-5.929 M5.5,10.499h10 M10.5,5.499v10`}))},ZoomOutIcon=function(){return React__namespace$2.createElement(core$3.Icon,{ignoreDirection:!0,size:16},React__namespace$2.createElement("path",{d:`M10.5,0.499c5.523,0,10,4.477,10,10s-4.477,10-10,10s-10-4.477-10-10S4.977,0.499,10.5,0.499z M23.5,23.499 l-5.929-5.929 M5.5,10.499h10`}))},__assign$2=function(){return __assign$2=Object.assign||function(n){for(var a,r=1,e=arguments.length;r<e;r++){a=arguments[r];for(var p in a)Object.prototype.hasOwnProperty.call(a,p)&&(n[p]=a[p])}return n},__assign$2.apply(this,arguments)},useZoom=function(t){var n=React__namespace$2.useState(t.get("scale")||0),a=n[0],r=n[1],e=function(p){r(p)};return React__namespace$2.useEffect(function(){return t.subscribe("scale",e),function(){t.unsubscribe("scale",e)}},[]),{scale:a}},CurrentScale=function(t){var n=t.children,a=t.store,r=useZoom(a).scale,e=function(k){return React__namespace$2.createElement(React__namespace$2.Fragment,null,"".concat(Math.round(k.scale*100),"%"))},p=n||e;return p({scale:r})},LEVELS=[.1,.2,.3,.4,.5,.6,.7,.8,.9,1,1.1,1.3,1.5,1.7,1.9,2.1,2.4,2.7,3,3.3,3.7,4.1,4.6,5.1,5.7,6.3,7,7.7,8.5,9.4,10],increase=function(t){var n=LEVELS.find(function(a){return a>t});return n||t},decrease=function(t){var n=LEVELS.findIndex(function(a){return a>=t});return n===-1||n===0?t:LEVELS[n-1]},ShortcutHandler=function(t){var n=t.containerRef,a=t.store,r=function(e){if(!(e.shiftKey||e.altKey)){var p=core$3.isMac()?e.metaKey:e.ctrlKey;if(p){var k=n.current;if(!(!k||!document.activeElement||!k.contains(document.activeElement))){var E=a.get("zoom");if(E){var b=a.get("scale")||1,R=1;switch(e.key){case"-":R=decrease(b);break;case"=":R=increase(b);break;case"0":R=1;break;default:R=b;break}R!==b&&(e.preventDefault(),E(R))}}}}};return React__namespace$2.useEffect(function(){var e=n.current;if(e)return document.addEventListener("keydown",r),function(){document.removeEventListener("keydown",r)}},[n.current]),React__namespace$2.createElement(React__namespace$2.Fragment,null)},DEFAULT_LEVELS=[.5,.75,1,1.25,1.5,2,3,4],PORTAL_OFFSET$1={left:0,top:8},ZoomPopover=function(t){var n=t.levels,a=n===void 0?DEFAULT_LEVELS:n,r=t.scale,e=t.onZoom,p=React__namespace$2.useContext(core$3.LocalizationContext).l10n,k=React__namespace$2.useContext(core$3.ThemeContext).direction,E=k===core$3.TextDirection.RightToLeft,b=function(y){switch(y){case core$3.SpecialZoomLevel.ActualSize:return p&&p.zoom?p.zoom.actualSize:"Actual size";case core$3.SpecialZoomLevel.PageFit:return p&&p.zoom?p.zoom.pageFit:"Page fit";case core$3.SpecialZoomLevel.PageWidth:return p&&p.zoom?p.zoom.pageWidth:"Page width"}},R=p&&p.zoom?p.zoom.zoomDocument:"Zoom document",S=function(y){var _=function(){y()};return React__namespace$2.createElement(core$3.MinimalButton,{ariaLabel:R,testId:"zoom__popover-target",onClick:_},React__namespace$2.createElement("span",{className:"rpv-zoom__popover-target"},React__namespace$2.createElement("span",{"data-testid":"zoom__popover-target-scale",className:core$3.classNames({"rpv-zoom__popover-target-scale":!0,"rpv-zoom__popover-target-scale--ltr":!E,"rpv-zoom__popover-target-scale--rtl":E})},Math.round(r*100),"%"),React__namespace$2.createElement("span",{className:"rpv-zoom__popover-target-arrow"})))},A=function(y){return React__namespace$2.createElement(core$3.Menu,null,Object.keys(core$3.SpecialZoomLevel).map(function(_){var h=_,l=function(){y(),e(h)};return React__namespace$2.createElement(core$3.MenuItem,{key:h,onClick:l},b(h))}),React__namespace$2.createElement(core$3.MenuDivider,null),a.map(function(_){var h=function(){y(),e(_)};return React__namespace$2.createElement(core$3.MenuItem,{key:_,onClick:h},"".concat(Math.round(_*100),"%"))}))};return React__namespace$2.createElement(core$3.Popover,{ariaControlsSuffix:"zoom",ariaHasPopup:"menu",position:core$3.Position.BottomCenter,target:S,content:A,offset:PORTAL_OFFSET$1,closeOnClickOutside:!0,closeOnEscape:!0})},Zoom=function(t){var n=t.children,a=t.levels,r=t.store,e=useZoom(r).scale,p=function(b){var R=r.get("zoom");R&&R(b)},k=function(b){return React__namespace$2.createElement(ZoomPopover,{levels:a,scale:b.scale,onZoom:b.onZoom})},E=n||k;return E({scale:e,onZoom:p})},TOOLTIP_OFFSET$1={left:0,top:8},ZoomInButton=function(t){var n=t.enableShortcuts,a=t.onClick,r=React__namespace$2.useContext(core$3.LocalizationContext).l10n,e=r&&r.zoom?r.zoom.zoomIn:"Zoom in",p=n?core$3.isMac()?"Meta+=":"Ctrl+=":"";return React__namespace$2.createElement(core$3.Tooltip,{ariaControlsSuffix:"zoom-in",position:core$3.Position.BottomCenter,target:React__namespace$2.createElement(core$3.MinimalButton,{ariaKeyShortcuts:p,ariaLabel:e,testId:"zoom__in-button",onClick:a},React__namespace$2.createElement(ZoomInIcon,null)),content:function(){return e},offset:TOOLTIP_OFFSET$1})},ZoomIn=function(t){var n=t.children,a=t.enableShortcuts,r=t.store,e=useZoom(r).scale,p=function(){var E=r.get("zoom");if(E){var b=increase(e);E(b)}},k=n||ZoomInButton;return k({enableShortcuts:a,onClick:p})},ZoomInMenuItem=function(t){var n=t.onClick,a=React__namespace$2.useContext(core$3.LocalizationContext).l10n,r=a&&a.zoom?a.zoom.zoomIn:"Zoom in";return React__namespace$2.createElement(core$3.MenuItem,{icon:React__namespace$2.createElement(ZoomInIcon,null),testId:"zoom__in-menu",onClick:n},r)},TOOLTIP_OFFSET={left:0,top:8},ZoomOutButton=function(t){var n=t.enableShortcuts,a=t.onClick,r=React__namespace$2.useContext(core$3.LocalizationContext).l10n,e=r&&r.zoom?r.zoom.zoomOut:"Zoom out",p=n?core$3.isMac()?"Meta+-":"Ctrl+-":"";return React__namespace$2.createElement(core$3.Tooltip,{ariaControlsSuffix:"zoom-out",position:core$3.Position.BottomCenter,target:React__namespace$2.createElement(core$3.MinimalButton,{ariaKeyShortcuts:p,ariaLabel:e,testId:"zoom__out-button",onClick:a},React__namespace$2.createElement(ZoomOutIcon,null)),content:function(){return e},offset:TOOLTIP_OFFSET})},ZoomOut=function(t){var n=t.children,a=t.enableShortcuts,r=t.store,e=useZoom(r).scale,p=function(){var E=r.get("zoom");if(E){var b=decrease(e);E(b)}},k=n||ZoomOutButton;return k({enableShortcuts:a,onClick:p})},ZoomOutMenuItem=function(t){var n=t.onClick,a=React__namespace$2.useContext(core$3.LocalizationContext).l10n,r=a&&a.zoom?a.zoom.zoomOut:"Zoom out";return React__namespace$2.createElement(core$3.MenuItem,{icon:React__namespace$2.createElement(ZoomOutIcon,null),testId:"zoom__out-menu",onClick:n},r)},zoomPlugin=function(t){var n=React__namespace$2.useMemo(function(){return Object.assign({},{enableShortcuts:!0},t)},[]),a=React__namespace$2.useMemo(function(){return core$3.createStore({})},[]),r=function(_){return React__namespace$2.createElement(CurrentScale,__assign$2({},_,{store:a}))},e=function(_){return React__namespace$2.createElement(ZoomIn,__assign$2({enableShortcuts:n.enableShortcuts},_,{store:a}))},p=function(){return React__namespace$2.createElement(e,null,function(_){return React__namespace$2.createElement(ZoomInButton,__assign$2({},_))})},k=function(_){return React__namespace$2.createElement(e,null,function(h){return React__namespace$2.createElement(ZoomInMenuItem,{onClick:function(){h.onClick(),_.onClick()}})})},E=function(_){return React__namespace$2.createElement(ZoomOut,__assign$2({enableShortcuts:n.enableShortcuts},_,{store:a}))},b=function(){return React__namespace$2.createElement(E,null,function(_){return React__namespace$2.createElement(ZoomOutButton,__assign$2({},_))})},R=function(_){return React__namespace$2.createElement(E,null,function(h){return React__namespace$2.createElement(ZoomOutMenuItem,{onClick:function(){h.onClick(),_.onClick()}})})},S=function(_){return React__namespace$2.createElement(Zoom,__assign$2({},_,{store:a}))},A=function(_){return React__namespace$2.createElement(S,null,function(h){return React__namespace$2.createElement(ZoomPopover,__assign$2({levels:_==null?void 0:_.levels},h))})},y=function(_){var h=_.slot;if(!n.enableShortcuts)return h;var l={children:React__namespace$2.createElement(React__namespace$2.Fragment,null,React__namespace$2.createElement(ShortcutHandler,{containerRef:_.containerRef,store:a}),h.children)};return __assign$2(__assign$2({},h),l)};return{renderViewer:y,install:function(_){a.update("zoom",_.zoom)},onViewerStateChange:function(_){return a.update("scale",_.scale),_},zoomTo:function(_){var h=a.get("zoom");h&&h(_)},CurrentScale:r,ZoomIn:e,ZoomInButton:p,ZoomInMenuItem:k,ZoomOut:E,ZoomOutButton:b,ZoomOutMenuItem:R,Zoom:S,ZoomPopover:A}};zoom$2.ZoomInIcon=ZoomInIcon;zoom$2.ZoomOutIcon=ZoomOutIcon;zoom$2.zoomPlugin=zoomPlugin;/** * A React component to view a PDF document * * @see https://react-pdf-viewer.dev * @license https://react-pdf-viewer.dev/license * @copyright 2019-2022 Nguyen Huu Phuoc <me@phuoc.ng> */lib.exports=zoom$2;var libExports$2=lib.exports,core$2=libExports$h,selectionMode$1=libExports$d,React$1=reactExports,fullScreen$1=libExports$c,getFile=libExports$b,open$1=libExports$a,pageNavigation$1=libExports$9,print$1=libExports$8,properties$1=libExports$7,rotate$1=libExports$6,scrollMode$1=libExports$5,search$1=libExports$4,theme$1=libExports$3,zoom$1=libExports$2;function _interopNamespaceDefault$1(t){var n=Object.create(null);return t&&Object.keys(t).forEach(function(a){if(a!=="default"){var r=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(n,a,r.get?r:{enumerable:!0,get:function(){return t[a]}})}}),n.default=t,Object.freeze(n)}var React__namespace$1=_interopNamespaceDefault$1(React$1),MoreIcon=function(){return React__namespace$1.createElement(core$2.Icon,{size:16},React__namespace$1.createElement("path",{d:`M12,0.5c1.381,0,2.5,1.119,2.5,2.5S13.381,5.5,12,5.5S9.5,4.381,9.5,3S10.619,0.5,12,0.5z M12,9.5 c1.381,0,2.5,1.119,2.5,2.5s-1.119,2.5-2.5,2.5S9.5,13.381,9.5,12S10.619,9.5,12,9.5z M12,18.5c1.381,0,2.5,1.119,2.5,2.5 s-1.119,2.5-2.5,2.5S9.5,22.381,9.5,21S10.619,18.5,12,18.5z`}))},PORTAL_OFFSET={left:0,top:8},MoreActionsPopover=function(t){var n=t.toolbarSlot,a=React__namespace$1.useContext(core$2.LocalizationContext).l10n,r=React__namespace$1.useContext(core$2.ThemeContext).direction,e=r===core$2.TextDirection.RightToLeft?core$2.Position.BottomLeft:core$2.Position.BottomRight,p=n.DownloadMenuItem,k=n.EnterFullScreenMenuItem,E=n.GoToFirstPageMenuItem,b=n.GoToLastPageMenuItem,R=n.GoToNextPageMenuItem,S=n.GoToPreviousPageMenuItem,A=n.OpenMenuItem,y=n.PrintMenuItem,_=n.RotateBackwardMenuItem,h=n.RotateForwardMenuItem,l=n.ShowPropertiesMenuItem,o=n.SwitchScrollModeMenuItem,s=n.SwitchSelectionModeMenuItem,f=n.SwitchViewModeMenuItem,g=n.SwitchThemeMenuItem,v=function(d,x){var L=a&&a.toolbar?a.toolbar.moreActions:"More actions";return React__namespace$1.createElement(core$2.Tooltip,{ariaControlsSuffix:"toolbar-more-actions",position:e,target:React__namespace$1.createElement(core$2.MinimalButton,{ariaLabel:L,isSelected:x,testId:"toolbar__more-actions-popover-target",onClick:d},React__namespace$1.createElement(MoreIcon,null)),content:function(){return L},offset:PORTAL_OFFSET})},c=function(d){return React__namespace$1.createElement(core$2.Menu,null,React__namespace$1.createElement("div",{className:"rpv-core__display--block rpv-core__display--hidden-medium"},React__namespace$1.createElement(g,{onClick:d})),React__namespace$1.createElement("div",{className:"rpv-core__display--block rpv-core__display--hidden-medium"},React__namespace$1.createElement(k,{onClick:d})),React__namespace$1.createElement("div",{className:"rpv-core__display--block rpv-core__display--hidden-medium"},React__namespace$1.createElement(A,null)),React__namespace$1.createElement("div",{className:"rpv-core__display--block rpv-core__display--hidden-medium"},React__namespace$1.createElement(y,{onClick:d})),React__namespace$1.createElement("div",{className:"rpv-core__display--block rpv-core__display--hidden-medium"},React__namespace$1.createElement(p,{onClick:d})),React__namespace$1.createElement("div",{className:"rpv-core__display--block rpv-core__display--hidden-medium"},React__namespace$1.createElement(core$2.MenuDivider,null)),React__namespace$1.createElement(E,{onClick:d}),React__namespace$1.createElement("div",{className:"rpv-core__display--block rpv-core__display--hidden-medium"},React__namespace$1.createElement(S,{onClick:d})),React__namespace$1.createElement("div",{className:"rpv-core__display--block rpv-core__display--hidden-medium"},React__namespace$1.createElement(R,{onClick:d})),React__namespace$1.createElement(b,{onClick:d}),React__namespace$1.createElement(core$2.MenuDivider,null),React__namespace$1.createElement(h,{onClick:d}),React__namespace$1.createElement(_,{onClick:d}),React__namespace$1.createElement(core$2.MenuDivider,null),React__namespace$1.createElement(s,{mode:selectionMode$1.SelectionMode.Text,onClick:d}),React__namespace$1.createElement(s,{mode:selectionMode$1.SelectionMode.Hand,onClick:d}),React__namespace$1.createElement(core$2.MenuDivider,null),React__namespace$1.createElement(o,{mode:core$2.ScrollMode.Page,onClick:d}),React__namespace$1.createElement(o,{mode:core$2.ScrollMode.Vertical,onClick:d}),React__namespace$1.createElement(o,{mode:core$2.ScrollMode.Horizontal,onClick:d}),React__namespace$1.createElement(o,{mode:core$2.ScrollMode.Wrapped,onClick:d}),React__namespace$1.createElement(core$2.MenuDivider,null),React__namespace$1.createElement("div",{className:"rpv-core__display--hidden rpv-core__display--block-small"},React__namespace$1.createElement(f,{mode:core$2.ViewMode.SinglePage,onClick:d})),React__namespace$1.createElement("div",{className:"rpv-core__display--hidden rpv-core__display--block-small"},React__namespace$1.createElement(f,{mode:core$2.ViewMode.DualPage,onClick:d})),React__namespace$1.createElement("div",{className:"rpv-core__display--hidden rpv-core__display--block-small"},React__namespace$1.createElement(f,{mode:core$2.ViewMode.DualPageWithCover,onClick:d})),React__namespace$1.createElement("div",{className:"rpv-core__display--hidden rpv-core__display--block-small"},React__namespace$1.createElement(core$2.MenuDivider,null)),React__namespace$1.createElement(l,{onClick:d}))};return React__namespace$1.createElement(core$2.Popover,{ariaControlsSuffix:"toolbar-more-actions",ariaHasPopup:"menu",position:e,target:v,content:c,offset:PORTAL_OFFSET,closeOnClickOutside:!0,closeOnEscape:!0})},__assign$1=function(){return __assign$1=Object.assign||function(n){for(var a,r=1,e=arguments.length;r<e;r++){a=arguments[r];for(var p in a)Object.prototype.hasOwnProperty.call(a,p)&&(n[p]=a[p])}return n},__assign$1.apply(this,arguments)},renderDefaultToolbar=function(t){return function(n){var a=React__namespace$1.useMemo(function(){return t(n)},[]),r=React__namespace$1.useContext(core$2.ThemeContext).direction,e=r===core$2.TextDirection.RightToLeft,p=a.CurrentPageInput,k=a.Download,E=a.EnterFullScreen,b=a.GoToNextPage,R=a.GoToPreviousPage,S=a.NumberOfPages,A=a.Open,y=a.Print,_=a.ShowSearchPopover,h=a.SwitchTheme,l=a.Zoom,o=a.ZoomIn,s=a.ZoomOut;return React__namespace$1.createElement("div",{"data-testid":"toolbar",className:core$2.classNames({"rpv-toolbar":!0,"rpv-toolbar--rtl":e}),role:"toolbar","aria-orientation":"horizontal"},React__namespace$1.createElement("div",{className:"rpv-toolbar__left"},React__namespace$1.createElement("div",{className:"rpv-toolbar__item"},React__namespace$1.createElement(_,null)),React__namespace$1.createElement("div",{className:"rpv-core__display--hidden rpv-core__display--block-small"},React__namespace$1.createElement("div",{className:"rpv-toolbar__item"},React__namespace$1.createElement(R,null))),React__namespace$1.createElement("div",{className:"rpv-toolbar__item"},React__namespace$1.createElement(p,null),React__namespace$1.createElement("span",{className:"rpv-toolbar__label"},React__namespace$1.createElement(S,null))),React__namespace$1.createElement("div",{className:"rpv-core__display--hidden rpv-core__display--block-small"},React__namespace$1.createElement("div",{className:"rpv-toolbar__item"},React__namespace$1.createElement(b,null)))),React__namespace$1.createElement("div",{className:"rpv-toolbar__center"},React__namespace$1.createElement("div",{className:"rpv-toolbar__item"},React__namespace$1.createElement(s,null)),React__namespace$1.createElement("div",{className:"rpv-core__display--hidden rpv-core__display--block-small"},React__namespace$1.createElement("div",{className:"rpv-toolbar__item"},React__namespace$1.createElement(l,null))),React__namespace$1.createElement("div",{className:"rpv-toolbar__item"},React__namespace$1.createElement(o,null))),React__namespace$1.createElement("div",{className:"rpv-toolbar__right"},React__namespace$1.createElement("div",{className:"rpv-core__display--hidden rpv-core__display--block-medium"},React__namespace$1.createElement("div",{className:"rpv-toolbar__item"},React__namespace$1.createElement(h,null))),React__namespace$1.createElement("div",{className:"rpv-core__display--hidden rpv-core__display--block-medium"},React__namespace$1.createElement("div",{className:"rpv-toolbar__item"},React__namespace$1.createElement(E,null))),React__namespace$1.createElement("div",{className:"rpv-core__display--hidden rpv-core__display--block-medium"},React__namespace$1.createElement("div",{className:"rpv-toolbar__item"},React__namespace$1.createElement(A,null))),React__namespace$1.createElement("div",{className:"rpv-core__display--hidden rpv-core__display--block-medium"},React__namespace$1.createElement("div",{className:"rpv-toolbar__item"},React__namespace$1.createElement(k,null))),React__namespace$1.createElement("div",{className:"rpv-core__display--hidden rpv-core__display--block-medium"},React__namespace$1.createElement("div",{className:"rpv-toolbar__item"},React__namespace$1.createElement(y,null))),React__namespace$1.createElement("div",{className:"rpv-toolbar__item"},React__namespace$1.createElement(MoreActionsPopover,{toolbarSlot:a}))))}},defaultTransform=function(t){var n=t.NumberOfPages;return Object.assign({},t,{NumberOfPages:function(){return React__namespace$1.createElement(React__namespace$1.Fragment,null,"/ ",React__namespace$1.createElement(n,null))}})},DefaultToobar=function(t){return renderDefaultToolbar(defaultTransform)(t)},Toolbar=function(t){var n=t.children,a=t.slot,r=n||DefaultToobar;return r(a)},toolbarPlugin=function(t){var n=fullScreen$1.fullScreenPlugin(t?t.fullScreenPlugin:{}),a=getFile.getFilePlugin(t?t.getFilePlugin:{}),r=open$1.openPlugin(t?t.openPlugin:{}),e=pageNavigation$1.pageNavigationPlugin(t?t.pageNavigationPlugin:{}),p=print$1.printPlugin(t?t.printPlugin:{}),k=properties$1.propertiesPlugin(),E=rotate$1.rotatePlugin(),b=scrollMode$1.scrollModePlugin(),R=search$1.searchPlugin(t?t.searchPlugin:{}),S=selectionMode$1.selectionModePlugin(t?t.selectionModePlugin:{}),A=theme$1.themePlugin(),y=zoom$1.zoomPlugin(t?t.zoomPlugin:{}),_=[n,a,r,e,p,k,E,b,R,S,A,y],h=React__namespace$1.useCallback(function(l){var o=n.EnterFullScreen,s=n.EnterFullScreenMenuItem,f=a.Download,g=a.DownloadMenuItem,v=r.Open,c=r.OpenMenuItem,d=e.CurrentPageInput,x=e.CurrentPageLabel,L=e.GoToFirstPage,X=e.GoToFirstPageMenuItem,N=e.GoToLastPage,D=e.GoToLastPageMenuItem,se=e.GoToNextPage,Ae=e.GoToNextPageMenuItem,Te=e.GoToPreviousPage,le=e.GoToPreviousPageMenuItem,ie=e.NumberOfPages,fe=p.Print,_e=p.PrintMenuItem,oe=k.ShowProperties,Me=k.ShowPropertiesMenuItem,xe=E.Rotate,K=E.RotateBackwardMenuItem,T=E.RotateForwardMenuItem,P=b.SwitchScrollMode,$=b.SwitchScrollModeMenuItem,Y=b.SwitchViewMode,J=b.SwitchViewModeMenuItem,te=R.Search,he=R.ShowSearchPopover,ve=S.SwitchSelectionMode,Ne=S.SwitchSelectionModeMenuItem,Se=A.SwitchTheme,je=A.SwitchThemeMenuItem,Ie=y.CurrentScale,ze=y.Zoom,C=y.ZoomIn,I=y.ZoomInMenuItem,G=y.ZoomOut,z=y.ZoomOutMenuItem;return React__namespace$1.createElement(Toolbar,__assign$1({},l,{slot:{CurrentPageInput:d,CurrentPageLabel:x,CurrentScale:Ie,Download:f,DownloadMenuItem:g,EnterFullScreen:o,EnterFullScreenMenuItem:s,GoToFirstPage:L,GoToFirstPageMenuItem:X,GoToLastPage:N,GoToLastPageMenuItem:D,GoToNextPage:se,GoToNextPageMenuItem:Ae,GoToPreviousPage:Te,GoToPreviousPageMenuItem:le,NumberOfPages:ie,Open:v,OpenMenuItem:c,Print:fe,PrintMenuItem:_e,Rotate:xe,RotateBackwardMenuItem:K,RotateForwardMenuItem:T,Search:te,ShowProperties:oe,ShowPropertiesMenuItem:Me,ShowSearchPopover:he,SwitchScrollMode:P,SwitchScrollModeMenuItem:$,SwitchSelectionMode:ve,SwitchSelectionModeMenuItem:Ne,SwitchViewMode:Y,SwitchViewModeMenuItem:J,SwitchTheme:Se,SwitchThemeMenuItem:je,Zoom:ze,ZoomIn:C,ZoomInMenuItem:I,ZoomOut:G,ZoomOutMenuItem:z}}))},[]);return{fullScreenPluginInstance:n,getFilePluginInstance:a,openPluginInstance:r,pageNavigationPluginInstance:e,printPluginInstance:p,propertiesPluginInstance:k,rotatePluginInstance:E,scrollModePluginInstance:b,searchPluginInstance:R,selectionModePluginInstance:S,themePluginInstance:A,zoomPluginInstance:y,install:function(l){_.forEach(function(o){o.install&&o.install(l)})},renderPageLayer:function(l){return React__namespace$1.createElement(React__namespace$1.Fragment,null,_.map(function(o,s){return o.renderPageLayer?React__namespace$1.createElement(React__namespace$1.Fragment,{key:s},o.renderPageLayer(l)):React__namespace$1.createElement(React__namespace$1.Fragment,{key:s})}))},renderViewer:function(l){var o=l.slot;return _.forEach(function(s){s.renderViewer&&(o=s.renderViewer(__assign$1(__assign$1({},l),{slot:o})))}),o},uninstall:function(l){_.forEach(function(o){o.uninstall&&o.uninstall(l)})},onDocumentLoad:function(l){_.forEach(function(o){o.onDocumentLoad&&o.onDocumentLoad(l)})},onAnnotationLayerRender:function(l){_.forEach(function(o){o.onAnnotationLayerRender&&o.onAnnotationLayerRender(l)})},onTextLayerRender:function(l){_.forEach(function(o){o.onTextLayerRender&&o.onTextLayerRender(l)})},onViewerStateChange:function(l){var o=l;return _.forEach(function(s){s.onViewerStateChange&&(o=s.onViewerStateChange(o))}),o},renderDefaultToolbar,Toolbar:h}};toolbar$2.MoreActionsPopover=MoreActionsPopover;toolbar$2.MoreIcon=MoreIcon;toolbar$2.toolbarPlugin=toolbarPlugin;/** * A React component to view a PDF document * * @see https://react-pdf-viewer.dev * @license https://react-pdf-viewer.dev/license * @copyright 2019-2022 Nguyen Huu Phuoc <me@phuoc.ng> */lib$c.exports=toolbar$2;var libExports$1=lib$c.exports,core$1=libExports$h,React=reactExports,attachment$1=libExports$g,bookmark$1=libExports$f,thumbnail=libExports$e,toolbar$1=libExports$1;function _interopNamespaceDefault(t){var n=Object.create(null);return t&&Object.keys(t).forEach(function(a){if(a!=="default"){var r=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(n,a,r.get?r:{enumerable:!0,get:function(){return t[a]}})}}),n.default=t,Object.freeze(n)}var React__namespace=_interopNamespaceDefault(React),BookmarkIcon=function(){return React__namespace.createElement(core$1.Icon,{size:16},React__namespace.createElement("path",{d:`M11.5,1.5h11c0.552,0,1,0.448,1,1v20c0,0.552-0.448,1-1,1h-21c-0.552,0-1-0.448-1-1v-20c0-0.552,0.448-1,1-1h3 M11.5,10.5c0,0.55-0.3,0.661-0.659,0.248L8,7.5l-2.844,3.246c-0.363,0.414-0.659,0.3-0.659-0.247v-9c0-0.552,0.448-1,1-1h5 c0.552,0,1,0.448,1,1L11.5,10.5z M14.5,6.499h6 M14.5,10.499h6 M3.5,14.499h17 M3.5,18.499h16.497`}))},__assign=function(){return __assign=Object.assign||function(n){for(var a,r=1,e=arguments.length;r<e;r++){a=arguments[r];for(var p in a)Object.prototype.hasOwnProperty.call(a,p)&&(n[p]=a[p])}return n},__assign.apply(this,arguments)},FileIcon=function(){return React__namespace.createElement(core$1.Icon,{size:16},React__namespace.createElement("path",{d:`M7.618,15.345l8.666-8.666c0.78-0.812,2.071-0.838,2.883-0.058s0.838,2.071,0.058,2.883 c-0.019,0.02-0.038,0.039-0.058,0.058L7.461,21.305c-1.593,1.593-4.175,1.592-5.767,0s-1.592-4.175,0-5.767c0,0,0,0,0,0 L13.928,3.305c2.189-2.19,5.739-2.19,7.929-0.001s2.19,5.739,0,7.929l0,0L13.192,19.9`}))},ThumbnailIcon=function(){return React__namespace.createElement(core$1.Icon,{size:16},React__namespace.createElement("path",{d:`M10.5,9.5c0,0.552-0.448,1-1,1h-8c-0.552,0-1-0.448-1-1v-8c0-0.552,0.448-1,1-1h8c0.552,0,1,0.448,1,1V9.5z M23.5,9.5c0,0.552-0.448,1-1,1h-8c-0.552,0-1-0.448-1-1v-8c0-0.552,0.448-1,1-1h8c0.552,0,1,0.448,1,1V9.5z M10.5,22.5 c0,0.552-0.448,1-1,1h-8c-0.552,0-1-0.448-1-1v-8c0-0.552,0.448-1,1-1h8c0.552,0,1,0.448,1,1V22.5z M23.5,22.5c0,0.552-0.448,1-1,1 h-8c-0.552,0-1-0.448-1-1v-8c0-0.552,0.448-1,1-1h8c0.552,0,1,0.448,1,1V22.5z`}))},TOOLTIP_OFFSET_LTR={left:8,top:0},TOOLTIP_OFFSET_RTL={left:-8,top:0},Sidebar=function(t){var n=t.attachmentTabContent,a=t.bookmarkTabContent,r=t.store,e=t.thumbnailTabContent,p=t.tabs,k=React__namespace.useRef(),E=React__namespace.useContext(core$1.LocalizationContext).l10n,b=React__namespace.useState(r.get("isCurrentTabOpened")||!1),R=b[0],S=b[1],A=React__namespace.useState(Math.max(r.get("currentTab")||0,0)),y=A[0],_=A[1],h=React__namespace.useContext(core$1.ThemeContext).direction,l=h===core$1.TextDirection.RightToLeft,o=function(d){return d.firstHalfPercentage>=20&&d.firstHalfPercentage<=80},s=[{content:e,icon:React__namespace.createElement(ThumbnailIcon,null),title:E&&E.defaultLayout?E.defaultLayout.thumbnail:"Thumbnail"},{content:a,icon:React__namespace.createElement(BookmarkIcon,null),title:E&&E.defaultLayout?E.defaultLayout.bookmark:"Bookmark"},{content:n,icon:React__namespace.createElement(FileIcon,null),title:E&&E.defaultLayout?E.defaultLayout.attachment:"Attachment"}],f=p?p(s):s,g=function(d){if(y===d){r.update("isCurrentTabOpened",!r.get("isCurrentTabOpened"));var x=k.current;if(x){var L=x.style.width;L&&x.style.removeProperty("width")}}else r.update("currentTab",d)},v=function(d){d>=0&&d<=f.length-1&&(r.update("isCurrentTabOpened",!0),_(d))},c=function(d){S(d)};return React__namespace.useEffect(function(){return r.subscribe("currentTab",v),r.subscribe("isCurrentTabOpened",c),function(){r.unsubscribe("currentTab",v),r.unsubscribe("isCurrentTabOpened",c)}},[]),f.length===0?React__namespace.createElement(React__namespace.Fragment,null):React__namespace.createElement(React__namespace.Fragment,null,React__namespace.createElement("div",{"data-testid":"default-layout__sidebar",className:core$1.classNames({"rpv-default-layout__sidebar":!0,"rpv-default-layout__sidebar--opened":R,"rpv-default-layout__sidebar--ltr":!l,"rpv-default-layout__sidebar--rtl":l}),ref:k},React__namespace.createElement("div",{className:"rpv-default-layout__sidebar-tabs"},React__namespace.createElement("div",{className:"rpv-default-layout__sidebar-headers",role:"tablist","aria-orientation":"vertical"},f.map(function(d,x){return React__namespace.createElement("div",{"aria-controls":"rpv-default-layout__sidebar-content","aria-selected":y===x,key:x,className:"rpv-default-layout__sidebar-header",id:"rpv-default-layout__sidebar-tab-".concat(x),role:"tab"},React__namespace.createElement(core$1.Tooltip,{ariaControlsSuffix:"default-layout-sidebar-tab-".concat(x),position:l?core$1.Position.LeftCenter:core$1.Position.RightCenter,target:React__namespace.createElement(core$1.MinimalButton,{ariaLabel:d.title,isSelected:y===x,onClick:function(){return g(x)}},d.icon),content:function(){return d.title},offset:l?TOOLTIP_OFFSET_RTL:TOOLTIP_OFFSET_LTR}))})),React__namespace.createElement("div",{"aria-labelledby":"rpv-default-layout__sidebar-tab-".concat(y),id:"rpv-default-layout__sidebar-content",className:core$1.classNames({"rpv-default-layout__sidebar-content":!0,"rpv-default-layout__sidebar-content--opened":R,"rpv-default-layout__sidebar-content--ltr":!l,"rpv-default-layout__sidebar-content--rtl":l}),role:"tabpanel",tabIndex:-1},f[y].content))),R&&React__namespace.createElement(core$1.Splitter,{constrain:o}))},defaultLayoutPlugin=function(t){var n=React__namespace.useMemo(function(){return core$1.createStore({isCurrentTabOpened:!1,currentTab:0})},[]),a=attachment$1.attachmentPlugin(),r=bookmark$1.bookmarkPlugin(),e=thumbnail.thumbnailPlugin(t?t.thumbnailPlugin:{}),p=toolbar$1.toolbarPlugin(t?t.toolbarPlugin:{}),k=a.Attachments,E=r.Bookmarks,b=e.Thumbnails,R=p.Toolbar,S=t?t.sidebarTabs:function(y){return y},A=[a,r,e,p];return{attachmentPluginInstance:a,bookmarkPluginInstance:r,thumbnailPluginInstance:e,toolbarPluginInstance:p,activateTab:function(y){n.update("currentTab",y)},toggleTab:function(y){var _=n.get("currentTab");n.update("isCurrentTabOpened",!n.get("isCurrentTabOpened")),_!==y&&n.update("currentTab",y)},install:function(y){A.forEach(function(_){_.install&&_.install(y)})},renderPageLayer:function(y){return React__namespace.createElement(React__namespace.Fragment,null,A.map(function(_,h){return _.renderPageLayer?React__namespace.createElement(React__namespace.Fragment,{key:h},_.renderPageLayer(y)):React__namespace.createElement(React__namespace.Fragment,{key:h},React__namespace.createElement(React__namespace.Fragment,null))}))},renderViewer:function(y){var _=y.slot;A.forEach(function(l){l.renderViewer&&(_=l.renderViewer(__assign(__assign({},y),{slot:_})))});var h=_.subSlot&&_.subSlot.attrs?{className:_.subSlot.attrs.className,"data-testid":_.subSlot.attrs["data-testid"],ref:_.subSlot.attrs.ref,style:_.subSlot.attrs.style}:{};return _.children=React__namespace.createElement("div",{className:"rpv-default-layout__container"},React__namespace.createElement("div",{"data-testid":"default-layout__main",className:core$1.classNames({"rpv-default-layout__main":!0,"rpv-default-layout__main--rtl":y.themeContext.direction===core$1.TextDirection.RightToLeft})},React__namespace.createElement(Sidebar,{attachmentTabContent:React__namespace.createElement(k,null),bookmarkTabContent:React__namespace.createElement(E,null),store:n,thumbnailTabContent:React__namespace.createElement(b,null),tabs:S}),React__namespace.createElement("div",{className:"rpv-default-layout__body","data-testid":"default-layout__body"},React__namespace.createElement("div",{className:"rpv-default-layout__toolbar"},t&&t.renderToolbar?t.renderToolbar(R):React__namespace.createElement(R,null)),React__namespace.createElement("div",__assign({},h),_.subSlot.children))),_.children),_.subSlot.attrs={},_.subSlot.children=React__namespace.createElement(React__namespace.Fragment,null),_},uninstall:function(y){A.forEach(function(_){_.uninstall&&_.uninstall(y)})},onDocumentLoad:function(y){A.forEach(function(_){_.onDocumentLoad&&_.onDocumentLoad(y)}),t&&t.setInitialTab&&t.setInitialTab(y.doc).then(function(_){n.update("currentTab",_),n.update("isCurrentTabOpened",!0)})},onAnnotationLayerRender:function(y){A.forEach(function(_){_.onAnnotationLayerRender&&_.onAnnotationLayerRender(y)})},onTextLayerRender:function(y){A.forEach(function(_){_.onTextLayerRender&&_.onTextLayerRender(y)})},onViewerStateChange:function(y){var _=y;return A.forEach(function(h){h.onViewerStateChange&&(_=h.onViewerStateChange(_))}),_}}},setInitialTabFromPageMode=function(t){return new Promise(function(n,a){t.getPageMode().then(function(r){if(!r)n(-1);else switch(r){case core$1.PageMode.Attachments:n(2);break;case core$1.PageMode.Bookmarks:n(1);break;case core$1.PageMode.Thumbnails:n(0);break;default:n(-1);break}})})};defaultLayout$1.BookmarkIcon=BookmarkIcon;defaultLayout$1.FileIcon=FileIcon;defaultLayout$1.ThumbnailIcon=ThumbnailIcon;defaultLayout$1.defaultLayoutPlugin=defaultLayoutPlugin;defaultLayout$1.setInitialTabFromPageMode=setInitialTabFromPageMode;/** * A React component to view a PDF document * * @see https://react-pdf-viewer.dev * @license https://react-pdf-viewer.dev/license * @copyright 2019-2022 Nguyen Huu Phuoc <me@phuoc.ng> */lib$h.exports=defaultLayout$1;var libExports=lib$h.exports;const attachment={clickToDownload:"Nhấn vào để tải về",noAttachment:"Không có tập tin đính kèm nào"},bookmark={noBookmark:"Không có đánh dấu nào"},core={askingPassword:{requirePasswordToOpen:"Tập tin yêu cầu mật khẩu để mở",submit:"Gửi đi"},wrongPassword:{submit:"Gửi đi",tryAgain:"Mật khẩu không đúng. Xin thử lại"}},defaultLayout={attachment:"Đính kèm",bookmark:"Đánh dấu",thumbnail:"Hình nhỏ"},download={download:"Tải về"},drop={dragDropFile:"Kéo và thả tập tin PDF ở đây"},fullScreen={enterFullScreen:"Toàn màn hình"},localeSwitcher={switchLocale:"Chuyển ngôn ngữ"},open={openFile:"Mở tập tin"},pageNavigation={goToFirstPage:"Trang đầu",goToLastPage:"Trang cuối",goToNextPage:"Trang kế",goToPreviousPage:"Trang trước"},print={cancel:"Huỷ",preparingDocument:"Chuẩn bị tài liệu ...",print:"In"},properties={author:"Tác giả",close:"Đóng",creationDate:"Ngày tạo",creator:"Người tạo",fileName:"Tên tệp tin",fileSize:"Kích thước tệp tin",keywords:"Từ khoá",modificationDate:"Ngày chỉnh sửa",pageCount:"Số trang",pdfProducer:"Phần mềm tạo PDF",pdfVersion:"Phiên bản PDF",showProperties:"Thông tin tập tin",subject:"Chủ đề",title:"Tiêu đề"},rotate={rotateBackward:"Xoay ngược chiều kim đồng hồ",rotateForward:"Xoay chiều kim đồng hồ"},scrollMode={horizontalScrolling:"Cuộn ngang",verticalScrolling:"Cuộn dọc",wrappedScrolling:"Cuộn lưới"},search={close:"Đóng",enterToSearch:"Nhấn Enter để tìm",matchCase:"Giống chữ hoa thường",nextMatch:"Kết quả tiếp theo",previousMatch:"Kết quả trước",search:"Tìm kiếm",wholeWords:"Toàn bộ từ"},selectionMode={handTool:"Cầm tay",textSelectionTool:"Chọn văn bản"},theme={switchDarkTheme:"Giao diện tối",switchLightTheme:"Giao diện sáng"},toolbar={moreActions:"Nhiều tác vụ khác"},zoom={actualSize:"Kích thước thực sự",pageFit:"Vừa trang",pageWidth:"Vừa chiều rộng",zoomIn:"Phóng to",zoomOut:"Thu nhỏ"},vi_VN={attachment,bookmark,core,defaultLayout,download,drop,fullScreen,localeSwitcher,open,pageNavigation,print,properties,rotate,scrollMode,search,selectionMode,theme,toolbar,zoom},index="",PDF=reactExports.forwardRef(({url:t,isBlob:n,setloading:a,height:r="100vh",attrs:e},p)=>{const[k,E]=reactExports.useState("");reactExports.useImperativeHandle(p,()=>({}),[]),libExports.defaultLayoutPlugin();const[b,R]=reactExports.useState(vi_VN),S={l10n:b,setL10n:R},[A,y]=React$g.useState("light");reactExports.useEffect(()=>{t&&E(t)},[t]);const _=libExports$1.toolbarPlugin(),{Toolbar:h}=_,l={currentTheme:A,setCurrentTheme:y},o=s=>{let f="Lỗi hiển thị văn bản!";return jsxDevRuntimeExports.jsxDEV("div",{className:"d-flex justify-content-center h-100 align-items-center",children:jsxDevRuntimeExports.jsxDEV("div",{children:[jsxDevRuntimeExports.jsxDEV("div",{className:"text-center",children:jsxDevRuntimeExports.jsxDEV("h3",{children:jsxDevRuntimeExports.jsxDEV("i",{className:"fa-solid fa-ban",style:{color:"#e53e3e",fontSize:"xx-large"}},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/pdf/PDF.jsx",lineNumber:37,columnNumber:15},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/pdf/PDF.jsx",lineNumber:36,columnNumber:13},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/pdf/PDF.jsx",lineNumber:35,columnNumber:11},globalThis),jsxDevRuntimeExports.jsxDEV("div",{style:{borderRadius:"0.25rem",fontSize:"x-large",padding:"0.5rem",color:"#e53e3e",background:"rgb(229, 62, 62,0.1)"},children:f},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/pdf/PDF.jsx",lineNumber:40,columnNumber:11},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/pdf/PDF.jsx",lineNumber:34,columnNumber:9},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/pdf/PDF.jsx",lineNumber:33,columnNumber:7},globalThis)};return jsxDevRuntimeExports.jsxDEV("div",{style:{height:r},children:jsxDevRuntimeExports.jsxDEV(libExports$i.Worker,{workerUrl:pdfjsWorker,children:jsxDevRuntimeExports.jsxDEV(libExports$i.ThemeContext.Provider,{value:l,children:jsxDevRuntimeExports.jsxDEV(libExports$i.LocalizationContext.Provider,{value:S,children:jsxDevRuntimeExports.jsxDEV("div",{className:`rpv-core__viewer rpv-core__viewer--${A}`,style:{border:"1px solid rgba(0, 0, 0, 0.3)",display:"flex",flexDirection:"column",height:"100%"},children:[jsxDevRuntimeExports.jsxDEV("div",{style:{alignItems:"center",backgroundColor:A==="dark"?"#292929":"#eeeeee",borderBottom:A==="dark"?"1px solid #000":"1px solid rgba(0, 0, 0, 0.1)",display:"flex",padding:".25rem"},children:jsxDevRuntimeExports.jsxDEV(h,{},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/pdf/PDF.jsx",lineNumber:79,columnNumber:17},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/pdf/PDF.jsx",lineNumber:70,columnNumber:15},globalThis),jsxDevRuntimeExports.jsxDEV("div",{style:{flex:1,overflow:"hidden"},children:jsxDevRuntimeExports.jsxDEV(libExports$i.Viewer,{renderError:o,fileUrl:k,plugins:[_]},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/pdf/PDF.jsx",lineNumber:87,columnNumber:17},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/pdf/PDF.jsx",lineNumber:81,columnNumber:15},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/pdf/PDF.jsx",lineNumber:61,columnNumber:13},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/pdf/PDF.jsx",lineNumber:60,columnNumber:11},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/pdf/PDF.jsx",lineNumber:59,columnNumber:9},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/pdf/PDF.jsx",lineNumber:58,columnNumber:7},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/pdf/PDF.jsx",lineNumber:57,columnNumber:5},globalThis)});export{PDF as P};