file-viewer-demo/public/file-viewer3/assets/pdf.worker-909112bf.js

67 lines
1.1 MiB
JavaScript
Raw Normal View History

2023-04-24 05:44:48 +00:00
(function(){"use strict";var qn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function fr(en){if(en.__esModule)return en;var rn=en.default;if(typeof rn=="function"){var Gt=function At(){if(this instanceof At){var Yt=[null];Yt.push.apply(Yt,arguments);var mn=Function.bind.apply(rn,Yt);return new mn}return rn.apply(this,arguments)};Gt.prototype=rn.prototype}else Gt={};return Object.defineProperty(Gt,"__esModule",{value:!0}),Object.keys(en).forEach(function(At){var Yt=Object.getOwnPropertyDescriptor(en,At);Object.defineProperty(Gt,At,Yt.get?Yt:{enumerable:!0,get:function(){return en[At]}})}),Gt}var Na={},dr={get exports(){return Na},set exports(en){Na=en}},gr={},mr=Object.freeze({__proto__:null,default:gr}),La=fr(mr),$a={},Ua;function xr(){return Ua||(Ua=1,function(){function en(i,O,P){if(P||arguments.length===2)for(var e,N=0,D=O.length;N<D;N++)!e&&N in O||(e||(e=Array.prototype.slice.call(O,0,N)),e[N]=O[N]);return i.concat(e||Array.prototype.slice.call(O))}var rn={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},Gt=/([astvzqmhlc])([^astvzqmhlc]*)/gi,At=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function Yt(i){var O=[],P=String(i).trim();return P[0]!=="M"&&P[0]!=="m"||P.replace(Gt,function(e,N,D){var L=function(g){var n=g.match(At);return n?n.map(Number):[]}(D),k=N.toLowerCase(),x=N;if(k==="m"&&L.length>2&&(O.push(en([x],L.splice(0,2),!0)),k="l",x=x==="m"?"l":"L"),L.length<rn[k])return"";for(O.push(en([x],L.splice(0,rn[k]),!0));L.length>=rn[k]&&L.length&&rn[k];)O.push(en([x],L.splice(0,rn[k]),!0));return""}),O}function mn(i,O){var P=i.x*Math.cos(O)-i.y*Math.sin(O),e=i.y*Math.cos(O)+i.x*Math.sin(O);i.x=P,i.y=e}function he(i,O){i.x*=O,i.y*=O}var l=function(){function i(O){var P;this.commands=[],O&&O instanceof i?(P=this.commands).push.apply(P,O.commands):O&&(this.commands=Yt(O))}return i.prototype.addPath=function(O){var P;O&&O instanceof i&&(P=this.commands).push.apply(P,O.commands)},i.prototype.moveTo=function(O,P){this.commands.push(["M",O,P])},i.prototype.lineTo=function(O,P){this.commands.push(["L",O,P])},i.prototype.arc=function(O,P,e,N,D,L){this.commands.push(["AC",O,P,e,N,D,!!L])},i.prototype.arcTo=function(O,P,e,N,D){this.commands.push(["AT",O,P,e,N,D])},i.prototype.ellipse=function(O,P,e,N,D,L,k,x){this.commands.push(["E",O,P,e,N,D,L,k,!!x])},i.prototype.closePath=function(){this.commands.push(["Z"])},i.prototype.bezierCurveTo=function(O,P,e,N,D,L){this.commands.push(["C",O,P,e,N,D,L])},i.prototype.quadraticCurveTo=function(O,P,e,N){this.commands.push(["Q",O,P,e,N])},i.prototype.rect=function(O,P,e,N){this.commands.push(["R",O,P,e,N])},i.prototype.roundRect=function(O,P,e,N,D){D===void 0?this.commands.push(["RR",O,P,e,N,0]):this.commands.push(["RR",O,P,e,N,D])},i}();function w(i,O){var P,e,N,D,L,k,x,g,n,I,B,h,c,C,u,m,X,f,F,s,d,S,r,o,A=0,p=0,v=null,R=null,T=null,y=null,H=null,z=null;i.beginPath();for(var $=0;$<O.length;++$){(f=O[$][0])!=="S"&&f!=="s"&&f!=="C"&&f!=="c"&&(v=null,R=null),f!=="T"&&f!=="t"&&f!=="Q"&&f!=="q"&&(T=null,y=null);var j=void 0;switch(f){case"m":case"M":j=O[$],f==="m"?(A+=j[1],p+=j[2]):(A=j[1],p=j[2]),f!=="M"&&H||(H={x:A,y:p}),i.moveTo(A,p);break;case"l":A+=(j=O[$])[1],p+=j[2],i.lineTo(A,p);break;case"L":A=(j=O[$])[1],p=j[2],i.lineTo(A,p);break;case"H":A=(j=O[$])[1],i.lineTo(A,p);break;case"h":A+=(j=O[$])[1],i.lineTo(A,p);break;case"V":p=(j=O[$])[1],i.lineTo(A,p);break;case"v":p+=(j=O[$])[1],i.lineTo(A,p);break;case"a":case"A":if(j=O[$],z===null)throw new Error("This should never happen");f==="a"?(A+=j[6],p+=j[7]):(A=j[6],p=j[7]),C=j[1],u=j[2],x=j[3]*Math.PI/180,N=!!j[4],D=!!j[5],L={x:A,y:p},mn(k={x:(z.x-L.x)/2,y:(z.y-L.y)/2},-x),(g=k.x*k.x/(C*C)+k.y*k.y/(u*u))>1&&(C*=g=Math.sqrt(g),u*=g),n=C*C*u*u,I=C*C*k.y*k.y+u*u*k.x*k.x,he(F={x:C*k.y/u,y:-u*k.x/C},D!==N?Math.sqrt((n-I)/I)||0:-Math.sqrt((n-I)/I)||0),e=Math.atan2((k.y-F.y)/u,(k.x-F.x)/C),P=Math.atan2(-(k.y+F.y)/u,-(k.x+F.x)/C),mn(F,x),S=F,r=(L.x+z.x)/2,o=(L.y+z.y)/2,S.x+=r,S.y+=o,i.save(),i.translate(F.x,F.y),i.rotate(x),i.scale(C,u),i.arc(0,0,1,e,P,!D),i.restore();break;case"C":v=(j=O[$])[3],R=j[4
`?"\\n":$==="\r"?"\\r":`\\${$}`)}function s(z,$,j,V){if(!z)return;let ee=null;if(z instanceof i.Ref){if(V.has(z))return;ee=z,V.put(ee),z=$.fetch(z)}if(Array.isArray(z))for(const U of z)s(U,$,j,V);else if(z instanceof i.Dict){if((0,i.isName)(z.get("S"),"JavaScript")){const U=z.get("JS");let G;U instanceof O.BaseStream?G=U.getString():typeof U=="string"&&(G=U),G=G&&(0,t.stringToPDFString)(G).replace(/\u0000/g,""),G&&j.push(G)}s(z.getRaw("Next"),$,j,V)}ee&&V.remove(ee)}function d(z,$,j){const V=Object.create(null),ee=n({dict:$,key:"AA",stopWhenFound:!1});if(ee)for(let U=ee.length-1;U>=0;U--){const G=ee[U];if(G instanceof i.Dict)for(const Y of G.getKeys()){const oe=j[Y];if(!oe)continue;const se=G.getRaw(Y),Q=new i.RefSet,E=[];s(se,z,E,Q),E.length>0&&(V[oe]=E)}}if($.has("A")){const U=$.get("A"),G=new i.RefSet,Y=[];s(U,z,Y,G),Y.length>0&&(V.Action=Y)}return(0,t.objectSize)(V)>0?V:null}const S={60:"&lt;",62:"&gt;",38:"&amp;",34:"&quot;",39:"&apos;"};function r(z){const $=[];let j=0;for(let V=0,ee=z.length;V<ee;V++){const U=z.codePointAt(V);if(32<=U&&U<=126){const G=S[U];G&&(j<V&&$.push(z.substring(j,V)),$.push(G),j=V+1)}else j<V&&$.push(z.substring(j,V)),$.push(`&#x${U.toString(16).toUpperCase()};`),U>55295&&(U<57344||U>65533)&&V++,j=V+1}return $.length===0?z:(j<z.length&&$.push(z.substring(j,z.length)),$.join(""))}function o(z){const $="14",j="400",V=new Set(["100","200","300","400","500","600","700","800","900","1000","normal","bold","bolder","lighter"]),{fontFamily:ee,fontWeight:U,italicAngle:G}=z;if(/^".*"$/.test(ee)){if(/[^\\]"/.test(ee.slice(1,ee.length-1)))return(0,t.warn)(`XFA - FontFamily contains some unescaped ": ${ee}.`),!1}else if(/^'.*'$/.test(ee)){if(/[^\\]'/.test(ee.slice(1,ee.length-1)))return(0,t.warn)(`XFA - FontFamily contains some unescaped ': ${ee}.`),!1}else for(const se of ee.split(/[ \t]+/))if(/^(\d|(-(\d|-)))/.test(se)||!/^[\w-\\]+$/.test(se))return(0,t.warn)(`XFA - FontFamily contains some invalid <custom-ident>: ${ee}.`),!1;const Y=U?U.toString():"";z.fontWeight=V.has(Y)?Y:j;const oe=parseFloat(G);return z.italicAngle=isNaN(oe)||oe<-90||oe>90?$:G.toString(),!0}function A(z){const $=["app.launchURL","window.open","xfa.host.gotoURL"],V=new RegExp("^\\s*("+$.join("|").split(".").join("\\.")+`)\\((?:'|")([^'"]*)(?:'|")(?:,\\s*(\\w+)\\)|\\))`,"i").exec(z);if(V&&V[2]){const ee=V[2];let U=!1;return V[3]==="true"&&V[1]==="app.launchURL"&&(U=!0),{url:ee,newWindow:U}}return null}function p(z){if(Number.isInteger(z))return z.toString();const $=Math.round(z*100);return $%100===0?($/100).toString():$%10===0?z.toFixed(1):z.toFixed(2)}function v(z){if(!z)return null;const $=new Map;for(const[j,V]of z){if(!j.startsWith(t.AnnotationEditorPrefix))continue;let ee=$.get(V.pageIndex);ee||(ee=[],$.set(V.pageIndex,ee)),ee.push(V)}return $.size>0?$:null}function R(z){return/^[\x00-\x7F]*$/.test(z)}function T(z){const $=[];for(let j=0,V=z.length;j<V;j++){const ee=z.charCodeAt(j);$.push((ee>>8&255).toString(16).padStart(2,"0"),(ee&255).toString(16).padStart(2,"0"))}return $.join("")}function y(z){let $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const j=[];$&&j.push("þÿ");for(let V=0,ee=z.length;V<ee;V++){const U=z.charCodeAt(V);j.push(String.fromCharCode(U>>8&255),String.fromCharCode(U&255))}return j.join("")}function H(z,$,j){switch(z){case 90:return[0,1,-1,0,$,0];case 180:return[-1,0,0,-1,$,j];case 270:return[0,-1,1,0,0,j];default:throw new Error("Invalid rotation")}}},(he,l,w)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.RefSetCache=l.RefSet=l.Ref=l.Name=l.EOF=l.Dict=l.Cmd=l.CIRCULAR_REF=void 0,l.clearPrimitiveCaches=h,l.isCmd=n,l.isDict=I,l.isName=g,l.isRefsEqual=B;var t=w(2);const i=Symbol("CIRCULAR_REF");l.CIRCULAR_REF=i;const O=Symbol("EOF");l.EOF=O;const P=function(){let C=Object.create(null);class u{constructor(X){this.name=X}static get(X){return C[X]||(C[X]=new u(X))}static _clearCache(){C=Object.create(null)}}return u}();l.Name=P;const e=function(){let C=Object.create(null);class u{constructor(X){this.cmd=X}static get(X){return C[X]||(C[X]=new u(X))}static _clearCache(){C=Object.create(nul
`);return`/Tx BMC q ${Fe}BT `+E+` 1 0 0 1 0 ${(0,i.numberToString)(te)} Tm ${pe} ET Q EMC`}_splitLine(E,M,_,J){let K=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{};E=K.line||E;const te=K.glyphs||M.charsToGlyphs(E);if(te.length<=1)return[E];const Z=K.positions||M.getCharPositions(E),ce=_/1e3,ne=[];let re=-1,ie=-1,ae=-1,ue=0,fe=0;for(let me=0,Fe=te.length;me<Fe;me++){const[pe,Ce]=Z[me],be=te[me],Ie=be.width*ce;be.unicode===" "?fe+Ie>J?(ne.push(E.substring(ue,pe)),ue=pe,fe=Ie,re=-1,ae=-1):(fe+=Ie,re=pe,ie=Ce,ae=me):fe+Ie>J?re!==-1?(ne.push(E.substring(ue,ie)),ue=ie,me=ae+1,re=-1,fe=0):(ne.push(E.substring(ue,pe)),ue=pe,fe=Ie):fe+=Ie}return ue<E.length&&ne.push(E.substring(ue,E.length)),ne}getFieldObject(){return{id:this.data.id,value:this.data.fieldValue,defaultValue:this.data.defaultFieldValue||"",multiline:this.data.multiLine,password:this.hasFieldFlag(t.AnnotationFieldFlag.PASSWORD),charLimit:this.data.maxLen,comb:this.data.comb,editable:!this.data.readOnly,hidden:this.data.hidden,name:this.data.fieldName,rect:this.data.rect,actions:this.data.actions,page:this.data.pageIndex,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,rotation:this.rotation,type:"text"}}}class S extends s{constructor(E){super(E),this.checkedAppearance=null,this.uncheckedAppearance=null,this.data.checkBox=!this.hasFieldFlag(t.AnnotationFieldFlag.RADIO)&&!this.hasFieldFlag(t.AnnotationFieldFlag.PUSHBUTTON),this.data.radioButton=this.hasFieldFlag(t.AnnotationFieldFlag.RADIO)&&!this.hasFieldFlag(t.AnnotationFieldFlag.PUSHBUTTON),this.data.pushButton=this.hasFieldFlag(t.AnnotationFieldFlag.PUSHBUTTON),this.data.isTooltipOnly=!1,this.data.checkBox?this._processCheckBox(E):this.data.radioButton?this._processRadioButton(E):this.data.pushButton?(this.data.hasOwnCanvas=!0,this._processPushButton(E)):(0,t.warn)("Invalid field flags for button widget annotation")}async getOperatorList(E,M,_,J,K){if(this.data.pushButton)return super.getOperatorList(E,M,_,!1,K);let te=null,Z=null;if(K){const ne=K.get(this.data.id);te=ne?ne.value:null,Z=ne?ne.rotation:null}if(te===null&&this.appearance)return super.getOperatorList(E,M,_,J,K);te==null&&(this.data.checkBox?te=this.data.fieldValue===this.data.exportValue:te=this.data.fieldValue===this.data.buttonValue);const ce=te?this.checkedAppearance:this.uncheckedAppearance;if(ce){const ne=this.appearance,re=ce.dict.getArray("Matrix")||t.IDENTITY_MATRIX;Z&&ce.dict.set("Matrix",this.getRotationMatrix(K)),this.appearance=ce;const ie=super.getOperatorList(E,M,_,J,K);return this.appearance=ne,ce.dict.set("Matrix",re),ie}return{opList:new n.OperatorList,separateForm:!1,separateCanvas:!1}}async save(E,M,_){return this.data.checkBox?this._saveCheckbox(E,M,_):this.data.radioButton?this._saveRadioButton(E,M,_):null}async _saveCheckbox(E,M,_){if(!_)return null;const J=_.get(this.data.id);let K=J&&J.rotation,te=J&&J.value;if(K===void 0&&(te===void 0||this.data.fieldValue===this.data.exportValue===te))return null;const Z=E.xref.fetchIfRef(this.ref);if(!(Z instanceof P.Dict))return null;K===void 0&&(K=this.rotation),te===void 0&&(te=this.data.fieldValue===this.data.exportValue);const ce={path:this.data.fieldName,value:te?this.data.exportValue:""},ne=P.Name.get(te?this.data.exportValue:"Off");Z.set("V",ne),Z.set("AS",ne),Z.set("M",`D:${(0,t.getModificationDate)()}`);const re=this._getMKDict(K);re&&Z.set("MK",re);const ie=E.xref.encrypt;let ae=null;ie&&(ae=ie.createCipherTransform(this.ref.num,this.ref.gen));const ue=[`${this.ref.num} ${this.ref.gen} obj
`];return(0,e.writeDict)(Z,ue,ae),ue.push(`
endobj
`),[{ref:this.ref,data:ue.join(""),xfa:ce}]}async _saveRadioButton(E,M,_){if(!_)return null;const J=_.get(this.data.id);let K=J&&J.rotation,te=J&&J.value;if(K===void 0&&(te===void 0||this.data.fieldValue===this.data.buttonValue===te))return null;const Z=E.xref.fetchIfRef(this.ref);if(!(Z instanceof P.Dict))return null;te===void 0&&(te=this.data.fieldValue===this.data.buttonValue),K===void 0&&(K=this.rotation);const ce={path:this.data.fieldName,value:te?this.data.buttonValue:""},ne=P.Name.get(te?this.data.buttonValue:"Off");let re=null;const ie=E.xref.encrypt;if(te)if(this.parent instanceof P.Ref){const Fe=E.xref.fetch(this.parent);let pe=null;ie&&(pe=ie.createCipherTransform(this.parent.num,this.parent.gen)),Fe.set("V",ne),re=[`${this.parent.num} ${this.parent.gen} obj
`],(0,e.writeDict)(Fe,re,pe),re.push(`
endobj
`)}else this.parent instanceof P.Dict&&this.parent.set("V",ne);Z.set("AS",ne),Z.set("M",`D:${(0,t.getModificationDate)()}`);const ae=this._getMKDict(K);ae&&Z.set("MK",ae);let ue=null;ie&&(ue=ie.createCipherTransform(this.ref.num,this.ref.gen));const fe=[`${this.ref.num} ${this.ref.gen} obj
`];(0,e.writeDict)(Z,fe,ue),fe.push(`
endobj
`);const me=[{ref:this.ref,data:fe.join(""),xfa:ce}];return re!==null&&me.push({ref:this.parent,data:re.join(""),xfa:null}),me}_getDefaultCheckedAppearance(E,M){const _=this.data.rect[2]-this.data.rect[0],J=this.data.rect[3]-this.data.rect[1],K=[0,0,_,J],te=.8,Z=Math.min(_,J)*te;let ce,ne;M==="check"?(ce={width:.755*Z,height:.705*Z},ne="3"):M==="disc"?(ce={width:.791*Z,height:.705*Z},ne="l"):(0,t.unreachable)(`_getDefaultCheckedAppearance - unsupported type: ${M}`);const re=(0,i.numberToString)((_-ce.width)/2),ie=(0,i.numberToString)((J-ce.height)/2),ae=`q BT /PdfJsZaDb ${Z} Tf 0 g ${re} ${ie} Td (${ne}) Tj ET Q`,ue=new P.Dict(E.xref);ue.set("FormType",1),ue.set("Subtype",P.Name.get("Form")),ue.set("Type",P.Name.get("XObject")),ue.set("BBox",K),ue.set("Matrix",[1,0,0,1,0,0]),ue.set("Length",ae.length);const fe=new P.Dict(E.xref),me=new P.Dict(E.xref);me.set("PdfJsZaDb",this.fallbackFontDict),fe.set("Font",me),ue.set("Resources",fe),this.checkedAppearance=new I.StringStream(ae),this.checkedAppearance.dict=ue,this._streams.push(this.checkedAppearance)}_processCheckBox(E){const M=E.dict.get("AP");if(!(M instanceof P.Dict))return;const _=M.get("N");if(!(_ instanceof P.Dict))return;const J=this._decodeFormValue(E.dict.get("AS"));typeof J=="string"&&(this.data.fieldValue=J);const K=this.data.fieldValue!==null&&this.data.fieldValue!=="Off"?this.data.fieldValue:"Yes",te=_.getKeys();if(te.length===0)te.push("Off",K);else if(te.length===1)te[0]==="Off"?te.push(K):te.unshift("Off");else if(te.includes(K))te.length=0,te.push("Off",K);else{const ne=te.find(re=>re!=="Off");te.length=0,te.push("Off",ne)}te.includes(this.data.fieldValue)||(this.data.fieldValue="Off"),this.data.exportValue=te[1];const Z=_.get(this.data.exportValue);this.checkedAppearance=Z instanceof N.BaseStream?Z:null;const ce=_.get("Off");this.uncheckedAppearance=ce instanceof N.BaseStream?ce:null,this.checkedAppearance?this._streams.push(this.checkedAppearance):this._getDefaultCheckedAppearance(E,"check"),this.uncheckedAppearance&&this._streams.push(this.uncheckedAppearance),this._fallbackFontDict=this.fallbackFontDict}_processRadioButton(E){this.data.fieldValue=this.data.buttonValue=null;const M=E.dict.get("Parent");if(M instanceof P.Dict){this.parent=E.dict.getRaw("Parent");const Z=M.get("V");Z instanceof P.Name&&(this.data.fieldValue=this._decodeFormValue(Z))}const _=E.dict.get("AP");if(!(_ instanceof P.Dict))return;const J=_.get("N");if(!(J instanceof P.Dict))return;for(const Z of J.getKeys())if(Z!=="Off"){this.data.buttonValue=this._decodeFormValue(Z);break}const K=J.get(this.data.buttonValue);this.checkedAppearance=K instanceof N.BaseStream?K:null;const te=J.get("Off");this.uncheckedAppearance=te instanceof N.BaseStream?te:null,this.checkedAppearance?this._streams.push(this.checkedAppearance):this._getDefaultCheckedAppearance(E,"disc"),this.uncheckedAppearance&&this._streams.push(this.uncheckedAppearance),this._fallbackFontDict=this.fallbackFontDict}_processPushButton(E){if(!E.dict.has("A")&&!E.dict.has("AA")&&!this.data.alternativeText){(0,t.warn)("Push buttons without action dictionaries are not supported");return}this.data.isTooltipOnly=!E.dict.has("A")&&!E.dict.has("AA"),L.Catalog.parseDestDictionary({destDict:E.dict,resultObj:this.data,docBaseUrl:E.pdfManager.docBaseUrl,docAttachments:E.attachments})}getFieldObject(){let E="button",M;return this.data.checkBox?(E="checkbox",M=this.data.exportValue):this.data.radioButton&&(E="radiobutton",M=this.data.buttonValue),{id:this.data.id,value:this.data.fieldValue||"Off",defaultValue:this.data.defaultFieldValue,exportValues:M,editable:!this.data.readOnly,name:this.data.fieldName,rect:this.data.rect,hidden:this.data.hidden,actions:this.data.actions,page:this.data.pageIndex,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,rotation:this.rotation,type:E}}get fallbackFontDict(){const E=new P.Dict;return E.set("BaseFont",P.Name.get("ZapfDingbats")),E.set("Type",P.Name.get("FallbackType")),E.set("Subtype",P.Name.get("FallbackType")),E.set("Encoding",P.Name.get("ZapfDingbatsEncoding")),(0,t.shadow)(thi
`)}}class o extends s{constructor(E){super(E),this.data.fieldValue=null}getFieldObject(){return{id:this.data.id,value:null,page:this.data.pageIndex,type:"signature"}}}class A extends F{constructor(E){super(E);const{dict:_}=E;this.data.annotationType=t.AnnotationType.TEXT,this.data.hasAppearance?this.data.name="NoIcon":(this.data.rect[1]=this.data.rect[3]-22,this.data.rect[2]=this.data.rect[0]+22,this.data.name=_.has("Name")?_.get("Name").name:"Note"),_.has("State")?(this.data.state=_.get("State")||null,this.data.stateModel=_.get("StateModel")||null):(this.data.state=null,this.data.stateModel=null)}}class p extends X{constructor(E){super(E),this.data.annotationType=t.AnnotationType.LINK;const M=u(E.dict,this.rectangle);M&&(this.data.quadPoints=M),this.data.borderColor=this.data.borderColor||this.data.color,L.Catalog.parseDestDictionary({destDict:E.dict,resultObj:this.data,docBaseUrl:E.pdfManager.docBaseUrl,docAttachments:E.attachments})}}class v extends X{constructor(E){super(E);const{dict:M}=E;this.data.annotationType=t.AnnotationType.POPUP;let _=M.get("Parent");if(!_){(0,t.warn)("Popup annotation has a missing or invalid parent annotation.");return}const J=_.get("Subtype");this.data.parentType=J instanceof P.Name?J.name:null;const K=M.getRaw("Parent");this.data.parentId=K instanceof P.Ref?K.toString():null;const te=_.getArray("Rect");Array.isArray(te)&&te.length===4?this.data.parentRect=t.Util.normalizeRect(te):this.data.parentRect=[0,0,0,0];const Z=_.get("RT");if((0,P.isName)(Z,t.AnnotationReplyType.GROUP)&&(_=_.get("IRT")),_.has("M")?(this.setModificationDate(_.get("M")),this.data.modificationDate=this.modificationDate):this.data.modificationDate=null,_.has("C")?(this.setColor(_.getArray("C")),this.data.color=this.color):this.data.color=null,!this.viewable){const ce=_.get("F");this._isViewable(ce)&&this.setFlags(ce)}this.setTitle(_.get("T")),this.data.titleObj=this._title,this.setContents(_.get("Contents")),this.data.contentsObj=this._contents,_.has("RC")&&(this.data.richText=B.XFAFactory.getRichTextAsHtml(_.get("RC")))}}l.PopupAnnotation=v;class R extends F{constructor(E){super(E);const{xref:M}=E;if(this.data.annotationType=t.AnnotationType.FREETEXT,this.setDefaultAppearance(E),!this.appearance&&this._isOffscreenCanvasSupported){const _=E.dict.get("CA"),J=new O.FakeUnicodeFont(M,"sans-serif"),K=this.data.defaultAppearanceData;this.appearance=J.createAppearance(this._contents.str,this.rectangle,this.rotation,K.fontSize||10,K.fontColor,_),this._streams.push(this.appearance,O.FakeUnicodeFont.toUnicodeStream)}else this._isOffscreenCanvasSupported||(0,t.warn)("FreeTextAnnotation: OffscreenCanvas is not supported, annotation may not render correctly.")}get hasTextContent(){return!!this.appearance}static createNewDict(E,M,_){let{apRef:J,ap:K}=_;const{color:te,fontSize:Z,rect:ce,rotation:ne,user:re,value:ie}=E,ae=new P.Dict(M);ae.set("Type",P.Name.get("Annot")),ae.set("Subtype",P.Name.get("FreeText")),ae.set("CreationDate",`D:${(0,t.getModificationDate)()}`),ae.set("Rect",ce);const ue=`/Helv ${Z} Tf ${(0,O.getPdfColor)(te,!0)}`;if(ae.set("DA",ue),ae.set("Contents",(0,i.isAscii)(ie)?ie:(0,i.stringToUTF16String)(ie,!0)),ae.set("F",4),ae.set("Border",[0,0,0]),ae.set("Rotate",ne),re&&ae.set("T",(0,i.isAscii)(re)?re:(0,i.stringToUTF16String)(re,!0)),J||K){const fe=new P.Dict(M);ae.set("AP",fe),J?fe.set("N",J):fe.set("N",K)}return ae}static async createNewAppearanceStream(E,M,_){const{baseFontRef:J,evaluator:K,task:te}=_,{color:Z,fontSize:ce,rect:ne,rotation:re,value:ie}=E,ae=new P.Dict(M),ue=new P.Dict(M);if(J)ue.set("Helv",J);else{const rt=new P.Dict(M);rt.set("BaseFont",P.Name.get("Helvetica")),rt.set("Type",P.Name.get("Font")),rt.set("Subtype",P.Name.get("Type1")),rt.set("Encoding",P.Name.get("WinAnsiEncoding")),ue.set("Helv",rt)}ae.set("Font",ue);const fe=await s._getFontData(K,te,{fontName:"Helvetica",fontSize:ce},ae),[me,Fe,pe,Ce]=ne;let be=pe-me,Ie=Ce-Fe;re%180!==0&&([be,Ie]=[Ie,be]);const ye=ie.split(`
`),de=ce/1e3;let ge=-1/0;const xe=[];for(let rt of ye){const Xe=fe.encodeString(rt);if(Xe.length>1)return null;rt=Xe.join(""),xe.push(rt);let Je=0;const et=fe.charsToGlyphs(rt);for(const pt of et)Je+=pt.width*de;ge=Math.max(ge,Je)}let Oe=1;ge>be&&(Oe=be/ge);let je=1;const it=t.LINE_FACTOR*ce,ke=t.LINE_DESCENT_FACTOR*ce,$e=it*ye.length;$e>Ie&&(je=Ie/$e);const Ge=Math.min(Oe,je),Qe=ce*Ge,ve=["q",`0 0 ${(0,i.numberToString)(be)} ${(0,i.numberToString)(Ie)} re W n`,"BT",`1 0 0 1 0 ${(0,i.numberToString)(Ie+ke)} Tm 0 Tc ${(0,O.getPdfColor)(Z,!0)}`,`/Helv ${(0,i.numberToString)(Qe)} Tf`],Ne=(0,i.numberToString)(it);for(const rt of xe)ve.push(`0 -${Ne} Td (${(0,i.escapeString)(rt)}) Tj`);ve.push("ET","Q");const Me=ve.join(`
`),nt=new P.Dict(M);if(nt.set("FormType",1),nt.set("Subtype",P.Name.get("Form")),nt.set("Type",P.Name.get("XObject")),nt.set("BBox",[0,0,be,Ie]),nt.set("Resources",ae),re){const rt=(0,i.getRotationMatrix)(re,be,Ie);nt.set("Matrix",rt)}const _e=new I.StringStream(Me);return _e.dict=nt,_e}}class T extends F{constructor(E){super(E);const{dict:M,xref:_}=E;this.data.annotationType=t.AnnotationType.LINE;const J=M.getArray("L");if(this.data.lineCoordinates=t.Util.normalizeRect(J),this.setLineEndings(M.getArray("LE")),this.data.lineEndings=this.lineEndings,!this.appearance){const K=this.color?C(this.color):[0,0,0],te=M.get("CA"),Z=c(M.getArray("IC"),null),ce=Z?C(Z):null,ne=ce?te:null,re=this.borderStyle.width||1,ie=2*re,ae=[this.data.lineCoordinates[0]-ie,this.data.lineCoordinates[1]-ie,this.data.lineCoordinates[2]+ie,this.data.lineCoordinates[3]+ie];t.Util.intersect(this.rectangle,ae)||(this.rectangle=ae),this._setDefaultAppearance({xref:_,extra:`${re} w`,strokeColor:K,fillColor:ce,strokeAlpha:te,fillAlpha:ne,pointsCallback:(ue,fe)=>(ue.push(`${J[0]} ${J[1]} m`,`${J[2]} ${J[3]} l`,"S"),[fe[0].x-re,fe[1].x+re,fe[3].y-re,fe[1].y+re])})}}}class y extends F{constructor(E){super(E);const{dict:M,xref:_}=E;if(this.data.annotationType=t.AnnotationType.SQUARE,!this.appearance){const J=this.color?C(this.color):[0,0,0],K=M.get("CA"),te=c(M.getArray("IC"),null),Z=te?C(te):null,ce=Z?K:null;if(this.borderStyle.width===0&&!Z)return;this._setDefaultAppearance({xref:_,extra:`${this.borderStyle.width} w`,strokeColor:J,fillColor:Z,strokeAlpha:K,fillAlpha:ce,pointsCallback:(ne,re)=>{const ie=re[2].x+this.borderStyle.width/2,ae=re[2].y+this.borderStyle.width/2,ue=re[3].x-re[2].x-this.borderStyle.width,fe=re[1].y-re[3].y-this.borderStyle.width;return ne.push(`${ie} ${ae} ${ue} ${fe} re`),Z?ne.push("B"):ne.push("S"),[re[0].x,re[1].x,re[3].y,re[1].y]}})}}}class H extends F{constructor(E){super(E);const{dict:M,xref:_}=E;if(this.data.annotationType=t.AnnotationType.CIRCLE,!this.appearance){const J=this.color?C(this.color):[0,0,0],K=M.get("CA"),te=c(M.getArray("IC"),null),Z=te?C(te):null,ce=Z?K:null;if(this.borderStyle.width===0&&!Z)return;const ne=4/3*Math.tan(Math.PI/(2*4));this._setDefaultAppearance({xref:_,extra:`${this.borderStyle.width} w`,strokeColor:J,fillColor:Z,strokeAlpha:K,fillAlpha:ce,pointsCallback:(re,ie)=>{const ae=ie[0].x+this.borderStyle.width/2,ue=ie[0].y-this.borderStyle.width/2,fe=ie[3].x-this.borderStyle.width/2,me=ie[3].y+this.borderStyle.width/2,Fe=ae+(fe-ae)/2,pe=ue+(me-ue)/2,Ce=(fe-ae)/2*ne,be=(me-ue)/2*ne;return re.push(`${Fe} ${me} m`,`${Fe+Ce} ${me} ${fe} ${pe+be} ${fe} ${pe} c`,`${fe} ${pe-be} ${Fe+Ce} ${ue} ${Fe} ${ue} c`,`${Fe-Ce} ${ue} ${ae} ${pe-be} ${ae} ${pe} c`,`${ae} ${pe+be} ${Fe-Ce} ${me} ${Fe} ${me} c`,"h"),Z?re.push("B"):re.push("S"),[ie[0].x,ie[1].x,ie[3].y,ie[1].y]}})}}}class z extends F{constructor(E){super(E);const{dict:M,xref:_}=E;this.data.annotationType=t.AnnotationType.POLYLINE,this.data.vertices=[],this instanceof $||(this.setLineEndings(M.getArray("LE")),this.data.lineEndings=this.lineEndings);const J=M.getArray("Vertices");if(Array.isArray(J)){for(let K=0,te=J.length;K<te;K+=2)this.data.vertices.push({x:J[K],y:J[K+1]});if(!this.appearance){const K=this.color?C(this.color):[0,0,0],te=M.get("CA"),Z=this.borderStyle.width||1,ce=2*Z,ne=[1/0,1/0,-1/0,-1/0];for(const re of this.data.vertices)ne[0]=Math.min(ne[0],re.x-ce),ne[1]=Math.min(ne[1],re.y-ce),ne[2]=Math.max(ne[2],re.x+ce),ne[3]=Math.max(ne[3],re.y+ce);t.Util.intersect(this.rectangle,ne)||(this.rectangle=ne),this._setDefaultAppearance({xref:_,extra:`${Z} w`,strokeColor:K,strokeAlpha:te,pointsCallback:(re,ie)=>{const ae=this.data.vertices;for(let ue=0,fe=ae.length;ue<fe;ue++)re.push(`${ae[ue].x} ${ae[ue].y} ${ue===0?"m":"l"}`);return re.push("S"),[ie[0].x,ie[1].x,ie[3].y,ie[1].y]}})}}}}class $ extends z{constructor(E){super(E),this.data.annotationType=t.AnnotationType.POLYGON}}class j extends F{constructor(E){super(E),this.data.annotationType=t.AnnotationType.CARET}}class V extends F{constructor(E){super(E);const{dict:M,xref:_}=E;this.data.annotationT
`))}const Ce=Fe.join(`
`),be=new P.Dict(M);if(be.set("FormType",1),be.set("Subtype",P.Name.get("Form")),be.set("Type",P.Name.get("XObject")),be.set("BBox",[0,0,fe,me]),be.set("Length",Ce.length),te){const ye=(0,i.getRotationMatrix)(te,fe,me);be.set("Matrix",ye)}if(ne!==1){const ye=new P.Dict(M),de=new P.Dict(M),ge=new P.Dict(M);ge.set("CA",ne),ge.set("Type",P.Name.get("ExtGState")),de.set("R0",ge),ye.set("ExtGState",de),be.set("Resources",ye)}const Ie=new I.StringStream(Ce);return Ie.dict=be,Ie}}class ee extends F{constructor(E){super(E);const{dict:M,xref:_}=E;if(this.data.annotationType=t.AnnotationType.HIGHLIGHT,this.data.quadPoints=u(M,null)){const K=this.appearance&&this.appearance.dict.get("Resources");if(!this.appearance||!(K&&K.has("ExtGState"))){this.appearance&&(0,t.warn)("HighlightAnnotation - ignoring built-in appearance stream.");const te=this.color?C(this.color):[1,1,0],Z=M.get("CA");this._setDefaultAppearance({xref:_,fillColor:te,blendMode:"Multiply",fillAlpha:Z,pointsCallback:(ce,ne)=>(ce.push(`${ne[0].x} ${ne[0].y} m`,`${ne[1].x} ${ne[1].y} l`,`${ne[3].x} ${ne[3].y} l`,`${ne[2].x} ${ne[2].y} l`,"f"),[ne[0].x,ne[1].x,ne[3].y,ne[1].y])})}}else this.data.hasPopup=!1}}class U extends F{constructor(E){super(E);const{dict:M,xref:_}=E;if(this.data.annotationType=t.AnnotationType.UNDERLINE,this.data.quadPoints=u(M,null)){if(!this.appearance){const K=this.color?C(this.color):[0,0,0],te=M.get("CA");this._setDefaultAppearance({xref:_,extra:"[] 0 d 1 w",strokeColor:K,strokeAlpha:te,pointsCallback:(Z,ce)=>(Z.push(`${ce[2].x} ${ce[2].y} m`,`${ce[3].x} ${ce[3].y} l`,"S"),[ce[0].x,ce[1].x,ce[3].y,ce[1].y])})}}else this.data.hasPopup=!1}}class G extends F{constructor(E){super(E);const{dict:M,xref:_}=E;if(this.data.annotationType=t.AnnotationType.SQUIGGLY,this.data.quadPoints=u(M,null)){if(!this.appearance){const K=this.color?C(this.color):[0,0,0],te=M.get("CA");this._setDefaultAppearance({xref:_,extra:"[] 0 d 1 w",strokeColor:K,strokeAlpha:te,pointsCallback:(Z,ce)=>{const ne=(ce[0].y-ce[2].y)/6;let re=ne,ie=ce[2].x;const ae=ce[2].y,ue=ce[3].x;Z.push(`${ie} ${ae+re} m`);do ie+=2,re=re===0?ne:0,Z.push(`${ie} ${ae+re} l`);while(ie<ue);return Z.push("S"),[ce[2].x,ue,ae-2*ne,ae+2*ne]}})}}else this.data.hasPopup=!1}}class Y extends F{constructor(E){super(E);const{dict:M,xref:_}=E;if(this.data.annotationType=t.AnnotationType.STRIKEOUT,this.data.quadPoints=u(M,null)){if(!this.appearance){const K=this.color?C(this.color):[0,0,0],te=M.get("CA");this._setDefaultAppearance({xref:_,extra:"[] 0 d 1 w",strokeColor:K,strokeAlpha:te,pointsCallback:(Z,ce)=>(Z.push(`${(ce[0].x+ce[2].x)/2} ${(ce[0].y+ce[2].y)/2} m`,`${(ce[1].x+ce[3].x)/2} ${(ce[1].y+ce[3].y)/2} l`,"S"),[ce[0].x,ce[1].x,ce[3].y,ce[1].y])})}}else this.data.hasPopup=!1}}class oe extends F{constructor(E){super(E),this.data.annotationType=t.AnnotationType.STAMP}}class se extends F{constructor(E){super(E);const{dict:M,xref:_}=E,J=new x.FileSpec(M.get("FS"),_);this.data.annotationType=t.AnnotationType.FILEATTACHMENT,this.data.file=J.serializable;const K=M.get("Name");this.data.name=K instanceof P.Name?(0,t.stringToPDFString)(K.name):"PushPin"}}},(he,l,w)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.FakeUnicodeFont=void 0,l.createDefaultAppearance=x,l.getPdfColor=k,l.parseDefaultAppearance=L;var t=w(137),i=w(136),O=w(2),P=w(145),e=w(146),N=w(141);class D extends e.EvaluatorPreprocessor{constructor(I){super(new N.StringStream(I))}parse(){const I={fn:0,args:[]},B={fontSize:0,fontName:"",fontColor:new Uint8ClampedArray(3)};try{for(;I.args.length=0,!!this.read(I);){if(this.savedStatesDepth!==0)continue;const{fn:h,args:c}=I;switch(h|0){case O.OPS.setFont:const[C,u]=c;C instanceof t.Name&&(B.fontName=C.name),typeof u=="number"&&u>0&&(B.fontSize=u);break;case O.OPS.setFillRGBColor:P.ColorSpace.singletons.rgb.getRgbItem(c,0,B.fontColor,0);break;case O.OPS.setFillGray:P.ColorSpace.singletons.gray.getRgbItem(c,0,B.fontColor,0);break;case O.OPS.setFillColorSpace:P.ColorSpace.singletons.cmyk.getRgbItem(c,0,B.fontColor,0);break}}}catch(h){(0,O.warn)(`parseDefaultAppearance - ignoring errors: "${h}".`)}return
12 dict begin
begincmap
/CIDSystemInfo
<< /Registry (Adobe)
/Ordering (UCS) /Supplement 0 >> def
/CMapName /Adobe-Identity-UCS def
/CMapType 2 def
1 begincodespacerange
<0000> <FFFF>
endcodespacerange
1 beginbfrange
<0000> <FFFF> <0000>
endbfrange
endcmap CMapName currentdict /CMap defineresource pop end end`,B=g.toUnicodeStream=new N.StringStream(I),h=new t.Dict(this.xref);B.dict=h,h.set("Length",I.length),g._toUnicodeRef=this.xref.getNewPersistentRef(B)}return g._toUnicodeRef}get fontDescriptorRef(){if(!g._fontDescriptorRef){const I=new t.Dict(this.xref);I.set("Type",t.Name.get("FontDescriptor")),I.set("FontName",this.fontName),I.set("FontFamily","MyriadPro Regular"),I.set("FontBBox",[0,0,0,0]),I.set("FontStretch",t.Name.get("Normal")),I.set("FontWeight",400),I.set("ItalicAngle",0),g._fontDescriptorRef=this.xref.getNewPersistentRef(I)}return g._fontDescriptorRef}get descendantFontRef(){const I=new t.Dict(this.xref);I.set("BaseFont",this.fontName),I.set("Type",t.Name.get("Font")),I.set("Subtype",t.Name.get("CIDFontType0")),I.set("CIDToGIDMap",t.Name.get("Identity")),I.set("FirstChar",this.firstChar),I.set("LastChar",this.lastChar),I.set("FontDescriptor",this.fontDescriptorRef),I.set("DW",1e3);const B=[],h=[...this.widths.entries()].sort();let c=null,C=null;for(const[m,X]of h){if(!c){c=m,C=[X];continue}m===c+C.length?C.push(X):(B.push(c,C),c=m,C=[X])}c&&B.push(c,C),I.set("W",B);const u=new t.Dict(this.xref);return u.set("Ordering","Identity"),u.set("Registry","Adobe"),u.set("Supplement",0),I.set("CIDSystemInfo",u),this.xref.getNewPersistentRef(I)}get baseFontRef(){const I=new t.Dict(this.xref);return I.set("BaseFont",this.fontName),I.set("Type",t.Name.get("Font")),I.set("Subtype",t.Name.get("Type0")),I.set("Encoding",t.Name.get("Identity-H")),I.set("DescendantFonts",[this.descendantFontRef]),I.set("ToUnicode",this.toUnicodeRef),this.xref.getNewPersistentRef(I)}get resources(){const I=new t.Dict(this.xref),B=new t.Dict(this.xref);return B.set(this.fontName.name,this.baseFontRef),I.set("Font",B),I}_createContext(){return this.widths=new Map,this.ctxMeasure.font=`1000px ${this.fontFamily}`,this.ctxMeasure}createFontResources(I){const B=this._createContext();for(const h of I.split(/\r\n?|\n/))for(const c of h.split("")){const C=c.charCodeAt(0);if(this.widths.has(C))continue;const u=B.measureText(c),m=Math.ceil(u.width);this.widths.set(C,m),this.firstChar=Math.min(C,this.firstChar),this.lastChar=Math.max(C,this.lastChar)}return this.resources}createAppearance(I,B,h,c,C,u){const m=this._createContext(),X=[];let f=-1/0;for(const G of I.split(/\r\n?|\n/)){X.push(G);const Y=m.measureText(G).width;f=Math.max(f,Y);for(const oe of G.split("")){const se=oe.charCodeAt(0);let Q=this.widths.get(se);if(Q===void 0){const E=m.measureText(oe);Q=Math.ceil(E.width),this.widths.set(se,Q),this.firstChar=Math.min(se,this.firstChar),this.lastChar=Math.max(se,this.lastChar)}}}f*=c/1e3;const[F,s,d,S]=B;let r=d-F,o=S-s;h%180!==0&&([r,o]=[o,r]);let A=1;f>r&&(A=r/f);let p=1;const v=O.LINE_FACTOR*c,R=O.LINE_DESCENT_FACTOR*c,T=v*X.length;T>o&&(p=o/T);const y=Math.min(A,p),H=c*y,z=["q",`0 0 ${(0,i.numberToString)(r)} ${(0,i.numberToString)(o)} re W n`,"BT",`1 0 0 1 0 ${(0,i.numberToString)(o+R)} Tm 0 Tc ${k(C,!0)}`,`/${this.fontName.name} ${(0,i.numberToString)(H)} Tf`],{resources:$}=this;if(u=typeof u=="number"&&u>=0&&u<=1?u:1,u!==1){z.push("/R0 gs");const G=new t.Dict(this.xref),Y=new t.Dict(this.xref);Y.set("ca",u),Y.set("CA",u),Y.set("Type",t.Name.get("ExtGState")),G.set("R0",Y),$.set("ExtGState",G)}const j=(0,i.numberToString)(v);for(const G of X)z.push(`0 -${j} Td <${(0,i.stringToUTF16HexString)(G)}> Tj`);z.push("ET","Q");const V=z.join(`
`),ee=new t.Dict(this.xref);if(ee.set("Subtype",t.Name.get("Form")),ee.set("Type",t.Name.get("XObject")),ee.set("BBox",[0,0,r,o]),ee.set("Length",V.length),ee.set("Resources",$),h){const G=(0,i.getRotationMatrix)(h,r,o);ee.set("Matrix",G)}const U=new N.StringStream(V);return U.dict=ee,U}}l.FakeUnicodeFont=g},(he,l,w)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorSpace=void 0;var t=w(2),i=w(137),O=w(138),P=w(136);function e(c,C,u,m,X,f,F){F=F!==1?0:F;const d=u/X,S=m/f;let r=0,o;const A=new Uint16Array(X),p=u*3;for(let v=0;v<X;v++)A[v]=Math.floor(v*d)*3;for(let v=0;v<f;v++){const R=Math.floor(v*S)*p;for(let T=0;T<X;T++)o=R+A[T],C[r++]=c[o++],C[r++]=c[o++],C[r++]=c[o++],r+=F}}class N{constructor(C,u){this.constructor===N&&(0,t.unreachable)("Cannot initialize ColorSpace."),this.name=C,this.numComps=u}getRgb(C,u){const m=new Uint8ClampedArray(3);return this.getRgbItem(C,u,m,0),m}getRgbItem(C,u,m,X){(0,t.unreachable)("Should not call ColorSpace.getRgbItem")}getRgbBuffer(C,u,m,X,f,F,s){(0,t.unreachable)("Should not call ColorSpace.getRgbBuffer")}getOutputLength(C,u){(0,t.unreachable)("Should not call ColorSpace.getOutputLength")}isPassthrough(C){return!1}isDefaultDecode(C,u){return N.isDefaultDecode(C,this.numComps)}fillRgb(C,u,m,X,f,F,s,d,S){const r=u*m;let o=null;const A=1<<s,p=m!==f||u!==X;if(this.isPassthrough(s))o=d;else if(this.numComps===1&&r>A&&this.name!=="DeviceGray"&&this.name!=="DeviceRGB"){const v=s<=8?new Uint8Array(A):new Uint16Array(A);for(let T=0;T<A;T++)v[T]=T;const R=new Uint8ClampedArray(A*3);if(this.getRgbBuffer(v,0,A,R,0,s,0),p){o=new Uint8Array(r*3);let T=0;for(let y=0;y<r;++y){const H=d[y]*3;o[T++]=R[H],o[T++]=R[H+1],o[T++]=R[H+2]}}else{let T=0;for(let y=0;y<r;++y){const H=d[y]*3;C[T++]=R[H],C[T++]=R[H+1],C[T++]=R[H+2],T+=S}}}else p?(o=new Uint8ClampedArray(r*3),this.getRgbBuffer(d,0,r,o,0,s,0)):this.getRgbBuffer(d,0,X*F,C,0,s,S);if(o)if(p)e(o,C,u,m,X,f,S);else{let v=0,R=0;for(let T=0,y=X*F;T<y;T++)C[v++]=o[R++],C[v++]=o[R++],C[v++]=o[R++],v+=S}}get usesZeroToOneRange(){return(0,t.shadow)(this,"usesZeroToOneRange",!0)}static _cache(C,u,m,X){if(!m)throw new Error('ColorSpace._cache - expected "localColorSpaceCache" argument.');if(!X)throw new Error('ColorSpace._cache - expected "parsedColorSpace" argument.');let f,F;C instanceof i.Ref&&(F=C,C=u.fetch(C)),C instanceof i.Name&&(f=C.name),(f||F)&&m.set(f,F,X)}static getCached(C,u,m){if(!m)throw new Error('ColorSpace.getCached - expected "localColorSpaceCache" argument.');if(C instanceof i.Ref){const X=m.getByRef(C);if(X)return X;try{C=u.fetch(C)}catch(f){if(f instanceof P.MissingDataException)throw f}}if(C instanceof i.Name){const X=m.getByName(C.name);if(X)return X}return null}static async parseAsync(C){let{cs:u,xref:m,resources:X=null,pdfFunctionFactory:f,localColorSpaceCache:F}=C;const s=this._parse(u,m,X,f);return this._cache(u,m,F,s),s}static parse(C){let{cs:u,xref:m,resources:X=null,pdfFunctionFactory:f,localColorSpaceCache:F}=C;const s=this.getCached(u,m,F);if(s)return s;const d=this._parse(u,m,X,f);return this._cache(u,m,F,d),d}static _parse(C,u){let m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,X=arguments.length>3?arguments[3]:void 0;if(C=u.fetchIfRef(C),C instanceof i.Name)switch(C.name){case"G":case"DeviceGray":return this.singletons.gray;case"RGB":case"DeviceRGB":return this.singletons.rgb;case"CMYK":case"DeviceCMYK":return this.singletons.cmyk;case"Pattern":return new L(null);default:if(m instanceof i.Dict){const f=m.get("ColorSpace");if(f instanceof i.Dict){const F=f.get(C.name);if(F){if(F instanceof i.Name)return this._parse(F,u,m,X);C=F;break}}}throw new t.FormatError(`Unrecognized ColorSpace: ${C.name}`)}if(Array.isArray(C)){const f=u.fetchIfRef(C[0]).name;let F,s,d,S,r,o;switch(f){case"G":case"DeviceGray":return this.singletons.gray;case"RGB":case"DeviceRGB":return this.singletons.rgb;case"CMYK":case"DeviceCMYK":return this.singletons.cmyk;case"CalGray":return F=u.fetchIfRef(C[1]),S=F.getArray("WhitePoint"),r=F.getArray("BlackPoint"),o=F.get("Gamma"),new I(S,r,o);case"CalRGB":F=u.fetchIfRef(C[1]),S=F.getArray("
`);break;case 114:S.push("\r");break;case 116:S.push(" ");break;case 98:S.push("\b");break;case 102:S.push("\f");break;case 92:case 40:case 41:S.push(String.fromCharCode(r));break;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:let A=r&15;r=this.nextChar(),o=!0,r>=48&&r<=55&&(A=(A<<3)+(r&15),r=this.nextChar(),r>=48&&r<=55&&(o=!1,A=(A<<3)+(r&15))),S.push(String.fromCharCode(A));break;case 13:this.peekChar()===10&&this.nextChar();break;case 10:break;default:S.push(String.fromCharCode(r));break}break;default:S.push(String.fromCharCode(r));break}if(d)break;o||(r=this.nextChar())}return S.join("")}getName(){let s,d;const S=this.strBuf;for(S.length=0;(s=this.nextChar())>=0&&!u[s];)if(s===35){if(s=this.nextChar(),u[s]){(0,t.warn)("Lexer_getName: NUMBER SIGN (#) should be followed by a hexadecimal number."),S.push("#");break}const r=m(s);if(r!==-1){d=s,s=this.nextChar();const o=m(s);if(o===-1){if((0,t.warn)(`Lexer_getName: Illegal digit (${String.fromCharCode(s)}) in hexadecimal number.`),S.push("#",String.fromCharCode(d)),u[s])break;S.push(String.fromCharCode(s));continue}S.push(String.fromCharCode(r<<4|o))}else S.push("#",String.fromCharCode(s))}else S.push(String.fromCharCode(s));return S.length>127&&(0,t.warn)(`Name token is longer than allowed by the spec: ${S.length}`),i.Name.get(S.join(""))}_hexStringWarn(s){if(this._hexStringNumWarn++===5){(0,t.warn)("getHexString - ignoring additional invalid characters.");return}this._hexStringNumWarn>5||(0,t.warn)(`getHexString - ignoring invalid character: ${s}`)}getHexString(){const s=this.strBuf;s.length=0;let d=this.currentChar,S=!0,r,o;for(this._hexStringNumWarn=0;;)if(d<0){(0,t.warn)("Unterminated hex string");break}else if(d===62){this.nextChar();break}else if(u[d]===1){d=this.nextChar();continue}else{if(S){if(r=m(d),r===-1){this._hexStringWarn(d),d=this.nextChar();continue}}else{if(o=m(d),o===-1){this._hexStringWarn(d),d=this.nextChar();continue}s.push(String.fromCharCode(r<<4|o))}S=!S,d=this.nextChar()}return s.join("")}getObj(){let s=!1,d=this.currentChar;for(;;){if(d<0)return i.EOF;if(s)(d===10||d===13)&&(s=!1);else if(d===37)s=!0;else if(u[d]!==1)break;d=this.nextChar()}switch(d|0){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return this.getNumber();case 40:return this.getString();case 47:return this.getName();case 91:return this.nextChar(),i.Cmd.get("[");case 93:return this.nextChar(),i.Cmd.get("]");case 60:return d=this.nextChar(),d===60?(this.nextChar(),i.Cmd.get("<<")):this.getHexString();case 62:return d=this.nextChar(),d===62?(this.nextChar(),i.Cmd.get(">>")):i.Cmd.get(">");case 123:return this.nextChar(),i.Cmd.get("{");case 125:return this.nextChar(),i.Cmd.get("}");case 41:throw this.nextChar(),new t.FormatError(`Illegal character: ${d}`)}let S=String.fromCharCode(d);if(d<32||d>127){const A=this.peekChar();if(A>=32&&A<=127)return this.nextChar(),i.Cmd.get(S)}const r=this.knownCommands;let o=r&&r[S]!==void 0;for(;(d=this.nextChar())>=0&&!u[d];){const A=S+String.fromCharCode(d);if(o&&r[A]===void 0)break;if(S.length===128)throw new t.FormatError(`Command token too long: ${S.length}`);S=A,o=r&&r[S]!==void 0}return S==="true"?!0:S==="false"?!1:S==="null"?null:(S==="BI"&&(this.beginInlineImagePos=this.stream.pos),i.Cmd.get(S))}peekObj(){const s=this.stream.pos,d=this.currentChar,S=this.beginInlineImagePos;let r;try{r=this.getObj()}catch(o){if(o instanceof O.MissingDataException)throw o;(0,t.warn)(`peekObj: ${o}`)}return this.stream.pos=s,this.currentChar=d,this.beginInlineImagePos=S,r}skipToNextLine(){let s=this.currentChar;for(;s>=0;){if(s===13){s=this.nextChar(),s===10&&this.nextChar();break}else if(s===10){this.nextChar();break}s=this.nextChar()}}}l.Lexer=X;class f{static create(s){function d(y,H){let z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const $=y.get(H);if(Number.isInteger($)&&(z?$>=0:$>0))return $;throw new Error(`The "${H}" parameter in the linearization dictionary is invalid.`)}function S(y){const H=y.get("H");let z;if(Array.isArray(H)&&((z=H.length)===2||z===4)){for(
`+(0,t.string32)(4+ue*8+4+Ne.length),Me="",me=0,Fe=ae.length;me<Fe;me++){$e=ae[me],Ge=$e[0],ve=$e[2];let _e=ve[0];for(pe=1,Ce=ve.length;pe<Ce;++pe)ve[pe]!==ve[pe-1]+1&&(Qe=$e[0]+pe-1,Me+=(0,t.string32)(Ge)+(0,t.string32)(Qe)+(0,t.string32)(_e),Ge=Qe+1,_e=ve[pe]);Me+=(0,t.string32)(Ge)+(0,t.string32)($e[1])+(0,t.string32)(_e)}nt="\0\f\0\0"+(0,t.string32)(Me.length+16)+"\0\0\0\0"+(0,t.string32)(Me.length/12)}return fe+"\0"+R(Ne.length+4)+Ne+nt+Me}function M(ne,re){re.pos=(re.start||0)+ne.offset;const ie=re.getUint16();re.skip(60);const ae=re.getUint16();if(ie<4&&ae&768)return!1;const ue=re.getUint16(),fe=re.getUint16();return ue>fe||(re.skip(6),re.getUint16()===0)?!1:(ne.data[8]=ne.data[9]=0,!0)}function _(ne,re,ie){ie=ie||{unitsPerEm:0,yMax:0,yMin:0,ascent:0,descent:0};let ae=0,ue=0,fe=0,me=0,Fe=null,pe=0;if(re){for(let Oe in re){Oe|=0,(Fe>Oe||!Fe)&&(Fe=Oe),pe<Oe&&(pe=Oe);const je=(0,P.getUnicodeRangeFor)(Oe);if(je<32)ae|=1<<je;else if(je<64)ue|=1<<je-32;else if(je<96)fe|=1<<je-64;else if(je<123)me|=1<<je-96;else throw new t.FormatError("Unicode ranges Bits > 123 are reserved for internal usage")}pe>65535&&(pe=65535)}else Fe=0,pe=255;const Ce=ne.bbox||[0,0,0,0],be=ie.unitsPerEm||1/(ne.fontMatrix||t.FONT_IDENTITY_MATRIX)[0],Ie=ne.ascentScaled?1:be/m,ye=ie.ascent||Math.round(Ie*(ne.ascent||Ce[3]));let de=ie.descent||Math.round(Ie*(ne.descent||Ce[1]));de>0&&ne.descent>0&&Ce[1]<0&&(de=-de);const ge=ie.yMax||ye,xe=-ie.yMin||-de;return"\0$ô\0\0\0Š»\0\0\0ŒŠ»\0\0ß\x001\0\0\0\0"+String.fromCharCode(ne.fixedPitch?9:0)+"\0\0\0\0\0\0"+(0,t.string32)(ae)+(0,t.string32)(ue)+(0,t.string32)(fe)+(0,t.string32)(me)+"*21*"+R(ne.italicAngle?1:0)+R(Fe||ne.firstChar)+R(pe||ne.lastChar)+R(ye)+R(de)+"\0d"+R(ge)+R(xe)+"\0\0\0\0\0\0\0\0"+R(ne.xHeight)+R(ne.capHeight)+R(0)+R(Fe||ne.firstChar)+"\0"}function J(ne){const re=Math.floor(ne.italicAngle*65536);return"\0\0\0"+(0,t.string32)(re)+"\0\0\0\0"+(0,t.string32)(ne.fixedPitch?1:0)+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}function K(ne){return ne.replace(/[^\x21-\x7E]|[[\](){}<>/%]/g,"").slice(0,63)}function te(ne,re){re||(re=[[],[]]);const ie=[re[0][0]||"Original licence",re[0][1]||ne,re[0][2]||"Unknown",re[0][3]||"uniqueID",re[0][4]||ne,re[0][5]||"Version 0.11",re[0][6]||K(ne),re[0][7]||"Unknown",re[0][8]||"Unknown",re[0][9]||"Unknown"],ae=[];let ue,fe,me,Fe,pe;for(ue=0,fe=ie.length;ue<fe;ue++){pe=re[1][ue]||ie[ue];const Oe=[];for(me=0,Fe=pe.length;me<Fe;me++)Oe.push(R(pe.charCodeAt(me)));ae.push(Oe.join(""))}const Ce=[ie,ae],be=["\0","\0"],Ie=["\0\0","\0"],ye=["\0\0"," "],de=ie.length*be.length;let ge="\0\0"+R(de)+R(de*12+6),xe=0;for(ue=0,fe=be.length;ue<fe;ue++){const Oe=Ce[ue];for(me=0,Fe=Oe.length;me<Fe;me++){pe=Oe[me];const je=be[ue]+Ie[ue]+ye[ue]+R(me)+R(pe.length)+R(xe);ge+=je,xe+=pe.length}}return ge+=ie.join("")+ae.join(""),ge}class Z{constructor(re,ie,ae){this.name=re,this.psName=null,this.mimetype=null,this.disableFontFace=!1,this.loadedName=ae.loadedName,this.isType3Font=ae.isType3Font,this.missingFile=!1,this.cssFontInfo=ae.cssFontInfo,this._charsCache=Object.create(null),this._glyphCache=Object.create(null);let ue=!!(ae.flags&O.FontFlags.Serif);if(!ue&&!ae.isSimulatedFlags){const Ce=re.replace(/[,_]/g,"-").split("-")[0],be=(0,D.getSerifFonts)();for(const Ie of Ce.split("+"))if(be[Ie]){ue=!0;break}}this.isSerifFont=ue,this.isSymbolicFont=!!(ae.flags&O.FontFlags.Symbolic),this.isMonospace=!!(ae.flags&O.FontFlags.FixedPitch);let{type:fe,subtype:me}=ae;this.type=fe,this.subtype=me;const Fe=re.match(/^InvalidPDFjsFont_(.*)_\d+$/);if(this.isInvalidPDFjsFont=!!Fe,this.isInvalidPDFjsFont?this.fallbackName=Fe[1]:this.isMonospace?this.fallbackName="monospace":this.isSerifFont?this.fallbackName="serif":this.fallbackName="sans-serif",this.differences=ae.differences,this.widths=ae.widths,this.defaultWidth=ae.defaultWidth,this.composite=ae.composite,this.cMap=ae.cMap,this.capHeight=ae.capHeight/m,this.ascent=ae.ascent/m,this.descent=ae.descent/m,this.lineHeight=this.ascent-this.descent,this.fontMatrix=ae.fontMatrix,this.bbox=ae.bbox,this.defaultEncoding=ae.defaultEncoding,this
`)}}l.PostScriptCompiler=d},(he,l,w)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.PostScriptParser=l.PostScriptLexer=void 0;var t=w(2),i=w(137),O=w(136);class P{constructor(k){this.lexer=k,this.operators=[],this.token=null,this.prev=null}nextToken(){this.prev=this.token,this.token=this.lexer.getToken()}accept(k){return this.token.type===k?(this.nextToken(),!0):!1}expect(k){if(this.accept(k))return!0;throw new t.FormatError(`Unexpected symbol: found ${this.token.type} expected ${k}.`)}parse(){return this.nextToken(),this.expect(e.LBRACE),this.parseBlock(),this.expect(e.RBRACE),this.operators}parseBlock(){for(;;)if(this.accept(e.NUMBER))this.operators.push(this.prev.value);else if(this.accept(e.OPERATOR))this.operators.push(this.prev.value);else if(this.accept(e.LBRACE))this.parseCondition();else return}parseCondition(){const k=this.operators.length;if(this.operators.push(null,null),this.parseBlock(),this.expect(e.RBRACE),this.accept(e.IF))this.operators[k]=this.operators.length,this.operators[k+1]="jz";else if(this.accept(e.LBRACE)){const x=this.operators.length;this.operators.push(null,null);const g=this.operators.length;this.parseBlock(),this.expect(e.RBRACE),this.expect(e.IFELSE),this.operators[x]=this.operators.length,this.operators[x+1]="j",this.operators[k]=g,this.operators[k+1]="jz"}else throw new t.FormatError("PS Function: error parsing conditional.")}}l.PostScriptParser=P;const e={LBRACE:0,RBRACE:1,NUMBER:2,OPERATOR:3,IF:4,IFELSE:5};class N{static get opCache(){return(0,t.shadow)(this,"opCache",Object.create(null))}constructor(k,x){this.type=k,this.value=x}static getOperator(k){const x=N.opCache[k];return x||(N.opCache[k]=new N(e.OPERATOR,k))}static get LBRACE(){return(0,t.shadow)(this,"LBRACE",new N(e.LBRACE,"{"))}static get RBRACE(){return(0,t.shadow)(this,"RBRACE",new N(e.RBRACE,"}"))}static get IF(){return(0,t.shadow)(this,"IF",new N(e.IF,"IF"))}static get IFELSE(){return(0,t.shadow)(this,"IFELSE",new N(e.IFELSE,"IFELSE"))}}class D{constructor(k){this.stream=k,this.nextChar(),this.strBuf=[]}nextChar(){return this.currentChar=this.stream.getByte()}getToken(){let k=!1,x=this.currentChar;for(;;){if(x<0)return i.EOF;if(k)(x===10||x===13)&&(k=!1);else if(x===37)k=!0;else if(!(0,O.isWhiteSpace)(x))break;x=this.nextChar()}switch(x|0){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return new N(e.NUMBER,this.getNumber());case 123:return this.nextChar(),N.LBRACE;case 125:return this.nextChar(),N.RBRACE}const g=this.strBuf;for(g.length=0,g[0]=String.fromCharCode(x);(x=this.nextChar())>=0&&(x>=65&&x<=90||x>=97&&x<=122);)g.push(String.fromCharCode(x));const n=g.join("");switch(n.toLowerCase()){case"if":return N.IF;case"ifelse":return N.IFELSE;default:return N.getOperator(n)}}getNumber(){let k=this.currentChar;const x=this.strBuf;for(x.length=0,x[0]=String.fromCharCode(k);(k=this.nextChar())>=0&&(k>=48&&k<=57||k===45||k===46);)x.push(String.fromCharCode(k));const g=parseFloat(x.join(""));if(isNaN(g))throw new t.FormatError(`Invalid floating point number: ${g}`);return g}}l.PostScriptLexer=D},(he,l,w)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.LocalTilingPatternCache=l.LocalImageCache=l.LocalGStateCache=l.LocalFunctionCache=l.LocalColorSpaceCache=l.GlobalImageCache=void 0;var t=w(2),i=w(137);class O{constructor(g){this.constructor===O&&(0,t.unreachable)("Cannot initialize BaseLocalCache."),this._onlyRefs=(g&&g.onlyRefs)===!0,this._onlyRefs||(this._nameRefMap=new Map,this._imageMap=new Map),this._imageCache=new i.RefSetCache}getByName(g){this._onlyRefs&&(0,t.unreachable)("Should not call `getByName` method.");const n=this._nameRefMap.get(g);return n?this.getByRef(n):this._imageMap.get(g)||null}getByRef(g){return this._imageCache.get(g)||null}set(g,n,I){(0,t.unreachable)("Abstract method `set` called.")}}class P extends O{set(g){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,I=arguments.length>2?arguments[2]:void 0;if(typeof g!="string")throw new Error('LocalImageCache.set - expected "name" argument.');if(n){if(this._imageCache.has
`),X instanceof i.Dict?L(X,f,F):X instanceof e.BaseStream&&k(X,f,F),f.push(`
endobj
`)}function L(m,X,f){X.push("<<");for(const F of m.getKeys())X.push(` /${(0,O.escapePDFName)(F)} `),g(m.getRaw(F),X,f);X.push(">>")}function k(m,X,f){let F=m.getString();f!==null&&(F=f.encryptString(F)),m.dict.set("Length",F.length),L(m.dict,X,f),X.push(` stream
`,F,`
endstream`)}function x(m,X,f){X.push("[");let F=!0;for(const s of m)F?F=!1:X.push(" "),g(s,X,f);X.push("]")}function g(m,X,f){m instanceof i.Name?X.push(`/${(0,O.escapePDFName)(m.name)}`):m instanceof i.Ref?X.push(`${m.num} ${m.gen} R`):Array.isArray(m)?x(m,X,f):typeof m=="string"?(f!==null&&(m=f.encryptString(m)),X.push(`(${(0,O.escapeString)(m)})`)):typeof m=="number"?X.push((0,O.numberToString)(m)):typeof m=="boolean"?X.push(m.toString()):m instanceof i.Dict?L(m,X,f):m instanceof e.BaseStream?k(m,X,f):m===null?X.push("null"):(0,t.warn)(`Unhandled value in writer: ${typeof m}, please file a bug.`)}function n(m,X,f,F){for(let s=X+f-1;s>f-1;s--)F[s]=m&255,m>>=8;return f+X}function I(m,X,f){for(let F=0,s=m.length;F<s;F++)f[X+F]=m.charCodeAt(F)&255}function B(m,X){const f=Math.floor(Date.now()/1e3),F=X.filename||"",s=[f.toString(),F,m.toString()];let d=s.reduce((o,A)=>o+A.length,0);for(const o of Object.values(X.info))s.push(o),d+=o.length;const S=new Uint8Array(d);let r=0;for(const o of s)I(o,r,S),r+=o.length;return(0,t.bytesToString)((0,N.calculateMD5)(S))}function h(m,X){const f=new P.SimpleXMLParser({hasAttributes:!0}).parseFromString(m);for(const{xfa:s}of X){if(!s)continue;const{path:d,value:S}=s;if(!d)continue;const r=(0,O.parseXFAPath)(d);let o=f.documentElement.searchNode(r,0);!o&&r.length>1&&(o=f.documentElement.searchNode([r.at(-1)],0)),o?Array.isArray(S)?o.childNodes=S.map(A=>new P.SimpleDOMNode("value",A)):o.childNodes=[new P.SimpleDOMNode("#text",S)]:(0,t.warn)(`Node not found for path: ${d}`)}const F=[];return f.documentElement.dump(F),F.join("")}function c(m){let{xref:X,acroForm:f,acroFormRef:F,hasXfa:s,hasXfaDatasetsEntry:d,xfaDatasetsRef:S,needAppearances:r,newRefs:o}=m;if(s&&!d&&!S&&(0,t.warn)("XFA - Cannot save it"),!r&&(!s||!S))return;const A=new i.Dict(X);for(const T of f.getKeys())A.set(T,f.getRaw(T));if(s&&!d){const T=f.get("XFA").slice();T.splice(2,0,"datasets"),T.splice(3,0,S),A.set("XFA",T)}r&&A.set("NeedAppearances",!0);const p=X.encrypt;let v=null;p&&(v=p.createCipherTransform(F.num,F.gen));const R=[];D(F,A,R,v),o.push({ref:F,data:R.join("")})}function C(m){let{xfaData:X,xfaDatasetsRef:f,newRefs:F,xref:s}=m;if(X===null){const r=s.fetchIfRef(f);X=h(r.getString(),F)}const d=s.encrypt;d&&(X=d.createCipherTransform(f.num,f.gen).encryptString(X));const S=`${f.num} ${f.gen} obj
<< /Type /EmbeddedFile /Length ${X.length}>>
stream
`+X+`
endstream
endobj
`;F.push({ref:f,data:S})}function u(m){let{originalData:X,xrefInfo:f,newRefs:F,xref:s=null,hasXfa:d=!1,xfaDatasetsRef:S=null,hasXfaDatasetsEntry:r=!1,needAppearances:o,acroFormRef:A=null,acroForm:p=null,xfaData:v=null}=m;c({xref:s,acroForm:p,acroFormRef:A,hasXfa:d,hasXfaDatasetsEntry:r,xfaDatasetsRef:S,needAppearances:o,newRefs:F}),d&&C({xfaData:v,xfaDatasetsRef:S,newRefs:F,xref:s});const R=new i.Dict(null),T=f.newRef;let y,H;const z=X.at(-1);z===10||z===13?(y=[],H=X.length):(y=[`
`],H=X.length+1),R.set("Size",T.num+1),R.set("Prev",f.startXRef),R.set("Type",i.Name.get("XRef")),f.rootRef!==null&&R.set("Root",f.rootRef),f.infoRef!==null&&R.set("Info",f.infoRef),f.encryptRef!==null&&R.set("Encrypt",f.encryptRef),F.push({ref:T,data:""}),F=F.sort((M,_)=>M.ref.num-_.ref.num);const $=[[0,1,65535]],j=[0,1];let V=0;for(const{ref:M,data:_}of F)V=Math.max(V,H),$.push([1,H,Math.min(M.gen,65535)]),H+=_.length,j.push(M.num,1),y.push(_);if(R.set("Index",j),Array.isArray(f.fileIds)&&f.fileIds.length>0){const M=B(H,f);R.set("ID",[f.fileIds[0],M])}const U=[1,Math.ceil(Math.log2(V)/8),2],Y=(U[0]+U[1]+U[2])*$.length;R.set("W",U),R.set("Length",Y),y.push(`${T.num} ${T.gen} obj
`),L(R,y,null),y.push(` stream
`);const oe=y.reduce((M,_)=>M+_.length,0),se=`
endstream
endobj
startxref
${H}
%%EOF
`,Q=new Uint8Array(X.length+oe+Y+se.length);Q.set(X);let E=X.length;for(const M of y)I(M,E,Q),E+=M.length;for(const[M,_,J]of $)E=n(M,U[0],E,Q),E=n(_,U[1],E,Q),E=n(J,U[2],E,Q);return I(se,E,Q),Q}},(he,l,w)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.XMLParserErrorCode=l.XMLParserBase=l.SimpleXMLParser=l.SimpleDOMNode=void 0;var t=w(136);const i={NoError:0,EndOfDocument:-1,UnterminatedCdat:-2,UnterminatedXmlDeclaration:-3,UnterminatedDoctypeDeclaration:-4,UnterminatedComment:-5,MalformedElement:-6,OutOfMemory:-7,UnterminatedAttributeValue:-8,UnterminatedElement:-9,ElementNeverBegun:-10};l.XMLParserErrorCode=i;function O(L,k){const x=L[k];return x===" "||x===`
`||x==="\r"||x===" "}function P(L){for(let k=0,x=L.length;k<x;k++)if(!O(L,k))return!1;return!0}class e{_resolveEntities(k){return k.replace(/&([^;]+);/g,(x,g)=>{if(g.substring(0,2)==="#x")return String.fromCodePoint(parseInt(g.substring(2),16));if(g.substring(0,1)==="#")return String.fromCodePoint(parseInt(g.substring(1),10));switch(g){case"lt":return"<";case"gt":return">";case"amp":return"&";case"quot":return'"';case"apos":return"'"}return this.onResolveEntity(g)})}_parseContent(k,x){const g=[];let n=x;function I(){for(;n<k.length&&O(k,n);)++n}for(;n<k.length&&!O(k,n)&&k[n]!==">"&&k[n]!=="/";)++n;const B=k.substring(x,n);for(I();n<k.length&&k[n]!==">"&&k[n]!=="/"&&k[n]!=="?";){I();let h="",c="";for(;n<k.length&&!O(k,n)&&k[n]!=="=";)h+=k[n],++n;if(I(),k[n]!=="=")return null;++n,I();const C=k[n];if(C!=='"'&&C!=="'")return null;const u=k.indexOf(C,++n);if(u<0)return null;c=k.substring(n,u),g.push({name:h,value:this._resolveEntities(c)}),n=u+1,I()}return{name:B,attributes:g,parsed:n-x}}_parseProcessingInstruction(k,x){let g=x;function n(){for(;g<k.length&&O(k,g);)++g}for(;g<k.length&&!O(k,g)&&k[g]!==">"&&k[g]!=="?"&&k[g]!=="/";)++g;const I=k.substring(x,g);n();const B=g;for(;g<k.length&&(k[g]!=="?"||k[g+1]!==">");)++g;const h=k.substring(B,g);return{name:I,value:h,parsed:g-x}}parseXml(k){let x=0;for(;x<k.length;){const g=k[x];let n=x;if(g==="<"){++n;const I=k[n];let B;switch(I){case"/":if(++n,B=k.indexOf(">",n),B<0){this.onError(i.UnterminatedElement);return}this.onEndElement(k.substring(n,B)),n=B+1;break;case"?":++n;const h=this._parseProcessingInstruction(k,n);if(k.substring(n+h.parsed,n+h.parsed+2)!=="?>"){this.onError(i.UnterminatedXmlDeclaration);return}this.onPi(h.name,h.value),n+=h.parsed+2;break;case"!":if(k.substring(n+1,n+3)==="--"){if(B=k.indexOf("-->",n+3),B<0){this.onError(i.UnterminatedComment);return}this.onComment(k.substring(n+3,B)),n=B+3}else if(k.substring(n+1,n+8)==="[CDATA["){if(B=k.indexOf("]]>",n+8),B<0){this.onError(i.UnterminatedCdat);return}this.onCdata(k.substring(n+8,B)),n=B+3}else if(k.substring(n+1,n+8)==="DOCTYPE"){const u=k.indexOf("[",n+8);let m=!1;if(B=k.indexOf(">",n+8),B<0){this.onError(i.UnterminatedDoctypeDeclaration);return}if(u>0&&B>u){if(B=k.indexOf("]>",n+8),B<0){this.onError(i.UnterminatedDoctypeDeclaration);return}m=!0}const X=k.substring(n+8,B+(m?1:0));this.onDoctype(X),n=B+(m?2:1)}else{this.onError(i.MalformedElement);return}break;default:const c=this._parseContent(k,n);if(c===null){this.onError(i.MalformedElement);return}let C=!1;if(k.substring(n+c.parsed,n+c.parsed+2)==="/>")C=!0;else if(k.substring(n+c.parsed,n+c.parsed+1)!==">"){this.onError(i.UnterminatedElement);return}this.onBeginElement(c.name,c.attributes,C),n+=c.parsed+(C?2:1);break}}else{for(;n<k.length&&k[n]!=="<";)n++;const I=k.substring(x,n);this.onText(this._resolveEntities(I))}x=n}}onResolveEntity(k){return`&${k};`}onPi(k,x){}onComment(k){}onCdata(k){}onDoctype(k){}onText(k){}onBeginElement(k,x,g){}onEndElement(k){}onError(k){}}l.XMLParserBase=e;class N{constructor(k,x){this.nodeName=k,this.nodeValue=x,Object.defineProperty(this,"parentNode",{value:null,writable:!0})}get firstChild(){return this.childNodes&&this.childNodes[0]}get nextSibling(){const k=this.parentNode.childNodes;if(!k)return;const x=k.indexOf(this);if(x!==-1)return k[x+1]}get textContent(){return this.childNodes?this.childNodes.map(function(k){return k.textContent}).join(""):this.nodeValue||""}get children(){return this.childNodes||[]}hasChildNodes(){return this.childNodes&&this.childNodes.length>0}searchNode(k,x){if(x>=k.length)return this;const g=k[x],n=[];let I=this;for(;;){if(g.name===I.nodeName)if(g.pos===0){const B=I.searchNode(k,x+1);if(B!==null)return B}else{if(n.length===0)return null;{const[B]=n.pop();let h=0;for(const c of B.childNodes)if(g.name===c.nodeName){if(h===g.pos)return c.searchNode(k,x+1);h++}return I.searchNode(k,x+1)}}if(I.childNodes&&I.childNodes.length!==0)n.push([I,0]),I=I.childNodes[0];else{if(n.length===0)return null;for(;n.length!==0;){const[B,h]=n.pop(),c=h+1;if(c<B.childNodes.length){n.push([B,c]),I=B.childNodes[c];
`);x[t.$setValue](D(I))}else this._isConsumeData()&&(0,e.warn)("XFA - Nodes haven't the same type.");else!g[t.$isDataValue]()||this._isMatchTemplate()?this._bindElement(x,g):(0,e.warn)("XFA - Nodes haven't the same type.")}_findDataByNameToConsume(x,g,n,I){if(!x)return null;let B,h;for(let c=0;c<3;c++){for(B=n[t.$getRealChildrenByNameIt](x,!1,!0);h=B.next().value,!!h;)if(g===h[t.$isDataValue]())return h;if(n[t.$namespaceId]===P.NamespaceIds.datasets.id&&n[t.$nodeName]==="data")break;n=n[t.$getParent]()}return I?(B=this.data[t.$getRealChildrenByNameIt](x,!0,!1),h=B.next().value,h||(B=this.data[t.$getAttributeIt](x,!0),h=B.next().value,h&&h[t.$isDataValue]())?h:null):null}_setProperties(x,g){if(x.hasOwnProperty("setProperty"))for(const{ref:n,target:I,connection:B}of x.setProperty.children){if(B||!n)continue;const h=(0,O.searchNode)(this.root,g,n,!1,!1);if(!h){(0,e.warn)(`XFA - Invalid reference: ${n}.`);continue}const[c]=h;if(!c[t.$isDescendent](this.data)){(0,e.warn)("XFA - Invalid node: must be a data node.");continue}const C=(0,O.searchNode)(this.root,x,I,!1,!1);if(!C){(0,e.warn)(`XFA - Invalid target: ${I}.`);continue}const[u]=C;if(!u[t.$isDescendent](x)){(0,e.warn)("XFA - Invalid target: must be a property or subproperty.");continue}const m=u[t.$getParent]();if(u instanceof i.SetProperty||m instanceof i.SetProperty){(0,e.warn)("XFA - Invalid target: cannot be a setProperty or one of its properties.");continue}if(u instanceof i.BindItems||m instanceof i.BindItems){(0,e.warn)("XFA - Invalid target: cannot be a bindItems or one of its properties.");continue}const X=c[t.$text](),f=u[t.$nodeName];if(u instanceof t.XFAAttribute){const F=Object.create(null);F[f]=X;const s=Reflect.construct(Object.getPrototypeOf(m).constructor,[F]);m[f]=s[f];continue}if(!u.hasOwnProperty(t.$content)){(0,e.warn)("XFA - Invalid node to use in setProperty");continue}u[t.$data]=c,u[t.$content]=X,u[t.$finalize]()}}_bindItems(x,g){if(!x.hasOwnProperty("items")||!x.hasOwnProperty("bindItems")||x.bindItems.isEmpty())return;for(const B of x.items.children)x[t.$removeChild](B);x.items.clear();const n=new i.Items({}),I=new i.Items({});x[t.$appendChild](n),x.items.push(n),x[t.$appendChild](I),x.items.push(I);for(const{ref:B,labelRef:h,valueRef:c,connection:C}of x.bindItems.children){if(C||!B)continue;const u=(0,O.searchNode)(this.root,g,B,!1,!1);if(!u){(0,e.warn)(`XFA - Invalid reference: ${B}.`);continue}for(const m of u){if(!m[t.$isDescendent](this.datasets)){(0,e.warn)(`XFA - Invalid ref (${B}): must be a datasets child.`);continue}const X=(0,O.searchNode)(this.root,m,h,!0,!1);if(!X){(0,e.warn)(`XFA - Invalid label: ${h}.`);continue}const[f]=X;if(!f[t.$isDescendent](this.datasets)){(0,e.warn)("XFA - Invalid label: must be a datasets child.");continue}const F=(0,O.searchNode)(this.root,m,c,!0,!1);if(!F){(0,e.warn)(`XFA - Invalid value: ${c}.`);continue}const[s]=F;if(!s[t.$isDescendent](this.datasets)){(0,e.warn)("XFA - Invalid value: must be a datasets child.");continue}const d=D(f[t.$text]()),S=D(s[t.$text]());n[t.$appendChild](d),n.text.push(d),I[t.$appendChild](S),I.text.push(S)}}}_bindOccurrences(x,g,n){let I;if(g.length>1&&(I=x[t.$clone](),I[t.$removeChild](I.occur),I.occur=null),this._bindValue(x,g[0],n),this._setProperties(x,g[0]),this._bindItems(x,g[0]),g.length===1)return;const B=x[t.$getParent](),h=x[t.$nodeName],c=B[t.$indexOf](x);for(let C=1,u=g.length;C<u;C++){const m=g[C],X=I[t.$clone]();B[h].push(X),B[t.$insertAt](c+C,X),this._bindValue(X,m,n),this._setProperties(X,m),this._bindItems(X,m)}}_createOccurrences(x){if(!this.emptyMerge)return;const{occur:g}=x;if(!g||g.initial<=1)return;const n=x[t.$getParent](),I=x[t.$nodeName];if(!(n[I]instanceof t.XFAObjectArray))return;let B;x.name?B=n[I].children.filter(C=>C.name===x.name).length:B=n[I].children.length;const h=n[t.$indexOf](x)+1,c=g.initial-B;if(c){const C=x[t.$clone]();C[t.$removeChild](C.occur),C.occur=null,n[I].push(C),n[t.$insertAt](h,C);for(let u=1;u<c;u++){const m=C[t.$clone]();n[I].push(m),n[t.$insertAt](h+u,m)}}}_getOccurInfo(x){const{name:g,occur:n}=x;if(!n||!g)return[1,1];const
`))}[t.$getExtra](){return typeof this[t.$content]=="string"?this[t.$content].split(/[\u2029\u2028\n]/).reduce((a,W)=>(W&&a.push(W),a),[]).join(`
`):this[t.$content][t.$text]()}[t.$toHTML](a){if(typeof this[t.$content]=="string"){const W=r(this[t.$content]).html;return this[t.$content].includes("\u2029")?(W.name="div",W.children=[],this[t.$content].split("\u2029").map(Ae=>Ae.split(/[\u2028\n]/).reduce((De,ze)=>(De.push({name:"span",value:ze},{name:"br"}),De),[])).forEach(Ae=>{W.children.push({name:"p",children:Ae})})):/[\u2028\n]/.test(this[t.$content])&&(W.name="div",W.children=[],this[t.$content].split(/[\u2028\n]/).forEach(Ae=>{W.children.push({name:"span",value:Ae},{name:"br"})})),e.HTMLResult.success(W)}return this[t.$content][t.$toHTML](a)}}l.Text=Rn;class on extends t.XFAObject{constructor(a){super(x,"textEdit",!0),this.allowRichText=(0,e.getInteger)({data:a.allowRichText,defaultValue:0,validate:W=>W===1}),this.hScrollPolicy=(0,e.getStringOption)(a.hScrollPolicy,["auto","off","on"]),this.id=a.id||"",this.multiLine=(0,e.getInteger)({data:a.multiLine,defaultValue:"",validate:W=>W===0||W===1}),this.use=a.use||"",this.usehref=a.usehref||"",this.vScrollPolicy=(0,e.getStringOption)(a.vScrollPolicy,["auto","off","on"]),this.border=null,this.comb=null,this.extras=null,this.margin=null}[t.$toHTML](a){const W=(0,P.toStyle)(this,"border","font","margin");let Ae;const De=this[t.$getParent]()[t.$getParent]();return this.multiLine===""&&(this.multiLine=De instanceof be?1:0),this.multiLine===1?Ae={name:"textarea",attributes:{dataId:De[t.$data]&&De[t.$data][t.$uid]||De[t.$uid],fieldId:De[t.$uid],class:["xfaTextfield"],style:W,"aria-label":S(De),"aria-required":!1}}:Ae={name:"input",attributes:{type:"text",dataId:De[t.$data]&&De[t.$data][t.$uid]||De[t.$uid],fieldId:De[t.$uid],class:["xfaTextfield"],style:W,"aria-label":S(De),"aria-required":!1}},F(De)&&(Ae.attributes["aria-required"]=!0,Ae.attributes.required=!0),e.HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[Ae]})}}class un extends t.StringObject{constructor(a){super(x,"time"),this.id=a.id||"",this.name=a.name||"",this.use=a.use||"",this.usehref=a.usehref||""}[t.$finalize](){const a=this[t.$content].trim();this[t.$content]=a?new Date(a):null}[t.$toHTML](a){return r(this[t.$content]?this[t.$content].toString():"")}}class vn extends t.XFAObject{constructor(a){super(x,"timeStamp"),this.id=a.id||"",this.server=a.server||"",this.type=(0,e.getStringOption)(a.type,["optional","required"]),this.use=a.use||"",this.usehref=a.usehref||""}}class zn extends t.StringObject{constructor(a){super(x,"toolTip"),this.id=a.id||"",this.rid=a.rid||"",this.use=a.use||"",this.usehref=a.usehref||""}}class na extends t.XFAObject{constructor(a){super(x,"traversal",!0),this.id=a.id||"",this.use=a.use||"",this.usehref=a.usehref||"",this.extras=null,this.traverse=new t.XFAObjectArray}}class Bn extends t.XFAObject{constructor(a){super(x,"traverse",!0),this.id=a.id||"",this.operation=(0,e.getStringOption)(a.operation,["next","back","down","first","left","right","up"]),this.ref=a.ref||"",this.use=a.use||"",this.usehref=a.usehref||"",this.extras=null,this.script=null}get name(){return this.operation}[t.$isTransparent](){return!1}}class pn extends t.XFAObject{constructor(a){super(x,"ui",!0),this.id=a.id||"",this.use=a.use||"",this.usehref=a.usehref||"",this.extras=null,this.picture=null,this.barcode=null,this.button=null,this.checkButton=null,this.choiceList=null,this.dateTimeEdit=null,this.defaultUi=null,this.imageEdit=null,this.numericEdit=null,this.passwordEdit=null,this.signature=null,this.textEdit=null}[t.$getExtra](){if(this[t.$extra]===void 0){for(const a of Object.getOwnPropertyNames(this)){if(a==="extras"||a==="picture")continue;const W=this[a];if(W instanceof t.XFAObject)return this[t.$extra]=W,W}this[t.$extra]=null}return this[t.$extra]}[t.$toHTML](a){const W=this[t.$getExtra]();return W?W[t.$toHTML](a):e.HTMLResult.EMPTY}}class Mn extends t.XFAObject{constructor(a){super(x,"validate",!0),this.formatTest=(0,e.getStringOption)(a.formatTest,["warning","disabled","error"]),this.id=a.id||"",this.nullTest=(0,e.getStringOption)(a.nullTest,["disabled","error","warning"]),this.scriptTest=(0,e.getStringOption)(a.scriptTest,["
`,!0])}this.glyphs.pop();return}for(const x of D.split(/[\u2029\n]/)){for(const g of x.split(""))this.glyphs.push([k,1.2*k,k,g,!1]);this.glyphs.push([0,0,0,`
`,!0])}this.glyphs.pop()}compute(D){let L=-1,k=0,x=0,g=0,n=0,I=0,B=!1,h=!0;for(let c=0,C=this.glyphs.length;c<C;c++){const[u,m,X,f,F]=this.glyphs[c],s=f===" ",d=h?X:m;if(F){x=Math.max(x,n),n=0,g+=I,I=d,L=-1,k=0,h=!1;continue}if(s){n+u>D?(x=Math.max(x,n),n=0,g+=I,I=d,L=-1,k=0,B=!0,h=!1):(I=Math.max(d,I),k=n,n+=u,L=c);continue}if(n+u>D){g+=I,I=d,L!==-1?(c=L,x=Math.max(x,k),n=0,L=-1,k=0):(x=Math.max(x,n),n=u),B=!0,h=!1;continue}n+=u,I=Math.max(d,I)}return x=Math.max(x,n),g+=I+this.extraHeight,{width:i*x,height:g,isBroken:B}}}l.TextMeasure=e},(he,l,w)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DataHandler=void 0;var t=w(208);class i{constructor(P,e){this.data=e,this.dataset=P.datasets||null}serialize(P){const e=[[-1,this.data[t.$getChildren]()]];for(;e.length>0;){const D=e.at(-1),[L,k]=D;if(L+1===k.length){e.pop();continue}const x=k[++D[0]],g=P.get(x[t.$uid]);if(g)x[t.$setValue](g);else{const I=x[t.$getAttributes]();for(const B of I.values()){const h=P.get(B[t.$uid]);if(h){B[t.$setValue](h);break}}}const n=x[t.$getChildren]();n.length>0&&e.push([-1,n])}const N=['<xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">'];if(this.dataset)for(const D of this.dataset[t.$getChildren]())D[t.$nodeName]!=="data"&&D[t.$toString](N);return this.data[t.$toString](N),N.push("</xfa:datasets>"),N.join("")}}l.DataHandler=i},(he,l,w)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.XFAParser=void 0;var t=w(208),i=w(197),O=w(220),P=w(2);class e extends i.XMLParserBase{constructor(){let D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super(),this._builder=new O.Builder(D),this._stack=[],this._globalData={usedTypefaces:new Set},this._ids=new Map,this._current=this._builder.buildRoot(this._ids),this._errorCode=i.XMLParserErrorCode.NoError,this._whiteRegex=/^\s+$/,this._nbsps=/\xa0+/g,this._richText=L}parse(D){if(this.parseXml(D),this._errorCode===i.XMLParserErrorCode.NoError)return this._current[t.$finalize](),this._current.element}onText(D){if(D=D.replace(this._nbsps,L=>L.slice(1)+" "),this._richText||this._current[t.$acceptWhitespace]()){this._current[t.$onText](D,this._richText);return}this._whiteRegex.test(D)||this._current[t.$onText](D.trim())}onCdata(D){this._current[t.$onText](D)}_mkAttributes(D,L){let k=null,x=null;const g=Object.create({});for(const{name:n,value:I}of D)if(n==="xmlns")k?(0,P.warn)(`XFA - multiple namespace definition in <${L}>`):k=I;else if(n.startsWith("xmlns:")){const B=n.substring(6);x||(x=[]),x.push({prefix:B,value:I})}else{const B=n.indexOf(":");if(B===-1)g[n]=I;else{let h=g[t.$nsAttributes];h||(h=g[t.$nsAttributes]=Object.create(null));const[c,C]=[n.slice(0,B),n.slice(B+1)];let u=h[c];u||(u=h[c]=Object.create(null)),u[C]=I}}return[k,x,g]}_getNameAndPrefix(D,L){const k=D.indexOf(":");return k===-1?[D,null]:[D.substring(k+1),L?"":D.substring(0,k)]}onBeginElement(D,L,k){const[x,g,n]=this._mkAttributes(L,D),[I,B]=this._getNameAndPrefix(D,this._builder.isNsAgnostic()),h=this._builder.build({nsPrefix:B,name:I,attributes:n,namespace:x,prefixes:g});if(h[t.$globalData]=this._globalData,k){h[t.$finalize](),this._current[t.$onChild](h)&&h[t.$setId](this._ids),h[t.$clean](this._builder);return}this._stack.push(this._current),this._current=h}onEndElement(D){const L=this._current;if(L[t.$isCDATAXml]()&&typeof L[t.$content]=="string"){const k=new e;k._globalData=this._globalData;const x=k.parse(L[t.$content]);L[t.$content]=null,L[t.$onChild](x)}L[t.$finalize](),this._current=this._stack.pop(),this._current[t.$onChild](L)&&L[t.$setId](this._ids),L[t.$clean](this._builder)}onError(D){this._errorCode=D}}l.XFAParser=e},(he,l,w)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Builder=void 0;var t=w(210),i=w(208),O=w(221),P=w(213),e=w(230),N=w(2);class D extends i.XFAObject{constructor(g){super(-1,"root",Object.create(null)),this.element=null,this[i.$ids]=g}[i.$onChild](g){return this.element=g,!0}[i.$finalize](){super[i.$finalize](),this.element.template instanceof P.Template&&(this[i.$ids].set(i.$root,this.element),this.element.te
`):void 0:y=this[t.$content]||void 0,P.HTMLResult.success({name:this[t.$nodeName],attributes:{href:this.href,style:n(this.style,this,this[N])},children:T,value:y})}}class c extends h{constructor(R){super(R,"a"),this.href=(0,O.fixURL)(R.href)||""}}class C extends h{constructor(R){super(R,"b")}[t.$pushGlyphs](R){R.pushFont({weight:"bold"}),super[t.$pushGlyphs](R),R.popFont()}}class u extends h{constructor(R){super(R,"body")}[t.$toHTML](R){const T=super[t.$toHTML](R),{html:y}=T;return y?(y.name="div",y.attributes.class=["xfaRich"],T):P.HTMLResult.EMPTY}}class m extends h{constructor(R){super(R,"br")}[t.$text](){return`
`}[t.$pushGlyphs](R){R.addString(`
`)}[t.$toHTML](R){return P.HTMLResult.success({name:"br"})}}class X extends h{constructor(R){super(R,"html")}[t.$toHTML](R){const T=[];if(this[t.$extra]={children:T},this[t.$childrenToHTML]({}),T.length===0)return P.HTMLResult.success({name:"div",attributes:{class:["xfaRich"],style:{}},value:this[t.$content]||""});if(T.length===1){const y=T[0];if(y.attributes&&y.attributes.class.includes("xfaRich"))return P.HTMLResult.success(y)}return P.HTMLResult.success({name:"div",attributes:{class:["xfaRich"],style:{}},children:T})}}class f extends h{constructor(R){super(R,"i")}[t.$pushGlyphs](R){R.pushFont({posture:"italic"}),super[t.$pushGlyphs](R),R.popFont()}}class F extends h{constructor(R){super(R,"li")}}class s extends h{constructor(R){super(R,"ol")}}class d extends h{constructor(R){super(R,"p")}[t.$pushGlyphs](R){super[t.$pushGlyphs](R,!1),R.addString(`
`),R.addPara(),R.popFont()}[t.$text](){return this[t.$getParent]()[t.$getChildren]().at(-1)===this?super[t.$text]():super[t.$text]()+`
`}}class S extends h{constructor(R){super(R,"span")}}class r extends h{constructor(R){super(R,"sub")}}class o extends h{constructor(R){super(R,"sup")}}class A extends h{constructor(R){super(R,"ul")}}class p{static[i.$buildXFAObject](R,T){if(p.hasOwnProperty(R))return p[R](T)}static a(R){return new c(R)}static b(R){return new C(R)}static body(R){return new u(R)}static br(R){return new m(R)}static html(R){return new X(R)}static i(R){return new f(R)}static li(R){return new F(R)}static ol(R){return new s(R)}static p(R){return new d(R)}static span(R){return new S(R)}static sub(R){return new r(R)}static sup(R){return new o(R)}static ul(R){return new A(R)}}l.XhtmlNamespace=p},(he,l,w)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnknownNamespace=void 0;var t=w(210),i=w(208);class O{constructor(e){this.namespaceId=e}[t.$buildXFAObject](e,N){return new i.XmlObject(this.namespaceId,e,N)}}l.UnknownNamespace=O},(he,l,w)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DatasetReader=void 0;var t=w(2),i=w(136),O=w(197);function P(D){try{return(0,t.stringToUTF8String)(D)}catch(L){return(0,t.warn)(`UTF-8 decoding failed: "${L}".`),D}}class e extends O.SimpleXMLParser{constructor(L){super(L),this.node=null}onEndElement(L){const k=super.onEndElement(L);if(k&&L==="xfa:datasets")throw this.node=k,new Error("Aborting DatasetXMLParser.")}}class N{constructor(L){if(L.datasets)this.node=new O.SimpleXMLParser({hasAttributes:!0}).parseFromString(L.datasets).documentElement;else{const k=new e({hasAttributes:!0});try{k.parseFromString(L["xdp:xdp"])}catch{}this.node=k.node}}getValue(L){if(!this.node||!L)return"";const k=this.node.searchNode((0,i.parseXFAPath)(L),0);if(!k)return"";const x=k.firstChild;return x&&x.nodeName==="value"?k.children.map(g=>P(g.textContent)):P(k.textContent)}}l.DatasetReader=N},(he,l,w)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.XRef=void 0;var t=w(2),i=w(137),O=w(148),P=w(136),e=w(138),N=w(198);class D{constructor(k,x){this.stream=k,this.pdfManager=x,this.entries=[],this.xrefstms=Object.create(null),this._cacheMap=new Map,this._pendingRefs=new i.RefSet,this._newPersistentRefNum=null,this._newTemporaryRefNum=null}getNewPersistentRef(k){this._newPersistentRefNum===null&&(this._newPersistentRefNum=this.entries.length||1);const x=this._newPersistentRefNum++;return this._cacheMap.set(x,k),i.Ref.get(x,0)}getNewTemporaryRef(){return this._newTemporaryRefNum===null&&(this._newTemporaryRefNum=this.entries.length||1),i.Ref.get(this._newTemporaryRefNum++,0)}resetNewTemporaryRef(){this._newTemporaryRefNum=null}setStartXRef(k){this.startXRefQueue=[k]}parse(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,x;k?((0,t.warn)("Indexing all PDF objects"),x=this.indexObjects()):x=this.readXRef(),x.assignXref(this),this.trailer=x;let g;try{g=x.get("Encrypt")}catch(I){if(I instanceof P.MissingDataException)throw I;(0,t.warn)(`XRef.parse - Invalid "Encrypt" reference: "${I}".`)}if(g instanceof i.Dict){const I=x.get("ID"),B=I&&I.length?I[0]:"";g.suppressEncryption=!0,this.encrypt=new N.CipherTransformFactory(g,B,this.pdfManager.password)}let n;try{n=x.get("Root")}catch(I){if(I instanceof P.MissingDataException)throw I;(0,t.warn)(`XRef.parse - Invalid "Root" reference: "${I}".`)}if(n instanceof i.Dict)try{if(n.get("Pages")instanceof i.Dict){this.root=n;return}}catch(I){if(I instanceof P.MissingDataException)throw I;(0,t.warn)(`XRef.parse - Invalid "Pages" reference: "${I}".`)}throw k?new t.InvalidPDFException("Invalid Root reference."):new P.XRefParseException}processXRefTable(k){"tableState"in this||(this.tableState={entryNum:0,streamPos:k.lexer.stream.pos,parserBuf1:k.buf1,parserBuf2:k.buf2});const x=this.readXRefTable(k);if(!(0,i.isCmd)(x,"trailer"))throw new t.FormatError("Invalid XRef table: could not find trailer dictionary");let g=k.getObj();if(!(g instanceof i.Dict)&&g.dict&&(g=g.dict),!(g instanceof i.Dict))throw new t.FormatError("Invalid XRef table: could not parse trailer dictionary");return delete this.tableState,g}readXRefTable(k){const x=k.lexer.stream,g=this.tableState;x.pos=g.streamPos,k.buf1=