main.js 862 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207
  1. /*
  2. THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
  3. if you want to view the source, please visit the github repository of this plugin
  4. */
  5. var __create = Object.create;
  6. var __defProp = Object.defineProperty;
  7. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  8. var __getOwnPropNames = Object.getOwnPropertyNames;
  9. var __getProtoOf = Object.getPrototypeOf;
  10. var __hasOwnProp = Object.prototype.hasOwnProperty;
  11. var __commonJS = (cb, mod) => function __require() {
  12. return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
  13. };
  14. var __export = (target, all) => {
  15. for (var name in all)
  16. __defProp(target, name, { get: all[name], enumerable: true });
  17. };
  18. var __copyProps = (to, from, except, desc) => {
  19. if (from && typeof from === "object" || typeof from === "function") {
  20. for (let key of __getOwnPropNames(from))
  21. if (!__hasOwnProp.call(to, key) && key !== except)
  22. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  23. }
  24. return to;
  25. };
  26. var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  27. // If the importer is in node compatibility mode or this is not an ESM
  28. // file that has been converted to a CommonJS file using a Babel-
  29. // compatible transform (i.e. "__esModule" has not been set), then set
  30. // "default" to the CommonJS "module.exports" for node compatibility.
  31. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  32. mod
  33. ));
  34. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  35. // node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js
  36. var require_cjs = __commonJS({
  37. "node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js"(exports, module2) {
  38. "use strict";
  39. var isMergeableObject = function isMergeableObject2(value) {
  40. return isNonNullObject(value) && !isSpecial(value);
  41. };
  42. function isNonNullObject(value) {
  43. return !!value && typeof value === "object";
  44. }
  45. function isSpecial(value) {
  46. var stringValue = Object.prototype.toString.call(value);
  47. return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
  48. }
  49. var canUseSymbol = typeof Symbol === "function" && Symbol.for;
  50. var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;
  51. function isReactElement(value) {
  52. return value.$$typeof === REACT_ELEMENT_TYPE;
  53. }
  54. function emptyTarget(val) {
  55. return Array.isArray(val) ? [] : {};
  56. }
  57. function cloneUnlessOtherwiseSpecified(value, options) {
  58. return options.clone !== false && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value;
  59. }
  60. function defaultArrayMerge(target, source, options) {
  61. return target.concat(source).map(function(element) {
  62. return cloneUnlessOtherwiseSpecified(element, options);
  63. });
  64. }
  65. function getMergeFunction(key, options) {
  66. if (!options.customMerge) {
  67. return deepmerge;
  68. }
  69. var customMerge = options.customMerge(key);
  70. return typeof customMerge === "function" ? customMerge : deepmerge;
  71. }
  72. function getEnumerableOwnPropertySymbols(target) {
  73. return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
  74. return Object.propertyIsEnumerable.call(target, symbol);
  75. }) : [];
  76. }
  77. function getKeys(target) {
  78. return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
  79. }
  80. function propertyIsOnObject(object, property) {
  81. try {
  82. return property in object;
  83. } catch (_) {
  84. return false;
  85. }
  86. }
  87. function propertyIsUnsafe(target, key) {
  88. return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
  89. }
  90. function mergeObject(target, source, options) {
  91. var destination = {};
  92. if (options.isMergeableObject(target)) {
  93. getKeys(target).forEach(function(key) {
  94. destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
  95. });
  96. }
  97. getKeys(source).forEach(function(key) {
  98. if (propertyIsUnsafe(target, key)) {
  99. return;
  100. }
  101. if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
  102. destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
  103. } else {
  104. destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
  105. }
  106. });
  107. return destination;
  108. }
  109. function deepmerge(target, source, options) {
  110. options = options || {};
  111. options.arrayMerge = options.arrayMerge || defaultArrayMerge;
  112. options.isMergeableObject = options.isMergeableObject || isMergeableObject;
  113. options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
  114. var sourceIsArray = Array.isArray(source);
  115. var targetIsArray = Array.isArray(target);
  116. var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
  117. if (!sourceAndTargetTypesMatch) {
  118. return cloneUnlessOtherwiseSpecified(source, options);
  119. } else if (sourceIsArray) {
  120. return options.arrayMerge(target, source, options);
  121. } else {
  122. return mergeObject(target, source, options);
  123. }
  124. }
  125. deepmerge.all = function deepmergeAll(array, options) {
  126. if (!Array.isArray(array)) {
  127. throw new Error("first argument should be an array");
  128. }
  129. return array.reduce(function(prev, next) {
  130. return deepmerge(prev, next, options);
  131. }, {});
  132. };
  133. var deepmerge_1 = deepmerge;
  134. module2.exports = deepmerge_1;
  135. }
  136. });
  137. // node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/utils/common.js
  138. var require_common = __commonJS({
  139. "node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/utils/common.js"(exports) {
  140. "use strict";
  141. var TYPED_OK = typeof Uint8Array !== "undefined" && typeof Uint16Array !== "undefined" && typeof Int32Array !== "undefined";
  142. function _has(obj, key) {
  143. return Object.prototype.hasOwnProperty.call(obj, key);
  144. }
  145. exports.assign = function(obj) {
  146. var sources = Array.prototype.slice.call(arguments, 1);
  147. while (sources.length) {
  148. var source = sources.shift();
  149. if (!source) {
  150. continue;
  151. }
  152. if (typeof source !== "object") {
  153. throw new TypeError(source + "must be non-object");
  154. }
  155. for (var p in source) {
  156. if (_has(source, p)) {
  157. obj[p] = source[p];
  158. }
  159. }
  160. }
  161. return obj;
  162. };
  163. exports.shrinkBuf = function(buf, size) {
  164. if (buf.length === size) {
  165. return buf;
  166. }
  167. if (buf.subarray) {
  168. return buf.subarray(0, size);
  169. }
  170. buf.length = size;
  171. return buf;
  172. };
  173. var fnTyped = {
  174. arraySet: function(dest, src, src_offs, len, dest_offs) {
  175. if (src.subarray && dest.subarray) {
  176. dest.set(src.subarray(src_offs, src_offs + len), dest_offs);
  177. return;
  178. }
  179. for (var i = 0; i < len; i++) {
  180. dest[dest_offs + i] = src[src_offs + i];
  181. }
  182. },
  183. // Join array of chunks to single array.
  184. flattenChunks: function(chunks) {
  185. var i, l, len, pos, chunk, result;
  186. len = 0;
  187. for (i = 0, l = chunks.length; i < l; i++) {
  188. len += chunks[i].length;
  189. }
  190. result = new Uint8Array(len);
  191. pos = 0;
  192. for (i = 0, l = chunks.length; i < l; i++) {
  193. chunk = chunks[i];
  194. result.set(chunk, pos);
  195. pos += chunk.length;
  196. }
  197. return result;
  198. }
  199. };
  200. var fnUntyped = {
  201. arraySet: function(dest, src, src_offs, len, dest_offs) {
  202. for (var i = 0; i < len; i++) {
  203. dest[dest_offs + i] = src[src_offs + i];
  204. }
  205. },
  206. // Join array of chunks to single array.
  207. flattenChunks: function(chunks) {
  208. return [].concat.apply([], chunks);
  209. }
  210. };
  211. exports.setTyped = function(on) {
  212. if (on) {
  213. exports.Buf8 = Uint8Array;
  214. exports.Buf16 = Uint16Array;
  215. exports.Buf32 = Int32Array;
  216. exports.assign(exports, fnTyped);
  217. } else {
  218. exports.Buf8 = Array;
  219. exports.Buf16 = Array;
  220. exports.Buf32 = Array;
  221. exports.assign(exports, fnUntyped);
  222. }
  223. };
  224. exports.setTyped(TYPED_OK);
  225. }
  226. });
  227. // node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/trees.js
  228. var require_trees = __commonJS({
  229. "node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/trees.js"(exports) {
  230. "use strict";
  231. var utils = require_common();
  232. var Z_FIXED = 4;
  233. var Z_BINARY = 0;
  234. var Z_TEXT = 1;
  235. var Z_UNKNOWN = 2;
  236. function zero(buf) {
  237. var len = buf.length;
  238. while (--len >= 0) {
  239. buf[len] = 0;
  240. }
  241. }
  242. var STORED_BLOCK = 0;
  243. var STATIC_TREES = 1;
  244. var DYN_TREES = 2;
  245. var MIN_MATCH = 3;
  246. var MAX_MATCH = 258;
  247. var LENGTH_CODES = 29;
  248. var LITERALS = 256;
  249. var L_CODES = LITERALS + 1 + LENGTH_CODES;
  250. var D_CODES = 30;
  251. var BL_CODES = 19;
  252. var HEAP_SIZE = 2 * L_CODES + 1;
  253. var MAX_BITS = 15;
  254. var Buf_size = 16;
  255. var MAX_BL_BITS = 7;
  256. var END_BLOCK = 256;
  257. var REP_3_6 = 16;
  258. var REPZ_3_10 = 17;
  259. var REPZ_11_138 = 18;
  260. var extra_lbits = (
  261. /* extra bits for each length code */
  262. [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0]
  263. );
  264. var extra_dbits = (
  265. /* extra bits for each distance code */
  266. [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13]
  267. );
  268. var extra_blbits = (
  269. /* extra bits for each bit length code */
  270. [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7]
  271. );
  272. var bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
  273. var DIST_CODE_LEN = 512;
  274. var static_ltree = new Array((L_CODES + 2) * 2);
  275. zero(static_ltree);
  276. var static_dtree = new Array(D_CODES * 2);
  277. zero(static_dtree);
  278. var _dist_code = new Array(DIST_CODE_LEN);
  279. zero(_dist_code);
  280. var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);
  281. zero(_length_code);
  282. var base_length = new Array(LENGTH_CODES);
  283. zero(base_length);
  284. var base_dist = new Array(D_CODES);
  285. zero(base_dist);
  286. function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {
  287. this.static_tree = static_tree;
  288. this.extra_bits = extra_bits;
  289. this.extra_base = extra_base;
  290. this.elems = elems;
  291. this.max_length = max_length;
  292. this.has_stree = static_tree && static_tree.length;
  293. }
  294. var static_l_desc;
  295. var static_d_desc;
  296. var static_bl_desc;
  297. function TreeDesc(dyn_tree, stat_desc) {
  298. this.dyn_tree = dyn_tree;
  299. this.max_code = 0;
  300. this.stat_desc = stat_desc;
  301. }
  302. function d_code(dist) {
  303. return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];
  304. }
  305. function put_short(s, w) {
  306. s.pending_buf[s.pending++] = w & 255;
  307. s.pending_buf[s.pending++] = w >>> 8 & 255;
  308. }
  309. function send_bits(s, value, length) {
  310. if (s.bi_valid > Buf_size - length) {
  311. s.bi_buf |= value << s.bi_valid & 65535;
  312. put_short(s, s.bi_buf);
  313. s.bi_buf = value >> Buf_size - s.bi_valid;
  314. s.bi_valid += length - Buf_size;
  315. } else {
  316. s.bi_buf |= value << s.bi_valid & 65535;
  317. s.bi_valid += length;
  318. }
  319. }
  320. function send_code(s, c, tree) {
  321. send_bits(
  322. s,
  323. tree[c * 2],
  324. tree[c * 2 + 1]
  325. /*.Len*/
  326. );
  327. }
  328. function bi_reverse(code, len) {
  329. var res = 0;
  330. do {
  331. res |= code & 1;
  332. code >>>= 1;
  333. res <<= 1;
  334. } while (--len > 0);
  335. return res >>> 1;
  336. }
  337. function bi_flush(s) {
  338. if (s.bi_valid === 16) {
  339. put_short(s, s.bi_buf);
  340. s.bi_buf = 0;
  341. s.bi_valid = 0;
  342. } else if (s.bi_valid >= 8) {
  343. s.pending_buf[s.pending++] = s.bi_buf & 255;
  344. s.bi_buf >>= 8;
  345. s.bi_valid -= 8;
  346. }
  347. }
  348. function gen_bitlen(s, desc) {
  349. var tree = desc.dyn_tree;
  350. var max_code = desc.max_code;
  351. var stree = desc.stat_desc.static_tree;
  352. var has_stree = desc.stat_desc.has_stree;
  353. var extra = desc.stat_desc.extra_bits;
  354. var base = desc.stat_desc.extra_base;
  355. var max_length = desc.stat_desc.max_length;
  356. var h;
  357. var n, m;
  358. var bits;
  359. var xbits;
  360. var f;
  361. var overflow = 0;
  362. for (bits = 0; bits <= MAX_BITS; bits++) {
  363. s.bl_count[bits] = 0;
  364. }
  365. tree[s.heap[s.heap_max] * 2 + 1] = 0;
  366. for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {
  367. n = s.heap[h];
  368. bits = tree[tree[n * 2 + 1] * 2 + 1] + 1;
  369. if (bits > max_length) {
  370. bits = max_length;
  371. overflow++;
  372. }
  373. tree[n * 2 + 1] = bits;
  374. if (n > max_code) {
  375. continue;
  376. }
  377. s.bl_count[bits]++;
  378. xbits = 0;
  379. if (n >= base) {
  380. xbits = extra[n - base];
  381. }
  382. f = tree[n * 2];
  383. s.opt_len += f * (bits + xbits);
  384. if (has_stree) {
  385. s.static_len += f * (stree[n * 2 + 1] + xbits);
  386. }
  387. }
  388. if (overflow === 0) {
  389. return;
  390. }
  391. do {
  392. bits = max_length - 1;
  393. while (s.bl_count[bits] === 0) {
  394. bits--;
  395. }
  396. s.bl_count[bits]--;
  397. s.bl_count[bits + 1] += 2;
  398. s.bl_count[max_length]--;
  399. overflow -= 2;
  400. } while (overflow > 0);
  401. for (bits = max_length; bits !== 0; bits--) {
  402. n = s.bl_count[bits];
  403. while (n !== 0) {
  404. m = s.heap[--h];
  405. if (m > max_code) {
  406. continue;
  407. }
  408. if (tree[m * 2 + 1] !== bits) {
  409. s.opt_len += (bits - tree[m * 2 + 1]) * tree[m * 2];
  410. tree[m * 2 + 1] = bits;
  411. }
  412. n--;
  413. }
  414. }
  415. }
  416. function gen_codes(tree, max_code, bl_count) {
  417. var next_code = new Array(MAX_BITS + 1);
  418. var code = 0;
  419. var bits;
  420. var n;
  421. for (bits = 1; bits <= MAX_BITS; bits++) {
  422. next_code[bits] = code = code + bl_count[bits - 1] << 1;
  423. }
  424. for (n = 0; n <= max_code; n++) {
  425. var len = tree[n * 2 + 1];
  426. if (len === 0) {
  427. continue;
  428. }
  429. tree[n * 2] = bi_reverse(next_code[len]++, len);
  430. }
  431. }
  432. function tr_static_init() {
  433. var n;
  434. var bits;
  435. var length;
  436. var code;
  437. var dist;
  438. var bl_count = new Array(MAX_BITS + 1);
  439. length = 0;
  440. for (code = 0; code < LENGTH_CODES - 1; code++) {
  441. base_length[code] = length;
  442. for (n = 0; n < 1 << extra_lbits[code]; n++) {
  443. _length_code[length++] = code;
  444. }
  445. }
  446. _length_code[length - 1] = code;
  447. dist = 0;
  448. for (code = 0; code < 16; code++) {
  449. base_dist[code] = dist;
  450. for (n = 0; n < 1 << extra_dbits[code]; n++) {
  451. _dist_code[dist++] = code;
  452. }
  453. }
  454. dist >>= 7;
  455. for (; code < D_CODES; code++) {
  456. base_dist[code] = dist << 7;
  457. for (n = 0; n < 1 << extra_dbits[code] - 7; n++) {
  458. _dist_code[256 + dist++] = code;
  459. }
  460. }
  461. for (bits = 0; bits <= MAX_BITS; bits++) {
  462. bl_count[bits] = 0;
  463. }
  464. n = 0;
  465. while (n <= 143) {
  466. static_ltree[n * 2 + 1] = 8;
  467. n++;
  468. bl_count[8]++;
  469. }
  470. while (n <= 255) {
  471. static_ltree[n * 2 + 1] = 9;
  472. n++;
  473. bl_count[9]++;
  474. }
  475. while (n <= 279) {
  476. static_ltree[n * 2 + 1] = 7;
  477. n++;
  478. bl_count[7]++;
  479. }
  480. while (n <= 287) {
  481. static_ltree[n * 2 + 1] = 8;
  482. n++;
  483. bl_count[8]++;
  484. }
  485. gen_codes(static_ltree, L_CODES + 1, bl_count);
  486. for (n = 0; n < D_CODES; n++) {
  487. static_dtree[n * 2 + 1] = 5;
  488. static_dtree[n * 2] = bi_reverse(n, 5);
  489. }
  490. static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);
  491. static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);
  492. static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);
  493. }
  494. function init_block(s) {
  495. var n;
  496. for (n = 0; n < L_CODES; n++) {
  497. s.dyn_ltree[n * 2] = 0;
  498. }
  499. for (n = 0; n < D_CODES; n++) {
  500. s.dyn_dtree[n * 2] = 0;
  501. }
  502. for (n = 0; n < BL_CODES; n++) {
  503. s.bl_tree[n * 2] = 0;
  504. }
  505. s.dyn_ltree[END_BLOCK * 2] = 1;
  506. s.opt_len = s.static_len = 0;
  507. s.last_lit = s.matches = 0;
  508. }
  509. function bi_windup(s) {
  510. if (s.bi_valid > 8) {
  511. put_short(s, s.bi_buf);
  512. } else if (s.bi_valid > 0) {
  513. s.pending_buf[s.pending++] = s.bi_buf;
  514. }
  515. s.bi_buf = 0;
  516. s.bi_valid = 0;
  517. }
  518. function copy_block(s, buf, len, header) {
  519. bi_windup(s);
  520. if (header) {
  521. put_short(s, len);
  522. put_short(s, ~len);
  523. }
  524. utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);
  525. s.pending += len;
  526. }
  527. function smaller(tree, n, m, depth) {
  528. var _n2 = n * 2;
  529. var _m2 = m * 2;
  530. return tree[_n2] < tree[_m2] || tree[_n2] === tree[_m2] && depth[n] <= depth[m];
  531. }
  532. function pqdownheap(s, tree, k) {
  533. var v = s.heap[k];
  534. var j = k << 1;
  535. while (j <= s.heap_len) {
  536. if (j < s.heap_len && smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {
  537. j++;
  538. }
  539. if (smaller(tree, v, s.heap[j], s.depth)) {
  540. break;
  541. }
  542. s.heap[k] = s.heap[j];
  543. k = j;
  544. j <<= 1;
  545. }
  546. s.heap[k] = v;
  547. }
  548. function compress_block(s, ltree, dtree) {
  549. var dist;
  550. var lc;
  551. var lx = 0;
  552. var code;
  553. var extra;
  554. if (s.last_lit !== 0) {
  555. do {
  556. dist = s.pending_buf[s.d_buf + lx * 2] << 8 | s.pending_buf[s.d_buf + lx * 2 + 1];
  557. lc = s.pending_buf[s.l_buf + lx];
  558. lx++;
  559. if (dist === 0) {
  560. send_code(s, lc, ltree);
  561. } else {
  562. code = _length_code[lc];
  563. send_code(s, code + LITERALS + 1, ltree);
  564. extra = extra_lbits[code];
  565. if (extra !== 0) {
  566. lc -= base_length[code];
  567. send_bits(s, lc, extra);
  568. }
  569. dist--;
  570. code = d_code(dist);
  571. send_code(s, code, dtree);
  572. extra = extra_dbits[code];
  573. if (extra !== 0) {
  574. dist -= base_dist[code];
  575. send_bits(s, dist, extra);
  576. }
  577. }
  578. } while (lx < s.last_lit);
  579. }
  580. send_code(s, END_BLOCK, ltree);
  581. }
  582. function build_tree(s, desc) {
  583. var tree = desc.dyn_tree;
  584. var stree = desc.stat_desc.static_tree;
  585. var has_stree = desc.stat_desc.has_stree;
  586. var elems = desc.stat_desc.elems;
  587. var n, m;
  588. var max_code = -1;
  589. var node;
  590. s.heap_len = 0;
  591. s.heap_max = HEAP_SIZE;
  592. for (n = 0; n < elems; n++) {
  593. if (tree[n * 2] !== 0) {
  594. s.heap[++s.heap_len] = max_code = n;
  595. s.depth[n] = 0;
  596. } else {
  597. tree[n * 2 + 1] = 0;
  598. }
  599. }
  600. while (s.heap_len < 2) {
  601. node = s.heap[++s.heap_len] = max_code < 2 ? ++max_code : 0;
  602. tree[node * 2] = 1;
  603. s.depth[node] = 0;
  604. s.opt_len--;
  605. if (has_stree) {
  606. s.static_len -= stree[node * 2 + 1];
  607. }
  608. }
  609. desc.max_code = max_code;
  610. for (n = s.heap_len >> 1; n >= 1; n--) {
  611. pqdownheap(s, tree, n);
  612. }
  613. node = elems;
  614. do {
  615. n = s.heap[
  616. 1
  617. /*SMALLEST*/
  618. ];
  619. s.heap[
  620. 1
  621. /*SMALLEST*/
  622. ] = s.heap[s.heap_len--];
  623. pqdownheap(
  624. s,
  625. tree,
  626. 1
  627. /*SMALLEST*/
  628. );
  629. m = s.heap[
  630. 1
  631. /*SMALLEST*/
  632. ];
  633. s.heap[--s.heap_max] = n;
  634. s.heap[--s.heap_max] = m;
  635. tree[node * 2] = tree[n * 2] + tree[m * 2];
  636. s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;
  637. tree[n * 2 + 1] = tree[m * 2 + 1] = node;
  638. s.heap[
  639. 1
  640. /*SMALLEST*/
  641. ] = node++;
  642. pqdownheap(
  643. s,
  644. tree,
  645. 1
  646. /*SMALLEST*/
  647. );
  648. } while (s.heap_len >= 2);
  649. s.heap[--s.heap_max] = s.heap[
  650. 1
  651. /*SMALLEST*/
  652. ];
  653. gen_bitlen(s, desc);
  654. gen_codes(tree, max_code, s.bl_count);
  655. }
  656. function scan_tree(s, tree, max_code) {
  657. var n;
  658. var prevlen = -1;
  659. var curlen;
  660. var nextlen = tree[0 * 2 + 1];
  661. var count = 0;
  662. var max_count = 7;
  663. var min_count = 4;
  664. if (nextlen === 0) {
  665. max_count = 138;
  666. min_count = 3;
  667. }
  668. tree[(max_code + 1) * 2 + 1] = 65535;
  669. for (n = 0; n <= max_code; n++) {
  670. curlen = nextlen;
  671. nextlen = tree[(n + 1) * 2 + 1];
  672. if (++count < max_count && curlen === nextlen) {
  673. continue;
  674. } else if (count < min_count) {
  675. s.bl_tree[curlen * 2] += count;
  676. } else if (curlen !== 0) {
  677. if (curlen !== prevlen) {
  678. s.bl_tree[curlen * 2]++;
  679. }
  680. s.bl_tree[REP_3_6 * 2]++;
  681. } else if (count <= 10) {
  682. s.bl_tree[REPZ_3_10 * 2]++;
  683. } else {
  684. s.bl_tree[REPZ_11_138 * 2]++;
  685. }
  686. count = 0;
  687. prevlen = curlen;
  688. if (nextlen === 0) {
  689. max_count = 138;
  690. min_count = 3;
  691. } else if (curlen === nextlen) {
  692. max_count = 6;
  693. min_count = 3;
  694. } else {
  695. max_count = 7;
  696. min_count = 4;
  697. }
  698. }
  699. }
  700. function send_tree(s, tree, max_code) {
  701. var n;
  702. var prevlen = -1;
  703. var curlen;
  704. var nextlen = tree[0 * 2 + 1];
  705. var count = 0;
  706. var max_count = 7;
  707. var min_count = 4;
  708. if (nextlen === 0) {
  709. max_count = 138;
  710. min_count = 3;
  711. }
  712. for (n = 0; n <= max_code; n++) {
  713. curlen = nextlen;
  714. nextlen = tree[(n + 1) * 2 + 1];
  715. if (++count < max_count && curlen === nextlen) {
  716. continue;
  717. } else if (count < min_count) {
  718. do {
  719. send_code(s, curlen, s.bl_tree);
  720. } while (--count !== 0);
  721. } else if (curlen !== 0) {
  722. if (curlen !== prevlen) {
  723. send_code(s, curlen, s.bl_tree);
  724. count--;
  725. }
  726. send_code(s, REP_3_6, s.bl_tree);
  727. send_bits(s, count - 3, 2);
  728. } else if (count <= 10) {
  729. send_code(s, REPZ_3_10, s.bl_tree);
  730. send_bits(s, count - 3, 3);
  731. } else {
  732. send_code(s, REPZ_11_138, s.bl_tree);
  733. send_bits(s, count - 11, 7);
  734. }
  735. count = 0;
  736. prevlen = curlen;
  737. if (nextlen === 0) {
  738. max_count = 138;
  739. min_count = 3;
  740. } else if (curlen === nextlen) {
  741. max_count = 6;
  742. min_count = 3;
  743. } else {
  744. max_count = 7;
  745. min_count = 4;
  746. }
  747. }
  748. }
  749. function build_bl_tree(s) {
  750. var max_blindex;
  751. scan_tree(s, s.dyn_ltree, s.l_desc.max_code);
  752. scan_tree(s, s.dyn_dtree, s.d_desc.max_code);
  753. build_tree(s, s.bl_desc);
  754. for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {
  755. if (s.bl_tree[bl_order[max_blindex] * 2 + 1] !== 0) {
  756. break;
  757. }
  758. }
  759. s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;
  760. return max_blindex;
  761. }
  762. function send_all_trees(s, lcodes, dcodes, blcodes) {
  763. var rank;
  764. send_bits(s, lcodes - 257, 5);
  765. send_bits(s, dcodes - 1, 5);
  766. send_bits(s, blcodes - 4, 4);
  767. for (rank = 0; rank < blcodes; rank++) {
  768. send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1], 3);
  769. }
  770. send_tree(s, s.dyn_ltree, lcodes - 1);
  771. send_tree(s, s.dyn_dtree, dcodes - 1);
  772. }
  773. function detect_data_type(s) {
  774. var black_mask = 4093624447;
  775. var n;
  776. for (n = 0; n <= 31; n++, black_mask >>>= 1) {
  777. if (black_mask & 1 && s.dyn_ltree[n * 2] !== 0) {
  778. return Z_BINARY;
  779. }
  780. }
  781. if (s.dyn_ltree[9 * 2] !== 0 || s.dyn_ltree[10 * 2] !== 0 || s.dyn_ltree[13 * 2] !== 0) {
  782. return Z_TEXT;
  783. }
  784. for (n = 32; n < LITERALS; n++) {
  785. if (s.dyn_ltree[n * 2] !== 0) {
  786. return Z_TEXT;
  787. }
  788. }
  789. return Z_BINARY;
  790. }
  791. var static_init_done = false;
  792. function _tr_init(s) {
  793. if (!static_init_done) {
  794. tr_static_init();
  795. static_init_done = true;
  796. }
  797. s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);
  798. s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);
  799. s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);
  800. s.bi_buf = 0;
  801. s.bi_valid = 0;
  802. init_block(s);
  803. }
  804. function _tr_stored_block(s, buf, stored_len, last2) {
  805. send_bits(s, (STORED_BLOCK << 1) + (last2 ? 1 : 0), 3);
  806. copy_block(s, buf, stored_len, true);
  807. }
  808. function _tr_align(s) {
  809. send_bits(s, STATIC_TREES << 1, 3);
  810. send_code(s, END_BLOCK, static_ltree);
  811. bi_flush(s);
  812. }
  813. function _tr_flush_block(s, buf, stored_len, last2) {
  814. var opt_lenb, static_lenb;
  815. var max_blindex = 0;
  816. if (s.level > 0) {
  817. if (s.strm.data_type === Z_UNKNOWN) {
  818. s.strm.data_type = detect_data_type(s);
  819. }
  820. build_tree(s, s.l_desc);
  821. build_tree(s, s.d_desc);
  822. max_blindex = build_bl_tree(s);
  823. opt_lenb = s.opt_len + 3 + 7 >>> 3;
  824. static_lenb = s.static_len + 3 + 7 >>> 3;
  825. if (static_lenb <= opt_lenb) {
  826. opt_lenb = static_lenb;
  827. }
  828. } else {
  829. opt_lenb = static_lenb = stored_len + 5;
  830. }
  831. if (stored_len + 4 <= opt_lenb && buf !== -1) {
  832. _tr_stored_block(s, buf, stored_len, last2);
  833. } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {
  834. send_bits(s, (STATIC_TREES << 1) + (last2 ? 1 : 0), 3);
  835. compress_block(s, static_ltree, static_dtree);
  836. } else {
  837. send_bits(s, (DYN_TREES << 1) + (last2 ? 1 : 0), 3);
  838. send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);
  839. compress_block(s, s.dyn_ltree, s.dyn_dtree);
  840. }
  841. init_block(s);
  842. if (last2) {
  843. bi_windup(s);
  844. }
  845. }
  846. function _tr_tally(s, dist, lc) {
  847. s.pending_buf[s.d_buf + s.last_lit * 2] = dist >>> 8 & 255;
  848. s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 255;
  849. s.pending_buf[s.l_buf + s.last_lit] = lc & 255;
  850. s.last_lit++;
  851. if (dist === 0) {
  852. s.dyn_ltree[lc * 2]++;
  853. } else {
  854. s.matches++;
  855. dist--;
  856. s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]++;
  857. s.dyn_dtree[d_code(dist) * 2]++;
  858. }
  859. return s.last_lit === s.lit_bufsize - 1;
  860. }
  861. exports._tr_init = _tr_init;
  862. exports._tr_stored_block = _tr_stored_block;
  863. exports._tr_flush_block = _tr_flush_block;
  864. exports._tr_tally = _tr_tally;
  865. exports._tr_align = _tr_align;
  866. }
  867. });
  868. // node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/adler32.js
  869. var require_adler32 = __commonJS({
  870. "node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/adler32.js"(exports, module2) {
  871. "use strict";
  872. function adler32(adler, buf, len, pos) {
  873. var s1 = adler & 65535 | 0, s2 = adler >>> 16 & 65535 | 0, n = 0;
  874. while (len !== 0) {
  875. n = len > 2e3 ? 2e3 : len;
  876. len -= n;
  877. do {
  878. s1 = s1 + buf[pos++] | 0;
  879. s2 = s2 + s1 | 0;
  880. } while (--n);
  881. s1 %= 65521;
  882. s2 %= 65521;
  883. }
  884. return s1 | s2 << 16 | 0;
  885. }
  886. module2.exports = adler32;
  887. }
  888. });
  889. // node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/crc32.js
  890. var require_crc32 = __commonJS({
  891. "node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/crc32.js"(exports, module2) {
  892. "use strict";
  893. function makeTable() {
  894. var c, table = [];
  895. for (var n = 0; n < 256; n++) {
  896. c = n;
  897. for (var k = 0; k < 8; k++) {
  898. c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1;
  899. }
  900. table[n] = c;
  901. }
  902. return table;
  903. }
  904. var crcTable = makeTable();
  905. function crc32(crc, buf, len, pos) {
  906. var t = crcTable, end = pos + len;
  907. crc ^= -1;
  908. for (var i = pos; i < end; i++) {
  909. crc = crc >>> 8 ^ t[(crc ^ buf[i]) & 255];
  910. }
  911. return crc ^ -1;
  912. }
  913. module2.exports = crc32;
  914. }
  915. });
  916. // node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/messages.js
  917. var require_messages = __commonJS({
  918. "node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/messages.js"(exports, module2) {
  919. "use strict";
  920. module2.exports = {
  921. 2: "need dictionary",
  922. /* Z_NEED_DICT 2 */
  923. 1: "stream end",
  924. /* Z_STREAM_END 1 */
  925. 0: "",
  926. /* Z_OK 0 */
  927. "-1": "file error",
  928. /* Z_ERRNO (-1) */
  929. "-2": "stream error",
  930. /* Z_STREAM_ERROR (-2) */
  931. "-3": "data error",
  932. /* Z_DATA_ERROR (-3) */
  933. "-4": "insufficient memory",
  934. /* Z_MEM_ERROR (-4) */
  935. "-5": "buffer error",
  936. /* Z_BUF_ERROR (-5) */
  937. "-6": "incompatible version"
  938. /* Z_VERSION_ERROR (-6) */
  939. };
  940. }
  941. });
  942. // node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/deflate.js
  943. var require_deflate = __commonJS({
  944. "node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/deflate.js"(exports) {
  945. "use strict";
  946. var utils = require_common();
  947. var trees = require_trees();
  948. var adler32 = require_adler32();
  949. var crc32 = require_crc32();
  950. var msg = require_messages();
  951. var Z_NO_FLUSH = 0;
  952. var Z_PARTIAL_FLUSH = 1;
  953. var Z_FULL_FLUSH = 3;
  954. var Z_FINISH = 4;
  955. var Z_BLOCK = 5;
  956. var Z_OK = 0;
  957. var Z_STREAM_END = 1;
  958. var Z_STREAM_ERROR = -2;
  959. var Z_DATA_ERROR = -3;
  960. var Z_BUF_ERROR = -5;
  961. var Z_DEFAULT_COMPRESSION = -1;
  962. var Z_FILTERED = 1;
  963. var Z_HUFFMAN_ONLY = 2;
  964. var Z_RLE = 3;
  965. var Z_FIXED = 4;
  966. var Z_DEFAULT_STRATEGY = 0;
  967. var Z_UNKNOWN = 2;
  968. var Z_DEFLATED = 8;
  969. var MAX_MEM_LEVEL = 9;
  970. var MAX_WBITS = 15;
  971. var DEF_MEM_LEVEL = 8;
  972. var LENGTH_CODES = 29;
  973. var LITERALS = 256;
  974. var L_CODES = LITERALS + 1 + LENGTH_CODES;
  975. var D_CODES = 30;
  976. var BL_CODES = 19;
  977. var HEAP_SIZE = 2 * L_CODES + 1;
  978. var MAX_BITS = 15;
  979. var MIN_MATCH = 3;
  980. var MAX_MATCH = 258;
  981. var MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1;
  982. var PRESET_DICT = 32;
  983. var INIT_STATE = 42;
  984. var EXTRA_STATE = 69;
  985. var NAME_STATE = 73;
  986. var COMMENT_STATE = 91;
  987. var HCRC_STATE = 103;
  988. var BUSY_STATE = 113;
  989. var FINISH_STATE = 666;
  990. var BS_NEED_MORE = 1;
  991. var BS_BLOCK_DONE = 2;
  992. var BS_FINISH_STARTED = 3;
  993. var BS_FINISH_DONE = 4;
  994. var OS_CODE = 3;
  995. function err(strm, errorCode) {
  996. strm.msg = msg[errorCode];
  997. return errorCode;
  998. }
  999. function rank(f) {
  1000. return (f << 1) - (f > 4 ? 9 : 0);
  1001. }
  1002. function zero(buf) {
  1003. var len = buf.length;
  1004. while (--len >= 0) {
  1005. buf[len] = 0;
  1006. }
  1007. }
  1008. function flush_pending(strm) {
  1009. var s = strm.state;
  1010. var len = s.pending;
  1011. if (len > strm.avail_out) {
  1012. len = strm.avail_out;
  1013. }
  1014. if (len === 0) {
  1015. return;
  1016. }
  1017. utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);
  1018. strm.next_out += len;
  1019. s.pending_out += len;
  1020. strm.total_out += len;
  1021. strm.avail_out -= len;
  1022. s.pending -= len;
  1023. if (s.pending === 0) {
  1024. s.pending_out = 0;
  1025. }
  1026. }
  1027. function flush_block_only(s, last2) {
  1028. trees._tr_flush_block(s, s.block_start >= 0 ? s.block_start : -1, s.strstart - s.block_start, last2);
  1029. s.block_start = s.strstart;
  1030. flush_pending(s.strm);
  1031. }
  1032. function put_byte(s, b) {
  1033. s.pending_buf[s.pending++] = b;
  1034. }
  1035. function putShortMSB(s, b) {
  1036. s.pending_buf[s.pending++] = b >>> 8 & 255;
  1037. s.pending_buf[s.pending++] = b & 255;
  1038. }
  1039. function read_buf(strm, buf, start, size) {
  1040. var len = strm.avail_in;
  1041. if (len > size) {
  1042. len = size;
  1043. }
  1044. if (len === 0) {
  1045. return 0;
  1046. }
  1047. strm.avail_in -= len;
  1048. utils.arraySet(buf, strm.input, strm.next_in, len, start);
  1049. if (strm.state.wrap === 1) {
  1050. strm.adler = adler32(strm.adler, buf, len, start);
  1051. } else if (strm.state.wrap === 2) {
  1052. strm.adler = crc32(strm.adler, buf, len, start);
  1053. }
  1054. strm.next_in += len;
  1055. strm.total_in += len;
  1056. return len;
  1057. }
  1058. function longest_match(s, cur_match) {
  1059. var chain_length = s.max_chain_length;
  1060. var scan = s.strstart;
  1061. var match;
  1062. var len;
  1063. var best_len = s.prev_length;
  1064. var nice_match = s.nice_match;
  1065. var limit = s.strstart > s.w_size - MIN_LOOKAHEAD ? s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0;
  1066. var _win = s.window;
  1067. var wmask = s.w_mask;
  1068. var prev = s.prev;
  1069. var strend = s.strstart + MAX_MATCH;
  1070. var scan_end1 = _win[scan + best_len - 1];
  1071. var scan_end = _win[scan + best_len];
  1072. if (s.prev_length >= s.good_match) {
  1073. chain_length >>= 2;
  1074. }
  1075. if (nice_match > s.lookahead) {
  1076. nice_match = s.lookahead;
  1077. }
  1078. do {
  1079. match = cur_match;
  1080. if (_win[match + best_len] !== scan_end || _win[match + best_len - 1] !== scan_end1 || _win[match] !== _win[scan] || _win[++match] !== _win[scan + 1]) {
  1081. continue;
  1082. }
  1083. scan += 2;
  1084. match++;
  1085. do {
  1086. } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && scan < strend);
  1087. len = MAX_MATCH - (strend - scan);
  1088. scan = strend - MAX_MATCH;
  1089. if (len > best_len) {
  1090. s.match_start = cur_match;
  1091. best_len = len;
  1092. if (len >= nice_match) {
  1093. break;
  1094. }
  1095. scan_end1 = _win[scan + best_len - 1];
  1096. scan_end = _win[scan + best_len];
  1097. }
  1098. } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);
  1099. if (best_len <= s.lookahead) {
  1100. return best_len;
  1101. }
  1102. return s.lookahead;
  1103. }
  1104. function fill_window(s) {
  1105. var _w_size = s.w_size;
  1106. var p, n, m, more, str;
  1107. do {
  1108. more = s.window_size - s.lookahead - s.strstart;
  1109. if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {
  1110. utils.arraySet(s.window, s.window, _w_size, _w_size, 0);
  1111. s.match_start -= _w_size;
  1112. s.strstart -= _w_size;
  1113. s.block_start -= _w_size;
  1114. n = s.hash_size;
  1115. p = n;
  1116. do {
  1117. m = s.head[--p];
  1118. s.head[p] = m >= _w_size ? m - _w_size : 0;
  1119. } while (--n);
  1120. n = _w_size;
  1121. p = n;
  1122. do {
  1123. m = s.prev[--p];
  1124. s.prev[p] = m >= _w_size ? m - _w_size : 0;
  1125. } while (--n);
  1126. more += _w_size;
  1127. }
  1128. if (s.strm.avail_in === 0) {
  1129. break;
  1130. }
  1131. n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);
  1132. s.lookahead += n;
  1133. if (s.lookahead + s.insert >= MIN_MATCH) {
  1134. str = s.strstart - s.insert;
  1135. s.ins_h = s.window[str];
  1136. s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + 1]) & s.hash_mask;
  1137. while (s.insert) {
  1138. s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;
  1139. s.prev[str & s.w_mask] = s.head[s.ins_h];
  1140. s.head[s.ins_h] = str;
  1141. str++;
  1142. s.insert--;
  1143. if (s.lookahead + s.insert < MIN_MATCH) {
  1144. break;
  1145. }
  1146. }
  1147. }
  1148. } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);
  1149. }
  1150. function deflate_stored(s, flush) {
  1151. var max_block_size = 65535;
  1152. if (max_block_size > s.pending_buf_size - 5) {
  1153. max_block_size = s.pending_buf_size - 5;
  1154. }
  1155. for (; ; ) {
  1156. if (s.lookahead <= 1) {
  1157. fill_window(s);
  1158. if (s.lookahead === 0 && flush === Z_NO_FLUSH) {
  1159. return BS_NEED_MORE;
  1160. }
  1161. if (s.lookahead === 0) {
  1162. break;
  1163. }
  1164. }
  1165. s.strstart += s.lookahead;
  1166. s.lookahead = 0;
  1167. var max_start = s.block_start + max_block_size;
  1168. if (s.strstart === 0 || s.strstart >= max_start) {
  1169. s.lookahead = s.strstart - max_start;
  1170. s.strstart = max_start;
  1171. flush_block_only(s, false);
  1172. if (s.strm.avail_out === 0) {
  1173. return BS_NEED_MORE;
  1174. }
  1175. }
  1176. if (s.strstart - s.block_start >= s.w_size - MIN_LOOKAHEAD) {
  1177. flush_block_only(s, false);
  1178. if (s.strm.avail_out === 0) {
  1179. return BS_NEED_MORE;
  1180. }
  1181. }
  1182. }
  1183. s.insert = 0;
  1184. if (flush === Z_FINISH) {
  1185. flush_block_only(s, true);
  1186. if (s.strm.avail_out === 0) {
  1187. return BS_FINISH_STARTED;
  1188. }
  1189. return BS_FINISH_DONE;
  1190. }
  1191. if (s.strstart > s.block_start) {
  1192. flush_block_only(s, false);
  1193. if (s.strm.avail_out === 0) {
  1194. return BS_NEED_MORE;
  1195. }
  1196. }
  1197. return BS_NEED_MORE;
  1198. }
  1199. function deflate_fast(s, flush) {
  1200. var hash_head;
  1201. var bflush;
  1202. for (; ; ) {
  1203. if (s.lookahead < MIN_LOOKAHEAD) {
  1204. fill_window(s);
  1205. if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
  1206. return BS_NEED_MORE;
  1207. }
  1208. if (s.lookahead === 0) {
  1209. break;
  1210. }
  1211. }
  1212. hash_head = 0;
  1213. if (s.lookahead >= MIN_MATCH) {
  1214. s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
  1215. hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
  1216. s.head[s.ins_h] = s.strstart;
  1217. }
  1218. if (hash_head !== 0 && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {
  1219. s.match_length = longest_match(s, hash_head);
  1220. }
  1221. if (s.match_length >= MIN_MATCH) {
  1222. bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);
  1223. s.lookahead -= s.match_length;
  1224. if (s.match_length <= s.max_lazy_match && s.lookahead >= MIN_MATCH) {
  1225. s.match_length--;
  1226. do {
  1227. s.strstart++;
  1228. s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
  1229. hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
  1230. s.head[s.ins_h] = s.strstart;
  1231. } while (--s.match_length !== 0);
  1232. s.strstart++;
  1233. } else {
  1234. s.strstart += s.match_length;
  1235. s.match_length = 0;
  1236. s.ins_h = s.window[s.strstart];
  1237. s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask;
  1238. }
  1239. } else {
  1240. bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
  1241. s.lookahead--;
  1242. s.strstart++;
  1243. }
  1244. if (bflush) {
  1245. flush_block_only(s, false);
  1246. if (s.strm.avail_out === 0) {
  1247. return BS_NEED_MORE;
  1248. }
  1249. }
  1250. }
  1251. s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;
  1252. if (flush === Z_FINISH) {
  1253. flush_block_only(s, true);
  1254. if (s.strm.avail_out === 0) {
  1255. return BS_FINISH_STARTED;
  1256. }
  1257. return BS_FINISH_DONE;
  1258. }
  1259. if (s.last_lit) {
  1260. flush_block_only(s, false);
  1261. if (s.strm.avail_out === 0) {
  1262. return BS_NEED_MORE;
  1263. }
  1264. }
  1265. return BS_BLOCK_DONE;
  1266. }
  1267. function deflate_slow(s, flush) {
  1268. var hash_head;
  1269. var bflush;
  1270. var max_insert;
  1271. for (; ; ) {
  1272. if (s.lookahead < MIN_LOOKAHEAD) {
  1273. fill_window(s);
  1274. if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
  1275. return BS_NEED_MORE;
  1276. }
  1277. if (s.lookahead === 0) {
  1278. break;
  1279. }
  1280. }
  1281. hash_head = 0;
  1282. if (s.lookahead >= MIN_MATCH) {
  1283. s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
  1284. hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
  1285. s.head[s.ins_h] = s.strstart;
  1286. }
  1287. s.prev_length = s.match_length;
  1288. s.prev_match = s.match_start;
  1289. s.match_length = MIN_MATCH - 1;
  1290. if (hash_head !== 0 && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {
  1291. s.match_length = longest_match(s, hash_head);
  1292. if (s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096)) {
  1293. s.match_length = MIN_MATCH - 1;
  1294. }
  1295. }
  1296. if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {
  1297. max_insert = s.strstart + s.lookahead - MIN_MATCH;
  1298. bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);
  1299. s.lookahead -= s.prev_length - 1;
  1300. s.prev_length -= 2;
  1301. do {
  1302. if (++s.strstart <= max_insert) {
  1303. s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
  1304. hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
  1305. s.head[s.ins_h] = s.strstart;
  1306. }
  1307. } while (--s.prev_length !== 0);
  1308. s.match_available = 0;
  1309. s.match_length = MIN_MATCH - 1;
  1310. s.strstart++;
  1311. if (bflush) {
  1312. flush_block_only(s, false);
  1313. if (s.strm.avail_out === 0) {
  1314. return BS_NEED_MORE;
  1315. }
  1316. }
  1317. } else if (s.match_available) {
  1318. bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);
  1319. if (bflush) {
  1320. flush_block_only(s, false);
  1321. }
  1322. s.strstart++;
  1323. s.lookahead--;
  1324. if (s.strm.avail_out === 0) {
  1325. return BS_NEED_MORE;
  1326. }
  1327. } else {
  1328. s.match_available = 1;
  1329. s.strstart++;
  1330. s.lookahead--;
  1331. }
  1332. }
  1333. if (s.match_available) {
  1334. bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);
  1335. s.match_available = 0;
  1336. }
  1337. s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;
  1338. if (flush === Z_FINISH) {
  1339. flush_block_only(s, true);
  1340. if (s.strm.avail_out === 0) {
  1341. return BS_FINISH_STARTED;
  1342. }
  1343. return BS_FINISH_DONE;
  1344. }
  1345. if (s.last_lit) {
  1346. flush_block_only(s, false);
  1347. if (s.strm.avail_out === 0) {
  1348. return BS_NEED_MORE;
  1349. }
  1350. }
  1351. return BS_BLOCK_DONE;
  1352. }
  1353. function deflate_rle(s, flush) {
  1354. var bflush;
  1355. var prev;
  1356. var scan, strend;
  1357. var _win = s.window;
  1358. for (; ; ) {
  1359. if (s.lookahead <= MAX_MATCH) {
  1360. fill_window(s);
  1361. if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {
  1362. return BS_NEED_MORE;
  1363. }
  1364. if (s.lookahead === 0) {
  1365. break;
  1366. }
  1367. }
  1368. s.match_length = 0;
  1369. if (s.lookahead >= MIN_MATCH && s.strstart > 0) {
  1370. scan = s.strstart - 1;
  1371. prev = _win[scan];
  1372. if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {
  1373. strend = s.strstart + MAX_MATCH;
  1374. do {
  1375. } while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend);
  1376. s.match_length = MAX_MATCH - (strend - scan);
  1377. if (s.match_length > s.lookahead) {
  1378. s.match_length = s.lookahead;
  1379. }
  1380. }
  1381. }
  1382. if (s.match_length >= MIN_MATCH) {
  1383. bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);
  1384. s.lookahead -= s.match_length;
  1385. s.strstart += s.match_length;
  1386. s.match_length = 0;
  1387. } else {
  1388. bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
  1389. s.lookahead--;
  1390. s.strstart++;
  1391. }
  1392. if (bflush) {
  1393. flush_block_only(s, false);
  1394. if (s.strm.avail_out === 0) {
  1395. return BS_NEED_MORE;
  1396. }
  1397. }
  1398. }
  1399. s.insert = 0;
  1400. if (flush === Z_FINISH) {
  1401. flush_block_only(s, true);
  1402. if (s.strm.avail_out === 0) {
  1403. return BS_FINISH_STARTED;
  1404. }
  1405. return BS_FINISH_DONE;
  1406. }
  1407. if (s.last_lit) {
  1408. flush_block_only(s, false);
  1409. if (s.strm.avail_out === 0) {
  1410. return BS_NEED_MORE;
  1411. }
  1412. }
  1413. return BS_BLOCK_DONE;
  1414. }
  1415. function deflate_huff(s, flush) {
  1416. var bflush;
  1417. for (; ; ) {
  1418. if (s.lookahead === 0) {
  1419. fill_window(s);
  1420. if (s.lookahead === 0) {
  1421. if (flush === Z_NO_FLUSH) {
  1422. return BS_NEED_MORE;
  1423. }
  1424. break;
  1425. }
  1426. }
  1427. s.match_length = 0;
  1428. bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
  1429. s.lookahead--;
  1430. s.strstart++;
  1431. if (bflush) {
  1432. flush_block_only(s, false);
  1433. if (s.strm.avail_out === 0) {
  1434. return BS_NEED_MORE;
  1435. }
  1436. }
  1437. }
  1438. s.insert = 0;
  1439. if (flush === Z_FINISH) {
  1440. flush_block_only(s, true);
  1441. if (s.strm.avail_out === 0) {
  1442. return BS_FINISH_STARTED;
  1443. }
  1444. return BS_FINISH_DONE;
  1445. }
  1446. if (s.last_lit) {
  1447. flush_block_only(s, false);
  1448. if (s.strm.avail_out === 0) {
  1449. return BS_NEED_MORE;
  1450. }
  1451. }
  1452. return BS_BLOCK_DONE;
  1453. }
  1454. function Config(good_length, max_lazy, nice_length, max_chain, func) {
  1455. this.good_length = good_length;
  1456. this.max_lazy = max_lazy;
  1457. this.nice_length = nice_length;
  1458. this.max_chain = max_chain;
  1459. this.func = func;
  1460. }
  1461. var configuration_table;
  1462. configuration_table = [
  1463. /* good lazy nice chain */
  1464. new Config(0, 0, 0, 0, deflate_stored),
  1465. /* 0 store only */
  1466. new Config(4, 4, 8, 4, deflate_fast),
  1467. /* 1 max speed, no lazy matches */
  1468. new Config(4, 5, 16, 8, deflate_fast),
  1469. /* 2 */
  1470. new Config(4, 6, 32, 32, deflate_fast),
  1471. /* 3 */
  1472. new Config(4, 4, 16, 16, deflate_slow),
  1473. /* 4 lazy matches */
  1474. new Config(8, 16, 32, 32, deflate_slow),
  1475. /* 5 */
  1476. new Config(8, 16, 128, 128, deflate_slow),
  1477. /* 6 */
  1478. new Config(8, 32, 128, 256, deflate_slow),
  1479. /* 7 */
  1480. new Config(32, 128, 258, 1024, deflate_slow),
  1481. /* 8 */
  1482. new Config(32, 258, 258, 4096, deflate_slow)
  1483. /* 9 max compression */
  1484. ];
  1485. function lm_init(s) {
  1486. s.window_size = 2 * s.w_size;
  1487. zero(s.head);
  1488. s.max_lazy_match = configuration_table[s.level].max_lazy;
  1489. s.good_match = configuration_table[s.level].good_length;
  1490. s.nice_match = configuration_table[s.level].nice_length;
  1491. s.max_chain_length = configuration_table[s.level].max_chain;
  1492. s.strstart = 0;
  1493. s.block_start = 0;
  1494. s.lookahead = 0;
  1495. s.insert = 0;
  1496. s.match_length = s.prev_length = MIN_MATCH - 1;
  1497. s.match_available = 0;
  1498. s.ins_h = 0;
  1499. }
  1500. function DeflateState() {
  1501. this.strm = null;
  1502. this.status = 0;
  1503. this.pending_buf = null;
  1504. this.pending_buf_size = 0;
  1505. this.pending_out = 0;
  1506. this.pending = 0;
  1507. this.wrap = 0;
  1508. this.gzhead = null;
  1509. this.gzindex = 0;
  1510. this.method = Z_DEFLATED;
  1511. this.last_flush = -1;
  1512. this.w_size = 0;
  1513. this.w_bits = 0;
  1514. this.w_mask = 0;
  1515. this.window = null;
  1516. this.window_size = 0;
  1517. this.prev = null;
  1518. this.head = null;
  1519. this.ins_h = 0;
  1520. this.hash_size = 0;
  1521. this.hash_bits = 0;
  1522. this.hash_mask = 0;
  1523. this.hash_shift = 0;
  1524. this.block_start = 0;
  1525. this.match_length = 0;
  1526. this.prev_match = 0;
  1527. this.match_available = 0;
  1528. this.strstart = 0;
  1529. this.match_start = 0;
  1530. this.lookahead = 0;
  1531. this.prev_length = 0;
  1532. this.max_chain_length = 0;
  1533. this.max_lazy_match = 0;
  1534. this.level = 0;
  1535. this.strategy = 0;
  1536. this.good_match = 0;
  1537. this.nice_match = 0;
  1538. this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2);
  1539. this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2);
  1540. this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2);
  1541. zero(this.dyn_ltree);
  1542. zero(this.dyn_dtree);
  1543. zero(this.bl_tree);
  1544. this.l_desc = null;
  1545. this.d_desc = null;
  1546. this.bl_desc = null;
  1547. this.bl_count = new utils.Buf16(MAX_BITS + 1);
  1548. this.heap = new utils.Buf16(2 * L_CODES + 1);
  1549. zero(this.heap);
  1550. this.heap_len = 0;
  1551. this.heap_max = 0;
  1552. this.depth = new utils.Buf16(2 * L_CODES + 1);
  1553. zero(this.depth);
  1554. this.l_buf = 0;
  1555. this.lit_bufsize = 0;
  1556. this.last_lit = 0;
  1557. this.d_buf = 0;
  1558. this.opt_len = 0;
  1559. this.static_len = 0;
  1560. this.matches = 0;
  1561. this.insert = 0;
  1562. this.bi_buf = 0;
  1563. this.bi_valid = 0;
  1564. }
  1565. function deflateResetKeep(strm) {
  1566. var s;
  1567. if (!strm || !strm.state) {
  1568. return err(strm, Z_STREAM_ERROR);
  1569. }
  1570. strm.total_in = strm.total_out = 0;
  1571. strm.data_type = Z_UNKNOWN;
  1572. s = strm.state;
  1573. s.pending = 0;
  1574. s.pending_out = 0;
  1575. if (s.wrap < 0) {
  1576. s.wrap = -s.wrap;
  1577. }
  1578. s.status = s.wrap ? INIT_STATE : BUSY_STATE;
  1579. strm.adler = s.wrap === 2 ? 0 : 1;
  1580. s.last_flush = Z_NO_FLUSH;
  1581. trees._tr_init(s);
  1582. return Z_OK;
  1583. }
  1584. function deflateReset(strm) {
  1585. var ret = deflateResetKeep(strm);
  1586. if (ret === Z_OK) {
  1587. lm_init(strm.state);
  1588. }
  1589. return ret;
  1590. }
  1591. function deflateSetHeader(strm, head) {
  1592. if (!strm || !strm.state) {
  1593. return Z_STREAM_ERROR;
  1594. }
  1595. if (strm.state.wrap !== 2) {
  1596. return Z_STREAM_ERROR;
  1597. }
  1598. strm.state.gzhead = head;
  1599. return Z_OK;
  1600. }
  1601. function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {
  1602. if (!strm) {
  1603. return Z_STREAM_ERROR;
  1604. }
  1605. var wrap = 1;
  1606. if (level === Z_DEFAULT_COMPRESSION) {
  1607. level = 6;
  1608. }
  1609. if (windowBits < 0) {
  1610. wrap = 0;
  1611. windowBits = -windowBits;
  1612. } else if (windowBits > 15) {
  1613. wrap = 2;
  1614. windowBits -= 16;
  1615. }
  1616. if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) {
  1617. return err(strm, Z_STREAM_ERROR);
  1618. }
  1619. if (windowBits === 8) {
  1620. windowBits = 9;
  1621. }
  1622. var s = new DeflateState();
  1623. strm.state = s;
  1624. s.strm = strm;
  1625. s.wrap = wrap;
  1626. s.gzhead = null;
  1627. s.w_bits = windowBits;
  1628. s.w_size = 1 << s.w_bits;
  1629. s.w_mask = s.w_size - 1;
  1630. s.hash_bits = memLevel + 7;
  1631. s.hash_size = 1 << s.hash_bits;
  1632. s.hash_mask = s.hash_size - 1;
  1633. s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);
  1634. s.window = new utils.Buf8(s.w_size * 2);
  1635. s.head = new utils.Buf16(s.hash_size);
  1636. s.prev = new utils.Buf16(s.w_size);
  1637. s.lit_bufsize = 1 << memLevel + 6;
  1638. s.pending_buf_size = s.lit_bufsize * 4;
  1639. s.pending_buf = new utils.Buf8(s.pending_buf_size);
  1640. s.d_buf = 1 * s.lit_bufsize;
  1641. s.l_buf = (1 + 2) * s.lit_bufsize;
  1642. s.level = level;
  1643. s.strategy = strategy;
  1644. s.method = method;
  1645. return deflateReset(strm);
  1646. }
  1647. function deflateInit(strm, level) {
  1648. return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);
  1649. }
  1650. function deflate(strm, flush) {
  1651. var old_flush, s;
  1652. var beg, val;
  1653. if (!strm || !strm.state || flush > Z_BLOCK || flush < 0) {
  1654. return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;
  1655. }
  1656. s = strm.state;
  1657. if (!strm.output || !strm.input && strm.avail_in !== 0 || s.status === FINISH_STATE && flush !== Z_FINISH) {
  1658. return err(strm, strm.avail_out === 0 ? Z_BUF_ERROR : Z_STREAM_ERROR);
  1659. }
  1660. s.strm = strm;
  1661. old_flush = s.last_flush;
  1662. s.last_flush = flush;
  1663. if (s.status === INIT_STATE) {
  1664. if (s.wrap === 2) {
  1665. strm.adler = 0;
  1666. put_byte(s, 31);
  1667. put_byte(s, 139);
  1668. put_byte(s, 8);
  1669. if (!s.gzhead) {
  1670. put_byte(s, 0);
  1671. put_byte(s, 0);
  1672. put_byte(s, 0);
  1673. put_byte(s, 0);
  1674. put_byte(s, 0);
  1675. put_byte(s, s.level === 9 ? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? 4 : 0);
  1676. put_byte(s, OS_CODE);
  1677. s.status = BUSY_STATE;
  1678. } else {
  1679. put_byte(
  1680. s,
  1681. (s.gzhead.text ? 1 : 0) + (s.gzhead.hcrc ? 2 : 0) + (!s.gzhead.extra ? 0 : 4) + (!s.gzhead.name ? 0 : 8) + (!s.gzhead.comment ? 0 : 16)
  1682. );
  1683. put_byte(s, s.gzhead.time & 255);
  1684. put_byte(s, s.gzhead.time >> 8 & 255);
  1685. put_byte(s, s.gzhead.time >> 16 & 255);
  1686. put_byte(s, s.gzhead.time >> 24 & 255);
  1687. put_byte(s, s.level === 9 ? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? 4 : 0);
  1688. put_byte(s, s.gzhead.os & 255);
  1689. if (s.gzhead.extra && s.gzhead.extra.length) {
  1690. put_byte(s, s.gzhead.extra.length & 255);
  1691. put_byte(s, s.gzhead.extra.length >> 8 & 255);
  1692. }
  1693. if (s.gzhead.hcrc) {
  1694. strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);
  1695. }
  1696. s.gzindex = 0;
  1697. s.status = EXTRA_STATE;
  1698. }
  1699. } else {
  1700. var header = Z_DEFLATED + (s.w_bits - 8 << 4) << 8;
  1701. var level_flags = -1;
  1702. if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {
  1703. level_flags = 0;
  1704. } else if (s.level < 6) {
  1705. level_flags = 1;
  1706. } else if (s.level === 6) {
  1707. level_flags = 2;
  1708. } else {
  1709. level_flags = 3;
  1710. }
  1711. header |= level_flags << 6;
  1712. if (s.strstart !== 0) {
  1713. header |= PRESET_DICT;
  1714. }
  1715. header += 31 - header % 31;
  1716. s.status = BUSY_STATE;
  1717. putShortMSB(s, header);
  1718. if (s.strstart !== 0) {
  1719. putShortMSB(s, strm.adler >>> 16);
  1720. putShortMSB(s, strm.adler & 65535);
  1721. }
  1722. strm.adler = 1;
  1723. }
  1724. }
  1725. if (s.status === EXTRA_STATE) {
  1726. if (s.gzhead.extra) {
  1727. beg = s.pending;
  1728. while (s.gzindex < (s.gzhead.extra.length & 65535)) {
  1729. if (s.pending === s.pending_buf_size) {
  1730. if (s.gzhead.hcrc && s.pending > beg) {
  1731. strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
  1732. }
  1733. flush_pending(strm);
  1734. beg = s.pending;
  1735. if (s.pending === s.pending_buf_size) {
  1736. break;
  1737. }
  1738. }
  1739. put_byte(s, s.gzhead.extra[s.gzindex] & 255);
  1740. s.gzindex++;
  1741. }
  1742. if (s.gzhead.hcrc && s.pending > beg) {
  1743. strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
  1744. }
  1745. if (s.gzindex === s.gzhead.extra.length) {
  1746. s.gzindex = 0;
  1747. s.status = NAME_STATE;
  1748. }
  1749. } else {
  1750. s.status = NAME_STATE;
  1751. }
  1752. }
  1753. if (s.status === NAME_STATE) {
  1754. if (s.gzhead.name) {
  1755. beg = s.pending;
  1756. do {
  1757. if (s.pending === s.pending_buf_size) {
  1758. if (s.gzhead.hcrc && s.pending > beg) {
  1759. strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
  1760. }
  1761. flush_pending(strm);
  1762. beg = s.pending;
  1763. if (s.pending === s.pending_buf_size) {
  1764. val = 1;
  1765. break;
  1766. }
  1767. }
  1768. if (s.gzindex < s.gzhead.name.length) {
  1769. val = s.gzhead.name.charCodeAt(s.gzindex++) & 255;
  1770. } else {
  1771. val = 0;
  1772. }
  1773. put_byte(s, val);
  1774. } while (val !== 0);
  1775. if (s.gzhead.hcrc && s.pending > beg) {
  1776. strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
  1777. }
  1778. if (val === 0) {
  1779. s.gzindex = 0;
  1780. s.status = COMMENT_STATE;
  1781. }
  1782. } else {
  1783. s.status = COMMENT_STATE;
  1784. }
  1785. }
  1786. if (s.status === COMMENT_STATE) {
  1787. if (s.gzhead.comment) {
  1788. beg = s.pending;
  1789. do {
  1790. if (s.pending === s.pending_buf_size) {
  1791. if (s.gzhead.hcrc && s.pending > beg) {
  1792. strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
  1793. }
  1794. flush_pending(strm);
  1795. beg = s.pending;
  1796. if (s.pending === s.pending_buf_size) {
  1797. val = 1;
  1798. break;
  1799. }
  1800. }
  1801. if (s.gzindex < s.gzhead.comment.length) {
  1802. val = s.gzhead.comment.charCodeAt(s.gzindex++) & 255;
  1803. } else {
  1804. val = 0;
  1805. }
  1806. put_byte(s, val);
  1807. } while (val !== 0);
  1808. if (s.gzhead.hcrc && s.pending > beg) {
  1809. strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
  1810. }
  1811. if (val === 0) {
  1812. s.status = HCRC_STATE;
  1813. }
  1814. } else {
  1815. s.status = HCRC_STATE;
  1816. }
  1817. }
  1818. if (s.status === HCRC_STATE) {
  1819. if (s.gzhead.hcrc) {
  1820. if (s.pending + 2 > s.pending_buf_size) {
  1821. flush_pending(strm);
  1822. }
  1823. if (s.pending + 2 <= s.pending_buf_size) {
  1824. put_byte(s, strm.adler & 255);
  1825. put_byte(s, strm.adler >> 8 & 255);
  1826. strm.adler = 0;
  1827. s.status = BUSY_STATE;
  1828. }
  1829. } else {
  1830. s.status = BUSY_STATE;
  1831. }
  1832. }
  1833. if (s.pending !== 0) {
  1834. flush_pending(strm);
  1835. if (strm.avail_out === 0) {
  1836. s.last_flush = -1;
  1837. return Z_OK;
  1838. }
  1839. } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && flush !== Z_FINISH) {
  1840. return err(strm, Z_BUF_ERROR);
  1841. }
  1842. if (s.status === FINISH_STATE && strm.avail_in !== 0) {
  1843. return err(strm, Z_BUF_ERROR);
  1844. }
  1845. if (strm.avail_in !== 0 || s.lookahead !== 0 || flush !== Z_NO_FLUSH && s.status !== FINISH_STATE) {
  1846. var bstate = s.strategy === Z_HUFFMAN_ONLY ? deflate_huff(s, flush) : s.strategy === Z_RLE ? deflate_rle(s, flush) : configuration_table[s.level].func(s, flush);
  1847. if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {
  1848. s.status = FINISH_STATE;
  1849. }
  1850. if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {
  1851. if (strm.avail_out === 0) {
  1852. s.last_flush = -1;
  1853. }
  1854. return Z_OK;
  1855. }
  1856. if (bstate === BS_BLOCK_DONE) {
  1857. if (flush === Z_PARTIAL_FLUSH) {
  1858. trees._tr_align(s);
  1859. } else if (flush !== Z_BLOCK) {
  1860. trees._tr_stored_block(s, 0, 0, false);
  1861. if (flush === Z_FULL_FLUSH) {
  1862. zero(s.head);
  1863. if (s.lookahead === 0) {
  1864. s.strstart = 0;
  1865. s.block_start = 0;
  1866. s.insert = 0;
  1867. }
  1868. }
  1869. }
  1870. flush_pending(strm);
  1871. if (strm.avail_out === 0) {
  1872. s.last_flush = -1;
  1873. return Z_OK;
  1874. }
  1875. }
  1876. }
  1877. if (flush !== Z_FINISH) {
  1878. return Z_OK;
  1879. }
  1880. if (s.wrap <= 0) {
  1881. return Z_STREAM_END;
  1882. }
  1883. if (s.wrap === 2) {
  1884. put_byte(s, strm.adler & 255);
  1885. put_byte(s, strm.adler >> 8 & 255);
  1886. put_byte(s, strm.adler >> 16 & 255);
  1887. put_byte(s, strm.adler >> 24 & 255);
  1888. put_byte(s, strm.total_in & 255);
  1889. put_byte(s, strm.total_in >> 8 & 255);
  1890. put_byte(s, strm.total_in >> 16 & 255);
  1891. put_byte(s, strm.total_in >> 24 & 255);
  1892. } else {
  1893. putShortMSB(s, strm.adler >>> 16);
  1894. putShortMSB(s, strm.adler & 65535);
  1895. }
  1896. flush_pending(strm);
  1897. if (s.wrap > 0) {
  1898. s.wrap = -s.wrap;
  1899. }
  1900. return s.pending !== 0 ? Z_OK : Z_STREAM_END;
  1901. }
  1902. function deflateEnd(strm) {
  1903. var status;
  1904. if (!strm || !strm.state) {
  1905. return Z_STREAM_ERROR;
  1906. }
  1907. status = strm.state.status;
  1908. if (status !== INIT_STATE && status !== EXTRA_STATE && status !== NAME_STATE && status !== COMMENT_STATE && status !== HCRC_STATE && status !== BUSY_STATE && status !== FINISH_STATE) {
  1909. return err(strm, Z_STREAM_ERROR);
  1910. }
  1911. strm.state = null;
  1912. return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;
  1913. }
  1914. function deflateSetDictionary(strm, dictionary) {
  1915. var dictLength = dictionary.length;
  1916. var s;
  1917. var str, n;
  1918. var wrap;
  1919. var avail;
  1920. var next;
  1921. var input;
  1922. var tmpDict;
  1923. if (!strm || !strm.state) {
  1924. return Z_STREAM_ERROR;
  1925. }
  1926. s = strm.state;
  1927. wrap = s.wrap;
  1928. if (wrap === 2 || wrap === 1 && s.status !== INIT_STATE || s.lookahead) {
  1929. return Z_STREAM_ERROR;
  1930. }
  1931. if (wrap === 1) {
  1932. strm.adler = adler32(strm.adler, dictionary, dictLength, 0);
  1933. }
  1934. s.wrap = 0;
  1935. if (dictLength >= s.w_size) {
  1936. if (wrap === 0) {
  1937. zero(s.head);
  1938. s.strstart = 0;
  1939. s.block_start = 0;
  1940. s.insert = 0;
  1941. }
  1942. tmpDict = new utils.Buf8(s.w_size);
  1943. utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0);
  1944. dictionary = tmpDict;
  1945. dictLength = s.w_size;
  1946. }
  1947. avail = strm.avail_in;
  1948. next = strm.next_in;
  1949. input = strm.input;
  1950. strm.avail_in = dictLength;
  1951. strm.next_in = 0;
  1952. strm.input = dictionary;
  1953. fill_window(s);
  1954. while (s.lookahead >= MIN_MATCH) {
  1955. str = s.strstart;
  1956. n = s.lookahead - (MIN_MATCH - 1);
  1957. do {
  1958. s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;
  1959. s.prev[str & s.w_mask] = s.head[s.ins_h];
  1960. s.head[s.ins_h] = str;
  1961. str++;
  1962. } while (--n);
  1963. s.strstart = str;
  1964. s.lookahead = MIN_MATCH - 1;
  1965. fill_window(s);
  1966. }
  1967. s.strstart += s.lookahead;
  1968. s.block_start = s.strstart;
  1969. s.insert = s.lookahead;
  1970. s.lookahead = 0;
  1971. s.match_length = s.prev_length = MIN_MATCH - 1;
  1972. s.match_available = 0;
  1973. strm.next_in = next;
  1974. strm.input = input;
  1975. strm.avail_in = avail;
  1976. s.wrap = wrap;
  1977. return Z_OK;
  1978. }
  1979. exports.deflateInit = deflateInit;
  1980. exports.deflateInit2 = deflateInit2;
  1981. exports.deflateReset = deflateReset;
  1982. exports.deflateResetKeep = deflateResetKeep;
  1983. exports.deflateSetHeader = deflateSetHeader;
  1984. exports.deflate = deflate;
  1985. exports.deflateEnd = deflateEnd;
  1986. exports.deflateSetDictionary = deflateSetDictionary;
  1987. exports.deflateInfo = "pako deflate (from Nodeca project)";
  1988. }
  1989. });
  1990. // node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/utils/strings.js
  1991. var require_strings = __commonJS({
  1992. "node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/utils/strings.js"(exports) {
  1993. "use strict";
  1994. var utils = require_common();
  1995. var STR_APPLY_OK = true;
  1996. var STR_APPLY_UIA_OK = true;
  1997. try {
  1998. String.fromCharCode.apply(null, [0]);
  1999. } catch (__) {
  2000. STR_APPLY_OK = false;
  2001. }
  2002. try {
  2003. String.fromCharCode.apply(null, new Uint8Array(1));
  2004. } catch (__) {
  2005. STR_APPLY_UIA_OK = false;
  2006. }
  2007. var _utf8len = new utils.Buf8(256);
  2008. for (q = 0; q < 256; q++) {
  2009. _utf8len[q] = q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1;
  2010. }
  2011. var q;
  2012. _utf8len[254] = _utf8len[254] = 1;
  2013. exports.string2buf = function(str) {
  2014. var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;
  2015. for (m_pos = 0; m_pos < str_len; m_pos++) {
  2016. c = str.charCodeAt(m_pos);
  2017. if ((c & 64512) === 55296 && m_pos + 1 < str_len) {
  2018. c2 = str.charCodeAt(m_pos + 1);
  2019. if ((c2 & 64512) === 56320) {
  2020. c = 65536 + (c - 55296 << 10) + (c2 - 56320);
  2021. m_pos++;
  2022. }
  2023. }
  2024. buf_len += c < 128 ? 1 : c < 2048 ? 2 : c < 65536 ? 3 : 4;
  2025. }
  2026. buf = new utils.Buf8(buf_len);
  2027. for (i = 0, m_pos = 0; i < buf_len; m_pos++) {
  2028. c = str.charCodeAt(m_pos);
  2029. if ((c & 64512) === 55296 && m_pos + 1 < str_len) {
  2030. c2 = str.charCodeAt(m_pos + 1);
  2031. if ((c2 & 64512) === 56320) {
  2032. c = 65536 + (c - 55296 << 10) + (c2 - 56320);
  2033. m_pos++;
  2034. }
  2035. }
  2036. if (c < 128) {
  2037. buf[i++] = c;
  2038. } else if (c < 2048) {
  2039. buf[i++] = 192 | c >>> 6;
  2040. buf[i++] = 128 | c & 63;
  2041. } else if (c < 65536) {
  2042. buf[i++] = 224 | c >>> 12;
  2043. buf[i++] = 128 | c >>> 6 & 63;
  2044. buf[i++] = 128 | c & 63;
  2045. } else {
  2046. buf[i++] = 240 | c >>> 18;
  2047. buf[i++] = 128 | c >>> 12 & 63;
  2048. buf[i++] = 128 | c >>> 6 & 63;
  2049. buf[i++] = 128 | c & 63;
  2050. }
  2051. }
  2052. return buf;
  2053. };
  2054. function buf2binstring(buf, len) {
  2055. if (len < 65534) {
  2056. if (buf.subarray && STR_APPLY_UIA_OK || !buf.subarray && STR_APPLY_OK) {
  2057. return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len));
  2058. }
  2059. }
  2060. var result = "";
  2061. for (var i = 0; i < len; i++) {
  2062. result += String.fromCharCode(buf[i]);
  2063. }
  2064. return result;
  2065. }
  2066. exports.buf2binstring = function(buf) {
  2067. return buf2binstring(buf, buf.length);
  2068. };
  2069. exports.binstring2buf = function(str) {
  2070. var buf = new utils.Buf8(str.length);
  2071. for (var i = 0, len = buf.length; i < len; i++) {
  2072. buf[i] = str.charCodeAt(i);
  2073. }
  2074. return buf;
  2075. };
  2076. exports.buf2string = function(buf, max) {
  2077. var i, out, c, c_len;
  2078. var len = max || buf.length;
  2079. var utf16buf = new Array(len * 2);
  2080. for (out = 0, i = 0; i < len; ) {
  2081. c = buf[i++];
  2082. if (c < 128) {
  2083. utf16buf[out++] = c;
  2084. continue;
  2085. }
  2086. c_len = _utf8len[c];
  2087. if (c_len > 4) {
  2088. utf16buf[out++] = 65533;
  2089. i += c_len - 1;
  2090. continue;
  2091. }
  2092. c &= c_len === 2 ? 31 : c_len === 3 ? 15 : 7;
  2093. while (c_len > 1 && i < len) {
  2094. c = c << 6 | buf[i++] & 63;
  2095. c_len--;
  2096. }
  2097. if (c_len > 1) {
  2098. utf16buf[out++] = 65533;
  2099. continue;
  2100. }
  2101. if (c < 65536) {
  2102. utf16buf[out++] = c;
  2103. } else {
  2104. c -= 65536;
  2105. utf16buf[out++] = 55296 | c >> 10 & 1023;
  2106. utf16buf[out++] = 56320 | c & 1023;
  2107. }
  2108. }
  2109. return buf2binstring(utf16buf, out);
  2110. };
  2111. exports.utf8border = function(buf, max) {
  2112. var pos;
  2113. max = max || buf.length;
  2114. if (max > buf.length) {
  2115. max = buf.length;
  2116. }
  2117. pos = max - 1;
  2118. while (pos >= 0 && (buf[pos] & 192) === 128) {
  2119. pos--;
  2120. }
  2121. if (pos < 0) {
  2122. return max;
  2123. }
  2124. if (pos === 0) {
  2125. return max;
  2126. }
  2127. return pos + _utf8len[buf[pos]] > max ? pos : max;
  2128. };
  2129. }
  2130. });
  2131. // node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/zstream.js
  2132. var require_zstream = __commonJS({
  2133. "node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/zstream.js"(exports, module2) {
  2134. "use strict";
  2135. function ZStream() {
  2136. this.input = null;
  2137. this.next_in = 0;
  2138. this.avail_in = 0;
  2139. this.total_in = 0;
  2140. this.output = null;
  2141. this.next_out = 0;
  2142. this.avail_out = 0;
  2143. this.total_out = 0;
  2144. this.msg = "";
  2145. this.state = null;
  2146. this.data_type = 2;
  2147. this.adler = 0;
  2148. }
  2149. module2.exports = ZStream;
  2150. }
  2151. });
  2152. // node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/deflate.js
  2153. var require_deflate2 = __commonJS({
  2154. "node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/deflate.js"(exports) {
  2155. "use strict";
  2156. var zlib_deflate = require_deflate();
  2157. var utils = require_common();
  2158. var strings = require_strings();
  2159. var msg = require_messages();
  2160. var ZStream = require_zstream();
  2161. var toString = Object.prototype.toString;
  2162. var Z_NO_FLUSH = 0;
  2163. var Z_FINISH = 4;
  2164. var Z_OK = 0;
  2165. var Z_STREAM_END = 1;
  2166. var Z_SYNC_FLUSH = 2;
  2167. var Z_DEFAULT_COMPRESSION = -1;
  2168. var Z_DEFAULT_STRATEGY = 0;
  2169. var Z_DEFLATED = 8;
  2170. function Deflate(options) {
  2171. if (!(this instanceof Deflate)) return new Deflate(options);
  2172. this.options = utils.assign({
  2173. level: Z_DEFAULT_COMPRESSION,
  2174. method: Z_DEFLATED,
  2175. chunkSize: 16384,
  2176. windowBits: 15,
  2177. memLevel: 8,
  2178. strategy: Z_DEFAULT_STRATEGY,
  2179. to: ""
  2180. }, options || {});
  2181. var opt = this.options;
  2182. if (opt.raw && opt.windowBits > 0) {
  2183. opt.windowBits = -opt.windowBits;
  2184. } else if (opt.gzip && opt.windowBits > 0 && opt.windowBits < 16) {
  2185. opt.windowBits += 16;
  2186. }
  2187. this.err = 0;
  2188. this.msg = "";
  2189. this.ended = false;
  2190. this.chunks = [];
  2191. this.strm = new ZStream();
  2192. this.strm.avail_out = 0;
  2193. var status = zlib_deflate.deflateInit2(
  2194. this.strm,
  2195. opt.level,
  2196. opt.method,
  2197. opt.windowBits,
  2198. opt.memLevel,
  2199. opt.strategy
  2200. );
  2201. if (status !== Z_OK) {
  2202. throw new Error(msg[status]);
  2203. }
  2204. if (opt.header) {
  2205. zlib_deflate.deflateSetHeader(this.strm, opt.header);
  2206. }
  2207. if (opt.dictionary) {
  2208. var dict;
  2209. if (typeof opt.dictionary === "string") {
  2210. dict = strings.string2buf(opt.dictionary);
  2211. } else if (toString.call(opt.dictionary) === "[object ArrayBuffer]") {
  2212. dict = new Uint8Array(opt.dictionary);
  2213. } else {
  2214. dict = opt.dictionary;
  2215. }
  2216. status = zlib_deflate.deflateSetDictionary(this.strm, dict);
  2217. if (status !== Z_OK) {
  2218. throw new Error(msg[status]);
  2219. }
  2220. this._dict_set = true;
  2221. }
  2222. }
  2223. Deflate.prototype.push = function(data, mode) {
  2224. var strm = this.strm;
  2225. var chunkSize = this.options.chunkSize;
  2226. var status, _mode;
  2227. if (this.ended) {
  2228. return false;
  2229. }
  2230. _mode = mode === ~~mode ? mode : mode === true ? Z_FINISH : Z_NO_FLUSH;
  2231. if (typeof data === "string") {
  2232. strm.input = strings.string2buf(data);
  2233. } else if (toString.call(data) === "[object ArrayBuffer]") {
  2234. strm.input = new Uint8Array(data);
  2235. } else {
  2236. strm.input = data;
  2237. }
  2238. strm.next_in = 0;
  2239. strm.avail_in = strm.input.length;
  2240. do {
  2241. if (strm.avail_out === 0) {
  2242. strm.output = new utils.Buf8(chunkSize);
  2243. strm.next_out = 0;
  2244. strm.avail_out = chunkSize;
  2245. }
  2246. status = zlib_deflate.deflate(strm, _mode);
  2247. if (status !== Z_STREAM_END && status !== Z_OK) {
  2248. this.onEnd(status);
  2249. this.ended = true;
  2250. return false;
  2251. }
  2252. if (strm.avail_out === 0 || strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH)) {
  2253. if (this.options.to === "string") {
  2254. this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out)));
  2255. } else {
  2256. this.onData(utils.shrinkBuf(strm.output, strm.next_out));
  2257. }
  2258. }
  2259. } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END);
  2260. if (_mode === Z_FINISH) {
  2261. status = zlib_deflate.deflateEnd(this.strm);
  2262. this.onEnd(status);
  2263. this.ended = true;
  2264. return status === Z_OK;
  2265. }
  2266. if (_mode === Z_SYNC_FLUSH) {
  2267. this.onEnd(Z_OK);
  2268. strm.avail_out = 0;
  2269. return true;
  2270. }
  2271. return true;
  2272. };
  2273. Deflate.prototype.onData = function(chunk) {
  2274. this.chunks.push(chunk);
  2275. };
  2276. Deflate.prototype.onEnd = function(status) {
  2277. if (status === Z_OK) {
  2278. if (this.options.to === "string") {
  2279. this.result = this.chunks.join("");
  2280. } else {
  2281. this.result = utils.flattenChunks(this.chunks);
  2282. }
  2283. }
  2284. this.chunks = [];
  2285. this.err = status;
  2286. this.msg = this.strm.msg;
  2287. };
  2288. function deflate(input, options) {
  2289. var deflator = new Deflate(options);
  2290. deflator.push(input, true);
  2291. if (deflator.err) {
  2292. throw deflator.msg || msg[deflator.err];
  2293. }
  2294. return deflator.result;
  2295. }
  2296. function deflateRaw(input, options) {
  2297. options = options || {};
  2298. options.raw = true;
  2299. return deflate(input, options);
  2300. }
  2301. function gzip(input, options) {
  2302. options = options || {};
  2303. options.gzip = true;
  2304. return deflate(input, options);
  2305. }
  2306. exports.Deflate = Deflate;
  2307. exports.deflate = deflate;
  2308. exports.deflateRaw = deflateRaw;
  2309. exports.gzip = gzip;
  2310. }
  2311. });
  2312. // node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/inffast.js
  2313. var require_inffast = __commonJS({
  2314. "node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/inffast.js"(exports, module2) {
  2315. "use strict";
  2316. var BAD = 30;
  2317. var TYPE = 12;
  2318. module2.exports = function inflate_fast(strm, start) {
  2319. var state;
  2320. var _in;
  2321. var last2;
  2322. var _out;
  2323. var beg;
  2324. var end;
  2325. var dmax;
  2326. var wsize;
  2327. var whave;
  2328. var wnext;
  2329. var s_window;
  2330. var hold;
  2331. var bits;
  2332. var lcode;
  2333. var dcode;
  2334. var lmask;
  2335. var dmask;
  2336. var here;
  2337. var op;
  2338. var len;
  2339. var dist;
  2340. var from;
  2341. var from_source;
  2342. var input, output;
  2343. state = strm.state;
  2344. _in = strm.next_in;
  2345. input = strm.input;
  2346. last2 = _in + (strm.avail_in - 5);
  2347. _out = strm.next_out;
  2348. output = strm.output;
  2349. beg = _out - (start - strm.avail_out);
  2350. end = _out + (strm.avail_out - 257);
  2351. dmax = state.dmax;
  2352. wsize = state.wsize;
  2353. whave = state.whave;
  2354. wnext = state.wnext;
  2355. s_window = state.window;
  2356. hold = state.hold;
  2357. bits = state.bits;
  2358. lcode = state.lencode;
  2359. dcode = state.distcode;
  2360. lmask = (1 << state.lenbits) - 1;
  2361. dmask = (1 << state.distbits) - 1;
  2362. top:
  2363. do {
  2364. if (bits < 15) {
  2365. hold += input[_in++] << bits;
  2366. bits += 8;
  2367. hold += input[_in++] << bits;
  2368. bits += 8;
  2369. }
  2370. here = lcode[hold & lmask];
  2371. dolen:
  2372. for (; ; ) {
  2373. op = here >>> 24;
  2374. hold >>>= op;
  2375. bits -= op;
  2376. op = here >>> 16 & 255;
  2377. if (op === 0) {
  2378. output[_out++] = here & 65535;
  2379. } else if (op & 16) {
  2380. len = here & 65535;
  2381. op &= 15;
  2382. if (op) {
  2383. if (bits < op) {
  2384. hold += input[_in++] << bits;
  2385. bits += 8;
  2386. }
  2387. len += hold & (1 << op) - 1;
  2388. hold >>>= op;
  2389. bits -= op;
  2390. }
  2391. if (bits < 15) {
  2392. hold += input[_in++] << bits;
  2393. bits += 8;
  2394. hold += input[_in++] << bits;
  2395. bits += 8;
  2396. }
  2397. here = dcode[hold & dmask];
  2398. dodist:
  2399. for (; ; ) {
  2400. op = here >>> 24;
  2401. hold >>>= op;
  2402. bits -= op;
  2403. op = here >>> 16 & 255;
  2404. if (op & 16) {
  2405. dist = here & 65535;
  2406. op &= 15;
  2407. if (bits < op) {
  2408. hold += input[_in++] << bits;
  2409. bits += 8;
  2410. if (bits < op) {
  2411. hold += input[_in++] << bits;
  2412. bits += 8;
  2413. }
  2414. }
  2415. dist += hold & (1 << op) - 1;
  2416. if (dist > dmax) {
  2417. strm.msg = "invalid distance too far back";
  2418. state.mode = BAD;
  2419. break top;
  2420. }
  2421. hold >>>= op;
  2422. bits -= op;
  2423. op = _out - beg;
  2424. if (dist > op) {
  2425. op = dist - op;
  2426. if (op > whave) {
  2427. if (state.sane) {
  2428. strm.msg = "invalid distance too far back";
  2429. state.mode = BAD;
  2430. break top;
  2431. }
  2432. }
  2433. from = 0;
  2434. from_source = s_window;
  2435. if (wnext === 0) {
  2436. from += wsize - op;
  2437. if (op < len) {
  2438. len -= op;
  2439. do {
  2440. output[_out++] = s_window[from++];
  2441. } while (--op);
  2442. from = _out - dist;
  2443. from_source = output;
  2444. }
  2445. } else if (wnext < op) {
  2446. from += wsize + wnext - op;
  2447. op -= wnext;
  2448. if (op < len) {
  2449. len -= op;
  2450. do {
  2451. output[_out++] = s_window[from++];
  2452. } while (--op);
  2453. from = 0;
  2454. if (wnext < len) {
  2455. op = wnext;
  2456. len -= op;
  2457. do {
  2458. output[_out++] = s_window[from++];
  2459. } while (--op);
  2460. from = _out - dist;
  2461. from_source = output;
  2462. }
  2463. }
  2464. } else {
  2465. from += wnext - op;
  2466. if (op < len) {
  2467. len -= op;
  2468. do {
  2469. output[_out++] = s_window[from++];
  2470. } while (--op);
  2471. from = _out - dist;
  2472. from_source = output;
  2473. }
  2474. }
  2475. while (len > 2) {
  2476. output[_out++] = from_source[from++];
  2477. output[_out++] = from_source[from++];
  2478. output[_out++] = from_source[from++];
  2479. len -= 3;
  2480. }
  2481. if (len) {
  2482. output[_out++] = from_source[from++];
  2483. if (len > 1) {
  2484. output[_out++] = from_source[from++];
  2485. }
  2486. }
  2487. } else {
  2488. from = _out - dist;
  2489. do {
  2490. output[_out++] = output[from++];
  2491. output[_out++] = output[from++];
  2492. output[_out++] = output[from++];
  2493. len -= 3;
  2494. } while (len > 2);
  2495. if (len) {
  2496. output[_out++] = output[from++];
  2497. if (len > 1) {
  2498. output[_out++] = output[from++];
  2499. }
  2500. }
  2501. }
  2502. } else if ((op & 64) === 0) {
  2503. here = dcode[(here & 65535) + (hold & (1 << op) - 1)];
  2504. continue dodist;
  2505. } else {
  2506. strm.msg = "invalid distance code";
  2507. state.mode = BAD;
  2508. break top;
  2509. }
  2510. break;
  2511. }
  2512. } else if ((op & 64) === 0) {
  2513. here = lcode[(here & 65535) + (hold & (1 << op) - 1)];
  2514. continue dolen;
  2515. } else if (op & 32) {
  2516. state.mode = TYPE;
  2517. break top;
  2518. } else {
  2519. strm.msg = "invalid literal/length code";
  2520. state.mode = BAD;
  2521. break top;
  2522. }
  2523. break;
  2524. }
  2525. } while (_in < last2 && _out < end);
  2526. len = bits >> 3;
  2527. _in -= len;
  2528. bits -= len << 3;
  2529. hold &= (1 << bits) - 1;
  2530. strm.next_in = _in;
  2531. strm.next_out = _out;
  2532. strm.avail_in = _in < last2 ? 5 + (last2 - _in) : 5 - (_in - last2);
  2533. strm.avail_out = _out < end ? 257 + (end - _out) : 257 - (_out - end);
  2534. state.hold = hold;
  2535. state.bits = bits;
  2536. return;
  2537. };
  2538. }
  2539. });
  2540. // node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/inftrees.js
  2541. var require_inftrees = __commonJS({
  2542. "node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/inftrees.js"(exports, module2) {
  2543. "use strict";
  2544. var utils = require_common();
  2545. var MAXBITS = 15;
  2546. var ENOUGH_LENS = 852;
  2547. var ENOUGH_DISTS = 592;
  2548. var CODES = 0;
  2549. var LENS = 1;
  2550. var DISTS = 2;
  2551. var lbase = [
  2552. /* Length codes 257..285 base */
  2553. 3,
  2554. 4,
  2555. 5,
  2556. 6,
  2557. 7,
  2558. 8,
  2559. 9,
  2560. 10,
  2561. 11,
  2562. 13,
  2563. 15,
  2564. 17,
  2565. 19,
  2566. 23,
  2567. 27,
  2568. 31,
  2569. 35,
  2570. 43,
  2571. 51,
  2572. 59,
  2573. 67,
  2574. 83,
  2575. 99,
  2576. 115,
  2577. 131,
  2578. 163,
  2579. 195,
  2580. 227,
  2581. 258,
  2582. 0,
  2583. 0
  2584. ];
  2585. var lext = [
  2586. /* Length codes 257..285 extra */
  2587. 16,
  2588. 16,
  2589. 16,
  2590. 16,
  2591. 16,
  2592. 16,
  2593. 16,
  2594. 16,
  2595. 17,
  2596. 17,
  2597. 17,
  2598. 17,
  2599. 18,
  2600. 18,
  2601. 18,
  2602. 18,
  2603. 19,
  2604. 19,
  2605. 19,
  2606. 19,
  2607. 20,
  2608. 20,
  2609. 20,
  2610. 20,
  2611. 21,
  2612. 21,
  2613. 21,
  2614. 21,
  2615. 16,
  2616. 72,
  2617. 78
  2618. ];
  2619. var dbase = [
  2620. /* Distance codes 0..29 base */
  2621. 1,
  2622. 2,
  2623. 3,
  2624. 4,
  2625. 5,
  2626. 7,
  2627. 9,
  2628. 13,
  2629. 17,
  2630. 25,
  2631. 33,
  2632. 49,
  2633. 65,
  2634. 97,
  2635. 129,
  2636. 193,
  2637. 257,
  2638. 385,
  2639. 513,
  2640. 769,
  2641. 1025,
  2642. 1537,
  2643. 2049,
  2644. 3073,
  2645. 4097,
  2646. 6145,
  2647. 8193,
  2648. 12289,
  2649. 16385,
  2650. 24577,
  2651. 0,
  2652. 0
  2653. ];
  2654. var dext = [
  2655. /* Distance codes 0..29 extra */
  2656. 16,
  2657. 16,
  2658. 16,
  2659. 16,
  2660. 17,
  2661. 17,
  2662. 18,
  2663. 18,
  2664. 19,
  2665. 19,
  2666. 20,
  2667. 20,
  2668. 21,
  2669. 21,
  2670. 22,
  2671. 22,
  2672. 23,
  2673. 23,
  2674. 24,
  2675. 24,
  2676. 25,
  2677. 25,
  2678. 26,
  2679. 26,
  2680. 27,
  2681. 27,
  2682. 28,
  2683. 28,
  2684. 29,
  2685. 29,
  2686. 64,
  2687. 64
  2688. ];
  2689. module2.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) {
  2690. var bits = opts.bits;
  2691. var len = 0;
  2692. var sym = 0;
  2693. var min = 0, max = 0;
  2694. var root = 0;
  2695. var curr = 0;
  2696. var drop = 0;
  2697. var left = 0;
  2698. var used = 0;
  2699. var huff = 0;
  2700. var incr;
  2701. var fill2;
  2702. var low;
  2703. var mask;
  2704. var next;
  2705. var base = null;
  2706. var base_index = 0;
  2707. var end;
  2708. var count = new utils.Buf16(MAXBITS + 1);
  2709. var offs = new utils.Buf16(MAXBITS + 1);
  2710. var extra = null;
  2711. var extra_index = 0;
  2712. var here_bits, here_op, here_val;
  2713. for (len = 0; len <= MAXBITS; len++) {
  2714. count[len] = 0;
  2715. }
  2716. for (sym = 0; sym < codes; sym++) {
  2717. count[lens[lens_index + sym]]++;
  2718. }
  2719. root = bits;
  2720. for (max = MAXBITS; max >= 1; max--) {
  2721. if (count[max] !== 0) {
  2722. break;
  2723. }
  2724. }
  2725. if (root > max) {
  2726. root = max;
  2727. }
  2728. if (max === 0) {
  2729. table[table_index++] = 1 << 24 | 64 << 16 | 0;
  2730. table[table_index++] = 1 << 24 | 64 << 16 | 0;
  2731. opts.bits = 1;
  2732. return 0;
  2733. }
  2734. for (min = 1; min < max; min++) {
  2735. if (count[min] !== 0) {
  2736. break;
  2737. }
  2738. }
  2739. if (root < min) {
  2740. root = min;
  2741. }
  2742. left = 1;
  2743. for (len = 1; len <= MAXBITS; len++) {
  2744. left <<= 1;
  2745. left -= count[len];
  2746. if (left < 0) {
  2747. return -1;
  2748. }
  2749. }
  2750. if (left > 0 && (type === CODES || max !== 1)) {
  2751. return -1;
  2752. }
  2753. offs[1] = 0;
  2754. for (len = 1; len < MAXBITS; len++) {
  2755. offs[len + 1] = offs[len] + count[len];
  2756. }
  2757. for (sym = 0; sym < codes; sym++) {
  2758. if (lens[lens_index + sym] !== 0) {
  2759. work[offs[lens[lens_index + sym]]++] = sym;
  2760. }
  2761. }
  2762. if (type === CODES) {
  2763. base = extra = work;
  2764. end = 19;
  2765. } else if (type === LENS) {
  2766. base = lbase;
  2767. base_index -= 257;
  2768. extra = lext;
  2769. extra_index -= 257;
  2770. end = 256;
  2771. } else {
  2772. base = dbase;
  2773. extra = dext;
  2774. end = -1;
  2775. }
  2776. huff = 0;
  2777. sym = 0;
  2778. len = min;
  2779. next = table_index;
  2780. curr = root;
  2781. drop = 0;
  2782. low = -1;
  2783. used = 1 << root;
  2784. mask = used - 1;
  2785. if (type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS) {
  2786. return 1;
  2787. }
  2788. for (; ; ) {
  2789. here_bits = len - drop;
  2790. if (work[sym] < end) {
  2791. here_op = 0;
  2792. here_val = work[sym];
  2793. } else if (work[sym] > end) {
  2794. here_op = extra[extra_index + work[sym]];
  2795. here_val = base[base_index + work[sym]];
  2796. } else {
  2797. here_op = 32 + 64;
  2798. here_val = 0;
  2799. }
  2800. incr = 1 << len - drop;
  2801. fill2 = 1 << curr;
  2802. min = fill2;
  2803. do {
  2804. fill2 -= incr;
  2805. table[next + (huff >> drop) + fill2] = here_bits << 24 | here_op << 16 | here_val | 0;
  2806. } while (fill2 !== 0);
  2807. incr = 1 << len - 1;
  2808. while (huff & incr) {
  2809. incr >>= 1;
  2810. }
  2811. if (incr !== 0) {
  2812. huff &= incr - 1;
  2813. huff += incr;
  2814. } else {
  2815. huff = 0;
  2816. }
  2817. sym++;
  2818. if (--count[len] === 0) {
  2819. if (len === max) {
  2820. break;
  2821. }
  2822. len = lens[lens_index + work[sym]];
  2823. }
  2824. if (len > root && (huff & mask) !== low) {
  2825. if (drop === 0) {
  2826. drop = root;
  2827. }
  2828. next += min;
  2829. curr = len - drop;
  2830. left = 1 << curr;
  2831. while (curr + drop < max) {
  2832. left -= count[curr + drop];
  2833. if (left <= 0) {
  2834. break;
  2835. }
  2836. curr++;
  2837. left <<= 1;
  2838. }
  2839. used += 1 << curr;
  2840. if (type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS) {
  2841. return 1;
  2842. }
  2843. low = huff & mask;
  2844. table[low] = root << 24 | curr << 16 | next - table_index | 0;
  2845. }
  2846. }
  2847. if (huff !== 0) {
  2848. table[next + huff] = len - drop << 24 | 64 << 16 | 0;
  2849. }
  2850. opts.bits = root;
  2851. return 0;
  2852. };
  2853. }
  2854. });
  2855. // node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/inflate.js
  2856. var require_inflate = __commonJS({
  2857. "node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/inflate.js"(exports) {
  2858. "use strict";
  2859. var utils = require_common();
  2860. var adler32 = require_adler32();
  2861. var crc32 = require_crc32();
  2862. var inflate_fast = require_inffast();
  2863. var inflate_table = require_inftrees();
  2864. var CODES = 0;
  2865. var LENS = 1;
  2866. var DISTS = 2;
  2867. var Z_FINISH = 4;
  2868. var Z_BLOCK = 5;
  2869. var Z_TREES = 6;
  2870. var Z_OK = 0;
  2871. var Z_STREAM_END = 1;
  2872. var Z_NEED_DICT = 2;
  2873. var Z_STREAM_ERROR = -2;
  2874. var Z_DATA_ERROR = -3;
  2875. var Z_MEM_ERROR = -4;
  2876. var Z_BUF_ERROR = -5;
  2877. var Z_DEFLATED = 8;
  2878. var HEAD = 1;
  2879. var FLAGS = 2;
  2880. var TIME = 3;
  2881. var OS = 4;
  2882. var EXLEN = 5;
  2883. var EXTRA = 6;
  2884. var NAME = 7;
  2885. var COMMENT = 8;
  2886. var HCRC = 9;
  2887. var DICTID = 10;
  2888. var DICT = 11;
  2889. var TYPE = 12;
  2890. var TYPEDO = 13;
  2891. var STORED = 14;
  2892. var COPY_ = 15;
  2893. var COPY = 16;
  2894. var TABLE = 17;
  2895. var LENLENS = 18;
  2896. var CODELENS = 19;
  2897. var LEN_ = 20;
  2898. var LEN = 21;
  2899. var LENEXT = 22;
  2900. var DIST = 23;
  2901. var DISTEXT = 24;
  2902. var MATCH = 25;
  2903. var LIT = 26;
  2904. var CHECK = 27;
  2905. var LENGTH = 28;
  2906. var DONE = 29;
  2907. var BAD = 30;
  2908. var MEM = 31;
  2909. var SYNC = 32;
  2910. var ENOUGH_LENS = 852;
  2911. var ENOUGH_DISTS = 592;
  2912. var MAX_WBITS = 15;
  2913. var DEF_WBITS = MAX_WBITS;
  2914. function zswap32(q) {
  2915. return (q >>> 24 & 255) + (q >>> 8 & 65280) + ((q & 65280) << 8) + ((q & 255) << 24);
  2916. }
  2917. function InflateState() {
  2918. this.mode = 0;
  2919. this.last = false;
  2920. this.wrap = 0;
  2921. this.havedict = false;
  2922. this.flags = 0;
  2923. this.dmax = 0;
  2924. this.check = 0;
  2925. this.total = 0;
  2926. this.head = null;
  2927. this.wbits = 0;
  2928. this.wsize = 0;
  2929. this.whave = 0;
  2930. this.wnext = 0;
  2931. this.window = null;
  2932. this.hold = 0;
  2933. this.bits = 0;
  2934. this.length = 0;
  2935. this.offset = 0;
  2936. this.extra = 0;
  2937. this.lencode = null;
  2938. this.distcode = null;
  2939. this.lenbits = 0;
  2940. this.distbits = 0;
  2941. this.ncode = 0;
  2942. this.nlen = 0;
  2943. this.ndist = 0;
  2944. this.have = 0;
  2945. this.next = null;
  2946. this.lens = new utils.Buf16(320);
  2947. this.work = new utils.Buf16(288);
  2948. this.lendyn = null;
  2949. this.distdyn = null;
  2950. this.sane = 0;
  2951. this.back = 0;
  2952. this.was = 0;
  2953. }
  2954. function inflateResetKeep(strm) {
  2955. var state;
  2956. if (!strm || !strm.state) {
  2957. return Z_STREAM_ERROR;
  2958. }
  2959. state = strm.state;
  2960. strm.total_in = strm.total_out = state.total = 0;
  2961. strm.msg = "";
  2962. if (state.wrap) {
  2963. strm.adler = state.wrap & 1;
  2964. }
  2965. state.mode = HEAD;
  2966. state.last = 0;
  2967. state.havedict = 0;
  2968. state.dmax = 32768;
  2969. state.head = null;
  2970. state.hold = 0;
  2971. state.bits = 0;
  2972. state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);
  2973. state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);
  2974. state.sane = 1;
  2975. state.back = -1;
  2976. return Z_OK;
  2977. }
  2978. function inflateReset(strm) {
  2979. var state;
  2980. if (!strm || !strm.state) {
  2981. return Z_STREAM_ERROR;
  2982. }
  2983. state = strm.state;
  2984. state.wsize = 0;
  2985. state.whave = 0;
  2986. state.wnext = 0;
  2987. return inflateResetKeep(strm);
  2988. }
  2989. function inflateReset2(strm, windowBits) {
  2990. var wrap;
  2991. var state;
  2992. if (!strm || !strm.state) {
  2993. return Z_STREAM_ERROR;
  2994. }
  2995. state = strm.state;
  2996. if (windowBits < 0) {
  2997. wrap = 0;
  2998. windowBits = -windowBits;
  2999. } else {
  3000. wrap = (windowBits >> 4) + 1;
  3001. if (windowBits < 48) {
  3002. windowBits &= 15;
  3003. }
  3004. }
  3005. if (windowBits && (windowBits < 8 || windowBits > 15)) {
  3006. return Z_STREAM_ERROR;
  3007. }
  3008. if (state.window !== null && state.wbits !== windowBits) {
  3009. state.window = null;
  3010. }
  3011. state.wrap = wrap;
  3012. state.wbits = windowBits;
  3013. return inflateReset(strm);
  3014. }
  3015. function inflateInit2(strm, windowBits) {
  3016. var ret;
  3017. var state;
  3018. if (!strm) {
  3019. return Z_STREAM_ERROR;
  3020. }
  3021. state = new InflateState();
  3022. strm.state = state;
  3023. state.window = null;
  3024. ret = inflateReset2(strm, windowBits);
  3025. if (ret !== Z_OK) {
  3026. strm.state = null;
  3027. }
  3028. return ret;
  3029. }
  3030. function inflateInit(strm) {
  3031. return inflateInit2(strm, DEF_WBITS);
  3032. }
  3033. var virgin = true;
  3034. var lenfix;
  3035. var distfix;
  3036. function fixedtables(state) {
  3037. if (virgin) {
  3038. var sym;
  3039. lenfix = new utils.Buf32(512);
  3040. distfix = new utils.Buf32(32);
  3041. sym = 0;
  3042. while (sym < 144) {
  3043. state.lens[sym++] = 8;
  3044. }
  3045. while (sym < 256) {
  3046. state.lens[sym++] = 9;
  3047. }
  3048. while (sym < 280) {
  3049. state.lens[sym++] = 7;
  3050. }
  3051. while (sym < 288) {
  3052. state.lens[sym++] = 8;
  3053. }
  3054. inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });
  3055. sym = 0;
  3056. while (sym < 32) {
  3057. state.lens[sym++] = 5;
  3058. }
  3059. inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });
  3060. virgin = false;
  3061. }
  3062. state.lencode = lenfix;
  3063. state.lenbits = 9;
  3064. state.distcode = distfix;
  3065. state.distbits = 5;
  3066. }
  3067. function updatewindow(strm, src, end, copy) {
  3068. var dist;
  3069. var state = strm.state;
  3070. if (state.window === null) {
  3071. state.wsize = 1 << state.wbits;
  3072. state.wnext = 0;
  3073. state.whave = 0;
  3074. state.window = new utils.Buf8(state.wsize);
  3075. }
  3076. if (copy >= state.wsize) {
  3077. utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);
  3078. state.wnext = 0;
  3079. state.whave = state.wsize;
  3080. } else {
  3081. dist = state.wsize - state.wnext;
  3082. if (dist > copy) {
  3083. dist = copy;
  3084. }
  3085. utils.arraySet(state.window, src, end - copy, dist, state.wnext);
  3086. copy -= dist;
  3087. if (copy) {
  3088. utils.arraySet(state.window, src, end - copy, copy, 0);
  3089. state.wnext = copy;
  3090. state.whave = state.wsize;
  3091. } else {
  3092. state.wnext += dist;
  3093. if (state.wnext === state.wsize) {
  3094. state.wnext = 0;
  3095. }
  3096. if (state.whave < state.wsize) {
  3097. state.whave += dist;
  3098. }
  3099. }
  3100. }
  3101. return 0;
  3102. }
  3103. function inflate(strm, flush) {
  3104. var state;
  3105. var input, output;
  3106. var next;
  3107. var put;
  3108. var have, left;
  3109. var hold;
  3110. var bits;
  3111. var _in, _out;
  3112. var copy;
  3113. var from;
  3114. var from_source;
  3115. var here = 0;
  3116. var here_bits, here_op, here_val;
  3117. var last_bits, last_op, last_val;
  3118. var len;
  3119. var ret;
  3120. var hbuf = new utils.Buf8(4);
  3121. var opts;
  3122. var n;
  3123. var order = (
  3124. /* permutation of code lengths */
  3125. [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]
  3126. );
  3127. if (!strm || !strm.state || !strm.output || !strm.input && strm.avail_in !== 0) {
  3128. return Z_STREAM_ERROR;
  3129. }
  3130. state = strm.state;
  3131. if (state.mode === TYPE) {
  3132. state.mode = TYPEDO;
  3133. }
  3134. put = strm.next_out;
  3135. output = strm.output;
  3136. left = strm.avail_out;
  3137. next = strm.next_in;
  3138. input = strm.input;
  3139. have = strm.avail_in;
  3140. hold = state.hold;
  3141. bits = state.bits;
  3142. _in = have;
  3143. _out = left;
  3144. ret = Z_OK;
  3145. inf_leave:
  3146. for (; ; ) {
  3147. switch (state.mode) {
  3148. case HEAD:
  3149. if (state.wrap === 0) {
  3150. state.mode = TYPEDO;
  3151. break;
  3152. }
  3153. while (bits < 16) {
  3154. if (have === 0) {
  3155. break inf_leave;
  3156. }
  3157. have--;
  3158. hold += input[next++] << bits;
  3159. bits += 8;
  3160. }
  3161. if (state.wrap & 2 && hold === 35615) {
  3162. state.check = 0;
  3163. hbuf[0] = hold & 255;
  3164. hbuf[1] = hold >>> 8 & 255;
  3165. state.check = crc32(state.check, hbuf, 2, 0);
  3166. hold = 0;
  3167. bits = 0;
  3168. state.mode = FLAGS;
  3169. break;
  3170. }
  3171. state.flags = 0;
  3172. if (state.head) {
  3173. state.head.done = false;
  3174. }
  3175. if (!(state.wrap & 1) || /* check if zlib header allowed */
  3176. (((hold & 255) << 8) + (hold >> 8)) % 31) {
  3177. strm.msg = "incorrect header check";
  3178. state.mode = BAD;
  3179. break;
  3180. }
  3181. if ((hold & 15) !== Z_DEFLATED) {
  3182. strm.msg = "unknown compression method";
  3183. state.mode = BAD;
  3184. break;
  3185. }
  3186. hold >>>= 4;
  3187. bits -= 4;
  3188. len = (hold & 15) + 8;
  3189. if (state.wbits === 0) {
  3190. state.wbits = len;
  3191. } else if (len > state.wbits) {
  3192. strm.msg = "invalid window size";
  3193. state.mode = BAD;
  3194. break;
  3195. }
  3196. state.dmax = 1 << len;
  3197. strm.adler = state.check = 1;
  3198. state.mode = hold & 512 ? DICTID : TYPE;
  3199. hold = 0;
  3200. bits = 0;
  3201. break;
  3202. case FLAGS:
  3203. while (bits < 16) {
  3204. if (have === 0) {
  3205. break inf_leave;
  3206. }
  3207. have--;
  3208. hold += input[next++] << bits;
  3209. bits += 8;
  3210. }
  3211. state.flags = hold;
  3212. if ((state.flags & 255) !== Z_DEFLATED) {
  3213. strm.msg = "unknown compression method";
  3214. state.mode = BAD;
  3215. break;
  3216. }
  3217. if (state.flags & 57344) {
  3218. strm.msg = "unknown header flags set";
  3219. state.mode = BAD;
  3220. break;
  3221. }
  3222. if (state.head) {
  3223. state.head.text = hold >> 8 & 1;
  3224. }
  3225. if (state.flags & 512) {
  3226. hbuf[0] = hold & 255;
  3227. hbuf[1] = hold >>> 8 & 255;
  3228. state.check = crc32(state.check, hbuf, 2, 0);
  3229. }
  3230. hold = 0;
  3231. bits = 0;
  3232. state.mode = TIME;
  3233. case TIME:
  3234. while (bits < 32) {
  3235. if (have === 0) {
  3236. break inf_leave;
  3237. }
  3238. have--;
  3239. hold += input[next++] << bits;
  3240. bits += 8;
  3241. }
  3242. if (state.head) {
  3243. state.head.time = hold;
  3244. }
  3245. if (state.flags & 512) {
  3246. hbuf[0] = hold & 255;
  3247. hbuf[1] = hold >>> 8 & 255;
  3248. hbuf[2] = hold >>> 16 & 255;
  3249. hbuf[3] = hold >>> 24 & 255;
  3250. state.check = crc32(state.check, hbuf, 4, 0);
  3251. }
  3252. hold = 0;
  3253. bits = 0;
  3254. state.mode = OS;
  3255. case OS:
  3256. while (bits < 16) {
  3257. if (have === 0) {
  3258. break inf_leave;
  3259. }
  3260. have--;
  3261. hold += input[next++] << bits;
  3262. bits += 8;
  3263. }
  3264. if (state.head) {
  3265. state.head.xflags = hold & 255;
  3266. state.head.os = hold >> 8;
  3267. }
  3268. if (state.flags & 512) {
  3269. hbuf[0] = hold & 255;
  3270. hbuf[1] = hold >>> 8 & 255;
  3271. state.check = crc32(state.check, hbuf, 2, 0);
  3272. }
  3273. hold = 0;
  3274. bits = 0;
  3275. state.mode = EXLEN;
  3276. case EXLEN:
  3277. if (state.flags & 1024) {
  3278. while (bits < 16) {
  3279. if (have === 0) {
  3280. break inf_leave;
  3281. }
  3282. have--;
  3283. hold += input[next++] << bits;
  3284. bits += 8;
  3285. }
  3286. state.length = hold;
  3287. if (state.head) {
  3288. state.head.extra_len = hold;
  3289. }
  3290. if (state.flags & 512) {
  3291. hbuf[0] = hold & 255;
  3292. hbuf[1] = hold >>> 8 & 255;
  3293. state.check = crc32(state.check, hbuf, 2, 0);
  3294. }
  3295. hold = 0;
  3296. bits = 0;
  3297. } else if (state.head) {
  3298. state.head.extra = null;
  3299. }
  3300. state.mode = EXTRA;
  3301. case EXTRA:
  3302. if (state.flags & 1024) {
  3303. copy = state.length;
  3304. if (copy > have) {
  3305. copy = have;
  3306. }
  3307. if (copy) {
  3308. if (state.head) {
  3309. len = state.head.extra_len - state.length;
  3310. if (!state.head.extra) {
  3311. state.head.extra = new Array(state.head.extra_len);
  3312. }
  3313. utils.arraySet(
  3314. state.head.extra,
  3315. input,
  3316. next,
  3317. // extra field is limited to 65536 bytes
  3318. // - no need for additional size check
  3319. copy,
  3320. /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/
  3321. len
  3322. );
  3323. }
  3324. if (state.flags & 512) {
  3325. state.check = crc32(state.check, input, copy, next);
  3326. }
  3327. have -= copy;
  3328. next += copy;
  3329. state.length -= copy;
  3330. }
  3331. if (state.length) {
  3332. break inf_leave;
  3333. }
  3334. }
  3335. state.length = 0;
  3336. state.mode = NAME;
  3337. case NAME:
  3338. if (state.flags & 2048) {
  3339. if (have === 0) {
  3340. break inf_leave;
  3341. }
  3342. copy = 0;
  3343. do {
  3344. len = input[next + copy++];
  3345. if (state.head && len && state.length < 65536) {
  3346. state.head.name += String.fromCharCode(len);
  3347. }
  3348. } while (len && copy < have);
  3349. if (state.flags & 512) {
  3350. state.check = crc32(state.check, input, copy, next);
  3351. }
  3352. have -= copy;
  3353. next += copy;
  3354. if (len) {
  3355. break inf_leave;
  3356. }
  3357. } else if (state.head) {
  3358. state.head.name = null;
  3359. }
  3360. state.length = 0;
  3361. state.mode = COMMENT;
  3362. case COMMENT:
  3363. if (state.flags & 4096) {
  3364. if (have === 0) {
  3365. break inf_leave;
  3366. }
  3367. copy = 0;
  3368. do {
  3369. len = input[next + copy++];
  3370. if (state.head && len && state.length < 65536) {
  3371. state.head.comment += String.fromCharCode(len);
  3372. }
  3373. } while (len && copy < have);
  3374. if (state.flags & 512) {
  3375. state.check = crc32(state.check, input, copy, next);
  3376. }
  3377. have -= copy;
  3378. next += copy;
  3379. if (len) {
  3380. break inf_leave;
  3381. }
  3382. } else if (state.head) {
  3383. state.head.comment = null;
  3384. }
  3385. state.mode = HCRC;
  3386. case HCRC:
  3387. if (state.flags & 512) {
  3388. while (bits < 16) {
  3389. if (have === 0) {
  3390. break inf_leave;
  3391. }
  3392. have--;
  3393. hold += input[next++] << bits;
  3394. bits += 8;
  3395. }
  3396. if (hold !== (state.check & 65535)) {
  3397. strm.msg = "header crc mismatch";
  3398. state.mode = BAD;
  3399. break;
  3400. }
  3401. hold = 0;
  3402. bits = 0;
  3403. }
  3404. if (state.head) {
  3405. state.head.hcrc = state.flags >> 9 & 1;
  3406. state.head.done = true;
  3407. }
  3408. strm.adler = state.check = 0;
  3409. state.mode = TYPE;
  3410. break;
  3411. case DICTID:
  3412. while (bits < 32) {
  3413. if (have === 0) {
  3414. break inf_leave;
  3415. }
  3416. have--;
  3417. hold += input[next++] << bits;
  3418. bits += 8;
  3419. }
  3420. strm.adler = state.check = zswap32(hold);
  3421. hold = 0;
  3422. bits = 0;
  3423. state.mode = DICT;
  3424. case DICT:
  3425. if (state.havedict === 0) {
  3426. strm.next_out = put;
  3427. strm.avail_out = left;
  3428. strm.next_in = next;
  3429. strm.avail_in = have;
  3430. state.hold = hold;
  3431. state.bits = bits;
  3432. return Z_NEED_DICT;
  3433. }
  3434. strm.adler = state.check = 1;
  3435. state.mode = TYPE;
  3436. case TYPE:
  3437. if (flush === Z_BLOCK || flush === Z_TREES) {
  3438. break inf_leave;
  3439. }
  3440. case TYPEDO:
  3441. if (state.last) {
  3442. hold >>>= bits & 7;
  3443. bits -= bits & 7;
  3444. state.mode = CHECK;
  3445. break;
  3446. }
  3447. while (bits < 3) {
  3448. if (have === 0) {
  3449. break inf_leave;
  3450. }
  3451. have--;
  3452. hold += input[next++] << bits;
  3453. bits += 8;
  3454. }
  3455. state.last = hold & 1;
  3456. hold >>>= 1;
  3457. bits -= 1;
  3458. switch (hold & 3) {
  3459. case 0:
  3460. state.mode = STORED;
  3461. break;
  3462. case 1:
  3463. fixedtables(state);
  3464. state.mode = LEN_;
  3465. if (flush === Z_TREES) {
  3466. hold >>>= 2;
  3467. bits -= 2;
  3468. break inf_leave;
  3469. }
  3470. break;
  3471. case 2:
  3472. state.mode = TABLE;
  3473. break;
  3474. case 3:
  3475. strm.msg = "invalid block type";
  3476. state.mode = BAD;
  3477. }
  3478. hold >>>= 2;
  3479. bits -= 2;
  3480. break;
  3481. case STORED:
  3482. hold >>>= bits & 7;
  3483. bits -= bits & 7;
  3484. while (bits < 32) {
  3485. if (have === 0) {
  3486. break inf_leave;
  3487. }
  3488. have--;
  3489. hold += input[next++] << bits;
  3490. bits += 8;
  3491. }
  3492. if ((hold & 65535) !== (hold >>> 16 ^ 65535)) {
  3493. strm.msg = "invalid stored block lengths";
  3494. state.mode = BAD;
  3495. break;
  3496. }
  3497. state.length = hold & 65535;
  3498. hold = 0;
  3499. bits = 0;
  3500. state.mode = COPY_;
  3501. if (flush === Z_TREES) {
  3502. break inf_leave;
  3503. }
  3504. case COPY_:
  3505. state.mode = COPY;
  3506. case COPY:
  3507. copy = state.length;
  3508. if (copy) {
  3509. if (copy > have) {
  3510. copy = have;
  3511. }
  3512. if (copy > left) {
  3513. copy = left;
  3514. }
  3515. if (copy === 0) {
  3516. break inf_leave;
  3517. }
  3518. utils.arraySet(output, input, next, copy, put);
  3519. have -= copy;
  3520. next += copy;
  3521. left -= copy;
  3522. put += copy;
  3523. state.length -= copy;
  3524. break;
  3525. }
  3526. state.mode = TYPE;
  3527. break;
  3528. case TABLE:
  3529. while (bits < 14) {
  3530. if (have === 0) {
  3531. break inf_leave;
  3532. }
  3533. have--;
  3534. hold += input[next++] << bits;
  3535. bits += 8;
  3536. }
  3537. state.nlen = (hold & 31) + 257;
  3538. hold >>>= 5;
  3539. bits -= 5;
  3540. state.ndist = (hold & 31) + 1;
  3541. hold >>>= 5;
  3542. bits -= 5;
  3543. state.ncode = (hold & 15) + 4;
  3544. hold >>>= 4;
  3545. bits -= 4;
  3546. if (state.nlen > 286 || state.ndist > 30) {
  3547. strm.msg = "too many length or distance symbols";
  3548. state.mode = BAD;
  3549. break;
  3550. }
  3551. state.have = 0;
  3552. state.mode = LENLENS;
  3553. case LENLENS:
  3554. while (state.have < state.ncode) {
  3555. while (bits < 3) {
  3556. if (have === 0) {
  3557. break inf_leave;
  3558. }
  3559. have--;
  3560. hold += input[next++] << bits;
  3561. bits += 8;
  3562. }
  3563. state.lens[order[state.have++]] = hold & 7;
  3564. hold >>>= 3;
  3565. bits -= 3;
  3566. }
  3567. while (state.have < 19) {
  3568. state.lens[order[state.have++]] = 0;
  3569. }
  3570. state.lencode = state.lendyn;
  3571. state.lenbits = 7;
  3572. opts = { bits: state.lenbits };
  3573. ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);
  3574. state.lenbits = opts.bits;
  3575. if (ret) {
  3576. strm.msg = "invalid code lengths set";
  3577. state.mode = BAD;
  3578. break;
  3579. }
  3580. state.have = 0;
  3581. state.mode = CODELENS;
  3582. case CODELENS:
  3583. while (state.have < state.nlen + state.ndist) {
  3584. for (; ; ) {
  3585. here = state.lencode[hold & (1 << state.lenbits) - 1];
  3586. here_bits = here >>> 24;
  3587. here_op = here >>> 16 & 255;
  3588. here_val = here & 65535;
  3589. if (here_bits <= bits) {
  3590. break;
  3591. }
  3592. if (have === 0) {
  3593. break inf_leave;
  3594. }
  3595. have--;
  3596. hold += input[next++] << bits;
  3597. bits += 8;
  3598. }
  3599. if (here_val < 16) {
  3600. hold >>>= here_bits;
  3601. bits -= here_bits;
  3602. state.lens[state.have++] = here_val;
  3603. } else {
  3604. if (here_val === 16) {
  3605. n = here_bits + 2;
  3606. while (bits < n) {
  3607. if (have === 0) {
  3608. break inf_leave;
  3609. }
  3610. have--;
  3611. hold += input[next++] << bits;
  3612. bits += 8;
  3613. }
  3614. hold >>>= here_bits;
  3615. bits -= here_bits;
  3616. if (state.have === 0) {
  3617. strm.msg = "invalid bit length repeat";
  3618. state.mode = BAD;
  3619. break;
  3620. }
  3621. len = state.lens[state.have - 1];
  3622. copy = 3 + (hold & 3);
  3623. hold >>>= 2;
  3624. bits -= 2;
  3625. } else if (here_val === 17) {
  3626. n = here_bits + 3;
  3627. while (bits < n) {
  3628. if (have === 0) {
  3629. break inf_leave;
  3630. }
  3631. have--;
  3632. hold += input[next++] << bits;
  3633. bits += 8;
  3634. }
  3635. hold >>>= here_bits;
  3636. bits -= here_bits;
  3637. len = 0;
  3638. copy = 3 + (hold & 7);
  3639. hold >>>= 3;
  3640. bits -= 3;
  3641. } else {
  3642. n = here_bits + 7;
  3643. while (bits < n) {
  3644. if (have === 0) {
  3645. break inf_leave;
  3646. }
  3647. have--;
  3648. hold += input[next++] << bits;
  3649. bits += 8;
  3650. }
  3651. hold >>>= here_bits;
  3652. bits -= here_bits;
  3653. len = 0;
  3654. copy = 11 + (hold & 127);
  3655. hold >>>= 7;
  3656. bits -= 7;
  3657. }
  3658. if (state.have + copy > state.nlen + state.ndist) {
  3659. strm.msg = "invalid bit length repeat";
  3660. state.mode = BAD;
  3661. break;
  3662. }
  3663. while (copy--) {
  3664. state.lens[state.have++] = len;
  3665. }
  3666. }
  3667. }
  3668. if (state.mode === BAD) {
  3669. break;
  3670. }
  3671. if (state.lens[256] === 0) {
  3672. strm.msg = "invalid code -- missing end-of-block";
  3673. state.mode = BAD;
  3674. break;
  3675. }
  3676. state.lenbits = 9;
  3677. opts = { bits: state.lenbits };
  3678. ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);
  3679. state.lenbits = opts.bits;
  3680. if (ret) {
  3681. strm.msg = "invalid literal/lengths set";
  3682. state.mode = BAD;
  3683. break;
  3684. }
  3685. state.distbits = 6;
  3686. state.distcode = state.distdyn;
  3687. opts = { bits: state.distbits };
  3688. ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);
  3689. state.distbits = opts.bits;
  3690. if (ret) {
  3691. strm.msg = "invalid distances set";
  3692. state.mode = BAD;
  3693. break;
  3694. }
  3695. state.mode = LEN_;
  3696. if (flush === Z_TREES) {
  3697. break inf_leave;
  3698. }
  3699. case LEN_:
  3700. state.mode = LEN;
  3701. case LEN:
  3702. if (have >= 6 && left >= 258) {
  3703. strm.next_out = put;
  3704. strm.avail_out = left;
  3705. strm.next_in = next;
  3706. strm.avail_in = have;
  3707. state.hold = hold;
  3708. state.bits = bits;
  3709. inflate_fast(strm, _out);
  3710. put = strm.next_out;
  3711. output = strm.output;
  3712. left = strm.avail_out;
  3713. next = strm.next_in;
  3714. input = strm.input;
  3715. have = strm.avail_in;
  3716. hold = state.hold;
  3717. bits = state.bits;
  3718. if (state.mode === TYPE) {
  3719. state.back = -1;
  3720. }
  3721. break;
  3722. }
  3723. state.back = 0;
  3724. for (; ; ) {
  3725. here = state.lencode[hold & (1 << state.lenbits) - 1];
  3726. here_bits = here >>> 24;
  3727. here_op = here >>> 16 & 255;
  3728. here_val = here & 65535;
  3729. if (here_bits <= bits) {
  3730. break;
  3731. }
  3732. if (have === 0) {
  3733. break inf_leave;
  3734. }
  3735. have--;
  3736. hold += input[next++] << bits;
  3737. bits += 8;
  3738. }
  3739. if (here_op && (here_op & 240) === 0) {
  3740. last_bits = here_bits;
  3741. last_op = here_op;
  3742. last_val = here_val;
  3743. for (; ; ) {
  3744. here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)];
  3745. here_bits = here >>> 24;
  3746. here_op = here >>> 16 & 255;
  3747. here_val = here & 65535;
  3748. if (last_bits + here_bits <= bits) {
  3749. break;
  3750. }
  3751. if (have === 0) {
  3752. break inf_leave;
  3753. }
  3754. have--;
  3755. hold += input[next++] << bits;
  3756. bits += 8;
  3757. }
  3758. hold >>>= last_bits;
  3759. bits -= last_bits;
  3760. state.back += last_bits;
  3761. }
  3762. hold >>>= here_bits;
  3763. bits -= here_bits;
  3764. state.back += here_bits;
  3765. state.length = here_val;
  3766. if (here_op === 0) {
  3767. state.mode = LIT;
  3768. break;
  3769. }
  3770. if (here_op & 32) {
  3771. state.back = -1;
  3772. state.mode = TYPE;
  3773. break;
  3774. }
  3775. if (here_op & 64) {
  3776. strm.msg = "invalid literal/length code";
  3777. state.mode = BAD;
  3778. break;
  3779. }
  3780. state.extra = here_op & 15;
  3781. state.mode = LENEXT;
  3782. case LENEXT:
  3783. if (state.extra) {
  3784. n = state.extra;
  3785. while (bits < n) {
  3786. if (have === 0) {
  3787. break inf_leave;
  3788. }
  3789. have--;
  3790. hold += input[next++] << bits;
  3791. bits += 8;
  3792. }
  3793. state.length += hold & (1 << state.extra) - 1;
  3794. hold >>>= state.extra;
  3795. bits -= state.extra;
  3796. state.back += state.extra;
  3797. }
  3798. state.was = state.length;
  3799. state.mode = DIST;
  3800. case DIST:
  3801. for (; ; ) {
  3802. here = state.distcode[hold & (1 << state.distbits) - 1];
  3803. here_bits = here >>> 24;
  3804. here_op = here >>> 16 & 255;
  3805. here_val = here & 65535;
  3806. if (here_bits <= bits) {
  3807. break;
  3808. }
  3809. if (have === 0) {
  3810. break inf_leave;
  3811. }
  3812. have--;
  3813. hold += input[next++] << bits;
  3814. bits += 8;
  3815. }
  3816. if ((here_op & 240) === 0) {
  3817. last_bits = here_bits;
  3818. last_op = here_op;
  3819. last_val = here_val;
  3820. for (; ; ) {
  3821. here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)];
  3822. here_bits = here >>> 24;
  3823. here_op = here >>> 16 & 255;
  3824. here_val = here & 65535;
  3825. if (last_bits + here_bits <= bits) {
  3826. break;
  3827. }
  3828. if (have === 0) {
  3829. break inf_leave;
  3830. }
  3831. have--;
  3832. hold += input[next++] << bits;
  3833. bits += 8;
  3834. }
  3835. hold >>>= last_bits;
  3836. bits -= last_bits;
  3837. state.back += last_bits;
  3838. }
  3839. hold >>>= here_bits;
  3840. bits -= here_bits;
  3841. state.back += here_bits;
  3842. if (here_op & 64) {
  3843. strm.msg = "invalid distance code";
  3844. state.mode = BAD;
  3845. break;
  3846. }
  3847. state.offset = here_val;
  3848. state.extra = here_op & 15;
  3849. state.mode = DISTEXT;
  3850. case DISTEXT:
  3851. if (state.extra) {
  3852. n = state.extra;
  3853. while (bits < n) {
  3854. if (have === 0) {
  3855. break inf_leave;
  3856. }
  3857. have--;
  3858. hold += input[next++] << bits;
  3859. bits += 8;
  3860. }
  3861. state.offset += hold & (1 << state.extra) - 1;
  3862. hold >>>= state.extra;
  3863. bits -= state.extra;
  3864. state.back += state.extra;
  3865. }
  3866. if (state.offset > state.dmax) {
  3867. strm.msg = "invalid distance too far back";
  3868. state.mode = BAD;
  3869. break;
  3870. }
  3871. state.mode = MATCH;
  3872. case MATCH:
  3873. if (left === 0) {
  3874. break inf_leave;
  3875. }
  3876. copy = _out - left;
  3877. if (state.offset > copy) {
  3878. copy = state.offset - copy;
  3879. if (copy > state.whave) {
  3880. if (state.sane) {
  3881. strm.msg = "invalid distance too far back";
  3882. state.mode = BAD;
  3883. break;
  3884. }
  3885. }
  3886. if (copy > state.wnext) {
  3887. copy -= state.wnext;
  3888. from = state.wsize - copy;
  3889. } else {
  3890. from = state.wnext - copy;
  3891. }
  3892. if (copy > state.length) {
  3893. copy = state.length;
  3894. }
  3895. from_source = state.window;
  3896. } else {
  3897. from_source = output;
  3898. from = put - state.offset;
  3899. copy = state.length;
  3900. }
  3901. if (copy > left) {
  3902. copy = left;
  3903. }
  3904. left -= copy;
  3905. state.length -= copy;
  3906. do {
  3907. output[put++] = from_source[from++];
  3908. } while (--copy);
  3909. if (state.length === 0) {
  3910. state.mode = LEN;
  3911. }
  3912. break;
  3913. case LIT:
  3914. if (left === 0) {
  3915. break inf_leave;
  3916. }
  3917. output[put++] = state.length;
  3918. left--;
  3919. state.mode = LEN;
  3920. break;
  3921. case CHECK:
  3922. if (state.wrap) {
  3923. while (bits < 32) {
  3924. if (have === 0) {
  3925. break inf_leave;
  3926. }
  3927. have--;
  3928. hold |= input[next++] << bits;
  3929. bits += 8;
  3930. }
  3931. _out -= left;
  3932. strm.total_out += _out;
  3933. state.total += _out;
  3934. if (_out) {
  3935. strm.adler = state.check = /*UPDATE(state.check, put - _out, _out);*/
  3936. state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out);
  3937. }
  3938. _out = left;
  3939. if ((state.flags ? hold : zswap32(hold)) !== state.check) {
  3940. strm.msg = "incorrect data check";
  3941. state.mode = BAD;
  3942. break;
  3943. }
  3944. hold = 0;
  3945. bits = 0;
  3946. }
  3947. state.mode = LENGTH;
  3948. case LENGTH:
  3949. if (state.wrap && state.flags) {
  3950. while (bits < 32) {
  3951. if (have === 0) {
  3952. break inf_leave;
  3953. }
  3954. have--;
  3955. hold += input[next++] << bits;
  3956. bits += 8;
  3957. }
  3958. if (hold !== (state.total & 4294967295)) {
  3959. strm.msg = "incorrect length check";
  3960. state.mode = BAD;
  3961. break;
  3962. }
  3963. hold = 0;
  3964. bits = 0;
  3965. }
  3966. state.mode = DONE;
  3967. case DONE:
  3968. ret = Z_STREAM_END;
  3969. break inf_leave;
  3970. case BAD:
  3971. ret = Z_DATA_ERROR;
  3972. break inf_leave;
  3973. case MEM:
  3974. return Z_MEM_ERROR;
  3975. case SYNC:
  3976. default:
  3977. return Z_STREAM_ERROR;
  3978. }
  3979. }
  3980. strm.next_out = put;
  3981. strm.avail_out = left;
  3982. strm.next_in = next;
  3983. strm.avail_in = have;
  3984. state.hold = hold;
  3985. state.bits = bits;
  3986. if (state.wsize || _out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush !== Z_FINISH)) {
  3987. if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {
  3988. state.mode = MEM;
  3989. return Z_MEM_ERROR;
  3990. }
  3991. }
  3992. _in -= strm.avail_in;
  3993. _out -= strm.avail_out;
  3994. strm.total_in += _in;
  3995. strm.total_out += _out;
  3996. state.total += _out;
  3997. if (state.wrap && _out) {
  3998. strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/
  3999. state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out);
  4000. }
  4001. strm.data_type = state.bits + (state.last ? 64 : 0) + (state.mode === TYPE ? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);
  4002. if ((_in === 0 && _out === 0 || flush === Z_FINISH) && ret === Z_OK) {
  4003. ret = Z_BUF_ERROR;
  4004. }
  4005. return ret;
  4006. }
  4007. function inflateEnd(strm) {
  4008. if (!strm || !strm.state) {
  4009. return Z_STREAM_ERROR;
  4010. }
  4011. var state = strm.state;
  4012. if (state.window) {
  4013. state.window = null;
  4014. }
  4015. strm.state = null;
  4016. return Z_OK;
  4017. }
  4018. function inflateGetHeader(strm, head) {
  4019. var state;
  4020. if (!strm || !strm.state) {
  4021. return Z_STREAM_ERROR;
  4022. }
  4023. state = strm.state;
  4024. if ((state.wrap & 2) === 0) {
  4025. return Z_STREAM_ERROR;
  4026. }
  4027. state.head = head;
  4028. head.done = false;
  4029. return Z_OK;
  4030. }
  4031. function inflateSetDictionary(strm, dictionary) {
  4032. var dictLength = dictionary.length;
  4033. var state;
  4034. var dictid;
  4035. var ret;
  4036. if (!strm || !strm.state) {
  4037. return Z_STREAM_ERROR;
  4038. }
  4039. state = strm.state;
  4040. if (state.wrap !== 0 && state.mode !== DICT) {
  4041. return Z_STREAM_ERROR;
  4042. }
  4043. if (state.mode === DICT) {
  4044. dictid = 1;
  4045. dictid = adler32(dictid, dictionary, dictLength, 0);
  4046. if (dictid !== state.check) {
  4047. return Z_DATA_ERROR;
  4048. }
  4049. }
  4050. ret = updatewindow(strm, dictionary, dictLength, dictLength);
  4051. if (ret) {
  4052. state.mode = MEM;
  4053. return Z_MEM_ERROR;
  4054. }
  4055. state.havedict = 1;
  4056. return Z_OK;
  4057. }
  4058. exports.inflateReset = inflateReset;
  4059. exports.inflateReset2 = inflateReset2;
  4060. exports.inflateResetKeep = inflateResetKeep;
  4061. exports.inflateInit = inflateInit;
  4062. exports.inflateInit2 = inflateInit2;
  4063. exports.inflate = inflate;
  4064. exports.inflateEnd = inflateEnd;
  4065. exports.inflateGetHeader = inflateGetHeader;
  4066. exports.inflateSetDictionary = inflateSetDictionary;
  4067. exports.inflateInfo = "pako inflate (from Nodeca project)";
  4068. }
  4069. });
  4070. // node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/constants.js
  4071. var require_constants = __commonJS({
  4072. "node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/constants.js"(exports, module2) {
  4073. "use strict";
  4074. module2.exports = {
  4075. /* Allowed flush values; see deflate() and inflate() below for details */
  4076. Z_NO_FLUSH: 0,
  4077. Z_PARTIAL_FLUSH: 1,
  4078. Z_SYNC_FLUSH: 2,
  4079. Z_FULL_FLUSH: 3,
  4080. Z_FINISH: 4,
  4081. Z_BLOCK: 5,
  4082. Z_TREES: 6,
  4083. /* Return codes for the compression/decompression functions. Negative values
  4084. * are errors, positive values are used for special but normal events.
  4085. */
  4086. Z_OK: 0,
  4087. Z_STREAM_END: 1,
  4088. Z_NEED_DICT: 2,
  4089. Z_ERRNO: -1,
  4090. Z_STREAM_ERROR: -2,
  4091. Z_DATA_ERROR: -3,
  4092. //Z_MEM_ERROR: -4,
  4093. Z_BUF_ERROR: -5,
  4094. //Z_VERSION_ERROR: -6,
  4095. /* compression levels */
  4096. Z_NO_COMPRESSION: 0,
  4097. Z_BEST_SPEED: 1,
  4098. Z_BEST_COMPRESSION: 9,
  4099. Z_DEFAULT_COMPRESSION: -1,
  4100. Z_FILTERED: 1,
  4101. Z_HUFFMAN_ONLY: 2,
  4102. Z_RLE: 3,
  4103. Z_FIXED: 4,
  4104. Z_DEFAULT_STRATEGY: 0,
  4105. /* Possible values of the data_type field (though see inflate()) */
  4106. Z_BINARY: 0,
  4107. Z_TEXT: 1,
  4108. //Z_ASCII: 1, // = Z_TEXT (deprecated)
  4109. Z_UNKNOWN: 2,
  4110. /* The deflate compression method */
  4111. Z_DEFLATED: 8
  4112. //Z_NULL: null // Use -1 or null inline, depending on var type
  4113. };
  4114. }
  4115. });
  4116. // node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/gzheader.js
  4117. var require_gzheader = __commonJS({
  4118. "node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/gzheader.js"(exports, module2) {
  4119. "use strict";
  4120. function GZheader() {
  4121. this.text = 0;
  4122. this.time = 0;
  4123. this.xflags = 0;
  4124. this.os = 0;
  4125. this.extra = null;
  4126. this.extra_len = 0;
  4127. this.name = "";
  4128. this.comment = "";
  4129. this.hcrc = 0;
  4130. this.done = false;
  4131. }
  4132. module2.exports = GZheader;
  4133. }
  4134. });
  4135. // node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/inflate.js
  4136. var require_inflate2 = __commonJS({
  4137. "node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/inflate.js"(exports) {
  4138. "use strict";
  4139. var zlib_inflate = require_inflate();
  4140. var utils = require_common();
  4141. var strings = require_strings();
  4142. var c = require_constants();
  4143. var msg = require_messages();
  4144. var ZStream = require_zstream();
  4145. var GZheader = require_gzheader();
  4146. var toString = Object.prototype.toString;
  4147. function Inflate(options) {
  4148. if (!(this instanceof Inflate)) return new Inflate(options);
  4149. this.options = utils.assign({
  4150. chunkSize: 16384,
  4151. windowBits: 0,
  4152. to: ""
  4153. }, options || {});
  4154. var opt = this.options;
  4155. if (opt.raw && opt.windowBits >= 0 && opt.windowBits < 16) {
  4156. opt.windowBits = -opt.windowBits;
  4157. if (opt.windowBits === 0) {
  4158. opt.windowBits = -15;
  4159. }
  4160. }
  4161. if (opt.windowBits >= 0 && opt.windowBits < 16 && !(options && options.windowBits)) {
  4162. opt.windowBits += 32;
  4163. }
  4164. if (opt.windowBits > 15 && opt.windowBits < 48) {
  4165. if ((opt.windowBits & 15) === 0) {
  4166. opt.windowBits |= 15;
  4167. }
  4168. }
  4169. this.err = 0;
  4170. this.msg = "";
  4171. this.ended = false;
  4172. this.chunks = [];
  4173. this.strm = new ZStream();
  4174. this.strm.avail_out = 0;
  4175. var status = zlib_inflate.inflateInit2(
  4176. this.strm,
  4177. opt.windowBits
  4178. );
  4179. if (status !== c.Z_OK) {
  4180. throw new Error(msg[status]);
  4181. }
  4182. this.header = new GZheader();
  4183. zlib_inflate.inflateGetHeader(this.strm, this.header);
  4184. if (opt.dictionary) {
  4185. if (typeof opt.dictionary === "string") {
  4186. opt.dictionary = strings.string2buf(opt.dictionary);
  4187. } else if (toString.call(opt.dictionary) === "[object ArrayBuffer]") {
  4188. opt.dictionary = new Uint8Array(opt.dictionary);
  4189. }
  4190. if (opt.raw) {
  4191. status = zlib_inflate.inflateSetDictionary(this.strm, opt.dictionary);
  4192. if (status !== c.Z_OK) {
  4193. throw new Error(msg[status]);
  4194. }
  4195. }
  4196. }
  4197. }
  4198. Inflate.prototype.push = function(data, mode) {
  4199. var strm = this.strm;
  4200. var chunkSize = this.options.chunkSize;
  4201. var dictionary = this.options.dictionary;
  4202. var status, _mode;
  4203. var next_out_utf8, tail, utf8str;
  4204. var allowBufError = false;
  4205. if (this.ended) {
  4206. return false;
  4207. }
  4208. _mode = mode === ~~mode ? mode : mode === true ? c.Z_FINISH : c.Z_NO_FLUSH;
  4209. if (typeof data === "string") {
  4210. strm.input = strings.binstring2buf(data);
  4211. } else if (toString.call(data) === "[object ArrayBuffer]") {
  4212. strm.input = new Uint8Array(data);
  4213. } else {
  4214. strm.input = data;
  4215. }
  4216. strm.next_in = 0;
  4217. strm.avail_in = strm.input.length;
  4218. do {
  4219. if (strm.avail_out === 0) {
  4220. strm.output = new utils.Buf8(chunkSize);
  4221. strm.next_out = 0;
  4222. strm.avail_out = chunkSize;
  4223. }
  4224. status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH);
  4225. if (status === c.Z_NEED_DICT && dictionary) {
  4226. status = zlib_inflate.inflateSetDictionary(this.strm, dictionary);
  4227. }
  4228. if (status === c.Z_BUF_ERROR && allowBufError === true) {
  4229. status = c.Z_OK;
  4230. allowBufError = false;
  4231. }
  4232. if (status !== c.Z_STREAM_END && status !== c.Z_OK) {
  4233. this.onEnd(status);
  4234. this.ended = true;
  4235. return false;
  4236. }
  4237. if (strm.next_out) {
  4238. if (strm.avail_out === 0 || status === c.Z_STREAM_END || strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH)) {
  4239. if (this.options.to === "string") {
  4240. next_out_utf8 = strings.utf8border(strm.output, strm.next_out);
  4241. tail = strm.next_out - next_out_utf8;
  4242. utf8str = strings.buf2string(strm.output, next_out_utf8);
  4243. strm.next_out = tail;
  4244. strm.avail_out = chunkSize - tail;
  4245. if (tail) {
  4246. utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0);
  4247. }
  4248. this.onData(utf8str);
  4249. } else {
  4250. this.onData(utils.shrinkBuf(strm.output, strm.next_out));
  4251. }
  4252. }
  4253. }
  4254. if (strm.avail_in === 0 && strm.avail_out === 0) {
  4255. allowBufError = true;
  4256. }
  4257. } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END);
  4258. if (status === c.Z_STREAM_END) {
  4259. _mode = c.Z_FINISH;
  4260. }
  4261. if (_mode === c.Z_FINISH) {
  4262. status = zlib_inflate.inflateEnd(this.strm);
  4263. this.onEnd(status);
  4264. this.ended = true;
  4265. return status === c.Z_OK;
  4266. }
  4267. if (_mode === c.Z_SYNC_FLUSH) {
  4268. this.onEnd(c.Z_OK);
  4269. strm.avail_out = 0;
  4270. return true;
  4271. }
  4272. return true;
  4273. };
  4274. Inflate.prototype.onData = function(chunk) {
  4275. this.chunks.push(chunk);
  4276. };
  4277. Inflate.prototype.onEnd = function(status) {
  4278. if (status === c.Z_OK) {
  4279. if (this.options.to === "string") {
  4280. this.result = this.chunks.join("");
  4281. } else {
  4282. this.result = utils.flattenChunks(this.chunks);
  4283. }
  4284. }
  4285. this.chunks = [];
  4286. this.err = status;
  4287. this.msg = this.strm.msg;
  4288. };
  4289. function inflate(input, options) {
  4290. var inflator = new Inflate(options);
  4291. inflator.push(input, true);
  4292. if (inflator.err) {
  4293. throw inflator.msg || msg[inflator.err];
  4294. }
  4295. return inflator.result;
  4296. }
  4297. function inflateRaw(input, options) {
  4298. options = options || {};
  4299. options.raw = true;
  4300. return inflate(input, options);
  4301. }
  4302. exports.Inflate = Inflate;
  4303. exports.inflate = inflate;
  4304. exports.inflateRaw = inflateRaw;
  4305. exports.ungzip = inflate;
  4306. }
  4307. });
  4308. // node_modules/.pnpm/pako@1.0.11/node_modules/pako/index.js
  4309. var require_pako = __commonJS({
  4310. "node_modules/.pnpm/pako@1.0.11/node_modules/pako/index.js"(exports, module2) {
  4311. "use strict";
  4312. var assign = require_common().assign;
  4313. var deflate = require_deflate2();
  4314. var inflate = require_inflate2();
  4315. var constants = require_constants();
  4316. var pako5 = {};
  4317. assign(pako5, deflate, inflate, constants);
  4318. module2.exports = pako5;
  4319. }
  4320. });
  4321. // src/main.ts
  4322. var main_exports = {};
  4323. __export(main_exports, {
  4324. default: () => BetterExportPdfPlugin
  4325. });
  4326. module.exports = __toCommonJS(main_exports);
  4327. var import_obsidian5 = require("obsidian");
  4328. // src/i18n/index.ts
  4329. var import_deepmerge = __toESM(require_cjs());
  4330. // src/i18n/en.ts
  4331. var en_default = {
  4332. exportCurrentFile: "Export current file to PDF",
  4333. exportCurrentFileWithPrevious: "Export to PDF with previous Settings",
  4334. exportDialog: {
  4335. filenameAsTitle: "Include file name as title",
  4336. pageSize: "Page Size",
  4337. margin: "Margin",
  4338. downscalePercent: "Downscale Percent",
  4339. landscape: "Landscape",
  4340. displayHeader: "Display Header",
  4341. displayFooter: "Display Footer",
  4342. openAfterExport: "Open after export",
  4343. cssSnippets: "CSS snippets"
  4344. },
  4345. settings: {
  4346. showTitle: "Add file name as title",
  4347. displayHeader: "Display headers",
  4348. displayFooter: "Display footer",
  4349. printBackground: "Print background",
  4350. maxLevel: "Max headings level of the outline",
  4351. displayMetadata: "PDF metadata",
  4352. headerTemplate: "Header Template",
  4353. footerTemplate: "Footer Template",
  4354. isTimestamp: "Add timestamp",
  4355. enabledCss: "Enable select css snippets",
  4356. debugMode: "Debug Mode"
  4357. }
  4358. };
  4359. // src/i18n/zh.ts
  4360. var zh_default = {
  4361. exportCurrentFile: "\u5BFC\u51FA\u5F53\u524D\u6587\u4EF6\u4E3APDF",
  4362. exportCurrentFileWithPrevious: "\u4F7F\u7528\u4E0A\u4E00\u6B21\u8BBE\u7F6E\u5BFC\u51FA\u4E3APDF",
  4363. exportDialog: {
  4364. filenameAsTitle: "\u5C06\u7B14\u8BB0\u540D\u4F5C\u4E3A\u6807\u9898",
  4365. pageSize: "\u7EB8\u5F20\u5C3A\u5BF8",
  4366. margin: "\u9875\u8FB9\u8DDD",
  4367. downscalePercent: "\u7F29\u653E",
  4368. landscape: "\u6A2A\u5411\u6253\u5370",
  4369. displayHeader: "\u9875\u7709",
  4370. displayFooter: "\u9875\u811A",
  4371. openAfterExport: "\u5BFC\u51FA\u540E\u6253\u5F00",
  4372. cssSnippets: "CSS\u4EE3\u7801\u7247\u6BB5"
  4373. },
  4374. settings: {
  4375. showTitle: "\u5C06\u7B14\u8BB0\u540D\u4F5C\u4E3A\u6807\u9898",
  4376. displayHeader: "\u663E\u793A\u9875\u7709",
  4377. displayFooter: "\u663E\u793A\u9875\u811A",
  4378. printBackground: "\u6253\u5370\u80CC\u666F",
  4379. maxLevel: "\u6700\u5927\u6807\u9898\u7EA7\u522B",
  4380. displayMetadata: "PDF\u5143\u6570\u636E",
  4381. headerTemplate: "\u9875\u7709\u6A21\u677F",
  4382. footerTemplate: "\u9875\u811A\u6A21\u677F",
  4383. isTimestamp: "\u6587\u4EF6\u540D\u6DFB\u52A0\u65F6\u95F4\u6233",
  4384. enabledCss: "\u542F\u7528CSS\u7247\u6BB5\u9009\u62E9",
  4385. debugMode: "\u8C03\u8BD5\u6A21\u5F0F"
  4386. }
  4387. };
  4388. // src/i18n/index.ts
  4389. var i18n_default = {
  4390. i18n: {
  4391. en: en_default,
  4392. zh: zh_default
  4393. },
  4394. get current() {
  4395. var _a, _b;
  4396. const lang = (_a = window.localStorage.getItem("language")) != null ? _a : "en";
  4397. return (0, import_deepmerge.default)(this.i18n.en, (_b = this.i18n[lang]) != null ? _b : {});
  4398. }
  4399. };
  4400. // src/modal.ts
  4401. var fs2 = __toESM(require("fs/promises"));
  4402. var import_obsidian3 = require("obsidian");
  4403. var import_path = __toESM(require("path"));
  4404. // src/constant.ts
  4405. var PageSize = {
  4406. A0: [841, 1189],
  4407. A1: [594, 841],
  4408. A2: [420, 594],
  4409. A3: [297, 420],
  4410. A4: [210, 297],
  4411. A5: [148, 210],
  4412. A6: [105, 148],
  4413. Legal: [216, 356],
  4414. Letter: [216, 279],
  4415. Tabloid: [279, 432],
  4416. Ledger: [432, 279]
  4417. };
  4418. // src/pdf.ts
  4419. var import_electron = __toESM(require("electron"));
  4420. var fs = __toESM(require("fs/promises"));
  4421. // node_modules/.pnpm/tslib@1.14.1/node_modules/tslib/tslib.es6.js
  4422. var extendStatics = function(d, b) {
  4423. extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
  4424. d2.__proto__ = b2;
  4425. } || function(d2, b2) {
  4426. for (var p in b2) if (b2.hasOwnProperty(p)) d2[p] = b2[p];
  4427. };
  4428. return extendStatics(d, b);
  4429. };
  4430. function __extends(d, b) {
  4431. extendStatics(d, b);
  4432. function __() {
  4433. this.constructor = d;
  4434. }
  4435. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  4436. }
  4437. var __assign = function() {
  4438. __assign = Object.assign || function __assign2(t) {
  4439. for (var s, i = 1, n = arguments.length; i < n; i++) {
  4440. s = arguments[i];
  4441. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  4442. }
  4443. return t;
  4444. };
  4445. return __assign.apply(this, arguments);
  4446. };
  4447. function __rest(s, e) {
  4448. var t = {};
  4449. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  4450. t[p] = s[p];
  4451. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  4452. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
  4453. if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
  4454. t[p[i]] = s[p[i]];
  4455. }
  4456. return t;
  4457. }
  4458. function __awaiter(thisArg, _arguments, P, generator) {
  4459. function adopt(value) {
  4460. return value instanceof P ? value : new P(function(resolve) {
  4461. resolve(value);
  4462. });
  4463. }
  4464. return new (P || (P = Promise))(function(resolve, reject) {
  4465. function fulfilled(value) {
  4466. try {
  4467. step(generator.next(value));
  4468. } catch (e) {
  4469. reject(e);
  4470. }
  4471. }
  4472. function rejected(value) {
  4473. try {
  4474. step(generator["throw"](value));
  4475. } catch (e) {
  4476. reject(e);
  4477. }
  4478. }
  4479. function step(result) {
  4480. result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
  4481. }
  4482. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4483. });
  4484. }
  4485. function __generator(thisArg, body) {
  4486. var _ = { label: 0, sent: function() {
  4487. if (t[0] & 1) throw t[1];
  4488. return t[1];
  4489. }, trys: [], ops: [] }, f, y, t, g;
  4490. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
  4491. return this;
  4492. }), g;
  4493. function verb(n) {
  4494. return function(v) {
  4495. return step([n, v]);
  4496. };
  4497. }
  4498. function step(op) {
  4499. if (f) throw new TypeError("Generator is already executing.");
  4500. while (_) try {
  4501. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
  4502. if (y = 0, t) op = [op[0] & 2, t.value];
  4503. switch (op[0]) {
  4504. case 0:
  4505. case 1:
  4506. t = op;
  4507. break;
  4508. case 4:
  4509. _.label++;
  4510. return { value: op[1], done: false };
  4511. case 5:
  4512. _.label++;
  4513. y = op[1];
  4514. op = [0];
  4515. continue;
  4516. case 7:
  4517. op = _.ops.pop();
  4518. _.trys.pop();
  4519. continue;
  4520. default:
  4521. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
  4522. _ = 0;
  4523. continue;
  4524. }
  4525. if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
  4526. _.label = op[1];
  4527. break;
  4528. }
  4529. if (op[0] === 6 && _.label < t[1]) {
  4530. _.label = t[1];
  4531. t = op;
  4532. break;
  4533. }
  4534. if (t && _.label < t[2]) {
  4535. _.label = t[2];
  4536. _.ops.push(op);
  4537. break;
  4538. }
  4539. if (t[2]) _.ops.pop();
  4540. _.trys.pop();
  4541. continue;
  4542. }
  4543. op = body.call(thisArg, _);
  4544. } catch (e) {
  4545. op = [6, e];
  4546. y = 0;
  4547. } finally {
  4548. f = t = 0;
  4549. }
  4550. if (op[0] & 5) throw op[1];
  4551. return { value: op[0] ? op[1] : void 0, done: true };
  4552. }
  4553. }
  4554. function __spreadArrays() {
  4555. for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
  4556. for (var r = Array(s), k = 0, i = 0; i < il; i++)
  4557. for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
  4558. r[k] = a[j];
  4559. return r;
  4560. }
  4561. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/utils/base64.js
  4562. var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  4563. var lookup = new Uint8Array(256);
  4564. for (i = 0; i < chars.length; i++) {
  4565. lookup[chars.charCodeAt(i)] = i;
  4566. }
  4567. var i;
  4568. var encodeToBase64 = function(bytes) {
  4569. var base64 = "";
  4570. var len = bytes.length;
  4571. for (var i = 0; i < len; i += 3) {
  4572. base64 += chars[bytes[i] >> 2];
  4573. base64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];
  4574. base64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];
  4575. base64 += chars[bytes[i + 2] & 63];
  4576. }
  4577. if (len % 3 === 2) {
  4578. base64 = base64.substring(0, base64.length - 1) + "=";
  4579. } else if (len % 3 === 1) {
  4580. base64 = base64.substring(0, base64.length - 2) + "==";
  4581. }
  4582. return base64;
  4583. };
  4584. var decodeFromBase64 = function(base64) {
  4585. var bufferLength = base64.length * 0.75;
  4586. var len = base64.length;
  4587. var i;
  4588. var p = 0;
  4589. var encoded1;
  4590. var encoded2;
  4591. var encoded3;
  4592. var encoded4;
  4593. if (base64[base64.length - 1] === "=") {
  4594. bufferLength--;
  4595. if (base64[base64.length - 2] === "=") {
  4596. bufferLength--;
  4597. }
  4598. }
  4599. var bytes = new Uint8Array(bufferLength);
  4600. for (i = 0; i < len; i += 4) {
  4601. encoded1 = lookup[base64.charCodeAt(i)];
  4602. encoded2 = lookup[base64.charCodeAt(i + 1)];
  4603. encoded3 = lookup[base64.charCodeAt(i + 2)];
  4604. encoded4 = lookup[base64.charCodeAt(i + 3)];
  4605. bytes[p++] = encoded1 << 2 | encoded2 >> 4;
  4606. bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;
  4607. bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;
  4608. }
  4609. return bytes;
  4610. };
  4611. var DATA_URI_PREFIX_REGEX = /^(data)?:?([\w\/\+]+)?;?(charset=[\w-]+|base64)?.*,/i;
  4612. var decodeFromBase64DataUri = function(dataUri) {
  4613. var trimmedUri = dataUri.trim();
  4614. var prefix = trimmedUri.substring(0, 100);
  4615. var res = prefix.match(DATA_URI_PREFIX_REGEX);
  4616. if (!res)
  4617. return decodeFromBase64(trimmedUri);
  4618. var fullMatch = res[0];
  4619. var data = trimmedUri.substring(fullMatch.length);
  4620. return decodeFromBase64(data);
  4621. };
  4622. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/utils/strings.js
  4623. var toCharCode = function(character) {
  4624. return character.charCodeAt(0);
  4625. };
  4626. var toCodePoint = function(character) {
  4627. return character.codePointAt(0);
  4628. };
  4629. var toHexStringOfMinLength = function(num, minLength) {
  4630. return padStart(num.toString(16), minLength, "0").toUpperCase();
  4631. };
  4632. var toHexString = function(num) {
  4633. return toHexStringOfMinLength(num, 2);
  4634. };
  4635. var charFromCode = function(code) {
  4636. return String.fromCharCode(code);
  4637. };
  4638. var charFromHexCode = function(hex) {
  4639. return charFromCode(parseInt(hex, 16));
  4640. };
  4641. var padStart = function(value, length, padChar) {
  4642. var padding = "";
  4643. for (var idx = 0, len = length - value.length; idx < len; idx++) {
  4644. padding += padChar;
  4645. }
  4646. return padding + value;
  4647. };
  4648. var copyStringIntoBuffer = function(str, buffer, offset) {
  4649. var length = str.length;
  4650. for (var idx = 0; idx < length; idx++) {
  4651. buffer[offset++] = str.charCodeAt(idx);
  4652. }
  4653. return length;
  4654. };
  4655. var escapeRegExp = function(str) {
  4656. return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
  4657. };
  4658. var cleanText = function(text) {
  4659. return text.replace(/\t|\u0085|\u2028|\u2029/g, " ").replace(/[\b\v]/g, "");
  4660. };
  4661. var escapedNewlineChars = ["\\n", "\\f", "\\r", "\\u000B"];
  4662. var isNewlineChar = function(text) {
  4663. return /^[\n\f\r\u000B]$/.test(text);
  4664. };
  4665. var lineSplit = function(text) {
  4666. return text.split(/[\n\f\r\u000B]/);
  4667. };
  4668. var mergeLines = function(text) {
  4669. return text.replace(/[\n\f\r\u000B]/g, " ");
  4670. };
  4671. var charAtIndex = function(text, index) {
  4672. var cuFirst = text.charCodeAt(index);
  4673. var cuSecond;
  4674. var nextIndex = index + 1;
  4675. var length = 1;
  4676. if (
  4677. // Check if it's the start of a surrogate pair.
  4678. cuFirst >= 55296 && cuFirst <= 56319 && // high surrogate
  4679. text.length > nextIndex
  4680. ) {
  4681. cuSecond = text.charCodeAt(nextIndex);
  4682. if (cuSecond >= 56320 && cuSecond <= 57343)
  4683. length = 2;
  4684. }
  4685. return [text.slice(index, index + length), length];
  4686. };
  4687. var charSplit = function(text) {
  4688. var chars3 = [];
  4689. for (var idx = 0, len = text.length; idx < len; ) {
  4690. var _a = charAtIndex(text, idx), c = _a[0], cLen = _a[1];
  4691. chars3.push(c);
  4692. idx += cLen;
  4693. }
  4694. return chars3;
  4695. };
  4696. var buildWordBreakRegex = function(wordBreaks) {
  4697. var newlineCharUnion = escapedNewlineChars.join("|");
  4698. var escapedRules = ["$"];
  4699. for (var idx = 0, len = wordBreaks.length; idx < len; idx++) {
  4700. var wordBreak = wordBreaks[idx];
  4701. if (isNewlineChar(wordBreak)) {
  4702. throw new TypeError("`wordBreak` must not include " + newlineCharUnion);
  4703. }
  4704. escapedRules.push(wordBreak === "" ? "." : escapeRegExp(wordBreak));
  4705. }
  4706. var breakRules = escapedRules.join("|");
  4707. return new RegExp("(" + newlineCharUnion + ")|((.*?)(" + breakRules + "))", "gm");
  4708. };
  4709. var breakTextIntoLines = function(text, wordBreaks, maxWidth, computeWidthOfText) {
  4710. var regex = buildWordBreakRegex(wordBreaks);
  4711. var words = cleanText(text).match(regex);
  4712. var currLine = "";
  4713. var currWidth = 0;
  4714. var lines = [];
  4715. var pushCurrLine = function() {
  4716. if (currLine !== "")
  4717. lines.push(currLine);
  4718. currLine = "";
  4719. currWidth = 0;
  4720. };
  4721. for (var idx = 0, len = words.length; idx < len; idx++) {
  4722. var word = words[idx];
  4723. if (isNewlineChar(word)) {
  4724. pushCurrLine();
  4725. } else {
  4726. var width = computeWidthOfText(word);
  4727. if (currWidth + width > maxWidth)
  4728. pushCurrLine();
  4729. currLine += word;
  4730. currWidth += width;
  4731. }
  4732. }
  4733. pushCurrLine();
  4734. return lines;
  4735. };
  4736. var dateRegex = /^D:(\d\d\d\d)(\d\d)?(\d\d)?(\d\d)?(\d\d)?(\d\d)?([+\-Z])?(\d\d)?'?(\d\d)?'?$/;
  4737. var parseDate = function(dateStr) {
  4738. var match = dateStr.match(dateRegex);
  4739. if (!match)
  4740. return void 0;
  4741. var year = match[1], _a = match[2], month = _a === void 0 ? "01" : _a, _b = match[3], day = _b === void 0 ? "01" : _b, _c = match[4], hours = _c === void 0 ? "00" : _c, _d = match[5], mins = _d === void 0 ? "00" : _d, _e = match[6], secs = _e === void 0 ? "00" : _e, _f = match[7], offsetSign = _f === void 0 ? "Z" : _f, _g = match[8], offsetHours = _g === void 0 ? "00" : _g, _h = match[9], offsetMins = _h === void 0 ? "00" : _h;
  4742. var tzOffset = offsetSign === "Z" ? "Z" : "" + offsetSign + offsetHours + ":" + offsetMins;
  4743. var date = /* @__PURE__ */ new Date(year + "-" + month + "-" + day + "T" + hours + ":" + mins + ":" + secs + tzOffset);
  4744. return date;
  4745. };
  4746. var findLastMatch = function(value, regex) {
  4747. var _a;
  4748. var position = 0;
  4749. var lastMatch;
  4750. while (position < value.length) {
  4751. var match = value.substring(position).match(regex);
  4752. if (!match)
  4753. return { match: lastMatch, pos: position };
  4754. lastMatch = match;
  4755. position += ((_a = match.index) !== null && _a !== void 0 ? _a : 0) + match[0].length;
  4756. }
  4757. return { match: lastMatch, pos: position };
  4758. };
  4759. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/utils/arrays.js
  4760. var last = function(array) {
  4761. return array[array.length - 1];
  4762. };
  4763. var typedArrayFor = function(value) {
  4764. if (value instanceof Uint8Array)
  4765. return value;
  4766. var length = value.length;
  4767. var typedArray = new Uint8Array(length);
  4768. for (var idx = 0; idx < length; idx++) {
  4769. typedArray[idx] = value.charCodeAt(idx);
  4770. }
  4771. return typedArray;
  4772. };
  4773. var mergeIntoTypedArray = function() {
  4774. var arrays = [];
  4775. for (var _i = 0; _i < arguments.length; _i++) {
  4776. arrays[_i] = arguments[_i];
  4777. }
  4778. var arrayCount = arrays.length;
  4779. var typedArrays = [];
  4780. for (var idx = 0; idx < arrayCount; idx++) {
  4781. var element = arrays[idx];
  4782. typedArrays[idx] = element instanceof Uint8Array ? element : typedArrayFor(element);
  4783. }
  4784. var totalSize = 0;
  4785. for (var idx = 0; idx < arrayCount; idx++) {
  4786. totalSize += arrays[idx].length;
  4787. }
  4788. var merged = new Uint8Array(totalSize);
  4789. var offset = 0;
  4790. for (var arrIdx = 0; arrIdx < arrayCount; arrIdx++) {
  4791. var arr = typedArrays[arrIdx];
  4792. for (var byteIdx = 0, arrLen = arr.length; byteIdx < arrLen; byteIdx++) {
  4793. merged[offset++] = arr[byteIdx];
  4794. }
  4795. }
  4796. return merged;
  4797. };
  4798. var mergeUint8Arrays = function(arrays) {
  4799. var totalSize = 0;
  4800. for (var idx = 0, len = arrays.length; idx < len; idx++) {
  4801. totalSize += arrays[idx].length;
  4802. }
  4803. var mergedBuffer = new Uint8Array(totalSize);
  4804. var offset = 0;
  4805. for (var idx = 0, len = arrays.length; idx < len; idx++) {
  4806. var array = arrays[idx];
  4807. mergedBuffer.set(array, offset);
  4808. offset += array.length;
  4809. }
  4810. return mergedBuffer;
  4811. };
  4812. var arrayAsString = function(array) {
  4813. var str = "";
  4814. for (var idx = 0, len = array.length; idx < len; idx++) {
  4815. str += charFromCode(array[idx]);
  4816. }
  4817. return str;
  4818. };
  4819. var byAscendingId = function(a, b) {
  4820. return a.id - b.id;
  4821. };
  4822. var sortedUniq = function(array, indexer) {
  4823. var uniq = [];
  4824. for (var idx = 0, len = array.length; idx < len; idx++) {
  4825. var curr = array[idx];
  4826. var prev = array[idx - 1];
  4827. if (idx === 0 || indexer(curr) !== indexer(prev)) {
  4828. uniq.push(curr);
  4829. }
  4830. }
  4831. return uniq;
  4832. };
  4833. var reverseArray = function(array) {
  4834. var arrayLen = array.length;
  4835. for (var idx = 0, len = Math.floor(arrayLen / 2); idx < len; idx++) {
  4836. var leftIdx = idx;
  4837. var rightIdx = arrayLen - idx - 1;
  4838. var temp = array[idx];
  4839. array[leftIdx] = array[rightIdx];
  4840. array[rightIdx] = temp;
  4841. }
  4842. return array;
  4843. };
  4844. var sum = function(array) {
  4845. var total = 0;
  4846. for (var idx = 0, len = array.length; idx < len; idx++) {
  4847. total += array[idx];
  4848. }
  4849. return total;
  4850. };
  4851. var range = function(start, end) {
  4852. var arr = new Array(end - start);
  4853. for (var idx = 0, len = arr.length; idx < len; idx++) {
  4854. arr[idx] = start + idx;
  4855. }
  4856. return arr;
  4857. };
  4858. var pluckIndices = function(arr, indices) {
  4859. var plucked = new Array(indices.length);
  4860. for (var idx = 0, len = indices.length; idx < len; idx++) {
  4861. plucked[idx] = arr[indices[idx]];
  4862. }
  4863. return plucked;
  4864. };
  4865. var canBeConvertedToUint8Array = function(input) {
  4866. return input instanceof Uint8Array || input instanceof ArrayBuffer || typeof input === "string";
  4867. };
  4868. var toUint8Array = function(input) {
  4869. if (typeof input === "string") {
  4870. return decodeFromBase64DataUri(input);
  4871. } else if (input instanceof ArrayBuffer) {
  4872. return new Uint8Array(input);
  4873. } else if (input instanceof Uint8Array) {
  4874. return input;
  4875. } else {
  4876. throw new TypeError("`input` must be one of `string | ArrayBuffer | Uint8Array`");
  4877. }
  4878. };
  4879. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/utils/async.js
  4880. var waitForTick = function() {
  4881. return new Promise(function(resolve) {
  4882. setTimeout(function() {
  4883. return resolve();
  4884. }, 0);
  4885. });
  4886. };
  4887. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/utils/unicode.js
  4888. var utf16Encode = function(input, byteOrderMark) {
  4889. if (byteOrderMark === void 0) {
  4890. byteOrderMark = true;
  4891. }
  4892. var encoded = [];
  4893. if (byteOrderMark)
  4894. encoded.push(65279);
  4895. for (var idx = 0, len = input.length; idx < len; ) {
  4896. var codePoint = input.codePointAt(idx);
  4897. if (codePoint < 65536) {
  4898. encoded.push(codePoint);
  4899. idx += 1;
  4900. } else if (codePoint < 1114112) {
  4901. encoded.push(highSurrogate(codePoint), lowSurrogate(codePoint));
  4902. idx += 2;
  4903. } else
  4904. throw new Error("Invalid code point: 0x" + toHexString(codePoint));
  4905. }
  4906. return new Uint16Array(encoded);
  4907. };
  4908. var isWithinBMP = function(codePoint) {
  4909. return codePoint >= 0 && codePoint <= 65535;
  4910. };
  4911. var hasSurrogates = function(codePoint) {
  4912. return codePoint >= 65536 && codePoint <= 1114111;
  4913. };
  4914. var highSurrogate = function(codePoint) {
  4915. return Math.floor((codePoint - 65536) / 1024) + 55296;
  4916. };
  4917. var lowSurrogate = function(codePoint) {
  4918. return (codePoint - 65536) % 1024 + 56320;
  4919. };
  4920. var ByteOrder;
  4921. (function(ByteOrder2) {
  4922. ByteOrder2["BigEndian"] = "BigEndian";
  4923. ByteOrder2["LittleEndian"] = "LittleEndian";
  4924. })(ByteOrder || (ByteOrder = {}));
  4925. var REPLACEMENT = "\uFFFD".codePointAt(0);
  4926. var utf16Decode = function(input, byteOrderMark) {
  4927. if (byteOrderMark === void 0) {
  4928. byteOrderMark = true;
  4929. }
  4930. if (input.length <= 1)
  4931. return String.fromCodePoint(REPLACEMENT);
  4932. var byteOrder = byteOrderMark ? readBOM(input) : ByteOrder.BigEndian;
  4933. var idx = byteOrderMark ? 2 : 0;
  4934. var codePoints = [];
  4935. while (input.length - idx >= 2) {
  4936. var first = decodeValues(input[idx++], input[idx++], byteOrder);
  4937. if (isHighSurrogate(first)) {
  4938. if (input.length - idx < 2) {
  4939. codePoints.push(REPLACEMENT);
  4940. } else {
  4941. var second = decodeValues(input[idx++], input[idx++], byteOrder);
  4942. if (isLowSurrogate(second)) {
  4943. codePoints.push(first, second);
  4944. } else {
  4945. codePoints.push(REPLACEMENT);
  4946. }
  4947. }
  4948. } else if (isLowSurrogate(first)) {
  4949. idx += 2;
  4950. codePoints.push(REPLACEMENT);
  4951. } else {
  4952. codePoints.push(first);
  4953. }
  4954. }
  4955. if (idx < input.length)
  4956. codePoints.push(REPLACEMENT);
  4957. return String.fromCodePoint.apply(String, codePoints);
  4958. };
  4959. var isHighSurrogate = function(codePoint) {
  4960. return codePoint >= 55296 && codePoint <= 56319;
  4961. };
  4962. var isLowSurrogate = function(codePoint) {
  4963. return codePoint >= 56320 && codePoint <= 57343;
  4964. };
  4965. var decodeValues = function(first, second, byteOrder) {
  4966. if (byteOrder === ByteOrder.LittleEndian)
  4967. return second << 8 | first;
  4968. if (byteOrder === ByteOrder.BigEndian)
  4969. return first << 8 | second;
  4970. throw new Error("Invalid byteOrder: " + byteOrder);
  4971. };
  4972. var readBOM = function(bytes) {
  4973. return hasUtf16BigEndianBOM(bytes) ? ByteOrder.BigEndian : hasUtf16LittleEndianBOM(bytes) ? ByteOrder.LittleEndian : ByteOrder.BigEndian;
  4974. };
  4975. var hasUtf16BigEndianBOM = function(bytes) {
  4976. return bytes[0] === 254 && bytes[1] === 255;
  4977. };
  4978. var hasUtf16LittleEndianBOM = function(bytes) {
  4979. return bytes[0] === 255 && bytes[1] === 254;
  4980. };
  4981. var hasUtf16BOM = function(bytes) {
  4982. return hasUtf16BigEndianBOM(bytes) || hasUtf16LittleEndianBOM(bytes);
  4983. };
  4984. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/utils/numbers.js
  4985. var numberToString = function(num) {
  4986. var numStr = String(num);
  4987. if (Math.abs(num) < 1) {
  4988. var e = parseInt(num.toString().split("e-")[1]);
  4989. if (e) {
  4990. var negative = num < 0;
  4991. if (negative)
  4992. num *= -1;
  4993. num *= Math.pow(10, e - 1);
  4994. numStr = "0." + new Array(e).join("0") + num.toString().substring(2);
  4995. if (negative)
  4996. numStr = "-" + numStr;
  4997. }
  4998. } else {
  4999. var e = parseInt(num.toString().split("+")[1]);
  5000. if (e > 20) {
  5001. e -= 20;
  5002. num /= Math.pow(10, e);
  5003. numStr = num.toString() + new Array(e + 1).join("0");
  5004. }
  5005. }
  5006. return numStr;
  5007. };
  5008. var sizeInBytes = function(n) {
  5009. return Math.ceil(n.toString(2).length / 8);
  5010. };
  5011. var bytesFor = function(n) {
  5012. var bytes = new Uint8Array(sizeInBytes(n));
  5013. for (var i = 1; i <= bytes.length; i++) {
  5014. bytes[i - 1] = n >> (bytes.length - i) * 8;
  5015. }
  5016. return bytes;
  5017. };
  5018. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/utils/errors.js
  5019. var error = function(msg) {
  5020. throw new Error(msg);
  5021. };
  5022. // node_modules/.pnpm/@pdf-lib+standard-fonts@1.0.0/node_modules/@pdf-lib/standard-fonts/es/utils.js
  5023. var import_pako = __toESM(require_pako());
  5024. var chars2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  5025. var lookup2 = new Uint8Array(256);
  5026. for (i = 0; i < chars2.length; i++) {
  5027. lookup2[chars2.charCodeAt(i)] = i;
  5028. }
  5029. var i;
  5030. var decodeFromBase642 = function(base64) {
  5031. var bufferLength = base64.length * 0.75;
  5032. var len = base64.length;
  5033. var i;
  5034. var p = 0;
  5035. var encoded1;
  5036. var encoded2;
  5037. var encoded3;
  5038. var encoded4;
  5039. if (base64[base64.length - 1] === "=") {
  5040. bufferLength--;
  5041. if (base64[base64.length - 2] === "=") {
  5042. bufferLength--;
  5043. }
  5044. }
  5045. var bytes = new Uint8Array(bufferLength);
  5046. for (i = 0; i < len; i += 4) {
  5047. encoded1 = lookup2[base64.charCodeAt(i)];
  5048. encoded2 = lookup2[base64.charCodeAt(i + 1)];
  5049. encoded3 = lookup2[base64.charCodeAt(i + 2)];
  5050. encoded4 = lookup2[base64.charCodeAt(i + 3)];
  5051. bytes[p++] = encoded1 << 2 | encoded2 >> 4;
  5052. bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;
  5053. bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;
  5054. }
  5055. return bytes;
  5056. };
  5057. var arrayToString = function(array) {
  5058. var str = "";
  5059. for (var i = 0; i < array.length; i++) {
  5060. str += String.fromCharCode(array[i]);
  5061. }
  5062. return str;
  5063. };
  5064. var decompressJson = function(compressedJson) {
  5065. return arrayToString(import_pako.default.inflate(decodeFromBase642(compressedJson)));
  5066. };
  5067. var padStart2 = function(value, length, padChar) {
  5068. var padding = "";
  5069. for (var idx = 0, len = length - value.length; idx < len; idx++) {
  5070. padding += padChar;
  5071. }
  5072. return padding + value;
  5073. };
  5074. // node_modules/.pnpm/@pdf-lib+standard-fonts@1.0.0/node_modules/@pdf-lib/standard-fonts/es/Courier-Bold.compressed.json
  5075. var Courier_Bold_compressed_default = "eJyFWdtyGjkQ/RVqnnar8Bb4lpg3jEnCxgEvGDtxKg9iphm01oyILrZxKv++mrGd3az6KC8UnNa0+nrUGr5lI11VVLtskF198FaU1Dns9w9OOkf7/ePDrJu90bWbiorCgpH2RpLZO9WqaCReqZ8lnReJqKTa/SwL8DXJctPs9Lxs4oSS+bAuVVjXC7/tG/lAxYV0+SYbOOOpm402wojckVlQ8+T4wVFdUDHXlaifrTs91Q/Z4PNeMLu7t3/U6746POm+7vW/dLNlWGuUrOlCW+mkrrPBXr/X+4/gciPz25qszQbhyeyKjG2XZb3ewR+9Xi/sMdVO5k+ebHemcaHzW/57p3/y+qQbPk967We//TxoP191hoVeUWexs44q25nUuTZbbYSj4o9OZ6hUZ97osZ05WTJ3AQ37jMOqQtblIt9QG7lWycKJuhCmeJGGhSOxffccyqPj/W728eXX4cFJNxvavAmRyQbH++HnGf34vdc/etXNFq54d50NXh+2X6/C137v+CnQH8gZmYdQfP6WXX8MCppQTYMlditCBL53/wfTQ65EFeNfvQ6erlQsqX21akJc1rGs0EoJE+NbMnlToZFAVEFkQ3iABW2uGH3CUK1ojUTgMWEbjfaWeUp5G6N5aCwRw5vddkOM98EVqRlPrBJ2E8OPZHSM6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IE+BG1Btp7hjKCjh6UKYt2xk7MkmMJ8PCMlGNy5XiSdvc6wYjYtIp5pSGBRTo9Z45R6Asw4bQ8HgrYhEJmTFsk6pWvyPfJOj4HiXNGFFQJw1hOCVaYgChNUOGcA6tD0DZCMSdDczMBDa5TFVWDqWn5i/yB+BByqARcGhx6ziqXVD4Ii2TqZmnLi8AS3L8dGqRoBIzwkM0LmXNpOAOKTNKbKciPBvg8XdZJ6RDoHEKO5meuGdDzmOiQMTrt0d63SVfAIDBJtgIwwaUvN7ps8l1r7v0I5lKPRUEV+rcqfaHlDvJH4FSdVBVCjk8IiXp87Jv/Ib90s/dk6gshTfPv8Zfv/wDUfBK2";
  5076. // node_modules/.pnpm/@pdf-lib+standard-fonts@1.0.0/node_modules/@pdf-lib/standard-fonts/es/Courier-BoldOblique.compressed.json
  5077. var Courier_BoldOblique_compressed_default = "eJyFWdtyGjkQ/RVqnnarcAo7vuE3jEnCxgEvGDtxKg9iRgxaa0ZEF9s4lX/fnrGdTVZ9lBcKTmvU96PW8C0bmqqStc9OsqsPwYlSdnaPDvb6naP+3v5+1s3emNpPRCVpwdAEq6TdOTW6mC61+hpksyBo/euCTrOg89MKUSm9/XUNwddSletGcbOcfo+90Cof1KWmdTu7e4S4N+pBFhfK5+vsxNsgu9lwLazIvbRz2Tw7evCyLmQxM5Won809PTUP2cnnnYOj7s7eQa97fNjvHvd2v3SzBS21WtXywjjllakbRb3eT4LLtcpva+lcdkJPZlfSunZZ1uu9ftXr9UjFxHiVP7my2drGh84f+Z+d3f5xv0uf/V77udt+vm4/jzqDwixlZ751XlauM65zYzfGCi+LV53OQOvOrNnHdWbSSXtHKOkZ0apC1eU8X8s2dO0mcy/qQtjiRUoLh2Lz7jmWB4cUto8vv/Zf97vZwOVNhGx2crhHP8/kj987uxShbO6Ld9fZyfF++/WKvu72Dp/i/EF6q3IKxedv2fVH2qAJ1YQscRtBEfje/R8sH3Itqhj/Ggx5utSxpA7VsglxWceywmgtbIxvpM2bio0EoiK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XkRGoKQscMigyN+CBGxCx55dc4BXYyDMTyhCSgk7ylkejHzwdkWCAxodEVYIAP6LWQLqnKCPo6EGZckgzdmKaHEuAh2dSeyZXnidpf28SjIhNq5hXGgpYZNJz5giFvgATTsvjVMCWCpkxbZ6oV74i3yfr+BwkzltRyEpYxnKZYIUxiNIYFc45sJqCthaaORmamwlocJOqqBpMTYvf5A/ERyKHSsCl5NBzVrmk8kGYJ1M3TVteEEtw/3YYkKIhMCJANi9UzqXhDGxkk95MQH4MwGfpsk5KB2DPAeRofuaagn0eEx0yQqc90n2bdAUMAuNkKwATfPpyY8om37Xh3o9gLg1YRFuhf6vSF1ruIH8ETtXJrSjk+IRQqMdHofkf8ks3ey9tfSGUbf49/vL9XxrnGMA=";
  5078. // node_modules/.pnpm/@pdf-lib+standard-fonts@1.0.0/node_modules/@pdf-lib/standard-fonts/es/Courier-Oblique.compressed.json
  5079. var Courier_Oblique_compressed_default = "eJyFWVtT2zgU/isZP+3OhE5Iy/UtDaHNFhI2IdDS4UGxFUeLbKW6AKHT/77Hhnbb1fnUFw98x9K5fzpyvmZDU1Wy9tlxdnUenChlZ3e//+awc7B32D/Kutmpqf1EVJJeGJpglbQ706VWX4JshEHrX4Wdn4SiUnr7q5jga6nKdaPvXBYqVISMvdAqH9Slpjd3dvuEuFP1KIsL5fN1duxtkN1suBZW5F7auWxWjx69rAtZzEwl6hc73741j9nx553+QXenv9frHr456h729m672YJetVrV8sI45ZWpG0W93k+Cy7XK72rpXHZMK7MraV37WtbrvX7V6/VIxcR4lT87s9naxovOH/mfnd2jw6MuPY967XO3ffbb5+v2edAZFGYpO/Ot87JynXGdG7sxVnhZvOp0Blp3Zs1urjOTTtp7QknbiN4qVF3O87VsQ9huMveiLoQtvkvpxaHYvH+J6d4+Be/j9//e9Pe72cDlTZxsdrzfP+pmJ/LH/zu7ewfdbO6L99e0crf98+rlzybY59JblVM8Pn/Nrj/S+iZeEzLEbQSF4Vv3f7B8zLWoYvxLMOToUseSOlTLJs5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Bgfv8trTmTtbsHcjKUjkw9b4DyR6nGCVQV/NXkRGoKQscMigyN2DBDYjYy0cu8Als5JkJZQhJQSd5y6PRD56OSDBA40OiKkGAn1BrIN1TlBF09KBMOaQZOzFNjiXAwxOpPZMrz5O0fzAJRsSmVcwnDQUsMuk5c4RCX4AJp+VxKmBLhcyYNk/UK1+RH5J1fAYS560oZCUsY7lMsMIYRGmMCucMWE1BWwvNnAzNzQQ0uElVVA2mpsVv8gfiI5FDJeBScuglq1xS+SDMk6mbpi0viCW4XzsMSNEQGBEgmxcq59JwAjaySW8mID8G4LN0WSelA7DnAHI0P3NNwT5PiQ4ZodMe6b5LugIGgXGyFYAJPn25MWWT79pw30cwlwYsoq3Qr1XpCy13kD8Bp+rkVhRyfEIo1OOj0PwOedvNPkhbXwhlm1+Pb7/9C/NFF2U=";
  5080. // node_modules/.pnpm/@pdf-lib+standard-fonts@1.0.0/node_modules/@pdf-lib/standard-fonts/es/Courier.compressed.json
  5081. var Courier_compressed_default = "eJyFWdtSGzkQ/RXXPO1WmZSBEAJvjnESb8AmGENCKg+ypj3Wohk5ugAmlX9fzUCyW6s+ysuUfVqXvh61Zr4XI1PX1PjiuLg6C05U1Ns/Ojx42TsYHB4eFf3irWn8VNQUB4xMsIpsCwatU1DUSm8T+JpUtW7XP6NShToiEy+0ksOm0nHkIP53b9UDlefKy3Vx7G2gfjFaCyukJzundu74wVNTUnlhatE8a/XmjXkojr/s7O33d/YOBv3D3YP+68HB136xiEOtVg2dG6e8Mk1xvLM7GPxHcLlW8rYh54rjOLO4Iuu6YcVgsP9iMBjELabGK/lkymZrWxt6f8g/e7tHr4/68Xk06J673XOve+53z8PesDRL6s23zlPtepNGGrsxVngqX/R6Q617F+1qrndBjuxdRONu4ziqVE01l2vqHNgtMveiKYUtf0rjwJHYvH/26MGrvX7x6ee/l3uv+sXQydZPtjh+tXfUL07o1/+d3YPDfjH35fvrOHO3+3n1/LN19hl5q2T0x5fvxfWnOL/11zQq4jYiuuFH/38wPU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FDhoAhZq37zFhoF7/ba05pYa9g5kqVIOdL3vQLAnOUYJsar5q8gY5JQFBhnkmRsw4QZ47PklF3gFNvZMhzKCpKCzvOVR6wdPRyQYovYhk5XAwY+oNNDeMxQRdPSgSDm0MzZilm1LgIUnpD0TK8+TtL83GUbEqtXMKw0FNDL5PnOMXF+CDqfj8ZjANiYyo9o8k698Rn7I5vEpCJy3oqRaWEZzyrDCBHhpghLnFGgdnbYWmjkZ2psJKHCTy6gGdE2L38QP+IeQQRXg0mjQc1S5oPJOmGdDN8trXkaW4L52GBCiEVAiQDYvleTCcAIWsllrpiA+BuAX+bTOSodgzSHkaL7nmoF1HjMVMkanPdr7NmsKaAQm2VIAKvj85cZUbbwbw70fwVwasCguhb5W5S+03EH+CIxqsktFl+MTQqEaH4f2O+TXfvGBbHMulG2/Hn/98Q/b2xEO";
  5082. // node_modules/.pnpm/@pdf-lib+standard-fonts@1.0.0/node_modules/@pdf-lib/standard-fonts/es/Helvetica-Bold.compressed.json
  5083. var Helvetica_Bold_compressed_default = "eJyNnVtzG0eyrf8KA0/7RMhzJJK6+U2+zMX2mJYsEuJMzANEtihsgYQMEITaO/Z/P41CV+bKlaug86JQf6uArsrKXNVX8H8m3y9vb7u7+8m3k4t/btazm+7o5PmTZy+PTl88eXk6eTT56/Lu/tfZbTc0+Hu3eOju51ezb75bLq532maxYO2oarPb+aJndRCm3fzm425/Y8N/3M8W86tXdzeLoeXjYXv91/mX7vq3+f3Vx8m396tN92jy/cfZanZ1361+73af/PHLfXd33V2/Wd7O7sY+fvfd8svk239/8+T540ffHB+/ePTk8eOTRy+fHf/n0eR8aLxazO+635br+f18eTf59ptBBuHtx/nVp7tuvZ58+3TgF91qXZpNHj8+/svjx4+Hnfy6HAawG8z3y8/9ajeGo/+6+j9HT16+ePpo9+/z8u/L3b8vH5d/nx+9ul6+745+79f33e366B93V8vV5+Vqdt9d/+Xo6NVicfRm9z3rozfduls9DNTDOF8fzY7uV7Pr7na2+nS0/HD0y/xued9/7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9WCsnvhXzqsdaASRSradaARpTrQ+1Asx/ws/ZWCtAYo71qVb6MA99noc+z0PfmIdezkOv56HP89CLeegb81CK4KltWRE4ikXgHIvAqRWBIy4CV7wInFkROLIiMET1XRdEzCpDlFrGKb+MqyQzMWeaSZRuxjnnTODEMyFmn2FKQb7MQqGAdDBEGWmc0tK5yE0Tc4K6lLPUNEpV45yvJnDShms3TyOi9G1cuyExJ3K+dkNcp7S4dkMCJXe+dhM5pzncpINMR0rJjhLlO0oq5VHPWY8qJT5KnPuocfqjFisAFSqC/C6IiBWkG1KqBpSoIIIkagL1XBZBzZWBMhUHSlwfqHGJgAZVgpQKBSVVK6jnckGVKgYlXTTYgusGNSodlKh6xGtAY1L8OYHnmP+EHAASnlj+k2ccMJ9n/UnzCzQ8hfwnziag+Lzxn+DjTGKn2cUTzt0XHp6UNBB2cMY0pOTfI68nm10mcVyG47gc53GZlsblShqXSXFchmlcxmlc+JJUp2kcX5DiGKOUxxn0NNaopvEGOY45SDTuoMHY//O//w/7Vd1G";
  5084. // node_modules/.pnpm/@pdf-lib+standard-fonts@1.0.0/node_modules/@pdf-lib/standard-fonts/es/Helvetica-BoldOblique.compressed.json
  5085. var Helvetica_BoldOblique_compressed_default = "eJyNnVtzG0eyrf8KA0/7RMhzRIq6+U2+zMX2mJYsEuJMzANEtihsgYQMEITaO/Z/P41CV+bKlaug86JQf6uArsrKXNVX8H8m3y9vb7u7+8m3k4t/btazm+7o+PT0xcnRsxdPXzybPJr8dXl3/+vsthsa/L1bPHT386vZN98tF9dn7xfzPzbdrslmseAmR7smR9Bmdjtf9NxqEKbd/Objbve7Dwzb/7ifLeZXr+5uFkPLb45PBrL+6/xLd/3b/P7q4+Tb+9WmezT5/uNsNbu671a/d7vP/vjlvru77q7fLG9nd2Onv/tu+WXy7b+/OX5++uibk5MXj46Pj08fvXx28p9Hk/Oh8Woxv+t+W67n9/Pl3W5Xjx+D8Pbj/OrTXbdeT759OvCLbrUuzSaPH5/85fHjx8NOfl0OQ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Z1/PfGteNPxITkV8HQz8gE9CRAZESj+i2vOquUAquNwRD9dtoWhnRpxa95mP942THgrnXeb7Xbb9NitMNZtdtNtttAtDm0/kN0VZL/vULbirY2C4nN1e5RvdBSe7nHsaXquruB416MguqNRGN3M6MdaeeJbMa96rBVAItV6qhWgMdX6UCvA/Cf8nI21AiTmWJ9qpQ/z0Od56PM89I156OU89Hoe+jwPvZiHvjEPpQie2pYVgaNYBM6xCJxaETjiInDFi8CZFYEjKwJDVN91QcSsMkSpZZzyy7hKMhNzpplE6Wacc84ETjwTYvYZphTkyywUCkgHQ5SRxiktnYvcNDEnqEs5S02jVDXO+WoCJ224dvM0IkrfxrUbEnMi52s3xHVKi2s3JFBy52s3kXOaw006yHSklOwoUb6jpFIe9Zz1qFLio8S5jxqnP2qxAlChIsjvgohYQbohpWpAiQoiSKImUM9lEdRcGShTcaDE9YEalwhoUCVIqVBQUrWCei4XVKliUNJFgy24blCj0kGJqke8BjQmxZ8TeI75T8gBIOGJ5T95xgHzedafNL9Aw1PIf+JsAorPG/8JPs4kdppdPOHcfeHhSUkDYQdnTENK/j3yerLZZRLHZTiOy3Eel2lpXK6kcZkUx2WYxmWcxoUvSXWaxvEFKY4xSnmcQU9jjWoab5DjmINE4w4ajP0///v/AGoZ428=";
  5086. // node_modules/.pnpm/@pdf-lib+standard-fonts@1.0.0/node_modules/@pdf-lib/standard-fonts/es/Helvetica-Oblique.compressed.json
  5087. var Helvetica_Oblique_compressed_default = "eJyNnVtzG8mxrf+KAk/nRGh8eBWleZPnItsaD0dXWNvhB5BsUdgC0TLAFgjt2P/9AI2uzJUrV7X8olB/q4CuyspaVX0p8H8mP7V3d83yfvLj5P3fu/Xstnl0fPbsydGjJ89Oz55MHk9+bZf3v8/uml2BvzSLr839/Hr2w+XVYv7vrtnL3WLB8iOQZ3fzxZYL7IRpM7/9tD/r35ubeXe3I3+9ny3m18+Xt4td2R+OT3Zk/ev8obn5Y35//Wny4/2qax5Pfvo0W82u75vVm2b/6V8e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irbzhaFts1Y9yndV+oi3bqtNcE71daBtt1VncGLQNtmrIly9D9PGBxAkhalN6IMFcNVg9kGCJmp4fSLDA3cEPJBhTHNLSlWIhinJOGqfEdD4SC5GiLuU8Na0Sp5SxJtTi1ApUaaDMYhPrDeF8Nq6T2uRaWzi9jVf6NiU6vDINuY6UIoASZTxKKj6o5xChSlFCiSOBGncsanEMoEKhUr+rkYOlP8DjASUaEkEaD5YYGEHNYwPleizTCEFtJJatpvW2y9GC+mgDecygpIcNlhhpIw8elOpJwUPoW1mvnttRXIN/C+tVQHkN/o3Xq0Bxveo4Ls2/xfWqM1qafyvrVT/KdW4rFWxlBdtck7RedUXU0derjuK1wjeciRhR/dNMlLhonJqJkpT7Ic1EzLm1eSYioRWo0kDZS2omYqlS2Uqn5ZmIBeq+NBMNvNyvUoiaaJz60Llouom56S7lPjSNwmKc220C92ERWoEqDZR9aGK9IdyHxnUfmlxrC/ehcepD/BWkGqamBo36M2oiFKFADkeUc98GnUIWNI5LELmfUWwreCQIss9DgfGGct8HTfd/KDLWVs6DoEEu/Ot//z8nhUqv";
  5088. // node_modules/.pnpm/@pdf-lib+standard-fonts@1.0.0/node_modules/@pdf-lib/standard-fonts/es/Helvetica.compressed.json
  5089. var Helvetica_compressed_default = "eJyNnVtzG8mxrf+KAk/nRGh8eBWleZPnItsaj0ZXWNvhB5BsUdgE0TLAFgjt2P/9AI2uzJUrV7X8olB/q4CuyspaVX0p8H8mP7V3d83yfvLj5MPfu/Xspnl0enH05Nmjs6dHz84mjye/tsv732d3za7AX5rF1+Z+fjXb426xUHh2N19shTBt5jef92f5e3M97+525K/3s8X86vnyZrEre7Q7Xv86f2iu/5jfX32e/Hi/6prHk58+z1azq/tm9bbZf/aXh/tmed1cv2nvZsuhbn/+c/sw+fGfPxw/efL4h5OT88fHR0dHj5+dHv/r8eT9rvBqMV82f7Tr+f28XU5+/GEng/Du8/zqdtms15Mfz3f8Q7Na98UmR0cnf9p90e4kv7e7Juyb81P7Zbvat+LR/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FIS1dKRaiKOekcUpM5yOxECnqUs5T0ypxShlrQi1OrUCVBsosNrHeEM5n4zqpTa61hdPbeKVvU6LDK9OQ60gpAihRxqOk4oN6DhGqFCWUOBKocceiFscAKhQq9bsaOVj6AzweUKIhEaTxYImBEdQ8NlCuxzKNENRGYtlqWm+7HC2ojzaQxwxKethgiZE28uBBqZ4UPIS+lfXquR3FNfi3sF4FlNfg33i9ChTXq47j0vxbXK86o6X5t7Je9aNc57ZSwVZWsM01SetVV0Qdfb3qKF4rfMOZiBHVP81EiYvGqZkoSbkf0kzEnFubZyISWoEqDZS9pGYiliqVrXRanolYoO5LM9HAy/0qhaiJxqkPnYumm5ib7lLuQ9MoLMa53SZwHxahFajSQNmHJtYbwn1oXPehybW2cB8apz7EX0GqYWpq0Kg/oyZCEQrkcEQ5923QKWRB47gEkfsZxbaCR4Ig+zwUGG8o933QdP+HImNt5TwIGuTCv/73/wO+9kRf";
  5090. // node_modules/.pnpm/@pdf-lib+standard-fonts@1.0.0/node_modules/@pdf-lib/standard-fonts/es/Times-Bold.compressed.json
  5091. var Times_Bold_compressed_default = "eJyFnVtzG0eShf8KA0+7EfKseJXkN9nj0Vj0yNaNEHZiHkCySWEJsmmAIA1PzH/fRqMr8+TJU9CLQv2dYqMrK/NU9Q349+jH9va2uXsYfT86+8dqOb1u9o72Tw5P9o4PTk72R89Gf2vvHt5Nb5uuwafZbbP87od2frnhq/kc+V7h09vZfI1KB8fN7Prr5jOGRj8/TOezi9d31/Ou1fNue/m32R/N5W+zh4uvo+8fFqvm2ejHr9PF9OKhWXxsNn/50x8Pzd1lc/mhvZ3eDcf1ww/tH6Pv//nd/snLZ98d7L98tv/8+fNnrw6P//Vs9LlrvJjP7prf2uXsYdbejb7/rpNB+PR1dnFz1yyXo++PO37WLJZ9s9Hz5wd/6XbUfci79mF2senIj+39erHpw95/Xfz33v6rl8fPNv++6P99tfn31fP+38P+3xd7ry/b82bv43r50Nwu936+u2gX9+1i+tBc/mVv7/V8vvdhs7f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XThG/z8OQaqwIv+c/xxqLX68CbaPAAYwqVwCpqfbkd7qUCsxXn9RfpWqsXH3Sqhr2+tUn3UBUaeXqk1RTLtSuPin5ujaCqYajqitZf11MqeegYpVGgWs7qlzhpMo6j2242vPVOBWoVPm7rsbJJt9KhOQFu6/GyUa7cyG5Q+VqnFLva8Oc/SLIv9d26N4xnNj1Fxm2l2qMlKATtq+0iji+HBA1fEEgKvaSQMT+OkDk/kpA5OW1gEjtG6oC/jQqr3MasRNnwuIV0CJuvk37KOx3nNpM0mdPdEwnKUDdAMFPCvVb8XpPj6JN9Ehc3+l5uq7T03g9p0d0HadndP2mZ+G6TU/i9ZpHmBS8T1Fvcp/ojsNjNnrnsk/ihsJj8HFHoqt8v+Cx2JJv5WPmFx+NywNs85Hktx5NEcfYxvfRHoN9GDJreNGjpzQcT6FrT7lrT5WuPcmuPeWuPVW79iS69pS79pS79pS7tk5dW4dMW+dMW+dMW1cybS0zba0zbZ0zbS0ybS0ybT3Ce+prHA5A4p76moYDaLynvhbDAQrdU1/jcACK99TXYjj4wscwJuHCR2zJo5MvfDAX4yQvfLCURyxf+CDOYycufEQBRjFdHmCuxlNdHmCJRrZ2eYBlHuN0eYA5jXa6FjAMuXh2cRh1fnYxteexl08uCklkQOW5RaXmPFCPLQqJs0E/tpg0yAn1MKGQVGZUHiUUKuXHjgcJRQvOEvUYoZAoV9RDhF26/Os//w8s8zdF";
  5092. // node_modules/.pnpm/@pdf-lib+standard-fonts@1.0.0/node_modules/@pdf-lib/standard-fonts/es/Times-BoldItalic.compressed.json
  5093. var Times_BoldItalic_compressed_default = "eJyFnV9TG0myxb8K0U/3RjC7NgZj5o0ZZnYGz5pZGyH3bsyDEA3oImhWfxCajf3ut1Xqyjx5Mkt+cbh/p9RdlZV1qrrVJf5T/dg+PjZPi+r76urvy/nortk7PPpwfLh39P7DyUm1X/3cPi0+jR6brsDl5LGZf/dDO735dTGaTsYbdTmdorq3UfdUHj1Opmss0MFhM7m731xwU7Y73pY+fbq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X33wXwvBfw2D/xoH/9UH/zUI/msQ/LVLobVv2JqnKMJcPPgKxiv4oT/++/9jjgIE";
  5094. // node_modules/.pnpm/@pdf-lib+standard-fonts@1.0.0/node_modules/@pdf-lib/standard-fonts/es/Times-Italic.compressed.json
  5095. var Times_Italic_compressed_default = "eJyNnV1320aWtf+KF6/mXcvpsWTJsnPnTtLdsdNx7ESGMb36gpZgmSNKcEhRCjNr/vsLgqhz9tlnFz03XsaziwDqVNWuDxSg/5l919/cdLd3s29n7/+5Wc+vukcnZ2fHZ49On5+dHs8ez/7W3979PL/phgS/LW669Tc/3s2Xi4udslkuUXnkyvxmsdyiNsCmW1x93l3nn93lYnMzkH36l7dXyyHdN0enfzkd2Ppviz+6y18WdxefZ9/erTbd49l3n+er+cVdt/q12/3+hz/uutvL7vJdfzO/ne7wr3/t/5h9+69vjp69ePzN8dHZ46MnR08eP3/+9N+PZ+dD4tVycdv90q8Xd4v+dnexJ09A+O3z4uL6tluvZ9+eDvx9t1qPyWZPnhz/5cmTJ8NFfu7vFhe77HzXf9mudjl59B8X/+/R0Yvnp493/56N/77Y/fviyfjv0/Hfs0cvL/uP3aNft+u77maI0e1Fv/rSr+Z33eVfHj16uVw+erc72/rRu27dre4Hug/mYv1o/uhuNb/sbuar60f9p0c/LW77u+2X7pt/dMOvXv790fz28j/71aPF8OP15uN6cbmYrxbd+i/D7f4wXOZycXv168XnbiyF8S5+vRt+Ml9dFnVI+N38yz+mgnl2+vTx7EM5Ojk5ejx7ub7YhXo1iM8H8fvOjscgz369u/xHM/v26fH43/fDf8+e7cvrn93danExBPRf/zNrPsy+Pd4F9ufhRtZf5kMc//fxHj99+nSPuz8ulvMb4yfHU/LfN/0QqY9LU06fTMrt5ubjrqCubrN22S+X85Xx5+UqX7rVxa6yF+Hs7PlemN8M0nqITr6z8Q7GEs/al/mqu112n2pS/Jnd3ny9O+P62pRnZ6fTr5abtVGL2cXQRuf5Ep+3Xz53tzn5kJVF7zk5LplcL+frz/lu/uxWfab9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L/mI1C9Ff0heriYO/GKL2a5zar3P2l/SsfCr2wi9zUvYX/EY2o8r9sb/ob2SzmP1FfiObNfKX/I1sFthfcOMAI/KXysYBUtlf8EPZJ7HQ2V/0h7JZzP6SPpTNXPtL/lA2C+Qv6UPZxJO/FOH3HCbwF0PkL8bJX5yzv7gi/SWs9KDLRIG9JqrsOFGVvhOTCPeJCdiDopqcKMrJj6JMrhRF9qb4jATKMArsA1FlNyA1eZZ+MFMqVFAvaz9LLpbWp7VwMCfJ1w6sT+skwuPq69M6BftdZX1ay8n70gMdLbAPHnqgI9MkT0wL4yeqyiV/PLAwrpMIr9QL41qt+GZlYVzL7KF6YVyq2U+D/Hst3OitUWCHjSr7LKnJbUkXnjstBo2vbe03DBixW4nY7DVi8RV509BQoxK/G2+YvgVv3L0z8mKakcaPwhf8WyYWVsIxXkHc/UG2/R+tLWT3l9hOQkx3f4LtLKSxv71GGAK0V+7BWvcvjdxjddujh5ToISfaQqL9Bzy2mGhCPNElzMnF9r2s4I/+/b//H63X5Vs=";
  5096. // node_modules/.pnpm/@pdf-lib+standard-fonts@1.0.0/node_modules/@pdf-lib/standard-fonts/es/Times-Roman.compressed.json
  5097. var Times_Roman_compressed_default = "eJyFnVtzG0mOhf+Kgk+7Ee5ZSdbN/aa+ebzuMdvupmjORD9QUlnmmmJpSMoSZ2L++9YNwMEBkn5xuL6TdUkkgLxUFvXv0Y/1/X212o6+H1397XEzv6sOTl6+Onx1cHry6uXJ6MXol3q1fTe/r5oCfyzuq813H+r7+aoVHpdLFA5UmN8vljuUGjitFnef27tIqTfb+XJxc7m6WzbFDpvjzS+L5+r2t8X25vPo++36sXox+vHzfD2/2Vbr36v21J+ft9XqtrrVGzWP9sMP9fPo+398d3R28eK746OLF0eHh4cvLl5d/PliNGkKr5eLVfVbvVlsF/Vq9P13jQzCH58XN19W1WYz+v604VfVetMVGx0eHv+luVBzk3f1dnHT1uTH+mG3bitx8F83/31w9Ori9EX773n376v231eH3b8vu3/PDy5v6+vq4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U/BoYCHkfUTOhQgWlx6cg4FzL0KekKHMuQd6mmEK29Po7Dc9hQaB3hagTpWIF9CexrFdbOnUVgsexqFFbKn2DjPLjKeY2Q8x8h4LkTGcxoZz3lkPMfIeE4i4zmJjF1ojl2s2I5HDIS5eLLlNip40p//+X+DG1I7";
  5098. // node_modules/.pnpm/@pdf-lib+standard-fonts@1.0.0/node_modules/@pdf-lib/standard-fonts/es/Symbol.compressed.json
  5099. var Symbol_compressed_default = "eJx9WFlv2zgQ/iuGnnYBt5DkS85bmk13g27SoEkPbNEHWqIlIhSpklSuov99R7JIkSLtFyGZjxzN8c0h/4oueF1jpqKz6Mt1K1GJZ4s4S+PZYrvdbqJ59J4zdYNqDAfuXuodp52spdSToZrQl6n0KyZl1Sm/xgVpa5BcKURJfs5KCgdj+F++J8+4uCUqr6IzJVo8jy4qJFCusLjD3d27BucE0cGYd+/4c3T2/U2SxfM36XYxT+JtDI8k/jGPPrMCC0oYvuWSKMJZdPYmiWMLuK9I/sCwlNHZCuRfsJD9sSiOk7dxnMFbbrgieefGBW9eROfA7I/8z1myzVbz7rnpn9vuCW/unpvZecF3eHb3IhWu5eyK5Vw0XCCFi7ezc0pnvRo5E1hi8QhCeM0lHCoIK+/yCvdR67zrfd2THPA7VfzzNTrbpv2fX+BPeH8fm2usBMnBg++/oq/forO08+QGNMgGgeG/5wfxYrE4iPFzTlFt5JtkkLeMPIL/EFoNreJBE2vrXReako3YcqvVEXCTKWJdzPS7Gizyjk/mZZvsAKC66d7FCgMtF4NC2eaVqpDyLW+QwIzi/TGoD6tvPQL7BJEPNVKVb39DW2mkJnY5FALyD9eEhU6DL4SPrqTaS0mRrHyDXrHgvpQz7AvVU+CkqgQOnN3zVgSkkFVfKslzQIgfMfPFOBxWRiyDjcs5p5wFIoFr4kImprQrP59WP1ubiVpcCgxlNLq5XC4PwM8Wy77EvSs5ZyU0EpuFaXqAzmlTjVlerzcH8TuskH/4oiLj0WQQ/oWpdXadJAfxZSOJ7exmPfD01lYS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gFYf8sGd8kFrRw4ptuCQagu2lJvwmpXEUu2DNSlOoEf12vY4aXOZkG6WY8OC4hzrwHRcjVhWepjd4KdYKK7jrx5H89WjRxPWoycydlS3jZ/I2VS/G9yp9gB6PG1T1aY4YAp3LfPHPPqABbtFRHS/jf34/T82FAfb";
  5100. // node_modules/.pnpm/@pdf-lib+standard-fonts@1.0.0/node_modules/@pdf-lib/standard-fonts/es/ZapfDingbats.compressed.json
  5101. var ZapfDingbats_compressed_default = "eJxtmNtu20YQhl+F4FULyMGeD7pz3AY1ChtG7NpFA18w1NomIlECSRcxgrx7SVk7+wOdG8H5OJydf2Z2d5gf9cV+t0v9VK/r+6vXsXlOlbHe28paq229qj/t++m62aXZ4J/m8PRb1z9/baZxefK63Z6eXN5dVMvTCh83u277xr/6kLrnl2XNq7TpXnczuZyabdee98/b2VzM/x4/dd/T5qab2pd6PQ2vaVVfvDRD005puE3Lu7eH1HbN9hTjx4/77/X6y5lcnUmjVzHIVVDicVX/1W/SsO36dLMfu6nb9/X6TAoBD+5euvZbn8axXtuZ36dhPJrVQqgPQoh5hev91LWLkIv94W1Ygq9+aX+tZAx2tfz64284/sblN/rqfLP/mqrbt3FKu7G67Nv9cNgPzZQ2H6rz7bb6vLgZq89pTMO/M/xfEqturJpqSM/d7GJIm2oamk3aNcO3av80O5xh3yyKmm1193ZIT02bqovTKjP+MAf++7zsZvZ3276kYyWWXB0z99S18/PbafPHQ71W4fjn/fxnFO+ZvkrT0LVzTr78qB/+nk38bHM9exgP8zr1z9U7jt6840YW5uSJKcZOCaBBnKgm5mU8MVNYyMwWFvO7Ukagkmgg6sDWQ5yFFqjzUrLEaQ3BEmiwNsMSaZS0vgWfOkPHWQowNeTUc0kumnxZvsgPxlGai6VTGUqAVCTQ6QkWnc77DKEiLktSUBJKqHIQZ86d8gCpHYoiEzMsb1ubYy8vW50DChB5ZhGqrijD0EqUIeiaEHIfCg5Kpuu0ApiToaGPSY0uaQsyr65L2oKi1yFt1PLaQ3lzfXTgXodGoJYzglndSLDMPg1sTPJpQJHJigw0QrGERqD9YhyTOgONQDUyuF1zaxuokc/BW2ztXCMrGZ9WMW1oQZHIXWNBkSCfRZEL5BMUiZw6CzVSFCfUSGZFNjIldoKDkonTKQiJIGzWmFd3BizJJ9SINoLDriOfUCOZS+zg+KGD1qGiLNMLxtJD1/ns00ON6EzyUCM6vbxhoBKaqbG3DFQCNiL1iHccBPV0DHhQH/JW8EW90dkyFKGywCJU0WkVSvSGeiSUODWFFD0HYdPQVoiRgfPMA+/nnRgiAyNYSjpWNQcNSMrtFCUH4ZIRpSCWocFCSuhCEY6hoUClc0WC52BJlCYYLQdhN+hygRRRlo5BKRRLS6oihSqh+ZzzRGG1Mo4Iz1LoP0qsxDGFzk0JE42ji0jCPejomJKCuwil4m5CiRMEUMVSzVLDUstSx1Juc0oVWMpqY295qVltmtWmWW2a1aZZbZrVplltmtWmWW2G1WZYbYbVZlhthtVmWG2G1WZYbYbVZlhtltVmWW2W1WZZbZbVZlltltVmWW2W1QYjQCh7E2aAQHeGhCFgPoNoy8KNb2wxBhmGKBxoUZXlLGsLI6AsftEDHV0wIURVbANLcTKlGGBIKPOAxCmhePCKUwFzAmpDFRQvjA9R06Hq8TONvshgKDCuRAZTXigUxjxNFfKRo3CLhnIJBMFRvMZpqpNBMlQJzGT5WFQMVQI/AikPMIhEU1aDjqJvQwmjSHB05cC9jbYwc5UtAHNLhDw41ha+lEqF4JaH3gmB61SYcqInxTDmQK8v08vjqv4zDf1N0w3Lf4A8/vwPpfK11w==";
  5102. // node_modules/.pnpm/@pdf-lib+standard-fonts@1.0.0/node_modules/@pdf-lib/standard-fonts/es/Font.js
  5103. var compressedJsonForFontName = {
  5104. "Courier": Courier_compressed_default,
  5105. "Courier-Bold": Courier_Bold_compressed_default,
  5106. "Courier-Oblique": Courier_Oblique_compressed_default,
  5107. "Courier-BoldOblique": Courier_BoldOblique_compressed_default,
  5108. "Helvetica": Helvetica_compressed_default,
  5109. "Helvetica-Bold": Helvetica_Bold_compressed_default,
  5110. "Helvetica-Oblique": Helvetica_Oblique_compressed_default,
  5111. "Helvetica-BoldOblique": Helvetica_BoldOblique_compressed_default,
  5112. "Times-Roman": Times_Roman_compressed_default,
  5113. "Times-Bold": Times_Bold_compressed_default,
  5114. "Times-Italic": Times_Italic_compressed_default,
  5115. "Times-BoldItalic": Times_BoldItalic_compressed_default,
  5116. "Symbol": Symbol_compressed_default,
  5117. "ZapfDingbats": ZapfDingbats_compressed_default
  5118. };
  5119. var FontNames;
  5120. (function(FontNames2) {
  5121. FontNames2["Courier"] = "Courier";
  5122. FontNames2["CourierBold"] = "Courier-Bold";
  5123. FontNames2["CourierOblique"] = "Courier-Oblique";
  5124. FontNames2["CourierBoldOblique"] = "Courier-BoldOblique";
  5125. FontNames2["Helvetica"] = "Helvetica";
  5126. FontNames2["HelveticaBold"] = "Helvetica-Bold";
  5127. FontNames2["HelveticaOblique"] = "Helvetica-Oblique";
  5128. FontNames2["HelveticaBoldOblique"] = "Helvetica-BoldOblique";
  5129. FontNames2["TimesRoman"] = "Times-Roman";
  5130. FontNames2["TimesRomanBold"] = "Times-Bold";
  5131. FontNames2["TimesRomanItalic"] = "Times-Italic";
  5132. FontNames2["TimesRomanBoldItalic"] = "Times-BoldItalic";
  5133. FontNames2["Symbol"] = "Symbol";
  5134. FontNames2["ZapfDingbats"] = "ZapfDingbats";
  5135. })(FontNames || (FontNames = {}));
  5136. var fontCache = {};
  5137. var Font = (
  5138. /** @class */
  5139. function() {
  5140. function Font2() {
  5141. var _this = this;
  5142. this.getWidthOfGlyph = function(glyphName) {
  5143. return _this.CharWidths[glyphName];
  5144. };
  5145. this.getXAxisKerningForPair = function(leftGlyphName, rightGlyphName) {
  5146. return (_this.KernPairXAmounts[leftGlyphName] || {})[rightGlyphName];
  5147. };
  5148. }
  5149. Font2.load = function(fontName) {
  5150. var cachedFont = fontCache[fontName];
  5151. if (cachedFont)
  5152. return cachedFont;
  5153. var json = decompressJson(compressedJsonForFontName[fontName]);
  5154. var font = Object.assign(new Font2(), JSON.parse(json));
  5155. font.CharWidths = font.CharMetrics.reduce(function(acc, metric) {
  5156. acc[metric.N] = metric.WX;
  5157. return acc;
  5158. }, {});
  5159. font.KernPairXAmounts = font.KernPairs.reduce(function(acc, _a) {
  5160. var name1 = _a[0], name2 = _a[1], width = _a[2];
  5161. if (!acc[name1])
  5162. acc[name1] = {};
  5163. acc[name1][name2] = width;
  5164. return acc;
  5165. }, {});
  5166. fontCache[fontName] = font;
  5167. return font;
  5168. };
  5169. return Font2;
  5170. }()
  5171. );
  5172. // node_modules/.pnpm/@pdf-lib+standard-fonts@1.0.0/node_modules/@pdf-lib/standard-fonts/es/all-encodings.compressed.json
  5173. var all_encodings_compressed_default = "eJztWsuy48iN/Ret74KZfHtX47meqfGjPHaXx4/wgpJ4JbooUU1JVXXb0f9u4JwESF13R7TD29koIpFi8gCJBHDA/Pvm+nraTuPmZ3/f5HHzs7/k8WlzvXS7fvPXp02eqyR/2vRfd2N3gqhUUfm0Od9P236+DoczxLWK66fNpZ93/fkGWaOy5mnTnUR67c57lRaZSItM/tnN/XnsX/DfIqg0JOk8HI4UK4BCAFzG+xWCQgXF02Y3nU4dJJVKKrx5mPgKBVMImOvYXY+QKJRCoHzXzxMErQrap810hqaloioF1e0L5kvFUwqe23Hu+Q+1TinWeZnuMwSKrRRsL8Nn/kOxlYLtOnzFWE1Viqmu/eceVioVaylYe1OwVKilQD0PCYgiLRtVcJz4kEItW13mNLi0UsCVAB77KyxTKeJKEPff3rsREkVcCeLD3He3HqArBV0J6G/v/fU2cK1WH23l0e3c7T71N9uUVv/c5i73bWlVs1Y0u5/3srO7aQb2EPUB+eUTva0TYgG5mGbbzZSUkJTpn75ygF4PThhq1SMGMds4HYZdN54n/rdWc8rv02bfH9I2hbqGsKbPnIYzHSc0qmTIxI6nuwpiAIQmU8F4Gy7jK8RwntAI1v3wedj39FmFECp508s4zUOyGmwpKrwbL8eOIlVU//Yf/S1J9C212Pa/uuSwbVDYlW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oq1dA==";
  5174. // node_modules/.pnpm/@pdf-lib+standard-fonts@1.0.0/node_modules/@pdf-lib/standard-fonts/es/Encoding.js
  5175. var decompressedEncodings = decompressJson(all_encodings_compressed_default);
  5176. var allUnicodeMappings = JSON.parse(decompressedEncodings);
  5177. var Encoding = (
  5178. /** @class */
  5179. /* @__PURE__ */ function() {
  5180. function Encoding2(name, unicodeMappings) {
  5181. var _this = this;
  5182. this.canEncodeUnicodeCodePoint = function(codePoint) {
  5183. return codePoint in _this.unicodeMappings;
  5184. };
  5185. this.encodeUnicodeCodePoint = function(codePoint) {
  5186. var mapped = _this.unicodeMappings[codePoint];
  5187. if (!mapped) {
  5188. var str = String.fromCharCode(codePoint);
  5189. var hexCode = "0x" + padStart2(codePoint.toString(16), 4, "0");
  5190. var msg = _this.name + ' cannot encode "' + str + '" (' + hexCode + ")";
  5191. throw new Error(msg);
  5192. }
  5193. return { code: mapped[0], name: mapped[1] };
  5194. };
  5195. this.name = name;
  5196. this.supportedCodePoints = Object.keys(unicodeMappings).map(Number).sort(function(a, b) {
  5197. return a - b;
  5198. });
  5199. this.unicodeMappings = unicodeMappings;
  5200. }
  5201. return Encoding2;
  5202. }()
  5203. );
  5204. var Encodings = {
  5205. Symbol: new Encoding("Symbol", allUnicodeMappings.symbol),
  5206. ZapfDingbats: new Encoding("ZapfDingbats", allUnicodeMappings.zapfdingbats),
  5207. WinAnsi: new Encoding("WinAnsi", allUnicodeMappings.win1252)
  5208. };
  5209. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/utils/objects.js
  5210. var values = function(obj) {
  5211. return Object.keys(obj).map(function(k) {
  5212. return obj[k];
  5213. });
  5214. };
  5215. var StandardFontValues = values(FontNames);
  5216. var isStandardFont = function(input) {
  5217. return StandardFontValues.includes(input);
  5218. };
  5219. var rectanglesAreEqual = function(a, b) {
  5220. return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
  5221. };
  5222. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/utils/validators.js
  5223. var backtick = function(val) {
  5224. return "`" + val + "`";
  5225. };
  5226. var singleQuote = function(val) {
  5227. return "'" + val + "'";
  5228. };
  5229. var formatValue = function(value) {
  5230. var type = typeof value;
  5231. if (type === "string")
  5232. return singleQuote(value);
  5233. else if (type === "undefined")
  5234. return backtick(value);
  5235. else
  5236. return value;
  5237. };
  5238. var createValueErrorMsg = function(value, valueName, values2) {
  5239. var allowedValues = new Array(values2.length);
  5240. for (var idx = 0, len = values2.length; idx < len; idx++) {
  5241. var v = values2[idx];
  5242. allowedValues[idx] = formatValue(v);
  5243. }
  5244. var joinedValues = allowedValues.join(" or ");
  5245. return backtick(valueName) + " must be one of " + joinedValues + ", but was actually " + formatValue(value);
  5246. };
  5247. var assertIsOneOf = function(value, valueName, allowedValues) {
  5248. if (!Array.isArray(allowedValues)) {
  5249. allowedValues = values(allowedValues);
  5250. }
  5251. for (var idx = 0, len = allowedValues.length; idx < len; idx++) {
  5252. if (value === allowedValues[idx])
  5253. return;
  5254. }
  5255. throw new TypeError(createValueErrorMsg(value, valueName, allowedValues));
  5256. };
  5257. var assertIsOneOfOrUndefined = function(value, valueName, allowedValues) {
  5258. if (!Array.isArray(allowedValues)) {
  5259. allowedValues = values(allowedValues);
  5260. }
  5261. assertIsOneOf(value, valueName, allowedValues.concat(void 0));
  5262. };
  5263. var assertIsSubset = function(values2, valueName, allowedValues) {
  5264. if (!Array.isArray(allowedValues)) {
  5265. allowedValues = values(allowedValues);
  5266. }
  5267. for (var idx = 0, len = values2.length; idx < len; idx++) {
  5268. assertIsOneOf(values2[idx], valueName, allowedValues);
  5269. }
  5270. };
  5271. var getType = function(val) {
  5272. if (val === null)
  5273. return "null";
  5274. if (val === void 0)
  5275. return "undefined";
  5276. if (typeof val === "string")
  5277. return "string";
  5278. if (isNaN(val))
  5279. return "NaN";
  5280. if (typeof val === "number")
  5281. return "number";
  5282. if (typeof val === "boolean")
  5283. return "boolean";
  5284. if (typeof val === "symbol")
  5285. return "symbol";
  5286. if (typeof val === "bigint")
  5287. return "bigint";
  5288. if (val.constructor && val.constructor.name)
  5289. return val.constructor.name;
  5290. if (val.name)
  5291. return val.name;
  5292. if (val.constructor)
  5293. return String(val.constructor);
  5294. return String(val);
  5295. };
  5296. var isType = function(value, type) {
  5297. if (type === "null")
  5298. return value === null;
  5299. if (type === "undefined")
  5300. return value === void 0;
  5301. if (type === "string")
  5302. return typeof value === "string";
  5303. if (type === "number")
  5304. return typeof value === "number" && !isNaN(value);
  5305. if (type === "boolean")
  5306. return typeof value === "boolean";
  5307. if (type === "symbol")
  5308. return typeof value === "symbol";
  5309. if (type === "bigint")
  5310. return typeof value === "bigint";
  5311. if (type === Date)
  5312. return value instanceof Date;
  5313. if (type === Array)
  5314. return value instanceof Array;
  5315. if (type === Uint8Array)
  5316. return value instanceof Uint8Array;
  5317. if (type === ArrayBuffer)
  5318. return value instanceof ArrayBuffer;
  5319. if (type === Function)
  5320. return value instanceof Function;
  5321. return value instanceof type[0];
  5322. };
  5323. var createTypeErrorMsg = function(value, valueName, types) {
  5324. var allowedTypes = new Array(types.length);
  5325. for (var idx = 0, len = types.length; idx < len; idx++) {
  5326. var type = types[idx];
  5327. if (type === "null")
  5328. allowedTypes[idx] = backtick("null");
  5329. if (type === "undefined")
  5330. allowedTypes[idx] = backtick("undefined");
  5331. if (type === "string")
  5332. allowedTypes[idx] = backtick("string");
  5333. else if (type === "number")
  5334. allowedTypes[idx] = backtick("number");
  5335. else if (type === "boolean")
  5336. allowedTypes[idx] = backtick("boolean");
  5337. else if (type === "symbol")
  5338. allowedTypes[idx] = backtick("symbol");
  5339. else if (type === "bigint")
  5340. allowedTypes[idx] = backtick("bigint");
  5341. else if (type === Array)
  5342. allowedTypes[idx] = backtick("Array");
  5343. else if (type === Uint8Array)
  5344. allowedTypes[idx] = backtick("Uint8Array");
  5345. else if (type === ArrayBuffer)
  5346. allowedTypes[idx] = backtick("ArrayBuffer");
  5347. else
  5348. allowedTypes[idx] = backtick(type[1]);
  5349. }
  5350. var joinedTypes = allowedTypes.join(" or ");
  5351. return backtick(valueName) + " must be of type " + joinedTypes + ", but was actually of type " + backtick(getType(value));
  5352. };
  5353. var assertIs = function(value, valueName, types) {
  5354. for (var idx = 0, len = types.length; idx < len; idx++) {
  5355. if (isType(value, types[idx]))
  5356. return;
  5357. }
  5358. throw new TypeError(createTypeErrorMsg(value, valueName, types));
  5359. };
  5360. var assertOrUndefined = function(value, valueName, types) {
  5361. assertIs(value, valueName, types.concat("undefined"));
  5362. };
  5363. var assertEachIs = function(values2, valueName, types) {
  5364. for (var idx = 0, len = values2.length; idx < len; idx++) {
  5365. assertIs(values2[idx], valueName, types);
  5366. }
  5367. };
  5368. var assertRange = function(value, valueName, min, max) {
  5369. assertIs(value, valueName, ["number"]);
  5370. assertIs(min, "min", ["number"]);
  5371. assertIs(max, "max", ["number"]);
  5372. max = Math.max(min, max);
  5373. if (value < min || value > max) {
  5374. throw new Error(backtick(valueName) + " must be at least " + min + " and at most " + max + ", but was actually " + value);
  5375. }
  5376. };
  5377. var assertRangeOrUndefined = function(value, valueName, min, max) {
  5378. assertIs(value, valueName, ["number", "undefined"]);
  5379. if (typeof value === "number")
  5380. assertRange(value, valueName, min, max);
  5381. };
  5382. var assertMultiple = function(value, valueName, multiplier) {
  5383. assertIs(value, valueName, ["number"]);
  5384. if (value % multiplier !== 0) {
  5385. throw new Error(backtick(valueName) + " must be a multiple of " + multiplier + ", but was actually " + value);
  5386. }
  5387. };
  5388. var assertInteger = function(value, valueName) {
  5389. if (!Number.isInteger(value)) {
  5390. throw new Error(backtick(valueName) + " must be an integer, but was actually " + value);
  5391. }
  5392. };
  5393. var assertPositive = function(value, valueName) {
  5394. if (![1, 0].includes(Math.sign(value))) {
  5395. throw new Error(backtick(valueName) + " must be a positive number or 0, but was actually " + value);
  5396. }
  5397. };
  5398. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/utils/pdfDocEncoding.js
  5399. var pdfDocEncodingToUnicode = new Uint16Array(256);
  5400. for (idx = 0; idx < 256; idx++) {
  5401. pdfDocEncodingToUnicode[idx] = idx;
  5402. }
  5403. var idx;
  5404. pdfDocEncodingToUnicode[22] = toCharCode("");
  5405. pdfDocEncodingToUnicode[24] = toCharCode("\u02D8");
  5406. pdfDocEncodingToUnicode[25] = toCharCode("\u02C7");
  5407. pdfDocEncodingToUnicode[26] = toCharCode("\u02C6");
  5408. pdfDocEncodingToUnicode[27] = toCharCode("\u02D9");
  5409. pdfDocEncodingToUnicode[28] = toCharCode("\u02DD");
  5410. pdfDocEncodingToUnicode[29] = toCharCode("\u02DB");
  5411. pdfDocEncodingToUnicode[30] = toCharCode("\u02DA");
  5412. pdfDocEncodingToUnicode[31] = toCharCode("\u02DC");
  5413. pdfDocEncodingToUnicode[127] = toCharCode("\uFFFD");
  5414. pdfDocEncodingToUnicode[128] = toCharCode("\u2022");
  5415. pdfDocEncodingToUnicode[129] = toCharCode("\u2020");
  5416. pdfDocEncodingToUnicode[130] = toCharCode("\u2021");
  5417. pdfDocEncodingToUnicode[131] = toCharCode("\u2026");
  5418. pdfDocEncodingToUnicode[132] = toCharCode("\u2014");
  5419. pdfDocEncodingToUnicode[133] = toCharCode("\u2013");
  5420. pdfDocEncodingToUnicode[134] = toCharCode("\u0192");
  5421. pdfDocEncodingToUnicode[135] = toCharCode("\u2044");
  5422. pdfDocEncodingToUnicode[136] = toCharCode("\u2039");
  5423. pdfDocEncodingToUnicode[137] = toCharCode("\u203A");
  5424. pdfDocEncodingToUnicode[138] = toCharCode("\u2212");
  5425. pdfDocEncodingToUnicode[139] = toCharCode("\u2030");
  5426. pdfDocEncodingToUnicode[140] = toCharCode("\u201E");
  5427. pdfDocEncodingToUnicode[141] = toCharCode("\u201C");
  5428. pdfDocEncodingToUnicode[142] = toCharCode("\u201D");
  5429. pdfDocEncodingToUnicode[143] = toCharCode("\u2018");
  5430. pdfDocEncodingToUnicode[144] = toCharCode("\u2019");
  5431. pdfDocEncodingToUnicode[145] = toCharCode("\u201A");
  5432. pdfDocEncodingToUnicode[146] = toCharCode("\u2122");
  5433. pdfDocEncodingToUnicode[147] = toCharCode("\uFB01");
  5434. pdfDocEncodingToUnicode[148] = toCharCode("\uFB02");
  5435. pdfDocEncodingToUnicode[149] = toCharCode("\u0141");
  5436. pdfDocEncodingToUnicode[150] = toCharCode("\u0152");
  5437. pdfDocEncodingToUnicode[151] = toCharCode("\u0160");
  5438. pdfDocEncodingToUnicode[152] = toCharCode("\u0178");
  5439. pdfDocEncodingToUnicode[153] = toCharCode("\u017D");
  5440. pdfDocEncodingToUnicode[154] = toCharCode("\u0131");
  5441. pdfDocEncodingToUnicode[155] = toCharCode("\u0142");
  5442. pdfDocEncodingToUnicode[156] = toCharCode("\u0153");
  5443. pdfDocEncodingToUnicode[157] = toCharCode("\u0161");
  5444. pdfDocEncodingToUnicode[158] = toCharCode("\u017E");
  5445. pdfDocEncodingToUnicode[159] = toCharCode("\uFFFD");
  5446. pdfDocEncodingToUnicode[160] = toCharCode("\u20AC");
  5447. pdfDocEncodingToUnicode[173] = toCharCode("\uFFFD");
  5448. var pdfDocEncodingDecode = function(bytes) {
  5449. var codePoints = new Array(bytes.length);
  5450. for (var idx = 0, len = bytes.length; idx < len; idx++) {
  5451. codePoints[idx] = pdfDocEncodingToUnicode[bytes[idx]];
  5452. }
  5453. return String.fromCodePoint.apply(String, codePoints);
  5454. };
  5455. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/utils/Cache.js
  5456. var Cache = (
  5457. /** @class */
  5458. function() {
  5459. function Cache2(populate) {
  5460. this.populate = populate;
  5461. this.value = void 0;
  5462. }
  5463. Cache2.prototype.getValue = function() {
  5464. return this.value;
  5465. };
  5466. Cache2.prototype.access = function() {
  5467. if (!this.value)
  5468. this.value = this.populate();
  5469. return this.value;
  5470. };
  5471. Cache2.prototype.invalidate = function() {
  5472. this.value = void 0;
  5473. };
  5474. Cache2.populatedBy = function(populate) {
  5475. return new Cache2(populate);
  5476. };
  5477. return Cache2;
  5478. }()
  5479. );
  5480. var Cache_default = Cache;
  5481. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/errors.js
  5482. var MethodNotImplementedError = (
  5483. /** @class */
  5484. function(_super) {
  5485. __extends(MethodNotImplementedError2, _super);
  5486. function MethodNotImplementedError2(className, methodName) {
  5487. var _this = this;
  5488. var msg = "Method " + className + "." + methodName + "() not implemented";
  5489. _this = _super.call(this, msg) || this;
  5490. return _this;
  5491. }
  5492. return MethodNotImplementedError2;
  5493. }(Error)
  5494. );
  5495. var PrivateConstructorError = (
  5496. /** @class */
  5497. function(_super) {
  5498. __extends(PrivateConstructorError2, _super);
  5499. function PrivateConstructorError2(className) {
  5500. var _this = this;
  5501. var msg = "Cannot construct " + className + " - it has a private constructor";
  5502. _this = _super.call(this, msg) || this;
  5503. return _this;
  5504. }
  5505. return PrivateConstructorError2;
  5506. }(Error)
  5507. );
  5508. var UnexpectedObjectTypeError = (
  5509. /** @class */
  5510. function(_super) {
  5511. __extends(UnexpectedObjectTypeError2, _super);
  5512. function UnexpectedObjectTypeError2(expected, actual) {
  5513. var _this = this;
  5514. var name = function(t) {
  5515. var _a, _b;
  5516. return (_a = t === null || t === void 0 ? void 0 : t.name) !== null && _a !== void 0 ? _a : (_b = t === null || t === void 0 ? void 0 : t.constructor) === null || _b === void 0 ? void 0 : _b.name;
  5517. };
  5518. var expectedTypes = Array.isArray(expected) ? expected.map(name) : [name(expected)];
  5519. var msg = "Expected instance of " + expectedTypes.join(" or ") + ", " + ("but got instance of " + (actual ? name(actual) : actual));
  5520. _this = _super.call(this, msg) || this;
  5521. return _this;
  5522. }
  5523. return UnexpectedObjectTypeError2;
  5524. }(Error)
  5525. );
  5526. var UnsupportedEncodingError = (
  5527. /** @class */
  5528. function(_super) {
  5529. __extends(UnsupportedEncodingError2, _super);
  5530. function UnsupportedEncodingError2(encoding) {
  5531. var _this = this;
  5532. var msg = encoding + " stream encoding not supported";
  5533. _this = _super.call(this, msg) || this;
  5534. return _this;
  5535. }
  5536. return UnsupportedEncodingError2;
  5537. }(Error)
  5538. );
  5539. var ReparseError = (
  5540. /** @class */
  5541. function(_super) {
  5542. __extends(ReparseError2, _super);
  5543. function ReparseError2(className, methodName) {
  5544. var _this = this;
  5545. var msg = "Cannot call " + className + "." + methodName + "() more than once";
  5546. _this = _super.call(this, msg) || this;
  5547. return _this;
  5548. }
  5549. return ReparseError2;
  5550. }(Error)
  5551. );
  5552. var MissingCatalogError = (
  5553. /** @class */
  5554. function(_super) {
  5555. __extends(MissingCatalogError2, _super);
  5556. function MissingCatalogError2(ref) {
  5557. var _this = this;
  5558. var msg = "Missing catalog (ref=" + ref + ")";
  5559. _this = _super.call(this, msg) || this;
  5560. return _this;
  5561. }
  5562. return MissingCatalogError2;
  5563. }(Error)
  5564. );
  5565. var MissingPageContentsEmbeddingError = (
  5566. /** @class */
  5567. function(_super) {
  5568. __extends(MissingPageContentsEmbeddingError2, _super);
  5569. function MissingPageContentsEmbeddingError2() {
  5570. var _this = this;
  5571. var msg = "Can't embed page with missing Contents";
  5572. _this = _super.call(this, msg) || this;
  5573. return _this;
  5574. }
  5575. return MissingPageContentsEmbeddingError2;
  5576. }(Error)
  5577. );
  5578. var UnrecognizedStreamTypeError = (
  5579. /** @class */
  5580. function(_super) {
  5581. __extends(UnrecognizedStreamTypeError2, _super);
  5582. function UnrecognizedStreamTypeError2(stream2) {
  5583. var _a, _b, _c;
  5584. var _this = this;
  5585. var streamType = (_c = (_b = (_a = stream2 === null || stream2 === void 0 ? void 0 : stream2.contructor) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : stream2 === null || stream2 === void 0 ? void 0 : stream2.name) !== null && _c !== void 0 ? _c : stream2;
  5586. var msg = "Unrecognized stream type: " + streamType;
  5587. _this = _super.call(this, msg) || this;
  5588. return _this;
  5589. }
  5590. return UnrecognizedStreamTypeError2;
  5591. }(Error)
  5592. );
  5593. var PageEmbeddingMismatchedContextError = (
  5594. /** @class */
  5595. function(_super) {
  5596. __extends(PageEmbeddingMismatchedContextError2, _super);
  5597. function PageEmbeddingMismatchedContextError2() {
  5598. var _this = this;
  5599. var msg = "Found mismatched contexts while embedding pages. All pages in the array passed to `PDFDocument.embedPages()` must be from the same document.";
  5600. _this = _super.call(this, msg) || this;
  5601. return _this;
  5602. }
  5603. return PageEmbeddingMismatchedContextError2;
  5604. }(Error)
  5605. );
  5606. var PDFArrayIsNotRectangleError = (
  5607. /** @class */
  5608. function(_super) {
  5609. __extends(PDFArrayIsNotRectangleError2, _super);
  5610. function PDFArrayIsNotRectangleError2(size) {
  5611. var _this = this;
  5612. var msg = "Attempted to convert PDFArray with " + size + " elements to rectangle, but must have exactly 4 elements.";
  5613. _this = _super.call(this, msg) || this;
  5614. return _this;
  5615. }
  5616. return PDFArrayIsNotRectangleError2;
  5617. }(Error)
  5618. );
  5619. var InvalidPDFDateStringError = (
  5620. /** @class */
  5621. function(_super) {
  5622. __extends(InvalidPDFDateStringError2, _super);
  5623. function InvalidPDFDateStringError2(value) {
  5624. var _this = this;
  5625. var msg = 'Attempted to convert "' + value + '" to a date, but it does not match the PDF date string format.';
  5626. _this = _super.call(this, msg) || this;
  5627. return _this;
  5628. }
  5629. return InvalidPDFDateStringError2;
  5630. }(Error)
  5631. );
  5632. var InvalidTargetIndexError = (
  5633. /** @class */
  5634. function(_super) {
  5635. __extends(InvalidTargetIndexError2, _super);
  5636. function InvalidTargetIndexError2(targetIndex, Count) {
  5637. var _this = this;
  5638. var msg = "Invalid targetIndex specified: targetIndex=" + targetIndex + " must be less than Count=" + Count;
  5639. _this = _super.call(this, msg) || this;
  5640. return _this;
  5641. }
  5642. return InvalidTargetIndexError2;
  5643. }(Error)
  5644. );
  5645. var CorruptPageTreeError = (
  5646. /** @class */
  5647. function(_super) {
  5648. __extends(CorruptPageTreeError2, _super);
  5649. function CorruptPageTreeError2(targetIndex, operation) {
  5650. var _this = this;
  5651. var msg = "Failed to " + operation + " at targetIndex=" + targetIndex + " due to corrupt page tree: It is likely that one or more 'Count' entries are invalid";
  5652. _this = _super.call(this, msg) || this;
  5653. return _this;
  5654. }
  5655. return CorruptPageTreeError2;
  5656. }(Error)
  5657. );
  5658. var IndexOutOfBoundsError = (
  5659. /** @class */
  5660. function(_super) {
  5661. __extends(IndexOutOfBoundsError2, _super);
  5662. function IndexOutOfBoundsError2(index, min, max) {
  5663. var _this = this;
  5664. var msg = "index should be at least " + min + " and at most " + max + ", but was actually " + index;
  5665. _this = _super.call(this, msg) || this;
  5666. return _this;
  5667. }
  5668. return IndexOutOfBoundsError2;
  5669. }(Error)
  5670. );
  5671. var InvalidAcroFieldValueError = (
  5672. /** @class */
  5673. function(_super) {
  5674. __extends(InvalidAcroFieldValueError2, _super);
  5675. function InvalidAcroFieldValueError2() {
  5676. var _this = this;
  5677. var msg = "Attempted to set invalid field value";
  5678. _this = _super.call(this, msg) || this;
  5679. return _this;
  5680. }
  5681. return InvalidAcroFieldValueError2;
  5682. }(Error)
  5683. );
  5684. var MultiSelectValueError = (
  5685. /** @class */
  5686. function(_super) {
  5687. __extends(MultiSelectValueError2, _super);
  5688. function MultiSelectValueError2() {
  5689. var _this = this;
  5690. var msg = "Attempted to select multiple values for single-select field";
  5691. _this = _super.call(this, msg) || this;
  5692. return _this;
  5693. }
  5694. return MultiSelectValueError2;
  5695. }(Error)
  5696. );
  5697. var MissingDAEntryError = (
  5698. /** @class */
  5699. function(_super) {
  5700. __extends(MissingDAEntryError2, _super);
  5701. function MissingDAEntryError2(fieldName) {
  5702. var _this = this;
  5703. var msg = "No /DA (default appearance) entry found for field: " + fieldName;
  5704. _this = _super.call(this, msg) || this;
  5705. return _this;
  5706. }
  5707. return MissingDAEntryError2;
  5708. }(Error)
  5709. );
  5710. var MissingTfOperatorError = (
  5711. /** @class */
  5712. function(_super) {
  5713. __extends(MissingTfOperatorError2, _super);
  5714. function MissingTfOperatorError2(fieldName) {
  5715. var _this = this;
  5716. var msg = "No Tf operator found for DA of field: " + fieldName;
  5717. _this = _super.call(this, msg) || this;
  5718. return _this;
  5719. }
  5720. return MissingTfOperatorError2;
  5721. }(Error)
  5722. );
  5723. var NumberParsingError = (
  5724. /** @class */
  5725. function(_super) {
  5726. __extends(NumberParsingError2, _super);
  5727. function NumberParsingError2(pos, value) {
  5728. var _this = this;
  5729. var msg = "Failed to parse number " + ("(line:" + pos.line + " col:" + pos.column + " offset=" + pos.offset + '): "' + value + '"');
  5730. _this = _super.call(this, msg) || this;
  5731. return _this;
  5732. }
  5733. return NumberParsingError2;
  5734. }(Error)
  5735. );
  5736. var PDFParsingError = (
  5737. /** @class */
  5738. function(_super) {
  5739. __extends(PDFParsingError2, _super);
  5740. function PDFParsingError2(pos, details) {
  5741. var _this = this;
  5742. var msg = "Failed to parse PDF document " + ("(line:" + pos.line + " col:" + pos.column + " offset=" + pos.offset + "): " + details);
  5743. _this = _super.call(this, msg) || this;
  5744. return _this;
  5745. }
  5746. return PDFParsingError2;
  5747. }(Error)
  5748. );
  5749. var NextByteAssertionError = (
  5750. /** @class */
  5751. function(_super) {
  5752. __extends(NextByteAssertionError2, _super);
  5753. function NextByteAssertionError2(pos, expectedByte, actualByte) {
  5754. var _this = this;
  5755. var msg = "Expected next byte to be " + expectedByte + " but it was actually " + actualByte;
  5756. _this = _super.call(this, pos, msg) || this;
  5757. return _this;
  5758. }
  5759. return NextByteAssertionError2;
  5760. }(PDFParsingError)
  5761. );
  5762. var PDFObjectParsingError = (
  5763. /** @class */
  5764. function(_super) {
  5765. __extends(PDFObjectParsingError2, _super);
  5766. function PDFObjectParsingError2(pos, byte) {
  5767. var _this = this;
  5768. var msg = "Failed to parse PDF object starting with the following byte: " + byte;
  5769. _this = _super.call(this, pos, msg) || this;
  5770. return _this;
  5771. }
  5772. return PDFObjectParsingError2;
  5773. }(PDFParsingError)
  5774. );
  5775. var PDFInvalidObjectParsingError = (
  5776. /** @class */
  5777. function(_super) {
  5778. __extends(PDFInvalidObjectParsingError2, _super);
  5779. function PDFInvalidObjectParsingError2(pos) {
  5780. var _this = this;
  5781. var msg = "Failed to parse invalid PDF object";
  5782. _this = _super.call(this, pos, msg) || this;
  5783. return _this;
  5784. }
  5785. return PDFInvalidObjectParsingError2;
  5786. }(PDFParsingError)
  5787. );
  5788. var PDFStreamParsingError = (
  5789. /** @class */
  5790. function(_super) {
  5791. __extends(PDFStreamParsingError2, _super);
  5792. function PDFStreamParsingError2(pos) {
  5793. var _this = this;
  5794. var msg = "Failed to parse PDF stream";
  5795. _this = _super.call(this, pos, msg) || this;
  5796. return _this;
  5797. }
  5798. return PDFStreamParsingError2;
  5799. }(PDFParsingError)
  5800. );
  5801. var UnbalancedParenthesisError = (
  5802. /** @class */
  5803. function(_super) {
  5804. __extends(UnbalancedParenthesisError2, _super);
  5805. function UnbalancedParenthesisError2(pos) {
  5806. var _this = this;
  5807. var msg = "Failed to parse PDF literal string due to unbalanced parenthesis";
  5808. _this = _super.call(this, pos, msg) || this;
  5809. return _this;
  5810. }
  5811. return UnbalancedParenthesisError2;
  5812. }(PDFParsingError)
  5813. );
  5814. var StalledParserError = (
  5815. /** @class */
  5816. function(_super) {
  5817. __extends(StalledParserError2, _super);
  5818. function StalledParserError2(pos) {
  5819. var _this = this;
  5820. var msg = "Parser stalled";
  5821. _this = _super.call(this, pos, msg) || this;
  5822. return _this;
  5823. }
  5824. return StalledParserError2;
  5825. }(PDFParsingError)
  5826. );
  5827. var MissingPDFHeaderError = (
  5828. /** @class */
  5829. function(_super) {
  5830. __extends(MissingPDFHeaderError2, _super);
  5831. function MissingPDFHeaderError2(pos) {
  5832. var _this = this;
  5833. var msg = "No PDF header found";
  5834. _this = _super.call(this, pos, msg) || this;
  5835. return _this;
  5836. }
  5837. return MissingPDFHeaderError2;
  5838. }(PDFParsingError)
  5839. );
  5840. var MissingKeywordError = (
  5841. /** @class */
  5842. function(_super) {
  5843. __extends(MissingKeywordError2, _super);
  5844. function MissingKeywordError2(pos, keyword) {
  5845. var _this = this;
  5846. var msg = "Did not find expected keyword '" + arrayAsString(keyword) + "'";
  5847. _this = _super.call(this, pos, msg) || this;
  5848. return _this;
  5849. }
  5850. return MissingKeywordError2;
  5851. }(PDFParsingError)
  5852. );
  5853. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/syntax/CharCodes.js
  5854. var CharCodes;
  5855. (function(CharCodes2) {
  5856. CharCodes2[CharCodes2["Null"] = 0] = "Null";
  5857. CharCodes2[CharCodes2["Backspace"] = 8] = "Backspace";
  5858. CharCodes2[CharCodes2["Tab"] = 9] = "Tab";
  5859. CharCodes2[CharCodes2["Newline"] = 10] = "Newline";
  5860. CharCodes2[CharCodes2["FormFeed"] = 12] = "FormFeed";
  5861. CharCodes2[CharCodes2["CarriageReturn"] = 13] = "CarriageReturn";
  5862. CharCodes2[CharCodes2["Space"] = 32] = "Space";
  5863. CharCodes2[CharCodes2["ExclamationPoint"] = 33] = "ExclamationPoint";
  5864. CharCodes2[CharCodes2["Hash"] = 35] = "Hash";
  5865. CharCodes2[CharCodes2["Percent"] = 37] = "Percent";
  5866. CharCodes2[CharCodes2["LeftParen"] = 40] = "LeftParen";
  5867. CharCodes2[CharCodes2["RightParen"] = 41] = "RightParen";
  5868. CharCodes2[CharCodes2["Plus"] = 43] = "Plus";
  5869. CharCodes2[CharCodes2["Minus"] = 45] = "Minus";
  5870. CharCodes2[CharCodes2["Dash"] = 45] = "Dash";
  5871. CharCodes2[CharCodes2["Period"] = 46] = "Period";
  5872. CharCodes2[CharCodes2["ForwardSlash"] = 47] = "ForwardSlash";
  5873. CharCodes2[CharCodes2["Zero"] = 48] = "Zero";
  5874. CharCodes2[CharCodes2["One"] = 49] = "One";
  5875. CharCodes2[CharCodes2["Two"] = 50] = "Two";
  5876. CharCodes2[CharCodes2["Three"] = 51] = "Three";
  5877. CharCodes2[CharCodes2["Four"] = 52] = "Four";
  5878. CharCodes2[CharCodes2["Five"] = 53] = "Five";
  5879. CharCodes2[CharCodes2["Six"] = 54] = "Six";
  5880. CharCodes2[CharCodes2["Seven"] = 55] = "Seven";
  5881. CharCodes2[CharCodes2["Eight"] = 56] = "Eight";
  5882. CharCodes2[CharCodes2["Nine"] = 57] = "Nine";
  5883. CharCodes2[CharCodes2["LessThan"] = 60] = "LessThan";
  5884. CharCodes2[CharCodes2["GreaterThan"] = 62] = "GreaterThan";
  5885. CharCodes2[CharCodes2["A"] = 65] = "A";
  5886. CharCodes2[CharCodes2["D"] = 68] = "D";
  5887. CharCodes2[CharCodes2["E"] = 69] = "E";
  5888. CharCodes2[CharCodes2["F"] = 70] = "F";
  5889. CharCodes2[CharCodes2["O"] = 79] = "O";
  5890. CharCodes2[CharCodes2["P"] = 80] = "P";
  5891. CharCodes2[CharCodes2["R"] = 82] = "R";
  5892. CharCodes2[CharCodes2["LeftSquareBracket"] = 91] = "LeftSquareBracket";
  5893. CharCodes2[CharCodes2["BackSlash"] = 92] = "BackSlash";
  5894. CharCodes2[CharCodes2["RightSquareBracket"] = 93] = "RightSquareBracket";
  5895. CharCodes2[CharCodes2["a"] = 97] = "a";
  5896. CharCodes2[CharCodes2["b"] = 98] = "b";
  5897. CharCodes2[CharCodes2["d"] = 100] = "d";
  5898. CharCodes2[CharCodes2["e"] = 101] = "e";
  5899. CharCodes2[CharCodes2["f"] = 102] = "f";
  5900. CharCodes2[CharCodes2["i"] = 105] = "i";
  5901. CharCodes2[CharCodes2["j"] = 106] = "j";
  5902. CharCodes2[CharCodes2["l"] = 108] = "l";
  5903. CharCodes2[CharCodes2["m"] = 109] = "m";
  5904. CharCodes2[CharCodes2["n"] = 110] = "n";
  5905. CharCodes2[CharCodes2["o"] = 111] = "o";
  5906. CharCodes2[CharCodes2["r"] = 114] = "r";
  5907. CharCodes2[CharCodes2["s"] = 115] = "s";
  5908. CharCodes2[CharCodes2["t"] = 116] = "t";
  5909. CharCodes2[CharCodes2["u"] = 117] = "u";
  5910. CharCodes2[CharCodes2["x"] = 120] = "x";
  5911. CharCodes2[CharCodes2["LeftCurly"] = 123] = "LeftCurly";
  5912. CharCodes2[CharCodes2["RightCurly"] = 125] = "RightCurly";
  5913. CharCodes2[CharCodes2["Tilde"] = 126] = "Tilde";
  5914. })(CharCodes || (CharCodes = {}));
  5915. var CharCodes_default = CharCodes;
  5916. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/PDFContext.js
  5917. var import_pako3 = __toESM(require_pako());
  5918. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/document/PDFHeader.js
  5919. var PDFHeader = (
  5920. /** @class */
  5921. function() {
  5922. function PDFHeader2(major, minor) {
  5923. this.major = String(major);
  5924. this.minor = String(minor);
  5925. }
  5926. PDFHeader2.prototype.toString = function() {
  5927. var bc = charFromCode(129);
  5928. return "%PDF-" + this.major + "." + this.minor + "\n%" + bc + bc + bc + bc;
  5929. };
  5930. PDFHeader2.prototype.sizeInBytes = function() {
  5931. return 12 + this.major.length + this.minor.length;
  5932. };
  5933. PDFHeader2.prototype.copyBytesInto = function(buffer, offset) {
  5934. var initialOffset = offset;
  5935. buffer[offset++] = CharCodes_default.Percent;
  5936. buffer[offset++] = CharCodes_default.P;
  5937. buffer[offset++] = CharCodes_default.D;
  5938. buffer[offset++] = CharCodes_default.F;
  5939. buffer[offset++] = CharCodes_default.Dash;
  5940. offset += copyStringIntoBuffer(this.major, buffer, offset);
  5941. buffer[offset++] = CharCodes_default.Period;
  5942. offset += copyStringIntoBuffer(this.minor, buffer, offset);
  5943. buffer[offset++] = CharCodes_default.Newline;
  5944. buffer[offset++] = CharCodes_default.Percent;
  5945. buffer[offset++] = 129;
  5946. buffer[offset++] = 129;
  5947. buffer[offset++] = 129;
  5948. buffer[offset++] = 129;
  5949. return offset - initialOffset;
  5950. };
  5951. PDFHeader2.forVersion = function(major, minor) {
  5952. return new PDFHeader2(major, minor);
  5953. };
  5954. return PDFHeader2;
  5955. }()
  5956. );
  5957. var PDFHeader_default = PDFHeader;
  5958. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/objects/PDFObject.js
  5959. var PDFObject = (
  5960. /** @class */
  5961. function() {
  5962. function PDFObject2() {
  5963. }
  5964. PDFObject2.prototype.clone = function(_context) {
  5965. throw new MethodNotImplementedError(this.constructor.name, "clone");
  5966. };
  5967. PDFObject2.prototype.toString = function() {
  5968. throw new MethodNotImplementedError(this.constructor.name, "toString");
  5969. };
  5970. PDFObject2.prototype.sizeInBytes = function() {
  5971. throw new MethodNotImplementedError(this.constructor.name, "sizeInBytes");
  5972. };
  5973. PDFObject2.prototype.copyBytesInto = function(_buffer, _offset) {
  5974. throw new MethodNotImplementedError(this.constructor.name, "copyBytesInto");
  5975. };
  5976. return PDFObject2;
  5977. }()
  5978. );
  5979. var PDFObject_default = PDFObject;
  5980. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/objects/PDFNumber.js
  5981. var PDFNumber = (
  5982. /** @class */
  5983. function(_super) {
  5984. __extends(PDFNumber2, _super);
  5985. function PDFNumber2(value) {
  5986. var _this = _super.call(this) || this;
  5987. _this.numberValue = value;
  5988. _this.stringValue = numberToString(value);
  5989. return _this;
  5990. }
  5991. PDFNumber2.prototype.asNumber = function() {
  5992. return this.numberValue;
  5993. };
  5994. PDFNumber2.prototype.value = function() {
  5995. return this.numberValue;
  5996. };
  5997. PDFNumber2.prototype.clone = function() {
  5998. return PDFNumber2.of(this.numberValue);
  5999. };
  6000. PDFNumber2.prototype.toString = function() {
  6001. return this.stringValue;
  6002. };
  6003. PDFNumber2.prototype.sizeInBytes = function() {
  6004. return this.stringValue.length;
  6005. };
  6006. PDFNumber2.prototype.copyBytesInto = function(buffer, offset) {
  6007. offset += copyStringIntoBuffer(this.stringValue, buffer, offset);
  6008. return this.stringValue.length;
  6009. };
  6010. PDFNumber2.of = function(value) {
  6011. return new PDFNumber2(value);
  6012. };
  6013. return PDFNumber2;
  6014. }(PDFObject_default)
  6015. );
  6016. var PDFNumber_default = PDFNumber;
  6017. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/objects/PDFArray.js
  6018. var PDFArray = (
  6019. /** @class */
  6020. function(_super) {
  6021. __extends(PDFArray3, _super);
  6022. function PDFArray3(context) {
  6023. var _this = _super.call(this) || this;
  6024. _this.array = [];
  6025. _this.context = context;
  6026. return _this;
  6027. }
  6028. PDFArray3.prototype.size = function() {
  6029. return this.array.length;
  6030. };
  6031. PDFArray3.prototype.push = function(object) {
  6032. this.array.push(object);
  6033. };
  6034. PDFArray3.prototype.insert = function(index, object) {
  6035. this.array.splice(index, 0, object);
  6036. };
  6037. PDFArray3.prototype.indexOf = function(object) {
  6038. var index = this.array.indexOf(object);
  6039. return index === -1 ? void 0 : index;
  6040. };
  6041. PDFArray3.prototype.remove = function(index) {
  6042. this.array.splice(index, 1);
  6043. };
  6044. PDFArray3.prototype.set = function(idx, object) {
  6045. this.array[idx] = object;
  6046. };
  6047. PDFArray3.prototype.get = function(index) {
  6048. return this.array[index];
  6049. };
  6050. PDFArray3.prototype.lookupMaybe = function(index) {
  6051. var _a;
  6052. var types = [];
  6053. for (var _i = 1; _i < arguments.length; _i++) {
  6054. types[_i - 1] = arguments[_i];
  6055. }
  6056. return (_a = this.context).lookupMaybe.apply(_a, __spreadArrays([this.get(index)], types));
  6057. };
  6058. PDFArray3.prototype.lookup = function(index) {
  6059. var _a;
  6060. var types = [];
  6061. for (var _i = 1; _i < arguments.length; _i++) {
  6062. types[_i - 1] = arguments[_i];
  6063. }
  6064. return (_a = this.context).lookup.apply(_a, __spreadArrays([this.get(index)], types));
  6065. };
  6066. PDFArray3.prototype.asRectangle = function() {
  6067. if (this.size() !== 4)
  6068. throw new PDFArrayIsNotRectangleError(this.size());
  6069. var lowerLeftX = this.lookup(0, PDFNumber_default).asNumber();
  6070. var lowerLeftY = this.lookup(1, PDFNumber_default).asNumber();
  6071. var upperRightX = this.lookup(2, PDFNumber_default).asNumber();
  6072. var upperRightY = this.lookup(3, PDFNumber_default).asNumber();
  6073. var x = lowerLeftX;
  6074. var y = lowerLeftY;
  6075. var width = upperRightX - lowerLeftX;
  6076. var height = upperRightY - lowerLeftY;
  6077. return { x, y, width, height };
  6078. };
  6079. PDFArray3.prototype.asArray = function() {
  6080. return this.array.slice();
  6081. };
  6082. PDFArray3.prototype.clone = function(context) {
  6083. var clone = PDFArray3.withContext(context || this.context);
  6084. for (var idx = 0, len = this.size(); idx < len; idx++) {
  6085. clone.push(this.array[idx]);
  6086. }
  6087. return clone;
  6088. };
  6089. PDFArray3.prototype.toString = function() {
  6090. var arrayString = "[ ";
  6091. for (var idx = 0, len = this.size(); idx < len; idx++) {
  6092. arrayString += this.get(idx).toString();
  6093. arrayString += " ";
  6094. }
  6095. arrayString += "]";
  6096. return arrayString;
  6097. };
  6098. PDFArray3.prototype.sizeInBytes = function() {
  6099. var size = 3;
  6100. for (var idx = 0, len = this.size(); idx < len; idx++) {
  6101. size += this.get(idx).sizeInBytes() + 1;
  6102. }
  6103. return size;
  6104. };
  6105. PDFArray3.prototype.copyBytesInto = function(buffer, offset) {
  6106. var initialOffset = offset;
  6107. buffer[offset++] = CharCodes_default.LeftSquareBracket;
  6108. buffer[offset++] = CharCodes_default.Space;
  6109. for (var idx = 0, len = this.size(); idx < len; idx++) {
  6110. offset += this.get(idx).copyBytesInto(buffer, offset);
  6111. buffer[offset++] = CharCodes_default.Space;
  6112. }
  6113. buffer[offset++] = CharCodes_default.RightSquareBracket;
  6114. return offset - initialOffset;
  6115. };
  6116. PDFArray3.prototype.scalePDFNumbers = function(x, y) {
  6117. for (var idx = 0, len = this.size(); idx < len; idx++) {
  6118. var el = this.lookup(idx);
  6119. if (el instanceof PDFNumber_default) {
  6120. var factor = idx % 2 === 0 ? x : y;
  6121. this.set(idx, PDFNumber_default.of(el.asNumber() * factor));
  6122. }
  6123. }
  6124. };
  6125. PDFArray3.withContext = function(context) {
  6126. return new PDFArray3(context);
  6127. };
  6128. return PDFArray3;
  6129. }(PDFObject_default)
  6130. );
  6131. var PDFArray_default = PDFArray;
  6132. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/objects/PDFBool.js
  6133. var ENFORCER = {};
  6134. var PDFBool = (
  6135. /** @class */
  6136. function(_super) {
  6137. __extends(PDFBool2, _super);
  6138. function PDFBool2(enforcer, value) {
  6139. var _this = this;
  6140. if (enforcer !== ENFORCER)
  6141. throw new PrivateConstructorError("PDFBool");
  6142. _this = _super.call(this) || this;
  6143. _this.value = value;
  6144. return _this;
  6145. }
  6146. PDFBool2.prototype.asBoolean = function() {
  6147. return this.value;
  6148. };
  6149. PDFBool2.prototype.clone = function() {
  6150. return this;
  6151. };
  6152. PDFBool2.prototype.toString = function() {
  6153. return String(this.value);
  6154. };
  6155. PDFBool2.prototype.sizeInBytes = function() {
  6156. return this.value ? 4 : 5;
  6157. };
  6158. PDFBool2.prototype.copyBytesInto = function(buffer, offset) {
  6159. if (this.value) {
  6160. buffer[offset++] = CharCodes_default.t;
  6161. buffer[offset++] = CharCodes_default.r;
  6162. buffer[offset++] = CharCodes_default.u;
  6163. buffer[offset++] = CharCodes_default.e;
  6164. return 4;
  6165. } else {
  6166. buffer[offset++] = CharCodes_default.f;
  6167. buffer[offset++] = CharCodes_default.a;
  6168. buffer[offset++] = CharCodes_default.l;
  6169. buffer[offset++] = CharCodes_default.s;
  6170. buffer[offset++] = CharCodes_default.e;
  6171. return 5;
  6172. }
  6173. };
  6174. PDFBool2.True = new PDFBool2(ENFORCER, true);
  6175. PDFBool2.False = new PDFBool2(ENFORCER, false);
  6176. return PDFBool2;
  6177. }(PDFObject_default)
  6178. );
  6179. var PDFBool_default = PDFBool;
  6180. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/syntax/Delimiters.js
  6181. var IsDelimiter = new Uint8Array(256);
  6182. IsDelimiter[CharCodes_default.LeftParen] = 1;
  6183. IsDelimiter[CharCodes_default.RightParen] = 1;
  6184. IsDelimiter[CharCodes_default.LessThan] = 1;
  6185. IsDelimiter[CharCodes_default.GreaterThan] = 1;
  6186. IsDelimiter[CharCodes_default.LeftSquareBracket] = 1;
  6187. IsDelimiter[CharCodes_default.RightSquareBracket] = 1;
  6188. IsDelimiter[CharCodes_default.LeftCurly] = 1;
  6189. IsDelimiter[CharCodes_default.RightCurly] = 1;
  6190. IsDelimiter[CharCodes_default.ForwardSlash] = 1;
  6191. IsDelimiter[CharCodes_default.Percent] = 1;
  6192. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/syntax/Whitespace.js
  6193. var IsWhitespace = new Uint8Array(256);
  6194. IsWhitespace[CharCodes_default.Null] = 1;
  6195. IsWhitespace[CharCodes_default.Tab] = 1;
  6196. IsWhitespace[CharCodes_default.Newline] = 1;
  6197. IsWhitespace[CharCodes_default.FormFeed] = 1;
  6198. IsWhitespace[CharCodes_default.CarriageReturn] = 1;
  6199. IsWhitespace[CharCodes_default.Space] = 1;
  6200. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/syntax/Irregular.js
  6201. var IsIrregular = new Uint8Array(256);
  6202. for (idx = 0, len = 256; idx < len; idx++) {
  6203. IsIrregular[idx] = IsWhitespace[idx] || IsDelimiter[idx] ? 1 : 0;
  6204. }
  6205. var idx;
  6206. var len;
  6207. IsIrregular[CharCodes_default.Hash] = 1;
  6208. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/objects/PDFName.js
  6209. var decodeName = function(name) {
  6210. return name.replace(/#([\dABCDEF]{2})/g, function(_, hex) {
  6211. return charFromHexCode(hex);
  6212. });
  6213. };
  6214. var isRegularChar = function(charCode) {
  6215. return charCode >= CharCodes_default.ExclamationPoint && charCode <= CharCodes_default.Tilde && !IsIrregular[charCode];
  6216. };
  6217. var ENFORCER2 = {};
  6218. var pool = /* @__PURE__ */ new Map();
  6219. var PDFName = (
  6220. /** @class */
  6221. function(_super) {
  6222. __extends(PDFName2, _super);
  6223. function PDFName2(enforcer, name) {
  6224. var _this = this;
  6225. if (enforcer !== ENFORCER2)
  6226. throw new PrivateConstructorError("PDFName");
  6227. _this = _super.call(this) || this;
  6228. var encodedName = "/";
  6229. for (var idx = 0, len = name.length; idx < len; idx++) {
  6230. var character = name[idx];
  6231. var code = toCharCode(character);
  6232. encodedName += isRegularChar(code) ? character : "#" + toHexString(code);
  6233. }
  6234. _this.encodedName = encodedName;
  6235. return _this;
  6236. }
  6237. PDFName2.prototype.asBytes = function() {
  6238. var bytes = [];
  6239. var hex = "";
  6240. var escaped = false;
  6241. var pushByte = function(byte2) {
  6242. if (byte2 !== void 0)
  6243. bytes.push(byte2);
  6244. escaped = false;
  6245. };
  6246. for (var idx = 1, len = this.encodedName.length; idx < len; idx++) {
  6247. var char = this.encodedName[idx];
  6248. var byte = toCharCode(char);
  6249. var nextChar = this.encodedName[idx + 1];
  6250. if (!escaped) {
  6251. if (byte === CharCodes_default.Hash)
  6252. escaped = true;
  6253. else
  6254. pushByte(byte);
  6255. } else {
  6256. if (byte >= CharCodes_default.Zero && byte <= CharCodes_default.Nine || byte >= CharCodes_default.a && byte <= CharCodes_default.f || byte >= CharCodes_default.A && byte <= CharCodes_default.F) {
  6257. hex += char;
  6258. if (hex.length === 2 || !(nextChar >= "0" && nextChar <= "9" || nextChar >= "a" && nextChar <= "f" || nextChar >= "A" && nextChar <= "F")) {
  6259. pushByte(parseInt(hex, 16));
  6260. hex = "";
  6261. }
  6262. } else {
  6263. pushByte(byte);
  6264. }
  6265. }
  6266. }
  6267. return new Uint8Array(bytes);
  6268. };
  6269. PDFName2.prototype.decodeText = function() {
  6270. var bytes = this.asBytes();
  6271. return String.fromCharCode.apply(String, Array.from(bytes));
  6272. };
  6273. PDFName2.prototype.asString = function() {
  6274. return this.encodedName;
  6275. };
  6276. PDFName2.prototype.value = function() {
  6277. return this.encodedName;
  6278. };
  6279. PDFName2.prototype.clone = function() {
  6280. return this;
  6281. };
  6282. PDFName2.prototype.toString = function() {
  6283. return this.encodedName;
  6284. };
  6285. PDFName2.prototype.sizeInBytes = function() {
  6286. return this.encodedName.length;
  6287. };
  6288. PDFName2.prototype.copyBytesInto = function(buffer, offset) {
  6289. offset += copyStringIntoBuffer(this.encodedName, buffer, offset);
  6290. return this.encodedName.length;
  6291. };
  6292. PDFName2.of = function(name) {
  6293. var decodedValue = decodeName(name);
  6294. var instance = pool.get(decodedValue);
  6295. if (!instance) {
  6296. instance = new PDFName2(ENFORCER2, decodedValue);
  6297. pool.set(decodedValue, instance);
  6298. }
  6299. return instance;
  6300. };
  6301. PDFName2.Length = PDFName2.of("Length");
  6302. PDFName2.FlateDecode = PDFName2.of("FlateDecode");
  6303. PDFName2.Resources = PDFName2.of("Resources");
  6304. PDFName2.Font = PDFName2.of("Font");
  6305. PDFName2.XObject = PDFName2.of("XObject");
  6306. PDFName2.ExtGState = PDFName2.of("ExtGState");
  6307. PDFName2.Contents = PDFName2.of("Contents");
  6308. PDFName2.Type = PDFName2.of("Type");
  6309. PDFName2.Parent = PDFName2.of("Parent");
  6310. PDFName2.MediaBox = PDFName2.of("MediaBox");
  6311. PDFName2.Page = PDFName2.of("Page");
  6312. PDFName2.Annots = PDFName2.of("Annots");
  6313. PDFName2.TrimBox = PDFName2.of("TrimBox");
  6314. PDFName2.ArtBox = PDFName2.of("ArtBox");
  6315. PDFName2.BleedBox = PDFName2.of("BleedBox");
  6316. PDFName2.CropBox = PDFName2.of("CropBox");
  6317. PDFName2.Rotate = PDFName2.of("Rotate");
  6318. PDFName2.Title = PDFName2.of("Title");
  6319. PDFName2.Author = PDFName2.of("Author");
  6320. PDFName2.Subject = PDFName2.of("Subject");
  6321. PDFName2.Creator = PDFName2.of("Creator");
  6322. PDFName2.Keywords = PDFName2.of("Keywords");
  6323. PDFName2.Producer = PDFName2.of("Producer");
  6324. PDFName2.CreationDate = PDFName2.of("CreationDate");
  6325. PDFName2.ModDate = PDFName2.of("ModDate");
  6326. return PDFName2;
  6327. }(PDFObject_default)
  6328. );
  6329. var PDFName_default = PDFName;
  6330. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/objects/PDFNull.js
  6331. var PDFNull = (
  6332. /** @class */
  6333. function(_super) {
  6334. __extends(PDFNull2, _super);
  6335. function PDFNull2() {
  6336. return _super !== null && _super.apply(this, arguments) || this;
  6337. }
  6338. PDFNull2.prototype.asNull = function() {
  6339. return null;
  6340. };
  6341. PDFNull2.prototype.clone = function() {
  6342. return this;
  6343. };
  6344. PDFNull2.prototype.toString = function() {
  6345. return "null";
  6346. };
  6347. PDFNull2.prototype.sizeInBytes = function() {
  6348. return 4;
  6349. };
  6350. PDFNull2.prototype.copyBytesInto = function(buffer, offset) {
  6351. buffer[offset++] = CharCodes_default.n;
  6352. buffer[offset++] = CharCodes_default.u;
  6353. buffer[offset++] = CharCodes_default.l;
  6354. buffer[offset++] = CharCodes_default.l;
  6355. return 4;
  6356. };
  6357. return PDFNull2;
  6358. }(PDFObject_default)
  6359. );
  6360. var PDFNull_default = new PDFNull();
  6361. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/objects/PDFDict.js
  6362. var PDFDict = (
  6363. /** @class */
  6364. function(_super) {
  6365. __extends(PDFDict2, _super);
  6366. function PDFDict2(map, context) {
  6367. var _this = _super.call(this) || this;
  6368. _this.dict = map;
  6369. _this.context = context;
  6370. return _this;
  6371. }
  6372. PDFDict2.prototype.keys = function() {
  6373. return Array.from(this.dict.keys());
  6374. };
  6375. PDFDict2.prototype.values = function() {
  6376. return Array.from(this.dict.values());
  6377. };
  6378. PDFDict2.prototype.entries = function() {
  6379. return Array.from(this.dict.entries());
  6380. };
  6381. PDFDict2.prototype.set = function(key, value) {
  6382. this.dict.set(key, value);
  6383. };
  6384. PDFDict2.prototype.get = function(key, preservePDFNull) {
  6385. if (preservePDFNull === void 0) {
  6386. preservePDFNull = false;
  6387. }
  6388. var value = this.dict.get(key);
  6389. if (value === PDFNull_default && !preservePDFNull)
  6390. return void 0;
  6391. return value;
  6392. };
  6393. PDFDict2.prototype.has = function(key) {
  6394. var value = this.dict.get(key);
  6395. return value !== void 0 && value !== PDFNull_default;
  6396. };
  6397. PDFDict2.prototype.lookupMaybe = function(key) {
  6398. var _a;
  6399. var types = [];
  6400. for (var _i = 1; _i < arguments.length; _i++) {
  6401. types[_i - 1] = arguments[_i];
  6402. }
  6403. var preservePDFNull = types.includes(PDFNull_default);
  6404. var value = (_a = this.context).lookupMaybe.apply(_a, __spreadArrays([this.get(key, preservePDFNull)], types));
  6405. if (value === PDFNull_default && !preservePDFNull)
  6406. return void 0;
  6407. return value;
  6408. };
  6409. PDFDict2.prototype.lookup = function(key) {
  6410. var _a;
  6411. var types = [];
  6412. for (var _i = 1; _i < arguments.length; _i++) {
  6413. types[_i - 1] = arguments[_i];
  6414. }
  6415. var preservePDFNull = types.includes(PDFNull_default);
  6416. var value = (_a = this.context).lookup.apply(_a, __spreadArrays([this.get(key, preservePDFNull)], types));
  6417. if (value === PDFNull_default && !preservePDFNull)
  6418. return void 0;
  6419. return value;
  6420. };
  6421. PDFDict2.prototype.delete = function(key) {
  6422. return this.dict.delete(key);
  6423. };
  6424. PDFDict2.prototype.asMap = function() {
  6425. return new Map(this.dict);
  6426. };
  6427. PDFDict2.prototype.uniqueKey = function(tag) {
  6428. if (tag === void 0) {
  6429. tag = "";
  6430. }
  6431. var existingKeys = this.keys();
  6432. var key = PDFName_default.of(this.context.addRandomSuffix(tag, 10));
  6433. while (existingKeys.includes(key)) {
  6434. key = PDFName_default.of(this.context.addRandomSuffix(tag, 10));
  6435. }
  6436. return key;
  6437. };
  6438. PDFDict2.prototype.clone = function(context) {
  6439. var clone = PDFDict2.withContext(context || this.context);
  6440. var entries = this.entries();
  6441. for (var idx = 0, len = entries.length; idx < len; idx++) {
  6442. var _a = entries[idx], key = _a[0], value = _a[1];
  6443. clone.set(key, value);
  6444. }
  6445. return clone;
  6446. };
  6447. PDFDict2.prototype.toString = function() {
  6448. var dictString = "<<\n";
  6449. var entries = this.entries();
  6450. for (var idx = 0, len = entries.length; idx < len; idx++) {
  6451. var _a = entries[idx], key = _a[0], value = _a[1];
  6452. dictString += key.toString() + " " + value.toString() + "\n";
  6453. }
  6454. dictString += ">>";
  6455. return dictString;
  6456. };
  6457. PDFDict2.prototype.sizeInBytes = function() {
  6458. var size = 5;
  6459. var entries = this.entries();
  6460. for (var idx = 0, len = entries.length; idx < len; idx++) {
  6461. var _a = entries[idx], key = _a[0], value = _a[1];
  6462. size += key.sizeInBytes() + value.sizeInBytes() + 2;
  6463. }
  6464. return size;
  6465. };
  6466. PDFDict2.prototype.copyBytesInto = function(buffer, offset) {
  6467. var initialOffset = offset;
  6468. buffer[offset++] = CharCodes_default.LessThan;
  6469. buffer[offset++] = CharCodes_default.LessThan;
  6470. buffer[offset++] = CharCodes_default.Newline;
  6471. var entries = this.entries();
  6472. for (var idx = 0, len = entries.length; idx < len; idx++) {
  6473. var _a = entries[idx], key = _a[0], value = _a[1];
  6474. offset += key.copyBytesInto(buffer, offset);
  6475. buffer[offset++] = CharCodes_default.Space;
  6476. offset += value.copyBytesInto(buffer, offset);
  6477. buffer[offset++] = CharCodes_default.Newline;
  6478. }
  6479. buffer[offset++] = CharCodes_default.GreaterThan;
  6480. buffer[offset++] = CharCodes_default.GreaterThan;
  6481. return offset - initialOffset;
  6482. };
  6483. PDFDict2.withContext = function(context) {
  6484. return new PDFDict2(/* @__PURE__ */ new Map(), context);
  6485. };
  6486. PDFDict2.fromMapWithContext = function(map, context) {
  6487. return new PDFDict2(map, context);
  6488. };
  6489. return PDFDict2;
  6490. }(PDFObject_default)
  6491. );
  6492. var PDFDict_default = PDFDict;
  6493. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/objects/PDFStream.js
  6494. var PDFStream = (
  6495. /** @class */
  6496. function(_super) {
  6497. __extends(PDFStream2, _super);
  6498. function PDFStream2(dict) {
  6499. var _this = _super.call(this) || this;
  6500. _this.dict = dict;
  6501. return _this;
  6502. }
  6503. PDFStream2.prototype.clone = function(_context) {
  6504. throw new MethodNotImplementedError(this.constructor.name, "clone");
  6505. };
  6506. PDFStream2.prototype.getContentsString = function() {
  6507. throw new MethodNotImplementedError(this.constructor.name, "getContentsString");
  6508. };
  6509. PDFStream2.prototype.getContents = function() {
  6510. throw new MethodNotImplementedError(this.constructor.name, "getContents");
  6511. };
  6512. PDFStream2.prototype.getContentsSize = function() {
  6513. throw new MethodNotImplementedError(this.constructor.name, "getContentsSize");
  6514. };
  6515. PDFStream2.prototype.updateDict = function() {
  6516. var contentsSize = this.getContentsSize();
  6517. this.dict.set(PDFName_default.Length, PDFNumber_default.of(contentsSize));
  6518. };
  6519. PDFStream2.prototype.sizeInBytes = function() {
  6520. this.updateDict();
  6521. return this.dict.sizeInBytes() + this.getContentsSize() + 18;
  6522. };
  6523. PDFStream2.prototype.toString = function() {
  6524. this.updateDict();
  6525. var streamString = this.dict.toString();
  6526. streamString += "\nstream\n";
  6527. streamString += this.getContentsString();
  6528. streamString += "\nendstream";
  6529. return streamString;
  6530. };
  6531. PDFStream2.prototype.copyBytesInto = function(buffer, offset) {
  6532. this.updateDict();
  6533. var initialOffset = offset;
  6534. offset += this.dict.copyBytesInto(buffer, offset);
  6535. buffer[offset++] = CharCodes_default.Newline;
  6536. buffer[offset++] = CharCodes_default.s;
  6537. buffer[offset++] = CharCodes_default.t;
  6538. buffer[offset++] = CharCodes_default.r;
  6539. buffer[offset++] = CharCodes_default.e;
  6540. buffer[offset++] = CharCodes_default.a;
  6541. buffer[offset++] = CharCodes_default.m;
  6542. buffer[offset++] = CharCodes_default.Newline;
  6543. var contents = this.getContents();
  6544. for (var idx = 0, len = contents.length; idx < len; idx++) {
  6545. buffer[offset++] = contents[idx];
  6546. }
  6547. buffer[offset++] = CharCodes_default.Newline;
  6548. buffer[offset++] = CharCodes_default.e;
  6549. buffer[offset++] = CharCodes_default.n;
  6550. buffer[offset++] = CharCodes_default.d;
  6551. buffer[offset++] = CharCodes_default.s;
  6552. buffer[offset++] = CharCodes_default.t;
  6553. buffer[offset++] = CharCodes_default.r;
  6554. buffer[offset++] = CharCodes_default.e;
  6555. buffer[offset++] = CharCodes_default.a;
  6556. buffer[offset++] = CharCodes_default.m;
  6557. return offset - initialOffset;
  6558. };
  6559. return PDFStream2;
  6560. }(PDFObject_default)
  6561. );
  6562. var PDFStream_default = PDFStream;
  6563. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/objects/PDFRawStream.js
  6564. var PDFRawStream = (
  6565. /** @class */
  6566. function(_super) {
  6567. __extends(PDFRawStream2, _super);
  6568. function PDFRawStream2(dict, contents) {
  6569. var _this = _super.call(this, dict) || this;
  6570. _this.contents = contents;
  6571. return _this;
  6572. }
  6573. PDFRawStream2.prototype.asUint8Array = function() {
  6574. return this.contents.slice();
  6575. };
  6576. PDFRawStream2.prototype.clone = function(context) {
  6577. return PDFRawStream2.of(this.dict.clone(context), this.contents.slice());
  6578. };
  6579. PDFRawStream2.prototype.getContentsString = function() {
  6580. return arrayAsString(this.contents);
  6581. };
  6582. PDFRawStream2.prototype.getContents = function() {
  6583. return this.contents;
  6584. };
  6585. PDFRawStream2.prototype.getContentsSize = function() {
  6586. return this.contents.length;
  6587. };
  6588. PDFRawStream2.of = function(dict, contents) {
  6589. return new PDFRawStream2(dict, contents);
  6590. };
  6591. return PDFRawStream2;
  6592. }(PDFStream_default)
  6593. );
  6594. var PDFRawStream_default = PDFRawStream;
  6595. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/objects/PDFRef.js
  6596. var ENFORCER3 = {};
  6597. var pool2 = /* @__PURE__ */ new Map();
  6598. var PDFRef = (
  6599. /** @class */
  6600. function(_super) {
  6601. __extends(PDFRef3, _super);
  6602. function PDFRef3(enforcer, objectNumber, generationNumber) {
  6603. var _this = this;
  6604. if (enforcer !== ENFORCER3)
  6605. throw new PrivateConstructorError("PDFRef");
  6606. _this = _super.call(this) || this;
  6607. _this.objectNumber = objectNumber;
  6608. _this.generationNumber = generationNumber;
  6609. _this.tag = objectNumber + " " + generationNumber + " R";
  6610. return _this;
  6611. }
  6612. PDFRef3.prototype.clone = function() {
  6613. return this;
  6614. };
  6615. PDFRef3.prototype.toString = function() {
  6616. return this.tag;
  6617. };
  6618. PDFRef3.prototype.sizeInBytes = function() {
  6619. return this.tag.length;
  6620. };
  6621. PDFRef3.prototype.copyBytesInto = function(buffer, offset) {
  6622. offset += copyStringIntoBuffer(this.tag, buffer, offset);
  6623. return this.tag.length;
  6624. };
  6625. PDFRef3.of = function(objectNumber, generationNumber) {
  6626. if (generationNumber === void 0) {
  6627. generationNumber = 0;
  6628. }
  6629. var tag = objectNumber + " " + generationNumber + " R";
  6630. var instance = pool2.get(tag);
  6631. if (!instance) {
  6632. instance = new PDFRef3(ENFORCER3, objectNumber, generationNumber);
  6633. pool2.set(tag, instance);
  6634. }
  6635. return instance;
  6636. };
  6637. return PDFRef3;
  6638. }(PDFObject_default)
  6639. );
  6640. var PDFRef_default = PDFRef;
  6641. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/operators/PDFOperator.js
  6642. var PDFOperator = (
  6643. /** @class */
  6644. function() {
  6645. function PDFOperator2(name, args) {
  6646. this.name = name;
  6647. this.args = args || [];
  6648. }
  6649. PDFOperator2.prototype.clone = function(context) {
  6650. var args = new Array(this.args.length);
  6651. for (var idx = 0, len = args.length; idx < len; idx++) {
  6652. var arg = this.args[idx];
  6653. args[idx] = arg instanceof PDFObject_default ? arg.clone(context) : arg;
  6654. }
  6655. return PDFOperator2.of(this.name, args);
  6656. };
  6657. PDFOperator2.prototype.toString = function() {
  6658. var value = "";
  6659. for (var idx = 0, len = this.args.length; idx < len; idx++) {
  6660. value += String(this.args[idx]) + " ";
  6661. }
  6662. value += this.name;
  6663. return value;
  6664. };
  6665. PDFOperator2.prototype.sizeInBytes = function() {
  6666. var size = 0;
  6667. for (var idx = 0, len = this.args.length; idx < len; idx++) {
  6668. var arg = this.args[idx];
  6669. size += (arg instanceof PDFObject_default ? arg.sizeInBytes() : arg.length) + 1;
  6670. }
  6671. size += this.name.length;
  6672. return size;
  6673. };
  6674. PDFOperator2.prototype.copyBytesInto = function(buffer, offset) {
  6675. var initialOffset = offset;
  6676. for (var idx = 0, len = this.args.length; idx < len; idx++) {
  6677. var arg = this.args[idx];
  6678. if (arg instanceof PDFObject_default) {
  6679. offset += arg.copyBytesInto(buffer, offset);
  6680. } else {
  6681. offset += copyStringIntoBuffer(arg, buffer, offset);
  6682. }
  6683. buffer[offset++] = CharCodes_default.Space;
  6684. }
  6685. offset += copyStringIntoBuffer(this.name, buffer, offset);
  6686. return offset - initialOffset;
  6687. };
  6688. PDFOperator2.of = function(name, args) {
  6689. return new PDFOperator2(name, args);
  6690. };
  6691. return PDFOperator2;
  6692. }()
  6693. );
  6694. var PDFOperator_default = PDFOperator;
  6695. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/operators/PDFOperatorNames.js
  6696. var PDFOperatorNames;
  6697. (function(PDFOperatorNames2) {
  6698. PDFOperatorNames2["NonStrokingColor"] = "sc";
  6699. PDFOperatorNames2["NonStrokingColorN"] = "scn";
  6700. PDFOperatorNames2["NonStrokingColorRgb"] = "rg";
  6701. PDFOperatorNames2["NonStrokingColorGray"] = "g";
  6702. PDFOperatorNames2["NonStrokingColorCmyk"] = "k";
  6703. PDFOperatorNames2["NonStrokingColorspace"] = "cs";
  6704. PDFOperatorNames2["StrokingColor"] = "SC";
  6705. PDFOperatorNames2["StrokingColorN"] = "SCN";
  6706. PDFOperatorNames2["StrokingColorRgb"] = "RG";
  6707. PDFOperatorNames2["StrokingColorGray"] = "G";
  6708. PDFOperatorNames2["StrokingColorCmyk"] = "K";
  6709. PDFOperatorNames2["StrokingColorspace"] = "CS";
  6710. PDFOperatorNames2["BeginMarkedContentSequence"] = "BDC";
  6711. PDFOperatorNames2["BeginMarkedContent"] = "BMC";
  6712. PDFOperatorNames2["EndMarkedContent"] = "EMC";
  6713. PDFOperatorNames2["MarkedContentPointWithProps"] = "DP";
  6714. PDFOperatorNames2["MarkedContentPoint"] = "MP";
  6715. PDFOperatorNames2["DrawObject"] = "Do";
  6716. PDFOperatorNames2["ConcatTransformationMatrix"] = "cm";
  6717. PDFOperatorNames2["PopGraphicsState"] = "Q";
  6718. PDFOperatorNames2["PushGraphicsState"] = "q";
  6719. PDFOperatorNames2["SetFlatness"] = "i";
  6720. PDFOperatorNames2["SetGraphicsStateParams"] = "gs";
  6721. PDFOperatorNames2["SetLineCapStyle"] = "J";
  6722. PDFOperatorNames2["SetLineDashPattern"] = "d";
  6723. PDFOperatorNames2["SetLineJoinStyle"] = "j";
  6724. PDFOperatorNames2["SetLineMiterLimit"] = "M";
  6725. PDFOperatorNames2["SetLineWidth"] = "w";
  6726. PDFOperatorNames2["SetTextMatrix"] = "Tm";
  6727. PDFOperatorNames2["SetRenderingIntent"] = "ri";
  6728. PDFOperatorNames2["AppendRectangle"] = "re";
  6729. PDFOperatorNames2["BeginInlineImage"] = "BI";
  6730. PDFOperatorNames2["BeginInlineImageData"] = "ID";
  6731. PDFOperatorNames2["EndInlineImage"] = "EI";
  6732. PDFOperatorNames2["ClipEvenOdd"] = "W*";
  6733. PDFOperatorNames2["ClipNonZero"] = "W";
  6734. PDFOperatorNames2["CloseAndStroke"] = "s";
  6735. PDFOperatorNames2["CloseFillEvenOddAndStroke"] = "b*";
  6736. PDFOperatorNames2["CloseFillNonZeroAndStroke"] = "b";
  6737. PDFOperatorNames2["ClosePath"] = "h";
  6738. PDFOperatorNames2["AppendBezierCurve"] = "c";
  6739. PDFOperatorNames2["CurveToReplicateFinalPoint"] = "y";
  6740. PDFOperatorNames2["CurveToReplicateInitialPoint"] = "v";
  6741. PDFOperatorNames2["EndPath"] = "n";
  6742. PDFOperatorNames2["FillEvenOddAndStroke"] = "B*";
  6743. PDFOperatorNames2["FillEvenOdd"] = "f*";
  6744. PDFOperatorNames2["FillNonZeroAndStroke"] = "B";
  6745. PDFOperatorNames2["FillNonZero"] = "f";
  6746. PDFOperatorNames2["LegacyFillNonZero"] = "F";
  6747. PDFOperatorNames2["LineTo"] = "l";
  6748. PDFOperatorNames2["MoveTo"] = "m";
  6749. PDFOperatorNames2["ShadingFill"] = "sh";
  6750. PDFOperatorNames2["StrokePath"] = "S";
  6751. PDFOperatorNames2["BeginText"] = "BT";
  6752. PDFOperatorNames2["EndText"] = "ET";
  6753. PDFOperatorNames2["MoveText"] = "Td";
  6754. PDFOperatorNames2["MoveTextSetLeading"] = "TD";
  6755. PDFOperatorNames2["NextLine"] = "T*";
  6756. PDFOperatorNames2["SetCharacterSpacing"] = "Tc";
  6757. PDFOperatorNames2["SetFontAndSize"] = "Tf";
  6758. PDFOperatorNames2["SetTextHorizontalScaling"] = "Tz";
  6759. PDFOperatorNames2["SetTextLineHeight"] = "TL";
  6760. PDFOperatorNames2["SetTextRenderingMode"] = "Tr";
  6761. PDFOperatorNames2["SetTextRise"] = "Ts";
  6762. PDFOperatorNames2["SetWordSpacing"] = "Tw";
  6763. PDFOperatorNames2["ShowText"] = "Tj";
  6764. PDFOperatorNames2["ShowTextAdjusted"] = "TJ";
  6765. PDFOperatorNames2["ShowTextLine"] = "'";
  6766. PDFOperatorNames2["ShowTextLineAndSpace"] = '"';
  6767. PDFOperatorNames2["Type3D0"] = "d0";
  6768. PDFOperatorNames2["Type3D1"] = "d1";
  6769. PDFOperatorNames2["BeginCompatibilitySection"] = "BX";
  6770. PDFOperatorNames2["EndCompatibilitySection"] = "EX";
  6771. })(PDFOperatorNames || (PDFOperatorNames = {}));
  6772. var PDFOperatorNames_default = PDFOperatorNames;
  6773. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/structures/PDFFlateStream.js
  6774. var import_pako2 = __toESM(require_pako());
  6775. var PDFFlateStream = (
  6776. /** @class */
  6777. function(_super) {
  6778. __extends(PDFFlateStream2, _super);
  6779. function PDFFlateStream2(dict, encode) {
  6780. var _this = _super.call(this, dict) || this;
  6781. _this.computeContents = function() {
  6782. var unencodedContents = _this.getUnencodedContents();
  6783. return _this.encode ? import_pako2.default.deflate(unencodedContents) : unencodedContents;
  6784. };
  6785. _this.encode = encode;
  6786. if (encode)
  6787. dict.set(PDFName_default.of("Filter"), PDFName_default.of("FlateDecode"));
  6788. _this.contentsCache = Cache_default.populatedBy(_this.computeContents);
  6789. return _this;
  6790. }
  6791. PDFFlateStream2.prototype.getContents = function() {
  6792. return this.contentsCache.access();
  6793. };
  6794. PDFFlateStream2.prototype.getContentsSize = function() {
  6795. return this.contentsCache.access().length;
  6796. };
  6797. PDFFlateStream2.prototype.getUnencodedContents = function() {
  6798. throw new MethodNotImplementedError(this.constructor.name, "getUnencodedContents");
  6799. };
  6800. return PDFFlateStream2;
  6801. }(PDFStream_default)
  6802. );
  6803. var PDFFlateStream_default = PDFFlateStream;
  6804. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/structures/PDFContentStream.js
  6805. var PDFContentStream = (
  6806. /** @class */
  6807. function(_super) {
  6808. __extends(PDFContentStream2, _super);
  6809. function PDFContentStream2(dict, operators, encode) {
  6810. if (encode === void 0) {
  6811. encode = true;
  6812. }
  6813. var _this = _super.call(this, dict, encode) || this;
  6814. _this.operators = operators;
  6815. return _this;
  6816. }
  6817. PDFContentStream2.prototype.push = function() {
  6818. var _a;
  6819. var operators = [];
  6820. for (var _i = 0; _i < arguments.length; _i++) {
  6821. operators[_i] = arguments[_i];
  6822. }
  6823. (_a = this.operators).push.apply(_a, operators);
  6824. };
  6825. PDFContentStream2.prototype.clone = function(context) {
  6826. var operators = new Array(this.operators.length);
  6827. for (var idx = 0, len = this.operators.length; idx < len; idx++) {
  6828. operators[idx] = this.operators[idx].clone(context);
  6829. }
  6830. var _a = this, dict = _a.dict, encode = _a.encode;
  6831. return PDFContentStream2.of(dict.clone(context), operators, encode);
  6832. };
  6833. PDFContentStream2.prototype.getContentsString = function() {
  6834. var value = "";
  6835. for (var idx = 0, len = this.operators.length; idx < len; idx++) {
  6836. value += this.operators[idx] + "\n";
  6837. }
  6838. return value;
  6839. };
  6840. PDFContentStream2.prototype.getUnencodedContents = function() {
  6841. var buffer = new Uint8Array(this.getUnencodedContentsSize());
  6842. var offset = 0;
  6843. for (var idx = 0, len = this.operators.length; idx < len; idx++) {
  6844. offset += this.operators[idx].copyBytesInto(buffer, offset);
  6845. buffer[offset++] = CharCodes_default.Newline;
  6846. }
  6847. return buffer;
  6848. };
  6849. PDFContentStream2.prototype.getUnencodedContentsSize = function() {
  6850. var size = 0;
  6851. for (var idx = 0, len = this.operators.length; idx < len; idx++) {
  6852. size += this.operators[idx].sizeInBytes() + 1;
  6853. }
  6854. return size;
  6855. };
  6856. PDFContentStream2.of = function(dict, operators, encode) {
  6857. if (encode === void 0) {
  6858. encode = true;
  6859. }
  6860. return new PDFContentStream2(dict, operators, encode);
  6861. };
  6862. return PDFContentStream2;
  6863. }(PDFFlateStream_default)
  6864. );
  6865. var PDFContentStream_default = PDFContentStream;
  6866. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/utils/rng.js
  6867. var SimpleRNG = (
  6868. /** @class */
  6869. function() {
  6870. function SimpleRNG2(seed) {
  6871. this.seed = seed;
  6872. }
  6873. SimpleRNG2.prototype.nextInt = function() {
  6874. var x = Math.sin(this.seed++) * 1e4;
  6875. return x - Math.floor(x);
  6876. };
  6877. SimpleRNG2.withSeed = function(seed) {
  6878. return new SimpleRNG2(seed);
  6879. };
  6880. return SimpleRNG2;
  6881. }()
  6882. );
  6883. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/PDFContext.js
  6884. var byAscendingObjectNumber = function(_a, _b) {
  6885. var a = _a[0];
  6886. var b = _b[0];
  6887. return a.objectNumber - b.objectNumber;
  6888. };
  6889. var PDFContext = (
  6890. /** @class */
  6891. function() {
  6892. function PDFContext2() {
  6893. this.largestObjectNumber = 0;
  6894. this.header = PDFHeader_default.forVersion(1, 7);
  6895. this.trailerInfo = {};
  6896. this.indirectObjects = /* @__PURE__ */ new Map();
  6897. this.rng = SimpleRNG.withSeed(1);
  6898. }
  6899. PDFContext2.prototype.assign = function(ref, object) {
  6900. this.indirectObjects.set(ref, object);
  6901. if (ref.objectNumber > this.largestObjectNumber) {
  6902. this.largestObjectNumber = ref.objectNumber;
  6903. }
  6904. };
  6905. PDFContext2.prototype.nextRef = function() {
  6906. this.largestObjectNumber += 1;
  6907. return PDFRef_default.of(this.largestObjectNumber);
  6908. };
  6909. PDFContext2.prototype.register = function(object) {
  6910. var ref = this.nextRef();
  6911. this.assign(ref, object);
  6912. return ref;
  6913. };
  6914. PDFContext2.prototype.delete = function(ref) {
  6915. return this.indirectObjects.delete(ref);
  6916. };
  6917. PDFContext2.prototype.lookupMaybe = function(ref) {
  6918. var types = [];
  6919. for (var _i = 1; _i < arguments.length; _i++) {
  6920. types[_i - 1] = arguments[_i];
  6921. }
  6922. var preservePDFNull = types.includes(PDFNull_default);
  6923. var result = ref instanceof PDFRef_default ? this.indirectObjects.get(ref) : ref;
  6924. if (!result || result === PDFNull_default && !preservePDFNull)
  6925. return void 0;
  6926. for (var idx = 0, len = types.length; idx < len; idx++) {
  6927. var type = types[idx];
  6928. if (type === PDFNull_default) {
  6929. if (result === PDFNull_default)
  6930. return result;
  6931. } else {
  6932. if (result instanceof type)
  6933. return result;
  6934. }
  6935. }
  6936. throw new UnexpectedObjectTypeError(types, result);
  6937. };
  6938. PDFContext2.prototype.lookup = function(ref) {
  6939. var types = [];
  6940. for (var _i = 1; _i < arguments.length; _i++) {
  6941. types[_i - 1] = arguments[_i];
  6942. }
  6943. var result = ref instanceof PDFRef_default ? this.indirectObjects.get(ref) : ref;
  6944. if (types.length === 0)
  6945. return result;
  6946. for (var idx = 0, len = types.length; idx < len; idx++) {
  6947. var type = types[idx];
  6948. if (type === PDFNull_default) {
  6949. if (result === PDFNull_default)
  6950. return result;
  6951. } else {
  6952. if (result instanceof type)
  6953. return result;
  6954. }
  6955. }
  6956. throw new UnexpectedObjectTypeError(types, result);
  6957. };
  6958. PDFContext2.prototype.getObjectRef = function(pdfObject) {
  6959. var entries = Array.from(this.indirectObjects.entries());
  6960. for (var idx = 0, len = entries.length; idx < len; idx++) {
  6961. var _a = entries[idx], ref = _a[0], object = _a[1];
  6962. if (object === pdfObject) {
  6963. return ref;
  6964. }
  6965. }
  6966. return void 0;
  6967. };
  6968. PDFContext2.prototype.enumerateIndirectObjects = function() {
  6969. return Array.from(this.indirectObjects.entries()).sort(byAscendingObjectNumber);
  6970. };
  6971. PDFContext2.prototype.obj = function(literal) {
  6972. if (literal instanceof PDFObject_default) {
  6973. return literal;
  6974. } else if (literal === null || literal === void 0) {
  6975. return PDFNull_default;
  6976. } else if (typeof literal === "string") {
  6977. return PDFName_default.of(literal);
  6978. } else if (typeof literal === "number") {
  6979. return PDFNumber_default.of(literal);
  6980. } else if (typeof literal === "boolean") {
  6981. return literal ? PDFBool_default.True : PDFBool_default.False;
  6982. } else if (Array.isArray(literal)) {
  6983. var array = PDFArray_default.withContext(this);
  6984. for (var idx = 0, len = literal.length; idx < len; idx++) {
  6985. array.push(this.obj(literal[idx]));
  6986. }
  6987. return array;
  6988. } else {
  6989. var dict = PDFDict_default.withContext(this);
  6990. var keys = Object.keys(literal);
  6991. for (var idx = 0, len = keys.length; idx < len; idx++) {
  6992. var key = keys[idx];
  6993. var value = literal[key];
  6994. if (value !== void 0)
  6995. dict.set(PDFName_default.of(key), this.obj(value));
  6996. }
  6997. return dict;
  6998. }
  6999. };
  7000. PDFContext2.prototype.stream = function(contents, dict) {
  7001. if (dict === void 0) {
  7002. dict = {};
  7003. }
  7004. return PDFRawStream_default.of(this.obj(dict), typedArrayFor(contents));
  7005. };
  7006. PDFContext2.prototype.flateStream = function(contents, dict) {
  7007. if (dict === void 0) {
  7008. dict = {};
  7009. }
  7010. return this.stream(import_pako3.default.deflate(typedArrayFor(contents)), __assign(__assign({}, dict), { Filter: "FlateDecode" }));
  7011. };
  7012. PDFContext2.prototype.contentStream = function(operators, dict) {
  7013. if (dict === void 0) {
  7014. dict = {};
  7015. }
  7016. return PDFContentStream_default.of(this.obj(dict), operators);
  7017. };
  7018. PDFContext2.prototype.formXObject = function(operators, dict) {
  7019. if (dict === void 0) {
  7020. dict = {};
  7021. }
  7022. return this.contentStream(operators, __assign(__assign({ BBox: this.obj([0, 0, 0, 0]), Matrix: this.obj([1, 0, 0, 1, 0, 0]) }, dict), { Type: "XObject", Subtype: "Form" }));
  7023. };
  7024. PDFContext2.prototype.getPushGraphicsStateContentStream = function() {
  7025. if (this.pushGraphicsStateContentStreamRef) {
  7026. return this.pushGraphicsStateContentStreamRef;
  7027. }
  7028. var dict = this.obj({});
  7029. var op = PDFOperator_default.of(PDFOperatorNames_default.PushGraphicsState);
  7030. var stream2 = PDFContentStream_default.of(dict, [op]);
  7031. this.pushGraphicsStateContentStreamRef = this.register(stream2);
  7032. return this.pushGraphicsStateContentStreamRef;
  7033. };
  7034. PDFContext2.prototype.getPopGraphicsStateContentStream = function() {
  7035. if (this.popGraphicsStateContentStreamRef) {
  7036. return this.popGraphicsStateContentStreamRef;
  7037. }
  7038. var dict = this.obj({});
  7039. var op = PDFOperator_default.of(PDFOperatorNames_default.PopGraphicsState);
  7040. var stream2 = PDFContentStream_default.of(dict, [op]);
  7041. this.popGraphicsStateContentStreamRef = this.register(stream2);
  7042. return this.popGraphicsStateContentStreamRef;
  7043. };
  7044. PDFContext2.prototype.addRandomSuffix = function(prefix, suffixLength) {
  7045. if (suffixLength === void 0) {
  7046. suffixLength = 4;
  7047. }
  7048. return prefix + "-" + Math.floor(this.rng.nextInt() * Math.pow(10, suffixLength));
  7049. };
  7050. PDFContext2.create = function() {
  7051. return new PDFContext2();
  7052. };
  7053. return PDFContext2;
  7054. }()
  7055. );
  7056. var PDFContext_default = PDFContext;
  7057. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/structures/PDFPageLeaf.js
  7058. var PDFPageLeaf = (
  7059. /** @class */
  7060. function(_super) {
  7061. __extends(PDFPageLeaf2, _super);
  7062. function PDFPageLeaf2(map, context, autoNormalizeCTM) {
  7063. if (autoNormalizeCTM === void 0) {
  7064. autoNormalizeCTM = true;
  7065. }
  7066. var _this = _super.call(this, map, context) || this;
  7067. _this.normalized = false;
  7068. _this.autoNormalizeCTM = autoNormalizeCTM;
  7069. return _this;
  7070. }
  7071. PDFPageLeaf2.prototype.clone = function(context) {
  7072. var clone = PDFPageLeaf2.fromMapWithContext(/* @__PURE__ */ new Map(), context || this.context, this.autoNormalizeCTM);
  7073. var entries = this.entries();
  7074. for (var idx = 0, len = entries.length; idx < len; idx++) {
  7075. var _a = entries[idx], key = _a[0], value = _a[1];
  7076. clone.set(key, value);
  7077. }
  7078. return clone;
  7079. };
  7080. PDFPageLeaf2.prototype.Parent = function() {
  7081. return this.lookupMaybe(PDFName_default.Parent, PDFDict_default);
  7082. };
  7083. PDFPageLeaf2.prototype.Contents = function() {
  7084. return this.lookup(PDFName_default.of("Contents"));
  7085. };
  7086. PDFPageLeaf2.prototype.Annots = function() {
  7087. return this.lookupMaybe(PDFName_default.Annots, PDFArray_default);
  7088. };
  7089. PDFPageLeaf2.prototype.BleedBox = function() {
  7090. return this.lookupMaybe(PDFName_default.BleedBox, PDFArray_default);
  7091. };
  7092. PDFPageLeaf2.prototype.TrimBox = function() {
  7093. return this.lookupMaybe(PDFName_default.TrimBox, PDFArray_default);
  7094. };
  7095. PDFPageLeaf2.prototype.ArtBox = function() {
  7096. return this.lookupMaybe(PDFName_default.ArtBox, PDFArray_default);
  7097. };
  7098. PDFPageLeaf2.prototype.Resources = function() {
  7099. var dictOrRef = this.getInheritableAttribute(PDFName_default.Resources);
  7100. return this.context.lookupMaybe(dictOrRef, PDFDict_default);
  7101. };
  7102. PDFPageLeaf2.prototype.MediaBox = function() {
  7103. var arrayOrRef = this.getInheritableAttribute(PDFName_default.MediaBox);
  7104. return this.context.lookup(arrayOrRef, PDFArray_default);
  7105. };
  7106. PDFPageLeaf2.prototype.CropBox = function() {
  7107. var arrayOrRef = this.getInheritableAttribute(PDFName_default.CropBox);
  7108. return this.context.lookupMaybe(arrayOrRef, PDFArray_default);
  7109. };
  7110. PDFPageLeaf2.prototype.Rotate = function() {
  7111. var numberOrRef = this.getInheritableAttribute(PDFName_default.Rotate);
  7112. return this.context.lookupMaybe(numberOrRef, PDFNumber_default);
  7113. };
  7114. PDFPageLeaf2.prototype.getInheritableAttribute = function(name) {
  7115. var attribute;
  7116. this.ascend(function(node) {
  7117. if (!attribute)
  7118. attribute = node.get(name);
  7119. });
  7120. return attribute;
  7121. };
  7122. PDFPageLeaf2.prototype.setParent = function(parentRef) {
  7123. this.set(PDFName_default.Parent, parentRef);
  7124. };
  7125. PDFPageLeaf2.prototype.addContentStream = function(contentStreamRef) {
  7126. var Contents = this.normalizedEntries().Contents || this.context.obj([]);
  7127. this.set(PDFName_default.Contents, Contents);
  7128. Contents.push(contentStreamRef);
  7129. };
  7130. PDFPageLeaf2.prototype.wrapContentStreams = function(startStream, endStream) {
  7131. var Contents = this.Contents();
  7132. if (Contents instanceof PDFArray_default) {
  7133. Contents.insert(0, startStream);
  7134. Contents.push(endStream);
  7135. return true;
  7136. }
  7137. return false;
  7138. };
  7139. PDFPageLeaf2.prototype.addAnnot = function(annotRef) {
  7140. var Annots = this.normalizedEntries().Annots;
  7141. Annots.push(annotRef);
  7142. };
  7143. PDFPageLeaf2.prototype.removeAnnot = function(annotRef) {
  7144. var Annots = this.normalizedEntries().Annots;
  7145. var index = Annots.indexOf(annotRef);
  7146. if (index !== void 0) {
  7147. Annots.remove(index);
  7148. }
  7149. };
  7150. PDFPageLeaf2.prototype.setFontDictionary = function(name, fontDictRef) {
  7151. var Font2 = this.normalizedEntries().Font;
  7152. Font2.set(name, fontDictRef);
  7153. };
  7154. PDFPageLeaf2.prototype.newFontDictionaryKey = function(tag) {
  7155. var Font2 = this.normalizedEntries().Font;
  7156. return Font2.uniqueKey(tag);
  7157. };
  7158. PDFPageLeaf2.prototype.newFontDictionary = function(tag, fontDictRef) {
  7159. var key = this.newFontDictionaryKey(tag);
  7160. this.setFontDictionary(key, fontDictRef);
  7161. return key;
  7162. };
  7163. PDFPageLeaf2.prototype.setXObject = function(name, xObjectRef) {
  7164. var XObject = this.normalizedEntries().XObject;
  7165. XObject.set(name, xObjectRef);
  7166. };
  7167. PDFPageLeaf2.prototype.newXObjectKey = function(tag) {
  7168. var XObject = this.normalizedEntries().XObject;
  7169. return XObject.uniqueKey(tag);
  7170. };
  7171. PDFPageLeaf2.prototype.newXObject = function(tag, xObjectRef) {
  7172. var key = this.newXObjectKey(tag);
  7173. this.setXObject(key, xObjectRef);
  7174. return key;
  7175. };
  7176. PDFPageLeaf2.prototype.setExtGState = function(name, extGStateRef) {
  7177. var ExtGState = this.normalizedEntries().ExtGState;
  7178. ExtGState.set(name, extGStateRef);
  7179. };
  7180. PDFPageLeaf2.prototype.newExtGStateKey = function(tag) {
  7181. var ExtGState = this.normalizedEntries().ExtGState;
  7182. return ExtGState.uniqueKey(tag);
  7183. };
  7184. PDFPageLeaf2.prototype.newExtGState = function(tag, extGStateRef) {
  7185. var key = this.newExtGStateKey(tag);
  7186. this.setExtGState(key, extGStateRef);
  7187. return key;
  7188. };
  7189. PDFPageLeaf2.prototype.ascend = function(visitor) {
  7190. visitor(this);
  7191. var Parent = this.Parent();
  7192. if (Parent)
  7193. Parent.ascend(visitor);
  7194. };
  7195. PDFPageLeaf2.prototype.normalize = function() {
  7196. if (this.normalized)
  7197. return;
  7198. var context = this.context;
  7199. var contentsRef = this.get(PDFName_default.Contents);
  7200. var contents = this.context.lookup(contentsRef);
  7201. if (contents instanceof PDFStream_default) {
  7202. this.set(PDFName_default.Contents, context.obj([contentsRef]));
  7203. }
  7204. if (this.autoNormalizeCTM) {
  7205. this.wrapContentStreams(this.context.getPushGraphicsStateContentStream(), this.context.getPopGraphicsStateContentStream());
  7206. }
  7207. var dictOrRef = this.getInheritableAttribute(PDFName_default.Resources);
  7208. var Resources = context.lookupMaybe(dictOrRef, PDFDict_default) || context.obj({});
  7209. this.set(PDFName_default.Resources, Resources);
  7210. var Font2 = Resources.lookupMaybe(PDFName_default.Font, PDFDict_default) || context.obj({});
  7211. Resources.set(PDFName_default.Font, Font2);
  7212. var XObject = Resources.lookupMaybe(PDFName_default.XObject, PDFDict_default) || context.obj({});
  7213. Resources.set(PDFName_default.XObject, XObject);
  7214. var ExtGState = Resources.lookupMaybe(PDFName_default.ExtGState, PDFDict_default) || context.obj({});
  7215. Resources.set(PDFName_default.ExtGState, ExtGState);
  7216. var Annots = this.Annots() || context.obj([]);
  7217. this.set(PDFName_default.Annots, Annots);
  7218. this.normalized = true;
  7219. };
  7220. PDFPageLeaf2.prototype.normalizedEntries = function() {
  7221. this.normalize();
  7222. var Annots = this.Annots();
  7223. var Resources = this.Resources();
  7224. var Contents = this.Contents();
  7225. return {
  7226. Annots,
  7227. Resources,
  7228. Contents,
  7229. Font: Resources.lookup(PDFName_default.Font, PDFDict_default),
  7230. XObject: Resources.lookup(PDFName_default.XObject, PDFDict_default),
  7231. ExtGState: Resources.lookup(PDFName_default.ExtGState, PDFDict_default)
  7232. };
  7233. };
  7234. PDFPageLeaf2.InheritableEntries = [
  7235. "Resources",
  7236. "MediaBox",
  7237. "CropBox",
  7238. "Rotate"
  7239. ];
  7240. PDFPageLeaf2.withContextAndParent = function(context, parent) {
  7241. var dict = /* @__PURE__ */ new Map();
  7242. dict.set(PDFName_default.Type, PDFName_default.Page);
  7243. dict.set(PDFName_default.Parent, parent);
  7244. dict.set(PDFName_default.Resources, context.obj({}));
  7245. dict.set(PDFName_default.MediaBox, context.obj([0, 0, 612, 792]));
  7246. return new PDFPageLeaf2(dict, context, false);
  7247. };
  7248. PDFPageLeaf2.fromMapWithContext = function(map, context, autoNormalizeCTM) {
  7249. if (autoNormalizeCTM === void 0) {
  7250. autoNormalizeCTM = true;
  7251. }
  7252. return new PDFPageLeaf2(map, context, autoNormalizeCTM);
  7253. };
  7254. return PDFPageLeaf2;
  7255. }(PDFDict_default)
  7256. );
  7257. var PDFPageLeaf_default = PDFPageLeaf;
  7258. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/PDFObjectCopier.js
  7259. var PDFObjectCopier = (
  7260. /** @class */
  7261. function() {
  7262. function PDFObjectCopier2(src, dest) {
  7263. var _this = this;
  7264. this.traversedObjects = /* @__PURE__ */ new Map();
  7265. this.copy = function(object) {
  7266. return object instanceof PDFPageLeaf_default ? _this.copyPDFPage(object) : object instanceof PDFDict_default ? _this.copyPDFDict(object) : object instanceof PDFArray_default ? _this.copyPDFArray(object) : object instanceof PDFStream_default ? _this.copyPDFStream(object) : object instanceof PDFRef_default ? _this.copyPDFIndirectObject(object) : object.clone();
  7267. };
  7268. this.copyPDFPage = function(originalPage) {
  7269. var clonedPage = originalPage.clone();
  7270. var InheritableEntries = PDFPageLeaf_default.InheritableEntries;
  7271. for (var idx = 0, len = InheritableEntries.length; idx < len; idx++) {
  7272. var key = PDFName_default.of(InheritableEntries[idx]);
  7273. var value = clonedPage.getInheritableAttribute(key);
  7274. if (!clonedPage.get(key) && value)
  7275. clonedPage.set(key, value);
  7276. }
  7277. clonedPage.delete(PDFName_default.of("Parent"));
  7278. return _this.copyPDFDict(clonedPage);
  7279. };
  7280. this.copyPDFDict = function(originalDict) {
  7281. if (_this.traversedObjects.has(originalDict)) {
  7282. return _this.traversedObjects.get(originalDict);
  7283. }
  7284. var clonedDict = originalDict.clone(_this.dest);
  7285. _this.traversedObjects.set(originalDict, clonedDict);
  7286. var entries = originalDict.entries();
  7287. for (var idx = 0, len = entries.length; idx < len; idx++) {
  7288. var _a = entries[idx], key = _a[0], value = _a[1];
  7289. clonedDict.set(key, _this.copy(value));
  7290. }
  7291. return clonedDict;
  7292. };
  7293. this.copyPDFArray = function(originalArray) {
  7294. if (_this.traversedObjects.has(originalArray)) {
  7295. return _this.traversedObjects.get(originalArray);
  7296. }
  7297. var clonedArray = originalArray.clone(_this.dest);
  7298. _this.traversedObjects.set(originalArray, clonedArray);
  7299. for (var idx = 0, len = originalArray.size(); idx < len; idx++) {
  7300. var value = originalArray.get(idx);
  7301. clonedArray.set(idx, _this.copy(value));
  7302. }
  7303. return clonedArray;
  7304. };
  7305. this.copyPDFStream = function(originalStream) {
  7306. if (_this.traversedObjects.has(originalStream)) {
  7307. return _this.traversedObjects.get(originalStream);
  7308. }
  7309. var clonedStream = originalStream.clone(_this.dest);
  7310. _this.traversedObjects.set(originalStream, clonedStream);
  7311. var entries = originalStream.dict.entries();
  7312. for (var idx = 0, len = entries.length; idx < len; idx++) {
  7313. var _a = entries[idx], key = _a[0], value = _a[1];
  7314. clonedStream.dict.set(key, _this.copy(value));
  7315. }
  7316. return clonedStream;
  7317. };
  7318. this.copyPDFIndirectObject = function(ref) {
  7319. var alreadyMapped = _this.traversedObjects.has(ref);
  7320. if (!alreadyMapped) {
  7321. var newRef = _this.dest.nextRef();
  7322. _this.traversedObjects.set(ref, newRef);
  7323. var dereferencedValue = _this.src.lookup(ref);
  7324. if (dereferencedValue) {
  7325. var cloned = _this.copy(dereferencedValue);
  7326. _this.dest.assign(newRef, cloned);
  7327. }
  7328. }
  7329. return _this.traversedObjects.get(ref);
  7330. };
  7331. this.src = src;
  7332. this.dest = dest;
  7333. }
  7334. PDFObjectCopier2.for = function(src, dest) {
  7335. return new PDFObjectCopier2(src, dest);
  7336. };
  7337. return PDFObjectCopier2;
  7338. }()
  7339. );
  7340. var PDFObjectCopier_default = PDFObjectCopier;
  7341. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/document/PDFCrossRefSection.js
  7342. var PDFCrossRefSection = (
  7343. /** @class */
  7344. function() {
  7345. function PDFCrossRefSection2(firstEntry) {
  7346. this.subsections = firstEntry ? [[firstEntry]] : [];
  7347. this.chunkIdx = 0;
  7348. this.chunkLength = firstEntry ? 1 : 0;
  7349. }
  7350. PDFCrossRefSection2.prototype.addEntry = function(ref, offset) {
  7351. this.append({ ref, offset, deleted: false });
  7352. };
  7353. PDFCrossRefSection2.prototype.addDeletedEntry = function(ref, nextFreeObjectNumber) {
  7354. this.append({ ref, offset: nextFreeObjectNumber, deleted: true });
  7355. };
  7356. PDFCrossRefSection2.prototype.toString = function() {
  7357. var section = "xref\n";
  7358. for (var rangeIdx = 0, rangeLen = this.subsections.length; rangeIdx < rangeLen; rangeIdx++) {
  7359. var range2 = this.subsections[rangeIdx];
  7360. section += range2[0].ref.objectNumber + " " + range2.length + "\n";
  7361. for (var entryIdx = 0, entryLen = range2.length; entryIdx < entryLen; entryIdx++) {
  7362. var entry = range2[entryIdx];
  7363. section += padStart(String(entry.offset), 10, "0");
  7364. section += " ";
  7365. section += padStart(String(entry.ref.generationNumber), 5, "0");
  7366. section += " ";
  7367. section += entry.deleted ? "f" : "n";
  7368. section += " \n";
  7369. }
  7370. }
  7371. return section;
  7372. };
  7373. PDFCrossRefSection2.prototype.sizeInBytes = function() {
  7374. var size = 5;
  7375. for (var idx = 0, len = this.subsections.length; idx < len; idx++) {
  7376. var subsection = this.subsections[idx];
  7377. var subsectionLength = subsection.length;
  7378. var firstEntry = subsection[0];
  7379. size += 2;
  7380. size += String(firstEntry.ref.objectNumber).length;
  7381. size += String(subsectionLength).length;
  7382. size += 20 * subsectionLength;
  7383. }
  7384. return size;
  7385. };
  7386. PDFCrossRefSection2.prototype.copyBytesInto = function(buffer, offset) {
  7387. var initialOffset = offset;
  7388. buffer[offset++] = CharCodes_default.x;
  7389. buffer[offset++] = CharCodes_default.r;
  7390. buffer[offset++] = CharCodes_default.e;
  7391. buffer[offset++] = CharCodes_default.f;
  7392. buffer[offset++] = CharCodes_default.Newline;
  7393. offset += this.copySubsectionsIntoBuffer(this.subsections, buffer, offset);
  7394. return offset - initialOffset;
  7395. };
  7396. PDFCrossRefSection2.prototype.copySubsectionsIntoBuffer = function(subsections, buffer, offset) {
  7397. var initialOffset = offset;
  7398. var length = subsections.length;
  7399. for (var idx = 0; idx < length; idx++) {
  7400. var subsection = this.subsections[idx];
  7401. var firstObjectNumber = String(subsection[0].ref.objectNumber);
  7402. offset += copyStringIntoBuffer(firstObjectNumber, buffer, offset);
  7403. buffer[offset++] = CharCodes_default.Space;
  7404. var rangeLength = String(subsection.length);
  7405. offset += copyStringIntoBuffer(rangeLength, buffer, offset);
  7406. buffer[offset++] = CharCodes_default.Newline;
  7407. offset += this.copyEntriesIntoBuffer(subsection, buffer, offset);
  7408. }
  7409. return offset - initialOffset;
  7410. };
  7411. PDFCrossRefSection2.prototype.copyEntriesIntoBuffer = function(entries, buffer, offset) {
  7412. var length = entries.length;
  7413. for (var idx = 0; idx < length; idx++) {
  7414. var entry = entries[idx];
  7415. var entryOffset = padStart(String(entry.offset), 10, "0");
  7416. offset += copyStringIntoBuffer(entryOffset, buffer, offset);
  7417. buffer[offset++] = CharCodes_default.Space;
  7418. var entryGen = padStart(String(entry.ref.generationNumber), 5, "0");
  7419. offset += copyStringIntoBuffer(entryGen, buffer, offset);
  7420. buffer[offset++] = CharCodes_default.Space;
  7421. buffer[offset++] = entry.deleted ? CharCodes_default.f : CharCodes_default.n;
  7422. buffer[offset++] = CharCodes_default.Space;
  7423. buffer[offset++] = CharCodes_default.Newline;
  7424. }
  7425. return 20 * length;
  7426. };
  7427. PDFCrossRefSection2.prototype.append = function(currEntry) {
  7428. if (this.chunkLength === 0) {
  7429. this.subsections.push([currEntry]);
  7430. this.chunkIdx = 0;
  7431. this.chunkLength = 1;
  7432. return;
  7433. }
  7434. var chunk = this.subsections[this.chunkIdx];
  7435. var prevEntry = chunk[this.chunkLength - 1];
  7436. if (currEntry.ref.objectNumber - prevEntry.ref.objectNumber > 1) {
  7437. this.subsections.push([currEntry]);
  7438. this.chunkIdx += 1;
  7439. this.chunkLength = 1;
  7440. } else {
  7441. chunk.push(currEntry);
  7442. this.chunkLength += 1;
  7443. }
  7444. };
  7445. PDFCrossRefSection2.create = function() {
  7446. return new PDFCrossRefSection2({
  7447. ref: PDFRef_default.of(0, 65535),
  7448. offset: 0,
  7449. deleted: true
  7450. });
  7451. };
  7452. PDFCrossRefSection2.createEmpty = function() {
  7453. return new PDFCrossRefSection2();
  7454. };
  7455. return PDFCrossRefSection2;
  7456. }()
  7457. );
  7458. var PDFCrossRefSection_default = PDFCrossRefSection;
  7459. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/document/PDFTrailer.js
  7460. var PDFTrailer = (
  7461. /** @class */
  7462. function() {
  7463. function PDFTrailer2(lastXRefOffset) {
  7464. this.lastXRefOffset = String(lastXRefOffset);
  7465. }
  7466. PDFTrailer2.prototype.toString = function() {
  7467. return "startxref\n" + this.lastXRefOffset + "\n%%EOF";
  7468. };
  7469. PDFTrailer2.prototype.sizeInBytes = function() {
  7470. return 16 + this.lastXRefOffset.length;
  7471. };
  7472. PDFTrailer2.prototype.copyBytesInto = function(buffer, offset) {
  7473. var initialOffset = offset;
  7474. buffer[offset++] = CharCodes_default.s;
  7475. buffer[offset++] = CharCodes_default.t;
  7476. buffer[offset++] = CharCodes_default.a;
  7477. buffer[offset++] = CharCodes_default.r;
  7478. buffer[offset++] = CharCodes_default.t;
  7479. buffer[offset++] = CharCodes_default.x;
  7480. buffer[offset++] = CharCodes_default.r;
  7481. buffer[offset++] = CharCodes_default.e;
  7482. buffer[offset++] = CharCodes_default.f;
  7483. buffer[offset++] = CharCodes_default.Newline;
  7484. offset += copyStringIntoBuffer(this.lastXRefOffset, buffer, offset);
  7485. buffer[offset++] = CharCodes_default.Newline;
  7486. buffer[offset++] = CharCodes_default.Percent;
  7487. buffer[offset++] = CharCodes_default.Percent;
  7488. buffer[offset++] = CharCodes_default.E;
  7489. buffer[offset++] = CharCodes_default.O;
  7490. buffer[offset++] = CharCodes_default.F;
  7491. return offset - initialOffset;
  7492. };
  7493. PDFTrailer2.forLastCrossRefSectionOffset = function(offset) {
  7494. return new PDFTrailer2(offset);
  7495. };
  7496. return PDFTrailer2;
  7497. }()
  7498. );
  7499. var PDFTrailer_default = PDFTrailer;
  7500. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/document/PDFTrailerDict.js
  7501. var PDFTrailerDict = (
  7502. /** @class */
  7503. function() {
  7504. function PDFTrailerDict2(dict) {
  7505. this.dict = dict;
  7506. }
  7507. PDFTrailerDict2.prototype.toString = function() {
  7508. return "trailer\n" + this.dict.toString();
  7509. };
  7510. PDFTrailerDict2.prototype.sizeInBytes = function() {
  7511. return 8 + this.dict.sizeInBytes();
  7512. };
  7513. PDFTrailerDict2.prototype.copyBytesInto = function(buffer, offset) {
  7514. var initialOffset = offset;
  7515. buffer[offset++] = CharCodes_default.t;
  7516. buffer[offset++] = CharCodes_default.r;
  7517. buffer[offset++] = CharCodes_default.a;
  7518. buffer[offset++] = CharCodes_default.i;
  7519. buffer[offset++] = CharCodes_default.l;
  7520. buffer[offset++] = CharCodes_default.e;
  7521. buffer[offset++] = CharCodes_default.r;
  7522. buffer[offset++] = CharCodes_default.Newline;
  7523. offset += this.dict.copyBytesInto(buffer, offset);
  7524. return offset - initialOffset;
  7525. };
  7526. PDFTrailerDict2.of = function(dict) {
  7527. return new PDFTrailerDict2(dict);
  7528. };
  7529. return PDFTrailerDict2;
  7530. }()
  7531. );
  7532. var PDFTrailerDict_default = PDFTrailerDict;
  7533. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/structures/PDFObjectStream.js
  7534. var PDFObjectStream = (
  7535. /** @class */
  7536. function(_super) {
  7537. __extends(PDFObjectStream2, _super);
  7538. function PDFObjectStream2(context, objects, encode) {
  7539. if (encode === void 0) {
  7540. encode = true;
  7541. }
  7542. var _this = _super.call(this, context.obj({}), encode) || this;
  7543. _this.objects = objects;
  7544. _this.offsets = _this.computeObjectOffsets();
  7545. _this.offsetsString = _this.computeOffsetsString();
  7546. _this.dict.set(PDFName_default.of("Type"), PDFName_default.of("ObjStm"));
  7547. _this.dict.set(PDFName_default.of("N"), PDFNumber_default.of(_this.objects.length));
  7548. _this.dict.set(PDFName_default.of("First"), PDFNumber_default.of(_this.offsetsString.length));
  7549. return _this;
  7550. }
  7551. PDFObjectStream2.prototype.getObjectsCount = function() {
  7552. return this.objects.length;
  7553. };
  7554. PDFObjectStream2.prototype.clone = function(context) {
  7555. return PDFObjectStream2.withContextAndObjects(context || this.dict.context, this.objects.slice(), this.encode);
  7556. };
  7557. PDFObjectStream2.prototype.getContentsString = function() {
  7558. var value = this.offsetsString;
  7559. for (var idx = 0, len = this.objects.length; idx < len; idx++) {
  7560. var _a = this.objects[idx], object = _a[1];
  7561. value += object + "\n";
  7562. }
  7563. return value;
  7564. };
  7565. PDFObjectStream2.prototype.getUnencodedContents = function() {
  7566. var buffer = new Uint8Array(this.getUnencodedContentsSize());
  7567. var offset = copyStringIntoBuffer(this.offsetsString, buffer, 0);
  7568. for (var idx = 0, len = this.objects.length; idx < len; idx++) {
  7569. var _a = this.objects[idx], object = _a[1];
  7570. offset += object.copyBytesInto(buffer, offset);
  7571. buffer[offset++] = CharCodes_default.Newline;
  7572. }
  7573. return buffer;
  7574. };
  7575. PDFObjectStream2.prototype.getUnencodedContentsSize = function() {
  7576. return this.offsetsString.length + last(this.offsets)[1] + last(this.objects)[1].sizeInBytes() + 1;
  7577. };
  7578. PDFObjectStream2.prototype.computeOffsetsString = function() {
  7579. var offsetsString = "";
  7580. for (var idx = 0, len = this.offsets.length; idx < len; idx++) {
  7581. var _a = this.offsets[idx], objectNumber = _a[0], offset = _a[1];
  7582. offsetsString += objectNumber + " " + offset + " ";
  7583. }
  7584. return offsetsString;
  7585. };
  7586. PDFObjectStream2.prototype.computeObjectOffsets = function() {
  7587. var offset = 0;
  7588. var offsets = new Array(this.objects.length);
  7589. for (var idx = 0, len = this.objects.length; idx < len; idx++) {
  7590. var _a = this.objects[idx], ref = _a[0], object = _a[1];
  7591. offsets[idx] = [ref.objectNumber, offset];
  7592. offset += object.sizeInBytes() + 1;
  7593. }
  7594. return offsets;
  7595. };
  7596. PDFObjectStream2.withContextAndObjects = function(context, objects, encode) {
  7597. if (encode === void 0) {
  7598. encode = true;
  7599. }
  7600. return new PDFObjectStream2(context, objects, encode);
  7601. };
  7602. return PDFObjectStream2;
  7603. }(PDFFlateStream_default)
  7604. );
  7605. var PDFObjectStream_default = PDFObjectStream;
  7606. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/writers/PDFWriter.js
  7607. var PDFWriter = (
  7608. /** @class */
  7609. function() {
  7610. function PDFWriter2(context, objectsPerTick) {
  7611. var _this = this;
  7612. this.parsedObjects = 0;
  7613. this.shouldWaitForTick = function(n) {
  7614. _this.parsedObjects += n;
  7615. return _this.parsedObjects % _this.objectsPerTick === 0;
  7616. };
  7617. this.context = context;
  7618. this.objectsPerTick = objectsPerTick;
  7619. }
  7620. PDFWriter2.prototype.serializeToBuffer = function() {
  7621. return __awaiter(this, void 0, void 0, function() {
  7622. var _a, size, header, indirectObjects, xref, trailerDict, trailer, offset, buffer, idx, len, _b, ref, object, objectNumber, generationNumber, n;
  7623. return __generator(this, function(_c) {
  7624. switch (_c.label) {
  7625. case 0:
  7626. return [4, this.computeBufferSize()];
  7627. case 1:
  7628. _a = _c.sent(), size = _a.size, header = _a.header, indirectObjects = _a.indirectObjects, xref = _a.xref, trailerDict = _a.trailerDict, trailer = _a.trailer;
  7629. offset = 0;
  7630. buffer = new Uint8Array(size);
  7631. offset += header.copyBytesInto(buffer, offset);
  7632. buffer[offset++] = CharCodes_default.Newline;
  7633. buffer[offset++] = CharCodes_default.Newline;
  7634. idx = 0, len = indirectObjects.length;
  7635. _c.label = 2;
  7636. case 2:
  7637. if (!(idx < len)) return [3, 5];
  7638. _b = indirectObjects[idx], ref = _b[0], object = _b[1];
  7639. objectNumber = String(ref.objectNumber);
  7640. offset += copyStringIntoBuffer(objectNumber, buffer, offset);
  7641. buffer[offset++] = CharCodes_default.Space;
  7642. generationNumber = String(ref.generationNumber);
  7643. offset += copyStringIntoBuffer(generationNumber, buffer, offset);
  7644. buffer[offset++] = CharCodes_default.Space;
  7645. buffer[offset++] = CharCodes_default.o;
  7646. buffer[offset++] = CharCodes_default.b;
  7647. buffer[offset++] = CharCodes_default.j;
  7648. buffer[offset++] = CharCodes_default.Newline;
  7649. offset += object.copyBytesInto(buffer, offset);
  7650. buffer[offset++] = CharCodes_default.Newline;
  7651. buffer[offset++] = CharCodes_default.e;
  7652. buffer[offset++] = CharCodes_default.n;
  7653. buffer[offset++] = CharCodes_default.d;
  7654. buffer[offset++] = CharCodes_default.o;
  7655. buffer[offset++] = CharCodes_default.b;
  7656. buffer[offset++] = CharCodes_default.j;
  7657. buffer[offset++] = CharCodes_default.Newline;
  7658. buffer[offset++] = CharCodes_default.Newline;
  7659. n = object instanceof PDFObjectStream_default ? object.getObjectsCount() : 1;
  7660. if (!this.shouldWaitForTick(n)) return [3, 4];
  7661. return [4, waitForTick()];
  7662. case 3:
  7663. _c.sent();
  7664. _c.label = 4;
  7665. case 4:
  7666. idx++;
  7667. return [3, 2];
  7668. case 5:
  7669. if (xref) {
  7670. offset += xref.copyBytesInto(buffer, offset);
  7671. buffer[offset++] = CharCodes_default.Newline;
  7672. }
  7673. if (trailerDict) {
  7674. offset += trailerDict.copyBytesInto(buffer, offset);
  7675. buffer[offset++] = CharCodes_default.Newline;
  7676. buffer[offset++] = CharCodes_default.Newline;
  7677. }
  7678. offset += trailer.copyBytesInto(buffer, offset);
  7679. return [2, buffer];
  7680. }
  7681. });
  7682. });
  7683. };
  7684. PDFWriter2.prototype.computeIndirectObjectSize = function(_a) {
  7685. var ref = _a[0], object = _a[1];
  7686. var refSize = ref.sizeInBytes() + 3;
  7687. var objectSize = object.sizeInBytes() + 9;
  7688. return refSize + objectSize;
  7689. };
  7690. PDFWriter2.prototype.createTrailerDict = function() {
  7691. return this.context.obj({
  7692. Size: this.context.largestObjectNumber + 1,
  7693. Root: this.context.trailerInfo.Root,
  7694. Encrypt: this.context.trailerInfo.Encrypt,
  7695. Info: this.context.trailerInfo.Info,
  7696. ID: this.context.trailerInfo.ID
  7697. });
  7698. };
  7699. PDFWriter2.prototype.computeBufferSize = function() {
  7700. return __awaiter(this, void 0, void 0, function() {
  7701. var header, size, xref, indirectObjects, idx, len, indirectObject, ref, xrefOffset, trailerDict, trailer;
  7702. return __generator(this, function(_a) {
  7703. switch (_a.label) {
  7704. case 0:
  7705. header = PDFHeader_default.forVersion(1, 7);
  7706. size = header.sizeInBytes() + 2;
  7707. xref = PDFCrossRefSection_default.create();
  7708. indirectObjects = this.context.enumerateIndirectObjects();
  7709. idx = 0, len = indirectObjects.length;
  7710. _a.label = 1;
  7711. case 1:
  7712. if (!(idx < len)) return [3, 4];
  7713. indirectObject = indirectObjects[idx];
  7714. ref = indirectObject[0];
  7715. xref.addEntry(ref, size);
  7716. size += this.computeIndirectObjectSize(indirectObject);
  7717. if (!this.shouldWaitForTick(1)) return [3, 3];
  7718. return [4, waitForTick()];
  7719. case 2:
  7720. _a.sent();
  7721. _a.label = 3;
  7722. case 3:
  7723. idx++;
  7724. return [3, 1];
  7725. case 4:
  7726. xrefOffset = size;
  7727. size += xref.sizeInBytes() + 1;
  7728. trailerDict = PDFTrailerDict_default.of(this.createTrailerDict());
  7729. size += trailerDict.sizeInBytes() + 2;
  7730. trailer = PDFTrailer_default.forLastCrossRefSectionOffset(xrefOffset);
  7731. size += trailer.sizeInBytes();
  7732. return [2, { size, header, indirectObjects, xref, trailerDict, trailer }];
  7733. }
  7734. });
  7735. });
  7736. };
  7737. PDFWriter2.forContext = function(context, objectsPerTick) {
  7738. return new PDFWriter2(context, objectsPerTick);
  7739. };
  7740. return PDFWriter2;
  7741. }()
  7742. );
  7743. var PDFWriter_default = PDFWriter;
  7744. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/objects/PDFInvalidObject.js
  7745. var PDFInvalidObject = (
  7746. /** @class */
  7747. function(_super) {
  7748. __extends(PDFInvalidObject2, _super);
  7749. function PDFInvalidObject2(data) {
  7750. var _this = _super.call(this) || this;
  7751. _this.data = data;
  7752. return _this;
  7753. }
  7754. PDFInvalidObject2.prototype.clone = function() {
  7755. return PDFInvalidObject2.of(this.data.slice());
  7756. };
  7757. PDFInvalidObject2.prototype.toString = function() {
  7758. return "PDFInvalidObject(" + this.data.length + " bytes)";
  7759. };
  7760. PDFInvalidObject2.prototype.sizeInBytes = function() {
  7761. return this.data.length;
  7762. };
  7763. PDFInvalidObject2.prototype.copyBytesInto = function(buffer, offset) {
  7764. var length = this.data.length;
  7765. for (var idx = 0; idx < length; idx++) {
  7766. buffer[offset++] = this.data[idx];
  7767. }
  7768. return length;
  7769. };
  7770. PDFInvalidObject2.of = function(data) {
  7771. return new PDFInvalidObject2(data);
  7772. };
  7773. return PDFInvalidObject2;
  7774. }(PDFObject_default)
  7775. );
  7776. var PDFInvalidObject_default = PDFInvalidObject;
  7777. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/structures/PDFCrossRefStream.js
  7778. var EntryType;
  7779. (function(EntryType2) {
  7780. EntryType2[EntryType2["Deleted"] = 0] = "Deleted";
  7781. EntryType2[EntryType2["Uncompressed"] = 1] = "Uncompressed";
  7782. EntryType2[EntryType2["Compressed"] = 2] = "Compressed";
  7783. })(EntryType || (EntryType = {}));
  7784. var PDFCrossRefStream = (
  7785. /** @class */
  7786. function(_super) {
  7787. __extends(PDFCrossRefStream2, _super);
  7788. function PDFCrossRefStream2(dict, entries, encode) {
  7789. if (encode === void 0) {
  7790. encode = true;
  7791. }
  7792. var _this = _super.call(this, dict, encode) || this;
  7793. _this.computeIndex = function() {
  7794. var subsections = [];
  7795. var subsectionLength = 0;
  7796. for (var idx = 0, len = _this.entries.length; idx < len; idx++) {
  7797. var currEntry = _this.entries[idx];
  7798. var prevEntry = _this.entries[idx - 1];
  7799. if (idx === 0) {
  7800. subsections.push(currEntry.ref.objectNumber);
  7801. } else if (currEntry.ref.objectNumber - prevEntry.ref.objectNumber > 1) {
  7802. subsections.push(subsectionLength);
  7803. subsections.push(currEntry.ref.objectNumber);
  7804. subsectionLength = 0;
  7805. }
  7806. subsectionLength += 1;
  7807. }
  7808. subsections.push(subsectionLength);
  7809. return subsections;
  7810. };
  7811. _this.computeEntryTuples = function() {
  7812. var entryTuples = new Array(_this.entries.length);
  7813. for (var idx = 0, len = _this.entries.length; idx < len; idx++) {
  7814. var entry = _this.entries[idx];
  7815. if (entry.type === EntryType.Deleted) {
  7816. var type = entry.type, nextFreeObjectNumber = entry.nextFreeObjectNumber, ref = entry.ref;
  7817. entryTuples[idx] = [type, nextFreeObjectNumber, ref.generationNumber];
  7818. }
  7819. if (entry.type === EntryType.Uncompressed) {
  7820. var type = entry.type, offset = entry.offset, ref = entry.ref;
  7821. entryTuples[idx] = [type, offset, ref.generationNumber];
  7822. }
  7823. if (entry.type === EntryType.Compressed) {
  7824. var type = entry.type, objectStreamRef = entry.objectStreamRef, index = entry.index;
  7825. entryTuples[idx] = [type, objectStreamRef.objectNumber, index];
  7826. }
  7827. }
  7828. return entryTuples;
  7829. };
  7830. _this.computeMaxEntryByteWidths = function() {
  7831. var entryTuples = _this.entryTuplesCache.access();
  7832. var widths = [0, 0, 0];
  7833. for (var idx = 0, len = entryTuples.length; idx < len; idx++) {
  7834. var _a = entryTuples[idx], first = _a[0], second = _a[1], third = _a[2];
  7835. var firstSize = sizeInBytes(first);
  7836. var secondSize = sizeInBytes(second);
  7837. var thirdSize = sizeInBytes(third);
  7838. if (firstSize > widths[0])
  7839. widths[0] = firstSize;
  7840. if (secondSize > widths[1])
  7841. widths[1] = secondSize;
  7842. if (thirdSize > widths[2])
  7843. widths[2] = thirdSize;
  7844. }
  7845. return widths;
  7846. };
  7847. _this.entries = entries || [];
  7848. _this.entryTuplesCache = Cache_default.populatedBy(_this.computeEntryTuples);
  7849. _this.maxByteWidthsCache = Cache_default.populatedBy(_this.computeMaxEntryByteWidths);
  7850. _this.indexCache = Cache_default.populatedBy(_this.computeIndex);
  7851. dict.set(PDFName_default.of("Type"), PDFName_default.of("XRef"));
  7852. return _this;
  7853. }
  7854. PDFCrossRefStream2.prototype.addDeletedEntry = function(ref, nextFreeObjectNumber) {
  7855. var type = EntryType.Deleted;
  7856. this.entries.push({ type, ref, nextFreeObjectNumber });
  7857. this.entryTuplesCache.invalidate();
  7858. this.maxByteWidthsCache.invalidate();
  7859. this.indexCache.invalidate();
  7860. this.contentsCache.invalidate();
  7861. };
  7862. PDFCrossRefStream2.prototype.addUncompressedEntry = function(ref, offset) {
  7863. var type = EntryType.Uncompressed;
  7864. this.entries.push({ type, ref, offset });
  7865. this.entryTuplesCache.invalidate();
  7866. this.maxByteWidthsCache.invalidate();
  7867. this.indexCache.invalidate();
  7868. this.contentsCache.invalidate();
  7869. };
  7870. PDFCrossRefStream2.prototype.addCompressedEntry = function(ref, objectStreamRef, index) {
  7871. var type = EntryType.Compressed;
  7872. this.entries.push({ type, ref, objectStreamRef, index });
  7873. this.entryTuplesCache.invalidate();
  7874. this.maxByteWidthsCache.invalidate();
  7875. this.indexCache.invalidate();
  7876. this.contentsCache.invalidate();
  7877. };
  7878. PDFCrossRefStream2.prototype.clone = function(context) {
  7879. var _a = this, dict = _a.dict, entries = _a.entries, encode = _a.encode;
  7880. return PDFCrossRefStream2.of(dict.clone(context), entries.slice(), encode);
  7881. };
  7882. PDFCrossRefStream2.prototype.getContentsString = function() {
  7883. var entryTuples = this.entryTuplesCache.access();
  7884. var byteWidths = this.maxByteWidthsCache.access();
  7885. var value = "";
  7886. for (var entryIdx = 0, entriesLen = entryTuples.length; entryIdx < entriesLen; entryIdx++) {
  7887. var _a = entryTuples[entryIdx], first = _a[0], second = _a[1], third = _a[2];
  7888. var firstBytes = reverseArray(bytesFor(first));
  7889. var secondBytes = reverseArray(bytesFor(second));
  7890. var thirdBytes = reverseArray(bytesFor(third));
  7891. for (var idx = byteWidths[0] - 1; idx >= 0; idx--) {
  7892. value += (firstBytes[idx] || 0).toString(2);
  7893. }
  7894. for (var idx = byteWidths[1] - 1; idx >= 0; idx--) {
  7895. value += (secondBytes[idx] || 0).toString(2);
  7896. }
  7897. for (var idx = byteWidths[2] - 1; idx >= 0; idx--) {
  7898. value += (thirdBytes[idx] || 0).toString(2);
  7899. }
  7900. }
  7901. return value;
  7902. };
  7903. PDFCrossRefStream2.prototype.getUnencodedContents = function() {
  7904. var entryTuples = this.entryTuplesCache.access();
  7905. var byteWidths = this.maxByteWidthsCache.access();
  7906. var buffer = new Uint8Array(this.getUnencodedContentsSize());
  7907. var offset = 0;
  7908. for (var entryIdx = 0, entriesLen = entryTuples.length; entryIdx < entriesLen; entryIdx++) {
  7909. var _a = entryTuples[entryIdx], first = _a[0], second = _a[1], third = _a[2];
  7910. var firstBytes = reverseArray(bytesFor(first));
  7911. var secondBytes = reverseArray(bytesFor(second));
  7912. var thirdBytes = reverseArray(bytesFor(third));
  7913. for (var idx = byteWidths[0] - 1; idx >= 0; idx--) {
  7914. buffer[offset++] = firstBytes[idx] || 0;
  7915. }
  7916. for (var idx = byteWidths[1] - 1; idx >= 0; idx--) {
  7917. buffer[offset++] = secondBytes[idx] || 0;
  7918. }
  7919. for (var idx = byteWidths[2] - 1; idx >= 0; idx--) {
  7920. buffer[offset++] = thirdBytes[idx] || 0;
  7921. }
  7922. }
  7923. return buffer;
  7924. };
  7925. PDFCrossRefStream2.prototype.getUnencodedContentsSize = function() {
  7926. var byteWidths = this.maxByteWidthsCache.access();
  7927. var entryWidth = sum(byteWidths);
  7928. return entryWidth * this.entries.length;
  7929. };
  7930. PDFCrossRefStream2.prototype.updateDict = function() {
  7931. _super.prototype.updateDict.call(this);
  7932. var byteWidths = this.maxByteWidthsCache.access();
  7933. var index = this.indexCache.access();
  7934. var context = this.dict.context;
  7935. this.dict.set(PDFName_default.of("W"), context.obj(byteWidths));
  7936. this.dict.set(PDFName_default.of("Index"), context.obj(index));
  7937. };
  7938. PDFCrossRefStream2.create = function(dict, encode) {
  7939. if (encode === void 0) {
  7940. encode = true;
  7941. }
  7942. var stream2 = new PDFCrossRefStream2(dict, [], encode);
  7943. stream2.addDeletedEntry(PDFRef_default.of(0, 65535), 0);
  7944. return stream2;
  7945. };
  7946. PDFCrossRefStream2.of = function(dict, entries, encode) {
  7947. if (encode === void 0) {
  7948. encode = true;
  7949. }
  7950. return new PDFCrossRefStream2(dict, entries, encode);
  7951. };
  7952. return PDFCrossRefStream2;
  7953. }(PDFFlateStream_default)
  7954. );
  7955. var PDFCrossRefStream_default = PDFCrossRefStream;
  7956. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/writers/PDFStreamWriter.js
  7957. var PDFStreamWriter = (
  7958. /** @class */
  7959. function(_super) {
  7960. __extends(PDFStreamWriter2, _super);
  7961. function PDFStreamWriter2(context, objectsPerTick, encodeStreams, objectsPerStream) {
  7962. var _this = _super.call(this, context, objectsPerTick) || this;
  7963. _this.encodeStreams = encodeStreams;
  7964. _this.objectsPerStream = objectsPerStream;
  7965. return _this;
  7966. }
  7967. PDFStreamWriter2.prototype.computeBufferSize = function() {
  7968. return __awaiter(this, void 0, void 0, function() {
  7969. var objectNumber, header, size, xrefStream, uncompressedObjects, compressedObjects, objectStreamRefs, indirectObjects, idx, len, indirectObject, ref, object, shouldNotCompress, chunk, objectStreamRef, idx, len, chunk, ref, objectStream, xrefStreamRef, xrefOffset, trailer;
  7970. return __generator(this, function(_a) {
  7971. switch (_a.label) {
  7972. case 0:
  7973. objectNumber = this.context.largestObjectNumber + 1;
  7974. header = PDFHeader_default.forVersion(1, 7);
  7975. size = header.sizeInBytes() + 2;
  7976. xrefStream = PDFCrossRefStream_default.create(this.createTrailerDict(), this.encodeStreams);
  7977. uncompressedObjects = [];
  7978. compressedObjects = [];
  7979. objectStreamRefs = [];
  7980. indirectObjects = this.context.enumerateIndirectObjects();
  7981. idx = 0, len = indirectObjects.length;
  7982. _a.label = 1;
  7983. case 1:
  7984. if (!(idx < len)) return [3, 6];
  7985. indirectObject = indirectObjects[idx];
  7986. ref = indirectObject[0], object = indirectObject[1];
  7987. shouldNotCompress = ref === this.context.trailerInfo.Encrypt || object instanceof PDFStream_default || object instanceof PDFInvalidObject_default || ref.generationNumber !== 0;
  7988. if (!shouldNotCompress) return [3, 4];
  7989. uncompressedObjects.push(indirectObject);
  7990. xrefStream.addUncompressedEntry(ref, size);
  7991. size += this.computeIndirectObjectSize(indirectObject);
  7992. if (!this.shouldWaitForTick(1)) return [3, 3];
  7993. return [4, waitForTick()];
  7994. case 2:
  7995. _a.sent();
  7996. _a.label = 3;
  7997. case 3:
  7998. return [3, 5];
  7999. case 4:
  8000. chunk = last(compressedObjects);
  8001. objectStreamRef = last(objectStreamRefs);
  8002. if (!chunk || chunk.length % this.objectsPerStream === 0) {
  8003. chunk = [];
  8004. compressedObjects.push(chunk);
  8005. objectStreamRef = PDFRef_default.of(objectNumber++);
  8006. objectStreamRefs.push(objectStreamRef);
  8007. }
  8008. xrefStream.addCompressedEntry(ref, objectStreamRef, chunk.length);
  8009. chunk.push(indirectObject);
  8010. _a.label = 5;
  8011. case 5:
  8012. idx++;
  8013. return [3, 1];
  8014. case 6:
  8015. idx = 0, len = compressedObjects.length;
  8016. _a.label = 7;
  8017. case 7:
  8018. if (!(idx < len)) return [3, 10];
  8019. chunk = compressedObjects[idx];
  8020. ref = objectStreamRefs[idx];
  8021. objectStream = PDFObjectStream_default.withContextAndObjects(this.context, chunk, this.encodeStreams);
  8022. xrefStream.addUncompressedEntry(ref, size);
  8023. size += this.computeIndirectObjectSize([ref, objectStream]);
  8024. uncompressedObjects.push([ref, objectStream]);
  8025. if (!this.shouldWaitForTick(chunk.length)) return [3, 9];
  8026. return [4, waitForTick()];
  8027. case 8:
  8028. _a.sent();
  8029. _a.label = 9;
  8030. case 9:
  8031. idx++;
  8032. return [3, 7];
  8033. case 10:
  8034. xrefStreamRef = PDFRef_default.of(objectNumber++);
  8035. xrefStream.dict.set(PDFName_default.of("Size"), PDFNumber_default.of(objectNumber));
  8036. xrefStream.addUncompressedEntry(xrefStreamRef, size);
  8037. xrefOffset = size;
  8038. size += this.computeIndirectObjectSize([xrefStreamRef, xrefStream]);
  8039. uncompressedObjects.push([xrefStreamRef, xrefStream]);
  8040. trailer = PDFTrailer_default.forLastCrossRefSectionOffset(xrefOffset);
  8041. size += trailer.sizeInBytes();
  8042. return [2, { size, header, indirectObjects: uncompressedObjects, trailer }];
  8043. }
  8044. });
  8045. });
  8046. };
  8047. PDFStreamWriter2.forContext = function(context, objectsPerTick, encodeStreams, objectsPerStream) {
  8048. if (encodeStreams === void 0) {
  8049. encodeStreams = true;
  8050. }
  8051. if (objectsPerStream === void 0) {
  8052. objectsPerStream = 50;
  8053. }
  8054. return new PDFStreamWriter2(context, objectsPerTick, encodeStreams, objectsPerStream);
  8055. };
  8056. return PDFStreamWriter2;
  8057. }(PDFWriter_default)
  8058. );
  8059. var PDFStreamWriter_default = PDFStreamWriter;
  8060. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/objects/PDFHexString.js
  8061. var PDFHexString = (
  8062. /** @class */
  8063. function(_super) {
  8064. __extends(PDFHexString2, _super);
  8065. function PDFHexString2(value) {
  8066. var _this = _super.call(this) || this;
  8067. _this.value = value;
  8068. return _this;
  8069. }
  8070. PDFHexString2.prototype.asBytes = function() {
  8071. var hex = this.value + (this.value.length % 2 === 1 ? "0" : "");
  8072. var hexLength = hex.length;
  8073. var bytes = new Uint8Array(hex.length / 2);
  8074. var hexOffset = 0;
  8075. var bytesOffset = 0;
  8076. while (hexOffset < hexLength) {
  8077. var byte = parseInt(hex.substring(hexOffset, hexOffset + 2), 16);
  8078. bytes[bytesOffset] = byte;
  8079. hexOffset += 2;
  8080. bytesOffset += 1;
  8081. }
  8082. return bytes;
  8083. };
  8084. PDFHexString2.prototype.decodeText = function() {
  8085. var bytes = this.asBytes();
  8086. if (hasUtf16BOM(bytes))
  8087. return utf16Decode(bytes);
  8088. return pdfDocEncodingDecode(bytes);
  8089. };
  8090. PDFHexString2.prototype.decodeDate = function() {
  8091. var text = this.decodeText();
  8092. var date = parseDate(text);
  8093. if (!date)
  8094. throw new InvalidPDFDateStringError(text);
  8095. return date;
  8096. };
  8097. PDFHexString2.prototype.asString = function() {
  8098. return this.value;
  8099. };
  8100. PDFHexString2.prototype.clone = function() {
  8101. return PDFHexString2.of(this.value);
  8102. };
  8103. PDFHexString2.prototype.toString = function() {
  8104. return "<" + this.value + ">";
  8105. };
  8106. PDFHexString2.prototype.sizeInBytes = function() {
  8107. return this.value.length + 2;
  8108. };
  8109. PDFHexString2.prototype.copyBytesInto = function(buffer, offset) {
  8110. buffer[offset++] = CharCodes_default.LessThan;
  8111. offset += copyStringIntoBuffer(this.value, buffer, offset);
  8112. buffer[offset++] = CharCodes_default.GreaterThan;
  8113. return this.value.length + 2;
  8114. };
  8115. PDFHexString2.of = function(value) {
  8116. return new PDFHexString2(value);
  8117. };
  8118. PDFHexString2.fromText = function(value) {
  8119. var encoded = utf16Encode(value);
  8120. var hex = "";
  8121. for (var idx = 0, len = encoded.length; idx < len; idx++) {
  8122. hex += toHexStringOfMinLength(encoded[idx], 4);
  8123. }
  8124. return new PDFHexString2(hex);
  8125. };
  8126. return PDFHexString2;
  8127. }(PDFObject_default)
  8128. );
  8129. var PDFHexString_default = PDFHexString;
  8130. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/embedders/StandardFontEmbedder.js
  8131. var StandardFontEmbedder = (
  8132. /** @class */
  8133. function() {
  8134. function StandardFontEmbedder2(fontName, customName) {
  8135. this.encoding = fontName === FontNames.ZapfDingbats ? Encodings.ZapfDingbats : fontName === FontNames.Symbol ? Encodings.Symbol : Encodings.WinAnsi;
  8136. this.font = Font.load(fontName);
  8137. this.fontName = this.font.FontName;
  8138. this.customName = customName;
  8139. }
  8140. StandardFontEmbedder2.prototype.encodeText = function(text) {
  8141. var glyphs = this.encodeTextAsGlyphs(text);
  8142. var hexCodes = new Array(glyphs.length);
  8143. for (var idx = 0, len = glyphs.length; idx < len; idx++) {
  8144. hexCodes[idx] = toHexString(glyphs[idx].code);
  8145. }
  8146. return PDFHexString_default.of(hexCodes.join(""));
  8147. };
  8148. StandardFontEmbedder2.prototype.widthOfTextAtSize = function(text, size) {
  8149. var glyphs = this.encodeTextAsGlyphs(text);
  8150. var totalWidth = 0;
  8151. for (var idx = 0, len = glyphs.length; idx < len; idx++) {
  8152. var left = glyphs[idx].name;
  8153. var right = (glyphs[idx + 1] || {}).name;
  8154. var kernAmount = this.font.getXAxisKerningForPair(left, right) || 0;
  8155. totalWidth += this.widthOfGlyph(left) + kernAmount;
  8156. }
  8157. var scale2 = size / 1e3;
  8158. return totalWidth * scale2;
  8159. };
  8160. StandardFontEmbedder2.prototype.heightOfFontAtSize = function(size, options) {
  8161. if (options === void 0) {
  8162. options = {};
  8163. }
  8164. var _a = options.descender, descender = _a === void 0 ? true : _a;
  8165. var _b = this.font, Ascender = _b.Ascender, Descender = _b.Descender, FontBBox = _b.FontBBox;
  8166. var yTop = Ascender || FontBBox[3];
  8167. var yBottom = Descender || FontBBox[1];
  8168. var height = yTop - yBottom;
  8169. if (!descender)
  8170. height += Descender || 0;
  8171. return height / 1e3 * size;
  8172. };
  8173. StandardFontEmbedder2.prototype.sizeOfFontAtHeight = function(height) {
  8174. var _a = this.font, Ascender = _a.Ascender, Descender = _a.Descender, FontBBox = _a.FontBBox;
  8175. var yTop = Ascender || FontBBox[3];
  8176. var yBottom = Descender || FontBBox[1];
  8177. return 1e3 * height / (yTop - yBottom);
  8178. };
  8179. StandardFontEmbedder2.prototype.embedIntoContext = function(context, ref) {
  8180. var fontDict = context.obj({
  8181. Type: "Font",
  8182. Subtype: "Type1",
  8183. BaseFont: this.customName || this.fontName,
  8184. Encoding: this.encoding === Encodings.WinAnsi ? "WinAnsiEncoding" : void 0
  8185. });
  8186. if (ref) {
  8187. context.assign(ref, fontDict);
  8188. return ref;
  8189. } else {
  8190. return context.register(fontDict);
  8191. }
  8192. };
  8193. StandardFontEmbedder2.prototype.widthOfGlyph = function(glyphName) {
  8194. return this.font.getWidthOfGlyph(glyphName) || 250;
  8195. };
  8196. StandardFontEmbedder2.prototype.encodeTextAsGlyphs = function(text) {
  8197. var codePoints = Array.from(text);
  8198. var glyphs = new Array(codePoints.length);
  8199. for (var idx = 0, len = codePoints.length; idx < len; idx++) {
  8200. var codePoint = toCodePoint(codePoints[idx]);
  8201. glyphs[idx] = this.encoding.encodeUnicodeCodePoint(codePoint);
  8202. }
  8203. return glyphs;
  8204. };
  8205. StandardFontEmbedder2.for = function(fontName, customName) {
  8206. return new StandardFontEmbedder2(fontName, customName);
  8207. };
  8208. return StandardFontEmbedder2;
  8209. }()
  8210. );
  8211. var StandardFontEmbedder_default = StandardFontEmbedder;
  8212. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/embedders/CMap.js
  8213. var createCmap = function(glyphs, glyphId) {
  8214. var bfChars = new Array(glyphs.length);
  8215. for (var idx = 0, len = glyphs.length; idx < len; idx++) {
  8216. var glyph = glyphs[idx];
  8217. var id = cmapHexFormat(cmapHexString(glyphId(glyph)));
  8218. var unicode = cmapHexFormat.apply(void 0, glyph.codePoints.map(cmapCodePointFormat));
  8219. bfChars[idx] = [id, unicode];
  8220. }
  8221. return fillCmapTemplate(bfChars);
  8222. };
  8223. var fillCmapTemplate = function(bfChars) {
  8224. return "/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\n/CIDSystemInfo <<\n /Registry (Adobe)\n /Ordering (UCS)\n /Supplement 0\n>> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange\n<0000><ffff>\nendcodespacerange\n" + bfChars.length + " beginbfchar\n" + bfChars.map(function(_a) {
  8225. var glyphId = _a[0], codePoint = _a[1];
  8226. return glyphId + " " + codePoint;
  8227. }).join("\n") + "\nendbfchar\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend";
  8228. };
  8229. var cmapHexFormat = function() {
  8230. var values2 = [];
  8231. for (var _i = 0; _i < arguments.length; _i++) {
  8232. values2[_i] = arguments[_i];
  8233. }
  8234. return "<" + values2.join("") + ">";
  8235. };
  8236. var cmapHexString = function(value) {
  8237. return toHexStringOfMinLength(value, 4);
  8238. };
  8239. var cmapCodePointFormat = function(codePoint) {
  8240. if (isWithinBMP(codePoint))
  8241. return cmapHexString(codePoint);
  8242. if (hasSurrogates(codePoint)) {
  8243. var hs = highSurrogate(codePoint);
  8244. var ls = lowSurrogate(codePoint);
  8245. return "" + cmapHexString(hs) + cmapHexString(ls);
  8246. }
  8247. var hex = toHexString(codePoint);
  8248. var msg = "0x" + hex + " is not a valid UTF-8 or UTF-16 codepoint.";
  8249. throw new Error(msg);
  8250. };
  8251. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/embedders/FontFlags.js
  8252. var makeFontFlags = function(options) {
  8253. var flags = 0;
  8254. var flipBit = function(bit) {
  8255. flags |= 1 << bit - 1;
  8256. };
  8257. if (options.fixedPitch)
  8258. flipBit(1);
  8259. if (options.serif)
  8260. flipBit(2);
  8261. if (options.symbolic)
  8262. flipBit(3);
  8263. if (options.script)
  8264. flipBit(4);
  8265. if (options.nonsymbolic)
  8266. flipBit(6);
  8267. if (options.italic)
  8268. flipBit(7);
  8269. if (options.allCap)
  8270. flipBit(17);
  8271. if (options.smallCap)
  8272. flipBit(18);
  8273. if (options.forceBold)
  8274. flipBit(19);
  8275. return flags;
  8276. };
  8277. var deriveFontFlags = function(font) {
  8278. var familyClass = font["OS/2"] ? font["OS/2"].sFamilyClass : 0;
  8279. var flags = makeFontFlags({
  8280. fixedPitch: font.post.isFixedPitch,
  8281. serif: 1 <= familyClass && familyClass <= 7,
  8282. symbolic: true,
  8283. script: familyClass === 10,
  8284. italic: font.head.macStyle.italic
  8285. });
  8286. return flags;
  8287. };
  8288. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/objects/PDFString.js
  8289. var PDFString = (
  8290. /** @class */
  8291. function(_super) {
  8292. __extends(PDFString2, _super);
  8293. function PDFString2(value) {
  8294. var _this = _super.call(this) || this;
  8295. _this.value = value;
  8296. return _this;
  8297. }
  8298. PDFString2.prototype.asBytes = function() {
  8299. var bytes = [];
  8300. var octal = "";
  8301. var escaped = false;
  8302. var pushByte = function(byte2) {
  8303. if (byte2 !== void 0)
  8304. bytes.push(byte2);
  8305. escaped = false;
  8306. };
  8307. for (var idx = 0, len = this.value.length; idx < len; idx++) {
  8308. var char = this.value[idx];
  8309. var byte = toCharCode(char);
  8310. var nextChar = this.value[idx + 1];
  8311. if (!escaped) {
  8312. if (byte === CharCodes_default.BackSlash)
  8313. escaped = true;
  8314. else
  8315. pushByte(byte);
  8316. } else {
  8317. if (byte === CharCodes_default.Newline)
  8318. pushByte();
  8319. else if (byte === CharCodes_default.CarriageReturn)
  8320. pushByte();
  8321. else if (byte === CharCodes_default.n)
  8322. pushByte(CharCodes_default.Newline);
  8323. else if (byte === CharCodes_default.r)
  8324. pushByte(CharCodes_default.CarriageReturn);
  8325. else if (byte === CharCodes_default.t)
  8326. pushByte(CharCodes_default.Tab);
  8327. else if (byte === CharCodes_default.b)
  8328. pushByte(CharCodes_default.Backspace);
  8329. else if (byte === CharCodes_default.f)
  8330. pushByte(CharCodes_default.FormFeed);
  8331. else if (byte === CharCodes_default.LeftParen)
  8332. pushByte(CharCodes_default.LeftParen);
  8333. else if (byte === CharCodes_default.RightParen)
  8334. pushByte(CharCodes_default.RightParen);
  8335. else if (byte === CharCodes_default.Backspace)
  8336. pushByte(CharCodes_default.BackSlash);
  8337. else if (byte >= CharCodes_default.Zero && byte <= CharCodes_default.Seven) {
  8338. octal += char;
  8339. if (octal.length === 3 || !(nextChar >= "0" && nextChar <= "7")) {
  8340. pushByte(parseInt(octal, 8));
  8341. octal = "";
  8342. }
  8343. } else {
  8344. pushByte(byte);
  8345. }
  8346. }
  8347. }
  8348. return new Uint8Array(bytes);
  8349. };
  8350. PDFString2.prototype.decodeText = function() {
  8351. var bytes = this.asBytes();
  8352. if (hasUtf16BOM(bytes))
  8353. return utf16Decode(bytes);
  8354. return pdfDocEncodingDecode(bytes);
  8355. };
  8356. PDFString2.prototype.decodeDate = function() {
  8357. var text = this.decodeText();
  8358. var date = parseDate(text);
  8359. if (!date)
  8360. throw new InvalidPDFDateStringError(text);
  8361. return date;
  8362. };
  8363. PDFString2.prototype.asString = function() {
  8364. return this.value;
  8365. };
  8366. PDFString2.prototype.clone = function() {
  8367. return PDFString2.of(this.value);
  8368. };
  8369. PDFString2.prototype.toString = function() {
  8370. return "(" + this.value + ")";
  8371. };
  8372. PDFString2.prototype.sizeInBytes = function() {
  8373. return this.value.length + 2;
  8374. };
  8375. PDFString2.prototype.copyBytesInto = function(buffer, offset) {
  8376. buffer[offset++] = CharCodes_default.LeftParen;
  8377. offset += copyStringIntoBuffer(this.value, buffer, offset);
  8378. buffer[offset++] = CharCodes_default.RightParen;
  8379. return this.value.length + 2;
  8380. };
  8381. PDFString2.of = function(value) {
  8382. return new PDFString2(value);
  8383. };
  8384. PDFString2.fromDate = function(date) {
  8385. var year = padStart(String(date.getUTCFullYear()), 4, "0");
  8386. var month = padStart(String(date.getUTCMonth() + 1), 2, "0");
  8387. var day = padStart(String(date.getUTCDate()), 2, "0");
  8388. var hours = padStart(String(date.getUTCHours()), 2, "0");
  8389. var mins = padStart(String(date.getUTCMinutes()), 2, "0");
  8390. var secs = padStart(String(date.getUTCSeconds()), 2, "0");
  8391. return new PDFString2("D:" + year + month + day + hours + mins + secs + "Z");
  8392. };
  8393. return PDFString2;
  8394. }(PDFObject_default)
  8395. );
  8396. var PDFString_default = PDFString;
  8397. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/embedders/CustomFontEmbedder.js
  8398. var CustomFontEmbedder = (
  8399. /** @class */
  8400. function() {
  8401. function CustomFontEmbedder2(font, fontData, customName, fontFeatures) {
  8402. var _this = this;
  8403. this.allGlyphsInFontSortedById = function() {
  8404. var glyphs = new Array(_this.font.characterSet.length);
  8405. for (var idx = 0, len = glyphs.length; idx < len; idx++) {
  8406. var codePoint = _this.font.characterSet[idx];
  8407. glyphs[idx] = _this.font.glyphForCodePoint(codePoint);
  8408. }
  8409. return sortedUniq(glyphs.sort(byAscendingId), function(g) {
  8410. return g.id;
  8411. });
  8412. };
  8413. this.font = font;
  8414. this.scale = 1e3 / this.font.unitsPerEm;
  8415. this.fontData = fontData;
  8416. this.fontName = this.font.postscriptName || "Font";
  8417. this.customName = customName;
  8418. this.fontFeatures = fontFeatures;
  8419. this.baseFontName = "";
  8420. this.glyphCache = Cache_default.populatedBy(this.allGlyphsInFontSortedById);
  8421. }
  8422. CustomFontEmbedder2.for = function(fontkit, fontData, customName, fontFeatures) {
  8423. return __awaiter(this, void 0, void 0, function() {
  8424. var font;
  8425. return __generator(this, function(_a) {
  8426. switch (_a.label) {
  8427. case 0:
  8428. return [4, fontkit.create(fontData)];
  8429. case 1:
  8430. font = _a.sent();
  8431. return [2, new CustomFontEmbedder2(font, fontData, customName, fontFeatures)];
  8432. }
  8433. });
  8434. });
  8435. };
  8436. CustomFontEmbedder2.prototype.encodeText = function(text) {
  8437. var glyphs = this.font.layout(text, this.fontFeatures).glyphs;
  8438. var hexCodes = new Array(glyphs.length);
  8439. for (var idx = 0, len = glyphs.length; idx < len; idx++) {
  8440. hexCodes[idx] = toHexStringOfMinLength(glyphs[idx].id, 4);
  8441. }
  8442. return PDFHexString_default.of(hexCodes.join(""));
  8443. };
  8444. CustomFontEmbedder2.prototype.widthOfTextAtSize = function(text, size) {
  8445. var glyphs = this.font.layout(text, this.fontFeatures).glyphs;
  8446. var totalWidth = 0;
  8447. for (var idx = 0, len = glyphs.length; idx < len; idx++) {
  8448. totalWidth += glyphs[idx].advanceWidth * this.scale;
  8449. }
  8450. var scale2 = size / 1e3;
  8451. return totalWidth * scale2;
  8452. };
  8453. CustomFontEmbedder2.prototype.heightOfFontAtSize = function(size, options) {
  8454. if (options === void 0) {
  8455. options = {};
  8456. }
  8457. var _a = options.descender, descender = _a === void 0 ? true : _a;
  8458. var _b = this.font, ascent = _b.ascent, descent = _b.descent, bbox = _b.bbox;
  8459. var yTop = (ascent || bbox.maxY) * this.scale;
  8460. var yBottom = (descent || bbox.minY) * this.scale;
  8461. var height = yTop - yBottom;
  8462. if (!descender)
  8463. height -= Math.abs(descent) || 0;
  8464. return height / 1e3 * size;
  8465. };
  8466. CustomFontEmbedder2.prototype.sizeOfFontAtHeight = function(height) {
  8467. var _a = this.font, ascent = _a.ascent, descent = _a.descent, bbox = _a.bbox;
  8468. var yTop = (ascent || bbox.maxY) * this.scale;
  8469. var yBottom = (descent || bbox.minY) * this.scale;
  8470. return 1e3 * height / (yTop - yBottom);
  8471. };
  8472. CustomFontEmbedder2.prototype.embedIntoContext = function(context, ref) {
  8473. this.baseFontName = this.customName || context.addRandomSuffix(this.fontName);
  8474. return this.embedFontDict(context, ref);
  8475. };
  8476. CustomFontEmbedder2.prototype.embedFontDict = function(context, ref) {
  8477. return __awaiter(this, void 0, void 0, function() {
  8478. var cidFontDictRef, unicodeCMapRef, fontDict;
  8479. return __generator(this, function(_a) {
  8480. switch (_a.label) {
  8481. case 0:
  8482. return [4, this.embedCIDFontDict(context)];
  8483. case 1:
  8484. cidFontDictRef = _a.sent();
  8485. unicodeCMapRef = this.embedUnicodeCmap(context);
  8486. fontDict = context.obj({
  8487. Type: "Font",
  8488. Subtype: "Type0",
  8489. BaseFont: this.baseFontName,
  8490. Encoding: "Identity-H",
  8491. DescendantFonts: [cidFontDictRef],
  8492. ToUnicode: unicodeCMapRef
  8493. });
  8494. if (ref) {
  8495. context.assign(ref, fontDict);
  8496. return [2, ref];
  8497. } else {
  8498. return [2, context.register(fontDict)];
  8499. }
  8500. return [
  8501. 2
  8502. /*return*/
  8503. ];
  8504. }
  8505. });
  8506. });
  8507. };
  8508. CustomFontEmbedder2.prototype.isCFF = function() {
  8509. return this.font.cff;
  8510. };
  8511. CustomFontEmbedder2.prototype.embedCIDFontDict = function(context) {
  8512. return __awaiter(this, void 0, void 0, function() {
  8513. var fontDescriptorRef, cidFontDict;
  8514. return __generator(this, function(_a) {
  8515. switch (_a.label) {
  8516. case 0:
  8517. return [4, this.embedFontDescriptor(context)];
  8518. case 1:
  8519. fontDescriptorRef = _a.sent();
  8520. cidFontDict = context.obj({
  8521. Type: "Font",
  8522. Subtype: this.isCFF() ? "CIDFontType0" : "CIDFontType2",
  8523. CIDToGIDMap: "Identity",
  8524. BaseFont: this.baseFontName,
  8525. CIDSystemInfo: {
  8526. Registry: PDFString_default.of("Adobe"),
  8527. Ordering: PDFString_default.of("Identity"),
  8528. Supplement: 0
  8529. },
  8530. FontDescriptor: fontDescriptorRef,
  8531. W: this.computeWidths()
  8532. });
  8533. return [2, context.register(cidFontDict)];
  8534. }
  8535. });
  8536. });
  8537. };
  8538. CustomFontEmbedder2.prototype.embedFontDescriptor = function(context) {
  8539. return __awaiter(this, void 0, void 0, function() {
  8540. var fontStreamRef, scale2, _a, italicAngle, ascent, descent, capHeight, xHeight, _b, minX, minY, maxX, maxY, fontDescriptor;
  8541. var _c;
  8542. return __generator(this, function(_d) {
  8543. switch (_d.label) {
  8544. case 0:
  8545. return [4, this.embedFontStream(context)];
  8546. case 1:
  8547. fontStreamRef = _d.sent();
  8548. scale2 = this.scale;
  8549. _a = this.font, italicAngle = _a.italicAngle, ascent = _a.ascent, descent = _a.descent, capHeight = _a.capHeight, xHeight = _a.xHeight;
  8550. _b = this.font.bbox, minX = _b.minX, minY = _b.minY, maxX = _b.maxX, maxY = _b.maxY;
  8551. fontDescriptor = context.obj((_c = {
  8552. Type: "FontDescriptor",
  8553. FontName: this.baseFontName,
  8554. Flags: deriveFontFlags(this.font),
  8555. FontBBox: [minX * scale2, minY * scale2, maxX * scale2, maxY * scale2],
  8556. ItalicAngle: italicAngle,
  8557. Ascent: ascent * scale2,
  8558. Descent: descent * scale2,
  8559. CapHeight: (capHeight || ascent) * scale2,
  8560. XHeight: (xHeight || 0) * scale2,
  8561. // Not sure how to compute/find this, nor is anybody else really:
  8562. // https://stackoverflow.com/questions/35485179/stemv-value-of-the-truetype-font
  8563. StemV: 0
  8564. }, _c[this.isCFF() ? "FontFile3" : "FontFile2"] = fontStreamRef, _c));
  8565. return [2, context.register(fontDescriptor)];
  8566. }
  8567. });
  8568. });
  8569. };
  8570. CustomFontEmbedder2.prototype.serializeFont = function() {
  8571. return __awaiter(this, void 0, void 0, function() {
  8572. return __generator(this, function(_a) {
  8573. return [2, this.fontData];
  8574. });
  8575. });
  8576. };
  8577. CustomFontEmbedder2.prototype.embedFontStream = function(context) {
  8578. return __awaiter(this, void 0, void 0, function() {
  8579. var fontStream, _a, _b;
  8580. return __generator(this, function(_c) {
  8581. switch (_c.label) {
  8582. case 0:
  8583. _b = (_a = context).flateStream;
  8584. return [4, this.serializeFont()];
  8585. case 1:
  8586. fontStream = _b.apply(_a, [_c.sent(), {
  8587. Subtype: this.isCFF() ? "CIDFontType0C" : void 0
  8588. }]);
  8589. return [2, context.register(fontStream)];
  8590. }
  8591. });
  8592. });
  8593. };
  8594. CustomFontEmbedder2.prototype.embedUnicodeCmap = function(context) {
  8595. var cmap = createCmap(this.glyphCache.access(), this.glyphId.bind(this));
  8596. var cmapStream = context.flateStream(cmap);
  8597. return context.register(cmapStream);
  8598. };
  8599. CustomFontEmbedder2.prototype.glyphId = function(glyph) {
  8600. return glyph ? glyph.id : -1;
  8601. };
  8602. CustomFontEmbedder2.prototype.computeWidths = function() {
  8603. var glyphs = this.glyphCache.access();
  8604. var widths = [];
  8605. var currSection = [];
  8606. for (var idx = 0, len = glyphs.length; idx < len; idx++) {
  8607. var currGlyph = glyphs[idx];
  8608. var prevGlyph = glyphs[idx - 1];
  8609. var currGlyphId = this.glyphId(currGlyph);
  8610. var prevGlyphId = this.glyphId(prevGlyph);
  8611. if (idx === 0) {
  8612. widths.push(currGlyphId);
  8613. } else if (currGlyphId - prevGlyphId !== 1) {
  8614. widths.push(currSection);
  8615. widths.push(currGlyphId);
  8616. currSection = [];
  8617. }
  8618. currSection.push(currGlyph.advanceWidth * this.scale);
  8619. }
  8620. widths.push(currSection);
  8621. return widths;
  8622. };
  8623. return CustomFontEmbedder2;
  8624. }()
  8625. );
  8626. var CustomFontEmbedder_default = CustomFontEmbedder;
  8627. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/embedders/CustomFontSubsetEmbedder.js
  8628. var CustomFontSubsetEmbedder = (
  8629. /** @class */
  8630. function(_super) {
  8631. __extends(CustomFontSubsetEmbedder2, _super);
  8632. function CustomFontSubsetEmbedder2(font, fontData, customFontName, fontFeatures) {
  8633. var _this = _super.call(this, font, fontData, customFontName, fontFeatures) || this;
  8634. _this.subset = _this.font.createSubset();
  8635. _this.glyphs = [];
  8636. _this.glyphCache = Cache_default.populatedBy(function() {
  8637. return _this.glyphs;
  8638. });
  8639. _this.glyphIdMap = /* @__PURE__ */ new Map();
  8640. return _this;
  8641. }
  8642. CustomFontSubsetEmbedder2.for = function(fontkit, fontData, customFontName, fontFeatures) {
  8643. return __awaiter(this, void 0, void 0, function() {
  8644. var font;
  8645. return __generator(this, function(_a) {
  8646. switch (_a.label) {
  8647. case 0:
  8648. return [4, fontkit.create(fontData)];
  8649. case 1:
  8650. font = _a.sent();
  8651. return [2, new CustomFontSubsetEmbedder2(font, fontData, customFontName, fontFeatures)];
  8652. }
  8653. });
  8654. });
  8655. };
  8656. CustomFontSubsetEmbedder2.prototype.encodeText = function(text) {
  8657. var glyphs = this.font.layout(text, this.fontFeatures).glyphs;
  8658. var hexCodes = new Array(glyphs.length);
  8659. for (var idx = 0, len = glyphs.length; idx < len; idx++) {
  8660. var glyph = glyphs[idx];
  8661. var subsetGlyphId = this.subset.includeGlyph(glyph);
  8662. this.glyphs[subsetGlyphId - 1] = glyph;
  8663. this.glyphIdMap.set(glyph.id, subsetGlyphId);
  8664. hexCodes[idx] = toHexStringOfMinLength(subsetGlyphId, 4);
  8665. }
  8666. this.glyphCache.invalidate();
  8667. return PDFHexString_default.of(hexCodes.join(""));
  8668. };
  8669. CustomFontSubsetEmbedder2.prototype.isCFF = function() {
  8670. return this.subset.cff;
  8671. };
  8672. CustomFontSubsetEmbedder2.prototype.glyphId = function(glyph) {
  8673. return glyph ? this.glyphIdMap.get(glyph.id) : -1;
  8674. };
  8675. CustomFontSubsetEmbedder2.prototype.serializeFont = function() {
  8676. var _this = this;
  8677. return new Promise(function(resolve, reject) {
  8678. var parts = [];
  8679. _this.subset.encodeStream().on("data", function(bytes) {
  8680. return parts.push(bytes);
  8681. }).on("end", function() {
  8682. return resolve(mergeUint8Arrays(parts));
  8683. }).on("error", function(err) {
  8684. return reject(err);
  8685. });
  8686. });
  8687. };
  8688. return CustomFontSubsetEmbedder2;
  8689. }(CustomFontEmbedder_default)
  8690. );
  8691. var CustomFontSubsetEmbedder_default = CustomFontSubsetEmbedder;
  8692. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/embedders/FileEmbedder.js
  8693. var AFRelationship;
  8694. (function(AFRelationship2) {
  8695. AFRelationship2["Source"] = "Source";
  8696. AFRelationship2["Data"] = "Data";
  8697. AFRelationship2["Alternative"] = "Alternative";
  8698. AFRelationship2["Supplement"] = "Supplement";
  8699. AFRelationship2["EncryptedPayload"] = "EncryptedPayload";
  8700. AFRelationship2["FormData"] = "EncryptedPayload";
  8701. AFRelationship2["Schema"] = "Schema";
  8702. AFRelationship2["Unspecified"] = "Unspecified";
  8703. })(AFRelationship || (AFRelationship = {}));
  8704. var FileEmbedder = (
  8705. /** @class */
  8706. function() {
  8707. function FileEmbedder2(fileData, fileName, options) {
  8708. if (options === void 0) {
  8709. options = {};
  8710. }
  8711. this.fileData = fileData;
  8712. this.fileName = fileName;
  8713. this.options = options;
  8714. }
  8715. FileEmbedder2.for = function(bytes, fileName, options) {
  8716. if (options === void 0) {
  8717. options = {};
  8718. }
  8719. return new FileEmbedder2(bytes, fileName, options);
  8720. };
  8721. FileEmbedder2.prototype.embedIntoContext = function(context, ref) {
  8722. return __awaiter(this, void 0, void 0, function() {
  8723. var _a, mimeType, description, creationDate, modificationDate, afRelationship, embeddedFileStream, embeddedFileStreamRef, fileSpecDict;
  8724. return __generator(this, function(_b) {
  8725. _a = this.options, mimeType = _a.mimeType, description = _a.description, creationDate = _a.creationDate, modificationDate = _a.modificationDate, afRelationship = _a.afRelationship;
  8726. embeddedFileStream = context.flateStream(this.fileData, {
  8727. Type: "EmbeddedFile",
  8728. Subtype: mimeType !== null && mimeType !== void 0 ? mimeType : void 0,
  8729. Params: {
  8730. Size: this.fileData.length,
  8731. CreationDate: creationDate ? PDFString_default.fromDate(creationDate) : void 0,
  8732. ModDate: modificationDate ? PDFString_default.fromDate(modificationDate) : void 0
  8733. }
  8734. });
  8735. embeddedFileStreamRef = context.register(embeddedFileStream);
  8736. fileSpecDict = context.obj({
  8737. Type: "Filespec",
  8738. F: PDFString_default.of(this.fileName),
  8739. UF: PDFHexString_default.fromText(this.fileName),
  8740. EF: { F: embeddedFileStreamRef },
  8741. Desc: description ? PDFHexString_default.fromText(description) : void 0,
  8742. AFRelationship: afRelationship !== null && afRelationship !== void 0 ? afRelationship : void 0
  8743. });
  8744. if (ref) {
  8745. context.assign(ref, fileSpecDict);
  8746. return [2, ref];
  8747. } else {
  8748. return [2, context.register(fileSpecDict)];
  8749. }
  8750. return [
  8751. 2
  8752. /*return*/
  8753. ];
  8754. });
  8755. });
  8756. };
  8757. return FileEmbedder2;
  8758. }()
  8759. );
  8760. var FileEmbedder_default = FileEmbedder;
  8761. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/embedders/JpegEmbedder.js
  8762. var MARKERS = [
  8763. 65472,
  8764. 65473,
  8765. 65474,
  8766. 65475,
  8767. 65477,
  8768. 65478,
  8769. 65479,
  8770. 65480,
  8771. 65481,
  8772. 65482,
  8773. 65483,
  8774. 65484,
  8775. 65485,
  8776. 65486,
  8777. 65487
  8778. ];
  8779. var ColorSpace;
  8780. (function(ColorSpace2) {
  8781. ColorSpace2["DeviceGray"] = "DeviceGray";
  8782. ColorSpace2["DeviceRGB"] = "DeviceRGB";
  8783. ColorSpace2["DeviceCMYK"] = "DeviceCMYK";
  8784. })(ColorSpace || (ColorSpace = {}));
  8785. var ChannelToColorSpace = {
  8786. 1: ColorSpace.DeviceGray,
  8787. 3: ColorSpace.DeviceRGB,
  8788. 4: ColorSpace.DeviceCMYK
  8789. };
  8790. var JpegEmbedder = (
  8791. /** @class */
  8792. function() {
  8793. function JpegEmbedder2(imageData, bitsPerComponent, width, height, colorSpace) {
  8794. this.imageData = imageData;
  8795. this.bitsPerComponent = bitsPerComponent;
  8796. this.width = width;
  8797. this.height = height;
  8798. this.colorSpace = colorSpace;
  8799. }
  8800. JpegEmbedder2.for = function(imageData) {
  8801. return __awaiter(this, void 0, void 0, function() {
  8802. var dataView, soi, pos, marker, bitsPerComponent, height, width, channelByte, channelName, colorSpace;
  8803. return __generator(this, function(_a) {
  8804. dataView = new DataView(imageData.buffer);
  8805. soi = dataView.getUint16(0);
  8806. if (soi !== 65496)
  8807. throw new Error("SOI not found in JPEG");
  8808. pos = 2;
  8809. while (pos < dataView.byteLength) {
  8810. marker = dataView.getUint16(pos);
  8811. pos += 2;
  8812. if (MARKERS.includes(marker))
  8813. break;
  8814. pos += dataView.getUint16(pos);
  8815. }
  8816. if (!MARKERS.includes(marker))
  8817. throw new Error("Invalid JPEG");
  8818. pos += 2;
  8819. bitsPerComponent = dataView.getUint8(pos++);
  8820. height = dataView.getUint16(pos);
  8821. pos += 2;
  8822. width = dataView.getUint16(pos);
  8823. pos += 2;
  8824. channelByte = dataView.getUint8(pos++);
  8825. channelName = ChannelToColorSpace[channelByte];
  8826. if (!channelName)
  8827. throw new Error("Unknown JPEG channel.");
  8828. colorSpace = channelName;
  8829. return [2, new JpegEmbedder2(imageData, bitsPerComponent, width, height, colorSpace)];
  8830. });
  8831. });
  8832. };
  8833. JpegEmbedder2.prototype.embedIntoContext = function(context, ref) {
  8834. return __awaiter(this, void 0, void 0, function() {
  8835. var xObject;
  8836. return __generator(this, function(_a) {
  8837. xObject = context.stream(this.imageData, {
  8838. Type: "XObject",
  8839. Subtype: "Image",
  8840. BitsPerComponent: this.bitsPerComponent,
  8841. Width: this.width,
  8842. Height: this.height,
  8843. ColorSpace: this.colorSpace,
  8844. Filter: "DCTDecode",
  8845. // CMYK JPEG streams in PDF are typically stored complemented,
  8846. // with 1 as 'off' and 0 as 'on' (PDF 32000-1:2008, 8.6.4.4).
  8847. //
  8848. // Standalone CMYK JPEG (usually exported by Photoshop) are
  8849. // stored inverse, with 0 as 'off' and 1 as 'on', like RGB.
  8850. //
  8851. // Applying a swap here as a hedge that most bytes passing
  8852. // through this method will benefit from it.
  8853. Decode: this.colorSpace === ColorSpace.DeviceCMYK ? [1, 0, 1, 0, 1, 0, 1, 0] : void 0
  8854. });
  8855. if (ref) {
  8856. context.assign(ref, xObject);
  8857. return [2, ref];
  8858. } else {
  8859. return [2, context.register(xObject)];
  8860. }
  8861. return [
  8862. 2
  8863. /*return*/
  8864. ];
  8865. });
  8866. });
  8867. };
  8868. return JpegEmbedder2;
  8869. }()
  8870. );
  8871. var JpegEmbedder_default = JpegEmbedder;
  8872. // node_modules/.pnpm/@pdf-lib+upng@1.0.1/node_modules/@pdf-lib/upng/UPNG.js
  8873. var import_pako4 = __toESM(require_pako());
  8874. var UPNG = {};
  8875. UPNG.toRGBA8 = function(out) {
  8876. var w = out.width, h = out.height;
  8877. if (out.tabs.acTL == null) return [UPNG.toRGBA8.decodeImage(out.data, w, h, out).buffer];
  8878. var frms = [];
  8879. if (out.frames[0].data == null) out.frames[0].data = out.data;
  8880. var len = w * h * 4, img = new Uint8Array(len), empty = new Uint8Array(len), prev = new Uint8Array(len);
  8881. for (var i = 0; i < out.frames.length; i++) {
  8882. var frm = out.frames[i];
  8883. var fx = frm.rect.x, fy = frm.rect.y, fw = frm.rect.width, fh = frm.rect.height;
  8884. var fdata = UPNG.toRGBA8.decodeImage(frm.data, fw, fh, out);
  8885. if (i != 0) for (var j = 0; j < len; j++) prev[j] = img[j];
  8886. if (frm.blend == 0) UPNG._copyTile(fdata, fw, fh, img, w, h, fx, fy, 0);
  8887. else if (frm.blend == 1) UPNG._copyTile(fdata, fw, fh, img, w, h, fx, fy, 1);
  8888. frms.push(img.buffer.slice(0));
  8889. if (frm.dispose == 0) {
  8890. } else if (frm.dispose == 1) UPNG._copyTile(empty, fw, fh, img, w, h, fx, fy, 0);
  8891. else if (frm.dispose == 2) for (var j = 0; j < len; j++) img[j] = prev[j];
  8892. }
  8893. return frms;
  8894. };
  8895. UPNG.toRGBA8.decodeImage = function(data, w, h, out) {
  8896. var area = w * h, bpp = UPNG.decode._getBPP(out);
  8897. var bpl = Math.ceil(w * bpp / 8);
  8898. var bf = new Uint8Array(area * 4), bf32 = new Uint32Array(bf.buffer);
  8899. var ctype = out.ctype, depth = out.depth;
  8900. var rs = UPNG._bin.readUshort;
  8901. var time = Date.now();
  8902. if (ctype == 6) {
  8903. var qarea = area << 2;
  8904. if (depth == 8) for (var i = 0; i < qarea; i += 4) {
  8905. bf[i] = data[i];
  8906. bf[i + 1] = data[i + 1];
  8907. bf[i + 2] = data[i + 2];
  8908. bf[i + 3] = data[i + 3];
  8909. }
  8910. if (depth == 16) for (var i = 0; i < qarea; i++) {
  8911. bf[i] = data[i << 1];
  8912. }
  8913. } else if (ctype == 2) {
  8914. var ts = out.tabs["tRNS"];
  8915. if (ts == null) {
  8916. if (depth == 8) for (var i = 0; i < area; i++) {
  8917. var ti = i * 3;
  8918. bf32[i] = 255 << 24 | data[ti + 2] << 16 | data[ti + 1] << 8 | data[ti];
  8919. }
  8920. if (depth == 16) for (var i = 0; i < area; i++) {
  8921. var ti = i * 6;
  8922. bf32[i] = 255 << 24 | data[ti + 4] << 16 | data[ti + 2] << 8 | data[ti];
  8923. }
  8924. } else {
  8925. var tr = ts[0], tg = ts[1], tb = ts[2];
  8926. if (depth == 8) for (var i = 0; i < area; i++) {
  8927. var qi = i << 2, ti = i * 3;
  8928. bf32[i] = 255 << 24 | data[ti + 2] << 16 | data[ti + 1] << 8 | data[ti];
  8929. if (data[ti] == tr && data[ti + 1] == tg && data[ti + 2] == tb) bf[qi + 3] = 0;
  8930. }
  8931. if (depth == 16) for (var i = 0; i < area; i++) {
  8932. var qi = i << 2, ti = i * 6;
  8933. bf32[i] = 255 << 24 | data[ti + 4] << 16 | data[ti + 2] << 8 | data[ti];
  8934. if (rs(data, ti) == tr && rs(data, ti + 2) == tg && rs(data, ti + 4) == tb) bf[qi + 3] = 0;
  8935. }
  8936. }
  8937. } else if (ctype == 3) {
  8938. var p = out.tabs["PLTE"], ap = out.tabs["tRNS"], tl = ap ? ap.length : 0;
  8939. if (depth == 1) for (var y = 0; y < h; y++) {
  8940. var s0 = y * bpl, t0 = y * w;
  8941. for (var i = 0; i < w; i++) {
  8942. var qi = t0 + i << 2, j = data[s0 + (i >> 3)] >> 7 - ((i & 7) << 0) & 1, cj = 3 * j;
  8943. bf[qi] = p[cj];
  8944. bf[qi + 1] = p[cj + 1];
  8945. bf[qi + 2] = p[cj + 2];
  8946. bf[qi + 3] = j < tl ? ap[j] : 255;
  8947. }
  8948. }
  8949. if (depth == 2) for (var y = 0; y < h; y++) {
  8950. var s0 = y * bpl, t0 = y * w;
  8951. for (var i = 0; i < w; i++) {
  8952. var qi = t0 + i << 2, j = data[s0 + (i >> 2)] >> 6 - ((i & 3) << 1) & 3, cj = 3 * j;
  8953. bf[qi] = p[cj];
  8954. bf[qi + 1] = p[cj + 1];
  8955. bf[qi + 2] = p[cj + 2];
  8956. bf[qi + 3] = j < tl ? ap[j] : 255;
  8957. }
  8958. }
  8959. if (depth == 4) for (var y = 0; y < h; y++) {
  8960. var s0 = y * bpl, t0 = y * w;
  8961. for (var i = 0; i < w; i++) {
  8962. var qi = t0 + i << 2, j = data[s0 + (i >> 1)] >> 4 - ((i & 1) << 2) & 15, cj = 3 * j;
  8963. bf[qi] = p[cj];
  8964. bf[qi + 1] = p[cj + 1];
  8965. bf[qi + 2] = p[cj + 2];
  8966. bf[qi + 3] = j < tl ? ap[j] : 255;
  8967. }
  8968. }
  8969. if (depth == 8) for (var i = 0; i < area; i++) {
  8970. var qi = i << 2, j = data[i], cj = 3 * j;
  8971. bf[qi] = p[cj];
  8972. bf[qi + 1] = p[cj + 1];
  8973. bf[qi + 2] = p[cj + 2];
  8974. bf[qi + 3] = j < tl ? ap[j] : 255;
  8975. }
  8976. } else if (ctype == 4) {
  8977. if (depth == 8) for (var i = 0; i < area; i++) {
  8978. var qi = i << 2, di = i << 1, gr = data[di];
  8979. bf[qi] = gr;
  8980. bf[qi + 1] = gr;
  8981. bf[qi + 2] = gr;
  8982. bf[qi + 3] = data[di + 1];
  8983. }
  8984. if (depth == 16) for (var i = 0; i < area; i++) {
  8985. var qi = i << 2, di = i << 2, gr = data[di];
  8986. bf[qi] = gr;
  8987. bf[qi + 1] = gr;
  8988. bf[qi + 2] = gr;
  8989. bf[qi + 3] = data[di + 2];
  8990. }
  8991. } else if (ctype == 0) {
  8992. var tr = out.tabs["tRNS"] ? out.tabs["tRNS"] : -1;
  8993. for (var y = 0; y < h; y++) {
  8994. var off = y * bpl, to = y * w;
  8995. if (depth == 1) for (var x = 0; x < w; x++) {
  8996. var gr = 255 * (data[off + (x >>> 3)] >>> 7 - (x & 7) & 1), al = gr == tr * 255 ? 0 : 255;
  8997. bf32[to + x] = al << 24 | gr << 16 | gr << 8 | gr;
  8998. }
  8999. else if (depth == 2) for (var x = 0; x < w; x++) {
  9000. var gr = 85 * (data[off + (x >>> 2)] >>> 6 - ((x & 3) << 1) & 3), al = gr == tr * 85 ? 0 : 255;
  9001. bf32[to + x] = al << 24 | gr << 16 | gr << 8 | gr;
  9002. }
  9003. else if (depth == 4) for (var x = 0; x < w; x++) {
  9004. var gr = 17 * (data[off + (x >>> 1)] >>> 4 - ((x & 1) << 2) & 15), al = gr == tr * 17 ? 0 : 255;
  9005. bf32[to + x] = al << 24 | gr << 16 | gr << 8 | gr;
  9006. }
  9007. else if (depth == 8) for (var x = 0; x < w; x++) {
  9008. var gr = data[off + x], al = gr == tr ? 0 : 255;
  9009. bf32[to + x] = al << 24 | gr << 16 | gr << 8 | gr;
  9010. }
  9011. else if (depth == 16) for (var x = 0; x < w; x++) {
  9012. var gr = data[off + (x << 1)], al = rs(data, off + (x << i)) == tr ? 0 : 255;
  9013. bf32[to + x] = al << 24 | gr << 16 | gr << 8 | gr;
  9014. }
  9015. }
  9016. }
  9017. return bf;
  9018. };
  9019. UPNG.decode = function(buff) {
  9020. var data = new Uint8Array(buff), offset = 8, bin = UPNG._bin, rUs = bin.readUshort, rUi = bin.readUint;
  9021. var out = { tabs: {}, frames: [] };
  9022. var dd = new Uint8Array(data.length), doff = 0;
  9023. var fd, foff = 0;
  9024. var mgck = [137, 80, 78, 71, 13, 10, 26, 10];
  9025. for (var i = 0; i < 8; i++) if (data[i] != mgck[i]) throw "The input is not a PNG file!";
  9026. while (offset < data.length) {
  9027. var len = bin.readUint(data, offset);
  9028. offset += 4;
  9029. var type = bin.readASCII(data, offset, 4);
  9030. offset += 4;
  9031. if (type == "IHDR") {
  9032. UPNG.decode._IHDR(data, offset, out);
  9033. } else if (type == "IDAT") {
  9034. for (var i = 0; i < len; i++) dd[doff + i] = data[offset + i];
  9035. doff += len;
  9036. } else if (type == "acTL") {
  9037. out.tabs[type] = { num_frames: rUi(data, offset), num_plays: rUi(data, offset + 4) };
  9038. fd = new Uint8Array(data.length);
  9039. } else if (type == "fcTL") {
  9040. if (foff != 0) {
  9041. var fr = out.frames[out.frames.length - 1];
  9042. fr.data = UPNG.decode._decompress(out, fd.slice(0, foff), fr.rect.width, fr.rect.height);
  9043. foff = 0;
  9044. }
  9045. var rct = { x: rUi(data, offset + 12), y: rUi(data, offset + 16), width: rUi(data, offset + 4), height: rUi(data, offset + 8) };
  9046. var del = rUs(data, offset + 22);
  9047. del = rUs(data, offset + 20) / (del == 0 ? 100 : del);
  9048. var frm = { rect: rct, delay: Math.round(del * 1e3), dispose: data[offset + 24], blend: data[offset + 25] };
  9049. out.frames.push(frm);
  9050. } else if (type == "fdAT") {
  9051. for (var i = 0; i < len - 4; i++) fd[foff + i] = data[offset + i + 4];
  9052. foff += len - 4;
  9053. } else if (type == "pHYs") {
  9054. out.tabs[type] = [bin.readUint(data, offset), bin.readUint(data, offset + 4), data[offset + 8]];
  9055. } else if (type == "cHRM") {
  9056. out.tabs[type] = [];
  9057. for (var i = 0; i < 8; i++) out.tabs[type].push(bin.readUint(data, offset + i * 4));
  9058. } else if (type == "tEXt") {
  9059. if (out.tabs[type] == null) out.tabs[type] = {};
  9060. var nz = bin.nextZero(data, offset);
  9061. var keyw = bin.readASCII(data, offset, nz - offset);
  9062. var text = bin.readASCII(data, nz + 1, offset + len - nz - 1);
  9063. out.tabs[type][keyw] = text;
  9064. } else if (type == "iTXt") {
  9065. if (out.tabs[type] == null) out.tabs[type] = {};
  9066. var nz = 0, off = offset;
  9067. nz = bin.nextZero(data, off);
  9068. var keyw = bin.readASCII(data, off, nz - off);
  9069. off = nz + 1;
  9070. var cflag = data[off], cmeth = data[off + 1];
  9071. off += 2;
  9072. nz = bin.nextZero(data, off);
  9073. var ltag = bin.readASCII(data, off, nz - off);
  9074. off = nz + 1;
  9075. nz = bin.nextZero(data, off);
  9076. var tkeyw = bin.readUTF8(data, off, nz - off);
  9077. off = nz + 1;
  9078. var text = bin.readUTF8(data, off, len - (off - offset));
  9079. out.tabs[type][keyw] = text;
  9080. } else if (type == "PLTE") {
  9081. out.tabs[type] = bin.readBytes(data, offset, len);
  9082. } else if (type == "hIST") {
  9083. var pl = out.tabs["PLTE"].length / 3;
  9084. out.tabs[type] = [];
  9085. for (var i = 0; i < pl; i++) out.tabs[type].push(rUs(data, offset + i * 2));
  9086. } else if (type == "tRNS") {
  9087. if (out.ctype == 3) out.tabs[type] = bin.readBytes(data, offset, len);
  9088. else if (out.ctype == 0) out.tabs[type] = rUs(data, offset);
  9089. else if (out.ctype == 2) out.tabs[type] = [rUs(data, offset), rUs(data, offset + 2), rUs(data, offset + 4)];
  9090. } else if (type == "gAMA") out.tabs[type] = bin.readUint(data, offset) / 1e5;
  9091. else if (type == "sRGB") out.tabs[type] = data[offset];
  9092. else if (type == "bKGD") {
  9093. if (out.ctype == 0 || out.ctype == 4) out.tabs[type] = [rUs(data, offset)];
  9094. else if (out.ctype == 2 || out.ctype == 6) out.tabs[type] = [rUs(data, offset), rUs(data, offset + 2), rUs(data, offset + 4)];
  9095. else if (out.ctype == 3) out.tabs[type] = data[offset];
  9096. } else if (type == "IEND") {
  9097. break;
  9098. }
  9099. offset += len;
  9100. var crc = bin.readUint(data, offset);
  9101. offset += 4;
  9102. }
  9103. if (foff != 0) {
  9104. var fr = out.frames[out.frames.length - 1];
  9105. fr.data = UPNG.decode._decompress(out, fd.slice(0, foff), fr.rect.width, fr.rect.height);
  9106. foff = 0;
  9107. }
  9108. out.data = UPNG.decode._decompress(out, dd, out.width, out.height);
  9109. delete out.compress;
  9110. delete out.interlace;
  9111. delete out.filter;
  9112. return out;
  9113. };
  9114. UPNG.decode._decompress = function(out, dd, w, h) {
  9115. var time = Date.now();
  9116. var bpp = UPNG.decode._getBPP(out), bpl = Math.ceil(w * bpp / 8), buff = new Uint8Array((bpl + 1 + out.interlace) * h);
  9117. dd = UPNG.decode._inflate(dd, buff);
  9118. var time = Date.now();
  9119. if (out.interlace == 0) dd = UPNG.decode._filterZero(dd, out, 0, w, h);
  9120. else if (out.interlace == 1) dd = UPNG.decode._readInterlace(dd, out);
  9121. return dd;
  9122. };
  9123. UPNG.decode._inflate = function(data, buff) {
  9124. var out = UPNG["inflateRaw"](new Uint8Array(data.buffer, 2, data.length - 6), buff);
  9125. return out;
  9126. };
  9127. UPNG.inflateRaw = function() {
  9128. var H = {};
  9129. H.H = {};
  9130. H.H.N = function(N, W) {
  9131. var R = Uint8Array, i = 0, m = 0, J = 0, h = 0, Q = 0, X = 0, u = 0, w = 0, d = 0, v, C;
  9132. if (N[0] == 3 && N[1] == 0) return W ? W : new R(0);
  9133. var V = H.H, n = V.b, A = V.e, l = V.R, M = V.n, I = V.A, e = V.Z, b = V.m, Z = W == null;
  9134. if (Z) W = new R(N.length >>> 2 << 3);
  9135. while (i == 0) {
  9136. i = n(N, d, 1);
  9137. m = n(N, d + 1, 2);
  9138. d += 3;
  9139. if (m == 0) {
  9140. if ((d & 7) != 0) d += 8 - (d & 7);
  9141. var D = (d >>> 3) + 4, q = N[D - 4] | N[D - 3] << 8;
  9142. if (Z) W = H.H.W(W, w + q);
  9143. W.set(new R(N.buffer, N.byteOffset + D, q), w);
  9144. d = D + q << 3;
  9145. w += q;
  9146. continue;
  9147. }
  9148. if (Z) W = H.H.W(W, w + (1 << 17));
  9149. if (m == 1) {
  9150. v = b.J;
  9151. C = b.h;
  9152. X = (1 << 9) - 1;
  9153. u = (1 << 5) - 1;
  9154. }
  9155. if (m == 2) {
  9156. J = A(N, d, 5) + 257;
  9157. h = A(N, d + 5, 5) + 1;
  9158. Q = A(N, d + 10, 4) + 4;
  9159. d += 14;
  9160. var E = d, j = 1;
  9161. for (var c = 0; c < 38; c += 2) {
  9162. b.Q[c] = 0;
  9163. b.Q[c + 1] = 0;
  9164. }
  9165. for (var c = 0; c < Q; c++) {
  9166. var K = A(N, d + c * 3, 3);
  9167. b.Q[(b.X[c] << 1) + 1] = K;
  9168. if (K > j) j = K;
  9169. }
  9170. d += 3 * Q;
  9171. M(b.Q, j);
  9172. I(b.Q, j, b.u);
  9173. v = b.w;
  9174. C = b.d;
  9175. d = l(b.u, (1 << j) - 1, J + h, N, d, b.v);
  9176. var r = V.V(b.v, 0, J, b.C);
  9177. X = (1 << r) - 1;
  9178. var S = V.V(b.v, J, h, b.D);
  9179. u = (1 << S) - 1;
  9180. M(b.C, r);
  9181. I(b.C, r, v);
  9182. M(b.D, S);
  9183. I(b.D, S, C);
  9184. }
  9185. while (true) {
  9186. var T = v[e(N, d) & X];
  9187. d += T & 15;
  9188. var p = T >>> 4;
  9189. if (p >>> 8 == 0) {
  9190. W[w++] = p;
  9191. } else if (p == 256) {
  9192. break;
  9193. } else {
  9194. var z = w + p - 254;
  9195. if (p > 264) {
  9196. var _ = b.q[p - 257];
  9197. z = w + (_ >>> 3) + A(N, d, _ & 7);
  9198. d += _ & 7;
  9199. }
  9200. var $ = C[e(N, d) & u];
  9201. d += $ & 15;
  9202. var s = $ >>> 4, Y = b.c[s], a = (Y >>> 4) + n(N, d, Y & 15);
  9203. d += Y & 15;
  9204. while (w < z) {
  9205. W[w] = W[w++ - a];
  9206. W[w] = W[w++ - a];
  9207. W[w] = W[w++ - a];
  9208. W[w] = W[w++ - a];
  9209. }
  9210. w = z;
  9211. }
  9212. }
  9213. }
  9214. return W.length == w ? W : W.slice(0, w);
  9215. };
  9216. H.H.W = function(N, W) {
  9217. var R = N.length;
  9218. if (W <= R) return N;
  9219. var V = new Uint8Array(R << 1);
  9220. V.set(N, 0);
  9221. return V;
  9222. };
  9223. H.H.R = function(N, W, R, V, n, A) {
  9224. var l = H.H.e, M = H.H.Z, I = 0;
  9225. while (I < R) {
  9226. var e = N[M(V, n) & W];
  9227. n += e & 15;
  9228. var b = e >>> 4;
  9229. if (b <= 15) {
  9230. A[I] = b;
  9231. I++;
  9232. } else {
  9233. var Z = 0, m = 0;
  9234. if (b == 16) {
  9235. m = 3 + l(V, n, 2);
  9236. n += 2;
  9237. Z = A[I - 1];
  9238. } else if (b == 17) {
  9239. m = 3 + l(V, n, 3);
  9240. n += 3;
  9241. } else if (b == 18) {
  9242. m = 11 + l(V, n, 7);
  9243. n += 7;
  9244. }
  9245. var J = I + m;
  9246. while (I < J) {
  9247. A[I] = Z;
  9248. I++;
  9249. }
  9250. }
  9251. }
  9252. return n;
  9253. };
  9254. H.H.V = function(N, W, R, V) {
  9255. var n = 0, A = 0, l = V.length >>> 1;
  9256. while (A < R) {
  9257. var M = N[A + W];
  9258. V[A << 1] = 0;
  9259. V[(A << 1) + 1] = M;
  9260. if (M > n) n = M;
  9261. A++;
  9262. }
  9263. while (A < l) {
  9264. V[A << 1] = 0;
  9265. V[(A << 1) + 1] = 0;
  9266. A++;
  9267. }
  9268. return n;
  9269. };
  9270. H.H.n = function(N, W) {
  9271. var R = H.H.m, V = N.length, n, A, l, M, I, e = R.j;
  9272. for (var M = 0; M <= W; M++) e[M] = 0;
  9273. for (M = 1; M < V; M += 2) e[N[M]]++;
  9274. var b = R.K;
  9275. n = 0;
  9276. e[0] = 0;
  9277. for (A = 1; A <= W; A++) {
  9278. n = n + e[A - 1] << 1;
  9279. b[A] = n;
  9280. }
  9281. for (l = 0; l < V; l += 2) {
  9282. I = N[l + 1];
  9283. if (I != 0) {
  9284. N[l] = b[I];
  9285. b[I]++;
  9286. }
  9287. }
  9288. };
  9289. H.H.A = function(N, W, R) {
  9290. var V = N.length, n = H.H.m, A = n.r;
  9291. for (var l = 0; l < V; l += 2) if (N[l + 1] != 0) {
  9292. var M = l >> 1, I = N[l + 1], e = M << 4 | I, b = W - I, Z = N[l] << b, m = Z + (1 << b);
  9293. while (Z != m) {
  9294. var J = A[Z] >>> 15 - W;
  9295. R[J] = e;
  9296. Z++;
  9297. }
  9298. }
  9299. };
  9300. H.H.l = function(N, W) {
  9301. var R = H.H.m.r, V = 15 - W;
  9302. for (var n = 0; n < N.length; n += 2) {
  9303. var A = N[n] << W - N[n + 1];
  9304. N[n] = R[A] >>> V;
  9305. }
  9306. };
  9307. H.H.M = function(N, W, R) {
  9308. R = R << (W & 7);
  9309. var V = W >>> 3;
  9310. N[V] |= R;
  9311. N[V + 1] |= R >>> 8;
  9312. };
  9313. H.H.I = function(N, W, R) {
  9314. R = R << (W & 7);
  9315. var V = W >>> 3;
  9316. N[V] |= R;
  9317. N[V + 1] |= R >>> 8;
  9318. N[V + 2] |= R >>> 16;
  9319. };
  9320. H.H.e = function(N, W, R) {
  9321. return (N[W >>> 3] | N[(W >>> 3) + 1] << 8) >>> (W & 7) & (1 << R) - 1;
  9322. };
  9323. H.H.b = function(N, W, R) {
  9324. return (N[W >>> 3] | N[(W >>> 3) + 1] << 8 | N[(W >>> 3) + 2] << 16) >>> (W & 7) & (1 << R) - 1;
  9325. };
  9326. H.H.Z = function(N, W) {
  9327. return (N[W >>> 3] | N[(W >>> 3) + 1] << 8 | N[(W >>> 3) + 2] << 16) >>> (W & 7);
  9328. };
  9329. H.H.i = function(N, W) {
  9330. return (N[W >>> 3] | N[(W >>> 3) + 1] << 8 | N[(W >>> 3) + 2] << 16 | N[(W >>> 3) + 3] << 24) >>> (W & 7);
  9331. };
  9332. H.H.m = function() {
  9333. var N = Uint16Array, W = Uint32Array;
  9334. return { K: new N(16), j: new N(16), X: [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], S: [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 999, 999, 999], T: [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0], q: new N(32), p: [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 65535, 65535], z: [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0], c: new W(32), J: new N(512), _: [], h: new N(32), $: [], w: new N(32768), C: [], v: [], d: new N(32768), D: [], u: new N(512), Q: [], r: new N(1 << 15), s: new W(286), Y: new W(30), a: new W(19), t: new W(15e3), k: new N(1 << 16), g: new N(1 << 15) };
  9335. }();
  9336. (function() {
  9337. var N = H.H.m, W = 1 << 15;
  9338. for (var R = 0; R < W; R++) {
  9339. var V = R;
  9340. V = (V & 2863311530) >>> 1 | (V & 1431655765) << 1;
  9341. V = (V & 3435973836) >>> 2 | (V & 858993459) << 2;
  9342. V = (V & 4042322160) >>> 4 | (V & 252645135) << 4;
  9343. V = (V & 4278255360) >>> 8 | (V & 16711935) << 8;
  9344. N.r[R] = (V >>> 16 | V << 16) >>> 17;
  9345. }
  9346. function n(A, l, M) {
  9347. while (l-- != 0) A.push(0, M);
  9348. }
  9349. for (var R = 0; R < 32; R++) {
  9350. N.q[R] = N.S[R] << 3 | N.T[R];
  9351. N.c[R] = N.p[R] << 4 | N.z[R];
  9352. }
  9353. n(N._, 144, 8);
  9354. n(N._, 255 - 143, 9);
  9355. n(N._, 279 - 255, 7);
  9356. n(N._, 287 - 279, 8);
  9357. H.H.n(N._, 9);
  9358. H.H.A(N._, 9, N.J);
  9359. H.H.l(N._, 9);
  9360. n(N.$, 32, 5);
  9361. H.H.n(N.$, 5);
  9362. H.H.A(N.$, 5, N.h);
  9363. H.H.l(N.$, 5);
  9364. n(N.Q, 19, 0);
  9365. n(N.C, 286, 0);
  9366. n(N.D, 30, 0);
  9367. n(N.v, 320, 0);
  9368. })();
  9369. return H.H.N;
  9370. }();
  9371. UPNG.decode._readInterlace = function(data, out) {
  9372. var w = out.width, h = out.height;
  9373. var bpp = UPNG.decode._getBPP(out), cbpp = bpp >> 3, bpl = Math.ceil(w * bpp / 8);
  9374. var img = new Uint8Array(h * bpl);
  9375. var di = 0;
  9376. var starting_row = [0, 0, 4, 0, 2, 0, 1];
  9377. var starting_col = [0, 4, 0, 2, 0, 1, 0];
  9378. var row_increment = [8, 8, 8, 4, 4, 2, 2];
  9379. var col_increment = [8, 8, 4, 4, 2, 2, 1];
  9380. var pass = 0;
  9381. while (pass < 7) {
  9382. var ri = row_increment[pass], ci = col_increment[pass];
  9383. var sw = 0, sh = 0;
  9384. var cr = starting_row[pass];
  9385. while (cr < h) {
  9386. cr += ri;
  9387. sh++;
  9388. }
  9389. var cc = starting_col[pass];
  9390. while (cc < w) {
  9391. cc += ci;
  9392. sw++;
  9393. }
  9394. var bpll = Math.ceil(sw * bpp / 8);
  9395. UPNG.decode._filterZero(data, out, di, sw, sh);
  9396. var y = 0, row = starting_row[pass];
  9397. while (row < h) {
  9398. var col = starting_col[pass];
  9399. var cdi = di + y * bpll << 3;
  9400. while (col < w) {
  9401. if (bpp == 1) {
  9402. var val = data[cdi >> 3];
  9403. val = val >> 7 - (cdi & 7) & 1;
  9404. img[row * bpl + (col >> 3)] |= val << 7 - ((col & 7) << 0);
  9405. }
  9406. if (bpp == 2) {
  9407. var val = data[cdi >> 3];
  9408. val = val >> 6 - (cdi & 7) & 3;
  9409. img[row * bpl + (col >> 2)] |= val << 6 - ((col & 3) << 1);
  9410. }
  9411. if (bpp == 4) {
  9412. var val = data[cdi >> 3];
  9413. val = val >> 4 - (cdi & 7) & 15;
  9414. img[row * bpl + (col >> 1)] |= val << 4 - ((col & 1) << 2);
  9415. }
  9416. if (bpp >= 8) {
  9417. var ii = row * bpl + col * cbpp;
  9418. for (var j = 0; j < cbpp; j++) img[ii + j] = data[(cdi >> 3) + j];
  9419. }
  9420. cdi += bpp;
  9421. col += ci;
  9422. }
  9423. y++;
  9424. row += ri;
  9425. }
  9426. if (sw * sh != 0) di += sh * (1 + bpll);
  9427. pass = pass + 1;
  9428. }
  9429. return img;
  9430. };
  9431. UPNG.decode._getBPP = function(out) {
  9432. var noc = [1, null, 3, 1, 2, null, 4][out.ctype];
  9433. return noc * out.depth;
  9434. };
  9435. UPNG.decode._filterZero = function(data, out, off, w, h) {
  9436. var bpp = UPNG.decode._getBPP(out), bpl = Math.ceil(w * bpp / 8), paeth = UPNG.decode._paeth;
  9437. bpp = Math.ceil(bpp / 8);
  9438. var i = 0, di = 1, type = data[off], x = 0;
  9439. if (type > 1) data[off] = [0, 0, 1][type - 2];
  9440. if (type == 3) for (x = bpp; x < bpl; x++) data[x + 1] = data[x + 1] + (data[x + 1 - bpp] >>> 1) & 255;
  9441. for (var y = 0; y < h; y++) {
  9442. i = off + y * bpl;
  9443. di = i + y + 1;
  9444. type = data[di - 1];
  9445. x = 0;
  9446. if (type == 0) for (; x < bpl; x++) data[i + x] = data[di + x];
  9447. else if (type == 1) {
  9448. for (; x < bpp; x++) data[i + x] = data[di + x];
  9449. for (; x < bpl; x++) data[i + x] = data[di + x] + data[i + x - bpp];
  9450. } else if (type == 2) {
  9451. for (; x < bpl; x++) data[i + x] = data[di + x] + data[i + x - bpl];
  9452. } else if (type == 3) {
  9453. for (; x < bpp; x++) data[i + x] = data[di + x] + (data[i + x - bpl] >>> 1);
  9454. for (; x < bpl; x++) data[i + x] = data[di + x] + (data[i + x - bpl] + data[i + x - bpp] >>> 1);
  9455. } else {
  9456. for (; x < bpp; x++) data[i + x] = data[di + x] + paeth(0, data[i + x - bpl], 0);
  9457. for (; x < bpl; x++) data[i + x] = data[di + x] + paeth(data[i + x - bpp], data[i + x - bpl], data[i + x - bpp - bpl]);
  9458. }
  9459. }
  9460. return data;
  9461. };
  9462. UPNG.decode._paeth = function(a, b, c) {
  9463. var p = a + b - c, pa = p - a, pb = p - b, pc = p - c;
  9464. if (pa * pa <= pb * pb && pa * pa <= pc * pc) return a;
  9465. else if (pb * pb <= pc * pc) return b;
  9466. return c;
  9467. };
  9468. UPNG.decode._IHDR = function(data, offset, out) {
  9469. var bin = UPNG._bin;
  9470. out.width = bin.readUint(data, offset);
  9471. offset += 4;
  9472. out.height = bin.readUint(data, offset);
  9473. offset += 4;
  9474. out.depth = data[offset];
  9475. offset++;
  9476. out.ctype = data[offset];
  9477. offset++;
  9478. out.compress = data[offset];
  9479. offset++;
  9480. out.filter = data[offset];
  9481. offset++;
  9482. out.interlace = data[offset];
  9483. offset++;
  9484. };
  9485. UPNG._bin = {
  9486. nextZero: function(data, p) {
  9487. while (data[p] != 0) p++;
  9488. return p;
  9489. },
  9490. readUshort: function(buff, p) {
  9491. return buff[p] << 8 | buff[p + 1];
  9492. },
  9493. writeUshort: function(buff, p, n) {
  9494. buff[p] = n >> 8 & 255;
  9495. buff[p + 1] = n & 255;
  9496. },
  9497. readUint: function(buff, p) {
  9498. return buff[p] * (256 * 256 * 256) + (buff[p + 1] << 16 | buff[p + 2] << 8 | buff[p + 3]);
  9499. },
  9500. writeUint: function(buff, p, n) {
  9501. buff[p] = n >> 24 & 255;
  9502. buff[p + 1] = n >> 16 & 255;
  9503. buff[p + 2] = n >> 8 & 255;
  9504. buff[p + 3] = n & 255;
  9505. },
  9506. readASCII: function(buff, p, l) {
  9507. var s = "";
  9508. for (var i = 0; i < l; i++) s += String.fromCharCode(buff[p + i]);
  9509. return s;
  9510. },
  9511. writeASCII: function(data, p, s) {
  9512. for (var i = 0; i < s.length; i++) data[p + i] = s.charCodeAt(i);
  9513. },
  9514. readBytes: function(buff, p, l) {
  9515. var arr = [];
  9516. for (var i = 0; i < l; i++) arr.push(buff[p + i]);
  9517. return arr;
  9518. },
  9519. pad: function(n) {
  9520. return n.length < 2 ? "0" + n : n;
  9521. },
  9522. readUTF8: function(buff, p, l) {
  9523. var s = "", ns;
  9524. for (var i = 0; i < l; i++) s += "%" + UPNG._bin.pad(buff[p + i].toString(16));
  9525. try {
  9526. ns = decodeURIComponent(s);
  9527. } catch (e) {
  9528. return UPNG._bin.readASCII(buff, p, l);
  9529. }
  9530. return ns;
  9531. }
  9532. };
  9533. UPNG._copyTile = function(sb, sw, sh, tb, tw, th, xoff, yoff, mode) {
  9534. var w = Math.min(sw, tw), h = Math.min(sh, th);
  9535. var si = 0, ti = 0;
  9536. for (var y = 0; y < h; y++)
  9537. for (var x = 0; x < w; x++) {
  9538. if (xoff >= 0 && yoff >= 0) {
  9539. si = y * sw + x << 2;
  9540. ti = (yoff + y) * tw + xoff + x << 2;
  9541. } else {
  9542. si = (-yoff + y) * sw - xoff + x << 2;
  9543. ti = y * tw + x << 2;
  9544. }
  9545. if (mode == 0) {
  9546. tb[ti] = sb[si];
  9547. tb[ti + 1] = sb[si + 1];
  9548. tb[ti + 2] = sb[si + 2];
  9549. tb[ti + 3] = sb[si + 3];
  9550. } else if (mode == 1) {
  9551. var fa = sb[si + 3] * (1 / 255), fr = sb[si] * fa, fg = sb[si + 1] * fa, fb = sb[si + 2] * fa;
  9552. var ba = tb[ti + 3] * (1 / 255), br = tb[ti] * ba, bg = tb[ti + 1] * ba, bb = tb[ti + 2] * ba;
  9553. var ifa = 1 - fa, oa = fa + ba * ifa, ioa = oa == 0 ? 0 : 1 / oa;
  9554. tb[ti + 3] = 255 * oa;
  9555. tb[ti + 0] = (fr + br * ifa) * ioa;
  9556. tb[ti + 1] = (fg + bg * ifa) * ioa;
  9557. tb[ti + 2] = (fb + bb * ifa) * ioa;
  9558. } else if (mode == 2) {
  9559. var fa = sb[si + 3], fr = sb[si], fg = sb[si + 1], fb = sb[si + 2];
  9560. var ba = tb[ti + 3], br = tb[ti], bg = tb[ti + 1], bb = tb[ti + 2];
  9561. if (fa == ba && fr == br && fg == bg && fb == bb) {
  9562. tb[ti] = 0;
  9563. tb[ti + 1] = 0;
  9564. tb[ti + 2] = 0;
  9565. tb[ti + 3] = 0;
  9566. } else {
  9567. tb[ti] = fr;
  9568. tb[ti + 1] = fg;
  9569. tb[ti + 2] = fb;
  9570. tb[ti + 3] = fa;
  9571. }
  9572. } else if (mode == 3) {
  9573. var fa = sb[si + 3], fr = sb[si], fg = sb[si + 1], fb = sb[si + 2];
  9574. var ba = tb[ti + 3], br = tb[ti], bg = tb[ti + 1], bb = tb[ti + 2];
  9575. if (fa == ba && fr == br && fg == bg && fb == bb) continue;
  9576. if (fa < 220 && ba > 20) return false;
  9577. }
  9578. }
  9579. return true;
  9580. };
  9581. UPNG.encode = function(bufs, w, h, ps, dels, tabs, forbidPlte) {
  9582. if (ps == null) ps = 0;
  9583. if (forbidPlte == null) forbidPlte = false;
  9584. var nimg = UPNG.encode.compress(bufs, w, h, ps, [false, false, false, 0, forbidPlte]);
  9585. UPNG.encode.compressPNG(nimg, -1);
  9586. return UPNG.encode._main(nimg, w, h, dels, tabs);
  9587. };
  9588. UPNG.encodeLL = function(bufs, w, h, cc, ac, depth, dels, tabs) {
  9589. var nimg = { ctype: 0 + (cc == 1 ? 0 : 2) + (ac == 0 ? 0 : 4), depth, frames: [] };
  9590. var time = Date.now();
  9591. var bipp = (cc + ac) * depth, bipl = bipp * w;
  9592. for (var i = 0; i < bufs.length; i++)
  9593. nimg.frames.push({ rect: { x: 0, y: 0, width: w, height: h }, img: new Uint8Array(bufs[i]), blend: 0, dispose: 1, bpp: Math.ceil(bipp / 8), bpl: Math.ceil(bipl / 8) });
  9594. UPNG.encode.compressPNG(nimg, 0, true);
  9595. var out = UPNG.encode._main(nimg, w, h, dels, tabs);
  9596. return out;
  9597. };
  9598. UPNG.encode._main = function(nimg, w, h, dels, tabs) {
  9599. if (tabs == null) tabs = {};
  9600. var crc = UPNG.crc.crc, wUi = UPNG._bin.writeUint, wUs = UPNG._bin.writeUshort, wAs = UPNG._bin.writeASCII;
  9601. var offset = 8, anim = nimg.frames.length > 1, pltAlpha = false;
  9602. var leng = 8 + (16 + 5 + 4) + (anim ? 20 : 0);
  9603. if (tabs["sRGB"] != null) leng += 8 + 1 + 4;
  9604. if (tabs["pHYs"] != null) leng += 8 + 9 + 4;
  9605. if (nimg.ctype == 3) {
  9606. var dl = nimg.plte.length;
  9607. for (var i = 0; i < dl; i++) if (nimg.plte[i] >>> 24 != 255) pltAlpha = true;
  9608. leng += 8 + dl * 3 + 4 + (pltAlpha ? 8 + dl * 1 + 4 : 0);
  9609. }
  9610. for (var j = 0; j < nimg.frames.length; j++) {
  9611. var fr = nimg.frames[j];
  9612. if (anim) leng += 38;
  9613. leng += fr.cimg.length + 12;
  9614. if (j != 0) leng += 4;
  9615. }
  9616. leng += 12;
  9617. var data = new Uint8Array(leng);
  9618. var wr = [137, 80, 78, 71, 13, 10, 26, 10];
  9619. for (var i = 0; i < 8; i++) data[i] = wr[i];
  9620. wUi(data, offset, 13);
  9621. offset += 4;
  9622. wAs(data, offset, "IHDR");
  9623. offset += 4;
  9624. wUi(data, offset, w);
  9625. offset += 4;
  9626. wUi(data, offset, h);
  9627. offset += 4;
  9628. data[offset] = nimg.depth;
  9629. offset++;
  9630. data[offset] = nimg.ctype;
  9631. offset++;
  9632. data[offset] = 0;
  9633. offset++;
  9634. data[offset] = 0;
  9635. offset++;
  9636. data[offset] = 0;
  9637. offset++;
  9638. wUi(data, offset, crc(data, offset - 17, 17));
  9639. offset += 4;
  9640. if (tabs["sRGB"] != null) {
  9641. wUi(data, offset, 1);
  9642. offset += 4;
  9643. wAs(data, offset, "sRGB");
  9644. offset += 4;
  9645. data[offset] = tabs["sRGB"];
  9646. offset++;
  9647. wUi(data, offset, crc(data, offset - 5, 5));
  9648. offset += 4;
  9649. }
  9650. if (tabs["pHYs"] != null) {
  9651. wUi(data, offset, 9);
  9652. offset += 4;
  9653. wAs(data, offset, "pHYs");
  9654. offset += 4;
  9655. wUi(data, offset, tabs["pHYs"][0]);
  9656. offset += 4;
  9657. wUi(data, offset, tabs["pHYs"][1]);
  9658. offset += 4;
  9659. data[offset] = tabs["pHYs"][2];
  9660. offset++;
  9661. wUi(data, offset, crc(data, offset - 13, 13));
  9662. offset += 4;
  9663. }
  9664. if (anim) {
  9665. wUi(data, offset, 8);
  9666. offset += 4;
  9667. wAs(data, offset, "acTL");
  9668. offset += 4;
  9669. wUi(data, offset, nimg.frames.length);
  9670. offset += 4;
  9671. wUi(data, offset, tabs["loop"] != null ? tabs["loop"] : 0);
  9672. offset += 4;
  9673. wUi(data, offset, crc(data, offset - 12, 12));
  9674. offset += 4;
  9675. }
  9676. if (nimg.ctype == 3) {
  9677. var dl = nimg.plte.length;
  9678. wUi(data, offset, dl * 3);
  9679. offset += 4;
  9680. wAs(data, offset, "PLTE");
  9681. offset += 4;
  9682. for (var i = 0; i < dl; i++) {
  9683. var ti = i * 3, c = nimg.plte[i], r = c & 255, g = c >>> 8 & 255, b = c >>> 16 & 255;
  9684. data[offset + ti + 0] = r;
  9685. data[offset + ti + 1] = g;
  9686. data[offset + ti + 2] = b;
  9687. }
  9688. offset += dl * 3;
  9689. wUi(data, offset, crc(data, offset - dl * 3 - 4, dl * 3 + 4));
  9690. offset += 4;
  9691. if (pltAlpha) {
  9692. wUi(data, offset, dl);
  9693. offset += 4;
  9694. wAs(data, offset, "tRNS");
  9695. offset += 4;
  9696. for (var i = 0; i < dl; i++) data[offset + i] = nimg.plte[i] >>> 24 & 255;
  9697. offset += dl;
  9698. wUi(data, offset, crc(data, offset - dl - 4, dl + 4));
  9699. offset += 4;
  9700. }
  9701. }
  9702. var fi = 0;
  9703. for (var j = 0; j < nimg.frames.length; j++) {
  9704. var fr = nimg.frames[j];
  9705. if (anim) {
  9706. wUi(data, offset, 26);
  9707. offset += 4;
  9708. wAs(data, offset, "fcTL");
  9709. offset += 4;
  9710. wUi(data, offset, fi++);
  9711. offset += 4;
  9712. wUi(data, offset, fr.rect.width);
  9713. offset += 4;
  9714. wUi(data, offset, fr.rect.height);
  9715. offset += 4;
  9716. wUi(data, offset, fr.rect.x);
  9717. offset += 4;
  9718. wUi(data, offset, fr.rect.y);
  9719. offset += 4;
  9720. wUs(data, offset, dels[j]);
  9721. offset += 2;
  9722. wUs(data, offset, 1e3);
  9723. offset += 2;
  9724. data[offset] = fr.dispose;
  9725. offset++;
  9726. data[offset] = fr.blend;
  9727. offset++;
  9728. wUi(data, offset, crc(data, offset - 30, 30));
  9729. offset += 4;
  9730. }
  9731. var imgd = fr.cimg, dl = imgd.length;
  9732. wUi(data, offset, dl + (j == 0 ? 0 : 4));
  9733. offset += 4;
  9734. var ioff = offset;
  9735. wAs(data, offset, j == 0 ? "IDAT" : "fdAT");
  9736. offset += 4;
  9737. if (j != 0) {
  9738. wUi(data, offset, fi++);
  9739. offset += 4;
  9740. }
  9741. data.set(imgd, offset);
  9742. offset += dl;
  9743. wUi(data, offset, crc(data, ioff, offset - ioff));
  9744. offset += 4;
  9745. }
  9746. wUi(data, offset, 0);
  9747. offset += 4;
  9748. wAs(data, offset, "IEND");
  9749. offset += 4;
  9750. wUi(data, offset, crc(data, offset - 4, 4));
  9751. offset += 4;
  9752. return data.buffer;
  9753. };
  9754. UPNG.encode.compressPNG = function(out, filter, levelZero) {
  9755. for (var i = 0; i < out.frames.length; i++) {
  9756. var frm = out.frames[i], nw = frm.rect.width, nh = frm.rect.height;
  9757. var fdata = new Uint8Array(nh * frm.bpl + nh);
  9758. frm.cimg = UPNG.encode._filterZero(frm.img, nh, frm.bpp, frm.bpl, fdata, filter, levelZero);
  9759. }
  9760. };
  9761. UPNG.encode.compress = function(bufs, w, h, ps, prms) {
  9762. var onlyBlend = prms[0], evenCrd = prms[1], forbidPrev = prms[2], minBits = prms[3], forbidPlte = prms[4];
  9763. var ctype = 6, depth = 8, alphaAnd = 255;
  9764. for (var j = 0; j < bufs.length; j++) {
  9765. var img = new Uint8Array(bufs[j]), ilen = img.length;
  9766. for (var i = 0; i < ilen; i += 4) alphaAnd &= img[i + 3];
  9767. }
  9768. var gotAlpha = alphaAnd != 255;
  9769. var frms = UPNG.encode.framize(bufs, w, h, onlyBlend, evenCrd, forbidPrev);
  9770. var cmap = {}, plte = [], inds = [];
  9771. if (ps != 0) {
  9772. var nbufs = [];
  9773. for (var i = 0; i < frms.length; i++) nbufs.push(frms[i].img.buffer);
  9774. var abuf = UPNG.encode.concatRGBA(nbufs), qres = UPNG.quantize(abuf, ps);
  9775. var cof = 0, bb = new Uint8Array(qres.abuf);
  9776. for (var i = 0; i < frms.length; i++) {
  9777. var ti = frms[i].img, bln = ti.length;
  9778. inds.push(new Uint8Array(qres.inds.buffer, cof >> 2, bln >> 2));
  9779. for (var j = 0; j < bln; j += 4) {
  9780. ti[j] = bb[cof + j];
  9781. ti[j + 1] = bb[cof + j + 1];
  9782. ti[j + 2] = bb[cof + j + 2];
  9783. ti[j + 3] = bb[cof + j + 3];
  9784. }
  9785. cof += bln;
  9786. }
  9787. for (var i = 0; i < qres.plte.length; i++) plte.push(qres.plte[i].est.rgba);
  9788. } else {
  9789. for (var j = 0; j < frms.length; j++) {
  9790. var frm = frms[j], img32 = new Uint32Array(frm.img.buffer), nw = frm.rect.width, ilen = img32.length;
  9791. var ind = new Uint8Array(ilen);
  9792. inds.push(ind);
  9793. for (var i = 0; i < ilen; i++) {
  9794. var c = img32[i];
  9795. if (i != 0 && c == img32[i - 1]) ind[i] = ind[i - 1];
  9796. else if (i > nw && c == img32[i - nw]) ind[i] = ind[i - nw];
  9797. else {
  9798. var cmc = cmap[c];
  9799. if (cmc == null) {
  9800. cmap[c] = cmc = plte.length;
  9801. plte.push(c);
  9802. if (plte.length >= 300) break;
  9803. }
  9804. ind[i] = cmc;
  9805. }
  9806. }
  9807. }
  9808. }
  9809. var cc = plte.length;
  9810. if (cc <= 256 && forbidPlte == false) {
  9811. if (cc <= 2) depth = 1;
  9812. else if (cc <= 4) depth = 2;
  9813. else if (cc <= 16) depth = 4;
  9814. else depth = 8;
  9815. depth = Math.max(depth, minBits);
  9816. }
  9817. for (var j = 0; j < frms.length; j++) {
  9818. var frm = frms[j], nx = frm.rect.x, ny = frm.rect.y, nw = frm.rect.width, nh = frm.rect.height;
  9819. var cimg = frm.img, cimg32 = new Uint32Array(cimg.buffer);
  9820. var bpl = 4 * nw, bpp = 4;
  9821. if (cc <= 256 && forbidPlte == false) {
  9822. bpl = Math.ceil(depth * nw / 8);
  9823. var nimg = new Uint8Array(bpl * nh);
  9824. var inj = inds[j];
  9825. for (var y = 0; y < nh; y++) {
  9826. var i = y * bpl, ii = y * nw;
  9827. if (depth == 8) for (var x = 0; x < nw; x++) nimg[i + x] = inj[ii + x];
  9828. else if (depth == 4) for (var x = 0; x < nw; x++) nimg[i + (x >> 1)] |= inj[ii + x] << 4 - (x & 1) * 4;
  9829. else if (depth == 2) for (var x = 0; x < nw; x++) nimg[i + (x >> 2)] |= inj[ii + x] << 6 - (x & 3) * 2;
  9830. else if (depth == 1) for (var x = 0; x < nw; x++) nimg[i + (x >> 3)] |= inj[ii + x] << 7 - (x & 7) * 1;
  9831. }
  9832. cimg = nimg;
  9833. ctype = 3;
  9834. bpp = 1;
  9835. } else if (gotAlpha == false && frms.length == 1) {
  9836. var nimg = new Uint8Array(nw * nh * 3), area = nw * nh;
  9837. for (var i = 0; i < area; i++) {
  9838. var ti = i * 3, qi = i * 4;
  9839. nimg[ti] = cimg[qi];
  9840. nimg[ti + 1] = cimg[qi + 1];
  9841. nimg[ti + 2] = cimg[qi + 2];
  9842. }
  9843. cimg = nimg;
  9844. ctype = 2;
  9845. bpp = 3;
  9846. bpl = 3 * nw;
  9847. }
  9848. frm.img = cimg;
  9849. frm.bpl = bpl;
  9850. frm.bpp = bpp;
  9851. }
  9852. return { ctype, depth, plte, frames: frms };
  9853. };
  9854. UPNG.encode.framize = function(bufs, w, h, alwaysBlend, evenCrd, forbidPrev) {
  9855. var frms = [];
  9856. for (var j = 0; j < bufs.length; j++) {
  9857. var cimg = new Uint8Array(bufs[j]), cimg32 = new Uint32Array(cimg.buffer);
  9858. var nimg;
  9859. var nx = 0, ny = 0, nw = w, nh = h, blend = alwaysBlend ? 1 : 0;
  9860. if (j != 0) {
  9861. var tlim = forbidPrev || alwaysBlend || j == 1 || frms[j - 2].dispose != 0 ? 1 : 2, tstp = 0, tarea = 1e9;
  9862. for (var it = 0; it < tlim; it++) {
  9863. var pimg = new Uint8Array(bufs[j - 1 - it]), p32 = new Uint32Array(bufs[j - 1 - it]);
  9864. var mix = w, miy = h, max = -1, may = -1;
  9865. for (var y = 0; y < h; y++) for (var x = 0; x < w; x++) {
  9866. var i = y * w + x;
  9867. if (cimg32[i] != p32[i]) {
  9868. if (x < mix) mix = x;
  9869. if (x > max) max = x;
  9870. if (y < miy) miy = y;
  9871. if (y > may) may = y;
  9872. }
  9873. }
  9874. if (max == -1) mix = miy = max = may = 0;
  9875. if (evenCrd) {
  9876. if ((mix & 1) == 1) mix--;
  9877. if ((miy & 1) == 1) miy--;
  9878. }
  9879. var sarea = (max - mix + 1) * (may - miy + 1);
  9880. if (sarea < tarea) {
  9881. tarea = sarea;
  9882. tstp = it;
  9883. nx = mix;
  9884. ny = miy;
  9885. nw = max - mix + 1;
  9886. nh = may - miy + 1;
  9887. }
  9888. }
  9889. var pimg = new Uint8Array(bufs[j - 1 - tstp]);
  9890. if (tstp == 1) frms[j - 1].dispose = 2;
  9891. nimg = new Uint8Array(nw * nh * 4);
  9892. UPNG._copyTile(pimg, w, h, nimg, nw, nh, -nx, -ny, 0);
  9893. blend = UPNG._copyTile(cimg, w, h, nimg, nw, nh, -nx, -ny, 3) ? 1 : 0;
  9894. if (blend == 1) UPNG.encode._prepareDiff(cimg, w, h, nimg, { x: nx, y: ny, width: nw, height: nh });
  9895. else UPNG._copyTile(cimg, w, h, nimg, nw, nh, -nx, -ny, 0);
  9896. } else nimg = cimg.slice(0);
  9897. frms.push({ rect: { x: nx, y: ny, width: nw, height: nh }, img: nimg, blend, dispose: 0 });
  9898. }
  9899. if (alwaysBlend) for (var j = 0; j < frms.length; j++) {
  9900. var frm = frms[j];
  9901. if (frm.blend == 1) continue;
  9902. var r0 = frm.rect, r1 = frms[j - 1].rect;
  9903. var miX = Math.min(r0.x, r1.x), miY = Math.min(r0.y, r1.y);
  9904. var maX = Math.max(r0.x + r0.width, r1.x + r1.width), maY = Math.max(r0.y + r0.height, r1.y + r1.height);
  9905. var r = { x: miX, y: miY, width: maX - miX, height: maY - miY };
  9906. frms[j - 1].dispose = 1;
  9907. if (j - 1 != 0)
  9908. UPNG.encode._updateFrame(bufs, w, h, frms, j - 1, r, evenCrd);
  9909. UPNG.encode._updateFrame(bufs, w, h, frms, j, r, evenCrd);
  9910. }
  9911. var area = 0;
  9912. if (bufs.length != 1) for (var i = 0; i < frms.length; i++) {
  9913. var frm = frms[i];
  9914. area += frm.rect.width * frm.rect.height;
  9915. }
  9916. return frms;
  9917. };
  9918. UPNG.encode._updateFrame = function(bufs, w, h, frms, i, r, evenCrd) {
  9919. var U8 = Uint8Array, U32 = Uint32Array;
  9920. var pimg = new U8(bufs[i - 1]), pimg32 = new U32(bufs[i - 1]), nimg = i + 1 < bufs.length ? new U8(bufs[i + 1]) : null;
  9921. var cimg = new U8(bufs[i]), cimg32 = new U32(cimg.buffer);
  9922. var mix = w, miy = h, max = -1, may = -1;
  9923. for (var y = 0; y < r.height; y++) for (var x = 0; x < r.width; x++) {
  9924. var cx2 = r.x + x, cy2 = r.y + y;
  9925. var j = cy2 * w + cx2, cc = cimg32[j];
  9926. if (cc == 0 || frms[i - 1].dispose == 0 && pimg32[j] == cc && (nimg == null || nimg[j * 4 + 3] != 0)) {
  9927. } else {
  9928. if (cx2 < mix) mix = cx2;
  9929. if (cx2 > max) max = cx2;
  9930. if (cy2 < miy) miy = cy2;
  9931. if (cy2 > may) may = cy2;
  9932. }
  9933. }
  9934. if (max == -1) mix = miy = max = may = 0;
  9935. if (evenCrd) {
  9936. if ((mix & 1) == 1) mix--;
  9937. if ((miy & 1) == 1) miy--;
  9938. }
  9939. r = { x: mix, y: miy, width: max - mix + 1, height: may - miy + 1 };
  9940. var fr = frms[i];
  9941. fr.rect = r;
  9942. fr.blend = 1;
  9943. fr.img = new Uint8Array(r.width * r.height * 4);
  9944. if (frms[i - 1].dispose == 0) {
  9945. UPNG._copyTile(pimg, w, h, fr.img, r.width, r.height, -r.x, -r.y, 0);
  9946. UPNG.encode._prepareDiff(cimg, w, h, fr.img, r);
  9947. } else
  9948. UPNG._copyTile(cimg, w, h, fr.img, r.width, r.height, -r.x, -r.y, 0);
  9949. };
  9950. UPNG.encode._prepareDiff = function(cimg, w, h, nimg, rec) {
  9951. UPNG._copyTile(cimg, w, h, nimg, rec.width, rec.height, -rec.x, -rec.y, 2);
  9952. };
  9953. UPNG.encode._filterZero = function(img, h, bpp, bpl, data, filter, levelZero) {
  9954. var fls = [], ftry = [0, 1, 2, 3, 4];
  9955. if (filter != -1) ftry = [filter];
  9956. else if (h * bpl > 5e5 || bpp == 1) ftry = [0];
  9957. var opts;
  9958. if (levelZero) opts = { level: 0 };
  9959. var CMPR = levelZero && UZIP != null ? UZIP : import_pako4.default;
  9960. for (var i = 0; i < ftry.length; i++) {
  9961. for (var y = 0; y < h; y++) UPNG.encode._filterLine(data, img, y, bpl, bpp, ftry[i]);
  9962. fls.push(CMPR["deflate"](data, opts));
  9963. }
  9964. var ti, tsize = 1e9;
  9965. for (var i = 0; i < fls.length; i++) if (fls[i].length < tsize) {
  9966. ti = i;
  9967. tsize = fls[i].length;
  9968. }
  9969. return fls[ti];
  9970. };
  9971. UPNG.encode._filterLine = function(data, img, y, bpl, bpp, type) {
  9972. var i = y * bpl, di = i + y, paeth = UPNG.decode._paeth;
  9973. data[di] = type;
  9974. di++;
  9975. if (type == 0) {
  9976. if (bpl < 500) for (var x = 0; x < bpl; x++) data[di + x] = img[i + x];
  9977. else data.set(new Uint8Array(img.buffer, i, bpl), di);
  9978. } else if (type == 1) {
  9979. for (var x = 0; x < bpp; x++) data[di + x] = img[i + x];
  9980. for (var x = bpp; x < bpl; x++) data[di + x] = img[i + x] - img[i + x - bpp] + 256 & 255;
  9981. } else if (y == 0) {
  9982. for (var x = 0; x < bpp; x++) data[di + x] = img[i + x];
  9983. if (type == 2) for (var x = bpp; x < bpl; x++) data[di + x] = img[i + x];
  9984. if (type == 3) for (var x = bpp; x < bpl; x++) data[di + x] = img[i + x] - (img[i + x - bpp] >> 1) + 256 & 255;
  9985. if (type == 4) for (var x = bpp; x < bpl; x++) data[di + x] = img[i + x] - paeth(img[i + x - bpp], 0, 0) + 256 & 255;
  9986. } else {
  9987. if (type == 2) {
  9988. for (var x = 0; x < bpl; x++) data[di + x] = img[i + x] + 256 - img[i + x - bpl] & 255;
  9989. }
  9990. if (type == 3) {
  9991. for (var x = 0; x < bpp; x++) data[di + x] = img[i + x] + 256 - (img[i + x - bpl] >> 1) & 255;
  9992. for (var x = bpp; x < bpl; x++) data[di + x] = img[i + x] + 256 - (img[i + x - bpl] + img[i + x - bpp] >> 1) & 255;
  9993. }
  9994. if (type == 4) {
  9995. for (var x = 0; x < bpp; x++) data[di + x] = img[i + x] + 256 - paeth(0, img[i + x - bpl], 0) & 255;
  9996. for (var x = bpp; x < bpl; x++) data[di + x] = img[i + x] + 256 - paeth(img[i + x - bpp], img[i + x - bpl], img[i + x - bpp - bpl]) & 255;
  9997. }
  9998. }
  9999. };
  10000. UPNG.crc = {
  10001. table: function() {
  10002. var tab = new Uint32Array(256);
  10003. for (var n = 0; n < 256; n++) {
  10004. var c = n;
  10005. for (var k = 0; k < 8; k++) {
  10006. if (c & 1) c = 3988292384 ^ c >>> 1;
  10007. else c = c >>> 1;
  10008. }
  10009. tab[n] = c;
  10010. }
  10011. return tab;
  10012. }(),
  10013. update: function(c, buf, off, len) {
  10014. for (var i = 0; i < len; i++) c = UPNG.crc.table[(c ^ buf[off + i]) & 255] ^ c >>> 8;
  10015. return c;
  10016. },
  10017. crc: function(b, o, l) {
  10018. return UPNG.crc.update(4294967295, b, o, l) ^ 4294967295;
  10019. }
  10020. };
  10021. UPNG.quantize = function(abuf, ps) {
  10022. var oimg = new Uint8Array(abuf), nimg = oimg.slice(0), nimg32 = new Uint32Array(nimg.buffer);
  10023. var KD = UPNG.quantize.getKDtree(nimg, ps);
  10024. var root = KD[0], leafs = KD[1];
  10025. var planeDst = UPNG.quantize.planeDst;
  10026. var sb = oimg, tb = nimg32, len = sb.length;
  10027. var inds = new Uint8Array(oimg.length >> 2);
  10028. for (var i = 0; i < len; i += 4) {
  10029. var r = sb[i] * (1 / 255), g = sb[i + 1] * (1 / 255), b = sb[i + 2] * (1 / 255), a = sb[i + 3] * (1 / 255);
  10030. var nd = UPNG.quantize.getNearest(root, r, g, b, a);
  10031. inds[i >> 2] = nd.ind;
  10032. tb[i >> 2] = nd.est.rgba;
  10033. }
  10034. return { abuf: nimg.buffer, inds, plte: leafs };
  10035. };
  10036. UPNG.quantize.getKDtree = function(nimg, ps, err) {
  10037. if (err == null) err = 1e-4;
  10038. var nimg32 = new Uint32Array(nimg.buffer);
  10039. var root = { i0: 0, i1: nimg.length, bst: null, est: null, tdst: 0, left: null, right: null };
  10040. root.bst = UPNG.quantize.stats(nimg, root.i0, root.i1);
  10041. root.est = UPNG.quantize.estats(root.bst);
  10042. var leafs = [root];
  10043. while (leafs.length < ps) {
  10044. var maxL = 0, mi = 0;
  10045. for (var i = 0; i < leafs.length; i++) if (leafs[i].est.L > maxL) {
  10046. maxL = leafs[i].est.L;
  10047. mi = i;
  10048. }
  10049. if (maxL < err) break;
  10050. var node = leafs[mi];
  10051. var s0 = UPNG.quantize.splitPixels(nimg, nimg32, node.i0, node.i1, node.est.e, node.est.eMq255);
  10052. var s0wrong = node.i0 >= s0 || node.i1 <= s0;
  10053. if (s0wrong) {
  10054. node.est.L = 0;
  10055. continue;
  10056. }
  10057. var ln = { i0: node.i0, i1: s0, bst: null, est: null, tdst: 0, left: null, right: null };
  10058. ln.bst = UPNG.quantize.stats(nimg, ln.i0, ln.i1);
  10059. ln.est = UPNG.quantize.estats(ln.bst);
  10060. var rn = { i0: s0, i1: node.i1, bst: null, est: null, tdst: 0, left: null, right: null };
  10061. rn.bst = { R: [], m: [], N: node.bst.N - ln.bst.N };
  10062. for (var i = 0; i < 16; i++) rn.bst.R[i] = node.bst.R[i] - ln.bst.R[i];
  10063. for (var i = 0; i < 4; i++) rn.bst.m[i] = node.bst.m[i] - ln.bst.m[i];
  10064. rn.est = UPNG.quantize.estats(rn.bst);
  10065. node.left = ln;
  10066. node.right = rn;
  10067. leafs[mi] = ln;
  10068. leafs.push(rn);
  10069. }
  10070. leafs.sort(function(a, b) {
  10071. return b.bst.N - a.bst.N;
  10072. });
  10073. for (var i = 0; i < leafs.length; i++) leafs[i].ind = i;
  10074. return [root, leafs];
  10075. };
  10076. UPNG.quantize.getNearest = function(nd, r, g, b, a) {
  10077. if (nd.left == null) {
  10078. nd.tdst = UPNG.quantize.dist(nd.est.q, r, g, b, a);
  10079. return nd;
  10080. }
  10081. var planeDst = UPNG.quantize.planeDst(nd.est, r, g, b, a);
  10082. var node0 = nd.left, node1 = nd.right;
  10083. if (planeDst > 0) {
  10084. node0 = nd.right;
  10085. node1 = nd.left;
  10086. }
  10087. var ln = UPNG.quantize.getNearest(node0, r, g, b, a);
  10088. if (ln.tdst <= planeDst * planeDst) return ln;
  10089. var rn = UPNG.quantize.getNearest(node1, r, g, b, a);
  10090. return rn.tdst < ln.tdst ? rn : ln;
  10091. };
  10092. UPNG.quantize.planeDst = function(est, r, g, b, a) {
  10093. var e = est.e;
  10094. return e[0] * r + e[1] * g + e[2] * b + e[3] * a - est.eMq;
  10095. };
  10096. UPNG.quantize.dist = function(q, r, g, b, a) {
  10097. var d0 = r - q[0], d1 = g - q[1], d2 = b - q[2], d3 = a - q[3];
  10098. return d0 * d0 + d1 * d1 + d2 * d2 + d3 * d3;
  10099. };
  10100. UPNG.quantize.splitPixels = function(nimg, nimg32, i0, i1, e, eMq) {
  10101. var vecDot = UPNG.quantize.vecDot;
  10102. i1 -= 4;
  10103. var shfs = 0;
  10104. while (i0 < i1) {
  10105. while (vecDot(nimg, i0, e) <= eMq) i0 += 4;
  10106. while (vecDot(nimg, i1, e) > eMq) i1 -= 4;
  10107. if (i0 >= i1) break;
  10108. var t = nimg32[i0 >> 2];
  10109. nimg32[i0 >> 2] = nimg32[i1 >> 2];
  10110. nimg32[i1 >> 2] = t;
  10111. i0 += 4;
  10112. i1 -= 4;
  10113. }
  10114. while (vecDot(nimg, i0, e) > eMq) i0 -= 4;
  10115. return i0 + 4;
  10116. };
  10117. UPNG.quantize.vecDot = function(nimg, i, e) {
  10118. return nimg[i] * e[0] + nimg[i + 1] * e[1] + nimg[i + 2] * e[2] + nimg[i + 3] * e[3];
  10119. };
  10120. UPNG.quantize.stats = function(nimg, i0, i1) {
  10121. var R = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
  10122. var m = [0, 0, 0, 0];
  10123. var N = i1 - i0 >> 2;
  10124. for (var i = i0; i < i1; i += 4) {
  10125. var r = nimg[i] * (1 / 255), g = nimg[i + 1] * (1 / 255), b = nimg[i + 2] * (1 / 255), a = nimg[i + 3] * (1 / 255);
  10126. m[0] += r;
  10127. m[1] += g;
  10128. m[2] += b;
  10129. m[3] += a;
  10130. R[0] += r * r;
  10131. R[1] += r * g;
  10132. R[2] += r * b;
  10133. R[3] += r * a;
  10134. R[5] += g * g;
  10135. R[6] += g * b;
  10136. R[7] += g * a;
  10137. R[10] += b * b;
  10138. R[11] += b * a;
  10139. R[15] += a * a;
  10140. }
  10141. R[4] = R[1];
  10142. R[8] = R[2];
  10143. R[9] = R[6];
  10144. R[12] = R[3];
  10145. R[13] = R[7];
  10146. R[14] = R[11];
  10147. return { R, m, N };
  10148. };
  10149. UPNG.quantize.estats = function(stats) {
  10150. var R = stats.R, m = stats.m, N = stats.N;
  10151. var m0 = m[0], m1 = m[1], m2 = m[2], m3 = m[3], iN = N == 0 ? 0 : 1 / N;
  10152. var Rj = [
  10153. R[0] - m0 * m0 * iN,
  10154. R[1] - m0 * m1 * iN,
  10155. R[2] - m0 * m2 * iN,
  10156. R[3] - m0 * m3 * iN,
  10157. R[4] - m1 * m0 * iN,
  10158. R[5] - m1 * m1 * iN,
  10159. R[6] - m1 * m2 * iN,
  10160. R[7] - m1 * m3 * iN,
  10161. R[8] - m2 * m0 * iN,
  10162. R[9] - m2 * m1 * iN,
  10163. R[10] - m2 * m2 * iN,
  10164. R[11] - m2 * m3 * iN,
  10165. R[12] - m3 * m0 * iN,
  10166. R[13] - m3 * m1 * iN,
  10167. R[14] - m3 * m2 * iN,
  10168. R[15] - m3 * m3 * iN
  10169. ];
  10170. var A = Rj, M = UPNG.M4;
  10171. var b = [0.5, 0.5, 0.5, 0.5], mi = 0, tmi = 0;
  10172. if (N != 0)
  10173. for (var i = 0; i < 10; i++) {
  10174. b = M.multVec(A, b);
  10175. tmi = Math.sqrt(M.dot(b, b));
  10176. b = M.sml(1 / tmi, b);
  10177. if (Math.abs(tmi - mi) < 1e-9) break;
  10178. mi = tmi;
  10179. }
  10180. var q = [m0 * iN, m1 * iN, m2 * iN, m3 * iN];
  10181. var eMq255 = M.dot(M.sml(255, q), b);
  10182. return {
  10183. Cov: Rj,
  10184. q,
  10185. e: b,
  10186. L: mi,
  10187. eMq255,
  10188. eMq: M.dot(b, q),
  10189. rgba: (Math.round(255 * q[3]) << 24 | Math.round(255 * q[2]) << 16 | Math.round(255 * q[1]) << 8 | Math.round(255 * q[0]) << 0) >>> 0
  10190. };
  10191. };
  10192. UPNG.M4 = {
  10193. multVec: function(m, v) {
  10194. return [
  10195. m[0] * v[0] + m[1] * v[1] + m[2] * v[2] + m[3] * v[3],
  10196. m[4] * v[0] + m[5] * v[1] + m[6] * v[2] + m[7] * v[3],
  10197. m[8] * v[0] + m[9] * v[1] + m[10] * v[2] + m[11] * v[3],
  10198. m[12] * v[0] + m[13] * v[1] + m[14] * v[2] + m[15] * v[3]
  10199. ];
  10200. },
  10201. dot: function(x, y) {
  10202. return x[0] * y[0] + x[1] * y[1] + x[2] * y[2] + x[3] * y[3];
  10203. },
  10204. sml: function(a, y) {
  10205. return [a * y[0], a * y[1], a * y[2], a * y[3]];
  10206. }
  10207. };
  10208. UPNG.encode.concatRGBA = function(bufs) {
  10209. var tlen = 0;
  10210. for (var i = 0; i < bufs.length; i++) tlen += bufs[i].byteLength;
  10211. var nimg = new Uint8Array(tlen), noff = 0;
  10212. for (var i = 0; i < bufs.length; i++) {
  10213. var img = new Uint8Array(bufs[i]), il = img.length;
  10214. for (var j = 0; j < il; j += 4) {
  10215. var r = img[j], g = img[j + 1], b = img[j + 2], a = img[j + 3];
  10216. if (a == 0) r = g = b = 0;
  10217. nimg[noff + j] = r;
  10218. nimg[noff + j + 1] = g;
  10219. nimg[noff + j + 2] = b;
  10220. nimg[noff + j + 3] = a;
  10221. }
  10222. noff += il;
  10223. }
  10224. return nimg.buffer;
  10225. };
  10226. var UPNG_default = UPNG;
  10227. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/utils/png.js
  10228. var getImageType = function(ctype) {
  10229. if (ctype === 0)
  10230. return PngType.Greyscale;
  10231. if (ctype === 2)
  10232. return PngType.Truecolour;
  10233. if (ctype === 3)
  10234. return PngType.IndexedColour;
  10235. if (ctype === 4)
  10236. return PngType.GreyscaleWithAlpha;
  10237. if (ctype === 6)
  10238. return PngType.TruecolourWithAlpha;
  10239. throw new Error("Unknown color type: " + ctype);
  10240. };
  10241. var splitAlphaChannel = function(rgbaChannel) {
  10242. var pixelCount = Math.floor(rgbaChannel.length / 4);
  10243. var rgbChannel = new Uint8Array(pixelCount * 3);
  10244. var alphaChannel = new Uint8Array(pixelCount * 1);
  10245. var rgbaOffset = 0;
  10246. var rgbOffset = 0;
  10247. var alphaOffset = 0;
  10248. while (rgbaOffset < rgbaChannel.length) {
  10249. rgbChannel[rgbOffset++] = rgbaChannel[rgbaOffset++];
  10250. rgbChannel[rgbOffset++] = rgbaChannel[rgbaOffset++];
  10251. rgbChannel[rgbOffset++] = rgbaChannel[rgbaOffset++];
  10252. alphaChannel[alphaOffset++] = rgbaChannel[rgbaOffset++];
  10253. }
  10254. return { rgbChannel, alphaChannel };
  10255. };
  10256. var PngType;
  10257. (function(PngType2) {
  10258. PngType2["Greyscale"] = "Greyscale";
  10259. PngType2["Truecolour"] = "Truecolour";
  10260. PngType2["IndexedColour"] = "IndexedColour";
  10261. PngType2["GreyscaleWithAlpha"] = "GreyscaleWithAlpha";
  10262. PngType2["TruecolourWithAlpha"] = "TruecolourWithAlpha";
  10263. })(PngType || (PngType = {}));
  10264. var PNG = (
  10265. /** @class */
  10266. function() {
  10267. function PNG2(pngData) {
  10268. var upng = UPNG_default.decode(pngData);
  10269. var frames = UPNG_default.toRGBA8(upng);
  10270. if (frames.length > 1)
  10271. throw new Error("Animated PNGs are not supported");
  10272. var frame = new Uint8Array(frames[0]);
  10273. var _a = splitAlphaChannel(frame), rgbChannel = _a.rgbChannel, alphaChannel = _a.alphaChannel;
  10274. this.rgbChannel = rgbChannel;
  10275. var hasAlphaValues = alphaChannel.some(function(a) {
  10276. return a < 255;
  10277. });
  10278. if (hasAlphaValues)
  10279. this.alphaChannel = alphaChannel;
  10280. this.type = getImageType(upng.ctype);
  10281. this.width = upng.width;
  10282. this.height = upng.height;
  10283. this.bitsPerComponent = 8;
  10284. }
  10285. PNG2.load = function(pngData) {
  10286. return new PNG2(pngData);
  10287. };
  10288. return PNG2;
  10289. }()
  10290. );
  10291. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/embedders/PngEmbedder.js
  10292. var PngEmbedder = (
  10293. /** @class */
  10294. function() {
  10295. function PngEmbedder2(png) {
  10296. this.image = png;
  10297. this.bitsPerComponent = png.bitsPerComponent;
  10298. this.width = png.width;
  10299. this.height = png.height;
  10300. this.colorSpace = "DeviceRGB";
  10301. }
  10302. PngEmbedder2.for = function(imageData) {
  10303. return __awaiter(this, void 0, void 0, function() {
  10304. var png;
  10305. return __generator(this, function(_a) {
  10306. png = PNG.load(imageData);
  10307. return [2, new PngEmbedder2(png)];
  10308. });
  10309. });
  10310. };
  10311. PngEmbedder2.prototype.embedIntoContext = function(context, ref) {
  10312. return __awaiter(this, void 0, void 0, function() {
  10313. var SMask, xObject;
  10314. return __generator(this, function(_a) {
  10315. SMask = this.embedAlphaChannel(context);
  10316. xObject = context.flateStream(this.image.rgbChannel, {
  10317. Type: "XObject",
  10318. Subtype: "Image",
  10319. BitsPerComponent: this.image.bitsPerComponent,
  10320. Width: this.image.width,
  10321. Height: this.image.height,
  10322. ColorSpace: this.colorSpace,
  10323. SMask
  10324. });
  10325. if (ref) {
  10326. context.assign(ref, xObject);
  10327. return [2, ref];
  10328. } else {
  10329. return [2, context.register(xObject)];
  10330. }
  10331. return [
  10332. 2
  10333. /*return*/
  10334. ];
  10335. });
  10336. });
  10337. };
  10338. PngEmbedder2.prototype.embedAlphaChannel = function(context) {
  10339. if (!this.image.alphaChannel)
  10340. return void 0;
  10341. var xObject = context.flateStream(this.image.alphaChannel, {
  10342. Type: "XObject",
  10343. Subtype: "Image",
  10344. Height: this.image.height,
  10345. Width: this.image.width,
  10346. BitsPerComponent: this.image.bitsPerComponent,
  10347. ColorSpace: "DeviceGray",
  10348. Decode: [0, 1]
  10349. });
  10350. return context.register(xObject);
  10351. };
  10352. return PngEmbedder2;
  10353. }()
  10354. );
  10355. var PngEmbedder_default = PngEmbedder;
  10356. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/streams/Stream.js
  10357. var Stream = (
  10358. /** @class */
  10359. function() {
  10360. function Stream2(buffer, start, length) {
  10361. this.bytes = buffer;
  10362. this.start = start || 0;
  10363. this.pos = this.start;
  10364. this.end = !!start && !!length ? start + length : this.bytes.length;
  10365. }
  10366. Object.defineProperty(Stream2.prototype, "length", {
  10367. get: function() {
  10368. return this.end - this.start;
  10369. },
  10370. enumerable: false,
  10371. configurable: true
  10372. });
  10373. Object.defineProperty(Stream2.prototype, "isEmpty", {
  10374. get: function() {
  10375. return this.length === 0;
  10376. },
  10377. enumerable: false,
  10378. configurable: true
  10379. });
  10380. Stream2.prototype.getByte = function() {
  10381. if (this.pos >= this.end) {
  10382. return -1;
  10383. }
  10384. return this.bytes[this.pos++];
  10385. };
  10386. Stream2.prototype.getUint16 = function() {
  10387. var b0 = this.getByte();
  10388. var b1 = this.getByte();
  10389. if (b0 === -1 || b1 === -1) {
  10390. return -1;
  10391. }
  10392. return (b0 << 8) + b1;
  10393. };
  10394. Stream2.prototype.getInt32 = function() {
  10395. var b0 = this.getByte();
  10396. var b1 = this.getByte();
  10397. var b2 = this.getByte();
  10398. var b3 = this.getByte();
  10399. return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3;
  10400. };
  10401. Stream2.prototype.getBytes = function(length, forceClamped) {
  10402. if (forceClamped === void 0) {
  10403. forceClamped = false;
  10404. }
  10405. var bytes = this.bytes;
  10406. var pos = this.pos;
  10407. var strEnd = this.end;
  10408. if (!length) {
  10409. var subarray = bytes.subarray(pos, strEnd);
  10410. return forceClamped ? new Uint8ClampedArray(subarray) : subarray;
  10411. } else {
  10412. var end = pos + length;
  10413. if (end > strEnd) {
  10414. end = strEnd;
  10415. }
  10416. this.pos = end;
  10417. var subarray = bytes.subarray(pos, end);
  10418. return forceClamped ? new Uint8ClampedArray(subarray) : subarray;
  10419. }
  10420. };
  10421. Stream2.prototype.peekByte = function() {
  10422. var peekedByte = this.getByte();
  10423. this.pos--;
  10424. return peekedByte;
  10425. };
  10426. Stream2.prototype.peekBytes = function(length, forceClamped) {
  10427. if (forceClamped === void 0) {
  10428. forceClamped = false;
  10429. }
  10430. var bytes = this.getBytes(length, forceClamped);
  10431. this.pos -= bytes.length;
  10432. return bytes;
  10433. };
  10434. Stream2.prototype.skip = function(n) {
  10435. if (!n) {
  10436. n = 1;
  10437. }
  10438. this.pos += n;
  10439. };
  10440. Stream2.prototype.reset = function() {
  10441. this.pos = this.start;
  10442. };
  10443. Stream2.prototype.moveStart = function() {
  10444. this.start = this.pos;
  10445. };
  10446. Stream2.prototype.makeSubStream = function(start, length) {
  10447. return new Stream2(this.bytes, start, length);
  10448. };
  10449. Stream2.prototype.decode = function() {
  10450. return this.bytes;
  10451. };
  10452. return Stream2;
  10453. }()
  10454. );
  10455. var Stream_default = Stream;
  10456. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/streams/DecodeStream.js
  10457. var emptyBuffer = new Uint8Array(0);
  10458. var DecodeStream = (
  10459. /** @class */
  10460. function() {
  10461. function DecodeStream2(maybeMinBufferLength) {
  10462. this.pos = 0;
  10463. this.bufferLength = 0;
  10464. this.eof = false;
  10465. this.buffer = emptyBuffer;
  10466. this.minBufferLength = 512;
  10467. if (maybeMinBufferLength) {
  10468. while (this.minBufferLength < maybeMinBufferLength) {
  10469. this.minBufferLength *= 2;
  10470. }
  10471. }
  10472. }
  10473. Object.defineProperty(DecodeStream2.prototype, "isEmpty", {
  10474. get: function() {
  10475. while (!this.eof && this.bufferLength === 0) {
  10476. this.readBlock();
  10477. }
  10478. return this.bufferLength === 0;
  10479. },
  10480. enumerable: false,
  10481. configurable: true
  10482. });
  10483. DecodeStream2.prototype.getByte = function() {
  10484. var pos = this.pos;
  10485. while (this.bufferLength <= pos) {
  10486. if (this.eof) {
  10487. return -1;
  10488. }
  10489. this.readBlock();
  10490. }
  10491. return this.buffer[this.pos++];
  10492. };
  10493. DecodeStream2.prototype.getUint16 = function() {
  10494. var b0 = this.getByte();
  10495. var b1 = this.getByte();
  10496. if (b0 === -1 || b1 === -1) {
  10497. return -1;
  10498. }
  10499. return (b0 << 8) + b1;
  10500. };
  10501. DecodeStream2.prototype.getInt32 = function() {
  10502. var b0 = this.getByte();
  10503. var b1 = this.getByte();
  10504. var b2 = this.getByte();
  10505. var b3 = this.getByte();
  10506. return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3;
  10507. };
  10508. DecodeStream2.prototype.getBytes = function(length, forceClamped) {
  10509. if (forceClamped === void 0) {
  10510. forceClamped = false;
  10511. }
  10512. var end;
  10513. var pos = this.pos;
  10514. if (length) {
  10515. this.ensureBuffer(pos + length);
  10516. end = pos + length;
  10517. while (!this.eof && this.bufferLength < end) {
  10518. this.readBlock();
  10519. }
  10520. var bufEnd = this.bufferLength;
  10521. if (end > bufEnd) {
  10522. end = bufEnd;
  10523. }
  10524. } else {
  10525. while (!this.eof) {
  10526. this.readBlock();
  10527. }
  10528. end = this.bufferLength;
  10529. }
  10530. this.pos = end;
  10531. var subarray = this.buffer.subarray(pos, end);
  10532. return forceClamped && !(subarray instanceof Uint8ClampedArray) ? new Uint8ClampedArray(subarray) : subarray;
  10533. };
  10534. DecodeStream2.prototype.peekByte = function() {
  10535. var peekedByte = this.getByte();
  10536. this.pos--;
  10537. return peekedByte;
  10538. };
  10539. DecodeStream2.prototype.peekBytes = function(length, forceClamped) {
  10540. if (forceClamped === void 0) {
  10541. forceClamped = false;
  10542. }
  10543. var bytes = this.getBytes(length, forceClamped);
  10544. this.pos -= bytes.length;
  10545. return bytes;
  10546. };
  10547. DecodeStream2.prototype.skip = function(n) {
  10548. if (!n) {
  10549. n = 1;
  10550. }
  10551. this.pos += n;
  10552. };
  10553. DecodeStream2.prototype.reset = function() {
  10554. this.pos = 0;
  10555. };
  10556. DecodeStream2.prototype.makeSubStream = function(start, length) {
  10557. var end = start + length;
  10558. while (this.bufferLength <= end && !this.eof) {
  10559. this.readBlock();
  10560. }
  10561. return new Stream_default(
  10562. this.buffer,
  10563. start,
  10564. length
  10565. /* dict */
  10566. );
  10567. };
  10568. DecodeStream2.prototype.decode = function() {
  10569. while (!this.eof)
  10570. this.readBlock();
  10571. return this.buffer.subarray(0, this.bufferLength);
  10572. };
  10573. DecodeStream2.prototype.readBlock = function() {
  10574. throw new MethodNotImplementedError(this.constructor.name, "readBlock");
  10575. };
  10576. DecodeStream2.prototype.ensureBuffer = function(requested) {
  10577. var buffer = this.buffer;
  10578. if (requested <= buffer.byteLength) {
  10579. return buffer;
  10580. }
  10581. var size = this.minBufferLength;
  10582. while (size < requested) {
  10583. size *= 2;
  10584. }
  10585. var buffer2 = new Uint8Array(size);
  10586. buffer2.set(buffer);
  10587. return this.buffer = buffer2;
  10588. };
  10589. return DecodeStream2;
  10590. }()
  10591. );
  10592. var DecodeStream_default = DecodeStream;
  10593. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/streams/Ascii85Stream.js
  10594. var isSpace = function(ch) {
  10595. return ch === 32 || ch === 9 || ch === 13 || ch === 10;
  10596. };
  10597. var Ascii85Stream = (
  10598. /** @class */
  10599. function(_super) {
  10600. __extends(Ascii85Stream2, _super);
  10601. function Ascii85Stream2(stream2, maybeLength) {
  10602. var _this = _super.call(this, maybeLength) || this;
  10603. _this.stream = stream2;
  10604. _this.input = new Uint8Array(5);
  10605. if (maybeLength) {
  10606. maybeLength = 0.8 * maybeLength;
  10607. }
  10608. return _this;
  10609. }
  10610. Ascii85Stream2.prototype.readBlock = function() {
  10611. var TILDA_CHAR = 126;
  10612. var Z_LOWER_CHAR = 122;
  10613. var EOF = -1;
  10614. var stream2 = this.stream;
  10615. var c = stream2.getByte();
  10616. while (isSpace(c)) {
  10617. c = stream2.getByte();
  10618. }
  10619. if (c === EOF || c === TILDA_CHAR) {
  10620. this.eof = true;
  10621. return;
  10622. }
  10623. var bufferLength = this.bufferLength;
  10624. var buffer;
  10625. var i;
  10626. if (c === Z_LOWER_CHAR) {
  10627. buffer = this.ensureBuffer(bufferLength + 4);
  10628. for (i = 0; i < 4; ++i) {
  10629. buffer[bufferLength + i] = 0;
  10630. }
  10631. this.bufferLength += 4;
  10632. } else {
  10633. var input = this.input;
  10634. input[0] = c;
  10635. for (i = 1; i < 5; ++i) {
  10636. c = stream2.getByte();
  10637. while (isSpace(c)) {
  10638. c = stream2.getByte();
  10639. }
  10640. input[i] = c;
  10641. if (c === EOF || c === TILDA_CHAR) {
  10642. break;
  10643. }
  10644. }
  10645. buffer = this.ensureBuffer(bufferLength + i - 1);
  10646. this.bufferLength += i - 1;
  10647. if (i < 5) {
  10648. for (; i < 5; ++i) {
  10649. input[i] = 33 + 84;
  10650. }
  10651. this.eof = true;
  10652. }
  10653. var t = 0;
  10654. for (i = 0; i < 5; ++i) {
  10655. t = t * 85 + (input[i] - 33);
  10656. }
  10657. for (i = 3; i >= 0; --i) {
  10658. buffer[bufferLength + i] = t & 255;
  10659. t >>= 8;
  10660. }
  10661. }
  10662. };
  10663. return Ascii85Stream2;
  10664. }(DecodeStream_default)
  10665. );
  10666. var Ascii85Stream_default = Ascii85Stream;
  10667. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/streams/AsciiHexStream.js
  10668. var AsciiHexStream = (
  10669. /** @class */
  10670. function(_super) {
  10671. __extends(AsciiHexStream2, _super);
  10672. function AsciiHexStream2(stream2, maybeLength) {
  10673. var _this = _super.call(this, maybeLength) || this;
  10674. _this.stream = stream2;
  10675. _this.firstDigit = -1;
  10676. if (maybeLength) {
  10677. maybeLength = 0.5 * maybeLength;
  10678. }
  10679. return _this;
  10680. }
  10681. AsciiHexStream2.prototype.readBlock = function() {
  10682. var UPSTREAM_BLOCK_SIZE = 8e3;
  10683. var bytes = this.stream.getBytes(UPSTREAM_BLOCK_SIZE);
  10684. if (!bytes.length) {
  10685. this.eof = true;
  10686. return;
  10687. }
  10688. var maxDecodeLength = bytes.length + 1 >> 1;
  10689. var buffer = this.ensureBuffer(this.bufferLength + maxDecodeLength);
  10690. var bufferLength = this.bufferLength;
  10691. var firstDigit = this.firstDigit;
  10692. for (var i = 0, ii = bytes.length; i < ii; i++) {
  10693. var ch = bytes[i];
  10694. var digit = void 0;
  10695. if (ch >= 48 && ch <= 57) {
  10696. digit = ch & 15;
  10697. } else if (ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102) {
  10698. digit = (ch & 15) + 9;
  10699. } else if (ch === 62) {
  10700. this.eof = true;
  10701. break;
  10702. } else {
  10703. continue;
  10704. }
  10705. if (firstDigit < 0) {
  10706. firstDigit = digit;
  10707. } else {
  10708. buffer[bufferLength++] = firstDigit << 4 | digit;
  10709. firstDigit = -1;
  10710. }
  10711. }
  10712. if (firstDigit >= 0 && this.eof) {
  10713. buffer[bufferLength++] = firstDigit << 4;
  10714. firstDigit = -1;
  10715. }
  10716. this.firstDigit = firstDigit;
  10717. this.bufferLength = bufferLength;
  10718. };
  10719. return AsciiHexStream2;
  10720. }(DecodeStream_default)
  10721. );
  10722. var AsciiHexStream_default = AsciiHexStream;
  10723. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/streams/FlateStream.js
  10724. var codeLenCodeMap = new Int32Array([
  10725. 16,
  10726. 17,
  10727. 18,
  10728. 0,
  10729. 8,
  10730. 7,
  10731. 9,
  10732. 6,
  10733. 10,
  10734. 5,
  10735. 11,
  10736. 4,
  10737. 12,
  10738. 3,
  10739. 13,
  10740. 2,
  10741. 14,
  10742. 1,
  10743. 15
  10744. ]);
  10745. var lengthDecode = new Int32Array([
  10746. 3,
  10747. 4,
  10748. 5,
  10749. 6,
  10750. 7,
  10751. 8,
  10752. 9,
  10753. 10,
  10754. 65547,
  10755. 65549,
  10756. 65551,
  10757. 65553,
  10758. 131091,
  10759. 131095,
  10760. 131099,
  10761. 131103,
  10762. 196643,
  10763. 196651,
  10764. 196659,
  10765. 196667,
  10766. 262211,
  10767. 262227,
  10768. 262243,
  10769. 262259,
  10770. 327811,
  10771. 327843,
  10772. 327875,
  10773. 327907,
  10774. 258,
  10775. 258,
  10776. 258
  10777. ]);
  10778. var distDecode = new Int32Array([
  10779. 1,
  10780. 2,
  10781. 3,
  10782. 4,
  10783. 65541,
  10784. 65543,
  10785. 131081,
  10786. 131085,
  10787. 196625,
  10788. 196633,
  10789. 262177,
  10790. 262193,
  10791. 327745,
  10792. 327777,
  10793. 393345,
  10794. 393409,
  10795. 459009,
  10796. 459137,
  10797. 524801,
  10798. 525057,
  10799. 590849,
  10800. 591361,
  10801. 657409,
  10802. 658433,
  10803. 724993,
  10804. 727041,
  10805. 794625,
  10806. 798721,
  10807. 868353,
  10808. 876545
  10809. ]);
  10810. var fixedLitCodeTab = [new Int32Array([
  10811. 459008,
  10812. 524368,
  10813. 524304,
  10814. 524568,
  10815. 459024,
  10816. 524400,
  10817. 524336,
  10818. 590016,
  10819. 459016,
  10820. 524384,
  10821. 524320,
  10822. 589984,
  10823. 524288,
  10824. 524416,
  10825. 524352,
  10826. 590048,
  10827. 459012,
  10828. 524376,
  10829. 524312,
  10830. 589968,
  10831. 459028,
  10832. 524408,
  10833. 524344,
  10834. 590032,
  10835. 459020,
  10836. 524392,
  10837. 524328,
  10838. 59e4,
  10839. 524296,
  10840. 524424,
  10841. 524360,
  10842. 590064,
  10843. 459010,
  10844. 524372,
  10845. 524308,
  10846. 524572,
  10847. 459026,
  10848. 524404,
  10849. 524340,
  10850. 590024,
  10851. 459018,
  10852. 524388,
  10853. 524324,
  10854. 589992,
  10855. 524292,
  10856. 524420,
  10857. 524356,
  10858. 590056,
  10859. 459014,
  10860. 524380,
  10861. 524316,
  10862. 589976,
  10863. 459030,
  10864. 524412,
  10865. 524348,
  10866. 590040,
  10867. 459022,
  10868. 524396,
  10869. 524332,
  10870. 590008,
  10871. 524300,
  10872. 524428,
  10873. 524364,
  10874. 590072,
  10875. 459009,
  10876. 524370,
  10877. 524306,
  10878. 524570,
  10879. 459025,
  10880. 524402,
  10881. 524338,
  10882. 590020,
  10883. 459017,
  10884. 524386,
  10885. 524322,
  10886. 589988,
  10887. 524290,
  10888. 524418,
  10889. 524354,
  10890. 590052,
  10891. 459013,
  10892. 524378,
  10893. 524314,
  10894. 589972,
  10895. 459029,
  10896. 524410,
  10897. 524346,
  10898. 590036,
  10899. 459021,
  10900. 524394,
  10901. 524330,
  10902. 590004,
  10903. 524298,
  10904. 524426,
  10905. 524362,
  10906. 590068,
  10907. 459011,
  10908. 524374,
  10909. 524310,
  10910. 524574,
  10911. 459027,
  10912. 524406,
  10913. 524342,
  10914. 590028,
  10915. 459019,
  10916. 524390,
  10917. 524326,
  10918. 589996,
  10919. 524294,
  10920. 524422,
  10921. 524358,
  10922. 590060,
  10923. 459015,
  10924. 524382,
  10925. 524318,
  10926. 589980,
  10927. 459031,
  10928. 524414,
  10929. 524350,
  10930. 590044,
  10931. 459023,
  10932. 524398,
  10933. 524334,
  10934. 590012,
  10935. 524302,
  10936. 524430,
  10937. 524366,
  10938. 590076,
  10939. 459008,
  10940. 524369,
  10941. 524305,
  10942. 524569,
  10943. 459024,
  10944. 524401,
  10945. 524337,
  10946. 590018,
  10947. 459016,
  10948. 524385,
  10949. 524321,
  10950. 589986,
  10951. 524289,
  10952. 524417,
  10953. 524353,
  10954. 590050,
  10955. 459012,
  10956. 524377,
  10957. 524313,
  10958. 589970,
  10959. 459028,
  10960. 524409,
  10961. 524345,
  10962. 590034,
  10963. 459020,
  10964. 524393,
  10965. 524329,
  10966. 590002,
  10967. 524297,
  10968. 524425,
  10969. 524361,
  10970. 590066,
  10971. 459010,
  10972. 524373,
  10973. 524309,
  10974. 524573,
  10975. 459026,
  10976. 524405,
  10977. 524341,
  10978. 590026,
  10979. 459018,
  10980. 524389,
  10981. 524325,
  10982. 589994,
  10983. 524293,
  10984. 524421,
  10985. 524357,
  10986. 590058,
  10987. 459014,
  10988. 524381,
  10989. 524317,
  10990. 589978,
  10991. 459030,
  10992. 524413,
  10993. 524349,
  10994. 590042,
  10995. 459022,
  10996. 524397,
  10997. 524333,
  10998. 590010,
  10999. 524301,
  11000. 524429,
  11001. 524365,
  11002. 590074,
  11003. 459009,
  11004. 524371,
  11005. 524307,
  11006. 524571,
  11007. 459025,
  11008. 524403,
  11009. 524339,
  11010. 590022,
  11011. 459017,
  11012. 524387,
  11013. 524323,
  11014. 589990,
  11015. 524291,
  11016. 524419,
  11017. 524355,
  11018. 590054,
  11019. 459013,
  11020. 524379,
  11021. 524315,
  11022. 589974,
  11023. 459029,
  11024. 524411,
  11025. 524347,
  11026. 590038,
  11027. 459021,
  11028. 524395,
  11029. 524331,
  11030. 590006,
  11031. 524299,
  11032. 524427,
  11033. 524363,
  11034. 590070,
  11035. 459011,
  11036. 524375,
  11037. 524311,
  11038. 524575,
  11039. 459027,
  11040. 524407,
  11041. 524343,
  11042. 590030,
  11043. 459019,
  11044. 524391,
  11045. 524327,
  11046. 589998,
  11047. 524295,
  11048. 524423,
  11049. 524359,
  11050. 590062,
  11051. 459015,
  11052. 524383,
  11053. 524319,
  11054. 589982,
  11055. 459031,
  11056. 524415,
  11057. 524351,
  11058. 590046,
  11059. 459023,
  11060. 524399,
  11061. 524335,
  11062. 590014,
  11063. 524303,
  11064. 524431,
  11065. 524367,
  11066. 590078,
  11067. 459008,
  11068. 524368,
  11069. 524304,
  11070. 524568,
  11071. 459024,
  11072. 524400,
  11073. 524336,
  11074. 590017,
  11075. 459016,
  11076. 524384,
  11077. 524320,
  11078. 589985,
  11079. 524288,
  11080. 524416,
  11081. 524352,
  11082. 590049,
  11083. 459012,
  11084. 524376,
  11085. 524312,
  11086. 589969,
  11087. 459028,
  11088. 524408,
  11089. 524344,
  11090. 590033,
  11091. 459020,
  11092. 524392,
  11093. 524328,
  11094. 590001,
  11095. 524296,
  11096. 524424,
  11097. 524360,
  11098. 590065,
  11099. 459010,
  11100. 524372,
  11101. 524308,
  11102. 524572,
  11103. 459026,
  11104. 524404,
  11105. 524340,
  11106. 590025,
  11107. 459018,
  11108. 524388,
  11109. 524324,
  11110. 589993,
  11111. 524292,
  11112. 524420,
  11113. 524356,
  11114. 590057,
  11115. 459014,
  11116. 524380,
  11117. 524316,
  11118. 589977,
  11119. 459030,
  11120. 524412,
  11121. 524348,
  11122. 590041,
  11123. 459022,
  11124. 524396,
  11125. 524332,
  11126. 590009,
  11127. 524300,
  11128. 524428,
  11129. 524364,
  11130. 590073,
  11131. 459009,
  11132. 524370,
  11133. 524306,
  11134. 524570,
  11135. 459025,
  11136. 524402,
  11137. 524338,
  11138. 590021,
  11139. 459017,
  11140. 524386,
  11141. 524322,
  11142. 589989,
  11143. 524290,
  11144. 524418,
  11145. 524354,
  11146. 590053,
  11147. 459013,
  11148. 524378,
  11149. 524314,
  11150. 589973,
  11151. 459029,
  11152. 524410,
  11153. 524346,
  11154. 590037,
  11155. 459021,
  11156. 524394,
  11157. 524330,
  11158. 590005,
  11159. 524298,
  11160. 524426,
  11161. 524362,
  11162. 590069,
  11163. 459011,
  11164. 524374,
  11165. 524310,
  11166. 524574,
  11167. 459027,
  11168. 524406,
  11169. 524342,
  11170. 590029,
  11171. 459019,
  11172. 524390,
  11173. 524326,
  11174. 589997,
  11175. 524294,
  11176. 524422,
  11177. 524358,
  11178. 590061,
  11179. 459015,
  11180. 524382,
  11181. 524318,
  11182. 589981,
  11183. 459031,
  11184. 524414,
  11185. 524350,
  11186. 590045,
  11187. 459023,
  11188. 524398,
  11189. 524334,
  11190. 590013,
  11191. 524302,
  11192. 524430,
  11193. 524366,
  11194. 590077,
  11195. 459008,
  11196. 524369,
  11197. 524305,
  11198. 524569,
  11199. 459024,
  11200. 524401,
  11201. 524337,
  11202. 590019,
  11203. 459016,
  11204. 524385,
  11205. 524321,
  11206. 589987,
  11207. 524289,
  11208. 524417,
  11209. 524353,
  11210. 590051,
  11211. 459012,
  11212. 524377,
  11213. 524313,
  11214. 589971,
  11215. 459028,
  11216. 524409,
  11217. 524345,
  11218. 590035,
  11219. 459020,
  11220. 524393,
  11221. 524329,
  11222. 590003,
  11223. 524297,
  11224. 524425,
  11225. 524361,
  11226. 590067,
  11227. 459010,
  11228. 524373,
  11229. 524309,
  11230. 524573,
  11231. 459026,
  11232. 524405,
  11233. 524341,
  11234. 590027,
  11235. 459018,
  11236. 524389,
  11237. 524325,
  11238. 589995,
  11239. 524293,
  11240. 524421,
  11241. 524357,
  11242. 590059,
  11243. 459014,
  11244. 524381,
  11245. 524317,
  11246. 589979,
  11247. 459030,
  11248. 524413,
  11249. 524349,
  11250. 590043,
  11251. 459022,
  11252. 524397,
  11253. 524333,
  11254. 590011,
  11255. 524301,
  11256. 524429,
  11257. 524365,
  11258. 590075,
  11259. 459009,
  11260. 524371,
  11261. 524307,
  11262. 524571,
  11263. 459025,
  11264. 524403,
  11265. 524339,
  11266. 590023,
  11267. 459017,
  11268. 524387,
  11269. 524323,
  11270. 589991,
  11271. 524291,
  11272. 524419,
  11273. 524355,
  11274. 590055,
  11275. 459013,
  11276. 524379,
  11277. 524315,
  11278. 589975,
  11279. 459029,
  11280. 524411,
  11281. 524347,
  11282. 590039,
  11283. 459021,
  11284. 524395,
  11285. 524331,
  11286. 590007,
  11287. 524299,
  11288. 524427,
  11289. 524363,
  11290. 590071,
  11291. 459011,
  11292. 524375,
  11293. 524311,
  11294. 524575,
  11295. 459027,
  11296. 524407,
  11297. 524343,
  11298. 590031,
  11299. 459019,
  11300. 524391,
  11301. 524327,
  11302. 589999,
  11303. 524295,
  11304. 524423,
  11305. 524359,
  11306. 590063,
  11307. 459015,
  11308. 524383,
  11309. 524319,
  11310. 589983,
  11311. 459031,
  11312. 524415,
  11313. 524351,
  11314. 590047,
  11315. 459023,
  11316. 524399,
  11317. 524335,
  11318. 590015,
  11319. 524303,
  11320. 524431,
  11321. 524367,
  11322. 590079
  11323. ]), 9];
  11324. var fixedDistCodeTab = [new Int32Array([
  11325. 327680,
  11326. 327696,
  11327. 327688,
  11328. 327704,
  11329. 327684,
  11330. 327700,
  11331. 327692,
  11332. 327708,
  11333. 327682,
  11334. 327698,
  11335. 327690,
  11336. 327706,
  11337. 327686,
  11338. 327702,
  11339. 327694,
  11340. 0,
  11341. 327681,
  11342. 327697,
  11343. 327689,
  11344. 327705,
  11345. 327685,
  11346. 327701,
  11347. 327693,
  11348. 327709,
  11349. 327683,
  11350. 327699,
  11351. 327691,
  11352. 327707,
  11353. 327687,
  11354. 327703,
  11355. 327695,
  11356. 0
  11357. ]), 5];
  11358. var FlateStream = (
  11359. /** @class */
  11360. function(_super) {
  11361. __extends(FlateStream2, _super);
  11362. function FlateStream2(stream2, maybeLength) {
  11363. var _this = _super.call(this, maybeLength) || this;
  11364. _this.stream = stream2;
  11365. var cmf = stream2.getByte();
  11366. var flg = stream2.getByte();
  11367. if (cmf === -1 || flg === -1) {
  11368. throw new Error("Invalid header in flate stream: " + cmf + ", " + flg);
  11369. }
  11370. if ((cmf & 15) !== 8) {
  11371. throw new Error("Unknown compression method in flate stream: " + cmf + ", " + flg);
  11372. }
  11373. if (((cmf << 8) + flg) % 31 !== 0) {
  11374. throw new Error("Bad FCHECK in flate stream: " + cmf + ", " + flg);
  11375. }
  11376. if (flg & 32) {
  11377. throw new Error("FDICT bit set in flate stream: " + cmf + ", " + flg);
  11378. }
  11379. _this.codeSize = 0;
  11380. _this.codeBuf = 0;
  11381. return _this;
  11382. }
  11383. FlateStream2.prototype.readBlock = function() {
  11384. var buffer;
  11385. var len;
  11386. var str = this.stream;
  11387. var hdr = this.getBits(3);
  11388. if (hdr & 1) {
  11389. this.eof = true;
  11390. }
  11391. hdr >>= 1;
  11392. if (hdr === 0) {
  11393. var b = void 0;
  11394. if ((b = str.getByte()) === -1) {
  11395. throw new Error("Bad block header in flate stream");
  11396. }
  11397. var blockLen = b;
  11398. if ((b = str.getByte()) === -1) {
  11399. throw new Error("Bad block header in flate stream");
  11400. }
  11401. blockLen |= b << 8;
  11402. if ((b = str.getByte()) === -1) {
  11403. throw new Error("Bad block header in flate stream");
  11404. }
  11405. var check = b;
  11406. if ((b = str.getByte()) === -1) {
  11407. throw new Error("Bad block header in flate stream");
  11408. }
  11409. check |= b << 8;
  11410. if (check !== (~blockLen & 65535) && (blockLen !== 0 || check !== 0)) {
  11411. throw new Error("Bad uncompressed block length in flate stream");
  11412. }
  11413. this.codeBuf = 0;
  11414. this.codeSize = 0;
  11415. var bufferLength = this.bufferLength;
  11416. buffer = this.ensureBuffer(bufferLength + blockLen);
  11417. var end = bufferLength + blockLen;
  11418. this.bufferLength = end;
  11419. if (blockLen === 0) {
  11420. if (str.peekByte() === -1) {
  11421. this.eof = true;
  11422. }
  11423. } else {
  11424. for (var n = bufferLength; n < end; ++n) {
  11425. if ((b = str.getByte()) === -1) {
  11426. this.eof = true;
  11427. break;
  11428. }
  11429. buffer[n] = b;
  11430. }
  11431. }
  11432. return;
  11433. }
  11434. var litCodeTable;
  11435. var distCodeTable;
  11436. if (hdr === 1) {
  11437. litCodeTable = fixedLitCodeTab;
  11438. distCodeTable = fixedDistCodeTab;
  11439. } else if (hdr === 2) {
  11440. var numLitCodes = this.getBits(5) + 257;
  11441. var numDistCodes = this.getBits(5) + 1;
  11442. var numCodeLenCodes = this.getBits(4) + 4;
  11443. var codeLenCodeLengths = new Uint8Array(codeLenCodeMap.length);
  11444. var i = void 0;
  11445. for (i = 0; i < numCodeLenCodes; ++i) {
  11446. codeLenCodeLengths[codeLenCodeMap[i]] = this.getBits(3);
  11447. }
  11448. var codeLenCodeTab = this.generateHuffmanTable(codeLenCodeLengths);
  11449. len = 0;
  11450. i = 0;
  11451. var codes = numLitCodes + numDistCodes;
  11452. var codeLengths = new Uint8Array(codes);
  11453. var bitsLength = void 0;
  11454. var bitsOffset = void 0;
  11455. var what = void 0;
  11456. while (i < codes) {
  11457. var code = this.getCode(codeLenCodeTab);
  11458. if (code === 16) {
  11459. bitsLength = 2;
  11460. bitsOffset = 3;
  11461. what = len;
  11462. } else if (code === 17) {
  11463. bitsLength = 3;
  11464. bitsOffset = 3;
  11465. what = len = 0;
  11466. } else if (code === 18) {
  11467. bitsLength = 7;
  11468. bitsOffset = 11;
  11469. what = len = 0;
  11470. } else {
  11471. codeLengths[i++] = len = code;
  11472. continue;
  11473. }
  11474. var repeatLength = this.getBits(bitsLength) + bitsOffset;
  11475. while (repeatLength-- > 0) {
  11476. codeLengths[i++] = what;
  11477. }
  11478. }
  11479. litCodeTable = this.generateHuffmanTable(codeLengths.subarray(0, numLitCodes));
  11480. distCodeTable = this.generateHuffmanTable(codeLengths.subarray(numLitCodes, codes));
  11481. } else {
  11482. throw new Error("Unknown block type in flate stream");
  11483. }
  11484. buffer = this.buffer;
  11485. var limit = buffer ? buffer.length : 0;
  11486. var pos = this.bufferLength;
  11487. while (true) {
  11488. var code1 = this.getCode(litCodeTable);
  11489. if (code1 < 256) {
  11490. if (pos + 1 >= limit) {
  11491. buffer = this.ensureBuffer(pos + 1);
  11492. limit = buffer.length;
  11493. }
  11494. buffer[pos++] = code1;
  11495. continue;
  11496. }
  11497. if (code1 === 256) {
  11498. this.bufferLength = pos;
  11499. return;
  11500. }
  11501. code1 -= 257;
  11502. code1 = lengthDecode[code1];
  11503. var code2 = code1 >> 16;
  11504. if (code2 > 0) {
  11505. code2 = this.getBits(code2);
  11506. }
  11507. len = (code1 & 65535) + code2;
  11508. code1 = this.getCode(distCodeTable);
  11509. code1 = distDecode[code1];
  11510. code2 = code1 >> 16;
  11511. if (code2 > 0) {
  11512. code2 = this.getBits(code2);
  11513. }
  11514. var dist = (code1 & 65535) + code2;
  11515. if (pos + len >= limit) {
  11516. buffer = this.ensureBuffer(pos + len);
  11517. limit = buffer.length;
  11518. }
  11519. for (var k = 0; k < len; ++k, ++pos) {
  11520. buffer[pos] = buffer[pos - dist];
  11521. }
  11522. }
  11523. };
  11524. FlateStream2.prototype.getBits = function(bits) {
  11525. var str = this.stream;
  11526. var codeSize = this.codeSize;
  11527. var codeBuf = this.codeBuf;
  11528. var b;
  11529. while (codeSize < bits) {
  11530. if ((b = str.getByte()) === -1) {
  11531. throw new Error("Bad encoding in flate stream");
  11532. }
  11533. codeBuf |= b << codeSize;
  11534. codeSize += 8;
  11535. }
  11536. b = codeBuf & (1 << bits) - 1;
  11537. this.codeBuf = codeBuf >> bits;
  11538. this.codeSize = codeSize -= bits;
  11539. return b;
  11540. };
  11541. FlateStream2.prototype.getCode = function(table) {
  11542. var str = this.stream;
  11543. var codes = table[0];
  11544. var maxLen = table[1];
  11545. var codeSize = this.codeSize;
  11546. var codeBuf = this.codeBuf;
  11547. var b;
  11548. while (codeSize < maxLen) {
  11549. if ((b = str.getByte()) === -1) {
  11550. break;
  11551. }
  11552. codeBuf |= b << codeSize;
  11553. codeSize += 8;
  11554. }
  11555. var code = codes[codeBuf & (1 << maxLen) - 1];
  11556. if (typeof codes === "number") {
  11557. console.log("FLATE:", code);
  11558. }
  11559. var codeLen = code >> 16;
  11560. var codeVal = code & 65535;
  11561. if (codeLen < 1 || codeSize < codeLen) {
  11562. throw new Error("Bad encoding in flate stream");
  11563. }
  11564. this.codeBuf = codeBuf >> codeLen;
  11565. this.codeSize = codeSize - codeLen;
  11566. return codeVal;
  11567. };
  11568. FlateStream2.prototype.generateHuffmanTable = function(lengths) {
  11569. var n = lengths.length;
  11570. var maxLen = 0;
  11571. var i;
  11572. for (i = 0; i < n; ++i) {
  11573. if (lengths[i] > maxLen) {
  11574. maxLen = lengths[i];
  11575. }
  11576. }
  11577. var size = 1 << maxLen;
  11578. var codes = new Int32Array(size);
  11579. for (var len = 1, code = 0, skip = 2; len <= maxLen; ++len, code <<= 1, skip <<= 1) {
  11580. for (var val = 0; val < n; ++val) {
  11581. if (lengths[val] === len) {
  11582. var code2 = 0;
  11583. var t = code;
  11584. for (i = 0; i < len; ++i) {
  11585. code2 = code2 << 1 | t & 1;
  11586. t >>= 1;
  11587. }
  11588. for (i = code2; i < size; i += skip) {
  11589. codes[i] = len << 16 | val;
  11590. }
  11591. ++code;
  11592. }
  11593. }
  11594. }
  11595. return [codes, maxLen];
  11596. };
  11597. return FlateStream2;
  11598. }(DecodeStream_default)
  11599. );
  11600. var FlateStream_default = FlateStream;
  11601. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/streams/LZWStream.js
  11602. var LZWStream = (
  11603. /** @class */
  11604. function(_super) {
  11605. __extends(LZWStream2, _super);
  11606. function LZWStream2(stream2, maybeLength, earlyChange) {
  11607. var _this = _super.call(this, maybeLength) || this;
  11608. _this.stream = stream2;
  11609. _this.cachedData = 0;
  11610. _this.bitsCached = 0;
  11611. var maxLzwDictionarySize = 4096;
  11612. var lzwState = {
  11613. earlyChange,
  11614. codeLength: 9,
  11615. nextCode: 258,
  11616. dictionaryValues: new Uint8Array(maxLzwDictionarySize),
  11617. dictionaryLengths: new Uint16Array(maxLzwDictionarySize),
  11618. dictionaryPrevCodes: new Uint16Array(maxLzwDictionarySize),
  11619. currentSequence: new Uint8Array(maxLzwDictionarySize),
  11620. currentSequenceLength: 0
  11621. };
  11622. for (var i = 0; i < 256; ++i) {
  11623. lzwState.dictionaryValues[i] = i;
  11624. lzwState.dictionaryLengths[i] = 1;
  11625. }
  11626. _this.lzwState = lzwState;
  11627. return _this;
  11628. }
  11629. LZWStream2.prototype.readBlock = function() {
  11630. var blockSize = 512;
  11631. var estimatedDecodedSize = blockSize * 2;
  11632. var decodedSizeDelta = blockSize;
  11633. var i;
  11634. var j;
  11635. var q;
  11636. var lzwState = this.lzwState;
  11637. if (!lzwState) {
  11638. return;
  11639. }
  11640. var earlyChange = lzwState.earlyChange;
  11641. var nextCode = lzwState.nextCode;
  11642. var dictionaryValues = lzwState.dictionaryValues;
  11643. var dictionaryLengths = lzwState.dictionaryLengths;
  11644. var dictionaryPrevCodes = lzwState.dictionaryPrevCodes;
  11645. var codeLength = lzwState.codeLength;
  11646. var prevCode = lzwState.prevCode;
  11647. var currentSequence = lzwState.currentSequence;
  11648. var currentSequenceLength = lzwState.currentSequenceLength;
  11649. var decodedLength = 0;
  11650. var currentBufferLength = this.bufferLength;
  11651. var buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize);
  11652. for (i = 0; i < blockSize; i++) {
  11653. var code = this.readBits(codeLength);
  11654. var hasPrev = currentSequenceLength > 0;
  11655. if (!code || code < 256) {
  11656. currentSequence[0] = code;
  11657. currentSequenceLength = 1;
  11658. } else if (code >= 258) {
  11659. if (code < nextCode) {
  11660. currentSequenceLength = dictionaryLengths[code];
  11661. for (j = currentSequenceLength - 1, q = code; j >= 0; j--) {
  11662. currentSequence[j] = dictionaryValues[q];
  11663. q = dictionaryPrevCodes[q];
  11664. }
  11665. } else {
  11666. currentSequence[currentSequenceLength++] = currentSequence[0];
  11667. }
  11668. } else if (code === 256) {
  11669. codeLength = 9;
  11670. nextCode = 258;
  11671. currentSequenceLength = 0;
  11672. continue;
  11673. } else {
  11674. this.eof = true;
  11675. delete this.lzwState;
  11676. break;
  11677. }
  11678. if (hasPrev) {
  11679. dictionaryPrevCodes[nextCode] = prevCode;
  11680. dictionaryLengths[nextCode] = dictionaryLengths[prevCode] + 1;
  11681. dictionaryValues[nextCode] = currentSequence[0];
  11682. nextCode++;
  11683. codeLength = nextCode + earlyChange & nextCode + earlyChange - 1 ? codeLength : Math.min(Math.log(nextCode + earlyChange) / 0.6931471805599453 + 1, 12) | 0;
  11684. }
  11685. prevCode = code;
  11686. decodedLength += currentSequenceLength;
  11687. if (estimatedDecodedSize < decodedLength) {
  11688. do {
  11689. estimatedDecodedSize += decodedSizeDelta;
  11690. } while (estimatedDecodedSize < decodedLength);
  11691. buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize);
  11692. }
  11693. for (j = 0; j < currentSequenceLength; j++) {
  11694. buffer[currentBufferLength++] = currentSequence[j];
  11695. }
  11696. }
  11697. lzwState.nextCode = nextCode;
  11698. lzwState.codeLength = codeLength;
  11699. lzwState.prevCode = prevCode;
  11700. lzwState.currentSequenceLength = currentSequenceLength;
  11701. this.bufferLength = currentBufferLength;
  11702. };
  11703. LZWStream2.prototype.readBits = function(n) {
  11704. var bitsCached = this.bitsCached;
  11705. var cachedData = this.cachedData;
  11706. while (bitsCached < n) {
  11707. var c = this.stream.getByte();
  11708. if (c === -1) {
  11709. this.eof = true;
  11710. return null;
  11711. }
  11712. cachedData = cachedData << 8 | c;
  11713. bitsCached += 8;
  11714. }
  11715. this.bitsCached = bitsCached -= n;
  11716. this.cachedData = cachedData;
  11717. return cachedData >>> bitsCached & (1 << n) - 1;
  11718. };
  11719. return LZWStream2;
  11720. }(DecodeStream_default)
  11721. );
  11722. var LZWStream_default = LZWStream;
  11723. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/streams/RunLengthStream.js
  11724. var RunLengthStream = (
  11725. /** @class */
  11726. function(_super) {
  11727. __extends(RunLengthStream2, _super);
  11728. function RunLengthStream2(stream2, maybeLength) {
  11729. var _this = _super.call(this, maybeLength) || this;
  11730. _this.stream = stream2;
  11731. return _this;
  11732. }
  11733. RunLengthStream2.prototype.readBlock = function() {
  11734. var repeatHeader = this.stream.getBytes(2);
  11735. if (!repeatHeader || repeatHeader.length < 2 || repeatHeader[0] === 128) {
  11736. this.eof = true;
  11737. return;
  11738. }
  11739. var buffer;
  11740. var bufferLength = this.bufferLength;
  11741. var n = repeatHeader[0];
  11742. if (n < 128) {
  11743. buffer = this.ensureBuffer(bufferLength + n + 1);
  11744. buffer[bufferLength++] = repeatHeader[1];
  11745. if (n > 0) {
  11746. var source = this.stream.getBytes(n);
  11747. buffer.set(source, bufferLength);
  11748. bufferLength += n;
  11749. }
  11750. } else {
  11751. n = 257 - n;
  11752. var b = repeatHeader[1];
  11753. buffer = this.ensureBuffer(bufferLength + n + 1);
  11754. for (var i = 0; i < n; i++) {
  11755. buffer[bufferLength++] = b;
  11756. }
  11757. }
  11758. this.bufferLength = bufferLength;
  11759. };
  11760. return RunLengthStream2;
  11761. }(DecodeStream_default)
  11762. );
  11763. var RunLengthStream_default = RunLengthStream;
  11764. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/streams/decode.js
  11765. var decodeStream = function(stream2, encoding, params) {
  11766. if (encoding === PDFName_default.of("FlateDecode")) {
  11767. return new FlateStream_default(stream2);
  11768. }
  11769. if (encoding === PDFName_default.of("LZWDecode")) {
  11770. var earlyChange = 1;
  11771. if (params instanceof PDFDict_default) {
  11772. var EarlyChange = params.lookup(PDFName_default.of("EarlyChange"));
  11773. if (EarlyChange instanceof PDFNumber_default) {
  11774. earlyChange = EarlyChange.asNumber();
  11775. }
  11776. }
  11777. return new LZWStream_default(stream2, void 0, earlyChange);
  11778. }
  11779. if (encoding === PDFName_default.of("ASCII85Decode")) {
  11780. return new Ascii85Stream_default(stream2);
  11781. }
  11782. if (encoding === PDFName_default.of("ASCIIHexDecode")) {
  11783. return new AsciiHexStream_default(stream2);
  11784. }
  11785. if (encoding === PDFName_default.of("RunLengthDecode")) {
  11786. return new RunLengthStream_default(stream2);
  11787. }
  11788. throw new UnsupportedEncodingError(encoding.asString());
  11789. };
  11790. var decodePDFRawStream = function(_a) {
  11791. var dict = _a.dict, contents = _a.contents;
  11792. var stream2 = new Stream_default(contents);
  11793. var Filter = dict.lookup(PDFName_default.of("Filter"));
  11794. var DecodeParms = dict.lookup(PDFName_default.of("DecodeParms"));
  11795. if (Filter instanceof PDFName_default) {
  11796. stream2 = decodeStream(stream2, Filter, DecodeParms);
  11797. } else if (Filter instanceof PDFArray_default) {
  11798. for (var idx = 0, len = Filter.size(); idx < len; idx++) {
  11799. stream2 = decodeStream(stream2, Filter.lookup(idx, PDFName_default), DecodeParms && DecodeParms.lookupMaybe(idx, PDFDict_default));
  11800. }
  11801. } else if (!!Filter) {
  11802. throw new UnexpectedObjectTypeError([PDFName_default, PDFArray_default], Filter);
  11803. }
  11804. return stream2;
  11805. };
  11806. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/embedders/PDFPageEmbedder.js
  11807. var fullPageBoundingBox = function(page) {
  11808. var mediaBox = page.MediaBox();
  11809. var width = mediaBox.lookup(2, PDFNumber_default).asNumber() - mediaBox.lookup(0, PDFNumber_default).asNumber();
  11810. var height = mediaBox.lookup(3, PDFNumber_default).asNumber() - mediaBox.lookup(1, PDFNumber_default).asNumber();
  11811. return { left: 0, bottom: 0, right: width, top: height };
  11812. };
  11813. var boundingBoxAdjustedMatrix = function(bb) {
  11814. return [1, 0, 0, 1, -bb.left, -bb.bottom];
  11815. };
  11816. var PDFPageEmbedder = (
  11817. /** @class */
  11818. function() {
  11819. function PDFPageEmbedder2(page, boundingBox, transformationMatrix) {
  11820. this.page = page;
  11821. var bb = boundingBox !== null && boundingBox !== void 0 ? boundingBox : fullPageBoundingBox(page);
  11822. this.width = bb.right - bb.left;
  11823. this.height = bb.top - bb.bottom;
  11824. this.boundingBox = bb;
  11825. this.transformationMatrix = transformationMatrix !== null && transformationMatrix !== void 0 ? transformationMatrix : boundingBoxAdjustedMatrix(bb);
  11826. }
  11827. PDFPageEmbedder2.for = function(page, boundingBox, transformationMatrix) {
  11828. return __awaiter(this, void 0, void 0, function() {
  11829. return __generator(this, function(_a) {
  11830. return [2, new PDFPageEmbedder2(page, boundingBox, transformationMatrix)];
  11831. });
  11832. });
  11833. };
  11834. PDFPageEmbedder2.prototype.embedIntoContext = function(context, ref) {
  11835. return __awaiter(this, void 0, void 0, function() {
  11836. var _a, Contents, Resources, decodedContents, _b, left, bottom, right, top, xObject;
  11837. return __generator(this, function(_c) {
  11838. _a = this.page.normalizedEntries(), Contents = _a.Contents, Resources = _a.Resources;
  11839. if (!Contents)
  11840. throw new MissingPageContentsEmbeddingError();
  11841. decodedContents = this.decodeContents(Contents);
  11842. _b = this.boundingBox, left = _b.left, bottom = _b.bottom, right = _b.right, top = _b.top;
  11843. xObject = context.flateStream(decodedContents, {
  11844. Type: "XObject",
  11845. Subtype: "Form",
  11846. FormType: 1,
  11847. BBox: [left, bottom, right, top],
  11848. Matrix: this.transformationMatrix,
  11849. Resources
  11850. });
  11851. if (ref) {
  11852. context.assign(ref, xObject);
  11853. return [2, ref];
  11854. } else {
  11855. return [2, context.register(xObject)];
  11856. }
  11857. return [
  11858. 2
  11859. /*return*/
  11860. ];
  11861. });
  11862. });
  11863. };
  11864. PDFPageEmbedder2.prototype.decodeContents = function(contents) {
  11865. var newline = Uint8Array.of(CharCodes_default.Newline);
  11866. var decodedContents = [];
  11867. for (var idx = 0, len = contents.size(); idx < len; idx++) {
  11868. var stream2 = contents.lookup(idx, PDFStream_default);
  11869. var content = void 0;
  11870. if (stream2 instanceof PDFRawStream_default) {
  11871. content = decodePDFRawStream(stream2).decode();
  11872. } else if (stream2 instanceof PDFContentStream_default) {
  11873. content = stream2.getUnencodedContents();
  11874. } else {
  11875. throw new UnrecognizedStreamTypeError(stream2);
  11876. }
  11877. decodedContents.push(content, newline);
  11878. }
  11879. return mergeIntoTypedArray.apply(void 0, decodedContents);
  11880. };
  11881. return PDFPageEmbedder2;
  11882. }()
  11883. );
  11884. var PDFPageEmbedder_default = PDFPageEmbedder;
  11885. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/interactive/ViewerPreferences.js
  11886. var asEnum = function(rawValue, enumType) {
  11887. if (rawValue === void 0)
  11888. return void 0;
  11889. return enumType[rawValue];
  11890. };
  11891. var NonFullScreenPageMode;
  11892. (function(NonFullScreenPageMode2) {
  11893. NonFullScreenPageMode2["UseNone"] = "UseNone";
  11894. NonFullScreenPageMode2["UseOutlines"] = "UseOutlines";
  11895. NonFullScreenPageMode2["UseThumbs"] = "UseThumbs";
  11896. NonFullScreenPageMode2["UseOC"] = "UseOC";
  11897. })(NonFullScreenPageMode || (NonFullScreenPageMode = {}));
  11898. var ReadingDirection;
  11899. (function(ReadingDirection2) {
  11900. ReadingDirection2["L2R"] = "L2R";
  11901. ReadingDirection2["R2L"] = "R2L";
  11902. })(ReadingDirection || (ReadingDirection = {}));
  11903. var PrintScaling;
  11904. (function(PrintScaling2) {
  11905. PrintScaling2["None"] = "None";
  11906. PrintScaling2["AppDefault"] = "AppDefault";
  11907. })(PrintScaling || (PrintScaling = {}));
  11908. var Duplex;
  11909. (function(Duplex2) {
  11910. Duplex2["Simplex"] = "Simplex";
  11911. Duplex2["DuplexFlipShortEdge"] = "DuplexFlipShortEdge";
  11912. Duplex2["DuplexFlipLongEdge"] = "DuplexFlipLongEdge";
  11913. })(Duplex || (Duplex = {}));
  11914. var ViewerPreferences = (
  11915. /** @class */
  11916. function() {
  11917. function ViewerPreferences2(dict) {
  11918. this.dict = dict;
  11919. }
  11920. ViewerPreferences2.prototype.lookupBool = function(key) {
  11921. var returnObj = this.dict.lookup(PDFName_default.of(key));
  11922. if (returnObj instanceof PDFBool_default)
  11923. return returnObj;
  11924. return void 0;
  11925. };
  11926. ViewerPreferences2.prototype.lookupName = function(key) {
  11927. var returnObj = this.dict.lookup(PDFName_default.of(key));
  11928. if (returnObj instanceof PDFName_default)
  11929. return returnObj;
  11930. return void 0;
  11931. };
  11932. ViewerPreferences2.prototype.HideToolbar = function() {
  11933. return this.lookupBool("HideToolbar");
  11934. };
  11935. ViewerPreferences2.prototype.HideMenubar = function() {
  11936. return this.lookupBool("HideMenubar");
  11937. };
  11938. ViewerPreferences2.prototype.HideWindowUI = function() {
  11939. return this.lookupBool("HideWindowUI");
  11940. };
  11941. ViewerPreferences2.prototype.FitWindow = function() {
  11942. return this.lookupBool("FitWindow");
  11943. };
  11944. ViewerPreferences2.prototype.CenterWindow = function() {
  11945. return this.lookupBool("CenterWindow");
  11946. };
  11947. ViewerPreferences2.prototype.DisplayDocTitle = function() {
  11948. return this.lookupBool("DisplayDocTitle");
  11949. };
  11950. ViewerPreferences2.prototype.NonFullScreenPageMode = function() {
  11951. return this.lookupName("NonFullScreenPageMode");
  11952. };
  11953. ViewerPreferences2.prototype.Direction = function() {
  11954. return this.lookupName("Direction");
  11955. };
  11956. ViewerPreferences2.prototype.PrintScaling = function() {
  11957. return this.lookupName("PrintScaling");
  11958. };
  11959. ViewerPreferences2.prototype.Duplex = function() {
  11960. return this.lookupName("Duplex");
  11961. };
  11962. ViewerPreferences2.prototype.PickTrayByPDFSize = function() {
  11963. return this.lookupBool("PickTrayByPDFSize");
  11964. };
  11965. ViewerPreferences2.prototype.PrintPageRange = function() {
  11966. var PrintPageRange = this.dict.lookup(PDFName_default.of("PrintPageRange"));
  11967. if (PrintPageRange instanceof PDFArray_default)
  11968. return PrintPageRange;
  11969. return void 0;
  11970. };
  11971. ViewerPreferences2.prototype.NumCopies = function() {
  11972. var NumCopies = this.dict.lookup(PDFName_default.of("NumCopies"));
  11973. if (NumCopies instanceof PDFNumber_default)
  11974. return NumCopies;
  11975. return void 0;
  11976. };
  11977. ViewerPreferences2.prototype.getHideToolbar = function() {
  11978. var _a, _b;
  11979. return (_b = (_a = this.HideToolbar()) === null || _a === void 0 ? void 0 : _a.asBoolean()) !== null && _b !== void 0 ? _b : false;
  11980. };
  11981. ViewerPreferences2.prototype.getHideMenubar = function() {
  11982. var _a, _b;
  11983. return (_b = (_a = this.HideMenubar()) === null || _a === void 0 ? void 0 : _a.asBoolean()) !== null && _b !== void 0 ? _b : false;
  11984. };
  11985. ViewerPreferences2.prototype.getHideWindowUI = function() {
  11986. var _a, _b;
  11987. return (_b = (_a = this.HideWindowUI()) === null || _a === void 0 ? void 0 : _a.asBoolean()) !== null && _b !== void 0 ? _b : false;
  11988. };
  11989. ViewerPreferences2.prototype.getFitWindow = function() {
  11990. var _a, _b;
  11991. return (_b = (_a = this.FitWindow()) === null || _a === void 0 ? void 0 : _a.asBoolean()) !== null && _b !== void 0 ? _b : false;
  11992. };
  11993. ViewerPreferences2.prototype.getCenterWindow = function() {
  11994. var _a, _b;
  11995. return (_b = (_a = this.CenterWindow()) === null || _a === void 0 ? void 0 : _a.asBoolean()) !== null && _b !== void 0 ? _b : false;
  11996. };
  11997. ViewerPreferences2.prototype.getDisplayDocTitle = function() {
  11998. var _a, _b;
  11999. return (_b = (_a = this.DisplayDocTitle()) === null || _a === void 0 ? void 0 : _a.asBoolean()) !== null && _b !== void 0 ? _b : false;
  12000. };
  12001. ViewerPreferences2.prototype.getNonFullScreenPageMode = function() {
  12002. var _a, _b;
  12003. var mode = (_a = this.NonFullScreenPageMode()) === null || _a === void 0 ? void 0 : _a.decodeText();
  12004. return (_b = asEnum(mode, NonFullScreenPageMode)) !== null && _b !== void 0 ? _b : NonFullScreenPageMode.UseNone;
  12005. };
  12006. ViewerPreferences2.prototype.getReadingDirection = function() {
  12007. var _a, _b;
  12008. var direction = (_a = this.Direction()) === null || _a === void 0 ? void 0 : _a.decodeText();
  12009. return (_b = asEnum(direction, ReadingDirection)) !== null && _b !== void 0 ? _b : ReadingDirection.L2R;
  12010. };
  12011. ViewerPreferences2.prototype.getPrintScaling = function() {
  12012. var _a, _b;
  12013. var scaling = (_a = this.PrintScaling()) === null || _a === void 0 ? void 0 : _a.decodeText();
  12014. return (_b = asEnum(scaling, PrintScaling)) !== null && _b !== void 0 ? _b : PrintScaling.AppDefault;
  12015. };
  12016. ViewerPreferences2.prototype.getDuplex = function() {
  12017. var _a;
  12018. var duplex = (_a = this.Duplex()) === null || _a === void 0 ? void 0 : _a.decodeText();
  12019. return asEnum(duplex, Duplex);
  12020. };
  12021. ViewerPreferences2.prototype.getPickTrayByPDFSize = function() {
  12022. var _a;
  12023. return (_a = this.PickTrayByPDFSize()) === null || _a === void 0 ? void 0 : _a.asBoolean();
  12024. };
  12025. ViewerPreferences2.prototype.getPrintPageRange = function() {
  12026. var rng = this.PrintPageRange();
  12027. if (!rng)
  12028. return [];
  12029. var pageRanges = [];
  12030. for (var i = 0; i < rng.size(); i += 2) {
  12031. var start = rng.lookup(i, PDFNumber_default).asNumber();
  12032. var end = rng.lookup(i + 1, PDFNumber_default).asNumber();
  12033. pageRanges.push({ start, end });
  12034. }
  12035. return pageRanges;
  12036. };
  12037. ViewerPreferences2.prototype.getNumCopies = function() {
  12038. var _a, _b;
  12039. return (_b = (_a = this.NumCopies()) === null || _a === void 0 ? void 0 : _a.asNumber()) !== null && _b !== void 0 ? _b : 1;
  12040. };
  12041. ViewerPreferences2.prototype.setHideToolbar = function(hideToolbar) {
  12042. var HideToolbar = this.dict.context.obj(hideToolbar);
  12043. this.dict.set(PDFName_default.of("HideToolbar"), HideToolbar);
  12044. };
  12045. ViewerPreferences2.prototype.setHideMenubar = function(hideMenubar) {
  12046. var HideMenubar = this.dict.context.obj(hideMenubar);
  12047. this.dict.set(PDFName_default.of("HideMenubar"), HideMenubar);
  12048. };
  12049. ViewerPreferences2.prototype.setHideWindowUI = function(hideWindowUI) {
  12050. var HideWindowUI = this.dict.context.obj(hideWindowUI);
  12051. this.dict.set(PDFName_default.of("HideWindowUI"), HideWindowUI);
  12052. };
  12053. ViewerPreferences2.prototype.setFitWindow = function(fitWindow) {
  12054. var FitWindow = this.dict.context.obj(fitWindow);
  12055. this.dict.set(PDFName_default.of("FitWindow"), FitWindow);
  12056. };
  12057. ViewerPreferences2.prototype.setCenterWindow = function(centerWindow) {
  12058. var CenterWindow = this.dict.context.obj(centerWindow);
  12059. this.dict.set(PDFName_default.of("CenterWindow"), CenterWindow);
  12060. };
  12061. ViewerPreferences2.prototype.setDisplayDocTitle = function(displayTitle) {
  12062. var DisplayDocTitle = this.dict.context.obj(displayTitle);
  12063. this.dict.set(PDFName_default.of("DisplayDocTitle"), DisplayDocTitle);
  12064. };
  12065. ViewerPreferences2.prototype.setNonFullScreenPageMode = function(nonFullScreenPageMode) {
  12066. assertIsOneOf(nonFullScreenPageMode, "nonFullScreenPageMode", NonFullScreenPageMode);
  12067. var mode = PDFName_default.of(nonFullScreenPageMode);
  12068. this.dict.set(PDFName_default.of("NonFullScreenPageMode"), mode);
  12069. };
  12070. ViewerPreferences2.prototype.setReadingDirection = function(readingDirection) {
  12071. assertIsOneOf(readingDirection, "readingDirection", ReadingDirection);
  12072. var direction = PDFName_default.of(readingDirection);
  12073. this.dict.set(PDFName_default.of("Direction"), direction);
  12074. };
  12075. ViewerPreferences2.prototype.setPrintScaling = function(printScaling) {
  12076. assertIsOneOf(printScaling, "printScaling", PrintScaling);
  12077. var scaling = PDFName_default.of(printScaling);
  12078. this.dict.set(PDFName_default.of("PrintScaling"), scaling);
  12079. };
  12080. ViewerPreferences2.prototype.setDuplex = function(duplex) {
  12081. assertIsOneOf(duplex, "duplex", Duplex);
  12082. var dup = PDFName_default.of(duplex);
  12083. this.dict.set(PDFName_default.of("Duplex"), dup);
  12084. };
  12085. ViewerPreferences2.prototype.setPickTrayByPDFSize = function(pickTrayByPDFSize) {
  12086. var PickTrayByPDFSize = this.dict.context.obj(pickTrayByPDFSize);
  12087. this.dict.set(PDFName_default.of("PickTrayByPDFSize"), PickTrayByPDFSize);
  12088. };
  12089. ViewerPreferences2.prototype.setPrintPageRange = function(printPageRange) {
  12090. if (!Array.isArray(printPageRange))
  12091. printPageRange = [printPageRange];
  12092. var flatRange = [];
  12093. for (var idx = 0, len = printPageRange.length; idx < len; idx++) {
  12094. flatRange.push(printPageRange[idx].start);
  12095. flatRange.push(printPageRange[idx].end);
  12096. }
  12097. assertEachIs(flatRange, "printPageRange", ["number"]);
  12098. var pageRanges = this.dict.context.obj(flatRange);
  12099. this.dict.set(PDFName_default.of("PrintPageRange"), pageRanges);
  12100. };
  12101. ViewerPreferences2.prototype.setNumCopies = function(numCopies) {
  12102. assertRange(numCopies, "numCopies", 1, Number.MAX_VALUE);
  12103. assertInteger(numCopies, "numCopies");
  12104. var NumCopies = this.dict.context.obj(numCopies);
  12105. this.dict.set(PDFName_default.of("NumCopies"), NumCopies);
  12106. };
  12107. ViewerPreferences2.fromDict = function(dict) {
  12108. return new ViewerPreferences2(dict);
  12109. };
  12110. ViewerPreferences2.create = function(context) {
  12111. var dict = context.obj({});
  12112. return new ViewerPreferences2(dict);
  12113. };
  12114. return ViewerPreferences2;
  12115. }()
  12116. );
  12117. var ViewerPreferences_default = ViewerPreferences;
  12118. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/acroform/PDFAcroField.js
  12119. var tfRegex = /\/([^\0\t\n\f\r\ ]+)[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]+Tf/;
  12120. var PDFAcroField = (
  12121. /** @class */
  12122. function() {
  12123. function PDFAcroField2(dict, ref) {
  12124. this.dict = dict;
  12125. this.ref = ref;
  12126. }
  12127. PDFAcroField2.prototype.T = function() {
  12128. return this.dict.lookupMaybe(PDFName_default.of("T"), PDFString_default, PDFHexString_default);
  12129. };
  12130. PDFAcroField2.prototype.Ff = function() {
  12131. var numberOrRef = this.getInheritableAttribute(PDFName_default.of("Ff"));
  12132. return this.dict.context.lookupMaybe(numberOrRef, PDFNumber_default);
  12133. };
  12134. PDFAcroField2.prototype.V = function() {
  12135. var valueOrRef = this.getInheritableAttribute(PDFName_default.of("V"));
  12136. return this.dict.context.lookup(valueOrRef);
  12137. };
  12138. PDFAcroField2.prototype.Kids = function() {
  12139. return this.dict.lookupMaybe(PDFName_default.of("Kids"), PDFArray_default);
  12140. };
  12141. PDFAcroField2.prototype.DA = function() {
  12142. var da = this.dict.lookup(PDFName_default.of("DA"));
  12143. if (da instanceof PDFString_default || da instanceof PDFHexString_default)
  12144. return da;
  12145. return void 0;
  12146. };
  12147. PDFAcroField2.prototype.setKids = function(kids) {
  12148. this.dict.set(PDFName_default.of("Kids"), this.dict.context.obj(kids));
  12149. };
  12150. PDFAcroField2.prototype.getParent = function() {
  12151. var parentRef = this.dict.get(PDFName_default.of("Parent"));
  12152. if (parentRef instanceof PDFRef_default) {
  12153. var parent_1 = this.dict.lookup(PDFName_default.of("Parent"), PDFDict_default);
  12154. return new PDFAcroField2(parent_1, parentRef);
  12155. }
  12156. return void 0;
  12157. };
  12158. PDFAcroField2.prototype.setParent = function(parent) {
  12159. if (!parent)
  12160. this.dict.delete(PDFName_default.of("Parent"));
  12161. else
  12162. this.dict.set(PDFName_default.of("Parent"), parent);
  12163. };
  12164. PDFAcroField2.prototype.getFullyQualifiedName = function() {
  12165. var parent = this.getParent();
  12166. if (!parent)
  12167. return this.getPartialName();
  12168. return parent.getFullyQualifiedName() + "." + this.getPartialName();
  12169. };
  12170. PDFAcroField2.prototype.getPartialName = function() {
  12171. var _a;
  12172. return (_a = this.T()) === null || _a === void 0 ? void 0 : _a.decodeText();
  12173. };
  12174. PDFAcroField2.prototype.setPartialName = function(partialName) {
  12175. if (!partialName)
  12176. this.dict.delete(PDFName_default.of("T"));
  12177. else
  12178. this.dict.set(PDFName_default.of("T"), PDFHexString_default.fromText(partialName));
  12179. };
  12180. PDFAcroField2.prototype.setDefaultAppearance = function(appearance) {
  12181. this.dict.set(PDFName_default.of("DA"), PDFString_default.of(appearance));
  12182. };
  12183. PDFAcroField2.prototype.getDefaultAppearance = function() {
  12184. var DA = this.DA();
  12185. if (DA instanceof PDFHexString_default) {
  12186. return DA.decodeText();
  12187. }
  12188. return DA === null || DA === void 0 ? void 0 : DA.asString();
  12189. };
  12190. PDFAcroField2.prototype.setFontSize = function(fontSize) {
  12191. var _a;
  12192. var name = (_a = this.getFullyQualifiedName()) !== null && _a !== void 0 ? _a : "";
  12193. var da = this.getDefaultAppearance();
  12194. if (!da)
  12195. throw new MissingDAEntryError(name);
  12196. var daMatch = findLastMatch(da, tfRegex);
  12197. if (!daMatch.match)
  12198. throw new MissingTfOperatorError(name);
  12199. var daStart = da.slice(0, daMatch.pos - daMatch.match[0].length);
  12200. var daEnd = daMatch.pos <= da.length ? da.slice(daMatch.pos) : "";
  12201. var fontName = daMatch.match[1];
  12202. var modifiedDa = daStart + " /" + fontName + " " + fontSize + " Tf " + daEnd;
  12203. this.setDefaultAppearance(modifiedDa);
  12204. };
  12205. PDFAcroField2.prototype.getFlags = function() {
  12206. var _a, _b;
  12207. return (_b = (_a = this.Ff()) === null || _a === void 0 ? void 0 : _a.asNumber()) !== null && _b !== void 0 ? _b : 0;
  12208. };
  12209. PDFAcroField2.prototype.setFlags = function(flags) {
  12210. this.dict.set(PDFName_default.of("Ff"), PDFNumber_default.of(flags));
  12211. };
  12212. PDFAcroField2.prototype.hasFlag = function(flag3) {
  12213. var flags = this.getFlags();
  12214. return (flags & flag3) !== 0;
  12215. };
  12216. PDFAcroField2.prototype.setFlag = function(flag3) {
  12217. var flags = this.getFlags();
  12218. this.setFlags(flags | flag3);
  12219. };
  12220. PDFAcroField2.prototype.clearFlag = function(flag3) {
  12221. var flags = this.getFlags();
  12222. this.setFlags(flags & ~flag3);
  12223. };
  12224. PDFAcroField2.prototype.setFlagTo = function(flag3, enable) {
  12225. if (enable)
  12226. this.setFlag(flag3);
  12227. else
  12228. this.clearFlag(flag3);
  12229. };
  12230. PDFAcroField2.prototype.getInheritableAttribute = function(name) {
  12231. var attribute;
  12232. this.ascend(function(node) {
  12233. if (!attribute)
  12234. attribute = node.dict.get(name);
  12235. });
  12236. return attribute;
  12237. };
  12238. PDFAcroField2.prototype.ascend = function(visitor) {
  12239. visitor(this);
  12240. var parent = this.getParent();
  12241. if (parent)
  12242. parent.ascend(visitor);
  12243. };
  12244. return PDFAcroField2;
  12245. }()
  12246. );
  12247. var PDFAcroField_default = PDFAcroField;
  12248. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/annotation/BorderStyle.js
  12249. var BorderStyle = (
  12250. /** @class */
  12251. function() {
  12252. function BorderStyle2(dict) {
  12253. this.dict = dict;
  12254. }
  12255. BorderStyle2.prototype.W = function() {
  12256. var W = this.dict.lookup(PDFName_default.of("W"));
  12257. if (W instanceof PDFNumber_default)
  12258. return W;
  12259. return void 0;
  12260. };
  12261. BorderStyle2.prototype.getWidth = function() {
  12262. var _a, _b;
  12263. return (_b = (_a = this.W()) === null || _a === void 0 ? void 0 : _a.asNumber()) !== null && _b !== void 0 ? _b : 1;
  12264. };
  12265. BorderStyle2.prototype.setWidth = function(width) {
  12266. var W = this.dict.context.obj(width);
  12267. this.dict.set(PDFName_default.of("W"), W);
  12268. };
  12269. BorderStyle2.fromDict = function(dict) {
  12270. return new BorderStyle2(dict);
  12271. };
  12272. return BorderStyle2;
  12273. }()
  12274. );
  12275. var BorderStyle_default = BorderStyle;
  12276. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/annotation/PDFAnnotation.js
  12277. var PDFAnnotation = (
  12278. /** @class */
  12279. function() {
  12280. function PDFAnnotation2(dict) {
  12281. this.dict = dict;
  12282. }
  12283. PDFAnnotation2.prototype.Rect = function() {
  12284. return this.dict.lookup(PDFName_default.of("Rect"), PDFArray_default);
  12285. };
  12286. PDFAnnotation2.prototype.AP = function() {
  12287. return this.dict.lookupMaybe(PDFName_default.of("AP"), PDFDict_default);
  12288. };
  12289. PDFAnnotation2.prototype.F = function() {
  12290. var numberOrRef = this.dict.lookup(PDFName_default.of("F"));
  12291. return this.dict.context.lookupMaybe(numberOrRef, PDFNumber_default);
  12292. };
  12293. PDFAnnotation2.prototype.getRectangle = function() {
  12294. var _a;
  12295. var Rect = this.Rect();
  12296. return (_a = Rect === null || Rect === void 0 ? void 0 : Rect.asRectangle()) !== null && _a !== void 0 ? _a : { x: 0, y: 0, width: 0, height: 0 };
  12297. };
  12298. PDFAnnotation2.prototype.setRectangle = function(rect) {
  12299. var x = rect.x, y = rect.y, width = rect.width, height = rect.height;
  12300. var Rect = this.dict.context.obj([x, y, x + width, y + height]);
  12301. this.dict.set(PDFName_default.of("Rect"), Rect);
  12302. };
  12303. PDFAnnotation2.prototype.getAppearanceState = function() {
  12304. var AS = this.dict.lookup(PDFName_default.of("AS"));
  12305. if (AS instanceof PDFName_default)
  12306. return AS;
  12307. return void 0;
  12308. };
  12309. PDFAnnotation2.prototype.setAppearanceState = function(state) {
  12310. this.dict.set(PDFName_default.of("AS"), state);
  12311. };
  12312. PDFAnnotation2.prototype.setAppearances = function(appearances) {
  12313. this.dict.set(PDFName_default.of("AP"), appearances);
  12314. };
  12315. PDFAnnotation2.prototype.ensureAP = function() {
  12316. var AP = this.AP();
  12317. if (!AP) {
  12318. AP = this.dict.context.obj({});
  12319. this.dict.set(PDFName_default.of("AP"), AP);
  12320. }
  12321. return AP;
  12322. };
  12323. PDFAnnotation2.prototype.getNormalAppearance = function() {
  12324. var AP = this.ensureAP();
  12325. var N = AP.get(PDFName_default.of("N"));
  12326. if (N instanceof PDFRef_default || N instanceof PDFDict_default)
  12327. return N;
  12328. throw new Error("Unexpected N type: " + (N === null || N === void 0 ? void 0 : N.constructor.name));
  12329. };
  12330. PDFAnnotation2.prototype.setNormalAppearance = function(appearance) {
  12331. var AP = this.ensureAP();
  12332. AP.set(PDFName_default.of("N"), appearance);
  12333. };
  12334. PDFAnnotation2.prototype.setRolloverAppearance = function(appearance) {
  12335. var AP = this.ensureAP();
  12336. AP.set(PDFName_default.of("R"), appearance);
  12337. };
  12338. PDFAnnotation2.prototype.setDownAppearance = function(appearance) {
  12339. var AP = this.ensureAP();
  12340. AP.set(PDFName_default.of("D"), appearance);
  12341. };
  12342. PDFAnnotation2.prototype.removeRolloverAppearance = function() {
  12343. var AP = this.AP();
  12344. AP === null || AP === void 0 ? void 0 : AP.delete(PDFName_default.of("R"));
  12345. };
  12346. PDFAnnotation2.prototype.removeDownAppearance = function() {
  12347. var AP = this.AP();
  12348. AP === null || AP === void 0 ? void 0 : AP.delete(PDFName_default.of("D"));
  12349. };
  12350. PDFAnnotation2.prototype.getAppearances = function() {
  12351. var AP = this.AP();
  12352. if (!AP)
  12353. return void 0;
  12354. var N = AP.lookup(PDFName_default.of("N"), PDFDict_default, PDFStream_default);
  12355. var R = AP.lookupMaybe(PDFName_default.of("R"), PDFDict_default, PDFStream_default);
  12356. var D = AP.lookupMaybe(PDFName_default.of("D"), PDFDict_default, PDFStream_default);
  12357. return { normal: N, rollover: R, down: D };
  12358. };
  12359. PDFAnnotation2.prototype.getFlags = function() {
  12360. var _a, _b;
  12361. return (_b = (_a = this.F()) === null || _a === void 0 ? void 0 : _a.asNumber()) !== null && _b !== void 0 ? _b : 0;
  12362. };
  12363. PDFAnnotation2.prototype.setFlags = function(flags) {
  12364. this.dict.set(PDFName_default.of("F"), PDFNumber_default.of(flags));
  12365. };
  12366. PDFAnnotation2.prototype.hasFlag = function(flag3) {
  12367. var flags = this.getFlags();
  12368. return (flags & flag3) !== 0;
  12369. };
  12370. PDFAnnotation2.prototype.setFlag = function(flag3) {
  12371. var flags = this.getFlags();
  12372. this.setFlags(flags | flag3);
  12373. };
  12374. PDFAnnotation2.prototype.clearFlag = function(flag3) {
  12375. var flags = this.getFlags();
  12376. this.setFlags(flags & ~flag3);
  12377. };
  12378. PDFAnnotation2.prototype.setFlagTo = function(flag3, enable) {
  12379. if (enable)
  12380. this.setFlag(flag3);
  12381. else
  12382. this.clearFlag(flag3);
  12383. };
  12384. PDFAnnotation2.fromDict = function(dict) {
  12385. return new PDFAnnotation2(dict);
  12386. };
  12387. return PDFAnnotation2;
  12388. }()
  12389. );
  12390. var PDFAnnotation_default = PDFAnnotation;
  12391. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/annotation/AppearanceCharacteristics.js
  12392. var AppearanceCharacteristics = (
  12393. /** @class */
  12394. function() {
  12395. function AppearanceCharacteristics2(dict) {
  12396. this.dict = dict;
  12397. }
  12398. AppearanceCharacteristics2.prototype.R = function() {
  12399. var R = this.dict.lookup(PDFName_default.of("R"));
  12400. if (R instanceof PDFNumber_default)
  12401. return R;
  12402. return void 0;
  12403. };
  12404. AppearanceCharacteristics2.prototype.BC = function() {
  12405. var BC = this.dict.lookup(PDFName_default.of("BC"));
  12406. if (BC instanceof PDFArray_default)
  12407. return BC;
  12408. return void 0;
  12409. };
  12410. AppearanceCharacteristics2.prototype.BG = function() {
  12411. var BG = this.dict.lookup(PDFName_default.of("BG"));
  12412. if (BG instanceof PDFArray_default)
  12413. return BG;
  12414. return void 0;
  12415. };
  12416. AppearanceCharacteristics2.prototype.CA = function() {
  12417. var CA = this.dict.lookup(PDFName_default.of("CA"));
  12418. if (CA instanceof PDFHexString_default || CA instanceof PDFString_default)
  12419. return CA;
  12420. return void 0;
  12421. };
  12422. AppearanceCharacteristics2.prototype.RC = function() {
  12423. var RC = this.dict.lookup(PDFName_default.of("RC"));
  12424. if (RC instanceof PDFHexString_default || RC instanceof PDFString_default)
  12425. return RC;
  12426. return void 0;
  12427. };
  12428. AppearanceCharacteristics2.prototype.AC = function() {
  12429. var AC = this.dict.lookup(PDFName_default.of("AC"));
  12430. if (AC instanceof PDFHexString_default || AC instanceof PDFString_default)
  12431. return AC;
  12432. return void 0;
  12433. };
  12434. AppearanceCharacteristics2.prototype.getRotation = function() {
  12435. var _a;
  12436. return (_a = this.R()) === null || _a === void 0 ? void 0 : _a.asNumber();
  12437. };
  12438. AppearanceCharacteristics2.prototype.getBorderColor = function() {
  12439. var BC = this.BC();
  12440. if (!BC)
  12441. return void 0;
  12442. var components = [];
  12443. for (var idx = 0, len = BC === null || BC === void 0 ? void 0 : BC.size(); idx < len; idx++) {
  12444. var component = BC.get(idx);
  12445. if (component instanceof PDFNumber_default)
  12446. components.push(component.asNumber());
  12447. }
  12448. return components;
  12449. };
  12450. AppearanceCharacteristics2.prototype.getBackgroundColor = function() {
  12451. var BG = this.BG();
  12452. if (!BG)
  12453. return void 0;
  12454. var components = [];
  12455. for (var idx = 0, len = BG === null || BG === void 0 ? void 0 : BG.size(); idx < len; idx++) {
  12456. var component = BG.get(idx);
  12457. if (component instanceof PDFNumber_default)
  12458. components.push(component.asNumber());
  12459. }
  12460. return components;
  12461. };
  12462. AppearanceCharacteristics2.prototype.getCaptions = function() {
  12463. var CA = this.CA();
  12464. var RC = this.RC();
  12465. var AC = this.AC();
  12466. return {
  12467. normal: CA === null || CA === void 0 ? void 0 : CA.decodeText(),
  12468. rollover: RC === null || RC === void 0 ? void 0 : RC.decodeText(),
  12469. down: AC === null || AC === void 0 ? void 0 : AC.decodeText()
  12470. };
  12471. };
  12472. AppearanceCharacteristics2.prototype.setRotation = function(rotation) {
  12473. var R = this.dict.context.obj(rotation);
  12474. this.dict.set(PDFName_default.of("R"), R);
  12475. };
  12476. AppearanceCharacteristics2.prototype.setBorderColor = function(color) {
  12477. var BC = this.dict.context.obj(color);
  12478. this.dict.set(PDFName_default.of("BC"), BC);
  12479. };
  12480. AppearanceCharacteristics2.prototype.setBackgroundColor = function(color) {
  12481. var BG = this.dict.context.obj(color);
  12482. this.dict.set(PDFName_default.of("BG"), BG);
  12483. };
  12484. AppearanceCharacteristics2.prototype.setCaptions = function(captions) {
  12485. var CA = PDFHexString_default.fromText(captions.normal);
  12486. this.dict.set(PDFName_default.of("CA"), CA);
  12487. if (captions.rollover) {
  12488. var RC = PDFHexString_default.fromText(captions.rollover);
  12489. this.dict.set(PDFName_default.of("RC"), RC);
  12490. } else {
  12491. this.dict.delete(PDFName_default.of("RC"));
  12492. }
  12493. if (captions.down) {
  12494. var AC = PDFHexString_default.fromText(captions.down);
  12495. this.dict.set(PDFName_default.of("AC"), AC);
  12496. } else {
  12497. this.dict.delete(PDFName_default.of("AC"));
  12498. }
  12499. };
  12500. AppearanceCharacteristics2.fromDict = function(dict) {
  12501. return new AppearanceCharacteristics2(dict);
  12502. };
  12503. return AppearanceCharacteristics2;
  12504. }()
  12505. );
  12506. var AppearanceCharacteristics_default = AppearanceCharacteristics;
  12507. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/annotation/PDFWidgetAnnotation.js
  12508. var PDFWidgetAnnotation = (
  12509. /** @class */
  12510. function(_super) {
  12511. __extends(PDFWidgetAnnotation2, _super);
  12512. function PDFWidgetAnnotation2() {
  12513. return _super !== null && _super.apply(this, arguments) || this;
  12514. }
  12515. PDFWidgetAnnotation2.prototype.MK = function() {
  12516. var MK = this.dict.lookup(PDFName_default.of("MK"));
  12517. if (MK instanceof PDFDict_default)
  12518. return MK;
  12519. return void 0;
  12520. };
  12521. PDFWidgetAnnotation2.prototype.BS = function() {
  12522. var BS = this.dict.lookup(PDFName_default.of("BS"));
  12523. if (BS instanceof PDFDict_default)
  12524. return BS;
  12525. return void 0;
  12526. };
  12527. PDFWidgetAnnotation2.prototype.DA = function() {
  12528. var da = this.dict.lookup(PDFName_default.of("DA"));
  12529. if (da instanceof PDFString_default || da instanceof PDFHexString_default)
  12530. return da;
  12531. return void 0;
  12532. };
  12533. PDFWidgetAnnotation2.prototype.P = function() {
  12534. var P = this.dict.get(PDFName_default.of("P"));
  12535. if (P instanceof PDFRef_default)
  12536. return P;
  12537. return void 0;
  12538. };
  12539. PDFWidgetAnnotation2.prototype.setP = function(page) {
  12540. this.dict.set(PDFName_default.of("P"), page);
  12541. };
  12542. PDFWidgetAnnotation2.prototype.setDefaultAppearance = function(appearance) {
  12543. this.dict.set(PDFName_default.of("DA"), PDFString_default.of(appearance));
  12544. };
  12545. PDFWidgetAnnotation2.prototype.getDefaultAppearance = function() {
  12546. var DA = this.DA();
  12547. if (DA instanceof PDFHexString_default) {
  12548. return DA.decodeText();
  12549. }
  12550. return DA === null || DA === void 0 ? void 0 : DA.asString();
  12551. };
  12552. PDFWidgetAnnotation2.prototype.getAppearanceCharacteristics = function() {
  12553. var MK = this.MK();
  12554. if (MK)
  12555. return AppearanceCharacteristics_default.fromDict(MK);
  12556. return void 0;
  12557. };
  12558. PDFWidgetAnnotation2.prototype.getOrCreateAppearanceCharacteristics = function() {
  12559. var MK = this.MK();
  12560. if (MK)
  12561. return AppearanceCharacteristics_default.fromDict(MK);
  12562. var ac = AppearanceCharacteristics_default.fromDict(this.dict.context.obj({}));
  12563. this.dict.set(PDFName_default.of("MK"), ac.dict);
  12564. return ac;
  12565. };
  12566. PDFWidgetAnnotation2.prototype.getBorderStyle = function() {
  12567. var BS = this.BS();
  12568. if (BS)
  12569. return BorderStyle_default.fromDict(BS);
  12570. return void 0;
  12571. };
  12572. PDFWidgetAnnotation2.prototype.getOrCreateBorderStyle = function() {
  12573. var BS = this.BS();
  12574. if (BS)
  12575. return BorderStyle_default.fromDict(BS);
  12576. var bs = BorderStyle_default.fromDict(this.dict.context.obj({}));
  12577. this.dict.set(PDFName_default.of("BS"), bs.dict);
  12578. return bs;
  12579. };
  12580. PDFWidgetAnnotation2.prototype.getOnValue = function() {
  12581. var _a;
  12582. var normal = (_a = this.getAppearances()) === null || _a === void 0 ? void 0 : _a.normal;
  12583. if (normal instanceof PDFDict_default) {
  12584. var keys = normal.keys();
  12585. for (var idx = 0, len = keys.length; idx < len; idx++) {
  12586. var key = keys[idx];
  12587. if (key !== PDFName_default.of("Off"))
  12588. return key;
  12589. }
  12590. }
  12591. return void 0;
  12592. };
  12593. PDFWidgetAnnotation2.fromDict = function(dict) {
  12594. return new PDFWidgetAnnotation2(dict);
  12595. };
  12596. PDFWidgetAnnotation2.create = function(context, parent) {
  12597. var dict = context.obj({
  12598. Type: "Annot",
  12599. Subtype: "Widget",
  12600. Rect: [0, 0, 0, 0],
  12601. Parent: parent
  12602. });
  12603. return new PDFWidgetAnnotation2(dict);
  12604. };
  12605. return PDFWidgetAnnotation2;
  12606. }(PDFAnnotation_default)
  12607. );
  12608. var PDFWidgetAnnotation_default = PDFWidgetAnnotation;
  12609. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/acroform/PDFAcroTerminal.js
  12610. var PDFAcroTerminal = (
  12611. /** @class */
  12612. function(_super) {
  12613. __extends(PDFAcroTerminal2, _super);
  12614. function PDFAcroTerminal2() {
  12615. return _super !== null && _super.apply(this, arguments) || this;
  12616. }
  12617. PDFAcroTerminal2.prototype.FT = function() {
  12618. var nameOrRef = this.getInheritableAttribute(PDFName_default.of("FT"));
  12619. return this.dict.context.lookup(nameOrRef, PDFName_default);
  12620. };
  12621. PDFAcroTerminal2.prototype.getWidgets = function() {
  12622. var kidDicts = this.Kids();
  12623. if (!kidDicts)
  12624. return [PDFWidgetAnnotation_default.fromDict(this.dict)];
  12625. var widgets = new Array(kidDicts.size());
  12626. for (var idx = 0, len = kidDicts.size(); idx < len; idx++) {
  12627. var dict = kidDicts.lookup(idx, PDFDict_default);
  12628. widgets[idx] = PDFWidgetAnnotation_default.fromDict(dict);
  12629. }
  12630. return widgets;
  12631. };
  12632. PDFAcroTerminal2.prototype.addWidget = function(ref) {
  12633. var Kids = this.normalizedEntries().Kids;
  12634. Kids.push(ref);
  12635. };
  12636. PDFAcroTerminal2.prototype.removeWidget = function(idx) {
  12637. var kidDicts = this.Kids();
  12638. if (!kidDicts) {
  12639. if (idx !== 0)
  12640. throw new IndexOutOfBoundsError(idx, 0, 0);
  12641. this.setKids([]);
  12642. } else {
  12643. if (idx < 0 || idx > kidDicts.size()) {
  12644. throw new IndexOutOfBoundsError(idx, 0, kidDicts.size());
  12645. }
  12646. kidDicts.remove(idx);
  12647. }
  12648. };
  12649. PDFAcroTerminal2.prototype.normalizedEntries = function() {
  12650. var Kids = this.Kids();
  12651. if (!Kids) {
  12652. Kids = this.dict.context.obj([this.ref]);
  12653. this.dict.set(PDFName_default.of("Kids"), Kids);
  12654. }
  12655. return { Kids };
  12656. };
  12657. PDFAcroTerminal2.fromDict = function(dict, ref) {
  12658. return new PDFAcroTerminal2(dict, ref);
  12659. };
  12660. return PDFAcroTerminal2;
  12661. }(PDFAcroField_default)
  12662. );
  12663. var PDFAcroTerminal_default = PDFAcroTerminal;
  12664. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/acroform/PDFAcroButton.js
  12665. var PDFAcroButton = (
  12666. /** @class */
  12667. function(_super) {
  12668. __extends(PDFAcroButton2, _super);
  12669. function PDFAcroButton2() {
  12670. return _super !== null && _super.apply(this, arguments) || this;
  12671. }
  12672. PDFAcroButton2.prototype.Opt = function() {
  12673. return this.dict.lookupMaybe(PDFName_default.of("Opt"), PDFString_default, PDFHexString_default, PDFArray_default);
  12674. };
  12675. PDFAcroButton2.prototype.setOpt = function(opt) {
  12676. this.dict.set(PDFName_default.of("Opt"), this.dict.context.obj(opt));
  12677. };
  12678. PDFAcroButton2.prototype.getExportValues = function() {
  12679. var opt = this.Opt();
  12680. if (!opt)
  12681. return void 0;
  12682. if (opt instanceof PDFString_default || opt instanceof PDFHexString_default) {
  12683. return [opt];
  12684. }
  12685. var values2 = [];
  12686. for (var idx = 0, len = opt.size(); idx < len; idx++) {
  12687. var value = opt.lookup(idx);
  12688. if (value instanceof PDFString_default || value instanceof PDFHexString_default) {
  12689. values2.push(value);
  12690. }
  12691. }
  12692. return values2;
  12693. };
  12694. PDFAcroButton2.prototype.removeExportValue = function(idx) {
  12695. var opt = this.Opt();
  12696. if (!opt)
  12697. return;
  12698. if (opt instanceof PDFString_default || opt instanceof PDFHexString_default) {
  12699. if (idx !== 0)
  12700. throw new IndexOutOfBoundsError(idx, 0, 0);
  12701. this.setOpt([]);
  12702. } else {
  12703. if (idx < 0 || idx > opt.size()) {
  12704. throw new IndexOutOfBoundsError(idx, 0, opt.size());
  12705. }
  12706. opt.remove(idx);
  12707. }
  12708. };
  12709. PDFAcroButton2.prototype.normalizeExportValues = function() {
  12710. var _a, _b, _c, _d;
  12711. var exportValues = (_a = this.getExportValues()) !== null && _a !== void 0 ? _a : [];
  12712. var Opt = [];
  12713. var widgets = this.getWidgets();
  12714. for (var idx = 0, len = widgets.length; idx < len; idx++) {
  12715. var widget = widgets[idx];
  12716. var exportVal = (_b = exportValues[idx]) !== null && _b !== void 0 ? _b : PDFHexString_default.fromText((_d = (_c = widget.getOnValue()) === null || _c === void 0 ? void 0 : _c.decodeText()) !== null && _d !== void 0 ? _d : "");
  12717. Opt.push(exportVal);
  12718. }
  12719. this.setOpt(Opt);
  12720. };
  12721. PDFAcroButton2.prototype.addOpt = function(opt, useExistingOptIdx) {
  12722. var _a;
  12723. this.normalizeExportValues();
  12724. var optText = opt.decodeText();
  12725. var existingIdx;
  12726. if (useExistingOptIdx) {
  12727. var exportValues = (_a = this.getExportValues()) !== null && _a !== void 0 ? _a : [];
  12728. for (var idx = 0, len = exportValues.length; idx < len; idx++) {
  12729. var exportVal = exportValues[idx];
  12730. if (exportVal.decodeText() === optText)
  12731. existingIdx = idx;
  12732. }
  12733. }
  12734. var Opt = this.Opt();
  12735. Opt.push(opt);
  12736. return existingIdx !== null && existingIdx !== void 0 ? existingIdx : Opt.size() - 1;
  12737. };
  12738. PDFAcroButton2.prototype.addWidgetWithOpt = function(widget, opt, useExistingOptIdx) {
  12739. var optIdx = this.addOpt(opt, useExistingOptIdx);
  12740. var apStateValue = PDFName_default.of(String(optIdx));
  12741. this.addWidget(widget);
  12742. return apStateValue;
  12743. };
  12744. return PDFAcroButton2;
  12745. }(PDFAcroTerminal_default)
  12746. );
  12747. var PDFAcroButton_default = PDFAcroButton;
  12748. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/acroform/PDFAcroCheckBox.js
  12749. var PDFAcroCheckBox = (
  12750. /** @class */
  12751. function(_super) {
  12752. __extends(PDFAcroCheckBox2, _super);
  12753. function PDFAcroCheckBox2() {
  12754. return _super !== null && _super.apply(this, arguments) || this;
  12755. }
  12756. PDFAcroCheckBox2.prototype.setValue = function(value) {
  12757. var _a;
  12758. var onValue = (_a = this.getOnValue()) !== null && _a !== void 0 ? _a : PDFName_default.of("Yes");
  12759. if (value !== onValue && value !== PDFName_default.of("Off")) {
  12760. throw new InvalidAcroFieldValueError();
  12761. }
  12762. this.dict.set(PDFName_default.of("V"), value);
  12763. var widgets = this.getWidgets();
  12764. for (var idx = 0, len = widgets.length; idx < len; idx++) {
  12765. var widget = widgets[idx];
  12766. var state = widget.getOnValue() === value ? value : PDFName_default.of("Off");
  12767. widget.setAppearanceState(state);
  12768. }
  12769. };
  12770. PDFAcroCheckBox2.prototype.getValue = function() {
  12771. var v = this.V();
  12772. if (v instanceof PDFName_default)
  12773. return v;
  12774. return PDFName_default.of("Off");
  12775. };
  12776. PDFAcroCheckBox2.prototype.getOnValue = function() {
  12777. var widget = this.getWidgets()[0];
  12778. return widget === null || widget === void 0 ? void 0 : widget.getOnValue();
  12779. };
  12780. PDFAcroCheckBox2.fromDict = function(dict, ref) {
  12781. return new PDFAcroCheckBox2(dict, ref);
  12782. };
  12783. PDFAcroCheckBox2.create = function(context) {
  12784. var dict = context.obj({
  12785. FT: "Btn",
  12786. Kids: []
  12787. });
  12788. var ref = context.register(dict);
  12789. return new PDFAcroCheckBox2(dict, ref);
  12790. };
  12791. return PDFAcroCheckBox2;
  12792. }(PDFAcroButton_default)
  12793. );
  12794. var PDFAcroCheckBox_default = PDFAcroCheckBox;
  12795. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/acroform/flags.js
  12796. var flag = function(bitIndex) {
  12797. return 1 << bitIndex;
  12798. };
  12799. var AcroFieldFlags;
  12800. (function(AcroFieldFlags2) {
  12801. AcroFieldFlags2[AcroFieldFlags2["ReadOnly"] = flag(1 - 1)] = "ReadOnly";
  12802. AcroFieldFlags2[AcroFieldFlags2["Required"] = flag(2 - 1)] = "Required";
  12803. AcroFieldFlags2[AcroFieldFlags2["NoExport"] = flag(3 - 1)] = "NoExport";
  12804. })(AcroFieldFlags || (AcroFieldFlags = {}));
  12805. var AcroButtonFlags;
  12806. (function(AcroButtonFlags2) {
  12807. AcroButtonFlags2[AcroButtonFlags2["NoToggleToOff"] = flag(15 - 1)] = "NoToggleToOff";
  12808. AcroButtonFlags2[AcroButtonFlags2["Radio"] = flag(16 - 1)] = "Radio";
  12809. AcroButtonFlags2[AcroButtonFlags2["PushButton"] = flag(17 - 1)] = "PushButton";
  12810. AcroButtonFlags2[AcroButtonFlags2["RadiosInUnison"] = flag(26 - 1)] = "RadiosInUnison";
  12811. })(AcroButtonFlags || (AcroButtonFlags = {}));
  12812. var AcroTextFlags;
  12813. (function(AcroTextFlags2) {
  12814. AcroTextFlags2[AcroTextFlags2["Multiline"] = flag(13 - 1)] = "Multiline";
  12815. AcroTextFlags2[AcroTextFlags2["Password"] = flag(14 - 1)] = "Password";
  12816. AcroTextFlags2[AcroTextFlags2["FileSelect"] = flag(21 - 1)] = "FileSelect";
  12817. AcroTextFlags2[AcroTextFlags2["DoNotSpellCheck"] = flag(23 - 1)] = "DoNotSpellCheck";
  12818. AcroTextFlags2[AcroTextFlags2["DoNotScroll"] = flag(24 - 1)] = "DoNotScroll";
  12819. AcroTextFlags2[AcroTextFlags2["Comb"] = flag(25 - 1)] = "Comb";
  12820. AcroTextFlags2[AcroTextFlags2["RichText"] = flag(26 - 1)] = "RichText";
  12821. })(AcroTextFlags || (AcroTextFlags = {}));
  12822. var AcroChoiceFlags;
  12823. (function(AcroChoiceFlags2) {
  12824. AcroChoiceFlags2[AcroChoiceFlags2["Combo"] = flag(18 - 1)] = "Combo";
  12825. AcroChoiceFlags2[AcroChoiceFlags2["Edit"] = flag(19 - 1)] = "Edit";
  12826. AcroChoiceFlags2[AcroChoiceFlags2["Sort"] = flag(20 - 1)] = "Sort";
  12827. AcroChoiceFlags2[AcroChoiceFlags2["MultiSelect"] = flag(22 - 1)] = "MultiSelect";
  12828. AcroChoiceFlags2[AcroChoiceFlags2["DoNotSpellCheck"] = flag(23 - 1)] = "DoNotSpellCheck";
  12829. AcroChoiceFlags2[AcroChoiceFlags2["CommitOnSelChange"] = flag(27 - 1)] = "CommitOnSelChange";
  12830. })(AcroChoiceFlags || (AcroChoiceFlags = {}));
  12831. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/acroform/PDFAcroChoice.js
  12832. var PDFAcroChoice = (
  12833. /** @class */
  12834. function(_super) {
  12835. __extends(PDFAcroChoice2, _super);
  12836. function PDFAcroChoice2() {
  12837. return _super !== null && _super.apply(this, arguments) || this;
  12838. }
  12839. PDFAcroChoice2.prototype.setValues = function(values2) {
  12840. if (this.hasFlag(AcroChoiceFlags.Combo) && !this.hasFlag(AcroChoiceFlags.Edit) && !this.valuesAreValid(values2)) {
  12841. throw new InvalidAcroFieldValueError();
  12842. }
  12843. if (values2.length === 0) {
  12844. this.dict.delete(PDFName_default.of("V"));
  12845. }
  12846. if (values2.length === 1) {
  12847. this.dict.set(PDFName_default.of("V"), values2[0]);
  12848. }
  12849. if (values2.length > 1) {
  12850. if (!this.hasFlag(AcroChoiceFlags.MultiSelect)) {
  12851. throw new MultiSelectValueError();
  12852. }
  12853. this.dict.set(PDFName_default.of("V"), this.dict.context.obj(values2));
  12854. }
  12855. this.updateSelectedIndices(values2);
  12856. };
  12857. PDFAcroChoice2.prototype.valuesAreValid = function(values2) {
  12858. var options = this.getOptions();
  12859. var _loop_1 = function(idx2, len2) {
  12860. var val = values2[idx2].decodeText();
  12861. if (!options.find(function(o) {
  12862. return val === (o.display || o.value).decodeText();
  12863. })) {
  12864. return { value: false };
  12865. }
  12866. };
  12867. for (var idx = 0, len = values2.length; idx < len; idx++) {
  12868. var state_1 = _loop_1(idx, len);
  12869. if (typeof state_1 === "object")
  12870. return state_1.value;
  12871. }
  12872. return true;
  12873. };
  12874. PDFAcroChoice2.prototype.updateSelectedIndices = function(values2) {
  12875. if (values2.length > 1) {
  12876. var indices = new Array(values2.length);
  12877. var options = this.getOptions();
  12878. var _loop_2 = function(idx2, len2) {
  12879. var val = values2[idx2].decodeText();
  12880. indices[idx2] = options.findIndex(function(o) {
  12881. return val === (o.display || o.value).decodeText();
  12882. });
  12883. };
  12884. for (var idx = 0, len = values2.length; idx < len; idx++) {
  12885. _loop_2(idx, len);
  12886. }
  12887. this.dict.set(PDFName_default.of("I"), this.dict.context.obj(indices.sort()));
  12888. } else {
  12889. this.dict.delete(PDFName_default.of("I"));
  12890. }
  12891. };
  12892. PDFAcroChoice2.prototype.getValues = function() {
  12893. var v = this.V();
  12894. if (v instanceof PDFString_default || v instanceof PDFHexString_default)
  12895. return [v];
  12896. if (v instanceof PDFArray_default) {
  12897. var values2 = [];
  12898. for (var idx = 0, len = v.size(); idx < len; idx++) {
  12899. var value = v.lookup(idx);
  12900. if (value instanceof PDFString_default || value instanceof PDFHexString_default) {
  12901. values2.push(value);
  12902. }
  12903. }
  12904. return values2;
  12905. }
  12906. return [];
  12907. };
  12908. PDFAcroChoice2.prototype.Opt = function() {
  12909. return this.dict.lookupMaybe(PDFName_default.of("Opt"), PDFString_default, PDFHexString_default, PDFArray_default);
  12910. };
  12911. PDFAcroChoice2.prototype.setOptions = function(options) {
  12912. var newOpt = new Array(options.length);
  12913. for (var idx = 0, len = options.length; idx < len; idx++) {
  12914. var _a = options[idx], value = _a.value, display = _a.display;
  12915. newOpt[idx] = this.dict.context.obj([value, display || value]);
  12916. }
  12917. this.dict.set(PDFName_default.of("Opt"), this.dict.context.obj(newOpt));
  12918. };
  12919. PDFAcroChoice2.prototype.getOptions = function() {
  12920. var Opt = this.Opt();
  12921. if (Opt instanceof PDFString_default || Opt instanceof PDFHexString_default) {
  12922. return [{ value: Opt, display: Opt }];
  12923. }
  12924. if (Opt instanceof PDFArray_default) {
  12925. var res = [];
  12926. for (var idx = 0, len = Opt.size(); idx < len; idx++) {
  12927. var item = Opt.lookup(idx);
  12928. if (item instanceof PDFString_default || item instanceof PDFHexString_default) {
  12929. res.push({ value: item, display: item });
  12930. }
  12931. if (item instanceof PDFArray_default) {
  12932. if (item.size() > 0) {
  12933. var first = item.lookup(0, PDFString_default, PDFHexString_default);
  12934. var second = item.lookupMaybe(1, PDFString_default, PDFHexString_default);
  12935. res.push({ value: first, display: second || first });
  12936. }
  12937. }
  12938. }
  12939. return res;
  12940. }
  12941. return [];
  12942. };
  12943. return PDFAcroChoice2;
  12944. }(PDFAcroTerminal_default)
  12945. );
  12946. var PDFAcroChoice_default = PDFAcroChoice;
  12947. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/acroform/PDFAcroComboBox.js
  12948. var PDFAcroComboBox = (
  12949. /** @class */
  12950. function(_super) {
  12951. __extends(PDFAcroComboBox2, _super);
  12952. function PDFAcroComboBox2() {
  12953. return _super !== null && _super.apply(this, arguments) || this;
  12954. }
  12955. PDFAcroComboBox2.fromDict = function(dict, ref) {
  12956. return new PDFAcroComboBox2(dict, ref);
  12957. };
  12958. PDFAcroComboBox2.create = function(context) {
  12959. var dict = context.obj({
  12960. FT: "Ch",
  12961. Ff: AcroChoiceFlags.Combo,
  12962. Kids: []
  12963. });
  12964. var ref = context.register(dict);
  12965. return new PDFAcroComboBox2(dict, ref);
  12966. };
  12967. return PDFAcroComboBox2;
  12968. }(PDFAcroChoice_default)
  12969. );
  12970. var PDFAcroComboBox_default = PDFAcroComboBox;
  12971. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/acroform/PDFAcroNonTerminal.js
  12972. var PDFAcroNonTerminal = (
  12973. /** @class */
  12974. function(_super) {
  12975. __extends(PDFAcroNonTerminal2, _super);
  12976. function PDFAcroNonTerminal2() {
  12977. return _super !== null && _super.apply(this, arguments) || this;
  12978. }
  12979. PDFAcroNonTerminal2.prototype.addField = function(field) {
  12980. var Kids = this.normalizedEntries().Kids;
  12981. Kids === null || Kids === void 0 ? void 0 : Kids.push(field);
  12982. };
  12983. PDFAcroNonTerminal2.prototype.normalizedEntries = function() {
  12984. var Kids = this.Kids();
  12985. if (!Kids) {
  12986. Kids = this.dict.context.obj([]);
  12987. this.dict.set(PDFName_default.of("Kids"), Kids);
  12988. }
  12989. return { Kids };
  12990. };
  12991. PDFAcroNonTerminal2.fromDict = function(dict, ref) {
  12992. return new PDFAcroNonTerminal2(dict, ref);
  12993. };
  12994. PDFAcroNonTerminal2.create = function(context) {
  12995. var dict = context.obj({});
  12996. var ref = context.register(dict);
  12997. return new PDFAcroNonTerminal2(dict, ref);
  12998. };
  12999. return PDFAcroNonTerminal2;
  13000. }(PDFAcroField_default)
  13001. );
  13002. var PDFAcroNonTerminal_default = PDFAcroNonTerminal;
  13003. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/acroform/PDFAcroSignature.js
  13004. var PDFAcroSignature = (
  13005. /** @class */
  13006. function(_super) {
  13007. __extends(PDFAcroSignature2, _super);
  13008. function PDFAcroSignature2() {
  13009. return _super !== null && _super.apply(this, arguments) || this;
  13010. }
  13011. PDFAcroSignature2.fromDict = function(dict, ref) {
  13012. return new PDFAcroSignature2(dict, ref);
  13013. };
  13014. return PDFAcroSignature2;
  13015. }(PDFAcroTerminal_default)
  13016. );
  13017. var PDFAcroSignature_default = PDFAcroSignature;
  13018. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/acroform/PDFAcroText.js
  13019. var PDFAcroText = (
  13020. /** @class */
  13021. function(_super) {
  13022. __extends(PDFAcroText2, _super);
  13023. function PDFAcroText2() {
  13024. return _super !== null && _super.apply(this, arguments) || this;
  13025. }
  13026. PDFAcroText2.prototype.MaxLen = function() {
  13027. var maxLen = this.dict.lookup(PDFName_default.of("MaxLen"));
  13028. if (maxLen instanceof PDFNumber_default)
  13029. return maxLen;
  13030. return void 0;
  13031. };
  13032. PDFAcroText2.prototype.Q = function() {
  13033. var q = this.dict.lookup(PDFName_default.of("Q"));
  13034. if (q instanceof PDFNumber_default)
  13035. return q;
  13036. return void 0;
  13037. };
  13038. PDFAcroText2.prototype.setMaxLength = function(maxLength) {
  13039. this.dict.set(PDFName_default.of("MaxLen"), PDFNumber_default.of(maxLength));
  13040. };
  13041. PDFAcroText2.prototype.removeMaxLength = function() {
  13042. this.dict.delete(PDFName_default.of("MaxLen"));
  13043. };
  13044. PDFAcroText2.prototype.getMaxLength = function() {
  13045. var _a;
  13046. return (_a = this.MaxLen()) === null || _a === void 0 ? void 0 : _a.asNumber();
  13047. };
  13048. PDFAcroText2.prototype.setQuadding = function(quadding) {
  13049. this.dict.set(PDFName_default.of("Q"), PDFNumber_default.of(quadding));
  13050. };
  13051. PDFAcroText2.prototype.getQuadding = function() {
  13052. var _a;
  13053. return (_a = this.Q()) === null || _a === void 0 ? void 0 : _a.asNumber();
  13054. };
  13055. PDFAcroText2.prototype.setValue = function(value) {
  13056. this.dict.set(PDFName_default.of("V"), value);
  13057. };
  13058. PDFAcroText2.prototype.removeValue = function() {
  13059. this.dict.delete(PDFName_default.of("V"));
  13060. };
  13061. PDFAcroText2.prototype.getValue = function() {
  13062. var v = this.V();
  13063. if (v instanceof PDFString_default || v instanceof PDFHexString_default)
  13064. return v;
  13065. return void 0;
  13066. };
  13067. PDFAcroText2.fromDict = function(dict, ref) {
  13068. return new PDFAcroText2(dict, ref);
  13069. };
  13070. PDFAcroText2.create = function(context) {
  13071. var dict = context.obj({
  13072. FT: "Tx",
  13073. Kids: []
  13074. });
  13075. var ref = context.register(dict);
  13076. return new PDFAcroText2(dict, ref);
  13077. };
  13078. return PDFAcroText2;
  13079. }(PDFAcroTerminal_default)
  13080. );
  13081. var PDFAcroText_default = PDFAcroText;
  13082. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/acroform/PDFAcroPushButton.js
  13083. var PDFAcroPushButton = (
  13084. /** @class */
  13085. function(_super) {
  13086. __extends(PDFAcroPushButton2, _super);
  13087. function PDFAcroPushButton2() {
  13088. return _super !== null && _super.apply(this, arguments) || this;
  13089. }
  13090. PDFAcroPushButton2.fromDict = function(dict, ref) {
  13091. return new PDFAcroPushButton2(dict, ref);
  13092. };
  13093. PDFAcroPushButton2.create = function(context) {
  13094. var dict = context.obj({
  13095. FT: "Btn",
  13096. Ff: AcroButtonFlags.PushButton,
  13097. Kids: []
  13098. });
  13099. var ref = context.register(dict);
  13100. return new PDFAcroPushButton2(dict, ref);
  13101. };
  13102. return PDFAcroPushButton2;
  13103. }(PDFAcroButton_default)
  13104. );
  13105. var PDFAcroPushButton_default = PDFAcroPushButton;
  13106. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/acroform/PDFAcroRadioButton.js
  13107. var PDFAcroRadioButton = (
  13108. /** @class */
  13109. function(_super) {
  13110. __extends(PDFAcroRadioButton2, _super);
  13111. function PDFAcroRadioButton2() {
  13112. return _super !== null && _super.apply(this, arguments) || this;
  13113. }
  13114. PDFAcroRadioButton2.prototype.setValue = function(value) {
  13115. var onValues = this.getOnValues();
  13116. if (!onValues.includes(value) && value !== PDFName_default.of("Off")) {
  13117. throw new InvalidAcroFieldValueError();
  13118. }
  13119. this.dict.set(PDFName_default.of("V"), value);
  13120. var widgets = this.getWidgets();
  13121. for (var idx = 0, len = widgets.length; idx < len; idx++) {
  13122. var widget = widgets[idx];
  13123. var state = widget.getOnValue() === value ? value : PDFName_default.of("Off");
  13124. widget.setAppearanceState(state);
  13125. }
  13126. };
  13127. PDFAcroRadioButton2.prototype.getValue = function() {
  13128. var v = this.V();
  13129. if (v instanceof PDFName_default)
  13130. return v;
  13131. return PDFName_default.of("Off");
  13132. };
  13133. PDFAcroRadioButton2.prototype.getOnValues = function() {
  13134. var widgets = this.getWidgets();
  13135. var onValues = [];
  13136. for (var idx = 0, len = widgets.length; idx < len; idx++) {
  13137. var onValue = widgets[idx].getOnValue();
  13138. if (onValue)
  13139. onValues.push(onValue);
  13140. }
  13141. return onValues;
  13142. };
  13143. PDFAcroRadioButton2.fromDict = function(dict, ref) {
  13144. return new PDFAcroRadioButton2(dict, ref);
  13145. };
  13146. PDFAcroRadioButton2.create = function(context) {
  13147. var dict = context.obj({
  13148. FT: "Btn",
  13149. Ff: AcroButtonFlags.Radio,
  13150. Kids: []
  13151. });
  13152. var ref = context.register(dict);
  13153. return new PDFAcroRadioButton2(dict, ref);
  13154. };
  13155. return PDFAcroRadioButton2;
  13156. }(PDFAcroButton_default)
  13157. );
  13158. var PDFAcroRadioButton_default = PDFAcroRadioButton;
  13159. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/acroform/PDFAcroListBox.js
  13160. var PDFAcroListBox = (
  13161. /** @class */
  13162. function(_super) {
  13163. __extends(PDFAcroListBox2, _super);
  13164. function PDFAcroListBox2() {
  13165. return _super !== null && _super.apply(this, arguments) || this;
  13166. }
  13167. PDFAcroListBox2.fromDict = function(dict, ref) {
  13168. return new PDFAcroListBox2(dict, ref);
  13169. };
  13170. PDFAcroListBox2.create = function(context) {
  13171. var dict = context.obj({
  13172. FT: "Ch",
  13173. Kids: []
  13174. });
  13175. var ref = context.register(dict);
  13176. return new PDFAcroListBox2(dict, ref);
  13177. };
  13178. return PDFAcroListBox2;
  13179. }(PDFAcroChoice_default)
  13180. );
  13181. var PDFAcroListBox_default = PDFAcroListBox;
  13182. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/acroform/utils.js
  13183. var createPDFAcroFields = function(kidDicts) {
  13184. if (!kidDicts)
  13185. return [];
  13186. var kids = [];
  13187. for (var idx = 0, len = kidDicts.size(); idx < len; idx++) {
  13188. var ref = kidDicts.get(idx);
  13189. var dict = kidDicts.lookup(idx);
  13190. if (ref instanceof PDFRef_default && dict instanceof PDFDict_default) {
  13191. kids.push([createPDFAcroField(dict, ref), ref]);
  13192. }
  13193. }
  13194. return kids;
  13195. };
  13196. var createPDFAcroField = function(dict, ref) {
  13197. var isNonTerminal = isNonTerminalAcroField(dict);
  13198. if (isNonTerminal)
  13199. return PDFAcroNonTerminal_default.fromDict(dict, ref);
  13200. return createPDFAcroTerminal(dict, ref);
  13201. };
  13202. var isNonTerminalAcroField = function(dict) {
  13203. var kids = dict.lookup(PDFName_default.of("Kids"));
  13204. if (kids instanceof PDFArray_default) {
  13205. for (var idx = 0, len = kids.size(); idx < len; idx++) {
  13206. var kid = kids.lookup(idx);
  13207. var kidIsField = kid instanceof PDFDict_default && kid.has(PDFName_default.of("T"));
  13208. if (kidIsField)
  13209. return true;
  13210. }
  13211. }
  13212. return false;
  13213. };
  13214. var createPDFAcroTerminal = function(dict, ref) {
  13215. var ftNameOrRef = getInheritableAttribute(dict, PDFName_default.of("FT"));
  13216. var type = dict.context.lookup(ftNameOrRef, PDFName_default);
  13217. if (type === PDFName_default.of("Btn"))
  13218. return createPDFAcroButton(dict, ref);
  13219. if (type === PDFName_default.of("Ch"))
  13220. return createPDFAcroChoice(dict, ref);
  13221. if (type === PDFName_default.of("Tx"))
  13222. return PDFAcroText_default.fromDict(dict, ref);
  13223. if (type === PDFName_default.of("Sig"))
  13224. return PDFAcroSignature_default.fromDict(dict, ref);
  13225. return PDFAcroTerminal_default.fromDict(dict, ref);
  13226. };
  13227. var createPDFAcroButton = function(dict, ref) {
  13228. var _a;
  13229. var ffNumberOrRef = getInheritableAttribute(dict, PDFName_default.of("Ff"));
  13230. var ffNumber = dict.context.lookupMaybe(ffNumberOrRef, PDFNumber_default);
  13231. var flags = (_a = ffNumber === null || ffNumber === void 0 ? void 0 : ffNumber.asNumber()) !== null && _a !== void 0 ? _a : 0;
  13232. if (flagIsSet(flags, AcroButtonFlags.PushButton)) {
  13233. return PDFAcroPushButton_default.fromDict(dict, ref);
  13234. } else if (flagIsSet(flags, AcroButtonFlags.Radio)) {
  13235. return PDFAcroRadioButton_default.fromDict(dict, ref);
  13236. } else {
  13237. return PDFAcroCheckBox_default.fromDict(dict, ref);
  13238. }
  13239. };
  13240. var createPDFAcroChoice = function(dict, ref) {
  13241. var _a;
  13242. var ffNumberOrRef = getInheritableAttribute(dict, PDFName_default.of("Ff"));
  13243. var ffNumber = dict.context.lookupMaybe(ffNumberOrRef, PDFNumber_default);
  13244. var flags = (_a = ffNumber === null || ffNumber === void 0 ? void 0 : ffNumber.asNumber()) !== null && _a !== void 0 ? _a : 0;
  13245. if (flagIsSet(flags, AcroChoiceFlags.Combo)) {
  13246. return PDFAcroComboBox_default.fromDict(dict, ref);
  13247. } else {
  13248. return PDFAcroListBox_default.fromDict(dict, ref);
  13249. }
  13250. };
  13251. var flagIsSet = function(flags, flag3) {
  13252. return (flags & flag3) !== 0;
  13253. };
  13254. var getInheritableAttribute = function(startNode, name) {
  13255. var attribute;
  13256. ascend(startNode, function(node) {
  13257. if (!attribute)
  13258. attribute = node.get(name);
  13259. });
  13260. return attribute;
  13261. };
  13262. var ascend = function(startNode, visitor) {
  13263. visitor(startNode);
  13264. var Parent = startNode.lookupMaybe(PDFName_default.of("Parent"), PDFDict_default);
  13265. if (Parent)
  13266. ascend(Parent, visitor);
  13267. };
  13268. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/acroform/PDFAcroForm.js
  13269. var PDFAcroForm = (
  13270. /** @class */
  13271. function() {
  13272. function PDFAcroForm2(dict) {
  13273. this.dict = dict;
  13274. }
  13275. PDFAcroForm2.prototype.Fields = function() {
  13276. var fields = this.dict.lookup(PDFName_default.of("Fields"));
  13277. if (fields instanceof PDFArray_default)
  13278. return fields;
  13279. return void 0;
  13280. };
  13281. PDFAcroForm2.prototype.getFields = function() {
  13282. var Fields = this.normalizedEntries().Fields;
  13283. var fields = new Array(Fields.size());
  13284. for (var idx = 0, len = Fields.size(); idx < len; idx++) {
  13285. var ref = Fields.get(idx);
  13286. var dict = Fields.lookup(idx, PDFDict_default);
  13287. fields[idx] = [createPDFAcroField(dict, ref), ref];
  13288. }
  13289. return fields;
  13290. };
  13291. PDFAcroForm2.prototype.getAllFields = function() {
  13292. var allFields = [];
  13293. var pushFields = function(fields) {
  13294. if (!fields)
  13295. return;
  13296. for (var idx = 0, len = fields.length; idx < len; idx++) {
  13297. var field = fields[idx];
  13298. allFields.push(field);
  13299. var fieldModel = field[0];
  13300. if (fieldModel instanceof PDFAcroNonTerminal_default) {
  13301. pushFields(createPDFAcroFields(fieldModel.Kids()));
  13302. }
  13303. }
  13304. };
  13305. pushFields(this.getFields());
  13306. return allFields;
  13307. };
  13308. PDFAcroForm2.prototype.addField = function(field) {
  13309. var Fields = this.normalizedEntries().Fields;
  13310. Fields === null || Fields === void 0 ? void 0 : Fields.push(field);
  13311. };
  13312. PDFAcroForm2.prototype.removeField = function(field) {
  13313. var parent = field.getParent();
  13314. var fields = parent === void 0 ? this.normalizedEntries().Fields : parent.Kids();
  13315. var index = fields === null || fields === void 0 ? void 0 : fields.indexOf(field.ref);
  13316. if (fields === void 0 || index === void 0) {
  13317. throw new Error("Tried to remove inexistent field " + field.getFullyQualifiedName());
  13318. }
  13319. fields.remove(index);
  13320. if (parent !== void 0 && fields.size() === 0) {
  13321. this.removeField(parent);
  13322. }
  13323. };
  13324. PDFAcroForm2.prototype.normalizedEntries = function() {
  13325. var Fields = this.Fields();
  13326. if (!Fields) {
  13327. Fields = this.dict.context.obj([]);
  13328. this.dict.set(PDFName_default.of("Fields"), Fields);
  13329. }
  13330. return { Fields };
  13331. };
  13332. PDFAcroForm2.fromDict = function(dict) {
  13333. return new PDFAcroForm2(dict);
  13334. };
  13335. PDFAcroForm2.create = function(context) {
  13336. var dict = context.obj({ Fields: [] });
  13337. return new PDFAcroForm2(dict);
  13338. };
  13339. return PDFAcroForm2;
  13340. }()
  13341. );
  13342. var PDFAcroForm_default = PDFAcroForm;
  13343. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/structures/PDFCatalog.js
  13344. var PDFCatalog = (
  13345. /** @class */
  13346. function(_super) {
  13347. __extends(PDFCatalog2, _super);
  13348. function PDFCatalog2() {
  13349. return _super !== null && _super.apply(this, arguments) || this;
  13350. }
  13351. PDFCatalog2.prototype.Pages = function() {
  13352. return this.lookup(PDFName_default.of("Pages"), PDFDict_default);
  13353. };
  13354. PDFCatalog2.prototype.AcroForm = function() {
  13355. return this.lookupMaybe(PDFName_default.of("AcroForm"), PDFDict_default);
  13356. };
  13357. PDFCatalog2.prototype.getAcroForm = function() {
  13358. var dict = this.AcroForm();
  13359. if (!dict)
  13360. return void 0;
  13361. return PDFAcroForm_default.fromDict(dict);
  13362. };
  13363. PDFCatalog2.prototype.getOrCreateAcroForm = function() {
  13364. var acroForm = this.getAcroForm();
  13365. if (!acroForm) {
  13366. acroForm = PDFAcroForm_default.create(this.context);
  13367. var acroFormRef = this.context.register(acroForm.dict);
  13368. this.set(PDFName_default.of("AcroForm"), acroFormRef);
  13369. }
  13370. return acroForm;
  13371. };
  13372. PDFCatalog2.prototype.ViewerPreferences = function() {
  13373. return this.lookupMaybe(PDFName_default.of("ViewerPreferences"), PDFDict_default);
  13374. };
  13375. PDFCatalog2.prototype.getViewerPreferences = function() {
  13376. var dict = this.ViewerPreferences();
  13377. if (!dict)
  13378. return void 0;
  13379. return ViewerPreferences_default.fromDict(dict);
  13380. };
  13381. PDFCatalog2.prototype.getOrCreateViewerPreferences = function() {
  13382. var viewerPrefs = this.getViewerPreferences();
  13383. if (!viewerPrefs) {
  13384. viewerPrefs = ViewerPreferences_default.create(this.context);
  13385. var viewerPrefsRef = this.context.register(viewerPrefs.dict);
  13386. this.set(PDFName_default.of("ViewerPreferences"), viewerPrefsRef);
  13387. }
  13388. return viewerPrefs;
  13389. };
  13390. PDFCatalog2.prototype.insertLeafNode = function(leafRef, index) {
  13391. var pagesRef = this.get(PDFName_default.of("Pages"));
  13392. var maybeParentRef = this.Pages().insertLeafNode(leafRef, index);
  13393. return maybeParentRef || pagesRef;
  13394. };
  13395. PDFCatalog2.prototype.removeLeafNode = function(index) {
  13396. this.Pages().removeLeafNode(index);
  13397. };
  13398. PDFCatalog2.withContextAndPages = function(context, pages) {
  13399. var dict = /* @__PURE__ */ new Map();
  13400. dict.set(PDFName_default.of("Type"), PDFName_default.of("Catalog"));
  13401. dict.set(PDFName_default.of("Pages"), pages);
  13402. return new PDFCatalog2(dict, context);
  13403. };
  13404. PDFCatalog2.fromMapWithContext = function(map, context) {
  13405. return new PDFCatalog2(map, context);
  13406. };
  13407. return PDFCatalog2;
  13408. }(PDFDict_default)
  13409. );
  13410. var PDFCatalog_default = PDFCatalog;
  13411. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/structures/PDFPageTree.js
  13412. var PDFPageTree = (
  13413. /** @class */
  13414. function(_super) {
  13415. __extends(PDFPageTree2, _super);
  13416. function PDFPageTree2() {
  13417. return _super !== null && _super.apply(this, arguments) || this;
  13418. }
  13419. PDFPageTree2.prototype.Parent = function() {
  13420. return this.lookup(PDFName_default.of("Parent"));
  13421. };
  13422. PDFPageTree2.prototype.Kids = function() {
  13423. return this.lookup(PDFName_default.of("Kids"), PDFArray_default);
  13424. };
  13425. PDFPageTree2.prototype.Count = function() {
  13426. return this.lookup(PDFName_default.of("Count"), PDFNumber_default);
  13427. };
  13428. PDFPageTree2.prototype.pushTreeNode = function(treeRef) {
  13429. var Kids = this.Kids();
  13430. Kids.push(treeRef);
  13431. };
  13432. PDFPageTree2.prototype.pushLeafNode = function(leafRef) {
  13433. var Kids = this.Kids();
  13434. this.insertLeafKid(Kids.size(), leafRef);
  13435. };
  13436. PDFPageTree2.prototype.insertLeafNode = function(leafRef, targetIndex) {
  13437. var Kids = this.Kids();
  13438. var Count = this.Count().asNumber();
  13439. if (targetIndex > Count) {
  13440. throw new InvalidTargetIndexError(targetIndex, Count);
  13441. }
  13442. var leafsRemainingUntilTarget = targetIndex;
  13443. for (var idx = 0, len = Kids.size(); idx < len; idx++) {
  13444. if (leafsRemainingUntilTarget === 0) {
  13445. this.insertLeafKid(idx, leafRef);
  13446. return void 0;
  13447. }
  13448. var kidRef = Kids.get(idx);
  13449. var kid = this.context.lookup(kidRef);
  13450. if (kid instanceof PDFPageTree2) {
  13451. if (kid.Count().asNumber() > leafsRemainingUntilTarget) {
  13452. return kid.insertLeafNode(leafRef, leafsRemainingUntilTarget) || kidRef;
  13453. } else {
  13454. leafsRemainingUntilTarget -= kid.Count().asNumber();
  13455. }
  13456. }
  13457. if (kid instanceof PDFPageLeaf_default) {
  13458. leafsRemainingUntilTarget -= 1;
  13459. }
  13460. }
  13461. if (leafsRemainingUntilTarget === 0) {
  13462. this.insertLeafKid(Kids.size(), leafRef);
  13463. return void 0;
  13464. }
  13465. throw new CorruptPageTreeError(targetIndex, "insertLeafNode");
  13466. };
  13467. PDFPageTree2.prototype.removeLeafNode = function(targetIndex, prune) {
  13468. if (prune === void 0) {
  13469. prune = true;
  13470. }
  13471. var Kids = this.Kids();
  13472. var Count = this.Count().asNumber();
  13473. if (targetIndex >= Count) {
  13474. throw new InvalidTargetIndexError(targetIndex, Count);
  13475. }
  13476. var leafsRemainingUntilTarget = targetIndex;
  13477. for (var idx = 0, len = Kids.size(); idx < len; idx++) {
  13478. var kidRef = Kids.get(idx);
  13479. var kid = this.context.lookup(kidRef);
  13480. if (kid instanceof PDFPageTree2) {
  13481. if (kid.Count().asNumber() > leafsRemainingUntilTarget) {
  13482. kid.removeLeafNode(leafsRemainingUntilTarget, prune);
  13483. if (prune && kid.Kids().size() === 0)
  13484. Kids.remove(idx);
  13485. return;
  13486. } else {
  13487. leafsRemainingUntilTarget -= kid.Count().asNumber();
  13488. }
  13489. }
  13490. if (kid instanceof PDFPageLeaf_default) {
  13491. if (leafsRemainingUntilTarget === 0) {
  13492. this.removeKid(idx);
  13493. return;
  13494. } else {
  13495. leafsRemainingUntilTarget -= 1;
  13496. }
  13497. }
  13498. }
  13499. throw new CorruptPageTreeError(targetIndex, "removeLeafNode");
  13500. };
  13501. PDFPageTree2.prototype.ascend = function(visitor) {
  13502. visitor(this);
  13503. var Parent = this.Parent();
  13504. if (Parent)
  13505. Parent.ascend(visitor);
  13506. };
  13507. PDFPageTree2.prototype.traverse = function(visitor) {
  13508. var Kids = this.Kids();
  13509. for (var idx = 0, len = Kids.size(); idx < len; idx++) {
  13510. var kidRef = Kids.get(idx);
  13511. var kid = this.context.lookup(kidRef);
  13512. if (kid instanceof PDFPageTree2)
  13513. kid.traverse(visitor);
  13514. visitor(kid, kidRef);
  13515. }
  13516. };
  13517. PDFPageTree2.prototype.insertLeafKid = function(kidIdx, leafRef) {
  13518. var Kids = this.Kids();
  13519. this.ascend(function(node) {
  13520. var newCount = node.Count().asNumber() + 1;
  13521. node.set(PDFName_default.of("Count"), PDFNumber_default.of(newCount));
  13522. });
  13523. Kids.insert(kidIdx, leafRef);
  13524. };
  13525. PDFPageTree2.prototype.removeKid = function(kidIdx) {
  13526. var Kids = this.Kids();
  13527. var kid = Kids.lookup(kidIdx);
  13528. if (kid instanceof PDFPageLeaf_default) {
  13529. this.ascend(function(node) {
  13530. var newCount = node.Count().asNumber() - 1;
  13531. node.set(PDFName_default.of("Count"), PDFNumber_default.of(newCount));
  13532. });
  13533. }
  13534. Kids.remove(kidIdx);
  13535. };
  13536. PDFPageTree2.withContext = function(context, parent) {
  13537. var dict = /* @__PURE__ */ new Map();
  13538. dict.set(PDFName_default.of("Type"), PDFName_default.of("Pages"));
  13539. dict.set(PDFName_default.of("Kids"), context.obj([]));
  13540. dict.set(PDFName_default.of("Count"), context.obj(0));
  13541. if (parent)
  13542. dict.set(PDFName_default.of("Parent"), parent);
  13543. return new PDFPageTree2(dict, context);
  13544. };
  13545. PDFPageTree2.fromMapWithContext = function(map, context) {
  13546. return new PDFPageTree2(map, context);
  13547. };
  13548. return PDFPageTree2;
  13549. }(PDFDict_default)
  13550. );
  13551. var PDFPageTree_default = PDFPageTree;
  13552. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/syntax/Numeric.js
  13553. var IsDigit = new Uint8Array(256);
  13554. IsDigit[CharCodes_default.Zero] = 1;
  13555. IsDigit[CharCodes_default.One] = 1;
  13556. IsDigit[CharCodes_default.Two] = 1;
  13557. IsDigit[CharCodes_default.Three] = 1;
  13558. IsDigit[CharCodes_default.Four] = 1;
  13559. IsDigit[CharCodes_default.Five] = 1;
  13560. IsDigit[CharCodes_default.Six] = 1;
  13561. IsDigit[CharCodes_default.Seven] = 1;
  13562. IsDigit[CharCodes_default.Eight] = 1;
  13563. IsDigit[CharCodes_default.Nine] = 1;
  13564. var IsNumericPrefix = new Uint8Array(256);
  13565. IsNumericPrefix[CharCodes_default.Period] = 1;
  13566. IsNumericPrefix[CharCodes_default.Plus] = 1;
  13567. IsNumericPrefix[CharCodes_default.Minus] = 1;
  13568. var IsNumeric = new Uint8Array(256);
  13569. for (idx = 0, len = 256; idx < len; idx++) {
  13570. IsNumeric[idx] = IsDigit[idx] || IsNumericPrefix[idx] ? 1 : 0;
  13571. }
  13572. var idx;
  13573. var len;
  13574. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/parser/BaseParser.js
  13575. var Newline = CharCodes_default.Newline;
  13576. var CarriageReturn = CharCodes_default.CarriageReturn;
  13577. var BaseParser = (
  13578. /** @class */
  13579. function() {
  13580. function BaseParser2(bytes, capNumbers) {
  13581. if (capNumbers === void 0) {
  13582. capNumbers = false;
  13583. }
  13584. this.bytes = bytes;
  13585. this.capNumbers = capNumbers;
  13586. }
  13587. BaseParser2.prototype.parseRawInt = function() {
  13588. var value = "";
  13589. while (!this.bytes.done()) {
  13590. var byte = this.bytes.peek();
  13591. if (!IsDigit[byte])
  13592. break;
  13593. value += charFromCode(this.bytes.next());
  13594. }
  13595. var numberValue = Number(value);
  13596. if (!value || !isFinite(numberValue)) {
  13597. throw new NumberParsingError(this.bytes.position(), value);
  13598. }
  13599. return numberValue;
  13600. };
  13601. BaseParser2.prototype.parseRawNumber = function() {
  13602. var value = "";
  13603. while (!this.bytes.done()) {
  13604. var byte = this.bytes.peek();
  13605. if (!IsNumeric[byte])
  13606. break;
  13607. value += charFromCode(this.bytes.next());
  13608. if (byte === CharCodes_default.Period)
  13609. break;
  13610. }
  13611. while (!this.bytes.done()) {
  13612. var byte = this.bytes.peek();
  13613. if (!IsDigit[byte])
  13614. break;
  13615. value += charFromCode(this.bytes.next());
  13616. }
  13617. var numberValue = Number(value);
  13618. if (!value || !isFinite(numberValue)) {
  13619. throw new NumberParsingError(this.bytes.position(), value);
  13620. }
  13621. if (numberValue > Number.MAX_SAFE_INTEGER) {
  13622. if (this.capNumbers) {
  13623. var msg = "Parsed number that is too large for some PDF readers: " + value + ", using Number.MAX_SAFE_INTEGER instead.";
  13624. console.warn(msg);
  13625. return Number.MAX_SAFE_INTEGER;
  13626. } else {
  13627. var msg = "Parsed number that is too large for some PDF readers: " + value + ", not capping.";
  13628. console.warn(msg);
  13629. }
  13630. }
  13631. return numberValue;
  13632. };
  13633. BaseParser2.prototype.skipWhitespace = function() {
  13634. while (!this.bytes.done() && IsWhitespace[this.bytes.peek()]) {
  13635. this.bytes.next();
  13636. }
  13637. };
  13638. BaseParser2.prototype.skipLine = function() {
  13639. while (!this.bytes.done()) {
  13640. var byte = this.bytes.peek();
  13641. if (byte === Newline || byte === CarriageReturn)
  13642. return;
  13643. this.bytes.next();
  13644. }
  13645. };
  13646. BaseParser2.prototype.skipComment = function() {
  13647. if (this.bytes.peek() !== CharCodes_default.Percent)
  13648. return false;
  13649. while (!this.bytes.done()) {
  13650. var byte = this.bytes.peek();
  13651. if (byte === Newline || byte === CarriageReturn)
  13652. return true;
  13653. this.bytes.next();
  13654. }
  13655. return true;
  13656. };
  13657. BaseParser2.prototype.skipWhitespaceAndComments = function() {
  13658. this.skipWhitespace();
  13659. while (this.skipComment())
  13660. this.skipWhitespace();
  13661. };
  13662. BaseParser2.prototype.matchKeyword = function(keyword) {
  13663. var initialOffset = this.bytes.offset();
  13664. for (var idx = 0, len = keyword.length; idx < len; idx++) {
  13665. if (this.bytes.done() || this.bytes.next() !== keyword[idx]) {
  13666. this.bytes.moveTo(initialOffset);
  13667. return false;
  13668. }
  13669. }
  13670. return true;
  13671. };
  13672. return BaseParser2;
  13673. }()
  13674. );
  13675. var BaseParser_default = BaseParser;
  13676. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/parser/ByteStream.js
  13677. var ByteStream = (
  13678. /** @class */
  13679. function() {
  13680. function ByteStream2(bytes) {
  13681. this.idx = 0;
  13682. this.line = 0;
  13683. this.column = 0;
  13684. this.bytes = bytes;
  13685. this.length = this.bytes.length;
  13686. }
  13687. ByteStream2.prototype.moveTo = function(offset) {
  13688. this.idx = offset;
  13689. };
  13690. ByteStream2.prototype.next = function() {
  13691. var byte = this.bytes[this.idx++];
  13692. if (byte === CharCodes_default.Newline) {
  13693. this.line += 1;
  13694. this.column = 0;
  13695. } else {
  13696. this.column += 1;
  13697. }
  13698. return byte;
  13699. };
  13700. ByteStream2.prototype.assertNext = function(expected) {
  13701. if (this.peek() !== expected) {
  13702. throw new NextByteAssertionError(this.position(), expected, this.peek());
  13703. }
  13704. return this.next();
  13705. };
  13706. ByteStream2.prototype.peek = function() {
  13707. return this.bytes[this.idx];
  13708. };
  13709. ByteStream2.prototype.peekAhead = function(steps) {
  13710. return this.bytes[this.idx + steps];
  13711. };
  13712. ByteStream2.prototype.peekAt = function(offset) {
  13713. return this.bytes[offset];
  13714. };
  13715. ByteStream2.prototype.done = function() {
  13716. return this.idx >= this.length;
  13717. };
  13718. ByteStream2.prototype.offset = function() {
  13719. return this.idx;
  13720. };
  13721. ByteStream2.prototype.slice = function(start, end) {
  13722. return this.bytes.slice(start, end);
  13723. };
  13724. ByteStream2.prototype.position = function() {
  13725. return { line: this.line, column: this.column, offset: this.idx };
  13726. };
  13727. ByteStream2.of = function(bytes) {
  13728. return new ByteStream2(bytes);
  13729. };
  13730. ByteStream2.fromPDFRawStream = function(rawStream) {
  13731. return ByteStream2.of(decodePDFRawStream(rawStream).decode());
  13732. };
  13733. return ByteStream2;
  13734. }()
  13735. );
  13736. var ByteStream_default = ByteStream;
  13737. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/syntax/Keywords.js
  13738. var Space = CharCodes_default.Space;
  13739. var CarriageReturn2 = CharCodes_default.CarriageReturn;
  13740. var Newline2 = CharCodes_default.Newline;
  13741. var stream = [
  13742. CharCodes_default.s,
  13743. CharCodes_default.t,
  13744. CharCodes_default.r,
  13745. CharCodes_default.e,
  13746. CharCodes_default.a,
  13747. CharCodes_default.m
  13748. ];
  13749. var endstream = [
  13750. CharCodes_default.e,
  13751. CharCodes_default.n,
  13752. CharCodes_default.d,
  13753. CharCodes_default.s,
  13754. CharCodes_default.t,
  13755. CharCodes_default.r,
  13756. CharCodes_default.e,
  13757. CharCodes_default.a,
  13758. CharCodes_default.m
  13759. ];
  13760. var Keywords = {
  13761. header: [
  13762. CharCodes_default.Percent,
  13763. CharCodes_default.P,
  13764. CharCodes_default.D,
  13765. CharCodes_default.F,
  13766. CharCodes_default.Dash
  13767. ],
  13768. eof: [
  13769. CharCodes_default.Percent,
  13770. CharCodes_default.Percent,
  13771. CharCodes_default.E,
  13772. CharCodes_default.O,
  13773. CharCodes_default.F
  13774. ],
  13775. obj: [CharCodes_default.o, CharCodes_default.b, CharCodes_default.j],
  13776. endobj: [
  13777. CharCodes_default.e,
  13778. CharCodes_default.n,
  13779. CharCodes_default.d,
  13780. CharCodes_default.o,
  13781. CharCodes_default.b,
  13782. CharCodes_default.j
  13783. ],
  13784. xref: [CharCodes_default.x, CharCodes_default.r, CharCodes_default.e, CharCodes_default.f],
  13785. trailer: [
  13786. CharCodes_default.t,
  13787. CharCodes_default.r,
  13788. CharCodes_default.a,
  13789. CharCodes_default.i,
  13790. CharCodes_default.l,
  13791. CharCodes_default.e,
  13792. CharCodes_default.r
  13793. ],
  13794. startxref: [
  13795. CharCodes_default.s,
  13796. CharCodes_default.t,
  13797. CharCodes_default.a,
  13798. CharCodes_default.r,
  13799. CharCodes_default.t,
  13800. CharCodes_default.x,
  13801. CharCodes_default.r,
  13802. CharCodes_default.e,
  13803. CharCodes_default.f
  13804. ],
  13805. true: [CharCodes_default.t, CharCodes_default.r, CharCodes_default.u, CharCodes_default.e],
  13806. false: [CharCodes_default.f, CharCodes_default.a, CharCodes_default.l, CharCodes_default.s, CharCodes_default.e],
  13807. null: [CharCodes_default.n, CharCodes_default.u, CharCodes_default.l, CharCodes_default.l],
  13808. stream,
  13809. streamEOF1: __spreadArrays(stream, [Space, CarriageReturn2, Newline2]),
  13810. streamEOF2: __spreadArrays(stream, [CarriageReturn2, Newline2]),
  13811. streamEOF3: __spreadArrays(stream, [CarriageReturn2]),
  13812. streamEOF4: __spreadArrays(stream, [Newline2]),
  13813. endstream,
  13814. EOF1endstream: __spreadArrays([CarriageReturn2, Newline2], endstream),
  13815. EOF2endstream: __spreadArrays([CarriageReturn2], endstream),
  13816. EOF3endstream: __spreadArrays([Newline2], endstream)
  13817. };
  13818. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/parser/PDFObjectParser.js
  13819. var PDFObjectParser = (
  13820. /** @class */
  13821. function(_super) {
  13822. __extends(PDFObjectParser2, _super);
  13823. function PDFObjectParser2(byteStream, context, capNumbers) {
  13824. if (capNumbers === void 0) {
  13825. capNumbers = false;
  13826. }
  13827. var _this = _super.call(this, byteStream, capNumbers) || this;
  13828. _this.context = context;
  13829. return _this;
  13830. }
  13831. PDFObjectParser2.prototype.parseObject = function() {
  13832. this.skipWhitespaceAndComments();
  13833. if (this.matchKeyword(Keywords.true))
  13834. return PDFBool_default.True;
  13835. if (this.matchKeyword(Keywords.false))
  13836. return PDFBool_default.False;
  13837. if (this.matchKeyword(Keywords.null))
  13838. return PDFNull_default;
  13839. var byte = this.bytes.peek();
  13840. if (byte === CharCodes_default.LessThan && this.bytes.peekAhead(1) === CharCodes_default.LessThan) {
  13841. return this.parseDictOrStream();
  13842. }
  13843. if (byte === CharCodes_default.LessThan)
  13844. return this.parseHexString();
  13845. if (byte === CharCodes_default.LeftParen)
  13846. return this.parseString();
  13847. if (byte === CharCodes_default.ForwardSlash)
  13848. return this.parseName();
  13849. if (byte === CharCodes_default.LeftSquareBracket)
  13850. return this.parseArray();
  13851. if (IsNumeric[byte])
  13852. return this.parseNumberOrRef();
  13853. throw new PDFObjectParsingError(this.bytes.position(), byte);
  13854. };
  13855. PDFObjectParser2.prototype.parseNumberOrRef = function() {
  13856. var firstNum = this.parseRawNumber();
  13857. this.skipWhitespaceAndComments();
  13858. var lookaheadStart = this.bytes.offset();
  13859. if (IsDigit[this.bytes.peek()]) {
  13860. var secondNum = this.parseRawNumber();
  13861. this.skipWhitespaceAndComments();
  13862. if (this.bytes.peek() === CharCodes_default.R) {
  13863. this.bytes.assertNext(CharCodes_default.R);
  13864. return PDFRef_default.of(firstNum, secondNum);
  13865. }
  13866. }
  13867. this.bytes.moveTo(lookaheadStart);
  13868. return PDFNumber_default.of(firstNum);
  13869. };
  13870. PDFObjectParser2.prototype.parseHexString = function() {
  13871. var value = "";
  13872. this.bytes.assertNext(CharCodes_default.LessThan);
  13873. while (!this.bytes.done() && this.bytes.peek() !== CharCodes_default.GreaterThan) {
  13874. value += charFromCode(this.bytes.next());
  13875. }
  13876. this.bytes.assertNext(CharCodes_default.GreaterThan);
  13877. return PDFHexString_default.of(value);
  13878. };
  13879. PDFObjectParser2.prototype.parseString = function() {
  13880. var nestingLvl = 0;
  13881. var isEscaped = false;
  13882. var value = "";
  13883. while (!this.bytes.done()) {
  13884. var byte = this.bytes.next();
  13885. value += charFromCode(byte);
  13886. if (!isEscaped) {
  13887. if (byte === CharCodes_default.LeftParen)
  13888. nestingLvl += 1;
  13889. if (byte === CharCodes_default.RightParen)
  13890. nestingLvl -= 1;
  13891. }
  13892. if (byte === CharCodes_default.BackSlash) {
  13893. isEscaped = !isEscaped;
  13894. } else if (isEscaped) {
  13895. isEscaped = false;
  13896. }
  13897. if (nestingLvl === 0) {
  13898. return PDFString_default.of(value.substring(1, value.length - 1));
  13899. }
  13900. }
  13901. throw new UnbalancedParenthesisError(this.bytes.position());
  13902. };
  13903. PDFObjectParser2.prototype.parseName = function() {
  13904. this.bytes.assertNext(CharCodes_default.ForwardSlash);
  13905. var name = "";
  13906. while (!this.bytes.done()) {
  13907. var byte = this.bytes.peek();
  13908. if (IsWhitespace[byte] || IsDelimiter[byte])
  13909. break;
  13910. name += charFromCode(byte);
  13911. this.bytes.next();
  13912. }
  13913. return PDFName_default.of(name);
  13914. };
  13915. PDFObjectParser2.prototype.parseArray = function() {
  13916. this.bytes.assertNext(CharCodes_default.LeftSquareBracket);
  13917. this.skipWhitespaceAndComments();
  13918. var pdfArray = PDFArray_default.withContext(this.context);
  13919. while (this.bytes.peek() !== CharCodes_default.RightSquareBracket) {
  13920. var element = this.parseObject();
  13921. pdfArray.push(element);
  13922. this.skipWhitespaceAndComments();
  13923. }
  13924. this.bytes.assertNext(CharCodes_default.RightSquareBracket);
  13925. return pdfArray;
  13926. };
  13927. PDFObjectParser2.prototype.parseDict = function() {
  13928. this.bytes.assertNext(CharCodes_default.LessThan);
  13929. this.bytes.assertNext(CharCodes_default.LessThan);
  13930. this.skipWhitespaceAndComments();
  13931. var dict = /* @__PURE__ */ new Map();
  13932. while (!this.bytes.done() && this.bytes.peek() !== CharCodes_default.GreaterThan && this.bytes.peekAhead(1) !== CharCodes_default.GreaterThan) {
  13933. var key = this.parseName();
  13934. var value = this.parseObject();
  13935. dict.set(key, value);
  13936. this.skipWhitespaceAndComments();
  13937. }
  13938. this.skipWhitespaceAndComments();
  13939. this.bytes.assertNext(CharCodes_default.GreaterThan);
  13940. this.bytes.assertNext(CharCodes_default.GreaterThan);
  13941. var Type = dict.get(PDFName_default.of("Type"));
  13942. if (Type === PDFName_default.of("Catalog")) {
  13943. return PDFCatalog_default.fromMapWithContext(dict, this.context);
  13944. } else if (Type === PDFName_default.of("Pages")) {
  13945. return PDFPageTree_default.fromMapWithContext(dict, this.context);
  13946. } else if (Type === PDFName_default.of("Page")) {
  13947. return PDFPageLeaf_default.fromMapWithContext(dict, this.context);
  13948. } else {
  13949. return PDFDict_default.fromMapWithContext(dict, this.context);
  13950. }
  13951. };
  13952. PDFObjectParser2.prototype.parseDictOrStream = function() {
  13953. var startPos = this.bytes.position();
  13954. var dict = this.parseDict();
  13955. this.skipWhitespaceAndComments();
  13956. if (!this.matchKeyword(Keywords.streamEOF1) && !this.matchKeyword(Keywords.streamEOF2) && !this.matchKeyword(Keywords.streamEOF3) && !this.matchKeyword(Keywords.streamEOF4) && !this.matchKeyword(Keywords.stream)) {
  13957. return dict;
  13958. }
  13959. var start = this.bytes.offset();
  13960. var end;
  13961. var Length = dict.get(PDFName_default.of("Length"));
  13962. if (Length instanceof PDFNumber_default) {
  13963. end = start + Length.asNumber();
  13964. this.bytes.moveTo(end);
  13965. this.skipWhitespaceAndComments();
  13966. if (!this.matchKeyword(Keywords.endstream)) {
  13967. this.bytes.moveTo(start);
  13968. end = this.findEndOfStreamFallback(startPos);
  13969. }
  13970. } else {
  13971. end = this.findEndOfStreamFallback(startPos);
  13972. }
  13973. var contents = this.bytes.slice(start, end);
  13974. return PDFRawStream_default.of(dict, contents);
  13975. };
  13976. PDFObjectParser2.prototype.findEndOfStreamFallback = function(startPos) {
  13977. var nestingLvl = 1;
  13978. var end = this.bytes.offset();
  13979. while (!this.bytes.done()) {
  13980. end = this.bytes.offset();
  13981. if (this.matchKeyword(Keywords.stream)) {
  13982. nestingLvl += 1;
  13983. } else if (this.matchKeyword(Keywords.EOF1endstream) || this.matchKeyword(Keywords.EOF2endstream) || this.matchKeyword(Keywords.EOF3endstream) || this.matchKeyword(Keywords.endstream)) {
  13984. nestingLvl -= 1;
  13985. } else {
  13986. this.bytes.next();
  13987. }
  13988. if (nestingLvl === 0)
  13989. break;
  13990. }
  13991. if (nestingLvl !== 0)
  13992. throw new PDFStreamParsingError(startPos);
  13993. return end;
  13994. };
  13995. PDFObjectParser2.forBytes = function(bytes, context, capNumbers) {
  13996. return new PDFObjectParser2(ByteStream_default.of(bytes), context, capNumbers);
  13997. };
  13998. PDFObjectParser2.forByteStream = function(byteStream, context, capNumbers) {
  13999. if (capNumbers === void 0) {
  14000. capNumbers = false;
  14001. }
  14002. return new PDFObjectParser2(byteStream, context, capNumbers);
  14003. };
  14004. return PDFObjectParser2;
  14005. }(BaseParser_default)
  14006. );
  14007. var PDFObjectParser_default = PDFObjectParser;
  14008. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/parser/PDFObjectStreamParser.js
  14009. var PDFObjectStreamParser = (
  14010. /** @class */
  14011. function(_super) {
  14012. __extends(PDFObjectStreamParser2, _super);
  14013. function PDFObjectStreamParser2(rawStream, shouldWaitForTick) {
  14014. var _this = _super.call(this, ByteStream_default.fromPDFRawStream(rawStream), rawStream.dict.context) || this;
  14015. var dict = rawStream.dict;
  14016. _this.alreadyParsed = false;
  14017. _this.shouldWaitForTick = shouldWaitForTick || function() {
  14018. return false;
  14019. };
  14020. _this.firstOffset = dict.lookup(PDFName_default.of("First"), PDFNumber_default).asNumber();
  14021. _this.objectCount = dict.lookup(PDFName_default.of("N"), PDFNumber_default).asNumber();
  14022. return _this;
  14023. }
  14024. PDFObjectStreamParser2.prototype.parseIntoContext = function() {
  14025. return __awaiter(this, void 0, void 0, function() {
  14026. var offsetsAndObjectNumbers, idx, len, _a, objectNumber, offset, object, ref;
  14027. return __generator(this, function(_b) {
  14028. switch (_b.label) {
  14029. case 0:
  14030. if (this.alreadyParsed) {
  14031. throw new ReparseError("PDFObjectStreamParser", "parseIntoContext");
  14032. }
  14033. this.alreadyParsed = true;
  14034. offsetsAndObjectNumbers = this.parseOffsetsAndObjectNumbers();
  14035. idx = 0, len = offsetsAndObjectNumbers.length;
  14036. _b.label = 1;
  14037. case 1:
  14038. if (!(idx < len)) return [3, 4];
  14039. _a = offsetsAndObjectNumbers[idx], objectNumber = _a.objectNumber, offset = _a.offset;
  14040. this.bytes.moveTo(this.firstOffset + offset);
  14041. object = this.parseObject();
  14042. ref = PDFRef_default.of(objectNumber, 0);
  14043. this.context.assign(ref, object);
  14044. if (!this.shouldWaitForTick()) return [3, 3];
  14045. return [4, waitForTick()];
  14046. case 2:
  14047. _b.sent();
  14048. _b.label = 3;
  14049. case 3:
  14050. idx++;
  14051. return [3, 1];
  14052. case 4:
  14053. return [
  14054. 2
  14055. /*return*/
  14056. ];
  14057. }
  14058. });
  14059. });
  14060. };
  14061. PDFObjectStreamParser2.prototype.parseOffsetsAndObjectNumbers = function() {
  14062. var offsetsAndObjectNumbers = [];
  14063. for (var idx = 0, len = this.objectCount; idx < len; idx++) {
  14064. this.skipWhitespaceAndComments();
  14065. var objectNumber = this.parseRawInt();
  14066. this.skipWhitespaceAndComments();
  14067. var offset = this.parseRawInt();
  14068. offsetsAndObjectNumbers.push({ objectNumber, offset });
  14069. }
  14070. return offsetsAndObjectNumbers;
  14071. };
  14072. PDFObjectStreamParser2.forStream = function(rawStream, shouldWaitForTick) {
  14073. return new PDFObjectStreamParser2(rawStream, shouldWaitForTick);
  14074. };
  14075. return PDFObjectStreamParser2;
  14076. }(PDFObjectParser_default)
  14077. );
  14078. var PDFObjectStreamParser_default = PDFObjectStreamParser;
  14079. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/parser/PDFXRefStreamParser.js
  14080. var PDFXRefStreamParser = (
  14081. /** @class */
  14082. function() {
  14083. function PDFXRefStreamParser2(rawStream) {
  14084. this.alreadyParsed = false;
  14085. this.dict = rawStream.dict;
  14086. this.bytes = ByteStream_default.fromPDFRawStream(rawStream);
  14087. this.context = this.dict.context;
  14088. var Size = this.dict.lookup(PDFName_default.of("Size"), PDFNumber_default);
  14089. var Index = this.dict.lookup(PDFName_default.of("Index"));
  14090. if (Index instanceof PDFArray_default) {
  14091. this.subsections = [];
  14092. for (var idx = 0, len = Index.size(); idx < len; idx += 2) {
  14093. var firstObjectNumber = Index.lookup(idx + 0, PDFNumber_default).asNumber();
  14094. var length_1 = Index.lookup(idx + 1, PDFNumber_default).asNumber();
  14095. this.subsections.push({ firstObjectNumber, length: length_1 });
  14096. }
  14097. } else {
  14098. this.subsections = [{ firstObjectNumber: 0, length: Size.asNumber() }];
  14099. }
  14100. var W = this.dict.lookup(PDFName_default.of("W"), PDFArray_default);
  14101. this.byteWidths = [-1, -1, -1];
  14102. for (var idx = 0, len = W.size(); idx < len; idx++) {
  14103. this.byteWidths[idx] = W.lookup(idx, PDFNumber_default).asNumber();
  14104. }
  14105. }
  14106. PDFXRefStreamParser2.prototype.parseIntoContext = function() {
  14107. if (this.alreadyParsed) {
  14108. throw new ReparseError("PDFXRefStreamParser", "parseIntoContext");
  14109. }
  14110. this.alreadyParsed = true;
  14111. this.context.trailerInfo = {
  14112. Root: this.dict.get(PDFName_default.of("Root")),
  14113. Encrypt: this.dict.get(PDFName_default.of("Encrypt")),
  14114. Info: this.dict.get(PDFName_default.of("Info")),
  14115. ID: this.dict.get(PDFName_default.of("ID"))
  14116. };
  14117. var entries = this.parseEntries();
  14118. return entries;
  14119. };
  14120. PDFXRefStreamParser2.prototype.parseEntries = function() {
  14121. var entries = [];
  14122. var _a = this.byteWidths, typeFieldWidth = _a[0], offsetFieldWidth = _a[1], genFieldWidth = _a[2];
  14123. for (var subsectionIdx = 0, subsectionLen = this.subsections.length; subsectionIdx < subsectionLen; subsectionIdx++) {
  14124. var _b = this.subsections[subsectionIdx], firstObjectNumber = _b.firstObjectNumber, length_2 = _b.length;
  14125. for (var objIdx = 0; objIdx < length_2; objIdx++) {
  14126. var type = 0;
  14127. for (var idx = 0, len = typeFieldWidth; idx < len; idx++) {
  14128. type = type << 8 | this.bytes.next();
  14129. }
  14130. var offset = 0;
  14131. for (var idx = 0, len = offsetFieldWidth; idx < len; idx++) {
  14132. offset = offset << 8 | this.bytes.next();
  14133. }
  14134. var generationNumber = 0;
  14135. for (var idx = 0, len = genFieldWidth; idx < len; idx++) {
  14136. generationNumber = generationNumber << 8 | this.bytes.next();
  14137. }
  14138. if (typeFieldWidth === 0)
  14139. type = 1;
  14140. var objectNumber = firstObjectNumber + objIdx;
  14141. var entry = {
  14142. ref: PDFRef_default.of(objectNumber, generationNumber),
  14143. offset,
  14144. deleted: type === 0,
  14145. inObjectStream: type === 2
  14146. };
  14147. entries.push(entry);
  14148. }
  14149. }
  14150. return entries;
  14151. };
  14152. PDFXRefStreamParser2.forStream = function(rawStream) {
  14153. return new PDFXRefStreamParser2(rawStream);
  14154. };
  14155. return PDFXRefStreamParser2;
  14156. }()
  14157. );
  14158. var PDFXRefStreamParser_default = PDFXRefStreamParser;
  14159. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/parser/PDFParser.js
  14160. var PDFParser = (
  14161. /** @class */
  14162. function(_super) {
  14163. __extends(PDFParser2, _super);
  14164. function PDFParser2(pdfBytes, objectsPerTick, throwOnInvalidObject, capNumbers) {
  14165. if (objectsPerTick === void 0) {
  14166. objectsPerTick = Infinity;
  14167. }
  14168. if (throwOnInvalidObject === void 0) {
  14169. throwOnInvalidObject = false;
  14170. }
  14171. if (capNumbers === void 0) {
  14172. capNumbers = false;
  14173. }
  14174. var _this = _super.call(this, ByteStream_default.of(pdfBytes), PDFContext_default.create(), capNumbers) || this;
  14175. _this.alreadyParsed = false;
  14176. _this.parsedObjects = 0;
  14177. _this.shouldWaitForTick = function() {
  14178. _this.parsedObjects += 1;
  14179. return _this.parsedObjects % _this.objectsPerTick === 0;
  14180. };
  14181. _this.objectsPerTick = objectsPerTick;
  14182. _this.throwOnInvalidObject = throwOnInvalidObject;
  14183. return _this;
  14184. }
  14185. PDFParser2.prototype.parseDocument = function() {
  14186. return __awaiter(this, void 0, void 0, function() {
  14187. var prevOffset, offset;
  14188. return __generator(this, function(_a) {
  14189. switch (_a.label) {
  14190. case 0:
  14191. if (this.alreadyParsed) {
  14192. throw new ReparseError("PDFParser", "parseDocument");
  14193. }
  14194. this.alreadyParsed = true;
  14195. this.context.header = this.parseHeader();
  14196. _a.label = 1;
  14197. case 1:
  14198. if (!!this.bytes.done()) return [3, 3];
  14199. return [4, this.parseDocumentSection()];
  14200. case 2:
  14201. _a.sent();
  14202. offset = this.bytes.offset();
  14203. if (offset === prevOffset) {
  14204. throw new StalledParserError(this.bytes.position());
  14205. }
  14206. prevOffset = offset;
  14207. return [3, 1];
  14208. case 3:
  14209. this.maybeRecoverRoot();
  14210. if (this.context.lookup(PDFRef_default.of(0))) {
  14211. console.warn("Removing parsed object: 0 0 R");
  14212. this.context.delete(PDFRef_default.of(0));
  14213. }
  14214. return [2, this.context];
  14215. }
  14216. });
  14217. });
  14218. };
  14219. PDFParser2.prototype.maybeRecoverRoot = function() {
  14220. var isValidCatalog = function(obj) {
  14221. return obj instanceof PDFDict_default && obj.lookup(PDFName_default.of("Type")) === PDFName_default.of("Catalog");
  14222. };
  14223. var catalog = this.context.lookup(this.context.trailerInfo.Root);
  14224. if (!isValidCatalog(catalog)) {
  14225. var indirectObjects = this.context.enumerateIndirectObjects();
  14226. for (var idx = 0, len = indirectObjects.length; idx < len; idx++) {
  14227. var _a = indirectObjects[idx], ref = _a[0], object = _a[1];
  14228. if (isValidCatalog(object)) {
  14229. this.context.trailerInfo.Root = ref;
  14230. }
  14231. }
  14232. }
  14233. };
  14234. PDFParser2.prototype.parseHeader = function() {
  14235. while (!this.bytes.done()) {
  14236. if (this.matchKeyword(Keywords.header)) {
  14237. var major = this.parseRawInt();
  14238. this.bytes.assertNext(CharCodes_default.Period);
  14239. var minor = this.parseRawInt();
  14240. var header = PDFHeader_default.forVersion(major, minor);
  14241. this.skipBinaryHeaderComment();
  14242. return header;
  14243. }
  14244. this.bytes.next();
  14245. }
  14246. throw new MissingPDFHeaderError(this.bytes.position());
  14247. };
  14248. PDFParser2.prototype.parseIndirectObjectHeader = function() {
  14249. this.skipWhitespaceAndComments();
  14250. var objectNumber = this.parseRawInt();
  14251. this.skipWhitespaceAndComments();
  14252. var generationNumber = this.parseRawInt();
  14253. this.skipWhitespaceAndComments();
  14254. if (!this.matchKeyword(Keywords.obj)) {
  14255. throw new MissingKeywordError(this.bytes.position(), Keywords.obj);
  14256. }
  14257. return PDFRef_default.of(objectNumber, generationNumber);
  14258. };
  14259. PDFParser2.prototype.matchIndirectObjectHeader = function() {
  14260. var initialOffset = this.bytes.offset();
  14261. try {
  14262. this.parseIndirectObjectHeader();
  14263. return true;
  14264. } catch (e) {
  14265. this.bytes.moveTo(initialOffset);
  14266. return false;
  14267. }
  14268. };
  14269. PDFParser2.prototype.parseIndirectObject = function() {
  14270. return __awaiter(this, void 0, void 0, function() {
  14271. var ref, object;
  14272. return __generator(this, function(_a) {
  14273. switch (_a.label) {
  14274. case 0:
  14275. ref = this.parseIndirectObjectHeader();
  14276. this.skipWhitespaceAndComments();
  14277. object = this.parseObject();
  14278. this.skipWhitespaceAndComments();
  14279. this.matchKeyword(Keywords.endobj);
  14280. if (!(object instanceof PDFRawStream_default && object.dict.lookup(PDFName_default.of("Type")) === PDFName_default.of("ObjStm"))) return [3, 2];
  14281. return [4, PDFObjectStreamParser_default.forStream(object, this.shouldWaitForTick).parseIntoContext()];
  14282. case 1:
  14283. _a.sent();
  14284. return [3, 3];
  14285. case 2:
  14286. if (object instanceof PDFRawStream_default && object.dict.lookup(PDFName_default.of("Type")) === PDFName_default.of("XRef")) {
  14287. PDFXRefStreamParser_default.forStream(object).parseIntoContext();
  14288. } else {
  14289. this.context.assign(ref, object);
  14290. }
  14291. _a.label = 3;
  14292. case 3:
  14293. return [2, ref];
  14294. }
  14295. });
  14296. });
  14297. };
  14298. PDFParser2.prototype.tryToParseInvalidIndirectObject = function() {
  14299. var startPos = this.bytes.position();
  14300. var msg = "Trying to parse invalid object: " + JSON.stringify(startPos) + ")";
  14301. if (this.throwOnInvalidObject)
  14302. throw new Error(msg);
  14303. console.warn(msg);
  14304. var ref = this.parseIndirectObjectHeader();
  14305. console.warn("Invalid object ref: " + ref);
  14306. this.skipWhitespaceAndComments();
  14307. var start = this.bytes.offset();
  14308. var failed = true;
  14309. while (!this.bytes.done()) {
  14310. if (this.matchKeyword(Keywords.endobj)) {
  14311. failed = false;
  14312. }
  14313. if (!failed)
  14314. break;
  14315. this.bytes.next();
  14316. }
  14317. if (failed)
  14318. throw new PDFInvalidObjectParsingError(startPos);
  14319. var end = this.bytes.offset() - Keywords.endobj.length;
  14320. var object = PDFInvalidObject_default.of(this.bytes.slice(start, end));
  14321. this.context.assign(ref, object);
  14322. return ref;
  14323. };
  14324. PDFParser2.prototype.parseIndirectObjects = function() {
  14325. return __awaiter(this, void 0, void 0, function() {
  14326. var initialOffset, e_1;
  14327. return __generator(this, function(_a) {
  14328. switch (_a.label) {
  14329. case 0:
  14330. this.skipWhitespaceAndComments();
  14331. _a.label = 1;
  14332. case 1:
  14333. if (!(!this.bytes.done() && IsDigit[this.bytes.peek()])) return [3, 8];
  14334. initialOffset = this.bytes.offset();
  14335. _a.label = 2;
  14336. case 2:
  14337. _a.trys.push([2, 4, , 5]);
  14338. return [4, this.parseIndirectObject()];
  14339. case 3:
  14340. _a.sent();
  14341. return [3, 5];
  14342. case 4:
  14343. e_1 = _a.sent();
  14344. this.bytes.moveTo(initialOffset);
  14345. this.tryToParseInvalidIndirectObject();
  14346. return [3, 5];
  14347. case 5:
  14348. this.skipWhitespaceAndComments();
  14349. this.skipJibberish();
  14350. if (!this.shouldWaitForTick()) return [3, 7];
  14351. return [4, waitForTick()];
  14352. case 6:
  14353. _a.sent();
  14354. _a.label = 7;
  14355. case 7:
  14356. return [3, 1];
  14357. case 8:
  14358. return [
  14359. 2
  14360. /*return*/
  14361. ];
  14362. }
  14363. });
  14364. });
  14365. };
  14366. PDFParser2.prototype.maybeParseCrossRefSection = function() {
  14367. this.skipWhitespaceAndComments();
  14368. if (!this.matchKeyword(Keywords.xref))
  14369. return;
  14370. this.skipWhitespaceAndComments();
  14371. var objectNumber = -1;
  14372. var xref = PDFCrossRefSection_default.createEmpty();
  14373. while (!this.bytes.done() && IsDigit[this.bytes.peek()]) {
  14374. var firstInt = this.parseRawInt();
  14375. this.skipWhitespaceAndComments();
  14376. var secondInt = this.parseRawInt();
  14377. this.skipWhitespaceAndComments();
  14378. var byte = this.bytes.peek();
  14379. if (byte === CharCodes_default.n || byte === CharCodes_default.f) {
  14380. var ref = PDFRef_default.of(objectNumber, secondInt);
  14381. if (this.bytes.next() === CharCodes_default.n) {
  14382. xref.addEntry(ref, firstInt);
  14383. } else {
  14384. xref.addDeletedEntry(ref, firstInt);
  14385. }
  14386. objectNumber += 1;
  14387. } else {
  14388. objectNumber = firstInt;
  14389. }
  14390. this.skipWhitespaceAndComments();
  14391. }
  14392. return xref;
  14393. };
  14394. PDFParser2.prototype.maybeParseTrailerDict = function() {
  14395. this.skipWhitespaceAndComments();
  14396. if (!this.matchKeyword(Keywords.trailer))
  14397. return;
  14398. this.skipWhitespaceAndComments();
  14399. var dict = this.parseDict();
  14400. var context = this.context;
  14401. context.trailerInfo = {
  14402. Root: dict.get(PDFName_default.of("Root")) || context.trailerInfo.Root,
  14403. Encrypt: dict.get(PDFName_default.of("Encrypt")) || context.trailerInfo.Encrypt,
  14404. Info: dict.get(PDFName_default.of("Info")) || context.trailerInfo.Info,
  14405. ID: dict.get(PDFName_default.of("ID")) || context.trailerInfo.ID
  14406. };
  14407. };
  14408. PDFParser2.prototype.maybeParseTrailer = function() {
  14409. this.skipWhitespaceAndComments();
  14410. if (!this.matchKeyword(Keywords.startxref))
  14411. return;
  14412. this.skipWhitespaceAndComments();
  14413. var offset = this.parseRawInt();
  14414. this.skipWhitespace();
  14415. this.matchKeyword(Keywords.eof);
  14416. this.skipWhitespaceAndComments();
  14417. this.matchKeyword(Keywords.eof);
  14418. this.skipWhitespaceAndComments();
  14419. return PDFTrailer_default.forLastCrossRefSectionOffset(offset);
  14420. };
  14421. PDFParser2.prototype.parseDocumentSection = function() {
  14422. return __awaiter(this, void 0, void 0, function() {
  14423. return __generator(this, function(_a) {
  14424. switch (_a.label) {
  14425. case 0:
  14426. return [4, this.parseIndirectObjects()];
  14427. case 1:
  14428. _a.sent();
  14429. this.maybeParseCrossRefSection();
  14430. this.maybeParseTrailerDict();
  14431. this.maybeParseTrailer();
  14432. this.skipJibberish();
  14433. return [
  14434. 2
  14435. /*return*/
  14436. ];
  14437. }
  14438. });
  14439. });
  14440. };
  14441. PDFParser2.prototype.skipJibberish = function() {
  14442. this.skipWhitespaceAndComments();
  14443. while (!this.bytes.done()) {
  14444. var initialOffset = this.bytes.offset();
  14445. var byte = this.bytes.peek();
  14446. var isAlphaNumeric = byte >= CharCodes_default.Space && byte <= CharCodes_default.Tilde;
  14447. if (isAlphaNumeric) {
  14448. if (this.matchKeyword(Keywords.xref) || this.matchKeyword(Keywords.trailer) || this.matchKeyword(Keywords.startxref) || this.matchIndirectObjectHeader()) {
  14449. this.bytes.moveTo(initialOffset);
  14450. break;
  14451. }
  14452. }
  14453. this.bytes.next();
  14454. }
  14455. };
  14456. PDFParser2.prototype.skipBinaryHeaderComment = function() {
  14457. this.skipWhitespaceAndComments();
  14458. try {
  14459. var initialOffset = this.bytes.offset();
  14460. this.parseIndirectObjectHeader();
  14461. this.bytes.moveTo(initialOffset);
  14462. } catch (e) {
  14463. this.bytes.next();
  14464. this.skipWhitespaceAndComments();
  14465. }
  14466. };
  14467. PDFParser2.forBytesWithOptions = function(pdfBytes, objectsPerTick, throwOnInvalidObject, capNumbers) {
  14468. return new PDFParser2(pdfBytes, objectsPerTick, throwOnInvalidObject, capNumbers);
  14469. };
  14470. return PDFParser2;
  14471. }(PDFObjectParser_default)
  14472. );
  14473. var PDFParser_default = PDFParser;
  14474. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/annotation/flags.js
  14475. var flag2 = function(bitIndex) {
  14476. return 1 << bitIndex;
  14477. };
  14478. var AnnotationFlags;
  14479. (function(AnnotationFlags2) {
  14480. AnnotationFlags2[AnnotationFlags2["Invisible"] = flag2(1 - 1)] = "Invisible";
  14481. AnnotationFlags2[AnnotationFlags2["Hidden"] = flag2(2 - 1)] = "Hidden";
  14482. AnnotationFlags2[AnnotationFlags2["Print"] = flag2(3 - 1)] = "Print";
  14483. AnnotationFlags2[AnnotationFlags2["NoZoom"] = flag2(4 - 1)] = "NoZoom";
  14484. AnnotationFlags2[AnnotationFlags2["NoRotate"] = flag2(5 - 1)] = "NoRotate";
  14485. AnnotationFlags2[AnnotationFlags2["NoView"] = flag2(6 - 1)] = "NoView";
  14486. AnnotationFlags2[AnnotationFlags2["ReadOnly"] = flag2(7 - 1)] = "ReadOnly";
  14487. AnnotationFlags2[AnnotationFlags2["Locked"] = flag2(8 - 1)] = "Locked";
  14488. AnnotationFlags2[AnnotationFlags2["ToggleNoView"] = flag2(9 - 1)] = "ToggleNoView";
  14489. AnnotationFlags2[AnnotationFlags2["LockedContents"] = flag2(10 - 1)] = "LockedContents";
  14490. })(AnnotationFlags || (AnnotationFlags = {}));
  14491. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/api/objects.js
  14492. var asPDFName = function(name) {
  14493. return name instanceof PDFName_default ? name : PDFName_default.of(name);
  14494. };
  14495. var asPDFNumber = function(num) {
  14496. return num instanceof PDFNumber_default ? num : PDFNumber_default.of(num);
  14497. };
  14498. var asNumber = function(num) {
  14499. return num instanceof PDFNumber_default ? num.asNumber() : num;
  14500. };
  14501. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/api/rotations.js
  14502. var RotationTypes;
  14503. (function(RotationTypes2) {
  14504. RotationTypes2["Degrees"] = "degrees";
  14505. RotationTypes2["Radians"] = "radians";
  14506. })(RotationTypes || (RotationTypes = {}));
  14507. var degrees = function(degreeAngle) {
  14508. assertIs(degreeAngle, "degreeAngle", ["number"]);
  14509. return { type: RotationTypes.Degrees, angle: degreeAngle };
  14510. };
  14511. var Radians = RotationTypes.Radians;
  14512. var Degrees = RotationTypes.Degrees;
  14513. var degreesToRadians = function(degree) {
  14514. return degree * Math.PI / 180;
  14515. };
  14516. var radiansToDegrees = function(radian) {
  14517. return radian * 180 / Math.PI;
  14518. };
  14519. var toRadians = function(rotation) {
  14520. return rotation.type === Radians ? rotation.angle : rotation.type === Degrees ? degreesToRadians(rotation.angle) : error("Invalid rotation: " + JSON.stringify(rotation));
  14521. };
  14522. var toDegrees = function(rotation) {
  14523. return rotation.type === Radians ? radiansToDegrees(rotation.angle) : rotation.type === Degrees ? rotation.angle : error("Invalid rotation: " + JSON.stringify(rotation));
  14524. };
  14525. var reduceRotation = function(degreeAngle) {
  14526. if (degreeAngle === void 0) {
  14527. degreeAngle = 0;
  14528. }
  14529. var quadrants = degreeAngle / 90 % 4;
  14530. if (quadrants === 0)
  14531. return 0;
  14532. if (quadrants === 1)
  14533. return 90;
  14534. if (quadrants === 2)
  14535. return 180;
  14536. if (quadrants === 3)
  14537. return 270;
  14538. return 0;
  14539. };
  14540. var adjustDimsForRotation = function(dims, degreeAngle) {
  14541. if (degreeAngle === void 0) {
  14542. degreeAngle = 0;
  14543. }
  14544. var rotation = reduceRotation(degreeAngle);
  14545. return rotation === 90 || rotation === 270 ? { width: dims.height, height: dims.width } : { width: dims.width, height: dims.height };
  14546. };
  14547. var rotateRectangle = function(rectangle, borderWidth, degreeAngle) {
  14548. if (borderWidth === void 0) {
  14549. borderWidth = 0;
  14550. }
  14551. if (degreeAngle === void 0) {
  14552. degreeAngle = 0;
  14553. }
  14554. var x = rectangle.x, y = rectangle.y, w = rectangle.width, h = rectangle.height;
  14555. var r = reduceRotation(degreeAngle);
  14556. var b = borderWidth / 2;
  14557. if (r === 0)
  14558. return { x: x - b, y: y - b, width: w, height: h };
  14559. else if (r === 90)
  14560. return { x: x - h + b, y: y - b, width: h, height: w };
  14561. else if (r === 180)
  14562. return { x: x - w + b, y: y - h + b, width: w, height: h };
  14563. else if (r === 270)
  14564. return { x: x - b, y: y - w + b, width: h, height: w };
  14565. else
  14566. return { x: x - b, y: y - b, width: w, height: h };
  14567. };
  14568. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/api/operators.js
  14569. var clip = function() {
  14570. return PDFOperator_default.of(PDFOperatorNames_default.ClipNonZero);
  14571. };
  14572. var cos = Math.cos;
  14573. var sin = Math.sin;
  14574. var tan = Math.tan;
  14575. var concatTransformationMatrix = function(a, b, c, d, e, f) {
  14576. return PDFOperator_default.of(PDFOperatorNames_default.ConcatTransformationMatrix, [
  14577. asPDFNumber(a),
  14578. asPDFNumber(b),
  14579. asPDFNumber(c),
  14580. asPDFNumber(d),
  14581. asPDFNumber(e),
  14582. asPDFNumber(f)
  14583. ]);
  14584. };
  14585. var translate = function(xPos, yPos) {
  14586. return concatTransformationMatrix(1, 0, 0, 1, xPos, yPos);
  14587. };
  14588. var scale = function(xPos, yPos) {
  14589. return concatTransformationMatrix(xPos, 0, 0, yPos, 0, 0);
  14590. };
  14591. var rotateRadians = function(angle) {
  14592. return concatTransformationMatrix(cos(asNumber(angle)), sin(asNumber(angle)), -sin(asNumber(angle)), cos(asNumber(angle)), 0, 0);
  14593. };
  14594. var rotateDegrees = function(angle) {
  14595. return rotateRadians(degreesToRadians(asNumber(angle)));
  14596. };
  14597. var skewRadians = function(xSkewAngle, ySkewAngle) {
  14598. return concatTransformationMatrix(1, tan(asNumber(xSkewAngle)), tan(asNumber(ySkewAngle)), 1, 0, 0);
  14599. };
  14600. var setDashPattern = function(dashArray, dashPhase) {
  14601. return PDFOperator_default.of(PDFOperatorNames_default.SetLineDashPattern, [
  14602. "[" + dashArray.map(asPDFNumber).join(" ") + "]",
  14603. asPDFNumber(dashPhase)
  14604. ]);
  14605. };
  14606. var LineCapStyle;
  14607. (function(LineCapStyle2) {
  14608. LineCapStyle2[LineCapStyle2["Butt"] = 0] = "Butt";
  14609. LineCapStyle2[LineCapStyle2["Round"] = 1] = "Round";
  14610. LineCapStyle2[LineCapStyle2["Projecting"] = 2] = "Projecting";
  14611. })(LineCapStyle || (LineCapStyle = {}));
  14612. var setLineCap = function(style) {
  14613. return PDFOperator_default.of(PDFOperatorNames_default.SetLineCapStyle, [asPDFNumber(style)]);
  14614. };
  14615. var LineJoinStyle;
  14616. (function(LineJoinStyle2) {
  14617. LineJoinStyle2[LineJoinStyle2["Miter"] = 0] = "Miter";
  14618. LineJoinStyle2[LineJoinStyle2["Round"] = 1] = "Round";
  14619. LineJoinStyle2[LineJoinStyle2["Bevel"] = 2] = "Bevel";
  14620. })(LineJoinStyle || (LineJoinStyle = {}));
  14621. var setGraphicsState = function(state) {
  14622. return PDFOperator_default.of(PDFOperatorNames_default.SetGraphicsStateParams, [asPDFName(state)]);
  14623. };
  14624. var pushGraphicsState = function() {
  14625. return PDFOperator_default.of(PDFOperatorNames_default.PushGraphicsState);
  14626. };
  14627. var popGraphicsState = function() {
  14628. return PDFOperator_default.of(PDFOperatorNames_default.PopGraphicsState);
  14629. };
  14630. var setLineWidth = function(width) {
  14631. return PDFOperator_default.of(PDFOperatorNames_default.SetLineWidth, [asPDFNumber(width)]);
  14632. };
  14633. var appendBezierCurve = function(x1, y1, x2, y2, x3, y3) {
  14634. return PDFOperator_default.of(PDFOperatorNames_default.AppendBezierCurve, [
  14635. asPDFNumber(x1),
  14636. asPDFNumber(y1),
  14637. asPDFNumber(x2),
  14638. asPDFNumber(y2),
  14639. asPDFNumber(x3),
  14640. asPDFNumber(y3)
  14641. ]);
  14642. };
  14643. var appendQuadraticCurve = function(x1, y1, x2, y2) {
  14644. return PDFOperator_default.of(PDFOperatorNames_default.CurveToReplicateInitialPoint, [
  14645. asPDFNumber(x1),
  14646. asPDFNumber(y1),
  14647. asPDFNumber(x2),
  14648. asPDFNumber(y2)
  14649. ]);
  14650. };
  14651. var closePath = function() {
  14652. return PDFOperator_default.of(PDFOperatorNames_default.ClosePath);
  14653. };
  14654. var moveTo = function(xPos, yPos) {
  14655. return PDFOperator_default.of(PDFOperatorNames_default.MoveTo, [asPDFNumber(xPos), asPDFNumber(yPos)]);
  14656. };
  14657. var lineTo = function(xPos, yPos) {
  14658. return PDFOperator_default.of(PDFOperatorNames_default.LineTo, [asPDFNumber(xPos), asPDFNumber(yPos)]);
  14659. };
  14660. var stroke = function() {
  14661. return PDFOperator_default.of(PDFOperatorNames_default.StrokePath);
  14662. };
  14663. var fill = function() {
  14664. return PDFOperator_default.of(PDFOperatorNames_default.FillNonZero);
  14665. };
  14666. var fillAndStroke = function() {
  14667. return PDFOperator_default.of(PDFOperatorNames_default.FillNonZeroAndStroke);
  14668. };
  14669. var endPath = function() {
  14670. return PDFOperator_default.of(PDFOperatorNames_default.EndPath);
  14671. };
  14672. var nextLine = function() {
  14673. return PDFOperator_default.of(PDFOperatorNames_default.NextLine);
  14674. };
  14675. var showText = function(text) {
  14676. return PDFOperator_default.of(PDFOperatorNames_default.ShowText, [text]);
  14677. };
  14678. var beginText = function() {
  14679. return PDFOperator_default.of(PDFOperatorNames_default.BeginText);
  14680. };
  14681. var endText = function() {
  14682. return PDFOperator_default.of(PDFOperatorNames_default.EndText);
  14683. };
  14684. var setFontAndSize = function(name, size) {
  14685. return PDFOperator_default.of(PDFOperatorNames_default.SetFontAndSize, [asPDFName(name), asPDFNumber(size)]);
  14686. };
  14687. var setLineHeight = function(lineHeight) {
  14688. return PDFOperator_default.of(PDFOperatorNames_default.SetTextLineHeight, [asPDFNumber(lineHeight)]);
  14689. };
  14690. var TextRenderingMode;
  14691. (function(TextRenderingMode2) {
  14692. TextRenderingMode2[TextRenderingMode2["Fill"] = 0] = "Fill";
  14693. TextRenderingMode2[TextRenderingMode2["Outline"] = 1] = "Outline";
  14694. TextRenderingMode2[TextRenderingMode2["FillAndOutline"] = 2] = "FillAndOutline";
  14695. TextRenderingMode2[TextRenderingMode2["Invisible"] = 3] = "Invisible";
  14696. TextRenderingMode2[TextRenderingMode2["FillAndClip"] = 4] = "FillAndClip";
  14697. TextRenderingMode2[TextRenderingMode2["OutlineAndClip"] = 5] = "OutlineAndClip";
  14698. TextRenderingMode2[TextRenderingMode2["FillAndOutlineAndClip"] = 6] = "FillAndOutlineAndClip";
  14699. TextRenderingMode2[TextRenderingMode2["Clip"] = 7] = "Clip";
  14700. })(TextRenderingMode || (TextRenderingMode = {}));
  14701. var setTextMatrix = function(a, b, c, d, e, f) {
  14702. return PDFOperator_default.of(PDFOperatorNames_default.SetTextMatrix, [
  14703. asPDFNumber(a),
  14704. asPDFNumber(b),
  14705. asPDFNumber(c),
  14706. asPDFNumber(d),
  14707. asPDFNumber(e),
  14708. asPDFNumber(f)
  14709. ]);
  14710. };
  14711. var rotateAndSkewTextRadiansAndTranslate = function(rotationAngle, xSkewAngle, ySkewAngle, x, y) {
  14712. return setTextMatrix(cos(asNumber(rotationAngle)), sin(asNumber(rotationAngle)) + tan(asNumber(xSkewAngle)), -sin(asNumber(rotationAngle)) + tan(asNumber(ySkewAngle)), cos(asNumber(rotationAngle)), x, y);
  14713. };
  14714. var drawObject = function(name) {
  14715. return PDFOperator_default.of(PDFOperatorNames_default.DrawObject, [asPDFName(name)]);
  14716. };
  14717. var setFillingGrayscaleColor = function(gray) {
  14718. return PDFOperator_default.of(PDFOperatorNames_default.NonStrokingColorGray, [asPDFNumber(gray)]);
  14719. };
  14720. var setStrokingGrayscaleColor = function(gray) {
  14721. return PDFOperator_default.of(PDFOperatorNames_default.StrokingColorGray, [asPDFNumber(gray)]);
  14722. };
  14723. var setFillingRgbColor = function(red, green, blue) {
  14724. return PDFOperator_default.of(PDFOperatorNames_default.NonStrokingColorRgb, [
  14725. asPDFNumber(red),
  14726. asPDFNumber(green),
  14727. asPDFNumber(blue)
  14728. ]);
  14729. };
  14730. var setStrokingRgbColor = function(red, green, blue) {
  14731. return PDFOperator_default.of(PDFOperatorNames_default.StrokingColorRgb, [
  14732. asPDFNumber(red),
  14733. asPDFNumber(green),
  14734. asPDFNumber(blue)
  14735. ]);
  14736. };
  14737. var setFillingCmykColor = function(cyan, magenta, yellow, key) {
  14738. return PDFOperator_default.of(PDFOperatorNames_default.NonStrokingColorCmyk, [
  14739. asPDFNumber(cyan),
  14740. asPDFNumber(magenta),
  14741. asPDFNumber(yellow),
  14742. asPDFNumber(key)
  14743. ]);
  14744. };
  14745. var setStrokingCmykColor = function(cyan, magenta, yellow, key) {
  14746. return PDFOperator_default.of(PDFOperatorNames_default.StrokingColorCmyk, [
  14747. asPDFNumber(cyan),
  14748. asPDFNumber(magenta),
  14749. asPDFNumber(yellow),
  14750. asPDFNumber(key)
  14751. ]);
  14752. };
  14753. var beginMarkedContent = function(tag) {
  14754. return PDFOperator_default.of(PDFOperatorNames_default.BeginMarkedContent, [asPDFName(tag)]);
  14755. };
  14756. var endMarkedContent = function() {
  14757. return PDFOperator_default.of(PDFOperatorNames_default.EndMarkedContent);
  14758. };
  14759. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/api/colors.js
  14760. var ColorTypes;
  14761. (function(ColorTypes2) {
  14762. ColorTypes2["Grayscale"] = "Grayscale";
  14763. ColorTypes2["RGB"] = "RGB";
  14764. ColorTypes2["CMYK"] = "CMYK";
  14765. })(ColorTypes || (ColorTypes = {}));
  14766. var grayscale = function(gray) {
  14767. assertRange(gray, "gray", 0, 1);
  14768. return { type: ColorTypes.Grayscale, gray };
  14769. };
  14770. var rgb = function(red, green, blue) {
  14771. assertRange(red, "red", 0, 1);
  14772. assertRange(green, "green", 0, 1);
  14773. assertRange(blue, "blue", 0, 1);
  14774. return { type: ColorTypes.RGB, red, green, blue };
  14775. };
  14776. var cmyk = function(cyan, magenta, yellow, key) {
  14777. assertRange(cyan, "cyan", 0, 1);
  14778. assertRange(magenta, "magenta", 0, 1);
  14779. assertRange(yellow, "yellow", 0, 1);
  14780. assertRange(key, "key", 0, 1);
  14781. return { type: ColorTypes.CMYK, cyan, magenta, yellow, key };
  14782. };
  14783. var Grayscale = ColorTypes.Grayscale;
  14784. var RGB = ColorTypes.RGB;
  14785. var CMYK = ColorTypes.CMYK;
  14786. var setFillingColor = function(color) {
  14787. return color.type === Grayscale ? setFillingGrayscaleColor(color.gray) : color.type === RGB ? setFillingRgbColor(color.red, color.green, color.blue) : color.type === CMYK ? setFillingCmykColor(color.cyan, color.magenta, color.yellow, color.key) : error("Invalid color: " + JSON.stringify(color));
  14788. };
  14789. var setStrokingColor = function(color) {
  14790. return color.type === Grayscale ? setStrokingGrayscaleColor(color.gray) : color.type === RGB ? setStrokingRgbColor(color.red, color.green, color.blue) : color.type === CMYK ? setStrokingCmykColor(color.cyan, color.magenta, color.yellow, color.key) : error("Invalid color: " + JSON.stringify(color));
  14791. };
  14792. var componentsToColor = function(comps, scale2) {
  14793. if (scale2 === void 0) {
  14794. scale2 = 1;
  14795. }
  14796. return (comps === null || comps === void 0 ? void 0 : comps.length) === 1 ? grayscale(comps[0] * scale2) : (comps === null || comps === void 0 ? void 0 : comps.length) === 3 ? rgb(comps[0] * scale2, comps[1] * scale2, comps[2] * scale2) : (comps === null || comps === void 0 ? void 0 : comps.length) === 4 ? cmyk(comps[0] * scale2, comps[1] * scale2, comps[2] * scale2, comps[3] * scale2) : void 0;
  14797. };
  14798. var colorToComponents = function(color) {
  14799. return color.type === Grayscale ? [color.gray] : color.type === RGB ? [color.red, color.green, color.blue] : color.type === CMYK ? [color.cyan, color.magenta, color.yellow, color.key] : error("Invalid color: " + JSON.stringify(color));
  14800. };
  14801. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/api/svgPath.js
  14802. var cx = 0;
  14803. var cy = 0;
  14804. var px = 0;
  14805. var py = 0;
  14806. var sx = 0;
  14807. var sy = 0;
  14808. var parameters = /* @__PURE__ */ new Map([
  14809. ["A", 7],
  14810. ["a", 7],
  14811. ["C", 6],
  14812. ["c", 6],
  14813. ["H", 1],
  14814. ["h", 1],
  14815. ["L", 2],
  14816. ["l", 2],
  14817. ["M", 2],
  14818. ["m", 2],
  14819. ["Q", 4],
  14820. ["q", 4],
  14821. ["S", 4],
  14822. ["s", 4],
  14823. ["T", 2],
  14824. ["t", 2],
  14825. ["V", 1],
  14826. ["v", 1],
  14827. ["Z", 0],
  14828. ["z", 0]
  14829. ]);
  14830. var parse = function(path2) {
  14831. var cmd;
  14832. var ret = [];
  14833. var args = [];
  14834. var curArg = "";
  14835. var foundDecimal = false;
  14836. var params = 0;
  14837. for (var _i = 0, path_1 = path2; _i < path_1.length; _i++) {
  14838. var c = path_1[_i];
  14839. if (parameters.has(c)) {
  14840. params = parameters.get(c);
  14841. if (cmd) {
  14842. if (curArg.length > 0) {
  14843. args[args.length] = +curArg;
  14844. }
  14845. ret[ret.length] = { cmd, args };
  14846. args = [];
  14847. curArg = "";
  14848. foundDecimal = false;
  14849. }
  14850. cmd = c;
  14851. } else if ([" ", ","].includes(c) || c === "-" && curArg.length > 0 && curArg[curArg.length - 1] !== "e" || c === "." && foundDecimal) {
  14852. if (curArg.length === 0) {
  14853. continue;
  14854. }
  14855. if (args.length === params) {
  14856. ret[ret.length] = { cmd, args };
  14857. args = [+curArg];
  14858. if (cmd === "M") {
  14859. cmd = "L";
  14860. }
  14861. if (cmd === "m") {
  14862. cmd = "l";
  14863. }
  14864. } else {
  14865. args[args.length] = +curArg;
  14866. }
  14867. foundDecimal = c === ".";
  14868. curArg = ["-", "."].includes(c) ? c : "";
  14869. } else {
  14870. curArg += c;
  14871. if (c === ".") {
  14872. foundDecimal = true;
  14873. }
  14874. }
  14875. }
  14876. if (curArg.length > 0) {
  14877. if (args.length === params) {
  14878. ret[ret.length] = { cmd, args };
  14879. args = [+curArg];
  14880. if (cmd === "M") {
  14881. cmd = "L";
  14882. }
  14883. if (cmd === "m") {
  14884. cmd = "l";
  14885. }
  14886. } else {
  14887. args[args.length] = +curArg;
  14888. }
  14889. }
  14890. ret[ret.length] = { cmd, args };
  14891. return ret;
  14892. };
  14893. var apply = function(commands) {
  14894. cx = cy = px = py = sx = sy = 0;
  14895. var cmds = [];
  14896. for (var i = 0; i < commands.length; i++) {
  14897. var c = commands[i];
  14898. if (c.cmd && typeof runners[c.cmd] === "function") {
  14899. var cmd = runners[c.cmd](c.args);
  14900. if (Array.isArray(cmd)) {
  14901. cmds = cmds.concat(cmd);
  14902. } else {
  14903. cmds.push(cmd);
  14904. }
  14905. }
  14906. }
  14907. return cmds;
  14908. };
  14909. var runners = {
  14910. M: function(a) {
  14911. cx = a[0];
  14912. cy = a[1];
  14913. px = py = null;
  14914. sx = cx;
  14915. sy = cy;
  14916. return moveTo(cx, cy);
  14917. },
  14918. m: function(a) {
  14919. cx += a[0];
  14920. cy += a[1];
  14921. px = py = null;
  14922. sx = cx;
  14923. sy = cy;
  14924. return moveTo(cx, cy);
  14925. },
  14926. C: function(a) {
  14927. cx = a[4];
  14928. cy = a[5];
  14929. px = a[2];
  14930. py = a[3];
  14931. return appendBezierCurve(a[0], a[1], a[2], a[3], a[4], a[5]);
  14932. },
  14933. c: function(a) {
  14934. var cmd = appendBezierCurve(a[0] + cx, a[1] + cy, a[2] + cx, a[3] + cy, a[4] + cx, a[5] + cy);
  14935. px = cx + a[2];
  14936. py = cy + a[3];
  14937. cx += a[4];
  14938. cy += a[5];
  14939. return cmd;
  14940. },
  14941. S: function(a) {
  14942. if (px === null || py === null) {
  14943. px = cx;
  14944. py = cy;
  14945. }
  14946. var cmd = appendBezierCurve(cx - (px - cx), cy - (py - cy), a[0], a[1], a[2], a[3]);
  14947. px = a[0];
  14948. py = a[1];
  14949. cx = a[2];
  14950. cy = a[3];
  14951. return cmd;
  14952. },
  14953. s: function(a) {
  14954. if (px === null || py === null) {
  14955. px = cx;
  14956. py = cy;
  14957. }
  14958. var cmd = appendBezierCurve(cx - (px - cx), cy - (py - cy), cx + a[0], cy + a[1], cx + a[2], cy + a[3]);
  14959. px = cx + a[0];
  14960. py = cy + a[1];
  14961. cx += a[2];
  14962. cy += a[3];
  14963. return cmd;
  14964. },
  14965. Q: function(a) {
  14966. px = a[0];
  14967. py = a[1];
  14968. cx = a[2];
  14969. cy = a[3];
  14970. return appendQuadraticCurve(a[0], a[1], cx, cy);
  14971. },
  14972. q: function(a) {
  14973. var cmd = appendQuadraticCurve(a[0] + cx, a[1] + cy, a[2] + cx, a[3] + cy);
  14974. px = cx + a[0];
  14975. py = cy + a[1];
  14976. cx += a[2];
  14977. cy += a[3];
  14978. return cmd;
  14979. },
  14980. T: function(a) {
  14981. if (px === null || py === null) {
  14982. px = cx;
  14983. py = cy;
  14984. } else {
  14985. px = cx - (px - cx);
  14986. py = cy - (py - cy);
  14987. }
  14988. var cmd = appendQuadraticCurve(px, py, a[0], a[1]);
  14989. px = cx - (px - cx);
  14990. py = cy - (py - cy);
  14991. cx = a[0];
  14992. cy = a[1];
  14993. return cmd;
  14994. },
  14995. t: function(a) {
  14996. if (px === null || py === null) {
  14997. px = cx;
  14998. py = cy;
  14999. } else {
  15000. px = cx - (px - cx);
  15001. py = cy - (py - cy);
  15002. }
  15003. var cmd = appendQuadraticCurve(px, py, cx + a[0], cy + a[1]);
  15004. cx += a[0];
  15005. cy += a[1];
  15006. return cmd;
  15007. },
  15008. A: function(a) {
  15009. var cmds = solveArc(cx, cy, a);
  15010. cx = a[5];
  15011. cy = a[6];
  15012. return cmds;
  15013. },
  15014. a: function(a) {
  15015. a[5] += cx;
  15016. a[6] += cy;
  15017. var cmds = solveArc(cx, cy, a);
  15018. cx = a[5];
  15019. cy = a[6];
  15020. return cmds;
  15021. },
  15022. L: function(a) {
  15023. cx = a[0];
  15024. cy = a[1];
  15025. px = py = null;
  15026. return lineTo(cx, cy);
  15027. },
  15028. l: function(a) {
  15029. cx += a[0];
  15030. cy += a[1];
  15031. px = py = null;
  15032. return lineTo(cx, cy);
  15033. },
  15034. H: function(a) {
  15035. cx = a[0];
  15036. px = py = null;
  15037. return lineTo(cx, cy);
  15038. },
  15039. h: function(a) {
  15040. cx += a[0];
  15041. px = py = null;
  15042. return lineTo(cx, cy);
  15043. },
  15044. V: function(a) {
  15045. cy = a[0];
  15046. px = py = null;
  15047. return lineTo(cx, cy);
  15048. },
  15049. v: function(a) {
  15050. cy += a[0];
  15051. px = py = null;
  15052. return lineTo(cx, cy);
  15053. },
  15054. Z: function() {
  15055. var cmd = closePath();
  15056. cx = sx;
  15057. cy = sy;
  15058. return cmd;
  15059. },
  15060. z: function() {
  15061. var cmd = closePath();
  15062. cx = sx;
  15063. cy = sy;
  15064. return cmd;
  15065. }
  15066. };
  15067. var solveArc = function(x, y, coords) {
  15068. var rx = coords[0], ry = coords[1], rot = coords[2], large = coords[3], sweep = coords[4], ex = coords[5], ey = coords[6];
  15069. var segs = arcToSegments(ex, ey, rx, ry, large, sweep, rot, x, y);
  15070. var cmds = [];
  15071. for (var _i = 0, segs_1 = segs; _i < segs_1.length; _i++) {
  15072. var seg = segs_1[_i];
  15073. var bez = segmentToBezier.apply(void 0, seg);
  15074. cmds.push(appendBezierCurve.apply(void 0, bez));
  15075. }
  15076. return cmds;
  15077. };
  15078. var arcToSegments = function(x, y, rx, ry, large, sweep, rotateX, ox, oy) {
  15079. var th = rotateX * (Math.PI / 180);
  15080. var sinTh = Math.sin(th);
  15081. var cosTh = Math.cos(th);
  15082. rx = Math.abs(rx);
  15083. ry = Math.abs(ry);
  15084. px = cosTh * (ox - x) * 0.5 + sinTh * (oy - y) * 0.5;
  15085. py = cosTh * (oy - y) * 0.5 - sinTh * (ox - x) * 0.5;
  15086. var pl = px * px / (rx * rx) + py * py / (ry * ry);
  15087. if (pl > 1) {
  15088. pl = Math.sqrt(pl);
  15089. rx *= pl;
  15090. ry *= pl;
  15091. }
  15092. var a00 = cosTh / rx;
  15093. var a01 = sinTh / rx;
  15094. var a10 = -sinTh / ry;
  15095. var a11 = cosTh / ry;
  15096. var x0 = a00 * ox + a01 * oy;
  15097. var y0 = a10 * ox + a11 * oy;
  15098. var x1 = a00 * x + a01 * y;
  15099. var y1 = a10 * x + a11 * y;
  15100. var d = (x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0);
  15101. var sfactorSq = 1 / d - 0.25;
  15102. if (sfactorSq < 0) {
  15103. sfactorSq = 0;
  15104. }
  15105. var sfactor = Math.sqrt(sfactorSq);
  15106. if (sweep === large) {
  15107. sfactor = -sfactor;
  15108. }
  15109. var xc = 0.5 * (x0 + x1) - sfactor * (y1 - y0);
  15110. var yc = 0.5 * (y0 + y1) + sfactor * (x1 - x0);
  15111. var th0 = Math.atan2(y0 - yc, x0 - xc);
  15112. var th1 = Math.atan2(y1 - yc, x1 - xc);
  15113. var thArc = th1 - th0;
  15114. if (thArc < 0 && sweep === 1) {
  15115. thArc += 2 * Math.PI;
  15116. } else if (thArc > 0 && sweep === 0) {
  15117. thArc -= 2 * Math.PI;
  15118. }
  15119. var segments = Math.ceil(Math.abs(thArc / (Math.PI * 0.5 + 1e-3)));
  15120. var result = [];
  15121. for (var i = 0; i < segments; i++) {
  15122. var th2 = th0 + i * thArc / segments;
  15123. var th3 = th0 + (i + 1) * thArc / segments;
  15124. result[i] = [xc, yc, th2, th3, rx, ry, sinTh, cosTh];
  15125. }
  15126. return result;
  15127. };
  15128. var segmentToBezier = function(cx1, cy1, th0, th1, rx, ry, sinTh, cosTh) {
  15129. var a00 = cosTh * rx;
  15130. var a01 = -sinTh * ry;
  15131. var a10 = sinTh * rx;
  15132. var a11 = cosTh * ry;
  15133. var thHalf = 0.5 * (th1 - th0);
  15134. var t = 8 / 3 * Math.sin(thHalf * 0.5) * Math.sin(thHalf * 0.5) / Math.sin(thHalf);
  15135. var x1 = cx1 + Math.cos(th0) - t * Math.sin(th0);
  15136. var y1 = cy1 + Math.sin(th0) + t * Math.cos(th0);
  15137. var x3 = cx1 + Math.cos(th1);
  15138. var y3 = cy1 + Math.sin(th1);
  15139. var x2 = x3 + t * Math.sin(th1);
  15140. var y2 = y3 - t * Math.cos(th1);
  15141. var result = [
  15142. a00 * x1 + a01 * y1,
  15143. a10 * x1 + a11 * y1,
  15144. a00 * x2 + a01 * y2,
  15145. a10 * x2 + a11 * y2,
  15146. a00 * x3 + a01 * y3,
  15147. a10 * x3 + a11 * y3
  15148. ];
  15149. return result;
  15150. };
  15151. var svgPathToOperators = function(path2) {
  15152. return apply(parse(path2));
  15153. };
  15154. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/api/operations.js
  15155. var drawLinesOfText = function(lines, options) {
  15156. var operators = [
  15157. pushGraphicsState(),
  15158. options.graphicsState && setGraphicsState(options.graphicsState),
  15159. beginText(),
  15160. setFillingColor(options.color),
  15161. setFontAndSize(options.font, options.size),
  15162. setLineHeight(options.lineHeight),
  15163. rotateAndSkewTextRadiansAndTranslate(toRadians(options.rotate), toRadians(options.xSkew), toRadians(options.ySkew), options.x, options.y)
  15164. ].filter(Boolean);
  15165. for (var idx = 0, len = lines.length; idx < len; idx++) {
  15166. operators.push(showText(lines[idx]), nextLine());
  15167. }
  15168. operators.push(endText(), popGraphicsState());
  15169. return operators;
  15170. };
  15171. var drawImage = function(name, options) {
  15172. return [
  15173. pushGraphicsState(),
  15174. options.graphicsState && setGraphicsState(options.graphicsState),
  15175. translate(options.x, options.y),
  15176. rotateRadians(toRadians(options.rotate)),
  15177. scale(options.width, options.height),
  15178. skewRadians(toRadians(options.xSkew), toRadians(options.ySkew)),
  15179. drawObject(name),
  15180. popGraphicsState()
  15181. ].filter(Boolean);
  15182. };
  15183. var drawPage = function(name, options) {
  15184. return [
  15185. pushGraphicsState(),
  15186. options.graphicsState && setGraphicsState(options.graphicsState),
  15187. translate(options.x, options.y),
  15188. rotateRadians(toRadians(options.rotate)),
  15189. scale(options.xScale, options.yScale),
  15190. skewRadians(toRadians(options.xSkew), toRadians(options.ySkew)),
  15191. drawObject(name),
  15192. popGraphicsState()
  15193. ].filter(Boolean);
  15194. };
  15195. var drawLine = function(options) {
  15196. var _a, _b;
  15197. return [
  15198. pushGraphicsState(),
  15199. options.graphicsState && setGraphicsState(options.graphicsState),
  15200. options.color && setStrokingColor(options.color),
  15201. setLineWidth(options.thickness),
  15202. setDashPattern((_a = options.dashArray) !== null && _a !== void 0 ? _a : [], (_b = options.dashPhase) !== null && _b !== void 0 ? _b : 0),
  15203. moveTo(options.start.x, options.start.y),
  15204. options.lineCap && setLineCap(options.lineCap),
  15205. moveTo(options.start.x, options.start.y),
  15206. lineTo(options.end.x, options.end.y),
  15207. stroke(),
  15208. popGraphicsState()
  15209. ].filter(Boolean);
  15210. };
  15211. var drawRectangle = function(options) {
  15212. var _a, _b;
  15213. return [
  15214. pushGraphicsState(),
  15215. options.graphicsState && setGraphicsState(options.graphicsState),
  15216. options.color && setFillingColor(options.color),
  15217. options.borderColor && setStrokingColor(options.borderColor),
  15218. setLineWidth(options.borderWidth),
  15219. options.borderLineCap && setLineCap(options.borderLineCap),
  15220. setDashPattern((_a = options.borderDashArray) !== null && _a !== void 0 ? _a : [], (_b = options.borderDashPhase) !== null && _b !== void 0 ? _b : 0),
  15221. translate(options.x, options.y),
  15222. rotateRadians(toRadians(options.rotate)),
  15223. skewRadians(toRadians(options.xSkew), toRadians(options.ySkew)),
  15224. moveTo(0, 0),
  15225. lineTo(0, options.height),
  15226. lineTo(options.width, options.height),
  15227. lineTo(options.width, 0),
  15228. closePath(),
  15229. // prettier-ignore
  15230. options.color && options.borderWidth ? fillAndStroke() : options.color ? fill() : options.borderColor ? stroke() : closePath(),
  15231. popGraphicsState()
  15232. ].filter(Boolean);
  15233. };
  15234. var KAPPA = 4 * ((Math.sqrt(2) - 1) / 3);
  15235. var drawEllipsePath = function(config) {
  15236. var x = asNumber(config.x);
  15237. var y = asNumber(config.y);
  15238. var xScale = asNumber(config.xScale);
  15239. var yScale = asNumber(config.yScale);
  15240. x -= xScale;
  15241. y -= yScale;
  15242. var ox = xScale * KAPPA;
  15243. var oy = yScale * KAPPA;
  15244. var xe = x + xScale * 2;
  15245. var ye = y + yScale * 2;
  15246. var xm = x + xScale;
  15247. var ym = y + yScale;
  15248. return [
  15249. pushGraphicsState(),
  15250. moveTo(x, ym),
  15251. appendBezierCurve(x, ym - oy, xm - ox, y, xm, y),
  15252. appendBezierCurve(xm + ox, y, xe, ym - oy, xe, ym),
  15253. appendBezierCurve(xe, ym + oy, xm + ox, ye, xm, ye),
  15254. appendBezierCurve(xm - ox, ye, x, ym + oy, x, ym),
  15255. popGraphicsState()
  15256. ];
  15257. };
  15258. var drawEllipseCurves = function(config) {
  15259. var centerX = asNumber(config.x);
  15260. var centerY = asNumber(config.y);
  15261. var xScale = asNumber(config.xScale);
  15262. var yScale = asNumber(config.yScale);
  15263. var x = -xScale;
  15264. var y = -yScale;
  15265. var ox = xScale * KAPPA;
  15266. var oy = yScale * KAPPA;
  15267. var xe = x + xScale * 2;
  15268. var ye = y + yScale * 2;
  15269. var xm = x + xScale;
  15270. var ym = y + yScale;
  15271. return [
  15272. translate(centerX, centerY),
  15273. rotateRadians(toRadians(config.rotate)),
  15274. moveTo(x, ym),
  15275. appendBezierCurve(x, ym - oy, xm - ox, y, xm, y),
  15276. appendBezierCurve(xm + ox, y, xe, ym - oy, xe, ym),
  15277. appendBezierCurve(xe, ym + oy, xm + ox, ye, xm, ye),
  15278. appendBezierCurve(xm - ox, ye, x, ym + oy, x, ym)
  15279. ];
  15280. };
  15281. var drawEllipse = function(options) {
  15282. var _a, _b, _c;
  15283. return __spreadArrays([
  15284. pushGraphicsState(),
  15285. options.graphicsState && setGraphicsState(options.graphicsState),
  15286. options.color && setFillingColor(options.color),
  15287. options.borderColor && setStrokingColor(options.borderColor),
  15288. setLineWidth(options.borderWidth),
  15289. options.borderLineCap && setLineCap(options.borderLineCap),
  15290. setDashPattern((_a = options.borderDashArray) !== null && _a !== void 0 ? _a : [], (_b = options.borderDashPhase) !== null && _b !== void 0 ? _b : 0)
  15291. ], options.rotate === void 0 ? drawEllipsePath({
  15292. x: options.x,
  15293. y: options.y,
  15294. xScale: options.xScale,
  15295. yScale: options.yScale
  15296. }) : drawEllipseCurves({
  15297. x: options.x,
  15298. y: options.y,
  15299. xScale: options.xScale,
  15300. yScale: options.yScale,
  15301. rotate: (_c = options.rotate) !== null && _c !== void 0 ? _c : degrees(0)
  15302. }), [
  15303. // prettier-ignore
  15304. options.color && options.borderWidth ? fillAndStroke() : options.color ? fill() : options.borderColor ? stroke() : closePath(),
  15305. popGraphicsState()
  15306. ]).filter(Boolean);
  15307. };
  15308. var drawSvgPath = function(path2, options) {
  15309. var _a, _b, _c;
  15310. return __spreadArrays([
  15311. pushGraphicsState(),
  15312. options.graphicsState && setGraphicsState(options.graphicsState),
  15313. translate(options.x, options.y),
  15314. rotateRadians(toRadians((_a = options.rotate) !== null && _a !== void 0 ? _a : degrees(0))),
  15315. // SVG path Y axis is opposite pdf-lib's
  15316. options.scale ? scale(options.scale, -options.scale) : scale(1, -1),
  15317. options.color && setFillingColor(options.color),
  15318. options.borderColor && setStrokingColor(options.borderColor),
  15319. options.borderWidth && setLineWidth(options.borderWidth),
  15320. options.borderLineCap && setLineCap(options.borderLineCap),
  15321. setDashPattern((_b = options.borderDashArray) !== null && _b !== void 0 ? _b : [], (_c = options.borderDashPhase) !== null && _c !== void 0 ? _c : 0)
  15322. ], svgPathToOperators(path2), [
  15323. // prettier-ignore
  15324. options.color && options.borderWidth ? fillAndStroke() : options.color ? fill() : options.borderColor ? stroke() : closePath(),
  15325. popGraphicsState()
  15326. ]).filter(Boolean);
  15327. };
  15328. var drawCheckMark = function(options) {
  15329. var size = asNumber(options.size);
  15330. var p2x = -1 + 0.75;
  15331. var p2y = -1 + 0.51;
  15332. var p3y = 1 - 0.525;
  15333. var p3x = 1 - 0.31;
  15334. var p1x = -1 + 0.325;
  15335. var p1y = -((p1x - p2x) * (p3x - p2x)) / (p3y - p2y) + p2y;
  15336. return [
  15337. pushGraphicsState(),
  15338. options.color && setStrokingColor(options.color),
  15339. setLineWidth(options.thickness),
  15340. translate(options.x, options.y),
  15341. moveTo(p1x * size, p1y * size),
  15342. lineTo(p2x * size, p2y * size),
  15343. lineTo(p3x * size, p3y * size),
  15344. stroke(),
  15345. popGraphicsState()
  15346. ].filter(Boolean);
  15347. };
  15348. var rotateInPlace = function(options) {
  15349. return options.rotation === 0 ? [
  15350. translate(0, 0),
  15351. rotateDegrees(0)
  15352. ] : options.rotation === 90 ? [
  15353. translate(options.width, 0),
  15354. rotateDegrees(90)
  15355. ] : options.rotation === 180 ? [
  15356. translate(options.width, options.height),
  15357. rotateDegrees(180)
  15358. ] : options.rotation === 270 ? [
  15359. translate(0, options.height),
  15360. rotateDegrees(270)
  15361. ] : [];
  15362. };
  15363. var drawCheckBox = function(options) {
  15364. var outline = drawRectangle({
  15365. x: options.x,
  15366. y: options.y,
  15367. width: options.width,
  15368. height: options.height,
  15369. borderWidth: options.borderWidth,
  15370. color: options.color,
  15371. borderColor: options.borderColor,
  15372. rotate: degrees(0),
  15373. xSkew: degrees(0),
  15374. ySkew: degrees(0)
  15375. });
  15376. if (!options.filled)
  15377. return outline;
  15378. var width = asNumber(options.width);
  15379. var height = asNumber(options.height);
  15380. var checkMarkSize = Math.min(width, height) / 2;
  15381. var checkMark = drawCheckMark({
  15382. x: width / 2,
  15383. y: height / 2,
  15384. size: checkMarkSize,
  15385. thickness: options.thickness,
  15386. color: options.markColor
  15387. });
  15388. return __spreadArrays([pushGraphicsState()], outline, checkMark, [popGraphicsState()]);
  15389. };
  15390. var drawRadioButton = function(options) {
  15391. var width = asNumber(options.width);
  15392. var height = asNumber(options.height);
  15393. var outlineScale = Math.min(width, height) / 2;
  15394. var outline = drawEllipse({
  15395. x: options.x,
  15396. y: options.y,
  15397. xScale: outlineScale,
  15398. yScale: outlineScale,
  15399. color: options.color,
  15400. borderColor: options.borderColor,
  15401. borderWidth: options.borderWidth
  15402. });
  15403. if (!options.filled)
  15404. return outline;
  15405. var dot = drawEllipse({
  15406. x: options.x,
  15407. y: options.y,
  15408. xScale: outlineScale * 0.45,
  15409. yScale: outlineScale * 0.45,
  15410. color: options.dotColor,
  15411. borderColor: void 0,
  15412. borderWidth: 0
  15413. });
  15414. return __spreadArrays([pushGraphicsState()], outline, dot, [popGraphicsState()]);
  15415. };
  15416. var drawButton = function(options) {
  15417. var x = asNumber(options.x);
  15418. var y = asNumber(options.y);
  15419. var width = asNumber(options.width);
  15420. var height = asNumber(options.height);
  15421. var background = drawRectangle({
  15422. x,
  15423. y,
  15424. width,
  15425. height,
  15426. borderWidth: options.borderWidth,
  15427. color: options.color,
  15428. borderColor: options.borderColor,
  15429. rotate: degrees(0),
  15430. xSkew: degrees(0),
  15431. ySkew: degrees(0)
  15432. });
  15433. var lines = drawTextLines(options.textLines, {
  15434. color: options.textColor,
  15435. font: options.font,
  15436. size: options.fontSize,
  15437. rotate: degrees(0),
  15438. xSkew: degrees(0),
  15439. ySkew: degrees(0)
  15440. });
  15441. return __spreadArrays([pushGraphicsState()], background, lines, [popGraphicsState()]);
  15442. };
  15443. var drawTextLines = function(lines, options) {
  15444. var operators = [
  15445. beginText(),
  15446. setFillingColor(options.color),
  15447. setFontAndSize(options.font, options.size)
  15448. ];
  15449. for (var idx = 0, len = lines.length; idx < len; idx++) {
  15450. var _a = lines[idx], encoded = _a.encoded, x = _a.x, y = _a.y;
  15451. operators.push(rotateAndSkewTextRadiansAndTranslate(toRadians(options.rotate), toRadians(options.xSkew), toRadians(options.ySkew), x, y), showText(encoded));
  15452. }
  15453. operators.push(endText());
  15454. return operators;
  15455. };
  15456. var drawTextField = function(options) {
  15457. var x = asNumber(options.x);
  15458. var y = asNumber(options.y);
  15459. var width = asNumber(options.width);
  15460. var height = asNumber(options.height);
  15461. var borderWidth = asNumber(options.borderWidth);
  15462. var padding = asNumber(options.padding);
  15463. var clipX = x + borderWidth / 2 + padding;
  15464. var clipY = y + borderWidth / 2 + padding;
  15465. var clipWidth = width - (borderWidth / 2 + padding) * 2;
  15466. var clipHeight = height - (borderWidth / 2 + padding) * 2;
  15467. var clippingArea = [
  15468. moveTo(clipX, clipY),
  15469. lineTo(clipX, clipY + clipHeight),
  15470. lineTo(clipX + clipWidth, clipY + clipHeight),
  15471. lineTo(clipX + clipWidth, clipY),
  15472. closePath(),
  15473. clip(),
  15474. endPath()
  15475. ];
  15476. var background = drawRectangle({
  15477. x,
  15478. y,
  15479. width,
  15480. height,
  15481. borderWidth: options.borderWidth,
  15482. color: options.color,
  15483. borderColor: options.borderColor,
  15484. rotate: degrees(0),
  15485. xSkew: degrees(0),
  15486. ySkew: degrees(0)
  15487. });
  15488. var lines = drawTextLines(options.textLines, {
  15489. color: options.textColor,
  15490. font: options.font,
  15491. size: options.fontSize,
  15492. rotate: degrees(0),
  15493. xSkew: degrees(0),
  15494. ySkew: degrees(0)
  15495. });
  15496. var markedContent = __spreadArrays([
  15497. beginMarkedContent("Tx"),
  15498. pushGraphicsState()
  15499. ], lines, [
  15500. popGraphicsState(),
  15501. endMarkedContent()
  15502. ]);
  15503. return __spreadArrays([
  15504. pushGraphicsState()
  15505. ], background, clippingArea, markedContent, [
  15506. popGraphicsState()
  15507. ]);
  15508. };
  15509. var drawOptionList = function(options) {
  15510. var x = asNumber(options.x);
  15511. var y = asNumber(options.y);
  15512. var width = asNumber(options.width);
  15513. var height = asNumber(options.height);
  15514. var lineHeight = asNumber(options.lineHeight);
  15515. var borderWidth = asNumber(options.borderWidth);
  15516. var padding = asNumber(options.padding);
  15517. var clipX = x + borderWidth / 2 + padding;
  15518. var clipY = y + borderWidth / 2 + padding;
  15519. var clipWidth = width - (borderWidth / 2 + padding) * 2;
  15520. var clipHeight = height - (borderWidth / 2 + padding) * 2;
  15521. var clippingArea = [
  15522. moveTo(clipX, clipY),
  15523. lineTo(clipX, clipY + clipHeight),
  15524. lineTo(clipX + clipWidth, clipY + clipHeight),
  15525. lineTo(clipX + clipWidth, clipY),
  15526. closePath(),
  15527. clip(),
  15528. endPath()
  15529. ];
  15530. var background = drawRectangle({
  15531. x,
  15532. y,
  15533. width,
  15534. height,
  15535. borderWidth: options.borderWidth,
  15536. color: options.color,
  15537. borderColor: options.borderColor,
  15538. rotate: degrees(0),
  15539. xSkew: degrees(0),
  15540. ySkew: degrees(0)
  15541. });
  15542. var highlights = [];
  15543. for (var idx = 0, len = options.selectedLines.length; idx < len; idx++) {
  15544. var line = options.textLines[options.selectedLines[idx]];
  15545. highlights.push.apply(highlights, drawRectangle({
  15546. x: line.x - padding,
  15547. y: line.y - (lineHeight - line.height) / 2,
  15548. width: width - borderWidth,
  15549. height: line.height + (lineHeight - line.height) / 2,
  15550. borderWidth: 0,
  15551. color: options.selectedColor,
  15552. borderColor: void 0,
  15553. rotate: degrees(0),
  15554. xSkew: degrees(0),
  15555. ySkew: degrees(0)
  15556. }));
  15557. }
  15558. var lines = drawTextLines(options.textLines, {
  15559. color: options.textColor,
  15560. font: options.font,
  15561. size: options.fontSize,
  15562. rotate: degrees(0),
  15563. xSkew: degrees(0),
  15564. ySkew: degrees(0)
  15565. });
  15566. var markedContent = __spreadArrays([
  15567. beginMarkedContent("Tx"),
  15568. pushGraphicsState()
  15569. ], lines, [
  15570. popGraphicsState(),
  15571. endMarkedContent()
  15572. ]);
  15573. return __spreadArrays([
  15574. pushGraphicsState()
  15575. ], background, highlights, clippingArea, markedContent, [
  15576. popGraphicsState()
  15577. ]);
  15578. };
  15579. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/api/errors.js
  15580. var EncryptedPDFError = (
  15581. /** @class */
  15582. function(_super) {
  15583. __extends(EncryptedPDFError2, _super);
  15584. function EncryptedPDFError2() {
  15585. var _this = this;
  15586. var msg = "Input document to `PDFDocument.load` is encrypted. You can use `PDFDocument.load(..., { ignoreEncryption: true })` if you wish to load the document anyways.";
  15587. _this = _super.call(this, msg) || this;
  15588. return _this;
  15589. }
  15590. return EncryptedPDFError2;
  15591. }(Error)
  15592. );
  15593. var FontkitNotRegisteredError = (
  15594. /** @class */
  15595. function(_super) {
  15596. __extends(FontkitNotRegisteredError2, _super);
  15597. function FontkitNotRegisteredError2() {
  15598. var _this = this;
  15599. var msg = "Input to `PDFDocument.embedFont` was a custom font, but no `fontkit` instance was found. You must register a `fontkit` instance with `PDFDocument.registerFontkit(...)` before embedding custom fonts.";
  15600. _this = _super.call(this, msg) || this;
  15601. return _this;
  15602. }
  15603. return FontkitNotRegisteredError2;
  15604. }(Error)
  15605. );
  15606. var ForeignPageError = (
  15607. /** @class */
  15608. function(_super) {
  15609. __extends(ForeignPageError2, _super);
  15610. function ForeignPageError2() {
  15611. var _this = this;
  15612. var msg = "A `page` passed to `PDFDocument.addPage` or `PDFDocument.insertPage` was from a different (foreign) PDF document. If you want to copy pages from one PDFDocument to another, you must use `PDFDocument.copyPages(...)` to copy the pages before adding or inserting them.";
  15613. _this = _super.call(this, msg) || this;
  15614. return _this;
  15615. }
  15616. return ForeignPageError2;
  15617. }(Error)
  15618. );
  15619. var RemovePageFromEmptyDocumentError = (
  15620. /** @class */
  15621. function(_super) {
  15622. __extends(RemovePageFromEmptyDocumentError2, _super);
  15623. function RemovePageFromEmptyDocumentError2() {
  15624. var _this = this;
  15625. var msg = "PDFDocument has no pages so `PDFDocument.removePage` cannot be called";
  15626. _this = _super.call(this, msg) || this;
  15627. return _this;
  15628. }
  15629. return RemovePageFromEmptyDocumentError2;
  15630. }(Error)
  15631. );
  15632. var NoSuchFieldError = (
  15633. /** @class */
  15634. function(_super) {
  15635. __extends(NoSuchFieldError2, _super);
  15636. function NoSuchFieldError2(name) {
  15637. var _this = this;
  15638. var msg = 'PDFDocument has no form field with the name "' + name + '"';
  15639. _this = _super.call(this, msg) || this;
  15640. return _this;
  15641. }
  15642. return NoSuchFieldError2;
  15643. }(Error)
  15644. );
  15645. var UnexpectedFieldTypeError = (
  15646. /** @class */
  15647. function(_super) {
  15648. __extends(UnexpectedFieldTypeError2, _super);
  15649. function UnexpectedFieldTypeError2(name, expected, actual) {
  15650. var _a, _b;
  15651. var _this = this;
  15652. var expectedType = expected === null || expected === void 0 ? void 0 : expected.name;
  15653. var actualType = (_b = (_a = actual === null || actual === void 0 ? void 0 : actual.constructor) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : actual;
  15654. var msg = 'Expected field "' + name + '" to be of type ' + expectedType + ", " + ("but it is actually of type " + actualType);
  15655. _this = _super.call(this, msg) || this;
  15656. return _this;
  15657. }
  15658. return UnexpectedFieldTypeError2;
  15659. }(Error)
  15660. );
  15661. var MissingOnValueCheckError = (
  15662. /** @class */
  15663. function(_super) {
  15664. __extends(MissingOnValueCheckError2, _super);
  15665. function MissingOnValueCheckError2(onValue) {
  15666. var _this = this;
  15667. var msg = 'Failed to select check box due to missing onValue: "' + onValue + '"';
  15668. _this = _super.call(this, msg) || this;
  15669. return _this;
  15670. }
  15671. return MissingOnValueCheckError2;
  15672. }(Error)
  15673. );
  15674. var FieldAlreadyExistsError = (
  15675. /** @class */
  15676. function(_super) {
  15677. __extends(FieldAlreadyExistsError2, _super);
  15678. function FieldAlreadyExistsError2(name) {
  15679. var _this = this;
  15680. var msg = 'A field already exists with the specified name: "' + name + '"';
  15681. _this = _super.call(this, msg) || this;
  15682. return _this;
  15683. }
  15684. return FieldAlreadyExistsError2;
  15685. }(Error)
  15686. );
  15687. var InvalidFieldNamePartError = (
  15688. /** @class */
  15689. function(_super) {
  15690. __extends(InvalidFieldNamePartError2, _super);
  15691. function InvalidFieldNamePartError2(namePart) {
  15692. var _this = this;
  15693. var msg = 'Field name contains invalid component: "' + namePart + '"';
  15694. _this = _super.call(this, msg) || this;
  15695. return _this;
  15696. }
  15697. return InvalidFieldNamePartError2;
  15698. }(Error)
  15699. );
  15700. var FieldExistsAsNonTerminalError = (
  15701. /** @class */
  15702. function(_super) {
  15703. __extends(FieldExistsAsNonTerminalError2, _super);
  15704. function FieldExistsAsNonTerminalError2(name) {
  15705. var _this = this;
  15706. var msg = 'A non-terminal field already exists with the specified name: "' + name + '"';
  15707. _this = _super.call(this, msg) || this;
  15708. return _this;
  15709. }
  15710. return FieldExistsAsNonTerminalError2;
  15711. }(Error)
  15712. );
  15713. var RichTextFieldReadError = (
  15714. /** @class */
  15715. function(_super) {
  15716. __extends(RichTextFieldReadError2, _super);
  15717. function RichTextFieldReadError2(fieldName) {
  15718. var _this = this;
  15719. var msg = "Reading rich text fields is not supported: Attempted to read rich text field: " + fieldName;
  15720. _this = _super.call(this, msg) || this;
  15721. return _this;
  15722. }
  15723. return RichTextFieldReadError2;
  15724. }(Error)
  15725. );
  15726. var CombedTextLayoutError = (
  15727. /** @class */
  15728. function(_super) {
  15729. __extends(CombedTextLayoutError2, _super);
  15730. function CombedTextLayoutError2(lineLength, cellCount) {
  15731. var _this = this;
  15732. var msg = "Failed to layout combed text as lineLength=" + lineLength + " is greater than cellCount=" + cellCount;
  15733. _this = _super.call(this, msg) || this;
  15734. return _this;
  15735. }
  15736. return CombedTextLayoutError2;
  15737. }(Error)
  15738. );
  15739. var ExceededMaxLengthError = (
  15740. /** @class */
  15741. function(_super) {
  15742. __extends(ExceededMaxLengthError2, _super);
  15743. function ExceededMaxLengthError2(textLength, maxLength, name) {
  15744. var _this = this;
  15745. var msg = "Attempted to set text with length=" + textLength + " for TextField with maxLength=" + maxLength + " and name=" + name;
  15746. _this = _super.call(this, msg) || this;
  15747. return _this;
  15748. }
  15749. return ExceededMaxLengthError2;
  15750. }(Error)
  15751. );
  15752. var InvalidMaxLengthError = (
  15753. /** @class */
  15754. function(_super) {
  15755. __extends(InvalidMaxLengthError2, _super);
  15756. function InvalidMaxLengthError2(textLength, maxLength, name) {
  15757. var _this = this;
  15758. var msg = "Attempted to set maxLength=" + maxLength + ", which is less than " + textLength + ", the length of this field's current value (name=" + name + ")";
  15759. _this = _super.call(this, msg) || this;
  15760. return _this;
  15761. }
  15762. return InvalidMaxLengthError2;
  15763. }(Error)
  15764. );
  15765. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/api/text/alignment.js
  15766. var TextAlignment;
  15767. (function(TextAlignment2) {
  15768. TextAlignment2[TextAlignment2["Left"] = 0] = "Left";
  15769. TextAlignment2[TextAlignment2["Center"] = 1] = "Center";
  15770. TextAlignment2[TextAlignment2["Right"] = 2] = "Right";
  15771. })(TextAlignment || (TextAlignment = {}));
  15772. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/api/text/layout.js
  15773. var MIN_FONT_SIZE = 4;
  15774. var MAX_FONT_SIZE = 500;
  15775. var computeFontSize = function(lines, font, bounds, multiline) {
  15776. if (multiline === void 0) {
  15777. multiline = false;
  15778. }
  15779. var fontSize = MIN_FONT_SIZE;
  15780. while (fontSize < MAX_FONT_SIZE) {
  15781. var linesUsed = 0;
  15782. for (var lineIdx = 0, lineLen = lines.length; lineIdx < lineLen; lineIdx++) {
  15783. linesUsed += 1;
  15784. var line = lines[lineIdx];
  15785. var words = line.split(" ");
  15786. var spaceInLineRemaining = bounds.width;
  15787. for (var idx = 0, len = words.length; idx < len; idx++) {
  15788. var isLastWord = idx === len - 1;
  15789. var word = isLastWord ? words[idx] : words[idx] + " ";
  15790. var widthOfWord = font.widthOfTextAtSize(word, fontSize);
  15791. spaceInLineRemaining -= widthOfWord;
  15792. if (spaceInLineRemaining <= 0) {
  15793. linesUsed += 1;
  15794. spaceInLineRemaining = bounds.width - widthOfWord;
  15795. }
  15796. }
  15797. }
  15798. if (!multiline && linesUsed > lines.length)
  15799. return fontSize - 1;
  15800. var height = font.heightAtSize(fontSize);
  15801. var lineHeight = height + height * 0.2;
  15802. var totalHeight = lineHeight * linesUsed;
  15803. if (totalHeight > Math.abs(bounds.height))
  15804. return fontSize - 1;
  15805. fontSize += 1;
  15806. }
  15807. return fontSize;
  15808. };
  15809. var computeCombedFontSize = function(line, font, bounds, cellCount) {
  15810. var cellWidth = bounds.width / cellCount;
  15811. var cellHeight = bounds.height;
  15812. var fontSize = MIN_FONT_SIZE;
  15813. var chars3 = charSplit(line);
  15814. while (fontSize < MAX_FONT_SIZE) {
  15815. for (var idx = 0, len = chars3.length; idx < len; idx++) {
  15816. var c = chars3[idx];
  15817. var tooLong = font.widthOfTextAtSize(c, fontSize) > cellWidth * 0.75;
  15818. if (tooLong)
  15819. return fontSize - 1;
  15820. }
  15821. var height = font.heightAtSize(fontSize, { descender: false });
  15822. if (height > cellHeight)
  15823. return fontSize - 1;
  15824. fontSize += 1;
  15825. }
  15826. return fontSize;
  15827. };
  15828. var lastIndexOfWhitespace = function(line) {
  15829. for (var idx = line.length; idx > 0; idx--) {
  15830. if (/\s/.test(line[idx]))
  15831. return idx;
  15832. }
  15833. return void 0;
  15834. };
  15835. var splitOutLines = function(input, maxWidth, font, fontSize) {
  15836. var _a;
  15837. var lastWhitespaceIdx = input.length;
  15838. while (lastWhitespaceIdx > 0) {
  15839. var line = input.substring(0, lastWhitespaceIdx);
  15840. var encoded = font.encodeText(line);
  15841. var width = font.widthOfTextAtSize(line, fontSize);
  15842. if (width < maxWidth) {
  15843. var remainder = input.substring(lastWhitespaceIdx) || void 0;
  15844. return { line, encoded, width, remainder };
  15845. }
  15846. lastWhitespaceIdx = (_a = lastIndexOfWhitespace(line)) !== null && _a !== void 0 ? _a : 0;
  15847. }
  15848. return {
  15849. line: input,
  15850. encoded: font.encodeText(input),
  15851. width: font.widthOfTextAtSize(input, fontSize),
  15852. remainder: void 0
  15853. };
  15854. };
  15855. var layoutMultilineText = function(text, _a) {
  15856. var alignment = _a.alignment, fontSize = _a.fontSize, font = _a.font, bounds = _a.bounds;
  15857. var lines = lineSplit(cleanText(text));
  15858. if (fontSize === void 0 || fontSize === 0) {
  15859. fontSize = computeFontSize(lines, font, bounds, true);
  15860. }
  15861. var height = font.heightAtSize(fontSize);
  15862. var lineHeight = height + height * 0.2;
  15863. var textLines = [];
  15864. var minX = bounds.x;
  15865. var minY = bounds.y;
  15866. var maxX = bounds.x + bounds.width;
  15867. var maxY = bounds.y + bounds.height;
  15868. var y = bounds.y + bounds.height;
  15869. for (var idx = 0, len = lines.length; idx < len; idx++) {
  15870. var prevRemainder = lines[idx];
  15871. while (prevRemainder !== void 0) {
  15872. var _b = splitOutLines(prevRemainder, bounds.width, font, fontSize), line = _b.line, encoded = _b.encoded, width = _b.width, remainder = _b.remainder;
  15873. var x = alignment === TextAlignment.Left ? bounds.x : alignment === TextAlignment.Center ? bounds.x + bounds.width / 2 - width / 2 : alignment === TextAlignment.Right ? bounds.x + bounds.width - width : bounds.x;
  15874. y -= lineHeight;
  15875. if (x < minX)
  15876. minX = x;
  15877. if (y < minY)
  15878. minY = y;
  15879. if (x + width > maxX)
  15880. maxX = x + width;
  15881. if (y + height > maxY)
  15882. maxY = y + height;
  15883. textLines.push({ text: line, encoded, width, height, x, y });
  15884. prevRemainder = remainder === null || remainder === void 0 ? void 0 : remainder.trim();
  15885. }
  15886. }
  15887. return {
  15888. fontSize,
  15889. lineHeight,
  15890. lines: textLines,
  15891. bounds: {
  15892. x: minX,
  15893. y: minY,
  15894. width: maxX - minX,
  15895. height: maxY - minY
  15896. }
  15897. };
  15898. };
  15899. var layoutCombedText = function(text, _a) {
  15900. var fontSize = _a.fontSize, font = _a.font, bounds = _a.bounds, cellCount = _a.cellCount;
  15901. var line = mergeLines(cleanText(text));
  15902. if (line.length > cellCount) {
  15903. throw new CombedTextLayoutError(line.length, cellCount);
  15904. }
  15905. if (fontSize === void 0 || fontSize === 0) {
  15906. fontSize = computeCombedFontSize(line, font, bounds, cellCount);
  15907. }
  15908. var cellWidth = bounds.width / cellCount;
  15909. var height = font.heightAtSize(fontSize, { descender: false });
  15910. var y = bounds.y + (bounds.height / 2 - height / 2);
  15911. var cells = [];
  15912. var minX = bounds.x;
  15913. var minY = bounds.y;
  15914. var maxX = bounds.x + bounds.width;
  15915. var maxY = bounds.y + bounds.height;
  15916. var cellOffset = 0;
  15917. var charOffset = 0;
  15918. while (cellOffset < cellCount) {
  15919. var _b = charAtIndex(line, charOffset), char = _b[0], charLength = _b[1];
  15920. var encoded = font.encodeText(char);
  15921. var width = font.widthOfTextAtSize(char, fontSize);
  15922. var cellCenter = bounds.x + (cellWidth * cellOffset + cellWidth / 2);
  15923. var x = cellCenter - width / 2;
  15924. if (x < minX)
  15925. minX = x;
  15926. if (y < minY)
  15927. minY = y;
  15928. if (x + width > maxX)
  15929. maxX = x + width;
  15930. if (y + height > maxY)
  15931. maxY = y + height;
  15932. cells.push({ text: line, encoded, width, height, x, y });
  15933. cellOffset += 1;
  15934. charOffset += charLength;
  15935. }
  15936. return {
  15937. fontSize,
  15938. cells,
  15939. bounds: {
  15940. x: minX,
  15941. y: minY,
  15942. width: maxX - minX,
  15943. height: maxY - minY
  15944. }
  15945. };
  15946. };
  15947. var layoutSinglelineText = function(text, _a) {
  15948. var alignment = _a.alignment, fontSize = _a.fontSize, font = _a.font, bounds = _a.bounds;
  15949. var line = mergeLines(cleanText(text));
  15950. if (fontSize === void 0 || fontSize === 0) {
  15951. fontSize = computeFontSize([line], font, bounds);
  15952. }
  15953. var encoded = font.encodeText(line);
  15954. var width = font.widthOfTextAtSize(line, fontSize);
  15955. var height = font.heightAtSize(fontSize, { descender: false });
  15956. var x = alignment === TextAlignment.Left ? bounds.x : alignment === TextAlignment.Center ? bounds.x + bounds.width / 2 - width / 2 : alignment === TextAlignment.Right ? bounds.x + bounds.width - width : bounds.x;
  15957. var y = bounds.y + (bounds.height / 2 - height / 2);
  15958. return {
  15959. fontSize,
  15960. line: { text: line, encoded, width, height, x, y },
  15961. bounds: { x, y, width, height }
  15962. };
  15963. };
  15964. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/api/form/appearances.js
  15965. var normalizeAppearance = function(appearance) {
  15966. if ("normal" in appearance)
  15967. return appearance;
  15968. return { normal: appearance };
  15969. };
  15970. var tfRegex2 = /\/([^\0\t\n\f\r\ ]+)[\0\t\n\f\r\ ]+(\d*\.\d+|\d+)[\0\t\n\f\r\ ]+Tf/;
  15971. var getDefaultFontSize = function(field) {
  15972. var _a, _b;
  15973. var da = (_a = field.getDefaultAppearance()) !== null && _a !== void 0 ? _a : "";
  15974. var daMatch = (_b = findLastMatch(da, tfRegex2).match) !== null && _b !== void 0 ? _b : [];
  15975. var defaultFontSize = Number(daMatch[2]);
  15976. return isFinite(defaultFontSize) ? defaultFontSize : void 0;
  15977. };
  15978. var colorRegex = /(\d*\.\d+|\d+)[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]+(g|rg|k)/;
  15979. var getDefaultColor = function(field) {
  15980. var _a;
  15981. var da = (_a = field.getDefaultAppearance()) !== null && _a !== void 0 ? _a : "";
  15982. var daMatch = findLastMatch(da, colorRegex).match;
  15983. var _b = daMatch !== null && daMatch !== void 0 ? daMatch : [], c1 = _b[1], c2 = _b[2], c3 = _b[3], c4 = _b[4], colorSpace = _b[5];
  15984. if (colorSpace === "g" && c1) {
  15985. return grayscale(Number(c1));
  15986. }
  15987. if (colorSpace === "rg" && c1 && c2 && c3) {
  15988. return rgb(Number(c1), Number(c2), Number(c3));
  15989. }
  15990. if (colorSpace === "k" && c1 && c2 && c3 && c4) {
  15991. return cmyk(Number(c1), Number(c2), Number(c3), Number(c4));
  15992. }
  15993. return void 0;
  15994. };
  15995. var updateDefaultAppearance = function(field, color, font, fontSize) {
  15996. var _a;
  15997. if (fontSize === void 0) {
  15998. fontSize = 0;
  15999. }
  16000. var da = [
  16001. setFillingColor(color).toString(),
  16002. setFontAndSize((_a = font === null || font === void 0 ? void 0 : font.name) !== null && _a !== void 0 ? _a : "dummy__noop", fontSize).toString()
  16003. ].join("\n");
  16004. field.setDefaultAppearance(da);
  16005. };
  16006. var defaultCheckBoxAppearanceProvider = function(checkBox, widget) {
  16007. var _a, _b, _c;
  16008. var widgetColor = getDefaultColor(widget);
  16009. var fieldColor = getDefaultColor(checkBox.acroField);
  16010. var rectangle = widget.getRectangle();
  16011. var ap = widget.getAppearanceCharacteristics();
  16012. var bs = widget.getBorderStyle();
  16013. var borderWidth = (_a = bs === null || bs === void 0 ? void 0 : bs.getWidth()) !== null && _a !== void 0 ? _a : 0;
  16014. var rotation = reduceRotation(ap === null || ap === void 0 ? void 0 : ap.getRotation());
  16015. var _d = adjustDimsForRotation(rectangle, rotation), width = _d.width, height = _d.height;
  16016. var rotate = rotateInPlace(__assign(__assign({}, rectangle), { rotation }));
  16017. var black = rgb(0, 0, 0);
  16018. var borderColor = (_b = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBorderColor())) !== null && _b !== void 0 ? _b : black;
  16019. var normalBackgroundColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBackgroundColor());
  16020. var downBackgroundColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBackgroundColor(), 0.8);
  16021. var textColor = (_c = widgetColor !== null && widgetColor !== void 0 ? widgetColor : fieldColor) !== null && _c !== void 0 ? _c : black;
  16022. if (widgetColor) {
  16023. updateDefaultAppearance(widget, textColor);
  16024. } else {
  16025. updateDefaultAppearance(checkBox.acroField, textColor);
  16026. }
  16027. var options = {
  16028. x: 0 + borderWidth / 2,
  16029. y: 0 + borderWidth / 2,
  16030. width: width - borderWidth,
  16031. height: height - borderWidth,
  16032. thickness: 1.5,
  16033. borderWidth,
  16034. borderColor,
  16035. markColor: textColor
  16036. };
  16037. return {
  16038. normal: {
  16039. on: __spreadArrays(rotate, drawCheckBox(__assign(__assign({}, options), { color: normalBackgroundColor, filled: true }))),
  16040. off: __spreadArrays(rotate, drawCheckBox(__assign(__assign({}, options), { color: normalBackgroundColor, filled: false })))
  16041. },
  16042. down: {
  16043. on: __spreadArrays(rotate, drawCheckBox(__assign(__assign({}, options), { color: downBackgroundColor, filled: true }))),
  16044. off: __spreadArrays(rotate, drawCheckBox(__assign(__assign({}, options), { color: downBackgroundColor, filled: false })))
  16045. }
  16046. };
  16047. };
  16048. var defaultRadioGroupAppearanceProvider = function(radioGroup, widget) {
  16049. var _a, _b, _c;
  16050. var widgetColor = getDefaultColor(widget);
  16051. var fieldColor = getDefaultColor(radioGroup.acroField);
  16052. var rectangle = widget.getRectangle();
  16053. var ap = widget.getAppearanceCharacteristics();
  16054. var bs = widget.getBorderStyle();
  16055. var borderWidth = (_a = bs === null || bs === void 0 ? void 0 : bs.getWidth()) !== null && _a !== void 0 ? _a : 0;
  16056. var rotation = reduceRotation(ap === null || ap === void 0 ? void 0 : ap.getRotation());
  16057. var _d = adjustDimsForRotation(rectangle, rotation), width = _d.width, height = _d.height;
  16058. var rotate = rotateInPlace(__assign(__assign({}, rectangle), { rotation }));
  16059. var black = rgb(0, 0, 0);
  16060. var borderColor = (_b = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBorderColor())) !== null && _b !== void 0 ? _b : black;
  16061. var normalBackgroundColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBackgroundColor());
  16062. var downBackgroundColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBackgroundColor(), 0.8);
  16063. var textColor = (_c = widgetColor !== null && widgetColor !== void 0 ? widgetColor : fieldColor) !== null && _c !== void 0 ? _c : black;
  16064. if (widgetColor) {
  16065. updateDefaultAppearance(widget, textColor);
  16066. } else {
  16067. updateDefaultAppearance(radioGroup.acroField, textColor);
  16068. }
  16069. var options = {
  16070. x: width / 2,
  16071. y: height / 2,
  16072. width: width - borderWidth,
  16073. height: height - borderWidth,
  16074. borderWidth,
  16075. borderColor,
  16076. dotColor: textColor
  16077. };
  16078. return {
  16079. normal: {
  16080. on: __spreadArrays(rotate, drawRadioButton(__assign(__assign({}, options), { color: normalBackgroundColor, filled: true }))),
  16081. off: __spreadArrays(rotate, drawRadioButton(__assign(__assign({}, options), { color: normalBackgroundColor, filled: false })))
  16082. },
  16083. down: {
  16084. on: __spreadArrays(rotate, drawRadioButton(__assign(__assign({}, options), { color: downBackgroundColor, filled: true }))),
  16085. off: __spreadArrays(rotate, drawRadioButton(__assign(__assign({}, options), { color: downBackgroundColor, filled: false })))
  16086. }
  16087. };
  16088. };
  16089. var defaultButtonAppearanceProvider = function(button, widget, font) {
  16090. var _a, _b, _c, _d, _e;
  16091. var widgetColor = getDefaultColor(widget);
  16092. var fieldColor = getDefaultColor(button.acroField);
  16093. var widgetFontSize = getDefaultFontSize(widget);
  16094. var fieldFontSize = getDefaultFontSize(button.acroField);
  16095. var rectangle = widget.getRectangle();
  16096. var ap = widget.getAppearanceCharacteristics();
  16097. var bs = widget.getBorderStyle();
  16098. var captions = ap === null || ap === void 0 ? void 0 : ap.getCaptions();
  16099. var normalText = (_a = captions === null || captions === void 0 ? void 0 : captions.normal) !== null && _a !== void 0 ? _a : "";
  16100. var downText = (_c = (_b = captions === null || captions === void 0 ? void 0 : captions.down) !== null && _b !== void 0 ? _b : normalText) !== null && _c !== void 0 ? _c : "";
  16101. var borderWidth = (_d = bs === null || bs === void 0 ? void 0 : bs.getWidth()) !== null && _d !== void 0 ? _d : 0;
  16102. var rotation = reduceRotation(ap === null || ap === void 0 ? void 0 : ap.getRotation());
  16103. var _f = adjustDimsForRotation(rectangle, rotation), width = _f.width, height = _f.height;
  16104. var rotate = rotateInPlace(__assign(__assign({}, rectangle), { rotation }));
  16105. var black = rgb(0, 0, 0);
  16106. var borderColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBorderColor());
  16107. var normalBackgroundColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBackgroundColor());
  16108. var downBackgroundColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBackgroundColor(), 0.8);
  16109. var bounds = {
  16110. x: borderWidth,
  16111. y: borderWidth,
  16112. width: width - borderWidth * 2,
  16113. height: height - borderWidth * 2
  16114. };
  16115. var normalLayout = layoutSinglelineText(normalText, {
  16116. alignment: TextAlignment.Center,
  16117. fontSize: widgetFontSize !== null && widgetFontSize !== void 0 ? widgetFontSize : fieldFontSize,
  16118. font,
  16119. bounds
  16120. });
  16121. var downLayout = layoutSinglelineText(downText, {
  16122. alignment: TextAlignment.Center,
  16123. fontSize: widgetFontSize !== null && widgetFontSize !== void 0 ? widgetFontSize : fieldFontSize,
  16124. font,
  16125. bounds
  16126. });
  16127. var fontSize = Math.min(normalLayout.fontSize, downLayout.fontSize);
  16128. var textColor = (_e = widgetColor !== null && widgetColor !== void 0 ? widgetColor : fieldColor) !== null && _e !== void 0 ? _e : black;
  16129. if (widgetColor || widgetFontSize !== void 0) {
  16130. updateDefaultAppearance(widget, textColor, font, fontSize);
  16131. } else {
  16132. updateDefaultAppearance(button.acroField, textColor, font, fontSize);
  16133. }
  16134. var options = {
  16135. x: 0 + borderWidth / 2,
  16136. y: 0 + borderWidth / 2,
  16137. width: width - borderWidth,
  16138. height: height - borderWidth,
  16139. borderWidth,
  16140. borderColor,
  16141. textColor,
  16142. font: font.name,
  16143. fontSize
  16144. };
  16145. return {
  16146. normal: __spreadArrays(rotate, drawButton(__assign(__assign({}, options), { color: normalBackgroundColor, textLines: [normalLayout.line] }))),
  16147. down: __spreadArrays(rotate, drawButton(__assign(__assign({}, options), { color: downBackgroundColor, textLines: [downLayout.line] })))
  16148. };
  16149. };
  16150. var defaultTextFieldAppearanceProvider = function(textField, widget, font) {
  16151. var _a, _b, _c, _d;
  16152. var widgetColor = getDefaultColor(widget);
  16153. var fieldColor = getDefaultColor(textField.acroField);
  16154. var widgetFontSize = getDefaultFontSize(widget);
  16155. var fieldFontSize = getDefaultFontSize(textField.acroField);
  16156. var rectangle = widget.getRectangle();
  16157. var ap = widget.getAppearanceCharacteristics();
  16158. var bs = widget.getBorderStyle();
  16159. var text = (_a = textField.getText()) !== null && _a !== void 0 ? _a : "";
  16160. var borderWidth = (_b = bs === null || bs === void 0 ? void 0 : bs.getWidth()) !== null && _b !== void 0 ? _b : 0;
  16161. var rotation = reduceRotation(ap === null || ap === void 0 ? void 0 : ap.getRotation());
  16162. var _e = adjustDimsForRotation(rectangle, rotation), width = _e.width, height = _e.height;
  16163. var rotate = rotateInPlace(__assign(__assign({}, rectangle), { rotation }));
  16164. var black = rgb(0, 0, 0);
  16165. var borderColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBorderColor());
  16166. var normalBackgroundColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBackgroundColor());
  16167. var textLines;
  16168. var fontSize;
  16169. var padding = textField.isCombed() ? 0 : 1;
  16170. var bounds = {
  16171. x: borderWidth + padding,
  16172. y: borderWidth + padding,
  16173. width: width - (borderWidth + padding) * 2,
  16174. height: height - (borderWidth + padding) * 2
  16175. };
  16176. if (textField.isMultiline()) {
  16177. var layout = layoutMultilineText(text, {
  16178. alignment: textField.getAlignment(),
  16179. fontSize: widgetFontSize !== null && widgetFontSize !== void 0 ? widgetFontSize : fieldFontSize,
  16180. font,
  16181. bounds
  16182. });
  16183. textLines = layout.lines;
  16184. fontSize = layout.fontSize;
  16185. } else if (textField.isCombed()) {
  16186. var layout = layoutCombedText(text, {
  16187. fontSize: widgetFontSize !== null && widgetFontSize !== void 0 ? widgetFontSize : fieldFontSize,
  16188. font,
  16189. bounds,
  16190. cellCount: (_c = textField.getMaxLength()) !== null && _c !== void 0 ? _c : 0
  16191. });
  16192. textLines = layout.cells;
  16193. fontSize = layout.fontSize;
  16194. } else {
  16195. var layout = layoutSinglelineText(text, {
  16196. alignment: textField.getAlignment(),
  16197. fontSize: widgetFontSize !== null && widgetFontSize !== void 0 ? widgetFontSize : fieldFontSize,
  16198. font,
  16199. bounds
  16200. });
  16201. textLines = [layout.line];
  16202. fontSize = layout.fontSize;
  16203. }
  16204. var textColor = (_d = widgetColor !== null && widgetColor !== void 0 ? widgetColor : fieldColor) !== null && _d !== void 0 ? _d : black;
  16205. if (widgetColor || widgetFontSize !== void 0) {
  16206. updateDefaultAppearance(widget, textColor, font, fontSize);
  16207. } else {
  16208. updateDefaultAppearance(textField.acroField, textColor, font, fontSize);
  16209. }
  16210. var options = {
  16211. x: 0 + borderWidth / 2,
  16212. y: 0 + borderWidth / 2,
  16213. width: width - borderWidth,
  16214. height: height - borderWidth,
  16215. borderWidth: borderWidth !== null && borderWidth !== void 0 ? borderWidth : 0,
  16216. borderColor,
  16217. textColor,
  16218. font: font.name,
  16219. fontSize,
  16220. color: normalBackgroundColor,
  16221. textLines,
  16222. padding
  16223. };
  16224. return __spreadArrays(rotate, drawTextField(options));
  16225. };
  16226. var defaultDropdownAppearanceProvider = function(dropdown, widget, font) {
  16227. var _a, _b, _c;
  16228. var widgetColor = getDefaultColor(widget);
  16229. var fieldColor = getDefaultColor(dropdown.acroField);
  16230. var widgetFontSize = getDefaultFontSize(widget);
  16231. var fieldFontSize = getDefaultFontSize(dropdown.acroField);
  16232. var rectangle = widget.getRectangle();
  16233. var ap = widget.getAppearanceCharacteristics();
  16234. var bs = widget.getBorderStyle();
  16235. var text = (_a = dropdown.getSelected()[0]) !== null && _a !== void 0 ? _a : "";
  16236. var borderWidth = (_b = bs === null || bs === void 0 ? void 0 : bs.getWidth()) !== null && _b !== void 0 ? _b : 0;
  16237. var rotation = reduceRotation(ap === null || ap === void 0 ? void 0 : ap.getRotation());
  16238. var _d = adjustDimsForRotation(rectangle, rotation), width = _d.width, height = _d.height;
  16239. var rotate = rotateInPlace(__assign(__assign({}, rectangle), { rotation }));
  16240. var black = rgb(0, 0, 0);
  16241. var borderColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBorderColor());
  16242. var normalBackgroundColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBackgroundColor());
  16243. var padding = 1;
  16244. var bounds = {
  16245. x: borderWidth + padding,
  16246. y: borderWidth + padding,
  16247. width: width - (borderWidth + padding) * 2,
  16248. height: height - (borderWidth + padding) * 2
  16249. };
  16250. var _e = layoutSinglelineText(text, {
  16251. alignment: TextAlignment.Left,
  16252. fontSize: widgetFontSize !== null && widgetFontSize !== void 0 ? widgetFontSize : fieldFontSize,
  16253. font,
  16254. bounds
  16255. }), line = _e.line, fontSize = _e.fontSize;
  16256. var textColor = (_c = widgetColor !== null && widgetColor !== void 0 ? widgetColor : fieldColor) !== null && _c !== void 0 ? _c : black;
  16257. if (widgetColor || widgetFontSize !== void 0) {
  16258. updateDefaultAppearance(widget, textColor, font, fontSize);
  16259. } else {
  16260. updateDefaultAppearance(dropdown.acroField, textColor, font, fontSize);
  16261. }
  16262. var options = {
  16263. x: 0 + borderWidth / 2,
  16264. y: 0 + borderWidth / 2,
  16265. width: width - borderWidth,
  16266. height: height - borderWidth,
  16267. borderWidth: borderWidth !== null && borderWidth !== void 0 ? borderWidth : 0,
  16268. borderColor,
  16269. textColor,
  16270. font: font.name,
  16271. fontSize,
  16272. color: normalBackgroundColor,
  16273. textLines: [line],
  16274. padding
  16275. };
  16276. return __spreadArrays(rotate, drawTextField(options));
  16277. };
  16278. var defaultOptionListAppearanceProvider = function(optionList, widget, font) {
  16279. var _a, _b;
  16280. var widgetColor = getDefaultColor(widget);
  16281. var fieldColor = getDefaultColor(optionList.acroField);
  16282. var widgetFontSize = getDefaultFontSize(widget);
  16283. var fieldFontSize = getDefaultFontSize(optionList.acroField);
  16284. var rectangle = widget.getRectangle();
  16285. var ap = widget.getAppearanceCharacteristics();
  16286. var bs = widget.getBorderStyle();
  16287. var borderWidth = (_a = bs === null || bs === void 0 ? void 0 : bs.getWidth()) !== null && _a !== void 0 ? _a : 0;
  16288. var rotation = reduceRotation(ap === null || ap === void 0 ? void 0 : ap.getRotation());
  16289. var _c = adjustDimsForRotation(rectangle, rotation), width = _c.width, height = _c.height;
  16290. var rotate = rotateInPlace(__assign(__assign({}, rectangle), { rotation }));
  16291. var black = rgb(0, 0, 0);
  16292. var borderColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBorderColor());
  16293. var normalBackgroundColor = componentsToColor(ap === null || ap === void 0 ? void 0 : ap.getBackgroundColor());
  16294. var options = optionList.getOptions();
  16295. var selected = optionList.getSelected();
  16296. if (optionList.isSorted())
  16297. options.sort();
  16298. var text = "";
  16299. for (var idx = 0, len = options.length; idx < len; idx++) {
  16300. text += options[idx];
  16301. if (idx < len - 1)
  16302. text += "\n";
  16303. }
  16304. var padding = 1;
  16305. var bounds = {
  16306. x: borderWidth + padding,
  16307. y: borderWidth + padding,
  16308. width: width - (borderWidth + padding) * 2,
  16309. height: height - (borderWidth + padding) * 2
  16310. };
  16311. var _d = layoutMultilineText(text, {
  16312. alignment: TextAlignment.Left,
  16313. fontSize: widgetFontSize !== null && widgetFontSize !== void 0 ? widgetFontSize : fieldFontSize,
  16314. font,
  16315. bounds
  16316. }), lines = _d.lines, fontSize = _d.fontSize, lineHeight = _d.lineHeight;
  16317. var selectedLines = [];
  16318. for (var idx = 0, len = lines.length; idx < len; idx++) {
  16319. var line = lines[idx];
  16320. if (selected.includes(line.text))
  16321. selectedLines.push(idx);
  16322. }
  16323. var blue = rgb(153 / 255, 193 / 255, 218 / 255);
  16324. var textColor = (_b = widgetColor !== null && widgetColor !== void 0 ? widgetColor : fieldColor) !== null && _b !== void 0 ? _b : black;
  16325. if (widgetColor || widgetFontSize !== void 0) {
  16326. updateDefaultAppearance(widget, textColor, font, fontSize);
  16327. } else {
  16328. updateDefaultAppearance(optionList.acroField, textColor, font, fontSize);
  16329. }
  16330. return __spreadArrays(rotate, drawOptionList({
  16331. x: 0 + borderWidth / 2,
  16332. y: 0 + borderWidth / 2,
  16333. width: width - borderWidth,
  16334. height: height - borderWidth,
  16335. borderWidth: borderWidth !== null && borderWidth !== void 0 ? borderWidth : 0,
  16336. borderColor,
  16337. textColor,
  16338. font: font.name,
  16339. fontSize,
  16340. color: normalBackgroundColor,
  16341. textLines: lines,
  16342. lineHeight,
  16343. selectedColor: blue,
  16344. selectedLines,
  16345. padding
  16346. }));
  16347. };
  16348. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/api/PDFEmbeddedPage.js
  16349. var PDFEmbeddedPage = (
  16350. /** @class */
  16351. function() {
  16352. function PDFEmbeddedPage2(ref, doc, embedder) {
  16353. this.alreadyEmbedded = false;
  16354. assertIs(ref, "ref", [[PDFRef_default, "PDFRef"]]);
  16355. assertIs(doc, "doc", [[PDFDocument_default, "PDFDocument"]]);
  16356. assertIs(embedder, "embedder", [[PDFPageEmbedder_default, "PDFPageEmbedder"]]);
  16357. this.ref = ref;
  16358. this.doc = doc;
  16359. this.width = embedder.width;
  16360. this.height = embedder.height;
  16361. this.embedder = embedder;
  16362. }
  16363. PDFEmbeddedPage2.prototype.scale = function(factor) {
  16364. assertIs(factor, "factor", ["number"]);
  16365. return { width: this.width * factor, height: this.height * factor };
  16366. };
  16367. PDFEmbeddedPage2.prototype.size = function() {
  16368. return this.scale(1);
  16369. };
  16370. PDFEmbeddedPage2.prototype.embed = function() {
  16371. return __awaiter(this, void 0, void 0, function() {
  16372. return __generator(this, function(_a) {
  16373. switch (_a.label) {
  16374. case 0:
  16375. if (!!this.alreadyEmbedded) return [3, 2];
  16376. return [4, this.embedder.embedIntoContext(this.doc.context, this.ref)];
  16377. case 1:
  16378. _a.sent();
  16379. this.alreadyEmbedded = true;
  16380. _a.label = 2;
  16381. case 2:
  16382. return [
  16383. 2
  16384. /*return*/
  16385. ];
  16386. }
  16387. });
  16388. });
  16389. };
  16390. PDFEmbeddedPage2.of = function(ref, doc, embedder) {
  16391. return new PDFEmbeddedPage2(ref, doc, embedder);
  16392. };
  16393. return PDFEmbeddedPage2;
  16394. }()
  16395. );
  16396. var PDFEmbeddedPage_default = PDFEmbeddedPage;
  16397. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/api/PDFFont.js
  16398. var PDFFont = (
  16399. /** @class */
  16400. function() {
  16401. function PDFFont2(ref, doc, embedder) {
  16402. this.modified = true;
  16403. assertIs(ref, "ref", [[PDFRef_default, "PDFRef"]]);
  16404. assertIs(doc, "doc", [[PDFDocument_default, "PDFDocument"]]);
  16405. assertIs(embedder, "embedder", [
  16406. [CustomFontEmbedder_default, "CustomFontEmbedder"],
  16407. [StandardFontEmbedder_default, "StandardFontEmbedder"]
  16408. ]);
  16409. this.ref = ref;
  16410. this.doc = doc;
  16411. this.name = embedder.fontName;
  16412. this.embedder = embedder;
  16413. }
  16414. PDFFont2.prototype.encodeText = function(text) {
  16415. assertIs(text, "text", ["string"]);
  16416. this.modified = true;
  16417. return this.embedder.encodeText(text);
  16418. };
  16419. PDFFont2.prototype.widthOfTextAtSize = function(text, size) {
  16420. assertIs(text, "text", ["string"]);
  16421. assertIs(size, "size", ["number"]);
  16422. return this.embedder.widthOfTextAtSize(text, size);
  16423. };
  16424. PDFFont2.prototype.heightAtSize = function(size, options) {
  16425. var _a;
  16426. assertIs(size, "size", ["number"]);
  16427. assertOrUndefined(options === null || options === void 0 ? void 0 : options.descender, "options.descender", ["boolean"]);
  16428. return this.embedder.heightOfFontAtSize(size, {
  16429. descender: (_a = options === null || options === void 0 ? void 0 : options.descender) !== null && _a !== void 0 ? _a : true
  16430. });
  16431. };
  16432. PDFFont2.prototype.sizeAtHeight = function(height) {
  16433. assertIs(height, "height", ["number"]);
  16434. return this.embedder.sizeOfFontAtHeight(height);
  16435. };
  16436. PDFFont2.prototype.getCharacterSet = function() {
  16437. if (this.embedder instanceof StandardFontEmbedder_default) {
  16438. return this.embedder.encoding.supportedCodePoints;
  16439. } else {
  16440. return this.embedder.font.characterSet;
  16441. }
  16442. };
  16443. PDFFont2.prototype.embed = function() {
  16444. return __awaiter(this, void 0, void 0, function() {
  16445. return __generator(this, function(_a) {
  16446. switch (_a.label) {
  16447. case 0:
  16448. if (!this.modified) return [3, 2];
  16449. return [4, this.embedder.embedIntoContext(this.doc.context, this.ref)];
  16450. case 1:
  16451. _a.sent();
  16452. this.modified = false;
  16453. _a.label = 2;
  16454. case 2:
  16455. return [
  16456. 2
  16457. /*return*/
  16458. ];
  16459. }
  16460. });
  16461. });
  16462. };
  16463. PDFFont2.of = function(ref, doc, embedder) {
  16464. return new PDFFont2(ref, doc, embedder);
  16465. };
  16466. return PDFFont2;
  16467. }()
  16468. );
  16469. var PDFFont_default = PDFFont;
  16470. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/api/PDFImage.js
  16471. var PDFImage = (
  16472. /** @class */
  16473. function() {
  16474. function PDFImage2(ref, doc, embedder) {
  16475. assertIs(ref, "ref", [[PDFRef_default, "PDFRef"]]);
  16476. assertIs(doc, "doc", [[PDFDocument_default, "PDFDocument"]]);
  16477. assertIs(embedder, "embedder", [
  16478. [JpegEmbedder_default, "JpegEmbedder"],
  16479. [PngEmbedder_default, "PngEmbedder"]
  16480. ]);
  16481. this.ref = ref;
  16482. this.doc = doc;
  16483. this.width = embedder.width;
  16484. this.height = embedder.height;
  16485. this.embedder = embedder;
  16486. }
  16487. PDFImage2.prototype.scale = function(factor) {
  16488. assertIs(factor, "factor", ["number"]);
  16489. return { width: this.width * factor, height: this.height * factor };
  16490. };
  16491. PDFImage2.prototype.scaleToFit = function(width, height) {
  16492. assertIs(width, "width", ["number"]);
  16493. assertIs(height, "height", ["number"]);
  16494. var imgWidthScale = width / this.width;
  16495. var imgHeightScale = height / this.height;
  16496. var scale2 = Math.min(imgWidthScale, imgHeightScale);
  16497. return this.scale(scale2);
  16498. };
  16499. PDFImage2.prototype.size = function() {
  16500. return this.scale(1);
  16501. };
  16502. PDFImage2.prototype.embed = function() {
  16503. return __awaiter(this, void 0, void 0, function() {
  16504. var _a, doc, ref;
  16505. return __generator(this, function(_b) {
  16506. switch (_b.label) {
  16507. case 0:
  16508. if (!this.embedder)
  16509. return [
  16510. 2
  16511. /*return*/
  16512. ];
  16513. if (!this.embedTask) {
  16514. _a = this, doc = _a.doc, ref = _a.ref;
  16515. this.embedTask = this.embedder.embedIntoContext(doc.context, ref);
  16516. }
  16517. return [4, this.embedTask];
  16518. case 1:
  16519. _b.sent();
  16520. this.embedder = void 0;
  16521. return [
  16522. 2
  16523. /*return*/
  16524. ];
  16525. }
  16526. });
  16527. });
  16528. };
  16529. PDFImage2.of = function(ref, doc, embedder) {
  16530. return new PDFImage2(ref, doc, embedder);
  16531. };
  16532. return PDFImage2;
  16533. }()
  16534. );
  16535. var PDFImage_default = PDFImage;
  16536. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/api/image/alignment.js
  16537. var ImageAlignment;
  16538. (function(ImageAlignment2) {
  16539. ImageAlignment2[ImageAlignment2["Left"] = 0] = "Left";
  16540. ImageAlignment2[ImageAlignment2["Center"] = 1] = "Center";
  16541. ImageAlignment2[ImageAlignment2["Right"] = 2] = "Right";
  16542. })(ImageAlignment || (ImageAlignment = {}));
  16543. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/api/form/PDFField.js
  16544. var assertFieldAppearanceOptions = function(options) {
  16545. assertOrUndefined(options === null || options === void 0 ? void 0 : options.x, "options.x", ["number"]);
  16546. assertOrUndefined(options === null || options === void 0 ? void 0 : options.y, "options.y", ["number"]);
  16547. assertOrUndefined(options === null || options === void 0 ? void 0 : options.width, "options.width", ["number"]);
  16548. assertOrUndefined(options === null || options === void 0 ? void 0 : options.height, "options.height", ["number"]);
  16549. assertOrUndefined(options === null || options === void 0 ? void 0 : options.textColor, "options.textColor", [
  16550. [Object, "Color"]
  16551. ]);
  16552. assertOrUndefined(options === null || options === void 0 ? void 0 : options.backgroundColor, "options.backgroundColor", [
  16553. [Object, "Color"]
  16554. ]);
  16555. assertOrUndefined(options === null || options === void 0 ? void 0 : options.borderColor, "options.borderColor", [
  16556. [Object, "Color"]
  16557. ]);
  16558. assertOrUndefined(options === null || options === void 0 ? void 0 : options.borderWidth, "options.borderWidth", ["number"]);
  16559. assertOrUndefined(options === null || options === void 0 ? void 0 : options.rotate, "options.rotate", [[Object, "Rotation"]]);
  16560. };
  16561. var PDFField = (
  16562. /** @class */
  16563. function() {
  16564. function PDFField2(acroField, ref, doc) {
  16565. assertIs(acroField, "acroField", [[PDFAcroTerminal_default, "PDFAcroTerminal"]]);
  16566. assertIs(ref, "ref", [[PDFRef_default, "PDFRef"]]);
  16567. assertIs(doc, "doc", [[PDFDocument_default, "PDFDocument"]]);
  16568. this.acroField = acroField;
  16569. this.ref = ref;
  16570. this.doc = doc;
  16571. }
  16572. PDFField2.prototype.getName = function() {
  16573. var _a;
  16574. return (_a = this.acroField.getFullyQualifiedName()) !== null && _a !== void 0 ? _a : "";
  16575. };
  16576. PDFField2.prototype.isReadOnly = function() {
  16577. return this.acroField.hasFlag(AcroFieldFlags.ReadOnly);
  16578. };
  16579. PDFField2.prototype.enableReadOnly = function() {
  16580. this.acroField.setFlagTo(AcroFieldFlags.ReadOnly, true);
  16581. };
  16582. PDFField2.prototype.disableReadOnly = function() {
  16583. this.acroField.setFlagTo(AcroFieldFlags.ReadOnly, false);
  16584. };
  16585. PDFField2.prototype.isRequired = function() {
  16586. return this.acroField.hasFlag(AcroFieldFlags.Required);
  16587. };
  16588. PDFField2.prototype.enableRequired = function() {
  16589. this.acroField.setFlagTo(AcroFieldFlags.Required, true);
  16590. };
  16591. PDFField2.prototype.disableRequired = function() {
  16592. this.acroField.setFlagTo(AcroFieldFlags.Required, false);
  16593. };
  16594. PDFField2.prototype.isExported = function() {
  16595. return !this.acroField.hasFlag(AcroFieldFlags.NoExport);
  16596. };
  16597. PDFField2.prototype.enableExporting = function() {
  16598. this.acroField.setFlagTo(AcroFieldFlags.NoExport, false);
  16599. };
  16600. PDFField2.prototype.disableExporting = function() {
  16601. this.acroField.setFlagTo(AcroFieldFlags.NoExport, true);
  16602. };
  16603. PDFField2.prototype.needsAppearancesUpdate = function() {
  16604. throw new MethodNotImplementedError(this.constructor.name, "needsAppearancesUpdate");
  16605. };
  16606. PDFField2.prototype.defaultUpdateAppearances = function(_font) {
  16607. throw new MethodNotImplementedError(this.constructor.name, "defaultUpdateAppearances");
  16608. };
  16609. PDFField2.prototype.markAsDirty = function() {
  16610. this.doc.getForm().markFieldAsDirty(this.ref);
  16611. };
  16612. PDFField2.prototype.markAsClean = function() {
  16613. this.doc.getForm().markFieldAsClean(this.ref);
  16614. };
  16615. PDFField2.prototype.isDirty = function() {
  16616. return this.doc.getForm().fieldIsDirty(this.ref);
  16617. };
  16618. PDFField2.prototype.createWidget = function(options) {
  16619. var _a;
  16620. var textColor = options.textColor;
  16621. var backgroundColor = options.backgroundColor;
  16622. var borderColor = options.borderColor;
  16623. var borderWidth = options.borderWidth;
  16624. var degreesAngle = toDegrees(options.rotate);
  16625. var caption = options.caption;
  16626. var x = options.x;
  16627. var y = options.y;
  16628. var width = options.width + borderWidth;
  16629. var height = options.height + borderWidth;
  16630. var hidden = Boolean(options.hidden);
  16631. var pageRef = options.page;
  16632. assertMultiple(degreesAngle, "degreesAngle", 90);
  16633. var widget = PDFWidgetAnnotation_default.create(this.doc.context, this.ref);
  16634. var rect = rotateRectangle({ x, y, width, height }, borderWidth, degreesAngle);
  16635. widget.setRectangle(rect);
  16636. if (pageRef)
  16637. widget.setP(pageRef);
  16638. var ac = widget.getOrCreateAppearanceCharacteristics();
  16639. if (backgroundColor) {
  16640. ac.setBackgroundColor(colorToComponents(backgroundColor));
  16641. }
  16642. ac.setRotation(degreesAngle);
  16643. if (caption)
  16644. ac.setCaptions({ normal: caption });
  16645. if (borderColor)
  16646. ac.setBorderColor(colorToComponents(borderColor));
  16647. var bs = widget.getOrCreateBorderStyle();
  16648. if (borderWidth !== void 0)
  16649. bs.setWidth(borderWidth);
  16650. widget.setFlagTo(AnnotationFlags.Print, true);
  16651. widget.setFlagTo(AnnotationFlags.Hidden, hidden);
  16652. widget.setFlagTo(AnnotationFlags.Invisible, false);
  16653. if (textColor) {
  16654. var da = (_a = this.acroField.getDefaultAppearance()) !== null && _a !== void 0 ? _a : "";
  16655. var newDa = da + "\n" + setFillingColor(textColor).toString();
  16656. this.acroField.setDefaultAppearance(newDa);
  16657. }
  16658. return widget;
  16659. };
  16660. PDFField2.prototype.updateWidgetAppearanceWithFont = function(widget, font, _a) {
  16661. var normal = _a.normal, rollover = _a.rollover, down = _a.down;
  16662. this.updateWidgetAppearances(widget, {
  16663. normal: this.createAppearanceStream(widget, normal, font),
  16664. rollover: rollover && this.createAppearanceStream(widget, rollover, font),
  16665. down: down && this.createAppearanceStream(widget, down, font)
  16666. });
  16667. };
  16668. PDFField2.prototype.updateOnOffWidgetAppearance = function(widget, onValue, _a) {
  16669. var normal = _a.normal, rollover = _a.rollover, down = _a.down;
  16670. this.updateWidgetAppearances(widget, {
  16671. normal: this.createAppearanceDict(widget, normal, onValue),
  16672. rollover: rollover && this.createAppearanceDict(widget, rollover, onValue),
  16673. down: down && this.createAppearanceDict(widget, down, onValue)
  16674. });
  16675. };
  16676. PDFField2.prototype.updateWidgetAppearances = function(widget, _a) {
  16677. var normal = _a.normal, rollover = _a.rollover, down = _a.down;
  16678. widget.setNormalAppearance(normal);
  16679. if (rollover) {
  16680. widget.setRolloverAppearance(rollover);
  16681. } else {
  16682. widget.removeRolloverAppearance();
  16683. }
  16684. if (down) {
  16685. widget.setDownAppearance(down);
  16686. } else {
  16687. widget.removeDownAppearance();
  16688. }
  16689. };
  16690. PDFField2.prototype.createAppearanceStream = function(widget, appearance, font) {
  16691. var _a;
  16692. var context = this.acroField.dict.context;
  16693. var _b = widget.getRectangle(), width = _b.width, height = _b.height;
  16694. var Resources = font && { Font: (_a = {}, _a[font.name] = font.ref, _a) };
  16695. var stream2 = context.formXObject(appearance, {
  16696. Resources,
  16697. BBox: context.obj([0, 0, width, height]),
  16698. Matrix: context.obj([1, 0, 0, 1, 0, 0])
  16699. });
  16700. var streamRef = context.register(stream2);
  16701. return streamRef;
  16702. };
  16703. PDFField2.prototype.createImageAppearanceStream = function(widget, image, alignment) {
  16704. var _a;
  16705. var _b;
  16706. var context = this.acroField.dict.context;
  16707. var rectangle = widget.getRectangle();
  16708. var ap = widget.getAppearanceCharacteristics();
  16709. var bs = widget.getBorderStyle();
  16710. var borderWidth = (_b = bs === null || bs === void 0 ? void 0 : bs.getWidth()) !== null && _b !== void 0 ? _b : 0;
  16711. var rotation = reduceRotation(ap === null || ap === void 0 ? void 0 : ap.getRotation());
  16712. var rotate = rotateInPlace(__assign(__assign({}, rectangle), { rotation }));
  16713. var adj = adjustDimsForRotation(rectangle, rotation);
  16714. var imageDims = image.scaleToFit(adj.width - borderWidth * 2, adj.height - borderWidth * 2);
  16715. var options = {
  16716. x: borderWidth,
  16717. y: borderWidth,
  16718. width: imageDims.width,
  16719. height: imageDims.height,
  16720. //
  16721. rotate: degrees(0),
  16722. xSkew: degrees(0),
  16723. ySkew: degrees(0)
  16724. };
  16725. if (alignment === ImageAlignment.Center) {
  16726. options.x += (adj.width - borderWidth * 2) / 2 - imageDims.width / 2;
  16727. options.y += (adj.height - borderWidth * 2) / 2 - imageDims.height / 2;
  16728. } else if (alignment === ImageAlignment.Right) {
  16729. options.x = adj.width - borderWidth - imageDims.width;
  16730. options.y = adj.height - borderWidth - imageDims.height;
  16731. }
  16732. var imageName = this.doc.context.addRandomSuffix("Image", 10);
  16733. var appearance = __spreadArrays(rotate, drawImage(imageName, options));
  16734. var Resources = { XObject: (_a = {}, _a[imageName] = image.ref, _a) };
  16735. var stream2 = context.formXObject(appearance, {
  16736. Resources,
  16737. BBox: context.obj([0, 0, rectangle.width, rectangle.height]),
  16738. Matrix: context.obj([1, 0, 0, 1, 0, 0])
  16739. });
  16740. return context.register(stream2);
  16741. };
  16742. PDFField2.prototype.createAppearanceDict = function(widget, appearance, onValue) {
  16743. var context = this.acroField.dict.context;
  16744. var onStreamRef = this.createAppearanceStream(widget, appearance.on);
  16745. var offStreamRef = this.createAppearanceStream(widget, appearance.off);
  16746. var appearanceDict = context.obj({});
  16747. appearanceDict.set(onValue, onStreamRef);
  16748. appearanceDict.set(PDFName_default.of("Off"), offStreamRef);
  16749. return appearanceDict;
  16750. };
  16751. return PDFField2;
  16752. }()
  16753. );
  16754. var PDFField_default = PDFField;
  16755. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/api/form/PDFCheckBox.js
  16756. var PDFCheckBox = (
  16757. /** @class */
  16758. function(_super) {
  16759. __extends(PDFCheckBox2, _super);
  16760. function PDFCheckBox2(acroCheckBox, ref, doc) {
  16761. var _this = _super.call(this, acroCheckBox, ref, doc) || this;
  16762. assertIs(acroCheckBox, "acroCheckBox", [
  16763. [PDFAcroCheckBox_default, "PDFAcroCheckBox"]
  16764. ]);
  16765. _this.acroField = acroCheckBox;
  16766. return _this;
  16767. }
  16768. PDFCheckBox2.prototype.check = function() {
  16769. var _a;
  16770. var onValue = (_a = this.acroField.getOnValue()) !== null && _a !== void 0 ? _a : PDFName_default.of("Yes");
  16771. this.markAsDirty();
  16772. this.acroField.setValue(onValue);
  16773. };
  16774. PDFCheckBox2.prototype.uncheck = function() {
  16775. this.markAsDirty();
  16776. this.acroField.setValue(PDFName_default.of("Off"));
  16777. };
  16778. PDFCheckBox2.prototype.isChecked = function() {
  16779. var onValue = this.acroField.getOnValue();
  16780. return !!onValue && onValue === this.acroField.getValue();
  16781. };
  16782. PDFCheckBox2.prototype.addToPage = function(page, options) {
  16783. var _a, _b, _c, _d, _e, _f;
  16784. assertIs(page, "page", [[PDFPage_default, "PDFPage"]]);
  16785. assertFieldAppearanceOptions(options);
  16786. if (!options)
  16787. options = {};
  16788. if (!("textColor" in options))
  16789. options.textColor = rgb(0, 0, 0);
  16790. if (!("backgroundColor" in options))
  16791. options.backgroundColor = rgb(1, 1, 1);
  16792. if (!("borderColor" in options))
  16793. options.borderColor = rgb(0, 0, 0);
  16794. if (!("borderWidth" in options))
  16795. options.borderWidth = 1;
  16796. var widget = this.createWidget({
  16797. x: (_a = options.x) !== null && _a !== void 0 ? _a : 0,
  16798. y: (_b = options.y) !== null && _b !== void 0 ? _b : 0,
  16799. width: (_c = options.width) !== null && _c !== void 0 ? _c : 50,
  16800. height: (_d = options.height) !== null && _d !== void 0 ? _d : 50,
  16801. textColor: options.textColor,
  16802. backgroundColor: options.backgroundColor,
  16803. borderColor: options.borderColor,
  16804. borderWidth: (_e = options.borderWidth) !== null && _e !== void 0 ? _e : 0,
  16805. rotate: (_f = options.rotate) !== null && _f !== void 0 ? _f : degrees(0),
  16806. hidden: options.hidden,
  16807. page: page.ref
  16808. });
  16809. var widgetRef = this.doc.context.register(widget.dict);
  16810. this.acroField.addWidget(widgetRef);
  16811. widget.setAppearanceState(PDFName_default.of("Off"));
  16812. this.updateWidgetAppearance(widget, PDFName_default.of("Yes"));
  16813. page.node.addAnnot(widgetRef);
  16814. };
  16815. PDFCheckBox2.prototype.needsAppearancesUpdate = function() {
  16816. var _a;
  16817. var widgets = this.acroField.getWidgets();
  16818. for (var idx = 0, len = widgets.length; idx < len; idx++) {
  16819. var widget = widgets[idx];
  16820. var state = widget.getAppearanceState();
  16821. var normal = (_a = widget.getAppearances()) === null || _a === void 0 ? void 0 : _a.normal;
  16822. if (!(normal instanceof PDFDict_default))
  16823. return true;
  16824. if (state && !normal.has(state))
  16825. return true;
  16826. }
  16827. return false;
  16828. };
  16829. PDFCheckBox2.prototype.defaultUpdateAppearances = function() {
  16830. this.updateAppearances();
  16831. };
  16832. PDFCheckBox2.prototype.updateAppearances = function(provider) {
  16833. var _a;
  16834. assertOrUndefined(provider, "provider", [Function]);
  16835. var widgets = this.acroField.getWidgets();
  16836. for (var idx = 0, len = widgets.length; idx < len; idx++) {
  16837. var widget = widgets[idx];
  16838. var onValue = (_a = widget.getOnValue()) !== null && _a !== void 0 ? _a : PDFName_default.of("Yes");
  16839. if (!onValue)
  16840. continue;
  16841. this.updateWidgetAppearance(widget, onValue, provider);
  16842. }
  16843. this.markAsClean();
  16844. };
  16845. PDFCheckBox2.prototype.updateWidgetAppearance = function(widget, onValue, provider) {
  16846. var apProvider = provider !== null && provider !== void 0 ? provider : defaultCheckBoxAppearanceProvider;
  16847. var appearances = normalizeAppearance(apProvider(this, widget));
  16848. this.updateOnOffWidgetAppearance(widget, onValue, appearances);
  16849. };
  16850. PDFCheckBox2.of = function(acroCheckBox, ref, doc) {
  16851. return new PDFCheckBox2(acroCheckBox, ref, doc);
  16852. };
  16853. return PDFCheckBox2;
  16854. }(PDFField_default)
  16855. );
  16856. var PDFCheckBox_default = PDFCheckBox;
  16857. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/api/form/PDFDropdown.js
  16858. var PDFDropdown = (
  16859. /** @class */
  16860. function(_super) {
  16861. __extends(PDFDropdown2, _super);
  16862. function PDFDropdown2(acroComboBox, ref, doc) {
  16863. var _this = _super.call(this, acroComboBox, ref, doc) || this;
  16864. assertIs(acroComboBox, "acroComboBox", [
  16865. [PDFAcroComboBox_default, "PDFAcroComboBox"]
  16866. ]);
  16867. _this.acroField = acroComboBox;
  16868. return _this;
  16869. }
  16870. PDFDropdown2.prototype.getOptions = function() {
  16871. var rawOptions = this.acroField.getOptions();
  16872. var options = new Array(rawOptions.length);
  16873. for (var idx = 0, len = options.length; idx < len; idx++) {
  16874. var _a = rawOptions[idx], display = _a.display, value = _a.value;
  16875. options[idx] = (display !== null && display !== void 0 ? display : value).decodeText();
  16876. }
  16877. return options;
  16878. };
  16879. PDFDropdown2.prototype.getSelected = function() {
  16880. var values2 = this.acroField.getValues();
  16881. var selected = new Array(values2.length);
  16882. for (var idx = 0, len = values2.length; idx < len; idx++) {
  16883. selected[idx] = values2[idx].decodeText();
  16884. }
  16885. return selected;
  16886. };
  16887. PDFDropdown2.prototype.setOptions = function(options) {
  16888. assertIs(options, "options", [Array]);
  16889. var optionObjects = new Array(options.length);
  16890. for (var idx = 0, len = options.length; idx < len; idx++) {
  16891. optionObjects[idx] = { value: PDFHexString_default.fromText(options[idx]) };
  16892. }
  16893. this.acroField.setOptions(optionObjects);
  16894. };
  16895. PDFDropdown2.prototype.addOptions = function(options) {
  16896. assertIs(options, "options", ["string", Array]);
  16897. var optionsArr = Array.isArray(options) ? options : [options];
  16898. var existingOptions = this.acroField.getOptions();
  16899. var newOptions = new Array(optionsArr.length);
  16900. for (var idx = 0, len = optionsArr.length; idx < len; idx++) {
  16901. newOptions[idx] = { value: PDFHexString_default.fromText(optionsArr[idx]) };
  16902. }
  16903. this.acroField.setOptions(existingOptions.concat(newOptions));
  16904. };
  16905. PDFDropdown2.prototype.select = function(options, merge2) {
  16906. if (merge2 === void 0) {
  16907. merge2 = false;
  16908. }
  16909. assertIs(options, "options", ["string", Array]);
  16910. assertIs(merge2, "merge", ["boolean"]);
  16911. var optionsArr = Array.isArray(options) ? options : [options];
  16912. var validOptions = this.getOptions();
  16913. var hasCustomOption = optionsArr.find(function(option) {
  16914. return !validOptions.includes(option);
  16915. });
  16916. if (hasCustomOption)
  16917. this.enableEditing();
  16918. this.markAsDirty();
  16919. if (optionsArr.length > 1 || optionsArr.length === 1 && merge2) {
  16920. this.enableMultiselect();
  16921. }
  16922. var values2 = new Array(optionsArr.length);
  16923. for (var idx = 0, len = optionsArr.length; idx < len; idx++) {
  16924. values2[idx] = PDFHexString_default.fromText(optionsArr[idx]);
  16925. }
  16926. if (merge2) {
  16927. var existingValues = this.acroField.getValues();
  16928. this.acroField.setValues(existingValues.concat(values2));
  16929. } else {
  16930. this.acroField.setValues(values2);
  16931. }
  16932. };
  16933. PDFDropdown2.prototype.clear = function() {
  16934. this.markAsDirty();
  16935. this.acroField.setValues([]);
  16936. };
  16937. PDFDropdown2.prototype.setFontSize = function(fontSize) {
  16938. assertPositive(fontSize, "fontSize");
  16939. this.acroField.setFontSize(fontSize);
  16940. this.markAsDirty();
  16941. };
  16942. PDFDropdown2.prototype.isEditable = function() {
  16943. return this.acroField.hasFlag(AcroChoiceFlags.Edit);
  16944. };
  16945. PDFDropdown2.prototype.enableEditing = function() {
  16946. this.acroField.setFlagTo(AcroChoiceFlags.Edit, true);
  16947. };
  16948. PDFDropdown2.prototype.disableEditing = function() {
  16949. this.acroField.setFlagTo(AcroChoiceFlags.Edit, false);
  16950. };
  16951. PDFDropdown2.prototype.isSorted = function() {
  16952. return this.acroField.hasFlag(AcroChoiceFlags.Sort);
  16953. };
  16954. PDFDropdown2.prototype.enableSorting = function() {
  16955. this.acroField.setFlagTo(AcroChoiceFlags.Sort, true);
  16956. };
  16957. PDFDropdown2.prototype.disableSorting = function() {
  16958. this.acroField.setFlagTo(AcroChoiceFlags.Sort, false);
  16959. };
  16960. PDFDropdown2.prototype.isMultiselect = function() {
  16961. return this.acroField.hasFlag(AcroChoiceFlags.MultiSelect);
  16962. };
  16963. PDFDropdown2.prototype.enableMultiselect = function() {
  16964. this.acroField.setFlagTo(AcroChoiceFlags.MultiSelect, true);
  16965. };
  16966. PDFDropdown2.prototype.disableMultiselect = function() {
  16967. this.acroField.setFlagTo(AcroChoiceFlags.MultiSelect, false);
  16968. };
  16969. PDFDropdown2.prototype.isSpellChecked = function() {
  16970. return !this.acroField.hasFlag(AcroChoiceFlags.DoNotSpellCheck);
  16971. };
  16972. PDFDropdown2.prototype.enableSpellChecking = function() {
  16973. this.acroField.setFlagTo(AcroChoiceFlags.DoNotSpellCheck, false);
  16974. };
  16975. PDFDropdown2.prototype.disableSpellChecking = function() {
  16976. this.acroField.setFlagTo(AcroChoiceFlags.DoNotSpellCheck, true);
  16977. };
  16978. PDFDropdown2.prototype.isSelectOnClick = function() {
  16979. return this.acroField.hasFlag(AcroChoiceFlags.CommitOnSelChange);
  16980. };
  16981. PDFDropdown2.prototype.enableSelectOnClick = function() {
  16982. this.acroField.setFlagTo(AcroChoiceFlags.CommitOnSelChange, true);
  16983. };
  16984. PDFDropdown2.prototype.disableSelectOnClick = function() {
  16985. this.acroField.setFlagTo(AcroChoiceFlags.CommitOnSelChange, false);
  16986. };
  16987. PDFDropdown2.prototype.addToPage = function(page, options) {
  16988. var _a, _b, _c, _d, _e, _f, _g;
  16989. assertIs(page, "page", [[PDFPage_default, "PDFPage"]]);
  16990. assertFieldAppearanceOptions(options);
  16991. if (!options)
  16992. options = {};
  16993. if (!("textColor" in options))
  16994. options.textColor = rgb(0, 0, 0);
  16995. if (!("backgroundColor" in options))
  16996. options.backgroundColor = rgb(1, 1, 1);
  16997. if (!("borderColor" in options))
  16998. options.borderColor = rgb(0, 0, 0);
  16999. if (!("borderWidth" in options))
  17000. options.borderWidth = 1;
  17001. var widget = this.createWidget({
  17002. x: (_a = options.x) !== null && _a !== void 0 ? _a : 0,
  17003. y: (_b = options.y) !== null && _b !== void 0 ? _b : 0,
  17004. width: (_c = options.width) !== null && _c !== void 0 ? _c : 200,
  17005. height: (_d = options.height) !== null && _d !== void 0 ? _d : 50,
  17006. textColor: options.textColor,
  17007. backgroundColor: options.backgroundColor,
  17008. borderColor: options.borderColor,
  17009. borderWidth: (_e = options.borderWidth) !== null && _e !== void 0 ? _e : 0,
  17010. rotate: (_f = options.rotate) !== null && _f !== void 0 ? _f : degrees(0),
  17011. hidden: options.hidden,
  17012. page: page.ref
  17013. });
  17014. var widgetRef = this.doc.context.register(widget.dict);
  17015. this.acroField.addWidget(widgetRef);
  17016. var font = (_g = options.font) !== null && _g !== void 0 ? _g : this.doc.getForm().getDefaultFont();
  17017. this.updateWidgetAppearance(widget, font);
  17018. page.node.addAnnot(widgetRef);
  17019. };
  17020. PDFDropdown2.prototype.needsAppearancesUpdate = function() {
  17021. var _a;
  17022. if (this.isDirty())
  17023. return true;
  17024. var widgets = this.acroField.getWidgets();
  17025. for (var idx = 0, len = widgets.length; idx < len; idx++) {
  17026. var widget = widgets[idx];
  17027. var hasAppearances = ((_a = widget.getAppearances()) === null || _a === void 0 ? void 0 : _a.normal) instanceof PDFStream_default;
  17028. if (!hasAppearances)
  17029. return true;
  17030. }
  17031. return false;
  17032. };
  17033. PDFDropdown2.prototype.defaultUpdateAppearances = function(font) {
  17034. assertIs(font, "font", [[PDFFont_default, "PDFFont"]]);
  17035. this.updateAppearances(font);
  17036. };
  17037. PDFDropdown2.prototype.updateAppearances = function(font, provider) {
  17038. assertIs(font, "font", [[PDFFont_default, "PDFFont"]]);
  17039. assertOrUndefined(provider, "provider", [Function]);
  17040. var widgets = this.acroField.getWidgets();
  17041. for (var idx = 0, len = widgets.length; idx < len; idx++) {
  17042. var widget = widgets[idx];
  17043. this.updateWidgetAppearance(widget, font, provider);
  17044. }
  17045. this.markAsClean();
  17046. };
  17047. PDFDropdown2.prototype.updateWidgetAppearance = function(widget, font, provider) {
  17048. var apProvider = provider !== null && provider !== void 0 ? provider : defaultDropdownAppearanceProvider;
  17049. var appearances = normalizeAppearance(apProvider(this, widget, font));
  17050. this.updateWidgetAppearanceWithFont(widget, font, appearances);
  17051. };
  17052. PDFDropdown2.of = function(acroComboBox, ref, doc) {
  17053. return new PDFDropdown2(acroComboBox, ref, doc);
  17054. };
  17055. return PDFDropdown2;
  17056. }(PDFField_default)
  17057. );
  17058. var PDFDropdown_default = PDFDropdown;
  17059. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/api/form/PDFOptionList.js
  17060. var PDFOptionList = (
  17061. /** @class */
  17062. function(_super) {
  17063. __extends(PDFOptionList2, _super);
  17064. function PDFOptionList2(acroListBox, ref, doc) {
  17065. var _this = _super.call(this, acroListBox, ref, doc) || this;
  17066. assertIs(acroListBox, "acroListBox", [[PDFAcroListBox_default, "PDFAcroListBox"]]);
  17067. _this.acroField = acroListBox;
  17068. return _this;
  17069. }
  17070. PDFOptionList2.prototype.getOptions = function() {
  17071. var rawOptions = this.acroField.getOptions();
  17072. var options = new Array(rawOptions.length);
  17073. for (var idx = 0, len = options.length; idx < len; idx++) {
  17074. var _a = rawOptions[idx], display = _a.display, value = _a.value;
  17075. options[idx] = (display !== null && display !== void 0 ? display : value).decodeText();
  17076. }
  17077. return options;
  17078. };
  17079. PDFOptionList2.prototype.getSelected = function() {
  17080. var values2 = this.acroField.getValues();
  17081. var selected = new Array(values2.length);
  17082. for (var idx = 0, len = values2.length; idx < len; idx++) {
  17083. selected[idx] = values2[idx].decodeText();
  17084. }
  17085. return selected;
  17086. };
  17087. PDFOptionList2.prototype.setOptions = function(options) {
  17088. assertIs(options, "options", [Array]);
  17089. this.markAsDirty();
  17090. var optionObjects = new Array(options.length);
  17091. for (var idx = 0, len = options.length; idx < len; idx++) {
  17092. optionObjects[idx] = { value: PDFHexString_default.fromText(options[idx]) };
  17093. }
  17094. this.acroField.setOptions(optionObjects);
  17095. };
  17096. PDFOptionList2.prototype.addOptions = function(options) {
  17097. assertIs(options, "options", ["string", Array]);
  17098. this.markAsDirty();
  17099. var optionsArr = Array.isArray(options) ? options : [options];
  17100. var existingOptions = this.acroField.getOptions();
  17101. var newOptions = new Array(optionsArr.length);
  17102. for (var idx = 0, len = optionsArr.length; idx < len; idx++) {
  17103. newOptions[idx] = { value: PDFHexString_default.fromText(optionsArr[idx]) };
  17104. }
  17105. this.acroField.setOptions(existingOptions.concat(newOptions));
  17106. };
  17107. PDFOptionList2.prototype.select = function(options, merge2) {
  17108. if (merge2 === void 0) {
  17109. merge2 = false;
  17110. }
  17111. assertIs(options, "options", ["string", Array]);
  17112. assertIs(merge2, "merge", ["boolean"]);
  17113. var optionsArr = Array.isArray(options) ? options : [options];
  17114. var validOptions = this.getOptions();
  17115. assertIsSubset(optionsArr, "option", validOptions);
  17116. this.markAsDirty();
  17117. if (optionsArr.length > 1 || optionsArr.length === 1 && merge2) {
  17118. this.enableMultiselect();
  17119. }
  17120. var values2 = new Array(optionsArr.length);
  17121. for (var idx = 0, len = optionsArr.length; idx < len; idx++) {
  17122. values2[idx] = PDFHexString_default.fromText(optionsArr[idx]);
  17123. }
  17124. if (merge2) {
  17125. var existingValues = this.acroField.getValues();
  17126. this.acroField.setValues(existingValues.concat(values2));
  17127. } else {
  17128. this.acroField.setValues(values2);
  17129. }
  17130. };
  17131. PDFOptionList2.prototype.clear = function() {
  17132. this.markAsDirty();
  17133. this.acroField.setValues([]);
  17134. };
  17135. PDFOptionList2.prototype.setFontSize = function(fontSize) {
  17136. assertPositive(fontSize, "fontSize");
  17137. this.acroField.setFontSize(fontSize);
  17138. this.markAsDirty();
  17139. };
  17140. PDFOptionList2.prototype.isSorted = function() {
  17141. return this.acroField.hasFlag(AcroChoiceFlags.Sort);
  17142. };
  17143. PDFOptionList2.prototype.enableSorting = function() {
  17144. this.acroField.setFlagTo(AcroChoiceFlags.Sort, true);
  17145. };
  17146. PDFOptionList2.prototype.disableSorting = function() {
  17147. this.acroField.setFlagTo(AcroChoiceFlags.Sort, false);
  17148. };
  17149. PDFOptionList2.prototype.isMultiselect = function() {
  17150. return this.acroField.hasFlag(AcroChoiceFlags.MultiSelect);
  17151. };
  17152. PDFOptionList2.prototype.enableMultiselect = function() {
  17153. this.acroField.setFlagTo(AcroChoiceFlags.MultiSelect, true);
  17154. };
  17155. PDFOptionList2.prototype.disableMultiselect = function() {
  17156. this.acroField.setFlagTo(AcroChoiceFlags.MultiSelect, false);
  17157. };
  17158. PDFOptionList2.prototype.isSelectOnClick = function() {
  17159. return this.acroField.hasFlag(AcroChoiceFlags.CommitOnSelChange);
  17160. };
  17161. PDFOptionList2.prototype.enableSelectOnClick = function() {
  17162. this.acroField.setFlagTo(AcroChoiceFlags.CommitOnSelChange, true);
  17163. };
  17164. PDFOptionList2.prototype.disableSelectOnClick = function() {
  17165. this.acroField.setFlagTo(AcroChoiceFlags.CommitOnSelChange, false);
  17166. };
  17167. PDFOptionList2.prototype.addToPage = function(page, options) {
  17168. var _a, _b, _c, _d, _e, _f, _g;
  17169. assertIs(page, "page", [[PDFPage_default, "PDFPage"]]);
  17170. assertFieldAppearanceOptions(options);
  17171. if (!options)
  17172. options = {};
  17173. if (!("textColor" in options))
  17174. options.textColor = rgb(0, 0, 0);
  17175. if (!("backgroundColor" in options))
  17176. options.backgroundColor = rgb(1, 1, 1);
  17177. if (!("borderColor" in options))
  17178. options.borderColor = rgb(0, 0, 0);
  17179. if (!("borderWidth" in options))
  17180. options.borderWidth = 1;
  17181. var widget = this.createWidget({
  17182. x: (_a = options.x) !== null && _a !== void 0 ? _a : 0,
  17183. y: (_b = options.y) !== null && _b !== void 0 ? _b : 0,
  17184. width: (_c = options.width) !== null && _c !== void 0 ? _c : 200,
  17185. height: (_d = options.height) !== null && _d !== void 0 ? _d : 100,
  17186. textColor: options.textColor,
  17187. backgroundColor: options.backgroundColor,
  17188. borderColor: options.borderColor,
  17189. borderWidth: (_e = options.borderWidth) !== null && _e !== void 0 ? _e : 0,
  17190. rotate: (_f = options.rotate) !== null && _f !== void 0 ? _f : degrees(0),
  17191. hidden: options.hidden,
  17192. page: page.ref
  17193. });
  17194. var widgetRef = this.doc.context.register(widget.dict);
  17195. this.acroField.addWidget(widgetRef);
  17196. var font = (_g = options.font) !== null && _g !== void 0 ? _g : this.doc.getForm().getDefaultFont();
  17197. this.updateWidgetAppearance(widget, font);
  17198. page.node.addAnnot(widgetRef);
  17199. };
  17200. PDFOptionList2.prototype.needsAppearancesUpdate = function() {
  17201. var _a;
  17202. if (this.isDirty())
  17203. return true;
  17204. var widgets = this.acroField.getWidgets();
  17205. for (var idx = 0, len = widgets.length; idx < len; idx++) {
  17206. var widget = widgets[idx];
  17207. var hasAppearances = ((_a = widget.getAppearances()) === null || _a === void 0 ? void 0 : _a.normal) instanceof PDFStream_default;
  17208. if (!hasAppearances)
  17209. return true;
  17210. }
  17211. return false;
  17212. };
  17213. PDFOptionList2.prototype.defaultUpdateAppearances = function(font) {
  17214. assertIs(font, "font", [[PDFFont_default, "PDFFont"]]);
  17215. this.updateAppearances(font);
  17216. };
  17217. PDFOptionList2.prototype.updateAppearances = function(font, provider) {
  17218. assertIs(font, "font", [[PDFFont_default, "PDFFont"]]);
  17219. assertOrUndefined(provider, "provider", [Function]);
  17220. var widgets = this.acroField.getWidgets();
  17221. for (var idx = 0, len = widgets.length; idx < len; idx++) {
  17222. var widget = widgets[idx];
  17223. this.updateWidgetAppearance(widget, font, provider);
  17224. }
  17225. this.markAsClean();
  17226. };
  17227. PDFOptionList2.prototype.updateWidgetAppearance = function(widget, font, provider) {
  17228. var apProvider = provider !== null && provider !== void 0 ? provider : defaultOptionListAppearanceProvider;
  17229. var appearances = normalizeAppearance(apProvider(this, widget, font));
  17230. this.updateWidgetAppearanceWithFont(widget, font, appearances);
  17231. };
  17232. PDFOptionList2.of = function(acroListBox, ref, doc) {
  17233. return new PDFOptionList2(acroListBox, ref, doc);
  17234. };
  17235. return PDFOptionList2;
  17236. }(PDFField_default)
  17237. );
  17238. var PDFOptionList_default = PDFOptionList;
  17239. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/api/form/PDFRadioGroup.js
  17240. var PDFRadioGroup = (
  17241. /** @class */
  17242. function(_super) {
  17243. __extends(PDFRadioGroup2, _super);
  17244. function PDFRadioGroup2(acroRadioButton, ref, doc) {
  17245. var _this = _super.call(this, acroRadioButton, ref, doc) || this;
  17246. assertIs(acroRadioButton, "acroRadioButton", [
  17247. [PDFAcroRadioButton_default, "PDFAcroRadioButton"]
  17248. ]);
  17249. _this.acroField = acroRadioButton;
  17250. return _this;
  17251. }
  17252. PDFRadioGroup2.prototype.getOptions = function() {
  17253. var exportValues = this.acroField.getExportValues();
  17254. if (exportValues) {
  17255. var exportOptions = new Array(exportValues.length);
  17256. for (var idx = 0, len = exportValues.length; idx < len; idx++) {
  17257. exportOptions[idx] = exportValues[idx].decodeText();
  17258. }
  17259. return exportOptions;
  17260. }
  17261. var onValues = this.acroField.getOnValues();
  17262. var onOptions = new Array(onValues.length);
  17263. for (var idx = 0, len = onOptions.length; idx < len; idx++) {
  17264. onOptions[idx] = onValues[idx].decodeText();
  17265. }
  17266. return onOptions;
  17267. };
  17268. PDFRadioGroup2.prototype.getSelected = function() {
  17269. var value = this.acroField.getValue();
  17270. if (value === PDFName_default.of("Off"))
  17271. return void 0;
  17272. var exportValues = this.acroField.getExportValues();
  17273. if (exportValues) {
  17274. var onValues = this.acroField.getOnValues();
  17275. for (var idx = 0, len = onValues.length; idx < len; idx++) {
  17276. if (onValues[idx] === value)
  17277. return exportValues[idx].decodeText();
  17278. }
  17279. }
  17280. return value.decodeText();
  17281. };
  17282. PDFRadioGroup2.prototype.select = function(option) {
  17283. assertIs(option, "option", ["string"]);
  17284. var validOptions = this.getOptions();
  17285. assertIsOneOf(option, "option", validOptions);
  17286. this.markAsDirty();
  17287. var onValues = this.acroField.getOnValues();
  17288. var exportValues = this.acroField.getExportValues();
  17289. if (exportValues) {
  17290. for (var idx = 0, len = exportValues.length; idx < len; idx++) {
  17291. if (exportValues[idx].decodeText() === option) {
  17292. this.acroField.setValue(onValues[idx]);
  17293. }
  17294. }
  17295. } else {
  17296. for (var idx = 0, len = onValues.length; idx < len; idx++) {
  17297. var value = onValues[idx];
  17298. if (value.decodeText() === option)
  17299. this.acroField.setValue(value);
  17300. }
  17301. }
  17302. };
  17303. PDFRadioGroup2.prototype.clear = function() {
  17304. this.markAsDirty();
  17305. this.acroField.setValue(PDFName_default.of("Off"));
  17306. };
  17307. PDFRadioGroup2.prototype.isOffToggleable = function() {
  17308. return !this.acroField.hasFlag(AcroButtonFlags.NoToggleToOff);
  17309. };
  17310. PDFRadioGroup2.prototype.enableOffToggling = function() {
  17311. this.acroField.setFlagTo(AcroButtonFlags.NoToggleToOff, false);
  17312. };
  17313. PDFRadioGroup2.prototype.disableOffToggling = function() {
  17314. this.acroField.setFlagTo(AcroButtonFlags.NoToggleToOff, true);
  17315. };
  17316. PDFRadioGroup2.prototype.isMutuallyExclusive = function() {
  17317. return !this.acroField.hasFlag(AcroButtonFlags.RadiosInUnison);
  17318. };
  17319. PDFRadioGroup2.prototype.enableMutualExclusion = function() {
  17320. this.acroField.setFlagTo(AcroButtonFlags.RadiosInUnison, false);
  17321. };
  17322. PDFRadioGroup2.prototype.disableMutualExclusion = function() {
  17323. this.acroField.setFlagTo(AcroButtonFlags.RadiosInUnison, true);
  17324. };
  17325. PDFRadioGroup2.prototype.addOptionToPage = function(option, page, options) {
  17326. var _a, _b, _c, _d, _e, _f, _g, _h, _j;
  17327. assertIs(option, "option", ["string"]);
  17328. assertIs(page, "page", [[PDFPage_default, "PDFPage"]]);
  17329. assertFieldAppearanceOptions(options);
  17330. var widget = this.createWidget({
  17331. x: (_a = options === null || options === void 0 ? void 0 : options.x) !== null && _a !== void 0 ? _a : 0,
  17332. y: (_b = options === null || options === void 0 ? void 0 : options.y) !== null && _b !== void 0 ? _b : 0,
  17333. width: (_c = options === null || options === void 0 ? void 0 : options.width) !== null && _c !== void 0 ? _c : 50,
  17334. height: (_d = options === null || options === void 0 ? void 0 : options.height) !== null && _d !== void 0 ? _d : 50,
  17335. textColor: (_e = options === null || options === void 0 ? void 0 : options.textColor) !== null && _e !== void 0 ? _e : rgb(0, 0, 0),
  17336. backgroundColor: (_f = options === null || options === void 0 ? void 0 : options.backgroundColor) !== null && _f !== void 0 ? _f : rgb(1, 1, 1),
  17337. borderColor: (_g = options === null || options === void 0 ? void 0 : options.borderColor) !== null && _g !== void 0 ? _g : rgb(0, 0, 0),
  17338. borderWidth: (_h = options === null || options === void 0 ? void 0 : options.borderWidth) !== null && _h !== void 0 ? _h : 1,
  17339. rotate: (_j = options === null || options === void 0 ? void 0 : options.rotate) !== null && _j !== void 0 ? _j : degrees(0),
  17340. hidden: options === null || options === void 0 ? void 0 : options.hidden,
  17341. page: page.ref
  17342. });
  17343. var widgetRef = this.doc.context.register(widget.dict);
  17344. var apStateValue = this.acroField.addWidgetWithOpt(widgetRef, PDFHexString_default.fromText(option), !this.isMutuallyExclusive());
  17345. widget.setAppearanceState(PDFName_default.of("Off"));
  17346. this.updateWidgetAppearance(widget, apStateValue);
  17347. page.node.addAnnot(widgetRef);
  17348. };
  17349. PDFRadioGroup2.prototype.needsAppearancesUpdate = function() {
  17350. var _a;
  17351. var widgets = this.acroField.getWidgets();
  17352. for (var idx = 0, len = widgets.length; idx < len; idx++) {
  17353. var widget = widgets[idx];
  17354. var state = widget.getAppearanceState();
  17355. var normal = (_a = widget.getAppearances()) === null || _a === void 0 ? void 0 : _a.normal;
  17356. if (!(normal instanceof PDFDict_default))
  17357. return true;
  17358. if (state && !normal.has(state))
  17359. return true;
  17360. }
  17361. return false;
  17362. };
  17363. PDFRadioGroup2.prototype.defaultUpdateAppearances = function() {
  17364. this.updateAppearances();
  17365. };
  17366. PDFRadioGroup2.prototype.updateAppearances = function(provider) {
  17367. assertOrUndefined(provider, "provider", [Function]);
  17368. var widgets = this.acroField.getWidgets();
  17369. for (var idx = 0, len = widgets.length; idx < len; idx++) {
  17370. var widget = widgets[idx];
  17371. var onValue = widget.getOnValue();
  17372. if (!onValue)
  17373. continue;
  17374. this.updateWidgetAppearance(widget, onValue, provider);
  17375. }
  17376. };
  17377. PDFRadioGroup2.prototype.updateWidgetAppearance = function(widget, onValue, provider) {
  17378. var apProvider = provider !== null && provider !== void 0 ? provider : defaultRadioGroupAppearanceProvider;
  17379. var appearances = normalizeAppearance(apProvider(this, widget));
  17380. this.updateOnOffWidgetAppearance(widget, onValue, appearances);
  17381. };
  17382. PDFRadioGroup2.of = function(acroRadioButton, ref, doc) {
  17383. return new PDFRadioGroup2(acroRadioButton, ref, doc);
  17384. };
  17385. return PDFRadioGroup2;
  17386. }(PDFField_default)
  17387. );
  17388. var PDFRadioGroup_default = PDFRadioGroup;
  17389. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/api/form/PDFSignature.js
  17390. var PDFSignature = (
  17391. /** @class */
  17392. function(_super) {
  17393. __extends(PDFSignature2, _super);
  17394. function PDFSignature2(acroSignature, ref, doc) {
  17395. var _this = _super.call(this, acroSignature, ref, doc) || this;
  17396. assertIs(acroSignature, "acroSignature", [
  17397. [PDFAcroSignature_default, "PDFAcroSignature"]
  17398. ]);
  17399. _this.acroField = acroSignature;
  17400. return _this;
  17401. }
  17402. PDFSignature2.prototype.needsAppearancesUpdate = function() {
  17403. return false;
  17404. };
  17405. PDFSignature2.of = function(acroSignature, ref, doc) {
  17406. return new PDFSignature2(acroSignature, ref, doc);
  17407. };
  17408. return PDFSignature2;
  17409. }(PDFField_default)
  17410. );
  17411. var PDFSignature_default = PDFSignature;
  17412. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/api/form/PDFTextField.js
  17413. var PDFTextField = (
  17414. /** @class */
  17415. function(_super) {
  17416. __extends(PDFTextField2, _super);
  17417. function PDFTextField2(acroText, ref, doc) {
  17418. var _this = _super.call(this, acroText, ref, doc) || this;
  17419. assertIs(acroText, "acroText", [[PDFAcroText_default, "PDFAcroText"]]);
  17420. _this.acroField = acroText;
  17421. return _this;
  17422. }
  17423. PDFTextField2.prototype.getText = function() {
  17424. var value = this.acroField.getValue();
  17425. if (!value && this.isRichFormatted()) {
  17426. throw new RichTextFieldReadError(this.getName());
  17427. }
  17428. return value === null || value === void 0 ? void 0 : value.decodeText();
  17429. };
  17430. PDFTextField2.prototype.setText = function(text) {
  17431. assertOrUndefined(text, "text", ["string"]);
  17432. var maxLength = this.getMaxLength();
  17433. if (maxLength !== void 0 && text && text.length > maxLength) {
  17434. throw new ExceededMaxLengthError(text.length, maxLength, this.getName());
  17435. }
  17436. this.markAsDirty();
  17437. this.disableRichFormatting();
  17438. if (text) {
  17439. this.acroField.setValue(PDFHexString_default.fromText(text));
  17440. } else {
  17441. this.acroField.removeValue();
  17442. }
  17443. };
  17444. PDFTextField2.prototype.getAlignment = function() {
  17445. var quadding = this.acroField.getQuadding();
  17446. return quadding === 0 ? TextAlignment.Left : quadding === 1 ? TextAlignment.Center : quadding === 2 ? TextAlignment.Right : TextAlignment.Left;
  17447. };
  17448. PDFTextField2.prototype.setAlignment = function(alignment) {
  17449. assertIsOneOf(alignment, "alignment", TextAlignment);
  17450. this.markAsDirty();
  17451. this.acroField.setQuadding(alignment);
  17452. };
  17453. PDFTextField2.prototype.getMaxLength = function() {
  17454. return this.acroField.getMaxLength();
  17455. };
  17456. PDFTextField2.prototype.setMaxLength = function(maxLength) {
  17457. assertRangeOrUndefined(maxLength, "maxLength", 0, Number.MAX_SAFE_INTEGER);
  17458. this.markAsDirty();
  17459. if (maxLength === void 0) {
  17460. this.acroField.removeMaxLength();
  17461. } else {
  17462. var text = this.getText();
  17463. if (text && text.length > maxLength) {
  17464. throw new InvalidMaxLengthError(text.length, maxLength, this.getName());
  17465. }
  17466. this.acroField.setMaxLength(maxLength);
  17467. }
  17468. };
  17469. PDFTextField2.prototype.removeMaxLength = function() {
  17470. this.markAsDirty();
  17471. this.acroField.removeMaxLength();
  17472. };
  17473. PDFTextField2.prototype.setImage = function(image) {
  17474. var fieldAlignment = this.getAlignment();
  17475. var alignment = fieldAlignment === TextAlignment.Center ? ImageAlignment.Center : fieldAlignment === TextAlignment.Right ? ImageAlignment.Right : ImageAlignment.Left;
  17476. var widgets = this.acroField.getWidgets();
  17477. for (var idx = 0, len = widgets.length; idx < len; idx++) {
  17478. var widget = widgets[idx];
  17479. var streamRef = this.createImageAppearanceStream(widget, image, alignment);
  17480. this.updateWidgetAppearances(widget, { normal: streamRef });
  17481. }
  17482. this.markAsClean();
  17483. };
  17484. PDFTextField2.prototype.setFontSize = function(fontSize) {
  17485. assertPositive(fontSize, "fontSize");
  17486. this.acroField.setFontSize(fontSize);
  17487. this.markAsDirty();
  17488. };
  17489. PDFTextField2.prototype.isMultiline = function() {
  17490. return this.acroField.hasFlag(AcroTextFlags.Multiline);
  17491. };
  17492. PDFTextField2.prototype.enableMultiline = function() {
  17493. this.markAsDirty();
  17494. this.acroField.setFlagTo(AcroTextFlags.Multiline, true);
  17495. };
  17496. PDFTextField2.prototype.disableMultiline = function() {
  17497. this.markAsDirty();
  17498. this.acroField.setFlagTo(AcroTextFlags.Multiline, false);
  17499. };
  17500. PDFTextField2.prototype.isPassword = function() {
  17501. return this.acroField.hasFlag(AcroTextFlags.Password);
  17502. };
  17503. PDFTextField2.prototype.enablePassword = function() {
  17504. this.acroField.setFlagTo(AcroTextFlags.Password, true);
  17505. };
  17506. PDFTextField2.prototype.disablePassword = function() {
  17507. this.acroField.setFlagTo(AcroTextFlags.Password, false);
  17508. };
  17509. PDFTextField2.prototype.isFileSelector = function() {
  17510. return this.acroField.hasFlag(AcroTextFlags.FileSelect);
  17511. };
  17512. PDFTextField2.prototype.enableFileSelection = function() {
  17513. this.acroField.setFlagTo(AcroTextFlags.FileSelect, true);
  17514. };
  17515. PDFTextField2.prototype.disableFileSelection = function() {
  17516. this.acroField.setFlagTo(AcroTextFlags.FileSelect, false);
  17517. };
  17518. PDFTextField2.prototype.isSpellChecked = function() {
  17519. return !this.acroField.hasFlag(AcroTextFlags.DoNotSpellCheck);
  17520. };
  17521. PDFTextField2.prototype.enableSpellChecking = function() {
  17522. this.acroField.setFlagTo(AcroTextFlags.DoNotSpellCheck, false);
  17523. };
  17524. PDFTextField2.prototype.disableSpellChecking = function() {
  17525. this.acroField.setFlagTo(AcroTextFlags.DoNotSpellCheck, true);
  17526. };
  17527. PDFTextField2.prototype.isScrollable = function() {
  17528. return !this.acroField.hasFlag(AcroTextFlags.DoNotScroll);
  17529. };
  17530. PDFTextField2.prototype.enableScrolling = function() {
  17531. this.acroField.setFlagTo(AcroTextFlags.DoNotScroll, false);
  17532. };
  17533. PDFTextField2.prototype.disableScrolling = function() {
  17534. this.acroField.setFlagTo(AcroTextFlags.DoNotScroll, true);
  17535. };
  17536. PDFTextField2.prototype.isCombed = function() {
  17537. return this.acroField.hasFlag(AcroTextFlags.Comb) && !this.isMultiline() && !this.isPassword() && !this.isFileSelector() && this.getMaxLength() !== void 0;
  17538. };
  17539. PDFTextField2.prototype.enableCombing = function() {
  17540. if (this.getMaxLength() === void 0) {
  17541. var msg = "PDFTextFields must have a max length in order to be combed";
  17542. console.warn(msg);
  17543. }
  17544. this.markAsDirty();
  17545. this.disableMultiline();
  17546. this.disablePassword();
  17547. this.disableFileSelection();
  17548. this.acroField.setFlagTo(AcroTextFlags.Comb, true);
  17549. };
  17550. PDFTextField2.prototype.disableCombing = function() {
  17551. this.markAsDirty();
  17552. this.acroField.setFlagTo(AcroTextFlags.Comb, false);
  17553. };
  17554. PDFTextField2.prototype.isRichFormatted = function() {
  17555. return this.acroField.hasFlag(AcroTextFlags.RichText);
  17556. };
  17557. PDFTextField2.prototype.enableRichFormatting = function() {
  17558. this.acroField.setFlagTo(AcroTextFlags.RichText, true);
  17559. };
  17560. PDFTextField2.prototype.disableRichFormatting = function() {
  17561. this.acroField.setFlagTo(AcroTextFlags.RichText, false);
  17562. };
  17563. PDFTextField2.prototype.addToPage = function(page, options) {
  17564. var _a, _b, _c, _d, _e, _f, _g;
  17565. assertIs(page, "page", [[PDFPage_default, "PDFPage"]]);
  17566. assertFieldAppearanceOptions(options);
  17567. if (!options)
  17568. options = {};
  17569. if (!("textColor" in options))
  17570. options.textColor = rgb(0, 0, 0);
  17571. if (!("backgroundColor" in options))
  17572. options.backgroundColor = rgb(1, 1, 1);
  17573. if (!("borderColor" in options))
  17574. options.borderColor = rgb(0, 0, 0);
  17575. if (!("borderWidth" in options))
  17576. options.borderWidth = 1;
  17577. var widget = this.createWidget({
  17578. x: (_a = options.x) !== null && _a !== void 0 ? _a : 0,
  17579. y: (_b = options.y) !== null && _b !== void 0 ? _b : 0,
  17580. width: (_c = options.width) !== null && _c !== void 0 ? _c : 200,
  17581. height: (_d = options.height) !== null && _d !== void 0 ? _d : 50,
  17582. textColor: options.textColor,
  17583. backgroundColor: options.backgroundColor,
  17584. borderColor: options.borderColor,
  17585. borderWidth: (_e = options.borderWidth) !== null && _e !== void 0 ? _e : 0,
  17586. rotate: (_f = options.rotate) !== null && _f !== void 0 ? _f : degrees(0),
  17587. hidden: options.hidden,
  17588. page: page.ref
  17589. });
  17590. var widgetRef = this.doc.context.register(widget.dict);
  17591. this.acroField.addWidget(widgetRef);
  17592. var font = (_g = options.font) !== null && _g !== void 0 ? _g : this.doc.getForm().getDefaultFont();
  17593. this.updateWidgetAppearance(widget, font);
  17594. page.node.addAnnot(widgetRef);
  17595. };
  17596. PDFTextField2.prototype.needsAppearancesUpdate = function() {
  17597. var _a;
  17598. if (this.isDirty())
  17599. return true;
  17600. var widgets = this.acroField.getWidgets();
  17601. for (var idx = 0, len = widgets.length; idx < len; idx++) {
  17602. var widget = widgets[idx];
  17603. var hasAppearances = ((_a = widget.getAppearances()) === null || _a === void 0 ? void 0 : _a.normal) instanceof PDFStream_default;
  17604. if (!hasAppearances)
  17605. return true;
  17606. }
  17607. return false;
  17608. };
  17609. PDFTextField2.prototype.defaultUpdateAppearances = function(font) {
  17610. assertIs(font, "font", [[PDFFont_default, "PDFFont"]]);
  17611. this.updateAppearances(font);
  17612. };
  17613. PDFTextField2.prototype.updateAppearances = function(font, provider) {
  17614. assertIs(font, "font", [[PDFFont_default, "PDFFont"]]);
  17615. assertOrUndefined(provider, "provider", [Function]);
  17616. var widgets = this.acroField.getWidgets();
  17617. for (var idx = 0, len = widgets.length; idx < len; idx++) {
  17618. var widget = widgets[idx];
  17619. this.updateWidgetAppearance(widget, font, provider);
  17620. }
  17621. this.markAsClean();
  17622. };
  17623. PDFTextField2.prototype.updateWidgetAppearance = function(widget, font, provider) {
  17624. var apProvider = provider !== null && provider !== void 0 ? provider : defaultTextFieldAppearanceProvider;
  17625. var appearances = normalizeAppearance(apProvider(this, widget, font));
  17626. this.updateWidgetAppearanceWithFont(widget, font, appearances);
  17627. };
  17628. PDFTextField2.of = function(acroText, ref, doc) {
  17629. return new PDFTextField2(acroText, ref, doc);
  17630. };
  17631. return PDFTextField2;
  17632. }(PDFField_default)
  17633. );
  17634. var PDFTextField_default = PDFTextField;
  17635. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/api/StandardFonts.js
  17636. var StandardFonts;
  17637. (function(StandardFonts2) {
  17638. StandardFonts2["Courier"] = "Courier";
  17639. StandardFonts2["CourierBold"] = "Courier-Bold";
  17640. StandardFonts2["CourierOblique"] = "Courier-Oblique";
  17641. StandardFonts2["CourierBoldOblique"] = "Courier-BoldOblique";
  17642. StandardFonts2["Helvetica"] = "Helvetica";
  17643. StandardFonts2["HelveticaBold"] = "Helvetica-Bold";
  17644. StandardFonts2["HelveticaOblique"] = "Helvetica-Oblique";
  17645. StandardFonts2["HelveticaBoldOblique"] = "Helvetica-BoldOblique";
  17646. StandardFonts2["TimesRoman"] = "Times-Roman";
  17647. StandardFonts2["TimesRomanBold"] = "Times-Bold";
  17648. StandardFonts2["TimesRomanItalic"] = "Times-Italic";
  17649. StandardFonts2["TimesRomanBoldItalic"] = "Times-BoldItalic";
  17650. StandardFonts2["Symbol"] = "Symbol";
  17651. StandardFonts2["ZapfDingbats"] = "ZapfDingbats";
  17652. })(StandardFonts || (StandardFonts = {}));
  17653. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/api/form/PDFForm.js
  17654. var PDFForm = (
  17655. /** @class */
  17656. function() {
  17657. function PDFForm2(acroForm, doc) {
  17658. var _this = this;
  17659. this.embedDefaultFont = function() {
  17660. return _this.doc.embedStandardFont(StandardFonts.Helvetica);
  17661. };
  17662. assertIs(acroForm, "acroForm", [[PDFAcroForm_default, "PDFAcroForm"]]);
  17663. assertIs(doc, "doc", [[PDFDocument_default, "PDFDocument"]]);
  17664. this.acroForm = acroForm;
  17665. this.doc = doc;
  17666. this.dirtyFields = /* @__PURE__ */ new Set();
  17667. this.defaultFontCache = Cache_default.populatedBy(this.embedDefaultFont);
  17668. }
  17669. PDFForm2.prototype.hasXFA = function() {
  17670. return this.acroForm.dict.has(PDFName_default.of("XFA"));
  17671. };
  17672. PDFForm2.prototype.deleteXFA = function() {
  17673. this.acroForm.dict.delete(PDFName_default.of("XFA"));
  17674. };
  17675. PDFForm2.prototype.getFields = function() {
  17676. var allFields = this.acroForm.getAllFields();
  17677. var fields = [];
  17678. for (var idx = 0, len = allFields.length; idx < len; idx++) {
  17679. var _a = allFields[idx], acroField = _a[0], ref = _a[1];
  17680. var field = convertToPDFField(acroField, ref, this.doc);
  17681. if (field)
  17682. fields.push(field);
  17683. }
  17684. return fields;
  17685. };
  17686. PDFForm2.prototype.getFieldMaybe = function(name) {
  17687. assertIs(name, "name", ["string"]);
  17688. var fields = this.getFields();
  17689. for (var idx = 0, len = fields.length; idx < len; idx++) {
  17690. var field = fields[idx];
  17691. if (field.getName() === name)
  17692. return field;
  17693. }
  17694. return void 0;
  17695. };
  17696. PDFForm2.prototype.getField = function(name) {
  17697. assertIs(name, "name", ["string"]);
  17698. var field = this.getFieldMaybe(name);
  17699. if (field)
  17700. return field;
  17701. throw new NoSuchFieldError(name);
  17702. };
  17703. PDFForm2.prototype.getButton = function(name) {
  17704. assertIs(name, "name", ["string"]);
  17705. var field = this.getField(name);
  17706. if (field instanceof PDFButton_default)
  17707. return field;
  17708. throw new UnexpectedFieldTypeError(name, PDFButton_default, field);
  17709. };
  17710. PDFForm2.prototype.getCheckBox = function(name) {
  17711. assertIs(name, "name", ["string"]);
  17712. var field = this.getField(name);
  17713. if (field instanceof PDFCheckBox_default)
  17714. return field;
  17715. throw new UnexpectedFieldTypeError(name, PDFCheckBox_default, field);
  17716. };
  17717. PDFForm2.prototype.getDropdown = function(name) {
  17718. assertIs(name, "name", ["string"]);
  17719. var field = this.getField(name);
  17720. if (field instanceof PDFDropdown_default)
  17721. return field;
  17722. throw new UnexpectedFieldTypeError(name, PDFDropdown_default, field);
  17723. };
  17724. PDFForm2.prototype.getOptionList = function(name) {
  17725. assertIs(name, "name", ["string"]);
  17726. var field = this.getField(name);
  17727. if (field instanceof PDFOptionList_default)
  17728. return field;
  17729. throw new UnexpectedFieldTypeError(name, PDFOptionList_default, field);
  17730. };
  17731. PDFForm2.prototype.getRadioGroup = function(name) {
  17732. assertIs(name, "name", ["string"]);
  17733. var field = this.getField(name);
  17734. if (field instanceof PDFRadioGroup_default)
  17735. return field;
  17736. throw new UnexpectedFieldTypeError(name, PDFRadioGroup_default, field);
  17737. };
  17738. PDFForm2.prototype.getSignature = function(name) {
  17739. assertIs(name, "name", ["string"]);
  17740. var field = this.getField(name);
  17741. if (field instanceof PDFSignature_default)
  17742. return field;
  17743. throw new UnexpectedFieldTypeError(name, PDFSignature_default, field);
  17744. };
  17745. PDFForm2.prototype.getTextField = function(name) {
  17746. assertIs(name, "name", ["string"]);
  17747. var field = this.getField(name);
  17748. if (field instanceof PDFTextField_default)
  17749. return field;
  17750. throw new UnexpectedFieldTypeError(name, PDFTextField_default, field);
  17751. };
  17752. PDFForm2.prototype.createButton = function(name) {
  17753. assertIs(name, "name", ["string"]);
  17754. var nameParts = splitFieldName(name);
  17755. var parent = this.findOrCreateNonTerminals(nameParts.nonTerminal);
  17756. var button = PDFAcroPushButton_default.create(this.doc.context);
  17757. button.setPartialName(nameParts.terminal);
  17758. addFieldToParent(parent, [button, button.ref], nameParts.terminal);
  17759. return PDFButton_default.of(button, button.ref, this.doc);
  17760. };
  17761. PDFForm2.prototype.createCheckBox = function(name) {
  17762. assertIs(name, "name", ["string"]);
  17763. var nameParts = splitFieldName(name);
  17764. var parent = this.findOrCreateNonTerminals(nameParts.nonTerminal);
  17765. var checkBox = PDFAcroCheckBox_default.create(this.doc.context);
  17766. checkBox.setPartialName(nameParts.terminal);
  17767. addFieldToParent(parent, [checkBox, checkBox.ref], nameParts.terminal);
  17768. return PDFCheckBox_default.of(checkBox, checkBox.ref, this.doc);
  17769. };
  17770. PDFForm2.prototype.createDropdown = function(name) {
  17771. assertIs(name, "name", ["string"]);
  17772. var nameParts = splitFieldName(name);
  17773. var parent = this.findOrCreateNonTerminals(nameParts.nonTerminal);
  17774. var comboBox = PDFAcroComboBox_default.create(this.doc.context);
  17775. comboBox.setPartialName(nameParts.terminal);
  17776. addFieldToParent(parent, [comboBox, comboBox.ref], nameParts.terminal);
  17777. return PDFDropdown_default.of(comboBox, comboBox.ref, this.doc);
  17778. };
  17779. PDFForm2.prototype.createOptionList = function(name) {
  17780. assertIs(name, "name", ["string"]);
  17781. var nameParts = splitFieldName(name);
  17782. var parent = this.findOrCreateNonTerminals(nameParts.nonTerminal);
  17783. var listBox = PDFAcroListBox_default.create(this.doc.context);
  17784. listBox.setPartialName(nameParts.terminal);
  17785. addFieldToParent(parent, [listBox, listBox.ref], nameParts.terminal);
  17786. return PDFOptionList_default.of(listBox, listBox.ref, this.doc);
  17787. };
  17788. PDFForm2.prototype.createRadioGroup = function(name) {
  17789. assertIs(name, "name", ["string"]);
  17790. var nameParts = splitFieldName(name);
  17791. var parent = this.findOrCreateNonTerminals(nameParts.nonTerminal);
  17792. var radioButton = PDFAcroRadioButton_default.create(this.doc.context);
  17793. radioButton.setPartialName(nameParts.terminal);
  17794. addFieldToParent(parent, [radioButton, radioButton.ref], nameParts.terminal);
  17795. return PDFRadioGroup_default.of(radioButton, radioButton.ref, this.doc);
  17796. };
  17797. PDFForm2.prototype.createTextField = function(name) {
  17798. assertIs(name, "name", ["string"]);
  17799. var nameParts = splitFieldName(name);
  17800. var parent = this.findOrCreateNonTerminals(nameParts.nonTerminal);
  17801. var text = PDFAcroText_default.create(this.doc.context);
  17802. text.setPartialName(nameParts.terminal);
  17803. addFieldToParent(parent, [text, text.ref], nameParts.terminal);
  17804. return PDFTextField_default.of(text, text.ref, this.doc);
  17805. };
  17806. PDFForm2.prototype.flatten = function(options) {
  17807. if (options === void 0) {
  17808. options = { updateFieldAppearances: true };
  17809. }
  17810. if (options.updateFieldAppearances) {
  17811. this.updateFieldAppearances();
  17812. }
  17813. var fields = this.getFields();
  17814. for (var i = 0, lenFields = fields.length; i < lenFields; i++) {
  17815. var field = fields[i];
  17816. var widgets = field.acroField.getWidgets();
  17817. for (var j = 0, lenWidgets = widgets.length; j < lenWidgets; j++) {
  17818. var widget = widgets[j];
  17819. var page = this.findWidgetPage(widget);
  17820. var widgetRef = this.findWidgetAppearanceRef(field, widget);
  17821. var xObjectKey = page.node.newXObject("FlatWidget", widgetRef);
  17822. var rectangle = widget.getRectangle();
  17823. var operators = __spreadArrays([
  17824. pushGraphicsState(),
  17825. translate(rectangle.x, rectangle.y)
  17826. ], rotateInPlace(__assign(__assign({}, rectangle), { rotation: 0 })), [
  17827. drawObject(xObjectKey),
  17828. popGraphicsState()
  17829. ]).filter(Boolean);
  17830. page.pushOperators.apply(page, operators);
  17831. }
  17832. this.removeField(field);
  17833. }
  17834. };
  17835. PDFForm2.prototype.removeField = function(field) {
  17836. var widgets = field.acroField.getWidgets();
  17837. var pages = /* @__PURE__ */ new Set();
  17838. for (var i = 0, len = widgets.length; i < len; i++) {
  17839. var widget = widgets[i];
  17840. var widgetRef = this.findWidgetAppearanceRef(field, widget);
  17841. var page = this.findWidgetPage(widget);
  17842. pages.add(page);
  17843. page.node.removeAnnot(widgetRef);
  17844. }
  17845. pages.forEach(function(page2) {
  17846. return page2.node.removeAnnot(field.ref);
  17847. });
  17848. this.acroForm.removeField(field.acroField);
  17849. var fieldKids = field.acroField.normalizedEntries().Kids;
  17850. var kidsCount = fieldKids.size();
  17851. for (var childIndex = 0; childIndex < kidsCount; childIndex++) {
  17852. var child = fieldKids.get(childIndex);
  17853. if (child instanceof PDFRef_default) {
  17854. this.doc.context.delete(child);
  17855. }
  17856. }
  17857. this.doc.context.delete(field.ref);
  17858. };
  17859. PDFForm2.prototype.updateFieldAppearances = function(font) {
  17860. assertOrUndefined(font, "font", [[PDFFont_default, "PDFFont"]]);
  17861. font = font !== null && font !== void 0 ? font : this.getDefaultFont();
  17862. var fields = this.getFields();
  17863. for (var idx = 0, len = fields.length; idx < len; idx++) {
  17864. var field = fields[idx];
  17865. if (field.needsAppearancesUpdate()) {
  17866. field.defaultUpdateAppearances(font);
  17867. }
  17868. }
  17869. };
  17870. PDFForm2.prototype.markFieldAsDirty = function(fieldRef) {
  17871. assertOrUndefined(fieldRef, "fieldRef", [[PDFRef_default, "PDFRef"]]);
  17872. this.dirtyFields.add(fieldRef);
  17873. };
  17874. PDFForm2.prototype.markFieldAsClean = function(fieldRef) {
  17875. assertOrUndefined(fieldRef, "fieldRef", [[PDFRef_default, "PDFRef"]]);
  17876. this.dirtyFields.delete(fieldRef);
  17877. };
  17878. PDFForm2.prototype.fieldIsDirty = function(fieldRef) {
  17879. assertOrUndefined(fieldRef, "fieldRef", [[PDFRef_default, "PDFRef"]]);
  17880. return this.dirtyFields.has(fieldRef);
  17881. };
  17882. PDFForm2.prototype.getDefaultFont = function() {
  17883. return this.defaultFontCache.access();
  17884. };
  17885. PDFForm2.prototype.findWidgetPage = function(widget) {
  17886. var pageRef = widget.P();
  17887. var page = this.doc.getPages().find(function(x) {
  17888. return x.ref === pageRef;
  17889. });
  17890. if (page === void 0) {
  17891. var widgetRef = this.doc.context.getObjectRef(widget.dict);
  17892. if (widgetRef === void 0) {
  17893. throw new Error("Could not find PDFRef for PDFObject");
  17894. }
  17895. page = this.doc.findPageForAnnotationRef(widgetRef);
  17896. if (page === void 0) {
  17897. throw new Error("Could not find page for PDFRef " + widgetRef);
  17898. }
  17899. }
  17900. return page;
  17901. };
  17902. PDFForm2.prototype.findWidgetAppearanceRef = function(field, widget) {
  17903. var _a;
  17904. var refOrDict = widget.getNormalAppearance();
  17905. if (refOrDict instanceof PDFDict_default && (field instanceof PDFCheckBox_default || field instanceof PDFRadioGroup_default)) {
  17906. var value = field.acroField.getValue();
  17907. var ref = (_a = refOrDict.get(value)) !== null && _a !== void 0 ? _a : refOrDict.get(PDFName_default.of("Off"));
  17908. if (ref instanceof PDFRef_default) {
  17909. refOrDict = ref;
  17910. }
  17911. }
  17912. if (!(refOrDict instanceof PDFRef_default)) {
  17913. var name_1 = field.getName();
  17914. throw new Error("Failed to extract appearance ref for: " + name_1);
  17915. }
  17916. return refOrDict;
  17917. };
  17918. PDFForm2.prototype.findOrCreateNonTerminals = function(partialNames) {
  17919. var nonTerminal = [
  17920. this.acroForm
  17921. ];
  17922. for (var idx = 0, len = partialNames.length; idx < len; idx++) {
  17923. var namePart = partialNames[idx];
  17924. if (!namePart)
  17925. throw new InvalidFieldNamePartError(namePart);
  17926. var parent_1 = nonTerminal[0], parentRef = nonTerminal[1];
  17927. var res = this.findNonTerminal(namePart, parent_1);
  17928. if (res) {
  17929. nonTerminal = res;
  17930. } else {
  17931. var node = PDFAcroNonTerminal_default.create(this.doc.context);
  17932. node.setPartialName(namePart);
  17933. node.setParent(parentRef);
  17934. var nodeRef = this.doc.context.register(node.dict);
  17935. parent_1.addField(nodeRef);
  17936. nonTerminal = [node, nodeRef];
  17937. }
  17938. }
  17939. return nonTerminal;
  17940. };
  17941. PDFForm2.prototype.findNonTerminal = function(partialName, parent) {
  17942. var fields = parent instanceof PDFAcroForm_default ? this.acroForm.getFields() : createPDFAcroFields(parent.Kids());
  17943. for (var idx = 0, len = fields.length; idx < len; idx++) {
  17944. var _a = fields[idx], field = _a[0], ref = _a[1];
  17945. if (field.getPartialName() === partialName) {
  17946. if (field instanceof PDFAcroNonTerminal_default)
  17947. return [field, ref];
  17948. throw new FieldAlreadyExistsError(partialName);
  17949. }
  17950. }
  17951. return void 0;
  17952. };
  17953. PDFForm2.of = function(acroForm, doc) {
  17954. return new PDFForm2(acroForm, doc);
  17955. };
  17956. return PDFForm2;
  17957. }()
  17958. );
  17959. var PDFForm_default = PDFForm;
  17960. var convertToPDFField = function(field, ref, doc) {
  17961. if (field instanceof PDFAcroPushButton_default)
  17962. return PDFButton_default.of(field, ref, doc);
  17963. if (field instanceof PDFAcroCheckBox_default)
  17964. return PDFCheckBox_default.of(field, ref, doc);
  17965. if (field instanceof PDFAcroComboBox_default)
  17966. return PDFDropdown_default.of(field, ref, doc);
  17967. if (field instanceof PDFAcroListBox_default)
  17968. return PDFOptionList_default.of(field, ref, doc);
  17969. if (field instanceof PDFAcroText_default)
  17970. return PDFTextField_default.of(field, ref, doc);
  17971. if (field instanceof PDFAcroRadioButton_default) {
  17972. return PDFRadioGroup_default.of(field, ref, doc);
  17973. }
  17974. if (field instanceof PDFAcroSignature_default) {
  17975. return PDFSignature_default.of(field, ref, doc);
  17976. }
  17977. return void 0;
  17978. };
  17979. var splitFieldName = function(fullyQualifiedName) {
  17980. if (fullyQualifiedName.length === 0) {
  17981. throw new Error("PDF field names must not be empty strings");
  17982. }
  17983. var parts = fullyQualifiedName.split(".");
  17984. for (var idx = 0, len = parts.length; idx < len; idx++) {
  17985. if (parts[idx] === "") {
  17986. throw new Error('Periods in PDF field names must be separated by at least one character: "' + fullyQualifiedName + '"');
  17987. }
  17988. }
  17989. if (parts.length === 1)
  17990. return { nonTerminal: [], terminal: parts[0] };
  17991. return {
  17992. nonTerminal: parts.slice(0, parts.length - 1),
  17993. terminal: parts[parts.length - 1]
  17994. };
  17995. };
  17996. var addFieldToParent = function(_a, _b, partialName) {
  17997. var parent = _a[0], parentRef = _a[1];
  17998. var field = _b[0], fieldRef = _b[1];
  17999. var entries = parent.normalizedEntries();
  18000. var fields = createPDFAcroFields("Kids" in entries ? entries.Kids : entries.Fields);
  18001. for (var idx = 0, len = fields.length; idx < len; idx++) {
  18002. if (fields[idx][0].getPartialName() === partialName) {
  18003. throw new FieldAlreadyExistsError(partialName);
  18004. }
  18005. }
  18006. parent.addField(fieldRef);
  18007. field.setParent(parentRef);
  18008. };
  18009. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/api/sizes.js
  18010. var PageSizes = {
  18011. "4A0": [4767.87, 6740.79],
  18012. "2A0": [3370.39, 4767.87],
  18013. A0: [2383.94, 3370.39],
  18014. A1: [1683.78, 2383.94],
  18015. A2: [1190.55, 1683.78],
  18016. A3: [841.89, 1190.55],
  18017. A4: [595.28, 841.89],
  18018. A5: [419.53, 595.28],
  18019. A6: [297.64, 419.53],
  18020. A7: [209.76, 297.64],
  18021. A8: [147.4, 209.76],
  18022. A9: [104.88, 147.4],
  18023. A10: [73.7, 104.88],
  18024. B0: [2834.65, 4008.19],
  18025. B1: [2004.09, 2834.65],
  18026. B2: [1417.32, 2004.09],
  18027. B3: [1000.63, 1417.32],
  18028. B4: [708.66, 1000.63],
  18029. B5: [498.9, 708.66],
  18030. B6: [354.33, 498.9],
  18031. B7: [249.45, 354.33],
  18032. B8: [175.75, 249.45],
  18033. B9: [124.72, 175.75],
  18034. B10: [87.87, 124.72],
  18035. C0: [2599.37, 3676.54],
  18036. C1: [1836.85, 2599.37],
  18037. C2: [1298.27, 1836.85],
  18038. C3: [918.43, 1298.27],
  18039. C4: [649.13, 918.43],
  18040. C5: [459.21, 649.13],
  18041. C6: [323.15, 459.21],
  18042. C7: [229.61, 323.15],
  18043. C8: [161.57, 229.61],
  18044. C9: [113.39, 161.57],
  18045. C10: [79.37, 113.39],
  18046. RA0: [2437.8, 3458.27],
  18047. RA1: [1729.13, 2437.8],
  18048. RA2: [1218.9, 1729.13],
  18049. RA3: [864.57, 1218.9],
  18050. RA4: [609.45, 864.57],
  18051. SRA0: [2551.18, 3628.35],
  18052. SRA1: [1814.17, 2551.18],
  18053. SRA2: [1275.59, 1814.17],
  18054. SRA3: [907.09, 1275.59],
  18055. SRA4: [637.8, 907.09],
  18056. Executive: [521.86, 756],
  18057. Folio: [612, 936],
  18058. Legal: [612, 1008],
  18059. Letter: [612, 792],
  18060. Tabloid: [792, 1224]
  18061. };
  18062. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/api/PDFDocumentOptions.js
  18063. var ParseSpeeds;
  18064. (function(ParseSpeeds2) {
  18065. ParseSpeeds2[ParseSpeeds2["Fastest"] = Infinity] = "Fastest";
  18066. ParseSpeeds2[ParseSpeeds2["Fast"] = 1500] = "Fast";
  18067. ParseSpeeds2[ParseSpeeds2["Medium"] = 500] = "Medium";
  18068. ParseSpeeds2[ParseSpeeds2["Slow"] = 100] = "Slow";
  18069. })(ParseSpeeds || (ParseSpeeds = {}));
  18070. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/api/PDFEmbeddedFile.js
  18071. var PDFEmbeddedFile = (
  18072. /** @class */
  18073. function() {
  18074. function PDFEmbeddedFile2(ref, doc, embedder) {
  18075. this.alreadyEmbedded = false;
  18076. this.ref = ref;
  18077. this.doc = doc;
  18078. this.embedder = embedder;
  18079. }
  18080. PDFEmbeddedFile2.prototype.embed = function() {
  18081. return __awaiter(this, void 0, void 0, function() {
  18082. var ref, Names, EmbeddedFiles, EFNames, AF;
  18083. return __generator(this, function(_a) {
  18084. switch (_a.label) {
  18085. case 0:
  18086. if (!!this.alreadyEmbedded) return [3, 2];
  18087. return [4, this.embedder.embedIntoContext(this.doc.context, this.ref)];
  18088. case 1:
  18089. ref = _a.sent();
  18090. if (!this.doc.catalog.has(PDFName_default.of("Names"))) {
  18091. this.doc.catalog.set(PDFName_default.of("Names"), this.doc.context.obj({}));
  18092. }
  18093. Names = this.doc.catalog.lookup(PDFName_default.of("Names"), PDFDict_default);
  18094. if (!Names.has(PDFName_default.of("EmbeddedFiles"))) {
  18095. Names.set(PDFName_default.of("EmbeddedFiles"), this.doc.context.obj({}));
  18096. }
  18097. EmbeddedFiles = Names.lookup(PDFName_default.of("EmbeddedFiles"), PDFDict_default);
  18098. if (!EmbeddedFiles.has(PDFName_default.of("Names"))) {
  18099. EmbeddedFiles.set(PDFName_default.of("Names"), this.doc.context.obj([]));
  18100. }
  18101. EFNames = EmbeddedFiles.lookup(PDFName_default.of("Names"), PDFArray_default);
  18102. EFNames.push(PDFHexString_default.fromText(this.embedder.fileName));
  18103. EFNames.push(ref);
  18104. if (!this.doc.catalog.has(PDFName_default.of("AF"))) {
  18105. this.doc.catalog.set(PDFName_default.of("AF"), this.doc.context.obj([]));
  18106. }
  18107. AF = this.doc.catalog.lookup(PDFName_default.of("AF"), PDFArray_default);
  18108. AF.push(ref);
  18109. this.alreadyEmbedded = true;
  18110. _a.label = 2;
  18111. case 2:
  18112. return [
  18113. 2
  18114. /*return*/
  18115. ];
  18116. }
  18117. });
  18118. });
  18119. };
  18120. PDFEmbeddedFile2.of = function(ref, doc, embedder) {
  18121. return new PDFEmbeddedFile2(ref, doc, embedder);
  18122. };
  18123. return PDFEmbeddedFile2;
  18124. }()
  18125. );
  18126. var PDFEmbeddedFile_default = PDFEmbeddedFile;
  18127. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/api/PDFJavaScript.js
  18128. var PDFJavaScript = (
  18129. /** @class */
  18130. function() {
  18131. function PDFJavaScript2(ref, doc, embedder) {
  18132. this.alreadyEmbedded = false;
  18133. this.ref = ref;
  18134. this.doc = doc;
  18135. this.embedder = embedder;
  18136. }
  18137. PDFJavaScript2.prototype.embed = function() {
  18138. return __awaiter(this, void 0, void 0, function() {
  18139. var _a, catalog, context, ref, Names, Javascript, JSNames;
  18140. return __generator(this, function(_b) {
  18141. switch (_b.label) {
  18142. case 0:
  18143. if (!!this.alreadyEmbedded) return [3, 2];
  18144. _a = this.doc, catalog = _a.catalog, context = _a.context;
  18145. return [4, this.embedder.embedIntoContext(this.doc.context, this.ref)];
  18146. case 1:
  18147. ref = _b.sent();
  18148. if (!catalog.has(PDFName_default.of("Names"))) {
  18149. catalog.set(PDFName_default.of("Names"), context.obj({}));
  18150. }
  18151. Names = catalog.lookup(PDFName_default.of("Names"), PDFDict_default);
  18152. if (!Names.has(PDFName_default.of("JavaScript"))) {
  18153. Names.set(PDFName_default.of("JavaScript"), context.obj({}));
  18154. }
  18155. Javascript = Names.lookup(PDFName_default.of("JavaScript"), PDFDict_default);
  18156. if (!Javascript.has(PDFName_default.of("Names"))) {
  18157. Javascript.set(PDFName_default.of("Names"), context.obj([]));
  18158. }
  18159. JSNames = Javascript.lookup(PDFName_default.of("Names"), PDFArray_default);
  18160. JSNames.push(PDFHexString_default.fromText(this.embedder.scriptName));
  18161. JSNames.push(ref);
  18162. this.alreadyEmbedded = true;
  18163. _b.label = 2;
  18164. case 2:
  18165. return [
  18166. 2
  18167. /*return*/
  18168. ];
  18169. }
  18170. });
  18171. });
  18172. };
  18173. PDFJavaScript2.of = function(ref, doc, embedder) {
  18174. return new PDFJavaScript2(ref, doc, embedder);
  18175. };
  18176. return PDFJavaScript2;
  18177. }()
  18178. );
  18179. var PDFJavaScript_default = PDFJavaScript;
  18180. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/core/embedders/JavaScriptEmbedder.js
  18181. var JavaScriptEmbedder = (
  18182. /** @class */
  18183. function() {
  18184. function JavaScriptEmbedder2(script, scriptName) {
  18185. this.script = script;
  18186. this.scriptName = scriptName;
  18187. }
  18188. JavaScriptEmbedder2.for = function(script, scriptName) {
  18189. return new JavaScriptEmbedder2(script, scriptName);
  18190. };
  18191. JavaScriptEmbedder2.prototype.embedIntoContext = function(context, ref) {
  18192. return __awaiter(this, void 0, void 0, function() {
  18193. var jsActionDict;
  18194. return __generator(this, function(_a) {
  18195. jsActionDict = context.obj({
  18196. Type: "Action",
  18197. S: "JavaScript",
  18198. JS: PDFHexString_default.fromText(this.script)
  18199. });
  18200. if (ref) {
  18201. context.assign(ref, jsActionDict);
  18202. return [2, ref];
  18203. } else {
  18204. return [2, context.register(jsActionDict)];
  18205. }
  18206. return [
  18207. 2
  18208. /*return*/
  18209. ];
  18210. });
  18211. });
  18212. };
  18213. return JavaScriptEmbedder2;
  18214. }()
  18215. );
  18216. var JavaScriptEmbedder_default = JavaScriptEmbedder;
  18217. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/api/PDFDocument.js
  18218. var PDFDocument = (
  18219. /** @class */
  18220. function() {
  18221. function PDFDocument2(context, ignoreEncryption, updateMetadata) {
  18222. var _this = this;
  18223. this.defaultWordBreaks = [" "];
  18224. this.computePages = function() {
  18225. var pages = [];
  18226. _this.catalog.Pages().traverse(function(node, ref) {
  18227. if (node instanceof PDFPageLeaf_default) {
  18228. var page = _this.pageMap.get(node);
  18229. if (!page) {
  18230. page = PDFPage_default.of(node, ref, _this);
  18231. _this.pageMap.set(node, page);
  18232. }
  18233. pages.push(page);
  18234. }
  18235. });
  18236. return pages;
  18237. };
  18238. this.getOrCreateForm = function() {
  18239. var acroForm = _this.catalog.getOrCreateAcroForm();
  18240. return PDFForm_default.of(acroForm, _this);
  18241. };
  18242. assertIs(context, "context", [[PDFContext_default, "PDFContext"]]);
  18243. assertIs(ignoreEncryption, "ignoreEncryption", ["boolean"]);
  18244. this.context = context;
  18245. this.catalog = context.lookup(context.trailerInfo.Root);
  18246. this.isEncrypted = !!context.lookup(context.trailerInfo.Encrypt);
  18247. this.pageCache = Cache_default.populatedBy(this.computePages);
  18248. this.pageMap = /* @__PURE__ */ new Map();
  18249. this.formCache = Cache_default.populatedBy(this.getOrCreateForm);
  18250. this.fonts = [];
  18251. this.images = [];
  18252. this.embeddedPages = [];
  18253. this.embeddedFiles = [];
  18254. this.javaScripts = [];
  18255. if (!ignoreEncryption && this.isEncrypted)
  18256. throw new EncryptedPDFError();
  18257. if (updateMetadata)
  18258. this.updateInfoDict();
  18259. }
  18260. PDFDocument2.load = function(pdf, options) {
  18261. if (options === void 0) {
  18262. options = {};
  18263. }
  18264. return __awaiter(this, void 0, void 0, function() {
  18265. var _a, ignoreEncryption, _b, parseSpeed, _c, throwOnInvalidObject, _d, updateMetadata, _e, capNumbers, bytes, context;
  18266. return __generator(this, function(_f) {
  18267. switch (_f.label) {
  18268. case 0:
  18269. _a = options.ignoreEncryption, ignoreEncryption = _a === void 0 ? false : _a, _b = options.parseSpeed, parseSpeed = _b === void 0 ? ParseSpeeds.Slow : _b, _c = options.throwOnInvalidObject, throwOnInvalidObject = _c === void 0 ? false : _c, _d = options.updateMetadata, updateMetadata = _d === void 0 ? true : _d, _e = options.capNumbers, capNumbers = _e === void 0 ? false : _e;
  18270. assertIs(pdf, "pdf", ["string", Uint8Array, ArrayBuffer]);
  18271. assertIs(ignoreEncryption, "ignoreEncryption", ["boolean"]);
  18272. assertIs(parseSpeed, "parseSpeed", ["number"]);
  18273. assertIs(throwOnInvalidObject, "throwOnInvalidObject", ["boolean"]);
  18274. bytes = toUint8Array(pdf);
  18275. return [4, PDFParser_default.forBytesWithOptions(bytes, parseSpeed, throwOnInvalidObject, capNumbers).parseDocument()];
  18276. case 1:
  18277. context = _f.sent();
  18278. return [2, new PDFDocument2(context, ignoreEncryption, updateMetadata)];
  18279. }
  18280. });
  18281. });
  18282. };
  18283. PDFDocument2.create = function(options) {
  18284. if (options === void 0) {
  18285. options = {};
  18286. }
  18287. return __awaiter(this, void 0, void 0, function() {
  18288. var _a, updateMetadata, context, pageTree, pageTreeRef, catalog;
  18289. return __generator(this, function(_b) {
  18290. _a = options.updateMetadata, updateMetadata = _a === void 0 ? true : _a;
  18291. context = PDFContext_default.create();
  18292. pageTree = PDFPageTree_default.withContext(context);
  18293. pageTreeRef = context.register(pageTree);
  18294. catalog = PDFCatalog_default.withContextAndPages(context, pageTreeRef);
  18295. context.trailerInfo.Root = context.register(catalog);
  18296. return [2, new PDFDocument2(context, false, updateMetadata)];
  18297. });
  18298. });
  18299. };
  18300. PDFDocument2.prototype.registerFontkit = function(fontkit) {
  18301. this.fontkit = fontkit;
  18302. };
  18303. PDFDocument2.prototype.getForm = function() {
  18304. var form = this.formCache.access();
  18305. if (form.hasXFA()) {
  18306. console.warn("Removing XFA form data as pdf-lib does not support reading or writing XFA");
  18307. form.deleteXFA();
  18308. }
  18309. return form;
  18310. };
  18311. PDFDocument2.prototype.getTitle = function() {
  18312. var title = this.getInfoDict().lookup(PDFName_default.Title);
  18313. if (!title)
  18314. return void 0;
  18315. assertIsLiteralOrHexString(title);
  18316. return title.decodeText();
  18317. };
  18318. PDFDocument2.prototype.getAuthor = function() {
  18319. var author = this.getInfoDict().lookup(PDFName_default.Author);
  18320. if (!author)
  18321. return void 0;
  18322. assertIsLiteralOrHexString(author);
  18323. return author.decodeText();
  18324. };
  18325. PDFDocument2.prototype.getSubject = function() {
  18326. var subject = this.getInfoDict().lookup(PDFName_default.Subject);
  18327. if (!subject)
  18328. return void 0;
  18329. assertIsLiteralOrHexString(subject);
  18330. return subject.decodeText();
  18331. };
  18332. PDFDocument2.prototype.getKeywords = function() {
  18333. var keywords = this.getInfoDict().lookup(PDFName_default.Keywords);
  18334. if (!keywords)
  18335. return void 0;
  18336. assertIsLiteralOrHexString(keywords);
  18337. return keywords.decodeText();
  18338. };
  18339. PDFDocument2.prototype.getCreator = function() {
  18340. var creator = this.getInfoDict().lookup(PDFName_default.Creator);
  18341. if (!creator)
  18342. return void 0;
  18343. assertIsLiteralOrHexString(creator);
  18344. return creator.decodeText();
  18345. };
  18346. PDFDocument2.prototype.getProducer = function() {
  18347. var producer = this.getInfoDict().lookup(PDFName_default.Producer);
  18348. if (!producer)
  18349. return void 0;
  18350. assertIsLiteralOrHexString(producer);
  18351. return producer.decodeText();
  18352. };
  18353. PDFDocument2.prototype.getCreationDate = function() {
  18354. var creationDate = this.getInfoDict().lookup(PDFName_default.CreationDate);
  18355. if (!creationDate)
  18356. return void 0;
  18357. assertIsLiteralOrHexString(creationDate);
  18358. return creationDate.decodeDate();
  18359. };
  18360. PDFDocument2.prototype.getModificationDate = function() {
  18361. var modificationDate = this.getInfoDict().lookup(PDFName_default.ModDate);
  18362. if (!modificationDate)
  18363. return void 0;
  18364. assertIsLiteralOrHexString(modificationDate);
  18365. return modificationDate.decodeDate();
  18366. };
  18367. PDFDocument2.prototype.setTitle = function(title, options) {
  18368. assertIs(title, "title", ["string"]);
  18369. var key = PDFName_default.of("Title");
  18370. this.getInfoDict().set(key, PDFHexString_default.fromText(title));
  18371. if (options === null || options === void 0 ? void 0 : options.showInWindowTitleBar) {
  18372. var prefs = this.catalog.getOrCreateViewerPreferences();
  18373. prefs.setDisplayDocTitle(true);
  18374. }
  18375. };
  18376. PDFDocument2.prototype.setAuthor = function(author) {
  18377. assertIs(author, "author", ["string"]);
  18378. var key = PDFName_default.of("Author");
  18379. this.getInfoDict().set(key, PDFHexString_default.fromText(author));
  18380. };
  18381. PDFDocument2.prototype.setSubject = function(subject) {
  18382. assertIs(subject, "author", ["string"]);
  18383. var key = PDFName_default.of("Subject");
  18384. this.getInfoDict().set(key, PDFHexString_default.fromText(subject));
  18385. };
  18386. PDFDocument2.prototype.setKeywords = function(keywords) {
  18387. assertIs(keywords, "keywords", [Array]);
  18388. var key = PDFName_default.of("Keywords");
  18389. this.getInfoDict().set(key, PDFHexString_default.fromText(keywords.join(" ")));
  18390. };
  18391. PDFDocument2.prototype.setCreator = function(creator) {
  18392. assertIs(creator, "creator", ["string"]);
  18393. var key = PDFName_default.of("Creator");
  18394. this.getInfoDict().set(key, PDFHexString_default.fromText(creator));
  18395. };
  18396. PDFDocument2.prototype.setProducer = function(producer) {
  18397. assertIs(producer, "creator", ["string"]);
  18398. var key = PDFName_default.of("Producer");
  18399. this.getInfoDict().set(key, PDFHexString_default.fromText(producer));
  18400. };
  18401. PDFDocument2.prototype.setLanguage = function(language) {
  18402. assertIs(language, "language", ["string"]);
  18403. var key = PDFName_default.of("Lang");
  18404. this.catalog.set(key, PDFString_default.of(language));
  18405. };
  18406. PDFDocument2.prototype.setCreationDate = function(creationDate) {
  18407. assertIs(creationDate, "creationDate", [[Date, "Date"]]);
  18408. var key = PDFName_default.of("CreationDate");
  18409. this.getInfoDict().set(key, PDFString_default.fromDate(creationDate));
  18410. };
  18411. PDFDocument2.prototype.setModificationDate = function(modificationDate) {
  18412. assertIs(modificationDate, "modificationDate", [[Date, "Date"]]);
  18413. var key = PDFName_default.of("ModDate");
  18414. this.getInfoDict().set(key, PDFString_default.fromDate(modificationDate));
  18415. };
  18416. PDFDocument2.prototype.getPageCount = function() {
  18417. if (this.pageCount === void 0)
  18418. this.pageCount = this.getPages().length;
  18419. return this.pageCount;
  18420. };
  18421. PDFDocument2.prototype.getPages = function() {
  18422. return this.pageCache.access();
  18423. };
  18424. PDFDocument2.prototype.getPage = function(index) {
  18425. var pages = this.getPages();
  18426. assertRange(index, "index", 0, pages.length - 1);
  18427. return pages[index];
  18428. };
  18429. PDFDocument2.prototype.getPageIndices = function() {
  18430. return range(0, this.getPageCount());
  18431. };
  18432. PDFDocument2.prototype.removePage = function(index) {
  18433. var pageCount = this.getPageCount();
  18434. if (this.pageCount === 0)
  18435. throw new RemovePageFromEmptyDocumentError();
  18436. assertRange(index, "index", 0, pageCount - 1);
  18437. this.catalog.removeLeafNode(index);
  18438. this.pageCount = pageCount - 1;
  18439. };
  18440. PDFDocument2.prototype.addPage = function(page) {
  18441. assertIs(page, "page", ["undefined", [PDFPage_default, "PDFPage"], Array]);
  18442. return this.insertPage(this.getPageCount(), page);
  18443. };
  18444. PDFDocument2.prototype.insertPage = function(index, page) {
  18445. var pageCount = this.getPageCount();
  18446. assertRange(index, "index", 0, pageCount);
  18447. assertIs(page, "page", ["undefined", [PDFPage_default, "PDFPage"], Array]);
  18448. if (!page || Array.isArray(page)) {
  18449. var dims = Array.isArray(page) ? page : PageSizes.A4;
  18450. page = PDFPage_default.create(this);
  18451. page.setSize.apply(page, dims);
  18452. } else if (page.doc !== this) {
  18453. throw new ForeignPageError();
  18454. }
  18455. var parentRef = this.catalog.insertLeafNode(page.ref, index);
  18456. page.node.setParent(parentRef);
  18457. this.pageMap.set(page.node, page);
  18458. this.pageCache.invalidate();
  18459. this.pageCount = pageCount + 1;
  18460. return page;
  18461. };
  18462. PDFDocument2.prototype.copyPages = function(srcDoc, indices) {
  18463. return __awaiter(this, void 0, void 0, function() {
  18464. var copier, srcPages, copiedPages, idx, len, srcPage, copiedPage, ref;
  18465. return __generator(this, function(_a) {
  18466. switch (_a.label) {
  18467. case 0:
  18468. assertIs(srcDoc, "srcDoc", [[PDFDocument2, "PDFDocument"]]);
  18469. assertIs(indices, "indices", [Array]);
  18470. return [4, srcDoc.flush()];
  18471. case 1:
  18472. _a.sent();
  18473. copier = PDFObjectCopier_default.for(srcDoc.context, this.context);
  18474. srcPages = srcDoc.getPages();
  18475. copiedPages = new Array(indices.length);
  18476. for (idx = 0, len = indices.length; idx < len; idx++) {
  18477. srcPage = srcPages[indices[idx]];
  18478. copiedPage = copier.copy(srcPage.node);
  18479. ref = this.context.register(copiedPage);
  18480. copiedPages[idx] = PDFPage_default.of(copiedPage, ref, this);
  18481. }
  18482. return [2, copiedPages];
  18483. }
  18484. });
  18485. });
  18486. };
  18487. PDFDocument2.prototype.copy = function() {
  18488. return __awaiter(this, void 0, void 0, function() {
  18489. var pdfCopy, contentPages, idx, len;
  18490. return __generator(this, function(_a) {
  18491. switch (_a.label) {
  18492. case 0:
  18493. return [4, PDFDocument2.create()];
  18494. case 1:
  18495. pdfCopy = _a.sent();
  18496. return [4, pdfCopy.copyPages(this, this.getPageIndices())];
  18497. case 2:
  18498. contentPages = _a.sent();
  18499. for (idx = 0, len = contentPages.length; idx < len; idx++) {
  18500. pdfCopy.addPage(contentPages[idx]);
  18501. }
  18502. if (this.getAuthor() !== void 0) {
  18503. pdfCopy.setAuthor(this.getAuthor());
  18504. }
  18505. if (this.getCreationDate() !== void 0) {
  18506. pdfCopy.setCreationDate(this.getCreationDate());
  18507. }
  18508. if (this.getCreator() !== void 0) {
  18509. pdfCopy.setCreator(this.getCreator());
  18510. }
  18511. if (this.getModificationDate() !== void 0) {
  18512. pdfCopy.setModificationDate(this.getModificationDate());
  18513. }
  18514. if (this.getProducer() !== void 0) {
  18515. pdfCopy.setProducer(this.getProducer());
  18516. }
  18517. if (this.getSubject() !== void 0) {
  18518. pdfCopy.setSubject(this.getSubject());
  18519. }
  18520. if (this.getTitle() !== void 0) {
  18521. pdfCopy.setTitle(this.getTitle());
  18522. }
  18523. pdfCopy.defaultWordBreaks = this.defaultWordBreaks;
  18524. return [2, pdfCopy];
  18525. }
  18526. });
  18527. });
  18528. };
  18529. PDFDocument2.prototype.addJavaScript = function(name, script) {
  18530. assertIs(name, "name", ["string"]);
  18531. assertIs(script, "script", ["string"]);
  18532. var embedder = JavaScriptEmbedder_default.for(script, name);
  18533. var ref = this.context.nextRef();
  18534. var javaScript = PDFJavaScript_default.of(ref, this, embedder);
  18535. this.javaScripts.push(javaScript);
  18536. };
  18537. PDFDocument2.prototype.attach = function(attachment, name, options) {
  18538. if (options === void 0) {
  18539. options = {};
  18540. }
  18541. return __awaiter(this, void 0, void 0, function() {
  18542. var bytes, embedder, ref, embeddedFile;
  18543. return __generator(this, function(_a) {
  18544. assertIs(attachment, "attachment", ["string", Uint8Array, ArrayBuffer]);
  18545. assertIs(name, "name", ["string"]);
  18546. assertOrUndefined(options.mimeType, "mimeType", ["string"]);
  18547. assertOrUndefined(options.description, "description", ["string"]);
  18548. assertOrUndefined(options.creationDate, "options.creationDate", [Date]);
  18549. assertOrUndefined(options.modificationDate, "options.modificationDate", [
  18550. Date
  18551. ]);
  18552. assertIsOneOfOrUndefined(options.afRelationship, "options.afRelationship", AFRelationship);
  18553. bytes = toUint8Array(attachment);
  18554. embedder = FileEmbedder_default.for(bytes, name, options);
  18555. ref = this.context.nextRef();
  18556. embeddedFile = PDFEmbeddedFile_default.of(ref, this, embedder);
  18557. this.embeddedFiles.push(embeddedFile);
  18558. return [
  18559. 2
  18560. /*return*/
  18561. ];
  18562. });
  18563. });
  18564. };
  18565. PDFDocument2.prototype.embedFont = function(font, options) {
  18566. if (options === void 0) {
  18567. options = {};
  18568. }
  18569. return __awaiter(this, void 0, void 0, function() {
  18570. var _a, subset, customName, features, embedder, bytes, fontkit, _b, ref, pdfFont;
  18571. return __generator(this, function(_c) {
  18572. switch (_c.label) {
  18573. case 0:
  18574. _a = options.subset, subset = _a === void 0 ? false : _a, customName = options.customName, features = options.features;
  18575. assertIs(font, "font", ["string", Uint8Array, ArrayBuffer]);
  18576. assertIs(subset, "subset", ["boolean"]);
  18577. if (!isStandardFont(font)) return [3, 1];
  18578. embedder = StandardFontEmbedder_default.for(font, customName);
  18579. return [3, 7];
  18580. case 1:
  18581. if (!canBeConvertedToUint8Array(font)) return [3, 6];
  18582. bytes = toUint8Array(font);
  18583. fontkit = this.assertFontkit();
  18584. if (!subset) return [3, 3];
  18585. return [4, CustomFontSubsetEmbedder_default.for(fontkit, bytes, customName, features)];
  18586. case 2:
  18587. _b = _c.sent();
  18588. return [3, 5];
  18589. case 3:
  18590. return [4, CustomFontEmbedder_default.for(fontkit, bytes, customName, features)];
  18591. case 4:
  18592. _b = _c.sent();
  18593. _c.label = 5;
  18594. case 5:
  18595. embedder = _b;
  18596. return [3, 7];
  18597. case 6:
  18598. throw new TypeError("`font` must be one of `StandardFonts | string | Uint8Array | ArrayBuffer`");
  18599. case 7:
  18600. ref = this.context.nextRef();
  18601. pdfFont = PDFFont_default.of(ref, this, embedder);
  18602. this.fonts.push(pdfFont);
  18603. return [2, pdfFont];
  18604. }
  18605. });
  18606. });
  18607. };
  18608. PDFDocument2.prototype.embedStandardFont = function(font, customName) {
  18609. assertIs(font, "font", ["string"]);
  18610. if (!isStandardFont(font)) {
  18611. throw new TypeError("`font` must be one of type `StandardFonts`");
  18612. }
  18613. var embedder = StandardFontEmbedder_default.for(font, customName);
  18614. var ref = this.context.nextRef();
  18615. var pdfFont = PDFFont_default.of(ref, this, embedder);
  18616. this.fonts.push(pdfFont);
  18617. return pdfFont;
  18618. };
  18619. PDFDocument2.prototype.embedJpg = function(jpg) {
  18620. return __awaiter(this, void 0, void 0, function() {
  18621. var bytes, embedder, ref, pdfImage;
  18622. return __generator(this, function(_a) {
  18623. switch (_a.label) {
  18624. case 0:
  18625. assertIs(jpg, "jpg", ["string", Uint8Array, ArrayBuffer]);
  18626. bytes = toUint8Array(jpg);
  18627. return [4, JpegEmbedder_default.for(bytes)];
  18628. case 1:
  18629. embedder = _a.sent();
  18630. ref = this.context.nextRef();
  18631. pdfImage = PDFImage_default.of(ref, this, embedder);
  18632. this.images.push(pdfImage);
  18633. return [2, pdfImage];
  18634. }
  18635. });
  18636. });
  18637. };
  18638. PDFDocument2.prototype.embedPng = function(png) {
  18639. return __awaiter(this, void 0, void 0, function() {
  18640. var bytes, embedder, ref, pdfImage;
  18641. return __generator(this, function(_a) {
  18642. switch (_a.label) {
  18643. case 0:
  18644. assertIs(png, "png", ["string", Uint8Array, ArrayBuffer]);
  18645. bytes = toUint8Array(png);
  18646. return [4, PngEmbedder_default.for(bytes)];
  18647. case 1:
  18648. embedder = _a.sent();
  18649. ref = this.context.nextRef();
  18650. pdfImage = PDFImage_default.of(ref, this, embedder);
  18651. this.images.push(pdfImage);
  18652. return [2, pdfImage];
  18653. }
  18654. });
  18655. });
  18656. };
  18657. PDFDocument2.prototype.embedPdf = function(pdf, indices) {
  18658. if (indices === void 0) {
  18659. indices = [0];
  18660. }
  18661. return __awaiter(this, void 0, void 0, function() {
  18662. var srcDoc, _a, srcPages;
  18663. return __generator(this, function(_b) {
  18664. switch (_b.label) {
  18665. case 0:
  18666. assertIs(pdf, "pdf", [
  18667. "string",
  18668. Uint8Array,
  18669. ArrayBuffer,
  18670. [PDFDocument2, "PDFDocument"]
  18671. ]);
  18672. assertIs(indices, "indices", [Array]);
  18673. if (!(pdf instanceof PDFDocument2)) return [3, 1];
  18674. _a = pdf;
  18675. return [3, 3];
  18676. case 1:
  18677. return [4, PDFDocument2.load(pdf)];
  18678. case 2:
  18679. _a = _b.sent();
  18680. _b.label = 3;
  18681. case 3:
  18682. srcDoc = _a;
  18683. srcPages = pluckIndices(srcDoc.getPages(), indices);
  18684. return [2, this.embedPages(srcPages)];
  18685. }
  18686. });
  18687. });
  18688. };
  18689. PDFDocument2.prototype.embedPage = function(page, boundingBox, transformationMatrix) {
  18690. return __awaiter(this, void 0, void 0, function() {
  18691. var embeddedPage;
  18692. return __generator(this, function(_a) {
  18693. switch (_a.label) {
  18694. case 0:
  18695. assertIs(page, "page", [[PDFPage_default, "PDFPage"]]);
  18696. return [4, this.embedPages([page], [boundingBox], [transformationMatrix])];
  18697. case 1:
  18698. embeddedPage = _a.sent()[0];
  18699. return [2, embeddedPage];
  18700. }
  18701. });
  18702. });
  18703. };
  18704. PDFDocument2.prototype.embedPages = function(pages, boundingBoxes, transformationMatrices) {
  18705. if (boundingBoxes === void 0) {
  18706. boundingBoxes = [];
  18707. }
  18708. if (transformationMatrices === void 0) {
  18709. transformationMatrices = [];
  18710. }
  18711. return __awaiter(this, void 0, void 0, function() {
  18712. var idx, len, currPage, nextPage, context, maybeCopyPage, embeddedPages, idx, len, page, box, matrix, embedder, ref;
  18713. var _a;
  18714. return __generator(this, function(_b) {
  18715. switch (_b.label) {
  18716. case 0:
  18717. if (pages.length === 0)
  18718. return [2, []];
  18719. for (idx = 0, len = pages.length - 1; idx < len; idx++) {
  18720. currPage = pages[idx];
  18721. nextPage = pages[idx + 1];
  18722. if (currPage.node.context !== nextPage.node.context) {
  18723. throw new PageEmbeddingMismatchedContextError();
  18724. }
  18725. }
  18726. context = pages[0].node.context;
  18727. maybeCopyPage = context === this.context ? function(p) {
  18728. return p;
  18729. } : PDFObjectCopier_default.for(context, this.context).copy;
  18730. embeddedPages = new Array(pages.length);
  18731. idx = 0, len = pages.length;
  18732. _b.label = 1;
  18733. case 1:
  18734. if (!(idx < len)) return [3, 4];
  18735. page = maybeCopyPage(pages[idx].node);
  18736. box = boundingBoxes[idx];
  18737. matrix = transformationMatrices[idx];
  18738. return [4, PDFPageEmbedder_default.for(page, box, matrix)];
  18739. case 2:
  18740. embedder = _b.sent();
  18741. ref = this.context.nextRef();
  18742. embeddedPages[idx] = PDFEmbeddedPage_default.of(ref, this, embedder);
  18743. _b.label = 3;
  18744. case 3:
  18745. idx++;
  18746. return [3, 1];
  18747. case 4:
  18748. (_a = this.embeddedPages).push.apply(_a, embeddedPages);
  18749. return [2, embeddedPages];
  18750. }
  18751. });
  18752. });
  18753. };
  18754. PDFDocument2.prototype.flush = function() {
  18755. return __awaiter(this, void 0, void 0, function() {
  18756. return __generator(this, function(_a) {
  18757. switch (_a.label) {
  18758. case 0:
  18759. return [4, this.embedAll(this.fonts)];
  18760. case 1:
  18761. _a.sent();
  18762. return [4, this.embedAll(this.images)];
  18763. case 2:
  18764. _a.sent();
  18765. return [4, this.embedAll(this.embeddedPages)];
  18766. case 3:
  18767. _a.sent();
  18768. return [4, this.embedAll(this.embeddedFiles)];
  18769. case 4:
  18770. _a.sent();
  18771. return [4, this.embedAll(this.javaScripts)];
  18772. case 5:
  18773. _a.sent();
  18774. return [
  18775. 2
  18776. /*return*/
  18777. ];
  18778. }
  18779. });
  18780. });
  18781. };
  18782. PDFDocument2.prototype.save = function(options) {
  18783. if (options === void 0) {
  18784. options = {};
  18785. }
  18786. return __awaiter(this, void 0, void 0, function() {
  18787. var _a, useObjectStreams, _b, addDefaultPage, _c, objectsPerTick, _d, updateFieldAppearances, form, Writer;
  18788. return __generator(this, function(_e) {
  18789. switch (_e.label) {
  18790. case 0:
  18791. _a = options.useObjectStreams, useObjectStreams = _a === void 0 ? true : _a, _b = options.addDefaultPage, addDefaultPage = _b === void 0 ? true : _b, _c = options.objectsPerTick, objectsPerTick = _c === void 0 ? 50 : _c, _d = options.updateFieldAppearances, updateFieldAppearances = _d === void 0 ? true : _d;
  18792. assertIs(useObjectStreams, "useObjectStreams", ["boolean"]);
  18793. assertIs(addDefaultPage, "addDefaultPage", ["boolean"]);
  18794. assertIs(objectsPerTick, "objectsPerTick", ["number"]);
  18795. assertIs(updateFieldAppearances, "updateFieldAppearances", ["boolean"]);
  18796. if (addDefaultPage && this.getPageCount() === 0)
  18797. this.addPage();
  18798. if (updateFieldAppearances) {
  18799. form = this.formCache.getValue();
  18800. if (form)
  18801. form.updateFieldAppearances();
  18802. }
  18803. return [4, this.flush()];
  18804. case 1:
  18805. _e.sent();
  18806. Writer = useObjectStreams ? PDFStreamWriter_default : PDFWriter_default;
  18807. return [2, Writer.forContext(this.context, objectsPerTick).serializeToBuffer()];
  18808. }
  18809. });
  18810. });
  18811. };
  18812. PDFDocument2.prototype.saveAsBase64 = function(options) {
  18813. if (options === void 0) {
  18814. options = {};
  18815. }
  18816. return __awaiter(this, void 0, void 0, function() {
  18817. var _a, dataUri, otherOptions, bytes, base64;
  18818. return __generator(this, function(_b) {
  18819. switch (_b.label) {
  18820. case 0:
  18821. _a = options.dataUri, dataUri = _a === void 0 ? false : _a, otherOptions = __rest(options, ["dataUri"]);
  18822. assertIs(dataUri, "dataUri", ["boolean"]);
  18823. return [4, this.save(otherOptions)];
  18824. case 1:
  18825. bytes = _b.sent();
  18826. base64 = encodeToBase64(bytes);
  18827. return [2, dataUri ? "data:application/pdf;base64," + base64 : base64];
  18828. }
  18829. });
  18830. });
  18831. };
  18832. PDFDocument2.prototype.findPageForAnnotationRef = function(ref) {
  18833. var pages = this.getPages();
  18834. for (var idx = 0, len = pages.length; idx < len; idx++) {
  18835. var page = pages[idx];
  18836. var annotations = page.node.Annots();
  18837. if ((annotations === null || annotations === void 0 ? void 0 : annotations.indexOf(ref)) !== void 0) {
  18838. return page;
  18839. }
  18840. }
  18841. return void 0;
  18842. };
  18843. PDFDocument2.prototype.embedAll = function(embeddables) {
  18844. return __awaiter(this, void 0, void 0, function() {
  18845. var idx, len;
  18846. return __generator(this, function(_a) {
  18847. switch (_a.label) {
  18848. case 0:
  18849. idx = 0, len = embeddables.length;
  18850. _a.label = 1;
  18851. case 1:
  18852. if (!(idx < len)) return [3, 4];
  18853. return [4, embeddables[idx].embed()];
  18854. case 2:
  18855. _a.sent();
  18856. _a.label = 3;
  18857. case 3:
  18858. idx++;
  18859. return [3, 1];
  18860. case 4:
  18861. return [
  18862. 2
  18863. /*return*/
  18864. ];
  18865. }
  18866. });
  18867. });
  18868. };
  18869. PDFDocument2.prototype.updateInfoDict = function() {
  18870. var pdfLib = "pdf-lib (https://github.com/Hopding/pdf-lib)";
  18871. var now = /* @__PURE__ */ new Date();
  18872. var info = this.getInfoDict();
  18873. this.setProducer(pdfLib);
  18874. this.setModificationDate(now);
  18875. if (!info.get(PDFName_default.of("Creator")))
  18876. this.setCreator(pdfLib);
  18877. if (!info.get(PDFName_default.of("CreationDate")))
  18878. this.setCreationDate(now);
  18879. };
  18880. PDFDocument2.prototype.getInfoDict = function() {
  18881. var existingInfo = this.context.lookup(this.context.trailerInfo.Info);
  18882. if (existingInfo instanceof PDFDict_default)
  18883. return existingInfo;
  18884. var newInfo = this.context.obj({});
  18885. this.context.trailerInfo.Info = this.context.register(newInfo);
  18886. return newInfo;
  18887. };
  18888. PDFDocument2.prototype.assertFontkit = function() {
  18889. if (!this.fontkit)
  18890. throw new FontkitNotRegisteredError();
  18891. return this.fontkit;
  18892. };
  18893. return PDFDocument2;
  18894. }()
  18895. );
  18896. var PDFDocument_default = PDFDocument;
  18897. function assertIsLiteralOrHexString(pdfObject) {
  18898. if (!(pdfObject instanceof PDFHexString_default) && !(pdfObject instanceof PDFString_default)) {
  18899. throw new UnexpectedObjectTypeError([PDFHexString_default, PDFString_default], pdfObject);
  18900. }
  18901. }
  18902. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/api/PDFPageOptions.js
  18903. var BlendMode;
  18904. (function(BlendMode2) {
  18905. BlendMode2["Normal"] = "Normal";
  18906. BlendMode2["Multiply"] = "Multiply";
  18907. BlendMode2["Screen"] = "Screen";
  18908. BlendMode2["Overlay"] = "Overlay";
  18909. BlendMode2["Darken"] = "Darken";
  18910. BlendMode2["Lighten"] = "Lighten";
  18911. BlendMode2["ColorDodge"] = "ColorDodge";
  18912. BlendMode2["ColorBurn"] = "ColorBurn";
  18913. BlendMode2["HardLight"] = "HardLight";
  18914. BlendMode2["SoftLight"] = "SoftLight";
  18915. BlendMode2["Difference"] = "Difference";
  18916. BlendMode2["Exclusion"] = "Exclusion";
  18917. })(BlendMode || (BlendMode = {}));
  18918. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/api/PDFPage.js
  18919. var PDFPage = (
  18920. /** @class */
  18921. function() {
  18922. function PDFPage2(leafNode, ref, doc) {
  18923. this.fontSize = 24;
  18924. this.fontColor = rgb(0, 0, 0);
  18925. this.lineHeight = 24;
  18926. this.x = 0;
  18927. this.y = 0;
  18928. assertIs(leafNode, "leafNode", [[PDFPageLeaf_default, "PDFPageLeaf"]]);
  18929. assertIs(ref, "ref", [[PDFRef_default, "PDFRef"]]);
  18930. assertIs(doc, "doc", [[PDFDocument_default, "PDFDocument"]]);
  18931. this.node = leafNode;
  18932. this.ref = ref;
  18933. this.doc = doc;
  18934. }
  18935. PDFPage2.prototype.setRotation = function(angle) {
  18936. var degreesAngle = toDegrees(angle);
  18937. assertMultiple(degreesAngle, "degreesAngle", 90);
  18938. this.node.set(PDFName_default.of("Rotate"), this.doc.context.obj(degreesAngle));
  18939. };
  18940. PDFPage2.prototype.getRotation = function() {
  18941. var Rotate = this.node.Rotate();
  18942. return degrees(Rotate ? Rotate.asNumber() : 0);
  18943. };
  18944. PDFPage2.prototype.setSize = function(width, height) {
  18945. assertIs(width, "width", ["number"]);
  18946. assertIs(height, "height", ["number"]);
  18947. var mediaBox = this.getMediaBox();
  18948. this.setMediaBox(mediaBox.x, mediaBox.y, width, height);
  18949. var cropBox = this.getCropBox();
  18950. var bleedBox = this.getBleedBox();
  18951. var trimBox = this.getTrimBox();
  18952. var artBox = this.getArtBox();
  18953. var hasCropBox = this.node.CropBox();
  18954. var hasBleedBox = this.node.BleedBox();
  18955. var hasTrimBox = this.node.TrimBox();
  18956. var hasArtBox = this.node.ArtBox();
  18957. if (hasCropBox && rectanglesAreEqual(cropBox, mediaBox)) {
  18958. this.setCropBox(mediaBox.x, mediaBox.y, width, height);
  18959. }
  18960. if (hasBleedBox && rectanglesAreEqual(bleedBox, mediaBox)) {
  18961. this.setBleedBox(mediaBox.x, mediaBox.y, width, height);
  18962. }
  18963. if (hasTrimBox && rectanglesAreEqual(trimBox, mediaBox)) {
  18964. this.setTrimBox(mediaBox.x, mediaBox.y, width, height);
  18965. }
  18966. if (hasArtBox && rectanglesAreEqual(artBox, mediaBox)) {
  18967. this.setArtBox(mediaBox.x, mediaBox.y, width, height);
  18968. }
  18969. };
  18970. PDFPage2.prototype.setWidth = function(width) {
  18971. assertIs(width, "width", ["number"]);
  18972. this.setSize(width, this.getSize().height);
  18973. };
  18974. PDFPage2.prototype.setHeight = function(height) {
  18975. assertIs(height, "height", ["number"]);
  18976. this.setSize(this.getSize().width, height);
  18977. };
  18978. PDFPage2.prototype.setMediaBox = function(x, y, width, height) {
  18979. assertIs(x, "x", ["number"]);
  18980. assertIs(y, "y", ["number"]);
  18981. assertIs(width, "width", ["number"]);
  18982. assertIs(height, "height", ["number"]);
  18983. var mediaBox = this.doc.context.obj([x, y, x + width, y + height]);
  18984. this.node.set(PDFName_default.MediaBox, mediaBox);
  18985. };
  18986. PDFPage2.prototype.setCropBox = function(x, y, width, height) {
  18987. assertIs(x, "x", ["number"]);
  18988. assertIs(y, "y", ["number"]);
  18989. assertIs(width, "width", ["number"]);
  18990. assertIs(height, "height", ["number"]);
  18991. var cropBox = this.doc.context.obj([x, y, x + width, y + height]);
  18992. this.node.set(PDFName_default.CropBox, cropBox);
  18993. };
  18994. PDFPage2.prototype.setBleedBox = function(x, y, width, height) {
  18995. assertIs(x, "x", ["number"]);
  18996. assertIs(y, "y", ["number"]);
  18997. assertIs(width, "width", ["number"]);
  18998. assertIs(height, "height", ["number"]);
  18999. var bleedBox = this.doc.context.obj([x, y, x + width, y + height]);
  19000. this.node.set(PDFName_default.BleedBox, bleedBox);
  19001. };
  19002. PDFPage2.prototype.setTrimBox = function(x, y, width, height) {
  19003. assertIs(x, "x", ["number"]);
  19004. assertIs(y, "y", ["number"]);
  19005. assertIs(width, "width", ["number"]);
  19006. assertIs(height, "height", ["number"]);
  19007. var trimBox = this.doc.context.obj([x, y, x + width, y + height]);
  19008. this.node.set(PDFName_default.TrimBox, trimBox);
  19009. };
  19010. PDFPage2.prototype.setArtBox = function(x, y, width, height) {
  19011. assertIs(x, "x", ["number"]);
  19012. assertIs(y, "y", ["number"]);
  19013. assertIs(width, "width", ["number"]);
  19014. assertIs(height, "height", ["number"]);
  19015. var artBox = this.doc.context.obj([x, y, x + width, y + height]);
  19016. this.node.set(PDFName_default.ArtBox, artBox);
  19017. };
  19018. PDFPage2.prototype.getSize = function() {
  19019. var _a = this.getMediaBox(), width = _a.width, height = _a.height;
  19020. return { width, height };
  19021. };
  19022. PDFPage2.prototype.getWidth = function() {
  19023. return this.getSize().width;
  19024. };
  19025. PDFPage2.prototype.getHeight = function() {
  19026. return this.getSize().height;
  19027. };
  19028. PDFPage2.prototype.getMediaBox = function() {
  19029. var mediaBox = this.node.MediaBox();
  19030. return mediaBox.asRectangle();
  19031. };
  19032. PDFPage2.prototype.getCropBox = function() {
  19033. var _a;
  19034. var cropBox = this.node.CropBox();
  19035. return (_a = cropBox === null || cropBox === void 0 ? void 0 : cropBox.asRectangle()) !== null && _a !== void 0 ? _a : this.getMediaBox();
  19036. };
  19037. PDFPage2.prototype.getBleedBox = function() {
  19038. var _a;
  19039. var bleedBox = this.node.BleedBox();
  19040. return (_a = bleedBox === null || bleedBox === void 0 ? void 0 : bleedBox.asRectangle()) !== null && _a !== void 0 ? _a : this.getCropBox();
  19041. };
  19042. PDFPage2.prototype.getTrimBox = function() {
  19043. var _a;
  19044. var trimBox = this.node.TrimBox();
  19045. return (_a = trimBox === null || trimBox === void 0 ? void 0 : trimBox.asRectangle()) !== null && _a !== void 0 ? _a : this.getCropBox();
  19046. };
  19047. PDFPage2.prototype.getArtBox = function() {
  19048. var _a;
  19049. var artBox = this.node.ArtBox();
  19050. return (_a = artBox === null || artBox === void 0 ? void 0 : artBox.asRectangle()) !== null && _a !== void 0 ? _a : this.getCropBox();
  19051. };
  19052. PDFPage2.prototype.translateContent = function(x, y) {
  19053. assertIs(x, "x", ["number"]);
  19054. assertIs(y, "y", ["number"]);
  19055. this.node.normalize();
  19056. this.getContentStream();
  19057. var start = this.createContentStream(pushGraphicsState(), translate(x, y));
  19058. var startRef = this.doc.context.register(start);
  19059. var end = this.createContentStream(popGraphicsState());
  19060. var endRef = this.doc.context.register(end);
  19061. this.node.wrapContentStreams(startRef, endRef);
  19062. };
  19063. PDFPage2.prototype.scale = function(x, y) {
  19064. assertIs(x, "x", ["number"]);
  19065. assertIs(y, "y", ["number"]);
  19066. this.setSize(this.getWidth() * x, this.getHeight() * y);
  19067. this.scaleContent(x, y);
  19068. this.scaleAnnotations(x, y);
  19069. };
  19070. PDFPage2.prototype.scaleContent = function(x, y) {
  19071. assertIs(x, "x", ["number"]);
  19072. assertIs(y, "y", ["number"]);
  19073. this.node.normalize();
  19074. this.getContentStream();
  19075. var start = this.createContentStream(pushGraphicsState(), scale(x, y));
  19076. var startRef = this.doc.context.register(start);
  19077. var end = this.createContentStream(popGraphicsState());
  19078. var endRef = this.doc.context.register(end);
  19079. this.node.wrapContentStreams(startRef, endRef);
  19080. };
  19081. PDFPage2.prototype.scaleAnnotations = function(x, y) {
  19082. assertIs(x, "x", ["number"]);
  19083. assertIs(y, "y", ["number"]);
  19084. var annots = this.node.Annots();
  19085. if (!annots)
  19086. return;
  19087. for (var idx = 0; idx < annots.size(); idx++) {
  19088. var annot = annots.lookup(idx);
  19089. if (annot instanceof PDFDict_default)
  19090. this.scaleAnnot(annot, x, y);
  19091. }
  19092. };
  19093. PDFPage2.prototype.resetPosition = function() {
  19094. this.getContentStream(false);
  19095. this.x = 0;
  19096. this.y = 0;
  19097. };
  19098. PDFPage2.prototype.setFont = function(font) {
  19099. assertIs(font, "font", [[PDFFont_default, "PDFFont"]]);
  19100. this.font = font;
  19101. this.fontKey = this.node.newFontDictionary(this.font.name, this.font.ref);
  19102. };
  19103. PDFPage2.prototype.setFontSize = function(fontSize) {
  19104. assertIs(fontSize, "fontSize", ["number"]);
  19105. this.fontSize = fontSize;
  19106. };
  19107. PDFPage2.prototype.setFontColor = function(fontColor) {
  19108. assertIs(fontColor, "fontColor", [[Object, "Color"]]);
  19109. this.fontColor = fontColor;
  19110. };
  19111. PDFPage2.prototype.setLineHeight = function(lineHeight) {
  19112. assertIs(lineHeight, "lineHeight", ["number"]);
  19113. this.lineHeight = lineHeight;
  19114. };
  19115. PDFPage2.prototype.getPosition = function() {
  19116. return { x: this.x, y: this.y };
  19117. };
  19118. PDFPage2.prototype.getX = function() {
  19119. return this.x;
  19120. };
  19121. PDFPage2.prototype.getY = function() {
  19122. return this.y;
  19123. };
  19124. PDFPage2.prototype.moveTo = function(x, y) {
  19125. assertIs(x, "x", ["number"]);
  19126. assertIs(y, "y", ["number"]);
  19127. this.x = x;
  19128. this.y = y;
  19129. };
  19130. PDFPage2.prototype.moveDown = function(yDecrease) {
  19131. assertIs(yDecrease, "yDecrease", ["number"]);
  19132. this.y -= yDecrease;
  19133. };
  19134. PDFPage2.prototype.moveUp = function(yIncrease) {
  19135. assertIs(yIncrease, "yIncrease", ["number"]);
  19136. this.y += yIncrease;
  19137. };
  19138. PDFPage2.prototype.moveLeft = function(xDecrease) {
  19139. assertIs(xDecrease, "xDecrease", ["number"]);
  19140. this.x -= xDecrease;
  19141. };
  19142. PDFPage2.prototype.moveRight = function(xIncrease) {
  19143. assertIs(xIncrease, "xIncrease", ["number"]);
  19144. this.x += xIncrease;
  19145. };
  19146. PDFPage2.prototype.pushOperators = function() {
  19147. var operator = [];
  19148. for (var _i = 0; _i < arguments.length; _i++) {
  19149. operator[_i] = arguments[_i];
  19150. }
  19151. assertEachIs(operator, "operator", [[PDFOperator_default, "PDFOperator"]]);
  19152. var contentStream = this.getContentStream();
  19153. contentStream.push.apply(contentStream, operator);
  19154. };
  19155. PDFPage2.prototype.drawText = function(text, options) {
  19156. var _a, _b, _c, _d, _e, _f, _g;
  19157. if (options === void 0) {
  19158. options = {};
  19159. }
  19160. assertIs(text, "text", ["string"]);
  19161. assertOrUndefined(options.color, "options.color", [[Object, "Color"]]);
  19162. assertRangeOrUndefined(options.opacity, "opacity.opacity", 0, 1);
  19163. assertOrUndefined(options.font, "options.font", [[PDFFont_default, "PDFFont"]]);
  19164. assertOrUndefined(options.size, "options.size", ["number"]);
  19165. assertOrUndefined(options.rotate, "options.rotate", [[Object, "Rotation"]]);
  19166. assertOrUndefined(options.xSkew, "options.xSkew", [[Object, "Rotation"]]);
  19167. assertOrUndefined(options.ySkew, "options.ySkew", [[Object, "Rotation"]]);
  19168. assertOrUndefined(options.x, "options.x", ["number"]);
  19169. assertOrUndefined(options.y, "options.y", ["number"]);
  19170. assertOrUndefined(options.lineHeight, "options.lineHeight", ["number"]);
  19171. assertOrUndefined(options.maxWidth, "options.maxWidth", ["number"]);
  19172. assertOrUndefined(options.wordBreaks, "options.wordBreaks", [Array]);
  19173. assertIsOneOfOrUndefined(options.blendMode, "options.blendMode", BlendMode);
  19174. var _h = this.setOrEmbedFont(options.font), oldFont = _h.oldFont, newFont = _h.newFont, newFontKey = _h.newFontKey;
  19175. var fontSize = options.size || this.fontSize;
  19176. var wordBreaks = options.wordBreaks || this.doc.defaultWordBreaks;
  19177. var textWidth = function(t) {
  19178. return newFont.widthOfTextAtSize(t, fontSize);
  19179. };
  19180. var lines = options.maxWidth === void 0 ? lineSplit(cleanText(text)) : breakTextIntoLines(text, wordBreaks, options.maxWidth, textWidth);
  19181. var encodedLines = new Array(lines.length);
  19182. for (var idx = 0, len = lines.length; idx < len; idx++) {
  19183. encodedLines[idx] = newFont.encodeText(lines[idx]);
  19184. }
  19185. var graphicsStateKey = this.maybeEmbedGraphicsState({
  19186. opacity: options.opacity,
  19187. blendMode: options.blendMode
  19188. });
  19189. var contentStream = this.getContentStream();
  19190. contentStream.push.apply(contentStream, drawLinesOfText(encodedLines, {
  19191. color: (_a = options.color) !== null && _a !== void 0 ? _a : this.fontColor,
  19192. font: newFontKey,
  19193. size: fontSize,
  19194. rotate: (_b = options.rotate) !== null && _b !== void 0 ? _b : degrees(0),
  19195. xSkew: (_c = options.xSkew) !== null && _c !== void 0 ? _c : degrees(0),
  19196. ySkew: (_d = options.ySkew) !== null && _d !== void 0 ? _d : degrees(0),
  19197. x: (_e = options.x) !== null && _e !== void 0 ? _e : this.x,
  19198. y: (_f = options.y) !== null && _f !== void 0 ? _f : this.y,
  19199. lineHeight: (_g = options.lineHeight) !== null && _g !== void 0 ? _g : this.lineHeight,
  19200. graphicsState: graphicsStateKey
  19201. }));
  19202. if (options.font) {
  19203. if (oldFont)
  19204. this.setFont(oldFont);
  19205. else
  19206. this.resetFont();
  19207. }
  19208. };
  19209. PDFPage2.prototype.drawImage = function(image, options) {
  19210. var _a, _b, _c, _d, _e, _f, _g;
  19211. if (options === void 0) {
  19212. options = {};
  19213. }
  19214. assertIs(image, "image", [[PDFImage_default, "PDFImage"]]);
  19215. assertOrUndefined(options.x, "options.x", ["number"]);
  19216. assertOrUndefined(options.y, "options.y", ["number"]);
  19217. assertOrUndefined(options.width, "options.width", ["number"]);
  19218. assertOrUndefined(options.height, "options.height", ["number"]);
  19219. assertOrUndefined(options.rotate, "options.rotate", [[Object, "Rotation"]]);
  19220. assertOrUndefined(options.xSkew, "options.xSkew", [[Object, "Rotation"]]);
  19221. assertOrUndefined(options.ySkew, "options.ySkew", [[Object, "Rotation"]]);
  19222. assertRangeOrUndefined(options.opacity, "opacity.opacity", 0, 1);
  19223. assertIsOneOfOrUndefined(options.blendMode, "options.blendMode", BlendMode);
  19224. var xObjectKey = this.node.newXObject("Image", image.ref);
  19225. var graphicsStateKey = this.maybeEmbedGraphicsState({
  19226. opacity: options.opacity,
  19227. blendMode: options.blendMode
  19228. });
  19229. var contentStream = this.getContentStream();
  19230. contentStream.push.apply(contentStream, drawImage(xObjectKey, {
  19231. x: (_a = options.x) !== null && _a !== void 0 ? _a : this.x,
  19232. y: (_b = options.y) !== null && _b !== void 0 ? _b : this.y,
  19233. width: (_c = options.width) !== null && _c !== void 0 ? _c : image.size().width,
  19234. height: (_d = options.height) !== null && _d !== void 0 ? _d : image.size().height,
  19235. rotate: (_e = options.rotate) !== null && _e !== void 0 ? _e : degrees(0),
  19236. xSkew: (_f = options.xSkew) !== null && _f !== void 0 ? _f : degrees(0),
  19237. ySkew: (_g = options.ySkew) !== null && _g !== void 0 ? _g : degrees(0),
  19238. graphicsState: graphicsStateKey
  19239. }));
  19240. };
  19241. PDFPage2.prototype.drawPage = function(embeddedPage, options) {
  19242. var _a, _b, _c, _d, _e;
  19243. if (options === void 0) {
  19244. options = {};
  19245. }
  19246. assertIs(embeddedPage, "embeddedPage", [
  19247. [PDFEmbeddedPage_default, "PDFEmbeddedPage"]
  19248. ]);
  19249. assertOrUndefined(options.x, "options.x", ["number"]);
  19250. assertOrUndefined(options.y, "options.y", ["number"]);
  19251. assertOrUndefined(options.xScale, "options.xScale", ["number"]);
  19252. assertOrUndefined(options.yScale, "options.yScale", ["number"]);
  19253. assertOrUndefined(options.width, "options.width", ["number"]);
  19254. assertOrUndefined(options.height, "options.height", ["number"]);
  19255. assertOrUndefined(options.rotate, "options.rotate", [[Object, "Rotation"]]);
  19256. assertOrUndefined(options.xSkew, "options.xSkew", [[Object, "Rotation"]]);
  19257. assertOrUndefined(options.ySkew, "options.ySkew", [[Object, "Rotation"]]);
  19258. assertRangeOrUndefined(options.opacity, "opacity.opacity", 0, 1);
  19259. assertIsOneOfOrUndefined(options.blendMode, "options.blendMode", BlendMode);
  19260. var xObjectKey = this.node.newXObject("EmbeddedPdfPage", embeddedPage.ref);
  19261. var graphicsStateKey = this.maybeEmbedGraphicsState({
  19262. opacity: options.opacity,
  19263. blendMode: options.blendMode
  19264. });
  19265. var xScale = options.width !== void 0 ? options.width / embeddedPage.width : options.xScale !== void 0 ? options.xScale : 1;
  19266. var yScale = options.height !== void 0 ? options.height / embeddedPage.height : options.yScale !== void 0 ? options.yScale : 1;
  19267. var contentStream = this.getContentStream();
  19268. contentStream.push.apply(contentStream, drawPage(xObjectKey, {
  19269. x: (_a = options.x) !== null && _a !== void 0 ? _a : this.x,
  19270. y: (_b = options.y) !== null && _b !== void 0 ? _b : this.y,
  19271. xScale,
  19272. yScale,
  19273. rotate: (_c = options.rotate) !== null && _c !== void 0 ? _c : degrees(0),
  19274. xSkew: (_d = options.xSkew) !== null && _d !== void 0 ? _d : degrees(0),
  19275. ySkew: (_e = options.ySkew) !== null && _e !== void 0 ? _e : degrees(0),
  19276. graphicsState: graphicsStateKey
  19277. }));
  19278. };
  19279. PDFPage2.prototype.drawSvgPath = function(path2, options) {
  19280. var _a, _b, _c, _d, _e, _f, _g, _h, _j;
  19281. if (options === void 0) {
  19282. options = {};
  19283. }
  19284. assertIs(path2, "path", ["string"]);
  19285. assertOrUndefined(options.x, "options.x", ["number"]);
  19286. assertOrUndefined(options.y, "options.y", ["number"]);
  19287. assertOrUndefined(options.scale, "options.scale", ["number"]);
  19288. assertOrUndefined(options.rotate, "options.rotate", [[Object, "Rotation"]]);
  19289. assertOrUndefined(options.borderWidth, "options.borderWidth", ["number"]);
  19290. assertOrUndefined(options.color, "options.color", [[Object, "Color"]]);
  19291. assertRangeOrUndefined(options.opacity, "opacity.opacity", 0, 1);
  19292. assertOrUndefined(options.borderColor, "options.borderColor", [
  19293. [Object, "Color"]
  19294. ]);
  19295. assertOrUndefined(options.borderDashArray, "options.borderDashArray", [
  19296. Array
  19297. ]);
  19298. assertOrUndefined(options.borderDashPhase, "options.borderDashPhase", [
  19299. "number"
  19300. ]);
  19301. assertIsOneOfOrUndefined(options.borderLineCap, "options.borderLineCap", LineCapStyle);
  19302. assertRangeOrUndefined(options.borderOpacity, "options.borderOpacity", 0, 1);
  19303. assertIsOneOfOrUndefined(options.blendMode, "options.blendMode", BlendMode);
  19304. var graphicsStateKey = this.maybeEmbedGraphicsState({
  19305. opacity: options.opacity,
  19306. borderOpacity: options.borderOpacity,
  19307. blendMode: options.blendMode
  19308. });
  19309. if (!("color" in options) && !("borderColor" in options)) {
  19310. options.borderColor = rgb(0, 0, 0);
  19311. }
  19312. var contentStream = this.getContentStream();
  19313. contentStream.push.apply(contentStream, drawSvgPath(path2, {
  19314. x: (_a = options.x) !== null && _a !== void 0 ? _a : this.x,
  19315. y: (_b = options.y) !== null && _b !== void 0 ? _b : this.y,
  19316. scale: options.scale,
  19317. rotate: (_c = options.rotate) !== null && _c !== void 0 ? _c : degrees(0),
  19318. color: (_d = options.color) !== null && _d !== void 0 ? _d : void 0,
  19319. borderColor: (_e = options.borderColor) !== null && _e !== void 0 ? _e : void 0,
  19320. borderWidth: (_f = options.borderWidth) !== null && _f !== void 0 ? _f : 0,
  19321. borderDashArray: (_g = options.borderDashArray) !== null && _g !== void 0 ? _g : void 0,
  19322. borderDashPhase: (_h = options.borderDashPhase) !== null && _h !== void 0 ? _h : void 0,
  19323. borderLineCap: (_j = options.borderLineCap) !== null && _j !== void 0 ? _j : void 0,
  19324. graphicsState: graphicsStateKey
  19325. }));
  19326. };
  19327. PDFPage2.prototype.drawLine = function(options) {
  19328. var _a, _b, _c, _d, _e;
  19329. assertIs(options.start, "options.start", [
  19330. [Object, "{ x: number, y: number }"]
  19331. ]);
  19332. assertIs(options.end, "options.end", [
  19333. [Object, "{ x: number, y: number }"]
  19334. ]);
  19335. assertIs(options.start.x, "options.start.x", ["number"]);
  19336. assertIs(options.start.y, "options.start.y", ["number"]);
  19337. assertIs(options.end.x, "options.end.x", ["number"]);
  19338. assertIs(options.end.y, "options.end.y", ["number"]);
  19339. assertOrUndefined(options.thickness, "options.thickness", ["number"]);
  19340. assertOrUndefined(options.color, "options.color", [[Object, "Color"]]);
  19341. assertOrUndefined(options.dashArray, "options.dashArray", [Array]);
  19342. assertOrUndefined(options.dashPhase, "options.dashPhase", ["number"]);
  19343. assertIsOneOfOrUndefined(options.lineCap, "options.lineCap", LineCapStyle);
  19344. assertRangeOrUndefined(options.opacity, "opacity.opacity", 0, 1);
  19345. assertIsOneOfOrUndefined(options.blendMode, "options.blendMode", BlendMode);
  19346. var graphicsStateKey = this.maybeEmbedGraphicsState({
  19347. borderOpacity: options.opacity,
  19348. blendMode: options.blendMode
  19349. });
  19350. if (!("color" in options)) {
  19351. options.color = rgb(0, 0, 0);
  19352. }
  19353. var contentStream = this.getContentStream();
  19354. contentStream.push.apply(contentStream, drawLine({
  19355. start: options.start,
  19356. end: options.end,
  19357. thickness: (_a = options.thickness) !== null && _a !== void 0 ? _a : 1,
  19358. color: (_b = options.color) !== null && _b !== void 0 ? _b : void 0,
  19359. dashArray: (_c = options.dashArray) !== null && _c !== void 0 ? _c : void 0,
  19360. dashPhase: (_d = options.dashPhase) !== null && _d !== void 0 ? _d : void 0,
  19361. lineCap: (_e = options.lineCap) !== null && _e !== void 0 ? _e : void 0,
  19362. graphicsState: graphicsStateKey
  19363. }));
  19364. };
  19365. PDFPage2.prototype.drawRectangle = function(options) {
  19366. var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
  19367. if (options === void 0) {
  19368. options = {};
  19369. }
  19370. assertOrUndefined(options.x, "options.x", ["number"]);
  19371. assertOrUndefined(options.y, "options.y", ["number"]);
  19372. assertOrUndefined(options.width, "options.width", ["number"]);
  19373. assertOrUndefined(options.height, "options.height", ["number"]);
  19374. assertOrUndefined(options.rotate, "options.rotate", [[Object, "Rotation"]]);
  19375. assertOrUndefined(options.xSkew, "options.xSkew", [[Object, "Rotation"]]);
  19376. assertOrUndefined(options.ySkew, "options.ySkew", [[Object, "Rotation"]]);
  19377. assertOrUndefined(options.borderWidth, "options.borderWidth", ["number"]);
  19378. assertOrUndefined(options.color, "options.color", [[Object, "Color"]]);
  19379. assertRangeOrUndefined(options.opacity, "opacity.opacity", 0, 1);
  19380. assertOrUndefined(options.borderColor, "options.borderColor", [
  19381. [Object, "Color"]
  19382. ]);
  19383. assertOrUndefined(options.borderDashArray, "options.borderDashArray", [
  19384. Array
  19385. ]);
  19386. assertOrUndefined(options.borderDashPhase, "options.borderDashPhase", [
  19387. "number"
  19388. ]);
  19389. assertIsOneOfOrUndefined(options.borderLineCap, "options.borderLineCap", LineCapStyle);
  19390. assertRangeOrUndefined(options.borderOpacity, "options.borderOpacity", 0, 1);
  19391. assertIsOneOfOrUndefined(options.blendMode, "options.blendMode", BlendMode);
  19392. var graphicsStateKey = this.maybeEmbedGraphicsState({
  19393. opacity: options.opacity,
  19394. borderOpacity: options.borderOpacity,
  19395. blendMode: options.blendMode
  19396. });
  19397. if (!("color" in options) && !("borderColor" in options)) {
  19398. options.color = rgb(0, 0, 0);
  19399. }
  19400. var contentStream = this.getContentStream();
  19401. contentStream.push.apply(contentStream, drawRectangle({
  19402. x: (_a = options.x) !== null && _a !== void 0 ? _a : this.x,
  19403. y: (_b = options.y) !== null && _b !== void 0 ? _b : this.y,
  19404. width: (_c = options.width) !== null && _c !== void 0 ? _c : 150,
  19405. height: (_d = options.height) !== null && _d !== void 0 ? _d : 100,
  19406. rotate: (_e = options.rotate) !== null && _e !== void 0 ? _e : degrees(0),
  19407. xSkew: (_f = options.xSkew) !== null && _f !== void 0 ? _f : degrees(0),
  19408. ySkew: (_g = options.ySkew) !== null && _g !== void 0 ? _g : degrees(0),
  19409. borderWidth: (_h = options.borderWidth) !== null && _h !== void 0 ? _h : 0,
  19410. color: (_j = options.color) !== null && _j !== void 0 ? _j : void 0,
  19411. borderColor: (_k = options.borderColor) !== null && _k !== void 0 ? _k : void 0,
  19412. borderDashArray: (_l = options.borderDashArray) !== null && _l !== void 0 ? _l : void 0,
  19413. borderDashPhase: (_m = options.borderDashPhase) !== null && _m !== void 0 ? _m : void 0,
  19414. graphicsState: graphicsStateKey,
  19415. borderLineCap: (_o = options.borderLineCap) !== null && _o !== void 0 ? _o : void 0
  19416. }));
  19417. };
  19418. PDFPage2.prototype.drawSquare = function(options) {
  19419. if (options === void 0) {
  19420. options = {};
  19421. }
  19422. var size = options.size;
  19423. assertOrUndefined(size, "size", ["number"]);
  19424. this.drawRectangle(__assign(__assign({}, options), { width: size, height: size }));
  19425. };
  19426. PDFPage2.prototype.drawEllipse = function(options) {
  19427. var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
  19428. if (options === void 0) {
  19429. options = {};
  19430. }
  19431. assertOrUndefined(options.x, "options.x", ["number"]);
  19432. assertOrUndefined(options.y, "options.y", ["number"]);
  19433. assertOrUndefined(options.xScale, "options.xScale", ["number"]);
  19434. assertOrUndefined(options.yScale, "options.yScale", ["number"]);
  19435. assertOrUndefined(options.rotate, "options.rotate", [[Object, "Rotation"]]);
  19436. assertOrUndefined(options.color, "options.color", [[Object, "Color"]]);
  19437. assertRangeOrUndefined(options.opacity, "opacity.opacity", 0, 1);
  19438. assertOrUndefined(options.borderColor, "options.borderColor", [
  19439. [Object, "Color"]
  19440. ]);
  19441. assertRangeOrUndefined(options.borderOpacity, "options.borderOpacity", 0, 1);
  19442. assertOrUndefined(options.borderWidth, "options.borderWidth", ["number"]);
  19443. assertOrUndefined(options.borderDashArray, "options.borderDashArray", [
  19444. Array
  19445. ]);
  19446. assertOrUndefined(options.borderDashPhase, "options.borderDashPhase", [
  19447. "number"
  19448. ]);
  19449. assertIsOneOfOrUndefined(options.borderLineCap, "options.borderLineCap", LineCapStyle);
  19450. assertIsOneOfOrUndefined(options.blendMode, "options.blendMode", BlendMode);
  19451. var graphicsStateKey = this.maybeEmbedGraphicsState({
  19452. opacity: options.opacity,
  19453. borderOpacity: options.borderOpacity,
  19454. blendMode: options.blendMode
  19455. });
  19456. if (!("color" in options) && !("borderColor" in options)) {
  19457. options.color = rgb(0, 0, 0);
  19458. }
  19459. var contentStream = this.getContentStream();
  19460. contentStream.push.apply(contentStream, drawEllipse({
  19461. x: (_a = options.x) !== null && _a !== void 0 ? _a : this.x,
  19462. y: (_b = options.y) !== null && _b !== void 0 ? _b : this.y,
  19463. xScale: (_c = options.xScale) !== null && _c !== void 0 ? _c : 100,
  19464. yScale: (_d = options.yScale) !== null && _d !== void 0 ? _d : 100,
  19465. rotate: (_e = options.rotate) !== null && _e !== void 0 ? _e : void 0,
  19466. color: (_f = options.color) !== null && _f !== void 0 ? _f : void 0,
  19467. borderColor: (_g = options.borderColor) !== null && _g !== void 0 ? _g : void 0,
  19468. borderWidth: (_h = options.borderWidth) !== null && _h !== void 0 ? _h : 0,
  19469. borderDashArray: (_j = options.borderDashArray) !== null && _j !== void 0 ? _j : void 0,
  19470. borderDashPhase: (_k = options.borderDashPhase) !== null && _k !== void 0 ? _k : void 0,
  19471. borderLineCap: (_l = options.borderLineCap) !== null && _l !== void 0 ? _l : void 0,
  19472. graphicsState: graphicsStateKey
  19473. }));
  19474. };
  19475. PDFPage2.prototype.drawCircle = function(options) {
  19476. if (options === void 0) {
  19477. options = {};
  19478. }
  19479. var _a = options.size, size = _a === void 0 ? 100 : _a;
  19480. assertOrUndefined(size, "size", ["number"]);
  19481. this.drawEllipse(__assign(__assign({}, options), { xScale: size, yScale: size }));
  19482. };
  19483. PDFPage2.prototype.setOrEmbedFont = function(font) {
  19484. var oldFont = this.font;
  19485. var oldFontKey = this.fontKey;
  19486. if (font)
  19487. this.setFont(font);
  19488. else
  19489. this.getFont();
  19490. var newFont = this.font;
  19491. var newFontKey = this.fontKey;
  19492. return { oldFont, oldFontKey, newFont, newFontKey };
  19493. };
  19494. PDFPage2.prototype.getFont = function() {
  19495. if (!this.font || !this.fontKey) {
  19496. var font = this.doc.embedStandardFont(StandardFonts.Helvetica);
  19497. this.setFont(font);
  19498. }
  19499. return [this.font, this.fontKey];
  19500. };
  19501. PDFPage2.prototype.resetFont = function() {
  19502. this.font = void 0;
  19503. this.fontKey = void 0;
  19504. };
  19505. PDFPage2.prototype.getContentStream = function(useExisting) {
  19506. if (useExisting === void 0) {
  19507. useExisting = true;
  19508. }
  19509. if (useExisting && this.contentStream)
  19510. return this.contentStream;
  19511. this.contentStream = this.createContentStream();
  19512. this.contentStreamRef = this.doc.context.register(this.contentStream);
  19513. this.node.addContentStream(this.contentStreamRef);
  19514. return this.contentStream;
  19515. };
  19516. PDFPage2.prototype.createContentStream = function() {
  19517. var operators = [];
  19518. for (var _i = 0; _i < arguments.length; _i++) {
  19519. operators[_i] = arguments[_i];
  19520. }
  19521. var dict = this.doc.context.obj({});
  19522. var contentStream = PDFContentStream_default.of(dict, operators);
  19523. return contentStream;
  19524. };
  19525. PDFPage2.prototype.maybeEmbedGraphicsState = function(options) {
  19526. var opacity = options.opacity, borderOpacity = options.borderOpacity, blendMode = options.blendMode;
  19527. if (opacity === void 0 && borderOpacity === void 0 && blendMode === void 0) {
  19528. return void 0;
  19529. }
  19530. var graphicsState = this.doc.context.obj({
  19531. Type: "ExtGState",
  19532. ca: opacity,
  19533. CA: borderOpacity,
  19534. BM: blendMode
  19535. });
  19536. var key = this.node.newExtGState("GS", graphicsState);
  19537. return key;
  19538. };
  19539. PDFPage2.prototype.scaleAnnot = function(annot, x, y) {
  19540. var selectors = ["RD", "CL", "Vertices", "QuadPoints", "L", "Rect"];
  19541. for (var idx = 0, len = selectors.length; idx < len; idx++) {
  19542. var list = annot.lookup(PDFName_default.of(selectors[idx]));
  19543. if (list instanceof PDFArray_default)
  19544. list.scalePDFNumbers(x, y);
  19545. }
  19546. var inkLists = annot.lookup(PDFName_default.of("InkList"));
  19547. if (inkLists instanceof PDFArray_default) {
  19548. for (var idx = 0, len = inkLists.size(); idx < len; idx++) {
  19549. var arr = inkLists.lookup(idx);
  19550. if (arr instanceof PDFArray_default)
  19551. arr.scalePDFNumbers(x, y);
  19552. }
  19553. }
  19554. };
  19555. PDFPage2.of = function(leafNode, ref, doc) {
  19556. return new PDFPage2(leafNode, ref, doc);
  19557. };
  19558. PDFPage2.create = function(doc) {
  19559. assertIs(doc, "doc", [[PDFDocument_default, "PDFDocument"]]);
  19560. var dummyRef = PDFRef_default.of(-1);
  19561. var pageLeaf = PDFPageLeaf_default.withContextAndParent(doc.context, dummyRef);
  19562. var pageRef = doc.context.register(pageLeaf);
  19563. return new PDFPage2(pageLeaf, pageRef, doc);
  19564. };
  19565. return PDFPage2;
  19566. }()
  19567. );
  19568. var PDFPage_default = PDFPage;
  19569. // node_modules/.pnpm/pdf-lib@1.17.1/node_modules/pdf-lib/es/api/form/PDFButton.js
  19570. var PDFButton = (
  19571. /** @class */
  19572. function(_super) {
  19573. __extends(PDFButton2, _super);
  19574. function PDFButton2(acroPushButton, ref, doc) {
  19575. var _this = _super.call(this, acroPushButton, ref, doc) || this;
  19576. assertIs(acroPushButton, "acroButton", [
  19577. [PDFAcroPushButton_default, "PDFAcroPushButton"]
  19578. ]);
  19579. _this.acroField = acroPushButton;
  19580. return _this;
  19581. }
  19582. PDFButton2.prototype.setImage = function(image, alignment) {
  19583. if (alignment === void 0) {
  19584. alignment = ImageAlignment.Center;
  19585. }
  19586. var widgets = this.acroField.getWidgets();
  19587. for (var idx = 0, len = widgets.length; idx < len; idx++) {
  19588. var widget = widgets[idx];
  19589. var streamRef = this.createImageAppearanceStream(widget, image, alignment);
  19590. this.updateWidgetAppearances(widget, { normal: streamRef });
  19591. }
  19592. this.markAsClean();
  19593. };
  19594. PDFButton2.prototype.setFontSize = function(fontSize) {
  19595. assertPositive(fontSize, "fontSize");
  19596. this.acroField.setFontSize(fontSize);
  19597. this.markAsDirty();
  19598. };
  19599. PDFButton2.prototype.addToPage = function(text, page, options) {
  19600. var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
  19601. assertOrUndefined(text, "text", ["string"]);
  19602. assertOrUndefined(page, "page", [[PDFPage_default, "PDFPage"]]);
  19603. assertFieldAppearanceOptions(options);
  19604. var widget = this.createWidget({
  19605. x: ((_a = options === null || options === void 0 ? void 0 : options.x) !== null && _a !== void 0 ? _a : 0) - ((_b = options === null || options === void 0 ? void 0 : options.borderWidth) !== null && _b !== void 0 ? _b : 0) / 2,
  19606. y: ((_c = options === null || options === void 0 ? void 0 : options.y) !== null && _c !== void 0 ? _c : 0) - ((_d = options === null || options === void 0 ? void 0 : options.borderWidth) !== null && _d !== void 0 ? _d : 0) / 2,
  19607. width: (_e = options === null || options === void 0 ? void 0 : options.width) !== null && _e !== void 0 ? _e : 100,
  19608. height: (_f = options === null || options === void 0 ? void 0 : options.height) !== null && _f !== void 0 ? _f : 50,
  19609. textColor: (_g = options === null || options === void 0 ? void 0 : options.textColor) !== null && _g !== void 0 ? _g : rgb(0, 0, 0),
  19610. backgroundColor: (_h = options === null || options === void 0 ? void 0 : options.backgroundColor) !== null && _h !== void 0 ? _h : rgb(0.75, 0.75, 0.75),
  19611. borderColor: options === null || options === void 0 ? void 0 : options.borderColor,
  19612. borderWidth: (_j = options === null || options === void 0 ? void 0 : options.borderWidth) !== null && _j !== void 0 ? _j : 0,
  19613. rotate: (_k = options === null || options === void 0 ? void 0 : options.rotate) !== null && _k !== void 0 ? _k : degrees(0),
  19614. caption: text,
  19615. hidden: options === null || options === void 0 ? void 0 : options.hidden,
  19616. page: page.ref
  19617. });
  19618. var widgetRef = this.doc.context.register(widget.dict);
  19619. this.acroField.addWidget(widgetRef);
  19620. var font = (_l = options === null || options === void 0 ? void 0 : options.font) !== null && _l !== void 0 ? _l : this.doc.getForm().getDefaultFont();
  19621. this.updateWidgetAppearance(widget, font);
  19622. page.node.addAnnot(widgetRef);
  19623. };
  19624. PDFButton2.prototype.needsAppearancesUpdate = function() {
  19625. var _a;
  19626. if (this.isDirty())
  19627. return true;
  19628. var widgets = this.acroField.getWidgets();
  19629. for (var idx = 0, len = widgets.length; idx < len; idx++) {
  19630. var widget = widgets[idx];
  19631. var hasAppearances = ((_a = widget.getAppearances()) === null || _a === void 0 ? void 0 : _a.normal) instanceof PDFStream_default;
  19632. if (!hasAppearances)
  19633. return true;
  19634. }
  19635. return false;
  19636. };
  19637. PDFButton2.prototype.defaultUpdateAppearances = function(font) {
  19638. assertIs(font, "font", [[PDFFont_default, "PDFFont"]]);
  19639. this.updateAppearances(font);
  19640. };
  19641. PDFButton2.prototype.updateAppearances = function(font, provider) {
  19642. assertIs(font, "font", [[PDFFont_default, "PDFFont"]]);
  19643. assertOrUndefined(provider, "provider", [Function]);
  19644. var widgets = this.acroField.getWidgets();
  19645. for (var idx = 0, len = widgets.length; idx < len; idx++) {
  19646. var widget = widgets[idx];
  19647. this.updateWidgetAppearance(widget, font, provider);
  19648. }
  19649. };
  19650. PDFButton2.prototype.updateWidgetAppearance = function(widget, font, provider) {
  19651. var apProvider = provider !== null && provider !== void 0 ? provider : defaultButtonAppearanceProvider;
  19652. var appearances = normalizeAppearance(apProvider(this, widget, font));
  19653. this.updateWidgetAppearanceWithFont(widget, font, appearances);
  19654. };
  19655. PDFButton2.of = function(acroPushButton, ref, doc) {
  19656. return new PDFButton2(acroPushButton, ref, doc);
  19657. };
  19658. return PDFButton2;
  19659. }(PDFField_default)
  19660. );
  19661. var PDFButton_default = PDFButton;
  19662. // src/utils.ts
  19663. var import_obsidian = require("obsidian");
  19664. var TreeNode = class {
  19665. constructor(key, title, level) {
  19666. this.children = [];
  19667. this.key = key;
  19668. this.title = title;
  19669. this.level = level;
  19670. this.children = [];
  19671. }
  19672. };
  19673. function getHeadingTree(doc = document) {
  19674. const headings = doc.querySelectorAll("h1, h2, h3, h4, h5, h6");
  19675. const root = new TreeNode("", "Root", 0);
  19676. let prev = root;
  19677. headings.forEach((heading) => {
  19678. var _a;
  19679. if (heading.style.display == "none") {
  19680. return;
  19681. }
  19682. const level = parseInt(heading.tagName.slice(1));
  19683. const link = heading.querySelector("a.md-print-anchor");
  19684. const regexMatch = /^af:\/\/(.+)$/.exec((_a = link == null ? void 0 : link.href) != null ? _a : "");
  19685. if (!regexMatch) {
  19686. return;
  19687. }
  19688. const newNode = new TreeNode(regexMatch[1], heading.innerText, level);
  19689. while (prev.level >= level) {
  19690. prev = prev.parent;
  19691. }
  19692. prev.children.push(newNode);
  19693. newNode.parent = prev;
  19694. prev = newNode;
  19695. });
  19696. return root;
  19697. }
  19698. function modifyDest(doc) {
  19699. const data = /* @__PURE__ */ new Map();
  19700. doc.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach((heading, i) => {
  19701. const link = document.createElement("a");
  19702. const flag3 = `${heading.tagName.toLowerCase()}-${i}`;
  19703. link.href = `af://${flag3}`;
  19704. link.className = "md-print-anchor";
  19705. heading.appendChild(link);
  19706. data.set(heading.dataset.heading, flag3);
  19707. });
  19708. return data;
  19709. }
  19710. function convertMapKeysToLowercase(map) {
  19711. return new Map(Array.from(map).map(([key, value]) => [key == null ? void 0 : key.toLowerCase(), value]));
  19712. }
  19713. function fixAnchors(doc, dest, basename) {
  19714. const lowerDest = convertMapKeysToLowercase(dest);
  19715. doc.querySelectorAll("a.internal-link").forEach((el, i) => {
  19716. var _a, _b, _c;
  19717. const [title, anchor] = (_b = (_a = el.dataset.href) == null ? void 0 : _a.split("#")) != null ? _b : [];
  19718. if (anchor == null ? void 0 : anchor.startsWith("^")) {
  19719. el.href = (_c = el.dataset.href) == null ? void 0 : _c.toLowerCase();
  19720. }
  19721. if ((anchor == null ? void 0 : anchor.length) > 0) {
  19722. if ((title == null ? void 0 : title.length) > 0 && title != basename) {
  19723. return;
  19724. }
  19725. const flag3 = dest.get(anchor) || lowerDest.get(anchor == null ? void 0 : anchor.toLowerCase());
  19726. if (flag3 && !anchor.startsWith("^")) {
  19727. el.href = `an://${flag3}`;
  19728. }
  19729. }
  19730. });
  19731. }
  19732. var px2mm = (px2) => {
  19733. return Math.round(px2 * 0.26458333333719);
  19734. };
  19735. var mm2px = (mm) => {
  19736. return Math.round(mm * 3.779527559);
  19737. };
  19738. function traverseFolder(path2) {
  19739. if (path2 instanceof import_obsidian.TFile) {
  19740. if (path2.extension == "md") {
  19741. return [path2];
  19742. } else {
  19743. return [];
  19744. }
  19745. }
  19746. const arr = [];
  19747. for (const item of path2.children) {
  19748. arr.push(...traverseFolder(item));
  19749. }
  19750. return arr;
  19751. }
  19752. function copyAttributes(node, attributes) {
  19753. Array.from(attributes).forEach((attr) => {
  19754. node.setAttribute(attr.name, attr.value);
  19755. });
  19756. }
  19757. // src/pdf.ts
  19758. async function getDestPosition(pdfDoc) {
  19759. const pages = pdfDoc.getPages();
  19760. const links = {};
  19761. pages.forEach((page, pageIndex) => {
  19762. var _a, _b;
  19763. const annotations = page.node.Annots();
  19764. if (!annotations) {
  19765. return;
  19766. }
  19767. const numAnnotations = (_a = annotations == null ? void 0 : annotations.size()) != null ? _a : 0;
  19768. for (let annotIndex = 0; annotIndex < numAnnotations; annotIndex++) {
  19769. try {
  19770. const annotation = annotations.lookup(annotIndex, PDFDict_default);
  19771. const subtype = annotation.get(PDFName_default.of("Subtype"));
  19772. if ((subtype == null ? void 0 : subtype.toString()) === "/Link") {
  19773. const linkDict = annotation.get(PDFName_default.of("A"));
  19774. const uri = linkDict == null ? void 0 : linkDict.get(PDFName_default.of("URI")).toString();
  19775. console.debug("uri", uri);
  19776. const regexMatch = /^\(af:\/\/(.+)\)$/.exec(uri || "");
  19777. if (regexMatch) {
  19778. const rect = (_b = annotation.get(PDFName_default.of("Rect"))) == null ? void 0 : _b.asRectangle();
  19779. const linkUrl = regexMatch[1];
  19780. const yPos = rect.y;
  19781. links[linkUrl] = [pageIndex, yPos];
  19782. }
  19783. }
  19784. } catch (err) {
  19785. console.error(err);
  19786. }
  19787. }
  19788. });
  19789. return links;
  19790. }
  19791. async function setAnchors(pdfDoc, links) {
  19792. const pages = pdfDoc.getPages();
  19793. pages.forEach((page, _) => {
  19794. var _a;
  19795. const annots = page.node.Annots();
  19796. if (!annots) {
  19797. return;
  19798. }
  19799. const numAnnotations = (_a = annots == null ? void 0 : annots.size()) != null ? _a : 0;
  19800. for (let idx = 0; idx < numAnnotations; idx++) {
  19801. try {
  19802. const linkAnnotRef = annots.get(idx);
  19803. const linkAnnot = annots.lookup(idx, PDFDict_default);
  19804. const subtype = linkAnnot.get(PDFName_default.of("Subtype"));
  19805. if ((subtype == null ? void 0 : subtype.toString()) === "/Link") {
  19806. const linkDict = linkAnnot.get(PDFName_default.of("A"));
  19807. const uri = linkDict == null ? void 0 : linkDict.get(PDFName_default.of("URI")).toString();
  19808. console.debug("uri", uri);
  19809. const regexMatch = /^\(an:\/\/(.+)\)$/.exec(uri || "");
  19810. const key = regexMatch == null ? void 0 : regexMatch[1];
  19811. if (key && (links == null ? void 0 : links[key])) {
  19812. const [pageIdx, yPos] = links[key];
  19813. const newAnnot = pdfDoc.context.obj({
  19814. Type: "Annot",
  19815. Subtype: "Link",
  19816. Rect: linkAnnot.lookup(PDFName_default.of("Rect")),
  19817. Border: linkAnnot.lookup(PDFName_default.of("Border")),
  19818. C: linkAnnot.lookup(PDFName_default.of("C")),
  19819. Dest: [pages[pageIdx].ref, "XYZ", null, yPos, null]
  19820. });
  19821. pdfDoc.context.assign(linkAnnotRef, newAnnot);
  19822. }
  19823. }
  19824. } catch (err) {
  19825. console.error(err);
  19826. }
  19827. }
  19828. });
  19829. return links;
  19830. }
  19831. function generateOutlines(root, positions, maxLevel = 6) {
  19832. var _a, _b;
  19833. const _outline = (node) => {
  19834. var _a2, _b2;
  19835. if (node.level > maxLevel) {
  19836. return;
  19837. }
  19838. const [pageIdx, pos] = (_a2 = positions == null ? void 0 : positions[node.key]) != null ? _a2 : [0, 0];
  19839. const outline = {
  19840. title: node.title,
  19841. to: [pageIdx, 0, pos],
  19842. open: false,
  19843. children: []
  19844. };
  19845. if (((_b2 = node.children) == null ? void 0 : _b2.length) > 0) {
  19846. for (const item of node.children) {
  19847. const child = _outline(item);
  19848. if (child) {
  19849. outline.children.push(child);
  19850. }
  19851. }
  19852. }
  19853. return outline;
  19854. };
  19855. return (_b = (_a = _outline(root)) == null ? void 0 : _a.children) != null ? _b : [];
  19856. }
  19857. var walk = (outlines, callback) => {
  19858. for (const outline of outlines) {
  19859. const ret = callback(outline);
  19860. if ("children" in outline && ret !== false) walk(outline.children, callback);
  19861. }
  19862. };
  19863. var flatten = (outlines) => {
  19864. const result = [];
  19865. walk(outlines, (outline) => void result.push(outline));
  19866. return result;
  19867. };
  19868. var getOpeningCount = (outlines) => {
  19869. let count = 0;
  19870. walk(outlines, (outline) => {
  19871. count += 1;
  19872. return !("open" in outline && !outline.open);
  19873. });
  19874. return count;
  19875. };
  19876. var setOutline = async (doc, outlines) => {
  19877. const rootRef = doc.context.nextRef();
  19878. const refMap = /* @__PURE__ */ new WeakMap();
  19879. for (const outline of flatten(outlines)) {
  19880. refMap.set(outline, doc.context.nextRef());
  19881. }
  19882. const pageRefs = (() => {
  19883. const refs = [];
  19884. doc.catalog.Pages().traverse((kid, ref) => {
  19885. var _a;
  19886. if (((_a = kid.get(kid.context.obj("Type"))) == null ? void 0 : _a.toString()) === "/Page") {
  19887. refs.push(ref);
  19888. }
  19889. });
  19890. return refs;
  19891. })();
  19892. const createOutline = (outlines2, parent) => {
  19893. const { length } = outlines2;
  19894. for (let i = 0; i < length; i += 1) {
  19895. const outline = outlines2[i];
  19896. const outlineRef = refMap.get(outline);
  19897. const destOrAction = (() => {
  19898. if (typeof outline.to === "number") {
  19899. return { Dest: [pageRefs[outline.to], "Fit"] };
  19900. } else if (Array.isArray(outline.to)) {
  19901. return {
  19902. Dest: [pageRefs[outline.to[0]], "XYZ", outline.to[1], outline.to[2], null]
  19903. };
  19904. }
  19905. return {};
  19906. })();
  19907. const childrenDict = (() => {
  19908. if ("children" in outline && outline.children.length > 0) {
  19909. createOutline(outline.children, outlineRef);
  19910. return {
  19911. First: refMap.get(outline.children[0]),
  19912. Last: refMap.get(outline.children[outline.children.length - 1]),
  19913. Count: getOpeningCount(outline.children) * (outline.open ? 1 : -1)
  19914. };
  19915. }
  19916. return {};
  19917. })();
  19918. doc.context.assign(
  19919. outlineRef,
  19920. doc.context.obj({
  19921. Title: PDFHexString_default.fromText(outline.title),
  19922. Parent: parent,
  19923. ...i > 0 ? { Prev: refMap.get(outlines2[i - 1]) } : {},
  19924. ...i < length - 1 ? { Next: refMap.get(outlines2[i + 1]) } : {},
  19925. ...childrenDict,
  19926. ...destOrAction,
  19927. F: (outline.italic ? 1 : 0) | (outline.bold ? 2 : 0)
  19928. })
  19929. );
  19930. }
  19931. };
  19932. createOutline(outlines, rootRef);
  19933. const rootCount = getOpeningCount(outlines);
  19934. doc.context.assign(
  19935. rootRef,
  19936. doc.context.obj({
  19937. Type: "Outlines",
  19938. ...rootCount > 0 ? {
  19939. First: refMap.get(outlines[0]),
  19940. Last: refMap.get(outlines[outlines.length - 1])
  19941. } : {},
  19942. Count: rootCount
  19943. })
  19944. );
  19945. doc.catalog.set(doc.context.obj("Outlines"), rootRef);
  19946. };
  19947. async function editPDF(data, { headings, maxLevel, frontMatter, displayMetadata }) {
  19948. const pdfDoc = await PDFDocument_default.load(data);
  19949. const posistions = await getDestPosition(pdfDoc);
  19950. setAnchors(pdfDoc, posistions);
  19951. const outlines = generateOutlines(headings, posistions, maxLevel);
  19952. setOutline(pdfDoc, outlines);
  19953. if (displayMetadata) {
  19954. setMetadata(pdfDoc, frontMatter != null ? frontMatter : {});
  19955. }
  19956. data = await pdfDoc.save();
  19957. return data;
  19958. }
  19959. function setMetadata(pdfDoc, { title, author, keywords, subject, creator, created_at, updated_at }) {
  19960. if (title) {
  19961. pdfDoc.setTitle(title, { showInWindowTitleBar: true });
  19962. }
  19963. if (author) {
  19964. pdfDoc.setAuthor(author);
  19965. }
  19966. if (keywords) {
  19967. pdfDoc.setKeywords(typeof keywords == "string" ? [keywords] : keywords);
  19968. }
  19969. if (subject) {
  19970. pdfDoc.setSubject(subject);
  19971. }
  19972. pdfDoc.setCreator(creator != null ? creator : "Obsidian");
  19973. pdfDoc.setProducer("Obsidian");
  19974. pdfDoc.setCreationDate(new Date(created_at != null ? created_at : /* @__PURE__ */ new Date()));
  19975. pdfDoc.setModificationDate(new Date(updated_at != null ? updated_at : /* @__PURE__ */ new Date()));
  19976. }
  19977. async function exportToPDF(outputFile, config, w, { doc, frontMatter }) {
  19978. var _a, _b, _c, _d, _e, _f, _g, _h, _i;
  19979. console.log("output pdf:", outputFile);
  19980. let pageSize = config["pageSize"];
  19981. if (config["pageSize"] == "Custom" && config["pageWidth"] && config["pageHeight"]) {
  19982. pageSize = {
  19983. width: parseFloat((_a = config["pageWidth"]) != null ? _a : "0") / 25.4,
  19984. height: parseFloat((_b = config["pageHeight"]) != null ? _b : "0") / 25.4
  19985. };
  19986. }
  19987. const printOptions = {
  19988. landscape: config == null ? void 0 : config["landscape"],
  19989. printBackground: config == null ? void 0 : config["printBackground"],
  19990. generateTaggedPDF: config == null ? void 0 : config["generateTaggedPDF"],
  19991. pageSize,
  19992. scale: config["scale"] / 100,
  19993. margins: {
  19994. marginType: "default"
  19995. },
  19996. displayHeaderFooter: config["displayHeader"] || config["displayFooter"],
  19997. headerTemplate: config["displayHeader"] ? (_c = frontMatter == null ? void 0 : frontMatter["headerTemplate"]) != null ? _c : config["headerTemplate"] : "<span></span>",
  19998. footerTemplate: config["displayFooter"] ? (_d = frontMatter == null ? void 0 : frontMatter["footerTemplate"]) != null ? _d : config["footerTemplate"] : "<span></span>"
  19999. };
  20000. if (config.marginType == "0") {
  20001. printOptions["margins"] = {
  20002. marginType: "custom",
  20003. top: 0,
  20004. bottom: 0,
  20005. left: 0,
  20006. right: 0
  20007. };
  20008. } else if (config.marginType == "1") {
  20009. printOptions["margins"] = {
  20010. marginType: "default"
  20011. };
  20012. } else if (config.marginType == "2") {
  20013. printOptions["margins"] = {
  20014. marginType: "custom",
  20015. top: 0.1,
  20016. bottom: 0.1,
  20017. left: 0.1,
  20018. right: 0.1
  20019. };
  20020. } else if (config.marginType == "3") {
  20021. printOptions["margins"] = {
  20022. marginType: "custom",
  20023. top: parseFloat((_e = config["marginTop"]) != null ? _e : "0") / 25.4,
  20024. bottom: parseFloat((_f = config["marginBottom"]) != null ? _f : "0") / 25.4,
  20025. left: parseFloat((_g = config["marginLeft"]) != null ? _g : "0") / 25.4,
  20026. right: parseFloat((_h = config["marginRight"]) != null ? _h : "0") / 25.4
  20027. };
  20028. }
  20029. try {
  20030. let data = await w.printToPDF(printOptions);
  20031. data = await editPDF(data, {
  20032. headings: getHeadingTree(doc),
  20033. frontMatter,
  20034. displayMetadata: config == null ? void 0 : config.displayMetadata,
  20035. maxLevel: parseInt((_i = config == null ? void 0 : config.maxLevel) != null ? _i : "6")
  20036. });
  20037. await fs.writeFile(outputFile, data);
  20038. if (config.open) {
  20039. import_electron.default.remote.shell.openPath(outputFile);
  20040. }
  20041. } catch (error2) {
  20042. console.error(error2);
  20043. }
  20044. }
  20045. async function getOutputFile(filename, isTimestamp) {
  20046. const result = await import_electron.default.remote.dialog.showSaveDialog({
  20047. title: "Export to PDF",
  20048. defaultPath: filename + (isTimestamp ? "-" + Date.now() : "") + ".pdf",
  20049. filters: [
  20050. { name: "All Files", extensions: ["*"] },
  20051. { name: "PDF", extensions: ["pdf"] }
  20052. ],
  20053. properties: ["showOverwriteConfirmation", "createDirectory"]
  20054. });
  20055. if (result.canceled) {
  20056. return;
  20057. }
  20058. return result.filePath;
  20059. }
  20060. async function getOutputPath(filename, isTimestamp) {
  20061. const result = await import_electron.default.remote.dialog.showOpenDialog({
  20062. title: "Export to PDF",
  20063. defaultPath: filename,
  20064. properties: ["openDirectory"]
  20065. });
  20066. if (result.canceled) {
  20067. return;
  20068. }
  20069. return result.filePaths[0];
  20070. }
  20071. // src/render.ts
  20072. var import_obsidian2 = require("obsidian");
  20073. function getAllStyles() {
  20074. const cssTexts = [];
  20075. Array.from(document.styleSheets).forEach((sheet) => {
  20076. var _a, _b, _c;
  20077. const id = (_a = sheet.ownerNode) == null ? void 0 : _a.id;
  20078. if (id == null ? void 0 : id.startsWith("svelte-")) {
  20079. return;
  20080. }
  20081. const href = (_b = sheet.ownerNode) == null ? void 0 : _b.href;
  20082. const division = `/* ----------${id ? `id:${id}` : href ? `href:${href}` : ""}---------- */`;
  20083. cssTexts.push(division);
  20084. try {
  20085. Array.from((_c = sheet == null ? void 0 : sheet.cssRules) != null ? _c : []).forEach((rule) => {
  20086. cssTexts.push(rule.cssText);
  20087. });
  20088. } catch (error2) {
  20089. console.error(error2);
  20090. }
  20091. });
  20092. cssTexts.push(...getPatchStyle());
  20093. return cssTexts;
  20094. }
  20095. var CSS_PATCH = `
  20096. /* ---------- css patch ---------- */
  20097. body {
  20098. overflow: auto !important;
  20099. }
  20100. @media print {
  20101. .print .markdown-preview-view {
  20102. height: auto !important;
  20103. }
  20104. .md-print-anchor, .blockid {
  20105. white-space: pre !important;
  20106. border-left: none !important;
  20107. border-right: none !important;
  20108. border-top: none !important;
  20109. border-bottom: none !important;
  20110. display: inline-block !important;
  20111. position: absolute !important;
  20112. width: 1px !important;
  20113. height: 1px !important;
  20114. right: 0 !important;
  20115. outline: 0 !important;
  20116. background: 0 0 !important;
  20117. text-decoration: initial !important;
  20118. text-shadow: initial !important;
  20119. }
  20120. }
  20121. @media print {
  20122. table {
  20123. break-inside: auto;
  20124. }
  20125. tr {
  20126. break-inside: avoid;
  20127. break-after: auto;
  20128. }
  20129. }
  20130. `;
  20131. function getPatchStyle() {
  20132. return [CSS_PATCH, ...getPrintStyle()];
  20133. }
  20134. function getPrintStyle() {
  20135. const cssTexts = [];
  20136. Array.from(document.styleSheets).forEach((sheet) => {
  20137. var _a;
  20138. try {
  20139. const cssRules = (_a = sheet == null ? void 0 : sheet.cssRules) != null ? _a : [];
  20140. Array.from(cssRules).forEach((rule) => {
  20141. if (rule.constructor.name == "CSSMediaRule") {
  20142. if (rule.conditionText === "print") {
  20143. const res = rule.cssText.replace(/@media print\s*\{(.+)\}/gms, "$1");
  20144. cssTexts.push(res);
  20145. }
  20146. }
  20147. });
  20148. } catch (error2) {
  20149. console.error(error2);
  20150. }
  20151. });
  20152. return cssTexts;
  20153. }
  20154. function generateDocId(n) {
  20155. return Array.from({ length: n }, () => (16 * Math.random() | 0).toString(16)).join("");
  20156. }
  20157. function getFrontMatter(app, file) {
  20158. var _a;
  20159. const cache = app.metadataCache.getFileCache(file);
  20160. return (_a = cache == null ? void 0 : cache.frontmatter) != null ? _a : {};
  20161. }
  20162. async function renderMarkdown(app, file, config, extra) {
  20163. var _a, _b, _c, _d, _e, _f, _g, _h;
  20164. const startTime = (/* @__PURE__ */ new Date()).getTime();
  20165. const ws = app.workspace;
  20166. if (((_a = ws.getActiveFile()) == null ? void 0 : _a.path) != file.path) {
  20167. const leaf = ws.getLeaf();
  20168. await leaf.openFile(file);
  20169. }
  20170. const view = ws.getActiveViewOfType(import_obsidian2.MarkdownView);
  20171. const data = (_e = (_c = view == null ? void 0 : view.data) != null ? _c : (_b = ws == null ? void 0 : ws.getActiveFileView()) == null ? void 0 : _b.data) != null ? _e : (_d = ws.activeEditor) == null ? void 0 : _d.data;
  20172. if (!data) {
  20173. new import_obsidian2.Notice("data is empty!");
  20174. }
  20175. const frontMatter = getFrontMatter(app, file);
  20176. const cssclasses = [];
  20177. for (const [key, val] of Object.entries(frontMatter)) {
  20178. if (key.toLowerCase() == "cssclass" || key.toLowerCase() == "cssclasses") {
  20179. if (Array.isArray(val)) {
  20180. cssclasses.push(...val);
  20181. } else {
  20182. cssclasses.push(val);
  20183. }
  20184. }
  20185. }
  20186. const comp = new import_obsidian2.Component();
  20187. comp.load();
  20188. const printEl = document.body.createDiv("print");
  20189. const viewEl = printEl.createDiv({
  20190. cls: "markdown-preview-view markdown-rendered " + cssclasses.join(" ")
  20191. });
  20192. app.vault.cachedRead(file);
  20193. viewEl.toggleClass("rtl", app.vault.getConfig("rightToLeft"));
  20194. viewEl.toggleClass("show-properties", "hidden" !== app.vault.getConfig("propertiesInDocument"));
  20195. const title = (_f = extra == null ? void 0 : extra.title) != null ? _f : file.basename;
  20196. viewEl.createEl("h1", { text: title }, (e) => {
  20197. var _a2;
  20198. e.addClass("__title__");
  20199. e.style.display = config.showTitle ? "block" : "none";
  20200. e.id = (_a2 = extra == null ? void 0 : extra.id) != null ? _a2 : "";
  20201. });
  20202. const cache = app.metadataCache.getFileCache(file);
  20203. const lines = (_g = data == null ? void 0 : data.split("\n")) != null ? _g : [];
  20204. Object.entries((_h = cache == null ? void 0 : cache.blocks) != null ? _h : {}).forEach(([key, c]) => {
  20205. const idx = c.position.end.line;
  20206. lines[idx] = `<span id="^${key}" class="blockid"></span>
  20207. ` + lines[idx];
  20208. });
  20209. const fragment = {
  20210. children: void 0,
  20211. appendChild(e) {
  20212. this.children = e == null ? void 0 : e.children;
  20213. throw new Error("exit");
  20214. }
  20215. };
  20216. const promises = [];
  20217. try {
  20218. await import_obsidian2.MarkdownRenderer.render(app, lines.join("\n"), fragment, file.path, comp);
  20219. } catch (error2) {
  20220. }
  20221. const el = createFragment();
  20222. Array.from(fragment.children).forEach((item) => {
  20223. el.createDiv({}, (t) => {
  20224. return t.appendChild(item);
  20225. });
  20226. });
  20227. viewEl.appendChild(el);
  20228. await import_obsidian2.MarkdownRenderer.postProcess(app, {
  20229. docId: generateDocId(16),
  20230. sourcePath: file.path,
  20231. frontmatter: {},
  20232. promises,
  20233. addChild: function(e) {
  20234. return comp.addChild(e);
  20235. },
  20236. getSectionInfo: function() {
  20237. return null;
  20238. },
  20239. containerEl: viewEl,
  20240. el: viewEl,
  20241. displayMode: true
  20242. });
  20243. await Promise.all(promises);
  20244. printEl.findAll("a.internal-link").forEach((el2) => {
  20245. var _a2, _b2;
  20246. const [title2, anchor] = (_b2 = (_a2 = el2.dataset.href) == null ? void 0 : _a2.split("#")) != null ? _b2 : [];
  20247. if ((!title2 || (title2 == null ? void 0 : title2.length) == 0 || title2 == file.basename) && (anchor == null ? void 0 : anchor.startsWith("^"))) {
  20248. return;
  20249. }
  20250. el2.removeAttribute("href");
  20251. });
  20252. try {
  20253. await fixWaitRender(data, viewEl);
  20254. } catch (error2) {
  20255. console.warn("wait timeout");
  20256. }
  20257. fixCanvasToImage(viewEl);
  20258. const doc = document.implementation.createHTMLDocument("document");
  20259. doc.body.appendChild(printEl.cloneNode(true));
  20260. printEl.detach();
  20261. comp.unload();
  20262. printEl.remove();
  20263. doc.title = title;
  20264. console.log(`md render time:${(/* @__PURE__ */ new Date()).getTime() - startTime}ms`);
  20265. return { doc, frontMatter, file };
  20266. }
  20267. function fixDoc(doc, title) {
  20268. const dest = modifyDest(doc);
  20269. fixAnchors(doc, dest, title);
  20270. encodeEmbeds(doc);
  20271. return doc;
  20272. }
  20273. function encodeEmbeds(doc) {
  20274. const spans = Array.from(doc.querySelectorAll("span.markdown-embed")).reverse();
  20275. spans.forEach((span) => span.innerHTML = encodeURIComponent(span.innerHTML));
  20276. }
  20277. async function fixWaitRender(data, viewEl) {
  20278. if (data.includes("```dataview") || data.includes("```gEvent") || data.includes("![[")) {
  20279. await sleep(2e3);
  20280. }
  20281. try {
  20282. await waitForDomChange(viewEl);
  20283. } catch (error2) {
  20284. await sleep(1e3);
  20285. }
  20286. }
  20287. function fixCanvasToImage(el) {
  20288. for (const canvas of Array.from(el.querySelectorAll("canvas"))) {
  20289. const data = canvas.toDataURL();
  20290. const img = document.createElement("img");
  20291. img.src = data;
  20292. copyAttributes(img, canvas.attributes);
  20293. img.className = "__canvas__";
  20294. canvas.replaceWith(img);
  20295. }
  20296. }
  20297. function createWebview(scale2 = 1.25) {
  20298. const webview = document.createElement("webview");
  20299. webview.src = `app://obsidian.md/help.html`;
  20300. webview.setAttribute(
  20301. "style",
  20302. `height:calc(${scale2} * 100%);
  20303. width: calc(${scale2} * 100%);
  20304. transform: scale(${1 / scale2}, ${1 / scale2});
  20305. transform-origin: top left;
  20306. border: 1px solid #f2f2f2;
  20307. `
  20308. );
  20309. webview.nodeintegration = true;
  20310. return webview;
  20311. }
  20312. function waitForDomChange(target, timeout = 2e3, interval = 200) {
  20313. return new Promise((resolve, reject) => {
  20314. let timer;
  20315. const observer = new MutationObserver((m) => {
  20316. clearTimeout(timer);
  20317. timer = setTimeout(() => {
  20318. observer.disconnect();
  20319. resolve(true);
  20320. }, interval);
  20321. });
  20322. observer.observe(target, {
  20323. childList: true,
  20324. subtree: true,
  20325. attributes: true,
  20326. characterData: true
  20327. });
  20328. setTimeout(() => {
  20329. observer.disconnect();
  20330. reject(new Error(`timeout ${timeout}ms`));
  20331. }, timeout);
  20332. });
  20333. }
  20334. // src/modal.ts
  20335. function fullWidthButton(button) {
  20336. button.buttonEl.setAttribute("style", `margin: "0 auto"; width: -webkit-fill-available`);
  20337. }
  20338. function setInputWidth(inputEl) {
  20339. inputEl.setAttribute("style", `width: 100px;`);
  20340. }
  20341. var ExportConfigModal = class extends import_obsidian3.Modal {
  20342. constructor(plugin, file, multiplePdf) {
  20343. var _a, _b, _c, _d, _e;
  20344. super(plugin.app);
  20345. this.canceled = true;
  20346. this.plugin = plugin;
  20347. this.file = file;
  20348. this.completed = false;
  20349. this.i18n = i18n_default.current;
  20350. this.docs = [];
  20351. this.scale = 0.75;
  20352. this.webviews = [];
  20353. this.multiplePdf = multiplePdf;
  20354. this.config = {
  20355. pageSize: "A4",
  20356. marginType: "1",
  20357. showTitle: (_a = plugin.settings.showTitle) != null ? _a : true,
  20358. open: true,
  20359. scale: 100,
  20360. landscape: false,
  20361. marginTop: "10",
  20362. marginBottom: "10",
  20363. marginLeft: "10",
  20364. marginRight: "10",
  20365. displayHeader: (_b = plugin.settings.displayHeader) != null ? _b : true,
  20366. displayFooter: (_c = plugin.settings.displayHeader) != null ? _c : true,
  20367. cssSnippet: "0",
  20368. ...(_e = (_d = plugin.settings) == null ? void 0 : _d.prevConfig) != null ? _e : {}
  20369. };
  20370. }
  20371. getFileCache(file) {
  20372. return this.app.metadataCache.getFileCache(file);
  20373. }
  20374. async renderFiles() {
  20375. var _a, _b;
  20376. const app = this.plugin.app;
  20377. const docs = [];
  20378. if (this.file instanceof import_obsidian3.TFolder) {
  20379. const files = traverseFolder(this.file);
  20380. for (const file of files) {
  20381. docs.push(await renderMarkdown(app, file, this.config));
  20382. }
  20383. } else {
  20384. const { doc, frontMatter, file } = await renderMarkdown(app, this.file, this.config);
  20385. docs.push({ doc, frontMatter, file });
  20386. if (frontMatter.toc) {
  20387. const cache = this.getFileCache(this.file);
  20388. const files = (_b = (_a = cache == null ? void 0 : cache.links) == null ? void 0 : _a.map(({ link, displayText }) => {
  20389. const id = crypto.randomUUID();
  20390. const elem = doc.querySelector(`a[data-href="${link}"]`);
  20391. if (elem) {
  20392. elem.href = `#${id}`;
  20393. }
  20394. return {
  20395. title: displayText,
  20396. file: this.app.metadataCache.getFirstLinkpathDest(link, this.file.path),
  20397. id
  20398. };
  20399. }).filter((item) => item.file instanceof import_obsidian3.TFile)) != null ? _b : [];
  20400. for (const item of files) {
  20401. docs.push(await renderMarkdown(app, item.file, this.config, item));
  20402. }
  20403. const leaf = this.app.workspace.getLeaf();
  20404. await leaf.openFile(this.file);
  20405. }
  20406. }
  20407. if (!this.multiplePdf) {
  20408. this.mergeDoc(docs);
  20409. }
  20410. this.docs = docs.map(({ doc, ...rest }) => {
  20411. return { ...rest, doc: fixDoc(doc, doc.title) };
  20412. });
  20413. }
  20414. mergeDoc(docs) {
  20415. const { doc: doc0, frontMatter, file } = docs[0];
  20416. const sections = [];
  20417. for (const { doc } of docs) {
  20418. const element = doc.querySelector(".markdown-preview-view");
  20419. if (element) {
  20420. const section = doc0.createElement("section");
  20421. Array.from(element.children).forEach((child) => {
  20422. section.appendChild(doc0.importNode(child, true));
  20423. });
  20424. sections.push(section);
  20425. }
  20426. }
  20427. const root = doc0.querySelector(".markdown-preview-view");
  20428. if (root) {
  20429. root.innerHTML = "";
  20430. }
  20431. sections.forEach((section) => {
  20432. root == null ? void 0 : root.appendChild(section);
  20433. });
  20434. this.docs = [{ doc: doc0, frontMatter, file }];
  20435. }
  20436. calcPageSize(element, config) {
  20437. var _a, _b, _c;
  20438. const { pageSize, pageWidth } = config != null ? config : this.config;
  20439. const el = element != null ? element : this.previewDiv;
  20440. let width = (_c = (_b = (_a = PageSize) == null ? void 0 : _a[pageSize]) == null ? void 0 : _b[0]) != null ? _c : parseFloat(pageWidth);
  20441. if (isNaN(width)) {
  20442. width = 210;
  20443. }
  20444. const scale2 = Math.floor(mm2px(width) / el.offsetWidth * 100) / 100;
  20445. this.webviews.forEach((wb) => {
  20446. wb.style.transform = `scale(${1 / scale2},${1 / scale2})`;
  20447. wb.style.width = `calc(${scale2} * 100%)`;
  20448. wb.style.height = `calc(${scale2} * 100%)`;
  20449. });
  20450. this.scale = scale2;
  20451. return scale2;
  20452. }
  20453. async calcWebviewSize() {
  20454. await sleep(500);
  20455. this.webviews.forEach(async (e, i) => {
  20456. var _a;
  20457. const [width, height] = await e.executeJavaScript("[document.body.offsetWidth, document.body.offsetHeight]");
  20458. const sizeEl = (_a = e.parentNode) == null ? void 0 : _a.querySelector(".print-size");
  20459. if (sizeEl) {
  20460. sizeEl.innerHTML = `${width}\xD7${height}px
  20461. ${px2mm(width)}\xD7${px2mm(height)}mm`;
  20462. }
  20463. });
  20464. }
  20465. async togglePrintSize() {
  20466. var _a;
  20467. (_a = document.querySelectorAll(".print-size")) == null ? void 0 : _a.forEach((sizeEl) => {
  20468. if (this.config["pageSize"] == "Custom") {
  20469. sizeEl.style.visibility = "visible";
  20470. } else {
  20471. sizeEl.style.visibility = "hidden";
  20472. }
  20473. });
  20474. }
  20475. makeWebviewJs(doc) {
  20476. return `
  20477. document.body.innerHTML = decodeURIComponent(\`${encodeURIComponent(doc.body.innerHTML)}\`);
  20478. document.head.innerHTML = decodeURIComponent(\`${encodeURIComponent(document.head.innerHTML)}\`);
  20479. // Function to recursively decode and replace innerHTML of span.markdown-embed elements
  20480. function decodeAndReplaceEmbed(element) {
  20481. // Replace the innerHTML with the decoded content
  20482. element.innerHTML = decodeURIComponent(element.innerHTML);
  20483. // Check if the new content contains further span.markdown-embed elements
  20484. const newEmbeds = element.querySelectorAll("span.markdown-embed");
  20485. newEmbeds.forEach(decodeAndReplaceEmbed);
  20486. }
  20487. // Start the process with all span.markdown-embed elements in the document
  20488. document.querySelectorAll("span.markdown-embed").forEach(decodeAndReplaceEmbed);
  20489. document.body.setAttribute("class", \`${document.body.getAttribute("class")}\`)
  20490. document.body.setAttribute("style", \`${document.body.getAttribute("style")}\`)
  20491. document.body.addClass("theme-light");
  20492. document.body.removeClass("theme-dark");
  20493. document.title = \`${doc.title}\`;
  20494. `;
  20495. }
  20496. /**
  20497. * append webview
  20498. * @param e HTMLDivElement
  20499. * @param render Rerender or not
  20500. */
  20501. async appendWebview(e, doc) {
  20502. const webview = createWebview(this.scale);
  20503. const preview = e.appendChild(webview);
  20504. this.webviews.push(preview);
  20505. this.preview = preview;
  20506. preview.addEventListener("dom-ready", async (e2) => {
  20507. this.completed = true;
  20508. getAllStyles().forEach(async (css) => {
  20509. await preview.insertCSS(css);
  20510. });
  20511. if (this.config.cssSnippet && this.config.cssSnippet != "0") {
  20512. try {
  20513. const cssSnippet = await fs2.readFile(this.config.cssSnippet, { encoding: "utf8" });
  20514. const printCss = cssSnippet.replaceAll(/@media print\s*{([^}]+)}/g, "$1");
  20515. await preview.insertCSS(printCss);
  20516. await preview.insertCSS(cssSnippet);
  20517. } catch (error2) {
  20518. console.warn(error2);
  20519. }
  20520. }
  20521. await preview.executeJavaScript(this.makeWebviewJs(doc));
  20522. getPatchStyle().forEach(async (css) => {
  20523. await preview.insertCSS(css);
  20524. });
  20525. });
  20526. }
  20527. async appendWebviews(e, render = true) {
  20528. var _a;
  20529. if (render) {
  20530. await this.renderFiles();
  20531. }
  20532. e.empty();
  20533. await Promise.all(
  20534. (_a = this.docs) == null ? void 0 : _a.map(async ({ doc }, i) => {
  20535. if (this.multiplePdf) {
  20536. e.createDiv({
  20537. text: `${i + 1}-${doc.title}`,
  20538. attr: { class: "filename" }
  20539. });
  20540. }
  20541. const div = e.createDiv({ attr: { class: "webview-wrapper" } });
  20542. div.createDiv({ attr: { class: "print-size" } });
  20543. await this.appendWebview(div, doc);
  20544. })
  20545. );
  20546. await this.calcWebviewSize();
  20547. }
  20548. async onOpen() {
  20549. var _a, _b, _c;
  20550. this.contentEl.empty();
  20551. this.containerEl.style.setProperty("--dialog-width", "60vw");
  20552. this.titleEl.setText("Export to PDF");
  20553. const wrapper = this.contentEl.createDiv({ attr: { id: "better-export-pdf" } });
  20554. const title = (_c = (_a = this.file) == null ? void 0 : _a.basename) != null ? _c : (_b = this.file) == null ? void 0 : _b.name;
  20555. this.previewDiv = wrapper.createDiv({ attr: { class: "pdf-preview" } }, async (el) => {
  20556. el.empty();
  20557. const resizeObserver = new ResizeObserver(() => {
  20558. this.calcPageSize(el);
  20559. });
  20560. resizeObserver.observe(el);
  20561. await this.appendWebviews(el);
  20562. this.togglePrintSize();
  20563. });
  20564. const contentEl = wrapper.createDiv();
  20565. contentEl.setAttribute("style", "width:320px;margin-left:16px;");
  20566. contentEl.addEventListener("keyup", (event) => {
  20567. if (event.key === "Enter") {
  20568. handleExport();
  20569. }
  20570. });
  20571. this.generateForm(contentEl);
  20572. const handleExport = async () => {
  20573. this.plugin.settings.prevConfig = this.config;
  20574. await this.plugin.saveSettings();
  20575. if (this.multiplePdf) {
  20576. const outputPath = await getOutputPath(title);
  20577. console.log("output:", outputPath);
  20578. if (outputPath) {
  20579. await Promise.all(
  20580. this.webviews.map(async (wb, i) => {
  20581. await exportToPDF(
  20582. `${outputPath}/${this.docs[i].file.basename}.pdf`,
  20583. { ...this.plugin.settings, ...this.config },
  20584. wb,
  20585. this.docs[i]
  20586. );
  20587. })
  20588. );
  20589. this.close();
  20590. }
  20591. } else {
  20592. const outputFile = await getOutputFile(title, this.plugin.settings.isTimestamp);
  20593. if (outputFile) {
  20594. await exportToPDF(outputFile, { ...this.plugin.settings, ...this.config }, this.webviews[0], this.docs[0]);
  20595. this.close();
  20596. }
  20597. }
  20598. };
  20599. new import_obsidian3.Setting(contentEl).setHeading().addButton((button) => {
  20600. button.setButtonText("Export").onClick(handleExport);
  20601. button.setCta();
  20602. fullWidthButton(button);
  20603. });
  20604. new import_obsidian3.Setting(contentEl).setHeading().addButton((button) => {
  20605. button.setButtonText("Refresh").onClick(async () => {
  20606. await this.appendWebviews(this.previewDiv);
  20607. });
  20608. fullWidthButton(button);
  20609. });
  20610. const debugEl = new import_obsidian3.Setting(contentEl).setHeading().addButton((button) => {
  20611. button.setButtonText("Debug").onClick(async () => {
  20612. var _a2;
  20613. (_a2 = this.preview) == null ? void 0 : _a2.openDevTools();
  20614. });
  20615. fullWidthButton(button);
  20616. });
  20617. debugEl.settingEl.hidden = !this.plugin.settings.debug;
  20618. }
  20619. generateForm(contentEl) {
  20620. new import_obsidian3.Setting(contentEl).setName(this.i18n.exportDialog.filenameAsTitle).addToggle(
  20621. (toggle) => toggle.setTooltip("Include file name as title").setValue(this.config["showTitle"]).onChange(async (value) => {
  20622. this.config["showTitle"] = value;
  20623. this.webviews.forEach((wv, i) => {
  20624. var _a, _b;
  20625. wv.executeJavaScript(`
  20626. var _title = document.querySelector("h1.__title__");
  20627. if (_title) {
  20628. _title.style.display = "${value ? "block" : "none"}";
  20629. }
  20630. `);
  20631. const _title = (_b = (_a = this.docs[i]) == null ? void 0 : _a.doc) == null ? void 0 : _b.querySelector("h1.__title__");
  20632. if (_title) {
  20633. _title.style.display = value ? "block" : "none";
  20634. }
  20635. });
  20636. })
  20637. );
  20638. const pageSizes = [
  20639. "A0",
  20640. "A1",
  20641. "A2",
  20642. "A3",
  20643. "A4",
  20644. "A5",
  20645. "A6",
  20646. "Legal",
  20647. "Letter",
  20648. "Tabloid",
  20649. "Ledger",
  20650. "Custom"
  20651. ];
  20652. new import_obsidian3.Setting(contentEl).setName(this.i18n.exportDialog.pageSize).addDropdown((dropdown) => {
  20653. dropdown.addOptions(Object.fromEntries(pageSizes.map((size) => [size, size]))).setValue(this.config.pageSize).onChange(async (value) => {
  20654. this.config["pageSize"] = value;
  20655. if (value == "Custom") {
  20656. sizeEl.settingEl.hidden = false;
  20657. } else {
  20658. sizeEl.settingEl.hidden = true;
  20659. }
  20660. this.togglePrintSize();
  20661. this.calcPageSize();
  20662. await this.calcWebviewSize();
  20663. });
  20664. });
  20665. const sizeEl = new import_obsidian3.Setting(contentEl).setName("Width/Height").addText((text) => {
  20666. setInputWidth(text.inputEl);
  20667. text.setPlaceholder("width").setValue(this.config["pageWidth"]).onChange(
  20668. (0, import_obsidian3.debounce)(
  20669. async (value) => {
  20670. this.config["pageWidth"] = value;
  20671. this.calcPageSize();
  20672. await this.calcWebviewSize();
  20673. },
  20674. 500,
  20675. true
  20676. )
  20677. );
  20678. }).addText((text) => {
  20679. setInputWidth(text.inputEl);
  20680. text.setPlaceholder("height").setValue(this.config["pageHeight"]).onChange((value) => {
  20681. this.config["pageHeight"] = value;
  20682. });
  20683. });
  20684. sizeEl.settingEl.hidden = this.config["pageSize"] !== "Custom";
  20685. new import_obsidian3.Setting(contentEl).setName(this.i18n.exportDialog.margin).setDesc("The unit is millimeters.").addDropdown((dropdown) => {
  20686. dropdown.addOption("0", "None").addOption("1", "Default").addOption("2", "Small").addOption("3", "Custom").setValue(this.config["marginType"]).onChange(async (value) => {
  20687. this.config["marginType"] = value;
  20688. if (value == "3") {
  20689. topEl.settingEl.hidden = false;
  20690. btmEl.settingEl.hidden = false;
  20691. } else {
  20692. topEl.settingEl.hidden = true;
  20693. btmEl.settingEl.hidden = true;
  20694. }
  20695. });
  20696. });
  20697. const topEl = new import_obsidian3.Setting(contentEl).setName("Top/Bottom").addText((text) => {
  20698. setInputWidth(text.inputEl);
  20699. text.setPlaceholder("margin top").setValue(this.config["marginTop"]).onChange((value) => {
  20700. this.config["marginTop"] = value;
  20701. });
  20702. }).addText((text) => {
  20703. setInputWidth(text.inputEl);
  20704. text.setPlaceholder("margin bottom").setValue(this.config["marginBottom"]).onChange((value) => {
  20705. this.config["marginBottom"] = value;
  20706. });
  20707. });
  20708. topEl.settingEl.hidden = this.config["marginType"] != "3";
  20709. const btmEl = new import_obsidian3.Setting(contentEl).setName("Left/Right").addText((text) => {
  20710. setInputWidth(text.inputEl);
  20711. text.setPlaceholder("margin left").setValue(this.config["marginLeft"]).onChange((value) => {
  20712. this.config["marginLeft"] = value;
  20713. });
  20714. }).addText((text) => {
  20715. setInputWidth(text.inputEl);
  20716. text.setPlaceholder("margin right").setValue(this.config["marginRight"]).onChange((value) => {
  20717. this.config["marginRight"] = value;
  20718. });
  20719. });
  20720. btmEl.settingEl.hidden = this.config["marginType"] != "3";
  20721. new import_obsidian3.Setting(contentEl).setName(this.i18n.exportDialog.downscalePercent).addSlider((slider) => {
  20722. slider.setLimits(0, 100, 1).setValue(this.config["scale"]).onChange(async (value) => {
  20723. this.config["scale"] = value;
  20724. slider.showTooltip();
  20725. });
  20726. });
  20727. new import_obsidian3.Setting(contentEl).setName(this.i18n.exportDialog.landscape).addToggle(
  20728. (toggle) => toggle.setTooltip("landscape").setValue(this.config["landscape"]).onChange(async (value) => {
  20729. this.config["landscape"] = value;
  20730. })
  20731. );
  20732. new import_obsidian3.Setting(contentEl).setName(this.i18n.exportDialog.displayHeader).addToggle(
  20733. (toggle) => toggle.setTooltip("Display header").setValue(this.config["displayHeader"]).onChange(async (value) => {
  20734. this.config["displayHeader"] = value;
  20735. })
  20736. );
  20737. new import_obsidian3.Setting(contentEl).setName(this.i18n.exportDialog.displayFooter).addToggle(
  20738. (toggle) => toggle.setTooltip("Display footer").setValue(this.config["displayFooter"]).onChange(async (value) => {
  20739. this.config["displayFooter"] = value;
  20740. })
  20741. );
  20742. new import_obsidian3.Setting(contentEl).setName(this.i18n.exportDialog.openAfterExport).addToggle(
  20743. (toggle) => toggle.setTooltip("Open the exported file after exporting.").setValue(this.config["open"]).onChange(async (value) => {
  20744. this.config["open"] = value;
  20745. })
  20746. );
  20747. const snippets = this.cssSnippets();
  20748. if (Object.keys(snippets).length > 0 && this.plugin.settings.enabledCss) {
  20749. new import_obsidian3.Setting(contentEl).setName(this.i18n.exportDialog.cssSnippets).addDropdown((dropdown) => {
  20750. dropdown.addOption("0", "Not select").addOptions(snippets).setValue(this.config["cssSnippet"]).onChange(async (value) => {
  20751. this.config["cssSnippet"] = value;
  20752. await this.appendWebviews(this.previewDiv, false);
  20753. });
  20754. });
  20755. }
  20756. }
  20757. onClose() {
  20758. const { contentEl } = this;
  20759. contentEl.empty();
  20760. }
  20761. cssSnippets() {
  20762. var _a, _b;
  20763. const { snippets, enabledSnippets } = (_b = (_a = this.app) == null ? void 0 : _a.customCss) != null ? _b : {};
  20764. const basePath = this.app.vault.adapter.basePath;
  20765. return Object.fromEntries(
  20766. snippets == null ? void 0 : snippets.filter((item) => !enabledSnippets.has(item)).map((name) => {
  20767. const file = import_path.default.join(basePath, ".obsidian/snippets", name + ".css");
  20768. return [file, name];
  20769. })
  20770. );
  20771. }
  20772. };
  20773. // src/setting.ts
  20774. var import_obsidian4 = require("obsidian");
  20775. function setAttributes(element, attributes) {
  20776. for (const key in attributes) {
  20777. element.setAttribute(key, attributes[key]);
  20778. }
  20779. }
  20780. var renderBuyMeACoffeeBadge = (contentEl, width = 175) => {
  20781. const linkEl = contentEl.createEl("a", {
  20782. href: "https://www.buymeacoffee.com/l1xnan"
  20783. });
  20784. const imgEl = linkEl.createEl("img");
  20785. imgEl.src = "https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&emoji=&slug=nathangeorge&button_colour=6a8696&font_colour=ffffff&font_family=Poppins&outline_colour=000000&coffee_colour=FFDD00";
  20786. imgEl.alt = "Buy me a coffee";
  20787. imgEl.width = width;
  20788. };
  20789. var ConfigSettingTab = class extends import_obsidian4.PluginSettingTab {
  20790. constructor(app, plugin) {
  20791. super(app, plugin);
  20792. this.plugin = plugin;
  20793. this.i18n = i18n_default.current;
  20794. }
  20795. display() {
  20796. const { containerEl } = this;
  20797. containerEl.empty();
  20798. const supportDesc = new DocumentFragment();
  20799. supportDesc.createDiv({
  20800. text: "Support the continued development of this plugin."
  20801. });
  20802. new import_obsidian4.Setting(containerEl).setDesc(supportDesc);
  20803. renderBuyMeACoffeeBadge(containerEl);
  20804. new import_obsidian4.Setting(containerEl).setName(this.i18n.settings.showTitle).addToggle(
  20805. (toggle) => toggle.setTooltip(this.i18n.settings.showTitle).setValue(this.plugin.settings.showTitle).onChange(async (value) => {
  20806. this.plugin.settings.showTitle = value;
  20807. this.plugin.saveSettings();
  20808. })
  20809. );
  20810. new import_obsidian4.Setting(containerEl).setName(this.i18n.settings.displayHeader).addToggle(
  20811. (toggle) => toggle.setTooltip("Display header").setValue(this.plugin.settings.displayHeader).onChange(async (value) => {
  20812. this.plugin.settings.displayHeader = value;
  20813. this.plugin.saveSettings();
  20814. })
  20815. );
  20816. new import_obsidian4.Setting(containerEl).setName(this.i18n.settings.displayFooter).addToggle(
  20817. (toggle) => toggle.setTooltip("Display footer").setValue(this.plugin.settings.displayFooter).onChange(async (value) => {
  20818. this.plugin.settings.displayFooter = value;
  20819. this.plugin.saveSettings();
  20820. })
  20821. );
  20822. new import_obsidian4.Setting(containerEl).setName(this.i18n.settings.printBackground).setDesc("Whether to print background graphics").addToggle(
  20823. (toggle) => toggle.setValue(this.plugin.settings.printBackground).onChange(async (value) => {
  20824. this.plugin.settings.printBackground = value;
  20825. this.plugin.saveSettings();
  20826. })
  20827. );
  20828. new import_obsidian4.Setting(containerEl).setName("Generate tagged PDF").setDesc(
  20829. "Whether or not to generate a tagged (accessible) PDF. Defaults to false. As this property is experimental, the generated PDF may not adhere fully to PDF/UA and WCAG standards."
  20830. ).addToggle(
  20831. (toggle) => toggle.setValue(this.plugin.settings.generateTaggedPDF).onChange(async (value) => {
  20832. this.plugin.settings.generateTaggedPDF = value;
  20833. this.plugin.saveSettings();
  20834. })
  20835. );
  20836. new import_obsidian4.Setting(containerEl).setName(this.i18n.settings.maxLevel).addDropdown((dropdown) => {
  20837. dropdown.addOptions(Object.fromEntries(["1", "2", "3", "4", "5", "6"].map((level) => [level, `h${level}`]))).setValue(this.plugin.settings.maxLevel).onChange(async (value) => {
  20838. this.plugin.settings.maxLevel = value;
  20839. this.plugin.saveSettings();
  20840. });
  20841. });
  20842. new import_obsidian4.Setting(containerEl).setName(this.i18n.settings.displayMetadata).setDesc("Add frontMatter(title, author, keywords, subject creator, etc) to pdf metadata").addToggle(
  20843. (toggle) => toggle.setValue(this.plugin.settings.displayMetadata).onChange(async (value) => {
  20844. this.plugin.settings.displayMetadata = value;
  20845. this.plugin.saveSettings();
  20846. })
  20847. );
  20848. new import_obsidian4.Setting(containerEl).setName("Advanced").setHeading();
  20849. const headerContentAreaSetting = new import_obsidian4.Setting(containerEl);
  20850. headerContentAreaSetting.settingEl.setAttribute("style", "display: grid; grid-template-columns: 1fr;");
  20851. headerContentAreaSetting.setName(this.i18n.settings.headerTemplate).setDesc(
  20852. 'HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them: date (formatted print date), title (document title), url (document location), pageNumber (current page number) and totalPages (total pages in the document). For example, <span class="title"></span> would generate span containing the title.'
  20853. );
  20854. const hederContentArea = new import_obsidian4.TextAreaComponent(headerContentAreaSetting.controlEl);
  20855. setAttributes(hederContentArea.inputEl, {
  20856. style: "margin-top: 12px; width: 100%; height: 6vh;"
  20857. });
  20858. hederContentArea.setValue(this.plugin.settings.headerTemplate).onChange(async (value) => {
  20859. this.plugin.settings.headerTemplate = value;
  20860. this.plugin.saveSettings();
  20861. });
  20862. const footerContentAreaSetting = new import_obsidian4.Setting(containerEl);
  20863. footerContentAreaSetting.settingEl.setAttribute("style", "display: grid; grid-template-columns: 1fr;");
  20864. footerContentAreaSetting.setName(this.i18n.settings.footerTemplate).setDesc("HTML template for the print footer. Should use the same format as the headerTemplate.");
  20865. const footerContentArea = new import_obsidian4.TextAreaComponent(footerContentAreaSetting.controlEl);
  20866. setAttributes(footerContentArea.inputEl, {
  20867. style: "margin-top: 12px; width: 100%; height: 6vh;"
  20868. });
  20869. footerContentArea.setValue(this.plugin.settings.footerTemplate).onChange(async (value) => {
  20870. this.plugin.settings.footerTemplate = value;
  20871. this.plugin.saveSettings();
  20872. });
  20873. new import_obsidian4.Setting(containerEl).setName(this.i18n.settings.isTimestamp).setDesc("Add timestamp to output file name").addToggle((cb) => {
  20874. cb.setValue(this.plugin.settings.isTimestamp).onChange(async (value) => {
  20875. this.plugin.settings.isTimestamp = value;
  20876. await this.plugin.saveSettings();
  20877. });
  20878. });
  20879. new import_obsidian4.Setting(containerEl).setName(this.i18n.settings.enabledCss).setDesc("Select the css snippet that are not enabled").addToggle((cb) => {
  20880. cb.setValue(this.plugin.settings.enabledCss).onChange(async (value) => {
  20881. this.plugin.settings.enabledCss = value;
  20882. await this.plugin.saveSettings();
  20883. });
  20884. });
  20885. new import_obsidian4.Setting(containerEl).setName("Debug").setHeading();
  20886. new import_obsidian4.Setting(containerEl).setName(this.i18n.settings.debugMode).setDesc("This is useful for troubleshooting.").addToggle((cb) => {
  20887. cb.setValue(this.plugin.settings.debug).onChange(async (value) => {
  20888. this.plugin.settings.debug = value;
  20889. await this.plugin.saveSettings();
  20890. });
  20891. });
  20892. }
  20893. };
  20894. // src/main.ts
  20895. var isDev = false;
  20896. var DEFAULT_SETTINGS = {
  20897. showTitle: true,
  20898. maxLevel: "6",
  20899. displayHeader: true,
  20900. displayFooter: true,
  20901. headerTemplate: `<div style="width: 100vw;font-size:10px;text-align:center;"><span class="title"></span></div>`,
  20902. footerTemplate: `<div style="width: 100vw;font-size:10px;text-align:center;"><span class="pageNumber"></span> / <span class="totalPages"></span></div>`,
  20903. printBackground: false,
  20904. generateTaggedPDF: false,
  20905. displayMetadata: false,
  20906. debug: false,
  20907. isTimestamp: false,
  20908. enabledCss: false
  20909. };
  20910. var BetterExportPdfPlugin = class extends import_obsidian5.Plugin {
  20911. constructor(app, manifest) {
  20912. super(app, manifest);
  20913. this.i18n = i18n_default.current;
  20914. }
  20915. async onload() {
  20916. await this.loadSettings();
  20917. this.registerCommand();
  20918. this.registerSetting();
  20919. this.registerEvents();
  20920. }
  20921. registerCommand() {
  20922. this.addCommand({
  20923. id: "export-current-file-to-pdf",
  20924. name: this.i18n.exportCurrentFile,
  20925. checkCallback: (checking) => {
  20926. const view = this.app.workspace.getActiveViewOfType(import_obsidian5.MarkdownView);
  20927. const file = view == null ? void 0 : view.file;
  20928. if (!file) {
  20929. return false;
  20930. }
  20931. if (checking) {
  20932. return true;
  20933. }
  20934. new ExportConfigModal(this, file).open();
  20935. return true;
  20936. }
  20937. });
  20938. }
  20939. registerSetting() {
  20940. this.addSettingTab(new ConfigSettingTab(this.app, this));
  20941. }
  20942. registerEvents() {
  20943. this.registerEvent(
  20944. this.app.workspace.on("file-menu", (menu, file) => {
  20945. let title = file instanceof import_obsidian5.TFolder ? "Export folder to PDF" : "Better Export PDF";
  20946. if (isDev) {
  20947. title = `${title} (dev)`;
  20948. }
  20949. menu.addItem((item) => {
  20950. item.setTitle(title).setIcon("download").setSection("action").onClick(async () => {
  20951. new ExportConfigModal(this, file).open();
  20952. });
  20953. });
  20954. })
  20955. );
  20956. this.registerEvent(
  20957. this.app.workspace.on("file-menu", (menu, file) => {
  20958. if (file instanceof import_obsidian5.TFolder) {
  20959. let title = "Export each file to PDF";
  20960. if (isDev) {
  20961. title = `${title} (dev)`;
  20962. }
  20963. menu.addItem((item) => {
  20964. item.setTitle(title).setIcon("download").setSection("action").onClick(async () => {
  20965. new ExportConfigModal(this, file, true).open();
  20966. });
  20967. });
  20968. }
  20969. })
  20970. );
  20971. }
  20972. onunload() {
  20973. }
  20974. async loadSettings() {
  20975. this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData());
  20976. }
  20977. async saveSettings() {
  20978. await this.saveData(this.settings);
  20979. }
  20980. changeConfig() {
  20981. var _a;
  20982. const theme = "obsidian" === ((_a = this.app.vault) == null ? void 0 : _a.getConfig("theme"));
  20983. if (theme) {
  20984. document.body.addClass("theme-light");
  20985. document.body.removeClass("theme-dark");
  20986. }
  20987. document.body.removeClass("theme-dark");
  20988. const node = document.body.createDiv("print");
  20989. const reset = function() {
  20990. node.detach();
  20991. if (theme) {
  20992. document.body.removeClass("theme-light");
  20993. document.body.addClass("theme-dark");
  20994. }
  20995. };
  20996. node.addEventListener("click", reset);
  20997. const el = document.body.createDiv("print");
  20998. const el2 = el.createDiv("markdown-preview-view markdown-rendered");
  20999. el2.toggleClass("rtl", this.app.vault.getConfig("rightToLeft"));
  21000. el2.toggleClass("show-frontmatter", this.app.vault.getConfig("showFrontmatter"));
  21001. el2.createEl("h1", {
  21002. text: "xxxxx"
  21003. // a.basename
  21004. });
  21005. }
  21006. };
  21007. /*! Bundled license information:
  21008. tslib/tslib.es6.js:
  21009. (*! *****************************************************************************
  21010. Copyright (c) Microsoft Corporation.
  21011. Permission to use, copy, modify, and/or distribute this software for any
  21012. purpose with or without fee is hereby granted.
  21013. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  21014. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  21015. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  21016. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  21017. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  21018. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  21019. PERFORMANCE OF THIS SOFTWARE.
  21020. ***************************************************************************** *)
  21021. */