Files
bishengWeb/build/assets/pdfjs-36654f0a.js

9 lines
319 KiB
JavaScript
Raw Normal View History

2024-06-05 14:27:06 +08:00
var Vi=Object.defineProperty;var $i=(wt,h,ct)=>h in wt?Vi(wt,h,{enumerable:!0,configurable:!0,writable:!0,value:ct}):wt[h]=ct;var Yt=(wt,h,ct)=>($i(wt,typeof h!="symbol"?h+"":h,ct),ct),Fe=(wt,h,ct)=>{if(!h.has(wt))throw TypeError("Cannot "+ct)};var t=(wt,h,ct)=>(Fe(wt,h,"read from private field"),ct?ct.call(wt):h.get(wt)),I=(wt,h,ct)=>{if(h.has(wt))throw TypeError("Cannot add the same private member more than once");h instanceof WeakSet?h.add(wt):h.set(wt,ct)},st=(wt,h,ct,l)=>(Fe(wt,h,"write to private field"),l?l.call(wt,ct):h.set(wt,ct),ct);var he=(wt,h,ct,l)=>({set _(M){st(wt,h,M,ct)},get _(){return t(wt,h,l)}}),V=(wt,h,ct)=>(Fe(wt,h,"access private method"),ct);import{a as getAugmentedNamespace}from"./acebuilds-fbc0ccc6.js";function commonjsRequire(wt){throw new Error('Could not dynamically require "'+wt+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pdf={exports:{}};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$5=getAugmentedNamespace(__viteBrowserExternal$1);(function(module,exports){(function(h,ct){module.exports=h.pdfjsLib=ct()})(globalThis,()=>(()=>{var __webpack_modules__=[,(wt,h)=>{var jt;Object.defineProperty(h,"__esModule",{value:!0}),h.VerbosityLevel=h.Util=h.UnknownErrorException=h.UnexpectedResponseException=h.TextRenderingMode=h.RenderingIntentFlag=h.PromiseCapability=h.PermissionFlag=h.PasswordResponses=h.PasswordException=h.PageActionEventType=h.OPS=h.MissingPDFException=h.MAX_IMAGE_SIZE_TO_CACHE=h.LINE_FACTOR=h.LINE_DESCENT_FACTOR=h.InvalidPDFException=h.ImageKind=h.IDENTITY_MATRIX=h.FormatError=h.FeatureTest=h.FONT_IDENTITY_MATRIX=h.DocumentActionEventType=h.CMapCompressionType=h.BaseException=h.BASELINE_FACTOR=h.AnnotationType=h.AnnotationReplyType=h.AnnotationMode=h.AnnotationFlag=h.AnnotationFieldFlag=h.AnnotationEditorType=h.AnnotationEditorPrefix=h.AnnotationEditorParamsType=h.AnnotationBorderStyleType=h.AnnotationActionEventType=h.AbortException=void 0,h.assert=O,h.bytesToString=Y,h.createValidAbsoluteUrl=rt,h.getModificationDate=Mt,h.getUuid=Gt,h.getVerbosityLevel=X,h.info=nt,h.isArrayBuffer=ft,h.isArrayEqual=Ft,h.isNodeJS=void 0,h.normalizeUnicode=Dt,h.objectFromMap=ut,h.objectSize=lt,h.setVerbosityLevel=E,h.shadow=mt,h.string32=at,h.stringToBytes=dt,h.stringToPDFString=Ct,h.stringToUTF8String=it,h.unreachable=u,h.utf8StringToString=tt,h.warn=ot;const ct=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");h.isNodeJS=ct;const l=[1,0,0,1,0,0];h.IDENTITY_MATRIX=l;const M=[.001,0,0,.001,0,0];h.FONT_IDENTITY_MATRIX=M;const ht=1e7;h.MAX_IMAGE_SIZE_TO_CACHE=ht;const K=1.35;h.LINE_FACTOR=K;const bt=.35;h.LINE_DESCENT_FACTOR=bt;const H=bt/K;h.BASELINE_FACTOR=H;const D={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};h.RenderingIntentFlag=D;const m={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};h.AnnotationMode=m;const L="pdfjs_internal_editor_";h.AnnotationEditorPrefix=L;const U={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15};h.AnnotationEditorType=U;const R={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23};h.AnnotationEditorParamsType=R;const S={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};h.PermissionFlag=S;const v={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};h.TextRenderingMode=v;const c={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};h.ImageKind=c;const _={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:
`);return it.join("")}}h.StatTimer=A;function n(Ct,it){try{const{protocol:tt}=it?new URL(Ct,it):new URL(Ct);return tt==="http:"||tt==="https:"}catch{return!1}}function r(Ct,it=!1){return new Promise((tt,ft)=>{const Ft=document.createElement("script");Ft.src=Ct,Ft.onload=function(Mt){it&&Ft.remove(),tt(Mt)},Ft.onerror=function(){ft(new Error(`Cannot load script at: ${Ft.src}`))},(document.head||document.documentElement).append(Ft)})}function F(Ct){console.log("Deprecated API usage: "+Ct)}let f;class s{static toDateObject(it){if(!it||typeof it!="string")return null;f||(f=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const tt=f.exec(it);if(!tt)return null;const ft=parseInt(tt[1],10);let Ft=parseInt(tt[2],10);Ft=Ft>=1&&Ft<=12?Ft-1:0;let Mt=parseInt(tt[3],10);Mt=Mt>=1&&Mt<=31?Mt:1;let Ht=parseInt(tt[4],10);Ht=Ht>=0&&Ht<=23?Ht:0;let Wt=parseInt(tt[5],10);Wt=Wt>=0&&Wt<=59?Wt:0;let Rt=parseInt(tt[6],10);Rt=Rt>=0&&Rt<=59?Rt:0;const Dt=tt[7]||"Z";let Gt=parseInt(tt[8],10);Gt=Gt>=0&&Gt<=23?Gt:0;let jt=parseInt(tt[9],10)||0;return jt=jt>=0&&jt<=59?jt:0,Dt==="-"?(Ht+=Gt,Wt+=jt):Dt==="+"&&(Ht-=Gt,Wt-=jt),new Date(Date.UTC(ft,Ft,Mt,Ht,Wt,Rt))}}h.PDFDateString=s;function x(Ct,{scale:it=1,rotation:tt=0}){const{width:ft,height:Ft}=Ct.attributes.style,Mt=[0,0,parseInt(ft),parseInt(Ft)];return new S({viewBox:Mt,scale:it,rotation:tt})}function g(Ct){if(Ct.startsWith("#")){const it=parseInt(Ct.slice(1),16);return[(it&16711680)>>16,(it&65280)>>8,it&255]}return Ct.startsWith("rgb(")?Ct.slice(4,-1).split(",").map(it=>parseInt(it)):Ct.startsWith("rgba(")?Ct.slice(5,-1).split(",").map(it=>parseInt(it)).slice(0,3):((0,M.warn)(`Not a valid color format: "${Ct}"`),[0,0,0])}function W(Ct){const it=document.createElement("span");it.style.visibility="hidden",document.body.append(it);for(const tt of Ct.keys()){it.style.color=tt;const ft=window.getComputedStyle(it).color;Ct.set(tt,g(ft))}it.remove()}function z(Ct){const{a:it,b:tt,c:ft,d:Ft,e:Mt,f:Ht}=Ct.getTransform();return[it,tt,ft,Ft,Mt,Ht]}function E(Ct){const{a:it,b:tt,c:ft,d:Ft,e:Mt,f:Ht}=Ct.getTransform().invertSelf();return[it,tt,ft,Ft,Mt,Ht]}function X(Ct,it,tt=!1,ft=!0){if(it instanceof S){const{pageWidth:Ft,pageHeight:Mt}=it.rawDims,{style:Ht}=Ct,Wt=M.FeatureTest.isCSSRoundSupported,Rt=`var(--scale-factor) * ${Ft}px`,Dt=`var(--scale-factor) * ${Mt}px`,Gt=Wt?`round(${Rt}, 1px)`:`calc(${Rt})`,jt=Wt?`round(${Dt}, 1px)`:`calc(${Dt})`;!tt||it.rotation%180===0?(Ht.width=Gt,Ht.height=jt):(Ht.width=jt,Ht.height=Gt)}ft&&Ct.setAttribute("data-main-rotation",it.rotation)}},(wt,h,ct)=>{Object.defineProperty(h,"__esModule",{value:!0}),h.BaseStandardFontDataFactory=h.BaseSVGFactory=h.BaseFilterFactory=h.BaseCanvasFactory=h.BaseCMapReaderFactory=void 0;var l=ct(1);class M{constructor(){this.constructor===M&&(0,l.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(m){return"none"}addHCMFilter(m,L){return"none"}addHighlightHCMFilter(m,L,U,R){return"none"}destroy(m=!1){}}h.BaseFilterFactory=M;class ht{constructor(){this.constructor===ht&&(0,l.unreachable)("Cannot initialize BaseCanvasFactory.")}create(m,L){if(m<=0||L<=0)throw new Error("Invalid canvas size");const U=this._createCanvas(m,L);return{canvas:U,context:U.getContext("2d")}}reset(m,L,U){if(!m.canvas)throw new Error("Canvas is not specified");if(L<=0||U<=0)throw new Error("Invalid canvas size");m.canvas.width=L,m.canvas.height=U}destroy(m){if(!m.canvas)throw new Error("Canvas is not specified");m.canvas.width=0,m.canvas.height=0,m.canvas=null,m.context=null}_createCanvas(m,L){(0,l.unreachable)("Abstract method `_createCanvas` called.")}}h.BaseCanvasFactory=ht;class K{constructor({baseUrl:m=null,isCompressed:L=!0}){this.constructor===K&&(0,l.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=m,this.isCompressed=L}async fetch({name:m}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!m)throw new Error("CMap name must be specified.");const L=this.baseUrl+m+(thi
`)}return this.compiledGlyphs[D]=new Function("c","size",L.join(""))}return this.compiledGlyphs[D]=function(L,U){for(const R of m)R.cmd==="scale"&&(R.args=[U,-U]),L[R.cmd].apply(L,R.args)}}}h.FontFaceObject=ht},(wt,h,ct)=>{Object.defineProperty(h,"__esModule",{value:!0}),h.NodeStandardFontDataFactory=h.NodeFilterFactory=h.NodeCanvasFactory=h.NodeCMapReaderFactory=void 0;var l=ct(7);ct(1);const M=function(D){return new Promise((m,L)=>{require$$5.readFile(D,(R,S)=>{if(R||!S){L(new Error(R));return}m(new Uint8Array(S))})})};class ht extends l.BaseFilterFactory{}h.NodeFilterFactory=ht;class K extends l.BaseCanvasFactory{_createCanvas(m,L){return require$$5.createCanvas(m,L)}}h.NodeCanvasFactory=K;class bt extends l.BaseCMapReaderFactory{_fetchData(m,L){return M(m).then(U=>({cMapData:U,compressionType:L}))}}h.NodeCMapReaderFactory=bt;class H extends l.BaseStandardFontDataFactory{_fetchData(m){return M(m)}}h.NodeStandardFontDataFactory=H},(wt,h,ct)=>{var u,He,$,We;Object.defineProperty(h,"__esModule",{value:!0}),h.CanvasGraphics=void 0;var l=ct(1),M=ct(6),ht=ct(12),K=ct(13);const bt=16,H=100,D=4096,m=15,L=10,U=1e3,R=16;function S(d,e){if(d._removeMirroring)throw new Error("Context is already forwarding operations.");d.__originalSave=d.save,d.__originalRestore=d.restore,d.__originalRotate=d.rotate,d.__originalScale=d.scale,d.__originalTranslate=d.translate,d.__originalTransform=d.transform,d.__originalSetTransform=d.setTransform,d.__originalResetTransform=d.resetTransform,d.__originalClip=d.clip,d.__originalMoveTo=d.moveTo,d.__originalLineTo=d.lineTo,d.__originalBezierCurveTo=d.bezierCurveTo,d.__originalRect=d.rect,d.__originalClosePath=d.closePath,d.__originalBeginPath=d.beginPath,d._removeMirroring=()=>{d.save=d.__originalSave,d.restore=d.__originalRestore,d.rotate=d.__originalRotate,d.scale=d.__originalScale,d.translate=d.__originalTranslate,d.transform=d.__originalTransform,d.setTransform=d.__originalSetTransform,d.resetTransform=d.__originalResetTransform,d.clip=d.__originalClip,d.moveTo=d.__originalMoveTo,d.lineTo=d.__originalLineTo,d.bezierCurveTo=d.__originalBezierCurveTo,d.rect=d.__originalRect,d.closePath=d.__originalClosePath,d.beginPath=d.__originalBeginPath,delete d._removeMirroring},d.save=function(){e.save(),this.__originalSave()},d.restore=function(){e.restore(),this.__originalRestore()},d.translate=function(o,C){e.translate(o,C),this.__originalTranslate(o,C)},d.scale=function(o,C){e.scale(o,C),this.__originalScale(o,C)},d.transform=function(o,C,y,N,j,Y){e.transform(o,C,y,N,j,Y),this.__originalTransform(o,C,y,N,j,Y)},d.setTransform=function(o,C,y,N,j,Y){e.setTransform(o,C,y,N,j,Y),this.__originalSetTransform(o,C,y,N,j,Y)},d.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},d.rotate=function(o){e.rotate(o),this.__originalRotate(o)},d.clip=function(o){e.clip(o),this.__originalClip(o)},d.moveTo=function(i,o){e.moveTo(i,o),this.__originalMoveTo(i,o)},d.lineTo=function(i,o){e.lineTo(i,o),this.__originalLineTo(i,o)},d.bezierCurveTo=function(i,o,C,y,N,j){e.bezierCurveTo(i,o,C,y,N,j),this.__originalBezierCurveTo(i,o,C,y,N,j)},d.rect=function(i,o,C,y){e.rect(i,o,C,y),this.__originalRect(i,o,C,y)},d.closePath=function(){e.closePath(),this.__originalClosePath()},d.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}class v{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,i,o){let C;return this.cache[e]!==void 0?(C=this.cache[e],this.canvasFactory.reset(C,i,o)):(C=this.canvasFactory.create(i,o),this.cache[e]=C),C}delete(e){delete this.cache[e]}clear(){for(const e in this.cache){const i=this.cache[e];this.canvasFactory.destroy(i),delete this.cache[e]}}}function c(d,e,i,o,C,y,N,j,Y,dt){const[at,lt,ut,kt,Et,Ot]=(0,M.getCurrentTransform)(d);if(lt===0&&ut===0){const Ut=N*at+Et,Ct=Math.round(Ut),it=j*kt+Ot,tt=Math.round(it),ft=(N+Y)*at+Et,Ft=Math.abs(Math.round(ft)-Ct)||1,Mt=(j+dt)*kt+Ot,Ht=Math.abs(Math.round(Mt)-tt)||1;return d.setTransform(Math.sign(at),0,0,Math.sign(kt),Ct,tt),d.drawImage(e,i,o,C,y,0,0,Ft,Ht),d.setTransform(at,lt,ut,kt,Et,Ot),[Ft,Ht]}if(at=
`}setFont(n){const r=this.current,F=this.commonObjs.get(n[0]);let f=n[1];r.font=F,this.embedFonts&&!F.missingFile&&!this.embeddedFonts[F.loadedName]&&(this.addFontStyle(F),this.embeddedFonts[F.loadedName]=F),r.fontMatrix=F.fontMatrix||M.FONT_IDENTITY_MATRIX;let s="normal";F.black?s="900":F.bold&&(s="bold");const x=F.italic?"italic":"normal";f<0?(f=-f,r.fontDirection=-1):r.fontDirection=1,r.fontSize=f,r.fontFamily=F.loadedName,r.fontWeight=s,r.fontStyle=x,r.tspan=this.svgFactory.createElement("svg:tspan"),r.tspan.setAttributeNS(null,"y",S(-r.y)),r.xcoords=[],r.ycoords=[]}endText(){var r;const n=this.current;n.textRenderingMode&M.TextRenderingMode.ADD_TO_PATH_FLAG&&((r=n.txtElement)!=null&&r.hasChildNodes())&&(n.element=n.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(n){n>0&&(this.current.lineWidth=n)}setLineCap(n){this.current.lineCap=H[n]}setLineJoin(n){this.current.lineJoin=D[n]}setMiterLimit(n){this.current.miterLimit=n}setStrokeAlpha(n){this.current.strokeAlpha=n}setStrokeRGBColor(n,r,F){this.current.strokeColor=M.Util.makeHexColor(n,r,F)}setFillAlpha(n){this.current.fillAlpha=n}setFillRGBColor(n,r,F){this.current.fillColor=M.Util.makeHexColor(n,r,F),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(n){this.current.strokeColor=this._makeColorN_Pattern(n)}setFillColorN(n){this.current.fillColor=this._makeColorN_Pattern(n)}shadingFill(n){const{width:r,height:F}=this.viewport,f=M.Util.inverseTransform(this.transformMatrix),[s,x,g,W]=M.Util.getAxialAlignedBoundingBox([0,0,r,F],f),z=this.svgFactory.createElement("svg:rect");z.setAttributeNS(null,"x",s),z.setAttributeNS(null,"y",x),z.setAttributeNS(null,"width",g-s),z.setAttributeNS(null,"height",W-x),z.setAttributeNS(null,"fill",this._makeShadingPattern(n)),this.current.fillAlpha<1&&z.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(z)}_makeColorN_Pattern(n){return n[0]==="TilingPattern"?this._makeTilingPattern(n):this._makeShadingPattern(n)}_makeTilingPattern(n){const r=n[1],F=n[2],f=n[3]||M.IDENTITY_MATRIX,[s,x,g,W]=n[4],z=n[5],E=n[6],X=n[7],nt=`shading${w++}`,[ot,u,O,$]=M.Util.normalizeRect([...M.Util.applyTransform([s,x],f),...M.Util.applyTransform([g,W],f)]),[rt,mt]=M.Util.singularValueDecompose2dScale(f),d=z*rt,e=E*mt,i=this.svgFactory.createElement("svg:pattern");i.setAttributeNS(null,"id",nt),i.setAttributeNS(null,"patternUnits","userSpaceOnUse"),i.setAttributeNS(null,"width",d),i.setAttributeNS(null,"height",e),i.setAttributeNS(null,"x",`${ot}`),i.setAttributeNS(null,"y",`${u}`);const o=this.svg,C=this.transformMatrix,y=this.current.fillColor,N=this.current.strokeColor,j=this.svgFactory.create(O-ot,$-u);if(this.svg=j,this.transformMatrix=f,X===2){const Y=M.Util.makeHexColor(...r);this.current.fillColor=Y,this.current.strokeColor=Y}return this.executeOpTree(this.convertOpList(F)),this.svg=o,this.transformMatrix=C,this.current.fillColor=y,this.current.strokeColor=N,i.append(j.childNodes[0]),this.defs.append(i),`url(#${nt})`}_makeShadingPattern(n){switch(typeof n=="string"&&(n=this.objs.get(n)),n[0]){case"RadialAxial":const r=`shading${w++}`,F=n[3];let f;switch(n[1]){case"axial":const s=n[4],x=n[5];f=this.svgFactory.createElement("svg:linearGradient"),f.setAttributeNS(null,"id",r),f.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),f.setAttributeNS(null,"x1",s[0]),f.setAttributeNS(null,"y1",s[1]),f.setAttributeNS(null,"x2",x[0]),f.setAttributeNS(null,"y2",x[1]);break;case"radial":const g=n[4],W=n[5],z=n[6],E=n[7];f=this.svgFactory.createElement("svg:radialGradient"),f.setAttributeNS(null,"id",r),f.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),f.setAttributeNS(null,"cx",W[0]),f.setAttributeNS(null,"cy",W[1]),f.setAttributeNS(null,"r",E),f.setAttributeNS(null,"fx",g[0]),f.setAttributeNS(null,"fy",g[1]),f.setAttributeNS(null,"fr",z);break;default:throw new Error(`Unknown RadialAxial type: ${n[1]}`)}for(const s of F){const x=this.svgFactory.createElement("svg:stop");x.setAttributeNS(null,"offset",s[0]),x.setAttributeNS(null
`),position:N,pageIndex:j-1,rect:i,rotation:o,id:C,deleted:!1}}const mt=super.deserialize(u,O,$);return st(mt,v,u.fontSize),st(mt,U,l.Util.makeHexColor(...u.color)),st(mt,R,u.value),mt.annotationElementId=u.id||null,st(mt,c,rt),mt}serialize(u=!1){if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};const O=X._internalPadding*this.parentScale,$=this.getRect(O,O),rt=ht.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:t(this,U)),mt={annotationType:l.AnnotationEditorType.FREETEXT,color:rt,fontSize:t(this,v),value:t(this,R),pageIndex:this.pageIndex,rect:$,rotation:this.rotation};return u?mt:this.annotationElementId&&!V(this,g,xi).call(this,mt)?null:(mt.id=this.annotationElementId,mt)}};H=new WeakMap,D=new WeakMap,m=new WeakMap,L=new WeakMap,U=new WeakMap,R=new WeakMap,S=new WeakMap,v=new WeakMap,c=new WeakMap,_=new WeakSet,wi=function(u){const O=rt=>{this.editorDiv.style.fontSize=`calc(${rt}px * var(--scale-factor))`,this.translate(0,-(rt-t(this,v))*this.parentScale),st(this,v,rt),V(this,F,ge).call(this)},$=t(this,v);this.addCommands({cmd:()=>{O(u)},undo:()=>{O($)},mustExec:!0,type:l.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},P=new WeakSet,Ci=function(u){const O=t(this,U);this.addCommands({cmd:()=>{st(this,U,this.editorDiv.style.color=u)},undo:()=>{st(this,U,this.editorDiv.style.color=O)},mustExec:!0,type:l.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},n=new WeakSet,Ti=function(){const u=this.editorDiv.getElementsByTagName("div");if(u.length===0)return this.editorDiv.innerText;const O=[];for(const $ of u)O.push($.innerText.replace(/\r\n?|\n/,""));return O.join(`
`)},F=new WeakSet,ge=function(){const[u,O]=this.parentDimensions;let $;if(this.isAttachedToDOM)$=this.div.getBoundingClientRect();else{const{currentLayer:rt,div:mt}=this,d=mt.style.display;mt.style.display="hidden",rt.div.append(this.div),$=mt.getBoundingClientRect(),mt.remove(),mt.style.display=d}this.rotation%180===this.parentRotation%180?(this.width=$.width/u,this.height=$.height/O):(this.width=$.height/u,this.height=$.width/O),this.fixAndSetPosition()},s=new WeakSet,Ve=function(){if(this.editorDiv.replaceChildren(),!!t(this,R))for(const u of t(this,R).split(`
`)){const O=document.createElement("div");O.append(u?document.createTextNode(u):document.createElement("br")),this.editorDiv.append(O)}},g=new WeakSet,xi=function(u){const{value:O,fontSize:$,color:rt,rect:mt,pageIndex:d}=t(this,c);return u.value!==O||u.fontSize!==$||u.rect.some((e,i)=>Math.abs(e-mt[i])>=1)||u.color.some((e,i)=>e!==rt[i])||u.pageIndex!==d},z=new WeakSet,$e=function(u=!1){if(!this.annotationElementId)return;if(V(this,F,ge).call(this),!u&&(this.width===0||this.height===0)){setTimeout(()=>V(this,z,$e).call(this,!0),0);return}const O=X._internalPadding*this.parentScale;t(this,c).rect=this.getRect(O,O)},Yt(X,"_freeTextDefaultContent",""),Yt(X,"_l10nPromise"),Yt(X,"_internalPadding",0),Yt(X,"_defaultColor",null),Yt(X,"_defaultFontSize",10),Yt(X,"_type","freetext");let bt=X;h.FreeTextEditor=bt},(wt,h,ct)=>{var i,o,ne,y,Pi,j,Y,dt,at,lt,ut,kt,Et,Ot,Bt,xt,Ut,Ct,it,tt,ft,Ft,Ye,Ht,Ke,Rt,Je,Gt,jt,pt,G,J,Tt,zt,Nt,$t,Jt,ki,vt,Qe;Object.defineProperty(h,"__esModule",{value:!0}),h.StampAnnotationElement=h.InkAnnotationElement=h.FreeTextAnnotationElement=h.AnnotationLayer=void 0;var l=ct(1),M=ct(6),ht=ct(3),K=ct(30),bt=ct(31),H=ct(32);const D=1e3,m=9,L=new WeakSet;function U(St){return{width:St[2]-St[0],height:St[3]-St[1]}}class R{static create(p){switch(p.data.annotationType){case l.AnnotationType.LINK:return new v(p);case l.AnnotationType.TEXT:return new c(p);case l.AnnotationType.WIDGET:switch(p.data.fieldType){case"Tx":return new w(p);case"Btn":return p.data.radioButton?new n(p):p.data.checkBox?new A(p):new r(p);case"Ch":return new F(p);case"Sig":return new P(p)}return new _(p);case l.AnnotationType.POPUP:return new f(p);case l.AnnotationType.FREETEXT:return new x(p);case l.AnnotationType.LINE:return new g(p);case l.AnnotationType.SQUARE:return new W(p);case l.AnnotationType.CIRCLE:return new z(p);case l.AnnotationType.POLYLINE:return new E(p);case l.AnnotationType.CARET:return new nt(p);case l.AnnotationType.INK:return new ot(p);case l.AnnotationType.POLYGON:return new X(p);case l.AnnotationType.HIGHLIGHT:return new u(p);case l.AnnotationType.UNDERLINE:return new O(p);case l.AnnotationType.SQUIGGLY:return new $(p);case l.AnnotationType.STRIKEOUT:return new rt(p);case l.AnnotationType.STAMP:return new mt(p);case l.AnnotationType.FILEATTACHMENT:return new d(p);default:return new S(p)}}}class S{constructor(p,{isRenderable:a=!1,ignoreBorder:k=!1,createQuadrilaterals:T=!1}={}){I(this,i,!1);this.isRenderable=a,this.data=p.data,this.layer=p.layer,this.linkService=p.linkService,this.downloadManager=p.downloadManager,this.imageResourcesPath=p.imageResourcesPath,this.renderForms=p.renderForms,this.svgFactory=p.svgFactory,this.annotationStorage=p.annotationStorage,this.enableScripting=p.enableScripting,this.hasJSActions=p.hasJSActions,this._fieldObjects=p.fieldObjects,this.parent=p.parent,a&&(this.container=this._createContainer(k)),T&&this._createQuadrilaterals()}_createContainer(p){const{data:a,parent:{page:k,viewport:T}}=this,B=document.createElement("section");B.setAttribute("data-annotation-id",a.id),B.style.zIndex=this.parent.zIndex++,this.data.popupRef&&B.setAttribute("aria-haspopup","dialog"),a.noRotate&&B.classList.add("norotate");const{pageWidth:Z,pageHeight:_t,pageX:b,pageY:q}=T.rawDims;if(!a.rect||this instanceof f){const{rotation:Pt}=a;return!a.hasOwnCanvas&&Pt!==0&&this.setRotation(Pt,B),B}const{width:et,height:yt}=U(a.rect),gt=l.Util.normalizeRect([a.rect[0],k.view[3]-a.rect[1]+k.view[1],a.rect[2],k.view[3]-a.rect[3]+k.view[1]]);if(!p&&a.borderStyle.width>0){B.style.borderWidth=`${a.borderStyle.width}px`;const Pt=a.borderStyle.horizontalCornerRadius,It=a.borderStyle.verticalCornerRadius;if(Pt>0||It>0){const qt=`calc(${Pt}px * var(--scale-factor)) / calc(${It}px * var(--scale-factor))`;B.style.borderRadius=qt}else if(this instanceof n){const qt=`calc(${et}px * var(--scale-factor)) / calc(${yt}px * var(--scale-factor))`;B.style.borderRadius=qt}switch(a.borderStyle.style){case l.AnnotationBorderStyleType.SOLID:B.style.borderStyle="solid";break;case l.AnnotationBorderStyleType.DASHED:B.style.borderStyle="dashed";brea
`))||null;q&&this.data.comb&&(q=q.replaceAll(/\s+/g,""));const et={userValue:_t,formattedValue:q,lastCommittedValue:null,commitKey:1};this.data.multiLine?(k=document.createElement("textarea"),k.textContent=q??_t,this.data.doNotScroll&&(k.style.overflowY="hidden")):(k=document.createElement("input"),k.type="text",k.setAttribute("value",q??_t),this.data.doNotScroll&&(k.style.overflowX="hidden")),this.data.hasOwnCanvas&&(k.hidden=!0),L.add(k),k.setAttribute("data-element-id",a),k.disabled=this.data.readOnly,k.name=this.data.fieldName,k.tabIndex=D,this._setRequired(k,this.data.required),b&&(k.maxLength=b),k.addEventListener("input",gt=>{p.setValue(a,{value:gt.target.value}),this.setPropertyOnSiblings(k,"value",gt.target.value,"value"),et.formattedValue=null}),k.addEventListener("resetform",gt=>{const At=this.data.defaultFieldValue??"";k.value=et.userValue=At,et.formattedValue=null});let yt=gt=>{const{formattedValue:At}=et;At!=null&&(gt.target.value=At),gt.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){k.addEventListener("focus",At=>{const{target:Pt}=At;et.userValue&&(Pt.value=et.userValue),et.lastCommittedValue=Pt.value,et.commitKey=1}),k.addEventListener("updatefromsandbox",At=>{this.showElementAndHideCanvas(At.target);const Pt={value(It){et.userValue=It.detail.value??"",p.setValue(a,{value:et.userValue.toString()}),It.target.value=et.userValue},formattedValue(It){const{formattedValue:Xt}=It.detail;et.formattedValue=Xt,Xt!=null&&It.target!==document.activeElement&&(It.target.value=Xt),p.setValue(a,{formattedValue:Xt})},selRange(It){It.target.setSelectionRange(...It.detail.selRange)},charLimit:It=>{var Vt;const{charLimit:Xt}=It.detail,{target:qt}=It;if(Xt===0){qt.removeAttribute("maxLength");return}qt.setAttribute("maxLength",Xt);let Kt=et.userValue;!Kt||Kt.length<=Xt||(Kt=Kt.slice(0,Xt),qt.value=et.userValue=Kt,p.setValue(a,{value:Kt}),(Vt=this.linkService.eventBus)==null||Vt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:a,name:"Keystroke",value:Kt,willCommit:!0,commitKey:1,selStart:qt.selectionStart,selEnd:qt.selectionEnd}}))}};this._dispatchEventFromSandbox(Pt,At)}),k.addEventListener("keydown",At=>{var Xt;et.commitKey=1;let Pt=-1;if(At.key==="Escape"?Pt=0:At.key==="Enter"&&!this.data.multiLine?Pt=2:At.key==="Tab"&&(et.commitKey=3),Pt===-1)return;const{value:It}=At.target;et.lastCommittedValue!==It&&(et.lastCommittedValue=It,et.userValue=It,(Xt=this.linkService.eventBus)==null||Xt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:a,name:"Keystroke",value:It,willCommit:!0,commitKey:Pt,selStart:At.target.selectionStart,selEnd:At.target.selectionEnd}}))});const gt=yt;yt=null,k.addEventListener("blur",At=>{var It;if(!At.relatedTarget)return;const{value:Pt}=At.target;et.userValue=Pt,et.lastCommittedValue!==Pt&&((It=this.linkService.eventBus)==null||It.dispatch("dispatcheventinsandbox",{source:this,detail:{id:a,name:"Keystroke",value:Pt,willCommit:!0,commitKey:et.commitKey,selStart:At.target.selectionStart,selEnd:At.target.selectionEnd}})),gt(At)}),(B=this.data.actions)!=null&&B.Keystroke&&k.addEventListener("beforeinput",At=>{var te;et.lastCommittedValue=null;const{data:Pt,target:It}=At,{value:Xt,selectionStart:qt,selectionEnd:Kt}=It;let Vt=qt,Qt=Kt;switch(At.inputType){case"deleteWordBackward":{const Zt=Xt.substring(0,qt).match(/\w*[^\w]*$/);Zt&&(Vt-=Zt[0].length);break}case"deleteWordForward":{const Zt=Xt.substring(qt).match(/^[^\w]*\w*/);Zt&&(Qt+=Zt[0].length);break}case"deleteContentBackward":qt===Kt&&(Vt-=1);break;case"deleteContentForward":qt===Kt&&(Qt+=1);break}At.preventDefault(),(te=this.linkService.eventBus)==null||te.dispatch("dispatcheventinsandbox",{source:this,detail:{id:a,name:"Keystroke",value:Xt,change:Pt||"",willCommit:!1,selStart:Vt,selEnd:Qt}})}),this._setEventListeners(k,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],At=>At.target.value)}if(yt&&k.addEventListener("blur",yt),this.data.comb){const At=(this.data.rect[2]-this.data.rect[0])/b;k.classList.add("comb"),k.style.lett