2025-10-15 13:32:31 +00:00
var FA = Object . defineProperty ; var NA = ( u , t , e ) => t in u ? FA ( u , t , { enumerable : ! 0 , configurable : ! 0 , writable : ! 0 , value : e } ) : u [ t ] = e ; var k = ( u , t , e ) => ( NA ( u , typeof t != "symbol" ? t + "" : t , e ) , e ) , dp = ( u , t , e ) => { if ( ! t . has ( u ) ) throw TypeError ( "Cannot " + e ) } ; var n = ( u , t , e ) => ( dp ( u , t , "read from private field" ) , e ? e . call ( u ) : t . get ( u ) ) , d = ( u , t , e ) => { if ( t . has ( u ) ) throw TypeError ( "Cannot add the same private member more than once" ) ; t instanceof WeakSet ? t . add ( u ) : t . set ( u , e ) } , p = ( u , t , e , s ) => ( dp ( u , t , "write to private field" ) , s ? s . call ( u , e ) : t . set ( u , e ) , e ) ; var St = ( u , t , e , s ) => ( { set _ ( i ) { p ( u , t , i , e ) } , get _ ( ) { return n ( u , t , s ) } } ) , b = ( u , t , e ) => ( dp ( u , t , "access private method" ) , e ) ; import { _ as OA } from "./index-93385e5a.js" ; const ie = typeof process == "object" && process + "" == "[object process]" && ! process . versions . nw && ! ( process . versions . electron && process . type && process . type !== "browser" ) , wp = [ . 001 , 0 , 0 , . 001 , 0 , 0 ] , up = 1.35 , Pe = { ANY : 1 , DISPLAY : 2 , PRINT : 4 , SAVE : 8 , ANNOTATIONS _FORMS : 16 , ANNOTATIONS _STORAGE : 32 , ANNOTATIONS _DISABLE : 64 , IS _EDITING : 128 , OPLIST : 256 } , ki = { DISABLE : 0 , ENABLE : 1 , ENABLE _FORMS : 2 , ENABLE _STORAGE : 3 } , Em = "pdfjs_internal_editor_" , $ = { DISABLE : - 1 , NONE : 0 , FREETEXT : 3 , HIGHLIGHT : 9 , STAMP : 13 , INK : 15 , POPUP : 16 , SIGNATURE : 101 , COMMENT : 102 } , X = { RESIZE : 1 , CREATE : 2 , FREETEXT _SIZE : 11 , FREETEXT _COLOR : 12 , FREETEXT _OPACITY : 13 , INK _COLOR : 21 , INK _THICKNESS : 22 , INK _OPACITY : 23 , HIGHLIGHT _COLOR : 31 , HIGHLIGHT _THICKNESS : 32 , HIGHLIGHT _FREE : 33 , HIGHLIGHT _SHOW _ALL : 34 , DRAW _STEP : 41 } , BA = { PRINT : 4 , MODIFY _CONTENTS : 8 , COPY : 16 , MODIFY _ANNOTATIONS : 32 , FILL _INTERACTIVE _FORMS : 256 , COPY _FOR _ACCESSIBILITY : 512 , ASSEMBLE : 1024 , PRINT _HIGH _QUALITY : 2048 } , Ot = { 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 } , wd = { GRAYSCALE _1BPP : 1 , RGB _24BPP : 2 , RGBA _32BPP : 3 } , wt = { TEXT : 1 , LINK : 2 , FREETEXT : 3 , LINE : 4 , SQUARE : 5 , CIRCLE : 6 , POLYGON : 7 , POLYLINE : 8 , HIGHLIGHT : 9 , UNDERLINE : 10 , SQUIGGLY : 11 , STRIKEOUT : 12 , STAMP : 13 , CARET : 14 , INK : 15 , POPUP : 16 , FILEATTACHMENT : 17 , SOUND : 18 , MOVIE : 19 , WIDGET : 20 , SCREEN : 21 , PRINTERMARK : 22 , TRAPNET : 23 , WATERMARK : 24 , THREED : 25 , REDACT : 26 } , da = { SOLID : 1 , DASHED : 2 , BEVELED : 3 , INSET : 4 , UNDERLINE : 5 } , ep = { ERRORS : 0 , WARNINGS : 1 , INFOS : 5 } , Fl = { dependency : 1 , setLineWidth : 2 , setLineCap : 3 , setLineJoin : 4 , setMiterLimit : 5 , setDash : 6 , setRenderingIntent : 7 , setFlatness : 8 , setGState : 9 , save : 10 , restore : 11 , transform : 12 , moveTo : 13 , lineTo : 14 , curveTo : 15 , curveTo2 : 16 , curveTo3 : 17 , closePath : 18 , rectangle : 19 , stroke : 20 , closeStroke : 21 , fill : 22 , eoFill : 23 , fillStroke : 24 , eoFillStroke : 25 , closeFillStroke : 26 , closeEOFillStroke : 27 , endPath : 28 , clip : 29 , eoClip : 30 , beginText : 31 , endText : 32 , setCharSpacing : 33 , setWordSpacing : 34 , setHScale : 35 , setLeading : 36 , setFont : 37 , setTextRenderingMode : 38 , setTextRise : 39 , moveText : 40 , setLeadingMoveText : 41 , setTextMatrix : 42 , nextLine : 43 , showText : 44 , showSpacedText : 45 , nextLineShowText : 46 , nextLineSetSpacingShowText : 47 , setCharWidth : 48 , setCharWidthAndBounds : 49 , setStrokeColorSpace : 50 , setFillColorSpace : 51 , setStrokeColor : 52 , setStrokeColorN : 53 , setFillColor : 54 , setFillColorN : 55 , setStrokeGray : 56 , setFillGray : 57 , setStrokeRGBColor : 58 , setFillRGBColor : 59 , setStrokeCMYKColor : 60 , setFillCMYKColor : 61 , shadingFill : 62 , beginInlineImage : 63 , beginImageData : 64 , endInlineImage : 65 , paintXObject : 66 , markPoint : 67 , markPointProps : 68 , beginMarkedContent : 69 , beginMarkedContentProps : 70 , endMarkedContent : 71 , beginCompat : 72 , endCompat : 73 , paintFormXObjectBegin : 74 , paintFormXObjectEnd : 75 , beginGroup : 76 , endGroup : 77 , beginAnnotation : 80 , endAnnotation : 81 , paintImageMaskXObject : 83 , paintImageMaskXObjectGroup : 84 , paintImageXObject : 85 , paintInlineImageXObject : 86 , paintInlineImageXObjectGroup : 87 , paintImageXObjectRepeat : 88 , paintImageMaskXObjectRepeat : 89 , paintSolidColorImageMask : 90 , constructPath : 91 , setStrokeTransparent : 92 , setFillTransparent : 93 , rawFillPath : 94 } , ud = { moveTo : 0 , lineTo : 1 , curveTo : 2 , closePath : 3 } , HA = { NEED _PASSWORD : 1 , INCORRECT _PASSWORD : 2 } ; let sp = ep . WARNINGS ; function $A ( u ) { Number . isInteger ( u ) && ( sp = u ) } function zA ( ) { return sp } function ip ( u ) { sp >= ep . INFOS && console . log ( ` Info: ${ u } ` ) } function z ( u ) { sp >= ep . WARNINGS && console . log ( ` Warning: ${ u } ` ) } function st ( u ) { throw new Error ( u ) } function _t ( u , t ) { u || st ( t ) } function GA ( u ) { switch ( u == null ? void 0 : u . protocol ) { case "http:" : case "https:" : case " f
2025-09-04 05:47:42 +00:00
` );return t.join("")}}function gl(u,t){const e=t?URL.parse(u,t):URL.parse(u);return(e==null?void 0:e.protocol)==="http:"||(e==null?void 0:e.protocol)==="https:"}function je(u){u.preventDefault()}function vt(u){u.preventDefault(),u.stopPropagation()}function ZA(u){console.log("Deprecated API usage: "+u)}var $ l;class Qd{static toDateObject(t){if(t instanceof Date)return t;if(!t||typeof t!="string")return null;n(this, $ l)||p(this, $ l,new RegExp("^D:( \\ d{4})( \\ d{2})?( \\ d{2})?( \\ d{2})?( \\ d{2})?( \\ d{2})?([Z|+|-])?( \\ d{2})?'?( \\ d{2})?'?"));const e=n(this, $ l).exec(t);if(!e)return null;const s=parseInt(e[1],10);let i=parseInt(e[2],10);i=i>=1&&i<=12?i-1:0;let r=parseInt(e[3],10);r=r>=1&&r<=31?r:1;let a=parseInt(e[4],10);a=a>=0&&a<=23?a:0;let o=parseInt(e[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(e[6],10);l=l>=0&&l<=59?l:0;const h=e[7]||"Z";let c=parseInt(e[8],10);c=c>=0&&c<=23?c:0;let f=parseInt(e[9],10)||0;return f=f>=0&&f<=59?f:0,h==="-"?(a+=c,o+=f):h==="+"&&(a-=c,o-=f),new Date(Date.UTC(s,i,r,a,o,l))}} $ l=new WeakMap,d(Qd, $ l,void 0);function ty(u,{scale:t=1,rotation:e=0}){const{width:s,height:i}=u.attributes.style,r=[0,0,parseInt(s),parseInt(i)];return new ld({viewBox:r,userUnit:1,scale:t,rotation:e})}function rp(u){if(u.startsWith("#")){const t=parseInt(u.slice(1),16);return[(t&16711680)>>16,(t&65280)>>8,t&255]}return u.startsWith("rgb(")?u.slice(4,-1).split(",").map(t=>parseInt(t)):u.startsWith("rgba(")?u.slice(5,-1).split(",").map(t=>parseInt(t)).slice(0,3):(z( ` Not a valid color format : "${u}" ` ),[0,0,0])}function ey(u){const t=document.createElement("span");t.style.visibility="hidden",t.style.colorScheme="only light",document.body.append(t);for(const e of u.keys()){t.style.color=e;const s=window.getComputedStyle(t).color;u.set(e,rp(s))}t.remove()}function dt(u){const{a:t,b:e,c:s,d:i,e:r,f:a}=u.getTransform();return[t,e,s,i,r,a]}function os(u){const{a:t,b:e,c:s,d:i,e:r,f:a}=u.getTransform().invertSelf();return[t,e,s,i,r,a]}function ra(u,t,e=!1,s=!0){if(t instanceof ld){const{pageWidth:i,pageHeight:r}=t.rawDims,{style:a}=u,o=Wt.isCSSRoundSupported,l= ` var ( -- total - scale - factor ) * $ { i } px ` ,h= ` var ( -- total - scale - factor ) * $ { r } px ` ,c=o? ` round ( down , $ { l } , var ( -- scale - round - x ) ) ` : ` calc ( $ { l } ) ` ,f=o? ` round ( down , $ { h } , var ( -- scale - round - y ) ) ` : ` calc ( $ { h } ) ` ;!e||t.rotation%180===0?(a.width=c,a.height=f):(a.width=f,a.height=c)}s&&u.setAttribute("data-main-rotation",t.rotation)}class Ds{constructor(){const{pixelRatio:t}=Ds;this.sx=t,this.sy=t}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(t,e,s,i,r=-1){let a=1/0,o=1/0,l=1/0;s=Ds.capPixels(s,r),s>0&&(a=Math.sqrt(s/(t*e))),i!==-1&&(o=i/t,l=i/e);const h=Math.min(a,o,l);return this.sx>h||this.sy>h?(this.sx=h,this.sy=h,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(t,e){if(e>=0){const s=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+e/100));return t>0?Math.min(t,s):s}return t}}const Sp=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];var Pi,Mi,Ie,Hs,zl,Ea,Ca,Gl,ou,Mm,lu,Rm,hu,Dm,Ri,ua,Bn,ml;const Os=class Os{constructor(t){d(this,lu);d(this,hu);d(this,Ri);d(this,Bn);d(this,Pi,null);d(this,Mi,null);d(this,Ie,void 0);d(this,Hs,null);d(this,zl,null);d(this,Ea,null);d(this,Ca,null);p(this,Ie,t),n(Os,Gl)||p(Os,Gl,Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"}))}render(){const t=p(this,Pi,document.createElement("div"));t.classList.add("editToolbar","hidden"),t.setAttribute("role","toolbar");const e=n(this,Ie)._uiManager._signal;e instanceof AbortSignal&&!e.aborted&&(t.addEventListener("contextmenu",je,{signal:e}),t.addEventListener("pointerdown",b(Os,ou,Mm),{signal:e}));const s=p(this,Hs,document.createElement("div"));s.className="buttons",t.append(s);const i=n(this,Ie).toolbarPosition;if(i){const{style:r}=t,a=n(this,Ie)._uiManag
` ))||null;h&&this.data.comb&&(h=h.replaceAll(/ \s +/g,""));const c={userValue:o,formattedValue:h,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(s=document.createElement("textarea"),s.textContent=h??o,this.data.doNotScroll&&(s.style.overflowY="hidden")):(s=document.createElement("input"),s.type=this.data.password?"password":"text",s.setAttribute("value",h??o),this.data.doNotScroll&&(s.style.overflowX="hidden")),this.data.hasOwnCanvas&&(s.hidden=!0),oa.add(s),s.setAttribute("data-element-id",e),s.disabled=this.data.readOnly,s.name=this.data.fieldName,s.tabIndex=0;const{datetimeFormat:f,datetimeType:g,timeStep:m}=this.data,A=!!g&&this.enableScripting;f&&(s.title=f),this._setRequired(s,this.data.required),l&&(s.maxLength=l),s.addEventListener("input",v=>{t.setValue(e,{value:v.target.value}),this.setPropertyOnSiblings(s,"value",v.target.value,"value"),c.formattedValue=null}),s.addEventListener("resetform",v=>{const w=this.data.defaultFieldValue??"";s.value=c.userValue=w,c.formattedValue=null});let y=v=>{const{formattedValue:w}=c;w!=null&&(v.target.value=w),v.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){s.addEventListener("focus",w=>{var _;if(c.focused)return;const{target:S}=w;if(A&&(S.type=g,m&&(S.step=m)),c.userValue){const E=c.userValue;if(A)if(g==="time"){const C=new Date(E),T=[C.getHours(),C.getMinutes(),C.getSeconds()];S.value=T.map(x=>x.toString().padStart(2,"0")).join(":")}else S.value=new Date(E-cw).toISOString().split(g==="date"?"T":".",1)[0];else S.value=E}c.lastCommittedValue=S.value,c.commitKey=1,(_=this.data.actions)!=null&&_.Focus||(c.focused=!0)}),s.addEventListener("updatefromsandbox",w=>{this.showElementAndHideCanvas(w.target);const S={value(_){c.userValue=_.detail.value??"",A||t.setValue(e,{value:c.userValue.toString()}),_.target.value=c.userValue},formattedValue(_){const{formattedValue:E}=_.detail;c.formattedValue=E,E!=null&&_.target!==document.activeElement&&(_.target.value=E);const C={formattedValue:E};A&&(C.value=E),t.setValue(e,C)},selRange(_){_.target.setSelectionRange(..._.detail.selRange)},charLimit:_=>{var x;const{charLimit:E}=_.detail,{target:C}=_;if(E===0){C.removeAttribute("maxLength");return}C.setAttribute("maxLength",E);let T=c.userValue;!T||T.length<=E||(T=T.slice(0,E),C.value=c.userValue=T,t.setValue(e,{value:T}),(x=this.linkService.eventBus)==null||x.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:T,willCommit:!0,commitKey:1,selStart:C.selectionStart,selEnd:C.selectionEnd}}))}};this._dispatchEventFromSandbox(S,w)}),s.addEventListener("keydown",w=>{var E;c.commitKey=1;let S=-1;if(w.key==="Escape"?S=0:w.key==="Enter"&&!this.data.multiLine?S=2:w.key==="Tab"&&(c.commitKey=3),S===-1)return;const{value:_}=w.target;c.lastCommittedValue!==_&&(c.lastCommittedValue=_,c.userValue=_,(E=this.linkService.eventBus)==null||E.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:_,willCommit:!0,commitKey:S,selStart:w.target.selectionStart,selEnd:w.target.selectionEnd}}))});const v=y;y=null,s.addEventListener("blur",w=>{var E,C;if(!c.focused||!w.relatedTarget)return;(E=this.data.actions)!=null&&E.Blur||(c.focused=!1);const{target:S}=w;let{value:_}=S;if(A){if(_&&g==="time"){const T=_.split(":").map(x=>parseInt(x,10));_=new Date(2e3,0,1,T[0],T[1],T[2]||0).valueOf(),S.step=""}else _=new Date(_).valueOf();S.type="text"}c.userValue=_,c.lastCommittedValue!==_&&((C=this.linkService.eventBus)==null||C.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:_,willCommit:!0,commitKey:c.commitKey,selStart:w.target.selectionStart,selEnd:w.target.selectionEnd}})),v(w)}),(r=this.data.actions)!=null&&r.Keystroke&&s.addEventListener("beforeinput",w=>{var M;c.lastCommittedValue=null;const{data:S,target:_}=w,{value:E,selectionStart:C,selectionEnd:T}=_;let x=C,P=T;switch(w.inputType){case"deleteWordBackward":{const D=E.substring(0,C).match(/ \w *[^ \w ]* $ /);D&&(x-=D[0].length);break}case"deleteWordForward":{const D=E.substring(C).match(/^[^ \w ]* \w */);D&&(P+=D[0].length);break}case"deleteContentBackward"
` ))e.push({name:"span",value:r,attributes:i});return s},uf=new WeakSet,zb=function(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||(t.key==="Enter"||t.key==="Escape"&&n(this,Es))&&b(this,Ro,Id).call(this)},ff=new WeakSet,Gb=function(){if(n(this,gi)!==null)return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:s,pageX:i,pageY:r}}}=n(this,cc);let a=!!n(this,To),o=a?n(this,To):n(this,uc);for(const A of n(this,fi))if(!o||I.intersect(A.data.rect,o)!==null){o=A.data.rect,a=!0;break}const l=I.normalizeRect([o[0],t[3]-o[1]+t[1],o[2],t[3]-o[3]+t[1]]),h=5,c=a?o[2]-o[0]+h:0,f=l[0]+c,g=l[1];p(this,gi,[100*(f-i)/e,100*(g-r)/s]);const{style:m}=n(this,ft);m.left= ` $ { n ( this , gi ) [ 0 ] } % ` ,m.top= ` $ { n ( this , gi ) [ 1 ] } % ` },Ro=new WeakSet,Id=function(){p(this,Es,!n(this,Es)),n(this,Es)?(b(this,Do,Fd).call(this),n(this,ft).addEventListener("click",n(this,kr)),n(this,ft).addEventListener("keydown",n(this,xr))):(b(this,pc,lg).call(this),n(this,ft).removeEventListener("click",n(this,kr)),n(this,ft).removeEventListener("keydown",n(this,xr)))},Do=new WeakSet,Fd=function(){n(this,ye)||this.render(),this.isVisible?n(this,Es)&&n(this,ft).classList.add("focused"):(b(this,ff,Gb).call(this),n(this,ft).hidden=!1,n(this,ft).style.zIndex=parseInt(n(this,ft).style.zIndex)+1e3)},pc=new WeakSet,lg=function(){n(this,ft).classList.remove("focused"),!(n(this,Es)||!this.isVisible)&&(n(this,ft).hidden=!0,n(this,ft).style.zIndex=parseInt(n(this,ft).style.zIndex)-1e3)};class Ub extends bt{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType= $ .FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const t=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(const e of this.textContent){const s=document.createElement("span");s.textContent=e,t.append(s)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}var gc;class Aw extends bt{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});d(this,gc,null)}render(){this.container.classList.add("lineAnnotation");const{data:e,width:s,height:i}=this,r=this.svgFactory.create(s,i,!0),a=p(this,gc,this.svgFactory.createElement("svg:line"));return a.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),a.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),a.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),a.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),a.setAttribute("stroke-width",e.borderStyle.width||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),r.append(a),this.container.append(r),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return n(this,gc)}addHighlightArea(){this.container.classList.add("highlightArea")}}gc=new WeakMap;var mc;class yw extends bt{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});d(this,mc,null)}render(){this.container.classList.add("squareAnnotation");const{data:e,width:s,height:i}=this,r=this.svgFactory.create(s,i,!0),a=e.borderStyle.width,o=p(this,mc,this.svgFactory.createElement("svg:rect"));return o.setAttribute("x",a/2),o.setAttribute("y",a/2),o.setAttribute("width",s-a),o.setAttribute("height",i-a),o.setAttribute("stroke-width",a||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),r.append(o),this.container.append(r),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return n(this,mc)}addHighlightArea(){this.container.classList.add("highlightArea")}}mc=new WeakMap;var bc;class ww extends bt{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});d(this,bc,null)}render(){this.container.classList.add("circleAnnotation");const{data:e,width:s,height:i}=this,r=this.svgFactory.create(s,i,!0),a=e.borderStyle.width,o=p(this,bc,this.svgFactory.createElement("svg:ellipse"));return o.setAttribute("cx",s/2),o.setAttribute("cy",i/2),o.setAttribute("rx",s/2-a/2),o.setAttribute("ry
` );if(!r)return;const a=window.getSelection();if(!a.rangeCount)return;this.editorDiv.normalize(),a.deleteFromDocument();const o=a.getRangeAt(0);if(!r.includes( `
` )){o.insertNode(document.createTextNode(r)),this.editorDiv.normalize(),a.collapseToStart();return}const{startContainer:l,startOffset:h}=o,c=[],f=[];if(l.nodeType===Node.TEXT_NODE){const w=l.parentElement;if(f.push(l.nodeValue.slice(h).replaceAll(Ad,"")),w!==this.editorDiv){let S=c;for(const _ of this.editorDiv.childNodes){if(_===w){S=f;continue}S.push(b(y=nt,Io,Od).call(y,_))}}c.push(l.nodeValue.slice(0,h).replaceAll(Ad,""))}else if(l===this.editorDiv){let w=c,S=0;for(const _ of this.editorDiv.childNodes)S++===h&&(w=f),w.push(b(v=nt,Io,Od).call(v,_))}p(this,we, ` $ { c . join ( `
` )} ${ r } ${ f . join ( `
` )} ` ) , b ( this , Fo , Bd ) . call ( this ) ; const g = new Range ; let m = Math . sumPrecise ( c . map ( w => w . length ) ) ; for ( const { firstChild : w } of this . editorDiv . childNodes ) if ( w . nodeType === Node . TEXT _NODE ) { const S = w . nodeValue . length ; if ( m <= S ) { g . setStart ( w , m ) , g . setEnd ( w , m ) ; break } m -= S } a . removeAllRanges ( ) , a . addRange ( g ) } get contentDiv ( ) { return this . editorDiv } getPDFRect ( ) { const e = nt . _internalPadding * this . parentScale ; return this . getRect ( e , e ) } static async deserialize ( e , s , i ) { var o ; let r = null ; if ( e instanceof Ub ) { const { data : { defaultAppearanceData : { fontSize : l , fontColor : h } , rect : c , rotation : f , id : g , popupRef : m , contentsObj : A } , textContent : y , textPosition : v , parent : { page : { pageNumber : w } } } = e ; if ( ! y || y . length === 0 ) return null ; r = e = { annotationType : $ . FREETEXT , color : Array . from ( h ) , fontSize : l , value : y . join ( `
` ),position:v,pageIndex:w-1,rect:c.slice(0),rotation:f,annotationElementId:g,id:g,deleted:!1,popupRef:m,comment:(A==null?void 0:A.str)||null}}const a=await super.deserialize(e,s,i);return p(a,ve,e.fontSize),p(a,He,I.makeHexColor(...e.color)),p(a,we,b(o=nt,kc,gg).call(o,e.value)),a._initialData=r,e.comment&&a.setCommentData(e.comment),a}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const s=this.getPDFRect(),i=rt._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:n(this,He)),r={annotationType: $ .FREETEXT,color:i,fontSize:n(this,ve),value:b(this,bf,Kb).call(this),pageIndex:this.pageIndex,rect:s,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return this.addComment(r),e?(r.isCopy=!0,r):this.annotationElementId&&!b(this,Af,Qb).call(this,r)?null:(r.id=this.annotationElementId,r)}renderAnnotationElement(e){const s=super.renderAnnotationElement(e);if(!s)return null;const{style:i}=s;i.fontSize= ` calc ( $ { n ( this , ve ) } px * var ( -- total - scale - factor ) ) ` ,i.color=n(this,He),s.replaceChildren();for(const a of n(this,we).split( `
` )){const o=document.createElement("div");o.append(a?document.createTextNode(a):document.createElement("br")),s.append(o)}const r={rect:this.getPDFRect()};return r.popup=this.hasEditedComment?this.comment:{text:n(this,we)},e.updateEdited(r),s}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}};He=new WeakMap,we=new WeakMap,xc=new WeakMap,Dr=new WeakMap,ve=new WeakMap,pf=new WeakSet,Xb=function(e){const s=r=>{this.editorDiv.style.fontSize= ` calc ( $ { r } px * var ( -- total - scale - factor ) ) ` ,this.translate(0,-(r-n(this,ve))*this.parentScale),p(this,ve,r),b(this,Lo,Nd).call(this)},i=n(this,ve);this.addCommands({cmd:s.bind(this,e),undo:s.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:X.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},gf=new WeakSet,qb=function(e){const s=r=>{var a;p(this,He,this.editorDiv.style.color=r),(a=this._colorPicker)==null||a.update(r)},i=n(this,He);this.addCommands({cmd:s.bind(this,e),undo:s.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:X.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},mf=new WeakSet,Yb=function(){var i;const e=[];this.editorDiv.normalize();let s=null;for(const r of this.editorDiv.childNodes)(s==null?void 0:s.nodeType)===Node.TEXT_NODE&&r.nodeName==="BR"||(e.push(b(i=nt,Io,Od).call(i,r)),s=r);return e.join( `
` )},Lo=new WeakSet,Nd=function(){const[e,s]=this.parentDimensions;let i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{const{currentLayer:r,div:a}=this,o=a.style.display,l=a.classList.contains("hidden");a.classList.remove("hidden"),a.style.display="hidden",r.div.append(this.div),i=a.getBoundingClientRect(),a.remove(),a.style.display=o,a.classList.toggle("hidden",l)}this.rotation%180===this.parentRotation%180?(this.width=i.width/e,this.height=i.height/s):(this.width=i.height/e,this.height=i.width/s),this.fixAndSetPosition()},Io=new WeakSet,Od=function(e){return(e.nodeType===Node.TEXT_NODE?e.nodeValue:e.innerText).replaceAll(Ad,"")},Fo=new WeakSet,Bd=function(){if(this.editorDiv.replaceChildren(),!!n(this,we))for(const e of n(this,we).split( `
` )){const s=document.createElement("div");s.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(s)}},bf=new WeakSet,Kb=function(){return n(this,we).replaceAll(" "," ")},kc=new WeakSet,gg=function(e){return e.replaceAll(" "," ")},Af=new WeakSet,Qb=function(e){const{value:s,fontSize:i,color:r,pageIndex:a}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||e.value!==s||e.fontSize!==i||e.color.some((o,l)=>o!==r[l])||e.pageIndex!==a},d(nt,Io),d(nt,kc),k(nt,"_freeTextDefaultContent",""),k(nt,"_internalPadding",0),k(nt,"_defaultColor",null),k(nt,"_defaultFontSize",10),k(nt,"_type","freetext"),k(nt,"_editorType", $ .FREETEXT);let pg=nt;class L{toSVGPath(){st("Abstract method ` toSVGPath ` must be implemented.")}get box(){st("Abstract getter ` box ` must be implemented.")}serialize(t,e){st("Abstract method ` serialize ` must be implemented.")}static _rescale(t,e,s,i,r,a){a||(a=new Float32Array(t.length));for(let o=0,l=t.length;o<l;o+=2)a[o]=e+t[o]*i,a[o+1]=s+t[o+1]*r;return a}static _rescaleAndSwap(t,e,s,i,r,a){a||(a=new Float32Array(t.length));for(let o=0,l=t.length;o<l;o+=2)a[o]=e+t[o+1]*i,a[o+1]=s+t[o]*r;return a}static _translate(t,e,s,i){i||(i=new Float32Array(t.length));for(let r=0,a=t.length;r<a;r+=2)i[r]=e+t[r],i[r+1]=s+t[r+1];return i}static svgRound(t){return Math.round(t*1e4)}static _normalizePoint(t,e,s,i,r){switch(r){case 90:return[1-e/s,t/i];case 180:return[1-t/s,1-e/i];case 270:return[e/s,1-t/i];default:return[t/s,e/i]}}static _normalizePagePoint(t,e,s){switch(s){case 90:return[1-e,t];case 180:return[1-t,1-e];case 270:return[e,1-t];default:return[t,e]}}static createBezierPoints(t,e,s,i,r,a){return[(t+5*s)/6,(e+5*i)/6,(5*s+r)/6,(5*i+a)/6,(s+r)/2,(i+a)/2]}}k(L,"PRECISION",1e-4);var _e,ts,No,Oo,Cs,j,Lr,Ir,Pc,Mc,Bo,Ho,fn,Rc,yf,wf,Fr,Pl,vf,Jb,_f,Zb,Sf,tA,Ef,eA,Cf,sA,Tf,iA;const Bs=class Bs{constructor({x:t,y:e},s,i,r,a,o=0){d(this,Fr);d(this,vf);d(this,_f);d(this,Sf);d(this,Ef);d(this,Cf);d(this,Tf);d(this,_e,void 0);d(this,ts,[]);d(this,No,void 0);d(this,Oo,void 0);d(this,Cs,[]);d(this,j,new Float32Array(18));d(this,Lr,void 0);d(this,Ir,void 0);d(this,Pc,void 0);d(this,Mc,void 0);d(this,Bo,void 0);d(this,Ho,void 0);d(this,fn,[]);p(this,_e,s),p(this,Ho,r*i),p(this,Oo,a),n(this,j).set([NaN,NaN,NaN,NaN,t,e],6),p(this,No,o),p(this,Mc,n(Bs,Rc)*i),p(this,Pc,n(Bs,wf)*i),p(this,Bo,i),n(this,fn).push(t,e)}isEmpty(){return isNaN(n(this,j)[8])}add({x:t,y:e}){var M;p(this,Lr,t),p(this,Ir,e);const[s,i,r,a]=n(this,_e);let[o,l,h,c]=n(this,j).subarray(8,12);const f=t-h,g=e-c,m=Math.hypot(f,g);if(m<n(this,Pc))return!1;const A=m-n(this,Mc),y=A/m,v=y*f,w=y*g;let S=o,_=l;o=h,l=c,h+=v,c+=w,(M=n(this,fn))==null||M.push(t,e);const E=-w/A,C=v/A,T=E*n(this,Ho),x=C*n(this,Ho);return n(this,j).set(n(this,j).subarray(2,8),0),n(this,j).set([h+T,c+x],4),n(this,j).set(n(this,j).subarray(14,18),12),n(this,j).set([h-T,c-x],16),isNaN(n(this,j)[6])?(n(this,Cs).length===0&&(n(this,j).set([o+T,l+x],2),n(this,Cs).push(NaN,NaN,NaN,NaN,(o+T-s)/r,(l+x-i)/a),n(this,j).set([o-T,l-x],14),n(this,ts).push(NaN,NaN,NaN,NaN,(o-T-s)/r,(l-x-i)/a)),n(this,j).set([S,_,o,l,h,c],6),!this.isEmpty()):(n(this,j).set([S,_,o,l,h,c],6),Math.abs(Math.atan2(_-l,S-o)-Math.atan2(w,v))<Math.PI/2?([o,l,h,c]=n(this,j).subarray(2,6),n(this,Cs).push(NaN,NaN,NaN,NaN,((o+h)/2-s)/r,((l+c)/2-i)/a),[o,l,S,_]=n(this,j).subarray(14,18),n(this,ts).push(NaN,NaN,NaN,NaN,((S+o)/2-s)/r,((_+l)/2-i)/a),!0):([S,_,o,l,h,c]=n(this,j).subarray(0,6),n(this,Cs).push(((S+5*o)/6-s)/r,((_+5*l)/6-i)/a,((5*o+h)/6-s)/r,((5*l+c)/6-i)/a,((o+h)/2-s)/r,((l+c)/2-i)/a),[h,c,o,l,S,_]=n(this,j).subarray(12,18),n(this,ts).push(((S+5*o)/6-s)/r,((_+5*l)/6-i)/a,((5*o+h)/6-s)/r,((5*l+c)/6-i)/a,((o+h)/2-s)/r,((l+c)/2-i)/a),!0))}toSVGPath(){if(this.isEmpty())return"";const t=n(this,Cs),e=n(this,ts);if(isNaN(n(this,j)[6])&&!this.isEmpty())return b(this,vf,Jb).call(this);const s=[];s.push( ` M$ { t [ 4 ] } $ { t [ 5 ] } ` );for(let i=6;i<t.length;i+=6)isNaN(t[i])?s.push( ` L$ { t [ i + 4 ] } $ { t [ i + 5 ] } ` ):s.push( ` C$ { t [ i ] } $ { t [ i + 1 ] } $ { t [ i + 2 ] } $ { t [ i + 3 ] } $ { t [ i + 4 ] } $ { t [ i + 5 ] } ` );b(this,Sf,tA).call(this,s);for(let i=