/** Notice * This file contains works from many authors under various (but compatible) licenses. Please see core.txt for more information. **/ (function(){(window.wpCoreControlsBundle=window.wpCoreControlsBundle||[]).push([[4],{495:function(Ba,va,r){var oa=r(0);Ba=r(87);var na=r(49);r=function(ma){function fa(){return null!==ma&&ma.apply(this,arguments)||this}Object(oa.c)(fa,ma);fa.prototype.testSelection=function(da,aa,y){return na.a.Al(da,aa,y)};return fa}(Ba.a);va.a=r},86:function(Ba,va,r){function oa(mb){return Object(za.b)(void 0,void 0,void 0,function(){var nb,rb,sb,xa,Na,Za,cb,jb,zb,eb,lb,tb,Cb,Nb,ib;return Object(za.d)(this,function(ub){switch(ub.label){case 0:return nb= mb.wb,rb=mb.RE,sb=mb.SE,xa=mb.aL,Na=mb.mha,Za=mb.Yga,cb=bb.getDocument(),jb=[1],[4,Object(Ha.c)(rb,{extension:"pdf"})];case 1:return zb=ub.ca(),eb=bb.ma(),Cb=(tb=Ga.a).Sja,[4,zb.JC()];case 2:return lb=Cb.apply(tb,[ub.ca().xfdfString,nb]),Nb=!0,[4,cb.Sf(zb,jb,nb,Nb)];case 3:return ub.ca(),[4,cb.Eg([nb+1],Nb)];case 4:return ub.ca(),ib=eb.nb().filter(function(Fb){return Fb.uL()&&Fb.PageNumber===nb}),eb.Jf(ib,{force:!0,source:"contentEditTool"}),[4,eb.bL(lb)];case 5:return ub.ca(),Fa||(bb.getDocument().TM(), bb.SM(nb),bb.re()),aa(nb),Za||Na||(ba(nb,sb.galleys,xa,Na),ba(nb,sb.objects,xa,Na)),[2]}})})}function na(mb){if(mb)return ma(mb.contents);Object(Ma.g)("Unable to extract document content")}function ma(mb){mb=(new DOMParser).parseFromString(mb,"text/html").documentElement.querySelector("body");mb.querySelectorAll("p").forEach(function(nb){nb.querySelectorAll("span").forEach(function(xa){var Na=xa.getAttribute("style");Na=fa(Na,xa.innerHTML);xa.innerHTML=Na});var rb=nb.getAttribute("style"),sb=nb.innerHTML.replaceAll("
", "");nb.innerHTML=fa(rb,sb)});return mb.innerHTML.trim()}function fa(mb,nb){if(null===mb||void 0===mb?0:mb.includes("bold"))nb=""+nb+"";if(null===mb||void 0===mb?0:mb.includes("italic"))nb=""+nb+"";if((null===mb||void 0===mb?0:mb.includes("underline:1;"))||(null===mb||void 0===mb?0:mb.includes("text-decoration: underline")))nb=""+nb+"";return nb}function da(mb){if(["STRONG","EM","U"].includes(mb.tagName)&&null!==mb.getAttribute("style")){var nb=document.createElement("span"), rb=mb.style.color;rb=ca(rb);nb.setAttribute("style","color:"+rb);mb.removeAttribute("style");nb.innerHTML=mb.innerHTML;mb.innerHTML="";mb.appendChild(nb)}else"SPAN"===mb.tagName&&null!==mb.getAttribute("style")?(rb=mb.style.color,rb=ca(rb),mb.setAttribute("style","color:"+rb)):"A"===mb.tagName&&mb.removeAttribute("style")}function aa(mb){var nb=bb.ma(),rb=nb.nb().filter(function(sb){return sb.Qe()&&sb.PageNumber===mb});nb.Jf(rb,{force:!0,source:"contentEditTool"})}function y(mb,nb){nb.forEach(function(rb){Ta[mb]|| (Ta[mb]=[]);Ta[mb].find(function(sb){return sb.id===rb.id})||Ta[mb].push(rb)})}function x(mb,nb){nb.forEach(function(rb){Oa[mb]||(Oa[mb]=[]);Oa[mb].find(function(sb){return sb.id===rb.id})||Oa[mb].push(rb)})}function h(mb,nb,rb,sb){return Object(za.b)(void 0,void 0,void 0,function(){var xa,Na,Za,cb,jb,zb,eb,lb,tb,Cb,Nb,ib,ub,Fb,Mb,Sb,Rb,Zb;return Object(za.d)(this,function(ya){switch(ya.label){case 0:if(!mb)return[2];xa=nb.replaceAll("


","");Na=b(xa);Na=Na.replace(/(.*?)<\/span>/g, "$1");Na=Na.replace(/(.*?)<\/span>/g,"");Za=mb.ef.id;cb=mb.PageNumber;jb=Xa[cb];zb=jb.galleys.find(function(hc){return hc.id===Za});eb=ma(zb.contents);lb=ka(cb,jb,eb,Na,Za);if(""===lb)return[3,2];tb=new TextEncoder;Cb=tb.encode(lb);Nb=Cb.buffer;ib=Object(Ja.c)()||"https://www.pdftron.com/webfonts/v2/";ub=bb.getDocument();return[4,ub.ae([cb])];case 1:return Fb=ya.ca(),tb=new TextEncoder,Mb=tb.encode(""),Sb=Mb.buffer,Wa.postMessage({cmd:"importText",pdfFile:Fb,pageNumber:cb, webFontURL:ib,galleyId:Za,importData:Nb,tableData:Sb,isSearchReplace:rb,callbackMapId:sb},[Nb,Sb]),Rb={},zb&&(Zb=zb.galleyBox,Rb={top:Zb.top,left:Zb.left,bottom:Zb.bottom,right:Zb.right}),Object(Da.w)(eb,Na,Rb),[3,3];case 2:Object(Ma.g)("Unable to generate import XML"),ya.label=3;case 3:return[2]}})})}function b(mb){var nb=new DOMParser,rb=nb.parseFromString(mb,"text/xml");rb.querySelector("parsererror")&&(rb=nb.parseFromString(""+mb+"","text/xml"));rb.querySelectorAll("a").forEach(function(sb){var xa= sb.childNodes[0];Array.from(sb.querySelectorAll("*")).find(function(Na){return"u"===Na.tagName.toLowerCase()})||(sb=document.createElement("u"),xa.after(sb),sb.appendChild(xa))});return(new XMLSerializer).serializeToString(rb)}function e(mb,nb,rb){return Object(za.b)(void 0,void 0,void 0,function(){var sb,xa,Na,Za;return Object(za.d)(this,function(cb){switch(cb.label){case 0:return aa(nb),Oa[nb]=[],Ta[nb]=[],[4,mb.ae([nb])];case 1:return sb=cb.ca(),xa=new TextEncoder,Na=xa.encode(""),Za=Na.buffer, Wa.postMessage({cmd:"exportFile",pageNumber:nb,performExport:rb,pdfFile:sb,tableData:Za},[sb,Za]),[2]}})})}function a(mb){return Object(za.b)(void 0,void 0,void 0,function(){return Object(za.d)(this,function(){pb||(bb=mb,pb=new Promise(function(nb,rb){var sb=window.Core.ContentEdit.getWorkerPath(),xa=window.Core.ContentEdit.getResourcePath();Wa=new Worker(sb+"InfixServerModule.js");Wa.onmessage=function(Na){ia(Na,nb,rb)};Wa.postMessage({cmd:"isReady",resourcePath:xa})}));return[2,pb]})})}function f(mb, nb,rb,sb){this.top=mb;this.left=nb;this.bottom=rb;this.right=sb;this.topVal=function(){return Math.round(this.top)};this.bottomVal=function(){return Math.round(this.bottom)};this.leftVal=function(){return Math.round(this.left)};this.rightVal=function(){return Math.round(this.right)};this.height=function(){return Math.round(Math.abs(this.top-this.bottom))};this.width=function(){return Math.round(this.right-this.left)};this.FS=function(xa){return this.topVal()!==xa.topVal()||this.leftVal()!==xa.leftVal()|| this.bottomVal()!==xa.bottomVal()||this.rightVal()!==xa.rightVal()}}function n(mb,nb,rb,sb,xa){this.id=mb;this.pagenum=nb;this.galleysContents=rb;this.contents=sb;this.galleyBox=xa;Object(Da.v)(Oa)}function z(mb,nb,rb,sb){this.id=nb;this.type=mb;this.bbox=rb;this.pagenum=sb}function w(mb,nb,rb,sb,xa){this.id=mb;this.pagecount=nb;this.pageBBox=rb;this.galleys=sb;this.objects=xa}function ea(mb,nb){this.family=mb;this.variations=nb}function ka(mb,nb,rb,sb,xa){var Na=[],Za=[];(new DOMParser).parseFromString(sb, "text/html").documentElement.querySelectorAll("p").forEach(function(lb,tb){Na[tb]=lb.innerHTML;Za[tb]={fontSize:lb.style.fontSize,fontFamily:lb.style.fontFamily,color:ca(lb.style.color)}});rb=(new DOMParser).parseFromString(rb,"text/html");var cb=null;rb.documentElement.querySelectorAll("p").forEach(function(lb,tb){if(tb";nb=nb+("")+(eb.galleysContents+"");eb.contents=rb;nb=nb+rb+"\n";return nb+=""}function ca(mb){return mb.startsWith("rgb(")?"#"+mb.replace(/^[^\d]+/,"").replace(/[^\d]+$/,"").split(",").map(function(nb){return("00"+parseInt(nb,10).toString(16)).slice(-2)}).join(""):mb}function ba(mb,nb,rb,sb){var xa=[],Na=bb.getDocument(),Za=null;nb.forEach(function(cb){if(cb instanceof z){var jb=Na.mo(mb,cb.bbox.leftVal(),cb.bbox.topVal());var zb=jb.x;var eb=jb.y;var lb=Na.mo(mb,cb.bbox.rightVal(),cb.bbox.bottomVal());jb=lb.x;lb=lb.y}else if(cb instanceof n)jb=Na.mo(mb,cb.galleyBox.leftVal(),cb.galleyBox.topVal()),zb=jb.x,eb=jb.y,lb=Na.mo(mb,cb.galleyBox.rightVal(),cb.galleyBox.bottomVal()),jb=lb.x,lb=lb.y;else return;var tb=new window.Core.Annotations.RectangleAnnotation,Cb=Ra.a.OBJECT;cb instanceof n&&(Cb=Ra.a.TEXT);tb.Fma(cb,Cb);tb.PageNumber=cb.pagenum;tb.X=zb;tb.Y=eb;tb.Width= jb-zb;tb.Height=lb-eb;tb.StrokeColor=new Ia.a("#3183C8");tb.FillColor=new Ia.a(255,255,255,.01);tb.Style="dash";tb.Dashes="4,3";if(Va||sb)tb.NoView=!0,tb.Listable=!1;tb.Gw();tb.selectionModel=Aa.a;xa.push(tb);"undefined"!==typeof rb&&rb===cb.id&&(Za=tb)});nb=bb.ma();nb.Yg(xa);!Za||Va||sb||nb.Zf(Za);nb.le(xa)}function ia(mb,nb,rb){return Object(za.b)(this,void 0,void 0,function(){var sb,xa,Na,Za,cb,jb,zb,eb,lb,tb;return Object(za.d)(this,function(Cb){switch(Cb.label){case 0:sb=mb.data;Na=sb.cmd;switch(Na){case "isReady":return[3, 1];case "initialiseInfixServer":return[3,3];case "loadAvailableFonts":return[3,4];case "exportFile":return[3,5];case "insertNewTextBox":return[3,6];case "importText":return[3,7];case "transformObject":return[3,7];case "alignParagraph":return[3,7];case "deleteObject":return[3,8];case "insertImage":return[3,9]}return[3,10];case 1:return[4,Object(Pa.b)()];case 2:return Za=Cb.ca(),Wa.postMessage({cmd:"initialiseInfixServer",l:Za}),[3,10];case 3:return(cb=ha(sb.resultsXML))?(nb(),jb=Object(Ja.c)()||"https://www.pdftron.com/webfonts/v2/", Wa.postMessage({cmd:"loadAvailableFonts",webFontURL:jb})):rb("License key does not have content edit permission"),[3,10];case 4:return wa(sb.resultsXML),[3,10];case 5:return sb.exportPerformed?ja(sb.pageNumber,sb.exportXML,sb.objectXML,sb.resultsXML):(xa=Xa[sb.pageNumber],x(sb.pageNumber,xa.galleys),y(sb.pageNumber,xa.objects),aa(sb.pageNumber),ba(sb.pageNumber,xa.galleys),ba(sb.pageNumber,xa.objects)),ob.resolve(),qb&&qb[sb.pageNumber]&&qb[sb.pageNumber].resolve(),[3,10];case 6:return la(sb.pageNumber, sb.exportXML,sb.contentHTML),xa=Xa[sb.pageNumber],oa({wb:sb.pageNumber,RE:sb.pdfBuffer,SE:xa,aL:sb.id}),[3,10];case 7:xa=Xa[sb.pageNumber];ua(sb.pageNumber,sb.resultsXML);oa({wb:sb.pageNumber,RE:sb.pdfBuffer,SE:xa,aL:sb.id,mha:sb.isSearchReplace});zb=sb.isSearchReplace;eb=sb.callbackMapId;if(zb&&eb&&Eb[eb])Eb[eb]();return[3,10];case 8:return xa=Xa[sb.pageNumber],ua(sb.pageNumber,sb.resultsXML),xa.galleys=xa.galleys.filter(function(Nb){return Nb.id!==sb.id}),xa.objects=xa.objects.filter(function(Nb){return Nb.id!== sb.id}),lb={wb:sb.pageNumber,RE:sb.pdfBuffer,SE:xa},oa(lb),[3,10];case 9:return xa=Xa[sb.pageNumber],ua(sb.pageNumber,sb.resultsXML),tb={wb:sb.pageNumber,RE:sb.pdfBuffer,SE:xa,aL:sb.isText,Yga:!0},oa(tb),[3,10];case 10:return[2]}})})}function ha(mb){mb=new Uint8Array(mb);var nb=(new TextDecoder("utf-8")).decode(mb);mb=!1;nb=(new DOMParser).parseFromString(nb,"text/xml").getElementsByTagName("LicenseCheck");null!==nb&&0"}),rb+="",Na=mb.pageNumber,Za=bb.getDocument(),cb=mb.position,jb=cb.top, zb=cb.left,eb=cb.bottom,lb=cb.right,tb=mb.defaultText,Cb=mb.font,Nb=mb.fontSize,ib=mb.textColor,[4,Za.ae([Na])];case 1:return ub=Fb.ca(),Wa.postMessage({cmd:"insertNewTextBox",pdfFile:ub,pageNumber:Na,topVal:jb,leftVal:zb,bottomVal:eb,rightVal:lb,defaultText:tb,font:Cb,fontSize:Nb,textColor:ib,importData:rb,content:nb}),[2]}})})},Upa:h,Ida:na,$la:function(mb){return Object(za.b)(this,void 0,void 0,function(){var nb,rb,sb,xa,Na,Za,cb,jb,zb,eb,lb,tb,Cb,Nb,ib,ub,Fb,Mb,Sb,Rb,Zb,ya,hc=this;return Object(za.d)(this, function(sc){switch(sc.label){case 0:nb=mb.replaceWith;rb=mb.documentViewer;sb=mb.search;xa=mb.searchResults;if(rb){if(!xa&&!sb)throw Error('The "searchResults" parameter is missing in the options');if(void 0===nb)throw Error('The "replaceWith" parameter should not be undefined');}else throw Error('The "documentViewer" parameter is missing in the options');Na=1===xa.length;sb?(Za=sb.y8,cb=sb.rqa):(jb=qa(rb.eV()),Za=jb.y8,cb=jb.rqa);zb=null;eb=[];if(Na)zb=xa[0],eb=[zb.pageNum];else try{eb=Object.keys(xa.reduce(function(vc, Gc){vc[Gc.pageNum]=Gc.pageNum;return vc},{})).map(function(vc){return Number(vc)})}catch(vc){Object(Ma.i)(vc)}lb=0;if(zb)for(tb=rb.qk(),Cb=-1,Nb=0,ib=tb.length;Nb]*|&[^;]*)"+Sb,Mb);ob=window.createPromiseCapability();return pb?[3,2]:[4,a(rb)];case 1:sc.ca(),sc.label=2;case 2:return Va=!0,Da.a.trigger(db.d.SEARCH_AND_REPLACE_STARTED), Zb=0,ya=eb.map(function(vc){return Object(za.b)(hc,void 0,void 0,function(){var Gc,cd=this;return Object(za.d)(this,function(){Gc=new Promise(function(Ad,Qc){return Object(za.b)(cd,void 0,void 0,function(){var Bd=this;return Object(za.d)(this,function(je){switch(je.label){case 0:return qb[vc]=window.createPromiseCapability(),[4,e(rb.getDocument(),vc,!0)];case 1:return je.ca(),qb[vc].promise.then(function(){return Object(za.b)(Bd,void 0,void 0,function(){function kc(dd,ve){return Object(za.b)(this, void 0,void 0,function(){var Qd,Vc;return Object(za.d)(this,function(Wc){switch(Wc.label){case 0:Qd=Sa.a.Ssa(),Eb[Qd]=function(){delete Eb[Qd];Ad(!0);Da.a.trigger(db.d.SEARCH_AND_REPLACE_TEXT_REPLACED)},Wc.label=1;case 1:return Wc.hg.push([1,3,,4]),[4,h(dd,ve,!0,Qd)];case 2:return Wc.ca(),[3,4];case 3:return Vc=Wc.ca(),Object(Ma.i)(Vc),Qc(Vc),[3,4];case 4:return[2]}})})}var jc,Yd,ke,Cd,Hd,le,oc,Zd,Uc,md,Dd,Dc,Pd,me,$d,Id,Jd;return Object(za.d)(this,function(){jc=bb.ma();Yd=jc.nb().filter(function(dd){return dd.PageNumber=== vc}).filter(function(dd){return dd.Qe()}).concat();ke=[];Hd=Cd=0;for(le=Yd.length;Hdlb){Dc=Math.abs(Cd-md.length-lb);Pd=md[Dc].index;me=Uc.substr(0,Pd);$d=nb;Id=Uc.substr(Pd+Fb.length,Uc.length);Jd=""+me+$d+Id;Da.a.trigger(db.d.SEARCH_AND_REPLACE_TEXT_FOUND,[[zb]]);kc(oc,Jd);break}else Na||(Fa=!0,Jd=Uc.replace(Rb,nb), Da.a.trigger(db.d.SEARCH_AND_REPLACE_TEXT_FOUND,[ke]),kc(oc,Jd))}return[2]})})}).catch(Qc),[2]}})})});return[2,Gc]})})}),[2,Promise.all(ya).then(function(){Na&&zb?rb.bN(zb):(rb.bT(),rb.Jm(),rb.re());Fa=Va=!1;Da.a.trigger(db.d.SEARCH_AND_REPLACE_ENDED);var vc=bb.ma(),Gc=vc.nb().filter(function(cd){return cd.Qe()});vc.Jf(Gc,{force:!0,source:"contentEditTool"})})]}})})},Gma:function(mb,nb){var rb=ma(mb.ef.contents);rb=(new DOMParser).parseFromString(rb,"text/html").documentElement.querySelector("body"); var sb=rb.querySelectorAll("p"),xa=new XMLSerializer;sb.forEach(function(Na){Na.style.fontFamily=nb});rb=xa.serializeToString(rb);h(mb,rb)},Hma:function(mb,nb){var rb=ma(mb.ef.contents);rb=(new DOMParser).parseFromString(rb,"text/html").documentElement.querySelector("body");var sb=rb.querySelectorAll("p"),xa=new XMLSerializer;sb.forEach(function(Na){Na.style.fontSize=nb});rb=xa.serializeToString(rb);h(mb,rb)},j7:function(mb,nb){return Object(za.b)(void 0,void 0,void 0,function(){var rb,sb,xa,Na,Za, cb,jb;return Object(za.d)(this,function(zb){switch(zb.label){case 0:return rb=mb.ef.id,sb=mb.PageNumber,xa=bb.getDocument(),[4,xa.ae([sb])];case 1:return Na=zb.ca(),Za=new TextEncoder,cb=Za.encode(""),jb=cb.buffer,Wa.postMessage({cmd:"AlignParaText",pdfFile:Na,pageNumber:sb,galleyID:rb,alignment:nb,topVal1:"",leftVal1:"",bottomVal1:"",rightVal1:"",topVal2:"",leftVal2:"",bottomVal2:"",rightVal2:"",tableData:jb},[jb]),[2]}})})},Z7:function(mb){var nb=ma(mb.ef.contents);nb=(new DOMParser).parseFromString(nb, "text/html").documentElement.querySelector("body");var rb=nb.querySelectorAll("p"),sb=new XMLSerializer,xa="bold"===rb[0].style.fontWeight,Na=sb.serializeToString(rb[0]).includes("");rb.forEach(function(Za){if(xa||Na){Za.style.fontWeight="normal";var cb=sb.serializeToString(Za).replace(//g,"");cb=cb.replace(/<\/strong>/g,"");cb=(new DOMParser).parseFromString(cb,"text/html").documentElement.querySelector("p");Za.parentElement.replaceChild(cb,Za)}else Za.style.fontWeight="bold",Za.innerHTML= ""+Za.innerHTML.trim()+""});nb=sb.serializeToString(nb);h(mb,nb)},xha:function(mb){var nb=ma(mb.ef.contents);nb=(new DOMParser).parseFromString(nb,"text/html").documentElement.querySelector("body");var rb=nb.querySelectorAll("p"),sb=new XMLSerializer,xa="italic"===rb[0].style.fontStyle,Na=sb.serializeToString(rb[0]).includes("");rb.forEach(function(Za){if(xa||Na){Za.style.fontStyle="normal";Za.style.font.includes("Italic")&&(Za.style.font=Za.style.font.replace("Italic",""));var cb= sb.serializeToString(Za).replace(//g,"");cb=cb.replace(/<\/em>/g,"");cb=(new DOMParser).parseFromString(cb,"text/html").documentElement.querySelector("p");Za.parentElement.replaceChild(cb,Za)}else Za.style.fontStyle="italic",Za.innerHTML=""+Za.innerHTML.trim()+""});nb=sb.serializeToString(nb);h(mb,nb)},Hpa:function(mb){var nb=ma(mb.ef.contents);nb=(new DOMParser).parseFromString(nb,"text/html").documentElement.querySelector("body");var rb=nb.querySelectorAll("p"),sb=new XMLSerializer, xa=rb[0].style.textDecoration.includes("underline")||rb[0].style.textDecoration.includes("word"),Na=sb.serializeToString(rb[0]).includes("");rb.forEach(function(Za){if(xa||Na){Za.style.textDecoration=Za.style.textDecoration.replace("underline","");var cb=sb.serializeToString(Za).replace(//g,"");cb=cb.replace(/<\/u>/g,"");cb=(new DOMParser).parseFromString(cb,"text/html").documentElement.querySelector("p");Za.parentElement.replaceChild(cb,Za)}else Za.style.textDecoration.includes("none")?Za.style.textDecoration= Za.style.textDecoration.replace("none","underline"):Za.style.textDecoration+=" underline",Za.innerHTML=""+Za.innerHTML.trim()+""});nb=sb.serializeToString(nb);h(mb,nb)},toa:function(mb,nb){var rb=ma(mb.ef.contents);rb=(new DOMParser).parseFromString(rb,"text/html").documentElement.querySelector("body");var sb=rb.querySelectorAll("p"),xa=new XMLSerializer;sb.forEach(function(Na){Na.style.color=nb});rb.querySelectorAll("span").forEach(function(Na){Na.setAttribute("style","color:"+nb)});rb=xa.serializeToString(rb); h(mb,rb)},uda:function(){return Ib},V6:function(mb){return Object(za.b)(void 0,void 0,void 0,function(){var nb,rb,sb,xa,Na,Za,cb,jb,zb,eb;return Object(za.d)(this,function(lb){switch(lb.label){case 0:return nb=mb.pageNumber,rb=mb.newImage,sb=mb.scaleType,xa=mb.position,Na=xa.top,Za=xa.left,cb=xa.bottom,jb=xa.right,zb=bb.getDocument(),[4,zb.ae([nb])];case 1:return eb=lb.ca(),Wa.postMessage({cmd:"insertImage",pdfFile:eb,pageNumber:nb,newImage:rb,scaleType:sb,topVal:Na,leftVal:Za,bottomVal:cb,rightVal:jb}, []),[2]}})})}}}}]);}).call(this || window)