parser_x.js 1.1.24 → 1.1.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/parser_x.js +1 -1
  2. package/package.json +1 -1
package/dist/parser_x.js CHANGED
@@ -1,5 +1,5 @@
1
1
  !function(A,I){"object"==typeof exports&&"object"==typeof module?module.exports=I(require("parser_helper_x.js"),require("axios")):"function"==typeof define&&define.amd?define([,"axios"],I):"object"==typeof exports?exports.parser_x=I(require("parser_helper_x.js"),require("axios")):A.parser_x=I(A.parser_helper_x,A.axios)}(window,(function(A,I){return function(A){var I={};function g(B){if(I[B])return I[B].exports;var Q=I[B]={i:B,l:!1,exports:{}};return A[B].call(Q.exports,Q,Q.exports,g),Q.l=!0,Q.exports}return g.m=A,g.c=I,g.d=function(A,I,B){g.o(A,I)||Object.defineProperty(A,I,{enumerable:!0,get:B})},g.r=function(A){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})},g.t=function(A,I){if(1&I&&(A=g(A)),8&I)return A;if(4&I&&"object"==typeof A&&A&&A.__esModule)return A;var B=Object.create(null);if(g.r(B),Object.defineProperty(B,"default",{enumerable:!0,value:A}),2&I&&"string"!=typeof A)for(var Q in A)g.d(B,Q,function(I){return A[I]}.bind(null,Q));return B},g.n=function(A){var I=A&&A.__esModule?function(){return A.default}:function(){return A};return g.d(I,"a",I),I},g.o=function(A,I){return Object.prototype.hasOwnProperty.call(A,I)},g.p="",g(g.s=0)}([function(A,I,g){"use strict";g.r(I),g.d(I,"OFDPrintApi",(function(){return x})),g.d(I,"ajaxUtils",(function(){return V})),g.d(I,"getToSign",(function(){return p})),g.d(I,"packageSigned",(function(){return m})),g.d(I,"free",(function(){return T})),g.d(I,"hashOfdDocument",(function(){return X})),g.d(I,"parseOfdDocument",(function(){return O})),g.d(I,"parseOfdDocumentFromBase64",(function(){return z})),g.d(I,"getOFDPageCount",(function(){return u})),g.d(I,"getAllAttachments",(function(){return P})),g.d(I,"getAttachmentById",(function(){return v})),g.d(I,"getAttachmentArrayBuffer",(function(){return _})),g.d(I,"pageSize",(function(){return $})),g.d(I,"getCustomTag",(function(){return AA})),g.d(I,"getTextObjects",(function(){return IA})),g.d(I,"renderOfd",(function(){return gA})),g.d(I,"renderOfdByIndex",(function(){return BA})),g.d(I,"getFileStream",(function(){return CA})),g.d(I,"openMetaBaseViewer",(function(){return EA})),g.d(I,"openOFDBaseViewer",(function(){return DA})),g.d(I,"openOFDBaseViewerByBase64",(function(){return iA})),g.d(I,"verifySignature",(function(){return oA})),g.d(I,"printOFD",(function(){return wA})),g.d(I,"getEventBus",(function(){return GA})),g.d(I,"initOFDViewer",(function(){return FA})),g.d(I,"openOFDViewer",(function(){return NA})),g.d(I,"openFile",(function(){return yA})),g.d(I,"openFileBase64",(function(){return RA})),g.d(I,"openOFD",(function(){return hA}));var B=g(1),Q=g.n(B),C=g(2),E=g.n(C),D=g(3),i=g(10),o=g(18),w=g(36),G=g(37),F=g(38),N=g(39),y=g(40),R=g(41),h=g(42),M=g(44),U=g(33),c=g(46),k=g(30),S=g(28),s=g(34),Y=g(47),a=g(48),K=g.n(a),H=g(49),L=g(50),J=g(51),t=g(52),d=g(29),Z=g(53),n=g.n(Z),e=g(54),q=g.n(e),l=g(55);function W(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return r(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return r(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function r(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var x=c.Print_api,f=window.Module,b={ofdCore:null,viewer:null,eventBus:null,waterText:null,fileName:null,ofdRender:null},V=q.a,p=function(A,I){return Object(k.JSGetToSign)(A,I)},m=function(A,I){return Object(k.JSPackageSigned)(A,I)},T=function(){b.ofdCore&&Object(k.freeOFD)(b.ofdCore)},X=function(A){if(A.ofd instanceof File){var I=new FileReader;I.readAsArrayBuffer(A.ofd),I.onload=function(){A.success&&A.success(Object(k.JSBase64ByHashFile)(I.result,A.list,A.method))}}else A.ofd instanceof ArrayBuffer?A.success&&A.success(Object(k.JSBase64ByHashFile)(A.ofd,A.list,A.method)):n()({url:A.ofd,method:"GET",responseType:"arraybuffer",headers:A.headers}).then((function(I){var g=Object(k.readOFD)(I.data,A.secret,A.digest);j(g,A)})).catch((function(I){A.fail&&A.fail(I)}))},j=function(A,I){0===A.code?(b.ofdCore=new U.Ofd_Core(A.data.ofd,A.data.ofdParserPtr,A.data.leftTime),I.waterText&&(b.waterText=I.waterText),I.digest||(b.waterText="demotest"),I.signatureClickCallback&&(b.eventBus=new i.EventBus,b.eventBus._on("signatureclick",I.signatureClickCallback)),I.signaturesCallback&&I.signaturesCallback(b.ofdCore.getAllSignature(0)),I.success&&I.success(b.ofdCore)):I.fail&&I.fail(A.msg)},O=function(A){QA((function(){if(b.ofdCore&&(Object(k.freeOFD)(b.ofdCore),b.ofdCore=null,b.ofdRender=null),Object(k.CreateLibrary)(),A.ofd instanceof File){var I=new FileReader;I.readAsArrayBuffer(A.ofd),I.onload=function(){var g=Object(k.readOFD)(I.result,A.secret,A.digest);j(g,A)}}else if(A.ofd instanceof ArrayBuffer){var g=Object(k.readOFD)(A.ofd,A.secret,A.digest);j(g,A)}else n()({url:A.ofd,method:"GET",responseType:"arraybuffer",headers:A.headers}).then((function(I){if(A.ofd&&A.ofd.split("/")){var g=A.ofd.split("/");b.fileName=g[g.length-1]}var B=Object(k.readOFD)(I.data,A.secret,A.digest);j(B,A)})).catch((function(I){A.fail&&A.fail(I)}))}))},z=function(A){QA((function(){b.ofdCore&&(Object(k.freeOFD)(b.ofdCore),b.ofdCore=null,b.ofdRender=null),Object(k.CreateLibrary)();var I=Object(k.readOFDByBase64)(A.ofd,A.secret,A.digest);j(I,A)}))},u=function(A){return b.ofdCore.getOFDPageCount(A)},P=function(A){return b.ofdCore.getAllAttachment(A)},v=function(A,I){return b.ofdCore.getAttachmentByID(A,I)},_=function(A,I){return new Promise((function(g,B){var Q=b.ofdCore.getAttachmentByID(A,I);Q?OA(Q.FileLocAbs).then((function(A){g(A)})).catch((function(A){B(A)})):B("attachmentId error")}))},$=function(A,I,g){var B=96;g&&(B=g/b.ofdCore.pageWidth(A,I)*25.4);var Q=new s.Ofd_Core_Helper(B);return{width:b.ofdCore.pageWidth(A,I),height:b.ofdCore.pageHeight(A,I),renderWidth:Q.pageRenderWidth(A,I,b.ofdCore),renderHeight:Q.pageRenderHeight(A,I,b.ofdCore)}},AA=function(A){return b.ofdCore.getCustomTag(A)},IA=function(A){return b.ofdCore.getAllTextObject(A)},gA=function(A,I){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},B=96;I&&"number"==typeof I&&!isNaN(I)&&(B=I/b.ofdCore.pageWidth(A,0)*25.4);var Q=new s.Ofd_Core_Helper(B);g.waterText?Q.setWaterText(g.waterText):b.waterText&&Q.setWaterText(b.waterText),b.ofdRender?b.ofdRender.setDpi(B):b.ofdRender=new S.Ofd_Render(b.ofdCore,Q),g.mixBlendMode&&b.ofdRender.setMixBlendMode(g.mixBlendMode);var C=[],E=b.ofdCore.readOfdDocument(A);if(!E)return C;var D=b.ofdCore.getOFDPageCount(A);g.frontPages>0&&g.frontPages<D&&(D=g.frontPages);for(var i=0;i<D;i++){var o=document.createElement("div"),w=Q.pageRenderWidth(0,i,b.ofdCore),G=Q.pageRenderHeight(0,i,b.ofdCore);o.setAttribute("style","margin-bottom: 20px;position: relative;width:".concat(w,"px;height:").concat(G,"px;background: white;overflow: hidden")),b.ofdRender.renderPage(o,0,i),C.push(o)}return C},BA=function(A,I,g){var B=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},Q=96;g&&"number"==typeof g&&!isNaN(g)&&(Q=g/b.ofdCore.pageWidth(A,I)*25.4);var C=new s.Ofd_Core_Helper(Q);B.waterText?C.setWaterText(B.waterText):b.waterText&&C.setWaterText(b.waterText),b.ofdRender?b.ofdRender.setDpi(Q):b.ofdRender=new S.Ofd_Render(b.ofdCore,C),B.mixBlendMode&&b.ofdRender.setMixBlendMode(B.mixBlendMode);var E=document.createElement("div"),D=C.pageRenderWidth(0,I,b.ofdCore),i=C.pageRenderHeight(0,I,b.ofdCore);return E.setAttribute("style","position: relative;width:".concat(D,"px;height:").concat(i,"px;overflow: hidden")),b.ofdRender.renderPage(E,0,I),E},QA=function(A){if(f)Object(k.setYYDS)(f),A&&A();else{Object(k.needInitAgain)()||A&&(A(),A=null);document.getElementsByTagName("meta").ofdwasm;K()({locateFile:function(){return H.wsdsb}}).then((function(I){var g=I.Module;Object(k.setYYDS)(g),A&&A()}))}},CA=function(){return Object(k.getStreamData)()},EA=function(A){if(A.loadingContainer){if(A.container)for(;A.container.firstChild;)A.container.removeChild(A.container.firstChild);A.container.appendChild(A.loadingContainer)}b.ofdCore&&(b.eventBus=new i.EventBus,b.eventBus._on("pageFinishRender",A.pageFinishRenderCallback),new t.OfdBaseViewer(A.container,A.width,b.eventBus,b.waterText).setOfdCore(b.ofdCore))},DA=function(A){setTimeout((function(){if(A.loadingContainer){if(A.container)for(;A.container.firstChild;)A.container.removeChild(A.container.firstChild);A.container.appendChild(A.loadingContainer)}O({ofd:A.ofd,secret:A.secret,digest:A.digest,headers:A.headers,signatureClickCallback:A.signatureClickCallback,signaturesCallback:A.signaturesCallback,waterText:A.waterText,success:function(I){A.parserOFDSuccess&&A.parserOFDSuccess(I),new t.OfdBaseViewer(A.container,A.width,b.eventBus,b.waterText).setOfdCore(I),A.renderOFDCallback&&A.renderOFDCallback()},fail:function(I){if(A.parserOFDFail&&A.parserOFDFail(I),A.container)for(;A.container.firstChild;)A.container.removeChild(A.container.firstChild);var g=document.createElement("div");g.classList.add("error"),g.textContent=I,A.container.appendChild(g)}})}),200)},iA=function(A){if(A.loadingContainer){if(A.container)for(;A.container.firstChild;)A.container.removeChild(A.container.firstChild);A.container.appendChild(A.loadingContainer)}z({ofd:A.ofd,secret:A.secret,digest:A.digest,signatureClickCallback:A.signatureClickCallback,signaturesCallback:A.signaturesCallback,waterText:A.waterText,success:function(I){A.parserOFDSuccess&&A.parserOFDSuccess(I.ofd),new t.OfdBaseViewer(A.container,A.width,b.eventBus,b.waterText).setOfdCore(I)},fail:function(I){if(A.parserOFDFail&&A.parserOFDFail(I),A.container)for(;A.container.firstChild;)A.container.removeChild(A.container.firstChild);var g=document.createElement("div");g.textContent=I,A.container.appendChild(g)}})},oA=function(A){var I=b.ofdCore.findSignature(0,A.pageRef,A.signatureId),g={signer:I.SignCert.subject,provider:I.SignedInfo.Provider.ProviderName,hashedValue:I.HashHex,HashValid:I.HashValid,signedValue:I.signatureHex,signMethod:I.SignedInfo.SignatureMethod,signVersion:I.SignedInfo.Seal.esVersion,signatureVerify:I.SignatureValid,sealID:I.SignedInfo.Seal.esID,sealName:I.SignedInfo.Seal.Property.name,sealType:I.SignedInfo.Seal.Property.type,sealAuthTime:"".concat(I.SignedInfo.Seal.Property.validStart," 至 ").concat(I.SignedInfo.Seal.Property.validEnd),sealMakeTime:I.SignedInfo.Seal.Property.createDate,sealVersion:I.SignedInfo.Seal.Header.version};A.signatureCallback&&A.signatureCallback(g),setTimeout((function(){var g,B="",Q=W(I.SignedInfo.References);try{for(Q.s();!(g=Q.n()).done;){var C=g.value;B+="".concat(Object(d.replaceFirstSlash)(C.FileRef),"|")}}catch(A){Q.e(A)}finally{Q.f()}var E,D=Object(k.hashPath)(b.ofdCore.ofdParserPtr,B,I.SignedInfo.ReferencesCheckMethod.toLowerCase()),i=!0,o=W(I.SignedInfo.References);try{for(o.s();!(E=o.n()).done;){var w=E.value,G=w.CheckValue,F=D["".concat(Object(d.replaceFirstSlash)(w.FileRef))];i&=G===F}}catch(A){o.e(A)}finally{o.f()}A.hashFileCallback&&A.hashFileCallback(1===i)}),200)},wA=function(){b.viewer.ofdPrint&&dA()},GA=function(){return b.viewer.eventBus},FA=function(A){NA(A)},NA=function(A){var I;b.viewer&&((I=b.viewer.eventBus)._off("resize",sA),I._off("fileinputchange",YA),I._off("openfile",UA),I._off("nextpage",HA),I._off("previouspage",LA),I._off("pagenumberchanged",JA),I._off("pagechanging",tA),I._off("print",dA),I._off("firstpage",aA),I._off("lastpage",KA),I._off("zoomin",ZA),I._off("zoomout",nA),I._off("scalechanging",eA),I._off("scalechanged",lA),I._off("viewportchanging",qA),I._off("switchspreadmode",WA),I._off("scrollmodechanged",rA),I._off("switchscrollmode",xA),I._off("rotatecw",fA),I._off("rotateccw",bA),I._off("documentproperties",VA),I._off("signatureclick",mA),I._off("attachmentclick",TA),I._off("customtagclick",jA),I._off("download",kA),I._off("pageViewerClick",XA),I._off("closePage",cA),I._off("printCallback",SA)),b.viewer=new MA(A)},yA=function(A){hA(A)},RA=function(A){b.viewer&&(A?(b.viewer.config.openFileTip&&(b.viewer.config.openFileTip.hidden=!0),b.viewer.ofdViewer.freeDocument(),b.viewer.config.loadingContainer&&b.viewer.ofdViewer.viewer.appendChild(b.viewer.config.loadingContainer),z({ofd:A,secret:b.viewer.config.secret,digest:b.viewer.config.digest,waterText:b.viewer.config.waterText,success:function(A){if(A.leftTime>0&&A.leftTime/1e3/3600/24<90){b.viewer.config.errorWrapper.moreInfoButton.hidden=!0,b.viewer.config.errorWrapper.container.hidden=!1;var I=A.leftTime/864e5,g=A.leftTime%864e5/36e5,B=A.leftTime%36e5/6e4,Q=A.leftTime%6e4/1e3;b.viewer.config.errorWrapper.errorMessage.textContent="组件剩余时间为".concat(Math.floor(I),"天").concat(Math.floor(g),"小时").concat(Math.floor(B),"分").concat(Math.floor(Q),"秒"),b.viewer.config.exceedTimeLimit&&b.viewer.config.exceedTimeLimit()}b.viewer.config.parserOFDSuccess&&b.viewer.config.parserOFDSuccess(A.ofd),b.ofdCore=A,b.viewer.ofdViewer.setWaterText(b.waterText),b.viewer.ofdViewer.setWaterSetting(b.viewer.config.waterSetting),b.viewer.ofdViewer.setOfdCore(A),b.viewer.ofdThumbnailViewer&&b.viewer.ofdThumbnailViewer.setOfdCore(A),b.viewer.ofdSignatureViewer.setOfdCore(A,b.viewer.config.signatureViewerForceCheck),b.viewer.ofdAttachmentViewer.setOfdCore(A),b.viewer.ofdCustomTagViewer.setOfdCore(A),b.viewer.config.signaturesCallback&&b.viewer.config.signaturesCallback(A.getAllSignature(0)),b.viewer.toolbar.setPagesCount(A.getOFDPageCount(0),!1),b.viewer.secondaryToolbar.setPagesCount(A.getOFDPageCount(0)),b.viewer.config.sidebarForceOpen&&A.getSignatureCount(0)>0&&setTimeout((function(){b.viewer.pdfSidebar.open()}),500)},fail:function(A){b.viewer.config.parserOFDFail&&b.viewer.config.parserOFDFail(A),b.viewer.ofdViewer.freeDocument(),b.viewer.config.errorWrapper.moreInfoButton.hidden=!0,b.viewer.config.errorWrapper.container.hidden=!1,b.viewer.config.errorWrapper.errorMessage.textContent=A}})):b.viewer.config.parserOFDFail&&b.viewer.config.parserOFDFail("file undefined"))},hA=function(A){b.viewer&&(A?(b.viewer.config.openFileTip&&(b.viewer.config.openFileTip.hidden=!0),b.viewer.ofdViewer.freeDocument(),b.viewer.config.loadingContainer&&b.viewer.ofdViewer.viewer.appendChild(b.viewer.config.loadingContainer),O({ofd:A,secret:b.viewer.config.secret,digest:b.viewer.config.digest,waterText:b.viewer.config.waterText,success:function(A){if(A.leftTime>0&&A.leftTime/1e3/3600/24<90){b.viewer.config.errorWrapper.moreInfoButton.hidden=!0,b.viewer.config.errorWrapper.container.hidden=!1;var I=A.leftTime/864e5,g=A.leftTime%864e5/36e5,B=A.leftTime%36e5/6e4,Q=A.leftTime%6e4/1e3;b.viewer.config.errorWrapper.errorMessage.textContent="组件剩余时间为".concat(Math.floor(I),"天").concat(Math.floor(g),"小时").concat(Math.floor(B),"分").concat(Math.floor(Q),"秒"),b.viewer.config.exceedTimeLimit&&b.viewer.config.exceedTimeLimit()}b.viewer.config.parserOFDSuccess&&b.viewer.config.parserOFDSuccess(A.ofd),b.ofdCore=A,b.viewer.ofdViewer.setWaterText(b.waterText),b.viewer.ofdViewer.setWaterSetting(b.viewer.config.waterSetting),b.viewer.ofdViewer.setOfdCore(A),b.viewer.ofdThumbnailViewer&&b.viewer.ofdThumbnailViewer.setOfdCore(A),b.viewer.ofdSignatureViewer.setOfdCore(A,b.viewer.config.signatureViewerForceCheck),b.viewer.ofdAttachmentViewer.setOfdCore(A),b.viewer.ofdCustomTagViewer.setOfdCore(A),b.viewer.config.signaturesCallback&&b.viewer.config.signaturesCallback(A.getAllSignature(0)),b.viewer.toolbar.setPagesCount(A.getOFDPageCount(0),!1),b.viewer.secondaryToolbar.setPagesCount(A.getOFDPageCount(0)),b.viewer.config.sidebarForceOpen&&A.getSignatureCount(0)>0&&setTimeout((function(){b.viewer.pdfSidebar.open()}),500)},fail:function(A){b.viewer.config.parserOFDFail&&b.viewer.config.parserOFDFail(A),b.viewer.ofdViewer.freeDocument(),b.viewer.config.errorWrapper.moreInfoButton.hidden=!0,b.viewer.config.errorWrapper.container.hidden=!1,b.viewer.config.errorWrapper.errorMessage.textContent=A}})):b.viewer.config.parserOFDFail&&b.viewer.config.parserOFDFail("file undefined"))},MA=Q()((function A(I){var g=this;E()(this,A),this.config=I,this.l10n=new D.GenericL10n("zh-CN"),this.eventBus=new i.EventBus,this.ofdViewer=new o.OfdViewer(I.mainContainer,I.viewerContainer,this.eventBus,I.mixBlendMode,I.defaultScale),I.sidebar.thumbnailView&&(this.ofdThumbnailViewer=new w.OfdThumbnailViewer(I.sidebar.thumbnailView,this.eventBus)),this.ofdSignatureViewer=new L.OfdSignatureViewer(I.sidebar.signaturesView,this.eventBus),this.ofdAttachmentViewer=new J.OfdAttachmentViewer(I.sidebar.attachmentsView,this.eventBus),this.ofdCustomTagViewer=new l.OfdCustomTagViewer(I.sidebar.outlineView,this.eventBus),this.pdfSidebar=new G.PDFSidebar({elements:I.sidebar,ofdViewer:this.ofdViewer,ofdThumbnailViewer:this.ofdThumbnailViewer,eventBus:this.eventBus,l10n:this.l10n}),this.overlayManager=new F.OverlayManager,I.signatureProperties&&(this.signatureProperties=new Y.OFDSignatureProperties(I.signatureProperties,this.overlayManager,this.eventBus,this.l10n)),I.documentProperties&&(this.ofdDocumentProperties=new N.PDFDocumentProperties(I.documentProperties,this.overlayManager,this.eventBus,this.l10n)),this.toolbar=new y.Toolbar(I.toolbar,this.eventBus,this.l10n),this.secondaryToolbar=new R.SecondaryToolbar(I.secondaryToolbar,I.mainContainer,this.eventBus);var B=document.createElement("input");B.id="fileInput",B.className="fileInput",B.setAttribute("type","file"),B.setAttribute("accept",".ofd"),document.body.appendChild(B);var Q=this;B.addEventListener("click",(function(A){A.target.value=null})),B.addEventListener("change",(function(A){var I=A.target.files;I&&0!==I.length&&Q.eventBus.dispatch("fileinputchange",{source:this,fileInput:A.target,eventBus:Q.eventBus})})),new h.PDFCursorTools({container:I.mainContainer,eventBus:this.eventBus});var C=document.getElementById("printServiceDialog");C&&(this.ofdPrint=new M.Print(C,this.overlayManager,this.l10n,this.eventBus,I.onPrintContentCallback));var U=I.appContainer||document.documentElement;this.l10n.translate(U).then((function(){g.eventBus.dispatch("localized",{})})),this.eventBus._on("printCallback",SA),this.eventBus._on("resize",sA),this.eventBus._on("fileinputchange",YA),this.eventBus._on("openfile",UA),this.eventBus._on("nextpage",HA),this.eventBus._on("previouspage",LA),this.eventBus._on("pagenumberchanged",JA),this.eventBus._on("pagechanging",tA),this.eventBus._on("print",dA),this.eventBus._on("firstpage",aA),this.eventBus._on("lastpage",KA),this.eventBus._on("zoomin",ZA),this.eventBus._on("zoomout",nA),this.eventBus._on("scalechanging",eA),this.eventBus._on("viewportchanging",qA),this.eventBus._on("scalechanged",lA),this.eventBus._on("switchspreadmode",WA),this.eventBus._on("scrollmodechanged",rA),this.eventBus._on("switchscrollmode",xA),this.eventBus._on("rotatecw",fA),this.eventBus._on("rotateccw",bA),this.eventBus._on("documentproperties",VA),this.eventBus._on("signatureclick",mA),this.eventBus._on("attachmentclick",TA),this.eventBus._on("customtagclick",jA),this.eventBus._on("download",kA),this.eventBus._on("pageViewerClick",XA),this.eventBus._on("closePage",cA),window.addEventListener("click",pA),window.addEventListener("resize",(function(){g.eventBus.dispatch("resize",{source:window})})),I.errorWrapper.closeButton.onclick=function(){I.errorWrapper.container.hidden=!0},I.toolbar.presentationModeButton&&(I.toolbar.presentationModeButton.hidden=!0),I.toolbar.viewBookmark&&(I.toolbar.viewBookmark.hidden=!0),I.secondaryToolbar.presentationModeButton&&(I.secondaryToolbar.presentationModeButton.hidden=!0),I.secondaryToolbar.viewBookmarkButton&&(I.secondaryToolbar.viewBookmarkButton.hidden=!0),I.secondaryToolbar.viewBookmarkButton&&(I.secondaryToolbar.viewBookmarkButton.hidden=!0),C&&"function"!=typeof C.showModal&&(C&&(C.hidden=!0),I.documentProperties&&I.documentProperties.dialog&&(I.documentProperties.dialog.hidden=!0),I.signatureProperties&&I.signatureProperties.dialog&&(I.signatureProperties.dialog.hidden=!0))}));function UA(){document.getElementById("fileInput").click()}function cA(){b.viewer.config.closeCallback&&b.viewer.config.closeCallback()}function kA(){var A=Object(k.getStreamData)();if(A)if(b.viewer.config.downloadCallback)b.viewer.config.downloadCallback(new Blob([A]));else{var I=window.URL.createObjectURL(new Blob([A])),g=document.createElement("a");g.style.display="none",g.href=I,g.setAttribute("download",b.fileName),document.body.append(g),g.click()}}function SA(A){b.viewer.config.onPrintContentCallback&&b.viewer.config.onPrintContentCallback(A.html)}function sA(){var A=b.ofdCore,I=b.viewer;if(A){var g=I.ofdViewer.currentScaleValue;"auto"!==g&&"page-fit"!==g&&"page-width"!==g||(I.ofdViewer.currentScaleValue=g),b.viewer.eventBus.dispatch("stampResize",{source:null})}}function YA(A){b.viewer.config.openFileTip&&(b.viewer.config.openFileTip.hidden=!0),b.viewer.pdfSidebar.isOpen&&b.viewer.pdfSidebar.close();var I=A.fileInput.files[0];b.fileName=I.name,b.viewer.ofdViewer.freeDocument(),b.viewer.config.loadingContainer&&b.viewer.ofdViewer.viewer.appendChild(b.viewer.config.loadingContainer);(new Date).getTime();O({ofd:I,secret:b.viewer.config.secret,digest:b.viewer.config.digest,waterText:b.viewer.config.waterText,success:function(A){(new Date).getTime();if(A.leftTime>0&&A.leftTime/1e3/3600/24<90){b.viewer.config.errorWrapper.moreInfoButton.hidden=!0,b.viewer.config.errorWrapper.container.hidden=!1;var I=A.leftTime/864e5,g=A.leftTime%864e5/36e5,B=A.leftTime%36e5/6e4,Q=A.leftTime%6e4/1e3;b.viewer.config.errorWrapper.errorMessage.textContent="组件剩余时间为".concat(Math.floor(I),"天").concat(Math.floor(g),"小时").concat(Math.floor(B),"分").concat(Math.floor(Q),"秒"),b.viewer.config.exceedTimeLimit&&b.viewer.config.exceedTimeLimit()}b.viewer.config.parserOFDSuccess&&b.viewer.config.parserOFDSuccess(A.ofd),b.ofdCore=A,b.viewer.ofdViewer.setWaterText(b.waterText),b.viewer.ofdViewer.setWaterSetting(b.viewer.config.waterSetting),b.viewer.ofdViewer.setOfdCore(A),b.viewer.ofdThumbnailViewer&&b.viewer.ofdThumbnailViewer.setOfdCore(A),b.viewer.config.signaturesCallback&&b.viewer.config.signaturesCallback(A.getAllSignature(0)),b.viewer.ofdSignatureViewer.setOfdCore(A,b.viewer.config.signatureViewerForceCheck),b.viewer.ofdAttachmentViewer.setOfdCore(A),b.viewer.ofdCustomTagViewer.setOfdCore(A),b.viewer.toolbar.setPagesCount(A.getOFDPageCount(0),!1),b.viewer.secondaryToolbar.setPagesCount(A.getOFDPageCount(0)),b.viewer.config.sidebarForceOpen&&A.getSignatureCount(0)>0&&setTimeout((function(){b.viewer.pdfSidebar.open()}),500)},fail:function(A){b.viewer.config.parserOFDFail&&b.viewer.config.parserOFDFail(A),b.viewer.ofdViewer.freeDocument(),b.viewer.config.errorWrapper.moreInfoButton.hidden=!0,b.viewer.config.errorWrapper.container.hidden=!1,b.viewer.config.errorWrapper.errorMessage.textContent=A}})}function aA(){b.viewer.ofdViewer.firstPage()}function KA(){b.viewer.ofdViewer.lastPage()}function HA(){b.viewer.ofdViewer.nextPage()}function LA(){b.viewer.ofdViewer.previousPage()}function JA(A){""!==A.value&&A.source.eventBus.dispatch("jumpPage",{source:A.source,pageIndex:A.value}),b.viewer.toolbar.setPageNumber(A.value,null),b.viewer.secondaryToolbar.setPageNumber(A.value,null)}function tA(A){var I=A.pageNumber;b.viewer.toolbar.setPageNumber(I,null),b.viewer.secondaryToolbar.setPageNumber(I,null),b.viewer.pdfSidebar.isThumbnailViewVisible&&b.viewer.ofdThumbnailViewer.scrollThumbnailIntoView(I),b.viewer.config.onPageChanging&&b.viewer.config.onPageChanging(I)}function dA(){b.viewer.ofdPrint.setOfdCore(b.ofdCore),b.viewer.ofdPrint.open()}function ZA(){b.viewer.ofdViewer.increaseScale()}function nA(){b.viewer.ofdViewer.decreaseScale()}function eA(A){b.viewer.toolbar.setPageScale(A.presetValue,A.scale),b.viewer.config.onPageScale&&b.viewer.config.onPageScale(A.scale)}function qA(A){b.viewer.config.onViewportChange&&b.viewer.config.onViewportChange(b.viewer.ofdViewer)}function lA(A){b.viewer.ofdViewer.zoom(A.value)}function WA(A){b.viewer.ofdViewer.setSpreadMode(A.mode)}function rA(A){}function xA(A){b.viewer.ofdViewer.setScrollMode(A.mode)}function fA(){b.viewer.ofdViewer.setRotation(90)}function bA(){b.viewer.ofdViewer.setRotation(-90)}function VA(){b.viewer.ofdDocumentProperties.setOfdCore(b.ofdCore),b.viewer.ofdDocumentProperties.open()}function pA(A){b.viewer.secondaryToolbar.isOpen&&(b.viewer.config.mainContainer.contains(A.target)||b.viewer.config.toolbar.container.contains(A.target)&&A.target!==b.viewer.config.secondaryToolbar.toggleButton)&&b.viewer.secondaryToolbar.close()}function mA(A){if(b.viewer.signatureProperties)if(b.viewer.signatureProperties.setOfdCore(b.ofdCore),A.pageRef||A.signatureId){var I=b.ofdCore.findSignature(0,A.pageRef,A.signatureId);b.viewer.signatureProperties.open(I)}else b.viewer.signatureProperties.open(A.sign.Signature)}function TA(A){var I=A.attachment.FileLocAbs.split("/"),g=A.attachment.Name;g||(g=I[I.length-1]),g.indexOf(".")<0&&(g="".concat(g,".").concat(A.attachment.Format)),OA(A.attachment.FileLocAbs).then((function(A){var I=window.URL.createObjectURL(new Blob([A])),B=document.createElement("a");B.style.display="none",B.href=I,B.setAttribute("download",g),document.body.append(B),B.click()})).catch((function(A){}))}function XA(A){b.viewer.ofdViewer&&b.viewer.ofdViewer.removeHighLight()}function jA(A){A.source.eventBus.dispatch("jumpPage",{source:A.source,pageIndex:A.pageIndex+1,eleIdArray:A.eleIdArray}),b.viewer.toolbar.setPageNumber(A.pageIndex+1,null),b.viewer.secondaryToolbar.setPageNumber(A.pageIndex+1,null)}function OA(A){return new Promise((function(I,g){Object(k.getStreamData)()&&I(Object(k.JSGetPathEncode)(b.ofdCore.ofdParserPtr,A))}))}},function(A,I){function g(A,I){for(var g=0;g<I.length;g++){var B=I[g];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(A,B.key,B)}}A.exports=function(A,I,B){return I&&g(A.prototype,I),B&&g(A,B),Object.defineProperty(A,"prototype",{writable:!1}),A},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){"use strict";g.r(I),g.d(I,"GenericL10n",(function(){return N}));var B=g(4),Q=g.n(B),C=g(2),E=g.n(C),D=g(1),i=g.n(D),o=g(5),w=g.n(o),G=(g(8),g(9)),F=document.webL10n,N=function(){function A(I){E()(this,A),this._lang=I,this._ready=new Promise((function(A,g){F.setLanguage(Object(G.fixupLangCode)(I),(function(){A(F)}))}))}var I,g,B,C;return i()(A,[{key:"getLanguage",value:(C=Q()(w.a.mark((function A(){var I;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,this._ready;case 2:return I=A.sent,A.abrupt("return",I.getLanguage());case 4:case"end":return A.stop()}}),A,this)}))),function(){return C.apply(this,arguments)})},{key:"getDirection",value:(B=Q()(w.a.mark((function A(){var I;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,this._ready;case 2:return I=A.sent,A.abrupt("return",I.getDirection());case 4:case"end":return A.stop()}}),A,this)}))),function(){return B.apply(this,arguments)})},{key:"get",value:(g=Q()(w.a.mark((function A(I){var g,B,Q,C=arguments;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return g=C.length>1&&void 0!==C[1]?C[1]:null,B=C.length>2&&void 0!==C[2]?C[2]:Object(G.getL10nFallback)(I,g),A.next=4,this._ready;case 4:return Q=A.sent,A.abrupt("return",Q.get(I,g,B));case 6:case"end":return A.stop()}}),A,this)}))),function(A){return g.apply(this,arguments)})},{key:"translate",value:(I=Q()(w.a.mark((function A(I){var g;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,this._ready;case 2:return g=A.sent,A.abrupt("return",g.translate(I));case 4:case"end":return A.stop()}}),A,this)}))),function(A){return I.apply(this,arguments)})}]),A}()},function(A,I){function g(A,I,g,B,Q,C,E){try{var D=A[C](E),i=D.value}catch(A){return void g(A)}D.done?I(i):Promise.resolve(i).then(B,Q)}A.exports=function(A){return function(){var I=this,B=arguments;return new Promise((function(Q,C){var E=A.apply(I,B);function D(A){g(E,Q,C,D,i,"next",A)}function i(A){g(E,Q,C,D,i,"throw",A)}D(void 0)}))}},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(6)();A.exports=B;try{regeneratorRuntime=B}catch(A){"object"==typeof globalThis?globalThis.regeneratorRuntime=B:Function("r","regeneratorRuntime = r")(B)}},function(A,I,g){var B=g(7).default;function Q(){"use strict";
2
- /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */A.exports=Q=function(){return I},A.exports.__esModule=!0,A.exports.default=A.exports;var I={},g=Object.prototype,C=g.hasOwnProperty,E="function"==typeof Symbol?Symbol:{},D=E.iterator||"@@iterator",i=E.asyncIterator||"@@asyncIterator",o=E.toStringTag||"@@toStringTag";function w(A,I,g){return Object.defineProperty(A,I,{value:g,enumerable:!0,configurable:!0,writable:!0}),A[I]}try{w({},"")}catch(A){w=function(A,I,g){return A[I]=g}}function G(A,I,g,B){var Q=I&&I.prototype instanceof y?I:y,C=Object.create(Q.prototype),E=new H(B||[]);return C._invoke=function(A,I,g){var B="suspendedStart";return function(Q,C){if("executing"===B)throw new Error("Generator is already running");if("completed"===B){if("throw"===Q)throw C;return J()}for(g.method=Q,g.arg=C;;){var E=g.delegate;if(E){var D=Y(E,g);if(D){if(D===N)continue;return D}}if("next"===g.method)g.sent=g._sent=g.arg;else if("throw"===g.method){if("suspendedStart"===B)throw B="completed",g.arg;g.dispatchException(g.arg)}else"return"===g.method&&g.abrupt("return",g.arg);B="executing";var i=F(A,I,g);if("normal"===i.type){if(B=g.done?"completed":"suspendedYield",i.arg===N)continue;return{value:i.arg,done:g.done}}"throw"===i.type&&(B="completed",g.method="throw",g.arg=i.arg)}}}(A,g,E),C}function F(A,I,g){try{return{type:"normal",arg:A.call(I,g)}}catch(A){return{type:"throw",arg:A}}}I.wrap=G;var N={};function y(){}function R(){}function h(){}var M={};w(M,D,(function(){return this}));var U=Object.getPrototypeOf,c=U&&U(U(L([])));c&&c!==g&&C.call(c,D)&&(M=c);var k=h.prototype=y.prototype=Object.create(M);function S(A){["next","throw","return"].forEach((function(I){w(A,I,(function(A){return this._invoke(I,A)}))}))}function s(A,I){function g(Q,E,D,i){var o=F(A[Q],A,E);if("throw"!==o.type){var w=o.arg,G=w.value;return G&&"object"==B(G)&&C.call(G,"__await")?I.resolve(G.__await).then((function(A){g("next",A,D,i)}),(function(A){g("throw",A,D,i)})):I.resolve(G).then((function(A){w.value=A,D(w)}),(function(A){return g("throw",A,D,i)}))}i(o.arg)}var Q;this._invoke=function(A,B){function C(){return new I((function(I,Q){g(A,B,I,Q)}))}return Q=Q?Q.then(C,C):C()}}function Y(A,I){var g=A.iterator[I.method];if(void 0===g){if(I.delegate=null,"throw"===I.method){if(A.iterator.return&&(I.method="return",I.arg=void 0,Y(A,I),"throw"===I.method))return N;I.method="throw",I.arg=new TypeError("The iterator does not provide a 'throw' method")}return N}var B=F(g,A.iterator,I.arg);if("throw"===B.type)return I.method="throw",I.arg=B.arg,I.delegate=null,N;var Q=B.arg;return Q?Q.done?(I[A.resultName]=Q.value,I.next=A.nextLoc,"return"!==I.method&&(I.method="next",I.arg=void 0),I.delegate=null,N):Q:(I.method="throw",I.arg=new TypeError("iterator result is not an object"),I.delegate=null,N)}function a(A){var I={tryLoc:A[0]};1 in A&&(I.catchLoc=A[1]),2 in A&&(I.finallyLoc=A[2],I.afterLoc=A[3]),this.tryEntries.push(I)}function K(A){var I=A.completion||{};I.type="normal",delete I.arg,A.completion=I}function H(A){this.tryEntries=[{tryLoc:"root"}],A.forEach(a,this),this.reset(!0)}function L(A){if(A){var I=A[D];if(I)return I.call(A);if("function"==typeof A.next)return A;if(!isNaN(A.length)){var g=-1,B=function I(){for(;++g<A.length;)if(C.call(A,g))return I.value=A[g],I.done=!1,I;return I.value=void 0,I.done=!0,I};return B.next=B}}return{next:J}}function J(){return{value:void 0,done:!0}}return R.prototype=h,w(k,"constructor",h),w(h,"constructor",R),R.displayName=w(h,o,"GeneratorFunction"),I.isGeneratorFunction=function(A){var I="function"==typeof A&&A.constructor;return!!I&&(I===R||"GeneratorFunction"===(I.displayName||I.name))},I.mark=function(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,h):(A.__proto__=h,w(A,o,"GeneratorFunction")),A.prototype=Object.create(k),A},I.awrap=function(A){return{__await:A}},S(s.prototype),w(s.prototype,i,(function(){return this})),I.AsyncIterator=s,I.async=function(A,g,B,Q,C){void 0===C&&(C=Promise);var E=new s(G(A,g,B,Q),C);return I.isGeneratorFunction(g)?E:E.next().then((function(A){return A.done?A.value:E.next()}))},S(k),w(k,o,"Generator"),w(k,D,(function(){return this})),w(k,"toString",(function(){return"[object Generator]"})),I.keys=function(A){var I=[];for(var g in A)I.push(g);return I.reverse(),function g(){for(;I.length;){var B=I.pop();if(B in A)return g.value=B,g.done=!1,g}return g.done=!0,g}},I.values=L,H.prototype={constructor:H,reset:function(A){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(K),!A)for(var I in this)"t"===I.charAt(0)&&C.call(this,I)&&!isNaN(+I.slice(1))&&(this[I]=void 0)},stop:function(){this.done=!0;var A=this.tryEntries[0].completion;if("throw"===A.type)throw A.arg;return this.rval},dispatchException:function(A){if(this.done)throw A;var I=this;function g(g,B){return E.type="throw",E.arg=A,I.next=g,B&&(I.method="next",I.arg=void 0),!!B}for(var B=this.tryEntries.length-1;B>=0;--B){var Q=this.tryEntries[B],E=Q.completion;if("root"===Q.tryLoc)return g("end");if(Q.tryLoc<=this.prev){var D=C.call(Q,"catchLoc"),i=C.call(Q,"finallyLoc");if(D&&i){if(this.prev<Q.catchLoc)return g(Q.catchLoc,!0);if(this.prev<Q.finallyLoc)return g(Q.finallyLoc)}else if(D){if(this.prev<Q.catchLoc)return g(Q.catchLoc,!0)}else{if(!i)throw new Error("try statement without catch or finally");if(this.prev<Q.finallyLoc)return g(Q.finallyLoc)}}}},abrupt:function(A,I){for(var g=this.tryEntries.length-1;g>=0;--g){var B=this.tryEntries[g];if(B.tryLoc<=this.prev&&C.call(B,"finallyLoc")&&this.prev<B.finallyLoc){var Q=B;break}}Q&&("break"===A||"continue"===A)&&Q.tryLoc<=I&&I<=Q.finallyLoc&&(Q=null);var E=Q?Q.completion:{};return E.type=A,E.arg=I,Q?(this.method="next",this.next=Q.finallyLoc,N):this.complete(E)},complete:function(A,I){if("throw"===A.type)throw A.arg;return"break"===A.type||"continue"===A.type?this.next=A.arg:"return"===A.type?(this.rval=this.arg=A.arg,this.method="return",this.next="end"):"normal"===A.type&&I&&(this.next=I),N},finish:function(A){for(var I=this.tryEntries.length-1;I>=0;--I){var g=this.tryEntries[I];if(g.finallyLoc===A)return this.complete(g.completion,g.afterLoc),K(g),N}},catch:function(A){for(var I=this.tryEntries.length-1;I>=0;--I){var g=this.tryEntries[I];if(g.tryLoc===A){var B=g.completion;if("throw"===B.type){var Q=B.arg;K(g)}return Q}}throw new Error("illegal catch attempt")},delegateYield:function(A,I,g){return this.delegate={iterator:L(A),resultName:I,nextLoc:g},"next"===this.method&&(this.arg=void 0),N}},I}A.exports=Q,A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){function g(I){return A.exports=g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},A.exports.__esModule=!0,A.exports.default=A.exports,g(I)}A.exports=g,A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){"use strict";document.webL10n=function(A,I,g){var B={},Q="",C="textContent",E="",D={},i="loading";function o(A,I,g){I=I||function(A){},g=g||function(){};var B=new XMLHttpRequest;B.open("GET",A,true),B.overrideMimeType&&B.overrideMimeType("text/plain; charset=utf-8"),B.onreadystatechange=function(){4==B.readyState&&(200==B.status||0===B.status?I(B.responseText):g())},B.onerror=g,B.ontimeout=g;try{B.send(null)}catch(A){g()}}function w(A,I,g,E){var D=A.replace(/[^\/]*$/,"")||"./";function i(A){return A.lastIndexOf("\\")<0?A:A.replace(/\\\\/g,"\\").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\{/g,"{").replace(/\\}/g,"}").replace(/\\"/g,'"').replace(/\\'/g,"'")}o(A,(function(A){Q+=A,function(A,g){var B={},Q=/^\s*|\s*$/,C=/^\s*#|^\s*$/,E=/^\s*\[(.*)\]\s*$/,w=/^\s*@import\s+url\((.*)\)\s*$/i,G=/^([^=\s]*)\s*=\s*(.+)$/;function F(A,g,o){var F=A.replace(Q,"").split(/[\r\n]+/),y="*",R=I.split("-",1)[0],h=!1,M="";!function A(){for(;;){if(!F.length)return void o();var Q=F.shift();if(!C.test(Q)){if(g){if(M=E.exec(Q)){y=M[1].toLowerCase(),h="*"!==y&&y!==I&&y!==R;continue}if(h)continue;if(M=w.exec(Q))return void N(D+M[1],A)}var U=Q.match(G);U&&3==U.length&&(B[U[1]]=i(U[2]))}}}()}function N(A,I){o(A,(function(A){F(A,!1,I)}),(function(){I()}))}F(A,!0,(function(){g(B)}))}(A,(function(A){for(var I in A){var Q,E,D=I.lastIndexOf(".");D>0?(Q=I.substring(0,D),E=I.substring(D+1)):(Q=I,E=C),B[Q]||(B[Q]={}),B[Q][E]=A[I]}g&&g()}))}),E)}function G(A,g){A&&(A=A.toLowerCase()),g=g||function(){},B={},Q="",E="",E=A;var C=I.querySelectorAll('link[type="application/l10n"]'),D=C.length;if(0!==D){var o,G,F=0;G=function(){++F>=D&&(g(),i="complete")};for(var N=0;N<D;N++){new M(C[N]).load(A,G)}}else{var y=(o=I.querySelector('script[type="application/l10n"]'))?JSON.parse(o.innerHTML):null;if(y&&y.locales&&y.default_locale){if(!(B=y.locales[A])){var R=y.default_locale.toLowerCase();for(var h in y.locales){if((h=h.toLowerCase())===A){B=y.locales[A];break}h===R&&(B=y.locales[R])}}g()}i="complete"}function M(A){var I=A.href;this.load=function(A,g){w(I,A,g,(function(){E="",g()}))}}}function F(A,I,g){var Q=B[A];if(!Q){if(!g)return null;Q=g}var C={};for(var E in Q){var D=Q[E];D=y(D=N(D,I,A,E),I,A),C[E]=D}return C}function N(A,I,g,Q){var C=/\{\[\s*([a-zA-Z]+)\(([a-zA-Z]+)\)\s*\]\}/.exec(A);if(!C||!C.length)return A;var E,i=C[1],o=C[2];(I&&o in I?E=I[o]:o in B&&(E=B[o]),i in D)&&(A=(0,D[i])(A,E,g,Q));return A}function y(A,I,g){return A.replace(/\{\{\s*(.+?)\s*\}\}/g,(function(A,g){return I&&g in I?I[g]:g in B?B[g]:A}))}function R(A){var g=function(A){if(!A)return{};var I=A.getAttribute("data-l10n-id"),g=A.getAttribute("data-l10n-args"),B={};if(g)try{B=JSON.parse(g)}catch(A){}return{id:I,args:B}}(A);if(g.id){var B=F(g.id,g.args);if(B){if(B[C]){if(0===function(A){if(A.children)return A.children.length;if(void 0!==A.childElementCount)return A.childElementCount;for(var I=0,g=0;g<A.childNodes.length;g++)I+=1===A.nodeType?1:0;return I}(A))A[C]=B[C];else{for(var Q=A.childNodes,E=!1,D=0,i=Q.length;D<i;D++)3===Q[D].nodeType&&/\S/.test(Q[D].nodeValue)&&(E?Q[D].nodeValue="":(Q[D].nodeValue=B[C],E=!0));if(!E){var o=I.createTextNode(B[C]);A.insertBefore(o,A.firstChild)}}delete B[C]}for(var w in B)A[w]=B[w]}}}return D.plural=function(A,I,g,Q){var i=parseFloat(I);if(isNaN(i))return A;if(Q!=C)return A;D._pluralRules||(D._pluralRules=function(A){function I(A,I){return-1!==I.indexOf(A)}function g(A,I,g){return I<=A&&A<=g}var B={0:function(A){return"other"},1:function(A){return g(A%100,3,10)?"few":0===A?"zero":g(A%100,11,99)?"many":2==A?"two":1==A?"one":"other"},2:function(A){return 0!==A&&A%10==0?"many":2==A?"two":1==A?"one":"other"},3:function(A){return 1==A?"one":"other"},4:function(A){return g(A,0,1)?"one":"other"},5:function(A){return g(A,0,2)&&2!=A?"one":"other"},6:function(A){return 0===A?"zero":A%10==1&&A%100!=11?"one":"other"},7:function(A){return 2==A?"two":1==A?"one":"other"},8:function(A){return g(A,3,6)?"few":g(A,7,10)?"many":2==A?"two":1==A?"one":"other"},9:function(A){return 0===A||1!=A&&g(A%100,1,19)?"few":1==A?"one":"other"},10:function(A){return g(A%10,2,9)&&!g(A%100,11,19)?"few":A%10!=1||g(A%100,11,19)?"other":"one"},11:function(A){return g(A%10,2,4)&&!g(A%100,12,14)?"few":A%10==0||g(A%10,5,9)||g(A%100,11,14)?"many":A%10==1&&A%100!=11?"one":"other"},12:function(A){return g(A,2,4)?"few":1==A?"one":"other"},13:function(A){return g(A%10,2,4)&&!g(A%100,12,14)?"few":1!=A&&g(A%10,0,1)||g(A%10,5,9)||g(A%100,12,14)?"many":1==A?"one":"other"},14:function(A){return g(A%100,3,4)?"few":A%100==2?"two":A%100==1?"one":"other"},15:function(A){return 0===A||g(A%100,2,10)?"few":g(A%100,11,19)?"many":1==A?"one":"other"},16:function(A){return A%10==1&&11!=A?"one":"other"},17:function(A){return 3==A?"few":0===A?"zero":6==A?"many":2==A?"two":1==A?"one":"other"},18:function(A){return 0===A?"zero":g(A,0,2)&&0!==A&&2!=A?"one":"other"},19:function(A){return g(A,2,10)?"few":g(A,0,1)?"one":"other"},20:function(A){return!g(A%10,3,4)&&A%10!=9||g(A%100,10,19)||g(A%100,70,79)||g(A%100,90,99)?A%1e6==0&&0!==A?"many":A%10!=2||I(A%100,[12,72,92])?A%10!=1||I(A%100,[11,71,91])?"other":"one":"two":"few"},21:function(A){return 0===A?"zero":1==A?"one":"other"},22:function(A){return g(A,0,1)||g(A,11,99)?"one":"other"},23:function(A){return g(A%10,1,2)||A%20==0?"one":"other"},24:function(A){return g(A,3,10)||g(A,13,19)?"few":I(A,[2,12])?"two":I(A,[1,11])?"one":"other"}},Q={af:3,ak:4,am:4,ar:1,asa:3,az:0,be:11,bem:3,bez:3,bg:3,bh:4,bm:0,bn:3,bo:0,br:20,brx:3,bs:11,ca:3,cgg:3,chr:3,cs:12,cy:17,da:3,de:3,dv:3,dz:0,ee:3,el:3,en:3,eo:3,es:3,et:3,eu:3,fa:0,ff:5,fi:3,fil:4,fo:3,fr:5,fur:3,fy:3,ga:8,gd:24,gl:3,gsw:3,gu:3,guw:4,gv:23,ha:3,haw:3,he:2,hi:4,hr:11,hu:0,id:0,ig:0,ii:0,is:3,it:3,iu:7,ja:0,jmc:3,jv:0,ka:0,kab:5,kaj:3,kcg:3,kde:0,kea:0,kk:3,kl:3,km:0,kn:0,ko:0,ksb:3,ksh:21,ku:3,kw:7,lag:18,lb:3,lg:3,ln:4,lo:0,lt:10,lv:6,mas:3,mg:4,mk:16,ml:3,mn:3,mo:9,mr:3,ms:0,mt:15,my:0,nah:3,naq:7,nb:3,nd:3,ne:3,nl:3,nn:3,no:3,nr:3,nso:4,ny:3,nyn:3,om:3,or:3,pa:3,pap:3,pl:13,ps:3,pt:3,rm:3,ro:9,rof:3,ru:11,rwk:3,sah:0,saq:3,se:7,seh:3,ses:0,sg:0,sh:11,shi:19,sk:12,sl:14,sma:7,smi:7,smj:7,smn:7,sms:7,sn:3,so:3,sq:3,sr:11,ss:3,ssy:3,st:3,sv:3,sw:3,syr:3,ta:3,te:3,teo:3,th:0,ti:4,tig:3,tk:3,tl:4,tn:3,to:0,tr:0,ts:3,tzm:22,uk:11,ur:3,ve:3,vi:0,vun:3,wa:4,wae:3,wo:0,xh:3,xog:3,yo:0,zh:0,zu:3}[A.replace(/-.*$/,"")];return Q in B?B[Q]:function(){return"other"}}(E));var o="["+D._pluralRules(i)+"]";return 0===i&&g+"[zero]"in B?A=B[g+"[zero]"][Q]:1==i&&g+"[one]"in B?A=B[g+"[one]"][Q]:2==i&&g+"[two]"in B?A=B[g+"[two]"][Q]:g+o in B?A=B[g+o][Q]:g+"[other]"in B&&(A=B[g+"[other]"][Q]),A},{get:function(A,I,g){var B,Q=A.lastIndexOf("."),E=C;Q>0&&(E=A.substring(Q+1),A=A.substring(0,Q)),g&&((B={})[E]=g);var D=F(A,I,B);return D&&E in D?D[E]:"{{"+A+"}}"},getData:function(){return B},getText:function(){return Q},getLanguage:function(){return E},setLanguage:function(A,I){G(A,(function(){I&&I()}))},getDirection:function(){var A=E.split("-",1)[0];return["ar","he","fa","ps","ur"].indexOf(A)>=0?"rtl":"ltr"},translate:function(A){for(var g=function(A){return A?A.querySelectorAll("*[data-l10n-id]"):[]}(A=A||I.documentElement),B=g.length,Q=0;Q<B;Q++)R(g[Q]);R(A)},getReadyState:function(){return i},ready:function(g){g&&("complete"==i||"interactive"==i?A.setTimeout((function(){g()})):I.addEventListener&&I.addEventListener("localized",(function A(){I.removeEventListener("localized",A),g()})))}}}(window,document)},function(A,I,g){"use strict";g.r(I),g.d(I,"fixupLangCode",(function(){return w})),g.d(I,"getL10nFallback",(function(){return i})),g.d(I,"NullL10n",(function(){return F}));var B=g(4),Q=g.n(B),C=g(5),E=g.n(C),D={of_pages:"of {{pagesCount}}",page_of_pages:"({{pageNumber}} of {{pagesCount}})",document_properties_kb:"{{size_kb}} KB ({{size_b}} bytes)",document_properties_mb:"{{size_mb}} MB ({{size_b}} bytes)",document_properties_date_string:"{{date}}, {{time}}",document_properties_page_size_unit_inches:"in",document_properties_page_size_unit_millimeters:"mm",document_properties_page_size_orientation_portrait:"portrait",document_properties_page_size_orientation_landscape:"landscape",document_properties_page_size_name_a3:"A3",document_properties_page_size_name_a4:"A4",document_properties_page_size_name_letter:"Letter",document_properties_page_size_name_legal:"Legal",document_properties_page_size_dimension_string:"{{width}} × {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})",document_properties_linearized_yes:"Yes",document_properties_linearized_no:"No",print_progress_percent:"{{progress}}%","toggle_sidebar.title":"Toggle Sidebar","toggle_sidebar_notification2.title":"Toggle Sidebar (document contains outline/attachments/layers)",additional_layers:"Additional Layers",page_landmark:"Page {{page}}",thumb_page_title:"Page {{page}}",thumb_page_canvas:"Thumbnail of Page {{page}}",find_reached_top:"Reached top of document, continued from bottom",find_reached_bottom:"Reached end of document, continued from top","find_match_count[one]":"{{current}} of {{total}} match","find_match_count[other]":"{{current}} of {{total}} matches","find_match_count_limit[one]":"More than {{limit}} match","find_match_count_limit[other]":"More than {{limit}} matches",find_not_found:"Phrase not found",error_version_info:"PDF.js v{{version}} (build: {{build}})",error_message:"Message: {{message}}",error_stack:"Stack: {{stack}}",error_file:"File: {{file}}",error_line:"Line: {{line}}",rendering_error:"An error occurred while rendering the page.",page_scale_width:"Page Width",page_scale_fit:"Page Fit",page_scale_auto:"Automatic Zoom",page_scale_actual:"Actual Size",page_scale_percent:"{{scale}}%",loading:"Loading…",loading_error:"An error occurred while loading the PDF.",invalid_file_error:"Invalid or corrupted PDF file.",missing_file_error:"Missing PDF file.",unexpected_response_error:"Unexpected server response.",printing_not_supported:"Warning: Printing is not fully supported by this browser.",printing_not_ready:"Warning: The PDF is not fully loaded for printing.",web_fonts_disabled:"Web fonts are disabled: unable to use embedded PDF fonts."};function i(A,I){switch(A){case"find_match_count":A="find_match_count[".concat(1===I.total?"one":"other","]");break;case"find_match_count_limit":A="find_match_count_limit[".concat(1===I.limit?"one":"other","]")}return D[A]||""}var o={en:"en-US",es:"es-ES",fy:"fy-NL",ga:"ga-IE",gu:"gu-IN",hi:"hi-IN",hy:"hy-AM",nb:"nb-NO",ne:"ne-NP",nn:"nn-NO",pa:"pa-IN",pt:"pt-PT",sv:"sv-SE",zh:"zh-CN"};function w(A){return o[!!A&&A.toLowerCase()]||A}function G(A,I){return I?A.replace(/\{\{\s*(\w+)\s*\}\}/g,(function(A,g){return g in I?I[g]:"{{"+g+"}}"})):A}var F={getLanguage:function(){return Q()(E.a.mark((function A(){return E.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return","en-us");case 1:case"end":return A.stop()}}),A)})))()},getDirection:function(){return Q()(E.a.mark((function A(){return E.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return","ltr");case 1:case"end":return A.stop()}}),A)})))()},get:function(A){var I=arguments;return Q()(E.a.mark((function g(){var B,Q;return E.a.wrap((function(g){for(;;)switch(g.prev=g.next){case 0:return B=I.length>1&&void 0!==I[1]?I[1]:null,Q=I.length>2&&void 0!==I[2]?I[2]:i(A,B),g.abrupt("return",G(Q,B));case 3:case"end":return g.stop()}}),g)})))()},translate:function(A){return Q()(E.a.mark((function A(){return E.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:case"end":return A.stop()}}),A)})))()}}},function(A,I,g){"use strict";g.r(I),g.d(I,"AutomationEventBus",(function(){return S})),g.d(I,"EventBus",(function(){return k})),g.d(I,"waitOnEventOrTimeout",(function(){return c})),g.d(I,"WaitOnType",(function(){return U}));var B=g(11),Q=g.n(B),C=g(14),E=g.n(C),D=g(16),i=g.n(D),o=g(13),w=g.n(o),G=g(2),F=g.n(G),N=g(1),y=g.n(N);function R(A){var I=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(A){return!1}}();return function(){var g,B=w()(A);if(I){var Q=w()(this).constructor;g=Reflect.construct(B,arguments,Q)}else g=B.apply(this,arguments);return i()(this,g)}}function h(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return M(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return M(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function M(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var U={EVENT:"event",TIMEOUT:"timeout"};function c(A){var I=A.target,g=A.name,B=A.delay,Q=void 0===B?0:B;return new Promise((function(A,B){if("object"!=typeof I||!g||"string"!=typeof g||!(Number.isInteger(Q)&&Q>=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");function C(B){I instanceof k?I._off(g,E):I.removeEventListener(g,E),i&&clearTimeout(i),A(B)}var E=C.bind(null,U.EVENT);I instanceof k?I._on(g,E):I.addEventListener(g,E);var D=C.bind(null,U.TIMEOUT),i=setTimeout(D,Q)}))}var k=function(){function A(){F()(this,A),this._listeners=Object.create(null)}return y()(A,[{key:"on",value:function(A,I){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._on(A,I,{external:!0,once:g&&g.once})}},{key:"off",value:function(A,I){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._off(A,I,{external:!0,once:g&&g.once})}},{key:"dispatch",value:function(A,I){var g=this._listeners[A];if(g&&0!==g.length){var B,Q,C=h(g.slice(0));try{for(C.s();!(Q=C.n()).done;){var E=Q.value,D=E.listener,i=E.external;E.once&&this._off(A,D),i?(B||(B=[]),B.push(D)):D(I)}}catch(A){C.e(A)}finally{C.f()}if(B){var o,w=h(B);try{for(w.s();!(o=w.n()).done;){(0,o.value)(I)}}catch(A){w.e(A)}finally{w.f()}B=null}}}},{key:"_on",value:function(A,I){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._listeners[A]||(this._listeners[A]=[]);var B=this._listeners[A];B.push({listener:I,external:g&&!0===g.external,once:g&&!0===g.once})}},{key:"_off",value:function(A,I){var g=this._listeners[A];if(g)for(var B=0,Q=g.length;B<Q;B++)if(g[B].listener===I)return void g.splice(B,1)}}]),A}(),S=function(A){E()(g,A);var I=R(g);function g(){return F()(this,g),I.apply(this,arguments)}return y()(g,[{key:"dispatch",value:function(A,I){if("undefined"!=typeof PDFJSDev&&!PDFJSDev.test("MOZCENTRAL"))throw new Error("Not implemented: AutomationEventBus.dispatch");Q()(w()(g.prototype),"dispatch",this).call(this,A,I);var B=Object.create(null);if(I)for(var C in I){var E=I[C];if("source"!==C)B[C]=E;else if(E===window||E===document)return}var D=document.createEvent("CustomEvent");D.initCustomEvent(A,!0,!0,B),document.dispatchEvent(D)}}]),g}(k)},function(A,I,g){var B=g(12);function Q(){return"undefined"!=typeof Reflect&&Reflect.get?(A.exports=Q=Reflect.get.bind(),A.exports.__esModule=!0,A.exports.default=A.exports):(A.exports=Q=function(A,I,g){var Q=B(A,I);if(Q){var C=Object.getOwnPropertyDescriptor(Q,I);return C.get?C.get.call(arguments.length<3?A:g):C.value}},A.exports.__esModule=!0,A.exports.default=A.exports),Q.apply(this,arguments)}A.exports=Q,A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(13);A.exports=function(A,I){for(;!Object.prototype.hasOwnProperty.call(A,I)&&null!==(A=B(A)););return A},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){function g(I){return A.exports=g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},A.exports.__esModule=!0,A.exports.default=A.exports,g(I)}A.exports=g,A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(15);A.exports=function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),I&&B(A,I)},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){function g(I,B){return A.exports=g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,I){return A.__proto__=I,A},A.exports.__esModule=!0,A.exports.default=A.exports,g(I,B)}A.exports=g,A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(7).default,Q=g(17);A.exports=function(A,I){if(I&&("object"===B(I)||"function"==typeof I))return I;if(void 0!==I)throw new TypeError("Derived constructors may only return object or undefined");return Q(A)},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){"use strict";g.r(I),g.d(I,"OfdViewer",(function(){return k}));var B=g(4),Q=g.n(B),C=g(2),E=g.n(C),D=g(1),i=g.n(D),o=g(19),w=g.n(o),G=g(5),F=g.n(G),N=g(20),y=g(27),R=g(28),h=g(35),M=g(34);function U(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return c(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return c(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function c(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var k=function(){function A(I,g,B,Q,C){E()(this,A),w()(this,"scrollModePageState",null),this.jumpPageEvt=null,this.coreHelper=new M.Ofd_Core_Helper,this.ofdRender=new R.Ofd_Render(null,new M.Ofd_Core_Helper),Q&&this.ofdRender.setMixBlendMode(Q),this.defaultScale=C||N.DEFAULT_SCALE_VALUE,this.ofdCanvasRender=new h.OfdCanvasRender(null,this.coreHelper),this.eventBus=B,this.container=I,this.viewer=g,this._currentScaleValue=this.defaultScale,this._pages=[],this._currentScale=1,this._spreadMode=N.SpreadMode.NONE,this._scrollMode=N.ScrollMode.VERTICAL,this._pagesRotation=0,this.currentPage=1,this.scroll=Object(N.watchScroll)(this.container,this._scrollUpdate.bind(this)),this.eventBus.dispatch("pagechanging",{source:this,pageNumber:1,pageLabel:null,previous:1}),this.eventBus._on("jumpPage",this.jumpPage.bind(this)),this.scrollModePageState={previousPageNumber:1,scrollDown:!0,pages:[]},this._location=null,this.lastViewerHeight=0,this.lastViewerContainerScrollTop=0,this.lastViewerWidth=0,this.lastViewerContainerScrollLeft=0}var I;return i()(A,[{key:"getPages",value:function(){return this._pages}},{key:"currentScaleValue",get:function(){return this._currentScaleValue},set:function(A){this.core&&this._setScale(A,!1)}},{key:"getOfdCore",value:function(){return this.core}},{key:"emptyNode",value:function(A){if(A)for(;A.firstChild;)A.removeChild(A.firstChild)}},{key:"_scrollUpdate",value:function(){0!==this.pageCount&&this.updateView()}},{key:"_getVisiblePages",value:function(){var A=this._pages;return Object(N.getVisibleElements)({scrollEl:this.container,views:A,sortByVisibility:!0,horizontal:false,rtl:false})}},{key:"renderHighestPriority",value:function(A){this.forceRendering(A)}},{key:"getScrollAhead",value:function(A){if(A.first&&1===A.first.id)return!0;if(A.last&&A.last.id===this.pageCount)return!1;switch(this._scrollMode){case N.ScrollMode.PAGE:return this.scrollModePageState.scrollDown;case N.ScrollMode.HORIZONTAL:return this.scroll.right}return this.scroll.down}},{key:"forceRendering",value:(I=Q()(F.a.mark((function A(I){var g,B,Q,C,E=this;return F.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(this._scrollMode!==N.ScrollMode.PAGE?(B=I||this._getVisiblePages(),Q=this.getScrollAhead(B),this._spreadMode!==N.SpreadMode.NONE&&(this._scrollMode,N.ScrollMode.HORIZONTAL),g=Object(y.getHighestPriority)(B,this._pages,Q)):g=I,!g||g.renderingState!==N.RenderingStates.INITIAL){A.next=6;break}return A.delegateYield(F.a.mark((function A(){var I,B,Q,C,D,i;return F.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return E.emptyNode(g.div.firstChild),A.next=3,E.ofdRender.renderPage(g.div.firstChild,0,g.id-1);case 3:E.highLightEle(),I=E,B=U(document.getElementsByName("seal_img_div_".concat(g.id-1)));try{for(C=function(){var A=Q.value;A.addEventListener("click",(function(){I.eventBus.dispatch("signatureclick",{source:I,pageRef:A.dataset.pageRef,signatureId:A.dataset.signatureId})}))},B.s();!(Q=B.n()).done;)C()}catch(A){B.e(A)}finally{B.f()}for(g.renderingState=N.RenderingStates.FINISHED,E.renderHighestPriority(),D=0;D<g.id-10;D++)(i=E._pages[D]).renderingState===N.RenderingStates.FINISHED&&(E.emptyNode(i.div.firstChild),i.renderingState=N.RenderingStates.INITIAL);return A.abrupt("return",{v:!0});case 11:case"end":return A.stop()}}),A)}))(),"t0",3);case 3:if("object"!=typeof(C=A.t0)){A.next=6;break}return A.abrupt("return",C.v);case 6:return A.abrupt("return",!1);case 7:case"end":return A.stop()}}),A,this)}))),function(A){return I.apply(this,arguments)})},{key:"highLightEle",value:function(){if(this.removeHighLight(),this.jumpPageEvt&&this.jumpPageEvt.eleIdArray){document.getElementById(this.jumpPageEvt.eleIdArray[0].eleId);this.jumpPageEvt.eleIdArray.forEach((function(A){var I=document.getElementById("page_".concat(A.pageIndex));if(I.firstElementChild&&I.firstElementChild.childElementCount>0){var g=document.getElementById(A.eleId),B=document.createElement("div");B.className="highLight",B.setAttribute("style","position:absolute;left:".concat(g.style.left,";top:").concat(g.style.top,";width:").concat(g.style.width,";height:").concat(g.style.height)),I.firstElementChild.appendChild(B)}})),this.jumpPageEvt=null}}},{key:"removeHighLight",value:function(){var A=document.getElementsByClassName("highLight");if(A)for(var I=A.length-1;I>=0;I--){var g=A[I];g&&g.parentNode.removeChild(g)}}},{key:"updateView",value:function(){var A=this._getVisiblePages(),I=A.views;if(0!==I.length){this.renderHighestPriority(A);var g,B=this.currentPage,Q=!1,C=U(I);try{for(C.s();!(g=C.n()).done;){var E=g.value;if(E.percent<100)break;if(E.id===B){Q=!0;break}}}catch(A){C.e(A)}finally{C.f()}Q||(B=I[0].id),this._setCurrentPageNumber(B)}}},{key:"logError",value:function(A,I){}},{key:"showDocumentError",value:function(A,I){this.logError(A,I);var g=document.createElement("div");g.classList.add("error"),g.textContent=I,this.emptyNode(this.viewer),this.viewer.appendChild(g)}},{key:"resetPageScale",value:function(){this.core&&(this.coreHelper.setDpi(96*this._currentScale),this.reformDiv(this._pagesRotation))}},{key:"reformDiv",value:function(A){for(var I=0;I<this._pages.length;++I){var g=this._pages[I].div,B=this.coreHelper.pageRenderWidth(0,I,this.core),Q=this.coreHelper.pageRenderHeight(0,I,this.core),C=g.firstChild,E=new M.Ofd_Core_Helper,D=E.pageRenderWidth(0,I,this.core),i=E.pageRenderHeight(0,I,this.core);switch(A){case 0:g.style.width=B+"px",g.style.height=Q+"px",0,this._pages[I].width=B,this._pages[I].height=Q,C.setAttribute("style","width:".concat(D,"px;height:").concat(i,"px;transform:rotate(",0,"deg) translate(").concat((B-D)/2,"px, ").concat((Q-i)/2,"px) scale(").concat(this._currentScale,")"));break;case 90:g.style.width=Q+"px",g.style.height=B+"px",(B-Q)/2,this._pages[I].width=Q,this._pages[I].height=B,C.setAttribute("style","width:".concat(D,"px;height:").concat(i,"px;transform: translate(").concat((Q-D)/2,"px, ").concat((B-i)/2,"px) rotate(").concat(A,"deg) scale(").concat(this._currentScale,")"));break;case 180:g.style.width=B+"px",g.style.height=Q+"px",0,this._pages[I].width=B,this._pages[I].height=Q,C.setAttribute("style","width:".concat(D,"px;height:").concat(i,"px;transform:rotate(",180,"deg) translate(").concat(-(B-D)/2,"px, ").concat(-(Q-i)/2,"px) scale(").concat(this._currentScale,")"));break;case 270:g.style.width=Q+"px",g.style.height=B+"px",-(B-Q)/2,this._pages[I].width=Q,this._pages[I].height=B,C.setAttribute("style","width:".concat(D,"px;height:").concat(i,"px;transform: translate(").concat((Q-D)/2,"px, ").concat((B-i)/2,"px) rotate(",270,"deg) scale(").concat(this._currentScale,")"))}this._pages[I].scale=this._currentScale;var o={width:this._pages[I].width,height:this._pages[I].height,scale:this._currentScale};this._pages[I].viewport=o}if(0!==this.lastViewerHeight&&0!==this.lastViewerContainerScrollTop){var w=this.viewer.scrollHeight;this.container.scrollTo({top:this.lastViewerContainerScrollTop/this.lastViewerHeight*w})}if(0!==this.lastViewerWidth&&0!==this.lastViewerContainerScrollLeft){var G=this.viewer.scrollWidth;this.container.scrollTo({left:this.lastViewerContainerScrollLeft/this.lastViewerWidth*G})}this.eventBus.dispatch("viewportchanging",{source:this})}},{key:"initDiv",value:function(){var A=this.viewer;this._pages=[],this.emptyNode(A);var I=this;A.addEventListener("click",(function(){I.eventBus.dispatch("pageViewerClick",{source:I})}));for(var g=0;g<this.pageCount;++g){var B=document.createElement("div");B.classList.add("page"),B.id="page_"+g;var Q=this.coreHelper.pageRenderWidth(0,g,this.core),C=this.coreHelper.pageRenderHeight(0,g,this.core);B.style.width=Q+"px",B.style.height=C+"px",B.style.overflow="hidden",B.style.position="relative";var E=document.createElement("div");B.style.width=Q+"px",B.style.height=C+"px",0;var D=new M.Ofd_Core_Helper,i=D.pageRenderWidth(0,g,this.core),o=D.pageRenderHeight(0,g,this.core);E.style.width=i+"px",E.style.height=o+"px",E.style.overflow="hidden",E.style.transform="translate(".concat((Q-i)/2,"px, ").concat((C-o)/2,"px) scale(").concat(this._currentScale,")"),B.appendChild(E),A.appendChild(B),0===g&&E.appendChild(this.initLoadingImg());var w={width:Q,height:C,scale:this._currentScale};this._pages.push({div:B,viewport:w,id:g+1,renderingState:N.RenderingStates.INITIAL,scale:this._currentScale,width:Q,height:C})}}},{key:"currentPageNumber",get:function(){return this.currentPage}},{key:"_setCurrentPageNumber",value:function(A){if(this.currentPage===A)return!0;if(!(0<A&&A<=this.pageCount))return!1;var I=this.currentPage;return this.currentPage=A,this.eventBus.dispatch("pagechanging",{source:this,pageNumber:A,pageLabel:null,previous:I}),!0}},{key:"setRotation",value:function(A){A+=this._pagesRotation,Object(N.isValidRotation)(A),(A%=360)<0&&(A+=360),this._pagesRotation!==A&&this.core&&(this._pagesRotation=A,this.reformDiv(this._pagesRotation,!0),this.updateView())}},{key:"increaseScale",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,I=this._currentScale;do{I=(I*N.DEFAULT_SCALE_DELTA).toFixed(2),I=Math.ceil(10*I)/10,I=Math.min(N.MAX_SCALE,I)}while(--A>0&&I<N.MAX_SCALE);this._setScale(I)}},{key:"decreaseScale",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,I=this._currentScale;do{I=(I/N.DEFAULT_SCALE_DELTA).toFixed(2),I=Math.floor(10*I)/10,I=Math.max(N.MIN_SCALE,I)}while(--A>0&&I>N.MIN_SCALE);this._setScale(I)}},{key:"zoom",value:function(A){this._setScale(A)}},{key:"_setScale",value:function(A){var I=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.lastViewerHeight=this.viewer.scrollHeight,this.lastViewerWidth=this.viewer.scrollWidth,this.lastViewerContainerScrollTop=this.container.scrollTop,this.lastViewerContainerScrollLeft=this.container.scrollLeft;var g=parseFloat(A);if(g>0)this._setScaleUpdatePages(g,A,I,!1);else{var B=this._pages[0];if(!B)return;var Q=N.SCROLLBAR_PADDING,C=N.VERTICAL_PADDING,E=(this.container.clientWidth-Q)/B.width*B.scale/1,D=(this.container.clientHeight-C)/B.height*B.scale;switch(A){case"page-actual":g=1;break;case"page-width":g=E;break;case"page-height":g=D;break;case"page-fit":g=Math.min(E,D);break;case"auto":var i=Object(N.isPortraitOrientation)(B)?E:Math.min(D,E);g=Math.min(N.MAX_AUTO_SCALE,i);break;default:return}this._setScaleUpdatePages(g,A,I,!0)}}},{key:"isSameScale",value:function(A){return A===this._currentScale||Math.abs(A-this._currentScale)<1e-15}},{key:"ensurePageViewVisible",value:function(){if(this._scrollMode!==N.ScrollMode.PAGE)throw new Error("#ensurePageViewVisible: Invalid scrollMode value.");var A=this.currentPageNumber,I=this.scrollModePageState,g=this.viewer;if(g.textContent="",I.pages.length=0,this._spreadMode===N.SpreadMode.NONE){var B=this._pages[A-1];B.renderingState===N.RenderingStates.INITIAL&&this.forceRendering(B),g.appendChild(B.div)}else{var Q=new Set,C=this._spreadMode-1;A%2!==C?(Q.add(A-1),Q.add(A)):(Q.add(A-2),Q.add(A-1));var E,D=null,i=U(Q);try{for(i.s();!(E=i.n()).done;){var o=E.value,w=this._pages[o];w&&(null===D?((D=document.createElement("div")).className="spread",g.appendChild(D)):o%2===C&&(D=D.cloneNode(!1),g.appendChild(D)),D.appendChild(w.div))}}catch(A){i.e(A)}finally{i.f()}}I.scrollDown=A>=I.previousPageNumber,I.previousPageNumber=A}},{key:"_setScaleUpdatePages",value:function(A,I){var g=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this._currentScaleValue=I.toString(),this.isSameScale(A)?g&&this.eventBus.dispatch("scalechanging",{source:this,scale:A,presetValue:I}):(this._currentScale=A,this.resetPageScale(),this.eventBus.dispatch("scalechanging",{source:this,scale:A,presetValue:g?I:void 0}))}},{key:"setSpreadMode",value:function(A){if(this._spreadMode!==A){if(!Object(N.isValidSpreadMode)(A))throw new Error("Invalid spread mode: ".concat(A));this._spreadMode=A,this.eventBus.dispatch("spreadmodechanged",{source:this,mode:A}),this._updateSpreadMode(this.currentPage)}}},{key:"_updateSpreadMode",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,I=this._pages;if(this._scrollMode===N.ScrollMode.PAGE)this.ensurePageViewVisible();else if(this._spreadMode===N.SpreadMode.NONE){this.viewer.textContent="";for(var g=0,B=I.length;g<B;++g)this.viewer.appendChild(I[g].div)}else{this.viewer.textContent="";for(var Q=this._spreadMode-1,C=null,E=0,D=I.length;E<D;++E)null===C?((C=document.createElement("div")).className="spread",this.viewer.appendChild(C)):E%2===Q&&(C=C.cloneNode(!1),this.viewer.appendChild(C)),C.appendChild(I[E].div)}A&&(this._currentScale&&isNaN(this._currentScale)&&this._setScale(this._currentScale,!0),this._setCurrentPageNumber(A,!0),this.updateView())}},{key:"setScrollMode",value:function(A){if(this._scrollMode!==A){if(!Object(N.isValidScrollMode)(A))throw new Error("Invalid scroll mode: ".concat(A));this.pageCount>15e3||(this._previousScrollMode=this._scrollMode,this._scrollMode=A,this.eventBus.dispatch("scrollmodechanged",{source:this,mode:A}),this._updateScrollMode(this.currentPage))}}},{key:"_updateScrollMode",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,I=this._scrollMode;this.viewer.classList.toggle("scrollHorizontal",I===N.ScrollMode.HORIZONTAL),this.viewer.classList.toggle("scrollWrapped",I===N.ScrollMode.WRAPPED),this.core&&(I===N.ScrollMode.PAGE?this.ensurePageViewVisible():this._previousScrollMode===N.ScrollMode.PAGE&&this._updateSpreadMode(),this._currentScale&&isNaN(this._currentScale)&&this._setScale(this._currentScale,!0),this._setCurrentPageNumber(A,!0),this.updateView())}},{key:"firstPage",value:function(){this._scrollMode===N.ScrollMode.PAGE?(this._setCurrentPageNumber(1),this.ensurePageViewVisible()):this.viewer.children.item(0).scrollIntoView(!0);return!0}},{key:"lastPage",value:function(){this._scrollMode===N.ScrollMode.PAGE?(this._setCurrentPageNumber(this.pageCount),this.ensurePageViewVisible()):this.viewer.children.item(this.pageCount-1).scrollIntoView(!0);return!0}},{key:"nextPage",value:function(){var A=this.currentPage;if(A>=this.pageCount)return!1;this._scrollMode===N.ScrollMode.PAGE?(this._setCurrentPageNumber(A+1),this.ensurePageViewVisible()):this.viewer.children.item(A).scrollIntoView(!0);return!0}},{key:"previousPage",value:function(){var A=this.currentPage;if(A<=1)return!1;this._scrollMode===N.ScrollMode.PAGE?(this._setCurrentPageNumber(A-1),this.ensurePageViewVisible()):this.viewer.children.item(A-2).scrollIntoView(!0);return!0}},{key:"jumpPage",value:function(A){(this.jumpPageEvt=A,this._scrollMode===N.ScrollMode.PAGE)?(A.pageIndex&&this._setCurrentPageNumber(A.pageIndex),this.ensurePageViewVisible()):(this.viewer.children.item(A.pageIndex-1).scrollIntoView(!0),this.highLightEle())}},{key:"freeDocument",value:function(){this.currentPage=1,this.pageCount=0,this._pages=[],this.emptyNode(this.viewer)}},{key:"initLoadingImg",value:function(){var A=new Image;return A.style.position="absolute",A.style.left=0,A.style.right=0,A.style.margin="auto",A.style.top=0,A.style.bottom=0,A.src="data:image/gif;base64,R0lGODlhNgA3APMAAP///zAyOJKTlkdJTzw+RN/g4XV2euPj5M/Q0WtscaChpDAyODAyODAyODAyODAyOCH5BAkKAAAAIf4aQ3JlYXRlZCB3aXRoIGFqYXhsb2FkLmluZm8AIf8LTkVUU0NBUEUyLjADAQAAACwAAAAANgA3AAAEzBDISau9OOvNu/9gKI5kaZ4lkhBEgqCnws6EApMITb93uOqsRC8EpA1Bxdnx8wMKl51ckXcsGFiGAkamsy0LA9pAe1EFqRbBYCAYXXUGk4DWJhZN4dlAlMSLRW80cSVzM3UgB3ksAwcnamwkB28GjVCWl5iZmpucnZ4cj4eWoRqFLKJHpgSoFIoEe5ausBeyl7UYqqw9uaVrukOkn8LDxMXGx8ibwY6+JLxydCO3JdMg1dJ/Is+E0SPLcs3Jnt/F28XXw+jC5uXh4u89EQAh+QQJCgAAACwAAAAANgA3AAAEzhDISau9OOvNu/9gKI5kaZ5oqhYGQRiFWhaD6w6xLLa2a+iiXg8YEtqIIF7vh/QcarbB4YJIuBKIpuTAM0wtCqNiJBgMBCaE0ZUFCXpoknWdCEFvpfURdCcM8noEIW82cSNzRnWDZoYjamttWhphQmOSHFVXkZecnZ6foKFujJdlZxqELo1AqQSrFH1/TbEZtLM9shetrzK7qKSSpryixMXGx8jJyifCKc1kcMzRIrYl1Xy4J9cfvibdIs/MwMue4cffxtvE6qLoxubk8ScRACH5BAkKAAAALAAAAAA2ADcAAATOEMhJq7046827/2AojmRpnmiqrqwwDAJbCkRNxLI42MSQ6zzfD0Sz4YYfFwyZKxhqhgJJeSQVdraBNFSsVUVPHsEAzJrEtnJNSELXRN2bKcwjw19f0QG7PjA7B2EGfn+FhoeIiYoSCAk1CQiLFQpoChlUQwhuBJEWcXkpjm4JF3w9P5tvFqZsLKkEF58/omiksXiZm52SlGKWkhONj7vAxcbHyMkTmCjMcDygRNAjrCfVaqcm11zTJrIjzt64yojhxd/G28XqwOjG5uTxJhEAIfkECQoAAAAsAAAAADYANwAABM0QyEmrvTjrzbv/YCiOZGmeaKqurDAMAlsKRE3EsjjYxJDrPN8PRLPhhh8XDMk0KY/OF5TIm4qKNWtnZxOWuDUvCNw7kcXJ6gl7Iz1T76Z8Tq/b7/i8qmCoGQoacT8FZ4AXbFopfTwEBhhnQ4w2j0GRkgQYiEOLPI6ZUkgHZwd6EweLBqSlq6ytricICTUJCKwKkgojgiMIlwS1VEYlspcJIZAkvjXHlcnKIZokxJLG0KAlvZfAebeMuUi7FbGz2z/Rq8jozavn7Nev8CsRACH5BAkKAAAALAAAAAA2ADcAAATLEMhJq7046827/2AojmRpnmiqrqwwDAJbCkRNxLI42MSQ6zzfD0Sz4YYfFwzJNCmPzheUyJuKijVrZ2cTlrg1LwjcO5HFyeoJeyM9U++mfE6v2+/4PD6O5F/YWiqAGWdIhRiHP4kWg0ONGH4/kXqUlZaXmJlMBQY1BgVuUicFZ6AhjyOdPAQGQF0mqzauYbCxBFdqJao8rVeiGQgJNQkIFwdnB0MKsQrGqgbJPwi2BMV5wrYJetQ129x62LHaedO21nnLq82VwcPnIhEAIfkECQoAAAAsAAAAADYANwAABMwQyEmrvTjrzbv/YCiOZGmeaKqurDAMAlsKRE3EsjjYxJDrPN8PRLPhhh8XDMk0KY/OF5TIm4qKNWtnZxOWuDUvCNw7kcXJ6gl7Iz1T76Z8Tq/b7/g8Po7kX9haKoAZZ0iFGIc/iRaDQ40Yfj+RepSVlpeYAAgJNQkIlgo8NQqUCKI2nzNSIpynBAkzaiCuNl9BIbQ1tl0hraewbrIfpq6pbqsioaKkFwUGNQYFSJudxhUFZ9KUz6IGlbTfrpXcPN6UB2cHlgfcBuqZKBEAIfkECQoAAAAsAAAAADYANwAABMwQyEmrvTjrzbv/YCiOZGmeaKqurDAMAlsKRE3EsjjYxJDrPN8PRLPhhh8XDMk0KY/OF5TIm4qKNWtnZxOWuDUvCNw7kcXJ6gl7Iz1T76Z8Tq/b7yJEopZA4CsKPDUKfxIIgjZ+P3EWe4gECYtqFo82P2cXlTWXQReOiJE5bFqHj4qiUhmBgoSFho59rrKztLVMBQY1BgWzBWe8UUsiuYIGTpMglSaYIcpfnSHEPMYzyB8HZwdrqSMHxAbath2MsqO0zLLorua05OLvJxEAIfkECQoAAAAsAAAAADYANwAABMwQyEmrvTjrzbv/YCiOZGmeaKqurDAMAlsKRE3EsjjYxJDrPN8PRLPhfohELYHQuGBDgIJXU0Q5CKqtOXsdP0otITHjfTtiW2lnE37StXUwFNaSScXaGZvm4r0jU1RWV1hhTIWJiouMjVcFBjUGBY4WBWw1A5RDT3sTkVQGnGYYaUOYPaVip3MXoDyiP3k3GAeoAwdRnRoHoAa5lcHCw8TFxscduyjKIrOeRKRAbSe3I9Um1yHOJ9sjzCbfyInhwt3E2cPo5dHF5OLvJREAOw==",A.draggable=!1,A}},{key:"setWaterText",value:function(A){this.ofdRender.coreHelper.setWaterText(A)}},{key:"setWaterSetting",value:function(A){this.ofdRender.coreHelper.setWaterSetting(A)}},{key:"setOfdCore",value:function(A){this.core=A,this.ofdRender.setOfdCore(this.core),this.ofdCanvasRender.setOfdCore(this.core),this._spreadMode=N.SpreadMode.NONE,this._scrollMode=N.ScrollMode.VERTICAL,this._pagesRotation=0,this.pageCount=this.core.getOFDPageCount(0),this.eventBus.dispatch("pagechanging",{source:this,pageNumber:1,pageLabel:null,previous:1}),this.viewer.scrollTo(0,0);var I=N.SCROLLBAR_PADDING,g=(N.VERTICAL_PADDING,this.container.clientWidth,new M.Ofd_Core_Helper(96)),B=(this.container.clientWidth-I)/g.pageRenderWidth(0,0,this.core)*1/1,Q=Math.min(N.MAX_AUTO_SCALE,B);this.defaultScale!==N.DEFAULT_SCALE_VALUE&&(Q=this.defaultScale),this._currentScale=Q,this.coreHelper.setDpi(96*Q),this.initDiv(0),this.updateView(),this.eventBus.dispatch("scalechanging",{source:this,scale:Q,presetValue:this.defaultScale}),this.eventBus.dispatch("viewportchanging",{source:this}),this.scrollModePageState={previousPageNumber:1,scrollDown:!0,pages:[]}}}]),A}()},function(A,I){A.exports=function(A,I,g){return I in A?Object.defineProperty(A,I,{value:g,enumerable:!0,configurable:!0,writable:!0}):A[I]=g,A},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){"use strict";g.r(I),g.d(I,"animationStarted",(function(){return z})),g.d(I,"apiPageLayoutToViewerModes",(function(){return v})),g.d(I,"apiPageModeToSidebarView",(function(){return _})),g.d(I,"approximateFraction",(function(){return W})),g.d(I,"AutoPrintRegExp",(function(){return L})),g.d(I,"backtrackBeforeAllVisibleElements",(function(){return f})),g.d(I,"binarySearchFirstItem",(function(){return l})),g.d(I,"DEFAULT_SCALE",(function(){return F})),g.d(I,"DEFAULT_SCALE_DELTA",(function(){return N})),g.d(I,"DEFAULT_SCALE_VALUE",(function(){return G})),g.d(I,"getActiveOrFocusedElement",(function(){return P})),g.d(I,"getPageSizeInches",(function(){return x})),g.d(I,"getVisibleElements",(function(){return b})),g.d(I,"isPortraitOrientation",(function(){return O})),g.d(I,"isValidRotation",(function(){return T})),g.d(I,"isValidScrollMode",(function(){return X})),g.d(I,"isValidSpreadMode",(function(){return j})),g.d(I,"MAX_AUTO_SCALE",(function(){return M})),g.d(I,"MAX_SCALE",(function(){return R})),g.d(I,"MIN_SCALE",(function(){return y})),g.d(I,"noContextMenuHandler",(function(){return V})),g.d(I,"normalizeWheelEventDelta",(function(){return m})),g.d(I,"normalizeWheelEventDirection",(function(){return p})),g.d(I,"OutputScale",(function(){return J})),g.d(I,"parseQueryString",(function(){return Z})),g.d(I,"PresentationModeState",(function(){return S})),g.d(I,"ProgressBar",(function(){return u})),g.d(I,"removeNullCharacters",(function(){return q})),g.d(I,"RendererType",(function(){return Y})),g.d(I,"RenderingStates",(function(){return k})),g.d(I,"roundToDivide",(function(){return r})),g.d(I,"SCROLLBAR_PADDING",(function(){return U})),g.d(I,"scrollIntoView",(function(){return t})),g.d(I,"ScrollMode",(function(){return K})),g.d(I,"SidebarView",(function(){return s})),g.d(I,"SpreadMode",(function(){return H})),g.d(I,"TextLayerMode",(function(){return a})),g.d(I,"UNKNOWN_SCALE",(function(){return h})),g.d(I,"VERTICAL_PADDING",(function(){return c})),g.d(I,"watchScroll",(function(){return d}));var B=g(21),Q=g.n(B),C=g(2),E=g.n(C),D=g(1),i=g.n(D);function o(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return w(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return w(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function w(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var G="auto",F=1,N=1.1,y=.1,R=10,h=0,M=1.25,U=40,c=5,k={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3},S={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3},s={UNKNOWN:-1,NONE:0,THUMBS:1,OUTLINE:2,ATTACHMENTS:3,LAYERS:4,SIGNATURES:5},Y={CANVAS:"canvas",SVG:"svg"},a={DISABLE:0,ENABLE:1,ENABLE_ENHANCE:2},K={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2,PAGE:3},H={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2},L=/\bprint\s*\(/,J=function(){function A(){E()(this,A);var I=window.devicePixelRatio||1;this.sx=I,this.sy=I}return i()(A,[{key:"scaled",get:function(){return 1!==this.sx||1!==this.sy}}]),A}();function t(A,I){var g=arguments.length>2&&void 0!==arguments[2]&&arguments[2],B=A.offsetParent;if(B){for(var Q=A.offsetTop+A.clientTop,C=A.offsetLeft+A.clientLeft;B.clientHeight===B.scrollHeight&&B.clientWidth===B.scrollWidth||g&&(B.classList.contains("markedContent")||"hidden"===getComputedStyle(B).overflow);)if(Q+=B.offsetTop,C+=B.offsetLeft,!(B=B.offsetParent))return;I&&(void 0!==I.top&&(Q+=I.top),void 0!==I.left&&(C+=I.left,B.scrollLeft=C)),B.scrollTop=Q}}function d(A,I){var g=function(g){Q||(Q=window.requestAnimationFrame((function(){Q=null;var g=A.scrollLeft,C=B.lastX;g!==C&&(B.right=g>C),B.lastX=g;var E=A.scrollTop,D=B.lastY;E!==D&&(B.down=E>D),B.lastY=E,I(B)})))},B={right:!0,down:!0,lastX:A.scrollLeft,lastY:A.scrollTop,_eventHandler:g},Q=null;return A.addEventListener("scroll",g,!0),B}function Z(A){var I,g=new Map,B=o(new URLSearchParams(A));try{for(B.s();!(I=B.n()).done;){var C=Q()(I.value,2),E=C[0],D=C[1];g.set(E.toLowerCase(),D)}}catch(A){B.e(A)}finally{B.f()}return g}var n=/\x00/g,e=/[\x01-\x1F]/g;function q(A){var I=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"string"!=typeof A?A:(I&&(A=A.replace(e," ")),A.replace(n,""))}function l(A,I){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,B=g,Q=A.length-1;if(Q<0||!I(A[Q]))return A.length;if(I(A[B]))return B;for(;B<Q;){var C=B+Q>>1,E=A[C];I(E)?Q=C:B=C+1}return B}function W(A){if(Math.floor(A)===A)return[A,1];var I=1/A;if(I>8)return[1,8];if(Math.floor(I)===I)return[1,I];for(var g=A>1?I:A,B=0,Q=1,C=1,E=1;;){var D=B+C,i=Q+E;if(i>8)break;g<=D/i?(C=D,E=i):(B=D,Q=i)}return g-B/Q<C/E-g?g===A?[B,Q]:[Q,B]:g===A?[C,E]:[E,C]}function r(A,I){var g=A%I;return 0===g?A:Math.round(A-g+I)}function x(A){var I=A.view,g=A.userUnit,B=A.rotate,C=Q()(I,4),E=C[0],D=C[1],i=B%180!=0,o=(C[2]-E)/72*g,w=(C[3]-D)/72*g;return{width:i?w:o,height:i?o:w}}function f(A,I,g){if(A<2)return A;var B=I[A].div,Q=B.offsetTop+B.clientTop;Q>=g&&(Q=(B=I[A-1].div).offsetTop+B.clientTop);for(var C=A-2;C>=0&&!((B=I[C].div).offsetTop+B.clientTop+B.clientHeight<=Q);--C)A=C;return A}function b(A){var I=A.scrollEl,g=A.views,B=A.sortByVisibility,Q=void 0!==B&&B,C=A.horizontal,E=void 0!==C&&C,D=A.rtl,i=void 0!==D&&D,o=I.scrollTop,w=o+I.clientHeight,G=I.scrollLeft,F=G+I.clientWidth;var N=[],y=new Set,R=g.length,h=l(g,E?function(A){var I=A.div,g=I.offsetLeft+I.clientLeft,B=g+I.clientWidth;return i?g<F:B>G}:function(A){var I=A.div;return I.offsetTop+I.clientTop+I.clientHeight>o});h>0&&h<R&&!E&&(h=f(h,g,o));for(var M=E?F:-1,U=h;U<R;U++){var c=g[U],k=c.div,S=k.offsetLeft+k.clientLeft,s=k.offsetTop+k.clientTop,Y=k.clientWidth,a=k.clientHeight,K=S+Y,H=s+a;if(-1===M)H>=w&&(M=H);else if((E?S:s)>M)break;if(!(H<=o||s>=w||K<=G||S>=F)){var L=Math.max(0,o-s)+Math.max(0,H-w),J=(Y-(Math.max(0,G-S)+Math.max(0,K-F)))/Y,t=(a-L)/a*J*100|0;N.push({id:c.id,x:S,y:s,view:c,percent:t,widthPercent:100*J|0}),y.add(c.id)}}var d=N[0],Z=N[N.length-1];return Q&&N.sort((function(A,I){var g=A.percent-I.percent;return Math.abs(g)>.001?-g:A.id-I.id})),{first:d,last:Z,views:N,ids:y}}function V(A){A.preventDefault()}function p(A){var I=Math.hypot(A.deltaX,A.deltaY),g=Math.atan2(A.deltaY,A.deltaX);return-.25*Math.PI<g&&g<.75*Math.PI&&(I=-I),I}function m(A){var I=p(A);return 0===A.deltaMode?I/=900:1===A.deltaMode&&(I/=30),I}function T(A){return Number.isInteger(A)&&A%90==0}function X(A){return Number.isInteger(A)&&Object.values(K).includes(A)&&A!==K.UNKNOWN}function j(A){return Number.isInteger(A)&&Object.values(H).includes(A)&&A!==H.UNKNOWN}function O(A){return A.width<=A.height}var z=new Promise((function(A){"undefined"!=typeof PDFJSDev&&PDFJSDev.test("LIB")&&"undefined"==typeof window?setTimeout(A,20):window.requestAnimationFrame(A)}));var u=function(){function A(I){var g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},B=g.height,Q=g.width,C=g.units;E()(this,A),this.visible=!0,this.div=document.querySelector(I+" .progress"),this.bar=this.div.parentNode,this.height=B||100,this.width=Q||100,this.units=C||"%",this.div.style.height=this.height+this.units,this.percent=0}return i()(A,[{key:"_updateBar",value:function(){if(this._indeterminate)return this.div.classList.add("indeterminate"),void(this.div.style.width=this.width+this.units);this.div.classList.remove("indeterminate");var A=this.width*this._percent/100;this.div.style.width=A+this.units}},{key:"percent",get:function(){return this._percent},set:function(A){var I,g,B;this._indeterminate=isNaN(A),this._percent=(I=A,g=0,B=100,Math.min(Math.max(I,g),B)),this._updateBar()}},{key:"setWidth",value:function(A){if(A){var I=A.parentNode.offsetWidth-A.offsetWidth;if(I>0)document.documentElement.style.setProperty("--loadingBar-end-offset","".concat(I,"px"))}}},{key:"hide",value:function(){this.visible&&(this.visible=!1,this.bar.classList.add("hidden"))}},{key:"show",value:function(){this.visible||(this.visible=!0,this.bar.classList.remove("hidden"))}}]),A}();function P(){for(var A=document,I=A.activeElement||A.querySelector(":focus");I&&I.shadowRoot;)I=(A=I.shadowRoot).activeElement||A.querySelector(":focus");return I}function v(A){var I=K.VERTICAL,g=H.NONE;switch(A){case"SinglePage":I=K.PAGE;break;case"OneColumn":break;case"TwoPageLeft":I=K.PAGE;case"TwoColumnLeft":g=H.ODD;break;case"TwoPageRight":I=K.PAGE;case"TwoColumnRight":g=H.EVEN}return{scrollMode:I,spreadMode:g}}function _(A){switch(A){case"UseNone":return s.NONE;case"UseThumbs":return s.THUMBS;case"UseOutlines":return s.OUTLINE;case"UseAttachments":return s.ATTACHMENTS;case"UseOC":return s.LAYERS}return s.NONE}},function(A,I,g){var B=g(22),Q=g(23),C=g(24),E=g(26);A.exports=function(A,I){return B(A)||Q(A,I)||C(A,I)||E()},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(A){if(Array.isArray(A))return A},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(A,I){var g=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null!=g){var B,Q,C=[],E=!0,D=!1;try{for(g=g.call(A);!(E=(B=g.next()).done)&&(C.push(B.value),!I||C.length!==I);E=!0);}catch(A){D=!0,Q=A}finally{try{E||null==g.return||g.return()}finally{if(D)throw Q}}return C}},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(25);A.exports=function(A,I){if(A){if("string"==typeof A)return B(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);return"Object"===g&&A.constructor&&(g=A.constructor.name),"Map"===g||"Set"===g?Array.from(A):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?B(A,I):void 0}},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){"use strict";g.r(I),g.d(I,"getHighestPriority",(function(){return Q}));var B=g(20);function Q(A,I,g){var B=arguments.length>3&&void 0!==arguments[3]&&arguments[3],Q=A.views,E=Q.length;if(0===E)return null;for(var D=0;D<E;D++){var i=Q[D].view;if(!C(i))return i}var o=A.first.id,w=A.last.id;if(w-o+1>E)for(var G=A.ids,F=1,N=w-o;F<N;F++){var y=g?o+F:w-F;if(!G.has(y)){var R=I[y-1];if(!C(R))return R}}var h=g?w:o-2,M=I[h];return M&&!C(M)||B&&(M=I[h+=g?1:-1])&&!C(M)?M:null}function C(A){return A.renderingState===B.RenderingStates.FINISHED}},function(A,I,g){"use strict";g.r(I),g.d(I,"Ofd_Render",(function(){return h}));var B=g(4),Q=g.n(B),C=g(2),E=g.n(C),D=g(1),i=g.n(D),o=g(5),w=g.n(o),G=g(29),F=g(30),N=g(33);g(34);function y(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return R(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return R(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function R(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var h=function(){function A(I,g){E()(this,A),this.core=I,this.coreHelper=g,this.mixBlendMode="darken"}var I;return i()(A,[{key:"setDpi",value:function(A){this.coreHelper.setDpi(A)}},{key:"setOfdCore",value:function(A){this.core=A}},{key:"setMixBlendMode",value:function(A){this.mixBlendMode=A}},{key:"renderPage",value:function(A,I,g,B,Q,C){var E=B?B.readOfdDocument(I):this.core.readOfdDocument(I),D=B?B.readOfdPage(I,g):this.core.readOfdPage(I,g);this.coreHelper.waterText&&!this.coreHelper.waterSetting&&A.appendChild(this.watermark({watermark_txt:this.coreHelper.waterText})),this.coreHelper.waterSetting&&A.appendChild(this.watermark(this.coreHelper.waterSetting));var i=D.Page.Template,o=E.Annotations?E.Annotations:[],w=B?B.readOfdTemplatePage(I):this.core.readOfdTemplatePage(I),F=E.Signatures?E.Signatures.Signature:[],R=E.CommonData.Res.Fonts,h=E.CommonData.Res.DrawParams,M=(E.CommonData.Res.ColorSpaces,E.CommonData.Res.CompositeGraphicUnits),U=E.CommonData.Res.MultiMedias;if(i){var c,k=y(i);try{for(k.s();!(c=k.n()).done;){var S,s=c.value,Y=y(w);try{for(Y.s();!(S=Y.n()).done;){var a=S.value;if(a.ID==s.TemplateID){if((a=B?B.readPageFromTemplate(a):this.core.readPageFromTemplate(a)).Page.Content){var K,H=y(a.Page.Content.Layer);try{for(H.s();!(K=H.n()).done;){var L=K.value;this.renderLayer(C,Q,g,A,R,h,U,M,L,!1)}}catch(A){H.e(A)}finally{H.f()}}break}}}catch(A){Y.e(A)}finally{Y.f()}}}catch(A){k.e(A)}finally{k.f()}}if(D.Page.Content){var J,t=y(D.Page.Content.Layer);try{for(t.s();!(J=t.n()).done;){var d=J.value;this.renderLayer(C,Q,g,A,R,h,U,M,d,!1)}}catch(A){t.e(A)}finally{t.f()}}var Z,n=y(o);try{for(n.s();!(Z=n.n()).done;){var e=Z.value;if(D.ID==e.PageID){var q,l=y(e.PageAnnot.Annot);try{for(l.s();!(q=l.n()).done;){var W=q.value;this.renderAnnotation(C,Q,A,W,R,h,U,M,g)}}catch(A){l.e(A)}finally{l.f()}}}}catch(A){n.e(A)}finally{n.f()}var r,x=y(F);try{for(x.s();!(r=x.n()).done;){var f,b=r.value,V=y(b.Signature.SignedInfo.StampAnnot);try{for(V.s();!(f=V.n()).done;){var p=f.value,m=p.PageRef;if(D.ID==m){var T=p.Boundary;if(b.Signature.PicType&&b.Signature.PicType.length>0)if("ofd"===b.Signature.PicType)for(var X=new N.Ofd_Core(b.Signature.ofd),j=0;j<X.getOFDPageCount(0);j++)this.renderSealPage(A,j,X,!0,T,m,p.ID,g,b.Signature.ZipName);else if("svg"===b.Signature.PicType){var O=Object(G.converterBox)(T,this.coreHelper.dpi),z=document.createElement("div");z.innerHTML=b.Signature.svg;var u=void 0,P=z.children[0].width.baseVal.value,v=z.children[0].height.baseVal.value;P!==O.w&&(u="transform-origin: 0px 0px; transform: scale(".concat(O.h/v<O.w/P?O.h/v:O.w/P,")")),z.setAttribute("style","".concat(u,"; position:absolute; left: ",0,"px; top: ",0,"px; width: ").concat(O.w,"px; height: ").concat(O.h,"px;"));var _=document.createElement("div");_.setAttribute("style","mix-blend-mode:".concat(this.mixBlendMode,";cursor: pointer;position:absolute; left: ").concat(O.x,"px; top: ").concat(O.y,"px; width: ").concat(O.w,"px; height: ").concat(O.h,"px;overflow:hidden")),_.setAttribute("name","seal_img_div_".concat(g)),_.setAttribute("data-signature-id",p.ID),_.setAttribute("data-page-ref",m),_.appendChild(z),A.appendChild(_)}else{var $=Object(G.converterBox)(T,this.coreHelper.dpi),AA="data:image/".concat(b.Signature.PicType,";base64,").concat(b.Signature.PicValue),IA=this.renderImageOnDiv(g,A.style.width,A.style.height,AA,$.w,$.h,$,p.Clip,!0,m,p.ID);IA.svg.setAttribute("style","".concat(IA.style,"left:").concat(IA.left,"px;top:").concat(IA.top,"px;mix-blend-mode:").concat(this.mixBlendMode)),b.Signature.PicType||IA.svg.removeChild(IA.svg.children[0]),A.appendChild(IA.svg)}else{var gA=Object(G.converterBox)(T,this.coreHelper.dpi),BA=document.createElement("div");BA.setAttribute("style","mix-blend-mode:".concat(this.mixBlendMode,";cursor: pointer;position:absolute; left: ").concat(gA.x,"px; top: ").concat(gA.y,"px; width: ").concat(gA.w,"px; height: ").concat(gA.h,"px;overflow:hidden")),BA.setAttribute("name","seal_img_div_".concat(g)),BA.setAttribute("data-signature-id",p.ID),BA.setAttribute("data-page-ref",m),A.appendChild(BA)}}}}catch(A){V.e(A)}finally{V.f()}}}catch(A){x.e(A)}finally{x.f()}}},{key:"throwWhite",value:(I=Q()(w.a.mark((function A(I){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return",new Promise((function(A,g){var B=new Image;B.onload=function(){var I=B.width,g=B.height,Q=document.createElement("canvas");Q.style.width="".concat(I,"px"),Q.style.height="".concat(g,"px"),Q.width=I,Q.height=g;var C=Q.getContext("2d");C.drawImage(B,0,0,I,g);for(var E=C.getImageData(0,0,I,g),D=E.data,i=0;i<D.length;i+=4)[D[i],D[i+1],D[i+2]].every((function(A){return A<256&&A>245}))&&(D[i+3]=0);C.putImageData(E,0,0),A(Q.toDataURL())},B.src=I})));case 1:case"end":return A.stop()}}),A)}))),function(A){return I.apply(this,arguments)})},{key:"renderAnnotation",value:function(A,I,g,B,Q,C,E,D,i){var o=document.createElement("div");o.setAttribute("style","overflow: hidden;;position:relative;");var w=B.Appearance.Boundary;if(w){var F=Object(G.converterBox)(w,this.coreHelper.dpi);o.setAttribute("style","mix-blend-mode:".concat(this.mixBlendMode,";overflow: visible;position:absolute; left: ").concat(F.x,"px; top: ").concat(F.y,"px; width: ").concat(F.w,"px; height: ").concat(F.h,"px"))}else o.setAttribute("style","mix-blend-mode:".concat(this.mixBlendMode,";overflow: visible;position:absolute; left: 0px; top: 0px; width: 1px; height: 1px"));var N=B.Appearance;this.renderLayer(A,I,i,o,Q,C,E,D,N,!1),g.appendChild(o)}},{key:"renderSealPage",value:function(A,I,g,B,Q,C,E,D,i){var o,w;o=Q;var F=g.pageWidth(0,I),N=g.pageHeight(0,I);F!==o.w&&(w="transform-origin: 0px 0px; transform: scale(".concat(o.h/N<o.w/F?o.h/N:o.w/F,")"));var y=Object(G.converterBox)(o,this.coreHelper.dpi),R=document.createElement("div");R.setAttribute("name","seal_img_div_".concat(D)),R.setAttribute("style","".concat(w,";cursor: pointer; position:absolute; left: ",0,"px; top: ",0,"px; width: ").concat(y.w,"px; height: ").concat(y.h,"px;")),R.setAttribute("data-signature-id",E),R.setAttribute("data-page-ref",C),this.renderPage(R,0,I,g,E,i);var h=document.createElement("div");h.setAttribute("style","mix-blend-mode:".concat(this.mixBlendMode,";position:absolute; left: ").concat(y.x,"px; top: ").concat(y.y,"px; width: ").concat(y.w,"px; height: ").concat(y.h,"px;overflow:hidden")),h.appendChild(R),A.appendChild(h)}},{key:"renderLayer",value:function(A,I,g,B,Q,C,E,D,i,o,w,F,N){var R=null,h=null,M=Object(G.converterDpi)(.353,this.coreHelper.dpi),U=i.DrawParam;if(U&&Object(G.getDrawParam)(C,U)){var c=Object(G.getDrawParam)(C,U);if(Object(G.getDrawParam)(C,c.Relative)){var k=Object(G.getDrawParam)(C,c.Relative);k&&(k.StrokeColor&&(c.StrokeColor=k.StrokeColor),k.FillColor&&(c.FillColor=k.FillColor),k.LineWidth&&(c.LineWidth=k.LineWidth))}c.FillColor&&(R=Object(G.parseColor)(c.FillColor.Value)),c.StrokeColor&&(h=Object(G.parseColor)(c.StrokeColor.Value)),c.LineWidth&&(M=Object(G.converterDpi)(c.LineWidth,this.coreHelper.dpi))}var S=i.PageBlock;if(S){var s,Y=y(S);try{for(Y.s();!(s=Y.n()).done;){var a=s.value;if("ImageObject"==a.Type){var K=this.renderImageObject(A,I,g,B.style.width,B.style.height,E,a,o,F,N,i.ctm);K&&(K.svg.setAttribute("style","".concat(K.style,"left:").concat(K.left,"px;top:").concat(K.top,"px;")),B.appendChild(K.svg))}else if("PathObject"==a.Type){var H=this.renderPathObject(A,I,g,C,a,R,h,M,o,w,F,N,E,Q);H.style&&(H.svg.setAttribute("style","".concat(H.style,"left:").concat(H.left,"px;top:").concat(H.top,"px;")),B.appendChild(H.svg))}else if("TextObject"==a.Type){var L=this.renderTextObject(B,Q,a,R,h,C,w,F,N);L.childElementCount>0&&B.appendChild(L)}else if("CompositeObject"==a.Type){var J,t=y(D);try{for(t.s();!(J=t.n()).done;){var d=J.value;if(d.ID===a.ResourceID){var Z=a.Alpha,n=a.Boundary,e=a.CTM;this.renderLayer(A,I,g,B,Q,C,E,D,d,!1,Z,n,e);break}}}catch(A){t.e(A)}finally{t.f()}}}}catch(A){Y.e(A)}finally{Y.f()}}}},{key:"renderImageObject",value:function(A,I,g,B,Q,C,E,D,i,o,w){var N=E.Boundary;N=Object(G.converterBox)(N,this.coreHelper.dpi);var y=E.ResourceID;if(!y)return null;var R=Object(G.getMultiMedia)(C,y);if(!R.MediaFile)return null;var h,M=E.ImageMask;if(M>0&&(h=Object(G.getMultiMedia)(C,M)).MediaFile&&!(h.width>0||h.height>0)&&h.MediaFile){var U=Object(F.JSGetImageInfoByPath)(this.core.ofdParserPtr,h.MediaFile,h.MediaFileResPln,this.core.getDocPln(0),A);U.ext,h.width=U.width,h.height=U.height,h.FileBase64=U.fileBase64}if(!(R.width>0||R.height>0)&&R.MediaFile){var c=Object(F.JSGetImageInfoByPath)(this.core.ofdParserPtr,R.MediaFile,R.MediaFileResPln,this.core.getDocPln(0),A);if("other"===c.ext)return null;R.width=c.width,R.height=c.height,R.FileBase64=c.fileBase64}var k=E.CTM,S=E.Clips,s=E.BlendMode,Y=E.Alpha;return this.renderImageOnDiv(g,B,Q,R.FileBase64,R.width,R.height,N,!1,D,null,null,k,i,o,S,E.ID,s,Y,M>0&&h.FileBase64?h.FileBase64:null,w)}},{key:"renderImageOnDiv",value:function(A,I,g,B,Q,C,E,D,i,o,w,F,N,R,h,M,U,c,k,S){var s=parseFloat(I.replace("px","")),Y=parseFloat(g.replace("px","")),a=E.w>s?s:E.w,K=E.h>Y?Y:E.h,H=document.createElementNS("http://www.w3.org/2000/svg","svg"),L=document.createElementNS("http://www.w3.org/2000/svg","image"),J="";i&&(J="cursor: pointer;",H.setAttribute("viewbox","0 0 ".concat(a," ").concat(K)),H.setAttribute("name","seal_img_div_".concat(A)),H.setAttribute("data-signature-id",w),H.setAttribute("data-page-ref",o),L.setAttribute("preserveAspectRatio","none slice"));var t=Q,d=C;L.setAttribute("xlink:href",B),L.href.baseVal=B,L.setAttribute("width","".concat(t,"px")),L.setAttribute("height","".concat(d,"px")),c&&L.setAttribute("opacity","".concat(c/255));var Z="";if(F){var n=1,e=1;if(S){var q=S.split(" ");n=q[0],e=q[3]}Z="matrix(".concat(F.a/t/Object(G.ctmImageScale)(this.coreHelper.dpi)*n," ").concat(F.b/t/Object(G.ctmImageScale)(this.coreHelper.dpi)," ").concat(F.c/d/Object(G.ctmImageScale)(this.coreHelper.dpi)," ").concat(F.d/d/Object(G.ctmImageScale)(this.coreHelper.dpi)*e," ").concat(Object(G.converterDpi)(F.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(F.f,this.coreHelper.dpi),")")}R&&(Z="".concat(Z," matrix(").concat(R.a," ").concat(R.b," ").concat(R.c," ").concat(R.d," ").concat(Object(G.converterDpi)(R.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(R.f,this.coreHelper.dpi),")")),L.setAttribute("transform",Z);var l="";D&&(D=Object(G.converterBox)(D,this.coreHelper.dpi),l="clip: rect(".concat(D.y,"px, ").concat(D.w+D.x,"px, ").concat(D.h+D.y,"px, ").concat(D.x,"px)"));var W=[];if(h&&h.length>0)for(var r=0;r<h.length;r++){var x=document.createElementNS("http://www.w3.org/2000/svg","clipPath");x.setAttribute("id","image-clip-path-".concat(M,"-").concat(r));for(var f=h[r].Clip,b=0;b<f.length;b++){var V=f[b].Area,p=0,m=0,T=0,X=0;V.Path.Boundary&&(p=V.Path.Boundary.x,m=V.Path.Boundary.y,T=V.Path.Boundary.w,X=V.Path.Boundary.h);var j=document.createElementNS("http://www.w3.org/2000/svg","path");if(V.CTM)F=V.CTM;else if(V.TransFlag)if(V.Path.CTM);else if(F&&0==F.b&&0==F.c){var O="matrix(".concat(F.a," ").concat(F.b," ").concat(F.c," ").concat(F.d," ").concat(Object(G.converterDpi)(F.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(F.f,this.coreHelper.dpi),")");j.setAttribute("transform",O)}var z,u="",P=y(V.Path.AbbreviatedData);try{for(P.s();!(z=P.n()).done;){var v=z.value;"M"===v.cmd||"S"===v.cmd?u+="M ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[0],T)+p,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[1],X)+m,this.coreHelper.dpi)," "):"L"===v.cmd?u+="L ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[0],T)+p,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[1],X)+m,this.coreHelper.dpi)," "):"B"===v.cmd?u+="C ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[0],T)+p,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[1],X)+m,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[2]+p,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[3]+m,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[4]+p,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[5]+m,this.coreHelper.dpi)," "):"Q"===v.cmd?u+="Q ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[0],T)+p,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[1],X)+m,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[2]+p,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[3]+m,this.coreHelper.dpi)," "):"A"===v.cmd?u+="A ".concat(Object(G.converterDpi)(v.crds[0],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(v.crds[1],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[2],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[3],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(v.crds[4],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[5],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(v.crds[6],this.coreHelper.dpi)):"C"===v.cmd&&(u+="Z")}}catch(A){P.e(A)}finally{P.f()}j.setAttribute("d",u),x.appendChild(j)}W.push(x)}if(k){var _=document.createElementNS("http://www.w3.org/2000/svg","mask");_.setAttribute("id","mask-".concat(M));var $=document.createElementNS("http://www.w3.org/2000/svg","image");$.setAttribute("xlink:href",k),$.href.baseVal=k,_.appendChild($),H.appendChild(_),L.setAttribute("mask","url(#mask-".concat(M,")"))}H.appendChild(L);var AA,IA=E.x,gA=E.y;if(R){var BA=R.a,QA=R.b,CA=R.c,EA=R.d,DA=BA>0?Math.sign(BA)*Math.sqrt(BA*BA+CA*CA):Math.sqrt(BA*BA+CA*CA),iA=EA>0?Math.sign(EA)*Math.sqrt(QA*QA+EA*EA):Math.sqrt(QA*QA+EA*EA);0==Math.atan2(-QA,EA)&&0!=BA&&1==EA||(gA*=iA,IA*=DA)}U&&(AA="mix-blend-mode: ".concat(U));var oA="".concat(J,"overflow: visible; position: absolute; width: ").concat(a,"px; height: ").concat(K,"px; ").concat(l,";").concat(AA,";");if(W.length>0)if(1==W.length)H.appendChild(W[0]),H.setAttribute("clip-path","url(#image-clip-path-".concat(M,"-0)"));else{var wA,GA="",FA=y(W);try{for(FA.s();!(wA=FA.n()).done;){var NA=wA.value;void 0!==NA.children[0].getAttribute("d")&&(GA+="clip-path:path('".concat(NA.children[0].getAttribute("d"),"');"))}}catch(A){FA.e(A)}finally{FA.f()}oA="".concat(GA,";").concat(oA,";")}return{svg:H,style:oA,left:IA,top:gA}}},{key:"renderTextObject",value:function(A,I,g,B,Q,C,E,D,i){var o=1,w=g.Boundary;w=Object(G.converterBox)(w,this.coreHelper.dpi);var N=g.CTM,R=g.HScale,h=g.Font,M=g.Weight,U=g.Alpha/255,c=g.Size>0;N&&!c&&(N={a:-N.a,b:N.b,c:N.c,d:-N.d,e:-N.e,f:-N.f});var k=Object(G.converterDpi)(Math.abs(parseFloat(g.Size)),this.coreHelper.dpi),S=Object(G.calTextPoint)(this.coreHelper.dpi,g.TextCode,g.CGTransform,N,g.Boundary,D,i,c,R),s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.setAttribute("xmlns","http://www.w3.org/2000/svg"),s.setAttribute("version","1.1"),s.setAttribute("id",g.ID);var Y,a,K,H=g.FillColor,L=!1,J=g.DrawParam;if(J){var t=Object(G.getDrawParam)(C,J);t.FillColor&&(H&&H.Value||(H=t.FillColor))}if(H){H.Value&&(B=Object(G.parseColor)(H.Value)),o=H.alpha/255;var d=H.axialShd;if(d){L=!0;var Z=document.createElementNS("http://www.w3.org/2000/svg","linearGradient");Z.setAttribute("id","".concat(g.ID)),Z.setAttribute("x1","0%"),Z.setAttribute("y1","0%"),Z.setAttribute("x2","100%"),Z.setAttribute("y2","100%");var n,e=y(d.Segment);try{for(e.s();!(n=e.n()).done;){var q=n.value;if(q){var l=document.createElement("stop");l.setAttribute("offset","".concat(100*q.position,"%")),l.setAttribute("style","stop-color:".concat(Object(G.parseColor)(q.color.Value),";stop-opacity:1")),Z.appendChild(l),B=Object(G.parseColor)(q.color.Value)}}}catch(A){e.e(A)}finally{e.f()}s.appendChild(Z)}}g.Stroke&&(Y=Object(G.parseColor)(g.StrokeColor.Value),a=g.LineWidth,K=g.LineWidth),g.Fill||(o=0);var W=w.w,r=w.h,x=w.x,f=w.y,b=k,V=k,p=0;if(N){var m=N.a,T=N.b,X=N.c,j=N.d,O=m>0?Math.sign(m)*Math.sqrt(m*m+X*X):Math.sqrt(m*m+X*X),z=j>0?Math.sign(j)*Math.sqrt(T*T+j*j):Math.sqrt(T*T+j*j);0==(p=Math.atan2(-T,j))&&0!=m&&1==j||(b*=O,V*=z,K*=O),0==p&&0!=m&&1==j&&(b*=O,V*=z,K*=O),0==p&&R-0==1&&(R=m/j)>0&&(b*=R)}if(i){var u=i.a,P=i.b,v=i.c,_=i.d,$=u>0?Math.sign(u)*Math.sqrt(u*u+v*v):Math.sqrt(u*u+v*v),AA=_>0?Math.sign(_)*Math.sqrt(P*P+_*_):Math.sqrt(P*P+_*_);0==(p=Math.atan2(-P,_))&&0!=u&&1==_||(b*=$,V*=AA,f*=AA,x*=$,W*=$,r*=AA)}var IA=Object(G.getFont)(I,h),gA="",BA="",QA="",CA="";N&&(CA="matrix(".concat(N.a," ").concat(N.b," ").concat(N.c," ").concat(N.d," ").concat(Object(G.converterDpi)(N.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(N.f,this.coreHelper.dpi),")")),i&&(CA="".concat(CA," matrix(").concat(i.a," ").concat(i.b," ").concat(i.c," ").concat(i.d," ").concat(Object(G.converterDpi)(i.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(i.f,this.coreHelper.dpi),")")),R&&(CA="".concat(CA," scale(").concat(R,", 1)"));for(var EA=!1,DA=0;DA<S.length;DA++){var iA=S[DA];if(iA&&!isNaN(iA.x)){if(iA.glyph&&IA&&IA.face){EA=!0;var oA=Object(F.loadFaceInfo)(IA.face),wA=Object(F.FT_Glyph_Get_Measure)(IA.face,iA.glyph),GA=this.drawGlyph(wA.glyphPath,wA.horiUnderlinePosition,oA.units_per_EM,b,V,Q||B,o,Y,K,g.ID);if(0===p)GA.img.setAttribute("style","position:absolute; left: ".concat(Math.ceil(iA.cx),"px; top: ").concat(iA.cy-GA.yScale*wA.horiUnderlinePosition-V,"px;width: ").concat(Math.ceil(b),"px; height:").concat(Math.ceil(V),"px")),A.appendChild(GA.img);else{var FA=document.createElement("div");FA.setAttribute("style","transform-origin: center;transform: rotate(".concat(-p,"rad);position:absolute; left: ").concat(iA.cx,"px; top: ").concat(iA.cy-GA.yScale*wA.horiUnderlinePosition-V,"px;width: ").concat(Math.ceil(b),"px; height:").concat(Math.ceil(V),"px")),GA.img.setAttribute("style","position: absolute;left: 0px;top:0px;width: ".concat(Math.ceil(b),"px; height:").concat(Math.ceil(V),"px")),FA.appendChild(GA.img),A.appendChild(FA)}}if(gA=R?"".concat(gA).concat(iA.x+R*iA.x," "):"".concat(gA).concat(iA.x," "),BA="".concat(BA).concat(iA.y," "),QA=" "==iA.text?"".concat(QA," "):"".concat(QA).concat(iA.text),S.length>1&&R){var NA=document.createElementNS("http://www.w3.org/2000/svg","text");NA.setAttribute("x",iA.x),NA.setAttribute("y",iA.y),NA.innerHTML=iA.text,NA.setAttribute("transform",CA),L?NA.setAttribute("fill",B):(NA.setAttribute("fill",Q),NA.setAttribute("fill",B),NA.setAttribute("fill-opacity",EA?0:o<U?o:U)),EA||(yA&&s.appendChild(yA),NA.setAttribute("clip-path","url(#clip-path-".concat(g.ID,"-0)"))),Y&&a>0&&(NA.setAttribute("stroke",Y),NA.setAttribute("stroke-width",Object(G.converterDpi)(a,this.coreHelper.dpi))),NA.setAttribute("style","font-weight: ".concat(M,";font-size:").concat(k,"px;font-family: ").concat(Object(G.getFontFamily)(IA),";")),EA||s.appendChild(NA)}}}var yA=null,RA=g.Clips;if(RA&&RA.length>0){for(var hA=[],MA=0;MA<RA.length;MA++){(yA=document.createElementNS("http://www.w3.org/2000/svg","clipPath")).setAttribute("id","clip-path-".concat(g.ID,"-").concat(MA));for(var UA=RA[MA].Clip,cA=0;cA<UA.length;cA++){var kA=UA[cA].Area,SA=document.createElementNS("http://www.w3.org/2000/svg","path"),sA="",YA=0,aA=0;kA.Path.Boundary&&(YA=kA.Path.Boundary.x,aA=kA.Path.Boundary.y),EA&&(aA=-aA);var KA,HA=y(kA.Path.AbbreviatedData);try{for(HA.s();!(KA=HA.n()).done;){var LA=KA.value;"M"===LA.cmd||"S"===LA.cmd?sA+="M ".concat(Object(G.converterDpi)(LA.crds[0]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[1]+aA,this.coreHelper.dpi)," "):"L"===LA.cmd?sA+="L ".concat(Object(G.converterDpi)(LA.crds[0]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[1]+aA,this.coreHelper.dpi)," "):"B"===LA.cmd?sA+="C ".concat(Object(G.converterDpi)(LA.crds[0]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[1]+aA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[2]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[3]+aA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[4]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[5]+aA,this.coreHelper.dpi)," "):"Q"===LA.cmd?sA+="Q ".concat(Object(G.converterDpi)(LA.crds[0]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[1]+aA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[2]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[3]+aA,this.coreHelper.dpi)," "):"A"===LA.cmd?sA+="A ".concat(Object(G.converterDpi)(LA.crds[0],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(LA.crds[1],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[2],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[3],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(LA.crds[4],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[5],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(LA.crds[6],this.coreHelper.dpi)):"C"===LA.cmd&&(sA+="Z")}}catch(A){HA.e(A)}finally{HA.f()}SA.setAttribute("d",sA),yA.appendChild(SA),hA.push(yA)}}if(hA.length>0)if(1==hA.length)s.appendChild(hA[0]);else{var JA,tA=y(hA);try{for(tA.s();!(JA=tA.n()).done;){var dA=JA.value;void 0!==dA.children[0].getAttribute("d")&&"clip-path:path('".concat(dA.children[0].getAttribute("d"),"');")}}catch(A){tA.e(A)}finally{tA.f()}}}if(!R){var ZA=document.createElementNS("http://www.w3.org/2000/svg","text");ZA.setAttribute("x",gA),ZA.setAttribute("y",BA),ZA.textContent=QA,ZA.setAttribute("transform",CA),L?ZA.setAttribute("fill",B):(ZA.setAttribute("fill",Q),ZA.setAttribute("fill",B),ZA.setAttribute("fill-opacity",EA?0:o<U?o:U)),g.Visible||ZA.setAttribute("fill-opacity",0),EA||(yA&&s.appendChild(yA),ZA.setAttribute("clip-path","url(#clip-path-".concat(g.ID,"-0)"))),Y&&a>0&&(ZA.setAttribute("stroke",Y),ZA.setAttribute("stroke-width",Object(G.converterDpi)(a,this.coreHelper.dpi))),ZA.setAttribute("style","font-weight: ".concat(M,";font-size:").concat(k,"px;font-family: ").concat(Object(G.getFontFamily)(IA),";")),EA||s.appendChild(ZA)}if(D){var nA=Object(G.converterBox)(D,this.coreHelper.dpi);x+=nA.x,f+=nA.y}return s.setAttribute("style","overflow:visible;position:absolute;width:".concat(W,"px;height:").concat(r,"px;left:").concat(x,"px;top:").concat(f,"px;")),s}},{key:"renderPathObject",value:function(A,I,g,B,Q,C,E,D,i,o,w,F,N,R){var h=document.createElementNS("http://www.w3.org/2000/svg","svg");h.setAttribute("version","1.1"),h.setAttribute("xmlns","http://www.w3.org/2000/svg");var M=Q.Boundary;if(!M)return{svg:h,style:""};M=Object(G.converterBox)(M,this.coreHelper.dpi);var U=Q.LineWidth,c=Q.AbbreviatedData,k=Q.StrokeColor,S=Q.FillColor,s=Q.CTM,Y=document.createElementNS("http://www.w3.org/2000/svg","path");Y.setAttribute("xmlns","http://www.w3.org/2000/svg"),Y.setAttribute("ID",Q.ID),U&&(D=Object(G.converterDpi)(U,this.coreHelper.dpi));var a=Q.DrawParam;if(a){var K=Object(G.getDrawParam)(B,a);(U=K.LineWidth)&&(D=Object(G.converterDpi)(U,this.coreHelper.dpi)),K.FillColor&&(S&&S.Value||(S=K.FillColor)),K.StrokeColor&&(k&&k.Value||(k=K.StrokeColor))}s?Y.setAttribute("transform","matrix(".concat(s.a," ").concat(s.b," ").concat(s.c," ").concat(s.d," ").concat(Object(G.converterDpi)(s.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(s.f,this.coreHelper.dpi),")")):F&&Y.setAttribute("transform","matrix(".concat(F.a," ").concat(F.b," ").concat(F.c," ").concat(F.d," ").concat(Object(G.converterDpi)(F.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(F.f,this.coreHelper.dpi),")"));if(k){k.Value&&(E=Object(G.parseColor)(k.Value));var H=k.axialShd;if(H){!0;var L=document.createElementNS("http://www.w3.org/2000/svg","linearGradient");L.setAttribute("id","".concat(Q.ID)),L.setAttribute("x1","0%"),L.setAttribute("y1","0%"),L.setAttribute("x2","100%"),L.setAttribute("y2","100%");var J,t=y(H.Segment);try{for(t.s();!(J=t.n()).done;){var d=J.value;if(d){var Z=document.createElement("stop");Z.setAttribute("offset","".concat(100*d.position,"%")),Z.setAttribute("style","stop-color:".concat(Object(G.parseColor)(d.color.Value),";stop-opacity:1")),L.appendChild(Z),E=Object(G.parseColor)(d.color.Value)}}}catch(A){t.e(A)}finally{t.f()}h.appendChild(L)}}if(S){S.Value&&(C=Object(G.parseColor)(S.Value)),void 0!==S.Alpha&&0===S.Alpha&&(C="none"),void 0!==S.alpha&&0===S.alpha?C="none":Y.setAttribute("fill-opacity","".concat(S.alpha/255));var n=S.axialShd;if(n){!0;var e=document.createElement("linearGradient");e.setAttribute("id","".concat(Q.ID)),e.setAttribute("x1","0%"),e.setAttribute("y1","0%"),e.setAttribute("x2","100%"),e.setAttribute("y2","100%");var q,l=y(n.Segment);try{for(l.s();!(q=l.n()).done;){var W=q.value;if(W){var r=document.createElement("stop");r.setAttribute("offset","".concat(100*W.position,"%")),r.setAttribute("style","stop-color:".concat(Object(G.parseColor)(W.color.Value),";stop-opacity:1")),e.appendChild(r),C=Object(G.parseColor)(W.color.Value)}}}catch(A){l.e(A)}finally{l.f()}h.appendChild(e)}}if(D>0&&!E&&(E="rgb(0, 0, 0)"),0===Q.Alpha&&(C="none"),o&&Y.setAttribute("fill-opacity","".concat(o/255)),Q.Stroke&&(Y.setAttribute("stroke","".concat(E)),Y.setAttribute("stroke-width","".concat(D,"px"))),Q.Fill?(Y.setAttribute("fill-rule",Q.Rule),Y.setAttribute("fill","".concat(i?"none":C||"none"))):Y.setAttribute("fill","none"),Q.Join&&Y.setAttribute("stroke-linejoin","".concat(Q["@_Join"])),Q.Cap&&Y.setAttribute("stroke-linecap","".concat(Q["@_Cap"])),Q.DashPattern){var x=Q.DashPattern,f=Object(G.parseCtm)(x),b=0;Q.DashOffset&&(b=Q.DashOffset),Y.setAttribute("stroke-dasharray","".concat(Object(G.converterDpi)(f[0],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(f[1],this.coreHelper.dpi))),Y.setAttribute("stroke-dashoffset","".concat(Object(G.converterDpi)(b,this.coreHelper.dpi),"px"))}var V,p="",m=y(c);try{for(m.s();!(V=m.n()).done;){var T=V.value;"M"===T.cmd||"S"===T.cmd?p+="M ".concat(Object(G.converterDpi)(T.crds[0],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(T.crds[1],this.coreHelper.dpi)," "):"L"===T.cmd?p+="L ".concat(Object(G.converterDpi)(T.crds[0],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(T.crds[1],this.coreHelper.dpi)," "):"B"===T.cmd?p+="C ".concat(Object(G.converterDpi)(T.crds[0],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(T.crds[1],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(T.crds[2],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(T.crds[3],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(T.crds[4],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(T.crds[5],this.coreHelper.dpi)," "):"Q"===T.cmd?p+="Q ".concat(Object(G.converterDpi)(T.crds[0],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(T.crds[1],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(T.crds[2],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(T.crds[3],this.coreHelper.dpi)," "):"A"===T.cmd?p+="A ".concat(Object(G.converterDpi)(T.crds[0],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(T.crds[1],this.coreHelper.dpi)," ").concat(T.crds[2]," ").concat(T.crds[3],",").concat(T.crds[4]," ").concat(Object(G.converterDpi)(T.crds[5],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(T.crds[6],this.coreHelper.dpi)," "):"C"===T.cmd&&(p+="Z")}}catch(A){m.e(A)}finally{m.f()}Y.setAttribute("d",p),h.appendChild(Y);var X=M.w,j=M.h,O=M.x,z=M.y,u=S.pattern;if(u){var P=document.createElementNS("http://www.w3.org/2000/svg","defs"),v=document.createElementNS("http://www.w3.org/2000/svg","pattern");v.setAttribute("width",Object(G.converterDpi)(u.width,this.coreHelper.dpi)),v.setAttribute("height",Object(G.converterDpi)(u.height,this.coreHelper.dpi)),v.setAttribute("id","pattern1-".concat(Q.ID)),v.setAttribute("patternUnits","userSpaceOnUse"),this.renderLayer(A,I,g,v,R,B,N,null,u,!1,null,null,null),P.appendChild(v),h.appendChild(P);var _=document.createElementNS("http://www.w3.org/2000/svg","rect");_.setAttribute("width",X),_.setAttribute("height",j),_.setAttribute("style","fill:url(#pattern1-".concat(Q.ID,")")),h.appendChild(_)}var $=Q.Clips;if($&&$.length>0){for(var AA=[],IA=0;IA<$.length;IA++){var gA=document.createElementNS("http://www.w3.org/2000/svg","clipPath");gA.setAttribute("id","clip-path-".concat(I,"-").concat(g,"-").concat(Q.ID,"-").concat(IA));for(var BA=$[IA].Clip,QA=0;QA<BA.length;QA++){var CA=BA[QA].Area,EA=document.createElementNS("http://www.w3.org/2000/svg","path"),DA="",iA=0,oA=0,wA=0,GA=0;if(CA.Path.Boundary&&(iA=CA.Path.Boundary.x,oA=CA.Path.Boundary.y,wA=CA.Path.Boundary.w,GA=CA.Path.Boundary.h),!CA.TransFlag&&CA.CTM){var FA=CA.CTM,NA=void 0;if(NA=s?"matrix(".concat(FA.a," ").concat(FA.b," ").concat(FA.c," ").concat(FA.d," ").concat(Object(G.converterDpi)(FA.e-s.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(FA.f-s.f,this.coreHelper.dpi),")"):"matrix(".concat(FA.a," ").concat(FA.b," ").concat(FA.c," ").concat(FA.d," ").concat(Object(G.converterDpi)(FA.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(FA.f,this.coreHelper.dpi),")"),s){var yA=[[s.a,s.c,0],[s.b,s.d,0],[0,0,1]],RA=Object(G.inv)(yA);isNaN(RA[0][0])||RA[0][0]===1/0||(NA="".concat(NA," matrix(").concat(RA[0][0]," ").concat(RA[1][0]," ").concat(RA[0][1]," ").concat(RA[1][1]," 0 0)"))}EA.setAttribute("transform",NA)}if(!CA.TransFlag&&CA.Path.CTM){var hA=CA.Path.CTM,MA="matrix(".concat(hA.a," ").concat(hA.b," ").concat(hA.c," ").concat(hA.d," ").concat(Object(G.converterDpi)(hA.e-s.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(hA.f-s.f,this.coreHelper.dpi),")");if(s){var UA=[[s.a,s.c,0],[s.b,s.d,0],[0,0,1]],cA=Object(G.inv)(UA);isNaN(cA[0][0])||cA[0][0]===1/0||(MA="".concat(MA," matrix(").concat(cA[0][0]," ").concat(cA[1][0]," ").concat(cA[0][1]," ").concat(cA[1][1]," 0 0)"))}EA.setAttribute("transform",MA)}var kA,SA=y(CA.Path.AbbreviatedData);try{for(SA.s();!(kA=SA.n()).done;){var sA=kA.value;"M"===sA.cmd||"S"===sA.cmd?DA+="M ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(sA.crds[0],wA)+iA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(sA.crds[1],GA)+oA,this.coreHelper.dpi)," "):"L"===sA.cmd?DA+="L ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(sA.crds[0],wA)+iA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(sA.crds[1],GA)+oA,this.coreHelper.dpi)," "):"B"===sA.cmd?DA+="C ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(sA.crds[0],wA)+iA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(sA.crds[1],GA)+oA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(sA.crds[2]+iA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(sA.crds[3]+oA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(sA.crds[4]+iA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(sA.crds[5]+oA,this.coreHelper.dpi)," "):"Q"===sA.cmd?DA+="Q ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(sA.crds[0],wA)+iA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(sA.crds[1],GA)+oA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(sA.crds[2]+iA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(sA.crds[3]+oA,this.coreHelper.dpi)," "):"A"===sA.cmd?DA+="A ".concat(Object(G.converterDpi)(sA.crds[0],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(sA.crds[1],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(sA.crds[2],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(sA.crds[3],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(sA.crds[4],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(sA.crds[5],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(sA.crds[6],this.coreHelper.dpi)):"C"===sA.cmd&&(DA+="Z")}}catch(A){SA.e(A)}finally{SA.f()}EA.setAttribute("d",DA),gA.appendChild(EA)}AA.push(gA)}if(AA.length>0)if(1==AA.length)h.appendChild(AA[0]),Y.setAttribute("clip-path","url(#clip-path-".concat(I,"-").concat(g,"-").concat(Q.ID,"-0)"));else{var YA,aA="",KA=y(AA);try{for(KA.s();!(YA=KA.n()).done;){var HA=YA.value;void 0!==HA.children[0].getAttribute("d")&&(aA+="clip-path:path('".concat(HA.children[0].getAttribute("d"),"');"))}}catch(A){KA.e(A)}finally{KA.f()}Y.setAttribute("style",aA)}}var LA="overflow:hidden;position:absolute;width:".concat(Math.ceil(X),"px;height:").concat(Math.ceil(j),"px;");if(w){var JA=document.createElementNS("http://www.w3.org/2000/svg","svg");JA.setAttribute("version","1.1");var tA=Object(G.converterBox)(w,this.coreHelper.dpi),dA=Math.ceil(tA.w),ZA=Math.ceil(tA.h),nA=tA.x+O,eA=tA.y+z;return LA="overflow:hidden;position:absolute;width:".concat(dA,"px;height:").concat(ZA,"px;"),F&&s&&h.setAttribute("transform","matrix(".concat(F.a," ").concat(F.b," ").concat(F.c," ").concat(F.d," ").concat(Object(G.converterDpi)(F.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(F.f,this.coreHelper.dpi),")")),JA.appendChild(h),{svg:JA,style:LA,left:nA,top:eA}}return{svg:h,style:LA,left:O,top:z}}},{key:"drawGlyph",value:function(A,I,g,B,Q,C,E,D,i,o){var w=B/g,F=Q/g,N=document.createElementNS("http://www.w3.org/2000/svg","svg");N.setAttribute("version","1.1"),N.setAttribute("xmlns","http://www.w3.org/2000/svg");var y=document.createElementNS("http://www.w3.org/2000/svg","path");return y.setAttribute("transform","translate(0, ".concat(Q,") scale(").concat(w,", ").concat(-F,") translate(0, ").concat(-I,")")),y.setAttribute("d",A),C&&y.setAttribute("fill",C),y.setAttribute("fill-opacity",E),D&&(y.setAttribute("stroke","".concat(D)),y.setAttribute("stroke-width","".concat(Object(G.converterDpi)(i,this.coreHelper.dpi),"px"))),y.setAttribute("clip-path","url(#clip-path-".concat(o,"-0)")),N.appendChild(y),{img:N,yScale:F}}},{key:"watermark",value:function(A){var I={watermark_txt:"text",watermark_x:20,watermark_y:20,watermark_rows:20,watermark_cols:20,watermark_x_space:100,watermark_y_space:50,watermark_color:"#aaa",watermark_alpha:.4,watermark_fontsize:"15px",watermark_font:"微软雅黑",watermark_width:210,watermark_height:80,watermark_angle:20};if(1===arguments.length&&"object"==typeof arguments[0]){var g=arguments[0]||{};for(var B in g)g[B]&&I[B]&&g[B]===I[B]||g[B]&&(I[B]=g[B])}var Q,C,E=document.createDocumentFragment(),D=.015*(i=Math.max(document.body.scrollWidth,document.body.clientWidth)),i=i-D,o=Math.max(document.body.scrollHeight,document.body.clientHeight)+450;o=Math.max(o,window.innerHeight-30),(0==I.watermark_cols||parseInt(I.watermark_x+I.watermark_width*I.watermark_cols+I.watermark_x_space*(I.watermark_cols-1))>i)&&(I.watermark_cols=parseInt((i-I.watermark_x+I.watermark_x_space)/(I.watermark_width+I.watermark_x_space)),I.watermark_x_space=parseInt((i-I.watermark_x-I.watermark_width*I.watermark_cols)/(I.watermark_cols-1))),(0==I.watermark_rows||parseInt(I.watermark_y+I.watermark_height*I.watermark_rows+I.watermark_y_space*(I.watermark_rows-1))>o)&&(I.watermark_rows=parseInt((I.watermark_y_space+o-I.watermark_y)/(I.watermark_height+I.watermark_y_space)),I.watermark_y_space=parseInt((o-I.watermark_y-I.watermark_height*I.watermark_rows)/(I.watermark_rows-1)));for(var w=0;w<I.watermark_rows;w++){C=I.watermark_y+(I.watermark_y_space+I.watermark_height)*w;for(var G=0;G<I.watermark_cols;G++){Q=I.watermark_x+(I.watermark_width+I.watermark_x_space)*G;var F=document.createElement("div");F.id="mask_div"+w+G,F.className="mask_div",F.innerHTML=I.watermark_txt,F.style.webkitTransform="rotate(-"+I.watermark_angle+"deg)",F.style.MozTransform="rotate(-"+I.watermark_angle+"deg)",F.style.msTransform="rotate(-"+I.watermark_angle+"deg)",F.style.OTransform="rotate(-"+I.watermark_angle+"deg)",F.style.transform="rotate(-"+I.watermark_angle+"deg)",F.style.visibility="",F.style.position="absolute",F.style.left=Q+"px",F.style.top=C+"px",F.style.overflow="hidden",F.style.zIndex="9999",F.style.pointerEvents="none",F.style.opacity=I.watermark_alpha,F.style.fontSize=I.watermark_fontsize,F.style.fontFamily=I.watermark_font,F.style.color=I.watermark_color,F.style.textAlign="center",F.style.width=I.watermark_width+"px",F.style.height=I.watermark_height+"px",F.style.display="block",E.appendChild(F)}}return E}}]),A}()},function(A,I,g){"use strict";function B(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return Q(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return Q(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,C=function(){};return{s:C,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var E,D=!0,i=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return D=A.done,A},e:function(A){i=!0,E=A},f:function(){try{D||null==g.return||g.return()}finally{if(i)throw E}}}}function Q(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}g.r(I),g.d(I,"converterDpi",(function(){return C})),g.d(I,"ctmImageScale",(function(){return E})),g.d(I,"adjustPosLimit",(function(){return w})),g.d(I,"calTextPoint",(function(){return G})),g.d(I,"decodeHtml",(function(){return y})),g.d(I,"getFontFamily",(function(){return h})),g.d(I,"parseStBox",(function(){return M})),g.d(I,"parseCtm",(function(){return U})),g.d(I,"parseColor",(function(){return c})),g.d(I,"converterBox",(function(){return S})),g.d(I,"Uint8ArrayToHexString",(function(){return s})),g.d(I,"replaceFirstSlash",(function(){return Y})),g.d(I,"replaceFirstTarget",(function(){return a})),g.d(I,"readUTF",(function(){return K})),g.d(I,"getMultiMedia",(function(){return H})),g.d(I,"getDrawParam",(function(){return L})),g.d(I,"getFont",(function(){return J})),g.d(I,"inv",(function(){return Z}));var C=function(A,I){return function(A,I){return A*I/25.4}(A,I)},E=function(A){return 25.4/A},D=function(A,I,g){return{cx:A*g.a+I*g.c+1*g.e,cy:A*g.b+I*g.d+1*g.f}},i=function(A,I,g){return{ctmX:A*g.a+I*g.c,ctmY:A*g.b+I*g.d}},o=function(A,I,g){return{cx:g.x+A,cy:g.y+I}},w=function(A,I){return 0===I?A:A>I?I:A},G=function(A,I,g,Q,E,w,G,F,N){var R=0,h=0,M=0,U=0,c=[];if(!I)return c;var k,S=B(I);try{for(S.s();!(k=S.n()).done;){var s=k.value;if(s){if(R=F?parseFloat(s.X):-parseFloat(s.X),h=F?parseFloat(s.Y):-parseFloat(s.Y),isNaN(R)&&(R=0),isNaN(h)&&(h=0),M=R,U=h,Q){var Y=D(M,U,Q);M=Y.cx,U=Y.cy}var a=[],K=[];s.DeltaX&&s.DeltaX.length>0&&(a=s.DeltaX),s.DeltaY&&s.DeltaY.length>0&&(K=s.DeltaY);var H=s.text;if(H){H=(H=y(H+="")).replace(/&#x20;/g," ");for(var L=0;L<H.length;L++){if(L>0&&a.length>0){var J=L-1;if(J>=a.length&&(J=a.length-1),R+=N?F?a[J]/N:-a[J]/N:F?a[J]:-a[J],Q)M+=i(F?a[L-1]:-a[L-1],0,Q).ctmX;else M=R}if(L>0&&K.length>0){var t=L-1;if(t>=K.length&&(t=K.length-1),h+=F?K[t]:-K[t],Q)U+=i(0,F?K[L-1]:-K[L-1],Q).ctmY;else U=h}var d=H.substring(L,L+1),Z=o(M,U,E);G&&(Z=D(Z.cx,Z.cy,G));var n={x:C(R,A),y:C(h,A),text:d,cx:C(Z.cx,A),cy:C(Z.cy,A)};c.push(n)}}}}}catch(A){S.e(A)}finally{S.f()}if(c.length>0){var e,q=B(g);try{for(q.s();!(e=q.n()).done;)for(var l=e.value,W=l.CodePosition,r=l.GlyphCount,x=W;x<r+W;x++)if(c.length<=x){var f="".concat(c[c.length-1].glyph," ").concat(l.Glyphs[x-W]);c[c.length-1].glyph=f}else c[x].glyph=l.Glyphs[x-W]}catch(A){q.e(A)}finally{q.f()}}return c},F=/&\w+;|&#(\d+);/g,N={"&lt;":"<","&gt;":">","&amp;":"&","&nbsp;":" ","&quot;":'"',"&copy;":"","&apos;":"'"},y=function(A){return"string"!=typeof(A=null!=A?A:this.toString())?A:A.replace(F,(function(A,I){var g=N[A];return null==g&&(g=isNaN(I)?A:String.fromCharCode(160==I?32:I)),g}))},R={"楷体":"楷体, KaiTi, Kai, simkai",kaiti:"楷体, KaiTi, Kai, simkai",Kai:"楷体, KaiTi, Kai",simsun:"SimSun, simsun, Songti SC","宋体":"SimSun, simsun, Songti SC","黑体":"SimHei, STHeiti, simhei","仿宋":"FangSong, STFangsong, simfang","小标宋体":"小标宋体","方正小标宋_gbk":"方正小标宋_gbk, FZXiaoBiaoSong-B05S, NSimSun","方正小标宋简体":"方正小标宋_gbk, FZXiaoBiaoSong-B05S, NSimSun","仿宋_gb2312":"FangSong, STFangsong, simfang","楷体_gb2312":"楷体, KaiTi, Kai, simkai",couriernew:"Courier New","courier new":"Courier New"},h=function(A){if(!A)return R["宋体"];var I=A.FamilyName;I||(I=A.FontName),R[I.toLowerCase()]&&(I=R[I.toLowerCase()]);for(var g=0,B=Object.keys(R);g<B.length;g++){var Q=B[g];if(-1!=I.toLowerCase().indexOf(Q.toLowerCase()))return R[Q]}return I},M=function(A){if(A){var I=A.split(" ");return{x:parseFloat(I[0]),y:parseFloat(I[1]),w:parseFloat(I[2]),h:parseFloat(I[3])}}return null},U=function(A){return A.split(" ")},c=function(A){if(!(A&&A.length>0))return"rgb(0, 0, 0)";if(-1!==A.indexOf("#"))return A="#"+(A=(A=A.replace(/#/g,"")).replace(/ /g,"")).toString();var I=A.split(" ");if(3===I.length)return"rgb(".concat(I[0],", ").concat(I[1],", ").concat(I[2],")");if(4===I.length){var g=k(I[0],I[1],I[2],I[3]);return"rgb(".concat(g.r,", ").concat(g.g,", ").concat(g.b,")")}},k=function(A,I,g,B,Q){var C=1-(A=(A/=100)*(1-(B/=100))+B),E=1-(I=(I/=100)*(1-B)+B),D=1-(g=(g/=100)*(1-B)+B);return Q||(C=Math.round(255*C),E=Math.round(255*E),D=Math.round(255*D)),{r:C,g:E,b:D}},S=function(A,I){return{x:C(A.x,I),y:C(A.y,I),w:C(A.w,I),h:C(A.h,I)}},s=function(A){for(var I=[],g=0,B=0;B<2*A.length;B+=2)I[B>>>3]|=parseInt(A[g],10)<<24-B%8*4,g++;for(var Q=[],C=0;C<A.length;C++){var E=I[C>>>2]>>>24-C%4*8&255;Q.push((E>>>4).toString(16)),Q.push((15&E).toString(16))}return Q.join("")},Y=function(A){return A&&0===A.indexOf("/")&&(A=A.replace("/","")),A},a=function(A,I){return A&&0===A.indexOf(I)&&(A=A.replace(I,"")),A},K=function(A){if("string"==typeof A)return A;for(var I="",g=A,B=0;B<g.length;B++){var Q=g[B].toString(2),C=Q.match(/^1+?(?=0)/);if(C&&8==Q.length){for(var E=C[0].length,D=g[B].toString(2).slice(7-E),i=1;i<E;i++)D+=g[i+B].toString(2).slice(2);I="".concat(I).concat(String.fromCharCode(parseInt(D,2))),B+=E-1}}return I},H=function(A,I){var g,Q=B(A);try{for(Q.s();!(g=Q.n()).done;){var C=g.value;if(C.ID==I)return C}}catch(A){Q.e(A)}finally{Q.f()}},L=function(A,I){var g,Q=B(A);try{for(Q.s();!(g=Q.n()).done;){var C=g.value;if(C.ID==I)return C}}catch(A){Q.e(A)}finally{Q.f()}},J=function(A,I){var g,Q=B(A);try{for(Q.s();!(g=Q.n()).done;){var C=g.value;if(C.ID==I)return C}}catch(A){Q.e(A)}finally{Q.f()}};function t(A){if(A.length!==A[0].length)throw new Error;var I=A.length,g=0;if(I>3)for(var B=0;B<I;B++){for(var Q=new Array(I-1).fill(0).map((function(A){return new Array(I-1).fill(0)})),C=0;C<I-1;C++)for(var E=0;E<I-1;E++)Q[C][E]=E<B?A[C+1][E]:A[C+1][E+1];g+=A[0][B]*Math.pow(-1,0+B)*t(Q)}else 3===I?g=A[0][0]*A[1][1]*A[2][2]+A[0][1]*A[1][2]*A[2][0]+A[0][2]*A[1][0]*A[2][1]-A[0][2]*A[1][1]*A[2][0]-A[0][1]*A[1][0]*A[2][2]-A[0][0]*A[1][2]*A[2][1]:2===I?g=A[0][0]*A[1][1]-A[0][1]*A[1][0]:1===I&&(g=A[0][0]);return g}function d(A){if(A[0].length!==A.length)throw new Error;for(var I=A.length,g=new Array(I).fill(0).map((function(A){return new Array(I).fill(0)})),B=0;B<I;B++)for(var Q=0;Q<I;Q++){for(var C=[],E=0;E<A.length;E++)if(E!==B){for(var D=[],i=0;i<A.length;i++)i!==Q&&D.push(A[E][i]);C.push(D)}g[B][Q]=Math.pow(-1,B+Q)*t(C)}return function(A){for(var I=new Array(A.length).fill(0).map((function(I){return new Array(A[0].length).fill(0)})),g=0;g<I.length;g++)for(var B=0;B<I[0].length;B++)I[g][B]=A[B][g];return I}(g)}function Z(A){if(A[0].length!==A.length)throw new Error;for(var I=t(A),g=d(A),B=0;B<g.length;B++)for(var Q=0;Q<g.length;Q++)g[B][Q]/=I;return g}},function(A,I,g){"use strict";g.r(I),g.d(I,"needInitAgain",(function(){return o})),g.d(I,"setYYDS",(function(){return w})),g.d(I,"freeMemory",(function(){return G})),g.d(I,"getStreamData",(function(){return F})),g.d(I,"CreateLibrary",(function(){return N})),g.d(I,"CreateNativeStream",(function(){return y})),g.d(I,"FT_Open_Face",(function(){return R})),g.d(I,"loadFaceInfo",(function(){return h})),g.d(I,"FT_Glyph_Get_Measure",(function(){return M})),g.d(I,"freeOFD",(function(){return U})),g.d(I,"readOFD",(function(){return c})),g.d(I,"readOFDByBase64",(function(){return k})),g.d(I,"hashPath",(function(){return S})),g.d(I,"MD5",(function(){return s})),g.d(I,"SHA1",(function(){return Y})),g.d(I,"SM3",(function(){return a})),g.d(I,"base64EncodeByByte",(function(){return K})),g.d(I,"base64Encode",(function(){return H})),g.d(I,"base64DecodeToUint8Array",(function(){return L})),g.d(I,"JSBase64ByHashFile",(function(){return J})),g.d(I,"JSGetImageInfoByBase64",(function(){return t})),g.d(I,"JSGetImageInfoByPath",(function(){return d})),g.d(I,"JSReadPageInfo",(function(){return Z})),g.d(I,"JSGetPathEncode",(function(){return n})),g.d(I,"JSPackageSigned",(function(){return e})),g.d(I,"JSGetToSign",(function(){return q}));var B,Q,C,E,D=g(31),i=g(32),o=function(){return!B},w=function(A){B=A},G=function(A){B._ASC_FT_Free(A.data),A.data=0},F=function(){return E},N=function(){Q=B._ASC_FT_Init()},y=function(A){var I=new Uint8Array(A),g=B._malloc(A.byteLength);return B.HEAPU8.set(I,g),{data:g,length:A.byteLength}},R=function(A){return B._ASC_FT_Open_Face(Q,A.data,A.length,0)},h=function(A){var I=B._ASC_FT_GetFaceInfo(A);if(I){var g=new D.CFaceInfo,Q=Math.min(B.HEAP8.length-I>>2,250),C=new Int32Array(B.HEAP8.buffer,I,Q),E=0;g.units_per_EM=Math.abs(C[E++]),g.ascender=C[E++],g.descender=C[E++],g.height=C[E++],g.face_flags=C[E++],g.num_faces=C[E++],g.num_glyphs=C[E++],g.num_charmaps=C[E++],g.style_flags=C[E++],g.face_index=C[E++];for(var i=C[E++];i;)g.family_name+=String.fromCharCode(i),i=C[E++];for(i=C[E++];i;)g.style_name+=String.fromCharCode(i),i=C[E++];g.os2_version=C[E++],g.os2_usWeightClass=C[E++],g.os2_fsSelection=C[E++],g.os2_usWinAscent=C[E++],g.os2_usWinDescent=C[E++],g.os2_usDefaultChar=C[E++],g.os2_sTypoAscender=C[E++],g.os2_sTypoDescender=C[E++],g.os2_sTypoLineGap=C[E++],g.os2_ulUnicodeRange1=l(C[E++]),g.os2_ulUnicodeRange2=l(C[E++]),g.os2_ulUnicodeRange3=l(C[E++]),g.os2_ulUnicodeRange4=l(C[E++]),g.os2_ulCodePageRange1=l(C[E++]),g.os2_ulCodePageRange2=l(C[E++]),g.os2_nSymbolic=C[E++],g.header_yMin=C[E++],g.header_yMax=C[E++];for(var o=C[E++],w=0;w<o;w++)g.monochromeSizes.push(C[E++]);return B._ASC_FT_Free(I),I=null,g}},M=function(A,I){if(B._AST_FT_Load_Glyph(A,I,1)>0)return" ";var g=B._ASC_FT_Get_Glyph_Measure_Params(A,1);if(!g)return null;var Q=B.HEAP32[g>>2],C=new Int32Array(B.HEAP8.buffer,g,Q),E=new i.CGlyphMetrics;E.bbox_xMin=C[1],E.bbox_yMin=C[2],E.bbox_xMax=C[3],E.bbox_yMax=C[4],E.width=C[5],E.height=C[6],E.horiAdvance=C[7],E.horiBearingX=C[8],E.horiBearingY=C[9],E.vertAdvance=C[10],E.vertBearingX=C[11],E.vertBearingY=C[12],E.linearHoriAdvance=C[13],E.linearVertAdvance=C[14],E.horiUnderlinePosition=E.horiBearingY-E.height;for(var D=15,o="";D<Q;)switch(C[D++]){case 0:o+=" M ".concat(C[D++]," ").concat(C[D++]);break;case 1:o+=" L ".concat(C[D++]," ").concat(C[D++]);break;case 2:o+=" Q ".concat(C[D++]," ").concat(C[D++]," ").concat(C[D++]," ").concat(C[D++]);break;case 3:o+=" C ".concat(C[D++]," ").concat(C[D++]," ").concat(C[D++]," ").concat(C[D++]," ").concat(C[D++]," ").concat(C[D++])}return E.glyphPath=o,B._ASC_FT_Free(g),C=null,E},U=function(A){if(G(C),A.ofdParserPtr>0)B.JSFreeOFD(A.ofdParserPtr);var I=A.getFontRes(0);I&&I.forEach((function(A){A.face&&B._ASC_FT_Free(A.face)}))},c=function(A,I,g){E=A,C=y(A);var D=B.JSReadOFD(Q,C.data,C.length,I||"kgNVVbdUZ31C6mps",g?g.toLowerCase():"");if(D.data&&D.data.ofd&&(D.data.ofd.size=C.length),0!==D.code)switch(D.msg){case"10001":D.msg="授权信息错误";break;case"10002":D.msg="授权时间过期";break;case"10003":var i="非ofd文件无法打开";switch(D.file_type){case 0:break;case 9:i="PDF文件无法打开";break;default:i="图片文件无法打开"}D.msg=i}return D},k=function(A,I,g){return B.JSReadOFDByBase64(Q,A,I||"kgNVVbdUZ31C6mps",g?g.toLowerCase():"")},S=function(A,I,g){return B.JSHashPath(A,I,g)},s=function(A){return B.JSMD5(A)},Y=function(A){return B.JSSHA1(A)},a=function(A){return B.JSSM3(A)},K=function(A){var I=y(A),g=B.JSBase64EncodeByByte(I.data,I.length);return G(I),g},H=function(A){return B.JSBase64Encode(A)},L=function(A){var I=B.JSBase64Decode(A);return new Uint8Array(B.HEAPU8.buffer,I.ptr,I.len).slice(0,I.len)},J=function(A,I,g){var Q=y(A);return B.JSBase64ByHashFile(Q.data,Q.length,I,g)},t=function(A){var I=B.JSGetImageInfoByBase64(A);return"jb2"!==I.ext&&"jp2"!==I.ext&&"tif"!==I.ext&&"gif"!==I.ext&&"bmp"!==I.ext||(I.ext="png"),0===I.fileBase64.length&&(I.fileBase64=A),0!==I.fileBase64.indexOf("data:image")&&(I.fileBase64="data:image/".concat(I.ext,";base64,").concat(I.fileBase64)),I},d=function(A,I,g,Q,C){C||(C="");var E=B.JSGetImageInfoByPath(A,I,g,Q,C);return"jb2"!==E.ext&&"jp2"!==E.ext&&"tif"!==E.ext&&"gif"!==E.ext&&"bmp"!==E.ext&&"webp"!==E.ext||(E.ext="png"),0!==E.fileBase64.indexOf("data:image")&&(E.fileBase64="data:image/".concat(E.ext,";base64,").concat(E.fileBase64)),E},Z=function(A,I,g,Q,C){return B.JSReadPageInfo(A,I,g,Q,C)},n=function(A,I){var g=B.JSGetPathEncode(A,I);return new Uint8Array(B.HEAPU8.buffer,g.ptr,g.ptr_len).slice(0,g.ptr_len)},e=function(A,I){var g=B.JSPackageSigned(A,I);return g.ptr_len>0?new Uint8Array(B.HEAPU8.buffer,g.ptr,g.ptr_len).slice(0,g.ptr_len):g},q=function(A,I){return B.JSGetToSign(A,I)},l=function(A){return A<0?A+4294967296:A}},function(A,I,g){"use strict";g.r(I),g.d(I,"CFaceInfo",(function(){return D}));var B=g(1),Q=g.n(B),C=g(2),E=g.n(C),D=Q()((function A(){E()(this,A),this.units_per_EM=0,this.ascender=0,this.descender=0,this.height=0,this.face_flags=0,this.num_faces=0,this.num_glyphs=0,this.num_charmaps=0,this.style_flags=0,this.face_index=0,this.family_name="",this.style_name="",this.os2_version=0,this.os2_usWeightClass=0,this.os2_fsSelection=0,this.os2_usWinAscent=0,this.os2_usWinDescent=0,this.os2_usDefaultChar=0,this.os2_sTypoAscender=0,this.os2_sTypoDescender=0,this.os2_sTypoLineGap=0,this.os2_ulUnicodeRange1=0,this.os2_ulUnicodeRange2=0,this.os2_ulUnicodeRange3=0,this.os2_ulUnicodeRange4=0,this.os2_ulCodePageRange1=0,this.os2_ulCodePageRange2=0,this.os2_nSymbolic=0,this.header_yMin=0,this.header_yMax=0,this.monochromeSizes=[]}))},function(A,I,g){"use strict";g.r(I),g.d(I,"CGlyphMetrics",(function(){return D}));var B=g(1),Q=g.n(B),C=g(2),E=g.n(C),D=Q()((function A(){E()(this,A),this.bbox_xMin=0,this.bbox_yMin=0,this.bbox_xMax=0,this.bbox_yMax=0,this.width=0,this.height=0,this.horiAdvance=0,this.horiBearingX=0,this.horiBearingY=0,this.vertAdvance=0,this.vertBearingX=0,this.vertBearingY=0,this.linearHoriAdvance=0,this.linearVertAdvance=0,this.horiUnderlinePosition=0,this.glyphPath=null}))},function(A,I,g){"use strict";g.r(I),g.d(I,"Ofd_Core",(function(){return w}));var B=g(2),Q=g.n(B),C=g(1),E=g.n(C),D=(g(29),g(30));function i(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return o(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return o(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function o(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var w=function(){function A(I,g,B){Q()(this,A),this.ofd=I,this.ofdParserPtr=g,this.leftTime=B}return E()(A,[{key:"getMetadata",value:function(A){return A?A>this.ofd.DocBody.length&&(A=this.ofd.DocBody.length-1):A=0,{Title:this.ofd.DocBody[A].DocInfo.Title,Author:this.ofd.DocBody[A].DocInfo.Author,Subject:this.ofd.DocBody[A].DocInfo.Subject,Creator:this.ofd.DocBody[A].DocInfo.Creator,CreationDate:this.ofd.DocBody[A].DocInfo.CreationDate,CreatorVersion:this.ofd.DocBody[A].DocInfo.CreatorVersion,ModificationDate:this.ofd.DocBody[A].DocInfo.ModDate,Keywords:this.ofd.DocBody[A].DocInfo.Keywords,numPages:this.getOFDPageCount(A),pageSize:"".concat(this.pageWidth(A,0),"毫米 X ").concat(this.pageHeight(A,0),"毫米")}}},{key:"readOfdDocBody",value:function(A){return this.ofd?(A?A>this.ofd.DocBody.length&&(A=this.ofd.DocBody.length-1):A=0,this.ofd.DocBody[A]):null}},{key:"readOfdDocument",value:function(A){return this.ofd?(A?A>this.ofd.Document.length&&(A=this.ofd.Document.length-1):A=0,this.ofd.Document[A]):null}},{key:"readOfdPage",value:function(A,I){if(!this.ofd)return null;A?A>this.ofd.Document.length&&(A=this.ofd.Document.length-1):A=0;var g=this.ofd.Document[A],B=g.Pages[I];if(B.Page.onlyReadArea){var Q=Object(D.JSReadPageInfo)(this.ofdParserPtr,B.BasePln,B.BaseAbs,B.pln,B.abs);g.Pages[I].Page=Q.Page}return g.Pages[I]}},{key:"readOfdTemplatePage",value:function(A){return this.ofd?(A?A>this.ofd.Document.length&&(A=this.ofd.Document.length-1):A=0,this.ofd.Document[A].CommonData.TemplatePage):null}},{key:"readPageFromTemplate",value:function(A){if(A.Page.onlyReadArea){var I=Object(D.JSReadPageInfo)(this.ofdParserPtr,A.BasePln,A.BaseAbs,"","");A.Page=I.Page}return A}},{key:"getOFDPageCount",value:function(A){var I=this.readOfdDocument(A);return I?I.Pages.length:0}},{key:"pageWidth",value:function(A,I){var g=this.readOfdDocument(A);if(!g)return 0;var B=g.Pages[I];return this.calPageBox(g,B).w}},{key:"pageHeight",value:function(A,I){var g=this.readOfdDocument(A);if(!g)return 0;var B=g.Pages[I];return this.calPageBox(g,B).h}},{key:"calPageBox",value:function(A,I){var g,B=I.Page.Area;if(B&&Object.keys(B).length>0){var Q=B.PhysicalBox;if(Q)g=Q;else{var C=B.ApplicationBox;if(C)g=C;else{var E=B.ContentBox;E&&(g=E)}}}else{var D=A.CommonData.PageArea,i=D.PhysicalBox;if(i)g=i;else{var o=D.ApplicationBox;if(o)g=o;else{var w=D.ContentBox;w&&(g=w)}}}return g}},{key:"getSignatureCount",value:function(A){var I=this.readOfdDocument(A);return I&&I.Signatures&&I.Signatures.Signature?I.Signatures.Signature.length:0}},{key:"getAllSignature",value:function(A){var I=this.readOfdDocument(A);return I&&I.Signatures?I.Signatures.Signature:0}},{key:"getSignatureByIndex",value:function(A,I){var g=this.readOfdDocument(A);return g?g.Signatures.Signature[I]:null}},{key:"findSignature",value:function(A,I,g){var B=null,Q=this.readOfdDocument(A);if(Q)for(var C=0;C<Q.Signatures.Signature.length;C++){var E,D=i(Q.Signatures.Signature);try{for(D.s();!(E=D.n()).done;){var o,w=E.value,G=i(w.Signature.SignedInfo.StampAnnot);try{for(G.s();!(o=G.n()).done;){var F=o.value;if(F.ID==g&&F.PageRef==I){B=w.Signature;break}}}catch(A){G.e(A)}finally{G.f()}}}catch(A){D.e(A)}finally{D.f()}}return B}},{key:"getFontRes",value:function(A){var I,g,B=this.readOfdDocument(A);if(B)return null==B||null===(I=B.CommonData)||void 0===I||null===(g=I.Res)||void 0===g?void 0:g.Fonts}},{key:"getDocPln",value:function(A){var I=this.readOfdDocBody(A);if(I)return null==I?void 0:I.DocPln}},{key:"getAttachmentCount",value:function(A){var I=this.readOfdDocument(A);return I&&I.Attachments?I.Attachments.length:0}},{key:"getCustomTag",value:function(A){var I=this.readOfdDocument(A);return I&&I.CustomTags?I.CustomTags:null}},{key:"getPageIndexByPageId",value:function(A,I){if(!this.ofd)return 0;A?A>this.ofd.Document.length&&(A=this.ofd.Document.length-1):A=0;for(var g=this.ofd.Document[A],B=0;B<g.Pages.length;B++){if(g.Pages[B].ID==I)return B}}},{key:"getAllAttachment",value:function(A){var I=this.readOfdDocument(A);return I&&I.Attachments?I.Attachments:[]}},{key:"getAttachmentByIndex",value:function(A,I){var g=this.readOfdDocument(A);return g?g.Attachments[I]:null}},{key:"getAttachmentByID",value:function(A,I){var g=this.readOfdDocument(A);if(g){var B,Q=i(g.Attachments);try{for(Q.s();!(B=Q.n()).done;){var C=B.value;if(C.ID==I)return C}}catch(A){Q.e(A)}finally{Q.f()}}return null}},{key:"getTextObject",value:function(A,I){var g=[],B=this.readOfdPage(A,I);if(B){var Q,C=i(B.Page.Content.Layer);try{for(C.s();!(Q=C.n()).done;){var E,D=i(Q.value.PageBlock);try{for(D.s();!(E=D.n()).done;){var o=E.value;if("TextObject"==o.Type){var w,G="",F=i(o.TextCode);try{for(F.s();!(w=F.n()).done;){var N=w.value;G="".concat(G).concat(N.text)}}catch(A){F.e(A)}finally{F.f()}if(G.length>0){var y={id:o.ID,pageId:B.ID};y.text=G,g.push(y)}}}}catch(A){D.e(A)}finally{D.f()}}}catch(A){C.e(A)}finally{C.f()}}return g}},{key:"getAllTextObject",value:function(A){for(var I=[],g=this.readOfdDocument(A),B=0;B<g.Pages.length;B++){var Q=g.Pages[B];if(Q.Page.onlyReadArea){var C=Object(D.JSReadPageInfo)(this.ofdParserPtr,Q.BasePln,Q.BaseAbs,Q.pln,Q.abs);Q.Page=C.Page}if(Q){var E,o=i(Q.Page.Content.Layer);try{for(o.s();!(E=o.n()).done;){var w,G=i(E.value.PageBlock);try{for(G.s();!(w=G.n()).done;){var F=w.value;if("TextObject"==F.Type){var N,y="",R=i(F.TextCode);try{for(R.s();!(N=R.n()).done;){var h=N.value;y="".concat(y).concat(h.text)}}catch(A){R.e(A)}finally{R.f()}if(y.length>0){var M={id:F.ID,pageId:Q.ID,pageIndex:B+1};M.text=y,I.push(M)}}}}catch(A){G.e(A)}finally{G.f()}}}catch(A){o.e(A)}finally{o.f()}}}return I}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"Ofd_Core_Helper",(function(){return i}));var B=g(2),Q=g.n(B),C=g(1),E=g.n(C),D=g(29),i=function(){function A(){var I=arguments.length>0&&void 0!==arguments[0]?arguments[0]:96,g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";Q()(this,A),this.dpi=I,this.waterText=g}return E()(A,[{key:"setWaterText",value:function(A){this.waterText=A}},{key:"setWaterSetting",value:function(A){this.waterSetting=A}},{key:"setDpi",value:function(A){this.dpi=A}},{key:"pageRenderWidth",value:function(A,I,g){var B=g.pageWidth(A,I);return B=Object(D.converterDpi)(B,this.dpi)}},{key:"pageRenderHeight",value:function(A,I,g){var B=g.pageHeight(A,I);return B=Object(D.converterDpi)(B,this.dpi)}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"OfdCanvasRender",(function(){return M}));var B=g(4),Q=g.n(B),C=g(2),E=g.n(C),D=g(1),i=g.n(D),o=g(5),w=g.n(o),G=g(29),F=g(30),N=g(33),y=g(28);function R(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return h(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return h(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function h(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var M=function(){function A(I,g){E()(this,A),this.core=I,this.coreHelper=g,this.render=new y.Ofd_Render(this.core,this.coreHelper)}var I,g,B,C,D,o,h,M,U,c;return i()(A,[{key:"setOfdCore",value:function(A){this.core=A,this.render.setOfdCore(this.core)}},{key:"renderPageByCanvas",value:(c=Q()(w.a.mark((function A(I,g,B,Q,C){var E,D,i,o,y,h,M,U,c,k,S,s,Y,a,K,H,L,J,t,d,Z,n,e,q,l,W,r,x,f,b,V,p,m,T,X,j,O,z,u,P;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(E=C?C.readOfdDocument(B):this.core.readOfdDocument(B),D=C?C.readOfdPage(B,Q):this.core.readOfdPage(B,Q),i=D.Page.Template,E.Annotations,o=C?C.readOfdTemplatePage(B):this.core.readOfdTemplatePage(B),y=E.Signatures?E.Signatures.Signature:[],h=E.CommonData.Res.Fonts,M=E.CommonData.Res.DrawParams,E.CommonData.Res.ColorSpaces,U=E.CommonData.Res.CompositeGraphicUnits,c=E.CommonData.Res.MultiMedias,!i){A.next=64;break}k=R(i),A.prev=13,k.s();case 15:if((S=k.n()).done){A.next=56;break}s=S.value,Y=R(o),A.prev=18,Y.s();case 20:if((a=Y.n()).done){A.next=46;break}if((K=a.value).ID!=s.TemplateID){A.next=44;break}if(!(K=C?C.readPageFromTemplate(K):this.core.readPageFromTemplate(K)).Page.Content){A.next=43;break}H=K.Page.Content.Layer,L=R(H),A.prev=27,L.s();case 29:if((J=L.n()).done){A.next=35;break}return t=J.value,A.next=33,this.renderLayerByCanvas(I,g,h,M,c,U,t,!1);case 33:A.next=29;break;case 35:A.next=40;break;case 37:A.prev=37,A.t0=A.catch(27),L.e(A.t0);case 40:return A.prev=40,L.f(),A.finish(40);case 43:return A.abrupt("break",46);case 44:A.next=20;break;case 46:A.next=51;break;case 48:A.prev=48,A.t1=A.catch(18),Y.e(A.t1);case 51:return A.prev=51,Y.f(),A.finish(51);case 54:A.next=15;break;case 56:A.next=61;break;case 58:A.prev=58,A.t2=A.catch(13),k.e(A.t2);case 61:return A.prev=61,k.f(),A.finish(61);case 64:if(!D.Page.Content){A.next=83;break}d=D.Page.Content.Layer,Z=R(d),A.prev=67,Z.s();case 69:if((n=Z.n()).done){A.next=75;break}return e=n.value,A.next=73,this.renderLayerByCanvas(I,g,h,M,c,U,e,!1);case 73:A.next=69;break;case 75:A.next=80;break;case 77:A.prev=77,A.t3=A.catch(67),Z.e(A.t3);case 80:return A.prev=80,Z.f(),A.finish(80);case 83:q=R(y),A.prev=84,q.s();case 86:if((l=q.n()).done){A.next=134;break}W=l.value,r=R(W.Signature.SignedInfo.StampAnnot),A.prev=89,r.s();case 91:if((x=r.n()).done){A.next=124;break}if(f=x.value,b=f.PageRef,D.ID!=b){A.next=122;break}if(V=f.Boundary,!(W.Signature.PicType&&W.Signature.PicType.length>0)){A.next=122;break}if("ofd"!==W.Signature.PicType){A.next=108;break}p=new N.Ofd_Core(W.Signature.ofd,this.coreHelper.dpi),m=0;case 100:if(!(m<p.getOFDPageCount(0))){A.next=106;break}return A.next=103,this.renderSealPageOnCanvas(I,g,m,p,!0,V,b,f.ID);case 103:m++,A.next=100;break;case 106:A.next=122;break;case 108:if("svg"!==W.Signature.PicType){A.next=114;break}return T="data:image/svg+xml;base64,".concat(W.Signature.PicValue),A.next=112,this.renderSealSvgOnCanvas(I,g,T,V);case 112:A.next=122;break;case 114:return X=V.w,j=V.h,O=Object(G.converterBox)(V,this.coreHelper.dpi),z=Object(F.JSGetImageInfoByBase64)(W.Signature.PicValue),u=z.fileBase64,P={a:X,b:0,c:0,d:j,e:0,f:0},A.next=122,this.renderImageOnCanvas(I,g,u,z.width,z.height,O,f.Clip,!0,b,f.ID,P);case 122:A.next=91;break;case 124:A.next=129;break;case 126:A.prev=126,A.t4=A.catch(89),r.e(A.t4);case 129:return A.prev=129,r.f(),A.finish(129);case 132:A.next=86;break;case 134:A.next=139;break;case 136:A.prev=136,A.t5=A.catch(84),q.e(A.t5);case 139:return A.prev=139,q.f(),A.finish(139);case 142:case"end":return A.stop()}}),A,this,[[13,58,61,64],[18,48,51,54],[27,37,40,43],[67,77,80,83],[84,136,139,142],[89,126,129,132]])}))),function(A,I,g,B,Q){return c.apply(this,arguments)})},{key:"renderAnnotationOnCanvas",value:(U=Q()(w.a.mark((function A(I,g,B,Q,C,E,D){var i,o,F,N,y;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(i=B.Appearance,!(o=B.Appearance.Boundary)){A.next=15;break}if(0!==o.w&&0!==o.h){A.next=5;break}return A.abrupt("return");case 5:return F=Object(G.converterBox)(o,this.coreHelper.dpi),(N=document.createElement("canvas")).style.height="".concat(F.w,"px"),N.style.width="".concat(F.h,"px"),N.width=F.w,N.height=F.h,y=N.getContext("2d"),A.next=14,this.renderLayerByCanvas(N,y,Q,C,E,D,i,!1);case 14:g.drawImage(N,F.x,F.y);case 15:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,Q,C,E){return U.apply(this,arguments)})},{key:"renderSealSvgOnCanvas",value:(M=Q()(w.a.mark((function A(I,g,B,Q,C,E){var D;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return D=Object(G.converterBox)(Q,this.coreHelper.dpi),A.abrupt("return",new Promise((function(A,I){var Q=new Image;Q.src=B,Q.onload=function(){var I=Q.width,B=Q.height,C=document.createElement("canvas");if(C.style.height="".concat(I,"px"),C.style.width="".concat(B,"px"),C.width=I,C.height=B,C.getContext("2d").drawImage(Q,0,0),I!==D.w){var E=D.h/B<D.w/I?D.h/B:D.w/I,i=document.createElement("canvas");i.style.height="".concat(D.w,"px"),i.style.width="".concat(D.h,"px"),i.width=D.w,i.height=D.h;var o=i.getContext("2d");o.scale(E,E),o.drawImage(C,0,0),g.drawImage(i,D.x,D.y)}else g.drawImage(C,D.x,D.y);A()}})));case 2:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,Q,C){return M.apply(this,arguments)})},{key:"renderSealPageOnCanvas",value:(h=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i){var o,F,N,y,R,h,M,U,c,k;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return o={x:0,y:0,w:0,h:0},o=E,F={x:E.x,y:E.y,w:Q.pageWidth(0,B),h:Q.pageHeight(0,B)},N=Object(G.converterBox)(F,this.coreHelper.dpi),y=1,(R=document.createElement("canvas")).style.height="".concat(N.w,"px"),R.style.width="".concat(N.h,"px"),R.width=N.w,R.height=N.h,h=R.getContext("2d"),A.next=13,this.renderPageByCanvas(R,h,0,B,Q);case 13:h.scale(y,y),F.w!==o.w?(M=o.h/F.h<o.w/F.w?o.h/F.h:o.w/F.w,U=document.createElement("canvas"),c=Object(G.converterBox)(o,this.coreHelper.dpi),U.style.height="".concat(c.w,"px"),U.style.width="".concat(c.h,"px"),U.width=c.w,U.height=c.h,(k=U.getContext("2d")).scale(M,M),k.drawImage(R,0,0),g.drawImage(U,N.x,N.y)):g.drawImage(R,N.x,N.y);case 15:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,Q,C,E,D){return h.apply(this,arguments)})},{key:"renderLayerByCanvas",value:(o=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i,o,F,N){var y,h,M,U,c,k,S,s,Y,a,K,H,L,J,t;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(y=null,h=null,M=Object(G.converterDpi)(.353,this.coreHelper.dpi),(U=D.DrawParam)&&Object(G.getDrawParam)(Q,U)&&(c=Object(G.getDrawParam)(Q,U),Object(G.getDrawParam)(Q,c.Relative)&&(c=Object(G.getDrawParam)(Q,c.Relative)),c.FillColor&&(y=Object(G.parseColor)(c.FillColor.Value)),c.StrokeColor&&(y=Object(G.parseColor)(c.StrokeColor.Value)),c.LineWidth&&(M=Object(G.converterDpi)(c.LineWidth,this.coreHelper.dpi))),!(k=D.PageBlock)){A.next=60;break}S=R(k),A.prev=8,S.s();case 10:if((s=S.n()).done){A.next=52;break}if("ImageObject"!=(Y=s.value).Type){A.next=17;break}return A.next=15,this.renderImageObject(I,g,C,Y,i,F,N);case 15:A.next=50;break;case 17:if("PathObject"!=Y.Type){A.next=22;break}return A.next=20,this.renderPathObject(I,g,Q,Y,y,h,M,i,o,F,N,C,B);case 20:A.next=50;break;case 22:if("TextObject"!=Y.Type){A.next=27;break}return A.next=25,this.renderTextObject(I,g,B,Y,y,h,Q,o,F,N);case 25:A.next=50;break;case 27:if("CompositeObject"!=Y.Type){A.next=50;break}a=R(E),A.prev=29,a.s();case 31:if((K=a.n()).done){A.next=42;break}if((H=K.value).ID!==Y.ResourceID){A.next=40;break}return L=Y.Alpha,J=Y.Boundary,t=Y.CTM,A.next=39,this.renderLayerByCanvas(I,g,B,Q,C,E,H,!1,L,J,t);case 39:return A.abrupt("break",42);case 40:A.next=31;break;case 42:A.next=47;break;case 44:A.prev=44,A.t0=A.catch(29),a.e(A.t0);case 47:return A.prev=47,a.f(),A.finish(47);case 50:A.next=10;break;case 52:A.next=57;break;case 54:A.prev=54,A.t1=A.catch(8),S.e(A.t1);case 57:return A.prev=57,S.f(),A.finish(57);case 60:case"end":return A.stop()}}),A,this,[[8,54,57,60],[29,44,47,50]])}))),function(A,I,g,B,Q,C,E,D,i,w,G){return o.apply(this,arguments)})},{key:"renderImageObject",value:(D=Q()(w.a.mark((function A(I,g,B,Q,C,E,D){var i,o,N,y,R,h;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(i=Q.Boundary,i=Object(G.converterBox)(i,this.coreHelper.dpi),o=Q.ResourceID){A.next=5;break}return A.abrupt("return");case 5:return(N=Object(G.getMultiMedia)(B,o)).width>0||N.height>0||(y=Object(F.JSGetImageInfoByBase64)(N.FileBase64),N.width=y.width,N.height=y.height,N.FileBase64=y.fileBase64),R=Q.CTM,h=Q.Clips,A.next=11,this.renderImageOnCanvas(I,g,N.FileBase64,N.width,N.height,i,!1,C,null,null,R,E,D,h);case 11:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,Q,C,E){return D.apply(this,arguments)})},{key:"renderImageOnCanvas",value:(C=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i,o,F,N,y,h,M){var U=this;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(!i){A.next=4;break}return A.next=3,this.render.throwWhite(B);case 3:B=A.sent;case 4:return A.abrupt("return",new Promise((function(A,I){var D=E.x,i=E.y,o=new Image;o.src=B,o.width=Q,o.height=C;var w=U;o.onload=function(){if(y){var I=document.createElement("canvas");I.width=E.w,I.height=E.h,I.style.width="".concat(E.w,"px"),I.style.height="".concat(E.h,"px");var B=I.getContext("2d");N&&B.transform(N.a/Q/Object(G.ctmImageScale)(w.coreHelper.dpi),N.b/Q/Object(G.ctmImageScale)(w.coreHelper.dpi),N.c/C/Object(G.ctmImageScale)(w.coreHelper.dpi),N.d/C/Object(G.ctmImageScale)(w.coreHelper.dpi),Object(G.converterDpi)(N.e,w.coreHelper.dpi),Object(G.converterDpi)(N.f,w.coreHelper.dpi)),B.drawImage(o,0,0);var F=document.createElement("canvas"),U=Object(G.converterBox)(y,w.coreHelper.dpi),c=U.w,k=U.h,S=U.x,s=U.y;F.width=c,F.height=k,F.style.width="".concat(c,"px"),F.style.height="".concat(k,"px");var Y=F.getContext("2d");h&&Y.transform(h.a,h.b,h.c,h.d,Object(G.converterDpi)(h.e,w.coreHelper.dpi),Object(G.converterDpi)(h.f,w.coreHelper.dpi)),Y.drawImage(I,D,i),g.drawImage(F,S,s)}else{var a=document.createElement("canvas");a.width=Math.ceil(E.w),a.height=Math.ceil(E.h),a.style.width="".concat(Math.ceil(E.w),"px"),a.style.height="".concat(Math.ceil(E.h),"px");var K=a.getContext("2d");if(M&&M.length>0)for(var H=0;H<M.length;H++)for(var L=M[H].Clip,J=0;J<L.length;J++){var t=L[J].Area,d=void 0;t.CTM?d=t.CTM:N&&(d=N),K.beginPath();var Z,n=R(t.Path.AbbreviatedData);try{for(n.s();!(Z=n.n()).done;){var e=Z.value;if("M"===e.cmd||"S"===e.cmd){var q=e.crds[0],l=e.crds[1];if(d){var W=w.ctmCalPoint(q,l,d);q=W.ctmX,l=W.ctmY}K.moveTo(Object(G.converterDpi)(q,w.coreHelper.dpi),Object(G.converterDpi)(l,w.coreHelper.dpi))}else if("L"===e.cmd){var r=e.crds[0],x=e.crds[1];if(d){var f=w.ctmCalPoint(r,x,d);r=f.ctmX,x=f.ctmY}K.lineTo(Object(G.converterDpi)(r,w.coreHelper.dpi),Object(G.converterDpi)(x,w.coreHelper.dpi))}else if("B"===e.cmd){var b=e.crds[0],V=e.crds[1],p=e.crds[2],m=e.crds[3],T=e.crds[4],X=e.crds[5];if(d){var j=w.ctmCalPoint(b,V,d);b=j.ctmX,V=j.ctmY;var O=w.ctmCalPoint(p,m,d);p=O.ctmX,m=O.ctmY;var z=w.ctmCalPoint(T,X,d);T=z.ctmX,X=z.ctmY}K.bezierCurveTo(Object(G.converterDpi)(b,w.coreHelper.dpi),Object(G.converterDpi)(V,w.coreHelper.dpi),Object(G.converterDpi)(p,w.coreHelper.dpi),Object(G.converterDpi)(m,w.coreHelper.dpi),Object(G.converterDpi)(T,w.coreHelper.dpi),Object(G.converterDpi)(X,w.coreHelper.dpi))}else if("Q"===e.cmd){var u=e.crds[0],P=e.crds[1],v=e.crds[2],_=e.crds[3];if(d){var $=w.ctmCalPoint(u,P,d);u=$.ctmX,P=$.ctmY;var AA=w.ctmCalPoint(v,_,d);v=AA.ctmX,_=AA.ctmY}K.quadraticCurveTo(Object(G.converterDpi)(u,w.coreHelper.dpi),Object(G.converterDpi)(P,w.coreHelper.dpi),Object(G.converterDpi)(v,w.coreHelper.dpi),Object(G.converterDpi)(_,w.coreHelper.dpi))}else"A"===e.cmd||"C"===e.cmd&&K.closePath()}}catch(A){n.e(A)}finally{n.f()}K.clip()}N&&K.transform(N.a/Q/Object(G.ctmImageScale)(w.coreHelper.dpi),N.b/Q/Object(G.ctmImageScale)(w.coreHelper.dpi),N.c/C/Object(G.ctmImageScale)(w.coreHelper.dpi),N.d/C/Object(G.ctmImageScale)(w.coreHelper.dpi),Object(G.converterDpi)(N.e,w.coreHelper.dpi),Object(G.converterDpi)(N.f,w.coreHelper.dpi)),K.drawImage(o,0,0),g.drawImage(a,D,i)}A()}})));case 5:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,Q,E,D,i,o,w,G,F,N,y){return C.apply(this,arguments)})},{key:"ctmCalPoint",value:function(A,I,g){return{ctmX:A*g.a+I*g.c+1*g.e,ctmY:A*g.b+I*g.d+1*g.f}}},{key:"renderPathObject",value:(B=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i,o,F,N,y,h){var M,U,c,k,S,s,Y,a,K,H,L,J,t,d,Z,n,e,q,l,W,r,x,f,b,V,p,m,T,X,j,O,z,u,P,v,_,$,AA,IA,gA,BA,QA,CA,EA,DA,iA,oA;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(M=Q.Boundary){A.next=3;break}return A.abrupt("return");case 3:if(U=1,M=Object(G.converterBox)(M,this.coreHelper.dpi),c=Math.ceil(M.w),k=Math.ceil(M.h),S=M.x,s=M.y,c-0!=0&&k-0!=0){A.next=11;break}return A.abrupt("return");case 11:if(Y=document.createElement("canvas"),a=Y.getContext("2d"),Y.width=c*U,Y.height=k*U,Y.style.width="".concat(c,"px"),Y.style.height="".concat(k,"px"),K=Q.LineWidth,H=Q.AbbreviatedData,L=Q.CTM,J=Q.StrokeColor,t=Q.FillColor,K&&(D=Object(G.converterDpi)(K,this.coreHelper.dpi)),(d=Q.DrawParam)&&(Z=Object(G.getDrawParam)(B,d),(K=Z.LineWidth)&&(D=Object(G.converterDpi)(K,this.coreHelper.dpi)),Z.FillColor&&(t&&t.Value||(t=Z.FillColor)),Z.StrokeColor&&(J&&J.Value||(J=Z.StrokeColor))),L&&a.transform(L.a,L.b,L.c,L.d,Object(G.converterDpi)(L.e,this.coreHelper.dpi),Object(G.converterDpi)(L.f,this.coreHelper.dpi)),n=!1,J&&(J.Value&&(E=Object(G.parseColor)(J.Value)),e=J.axialShd)){n=!0,q=Object(G.parseCtm)(e.StartPoint),l=Object(G.parseCtm)(e.EndPoint),W=a.createLinearGradient(q[0],q[1],l[0],l[1]),r=R(e.Segment);try{for(r.s();!(x=r.n()).done;)(f=x.value)&&W.addColorStop(f.position,Object(G.parseColor)(f.color.Value))}catch(A){r.e(A)}finally{r.f()}a.lineWidth=D,a.strokeStyle=W}if(b=!1,t&&(t.Value&&(C=Object(G.parseColor)(t.Value)),t.Alpha&&0===t.Alpha&&(a.globalAlpha=0),V=t.AxialShd)){b=!0,p=Object(G.parseCtm)(V.StartPoint),m=Object(G.parseCtm)(V.EndPoint),T=a.createLinearGradient(p[0],p[1],m[0],m[1]),X=R(V.Segment);try{for(X.s();!(j=X.n()).done;)(O=j.value)&&T.addColorStop(O.position,Object(G.parseColor)(O.color.Value))}catch(A){X.e(A)}finally{X.f()}a.fillStyle=T}D>0&&!E&&((E=C)||(E="rgb(0, 0, 0)")),Q.Join&&a.setLineJoin(Q["@_Join"]),Q.Cap&&a.setLineCap(Q["@_Cap"]),Q.DashPattern&&(z=Q.DashPattern,u=Object(G.parseCtm)(z),Q.DashOffset&&Q.DashOffset,a.setLineDash([Object(G.converterDpi)(u[0],this.coreHelper.dpi),Object(G.converterDpi)(u[1],this.coreHelper.dpi)])),a.beginPath(),P=R(H);try{for(P.s();!(v=P.n()).done;)"M"===(_=v.value).cmd||"S"===_.cmd?a.moveTo(Object(G.converterDpi)(_.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(_.crds[1],this.coreHelper.dpi)):"L"===_.cmd?a.lineTo(Object(G.converterDpi)(_.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(_.crds[1],this.coreHelper.dpi)):"B"===_.cmd?a.bezierCurveTo(Object(G.converterDpi)(_.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(_.crds[1],this.coreHelper.dpi),Object(G.converterDpi)(_.crds[2],this.coreHelper.dpi),Object(G.converterDpi)(_.crds[3],this.coreHelper.dpi),Object(G.converterDpi)(_.crds[4],this.coreHelper.dpi),Object(G.converterDpi)(_.crds[5],this.coreHelper.dpi)):"Q"===_.cmd?a.quadraticCurveTo(Object(G.converterDpi)(_.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(_.crds[1],this.coreHelper.dpi),Object(G.converterDpi)(_.crds[2],this.coreHelper.dpi),Object(G.converterDpi)(_.crds[3],this.coreHelper.dpi)):"A"===_.cmd||"C"===_.cmd&&a.closePath()}catch(A){P.e(A)}finally{P.f()}if(Q.Stroke&&(n||(a.strokeStyle=E,a.lineWidth=D),a.stroke()),$=t.pattern,!Q.Fill||$?a.fillStyle="none":(b||(a.fillStyle=C),a.fill(Q.Rule)),!$){A.next=52;break}return a.save(),AA=document.createElement("canvas"),IA=AA.getContext("2d"),AA.width=Object(G.converterDpi)($.width,this.coreHelper.dpi),AA.height=Object(G.converterDpi)($.height,this.coreHelper.dpi),A.next=48,this.renderLayerByCanvas(AA,IA,h,B,y,null,$,!1,null,null,null);case 48:gA=a.createPattern(AA,"repeat"),a.fillStyle=gA,a.fillRect(0,0,c,k),a.restore();case 52:F?(BA=document.createElement("canvas"),QA=Object(G.converterBox)(F,this.coreHelper.dpi),CA=QA.w,EA=QA.h,DA=QA.x,iA=QA.y,BA.width=CA*U,BA.height=EA*U,BA.style.width="".concat(CA,"px"),BA.style.height="".concat(EA,"px"),oA=BA.getContext("2d"),N&&oA.transform(N.a,N.b,N.c,N.d,Object(G.converterDpi)(N.e,this.coreHelper.dpi),Object(G.converterDpi)(N.f,this.coreHelper.dpi)),o&&(oA.globalAlpha=o/255),oA.drawImage(Y,S,s),g.drawImage(BA,DA,iA)):g.drawImage(Y,S,s);case 53:case"end":return A.stop()}}),A,this)}))),function(A,I,g,Q,C,E,D,i,o,w,G,F,N){return B.apply(this,arguments)})},{key:"renderTextObject",value:(g=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i,o,N){var y,h,M,U,c,k,S,s,Y,a,K,H,L,J,t,d,Z,n,e,q,l,W,r,x,f,b,V,p,m,T,X,j,O,z,u,P,v,_,$,AA,IA,gA,BA,QA,CA,EA,DA,iA,oA,wA,GA,FA,NA;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(y=1,h=Q.Boundary,h=Object(G.converterBox)(h,this.coreHelper.dpi),M=Q.CTM,U=Q.HScale,c=Q.Font,k=Q.Weight,S=Q.Size>0,M&&!S&&(M={a:-M.a,b:M.b,c:M.c,d:-M.d,e:-M.e,f:-M.f}),s=Object(G.converterDpi)(Math.abs(parseFloat(Q.Size)),this.coreHelper.dpi),Y=Object(G.calTextPoint)(this.coreHelper.dpi,Q.TextCode,Q.CGTransform,M,Q.Boundary,o,N,S),(a=document.createElementNS("http://www.w3.org/2000/svg","svg")).setAttribute("xmlns","http://www.w3.org/2000/svg"),a.setAttribute("version","1.1"),K=Q.FillColor,H=!1,(L=Q.DrawParam)&&(J=Object(G.getDrawParam)(D,L)).FillColor&&(K&&K.Value||(K=J.FillColor)),K&&(K.Value&&(C=Object(G.parseColor)(K.Value)),t=K.alpha,y=t/255,d=K.axialShd)){H=!0,(Z=document.createElementNS("http://www.w3.org/2000/svg","linearGradient")).setAttribute("id","".concat(Q.ID)),Z.setAttribute("x1","0%"),Z.setAttribute("y1","0%"),Z.setAttribute("x2","100%"),Z.setAttribute("y2","100%"),n=R(d.Segment);try{for(n.s();!(e=n.n()).done;)(q=e.value)&&((l=document.createElement("stop")).setAttribute("offset","".concat(100*q.position,"%")),l.setAttribute("style","stop-color:".concat(Object(G.parseColor)(q.color.Value),";stop-opacity:1")),Z.appendChild(l),C=Object(G.parseColor)(q.color.Value))}catch(A){n.e(A)}finally{n.f()}a.appendChild(Z)}Q.Fill||(y=0),W=h.w,r=h.h,x=h.x,f=h.y,b=s,V=s,p=0,M&&(m=M.a,T=M.b,X=M.c,j=M.d,O=m>0?Math.sign(m)*Math.sqrt(m*m+X*X):Math.sqrt(m*m+X*X),z=j>0?Math.sign(j)*Math.sqrt(T*T+j*j):Math.sqrt(T*T+j*j),0==(p=Math.atan2(-T,j))&&0!=m&&1==j||(b*=O,V*=z),0==p&&U-0==1&&(U=m/j)>0&&(b*=U)),N&&(u=N.a,P=N.b,v=N.c,_=N.d,$=u>0?Math.sign(u)*Math.sqrt(u*u+v*v):Math.sqrt(u*u+v*v),AA=_>0?Math.sign(_)*Math.sqrt(P*P+_*_):Math.sqrt(P*P+_*_),0==(p=Math.atan2(-P,_))&&0!=u&&1==_||(b*=$,V*=AA,f*=AA,x*=$,W*=$,r*=AA)),IA=Object(G.getFont)(B,c),gA=R(Y),A.prev=31,gA.s();case 33:if((BA=gA.n()).done){A.next=73;break}if(!(QA=BA.value)||isNaN(QA.x)){A.next=71;break}if(!QA.glyph){A.next=59;break}if(!IA||!IA.face){A.next=57;break}if(CA=Object(F.loadFaceInfo)(IA.face),EA=Object(F.FT_Glyph_Get_Measure)(IA.face,QA.glyph),(DA=this.render.drawGlyph(EA.glyphPath,EA.horiUnderlinePosition,CA.units_per_EM,b,V,E||C,y)).img.setAttribute("style","width: ".concat(Math.ceil(b),"px; height:").concat(Math.ceil(V),"px")),iA="data:image/svg+xml;base64,".concat(Object(F.base64Encode)(DA.img.outerHTML)),0!==p){A.next=48;break}return A.next=46,this.drawTextFromSvg(I,g,iA,Math.ceil(QA.cx),QA.cy-DA.yScale*EA.horiUnderlinePosition-V);case 46:A.next=57;break;case 48:return(oA=document.createElement("canvas")).style.width="".concat(Math.ceil(b),"px"),oA.style.height="".concat(Math.ceil(V),"px"),oA.width=Math.ceil(b),oA.height=Math.ceil(V),wA=oA.getContext("2d"),A.next=56,this.drawTextFromSvg(oA,wA,iA,0,0,p,Math.ceil(b)/2,Math.ceil(V)/2);case 56:g.drawImage(oA,Math.ceil(QA.cx),QA.cy-DA.yScale*EA.horiUnderlinePosition-V);case 57:A.next=71;break;case 59:(GA=document.createElementNS("http://www.w3.org/2000/svg","text")).setAttribute("x",QA.x),GA.setAttribute("y",QA.y),GA.innerHTML=QA.text,FA="",M&&(FA="matrix(".concat(M.a," ").concat(M.b," ").concat(M.c," ").concat(M.d," ").concat(Object(G.converterDpi)(M.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(M.f,this.coreHelper.dpi),")")),N&&(FA="".concat(FA," matrix(").concat(N.a," ").concat(N.b," ").concat(N.c," ").concat(N.d," ").concat(Object(G.converterDpi)(N.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(N.f,this.coreHelper.dpi),")")),U&&(FA="".concat(FA," matrix(").concat(U,", 0, 0, 1, ").concat((1-U)*QA.x,", 0)")),GA.setAttribute("transform",FA),H?GA.setAttribute("fill",C):(GA.setAttribute("fill",E),GA.setAttribute("fill",C),GA.setAttribute("fill-opacity",y)),GA.setAttribute("style","font-weight: ".concat(k,";font-size:").concat(s,"px;font-family: ").concat(Object(G.getFontFamily)(IA),";")),a.appendChild(GA);case 71:A.next=33;break;case 73:A.next=78;break;case 75:A.prev=75,A.t0=A.catch(31),gA.e(A.t0);case 78:return A.prev=78,gA.f(),A.finish(78);case 81:return a.setAttribute("style","overflow:visible;width:".concat(W,"px;height:").concat(r,"px")),NA="data:image/svg+xml;base64,".concat(Object(F.base64Encode)(a.outerHTML)),A.next=85,this.drawTextFromSvg(I,g,NA,x,f);case 85:case"end":return A.stop()}}),A,this,[[31,75,78,81]])}))),function(A,I,B,Q,C,E,D,i,o,w){return g.apply(this,arguments)})},{key:"drawTextFromSvg",value:(I=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return",new Promise((function(A,I){var o=new Image;o.src=B,o.onload=function(){0!=E&&D&&i&&(g.translate(D,i),g.rotate(-E),g.translate(-D,-i)),g.drawImage(o,Q,C),A()}})));case 1:case"end":return A.stop()}}),A)}))),function(A,g,B,Q,C,E,D,i){return I.apply(this,arguments)})}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"OfdThumbnailViewer",(function(){return y}));var B=g(2),Q=g.n(B),C=g(1),E=g.n(C),D=g(20),i=g(27),o=g(35),w=g(34);function G(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return F(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return F(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function F(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var N="selected",y=function(){function A(I,g){Q()(this,A),this.core=null,this.coreHelper=new w.Ofd_Core_Helper(96),this.ofdCanvasRender=new o.OfdCanvasRender(null,this.coreHelper),this.eventBus=g,this.container=I,this.pageDIV=[],this.currentPage=1,this.container&&(this.scroll=Object(D.watchScroll)(this.container,this._scrollUpdate.bind(this)))}return E()(A,[{key:"emptyNode",value:function(A){if(A)for(;A.firstChild;)A.removeChild(A.firstChild)}},{key:"freeThumbnailDocument",value:function(){this.pageDIV=[];var A=this.container;this.emptyNode(A)}},{key:"getScrollAhead",value:function(A){return!(!A.first||1!==A.first.id)||(!A.last||A.last.id!==this.pageDIV.length)&&scroll.down}},{key:"_scrollUpdate",value:function(){0!==this.core.getOFDPageCount(0)&&this.updateThumbnailView()}},{key:"_getVisibleThumbs",value:function(){return Object(D.getVisibleElements)({scrollEl:this.container,views:this.pageDIV})}},{key:"updateThumbnailView",value:function(){var A=this,I=this._getVisibleThumbs();if(0!==I.views.length){var g=this.getScrollAhead(I),B=Object(i.getHighestPriority)(I,this.pageDIV,g);if(B&&B.renderingState===D.RenderingStates.INITIAL){B.renderingState=D.RenderingStates.RUNNING;var Q=B.ring,C=document.createElement("canvas"),E=C.getContext("2d");C.style.height=Q.style.height,C.style.width=Q.style.width,C.width=1*this.coreHelper.pageRenderWidth(0,B.id-1,this.core),C.height=1*this.coreHelper.pageRenderHeight(0,B.id-1,this.core);var o=C.width/C.height,w=document.createElement("img");w.className="thumbnailImage",w.style.width="98px",w.style.height=98/o+"px",this.ofdCanvasRender.renderPageByCanvas(C,E,0,B.id-1).then((function(I){var g=C.toDataURL();w.src=g,B.renderingState=D.RenderingStates.FINISHED,A.updateThumbnailView()})),Q.appendChild(w)}}}},{key:"scrollThumbnailIntoView",value:function(A){if(A){var I=this.pageDIV[A-1];if(I){if(A!==this.currentPage)this.pageDIV[this.currentPage-1].div.classList.remove(N),I.div.classList.add(N);var g=this._getVisibleThumbs(),B=g.first,Q=g.last,C=g.views;if(C.length>0){var E=!1;if(A<=B.id||A>=Q.id)E=!0;else{var i,o=G(C);try{for(o.s();!(i=o.n()).done;){var w=i.value,F=w.id,y=w.percent;if(F===A){E=y<100;break}}}catch(A){o.e(A)}finally{o.f()}}E&&Object(D.scrollIntoView)(I.div,{top:-19})}this.currentPage=A}}}},{key:"setOfdCore",value:function(A){var I=this;if(this.container){this.core&&this.freeThumbnailDocument(),this.core=A,this.ofdCanvasRender.setOfdCore(this.core);for(var g=this.container,B=this,Q=function(A){var Q=I.coreHelper.pageRenderWidth(0,A,I.core)/I.coreHelper.pageRenderHeight(0,A,I.core),C=document.createElement("a");C.onclick=function(){return B.eventBus.dispatch("jumpPage",{source:this,pageIndex:A+1}),!1};var E=document.createElement("div");E.className="thumbnail",E.setAttribute("data-page-number","".concat(A+1));var i=document.createElement("div");i.className="thumbnailSelectionRing";i.style.width="100px",i.style.height=98/Q+2+"px",E.appendChild(i),C.appendChild(E),I.pageDIV[A]={ring:i,div:E,anchor:C,id:A+1,renderingState:D.RenderingStates.INITIAL},g.appendChild(C)},C=0;C<this.core.getOFDPageCount(0);++C)Q(C);this.updateThumbnailView()}}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"PDFSidebar",(function(){return o}));var B=g(2),Q=g.n(B),C=g(1),E=g.n(C),D=g(20),i="pdfSidebarNotification",o=function(){function A(I){var g=I.elements,B=I.ofdViewer,C=I.ofdThumbnailViewer,E=I.eventBus,i=I.l10n;Q()(this,A),this.isOpen=!1,this.active=D.SidebarView.OUTLINE,this.isInitialViewSet=!1,this.onToggled=null,this.ofdViewer=B,this.ofdThumbnailViewer=C,this.outerContainer=g.outerContainer,this.viewerContainer=g.viewerContainer,this.toggleButton=g.toggleButton,this.thumbnailButton=g.thumbnailButton,this.outlineButton=g.outlineButton,this.attachmentsButton=g.attachmentsButton,this.layersButton=g.layersButton,this.signaturesButton=g.signaturesButton,this.thumbnailView=g.thumbnailView,this.outlineView=g.outlineView,this.attachmentsView=g.attachmentsView,this.layersView=g.layersView,this.signaturesView=g.signaturesView,this._outlineOptionsContainer=g.outlineOptionsContainer,this._currentOutlineItemButton=g.currentOutlineItemButton,this.eventBus=E,this.l10n=i,this._addEventListeners()}return E()(A,[{key:"reset",value:function(){this.isInitialViewSet=!1,this._hideUINotification(!0),this.switchView(D.SidebarView.OUTLINE),this.outlineButton.disabled=!1,this.attachmentsButton.disabled=!1,this.layersButton.disabled=!1,this._currentOutlineItemButton.disabled=!0}},{key:"visibleView",get:function(){return this.isOpen?this.active:D.SidebarView.NONE}},{key:"isThumbnailViewVisible",get:function(){return this.isOpen&&this.active===D.SidebarView.THUMBS}},{key:"isOutlineViewVisible",get:function(){return this.isOpen&&this.active===D.SidebarView.OUTLINE}},{key:"isAttachmentsViewVisible",get:function(){return this.isOpen&&this.active===D.SidebarView.ATTACHMENTS}},{key:"isLayersViewVisible",get:function(){return this.isOpen&&this.active===D.SidebarView.LAYERS}},{key:"isSignatureViewVisible",get:function(){return this.isOpen&&this.active===D.SidebarView.SIGNATURES}},{key:"setInitialView",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:D.SidebarView.NONE;this.isInitialViewSet||(this.isInitialViewSet=!0,A!==D.SidebarView.NONE&&A!==D.SidebarView.UNKNOWN&&this._switchView(A,!0)||this._dispatchEvent())}},{key:"switchView",value:function(A){var I=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._switchView(A,I)}},{key:"_switchView",value:function(A){var I=arguments.length>1&&void 0!==arguments[1]&&arguments[1],g=A!==this.active,B=!1;switch(A){case D.SidebarView.NONE:return!!this.isOpen&&(this.close(),!0);case D.SidebarView.THUMBS:this.isOpen&&g&&(B=!0);break;case D.SidebarView.OUTLINE:if(this.outlineButton.disabled)return!1;break;case D.SidebarView.ATTACHMENTS:if(this.attachmentsButton.disabled)return!1;break;case D.SidebarView.LAYERS:if(this.layersButton.disabled)return!1;break;case D.SidebarView.SIGNATURES:if(this.signaturesButton.disabled)return!1;break;default:return!1}this.active=A;var Q=A===D.SidebarView.THUMBS,C=A===D.SidebarView.OUTLINE,E=A===D.SidebarView.ATTACHMENTS,i=A===D.SidebarView.LAYERS,o=A===D.SidebarView.SIGNATURES;return this.thumbnailButton&&this.thumbnailButton.classList.toggle("toggled",Q),this.outlineButton&&this.outlineButton.classList.toggle("toggled",C),this.attachmentsButton&&this.attachmentsButton.classList.toggle("toggled",E),this.layersButton&&this.layersButton.classList.toggle("toggled",i),this.signaturesButton&&this.signaturesButton.classList.toggle("toggled",o),this.thumbnailButton&&this.thumbnailButton.setAttribute("aria-checked",Q),this.outlineButton&&this.outlineButton.setAttribute("aria-checked",C),this.attachmentsButton&&this.attachmentsButton.setAttribute("aria-checked",E),this.layersButton&&this.layersButton.setAttribute("aria-checked",i),this.signaturesButton&&this.signaturesButton.setAttribute("aria-checked",o),this.thumbnailView&&this.thumbnailView.classList.toggle("hidden",!Q),this.outlineView&&this.outlineView.classList.toggle("hidden",!C),this.attachmentsView&&this.attachmentsView.classList.toggle("hidden",!E),this.layersView&&this.layersView.classList.toggle("hidden",!i),this.signaturesView&&this.signaturesView.classList.toggle("hidden",!o),this._outlineOptionsContainer&&this._outlineOptionsContainer.classList.toggle("hidden",!C),I&&!this.isOpen?(this.open(),!0):(B&&(this._updateThumbnailViewer(),this._forceRendering()),g&&this._dispatchEvent(),g)}},{key:"open",value:function(){this.isOpen||(this.isOpen=!0,this.toggleButton.classList.add("toggled"),this.toggleButton.setAttribute("aria-expanded","true"),this.outerContainer.classList.add("sidebarMoving","sidebarOpen"),this.active===D.SidebarView.THUMBS&&this._updateThumbnailViewer(),this._forceRendering(),this._dispatchEvent(),this._hideUINotification())}},{key:"close",value:function(){this.isOpen&&(this.isOpen=!1,this.toggleButton.classList.remove("toggled"),this.toggleButton.setAttribute("aria-expanded","false"),this.outerContainer.classList.add("sidebarMoving"),this.outerContainer.classList.remove("sidebarOpen"),this._forceRendering(),this._dispatchEvent())}},{key:"toggle",value:function(){this.isOpen?this.close():this.open()}},{key:"_dispatchEvent",value:function(){this.eventBus.dispatch("sidebarviewchanged",{source:this,view:this.isOutlineViewVisible})}},{key:"_forceRendering",value:function(){this.onToggled?this.onToggled():(this.ofdViewer.forceRendering(),this.ofdThumbnailViewer&&this.ofdThumbnailViewer.updateThumbnailView())}},{key:"_updateThumbnailViewer",value:function(){var A=this.ofdViewer;this.ofdThumbnailViewer.scrollThumbnailIntoView(A.currentPageNumber)}},{key:"_showUINotification",value:function(){var A=this;this.l10n.get("toggle_sidebar_notification2.title").then((function(I){A.toggleButton.title=I})),this.isOpen||this.toggleButton.classList.add(i)}},{key:"_hideUINotification",value:function(){var A=this,I=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(this.isOpen||I)&&this.toggleButton.classList.remove(i),I&&this.l10n.get("toggle_sidebar.title").then((function(I){A.toggleButton.title=I}))}},{key:"_addEventListeners",value:function(){var A,I,g,B,Q,C,E,i,o,w,G=this;null===(A=this.viewerContainer)||void 0===A||A.addEventListener("transitionend",(function(A){A.target===G.viewerContainer&&G.outerContainer.classList.remove("sidebarMoving")})),null===(I=this.toggleButton)||void 0===I||I.addEventListener("click",(function(){G.toggle()})),null===(g=this.thumbnailButton)||void 0===g||g.addEventListener("click",(function(){G.switchView(D.SidebarView.THUMBS)})),null===(B=this.outlineButton)||void 0===B||B.addEventListener("click",(function(){G.switchView(D.SidebarView.OUTLINE)})),null===(Q=this.outlineButton)||void 0===Q||Q.addEventListener("dblclick",(function(){G.eventBus.dispatch("toggleoutlinetree",{source:G})})),null===(C=this.attachmentsButton)||void 0===C||C.addEventListener("click",(function(){G.switchView(D.SidebarView.ATTACHMENTS)})),null===(E=this.layersButton)||void 0===E||E.addEventListener("click",(function(){G.switchView(D.SidebarView.LAYERS)})),null===(i=this.layersButton)||void 0===i||i.addEventListener("dblclick",(function(){G.eventBus.dispatch("resetlayers",{source:G})})),null===(o=this.signaturesButton)||void 0===o||o.addEventListener("click",(function(){G.switchView(D.SidebarView.SIGNATURES)})),null===(w=this._currentOutlineItemButton)||void 0===w||w.addEventListener("click",(function(){G.eventBus.dispatch("currentoutlineitem",{source:G})}));var F=function(A,I,g){I.disabled=!A,A?G._showUINotification():G.active===g&&G.switchView(D.SidebarView.THUMBS)};this.eventBus._on("outlineloaded",(function(A){F(A.outlineCount,G.outlineButton,D.SidebarView.OUTLINE),A.currentOutlineItemPromise.then((function(A){G.isInitialViewSet&&(G._currentOutlineItemButton.disabled=!A)}))})),this.eventBus._on("attachmentsloaded",(function(A){F(A.attachmentsCount,G.attachmentsButton,D.SidebarView.ATTACHMENTS)})),this.eventBus._on("layersloaded",(function(A){F(A.layersCount,G.layersButton,D.SidebarView.LAYERS)})),this.eventBus._on("presentationmodechanged",(function(A){A.state===D.PresentationModeState.NORMAL&&G.isThumbnailViewVisible&&G._updateThumbnailViewer()}))}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"OverlayManager",(function(){return G}));var B=g(4),Q=g.n(B),C=g(2),E=g.n(C),D=g(1),i=g.n(D),o=g(5),w=g.n(o),G=function(){function A(){E()(this,A),this.overlays=new WeakMap}var I,g,B,C;return i()(A,[{key:"register",value:(C=Q()(w.a.mark((function A(I){var g,B=this,Q=arguments;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(g=Q.length>1&&void 0!==Q[1]&&Q[1],"object"==typeof I){A.next=5;break}throw new Error("Not enough parameters.");case 5:if(!this.overlays.has(I)){A.next=7;break}throw new Error("The overlay is already registered.");case 7:this.overlays.set(I,{canForceClose:g}),"undefined"!=typeof PDFJSDev&&PDFJSDev.test("GENERIC && !SKIP_BABEL")&&I.showModal,I.addEventListener("cancel",(function(A){B.active=null}));case 10:case"end":return A.stop()}}),A,this)}))),function(A){return C.apply(this,arguments)})},{key:"unregister",value:(B=Q()(w.a.mark((function A(I){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(this.overlays.has(I)){A.next=4;break}throw new Error("The overlay does not exist.");case 4:if(this.active!==I){A.next=6;break}throw new Error("The overlay cannot be removed while it is active.");case 6:this.overlays.delete(I);case 7:case"end":return A.stop()}}),A,this)}))),function(A){return B.apply(this,arguments)})},{key:"open",value:(g=Q()(w.a.mark((function A(I){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(this.overlays.has(I)){A.next=4;break}throw new Error("The overlay does not exist.");case 4:if(!this.active){A.next=15;break}if(this.active!==I){A.next=9;break}this.active=null,A.next=15;break;case 9:if(!this.overlays.get(I).canForceClose){A.next=14;break}return A.next=12,this.close();case 12:A.next=15;break;case 14:this.active=null;case 15:this.active=I,"function"==typeof I.showModal&&I.showModal();case 17:case"end":return A.stop()}}),A,this)}))),function(A){return g.apply(this,arguments)})},{key:"close",value:(I=Q()(w.a.mark((function A(){var I,g=arguments;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(I=g.length>0&&void 0!==g[0]?g[0]:this.active,this.overlays.has(I)){A.next=5;break}throw new Error("The overlay does not exist.");case 5:if(this.active){A.next=9;break}throw new Error("The overlay is currently not active.");case 9:if(this.active===I){A.next=11;break}throw new Error("Another overlay is currently active.");case 11:I.close(),this.active=null;case 13:case"end":return A.stop()}}),A,this)}))),function(){return I.apply(this,arguments)})}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"PDFDocumentProperties",(function(){return F}));var B=g(4),Q=g.n(B),C=g(2),E=g.n(C),D=g(1),i=g.n(D),o=g(5),w=g.n(o),G=(g(20),"-"),F=function(){function A(I,g,B,Q){var C=this,D=I.dialog,i=I.fields,o=I.closeButton;E()(this,A),this.dialog=D,this.fields=i,this.overlayManager=g,this.l10n=Q,this.fieldData=null,this.reset(),o.addEventListener("click",this.close.bind(this)),this.overlayManager.register(this.dialog),B._on("pagechanging",(function(A){C._currentPageNumber=A.pageNumber})),B._on("rotationchanging",(function(A){C._pagesRotation=A.pagesRotation})),this._isNonMetricLocale=!0}var I,g;return i()(A,[{key:"open",value:(g=Q()(w.a.mark((function A(){var I,g,B,Q,C,E;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(this.dialog.hidden=!1,this.ofdCore){A.next=3;break}return A.abrupt("return");case 3:if(this.overlayManager.open(this.dialog),I=this._currentPageNumber,g=this._pagesRotation,!this.fieldData||I!==this.fieldData._currentPageNumber||g!==this.fieldData._pagesRotation){A.next=9;break}return this.updateUI(),A.abrupt("return");case 9:B=this.getMetadata(),Q=B.info,B.contentDispositionFilename,C=B.contentLength,E=this.parseFileSize(C),this.fieldData=Object.freeze({fileSize:E,title:Q.Title,author:Q.Author,subject:Q.Subject,keywords:Q.Keywords,creationDate:Q.CreationDate,modificationDate:Q.ModificationDate,creator:Q.Creator,producer:Q.Producer,version:Q.CreatorVersion,pageCount:Q.numPages,pageSize:Q.pageSize,_currentPageNumber:I,_pagesRotation:g}),this.updateUI();case 13:case"end":return A.stop()}}),A,this)}))),function(){return g.apply(this,arguments)})},{key:"close",value:(I=Q()(w.a.mark((function A(){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:this.overlayManager.close(this.dialog);case 1:case"end":return A.stop()}}),A,this)}))),function(){return I.apply(this,arguments)})},{key:"setOfdCore",value:function(A){var I=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.ofdCore&&(this.reset(),this.updateUI(!0)),A&&(this.ofdCore=A,this.url=I)}},{key:"getMetadata",value:function(){if(this.ofdCore)return{info:this.ofdCore.getMetadata(0),contentLength:this.ofdCore.ofd.size}}},{key:"reset",value:function(){this.ofdCore=null,this.url=null,this.fieldData=null,this._currentPageNumber=1,this._pagesRotation=0}},{key:"updateUI",value:function(){var A=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!A&&this.fieldData){if(this.overlayManager.active===this.dialog)for(var I in this.fields){var g=this.fieldData[I];this.fields[I].textContent=g||0===g?g:G}}else for(var B in this.fields)this.fields[B].textContent=G}},{key:"parseFileSize",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,I=A/1024,g=I/1024;if(I)return g>=1?"".concat(g>=1&&(+g.toPrecision(3)).toLocaleString(),"mb(").concat(A.toLocaleString(),"字节)"):"".concat(g<1&&(+I.toPrecision(3)).toLocaleString(),"kb(").concat(A.toLocaleString(),"字节)")}},{key:"parseLinearization",value:function(A){return this.l10n.get("document_properties_linearized_".concat(A?"yes":"no"))}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"Toolbar",(function(){return G}));var B=g(2),Q=g.n(B),C=g(1),E=g.n(C),D=g(20);function i(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return o(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return o(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function o(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var w="visiblePageIsLoading",G=function(){function A(I,g,B){Q()(this,A),this.toolbar=I.container,this.eventBus=g,this.l10n=B,this.buttons=[{element:I.previous,eventName:"previouspage"},{element:I.next,eventName:"nextpage"},{element:I.zoomIn,eventName:"zoomin"},{element:I.zoomOut,eventName:"zoomout"},{element:I.openFile,eventName:"openfile"},{element:I.print,eventName:"print"},{element:I.presentationModeButton,eventName:"presentationmode"},{element:I.download,eventName:"download"},{element:I.viewBookmark,eventName:null}],this.items={numPages:I.numPages,pageNumber:I.pageNumber,scaleSelect:I.scaleSelect,customScaleOption:I.customScaleOption,previous:I.previous,next:I.next,zoomIn:I.zoomIn,zoomOut:I.zoomOut},this._wasLocalized=!1,this.reset(),this._bindListeners()}return E()(A,[{key:"setPageNumber",value:function(A,I){this.pageNumber=A,this.pageLabel=I,this._updateUIState(!1)}},{key:"setPagesCount",value:function(A,I){this.pagesCount=A,this.hasPageLabels=I,this._updateUIState(!0)}},{key:"setPageScale",value:function(A,I){this.pageScaleValue=(A||I).toString(),this.pageScale=I,this._updateUIState(!1)}},{key:"reset",value:function(){this.pageNumber=0,this.pageLabel=null,this.hasPageLabels=!1,this.pagesCount=0,this.pageScaleValue=D.DEFAULT_SCALE_VALUE,this.pageScale=D.DEFAULT_SCALE,this._updateUIState(!0),this.updateLoadingIndicatorState()}},{key:"_bindListeners",value:function(){var A,I=this,g=this.items,B=g.pageNumber,Q=g.scaleSelect,C=this,E=i(this.buttons);try{var o=function(){var g=A.value,B=g.element,Q=g.eventName;null==B||B.addEventListener("click",(function(A){null!==Q&&I.eventBus.dispatch(Q,{source:I})}))};for(E.s();!(A=E.n()).done;)o()}catch(A){E.e(A)}finally{E.f()}B.addEventListener("click",(function(){this.select()})),B.addEventListener("change",(function(){C.eventBus.dispatch("pagenumberchanged",{source:C,value:this.value})})),Q.addEventListener("change",(function(){"custom"!==this.value&&C.eventBus.dispatch("scalechanged",{source:C,value:this.value})})),Q.addEventListener("click",(function(A){var I=A.target;this.value===C.pageScaleValue&&"OPTION"===I.tagName.toUpperCase()&&this.blur()})),Q.oncontextmenu=D.noContextMenuHandler,this.eventBus._on("localized",(function(){I._wasLocalized=!0,I._updateUIState(!0)}))}},{key:"_updateUIState",value:function(){var A=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this._wasLocalized){var I=this.pageNumber,g=this.pagesCount,B=this.pageScaleValue,Q=this.pageScale,C=this.items;A&&(this.hasPageLabels?C.pageNumber.type="text":(C.pageNumber.type="number",this.l10n.get("of_pages",{pagesCount:g}).then((function(A){C.numPages.textContent=A}))),C.pageNumber.max=g),this.hasPageLabels?(C.pageNumber.value=this.pageLabel,this.l10n.get("page_of_pages",{pageNumber:I,pagesCount:g}).then((function(A){C.numPages.textContent=A}))):C.pageNumber.value=I,C.previous.disabled=I<=1,C.next.disabled=I>=g,C.zoomOut.disabled=Q<=D.MIN_SCALE,C.zoomIn.disabled=Q>=D.MAX_SCALE;var E,o=!1,w=i(C.scaleSelect.options);try{for(w.s();!(E=w.n()).done;){var G=E.value;G.value===B?(G.selected=!0,o=!0):G.selected=!1}}catch(A){w.e(A)}finally{w.f()}o||(C.customScaleOption.textContent="".concat(1e4*Q/100,"%"),C.customScaleOption.selected=!0)}}},{key:"updateLoadingIndicatorState",value:function(){var A=arguments.length>0&&void 0!==arguments[0]&&arguments[0],I=this.items.pageNumber;I.classList.toggle(w,A)}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"SecondaryToolbar",(function(){return G}));var B=g(2),Q=g.n(B),C=g(1),E=g.n(C),D=g(20),i=g(42);function o(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return w(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return w(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function w(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var G=function(){function A(I,g,B){Q()(this,A),this.toolbar=I.toolbar,this.toggleButton=I.toggleButton,this.toolbarButtonContainer=I.toolbarButtonContainer,this.buttons=[{element:I.presentationModeButton,eventName:"presentationmode",close:!0},{element:I.openFileButton,eventName:"openfile",close:!0},{element:I.printButton,eventName:"print",close:!0},{element:I.downloadButton,eventName:"download",close:!0},{element:I.viewBookmarkButton,eventName:null,close:!0},{element:I.firstPageButton,eventName:"firstpage",close:!0},{element:I.lastPageButton,eventName:"lastpage",close:!0},{element:I.pageRotateCwButton,eventName:"rotatecw",close:!1},{element:I.pageRotateCcwButton,eventName:"rotateccw",close:!1},{element:I.cursorSelectToolButton,eventName:"switchcursortool",eventDetails:{tool:i.CursorTool.SELECT},close:!0},{element:I.cursorHandToolButton,eventName:"switchcursortool",eventDetails:{tool:i.CursorTool.HAND},close:!0},{element:I.scrollPageButton,eventName:"switchscrollmode",eventDetails:{mode:D.ScrollMode.PAGE},close:!0},{element:I.scrollVerticalButton,eventName:"switchscrollmode",eventDetails:{mode:D.ScrollMode.VERTICAL},close:!0},{element:I.scrollHorizontalButton,eventName:"switchscrollmode",eventDetails:{mode:D.ScrollMode.HORIZONTAL},close:!0},{element:I.scrollWrappedButton,eventName:"switchscrollmode",eventDetails:{mode:D.ScrollMode.WRAPPED},close:!0},{element:I.spreadNoneButton,eventName:"switchspreadmode",eventDetails:{mode:D.SpreadMode.NONE},close:!0},{element:I.spreadOddButton,eventName:"switchspreadmode",eventDetails:{mode:D.SpreadMode.ODD},close:!0},{element:I.spreadEvenButton,eventName:"switchspreadmode",eventDetails:{mode:D.SpreadMode.EVEN},close:!0},{element:I.documentPropertiesButton,eventName:"documentproperties",close:!0},{element:I.closeButton,eventName:"closePage",close:!0}],this.items={firstPage:I.firstPageButton,lastPage:I.lastPageButton,pageRotateCw:I.pageRotateCwButton,pageRotateCcw:I.pageRotateCcwButton},this.mainContainer=g,this.eventBus=B,this.opened=!1,this.containerHeight=null,this.previousContainerHeight=null,this.reset(),this.bindClickListeners(),this.bindCursorToolsListener(I),this.bindScrollModeListener(I),this.bindSpreadModeListener(I),this.eventBus._on("resize",this.setMaxHeight.bind(this))}return E()(A,[{key:"isOpen",get:function(){return this.opened}},{key:"setPageNumber",value:function(A){this.pageNumber=A,this.updateUIState()}},{key:"setPagesCount",value:function(A){this.pagesCount=A,this.updateUIState()}},{key:"reset",value:function(){this.pageNumber=0,this.pagesCount=0,this.updateUIState(),this.eventBus.dispatch("secondarytoolbarreset",{source:this})}},{key:"updateUIState",value:function(){this.items.firstPage&&(this.items.firstPage.disabled=this.pageNumber<=1),this.items.lastPage&&(this.items.lastPage.disabled=this.pageNumber>=this.pagesCount),this.items.pageRotateCw&&(this.items.pageRotateCw.disabled=0===this.pagesCount),this.items.pageRotateCcw&&(this.items.pageRotateCcw.disabled=0===this.pagesCount)}},{key:"bindClickListeners",value:function(){var A,I=this;null===(A=this.toggleButton)||void 0===A||A.addEventListener("click",this.toggle.bind(this));var g,B=o(this.buttons);try{var Q=function(){var A=g.value,B=A.element,Q=A.eventName,C=A.close,E=A.eventDetails;null==B||B.addEventListener("click",(function(A){if(null!==Q){var g={source:I};for(var B in E)g[B]=E[B];I.eventBus.dispatch(Q,g)}C&&I.close()}))};for(B.s();!(g=B.n()).done;)Q()}catch(A){B.e(A)}finally{B.f()}}},{key:"bindCursorToolsListener",value:function(A){var I=A.cursorSelectToolButton,g=A.cursorHandToolButton;this.eventBus._on("cursortoolchanged",(function(A){var B=A.tool,Q=B===i.CursorTool.SELECT,C=B===i.CursorTool.HAND;I.classList.toggle("toggled",Q),g.classList.toggle("toggled",C),I.setAttribute("aria-checked",Q),g.setAttribute("aria-checked",C)}))}},{key:"bindScrollModeListener",value:function(A){var I=this,g=A.scrollPageButton,B=A.scrollVerticalButton,Q=A.scrollHorizontalButton,C=A.scrollWrappedButton,E=A.spreadNoneButton,i=A.spreadOddButton,o=A.spreadEvenButton,w=function(A){var w=A.mode,G=w===D.ScrollMode.PAGE,F=w===D.ScrollMode.VERTICAL,N=w===D.ScrollMode.HORIZONTAL,y=w===D.ScrollMode.WRAPPED;g.classList.toggle("toggled",G),B.classList.toggle("toggled",F),Q.classList.toggle("toggled",N),C.classList.toggle("toggled",y),g.setAttribute("aria-checked",G),B.setAttribute("aria-checked",F),Q.setAttribute("aria-checked",N),C.setAttribute("aria-checked",y);var R=I.pagesCount>15e3;g.disabled=R,B.disabled=R,Q.disabled=R,C.disabled=R,E.disabled=N,i.disabled=N,o.disabled=N};this.eventBus._on("scrollmodechanged",w),this.eventBus._on("secondarytoolbarreset",(function(A){A.source===I&&w({mode:D.ScrollMode.VERTICAL})}))}},{key:"bindSpreadModeListener",value:function(A){var I=this,g=A.spreadNoneButton,B=A.spreadOddButton,Q=A.spreadEvenButton;function C(A){var I=A.mode,C=I===D.SpreadMode.NONE,E=I===D.SpreadMode.ODD,i=I===D.SpreadMode.EVEN;g.classList.toggle("toggled",C),B.classList.toggle("toggled",E),Q.classList.toggle("toggled",i),g.setAttribute("aria-checked",C),B.setAttribute("aria-checked",E),Q.setAttribute("aria-checked",i)}this.eventBus._on("spreadmodechanged",C),this.eventBus._on("secondarytoolbarreset",(function(A){A.source===I&&C({mode:D.SpreadMode.NONE})}))}},{key:"open",value:function(){this.opened||(this.opened=!0,this.setMaxHeight(),this.toggleButton.classList.add("toggled"),this.toggleButton.setAttribute("aria-expanded","true"),this.toolbar.classList.remove("hidden"))}},{key:"close",value:function(){this.opened&&(this.opened=!1,this.toolbar.classList.add("hidden"),this.toggleButton.classList.remove("toggled"),this.toggleButton.setAttribute("aria-expanded","false"))}},{key:"toggle",value:function(){this.opened?this.close():this.open()}},{key:"setMaxHeight",value:function(){this.opened&&(this.containerHeight=this.mainContainer.clientHeight,this.containerHeight!==this.previousContainerHeight&&(this.toolbarButtonContainer.style.maxHeight="".concat(this.containerHeight-D.SCROLLBAR_PADDING,"px"),this.previousContainerHeight=this.containerHeight))}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"CursorTool",(function(){return o})),g.d(I,"PDFCursorTools",(function(){return w}));var B=g(2),Q=g.n(B),C=g(1),E=g.n(C),D=g(43),i=g(20),o={SELECT:0,HAND:1,ZOOM:2},w=function(){function A(I){var g=this,B=I.container,C=I.eventBus,E=I.cursorToolOnLoad,i=void 0===E?o.SELECT:E;Q()(this,A),this.container=B,this.eventBus=C,this.active=o.SELECT,this.activeBeforePresentationMode=null,this.handTool=new D.GrabToPan({element:this.container}),this.addEventListeners(),Promise.resolve().then((function(){g.switchTool(i)}))}return E()(A,[{key:"activeTool",get:function(){return this.active}},{key:"switchTool",value:function(A){var I=this;if(null===this.activeBeforePresentationMode&&A!==this.active){var g=function(){switch(I.active){case o.SELECT:break;case o.HAND:I.handTool.deactivate();case o.ZOOM:}};switch(A){case o.SELECT:g();break;case o.HAND:g(),this.handTool.activate();break;case o.ZOOM:default:return}this.active=A,this.dispatchEvent()}}},{key:"dispatchEvent",value:function(){this.eventBus.dispatch("cursortoolchanged",{source:this,tool:this.active})}},{key:"addEventListeners",value:function(){var A=this;this.eventBus._on("switchcursortool",(function(I){A.switchTool(I.tool)})),this.eventBus._on("presentationmodechanged",(function(I){switch(I.state){case i.PresentationModeState.FULLSCREEN:var g=A.active;A.switchTool(o.SELECT),A.activeBeforePresentationMode=g;break;case i.PresentationModeState.NORMAL:var B=A.activeBeforePresentationMode;A.activeBeforePresentationMode=null,A.switchTool(B)}}))}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"GrabToPan",(function(){return i}));var B=g(2),Q=g.n(B),C=g(1),E=g.n(C),D="grab-to-pan-grab",i=function(){function A(I){Q()(this,A),this.element=I.element,this.document=I.element.ownerDocument,"function"==typeof I.ignoreTarget&&(this.ignoreTarget=I.ignoreTarget),this.onActiveChanged=I.onActiveChanged,this.activate=this.activate.bind(this),this.deactivate=this.deactivate.bind(this),this.toggle=this.toggle.bind(this),this._onMouseDown=this.onMouseDown.bind(this),this._onMouseMove=this.onMouseMove.bind(this),this._endPan=this.endPan.bind(this),(this.overlay=document.createElement("div")).className="grab-to-pan-grabbing"}return E()(A,[{key:"activate",value:function(){this.active||(this.active=!0,this.element.addEventListener("mousedown",this._onMouseDown,!0),this.element.classList.add(D),this.onActiveChanged&&this.onActiveChanged(!0))}},{key:"deactivate",value:function(){this.active&&(this.active=!1,this.element.removeEventListener("mousedown",this._onMouseDown,!0),this._endPan(),this.element.classList.remove(D),this.onActiveChanged&&this.onActiveChanged(!1))}},{key:"toggle",value:function(){this.active?this.deactivate():this.activate()}},{key:"ignoreTarget",value:function(A){return A.matches("a[href], a[href] *, input, textarea, button, button *, select, option")}},{key:"onMouseDown",value:function(A){if(0===A.button&&!this.ignoreTarget(A.target)){if(A.originalTarget)try{A.originalTarget.tagName}catch(A){return}this.scrollLeftStart=this.element.scrollLeft,this.scrollTopStart=this.element.scrollTop,this.clientXStart=A.clientX,this.clientYStart=A.clientY,this.document.addEventListener("mousemove",this._onMouseMove,!0),this.document.addEventListener("mouseup",this._endPan,!0),this.element.addEventListener("scroll",this._endPan,!0),A.preventDefault(),A.stopPropagation();var I=document.activeElement;I&&!I.contains(A.target)&&I.blur()}}},{key:"onMouseMove",value:function(A){if(this.element.removeEventListener("scroll",this._endPan,!0),1&A.buttons){var I=A.clientX-this.clientXStart,g=A.clientY-this.clientYStart,B=this.scrollTopStart-g,Q=this.scrollLeftStart-I;this.element.scrollTo?this.element.scrollTo({top:B,left:Q,behavior:"instant"}):(this.element.scrollTop=B,this.element.scrollLeft=Q),this.overlay.parentNode||document.body.appendChild(this.overlay)}else this._endPan()}},{key:"endPan",value:function(){this.element.removeEventListener("scroll",this._endPan,!0),this.document.removeEventListener("mousemove",this._onMouseMove,!0),this.document.removeEventListener("mouseup",this._endPan,!0),this.overlay.remove()}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"Print",(function(){return M}));var B=g(4),Q=g.n(B),C=g(2),E=g.n(C),D=g(1),i=g.n(D),o=g(5),w=g.n(o),G=(g(35),g(28)),F=g(34),N=g(45),y=g.n(N);function R(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return h(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return h(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function h(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var M=function(){function A(I,g,B,Q,C){E()(this,A),this.coreHelper=new F.Ofd_Core_Helper(40),this.dialog=I||document.getElementById("printServiceDialog"),this.overlayManager=g,this.l10n=B,this.ofdRender=new G.Ofd_Render(null,this.coreHelper),document.getElementById("printCancel").addEventListener("click",this.close.bind(this)),this.overlayManager.register(this.dialog),this.progressBar=this.dialog.querySelector("progress"),this.progressPerc=this.dialog.querySelector(".relative-progress"),this.abort=!1,this.eventBus=Q,this.callback=C}var I,g,B;return i()(A,[{key:"setOfdCore",value:function(A){this.core=A,this.ofdRender.setOfdCore(this.core)}},{key:"close",value:(B=Q()(w.a.mark((function A(){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:this.abort=!0,this.overlayManager.close(this.dialog);case 2:case"end":return A.stop()}}),A,this)}))),function(){return B.apply(this,arguments)})},{key:"open",value:(g=Q()(w.a.mark((function A(){var I=this;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(this.core){A.next=2;break}return A.abrupt("return");case 2:return this.abort=!1,this.overlayManager.open(this.dialog),A.next=6,this.renderProgress(0);case 6:setTimeout((function(){I.prepare().then((function(A){if(A&&A.length>0){I.close();var g,B=document.createElement("div"),Q=R(A);try{for(Q.s();!(g=Q.n()).done;){var C=g.value;B.appendChild(C)}}catch(A){Q.e(A)}finally{Q.f()}if(I.callback&&I.eventBus)return void I.eventBus.dispatch("printCallback",{source:I,html:B});y()({printable:B,type:"html",scanStyles:!1})}}))}),100);case 7:case"end":return A.stop()}}),A,this)}))),function(){return g.apply(this,arguments)})},{key:"prepare",value:(I=Q()(w.a.mark((function A(){var I=this;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return",new Promise(function(){var A=Q()(w.a.mark((function A(g,B){var Q,C,E,D,i;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:Q=[],C=0;case 2:if(!(C<I.core.getOFDPageCount(0))||I.abort){A.next=21;break}return E=785/I.core.pageWidth(0,C)*25.4,I.ofdRender.setDpi(E),(D=document.createElement("canvas")).style.width="794px",D.style.height="1123px",(i=document.createElement("div")).style.width="794px",i.style.height="1123px",i.style.position="relative",i.appendChild(D),A.next=15,I.ofdRender.renderPage(i,0,C);case 15:return Q.push(i),A.next=18,I.renderProgress(C+1);case 18:C++,A.next=2;break;case 21:I.abort&&g(),g(Q);case 23:case"end":return A.stop()}}),A)})));return function(I,g){return A.apply(this,arguments)}}()));case 1:case"end":return A.stop()}}),A)}))),function(){return I.apply(this,arguments)})},{key:"renderProgress",value:function(A){var I=this;return new Promise((function(g,B){var Q=Math.round(100*A/I.core.getOFDPageCount(0));I.progressBar.value=Q,I.l10n.get("print_progress_percent",{progress:Q}).then((function(A){I.progressPerc.textContent=A})),setTimeout((function(){g()}),100)}))}}]),A}()},function(A,I,g){var B;window,B=function(){return function(A){var I={};function g(B){if(I[B])return I[B].exports;var Q=I[B]={i:B,l:!1,exports:{}};return A[B].call(Q.exports,Q,Q.exports,g),Q.l=!0,Q.exports}return g.m=A,g.c=I,g.d=function(A,I,B){g.o(A,I)||Object.defineProperty(A,I,{enumerable:!0,get:B})},g.r=function(A){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})},g.t=function(A,I){if(1&I&&(A=g(A)),8&I)return A;if(4&I&&"object"==typeof A&&A&&A.__esModule)return A;var B=Object.create(null);if(g.r(B),Object.defineProperty(B,"default",{enumerable:!0,value:A}),2&I&&"string"!=typeof A)for(var Q in A)g.d(B,Q,function(I){return A[I]}.bind(null,Q));return B},g.n=function(A){var I=A&&A.__esModule?function(){return A.default}:function(){return A};return g.d(I,"a",I),I},g.o=function(A,I){return Object.prototype.hasOwnProperty.call(A,I)},g.p="",g(g.s=0)}({"./src/index.js":
2
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */A.exports=Q=function(){return I},A.exports.__esModule=!0,A.exports.default=A.exports;var I={},g=Object.prototype,C=g.hasOwnProperty,E="function"==typeof Symbol?Symbol:{},D=E.iterator||"@@iterator",i=E.asyncIterator||"@@asyncIterator",o=E.toStringTag||"@@toStringTag";function w(A,I,g){return Object.defineProperty(A,I,{value:g,enumerable:!0,configurable:!0,writable:!0}),A[I]}try{w({},"")}catch(A){w=function(A,I,g){return A[I]=g}}function G(A,I,g,B){var Q=I&&I.prototype instanceof y?I:y,C=Object.create(Q.prototype),E=new H(B||[]);return C._invoke=function(A,I,g){var B="suspendedStart";return function(Q,C){if("executing"===B)throw new Error("Generator is already running");if("completed"===B){if("throw"===Q)throw C;return J()}for(g.method=Q,g.arg=C;;){var E=g.delegate;if(E){var D=Y(E,g);if(D){if(D===N)continue;return D}}if("next"===g.method)g.sent=g._sent=g.arg;else if("throw"===g.method){if("suspendedStart"===B)throw B="completed",g.arg;g.dispatchException(g.arg)}else"return"===g.method&&g.abrupt("return",g.arg);B="executing";var i=F(A,I,g);if("normal"===i.type){if(B=g.done?"completed":"suspendedYield",i.arg===N)continue;return{value:i.arg,done:g.done}}"throw"===i.type&&(B="completed",g.method="throw",g.arg=i.arg)}}}(A,g,E),C}function F(A,I,g){try{return{type:"normal",arg:A.call(I,g)}}catch(A){return{type:"throw",arg:A}}}I.wrap=G;var N={};function y(){}function R(){}function h(){}var M={};w(M,D,(function(){return this}));var U=Object.getPrototypeOf,c=U&&U(U(L([])));c&&c!==g&&C.call(c,D)&&(M=c);var k=h.prototype=y.prototype=Object.create(M);function S(A){["next","throw","return"].forEach((function(I){w(A,I,(function(A){return this._invoke(I,A)}))}))}function s(A,I){function g(Q,E,D,i){var o=F(A[Q],A,E);if("throw"!==o.type){var w=o.arg,G=w.value;return G&&"object"==B(G)&&C.call(G,"__await")?I.resolve(G.__await).then((function(A){g("next",A,D,i)}),(function(A){g("throw",A,D,i)})):I.resolve(G).then((function(A){w.value=A,D(w)}),(function(A){return g("throw",A,D,i)}))}i(o.arg)}var Q;this._invoke=function(A,B){function C(){return new I((function(I,Q){g(A,B,I,Q)}))}return Q=Q?Q.then(C,C):C()}}function Y(A,I){var g=A.iterator[I.method];if(void 0===g){if(I.delegate=null,"throw"===I.method){if(A.iterator.return&&(I.method="return",I.arg=void 0,Y(A,I),"throw"===I.method))return N;I.method="throw",I.arg=new TypeError("The iterator does not provide a 'throw' method")}return N}var B=F(g,A.iterator,I.arg);if("throw"===B.type)return I.method="throw",I.arg=B.arg,I.delegate=null,N;var Q=B.arg;return Q?Q.done?(I[A.resultName]=Q.value,I.next=A.nextLoc,"return"!==I.method&&(I.method="next",I.arg=void 0),I.delegate=null,N):Q:(I.method="throw",I.arg=new TypeError("iterator result is not an object"),I.delegate=null,N)}function a(A){var I={tryLoc:A[0]};1 in A&&(I.catchLoc=A[1]),2 in A&&(I.finallyLoc=A[2],I.afterLoc=A[3]),this.tryEntries.push(I)}function K(A){var I=A.completion||{};I.type="normal",delete I.arg,A.completion=I}function H(A){this.tryEntries=[{tryLoc:"root"}],A.forEach(a,this),this.reset(!0)}function L(A){if(A){var I=A[D];if(I)return I.call(A);if("function"==typeof A.next)return A;if(!isNaN(A.length)){var g=-1,B=function I(){for(;++g<A.length;)if(C.call(A,g))return I.value=A[g],I.done=!1,I;return I.value=void 0,I.done=!0,I};return B.next=B}}return{next:J}}function J(){return{value:void 0,done:!0}}return R.prototype=h,w(k,"constructor",h),w(h,"constructor",R),R.displayName=w(h,o,"GeneratorFunction"),I.isGeneratorFunction=function(A){var I="function"==typeof A&&A.constructor;return!!I&&(I===R||"GeneratorFunction"===(I.displayName||I.name))},I.mark=function(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,h):(A.__proto__=h,w(A,o,"GeneratorFunction")),A.prototype=Object.create(k),A},I.awrap=function(A){return{__await:A}},S(s.prototype),w(s.prototype,i,(function(){return this})),I.AsyncIterator=s,I.async=function(A,g,B,Q,C){void 0===C&&(C=Promise);var E=new s(G(A,g,B,Q),C);return I.isGeneratorFunction(g)?E:E.next().then((function(A){return A.done?A.value:E.next()}))},S(k),w(k,o,"Generator"),w(k,D,(function(){return this})),w(k,"toString",(function(){return"[object Generator]"})),I.keys=function(A){var I=[];for(var g in A)I.push(g);return I.reverse(),function g(){for(;I.length;){var B=I.pop();if(B in A)return g.value=B,g.done=!1,g}return g.done=!0,g}},I.values=L,H.prototype={constructor:H,reset:function(A){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(K),!A)for(var I in this)"t"===I.charAt(0)&&C.call(this,I)&&!isNaN(+I.slice(1))&&(this[I]=void 0)},stop:function(){this.done=!0;var A=this.tryEntries[0].completion;if("throw"===A.type)throw A.arg;return this.rval},dispatchException:function(A){if(this.done)throw A;var I=this;function g(g,B){return E.type="throw",E.arg=A,I.next=g,B&&(I.method="next",I.arg=void 0),!!B}for(var B=this.tryEntries.length-1;B>=0;--B){var Q=this.tryEntries[B],E=Q.completion;if("root"===Q.tryLoc)return g("end");if(Q.tryLoc<=this.prev){var D=C.call(Q,"catchLoc"),i=C.call(Q,"finallyLoc");if(D&&i){if(this.prev<Q.catchLoc)return g(Q.catchLoc,!0);if(this.prev<Q.finallyLoc)return g(Q.finallyLoc)}else if(D){if(this.prev<Q.catchLoc)return g(Q.catchLoc,!0)}else{if(!i)throw new Error("try statement without catch or finally");if(this.prev<Q.finallyLoc)return g(Q.finallyLoc)}}}},abrupt:function(A,I){for(var g=this.tryEntries.length-1;g>=0;--g){var B=this.tryEntries[g];if(B.tryLoc<=this.prev&&C.call(B,"finallyLoc")&&this.prev<B.finallyLoc){var Q=B;break}}Q&&("break"===A||"continue"===A)&&Q.tryLoc<=I&&I<=Q.finallyLoc&&(Q=null);var E=Q?Q.completion:{};return E.type=A,E.arg=I,Q?(this.method="next",this.next=Q.finallyLoc,N):this.complete(E)},complete:function(A,I){if("throw"===A.type)throw A.arg;return"break"===A.type||"continue"===A.type?this.next=A.arg:"return"===A.type?(this.rval=this.arg=A.arg,this.method="return",this.next="end"):"normal"===A.type&&I&&(this.next=I),N},finish:function(A){for(var I=this.tryEntries.length-1;I>=0;--I){var g=this.tryEntries[I];if(g.finallyLoc===A)return this.complete(g.completion,g.afterLoc),K(g),N}},catch:function(A){for(var I=this.tryEntries.length-1;I>=0;--I){var g=this.tryEntries[I];if(g.tryLoc===A){var B=g.completion;if("throw"===B.type){var Q=B.arg;K(g)}return Q}}throw new Error("illegal catch attempt")},delegateYield:function(A,I,g){return this.delegate={iterator:L(A),resultName:I,nextLoc:g},"next"===this.method&&(this.arg=void 0),N}},I}A.exports=Q,A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){function g(I){return A.exports=g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},A.exports.__esModule=!0,A.exports.default=A.exports,g(I)}A.exports=g,A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){"use strict";document.webL10n=function(A,I,g){var B={},Q="",C="textContent",E="",D={},i="loading";function o(A,I,g){I=I||function(A){},g=g||function(){};var B=new XMLHttpRequest;B.open("GET",A,true),B.overrideMimeType&&B.overrideMimeType("text/plain; charset=utf-8"),B.onreadystatechange=function(){4==B.readyState&&(200==B.status||0===B.status?I(B.responseText):g())},B.onerror=g,B.ontimeout=g;try{B.send(null)}catch(A){g()}}function w(A,I,g,E){var D=A.replace(/[^\/]*$/,"")||"./";function i(A){return A.lastIndexOf("\\")<0?A:A.replace(/\\\\/g,"\\").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\{/g,"{").replace(/\\}/g,"}").replace(/\\"/g,'"').replace(/\\'/g,"'")}o(A,(function(A){Q+=A,function(A,g){var B={},Q=/^\s*|\s*$/,C=/^\s*#|^\s*$/,E=/^\s*\[(.*)\]\s*$/,w=/^\s*@import\s+url\((.*)\)\s*$/i,G=/^([^=\s]*)\s*=\s*(.+)$/;function F(A,g,o){var F=A.replace(Q,"").split(/[\r\n]+/),y="*",R=I.split("-",1)[0],h=!1,M="";!function A(){for(;;){if(!F.length)return void o();var Q=F.shift();if(!C.test(Q)){if(g){if(M=E.exec(Q)){y=M[1].toLowerCase(),h="*"!==y&&y!==I&&y!==R;continue}if(h)continue;if(M=w.exec(Q))return void N(D+M[1],A)}var U=Q.match(G);U&&3==U.length&&(B[U[1]]=i(U[2]))}}}()}function N(A,I){o(A,(function(A){F(A,!1,I)}),(function(){I()}))}F(A,!0,(function(){g(B)}))}(A,(function(A){for(var I in A){var Q,E,D=I.lastIndexOf(".");D>0?(Q=I.substring(0,D),E=I.substring(D+1)):(Q=I,E=C),B[Q]||(B[Q]={}),B[Q][E]=A[I]}g&&g()}))}),E)}function G(A,g){A&&(A=A.toLowerCase()),g=g||function(){},B={},Q="",E="",E=A;var C=I.querySelectorAll('link[type="application/l10n"]'),D=C.length;if(0!==D){var o,G,F=0;G=function(){++F>=D&&(g(),i="complete")};for(var N=0;N<D;N++){new M(C[N]).load(A,G)}}else{var y=(o=I.querySelector('script[type="application/l10n"]'))?JSON.parse(o.innerHTML):null;if(y&&y.locales&&y.default_locale){if(!(B=y.locales[A])){var R=y.default_locale.toLowerCase();for(var h in y.locales){if((h=h.toLowerCase())===A){B=y.locales[A];break}h===R&&(B=y.locales[R])}}g()}i="complete"}function M(A){var I=A.href;this.load=function(A,g){w(I,A,g,(function(){E="",g()}))}}}function F(A,I,g){var Q=B[A];if(!Q){if(!g)return null;Q=g}var C={};for(var E in Q){var D=Q[E];D=y(D=N(D,I,A,E),I,A),C[E]=D}return C}function N(A,I,g,Q){var C=/\{\[\s*([a-zA-Z]+)\(([a-zA-Z]+)\)\s*\]\}/.exec(A);if(!C||!C.length)return A;var E,i=C[1],o=C[2];(I&&o in I?E=I[o]:o in B&&(E=B[o]),i in D)&&(A=(0,D[i])(A,E,g,Q));return A}function y(A,I,g){return A.replace(/\{\{\s*(.+?)\s*\}\}/g,(function(A,g){return I&&g in I?I[g]:g in B?B[g]:A}))}function R(A){var g=function(A){if(!A)return{};var I=A.getAttribute("data-l10n-id"),g=A.getAttribute("data-l10n-args"),B={};if(g)try{B=JSON.parse(g)}catch(A){}return{id:I,args:B}}(A);if(g.id){var B=F(g.id,g.args);if(B){if(B[C]){if(0===function(A){if(A.children)return A.children.length;if(void 0!==A.childElementCount)return A.childElementCount;for(var I=0,g=0;g<A.childNodes.length;g++)I+=1===A.nodeType?1:0;return I}(A))A[C]=B[C];else{for(var Q=A.childNodes,E=!1,D=0,i=Q.length;D<i;D++)3===Q[D].nodeType&&/\S/.test(Q[D].nodeValue)&&(E?Q[D].nodeValue="":(Q[D].nodeValue=B[C],E=!0));if(!E){var o=I.createTextNode(B[C]);A.insertBefore(o,A.firstChild)}}delete B[C]}for(var w in B)A[w]=B[w]}}}return D.plural=function(A,I,g,Q){var i=parseFloat(I);if(isNaN(i))return A;if(Q!=C)return A;D._pluralRules||(D._pluralRules=function(A){function I(A,I){return-1!==I.indexOf(A)}function g(A,I,g){return I<=A&&A<=g}var B={0:function(A){return"other"},1:function(A){return g(A%100,3,10)?"few":0===A?"zero":g(A%100,11,99)?"many":2==A?"two":1==A?"one":"other"},2:function(A){return 0!==A&&A%10==0?"many":2==A?"two":1==A?"one":"other"},3:function(A){return 1==A?"one":"other"},4:function(A){return g(A,0,1)?"one":"other"},5:function(A){return g(A,0,2)&&2!=A?"one":"other"},6:function(A){return 0===A?"zero":A%10==1&&A%100!=11?"one":"other"},7:function(A){return 2==A?"two":1==A?"one":"other"},8:function(A){return g(A,3,6)?"few":g(A,7,10)?"many":2==A?"two":1==A?"one":"other"},9:function(A){return 0===A||1!=A&&g(A%100,1,19)?"few":1==A?"one":"other"},10:function(A){return g(A%10,2,9)&&!g(A%100,11,19)?"few":A%10!=1||g(A%100,11,19)?"other":"one"},11:function(A){return g(A%10,2,4)&&!g(A%100,12,14)?"few":A%10==0||g(A%10,5,9)||g(A%100,11,14)?"many":A%10==1&&A%100!=11?"one":"other"},12:function(A){return g(A,2,4)?"few":1==A?"one":"other"},13:function(A){return g(A%10,2,4)&&!g(A%100,12,14)?"few":1!=A&&g(A%10,0,1)||g(A%10,5,9)||g(A%100,12,14)?"many":1==A?"one":"other"},14:function(A){return g(A%100,3,4)?"few":A%100==2?"two":A%100==1?"one":"other"},15:function(A){return 0===A||g(A%100,2,10)?"few":g(A%100,11,19)?"many":1==A?"one":"other"},16:function(A){return A%10==1&&11!=A?"one":"other"},17:function(A){return 3==A?"few":0===A?"zero":6==A?"many":2==A?"two":1==A?"one":"other"},18:function(A){return 0===A?"zero":g(A,0,2)&&0!==A&&2!=A?"one":"other"},19:function(A){return g(A,2,10)?"few":g(A,0,1)?"one":"other"},20:function(A){return!g(A%10,3,4)&&A%10!=9||g(A%100,10,19)||g(A%100,70,79)||g(A%100,90,99)?A%1e6==0&&0!==A?"many":A%10!=2||I(A%100,[12,72,92])?A%10!=1||I(A%100,[11,71,91])?"other":"one":"two":"few"},21:function(A){return 0===A?"zero":1==A?"one":"other"},22:function(A){return g(A,0,1)||g(A,11,99)?"one":"other"},23:function(A){return g(A%10,1,2)||A%20==0?"one":"other"},24:function(A){return g(A,3,10)||g(A,13,19)?"few":I(A,[2,12])?"two":I(A,[1,11])?"one":"other"}},Q={af:3,ak:4,am:4,ar:1,asa:3,az:0,be:11,bem:3,bez:3,bg:3,bh:4,bm:0,bn:3,bo:0,br:20,brx:3,bs:11,ca:3,cgg:3,chr:3,cs:12,cy:17,da:3,de:3,dv:3,dz:0,ee:3,el:3,en:3,eo:3,es:3,et:3,eu:3,fa:0,ff:5,fi:3,fil:4,fo:3,fr:5,fur:3,fy:3,ga:8,gd:24,gl:3,gsw:3,gu:3,guw:4,gv:23,ha:3,haw:3,he:2,hi:4,hr:11,hu:0,id:0,ig:0,ii:0,is:3,it:3,iu:7,ja:0,jmc:3,jv:0,ka:0,kab:5,kaj:3,kcg:3,kde:0,kea:0,kk:3,kl:3,km:0,kn:0,ko:0,ksb:3,ksh:21,ku:3,kw:7,lag:18,lb:3,lg:3,ln:4,lo:0,lt:10,lv:6,mas:3,mg:4,mk:16,ml:3,mn:3,mo:9,mr:3,ms:0,mt:15,my:0,nah:3,naq:7,nb:3,nd:3,ne:3,nl:3,nn:3,no:3,nr:3,nso:4,ny:3,nyn:3,om:3,or:3,pa:3,pap:3,pl:13,ps:3,pt:3,rm:3,ro:9,rof:3,ru:11,rwk:3,sah:0,saq:3,se:7,seh:3,ses:0,sg:0,sh:11,shi:19,sk:12,sl:14,sma:7,smi:7,smj:7,smn:7,sms:7,sn:3,so:3,sq:3,sr:11,ss:3,ssy:3,st:3,sv:3,sw:3,syr:3,ta:3,te:3,teo:3,th:0,ti:4,tig:3,tk:3,tl:4,tn:3,to:0,tr:0,ts:3,tzm:22,uk:11,ur:3,ve:3,vi:0,vun:3,wa:4,wae:3,wo:0,xh:3,xog:3,yo:0,zh:0,zu:3}[A.replace(/-.*$/,"")];return Q in B?B[Q]:function(){return"other"}}(E));var o="["+D._pluralRules(i)+"]";return 0===i&&g+"[zero]"in B?A=B[g+"[zero]"][Q]:1==i&&g+"[one]"in B?A=B[g+"[one]"][Q]:2==i&&g+"[two]"in B?A=B[g+"[two]"][Q]:g+o in B?A=B[g+o][Q]:g+"[other]"in B&&(A=B[g+"[other]"][Q]),A},{get:function(A,I,g){var B,Q=A.lastIndexOf("."),E=C;Q>0&&(E=A.substring(Q+1),A=A.substring(0,Q)),g&&((B={})[E]=g);var D=F(A,I,B);return D&&E in D?D[E]:"{{"+A+"}}"},getData:function(){return B},getText:function(){return Q},getLanguage:function(){return E},setLanguage:function(A,I){G(A,(function(){I&&I()}))},getDirection:function(){var A=E.split("-",1)[0];return["ar","he","fa","ps","ur"].indexOf(A)>=0?"rtl":"ltr"},translate:function(A){for(var g=function(A){return A?A.querySelectorAll("*[data-l10n-id]"):[]}(A=A||I.documentElement),B=g.length,Q=0;Q<B;Q++)R(g[Q]);R(A)},getReadyState:function(){return i},ready:function(g){g&&("complete"==i||"interactive"==i?A.setTimeout((function(){g()})):I.addEventListener&&I.addEventListener("localized",(function A(){I.removeEventListener("localized",A),g()})))}}}(window,document)},function(A,I,g){"use strict";g.r(I),g.d(I,"fixupLangCode",(function(){return w})),g.d(I,"getL10nFallback",(function(){return i})),g.d(I,"NullL10n",(function(){return F}));var B=g(4),Q=g.n(B),C=g(5),E=g.n(C),D={of_pages:"of {{pagesCount}}",page_of_pages:"({{pageNumber}} of {{pagesCount}})",document_properties_kb:"{{size_kb}} KB ({{size_b}} bytes)",document_properties_mb:"{{size_mb}} MB ({{size_b}} bytes)",document_properties_date_string:"{{date}}, {{time}}",document_properties_page_size_unit_inches:"in",document_properties_page_size_unit_millimeters:"mm",document_properties_page_size_orientation_portrait:"portrait",document_properties_page_size_orientation_landscape:"landscape",document_properties_page_size_name_a3:"A3",document_properties_page_size_name_a4:"A4",document_properties_page_size_name_letter:"Letter",document_properties_page_size_name_legal:"Legal",document_properties_page_size_dimension_string:"{{width}} × {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})",document_properties_linearized_yes:"Yes",document_properties_linearized_no:"No",print_progress_percent:"{{progress}}%","toggle_sidebar.title":"Toggle Sidebar","toggle_sidebar_notification2.title":"Toggle Sidebar (document contains outline/attachments/layers)",additional_layers:"Additional Layers",page_landmark:"Page {{page}}",thumb_page_title:"Page {{page}}",thumb_page_canvas:"Thumbnail of Page {{page}}",find_reached_top:"Reached top of document, continued from bottom",find_reached_bottom:"Reached end of document, continued from top","find_match_count[one]":"{{current}} of {{total}} match","find_match_count[other]":"{{current}} of {{total}} matches","find_match_count_limit[one]":"More than {{limit}} match","find_match_count_limit[other]":"More than {{limit}} matches",find_not_found:"Phrase not found",error_version_info:"PDF.js v{{version}} (build: {{build}})",error_message:"Message: {{message}}",error_stack:"Stack: {{stack}}",error_file:"File: {{file}}",error_line:"Line: {{line}}",rendering_error:"An error occurred while rendering the page.",page_scale_width:"Page Width",page_scale_fit:"Page Fit",page_scale_auto:"Automatic Zoom",page_scale_actual:"Actual Size",page_scale_percent:"{{scale}}%",loading:"Loading…",loading_error:"An error occurred while loading the PDF.",invalid_file_error:"Invalid or corrupted PDF file.",missing_file_error:"Missing PDF file.",unexpected_response_error:"Unexpected server response.",printing_not_supported:"Warning: Printing is not fully supported by this browser.",printing_not_ready:"Warning: The PDF is not fully loaded for printing.",web_fonts_disabled:"Web fonts are disabled: unable to use embedded PDF fonts."};function i(A,I){switch(A){case"find_match_count":A="find_match_count[".concat(1===I.total?"one":"other","]");break;case"find_match_count_limit":A="find_match_count_limit[".concat(1===I.limit?"one":"other","]")}return D[A]||""}var o={en:"en-US",es:"es-ES",fy:"fy-NL",ga:"ga-IE",gu:"gu-IN",hi:"hi-IN",hy:"hy-AM",nb:"nb-NO",ne:"ne-NP",nn:"nn-NO",pa:"pa-IN",pt:"pt-PT",sv:"sv-SE",zh:"zh-CN"};function w(A){return o[!!A&&A.toLowerCase()]||A}function G(A,I){return I?A.replace(/\{\{\s*(\w+)\s*\}\}/g,(function(A,g){return g in I?I[g]:"{{"+g+"}}"})):A}var F={getLanguage:function(){return Q()(E.a.mark((function A(){return E.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return","en-us");case 1:case"end":return A.stop()}}),A)})))()},getDirection:function(){return Q()(E.a.mark((function A(){return E.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return","ltr");case 1:case"end":return A.stop()}}),A)})))()},get:function(A){var I=arguments;return Q()(E.a.mark((function g(){var B,Q;return E.a.wrap((function(g){for(;;)switch(g.prev=g.next){case 0:return B=I.length>1&&void 0!==I[1]?I[1]:null,Q=I.length>2&&void 0!==I[2]?I[2]:i(A,B),g.abrupt("return",G(Q,B));case 3:case"end":return g.stop()}}),g)})))()},translate:function(A){return Q()(E.a.mark((function A(){return E.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:case"end":return A.stop()}}),A)})))()}}},function(A,I,g){"use strict";g.r(I),g.d(I,"AutomationEventBus",(function(){return S})),g.d(I,"EventBus",(function(){return k})),g.d(I,"waitOnEventOrTimeout",(function(){return c})),g.d(I,"WaitOnType",(function(){return U}));var B=g(11),Q=g.n(B),C=g(14),E=g.n(C),D=g(16),i=g.n(D),o=g(13),w=g.n(o),G=g(2),F=g.n(G),N=g(1),y=g.n(N);function R(A){var I=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(A){return!1}}();return function(){var g,B=w()(A);if(I){var Q=w()(this).constructor;g=Reflect.construct(B,arguments,Q)}else g=B.apply(this,arguments);return i()(this,g)}}function h(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return M(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return M(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function M(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var U={EVENT:"event",TIMEOUT:"timeout"};function c(A){var I=A.target,g=A.name,B=A.delay,Q=void 0===B?0:B;return new Promise((function(A,B){if("object"!=typeof I||!g||"string"!=typeof g||!(Number.isInteger(Q)&&Q>=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");function C(B){I instanceof k?I._off(g,E):I.removeEventListener(g,E),i&&clearTimeout(i),A(B)}var E=C.bind(null,U.EVENT);I instanceof k?I._on(g,E):I.addEventListener(g,E);var D=C.bind(null,U.TIMEOUT),i=setTimeout(D,Q)}))}var k=function(){function A(){F()(this,A),this._listeners=Object.create(null)}return y()(A,[{key:"on",value:function(A,I){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._on(A,I,{external:!0,once:g&&g.once})}},{key:"off",value:function(A,I){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._off(A,I,{external:!0,once:g&&g.once})}},{key:"dispatch",value:function(A,I){var g=this._listeners[A];if(g&&0!==g.length){var B,Q,C=h(g.slice(0));try{for(C.s();!(Q=C.n()).done;){var E=Q.value,D=E.listener,i=E.external;E.once&&this._off(A,D),i?(B||(B=[]),B.push(D)):D(I)}}catch(A){C.e(A)}finally{C.f()}if(B){var o,w=h(B);try{for(w.s();!(o=w.n()).done;){(0,o.value)(I)}}catch(A){w.e(A)}finally{w.f()}B=null}}}},{key:"_on",value:function(A,I){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this._listeners[A]||(this._listeners[A]=[]);var B=this._listeners[A];B.push({listener:I,external:g&&!0===g.external,once:g&&!0===g.once})}},{key:"_off",value:function(A,I){var g=this._listeners[A];if(g)for(var B=0,Q=g.length;B<Q;B++)if(g[B].listener===I)return void g.splice(B,1)}}]),A}(),S=function(A){E()(g,A);var I=R(g);function g(){return F()(this,g),I.apply(this,arguments)}return y()(g,[{key:"dispatch",value:function(A,I){if("undefined"!=typeof PDFJSDev&&!PDFJSDev.test("MOZCENTRAL"))throw new Error("Not implemented: AutomationEventBus.dispatch");Q()(w()(g.prototype),"dispatch",this).call(this,A,I);var B=Object.create(null);if(I)for(var C in I){var E=I[C];if("source"!==C)B[C]=E;else if(E===window||E===document)return}var D=document.createEvent("CustomEvent");D.initCustomEvent(A,!0,!0,B),document.dispatchEvent(D)}}]),g}(k)},function(A,I,g){var B=g(12);function Q(){return"undefined"!=typeof Reflect&&Reflect.get?(A.exports=Q=Reflect.get.bind(),A.exports.__esModule=!0,A.exports.default=A.exports):(A.exports=Q=function(A,I,g){var Q=B(A,I);if(Q){var C=Object.getOwnPropertyDescriptor(Q,I);return C.get?C.get.call(arguments.length<3?A:g):C.value}},A.exports.__esModule=!0,A.exports.default=A.exports),Q.apply(this,arguments)}A.exports=Q,A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(13);A.exports=function(A,I){for(;!Object.prototype.hasOwnProperty.call(A,I)&&null!==(A=B(A)););return A},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){function g(I){return A.exports=g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},A.exports.__esModule=!0,A.exports.default=A.exports,g(I)}A.exports=g,A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(15);A.exports=function(A,I){if("function"!=typeof I&&null!==I)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),I&&B(A,I)},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){function g(I,B){return A.exports=g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,I){return A.__proto__=I,A},A.exports.__esModule=!0,A.exports.default=A.exports,g(I,B)}A.exports=g,A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(7).default,Q=g(17);A.exports=function(A,I){if(I&&("object"===B(I)||"function"==typeof I))return I;if(void 0!==I)throw new TypeError("Derived constructors may only return object or undefined");return Q(A)},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){"use strict";g.r(I),g.d(I,"OfdViewer",(function(){return k}));var B=g(4),Q=g.n(B),C=g(2),E=g.n(C),D=g(1),i=g.n(D),o=g(19),w=g.n(o),G=g(5),F=g.n(G),N=g(20),y=g(27),R=g(28),h=g(35),M=g(34);function U(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return c(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return c(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function c(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var k=function(){function A(I,g,B,Q,C){E()(this,A),w()(this,"scrollModePageState",null),this.jumpPageEvt=null,this.coreHelper=new M.Ofd_Core_Helper,this.ofdRender=new R.Ofd_Render(null,new M.Ofd_Core_Helper),Q&&this.ofdRender.setMixBlendMode(Q),this.defaultScale=C||N.DEFAULT_SCALE_VALUE,this.ofdCanvasRender=new h.OfdCanvasRender(null,this.coreHelper),this.eventBus=B,this.container=I,this.viewer=g,this._currentScaleValue=this.defaultScale,this._pages=[],this._currentScale=1,this._spreadMode=N.SpreadMode.NONE,this._scrollMode=N.ScrollMode.VERTICAL,this._pagesRotation=0,this.currentPage=1,this.scroll=Object(N.watchScroll)(this.container,this._scrollUpdate.bind(this)),this.eventBus.dispatch("pagechanging",{source:this,pageNumber:1,pageLabel:null,previous:1}),this.eventBus._on("jumpPage",this.jumpPage.bind(this)),this.scrollModePageState={previousPageNumber:1,scrollDown:!0,pages:[]},this._location=null,this.lastViewerHeight=0,this.lastViewerContainerScrollTop=0,this.lastViewerWidth=0,this.lastViewerContainerScrollLeft=0}var I;return i()(A,[{key:"getPages",value:function(){return this._pages}},{key:"currentScaleValue",get:function(){return this._currentScaleValue},set:function(A){this.core&&this._setScale(A,!1)}},{key:"getOfdCore",value:function(){return this.core}},{key:"emptyNode",value:function(A){if(A)for(;A.firstChild;)A.removeChild(A.firstChild)}},{key:"_scrollUpdate",value:function(){0!==this.pageCount&&this.updateView()}},{key:"_getVisiblePages",value:function(){var A=this._pages;return Object(N.getVisibleElements)({scrollEl:this.container,views:A,sortByVisibility:!0,horizontal:false,rtl:false})}},{key:"renderHighestPriority",value:function(A){this.forceRendering(A)}},{key:"getScrollAhead",value:function(A){if(A.first&&1===A.first.id)return!0;if(A.last&&A.last.id===this.pageCount)return!1;switch(this._scrollMode){case N.ScrollMode.PAGE:return this.scrollModePageState.scrollDown;case N.ScrollMode.HORIZONTAL:return this.scroll.right}return this.scroll.down}},{key:"forceRendering",value:(I=Q()(F.a.mark((function A(I){var g,B,Q,C,E=this;return F.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(this._scrollMode!==N.ScrollMode.PAGE?(B=I||this._getVisiblePages(),Q=this.getScrollAhead(B),this._spreadMode!==N.SpreadMode.NONE&&(this._scrollMode,N.ScrollMode.HORIZONTAL),g=Object(y.getHighestPriority)(B,this._pages,Q)):g=I,!g||g.renderingState!==N.RenderingStates.INITIAL){A.next=6;break}return A.delegateYield(F.a.mark((function A(){var I,B,Q,C,D,i;return F.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return E.emptyNode(g.div.firstChild),A.next=3,E.ofdRender.renderPage(g.div.firstChild,0,g.id-1);case 3:E.highLightEle(),I=E,B=U(document.getElementsByName("seal_img_div_".concat(g.id-1)));try{for(C=function(){var A=Q.value;A.addEventListener("click",(function(){I.eventBus.dispatch("signatureclick",{source:I,pageRef:A.dataset.pageRef,signatureId:A.dataset.signatureId})}))},B.s();!(Q=B.n()).done;)C()}catch(A){B.e(A)}finally{B.f()}for(g.renderingState=N.RenderingStates.FINISHED,E.renderHighestPriority(),D=0;D<g.id-10;D++)(i=E._pages[D]).renderingState===N.RenderingStates.FINISHED&&(E.emptyNode(i.div.firstChild),i.renderingState=N.RenderingStates.INITIAL);return A.abrupt("return",{v:!0});case 11:case"end":return A.stop()}}),A)}))(),"t0",3);case 3:if("object"!=typeof(C=A.t0)){A.next=6;break}return A.abrupt("return",C.v);case 6:return A.abrupt("return",!1);case 7:case"end":return A.stop()}}),A,this)}))),function(A){return I.apply(this,arguments)})},{key:"highLightEle",value:function(){if(this.removeHighLight(),this.jumpPageEvt&&this.jumpPageEvt.eleIdArray){document.getElementById(this.jumpPageEvt.eleIdArray[0].eleId);this.jumpPageEvt.eleIdArray.forEach((function(A){var I=document.getElementById("page_".concat(A.pageIndex));if(I.firstElementChild&&I.firstElementChild.childElementCount>0){var g=document.getElementById(A.eleId),B=document.createElement("div");B.className="highLight",B.setAttribute("style","position:absolute;left:".concat(g.style.left,";top:").concat(g.style.top,";width:").concat(g.style.width,";height:").concat(g.style.height)),I.firstElementChild.appendChild(B)}})),this.jumpPageEvt=null}}},{key:"removeHighLight",value:function(){var A=document.getElementsByClassName("highLight");if(A)for(var I=A.length-1;I>=0;I--){var g=A[I];g&&g.parentNode.removeChild(g)}}},{key:"updateView",value:function(){var A=this._getVisiblePages(),I=A.views;if(0!==I.length){this.renderHighestPriority(A);var g,B=this.currentPage,Q=!1,C=U(I);try{for(C.s();!(g=C.n()).done;){var E=g.value;if(E.percent<100)break;if(E.id===B){Q=!0;break}}}catch(A){C.e(A)}finally{C.f()}Q||(B=I[0].id),this._setCurrentPageNumber(B)}}},{key:"logError",value:function(A,I){}},{key:"showDocumentError",value:function(A,I){this.logError(A,I);var g=document.createElement("div");g.classList.add("error"),g.textContent=I,this.emptyNode(this.viewer),this.viewer.appendChild(g)}},{key:"resetPageScale",value:function(){this.core&&(this.coreHelper.setDpi(96*this._currentScale),this.reformDiv(this._pagesRotation))}},{key:"reformDiv",value:function(A){for(var I=0;I<this._pages.length;++I){var g=this._pages[I].div,B=this.coreHelper.pageRenderWidth(0,I,this.core),Q=this.coreHelper.pageRenderHeight(0,I,this.core),C=g.firstChild,E=new M.Ofd_Core_Helper,D=E.pageRenderWidth(0,I,this.core),i=E.pageRenderHeight(0,I,this.core);switch(A){case 0:g.style.width=B+"px",g.style.height=Q+"px",0,this._pages[I].width=B,this._pages[I].height=Q,C.setAttribute("style","width:".concat(D,"px;height:").concat(i,"px;transform:rotate(",0,"deg) translate(").concat((B-D)/2,"px, ").concat((Q-i)/2,"px) scale(").concat(this._currentScale,")"));break;case 90:g.style.width=Q+"px",g.style.height=B+"px",(B-Q)/2,this._pages[I].width=Q,this._pages[I].height=B,C.setAttribute("style","width:".concat(D,"px;height:").concat(i,"px;transform: translate(").concat((Q-D)/2,"px, ").concat((B-i)/2,"px) rotate(").concat(A,"deg) scale(").concat(this._currentScale,")"));break;case 180:g.style.width=B+"px",g.style.height=Q+"px",0,this._pages[I].width=B,this._pages[I].height=Q,C.setAttribute("style","width:".concat(D,"px;height:").concat(i,"px;transform:rotate(",180,"deg) translate(").concat(-(B-D)/2,"px, ").concat(-(Q-i)/2,"px) scale(").concat(this._currentScale,")"));break;case 270:g.style.width=Q+"px",g.style.height=B+"px",-(B-Q)/2,this._pages[I].width=Q,this._pages[I].height=B,C.setAttribute("style","width:".concat(D,"px;height:").concat(i,"px;transform: translate(").concat((Q-D)/2,"px, ").concat((B-i)/2,"px) rotate(",270,"deg) scale(").concat(this._currentScale,")"))}this._pages[I].scale=this._currentScale;var o={width:this._pages[I].width,height:this._pages[I].height,scale:this._currentScale};this._pages[I].viewport=o}if(0!==this.lastViewerHeight&&0!==this.lastViewerContainerScrollTop){var w=this.viewer.scrollHeight;this.container.scrollTo({top:this.lastViewerContainerScrollTop/this.lastViewerHeight*w})}if(0!==this.lastViewerWidth&&0!==this.lastViewerContainerScrollLeft){var G=this.viewer.scrollWidth;this.container.scrollTo({left:this.lastViewerContainerScrollLeft/this.lastViewerWidth*G})}this.eventBus.dispatch("viewportchanging",{source:this})}},{key:"initDiv",value:function(){var A=this.viewer;this._pages=[],this.emptyNode(A);var I=this;A.addEventListener("click",(function(){I.eventBus.dispatch("pageViewerClick",{source:I})}));for(var g=0;g<this.pageCount;++g){var B=document.createElement("div");B.classList.add("page"),B.id="page_"+g;var Q=this.coreHelper.pageRenderWidth(0,g,this.core),C=this.coreHelper.pageRenderHeight(0,g,this.core);B.style.width=Q+"px",B.style.height=C+"px",B.style.overflow="hidden",B.style.position="relative";var E=document.createElement("div");B.style.width=Q+"px",B.style.height=C+"px",0;var D=new M.Ofd_Core_Helper,i=D.pageRenderWidth(0,g,this.core),o=D.pageRenderHeight(0,g,this.core);E.style.width=i+"px",E.style.height=o+"px",E.style.overflow="hidden",E.style.transform="translate(".concat((Q-i)/2,"px, ").concat((C-o)/2,"px) scale(").concat(this._currentScale,")"),B.appendChild(E),A.appendChild(B),0===g&&E.appendChild(this.initLoadingImg());var w={width:Q,height:C,scale:this._currentScale};this._pages.push({div:B,viewport:w,id:g+1,renderingState:N.RenderingStates.INITIAL,scale:this._currentScale,width:Q,height:C})}}},{key:"currentPageNumber",get:function(){return this.currentPage}},{key:"_setCurrentPageNumber",value:function(A){if(this.currentPage===A)return!0;if(!(0<A&&A<=this.pageCount))return!1;var I=this.currentPage;return this.currentPage=A,this.eventBus.dispatch("pagechanging",{source:this,pageNumber:A,pageLabel:null,previous:I}),!0}},{key:"setRotation",value:function(A){A+=this._pagesRotation,Object(N.isValidRotation)(A),(A%=360)<0&&(A+=360),this._pagesRotation!==A&&this.core&&(this._pagesRotation=A,this.reformDiv(this._pagesRotation,!0),this.updateView())}},{key:"increaseScale",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,I=this._currentScale;do{I=(I*N.DEFAULT_SCALE_DELTA).toFixed(2),I=Math.ceil(10*I)/10,I=Math.min(N.MAX_SCALE,I)}while(--A>0&&I<N.MAX_SCALE);this._setScale(I)}},{key:"decreaseScale",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,I=this._currentScale;do{I=(I/N.DEFAULT_SCALE_DELTA).toFixed(2),I=Math.floor(10*I)/10,I=Math.max(N.MIN_SCALE,I)}while(--A>0&&I>N.MIN_SCALE);this._setScale(I)}},{key:"zoom",value:function(A){this._setScale(A)}},{key:"_setScale",value:function(A){var I=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.lastViewerHeight=this.viewer.scrollHeight,this.lastViewerWidth=this.viewer.scrollWidth,this.lastViewerContainerScrollTop=this.container.scrollTop,this.lastViewerContainerScrollLeft=this.container.scrollLeft;var g=parseFloat(A);if(g>0)this._setScaleUpdatePages(g,A,I,!1);else{var B=this._pages[0];if(!B)return;var Q=N.SCROLLBAR_PADDING,C=N.VERTICAL_PADDING,E=(this.container.clientWidth-Q)/B.width*B.scale/1,D=(this.container.clientHeight-C)/B.height*B.scale;switch(A){case"page-actual":g=1;break;case"page-width":g=E;break;case"page-height":g=D;break;case"page-fit":g=Math.min(E,D);break;case"auto":var i=Object(N.isPortraitOrientation)(B)?E:Math.min(D,E);g=Math.min(N.MAX_AUTO_SCALE,i);break;default:return}this._setScaleUpdatePages(g,A,I,!0)}}},{key:"isSameScale",value:function(A){return A===this._currentScale||Math.abs(A-this._currentScale)<1e-15}},{key:"ensurePageViewVisible",value:function(){if(this._scrollMode!==N.ScrollMode.PAGE)throw new Error("#ensurePageViewVisible: Invalid scrollMode value.");var A=this.currentPageNumber,I=this.scrollModePageState,g=this.viewer;if(g.textContent="",I.pages.length=0,this._spreadMode===N.SpreadMode.NONE){var B=this._pages[A-1];B.renderingState===N.RenderingStates.INITIAL&&this.forceRendering(B),g.appendChild(B.div)}else{var Q=new Set,C=this._spreadMode-1;A%2!==C?(Q.add(A-1),Q.add(A)):(Q.add(A-2),Q.add(A-1));var E,D=null,i=U(Q);try{for(i.s();!(E=i.n()).done;){var o=E.value,w=this._pages[o];w&&(null===D?((D=document.createElement("div")).className="spread",g.appendChild(D)):o%2===C&&(D=D.cloneNode(!1),g.appendChild(D)),D.appendChild(w.div))}}catch(A){i.e(A)}finally{i.f()}}I.scrollDown=A>=I.previousPageNumber,I.previousPageNumber=A}},{key:"_setScaleUpdatePages",value:function(A,I){var g=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this._currentScaleValue=I.toString(),this.isSameScale(A)?g&&this.eventBus.dispatch("scalechanging",{source:this,scale:A,presetValue:I}):(this._currentScale=A,this.resetPageScale(),this.eventBus.dispatch("scalechanging",{source:this,scale:A,presetValue:g?I:void 0}))}},{key:"setSpreadMode",value:function(A){if(this._spreadMode!==A){if(!Object(N.isValidSpreadMode)(A))throw new Error("Invalid spread mode: ".concat(A));this._spreadMode=A,this.eventBus.dispatch("spreadmodechanged",{source:this,mode:A}),this._updateSpreadMode(this.currentPage)}}},{key:"_updateSpreadMode",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,I=this._pages;if(this._scrollMode===N.ScrollMode.PAGE)this.ensurePageViewVisible();else if(this._spreadMode===N.SpreadMode.NONE){this.viewer.textContent="";for(var g=0,B=I.length;g<B;++g)this.viewer.appendChild(I[g].div)}else{this.viewer.textContent="";for(var Q=this._spreadMode-1,C=null,E=0,D=I.length;E<D;++E)null===C?((C=document.createElement("div")).className="spread",this.viewer.appendChild(C)):E%2===Q&&(C=C.cloneNode(!1),this.viewer.appendChild(C)),C.appendChild(I[E].div)}A&&(this._currentScale&&isNaN(this._currentScale)&&this._setScale(this._currentScale,!0),this._setCurrentPageNumber(A,!0),this.updateView())}},{key:"setScrollMode",value:function(A){if(this._scrollMode!==A){if(!Object(N.isValidScrollMode)(A))throw new Error("Invalid scroll mode: ".concat(A));this.pageCount>15e3||(this._previousScrollMode=this._scrollMode,this._scrollMode=A,this.eventBus.dispatch("scrollmodechanged",{source:this,mode:A}),this._updateScrollMode(this.currentPage))}}},{key:"_updateScrollMode",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,I=this._scrollMode;this.viewer.classList.toggle("scrollHorizontal",I===N.ScrollMode.HORIZONTAL),this.viewer.classList.toggle("scrollWrapped",I===N.ScrollMode.WRAPPED),this.core&&(I===N.ScrollMode.PAGE?this.ensurePageViewVisible():this._previousScrollMode===N.ScrollMode.PAGE&&this._updateSpreadMode(),this._currentScale&&isNaN(this._currentScale)&&this._setScale(this._currentScale,!0),this._setCurrentPageNumber(A,!0),this.updateView())}},{key:"firstPage",value:function(){this._scrollMode===N.ScrollMode.PAGE?(this._setCurrentPageNumber(1),this.ensurePageViewVisible()):this.viewer.children.item(0).scrollIntoView(!0);return!0}},{key:"lastPage",value:function(){this._scrollMode===N.ScrollMode.PAGE?(this._setCurrentPageNumber(this.pageCount),this.ensurePageViewVisible()):this.viewer.children.item(this.pageCount-1).scrollIntoView(!0);return!0}},{key:"nextPage",value:function(){var A=this.currentPage;if(A>=this.pageCount)return!1;this._scrollMode===N.ScrollMode.PAGE?(this._setCurrentPageNumber(A+1),this.ensurePageViewVisible()):this.viewer.children.item(A).scrollIntoView(!0);return!0}},{key:"previousPage",value:function(){var A=this.currentPage;if(A<=1)return!1;this._scrollMode===N.ScrollMode.PAGE?(this._setCurrentPageNumber(A-1),this.ensurePageViewVisible()):this.viewer.children.item(A-2).scrollIntoView(!0);return!0}},{key:"jumpPage",value:function(A){(this.jumpPageEvt=A,this._scrollMode===N.ScrollMode.PAGE)?(A.pageIndex&&this._setCurrentPageNumber(A.pageIndex),this.ensurePageViewVisible()):(this.viewer.children.item(A.pageIndex-1).scrollIntoView(!0),this.highLightEle())}},{key:"freeDocument",value:function(){this.currentPage=1,this.pageCount=0,this._pages=[],this.emptyNode(this.viewer)}},{key:"initLoadingImg",value:function(){var A=new Image;return A.style.position="absolute",A.style.left=0,A.style.right=0,A.style.margin="auto",A.style.top=0,A.style.bottom=0,A.src="data:image/gif;base64,R0lGODlhNgA3APMAAP///zAyOJKTlkdJTzw+RN/g4XV2euPj5M/Q0WtscaChpDAyODAyODAyODAyODAyOCH5BAkKAAAAIf4aQ3JlYXRlZCB3aXRoIGFqYXhsb2FkLmluZm8AIf8LTkVUU0NBUEUyLjADAQAAACwAAAAANgA3AAAEzBDISau9OOvNu/9gKI5kaZ4lkhBEgqCnws6EApMITb93uOqsRC8EpA1Bxdnx8wMKl51ckXcsGFiGAkamsy0LA9pAe1EFqRbBYCAYXXUGk4DWJhZN4dlAlMSLRW80cSVzM3UgB3ksAwcnamwkB28GjVCWl5iZmpucnZ4cj4eWoRqFLKJHpgSoFIoEe5ausBeyl7UYqqw9uaVrukOkn8LDxMXGx8ibwY6+JLxydCO3JdMg1dJ/Is+E0SPLcs3Jnt/F28XXw+jC5uXh4u89EQAh+QQJCgAAACwAAAAANgA3AAAEzhDISau9OOvNu/9gKI5kaZ5oqhYGQRiFWhaD6w6xLLa2a+iiXg8YEtqIIF7vh/QcarbB4YJIuBKIpuTAM0wtCqNiJBgMBCaE0ZUFCXpoknWdCEFvpfURdCcM8noEIW82cSNzRnWDZoYjamttWhphQmOSHFVXkZecnZ6foKFujJdlZxqELo1AqQSrFH1/TbEZtLM9shetrzK7qKSSpryixMXGx8jJyifCKc1kcMzRIrYl1Xy4J9cfvibdIs/MwMue4cffxtvE6qLoxubk8ScRACH5BAkKAAAALAAAAAA2ADcAAATOEMhJq7046827/2AojmRpnmiqrqwwDAJbCkRNxLI42MSQ6zzfD0Sz4YYfFwyZKxhqhgJJeSQVdraBNFSsVUVPHsEAzJrEtnJNSELXRN2bKcwjw19f0QG7PjA7B2EGfn+FhoeIiYoSCAk1CQiLFQpoChlUQwhuBJEWcXkpjm4JF3w9P5tvFqZsLKkEF58/omiksXiZm52SlGKWkhONj7vAxcbHyMkTmCjMcDygRNAjrCfVaqcm11zTJrIjzt64yojhxd/G28XqwOjG5uTxJhEAIfkECQoAAAAsAAAAADYANwAABM0QyEmrvTjrzbv/YCiOZGmeaKqurDAMAlsKRE3EsjjYxJDrPN8PRLPhhh8XDMk0KY/OF5TIm4qKNWtnZxOWuDUvCNw7kcXJ6gl7Iz1T76Z8Tq/b7/i8qmCoGQoacT8FZ4AXbFopfTwEBhhnQ4w2j0GRkgQYiEOLPI6ZUkgHZwd6EweLBqSlq6ytricICTUJCKwKkgojgiMIlwS1VEYlspcJIZAkvjXHlcnKIZokxJLG0KAlvZfAebeMuUi7FbGz2z/Rq8jozavn7Nev8CsRACH5BAkKAAAALAAAAAA2ADcAAATLEMhJq7046827/2AojmRpnmiqrqwwDAJbCkRNxLI42MSQ6zzfD0Sz4YYfFwzJNCmPzheUyJuKijVrZ2cTlrg1LwjcO5HFyeoJeyM9U++mfE6v2+/4PD6O5F/YWiqAGWdIhRiHP4kWg0ONGH4/kXqUlZaXmJlMBQY1BgVuUicFZ6AhjyOdPAQGQF0mqzauYbCxBFdqJao8rVeiGQgJNQkIFwdnB0MKsQrGqgbJPwi2BMV5wrYJetQ129x62LHaedO21nnLq82VwcPnIhEAIfkECQoAAAAsAAAAADYANwAABMwQyEmrvTjrzbv/YCiOZGmeaKqurDAMAlsKRE3EsjjYxJDrPN8PRLPhhh8XDMk0KY/OF5TIm4qKNWtnZxOWuDUvCNw7kcXJ6gl7Iz1T76Z8Tq/b7/g8Po7kX9haKoAZZ0iFGIc/iRaDQ40Yfj+RepSVlpeYAAgJNQkIlgo8NQqUCKI2nzNSIpynBAkzaiCuNl9BIbQ1tl0hraewbrIfpq6pbqsioaKkFwUGNQYFSJudxhUFZ9KUz6IGlbTfrpXcPN6UB2cHlgfcBuqZKBEAIfkECQoAAAAsAAAAADYANwAABMwQyEmrvTjrzbv/YCiOZGmeaKqurDAMAlsKRE3EsjjYxJDrPN8PRLPhhh8XDMk0KY/OF5TIm4qKNWtnZxOWuDUvCNw7kcXJ6gl7Iz1T76Z8Tq/b7yJEopZA4CsKPDUKfxIIgjZ+P3EWe4gECYtqFo82P2cXlTWXQReOiJE5bFqHj4qiUhmBgoSFho59rrKztLVMBQY1BgWzBWe8UUsiuYIGTpMglSaYIcpfnSHEPMYzyB8HZwdrqSMHxAbath2MsqO0zLLorua05OLvJxEAIfkECQoAAAAsAAAAADYANwAABMwQyEmrvTjrzbv/YCiOZGmeaKqurDAMAlsKRE3EsjjYxJDrPN8PRLPhfohELYHQuGBDgIJXU0Q5CKqtOXsdP0otITHjfTtiW2lnE37StXUwFNaSScXaGZvm4r0jU1RWV1hhTIWJiouMjVcFBjUGBY4WBWw1A5RDT3sTkVQGnGYYaUOYPaVip3MXoDyiP3k3GAeoAwdRnRoHoAa5lcHCw8TFxscduyjKIrOeRKRAbSe3I9Um1yHOJ9sjzCbfyInhwt3E2cPo5dHF5OLvJREAOw==",A.draggable=!1,A}},{key:"setWaterText",value:function(A){this.ofdRender.coreHelper.setWaterText(A)}},{key:"setWaterSetting",value:function(A){this.ofdRender.coreHelper.setWaterSetting(A)}},{key:"setOfdCore",value:function(A){this.core=A,this.ofdRender.setOfdCore(this.core),this.ofdCanvasRender.setOfdCore(this.core),this._spreadMode=N.SpreadMode.NONE,this._scrollMode=N.ScrollMode.VERTICAL,this._pagesRotation=0,this.pageCount=this.core.getOFDPageCount(0),this.eventBus.dispatch("pagechanging",{source:this,pageNumber:1,pageLabel:null,previous:1}),this.viewer.scrollTo(0,0);var I=N.SCROLLBAR_PADDING,g=(N.VERTICAL_PADDING,this.container.clientWidth,new M.Ofd_Core_Helper(96)),B=(this.container.clientWidth-I)/g.pageRenderWidth(0,0,this.core)*1/1,Q=Math.min(N.MAX_AUTO_SCALE,B);this.defaultScale!==N.DEFAULT_SCALE_VALUE&&(Q=this.defaultScale),this._currentScale=Q,this.coreHelper.setDpi(96*Q),this.initDiv(0),this.updateView(),this.eventBus.dispatch("scalechanging",{source:this,scale:Q,presetValue:this.defaultScale}),this.eventBus.dispatch("viewportchanging",{source:this}),this.scrollModePageState={previousPageNumber:1,scrollDown:!0,pages:[]}}}]),A}()},function(A,I){A.exports=function(A,I,g){return I in A?Object.defineProperty(A,I,{value:g,enumerable:!0,configurable:!0,writable:!0}):A[I]=g,A},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){"use strict";g.r(I),g.d(I,"animationStarted",(function(){return z})),g.d(I,"apiPageLayoutToViewerModes",(function(){return v})),g.d(I,"apiPageModeToSidebarView",(function(){return _})),g.d(I,"approximateFraction",(function(){return W})),g.d(I,"AutoPrintRegExp",(function(){return L})),g.d(I,"backtrackBeforeAllVisibleElements",(function(){return f})),g.d(I,"binarySearchFirstItem",(function(){return l})),g.d(I,"DEFAULT_SCALE",(function(){return F})),g.d(I,"DEFAULT_SCALE_DELTA",(function(){return N})),g.d(I,"DEFAULT_SCALE_VALUE",(function(){return G})),g.d(I,"getActiveOrFocusedElement",(function(){return P})),g.d(I,"getPageSizeInches",(function(){return x})),g.d(I,"getVisibleElements",(function(){return b})),g.d(I,"isPortraitOrientation",(function(){return O})),g.d(I,"isValidRotation",(function(){return T})),g.d(I,"isValidScrollMode",(function(){return X})),g.d(I,"isValidSpreadMode",(function(){return j})),g.d(I,"MAX_AUTO_SCALE",(function(){return M})),g.d(I,"MAX_SCALE",(function(){return R})),g.d(I,"MIN_SCALE",(function(){return y})),g.d(I,"noContextMenuHandler",(function(){return V})),g.d(I,"normalizeWheelEventDelta",(function(){return m})),g.d(I,"normalizeWheelEventDirection",(function(){return p})),g.d(I,"OutputScale",(function(){return J})),g.d(I,"parseQueryString",(function(){return Z})),g.d(I,"PresentationModeState",(function(){return S})),g.d(I,"ProgressBar",(function(){return u})),g.d(I,"removeNullCharacters",(function(){return q})),g.d(I,"RendererType",(function(){return Y})),g.d(I,"RenderingStates",(function(){return k})),g.d(I,"roundToDivide",(function(){return r})),g.d(I,"SCROLLBAR_PADDING",(function(){return U})),g.d(I,"scrollIntoView",(function(){return t})),g.d(I,"ScrollMode",(function(){return K})),g.d(I,"SidebarView",(function(){return s})),g.d(I,"SpreadMode",(function(){return H})),g.d(I,"TextLayerMode",(function(){return a})),g.d(I,"UNKNOWN_SCALE",(function(){return h})),g.d(I,"VERTICAL_PADDING",(function(){return c})),g.d(I,"watchScroll",(function(){return d}));var B=g(21),Q=g.n(B),C=g(2),E=g.n(C),D=g(1),i=g.n(D);function o(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return w(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return w(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function w(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var G="auto",F=1,N=1.1,y=.1,R=10,h=0,M=1.25,U=40,c=5,k={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3},S={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3},s={UNKNOWN:-1,NONE:0,THUMBS:1,OUTLINE:2,ATTACHMENTS:3,LAYERS:4,SIGNATURES:5},Y={CANVAS:"canvas",SVG:"svg"},a={DISABLE:0,ENABLE:1,ENABLE_ENHANCE:2},K={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2,PAGE:3},H={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2},L=/\bprint\s*\(/,J=function(){function A(){E()(this,A);var I=window.devicePixelRatio||1;this.sx=I,this.sy=I}return i()(A,[{key:"scaled",get:function(){return 1!==this.sx||1!==this.sy}}]),A}();function t(A,I){var g=arguments.length>2&&void 0!==arguments[2]&&arguments[2],B=A.offsetParent;if(B){for(var Q=A.offsetTop+A.clientTop,C=A.offsetLeft+A.clientLeft;B.clientHeight===B.scrollHeight&&B.clientWidth===B.scrollWidth||g&&(B.classList.contains("markedContent")||"hidden"===getComputedStyle(B).overflow);)if(Q+=B.offsetTop,C+=B.offsetLeft,!(B=B.offsetParent))return;I&&(void 0!==I.top&&(Q+=I.top),void 0!==I.left&&(C+=I.left,B.scrollLeft=C)),B.scrollTop=Q}}function d(A,I){var g=function(g){Q||(Q=window.requestAnimationFrame((function(){Q=null;var g=A.scrollLeft,C=B.lastX;g!==C&&(B.right=g>C),B.lastX=g;var E=A.scrollTop,D=B.lastY;E!==D&&(B.down=E>D),B.lastY=E,I(B)})))},B={right:!0,down:!0,lastX:A.scrollLeft,lastY:A.scrollTop,_eventHandler:g},Q=null;return A.addEventListener("scroll",g,!0),B}function Z(A){var I,g=new Map,B=o(new URLSearchParams(A));try{for(B.s();!(I=B.n()).done;){var C=Q()(I.value,2),E=C[0],D=C[1];g.set(E.toLowerCase(),D)}}catch(A){B.e(A)}finally{B.f()}return g}var n=/\x00/g,e=/[\x01-\x1F]/g;function q(A){var I=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"string"!=typeof A?A:(I&&(A=A.replace(e," ")),A.replace(n,""))}function l(A,I){var g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,B=g,Q=A.length-1;if(Q<0||!I(A[Q]))return A.length;if(I(A[B]))return B;for(;B<Q;){var C=B+Q>>1,E=A[C];I(E)?Q=C:B=C+1}return B}function W(A){if(Math.floor(A)===A)return[A,1];var I=1/A;if(I>8)return[1,8];if(Math.floor(I)===I)return[1,I];for(var g=A>1?I:A,B=0,Q=1,C=1,E=1;;){var D=B+C,i=Q+E;if(i>8)break;g<=D/i?(C=D,E=i):(B=D,Q=i)}return g-B/Q<C/E-g?g===A?[B,Q]:[Q,B]:g===A?[C,E]:[E,C]}function r(A,I){var g=A%I;return 0===g?A:Math.round(A-g+I)}function x(A){var I=A.view,g=A.userUnit,B=A.rotate,C=Q()(I,4),E=C[0],D=C[1],i=B%180!=0,o=(C[2]-E)/72*g,w=(C[3]-D)/72*g;return{width:i?w:o,height:i?o:w}}function f(A,I,g){if(A<2)return A;var B=I[A].div,Q=B.offsetTop+B.clientTop;Q>=g&&(Q=(B=I[A-1].div).offsetTop+B.clientTop);for(var C=A-2;C>=0&&!((B=I[C].div).offsetTop+B.clientTop+B.clientHeight<=Q);--C)A=C;return A}function b(A){var I=A.scrollEl,g=A.views,B=A.sortByVisibility,Q=void 0!==B&&B,C=A.horizontal,E=void 0!==C&&C,D=A.rtl,i=void 0!==D&&D,o=I.scrollTop,w=o+I.clientHeight,G=I.scrollLeft,F=G+I.clientWidth;var N=[],y=new Set,R=g.length,h=l(g,E?function(A){var I=A.div,g=I.offsetLeft+I.clientLeft,B=g+I.clientWidth;return i?g<F:B>G}:function(A){var I=A.div;return I.offsetTop+I.clientTop+I.clientHeight>o});h>0&&h<R&&!E&&(h=f(h,g,o));for(var M=E?F:-1,U=h;U<R;U++){var c=g[U],k=c.div,S=k.offsetLeft+k.clientLeft,s=k.offsetTop+k.clientTop,Y=k.clientWidth,a=k.clientHeight,K=S+Y,H=s+a;if(-1===M)H>=w&&(M=H);else if((E?S:s)>M)break;if(!(H<=o||s>=w||K<=G||S>=F)){var L=Math.max(0,o-s)+Math.max(0,H-w),J=(Y-(Math.max(0,G-S)+Math.max(0,K-F)))/Y,t=(a-L)/a*J*100|0;N.push({id:c.id,x:S,y:s,view:c,percent:t,widthPercent:100*J|0}),y.add(c.id)}}var d=N[0],Z=N[N.length-1];return Q&&N.sort((function(A,I){var g=A.percent-I.percent;return Math.abs(g)>.001?-g:A.id-I.id})),{first:d,last:Z,views:N,ids:y}}function V(A){A.preventDefault()}function p(A){var I=Math.hypot(A.deltaX,A.deltaY),g=Math.atan2(A.deltaY,A.deltaX);return-.25*Math.PI<g&&g<.75*Math.PI&&(I=-I),I}function m(A){var I=p(A);return 0===A.deltaMode?I/=900:1===A.deltaMode&&(I/=30),I}function T(A){return Number.isInteger(A)&&A%90==0}function X(A){return Number.isInteger(A)&&Object.values(K).includes(A)&&A!==K.UNKNOWN}function j(A){return Number.isInteger(A)&&Object.values(H).includes(A)&&A!==H.UNKNOWN}function O(A){return A.width<=A.height}var z=new Promise((function(A){"undefined"!=typeof PDFJSDev&&PDFJSDev.test("LIB")&&"undefined"==typeof window?setTimeout(A,20):window.requestAnimationFrame(A)}));var u=function(){function A(I){var g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},B=g.height,Q=g.width,C=g.units;E()(this,A),this.visible=!0,this.div=document.querySelector(I+" .progress"),this.bar=this.div.parentNode,this.height=B||100,this.width=Q||100,this.units=C||"%",this.div.style.height=this.height+this.units,this.percent=0}return i()(A,[{key:"_updateBar",value:function(){if(this._indeterminate)return this.div.classList.add("indeterminate"),void(this.div.style.width=this.width+this.units);this.div.classList.remove("indeterminate");var A=this.width*this._percent/100;this.div.style.width=A+this.units}},{key:"percent",get:function(){return this._percent},set:function(A){var I,g,B;this._indeterminate=isNaN(A),this._percent=(I=A,g=0,B=100,Math.min(Math.max(I,g),B)),this._updateBar()}},{key:"setWidth",value:function(A){if(A){var I=A.parentNode.offsetWidth-A.offsetWidth;if(I>0)document.documentElement.style.setProperty("--loadingBar-end-offset","".concat(I,"px"))}}},{key:"hide",value:function(){this.visible&&(this.visible=!1,this.bar.classList.add("hidden"))}},{key:"show",value:function(){this.visible||(this.visible=!0,this.bar.classList.remove("hidden"))}}]),A}();function P(){for(var A=document,I=A.activeElement||A.querySelector(":focus");I&&I.shadowRoot;)I=(A=I.shadowRoot).activeElement||A.querySelector(":focus");return I}function v(A){var I=K.VERTICAL,g=H.NONE;switch(A){case"SinglePage":I=K.PAGE;break;case"OneColumn":break;case"TwoPageLeft":I=K.PAGE;case"TwoColumnLeft":g=H.ODD;break;case"TwoPageRight":I=K.PAGE;case"TwoColumnRight":g=H.EVEN}return{scrollMode:I,spreadMode:g}}function _(A){switch(A){case"UseNone":return s.NONE;case"UseThumbs":return s.THUMBS;case"UseOutlines":return s.OUTLINE;case"UseAttachments":return s.ATTACHMENTS;case"UseOC":return s.LAYERS}return s.NONE}},function(A,I,g){var B=g(22),Q=g(23),C=g(24),E=g(26);A.exports=function(A,I){return B(A)||Q(A,I)||C(A,I)||E()},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(A){if(Array.isArray(A))return A},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(A,I){var g=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null!=g){var B,Q,C=[],E=!0,D=!1;try{for(g=g.call(A);!(E=(B=g.next()).done)&&(C.push(B.value),!I||C.length!==I);E=!0);}catch(A){D=!0,Q=A}finally{try{E||null==g.return||g.return()}finally{if(D)throw Q}}return C}},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){var B=g(25);A.exports=function(A,I){if(A){if("string"==typeof A)return B(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);return"Object"===g&&A.constructor&&(g=A.constructor.name),"Map"===g||"Set"===g?Array.from(A):"Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?B(A,I):void 0}},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I){A.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},A.exports.__esModule=!0,A.exports.default=A.exports},function(A,I,g){"use strict";g.r(I),g.d(I,"getHighestPriority",(function(){return Q}));var B=g(20);function Q(A,I,g){var B=arguments.length>3&&void 0!==arguments[3]&&arguments[3],Q=A.views,E=Q.length;if(0===E)return null;for(var D=0;D<E;D++){var i=Q[D].view;if(!C(i))return i}var o=A.first.id,w=A.last.id;if(w-o+1>E)for(var G=A.ids,F=1,N=w-o;F<N;F++){var y=g?o+F:w-F;if(!G.has(y)){var R=I[y-1];if(!C(R))return R}}var h=g?w:o-2,M=I[h];return M&&!C(M)||B&&(M=I[h+=g?1:-1])&&!C(M)?M:null}function C(A){return A.renderingState===B.RenderingStates.FINISHED}},function(A,I,g){"use strict";g.r(I),g.d(I,"Ofd_Render",(function(){return h}));var B=g(4),Q=g.n(B),C=g(2),E=g.n(C),D=g(1),i=g.n(D),o=g(5),w=g.n(o),G=g(29),F=g(30),N=g(33);g(34);function y(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return R(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return R(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function R(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var h=function(){function A(I,g){E()(this,A),this.core=I,this.coreHelper=g,this.mixBlendMode="darken"}var I;return i()(A,[{key:"setDpi",value:function(A){this.coreHelper.setDpi(A)}},{key:"setOfdCore",value:function(A){this.core=A}},{key:"setMixBlendMode",value:function(A){this.mixBlendMode=A}},{key:"renderPage",value:function(A,I,g,B,Q,C){var E=B?B.readOfdDocument(I):this.core.readOfdDocument(I),D=B?B.readOfdPage(I,g):this.core.readOfdPage(I,g);this.coreHelper.waterText&&!this.coreHelper.waterSetting&&A.appendChild(this.watermark({watermark_txt:this.coreHelper.waterText})),this.coreHelper.waterSetting&&A.appendChild(this.watermark(this.coreHelper.waterSetting));var i=D.Page.Template,o=E.Annotations?E.Annotations:[],w=B?B.readOfdTemplatePage(I):this.core.readOfdTemplatePage(I),F=E.Signatures?E.Signatures.Signature:[],R=E.CommonData.Res.Fonts,h=E.CommonData.Res.DrawParams,M=(E.CommonData.Res.ColorSpaces,E.CommonData.Res.CompositeGraphicUnits),U=E.CommonData.Res.MultiMedias;if(i){var c,k=y(i);try{for(k.s();!(c=k.n()).done;){var S,s=c.value,Y=y(w);try{for(Y.s();!(S=Y.n()).done;){var a=S.value;if(a.ID==s.TemplateID){if((a=B?B.readPageFromTemplate(a):this.core.readPageFromTemplate(a)).Page.Content){var K,H=y(a.Page.Content.Layer);try{for(H.s();!(K=H.n()).done;){var L=K.value;this.renderLayer(C,Q,g,A,R,h,U,M,L,!1)}}catch(A){H.e(A)}finally{H.f()}}break}}}catch(A){Y.e(A)}finally{Y.f()}}}catch(A){k.e(A)}finally{k.f()}}if(D.Page.Content){var J,t=y(D.Page.Content.Layer);try{for(t.s();!(J=t.n()).done;){var d=J.value;this.renderLayer(C,Q,g,A,R,h,U,M,d,!1)}}catch(A){t.e(A)}finally{t.f()}}var Z,n=y(o);try{for(n.s();!(Z=n.n()).done;){var e=Z.value;if(D.ID==e.PageID){var q,l=y(e.PageAnnot.Annot);try{for(l.s();!(q=l.n()).done;){var W=q.value;this.renderAnnotation(C,Q,A,W,R,h,U,M,g)}}catch(A){l.e(A)}finally{l.f()}}}}catch(A){n.e(A)}finally{n.f()}var r,x=y(F);try{for(x.s();!(r=x.n()).done;){var f,b=r.value,V=y(b.Signature.SignedInfo.StampAnnot);try{for(V.s();!(f=V.n()).done;){var p=f.value,m=p.PageRef;if(D.ID==m){var T=p.Boundary;if(b.Signature.PicType&&b.Signature.PicType.length>0)if("ofd"===b.Signature.PicType)for(var X=new N.Ofd_Core(b.Signature.ofd),j=0;j<X.getOFDPageCount(0);j++)this.renderSealPage(A,j,X,!0,T,m,p.ID,g,b.Signature.ZipName);else if("svg"===b.Signature.PicType){var O=Object(G.converterBox)(T,this.coreHelper.dpi),z=document.createElement("div");z.innerHTML=b.Signature.svg;var u=void 0,P=z.children[0].width.baseVal.value,v=z.children[0].height.baseVal.value;P!==O.w&&(u="transform-origin: 0px 0px; transform: scale(".concat(O.h/v<O.w/P?O.h/v:O.w/P,")")),z.setAttribute("style","".concat(u,"; position:absolute; left: ",0,"px; top: ",0,"px; width: ").concat(O.w,"px; height: ").concat(O.h,"px;"));var _=document.createElement("div");_.setAttribute("style","mix-blend-mode:".concat(this.mixBlendMode,";cursor: pointer;position:absolute; left: ").concat(O.x,"px; top: ").concat(O.y,"px; width: ").concat(O.w,"px; height: ").concat(O.h,"px;overflow:hidden")),_.setAttribute("name","seal_img_div_".concat(g)),_.setAttribute("data-signature-id",p.ID),_.setAttribute("data-page-ref",m),_.appendChild(z),A.appendChild(_)}else{var $=Object(G.converterBox)(T,this.coreHelper.dpi),AA="data:image/".concat(b.Signature.PicType,";base64,").concat(b.Signature.PicValue),IA=this.renderImageOnDiv(g,A.style.width,A.style.height,AA,$.w,$.h,$,p.Clip,!0,m,p.ID);IA.svg.setAttribute("style","".concat(IA.style,"left:").concat(IA.left,"px;top:").concat(IA.top,"px;mix-blend-mode:").concat(this.mixBlendMode)),b.Signature.PicType||IA.svg.removeChild(IA.svg.children[0]),A.appendChild(IA.svg)}else{var gA=Object(G.converterBox)(T,this.coreHelper.dpi),BA=document.createElement("div");BA.setAttribute("style","mix-blend-mode:".concat(this.mixBlendMode,";cursor: pointer;position:absolute; left: ").concat(gA.x,"px; top: ").concat(gA.y,"px; width: ").concat(gA.w,"px; height: ").concat(gA.h,"px;overflow:hidden")),BA.setAttribute("name","seal_img_div_".concat(g)),BA.setAttribute("data-signature-id",p.ID),BA.setAttribute("data-page-ref",m),A.appendChild(BA)}}}}catch(A){V.e(A)}finally{V.f()}}}catch(A){x.e(A)}finally{x.f()}}},{key:"throwWhite",value:(I=Q()(w.a.mark((function A(I){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return",new Promise((function(A,g){var B=new Image;B.onload=function(){var I=B.width,g=B.height,Q=document.createElement("canvas");Q.style.width="".concat(I,"px"),Q.style.height="".concat(g,"px"),Q.width=I,Q.height=g;var C=Q.getContext("2d");C.drawImage(B,0,0,I,g);for(var E=C.getImageData(0,0,I,g),D=E.data,i=0;i<D.length;i+=4)[D[i],D[i+1],D[i+2]].every((function(A){return A<256&&A>245}))&&(D[i+3]=0);C.putImageData(E,0,0),A(Q.toDataURL())},B.src=I})));case 1:case"end":return A.stop()}}),A)}))),function(A){return I.apply(this,arguments)})},{key:"renderAnnotation",value:function(A,I,g,B,Q,C,E,D,i){var o=document.createElement("div");o.setAttribute("style","overflow: hidden;;position:relative;");var w=B.Appearance.Boundary;if(w){var F=Object(G.converterBox)(w,this.coreHelper.dpi);o.setAttribute("style","mix-blend-mode:".concat(this.mixBlendMode,";overflow: visible;position:absolute; left: ").concat(F.x,"px; top: ").concat(F.y,"px; width: ").concat(F.w,"px; height: ").concat(F.h,"px"))}else o.setAttribute("style","mix-blend-mode:".concat(this.mixBlendMode,";overflow: visible;position:absolute; left: 0px; top: 0px; width: 1px; height: 1px"));var N=B.Appearance;this.renderLayer(A,I,i,o,Q,C,E,D,N,!1),g.appendChild(o)}},{key:"renderSealPage",value:function(A,I,g,B,Q,C,E,D,i){var o,w;o=Q;var F=g.pageWidth(0,I),N=g.pageHeight(0,I);F!==o.w&&(w="transform-origin: 0px 0px; transform: scale(".concat(o.h/N<o.w/F?o.h/N:o.w/F,")"));var y=Object(G.converterBox)(o,this.coreHelper.dpi),R=document.createElement("div");R.setAttribute("name","seal_img_div_".concat(D)),R.setAttribute("style","".concat(w,";cursor: pointer; position:absolute; left: ",0,"px; top: ",0,"px; width: ").concat(y.w,"px; height: ").concat(y.h,"px;")),R.setAttribute("data-signature-id",E),R.setAttribute("data-page-ref",C),this.renderPage(R,0,I,g,E,i);var h=document.createElement("div");h.setAttribute("style","mix-blend-mode:".concat(this.mixBlendMode,";position:absolute; left: ").concat(y.x,"px; top: ").concat(y.y,"px; width: ").concat(y.w,"px; height: ").concat(y.h,"px;overflow:hidden")),h.appendChild(R),A.appendChild(h)}},{key:"renderLayer",value:function(A,I,g,B,Q,C,E,D,i,o,w,F,N){var R=null,h=null,M=Object(G.converterDpi)(.353,this.coreHelper.dpi),U=i.DrawParam;if(U&&Object(G.getDrawParam)(C,U)){var c=Object(G.getDrawParam)(C,U);if(Object(G.getDrawParam)(C,c.Relative)){var k=Object(G.getDrawParam)(C,c.Relative);k&&(k.StrokeColor&&(c.StrokeColor=k.StrokeColor),k.FillColor&&(c.FillColor=k.FillColor),k.LineWidth&&(c.LineWidth=k.LineWidth))}c.FillColor&&(R=Object(G.parseColor)(c.FillColor.Value)),c.StrokeColor&&(h=Object(G.parseColor)(c.StrokeColor.Value)),c.LineWidth&&(M=Object(G.converterDpi)(c.LineWidth,this.coreHelper.dpi))}var S=i.PageBlock;if(S){var s,Y=y(S);try{for(Y.s();!(s=Y.n()).done;){var a=s.value;if("ImageObject"==a.Type){var K=this.renderImageObject(A,I,g,B.style.width,B.style.height,E,a,o,F,N,i.ctm);K&&(K.svg.setAttribute("style","".concat(K.style,"left:").concat(K.left,"px;top:").concat(K.top,"px;")),B.appendChild(K.svg))}else if("PathObject"==a.Type){var H=this.renderPathObject(A,I,g,C,a,R,h,M,o,w,F,N,E,Q);H.style&&(H.svg.setAttribute("style","".concat(H.style,"left:").concat(H.left,"px;top:").concat(H.top,"px;")),B.appendChild(H.svg))}else if("TextObject"==a.Type){if(i.ctm){var L=i.ctm.split(" ");a.CTM={a:L[0],b:L[1],c:L[2],d:L[3],e:L[4],f:L[5]}}var J=this.renderTextObject(B,Q,a,R,h,C,w,F,N);J.childElementCount>0&&B.appendChild(J)}else if("CompositeObject"==a.Type){var t,d=y(D);try{for(d.s();!(t=d.n()).done;){var Z=t.value;if(Z.ID===a.ResourceID){var n=a.Alpha,e=a.Boundary,q=a.CTM;this.renderLayer(A,I,g,B,Q,C,E,D,Z,!1,n,e,q);break}}}catch(A){d.e(A)}finally{d.f()}}}}catch(A){Y.e(A)}finally{Y.f()}}}},{key:"renderImageObject",value:function(A,I,g,B,Q,C,E,D,i,o,w){var N=E.Boundary;N=Object(G.converterBox)(N,this.coreHelper.dpi);var y=E.ResourceID;if(!y)return null;var R=Object(G.getMultiMedia)(C,y);if(!R.MediaFile)return null;var h,M=E.ImageMask;if(M>0&&(h=Object(G.getMultiMedia)(C,M)).MediaFile&&!(h.width>0||h.height>0)&&h.MediaFile){var U=Object(F.JSGetImageInfoByPath)(this.core.ofdParserPtr,h.MediaFile,h.MediaFileResPln,this.core.getDocPln(0),A);U.ext,h.width=U.width,h.height=U.height,h.FileBase64=U.fileBase64}if(!(R.width>0||R.height>0)&&R.MediaFile){var c=Object(F.JSGetImageInfoByPath)(this.core.ofdParserPtr,R.MediaFile,R.MediaFileResPln,this.core.getDocPln(0),A);if("other"===c.ext)return null;R.width=c.width,R.height=c.height,R.FileBase64=c.fileBase64}var k=E.CTM,S=E.Clips,s=E.BlendMode,Y=E.Alpha;return this.renderImageOnDiv(g,B,Q,R.FileBase64,R.width,R.height,N,!1,D,null,null,k,i,o,S,E.ID,s,Y,M>0&&h.FileBase64?h.FileBase64:null,w)}},{key:"renderImageOnDiv",value:function(A,I,g,B,Q,C,E,D,i,o,w,F,N,R,h,M,U,c,k,S){var s=parseFloat(I.replace("px","")),Y=parseFloat(g.replace("px","")),a=E.w>s?s:E.w,K=E.h>Y?Y:E.h,H=document.createElementNS("http://www.w3.org/2000/svg","svg"),L=document.createElementNS("http://www.w3.org/2000/svg","image"),J="";i&&(J="cursor: pointer;",H.setAttribute("viewbox","0 0 ".concat(a," ").concat(K)),H.setAttribute("name","seal_img_div_".concat(A)),H.setAttribute("data-signature-id",w),H.setAttribute("data-page-ref",o),L.setAttribute("preserveAspectRatio","none slice"));var t=Q,d=C;L.setAttribute("xlink:href",B),L.href.baseVal=B,L.setAttribute("width","".concat(t,"px")),L.setAttribute("height","".concat(d,"px")),c&&L.setAttribute("opacity","".concat(c/255));var Z="";if(F){var n=1,e=1;if(S){var q=S.split(" ");n=q[0],e=q[3]}Z="matrix(".concat(F.a/t/Object(G.ctmImageScale)(this.coreHelper.dpi)*n," ").concat(F.b/t/Object(G.ctmImageScale)(this.coreHelper.dpi)," ").concat(F.c/d/Object(G.ctmImageScale)(this.coreHelper.dpi)," ").concat(F.d/d/Object(G.ctmImageScale)(this.coreHelper.dpi)*e," ").concat(Object(G.converterDpi)(F.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(F.f,this.coreHelper.dpi),")")}R&&(Z="".concat(Z," matrix(").concat(R.a," ").concat(R.b," ").concat(R.c," ").concat(R.d," ").concat(Object(G.converterDpi)(R.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(R.f,this.coreHelper.dpi),")")),L.setAttribute("transform",Z);var l="";D&&(D=Object(G.converterBox)(D,this.coreHelper.dpi),l="clip: rect(".concat(D.y,"px, ").concat(D.w+D.x,"px, ").concat(D.h+D.y,"px, ").concat(D.x,"px)"));var W=[];if(h&&h.length>0)for(var r=0;r<h.length;r++){var x=document.createElementNS("http://www.w3.org/2000/svg","clipPath");x.setAttribute("id","image-clip-path-".concat(M,"-").concat(r));for(var f=h[r].Clip,b=0;b<f.length;b++){var V=f[b].Area,p=0,m=0,T=0,X=0;V.Path.Boundary&&(p=V.Path.Boundary.x,m=V.Path.Boundary.y,T=V.Path.Boundary.w,X=V.Path.Boundary.h);var j=document.createElementNS("http://www.w3.org/2000/svg","path");if(V.CTM)F=V.CTM;else if(V.TransFlag)if(V.Path.CTM);else if(F&&0==F.b&&0==F.c){var O="matrix(".concat(F.a," ").concat(F.b," ").concat(F.c," ").concat(F.d," ").concat(Object(G.converterDpi)(F.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(F.f,this.coreHelper.dpi),")");j.setAttribute("transform",O)}var z,u="",P=y(V.Path.AbbreviatedData);try{for(P.s();!(z=P.n()).done;){var v=z.value;"M"===v.cmd||"S"===v.cmd?u+="M ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[0],T)+p,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[1],X)+m,this.coreHelper.dpi)," "):"L"===v.cmd?u+="L ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[0],T)+p,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[1],X)+m,this.coreHelper.dpi)," "):"B"===v.cmd?u+="C ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[0],T)+p,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[1],X)+m,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[2]+p,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[3]+m,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[4]+p,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[5]+m,this.coreHelper.dpi)," "):"Q"===v.cmd?u+="Q ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[0],T)+p,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(v.crds[1],X)+m,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[2]+p,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[3]+m,this.coreHelper.dpi)," "):"A"===v.cmd?u+="A ".concat(Object(G.converterDpi)(v.crds[0],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(v.crds[1],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[2],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[3],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(v.crds[4],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(v.crds[5],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(v.crds[6],this.coreHelper.dpi)):"C"===v.cmd&&(u+="Z")}}catch(A){P.e(A)}finally{P.f()}j.setAttribute("d",u),x.appendChild(j)}W.push(x)}if(k){var _=document.createElementNS("http://www.w3.org/2000/svg","mask");_.setAttribute("id","mask-".concat(M));var $=document.createElementNS("http://www.w3.org/2000/svg","image");$.setAttribute("xlink:href",k),$.href.baseVal=k,_.appendChild($),H.appendChild(_),L.setAttribute("mask","url(#mask-".concat(M,")"))}H.appendChild(L);var AA,IA=E.x,gA=E.y;if(R){var BA=R.a,QA=R.b,CA=R.c,EA=R.d,DA=BA>0?Math.sign(BA)*Math.sqrt(BA*BA+CA*CA):Math.sqrt(BA*BA+CA*CA),iA=EA>0?Math.sign(EA)*Math.sqrt(QA*QA+EA*EA):Math.sqrt(QA*QA+EA*EA);0==Math.atan2(-QA,EA)&&0!=BA&&1==EA||(gA*=iA,IA*=DA)}U&&(AA="mix-blend-mode: ".concat(U));var oA="".concat(J,"overflow: visible; position: absolute; width: ").concat(a,"px; height: ").concat(K,"px; ").concat(l,";").concat(AA,";");if(W.length>0)if(1==W.length)H.appendChild(W[0]),H.setAttribute("clip-path","url(#image-clip-path-".concat(M,"-0)"));else{var wA,GA="",FA=y(W);try{for(FA.s();!(wA=FA.n()).done;){var NA=wA.value;void 0!==NA.children[0].getAttribute("d")&&(GA+="clip-path:path('".concat(NA.children[0].getAttribute("d"),"');"))}}catch(A){FA.e(A)}finally{FA.f()}oA="".concat(GA,";").concat(oA,";")}return{svg:H,style:oA,left:IA,top:gA}}},{key:"renderTextObject",value:function(A,I,g,B,Q,C,E,D,i){var o=1,w=g.Boundary;w=Object(G.converterBox)(w,this.coreHelper.dpi);var N=g.CTM,R=g.HScale,h=g.Font,M=g.Weight,U=g.Alpha/255,c=g.Size>0;N&&!c&&(N={a:-N.a,b:N.b,c:N.c,d:-N.d,e:-N.e,f:-N.f});var k=Object(G.converterDpi)(Math.abs(parseFloat(g.Size)),this.coreHelper.dpi),S=Object(G.calTextPoint)(this.coreHelper.dpi,g.TextCode,g.CGTransform,N,g.Boundary,D,i,c,R),s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.setAttribute("xmlns","http://www.w3.org/2000/svg"),s.setAttribute("version","1.1"),s.setAttribute("id",g.ID);var Y,a,K,H=g.FillColor,L=!1,J=g.DrawParam;if(J){var t=Object(G.getDrawParam)(C,J);t.FillColor&&(H&&H.Value||(H=t.FillColor))}if(H){H.Value&&(B=Object(G.parseColor)(H.Value)),o=H.alpha/255;var d=H.axialShd;if(d){L=!0;var Z=document.createElementNS("http://www.w3.org/2000/svg","linearGradient");Z.setAttribute("id","".concat(g.ID)),Z.setAttribute("x1","0%"),Z.setAttribute("y1","0%"),Z.setAttribute("x2","100%"),Z.setAttribute("y2","100%");var n,e=y(d.Segment);try{for(e.s();!(n=e.n()).done;){var q=n.value;if(q){var l=document.createElement("stop");l.setAttribute("offset","".concat(100*q.position,"%")),l.setAttribute("style","stop-color:".concat(Object(G.parseColor)(q.color.Value),";stop-opacity:1")),Z.appendChild(l),B=Object(G.parseColor)(q.color.Value)}}}catch(A){e.e(A)}finally{e.f()}s.appendChild(Z)}}g.Stroke&&(Y=Object(G.parseColor)(g.StrokeColor.Value),a=g.LineWidth,K=g.LineWidth),g.Fill||(o=0);var W=w.w,r=w.h,x=w.x,f=w.y,b=k,V=k,p=0;if(N){var m=N.a,T=N.b,X=N.c,j=N.d,O=m>0?Math.sign(m)*Math.sqrt(m*m+X*X):Math.sqrt(m*m+X*X),z=j>0?Math.sign(j)*Math.sqrt(T*T+j*j):Math.sqrt(T*T+j*j);0==(p=Math.atan2(-T,j))&&0!=m&&1==j||(b*=O,V*=z,K*=O),0==p&&0!=m&&1==j&&(b*=O,V*=z,K*=O),0==p&&R-0==1&&(R=m/j)>0&&(b*=R)}if(i){var u=i.a,P=i.b,v=i.c,_=i.d,$=u>0?Math.sign(u)*Math.sqrt(u*u+v*v):Math.sqrt(u*u+v*v),AA=_>0?Math.sign(_)*Math.sqrt(P*P+_*_):Math.sqrt(P*P+_*_);0==(p=Math.atan2(-P,_))&&0!=u&&1==_||(b*=$,V*=AA,f*=AA,x*=$,W*=$,r*=AA)}var IA=Object(G.getFont)(I,h),gA="",BA="",QA="",CA="";N&&(CA="matrix(".concat(N.a," ").concat(N.b," ").concat(N.c," ").concat(N.d," ").concat(Object(G.converterDpi)(N.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(N.f,this.coreHelper.dpi),")")),i&&(CA="".concat(CA," matrix(").concat(i.a," ").concat(i.b," ").concat(i.c," ").concat(i.d," ").concat(Object(G.converterDpi)(i.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(i.f,this.coreHelper.dpi),")")),R&&(CA="".concat(CA," scale(").concat(R,", 1)"));for(var EA=!1,DA=0;DA<S.length;DA++){var iA=S[DA];if(iA&&!isNaN(iA.x)){if(iA.glyph&&IA&&IA.face){EA=!0;var oA=Object(F.loadFaceInfo)(IA.face),wA=Object(F.FT_Glyph_Get_Measure)(IA.face,iA.glyph),GA=this.drawGlyph(wA.glyphPath,wA.horiUnderlinePosition,oA.units_per_EM,b,V,Q||B,o,Y,K,g.ID);if(0===p)GA.img.setAttribute("style","overflow: visible;position:absolute; left: ".concat(Math.ceil(iA.cx),"px; top: ").concat(iA.cy-GA.yScale*wA.horiUnderlinePosition-V,"px;width: ").concat(Math.ceil(b),"px; height:").concat(Math.ceil(V),"px")),A.appendChild(GA.img);else{var FA=document.createElement("div");FA.setAttribute("style","transform-origin: center;transform: rotate(".concat(-p,"rad);position:absolute; left: ").concat(iA.cx,"px; top: ").concat(iA.cy-GA.yScale*wA.horiUnderlinePosition-V,"px;width: ").concat(Math.ceil(b),"px; height:").concat(Math.ceil(V),"px")),GA.img.setAttribute("style","position: absolute;left: 0px;top:0px;width: ".concat(Math.ceil(b),"px; height:").concat(Math.ceil(V),"px")),FA.appendChild(GA.img),A.appendChild(FA)}}if(gA=R?"".concat(gA).concat(iA.x+R*iA.x," "):"".concat(gA).concat(iA.x," "),BA="".concat(BA).concat(iA.y," "),QA=" "==iA.text?"".concat(QA," "):"".concat(QA).concat(iA.text),S.length>1&&R){var NA=document.createElementNS("http://www.w3.org/2000/svg","text");NA.setAttribute("x",iA.x),NA.setAttribute("y",iA.y),NA.innerHTML=iA.text,NA.setAttribute("transform",CA),L?NA.setAttribute("fill",B):(NA.setAttribute("fill",Q),NA.setAttribute("fill",B),NA.setAttribute("fill-opacity",EA?0:o<U?o:U)),EA||(yA&&s.appendChild(yA),NA.setAttribute("clip-path","url(#clip-path-".concat(g.ID,"-0)"))),Y&&a>0&&(NA.setAttribute("stroke",Y),NA.setAttribute("stroke-width",Object(G.converterDpi)(a,this.coreHelper.dpi))),NA.setAttribute("style","font-weight: ".concat(M,";font-size:").concat(k,"px;font-family: ").concat(Object(G.getFontFamily)(IA),";")),EA||s.appendChild(NA)}}}var yA=null,RA=g.Clips;if(RA&&RA.length>0){for(var hA=[],MA=0;MA<RA.length;MA++){(yA=document.createElementNS("http://www.w3.org/2000/svg","clipPath")).setAttribute("id","clip-path-".concat(g.ID,"-").concat(MA));for(var UA=RA[MA].Clip,cA=0;cA<UA.length;cA++){var kA=UA[cA].Area,SA=document.createElementNS("http://www.w3.org/2000/svg","path"),sA="",YA=0,aA=0;kA.Path.Boundary&&(YA=kA.Path.Boundary.x,aA=kA.Path.Boundary.y),EA&&(aA=-aA);var KA,HA=y(kA.Path.AbbreviatedData);try{for(HA.s();!(KA=HA.n()).done;){var LA=KA.value;"M"===LA.cmd||"S"===LA.cmd?sA+="M ".concat(Object(G.converterDpi)(LA.crds[0]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[1]+aA,this.coreHelper.dpi)," "):"L"===LA.cmd?sA+="L ".concat(Object(G.converterDpi)(LA.crds[0]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[1]+aA,this.coreHelper.dpi)," "):"B"===LA.cmd?sA+="C ".concat(Object(G.converterDpi)(LA.crds[0]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[1]+aA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[2]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[3]+aA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[4]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[5]+aA,this.coreHelper.dpi)," "):"Q"===LA.cmd?sA+="Q ".concat(Object(G.converterDpi)(LA.crds[0]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[1]+aA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[2]+YA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[3]+aA,this.coreHelper.dpi)," "):"A"===LA.cmd?sA+="A ".concat(Object(G.converterDpi)(LA.crds[0],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(LA.crds[1],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[2],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[3],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(LA.crds[4],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(LA.crds[5],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(LA.crds[6],this.coreHelper.dpi)):"C"===LA.cmd&&(sA+="Z")}}catch(A){HA.e(A)}finally{HA.f()}SA.setAttribute("d",sA),yA.appendChild(SA),hA.push(yA)}}if(hA.length>0)if(1==hA.length)s.appendChild(hA[0]);else{var JA,tA=y(hA);try{for(tA.s();!(JA=tA.n()).done;){var dA=JA.value;void 0!==dA.children[0].getAttribute("d")&&"clip-path:path('".concat(dA.children[0].getAttribute("d"),"');")}}catch(A){tA.e(A)}finally{tA.f()}}}if(!R){var ZA=document.createElementNS("http://www.w3.org/2000/svg","text");ZA.setAttribute("x",gA),ZA.setAttribute("y",BA),ZA.textContent=QA,ZA.setAttribute("transform",CA),L?ZA.setAttribute("fill",B):(ZA.setAttribute("fill",Q),ZA.setAttribute("fill",B),ZA.setAttribute("fill-opacity",EA?0:o<U?o:U)),g.Visible||ZA.setAttribute("fill-opacity",0),EA||(yA&&s.appendChild(yA),ZA.setAttribute("clip-path","url(#clip-path-".concat(g.ID,"-0)"))),Y&&a>0&&(ZA.setAttribute("stroke",Y),ZA.setAttribute("stroke-width",Object(G.converterDpi)(a,this.coreHelper.dpi))),ZA.setAttribute("style","font-weight: ".concat(M,";font-size:").concat(k,"px;font-family: ").concat(Object(G.getFontFamily)(IA),";")),EA||s.appendChild(ZA)}if(D){var nA=Object(G.converterBox)(D,this.coreHelper.dpi);x+=nA.x,f+=nA.y}return s.setAttribute("style","overflow:visible;position:absolute;width:".concat(W,"px;height:").concat(r,"px;left:").concat(x,"px;top:").concat(f,"px;")),s}},{key:"renderPathObject",value:function(A,I,g,B,Q,C,E,D,i,o,w,F,N,R){var h=document.createElementNS("http://www.w3.org/2000/svg","svg");h.setAttribute("version","1.1"),h.setAttribute("xmlns","http://www.w3.org/2000/svg");var M=Q.Boundary;if(!M)return{svg:h,style:""};M=Object(G.converterBox)(M,this.coreHelper.dpi);var U=Q.LineWidth,c=Q.AbbreviatedData,k=Q.StrokeColor,S=Q.FillColor,s=Q.CTM,Y=document.createElementNS("http://www.w3.org/2000/svg","path");Y.setAttribute("xmlns","http://www.w3.org/2000/svg"),Y.setAttribute("ID",Q.ID),U&&(D=Object(G.converterDpi)(U,this.coreHelper.dpi));var a=Q.DrawParam;if(a){var K=Object(G.getDrawParam)(B,a);(U=K.LineWidth)&&(D=Object(G.converterDpi)(U,this.coreHelper.dpi)),K.FillColor&&(S&&S.Value||(S=K.FillColor)),K.StrokeColor&&(k&&k.Value||(k=K.StrokeColor))}s?Y.setAttribute("transform","matrix(".concat(s.a," ").concat(s.b," ").concat(s.c," ").concat(s.d," ").concat(Object(G.converterDpi)(s.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(s.f,this.coreHelper.dpi),")")):F&&Y.setAttribute("transform","matrix(".concat(F.a," ").concat(F.b," ").concat(F.c," ").concat(F.d," ").concat(Object(G.converterDpi)(F.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(F.f,this.coreHelper.dpi),")"));if(k){k.Value&&(E=Object(G.parseColor)(k.Value));var H=k.axialShd;if(H){!0;var L=document.createElementNS("http://www.w3.org/2000/svg","linearGradient");L.setAttribute("id","".concat(Q.ID)),L.setAttribute("x1","0%"),L.setAttribute("y1","0%"),L.setAttribute("x2","100%"),L.setAttribute("y2","100%");var J,t=y(H.Segment);try{for(t.s();!(J=t.n()).done;){var d=J.value;if(d){var Z=document.createElement("stop");Z.setAttribute("offset","".concat(100*d.position,"%")),Z.setAttribute("style","stop-color:".concat(Object(G.parseColor)(d.color.Value),";stop-opacity:1")),L.appendChild(Z),E=Object(G.parseColor)(d.color.Value)}}}catch(A){t.e(A)}finally{t.f()}h.appendChild(L)}}if(S){S.Value&&(C=Object(G.parseColor)(S.Value)),void 0!==S.Alpha&&0===S.Alpha&&(C="none"),void 0!==S.alpha&&0===S.alpha?C="none":Y.setAttribute("fill-opacity","".concat(S.alpha/255));var n=S.axialShd;if(n){!0;var e=document.createElement("linearGradient");e.setAttribute("id","".concat(Q.ID)),e.setAttribute("x1","0%"),e.setAttribute("y1","0%"),e.setAttribute("x2","100%"),e.setAttribute("y2","100%");var q,l=y(n.Segment);try{for(l.s();!(q=l.n()).done;){var W=q.value;if(W){var r=document.createElement("stop");r.setAttribute("offset","".concat(100*W.position,"%")),r.setAttribute("style","stop-color:".concat(Object(G.parseColor)(W.color.Value),";stop-opacity:1")),e.appendChild(r),C=Object(G.parseColor)(W.color.Value)}}}catch(A){l.e(A)}finally{l.f()}h.appendChild(e)}}if(D>0&&!E&&(E="rgb(0, 0, 0)"),0===Q.Alpha&&(C="none"),o&&Y.setAttribute("fill-opacity","".concat(o/255)),Q.Stroke&&(Y.setAttribute("stroke","".concat(E)),Y.setAttribute("stroke-width","".concat(D,"px"))),Q.Fill?(Y.setAttribute("fill-rule",Q.Rule),Y.setAttribute("fill","".concat(i?"none":C||"none"))):Y.setAttribute("fill","none"),Q.Join&&Y.setAttribute("stroke-linejoin","".concat(Q["@_Join"])),Q.Cap&&Y.setAttribute("stroke-linecap","".concat(Q["@_Cap"])),Q.DashPattern){var x=Q.DashPattern,f=Object(G.parseCtm)(x),b=0;Q.DashOffset&&(b=Q.DashOffset),Y.setAttribute("stroke-dasharray","".concat(Object(G.converterDpi)(f[0],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(f[1],this.coreHelper.dpi))),Y.setAttribute("stroke-dashoffset","".concat(Object(G.converterDpi)(b,this.coreHelper.dpi),"px"))}var V,p="",m=y(c);try{for(m.s();!(V=m.n()).done;){var T=V.value;"M"===T.cmd||"S"===T.cmd?p+="M ".concat(Object(G.converterDpi)(T.crds[0],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(T.crds[1],this.coreHelper.dpi)," "):"L"===T.cmd?p+="L ".concat(Object(G.converterDpi)(T.crds[0],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(T.crds[1],this.coreHelper.dpi)," "):"B"===T.cmd?p+="C ".concat(Object(G.converterDpi)(T.crds[0],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(T.crds[1],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(T.crds[2],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(T.crds[3],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(T.crds[4],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(T.crds[5],this.coreHelper.dpi)," "):"Q"===T.cmd?p+="Q ".concat(Object(G.converterDpi)(T.crds[0],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(T.crds[1],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(T.crds[2],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(T.crds[3],this.coreHelper.dpi)," "):"A"===T.cmd?p+="A ".concat(Object(G.converterDpi)(T.crds[0],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(T.crds[1],this.coreHelper.dpi)," ").concat(T.crds[2]," ").concat(T.crds[3],",").concat(T.crds[4]," ").concat(Object(G.converterDpi)(T.crds[5],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(T.crds[6],this.coreHelper.dpi)," "):"C"===T.cmd&&(p+="Z")}}catch(A){m.e(A)}finally{m.f()}Y.setAttribute("d",p),h.appendChild(Y);var X=M.w,j=M.h,O=M.x,z=M.y,u=S.pattern;if(u){var P=document.createElementNS("http://www.w3.org/2000/svg","defs"),v=document.createElementNS("http://www.w3.org/2000/svg","pattern");v.setAttribute("width",Object(G.converterDpi)(u.width,this.coreHelper.dpi)),v.setAttribute("height",Object(G.converterDpi)(u.height,this.coreHelper.dpi)),u.ctm&&v.setAttribute("height",Object(G.converterDpi)(u.height,this.coreHelper.dpi)+Object(G.converterDpi)(u.ctm.split(" ")[5],this.coreHelper.dpi)),v.setAttribute("x",Object(G.converterDpi)(u.width,this.coreHelper.dpi)),v.setAttribute("y",Object(G.converterDpi)(u.height,this.coreHelper.dpi)),v.setAttribute("id","pattern1-".concat(Q.ID)),v.setAttribute("patternUnits","userSpaceOnUse"),this.renderLayer(A,I,g,v,R,B,N,null,u,!1,null,null,null),P.appendChild(v),h.appendChild(P);var _=document.createElementNS("http://www.w3.org/2000/svg","rect");_.setAttribute("width",X),_.setAttribute("height",j),_.setAttribute("style","fill:url(#pattern1-".concat(Q.ID,")")),h.appendChild(_)}var $=Q.Clips;if($&&$.length>0){for(var AA=[],IA=0;IA<$.length;IA++){var gA=document.createElementNS("http://www.w3.org/2000/svg","clipPath");gA.setAttribute("id","clip-path-".concat(I,"-").concat(g,"-").concat(Q.ID,"-").concat(IA));for(var BA=$[IA].Clip,QA=0;QA<BA.length;QA++){var CA=BA[QA].Area,EA=document.createElementNS("http://www.w3.org/2000/svg","path"),DA="",iA=0,oA=0,wA=0,GA=0;if(CA.Path.Boundary&&(iA=CA.Path.Boundary.x,oA=CA.Path.Boundary.y,wA=CA.Path.Boundary.w,GA=CA.Path.Boundary.h),!CA.TransFlag&&CA.CTM){var FA=CA.CTM,NA=void 0;if(NA=s?"matrix(".concat(FA.a," ").concat(FA.b," ").concat(FA.c," ").concat(FA.d," ").concat(Object(G.converterDpi)(FA.e-s.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(FA.f-s.f,this.coreHelper.dpi),")"):"matrix(".concat(FA.a," ").concat(FA.b," ").concat(FA.c," ").concat(FA.d," ").concat(Object(G.converterDpi)(FA.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(FA.f,this.coreHelper.dpi),")"),s){var yA=[[s.a,s.c,0],[s.b,s.d,0],[0,0,1]],RA=Object(G.inv)(yA);isNaN(RA[0][0])||RA[0][0]===1/0||(NA="".concat(NA," matrix(").concat(RA[0][0]," ").concat(RA[1][0]," ").concat(RA[0][1]," ").concat(RA[1][1]," 0 0)"))}EA.setAttribute("transform",NA)}if(!CA.TransFlag&&CA.Path.CTM){var hA=CA.Path.CTM,MA="matrix(".concat(hA.a," ").concat(hA.b," ").concat(hA.c," ").concat(hA.d," ").concat(Object(G.converterDpi)(hA.e-s.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(hA.f-s.f,this.coreHelper.dpi),")");if(s){var UA=[[s.a,s.c,0],[s.b,s.d,0],[0,0,1]],cA=Object(G.inv)(UA);isNaN(cA[0][0])||cA[0][0]===1/0||(MA="".concat(MA," matrix(").concat(cA[0][0]," ").concat(cA[1][0]," ").concat(cA[0][1]," ").concat(cA[1][1]," 0 0)"))}EA.setAttribute("transform",MA)}var kA,SA=y(CA.Path.AbbreviatedData);try{for(SA.s();!(kA=SA.n()).done;){var sA=kA.value;"M"===sA.cmd||"S"===sA.cmd?DA+="M ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(sA.crds[0],wA)+iA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(sA.crds[1],GA)+oA,this.coreHelper.dpi)," "):"L"===sA.cmd?DA+="L ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(sA.crds[0],wA)+iA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(sA.crds[1],GA)+oA,this.coreHelper.dpi)," "):"B"===sA.cmd?DA+="C ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(sA.crds[0],wA)+iA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(sA.crds[1],GA)+oA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(sA.crds[2]+iA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(sA.crds[3]+oA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(sA.crds[4]+iA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(sA.crds[5]+oA,this.coreHelper.dpi)," "):"Q"===sA.cmd?DA+="Q ".concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(sA.crds[0],wA)+iA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(Object(G.adjustPosLimit)(sA.crds[1],GA)+oA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(sA.crds[2]+iA,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(sA.crds[3]+oA,this.coreHelper.dpi)," "):"A"===sA.cmd?DA+="A ".concat(Object(G.converterDpi)(sA.crds[0],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(sA.crds[1],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(sA.crds[2],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(sA.crds[3],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(sA.crds[4],this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(sA.crds[5],this.coreHelper.dpi),",").concat(Object(G.converterDpi)(sA.crds[6],this.coreHelper.dpi)):"C"===sA.cmd&&(DA+="Z")}}catch(A){SA.e(A)}finally{SA.f()}EA.setAttribute("d",DA),gA.appendChild(EA)}AA.push(gA)}if(AA.length>0)if(1==AA.length)h.appendChild(AA[0]),Y.setAttribute("clip-path","url(#clip-path-".concat(I,"-").concat(g,"-").concat(Q.ID,"-0)"));else{var YA,aA="",KA=y(AA);try{for(KA.s();!(YA=KA.n()).done;){var HA=YA.value;void 0!==HA.children[0].getAttribute("d")&&(aA+="clip-path:path('".concat(HA.children[0].getAttribute("d"),"');"))}}catch(A){KA.e(A)}finally{KA.f()}Y.setAttribute("style",aA)}}var LA="overflow:hidden;position:absolute;width:".concat(Math.ceil(X),"px;height:").concat(Math.ceil(j),"px;");if(w){var JA=document.createElementNS("http://www.w3.org/2000/svg","svg");JA.setAttribute("version","1.1");var tA=Object(G.converterBox)(w,this.coreHelper.dpi),dA=Math.ceil(tA.w),ZA=Math.ceil(tA.h),nA=tA.x+O,eA=tA.y+z;return LA="overflow:hidden;position:absolute;width:".concat(dA,"px;height:").concat(ZA,"px;"),F&&s&&h.setAttribute("transform","matrix(".concat(F.a," ").concat(F.b," ").concat(F.c," ").concat(F.d," ").concat(Object(G.converterDpi)(F.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(F.f,this.coreHelper.dpi),")")),JA.appendChild(h),{svg:JA,style:LA,left:nA,top:eA}}return{svg:h,style:LA,left:O,top:z}}},{key:"drawGlyph",value:function(A,I,g,B,Q,C,E,D,i,o){var w=B/g,F=Q/g,N=document.createElementNS("http://www.w3.org/2000/svg","svg");N.setAttribute("version","1.1"),N.setAttribute("xmlns","http://www.w3.org/2000/svg");var y=document.createElementNS("http://www.w3.org/2000/svg","path");return y.setAttribute("transform","translate(0, ".concat(Q,") scale(").concat(w,", ").concat(-F,") translate(0, ").concat(-I,")")),y.setAttribute("d",A),C&&y.setAttribute("fill",C),y.setAttribute("fill-opacity",E),D&&(y.setAttribute("stroke","".concat(D)),y.setAttribute("stroke-width","".concat(Object(G.converterDpi)(i,this.coreHelper.dpi),"px"))),y.setAttribute("clip-path","url(#clip-path-".concat(o,"-0)")),N.appendChild(y),{img:N,yScale:F}}},{key:"watermark",value:function(A){var I={watermark_txt:"text",watermark_x:20,watermark_y:20,watermark_rows:20,watermark_cols:20,watermark_x_space:100,watermark_y_space:50,watermark_color:"#aaa",watermark_alpha:.4,watermark_fontsize:"15px",watermark_font:"微软雅黑",watermark_width:210,watermark_height:80,watermark_angle:20};if(1===arguments.length&&"object"==typeof arguments[0]){var g=arguments[0]||{};for(var B in g)g[B]&&I[B]&&g[B]===I[B]||g[B]&&(I[B]=g[B])}var Q,C,E=document.createDocumentFragment(),D=.015*(i=Math.max(document.body.scrollWidth,document.body.clientWidth)),i=i-D,o=Math.max(document.body.scrollHeight,document.body.clientHeight)+450;o=Math.max(o,window.innerHeight-30),(0==I.watermark_cols||parseInt(I.watermark_x+I.watermark_width*I.watermark_cols+I.watermark_x_space*(I.watermark_cols-1))>i)&&(I.watermark_cols=parseInt((i-I.watermark_x+I.watermark_x_space)/(I.watermark_width+I.watermark_x_space)),I.watermark_x_space=parseInt((i-I.watermark_x-I.watermark_width*I.watermark_cols)/(I.watermark_cols-1))),(0==I.watermark_rows||parseInt(I.watermark_y+I.watermark_height*I.watermark_rows+I.watermark_y_space*(I.watermark_rows-1))>o)&&(I.watermark_rows=parseInt((I.watermark_y_space+o-I.watermark_y)/(I.watermark_height+I.watermark_y_space)),I.watermark_y_space=parseInt((o-I.watermark_y-I.watermark_height*I.watermark_rows)/(I.watermark_rows-1)));for(var w=0;w<I.watermark_rows;w++){C=I.watermark_y+(I.watermark_y_space+I.watermark_height)*w;for(var G=0;G<I.watermark_cols;G++){Q=I.watermark_x+(I.watermark_width+I.watermark_x_space)*G;var F=document.createElement("div");F.id="mask_div"+w+G,F.className="mask_div",F.innerHTML=I.watermark_txt,F.style.webkitTransform="rotate(-"+I.watermark_angle+"deg)",F.style.MozTransform="rotate(-"+I.watermark_angle+"deg)",F.style.msTransform="rotate(-"+I.watermark_angle+"deg)",F.style.OTransform="rotate(-"+I.watermark_angle+"deg)",F.style.transform="rotate(-"+I.watermark_angle+"deg)",F.style.visibility="",F.style.position="absolute",F.style.left=Q+"px",F.style.top=C+"px",F.style.overflow="hidden",F.style.zIndex="9999",F.style.pointerEvents="none",F.style.opacity=I.watermark_alpha,F.style.fontSize=I.watermark_fontsize,F.style.fontFamily=I.watermark_font,F.style.color=I.watermark_color,F.style.textAlign="center",F.style.width=I.watermark_width+"px",F.style.height=I.watermark_height+"px",F.style.display="block",E.appendChild(F)}}return E}}]),A}()},function(A,I,g){"use strict";function B(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return Q(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return Q(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,C=function(){};return{s:C,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:C}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var E,D=!0,i=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return D=A.done,A},e:function(A){i=!0,E=A},f:function(){try{D||null==g.return||g.return()}finally{if(i)throw E}}}}function Q(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}g.r(I),g.d(I,"converterDpi",(function(){return C})),g.d(I,"ctmImageScale",(function(){return E})),g.d(I,"adjustPosLimit",(function(){return w})),g.d(I,"calTextPoint",(function(){return G})),g.d(I,"decodeHtml",(function(){return y})),g.d(I,"getFontFamily",(function(){return h})),g.d(I,"parseStBox",(function(){return M})),g.d(I,"parseCtm",(function(){return U})),g.d(I,"parseColor",(function(){return c})),g.d(I,"converterBox",(function(){return S})),g.d(I,"Uint8ArrayToHexString",(function(){return s})),g.d(I,"replaceFirstSlash",(function(){return Y})),g.d(I,"replaceFirstTarget",(function(){return a})),g.d(I,"readUTF",(function(){return K})),g.d(I,"getMultiMedia",(function(){return H})),g.d(I,"getDrawParam",(function(){return L})),g.d(I,"getFont",(function(){return J})),g.d(I,"inv",(function(){return Z}));var C=function(A,I){return function(A,I){return A*I/25.4}(A,I)},E=function(A){return 25.4/A},D=function(A,I,g){return{cx:A*g.a+I*g.c+1*g.e,cy:A*g.b+I*g.d+1*g.f}},i=function(A,I,g){return{ctmX:A*g.a+I*g.c,ctmY:A*g.b+I*g.d}},o=function(A,I,g){return{cx:g.x+A,cy:g.y+I}},w=function(A,I){return 0===I?A:A>I?I:A},G=function(A,I,g,Q,E,w,G,F,N){var R=0,h=0,M=0,U=0,c=[];if(!I)return c;var k,S=B(I);try{for(S.s();!(k=S.n()).done;){var s=k.value;if(s){if(R=F?parseFloat(s.X):-parseFloat(s.X),h=F?parseFloat(s.Y):-parseFloat(s.Y),isNaN(R)&&(R=0),isNaN(h)&&(h=0),M=R,U=h,Q){var Y=D(M,U,Q);M=Y.cx,U=Y.cy}var a=[],K=[];s.DeltaX&&s.DeltaX.length>0&&(a=s.DeltaX),s.DeltaY&&s.DeltaY.length>0&&(K=s.DeltaY);var H=s.text;if(H){H=(H=y(H+="")).replace(/&#x20;/g," ");for(var L=0;L<H.length;L++){if(L>0&&a.length>0){var J=L-1;if(J>=a.length&&(J=a.length-1),R+=N?F?a[J]/N:-a[J]/N:F?a[J]:-a[J],Q)M+=i(F?a[L-1]:-a[L-1],0,Q).ctmX;else M=R}if(L>0&&K.length>0){var t=L-1;if(t>=K.length&&(t=K.length-1),h+=F?K[t]:-K[t],Q)U+=i(0,F?K[L-1]:-K[L-1],Q).ctmY;else U=h}var d=H.substring(L,L+1),Z=o(M,U,E);G&&(Z=D(Z.cx,Z.cy,G));var n={x:C(R,A),y:C(h,A),text:d,cx:C(Z.cx,A),cy:C(Z.cy,A)};c.push(n)}}}}}catch(A){S.e(A)}finally{S.f()}if(c.length>0){var e,q=B(g);try{for(q.s();!(e=q.n()).done;)for(var l=e.value,W=l.CodePosition,r=l.GlyphCount,x=W;x<r+W;x++)if(c.length<=x){var f="".concat(c[c.length-1].glyph," ").concat(l.Glyphs[x-W]);c[c.length-1].glyph=f}else c[x].glyph=l.Glyphs[x-W]}catch(A){q.e(A)}finally{q.f()}}return c},F=/&\w+;|&#(\d+);/g,N={"&lt;":"<","&gt;":">","&amp;":"&","&nbsp;":" ","&quot;":'"',"&copy;":"","&apos;":"'"},y=function(A){return"string"!=typeof(A=null!=A?A:this.toString())?A:A.replace(F,(function(A,I){var g=N[A];return null==g&&(g=isNaN(I)?A:String.fromCharCode(160==I?32:I)),g}))},R={"楷体":"楷体, KaiTi, Kai, simkai",kaiti:"楷体, KaiTi, Kai, simkai",Kai:"楷体, KaiTi, Kai",simsun:"SimSun, simsun, Songti SC","宋体":"SimSun, simsun, Songti SC","黑体":"SimHei, STHeiti, simhei","仿宋":"FangSong, STFangsong, simfang","小标宋体":"小标宋体","方正小标宋_gbk":"方正小标宋_gbk, FZXiaoBiaoSong-B05S, NSimSun","方正小标宋简体":"方正小标宋_gbk, FZXiaoBiaoSong-B05S, NSimSun","仿宋_gb2312":"FangSong, STFangsong, simfang","楷体_gb2312":"楷体, KaiTi, Kai, simkai",couriernew:"Courier New","courier new":"Courier New"},h=function(A){if(!A)return R["宋体"];var I=A.FamilyName;I||(I=A.FontName),R[I.toLowerCase()]&&(I=R[I.toLowerCase()]);for(var g=0,B=Object.keys(R);g<B.length;g++){var Q=B[g];if(-1!=I.toLowerCase().indexOf(Q.toLowerCase()))return R[Q]}return I},M=function(A){if(A){var I=A.split(" ");return{x:parseFloat(I[0]),y:parseFloat(I[1]),w:parseFloat(I[2]),h:parseFloat(I[3])}}return null},U=function(A){return A.split(" ")},c=function(A){if(!(A&&A.length>0))return"rgb(0, 0, 0)";if(-1!==A.indexOf("#"))return A="#"+(A=(A=A.replace(/#/g,"")).replace(/ /g,"")).toString();var I=A.split(" ");if(3===I.length)return"rgb(".concat(I[0],", ").concat(I[1],", ").concat(I[2],")");if(4===I.length){var g=k(I[0],I[1],I[2],I[3]);return"rgb(".concat(g.r,", ").concat(g.g,", ").concat(g.b,")")}},k=function(A,I,g,B,Q){var C=1-(A=(A/=100)*(1-(B/=100))+B),E=1-(I=(I/=100)*(1-B)+B),D=1-(g=(g/=100)*(1-B)+B);return Q||(C=Math.round(255*C),E=Math.round(255*E),D=Math.round(255*D)),{r:C,g:E,b:D}},S=function(A,I){return{x:C(A.x,I),y:C(A.y,I),w:C(A.w,I),h:C(A.h,I)}},s=function(A){for(var I=[],g=0,B=0;B<2*A.length;B+=2)I[B>>>3]|=parseInt(A[g],10)<<24-B%8*4,g++;for(var Q=[],C=0;C<A.length;C++){var E=I[C>>>2]>>>24-C%4*8&255;Q.push((E>>>4).toString(16)),Q.push((15&E).toString(16))}return Q.join("")},Y=function(A){return A&&0===A.indexOf("/")&&(A=A.replace("/","")),A},a=function(A,I){return A&&0===A.indexOf(I)&&(A=A.replace(I,"")),A},K=function(A){if("string"==typeof A)return A;for(var I="",g=A,B=0;B<g.length;B++){var Q=g[B].toString(2),C=Q.match(/^1+?(?=0)/);if(C&&8==Q.length){for(var E=C[0].length,D=g[B].toString(2).slice(7-E),i=1;i<E;i++)D+=g[i+B].toString(2).slice(2);I="".concat(I).concat(String.fromCharCode(parseInt(D,2))),B+=E-1}}return I},H=function(A,I){var g,Q=B(A);try{for(Q.s();!(g=Q.n()).done;){var C=g.value;if(C.ID==I)return C}}catch(A){Q.e(A)}finally{Q.f()}},L=function(A,I){var g,Q=B(A);try{for(Q.s();!(g=Q.n()).done;){var C=g.value;if(C.ID==I)return C}}catch(A){Q.e(A)}finally{Q.f()}},J=function(A,I){var g,Q=B(A);try{for(Q.s();!(g=Q.n()).done;){var C=g.value;if(C.ID==I)return C}}catch(A){Q.e(A)}finally{Q.f()}};function t(A){if(A.length!==A[0].length)throw new Error;var I=A.length,g=0;if(I>3)for(var B=0;B<I;B++){for(var Q=new Array(I-1).fill(0).map((function(A){return new Array(I-1).fill(0)})),C=0;C<I-1;C++)for(var E=0;E<I-1;E++)Q[C][E]=E<B?A[C+1][E]:A[C+1][E+1];g+=A[0][B]*Math.pow(-1,0+B)*t(Q)}else 3===I?g=A[0][0]*A[1][1]*A[2][2]+A[0][1]*A[1][2]*A[2][0]+A[0][2]*A[1][0]*A[2][1]-A[0][2]*A[1][1]*A[2][0]-A[0][1]*A[1][0]*A[2][2]-A[0][0]*A[1][2]*A[2][1]:2===I?g=A[0][0]*A[1][1]-A[0][1]*A[1][0]:1===I&&(g=A[0][0]);return g}function d(A){if(A[0].length!==A.length)throw new Error;for(var I=A.length,g=new Array(I).fill(0).map((function(A){return new Array(I).fill(0)})),B=0;B<I;B++)for(var Q=0;Q<I;Q++){for(var C=[],E=0;E<A.length;E++)if(E!==B){for(var D=[],i=0;i<A.length;i++)i!==Q&&D.push(A[E][i]);C.push(D)}g[B][Q]=Math.pow(-1,B+Q)*t(C)}return function(A){for(var I=new Array(A.length).fill(0).map((function(I){return new Array(A[0].length).fill(0)})),g=0;g<I.length;g++)for(var B=0;B<I[0].length;B++)I[g][B]=A[B][g];return I}(g)}function Z(A){if(A[0].length!==A.length)throw new Error;for(var I=t(A),g=d(A),B=0;B<g.length;B++)for(var Q=0;Q<g.length;Q++)g[B][Q]/=I;return g}},function(A,I,g){"use strict";g.r(I),g.d(I,"needInitAgain",(function(){return o})),g.d(I,"setYYDS",(function(){return w})),g.d(I,"freeMemory",(function(){return G})),g.d(I,"getStreamData",(function(){return F})),g.d(I,"CreateLibrary",(function(){return N})),g.d(I,"CreateNativeStream",(function(){return y})),g.d(I,"FT_Open_Face",(function(){return R})),g.d(I,"loadFaceInfo",(function(){return h})),g.d(I,"FT_Glyph_Get_Measure",(function(){return M})),g.d(I,"freeOFD",(function(){return U})),g.d(I,"readOFD",(function(){return c})),g.d(I,"readOFDByBase64",(function(){return k})),g.d(I,"hashPath",(function(){return S})),g.d(I,"MD5",(function(){return s})),g.d(I,"SHA1",(function(){return Y})),g.d(I,"SM3",(function(){return a})),g.d(I,"base64EncodeByByte",(function(){return K})),g.d(I,"base64Encode",(function(){return H})),g.d(I,"base64DecodeToUint8Array",(function(){return L})),g.d(I,"JSBase64ByHashFile",(function(){return J})),g.d(I,"JSGetImageInfoByBase64",(function(){return t})),g.d(I,"JSGetImageInfoByPath",(function(){return d})),g.d(I,"JSReadPageInfo",(function(){return Z})),g.d(I,"JSGetPathEncode",(function(){return n})),g.d(I,"JSPackageSigned",(function(){return e})),g.d(I,"JSGetToSign",(function(){return q}));var B,Q,C,E,D=g(31),i=g(32),o=function(){return!B},w=function(A){B=A},G=function(A){B._ASC_FT_Free(A.data),A.data=0},F=function(){return E},N=function(){Q=B._ASC_FT_Init()},y=function(A){var I=new Uint8Array(A),g=B._malloc(A.byteLength);return B.HEAPU8.set(I,g),{data:g,length:A.byteLength}},R=function(A){return B._ASC_FT_Open_Face(Q,A.data,A.length,0)},h=function(A){var I=B._ASC_FT_GetFaceInfo(A);if(I){var g=new D.CFaceInfo,Q=Math.min(B.HEAP8.length-I>>2,250),C=new Int32Array(B.HEAP8.buffer,I,Q),E=0;g.units_per_EM=Math.abs(C[E++]),g.ascender=C[E++],g.descender=C[E++],g.height=C[E++],g.face_flags=C[E++],g.num_faces=C[E++],g.num_glyphs=C[E++],g.num_charmaps=C[E++],g.style_flags=C[E++],g.face_index=C[E++];for(var i=C[E++];i;)g.family_name+=String.fromCharCode(i),i=C[E++];for(i=C[E++];i;)g.style_name+=String.fromCharCode(i),i=C[E++];g.os2_version=C[E++],g.os2_usWeightClass=C[E++],g.os2_fsSelection=C[E++],g.os2_usWinAscent=C[E++],g.os2_usWinDescent=C[E++],g.os2_usDefaultChar=C[E++],g.os2_sTypoAscender=C[E++],g.os2_sTypoDescender=C[E++],g.os2_sTypoLineGap=C[E++],g.os2_ulUnicodeRange1=l(C[E++]),g.os2_ulUnicodeRange2=l(C[E++]),g.os2_ulUnicodeRange3=l(C[E++]),g.os2_ulUnicodeRange4=l(C[E++]),g.os2_ulCodePageRange1=l(C[E++]),g.os2_ulCodePageRange2=l(C[E++]),g.os2_nSymbolic=C[E++],g.header_yMin=C[E++],g.header_yMax=C[E++];for(var o=C[E++],w=0;w<o;w++)g.monochromeSizes.push(C[E++]);return B._ASC_FT_Free(I),I=null,g}},M=function(A,I){if(B._AST_FT_Load_Glyph(A,I,1)>0)return" ";var g=B._ASC_FT_Get_Glyph_Measure_Params(A,1);if(!g)return null;var Q=B.HEAP32[g>>2],C=new Int32Array(B.HEAP8.buffer,g,Q),E=new i.CGlyphMetrics;E.bbox_xMin=C[1],E.bbox_yMin=C[2],E.bbox_xMax=C[3],E.bbox_yMax=C[4],E.width=C[5],E.height=C[6],E.horiAdvance=C[7],E.horiBearingX=C[8],E.horiBearingY=C[9],E.vertAdvance=C[10],E.vertBearingX=C[11],E.vertBearingY=C[12],E.linearHoriAdvance=C[13],E.linearVertAdvance=C[14],E.horiUnderlinePosition=E.horiBearingY-E.height;for(var D=15,o="";D<Q;)switch(C[D++]){case 0:o+=" M ".concat(C[D++]," ").concat(C[D++]);break;case 1:o+=" L ".concat(C[D++]," ").concat(C[D++]);break;case 2:o+=" Q ".concat(C[D++]," ").concat(C[D++]," ").concat(C[D++]," ").concat(C[D++]);break;case 3:o+=" C ".concat(C[D++]," ").concat(C[D++]," ").concat(C[D++]," ").concat(C[D++]," ").concat(C[D++]," ").concat(C[D++])}return E.glyphPath=o,B._ASC_FT_Free(g),C=null,E},U=function(A){if(G(C),A.ofdParserPtr>0)B.JSFreeOFD(A.ofdParserPtr);var I=A.getFontRes(0);I&&I.forEach((function(A){A.face&&B._ASC_FT_Free(A.face)}))},c=function(A,I,g){E=A,C=y(A);var D=B.JSReadOFD(Q,C.data,C.length,I||"kgNVVbdUZ31C6mps",g?g.toLowerCase():"");if(D.data&&D.data.ofd&&(D.data.ofd.size=C.length),0!==D.code)switch(D.msg){case"10001":D.msg="授权信息错误";break;case"10002":D.msg="授权时间过期";break;case"10003":var i="非ofd文件无法打开";switch(D.file_type){case 0:break;case 9:i="PDF文件无法打开";break;default:i="图片文件无法打开"}D.msg=i}return D},k=function(A,I,g){return B.JSReadOFDByBase64(Q,A,I||"kgNVVbdUZ31C6mps",g?g.toLowerCase():"")},S=function(A,I,g){return B.JSHashPath(A,I,g)},s=function(A){return B.JSMD5(A)},Y=function(A){return B.JSSHA1(A)},a=function(A){return B.JSSM3(A)},K=function(A){var I=y(A),g=B.JSBase64EncodeByByte(I.data,I.length);return G(I),g},H=function(A){return B.JSBase64Encode(A)},L=function(A){var I=B.JSBase64Decode(A);return new Uint8Array(B.HEAPU8.buffer,I.ptr,I.len).slice(0,I.len)},J=function(A,I,g){var Q=y(A);return B.JSBase64ByHashFile(Q.data,Q.length,I,g)},t=function(A){var I=B.JSGetImageInfoByBase64(A);return"jb2"!==I.ext&&"jp2"!==I.ext&&"tif"!==I.ext&&"gif"!==I.ext&&"bmp"!==I.ext||(I.ext="png"),0===I.fileBase64.length&&(I.fileBase64=A),0!==I.fileBase64.indexOf("data:image")&&(I.fileBase64="data:image/".concat(I.ext,";base64,").concat(I.fileBase64)),I},d=function(A,I,g,Q,C){C||(C="");var E=B.JSGetImageInfoByPath(A,I,g,Q,C);return"jb2"!==E.ext&&"jp2"!==E.ext&&"tif"!==E.ext&&"gif"!==E.ext&&"bmp"!==E.ext&&"webp"!==E.ext||(E.ext="png"),0!==E.fileBase64.indexOf("data:image")&&(E.fileBase64="data:image/".concat(E.ext,";base64,").concat(E.fileBase64)),E},Z=function(A,I,g,Q,C){return B.JSReadPageInfo(A,I,g,Q,C)},n=function(A,I){var g=B.JSGetPathEncode(A,I);return new Uint8Array(B.HEAPU8.buffer,g.ptr,g.ptr_len).slice(0,g.ptr_len)},e=function(A,I){var g=B.JSPackageSigned(A,I);return g.ptr_len>0?new Uint8Array(B.HEAPU8.buffer,g.ptr,g.ptr_len).slice(0,g.ptr_len):g},q=function(A,I){return B.JSGetToSign(A,I)},l=function(A){return A<0?A+4294967296:A}},function(A,I,g){"use strict";g.r(I),g.d(I,"CFaceInfo",(function(){return D}));var B=g(1),Q=g.n(B),C=g(2),E=g.n(C),D=Q()((function A(){E()(this,A),this.units_per_EM=0,this.ascender=0,this.descender=0,this.height=0,this.face_flags=0,this.num_faces=0,this.num_glyphs=0,this.num_charmaps=0,this.style_flags=0,this.face_index=0,this.family_name="",this.style_name="",this.os2_version=0,this.os2_usWeightClass=0,this.os2_fsSelection=0,this.os2_usWinAscent=0,this.os2_usWinDescent=0,this.os2_usDefaultChar=0,this.os2_sTypoAscender=0,this.os2_sTypoDescender=0,this.os2_sTypoLineGap=0,this.os2_ulUnicodeRange1=0,this.os2_ulUnicodeRange2=0,this.os2_ulUnicodeRange3=0,this.os2_ulUnicodeRange4=0,this.os2_ulCodePageRange1=0,this.os2_ulCodePageRange2=0,this.os2_nSymbolic=0,this.header_yMin=0,this.header_yMax=0,this.monochromeSizes=[]}))},function(A,I,g){"use strict";g.r(I),g.d(I,"CGlyphMetrics",(function(){return D}));var B=g(1),Q=g.n(B),C=g(2),E=g.n(C),D=Q()((function A(){E()(this,A),this.bbox_xMin=0,this.bbox_yMin=0,this.bbox_xMax=0,this.bbox_yMax=0,this.width=0,this.height=0,this.horiAdvance=0,this.horiBearingX=0,this.horiBearingY=0,this.vertAdvance=0,this.vertBearingX=0,this.vertBearingY=0,this.linearHoriAdvance=0,this.linearVertAdvance=0,this.horiUnderlinePosition=0,this.glyphPath=null}))},function(A,I,g){"use strict";g.r(I),g.d(I,"Ofd_Core",(function(){return w}));var B=g(2),Q=g.n(B),C=g(1),E=g.n(C),D=(g(29),g(30));function i(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return o(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return o(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function o(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var w=function(){function A(I,g,B){Q()(this,A),this.ofd=I,this.ofdParserPtr=g,this.leftTime=B}return E()(A,[{key:"getMetadata",value:function(A){return A?A>this.ofd.DocBody.length&&(A=this.ofd.DocBody.length-1):A=0,{Title:this.ofd.DocBody[A].DocInfo.Title,Author:this.ofd.DocBody[A].DocInfo.Author,Subject:this.ofd.DocBody[A].DocInfo.Subject,Creator:this.ofd.DocBody[A].DocInfo.Creator,CreationDate:this.ofd.DocBody[A].DocInfo.CreationDate,CreatorVersion:this.ofd.DocBody[A].DocInfo.CreatorVersion,ModificationDate:this.ofd.DocBody[A].DocInfo.ModDate,Keywords:this.ofd.DocBody[A].DocInfo.Keywords,numPages:this.getOFDPageCount(A),pageSize:"".concat(this.pageWidth(A,0),"毫米 X ").concat(this.pageHeight(A,0),"毫米")}}},{key:"readOfdDocBody",value:function(A){return this.ofd?(A?A>this.ofd.DocBody.length&&(A=this.ofd.DocBody.length-1):A=0,this.ofd.DocBody[A]):null}},{key:"readOfdDocument",value:function(A){return this.ofd?(A?A>this.ofd.Document.length&&(A=this.ofd.Document.length-1):A=0,this.ofd.Document[A]):null}},{key:"readOfdPage",value:function(A,I){if(!this.ofd)return null;A?A>this.ofd.Document.length&&(A=this.ofd.Document.length-1):A=0;var g=this.ofd.Document[A],B=g.Pages[I];if(B.Page.onlyReadArea){var Q=Object(D.JSReadPageInfo)(this.ofdParserPtr,B.BasePln,B.BaseAbs,B.pln,B.abs);g.Pages[I].Page=Q.Page}return g.Pages[I]}},{key:"readOfdTemplatePage",value:function(A){return this.ofd?(A?A>this.ofd.Document.length&&(A=this.ofd.Document.length-1):A=0,this.ofd.Document[A].CommonData.TemplatePage):null}},{key:"readPageFromTemplate",value:function(A){if(A.Page.onlyReadArea){var I=Object(D.JSReadPageInfo)(this.ofdParserPtr,A.BasePln,A.BaseAbs,"","");A.Page=I.Page}return A}},{key:"getOFDPageCount",value:function(A){var I=this.readOfdDocument(A);return I?I.Pages.length:0}},{key:"pageWidth",value:function(A,I){var g=this.readOfdDocument(A);if(!g)return 0;var B=g.Pages[I];return this.calPageBox(g,B).w}},{key:"pageHeight",value:function(A,I){var g=this.readOfdDocument(A);if(!g)return 0;var B=g.Pages[I];return this.calPageBox(g,B).h}},{key:"calPageBox",value:function(A,I){var g,B=I.Page.Area;if(B&&Object.keys(B).length>0){var Q=B.PhysicalBox;if(Q)g=Q;else{var C=B.ApplicationBox;if(C)g=C;else{var E=B.ContentBox;E&&(g=E)}}}else{var D=A.CommonData.PageArea,i=D.PhysicalBox;if(i)g=i;else{var o=D.ApplicationBox;if(o)g=o;else{var w=D.ContentBox;w&&(g=w)}}}return g}},{key:"getSignatureCount",value:function(A){var I=this.readOfdDocument(A);return I&&I.Signatures&&I.Signatures.Signature?I.Signatures.Signature.length:0}},{key:"getAllSignature",value:function(A){var I=this.readOfdDocument(A);return I&&I.Signatures?I.Signatures.Signature:0}},{key:"getSignatureByIndex",value:function(A,I){var g=this.readOfdDocument(A);return g?g.Signatures.Signature[I]:null}},{key:"findSignature",value:function(A,I,g){var B=null,Q=this.readOfdDocument(A);if(Q)for(var C=0;C<Q.Signatures.Signature.length;C++){var E,D=i(Q.Signatures.Signature);try{for(D.s();!(E=D.n()).done;){var o,w=E.value,G=i(w.Signature.SignedInfo.StampAnnot);try{for(G.s();!(o=G.n()).done;){var F=o.value;if(F.ID==g&&F.PageRef==I){B=w.Signature;break}}}catch(A){G.e(A)}finally{G.f()}}}catch(A){D.e(A)}finally{D.f()}}return B}},{key:"getFontRes",value:function(A){var I,g,B=this.readOfdDocument(A);if(B)return null==B||null===(I=B.CommonData)||void 0===I||null===(g=I.Res)||void 0===g?void 0:g.Fonts}},{key:"getDocPln",value:function(A){var I=this.readOfdDocBody(A);if(I)return null==I?void 0:I.DocPln}},{key:"getAttachmentCount",value:function(A){var I=this.readOfdDocument(A);return I&&I.Attachments?I.Attachments.length:0}},{key:"getCustomTag",value:function(A){var I=this.readOfdDocument(A);return I&&I.CustomTags?I.CustomTags:null}},{key:"getPageIndexByPageId",value:function(A,I){if(!this.ofd)return 0;A?A>this.ofd.Document.length&&(A=this.ofd.Document.length-1):A=0;for(var g=this.ofd.Document[A],B=0;B<g.Pages.length;B++){if(g.Pages[B].ID==I)return B}}},{key:"getAllAttachment",value:function(A){var I=this.readOfdDocument(A);return I&&I.Attachments?I.Attachments:[]}},{key:"getAttachmentByIndex",value:function(A,I){var g=this.readOfdDocument(A);return g?g.Attachments[I]:null}},{key:"getAttachmentByID",value:function(A,I){var g=this.readOfdDocument(A);if(g){var B,Q=i(g.Attachments);try{for(Q.s();!(B=Q.n()).done;){var C=B.value;if(C.ID==I)return C}}catch(A){Q.e(A)}finally{Q.f()}}return null}},{key:"getTextObject",value:function(A,I){var g=[],B=this.readOfdPage(A,I);if(B){var Q,C=i(B.Page.Content.Layer);try{for(C.s();!(Q=C.n()).done;){var E,D=i(Q.value.PageBlock);try{for(D.s();!(E=D.n()).done;){var o=E.value;if("TextObject"==o.Type){var w,G="",F=i(o.TextCode);try{for(F.s();!(w=F.n()).done;){var N=w.value;G="".concat(G).concat(N.text)}}catch(A){F.e(A)}finally{F.f()}if(G.length>0){var y={id:o.ID,pageId:B.ID};y.text=G,g.push(y)}}}}catch(A){D.e(A)}finally{D.f()}}}catch(A){C.e(A)}finally{C.f()}}return g}},{key:"getAllTextObject",value:function(A){for(var I=[],g=this.readOfdDocument(A),B=0;B<g.Pages.length;B++){var Q=g.Pages[B];if(Q.Page.onlyReadArea){var C=Object(D.JSReadPageInfo)(this.ofdParserPtr,Q.BasePln,Q.BaseAbs,Q.pln,Q.abs);Q.Page=C.Page}if(Q){var E,o=i(Q.Page.Content.Layer);try{for(o.s();!(E=o.n()).done;){var w,G=i(E.value.PageBlock);try{for(G.s();!(w=G.n()).done;){var F=w.value;if("TextObject"==F.Type){var N,y="",R=i(F.TextCode);try{for(R.s();!(N=R.n()).done;){var h=N.value;y="".concat(y).concat(h.text)}}catch(A){R.e(A)}finally{R.f()}if(y.length>0){var M={id:F.ID,pageId:Q.ID,pageIndex:B+1};M.text=y,I.push(M)}}}}catch(A){G.e(A)}finally{G.f()}}}catch(A){o.e(A)}finally{o.f()}}}return I}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"Ofd_Core_Helper",(function(){return i}));var B=g(2),Q=g.n(B),C=g(1),E=g.n(C),D=g(29),i=function(){function A(){var I=arguments.length>0&&void 0!==arguments[0]?arguments[0]:96,g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";Q()(this,A),this.dpi=I,this.waterText=g}return E()(A,[{key:"setWaterText",value:function(A){this.waterText=A}},{key:"setWaterSetting",value:function(A){this.waterSetting=A}},{key:"setDpi",value:function(A){this.dpi=A}},{key:"pageRenderWidth",value:function(A,I,g){var B=g.pageWidth(A,I);return B=Object(D.converterDpi)(B,this.dpi)}},{key:"pageRenderHeight",value:function(A,I,g){var B=g.pageHeight(A,I);return B=Object(D.converterDpi)(B,this.dpi)}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"OfdCanvasRender",(function(){return M}));var B=g(4),Q=g.n(B),C=g(2),E=g.n(C),D=g(1),i=g.n(D),o=g(5),w=g.n(o),G=g(29),F=g(30),N=g(33),y=g(28);function R(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return h(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return h(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function h(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var M=function(){function A(I,g){E()(this,A),this.core=I,this.coreHelper=g,this.render=new y.Ofd_Render(this.core,this.coreHelper)}var I,g,B,C,D,o,h,M,U,c;return i()(A,[{key:"setOfdCore",value:function(A){this.core=A,this.render.setOfdCore(this.core)}},{key:"renderPageByCanvas",value:(c=Q()(w.a.mark((function A(I,g,B,Q,C){var E,D,i,o,y,h,M,U,c,k,S,s,Y,a,K,H,L,J,t,d,Z,n,e,q,l,W,r,x,f,b,V,p,m,T,X,j,O,z,u,P;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(E=C?C.readOfdDocument(B):this.core.readOfdDocument(B),D=C?C.readOfdPage(B,Q):this.core.readOfdPage(B,Q),i=D.Page.Template,E.Annotations,o=C?C.readOfdTemplatePage(B):this.core.readOfdTemplatePage(B),y=E.Signatures?E.Signatures.Signature:[],h=E.CommonData.Res.Fonts,M=E.CommonData.Res.DrawParams,E.CommonData.Res.ColorSpaces,U=E.CommonData.Res.CompositeGraphicUnits,c=E.CommonData.Res.MultiMedias,!i){A.next=64;break}k=R(i),A.prev=13,k.s();case 15:if((S=k.n()).done){A.next=56;break}s=S.value,Y=R(o),A.prev=18,Y.s();case 20:if((a=Y.n()).done){A.next=46;break}if((K=a.value).ID!=s.TemplateID){A.next=44;break}if(!(K=C?C.readPageFromTemplate(K):this.core.readPageFromTemplate(K)).Page.Content){A.next=43;break}H=K.Page.Content.Layer,L=R(H),A.prev=27,L.s();case 29:if((J=L.n()).done){A.next=35;break}return t=J.value,A.next=33,this.renderLayerByCanvas(I,g,h,M,c,U,t,!1);case 33:A.next=29;break;case 35:A.next=40;break;case 37:A.prev=37,A.t0=A.catch(27),L.e(A.t0);case 40:return A.prev=40,L.f(),A.finish(40);case 43:return A.abrupt("break",46);case 44:A.next=20;break;case 46:A.next=51;break;case 48:A.prev=48,A.t1=A.catch(18),Y.e(A.t1);case 51:return A.prev=51,Y.f(),A.finish(51);case 54:A.next=15;break;case 56:A.next=61;break;case 58:A.prev=58,A.t2=A.catch(13),k.e(A.t2);case 61:return A.prev=61,k.f(),A.finish(61);case 64:if(!D.Page.Content){A.next=83;break}d=D.Page.Content.Layer,Z=R(d),A.prev=67,Z.s();case 69:if((n=Z.n()).done){A.next=75;break}return e=n.value,A.next=73,this.renderLayerByCanvas(I,g,h,M,c,U,e,!1);case 73:A.next=69;break;case 75:A.next=80;break;case 77:A.prev=77,A.t3=A.catch(67),Z.e(A.t3);case 80:return A.prev=80,Z.f(),A.finish(80);case 83:q=R(y),A.prev=84,q.s();case 86:if((l=q.n()).done){A.next=134;break}W=l.value,r=R(W.Signature.SignedInfo.StampAnnot),A.prev=89,r.s();case 91:if((x=r.n()).done){A.next=124;break}if(f=x.value,b=f.PageRef,D.ID!=b){A.next=122;break}if(V=f.Boundary,!(W.Signature.PicType&&W.Signature.PicType.length>0)){A.next=122;break}if("ofd"!==W.Signature.PicType){A.next=108;break}p=new N.Ofd_Core(W.Signature.ofd,this.coreHelper.dpi),m=0;case 100:if(!(m<p.getOFDPageCount(0))){A.next=106;break}return A.next=103,this.renderSealPageOnCanvas(I,g,m,p,!0,V,b,f.ID);case 103:m++,A.next=100;break;case 106:A.next=122;break;case 108:if("svg"!==W.Signature.PicType){A.next=114;break}return T="data:image/svg+xml;base64,".concat(W.Signature.PicValue),A.next=112,this.renderSealSvgOnCanvas(I,g,T,V);case 112:A.next=122;break;case 114:return X=V.w,j=V.h,O=Object(G.converterBox)(V,this.coreHelper.dpi),z=Object(F.JSGetImageInfoByBase64)(W.Signature.PicValue),u=z.fileBase64,P={a:X,b:0,c:0,d:j,e:0,f:0},A.next=122,this.renderImageOnCanvas(I,g,u,z.width,z.height,O,f.Clip,!0,b,f.ID,P);case 122:A.next=91;break;case 124:A.next=129;break;case 126:A.prev=126,A.t4=A.catch(89),r.e(A.t4);case 129:return A.prev=129,r.f(),A.finish(129);case 132:A.next=86;break;case 134:A.next=139;break;case 136:A.prev=136,A.t5=A.catch(84),q.e(A.t5);case 139:return A.prev=139,q.f(),A.finish(139);case 142:case"end":return A.stop()}}),A,this,[[13,58,61,64],[18,48,51,54],[27,37,40,43],[67,77,80,83],[84,136,139,142],[89,126,129,132]])}))),function(A,I,g,B,Q){return c.apply(this,arguments)})},{key:"renderAnnotationOnCanvas",value:(U=Q()(w.a.mark((function A(I,g,B,Q,C,E,D){var i,o,F,N,y;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(i=B.Appearance,!(o=B.Appearance.Boundary)){A.next=15;break}if(0!==o.w&&0!==o.h){A.next=5;break}return A.abrupt("return");case 5:return F=Object(G.converterBox)(o,this.coreHelper.dpi),(N=document.createElement("canvas")).style.height="".concat(F.w,"px"),N.style.width="".concat(F.h,"px"),N.width=F.w,N.height=F.h,y=N.getContext("2d"),A.next=14,this.renderLayerByCanvas(N,y,Q,C,E,D,i,!1);case 14:g.drawImage(N,F.x,F.y);case 15:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,Q,C,E){return U.apply(this,arguments)})},{key:"renderSealSvgOnCanvas",value:(M=Q()(w.a.mark((function A(I,g,B,Q,C,E){var D;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return D=Object(G.converterBox)(Q,this.coreHelper.dpi),A.abrupt("return",new Promise((function(A,I){var Q=new Image;Q.src=B,Q.onload=function(){var I=Q.width,B=Q.height,C=document.createElement("canvas");if(C.style.height="".concat(I,"px"),C.style.width="".concat(B,"px"),C.width=I,C.height=B,C.getContext("2d").drawImage(Q,0,0),I!==D.w){var E=D.h/B<D.w/I?D.h/B:D.w/I,i=document.createElement("canvas");i.style.height="".concat(D.w,"px"),i.style.width="".concat(D.h,"px"),i.width=D.w,i.height=D.h;var o=i.getContext("2d");o.scale(E,E),o.drawImage(C,0,0),g.drawImage(i,D.x,D.y)}else g.drawImage(C,D.x,D.y);A()}})));case 2:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,Q,C){return M.apply(this,arguments)})},{key:"renderSealPageOnCanvas",value:(h=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i){var o,F,N,y,R,h,M,U,c,k;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return o={x:0,y:0,w:0,h:0},o=E,F={x:E.x,y:E.y,w:Q.pageWidth(0,B),h:Q.pageHeight(0,B)},N=Object(G.converterBox)(F,this.coreHelper.dpi),y=1,(R=document.createElement("canvas")).style.height="".concat(N.w,"px"),R.style.width="".concat(N.h,"px"),R.width=N.w,R.height=N.h,h=R.getContext("2d"),A.next=13,this.renderPageByCanvas(R,h,0,B,Q);case 13:h.scale(y,y),F.w!==o.w?(M=o.h/F.h<o.w/F.w?o.h/F.h:o.w/F.w,U=document.createElement("canvas"),c=Object(G.converterBox)(o,this.coreHelper.dpi),U.style.height="".concat(c.w,"px"),U.style.width="".concat(c.h,"px"),U.width=c.w,U.height=c.h,(k=U.getContext("2d")).scale(M,M),k.drawImage(R,0,0),g.drawImage(U,N.x,N.y)):g.drawImage(R,N.x,N.y);case 15:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,Q,C,E,D){return h.apply(this,arguments)})},{key:"renderLayerByCanvas",value:(o=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i,o,F,N){var y,h,M,U,c,k,S,s,Y,a,K,H,L,J,t;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(y=null,h=null,M=Object(G.converterDpi)(.353,this.coreHelper.dpi),(U=D.DrawParam)&&Object(G.getDrawParam)(Q,U)&&(c=Object(G.getDrawParam)(Q,U),Object(G.getDrawParam)(Q,c.Relative)&&(c=Object(G.getDrawParam)(Q,c.Relative)),c.FillColor&&(y=Object(G.parseColor)(c.FillColor.Value)),c.StrokeColor&&(y=Object(G.parseColor)(c.StrokeColor.Value)),c.LineWidth&&(M=Object(G.converterDpi)(c.LineWidth,this.coreHelper.dpi))),!(k=D.PageBlock)){A.next=60;break}S=R(k),A.prev=8,S.s();case 10:if((s=S.n()).done){A.next=52;break}if("ImageObject"!=(Y=s.value).Type){A.next=17;break}return A.next=15,this.renderImageObject(I,g,C,Y,i,F,N);case 15:A.next=50;break;case 17:if("PathObject"!=Y.Type){A.next=22;break}return A.next=20,this.renderPathObject(I,g,Q,Y,y,h,M,i,o,F,N,C,B);case 20:A.next=50;break;case 22:if("TextObject"!=Y.Type){A.next=27;break}return A.next=25,this.renderTextObject(I,g,B,Y,y,h,Q,o,F,N);case 25:A.next=50;break;case 27:if("CompositeObject"!=Y.Type){A.next=50;break}a=R(E),A.prev=29,a.s();case 31:if((K=a.n()).done){A.next=42;break}if((H=K.value).ID!==Y.ResourceID){A.next=40;break}return L=Y.Alpha,J=Y.Boundary,t=Y.CTM,A.next=39,this.renderLayerByCanvas(I,g,B,Q,C,E,H,!1,L,J,t);case 39:return A.abrupt("break",42);case 40:A.next=31;break;case 42:A.next=47;break;case 44:A.prev=44,A.t0=A.catch(29),a.e(A.t0);case 47:return A.prev=47,a.f(),A.finish(47);case 50:A.next=10;break;case 52:A.next=57;break;case 54:A.prev=54,A.t1=A.catch(8),S.e(A.t1);case 57:return A.prev=57,S.f(),A.finish(57);case 60:case"end":return A.stop()}}),A,this,[[8,54,57,60],[29,44,47,50]])}))),function(A,I,g,B,Q,C,E,D,i,w,G){return o.apply(this,arguments)})},{key:"renderImageObject",value:(D=Q()(w.a.mark((function A(I,g,B,Q,C,E,D){var i,o,N,y,R,h;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(i=Q.Boundary,i=Object(G.converterBox)(i,this.coreHelper.dpi),o=Q.ResourceID){A.next=5;break}return A.abrupt("return");case 5:return(N=Object(G.getMultiMedia)(B,o)).width>0||N.height>0||(y=Object(F.JSGetImageInfoByBase64)(N.FileBase64),N.width=y.width,N.height=y.height,N.FileBase64=y.fileBase64),R=Q.CTM,h=Q.Clips,A.next=11,this.renderImageOnCanvas(I,g,N.FileBase64,N.width,N.height,i,!1,C,null,null,R,E,D,h);case 11:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,Q,C,E){return D.apply(this,arguments)})},{key:"renderImageOnCanvas",value:(C=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i,o,F,N,y,h,M){var U=this;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(!i){A.next=4;break}return A.next=3,this.render.throwWhite(B);case 3:B=A.sent;case 4:return A.abrupt("return",new Promise((function(A,I){var D=E.x,i=E.y,o=new Image;o.src=B,o.width=Q,o.height=C;var w=U;o.onload=function(){if(y){var I=document.createElement("canvas");I.width=E.w,I.height=E.h,I.style.width="".concat(E.w,"px"),I.style.height="".concat(E.h,"px");var B=I.getContext("2d");N&&B.transform(N.a/Q/Object(G.ctmImageScale)(w.coreHelper.dpi),N.b/Q/Object(G.ctmImageScale)(w.coreHelper.dpi),N.c/C/Object(G.ctmImageScale)(w.coreHelper.dpi),N.d/C/Object(G.ctmImageScale)(w.coreHelper.dpi),Object(G.converterDpi)(N.e,w.coreHelper.dpi),Object(G.converterDpi)(N.f,w.coreHelper.dpi)),B.drawImage(o,0,0);var F=document.createElement("canvas"),U=Object(G.converterBox)(y,w.coreHelper.dpi),c=U.w,k=U.h,S=U.x,s=U.y;F.width=c,F.height=k,F.style.width="".concat(c,"px"),F.style.height="".concat(k,"px");var Y=F.getContext("2d");h&&Y.transform(h.a,h.b,h.c,h.d,Object(G.converterDpi)(h.e,w.coreHelper.dpi),Object(G.converterDpi)(h.f,w.coreHelper.dpi)),Y.drawImage(I,D,i),g.drawImage(F,S,s)}else{var a=document.createElement("canvas");a.width=Math.ceil(E.w),a.height=Math.ceil(E.h),a.style.width="".concat(Math.ceil(E.w),"px"),a.style.height="".concat(Math.ceil(E.h),"px");var K=a.getContext("2d");if(M&&M.length>0)for(var H=0;H<M.length;H++)for(var L=M[H].Clip,J=0;J<L.length;J++){var t=L[J].Area,d=void 0;t.CTM?d=t.CTM:N&&(d=N),K.beginPath();var Z,n=R(t.Path.AbbreviatedData);try{for(n.s();!(Z=n.n()).done;){var e=Z.value;if("M"===e.cmd||"S"===e.cmd){var q=e.crds[0],l=e.crds[1];if(d){var W=w.ctmCalPoint(q,l,d);q=W.ctmX,l=W.ctmY}K.moveTo(Object(G.converterDpi)(q,w.coreHelper.dpi),Object(G.converterDpi)(l,w.coreHelper.dpi))}else if("L"===e.cmd){var r=e.crds[0],x=e.crds[1];if(d){var f=w.ctmCalPoint(r,x,d);r=f.ctmX,x=f.ctmY}K.lineTo(Object(G.converterDpi)(r,w.coreHelper.dpi),Object(G.converterDpi)(x,w.coreHelper.dpi))}else if("B"===e.cmd){var b=e.crds[0],V=e.crds[1],p=e.crds[2],m=e.crds[3],T=e.crds[4],X=e.crds[5];if(d){var j=w.ctmCalPoint(b,V,d);b=j.ctmX,V=j.ctmY;var O=w.ctmCalPoint(p,m,d);p=O.ctmX,m=O.ctmY;var z=w.ctmCalPoint(T,X,d);T=z.ctmX,X=z.ctmY}K.bezierCurveTo(Object(G.converterDpi)(b,w.coreHelper.dpi),Object(G.converterDpi)(V,w.coreHelper.dpi),Object(G.converterDpi)(p,w.coreHelper.dpi),Object(G.converterDpi)(m,w.coreHelper.dpi),Object(G.converterDpi)(T,w.coreHelper.dpi),Object(G.converterDpi)(X,w.coreHelper.dpi))}else if("Q"===e.cmd){var u=e.crds[0],P=e.crds[1],v=e.crds[2],_=e.crds[3];if(d){var $=w.ctmCalPoint(u,P,d);u=$.ctmX,P=$.ctmY;var AA=w.ctmCalPoint(v,_,d);v=AA.ctmX,_=AA.ctmY}K.quadraticCurveTo(Object(G.converterDpi)(u,w.coreHelper.dpi),Object(G.converterDpi)(P,w.coreHelper.dpi),Object(G.converterDpi)(v,w.coreHelper.dpi),Object(G.converterDpi)(_,w.coreHelper.dpi))}else"A"===e.cmd||"C"===e.cmd&&K.closePath()}}catch(A){n.e(A)}finally{n.f()}K.clip()}N&&K.transform(N.a/Q/Object(G.ctmImageScale)(w.coreHelper.dpi),N.b/Q/Object(G.ctmImageScale)(w.coreHelper.dpi),N.c/C/Object(G.ctmImageScale)(w.coreHelper.dpi),N.d/C/Object(G.ctmImageScale)(w.coreHelper.dpi),Object(G.converterDpi)(N.e,w.coreHelper.dpi),Object(G.converterDpi)(N.f,w.coreHelper.dpi)),K.drawImage(o,0,0),g.drawImage(a,D,i)}A()}})));case 5:case"end":return A.stop()}}),A,this)}))),function(A,I,g,B,Q,E,D,i,o,w,G,F,N,y){return C.apply(this,arguments)})},{key:"ctmCalPoint",value:function(A,I,g){return{ctmX:A*g.a+I*g.c+1*g.e,ctmY:A*g.b+I*g.d+1*g.f}}},{key:"renderPathObject",value:(B=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i,o,F,N,y,h){var M,U,c,k,S,s,Y,a,K,H,L,J,t,d,Z,n,e,q,l,W,r,x,f,b,V,p,m,T,X,j,O,z,u,P,v,_,$,AA,IA,gA,BA,QA,CA,EA,DA,iA,oA;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(M=Q.Boundary){A.next=3;break}return A.abrupt("return");case 3:if(U=1,M=Object(G.converterBox)(M,this.coreHelper.dpi),c=Math.ceil(M.w),k=Math.ceil(M.h),S=M.x,s=M.y,c-0!=0&&k-0!=0){A.next=11;break}return A.abrupt("return");case 11:if(Y=document.createElement("canvas"),a=Y.getContext("2d"),Y.width=c*U,Y.height=k*U,Y.style.width="".concat(c,"px"),Y.style.height="".concat(k,"px"),K=Q.LineWidth,H=Q.AbbreviatedData,L=Q.CTM,J=Q.StrokeColor,t=Q.FillColor,K&&(D=Object(G.converterDpi)(K,this.coreHelper.dpi)),(d=Q.DrawParam)&&(Z=Object(G.getDrawParam)(B,d),(K=Z.LineWidth)&&(D=Object(G.converterDpi)(K,this.coreHelper.dpi)),Z.FillColor&&(t&&t.Value||(t=Z.FillColor)),Z.StrokeColor&&(J&&J.Value||(J=Z.StrokeColor))),L&&a.transform(L.a,L.b,L.c,L.d,Object(G.converterDpi)(L.e,this.coreHelper.dpi),Object(G.converterDpi)(L.f,this.coreHelper.dpi)),n=!1,J&&(J.Value&&(E=Object(G.parseColor)(J.Value)),e=J.axialShd)){n=!0,q=Object(G.parseCtm)(e.StartPoint),l=Object(G.parseCtm)(e.EndPoint),W=a.createLinearGradient(q[0],q[1],l[0],l[1]),r=R(e.Segment);try{for(r.s();!(x=r.n()).done;)(f=x.value)&&W.addColorStop(f.position,Object(G.parseColor)(f.color.Value))}catch(A){r.e(A)}finally{r.f()}a.lineWidth=D,a.strokeStyle=W}if(b=!1,t&&(t.Value&&(C=Object(G.parseColor)(t.Value)),t.Alpha&&0===t.Alpha&&(a.globalAlpha=0),V=t.AxialShd)){b=!0,p=Object(G.parseCtm)(V.StartPoint),m=Object(G.parseCtm)(V.EndPoint),T=a.createLinearGradient(p[0],p[1],m[0],m[1]),X=R(V.Segment);try{for(X.s();!(j=X.n()).done;)(O=j.value)&&T.addColorStop(O.position,Object(G.parseColor)(O.color.Value))}catch(A){X.e(A)}finally{X.f()}a.fillStyle=T}D>0&&!E&&((E=C)||(E="rgb(0, 0, 0)")),Q.Join&&a.setLineJoin(Q["@_Join"]),Q.Cap&&a.setLineCap(Q["@_Cap"]),Q.DashPattern&&(z=Q.DashPattern,u=Object(G.parseCtm)(z),Q.DashOffset&&Q.DashOffset,a.setLineDash([Object(G.converterDpi)(u[0],this.coreHelper.dpi),Object(G.converterDpi)(u[1],this.coreHelper.dpi)])),a.beginPath(),P=R(H);try{for(P.s();!(v=P.n()).done;)"M"===(_=v.value).cmd||"S"===_.cmd?a.moveTo(Object(G.converterDpi)(_.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(_.crds[1],this.coreHelper.dpi)):"L"===_.cmd?a.lineTo(Object(G.converterDpi)(_.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(_.crds[1],this.coreHelper.dpi)):"B"===_.cmd?a.bezierCurveTo(Object(G.converterDpi)(_.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(_.crds[1],this.coreHelper.dpi),Object(G.converterDpi)(_.crds[2],this.coreHelper.dpi),Object(G.converterDpi)(_.crds[3],this.coreHelper.dpi),Object(G.converterDpi)(_.crds[4],this.coreHelper.dpi),Object(G.converterDpi)(_.crds[5],this.coreHelper.dpi)):"Q"===_.cmd?a.quadraticCurveTo(Object(G.converterDpi)(_.crds[0],this.coreHelper.dpi),Object(G.converterDpi)(_.crds[1],this.coreHelper.dpi),Object(G.converterDpi)(_.crds[2],this.coreHelper.dpi),Object(G.converterDpi)(_.crds[3],this.coreHelper.dpi)):"A"===_.cmd||"C"===_.cmd&&a.closePath()}catch(A){P.e(A)}finally{P.f()}if(Q.Stroke&&(n||(a.strokeStyle=E,a.lineWidth=D),a.stroke()),$=t.pattern,!Q.Fill||$?a.fillStyle="none":(b||(a.fillStyle=C),a.fill(Q.Rule)),!$){A.next=52;break}return a.save(),AA=document.createElement("canvas"),IA=AA.getContext("2d"),AA.width=Object(G.converterDpi)($.width,this.coreHelper.dpi),AA.height=Object(G.converterDpi)($.height,this.coreHelper.dpi),A.next=48,this.renderLayerByCanvas(AA,IA,h,B,y,null,$,!1,null,null,null);case 48:gA=a.createPattern(AA,"repeat"),a.fillStyle=gA,a.fillRect(0,0,c,k),a.restore();case 52:F?(BA=document.createElement("canvas"),QA=Object(G.converterBox)(F,this.coreHelper.dpi),CA=QA.w,EA=QA.h,DA=QA.x,iA=QA.y,BA.width=CA*U,BA.height=EA*U,BA.style.width="".concat(CA,"px"),BA.style.height="".concat(EA,"px"),oA=BA.getContext("2d"),N&&oA.transform(N.a,N.b,N.c,N.d,Object(G.converterDpi)(N.e,this.coreHelper.dpi),Object(G.converterDpi)(N.f,this.coreHelper.dpi)),o&&(oA.globalAlpha=o/255),oA.drawImage(Y,S,s),g.drawImage(BA,DA,iA)):g.drawImage(Y,S,s);case 53:case"end":return A.stop()}}),A,this)}))),function(A,I,g,Q,C,E,D,i,o,w,G,F,N){return B.apply(this,arguments)})},{key:"renderTextObject",value:(g=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i,o,N){var y,h,M,U,c,k,S,s,Y,a,K,H,L,J,t,d,Z,n,e,q,l,W,r,x,f,b,V,p,m,T,X,j,O,z,u,P,v,_,$,AA,IA,gA,BA,QA,CA,EA,DA,iA,oA,wA,GA,FA,NA;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(y=1,h=Q.Boundary,h=Object(G.converterBox)(h,this.coreHelper.dpi),M=Q.CTM,U=Q.HScale,c=Q.Font,k=Q.Weight,S=Q.Size>0,M&&!S&&(M={a:-M.a,b:M.b,c:M.c,d:-M.d,e:-M.e,f:-M.f}),s=Object(G.converterDpi)(Math.abs(parseFloat(Q.Size)),this.coreHelper.dpi),Y=Object(G.calTextPoint)(this.coreHelper.dpi,Q.TextCode,Q.CGTransform,M,Q.Boundary,o,N,S),(a=document.createElementNS("http://www.w3.org/2000/svg","svg")).setAttribute("xmlns","http://www.w3.org/2000/svg"),a.setAttribute("version","1.1"),K=Q.FillColor,H=!1,(L=Q.DrawParam)&&(J=Object(G.getDrawParam)(D,L)).FillColor&&(K&&K.Value||(K=J.FillColor)),K&&(K.Value&&(C=Object(G.parseColor)(K.Value)),t=K.alpha,y=t/255,d=K.axialShd)){H=!0,(Z=document.createElementNS("http://www.w3.org/2000/svg","linearGradient")).setAttribute("id","".concat(Q.ID)),Z.setAttribute("x1","0%"),Z.setAttribute("y1","0%"),Z.setAttribute("x2","100%"),Z.setAttribute("y2","100%"),n=R(d.Segment);try{for(n.s();!(e=n.n()).done;)(q=e.value)&&((l=document.createElement("stop")).setAttribute("offset","".concat(100*q.position,"%")),l.setAttribute("style","stop-color:".concat(Object(G.parseColor)(q.color.Value),";stop-opacity:1")),Z.appendChild(l),C=Object(G.parseColor)(q.color.Value))}catch(A){n.e(A)}finally{n.f()}a.appendChild(Z)}Q.Fill||(y=0),W=h.w,r=h.h,x=h.x,f=h.y,b=s,V=s,p=0,M&&(m=M.a,T=M.b,X=M.c,j=M.d,O=m>0?Math.sign(m)*Math.sqrt(m*m+X*X):Math.sqrt(m*m+X*X),z=j>0?Math.sign(j)*Math.sqrt(T*T+j*j):Math.sqrt(T*T+j*j),0==(p=Math.atan2(-T,j))&&0!=m&&1==j||(b*=O,V*=z),0==p&&U-0==1&&(U=m/j)>0&&(b*=U)),N&&(u=N.a,P=N.b,v=N.c,_=N.d,$=u>0?Math.sign(u)*Math.sqrt(u*u+v*v):Math.sqrt(u*u+v*v),AA=_>0?Math.sign(_)*Math.sqrt(P*P+_*_):Math.sqrt(P*P+_*_),0==(p=Math.atan2(-P,_))&&0!=u&&1==_||(b*=$,V*=AA,f*=AA,x*=$,W*=$,r*=AA)),IA=Object(G.getFont)(B,c),gA=R(Y),A.prev=31,gA.s();case 33:if((BA=gA.n()).done){A.next=73;break}if(!(QA=BA.value)||isNaN(QA.x)){A.next=71;break}if(!QA.glyph){A.next=59;break}if(!IA||!IA.face){A.next=57;break}if(CA=Object(F.loadFaceInfo)(IA.face),EA=Object(F.FT_Glyph_Get_Measure)(IA.face,QA.glyph),(DA=this.render.drawGlyph(EA.glyphPath,EA.horiUnderlinePosition,CA.units_per_EM,b,V,E||C,y)).img.setAttribute("style","width: ".concat(Math.ceil(b),"px; height:").concat(Math.ceil(V),"px")),iA="data:image/svg+xml;base64,".concat(Object(F.base64Encode)(DA.img.outerHTML)),0!==p){A.next=48;break}return A.next=46,this.drawTextFromSvg(I,g,iA,Math.ceil(QA.cx),QA.cy-DA.yScale*EA.horiUnderlinePosition-V);case 46:A.next=57;break;case 48:return(oA=document.createElement("canvas")).style.width="".concat(Math.ceil(b),"px"),oA.style.height="".concat(Math.ceil(V),"px"),oA.width=Math.ceil(b),oA.height=Math.ceil(V),wA=oA.getContext("2d"),A.next=56,this.drawTextFromSvg(oA,wA,iA,0,0,p,Math.ceil(b)/2,Math.ceil(V)/2);case 56:g.drawImage(oA,Math.ceil(QA.cx),QA.cy-DA.yScale*EA.horiUnderlinePosition-V);case 57:A.next=71;break;case 59:(GA=document.createElementNS("http://www.w3.org/2000/svg","text")).setAttribute("x",QA.x),GA.setAttribute("y",QA.y),GA.innerHTML=QA.text,FA="",M&&(FA="matrix(".concat(M.a," ").concat(M.b," ").concat(M.c," ").concat(M.d," ").concat(Object(G.converterDpi)(M.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(M.f,this.coreHelper.dpi),")")),N&&(FA="".concat(FA," matrix(").concat(N.a," ").concat(N.b," ").concat(N.c," ").concat(N.d," ").concat(Object(G.converterDpi)(N.e,this.coreHelper.dpi)," ").concat(Object(G.converterDpi)(N.f,this.coreHelper.dpi),")")),U&&(FA="".concat(FA," matrix(").concat(U,", 0, 0, 1, ").concat((1-U)*QA.x,", 0)")),GA.setAttribute("transform",FA),H?GA.setAttribute("fill",C):(GA.setAttribute("fill",E),GA.setAttribute("fill",C),GA.setAttribute("fill-opacity",y)),GA.setAttribute("style","font-weight: ".concat(k,";font-size:").concat(s,"px;font-family: ").concat(Object(G.getFontFamily)(IA),";")),a.appendChild(GA);case 71:A.next=33;break;case 73:A.next=78;break;case 75:A.prev=75,A.t0=A.catch(31),gA.e(A.t0);case 78:return A.prev=78,gA.f(),A.finish(78);case 81:return a.setAttribute("style","overflow:visible;width:".concat(W,"px;height:").concat(r,"px")),NA="data:image/svg+xml;base64,".concat(Object(F.base64Encode)(a.outerHTML)),A.next=85,this.drawTextFromSvg(I,g,NA,x,f);case 85:case"end":return A.stop()}}),A,this,[[31,75,78,81]])}))),function(A,I,B,Q,C,E,D,i,o,w){return g.apply(this,arguments)})},{key:"drawTextFromSvg",value:(I=Q()(w.a.mark((function A(I,g,B,Q,C,E,D,i){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return",new Promise((function(A,I){var o=new Image;o.src=B,o.onload=function(){0!=E&&D&&i&&(g.translate(D,i),g.rotate(-E),g.translate(-D,-i)),g.drawImage(o,Q,C),A()}})));case 1:case"end":return A.stop()}}),A)}))),function(A,g,B,Q,C,E,D,i){return I.apply(this,arguments)})}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"OfdThumbnailViewer",(function(){return y}));var B=g(2),Q=g.n(B),C=g(1),E=g.n(C),D=g(20),i=g(27),o=g(35),w=g(34);function G(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return F(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return F(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function F(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var N="selected",y=function(){function A(I,g){Q()(this,A),this.core=null,this.coreHelper=new w.Ofd_Core_Helper(96),this.ofdCanvasRender=new o.OfdCanvasRender(null,this.coreHelper),this.eventBus=g,this.container=I,this.pageDIV=[],this.currentPage=1,this.container&&(this.scroll=Object(D.watchScroll)(this.container,this._scrollUpdate.bind(this)))}return E()(A,[{key:"emptyNode",value:function(A){if(A)for(;A.firstChild;)A.removeChild(A.firstChild)}},{key:"freeThumbnailDocument",value:function(){this.pageDIV=[];var A=this.container;this.emptyNode(A)}},{key:"getScrollAhead",value:function(A){return!(!A.first||1!==A.first.id)||(!A.last||A.last.id!==this.pageDIV.length)&&scroll.down}},{key:"_scrollUpdate",value:function(){0!==this.core.getOFDPageCount(0)&&this.updateThumbnailView()}},{key:"_getVisibleThumbs",value:function(){return Object(D.getVisibleElements)({scrollEl:this.container,views:this.pageDIV})}},{key:"updateThumbnailView",value:function(){var A=this,I=this._getVisibleThumbs();if(0!==I.views.length){var g=this.getScrollAhead(I),B=Object(i.getHighestPriority)(I,this.pageDIV,g);if(B&&B.renderingState===D.RenderingStates.INITIAL){B.renderingState=D.RenderingStates.RUNNING;var Q=B.ring,C=document.createElement("canvas"),E=C.getContext("2d");C.style.height=Q.style.height,C.style.width=Q.style.width,C.width=1*this.coreHelper.pageRenderWidth(0,B.id-1,this.core),C.height=1*this.coreHelper.pageRenderHeight(0,B.id-1,this.core);var o=C.width/C.height,w=document.createElement("img");w.className="thumbnailImage",w.style.width="98px",w.style.height=98/o+"px",this.ofdCanvasRender.renderPageByCanvas(C,E,0,B.id-1).then((function(I){var g=C.toDataURL();w.src=g,B.renderingState=D.RenderingStates.FINISHED,A.updateThumbnailView()})),Q.appendChild(w)}}}},{key:"scrollThumbnailIntoView",value:function(A){if(A){var I=this.pageDIV[A-1];if(I){if(A!==this.currentPage)this.pageDIV[this.currentPage-1].div.classList.remove(N),I.div.classList.add(N);var g=this._getVisibleThumbs(),B=g.first,Q=g.last,C=g.views;if(C.length>0){var E=!1;if(A<=B.id||A>=Q.id)E=!0;else{var i,o=G(C);try{for(o.s();!(i=o.n()).done;){var w=i.value,F=w.id,y=w.percent;if(F===A){E=y<100;break}}}catch(A){o.e(A)}finally{o.f()}}E&&Object(D.scrollIntoView)(I.div,{top:-19})}this.currentPage=A}}}},{key:"setOfdCore",value:function(A){var I=this;if(this.container){this.core&&this.freeThumbnailDocument(),this.core=A,this.ofdCanvasRender.setOfdCore(this.core);for(var g=this.container,B=this,Q=function(A){var Q=I.coreHelper.pageRenderWidth(0,A,I.core)/I.coreHelper.pageRenderHeight(0,A,I.core),C=document.createElement("a");C.onclick=function(){return B.eventBus.dispatch("jumpPage",{source:this,pageIndex:A+1}),!1};var E=document.createElement("div");E.className="thumbnail",E.setAttribute("data-page-number","".concat(A+1));var i=document.createElement("div");i.className="thumbnailSelectionRing";i.style.width="100px",i.style.height=98/Q+2+"px",E.appendChild(i),C.appendChild(E),I.pageDIV[A]={ring:i,div:E,anchor:C,id:A+1,renderingState:D.RenderingStates.INITIAL},g.appendChild(C)},C=0;C<this.core.getOFDPageCount(0);++C)Q(C);this.updateThumbnailView()}}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"PDFSidebar",(function(){return o}));var B=g(2),Q=g.n(B),C=g(1),E=g.n(C),D=g(20),i="pdfSidebarNotification",o=function(){function A(I){var g=I.elements,B=I.ofdViewer,C=I.ofdThumbnailViewer,E=I.eventBus,i=I.l10n;Q()(this,A),this.isOpen=!1,this.active=D.SidebarView.OUTLINE,this.isInitialViewSet=!1,this.onToggled=null,this.ofdViewer=B,this.ofdThumbnailViewer=C,this.outerContainer=g.outerContainer,this.viewerContainer=g.viewerContainer,this.toggleButton=g.toggleButton,this.thumbnailButton=g.thumbnailButton,this.outlineButton=g.outlineButton,this.attachmentsButton=g.attachmentsButton,this.layersButton=g.layersButton,this.signaturesButton=g.signaturesButton,this.thumbnailView=g.thumbnailView,this.outlineView=g.outlineView,this.attachmentsView=g.attachmentsView,this.layersView=g.layersView,this.signaturesView=g.signaturesView,this._outlineOptionsContainer=g.outlineOptionsContainer,this._currentOutlineItemButton=g.currentOutlineItemButton,this.eventBus=E,this.l10n=i,this._addEventListeners()}return E()(A,[{key:"reset",value:function(){this.isInitialViewSet=!1,this._hideUINotification(!0),this.switchView(D.SidebarView.OUTLINE),this.outlineButton.disabled=!1,this.attachmentsButton.disabled=!1,this.layersButton.disabled=!1,this._currentOutlineItemButton.disabled=!0}},{key:"visibleView",get:function(){return this.isOpen?this.active:D.SidebarView.NONE}},{key:"isThumbnailViewVisible",get:function(){return this.isOpen&&this.active===D.SidebarView.THUMBS}},{key:"isOutlineViewVisible",get:function(){return this.isOpen&&this.active===D.SidebarView.OUTLINE}},{key:"isAttachmentsViewVisible",get:function(){return this.isOpen&&this.active===D.SidebarView.ATTACHMENTS}},{key:"isLayersViewVisible",get:function(){return this.isOpen&&this.active===D.SidebarView.LAYERS}},{key:"isSignatureViewVisible",get:function(){return this.isOpen&&this.active===D.SidebarView.SIGNATURES}},{key:"setInitialView",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:D.SidebarView.NONE;this.isInitialViewSet||(this.isInitialViewSet=!0,A!==D.SidebarView.NONE&&A!==D.SidebarView.UNKNOWN&&this._switchView(A,!0)||this._dispatchEvent())}},{key:"switchView",value:function(A){var I=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._switchView(A,I)}},{key:"_switchView",value:function(A){var I=arguments.length>1&&void 0!==arguments[1]&&arguments[1],g=A!==this.active,B=!1;switch(A){case D.SidebarView.NONE:return!!this.isOpen&&(this.close(),!0);case D.SidebarView.THUMBS:this.isOpen&&g&&(B=!0);break;case D.SidebarView.OUTLINE:if(this.outlineButton.disabled)return!1;break;case D.SidebarView.ATTACHMENTS:if(this.attachmentsButton.disabled)return!1;break;case D.SidebarView.LAYERS:if(this.layersButton.disabled)return!1;break;case D.SidebarView.SIGNATURES:if(this.signaturesButton.disabled)return!1;break;default:return!1}this.active=A;var Q=A===D.SidebarView.THUMBS,C=A===D.SidebarView.OUTLINE,E=A===D.SidebarView.ATTACHMENTS,i=A===D.SidebarView.LAYERS,o=A===D.SidebarView.SIGNATURES;return this.thumbnailButton&&this.thumbnailButton.classList.toggle("toggled",Q),this.outlineButton&&this.outlineButton.classList.toggle("toggled",C),this.attachmentsButton&&this.attachmentsButton.classList.toggle("toggled",E),this.layersButton&&this.layersButton.classList.toggle("toggled",i),this.signaturesButton&&this.signaturesButton.classList.toggle("toggled",o),this.thumbnailButton&&this.thumbnailButton.setAttribute("aria-checked",Q),this.outlineButton&&this.outlineButton.setAttribute("aria-checked",C),this.attachmentsButton&&this.attachmentsButton.setAttribute("aria-checked",E),this.layersButton&&this.layersButton.setAttribute("aria-checked",i),this.signaturesButton&&this.signaturesButton.setAttribute("aria-checked",o),this.thumbnailView&&this.thumbnailView.classList.toggle("hidden",!Q),this.outlineView&&this.outlineView.classList.toggle("hidden",!C),this.attachmentsView&&this.attachmentsView.classList.toggle("hidden",!E),this.layersView&&this.layersView.classList.toggle("hidden",!i),this.signaturesView&&this.signaturesView.classList.toggle("hidden",!o),this._outlineOptionsContainer&&this._outlineOptionsContainer.classList.toggle("hidden",!C),I&&!this.isOpen?(this.open(),!0):(B&&(this._updateThumbnailViewer(),this._forceRendering()),g&&this._dispatchEvent(),g)}},{key:"open",value:function(){this.isOpen||(this.isOpen=!0,this.toggleButton.classList.add("toggled"),this.toggleButton.setAttribute("aria-expanded","true"),this.outerContainer.classList.add("sidebarMoving","sidebarOpen"),this.active===D.SidebarView.THUMBS&&this._updateThumbnailViewer(),this._forceRendering(),this._dispatchEvent(),this._hideUINotification())}},{key:"close",value:function(){this.isOpen&&(this.isOpen=!1,this.toggleButton.classList.remove("toggled"),this.toggleButton.setAttribute("aria-expanded","false"),this.outerContainer.classList.add("sidebarMoving"),this.outerContainer.classList.remove("sidebarOpen"),this._forceRendering(),this._dispatchEvent())}},{key:"toggle",value:function(){this.isOpen?this.close():this.open()}},{key:"_dispatchEvent",value:function(){this.eventBus.dispatch("sidebarviewchanged",{source:this,view:this.isOutlineViewVisible})}},{key:"_forceRendering",value:function(){this.onToggled?this.onToggled():(this.ofdViewer.forceRendering(),this.ofdThumbnailViewer&&this.ofdThumbnailViewer.updateThumbnailView())}},{key:"_updateThumbnailViewer",value:function(){var A=this.ofdViewer;this.ofdThumbnailViewer.scrollThumbnailIntoView(A.currentPageNumber)}},{key:"_showUINotification",value:function(){var A=this;this.l10n.get("toggle_sidebar_notification2.title").then((function(I){A.toggleButton.title=I})),this.isOpen||this.toggleButton.classList.add(i)}},{key:"_hideUINotification",value:function(){var A=this,I=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(this.isOpen||I)&&this.toggleButton.classList.remove(i),I&&this.l10n.get("toggle_sidebar.title").then((function(I){A.toggleButton.title=I}))}},{key:"_addEventListeners",value:function(){var A,I,g,B,Q,C,E,i,o,w,G=this;null===(A=this.viewerContainer)||void 0===A||A.addEventListener("transitionend",(function(A){A.target===G.viewerContainer&&G.outerContainer.classList.remove("sidebarMoving")})),null===(I=this.toggleButton)||void 0===I||I.addEventListener("click",(function(){G.toggle()})),null===(g=this.thumbnailButton)||void 0===g||g.addEventListener("click",(function(){G.switchView(D.SidebarView.THUMBS)})),null===(B=this.outlineButton)||void 0===B||B.addEventListener("click",(function(){G.switchView(D.SidebarView.OUTLINE)})),null===(Q=this.outlineButton)||void 0===Q||Q.addEventListener("dblclick",(function(){G.eventBus.dispatch("toggleoutlinetree",{source:G})})),null===(C=this.attachmentsButton)||void 0===C||C.addEventListener("click",(function(){G.switchView(D.SidebarView.ATTACHMENTS)})),null===(E=this.layersButton)||void 0===E||E.addEventListener("click",(function(){G.switchView(D.SidebarView.LAYERS)})),null===(i=this.layersButton)||void 0===i||i.addEventListener("dblclick",(function(){G.eventBus.dispatch("resetlayers",{source:G})})),null===(o=this.signaturesButton)||void 0===o||o.addEventListener("click",(function(){G.switchView(D.SidebarView.SIGNATURES)})),null===(w=this._currentOutlineItemButton)||void 0===w||w.addEventListener("click",(function(){G.eventBus.dispatch("currentoutlineitem",{source:G})}));var F=function(A,I,g){I.disabled=!A,A?G._showUINotification():G.active===g&&G.switchView(D.SidebarView.THUMBS)};this.eventBus._on("outlineloaded",(function(A){F(A.outlineCount,G.outlineButton,D.SidebarView.OUTLINE),A.currentOutlineItemPromise.then((function(A){G.isInitialViewSet&&(G._currentOutlineItemButton.disabled=!A)}))})),this.eventBus._on("attachmentsloaded",(function(A){F(A.attachmentsCount,G.attachmentsButton,D.SidebarView.ATTACHMENTS)})),this.eventBus._on("layersloaded",(function(A){F(A.layersCount,G.layersButton,D.SidebarView.LAYERS)})),this.eventBus._on("presentationmodechanged",(function(A){A.state===D.PresentationModeState.NORMAL&&G.isThumbnailViewVisible&&G._updateThumbnailViewer()}))}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"OverlayManager",(function(){return G}));var B=g(4),Q=g.n(B),C=g(2),E=g.n(C),D=g(1),i=g.n(D),o=g(5),w=g.n(o),G=function(){function A(){E()(this,A),this.overlays=new WeakMap}var I,g,B,C;return i()(A,[{key:"register",value:(C=Q()(w.a.mark((function A(I){var g,B=this,Q=arguments;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(g=Q.length>1&&void 0!==Q[1]&&Q[1],"object"==typeof I){A.next=5;break}throw new Error("Not enough parameters.");case 5:if(!this.overlays.has(I)){A.next=7;break}throw new Error("The overlay is already registered.");case 7:this.overlays.set(I,{canForceClose:g}),"undefined"!=typeof PDFJSDev&&PDFJSDev.test("GENERIC && !SKIP_BABEL")&&I.showModal,I.addEventListener("cancel",(function(A){B.active=null}));case 10:case"end":return A.stop()}}),A,this)}))),function(A){return C.apply(this,arguments)})},{key:"unregister",value:(B=Q()(w.a.mark((function A(I){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(this.overlays.has(I)){A.next=4;break}throw new Error("The overlay does not exist.");case 4:if(this.active!==I){A.next=6;break}throw new Error("The overlay cannot be removed while it is active.");case 6:this.overlays.delete(I);case 7:case"end":return A.stop()}}),A,this)}))),function(A){return B.apply(this,arguments)})},{key:"open",value:(g=Q()(w.a.mark((function A(I){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(this.overlays.has(I)){A.next=4;break}throw new Error("The overlay does not exist.");case 4:if(!this.active){A.next=15;break}if(this.active!==I){A.next=9;break}this.active=null,A.next=15;break;case 9:if(!this.overlays.get(I).canForceClose){A.next=14;break}return A.next=12,this.close();case 12:A.next=15;break;case 14:this.active=null;case 15:this.active=I,"function"==typeof I.showModal&&I.showModal();case 17:case"end":return A.stop()}}),A,this)}))),function(A){return g.apply(this,arguments)})},{key:"close",value:(I=Q()(w.a.mark((function A(){var I,g=arguments;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(I=g.length>0&&void 0!==g[0]?g[0]:this.active,this.overlays.has(I)){A.next=5;break}throw new Error("The overlay does not exist.");case 5:if(this.active){A.next=9;break}throw new Error("The overlay is currently not active.");case 9:if(this.active===I){A.next=11;break}throw new Error("Another overlay is currently active.");case 11:I.close(),this.active=null;case 13:case"end":return A.stop()}}),A,this)}))),function(){return I.apply(this,arguments)})}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"PDFDocumentProperties",(function(){return F}));var B=g(4),Q=g.n(B),C=g(2),E=g.n(C),D=g(1),i=g.n(D),o=g(5),w=g.n(o),G=(g(20),"-"),F=function(){function A(I,g,B,Q){var C=this,D=I.dialog,i=I.fields,o=I.closeButton;E()(this,A),this.dialog=D,this.fields=i,this.overlayManager=g,this.l10n=Q,this.fieldData=null,this.reset(),o.addEventListener("click",this.close.bind(this)),this.overlayManager.register(this.dialog),B._on("pagechanging",(function(A){C._currentPageNumber=A.pageNumber})),B._on("rotationchanging",(function(A){C._pagesRotation=A.pagesRotation})),this._isNonMetricLocale=!0}var I,g;return i()(A,[{key:"open",value:(g=Q()(w.a.mark((function A(){var I,g,B,Q,C,E;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(this.dialog.hidden=!1,this.ofdCore){A.next=3;break}return A.abrupt("return");case 3:if(this.overlayManager.open(this.dialog),I=this._currentPageNumber,g=this._pagesRotation,!this.fieldData||I!==this.fieldData._currentPageNumber||g!==this.fieldData._pagesRotation){A.next=9;break}return this.updateUI(),A.abrupt("return");case 9:B=this.getMetadata(),Q=B.info,B.contentDispositionFilename,C=B.contentLength,E=this.parseFileSize(C),this.fieldData=Object.freeze({fileSize:E,title:Q.Title,author:Q.Author,subject:Q.Subject,keywords:Q.Keywords,creationDate:Q.CreationDate,modificationDate:Q.ModificationDate,creator:Q.Creator,producer:Q.Producer,version:Q.CreatorVersion,pageCount:Q.numPages,pageSize:Q.pageSize,_currentPageNumber:I,_pagesRotation:g}),this.updateUI();case 13:case"end":return A.stop()}}),A,this)}))),function(){return g.apply(this,arguments)})},{key:"close",value:(I=Q()(w.a.mark((function A(){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:this.overlayManager.close(this.dialog);case 1:case"end":return A.stop()}}),A,this)}))),function(){return I.apply(this,arguments)})},{key:"setOfdCore",value:function(A){var I=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.ofdCore&&(this.reset(),this.updateUI(!0)),A&&(this.ofdCore=A,this.url=I)}},{key:"getMetadata",value:function(){if(this.ofdCore)return{info:this.ofdCore.getMetadata(0),contentLength:this.ofdCore.ofd.size}}},{key:"reset",value:function(){this.ofdCore=null,this.url=null,this.fieldData=null,this._currentPageNumber=1,this._pagesRotation=0}},{key:"updateUI",value:function(){var A=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!A&&this.fieldData){if(this.overlayManager.active===this.dialog)for(var I in this.fields){var g=this.fieldData[I];this.fields[I].textContent=g||0===g?g:G}}else for(var B in this.fields)this.fields[B].textContent=G}},{key:"parseFileSize",value:function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,I=A/1024,g=I/1024;if(I)return g>=1?"".concat(g>=1&&(+g.toPrecision(3)).toLocaleString(),"mb(").concat(A.toLocaleString(),"字节)"):"".concat(g<1&&(+I.toPrecision(3)).toLocaleString(),"kb(").concat(A.toLocaleString(),"字节)")}},{key:"parseLinearization",value:function(A){return this.l10n.get("document_properties_linearized_".concat(A?"yes":"no"))}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"Toolbar",(function(){return G}));var B=g(2),Q=g.n(B),C=g(1),E=g.n(C),D=g(20);function i(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return o(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return o(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function o(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var w="visiblePageIsLoading",G=function(){function A(I,g,B){Q()(this,A),this.toolbar=I.container,this.eventBus=g,this.l10n=B,this.buttons=[{element:I.previous,eventName:"previouspage"},{element:I.next,eventName:"nextpage"},{element:I.zoomIn,eventName:"zoomin"},{element:I.zoomOut,eventName:"zoomout"},{element:I.openFile,eventName:"openfile"},{element:I.print,eventName:"print"},{element:I.presentationModeButton,eventName:"presentationmode"},{element:I.download,eventName:"download"},{element:I.viewBookmark,eventName:null}],this.items={numPages:I.numPages,pageNumber:I.pageNumber,scaleSelect:I.scaleSelect,customScaleOption:I.customScaleOption,previous:I.previous,next:I.next,zoomIn:I.zoomIn,zoomOut:I.zoomOut},this._wasLocalized=!1,this.reset(),this._bindListeners()}return E()(A,[{key:"setPageNumber",value:function(A,I){this.pageNumber=A,this.pageLabel=I,this._updateUIState(!1)}},{key:"setPagesCount",value:function(A,I){this.pagesCount=A,this.hasPageLabels=I,this._updateUIState(!0)}},{key:"setPageScale",value:function(A,I){this.pageScaleValue=(A||I).toString(),this.pageScale=I,this._updateUIState(!1)}},{key:"reset",value:function(){this.pageNumber=0,this.pageLabel=null,this.hasPageLabels=!1,this.pagesCount=0,this.pageScaleValue=D.DEFAULT_SCALE_VALUE,this.pageScale=D.DEFAULT_SCALE,this._updateUIState(!0),this.updateLoadingIndicatorState()}},{key:"_bindListeners",value:function(){var A,I=this,g=this.items,B=g.pageNumber,Q=g.scaleSelect,C=this,E=i(this.buttons);try{var o=function(){var g=A.value,B=g.element,Q=g.eventName;null==B||B.addEventListener("click",(function(A){null!==Q&&I.eventBus.dispatch(Q,{source:I})}))};for(E.s();!(A=E.n()).done;)o()}catch(A){E.e(A)}finally{E.f()}B.addEventListener("click",(function(){this.select()})),B.addEventListener("change",(function(){C.eventBus.dispatch("pagenumberchanged",{source:C,value:this.value})})),Q.addEventListener("change",(function(){"custom"!==this.value&&C.eventBus.dispatch("scalechanged",{source:C,value:this.value})})),Q.addEventListener("click",(function(A){var I=A.target;this.value===C.pageScaleValue&&"OPTION"===I.tagName.toUpperCase()&&this.blur()})),Q.oncontextmenu=D.noContextMenuHandler,this.eventBus._on("localized",(function(){I._wasLocalized=!0,I._updateUIState(!0)}))}},{key:"_updateUIState",value:function(){var A=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this._wasLocalized){var I=this.pageNumber,g=this.pagesCount,B=this.pageScaleValue,Q=this.pageScale,C=this.items;A&&(this.hasPageLabels?C.pageNumber.type="text":(C.pageNumber.type="number",this.l10n.get("of_pages",{pagesCount:g}).then((function(A){C.numPages.textContent=A}))),C.pageNumber.max=g),this.hasPageLabels?(C.pageNumber.value=this.pageLabel,this.l10n.get("page_of_pages",{pageNumber:I,pagesCount:g}).then((function(A){C.numPages.textContent=A}))):C.pageNumber.value=I,C.previous.disabled=I<=1,C.next.disabled=I>=g,C.zoomOut.disabled=Q<=D.MIN_SCALE,C.zoomIn.disabled=Q>=D.MAX_SCALE;var E,o=!1,w=i(C.scaleSelect.options);try{for(w.s();!(E=w.n()).done;){var G=E.value;G.value===B?(G.selected=!0,o=!0):G.selected=!1}}catch(A){w.e(A)}finally{w.f()}o||(C.customScaleOption.textContent="".concat(1e4*Q/100,"%"),C.customScaleOption.selected=!0)}}},{key:"updateLoadingIndicatorState",value:function(){var A=arguments.length>0&&void 0!==arguments[0]&&arguments[0],I=this.items.pageNumber;I.classList.toggle(w,A)}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"SecondaryToolbar",(function(){return G}));var B=g(2),Q=g.n(B),C=g(1),E=g.n(C),D=g(20),i=g(42);function o(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return w(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return w(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function w(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var G=function(){function A(I,g,B){Q()(this,A),this.toolbar=I.toolbar,this.toggleButton=I.toggleButton,this.toolbarButtonContainer=I.toolbarButtonContainer,this.buttons=[{element:I.presentationModeButton,eventName:"presentationmode",close:!0},{element:I.openFileButton,eventName:"openfile",close:!0},{element:I.printButton,eventName:"print",close:!0},{element:I.downloadButton,eventName:"download",close:!0},{element:I.viewBookmarkButton,eventName:null,close:!0},{element:I.firstPageButton,eventName:"firstpage",close:!0},{element:I.lastPageButton,eventName:"lastpage",close:!0},{element:I.pageRotateCwButton,eventName:"rotatecw",close:!1},{element:I.pageRotateCcwButton,eventName:"rotateccw",close:!1},{element:I.cursorSelectToolButton,eventName:"switchcursortool",eventDetails:{tool:i.CursorTool.SELECT},close:!0},{element:I.cursorHandToolButton,eventName:"switchcursortool",eventDetails:{tool:i.CursorTool.HAND},close:!0},{element:I.scrollPageButton,eventName:"switchscrollmode",eventDetails:{mode:D.ScrollMode.PAGE},close:!0},{element:I.scrollVerticalButton,eventName:"switchscrollmode",eventDetails:{mode:D.ScrollMode.VERTICAL},close:!0},{element:I.scrollHorizontalButton,eventName:"switchscrollmode",eventDetails:{mode:D.ScrollMode.HORIZONTAL},close:!0},{element:I.scrollWrappedButton,eventName:"switchscrollmode",eventDetails:{mode:D.ScrollMode.WRAPPED},close:!0},{element:I.spreadNoneButton,eventName:"switchspreadmode",eventDetails:{mode:D.SpreadMode.NONE},close:!0},{element:I.spreadOddButton,eventName:"switchspreadmode",eventDetails:{mode:D.SpreadMode.ODD},close:!0},{element:I.spreadEvenButton,eventName:"switchspreadmode",eventDetails:{mode:D.SpreadMode.EVEN},close:!0},{element:I.documentPropertiesButton,eventName:"documentproperties",close:!0},{element:I.closeButton,eventName:"closePage",close:!0}],this.items={firstPage:I.firstPageButton,lastPage:I.lastPageButton,pageRotateCw:I.pageRotateCwButton,pageRotateCcw:I.pageRotateCcwButton},this.mainContainer=g,this.eventBus=B,this.opened=!1,this.containerHeight=null,this.previousContainerHeight=null,this.reset(),this.bindClickListeners(),this.bindCursorToolsListener(I),this.bindScrollModeListener(I),this.bindSpreadModeListener(I),this.eventBus._on("resize",this.setMaxHeight.bind(this))}return E()(A,[{key:"isOpen",get:function(){return this.opened}},{key:"setPageNumber",value:function(A){this.pageNumber=A,this.updateUIState()}},{key:"setPagesCount",value:function(A){this.pagesCount=A,this.updateUIState()}},{key:"reset",value:function(){this.pageNumber=0,this.pagesCount=0,this.updateUIState(),this.eventBus.dispatch("secondarytoolbarreset",{source:this})}},{key:"updateUIState",value:function(){this.items.firstPage&&(this.items.firstPage.disabled=this.pageNumber<=1),this.items.lastPage&&(this.items.lastPage.disabled=this.pageNumber>=this.pagesCount),this.items.pageRotateCw&&(this.items.pageRotateCw.disabled=0===this.pagesCount),this.items.pageRotateCcw&&(this.items.pageRotateCcw.disabled=0===this.pagesCount)}},{key:"bindClickListeners",value:function(){var A,I=this;null===(A=this.toggleButton)||void 0===A||A.addEventListener("click",this.toggle.bind(this));var g,B=o(this.buttons);try{var Q=function(){var A=g.value,B=A.element,Q=A.eventName,C=A.close,E=A.eventDetails;null==B||B.addEventListener("click",(function(A){if(null!==Q){var g={source:I};for(var B in E)g[B]=E[B];I.eventBus.dispatch(Q,g)}C&&I.close()}))};for(B.s();!(g=B.n()).done;)Q()}catch(A){B.e(A)}finally{B.f()}}},{key:"bindCursorToolsListener",value:function(A){var I=A.cursorSelectToolButton,g=A.cursorHandToolButton;this.eventBus._on("cursortoolchanged",(function(A){var B=A.tool,Q=B===i.CursorTool.SELECT,C=B===i.CursorTool.HAND;I.classList.toggle("toggled",Q),g.classList.toggle("toggled",C),I.setAttribute("aria-checked",Q),g.setAttribute("aria-checked",C)}))}},{key:"bindScrollModeListener",value:function(A){var I=this,g=A.scrollPageButton,B=A.scrollVerticalButton,Q=A.scrollHorizontalButton,C=A.scrollWrappedButton,E=A.spreadNoneButton,i=A.spreadOddButton,o=A.spreadEvenButton,w=function(A){var w=A.mode,G=w===D.ScrollMode.PAGE,F=w===D.ScrollMode.VERTICAL,N=w===D.ScrollMode.HORIZONTAL,y=w===D.ScrollMode.WRAPPED;g.classList.toggle("toggled",G),B.classList.toggle("toggled",F),Q.classList.toggle("toggled",N),C.classList.toggle("toggled",y),g.setAttribute("aria-checked",G),B.setAttribute("aria-checked",F),Q.setAttribute("aria-checked",N),C.setAttribute("aria-checked",y);var R=I.pagesCount>15e3;g.disabled=R,B.disabled=R,Q.disabled=R,C.disabled=R,E.disabled=N,i.disabled=N,o.disabled=N};this.eventBus._on("scrollmodechanged",w),this.eventBus._on("secondarytoolbarreset",(function(A){A.source===I&&w({mode:D.ScrollMode.VERTICAL})}))}},{key:"bindSpreadModeListener",value:function(A){var I=this,g=A.spreadNoneButton,B=A.spreadOddButton,Q=A.spreadEvenButton;function C(A){var I=A.mode,C=I===D.SpreadMode.NONE,E=I===D.SpreadMode.ODD,i=I===D.SpreadMode.EVEN;g.classList.toggle("toggled",C),B.classList.toggle("toggled",E),Q.classList.toggle("toggled",i),g.setAttribute("aria-checked",C),B.setAttribute("aria-checked",E),Q.setAttribute("aria-checked",i)}this.eventBus._on("spreadmodechanged",C),this.eventBus._on("secondarytoolbarreset",(function(A){A.source===I&&C({mode:D.SpreadMode.NONE})}))}},{key:"open",value:function(){this.opened||(this.opened=!0,this.setMaxHeight(),this.toggleButton.classList.add("toggled"),this.toggleButton.setAttribute("aria-expanded","true"),this.toolbar.classList.remove("hidden"))}},{key:"close",value:function(){this.opened&&(this.opened=!1,this.toolbar.classList.add("hidden"),this.toggleButton.classList.remove("toggled"),this.toggleButton.setAttribute("aria-expanded","false"))}},{key:"toggle",value:function(){this.opened?this.close():this.open()}},{key:"setMaxHeight",value:function(){this.opened&&(this.containerHeight=this.mainContainer.clientHeight,this.containerHeight!==this.previousContainerHeight&&(this.toolbarButtonContainer.style.maxHeight="".concat(this.containerHeight-D.SCROLLBAR_PADDING,"px"),this.previousContainerHeight=this.containerHeight))}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"CursorTool",(function(){return o})),g.d(I,"PDFCursorTools",(function(){return w}));var B=g(2),Q=g.n(B),C=g(1),E=g.n(C),D=g(43),i=g(20),o={SELECT:0,HAND:1,ZOOM:2},w=function(){function A(I){var g=this,B=I.container,C=I.eventBus,E=I.cursorToolOnLoad,i=void 0===E?o.SELECT:E;Q()(this,A),this.container=B,this.eventBus=C,this.active=o.SELECT,this.activeBeforePresentationMode=null,this.handTool=new D.GrabToPan({element:this.container}),this.addEventListeners(),Promise.resolve().then((function(){g.switchTool(i)}))}return E()(A,[{key:"activeTool",get:function(){return this.active}},{key:"switchTool",value:function(A){var I=this;if(null===this.activeBeforePresentationMode&&A!==this.active){var g=function(){switch(I.active){case o.SELECT:break;case o.HAND:I.handTool.deactivate();case o.ZOOM:}};switch(A){case o.SELECT:g();break;case o.HAND:g(),this.handTool.activate();break;case o.ZOOM:default:return}this.active=A,this.dispatchEvent()}}},{key:"dispatchEvent",value:function(){this.eventBus.dispatch("cursortoolchanged",{source:this,tool:this.active})}},{key:"addEventListeners",value:function(){var A=this;this.eventBus._on("switchcursortool",(function(I){A.switchTool(I.tool)})),this.eventBus._on("presentationmodechanged",(function(I){switch(I.state){case i.PresentationModeState.FULLSCREEN:var g=A.active;A.switchTool(o.SELECT),A.activeBeforePresentationMode=g;break;case i.PresentationModeState.NORMAL:var B=A.activeBeforePresentationMode;A.activeBeforePresentationMode=null,A.switchTool(B)}}))}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"GrabToPan",(function(){return i}));var B=g(2),Q=g.n(B),C=g(1),E=g.n(C),D="grab-to-pan-grab",i=function(){function A(I){Q()(this,A),this.element=I.element,this.document=I.element.ownerDocument,"function"==typeof I.ignoreTarget&&(this.ignoreTarget=I.ignoreTarget),this.onActiveChanged=I.onActiveChanged,this.activate=this.activate.bind(this),this.deactivate=this.deactivate.bind(this),this.toggle=this.toggle.bind(this),this._onMouseDown=this.onMouseDown.bind(this),this._onMouseMove=this.onMouseMove.bind(this),this._endPan=this.endPan.bind(this),(this.overlay=document.createElement("div")).className="grab-to-pan-grabbing"}return E()(A,[{key:"activate",value:function(){this.active||(this.active=!0,this.element.addEventListener("mousedown",this._onMouseDown,!0),this.element.classList.add(D),this.onActiveChanged&&this.onActiveChanged(!0))}},{key:"deactivate",value:function(){this.active&&(this.active=!1,this.element.removeEventListener("mousedown",this._onMouseDown,!0),this._endPan(),this.element.classList.remove(D),this.onActiveChanged&&this.onActiveChanged(!1))}},{key:"toggle",value:function(){this.active?this.deactivate():this.activate()}},{key:"ignoreTarget",value:function(A){return A.matches("a[href], a[href] *, input, textarea, button, button *, select, option")}},{key:"onMouseDown",value:function(A){if(0===A.button&&!this.ignoreTarget(A.target)){if(A.originalTarget)try{A.originalTarget.tagName}catch(A){return}this.scrollLeftStart=this.element.scrollLeft,this.scrollTopStart=this.element.scrollTop,this.clientXStart=A.clientX,this.clientYStart=A.clientY,this.document.addEventListener("mousemove",this._onMouseMove,!0),this.document.addEventListener("mouseup",this._endPan,!0),this.element.addEventListener("scroll",this._endPan,!0),A.preventDefault(),A.stopPropagation();var I=document.activeElement;I&&!I.contains(A.target)&&I.blur()}}},{key:"onMouseMove",value:function(A){if(this.element.removeEventListener("scroll",this._endPan,!0),1&A.buttons){var I=A.clientX-this.clientXStart,g=A.clientY-this.clientYStart,B=this.scrollTopStart-g,Q=this.scrollLeftStart-I;this.element.scrollTo?this.element.scrollTo({top:B,left:Q,behavior:"instant"}):(this.element.scrollTop=B,this.element.scrollLeft=Q),this.overlay.parentNode||document.body.appendChild(this.overlay)}else this._endPan()}},{key:"endPan",value:function(){this.element.removeEventListener("scroll",this._endPan,!0),this.document.removeEventListener("mousemove",this._onMouseMove,!0),this.document.removeEventListener("mouseup",this._endPan,!0),this.overlay.remove()}}]),A}()},function(A,I,g){"use strict";g.r(I),g.d(I,"Print",(function(){return M}));var B=g(4),Q=g.n(B),C=g(2),E=g.n(C),D=g(1),i=g.n(D),o=g(5),w=g.n(o),G=(g(35),g(28)),F=g(34),N=g(45),y=g.n(N);function R(A,I){var g="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!g){if(Array.isArray(A)||(g=function(A,I){if(!A)return;if("string"==typeof A)return h(A,I);var g=Object.prototype.toString.call(A).slice(8,-1);"Object"===g&&A.constructor&&(g=A.constructor.name);if("Map"===g||"Set"===g)return Array.from(A);if("Arguments"===g||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return h(A,I)}(A))||I&&A&&"number"==typeof A.length){g&&(A=g);var B=0,Q=function(){};return{s:Q,n:function(){return B>=A.length?{done:!0}:{done:!1,value:A[B++]}},e:function(A){throw A},f:Q}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,E=!0,D=!1;return{s:function(){g=g.call(A)},n:function(){var A=g.next();return E=A.done,A},e:function(A){D=!0,C=A},f:function(){try{E||null==g.return||g.return()}finally{if(D)throw C}}}}function h(A,I){(null==I||I>A.length)&&(I=A.length);for(var g=0,B=new Array(I);g<I;g++)B[g]=A[g];return B}var M=function(){function A(I,g,B,Q,C){E()(this,A),this.coreHelper=new F.Ofd_Core_Helper(40),this.dialog=I||document.getElementById("printServiceDialog"),this.overlayManager=g,this.l10n=B,this.ofdRender=new G.Ofd_Render(null,this.coreHelper),document.getElementById("printCancel").addEventListener("click",this.close.bind(this)),this.overlayManager.register(this.dialog),this.progressBar=this.dialog.querySelector("progress"),this.progressPerc=this.dialog.querySelector(".relative-progress"),this.abort=!1,this.eventBus=Q,this.callback=C}var I,g,B;return i()(A,[{key:"setOfdCore",value:function(A){this.core=A,this.ofdRender.setOfdCore(this.core)}},{key:"close",value:(B=Q()(w.a.mark((function A(){return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:this.abort=!0,this.overlayManager.close(this.dialog);case 2:case"end":return A.stop()}}),A,this)}))),function(){return B.apply(this,arguments)})},{key:"open",value:(g=Q()(w.a.mark((function A(){var I=this;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(this.core){A.next=2;break}return A.abrupt("return");case 2:return this.abort=!1,this.overlayManager.open(this.dialog),A.next=6,this.renderProgress(0);case 6:setTimeout((function(){I.prepare().then((function(A){if(A&&A.length>0){I.close();var g,B=document.createElement("div"),Q=R(A);try{for(Q.s();!(g=Q.n()).done;){var C=g.value;B.appendChild(C)}}catch(A){Q.e(A)}finally{Q.f()}if(I.callback&&I.eventBus)return void I.eventBus.dispatch("printCallback",{source:I,html:B});y()({printable:B,type:"html",scanStyles:!1})}}))}),100);case 7:case"end":return A.stop()}}),A,this)}))),function(){return g.apply(this,arguments)})},{key:"prepare",value:(I=Q()(w.a.mark((function A(){var I=this;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.abrupt("return",new Promise(function(){var A=Q()(w.a.mark((function A(g,B){var Q,C,E,D,i;return w.a.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:Q=[],C=0;case 2:if(!(C<I.core.getOFDPageCount(0))||I.abort){A.next=21;break}return E=785/I.core.pageWidth(0,C)*25.4,I.ofdRender.setDpi(E),(D=document.createElement("canvas")).style.width="794px",D.style.height="1123px",(i=document.createElement("div")).style.width="794px",i.style.height="1123px",i.style.position="relative",i.appendChild(D),A.next=15,I.ofdRender.renderPage(i,0,C);case 15:return Q.push(i),A.next=18,I.renderProgress(C+1);case 18:C++,A.next=2;break;case 21:I.abort&&g(),g(Q);case 23:case"end":return A.stop()}}),A)})));return function(I,g){return A.apply(this,arguments)}}()));case 1:case"end":return A.stop()}}),A)}))),function(){return I.apply(this,arguments)})},{key:"renderProgress",value:function(A){var I=this;return new Promise((function(g,B){var Q=Math.round(100*A/I.core.getOFDPageCount(0));I.progressBar.value=Q,I.l10n.get("print_progress_percent",{progress:Q}).then((function(A){I.progressPerc.textContent=A})),setTimeout((function(){g()}),100)}))}}]),A}()},function(A,I,g){var B;window,B=function(){return function(A){var I={};function g(B){if(I[B])return I[B].exports;var Q=I[B]={i:B,l:!1,exports:{}};return A[B].call(Q.exports,Q,Q.exports,g),Q.l=!0,Q.exports}return g.m=A,g.c=I,g.d=function(A,I,B){g.o(A,I)||Object.defineProperty(A,I,{enumerable:!0,get:B})},g.r=function(A){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})},g.t=function(A,I){if(1&I&&(A=g(A)),8&I)return A;if(4&I&&"object"==typeof A&&A&&A.__esModule)return A;var B=Object.create(null);if(g.r(B),Object.defineProperty(B,"default",{enumerable:!0,value:A}),2&I&&"string"!=typeof A)for(var Q in A)g.d(B,Q,function(I){return A[I]}.bind(null,Q));return B},g.n=function(A){var I=A&&A.__esModule?function(){return A.default}:function(){return A};return g.d(I,"a",I),I},g.o=function(A,I){return Object.prototype.hasOwnProperty.call(A,I)},g.p="",g(g.s=0)}({"./src/index.js":
3
3
  /*!**********************!*\
4
4
  !*** ./src/index.js ***!
5
5
  \**********************/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "parser_x.js",
3
- "version": "1.1.24",
3
+ "version": "1.1.25",
4
4
  "main": "dist/parser_x.js",
5
5
  "author": "nobodyelse",
6
6
  "private": false,