@pdfme/ui 4.4.1 → 4.4.2
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.
- package/dist/index.es.js +4 -4
- package/dist/index.umd.js +3 -2
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
@@ -9570,7 +9570,7 @@ function createNewTemplate(a, s) {
|
|
9570
9570
|
lt.__bodyRange = {
|
9571
9571
|
start: Math.max(st - 1, 0),
|
9572
9572
|
end: st + rt.length - 1
|
9573
|
-
}, $.schemas[tt][at] = Object.assign({}, lt, { position: it, height: et });
|
9573
|
+
}, lt.__isSplit = st > 0, $.schemas[tt][at] = Object.assign({}, lt, { position: it, height: et });
|
9574
9574
|
}
|
9575
9575
|
});
|
9576
9576
|
}), $;
|
@@ -82557,14 +82557,14 @@ function parseInput(a, s) {
|
|
82557
82557
|
}
|
82558
82558
|
function createSingleTable(a, s) {
|
82559
82559
|
const { options: $, _cache: _, basePdf: _e } = s;
|
82560
|
-
|
82561
|
-
|
82560
|
+
isBlankPdf(_e) || console.warn(`[@pdfme/schema/table]When specifying a custom PDF for basePdf, you cannot use features such as page breaks or re-layout of other elements.To utilize these features, please define basePdf as follows:
|
82561
|
+
{ width: number; height: number; padding: [number, number, number, number]; }`);
|
82562
82562
|
const tt = cloneDeep$1(s.schema), { start: nt } = tt.__bodyRange || { start: 0 };
|
82563
82563
|
if (nt % 2 === 1) {
|
82564
82564
|
const lt = tt.bodyStyles.alternateBackgroundColor;
|
82565
82565
|
tt.bodyStyles.alternateBackgroundColor = tt.bodyStyles.backgroundColor, tt.bodyStyles.backgroundColor = lt;
|
82566
82566
|
}
|
82567
|
-
tt.showHead = tt.showHead === !1 ? !1 :
|
82567
|
+
tt.showHead = tt.showHead === !1 ? !1 : !tt.__isSplit;
|
82568
82568
|
const at = parseInput(tt, a), ot = $.font || getDefaultFont(), rt = getFallbackFontName(ot), st = parseContent4Table(at, rt);
|
82569
82569
|
return Table$3.create({ input: at, content: st, font: ot, _cache: _ });
|
82570
82570
|
}
|
package/dist/index.umd.js
CHANGED
@@ -47,7 +47,7 @@ ERROR MESSAGE: ${tt.message}
|
|
47
47
|
--------------------------`).join(`
|
48
48
|
`);throw Error(`[@pdfme/common] Invalid argument:
|
49
49
|
--------------------------
|
50
|
-
${_e}`)}}if(a&&typeof a=="object"&&"template"in a&&"options"in a){const{template:$,options:_}=a;_&&_.font&&checkFont({font:_.font,template:$})}if(a&&typeof a=="object"&&"template"in a&&"plugins"in a){const{template:$,plugins:_}=a;_&&checkPlugins({plugins:_,template:$})}},checkInputs=a=>checkProps(a,Inputs),checkUIOptions=a=>checkProps(a,UIOptions),checkTemplate=a=>checkProps(a,Template),checkUIProps=a=>checkProps(a,UIProps),checkPreviewProps=a=>checkProps(a,PreviewProps),checkDesignerProps=a=>checkProps(a,DesignerProps);class Node{constructor({width:s=0,height:$=0}={}){Object.defineProperty(this,"index",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"key",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"schema",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"children",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"padding",{enumerable:!0,configurable:!0,writable:!0,value:[0,0,0,0]}),Object.defineProperty(this,"position",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0}}),this.width=s,this.height=$}setIndex(s){this.index=s}setKeyAndSchema(s,$){this.key=s,this.schema=$}setWidth(s){this.width=s}setHeight(s){this.height=s}setPadding(s){this.padding=s}setPosition(s){this.position=s}insertChild(s){const $=this.getChildCount();s.setIndex($),this.children.splice($,0,s)}getChildCount(){return this.children.length}getChild(s){return this.children[s]}}function createPage(a){const s=new Node({...a});return s.setPadding(a.padding),s}function createNode(a){const{position:s,width:$,height:_,key:_e,schema:tt}=a,nt=new Node({width:$,height:_});return nt.setPosition(s),nt.setKeyAndSchema(_e,tt),nt}function resortChildren(a,s){a.children=a.children.sort(($,_)=>{const _e=s.get($.key),tt=s.get(_.key);if(_e===void 0||tt===void 0)throw new Error("[@pdfme/common] order is not defined");return _e-tt}).map(($,_)=>($.setIndex(_),$))}async function createOnePage(a){const{basePdf:s,schemaObj:$,orderMap:_,input:_e,options:tt,_cache:nt,getDynamicHeights:at}=a,ot=createPage(s),rt=[],st=Object.entries($).sort((it,ut)=>it[1].position.y-ut[1].position.y),lt=new Map;for(const[it,ut]of st){const{position:ft,width:ht}=ut,dt={schema:ut,basePdf:s,options:tt,_cache:nt},gt=await at((_e==null?void 0:_e[it])||"",dt),pt=gt.reduce((ct,vt)=>ct+vt,0),mt=ut.height;pt!==mt&<.set(ft.y+mt,pt-mt),gt.forEach((ct,vt)=>{let At=ut.position.y+gt.reduce((bt,Et,St)=>St<vt?bt+Et:bt,0);for(const[bt,Et]of lt.entries())bt<=ut.position.y&&(At+=Et);const xt=createNode({key:it,schema:ut,position:{...ft,y:At},width:ht,height:ct});rt.push(At+ct+s.padding[2]),ot.insertChild(xt)})}const et=Math.max(...rt,s.height-s.padding[2]);return ot.setHeight(et),resortChildren(ot,_),ot}function breakIntoPages(a){const{longPage:s,orderMap:$,basePdf:_}=a,_e=[createPage(_)],[tt,,nt]=_.padding,at=[],ot=lt=>_.height-nt-(lt>0?tt:0),rt=(lt,et)=>{var ut;const it=lt-et*(_.height-tt-nt);for(;_e.length<=et;)_e[et]||(_e.push(createPage(_)),at.push({page:et,value:(it-tt)*-1}));return it+(((ut=at.find(ft=>ft.page===et))==null?void 0:ut.value)||0)},st=s.children.sort((lt,et)=>lt.position.y-et.position.y);for(let lt=0;lt<st.length;lt++){const{key:et,schema:it,position:ut,height:ft,width:ht}=st[lt],{y:dt,x:gt}=ut;let pt=Math.floor(dt/ot(_e.length-1)),mt=rt(dt,pt);if(mt+ft>_.height-nt&&(pt++,mt=rt(dt,pt)),!et||!it)throw new Error("[@pdfme/common] key or schema is undefined");const ct=createNode({key:et,schema:it,position:{x:gt,y:mt},width:ht,height:ft});_e[pt].insertChild(ct)}return _e.forEach(lt=>resortChildren(lt,$)),_e}function createNewTemplate(a,s){const $={schemas:Array.from({length:a.length},()=>({})),basePdf:s},_=new Map;return cloneDeep$1(a).forEach((_e,tt)=>{_e.children.forEach(nt=>{const{key:at,schema:ot}=nt;if(!at||!ot)throw new Error("[@pdfme/common] key or schema is undefined");_.has(at)||_.set(at,[]),_.get(at).push(nt);const rt=_e.children.filter(lt=>lt.key===at),st=_.get(at).length-rt.length;if(rt.length>0){if(!rt[0].schema)throw new Error("[@pdfme/common] schema is undefined");const lt=rt[0].schema,et=rt.reduce((ut,ft)=>ut+ft.height,0),it=rt[0].position;lt.__bodyRange={start:Math.max(st-1,0),end:st+rt.length-1},$.schemas[tt][at]=Object.assign({},lt,{position:it,height:et})}})}),$}const getDynamicTemplate=async a=>{const{template:s}=a;if(!isBlankPdf(s.basePdf))return s;const $=s.basePdf,_=[];for(const _e of s.schemas){const tt=new Map(Object.keys(_e).map((ot,rt)=>[ot,rt])),nt=await createOnePage({basePdf:$,schemaObj:_e,orderMap:tt,...a}),at=breakIntoPages({longPage:nt,basePdf:$,orderMap:tt});_.push(...at)}return createNewTemplate(_,s.basePdf)},DEFAULT_LANG="en",DESTROYED_ERR_MSG="[@pdfme/ui] this instance is already destroyed",SELECTABLE_CLASSNAME="selectable",RULER_HEIGHT=30,PAGE_GAP=10,RIGHT_SIDEBAR_WIDTH=400,BACKGROUND_COLOR="rgb(74, 74, 74)";var pdf_worker_entry={},pdf_worker={exports:{}};(function(a,s){(function(_,_e){a.exports=_.pdfjsWorker=_e()})(globalThis,()=>(()=>{var $=[,(nt,at,ot)=>{Object.defineProperty(at,"__esModule",{value:!0}),at.WorkerTask=at.WorkerMessageHandler=void 0,ot(2),ot(84),ot(93),ot(94),ot(97),ot(99),ot(101),ot(105),ot(108),ot(115),ot(116),ot(127),ot(129),ot(132),ot(134),ot(136),ot(138),ot(140),ot(144);var rt=ot(145),st=ot(150),lt=ot(151),et=ot(153),it=ot(157),ut=ot(219),ft=ot(224),ht=ot(258),dt=ot(259),gt=ot(223);class pt{constructor(At){this.name=At,this.terminated=!1,this._capability=new rt.PromiseCapability}get finished(){return this._capability.promise}finish(){this._capability.resolve()}terminate(){this.terminated=!0}ensureNotTerminated(){if(this.terminated)throw new Error("Worker task was terminated")}}at.WorkerTask=pt;class mt{static setup(At,xt){let bt=!1;At.on("test",function(Et){bt||(bt=!0,At.send("test",Et instanceof Uint8Array))}),At.on("configure",function(Et){(0,rt.setVerbosityLevel)(Et.verbosity)}),At.on("GetDocRequest",function(Et){return mt.createDocumentHandler(Et,xt)})}static createDocumentHandler(At,xt){let bt,Et=!1,St=null;const Bt=new Set,Ot=(0,rt.getVerbosityLevel)(),{docId:Pt,apiVersion:wt}=At,Ct="3.11.174";if(wt!==Ct)throw new Error(`The API version "${wt}" does not match the Worker version "${Ct}".`);const It=[];for(const Mt in[])It.push(Mt);if(It.length)throw new Error("The `Array.prototype` contains unexpected enumerable properties: "+It.join(", ")+"; thus breaking e.g. `for...in` iteration of `Array`s.");const yt=Pt+"_worker";let Rt=new ht.MessageHandler(yt,Pt,xt);function kt(){if(Et)throw new Error("Worker was terminated")}function jt(Mt){Bt.add(Mt)}function Ht(Mt){Mt.finish(),Bt.delete(Mt)}async function Ft(Mt){await bt.ensureDoc("checkHeader"),await bt.ensureDoc("parseStartXRef"),await bt.ensureDoc("parse",[Mt]),await bt.ensureDoc("checkFirstPage",[Mt]),await bt.ensureDoc("checkLastPage",[Mt]);const Lt=await bt.ensureDoc("isPureXfa");if(Lt){const Ut=new pt("loadXfaFonts");jt(Ut),await Promise.all([bt.loadXfaFonts(Rt,Ut).catch(Vt=>{}).then(()=>Ht(Ut)),bt.loadXfaImages()])}const[$t,Tt]=await Promise.all([bt.ensureDoc("numPages"),bt.ensureDoc("fingerprints")]),Dt=Lt?await bt.ensureDoc("htmlForXfa"):null;return{numPages:$t,fingerprints:Tt,htmlForXfa:Dt}}function _t(Mt){let{data:Lt,password:$t,disableAutoFetch:Tt,rangeChunkSize:Dt,length:Ut,docBaseUrl:Vt,enableXfa:Qt,evaluatorOptions:qt}=Mt;const Zt={source:null,disableAutoFetch:Tt,docBaseUrl:Vt,docId:Pt,enableXfa:Qt,evaluatorOptions:qt,handler:Rt,length:Ut,password:$t,rangeChunkSize:Dt},ar=new rt.PromiseCapability;let Jt;if(Lt){try{Zt.source=Lt,Jt=new et.LocalPdfManager(Zt),ar.resolve(Jt)}catch(ir){ar.reject(ir)}return ar.promise}let rr,Yt=[];try{rr=new dt.PDFWorkerStream(Rt)}catch(ir){return ar.reject(ir),ar.promise}const Kt=rr.getFullReader();Kt.headersReady.then(function(){if(Kt.isRangeSupported){Zt.source=rr,Zt.length=Kt.contentLength,Zt.disableAutoFetch||(Zt.disableAutoFetch=Kt.isStreamingSupported),Jt=new et.NetworkPdfManager(Zt);for(const ir of Yt)Jt.sendProgressiveData(ir);Yt=[],ar.resolve(Jt),St=null}}).catch(function(ir){ar.reject(ir),St=null});let nr=0;const tr=function(){const ir=(0,st.arrayBuffersToBytes)(Yt);Ut&&ir.length!==Ut&&(0,rt.warn)("reported HTTP length is different from actual");try{Zt.source=ir,Jt=new et.LocalPdfManager(Zt),ar.resolve(Jt)}catch(sr){ar.reject(sr)}Yt=[]};return new Promise(function(ir,sr){const cr=function(or){let{value:Xt,done:Gt}=or;try{if(kt(),Gt){Jt||tr(),St=null;return}nr+=Xt.byteLength,Kt.isStreamingSupported||Rt.send("DocProgress",{loaded:nr,total:Math.max(nr,Kt.contentLength||0)}),Jt?Jt.sendProgressiveData(Xt):Yt.push(Xt),Kt.read().then(cr,sr)}catch(Wt){sr(Wt)}};Kt.read().then(cr,sr)}).catch(function(ir){ar.reject(ir),St=null}),St=function(ir){rr.cancelAllRequests(ir)},ar.promise}function Nt(Mt){function Lt(Dt){kt(),Rt.send("GetDoc",{pdfInfo:Dt})}function $t(Dt){if(kt(),Dt instanceof rt.PasswordException){const Ut=new pt(`PasswordException: response ${Dt.code}`);jt(Ut),Rt.sendWithPromise("PasswordRequest",Dt).then(function(Vt){let{password:Qt}=Vt;Ht(Ut),bt.updatePassword(Qt),Tt()}).catch(function(){Ht(Ut),Rt.send("DocException",Dt)})}else Dt instanceof rt.InvalidPDFException||Dt instanceof rt.MissingPDFException||Dt instanceof rt.UnexpectedResponseException||Dt instanceof rt.UnknownErrorException?Rt.send("DocException",Dt):Rt.send("DocException",new rt.UnknownErrorException(Dt.message,Dt.toString()))}function Tt(){kt(),Ft(!1).then(Lt,function(Dt){if(kt(),!(Dt instanceof st.XRefParseException)){$t(Dt);return}bt.requestLoadedStream().then(function(){kt(),Ft(!0).then(Lt,$t)})})}kt(),_t(Mt).then(function(Dt){if(Et)throw Dt.terminate(new rt.AbortException("Worker was terminated.")),new Error("Worker was terminated");bt=Dt,bt.requestLoadedStream(!0).then(Ut=>{Rt.send("DataLoaded",{length:Ut.bytes.byteLength})})}).then(Tt,$t)}return Rt.on("GetPage",function(Mt){return bt.getPage(Mt.pageIndex).then(function(Lt){return Promise.all([bt.ensure(Lt,"rotate"),bt.ensure(Lt,"ref"),bt.ensure(Lt,"userUnit"),bt.ensure(Lt,"view")]).then(function($t){let[Tt,Dt,Ut,Vt]=$t;return{rotate:Tt,ref:Dt,userUnit:Ut,view:Vt}})})}),Rt.on("GetPageIndex",function(Mt){const Lt=lt.Ref.get(Mt.num,Mt.gen);return bt.ensureCatalog("getPageIndex",[Lt])}),Rt.on("GetDestinations",function(Mt){return bt.ensureCatalog("destinations")}),Rt.on("GetDestination",function(Mt){return bt.ensureCatalog("getDestination",[Mt.id])}),Rt.on("GetPageLabels",function(Mt){return bt.ensureCatalog("pageLabels")}),Rt.on("GetPageLayout",function(Mt){return bt.ensureCatalog("pageLayout")}),Rt.on("GetPageMode",function(Mt){return bt.ensureCatalog("pageMode")}),Rt.on("GetViewerPreferences",function(Mt){return bt.ensureCatalog("viewerPreferences")}),Rt.on("GetOpenAction",function(Mt){return bt.ensureCatalog("openAction")}),Rt.on("GetAttachments",function(Mt){return bt.ensureCatalog("attachments")}),Rt.on("GetDocJSActions",function(Mt){return bt.ensureCatalog("jsActions")}),Rt.on("GetPageJSActions",function(Mt){let{pageIndex:Lt}=Mt;return bt.getPage(Lt).then(function($t){return bt.ensure($t,"jsActions")})}),Rt.on("GetOutline",function(Mt){return bt.ensureCatalog("documentOutline")}),Rt.on("GetOptionalContentConfig",function(Mt){return bt.ensureCatalog("optionalContentConfig")}),Rt.on("GetPermissions",function(Mt){return bt.ensureCatalog("permissions")}),Rt.on("GetMetadata",function(Mt){return Promise.all([bt.ensureDoc("documentInfo"),bt.ensureCatalog("metadata")])}),Rt.on("GetMarkInfo",function(Mt){return bt.ensureCatalog("markInfo")}),Rt.on("GetData",function(Mt){return bt.requestLoadedStream().then(function(Lt){return Lt.bytes})}),Rt.on("GetAnnotations",function(Mt){let{pageIndex:Lt,intent:$t}=Mt;return bt.getPage(Lt).then(function(Tt){const Dt=new pt(`GetAnnotations: page ${Lt}`);return jt(Dt),Tt.getAnnotationsData(Rt,Dt,$t).then(Ut=>(Ht(Dt),Ut),Ut=>{throw Ht(Dt),Ut})})}),Rt.on("GetFieldObjects",function(Mt){return bt.ensureDoc("fieldObjects")}),Rt.on("HasJSActions",function(Mt){return bt.ensureDoc("hasJSActions")}),Rt.on("GetCalculationOrderIds",function(Mt){return bt.ensureDoc("calculationOrderIds")}),Rt.on("SaveDocument",async function(Mt){let{isPureXfa:Lt,numPages:$t,annotationStorage:Tt,filename:Dt}=Mt;const Ut=[bt.requestLoadedStream(),bt.ensureCatalog("acroForm"),bt.ensureCatalog("acroFormRef"),bt.ensureDoc("startXRef"),bt.ensureDoc("xref"),bt.ensureDoc("linearization"),bt.ensureCatalog("structTreeRoot")],Vt=[],Qt=Lt?null:(0,st.getNewAnnotationsMap)(Tt),[qt,Zt,ar,Jt,rr,Yt,Kt]=await Promise.all(Ut),nr=rr.trailer.getRaw("Root")||null;let tr;if(Qt){Kt?await Kt.canUpdateStructTree({pdfManager:bt,newAnnotationsByPage:Qt})&&(tr=Kt):await gt.StructTreeRoot.canCreateStructureTree({catalogRef:nr,pdfManager:bt,newAnnotationsByPage:Qt})&&(tr=null);const lr=it.AnnotationFactory.generateImages(Tt.values(),rr,bt.evaluatorOptions.isOffscreenCanvasSupported),ur=tr===void 0?Vt:[];for(const[pr,yr]of Qt)ur.push(bt.getPage(pr).then(Er=>{const br=new pt(`Save (editor): page ${pr}`);return Er.saveNewAnnotations(Rt,br,yr,lr).finally(function(){Ht(br)})}));tr===null?Vt.push(Promise.all(ur).then(async pr=>(await gt.StructTreeRoot.createStructureTree({newAnnotationsByPage:Qt,xref:rr,catalogRef:nr,pdfManager:bt,newRefs:pr}),pr))):tr&&Vt.push(Promise.all(ur).then(async pr=>(await tr.updateStructureTree({newAnnotationsByPage:Qt,pdfManager:bt,newRefs:pr}),pr)))}if(Lt)Vt.push(bt.serializeXfaData(Tt));else for(let lr=0;lr<$t;lr++)Vt.push(bt.getPage(lr).then(function(ur){const pr=new pt(`Save: page ${lr}`);return ur.save(Rt,pr,Tt).finally(function(){Ht(pr)})}));const ir=await Promise.all(Vt);let sr=[],cr=null;if(Lt){if(cr=ir[0],!cr)return qt.bytes}else if(sr=ir.flat(2),sr.length===0)return qt.bytes;const or=ar&&Zt instanceof lt.Dict&&sr.some(lr=>lr.needAppearances),Xt=Zt instanceof lt.Dict&&Zt.get("XFA")||null;let Gt=null,Wt=!1;if(Array.isArray(Xt)){for(let lr=0,ur=Xt.length;lr<ur;lr+=2)Xt[lr]==="datasets"&&(Gt=Xt[lr+1],Wt=!0);Gt===null&&(Gt=rr.getNewTemporaryRef())}else Xt&&(0,rt.warn)("Unsupported XFA type.");let er=Object.create(null);if(rr.trailer){const lr=Object.create(null),ur=rr.trailer.get("Info")||null;ur instanceof lt.Dict&&ur.forEach((pr,yr)=>{typeof yr=="string"&&(lr[pr]=(0,rt.stringToPDFString)(yr))}),er={rootRef:nr,encryptRef:rr.trailer.getRaw("Encrypt")||null,newRef:rr.getNewTemporaryRef(),infoRef:rr.trailer.getRaw("Info")||null,info:lr,fileIds:rr.trailer.get("ID")||null,startXRef:Yt?Jt:rr.lastXRefStreamPos??Jt,filename:Dt}}return(0,ft.incrementalUpdate)({originalData:qt.bytes,xrefInfo:er,newRefs:sr,xref:rr,hasXfa:!!Xt,xfaDatasetsRef:Gt,hasXfaDatasetsEntry:Wt,needAppearances:or,acroFormRef:ar,acroForm:Zt,xfaData:cr}).finally(()=>{rr.resetNewTemporaryRef()})}),Rt.on("GetOperatorList",function(Mt,Lt){const $t=Mt.pageIndex;bt.getPage($t).then(function(Tt){const Dt=new pt(`GetOperatorList: page ${$t}`);jt(Dt);const Ut=Ot>=rt.VerbosityLevel.INFOS?Date.now():0;Tt.getOperatorList({handler:Rt,sink:Lt,task:Dt,intent:Mt.intent,cacheKey:Mt.cacheKey,annotationStorage:Mt.annotationStorage}).then(function(Vt){Ht(Dt),Ut&&(0,rt.info)(`page=${$t+1} - getOperatorList: time=${Date.now()-Ut}ms, len=${Vt.length}`),Lt.close()},function(Vt){Ht(Dt),!Dt.terminated&&Lt.error(Vt)})})}),Rt.on("GetTextContent",function(Mt,Lt){const{pageIndex:$t,includeMarkedContent:Tt,disableNormalization:Dt}=Mt;bt.getPage($t).then(function(Ut){const Vt=new pt("GetTextContent: page "+$t);jt(Vt);const Qt=Ot>=rt.VerbosityLevel.INFOS?Date.now():0;Ut.extractTextContent({handler:Rt,task:Vt,sink:Lt,includeMarkedContent:Tt,disableNormalization:Dt}).then(function(){Ht(Vt),Qt&&(0,rt.info)(`page=${$t+1} - getTextContent: time=${Date.now()-Qt}ms`),Lt.close()},function(qt){Ht(Vt),!Vt.terminated&&Lt.error(qt)})})}),Rt.on("GetStructTree",function(Mt){return bt.getPage(Mt.pageIndex).then(function(Lt){return bt.ensure(Lt,"getStructTree")})}),Rt.on("FontFallback",function(Mt){return bt.fontFallback(Mt.id,Rt)}),Rt.on("Cleanup",function(Mt){return bt.cleanup(!0)}),Rt.on("Terminate",function(Mt){Et=!0;const Lt=[];if(bt){bt.terminate(new rt.AbortException("Worker was terminated."));const $t=bt.cleanup();Lt.push($t),bt=null}else(0,ut.clearGlobalCaches)();St&&St(new rt.AbortException("Worker was terminated."));for(const $t of Bt)Lt.push($t.finished),$t.terminate();return Promise.all(Lt).then(function(){Rt.destroy(),Rt=null})}),Rt.on("Ready",function(Mt){Nt(At),At=null}),yt}static initializeFromPort(At){const xt=new ht.MessageHandler("worker","main",At);mt.setup(xt,At),xt.send("ready",null)}}at.WorkerMessageHandler=mt;function ct(vt){return typeof vt.postMessage=="function"&&"onmessage"in vt}typeof window>"u"&&!rt.isNodeJS&&typeof self<"u"&&ct(self)&&mt.initializeFromPort(self)},(nt,at,ot)=>{var rt=ot(3),st=ot(4),lt=ot(69),et=ot(70),it="WebAssembly",ut=st[it],ft=Error("e",{cause:7}).cause!==7,ht=function(gt,pt){var mt={};mt[gt]=et(gt,pt,ft),rt({global:!0,constructor:!0,arity:1,forced:ft},mt)},dt=function(gt,pt){if(ut&&ut[gt]){var mt={};mt[gt]=et(it+"."+gt,pt,ft),rt({target:it,stat:!0,constructor:!0,arity:1,forced:ft},mt)}};ht("Error",function(gt){return function(mt){return lt(gt,this,arguments)}}),ht("EvalError",function(gt){return function(mt){return lt(gt,this,arguments)}}),ht("RangeError",function(gt){return function(mt){return lt(gt,this,arguments)}}),ht("ReferenceError",function(gt){return function(mt){return lt(gt,this,arguments)}}),ht("SyntaxError",function(gt){return function(mt){return lt(gt,this,arguments)}}),ht("TypeError",function(gt){return function(mt){return lt(gt,this,arguments)}}),ht("URIError",function(gt){return function(mt){return lt(gt,this,arguments)}}),dt("CompileError",function(gt){return function(mt){return lt(gt,this,arguments)}}),dt("LinkError",function(gt){return function(mt){return lt(gt,this,arguments)}}),dt("RuntimeError",function(gt){return function(mt){return lt(gt,this,arguments)}})},(nt,at,ot)=>{var rt=ot(4),st=ot(5).f,lt=ot(44),et=ot(48),it=ot(38),ut=ot(56),ft=ot(68);nt.exports=function(ht,dt){var gt=ht.target,pt=ht.global,mt=ht.stat,ct,vt,At,xt,bt,Et;if(pt?vt=rt:mt?vt=rt[gt]||it(gt,{}):vt=(rt[gt]||{}).prototype,vt)for(At in dt){if(bt=dt[At],ht.dontCallGetSet?(Et=st(vt,At),xt=Et&&Et.value):xt=vt[At],ct=ft(pt?At:gt+(mt?".":"#")+At,ht.forced),!ct&&xt!==void 0){if(typeof bt==typeof xt)continue;ut(bt,xt)}(ht.sham||xt&&xt.sham)&<(bt,"sham",!0),et(vt,At,bt,ht)}}},function(nt){var at=function(ot){return ot&&ot.Math===Math&&ot};nt.exports=at(typeof globalThis=="object"&&globalThis)||at(typeof window=="object"&&window)||at(typeof self=="object"&&self)||at(typeof commonjsGlobal=="object"&&commonjsGlobal)||function(){return this}()||this||Function("return this")()},(nt,at,ot)=>{var rt=ot(6),st=ot(8),lt=ot(10),et=ot(11),it=ot(12),ut=ot(18),ft=ot(39),ht=ot(42),dt=Object.getOwnPropertyDescriptor;at.f=rt?dt:function(pt,mt){if(pt=it(pt),mt=ut(mt),ht)try{return dt(pt,mt)}catch{}if(ft(pt,mt))return et(!st(lt.f,pt,mt),pt[mt])}},(nt,at,ot)=>{var rt=ot(7);nt.exports=!rt(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})},nt=>{nt.exports=function(at){try{return!!at()}catch{return!0}}},(nt,at,ot)=>{var rt=ot(9),st=Function.prototype.call;nt.exports=rt?st.bind(st):function(){return st.apply(st,arguments)}},(nt,at,ot)=>{var rt=ot(7);nt.exports=!rt(function(){var st=(function(){}).bind();return typeof st!="function"||st.hasOwnProperty("prototype")})},(nt,at)=>{var ot={}.propertyIsEnumerable,rt=Object.getOwnPropertyDescriptor,st=rt&&!ot.call({1:2},1);at.f=st?function(et){var it=rt(this,et);return!!it&&it.enumerable}:ot},nt=>{nt.exports=function(at,ot){return{enumerable:!(at&1),configurable:!(at&2),writable:!(at&4),value:ot}}},(nt,at,ot)=>{var rt=ot(13),st=ot(16);nt.exports=function(lt){return rt(st(lt))}},(nt,at,ot)=>{var rt=ot(14),st=ot(7),lt=ot(15),et=Object,it=rt("".split);nt.exports=st(function(){return!et("z").propertyIsEnumerable(0)})?function(ut){return lt(ut)==="String"?it(ut,""):et(ut)}:et},(nt,at,ot)=>{var rt=ot(9),st=Function.prototype,lt=st.call,et=rt&&st.bind.bind(lt,lt);nt.exports=rt?et:function(it){return function(){return lt.apply(it,arguments)}}},(nt,at,ot)=>{var rt=ot(14),st=rt({}.toString),lt=rt("".slice);nt.exports=function(et){return lt(st(et),8,-1)}},(nt,at,ot)=>{var rt=ot(17),st=TypeError;nt.exports=function(lt){if(rt(lt))throw st("Can't call method on "+lt);return lt}},nt=>{nt.exports=function(at){return at==null}},(nt,at,ot)=>{var rt=ot(19),st=ot(23);nt.exports=function(lt){var et=rt(lt,"string");return st(et)?et:et+""}},(nt,at,ot)=>{var rt=ot(8),st=ot(20),lt=ot(23),et=ot(30),it=ot(33),ut=ot(34),ft=TypeError,ht=ut("toPrimitive");nt.exports=function(dt,gt){if(!st(dt)||lt(dt))return dt;var pt=et(dt,ht),mt;if(pt){if(gt===void 0&&(gt="default"),mt=rt(pt,dt,gt),!st(mt)||lt(mt))return mt;throw ft("Can't convert object to primitive value")}return gt===void 0&&(gt="number"),it(dt,gt)}},(nt,at,ot)=>{var rt=ot(21),st=ot(22),lt=st.all;nt.exports=st.IS_HTMLDDA?function(et){return typeof et=="object"?et!==null:rt(et)||et===lt}:function(et){return typeof et=="object"?et!==null:rt(et)}},(nt,at,ot)=>{var rt=ot(22),st=rt.all;nt.exports=rt.IS_HTMLDDA?function(lt){return typeof lt=="function"||lt===st}:function(lt){return typeof lt=="function"}},nt=>{var at=typeof document=="object"&&document.all,ot=typeof at>"u"&&at!==void 0;nt.exports={all:at,IS_HTMLDDA:ot}},(nt,at,ot)=>{var rt=ot(24),st=ot(21),lt=ot(25),et=ot(26),it=Object;nt.exports=et?function(ut){return typeof ut=="symbol"}:function(ut){var ft=rt("Symbol");return st(ft)&<(ft.prototype,it(ut))}},(nt,at,ot)=>{var rt=ot(4),st=ot(21),lt=function(et){return st(et)?et:void 0};nt.exports=function(et,it){return arguments.length<2?lt(rt[et]):rt[et]&&rt[et][it]}},(nt,at,ot)=>{var rt=ot(14);nt.exports=rt({}.isPrototypeOf)},(nt,at,ot)=>{var rt=ot(27);nt.exports=rt&&!Symbol.sham&&typeof Symbol.iterator=="symbol"},(nt,at,ot)=>{var rt=ot(28),st=ot(7),lt=ot(4),et=lt.String;nt.exports=!!Object.getOwnPropertySymbols&&!st(function(){var it=Symbol("symbol detection");return!et(it)||!(Object(it)instanceof Symbol)||!Symbol.sham&&rt&&rt<41})},(nt,at,ot)=>{var rt=ot(4),st=ot(29),lt=rt.process,et=rt.Deno,it=lt&<.versions||et&&et.version,ut=it&&it.v8,ft,ht;ut&&(ft=ut.split("."),ht=ft[0]>0&&ft[0]<4?1:+(ft[0]+ft[1])),!ht&&st&&(ft=st.match(/Edge\/(\d+)/),(!ft||ft[1]>=74)&&(ft=st.match(/Chrome\/(\d+)/),ft&&(ht=+ft[1]))),nt.exports=ht},nt=>{nt.exports=typeof navigator<"u"&&String(navigator.userAgent)||""},(nt,at,ot)=>{var rt=ot(31),st=ot(17);nt.exports=function(lt,et){var it=lt[et];return st(it)?void 0:rt(it)}},(nt,at,ot)=>{var rt=ot(21),st=ot(32),lt=TypeError;nt.exports=function(et){if(rt(et))return et;throw lt(st(et)+" is not a function")}},nt=>{var at=String;nt.exports=function(ot){try{return at(ot)}catch{return"Object"}}},(nt,at,ot)=>{var rt=ot(8),st=ot(21),lt=ot(20),et=TypeError;nt.exports=function(it,ut){var ft,ht;if(ut==="string"&&st(ft=it.toString)&&!lt(ht=rt(ft,it))||st(ft=it.valueOf)&&!lt(ht=rt(ft,it))||ut!=="string"&&st(ft=it.toString)&&!lt(ht=rt(ft,it)))return ht;throw et("Can't convert object to primitive value")}},(nt,at,ot)=>{var rt=ot(4),st=ot(35),lt=ot(39),et=ot(41),it=ot(27),ut=ot(26),ft=rt.Symbol,ht=st("wks"),dt=ut?ft.for||ft:ft&&ft.withoutSetter||et;nt.exports=function(gt){return lt(ht,gt)||(ht[gt]=it&<(ft,gt)?ft[gt]:dt("Symbol."+gt)),ht[gt]}},(nt,at,ot)=>{var rt=ot(36),st=ot(37);(nt.exports=function(lt,et){return st[lt]||(st[lt]=et!==void 0?et:{})})("versions",[]).push({version:"3.32.2",mode:rt?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.32.2/LICENSE",source:"https://github.com/zloirock/core-js"})},nt=>{nt.exports=!1},(nt,at,ot)=>{var rt=ot(4),st=ot(38),lt="__core-js_shared__",et=rt[lt]||st(lt,{});nt.exports=et},(nt,at,ot)=>{var rt=ot(4),st=Object.defineProperty;nt.exports=function(lt,et){try{st(rt,lt,{value:et,configurable:!0,writable:!0})}catch{rt[lt]=et}return et}},(nt,at,ot)=>{var rt=ot(14),st=ot(40),lt=rt({}.hasOwnProperty);nt.exports=Object.hasOwn||function(it,ut){return lt(st(it),ut)}},(nt,at,ot)=>{var rt=ot(16),st=Object;nt.exports=function(lt){return st(rt(lt))}},(nt,at,ot)=>{var rt=ot(14),st=0,lt=Math.random(),et=rt(1 .toString);nt.exports=function(it){return"Symbol("+(it===void 0?"":it)+")_"+et(++st+lt,36)}},(nt,at,ot)=>{var rt=ot(6),st=ot(7),lt=ot(43);nt.exports=!rt&&!st(function(){return Object.defineProperty(lt("div"),"a",{get:function(){return 7}}).a!==7})},(nt,at,ot)=>{var rt=ot(4),st=ot(20),lt=rt.document,et=st(lt)&&st(lt.createElement);nt.exports=function(it){return et?lt.createElement(it):{}}},(nt,at,ot)=>{var rt=ot(6),st=ot(45),lt=ot(11);nt.exports=rt?function(et,it,ut){return st.f(et,it,lt(1,ut))}:function(et,it,ut){return et[it]=ut,et}},(nt,at,ot)=>{var rt=ot(6),st=ot(42),lt=ot(46),et=ot(47),it=ot(18),ut=TypeError,ft=Object.defineProperty,ht=Object.getOwnPropertyDescriptor,dt="enumerable",gt="configurable",pt="writable";at.f=rt?lt?function(ct,vt,At){if(et(ct),vt=it(vt),et(At),typeof ct=="function"&&vt==="prototype"&&"value"in At&&pt in At&&!At[pt]){var xt=ht(ct,vt);xt&&xt[pt]&&(ct[vt]=At.value,At={configurable:gt in At?At[gt]:xt[gt],enumerable:dt in At?At[dt]:xt[dt],writable:!1})}return ft(ct,vt,At)}:ft:function(ct,vt,At){if(et(ct),vt=it(vt),et(At),st)try{return ft(ct,vt,At)}catch{}if("get"in At||"set"in At)throw ut("Accessors not supported");return"value"in At&&(ct[vt]=At.value),ct}},(nt,at,ot)=>{var rt=ot(6),st=ot(7);nt.exports=rt&&st(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})},(nt,at,ot)=>{var rt=ot(20),st=String,lt=TypeError;nt.exports=function(et){if(rt(et))return et;throw lt(st(et)+" is not an object")}},(nt,at,ot)=>{var rt=ot(21),st=ot(45),lt=ot(49),et=ot(38);nt.exports=function(it,ut,ft,ht){ht||(ht={});var dt=ht.enumerable,gt=ht.name!==void 0?ht.name:ut;if(rt(ft)&<(ft,gt,ht),ht.global)dt?it[ut]=ft:et(ut,ft);else{try{ht.unsafe?it[ut]&&(dt=!0):delete it[ut]}catch{}dt?it[ut]=ft:st.f(it,ut,{value:ft,enumerable:!1,configurable:!ht.nonConfigurable,writable:!ht.nonWritable})}return it}},(nt,at,ot)=>{var rt=ot(14),st=ot(7),lt=ot(21),et=ot(39),it=ot(6),ut=ot(50).CONFIGURABLE,ft=ot(51),ht=ot(52),dt=ht.enforce,gt=ht.get,pt=String,mt=Object.defineProperty,ct=rt("".slice),vt=rt("".replace),At=rt([].join),xt=it&&!st(function(){return mt(function(){},"length",{value:8}).length!==8}),bt=String(String).split("String"),Et=nt.exports=function(St,Bt,Ot){ct(pt(Bt),0,7)==="Symbol("&&(Bt="["+vt(pt(Bt),/^Symbol\(([^)]*)\)/,"$1")+"]"),Ot&&Ot.getter&&(Bt="get "+Bt),Ot&&Ot.setter&&(Bt="set "+Bt),(!et(St,"name")||ut&&St.name!==Bt)&&(it?mt(St,"name",{value:Bt,configurable:!0}):St.name=Bt),xt&&Ot&&et(Ot,"arity")&&St.length!==Ot.arity&&mt(St,"length",{value:Ot.arity});try{Ot&&et(Ot,"constructor")&&Ot.constructor?it&&mt(St,"prototype",{writable:!1}):St.prototype&&(St.prototype=void 0)}catch{}var Pt=dt(St);return et(Pt,"source")||(Pt.source=At(bt,typeof Bt=="string"?Bt:"")),St};Function.prototype.toString=Et(function(){return lt(this)&>(this).source||ft(this)},"toString")},(nt,at,ot)=>{var rt=ot(6),st=ot(39),lt=Function.prototype,et=rt&&Object.getOwnPropertyDescriptor,it=st(lt,"name"),ut=it&&(function(){}).name==="something",ft=it&&(!rt||rt&&et(lt,"name").configurable);nt.exports={EXISTS:it,PROPER:ut,CONFIGURABLE:ft}},(nt,at,ot)=>{var rt=ot(14),st=ot(21),lt=ot(37),et=rt(Function.toString);st(lt.inspectSource)||(lt.inspectSource=function(it){return et(it)}),nt.exports=lt.inspectSource},(nt,at,ot)=>{var rt=ot(53),st=ot(4),lt=ot(20),et=ot(44),it=ot(39),ut=ot(37),ft=ot(54),ht=ot(55),dt="Object already initialized",gt=st.TypeError,pt=st.WeakMap,mt,ct,vt,At=function(St){return vt(St)?ct(St):mt(St,{})},xt=function(St){return function(Bt){var Ot;if(!lt(Bt)||(Ot=ct(Bt)).type!==St)throw gt("Incompatible receiver, "+St+" required");return Ot}};if(rt||ut.state){var bt=ut.state||(ut.state=new pt);bt.get=bt.get,bt.has=bt.has,bt.set=bt.set,mt=function(St,Bt){if(bt.has(St))throw gt(dt);return Bt.facade=St,bt.set(St,Bt),Bt},ct=function(St){return bt.get(St)||{}},vt=function(St){return bt.has(St)}}else{var Et=ft("state");ht[Et]=!0,mt=function(St,Bt){if(it(St,Et))throw gt(dt);return Bt.facade=St,et(St,Et,Bt),Bt},ct=function(St){return it(St,Et)?St[Et]:{}},vt=function(St){return it(St,Et)}}nt.exports={set:mt,get:ct,has:vt,enforce:At,getterFor:xt}},(nt,at,ot)=>{var rt=ot(4),st=ot(21),lt=rt.WeakMap;nt.exports=st(lt)&&/native code/.test(String(lt))},(nt,at,ot)=>{var rt=ot(35),st=ot(41),lt=rt("keys");nt.exports=function(et){return lt[et]||(lt[et]=st(et))}},nt=>{nt.exports={}},(nt,at,ot)=>{var rt=ot(39),st=ot(57),lt=ot(5),et=ot(45);nt.exports=function(it,ut,ft){for(var ht=st(ut),dt=et.f,gt=lt.f,pt=0;pt<ht.length;pt++){var mt=ht[pt];!rt(it,mt)&&!(ft&&rt(ft,mt))&&dt(it,mt,gt(ut,mt))}}},(nt,at,ot)=>{var rt=ot(24),st=ot(14),lt=ot(58),et=ot(67),it=ot(47),ut=st([].concat);nt.exports=rt("Reflect","ownKeys")||function(ht){var dt=lt.f(it(ht)),gt=et.f;return gt?ut(dt,gt(ht)):dt}},(nt,at,ot)=>{var rt=ot(59),st=ot(66),lt=st.concat("length","prototype");at.f=Object.getOwnPropertyNames||function(it){return rt(it,lt)}},(nt,at,ot)=>{var rt=ot(14),st=ot(39),lt=ot(12),et=ot(60).indexOf,it=ot(55),ut=rt([].push);nt.exports=function(ft,ht){var dt=lt(ft),gt=0,pt=[],mt;for(mt in dt)!st(it,mt)&&st(dt,mt)&&ut(pt,mt);for(;ht.length>gt;)st(dt,mt=ht[gt++])&&(~et(pt,mt)||ut(pt,mt));return pt}},(nt,at,ot)=>{var rt=ot(12),st=ot(61),lt=ot(64),et=function(it){return function(ut,ft,ht){var dt=rt(ut),gt=lt(dt),pt=st(ht,gt),mt;if(it&&ft!==ft){for(;gt>pt;)if(mt=dt[pt++],mt!==mt)return!0}else for(;gt>pt;pt++)if((it||pt in dt)&&dt[pt]===ft)return it||pt||0;return!it&&-1}};nt.exports={includes:et(!0),indexOf:et(!1)}},(nt,at,ot)=>{var rt=ot(62),st=Math.max,lt=Math.min;nt.exports=function(et,it){var ut=rt(et);return ut<0?st(ut+it,0):lt(ut,it)}},(nt,at,ot)=>{var rt=ot(63);nt.exports=function(st){var lt=+st;return lt!==lt||lt===0?0:rt(lt)}},nt=>{var at=Math.ceil,ot=Math.floor;nt.exports=Math.trunc||function(st){var lt=+st;return(lt>0?ot:at)(lt)}},(nt,at,ot)=>{var rt=ot(65);nt.exports=function(st){return rt(st.length)}},(nt,at,ot)=>{var rt=ot(62),st=Math.min;nt.exports=function(lt){return lt>0?st(rt(lt),9007199254740991):0}},nt=>{nt.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(nt,at)=>{at.f=Object.getOwnPropertySymbols},(nt,at,ot)=>{var rt=ot(7),st=ot(21),lt=/#|\.prototype\./,et=function(dt,gt){var pt=ut[it(dt)];return pt===ht?!0:pt===ft?!1:st(gt)?rt(gt):!!gt},it=et.normalize=function(dt){return String(dt).replace(lt,".").toLowerCase()},ut=et.data={},ft=et.NATIVE="N",ht=et.POLYFILL="P";nt.exports=et},(nt,at,ot)=>{var rt=ot(9),st=Function.prototype,lt=st.apply,et=st.call;nt.exports=typeof Reflect=="object"&&Reflect.apply||(rt?et.bind(lt):function(){return et.apply(lt,arguments)})},(nt,at,ot)=>{var rt=ot(24),st=ot(39),lt=ot(44),et=ot(25),it=ot(71),ut=ot(56),ft=ot(74),ht=ot(75),dt=ot(76),gt=ot(80),pt=ot(81),mt=ot(6),ct=ot(36);nt.exports=function(vt,At,xt,bt){var Et="stackTraceLimit",St=bt?2:1,Bt=vt.split("."),Ot=Bt[Bt.length-1],Pt=rt.apply(null,Bt);if(Pt){var wt=Pt.prototype;if(!ct&&st(wt,"cause")&&delete wt.cause,!xt)return Pt;var Ct=rt("Error"),It=At(function(yt,Rt){var kt=dt(bt?Rt:yt,void 0),jt=bt?new Pt(yt):new Pt;return kt!==void 0&<(jt,"message",kt),pt(jt,It,jt.stack,2),this&&et(wt,this)&&ht(jt,this,It),arguments.length>St&>(jt,arguments[St]),jt});if(It.prototype=wt,Ot!=="Error"?it?it(It,Ct):ut(It,Ct,{name:!0}):mt&&Et in Pt&&(ft(It,Pt,Et),ft(It,Pt,"prepareStackTrace")),ut(It,Pt),!ct)try{wt.name!==Ot&<(wt,"name",Ot),wt.constructor=It}catch{}return It}}},(nt,at,ot)=>{var rt=ot(72),st=ot(47),lt=ot(73);nt.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var et=!1,it={},ut;try{ut=rt(Object.prototype,"__proto__","set"),ut(it,[]),et=it instanceof Array}catch{}return function(ht,dt){return st(ht),lt(dt),et?ut(ht,dt):ht.__proto__=dt,ht}}():void 0)},(nt,at,ot)=>{var rt=ot(14),st=ot(31);nt.exports=function(lt,et,it){try{return rt(st(Object.getOwnPropertyDescriptor(lt,et)[it]))}catch{}}},(nt,at,ot)=>{var rt=ot(21),st=String,lt=TypeError;nt.exports=function(et){if(typeof et=="object"||rt(et))return et;throw lt("Can't set "+st(et)+" as a prototype")}},(nt,at,ot)=>{var rt=ot(45).f;nt.exports=function(st,lt,et){et in st||rt(st,et,{configurable:!0,get:function(){return lt[et]},set:function(it){lt[et]=it}})}},(nt,at,ot)=>{var rt=ot(21),st=ot(20),lt=ot(71);nt.exports=function(et,it,ut){var ft,ht;return lt&&rt(ft=it.constructor)&&ft!==ut&&st(ht=ft.prototype)&&ht!==ut.prototype&<(et,ht),et}},(nt,at,ot)=>{var rt=ot(77);nt.exports=function(st,lt){return st===void 0?arguments.length<2?"":lt:rt(st)}},(nt,at,ot)=>{var rt=ot(78),st=String;nt.exports=function(lt){if(rt(lt)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return st(lt)}},(nt,at,ot)=>{var rt=ot(79),st=ot(21),lt=ot(15),et=ot(34),it=et("toStringTag"),ut=Object,ft=lt(function(){return arguments}())==="Arguments",ht=function(dt,gt){try{return dt[gt]}catch{}};nt.exports=rt?lt:function(dt){var gt,pt,mt;return dt===void 0?"Undefined":dt===null?"Null":typeof(pt=ht(gt=ut(dt),it))=="string"?pt:ft?lt(gt):(mt=lt(gt))==="Object"&&st(gt.callee)?"Arguments":mt}},(nt,at,ot)=>{var rt=ot(34),st=rt("toStringTag"),lt={};lt[st]="z",nt.exports=String(lt)==="[object z]"},(nt,at,ot)=>{var rt=ot(20),st=ot(44);nt.exports=function(lt,et){rt(et)&&"cause"in et&&st(lt,"cause",et.cause)}},(nt,at,ot)=>{var rt=ot(44),st=ot(82),lt=ot(83),et=Error.captureStackTrace;nt.exports=function(it,ut,ft,ht){lt&&(et?et(it,ut):rt(it,"stack",st(ft,ht)))}},(nt,at,ot)=>{var rt=ot(14),st=Error,lt=rt("".replace),et=function(ft){return String(st(ft).stack)}("zxcasd"),it=/\n\s*at [^:]*:[^\n]*/,ut=it.test(et);nt.exports=function(ft,ht){if(ut&&typeof ft=="string"&&!st.prepareStackTrace)for(;ht--;)ft=lt(ft,it,"");return ft}},(nt,at,ot)=>{var rt=ot(7),st=ot(11);nt.exports=!rt(function(){var lt=Error("a");return"stack"in lt?(Object.defineProperty(lt,"stack",st(1,7)),lt.stack!==7):!0})},(nt,at,ot)=>{var rt=ot(85),st=ot(90).findLast,lt=rt.aTypedArray,et=rt.exportTypedArrayMethod;et("findLast",function(ut){return st(lt(this),ut,arguments.length>1?arguments[1]:void 0)})},(nt,at,ot)=>{var rt=ot(86),st=ot(6),lt=ot(4),et=ot(21),it=ot(20),ut=ot(39),ft=ot(78),ht=ot(32),dt=ot(44),gt=ot(48),pt=ot(87),mt=ot(25),ct=ot(88),vt=ot(71),At=ot(34),xt=ot(41),bt=ot(52),Et=bt.enforce,St=bt.get,Bt=lt.Int8Array,Ot=Bt&&Bt.prototype,Pt=lt.Uint8ClampedArray,wt=Pt&&Pt.prototype,Ct=Bt&&ct(Bt),It=Ot&&ct(Ot),yt=Object.prototype,Rt=lt.TypeError,kt=At("toStringTag"),jt=xt("TYPED_ARRAY_TAG"),Ht="TypedArrayConstructor",Ft=rt&&!!vt&&ft(lt.opera)!=="Opera",_t=!1,Nt,Mt,Lt,$t={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Tt={BigInt64Array:8,BigUint64Array:8},Dt=function(rr){if(!it(rr))return!1;var Yt=ft(rr);return Yt==="DataView"||ut($t,Yt)||ut(Tt,Yt)},Ut=function(Jt){var rr=ct(Jt);if(it(rr)){var Yt=St(rr);return Yt&&ut(Yt,Ht)?Yt[Ht]:Ut(rr)}},Vt=function(Jt){if(!it(Jt))return!1;var rr=ft(Jt);return ut($t,rr)||ut(Tt,rr)},Qt=function(Jt){if(Vt(Jt))return Jt;throw Rt("Target is not a typed array")},qt=function(Jt){if(et(Jt)&&(!vt||mt(Ct,Jt)))return Jt;throw Rt(ht(Jt)+" is not a typed array constructor")},Zt=function(Jt,rr,Yt,Kt){if(st){if(Yt)for(var nr in $t){var tr=lt[nr];if(tr&&ut(tr.prototype,Jt))try{delete tr.prototype[Jt]}catch{try{tr.prototype[Jt]=rr}catch{}}}(!It[Jt]||Yt)&>(It,Jt,Yt?rr:Ft&&Ot[Jt]||rr,Kt)}},ar=function(Jt,rr,Yt){var Kt,nr;if(st){if(vt){if(Yt){for(Kt in $t)if(nr=lt[Kt],nr&&ut(nr,Jt))try{delete nr[Jt]}catch{}}if(!Ct[Jt]||Yt)try{return gt(Ct,Jt,Yt?rr:Ft&&Ct[Jt]||rr)}catch{}else return}for(Kt in $t)nr=lt[Kt],nr&&(!nr[Jt]||Yt)&>(nr,Jt,rr)}};for(Nt in $t)Mt=lt[Nt],Lt=Mt&&Mt.prototype,Lt?Et(Lt)[Ht]=Mt:Ft=!1;for(Nt in Tt)Mt=lt[Nt],Lt=Mt&&Mt.prototype,Lt&&(Et(Lt)[Ht]=Mt);if((!Ft||!et(Ct)||Ct===Function.prototype)&&(Ct=function(){throw Rt("Incorrect invocation")},Ft))for(Nt in $t)lt[Nt]&&vt(lt[Nt],Ct);if((!Ft||!It||It===yt)&&(It=Ct.prototype,Ft))for(Nt in $t)lt[Nt]&&vt(lt[Nt].prototype,It);if(Ft&&ct(wt)!==It&&vt(wt,It),st&&!ut(It,kt)){_t=!0,pt(It,kt,{configurable:!0,get:function(){return it(this)?this[jt]:void 0}});for(Nt in $t)lt[Nt]&&dt(lt[Nt],jt,Nt)}nt.exports={NATIVE_ARRAY_BUFFER_VIEWS:Ft,TYPED_ARRAY_TAG:_t&&jt,aTypedArray:Qt,aTypedArrayConstructor:qt,exportTypedArrayMethod:Zt,exportTypedArrayStaticMethod:ar,getTypedArrayConstructor:Ut,isView:Dt,isTypedArray:Vt,TypedArray:Ct,TypedArrayPrototype:It}},nt=>{nt.exports=typeof ArrayBuffer<"u"&&typeof DataView<"u"},(nt,at,ot)=>{var rt=ot(49),st=ot(45);nt.exports=function(lt,et,it){return it.get&&rt(it.get,et,{getter:!0}),it.set&&rt(it.set,et,{setter:!0}),st.f(lt,et,it)}},(nt,at,ot)=>{var rt=ot(39),st=ot(21),lt=ot(40),et=ot(54),it=ot(89),ut=et("IE_PROTO"),ft=Object,ht=ft.prototype;nt.exports=it?ft.getPrototypeOf:function(dt){var gt=lt(dt);if(rt(gt,ut))return gt[ut];var pt=gt.constructor;return st(pt)&> instanceof pt?pt.prototype:gt instanceof ft?ht:null}},(nt,at,ot)=>{var rt=ot(7);nt.exports=!rt(function(){function st(){}return st.prototype.constructor=null,Object.getPrototypeOf(new st)!==st.prototype})},(nt,at,ot)=>{var rt=ot(91),st=ot(13),lt=ot(40),et=ot(64),it=function(ut){var ft=ut===1;return function(ht,dt,gt){for(var pt=lt(ht),mt=st(pt),ct=rt(dt,gt),vt=et(mt),At,xt;vt-- >0;)if(At=mt[vt],xt=ct(At,vt,pt),xt)switch(ut){case 0:return At;case 1:return vt}return ft?-1:void 0}};nt.exports={findLast:it(0),findLastIndex:it(1)}},(nt,at,ot)=>{var rt=ot(92),st=ot(31),lt=ot(9),et=rt(rt.bind);nt.exports=function(it,ut){return st(it),ut===void 0?it:lt?et(it,ut):function(){return it.apply(ut,arguments)}}},(nt,at,ot)=>{var rt=ot(15),st=ot(14);nt.exports=function(lt){if(rt(lt)==="Function")return st(lt)}},(nt,at,ot)=>{var rt=ot(85),st=ot(90).findLastIndex,lt=rt.aTypedArray,et=rt.exportTypedArrayMethod;et("findLastIndex",function(ut){return st(lt(this),ut,arguments.length>1?arguments[1]:void 0)})},(nt,at,ot)=>{var rt=ot(4),st=ot(8),lt=ot(85),et=ot(64),it=ot(95),ut=ot(40),ft=ot(7),ht=rt.RangeError,dt=rt.Int8Array,gt=dt&&dt.prototype,pt=gt&>.set,mt=lt.aTypedArray,ct=lt.exportTypedArrayMethod,vt=!ft(function(){var xt=new Uint8ClampedArray(2);return st(pt,xt,{length:1,0:3},1),xt[1]!==3}),At=vt&<.NATIVE_ARRAY_BUFFER_VIEWS&&ft(function(){var xt=new dt(2);return xt.set(1),xt.set("2",1),xt[0]!==0||xt[1]!==2});ct("set",function(bt){mt(this);var Et=it(arguments.length>1?arguments[1]:void 0,1),St=ut(bt);if(vt)return st(pt,this,St,Et);var Bt=this.length,Ot=et(St),Pt=0;if(Ot+Et>Bt)throw ht("Wrong length");for(;Pt<Ot;)this[Et+Pt]=St[Pt++]},!vt||At)},(nt,at,ot)=>{var rt=ot(96),st=RangeError;nt.exports=function(lt,et){var it=rt(lt);if(it%et)throw st("Wrong offset");return it}},(nt,at,ot)=>{var rt=ot(62),st=RangeError;nt.exports=function(lt){var et=rt(lt);if(et<0)throw st("The argument can't be less than 0");return et}},(nt,at,ot)=>{var rt=ot(98),st=ot(85),lt=st.aTypedArray,et=st.exportTypedArrayMethod,it=st.getTypedArrayConstructor;et("toReversed",function(){return rt(lt(this),it(this))})},(nt,at,ot)=>{var rt=ot(64);nt.exports=function(st,lt){for(var et=rt(st),it=new lt(et),ut=0;ut<et;ut++)it[ut]=st[et-ut-1];return it}},(nt,at,ot)=>{var rt=ot(85),st=ot(14),lt=ot(31),et=ot(100),it=rt.aTypedArray,ut=rt.getTypedArrayConstructor,ft=rt.exportTypedArrayMethod,ht=st(rt.TypedArrayPrototype.sort);ft("toSorted",function(gt){gt!==void 0&<(gt);var pt=it(this),mt=et(ut(pt),pt);return ht(mt,gt)})},(nt,at,ot)=>{var rt=ot(64);nt.exports=function(st,lt){for(var et=0,it=rt(lt),ut=new st(it);it>et;)ut[et]=lt[et++];return ut}},(nt,at,ot)=>{var rt=ot(102),st=ot(85),lt=ot(103),et=ot(62),it=ot(104),ut=st.aTypedArray,ft=st.getTypedArrayConstructor,ht=st.exportTypedArrayMethod,dt=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(gt){return gt===8}}();ht("with",function(gt,pt){var mt=ut(this),ct=et(gt),vt=lt(mt)?it(pt):+pt;return rt(mt,ft(mt),ct,vt)},!dt)},(nt,at,ot)=>{var rt=ot(64),st=ot(62),lt=RangeError;nt.exports=function(et,it,ut,ft){var ht=rt(et),dt=st(ut),gt=dt<0?ht+dt:dt;if(gt>=ht||gt<0)throw lt("Incorrect index");for(var pt=new it(ht),mt=0;mt<ht;mt++)pt[mt]=mt===gt?ft:et[mt];return pt}},(nt,at,ot)=>{var rt=ot(78);nt.exports=function(st){var lt=rt(st);return lt==="BigInt64Array"||lt==="BigUint64Array"}},(nt,at,ot)=>{var rt=ot(19),st=TypeError;nt.exports=function(lt){var et=rt(lt,"number");if(typeof et=="number")throw st("Can't convert number to bigint");return BigInt(et)}},(nt,at,ot)=>{var rt=ot(6),st=ot(87),lt=ot(106),et=ArrayBuffer.prototype;rt&&!("detached"in et)&&st(et,"detached",{configurable:!0,get:function(){return lt(this)}})},(nt,at,ot)=>{var rt=ot(14),st=ot(107),lt=rt(ArrayBuffer.prototype.slice);nt.exports=function(et){if(st(et)!==0)return!1;try{return lt(et,0,0),!1}catch{return!0}}},(nt,at,ot)=>{var rt=ot(72),st=ot(15),lt=TypeError;nt.exports=rt(ArrayBuffer.prototype,"byteLength","get")||function(et){if(st(et)!=="ArrayBuffer")throw lt("ArrayBuffer expected");return et.byteLength}},(nt,at,ot)=>{var rt=ot(3),st=ot(109);st&&rt({target:"ArrayBuffer",proto:!0},{transfer:function(){return st(this,arguments.length?arguments[0]:void 0,!0)}})},(nt,at,ot)=>{var rt=ot(4),st=ot(14),lt=ot(72),et=ot(110),it=ot(106),ut=ot(107),ft=ot(111),ht=rt.TypeError,dt=rt.structuredClone,gt=rt.ArrayBuffer,pt=rt.DataView,mt=Math.min,ct=gt.prototype,vt=pt.prototype,At=st(ct.slice),xt=lt(ct,"resizable","get"),bt=lt(ct,"maxByteLength","get"),Et=st(vt.getInt8),St=st(vt.setInt8);nt.exports=ft&&function(Bt,Ot,Pt){var wt=ut(Bt),Ct=Ot===void 0?wt:et(Ot),It=!xt||!xt(Bt);if(it(Bt))throw ht("ArrayBuffer is detached");var yt=dt(Bt,{transfer:[Bt]});if(wt===Ct&&(Pt||It))return yt;if(wt>=Ct&&(!Pt||It))return At(yt,0,Ct);for(var Rt=Pt&&!It&&bt?{maxByteLength:bt(yt)}:void 0,kt=new gt(Ct,Rt),jt=new pt(yt),Ht=new pt(kt),Ft=mt(Ct,wt),_t=0;_t<Ft;_t++)St(Ht,_t,Et(jt,_t));return kt}},(nt,at,ot)=>{var rt=ot(62),st=ot(65),lt=RangeError;nt.exports=function(et){if(et===void 0)return 0;var it=rt(et),ut=st(it);if(it!==ut)throw lt("Wrong length or index");return ut}},(nt,at,ot)=>{var rt=ot(4),st=ot(7),lt=ot(28),et=ot(112),it=ot(113),ut=ot(114),ft=rt.structuredClone;nt.exports=!!ft&&!st(function(){if(it&<>92||ut&<>94||et&<>97)return!1;var ht=new ArrayBuffer(8),dt=ft(ht,{transfer:[ht]});return ht.byteLength!==0||dt.byteLength!==8})},(nt,at,ot)=>{var rt=ot(113),st=ot(114);nt.exports=!rt&&!st&&typeof window=="object"&&typeof document=="object"},nt=>{nt.exports=typeof Deno=="object"&&Deno&&typeof Deno.version=="object"},(nt,at,ot)=>{var rt=ot(4),st=ot(15);nt.exports=st(rt.process)==="process"},(nt,at,ot)=>{var rt=ot(3),st=ot(109);st&&rt({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return st(this,arguments.length?arguments[0]:void 0,!1)}})},(nt,at,ot)=>{var rt=ot(3),st=ot(117),lt=ot(126);rt({target:"Set",proto:!0,real:!0,forced:!lt("difference")},{difference:st})},(nt,at,ot)=>{var rt=ot(118),st=ot(119),lt=ot(120),et=ot(123),it=ot(124),ut=ot(121),ft=ot(122),ht=st.has,dt=st.remove;nt.exports=function(pt){var mt=rt(this),ct=it(pt),vt=lt(mt);return et(mt)<=ct.size?ut(mt,function(At){ct.includes(At)&&dt(vt,At)}):ft(ct.getIterator(),function(At){ht(mt,At)&&dt(vt,At)}),vt}},(nt,at,ot)=>{var rt=ot(119).has;nt.exports=function(st){return rt(st),st}},(nt,at,ot)=>{var rt=ot(14),st=Set.prototype;nt.exports={Set,add:rt(st.add),has:rt(st.has),remove:rt(st.delete),proto:st}},(nt,at,ot)=>{var rt=ot(119),st=ot(121),lt=rt.Set,et=rt.add;nt.exports=function(it){var ut=new lt;return st(it,function(ft){et(ut,ft)}),ut}},(nt,at,ot)=>{var rt=ot(14),st=ot(122),lt=ot(119),et=lt.Set,it=lt.proto,ut=rt(it.forEach),ft=rt(it.keys),ht=ft(new et).next;nt.exports=function(dt,gt,pt){return pt?st({iterator:ft(dt),next:ht},gt):ut(dt,gt)}},(nt,at,ot)=>{var rt=ot(8);nt.exports=function(st,lt,et){for(var it=et?st:st.iterator,ut=st.next,ft,ht;!(ft=rt(ut,it)).done;)if(ht=lt(ft.value),ht!==void 0)return ht}},(nt,at,ot)=>{var rt=ot(72),st=ot(119);nt.exports=rt(st.proto,"size","get")||function(lt){return lt.size}},(nt,at,ot)=>{var rt=ot(31),st=ot(47),lt=ot(8),et=ot(62),it=ot(125),ut="Invalid size",ft=RangeError,ht=TypeError,dt=Math.max,gt=function(pt,mt,ct,vt){this.set=pt,this.size=mt,this.has=ct,this.keys=vt};gt.prototype={getIterator:function(){return it(st(lt(this.keys,this.set)))},includes:function(pt){return lt(this.has,this.set,pt)}},nt.exports=function(pt){st(pt);var mt=+pt.size;if(mt!==mt)throw ht(ut);var ct=et(mt);if(ct<0)throw ft(ut);return new gt(pt,dt(ct,0),rt(pt.has),rt(pt.keys))}},nt=>{nt.exports=function(at){return{iterator:at,next:at.next,done:!1}}},(nt,at,ot)=>{var rt=ot(24),st=function(lt){return{size:lt,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};nt.exports=function(lt){var et=rt("Set");try{new et()[lt](st(0));try{return new et()[lt](st(-1)),!1}catch{return!0}}catch{return!1}}},(nt,at,ot)=>{var rt=ot(3),st=ot(7),lt=ot(128),et=ot(126),it=!et("intersection")||st(function(){return Array.from(new Set([1,2,3]).intersection(new Set([3,2])))!=="3,2"});rt({target:"Set",proto:!0,real:!0,forced:it},{intersection:lt})},(nt,at,ot)=>{var rt=ot(118),st=ot(119),lt=ot(123),et=ot(124),it=ot(121),ut=ot(122),ft=st.Set,ht=st.add,dt=st.has;nt.exports=function(pt){var mt=rt(this),ct=et(pt),vt=new ft;return lt(mt)>ct.size?ut(ct.getIterator(),function(At){dt(mt,At)&&ht(vt,At)}):it(mt,function(At){ct.includes(At)&&ht(vt,At)}),vt}},(nt,at,ot)=>{var rt=ot(3),st=ot(130),lt=ot(126);rt({target:"Set",proto:!0,real:!0,forced:!lt("isDisjointFrom")},{isDisjointFrom:st})},(nt,at,ot)=>{var rt=ot(118),st=ot(119).has,lt=ot(123),et=ot(124),it=ot(121),ut=ot(122),ft=ot(131);nt.exports=function(dt){var gt=rt(this),pt=et(dt);if(lt(gt)<=pt.size)return it(gt,function(ct){if(pt.includes(ct))return!1},!0)!==!1;var mt=pt.getIterator();return ut(mt,function(ct){if(st(gt,ct))return ft(mt,"normal",!1)})!==!1}},(nt,at,ot)=>{var rt=ot(8),st=ot(47),lt=ot(30);nt.exports=function(et,it,ut){var ft,ht;st(et);try{if(ft=lt(et,"return"),!ft){if(it==="throw")throw ut;return ut}ft=rt(ft,et)}catch(dt){ht=!0,ft=dt}if(it==="throw")throw ut;if(ht)throw ft;return st(ft),ut}},(nt,at,ot)=>{var rt=ot(3),st=ot(133),lt=ot(126);rt({target:"Set",proto:!0,real:!0,forced:!lt("isSubsetOf")},{isSubsetOf:st})},(nt,at,ot)=>{var rt=ot(118),st=ot(123),lt=ot(121),et=ot(124);nt.exports=function(ut){var ft=rt(this),ht=et(ut);return st(ft)>ht.size?!1:lt(ft,function(dt){if(!ht.includes(dt))return!1},!0)!==!1}},(nt,at,ot)=>{var rt=ot(3),st=ot(135),lt=ot(126);rt({target:"Set",proto:!0,real:!0,forced:!lt("isSupersetOf")},{isSupersetOf:st})},(nt,at,ot)=>{var rt=ot(118),st=ot(119).has,lt=ot(123),et=ot(124),it=ot(122),ut=ot(131);nt.exports=function(ht){var dt=rt(this),gt=et(ht);if(lt(dt)<gt.size)return!1;var pt=gt.getIterator();return it(pt,function(mt){if(!st(dt,mt))return ut(pt,"normal",!1)})!==!1}},(nt,at,ot)=>{var rt=ot(3),st=ot(137),lt=ot(126);rt({target:"Set",proto:!0,real:!0,forced:!lt("symmetricDifference")},{symmetricDifference:st})},(nt,at,ot)=>{var rt=ot(118),st=ot(119),lt=ot(120),et=ot(124),it=ot(122),ut=st.add,ft=st.has,ht=st.remove;nt.exports=function(gt){var pt=rt(this),mt=et(gt).getIterator(),ct=lt(pt);return it(mt,function(vt){ft(pt,vt)?ht(ct,vt):ut(ct,vt)}),ct}},(nt,at,ot)=>{var rt=ot(3),st=ot(139),lt=ot(126);rt({target:"Set",proto:!0,real:!0,forced:!lt("union")},{union:st})},(nt,at,ot)=>{var rt=ot(118),st=ot(119).add,lt=ot(120),et=ot(124),it=ot(122);nt.exports=function(ft){var ht=rt(this),dt=et(ft).getIterator(),gt=lt(ht);return it(dt,function(pt){st(gt,pt)}),gt}},(nt,at,ot)=>{var rt=ot(3),st=ot(40),lt=ot(64),et=ot(141),it=ot(143),ut=ot(7),ft=ut(function(){return[].push.call({length:4294967296},1)!==4294967297}),ht=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(gt){return gt instanceof TypeError}},dt=ft||!ht();rt({target:"Array",proto:!0,arity:1,forced:dt},{push:function(pt){var mt=st(this),ct=lt(mt),vt=arguments.length;it(ct+vt);for(var At=0;At<vt;At++)mt[ct]=arguments[At],ct++;return et(mt,ct),ct}})},(nt,at,ot)=>{var rt=ot(6),st=ot(142),lt=TypeError,et=Object.getOwnPropertyDescriptor,it=rt&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(ut){return ut instanceof TypeError}}();nt.exports=it?function(ut,ft){if(st(ut)&&!et(ut,"length").writable)throw lt("Cannot set read only .length");return ut.length=ft}:function(ut,ft){return ut.length=ft}},(nt,at,ot)=>{var rt=ot(15);nt.exports=Array.isArray||function(lt){return rt(lt)==="Array"}},nt=>{var at=TypeError,ot=9007199254740991;nt.exports=function(rt){if(rt>ot)throw at("Maximum allowed index exceeded");return rt}},(nt,at,ot)=>{var rt=ot(3),st=ot(4),lt=ot(87),et=ot(6),it=TypeError,ut=Object.defineProperty,ft=st.self!==st;try{if(et){var ht=Object.getOwnPropertyDescriptor(st,"self");(ft||!ht||!ht.get||!ht.enumerable)&<(st,"self",{get:function(){return st},set:function(gt){if(this!==st)throw it("Illegal invocation");ut(st,"self",{value:gt,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}else rt({global:!0,simple:!0,forced:ft},{self:st})}catch{}},(nt,at,ot)=>{var Ir;Object.defineProperty(at,"__esModule",{value:!0}),at.VerbosityLevel=at.Util=at.UnknownErrorException=at.UnexpectedResponseException=at.TextRenderingMode=at.RenderingIntentFlag=at.PromiseCapability=at.PermissionFlag=at.PasswordResponses=at.PasswordException=at.PageActionEventType=at.OPS=at.MissingPDFException=at.MAX_IMAGE_SIZE_TO_CACHE=at.LINE_FACTOR=at.LINE_DESCENT_FACTOR=at.InvalidPDFException=at.ImageKind=at.IDENTITY_MATRIX=at.FormatError=at.FeatureTest=at.FONT_IDENTITY_MATRIX=at.DocumentActionEventType=at.CMapCompressionType=at.BaseException=at.BASELINE_FACTOR=at.AnnotationType=at.AnnotationReplyType=at.AnnotationPrefix=at.AnnotationMode=at.AnnotationFlag=at.AnnotationFieldFlag=at.AnnotationEditorType=at.AnnotationEditorPrefix=at.AnnotationEditorParamsType=at.AnnotationBorderStyleType=at.AnnotationActionEventType=at.AbortException=void 0,at.assert=Mt,at.bytesToString=rr,at.createValidAbsoluteUrl=$t,at.getModificationDate=yr,at.getUuid=Sr,at.getVerbosityLevel=Ht,at.info=Ft,at.isArrayBuffer=ur,at.isArrayEqual=pr,at.isNodeJS=void 0,at.normalizeUnicode=Ar,at.objectFromMap=tr,at.objectSize=nr,at.setVerbosityLevel=jt,at.shadow=Tt,at.string32=Kt,at.stringToBytes=Yt,at.stringToPDFString=Wt,at.stringToUTF8String=er,at.unreachable=Nt,at.utf8StringToString=lr,at.warn=_t,ot(2),ot(146),ot(148),ot(149),ot(140),ot(84),ot(93),ot(94),ot(97),ot(99),ot(101),ot(105),ot(108),ot(115);const rt=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");at.isNodeJS=rt;const st=[1,0,0,1,0,0];at.IDENTITY_MATRIX=st;const lt=[.001,0,0,.001,0,0];at.FONT_IDENTITY_MATRIX=lt;const et=1e7;at.MAX_IMAGE_SIZE_TO_CACHE=et;const it=1.35;at.LINE_FACTOR=it;const ut=.35;at.LINE_DESCENT_FACTOR=ut;const ft=ut/it;at.BASELINE_FACTOR=ft;const ht={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};at.RenderingIntentFlag=ht;const dt={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};at.AnnotationMode=dt;const gt="pdfjs_internal_editor_";at.AnnotationEditorPrefix=gt;const pt={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15};at.AnnotationEditorType=pt;const mt={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23};at.AnnotationEditorParamsType=mt;const ct={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};at.PermissionFlag=ct;const vt={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};at.TextRenderingMode=vt;const At={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};at.ImageKind=At;const xt={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};at.AnnotationType=xt;const bt={GROUP:"Group",REPLY:"R"};at.AnnotationReplyType=bt;const Et={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};at.AnnotationFlag=Et;const St={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};at.AnnotationFieldFlag=St;const Bt={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};at.AnnotationBorderStyleType=Bt;const Ot={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};at.AnnotationActionEventType=Ot;const Pt={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};at.DocumentActionEventType=Pt;const wt={O:"PageOpen",C:"PageClose"};at.PageActionEventType=wt;const Ct={ERRORS:0,WARNINGS:1,INFOS:5};at.VerbosityLevel=Ct;const It={NONE:0,BINARY:1};at.CMapCompressionType=It;const yt={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};at.OPS=yt;const Rt={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};at.PasswordResponses=Rt;let kt=Ct.WARNINGS;function jt(hr){Number.isInteger(hr)&&(kt=hr)}function Ht(){return kt}function Ft(hr){kt>=Ct.INFOS&&console.log(`Info: ${hr}`)}function _t(hr){kt>=Ct.WARNINGS&&console.log(`Warning: ${hr}`)}function Nt(hr){throw new Error(hr)}function Mt(hr,vr){hr||Nt(vr)}function Lt(hr){switch(hr==null?void 0:hr.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function $t(hr){let vr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,xr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!hr)return null;try{if(xr&&typeof hr=="string"){if(xr.addDefaultProtocol&&hr.startsWith("www.")){const Rr=hr.match(/\./g);(Rr==null?void 0:Rr.length)>=2&&(hr=`http://${hr}`)}if(xr.tryConvertEncoding)try{hr=er(hr)}catch{}}const Pr=vr?new URL(hr,vr):new URL(hr);if(Lt(Pr))return Pr}catch{}return null}function Tt(hr,vr,xr){let Pr=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return Object.defineProperty(hr,vr,{value:xr,enumerable:!Pr,configurable:!0,writable:!1}),xr}const Dt=function(){function vr(xr,Pr){this.constructor===vr&&Nt("Cannot initialize BaseException."),this.message=xr,this.name=Pr}return vr.prototype=new Error,vr.constructor=vr,vr}();at.BaseException=Dt;class Ut extends Dt{constructor(vr,xr){super(vr,"PasswordException"),this.code=xr}}at.PasswordException=Ut;class Vt extends Dt{constructor(vr,xr){super(vr,"UnknownErrorException"),this.details=xr}}at.UnknownErrorException=Vt;class Qt extends Dt{constructor(vr){super(vr,"InvalidPDFException")}}at.InvalidPDFException=Qt;class qt extends Dt{constructor(vr){super(vr,"MissingPDFException")}}at.MissingPDFException=qt;class Zt extends Dt{constructor(vr,xr){super(vr,"UnexpectedResponseException"),this.status=xr}}at.UnexpectedResponseException=Zt;class ar extends Dt{constructor(vr){super(vr,"FormatError")}}at.FormatError=ar;class Jt extends Dt{constructor(vr){super(vr,"AbortException")}}at.AbortException=Jt;function rr(hr){(typeof hr!="object"||(hr==null?void 0:hr.length)===void 0)&&Nt("Invalid argument for bytesToString");const vr=hr.length,xr=8192;if(vr<xr)return String.fromCharCode.apply(null,hr);const Pr=[];for(let Rr=0;Rr<vr;Rr+=xr){const Dr=Math.min(Rr+xr,vr),Gr=hr.subarray(Rr,Dr);Pr.push(String.fromCharCode.apply(null,Gr))}return Pr.join("")}function Yt(hr){typeof hr!="string"&&Nt("Invalid argument for stringToBytes");const vr=hr.length,xr=new Uint8Array(vr);for(let Pr=0;Pr<vr;++Pr)xr[Pr]=hr.charCodeAt(Pr)&255;return xr}function Kt(hr){return String.fromCharCode(hr>>24&255,hr>>16&255,hr>>8&255,hr&255)}function nr(hr){return Object.keys(hr).length}function tr(hr){const vr=Object.create(null);for(const[xr,Pr]of hr)vr[xr]=Pr;return vr}function ir(){const hr=new Uint8Array(4);return hr[0]=1,new Uint32Array(hr.buffer,0,1)[0]===1}function sr(){try{return new Function(""),!0}catch{return!1}}class cr{static get isLittleEndian(){return Tt(this,"isLittleEndian",ir())}static get isEvalSupported(){return Tt(this,"isEvalSupported",sr())}static get isOffscreenCanvasSupported(){return Tt(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator>"u"?Tt(this,"platform",{isWin:!1,isMac:!1}):Tt(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}static get isCSSRoundSupported(){var vr,xr;return Tt(this,"isCSSRoundSupported",(xr=(vr=globalThis.CSS)==null?void 0:vr.supports)==null?void 0:xr.call(vr,"width: round(1.5px, 1px)"))}}at.FeatureTest=cr;const or=[...Array(256).keys()].map(hr=>hr.toString(16).padStart(2,"0"));class Xt{static makeHexColor(vr,xr,Pr){return`#${or[vr]}${or[xr]}${or[Pr]}`}static scaleMinMax(vr,xr){let Pr;vr[0]?(vr[0]<0&&(Pr=xr[0],xr[0]=xr[1],xr[1]=Pr),xr[0]*=vr[0],xr[1]*=vr[0],vr[3]<0&&(Pr=xr[2],xr[2]=xr[3],xr[3]=Pr),xr[2]*=vr[3],xr[3]*=vr[3]):(Pr=xr[0],xr[0]=xr[2],xr[2]=Pr,Pr=xr[1],xr[1]=xr[3],xr[3]=Pr,vr[1]<0&&(Pr=xr[2],xr[2]=xr[3],xr[3]=Pr),xr[2]*=vr[1],xr[3]*=vr[1],vr[2]<0&&(Pr=xr[0],xr[0]=xr[1],xr[1]=Pr),xr[0]*=vr[2],xr[1]*=vr[2]),xr[0]+=vr[4],xr[1]+=vr[4],xr[2]+=vr[5],xr[3]+=vr[5]}static transform(vr,xr){return[vr[0]*xr[0]+vr[2]*xr[1],vr[1]*xr[0]+vr[3]*xr[1],vr[0]*xr[2]+vr[2]*xr[3],vr[1]*xr[2]+vr[3]*xr[3],vr[0]*xr[4]+vr[2]*xr[5]+vr[4],vr[1]*xr[4]+vr[3]*xr[5]+vr[5]]}static applyTransform(vr,xr){const Pr=vr[0]*xr[0]+vr[1]*xr[2]+xr[4],Rr=vr[0]*xr[1]+vr[1]*xr[3]+xr[5];return[Pr,Rr]}static applyInverseTransform(vr,xr){const Pr=xr[0]*xr[3]-xr[1]*xr[2],Rr=(vr[0]*xr[3]-vr[1]*xr[2]+xr[2]*xr[5]-xr[4]*xr[3])/Pr,Dr=(-vr[0]*xr[1]+vr[1]*xr[0]+xr[4]*xr[1]-xr[5]*xr[0])/Pr;return[Rr,Dr]}static getAxialAlignedBoundingBox(vr,xr){const Pr=this.applyTransform(vr,xr),Rr=this.applyTransform(vr.slice(2,4),xr),Dr=this.applyTransform([vr[0],vr[3]],xr),Gr=this.applyTransform([vr[2],vr[1]],xr);return[Math.min(Pr[0],Rr[0],Dr[0],Gr[0]),Math.min(Pr[1],Rr[1],Dr[1],Gr[1]),Math.max(Pr[0],Rr[0],Dr[0],Gr[0]),Math.max(Pr[1],Rr[1],Dr[1],Gr[1])]}static inverseTransform(vr){const xr=vr[0]*vr[3]-vr[1]*vr[2];return[vr[3]/xr,-vr[1]/xr,-vr[2]/xr,vr[0]/xr,(vr[2]*vr[5]-vr[4]*vr[3])/xr,(vr[4]*vr[1]-vr[5]*vr[0])/xr]}static singularValueDecompose2dScale(vr){const xr=[vr[0],vr[2],vr[1],vr[3]],Pr=vr[0]*xr[0]+vr[1]*xr[2],Rr=vr[0]*xr[1]+vr[1]*xr[3],Dr=vr[2]*xr[0]+vr[3]*xr[2],Gr=vr[2]*xr[1]+vr[3]*xr[3],Or=(Pr+Gr)/2,Hr=Math.sqrt((Pr+Gr)**2-4*(Pr*Gr-Dr*Rr))/2,jr=Or+Hr||1,Tr=Or-Hr||1;return[Math.sqrt(jr),Math.sqrt(Tr)]}static normalizeRect(vr){const xr=vr.slice(0);return vr[0]>vr[2]&&(xr[0]=vr[2],xr[2]=vr[0]),vr[1]>vr[3]&&(xr[1]=vr[3],xr[3]=vr[1]),xr}static intersect(vr,xr){const Pr=Math.max(Math.min(vr[0],vr[2]),Math.min(xr[0],xr[2])),Rr=Math.min(Math.max(vr[0],vr[2]),Math.max(xr[0],xr[2]));if(Pr>Rr)return null;const Dr=Math.max(Math.min(vr[1],vr[3]),Math.min(xr[1],xr[3])),Gr=Math.min(Math.max(vr[1],vr[3]),Math.max(xr[1],xr[3]));return Dr>Gr?null:[Pr,Dr,Rr,Gr]}static bezierBoundingBox(vr,xr,Pr,Rr,Dr,Gr,Or,Hr){const jr=[],Tr=[[],[]];let fr,Cr,$r,wr,Mr,Fr,Qr,Yr;for(let zr=0;zr<2;++zr){if(zr===0?(Cr=6*vr-12*Pr+6*Dr,fr=-3*vr+9*Pr-9*Dr+3*Or,$r=3*Pr-3*vr):(Cr=6*xr-12*Rr+6*Gr,fr=-3*xr+9*Rr-9*Gr+3*Hr,$r=3*Rr-3*xr),Math.abs(fr)<1e-12){if(Math.abs(Cr)<1e-12)continue;wr=-$r/Cr,0<wr&&wr<1&&jr.push(wr);continue}Qr=Cr*Cr-4*$r*fr,Yr=Math.sqrt(Qr),!(Qr<0)&&(Mr=(-Cr+Yr)/(2*fr),0<Mr&&Mr<1&&jr.push(Mr),Fr=(-Cr-Yr)/(2*fr),0<Fr&&Fr<1&&jr.push(Fr))}let kr=jr.length,Nr;const Lr=kr;for(;kr--;)wr=jr[kr],Nr=1-wr,Tr[0][kr]=Nr*Nr*Nr*vr+3*Nr*Nr*wr*Pr+3*Nr*wr*wr*Dr+wr*wr*wr*Or,Tr[1][kr]=Nr*Nr*Nr*xr+3*Nr*Nr*wr*Rr+3*Nr*wr*wr*Gr+wr*wr*wr*Hr;return Tr[0][Lr]=vr,Tr[1][Lr]=xr,Tr[0][Lr+1]=Or,Tr[1][Lr+1]=Hr,Tr[0].length=Tr[1].length=Lr+2,[Math.min(...Tr[0]),Math.min(...Tr[1]),Math.max(...Tr[0]),Math.max(...Tr[1])]}}at.Util=Xt;const Gt=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function Wt(hr){if(hr[0]>="ï"){let xr;if(hr[0]==="þ"&&hr[1]==="ÿ"?xr="utf-16be":hr[0]==="ÿ"&&hr[1]==="þ"?xr="utf-16le":hr[0]==="ï"&&hr[1]==="»"&&hr[2]==="¿"&&(xr="utf-8"),xr)try{const Pr=new TextDecoder(xr,{fatal:!0}),Rr=Yt(hr);return Pr.decode(Rr)}catch(Pr){_t(`stringToPDFString: "${Pr}".`)}}const vr=[];for(let xr=0,Pr=hr.length;xr<Pr;xr++){const Rr=Gt[hr.charCodeAt(xr)];vr.push(Rr?String.fromCharCode(Rr):hr.charAt(xr))}return vr.join("")}function er(hr){return decodeURIComponent(escape(hr))}function lr(hr){return unescape(encodeURIComponent(hr))}function ur(hr){return typeof hr=="object"&&(hr==null?void 0:hr.byteLength)!==void 0}function pr(hr,vr){if(hr.length!==vr.length)return!1;for(let xr=0,Pr=hr.length;xr<Pr;xr++)if(hr[xr]!==vr[xr])return!1;return!0}function yr(){let hr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Date;return[hr.getUTCFullYear().toString(),(hr.getUTCMonth()+1).toString().padStart(2,"0"),hr.getUTCDate().toString().padStart(2,"0"),hr.getUTCHours().toString().padStart(2,"0"),hr.getUTCMinutes().toString().padStart(2,"0"),hr.getUTCSeconds().toString().padStart(2,"0")].join("")}class Er{constructor(){_r(this,Ir,!1);this.promise=new Promise((vr,xr)=>{this.resolve=Pr=>{tn(this,Ir,!0),vr(Pr)},this.reject=Pr=>{tn(this,Ir,!0),xr(Pr)}})}get settled(){return mr(this,Ir)}}Ir=new WeakMap,at.PromiseCapability=Er;let br=null,gr=null;function Ar(hr){return br||(br=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,gr=new Map([["ſt","ſt"]])),hr.replaceAll(br,(vr,xr,Pr)=>xr?xr.normalize("NFKC"):gr.get(Pr))}function Sr(){if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.randomUUID)=="function")return crypto.randomUUID();const hr=new Uint8Array(32);if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.getRandomValues)=="function")crypto.getRandomValues(hr);else for(let vr=0;vr<32;vr++)hr[vr]=Math.floor(Math.random()*255);return rr(hr)}const Br="pdfjs_internal_id_";at.AnnotationPrefix=Br},(nt,at,ot)=>{var rt=ot(48),st=ot(14),lt=ot(77),et=ot(147),it=URLSearchParams,ut=it.prototype,ft=st(ut.append),ht=st(ut.delete),dt=st(ut.forEach),gt=st([].push),pt=new it("a=1&a=2&b=3");pt.delete("a",1),pt.delete("b",void 0),pt+""!="a=2"&&rt(ut,"delete",function(mt){var ct=arguments.length,vt=ct<2?void 0:arguments[1];if(ct&&vt===void 0)return ht(this,mt);var At=[];dt(this,function(wt,Ct){gt(At,{key:Ct,value:wt})}),et(ct,1);for(var xt=lt(mt),bt=lt(vt),Et=0,St=0,Bt=!1,Ot=At.length,Pt;Et<Ot;)Pt=At[Et++],Bt||Pt.key===xt?(Bt=!0,ht(this,Pt.key)):St++;for(;St<Ot;)Pt=At[St++],Pt.key===xt&&Pt.value===bt||ft(this,Pt.key,Pt.value)},{enumerable:!0,unsafe:!0})},nt=>{var at=TypeError;nt.exports=function(ot,rt){if(ot<rt)throw at("Not enough arguments");return ot}},(nt,at,ot)=>{var rt=ot(48),st=ot(14),lt=ot(77),et=ot(147),it=URLSearchParams,ut=it.prototype,ft=st(ut.getAll),ht=st(ut.has),dt=new it("a=1");(dt.has("a",2)||!dt.has("a",void 0))&&rt(ut,"has",function(pt){var mt=arguments.length,ct=mt<2?void 0:arguments[1];if(mt&&ct===void 0)return ht(this,pt);var vt=ft(this,pt);et(mt,1);for(var At=lt(ct),xt=0;xt<vt.length;)if(vt[xt++]===At)return!0;return!1},{enumerable:!0,unsafe:!0})},(nt,at,ot)=>{var rt=ot(6),st=ot(14),lt=ot(87),et=URLSearchParams.prototype,it=st(et.forEach);rt&&!("size"in et)&<(et,"size",{get:function(){var ft=0;return it(this,function(){ft++}),ft},configurable:!0,enumerable:!0})},(nt,at,ot)=>{Object.defineProperty(at,"__esModule",{value:!0}),at.XRefParseException=at.XRefEntryException=at.ParserEOFException=at.PDF_VERSION_REGEXP=at.MissingDataException=void 0,at.arrayBuffersToBytes=gt,at.collectActions=wt,at.encodeToXmlString=It,at.escapePDFName=Bt,at.escapeString=Ot,at.getInheritableProperty=pt,at.getLookupTableFactory=it,at.getNewAnnotationsMap=Ht,at.getRotationMatrix=Mt,at.isAscii=Ft,at.isWhiteSpace=Et,at.log2=vt,at.numberToString=jt,at.parseXFAPath=St,at.readInt8=At,at.readUint16=xt,at.readUint32=bt,at.recoverJsURL=kt,at.stringToUTF16HexString=_t,at.stringToUTF16String=Nt,at.toRomanNumerals=ct,at.validateCSSFont=Rt,at.validateFontName=yt,ot(84),ot(93),ot(94),ot(97),ot(99),ot(101),ot(105),ot(108),ot(115),ot(140),ot(116),ot(127),ot(129),ot(132),ot(134),ot(136),ot(138),ot(2);var rt=ot(145),st=ot(151),lt=ot(152);const et=/^[1-9]\.\d$/;at.PDF_VERSION_REGEXP=et;function it(Lt){let $t;return function(){return Lt&&($t=Object.create(null),Lt($t),Lt=null),$t}}class ut extends rt.BaseException{constructor($t,Tt){super(`Missing data [${$t}, ${Tt})`,"MissingDataException"),this.begin=$t,this.end=Tt}}at.MissingDataException=ut;class ft extends rt.BaseException{constructor($t){super($t,"ParserEOFException")}}at.ParserEOFException=ft;class ht extends rt.BaseException{constructor($t){super($t,"XRefEntryException")}}at.XRefEntryException=ht;class dt extends rt.BaseException{constructor($t){super($t,"XRefParseException")}}at.XRefParseException=dt;function gt(Lt){const $t=Lt.length;if($t===0)return new Uint8Array(0);if($t===1)return new Uint8Array(Lt[0]);let Tt=0;for(let Vt=0;Vt<$t;Vt++)Tt+=Lt[Vt].byteLength;const Dt=new Uint8Array(Tt);let Ut=0;for(let Vt=0;Vt<$t;Vt++){const Qt=new Uint8Array(Lt[Vt]);Dt.set(Qt,Ut),Ut+=Qt.byteLength}return Dt}function pt(Lt){let{dict:$t,key:Tt,getArray:Dt=!1,stopWhenFound:Ut=!0}=Lt,Vt;const Qt=new st.RefSet;for(;$t instanceof st.Dict&&!($t.objId&&Qt.has($t.objId));){$t.objId&&Qt.put($t.objId);const qt=Dt?$t.getArray(Tt):$t.get(Tt);if(qt!==void 0){if(Ut)return qt;(Vt||(Vt=[])).push(qt)}$t=$t.get("Parent")}return Vt}const mt=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"];function ct(Lt){let $t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;(0,rt.assert)(Number.isInteger(Lt)&&Lt>0,"The number should be a positive integer.");const Tt=[];let Dt;for(;Lt>=1e3;)Lt-=1e3,Tt.push("M");Dt=Lt/100|0,Lt%=100,Tt.push(mt[Dt]),Dt=Lt/10|0,Lt%=10,Tt.push(mt[10+Dt]),Tt.push(mt[20+Lt]);const Ut=Tt.join("");return $t?Ut.toLowerCase():Ut}function vt(Lt){return Lt<=0?0:Math.ceil(Math.log2(Lt))}function At(Lt,$t){return Lt[$t]<<24>>24}function xt(Lt,$t){return Lt[$t]<<8|Lt[$t+1]}function bt(Lt,$t){return(Lt[$t]<<24|Lt[$t+1]<<16|Lt[$t+2]<<8|Lt[$t+3])>>>0}function Et(Lt){return Lt===32||Lt===9||Lt===13||Lt===10}function St(Lt){const $t=/(.+)\[(\d+)\]$/;return Lt.split(".").map(Tt=>{const Dt=Tt.match($t);return Dt?{name:Dt[1],pos:parseInt(Dt[2],10)}:{name:Tt,pos:0}})}function Bt(Lt){const $t=[];let Tt=0;for(let Dt=0,Ut=Lt.length;Dt<Ut;Dt++){const Vt=Lt.charCodeAt(Dt);(Vt<33||Vt>126||Vt===35||Vt===40||Vt===41||Vt===60||Vt===62||Vt===91||Vt===93||Vt===123||Vt===125||Vt===47||Vt===37)&&(Tt<Dt&&$t.push(Lt.substring(Tt,Dt)),$t.push(`#${Vt.toString(16)}`),Tt=Dt+1)}return $t.length===0?Lt:(Tt<Lt.length&&$t.push(Lt.substring(Tt,Lt.length)),$t.join(""))}function Ot(Lt){return Lt.replaceAll(/([()\\\n\r])/g,$t=>$t===`
|
50
|
+
${_e}`)}}if(a&&typeof a=="object"&&"template"in a&&"options"in a){const{template:$,options:_}=a;_&&_.font&&checkFont({font:_.font,template:$})}if(a&&typeof a=="object"&&"template"in a&&"plugins"in a){const{template:$,plugins:_}=a;_&&checkPlugins({plugins:_,template:$})}},checkInputs=a=>checkProps(a,Inputs),checkUIOptions=a=>checkProps(a,UIOptions),checkTemplate=a=>checkProps(a,Template),checkUIProps=a=>checkProps(a,UIProps),checkPreviewProps=a=>checkProps(a,PreviewProps),checkDesignerProps=a=>checkProps(a,DesignerProps);class Node{constructor({width:s=0,height:$=0}={}){Object.defineProperty(this,"index",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"key",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"schema",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"children",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"padding",{enumerable:!0,configurable:!0,writable:!0,value:[0,0,0,0]}),Object.defineProperty(this,"position",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0}}),this.width=s,this.height=$}setIndex(s){this.index=s}setKeyAndSchema(s,$){this.key=s,this.schema=$}setWidth(s){this.width=s}setHeight(s){this.height=s}setPadding(s){this.padding=s}setPosition(s){this.position=s}insertChild(s){const $=this.getChildCount();s.setIndex($),this.children.splice($,0,s)}getChildCount(){return this.children.length}getChild(s){return this.children[s]}}function createPage(a){const s=new Node({...a});return s.setPadding(a.padding),s}function createNode(a){const{position:s,width:$,height:_,key:_e,schema:tt}=a,nt=new Node({width:$,height:_});return nt.setPosition(s),nt.setKeyAndSchema(_e,tt),nt}function resortChildren(a,s){a.children=a.children.sort(($,_)=>{const _e=s.get($.key),tt=s.get(_.key);if(_e===void 0||tt===void 0)throw new Error("[@pdfme/common] order is not defined");return _e-tt}).map(($,_)=>($.setIndex(_),$))}async function createOnePage(a){const{basePdf:s,schemaObj:$,orderMap:_,input:_e,options:tt,_cache:nt,getDynamicHeights:at}=a,ot=createPage(s),rt=[],st=Object.entries($).sort((it,ut)=>it[1].position.y-ut[1].position.y),lt=new Map;for(const[it,ut]of st){const{position:ft,width:ht}=ut,dt={schema:ut,basePdf:s,options:tt,_cache:nt},gt=await at((_e==null?void 0:_e[it])||"",dt),pt=gt.reduce((ct,vt)=>ct+vt,0),mt=ut.height;pt!==mt&<.set(ft.y+mt,pt-mt),gt.forEach((ct,vt)=>{let At=ut.position.y+gt.reduce((bt,Et,St)=>St<vt?bt+Et:bt,0);for(const[bt,Et]of lt.entries())bt<=ut.position.y&&(At+=Et);const xt=createNode({key:it,schema:ut,position:{...ft,y:At},width:ht,height:ct});rt.push(At+ct+s.padding[2]),ot.insertChild(xt)})}const et=Math.max(...rt,s.height-s.padding[2]);return ot.setHeight(et),resortChildren(ot,_),ot}function breakIntoPages(a){const{longPage:s,orderMap:$,basePdf:_}=a,_e=[createPage(_)],[tt,,nt]=_.padding,at=[],ot=lt=>_.height-nt-(lt>0?tt:0),rt=(lt,et)=>{var ut;const it=lt-et*(_.height-tt-nt);for(;_e.length<=et;)_e[et]||(_e.push(createPage(_)),at.push({page:et,value:(it-tt)*-1}));return it+(((ut=at.find(ft=>ft.page===et))==null?void 0:ut.value)||0)},st=s.children.sort((lt,et)=>lt.position.y-et.position.y);for(let lt=0;lt<st.length;lt++){const{key:et,schema:it,position:ut,height:ft,width:ht}=st[lt],{y:dt,x:gt}=ut;let pt=Math.floor(dt/ot(_e.length-1)),mt=rt(dt,pt);if(mt+ft>_.height-nt&&(pt++,mt=rt(dt,pt)),!et||!it)throw new Error("[@pdfme/common] key or schema is undefined");const ct=createNode({key:et,schema:it,position:{x:gt,y:mt},width:ht,height:ft});_e[pt].insertChild(ct)}return _e.forEach(lt=>resortChildren(lt,$)),_e}function createNewTemplate(a,s){const $={schemas:Array.from({length:a.length},()=>({})),basePdf:s},_=new Map;return cloneDeep$1(a).forEach((_e,tt)=>{_e.children.forEach(nt=>{const{key:at,schema:ot}=nt;if(!at||!ot)throw new Error("[@pdfme/common] key or schema is undefined");_.has(at)||_.set(at,[]),_.get(at).push(nt);const rt=_e.children.filter(lt=>lt.key===at),st=_.get(at).length-rt.length;if(rt.length>0){if(!rt[0].schema)throw new Error("[@pdfme/common] schema is undefined");const lt=rt[0].schema,et=rt.reduce((ut,ft)=>ut+ft.height,0),it=rt[0].position;lt.__bodyRange={start:Math.max(st-1,0),end:st+rt.length-1},lt.__isSplit=st>0,$.schemas[tt][at]=Object.assign({},lt,{position:it,height:et})}})}),$}const getDynamicTemplate=async a=>{const{template:s}=a;if(!isBlankPdf(s.basePdf))return s;const $=s.basePdf,_=[];for(const _e of s.schemas){const tt=new Map(Object.keys(_e).map((ot,rt)=>[ot,rt])),nt=await createOnePage({basePdf:$,schemaObj:_e,orderMap:tt,...a}),at=breakIntoPages({longPage:nt,basePdf:$,orderMap:tt});_.push(...at)}return createNewTemplate(_,s.basePdf)},DEFAULT_LANG="en",DESTROYED_ERR_MSG="[@pdfme/ui] this instance is already destroyed",SELECTABLE_CLASSNAME="selectable",RULER_HEIGHT=30,PAGE_GAP=10,RIGHT_SIDEBAR_WIDTH=400,BACKGROUND_COLOR="rgb(74, 74, 74)";var pdf_worker_entry={},pdf_worker={exports:{}};(function(a,s){(function(_,_e){a.exports=_.pdfjsWorker=_e()})(globalThis,()=>(()=>{var $=[,(nt,at,ot)=>{Object.defineProperty(at,"__esModule",{value:!0}),at.WorkerTask=at.WorkerMessageHandler=void 0,ot(2),ot(84),ot(93),ot(94),ot(97),ot(99),ot(101),ot(105),ot(108),ot(115),ot(116),ot(127),ot(129),ot(132),ot(134),ot(136),ot(138),ot(140),ot(144);var rt=ot(145),st=ot(150),lt=ot(151),et=ot(153),it=ot(157),ut=ot(219),ft=ot(224),ht=ot(258),dt=ot(259),gt=ot(223);class pt{constructor(At){this.name=At,this.terminated=!1,this._capability=new rt.PromiseCapability}get finished(){return this._capability.promise}finish(){this._capability.resolve()}terminate(){this.terminated=!0}ensureNotTerminated(){if(this.terminated)throw new Error("Worker task was terminated")}}at.WorkerTask=pt;class mt{static setup(At,xt){let bt=!1;At.on("test",function(Et){bt||(bt=!0,At.send("test",Et instanceof Uint8Array))}),At.on("configure",function(Et){(0,rt.setVerbosityLevel)(Et.verbosity)}),At.on("GetDocRequest",function(Et){return mt.createDocumentHandler(Et,xt)})}static createDocumentHandler(At,xt){let bt,Et=!1,St=null;const Bt=new Set,Ot=(0,rt.getVerbosityLevel)(),{docId:Pt,apiVersion:wt}=At,Ct="3.11.174";if(wt!==Ct)throw new Error(`The API version "${wt}" does not match the Worker version "${Ct}".`);const It=[];for(const Mt in[])It.push(Mt);if(It.length)throw new Error("The `Array.prototype` contains unexpected enumerable properties: "+It.join(", ")+"; thus breaking e.g. `for...in` iteration of `Array`s.");const yt=Pt+"_worker";let Rt=new ht.MessageHandler(yt,Pt,xt);function kt(){if(Et)throw new Error("Worker was terminated")}function jt(Mt){Bt.add(Mt)}function Ht(Mt){Mt.finish(),Bt.delete(Mt)}async function Ft(Mt){await bt.ensureDoc("checkHeader"),await bt.ensureDoc("parseStartXRef"),await bt.ensureDoc("parse",[Mt]),await bt.ensureDoc("checkFirstPage",[Mt]),await bt.ensureDoc("checkLastPage",[Mt]);const Lt=await bt.ensureDoc("isPureXfa");if(Lt){const Ut=new pt("loadXfaFonts");jt(Ut),await Promise.all([bt.loadXfaFonts(Rt,Ut).catch(Vt=>{}).then(()=>Ht(Ut)),bt.loadXfaImages()])}const[$t,Tt]=await Promise.all([bt.ensureDoc("numPages"),bt.ensureDoc("fingerprints")]),Dt=Lt?await bt.ensureDoc("htmlForXfa"):null;return{numPages:$t,fingerprints:Tt,htmlForXfa:Dt}}function _t(Mt){let{data:Lt,password:$t,disableAutoFetch:Tt,rangeChunkSize:Dt,length:Ut,docBaseUrl:Vt,enableXfa:Qt,evaluatorOptions:qt}=Mt;const Zt={source:null,disableAutoFetch:Tt,docBaseUrl:Vt,docId:Pt,enableXfa:Qt,evaluatorOptions:qt,handler:Rt,length:Ut,password:$t,rangeChunkSize:Dt},ar=new rt.PromiseCapability;let Jt;if(Lt){try{Zt.source=Lt,Jt=new et.LocalPdfManager(Zt),ar.resolve(Jt)}catch(ir){ar.reject(ir)}return ar.promise}let rr,Yt=[];try{rr=new dt.PDFWorkerStream(Rt)}catch(ir){return ar.reject(ir),ar.promise}const Kt=rr.getFullReader();Kt.headersReady.then(function(){if(Kt.isRangeSupported){Zt.source=rr,Zt.length=Kt.contentLength,Zt.disableAutoFetch||(Zt.disableAutoFetch=Kt.isStreamingSupported),Jt=new et.NetworkPdfManager(Zt);for(const ir of Yt)Jt.sendProgressiveData(ir);Yt=[],ar.resolve(Jt),St=null}}).catch(function(ir){ar.reject(ir),St=null});let nr=0;const tr=function(){const ir=(0,st.arrayBuffersToBytes)(Yt);Ut&&ir.length!==Ut&&(0,rt.warn)("reported HTTP length is different from actual");try{Zt.source=ir,Jt=new et.LocalPdfManager(Zt),ar.resolve(Jt)}catch(sr){ar.reject(sr)}Yt=[]};return new Promise(function(ir,sr){const cr=function(or){let{value:Xt,done:Gt}=or;try{if(kt(),Gt){Jt||tr(),St=null;return}nr+=Xt.byteLength,Kt.isStreamingSupported||Rt.send("DocProgress",{loaded:nr,total:Math.max(nr,Kt.contentLength||0)}),Jt?Jt.sendProgressiveData(Xt):Yt.push(Xt),Kt.read().then(cr,sr)}catch(Wt){sr(Wt)}};Kt.read().then(cr,sr)}).catch(function(ir){ar.reject(ir),St=null}),St=function(ir){rr.cancelAllRequests(ir)},ar.promise}function Nt(Mt){function Lt(Dt){kt(),Rt.send("GetDoc",{pdfInfo:Dt})}function $t(Dt){if(kt(),Dt instanceof rt.PasswordException){const Ut=new pt(`PasswordException: response ${Dt.code}`);jt(Ut),Rt.sendWithPromise("PasswordRequest",Dt).then(function(Vt){let{password:Qt}=Vt;Ht(Ut),bt.updatePassword(Qt),Tt()}).catch(function(){Ht(Ut),Rt.send("DocException",Dt)})}else Dt instanceof rt.InvalidPDFException||Dt instanceof rt.MissingPDFException||Dt instanceof rt.UnexpectedResponseException||Dt instanceof rt.UnknownErrorException?Rt.send("DocException",Dt):Rt.send("DocException",new rt.UnknownErrorException(Dt.message,Dt.toString()))}function Tt(){kt(),Ft(!1).then(Lt,function(Dt){if(kt(),!(Dt instanceof st.XRefParseException)){$t(Dt);return}bt.requestLoadedStream().then(function(){kt(),Ft(!0).then(Lt,$t)})})}kt(),_t(Mt).then(function(Dt){if(Et)throw Dt.terminate(new rt.AbortException("Worker was terminated.")),new Error("Worker was terminated");bt=Dt,bt.requestLoadedStream(!0).then(Ut=>{Rt.send("DataLoaded",{length:Ut.bytes.byteLength})})}).then(Tt,$t)}return Rt.on("GetPage",function(Mt){return bt.getPage(Mt.pageIndex).then(function(Lt){return Promise.all([bt.ensure(Lt,"rotate"),bt.ensure(Lt,"ref"),bt.ensure(Lt,"userUnit"),bt.ensure(Lt,"view")]).then(function($t){let[Tt,Dt,Ut,Vt]=$t;return{rotate:Tt,ref:Dt,userUnit:Ut,view:Vt}})})}),Rt.on("GetPageIndex",function(Mt){const Lt=lt.Ref.get(Mt.num,Mt.gen);return bt.ensureCatalog("getPageIndex",[Lt])}),Rt.on("GetDestinations",function(Mt){return bt.ensureCatalog("destinations")}),Rt.on("GetDestination",function(Mt){return bt.ensureCatalog("getDestination",[Mt.id])}),Rt.on("GetPageLabels",function(Mt){return bt.ensureCatalog("pageLabels")}),Rt.on("GetPageLayout",function(Mt){return bt.ensureCatalog("pageLayout")}),Rt.on("GetPageMode",function(Mt){return bt.ensureCatalog("pageMode")}),Rt.on("GetViewerPreferences",function(Mt){return bt.ensureCatalog("viewerPreferences")}),Rt.on("GetOpenAction",function(Mt){return bt.ensureCatalog("openAction")}),Rt.on("GetAttachments",function(Mt){return bt.ensureCatalog("attachments")}),Rt.on("GetDocJSActions",function(Mt){return bt.ensureCatalog("jsActions")}),Rt.on("GetPageJSActions",function(Mt){let{pageIndex:Lt}=Mt;return bt.getPage(Lt).then(function($t){return bt.ensure($t,"jsActions")})}),Rt.on("GetOutline",function(Mt){return bt.ensureCatalog("documentOutline")}),Rt.on("GetOptionalContentConfig",function(Mt){return bt.ensureCatalog("optionalContentConfig")}),Rt.on("GetPermissions",function(Mt){return bt.ensureCatalog("permissions")}),Rt.on("GetMetadata",function(Mt){return Promise.all([bt.ensureDoc("documentInfo"),bt.ensureCatalog("metadata")])}),Rt.on("GetMarkInfo",function(Mt){return bt.ensureCatalog("markInfo")}),Rt.on("GetData",function(Mt){return bt.requestLoadedStream().then(function(Lt){return Lt.bytes})}),Rt.on("GetAnnotations",function(Mt){let{pageIndex:Lt,intent:$t}=Mt;return bt.getPage(Lt).then(function(Tt){const Dt=new pt(`GetAnnotations: page ${Lt}`);return jt(Dt),Tt.getAnnotationsData(Rt,Dt,$t).then(Ut=>(Ht(Dt),Ut),Ut=>{throw Ht(Dt),Ut})})}),Rt.on("GetFieldObjects",function(Mt){return bt.ensureDoc("fieldObjects")}),Rt.on("HasJSActions",function(Mt){return bt.ensureDoc("hasJSActions")}),Rt.on("GetCalculationOrderIds",function(Mt){return bt.ensureDoc("calculationOrderIds")}),Rt.on("SaveDocument",async function(Mt){let{isPureXfa:Lt,numPages:$t,annotationStorage:Tt,filename:Dt}=Mt;const Ut=[bt.requestLoadedStream(),bt.ensureCatalog("acroForm"),bt.ensureCatalog("acroFormRef"),bt.ensureDoc("startXRef"),bt.ensureDoc("xref"),bt.ensureDoc("linearization"),bt.ensureCatalog("structTreeRoot")],Vt=[],Qt=Lt?null:(0,st.getNewAnnotationsMap)(Tt),[qt,Zt,ar,Jt,rr,Yt,Kt]=await Promise.all(Ut),nr=rr.trailer.getRaw("Root")||null;let tr;if(Qt){Kt?await Kt.canUpdateStructTree({pdfManager:bt,newAnnotationsByPage:Qt})&&(tr=Kt):await gt.StructTreeRoot.canCreateStructureTree({catalogRef:nr,pdfManager:bt,newAnnotationsByPage:Qt})&&(tr=null);const lr=it.AnnotationFactory.generateImages(Tt.values(),rr,bt.evaluatorOptions.isOffscreenCanvasSupported),ur=tr===void 0?Vt:[];for(const[pr,yr]of Qt)ur.push(bt.getPage(pr).then(Er=>{const br=new pt(`Save (editor): page ${pr}`);return Er.saveNewAnnotations(Rt,br,yr,lr).finally(function(){Ht(br)})}));tr===null?Vt.push(Promise.all(ur).then(async pr=>(await gt.StructTreeRoot.createStructureTree({newAnnotationsByPage:Qt,xref:rr,catalogRef:nr,pdfManager:bt,newRefs:pr}),pr))):tr&&Vt.push(Promise.all(ur).then(async pr=>(await tr.updateStructureTree({newAnnotationsByPage:Qt,pdfManager:bt,newRefs:pr}),pr)))}if(Lt)Vt.push(bt.serializeXfaData(Tt));else for(let lr=0;lr<$t;lr++)Vt.push(bt.getPage(lr).then(function(ur){const pr=new pt(`Save: page ${lr}`);return ur.save(Rt,pr,Tt).finally(function(){Ht(pr)})}));const ir=await Promise.all(Vt);let sr=[],cr=null;if(Lt){if(cr=ir[0],!cr)return qt.bytes}else if(sr=ir.flat(2),sr.length===0)return qt.bytes;const or=ar&&Zt instanceof lt.Dict&&sr.some(lr=>lr.needAppearances),Xt=Zt instanceof lt.Dict&&Zt.get("XFA")||null;let Gt=null,Wt=!1;if(Array.isArray(Xt)){for(let lr=0,ur=Xt.length;lr<ur;lr+=2)Xt[lr]==="datasets"&&(Gt=Xt[lr+1],Wt=!0);Gt===null&&(Gt=rr.getNewTemporaryRef())}else Xt&&(0,rt.warn)("Unsupported XFA type.");let er=Object.create(null);if(rr.trailer){const lr=Object.create(null),ur=rr.trailer.get("Info")||null;ur instanceof lt.Dict&&ur.forEach((pr,yr)=>{typeof yr=="string"&&(lr[pr]=(0,rt.stringToPDFString)(yr))}),er={rootRef:nr,encryptRef:rr.trailer.getRaw("Encrypt")||null,newRef:rr.getNewTemporaryRef(),infoRef:rr.trailer.getRaw("Info")||null,info:lr,fileIds:rr.trailer.get("ID")||null,startXRef:Yt?Jt:rr.lastXRefStreamPos??Jt,filename:Dt}}return(0,ft.incrementalUpdate)({originalData:qt.bytes,xrefInfo:er,newRefs:sr,xref:rr,hasXfa:!!Xt,xfaDatasetsRef:Gt,hasXfaDatasetsEntry:Wt,needAppearances:or,acroFormRef:ar,acroForm:Zt,xfaData:cr}).finally(()=>{rr.resetNewTemporaryRef()})}),Rt.on("GetOperatorList",function(Mt,Lt){const $t=Mt.pageIndex;bt.getPage($t).then(function(Tt){const Dt=new pt(`GetOperatorList: page ${$t}`);jt(Dt);const Ut=Ot>=rt.VerbosityLevel.INFOS?Date.now():0;Tt.getOperatorList({handler:Rt,sink:Lt,task:Dt,intent:Mt.intent,cacheKey:Mt.cacheKey,annotationStorage:Mt.annotationStorage}).then(function(Vt){Ht(Dt),Ut&&(0,rt.info)(`page=${$t+1} - getOperatorList: time=${Date.now()-Ut}ms, len=${Vt.length}`),Lt.close()},function(Vt){Ht(Dt),!Dt.terminated&&Lt.error(Vt)})})}),Rt.on("GetTextContent",function(Mt,Lt){const{pageIndex:$t,includeMarkedContent:Tt,disableNormalization:Dt}=Mt;bt.getPage($t).then(function(Ut){const Vt=new pt("GetTextContent: page "+$t);jt(Vt);const Qt=Ot>=rt.VerbosityLevel.INFOS?Date.now():0;Ut.extractTextContent({handler:Rt,task:Vt,sink:Lt,includeMarkedContent:Tt,disableNormalization:Dt}).then(function(){Ht(Vt),Qt&&(0,rt.info)(`page=${$t+1} - getTextContent: time=${Date.now()-Qt}ms`),Lt.close()},function(qt){Ht(Vt),!Vt.terminated&&Lt.error(qt)})})}),Rt.on("GetStructTree",function(Mt){return bt.getPage(Mt.pageIndex).then(function(Lt){return bt.ensure(Lt,"getStructTree")})}),Rt.on("FontFallback",function(Mt){return bt.fontFallback(Mt.id,Rt)}),Rt.on("Cleanup",function(Mt){return bt.cleanup(!0)}),Rt.on("Terminate",function(Mt){Et=!0;const Lt=[];if(bt){bt.terminate(new rt.AbortException("Worker was terminated."));const $t=bt.cleanup();Lt.push($t),bt=null}else(0,ut.clearGlobalCaches)();St&&St(new rt.AbortException("Worker was terminated."));for(const $t of Bt)Lt.push($t.finished),$t.terminate();return Promise.all(Lt).then(function(){Rt.destroy(),Rt=null})}),Rt.on("Ready",function(Mt){Nt(At),At=null}),yt}static initializeFromPort(At){const xt=new ht.MessageHandler("worker","main",At);mt.setup(xt,At),xt.send("ready",null)}}at.WorkerMessageHandler=mt;function ct(vt){return typeof vt.postMessage=="function"&&"onmessage"in vt}typeof window>"u"&&!rt.isNodeJS&&typeof self<"u"&&ct(self)&&mt.initializeFromPort(self)},(nt,at,ot)=>{var rt=ot(3),st=ot(4),lt=ot(69),et=ot(70),it="WebAssembly",ut=st[it],ft=Error("e",{cause:7}).cause!==7,ht=function(gt,pt){var mt={};mt[gt]=et(gt,pt,ft),rt({global:!0,constructor:!0,arity:1,forced:ft},mt)},dt=function(gt,pt){if(ut&&ut[gt]){var mt={};mt[gt]=et(it+"."+gt,pt,ft),rt({target:it,stat:!0,constructor:!0,arity:1,forced:ft},mt)}};ht("Error",function(gt){return function(mt){return lt(gt,this,arguments)}}),ht("EvalError",function(gt){return function(mt){return lt(gt,this,arguments)}}),ht("RangeError",function(gt){return function(mt){return lt(gt,this,arguments)}}),ht("ReferenceError",function(gt){return function(mt){return lt(gt,this,arguments)}}),ht("SyntaxError",function(gt){return function(mt){return lt(gt,this,arguments)}}),ht("TypeError",function(gt){return function(mt){return lt(gt,this,arguments)}}),ht("URIError",function(gt){return function(mt){return lt(gt,this,arguments)}}),dt("CompileError",function(gt){return function(mt){return lt(gt,this,arguments)}}),dt("LinkError",function(gt){return function(mt){return lt(gt,this,arguments)}}),dt("RuntimeError",function(gt){return function(mt){return lt(gt,this,arguments)}})},(nt,at,ot)=>{var rt=ot(4),st=ot(5).f,lt=ot(44),et=ot(48),it=ot(38),ut=ot(56),ft=ot(68);nt.exports=function(ht,dt){var gt=ht.target,pt=ht.global,mt=ht.stat,ct,vt,At,xt,bt,Et;if(pt?vt=rt:mt?vt=rt[gt]||it(gt,{}):vt=(rt[gt]||{}).prototype,vt)for(At in dt){if(bt=dt[At],ht.dontCallGetSet?(Et=st(vt,At),xt=Et&&Et.value):xt=vt[At],ct=ft(pt?At:gt+(mt?".":"#")+At,ht.forced),!ct&&xt!==void 0){if(typeof bt==typeof xt)continue;ut(bt,xt)}(ht.sham||xt&&xt.sham)&<(bt,"sham",!0),et(vt,At,bt,ht)}}},function(nt){var at=function(ot){return ot&&ot.Math===Math&&ot};nt.exports=at(typeof globalThis=="object"&&globalThis)||at(typeof window=="object"&&window)||at(typeof self=="object"&&self)||at(typeof commonjsGlobal=="object"&&commonjsGlobal)||function(){return this}()||this||Function("return this")()},(nt,at,ot)=>{var rt=ot(6),st=ot(8),lt=ot(10),et=ot(11),it=ot(12),ut=ot(18),ft=ot(39),ht=ot(42),dt=Object.getOwnPropertyDescriptor;at.f=rt?dt:function(pt,mt){if(pt=it(pt),mt=ut(mt),ht)try{return dt(pt,mt)}catch{}if(ft(pt,mt))return et(!st(lt.f,pt,mt),pt[mt])}},(nt,at,ot)=>{var rt=ot(7);nt.exports=!rt(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})},nt=>{nt.exports=function(at){try{return!!at()}catch{return!0}}},(nt,at,ot)=>{var rt=ot(9),st=Function.prototype.call;nt.exports=rt?st.bind(st):function(){return st.apply(st,arguments)}},(nt,at,ot)=>{var rt=ot(7);nt.exports=!rt(function(){var st=(function(){}).bind();return typeof st!="function"||st.hasOwnProperty("prototype")})},(nt,at)=>{var ot={}.propertyIsEnumerable,rt=Object.getOwnPropertyDescriptor,st=rt&&!ot.call({1:2},1);at.f=st?function(et){var it=rt(this,et);return!!it&&it.enumerable}:ot},nt=>{nt.exports=function(at,ot){return{enumerable:!(at&1),configurable:!(at&2),writable:!(at&4),value:ot}}},(nt,at,ot)=>{var rt=ot(13),st=ot(16);nt.exports=function(lt){return rt(st(lt))}},(nt,at,ot)=>{var rt=ot(14),st=ot(7),lt=ot(15),et=Object,it=rt("".split);nt.exports=st(function(){return!et("z").propertyIsEnumerable(0)})?function(ut){return lt(ut)==="String"?it(ut,""):et(ut)}:et},(nt,at,ot)=>{var rt=ot(9),st=Function.prototype,lt=st.call,et=rt&&st.bind.bind(lt,lt);nt.exports=rt?et:function(it){return function(){return lt.apply(it,arguments)}}},(nt,at,ot)=>{var rt=ot(14),st=rt({}.toString),lt=rt("".slice);nt.exports=function(et){return lt(st(et),8,-1)}},(nt,at,ot)=>{var rt=ot(17),st=TypeError;nt.exports=function(lt){if(rt(lt))throw st("Can't call method on "+lt);return lt}},nt=>{nt.exports=function(at){return at==null}},(nt,at,ot)=>{var rt=ot(19),st=ot(23);nt.exports=function(lt){var et=rt(lt,"string");return st(et)?et:et+""}},(nt,at,ot)=>{var rt=ot(8),st=ot(20),lt=ot(23),et=ot(30),it=ot(33),ut=ot(34),ft=TypeError,ht=ut("toPrimitive");nt.exports=function(dt,gt){if(!st(dt)||lt(dt))return dt;var pt=et(dt,ht),mt;if(pt){if(gt===void 0&&(gt="default"),mt=rt(pt,dt,gt),!st(mt)||lt(mt))return mt;throw ft("Can't convert object to primitive value")}return gt===void 0&&(gt="number"),it(dt,gt)}},(nt,at,ot)=>{var rt=ot(21),st=ot(22),lt=st.all;nt.exports=st.IS_HTMLDDA?function(et){return typeof et=="object"?et!==null:rt(et)||et===lt}:function(et){return typeof et=="object"?et!==null:rt(et)}},(nt,at,ot)=>{var rt=ot(22),st=rt.all;nt.exports=rt.IS_HTMLDDA?function(lt){return typeof lt=="function"||lt===st}:function(lt){return typeof lt=="function"}},nt=>{var at=typeof document=="object"&&document.all,ot=typeof at>"u"&&at!==void 0;nt.exports={all:at,IS_HTMLDDA:ot}},(nt,at,ot)=>{var rt=ot(24),st=ot(21),lt=ot(25),et=ot(26),it=Object;nt.exports=et?function(ut){return typeof ut=="symbol"}:function(ut){var ft=rt("Symbol");return st(ft)&<(ft.prototype,it(ut))}},(nt,at,ot)=>{var rt=ot(4),st=ot(21),lt=function(et){return st(et)?et:void 0};nt.exports=function(et,it){return arguments.length<2?lt(rt[et]):rt[et]&&rt[et][it]}},(nt,at,ot)=>{var rt=ot(14);nt.exports=rt({}.isPrototypeOf)},(nt,at,ot)=>{var rt=ot(27);nt.exports=rt&&!Symbol.sham&&typeof Symbol.iterator=="symbol"},(nt,at,ot)=>{var rt=ot(28),st=ot(7),lt=ot(4),et=lt.String;nt.exports=!!Object.getOwnPropertySymbols&&!st(function(){var it=Symbol("symbol detection");return!et(it)||!(Object(it)instanceof Symbol)||!Symbol.sham&&rt&&rt<41})},(nt,at,ot)=>{var rt=ot(4),st=ot(29),lt=rt.process,et=rt.Deno,it=lt&<.versions||et&&et.version,ut=it&&it.v8,ft,ht;ut&&(ft=ut.split("."),ht=ft[0]>0&&ft[0]<4?1:+(ft[0]+ft[1])),!ht&&st&&(ft=st.match(/Edge\/(\d+)/),(!ft||ft[1]>=74)&&(ft=st.match(/Chrome\/(\d+)/),ft&&(ht=+ft[1]))),nt.exports=ht},nt=>{nt.exports=typeof navigator<"u"&&String(navigator.userAgent)||""},(nt,at,ot)=>{var rt=ot(31),st=ot(17);nt.exports=function(lt,et){var it=lt[et];return st(it)?void 0:rt(it)}},(nt,at,ot)=>{var rt=ot(21),st=ot(32),lt=TypeError;nt.exports=function(et){if(rt(et))return et;throw lt(st(et)+" is not a function")}},nt=>{var at=String;nt.exports=function(ot){try{return at(ot)}catch{return"Object"}}},(nt,at,ot)=>{var rt=ot(8),st=ot(21),lt=ot(20),et=TypeError;nt.exports=function(it,ut){var ft,ht;if(ut==="string"&&st(ft=it.toString)&&!lt(ht=rt(ft,it))||st(ft=it.valueOf)&&!lt(ht=rt(ft,it))||ut!=="string"&&st(ft=it.toString)&&!lt(ht=rt(ft,it)))return ht;throw et("Can't convert object to primitive value")}},(nt,at,ot)=>{var rt=ot(4),st=ot(35),lt=ot(39),et=ot(41),it=ot(27),ut=ot(26),ft=rt.Symbol,ht=st("wks"),dt=ut?ft.for||ft:ft&&ft.withoutSetter||et;nt.exports=function(gt){return lt(ht,gt)||(ht[gt]=it&<(ft,gt)?ft[gt]:dt("Symbol."+gt)),ht[gt]}},(nt,at,ot)=>{var rt=ot(36),st=ot(37);(nt.exports=function(lt,et){return st[lt]||(st[lt]=et!==void 0?et:{})})("versions",[]).push({version:"3.32.2",mode:rt?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.32.2/LICENSE",source:"https://github.com/zloirock/core-js"})},nt=>{nt.exports=!1},(nt,at,ot)=>{var rt=ot(4),st=ot(38),lt="__core-js_shared__",et=rt[lt]||st(lt,{});nt.exports=et},(nt,at,ot)=>{var rt=ot(4),st=Object.defineProperty;nt.exports=function(lt,et){try{st(rt,lt,{value:et,configurable:!0,writable:!0})}catch{rt[lt]=et}return et}},(nt,at,ot)=>{var rt=ot(14),st=ot(40),lt=rt({}.hasOwnProperty);nt.exports=Object.hasOwn||function(it,ut){return lt(st(it),ut)}},(nt,at,ot)=>{var rt=ot(16),st=Object;nt.exports=function(lt){return st(rt(lt))}},(nt,at,ot)=>{var rt=ot(14),st=0,lt=Math.random(),et=rt(1 .toString);nt.exports=function(it){return"Symbol("+(it===void 0?"":it)+")_"+et(++st+lt,36)}},(nt,at,ot)=>{var rt=ot(6),st=ot(7),lt=ot(43);nt.exports=!rt&&!st(function(){return Object.defineProperty(lt("div"),"a",{get:function(){return 7}}).a!==7})},(nt,at,ot)=>{var rt=ot(4),st=ot(20),lt=rt.document,et=st(lt)&&st(lt.createElement);nt.exports=function(it){return et?lt.createElement(it):{}}},(nt,at,ot)=>{var rt=ot(6),st=ot(45),lt=ot(11);nt.exports=rt?function(et,it,ut){return st.f(et,it,lt(1,ut))}:function(et,it,ut){return et[it]=ut,et}},(nt,at,ot)=>{var rt=ot(6),st=ot(42),lt=ot(46),et=ot(47),it=ot(18),ut=TypeError,ft=Object.defineProperty,ht=Object.getOwnPropertyDescriptor,dt="enumerable",gt="configurable",pt="writable";at.f=rt?lt?function(ct,vt,At){if(et(ct),vt=it(vt),et(At),typeof ct=="function"&&vt==="prototype"&&"value"in At&&pt in At&&!At[pt]){var xt=ht(ct,vt);xt&&xt[pt]&&(ct[vt]=At.value,At={configurable:gt in At?At[gt]:xt[gt],enumerable:dt in At?At[dt]:xt[dt],writable:!1})}return ft(ct,vt,At)}:ft:function(ct,vt,At){if(et(ct),vt=it(vt),et(At),st)try{return ft(ct,vt,At)}catch{}if("get"in At||"set"in At)throw ut("Accessors not supported");return"value"in At&&(ct[vt]=At.value),ct}},(nt,at,ot)=>{var rt=ot(6),st=ot(7);nt.exports=rt&&st(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})},(nt,at,ot)=>{var rt=ot(20),st=String,lt=TypeError;nt.exports=function(et){if(rt(et))return et;throw lt(st(et)+" is not an object")}},(nt,at,ot)=>{var rt=ot(21),st=ot(45),lt=ot(49),et=ot(38);nt.exports=function(it,ut,ft,ht){ht||(ht={});var dt=ht.enumerable,gt=ht.name!==void 0?ht.name:ut;if(rt(ft)&<(ft,gt,ht),ht.global)dt?it[ut]=ft:et(ut,ft);else{try{ht.unsafe?it[ut]&&(dt=!0):delete it[ut]}catch{}dt?it[ut]=ft:st.f(it,ut,{value:ft,enumerable:!1,configurable:!ht.nonConfigurable,writable:!ht.nonWritable})}return it}},(nt,at,ot)=>{var rt=ot(14),st=ot(7),lt=ot(21),et=ot(39),it=ot(6),ut=ot(50).CONFIGURABLE,ft=ot(51),ht=ot(52),dt=ht.enforce,gt=ht.get,pt=String,mt=Object.defineProperty,ct=rt("".slice),vt=rt("".replace),At=rt([].join),xt=it&&!st(function(){return mt(function(){},"length",{value:8}).length!==8}),bt=String(String).split("String"),Et=nt.exports=function(St,Bt,Ot){ct(pt(Bt),0,7)==="Symbol("&&(Bt="["+vt(pt(Bt),/^Symbol\(([^)]*)\)/,"$1")+"]"),Ot&&Ot.getter&&(Bt="get "+Bt),Ot&&Ot.setter&&(Bt="set "+Bt),(!et(St,"name")||ut&&St.name!==Bt)&&(it?mt(St,"name",{value:Bt,configurable:!0}):St.name=Bt),xt&&Ot&&et(Ot,"arity")&&St.length!==Ot.arity&&mt(St,"length",{value:Ot.arity});try{Ot&&et(Ot,"constructor")&&Ot.constructor?it&&mt(St,"prototype",{writable:!1}):St.prototype&&(St.prototype=void 0)}catch{}var Pt=dt(St);return et(Pt,"source")||(Pt.source=At(bt,typeof Bt=="string"?Bt:"")),St};Function.prototype.toString=Et(function(){return lt(this)&>(this).source||ft(this)},"toString")},(nt,at,ot)=>{var rt=ot(6),st=ot(39),lt=Function.prototype,et=rt&&Object.getOwnPropertyDescriptor,it=st(lt,"name"),ut=it&&(function(){}).name==="something",ft=it&&(!rt||rt&&et(lt,"name").configurable);nt.exports={EXISTS:it,PROPER:ut,CONFIGURABLE:ft}},(nt,at,ot)=>{var rt=ot(14),st=ot(21),lt=ot(37),et=rt(Function.toString);st(lt.inspectSource)||(lt.inspectSource=function(it){return et(it)}),nt.exports=lt.inspectSource},(nt,at,ot)=>{var rt=ot(53),st=ot(4),lt=ot(20),et=ot(44),it=ot(39),ut=ot(37),ft=ot(54),ht=ot(55),dt="Object already initialized",gt=st.TypeError,pt=st.WeakMap,mt,ct,vt,At=function(St){return vt(St)?ct(St):mt(St,{})},xt=function(St){return function(Bt){var Ot;if(!lt(Bt)||(Ot=ct(Bt)).type!==St)throw gt("Incompatible receiver, "+St+" required");return Ot}};if(rt||ut.state){var bt=ut.state||(ut.state=new pt);bt.get=bt.get,bt.has=bt.has,bt.set=bt.set,mt=function(St,Bt){if(bt.has(St))throw gt(dt);return Bt.facade=St,bt.set(St,Bt),Bt},ct=function(St){return bt.get(St)||{}},vt=function(St){return bt.has(St)}}else{var Et=ft("state");ht[Et]=!0,mt=function(St,Bt){if(it(St,Et))throw gt(dt);return Bt.facade=St,et(St,Et,Bt),Bt},ct=function(St){return it(St,Et)?St[Et]:{}},vt=function(St){return it(St,Et)}}nt.exports={set:mt,get:ct,has:vt,enforce:At,getterFor:xt}},(nt,at,ot)=>{var rt=ot(4),st=ot(21),lt=rt.WeakMap;nt.exports=st(lt)&&/native code/.test(String(lt))},(nt,at,ot)=>{var rt=ot(35),st=ot(41),lt=rt("keys");nt.exports=function(et){return lt[et]||(lt[et]=st(et))}},nt=>{nt.exports={}},(nt,at,ot)=>{var rt=ot(39),st=ot(57),lt=ot(5),et=ot(45);nt.exports=function(it,ut,ft){for(var ht=st(ut),dt=et.f,gt=lt.f,pt=0;pt<ht.length;pt++){var mt=ht[pt];!rt(it,mt)&&!(ft&&rt(ft,mt))&&dt(it,mt,gt(ut,mt))}}},(nt,at,ot)=>{var rt=ot(24),st=ot(14),lt=ot(58),et=ot(67),it=ot(47),ut=st([].concat);nt.exports=rt("Reflect","ownKeys")||function(ht){var dt=lt.f(it(ht)),gt=et.f;return gt?ut(dt,gt(ht)):dt}},(nt,at,ot)=>{var rt=ot(59),st=ot(66),lt=st.concat("length","prototype");at.f=Object.getOwnPropertyNames||function(it){return rt(it,lt)}},(nt,at,ot)=>{var rt=ot(14),st=ot(39),lt=ot(12),et=ot(60).indexOf,it=ot(55),ut=rt([].push);nt.exports=function(ft,ht){var dt=lt(ft),gt=0,pt=[],mt;for(mt in dt)!st(it,mt)&&st(dt,mt)&&ut(pt,mt);for(;ht.length>gt;)st(dt,mt=ht[gt++])&&(~et(pt,mt)||ut(pt,mt));return pt}},(nt,at,ot)=>{var rt=ot(12),st=ot(61),lt=ot(64),et=function(it){return function(ut,ft,ht){var dt=rt(ut),gt=lt(dt),pt=st(ht,gt),mt;if(it&&ft!==ft){for(;gt>pt;)if(mt=dt[pt++],mt!==mt)return!0}else for(;gt>pt;pt++)if((it||pt in dt)&&dt[pt]===ft)return it||pt||0;return!it&&-1}};nt.exports={includes:et(!0),indexOf:et(!1)}},(nt,at,ot)=>{var rt=ot(62),st=Math.max,lt=Math.min;nt.exports=function(et,it){var ut=rt(et);return ut<0?st(ut+it,0):lt(ut,it)}},(nt,at,ot)=>{var rt=ot(63);nt.exports=function(st){var lt=+st;return lt!==lt||lt===0?0:rt(lt)}},nt=>{var at=Math.ceil,ot=Math.floor;nt.exports=Math.trunc||function(st){var lt=+st;return(lt>0?ot:at)(lt)}},(nt,at,ot)=>{var rt=ot(65);nt.exports=function(st){return rt(st.length)}},(nt,at,ot)=>{var rt=ot(62),st=Math.min;nt.exports=function(lt){return lt>0?st(rt(lt),9007199254740991):0}},nt=>{nt.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(nt,at)=>{at.f=Object.getOwnPropertySymbols},(nt,at,ot)=>{var rt=ot(7),st=ot(21),lt=/#|\.prototype\./,et=function(dt,gt){var pt=ut[it(dt)];return pt===ht?!0:pt===ft?!1:st(gt)?rt(gt):!!gt},it=et.normalize=function(dt){return String(dt).replace(lt,".").toLowerCase()},ut=et.data={},ft=et.NATIVE="N",ht=et.POLYFILL="P";nt.exports=et},(nt,at,ot)=>{var rt=ot(9),st=Function.prototype,lt=st.apply,et=st.call;nt.exports=typeof Reflect=="object"&&Reflect.apply||(rt?et.bind(lt):function(){return et.apply(lt,arguments)})},(nt,at,ot)=>{var rt=ot(24),st=ot(39),lt=ot(44),et=ot(25),it=ot(71),ut=ot(56),ft=ot(74),ht=ot(75),dt=ot(76),gt=ot(80),pt=ot(81),mt=ot(6),ct=ot(36);nt.exports=function(vt,At,xt,bt){var Et="stackTraceLimit",St=bt?2:1,Bt=vt.split("."),Ot=Bt[Bt.length-1],Pt=rt.apply(null,Bt);if(Pt){var wt=Pt.prototype;if(!ct&&st(wt,"cause")&&delete wt.cause,!xt)return Pt;var Ct=rt("Error"),It=At(function(yt,Rt){var kt=dt(bt?Rt:yt,void 0),jt=bt?new Pt(yt):new Pt;return kt!==void 0&<(jt,"message",kt),pt(jt,It,jt.stack,2),this&&et(wt,this)&&ht(jt,this,It),arguments.length>St&>(jt,arguments[St]),jt});if(It.prototype=wt,Ot!=="Error"?it?it(It,Ct):ut(It,Ct,{name:!0}):mt&&Et in Pt&&(ft(It,Pt,Et),ft(It,Pt,"prepareStackTrace")),ut(It,Pt),!ct)try{wt.name!==Ot&<(wt,"name",Ot),wt.constructor=It}catch{}return It}}},(nt,at,ot)=>{var rt=ot(72),st=ot(47),lt=ot(73);nt.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var et=!1,it={},ut;try{ut=rt(Object.prototype,"__proto__","set"),ut(it,[]),et=it instanceof Array}catch{}return function(ht,dt){return st(ht),lt(dt),et?ut(ht,dt):ht.__proto__=dt,ht}}():void 0)},(nt,at,ot)=>{var rt=ot(14),st=ot(31);nt.exports=function(lt,et,it){try{return rt(st(Object.getOwnPropertyDescriptor(lt,et)[it]))}catch{}}},(nt,at,ot)=>{var rt=ot(21),st=String,lt=TypeError;nt.exports=function(et){if(typeof et=="object"||rt(et))return et;throw lt("Can't set "+st(et)+" as a prototype")}},(nt,at,ot)=>{var rt=ot(45).f;nt.exports=function(st,lt,et){et in st||rt(st,et,{configurable:!0,get:function(){return lt[et]},set:function(it){lt[et]=it}})}},(nt,at,ot)=>{var rt=ot(21),st=ot(20),lt=ot(71);nt.exports=function(et,it,ut){var ft,ht;return lt&&rt(ft=it.constructor)&&ft!==ut&&st(ht=ft.prototype)&&ht!==ut.prototype&<(et,ht),et}},(nt,at,ot)=>{var rt=ot(77);nt.exports=function(st,lt){return st===void 0?arguments.length<2?"":lt:rt(st)}},(nt,at,ot)=>{var rt=ot(78),st=String;nt.exports=function(lt){if(rt(lt)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return st(lt)}},(nt,at,ot)=>{var rt=ot(79),st=ot(21),lt=ot(15),et=ot(34),it=et("toStringTag"),ut=Object,ft=lt(function(){return arguments}())==="Arguments",ht=function(dt,gt){try{return dt[gt]}catch{}};nt.exports=rt?lt:function(dt){var gt,pt,mt;return dt===void 0?"Undefined":dt===null?"Null":typeof(pt=ht(gt=ut(dt),it))=="string"?pt:ft?lt(gt):(mt=lt(gt))==="Object"&&st(gt.callee)?"Arguments":mt}},(nt,at,ot)=>{var rt=ot(34),st=rt("toStringTag"),lt={};lt[st]="z",nt.exports=String(lt)==="[object z]"},(nt,at,ot)=>{var rt=ot(20),st=ot(44);nt.exports=function(lt,et){rt(et)&&"cause"in et&&st(lt,"cause",et.cause)}},(nt,at,ot)=>{var rt=ot(44),st=ot(82),lt=ot(83),et=Error.captureStackTrace;nt.exports=function(it,ut,ft,ht){lt&&(et?et(it,ut):rt(it,"stack",st(ft,ht)))}},(nt,at,ot)=>{var rt=ot(14),st=Error,lt=rt("".replace),et=function(ft){return String(st(ft).stack)}("zxcasd"),it=/\n\s*at [^:]*:[^\n]*/,ut=it.test(et);nt.exports=function(ft,ht){if(ut&&typeof ft=="string"&&!st.prepareStackTrace)for(;ht--;)ft=lt(ft,it,"");return ft}},(nt,at,ot)=>{var rt=ot(7),st=ot(11);nt.exports=!rt(function(){var lt=Error("a");return"stack"in lt?(Object.defineProperty(lt,"stack",st(1,7)),lt.stack!==7):!0})},(nt,at,ot)=>{var rt=ot(85),st=ot(90).findLast,lt=rt.aTypedArray,et=rt.exportTypedArrayMethod;et("findLast",function(ut){return st(lt(this),ut,arguments.length>1?arguments[1]:void 0)})},(nt,at,ot)=>{var rt=ot(86),st=ot(6),lt=ot(4),et=ot(21),it=ot(20),ut=ot(39),ft=ot(78),ht=ot(32),dt=ot(44),gt=ot(48),pt=ot(87),mt=ot(25),ct=ot(88),vt=ot(71),At=ot(34),xt=ot(41),bt=ot(52),Et=bt.enforce,St=bt.get,Bt=lt.Int8Array,Ot=Bt&&Bt.prototype,Pt=lt.Uint8ClampedArray,wt=Pt&&Pt.prototype,Ct=Bt&&ct(Bt),It=Ot&&ct(Ot),yt=Object.prototype,Rt=lt.TypeError,kt=At("toStringTag"),jt=xt("TYPED_ARRAY_TAG"),Ht="TypedArrayConstructor",Ft=rt&&!!vt&&ft(lt.opera)!=="Opera",_t=!1,Nt,Mt,Lt,$t={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Tt={BigInt64Array:8,BigUint64Array:8},Dt=function(rr){if(!it(rr))return!1;var Yt=ft(rr);return Yt==="DataView"||ut($t,Yt)||ut(Tt,Yt)},Ut=function(Jt){var rr=ct(Jt);if(it(rr)){var Yt=St(rr);return Yt&&ut(Yt,Ht)?Yt[Ht]:Ut(rr)}},Vt=function(Jt){if(!it(Jt))return!1;var rr=ft(Jt);return ut($t,rr)||ut(Tt,rr)},Qt=function(Jt){if(Vt(Jt))return Jt;throw Rt("Target is not a typed array")},qt=function(Jt){if(et(Jt)&&(!vt||mt(Ct,Jt)))return Jt;throw Rt(ht(Jt)+" is not a typed array constructor")},Zt=function(Jt,rr,Yt,Kt){if(st){if(Yt)for(var nr in $t){var tr=lt[nr];if(tr&&ut(tr.prototype,Jt))try{delete tr.prototype[Jt]}catch{try{tr.prototype[Jt]=rr}catch{}}}(!It[Jt]||Yt)&>(It,Jt,Yt?rr:Ft&&Ot[Jt]||rr,Kt)}},ar=function(Jt,rr,Yt){var Kt,nr;if(st){if(vt){if(Yt){for(Kt in $t)if(nr=lt[Kt],nr&&ut(nr,Jt))try{delete nr[Jt]}catch{}}if(!Ct[Jt]||Yt)try{return gt(Ct,Jt,Yt?rr:Ft&&Ct[Jt]||rr)}catch{}else return}for(Kt in $t)nr=lt[Kt],nr&&(!nr[Jt]||Yt)&>(nr,Jt,rr)}};for(Nt in $t)Mt=lt[Nt],Lt=Mt&&Mt.prototype,Lt?Et(Lt)[Ht]=Mt:Ft=!1;for(Nt in Tt)Mt=lt[Nt],Lt=Mt&&Mt.prototype,Lt&&(Et(Lt)[Ht]=Mt);if((!Ft||!et(Ct)||Ct===Function.prototype)&&(Ct=function(){throw Rt("Incorrect invocation")},Ft))for(Nt in $t)lt[Nt]&&vt(lt[Nt],Ct);if((!Ft||!It||It===yt)&&(It=Ct.prototype,Ft))for(Nt in $t)lt[Nt]&&vt(lt[Nt].prototype,It);if(Ft&&ct(wt)!==It&&vt(wt,It),st&&!ut(It,kt)){_t=!0,pt(It,kt,{configurable:!0,get:function(){return it(this)?this[jt]:void 0}});for(Nt in $t)lt[Nt]&&dt(lt[Nt],jt,Nt)}nt.exports={NATIVE_ARRAY_BUFFER_VIEWS:Ft,TYPED_ARRAY_TAG:_t&&jt,aTypedArray:Qt,aTypedArrayConstructor:qt,exportTypedArrayMethod:Zt,exportTypedArrayStaticMethod:ar,getTypedArrayConstructor:Ut,isView:Dt,isTypedArray:Vt,TypedArray:Ct,TypedArrayPrototype:It}},nt=>{nt.exports=typeof ArrayBuffer<"u"&&typeof DataView<"u"},(nt,at,ot)=>{var rt=ot(49),st=ot(45);nt.exports=function(lt,et,it){return it.get&&rt(it.get,et,{getter:!0}),it.set&&rt(it.set,et,{setter:!0}),st.f(lt,et,it)}},(nt,at,ot)=>{var rt=ot(39),st=ot(21),lt=ot(40),et=ot(54),it=ot(89),ut=et("IE_PROTO"),ft=Object,ht=ft.prototype;nt.exports=it?ft.getPrototypeOf:function(dt){var gt=lt(dt);if(rt(gt,ut))return gt[ut];var pt=gt.constructor;return st(pt)&> instanceof pt?pt.prototype:gt instanceof ft?ht:null}},(nt,at,ot)=>{var rt=ot(7);nt.exports=!rt(function(){function st(){}return st.prototype.constructor=null,Object.getPrototypeOf(new st)!==st.prototype})},(nt,at,ot)=>{var rt=ot(91),st=ot(13),lt=ot(40),et=ot(64),it=function(ut){var ft=ut===1;return function(ht,dt,gt){for(var pt=lt(ht),mt=st(pt),ct=rt(dt,gt),vt=et(mt),At,xt;vt-- >0;)if(At=mt[vt],xt=ct(At,vt,pt),xt)switch(ut){case 0:return At;case 1:return vt}return ft?-1:void 0}};nt.exports={findLast:it(0),findLastIndex:it(1)}},(nt,at,ot)=>{var rt=ot(92),st=ot(31),lt=ot(9),et=rt(rt.bind);nt.exports=function(it,ut){return st(it),ut===void 0?it:lt?et(it,ut):function(){return it.apply(ut,arguments)}}},(nt,at,ot)=>{var rt=ot(15),st=ot(14);nt.exports=function(lt){if(rt(lt)==="Function")return st(lt)}},(nt,at,ot)=>{var rt=ot(85),st=ot(90).findLastIndex,lt=rt.aTypedArray,et=rt.exportTypedArrayMethod;et("findLastIndex",function(ut){return st(lt(this),ut,arguments.length>1?arguments[1]:void 0)})},(nt,at,ot)=>{var rt=ot(4),st=ot(8),lt=ot(85),et=ot(64),it=ot(95),ut=ot(40),ft=ot(7),ht=rt.RangeError,dt=rt.Int8Array,gt=dt&&dt.prototype,pt=gt&>.set,mt=lt.aTypedArray,ct=lt.exportTypedArrayMethod,vt=!ft(function(){var xt=new Uint8ClampedArray(2);return st(pt,xt,{length:1,0:3},1),xt[1]!==3}),At=vt&<.NATIVE_ARRAY_BUFFER_VIEWS&&ft(function(){var xt=new dt(2);return xt.set(1),xt.set("2",1),xt[0]!==0||xt[1]!==2});ct("set",function(bt){mt(this);var Et=it(arguments.length>1?arguments[1]:void 0,1),St=ut(bt);if(vt)return st(pt,this,St,Et);var Bt=this.length,Ot=et(St),Pt=0;if(Ot+Et>Bt)throw ht("Wrong length");for(;Pt<Ot;)this[Et+Pt]=St[Pt++]},!vt||At)},(nt,at,ot)=>{var rt=ot(96),st=RangeError;nt.exports=function(lt,et){var it=rt(lt);if(it%et)throw st("Wrong offset");return it}},(nt,at,ot)=>{var rt=ot(62),st=RangeError;nt.exports=function(lt){var et=rt(lt);if(et<0)throw st("The argument can't be less than 0");return et}},(nt,at,ot)=>{var rt=ot(98),st=ot(85),lt=st.aTypedArray,et=st.exportTypedArrayMethod,it=st.getTypedArrayConstructor;et("toReversed",function(){return rt(lt(this),it(this))})},(nt,at,ot)=>{var rt=ot(64);nt.exports=function(st,lt){for(var et=rt(st),it=new lt(et),ut=0;ut<et;ut++)it[ut]=st[et-ut-1];return it}},(nt,at,ot)=>{var rt=ot(85),st=ot(14),lt=ot(31),et=ot(100),it=rt.aTypedArray,ut=rt.getTypedArrayConstructor,ft=rt.exportTypedArrayMethod,ht=st(rt.TypedArrayPrototype.sort);ft("toSorted",function(gt){gt!==void 0&<(gt);var pt=it(this),mt=et(ut(pt),pt);return ht(mt,gt)})},(nt,at,ot)=>{var rt=ot(64);nt.exports=function(st,lt){for(var et=0,it=rt(lt),ut=new st(it);it>et;)ut[et]=lt[et++];return ut}},(nt,at,ot)=>{var rt=ot(102),st=ot(85),lt=ot(103),et=ot(62),it=ot(104),ut=st.aTypedArray,ft=st.getTypedArrayConstructor,ht=st.exportTypedArrayMethod,dt=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(gt){return gt===8}}();ht("with",function(gt,pt){var mt=ut(this),ct=et(gt),vt=lt(mt)?it(pt):+pt;return rt(mt,ft(mt),ct,vt)},!dt)},(nt,at,ot)=>{var rt=ot(64),st=ot(62),lt=RangeError;nt.exports=function(et,it,ut,ft){var ht=rt(et),dt=st(ut),gt=dt<0?ht+dt:dt;if(gt>=ht||gt<0)throw lt("Incorrect index");for(var pt=new it(ht),mt=0;mt<ht;mt++)pt[mt]=mt===gt?ft:et[mt];return pt}},(nt,at,ot)=>{var rt=ot(78);nt.exports=function(st){var lt=rt(st);return lt==="BigInt64Array"||lt==="BigUint64Array"}},(nt,at,ot)=>{var rt=ot(19),st=TypeError;nt.exports=function(lt){var et=rt(lt,"number");if(typeof et=="number")throw st("Can't convert number to bigint");return BigInt(et)}},(nt,at,ot)=>{var rt=ot(6),st=ot(87),lt=ot(106),et=ArrayBuffer.prototype;rt&&!("detached"in et)&&st(et,"detached",{configurable:!0,get:function(){return lt(this)}})},(nt,at,ot)=>{var rt=ot(14),st=ot(107),lt=rt(ArrayBuffer.prototype.slice);nt.exports=function(et){if(st(et)!==0)return!1;try{return lt(et,0,0),!1}catch{return!0}}},(nt,at,ot)=>{var rt=ot(72),st=ot(15),lt=TypeError;nt.exports=rt(ArrayBuffer.prototype,"byteLength","get")||function(et){if(st(et)!=="ArrayBuffer")throw lt("ArrayBuffer expected");return et.byteLength}},(nt,at,ot)=>{var rt=ot(3),st=ot(109);st&&rt({target:"ArrayBuffer",proto:!0},{transfer:function(){return st(this,arguments.length?arguments[0]:void 0,!0)}})},(nt,at,ot)=>{var rt=ot(4),st=ot(14),lt=ot(72),et=ot(110),it=ot(106),ut=ot(107),ft=ot(111),ht=rt.TypeError,dt=rt.structuredClone,gt=rt.ArrayBuffer,pt=rt.DataView,mt=Math.min,ct=gt.prototype,vt=pt.prototype,At=st(ct.slice),xt=lt(ct,"resizable","get"),bt=lt(ct,"maxByteLength","get"),Et=st(vt.getInt8),St=st(vt.setInt8);nt.exports=ft&&function(Bt,Ot,Pt){var wt=ut(Bt),Ct=Ot===void 0?wt:et(Ot),It=!xt||!xt(Bt);if(it(Bt))throw ht("ArrayBuffer is detached");var yt=dt(Bt,{transfer:[Bt]});if(wt===Ct&&(Pt||It))return yt;if(wt>=Ct&&(!Pt||It))return At(yt,0,Ct);for(var Rt=Pt&&!It&&bt?{maxByteLength:bt(yt)}:void 0,kt=new gt(Ct,Rt),jt=new pt(yt),Ht=new pt(kt),Ft=mt(Ct,wt),_t=0;_t<Ft;_t++)St(Ht,_t,Et(jt,_t));return kt}},(nt,at,ot)=>{var rt=ot(62),st=ot(65),lt=RangeError;nt.exports=function(et){if(et===void 0)return 0;var it=rt(et),ut=st(it);if(it!==ut)throw lt("Wrong length or index");return ut}},(nt,at,ot)=>{var rt=ot(4),st=ot(7),lt=ot(28),et=ot(112),it=ot(113),ut=ot(114),ft=rt.structuredClone;nt.exports=!!ft&&!st(function(){if(it&<>92||ut&<>94||et&<>97)return!1;var ht=new ArrayBuffer(8),dt=ft(ht,{transfer:[ht]});return ht.byteLength!==0||dt.byteLength!==8})},(nt,at,ot)=>{var rt=ot(113),st=ot(114);nt.exports=!rt&&!st&&typeof window=="object"&&typeof document=="object"},nt=>{nt.exports=typeof Deno=="object"&&Deno&&typeof Deno.version=="object"},(nt,at,ot)=>{var rt=ot(4),st=ot(15);nt.exports=st(rt.process)==="process"},(nt,at,ot)=>{var rt=ot(3),st=ot(109);st&&rt({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return st(this,arguments.length?arguments[0]:void 0,!1)}})},(nt,at,ot)=>{var rt=ot(3),st=ot(117),lt=ot(126);rt({target:"Set",proto:!0,real:!0,forced:!lt("difference")},{difference:st})},(nt,at,ot)=>{var rt=ot(118),st=ot(119),lt=ot(120),et=ot(123),it=ot(124),ut=ot(121),ft=ot(122),ht=st.has,dt=st.remove;nt.exports=function(pt){var mt=rt(this),ct=it(pt),vt=lt(mt);return et(mt)<=ct.size?ut(mt,function(At){ct.includes(At)&&dt(vt,At)}):ft(ct.getIterator(),function(At){ht(mt,At)&&dt(vt,At)}),vt}},(nt,at,ot)=>{var rt=ot(119).has;nt.exports=function(st){return rt(st),st}},(nt,at,ot)=>{var rt=ot(14),st=Set.prototype;nt.exports={Set,add:rt(st.add),has:rt(st.has),remove:rt(st.delete),proto:st}},(nt,at,ot)=>{var rt=ot(119),st=ot(121),lt=rt.Set,et=rt.add;nt.exports=function(it){var ut=new lt;return st(it,function(ft){et(ut,ft)}),ut}},(nt,at,ot)=>{var rt=ot(14),st=ot(122),lt=ot(119),et=lt.Set,it=lt.proto,ut=rt(it.forEach),ft=rt(it.keys),ht=ft(new et).next;nt.exports=function(dt,gt,pt){return pt?st({iterator:ft(dt),next:ht},gt):ut(dt,gt)}},(nt,at,ot)=>{var rt=ot(8);nt.exports=function(st,lt,et){for(var it=et?st:st.iterator,ut=st.next,ft,ht;!(ft=rt(ut,it)).done;)if(ht=lt(ft.value),ht!==void 0)return ht}},(nt,at,ot)=>{var rt=ot(72),st=ot(119);nt.exports=rt(st.proto,"size","get")||function(lt){return lt.size}},(nt,at,ot)=>{var rt=ot(31),st=ot(47),lt=ot(8),et=ot(62),it=ot(125),ut="Invalid size",ft=RangeError,ht=TypeError,dt=Math.max,gt=function(pt,mt,ct,vt){this.set=pt,this.size=mt,this.has=ct,this.keys=vt};gt.prototype={getIterator:function(){return it(st(lt(this.keys,this.set)))},includes:function(pt){return lt(this.has,this.set,pt)}},nt.exports=function(pt){st(pt);var mt=+pt.size;if(mt!==mt)throw ht(ut);var ct=et(mt);if(ct<0)throw ft(ut);return new gt(pt,dt(ct,0),rt(pt.has),rt(pt.keys))}},nt=>{nt.exports=function(at){return{iterator:at,next:at.next,done:!1}}},(nt,at,ot)=>{var rt=ot(24),st=function(lt){return{size:lt,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};nt.exports=function(lt){var et=rt("Set");try{new et()[lt](st(0));try{return new et()[lt](st(-1)),!1}catch{return!0}}catch{return!1}}},(nt,at,ot)=>{var rt=ot(3),st=ot(7),lt=ot(128),et=ot(126),it=!et("intersection")||st(function(){return Array.from(new Set([1,2,3]).intersection(new Set([3,2])))!=="3,2"});rt({target:"Set",proto:!0,real:!0,forced:it},{intersection:lt})},(nt,at,ot)=>{var rt=ot(118),st=ot(119),lt=ot(123),et=ot(124),it=ot(121),ut=ot(122),ft=st.Set,ht=st.add,dt=st.has;nt.exports=function(pt){var mt=rt(this),ct=et(pt),vt=new ft;return lt(mt)>ct.size?ut(ct.getIterator(),function(At){dt(mt,At)&&ht(vt,At)}):it(mt,function(At){ct.includes(At)&&ht(vt,At)}),vt}},(nt,at,ot)=>{var rt=ot(3),st=ot(130),lt=ot(126);rt({target:"Set",proto:!0,real:!0,forced:!lt("isDisjointFrom")},{isDisjointFrom:st})},(nt,at,ot)=>{var rt=ot(118),st=ot(119).has,lt=ot(123),et=ot(124),it=ot(121),ut=ot(122),ft=ot(131);nt.exports=function(dt){var gt=rt(this),pt=et(dt);if(lt(gt)<=pt.size)return it(gt,function(ct){if(pt.includes(ct))return!1},!0)!==!1;var mt=pt.getIterator();return ut(mt,function(ct){if(st(gt,ct))return ft(mt,"normal",!1)})!==!1}},(nt,at,ot)=>{var rt=ot(8),st=ot(47),lt=ot(30);nt.exports=function(et,it,ut){var ft,ht;st(et);try{if(ft=lt(et,"return"),!ft){if(it==="throw")throw ut;return ut}ft=rt(ft,et)}catch(dt){ht=!0,ft=dt}if(it==="throw")throw ut;if(ht)throw ft;return st(ft),ut}},(nt,at,ot)=>{var rt=ot(3),st=ot(133),lt=ot(126);rt({target:"Set",proto:!0,real:!0,forced:!lt("isSubsetOf")},{isSubsetOf:st})},(nt,at,ot)=>{var rt=ot(118),st=ot(123),lt=ot(121),et=ot(124);nt.exports=function(ut){var ft=rt(this),ht=et(ut);return st(ft)>ht.size?!1:lt(ft,function(dt){if(!ht.includes(dt))return!1},!0)!==!1}},(nt,at,ot)=>{var rt=ot(3),st=ot(135),lt=ot(126);rt({target:"Set",proto:!0,real:!0,forced:!lt("isSupersetOf")},{isSupersetOf:st})},(nt,at,ot)=>{var rt=ot(118),st=ot(119).has,lt=ot(123),et=ot(124),it=ot(122),ut=ot(131);nt.exports=function(ht){var dt=rt(this),gt=et(ht);if(lt(dt)<gt.size)return!1;var pt=gt.getIterator();return it(pt,function(mt){if(!st(dt,mt))return ut(pt,"normal",!1)})!==!1}},(nt,at,ot)=>{var rt=ot(3),st=ot(137),lt=ot(126);rt({target:"Set",proto:!0,real:!0,forced:!lt("symmetricDifference")},{symmetricDifference:st})},(nt,at,ot)=>{var rt=ot(118),st=ot(119),lt=ot(120),et=ot(124),it=ot(122),ut=st.add,ft=st.has,ht=st.remove;nt.exports=function(gt){var pt=rt(this),mt=et(gt).getIterator(),ct=lt(pt);return it(mt,function(vt){ft(pt,vt)?ht(ct,vt):ut(ct,vt)}),ct}},(nt,at,ot)=>{var rt=ot(3),st=ot(139),lt=ot(126);rt({target:"Set",proto:!0,real:!0,forced:!lt("union")},{union:st})},(nt,at,ot)=>{var rt=ot(118),st=ot(119).add,lt=ot(120),et=ot(124),it=ot(122);nt.exports=function(ft){var ht=rt(this),dt=et(ft).getIterator(),gt=lt(ht);return it(dt,function(pt){st(gt,pt)}),gt}},(nt,at,ot)=>{var rt=ot(3),st=ot(40),lt=ot(64),et=ot(141),it=ot(143),ut=ot(7),ft=ut(function(){return[].push.call({length:4294967296},1)!==4294967297}),ht=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(gt){return gt instanceof TypeError}},dt=ft||!ht();rt({target:"Array",proto:!0,arity:1,forced:dt},{push:function(pt){var mt=st(this),ct=lt(mt),vt=arguments.length;it(ct+vt);for(var At=0;At<vt;At++)mt[ct]=arguments[At],ct++;return et(mt,ct),ct}})},(nt,at,ot)=>{var rt=ot(6),st=ot(142),lt=TypeError,et=Object.getOwnPropertyDescriptor,it=rt&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(ut){return ut instanceof TypeError}}();nt.exports=it?function(ut,ft){if(st(ut)&&!et(ut,"length").writable)throw lt("Cannot set read only .length");return ut.length=ft}:function(ut,ft){return ut.length=ft}},(nt,at,ot)=>{var rt=ot(15);nt.exports=Array.isArray||function(lt){return rt(lt)==="Array"}},nt=>{var at=TypeError,ot=9007199254740991;nt.exports=function(rt){if(rt>ot)throw at("Maximum allowed index exceeded");return rt}},(nt,at,ot)=>{var rt=ot(3),st=ot(4),lt=ot(87),et=ot(6),it=TypeError,ut=Object.defineProperty,ft=st.self!==st;try{if(et){var ht=Object.getOwnPropertyDescriptor(st,"self");(ft||!ht||!ht.get||!ht.enumerable)&<(st,"self",{get:function(){return st},set:function(gt){if(this!==st)throw it("Illegal invocation");ut(st,"self",{value:gt,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}else rt({global:!0,simple:!0,forced:ft},{self:st})}catch{}},(nt,at,ot)=>{var Ir;Object.defineProperty(at,"__esModule",{value:!0}),at.VerbosityLevel=at.Util=at.UnknownErrorException=at.UnexpectedResponseException=at.TextRenderingMode=at.RenderingIntentFlag=at.PromiseCapability=at.PermissionFlag=at.PasswordResponses=at.PasswordException=at.PageActionEventType=at.OPS=at.MissingPDFException=at.MAX_IMAGE_SIZE_TO_CACHE=at.LINE_FACTOR=at.LINE_DESCENT_FACTOR=at.InvalidPDFException=at.ImageKind=at.IDENTITY_MATRIX=at.FormatError=at.FeatureTest=at.FONT_IDENTITY_MATRIX=at.DocumentActionEventType=at.CMapCompressionType=at.BaseException=at.BASELINE_FACTOR=at.AnnotationType=at.AnnotationReplyType=at.AnnotationPrefix=at.AnnotationMode=at.AnnotationFlag=at.AnnotationFieldFlag=at.AnnotationEditorType=at.AnnotationEditorPrefix=at.AnnotationEditorParamsType=at.AnnotationBorderStyleType=at.AnnotationActionEventType=at.AbortException=void 0,at.assert=Mt,at.bytesToString=rr,at.createValidAbsoluteUrl=$t,at.getModificationDate=yr,at.getUuid=Sr,at.getVerbosityLevel=Ht,at.info=Ft,at.isArrayBuffer=ur,at.isArrayEqual=pr,at.isNodeJS=void 0,at.normalizeUnicode=Ar,at.objectFromMap=tr,at.objectSize=nr,at.setVerbosityLevel=jt,at.shadow=Tt,at.string32=Kt,at.stringToBytes=Yt,at.stringToPDFString=Wt,at.stringToUTF8String=er,at.unreachable=Nt,at.utf8StringToString=lr,at.warn=_t,ot(2),ot(146),ot(148),ot(149),ot(140),ot(84),ot(93),ot(94),ot(97),ot(99),ot(101),ot(105),ot(108),ot(115);const rt=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");at.isNodeJS=rt;const st=[1,0,0,1,0,0];at.IDENTITY_MATRIX=st;const lt=[.001,0,0,.001,0,0];at.FONT_IDENTITY_MATRIX=lt;const et=1e7;at.MAX_IMAGE_SIZE_TO_CACHE=et;const it=1.35;at.LINE_FACTOR=it;const ut=.35;at.LINE_DESCENT_FACTOR=ut;const ft=ut/it;at.BASELINE_FACTOR=ft;const ht={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};at.RenderingIntentFlag=ht;const dt={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};at.AnnotationMode=dt;const gt="pdfjs_internal_editor_";at.AnnotationEditorPrefix=gt;const pt={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15};at.AnnotationEditorType=pt;const mt={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23};at.AnnotationEditorParamsType=mt;const ct={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};at.PermissionFlag=ct;const vt={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};at.TextRenderingMode=vt;const At={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};at.ImageKind=At;const xt={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};at.AnnotationType=xt;const bt={GROUP:"Group",REPLY:"R"};at.AnnotationReplyType=bt;const Et={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};at.AnnotationFlag=Et;const St={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};at.AnnotationFieldFlag=St;const Bt={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};at.AnnotationBorderStyleType=Bt;const Ot={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};at.AnnotationActionEventType=Ot;const Pt={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};at.DocumentActionEventType=Pt;const wt={O:"PageOpen",C:"PageClose"};at.PageActionEventType=wt;const Ct={ERRORS:0,WARNINGS:1,INFOS:5};at.VerbosityLevel=Ct;const It={NONE:0,BINARY:1};at.CMapCompressionType=It;const yt={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};at.OPS=yt;const Rt={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};at.PasswordResponses=Rt;let kt=Ct.WARNINGS;function jt(hr){Number.isInteger(hr)&&(kt=hr)}function Ht(){return kt}function Ft(hr){kt>=Ct.INFOS&&console.log(`Info: ${hr}`)}function _t(hr){kt>=Ct.WARNINGS&&console.log(`Warning: ${hr}`)}function Nt(hr){throw new Error(hr)}function Mt(hr,vr){hr||Nt(vr)}function Lt(hr){switch(hr==null?void 0:hr.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function $t(hr){let vr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,xr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!hr)return null;try{if(xr&&typeof hr=="string"){if(xr.addDefaultProtocol&&hr.startsWith("www.")){const Rr=hr.match(/\./g);(Rr==null?void 0:Rr.length)>=2&&(hr=`http://${hr}`)}if(xr.tryConvertEncoding)try{hr=er(hr)}catch{}}const Pr=vr?new URL(hr,vr):new URL(hr);if(Lt(Pr))return Pr}catch{}return null}function Tt(hr,vr,xr){let Pr=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return Object.defineProperty(hr,vr,{value:xr,enumerable:!Pr,configurable:!0,writable:!1}),xr}const Dt=function(){function vr(xr,Pr){this.constructor===vr&&Nt("Cannot initialize BaseException."),this.message=xr,this.name=Pr}return vr.prototype=new Error,vr.constructor=vr,vr}();at.BaseException=Dt;class Ut extends Dt{constructor(vr,xr){super(vr,"PasswordException"),this.code=xr}}at.PasswordException=Ut;class Vt extends Dt{constructor(vr,xr){super(vr,"UnknownErrorException"),this.details=xr}}at.UnknownErrorException=Vt;class Qt extends Dt{constructor(vr){super(vr,"InvalidPDFException")}}at.InvalidPDFException=Qt;class qt extends Dt{constructor(vr){super(vr,"MissingPDFException")}}at.MissingPDFException=qt;class Zt extends Dt{constructor(vr,xr){super(vr,"UnexpectedResponseException"),this.status=xr}}at.UnexpectedResponseException=Zt;class ar extends Dt{constructor(vr){super(vr,"FormatError")}}at.FormatError=ar;class Jt extends Dt{constructor(vr){super(vr,"AbortException")}}at.AbortException=Jt;function rr(hr){(typeof hr!="object"||(hr==null?void 0:hr.length)===void 0)&&Nt("Invalid argument for bytesToString");const vr=hr.length,xr=8192;if(vr<xr)return String.fromCharCode.apply(null,hr);const Pr=[];for(let Rr=0;Rr<vr;Rr+=xr){const Dr=Math.min(Rr+xr,vr),Gr=hr.subarray(Rr,Dr);Pr.push(String.fromCharCode.apply(null,Gr))}return Pr.join("")}function Yt(hr){typeof hr!="string"&&Nt("Invalid argument for stringToBytes");const vr=hr.length,xr=new Uint8Array(vr);for(let Pr=0;Pr<vr;++Pr)xr[Pr]=hr.charCodeAt(Pr)&255;return xr}function Kt(hr){return String.fromCharCode(hr>>24&255,hr>>16&255,hr>>8&255,hr&255)}function nr(hr){return Object.keys(hr).length}function tr(hr){const vr=Object.create(null);for(const[xr,Pr]of hr)vr[xr]=Pr;return vr}function ir(){const hr=new Uint8Array(4);return hr[0]=1,new Uint32Array(hr.buffer,0,1)[0]===1}function sr(){try{return new Function(""),!0}catch{return!1}}class cr{static get isLittleEndian(){return Tt(this,"isLittleEndian",ir())}static get isEvalSupported(){return Tt(this,"isEvalSupported",sr())}static get isOffscreenCanvasSupported(){return Tt(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator>"u"?Tt(this,"platform",{isWin:!1,isMac:!1}):Tt(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}static get isCSSRoundSupported(){var vr,xr;return Tt(this,"isCSSRoundSupported",(xr=(vr=globalThis.CSS)==null?void 0:vr.supports)==null?void 0:xr.call(vr,"width: round(1.5px, 1px)"))}}at.FeatureTest=cr;const or=[...Array(256).keys()].map(hr=>hr.toString(16).padStart(2,"0"));class Xt{static makeHexColor(vr,xr,Pr){return`#${or[vr]}${or[xr]}${or[Pr]}`}static scaleMinMax(vr,xr){let Pr;vr[0]?(vr[0]<0&&(Pr=xr[0],xr[0]=xr[1],xr[1]=Pr),xr[0]*=vr[0],xr[1]*=vr[0],vr[3]<0&&(Pr=xr[2],xr[2]=xr[3],xr[3]=Pr),xr[2]*=vr[3],xr[3]*=vr[3]):(Pr=xr[0],xr[0]=xr[2],xr[2]=Pr,Pr=xr[1],xr[1]=xr[3],xr[3]=Pr,vr[1]<0&&(Pr=xr[2],xr[2]=xr[3],xr[3]=Pr),xr[2]*=vr[1],xr[3]*=vr[1],vr[2]<0&&(Pr=xr[0],xr[0]=xr[1],xr[1]=Pr),xr[0]*=vr[2],xr[1]*=vr[2]),xr[0]+=vr[4],xr[1]+=vr[4],xr[2]+=vr[5],xr[3]+=vr[5]}static transform(vr,xr){return[vr[0]*xr[0]+vr[2]*xr[1],vr[1]*xr[0]+vr[3]*xr[1],vr[0]*xr[2]+vr[2]*xr[3],vr[1]*xr[2]+vr[3]*xr[3],vr[0]*xr[4]+vr[2]*xr[5]+vr[4],vr[1]*xr[4]+vr[3]*xr[5]+vr[5]]}static applyTransform(vr,xr){const Pr=vr[0]*xr[0]+vr[1]*xr[2]+xr[4],Rr=vr[0]*xr[1]+vr[1]*xr[3]+xr[5];return[Pr,Rr]}static applyInverseTransform(vr,xr){const Pr=xr[0]*xr[3]-xr[1]*xr[2],Rr=(vr[0]*xr[3]-vr[1]*xr[2]+xr[2]*xr[5]-xr[4]*xr[3])/Pr,Dr=(-vr[0]*xr[1]+vr[1]*xr[0]+xr[4]*xr[1]-xr[5]*xr[0])/Pr;return[Rr,Dr]}static getAxialAlignedBoundingBox(vr,xr){const Pr=this.applyTransform(vr,xr),Rr=this.applyTransform(vr.slice(2,4),xr),Dr=this.applyTransform([vr[0],vr[3]],xr),Gr=this.applyTransform([vr[2],vr[1]],xr);return[Math.min(Pr[0],Rr[0],Dr[0],Gr[0]),Math.min(Pr[1],Rr[1],Dr[1],Gr[1]),Math.max(Pr[0],Rr[0],Dr[0],Gr[0]),Math.max(Pr[1],Rr[1],Dr[1],Gr[1])]}static inverseTransform(vr){const xr=vr[0]*vr[3]-vr[1]*vr[2];return[vr[3]/xr,-vr[1]/xr,-vr[2]/xr,vr[0]/xr,(vr[2]*vr[5]-vr[4]*vr[3])/xr,(vr[4]*vr[1]-vr[5]*vr[0])/xr]}static singularValueDecompose2dScale(vr){const xr=[vr[0],vr[2],vr[1],vr[3]],Pr=vr[0]*xr[0]+vr[1]*xr[2],Rr=vr[0]*xr[1]+vr[1]*xr[3],Dr=vr[2]*xr[0]+vr[3]*xr[2],Gr=vr[2]*xr[1]+vr[3]*xr[3],Or=(Pr+Gr)/2,Hr=Math.sqrt((Pr+Gr)**2-4*(Pr*Gr-Dr*Rr))/2,jr=Or+Hr||1,Tr=Or-Hr||1;return[Math.sqrt(jr),Math.sqrt(Tr)]}static normalizeRect(vr){const xr=vr.slice(0);return vr[0]>vr[2]&&(xr[0]=vr[2],xr[2]=vr[0]),vr[1]>vr[3]&&(xr[1]=vr[3],xr[3]=vr[1]),xr}static intersect(vr,xr){const Pr=Math.max(Math.min(vr[0],vr[2]),Math.min(xr[0],xr[2])),Rr=Math.min(Math.max(vr[0],vr[2]),Math.max(xr[0],xr[2]));if(Pr>Rr)return null;const Dr=Math.max(Math.min(vr[1],vr[3]),Math.min(xr[1],xr[3])),Gr=Math.min(Math.max(vr[1],vr[3]),Math.max(xr[1],xr[3]));return Dr>Gr?null:[Pr,Dr,Rr,Gr]}static bezierBoundingBox(vr,xr,Pr,Rr,Dr,Gr,Or,Hr){const jr=[],Tr=[[],[]];let fr,Cr,$r,wr,Mr,Fr,Qr,Yr;for(let zr=0;zr<2;++zr){if(zr===0?(Cr=6*vr-12*Pr+6*Dr,fr=-3*vr+9*Pr-9*Dr+3*Or,$r=3*Pr-3*vr):(Cr=6*xr-12*Rr+6*Gr,fr=-3*xr+9*Rr-9*Gr+3*Hr,$r=3*Rr-3*xr),Math.abs(fr)<1e-12){if(Math.abs(Cr)<1e-12)continue;wr=-$r/Cr,0<wr&&wr<1&&jr.push(wr);continue}Qr=Cr*Cr-4*$r*fr,Yr=Math.sqrt(Qr),!(Qr<0)&&(Mr=(-Cr+Yr)/(2*fr),0<Mr&&Mr<1&&jr.push(Mr),Fr=(-Cr-Yr)/(2*fr),0<Fr&&Fr<1&&jr.push(Fr))}let kr=jr.length,Nr;const Lr=kr;for(;kr--;)wr=jr[kr],Nr=1-wr,Tr[0][kr]=Nr*Nr*Nr*vr+3*Nr*Nr*wr*Pr+3*Nr*wr*wr*Dr+wr*wr*wr*Or,Tr[1][kr]=Nr*Nr*Nr*xr+3*Nr*Nr*wr*Rr+3*Nr*wr*wr*Gr+wr*wr*wr*Hr;return Tr[0][Lr]=vr,Tr[1][Lr]=xr,Tr[0][Lr+1]=Or,Tr[1][Lr+1]=Hr,Tr[0].length=Tr[1].length=Lr+2,[Math.min(...Tr[0]),Math.min(...Tr[1]),Math.max(...Tr[0]),Math.max(...Tr[1])]}}at.Util=Xt;const Gt=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function Wt(hr){if(hr[0]>="ï"){let xr;if(hr[0]==="þ"&&hr[1]==="ÿ"?xr="utf-16be":hr[0]==="ÿ"&&hr[1]==="þ"?xr="utf-16le":hr[0]==="ï"&&hr[1]==="»"&&hr[2]==="¿"&&(xr="utf-8"),xr)try{const Pr=new TextDecoder(xr,{fatal:!0}),Rr=Yt(hr);return Pr.decode(Rr)}catch(Pr){_t(`stringToPDFString: "${Pr}".`)}}const vr=[];for(let xr=0,Pr=hr.length;xr<Pr;xr++){const Rr=Gt[hr.charCodeAt(xr)];vr.push(Rr?String.fromCharCode(Rr):hr.charAt(xr))}return vr.join("")}function er(hr){return decodeURIComponent(escape(hr))}function lr(hr){return unescape(encodeURIComponent(hr))}function ur(hr){return typeof hr=="object"&&(hr==null?void 0:hr.byteLength)!==void 0}function pr(hr,vr){if(hr.length!==vr.length)return!1;for(let xr=0,Pr=hr.length;xr<Pr;xr++)if(hr[xr]!==vr[xr])return!1;return!0}function yr(){let hr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Date;return[hr.getUTCFullYear().toString(),(hr.getUTCMonth()+1).toString().padStart(2,"0"),hr.getUTCDate().toString().padStart(2,"0"),hr.getUTCHours().toString().padStart(2,"0"),hr.getUTCMinutes().toString().padStart(2,"0"),hr.getUTCSeconds().toString().padStart(2,"0")].join("")}class Er{constructor(){_r(this,Ir,!1);this.promise=new Promise((vr,xr)=>{this.resolve=Pr=>{tn(this,Ir,!0),vr(Pr)},this.reject=Pr=>{tn(this,Ir,!0),xr(Pr)}})}get settled(){return mr(this,Ir)}}Ir=new WeakMap,at.PromiseCapability=Er;let br=null,gr=null;function Ar(hr){return br||(br=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,gr=new Map([["ſt","ſt"]])),hr.replaceAll(br,(vr,xr,Pr)=>xr?xr.normalize("NFKC"):gr.get(Pr))}function Sr(){if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.randomUUID)=="function")return crypto.randomUUID();const hr=new Uint8Array(32);if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.getRandomValues)=="function")crypto.getRandomValues(hr);else for(let vr=0;vr<32;vr++)hr[vr]=Math.floor(Math.random()*255);return rr(hr)}const Br="pdfjs_internal_id_";at.AnnotationPrefix=Br},(nt,at,ot)=>{var rt=ot(48),st=ot(14),lt=ot(77),et=ot(147),it=URLSearchParams,ut=it.prototype,ft=st(ut.append),ht=st(ut.delete),dt=st(ut.forEach),gt=st([].push),pt=new it("a=1&a=2&b=3");pt.delete("a",1),pt.delete("b",void 0),pt+""!="a=2"&&rt(ut,"delete",function(mt){var ct=arguments.length,vt=ct<2?void 0:arguments[1];if(ct&&vt===void 0)return ht(this,mt);var At=[];dt(this,function(wt,Ct){gt(At,{key:Ct,value:wt})}),et(ct,1);for(var xt=lt(mt),bt=lt(vt),Et=0,St=0,Bt=!1,Ot=At.length,Pt;Et<Ot;)Pt=At[Et++],Bt||Pt.key===xt?(Bt=!0,ht(this,Pt.key)):St++;for(;St<Ot;)Pt=At[St++],Pt.key===xt&&Pt.value===bt||ft(this,Pt.key,Pt.value)},{enumerable:!0,unsafe:!0})},nt=>{var at=TypeError;nt.exports=function(ot,rt){if(ot<rt)throw at("Not enough arguments");return ot}},(nt,at,ot)=>{var rt=ot(48),st=ot(14),lt=ot(77),et=ot(147),it=URLSearchParams,ut=it.prototype,ft=st(ut.getAll),ht=st(ut.has),dt=new it("a=1");(dt.has("a",2)||!dt.has("a",void 0))&&rt(ut,"has",function(pt){var mt=arguments.length,ct=mt<2?void 0:arguments[1];if(mt&&ct===void 0)return ht(this,pt);var vt=ft(this,pt);et(mt,1);for(var At=lt(ct),xt=0;xt<vt.length;)if(vt[xt++]===At)return!0;return!1},{enumerable:!0,unsafe:!0})},(nt,at,ot)=>{var rt=ot(6),st=ot(14),lt=ot(87),et=URLSearchParams.prototype,it=st(et.forEach);rt&&!("size"in et)&<(et,"size",{get:function(){var ft=0;return it(this,function(){ft++}),ft},configurable:!0,enumerable:!0})},(nt,at,ot)=>{Object.defineProperty(at,"__esModule",{value:!0}),at.XRefParseException=at.XRefEntryException=at.ParserEOFException=at.PDF_VERSION_REGEXP=at.MissingDataException=void 0,at.arrayBuffersToBytes=gt,at.collectActions=wt,at.encodeToXmlString=It,at.escapePDFName=Bt,at.escapeString=Ot,at.getInheritableProperty=pt,at.getLookupTableFactory=it,at.getNewAnnotationsMap=Ht,at.getRotationMatrix=Mt,at.isAscii=Ft,at.isWhiteSpace=Et,at.log2=vt,at.numberToString=jt,at.parseXFAPath=St,at.readInt8=At,at.readUint16=xt,at.readUint32=bt,at.recoverJsURL=kt,at.stringToUTF16HexString=_t,at.stringToUTF16String=Nt,at.toRomanNumerals=ct,at.validateCSSFont=Rt,at.validateFontName=yt,ot(84),ot(93),ot(94),ot(97),ot(99),ot(101),ot(105),ot(108),ot(115),ot(140),ot(116),ot(127),ot(129),ot(132),ot(134),ot(136),ot(138),ot(2);var rt=ot(145),st=ot(151),lt=ot(152);const et=/^[1-9]\.\d$/;at.PDF_VERSION_REGEXP=et;function it(Lt){let $t;return function(){return Lt&&($t=Object.create(null),Lt($t),Lt=null),$t}}class ut extends rt.BaseException{constructor($t,Tt){super(`Missing data [${$t}, ${Tt})`,"MissingDataException"),this.begin=$t,this.end=Tt}}at.MissingDataException=ut;class ft extends rt.BaseException{constructor($t){super($t,"ParserEOFException")}}at.ParserEOFException=ft;class ht extends rt.BaseException{constructor($t){super($t,"XRefEntryException")}}at.XRefEntryException=ht;class dt extends rt.BaseException{constructor($t){super($t,"XRefParseException")}}at.XRefParseException=dt;function gt(Lt){const $t=Lt.length;if($t===0)return new Uint8Array(0);if($t===1)return new Uint8Array(Lt[0]);let Tt=0;for(let Vt=0;Vt<$t;Vt++)Tt+=Lt[Vt].byteLength;const Dt=new Uint8Array(Tt);let Ut=0;for(let Vt=0;Vt<$t;Vt++){const Qt=new Uint8Array(Lt[Vt]);Dt.set(Qt,Ut),Ut+=Qt.byteLength}return Dt}function pt(Lt){let{dict:$t,key:Tt,getArray:Dt=!1,stopWhenFound:Ut=!0}=Lt,Vt;const Qt=new st.RefSet;for(;$t instanceof st.Dict&&!($t.objId&&Qt.has($t.objId));){$t.objId&&Qt.put($t.objId);const qt=Dt?$t.getArray(Tt):$t.get(Tt);if(qt!==void 0){if(Ut)return qt;(Vt||(Vt=[])).push(qt)}$t=$t.get("Parent")}return Vt}const mt=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"];function ct(Lt){let $t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;(0,rt.assert)(Number.isInteger(Lt)&&Lt>0,"The number should be a positive integer.");const Tt=[];let Dt;for(;Lt>=1e3;)Lt-=1e3,Tt.push("M");Dt=Lt/100|0,Lt%=100,Tt.push(mt[Dt]),Dt=Lt/10|0,Lt%=10,Tt.push(mt[10+Dt]),Tt.push(mt[20+Lt]);const Ut=Tt.join("");return $t?Ut.toLowerCase():Ut}function vt(Lt){return Lt<=0?0:Math.ceil(Math.log2(Lt))}function At(Lt,$t){return Lt[$t]<<24>>24}function xt(Lt,$t){return Lt[$t]<<8|Lt[$t+1]}function bt(Lt,$t){return(Lt[$t]<<24|Lt[$t+1]<<16|Lt[$t+2]<<8|Lt[$t+3])>>>0}function Et(Lt){return Lt===32||Lt===9||Lt===13||Lt===10}function St(Lt){const $t=/(.+)\[(\d+)\]$/;return Lt.split(".").map(Tt=>{const Dt=Tt.match($t);return Dt?{name:Dt[1],pos:parseInt(Dt[2],10)}:{name:Tt,pos:0}})}function Bt(Lt){const $t=[];let Tt=0;for(let Dt=0,Ut=Lt.length;Dt<Ut;Dt++){const Vt=Lt.charCodeAt(Dt);(Vt<33||Vt>126||Vt===35||Vt===40||Vt===41||Vt===60||Vt===62||Vt===91||Vt===93||Vt===123||Vt===125||Vt===47||Vt===37)&&(Tt<Dt&&$t.push(Lt.substring(Tt,Dt)),$t.push(`#${Vt.toString(16)}`),Tt=Dt+1)}return $t.length===0?Lt:(Tt<Lt.length&&$t.push(Lt.substring(Tt,Lt.length)),$t.join(""))}function Ot(Lt){return Lt.replaceAll(/([()\\\n\r])/g,$t=>$t===`
|
51
51
|
`?"\\n":$t==="\r"?"\\r":`\\${$t}`)}function Pt(Lt,$t,Tt,Dt){if(!Lt)return;let Ut=null;if(Lt instanceof st.Ref){if(Dt.has(Lt))return;Ut=Lt,Dt.put(Ut),Lt=$t.fetch(Lt)}if(Array.isArray(Lt))for(const Vt of Lt)Pt(Vt,$t,Tt,Dt);else if(Lt instanceof st.Dict){if((0,st.isName)(Lt.get("S"),"JavaScript")){const Vt=Lt.get("JS");let Qt;Vt instanceof lt.BaseStream?Qt=Vt.getString():typeof Vt=="string"&&(Qt=Vt),Qt&&(Qt=(0,rt.stringToPDFString)(Qt).replaceAll("\0","")),Qt&&Tt.push(Qt)}Pt(Lt.getRaw("Next"),$t,Tt,Dt)}Ut&&Dt.remove(Ut)}function wt(Lt,$t,Tt){const Dt=Object.create(null),Ut=pt({dict:$t,key:"AA",stopWhenFound:!1});if(Ut)for(let Vt=Ut.length-1;Vt>=0;Vt--){const Qt=Ut[Vt];if(Qt instanceof st.Dict)for(const qt of Qt.getKeys()){const Zt=Tt[qt];if(!Zt)continue;const ar=Qt.getRaw(qt),Jt=new st.RefSet,rr=[];Pt(ar,Lt,rr,Jt),rr.length>0&&(Dt[Zt]=rr)}}if($t.has("A")){const Vt=$t.get("A"),Qt=new st.RefSet,qt=[];Pt(Vt,Lt,qt,Qt),qt.length>0&&(Dt.Action=qt)}return(0,rt.objectSize)(Dt)>0?Dt:null}const Ct={60:"<",62:">",38:"&",34:""",39:"'"};function It(Lt){const $t=[];let Tt=0;for(let Dt=0,Ut=Lt.length;Dt<Ut;Dt++){const Vt=Lt.codePointAt(Dt);if(32<=Vt&&Vt<=126){const Qt=Ct[Vt];Qt&&(Tt<Dt&&$t.push(Lt.substring(Tt,Dt)),$t.push(Qt),Tt=Dt+1)}else Tt<Dt&&$t.push(Lt.substring(Tt,Dt)),$t.push(`&#x${Vt.toString(16).toUpperCase()};`),Vt>55295&&(Vt<57344||Vt>65533)&&Dt++,Tt=Dt+1}return $t.length===0?Lt:(Tt<Lt.length&&$t.push(Lt.substring(Tt,Lt.length)),$t.join(""))}function yt(Lt){let $t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const Tt=/^("|').*("|')$/.exec(Lt);if(Tt&&Tt[1]===Tt[2]){if(new RegExp(`[^\\\\]${Tt[1]}`).test(Lt.slice(1,-1)))return $t&&(0,rt.warn)(`FontFamily contains unescaped ${Tt[1]}: ${Lt}.`),!1}else for(const Dt of Lt.split(/[ \t]+/))if(/^(\d|(-(\d|-)))/.test(Dt)||!/^[\w-\\]+$/.test(Dt))return $t&&(0,rt.warn)(`FontFamily contains invalid <custom-ident>: ${Lt}.`),!1;return!0}function Rt(Lt){const $t="14",Tt="400",Dt=new Set(["100","200","300","400","500","600","700","800","900","1000","normal","bold","bolder","lighter"]),{fontFamily:Ut,fontWeight:Vt,italicAngle:Qt}=Lt;if(!yt(Ut,!0))return!1;const qt=Vt?Vt.toString():"";Lt.fontWeight=Dt.has(qt)?qt:Tt;const Zt=parseFloat(Qt);return Lt.italicAngle=isNaN(Zt)||Zt<-90||Zt>90?$t:Qt.toString(),!0}function kt(Lt){const $t=["app.launchURL","window.open","xfa.host.gotoURL"],Dt=new RegExp("^\\s*("+$t.join("|").replaceAll(".","\\.")+`)\\((?:'|")([^'"]*)(?:'|")(?:,\\s*(\\w+)\\)|\\))`,"i").exec(Lt);if(Dt!=null&&Dt[2]){const Ut=Dt[2];let Vt=!1;return Dt[3]==="true"&&Dt[1]==="app.launchURL"&&(Vt=!0),{url:Ut,newWindow:Vt}}return null}function jt(Lt){if(Number.isInteger(Lt))return Lt.toString();const $t=Math.round(Lt*100);return $t%100===0?($t/100).toString():$t%10===0?Lt.toFixed(1):Lt.toFixed(2)}function Ht(Lt){if(!Lt)return null;const $t=new Map;for(const[Tt,Dt]of Lt){if(!Tt.startsWith(rt.AnnotationEditorPrefix))continue;let Ut=$t.get(Dt.pageIndex);Ut||(Ut=[],$t.set(Dt.pageIndex,Ut)),Ut.push(Dt)}return $t.size>0?$t:null}function Ft(Lt){return/^[\x00-\x7F]*$/.test(Lt)}function _t(Lt){const $t=[];for(let Tt=0,Dt=Lt.length;Tt<Dt;Tt++){const Ut=Lt.charCodeAt(Tt);$t.push((Ut>>8&255).toString(16).padStart(2,"0"),(Ut&255).toString(16).padStart(2,"0"))}return $t.join("")}function Nt(Lt){let $t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const Tt=[];$t&&Tt.push("þÿ");for(let Dt=0,Ut=Lt.length;Dt<Ut;Dt++){const Vt=Lt.charCodeAt(Dt);Tt.push(String.fromCharCode(Vt>>8&255),String.fromCharCode(Vt&255))}return Tt.join("")}function Mt(Lt,$t,Tt){switch(Lt){case 90:return[0,1,-1,0,$t,0];case 180:return[-1,0,0,-1,$t,Tt];case 270:return[0,-1,1,0,0,Tt];default:throw new Error("Invalid rotation")}}},(nt,at,ot)=>{Object.defineProperty(at,"__esModule",{value:!0}),at.RefSetCache=at.RefSet=at.Ref=at.Name=at.EOF=at.Dict=at.Cmd=at.CIRCULAR_REF=void 0,at.clearPrimitiveCaches=ft,at.isCmd=xt,at.isDict=bt,at.isName=At,at.isRefsEqual=Et,ot(140),ot(116),ot(127),ot(129),ot(132),ot(134),ot(136),ot(138);var rt=ot(145);const st=Symbol("CIRCULAR_REF");at.CIRCULAR_REF=st;const lt=Symbol("EOF");at.EOF=lt;let et=Object.create(null),it=Object.create(null),ut=Object.create(null);function ft(){et=Object.create(null),it=Object.create(null),ut=Object.create(null)}class ht{constructor(Bt){this.name=Bt}static get(Bt){return it[Bt]||(it[Bt]=new ht(Bt))}}at.Name=ht;class dt{constructor(Bt){this.cmd=Bt}static get(Bt){return et[Bt]||(et[Bt]=new dt(Bt))}}at.Cmd=dt;const gt=function(){return gt};class pt{constructor(){let Bt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;this._map=Object.create(null),this.xref=Bt,this.objId=null,this.suppressEncryption=!1,this.__nonSerializable__=gt}assignXref(Bt){this.xref=Bt}get size(){return Object.keys(this._map).length}get(Bt,Ot,Pt){let wt=this._map[Bt];return wt===void 0&&Ot!==void 0&&(wt=this._map[Ot],wt===void 0&&Pt!==void 0&&(wt=this._map[Pt])),wt instanceof mt&&this.xref?this.xref.fetch(wt,this.suppressEncryption):wt}async getAsync(Bt,Ot,Pt){let wt=this._map[Bt];return wt===void 0&&Ot!==void 0&&(wt=this._map[Ot],wt===void 0&&Pt!==void 0&&(wt=this._map[Pt])),wt instanceof mt&&this.xref?this.xref.fetchAsync(wt,this.suppressEncryption):wt}getArray(Bt,Ot,Pt){let wt=this._map[Bt];if(wt===void 0&&Ot!==void 0&&(wt=this._map[Ot],wt===void 0&&Pt!==void 0&&(wt=this._map[Pt])),wt instanceof mt&&this.xref&&(wt=this.xref.fetch(wt,this.suppressEncryption)),Array.isArray(wt)){wt=wt.slice();for(let Ct=0,It=wt.length;Ct<It;Ct++)wt[Ct]instanceof mt&&this.xref&&(wt[Ct]=this.xref.fetch(wt[Ct],this.suppressEncryption))}return wt}getRaw(Bt){return this._map[Bt]}getKeys(){return Object.keys(this._map)}getRawValues(){return Object.values(this._map)}set(Bt,Ot){this._map[Bt]=Ot}has(Bt){return this._map[Bt]!==void 0}forEach(Bt){for(const Ot in this._map)Bt(Ot,this.get(Ot))}static get empty(){const Bt=new pt(null);return Bt.set=(Ot,Pt)=>{(0,rt.unreachable)("Should not call `set` on the empty dictionary.")},(0,rt.shadow)(this,"empty",Bt)}static merge(Bt){let{xref:Ot,dictArray:Pt,mergeSubDicts:wt=!1}=Bt;const Ct=new pt(Ot),It=new Map;for(const yt of Pt)if(yt instanceof pt)for(const[Rt,kt]of Object.entries(yt._map)){let jt=It.get(Rt);if(jt===void 0)jt=[],It.set(Rt,jt);else if(!wt||!(kt instanceof pt))continue;jt.push(kt)}for(const[yt,Rt]of It){if(Rt.length===1||!(Rt[0]instanceof pt)){Ct._map[yt]=Rt[0];continue}const kt=new pt(Ot);for(const jt of Rt)for(const[Ht,Ft]of Object.entries(jt._map))kt._map[Ht]===void 0&&(kt._map[Ht]=Ft);kt.size>0&&(Ct._map[yt]=kt)}return It.clear(),Ct.size>0?Ct:pt.empty}clone(){const Bt=new pt(this.xref);for(const Ot of this.getKeys())Bt.set(Ot,this.getRaw(Ot));return Bt}}at.Dict=pt;class mt{constructor(Bt,Ot){this.num=Bt,this.gen=Ot}toString(){return this.gen===0?`${this.num}R`:`${this.num}R${this.gen}`}static fromString(Bt){const Ot=ut[Bt];if(Ot)return Ot;const Pt=/^(\d+)R(\d*)$/.exec(Bt);return!Pt||Pt[1]==="0"?null:ut[Bt]=new mt(parseInt(Pt[1]),Pt[2]?parseInt(Pt[2]):0)}static get(Bt,Ot){const Pt=Ot===0?`${Bt}R`:`${Bt}R${Ot}`;return ut[Pt]||(ut[Pt]=new mt(Bt,Ot))}}at.Ref=mt;class ct{constructor(){let Bt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;this._set=new Set(Bt==null?void 0:Bt._set)}has(Bt){return this._set.has(Bt.toString())}put(Bt){this._set.add(Bt.toString())}remove(Bt){this._set.delete(Bt.toString())}[Symbol.iterator](){return this._set.values()}clear(){this._set.clear()}}at.RefSet=ct;class vt{constructor(){this._map=new Map}get size(){return this._map.size}get(Bt){return this._map.get(Bt.toString())}has(Bt){return this._map.has(Bt.toString())}put(Bt,Ot){this._map.set(Bt.toString(),Ot)}putAlias(Bt,Ot){this._map.set(Bt.toString(),this.get(Ot))}[Symbol.iterator](){return this._map.values()}clear(){this._map.clear()}}at.RefSetCache=vt;function At(St,Bt){return St instanceof ht&&(Bt===void 0||St.name===Bt)}function xt(St,Bt){return St instanceof dt&&(Bt===void 0||St.cmd===Bt)}function bt(St,Bt){return St instanceof pt&&(Bt===void 0||At(St.get("Type"),Bt))}function Et(St,Bt){return St.num===Bt.num&&St.gen===Bt.gen}},(nt,at,ot)=>{Object.defineProperty(at,"__esModule",{value:!0}),at.BaseStream=void 0;var rt=ot(145);class st{constructor(){this.constructor===st&&(0,rt.unreachable)("Cannot initialize BaseStream.")}get length(){(0,rt.unreachable)("Abstract getter `length` accessed")}get isEmpty(){(0,rt.unreachable)("Abstract getter `isEmpty` accessed")}get isDataLoaded(){return(0,rt.shadow)(this,"isDataLoaded",!0)}getByte(){(0,rt.unreachable)("Abstract method `getByte` called")}getBytes(et){(0,rt.unreachable)("Abstract method `getBytes` called")}peekByte(){const et=this.getByte();return et!==-1&&this.pos--,et}peekBytes(et){const it=this.getBytes(et);return this.pos-=it.length,it}getUint16(){const et=this.getByte(),it=this.getByte();return et===-1||it===-1?-1:(et<<8)+it}getInt32(){const et=this.getByte(),it=this.getByte(),ut=this.getByte(),ft=this.getByte();return(et<<24)+(it<<16)+(ut<<8)+ft}getByteRange(et,it){(0,rt.unreachable)("Abstract method `getByteRange` called")}getString(et){return(0,rt.bytesToString)(this.getBytes(et))}skip(et){this.pos+=et||1}reset(){(0,rt.unreachable)("Abstract method `reset` called")}moveStart(){(0,rt.unreachable)("Abstract method `moveStart` called")}makeSubStream(et,it){(0,rt.unreachable)("Abstract method `makeSubStream` called")}getBaseStreams(){return null}}at.BaseStream=st},(nt,at,ot)=>{Object.defineProperty(at,"__esModule",{value:!0}),at.NetworkPdfManager=at.LocalPdfManager=void 0;var rt=ot(145),st=ot(154),lt=ot(150),et=ot(156),it=ot(155);function ut(gt){if(gt){const pt=(0,rt.createValidAbsoluteUrl)(gt);if(pt)return pt.href;(0,rt.warn)(`Invalid absolute docBaseUrl: "${gt}".`)}return null}class ft{constructor(pt){var mt;this.constructor===ft&&(0,rt.unreachable)("Cannot initialize BasePdfManager."),this._docBaseUrl=ut(pt.docBaseUrl),this._docId=pt.docId,this._password=pt.password,this.enableXfa=pt.enableXfa,(mt=pt.evaluatorOptions).isOffscreenCanvasSupported&&(mt.isOffscreenCanvasSupported=rt.FeatureTest.isOffscreenCanvasSupported),this.evaluatorOptions=pt.evaluatorOptions}get docId(){return this._docId}get password(){return this._password}get docBaseUrl(){return this._docBaseUrl}get catalog(){return this.pdfDocument.catalog}ensureDoc(pt,mt){return this.ensure(this.pdfDocument,pt,mt)}ensureXRef(pt,mt){return this.ensure(this.pdfDocument.xref,pt,mt)}ensureCatalog(pt,mt){return this.ensure(this.pdfDocument.catalog,pt,mt)}getPage(pt){return this.pdfDocument.getPage(pt)}fontFallback(pt,mt){return this.pdfDocument.fontFallback(pt,mt)}loadXfaFonts(pt,mt){return this.pdfDocument.loadXfaFonts(pt,mt)}loadXfaImages(){return this.pdfDocument.loadXfaImages()}serializeXfaData(pt){return this.pdfDocument.serializeXfaData(pt)}cleanup(){let pt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.pdfDocument.cleanup(pt)}async ensure(pt,mt,ct){(0,rt.unreachable)("Abstract method `ensure` called")}requestRange(pt,mt){(0,rt.unreachable)("Abstract method `requestRange` called")}requestLoadedStream(){(0,rt.unreachable)("Abstract method `requestLoadedStream` called")}sendProgressiveData(pt){(0,rt.unreachable)("Abstract method `sendProgressiveData` called")}updatePassword(pt){this._password=pt}terminate(pt){(0,rt.unreachable)("Abstract method `terminate` called")}}class ht extends ft{constructor(pt){super(pt);const mt=new it.Stream(pt.source);this.pdfDocument=new et.PDFDocument(this,mt),this._loadedStreamPromise=Promise.resolve(mt)}async ensure(pt,mt,ct){const vt=pt[mt];return typeof vt=="function"?vt.apply(pt,ct):vt}requestRange(pt,mt){return Promise.resolve()}requestLoadedStream(){return this._loadedStreamPromise}terminate(pt){}}at.LocalPdfManager=ht;class dt extends ft{constructor(pt){super(pt),this.streamManager=new st.ChunkedStreamManager(pt.source,{msgHandler:pt.handler,length:pt.length,disableAutoFetch:pt.disableAutoFetch,rangeChunkSize:pt.rangeChunkSize}),this.pdfDocument=new et.PDFDocument(this,this.streamManager.getStream())}async ensure(pt,mt,ct){try{const vt=pt[mt];return typeof vt=="function"?vt.apply(pt,ct):vt}catch(vt){if(!(vt instanceof lt.MissingDataException))throw vt;return await this.requestRange(vt.begin,vt.end),this.ensure(pt,mt,ct)}}requestRange(pt,mt){return this.streamManager.requestRange(pt,mt)}requestLoadedStream(){let pt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.streamManager.requestAllChunks(pt)}sendProgressiveData(pt){this.streamManager.onReceiveData({chunk:pt})}terminate(pt){this.streamManager.abort(pt)}}at.NetworkPdfManager=dt},(nt,at,ot)=>{Object.defineProperty(at,"__esModule",{value:!0}),at.ChunkedStreamManager=at.ChunkedStream=void 0,ot(84),ot(93),ot(94),ot(97),ot(99),ot(101),ot(105),ot(108),ot(115),ot(116),ot(127),ot(129),ot(132),ot(134),ot(136),ot(138),ot(140),ot(2);var rt=ot(150),st=ot(145),lt=ot(155);class et extends lt.Stream{constructor(ft,ht,dt){super(new Uint8Array(ft),0,ft,null),this.chunkSize=ht,this._loadedChunks=new Set,this.numChunks=Math.ceil(ft/ht),this.manager=dt,this.progressiveDataLength=0,this.lastSuccessfulEnsureByteChunk=-1}getMissingChunks(){const ft=[];for(let ht=0,dt=this.numChunks;ht<dt;++ht)this._loadedChunks.has(ht)||ft.push(ht);return ft}get numChunksLoaded(){return this._loadedChunks.size}get isDataLoaded(){return this.numChunksLoaded===this.numChunks}onReceiveData(ft,ht){const dt=this.chunkSize;if(ft%dt!==0)throw new Error(`Bad begin offset: ${ft}`);const gt=ft+ht.byteLength;if(gt%dt!==0&>!==this.bytes.length)throw new Error(`Bad end offset: ${gt}`);this.bytes.set(new Uint8Array(ht),ft);const pt=Math.floor(ft/dt),mt=Math.floor((gt-1)/dt)+1;for(let ct=pt;ct<mt;++ct)this._loadedChunks.add(ct)}onReceiveProgressiveData(ft){let ht=this.progressiveDataLength;const dt=Math.floor(ht/this.chunkSize);this.bytes.set(new Uint8Array(ft),ht),ht+=ft.byteLength,this.progressiveDataLength=ht;const gt=ht>=this.end?this.numChunks:Math.floor(ht/this.chunkSize);for(let pt=dt;pt<gt;++pt)this._loadedChunks.add(pt)}ensureByte(ft){if(ft<this.progressiveDataLength)return;const ht=Math.floor(ft/this.chunkSize);if(!(ht>this.numChunks)&&ht!==this.lastSuccessfulEnsureByteChunk){if(!this._loadedChunks.has(ht))throw new rt.MissingDataException(ft,ft+1);this.lastSuccessfulEnsureByteChunk=ht}}ensureRange(ft,ht){if(ft>=ht||ht<=this.progressiveDataLength)return;const dt=Math.floor(ft/this.chunkSize);if(dt>this.numChunks)return;const gt=Math.min(Math.floor((ht-1)/this.chunkSize)+1,this.numChunks);for(let pt=dt;pt<gt;++pt)if(!this._loadedChunks.has(pt))throw new rt.MissingDataException(ft,ht)}nextEmptyChunk(ft){const ht=this.numChunks;for(let dt=0;dt<ht;++dt){const gt=(ft+dt)%ht;if(!this._loadedChunks.has(gt))return gt}return null}hasChunk(ft){return this._loadedChunks.has(ft)}getByte(){const ft=this.pos;return ft>=this.end?-1:(ft>=this.progressiveDataLength&&this.ensureByte(ft),this.bytes[this.pos++])}getBytes(ft){const ht=this.bytes,dt=this.pos,gt=this.end;if(!ft)return gt>this.progressiveDataLength&&this.ensureRange(dt,gt),ht.subarray(dt,gt);let pt=dt+ft;return pt>gt&&(pt=gt),pt>this.progressiveDataLength&&this.ensureRange(dt,pt),this.pos=pt,ht.subarray(dt,pt)}getByteRange(ft,ht){return ft<0&&(ft=0),ht>this.end&&(ht=this.end),ht>this.progressiveDataLength&&this.ensureRange(ft,ht),this.bytes.subarray(ft,ht)}makeSubStream(ft,ht){let dt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;ht?ft+ht>this.progressiveDataLength&&this.ensureRange(ft,ft+ht):ft>=this.progressiveDataLength&&this.ensureByte(ft);function gt(){}gt.prototype=Object.create(this),gt.prototype.getMissingChunks=function(){const mt=this.chunkSize,ct=Math.floor(this.start/mt),vt=Math.floor((this.end-1)/mt)+1,At=[];for(let xt=ct;xt<vt;++xt)this._loadedChunks.has(xt)||At.push(xt);return At},Object.defineProperty(gt.prototype,"isDataLoaded",{get(){return this.numChunksLoaded===this.numChunks?!0:this.getMissingChunks().length===0},configurable:!0});const pt=new gt;return pt.pos=pt.start=ft,pt.end=ft+ht||this.end,pt.dict=dt,pt}getBaseStreams(){return[this]}}at.ChunkedStream=et;class it{constructor(ft,ht){this.length=ht.length,this.chunkSize=ht.rangeChunkSize,this.stream=new et(this.length,this.chunkSize,this),this.pdfNetworkStream=ft,this.disableAutoFetch=ht.disableAutoFetch,this.msgHandler=ht.msgHandler,this.currRequestId=0,this._chunksNeededByRequest=new Map,this._requestsByChunk=new Map,this._promisesByRequest=new Map,this.progressiveDataLength=0,this.aborted=!1,this._loadedStreamCapability=new st.PromiseCapability}sendRequest(ft,ht){const dt=this.pdfNetworkStream.getRangeReader(ft,ht);dt.isStreamingSupported||(dt.onProgress=this.onProgress.bind(this));let gt=[],pt=0;return new Promise((mt,ct)=>{const vt=At=>{let{value:xt,done:bt}=At;try{if(bt){const Et=(0,rt.arrayBuffersToBytes)(gt);gt=null,mt(Et);return}pt+=xt.byteLength,dt.isStreamingSupported&&this.onProgress({loaded:pt}),gt.push(xt),dt.read().then(vt,ct)}catch(Et){ct(Et)}};dt.read().then(vt,ct)}).then(mt=>{this.aborted||this.onReceiveData({chunk:mt,begin:ft})})}requestAllChunks(){if(!(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)){const ht=this.stream.getMissingChunks();this._requestChunks(ht)}return this._loadedStreamCapability.promise}_requestChunks(ft){const ht=this.currRequestId++,dt=new Set;this._chunksNeededByRequest.set(ht,dt);for(const mt of ft)this.stream.hasChunk(mt)||dt.add(mt);if(dt.size===0)return Promise.resolve();const gt=new st.PromiseCapability;this._promisesByRequest.set(ht,gt);const pt=[];for(const mt of dt){let ct=this._requestsByChunk.get(mt);ct||(ct=[],this._requestsByChunk.set(mt,ct),pt.push(mt)),ct.push(ht)}if(pt.length>0){const mt=this.groupChunks(pt);for(const ct of mt){const vt=ct.beginChunk*this.chunkSize,At=Math.min(ct.endChunk*this.chunkSize,this.length);this.sendRequest(vt,At).catch(gt.reject)}}return gt.promise.catch(mt=>{if(!this.aborted)throw mt})}getStream(){return this.stream}requestRange(ft,ht){ht=Math.min(ht,this.length);const dt=this.getBeginChunk(ft),gt=this.getEndChunk(ht),pt=[];for(let mt=dt;mt<gt;++mt)pt.push(mt);return this._requestChunks(pt)}requestRanges(){let ft=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];const ht=[];for(const dt of ft){const gt=this.getBeginChunk(dt.begin),pt=this.getEndChunk(dt.end);for(let mt=gt;mt<pt;++mt)ht.includes(mt)||ht.push(mt)}return ht.sort(function(dt,gt){return dt-gt}),this._requestChunks(ht)}groupChunks(ft){const ht=[];let dt=-1,gt=-1;for(let pt=0,mt=ft.length;pt<mt;++pt){const ct=ft[pt];dt<0&&(dt=ct),gt>=0&>+1!==ct&&(ht.push({beginChunk:dt,endChunk:gt+1}),dt=ct),pt+1===ft.length&&ht.push({beginChunk:dt,endChunk:ct+1}),gt=ct}return ht}onProgress(ft){this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize+ft.loaded,total:this.length})}onReceiveData(ft){const ht=ft.chunk,dt=ft.begin===void 0,gt=dt?this.progressiveDataLength:ft.begin,pt=gt+ht.byteLength,mt=Math.floor(gt/this.chunkSize),ct=pt<this.length?Math.floor(pt/this.chunkSize):Math.ceil(pt/this.chunkSize);dt?(this.stream.onReceiveProgressiveData(ht),this.progressiveDataLength=pt):this.stream.onReceiveData(gt,ht),this.stream.isDataLoaded&&this._loadedStreamCapability.resolve(this.stream);const vt=[];for(let At=mt;At<ct;++At){const xt=this._requestsByChunk.get(At);if(xt){this._requestsByChunk.delete(At);for(const bt of xt){const Et=this._chunksNeededByRequest.get(bt);Et.has(At)&&Et.delete(At),!(Et.size>0)&&vt.push(bt)}}}if(!this.disableAutoFetch&&this._requestsByChunk.size===0){let At;if(this.stream.numChunksLoaded===1){const xt=this.stream.numChunks-1;this.stream.hasChunk(xt)||(At=xt)}else At=this.stream.nextEmptyChunk(ct);Number.isInteger(At)&&this._requestChunks([At])}for(const At of vt){const xt=this._promisesByRequest.get(At);this._promisesByRequest.delete(At),xt.resolve()}this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize,total:this.length})}onError(ft){this._loadedStreamCapability.reject(ft)}getBeginChunk(ft){return Math.floor(ft/this.chunkSize)}getEndChunk(ft){return Math.floor((ft-1)/this.chunkSize)+1}abort(ft){var ht;this.aborted=!0,(ht=this.pdfNetworkStream)==null||ht.cancelAllRequests(ft);for(const dt of this._promisesByRequest.values())dt.reject(ft)}}at.ChunkedStreamManager=it},(nt,at,ot)=>{Object.defineProperty(at,"__esModule",{value:!0}),at.StringStream=at.Stream=at.NullStream=void 0,ot(84),ot(93),ot(94),ot(97),ot(99),ot(101),ot(105),ot(108),ot(115);var rt=ot(152),st=ot(145);class lt extends rt.BaseStream{constructor(ft,ht,dt,gt){super(),this.bytes=ft instanceof Uint8Array?ft:new Uint8Array(ft),this.start=ht||0,this.pos=this.start,this.end=ht+dt||this.bytes.length,this.dict=gt}get length(){return this.end-this.start}get isEmpty(){return this.length===0}getByte(){return this.pos>=this.end?-1:this.bytes[this.pos++]}getBytes(ft){const ht=this.bytes,dt=this.pos,gt=this.end;if(!ft)return ht.subarray(dt,gt);let pt=dt+ft;return pt>gt&&(pt=gt),this.pos=pt,ht.subarray(dt,pt)}getByteRange(ft,ht){return ft<0&&(ft=0),ht>this.end&&(ht=this.end),this.bytes.subarray(ft,ht)}reset(){this.pos=this.start}moveStart(){this.start=this.pos}makeSubStream(ft,ht){let dt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;return new lt(this.bytes.buffer,ft,ht,dt)}}at.Stream=lt;class et extends lt{constructor(ft){super((0,st.stringToBytes)(ft))}}at.StringStream=et;class it extends lt{constructor(){super(new Uint8Array(0))}}at.NullStream=it},(nt,at,ot)=>{var Ft,Es,Nt,Cs;Object.defineProperty(at,"__esModule",{value:!0}),at.Page=at.PDFDocument=void 0,ot(2),ot(140),ot(116),ot(127),ot(129),ot(132),ot(134),ot(136),ot(138),ot(84),ot(93),ot(94),ot(97),ot(99),ot(101),ot(105),ot(108),ot(115);var rt=ot(145),st=ot(157),lt=ot(150),et=ot(151),it=ot(202),ut=ot(152),ft=ot(225),ht=ot(217),dt=ot(219),gt=ot(256),pt=ot(167),mt=ot(155),ct=ot(227),vt=ot(215),At=ot(164),xt=ot(169),bt=ot(223),Et=ot(224),St=ot(228),Bt=ot(257);const Ot=1,Pt=[0,0,612,792];class wt{constructor($t){_r(this,Ft);let{pdfManager:Tt,xref:Dt,pageIndex:Ut,pageDict:Vt,ref:Qt,globalIdFactory:qt,fontCache:Zt,builtInCMapCache:ar,standardFontDataCache:Jt,globalImageCache:rr,systemFontCache:Yt,nonBlendModesSet:Kt,xfaFactory:nr}=$t;this.pdfManager=Tt,this.pageIndex=Ut,this.pageDict=Vt,this.xref=Dt,this.ref=Qt,this.fontCache=Zt,this.builtInCMapCache=ar,this.standardFontDataCache=Jt,this.globalImageCache=rr,this.systemFontCache=Yt,this.nonBlendModesSet=Kt,this.evaluatorOptions=Tt.evaluatorOptions,this.resourcesPromise=null,this.xfaFactory=nr;const tr={obj:0};this._localIdFactory=class extends qt{static createObjId(){return`p${Ut}_${++tr.obj}`}static getPageObjId(){return`p${Qt.toString()}`}}}_getInheritableProperty($t){let Tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const Dt=(0,lt.getInheritableProperty)({dict:this.pageDict,key:$t,getArray:Tt,stopWhenFound:!1});return Array.isArray(Dt)?Dt.length===1||!(Dt[0]instanceof et.Dict)?Dt[0]:et.Dict.merge({xref:this.xref,dictArray:Dt}):Dt}get content(){return this.pageDict.getArray("Contents")}get resources(){const $t=this._getInheritableProperty("Resources");return(0,rt.shadow)(this,"resources",$t instanceof et.Dict?$t:et.Dict.empty)}_getBoundingBox($t){if(this.xfaData)return this.xfaData.bbox;let Tt=this._getInheritableProperty($t,!0);if(Array.isArray(Tt)&&Tt.length===4){if(Tt=rt.Util.normalizeRect(Tt),Tt[2]-Tt[0]>0&&Tt[3]-Tt[1]>0)return Tt;(0,rt.warn)(`Empty, or invalid, /${$t} entry.`)}return null}get mediaBox(){return(0,rt.shadow)(this,"mediaBox",this._getBoundingBox("MediaBox")||Pt)}get cropBox(){return(0,rt.shadow)(this,"cropBox",this._getBoundingBox("CropBox")||this.mediaBox)}get userUnit(){let $t=this.pageDict.get("UserUnit");return(typeof $t!="number"||$t<=0)&&($t=Ot),(0,rt.shadow)(this,"userUnit",$t)}get view(){const{cropBox:$t,mediaBox:Tt}=this;if($t!==Tt&&!(0,rt.isArrayEqual)($t,Tt)){const Dt=rt.Util.intersect($t,Tt);if(Dt&&Dt[2]-Dt[0]>0&&Dt[3]-Dt[1]>0)return(0,rt.shadow)(this,"view",Dt);(0,rt.warn)("Empty /CropBox and /MediaBox intersection.")}return(0,rt.shadow)(this,"view",Tt)}get rotate(){let $t=this._getInheritableProperty("Rotate")||0;return $t%90!==0?$t=0:$t>=360?$t%=360:$t<0&&($t=($t%360+360)%360),(0,rt.shadow)(this,"rotate",$t)}_onSubStreamError($t,Tt){if(this.evaluatorOptions.ignoreErrors){(0,rt.warn)(`getContentStream - ignoring sub-stream (${Tt}): "${$t}".`);return}throw $t}getContentStream(){return this.pdfManager.ensure(this,"content").then($t=>$t instanceof ut.BaseStream?$t:Array.isArray($t)?new xt.StreamsSequenceStream($t,this._onSubStreamError.bind(this)):new mt.NullStream)}get xfaData(){return(0,rt.shadow)(this,"xfaData",this.xfaFactory?{bbox:this.xfaFactory.getBoundingBox(this.pageIndex)}:null)}async saveNewAnnotations($t,Tt,Dt,Ut){if(this.xfaFactory)throw new Error("XFA: Cannot save new annotations.");const Vt=new At.PartialEvaluator({xref:this.xref,handler:$t,pageIndex:this.pageIndex,idFactory:this._localIdFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,standardFontDataCache:this.standardFontDataCache,globalImageCache:this.globalImageCache,systemFontCache:this.systemFontCache,options:this.evaluatorOptions}),Qt=new et.RefSet,qt=new et.RefSet;Ur(this,Ft,Es).call(this,Dt,Qt,qt);const Zt=this.pageDict,ar=this.annotations.filter(nr=>!(nr instanceof et.Ref&&Qt.has(nr))),Jt=await st.AnnotationFactory.saveNewAnnotations(Vt,Tt,Dt,Ut);for(const{ref:nr}of Jt.annotations)nr instanceof et.Ref&&!qt.has(nr)&&ar.push(nr);const rr=Zt.get("Annots");Zt.set("Annots",ar);const Yt=[];await(0,Et.writeObject)(this.ref,Zt,Yt,this.xref),rr&&Zt.set("Annots",rr);const Kt=Jt.dependencies;return Kt.push({ref:this.ref,data:Yt.join("")},...Jt.annotations),Kt}save($t,Tt,Dt){const Ut=new At.PartialEvaluator({xref:this.xref,handler:$t,pageIndex:this.pageIndex,idFactory:this._localIdFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,standardFontDataCache:this.standardFontDataCache,globalImageCache:this.globalImageCache,systemFontCache:this.systemFontCache,options:this.evaluatorOptions});return this._parsedAnnotations.then(function(Vt){const Qt=[];for(const qt of Vt)qt.mustBePrinted(Dt)&&Qt.push(qt.save(Ut,Tt,Dt).catch(function(Zt){return(0,rt.warn)(`save - ignoring annotation data during "${Tt.name}" task: "${Zt}".`),null}));return Promise.all(Qt).then(function(qt){return qt.filter(Zt=>!!Zt)})})}loadResources($t){return this.resourcesPromise||(this.resourcesPromise=this.pdfManager.ensure(this,"resources")),this.resourcesPromise.then(()=>new ct.ObjectLoader(this.resources,$t,this.xref).load())}getOperatorList($t){let{handler:Tt,sink:Dt,task:Ut,intent:Vt,cacheKey:Qt,annotationStorage:qt=null}=$t;const Zt=this.getContentStream(),ar=this.loadResources(["ColorSpace","ExtGState","Font","Pattern","Properties","Shading","XObject"]),Jt=new At.PartialEvaluator({xref:this.xref,handler:Tt,pageIndex:this.pageIndex,idFactory:this._localIdFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,standardFontDataCache:this.standardFontDataCache,globalImageCache:this.globalImageCache,systemFontCache:this.systemFontCache,options:this.evaluatorOptions}),rr=this.xfaFactory?null:(0,lt.getNewAnnotationsMap)(qt);let Yt=null,Kt=Promise.resolve(null);if(rr){const ir=rr.get(this.pageIndex);if(ir){const sr=this.pdfManager.ensureDoc("annotationGlobals");let cr;const or=new Set;for(const{bitmapId:Gt,bitmap:Wt}of ir)Gt&&!Wt&&!or.has(Gt)&&or.add(Gt);const{isOffscreenCanvasSupported:Xt}=this.evaluatorOptions;if(or.size>0){const Gt=ir.slice();for(const[Wt,er]of qt)Wt.startsWith(rt.AnnotationEditorPrefix)&&er.bitmap&&or.has(er.bitmapId)&&Gt.push(er);cr=st.AnnotationFactory.generateImages(Gt,this.xref,Xt)}else cr=st.AnnotationFactory.generateImages(ir,this.xref,Xt);Yt=new et.RefSet,Ur(this,Ft,Es).call(this,ir,Yt,null),Kt=sr.then(Gt=>Gt?st.AnnotationFactory.printNewAnnotations(Gt,Jt,Ut,ir,cr):null)}}const tr=Promise.all([Zt,ar]).then(ir=>{let[sr]=ir;const cr=new vt.OperatorList(Vt,Dt);return Tt.send("StartRenderPage",{transparency:Jt.hasBlendModes(this.resources,this.nonBlendModesSet),pageIndex:this.pageIndex,cacheKey:Qt}),Jt.getOperatorList({stream:sr,task:Ut,resources:this.resources,operatorList:cr}).then(function(){return cr})});return Promise.all([tr,this._parsedAnnotations,Kt]).then(function(ir){let[sr,cr,or]=ir;if(or){cr=cr.filter(ur=>!(ur.ref&&Yt.has(ur.ref)));for(let ur=0,pr=or.length;ur<pr;ur++){const yr=or[ur];if(yr.refToReplace){const Er=cr.findIndex(br=>br.ref&&(0,et.isRefsEqual)(br.ref,yr.refToReplace));Er>=0&&(cr.splice(Er,1,yr),or.splice(ur--,1),pr--)}}cr=cr.concat(or)}if(cr.length===0||Vt&rt.RenderingIntentFlag.ANNOTATIONS_DISABLE)return sr.flush(!0),{length:sr.totalLength};const Xt=!!(Vt&rt.RenderingIntentFlag.ANNOTATIONS_FORMS),Gt=!!(Vt&rt.RenderingIntentFlag.ANY),Wt=!!(Vt&rt.RenderingIntentFlag.DISPLAY),er=!!(Vt&rt.RenderingIntentFlag.PRINT),lr=[];for(const ur of cr)(Gt||Wt&&ur.mustBeViewed(qt,Xt)||er&&ur.mustBePrinted(qt))&&lr.push(ur.getOperatorList(Jt,Ut,Vt,Xt,qt).catch(function(pr){return(0,rt.warn)(`getOperatorList - ignoring annotation data during "${Ut.name}" task: "${pr}".`),{opList:null,separateForm:!1,separateCanvas:!1}}));return Promise.all(lr).then(function(ur){let pr=!1,yr=!1;for(const{opList:Er,separateForm:br,separateCanvas:gr}of ur)sr.addOpList(Er),pr||(pr=br),yr||(yr=gr);return sr.flush(!0,{form:pr,canvas:yr}),{length:sr.totalLength}})})}extractTextContent($t){let{handler:Tt,task:Dt,includeMarkedContent:Ut,disableNormalization:Vt,sink:Qt}=$t;const qt=this.getContentStream(),Zt=this.loadResources(["ExtGState","Font","Properties","XObject"]);return Promise.all([qt,Zt]).then(Jt=>{let[rr]=Jt;return new At.PartialEvaluator({xref:this.xref,handler:Tt,pageIndex:this.pageIndex,idFactory:this._localIdFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,standardFontDataCache:this.standardFontDataCache,globalImageCache:this.globalImageCache,systemFontCache:this.systemFontCache,options:this.evaluatorOptions}).getTextContent({stream:rr,task:Dt,resources:this.resources,includeMarkedContent:Ut,disableNormalization:Vt,sink:Qt,viewBox:this.view})})}async getStructTree(){const $t=await this.pdfManager.ensureCatalog("structTreeRoot");return $t?(await this._parsedAnnotations,(await this.pdfManager.ensure(this,"_parseStructTree",[$t])).serializable):null}_parseStructTree($t){const Tt=new bt.StructTreePage($t,this.pageDict);return Tt.parse(this.ref),Tt}async getAnnotationsData($t,Tt,Dt){const Ut=await this._parsedAnnotations;if(Ut.length===0)return Ut;const Vt=[],Qt=[];let qt;const Zt=!!(Dt&rt.RenderingIntentFlag.ANY),ar=!!(Dt&rt.RenderingIntentFlag.DISPLAY),Jt=!!(Dt&rt.RenderingIntentFlag.PRINT);for(const rr of Ut){const Yt=Zt||ar&&rr.viewable;(Yt||Jt&&rr.printable)&&Vt.push(rr.data),rr.hasTextContent&&Yt&&(qt||(qt=new At.PartialEvaluator({xref:this.xref,handler:$t,pageIndex:this.pageIndex,idFactory:this._localIdFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,standardFontDataCache:this.standardFontDataCache,globalImageCache:this.globalImageCache,systemFontCache:this.systemFontCache,options:this.evaluatorOptions})),Qt.push(rr.extractTextContent(qt,Tt,[-1/0,-1/0,1/0,1/0]).catch(function(Kt){(0,rt.warn)(`getAnnotationsData - ignoring textContent during "${Tt.name}" task: "${Kt}".`)})))}return await Promise.all(Qt),Vt}get annotations(){const $t=this._getInheritableProperty("Annots");return(0,rt.shadow)(this,"annotations",Array.isArray($t)?$t:[])}get _parsedAnnotations(){const $t=this.pdfManager.ensure(this,"annotations").then(async Tt=>{if(Tt.length===0)return Tt;const Dt=await this.pdfManager.ensureDoc("annotationGlobals");if(!Dt)return[];const Ut=[];for(const qt of Tt)Ut.push(st.AnnotationFactory.create(this.xref,qt,Dt,this._localIdFactory,!1,this.ref).catch(function(Zt){return(0,rt.warn)(`_parsedAnnotations: "${Zt}".`),null}));const Vt=[];let Qt;for(const qt of await Promise.all(Ut))if(qt){if(qt instanceof st.PopupAnnotation){(Qt||(Qt=[])).push(qt);continue}Vt.push(qt)}return Qt&&Vt.push(...Qt),Vt});return(0,rt.shadow)(this,"_parsedAnnotations",$t)}get jsActions(){const $t=(0,lt.collectActions)(this.xref,this.pageDict,rt.PageActionEventType);return(0,rt.shadow)(this,"jsActions",$t)}}Ft=new WeakSet,Es=function($t,Tt,Dt){for(const Ut of $t)if(Ut.id){const Vt=et.Ref.fromString(Ut.id);if(!Vt){(0,rt.warn)(`A non-linked annotation cannot be modified: ${Ut.id}`);continue}if(Ut.deleted){Tt.put(Vt);continue}Dt==null||Dt.put(Vt),Ut.ref=Vt,delete Ut.id}},at.Page=wt;const Ct=new Uint8Array([37,80,68,70,45]),It=new Uint8Array([115,116,97,114,116,120,114,101,102]),yt=new Uint8Array([101,110,100,111,98,106]),Rt=1024,kt="\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";function jt(Lt,$t){let Tt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1024,Dt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;const Ut=$t.length,Vt=Lt.peekBytes(Tt),Qt=Vt.length-Ut;if(Qt<=0)return!1;if(Dt){const qt=Ut-1;let Zt=Vt.length-1;for(;Zt>=qt;){let ar=0;for(;ar<Ut&&Vt[Zt-ar]===$t[qt-ar];)ar++;if(ar>=Ut)return Lt.pos+=Zt-qt,!0;Zt--}}else{let qt=0;for(;qt<=Qt;){let Zt=0;for(;Zt<Ut&&Vt[qt+Zt]===$t[Zt];)Zt++;if(Zt>=Ut)return Lt.pos+=qt,!0;qt++}}return!1}class Ht{constructor($t,Tt){_r(this,Nt);if(Tt.length<=0)throw new rt.InvalidPDFException("The PDF file is empty, i.e. its size is zero bytes.");this.pdfManager=$t,this.stream=Tt,this.xref=new Bt.XRef(Tt,$t),this._pagePromises=new Map,this._version=null;const Dt={font:0};this._globalIdFactory=class{static getDocId(){return`g_${$t.docId}`}static createFontId(){return`f${++Dt.font}`}static createObjId(){(0,rt.unreachable)("Abstract method `createObjId` called.")}static getPageObjId(){(0,rt.unreachable)("Abstract method `getPageObjId` called.")}}}parse($t){this.xref.parse($t),this.catalog=new ht.Catalog(this.pdfManager,this.xref)}get linearization(){let $t=null;try{$t=pt.Linearization.create(this.stream)}catch(Tt){if(Tt instanceof lt.MissingDataException)throw Tt;(0,rt.info)(Tt)}return(0,rt.shadow)(this,"linearization",$t)}get startXRef(){const $t=this.stream;let Tt=0;if(this.linearization)$t.reset(),jt($t,yt)&&(Tt=$t.pos+6-$t.start);else{const Ut=It.length;let Vt=!1,Qt=$t.end;for(;!Vt&&Qt>0;)Qt-=1024-Ut,Qt<0&&(Qt=0),$t.pos=Qt,Vt=jt($t,It,1024,!0);if(Vt){$t.skip(9);let qt;do qt=$t.getByte();while((0,lt.isWhiteSpace)(qt));let Zt="";for(;qt>=32&&qt<=57;)Zt+=String.fromCharCode(qt),qt=$t.getByte();Tt=parseInt(Zt,10),isNaN(Tt)&&(Tt=0)}}return(0,rt.shadow)(this,"startXRef",Tt)}checkHeader(){const $t=this.stream;if($t.reset(),!jt($t,Ct))return;$t.moveStart(),$t.skip(Ct.length);let Tt="",Dt;for(;(Dt=$t.getByte())>32&&Tt.length<7;)Tt+=String.fromCharCode(Dt);lt.PDF_VERSION_REGEXP.test(Tt)?this._version=Tt:(0,rt.warn)(`Invalid PDF header version: ${Tt}`)}parseStartXRef(){this.xref.setStartXRef(this.startXRef)}get numPages(){let $t=0;return this.catalog.hasActualNumPages?$t=this.catalog.numPages:this.xfaFactory?$t=this.xfaFactory.getNumPages():this.linearization?$t=this.linearization.numPages:$t=this.catalog.numPages,(0,rt.shadow)(this,"numPages",$t)}_hasOnlyDocumentSignatures($t){let Tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const Dt=10;return Array.isArray($t)?$t.every(Ut=>{if(Ut=this.xref.fetchIfRef(Ut),!(Ut instanceof et.Dict))return!1;if(Ut.has("Kids"))return++Tt>Dt?((0,rt.warn)("_hasOnlyDocumentSignatures: maximum recursion depth reached"),!1):this._hasOnlyDocumentSignatures(Ut.get("Kids"),Tt);const Vt=(0,et.isName)(Ut.get("FT"),"Sig"),Qt=Ut.get("Rect"),qt=Array.isArray(Qt)&&Qt.every(Zt=>Zt===0);return Vt&&qt}):!1}get _xfaStreams(){const $t=this.catalog.acroForm;if(!$t)return null;const Tt=$t.get("XFA"),Dt={"xdp:xdp":"",template:"",datasets:"",config:"",connectionSet:"",localeSet:"",stylesheet:"","/xdp:xdp":""};if(Tt instanceof ut.BaseStream&&!Tt.isEmpty)return Dt["xdp:xdp"]=Tt,Dt;if(!Array.isArray(Tt)||Tt.length===0)return null;for(let Ut=0,Vt=Tt.length;Ut<Vt;Ut+=2){let Qt;if(Ut===0?Qt="xdp:xdp":Ut===Vt-2?Qt="/xdp:xdp":Qt=Tt[Ut],!Dt.hasOwnProperty(Qt))continue;const qt=this.xref.fetchIfRef(Tt[Ut+1]);!(qt instanceof ut.BaseStream)||qt.isEmpty||(Dt[Qt]=qt)}return Dt}get xfaDatasets(){const $t=this._xfaStreams;if(!$t)return(0,rt.shadow)(this,"xfaDatasets",null);for(const Tt of["datasets","xdp:xdp"]){const Dt=$t[Tt];if(Dt)try{const Ut=(0,rt.stringToUTF8String)(Dt.getString()),Vt={[Tt]:Ut};return(0,rt.shadow)(this,"xfaDatasets",new gt.DatasetReader(Vt))}catch{(0,rt.warn)("XFA - Invalid utf-8 string.");break}}return(0,rt.shadow)(this,"xfaDatasets",null)}get xfaData(){const $t=this._xfaStreams;if(!$t)return null;const Tt=Object.create(null);for(const[Dt,Ut]of Object.entries($t))if(Ut)try{Tt[Dt]=(0,rt.stringToUTF8String)(Ut.getString())}catch{return(0,rt.warn)("XFA - Invalid utf-8 string."),null}return Tt}get xfaFactory(){let $t;return this.pdfManager.enableXfa&&this.catalog.needsRendering&&this.formInfo.hasXfa&&!this.formInfo.hasAcroForm&&($t=this.xfaData),(0,rt.shadow)(this,"xfaFactory",$t?new St.XFAFactory($t):null)}get isPureXfa(){return this.xfaFactory?this.xfaFactory.isValid():!1}get htmlForXfa(){return this.xfaFactory?this.xfaFactory.getPages():null}async loadXfaImages(){const $t=await this.pdfManager.ensureCatalog("xfaImages");if(!$t)return;const Tt=$t.getKeys();await new ct.ObjectLoader($t,Tt,this.xref).load();const Ut=new Map;for(const Vt of Tt){const Qt=$t.get(Vt);Qt instanceof ut.BaseStream&&Ut.set(Vt,Qt.getBytes())}this.xfaFactory.setImages(Ut)}async loadXfaFonts($t,Tt){const Dt=await this.pdfManager.ensureCatalog("acroForm");if(!Dt)return;const Ut=await Dt.getAsync("DR");if(!(Ut instanceof et.Dict))return;await new ct.ObjectLoader(Ut,["Font"],this.xref).load();const Qt=Ut.get("Font");if(!(Qt instanceof et.Dict))return;const qt=Object.assign(Object.create(null),this.pdfManager.evaluatorOptions);qt.useSystemFonts=!1;const Zt=new At.PartialEvaluator({xref:this.xref,handler:$t,pageIndex:-1,idFactory:this._globalIdFactory,fontCache:this.catalog.fontCache,builtInCMapCache:this.catalog.builtInCMapCache,standardFontDataCache:this.catalog.standardFontDataCache,options:qt}),ar=new vt.OperatorList,Jt=[],rr={get font(){return Jt.at(-1)},set font(ir){Jt.push(ir)},clone(){return this}},Yt=new Map;Qt.forEach((ir,sr)=>{Yt.set(ir,sr)});const Kt=[];for(const[ir,sr]of Yt){const cr=sr.get("FontDescriptor");if(!(cr instanceof et.Dict))continue;let or=cr.get("FontFamily");or=or.replaceAll(/[ ]+(\d)/g,"$1");const Xt=cr.get("FontWeight"),Gt=-cr.get("ItalicAngle"),Wt={fontFamily:or,fontWeight:Xt,italicAngle:Gt};(0,lt.validateCSSFont)(Wt)&&Kt.push(Zt.handleSetFont(Ut,[et.Name.get(ir),1],null,ar,Tt,rr,null,Wt).catch(function(er){return(0,rt.warn)(`loadXfaFonts: "${er}".`),null}))}await Promise.all(Kt);const nr=this.xfaFactory.setFonts(Jt);if(!nr)return;qt.ignoreErrors=!0,Kt.length=0,Jt.length=0;const tr=new Set;for(const ir of nr)(0,it.getXfaFontName)(`${ir}-Regular`)||tr.add(ir);tr.size&&nr.push("PdfJS-Fallback");for(const ir of nr)if(!tr.has(ir))for(const sr of[{name:"Regular",fontWeight:400,italicAngle:0},{name:"Bold",fontWeight:700,italicAngle:0},{name:"Italic",fontWeight:400,italicAngle:12},{name:"BoldItalic",fontWeight:700,italicAngle:12}]){const cr=`${ir}-${sr.name}`,or=(0,it.getXfaFontDict)(cr);Kt.push(Zt.handleSetFont(Ut,[et.Name.get(cr),1],null,ar,Tt,rr,or,{fontFamily:ir,fontWeight:sr.fontWeight,italicAngle:sr.italicAngle}).catch(function(Xt){return(0,rt.warn)(`loadXfaFonts: "${Xt}".`),null}))}await Promise.all(Kt),this.xfaFactory.appendFonts(Jt,tr)}async serializeXfaData($t){return this.xfaFactory?this.xfaFactory.serializeData($t):null}get version(){return this.catalog.version||this._version}get formInfo(){const $t={hasFields:!1,hasAcroForm:!1,hasXfa:!1,hasSignatures:!1},Tt=this.catalog.acroForm;if(!Tt)return(0,rt.shadow)(this,"formInfo",$t);try{const Dt=Tt.get("Fields"),Ut=Array.isArray(Dt)&&Dt.length>0;$t.hasFields=Ut;const Vt=Tt.get("XFA");$t.hasXfa=Array.isArray(Vt)&&Vt.length>0||Vt instanceof ut.BaseStream&&!Vt.isEmpty;const qt=!!(Tt.get("SigFlags")&1),Zt=qt&&this._hasOnlyDocumentSignatures(Dt);$t.hasAcroForm=Ut&&!Zt,$t.hasSignatures=qt}catch(Dt){if(Dt instanceof lt.MissingDataException)throw Dt;(0,rt.warn)(`Cannot fetch form information: "${Dt}".`)}return(0,rt.shadow)(this,"formInfo",$t)}get documentInfo(){const $t={PDFFormatVersion:this.version,Language:this.catalog.lang,EncryptFilterName:this.xref.encrypt?this.xref.encrypt.filterName:null,IsLinearized:!!this.linearization,IsAcroFormPresent:this.formInfo.hasAcroForm,IsXFAPresent:this.formInfo.hasXfa,IsCollectionPresent:!!this.catalog.collection,IsSignaturesPresent:this.formInfo.hasSignatures};let Tt;try{Tt=this.xref.trailer.get("Info")}catch(Dt){if(Dt instanceof lt.MissingDataException)throw Dt;(0,rt.info)("The document information dictionary is invalid.")}if(!(Tt instanceof et.Dict))return(0,rt.shadow)(this,"documentInfo",$t);for(const Dt of Tt.getKeys()){const Ut=Tt.get(Dt);switch(Dt){case"Title":case"Author":case"Subject":case"Keywords":case"Creator":case"Producer":case"CreationDate":case"ModDate":if(typeof Ut=="string"){$t[Dt]=(0,rt.stringToPDFString)(Ut);continue}break;case"Trapped":if(Ut instanceof et.Name){$t[Dt]=Ut;continue}break;default:let Vt;switch(typeof Ut){case"string":Vt=(0,rt.stringToPDFString)(Ut);break;case"number":case"boolean":Vt=Ut;break;default:Ut instanceof et.Name&&(Vt=Ut);break}if(Vt===void 0){(0,rt.warn)(`Bad value, for custom key "${Dt}", in Info: ${Ut}.`);continue}$t.Custom||($t.Custom=Object.create(null)),$t.Custom[Dt]=Vt;continue}(0,rt.warn)(`Bad value, for key "${Dt}", in Info: ${Ut}.`)}return(0,rt.shadow)(this,"documentInfo",$t)}get fingerprints(){function $t(Qt){return typeof Qt=="string"&&Qt.length>0&&Qt!==kt}function Tt(Qt){const qt=[];for(const Zt of Qt){const ar=Zt.toString(16);qt.push(ar.padStart(2,"0"))}return qt.join("")}const Dt=this.xref.trailer.get("ID");let Ut,Vt;return Array.isArray(Dt)&&$t(Dt[0])?(Ut=(0,rt.stringToBytes)(Dt[0]),Dt[1]!==Dt[0]&&$t(Dt[1])&&(Vt=(0,rt.stringToBytes)(Dt[1]))):Ut=(0,ft.calculateMD5)(this.stream.getByteRange(0,Rt),0,Rt),(0,rt.shadow)(this,"fingerprints",[Tt(Ut),Vt?Tt(Vt):null])}async _getLinearizationPage($t){const{catalog:Tt,linearization:Dt,xref:Ut}=this,Vt=et.Ref.get(Dt.objectNumberFirst,0);try{const Qt=await Ut.fetchAsync(Vt);if(Qt instanceof et.Dict){let qt=Qt.getRaw("Type");if(qt instanceof et.Ref&&(qt=await Ut.fetchAsync(qt)),(0,et.isName)(qt,"Page")||!Qt.has("Type")&&!Qt.has("Kids"))return Tt.pageKidsCountCache.has(Vt)||Tt.pageKidsCountCache.put(Vt,1),Tt.pageIndexCache.has(Vt)||Tt.pageIndexCache.put(Vt,0),[Qt,Vt]}throw new rt.FormatError("The Linearization dictionary doesn't point to a valid Page dictionary.")}catch(Qt){return(0,rt.warn)(`_getLinearizationPage: "${Qt.message}".`),Tt.getPageDict($t)}}getPage($t){const Tt=this._pagePromises.get($t);if(Tt)return Tt;const{catalog:Dt,linearization:Ut,xfaFactory:Vt}=this;let Qt;return Vt?Qt=Promise.resolve([et.Dict.empty,null]):(Ut==null?void 0:Ut.pageFirst)===$t?Qt=this._getLinearizationPage($t):Qt=Dt.getPageDict($t),Qt=Qt.then(qt=>{let[Zt,ar]=qt;return new wt({pdfManager:this.pdfManager,xref:this.xref,pageIndex:$t,pageDict:Zt,ref:ar,globalIdFactory:this._globalIdFactory,fontCache:Dt.fontCache,builtInCMapCache:Dt.builtInCMapCache,standardFontDataCache:Dt.standardFontDataCache,globalImageCache:Dt.globalImageCache,systemFontCache:Dt.systemFontCache,nonBlendModesSet:Dt.nonBlendModesSet,xfaFactory:Vt})}),this._pagePromises.set($t,Qt),Qt}async checkFirstPage(){if(!(arguments.length>0&&arguments[0]!==void 0&&arguments[0]))try{await this.getPage(0)}catch(Tt){if(Tt instanceof lt.XRefEntryException)throw this._pagePromises.delete(0),await this.cleanup(),new lt.XRefParseException}}async checkLastPage(){let $t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const{catalog:Tt,pdfManager:Dt}=this;Tt.setActualNumPages();let Ut;try{if(await Promise.all([Dt.ensureDoc("xfaFactory"),Dt.ensureDoc("linearization"),Dt.ensureCatalog("numPages")]),this.xfaFactory)return;if(this.linearization?Ut=this.linearization.numPages:Ut=Tt.numPages,Number.isInteger(Ut)){if(Ut<=1)return}else throw new rt.FormatError("Page count is not an integer.");await this.getPage(Ut-1)}catch(Vt){if(this._pagePromises.delete(Ut-1),await this.cleanup(),Vt instanceof lt.XRefEntryException&&!$t)throw new lt.XRefParseException;(0,rt.warn)(`checkLastPage - invalid /Pages tree /Count: ${Ut}.`);let Qt;try{Qt=await Tt.getAllPageDicts($t)}catch(qt){if(qt instanceof lt.XRefEntryException&&!$t)throw new lt.XRefParseException;Tt.setActualNumPages(1);return}for(const[qt,[Zt,ar]]of Qt){let Jt;Zt instanceof Error?(Jt=Promise.reject(Zt),Jt.catch(()=>{})):Jt=Promise.resolve(new wt({pdfManager:Dt,xref:this.xref,pageIndex:qt,pageDict:Zt,ref:ar,globalIdFactory:this._globalIdFactory,fontCache:Tt.fontCache,builtInCMapCache:Tt.builtInCMapCache,standardFontDataCache:Tt.standardFontDataCache,globalImageCache:Tt.globalImageCache,systemFontCache:Tt.systemFontCache,nonBlendModesSet:Tt.nonBlendModesSet,xfaFactory:null})),this._pagePromises.set(qt,Jt)}Tt.setActualNumPages(Qt.size)}}fontFallback($t,Tt){return this.catalog.fontFallback($t,Tt)}async cleanup(){let $t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.catalog?this.catalog.cleanup($t):(0,dt.clearGlobalCaches)()}get fieldObjects(){if(!this.formInfo.hasFields)return(0,rt.shadow)(this,"fieldObjects",Promise.resolve(null));const $t=this.pdfManager.ensureDoc("annotationGlobals").then(async Tt=>{if(!Tt)return null;const Dt=Object.create(null),Ut=new Map;for(const Qt of this.catalog.acroForm.get("Fields"))Ur(this,Nt,Cs).call(this,"",Qt,Ut,Tt);const Vt=[];for(const[Qt,qt]of Ut)Vt.push(Promise.all(qt).then(Zt=>{Zt=Zt.filter(ar=>!!ar),Zt.length>0&&(Dt[Qt]=Zt)}));return await Promise.all(Vt),Dt});return(0,rt.shadow)(this,"fieldObjects",$t)}get hasJSActions(){const $t=this.pdfManager.ensureDoc("_parseHasJSActions");return(0,rt.shadow)(this,"hasJSActions",$t)}async _parseHasJSActions(){const[$t,Tt]=await Promise.all([this.pdfManager.ensureCatalog("jsActions"),this.pdfManager.ensureDoc("fieldObjects")]);return $t?!0:Tt?Object.values(Tt).some(Dt=>Dt.some(Ut=>Ut.actions!==null)):!1}get calculationOrderIds(){const $t=this.catalog.acroForm;if(!($t!=null&&$t.has("CO")))return(0,rt.shadow)(this,"calculationOrderIds",null);const Tt=$t.get("CO");if(!Array.isArray(Tt)||Tt.length===0)return(0,rt.shadow)(this,"calculationOrderIds",null);const Dt=[];for(const Ut of Tt)Ut instanceof et.Ref&&Dt.push(Ut.toString());return Dt.length===0?(0,rt.shadow)(this,"calculationOrderIds",null):(0,rt.shadow)(this,"calculationOrderIds",Dt)}get annotationGlobals(){return(0,rt.shadow)(this,"annotationGlobals",st.AnnotationFactory.createGlobals(this.pdfManager))}}Nt=new WeakSet,Cs=function($t,Tt,Dt,Ut){const Vt=this.xref.fetchIfRef(Tt);if(Vt.has("T")){const Qt=(0,rt.stringToPDFString)(Vt.get("T"));$t=$t===""?Qt:`${$t}.${Qt}`}if(Dt.has($t)||Dt.set($t,[]),Dt.get($t).push(st.AnnotationFactory.create(this.xref,Tt,Ut,this._localIdFactory,!0,null).then(Qt=>Qt==null?void 0:Qt.getFieldObject()).catch(function(Qt){return(0,rt.warn)(`#collectFieldObjects: "${Qt}".`),null})),Vt.has("Kids"))for(const Qt of Vt.get("Kids"))Ur(this,Nt,Cs).call(this,$t,Qt,Dt,Ut)},at.PDFDocument=Ht},(nt,at,ot)=>{Object.defineProperty(at,"__esModule",{value:!0}),at.PopupAnnotation=at.MarkupAnnotation=at.AnnotationFactory=at.AnnotationBorderStyle=at.Annotation=void 0,at.getQuadPoints=St,ot(140),ot(84),ot(93),ot(94),ot(97),ot(99),ot(101),ot(105),ot(108),ot(115),ot(158),ot(160);var rt=ot(145),st=ot(150),lt=ot(162),et=ot(151),it=ot(155),ut=ot(152),ft=ot(211),ht=ot(217),dt=ot(163),gt=ot(220),pt=ot(177),mt=ot(227),ct=ot(215),vt=ot(224),At=ot(228);class xt{static createGlobals(Yt){return Promise.all([Yt.ensureCatalog("acroForm"),Yt.ensureDoc("xfaDatasets"),Yt.ensureCatalog("structTreeRoot"),Yt.ensureCatalog("baseUrl"),Yt.ensureCatalog("attachments")]).then(Kt=>{let[nr,tr,ir,sr,cr]=Kt;return{pdfManager:Yt,acroForm:nr instanceof et.Dict?nr:et.Dict.empty,xfaDatasets:tr,structTreeRoot:ir,baseUrl:sr,attachments:cr}},Kt=>((0,rt.warn)(`createGlobals: "${Kt}".`),null))}static async create(Yt,Kt,nr,tr,ir,sr){const cr=ir?await this._getPageIndex(Yt,Kt,nr.pdfManager):null;return nr.pdfManager.ensure(this,"_create",[Yt,Kt,nr,tr,ir,cr,sr])}static _create(Yt,Kt,nr,tr){let ir=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,sr=arguments.length>5&&arguments[5]!==void 0?arguments[5]:null,cr=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null;const or=Yt.fetchIfRef(Kt);if(!(or instanceof et.Dict))return;const{acroForm:Xt,pdfManager:Gt}=nr,Wt=Kt instanceof et.Ref?Kt.toString():`annot_${tr.createObjId()}`;let er=or.get("Subtype");er=er instanceof et.Name?er.name:null;const lr={xref:Yt,ref:Kt,dict:or,subtype:er,id:Wt,annotationGlobals:nr,collectFields:ir,needAppearances:!ir&&Xt.get("NeedAppearances")===!0,pageIndex:sr,evaluatorOptions:Gt.evaluatorOptions,pageRef:cr};switch(er){case"Link":return new Ht(lr);case"Text":return new jt(lr);case"Widget":let ur=(0,st.getInheritableProperty)({dict:or,key:"FT"});switch(ur=ur instanceof et.Name?ur.name:null,ur){case"Tx":return new It(lr);case"Btn":return new yt(lr);case"Ch":return new Rt(lr);case"Sig":return new kt(lr)}return(0,rt.warn)(`Unimplemented widget field type "${ur}", falling back to base field type.`),new Ct(lr);case"Popup":return new Ft(lr);case"FreeText":return new _t(lr);case"Line":return new Nt(lr);case"Square":return new Mt(lr);case"Circle":return new Lt(lr);case"PolyLine":return new $t(lr);case"Polygon":return new Tt(lr);case"Caret":return new Dt(lr);case"Ink":return new Ut(lr);case"Highlight":return new Vt(lr);case"Underline":return new Qt(lr);case"Squiggly":return new qt(lr);case"StrikeOut":return new Zt(lr);case"Stamp":return new ar(lr);case"FileAttachment":return new Jt(lr);default:return ir||(er?(0,rt.warn)(`Unimplemented annotation type "${er}", falling back to base annotation.`):(0,rt.warn)("Annotation is missing the required /Subtype.")),new Ot(lr)}}static async _getPageIndex(Yt,Kt,nr){try{const tr=await Yt.fetchIfRefAsync(Kt);if(!(tr instanceof et.Dict))return-1;const ir=tr.getRaw("P");if(ir instanceof et.Ref)try{return await nr.ensureCatalog("getPageIndex",[ir])}catch(cr){(0,rt.info)(`_getPageIndex -- not a valid page reference: "${cr}".`)}if(tr.has("Kids"))return-1;const sr=await nr.ensureDoc("numPages");for(let cr=0;cr<sr;cr++){const or=await nr.getPage(cr),Xt=await nr.ensure(or,"annotations");for(const Gt of Xt)if(Gt instanceof et.Ref&&(0,et.isRefsEqual)(Gt,Kt))return cr}}catch(tr){(0,rt.warn)(`_getPageIndex: "${tr}".`)}return-1}static generateImages(Yt,Kt,nr){if(!nr)return(0,rt.warn)("generateImages: OffscreenCanvas is not supported, cannot save or print some annotations with images."),null;let tr;for(const{bitmapId:ir,bitmap:sr}of Yt)sr&&(tr||(tr=new Map),tr.set(ir,ar.createImage(sr,Kt)));return tr}static async saveNewAnnotations(Yt,Kt,nr,tr){const ir=Yt.xref;let sr;const cr=[],or=[],{isOffscreenCanvasSupported:Xt}=Yt.options;for(const Gt of nr)if(!Gt.deleted)switch(Gt.annotationType){case rt.AnnotationEditorType.FREETEXT:if(!sr){const er=new et.Dict(ir);er.set("BaseFont",et.Name.get("Helvetica")),er.set("Type",et.Name.get("Font")),er.set("Subtype",et.Name.get("Type1")),er.set("Encoding",et.Name.get("WinAnsiEncoding"));const lr=[];sr=ir.getNewTemporaryRef(),await(0,vt.writeObject)(sr,er,lr,ir),cr.push({ref:sr,data:lr.join("")})}or.push(_t.createNewAnnotation(ir,Gt,cr,{evaluator:Yt,task:Kt,baseFontRef:sr}));break;case rt.AnnotationEditorType.INK:or.push(Ut.createNewAnnotation(ir,Gt,cr));break;case rt.AnnotationEditorType.STAMP:if(!Xt)break;const Wt=await tr.get(Gt.bitmapId);if(Wt.imageStream){const{imageStream:er,smaskStream:lr}=Wt,ur=[];if(lr){const yr=ir.getNewTemporaryRef();await(0,vt.writeObject)(yr,lr,ur,ir),cr.push({ref:yr,data:ur.join("")}),er.dict.set("SMask",yr),ur.length=0}const pr=Wt.imageRef=ir.getNewTemporaryRef();await(0,vt.writeObject)(pr,er,ur,ir),cr.push({ref:pr,data:ur.join("")}),Wt.imageStream=Wt.smaskStream=null}or.push(ar.createNewAnnotation(ir,Gt,cr,{image:Wt}));break}return{annotations:await Promise.all(or),dependencies:cr}}static async printNewAnnotations(Yt,Kt,nr,tr,ir){if(!tr)return null;const{options:sr,xref:cr}=Kt,or=[];for(const Xt of tr)if(!Xt.deleted)switch(Xt.annotationType){case rt.AnnotationEditorType.FREETEXT:or.push(_t.createNewPrintAnnotation(Yt,cr,Xt,{evaluator:Kt,task:nr,evaluatorOptions:sr}));break;case rt.AnnotationEditorType.INK:or.push(Ut.createNewPrintAnnotation(Yt,cr,Xt,{evaluatorOptions:sr}));break;case rt.AnnotationEditorType.STAMP:if(!sr.isOffscreenCanvasSupported)break;const Gt=await ir.get(Xt.bitmapId);if(Gt.imageStream){const{imageStream:Wt,smaskStream:er}=Gt;er&&Wt.dict.set("SMask",er),Gt.imageRef=new pt.JpegStream(Wt,Wt.length),Gt.imageStream=Gt.smaskStream=null}or.push(ar.createNewPrintAnnotation(Yt,cr,Xt,{image:Gt,evaluatorOptions:sr}));break}return Promise.all(or)}}at.AnnotationFactory=xt;function bt(rr){let Yt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Uint8ClampedArray(3);if(!Array.isArray(rr))return Yt;const Kt=Yt||new Uint8ClampedArray(3);switch(rr.length){case 0:return null;case 1:return dt.ColorSpace.singletons.gray.getRgbItem(rr,0,Kt,0),Kt;case 3:return dt.ColorSpace.singletons.rgb.getRgbItem(rr,0,Kt,0),Kt;case 4:return dt.ColorSpace.singletons.cmyk.getRgbItem(rr,0,Kt,0),Kt;default:return Yt}}function Et(rr){return Array.from(rr,Yt=>Yt/255)}function St(rr,Yt){const Kt=rr.getArray("QuadPoints");if(!Array.isArray(Kt)||Kt.length===0||Kt.length%8>0)return null;const nr=[];for(let tr=0,ir=Kt.length/8;tr<ir;tr++){let sr=1/0,cr=-1/0,or=1/0,Xt=-1/0;for(let Gt=tr*8,Wt=tr*8+8;Gt<Wt;Gt+=2){const er=Kt[Gt],lr=Kt[Gt+1];sr=Math.min(er,sr),cr=Math.max(er,cr),or=Math.min(lr,or),Xt=Math.max(lr,Xt)}if(Yt!==null&&(sr<Yt[0]||cr>Yt[2]||or<Yt[1]||Xt>Yt[3]))return null;nr.push([{x:sr,y:Xt},{x:cr,y:Xt},{x:sr,y:or},{x:cr,y:or}])}return nr}function Bt(rr,Yt,Kt){const[nr,tr,ir,sr]=rt.Util.getAxialAlignedBoundingBox(Yt,Kt);if(nr===ir||tr===sr)return[1,0,0,1,rr[0],rr[1]];const cr=(rr[2]-rr[0])/(ir-nr),or=(rr[3]-rr[1])/(sr-tr);return[cr,0,0,or,rr[0]-nr*cr,rr[1]-tr*or]}class Ot{constructor(Yt){const{dict:Kt,xref:nr,annotationGlobals:tr}=Yt;this.setTitle(Kt.get("T")),this.setContents(Kt.get("Contents")),this.setModificationDate(Kt.get("M")),this.setFlags(Kt.get("F")),this.setRectangle(Kt.getArray("Rect")),this.setColor(Kt.getArray("C")),this.setBorderStyle(Kt),this.setAppearance(Kt),this.setOptionalContent(Kt);const ir=Kt.get("MK");this.setBorderAndBackgroundColors(ir),this.setRotation(ir,Kt),this.ref=Yt.ref instanceof et.Ref?Yt.ref:null,this._streams=[],this.appearance&&this._streams.push(this.appearance);const sr=!!(this.flags&rt.AnnotationFlag.LOCKED),cr=!!(this.flags&rt.AnnotationFlag.LOCKEDCONTENTS);if(tr.structTreeRoot){let or=Kt.get("StructParent");or=Number.isInteger(or)&&or>=0?or:-1,tr.structTreeRoot.addAnnotationIdToPage(Yt.pageRef,or)}if(this.data={annotationFlags:this.flags,borderStyle:this.borderStyle,color:this.color,backgroundColor:this.backgroundColor,borderColor:this.borderColor,rotation:this.rotation,contentsObj:this._contents,hasAppearance:!!this.appearance,id:Yt.id,modificationDate:this.modificationDate,rect:this.rectangle,subtype:Yt.subtype,hasOwnCanvas:!1,noRotate:!!(this.flags&rt.AnnotationFlag.NOROTATE),noHTML:sr&&cr},Yt.collectFields){const or=Kt.get("Kids");if(Array.isArray(or)){const Xt=[];for(const Gt of or)Gt instanceof et.Ref&&Xt.push(Gt.toString());Xt.length!==0&&(this.data.kidIds=Xt)}this.data.actions=(0,st.collectActions)(nr,Kt,rt.AnnotationActionEventType),this.data.fieldName=this._constructFieldName(Kt),this.data.pageIndex=Yt.pageIndex}this._isOffscreenCanvasSupported=Yt.evaluatorOptions.isOffscreenCanvasSupported,this._fallbackFontDict=null,this._needAppearances=!1}_hasFlag(Yt,Kt){return!!(Yt&Kt)}_isViewable(Yt){return!this._hasFlag(Yt,rt.AnnotationFlag.INVISIBLE)&&!this._hasFlag(Yt,rt.AnnotationFlag.NOVIEW)}_isPrintable(Yt){return this._hasFlag(Yt,rt.AnnotationFlag.PRINT)&&!this._hasFlag(Yt,rt.AnnotationFlag.HIDDEN)&&!this._hasFlag(Yt,rt.AnnotationFlag.INVISIBLE)}mustBeViewed(Yt,Kt){var tr;const nr=(tr=Yt==null?void 0:Yt.get(this.data.id))==null?void 0:tr.noView;return nr!==void 0?!nr:this.viewable&&!this._hasFlag(this.flags,rt.AnnotationFlag.HIDDEN)}mustBePrinted(Yt){var nr;const Kt=(nr=Yt==null?void 0:Yt.get(this.data.id))==null?void 0:nr.noPrint;return Kt!==void 0?!Kt:this.printable}get viewable(){return this.data.quadPoints===null?!1:this.flags===0?!0:this._isViewable(this.flags)}get printable(){return this.data.quadPoints===null||this.flags===0?!1:this._isPrintable(this.flags)}_parseStringHelper(Yt){const Kt=typeof Yt=="string"?(0,rt.stringToPDFString)(Yt):"",nr=Kt&&(0,ft.bidi)(Kt).dir==="rtl"?"rtl":"ltr";return{str:Kt,dir:nr}}setDefaultAppearance(Yt){const{dict:Kt,annotationGlobals:nr}=Yt,tr=(0,st.getInheritableProperty)({dict:Kt,key:"DA"})||nr.acroForm.get("DA");this._defaultAppearance=typeof tr=="string"?tr:"",this.data.defaultAppearanceData=(0,lt.parseDefaultAppearance)(this._defaultAppearance)}setTitle(Yt){this._title=this._parseStringHelper(Yt)}setContents(Yt){this._contents=this._parseStringHelper(Yt)}setModificationDate(Yt){this.modificationDate=typeof Yt=="string"?Yt:null}setFlags(Yt){this.flags=Number.isInteger(Yt)&&Yt>0?Yt:0}hasFlag(Yt){return this._hasFlag(this.flags,Yt)}setRectangle(Yt){this.rectangle=Array.isArray(Yt)&&Yt.length===4?rt.Util.normalizeRect(Yt):[0,0,0,0]}setColor(Yt){this.color=bt(Yt)}setLineEndings(Yt){if(this.lineEndings=["None","None"],Array.isArray(Yt)&&Yt.length===2)for(let Kt=0;Kt<2;Kt++){const nr=Yt[Kt];if(nr instanceof et.Name)switch(nr.name){case"None":continue;case"Square":case"Circle":case"Diamond":case"OpenArrow":case"ClosedArrow":case"Butt":case"ROpenArrow":case"RClosedArrow":case"Slash":this.lineEndings[Kt]=nr.name;continue}(0,rt.warn)(`Ignoring invalid lineEnding: ${nr}`)}}setRotation(Yt,Kt){this.rotation=0;let nr=Yt instanceof et.Dict?Yt.get("R")||0:Kt.get("Rotate")||0;Number.isInteger(nr)&&nr!==0&&(nr%=360,nr<0&&(nr+=360),nr%90===0&&(this.rotation=nr))}setBorderAndBackgroundColors(Yt){Yt instanceof et.Dict?(this.borderColor=bt(Yt.getArray("BC"),null),this.backgroundColor=bt(Yt.getArray("BG"),null)):this.borderColor=this.backgroundColor=null}setBorderStyle(Yt){if(this.borderStyle=new Pt,Yt instanceof et.Dict)if(Yt.has("BS")){const Kt=Yt.get("BS"),nr=Kt.get("Type");(!nr||(0,et.isName)(nr,"Border"))&&(this.borderStyle.setWidth(Kt.get("W"),this.rectangle),this.borderStyle.setStyle(Kt.get("S")),this.borderStyle.setDashArray(Kt.getArray("D")))}else if(Yt.has("Border")){const Kt=Yt.getArray("Border");Array.isArray(Kt)&&Kt.length>=3&&(this.borderStyle.setHorizontalCornerRadius(Kt[0]),this.borderStyle.setVerticalCornerRadius(Kt[1]),this.borderStyle.setWidth(Kt[2],this.rectangle),Kt.length===4&&this.borderStyle.setDashArray(Kt[3],!0))}else this.borderStyle.setWidth(0)}setAppearance(Yt){this.appearance=null;const Kt=Yt.get("AP");if(!(Kt instanceof et.Dict))return;const nr=Kt.get("N");if(nr instanceof ut.BaseStream){this.appearance=nr;return}if(!(nr instanceof et.Dict))return;const tr=Yt.get("AS");if(!(tr instanceof et.Name)||!nr.has(tr.name))return;const ir=nr.get(tr.name);ir instanceof ut.BaseStream&&(this.appearance=ir)}setOptionalContent(Yt){this.oc=null;const Kt=Yt.get("OC");Kt instanceof et.Name?(0,rt.warn)("setOptionalContent: Support for /Name-entry is not implemented."):Kt instanceof et.Dict&&(this.oc=Kt)}loadResources(Yt,Kt){return Kt.dict.getAsync("Resources").then(nr=>nr?new mt.ObjectLoader(nr,Yt,nr.xref).load().then(function(){return nr}):void 0)}async getOperatorList(Yt,Kt,nr,tr,ir){const sr=this.data;let cr=this.appearance;const or=!!(this.data.hasOwnCanvas&&nr&rt.RenderingIntentFlag.DISPLAY);if(!cr){if(!or)return{opList:new ct.OperatorList,separateForm:!1,separateCanvas:!1};cr=new it.StringStream(""),cr.dict=new et.Dict}const Xt=cr.dict,Gt=await this.loadResources(["ExtGState","ColorSpace","Pattern","Shading","XObject","Font"],cr),Wt=Xt.getArray("BBox")||[0,0,1,1],er=Xt.getArray("Matrix")||[1,0,0,1,0,0],lr=Bt(sr.rect,Wt,er),ur=new ct.OperatorList;let pr;return this.oc&&(pr=await Yt.parseMarkedContentProps(this.oc,null)),pr!==void 0&&ur.addOp(rt.OPS.beginMarkedContentProps,["OC",pr]),ur.addOp(rt.OPS.beginAnnotation,[sr.id,sr.rect,lr,er,or]),await Yt.getOperatorList({stream:cr,task:Kt,resources:Gt,operatorList:ur,fallbackFontDict:this._fallbackFontDict}),ur.addOp(rt.OPS.endAnnotation,[]),pr!==void 0&&ur.addOp(rt.OPS.endMarkedContent,[]),this.reset(),{opList:ur,separateForm:!1,separateCanvas:or}}async save(Yt,Kt,nr){return null}get hasTextContent(){return!1}async extractTextContent(Yt,Kt,nr){if(!this.appearance)return;const tr=await this.loadResources(["ExtGState","Font","Properties","XObject"],this.appearance),ir=[],sr=[];let cr=null;const or={desiredSize:Math.Infinity,ready:!0,enqueue(Xt,Gt){for(const Wt of Xt.items)Wt.str!==void 0&&(cr||(cr=Wt.transform.slice(-2)),sr.push(Wt.str),Wt.hasEOL&&(ir.push(sr.join("")),sr.length=0))}};if(await Yt.getTextContent({stream:this.appearance,task:Kt,resources:tr,includeMarkedContent:!0,sink:or,viewBox:nr}),this.reset(),sr.length&&ir.push(sr.join("")),ir.length>1||ir[0]){const Xt=this.appearance.dict,Gt=Xt.getArray("BBox")||[0,0,1,1],Wt=Xt.getArray("Matrix")||[1,0,0,1,0,0],er=this.data.rect,lr=Bt(er,Gt,Wt);lr[4]-=er[0],lr[5]-=er[1],cr=rt.Util.applyTransform(cr,lr),cr=rt.Util.applyTransform(cr,Wt),this.data.textPosition=cr,this.data.textContent=ir}}getFieldObject(){return this.data.kidIds?{id:this.data.id,actions:this.data.actions,name:this.data.fieldName,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,type:"",kidIds:this.data.kidIds,page:this.data.pageIndex,rotation:this.rotation}:null}reset(){for(const Yt of this._streams)Yt.reset()}_constructFieldName(Yt){if(!Yt.has("T")&&!Yt.has("Parent"))return(0,rt.warn)("Unknown field name, falling back to empty field name."),"";if(!Yt.has("Parent"))return(0,rt.stringToPDFString)(Yt.get("T"));const Kt=[];Yt.has("T")&&Kt.unshift((0,rt.stringToPDFString)(Yt.get("T")));let nr=Yt;const tr=new et.RefSet;for(Yt.objId&&tr.put(Yt.objId);nr.has("Parent")&&(nr=nr.get("Parent"),!(!(nr instanceof et.Dict)||nr.objId&&tr.has(nr.objId)));)nr.objId&&tr.put(nr.objId),nr.has("T")&&Kt.unshift((0,rt.stringToPDFString)(nr.get("T")));return Kt.join(".")}}at.Annotation=Ot;class Pt{constructor(){this.width=1,this.style=rt.AnnotationBorderStyleType.SOLID,this.dashArray=[3],this.horizontalCornerRadius=0,this.verticalCornerRadius=0}setWidth(Yt){let Kt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0,0];if(Yt instanceof et.Name){this.width=0;return}if(typeof Yt=="number"){if(Yt>0){const nr=(Kt[2]-Kt[0])/2,tr=(Kt[3]-Kt[1])/2;nr>0&&tr>0&&(Yt>nr||Yt>tr)&&((0,rt.warn)(`AnnotationBorderStyle.setWidth - ignoring width: ${Yt}`),Yt=1)}this.width=Yt}}setStyle(Yt){if(Yt instanceof et.Name)switch(Yt.name){case"S":this.style=rt.AnnotationBorderStyleType.SOLID;break;case"D":this.style=rt.AnnotationBorderStyleType.DASHED;break;case"B":this.style=rt.AnnotationBorderStyleType.BEVELED;break;case"I":this.style=rt.AnnotationBorderStyleType.INSET;break;case"U":this.style=rt.AnnotationBorderStyleType.UNDERLINE;break}}setDashArray(Yt){let Kt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(Array.isArray(Yt)&&Yt.length>0){let nr=!0,tr=!0;for(const ir of Yt)if(+ir>=0)ir>0&&(tr=!1);else{nr=!1;break}nr&&!tr?(this.dashArray=Yt,Kt&&this.setStyle(et.Name.get("D"))):this.width=0}else Yt&&(this.width=0)}setHorizontalCornerRadius(Yt){Number.isInteger(Yt)&&(this.horizontalCornerRadius=Yt)}setVerticalCornerRadius(Yt){Number.isInteger(Yt)&&(this.verticalCornerRadius=Yt)}}at.AnnotationBorderStyle=Pt;class wt extends Ot{constructor(Yt){super(Yt);const{dict:Kt}=Yt;if(Kt.has("IRT")){const tr=Kt.getRaw("IRT");this.data.inReplyTo=tr instanceof et.Ref?tr.toString():null;const ir=Kt.get("RT");this.data.replyType=ir instanceof et.Name?ir.name:rt.AnnotationReplyType.REPLY}let nr=null;if(this.data.replyType===rt.AnnotationReplyType.GROUP){const tr=Kt.get("IRT");this.setTitle(tr.get("T")),this.data.titleObj=this._title,this.setContents(tr.get("Contents")),this.data.contentsObj=this._contents,tr.has("CreationDate")?(this.setCreationDate(tr.get("CreationDate")),this.data.creationDate=this.creationDate):this.data.creationDate=null,tr.has("M")?(this.setModificationDate(tr.get("M")),this.data.modificationDate=this.modificationDate):this.data.modificationDate=null,nr=tr.getRaw("Popup"),tr.has("C")?(this.setColor(tr.getArray("C")),this.data.color=this.color):this.data.color=null}else this.data.titleObj=this._title,this.setCreationDate(Kt.get("CreationDate")),this.data.creationDate=this.creationDate,nr=Kt.getRaw("Popup"),Kt.has("C")||(this.data.color=null);this.data.popupRef=nr instanceof et.Ref?nr.toString():null,Kt.has("RC")&&(this.data.richText=At.XFAFactory.getRichTextAsHtml(Kt.get("RC")))}setCreationDate(Yt){this.creationDate=typeof Yt=="string"?Yt:null}_setDefaultAppearance(Yt){let{xref:Kt,extra:nr,strokeColor:tr,fillColor:ir,blendMode:sr,strokeAlpha:cr,fillAlpha:or,pointsCallback:Xt}=Yt,Gt=Number.MAX_VALUE,Wt=Number.MAX_VALUE,er=Number.MIN_VALUE,lr=Number.MIN_VALUE;const ur=["q"];nr&&ur.push(nr),tr&&ur.push(`${tr[0]} ${tr[1]} ${tr[2]} RG`),ir&&ur.push(`${ir[0]} ${ir[1]} ${ir[2]} rg`);let pr=this.data.quadPoints;pr||(pr=[[{x:this.rectangle[0],y:this.rectangle[3]},{x:this.rectangle[2],y:this.rectangle[3]},{x:this.rectangle[0],y:this.rectangle[1]},{x:this.rectangle[2],y:this.rectangle[1]}]]);for(const hr of pr){const[vr,xr,Pr,Rr]=Xt(ur,hr);Gt=Math.min(Gt,vr),er=Math.max(er,xr),Wt=Math.min(Wt,Pr),lr=Math.max(lr,Rr)}ur.push("Q");const yr=new et.Dict(Kt),Er=new et.Dict(Kt);Er.set("Subtype",et.Name.get("Form"));const br=new it.StringStream(ur.join(" "));br.dict=Er,yr.set("Fm0",br);const gr=new et.Dict(Kt);sr&&gr.set("BM",et.Name.get(sr)),typeof cr=="number"&&gr.set("CA",cr),typeof or=="number"&&gr.set("ca",or);const Ar=new et.Dict(Kt);Ar.set("GS0",gr);const Sr=new et.Dict(Kt);Sr.set("ExtGState",Ar),Sr.set("XObject",yr);const Br=new et.Dict(Kt);Br.set("Resources",Sr);const Ir=this.data.rect=[Gt,Wt,er,lr];Br.set("BBox",Ir),this.appearance=new it.StringStream("/GS0 gs /Fm0 Do"),this.appearance.dict=Br,this._streams.push(this.appearance,br)}static async createNewAnnotation(Yt,Kt,nr,tr){const ir=Kt.ref||(Kt.ref=Yt.getNewTemporaryRef()),sr=await this.createNewAppearanceStream(Kt,Yt,tr),cr=[];let or;if(sr){const Xt=Yt.getNewTemporaryRef();or=this.createNewDict(Kt,Yt,{apRef:Xt}),await(0,vt.writeObject)(Xt,sr,cr,Yt),nr.push({ref:Xt,data:cr.join("")})}else or=this.createNewDict(Kt,Yt,{});return Number.isInteger(Kt.parentTreeId)&&or.set("StructParent",Kt.parentTreeId),cr.length=0,await(0,vt.writeObject)(ir,or,cr,Yt),{ref:ir,data:cr.join("")}}static async createNewPrintAnnotation(Yt,Kt,nr,tr){const ir=await this.createNewAppearanceStream(nr,Kt,tr),sr=this.createNewDict(nr,Kt,{ap:ir}),cr=new this.prototype.constructor({dict:sr,xref:Kt,annotationGlobals:Yt,evaluatorOptions:tr.evaluatorOptions});return nr.ref&&(cr.ref=cr.refToReplace=nr.ref),cr}}at.MarkupAnnotation=wt;class Ct extends Ot{constructor(Yt){var er;super(Yt);const{dict:Kt,xref:nr,annotationGlobals:tr}=Yt,ir=this.data;this._needAppearances=Yt.needAppearances,ir.annotationType=rt.AnnotationType.WIDGET,ir.fieldName===void 0&&(ir.fieldName=this._constructFieldName(Kt)),ir.actions===void 0&&(ir.actions=(0,st.collectActions)(nr,Kt,rt.AnnotationActionEventType));let sr=(0,st.getInheritableProperty)({dict:Kt,key:"V",getArray:!0});ir.fieldValue=this._decodeFormValue(sr);const cr=(0,st.getInheritableProperty)({dict:Kt,key:"DV",getArray:!0});if(ir.defaultFieldValue=this._decodeFormValue(cr),sr===void 0&&tr.xfaDatasets){const lr=this._title.str;lr&&(this._hasValueFromXFA=!0,ir.fieldValue=sr=tr.xfaDatasets.getValue(lr))}sr===void 0&&ir.defaultFieldValue!==null&&(ir.fieldValue=ir.defaultFieldValue),ir.alternativeText=(0,rt.stringToPDFString)(Kt.get("TU")||""),this.setDefaultAppearance(Yt),ir.hasAppearance||(ir.hasAppearance=this._needAppearances&&ir.fieldValue!==void 0&&ir.fieldValue!==null);const or=(0,st.getInheritableProperty)({dict:Kt,key:"FT"});ir.fieldType=or instanceof et.Name?or.name:null;const Xt=(0,st.getInheritableProperty)({dict:Kt,key:"DR"}),Gt=tr.acroForm.get("DR"),Wt=(er=this.appearance)==null?void 0:er.dict.get("Resources");this._fieldResources={localResources:Xt,acroFormResources:Gt,appearanceResources:Wt,mergedResources:et.Dict.merge({xref:nr,dictArray:[Xt,Wt,Gt],mergeSubDicts:!0})},ir.fieldFlags=(0,st.getInheritableProperty)({dict:Kt,key:"Ff"}),(!Number.isInteger(ir.fieldFlags)||ir.fieldFlags<0)&&(ir.fieldFlags=0),ir.readOnly=this.hasFieldFlag(rt.AnnotationFieldFlag.READONLY),ir.required=this.hasFieldFlag(rt.AnnotationFieldFlag.REQUIRED),ir.hidden=this._hasFlag(ir.annotationFlags,rt.AnnotationFlag.HIDDEN)||this._hasFlag(ir.annotationFlags,rt.AnnotationFlag.NOVIEW)}_decodeFormValue(Yt){return Array.isArray(Yt)?Yt.filter(Kt=>typeof Kt=="string").map(Kt=>(0,rt.stringToPDFString)(Kt)):Yt instanceof et.Name?(0,rt.stringToPDFString)(Yt.name):typeof Yt=="string"?(0,rt.stringToPDFString)(Yt):null}hasFieldFlag(Yt){return!!(this.data.fieldFlags&Yt)}_isViewable(Yt){return!this._hasFlag(Yt,rt.AnnotationFlag.INVISIBLE)}mustBeViewed(Yt,Kt){return Kt?this.viewable:super.mustBeViewed(Yt,Kt)&&!this._hasFlag(this.flags,rt.AnnotationFlag.NOVIEW)}getRotationMatrix(Yt){var ir;let Kt=(ir=Yt==null?void 0:Yt.get(this.data.id))==null?void 0:ir.rotation;if(Kt===void 0&&(Kt=this.rotation),Kt===0)return rt.IDENTITY_MATRIX;const nr=this.data.rect[2]-this.data.rect[0],tr=this.data.rect[3]-this.data.rect[1];return(0,st.getRotationMatrix)(Kt,nr,tr)}getBorderAndBackgroundAppearances(Yt){var cr;let Kt=(cr=Yt==null?void 0:Yt.get(this.data.id))==null?void 0:cr.rotation;if(Kt===void 0&&(Kt=this.rotation),!this.backgroundColor&&!this.borderColor)return"";const nr=this.data.rect[2]-this.data.rect[0],tr=this.data.rect[3]-this.data.rect[1],ir=Kt===0||Kt===180?`0 0 ${nr} ${tr} re`:`0 0 ${tr} ${nr} re`;let sr="";if(this.backgroundColor&&(sr=`${(0,lt.getPdfColor)(this.backgroundColor,!0)} ${ir} f `),this.borderColor){const or=this.borderStyle.width||1;sr+=`${or} w ${(0,lt.getPdfColor)(this.borderColor,!1)} ${ir} S `}return sr}async getOperatorList(Yt,Kt,nr,tr,ir){if(tr&&!(this instanceof kt)&&!this.data.noHTML&&!this.data.hasOwnCanvas)return{opList:new ct.OperatorList,separateForm:!0,separateCanvas:!1};if(!this._hasText)return super.getOperatorList(Yt,Kt,nr,tr,ir);const sr=await this._getAppearance(Yt,Kt,nr,ir);if(this.appearance&&sr===null)return super.getOperatorList(Yt,Kt,nr,tr,ir);const cr=new ct.OperatorList;if(!this._defaultAppearance||sr===null)return{opList:cr,separateForm:!1,separateCanvas:!1};const or=!!(this.data.hasOwnCanvas&&nr&rt.RenderingIntentFlag.DISPLAY),Xt=[1,0,0,1,0,0],Gt=[0,0,this.data.rect[2]-this.data.rect[0],this.data.rect[3]-this.data.rect[1]],Wt=Bt(this.data.rect,Gt,Xt);let er;this.oc&&(er=await Yt.parseMarkedContentProps(this.oc,null)),er!==void 0&&cr.addOp(rt.OPS.beginMarkedContentProps,["OC",er]),cr.addOp(rt.OPS.beginAnnotation,[this.data.id,this.data.rect,Wt,this.getRotationMatrix(ir),or]);const lr=new it.StringStream(sr);return await Yt.getOperatorList({stream:lr,task:Kt,resources:this._fieldResources.mergedResources,operatorList:cr}),cr.addOp(rt.OPS.endAnnotation,[]),er!==void 0&&cr.addOp(rt.OPS.endMarkedContent,[]),{opList:cr,separateForm:!1,separateCanvas:or}}_getMKDict(Yt){const Kt=new et.Dict(null);return Yt&&Kt.set("R",Yt),this.borderColor&&Kt.set("BC",Et(this.borderColor)),this.backgroundColor&&Kt.set("BG",Et(this.backgroundColor)),Kt.size>0?Kt:null}amendSavedDict(Yt,Kt){}async save(Yt,Kt,nr){const tr=nr==null?void 0:nr.get(this.data.id);let ir=tr==null?void 0:tr.value,sr=tr==null?void 0:tr.rotation;if(ir===this.data.fieldValue||ir===void 0){if(!this._hasValueFromXFA&&sr===void 0)return null;ir||(ir=this.data.fieldValue)}if(sr===void 0&&!this._hasValueFromXFA&&Array.isArray(ir)&&Array.isArray(this.data.fieldValue)&&ir.length===this.data.fieldValue.length&&ir.every((Er,br)=>Er===this.data.fieldValue[br]))return null;sr===void 0&&(sr=this.rotation);let cr=null;if(!this._needAppearances&&(cr=await this._getAppearance(Yt,Kt,rt.RenderingIntentFlag.SAVE,nr),cr===null))return null;let or=!1;cr!=null&&cr.needAppearances&&(or=!0,cr=null);const{xref:Xt}=Yt,Gt=Xt.fetchIfRef(this.ref);if(!(Gt instanceof et.Dict))return null;const Wt=new et.Dict(Xt);for(const Er of Gt.getKeys())Er!=="AP"&&Wt.set(Er,Gt.getRaw(Er));const er={path:this.data.fieldName,value:ir},lr=Er=>(0,st.isAscii)(Er)?Er:(0,st.stringToUTF16String)(Er,!0);Wt.set("V",Array.isArray(ir)?ir.map(lr):lr(ir)),this.amendSavedDict(nr,Wt);const ur=this._getMKDict(sr);ur&&Wt.set("MK",ur);const pr=[],yr=[{ref:this.ref,data:"",xfa:er,needAppearances:or}];if(cr!==null){const Er=Xt.getNewTemporaryRef(),br=new et.Dict(Xt);Wt.set("AP",br),br.set("N",Er);const gr=this._getSaveFieldResources(Xt),Ar=new it.StringStream(cr),Sr=Ar.dict=new et.Dict(Xt);Sr.set("Subtype",et.Name.get("Form")),Sr.set("Resources",gr),Sr.set("BBox",[0,0,this.data.rect[2]-this.data.rect[0],this.data.rect[3]-this.data.rect[1]]);const Br=this.getRotationMatrix(nr);Br!==rt.IDENTITY_MATRIX&&Sr.set("Matrix",Br),await(0,vt.writeObject)(Er,Ar,pr,Xt),yr.push({ref:Er,data:pr.join(""),xfa:null,needAppearances:!1}),pr.length=0}return Wt.set("M",`D:${(0,rt.getModificationDate)()}`),await(0,vt.writeObject)(this.ref,Wt,pr,Xt),yr[0].data=pr.join(""),yr}async _getAppearance(Yt,Kt,nr,tr){if(this.hasFieldFlag(rt.AnnotationFieldFlag.PASSWORD))return null;const sr=tr==null?void 0:tr.get(this.data.id);let cr,or;if(sr&&(cr=sr.formattedValue||sr.value,or=sr.rotation),or===void 0&&cr===void 0&&!this._needAppearances&&(!this._hasValueFromXFA||this.appearance))return null;const Xt=this.getBorderAndBackgroundAppearances(tr);if(cr===void 0&&(cr=this.data.fieldValue,!cr))return`/Tx BMC q ${Xt}Q EMC`;if(Array.isArray(cr)&&cr.length===1&&(cr=cr[0]),(0,rt.assert)(typeof cr=="string","Expected `value` to be a string."),cr=cr.trim(),this.data.combo){const Rr=this.data.options.find(Dr=>{let{exportValue:Gr}=Dr;return cr===Gr});cr=(Rr==null?void 0:Rr.displayValue)||cr}if(cr==="")return`/Tx BMC q ${Xt}Q EMC`;or===void 0&&(or=this.rotation);let Gt=-1,Wt;this.data.multiLine?(Wt=cr.split(/\r\n?|\n/).map(Rr=>Rr.normalize("NFC")),Gt=Wt.length):Wt=[cr.replace(/\r\n?|\n/,"").normalize("NFC")];const er=1,lr=2;let ur=this.data.rect[3]-this.data.rect[1],pr=this.data.rect[2]-this.data.rect[0];(or===90||or===270)&&([pr,ur]=[ur,pr]),this._defaultAppearance||(this.data.defaultAppearanceData=(0,lt.parseDefaultAppearance)(this._defaultAppearance="/Helvetica 0 Tf 0 g"));let yr=await Ct._getFontData(Yt,Kt,this.data.defaultAppearanceData,this._fieldResources.mergedResources),Er,br,gr;const Ar=[];let Sr=!1;for(const Rr of Wt){const Dr=yr.encodeString(Rr);Dr.length>1&&(Sr=!0),Ar.push(Dr.join(""))}if(Sr&&nr&rt.RenderingIntentFlag.SAVE)return{needAppearances:!0};if(Sr&&this._isOffscreenCanvasSupported){const Rr=this.data.comb?"monospace":"sans-serif",Dr=new lt.FakeUnicodeFont(Yt.xref,Rr),Gr=Dr.createFontResources(Wt.join("")),Or=Gr.getRaw("Font");if(this._fieldResources.mergedResources.has("Font")){const Tr=this._fieldResources.mergedResources.get("Font");for(const fr of Or.getKeys())Tr.set(fr,Or.getRaw(fr))}else this._fieldResources.mergedResources.set("Font",Or);const Hr=Dr.fontName.name;yr=await Ct._getFontData(Yt,Kt,{fontName:Hr,fontSize:0},Gr);for(let Tr=0,fr=Ar.length;Tr<fr;Tr++)Ar[Tr]=(0,st.stringToUTF16String)(Wt[Tr]);const jr=Object.assign(Object.create(null),this.data.defaultAppearanceData);this.data.defaultAppearanceData.fontSize=0,this.data.defaultAppearanceData.fontName=Hr,[Er,br,gr]=this._computeFontSize(ur-2*er,pr-2*lr,cr,yr,Gt),this.data.defaultAppearanceData=jr}else this._isOffscreenCanvasSupported||(0,rt.warn)("_getAppearance: OffscreenCanvas is not supported, annotation may not render correctly."),[Er,br,gr]=this._computeFontSize(ur-2*er,pr-2*lr,cr,yr,Gt);let Br=yr.descent;isNaN(Br)?Br=rt.BASELINE_FACTOR*gr:Br=Math.max(rt.BASELINE_FACTOR*gr,Math.abs(Br)*br);const Ir=Math.min(Math.floor((ur-br)/2),er),hr=this.data.textAlignment;if(this.data.multiLine)return this._getMultilineAppearance(Er,Ar,yr,br,pr,ur,hr,lr,Ir,Br,gr,tr);if(this.data.comb)return this._getCombAppearance(Er,yr,Ar[0],br,pr,ur,lr,Ir,Br,gr,tr);const vr=Ir+Br;if(hr===0||hr>2)return`/Tx BMC q ${Xt}BT `+Er+` 1 0 0 1 ${(0,st.numberToString)(lr)} ${(0,st.numberToString)(vr)} Tm (${(0,st.escapeString)(Ar[0])}) Tj ET Q EMC`;const xr={shift:0},Pr=this._renderText(Ar[0],yr,br,pr,hr,xr,lr,vr);return`/Tx BMC q ${Xt}BT `+Er+` 1 0 0 1 0 0 Tm ${Pr} ET Q EMC`}static async _getFontData(Yt,Kt,nr,tr){const ir=new ct.OperatorList,sr={font:null,clone(){return this}},{fontName:cr,fontSize:or}=nr;return await Yt.handleSetFont(tr,[cr&&et.Name.get(cr),or],null,ir,Kt,sr,null),sr.font}_getTextWidth(Yt,Kt){return Kt.charsToGlyphs(Yt).reduce((nr,tr)=>nr+tr.width,0)/1e3}_computeFontSize(Yt,Kt,nr,tr,ir){let{fontSize:sr}=this.data.defaultAppearanceData,cr=(sr||12)*rt.LINE_FACTOR,or=Math.round(Yt/cr);if(!sr){const Xt=er=>Math.floor(er*100)/100;if(ir===-1){const er=this._getTextWidth(nr,tr);sr=Xt(Math.min(Yt/rt.LINE_FACTOR,er>Kt?Kt/er:1/0)),or=1}else{const er=nr.split(/\r\n?|\n/),lr=[];for(const pr of er){const yr=tr.encodeString(pr).join(""),Er=tr.charsToGlyphs(yr),br=tr.getCharPositions(yr);lr.push({line:yr,glyphs:Er,positions:br})}const ur=pr=>{let yr=0;for(const Er of lr){const br=this._splitLine(null,tr,pr,Kt,Er);if(yr+=br.length*pr,yr>Yt)return!0}return!1};for(or=Math.max(or,ir);;){if(cr=Yt/or,sr=Xt(cr/rt.LINE_FACTOR),ur(sr)){or++;continue}break}}const{fontName:Gt,fontColor:Wt}=this.data.defaultAppearanceData;this._defaultAppearance=(0,lt.createDefaultAppearance)({fontSize:sr,fontName:Gt,fontColor:Wt})}return[this._defaultAppearance,sr,Yt/or]}_renderText(Yt,Kt,nr,tr,ir,sr,cr,or){let Xt;if(ir===1){const Wt=this._getTextWidth(Yt,Kt)*nr;Xt=(tr-Wt)/2}else if(ir===2){const Wt=this._getTextWidth(Yt,Kt)*nr;Xt=tr-Wt-cr}else Xt=cr;const Gt=(0,st.numberToString)(Xt-sr.shift);return sr.shift=Xt,or=(0,st.numberToString)(or),`${Gt} ${or} Td (${(0,st.escapeString)(Yt)}) Tj`}_getSaveFieldResources(Yt){var sr;const{localResources:Kt,appearanceResources:nr,acroFormResources:tr}=this._fieldResources,ir=(sr=this.data.defaultAppearanceData)==null?void 0:sr.fontName;if(!ir)return Kt||et.Dict.empty;for(const cr of[Kt,nr])if(cr instanceof et.Dict){const or=cr.get("Font");if(or instanceof et.Dict&&or.has(ir))return cr}if(tr instanceof et.Dict){const cr=tr.get("Font");if(cr instanceof et.Dict&&cr.has(ir)){const or=new et.Dict(Yt);or.set(ir,cr.getRaw(ir));const Xt=new et.Dict(Yt);return Xt.set("Font",or),et.Dict.merge({xref:Yt,dictArray:[Xt,Kt],mergeSubDicts:!0})}}return Kt||et.Dict.empty}getFieldObject(){return null}}class It extends Ct{constructor(Yt){super(Yt),this.data.hasOwnCanvas=this.data.readOnly&&!this.data.noHTML,this._hasText=!0;const Kt=Yt.dict;typeof this.data.fieldValue!="string"&&(this.data.fieldValue="");let nr=(0,st.getInheritableProperty)({dict:Kt,key:"Q"});(!Number.isInteger(nr)||nr<0||nr>2)&&(nr=null),this.data.textAlignment=nr;let tr=(0,st.getInheritableProperty)({dict:Kt,key:"MaxLen"});(!Number.isInteger(tr)||tr<0)&&(tr=0),this.data.maxLen=tr,this.data.multiLine=this.hasFieldFlag(rt.AnnotationFieldFlag.MULTILINE),this.data.comb=this.hasFieldFlag(rt.AnnotationFieldFlag.COMB)&&!this.hasFieldFlag(rt.AnnotationFieldFlag.MULTILINE)&&!this.hasFieldFlag(rt.AnnotationFieldFlag.PASSWORD)&&!this.hasFieldFlag(rt.AnnotationFieldFlag.FILESELECT)&&this.data.maxLen!==0,this.data.doNotScroll=this.hasFieldFlag(rt.AnnotationFieldFlag.DONOTSCROLL)}get hasTextContent(){return!!this.appearance&&!this._needAppearances}_getCombAppearance(Yt,Kt,nr,tr,ir,sr,cr,or,Xt,Gt,Wt){const er=ir/this.data.maxLen,lr=this.getBorderAndBackgroundAppearances(Wt),ur=[],pr=Kt.getCharPositions(nr);for(const[Er,br]of pr)ur.push(`(${(0,st.escapeString)(nr.substring(Er,br))}) Tj`);const yr=ur.join(` ${(0,st.numberToString)(er)} 0 Td `);return`/Tx BMC q ${lr}BT `+Yt+` 1 0 0 1 ${(0,st.numberToString)(cr)} ${(0,st.numberToString)(or+Xt)} Tm ${yr} ET Q EMC`}_getMultilineAppearance(Yt,Kt,nr,tr,ir,sr,cr,or,Xt,Gt,Wt,er){const lr=[],ur=ir-2*or,pr={shift:0};for(let br=0,gr=Kt.length;br<gr;br++){const Ar=Kt[br],Sr=this._splitLine(Ar,nr,tr,ur);for(let Br=0,Ir=Sr.length;Br<Ir;Br++){const hr=Sr[Br],vr=br===0&&Br===0?-Xt-(Wt-Gt):-Wt;lr.push(this._renderText(hr,nr,tr,ir,cr,pr,or,vr))}}const yr=this.getBorderAndBackgroundAppearances(er),Er=lr.join(`
|
52
52
|
`);return`/Tx BMC q ${yr}BT `+Yt+` 1 0 0 1 0 ${(0,st.numberToString)(sr)} Tm ${Er} ET Q EMC`}_splitLine(Yt,Kt,nr,tr){let ir=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{};Yt=ir.line||Yt;const sr=ir.glyphs||Kt.charsToGlyphs(Yt);if(sr.length<=1)return[Yt];const cr=ir.positions||Kt.getCharPositions(Yt),or=nr/1e3,Xt=[];let Gt=-1,Wt=-1,er=-1,lr=0,ur=0;for(let pr=0,yr=sr.length;pr<yr;pr++){const[Er,br]=cr[pr],gr=sr[pr],Ar=gr.width*or;gr.unicode===" "?ur+Ar>tr?(Xt.push(Yt.substring(lr,Er)),lr=Er,ur=Ar,Gt=-1,er=-1):(ur+=Ar,Gt=Er,Wt=br,er=pr):ur+Ar>tr?Gt!==-1?(Xt.push(Yt.substring(lr,Wt)),lr=Wt,pr=er+1,Gt=-1,ur=0):(Xt.push(Yt.substring(lr,Er)),lr=Er,ur=Ar):ur+=Ar}return lr<Yt.length&&Xt.push(Yt.substring(lr,Yt.length)),Xt}getFieldObject(){return{id:this.data.id,value:this.data.fieldValue,defaultValue:this.data.defaultFieldValue||"",multiline:this.data.multiLine,password:this.hasFieldFlag(rt.AnnotationFieldFlag.PASSWORD),charLimit:this.data.maxLen,comb:this.data.comb,editable:!this.data.readOnly,hidden:this.data.hidden,name:this.data.fieldName,rect:this.data.rect,actions:this.data.actions,page:this.data.pageIndex,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,rotation:this.rotation,type:"text"}}}class yt extends Ct{constructor(Yt){super(Yt),this.checkedAppearance=null,this.uncheckedAppearance=null,this.data.checkBox=!this.hasFieldFlag(rt.AnnotationFieldFlag.RADIO)&&!this.hasFieldFlag(rt.AnnotationFieldFlag.PUSHBUTTON),this.data.radioButton=this.hasFieldFlag(rt.AnnotationFieldFlag.RADIO)&&!this.hasFieldFlag(rt.AnnotationFieldFlag.PUSHBUTTON),this.data.pushButton=this.hasFieldFlag(rt.AnnotationFieldFlag.PUSHBUTTON),this.data.isTooltipOnly=!1,this.data.checkBox?this._processCheckBox(Yt):this.data.radioButton?this._processRadioButton(Yt):this.data.pushButton?(this.data.hasOwnCanvas=!0,this._processPushButton(Yt)):(0,rt.warn)("Invalid field flags for button widget annotation")}async getOperatorList(Yt,Kt,nr,tr,ir){if(this.data.pushButton)return super.getOperatorList(Yt,Kt,nr,!1,ir);let sr=null,cr=null;if(ir){const Xt=ir.get(this.data.id);sr=Xt?Xt.value:null,cr=Xt?Xt.rotation:null}if(sr===null&&this.appearance)return super.getOperatorList(Yt,Kt,nr,tr,ir);sr==null&&(sr=this.data.checkBox?this.data.fieldValue===this.data.exportValue:this.data.fieldValue===this.data.buttonValue);const or=sr?this.checkedAppearance:this.uncheckedAppearance;if(or){const Xt=this.appearance,Gt=or.dict.getArray("Matrix")||rt.IDENTITY_MATRIX;cr&&or.dict.set("Matrix",this.getRotationMatrix(ir)),this.appearance=or;const Wt=super.getOperatorList(Yt,Kt,nr,tr,ir);return this.appearance=Xt,or.dict.set("Matrix",Gt),Wt}return{opList:new ct.OperatorList,separateForm:!1,separateCanvas:!1}}async save(Yt,Kt,nr){return this.data.checkBox?this._saveCheckbox(Yt,Kt,nr):this.data.radioButton?this._saveRadioButton(Yt,Kt,nr):null}async _saveCheckbox(Yt,Kt,nr){if(!nr)return null;const tr=nr.get(this.data.id);let ir=tr==null?void 0:tr.rotation,sr=tr==null?void 0:tr.value;if(ir===void 0&&(sr===void 0||this.data.fieldValue===this.data.exportValue===sr))return null;const cr=Yt.xref.fetchIfRef(this.ref);if(!(cr instanceof et.Dict))return null;ir===void 0&&(ir=this.rotation),sr===void 0&&(sr=this.data.fieldValue===this.data.exportValue);const or={path:this.data.fieldName,value:sr?this.data.exportValue:""},Xt=et.Name.get(sr?this.data.exportValue:"Off");cr.set("V",Xt),cr.set("AS",Xt),cr.set("M",`D:${(0,rt.getModificationDate)()}`);const Gt=this._getMKDict(ir);Gt&&cr.set("MK",Gt);const Wt=[];return await(0,vt.writeObject)(this.ref,cr,Wt,Yt.xref),[{ref:this.ref,data:Wt.join(""),xfa:or}]}async _saveRadioButton(Yt,Kt,nr){if(!nr)return null;const tr=nr.get(this.data.id);let ir=tr==null?void 0:tr.rotation,sr=tr==null?void 0:tr.value;if(ir===void 0&&(sr===void 0||this.data.fieldValue===this.data.buttonValue===sr))return null;const cr=Yt.xref.fetchIfRef(this.ref);if(!(cr instanceof et.Dict))return null;sr===void 0&&(sr=this.data.fieldValue===this.data.buttonValue),ir===void 0&&(ir=this.rotation);const or={path:this.data.fieldName,value:sr?this.data.buttonValue:""},Xt=et.Name.get(sr?this.data.buttonValue:"Off"),Gt=[];let Wt=null;if(sr)if(this.parent instanceof et.Ref){const ur=Yt.xref.fetch(this.parent);ur.set("V",Xt),await(0,vt.writeObject)(this.parent,ur,Gt,Yt.xref),Wt=Gt.join(""),Gt.length=0}else this.parent instanceof et.Dict&&this.parent.set("V",Xt);cr.set("AS",Xt),cr.set("M",`D:${(0,rt.getModificationDate)()}`);const er=this._getMKDict(ir);er&&cr.set("MK",er),await(0,vt.writeObject)(this.ref,cr,Gt,Yt.xref);const lr=[{ref:this.ref,data:Gt.join(""),xfa:or}];return Wt&&lr.push({ref:this.parent,data:Wt,xfa:null}),lr}_getDefaultCheckedAppearance(Yt,Kt){const nr=this.data.rect[2]-this.data.rect[0],tr=this.data.rect[3]-this.data.rect[1],ir=[0,0,nr,tr],sr=.8,cr=Math.min(nr,tr)*sr;let or,Xt;Kt==="check"?(or={width:.755*cr,height:.705*cr},Xt="3"):Kt==="disc"?(or={width:.791*cr,height:.705*cr},Xt="l"):(0,rt.unreachable)(`_getDefaultCheckedAppearance - unsupported type: ${Kt}`);const Gt=(0,st.numberToString)((nr-or.width)/2),Wt=(0,st.numberToString)((tr-or.height)/2),er=`q BT /PdfJsZaDb ${cr} Tf 0 g ${Gt} ${Wt} Td (${Xt}) Tj ET Q`,lr=new et.Dict(Yt.xref);lr.set("FormType",1),lr.set("Subtype",et.Name.get("Form")),lr.set("Type",et.Name.get("XObject")),lr.set("BBox",ir),lr.set("Matrix",[1,0,0,1,0,0]),lr.set("Length",er.length);const ur=new et.Dict(Yt.xref),pr=new et.Dict(Yt.xref);pr.set("PdfJsZaDb",this.fallbackFontDict),ur.set("Font",pr),lr.set("Resources",ur),this.checkedAppearance=new it.StringStream(er),this.checkedAppearance.dict=lr,this._streams.push(this.checkedAppearance)}_processCheckBox(Yt){const Kt=Yt.dict.get("AP");if(!(Kt instanceof et.Dict))return;const nr=Kt.get("N");if(!(nr instanceof et.Dict))return;const tr=this._decodeFormValue(Yt.dict.get("AS"));typeof tr=="string"&&(this.data.fieldValue=tr);const ir=this.data.fieldValue!==null&&this.data.fieldValue!=="Off"?this.data.fieldValue:"Yes",sr=nr.getKeys();if(sr.length===0)sr.push("Off",ir);else if(sr.length===1)sr[0]==="Off"?sr.push(ir):sr.unshift("Off");else if(sr.includes(ir))sr.length=0,sr.push("Off",ir);else{const Xt=sr.find(Gt=>Gt!=="Off");sr.length=0,sr.push("Off",Xt)}sr.includes(this.data.fieldValue)||(this.data.fieldValue="Off"),this.data.exportValue=sr[1];const cr=nr.get(this.data.exportValue);this.checkedAppearance=cr instanceof ut.BaseStream?cr:null;const or=nr.get("Off");this.uncheckedAppearance=or instanceof ut.BaseStream?or:null,this.checkedAppearance?this._streams.push(this.checkedAppearance):this._getDefaultCheckedAppearance(Yt,"check"),this.uncheckedAppearance&&this._streams.push(this.uncheckedAppearance),this._fallbackFontDict=this.fallbackFontDict,this.data.defaultFieldValue===null&&(this.data.defaultFieldValue="Off")}_processRadioButton(Yt){this.data.fieldValue=this.data.buttonValue=null;const Kt=Yt.dict.get("Parent");if(Kt instanceof et.Dict){this.parent=Yt.dict.getRaw("Parent");const cr=Kt.get("V");cr instanceof et.Name&&(this.data.fieldValue=this._decodeFormValue(cr))}const nr=Yt.dict.get("AP");if(!(nr instanceof et.Dict))return;const tr=nr.get("N");if(!(tr instanceof et.Dict))return;for(const cr of tr.getKeys())if(cr!=="Off"){this.data.buttonValue=this._decodeFormValue(cr);break}const ir=tr.get(this.data.buttonValue);this.checkedAppearance=ir instanceof ut.BaseStream?ir:null;const sr=tr.get("Off");this.uncheckedAppearance=sr instanceof ut.BaseStream?sr:null,this.checkedAppearance?this._streams.push(this.checkedAppearance):this._getDefaultCheckedAppearance(Yt,"disc"),this.uncheckedAppearance&&this._streams.push(this.uncheckedAppearance),this._fallbackFontDict=this.fallbackFontDict,this.data.defaultFieldValue===null&&(this.data.defaultFieldValue="Off")}_processPushButton(Yt){const{dict:Kt,annotationGlobals:nr}=Yt;if(!Kt.has("A")&&!Kt.has("AA")&&!this.data.alternativeText){(0,rt.warn)("Push buttons without action dictionaries are not supported");return}this.data.isTooltipOnly=!Kt.has("A")&&!Kt.has("AA"),ht.Catalog.parseDestDictionary({destDict:Kt,resultObj:this.data,docBaseUrl:nr.baseUrl,docAttachments:nr.attachments})}getFieldObject(){let Yt="button",Kt;return this.data.checkBox?(Yt="checkbox",Kt=this.data.exportValue):this.data.radioButton&&(Yt="radiobutton",Kt=this.data.buttonValue),{id:this.data.id,value:this.data.fieldValue||"Off",defaultValue:this.data.defaultFieldValue,exportValues:Kt,editable:!this.data.readOnly,name:this.data.fieldName,rect:this.data.rect,hidden:this.data.hidden,actions:this.data.actions,page:this.data.pageIndex,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,rotation:this.rotation,type:Yt}}get fallbackFontDict(){const Yt=new et.Dict;return Yt.set("BaseFont",et.Name.get("ZapfDingbats")),Yt.set("Type",et.Name.get("FallbackType")),Yt.set("Subtype",et.Name.get("FallbackType")),Yt.set("Encoding",et.Name.get("ZapfDingbatsEncoding")),(0,rt.shadow)(this,"fallbackFontDict",Yt)}}class Rt extends Ct{constructor(Yt){super(Yt);const{dict:Kt,xref:nr}=Yt;this.indices=Kt.getArray("I"),this.hasIndices=Array.isArray(this.indices)&&this.indices.length>0,this.data.options=[];const tr=(0,st.getInheritableProperty)({dict:Kt,key:"Opt"});if(Array.isArray(tr))for(let ir=0,sr=tr.length;ir<sr;ir++){const cr=nr.fetchIfRef(tr[ir]),or=Array.isArray(cr);this.data.options[ir]={exportValue:this._decodeFormValue(or?nr.fetchIfRef(cr[0]):cr),displayValue:this._decodeFormValue(or?nr.fetchIfRef(cr[1]):cr)}}if(!this.hasIndices)typeof this.data.fieldValue=="string"?this.data.fieldValue=[this.data.fieldValue]:this.data.fieldValue||(this.data.fieldValue=[]);else{this.data.fieldValue=[];const ir=this.data.options.length;for(const sr of this.indices)Number.isInteger(sr)&&sr>=0&&sr<ir&&this.data.fieldValue.push(this.data.options[sr].exportValue)}this.data.combo=this.hasFieldFlag(rt.AnnotationFieldFlag.COMBO),this.data.multiSelect=this.hasFieldFlag(rt.AnnotationFieldFlag.MULTISELECT),this._hasText=!0}getFieldObject(){const Yt=this.data.combo?"combobox":"listbox",Kt=this.data.fieldValue.length>0?this.data.fieldValue[0]:null;return{id:this.data.id,value:Kt,defaultValue:this.data.defaultFieldValue,editable:!this.data.readOnly,name:this.data.fieldName,rect:this.data.rect,numItems:this.data.fieldValue.length,multipleSelection:this.data.multiSelect,hidden:this.data.hidden,actions:this.data.actions,items:this.data.options,page:this.data.pageIndex,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,rotation:this.rotation,type:Yt}}amendSavedDict(Yt,Kt){var sr;if(!this.hasIndices)return;let nr=(sr=Yt==null?void 0:Yt.get(this.data.id))==null?void 0:sr.value;Array.isArray(nr)||(nr=[nr]);const tr=[],{options:ir}=this.data;for(let cr=0,or=0,Xt=ir.length;cr<Xt;cr++)ir[cr].exportValue===nr[or]&&(tr.push(cr),or+=1);Kt.set("I",tr)}async _getAppearance(Yt,Kt,nr,tr){if(this.data.combo)return super._getAppearance(Yt,Kt,nr,tr);let ir,sr;const cr=tr==null?void 0:tr.get(this.data.id);if(cr&&(sr=cr.rotation,ir=cr.value),sr===void 0&&ir===void 0&&!this._needAppearances)return null;ir===void 0?ir=this.data.fieldValue:Array.isArray(ir)||(ir=[ir]);const or=1,Xt=2;let Gt=this.data.rect[3]-this.data.rect[1],Wt=this.data.rect[2]-this.data.rect[0];(sr===90||sr===270)&&([Wt,Gt]=[Gt,Wt]);const er=this.data.options.length,lr=[];for(let hr=0;hr<er;hr++){const{exportValue:vr}=this.data.options[hr];ir.includes(vr)&&lr.push(hr)}this._defaultAppearance||(this.data.defaultAppearanceData=(0,lt.parseDefaultAppearance)(this._defaultAppearance="/Helvetica 0 Tf 0 g"));const ur=await Ct._getFontData(Yt,Kt,this.data.defaultAppearanceData,this._fieldResources.mergedResources);let pr,{fontSize:yr}=this.data.defaultAppearanceData;if(yr)pr=this._defaultAppearance;else{const hr=(Gt-or)/er;let vr=-1,xr;for(const{displayValue:Pr}of this.data.options){const Rr=this._getTextWidth(Pr,ur);Rr>vr&&(vr=Rr,xr=Pr)}[pr,yr]=this._computeFontSize(hr,Wt-2*Xt,xr,ur,-1)}const Er=yr*rt.LINE_FACTOR,br=(Er-yr)/2,gr=Math.floor(Gt/Er);let Ar=0;if(lr.length>0){const hr=Math.min(...lr),vr=Math.max(...lr);Ar=Math.max(0,vr-gr+1),Ar>hr&&(Ar=hr)}const Sr=Math.min(Ar+gr+1,er),Br=["/Tx BMC q",`1 1 ${Wt} ${Gt} re W n`];if(lr.length){Br.push("0.600006 0.756866 0.854904 rg");for(const hr of lr)Ar<=hr&&hr<Sr&&Br.push(`1 ${Gt-(hr-Ar+1)*Er} ${Wt} ${Er} re f`)}Br.push("BT",pr,`1 0 0 1 0 ${Gt} Tm`);const Ir={shift:0};for(let hr=Ar;hr<Sr;hr++){const{displayValue:vr}=this.data.options[hr],xr=hr===Ar?br:0;Br.push(this._renderText(vr,ur,yr,Wt,0,Ir,Xt,-Er+xr))}return Br.push("ET Q EMC"),Br.join(`
|
53
53
|
`)}}class kt extends Ct{constructor(Yt){super(Yt),this.data.fieldValue=null,this.data.hasOwnCanvas=this.data.noRotate}getFieldObject(){return{id:this.data.id,value:null,page:this.data.pageIndex,type:"signature"}}}class jt extends wt{constructor(Yt){super(Yt),this.data.noRotate=!0,this.data.hasOwnCanvas=this.data.noRotate;const{dict:nr}=Yt;this.data.annotationType=rt.AnnotationType.TEXT,this.data.hasAppearance?this.data.name="NoIcon":(this.data.rect[1]=this.data.rect[3]-22,this.data.rect[2]=this.data.rect[0]+22,this.data.name=nr.has("Name")?nr.get("Name").name:"Note"),nr.has("State")?(this.data.state=nr.get("State")||null,this.data.stateModel=nr.get("StateModel")||null):(this.data.state=null,this.data.stateModel=null)}}class Ht extends Ot{constructor(Yt){var ir;super(Yt);const{dict:Kt,annotationGlobals:nr}=Yt;this.data.annotationType=rt.AnnotationType.LINK;const tr=St(Kt,this.rectangle);tr&&(this.data.quadPoints=tr),(ir=this.data).borderColor||(ir.borderColor=this.data.color),ht.Catalog.parseDestDictionary({destDict:Kt,resultObj:this.data,docBaseUrl:nr.baseUrl,docAttachments:nr.attachments})}}class Ft extends Ot{constructor(Yt){super(Yt);const{dict:Kt}=Yt;this.data.annotationType=rt.AnnotationType.POPUP,(this.data.rect[0]===this.data.rect[2]||this.data.rect[1]===this.data.rect[3])&&(this.data.rect=null);let nr=Kt.get("Parent");if(!nr){(0,rt.warn)("Popup annotation has a missing or invalid parent annotation.");return}const tr=nr.getArray("Rect");this.data.parentRect=Array.isArray(tr)&&tr.length===4?rt.Util.normalizeRect(tr):null;const ir=nr.get("RT");if((0,et.isName)(ir,rt.AnnotationReplyType.GROUP)&&(nr=nr.get("IRT")),nr.has("M")?(this.setModificationDate(nr.get("M")),this.data.modificationDate=this.modificationDate):this.data.modificationDate=null,nr.has("C")?(this.setColor(nr.getArray("C")),this.data.color=this.color):this.data.color=null,!this.viewable){const sr=nr.get("F");this._isViewable(sr)&&this.setFlags(sr)}this.setTitle(nr.get("T")),this.data.titleObj=this._title,this.setContents(nr.get("Contents")),this.data.contentsObj=this._contents,nr.has("RC")&&(this.data.richText=At.XFAFactory.getRichTextAsHtml(nr.get("RC"))),this.data.open=!!Kt.get("Open")}}at.PopupAnnotation=Ft;class _t extends wt{constructor(Yt){var tr;super(Yt),this.data.hasOwnCanvas=!0;const{evaluatorOptions:Kt,xref:nr}=Yt;if(this.data.annotationType=rt.AnnotationType.FREETEXT,this.setDefaultAppearance(Yt),this.appearance){const{fontColor:ir,fontSize:sr}=(0,lt.parseAppearanceStream)(this.appearance,Kt,nr);this.data.defaultAppearanceData.fontColor=ir,this.data.defaultAppearanceData.fontSize=sr||10}else if(this._isOffscreenCanvasSupported){const ir=Yt.dict.get("CA"),sr=new lt.FakeUnicodeFont(nr,"sans-serif");(tr=this.data.defaultAppearanceData).fontSize||(tr.fontSize=10);const{fontColor:cr,fontSize:or}=this.data.defaultAppearanceData;this.appearance=sr.createAppearance(this._contents.str,this.rectangle,this.rotation,or,cr,ir),this._streams.push(this.appearance,lt.FakeUnicodeFont.toUnicodeStream)}else(0,rt.warn)("FreeTextAnnotation: OffscreenCanvas is not supported, annotation may not render correctly.")}get hasTextContent(){return!!this.appearance}static createNewDict(Yt,Kt,nr){let{apRef:tr,ap:ir}=nr;const{color:sr,fontSize:cr,rect:or,rotation:Xt,user:Gt,value:Wt}=Yt,er=new et.Dict(Kt);er.set("Type",et.Name.get("Annot")),er.set("Subtype",et.Name.get("FreeText")),er.set("CreationDate",`D:${(0,rt.getModificationDate)()}`),er.set("Rect",or);const lr=`/Helv ${cr} Tf ${(0,lt.getPdfColor)(sr,!0)}`;if(er.set("DA",lr),er.set("Contents",(0,st.isAscii)(Wt)?Wt:(0,st.stringToUTF16String)(Wt,!0)),er.set("F",4),er.set("Border",[0,0,0]),er.set("Rotate",Xt),Gt&&er.set("T",(0,st.isAscii)(Gt)?Gt:(0,st.stringToUTF16String)(Gt,!0)),tr||ir){const ur=new et.Dict(Kt);er.set("AP",ur),tr?ur.set("N",tr):ur.set("N",ir)}return er}static async createNewAppearanceStream(Yt,Kt,nr){const{baseFontRef:tr,evaluator:ir,task:sr}=nr,{color:cr,fontSize:or,rect:Xt,rotation:Gt,value:Wt}=Yt,er=new et.Dict(Kt),lr=new et.Dict(Kt);if(tr)lr.set("Helv",tr);else{const Fr=new et.Dict(Kt);Fr.set("BaseFont",et.Name.get("Helvetica")),Fr.set("Type",et.Name.get("Font")),Fr.set("Subtype",et.Name.get("Type1")),Fr.set("Encoding",et.Name.get("WinAnsiEncoding")),lr.set("Helv",Fr)}er.set("Font",lr);const ur=await Ct._getFontData(ir,sr,{fontName:"Helv",fontSize:or},er),[pr,yr,Er,br]=Xt;let gr=Er-pr,Ar=br-yr;Gt%180!==0&&([gr,Ar]=[Ar,gr]);const Sr=Wt.split(`
|
@@ -126,7 +126,8 @@ endstream`,s}copyBytesInto(s,$){this.updateDict();const _=$;$+=this.dict.copyByt
|
|
126
126
|
`,"𝔑":"𝔑","⁠":""," ":" ","ℕ":"ℕ","⫬":"⫬","≢":"≢","≭":"≭","∦":"∦","∉":"∉","≠":"≠","≂̸":"≂̸","∄":"∄","≯":"≯","≱":"≱","≧̸":"≧̸","≫̸":"≫̸","≹":"≹","⩾̸":"⩾̸","≵":"≵","≎̸":"≎̸","≏̸":"≏̸","⋪":"⋪","⧏̸":"⧏̸","⋬":"⋬","≮":"≮","≰":"≰","≸":"≸","≪̸":"≪̸","⩽̸":"⩽̸","≴":"≴","⪢̸":"⪢̸","⪡̸":"⪡̸","⊀":"⊀","⪯̸":"⪯̸","⋠":"⋠","∌":"∌","⋫":"⋫","⧐̸":"⧐̸","⋭":"⋭","⊏̸":"⊏̸","⋢":"⋢","⊐̸":"⊐̸","⋣":"⋣","⊂⃒":"⊂⃒","⊈":"⊈","⊁":"⊁","⪰̸":"⪰̸","⋡":"⋡","≿̸":"≿̸","⊃⃒":"⊃⃒","⊉":"⊉","≁":"≁","≄":"≄","≇":"≇","≉":"≉","∤":"∤","𝒩":"𝒩","Ñ":"Ñ","Ñ":"Ñ","Ν":"Ν","Œ":"Œ","Ó":"Ó","Ó":"Ó","Ô":"Ô","Ô":"Ô","О":"О","Ő":"Ő","𝔒":"𝔒","Ò":"Ò","Ò":"Ò","Ō":"Ō","Ω":"Ω","Ο":"Ο","𝕆":"𝕆","“":"“","‘":"‘","⩔":"⩔","𝒪":"𝒪","Ø":"Ø","Ø":"Ø","Õ":"Õ","Õ":"Õ","⨷":"⨷","Ö":"Ö","Ö":"Ö","‾":"‾","⏞":"⏞","⎴":"⎴","⏜":"⏜","∂":"∂","П":"П","𝔓":"𝔓","Φ":"Φ","Π":"Π","±":"±","ℌ":"ℌ","ℙ":"ℙ","⪻":"⪻","≺":"≺","⪯":"⪯","≼":"≼","≾":"≾","″":"″","∏":"∏","∷":"∷","∝":"∝","𝒫":"𝒫","Ψ":"Ψ",""":'"',""":'"',"𝔔":"𝔔","ℚ":"ℚ","𝒬":"𝒬","⤐":"⤐","®":"®","®":"®","Ŕ":"Ŕ","⟫":"⟫","↠":"↠","⤖":"⤖","Ř":"Ř","Ŗ":"Ŗ","Р":"Р","ℜ":"ℜ","∋":"∋","⇋":"⇋","⥯":"⥯","ℜ":"ℜ","Ρ":"Ρ","⟩":"⟩","→":"→","⇥":"⇥","⇄":"⇄","⌉":"⌉","⟧":"⟧","⥝":"⥝","⇂":"⇂","⥕":"⥕","⌋":"⌋","⊢":"⊢","↦":"↦","⥛":"⥛","⊳":"⊳","⧐":"⧐","⊵":"⊵","⥏":"⥏","⥜":"⥜","↾":"↾","⥔":"⥔","⇀":"⇀","⥓":"⥓","⇒":"⇒","ℝ":"ℝ","⥰":"⥰","⇛":"⇛","ℛ":"ℛ","↱":"↱","⧴":"⧴","Щ":"Щ","Ш":"Ш","Ь":"Ь","Ś":"Ś","⪼":"⪼","Š":"Š","Ş":"Ş","Ŝ":"Ŝ","С":"С","𝔖":"𝔖","↓":"↓","←":"←","→":"→","↑":"↑","Σ":"Σ","∘":"∘","𝕊":"𝕊","√":"√","□":"□","⊓":"⊓","⊏":"⊏","⊑":"⊑","⊐":"⊐","⊒":"⊒","⊔":"⊔","𝒮":"𝒮","⋆":"⋆","⋐":"⋐","⋐":"⋐","⊆":"⊆","≻":"≻","⪰":"⪰","≽":"≽","≿":"≿","∋":"∋","∑":"∑","⋑":"⋑","⊃":"⊃","⊇":"⊇","⋑":"⋑","Þ":"Þ","Þ":"Þ","™":"™","Ћ":"Ћ","Ц":"Ц","	":" ","Τ":"Τ","Ť":"Ť","Ţ":"Ţ","Т":"Т","𝔗":"𝔗","∴":"∴","Θ":"Θ","  ":" "," ":" ","∼":"∼","≃":"≃","≅":"≅","≈":"≈","𝕋":"𝕋","⃛":"⃛","𝒯":"𝒯","Ŧ":"Ŧ","Ú":"Ú","Ú":"Ú","↟":"↟","⥉":"⥉","Ў":"Ў","Ŭ":"Ŭ","Û":"Û","Û":"Û","У":"У","Ű":"Ű","𝔘":"𝔘","Ù":"Ù","Ù":"Ù","Ū":"Ū","_":"_","⏟":"⏟","⎵":"⎵","⏝":"⏝","⋃":"⋃","⊎":"⊎","Ų":"Ų","𝕌":"𝕌","↑":"↑","⤒":"⤒","⇅":"⇅","↕":"↕","⥮":"⥮","⊥":"⊥","↥":"↥","⇑":"⇑","⇕":"⇕","↖":"↖","↗":"↗","ϒ":"ϒ","Υ":"Υ","Ů":"Ů","𝒰":"𝒰","Ũ":"Ũ","Ü":"Ü","Ü":"Ü","⊫":"⊫","⫫":"⫫","В":"В","⊩":"⊩","⫦":"⫦","⋁":"⋁","‖":"‖","‖":"‖","∣":"∣","|":"|","❘":"❘","≀":"≀"," ":" ","𝔙":"𝔙","𝕍":"𝕍","𝒱":"𝒱","⊪":"⊪","Ŵ":"Ŵ","⋀":"⋀","𝔚":"𝔚","𝕎":"𝕎","𝒲":"𝒲","𝔛":"𝔛","Ξ":"Ξ","𝕏":"𝕏","𝒳":"𝒳","Я":"Я","Ї":"Ї","Ю":"Ю","Ý":"Ý","Ý":"Ý","Ŷ":"Ŷ","Ы":"Ы","𝔜":"𝔜","𝕐":"𝕐","𝒴":"𝒴","Ÿ":"Ÿ","Ж":"Ж","Ź":"Ź","Ž":"Ž","З":"З","Ż":"Ż","​":"","Ζ":"Ζ","ℨ":"ℨ","ℤ":"ℤ","𝒵":"𝒵","á":"á","á":"á","ă":"ă","∾":"∾","∾̳":"∾̳","∿":"∿","â":"â","â":"â","´":"´","´":"´","а":"а","æ":"æ","æ":"æ","⁡":"","𝔞":"𝔞","à":"à","à":"à","ℵ":"ℵ","ℵ":"ℵ","α":"α","ā":"ā","⨿":"⨿","&":"&","&":"&","∧":"∧","⩕":"⩕","⩜":"⩜","⩘":"⩘","⩚":"⩚","∠":"∠","⦤":"⦤","∠":"∠","∡":"∡","⦨":"⦨","⦩":"⦩","⦪":"⦪","⦫":"⦫","⦬":"⦬","⦭":"⦭","⦮":"⦮","⦯":"⦯","∟":"∟","⊾":"⊾","⦝":"⦝","∢":"∢","Å":"Å","⍼":"⍼","ą":"ą","𝕒":"𝕒","≈":"≈","⩰":"⩰","⩯":"⩯","≊":"≊","≋":"≋","'":"'","≈":"≈","≊":"≊","å":"å","å":"å","𝒶":"𝒶","*":"*","≈":"≈","≍":"≍","ã":"ã","ã":"ã","ä":"ä","ä":"ä","∳":"∳","⨑":"⨑","⫭":"⫭","≌":"≌","϶":"϶","‵":"‵","∽":"∽","⋍":"⋍","⊽":"⊽","⌅":"⌅","⌅":"⌅","⎵":"⎵","⎶":"⎶","≌":"≌","б":"б","„":"„","∵":"∵","∵":"∵","⦰":"⦰","϶":"϶","ℬ":"ℬ","β":"β","ℶ":"ℶ","≬":"≬","𝔟":"𝔟","⋂":"⋂","◯":"◯","⋃":"⋃","⨀":"⨀","⨁":"⨁","⨂":"⨂","⨆":"⨆","★":"★","▽":"▽","△":"△","⨄":"⨄","⋁":"⋁","⋀":"⋀","⤍":"⤍","⧫":"⧫","▪":"▪","▴":"▴","▾":"▾","◂":"◂","▸":"▸","␣":"␣","▒":"▒","░":"░","▓":"▓","█":"█","=⃥":"=⃥","≡⃥":"≡⃥","⌐":"⌐","𝕓":"𝕓","⊥":"⊥","⊥":"⊥","⋈":"⋈","╗":"╗","╔":"╔","╖":"╖","╓":"╓","═":"═","╦":"╦","╩":"╩","╤":"╤","╧":"╧","╝":"╝","╚":"╚","╜":"╜","╙":"╙","║":"║","╬":"╬","╣":"╣","╠":"╠","╫":"╫","╢":"╢","╟":"╟","⧉":"⧉","╕":"╕","╒":"╒","┐":"┐","┌":"┌","─":"─","╥":"╥","╨":"╨","┬":"┬","┴":"┴","⊟":"⊟","⊞":"⊞","⊠":"⊠","╛":"╛","╘":"╘","┘":"┘","└":"└","│":"│","╪":"╪","╡":"╡","╞":"╞","┼":"┼","┤":"┤","├":"├","‵":"‵","˘":"˘","¦":"¦","¦":"¦","𝒷":"𝒷","⁏":"⁏","∽":"∽","⋍":"⋍","\":"\\","⧅":"⧅","⟈":"⟈","•":"•","•":"•","≎":"≎","⪮":"⪮","≏":"≏","≏":"≏","ć":"ć","∩":"∩","⩄":"⩄","⩉":"⩉","⩋":"⩋","⩇":"⩇","⩀":"⩀","∩︀":"∩︀","⁁":"⁁","ˇ":"ˇ","⩍":"⩍","č":"č","ç":"ç","ç":"ç","ĉ":"ĉ","⩌":"⩌","⩐":"⩐","ċ":"ċ","¸":"¸","¸":"¸","⦲":"⦲","¢":"¢","¢":"¢","·":"·","𝔠":"𝔠","ч":"ч","✓":"✓","✓":"✓","χ":"χ","○":"○","⧃":"⧃","ˆ":"ˆ","≗":"≗","↺":"↺","↻":"↻","®":"®","Ⓢ":"Ⓢ","⊛":"⊛","⊚":"⊚","⊝":"⊝","≗":"≗","⨐":"⨐","⫯":"⫯","⧂":"⧂","♣":"♣","♣":"♣",":":":","≔":"≔","≔":"≔",",":",","@":"@","∁":"∁","∘":"∘","∁":"∁","ℂ":"ℂ","≅":"≅","⩭":"⩭","∮":"∮","𝕔":"𝕔","∐":"∐","©":"©","©":"©","℗":"℗","↵":"↵","✗":"✗","𝒸":"𝒸","⫏":"⫏","⫑":"⫑","⫐":"⫐","⫒":"⫒","⋯":"⋯","⤸":"⤸","⤵":"⤵","⋞":"⋞","⋟":"⋟","↶":"↶","⤽":"⤽","∪":"∪","⩈":"⩈","⩆":"⩆","⩊":"⩊","⊍":"⊍","⩅":"⩅","∪︀":"∪︀","↷":"↷","⤼":"⤼","⋞":"⋞","⋟":"⋟","⋎":"⋎","⋏":"⋏","¤":"¤","¤":"¤","↶":"↶","↷":"↷","⋎":"⋎","⋏":"⋏","∲":"∲","∱":"∱","⌭":"⌭","⇓":"⇓","⥥":"⥥","†":"†","ℸ":"ℸ","↓":"↓","‐":"‐","⊣":"⊣","⤏":"⤏","˝":"˝","ď":"ď","д":"д","ⅆ":"ⅆ","‡":"‡","⇊":"⇊","⩷":"⩷","°":"°","°":"°","δ":"δ","⦱":"⦱","⥿":"⥿","𝔡":"𝔡","⇃":"⇃","⇂":"⇂","⋄":"⋄","⋄":"⋄","♦":"♦","♦":"♦","¨":"¨","ϝ":"ϝ","⋲":"⋲","÷":"÷","÷":"÷","÷":"÷","⋇":"⋇","⋇":"⋇","ђ":"ђ","⌞":"⌞","⌍":"⌍","$":"$","𝕕":"𝕕","˙":"˙","≐":"≐","≑":"≑","∸":"∸","∔":"∔","⊡":"⊡","⌆":"⌆","↓":"↓","⇊":"⇊","⇃":"⇃","⇂":"⇂","⤐":"⤐","⌟":"⌟","⌌":"⌌","𝒹":"𝒹","ѕ":"ѕ","⧶":"⧶","đ":"đ","⋱":"⋱","▿":"▿","▾":"▾","⇵":"⇵","⥯":"⥯","⦦":"⦦","џ":"џ","⟿":"⟿","⩷":"⩷","≑":"≑","é":"é","é":"é","⩮":"⩮","ě":"ě","≖":"≖","ê":"ê","ê":"ê","≕":"≕","э":"э","ė":"ė","ⅇ":"ⅇ","≒":"≒","𝔢":"𝔢","⪚":"⪚","è":"è","è":"è","⪖":"⪖","⪘":"⪘","⪙":"⪙","⏧":"⏧","ℓ":"ℓ","⪕":"⪕","⪗":"⪗","ē":"ē","∅":"∅","∅":"∅","∅":"∅"," ":" "," ":" "," ":" ","ŋ":"ŋ"," ":" ","ę":"ę","𝕖":"𝕖","⋕":"⋕","⧣":"⧣","⩱":"⩱","ε":"ε","ε":"ε","ϵ":"ϵ","≖":"≖","≕":"≕","≂":"≂","⪖":"⪖","⪕":"⪕","=":"=","≟":"≟","≡":"≡","⩸":"⩸","⧥":"⧥","≓":"≓","⥱":"⥱","ℯ":"ℯ","≐":"≐","≂":"≂","η":"η","ð":"ð","ð":"ð","ë":"ë","ë":"ë","€":"€","!":"!","∃":"∃","ℰ":"ℰ","ⅇ":"ⅇ","≒":"≒","ф":"ф","♀":"♀","ffi":"ffi","ff":"ff","ffl":"ffl","𝔣":"𝔣","fi":"fi","fj":"fj","♭":"♭","fl":"fl","▱":"▱","ƒ":"ƒ","𝕗":"𝕗","∀":"∀","⋔":"⋔","⫙":"⫙","⨍":"⨍","½":"½","½":"½","⅓":"⅓","¼":"¼","¼":"¼","⅕":"⅕","⅙":"⅙","⅛":"⅛","⅔":"⅔","⅖":"⅖","¾":"¾","¾":"¾","⅗":"⅗","⅜":"⅜","⅘":"⅘","⅚":"⅚","⅝":"⅝","⅞":"⅞","⁄":"⁄","⌢":"⌢","𝒻":"𝒻","≧":"≧","⪌":"⪌","ǵ":"ǵ","γ":"γ","ϝ":"ϝ","⪆":"⪆","ğ":"ğ","ĝ":"ĝ","г":"г","ġ":"ġ","≥":"≥","⋛":"⋛","≥":"≥","≧":"≧","⩾":"⩾","⩾":"⩾","⪩":"⪩","⪀":"⪀","⪂":"⪂","⪄":"⪄","⋛︀":"⋛︀","⪔":"⪔","𝔤":"𝔤","≫":"≫","⋙":"⋙","ℷ":"ℷ","ѓ":"ѓ","≷":"≷","⪒":"⪒","⪥":"⪥","⪤":"⪤","≩":"≩","⪊":"⪊","⪊":"⪊","⪈":"⪈","⪈":"⪈","≩":"≩","⋧":"⋧","𝕘":"𝕘","`":"`","ℊ":"ℊ","≳":"≳","⪎":"⪎","⪐":"⪐",">":">",">":">","⪧":"⪧","⩺":"⩺","⋗":"⋗","⦕":"⦕","⩼":"⩼","⪆":"⪆","⥸":"⥸","⋗":"⋗","⋛":"⋛","⪌":"⪌","≷":"≷","≳":"≳","≩︀":"≩︀","≩︀":"≩︀","⇔":"⇔"," ":" ","½":"½","ℋ":"ℋ","ъ":"ъ","↔":"↔","⥈":"⥈","↭":"↭","ℏ":"ℏ","ĥ":"ĥ","♥":"♥","♥":"♥","…":"…","⊹":"⊹","𝔥":"𝔥","⤥":"⤥","⤦":"⤦","⇿":"⇿","∻":"∻","↩":"↩","↪":"↪","𝕙":"𝕙","―":"―","𝒽":"𝒽","ℏ":"ℏ","ħ":"ħ","⁃":"⁃","‐":"‐","í":"í","í":"í","⁣":"","î":"î","î":"î","и":"и","е":"е","¡":"¡","¡":"¡","⇔":"⇔","𝔦":"𝔦","ì":"ì","ì":"ì","ⅈ":"ⅈ","⨌":"⨌","∭":"∭","⧜":"⧜","℩":"℩","ij":"ij","ī":"ī","ℑ":"ℑ","ℐ":"ℐ","ℑ":"ℑ","ı":"ı","⊷":"⊷","Ƶ":"Ƶ","∈":"∈","℅":"℅","∞":"∞","⧝":"⧝","ı":"ı","∫":"∫","⊺":"⊺","ℤ":"ℤ","⊺":"⊺","⨗":"⨗","⨼":"⨼","ё":"ё","į":"į","𝕚":"𝕚","ι":"ι","⨼":"⨼","¿":"¿","¿":"¿","𝒾":"𝒾","∈":"∈","⋹":"⋹","⋵":"⋵","⋴":"⋴","⋳":"⋳","∈":"∈","⁢":"","ĩ":"ĩ","і":"і","ï":"ï","ï":"ï","ĵ":"ĵ","й":"й","𝔧":"𝔧","ȷ":"ȷ","𝕛":"𝕛","𝒿":"𝒿","ј":"ј","є":"є","κ":"κ","ϰ":"ϰ","ķ":"ķ","к":"к","𝔨":"𝔨","ĸ":"ĸ","х":"х","ќ":"ќ","𝕜":"𝕜","𝓀":"𝓀","⇚":"⇚","⇐":"⇐","⤛":"⤛","⤎":"⤎","≦":"≦","⪋":"⪋","⥢":"⥢","ĺ":"ĺ","⦴":"⦴","ℒ":"ℒ","λ":"λ","⟨":"⟨","⦑":"⦑","⟨":"⟨","⪅":"⪅","«":"«","«":"«","←":"←","⇤":"⇤","⤟":"⤟","⤝":"⤝","↩":"↩","↫":"↫","⤹":"⤹","⥳":"⥳","↢":"↢","⪫":"⪫","⤙":"⤙","⪭":"⪭","⪭︀":"⪭︀","⤌":"⤌","❲":"❲","{":"{","[":"[","⦋":"⦋","⦏":"⦏","⦍":"⦍","ľ":"ľ","ļ":"ļ","⌈":"⌈","{":"{","л":"л","⤶":"⤶","“":"“","„":"„","⥧":"⥧","⥋":"⥋","↲":"↲","≤":"≤","←":"←","↢":"↢","↽":"↽","↼":"↼","⇇":"⇇","↔":"↔","⇆":"⇆","⇋":"⇋","↭":"↭","⋋":"⋋","⋚":"⋚","≤":"≤","≦":"≦","⩽":"⩽","⩽":"⩽","⪨":"⪨","⩿":"⩿","⪁":"⪁","⪃":"⪃","⋚︀":"⋚︀","⪓":"⪓","⪅":"⪅","⋖":"⋖","⋚":"⋚","⪋":"⪋","≶":"≶","≲":"≲","⥼":"⥼","⌊":"⌊","𝔩":"𝔩","≶":"≶","⪑":"⪑","↽":"↽","↼":"↼","⥪":"⥪","▄":"▄","љ":"љ","≪":"≪","⇇":"⇇","⌞":"⌞","⥫":"⥫","◺":"◺","ŀ":"ŀ","⎰":"⎰","⎰":"⎰","≨":"≨","⪉":"⪉","⪉":"⪉","⪇":"⪇","⪇":"⪇","≨":"≨","⋦":"⋦","⟬":"⟬","⇽":"⇽","⟦":"⟦","⟵":"⟵","⟷":"⟷","⟼":"⟼","⟶":"⟶","↫":"↫","↬":"↬","⦅":"⦅","𝕝":"𝕝","⨭":"⨭","⨴":"⨴","∗":"∗","_":"_","◊":"◊","◊":"◊","⧫":"⧫","(":"(","⦓":"⦓","⇆":"⇆","⌟":"⌟","⇋":"⇋","⥭":"⥭","‎":"","⊿":"⊿","‹":"‹","𝓁":"𝓁","↰":"↰","≲":"≲","⪍":"⪍","⪏":"⪏","[":"[","‘":"‘","‚":"‚","ł":"ł","<":"<","<":"<","⪦":"⪦","⩹":"⩹","⋖":"⋖","⋋":"⋋","⋉":"⋉","⥶":"⥶","⩻":"⩻","⦖":"⦖","◃":"◃","⊴":"⊴","◂":"◂","⥊":"⥊","⥦":"⥦","≨︀":"≨︀","≨︀":"≨︀","∺":"∺","¯":"¯","¯":"¯","♂":"♂","✠":"✠","✠":"✠","↦":"↦","↦":"↦","↧":"↧","↤":"↤","↥":"↥","▮":"▮","⨩":"⨩","м":"м","—":"—","∡":"∡","𝔪":"𝔪","℧":"℧","µ":"µ","µ":"µ","∣":"∣","*":"*","⫰":"⫰","·":"·","·":"·","−":"−","⊟":"⊟","∸":"∸","⨪":"⨪","⫛":"⫛","…":"…","∓":"∓","⊧":"⊧","𝕞":"𝕞","∓":"∓","𝓂":"𝓂","∾":"∾","μ":"μ","⊸":"⊸","⊸":"⊸","⋙̸":"⋙̸","≫⃒":"≫⃒","≫̸":"≫̸","⇍":"⇍","⇎":"⇎","⋘̸":"⋘̸","≪⃒":"≪⃒","≪̸":"≪̸","⇏":"⇏","⊯":"⊯","⊮":"⊮","∇":"∇","ń":"ń","∠⃒":"∠⃒","≉":"≉","⩰̸":"⩰̸","≋̸":"≋̸","ʼn":"ʼn","≉":"≉","♮":"♮","♮":"♮","ℕ":"ℕ"," ":" "," ":" ","≎̸":"≎̸","≏̸":"≏̸","⩃":"⩃","ň":"ň","ņ":"ņ","≇":"≇","⩭̸":"⩭̸","⩂":"⩂","н":"н","–":"–","≠":"≠","⇗":"⇗","⤤":"⤤","↗":"↗","↗":"↗","≐̸":"≐̸","≢":"≢","⤨":"⤨","≂̸":"≂̸","∄":"∄","∄":"∄","𝔫":"𝔫","≧̸":"≧̸","≱":"≱","≱":"≱","≧̸":"≧̸","⩾̸":"⩾̸","⩾̸":"⩾̸","≵":"≵","≯":"≯","≯":"≯","⇎":"⇎","↮":"↮","⫲":"⫲","∋":"∋","⋼":"⋼","⋺":"⋺","∋":"∋","њ":"њ","⇍":"⇍","≦̸":"≦̸","↚":"↚","‥":"‥","≰":"≰","↚":"↚","↮":"↮","≰":"≰","≦̸":"≦̸","⩽̸":"⩽̸","⩽̸":"⩽̸","≮":"≮","≴":"≴","≮":"≮","⋪":"⋪","⋬":"⋬","∤":"∤","𝕟":"𝕟","¬":"¬","¬":"¬","∉":"∉","⋹̸":"⋹̸","⋵̸":"⋵̸","∉":"∉","⋷":"⋷","⋶":"⋶","∌":"∌","∌":"∌","⋾":"⋾","⋽":"⋽","∦":"∦","∦":"∦","⫽⃥":"⫽⃥","∂̸":"∂̸","⨔":"⨔","⊀":"⊀","⋠":"⋠","⪯̸":"⪯̸","⊀":"⊀","⪯̸":"⪯̸","⇏":"⇏","↛":"↛","⤳̸":"⤳̸","↝̸":"↝̸","↛":"↛","⋫":"⋫","⋭":"⋭","⊁":"⊁","⋡":"⋡","⪰̸":"⪰̸","𝓃":"𝓃","∤":"∤","∦":"∦","≁":"≁","≄":"≄","≄":"≄","∤":"∤","∦":"∦","⋢":"⋢","⋣":"⋣","⊄":"⊄","⫅̸":"⫅̸","⊈":"⊈","⊂⃒":"⊂⃒","⊈":"⊈","⫅̸":"⫅̸","⊁":"⊁","⪰̸":"⪰̸","⊅":"⊅","⫆̸":"⫆̸","⊉":"⊉","⊃⃒":"⊃⃒","⊉":"⊉","⫆̸":"⫆̸","≹":"≹","ñ":"ñ","ñ":"ñ","≸":"≸","⋪":"⋪","⋬":"⋬","⋫":"⋫","⋭":"⋭","ν":"ν","#":"#","№":"№"," ":" ","⊭":"⊭","⤄":"⤄","≍⃒":"≍⃒","⊬":"⊬","≥⃒":"≥⃒",">⃒":">⃒","⧞":"⧞","⤂":"⤂","≤⃒":"≤⃒","<⃒":"<⃒","⊴⃒":"⊴⃒","⤃":"⤃","⊵⃒":"⊵⃒","∼⃒":"∼⃒","⇖":"⇖","⤣":"⤣","↖":"↖","↖":"↖","⤧":"⤧","Ⓢ":"Ⓢ","ó":"ó","ó":"ó","⊛":"⊛","⊚":"⊚","ô":"ô","ô":"ô","о":"о","⊝":"⊝","ő":"ő","⨸":"⨸","⊙":"⊙","⦼":"⦼","œ":"œ","⦿":"⦿","𝔬":"𝔬","˛":"˛","ò":"ò","ò":"ò","⧁":"⧁","⦵":"⦵","Ω":"Ω","∮":"∮","↺":"↺","⦾":"⦾","⦻":"⦻","‾":"‾","⧀":"⧀","ō":"ō","ω":"ω","ο":"ο","⦶":"⦶","⊖":"⊖","𝕠":"𝕠","⦷":"⦷","⦹":"⦹","⊕":"⊕","∨":"∨","↻":"↻","⩝":"⩝","ℴ":"ℴ","ℴ":"ℴ","ª":"ª","ª":"ª","º":"º","º":"º","⊶":"⊶","⩖":"⩖","⩗":"⩗","⩛":"⩛","ℴ":"ℴ","ø":"ø","ø":"ø","⊘":"⊘","õ":"õ","õ":"õ","⊗":"⊗","⨶":"⨶","ö":"ö","ö":"ö","⌽":"⌽","∥":"∥","¶":"¶","¶":"¶","∥":"∥","⫳":"⫳","⫽":"⫽","∂":"∂","п":"п","%":"%",".":".","‰":"‰","⊥":"⊥","‱":"‱","𝔭":"𝔭","φ":"φ","ϕ":"ϕ","ℳ":"ℳ","☎":"☎","π":"π","⋔":"⋔","ϖ":"ϖ","ℏ":"ℏ","ℎ":"ℎ","ℏ":"ℏ","+":"+","⨣":"⨣","⊞":"⊞","⨢":"⨢","∔":"∔","⨥":"⨥","⩲":"⩲","±":"±","±":"±","⨦":"⨦","⨧":"⨧","±":"±","⨕":"⨕","𝕡":"𝕡","£":"£","£":"£","≺":"≺","⪳":"⪳","⪷":"⪷","≼":"≼","⪯":"⪯","≺":"≺","⪷":"⪷","≼":"≼","⪯":"⪯","⪹":"⪹","⪵":"⪵","⋨":"⋨","≾":"≾","′":"′","ℙ":"ℙ","⪵":"⪵","⪹":"⪹","⋨":"⋨","∏":"∏","⌮":"⌮","⌒":"⌒","⌓":"⌓","∝":"∝","∝":"∝","≾":"≾","⊰":"⊰","𝓅":"𝓅","ψ":"ψ"," ":" ","𝔮":"𝔮","⨌":"⨌","𝕢":"𝕢","⁗":"⁗","𝓆":"𝓆","ℍ":"ℍ","⨖":"⨖","?":"?","≟":"≟",""":'"',""":'"',"⇛":"⇛","⇒":"⇒","⤜":"⤜","⤏":"⤏","⥤":"⥤","∽̱":"∽̱","ŕ":"ŕ","√":"√","⦳":"⦳","⟩":"⟩","⦒":"⦒","⦥":"⦥","⟩":"⟩","»":"»","»":"»","→":"→","⥵":"⥵","⇥":"⇥","⤠":"⤠","⤳":"⤳","⤞":"⤞","↪":"↪","↬":"↬","⥅":"⥅","⥴":"⥴","↣":"↣","↝":"↝","⤚":"⤚","∶":"∶","ℚ":"ℚ","⤍":"⤍","❳":"❳","}":"}","]":"]","⦌":"⦌","⦎":"⦎","⦐":"⦐","ř":"ř","ŗ":"ŗ","⌉":"⌉","}":"}","р":"р","⤷":"⤷","⥩":"⥩","”":"”","”":"”","↳":"↳","ℜ":"ℜ","ℛ":"ℛ","ℜ":"ℜ","ℝ":"ℝ","▭":"▭","®":"®","®":"®","⥽":"⥽","⌋":"⌋","𝔯":"𝔯","⇁":"⇁","⇀":"⇀","⥬":"⥬","ρ":"ρ","ϱ":"ϱ","→":"→","↣":"↣","⇁":"⇁","⇀":"⇀","⇄":"⇄","⇌":"⇌","⇉":"⇉","↝":"↝","⋌":"⋌","˚":"˚","≓":"≓","⇄":"⇄","⇌":"⇌","‏":"","⎱":"⎱","⎱":"⎱","⫮":"⫮","⟭":"⟭","⇾":"⇾","⟧":"⟧","⦆":"⦆","𝕣":"𝕣","⨮":"⨮","⨵":"⨵",")":")","⦔":"⦔","⨒":"⨒","⇉":"⇉","›":"›","𝓇":"𝓇","↱":"↱","]":"]","’":"’","’":"’","⋌":"⋌","⋊":"⋊","▹":"▹","⊵":"⊵","▸":"▸","⧎":"⧎","⥨":"⥨","℞":"℞","ś":"ś","‚":"‚","≻":"≻","⪴":"⪴","⪸":"⪸","š":"š","≽":"≽","⪰":"⪰","ş":"ş","ŝ":"ŝ","⪶":"⪶","⪺":"⪺","⋩":"⋩","⨓":"⨓","≿":"≿","с":"с","⋅":"⋅","⊡":"⊡","⩦":"⩦","⇘":"⇘","⤥":"⤥","↘":"↘","↘":"↘","§":"§","§":"§",";":";","⤩":"⤩","∖":"∖","∖":"∖","✶":"✶","𝔰":"𝔰","⌢":"⌢","♯":"♯","щ":"щ","ш":"ш","∣":"∣","∥":"∥","­":"","­":"","σ":"σ","ς":"ς","ς":"ς","∼":"∼","⩪":"⩪","≃":"≃","≃":"≃","⪞":"⪞","⪠":"⪠","⪝":"⪝","⪟":"⪟","≆":"≆","⨤":"⨤","⥲":"⥲","←":"←","∖":"∖","⨳":"⨳","⧤":"⧤","∣":"∣","⌣":"⌣","⪪":"⪪","⪬":"⪬","⪬︀":"⪬︀","ь":"ь","/":"/","⧄":"⧄","⌿":"⌿","𝕤":"𝕤","♠":"♠","♠":"♠","∥":"∥","⊓":"⊓","⊓︀":"⊓︀","⊔":"⊔","⊔︀":"⊔︀","⊏":"⊏","⊑":"⊑","⊏":"⊏","⊑":"⊑","⊐":"⊐","⊒":"⊒","⊐":"⊐","⊒":"⊒","□":"□","□":"□","▪":"▪","▪":"▪","→":"→","𝓈":"𝓈","∖":"∖","⌣":"⌣","⋆":"⋆","☆":"☆","★":"★","ϵ":"ϵ","ϕ":"ϕ","¯":"¯","⊂":"⊂","⫅":"⫅","⪽":"⪽","⊆":"⊆","⫃":"⫃","⫁":"⫁","⫋":"⫋","⊊":"⊊","⪿":"⪿","⥹":"⥹","⊂":"⊂","⊆":"⊆","⫅":"⫅","⊊":"⊊","⫋":"⫋","⫇":"⫇","⫕":"⫕","⫓":"⫓","≻":"≻","⪸":"⪸","≽":"≽","⪰":"⪰","⪺":"⪺","⪶":"⪶","⋩":"⋩","≿":"≿","∑":"∑","♪":"♪","¹":"¹","¹":"¹","²":"²","²":"²","³":"³","³":"³","⊃":"⊃","⫆":"⫆","⪾":"⪾","⫘":"⫘","⊇":"⊇","⫄":"⫄","⟉":"⟉","⫗":"⫗","⥻":"⥻","⫂":"⫂","⫌":"⫌","⊋":"⊋","⫀":"⫀","⊃":"⊃","⊇":"⊇","⫆":"⫆","⊋":"⊋","⫌":"⫌","⫈":"⫈","⫔":"⫔","⫖":"⫖","⇙":"⇙","⤦":"⤦","↙":"↙","↙":"↙","⤪":"⤪","ß":"ß","ß":"ß","⌖":"⌖","τ":"τ","⎴":"⎴","ť":"ť","ţ":"ţ","т":"т","⃛":"⃛","⌕":"⌕","𝔱":"𝔱","∴":"∴","∴":"∴","θ":"θ","ϑ":"ϑ","ϑ":"ϑ","≈":"≈","∼":"∼"," ":" ","≈":"≈","∼":"∼","þ":"þ","þ":"þ","˜":"˜","×":"×","×":"×","⊠":"⊠","⨱":"⨱","⨰":"⨰","∭":"∭","⤨":"⤨","⊤":"⊤","⌶":"⌶","⫱":"⫱","𝕥":"𝕥","⫚":"⫚","⤩":"⤩","‴":"‴","™":"™","▵":"▵","▿":"▿","◃":"◃","⊴":"⊴","≜":"≜","▹":"▹","⊵":"⊵","◬":"◬","≜":"≜","⨺":"⨺","⨹":"⨹","⧍":"⧍","⨻":"⨻","⏢":"⏢","𝓉":"𝓉","ц":"ц","ћ":"ћ","ŧ":"ŧ","≬":"≬","↞":"↞","↠":"↠","⇑":"⇑","⥣":"⥣","ú":"ú","ú":"ú","↑":"↑","ў":"ў","ŭ":"ŭ","û":"û","û":"û","у":"у","⇅":"⇅","ű":"ű","⥮":"⥮","⥾":"⥾","𝔲":"𝔲","ù":"ù","ù":"ù","↿":"↿","↾":"↾","▀":"▀","⌜":"⌜","⌜":"⌜","⌏":"⌏","◸":"◸","ū":"ū","¨":"¨","¨":"¨","ų":"ų","𝕦":"𝕦","↑":"↑","↕":"↕","↿":"↿","↾":"↾","⊎":"⊎","υ":"υ","ϒ":"ϒ","υ":"υ","⇈":"⇈","⌝":"⌝","⌝":"⌝","⌎":"⌎","ů":"ů","◹":"◹","𝓊":"𝓊","⋰":"⋰","ũ":"ũ","▵":"▵","▴":"▴","⇈":"⇈","ü":"ü","ü":"ü","⦧":"⦧","⇕":"⇕","⫨":"⫨","⫩":"⫩","⊨":"⊨","⦜":"⦜","ϵ":"ϵ","ϰ":"ϰ","∅":"∅","ϕ":"ϕ","ϖ":"ϖ","∝":"∝","↕":"↕","ϱ":"ϱ","ς":"ς","⊊︀":"⊊︀","⫋︀":"⫋︀","⊋︀":"⊋︀","⫌︀":"⫌︀","ϑ":"ϑ","⊲":"⊲","⊳":"⊳","в":"в","⊢":"⊢","∨":"∨","⊻":"⊻","≚":"≚","⋮":"⋮","|":"|","|":"|","𝔳":"𝔳","⊲":"⊲","⊂⃒":"⊂⃒","⊃⃒":"⊃⃒","𝕧":"𝕧","∝":"∝","⊳":"⊳","𝓋":"𝓋","⫋︀":"⫋︀","⊊︀":"⊊︀","⫌︀":"⫌︀","⊋︀":"⊋︀","⦚":"⦚","ŵ":"ŵ","⩟":"⩟","∧":"∧","≙":"≙","℘":"℘","𝔴":"𝔴","𝕨":"𝕨","℘":"℘","≀":"≀","≀":"≀","𝓌":"𝓌","⋂":"⋂","◯":"◯","⋃":"⋃","▽":"▽","𝔵":"𝔵","⟺":"⟺","⟷":"⟷","ξ":"ξ","⟸":"⟸","⟵":"⟵","⟼":"⟼","⋻":"⋻","⨀":"⨀","𝕩":"𝕩","⨁":"⨁","⨂":"⨂","⟹":"⟹","⟶":"⟶","𝓍":"𝓍","⨆":"⨆","⨄":"⨄","△":"△","⋁":"⋁","⋀":"⋀","ý":"ý","ý":"ý","я":"я","ŷ":"ŷ","ы":"ы","¥":"¥","¥":"¥","𝔶":"𝔶","ї":"ї","𝕪":"𝕪","𝓎":"𝓎","ю":"ю","ÿ":"ÿ","ÿ":"ÿ","ź":"ź","ž":"ž","з":"з","ż":"ż","ℨ":"ℨ","ζ":"ζ","𝔷":"𝔷","ж":"ж","⇝":"⇝","𝕫":"𝕫","𝓏":"𝓏","‍":"","‌":""},characters:{Æ:"Æ","&":"&",Á:"Á",Ă:"Ă",Â:"Â",А:"А","𝔄":"𝔄",À:"À",Α:"Α",Ā:"Ā","⩓":"⩓",Ą:"Ą","𝔸":"𝔸","":"⁡",Å:"Å","𝒜":"𝒜","≔":"≔",Ã:"Ã",Ä:"Ä","∖":"∖","⫧":"⫧","⌆":"⌆",Б:"Б","∵":"∵",ℬ:"ℬ",Β:"Β","𝔅":"𝔅","𝔹":"𝔹","˘":"˘","≎":"≎",Ч:"Ч","©":"©",Ć:"Ć","⋒":"⋒","ⅅ":"ⅅ",ℭ:"ℭ",Č:"Č",Ç:"Ç",Ĉ:"Ĉ","∰":"∰",Ċ:"Ċ","¸":"¸","·":"·",Χ:"Χ","⊙":"⊙","⊖":"⊖","⊕":"⊕","⊗":"⊗","∲":"∲","”":"”","’":"’","∷":"∷","⩴":"⩴","≡":"≡","∯":"∯","∮":"∮",ℂ:"ℂ","∐":"∐","∳":"∳","⨯":"⨯","𝒞":"𝒞","⋓":"⋓","≍":"≍","⤑":"⤑",Ђ:"Ђ",Ѕ:"Ѕ",Џ:"Џ","‡":"‡","↡":"↡","⫤":"⫤",Ď:"Ď",Д:"Д","∇":"∇",Δ:"Δ","𝔇":"𝔇","´":"´","˙":"˙","˝":"˝","`":"`","˜":"˜","⋄":"⋄","ⅆ":"ⅆ","𝔻":"𝔻","¨":"¨","⃜":"⃜","≐":"≐","⇓":"⇓","⇐":"⇐","⇔":"⇔","⟸":"⟸","⟺":"⟺","⟹":"⟹","⇒":"⇒","⊨":"⊨","⇑":"⇑","⇕":"⇕","∥":"∥","↓":"↓","⤓":"⤓","⇵":"⇵","̑":"̑","⥐":"⥐","⥞":"⥞","↽":"↽","⥖":"⥖","⥟":"⥟","⇁":"⇁","⥗":"⥗","⊤":"⊤","↧":"↧","𝒟":"𝒟",Đ:"Đ",Ŋ:"Ŋ",Ð:"Ð",É:"É",Ě:"Ě",Ê:"Ê",Э:"Э",Ė:"Ė","𝔈":"𝔈",È:"È","∈":"∈",Ē:"Ē","◻":"◻","▫":"▫",Ę:"Ę","𝔼":"𝔼",Ε:"Ε","⩵":"⩵","≂":"≂","⇌":"⇌",ℰ:"ℰ","⩳":"⩳",Η:"Η",Ë:"Ë","∃":"∃","ⅇ":"ⅇ",Ф:"Ф","𝔉":"𝔉","◼":"◼","▪":"▪","𝔽":"𝔽","∀":"∀",ℱ:"ℱ",Ѓ:"Ѓ",">":">",Γ:"Γ",Ϝ:"Ϝ",Ğ:"Ğ",Ģ:"Ģ",Ĝ:"Ĝ",Г:"Г",Ġ:"Ġ","𝔊":"𝔊","⋙":"⋙","𝔾":"𝔾","≥":"≥","⋛":"⋛","≧":"≧","⪢":"⪢","≷":"≷","⩾":"⩾","≳":"≳","𝒢":"𝒢","≫":"≫",Ъ:"Ъ","ˇ":"ˇ","^":"^",Ĥ:"Ĥ",ℌ:"ℌ",ℋ:"ℋ",ℍ:"ℍ","─":"─",Ħ:"Ħ","≏":"≏",Е:"Е",IJ:"IJ",Ё:"Ё",Í:"Í",Î:"Î",И:"И",İ:"İ",ℑ:"ℑ",Ì:"Ì",Ī:"Ī","ⅈ":"ⅈ","∬":"∬","∫":"∫","⋂":"⋂","":"⁣","":"⁢",Į:"Į","𝕀":"𝕀",Ι:"Ι",ℐ:"ℐ",Ĩ:"Ĩ",І:"І",Ï:"Ï",Ĵ:"Ĵ",Й:"Й","𝔍":"𝔍","𝕁":"𝕁","𝒥":"𝒥",Ј:"Ј",Є:"Є",Х:"Х",Ќ:"Ќ",Κ:"Κ",Ķ:"Ķ",К:"К","𝔎":"𝔎","𝕂":"𝕂","𝒦":"𝒦",Љ:"Љ","<":"<",Ĺ:"Ĺ",Λ:"Λ","⟪":"⟪",ℒ:"ℒ","↞":"↞",Ľ:"Ľ",Ļ:"Ļ",Л:"Л","⟨":"⟨","←":"←","⇤":"⇤","⇆":"⇆","⌈":"⌈","⟦":"⟦","⥡":"⥡","⇃":"⇃","⥙":"⥙","⌊":"⌊","↔":"↔","⥎":"⥎","⊣":"⊣","↤":"↤","⥚":"⥚","⊲":"⊲","⧏":"⧏","⊴":"⊴","⥑":"⥑","⥠":"⥠","↿":"↿","⥘":"⥘","↼":"↼","⥒":"⥒","⋚":"⋚","≦":"≦","≶":"≶","⪡":"⪡","⩽":"⩽","≲":"≲","𝔏":"𝔏","⋘":"⋘","⇚":"⇚",Ŀ:"Ŀ","⟵":"⟵","⟷":"⟷","⟶":"⟶","𝕃":"𝕃","↙":"↙","↘":"↘","↰":"↰",Ł:"Ł","≪":"≪","⤅":"⤅",М:"М"," ":" ",ℳ:"ℳ","𝔐":"𝔐","∓":"∓","𝕄":"𝕄",Μ:"Μ",Њ:"Њ",Ń:"Ń",Ň:"Ň",Ņ:"Ņ",Н:"Н","":"​","\n":"
","𝔑":"𝔑","":"⁠"," ":" ",ℕ:"ℕ","⫬":"⫬","≢":"≢","≭":"≭","∦":"∦","∉":"∉","≠":"≠","≂̸":"≂̸","∄":"∄","≯":"≯","≱":"≱","≧̸":"≧̸","≫̸":"≫̸","≹":"≹","⩾̸":"⩾̸","≵":"≵","≎̸":"≎̸","≏̸":"≏̸","⋪":"⋪","⧏̸":"⧏̸","⋬":"⋬","≮":"≮","≰":"≰","≸":"≸","≪̸":"≪̸","⩽̸":"⩽̸","≴":"≴","⪢̸":"⪢̸","⪡̸":"⪡̸","⊀":"⊀","⪯̸":"⪯̸","⋠":"⋠","∌":"∌","⋫":"⋫","⧐̸":"⧐̸","⋭":"⋭","⊏̸":"⊏̸","⋢":"⋢","⊐̸":"⊐̸","⋣":"⋣","⊂⃒":"⊂⃒","⊈":"⊈","⊁":"⊁","⪰̸":"⪰̸","⋡":"⋡","≿̸":"≿̸","⊃⃒":"⊃⃒","⊉":"⊉","≁":"≁","≄":"≄","≇":"≇","≉":"≉","∤":"∤","𝒩":"𝒩",Ñ:"Ñ",Ν:"Ν",Œ:"Œ",Ó:"Ó",Ô:"Ô",О:"О",Ő:"Ő","𝔒":"𝔒",Ò:"Ò",Ō:"Ō",Ω:"Ω",Ο:"Ο","𝕆":"𝕆","“":"“","‘":"‘","⩔":"⩔","𝒪":"𝒪",Ø:"Ø",Õ:"Õ","⨷":"⨷",Ö:"Ö","‾":"‾","⏞":"⏞","⎴":"⎴","⏜":"⏜","∂":"∂",П:"П","𝔓":"𝔓",Φ:"Φ",Π:"Π","±":"±",ℙ:"ℙ","⪻":"⪻","≺":"≺","⪯":"⪯","≼":"≼","≾":"≾","″":"″","∏":"∏","∝":"∝","𝒫":"𝒫",Ψ:"Ψ",'"':""","𝔔":"𝔔",ℚ:"ℚ","𝒬":"𝒬","⤐":"⤐","®":"®",Ŕ:"Ŕ","⟫":"⟫","↠":"↠","⤖":"⤖",Ř:"Ř",Ŗ:"Ŗ",Р:"Р",ℜ:"ℜ","∋":"∋","⇋":"⇋","⥯":"⥯",Ρ:"Ρ","⟩":"⟩","→":"→","⇥":"⇥","⇄":"⇄","⌉":"⌉","⟧":"⟧","⥝":"⥝","⇂":"⇂","⥕":"⥕","⌋":"⌋","⊢":"⊢","↦":"↦","⥛":"⥛","⊳":"⊳","⧐":"⧐","⊵":"⊵","⥏":"⥏","⥜":"⥜","↾":"↾","⥔":"⥔","⇀":"⇀","⥓":"⥓",ℝ:"ℝ","⥰":"⥰","⇛":"⇛",ℛ:"ℛ","↱":"↱","⧴":"⧴",Щ:"Щ",Ш:"Ш",Ь:"Ь",Ś:"Ś","⪼":"⪼",Š:"Š",Ş:"Ş",Ŝ:"Ŝ",С:"С","𝔖":"𝔖","↑":"↑",Σ:"Σ","∘":"∘","𝕊":"𝕊","√":"√","□":"□","⊓":"⊓","⊏":"⊏","⊑":"⊑","⊐":"⊐","⊒":"⊒","⊔":"⊔","𝒮":"𝒮","⋆":"⋆","⋐":"⋐","⊆":"⊆","≻":"≻","⪰":"⪰","≽":"≽","≿":"≿","∑":"∑","⋑":"⋑","⊃":"⊃","⊇":"⊇",Þ:"Þ","™":"™",Ћ:"Ћ",Ц:"Ц"," ":"	",Τ:"Τ",Ť:"Ť",Ţ:"Ţ",Т:"Т","𝔗":"𝔗","∴":"∴",Θ:"Θ"," ":"  "," ":" ","∼":"∼","≃":"≃","≅":"≅","≈":"≈","𝕋":"𝕋","⃛":"⃛","𝒯":"𝒯",Ŧ:"Ŧ",Ú:"Ú","↟":"↟","⥉":"⥉",Ў:"Ў",Ŭ:"Ŭ",Û:"Û",У:"У",Ű:"Ű","𝔘":"𝔘",Ù:"Ù",Ū:"Ū",_:"_","⏟":"⏟","⎵":"⎵","⏝":"⏝","⋃":"⋃","⊎":"⊎",Ų:"Ų","𝕌":"𝕌","⤒":"⤒","⇅":"⇅","↕":"↕","⥮":"⥮","⊥":"⊥","↥":"↥","↖":"↖","↗":"↗",ϒ:"ϒ",Υ:"Υ",Ů:"Ů","𝒰":"𝒰",Ũ:"Ũ",Ü:"Ü","⊫":"⊫","⫫":"⫫",В:"В","⊩":"⊩","⫦":"⫦","⋁":"⋁","‖":"‖","∣":"∣","|":"|","❘":"❘","≀":"≀"," ":" ","𝔙":"𝔙","𝕍":"𝕍","𝒱":"𝒱","⊪":"⊪",Ŵ:"Ŵ","⋀":"⋀","𝔚":"𝔚","𝕎":"𝕎","𝒲":"𝒲","𝔛":"𝔛",Ξ:"Ξ","𝕏":"𝕏","𝒳":"𝒳",Я:"Я",Ї:"Ї",Ю:"Ю",Ý:"Ý",Ŷ:"Ŷ",Ы:"Ы","𝔜":"𝔜","𝕐":"𝕐","𝒴":"𝒴",Ÿ:"Ÿ",Ж:"Ж",Ź:"Ź",Ž:"Ž",З:"З",Ż:"Ż",Ζ:"Ζ",ℨ:"ℨ",ℤ:"ℤ","𝒵":"𝒵",á:"á",ă:"ă","∾":"∾","∾̳":"∾̳","∿":"∿",â:"â",а:"а",æ:"æ","𝔞":"𝔞",à:"à",ℵ:"ℵ",α:"α",ā:"ā","⨿":"⨿","∧":"∧","⩕":"⩕","⩜":"⩜","⩘":"⩘","⩚":"⩚","∠":"∠","⦤":"⦤","∡":"∡","⦨":"⦨","⦩":"⦩","⦪":"⦪","⦫":"⦫","⦬":"⦬","⦭":"⦭","⦮":"⦮","⦯":"⦯","∟":"∟","⊾":"⊾","⦝":"⦝","∢":"∢","⍼":"⍼",ą:"ą","𝕒":"𝕒","⩰":"⩰","⩯":"⩯","≊":"≊","≋":"≋","'":"'",å:"å","𝒶":"𝒶","*":"*",ã:"ã",ä:"ä","⨑":"⨑","⫭":"⫭","≌":"≌","϶":"϶","‵":"‵","∽":"∽","⋍":"⋍","⊽":"⊽","⌅":"⌅","⎶":"⎶",б:"б","„":"„","⦰":"⦰",β:"β",ℶ:"ℶ","≬":"≬","𝔟":"𝔟","◯":"◯","⨀":"⨀","⨁":"⨁","⨂":"⨂","⨆":"⨆","★":"★","▽":"▽","△":"△","⨄":"⨄","⤍":"⤍","⧫":"⧫","▴":"▴","▾":"▾","◂":"◂","▸":"▸","␣":"␣","▒":"▒","░":"░","▓":"▓","█":"█","=⃥":"=⃥","≡⃥":"≡⃥","⌐":"⌐","𝕓":"𝕓","⋈":"⋈","╗":"╗","╔":"╔","╖":"╖","╓":"╓","═":"═","╦":"╦","╩":"╩","╤":"╤","╧":"╧","╝":"╝","╚":"╚","╜":"╜","╙":"╙","║":"║","╬":"╬","╣":"╣","╠":"╠","╫":"╫","╢":"╢","╟":"╟","⧉":"⧉","╕":"╕","╒":"╒","┐":"┐","┌":"┌","╥":"╥","╨":"╨","┬":"┬","┴":"┴","⊟":"⊟","⊞":"⊞","⊠":"⊠","╛":"╛","╘":"╘","┘":"┘","└":"└","│":"│","╪":"╪","╡":"╡","╞":"╞","┼":"┼","┤":"┤","├":"├","¦":"¦","𝒷":"𝒷","⁏":"⁏","\\":"\","⧅":"⧅","⟈":"⟈","•":"•","⪮":"⪮",ć:"ć","∩":"∩","⩄":"⩄","⩉":"⩉","⩋":"⩋","⩇":"⩇","⩀":"⩀","∩︀":"∩︀","⁁":"⁁","⩍":"⩍",č:"č",ç:"ç",ĉ:"ĉ","⩌":"⩌","⩐":"⩐",ċ:"ċ","⦲":"⦲","¢":"¢","𝔠":"𝔠",ч:"ч","✓":"✓",χ:"χ","○":"○","⧃":"⧃","ˆ":"ˆ","≗":"≗","↺":"↺","↻":"↻","Ⓢ":"Ⓢ","⊛":"⊛","⊚":"⊚","⊝":"⊝","⨐":"⨐","⫯":"⫯","⧂":"⧂","♣":"♣",":":":",",":",","@":"@","∁":"∁","⩭":"⩭","𝕔":"𝕔","℗":"℗","↵":"↵","✗":"✗","𝒸":"𝒸","⫏":"⫏","⫑":"⫑","⫐":"⫐","⫒":"⫒","⋯":"⋯","⤸":"⤸","⤵":"⤵","⋞":"⋞","⋟":"⋟","↶":"↶","⤽":"⤽","∪":"∪","⩈":"⩈","⩆":"⩆","⩊":"⩊","⊍":"⊍","⩅":"⩅","∪︀":"∪︀","↷":"↷","⤼":"⤼","⋎":"⋎","⋏":"⋏","¤":"¤","∱":"∱","⌭":"⌭","⥥":"⥥","†":"†",ℸ:"ℸ","‐":"‐","⤏":"⤏",ď:"ď",д:"д","⇊":"⇊","⩷":"⩷","°":"°",δ:"δ","⦱":"⦱","⥿":"⥿","𝔡":"𝔡","♦":"♦",ϝ:"ϝ","⋲":"⋲","÷":"÷","⋇":"⋇",ђ:"ђ","⌞":"⌞","⌍":"⌍",$:"$","𝕕":"𝕕","≑":"≑","∸":"∸","∔":"∔","⊡":"⊡","⌟":"⌟","⌌":"⌌","𝒹":"𝒹",ѕ:"ѕ","⧶":"⧶",đ:"đ","⋱":"⋱","▿":"▿","⦦":"⦦",џ:"џ","⟿":"⟿",é:"é","⩮":"⩮",ě:"ě","≖":"≖",ê:"ê","≕":"≕",э:"э",ė:"ė","≒":"≒","𝔢":"𝔢","⪚":"⪚",è:"è","⪖":"⪖","⪘":"⪘","⪙":"⪙","⏧":"⏧",ℓ:"ℓ","⪕":"⪕","⪗":"⪗",ē:"ē","∅":"∅"," ":" "," ":" "," ":" ",ŋ:"ŋ"," ":" ",ę:"ę","𝕖":"𝕖","⋕":"⋕","⧣":"⧣","⩱":"⩱",ε:"ε","ϵ":"ϵ","=":"=","≟":"≟","⩸":"⩸","⧥":"⧥","≓":"≓","⥱":"⥱",ℯ:"ℯ",η:"η",ð:"ð",ë:"ë","€":"€","!":"!",ф:"ф","♀":"♀",ffi:"ffi",ff:"ff",ffl:"ffl","𝔣":"𝔣",fi:"fi",fj:"fj","♭":"♭",fl:"fl","▱":"▱",ƒ:"ƒ","𝕗":"𝕗","⋔":"⋔","⫙":"⫙","⨍":"⨍","½":"½","⅓":"⅓","¼":"¼","⅕":"⅕","⅙":"⅙","⅛":"⅛","⅔":"⅔","⅖":"⅖","¾":"¾","⅗":"⅗","⅜":"⅜","⅘":"⅘","⅚":"⅚","⅝":"⅝","⅞":"⅞","⁄":"⁄","⌢":"⌢","𝒻":"𝒻","⪌":"⪌",ǵ:"ǵ",γ:"γ","⪆":"⪆",ğ:"ğ",ĝ:"ĝ",г:"г",ġ:"ġ","⪩":"⪩","⪀":"⪀","⪂":"⪂","⪄":"⪄","⋛︀":"⋛︀","⪔":"⪔","𝔤":"𝔤",ℷ:"ℷ",ѓ:"ѓ","⪒":"⪒","⪥":"⪥","⪤":"⪤","≩":"≩","⪊":"⪊","⪈":"⪈","⋧":"⋧","𝕘":"𝕘",ℊ:"ℊ","⪎":"⪎","⪐":"⪐","⪧":"⪧","⩺":"⩺","⋗":"⋗","⦕":"⦕","⩼":"⩼","⥸":"⥸","≩︀":"≩︀",ъ:"ъ","⥈":"⥈","↭":"↭",ℏ:"ℏ",ĥ:"ĥ","♥":"♥","…":"…","⊹":"⊹","𝔥":"𝔥","⤥":"⤥","⤦":"⤦","⇿":"⇿","∻":"∻","↩":"↩","↪":"↪","𝕙":"𝕙","―":"―","𝒽":"𝒽",ħ:"ħ","⁃":"⁃",í:"í",î:"î",и:"и",е:"е","¡":"¡","𝔦":"𝔦",ì:"ì","⨌":"⨌","∭":"∭","⧜":"⧜","℩":"℩",ij:"ij",ī:"ī",ı:"ı","⊷":"⊷",Ƶ:"Ƶ","℅":"℅","∞":"∞","⧝":"⧝","⊺":"⊺","⨗":"⨗","⨼":"⨼",ё:"ё",į:"į","𝕚":"𝕚",ι:"ι","¿":"¿","𝒾":"𝒾","⋹":"⋹","⋵":"⋵","⋴":"⋴","⋳":"⋳",ĩ:"ĩ",і:"і",ï:"ï",ĵ:"ĵ",й:"й","𝔧":"𝔧","ȷ":"ȷ","𝕛":"𝕛","𝒿":"𝒿",ј:"ј",є:"є",κ:"κ",ϰ:"ϰ",ķ:"ķ",к:"к","𝔨":"𝔨",ĸ:"ĸ",х:"х",ќ:"ќ","𝕜":"𝕜","𝓀":"𝓀","⤛":"⤛","⤎":"⤎","⪋":"⪋","⥢":"⥢",ĺ:"ĺ","⦴":"⦴",λ:"λ","⦑":"⦑","⪅":"⪅","«":"«","⤟":"⤟","⤝":"⤝","↫":"↫","⤹":"⤹","⥳":"⥳","↢":"↢","⪫":"⪫","⤙":"⤙","⪭":"⪭","⪭︀":"⪭︀","⤌":"⤌","❲":"❲","{":"{","[":"[","⦋":"⦋","⦏":"⦏","⦍":"⦍",ľ:"ľ",ļ:"ļ",л:"л","⤶":"⤶","⥧":"⥧","⥋":"⥋","↲":"↲","≤":"≤","⇇":"⇇","⋋":"⋋","⪨":"⪨","⩿":"⩿","⪁":"⪁","⪃":"⪃","⋚︀":"⋚︀","⪓":"⪓","⋖":"⋖","⥼":"⥼","𝔩":"𝔩","⪑":"⪑","⥪":"⥪","▄":"▄",љ:"љ","⥫":"⥫","◺":"◺",ŀ:"ŀ","⎰":"⎰","≨":"≨","⪉":"⪉","⪇":"⪇","⋦":"⋦","⟬":"⟬","⇽":"⇽","⟼":"⟼","↬":"↬","⦅":"⦅","𝕝":"𝕝","⨭":"⨭","⨴":"⨴","∗":"∗","◊":"◊","(":"(","⦓":"⦓","⥭":"⥭","":"‎","⊿":"⊿","‹":"‹","𝓁":"𝓁","⪍":"⪍","⪏":"⪏","‚":"‚",ł:"ł","⪦":"⪦","⩹":"⩹","⋉":"⋉","⥶":"⥶","⩻":"⩻","⦖":"⦖","◃":"◃","⥊":"⥊","⥦":"⥦","≨︀":"≨︀","∺":"∺","¯":"¯","♂":"♂","✠":"✠","▮":"▮","⨩":"⨩",м:"м","—":"—","𝔪":"𝔪","℧":"℧",µ:"µ","⫰":"⫰","−":"−","⨪":"⨪","⫛":"⫛","⊧":"⊧","𝕞":"𝕞","𝓂":"𝓂",μ:"μ","⊸":"⊸","⋙̸":"⋙̸","≫⃒":"≫⃒","⇍":"⇍","⇎":"⇎","⋘̸":"⋘̸","≪⃒":"≪⃒","⇏":"⇏","⊯":"⊯","⊮":"⊮",ń:"ń","∠⃒":"∠⃒","⩰̸":"⩰̸","≋̸":"≋̸",ʼn:"ʼn","♮":"♮","⩃":"⩃",ň:"ň",ņ:"ņ","⩭̸":"⩭̸","⩂":"⩂",н:"н","–":"–","⇗":"⇗","⤤":"⤤","≐̸":"≐̸","⤨":"⤨","𝔫":"𝔫","↮":"↮","⫲":"⫲","⋼":"⋼","⋺":"⋺",њ:"њ","≦̸":"≦̸","↚":"↚","‥":"‥","𝕟":"𝕟","¬":"¬","⋹̸":"⋹̸","⋵̸":"⋵̸","⋷":"⋷","⋶":"⋶","⋾":"⋾","⋽":"⋽","⫽⃥":"⫽⃥","∂̸":"∂̸","⨔":"⨔","↛":"↛","⤳̸":"⤳̸","↝̸":"↝̸","𝓃":"𝓃","⊄":"⊄","⫅̸":"⫅̸","⊅":"⊅","⫆̸":"⫆̸",ñ:"ñ",ν:"ν","#":"#","№":"№"," ":" ","⊭":"⊭","⤄":"⤄","≍⃒":"≍⃒","⊬":"⊬","≥⃒":"≥⃒",">⃒":">⃒","⧞":"⧞","⤂":"⤂","≤⃒":"≤⃒","<⃒":"<⃒","⊴⃒":"⊴⃒","⤃":"⤃","⊵⃒":"⊵⃒","∼⃒":"∼⃒","⇖":"⇖","⤣":"⤣","⤧":"⤧",ó:"ó",ô:"ô",о:"о",ő:"ő","⨸":"⨸","⦼":"⦼",œ:"œ","⦿":"⦿","𝔬":"𝔬","˛":"˛",ò:"ò","⧁":"⧁","⦵":"⦵","⦾":"⦾","⦻":"⦻","⧀":"⧀",ō:"ō",ω:"ω",ο:"ο","⦶":"⦶","𝕠":"𝕠","⦷":"⦷","⦹":"⦹","∨":"∨","⩝":"⩝",ℴ:"ℴ",ª:"ª",º:"º","⊶":"⊶","⩖":"⩖","⩗":"⩗","⩛":"⩛",ø:"ø","⊘":"⊘",õ:"õ","⨶":"⨶",ö:"ö","⌽":"⌽","¶":"¶","⫳":"⫳","⫽":"⫽",п:"п","%":"%",".":".","‰":"‰","‱":"‱","𝔭":"𝔭",φ:"φ",ϕ:"ϕ","☎":"☎",π:"π",ϖ:"ϖ",ℎ:"ℎ","+":"+","⨣":"⨣","⨢":"⨢","⨥":"⨥","⩲":"⩲","⨦":"⨦","⨧":"⨧","⨕":"⨕","𝕡":"𝕡","£":"£","⪳":"⪳","⪷":"⪷","⪹":"⪹","⪵":"⪵","⋨":"⋨","′":"′","⌮":"⌮","⌒":"⌒","⌓":"⌓","⊰":"⊰","𝓅":"𝓅",ψ:"ψ"," ":" ","𝔮":"𝔮","𝕢":"𝕢","⁗":"⁗","𝓆":"𝓆","⨖":"⨖","?":"?","⤜":"⤜","⥤":"⥤","∽̱":"∽̱",ŕ:"ŕ","⦳":"⦳","⦒":"⦒","⦥":"⦥","»":"»","⥵":"⥵","⤠":"⤠","⤳":"⤳","⤞":"⤞","⥅":"⥅","⥴":"⥴","↣":"↣","↝":"↝","⤚":"⤚","∶":"∶","❳":"❳","}":"}","]":"]","⦌":"⦌","⦎":"⦎","⦐":"⦐",ř:"ř",ŗ:"ŗ",р:"р","⤷":"⤷","⥩":"⥩","↳":"↳","▭":"▭","⥽":"⥽","𝔯":"𝔯","⥬":"⥬",ρ:"ρ",ϱ:"ϱ","⇉":"⇉","⋌":"⋌","˚":"˚","":"‏","⎱":"⎱","⫮":"⫮","⟭":"⟭","⇾":"⇾","⦆":"⦆","𝕣":"𝕣","⨮":"⨮","⨵":"⨵",")":")","⦔":"⦔","⨒":"⨒","›":"›","𝓇":"𝓇","⋊":"⋊","▹":"▹","⧎":"⧎","⥨":"⥨","℞":"℞",ś:"ś","⪴":"⪴","⪸":"⪸",š:"š",ş:"ş",ŝ:"ŝ","⪶":"⪶","⪺":"⪺","⋩":"⋩","⨓":"⨓",с:"с","⋅":"⋅","⩦":"⩦","⇘":"⇘","§":"§",";":";","⤩":"⤩","✶":"✶","𝔰":"𝔰","♯":"♯",щ:"щ",ш:"ш","":"­",σ:"σ",ς:"ς","⩪":"⩪","⪞":"⪞","⪠":"⪠","⪝":"⪝","⪟":"⪟","≆":"≆","⨤":"⨤","⥲":"⥲","⨳":"⨳","⧤":"⧤","⌣":"⌣","⪪":"⪪","⪬":"⪬","⪬︀":"⪬︀",ь:"ь","/":"/","⧄":"⧄","⌿":"⌿","𝕤":"𝕤","♠":"♠","⊓︀":"⊓︀","⊔︀":"⊔︀","𝓈":"𝓈","☆":"☆","⊂":"⊂","⫅":"⫅","⪽":"⪽","⫃":"⫃","⫁":"⫁","⫋":"⫋","⊊":"⊊","⪿":"⪿","⥹":"⥹","⫇":"⫇","⫕":"⫕","⫓":"⫓","♪":"♪","¹":"¹","²":"²","³":"³","⫆":"⫆","⪾":"⪾","⫘":"⫘","⫄":"⫄","⟉":"⟉","⫗":"⫗","⥻":"⥻","⫂":"⫂","⫌":"⫌","⊋":"⊋","⫀":"⫀","⫈":"⫈","⫔":"⫔","⫖":"⫖","⇙":"⇙","⤪":"⤪",ß:"ß","⌖":"⌖",τ:"τ",ť:"ť",ţ:"ţ",т:"т","⌕":"⌕","𝔱":"𝔱",θ:"θ",ϑ:"ϑ",þ:"þ","×":"×","⨱":"⨱","⨰":"⨰","⌶":"⌶","⫱":"⫱","𝕥":"𝕥","⫚":"⫚","‴":"‴","▵":"▵","≜":"≜","◬":"◬","⨺":"⨺","⨹":"⨹","⧍":"⧍","⨻":"⨻","⏢":"⏢","𝓉":"𝓉",ц:"ц",ћ:"ћ",ŧ:"ŧ","⥣":"⥣",ú:"ú",ў:"ў",ŭ:"ŭ",û:"û",у:"у",ű:"ű","⥾":"⥾","𝔲":"𝔲",ù:"ù","▀":"▀","⌜":"⌜","⌏":"⌏","◸":"◸",ū:"ū",ų:"ų","𝕦":"𝕦",υ:"υ","⇈":"⇈","⌝":"⌝","⌎":"⌎",ů:"ů","◹":"◹","𝓊":"𝓊","⋰":"⋰",ũ:"ũ",ü:"ü","⦧":"⦧","⫨":"⫨","⫩":"⫩","⦜":"⦜","⊊︀":"⊊︀","⫋︀":"⫋︀","⊋︀":"⊋︀","⫌︀":"⫌︀",в:"в","⊻":"⊻","≚":"≚","⋮":"⋮","𝔳":"𝔳","𝕧":"𝕧","𝓋":"𝓋","⦚":"⦚",ŵ:"ŵ","⩟":"⩟","≙":"≙","℘":"℘","𝔴":"𝔴","𝕨":"𝕨","𝓌":"𝓌","𝔵":"𝔵",ξ:"ξ","⋻":"⋻","𝕩":"𝕩","𝓍":"𝓍",ý:"ý",я:"я",ŷ:"ŷ",ы:"ы","¥":"¥","𝔶":"𝔶",ї:"ї","𝕪":"𝕪","𝓎":"𝓎",ю:"ю",ÿ:"ÿ",ź:"ź",ž:"ž",з:"з",ż:"ż",ζ:"ζ","𝔷":"𝔷",ж:"ж","⇝":"⇝","𝕫":"𝕫","𝓏":"𝓏","":"‍","":"‌"}}};var numericUnicodeMap={};Object.defineProperty(numericUnicodeMap,"__esModule",{value:!0}),numericUnicodeMap.numericUnicodeMap={0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376};var surrogatePairs={};Object.defineProperty(surrogatePairs,"__esModule",{value:!0}),surrogatePairs.fromCodePoint=String.fromCodePoint||function(a){return String.fromCharCode(Math.floor((a-65536)/1024)+55296,(a-65536)%1024+56320)},surrogatePairs.getCodePoint=String.prototype.codePointAt?function(a,s){return a.codePointAt(s)}:function(a,s){return(a.charCodeAt(s)-55296)*1024+a.charCodeAt(s+1)-56320+65536},surrogatePairs.highSurrogateFrom=55296,surrogatePairs.highSurrogateTo=56319;var __assign$9=commonjsGlobal&&commonjsGlobal.__assign||function(){return __assign$9=Object.assign||function(a){for(var s,$=1,_=arguments.length;$<_;$++){s=arguments[$];for(var _e in s)Object.prototype.hasOwnProperty.call(s,_e)&&(a[_e]=s[_e])}return a},__assign$9.apply(this,arguments)};Object.defineProperty(lib$2,"__esModule",{value:!0});var named_references_1=namedReferences,numeric_unicode_map_1=numericUnicodeMap,surrogate_pairs_1=surrogatePairs,allNamedReferences=__assign$9(__assign$9({},named_references_1.namedReferences),{all:named_references_1.namedReferences.html5}),encodeRegExps={specialChars:/[<>'"&]/g,nonAscii:/[<>'"&\u0080-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g,nonAsciiPrintable:/[<>'"&\x01-\x08\x11-\x15\x17-\x1F\x7f-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g,nonAsciiPrintableOnly:/[\x01-\x08\x11-\x15\x17-\x1F\x7f-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g,extensive:/[\x01-\x0c\x0e-\x1f\x21-\x2c\x2e-\x2f\x3a-\x40\x5b-\x60\x7b-\x7d\x7f-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g},defaultEncodeOptions={mode:"specialChars",level:"all",numeric:"decimal"};function encode(a,s){var st=s===void 0?defaultEncodeOptions:s,lt=st.mode,$=lt===void 0?"specialChars":lt,_=st.numeric,_e=_===void 0?"decimal":_,tt=st.level,nt=tt===void 0?"all":tt;if(!a)return"";var at=encodeRegExps[$],ot=allNamedReferences[nt].characters,rt=_e==="hexadecimal";at.lastIndex=0;var st=at.exec(a),lt;if(st){lt="";var _=0;do{_!==st.index&&(lt+=a.substring(_,st.index));var tt=st[0],et=ot[tt];if(!et){var it=tt.length>1?surrogate_pairs_1.getCodePoint(tt,0):tt.charCodeAt(0);et=(rt?"&#x"+it.toString(16):"&#"+it)+";"}lt+=et,_=st.index+tt.length}while(st=at.exec(a));_!==a.length&&(lt+=a.substring(_))}else lt=a;return lt}lib$2.encode=encode;var defaultDecodeOptions={scope:"body",level:"all"},strict=/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);/g,attribute=/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+)[;=]?/g,baseDecodeRegExps={xml:{strict,attribute,body:named_references_1.bodyRegExps.xml},html4:{strict,attribute,body:named_references_1.bodyRegExps.html4},html5:{strict,attribute,body:named_references_1.bodyRegExps.html5}},decodeRegExps=__assign$9(__assign$9({},baseDecodeRegExps),{all:baseDecodeRegExps.html5}),fromCharCode=String.fromCharCode,outOfBoundsChar=fromCharCode(65533),defaultDecodeEntityOptions={level:"all"};function decodeEntity(a,s){var _=(s===void 0?defaultDecodeEntityOptions:s).level,$=_===void 0?"all":_;if(!a)return"";var _=a;a[a.length-1];{var _e=allNamedReferences[$].entities[a];if(_e)_=_e;else if(a[0]==="&"&&a[1]==="#"){var tt=a[2],nt=tt=="x"||tt=="X"?parseInt(a.substr(3),16):parseInt(a.substr(2));_=nt>=1114111?outOfBoundsChar:nt>65535?surrogate_pairs_1.fromCodePoint(nt):fromCharCode(numeric_unicode_map_1.numericUnicodeMap[nt]||nt)}}return _}lib$2.decodeEntity=decodeEntity;function decode(a,s){var $=s===void 0?defaultDecodeOptions:s,_=$.level,_e=_===void 0?"all":_,tt=$.scope,nt=tt===void 0?_e==="xml"?"strict":"body":tt;if(!a)return"";var at=decodeRegExps[_e][nt],ot=allNamedReferences[_e].entities,rt=nt==="attribute",st=nt==="strict";at.lastIndex=0;var lt=at.exec(a),et;if(lt){et="";var it=0;do{it!==lt.index&&(et+=a.substring(it,lt.index));var ut=lt[0],ft=ut,ht=ut[ut.length-1];if(rt&&ht==="=")ft=ut;else if(st&&ht!==";")ft=ut;else{var dt=ot[ut];if(dt)ft=dt;else if(ut[0]==="&"&&ut[1]==="#"){var gt=ut[2],pt=gt=="x"||gt=="X"?parseInt(ut.substr(3),16):parseInt(ut.substr(2));ft=pt>=1114111?outOfBoundsChar:pt>65535?surrogate_pairs_1.fromCodePoint(pt):fromCharCode(numeric_unicode_map_1.numericUnicodeMap[pt]||pt)}}et+=ft,it=lt.index+ut.length}while(lt=at.exec(a));it!==a.length&&(et+=a.substring(it))}else et=a;return et}lib$2.decode=decode,function(a){var s=commonjsGlobal&&commonjsGlobal.__extends||function(){var At=function(xt,bt){return At=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Et,St){Et.__proto__=St}||function(Et,St){for(var Bt in St)Object.prototype.hasOwnProperty.call(St,Bt)&&(Et[Bt]=St[Bt])},At(xt,bt)};return function(xt,bt){if(typeof bt!="function"&&bt!==null)throw new TypeError("Class extends value "+String(bt)+" is not a constructor or null");At(xt,bt);function Et(){this.constructor=xt}xt.prototype=bt===null?Object.create(bt):(Et.prototype=bt.prototype,new Et)}}();Object.defineProperty(a,"__esModule",{value:!0}),a.isBlock=a.parse=a.Matcher=a.HTMLElement=a.CommentNode=a.TextNode=a.AbstractNode=a.NodeType=void 0;var $=lib$2,_;(function(At){At[At.ELEMENT_NODE=1]="ELEMENT_NODE",At[At.TEXT_NODE=3]="TEXT_NODE",At[At.COMMENT_NODE=8]="COMMENT_NODE"})(_=a.NodeType||(a.NodeType={}));var _e=function(){function At(){this.childNodes=[]}return Object.defineProperty(At.prototype,"text",{get:function(){return(0,$.decode)(this.rawText)},enumerable:!1,configurable:!0}),At.prototype.remove=function(){return this.parentNode&&this.parentNode.removeChild(this),this},At}();a.AbstractNode=_e;var tt=function(At){s(xt,At);function xt(bt){var Et=At.call(this)||this;return Et.nodeType=_.TEXT_NODE,Et.value=bt,Et}return Object.defineProperty(xt.prototype,"rawText",{get:function(){return this.value},enumerable:!1,configurable:!0}),Object.defineProperty(xt.prototype,"isWhitespace",{get:function(){return/^(\s| )*$/.test(this.rawText)},enumerable:!1,configurable:!0}),xt.prototype.toString=function(){return this.rawText},xt}(_e);a.TextNode=tt;var nt=function(At){s(xt,At);function xt(bt){var Et=At.call(this)||this;return Et.nodeType=_.COMMENT_NODE,Et.value=bt,Et}return Object.defineProperty(xt.prototype,"rawText",{get:function(){return this.value},enumerable:!1,configurable:!0}),xt.prototype.toString=function(){return"<!--".concat(this.rawText,"-->")},xt}(_e);a.CommentNode=nt;var at={div:!0,p:!0,li:!0,td:!0,section:!0,br:!0};function ot(At){return At[At.length-1]}var rt=function(At){s(xt,At);function xt(bt,Et,St){Et===void 0&&(Et=""),St===void 0&&(St=null);var Bt=At.call(this)||this;Bt.tagName=bt,Bt.rawAttrs=Et,Bt.classNames=[],Bt.nodeType=_.ELEMENT_NODE,Bt.rawAttrs=Et,Bt.parentNode=St,Bt.childNodes=[];for(var Ot={},Pt=void 0;Pt=ut.exec(Et);)Ot[Pt[2]]=Pt[4]||Pt[5]||Pt[6];return Ot.id&&(Bt.id=Ot.id),Ot.class&&(Bt.classNames=Ot.class.split(/\s+/)),Bt}return xt.prototype.removeChild=function(bt){this.childNodes=this.childNodes.filter(function(Et){return Et!==bt}),bt instanceof xt&&(bt.parentNode=null)},xt.prototype.exchangeChild=function(bt,Et){var St=this.childNodes.findIndex(function(Bt){return Bt===bt});St>=0&&(this.childNodes[St]=Et,bt instanceof xt&&(bt.parentNode=null))},Object.defineProperty(xt.prototype,"rawText",{get:function(){for(var bt="",Et=0;Et<this.childNodes.length;Et++)bt+=this.childNodes[Et].rawText;return bt},enumerable:!1,configurable:!0}),Object.defineProperty(xt.prototype,"structuredText",{get:function(){var bt=[],Et=[bt];function St(Bt){if(Bt.nodeType===_.ELEMENT_NODE)at[Bt.tagName]?(bt.length>0&&Et.push(bt=[]),Bt.childNodes.forEach(St),bt.length>0&&Et.push(bt=[])):Bt.childNodes.forEach(St);else if(Bt.nodeType===_.TEXT_NODE)if(Bt.isWhitespace)bt.prependWhitespace=!0;else{var Ot=Bt.text;bt.prependWhitespace&&(Ot=" "+Ot,bt.prependWhitespace=!1),bt.push(Ot)}}return St(this),Et.map(function(Bt){return Bt.join("").trim().replace(/\s{2,}/g," ")}).join(`
|
127
127
|
`).replace(/\s+$/,"")},enumerable:!1,configurable:!0}),xt.prototype.toString=function(){var bt=this.tagName;if(bt){var Et=/^(img|br|hr|area|base|input|doctype|link|meta)$/i.test(bt),St=this.rawAttrs?" "+this.rawAttrs:"";return Et?"<".concat(bt).concat(St," />"):"<".concat(bt).concat(St,">").concat(this.innerHTML,"</").concat(bt,">")}else return this.innerHTML},Object.defineProperty(xt.prototype,"innerHTML",{get:function(){return this.childNodes.map(function(bt){return bt.toString()}).join("")},set:function(bt){var Et=this,St=mt(bt);this.childNodes.forEach(function(Bt){return Bt.remove()}),St.childNodes.forEach(function(Bt){return Et.appendChild(Bt)})},enumerable:!1,configurable:!0}),xt.prototype.set_content=function(bt){if(bt instanceof _e)bt=[bt];else if(typeof bt=="string"){var Et=mt(bt);bt=Et.childNodes.length?Et.childNodes:[new tt(bt)]}this.childNodes=bt},Object.defineProperty(xt.prototype,"outerHTML",{get:function(){return this.toString()},enumerable:!1,configurable:!0}),xt.prototype.trimRight=function(bt){for(var Et=0;Et<this.childNodes.length;Et++){var St=this.childNodes[Et];if(St.nodeType===_.ELEMENT_NODE)St.trimRight(bt);else{var Bt=St.rawText.search(bt);Bt>-1&&(St.value=St.rawText.substr(0,Bt),this.childNodes.length=Et+1)}}return this},Object.defineProperty(xt.prototype,"structure",{get:function(){var bt=[],Et=0;function St(Ot){bt.push(" ".repeat(Et)+Ot)}function Bt(Ot){var Pt=Ot.id?"#"+Ot.id:"",wt=Ot.classNames.length?"."+Ot.classNames.join("."):"";St(Ot.tagName+Pt+wt),Et++;for(var Ct=0;Ct<Ot.childNodes.length;Ct++){var It=Ot.childNodes[Ct];It.nodeType===_.ELEMENT_NODE?Bt(It):It.nodeType===_.TEXT_NODE&&(It.isWhitespace||St("#text"))}Et--}return Bt(this),bt.join(`
|
128
128
|
`)},enumerable:!1,configurable:!0}),xt.prototype.removeWhitespace=function(){for(var bt=0,Et=0;Et<this.childNodes.length;Et++){var St=this.childNodes[Et];if(St.nodeType===_.TEXT_NODE){if(St.isWhitespace)continue;St.value=St.rawText.trim()}else St.nodeType===_.ELEMENT_NODE&&St.removeWhitespace();this.childNodes[bt++]=St}return this.childNodes.length=bt,this},xt.prototype.querySelectorAll=function(bt){var Et=this,St;if(bt instanceof et)St=bt,St.reset();else{if(bt.includes(",")){var Bt=bt.split(",");return Array.from(Bt.reduce(function(yt,Rt){var kt=Et.querySelectorAll(Rt.trim());return kt.reduce(function(jt,Ht){return jt.add(Ht)},yt)},new Set))}St=new et(bt)}for(var Ot=[],Pt=[],wt=0;wt<this.childNodes.length;wt++)for(Pt.push([this.childNodes[wt],0,!1]);Pt.length;){var Ct=ot(Pt),It=Ct[0];if(Ct[1]===0){if(It.nodeType!==_.ELEMENT_NODE){Pt.pop();continue}if((Ct[2]=St.advance(It))&&St.matched){Ot.push(It),St.rewind(),Pt.pop();continue}}Ct[1]<It.childNodes.length?Pt.push([It.childNodes[Ct[1]++],0,!1]):(Ct[2]&&St.rewind(),Pt.pop())}return Ot},xt.prototype.querySelector=function(bt){var Et;bt instanceof et?(Et=bt,Et.reset()):Et=new et(bt);for(var St=[],Bt=0;Bt<this.childNodes.length;Bt++)for(St.push([this.childNodes[Bt],0,!1]);St.length;){var Ot=ot(St),Pt=Ot[0];if(Ot[1]===0){if(Pt.nodeType!==_.ELEMENT_NODE){St.pop();continue}if((Ot[2]=Et.advance(Pt))&&Et.matched)return Pt}Ot[1]<Pt.childNodes.length?St.push([Pt.childNodes[Ot[1]++],0,!1]):(Ot[2]&&Et.rewind(),St.pop())}return null},xt.prototype.appendChild=function(bt){return this.childNodes.push(bt),bt instanceof xt&&(bt.parentNode=this),bt},xt.prototype.prependChild=function(bt){return this.childNodes.unshift(bt),bt instanceof xt&&(bt.parentNode=this),bt},Object.defineProperty(xt.prototype,"firstChild",{get:function(){return this.childNodes[0]},enumerable:!1,configurable:!0}),Object.defineProperty(xt.prototype,"lastChild",{get:function(){return ot(this.childNodes)},enumerable:!1,configurable:!0}),Object.defineProperty(xt.prototype,"attributes",{get:function(){if(this._attrs)return this._attrs;this._attrs={};var bt=this.rawAttributes;for(var Et in bt)this._attrs[Et]=(0,$.decode)(bt[Et]);return this._attrs},enumerable:!1,configurable:!0}),Object.defineProperty(xt.prototype,"rawAttributes",{get:function(){if(this._rawAttrs)return this._rawAttrs;var bt={};if(this.rawAttrs)for(var Et=void 0;Et=ft.exec(this.rawAttrs);)bt[Et[1]]=Et[4]||Et[5]||Et[6]||"";return this._rawAttrs=bt,bt},enumerable:!1,configurable:!0}),xt.prototype.setAttribute=function(bt,Et){bt==="id"?this.id=Et:bt==="class"&&(this.classNames=Et.split(/\s+/));var St=this.attributes;Et===void 0?delete St[bt]:St[bt]=Et+"",this._rawAttrs&&(Et===void 0?delete this._rawAttrs[bt]:this._rawAttrs[bt]=(0,$.encode)(Et+"")),this.rawAttrs=Object.keys(St).map(function(Bt){return Bt+(St[Bt]===""?"":'="'+(0,$.encode)(St[Bt])+'"')}).join(" ")},xt.prototype.removeAttribute=function(bt){this.setAttribute(bt,void 0)},xt.prototype.setAttributes=function(bt){var Et=this;bt.id?this.id=bt.id:bt.class&&(this.classNames=bt.class.split(/\s+/)),this.attributes&&(Object.keys(this.attributes).forEach(function(St){return delete Et.attributes[St]}),Object.keys(bt).forEach(function(St){return Et.attributes[St]=bt[St]+""})),this.rawAttributes&&(Object.keys(this.rawAttributes).forEach(function(St){return delete Et.rawAttributes[St]}),Object.keys(bt).forEach(function(St){return Et.rawAttributes[St]=(0,$.encode)(bt[St]+"")})),this.rawAttrs=Object.keys(bt).map(function(St){return St+(bt[St]===""?"":'="'+(0,$.encode)(bt[St]+"")+'"')}).join(" ")},xt}(_e);a.HTMLElement=rt;var st={},lt={f145:function(At,xt,bt,Et,St){if(xt=xt||"",bt=bt||[],At.id!=xt.substr(1))return!1;for(var Bt=bt,Ot=0;Ot<Bt.length;Ot++)if(At.classNames.indexOf(Bt[Ot])===-1)return!1;return!0},f45:function(At,xt,bt,Et,St){bt=bt||[];for(var Bt=bt,Ot=0;Ot<Bt.length;Ot++)if(At.classNames.indexOf(Bt[Ot])===-1)return!1;return!0},f15:function(At,xt,bt,Et,St){return xt=xt||"",At.id==xt.substr(1)},f1:function(At,xt,bt,Et,St){if(xt=xt||"",At.id!=xt.substr(1))return!1},f5:function(At,xt,bt,Et,St){return!0},f245:function(At,xt,bt,Et,St){Et=Et||"",St=St||"";var Bt=At.attributes;for(var Ot in Bt){var Pt=Bt[Ot];if(Ot==Et&&Pt==St)return!0}return!1},f25:function(At,xt,bt,Et,St){Et=Et||"",St=St||"";var Bt=At.attributes;for(var Ot in Bt){var Pt=Bt[Ot];if(Ot==Et&&Pt==St)return!0}return!1},f2:function(At,xt,bt,Et,St){Et=Et||"",St=St||"";var Bt=At.attributes;for(var Ot in Bt){var Pt=Bt[Ot];if(Ot==Et&&Pt==St)return!0}return!1},f345:function(At,xt,bt,Et,St){if(xt=xt||"",bt=bt||[],At.tagName!=xt)return!1;for(var Bt=bt,Ot=0;Ot<Bt.length;Ot++)if(At.classNames.indexOf(Bt[Ot])===-1)return!1;return!0},f35:function(At,xt,bt,Et,St){return xt=xt||"",At.tagName==xt},f3:function(At,xt,bt,Et,St){if(xt=xt||"",At.tagName!=xt)return!1}},et=function(){function At(xt){this.nextMatch=0,lt.f5=lt.f5,this.matchers=xt.split(" ").map(function(bt){if(st[bt])return st[bt];var Et=bt.split("."),St=Et[0],Bt=Et.slice(1).sort(),Ot='"use strict";',Pt="f",wt="",Ct="";if(St&&St!="*"){var It;if(St[0]=="#")Ot+="if (el.id != "+JSON.stringify(St.substr(1))+") return false;",Pt+="1";else if(It=St.match(/^\[\s*(\S+)\s*(=|!=)\s*((((["'])([^\6]*)\6))|(\S*?))\]\s*/)){wt=It[1];var yt=It[2];if(yt!=="="&&yt!=="!=")throw new Error("Selector not supported, Expect [key${op}value].op must be =,!=");yt==="="&&(yt="=="),Ct=It[7]||It[8],Ot+='let attrs = el.attributes;for (let key in attrs){const val = attrs[key]; if (key == "'.concat(wt,'" && val == "').concat(Ct,'"){return true;}} return false;'),Pt+="2"}else Ot+="if (el.tagName != "+JSON.stringify(St)+") return false;",Pt+="3"}Bt.length>0&&(Ot+="for (let cls = "+JSON.stringify(Bt)+", i = 0; i < cls.length; i++) if (el.classNames.indexOf(cls[i]) === -1) return false;",Pt+="4"),Ot+="return true;",Pt+="5";var Rt={func:lt[Pt],tagName:St||"",classes:Bt||"",attr_key:wt||"",value:Ct||""};return Ot=Ot||"",st[bt]=Rt})}return At.prototype.advance=function(xt){return this.nextMatch<this.matchers.length&&this.matchers[this.nextMatch].func(xt,this.matchers[this.nextMatch].tagName,this.matchers[this.nextMatch].classes,this.matchers[this.nextMatch].attr_key,this.matchers[this.nextMatch].value)?(this.nextMatch++,!0):!1},At.prototype.rewind=function(){this.nextMatch--},Object.defineProperty(At.prototype,"matched",{get:function(){return this.nextMatch==this.matchers.length},enumerable:!1,configurable:!0}),At.prototype.reset=function(){this.nextMatch=0},At.prototype.flushCache=function(){st={}},At}();a.Matcher=et;var it=/<!--[^]*?(?=-->)-->|<(\/?)([a-z][-.:0-9_a-z]*)((\s+[a-z][-.:0-9_a-z]*(\s*=\s*("[^"]*"|'([^']*')|([^\s\/>]+)))?)*)\s*(\/?)>/ig,ut=/(^|\s)(id|class)\s*=\s*("([^"]+)"|'([^']+)'|(\S+))/ig,ft=/([a-z][-.:0-9_a-z]*)(\s*=\s*("([^"]*)"|'([^']*)'|(\S+)))?/ig,ht={area:!0,base:!0,br:!0,col:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,source:!0},dt={li:{li:!0},p:{p:!0,div:!0},b:{div:!0},td:{td:!0,th:!0},th:{td:!0,th:!0},h1:{h1:!0},h2:{h2:!0},h3:{h3:!0},h4:{h4:!0},h5:{h5:!0},h6:{h6:!0}},gt={li:{ul:!0,ol:!0},a:{div:!0},b:{div:!0},i:{div:!0},p:{div:!0},td:{tr:!0,table:!0},th:{tr:!0,table:!0}},pt={script:!0,noscript:!0,style:!0,pre:!0};function mt(At,xt){var bt=new rt(null),Et=bt,St=[bt],Bt=0;xt=xt||{};for(var Ot;Ot=it.exec(At);){if(Bt+Ot[0].length<it.lastIndex){var Pt=At.substring(Bt,it.lastIndex-Ot[0].length);Et.appendChild(new tt(Pt))}if(Bt=it.lastIndex,Ot[0][1]=="!"){if(xt.comment){var Pt=At.substring(Bt-3,Bt-Ot[0].length+4);Et.appendChild(new nt(Pt))}continue}if(xt.lowerCaseTagName&&(Ot[2]=Ot[2].toLowerCase()),!Ot[1]&&(!Ot[9]&&dt[Et.tagName]&&dt[Et.tagName][Ot[2]]&&(St.pop(),Et=ot(St)),Et=Et.appendChild(new rt(Ot[2],Ot[3].trim())),St.push(Et),pt[Ot[2]])){var wt="</"+Ot[2]+">",Ct=At.indexOf(wt,it.lastIndex);if(xt[Ot[2]]){var Pt=void 0;Ct==-1?Pt=At.substr(it.lastIndex):Pt=At.substring(it.lastIndex,Ct),Pt.length>0&&Et.appendChild(new tt(Pt))}Ct==-1?Bt=it.lastIndex=At.length+1:(Bt=it.lastIndex=Ct+wt.length,Ot[1]="true")}if(Ot[1]||Ot[9]||ht[Ot[2]])for(;;)if(Et.tagName==Ot[2]){St.pop(),Et=ot(St);break}else{if(gt[Et.tagName]&>[Et.tagName][Ot[2]]){St.pop(),Et=ot(St);continue}break}}Bt<At.length&&bt.appendChild(new tt(At.substring(Bt))),bt.valid=St.length===1;for(var It=function(){var yt=St.pop(),Rt=ot(St);yt.parentNode&&yt.parentNode instanceof rt&&yt.parentNode.parentNode&&(yt.parentNode===Rt&&yt.tagName===Rt.tagName?(Rt.removeChild(yt),yt.childNodes.forEach(function(kt){Rt.parentNode.appendChild(kt)}),St.pop()):(Rt.removeChild(yt),yt.childNodes.forEach(function(kt){Rt.appendChild(kt)})))};St.length>1;)It();return bt}a.parse=mt;var ct=["html","body","address","article","aside","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","header","hr","li","main","nav","noscript","ol","p","pre","section","tfoot","table","tbody","ul","video","th","td","tr","h1","h2","h3","h4","h5","h6"];function vt(At){return At.nodeType===_.ELEMENT_NODE&&At.tagName&&ct.includes(At.tagName.toLowerCase())}a.isBlock=vt}(dist),LineCapStyle.Butt,LineCapStyle.Round,LineCapStyle.Projecting,FillRule.EvenOdd,FillRule.NonZero,LineJoinStyle.Bevel,LineJoinStyle.Miter,LineJoinStyle.Round;const convertForPdfLayoutProps=({schema:a,pageHeight:s,applyRotateTranslate:$=!0})=>{const{width:_,height:_e,position:tt,rotate:nt,opacity:at}=a,{x:ot,y:rt}=tt,st=nt?-nt:0,lt=mm2pt(_),et=mm2pt(_e);let it=mm2pt(ot),ut=s-mm2pt(rt)-et;if(st&&$){const ft={x:it+lt/2,y:s-mm2pt(rt)-et/2},ht=rotatePoint({x:it,y:ut},ft,st);it=ht.x,ut=ht.y}return{position:{x:it,y:ut},height:et,width:lt,rotate:degrees(st),opacity:at}},rotatePoint=(a,s,$)=>{const _=degreesToRadians($),_e=Math.cos(_)*(a.x-s.x)-Math.sin(_)*(a.y-s.y)+s.x,tt=Math.sin(_)*(a.x-s.x)+Math.cos(_)*(a.y-s.y)+s.y;return{x:_e,y:tt}},isEditable=(a,s)=>a==="designer"||a==="form"&&s.readOnly!==!0,hex2rgb=a=>(a.slice(0,1)==="#"&&(a=a.slice(1)),a.length===3&&(a=a.slice(0,1)+a.slice(0,1)+a.slice(1,2)+a.slice(1,2)+a.slice(2,3)+a.slice(2,3)),[a.slice(0,2),a.slice(2,4),a.slice(4,6)].map(s=>parseInt(s,16))),hex2RgbColor=a=>{if(a){if(!isHexValid(a))throw new Error(`Invalid hex color value ${a}`);const[$,_,_e]=hex2rgb(a);return rgb($/255,_/255,_e/255)}},hex2CmykColor=a=>{if(a){if(!isHexValid(a))throw new Error(`Invalid hex color value ${a}`);a=a.replace("#","");const $=a.substring(0,6),_=a.substring(6,8),_e=_?parseInt(_,16)/255:1;let tt=parseInt($.substring(0,2),16)/255,nt=parseInt($.substring(2,4),16)/255,at=parseInt($.substring(4,6),16)/255;tt=tt*_e+(1-_e),nt=nt*_e+(1-_e),at=at*_e+(1-_e);const ot=1-Math.max(tt,nt,at),rt=tt===0?0:(1-tt-ot)/(1-ot),st=nt===0?0:(1-nt-ot)/(1-ot),lt=at===0?0:(1-at-ot)/(1-ot);return cmyk(rt,st,lt,ot)}},hex2PrintingColor=(a,s)=>(s==null?void 0:s.toLocaleLowerCase())=="cmyk"?hex2CmykColor(a):hex2RgbColor(a),embedAndGetFontObj=async a=>{const{pdfDoc:s,font:$,_cache:_}=a;if(_.has(s))return _.get(s);const _e=await Promise.all(Object.values($).map(async nt=>{let at=nt.data;return typeof at=="string"&&at.startsWith("http")&&(at=await fetch(at).then(ot=>ot.arrayBuffer())),s.embedFont(at,{subset:typeof nt.subset>"u"?!0:nt.subset})})),tt=Object.keys($).reduce((nt,at,ot)=>Object.assign(nt,{[at]:_e[ot]}),{});return _.set(s,tt),tt},getFontProp=async({value:a,font:s,schema:$,colorType:_,_cache:_e})=>{const tt=$.dynamicFontSize?await calculateDynamicFontSize({textSchema:$,font:s,value:a,_cache:_e}):$.fontSize??DEFAULT_FONT_SIZE,nt=hex2PrintingColor($.fontColor||DEFAULT_FONT_COLOR,_);return{alignment:$.alignment??DEFAULT_ALIGNMENT,verticalAlignment:$.verticalAlignment??DEFAULT_VERTICAL_ALIGNMENT,lineHeight:$.lineHeight??DEFAULT_LINE_HEIGHT,characterSpacing:$.characterSpacing??DEFAULT_CHARACTER_SPACING,fontSize:tt,color:nt}},pdfRender=async a=>{const{value:s,pdfDoc:$,pdfLib:_,page:_e,options:tt,schema:nt,_cache:at}=a;if(!s)return;const{font:ot=getDefaultFont(),colorType:rt}=tt,[st,lt,et]=await Promise.all([embedAndGetFontObj({pdfDoc:$,font:ot,_cache:at}),getFontKitFont(nt.fontName,ot,at),getFontProp({value:s,font:ot,schema:nt,_cache:at,colorType:rt})]),{fontSize:it,color:ut,alignment:ft,verticalAlignment:ht,lineHeight:dt,characterSpacing:gt}=et,pt=nt.fontName?nt.fontName:getFallbackFontName(ot),mt=st&&st[pt],ct=_e.getHeight(),{width:vt,height:At,rotate:xt,position:{x:bt,y:Et},opacity:St}=convertForPdfLayoutProps({schema:nt,pageHeight:ct,applyRotateTranslate:!1});if(nt.backgroundColor){const yt=hex2PrintingColor(nt.backgroundColor,rt);_e.drawRectangle({x:bt,y:Et,width:vt,height:At,rotate:xt,color:yt})}_e.pushOperators(_.setCharacterSpacing(gt??DEFAULT_CHARACTER_SPACING));const Bt=heightOfFontAtSize(lt,it),Ot=getFontDescentInPt(lt,it),Pt=dt===0?0:(dt-1)*it/2,wt=splitTextToSize({value:s,characterSpacing:gt,fontSize:it,fontKitFont:lt,boxWidthInPt:vt});let Ct=0;if(ht===VERTICAL_ALIGN_TOP)Ct=Bt+Pt;else{const yt=dt*it*(wt.length-1);ht===VERTICAL_ALIGN_BOTTOM?Ct=At-yt+Ot-Pt:ht===VERTICAL_ALIGN_MIDDLE&&(Ct=(At-yt-Bt+Ot)/2+Bt)}const It={x:bt+vt/2,y:ct-mm2pt(nt.position.y)-At/2};wt.forEach((yt,Rt)=>{const kt=widthOfTextAtSize(yt,lt,it,gt),jt=heightOfFontAtSize(lt,it),Ht=dt*it*Rt;let Ft=bt;ft==="center"?Ft+=(vt-kt)/2:ft==="right"&&(Ft+=vt-kt);let _t=ct-mm2pt(nt.position.y)-Ct-Ht;if(nt.strikethrough&&kt>0){const Nt=Ft+kt+1,Mt=_t+jt/3;_e.drawLine({start:rotatePoint({x:Ft,y:Mt},It,xt.angle),end:rotatePoint({x:Nt,y:Mt},It,xt.angle),thickness:1/12*it,color:ut,opacity:St})}if(nt.underline&&kt>0){const Nt=Ft+kt+1,Mt=_t-jt/12;_e.drawLine({start:rotatePoint({x:Ft,y:Mt},It,xt.angle),end:rotatePoint({x:Nt,y:Mt},It,xt.angle),thickness:1/12*it,color:ut,opacity:St})}if(xt.angle!==0){const Nt=rotatePoint({x:Ft,y:_t},It,xt.angle);Ft=Nt.x,_t=Nt.y}_e.drawText(yt,{x:Ft,y:_t,rotate:xt,size:it,color:ut,lineHeight:dt*it,font:mt,opacity:St})})},DEFAULT_OPACITY=1,HEX_COLOR_PATTERN="^#(?:[A-Fa-f0-9]{6})$",TextStrikethroughIcon='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><path d="M6.85 7.08C6.85 4.37 9.45 3 12.24 3c1.64 0 3 .49 3.9 1.28c.77.65 1.46 1.73 1.46 3.24h-3.01c0-.31-.05-.59-.15-.85c-.29-.86-1.2-1.28-2.25-1.28c-1.86 0-2.34 1.02-2.34 1.7c0 .48.25.88.74 1.21c.38.25.77.48 1.41.7H7.39c-.21-.34-.54-.89-.54-1.92zM21 12v-2H3v2h9.62c1.15.45 1.96.75 1.96 1.97c0 1-.81 1.67-2.28 1.67c-1.54 0-2.93-.54-2.93-2.51H6.4c0 .55.08 1.13.24 1.58c.81 2.29 3.29 3.3 5.67 3.3c2.27 0 5.3-.89 5.3-4.05c0-.3-.01-1.16-.48-1.94H21V12z" fill="currentColor"></path></svg>',TextUnderlineIcon='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><path d="M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6zm-7 2v2h14v-2H5z" fill="currentColor"></path></svg>',TextAlignLeftIcon='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><path d="M15 15H3v2h12v-2zm0-8H3v2h12V7zM3 13h18v-2H3v2zm0 8h18v-2H3v2zM3 3v2h18V3H3z" fill="currentColor"></path></svg>',TextAlignCenterIcon='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><path d="M7 15v2h10v-2H7zm-4 6h18v-2H3v2zm0-8h18v-2H3v2zm4-6v2h10V7H7zM3 3v2h18V3H3z" fill="currentColor"></path></svg>',TextAlignRightIcon='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><path d="M3 21h18v-2H3v2zm6-4h12v-2H9v2zm-6-4h18v-2H3v2zm6-4h12V7H9v2zM3 3v2h18V3H3z" fill="currentColor"></path></svg>',TextVerticalAlignTopIcon='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><path d="M8 11h3v10h2V11h3l-4-4l-4 4zM4 3v2h16V3H4z" fill="currentColor"></path></svg>',TextVerticalAlignMiddleIcon='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><path d="M8 19h3v4h2v-4h3l-4-4l-4 4zm8-14h-3V1h-2v4H8l4 4l4-4zM4 11v2h16v-2H4z" fill="currentColor"></path></svg>',TextVerticalAlignBottomIcon='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><path d="M16 13h-3V3h-2v10H8l4 4l4-4zM4 19v2h16v-2H4z" fill="currentColor"></path></svg>';var Formatter;(function(a){a.STRIKETHROUGH="strikethrough",a.UNDERLINE="underline",a.ALIGNMENT="alignment",a.VERTICAL_ALIGNMENT="verticalAlignment"})(Formatter||(Formatter={}));function getExtraFormatterSchema(a){const s=[{key:Formatter.STRIKETHROUGH,icon:TextStrikethroughIcon,type:"boolean"},{key:Formatter.UNDERLINE,icon:TextUnderlineIcon,type:"boolean"},{key:Formatter.ALIGNMENT,icon:TextAlignLeftIcon,type:"select",value:DEFAULT_ALIGNMENT},{key:Formatter.ALIGNMENT,icon:TextAlignCenterIcon,type:"select",value:ALIGN_CENTER},{key:Formatter.ALIGNMENT,icon:TextAlignRightIcon,type:"select",value:ALIGN_RIGHT},{key:Formatter.VERTICAL_ALIGNMENT,icon:TextVerticalAlignTopIcon,type:"select",value:DEFAULT_VERTICAL_ALIGNMENT},{key:Formatter.VERTICAL_ALIGNMENT,icon:TextVerticalAlignMiddleIcon,type:"select",value:VERTICAL_ALIGN_MIDDLE},{key:Formatter.VERTICAL_ALIGNMENT,icon:TextVerticalAlignBottomIcon,type:"select",value:VERTICAL_ALIGN_BOTTOM}];return{title:a("schemas.text.format"),widget:"ButtonGroup",buttons:s,span:17}}const UseDynamicFontSize=a=>{const{rootElement:s,changeSchemas:$,activeSchema:_,i18n:_e}=a,tt=document.createElement("input");tt.type="checkbox",tt.checked=!!(_!=null&&_.dynamicFontSize),tt.onchange=ot=>{const rt=ot.target.checked?{min:DEFAULT_DYNAMIC_MIN_FONT_SIZE,max:DEFAULT_DYNAMIC_MAX_FONT_SIZE,fit:DEFAULT_DYNAMIC_FIT}:void 0;$([{key:"dynamicFontSize",value:rt,schemaId:_.id}])};const nt=document.createElement("label"),at=document.createElement("span");at.innerText=_e("schemas.text.dynamicFontSize")||"",at.style.cssText="margin-left: 0.5rem",nt.style.cssText="display: flex; width: 100%;",nt.appendChild(tt),nt.appendChild(at),s.appendChild(nt)},propPanel={schema:({options:a,activeSchema:s,i18n:$})=>{const _=a.font||{[DEFAULT_FONT_NAME]:{data:"",fallback:!0}},_e=Object.keys(_),tt=getFallbackFontName(_),nt=!!(s!=null&&s.dynamicFontSize);return{fontName:{title:$("schemas.text.fontName"),type:"string",widget:"select",default:tt,props:{options:_e.map(ot=>({label:ot,value:ot}))},span:12},fontSize:{title:$("schemas.text.size"),type:"number",widget:"inputNumber",span:6,disabled:nt,props:{min:0}},characterSpacing:{title:$("schemas.text.spacing"),type:"number",widget:"inputNumber",span:6,props:{min:0}},formatter:getExtraFormatterSchema($),lineHeight:{title:$("schemas.text.lineHeight"),type:"number",widget:"inputNumber",props:{step:.1,min:0},span:7},useDynamicFontSize:{type:"boolean",widget:"UseDynamicFontSize",bind:!1,span:16},dynamicFontSize:{type:"object",widget:"card",column:3,properties:{min:{title:$("schemas.text.min"),type:"number",widget:"inputNumber",hidden:!nt,props:{min:0}},max:{title:$("schemas.text.max"),type:"number",widget:"inputNumber",hidden:!nt,props:{min:0}},fit:{title:$("schemas.text.fit"),type:"string",widget:"select",hidden:!nt,props:{options:[{label:$("schemas.horizontal"),value:DYNAMIC_FIT_HORIZONTAL},{label:$("schemas.vertical"),value:DYNAMIC_FIT_VERTICAL}]}}}},fontColor:{title:$("schemas.textColor"),type:"string",widget:"color",rules:[{pattern:HEX_COLOR_PATTERN,message:$("validation.hexColor")}]},backgroundColor:{title:$("schemas.bgColor"),type:"string",widget:"color",rules:[{pattern:HEX_COLOR_PATTERN,message:$("validation.hexColor")}]}}},widgets:{UseDynamicFontSize},defaultSchema:{type:"text",content:"Type Something...",position:{x:0,y:0},width:45,height:10,rotate:0,alignment:DEFAULT_ALIGNMENT,verticalAlignment:DEFAULT_VERTICAL_ALIGNMENT,fontSize:DEFAULT_FONT_SIZE,lineHeight:DEFAULT_LINE_HEIGHT,characterSpacing:DEFAULT_CHARACTER_SPACING,dynamicFontSize:void 0,fontColor:DEFAULT_FONT_COLOR,fontName:void 0,backgroundColor:"",opacity:DEFAULT_OPACITY,strikethrough:!1,underline:!1}},replaceUnsupportedChars=(a,s)=>{const $={},_=tt=>{if(tt in $)return $[tt];const nt=s.hasGlyphForCodePoint(tt.codePointAt(0)||0);return $[tt]=nt,nt};return a.split(/(\r\n|\n|\r)/).map(tt=>/\r\n|\n|\r/.test(tt)?tt:tt.split("").map(nt=>/\s/.test(nt)||nt.charCodeAt(0)<32||_(nt)?nt:"〿").join("")).join("")},uiRender=async a=>{const{value:s,schema:$,mode:_,onChange:_e,stopEditing:tt,tabIndex:nt,placeholder:at,options:ot,_cache:rt}=a,st=isEditable(_,$)&&at&&!s,lt=ht=>{let dt=ht.innerText;return dt.endsWith(`
|
129
|
-
`)&&(dt=dt.slice(0,-1)),dt},et=(ot==null?void 0:ot.font)||getDefaultFont(),[it,ut]=await Promise.all([getFontKitFont($.fontName,et,rt),buildStyledTextContainer(a,st?at:s)]),ft=replaceUnsupportedChars(s,it);if(!isEditable(_,$)){ut.innerHTML=ft.split("").map((ht,dt)=>`<span style="letter-spacing:${String(s).length===dt+1?0:"inherit"};">${ht}</span>`).join("");return}if(makeElementPlainTextContentEditable(ut),ut.tabIndex=nt||0,ut.innerText=_==="designer"?s:ft,ut.addEventListener("blur",ht=>{_e&&_e({key:"content",value:lt(ht.target)}),tt&&tt()}),$.dynamicFontSize){let ht;const dt=(ot==null?void 0:ot.font)||getDefaultFont(),gt=await getFontKitFont($.fontName,dt,rt);ut.addEventListener("keyup",()=>{setTimeout(()=>{(async()=>{if(!ut.textContent)return;ht=await calculateDynamicFontSize({textSchema:$,font:dt,value:lt(ut),startingFontSize:ht,_cache:rt}),ut.style.fontSize=`${ht}pt`;const{topAdj:pt,bottomAdj:mt}=getBrowserVerticalFontAdjustments(gt,ht??$.fontSize??DEFAULT_FONT_SIZE,$.lineHeight??DEFAULT_LINE_HEIGHT,$.verticalAlignment??DEFAULT_VERTICAL_ALIGNMENT);ut.style.paddingTop=`${pt}px`,ut.style.marginBottom=`${mt}px`})()},0)})}st&&(ut.style.color=PLACEHOLDER_FONT_COLOR,ut.addEventListener("focus",()=>{ut.innerText===at&&(ut.innerText="",ut.style.color=$.fontColor??DEFAULT_FONT_COLOR)})),_==="designer"&&setTimeout(()=>{ut.focus();const ht=window.getSelection(),dt=document.createRange();ht&&dt&&(dt.selectNodeContents(ut),dt.collapse(!1),ht==null||ht.removeAllRanges(),ht==null||ht.addRange(dt))})},buildStyledTextContainer=async(a,s)=>{const{schema:$,rootElement:_,mode:_e,options:tt,_cache:nt}=a,at=(tt==null?void 0:tt.font)||getDefaultFont();let ot;$.dynamicFontSize&&s&&(ot=await calculateDynamicFontSize({textSchema:$,font:at,value:s,startingFontSize:ot,_cache:nt}));const rt=await getFontKitFont($.fontName,at,nt),{topAdj:st,bottomAdj:lt}=getBrowserVerticalFontAdjustments(rt,ot??$.fontSize??DEFAULT_FONT_SIZE,$.lineHeight??DEFAULT_LINE_HEIGHT,$.verticalAlignment??DEFAULT_VERTICAL_ALIGNMENT),et=st.toString(),it=lt.toString(),ut=document.createElement("div"),ft={padding:0,resize:"none",backgroundColor:getBackgroundColor(s,$),border:"none",display:"flex",flexDirection:"column",justifyContent:mapVerticalAlignToFlex($.verticalAlignment),width:"100%",height:"100%",cursor:isEditable(_e,$)?"text":"default"};Object.assign(ut.style,ft),_.innerHTML="",_.appendChild(ut);const ht=[];$.strikethrough&&ht.push("line-through"),$.underline&&ht.push("underline");const dt={fontFamily:$.fontName?`'${$.fontName}'`:"inherit",color:$.fontColor?$.fontColor:DEFAULT_FONT_COLOR,fontSize:`${ot??$.fontSize??DEFAULT_FONT_SIZE}pt`,letterSpacing:`${$.characterSpacing??DEFAULT_CHARACTER_SPACING}pt`,lineHeight:`${$.lineHeight??DEFAULT_LINE_HEIGHT}em`,textAlign:$.alignment??DEFAULT_ALIGNMENT,whiteSpace:"pre-wrap",wordBreak:"break-word",resize:"none",border:"none",outline:"none",marginBottom:`${it}px`,paddingTop:`${et}px`,backgroundColor:"transparent",textDecoration:ht.join(" ")},gt=document.createElement("div");return gt.id="text-"+$.id,Object.assign(gt.style,dt),ut.appendChild(gt),gt},makeElementPlainTextContentEditable=a=>{if(!isFirefox()){a.contentEditable="plaintext-only";return}a.contentEditable="true",a.addEventListener("keydown",s=>{s.key==="Enter"&&!s.shiftKey&&(s.preventDefault(),document.execCommand("insertLineBreak",!1,void 0))}),a.addEventListener("paste",s=>{var _e;s.preventDefault();const $=(_e=s.clipboardData)==null?void 0:_e.getData("text"),_=window.getSelection();_!=null&&_.rangeCount&&(_.deleteFromDocument(),_.getRangeAt(0).insertNode(document.createTextNode($||"")),_.collapseToEnd())})},mapVerticalAlignToFlex=a=>{switch(a){case VERTICAL_ALIGN_TOP:return"flex-start";case VERTICAL_ALIGN_MIDDLE:return"center";case VERTICAL_ALIGN_BOTTOM:return"flex-end"}return"flex-start"},getBackgroundColor=(a,s)=>!a||!s.backgroundColor?"transparent":s.backgroundColor,textSchema={pdf:pdfRender,ui:uiRender,propPanel,icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-text-cursor-input"><path d="M5 4h1a3 3 0 0 1 3 3 3 3 0 0 1 3-3h1"/><path d="M13 20h-1a3 3 0 0 1-3-3 3 3 0 0 1-3 3H5"/><path d="M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1"/><path d="M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7"/><path d="M9 7v10"/></svg>'},text=textSchema;textSchema.pdf,textSchema.ui,{...textSchema.propPanel,defaultSchema:{...textSchema.propPanel.defaultSchema}};const getBody$1=a=>typeof a=="string"?JSON.parse(a||"[]"):a||[],getBodyWithRange=(a,s)=>{const $=getBody$1(a);return s?$.slice(s.start,s.end):$};let Cell$2=class{constructor(s,$,_){Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"styles",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"section",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contentHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"contentWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"wrappedWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"minReadableWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"minWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:0}),this.styles=$,this.section=_,this.raw=s;const _e=/\r\n|\r|\n/g;this.text=s.split(_e)}getContentHeight(){const s=Array.isArray(this.text)?this.text.length:1,$=pt2mm(this.styles.fontSize)*this.styles.lineHeight,_=this.padding("top")+this.padding("bottom"),_e=s*$+_;return Math.max(_e,this.styles.minCellHeight)}padding(s){return this.styles.cellPadding[s]}},Column$2=class{constructor(s){Object.defineProperty(this,"index",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"wrappedWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"minReadableWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"minWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:0}),this.index=s}getMaxCustomCellWidth(s){let $=0;for(const _ of s.allRows()){const _e=_.cells[this.index];$=Math.max($,_e.styles.cellWidth)}return $}},Row$2=class{constructor(s,$,_,_e){Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"index",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"section",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cells",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:0}),this.raw=s,this.index=$,this.section=_,this.cells=_e}getMaxCellHeight(s){return s.reduce(($,_)=>{var _e;return Math.max($,((_e=this.cells[_.index])==null?void 0:_e.height)||0)},0)}getMinimumRowHeight(s){return s.reduce(($,_)=>{const _e=this.cells[_.index];if(!_e)return 0;const nt=_e.padding("top")+_e.padding("bottom")+_e.styles.lineHeight;return nt>$?nt:$},0)}},Table$3=class ou{constructor(s,$){Object.defineProperty(this,"settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"styles",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"columns",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"head",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.settings=s.settings,this.styles=s.styles,this.columns=$.columns,this.head=$.head,this.body=$.body}static async create(s){const{input:$,content:_,font:_e,_cache:tt}=s,nt=new ou($,_);return await calculateWidths({table:nt,font:_e,_cache:tt}),nt}getHeadHeight(){return this.head.reduce((s,$)=>s+$.getMaxCellHeight(this.columns),0)}getBodyHeight(){return this.body.reduce((s,$)=>s+$.getMaxCellHeight(this.columns),0)}allRows(){return this.head.concat(this.body)}getWidth(){return this.settings.tableWidth}getHeight(){return(this.settings.showHead?this.getHeadHeight():0)+this.getBodyHeight()}};async function calculateWidths(a){const{table:s,font:$,_cache:_}=a,_e=ot=>getFontKitFont(ot,$,_);await calculate$1(s,_e);const tt=[];let nt=0;s.columns.forEach(ot=>{const rt=ot.getMaxCustomCellWidth(s);rt?ot.width=rt:(ot.width=ot.wrappedWidth,tt.push(ot)),nt+=ot.width});let at=s.getWidth()-nt;at&&(at=resizeColumns(tt,at,ot=>Math.max(ot.minReadableWidth,ot.minWidth))),at&&(at=resizeColumns(tt,at,ot=>ot.minWidth)),at=Math.abs(at),applyColSpans(s),await fitContent(s,_e),applyRowSpans(s)}function applyRowSpans(a){const s={};let $=1;const _=a.allRows();for(let _e=0;_e<_.length;_e++){const tt=_[_e];for(const nt of a.columns){const at=s[nt.index];if($>1)$--,delete tt.cells[nt.index];else if(at)at.cell.height+=tt.height,$=1,delete tt.cells[nt.index],at.left--,at.left<=1&&delete s[nt.index];else{const ot=tt.cells[nt.index];if(!ot)continue;ot.height=tt.height}}}}function applyColSpans(a){const s=a.allRows();for(let $=0;$<s.length;$++){const _=s[$];let _e=0,tt=0;for(let nt=0;nt<a.columns.length;nt++){const at=a.columns[nt];if(tt-=1,tt>1&&a.columns[nt+1])_e+=at.width,delete _.cells[at.index];else{const ot=_.cells[at.index];if(!ot)continue;tt=1,_e=0,ot.width=at.width+_e}}}}async function fitContent(a,s){const $={count:0,height:0};for(const _ of a.allRows()){for(const _e of a.columns){const tt=_.cells[_e.index];if(!tt)continue;const nt=await s(tt.styles.fontName);tt.text=splitTextToSize({value:tt.raw,characterSpacing:tt.styles.characterSpacing,boxWidthInPt:mm2pt(tt.width),fontSize:tt.styles.fontSize,fontKitFont:nt}),tt.contentHeight=tt.getContentHeight();let at=tt.contentHeight;$&&$.count>0&&$.height>at&&(at=$.height),at>_.height&&(_.height=at)}$.count--}}function resizeColumns(a,s,$){const _=s,_e=a.reduce((tt,nt)=>tt+nt.wrappedWidth,0);for(let tt=0;tt<a.length;tt++){const nt=a[tt],at=nt.wrappedWidth/_e,ot=_*at,rt=nt.width+ot,st=$(nt),lt=rt<st?st:rt;s-=lt-nt.width,nt.width=lt}if(s=Math.round(s*1e10)/1e10,s){const tt=a.filter(nt=>s<0?nt.width>$(nt):!0);tt.length&&(s=resizeColumns(tt,s,$))}return s}async function calculate$1(a,s){for(const $ of a.allRows())for(const _ of a.columns){const _e=$.cells[_.index];if(!_e)continue;const tt=_e.padding("right")+_e.padding("left"),nt=await s(_e.styles.fontName);_e.contentWidth=getStringWidth(_e,nt)+tt;const at=getStringWidth(Object.assign(_e,{text:_e.text.join(" ").split(/\s+/)}),nt);_e.minReadableWidth=at+tt,_e.minWidth=_e.styles.cellWidth,_e.wrappedWidth=_e.styles.cellWidth}for(const $ of a.allRows())for(const _ of a.columns){const _e=$.cells[_.index];if(_e)_.wrappedWidth=Math.max(_.wrappedWidth,_e.wrappedWidth),_.minWidth=Math.max(_.minWidth,_e.minWidth),_.minReadableWidth=Math.max(_.minReadableWidth,_e.minReadableWidth);else{const tt=a.styles.columnStyles[_.index]||{},nt=tt.cellWidth||tt.minCellWidth;nt&&(_.minWidth=nt,_.wrappedWidth=nt)}}}function getStringWidth(a,s){const $=a.text,_=Array.isArray($)?$:[$],_e=a.styles.fontSize,tt=a.styles.characterSpacing;return _.map(at=>widthOfTextAtSize(at,s,_e,tt)).reduce((at,ot)=>Math.max(at,ot),0)}function parseSection(a,s,$,_,_e){const tt={};return s.map((at,ot)=>{let rt=0;const st={};let lt=0,et=0;for(const it of $)if(tt[it.index]==null||tt[it.index].left===0)if(et===0){let ut;Array.isArray(at)?ut=at[it.index-lt-rt]:ut=at[it.index];const ft=cellStyles(a,it,ot,_,_e),ht=new Cell$2(ut,ft,a);st[it.index]=ht,et=0,tt[it.index]={left:0,times:et}}else et--,lt++;else tt[it.index].left--,et=tt[it.index].times,rt++;return new Row$2(at,ot,a,st)})}function parseContent4Table(a,s){const $=a.content,_=$.columns.map(tt=>new Column$2(tt)),_e=a.styles;return{columns:_,head:parseSection("head",$.head,_,_e,s),body:parseSection("body",$.body,_,_e,s)}}function cellStyles(a,s,$,_,_e){let tt;a==="head"?tt=_.headStyles:a==="body"&&(tt=_.bodyStyles);const nt=Object.assign({},_.styles,tt),at=_.columnStyles[s.index]||_.columnStyles[s.index]||{},ot=a==="body"&&$%2===0?Object.assign({},_.alternateRowStyles):{};return Object.assign({fontName:_e,backgroundColor:"",textColor:"#000000",lineHeight:1,characterSpacing:0,alignment:"left",verticalAlignment:"middle",fontSize:10,cellPadding:5,lineColor:"#000000",lineWidth:0,minCellHeight:0,minCellWidth:0},nt,ot,at)}function mapCellStyle(a){return{fontName:a.fontName,alignment:a.alignment,verticalAlignment:a.verticalAlignment,fontSize:a.fontSize,lineHeight:a.lineHeight,characterSpacing:a.characterSpacing,backgroundColor:a.backgroundColor,textColor:a.fontColor,lineColor:a.borderColor,lineWidth:a.borderWidth,cellPadding:a.padding}}function getTableOptions(a,s){const $=a.headWidthPercentages.reduce((nt,at,ot)=>({...nt,[ot]:{cellWidth:a.width*(at/100)}}),{}),_=Object.entries(a.columnStyles.alignment||{}).reduce((nt,[at,ot])=>({...nt,[at]:{alignment:ot}}),{}),_e=new Set([...Object.keys($).map(Number),...Object.keys(_).map(Number)]),tt=Array.from(_e).reduce((nt,at)=>{const ot=$[at]||{},rt=_[at]||{};return{...nt,[at]:{...ot,...rt}}},{});return{head:[a.head],body:s,showHead:a.showHead,startY:a.position.y,tableWidth:a.width,tableLineColor:a.tableStyles.borderColor,tableLineWidth:a.tableStyles.borderWidth,headStyles:mapCellStyle(a.headStyles),bodyStyles:mapCellStyle(a.bodyStyles),alternateRowStyles:{backgroundColor:a.bodyStyles.alternateBackgroundColor},columnStyles:tt,margin:{top:0,right:0,left:a.position.x,bottom:0}}}function parseStyles(a){const s={styles:{},headStyles:{},bodyStyles:{},alternateRowStyles:{},columnStyles:{}};for(const $ of Object.keys(s))if($==="columnStyles"){const _=a[$];s.columnStyles=Object.assign({},_)}else{const _e=[a].map(tt=>tt[$]||{});s[$]=Object.assign({},_e[0],_e[1],_e[2])}return s}function parseContent4Input(a){const s=a.head||[],$=a.body||[];return{columns:(s[0]||$[0]||[]).map((_e,tt)=>tt),head:s,body:$}}function parseInput(a,s){const $=getTableOptions(a,s),_=parseStyles($),_e={startY:$.startY,margin:$.margin,tableWidth:$.tableWidth,showHead:$.showHead,tableLineWidth:$.tableLineWidth??0,tableLineColor:$.tableLineColor??""};return{content:parseContent4Input($),styles:_,settings:_e}}function createSingleTable(a,s){const{options:$,_cache:_,basePdf:_e}=s;if(!isBlankPdf(_e))throw new Error("[@pdfme/schema/table] Custom PDF is not supported");const tt=cloneDeep$1(s.schema),{start:nt}=tt.__bodyRange||{start:0};if(nt%2===1){const lt=tt.bodyStyles.alternateBackgroundColor;tt.bodyStyles.alternateBackgroundColor=tt.bodyStyles.backgroundColor,tt.bodyStyles.backgroundColor=lt}tt.showHead=tt.showHead===!1?!1:nt===0;const at=parseInput(tt,a),ot=$.font||getDefaultFont(),rt=getFallbackFontName(ot),st=parseContent4Table(at,rt);return Table$3.create({input:at,content:st,font:ot,_cache:_})}const getDynamicHeightsForTable=async(a,s)=>{var tt;if(s.schema.type!=="table")return Promise.resolve([s.schema.height]);const $=s.schema,_=((tt=$.__bodyRange)==null?void 0:tt.start)===0?getBody$1(a):getBodyWithRange(a,$.__bodyRange);return(await createSingleTable(_,s)).allRows().map(nt=>nt.height)},builtInPlugins={Text:text};class BaseUIClass{constructor(s){this.lang=DEFAULT_LANG,this.font=getDefaultFont(),this.pluginsRegistry=builtInPlugins,this.options={},this.setSize=debounce$1(()=>{if(!this.domContainer)throw Error(DESTROYED_ERR_MSG);this.size={height:this.domContainer.clientHeight||window.innerHeight,width:this.domContainer.clientWidth||window.innerWidth},this.render()},100),this.resizeObserver=new ResizeObserver(this.setSize),checkUIProps(s);const{domContainer:$,template:_,options:_e={},plugins:tt={}}=s;this.domContainer=$,this.template=cloneDeep$1(_),this.options=_e,this.size={height:this.domContainer.clientHeight||window.innerHeight,width:this.domContainer.clientWidth||window.innerWidth},this.resizeObserver.observe(this.domContainer);const{lang:nt,font:at}=_e;nt&&(this.lang=nt),at&&(this.font=at),Object.values(tt).length>0&&(this.pluginsRegistry=tt)}getLang(){return this.lang}getFont(){return this.font}getPluginsRegistry(){return this.pluginsRegistry}getOptions(){return this.options}getTemplate(){if(!this.domContainer)throw Error(DESTROYED_ERR_MSG);return this.template}updateTemplate(s){if(checkTemplate(s),!this.domContainer)throw Error(DESTROYED_ERR_MSG);this.template=cloneDeep$1(s),this.render()}updateOptions(s){checkUIOptions(s);const{lang:$,font:_}=s||{};$&&(this.lang=$),_&&(this.font=_),this.options=Object.assign(this.options,s),this.render()}destroy(){if(!this.domContainer)throw Error(DESTROYED_ERR_MSG);ReactDOM.unmountComponentAtNode(this.domContainer),this.resizeObserver.unobserve(this.domContainer),this.domContainer=null}}class PreviewUI extends BaseUIClass{constructor(s){super(s),checkPreviewProps(s),this.inputs=convertToStingObjectArray(cloneDeep$1(s.inputs))}getInputs(){if(!this.domContainer)throw Error(DESTROYED_ERR_MSG);return this.inputs}setInputs(s){if(!this.domContainer)throw Error(DESTROYED_ERR_MSG);checkInputs(s),this.inputs=convertToStingObjectArray(s),this.render()}}function convertToStingObjectArray(a){return a.map(s=>{const $={};return Object.keys(s).forEach(_=>{const _e=s[_];Array.isArray(_e)?$[_]=JSON.stringify(_e):$[_]=_e}),$})}function useCombinedRefs(){for(var a=arguments.length,s=new Array(a),$=0;$<a;$++)s[$]=arguments[$];return reactExports.useMemo(()=>_=>{s.forEach(_e=>_e(_))},s)}const canUseDOM=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function isWindow$4(a){const s=Object.prototype.toString.call(a);return s==="[object Window]"||s==="[object global]"}function isNode$1(a){return"nodeType"in a}function getWindow$1(a){var s,$;return a?isWindow$4(a)?a:isNode$1(a)&&(s=($=a.ownerDocument)==null?void 0:$.defaultView)!=null?s:window:window}function isDocument(a){const{Document:s}=getWindow$1(a);return a instanceof s}function isHTMLElement(a){return isWindow$4(a)?!1:a instanceof getWindow$1(a).HTMLElement}function isSVGElement(a){return a instanceof getWindow$1(a).SVGElement}function getOwnerDocument(a){return a?isWindow$4(a)?a.document:isNode$1(a)?isDocument(a)?a:isHTMLElement(a)||isSVGElement(a)?a.ownerDocument:document:document:document}const useIsomorphicLayoutEffect$1=canUseDOM?reactExports.useLayoutEffect:reactExports.useEffect;function useEvent$1(a){const s=reactExports.useRef(a);return useIsomorphicLayoutEffect$1(()=>{s.current=a}),reactExports.useCallback(function(){for(var $=arguments.length,_=new Array($),_e=0;_e<$;_e++)_[_e]=arguments[_e];return s.current==null?void 0:s.current(..._)},[])}function useInterval(){const a=reactExports.useRef(null),s=reactExports.useCallback((_,_e)=>{a.current=setInterval(_,_e)},[]),$=reactExports.useCallback(()=>{a.current!==null&&(clearInterval(a.current),a.current=null)},[]);return[s,$]}function useLatestValue(a,s){s===void 0&&(s=[a]);const $=reactExports.useRef(a);return useIsomorphicLayoutEffect$1(()=>{$.current!==a&&($.current=a)},s),$}function useLazyMemo(a,s){const $=reactExports.useRef();return reactExports.useMemo(()=>{const _=a($.current);return $.current=_,_},[...s])}function useNodeRef(a){const s=useEvent$1(a),$=reactExports.useRef(null),_=reactExports.useCallback(_e=>{_e!==$.current&&(s==null||s(_e,$.current)),$.current=_e},[]);return[$,_]}function usePrevious$1(a){const s=reactExports.useRef();return reactExports.useEffect(()=>{s.current=a},[a]),s.current}let ids={};function useUniqueId(a,s){return reactExports.useMemo(()=>{if(s)return s;const $=ids[a]==null?0:ids[a]+1;return ids[a]=$,a+"-"+$},[a,s])}function createAdjustmentFn(a){return function(s){for(var $=arguments.length,_=new Array($>1?$-1:0),_e=1;_e<$;_e++)_[_e-1]=arguments[_e];return _.reduce((tt,nt)=>{const at=Object.entries(nt);for(const[ot,rt]of at){const st=tt[ot];st!=null&&(tt[ot]=st+a*rt)}return tt},{...s})}}const add$1=createAdjustmentFn(1),subtract=createAdjustmentFn(-1);function hasViewportRelativeCoordinates(a){return"clientX"in a&&"clientY"in a}function isKeyboardEvent(a){if(!a)return!1;const{KeyboardEvent:s}=getWindow$1(a.target);return s&&a instanceof s}function isTouchEvent(a){if(!a)return!1;const{TouchEvent:s}=getWindow$1(a.target);return s&&a instanceof s}function getEventCoordinates(a){if(isTouchEvent(a)){if(a.touches&&a.touches.length){const{clientX:s,clientY:$}=a.touches[0];return{x:s,y:$}}else if(a.changedTouches&&a.changedTouches.length){const{clientX:s,clientY:$}=a.changedTouches[0];return{x:s,y:$}}}return hasViewportRelativeCoordinates(a)?{x:a.clientX,y:a.clientY}:null}const CSS$1=Object.freeze({Translate:{toString(a){if(!a)return;const{x:s,y:$}=a;return"translate3d("+(s?Math.round(s):0)+"px, "+($?Math.round($):0)+"px, 0)"}},Scale:{toString(a){if(!a)return;const{scaleX:s,scaleY:$}=a;return"scaleX("+s+") scaleY("+$+")"}},Transform:{toString(a){if(a)return[CSS$1.Translate.toString(a),CSS$1.Scale.toString(a)].join(" ")}},Transition:{toString(a){let{property:s,duration:$,easing:_}=a;return s+" "+$+"ms "+_}}}),SELECTOR="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function findFirstFocusableNode(a){return a.matches(SELECTOR)?a:a.querySelector(SELECTOR)}const hiddenStyles={display:"none"};function HiddenText(a){let{id:s,value:$}=a;return React$a.createElement("div",{id:s,style:hiddenStyles},$)}function LiveRegion(a){let{id:s,announcement:$,ariaLiveType:_="assertive"}=a;const _e={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return React$a.createElement("div",{id:s,style:_e,role:"status","aria-live":_,"aria-atomic":!0},$)}function useAnnouncement(){const[a,s]=reactExports.useState("");return{announce:reactExports.useCallback(_=>{_!=null&&s(_)},[]),announcement:a}}const DndMonitorContext=reactExports.createContext(null);function useDndMonitor(a){const s=reactExports.useContext(DndMonitorContext);reactExports.useEffect(()=>{if(!s)throw new Error("useDndMonitor must be used within a children of <DndContext>");return s(a)},[a,s])}function useDndMonitorProvider(){const[a]=reactExports.useState(()=>new Set),s=reactExports.useCallback(_=>(a.add(_),()=>a.delete(_)),[a]);return[reactExports.useCallback(_=>{let{type:_e,event:tt}=_;a.forEach(nt=>{var at;return(at=nt[_e])==null?void 0:at.call(nt,tt)})},[a]),s]}const defaultScreenReaderInstructions={draggable:`
|
129
|
+
`)&&(dt=dt.slice(0,-1)),dt},et=(ot==null?void 0:ot.font)||getDefaultFont(),[it,ut]=await Promise.all([getFontKitFont($.fontName,et,rt),buildStyledTextContainer(a,st?at:s)]),ft=replaceUnsupportedChars(s,it);if(!isEditable(_,$)){ut.innerHTML=ft.split("").map((ht,dt)=>`<span style="letter-spacing:${String(s).length===dt+1?0:"inherit"};">${ht}</span>`).join("");return}if(makeElementPlainTextContentEditable(ut),ut.tabIndex=nt||0,ut.innerText=_==="designer"?s:ft,ut.addEventListener("blur",ht=>{_e&&_e({key:"content",value:lt(ht.target)}),tt&&tt()}),$.dynamicFontSize){let ht;const dt=(ot==null?void 0:ot.font)||getDefaultFont(),gt=await getFontKitFont($.fontName,dt,rt);ut.addEventListener("keyup",()=>{setTimeout(()=>{(async()=>{if(!ut.textContent)return;ht=await calculateDynamicFontSize({textSchema:$,font:dt,value:lt(ut),startingFontSize:ht,_cache:rt}),ut.style.fontSize=`${ht}pt`;const{topAdj:pt,bottomAdj:mt}=getBrowserVerticalFontAdjustments(gt,ht??$.fontSize??DEFAULT_FONT_SIZE,$.lineHeight??DEFAULT_LINE_HEIGHT,$.verticalAlignment??DEFAULT_VERTICAL_ALIGNMENT);ut.style.paddingTop=`${pt}px`,ut.style.marginBottom=`${mt}px`})()},0)})}st&&(ut.style.color=PLACEHOLDER_FONT_COLOR,ut.addEventListener("focus",()=>{ut.innerText===at&&(ut.innerText="",ut.style.color=$.fontColor??DEFAULT_FONT_COLOR)})),_==="designer"&&setTimeout(()=>{ut.focus();const ht=window.getSelection(),dt=document.createRange();ht&&dt&&(dt.selectNodeContents(ut),dt.collapse(!1),ht==null||ht.removeAllRanges(),ht==null||ht.addRange(dt))})},buildStyledTextContainer=async(a,s)=>{const{schema:$,rootElement:_,mode:_e,options:tt,_cache:nt}=a,at=(tt==null?void 0:tt.font)||getDefaultFont();let ot;$.dynamicFontSize&&s&&(ot=await calculateDynamicFontSize({textSchema:$,font:at,value:s,startingFontSize:ot,_cache:nt}));const rt=await getFontKitFont($.fontName,at,nt),{topAdj:st,bottomAdj:lt}=getBrowserVerticalFontAdjustments(rt,ot??$.fontSize??DEFAULT_FONT_SIZE,$.lineHeight??DEFAULT_LINE_HEIGHT,$.verticalAlignment??DEFAULT_VERTICAL_ALIGNMENT),et=st.toString(),it=lt.toString(),ut=document.createElement("div"),ft={padding:0,resize:"none",backgroundColor:getBackgroundColor(s,$),border:"none",display:"flex",flexDirection:"column",justifyContent:mapVerticalAlignToFlex($.verticalAlignment),width:"100%",height:"100%",cursor:isEditable(_e,$)?"text":"default"};Object.assign(ut.style,ft),_.innerHTML="",_.appendChild(ut);const ht=[];$.strikethrough&&ht.push("line-through"),$.underline&&ht.push("underline");const dt={fontFamily:$.fontName?`'${$.fontName}'`:"inherit",color:$.fontColor?$.fontColor:DEFAULT_FONT_COLOR,fontSize:`${ot??$.fontSize??DEFAULT_FONT_SIZE}pt`,letterSpacing:`${$.characterSpacing??DEFAULT_CHARACTER_SPACING}pt`,lineHeight:`${$.lineHeight??DEFAULT_LINE_HEIGHT}em`,textAlign:$.alignment??DEFAULT_ALIGNMENT,whiteSpace:"pre-wrap",wordBreak:"break-word",resize:"none",border:"none",outline:"none",marginBottom:`${it}px`,paddingTop:`${et}px`,backgroundColor:"transparent",textDecoration:ht.join(" ")},gt=document.createElement("div");return gt.id="text-"+$.id,Object.assign(gt.style,dt),ut.appendChild(gt),gt},makeElementPlainTextContentEditable=a=>{if(!isFirefox()){a.contentEditable="plaintext-only";return}a.contentEditable="true",a.addEventListener("keydown",s=>{s.key==="Enter"&&!s.shiftKey&&(s.preventDefault(),document.execCommand("insertLineBreak",!1,void 0))}),a.addEventListener("paste",s=>{var _e;s.preventDefault();const $=(_e=s.clipboardData)==null?void 0:_e.getData("text"),_=window.getSelection();_!=null&&_.rangeCount&&(_.deleteFromDocument(),_.getRangeAt(0).insertNode(document.createTextNode($||"")),_.collapseToEnd())})},mapVerticalAlignToFlex=a=>{switch(a){case VERTICAL_ALIGN_TOP:return"flex-start";case VERTICAL_ALIGN_MIDDLE:return"center";case VERTICAL_ALIGN_BOTTOM:return"flex-end"}return"flex-start"},getBackgroundColor=(a,s)=>!a||!s.backgroundColor?"transparent":s.backgroundColor,textSchema={pdf:pdfRender,ui:uiRender,propPanel,icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-text-cursor-input"><path d="M5 4h1a3 3 0 0 1 3 3 3 3 0 0 1 3-3h1"/><path d="M13 20h-1a3 3 0 0 1-3-3 3 3 0 0 1-3 3H5"/><path d="M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1"/><path d="M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7"/><path d="M9 7v10"/></svg>'},text=textSchema;textSchema.pdf,textSchema.ui,{...textSchema.propPanel,defaultSchema:{...textSchema.propPanel.defaultSchema}};const getBody$1=a=>typeof a=="string"?JSON.parse(a||"[]"):a||[],getBodyWithRange=(a,s)=>{const $=getBody$1(a);return s?$.slice(s.start,s.end):$};let Cell$2=class{constructor(s,$,_){Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"styles",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"section",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contentHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"contentWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"wrappedWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"minReadableWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"minWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:0}),this.styles=$,this.section=_,this.raw=s;const _e=/\r\n|\r|\n/g;this.text=s.split(_e)}getContentHeight(){const s=Array.isArray(this.text)?this.text.length:1,$=pt2mm(this.styles.fontSize)*this.styles.lineHeight,_=this.padding("top")+this.padding("bottom"),_e=s*$+_;return Math.max(_e,this.styles.minCellHeight)}padding(s){return this.styles.cellPadding[s]}},Column$2=class{constructor(s){Object.defineProperty(this,"index",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"wrappedWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"minReadableWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"minWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:0}),this.index=s}getMaxCustomCellWidth(s){let $=0;for(const _ of s.allRows()){const _e=_.cells[this.index];$=Math.max($,_e.styles.cellWidth)}return $}},Row$2=class{constructor(s,$,_,_e){Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"index",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"section",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cells",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:0}),this.raw=s,this.index=$,this.section=_,this.cells=_e}getMaxCellHeight(s){return s.reduce(($,_)=>{var _e;return Math.max($,((_e=this.cells[_.index])==null?void 0:_e.height)||0)},0)}getMinimumRowHeight(s){return s.reduce(($,_)=>{const _e=this.cells[_.index];if(!_e)return 0;const nt=_e.padding("top")+_e.padding("bottom")+_e.styles.lineHeight;return nt>$?nt:$},0)}},Table$3=class ou{constructor(s,$){Object.defineProperty(this,"settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"styles",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"columns",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"head",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.settings=s.settings,this.styles=s.styles,this.columns=$.columns,this.head=$.head,this.body=$.body}static async create(s){const{input:$,content:_,font:_e,_cache:tt}=s,nt=new ou($,_);return await calculateWidths({table:nt,font:_e,_cache:tt}),nt}getHeadHeight(){return this.head.reduce((s,$)=>s+$.getMaxCellHeight(this.columns),0)}getBodyHeight(){return this.body.reduce((s,$)=>s+$.getMaxCellHeight(this.columns),0)}allRows(){return this.head.concat(this.body)}getWidth(){return this.settings.tableWidth}getHeight(){return(this.settings.showHead?this.getHeadHeight():0)+this.getBodyHeight()}};async function calculateWidths(a){const{table:s,font:$,_cache:_}=a,_e=ot=>getFontKitFont(ot,$,_);await calculate$1(s,_e);const tt=[];let nt=0;s.columns.forEach(ot=>{const rt=ot.getMaxCustomCellWidth(s);rt?ot.width=rt:(ot.width=ot.wrappedWidth,tt.push(ot)),nt+=ot.width});let at=s.getWidth()-nt;at&&(at=resizeColumns(tt,at,ot=>Math.max(ot.minReadableWidth,ot.minWidth))),at&&(at=resizeColumns(tt,at,ot=>ot.minWidth)),at=Math.abs(at),applyColSpans(s),await fitContent(s,_e),applyRowSpans(s)}function applyRowSpans(a){const s={};let $=1;const _=a.allRows();for(let _e=0;_e<_.length;_e++){const tt=_[_e];for(const nt of a.columns){const at=s[nt.index];if($>1)$--,delete tt.cells[nt.index];else if(at)at.cell.height+=tt.height,$=1,delete tt.cells[nt.index],at.left--,at.left<=1&&delete s[nt.index];else{const ot=tt.cells[nt.index];if(!ot)continue;ot.height=tt.height}}}}function applyColSpans(a){const s=a.allRows();for(let $=0;$<s.length;$++){const _=s[$];let _e=0,tt=0;for(let nt=0;nt<a.columns.length;nt++){const at=a.columns[nt];if(tt-=1,tt>1&&a.columns[nt+1])_e+=at.width,delete _.cells[at.index];else{const ot=_.cells[at.index];if(!ot)continue;tt=1,_e=0,ot.width=at.width+_e}}}}async function fitContent(a,s){const $={count:0,height:0};for(const _ of a.allRows()){for(const _e of a.columns){const tt=_.cells[_e.index];if(!tt)continue;const nt=await s(tt.styles.fontName);tt.text=splitTextToSize({value:tt.raw,characterSpacing:tt.styles.characterSpacing,boxWidthInPt:mm2pt(tt.width),fontSize:tt.styles.fontSize,fontKitFont:nt}),tt.contentHeight=tt.getContentHeight();let at=tt.contentHeight;$&&$.count>0&&$.height>at&&(at=$.height),at>_.height&&(_.height=at)}$.count--}}function resizeColumns(a,s,$){const _=s,_e=a.reduce((tt,nt)=>tt+nt.wrappedWidth,0);for(let tt=0;tt<a.length;tt++){const nt=a[tt],at=nt.wrappedWidth/_e,ot=_*at,rt=nt.width+ot,st=$(nt),lt=rt<st?st:rt;s-=lt-nt.width,nt.width=lt}if(s=Math.round(s*1e10)/1e10,s){const tt=a.filter(nt=>s<0?nt.width>$(nt):!0);tt.length&&(s=resizeColumns(tt,s,$))}return s}async function calculate$1(a,s){for(const $ of a.allRows())for(const _ of a.columns){const _e=$.cells[_.index];if(!_e)continue;const tt=_e.padding("right")+_e.padding("left"),nt=await s(_e.styles.fontName);_e.contentWidth=getStringWidth(_e,nt)+tt;const at=getStringWidth(Object.assign(_e,{text:_e.text.join(" ").split(/\s+/)}),nt);_e.minReadableWidth=at+tt,_e.minWidth=_e.styles.cellWidth,_e.wrappedWidth=_e.styles.cellWidth}for(const $ of a.allRows())for(const _ of a.columns){const _e=$.cells[_.index];if(_e)_.wrappedWidth=Math.max(_.wrappedWidth,_e.wrappedWidth),_.minWidth=Math.max(_.minWidth,_e.minWidth),_.minReadableWidth=Math.max(_.minReadableWidth,_e.minReadableWidth);else{const tt=a.styles.columnStyles[_.index]||{},nt=tt.cellWidth||tt.minCellWidth;nt&&(_.minWidth=nt,_.wrappedWidth=nt)}}}function getStringWidth(a,s){const $=a.text,_=Array.isArray($)?$:[$],_e=a.styles.fontSize,tt=a.styles.characterSpacing;return _.map(at=>widthOfTextAtSize(at,s,_e,tt)).reduce((at,ot)=>Math.max(at,ot),0)}function parseSection(a,s,$,_,_e){const tt={};return s.map((at,ot)=>{let rt=0;const st={};let lt=0,et=0;for(const it of $)if(tt[it.index]==null||tt[it.index].left===0)if(et===0){let ut;Array.isArray(at)?ut=at[it.index-lt-rt]:ut=at[it.index];const ft=cellStyles(a,it,ot,_,_e),ht=new Cell$2(ut,ft,a);st[it.index]=ht,et=0,tt[it.index]={left:0,times:et}}else et--,lt++;else tt[it.index].left--,et=tt[it.index].times,rt++;return new Row$2(at,ot,a,st)})}function parseContent4Table(a,s){const $=a.content,_=$.columns.map(tt=>new Column$2(tt)),_e=a.styles;return{columns:_,head:parseSection("head",$.head,_,_e,s),body:parseSection("body",$.body,_,_e,s)}}function cellStyles(a,s,$,_,_e){let tt;a==="head"?tt=_.headStyles:a==="body"&&(tt=_.bodyStyles);const nt=Object.assign({},_.styles,tt),at=_.columnStyles[s.index]||_.columnStyles[s.index]||{},ot=a==="body"&&$%2===0?Object.assign({},_.alternateRowStyles):{};return Object.assign({fontName:_e,backgroundColor:"",textColor:"#000000",lineHeight:1,characterSpacing:0,alignment:"left",verticalAlignment:"middle",fontSize:10,cellPadding:5,lineColor:"#000000",lineWidth:0,minCellHeight:0,minCellWidth:0},nt,ot,at)}function mapCellStyle(a){return{fontName:a.fontName,alignment:a.alignment,verticalAlignment:a.verticalAlignment,fontSize:a.fontSize,lineHeight:a.lineHeight,characterSpacing:a.characterSpacing,backgroundColor:a.backgroundColor,textColor:a.fontColor,lineColor:a.borderColor,lineWidth:a.borderWidth,cellPadding:a.padding}}function getTableOptions(a,s){const $=a.headWidthPercentages.reduce((nt,at,ot)=>({...nt,[ot]:{cellWidth:a.width*(at/100)}}),{}),_=Object.entries(a.columnStyles.alignment||{}).reduce((nt,[at,ot])=>({...nt,[at]:{alignment:ot}}),{}),_e=new Set([...Object.keys($).map(Number),...Object.keys(_).map(Number)]),tt=Array.from(_e).reduce((nt,at)=>{const ot=$[at]||{},rt=_[at]||{};return{...nt,[at]:{...ot,...rt}}},{});return{head:[a.head],body:s,showHead:a.showHead,startY:a.position.y,tableWidth:a.width,tableLineColor:a.tableStyles.borderColor,tableLineWidth:a.tableStyles.borderWidth,headStyles:mapCellStyle(a.headStyles),bodyStyles:mapCellStyle(a.bodyStyles),alternateRowStyles:{backgroundColor:a.bodyStyles.alternateBackgroundColor},columnStyles:tt,margin:{top:0,right:0,left:a.position.x,bottom:0}}}function parseStyles(a){const s={styles:{},headStyles:{},bodyStyles:{},alternateRowStyles:{},columnStyles:{}};for(const $ of Object.keys(s))if($==="columnStyles"){const _=a[$];s.columnStyles=Object.assign({},_)}else{const _e=[a].map(tt=>tt[$]||{});s[$]=Object.assign({},_e[0],_e[1],_e[2])}return s}function parseContent4Input(a){const s=a.head||[],$=a.body||[];return{columns:(s[0]||$[0]||[]).map((_e,tt)=>tt),head:s,body:$}}function parseInput(a,s){const $=getTableOptions(a,s),_=parseStyles($),_e={startY:$.startY,margin:$.margin,tableWidth:$.tableWidth,showHead:$.showHead,tableLineWidth:$.tableLineWidth??0,tableLineColor:$.tableLineColor??""};return{content:parseContent4Input($),styles:_,settings:_e}}function createSingleTable(a,s){const{options:$,_cache:_,basePdf:_e}=s;isBlankPdf(_e)||console.warn(`[@pdfme/schema/table]When specifying a custom PDF for basePdf, you cannot use features such as page breaks or re-layout of other elements.To utilize these features, please define basePdf as follows:
|
130
|
+
{ width: number; height: number; padding: [number, number, number, number]; }`);const tt=cloneDeep$1(s.schema),{start:nt}=tt.__bodyRange||{start:0};if(nt%2===1){const lt=tt.bodyStyles.alternateBackgroundColor;tt.bodyStyles.alternateBackgroundColor=tt.bodyStyles.backgroundColor,tt.bodyStyles.backgroundColor=lt}tt.showHead=tt.showHead===!1?!1:!tt.__isSplit;const at=parseInput(tt,a),ot=$.font||getDefaultFont(),rt=getFallbackFontName(ot),st=parseContent4Table(at,rt);return Table$3.create({input:at,content:st,font:ot,_cache:_})}const getDynamicHeightsForTable=async(a,s)=>{var tt;if(s.schema.type!=="table")return Promise.resolve([s.schema.height]);const $=s.schema,_=((tt=$.__bodyRange)==null?void 0:tt.start)===0?getBody$1(a):getBodyWithRange(a,$.__bodyRange);return(await createSingleTable(_,s)).allRows().map(nt=>nt.height)},builtInPlugins={Text:text};class BaseUIClass{constructor(s){this.lang=DEFAULT_LANG,this.font=getDefaultFont(),this.pluginsRegistry=builtInPlugins,this.options={},this.setSize=debounce$1(()=>{if(!this.domContainer)throw Error(DESTROYED_ERR_MSG);this.size={height:this.domContainer.clientHeight||window.innerHeight,width:this.domContainer.clientWidth||window.innerWidth},this.render()},100),this.resizeObserver=new ResizeObserver(this.setSize),checkUIProps(s);const{domContainer:$,template:_,options:_e={},plugins:tt={}}=s;this.domContainer=$,this.template=cloneDeep$1(_),this.options=_e,this.size={height:this.domContainer.clientHeight||window.innerHeight,width:this.domContainer.clientWidth||window.innerWidth},this.resizeObserver.observe(this.domContainer);const{lang:nt,font:at}=_e;nt&&(this.lang=nt),at&&(this.font=at),Object.values(tt).length>0&&(this.pluginsRegistry=tt)}getLang(){return this.lang}getFont(){return this.font}getPluginsRegistry(){return this.pluginsRegistry}getOptions(){return this.options}getTemplate(){if(!this.domContainer)throw Error(DESTROYED_ERR_MSG);return this.template}updateTemplate(s){if(checkTemplate(s),!this.domContainer)throw Error(DESTROYED_ERR_MSG);this.template=cloneDeep$1(s),this.render()}updateOptions(s){checkUIOptions(s);const{lang:$,font:_}=s||{};$&&(this.lang=$),_&&(this.font=_),this.options=Object.assign(this.options,s),this.render()}destroy(){if(!this.domContainer)throw Error(DESTROYED_ERR_MSG);ReactDOM.unmountComponentAtNode(this.domContainer),this.resizeObserver.unobserve(this.domContainer),this.domContainer=null}}class PreviewUI extends BaseUIClass{constructor(s){super(s),checkPreviewProps(s),this.inputs=convertToStingObjectArray(cloneDeep$1(s.inputs))}getInputs(){if(!this.domContainer)throw Error(DESTROYED_ERR_MSG);return this.inputs}setInputs(s){if(!this.domContainer)throw Error(DESTROYED_ERR_MSG);checkInputs(s),this.inputs=convertToStingObjectArray(s),this.render()}}function convertToStingObjectArray(a){return a.map(s=>{const $={};return Object.keys(s).forEach(_=>{const _e=s[_];Array.isArray(_e)?$[_]=JSON.stringify(_e):$[_]=_e}),$})}function useCombinedRefs(){for(var a=arguments.length,s=new Array(a),$=0;$<a;$++)s[$]=arguments[$];return reactExports.useMemo(()=>_=>{s.forEach(_e=>_e(_))},s)}const canUseDOM=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function isWindow$4(a){const s=Object.prototype.toString.call(a);return s==="[object Window]"||s==="[object global]"}function isNode$1(a){return"nodeType"in a}function getWindow$1(a){var s,$;return a?isWindow$4(a)?a:isNode$1(a)&&(s=($=a.ownerDocument)==null?void 0:$.defaultView)!=null?s:window:window}function isDocument(a){const{Document:s}=getWindow$1(a);return a instanceof s}function isHTMLElement(a){return isWindow$4(a)?!1:a instanceof getWindow$1(a).HTMLElement}function isSVGElement(a){return a instanceof getWindow$1(a).SVGElement}function getOwnerDocument(a){return a?isWindow$4(a)?a.document:isNode$1(a)?isDocument(a)?a:isHTMLElement(a)||isSVGElement(a)?a.ownerDocument:document:document:document}const useIsomorphicLayoutEffect$1=canUseDOM?reactExports.useLayoutEffect:reactExports.useEffect;function useEvent$1(a){const s=reactExports.useRef(a);return useIsomorphicLayoutEffect$1(()=>{s.current=a}),reactExports.useCallback(function(){for(var $=arguments.length,_=new Array($),_e=0;_e<$;_e++)_[_e]=arguments[_e];return s.current==null?void 0:s.current(..._)},[])}function useInterval(){const a=reactExports.useRef(null),s=reactExports.useCallback((_,_e)=>{a.current=setInterval(_,_e)},[]),$=reactExports.useCallback(()=>{a.current!==null&&(clearInterval(a.current),a.current=null)},[]);return[s,$]}function useLatestValue(a,s){s===void 0&&(s=[a]);const $=reactExports.useRef(a);return useIsomorphicLayoutEffect$1(()=>{$.current!==a&&($.current=a)},s),$}function useLazyMemo(a,s){const $=reactExports.useRef();return reactExports.useMemo(()=>{const _=a($.current);return $.current=_,_},[...s])}function useNodeRef(a){const s=useEvent$1(a),$=reactExports.useRef(null),_=reactExports.useCallback(_e=>{_e!==$.current&&(s==null||s(_e,$.current)),$.current=_e},[]);return[$,_]}function usePrevious$1(a){const s=reactExports.useRef();return reactExports.useEffect(()=>{s.current=a},[a]),s.current}let ids={};function useUniqueId(a,s){return reactExports.useMemo(()=>{if(s)return s;const $=ids[a]==null?0:ids[a]+1;return ids[a]=$,a+"-"+$},[a,s])}function createAdjustmentFn(a){return function(s){for(var $=arguments.length,_=new Array($>1?$-1:0),_e=1;_e<$;_e++)_[_e-1]=arguments[_e];return _.reduce((tt,nt)=>{const at=Object.entries(nt);for(const[ot,rt]of at){const st=tt[ot];st!=null&&(tt[ot]=st+a*rt)}return tt},{...s})}}const add$1=createAdjustmentFn(1),subtract=createAdjustmentFn(-1);function hasViewportRelativeCoordinates(a){return"clientX"in a&&"clientY"in a}function isKeyboardEvent(a){if(!a)return!1;const{KeyboardEvent:s}=getWindow$1(a.target);return s&&a instanceof s}function isTouchEvent(a){if(!a)return!1;const{TouchEvent:s}=getWindow$1(a.target);return s&&a instanceof s}function getEventCoordinates(a){if(isTouchEvent(a)){if(a.touches&&a.touches.length){const{clientX:s,clientY:$}=a.touches[0];return{x:s,y:$}}else if(a.changedTouches&&a.changedTouches.length){const{clientX:s,clientY:$}=a.changedTouches[0];return{x:s,y:$}}}return hasViewportRelativeCoordinates(a)?{x:a.clientX,y:a.clientY}:null}const CSS$1=Object.freeze({Translate:{toString(a){if(!a)return;const{x:s,y:$}=a;return"translate3d("+(s?Math.round(s):0)+"px, "+($?Math.round($):0)+"px, 0)"}},Scale:{toString(a){if(!a)return;const{scaleX:s,scaleY:$}=a;return"scaleX("+s+") scaleY("+$+")"}},Transform:{toString(a){if(a)return[CSS$1.Translate.toString(a),CSS$1.Scale.toString(a)].join(" ")}},Transition:{toString(a){let{property:s,duration:$,easing:_}=a;return s+" "+$+"ms "+_}}}),SELECTOR="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function findFirstFocusableNode(a){return a.matches(SELECTOR)?a:a.querySelector(SELECTOR)}const hiddenStyles={display:"none"};function HiddenText(a){let{id:s,value:$}=a;return React$a.createElement("div",{id:s,style:hiddenStyles},$)}function LiveRegion(a){let{id:s,announcement:$,ariaLiveType:_="assertive"}=a;const _e={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return React$a.createElement("div",{id:s,style:_e,role:"status","aria-live":_,"aria-atomic":!0},$)}function useAnnouncement(){const[a,s]=reactExports.useState("");return{announce:reactExports.useCallback(_=>{_!=null&&s(_)},[]),announcement:a}}const DndMonitorContext=reactExports.createContext(null);function useDndMonitor(a){const s=reactExports.useContext(DndMonitorContext);reactExports.useEffect(()=>{if(!s)throw new Error("useDndMonitor must be used within a children of <DndContext>");return s(a)},[a,s])}function useDndMonitorProvider(){const[a]=reactExports.useState(()=>new Set),s=reactExports.useCallback(_=>(a.add(_),()=>a.delete(_)),[a]);return[reactExports.useCallback(_=>{let{type:_e,event:tt}=_;a.forEach(nt=>{var at;return(at=nt[_e])==null?void 0:at.call(nt,tt)})},[a]),s]}const defaultScreenReaderInstructions={draggable:`
|
130
131
|
To pick up a draggable item, press the space bar.
|
131
132
|
While dragging, use the arrow keys to move the item.
|
132
133
|
Press space again to drop the item in its new position, or press escape to cancel.
|