pdf.worker.mjs 2.2 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652556535565455655556565565755658556595566055661556625566355664556655566655667556685566955670556715567255673556745567555676556775567855679556805568155682556835568455685556865568755688556895569055691556925569355694556955569655697556985569955700557015570255703557045570555706557075570855709557105571155712557135571455715557165571755718557195572055721557225572355724557255572655727557285572955730557315573255733557345573555736557375573855739557405574155742557435574455745557465574755748557495575055751557525575355754557555575655757557585575955760557615576255763557645576555766557675576855769557705577155772557735577455775557765577755778557795578055781557825578355784557855578655787557885578955790557915579255793557945579555796557975579855799558005580155802558035580455805558065580755808558095581055811558125581355814558155581655817558185581955820558215582255823558245582555826558275582855829558305583155832558335583455835558365583755838558395584055841558425584355844558455584655847558485584955850558515585255853558545585555856558575585855859558605586155862558635586455865558665586755868558695587055871558725587355874558755587655877558785587955880558815588255883558845588555886558875588855889558905589155892558935589455895558965589755898558995590055901559025590355904559055590655907559085590955910559115591255913559145591555916559175591855919559205592155922559235592455925559265592755928559295593055931559325593355934559355593655937559385593955940559415594255943559445594555946559475594855949559505595155952559535595455955559565595755958559595596055961559625596355964559655596655967559685596955970559715597255973559745597555976559775597855979559805598155982559835598455985559865598755988559895599055991559925599355994559955599655997559985599956000560015600256003560045600556006560075600856009560105601156012560135601456015560165601756018560195602056021560225602356024560255602656027560285602956030560315603256033560345603556036560375603856039560405604156042560435604456045560465604756048560495605056051560525605356054560555605656057560585605956060560615606256063560645606556066560675606856069560705607156072560735607456075560765607756078560795608056081560825608356084560855608656087560885608956090560915609256093560945609556096560975609856099561005610156102561035610456105561065610756108561095611056111561125611356114561155611656117561185611956120561215612256123561245612556126561275612856129561305613156132561335613456135561365613756138561395614056141561425614356144561455614656147561485614956150561515615256153561545615556156561575615856159561605616156162561635616456165561665616756168561695617056171561725617356174561755617656177561785617956180561815618256183561845618556186561875618856189561905619156192561935619456195561965619756198561995620056201562025620356204562055620656207562085620956210562115621256213562145621556216562175621856219562205622156222562235622456225562265622756228562295623056231562325623356234562355623656237562385623956240562415624256243562445624556246562475624856249562505625156252562535625456255562565625756258562595626056261562625626356264562655626656267562685626956270562715627256273562745627556276562775627856279562805628156282562835628456285562865628756288562895629056291562925629356294562955629656297562985629956300563015630256303563045630556306563075630856309563105631156312563135631456315563165631756318563195632056321563225632356324563255632656327563285632956330563315633256333563345633556336563375633856339563405634156342563435634456345563465634756348563495635056351563525635356354563555635656357563585635956360563615636256363563645636556366563675636856369563705637156372563735637456375563765637756378563795638056381563825638356384563855638656387563885638956390563915639256393563945639556396563975639856399564005640156402564035640456405564065640756408564095641056411564125641356414564155641656417564185641956420564215642256423564245642556426564275642856429564305643156432564335643456435564365643756438564395644056441564425644356444564455644656447564485644956450564515645256453564545645556456564575645856459564605646156462564635646456465564665646756468564695647056471564725647356474564755647656477564785647956480564815648256483564845648556486564875648856489564905649156492564935649456495564965649756498564995650056501565025650356504565055650656507565085650956510565115651256513565145651556516565175651856519565205652156522565235652456525565265652756528565295653056531565325653356534565355653656537565385653956540565415654256543565445654556546565475654856549565505655156552565535655456555565565655756558565595656056561565625656356564565655656656567565685656956570565715657256573565745657556576565775657856579565805658156582565835658456585565865658756588565895659056591565925659356594565955659656597565985659956600566015660256603566045660556606566075660856609566105661156612566135661456615566165661756618566195662056621566225662356624566255662656627566285662956630566315663256633566345663556636566375663856639566405664156642566435664456645566465664756648566495665056651566525665356654566555665656657566585665956660566615666256663566645666556666566675666856669566705667156672566735667456675566765667756678566795668056681566825668356684566855668656687566885668956690566915669256693566945669556696566975669856699567005670156702567035670456705567065670756708567095671056711567125671356714567155671656717567185671956720567215672256723567245672556726567275672856729567305673156732567335673456735567365673756738567395674056741567425674356744567455674656747567485674956750567515675256753567545675556756567575675856759567605676156762567635676456765567665676756768567695677056771567725677356774567755677656777567785677956780567815678256783567845678556786567875678856789567905679156792567935679456795567965679756798567995680056801568025680356804568055680656807568085680956810568115681256813568145681556816568175681856819568205682156822568235682456825568265682756828568295683056831568325683356834568355683656837568385683956840568415684256843568445684556846568475684856849568505685156852568535685456855568565685756858568595686056861568625686356864568655686656867568685686956870568715687256873568745687556876568775687856879568805688156882568835688456885568865688756888568895689056891568925689356894568955689656897568985689956900569015690256903569045690556906569075690856909569105691156912569135691456915569165691756918569195692056921569225692356924569255692656927569285692956930569315693256933569345693556936569375693856939569405694156942569435694456945569465694756948569495695056951569525695356954569555695656957569585695956960569615696256963569645696556966569675696856969569705697156972569735697456975569765697756978569795698056981569825698356984569855698656987569885698956990569915699256993569945699556996569975699856999570005700157002570035700457005570065700757008570095701057011570125701357014570155701657017570185701957020570215702257023570245702557026570275702857029570305703157032570335703457035570365703757038570395704057041570425704357044570455704657047570485704957050570515705257053570545705557056570575705857059570605706157062570635706457065570665706757068570695707057071570725707357074570755707657077570785707957080570815708257083570845708557086570875708857089570905709157092570935709457095570965709757098570995710057101571025710357104571055710657107571085710957110571115711257113571145711557116571175711857119571205712157122571235712457125571265712757128571295713057131571325713357134571355713657137571385713957140571415714257143571445714557146571475714857149571505715157152571535715457155571565715757158571595716057161571625716357164571655716657167571685716957170571715717257173571745717557176571775717857179571805718157182571835718457185571865718757188571895719057191571925719357194571955719657197571985719957200572015720257203572045720557206572075720857209572105721157212572135721457215572165721757218572195722057221572225722357224572255722657227572285722957230572315723257233572345723557236572375723857239572405724157242572435724457245572465724757248572495725057251572525725357254572555725657257572585725957260572615726257263572645726557266572675726857269572705727157272572735727457275572765727757278572795728057281572825728357284572855728657287572885728957290572915729257293572945729557296572975729857299573005730157302573035730457305573065730757308573095731057311573125731357314573155731657317573185731957320573215732257323573245732557326573275732857329573305733157332573335733457335573365733757338573395734057341573425734357344573455734657347573485734957350573515735257353573545735557356573575735857359573605736157362573635736457365573665736757368573695737057371573725737357374573755737657377573785737957380573815738257383573845738557386573875738857389573905739157392573935739457395573965739757398573995740057401574025740357404574055740657407574085740957410574115741257413574145741557416574175741857419574205742157422574235742457425574265742757428574295743057431574325743357434574355743657437574385743957440574415744257443574445744557446574475744857449574505745157452574535745457455574565745757458574595746057461574625746357464574655746657467574685746957470574715747257473574745747557476574775747857479574805748157482574835748457485574865748757488574895749057491574925749357494574955749657497574985749957500575015750257503575045750557506575075750857509575105751157512575135751457515575165751757518575195752057521575225752357524575255752657527575285752957530575315753257533575345753557536575375753857539575405754157542575435754457545575465754757548575495755057551575525755357554575555755657557575585755957560575615756257563575645756557566575675756857569575705757157572575735757457575575765757757578575795758057581575825758357584575855758657587575885758957590575915759257593575945759557596575975759857599576005760157602576035760457605576065760757608576095761057611576125761357614576155761657617576185761957620576215762257623576245762557626576275762857629576305763157632576335763457635576365763757638576395764057641576425764357644576455764657647576485764957650576515765257653576545765557656576575765857659576605766157662576635766457665576665766757668576695767057671576725767357674576755767657677576785767957680576815768257683576845768557686576875768857689576905769157692576935769457695576965769757698576995770057701577025770357704577055770657707577085770957710577115771257713577145771557716577175771857719577205772157722577235772457725577265772757728577295773057731577325773357734577355773657737577385773957740577415774257743577445774557746577475774857749577505775157752577535775457755577565775757758577595776057761577625776357764577655776657767577685776957770577715777257773577745777557776577775777857779577805778157782577835778457785577865778757788577895779057791577925779357794577955779657797577985779957800578015780257803578045780557806578075780857809578105781157812578135781457815578165781757818578195782057821578225782357824578255782657827578285782957830578315783257833578345783557836578375783857839578405784157842578435784457845578465784757848578495785057851578525785357854578555785657857578585785957860578615786257863578645786557866578675786857869578705787157872578735787457875578765787757878578795788057881578825788357884578855788657887578885788957890578915789257893578945789557896578975789857899579005790157902579035790457905579065790757908579095791057911579125791357914579155791657917579185791957920579215792257923579245792557926579275792857929579305793157932579335793457935579365793757938579395794057941579425794357944579455794657947579485794957950579515795257953579545795557956579575795857959579605796157962579635796457965579665796757968579695797057971579725797357974579755797657977579785797957980579815798257983579845798557986579875798857989579905799157992579935799457995579965799757998579995800058001580025800358004580055800658007580085800958010580115801258013580145801558016580175801858019580205802158022580235802458025580265802758028580295803058031580325803358034580355803658037580385803958040580415804258043580445804558046580475804858049580505805158052580535805458055580565805758058580595806058061580625806358064580655806658067580685806958070580715807258073580745807558076580775807858079580805808158082580835808458085580865808758088580895809058091580925809358094580955809658097580985809958100581015810258103581045810558106581075810858109581105811158112581135811458115581165811758118581195812058121581225812358124581255812658127581285812958130581315813258133581345813558136581375813858139581405814158142581435814458145581465814758148581495815058151581525815358154581555815658157581585815958160581615816258163581645816558166581675816858169581705817158172581735817458175581765817758178581795818058181581825818358184581855818658187581885818958190581915819258193581945819558196581975819858199582005820158202582035820458205582065820758208582095821058211582125821358214582155821658217582185821958220582215822258223582245822558226582275822858229582305823158232582335823458235582365823758238582395824058241582425824358244582455824658247582485824958250582515825258253582545825558256582575825858259582605826158262582635826458265582665826758268582695827058271582725827358274582755827658277582785827958280582815828258283582845828558286582875828858289582905829158292582935829458295582965829758298582995830058301583025830358304583055830658307583085830958310583115831258313583145831558316583175831858319583205832158322583235832458325583265832758328583295833058331583325833358334583355833658337583385833958340583415834258343583445834558346583475834858349583505835158352583535835458355583565835758358583595836058361583625836358364583655836658367583685836958370583715837258373583745837558376583775837858379583805838158382583835838458385583865838758388583895839058391583925839358394583955839658397583985839958400584015840258403584045840558406584075840858409584105841158412584135841458415584165841758418584195842058421584225842358424584255842658427584285842958430584315843258433584345843558436584375843858439584405844158442584435844458445584465844758448584495845058451584525845358454584555845658457584585845958460584615846258463584645846558466584675846858469584705847158472584735847458475584765847758478584795848058481584825848358484584855848658487584885848958490584915849258493584945849558496584975849858499585005850158502585035850458505585065850758508585095851058511585125851358514585155851658517585185851958520585215852258523585245852558526585275852858529585305853158532585335853458535585365853758538585395854058541585425854358544585455854658547585485854958550585515855258553585545855558556585575855858559585605856158562585635856458565585665856758568585695857058571585725857358574585755857658577585785857958580585815858258583585845858558586585875858858589585905859158592585935859458595585965859758598585995860058601586025860358604586055860658607586085860958610586115861258613586145861558616586175861858619586205862158622586235862458625586265862758628586295863058631586325863358634586355863658637586385863958640586415864258643586445864558646586475864858649586505865158652586535865458655586565865758658586595866058661586625866358664586655866658667586685866958670586715867258673586745867558676586775867858679586805868158682586835868458685586865868758688586895869058691586925869358694586955869658697586985869958700587015870258703587045870558706587075870858709587105871158712587135871458715587165871758718587195872058721587225872358724587255872658727587285872958730587315873258733587345873558736587375873858739587405874158742587435874458745587465874758748587495875058751587525875358754587555875658757587585875958760587615876258763587645876558766587675876858769587705877158772587735877458775587765877758778587795878058781587825878358784587855878658787587885878958790587915879258793587945879558796587975879858799588005880158802588035880458805588065880758808588095881058811588125881358814588155881658817588185881958820588215882258823588245882558826588275882858829588305883158832588335883458835588365883758838588395884058841588425884358844588455884658847588485884958850588515885258853588545885558856588575885858859588605886158862588635886458865588665886758868588695887058871588725887358874588755887658877588785887958880588815888258883588845888558886588875888858889588905889158892588935889458895588965889758898588995890058901589025890358904589055890658907589085890958910589115891258913589145891558916589175891858919589205892158922589235892458925589265892758928589295893058931589325893358934589355893658937589385893958940589415894258943589445894558946589475894858949589505895158952589535895458955589565895758958589595896058961589625896358964589655896658967589685896958970589715897258973589745897558976589775897858979589805898158982589835898458985589865898758988589895899058991589925899358994589955899658997589985899959000590015900259003590045900559006590075900859009590105901159012590135901459015590165901759018590195902059021590225902359024590255902659027590285902959030590315903259033590345903559036590375903859039590405904159042590435904459045590465904759048590495905059051590525905359054590555905659057590585905959060590615906259063590645906559066590675906859069590705907159072590735907459075590765907759078590795908059081590825908359084590855908659087590885908959090590915909259093590945909559096590975909859099591005910159102591035910459105591065910759108591095911059111591125911359114591155911659117591185911959120591215912259123591245912559126591275912859129591305913159132591335913459135591365913759138591395914059141591425914359144591455914659147591485914959150591515915259153591545915559156591575915859159591605916159162591635916459165591665916759168591695917059171591725917359174591755917659177591785917959180591815918259183591845918559186591875918859189591905919159192591935919459195591965919759198591995920059201592025920359204592055920659207592085920959210592115921259213592145921559216592175921859219592205922159222592235922459225592265922759228592295923059231592325923359234592355923659237592385923959240592415924259243592445924559246592475924859249592505925159252592535925459255592565925759258592595926059261592625926359264592655926659267592685926959270592715927259273592745927559276592775927859279592805928159282592835928459285592865928759288592895929059291592925929359294592955929659297592985929959300593015930259303593045930559306593075930859309593105931159312593135931459315593165931759318593195932059321593225932359324593255932659327593285932959330593315933259333593345933559336593375933859339593405934159342593435934459345593465934759348593495935059351593525935359354593555935659357593585935959360593615936259363593645936559366593675936859369593705937159372593735937459375593765937759378593795938059381593825938359384593855938659387593885938959390593915939259393593945939559396593975939859399594005940159402594035940459405594065940759408594095941059411594125941359414594155941659417594185941959420594215942259423594245942559426594275942859429594305943159432594335943459435594365943759438594395944059441594425944359444594455944659447594485944959450594515945259453594545945559456594575945859459594605946159462594635946459465594665946759468594695947059471594725947359474594755947659477594785947959480594815948259483594845948559486594875948859489594905949159492594935949459495594965949759498594995950059501595025950359504595055950659507595085950959510595115951259513595145951559516595175951859519595205952159522595235952459525595265952759528595295953059531595325953359534595355953659537595385953959540595415954259543595445954559546595475954859549595505955159552595535955459555595565955759558595595956059561595625956359564595655956659567595685956959570595715957259573595745957559576595775957859579595805958159582595835958459585595865958759588595895959059591595925959359594595955959659597595985959959600596015960259603596045960559606596075960859609596105961159612596135961459615596165961759618596195962059621596225962359624596255962659627596285962959630596315963259633596345963559636596375963859639596405964159642596435964459645596465964759648596495965059651596525965359654596555965659657596585965959660596615966259663596645966559666596675966859669596705967159672596735967459675596765967759678596795968059681596825968359684596855968659687596885968959690596915969259693596945969559696596975969859699597005970159702597035970459705597065970759708597095971059711597125971359714597155971659717597185971959720597215972259723597245972559726597275972859729597305973159732597335973459735597365973759738597395974059741597425974359744597455974659747597485974959750597515975259753597545975559756597575975859759597605976159762597635976459765597665976759768597695977059771597725977359774597755977659777597785977959780597815978259783597845978559786597875978859789597905979159792597935979459795597965979759798597995980059801598025980359804598055980659807598085980959810598115981259813598145981559816598175981859819598205982159822598235982459825598265982759828598295983059831598325983359834598355983659837598385983959840598415984259843598445984559846598475984859849598505985159852598535985459855598565985759858598595986059861598625986359864598655986659867598685986959870598715987259873598745987559876598775987859879598805988159882598835988459885598865988759888598895989059891598925989359894598955989659897598985989959900599015990259903599045990559906599075990859909599105991159912599135991459915599165991759918599195992059921599225992359924599255992659927599285992959930599315993259933599345993559936599375993859939599405994159942599435994459945599465994759948599495995059951599525995359954599555995659957599585995959960599615996259963599645996559966599675996859969599705997159972599735997459975599765997759978599795998059981599825998359984599855998659987599885998959990599915999259993599945999559996599975999859999600006000160002600036000460005600066000760008600096001060011600126001360014600156001660017600186001960020600216002260023600246002560026600276002860029600306003160032600336003460035600366003760038600396004060041600426004360044600456004660047600486004960050600516005260053600546005560056600576005860059600606006160062600636006460065600666006760068600696007060071600726007360074600756007660077600786007960080600816008260083600846008560086600876008860089600906009160092600936009460095600966009760098600996010060101601026010360104601056010660107601086010960110601116011260113601146011560116601176011860119601206012160122601236012460125601266012760128601296013060131601326013360134601356013660137601386013960140601416014260143601446014560146601476014860149601506015160152601536015460155601566015760158601596016060161601626016360164601656016660167601686016960170601716017260173601746017560176601776017860179601806018160182601836018460185601866018760188601896019060191601926019360194601956019660197601986019960200602016020260203602046020560206602076020860209602106021160212602136021460215602166021760218602196022060221602226022360224602256022660227602286022960230602316023260233602346023560236602376023860239602406024160242602436024460245602466024760248602496025060251602526025360254602556025660257602586025960260602616026260263602646026560266602676026860269602706027160272602736027460275602766027760278602796028060281602826028360284602856028660287602886028960290602916029260293602946029560296602976029860299603006030160302603036030460305603066030760308603096031060311603126031360314603156031660317603186031960320603216032260323603246032560326603276032860329603306033160332603336033460335603366033760338603396034060341603426034360344603456034660347603486034960350603516035260353603546035560356603576035860359603606036160362603636036460365603666036760368603696037060371603726037360374603756037660377603786037960380603816038260383603846038560386603876038860389603906039160392603936039460395603966039760398603996040060401604026040360404604056040660407604086040960410604116041260413604146041560416604176041860419604206042160422604236042460425604266042760428604296043060431604326043360434604356043660437604386043960440604416044260443604446044560446604476044860449604506045160452604536045460455604566045760458604596046060461604626046360464604656046660467604686046960470604716047260473604746047560476604776047860479604806048160482604836048460485604866048760488604896049060491604926049360494604956049660497604986049960500605016050260503605046050560506605076050860509605106051160512605136051460515605166051760518605196052060521605226052360524605256052660527605286052960530605316053260533605346053560536605376053860539605406054160542605436054460545605466054760548605496055060551605526055360554605556055660557605586055960560605616056260563605646056560566605676056860569605706057160572605736057460575605766057760578605796058060581605826058360584605856058660587605886058960590605916059260593605946059560596605976059860599606006060160602606036060460605606066060760608606096061060611606126061360614606156061660617606186061960620606216062260623606246062560626606276062860629606306063160632606336063460635606366063760638606396064060641606426064360644606456064660647606486064960650606516065260653606546065560656606576065860659606606066160662606636066460665606666066760668606696067060671606726067360674606756067660677606786067960680606816068260683606846068560686606876068860689606906069160692606936069460695606966069760698606996070060701607026070360704607056070660707607086070960710607116071260713607146071560716607176071860719607206072160722607236072460725607266072760728607296073060731607326073360734607356073660737607386073960740607416074260743607446074560746607476074860749607506075160752607536075460755607566075760758607596076060761607626076360764607656076660767607686076960770607716077260773607746077560776607776077860779607806078160782607836078460785607866078760788607896079060791607926079360794607956079660797607986079960800608016080260803608046080560806608076080860809608106081160812608136081460815608166081760818608196082060821608226082360824608256082660827608286082960830608316083260833608346083560836608376083860839608406084160842608436084460845608466084760848608496085060851608526085360854608556085660857608586085960860608616086260863608646086560866608676086860869608706087160872608736087460875608766087760878608796088060881608826088360884608856088660887608886088960890608916089260893608946089560896608976089860899609006090160902609036090460905609066090760908609096091060911609126091360914609156091660917609186091960920609216092260923609246092560926609276092860929609306093160932609336093460935609366093760938609396094060941609426094360944609456094660947609486094960950609516095260953609546095560956609576095860959609606096160962609636096460965609666096760968609696097060971609726097360974609756097660977609786097960980609816098260983609846098560986609876098860989609906099160992609936099460995609966099760998609996100061001610026100361004610056100661007610086100961010610116101261013610146101561016610176101861019610206102161022610236102461025610266102761028610296103061031610326103361034610356103661037610386103961040610416104261043610446104561046610476104861049610506105161052610536105461055610566105761058610596106061061610626106361064610656106661067610686106961070610716107261073610746107561076610776107861079610806108161082610836108461085610866108761088610896109061091610926109361094610956109661097610986109961100611016110261103611046110561106611076110861109611106111161112611136111461115611166111761118611196112061121611226112361124611256112661127611286112961130611316113261133611346113561136611376113861139611406114161142611436114461145611466114761148611496115061151611526115361154611556115661157611586115961160611616116261163611646116561166611676116861169611706117161172611736117461175611766117761178611796118061181611826118361184611856118661187611886118961190611916119261193611946119561196611976119861199612006120161202612036120461205612066120761208612096121061211612126121361214612156121661217612186121961220612216122261223612246122561226612276122861229612306123161232612336123461235612366123761238612396124061241612426124361244612456124661247612486124961250612516125261253612546125561256612576125861259612606126161262612636126461265612666126761268612696127061271612726127361274612756127661277612786127961280612816128261283612846128561286612876128861289612906129161292612936129461295612966129761298612996130061301613026130361304613056130661307613086130961310613116131261313613146131561316613176131861319613206132161322613236132461325613266132761328613296133061331613326133361334613356133661337613386133961340613416134261343613446134561346613476134861349613506135161352613536135461355613566135761358613596136061361613626136361364613656136661367613686136961370613716137261373613746137561376613776137861379613806138161382613836138461385613866138761388613896139061391613926139361394613956139661397613986139961400614016140261403614046140561406614076140861409614106141161412614136141461415614166141761418614196142061421614226142361424614256142661427614286142961430614316143261433614346143561436614376143861439614406144161442614436144461445614466144761448614496145061451614526145361454614556145661457614586145961460614616146261463614646146561466614676146861469614706147161472614736147461475614766147761478614796148061481614826148361484614856148661487614886148961490614916149261493614946149561496614976149861499615006150161502615036150461505615066150761508615096151061511615126151361514615156151661517615186151961520615216152261523615246152561526615276152861529615306153161532615336153461535615366153761538615396154061541615426154361544615456154661547615486154961550615516155261553615546155561556615576155861559615606156161562615636156461565615666156761568615696157061571615726157361574615756157661577615786157961580615816158261583615846158561586615876158861589615906159161592615936159461595615966159761598615996160061601616026160361604616056160661607616086160961610616116161261613616146161561616616176161861619616206162161622616236162461625616266162761628616296163061631616326163361634616356163661637616386163961640616416164261643616446164561646616476164861649
  1. /**
  2. * @licstart The following is the entire license notice for the
  3. * JavaScript code in this page
  4. *
  5. * Copyright 2024 Mozilla Foundation
  6. *
  7. * Licensed under the Apache License, Version 2.0 (the "License");
  8. * you may not use this file except in compliance with the License.
  9. * You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS,
  15. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. * See the License for the specific language governing permissions and
  17. * limitations under the License.
  18. *
  19. * @licend The above is the entire license notice for the
  20. * JavaScript code in this page
  21. */
  22. /******/ var __webpack_modules__ = ({
  23. /***/ 9306:
  24. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  25. var isCallable = __webpack_require__(4901);
  26. var tryToString = __webpack_require__(6823);
  27. var $TypeError = TypeError;
  28. // `Assert: IsCallable(argument) is true`
  29. module.exports = function (argument) {
  30. if (isCallable(argument)) return argument;
  31. throw new $TypeError(tryToString(argument) + ' is not a function');
  32. };
  33. /***/ }),
  34. /***/ 3506:
  35. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  36. var isPossiblePrototype = __webpack_require__(3925);
  37. var $String = String;
  38. var $TypeError = TypeError;
  39. module.exports = function (argument) {
  40. if (isPossiblePrototype(argument)) return argument;
  41. throw new $TypeError("Can't set " + $String(argument) + ' as a prototype');
  42. };
  43. /***/ }),
  44. /***/ 7080:
  45. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  46. var has = (__webpack_require__(4402).has);
  47. // Perform ? RequireInternalSlot(M, [[SetData]])
  48. module.exports = function (it) {
  49. has(it);
  50. return it;
  51. };
  52. /***/ }),
  53. /***/ 679:
  54. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  55. var isPrototypeOf = __webpack_require__(1625);
  56. var $TypeError = TypeError;
  57. module.exports = function (it, Prototype) {
  58. if (isPrototypeOf(Prototype, it)) return it;
  59. throw new $TypeError('Incorrect invocation');
  60. };
  61. /***/ }),
  62. /***/ 8551:
  63. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  64. var isObject = __webpack_require__(34);
  65. var $String = String;
  66. var $TypeError = TypeError;
  67. // `Assert: Type(argument) is Object`
  68. module.exports = function (argument) {
  69. if (isObject(argument)) return argument;
  70. throw new $TypeError($String(argument) + ' is not an object');
  71. };
  72. /***/ }),
  73. /***/ 7811:
  74. /***/ ((module) => {
  75. // eslint-disable-next-line es/no-typed-arrays -- safe
  76. module.exports = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined';
  77. /***/ }),
  78. /***/ 7394:
  79. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  80. var globalThis = __webpack_require__(4576);
  81. var uncurryThisAccessor = __webpack_require__(6706);
  82. var classof = __webpack_require__(2195);
  83. var ArrayBuffer = globalThis.ArrayBuffer;
  84. var TypeError = globalThis.TypeError;
  85. // Includes
  86. // - Perform ? RequireInternalSlot(O, [[ArrayBufferData]]).
  87. // - If IsSharedArrayBuffer(O) is true, throw a TypeError exception.
  88. module.exports = ArrayBuffer && uncurryThisAccessor(ArrayBuffer.prototype, 'byteLength', 'get') || function (O) {
  89. if (classof(O) !== 'ArrayBuffer') throw new TypeError('ArrayBuffer expected');
  90. return O.byteLength;
  91. };
  92. /***/ }),
  93. /***/ 3238:
  94. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  95. var globalThis = __webpack_require__(4576);
  96. var uncurryThis = __webpack_require__(7476);
  97. var arrayBufferByteLength = __webpack_require__(7394);
  98. var ArrayBuffer = globalThis.ArrayBuffer;
  99. var ArrayBufferPrototype = ArrayBuffer && ArrayBuffer.prototype;
  100. var slice = ArrayBufferPrototype && uncurryThis(ArrayBufferPrototype.slice);
  101. module.exports = function (O) {
  102. if (arrayBufferByteLength(O) !== 0) return false;
  103. if (!slice) return false;
  104. try {
  105. slice(O, 0, 0);
  106. return false;
  107. } catch (error) {
  108. return true;
  109. }
  110. };
  111. /***/ }),
  112. /***/ 5169:
  113. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  114. var isDetached = __webpack_require__(3238);
  115. var $TypeError = TypeError;
  116. module.exports = function (it) {
  117. if (isDetached(it)) throw new $TypeError('ArrayBuffer is detached');
  118. return it;
  119. };
  120. /***/ }),
  121. /***/ 5636:
  122. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  123. var globalThis = __webpack_require__(4576);
  124. var uncurryThis = __webpack_require__(9504);
  125. var uncurryThisAccessor = __webpack_require__(6706);
  126. var toIndex = __webpack_require__(7696);
  127. var notDetached = __webpack_require__(5169);
  128. var arrayBufferByteLength = __webpack_require__(7394);
  129. var detachTransferable = __webpack_require__(4483);
  130. var PROPER_STRUCTURED_CLONE_TRANSFER = __webpack_require__(1548);
  131. var structuredClone = globalThis.structuredClone;
  132. var ArrayBuffer = globalThis.ArrayBuffer;
  133. var DataView = globalThis.DataView;
  134. var min = Math.min;
  135. var ArrayBufferPrototype = ArrayBuffer.prototype;
  136. var DataViewPrototype = DataView.prototype;
  137. var slice = uncurryThis(ArrayBufferPrototype.slice);
  138. var isResizable = uncurryThisAccessor(ArrayBufferPrototype, 'resizable', 'get');
  139. var maxByteLength = uncurryThisAccessor(ArrayBufferPrototype, 'maxByteLength', 'get');
  140. var getInt8 = uncurryThis(DataViewPrototype.getInt8);
  141. var setInt8 = uncurryThis(DataViewPrototype.setInt8);
  142. module.exports = (PROPER_STRUCTURED_CLONE_TRANSFER || detachTransferable) && function (arrayBuffer, newLength, preserveResizability) {
  143. var byteLength = arrayBufferByteLength(arrayBuffer);
  144. var newByteLength = newLength === undefined ? byteLength : toIndex(newLength);
  145. var fixedLength = !isResizable || !isResizable(arrayBuffer);
  146. var newBuffer;
  147. notDetached(arrayBuffer);
  148. if (PROPER_STRUCTURED_CLONE_TRANSFER) {
  149. arrayBuffer = structuredClone(arrayBuffer, { transfer: [arrayBuffer] });
  150. if (byteLength === newByteLength && (preserveResizability || fixedLength)) return arrayBuffer;
  151. }
  152. if (byteLength >= newByteLength && (!preserveResizability || fixedLength)) {
  153. newBuffer = slice(arrayBuffer, 0, newByteLength);
  154. } else {
  155. var options = preserveResizability && !fixedLength && maxByteLength ? { maxByteLength: maxByteLength(arrayBuffer) } : undefined;
  156. newBuffer = new ArrayBuffer(newByteLength, options);
  157. var a = new DataView(arrayBuffer);
  158. var b = new DataView(newBuffer);
  159. var copyLength = min(newByteLength, byteLength);
  160. for (var i = 0; i < copyLength; i++) setInt8(b, i, getInt8(a, i));
  161. }
  162. if (!PROPER_STRUCTURED_CLONE_TRANSFER) detachTransferable(arrayBuffer);
  163. return newBuffer;
  164. };
  165. /***/ }),
  166. /***/ 4644:
  167. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  168. var NATIVE_ARRAY_BUFFER = __webpack_require__(7811);
  169. var DESCRIPTORS = __webpack_require__(3724);
  170. var globalThis = __webpack_require__(4576);
  171. var isCallable = __webpack_require__(4901);
  172. var isObject = __webpack_require__(34);
  173. var hasOwn = __webpack_require__(9297);
  174. var classof = __webpack_require__(6955);
  175. var tryToString = __webpack_require__(6823);
  176. var createNonEnumerableProperty = __webpack_require__(6699);
  177. var defineBuiltIn = __webpack_require__(6840);
  178. var defineBuiltInAccessor = __webpack_require__(2106);
  179. var isPrototypeOf = __webpack_require__(1625);
  180. var getPrototypeOf = __webpack_require__(2787);
  181. var setPrototypeOf = __webpack_require__(2967);
  182. var wellKnownSymbol = __webpack_require__(8227);
  183. var uid = __webpack_require__(3392);
  184. var InternalStateModule = __webpack_require__(1181);
  185. var enforceInternalState = InternalStateModule.enforce;
  186. var getInternalState = InternalStateModule.get;
  187. var Int8Array = globalThis.Int8Array;
  188. var Int8ArrayPrototype = Int8Array && Int8Array.prototype;
  189. var Uint8ClampedArray = globalThis.Uint8ClampedArray;
  190. var Uint8ClampedArrayPrototype = Uint8ClampedArray && Uint8ClampedArray.prototype;
  191. var TypedArray = Int8Array && getPrototypeOf(Int8Array);
  192. var TypedArrayPrototype = Int8ArrayPrototype && getPrototypeOf(Int8ArrayPrototype);
  193. var ObjectPrototype = Object.prototype;
  194. var TypeError = globalThis.TypeError;
  195. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  196. var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG');
  197. var TYPED_ARRAY_CONSTRUCTOR = 'TypedArrayConstructor';
  198. // Fixing native typed arrays in Opera Presto crashes the browser, see #595
  199. var NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(globalThis.opera) !== 'Opera';
  200. var TYPED_ARRAY_TAG_REQUIRED = false;
  201. var NAME, Constructor, Prototype;
  202. var TypedArrayConstructorsList = {
  203. Int8Array: 1,
  204. Uint8Array: 1,
  205. Uint8ClampedArray: 1,
  206. Int16Array: 2,
  207. Uint16Array: 2,
  208. Int32Array: 4,
  209. Uint32Array: 4,
  210. Float32Array: 4,
  211. Float64Array: 8
  212. };
  213. var BigIntArrayConstructorsList = {
  214. BigInt64Array: 8,
  215. BigUint64Array: 8
  216. };
  217. var isView = function isView(it) {
  218. if (!isObject(it)) return false;
  219. var klass = classof(it);
  220. return klass === 'DataView'
  221. || hasOwn(TypedArrayConstructorsList, klass)
  222. || hasOwn(BigIntArrayConstructorsList, klass);
  223. };
  224. var getTypedArrayConstructor = function (it) {
  225. var proto = getPrototypeOf(it);
  226. if (!isObject(proto)) return;
  227. var state = getInternalState(proto);
  228. return (state && hasOwn(state, TYPED_ARRAY_CONSTRUCTOR)) ? state[TYPED_ARRAY_CONSTRUCTOR] : getTypedArrayConstructor(proto);
  229. };
  230. var isTypedArray = function (it) {
  231. if (!isObject(it)) return false;
  232. var klass = classof(it);
  233. return hasOwn(TypedArrayConstructorsList, klass)
  234. || hasOwn(BigIntArrayConstructorsList, klass);
  235. };
  236. var aTypedArray = function (it) {
  237. if (isTypedArray(it)) return it;
  238. throw new TypeError('Target is not a typed array');
  239. };
  240. var aTypedArrayConstructor = function (C) {
  241. if (isCallable(C) && (!setPrototypeOf || isPrototypeOf(TypedArray, C))) return C;
  242. throw new TypeError(tryToString(C) + ' is not a typed array constructor');
  243. };
  244. var exportTypedArrayMethod = function (KEY, property, forced, options) {
  245. if (!DESCRIPTORS) return;
  246. if (forced) for (var ARRAY in TypedArrayConstructorsList) {
  247. var TypedArrayConstructor = globalThis[ARRAY];
  248. if (TypedArrayConstructor && hasOwn(TypedArrayConstructor.prototype, KEY)) try {
  249. delete TypedArrayConstructor.prototype[KEY];
  250. } catch (error) {
  251. // old WebKit bug - some methods are non-configurable
  252. try {
  253. TypedArrayConstructor.prototype[KEY] = property;
  254. } catch (error2) { /* empty */ }
  255. }
  256. }
  257. if (!TypedArrayPrototype[KEY] || forced) {
  258. defineBuiltIn(TypedArrayPrototype, KEY, forced ? property
  259. : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property, options);
  260. }
  261. };
  262. var exportTypedArrayStaticMethod = function (KEY, property, forced) {
  263. var ARRAY, TypedArrayConstructor;
  264. if (!DESCRIPTORS) return;
  265. if (setPrototypeOf) {
  266. if (forced) for (ARRAY in TypedArrayConstructorsList) {
  267. TypedArrayConstructor = globalThis[ARRAY];
  268. if (TypedArrayConstructor && hasOwn(TypedArrayConstructor, KEY)) try {
  269. delete TypedArrayConstructor[KEY];
  270. } catch (error) { /* empty */ }
  271. }
  272. if (!TypedArray[KEY] || forced) {
  273. // V8 ~ Chrome 49-50 `%TypedArray%` methods are non-writable non-configurable
  274. try {
  275. return defineBuiltIn(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && TypedArray[KEY] || property);
  276. } catch (error) { /* empty */ }
  277. } else return;
  278. }
  279. for (ARRAY in TypedArrayConstructorsList) {
  280. TypedArrayConstructor = globalThis[ARRAY];
  281. if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) {
  282. defineBuiltIn(TypedArrayConstructor, KEY, property);
  283. }
  284. }
  285. };
  286. for (NAME in TypedArrayConstructorsList) {
  287. Constructor = globalThis[NAME];
  288. Prototype = Constructor && Constructor.prototype;
  289. if (Prototype) enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor;
  290. else NATIVE_ARRAY_BUFFER_VIEWS = false;
  291. }
  292. for (NAME in BigIntArrayConstructorsList) {
  293. Constructor = globalThis[NAME];
  294. Prototype = Constructor && Constructor.prototype;
  295. if (Prototype) enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor;
  296. }
  297. // WebKit bug - typed arrays constructors prototype is Object.prototype
  298. if (!NATIVE_ARRAY_BUFFER_VIEWS || !isCallable(TypedArray) || TypedArray === Function.prototype) {
  299. // eslint-disable-next-line no-shadow -- safe
  300. TypedArray = function TypedArray() {
  301. throw new TypeError('Incorrect invocation');
  302. };
  303. if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {
  304. if (globalThis[NAME]) setPrototypeOf(globalThis[NAME], TypedArray);
  305. }
  306. }
  307. if (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) {
  308. TypedArrayPrototype = TypedArray.prototype;
  309. if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {
  310. if (globalThis[NAME]) setPrototypeOf(globalThis[NAME].prototype, TypedArrayPrototype);
  311. }
  312. }
  313. // WebKit bug - one more object in Uint8ClampedArray prototype chain
  314. if (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) {
  315. setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype);
  316. }
  317. if (DESCRIPTORS && !hasOwn(TypedArrayPrototype, TO_STRING_TAG)) {
  318. TYPED_ARRAY_TAG_REQUIRED = true;
  319. defineBuiltInAccessor(TypedArrayPrototype, TO_STRING_TAG, {
  320. configurable: true,
  321. get: function () {
  322. return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined;
  323. }
  324. });
  325. for (NAME in TypedArrayConstructorsList) if (globalThis[NAME]) {
  326. createNonEnumerableProperty(globalThis[NAME], TYPED_ARRAY_TAG, NAME);
  327. }
  328. }
  329. module.exports = {
  330. NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS,
  331. TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQUIRED && TYPED_ARRAY_TAG,
  332. aTypedArray: aTypedArray,
  333. aTypedArrayConstructor: aTypedArrayConstructor,
  334. exportTypedArrayMethod: exportTypedArrayMethod,
  335. exportTypedArrayStaticMethod: exportTypedArrayStaticMethod,
  336. getTypedArrayConstructor: getTypedArrayConstructor,
  337. isView: isView,
  338. isTypedArray: isTypedArray,
  339. TypedArray: TypedArray,
  340. TypedArrayPrototype: TypedArrayPrototype
  341. };
  342. /***/ }),
  343. /***/ 5370:
  344. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  345. var lengthOfArrayLike = __webpack_require__(6198);
  346. module.exports = function (Constructor, list, $length) {
  347. var index = 0;
  348. var length = arguments.length > 2 ? $length : lengthOfArrayLike(list);
  349. var result = new Constructor(length);
  350. while (length > index) result[index] = list[index++];
  351. return result;
  352. };
  353. /***/ }),
  354. /***/ 9617:
  355. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  356. var toIndexedObject = __webpack_require__(5397);
  357. var toAbsoluteIndex = __webpack_require__(5610);
  358. var lengthOfArrayLike = __webpack_require__(6198);
  359. // `Array.prototype.{ indexOf, includes }` methods implementation
  360. var createMethod = function (IS_INCLUDES) {
  361. return function ($this, el, fromIndex) {
  362. var O = toIndexedObject($this);
  363. var length = lengthOfArrayLike(O);
  364. if (length === 0) return !IS_INCLUDES && -1;
  365. var index = toAbsoluteIndex(fromIndex, length);
  366. var value;
  367. // Array#includes uses SameValueZero equality algorithm
  368. // eslint-disable-next-line no-self-compare -- NaN check
  369. if (IS_INCLUDES && el !== el) while (length > index) {
  370. value = O[index++];
  371. // eslint-disable-next-line no-self-compare -- NaN check
  372. if (value !== value) return true;
  373. // Array#indexOf ignores holes, Array#includes - not
  374. } else for (;length > index; index++) {
  375. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  376. } return !IS_INCLUDES && -1;
  377. };
  378. };
  379. module.exports = {
  380. // `Array.prototype.includes` method
  381. // https://tc39.es/ecma262/#sec-array.prototype.includes
  382. includes: createMethod(true),
  383. // `Array.prototype.indexOf` method
  384. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  385. indexOf: createMethod(false)
  386. };
  387. /***/ }),
  388. /***/ 4527:
  389. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  390. var DESCRIPTORS = __webpack_require__(3724);
  391. var isArray = __webpack_require__(4376);
  392. var $TypeError = TypeError;
  393. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  394. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  395. // Safari < 13 does not throw an error in this case
  396. var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS && !function () {
  397. // makes no sense without proper strict mode support
  398. if (this !== undefined) return true;
  399. try {
  400. // eslint-disable-next-line es/no-object-defineproperty -- safe
  401. Object.defineProperty([], 'length', { writable: false }).length = 1;
  402. } catch (error) {
  403. return error instanceof TypeError;
  404. }
  405. }();
  406. module.exports = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
  407. if (isArray(O) && !getOwnPropertyDescriptor(O, 'length').writable) {
  408. throw new $TypeError('Cannot set read only .length');
  409. } return O.length = length;
  410. } : function (O, length) {
  411. return O.length = length;
  412. };
  413. /***/ }),
  414. /***/ 7628:
  415. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  416. var lengthOfArrayLike = __webpack_require__(6198);
  417. // https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.toReversed
  418. // https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.toReversed
  419. module.exports = function (O, C) {
  420. var len = lengthOfArrayLike(O);
  421. var A = new C(len);
  422. var k = 0;
  423. for (; k < len; k++) A[k] = O[len - k - 1];
  424. return A;
  425. };
  426. /***/ }),
  427. /***/ 9928:
  428. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  429. var lengthOfArrayLike = __webpack_require__(6198);
  430. var toIntegerOrInfinity = __webpack_require__(1291);
  431. var $RangeError = RangeError;
  432. // https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.with
  433. // https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.with
  434. module.exports = function (O, C, index, value) {
  435. var len = lengthOfArrayLike(O);
  436. var relativeIndex = toIntegerOrInfinity(index);
  437. var actualIndex = relativeIndex < 0 ? len + relativeIndex : relativeIndex;
  438. if (actualIndex >= len || actualIndex < 0) throw new $RangeError('Incorrect index');
  439. var A = new C(len);
  440. var k = 0;
  441. for (; k < len; k++) A[k] = k === actualIndex ? value : O[k];
  442. return A;
  443. };
  444. /***/ }),
  445. /***/ 6319:
  446. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  447. var anObject = __webpack_require__(8551);
  448. var iteratorClose = __webpack_require__(9539);
  449. // call something on iterator step with safe closing on error
  450. module.exports = function (iterator, fn, value, ENTRIES) {
  451. try {
  452. return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
  453. } catch (error) {
  454. iteratorClose(iterator, 'throw', error);
  455. }
  456. };
  457. /***/ }),
  458. /***/ 2195:
  459. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  460. var uncurryThis = __webpack_require__(9504);
  461. var toString = uncurryThis({}.toString);
  462. var stringSlice = uncurryThis(''.slice);
  463. module.exports = function (it) {
  464. return stringSlice(toString(it), 8, -1);
  465. };
  466. /***/ }),
  467. /***/ 6955:
  468. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  469. var TO_STRING_TAG_SUPPORT = __webpack_require__(2140);
  470. var isCallable = __webpack_require__(4901);
  471. var classofRaw = __webpack_require__(2195);
  472. var wellKnownSymbol = __webpack_require__(8227);
  473. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  474. var $Object = Object;
  475. // ES3 wrong here
  476. var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';
  477. // fallback for IE11 Script Access Denied error
  478. var tryGet = function (it, key) {
  479. try {
  480. return it[key];
  481. } catch (error) { /* empty */ }
  482. };
  483. // getting tag from ES6+ `Object.prototype.toString`
  484. module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
  485. var O, tag, result;
  486. return it === undefined ? 'Undefined' : it === null ? 'Null'
  487. // @@toStringTag case
  488. : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
  489. // builtinTag case
  490. : CORRECT_ARGUMENTS ? classofRaw(O)
  491. // ES3 arguments fallback
  492. : (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result;
  493. };
  494. /***/ }),
  495. /***/ 7740:
  496. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  497. var hasOwn = __webpack_require__(9297);
  498. var ownKeys = __webpack_require__(5031);
  499. var getOwnPropertyDescriptorModule = __webpack_require__(7347);
  500. var definePropertyModule = __webpack_require__(4913);
  501. module.exports = function (target, source, exceptions) {
  502. var keys = ownKeys(source);
  503. var defineProperty = definePropertyModule.f;
  504. var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  505. for (var i = 0; i < keys.length; i++) {
  506. var key = keys[i];
  507. if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
  508. defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  509. }
  510. }
  511. };
  512. /***/ }),
  513. /***/ 2211:
  514. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  515. var fails = __webpack_require__(9039);
  516. module.exports = !fails(function () {
  517. function F() { /* empty */ }
  518. F.prototype.constructor = null;
  519. // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
  520. return Object.getPrototypeOf(new F()) !== F.prototype;
  521. });
  522. /***/ }),
  523. /***/ 2529:
  524. /***/ ((module) => {
  525. // `CreateIterResultObject` abstract operation
  526. // https://tc39.es/ecma262/#sec-createiterresultobject
  527. module.exports = function (value, done) {
  528. return { value: value, done: done };
  529. };
  530. /***/ }),
  531. /***/ 6699:
  532. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  533. var DESCRIPTORS = __webpack_require__(3724);
  534. var definePropertyModule = __webpack_require__(4913);
  535. var createPropertyDescriptor = __webpack_require__(6980);
  536. module.exports = DESCRIPTORS ? function (object, key, value) {
  537. return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
  538. } : function (object, key, value) {
  539. object[key] = value;
  540. return object;
  541. };
  542. /***/ }),
  543. /***/ 6980:
  544. /***/ ((module) => {
  545. module.exports = function (bitmap, value) {
  546. return {
  547. enumerable: !(bitmap & 1),
  548. configurable: !(bitmap & 2),
  549. writable: !(bitmap & 4),
  550. value: value
  551. };
  552. };
  553. /***/ }),
  554. /***/ 4659:
  555. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  556. var DESCRIPTORS = __webpack_require__(3724);
  557. var definePropertyModule = __webpack_require__(4913);
  558. var createPropertyDescriptor = __webpack_require__(6980);
  559. module.exports = function (object, key, value) {
  560. if (DESCRIPTORS) definePropertyModule.f(object, key, createPropertyDescriptor(0, value));
  561. else object[key] = value;
  562. };
  563. /***/ }),
  564. /***/ 2106:
  565. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  566. var makeBuiltIn = __webpack_require__(283);
  567. var defineProperty = __webpack_require__(4913);
  568. module.exports = function (target, name, descriptor) {
  569. if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true });
  570. if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true });
  571. return defineProperty.f(target, name, descriptor);
  572. };
  573. /***/ }),
  574. /***/ 6840:
  575. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  576. var isCallable = __webpack_require__(4901);
  577. var definePropertyModule = __webpack_require__(4913);
  578. var makeBuiltIn = __webpack_require__(283);
  579. var defineGlobalProperty = __webpack_require__(9433);
  580. module.exports = function (O, key, value, options) {
  581. if (!options) options = {};
  582. var simple = options.enumerable;
  583. var name = options.name !== undefined ? options.name : key;
  584. if (isCallable(value)) makeBuiltIn(value, name, options);
  585. if (options.global) {
  586. if (simple) O[key] = value;
  587. else defineGlobalProperty(key, value);
  588. } else {
  589. try {
  590. if (!options.unsafe) delete O[key];
  591. else if (O[key]) simple = true;
  592. } catch (error) { /* empty */ }
  593. if (simple) O[key] = value;
  594. else definePropertyModule.f(O, key, {
  595. value: value,
  596. enumerable: false,
  597. configurable: !options.nonConfigurable,
  598. writable: !options.nonWritable
  599. });
  600. } return O;
  601. };
  602. /***/ }),
  603. /***/ 6279:
  604. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  605. var defineBuiltIn = __webpack_require__(6840);
  606. module.exports = function (target, src, options) {
  607. for (var key in src) defineBuiltIn(target, key, src[key], options);
  608. return target;
  609. };
  610. /***/ }),
  611. /***/ 9433:
  612. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  613. var globalThis = __webpack_require__(4576);
  614. // eslint-disable-next-line es/no-object-defineproperty -- safe
  615. var defineProperty = Object.defineProperty;
  616. module.exports = function (key, value) {
  617. try {
  618. defineProperty(globalThis, key, { value: value, configurable: true, writable: true });
  619. } catch (error) {
  620. globalThis[key] = value;
  621. } return value;
  622. };
  623. /***/ }),
  624. /***/ 3724:
  625. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  626. var fails = __webpack_require__(9039);
  627. // Detect IE8's incomplete defineProperty implementation
  628. module.exports = !fails(function () {
  629. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  630. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
  631. });
  632. /***/ }),
  633. /***/ 4483:
  634. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  635. var globalThis = __webpack_require__(4576);
  636. var getBuiltInNodeModule = __webpack_require__(9429);
  637. var PROPER_STRUCTURED_CLONE_TRANSFER = __webpack_require__(1548);
  638. var structuredClone = globalThis.structuredClone;
  639. var $ArrayBuffer = globalThis.ArrayBuffer;
  640. var $MessageChannel = globalThis.MessageChannel;
  641. var detach = false;
  642. var WorkerThreads, channel, buffer, $detach;
  643. if (PROPER_STRUCTURED_CLONE_TRANSFER) {
  644. detach = function (transferable) {
  645. structuredClone(transferable, { transfer: [transferable] });
  646. };
  647. } else if ($ArrayBuffer) try {
  648. if (!$MessageChannel) {
  649. WorkerThreads = getBuiltInNodeModule('worker_threads');
  650. if (WorkerThreads) $MessageChannel = WorkerThreads.MessageChannel;
  651. }
  652. if ($MessageChannel) {
  653. channel = new $MessageChannel();
  654. buffer = new $ArrayBuffer(2);
  655. $detach = function (transferable) {
  656. channel.port1.postMessage(null, [transferable]);
  657. };
  658. if (buffer.byteLength === 2) {
  659. $detach(buffer);
  660. if (buffer.byteLength === 0) detach = $detach;
  661. }
  662. }
  663. } catch (error) { /* empty */ }
  664. module.exports = detach;
  665. /***/ }),
  666. /***/ 4055:
  667. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  668. var globalThis = __webpack_require__(4576);
  669. var isObject = __webpack_require__(34);
  670. var document = globalThis.document;
  671. // typeof document.createElement is 'object' in old IE
  672. var EXISTS = isObject(document) && isObject(document.createElement);
  673. module.exports = function (it) {
  674. return EXISTS ? document.createElement(it) : {};
  675. };
  676. /***/ }),
  677. /***/ 6837:
  678. /***/ ((module) => {
  679. var $TypeError = TypeError;
  680. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
  681. module.exports = function (it) {
  682. if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded');
  683. return it;
  684. };
  685. /***/ }),
  686. /***/ 5002:
  687. /***/ ((module) => {
  688. module.exports = {
  689. IndexSizeError: { s: 'INDEX_SIZE_ERR', c: 1, m: 1 },
  690. DOMStringSizeError: { s: 'DOMSTRING_SIZE_ERR', c: 2, m: 0 },
  691. HierarchyRequestError: { s: 'HIERARCHY_REQUEST_ERR', c: 3, m: 1 },
  692. WrongDocumentError: { s: 'WRONG_DOCUMENT_ERR', c: 4, m: 1 },
  693. InvalidCharacterError: { s: 'INVALID_CHARACTER_ERR', c: 5, m: 1 },
  694. NoDataAllowedError: { s: 'NO_DATA_ALLOWED_ERR', c: 6, m: 0 },
  695. NoModificationAllowedError: { s: 'NO_MODIFICATION_ALLOWED_ERR', c: 7, m: 1 },
  696. NotFoundError: { s: 'NOT_FOUND_ERR', c: 8, m: 1 },
  697. NotSupportedError: { s: 'NOT_SUPPORTED_ERR', c: 9, m: 1 },
  698. InUseAttributeError: { s: 'INUSE_ATTRIBUTE_ERR', c: 10, m: 1 },
  699. InvalidStateError: { s: 'INVALID_STATE_ERR', c: 11, m: 1 },
  700. SyntaxError: { s: 'SYNTAX_ERR', c: 12, m: 1 },
  701. InvalidModificationError: { s: 'INVALID_MODIFICATION_ERR', c: 13, m: 1 },
  702. NamespaceError: { s: 'NAMESPACE_ERR', c: 14, m: 1 },
  703. InvalidAccessError: { s: 'INVALID_ACCESS_ERR', c: 15, m: 1 },
  704. ValidationError: { s: 'VALIDATION_ERR', c: 16, m: 0 },
  705. TypeMismatchError: { s: 'TYPE_MISMATCH_ERR', c: 17, m: 1 },
  706. SecurityError: { s: 'SECURITY_ERR', c: 18, m: 1 },
  707. NetworkError: { s: 'NETWORK_ERR', c: 19, m: 1 },
  708. AbortError: { s: 'ABORT_ERR', c: 20, m: 1 },
  709. URLMismatchError: { s: 'URL_MISMATCH_ERR', c: 21, m: 1 },
  710. QuotaExceededError: { s: 'QUOTA_EXCEEDED_ERR', c: 22, m: 1 },
  711. TimeoutError: { s: 'TIMEOUT_ERR', c: 23, m: 1 },
  712. InvalidNodeTypeError: { s: 'INVALID_NODE_TYPE_ERR', c: 24, m: 1 },
  713. DataCloneError: { s: 'DATA_CLONE_ERR', c: 25, m: 1 }
  714. };
  715. /***/ }),
  716. /***/ 8727:
  717. /***/ ((module) => {
  718. // IE8- don't enum bug keys
  719. module.exports = [
  720. 'constructor',
  721. 'hasOwnProperty',
  722. 'isPrototypeOf',
  723. 'propertyIsEnumerable',
  724. 'toLocaleString',
  725. 'toString',
  726. 'valueOf'
  727. ];
  728. /***/ }),
  729. /***/ 6193:
  730. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  731. var ENVIRONMENT = __webpack_require__(4215);
  732. module.exports = ENVIRONMENT === 'NODE';
  733. /***/ }),
  734. /***/ 2839:
  735. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  736. var globalThis = __webpack_require__(4576);
  737. var navigator = globalThis.navigator;
  738. var userAgent = navigator && navigator.userAgent;
  739. module.exports = userAgent ? String(userAgent) : '';
  740. /***/ }),
  741. /***/ 9519:
  742. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  743. var globalThis = __webpack_require__(4576);
  744. var userAgent = __webpack_require__(2839);
  745. var process = globalThis.process;
  746. var Deno = globalThis.Deno;
  747. var versions = process && process.versions || Deno && Deno.version;
  748. var v8 = versions && versions.v8;
  749. var match, version;
  750. if (v8) {
  751. match = v8.split('.');
  752. // in old Chrome, versions of V8 isn't V8 = Chrome / 10
  753. // but their correct versions are not interesting for us
  754. version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
  755. }
  756. // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
  757. // so check `userAgent` even if `.v8` exists, but 0
  758. if (!version && userAgent) {
  759. match = userAgent.match(/Edge\/(\d+)/);
  760. if (!match || match[1] >= 74) {
  761. match = userAgent.match(/Chrome\/(\d+)/);
  762. if (match) version = +match[1];
  763. }
  764. }
  765. module.exports = version;
  766. /***/ }),
  767. /***/ 4215:
  768. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  769. /* global Bun, Deno -- detection */
  770. var globalThis = __webpack_require__(4576);
  771. var userAgent = __webpack_require__(2839);
  772. var classof = __webpack_require__(2195);
  773. var userAgentStartsWith = function (string) {
  774. return userAgent.slice(0, string.length) === string;
  775. };
  776. module.exports = (function () {
  777. if (userAgentStartsWith('Bun/')) return 'BUN';
  778. if (userAgentStartsWith('Cloudflare-Workers')) return 'CLOUDFLARE';
  779. if (userAgentStartsWith('Deno/')) return 'DENO';
  780. if (userAgentStartsWith('Node.js/')) return 'NODE';
  781. if (globalThis.Bun && typeof Bun.version == 'string') return 'BUN';
  782. if (globalThis.Deno && typeof Deno.version == 'object') return 'DENO';
  783. if (classof(globalThis.process) === 'process') return 'NODE';
  784. if (globalThis.window && globalThis.document) return 'BROWSER';
  785. return 'REST';
  786. })();
  787. /***/ }),
  788. /***/ 8574:
  789. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  790. var uncurryThis = __webpack_require__(9504);
  791. var $Error = Error;
  792. var replace = uncurryThis(''.replace);
  793. var TEST = (function (arg) { return String(new $Error(arg).stack); })('zxcasd');
  794. // eslint-disable-next-line redos/no-vulnerable -- safe
  795. var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
  796. var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);
  797. module.exports = function (stack, dropEntries) {
  798. if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) {
  799. while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, '');
  800. } return stack;
  801. };
  802. /***/ }),
  803. /***/ 6518:
  804. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  805. var globalThis = __webpack_require__(4576);
  806. var getOwnPropertyDescriptor = (__webpack_require__(7347).f);
  807. var createNonEnumerableProperty = __webpack_require__(6699);
  808. var defineBuiltIn = __webpack_require__(6840);
  809. var defineGlobalProperty = __webpack_require__(9433);
  810. var copyConstructorProperties = __webpack_require__(7740);
  811. var isForced = __webpack_require__(2796);
  812. /*
  813. options.target - name of the target object
  814. options.global - target is the global object
  815. options.stat - export as static methods of target
  816. options.proto - export as prototype methods of target
  817. options.real - real prototype method for the `pure` version
  818. options.forced - export even if the native feature is available
  819. options.bind - bind methods to the target, required for the `pure` version
  820. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  821. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  822. options.sham - add a flag to not completely full polyfills
  823. options.enumerable - export as enumerable property
  824. options.dontCallGetSet - prevent calling a getter on target
  825. options.name - the .name of the function if it does not match the key
  826. */
  827. module.exports = function (options, source) {
  828. var TARGET = options.target;
  829. var GLOBAL = options.global;
  830. var STATIC = options.stat;
  831. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  832. if (GLOBAL) {
  833. target = globalThis;
  834. } else if (STATIC) {
  835. target = globalThis[TARGET] || defineGlobalProperty(TARGET, {});
  836. } else {
  837. target = globalThis[TARGET] && globalThis[TARGET].prototype;
  838. }
  839. if (target) for (key in source) {
  840. sourceProperty = source[key];
  841. if (options.dontCallGetSet) {
  842. descriptor = getOwnPropertyDescriptor(target, key);
  843. targetProperty = descriptor && descriptor.value;
  844. } else targetProperty = target[key];
  845. FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  846. // contained in target
  847. if (!FORCED && targetProperty !== undefined) {
  848. if (typeof sourceProperty == typeof targetProperty) continue;
  849. copyConstructorProperties(sourceProperty, targetProperty);
  850. }
  851. // add a flag to not completely full polyfills
  852. if (options.sham || (targetProperty && targetProperty.sham)) {
  853. createNonEnumerableProperty(sourceProperty, 'sham', true);
  854. }
  855. defineBuiltIn(target, key, sourceProperty, options);
  856. }
  857. };
  858. /***/ }),
  859. /***/ 9039:
  860. /***/ ((module) => {
  861. module.exports = function (exec) {
  862. try {
  863. return !!exec();
  864. } catch (error) {
  865. return true;
  866. }
  867. };
  868. /***/ }),
  869. /***/ 6080:
  870. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  871. var uncurryThis = __webpack_require__(7476);
  872. var aCallable = __webpack_require__(9306);
  873. var NATIVE_BIND = __webpack_require__(616);
  874. var bind = uncurryThis(uncurryThis.bind);
  875. // optional / simple context binding
  876. module.exports = function (fn, that) {
  877. aCallable(fn);
  878. return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) {
  879. return fn.apply(that, arguments);
  880. };
  881. };
  882. /***/ }),
  883. /***/ 616:
  884. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  885. var fails = __webpack_require__(9039);
  886. module.exports = !fails(function () {
  887. // eslint-disable-next-line es/no-function-prototype-bind -- safe
  888. var test = (function () { /* empty */ }).bind();
  889. // eslint-disable-next-line no-prototype-builtins -- safe
  890. return typeof test != 'function' || test.hasOwnProperty('prototype');
  891. });
  892. /***/ }),
  893. /***/ 9565:
  894. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  895. var NATIVE_BIND = __webpack_require__(616);
  896. var call = Function.prototype.call;
  897. module.exports = NATIVE_BIND ? call.bind(call) : function () {
  898. return call.apply(call, arguments);
  899. };
  900. /***/ }),
  901. /***/ 350:
  902. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  903. var DESCRIPTORS = __webpack_require__(3724);
  904. var hasOwn = __webpack_require__(9297);
  905. var FunctionPrototype = Function.prototype;
  906. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  907. var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
  908. var EXISTS = hasOwn(FunctionPrototype, 'name');
  909. // additional protection from minified / mangled / dropped function names
  910. var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
  911. var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));
  912. module.exports = {
  913. EXISTS: EXISTS,
  914. PROPER: PROPER,
  915. CONFIGURABLE: CONFIGURABLE
  916. };
  917. /***/ }),
  918. /***/ 6706:
  919. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  920. var uncurryThis = __webpack_require__(9504);
  921. var aCallable = __webpack_require__(9306);
  922. module.exports = function (object, key, method) {
  923. try {
  924. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  925. return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));
  926. } catch (error) { /* empty */ }
  927. };
  928. /***/ }),
  929. /***/ 7476:
  930. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  931. var classofRaw = __webpack_require__(2195);
  932. var uncurryThis = __webpack_require__(9504);
  933. module.exports = function (fn) {
  934. // Nashorn bug:
  935. // https://github.com/zloirock/core-js/issues/1128
  936. // https://github.com/zloirock/core-js/issues/1130
  937. if (classofRaw(fn) === 'Function') return uncurryThis(fn);
  938. };
  939. /***/ }),
  940. /***/ 9504:
  941. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  942. var NATIVE_BIND = __webpack_require__(616);
  943. var FunctionPrototype = Function.prototype;
  944. var call = FunctionPrototype.call;
  945. var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);
  946. module.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) {
  947. return function () {
  948. return call.apply(fn, arguments);
  949. };
  950. };
  951. /***/ }),
  952. /***/ 9429:
  953. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  954. var globalThis = __webpack_require__(4576);
  955. var IS_NODE = __webpack_require__(6193);
  956. module.exports = function (name) {
  957. if (IS_NODE) {
  958. try {
  959. return globalThis.process.getBuiltinModule(name);
  960. } catch (error) { /* empty */ }
  961. try {
  962. // eslint-disable-next-line no-new-func -- safe
  963. return Function('return require("' + name + '")')();
  964. } catch (error) { /* empty */ }
  965. }
  966. };
  967. /***/ }),
  968. /***/ 7751:
  969. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  970. var globalThis = __webpack_require__(4576);
  971. var isCallable = __webpack_require__(4901);
  972. var aFunction = function (argument) {
  973. return isCallable(argument) ? argument : undefined;
  974. };
  975. module.exports = function (namespace, method) {
  976. return arguments.length < 2 ? aFunction(globalThis[namespace]) : globalThis[namespace] && globalThis[namespace][method];
  977. };
  978. /***/ }),
  979. /***/ 1767:
  980. /***/ ((module) => {
  981. // `GetIteratorDirect(obj)` abstract operation
  982. // https://tc39.es/proposal-iterator-helpers/#sec-getiteratordirect
  983. module.exports = function (obj) {
  984. return {
  985. iterator: obj,
  986. next: obj.next,
  987. done: false
  988. };
  989. };
  990. /***/ }),
  991. /***/ 851:
  992. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  993. var classof = __webpack_require__(6955);
  994. var getMethod = __webpack_require__(5966);
  995. var isNullOrUndefined = __webpack_require__(4117);
  996. var Iterators = __webpack_require__(6269);
  997. var wellKnownSymbol = __webpack_require__(8227);
  998. var ITERATOR = wellKnownSymbol('iterator');
  999. module.exports = function (it) {
  1000. if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR)
  1001. || getMethod(it, '@@iterator')
  1002. || Iterators[classof(it)];
  1003. };
  1004. /***/ }),
  1005. /***/ 81:
  1006. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1007. var call = __webpack_require__(9565);
  1008. var aCallable = __webpack_require__(9306);
  1009. var anObject = __webpack_require__(8551);
  1010. var tryToString = __webpack_require__(6823);
  1011. var getIteratorMethod = __webpack_require__(851);
  1012. var $TypeError = TypeError;
  1013. module.exports = function (argument, usingIterator) {
  1014. var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
  1015. if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));
  1016. throw new $TypeError(tryToString(argument) + ' is not iterable');
  1017. };
  1018. /***/ }),
  1019. /***/ 5966:
  1020. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1021. var aCallable = __webpack_require__(9306);
  1022. var isNullOrUndefined = __webpack_require__(4117);
  1023. // `GetMethod` abstract operation
  1024. // https://tc39.es/ecma262/#sec-getmethod
  1025. module.exports = function (V, P) {
  1026. var func = V[P];
  1027. return isNullOrUndefined(func) ? undefined : aCallable(func);
  1028. };
  1029. /***/ }),
  1030. /***/ 3789:
  1031. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1032. var aCallable = __webpack_require__(9306);
  1033. var anObject = __webpack_require__(8551);
  1034. var call = __webpack_require__(9565);
  1035. var toIntegerOrInfinity = __webpack_require__(1291);
  1036. var getIteratorDirect = __webpack_require__(1767);
  1037. var INVALID_SIZE = 'Invalid size';
  1038. var $RangeError = RangeError;
  1039. var $TypeError = TypeError;
  1040. var max = Math.max;
  1041. var SetRecord = function (set, intSize) {
  1042. this.set = set;
  1043. this.size = max(intSize, 0);
  1044. this.has = aCallable(set.has);
  1045. this.keys = aCallable(set.keys);
  1046. };
  1047. SetRecord.prototype = {
  1048. getIterator: function () {
  1049. return getIteratorDirect(anObject(call(this.keys, this.set)));
  1050. },
  1051. includes: function (it) {
  1052. return call(this.has, this.set, it);
  1053. }
  1054. };
  1055. // `GetSetRecord` abstract operation
  1056. // https://tc39.es/proposal-set-methods/#sec-getsetrecord
  1057. module.exports = function (obj) {
  1058. anObject(obj);
  1059. var numSize = +obj.size;
  1060. // NOTE: If size is undefined, then numSize will be NaN
  1061. // eslint-disable-next-line no-self-compare -- NaN check
  1062. if (numSize !== numSize) throw new $TypeError(INVALID_SIZE);
  1063. var intSize = toIntegerOrInfinity(numSize);
  1064. if (intSize < 0) throw new $RangeError(INVALID_SIZE);
  1065. return new SetRecord(obj, intSize);
  1066. };
  1067. /***/ }),
  1068. /***/ 4576:
  1069. /***/ (function(module) {
  1070. var check = function (it) {
  1071. return it && it.Math === Math && it;
  1072. };
  1073. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  1074. module.exports =
  1075. // eslint-disable-next-line es/no-global-this -- safe
  1076. check(typeof globalThis == 'object' && globalThis) ||
  1077. check(typeof window == 'object' && window) ||
  1078. // eslint-disable-next-line no-restricted-globals -- safe
  1079. check(typeof self == 'object' && self) ||
  1080. check(typeof global == 'object' && global) ||
  1081. check(typeof this == 'object' && this) ||
  1082. // eslint-disable-next-line no-new-func -- fallback
  1083. (function () { return this; })() || Function('return this')();
  1084. /***/ }),
  1085. /***/ 9297:
  1086. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1087. var uncurryThis = __webpack_require__(9504);
  1088. var toObject = __webpack_require__(8981);
  1089. var hasOwnProperty = uncurryThis({}.hasOwnProperty);
  1090. // `HasOwnProperty` abstract operation
  1091. // https://tc39.es/ecma262/#sec-hasownproperty
  1092. // eslint-disable-next-line es/no-object-hasown -- safe
  1093. module.exports = Object.hasOwn || function hasOwn(it, key) {
  1094. return hasOwnProperty(toObject(it), key);
  1095. };
  1096. /***/ }),
  1097. /***/ 421:
  1098. /***/ ((module) => {
  1099. module.exports = {};
  1100. /***/ }),
  1101. /***/ 397:
  1102. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1103. var getBuiltIn = __webpack_require__(7751);
  1104. module.exports = getBuiltIn('document', 'documentElement');
  1105. /***/ }),
  1106. /***/ 5917:
  1107. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1108. var DESCRIPTORS = __webpack_require__(3724);
  1109. var fails = __webpack_require__(9039);
  1110. var createElement = __webpack_require__(4055);
  1111. // Thanks to IE8 for its funny defineProperty
  1112. module.exports = !DESCRIPTORS && !fails(function () {
  1113. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  1114. return Object.defineProperty(createElement('div'), 'a', {
  1115. get: function () { return 7; }
  1116. }).a !== 7;
  1117. });
  1118. /***/ }),
  1119. /***/ 7055:
  1120. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1121. var uncurryThis = __webpack_require__(9504);
  1122. var fails = __webpack_require__(9039);
  1123. var classof = __webpack_require__(2195);
  1124. var $Object = Object;
  1125. var split = uncurryThis(''.split);
  1126. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  1127. module.exports = fails(function () {
  1128. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  1129. // eslint-disable-next-line no-prototype-builtins -- safe
  1130. return !$Object('z').propertyIsEnumerable(0);
  1131. }) ? function (it) {
  1132. return classof(it) === 'String' ? split(it, '') : $Object(it);
  1133. } : $Object;
  1134. /***/ }),
  1135. /***/ 3167:
  1136. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1137. var isCallable = __webpack_require__(4901);
  1138. var isObject = __webpack_require__(34);
  1139. var setPrototypeOf = __webpack_require__(2967);
  1140. // makes subclassing work correct for wrapped built-ins
  1141. module.exports = function ($this, dummy, Wrapper) {
  1142. var NewTarget, NewTargetPrototype;
  1143. if (
  1144. // it can work only with native `setPrototypeOf`
  1145. setPrototypeOf &&
  1146. // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
  1147. isCallable(NewTarget = dummy.constructor) &&
  1148. NewTarget !== Wrapper &&
  1149. isObject(NewTargetPrototype = NewTarget.prototype) &&
  1150. NewTargetPrototype !== Wrapper.prototype
  1151. ) setPrototypeOf($this, NewTargetPrototype);
  1152. return $this;
  1153. };
  1154. /***/ }),
  1155. /***/ 3706:
  1156. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1157. var uncurryThis = __webpack_require__(9504);
  1158. var isCallable = __webpack_require__(4901);
  1159. var store = __webpack_require__(7629);
  1160. var functionToString = uncurryThis(Function.toString);
  1161. // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
  1162. if (!isCallable(store.inspectSource)) {
  1163. store.inspectSource = function (it) {
  1164. return functionToString(it);
  1165. };
  1166. }
  1167. module.exports = store.inspectSource;
  1168. /***/ }),
  1169. /***/ 1181:
  1170. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1171. var NATIVE_WEAK_MAP = __webpack_require__(8622);
  1172. var globalThis = __webpack_require__(4576);
  1173. var isObject = __webpack_require__(34);
  1174. var createNonEnumerableProperty = __webpack_require__(6699);
  1175. var hasOwn = __webpack_require__(9297);
  1176. var shared = __webpack_require__(7629);
  1177. var sharedKey = __webpack_require__(6119);
  1178. var hiddenKeys = __webpack_require__(421);
  1179. var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
  1180. var TypeError = globalThis.TypeError;
  1181. var WeakMap = globalThis.WeakMap;
  1182. var set, get, has;
  1183. var enforce = function (it) {
  1184. return has(it) ? get(it) : set(it, {});
  1185. };
  1186. var getterFor = function (TYPE) {
  1187. return function (it) {
  1188. var state;
  1189. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  1190. throw new TypeError('Incompatible receiver, ' + TYPE + ' required');
  1191. } return state;
  1192. };
  1193. };
  1194. if (NATIVE_WEAK_MAP || shared.state) {
  1195. var store = shared.state || (shared.state = new WeakMap());
  1196. /* eslint-disable no-self-assign -- prototype methods protection */
  1197. store.get = store.get;
  1198. store.has = store.has;
  1199. store.set = store.set;
  1200. /* eslint-enable no-self-assign -- prototype methods protection */
  1201. set = function (it, metadata) {
  1202. if (store.has(it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
  1203. metadata.facade = it;
  1204. store.set(it, metadata);
  1205. return metadata;
  1206. };
  1207. get = function (it) {
  1208. return store.get(it) || {};
  1209. };
  1210. has = function (it) {
  1211. return store.has(it);
  1212. };
  1213. } else {
  1214. var STATE = sharedKey('state');
  1215. hiddenKeys[STATE] = true;
  1216. set = function (it, metadata) {
  1217. if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
  1218. metadata.facade = it;
  1219. createNonEnumerableProperty(it, STATE, metadata);
  1220. return metadata;
  1221. };
  1222. get = function (it) {
  1223. return hasOwn(it, STATE) ? it[STATE] : {};
  1224. };
  1225. has = function (it) {
  1226. return hasOwn(it, STATE);
  1227. };
  1228. }
  1229. module.exports = {
  1230. set: set,
  1231. get: get,
  1232. has: has,
  1233. enforce: enforce,
  1234. getterFor: getterFor
  1235. };
  1236. /***/ }),
  1237. /***/ 4209:
  1238. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1239. var wellKnownSymbol = __webpack_require__(8227);
  1240. var Iterators = __webpack_require__(6269);
  1241. var ITERATOR = wellKnownSymbol('iterator');
  1242. var ArrayPrototype = Array.prototype;
  1243. // check on default Array iterator
  1244. module.exports = function (it) {
  1245. return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
  1246. };
  1247. /***/ }),
  1248. /***/ 4376:
  1249. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1250. var classof = __webpack_require__(2195);
  1251. // `IsArray` abstract operation
  1252. // https://tc39.es/ecma262/#sec-isarray
  1253. // eslint-disable-next-line es/no-array-isarray -- safe
  1254. module.exports = Array.isArray || function isArray(argument) {
  1255. return classof(argument) === 'Array';
  1256. };
  1257. /***/ }),
  1258. /***/ 1108:
  1259. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1260. var classof = __webpack_require__(6955);
  1261. module.exports = function (it) {
  1262. var klass = classof(it);
  1263. return klass === 'BigInt64Array' || klass === 'BigUint64Array';
  1264. };
  1265. /***/ }),
  1266. /***/ 4901:
  1267. /***/ ((module) => {
  1268. // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
  1269. var documentAll = typeof document == 'object' && document.all;
  1270. // `IsCallable` abstract operation
  1271. // https://tc39.es/ecma262/#sec-iscallable
  1272. // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
  1273. module.exports = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
  1274. return typeof argument == 'function' || argument === documentAll;
  1275. } : function (argument) {
  1276. return typeof argument == 'function';
  1277. };
  1278. /***/ }),
  1279. /***/ 2796:
  1280. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1281. var fails = __webpack_require__(9039);
  1282. var isCallable = __webpack_require__(4901);
  1283. var replacement = /#|\.prototype\./;
  1284. var isForced = function (feature, detection) {
  1285. var value = data[normalize(feature)];
  1286. return value === POLYFILL ? true
  1287. : value === NATIVE ? false
  1288. : isCallable(detection) ? fails(detection)
  1289. : !!detection;
  1290. };
  1291. var normalize = isForced.normalize = function (string) {
  1292. return String(string).replace(replacement, '.').toLowerCase();
  1293. };
  1294. var data = isForced.data = {};
  1295. var NATIVE = isForced.NATIVE = 'N';
  1296. var POLYFILL = isForced.POLYFILL = 'P';
  1297. module.exports = isForced;
  1298. /***/ }),
  1299. /***/ 4117:
  1300. /***/ ((module) => {
  1301. // we can't use just `it == null` since of `document.all` special case
  1302. // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
  1303. module.exports = function (it) {
  1304. return it === null || it === undefined;
  1305. };
  1306. /***/ }),
  1307. /***/ 34:
  1308. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1309. var isCallable = __webpack_require__(4901);
  1310. module.exports = function (it) {
  1311. return typeof it == 'object' ? it !== null : isCallable(it);
  1312. };
  1313. /***/ }),
  1314. /***/ 3925:
  1315. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1316. var isObject = __webpack_require__(34);
  1317. module.exports = function (argument) {
  1318. return isObject(argument) || argument === null;
  1319. };
  1320. /***/ }),
  1321. /***/ 6395:
  1322. /***/ ((module) => {
  1323. module.exports = false;
  1324. /***/ }),
  1325. /***/ 757:
  1326. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1327. var getBuiltIn = __webpack_require__(7751);
  1328. var isCallable = __webpack_require__(4901);
  1329. var isPrototypeOf = __webpack_require__(1625);
  1330. var USE_SYMBOL_AS_UID = __webpack_require__(7040);
  1331. var $Object = Object;
  1332. module.exports = USE_SYMBOL_AS_UID ? function (it) {
  1333. return typeof it == 'symbol';
  1334. } : function (it) {
  1335. var $Symbol = getBuiltIn('Symbol');
  1336. return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));
  1337. };
  1338. /***/ }),
  1339. /***/ 507:
  1340. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1341. var call = __webpack_require__(9565);
  1342. module.exports = function (record, fn, ITERATOR_INSTEAD_OF_RECORD) {
  1343. var iterator = ITERATOR_INSTEAD_OF_RECORD ? record : record.iterator;
  1344. var next = record.next;
  1345. var step, result;
  1346. while (!(step = call(next, iterator)).done) {
  1347. result = fn(step.value);
  1348. if (result !== undefined) return result;
  1349. }
  1350. };
  1351. /***/ }),
  1352. /***/ 2652:
  1353. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1354. var bind = __webpack_require__(6080);
  1355. var call = __webpack_require__(9565);
  1356. var anObject = __webpack_require__(8551);
  1357. var tryToString = __webpack_require__(6823);
  1358. var isArrayIteratorMethod = __webpack_require__(4209);
  1359. var lengthOfArrayLike = __webpack_require__(6198);
  1360. var isPrototypeOf = __webpack_require__(1625);
  1361. var getIterator = __webpack_require__(81);
  1362. var getIteratorMethod = __webpack_require__(851);
  1363. var iteratorClose = __webpack_require__(9539);
  1364. var $TypeError = TypeError;
  1365. var Result = function (stopped, result) {
  1366. this.stopped = stopped;
  1367. this.result = result;
  1368. };
  1369. var ResultPrototype = Result.prototype;
  1370. module.exports = function (iterable, unboundFunction, options) {
  1371. var that = options && options.that;
  1372. var AS_ENTRIES = !!(options && options.AS_ENTRIES);
  1373. var IS_RECORD = !!(options && options.IS_RECORD);
  1374. var IS_ITERATOR = !!(options && options.IS_ITERATOR);
  1375. var INTERRUPTED = !!(options && options.INTERRUPTED);
  1376. var fn = bind(unboundFunction, that);
  1377. var iterator, iterFn, index, length, result, next, step;
  1378. var stop = function (condition) {
  1379. if (iterator) iteratorClose(iterator, 'normal', condition);
  1380. return new Result(true, condition);
  1381. };
  1382. var callFn = function (value) {
  1383. if (AS_ENTRIES) {
  1384. anObject(value);
  1385. return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
  1386. } return INTERRUPTED ? fn(value, stop) : fn(value);
  1387. };
  1388. if (IS_RECORD) {
  1389. iterator = iterable.iterator;
  1390. } else if (IS_ITERATOR) {
  1391. iterator = iterable;
  1392. } else {
  1393. iterFn = getIteratorMethod(iterable);
  1394. if (!iterFn) throw new $TypeError(tryToString(iterable) + ' is not iterable');
  1395. // optimisation for array iterators
  1396. if (isArrayIteratorMethod(iterFn)) {
  1397. for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
  1398. result = callFn(iterable[index]);
  1399. if (result && isPrototypeOf(ResultPrototype, result)) return result;
  1400. } return new Result(false);
  1401. }
  1402. iterator = getIterator(iterable, iterFn);
  1403. }
  1404. next = IS_RECORD ? iterable.next : iterator.next;
  1405. while (!(step = call(next, iterator)).done) {
  1406. try {
  1407. result = callFn(step.value);
  1408. } catch (error) {
  1409. iteratorClose(iterator, 'throw', error);
  1410. }
  1411. if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
  1412. } return new Result(false);
  1413. };
  1414. /***/ }),
  1415. /***/ 9539:
  1416. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1417. var call = __webpack_require__(9565);
  1418. var anObject = __webpack_require__(8551);
  1419. var getMethod = __webpack_require__(5966);
  1420. module.exports = function (iterator, kind, value) {
  1421. var innerResult, innerError;
  1422. anObject(iterator);
  1423. try {
  1424. innerResult = getMethod(iterator, 'return');
  1425. if (!innerResult) {
  1426. if (kind === 'throw') throw value;
  1427. return value;
  1428. }
  1429. innerResult = call(innerResult, iterator);
  1430. } catch (error) {
  1431. innerError = true;
  1432. innerResult = error;
  1433. }
  1434. if (kind === 'throw') throw value;
  1435. if (innerError) throw innerResult;
  1436. anObject(innerResult);
  1437. return value;
  1438. };
  1439. /***/ }),
  1440. /***/ 9462:
  1441. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1442. var call = __webpack_require__(9565);
  1443. var create = __webpack_require__(2360);
  1444. var createNonEnumerableProperty = __webpack_require__(6699);
  1445. var defineBuiltIns = __webpack_require__(6279);
  1446. var wellKnownSymbol = __webpack_require__(8227);
  1447. var InternalStateModule = __webpack_require__(1181);
  1448. var getMethod = __webpack_require__(5966);
  1449. var IteratorPrototype = (__webpack_require__(7657).IteratorPrototype);
  1450. var createIterResultObject = __webpack_require__(2529);
  1451. var iteratorClose = __webpack_require__(9539);
  1452. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  1453. var ITERATOR_HELPER = 'IteratorHelper';
  1454. var WRAP_FOR_VALID_ITERATOR = 'WrapForValidIterator';
  1455. var setInternalState = InternalStateModule.set;
  1456. var createIteratorProxyPrototype = function (IS_ITERATOR) {
  1457. var getInternalState = InternalStateModule.getterFor(IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER);
  1458. return defineBuiltIns(create(IteratorPrototype), {
  1459. next: function next() {
  1460. var state = getInternalState(this);
  1461. // for simplification:
  1462. // for `%WrapForValidIteratorPrototype%.next` our `nextHandler` returns `IterResultObject`
  1463. // for `%IteratorHelperPrototype%.next` - just a value
  1464. if (IS_ITERATOR) return state.nextHandler();
  1465. try {
  1466. var result = state.done ? undefined : state.nextHandler();
  1467. return createIterResultObject(result, state.done);
  1468. } catch (error) {
  1469. state.done = true;
  1470. throw error;
  1471. }
  1472. },
  1473. 'return': function () {
  1474. var state = getInternalState(this);
  1475. var iterator = state.iterator;
  1476. state.done = true;
  1477. if (IS_ITERATOR) {
  1478. var returnMethod = getMethod(iterator, 'return');
  1479. return returnMethod ? call(returnMethod, iterator) : createIterResultObject(undefined, true);
  1480. }
  1481. if (state.inner) try {
  1482. iteratorClose(state.inner.iterator, 'normal');
  1483. } catch (error) {
  1484. return iteratorClose(iterator, 'throw', error);
  1485. }
  1486. iteratorClose(iterator, 'normal');
  1487. return createIterResultObject(undefined, true);
  1488. }
  1489. });
  1490. };
  1491. var WrapForValidIteratorPrototype = createIteratorProxyPrototype(true);
  1492. var IteratorHelperPrototype = createIteratorProxyPrototype(false);
  1493. createNonEnumerableProperty(IteratorHelperPrototype, TO_STRING_TAG, 'Iterator Helper');
  1494. module.exports = function (nextHandler, IS_ITERATOR) {
  1495. var IteratorProxy = function Iterator(record, state) {
  1496. if (state) {
  1497. state.iterator = record.iterator;
  1498. state.next = record.next;
  1499. } else state = record;
  1500. state.type = IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER;
  1501. state.nextHandler = nextHandler;
  1502. state.counter = 0;
  1503. state.done = false;
  1504. setInternalState(this, state);
  1505. };
  1506. IteratorProxy.prototype = IS_ITERATOR ? WrapForValidIteratorPrototype : IteratorHelperPrototype;
  1507. return IteratorProxy;
  1508. };
  1509. /***/ }),
  1510. /***/ 713:
  1511. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1512. var call = __webpack_require__(9565);
  1513. var aCallable = __webpack_require__(9306);
  1514. var anObject = __webpack_require__(8551);
  1515. var getIteratorDirect = __webpack_require__(1767);
  1516. var createIteratorProxy = __webpack_require__(9462);
  1517. var callWithSafeIterationClosing = __webpack_require__(6319);
  1518. var IteratorProxy = createIteratorProxy(function () {
  1519. var iterator = this.iterator;
  1520. var result = anObject(call(this.next, iterator));
  1521. var done = this.done = !!result.done;
  1522. if (!done) return callWithSafeIterationClosing(iterator, this.mapper, [result.value, this.counter++], true);
  1523. });
  1524. // `Iterator.prototype.map` method
  1525. // https://github.com/tc39/proposal-iterator-helpers
  1526. module.exports = function map(mapper) {
  1527. anObject(this);
  1528. aCallable(mapper);
  1529. return new IteratorProxy(getIteratorDirect(this), {
  1530. mapper: mapper
  1531. });
  1532. };
  1533. /***/ }),
  1534. /***/ 7657:
  1535. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1536. var fails = __webpack_require__(9039);
  1537. var isCallable = __webpack_require__(4901);
  1538. var isObject = __webpack_require__(34);
  1539. var create = __webpack_require__(2360);
  1540. var getPrototypeOf = __webpack_require__(2787);
  1541. var defineBuiltIn = __webpack_require__(6840);
  1542. var wellKnownSymbol = __webpack_require__(8227);
  1543. var IS_PURE = __webpack_require__(6395);
  1544. var ITERATOR = wellKnownSymbol('iterator');
  1545. var BUGGY_SAFARI_ITERATORS = false;
  1546. // `%IteratorPrototype%` object
  1547. // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
  1548. var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
  1549. /* eslint-disable es/no-array-prototype-keys -- safe */
  1550. if ([].keys) {
  1551. arrayIterator = [].keys();
  1552. // Safari 8 has buggy iterators w/o `next`
  1553. if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
  1554. else {
  1555. PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
  1556. if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
  1557. }
  1558. }
  1559. var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype) || fails(function () {
  1560. var test = {};
  1561. // FF44- legacy iterators case
  1562. return IteratorPrototype[ITERATOR].call(test) !== test;
  1563. });
  1564. if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};
  1565. else if (IS_PURE) IteratorPrototype = create(IteratorPrototype);
  1566. // `%IteratorPrototype%[@@iterator]()` method
  1567. // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
  1568. if (!isCallable(IteratorPrototype[ITERATOR])) {
  1569. defineBuiltIn(IteratorPrototype, ITERATOR, function () {
  1570. return this;
  1571. });
  1572. }
  1573. module.exports = {
  1574. IteratorPrototype: IteratorPrototype,
  1575. BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
  1576. };
  1577. /***/ }),
  1578. /***/ 6269:
  1579. /***/ ((module) => {
  1580. module.exports = {};
  1581. /***/ }),
  1582. /***/ 6198:
  1583. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1584. var toLength = __webpack_require__(8014);
  1585. // `LengthOfArrayLike` abstract operation
  1586. // https://tc39.es/ecma262/#sec-lengthofarraylike
  1587. module.exports = function (obj) {
  1588. return toLength(obj.length);
  1589. };
  1590. /***/ }),
  1591. /***/ 283:
  1592. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1593. var uncurryThis = __webpack_require__(9504);
  1594. var fails = __webpack_require__(9039);
  1595. var isCallable = __webpack_require__(4901);
  1596. var hasOwn = __webpack_require__(9297);
  1597. var DESCRIPTORS = __webpack_require__(3724);
  1598. var CONFIGURABLE_FUNCTION_NAME = (__webpack_require__(350).CONFIGURABLE);
  1599. var inspectSource = __webpack_require__(3706);
  1600. var InternalStateModule = __webpack_require__(1181);
  1601. var enforceInternalState = InternalStateModule.enforce;
  1602. var getInternalState = InternalStateModule.get;
  1603. var $String = String;
  1604. // eslint-disable-next-line es/no-object-defineproperty -- safe
  1605. var defineProperty = Object.defineProperty;
  1606. var stringSlice = uncurryThis(''.slice);
  1607. var replace = uncurryThis(''.replace);
  1608. var join = uncurryThis([].join);
  1609. var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function () {
  1610. return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
  1611. });
  1612. var TEMPLATE = String(String).split('String');
  1613. var makeBuiltIn = module.exports = function (value, name, options) {
  1614. if (stringSlice($String(name), 0, 7) === 'Symbol(') {
  1615. name = '[' + replace($String(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
  1616. }
  1617. if (options && options.getter) name = 'get ' + name;
  1618. if (options && options.setter) name = 'set ' + name;
  1619. if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
  1620. if (DESCRIPTORS) defineProperty(value, 'name', { value: name, configurable: true });
  1621. else value.name = name;
  1622. }
  1623. if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) {
  1624. defineProperty(value, 'length', { value: options.arity });
  1625. }
  1626. try {
  1627. if (options && hasOwn(options, 'constructor') && options.constructor) {
  1628. if (DESCRIPTORS) defineProperty(value, 'prototype', { writable: false });
  1629. // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
  1630. } else if (value.prototype) value.prototype = undefined;
  1631. } catch (error) { /* empty */ }
  1632. var state = enforceInternalState(value);
  1633. if (!hasOwn(state, 'source')) {
  1634. state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
  1635. } return value;
  1636. };
  1637. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  1638. // eslint-disable-next-line no-extend-native -- required
  1639. Function.prototype.toString = makeBuiltIn(function toString() {
  1640. return isCallable(this) && getInternalState(this).source || inspectSource(this);
  1641. }, 'toString');
  1642. /***/ }),
  1643. /***/ 741:
  1644. /***/ ((module) => {
  1645. var ceil = Math.ceil;
  1646. var floor = Math.floor;
  1647. // `Math.trunc` method
  1648. // https://tc39.es/ecma262/#sec-math.trunc
  1649. // eslint-disable-next-line es/no-math-trunc -- safe
  1650. module.exports = Math.trunc || function trunc(x) {
  1651. var n = +x;
  1652. return (n > 0 ? floor : ceil)(n);
  1653. };
  1654. /***/ }),
  1655. /***/ 6043:
  1656. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1657. var aCallable = __webpack_require__(9306);
  1658. var $TypeError = TypeError;
  1659. var PromiseCapability = function (C) {
  1660. var resolve, reject;
  1661. this.promise = new C(function ($$resolve, $$reject) {
  1662. if (resolve !== undefined || reject !== undefined) throw new $TypeError('Bad Promise constructor');
  1663. resolve = $$resolve;
  1664. reject = $$reject;
  1665. });
  1666. this.resolve = aCallable(resolve);
  1667. this.reject = aCallable(reject);
  1668. };
  1669. // `NewPromiseCapability` abstract operation
  1670. // https://tc39.es/ecma262/#sec-newpromisecapability
  1671. module.exports.f = function (C) {
  1672. return new PromiseCapability(C);
  1673. };
  1674. /***/ }),
  1675. /***/ 2603:
  1676. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1677. var toString = __webpack_require__(655);
  1678. module.exports = function (argument, $default) {
  1679. return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument);
  1680. };
  1681. /***/ }),
  1682. /***/ 2360:
  1683. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1684. /* global ActiveXObject -- old IE, WSH */
  1685. var anObject = __webpack_require__(8551);
  1686. var definePropertiesModule = __webpack_require__(6801);
  1687. var enumBugKeys = __webpack_require__(8727);
  1688. var hiddenKeys = __webpack_require__(421);
  1689. var html = __webpack_require__(397);
  1690. var documentCreateElement = __webpack_require__(4055);
  1691. var sharedKey = __webpack_require__(6119);
  1692. var GT = '>';
  1693. var LT = '<';
  1694. var PROTOTYPE = 'prototype';
  1695. var SCRIPT = 'script';
  1696. var IE_PROTO = sharedKey('IE_PROTO');
  1697. var EmptyConstructor = function () { /* empty */ };
  1698. var scriptTag = function (content) {
  1699. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  1700. };
  1701. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  1702. var NullProtoObjectViaActiveX = function (activeXDocument) {
  1703. activeXDocument.write(scriptTag(''));
  1704. activeXDocument.close();
  1705. var temp = activeXDocument.parentWindow.Object;
  1706. // eslint-disable-next-line no-useless-assignment -- avoid memory leak
  1707. activeXDocument = null;
  1708. return temp;
  1709. };
  1710. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  1711. var NullProtoObjectViaIFrame = function () {
  1712. // Thrash, waste and sodomy: IE GC bug
  1713. var iframe = documentCreateElement('iframe');
  1714. var JS = 'java' + SCRIPT + ':';
  1715. var iframeDocument;
  1716. iframe.style.display = 'none';
  1717. html.appendChild(iframe);
  1718. // https://github.com/zloirock/core-js/issues/475
  1719. iframe.src = String(JS);
  1720. iframeDocument = iframe.contentWindow.document;
  1721. iframeDocument.open();
  1722. iframeDocument.write(scriptTag('document.F=Object'));
  1723. iframeDocument.close();
  1724. return iframeDocument.F;
  1725. };
  1726. // Check for document.domain and active x support
  1727. // No need to use active x approach when document.domain is not set
  1728. // see https://github.com/es-shims/es5-shim/issues/150
  1729. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  1730. // avoid IE GC bug
  1731. var activeXDocument;
  1732. var NullProtoObject = function () {
  1733. try {
  1734. activeXDocument = new ActiveXObject('htmlfile');
  1735. } catch (error) { /* ignore */ }
  1736. NullProtoObject = typeof document != 'undefined'
  1737. ? document.domain && activeXDocument
  1738. ? NullProtoObjectViaActiveX(activeXDocument) // old IE
  1739. : NullProtoObjectViaIFrame()
  1740. : NullProtoObjectViaActiveX(activeXDocument); // WSH
  1741. var length = enumBugKeys.length;
  1742. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  1743. return NullProtoObject();
  1744. };
  1745. hiddenKeys[IE_PROTO] = true;
  1746. // `Object.create` method
  1747. // https://tc39.es/ecma262/#sec-object.create
  1748. // eslint-disable-next-line es/no-object-create -- safe
  1749. module.exports = Object.create || function create(O, Properties) {
  1750. var result;
  1751. if (O !== null) {
  1752. EmptyConstructor[PROTOTYPE] = anObject(O);
  1753. result = new EmptyConstructor();
  1754. EmptyConstructor[PROTOTYPE] = null;
  1755. // add "__proto__" for Object.getPrototypeOf polyfill
  1756. result[IE_PROTO] = O;
  1757. } else result = NullProtoObject();
  1758. return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
  1759. };
  1760. /***/ }),
  1761. /***/ 6801:
  1762. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  1763. var DESCRIPTORS = __webpack_require__(3724);
  1764. var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(8686);
  1765. var definePropertyModule = __webpack_require__(4913);
  1766. var anObject = __webpack_require__(8551);
  1767. var toIndexedObject = __webpack_require__(5397);
  1768. var objectKeys = __webpack_require__(1072);
  1769. // `Object.defineProperties` method
  1770. // https://tc39.es/ecma262/#sec-object.defineproperties
  1771. // eslint-disable-next-line es/no-object-defineproperties -- safe
  1772. exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
  1773. anObject(O);
  1774. var props = toIndexedObject(Properties);
  1775. var keys = objectKeys(Properties);
  1776. var length = keys.length;
  1777. var index = 0;
  1778. var key;
  1779. while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
  1780. return O;
  1781. };
  1782. /***/ }),
  1783. /***/ 4913:
  1784. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  1785. var DESCRIPTORS = __webpack_require__(3724);
  1786. var IE8_DOM_DEFINE = __webpack_require__(5917);
  1787. var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(8686);
  1788. var anObject = __webpack_require__(8551);
  1789. var toPropertyKey = __webpack_require__(6969);
  1790. var $TypeError = TypeError;
  1791. // eslint-disable-next-line es/no-object-defineproperty -- safe
  1792. var $defineProperty = Object.defineProperty;
  1793. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  1794. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  1795. var ENUMERABLE = 'enumerable';
  1796. var CONFIGURABLE = 'configurable';
  1797. var WRITABLE = 'writable';
  1798. // `Object.defineProperty` method
  1799. // https://tc39.es/ecma262/#sec-object.defineproperty
  1800. exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
  1801. anObject(O);
  1802. P = toPropertyKey(P);
  1803. anObject(Attributes);
  1804. if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
  1805. var current = $getOwnPropertyDescriptor(O, P);
  1806. if (current && current[WRITABLE]) {
  1807. O[P] = Attributes.value;
  1808. Attributes = {
  1809. configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
  1810. enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
  1811. writable: false
  1812. };
  1813. }
  1814. } return $defineProperty(O, P, Attributes);
  1815. } : $defineProperty : function defineProperty(O, P, Attributes) {
  1816. anObject(O);
  1817. P = toPropertyKey(P);
  1818. anObject(Attributes);
  1819. if (IE8_DOM_DEFINE) try {
  1820. return $defineProperty(O, P, Attributes);
  1821. } catch (error) { /* empty */ }
  1822. if ('get' in Attributes || 'set' in Attributes) throw new $TypeError('Accessors not supported');
  1823. if ('value' in Attributes) O[P] = Attributes.value;
  1824. return O;
  1825. };
  1826. /***/ }),
  1827. /***/ 7347:
  1828. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  1829. var DESCRIPTORS = __webpack_require__(3724);
  1830. var call = __webpack_require__(9565);
  1831. var propertyIsEnumerableModule = __webpack_require__(8773);
  1832. var createPropertyDescriptor = __webpack_require__(6980);
  1833. var toIndexedObject = __webpack_require__(5397);
  1834. var toPropertyKey = __webpack_require__(6969);
  1835. var hasOwn = __webpack_require__(9297);
  1836. var IE8_DOM_DEFINE = __webpack_require__(5917);
  1837. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  1838. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  1839. // `Object.getOwnPropertyDescriptor` method
  1840. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  1841. exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  1842. O = toIndexedObject(O);
  1843. P = toPropertyKey(P);
  1844. if (IE8_DOM_DEFINE) try {
  1845. return $getOwnPropertyDescriptor(O, P);
  1846. } catch (error) { /* empty */ }
  1847. if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);
  1848. };
  1849. /***/ }),
  1850. /***/ 8480:
  1851. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  1852. var internalObjectKeys = __webpack_require__(1828);
  1853. var enumBugKeys = __webpack_require__(8727);
  1854. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  1855. // `Object.getOwnPropertyNames` method
  1856. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  1857. // eslint-disable-next-line es/no-object-getownpropertynames -- safe
  1858. exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  1859. return internalObjectKeys(O, hiddenKeys);
  1860. };
  1861. /***/ }),
  1862. /***/ 3717:
  1863. /***/ ((__unused_webpack_module, exports) => {
  1864. // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
  1865. exports.f = Object.getOwnPropertySymbols;
  1866. /***/ }),
  1867. /***/ 2787:
  1868. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1869. var hasOwn = __webpack_require__(9297);
  1870. var isCallable = __webpack_require__(4901);
  1871. var toObject = __webpack_require__(8981);
  1872. var sharedKey = __webpack_require__(6119);
  1873. var CORRECT_PROTOTYPE_GETTER = __webpack_require__(2211);
  1874. var IE_PROTO = sharedKey('IE_PROTO');
  1875. var $Object = Object;
  1876. var ObjectPrototype = $Object.prototype;
  1877. // `Object.getPrototypeOf` method
  1878. // https://tc39.es/ecma262/#sec-object.getprototypeof
  1879. // eslint-disable-next-line es/no-object-getprototypeof -- safe
  1880. module.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
  1881. var object = toObject(O);
  1882. if (hasOwn(object, IE_PROTO)) return object[IE_PROTO];
  1883. var constructor = object.constructor;
  1884. if (isCallable(constructor) && object instanceof constructor) {
  1885. return constructor.prototype;
  1886. } return object instanceof $Object ? ObjectPrototype : null;
  1887. };
  1888. /***/ }),
  1889. /***/ 1625:
  1890. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1891. var uncurryThis = __webpack_require__(9504);
  1892. module.exports = uncurryThis({}.isPrototypeOf);
  1893. /***/ }),
  1894. /***/ 1828:
  1895. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1896. var uncurryThis = __webpack_require__(9504);
  1897. var hasOwn = __webpack_require__(9297);
  1898. var toIndexedObject = __webpack_require__(5397);
  1899. var indexOf = (__webpack_require__(9617).indexOf);
  1900. var hiddenKeys = __webpack_require__(421);
  1901. var push = uncurryThis([].push);
  1902. module.exports = function (object, names) {
  1903. var O = toIndexedObject(object);
  1904. var i = 0;
  1905. var result = [];
  1906. var key;
  1907. for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);
  1908. // Don't enum bug & hidden keys
  1909. while (names.length > i) if (hasOwn(O, key = names[i++])) {
  1910. ~indexOf(result, key) || push(result, key);
  1911. }
  1912. return result;
  1913. };
  1914. /***/ }),
  1915. /***/ 1072:
  1916. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1917. var internalObjectKeys = __webpack_require__(1828);
  1918. var enumBugKeys = __webpack_require__(8727);
  1919. // `Object.keys` method
  1920. // https://tc39.es/ecma262/#sec-object.keys
  1921. // eslint-disable-next-line es/no-object-keys -- safe
  1922. module.exports = Object.keys || function keys(O) {
  1923. return internalObjectKeys(O, enumBugKeys);
  1924. };
  1925. /***/ }),
  1926. /***/ 8773:
  1927. /***/ ((__unused_webpack_module, exports) => {
  1928. var $propertyIsEnumerable = {}.propertyIsEnumerable;
  1929. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  1930. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  1931. // Nashorn ~ JDK8 bug
  1932. var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
  1933. // `Object.prototype.propertyIsEnumerable` method implementation
  1934. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  1935. exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
  1936. var descriptor = getOwnPropertyDescriptor(this, V);
  1937. return !!descriptor && descriptor.enumerable;
  1938. } : $propertyIsEnumerable;
  1939. /***/ }),
  1940. /***/ 2967:
  1941. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1942. /* eslint-disable no-proto -- safe */
  1943. var uncurryThisAccessor = __webpack_require__(6706);
  1944. var isObject = __webpack_require__(34);
  1945. var requireObjectCoercible = __webpack_require__(7750);
  1946. var aPossiblePrototype = __webpack_require__(3506);
  1947. // `Object.setPrototypeOf` method
  1948. // https://tc39.es/ecma262/#sec-object.setprototypeof
  1949. // Works with __proto__ only. Old v8 can't work with null proto objects.
  1950. // eslint-disable-next-line es/no-object-setprototypeof -- safe
  1951. module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
  1952. var CORRECT_SETTER = false;
  1953. var test = {};
  1954. var setter;
  1955. try {
  1956. setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set');
  1957. setter(test, []);
  1958. CORRECT_SETTER = test instanceof Array;
  1959. } catch (error) { /* empty */ }
  1960. return function setPrototypeOf(O, proto) {
  1961. requireObjectCoercible(O);
  1962. aPossiblePrototype(proto);
  1963. if (!isObject(O)) return O;
  1964. if (CORRECT_SETTER) setter(O, proto);
  1965. else O.__proto__ = proto;
  1966. return O;
  1967. };
  1968. }() : undefined);
  1969. /***/ }),
  1970. /***/ 4270:
  1971. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1972. var call = __webpack_require__(9565);
  1973. var isCallable = __webpack_require__(4901);
  1974. var isObject = __webpack_require__(34);
  1975. var $TypeError = TypeError;
  1976. // `OrdinaryToPrimitive` abstract operation
  1977. // https://tc39.es/ecma262/#sec-ordinarytoprimitive
  1978. module.exports = function (input, pref) {
  1979. var fn, val;
  1980. if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
  1981. if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;
  1982. if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
  1983. throw new $TypeError("Can't convert object to primitive value");
  1984. };
  1985. /***/ }),
  1986. /***/ 5031:
  1987. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  1988. var getBuiltIn = __webpack_require__(7751);
  1989. var uncurryThis = __webpack_require__(9504);
  1990. var getOwnPropertyNamesModule = __webpack_require__(8480);
  1991. var getOwnPropertySymbolsModule = __webpack_require__(3717);
  1992. var anObject = __webpack_require__(8551);
  1993. var concat = uncurryThis([].concat);
  1994. // all object keys, includes non-enumerable and symbols
  1995. module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  1996. var keys = getOwnPropertyNamesModule.f(anObject(it));
  1997. var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  1998. return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
  1999. };
  2000. /***/ }),
  2001. /***/ 7979:
  2002. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2003. var anObject = __webpack_require__(8551);
  2004. // `RegExp.prototype.flags` getter implementation
  2005. // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
  2006. module.exports = function () {
  2007. var that = anObject(this);
  2008. var result = '';
  2009. if (that.hasIndices) result += 'd';
  2010. if (that.global) result += 'g';
  2011. if (that.ignoreCase) result += 'i';
  2012. if (that.multiline) result += 'm';
  2013. if (that.dotAll) result += 's';
  2014. if (that.unicode) result += 'u';
  2015. if (that.unicodeSets) result += 'v';
  2016. if (that.sticky) result += 'y';
  2017. return result;
  2018. };
  2019. /***/ }),
  2020. /***/ 7750:
  2021. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2022. var isNullOrUndefined = __webpack_require__(4117);
  2023. var $TypeError = TypeError;
  2024. // `RequireObjectCoercible` abstract operation
  2025. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  2026. module.exports = function (it) {
  2027. if (isNullOrUndefined(it)) throw new $TypeError("Can't call method on " + it);
  2028. return it;
  2029. };
  2030. /***/ }),
  2031. /***/ 9286:
  2032. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2033. var SetHelpers = __webpack_require__(4402);
  2034. var iterate = __webpack_require__(8469);
  2035. var Set = SetHelpers.Set;
  2036. var add = SetHelpers.add;
  2037. module.exports = function (set) {
  2038. var result = new Set();
  2039. iterate(set, function (it) {
  2040. add(result, it);
  2041. });
  2042. return result;
  2043. };
  2044. /***/ }),
  2045. /***/ 3440:
  2046. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2047. var aSet = __webpack_require__(7080);
  2048. var SetHelpers = __webpack_require__(4402);
  2049. var clone = __webpack_require__(9286);
  2050. var size = __webpack_require__(5170);
  2051. var getSetRecord = __webpack_require__(3789);
  2052. var iterateSet = __webpack_require__(8469);
  2053. var iterateSimple = __webpack_require__(507);
  2054. var has = SetHelpers.has;
  2055. var remove = SetHelpers.remove;
  2056. // `Set.prototype.difference` method
  2057. // https://github.com/tc39/proposal-set-methods
  2058. module.exports = function difference(other) {
  2059. var O = aSet(this);
  2060. var otherRec = getSetRecord(other);
  2061. var result = clone(O);
  2062. if (size(O) <= otherRec.size) iterateSet(O, function (e) {
  2063. if (otherRec.includes(e)) remove(result, e);
  2064. });
  2065. else iterateSimple(otherRec.getIterator(), function (e) {
  2066. if (has(O, e)) remove(result, e);
  2067. });
  2068. return result;
  2069. };
  2070. /***/ }),
  2071. /***/ 4402:
  2072. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2073. var uncurryThis = __webpack_require__(9504);
  2074. // eslint-disable-next-line es/no-set -- safe
  2075. var SetPrototype = Set.prototype;
  2076. module.exports = {
  2077. // eslint-disable-next-line es/no-set -- safe
  2078. Set: Set,
  2079. add: uncurryThis(SetPrototype.add),
  2080. has: uncurryThis(SetPrototype.has),
  2081. remove: uncurryThis(SetPrototype['delete']),
  2082. proto: SetPrototype
  2083. };
  2084. /***/ }),
  2085. /***/ 8750:
  2086. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2087. var aSet = __webpack_require__(7080);
  2088. var SetHelpers = __webpack_require__(4402);
  2089. var size = __webpack_require__(5170);
  2090. var getSetRecord = __webpack_require__(3789);
  2091. var iterateSet = __webpack_require__(8469);
  2092. var iterateSimple = __webpack_require__(507);
  2093. var Set = SetHelpers.Set;
  2094. var add = SetHelpers.add;
  2095. var has = SetHelpers.has;
  2096. // `Set.prototype.intersection` method
  2097. // https://github.com/tc39/proposal-set-methods
  2098. module.exports = function intersection(other) {
  2099. var O = aSet(this);
  2100. var otherRec = getSetRecord(other);
  2101. var result = new Set();
  2102. if (size(O) > otherRec.size) {
  2103. iterateSimple(otherRec.getIterator(), function (e) {
  2104. if (has(O, e)) add(result, e);
  2105. });
  2106. } else {
  2107. iterateSet(O, function (e) {
  2108. if (otherRec.includes(e)) add(result, e);
  2109. });
  2110. }
  2111. return result;
  2112. };
  2113. /***/ }),
  2114. /***/ 4449:
  2115. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2116. var aSet = __webpack_require__(7080);
  2117. var has = (__webpack_require__(4402).has);
  2118. var size = __webpack_require__(5170);
  2119. var getSetRecord = __webpack_require__(3789);
  2120. var iterateSet = __webpack_require__(8469);
  2121. var iterateSimple = __webpack_require__(507);
  2122. var iteratorClose = __webpack_require__(9539);
  2123. // `Set.prototype.isDisjointFrom` method
  2124. // https://tc39.github.io/proposal-set-methods/#Set.prototype.isDisjointFrom
  2125. module.exports = function isDisjointFrom(other) {
  2126. var O = aSet(this);
  2127. var otherRec = getSetRecord(other);
  2128. if (size(O) <= otherRec.size) return iterateSet(O, function (e) {
  2129. if (otherRec.includes(e)) return false;
  2130. }, true) !== false;
  2131. var iterator = otherRec.getIterator();
  2132. return iterateSimple(iterator, function (e) {
  2133. if (has(O, e)) return iteratorClose(iterator, 'normal', false);
  2134. }) !== false;
  2135. };
  2136. /***/ }),
  2137. /***/ 3838:
  2138. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2139. var aSet = __webpack_require__(7080);
  2140. var size = __webpack_require__(5170);
  2141. var iterate = __webpack_require__(8469);
  2142. var getSetRecord = __webpack_require__(3789);
  2143. // `Set.prototype.isSubsetOf` method
  2144. // https://tc39.github.io/proposal-set-methods/#Set.prototype.isSubsetOf
  2145. module.exports = function isSubsetOf(other) {
  2146. var O = aSet(this);
  2147. var otherRec = getSetRecord(other);
  2148. if (size(O) > otherRec.size) return false;
  2149. return iterate(O, function (e) {
  2150. if (!otherRec.includes(e)) return false;
  2151. }, true) !== false;
  2152. };
  2153. /***/ }),
  2154. /***/ 8527:
  2155. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2156. var aSet = __webpack_require__(7080);
  2157. var has = (__webpack_require__(4402).has);
  2158. var size = __webpack_require__(5170);
  2159. var getSetRecord = __webpack_require__(3789);
  2160. var iterateSimple = __webpack_require__(507);
  2161. var iteratorClose = __webpack_require__(9539);
  2162. // `Set.prototype.isSupersetOf` method
  2163. // https://tc39.github.io/proposal-set-methods/#Set.prototype.isSupersetOf
  2164. module.exports = function isSupersetOf(other) {
  2165. var O = aSet(this);
  2166. var otherRec = getSetRecord(other);
  2167. if (size(O) < otherRec.size) return false;
  2168. var iterator = otherRec.getIterator();
  2169. return iterateSimple(iterator, function (e) {
  2170. if (!has(O, e)) return iteratorClose(iterator, 'normal', false);
  2171. }) !== false;
  2172. };
  2173. /***/ }),
  2174. /***/ 8469:
  2175. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2176. var uncurryThis = __webpack_require__(9504);
  2177. var iterateSimple = __webpack_require__(507);
  2178. var SetHelpers = __webpack_require__(4402);
  2179. var Set = SetHelpers.Set;
  2180. var SetPrototype = SetHelpers.proto;
  2181. var forEach = uncurryThis(SetPrototype.forEach);
  2182. var keys = uncurryThis(SetPrototype.keys);
  2183. var next = keys(new Set()).next;
  2184. module.exports = function (set, fn, interruptible) {
  2185. return interruptible ? iterateSimple({ iterator: keys(set), next: next }, fn) : forEach(set, fn);
  2186. };
  2187. /***/ }),
  2188. /***/ 4916:
  2189. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2190. var getBuiltIn = __webpack_require__(7751);
  2191. var createSetLike = function (size) {
  2192. return {
  2193. size: size,
  2194. has: function () {
  2195. return false;
  2196. },
  2197. keys: function () {
  2198. return {
  2199. next: function () {
  2200. return { done: true };
  2201. }
  2202. };
  2203. }
  2204. };
  2205. };
  2206. module.exports = function (name) {
  2207. var Set = getBuiltIn('Set');
  2208. try {
  2209. new Set()[name](createSetLike(0));
  2210. try {
  2211. // late spec change, early WebKit ~ Safari 17.0 beta implementation does not pass it
  2212. // https://github.com/tc39/proposal-set-methods/pull/88
  2213. new Set()[name](createSetLike(-1));
  2214. return false;
  2215. } catch (error2) {
  2216. return true;
  2217. }
  2218. } catch (error) {
  2219. return false;
  2220. }
  2221. };
  2222. /***/ }),
  2223. /***/ 5170:
  2224. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2225. var uncurryThisAccessor = __webpack_require__(6706);
  2226. var SetHelpers = __webpack_require__(4402);
  2227. module.exports = uncurryThisAccessor(SetHelpers.proto, 'size', 'get') || function (set) {
  2228. return set.size;
  2229. };
  2230. /***/ }),
  2231. /***/ 3650:
  2232. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2233. var aSet = __webpack_require__(7080);
  2234. var SetHelpers = __webpack_require__(4402);
  2235. var clone = __webpack_require__(9286);
  2236. var getSetRecord = __webpack_require__(3789);
  2237. var iterateSimple = __webpack_require__(507);
  2238. var add = SetHelpers.add;
  2239. var has = SetHelpers.has;
  2240. var remove = SetHelpers.remove;
  2241. // `Set.prototype.symmetricDifference` method
  2242. // https://github.com/tc39/proposal-set-methods
  2243. module.exports = function symmetricDifference(other) {
  2244. var O = aSet(this);
  2245. var keysIter = getSetRecord(other).getIterator();
  2246. var result = clone(O);
  2247. iterateSimple(keysIter, function (e) {
  2248. if (has(O, e)) remove(result, e);
  2249. else add(result, e);
  2250. });
  2251. return result;
  2252. };
  2253. /***/ }),
  2254. /***/ 4204:
  2255. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2256. var aSet = __webpack_require__(7080);
  2257. var add = (__webpack_require__(4402).add);
  2258. var clone = __webpack_require__(9286);
  2259. var getSetRecord = __webpack_require__(3789);
  2260. var iterateSimple = __webpack_require__(507);
  2261. // `Set.prototype.union` method
  2262. // https://github.com/tc39/proposal-set-methods
  2263. module.exports = function union(other) {
  2264. var O = aSet(this);
  2265. var keysIter = getSetRecord(other).getIterator();
  2266. var result = clone(O);
  2267. iterateSimple(keysIter, function (it) {
  2268. add(result, it);
  2269. });
  2270. return result;
  2271. };
  2272. /***/ }),
  2273. /***/ 6119:
  2274. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2275. var shared = __webpack_require__(5745);
  2276. var uid = __webpack_require__(3392);
  2277. var keys = shared('keys');
  2278. module.exports = function (key) {
  2279. return keys[key] || (keys[key] = uid(key));
  2280. };
  2281. /***/ }),
  2282. /***/ 7629:
  2283. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2284. var IS_PURE = __webpack_require__(6395);
  2285. var globalThis = __webpack_require__(4576);
  2286. var defineGlobalProperty = __webpack_require__(9433);
  2287. var SHARED = '__core-js_shared__';
  2288. var store = module.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {});
  2289. (store.versions || (store.versions = [])).push({
  2290. version: '3.38.1',
  2291. mode: IS_PURE ? 'pure' : 'global',
  2292. copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
  2293. license: 'https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE',
  2294. source: 'https://github.com/zloirock/core-js'
  2295. });
  2296. /***/ }),
  2297. /***/ 5745:
  2298. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2299. var store = __webpack_require__(7629);
  2300. module.exports = function (key, value) {
  2301. return store[key] || (store[key] = value || {});
  2302. };
  2303. /***/ }),
  2304. /***/ 1548:
  2305. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2306. var globalThis = __webpack_require__(4576);
  2307. var fails = __webpack_require__(9039);
  2308. var V8 = __webpack_require__(9519);
  2309. var ENVIRONMENT = __webpack_require__(4215);
  2310. var structuredClone = globalThis.structuredClone;
  2311. module.exports = !!structuredClone && !fails(function () {
  2312. // prevent V8 ArrayBufferDetaching protector cell invalidation and performance degradation
  2313. // https://github.com/zloirock/core-js/issues/679
  2314. if ((ENVIRONMENT === 'DENO' && V8 > 92) || (ENVIRONMENT === 'NODE' && V8 > 94) || (ENVIRONMENT === 'BROWSER' && V8 > 97)) return false;
  2315. var buffer = new ArrayBuffer(8);
  2316. var clone = structuredClone(buffer, { transfer: [buffer] });
  2317. return buffer.byteLength !== 0 || clone.byteLength !== 8;
  2318. });
  2319. /***/ }),
  2320. /***/ 4495:
  2321. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2322. /* eslint-disable es/no-symbol -- required for testing */
  2323. var V8_VERSION = __webpack_require__(9519);
  2324. var fails = __webpack_require__(9039);
  2325. var globalThis = __webpack_require__(4576);
  2326. var $String = globalThis.String;
  2327. // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
  2328. module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
  2329. var symbol = Symbol('symbol detection');
  2330. // Chrome 38 Symbol has incorrect toString conversion
  2331. // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
  2332. // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
  2333. // of course, fail.
  2334. return !$String(symbol) || !(Object(symbol) instanceof Symbol) ||
  2335. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  2336. !Symbol.sham && V8_VERSION && V8_VERSION < 41;
  2337. });
  2338. /***/ }),
  2339. /***/ 5610:
  2340. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2341. var toIntegerOrInfinity = __webpack_require__(1291);
  2342. var max = Math.max;
  2343. var min = Math.min;
  2344. // Helper for a popular repeating case of the spec:
  2345. // Let integer be ? ToInteger(index).
  2346. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  2347. module.exports = function (index, length) {
  2348. var integer = toIntegerOrInfinity(index);
  2349. return integer < 0 ? max(integer + length, 0) : min(integer, length);
  2350. };
  2351. /***/ }),
  2352. /***/ 5854:
  2353. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2354. var toPrimitive = __webpack_require__(2777);
  2355. var $TypeError = TypeError;
  2356. // `ToBigInt` abstract operation
  2357. // https://tc39.es/ecma262/#sec-tobigint
  2358. module.exports = function (argument) {
  2359. var prim = toPrimitive(argument, 'number');
  2360. if (typeof prim == 'number') throw new $TypeError("Can't convert number to bigint");
  2361. // eslint-disable-next-line es/no-bigint -- safe
  2362. return BigInt(prim);
  2363. };
  2364. /***/ }),
  2365. /***/ 7696:
  2366. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2367. var toIntegerOrInfinity = __webpack_require__(1291);
  2368. var toLength = __webpack_require__(8014);
  2369. var $RangeError = RangeError;
  2370. // `ToIndex` abstract operation
  2371. // https://tc39.es/ecma262/#sec-toindex
  2372. module.exports = function (it) {
  2373. if (it === undefined) return 0;
  2374. var number = toIntegerOrInfinity(it);
  2375. var length = toLength(number);
  2376. if (number !== length) throw new $RangeError('Wrong length or index');
  2377. return length;
  2378. };
  2379. /***/ }),
  2380. /***/ 5397:
  2381. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2382. // toObject with fallback for non-array-like ES3 strings
  2383. var IndexedObject = __webpack_require__(7055);
  2384. var requireObjectCoercible = __webpack_require__(7750);
  2385. module.exports = function (it) {
  2386. return IndexedObject(requireObjectCoercible(it));
  2387. };
  2388. /***/ }),
  2389. /***/ 1291:
  2390. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2391. var trunc = __webpack_require__(741);
  2392. // `ToIntegerOrInfinity` abstract operation
  2393. // https://tc39.es/ecma262/#sec-tointegerorinfinity
  2394. module.exports = function (argument) {
  2395. var number = +argument;
  2396. // eslint-disable-next-line no-self-compare -- NaN check
  2397. return number !== number || number === 0 ? 0 : trunc(number);
  2398. };
  2399. /***/ }),
  2400. /***/ 8014:
  2401. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2402. var toIntegerOrInfinity = __webpack_require__(1291);
  2403. var min = Math.min;
  2404. // `ToLength` abstract operation
  2405. // https://tc39.es/ecma262/#sec-tolength
  2406. module.exports = function (argument) {
  2407. var len = toIntegerOrInfinity(argument);
  2408. return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  2409. };
  2410. /***/ }),
  2411. /***/ 8981:
  2412. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2413. var requireObjectCoercible = __webpack_require__(7750);
  2414. var $Object = Object;
  2415. // `ToObject` abstract operation
  2416. // https://tc39.es/ecma262/#sec-toobject
  2417. module.exports = function (argument) {
  2418. return $Object(requireObjectCoercible(argument));
  2419. };
  2420. /***/ }),
  2421. /***/ 2777:
  2422. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2423. var call = __webpack_require__(9565);
  2424. var isObject = __webpack_require__(34);
  2425. var isSymbol = __webpack_require__(757);
  2426. var getMethod = __webpack_require__(5966);
  2427. var ordinaryToPrimitive = __webpack_require__(4270);
  2428. var wellKnownSymbol = __webpack_require__(8227);
  2429. var $TypeError = TypeError;
  2430. var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
  2431. // `ToPrimitive` abstract operation
  2432. // https://tc39.es/ecma262/#sec-toprimitive
  2433. module.exports = function (input, pref) {
  2434. if (!isObject(input) || isSymbol(input)) return input;
  2435. var exoticToPrim = getMethod(input, TO_PRIMITIVE);
  2436. var result;
  2437. if (exoticToPrim) {
  2438. if (pref === undefined) pref = 'default';
  2439. result = call(exoticToPrim, input, pref);
  2440. if (!isObject(result) || isSymbol(result)) return result;
  2441. throw new $TypeError("Can't convert object to primitive value");
  2442. }
  2443. if (pref === undefined) pref = 'number';
  2444. return ordinaryToPrimitive(input, pref);
  2445. };
  2446. /***/ }),
  2447. /***/ 6969:
  2448. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2449. var toPrimitive = __webpack_require__(2777);
  2450. var isSymbol = __webpack_require__(757);
  2451. // `ToPropertyKey` abstract operation
  2452. // https://tc39.es/ecma262/#sec-topropertykey
  2453. module.exports = function (argument) {
  2454. var key = toPrimitive(argument, 'string');
  2455. return isSymbol(key) ? key : key + '';
  2456. };
  2457. /***/ }),
  2458. /***/ 2140:
  2459. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2460. var wellKnownSymbol = __webpack_require__(8227);
  2461. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  2462. var test = {};
  2463. test[TO_STRING_TAG] = 'z';
  2464. module.exports = String(test) === '[object z]';
  2465. /***/ }),
  2466. /***/ 655:
  2467. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2468. var classof = __webpack_require__(6955);
  2469. var $String = String;
  2470. module.exports = function (argument) {
  2471. if (classof(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
  2472. return $String(argument);
  2473. };
  2474. /***/ }),
  2475. /***/ 6823:
  2476. /***/ ((module) => {
  2477. var $String = String;
  2478. module.exports = function (argument) {
  2479. try {
  2480. return $String(argument);
  2481. } catch (error) {
  2482. return 'Object';
  2483. }
  2484. };
  2485. /***/ }),
  2486. /***/ 3392:
  2487. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2488. var uncurryThis = __webpack_require__(9504);
  2489. var id = 0;
  2490. var postfix = Math.random();
  2491. var toString = uncurryThis(1.0.toString);
  2492. module.exports = function (key) {
  2493. return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
  2494. };
  2495. /***/ }),
  2496. /***/ 7040:
  2497. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2498. /* eslint-disable es/no-symbol -- required for testing */
  2499. var NATIVE_SYMBOL = __webpack_require__(4495);
  2500. module.exports = NATIVE_SYMBOL
  2501. && !Symbol.sham
  2502. && typeof Symbol.iterator == 'symbol';
  2503. /***/ }),
  2504. /***/ 8686:
  2505. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2506. var DESCRIPTORS = __webpack_require__(3724);
  2507. var fails = __webpack_require__(9039);
  2508. // V8 ~ Chrome 36-
  2509. // https://bugs.chromium.org/p/v8/issues/detail?id=3334
  2510. module.exports = DESCRIPTORS && fails(function () {
  2511. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  2512. return Object.defineProperty(function () { /* empty */ }, 'prototype', {
  2513. value: 42,
  2514. writable: false
  2515. }).prototype !== 42;
  2516. });
  2517. /***/ }),
  2518. /***/ 2812:
  2519. /***/ ((module) => {
  2520. var $TypeError = TypeError;
  2521. module.exports = function (passed, required) {
  2522. if (passed < required) throw new $TypeError('Not enough arguments');
  2523. return passed;
  2524. };
  2525. /***/ }),
  2526. /***/ 8622:
  2527. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2528. var globalThis = __webpack_require__(4576);
  2529. var isCallable = __webpack_require__(4901);
  2530. var WeakMap = globalThis.WeakMap;
  2531. module.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap));
  2532. /***/ }),
  2533. /***/ 8227:
  2534. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2535. var globalThis = __webpack_require__(4576);
  2536. var shared = __webpack_require__(5745);
  2537. var hasOwn = __webpack_require__(9297);
  2538. var uid = __webpack_require__(3392);
  2539. var NATIVE_SYMBOL = __webpack_require__(4495);
  2540. var USE_SYMBOL_AS_UID = __webpack_require__(7040);
  2541. var Symbol = globalThis.Symbol;
  2542. var WellKnownSymbolsStore = shared('wks');
  2543. var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid;
  2544. module.exports = function (name) {
  2545. if (!hasOwn(WellKnownSymbolsStore, name)) {
  2546. WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name)
  2547. ? Symbol[name]
  2548. : createWellKnownSymbol('Symbol.' + name);
  2549. } return WellKnownSymbolsStore[name];
  2550. };
  2551. /***/ }),
  2552. /***/ 6573:
  2553. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2554. var DESCRIPTORS = __webpack_require__(3724);
  2555. var defineBuiltInAccessor = __webpack_require__(2106);
  2556. var isDetached = __webpack_require__(3238);
  2557. var ArrayBufferPrototype = ArrayBuffer.prototype;
  2558. if (DESCRIPTORS && !('detached' in ArrayBufferPrototype)) {
  2559. defineBuiltInAccessor(ArrayBufferPrototype, 'detached', {
  2560. configurable: true,
  2561. get: function detached() {
  2562. return isDetached(this);
  2563. }
  2564. });
  2565. }
  2566. /***/ }),
  2567. /***/ 7936:
  2568. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2569. var $ = __webpack_require__(6518);
  2570. var $transfer = __webpack_require__(5636);
  2571. // `ArrayBuffer.prototype.transferToFixedLength` method
  2572. // https://tc39.es/proposal-arraybuffer-transfer/#sec-arraybuffer.prototype.transfertofixedlength
  2573. if ($transfer) $({ target: 'ArrayBuffer', proto: true }, {
  2574. transferToFixedLength: function transferToFixedLength() {
  2575. return $transfer(this, arguments.length ? arguments[0] : undefined, false);
  2576. }
  2577. });
  2578. /***/ }),
  2579. /***/ 8100:
  2580. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2581. var $ = __webpack_require__(6518);
  2582. var $transfer = __webpack_require__(5636);
  2583. // `ArrayBuffer.prototype.transfer` method
  2584. // https://tc39.es/proposal-arraybuffer-transfer/#sec-arraybuffer.prototype.transfer
  2585. if ($transfer) $({ target: 'ArrayBuffer', proto: true }, {
  2586. transfer: function transfer() {
  2587. return $transfer(this, arguments.length ? arguments[0] : undefined, true);
  2588. }
  2589. });
  2590. /***/ }),
  2591. /***/ 4114:
  2592. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2593. var $ = __webpack_require__(6518);
  2594. var toObject = __webpack_require__(8981);
  2595. var lengthOfArrayLike = __webpack_require__(6198);
  2596. var setArrayLength = __webpack_require__(4527);
  2597. var doesNotExceedSafeInteger = __webpack_require__(6837);
  2598. var fails = __webpack_require__(9039);
  2599. var INCORRECT_TO_LENGTH = fails(function () {
  2600. return [].push.call({ length: 0x100000000 }, 1) !== 4294967297;
  2601. });
  2602. // V8 <= 121 and Safari <= 15.4; FF < 23 throws InternalError
  2603. // https://bugs.chromium.org/p/v8/issues/detail?id=12681
  2604. var properErrorOnNonWritableLength = function () {
  2605. try {
  2606. // eslint-disable-next-line es/no-object-defineproperty -- safe
  2607. Object.defineProperty([], 'length', { writable: false }).push();
  2608. } catch (error) {
  2609. return error instanceof TypeError;
  2610. }
  2611. };
  2612. var FORCED = INCORRECT_TO_LENGTH || !properErrorOnNonWritableLength();
  2613. // `Array.prototype.push` method
  2614. // https://tc39.es/ecma262/#sec-array.prototype.push
  2615. $({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
  2616. // eslint-disable-next-line no-unused-vars -- required for `.length`
  2617. push: function push(item) {
  2618. var O = toObject(this);
  2619. var len = lengthOfArrayLike(O);
  2620. var argCount = arguments.length;
  2621. doesNotExceedSafeInteger(len + argCount);
  2622. for (var i = 0; i < argCount; i++) {
  2623. O[len] = arguments[i];
  2624. len++;
  2625. }
  2626. setArrayLength(O, len);
  2627. return len;
  2628. }
  2629. });
  2630. /***/ }),
  2631. /***/ 4628:
  2632. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2633. var $ = __webpack_require__(6518);
  2634. var newPromiseCapabilityModule = __webpack_require__(6043);
  2635. // `Promise.withResolvers` method
  2636. // https://github.com/tc39/proposal-promise-with-resolvers
  2637. $({ target: 'Promise', stat: true }, {
  2638. withResolvers: function withResolvers() {
  2639. var promiseCapability = newPromiseCapabilityModule.f(this);
  2640. return {
  2641. promise: promiseCapability.promise,
  2642. resolve: promiseCapability.resolve,
  2643. reject: promiseCapability.reject
  2644. };
  2645. }
  2646. });
  2647. /***/ }),
  2648. /***/ 9479:
  2649. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2650. var globalThis = __webpack_require__(4576);
  2651. var DESCRIPTORS = __webpack_require__(3724);
  2652. var defineBuiltInAccessor = __webpack_require__(2106);
  2653. var regExpFlags = __webpack_require__(7979);
  2654. var fails = __webpack_require__(9039);
  2655. // babel-minify and Closure Compiler transpiles RegExp('.', 'd') -> /./d and it causes SyntaxError
  2656. var RegExp = globalThis.RegExp;
  2657. var RegExpPrototype = RegExp.prototype;
  2658. var FORCED = DESCRIPTORS && fails(function () {
  2659. var INDICES_SUPPORT = true;
  2660. try {
  2661. RegExp('.', 'd');
  2662. } catch (error) {
  2663. INDICES_SUPPORT = false;
  2664. }
  2665. var O = {};
  2666. // modern V8 bug
  2667. var calls = '';
  2668. var expected = INDICES_SUPPORT ? 'dgimsy' : 'gimsy';
  2669. var addGetter = function (key, chr) {
  2670. // eslint-disable-next-line es/no-object-defineproperty -- safe
  2671. Object.defineProperty(O, key, { get: function () {
  2672. calls += chr;
  2673. return true;
  2674. } });
  2675. };
  2676. var pairs = {
  2677. dotAll: 's',
  2678. global: 'g',
  2679. ignoreCase: 'i',
  2680. multiline: 'm',
  2681. sticky: 'y'
  2682. };
  2683. if (INDICES_SUPPORT) pairs.hasIndices = 'd';
  2684. for (var key in pairs) addGetter(key, pairs[key]);
  2685. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  2686. var result = Object.getOwnPropertyDescriptor(RegExpPrototype, 'flags').get.call(O);
  2687. return result !== expected || calls !== expected;
  2688. });
  2689. // `RegExp.prototype.flags` getter
  2690. // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
  2691. if (FORCED) defineBuiltInAccessor(RegExpPrototype, 'flags', {
  2692. configurable: true,
  2693. get: regExpFlags
  2694. });
  2695. /***/ }),
  2696. /***/ 7642:
  2697. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2698. var $ = __webpack_require__(6518);
  2699. var difference = __webpack_require__(3440);
  2700. var setMethodAcceptSetLike = __webpack_require__(4916);
  2701. // `Set.prototype.difference` method
  2702. // https://github.com/tc39/proposal-set-methods
  2703. $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('difference') }, {
  2704. difference: difference
  2705. });
  2706. /***/ }),
  2707. /***/ 8004:
  2708. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2709. var $ = __webpack_require__(6518);
  2710. var fails = __webpack_require__(9039);
  2711. var intersection = __webpack_require__(8750);
  2712. var setMethodAcceptSetLike = __webpack_require__(4916);
  2713. var INCORRECT = !setMethodAcceptSetLike('intersection') || fails(function () {
  2714. // eslint-disable-next-line es/no-array-from, es/no-set -- testing
  2715. return String(Array.from(new Set([1, 2, 3]).intersection(new Set([3, 2])))) !== '3,2';
  2716. });
  2717. // `Set.prototype.intersection` method
  2718. // https://github.com/tc39/proposal-set-methods
  2719. $({ target: 'Set', proto: true, real: true, forced: INCORRECT }, {
  2720. intersection: intersection
  2721. });
  2722. /***/ }),
  2723. /***/ 3853:
  2724. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2725. var $ = __webpack_require__(6518);
  2726. var isDisjointFrom = __webpack_require__(4449);
  2727. var setMethodAcceptSetLike = __webpack_require__(4916);
  2728. // `Set.prototype.isDisjointFrom` method
  2729. // https://github.com/tc39/proposal-set-methods
  2730. $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('isDisjointFrom') }, {
  2731. isDisjointFrom: isDisjointFrom
  2732. });
  2733. /***/ }),
  2734. /***/ 5876:
  2735. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2736. var $ = __webpack_require__(6518);
  2737. var isSubsetOf = __webpack_require__(3838);
  2738. var setMethodAcceptSetLike = __webpack_require__(4916);
  2739. // `Set.prototype.isSubsetOf` method
  2740. // https://github.com/tc39/proposal-set-methods
  2741. $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('isSubsetOf') }, {
  2742. isSubsetOf: isSubsetOf
  2743. });
  2744. /***/ }),
  2745. /***/ 2475:
  2746. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2747. var $ = __webpack_require__(6518);
  2748. var isSupersetOf = __webpack_require__(8527);
  2749. var setMethodAcceptSetLike = __webpack_require__(4916);
  2750. // `Set.prototype.isSupersetOf` method
  2751. // https://github.com/tc39/proposal-set-methods
  2752. $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('isSupersetOf') }, {
  2753. isSupersetOf: isSupersetOf
  2754. });
  2755. /***/ }),
  2756. /***/ 5024:
  2757. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2758. var $ = __webpack_require__(6518);
  2759. var symmetricDifference = __webpack_require__(3650);
  2760. var setMethodAcceptSetLike = __webpack_require__(4916);
  2761. // `Set.prototype.symmetricDifference` method
  2762. // https://github.com/tc39/proposal-set-methods
  2763. $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('symmetricDifference') }, {
  2764. symmetricDifference: symmetricDifference
  2765. });
  2766. /***/ }),
  2767. /***/ 1698:
  2768. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2769. var $ = __webpack_require__(6518);
  2770. var union = __webpack_require__(4204);
  2771. var setMethodAcceptSetLike = __webpack_require__(4916);
  2772. // `Set.prototype.union` method
  2773. // https://github.com/tc39/proposal-set-methods
  2774. $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('union') }, {
  2775. union: union
  2776. });
  2777. /***/ }),
  2778. /***/ 7467:
  2779. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2780. var arrayToReversed = __webpack_require__(7628);
  2781. var ArrayBufferViewCore = __webpack_require__(4644);
  2782. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  2783. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  2784. var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor;
  2785. // `%TypedArray%.prototype.toReversed` method
  2786. // https://tc39.es/ecma262/#sec-%typedarray%.prototype.toreversed
  2787. exportTypedArrayMethod('toReversed', function toReversed() {
  2788. return arrayToReversed(aTypedArray(this), getTypedArrayConstructor(this));
  2789. });
  2790. /***/ }),
  2791. /***/ 4732:
  2792. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2793. var ArrayBufferViewCore = __webpack_require__(4644);
  2794. var uncurryThis = __webpack_require__(9504);
  2795. var aCallable = __webpack_require__(9306);
  2796. var arrayFromConstructorAndList = __webpack_require__(5370);
  2797. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  2798. var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor;
  2799. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  2800. var sort = uncurryThis(ArrayBufferViewCore.TypedArrayPrototype.sort);
  2801. // `%TypedArray%.prototype.toSorted` method
  2802. // https://tc39.es/ecma262/#sec-%typedarray%.prototype.tosorted
  2803. exportTypedArrayMethod('toSorted', function toSorted(compareFn) {
  2804. if (compareFn !== undefined) aCallable(compareFn);
  2805. var O = aTypedArray(this);
  2806. var A = arrayFromConstructorAndList(getTypedArrayConstructor(O), O);
  2807. return sort(A, compareFn);
  2808. });
  2809. /***/ }),
  2810. /***/ 9577:
  2811. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2812. var arrayWith = __webpack_require__(9928);
  2813. var ArrayBufferViewCore = __webpack_require__(4644);
  2814. var isBigIntArray = __webpack_require__(1108);
  2815. var toIntegerOrInfinity = __webpack_require__(1291);
  2816. var toBigInt = __webpack_require__(5854);
  2817. var aTypedArray = ArrayBufferViewCore.aTypedArray;
  2818. var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor;
  2819. var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
  2820. var PROPER_ORDER = !!function () {
  2821. try {
  2822. // eslint-disable-next-line no-throw-literal, es/no-typed-arrays, es/no-array-prototype-with -- required for testing
  2823. new Int8Array(1)['with'](2, { valueOf: function () { throw 8; } });
  2824. } catch (error) {
  2825. // some early implementations, like WebKit, does not follow the final semantic
  2826. // https://github.com/tc39/proposal-change-array-by-copy/pull/86
  2827. return error === 8;
  2828. }
  2829. }();
  2830. // `%TypedArray%.prototype.with` method
  2831. // https://tc39.es/ecma262/#sec-%typedarray%.prototype.with
  2832. exportTypedArrayMethod('with', { 'with': function (index, value) {
  2833. var O = aTypedArray(this);
  2834. var relativeIndex = toIntegerOrInfinity(index);
  2835. var actualValue = isBigIntArray(O) ? toBigInt(value) : +value;
  2836. return arrayWith(O, getTypedArrayConstructor(O), relativeIndex, actualValue);
  2837. } }['with'], !PROPER_ORDER);
  2838. /***/ }),
  2839. /***/ 8992:
  2840. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2841. var $ = __webpack_require__(6518);
  2842. var globalThis = __webpack_require__(4576);
  2843. var anInstance = __webpack_require__(679);
  2844. var anObject = __webpack_require__(8551);
  2845. var isCallable = __webpack_require__(4901);
  2846. var getPrototypeOf = __webpack_require__(2787);
  2847. var defineBuiltInAccessor = __webpack_require__(2106);
  2848. var createProperty = __webpack_require__(4659);
  2849. var fails = __webpack_require__(9039);
  2850. var hasOwn = __webpack_require__(9297);
  2851. var wellKnownSymbol = __webpack_require__(8227);
  2852. var IteratorPrototype = (__webpack_require__(7657).IteratorPrototype);
  2853. var DESCRIPTORS = __webpack_require__(3724);
  2854. var IS_PURE = __webpack_require__(6395);
  2855. var CONSTRUCTOR = 'constructor';
  2856. var ITERATOR = 'Iterator';
  2857. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  2858. var $TypeError = TypeError;
  2859. var NativeIterator = globalThis[ITERATOR];
  2860. // FF56- have non-standard global helper `Iterator`
  2861. var FORCED = IS_PURE
  2862. || !isCallable(NativeIterator)
  2863. || NativeIterator.prototype !== IteratorPrototype
  2864. // FF44- non-standard `Iterator` passes previous tests
  2865. || !fails(function () { NativeIterator({}); });
  2866. var IteratorConstructor = function Iterator() {
  2867. anInstance(this, IteratorPrototype);
  2868. if (getPrototypeOf(this) === IteratorPrototype) throw new $TypeError('Abstract class Iterator not directly constructable');
  2869. };
  2870. var defineIteratorPrototypeAccessor = function (key, value) {
  2871. if (DESCRIPTORS) {
  2872. defineBuiltInAccessor(IteratorPrototype, key, {
  2873. configurable: true,
  2874. get: function () {
  2875. return value;
  2876. },
  2877. set: function (replacement) {
  2878. anObject(this);
  2879. if (this === IteratorPrototype) throw new $TypeError("You can't redefine this property");
  2880. if (hasOwn(this, key)) this[key] = replacement;
  2881. else createProperty(this, key, replacement);
  2882. }
  2883. });
  2884. } else IteratorPrototype[key] = value;
  2885. };
  2886. if (!hasOwn(IteratorPrototype, TO_STRING_TAG)) defineIteratorPrototypeAccessor(TO_STRING_TAG, ITERATOR);
  2887. if (FORCED || !hasOwn(IteratorPrototype, CONSTRUCTOR) || IteratorPrototype[CONSTRUCTOR] === Object) {
  2888. defineIteratorPrototypeAccessor(CONSTRUCTOR, IteratorConstructor);
  2889. }
  2890. IteratorConstructor.prototype = IteratorPrototype;
  2891. // `Iterator` constructor
  2892. // https://github.com/tc39/proposal-iterator-helpers
  2893. $({ global: true, constructor: true, forced: FORCED }, {
  2894. Iterator: IteratorConstructor
  2895. });
  2896. /***/ }),
  2897. /***/ 3215:
  2898. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2899. var $ = __webpack_require__(6518);
  2900. var iterate = __webpack_require__(2652);
  2901. var aCallable = __webpack_require__(9306);
  2902. var anObject = __webpack_require__(8551);
  2903. var getIteratorDirect = __webpack_require__(1767);
  2904. // `Iterator.prototype.every` method
  2905. // https://github.com/tc39/proposal-iterator-helpers
  2906. $({ target: 'Iterator', proto: true, real: true }, {
  2907. every: function every(predicate) {
  2908. anObject(this);
  2909. aCallable(predicate);
  2910. var record = getIteratorDirect(this);
  2911. var counter = 0;
  2912. return !iterate(record, function (value, stop) {
  2913. if (!predicate(value, counter++)) return stop();
  2914. }, { IS_RECORD: true, INTERRUPTED: true }).stopped;
  2915. }
  2916. });
  2917. /***/ }),
  2918. /***/ 4520:
  2919. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2920. var $ = __webpack_require__(6518);
  2921. var call = __webpack_require__(9565);
  2922. var aCallable = __webpack_require__(9306);
  2923. var anObject = __webpack_require__(8551);
  2924. var getIteratorDirect = __webpack_require__(1767);
  2925. var createIteratorProxy = __webpack_require__(9462);
  2926. var callWithSafeIterationClosing = __webpack_require__(6319);
  2927. var IS_PURE = __webpack_require__(6395);
  2928. var IteratorProxy = createIteratorProxy(function () {
  2929. var iterator = this.iterator;
  2930. var predicate = this.predicate;
  2931. var next = this.next;
  2932. var result, done, value;
  2933. while (true) {
  2934. result = anObject(call(next, iterator));
  2935. done = this.done = !!result.done;
  2936. if (done) return;
  2937. value = result.value;
  2938. if (callWithSafeIterationClosing(iterator, predicate, [value, this.counter++], true)) return value;
  2939. }
  2940. });
  2941. // `Iterator.prototype.filter` method
  2942. // https://github.com/tc39/proposal-iterator-helpers
  2943. $({ target: 'Iterator', proto: true, real: true, forced: IS_PURE }, {
  2944. filter: function filter(predicate) {
  2945. anObject(this);
  2946. aCallable(predicate);
  2947. return new IteratorProxy(getIteratorDirect(this), {
  2948. predicate: predicate
  2949. });
  2950. }
  2951. });
  2952. /***/ }),
  2953. /***/ 2577:
  2954. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2955. var $ = __webpack_require__(6518);
  2956. var iterate = __webpack_require__(2652);
  2957. var aCallable = __webpack_require__(9306);
  2958. var anObject = __webpack_require__(8551);
  2959. var getIteratorDirect = __webpack_require__(1767);
  2960. // `Iterator.prototype.find` method
  2961. // https://github.com/tc39/proposal-iterator-helpers
  2962. $({ target: 'Iterator', proto: true, real: true }, {
  2963. find: function find(predicate) {
  2964. anObject(this);
  2965. aCallable(predicate);
  2966. var record = getIteratorDirect(this);
  2967. var counter = 0;
  2968. return iterate(record, function (value, stop) {
  2969. if (predicate(value, counter++)) return stop(value);
  2970. }, { IS_RECORD: true, INTERRUPTED: true }).result;
  2971. }
  2972. });
  2973. /***/ }),
  2974. /***/ 3949:
  2975. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2976. var $ = __webpack_require__(6518);
  2977. var iterate = __webpack_require__(2652);
  2978. var aCallable = __webpack_require__(9306);
  2979. var anObject = __webpack_require__(8551);
  2980. var getIteratorDirect = __webpack_require__(1767);
  2981. // `Iterator.prototype.forEach` method
  2982. // https://github.com/tc39/proposal-iterator-helpers
  2983. $({ target: 'Iterator', proto: true, real: true }, {
  2984. forEach: function forEach(fn) {
  2985. anObject(this);
  2986. aCallable(fn);
  2987. var record = getIteratorDirect(this);
  2988. var counter = 0;
  2989. iterate(record, function (value) {
  2990. fn(value, counter++);
  2991. }, { IS_RECORD: true });
  2992. }
  2993. });
  2994. /***/ }),
  2995. /***/ 1454:
  2996. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  2997. var $ = __webpack_require__(6518);
  2998. var map = __webpack_require__(713);
  2999. var IS_PURE = __webpack_require__(6395);
  3000. // `Iterator.prototype.map` method
  3001. // https://github.com/tc39/proposal-iterator-helpers
  3002. $({ target: 'Iterator', proto: true, real: true, forced: IS_PURE }, {
  3003. map: map
  3004. });
  3005. /***/ }),
  3006. /***/ 8872:
  3007. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  3008. var $ = __webpack_require__(6518);
  3009. var iterate = __webpack_require__(2652);
  3010. var aCallable = __webpack_require__(9306);
  3011. var anObject = __webpack_require__(8551);
  3012. var getIteratorDirect = __webpack_require__(1767);
  3013. var $TypeError = TypeError;
  3014. // `Iterator.prototype.reduce` method
  3015. // https://github.com/tc39/proposal-iterator-helpers
  3016. $({ target: 'Iterator', proto: true, real: true }, {
  3017. reduce: function reduce(reducer /* , initialValue */) {
  3018. anObject(this);
  3019. aCallable(reducer);
  3020. var record = getIteratorDirect(this);
  3021. var noInitial = arguments.length < 2;
  3022. var accumulator = noInitial ? undefined : arguments[1];
  3023. var counter = 0;
  3024. iterate(record, function (value) {
  3025. if (noInitial) {
  3026. noInitial = false;
  3027. accumulator = value;
  3028. } else {
  3029. accumulator = reducer(accumulator, value, counter);
  3030. }
  3031. counter++;
  3032. }, { IS_RECORD: true });
  3033. if (noInitial) throw new $TypeError('Reduce of empty iterator with no initial value');
  3034. return accumulator;
  3035. }
  3036. });
  3037. /***/ }),
  3038. /***/ 7550:
  3039. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  3040. var $ = __webpack_require__(6518);
  3041. var iterate = __webpack_require__(2652);
  3042. var aCallable = __webpack_require__(9306);
  3043. var anObject = __webpack_require__(8551);
  3044. var getIteratorDirect = __webpack_require__(1767);
  3045. // `Iterator.prototype.some` method
  3046. // https://github.com/tc39/proposal-iterator-helpers
  3047. $({ target: 'Iterator', proto: true, real: true }, {
  3048. some: function some(predicate) {
  3049. anObject(this);
  3050. aCallable(predicate);
  3051. var record = getIteratorDirect(this);
  3052. var counter = 0;
  3053. return iterate(record, function (value, stop) {
  3054. if (predicate(value, counter++)) return stop();
  3055. }, { IS_RECORD: true, INTERRUPTED: true }).stopped;
  3056. }
  3057. });
  3058. /***/ }),
  3059. /***/ 1795:
  3060. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  3061. var $ = __webpack_require__(6518);
  3062. var anObject = __webpack_require__(8551);
  3063. var iterate = __webpack_require__(2652);
  3064. var getIteratorDirect = __webpack_require__(1767);
  3065. var push = [].push;
  3066. // `Iterator.prototype.toArray` method
  3067. // https://github.com/tc39/proposal-iterator-helpers
  3068. $({ target: 'Iterator', proto: true, real: true }, {
  3069. toArray: function toArray() {
  3070. var result = [];
  3071. iterate(getIteratorDirect(anObject(this)), push, { that: result, IS_RECORD: true });
  3072. return result;
  3073. }
  3074. });
  3075. /***/ }),
  3076. /***/ 4979:
  3077. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  3078. var $ = __webpack_require__(6518);
  3079. var globalThis = __webpack_require__(4576);
  3080. var getBuiltIn = __webpack_require__(7751);
  3081. var createPropertyDescriptor = __webpack_require__(6980);
  3082. var defineProperty = (__webpack_require__(4913).f);
  3083. var hasOwn = __webpack_require__(9297);
  3084. var anInstance = __webpack_require__(679);
  3085. var inheritIfRequired = __webpack_require__(3167);
  3086. var normalizeStringArgument = __webpack_require__(2603);
  3087. var DOMExceptionConstants = __webpack_require__(5002);
  3088. var clearErrorStack = __webpack_require__(8574);
  3089. var DESCRIPTORS = __webpack_require__(3724);
  3090. var IS_PURE = __webpack_require__(6395);
  3091. var DOM_EXCEPTION = 'DOMException';
  3092. var Error = getBuiltIn('Error');
  3093. var NativeDOMException = getBuiltIn(DOM_EXCEPTION);
  3094. var $DOMException = function DOMException() {
  3095. anInstance(this, DOMExceptionPrototype);
  3096. var argumentsLength = arguments.length;
  3097. var message = normalizeStringArgument(argumentsLength < 1 ? undefined : arguments[0]);
  3098. var name = normalizeStringArgument(argumentsLength < 2 ? undefined : arguments[1], 'Error');
  3099. var that = new NativeDOMException(message, name);
  3100. var error = new Error(message);
  3101. error.name = DOM_EXCEPTION;
  3102. defineProperty(that, 'stack', createPropertyDescriptor(1, clearErrorStack(error.stack, 1)));
  3103. inheritIfRequired(that, this, $DOMException);
  3104. return that;
  3105. };
  3106. var DOMExceptionPrototype = $DOMException.prototype = NativeDOMException.prototype;
  3107. var ERROR_HAS_STACK = 'stack' in new Error(DOM_EXCEPTION);
  3108. var DOM_EXCEPTION_HAS_STACK = 'stack' in new NativeDOMException(1, 2);
  3109. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  3110. var descriptor = NativeDOMException && DESCRIPTORS && Object.getOwnPropertyDescriptor(globalThis, DOM_EXCEPTION);
  3111. // Bun ~ 0.1.1 DOMException have incorrect descriptor and we can't redefine it
  3112. // https://github.com/Jarred-Sumner/bun/issues/399
  3113. var BUGGY_DESCRIPTOR = !!descriptor && !(descriptor.writable && descriptor.configurable);
  3114. var FORCED_CONSTRUCTOR = ERROR_HAS_STACK && !BUGGY_DESCRIPTOR && !DOM_EXCEPTION_HAS_STACK;
  3115. // `DOMException` constructor patch for `.stack` where it's required
  3116. // https://webidl.spec.whatwg.org/#es-DOMException-specialness
  3117. $({ global: true, constructor: true, forced: IS_PURE || FORCED_CONSTRUCTOR }, { // TODO: fix export logic
  3118. DOMException: FORCED_CONSTRUCTOR ? $DOMException : NativeDOMException
  3119. });
  3120. var PolyfilledDOMException = getBuiltIn(DOM_EXCEPTION);
  3121. var PolyfilledDOMExceptionPrototype = PolyfilledDOMException.prototype;
  3122. if (PolyfilledDOMExceptionPrototype.constructor !== PolyfilledDOMException) {
  3123. if (!IS_PURE) {
  3124. defineProperty(PolyfilledDOMExceptionPrototype, 'constructor', createPropertyDescriptor(1, PolyfilledDOMException));
  3125. }
  3126. for (var key in DOMExceptionConstants) if (hasOwn(DOMExceptionConstants, key)) {
  3127. var constant = DOMExceptionConstants[key];
  3128. var constantName = constant.s;
  3129. if (!hasOwn(PolyfilledDOMException, constantName)) {
  3130. defineProperty(PolyfilledDOMException, constantName, createPropertyDescriptor(6, constant.c));
  3131. }
  3132. }
  3133. }
  3134. /***/ }),
  3135. /***/ 3611:
  3136. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  3137. var $ = __webpack_require__(6518);
  3138. var globalThis = __webpack_require__(4576);
  3139. var defineBuiltInAccessor = __webpack_require__(2106);
  3140. var DESCRIPTORS = __webpack_require__(3724);
  3141. var $TypeError = TypeError;
  3142. // eslint-disable-next-line es/no-object-defineproperty -- safe
  3143. var defineProperty = Object.defineProperty;
  3144. var INCORRECT_VALUE = globalThis.self !== globalThis;
  3145. // `self` getter
  3146. // https://html.spec.whatwg.org/multipage/window-object.html#dom-self
  3147. try {
  3148. if (DESCRIPTORS) {
  3149. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  3150. var descriptor = Object.getOwnPropertyDescriptor(globalThis, 'self');
  3151. // some engines have `self`, but with incorrect descriptor
  3152. // https://github.com/denoland/deno/issues/15765
  3153. if (INCORRECT_VALUE || !descriptor || !descriptor.get || !descriptor.enumerable) {
  3154. defineBuiltInAccessor(globalThis, 'self', {
  3155. get: function self() {
  3156. return globalThis;
  3157. },
  3158. set: function self(value) {
  3159. if (this !== globalThis) throw new $TypeError('Illegal invocation');
  3160. defineProperty(globalThis, 'self', {
  3161. value: value,
  3162. writable: true,
  3163. configurable: true,
  3164. enumerable: true
  3165. });
  3166. },
  3167. configurable: true,
  3168. enumerable: true
  3169. });
  3170. }
  3171. } else $({ global: true, simple: true, forced: INCORRECT_VALUE }, {
  3172. self: globalThis
  3173. });
  3174. } catch (error) { /* empty */ }
  3175. /***/ }),
  3176. /***/ 4603:
  3177. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  3178. var defineBuiltIn = __webpack_require__(6840);
  3179. var uncurryThis = __webpack_require__(9504);
  3180. var toString = __webpack_require__(655);
  3181. var validateArgumentsLength = __webpack_require__(2812);
  3182. var $URLSearchParams = URLSearchParams;
  3183. var URLSearchParamsPrototype = $URLSearchParams.prototype;
  3184. var append = uncurryThis(URLSearchParamsPrototype.append);
  3185. var $delete = uncurryThis(URLSearchParamsPrototype['delete']);
  3186. var forEach = uncurryThis(URLSearchParamsPrototype.forEach);
  3187. var push = uncurryThis([].push);
  3188. var params = new $URLSearchParams('a=1&a=2&b=3');
  3189. params['delete']('a', 1);
  3190. // `undefined` case is a Chromium 117 bug
  3191. // https://bugs.chromium.org/p/v8/issues/detail?id=14222
  3192. params['delete']('b', undefined);
  3193. if (params + '' !== 'a=2') {
  3194. defineBuiltIn(URLSearchParamsPrototype, 'delete', function (name /* , value */) {
  3195. var length = arguments.length;
  3196. var $value = length < 2 ? undefined : arguments[1];
  3197. if (length && $value === undefined) return $delete(this, name);
  3198. var entries = [];
  3199. forEach(this, function (v, k) { // also validates `this`
  3200. push(entries, { key: k, value: v });
  3201. });
  3202. validateArgumentsLength(length, 1);
  3203. var key = toString(name);
  3204. var value = toString($value);
  3205. var index = 0;
  3206. var dindex = 0;
  3207. var found = false;
  3208. var entriesLength = entries.length;
  3209. var entry;
  3210. while (index < entriesLength) {
  3211. entry = entries[index++];
  3212. if (found || entry.key === key) {
  3213. found = true;
  3214. $delete(this, entry.key);
  3215. } else dindex++;
  3216. }
  3217. while (dindex < entriesLength) {
  3218. entry = entries[dindex++];
  3219. if (!(entry.key === key && entry.value === value)) append(this, entry.key, entry.value);
  3220. }
  3221. }, { enumerable: true, unsafe: true });
  3222. }
  3223. /***/ }),
  3224. /***/ 7566:
  3225. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  3226. var defineBuiltIn = __webpack_require__(6840);
  3227. var uncurryThis = __webpack_require__(9504);
  3228. var toString = __webpack_require__(655);
  3229. var validateArgumentsLength = __webpack_require__(2812);
  3230. var $URLSearchParams = URLSearchParams;
  3231. var URLSearchParamsPrototype = $URLSearchParams.prototype;
  3232. var getAll = uncurryThis(URLSearchParamsPrototype.getAll);
  3233. var $has = uncurryThis(URLSearchParamsPrototype.has);
  3234. var params = new $URLSearchParams('a=1');
  3235. // `undefined` case is a Chromium 117 bug
  3236. // https://bugs.chromium.org/p/v8/issues/detail?id=14222
  3237. if (params.has('a', 2) || !params.has('a', undefined)) {
  3238. defineBuiltIn(URLSearchParamsPrototype, 'has', function has(name /* , value */) {
  3239. var length = arguments.length;
  3240. var $value = length < 2 ? undefined : arguments[1];
  3241. if (length && $value === undefined) return $has(this, name);
  3242. var values = getAll(this, name); // also validates `this`
  3243. validateArgumentsLength(length, 1);
  3244. var value = toString($value);
  3245. var index = 0;
  3246. while (index < values.length) {
  3247. if (values[index++] === value) return true;
  3248. } return false;
  3249. }, { enumerable: true, unsafe: true });
  3250. }
  3251. /***/ }),
  3252. /***/ 8721:
  3253. /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
  3254. var DESCRIPTORS = __webpack_require__(3724);
  3255. var uncurryThis = __webpack_require__(9504);
  3256. var defineBuiltInAccessor = __webpack_require__(2106);
  3257. var URLSearchParamsPrototype = URLSearchParams.prototype;
  3258. var forEach = uncurryThis(URLSearchParamsPrototype.forEach);
  3259. // `URLSearchParams.prototype.size` getter
  3260. // https://github.com/whatwg/url/pull/734
  3261. if (DESCRIPTORS && !('size' in URLSearchParamsPrototype)) {
  3262. defineBuiltInAccessor(URLSearchParamsPrototype, 'size', {
  3263. get: function size() {
  3264. var count = 0;
  3265. forEach(this, function () { count++; });
  3266. return count;
  3267. },
  3268. configurable: true,
  3269. enumerable: true
  3270. });
  3271. }
  3272. /***/ })
  3273. /******/ });
  3274. /************************************************************************/
  3275. /******/ // The module cache
  3276. /******/ var __webpack_module_cache__ = {};
  3277. /******/
  3278. /******/ // The require function
  3279. /******/ function __webpack_require__(moduleId) {
  3280. /******/ // Check if module is in cache
  3281. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  3282. /******/ if (cachedModule !== undefined) {
  3283. /******/ return cachedModule.exports;
  3284. /******/ }
  3285. /******/ // Create a new module (and put it into the cache)
  3286. /******/ var module = __webpack_module_cache__[moduleId] = {
  3287. /******/ // no module.id needed
  3288. /******/ // no module.loaded needed
  3289. /******/ exports: {}
  3290. /******/ };
  3291. /******/
  3292. /******/ // Execute the module function
  3293. /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  3294. /******/
  3295. /******/ // Return the exports of the module
  3296. /******/ return module.exports;
  3297. /******/ }
  3298. /******/
  3299. /************************************************************************/
  3300. /******/ /* webpack/runtime/define property getters */
  3301. /******/ (() => {
  3302. /******/ // define getter functions for harmony exports
  3303. /******/ __webpack_require__.d = (exports, definition) => {
  3304. /******/ for(var key in definition) {
  3305. /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  3306. /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  3307. /******/ }
  3308. /******/ }
  3309. /******/ };
  3310. /******/ })();
  3311. /******/
  3312. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  3313. /******/ (() => {
  3314. /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
  3315. /******/ })();
  3316. /******/
  3317. /************************************************************************/
  3318. var __webpack_exports__ = globalThis.pdfjsWorker = {};
  3319. // EXPORTS
  3320. __webpack_require__.d(__webpack_exports__, {
  3321. WorkerMessageHandler: () => (/* reexport */ WorkerMessageHandler)
  3322. });
  3323. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js
  3324. var es_array_push = __webpack_require__(4114);
  3325. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array-buffer.detached.js
  3326. var es_array_buffer_detached = __webpack_require__(6573);
  3327. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array-buffer.transfer.js
  3328. var es_array_buffer_transfer = __webpack_require__(8100);
  3329. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array-buffer.transfer-to-fixed-length.js
  3330. var es_array_buffer_transfer_to_fixed_length = __webpack_require__(7936);
  3331. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.promise.with-resolvers.js
  3332. var es_promise_with_resolvers = __webpack_require__(4628);
  3333. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.set.difference.v2.js
  3334. var es_set_difference_v2 = __webpack_require__(7642);
  3335. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.set.intersection.v2.js
  3336. var es_set_intersection_v2 = __webpack_require__(8004);
  3337. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.set.is-disjoint-from.v2.js
  3338. var es_set_is_disjoint_from_v2 = __webpack_require__(3853);
  3339. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.set.is-subset-of.v2.js
  3340. var es_set_is_subset_of_v2 = __webpack_require__(5876);
  3341. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.set.is-superset-of.v2.js
  3342. var es_set_is_superset_of_v2 = __webpack_require__(2475);
  3343. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.set.symmetric-difference.v2.js
  3344. var es_set_symmetric_difference_v2 = __webpack_require__(5024);
  3345. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.set.union.v2.js
  3346. var es_set_union_v2 = __webpack_require__(1698);
  3347. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.to-reversed.js
  3348. var es_typed_array_to_reversed = __webpack_require__(7467);
  3349. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.to-sorted.js
  3350. var es_typed_array_to_sorted = __webpack_require__(4732);
  3351. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.typed-array.with.js
  3352. var es_typed_array_with = __webpack_require__(9577);
  3353. // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.constructor.js
  3354. var esnext_iterator_constructor = __webpack_require__(8992);
  3355. // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.for-each.js
  3356. var esnext_iterator_for_each = __webpack_require__(3949);
  3357. // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.map.js
  3358. var esnext_iterator_map = __webpack_require__(1454);
  3359. // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.some.js
  3360. var esnext_iterator_some = __webpack_require__(7550);
  3361. // EXTERNAL MODULE: ./node_modules/core-js/modules/web.self.js
  3362. var web_self = __webpack_require__(3611);
  3363. // EXTERNAL MODULE: ./node_modules/core-js/modules/web.url-search-params.delete.js
  3364. var web_url_search_params_delete = __webpack_require__(4603);
  3365. // EXTERNAL MODULE: ./node_modules/core-js/modules/web.url-search-params.has.js
  3366. var web_url_search_params_has = __webpack_require__(7566);
  3367. // EXTERNAL MODULE: ./node_modules/core-js/modules/web.url-search-params.size.js
  3368. var web_url_search_params_size = __webpack_require__(8721);
  3369. ;// ./src/shared/util.js
  3370. const isNodeJS = typeof process === "object" && process + "" === "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser");
  3371. const IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0];
  3372. const FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];
  3373. const MAX_IMAGE_SIZE_TO_CACHE = 10e6;
  3374. const LINE_FACTOR = 1.35;
  3375. const LINE_DESCENT_FACTOR = 0.35;
  3376. const BASELINE_FACTOR = LINE_DESCENT_FACTOR / LINE_FACTOR;
  3377. const RenderingIntentFlag = {
  3378. ANY: 0x01,
  3379. DISPLAY: 0x02,
  3380. PRINT: 0x04,
  3381. SAVE: 0x08,
  3382. ANNOTATIONS_FORMS: 0x10,
  3383. ANNOTATIONS_STORAGE: 0x20,
  3384. ANNOTATIONS_DISABLE: 0x40,
  3385. IS_EDITING: 0x80,
  3386. OPLIST: 0x100
  3387. };
  3388. const AnnotationMode = {
  3389. DISABLE: 0,
  3390. ENABLE: 1,
  3391. ENABLE_FORMS: 2,
  3392. ENABLE_STORAGE: 3
  3393. };
  3394. const AnnotationEditorPrefix = "pdfjs_internal_editor_";
  3395. const AnnotationEditorType = {
  3396. DISABLE: -1,
  3397. NONE: 0,
  3398. FREETEXT: 3,
  3399. HIGHLIGHT: 9,
  3400. STAMP: 13,
  3401. INK: 15
  3402. };
  3403. const AnnotationEditorParamsType = {
  3404. RESIZE: 1,
  3405. CREATE: 2,
  3406. FREETEXT_SIZE: 11,
  3407. FREETEXT_COLOR: 12,
  3408. FREETEXT_OPACITY: 13,
  3409. INK_COLOR: 21,
  3410. INK_THICKNESS: 22,
  3411. INK_OPACITY: 23,
  3412. HIGHLIGHT_COLOR: 31,
  3413. HIGHLIGHT_DEFAULT_COLOR: 32,
  3414. HIGHLIGHT_THICKNESS: 33,
  3415. HIGHLIGHT_FREE: 34,
  3416. HIGHLIGHT_SHOW_ALL: 35
  3417. };
  3418. const PermissionFlag = {
  3419. PRINT: 0x04,
  3420. MODIFY_CONTENTS: 0x08,
  3421. COPY: 0x10,
  3422. MODIFY_ANNOTATIONS: 0x20,
  3423. FILL_INTERACTIVE_FORMS: 0x100,
  3424. COPY_FOR_ACCESSIBILITY: 0x200,
  3425. ASSEMBLE: 0x400,
  3426. PRINT_HIGH_QUALITY: 0x800
  3427. };
  3428. const TextRenderingMode = {
  3429. FILL: 0,
  3430. STROKE: 1,
  3431. FILL_STROKE: 2,
  3432. INVISIBLE: 3,
  3433. FILL_ADD_TO_PATH: 4,
  3434. STROKE_ADD_TO_PATH: 5,
  3435. FILL_STROKE_ADD_TO_PATH: 6,
  3436. ADD_TO_PATH: 7,
  3437. FILL_STROKE_MASK: 3,
  3438. ADD_TO_PATH_FLAG: 4
  3439. };
  3440. const ImageKind = {
  3441. GRAYSCALE_1BPP: 1,
  3442. RGB_24BPP: 2,
  3443. RGBA_32BPP: 3
  3444. };
  3445. const AnnotationType = {
  3446. TEXT: 1,
  3447. LINK: 2,
  3448. FREETEXT: 3,
  3449. LINE: 4,
  3450. SQUARE: 5,
  3451. CIRCLE: 6,
  3452. POLYGON: 7,
  3453. POLYLINE: 8,
  3454. HIGHLIGHT: 9,
  3455. UNDERLINE: 10,
  3456. SQUIGGLY: 11,
  3457. STRIKEOUT: 12,
  3458. STAMP: 13,
  3459. CARET: 14,
  3460. INK: 15,
  3461. POPUP: 16,
  3462. FILEATTACHMENT: 17,
  3463. SOUND: 18,
  3464. MOVIE: 19,
  3465. WIDGET: 20,
  3466. SCREEN: 21,
  3467. PRINTERMARK: 22,
  3468. TRAPNET: 23,
  3469. WATERMARK: 24,
  3470. THREED: 25,
  3471. REDACT: 26
  3472. };
  3473. const AnnotationReplyType = {
  3474. GROUP: "Group",
  3475. REPLY: "R"
  3476. };
  3477. const AnnotationFlag = {
  3478. INVISIBLE: 0x01,
  3479. HIDDEN: 0x02,
  3480. PRINT: 0x04,
  3481. NOZOOM: 0x08,
  3482. NOROTATE: 0x10,
  3483. NOVIEW: 0x20,
  3484. READONLY: 0x40,
  3485. LOCKED: 0x80,
  3486. TOGGLENOVIEW: 0x100,
  3487. LOCKEDCONTENTS: 0x200
  3488. };
  3489. const AnnotationFieldFlag = {
  3490. READONLY: 0x0000001,
  3491. REQUIRED: 0x0000002,
  3492. NOEXPORT: 0x0000004,
  3493. MULTILINE: 0x0001000,
  3494. PASSWORD: 0x0002000,
  3495. NOTOGGLETOOFF: 0x0004000,
  3496. RADIO: 0x0008000,
  3497. PUSHBUTTON: 0x0010000,
  3498. COMBO: 0x0020000,
  3499. EDIT: 0x0040000,
  3500. SORT: 0x0080000,
  3501. FILESELECT: 0x0100000,
  3502. MULTISELECT: 0x0200000,
  3503. DONOTSPELLCHECK: 0x0400000,
  3504. DONOTSCROLL: 0x0800000,
  3505. COMB: 0x1000000,
  3506. RICHTEXT: 0x2000000,
  3507. RADIOSINUNISON: 0x2000000,
  3508. COMMITONSELCHANGE: 0x4000000
  3509. };
  3510. const AnnotationBorderStyleType = {
  3511. SOLID: 1,
  3512. DASHED: 2,
  3513. BEVELED: 3,
  3514. INSET: 4,
  3515. UNDERLINE: 5
  3516. };
  3517. const AnnotationActionEventType = {
  3518. E: "Mouse Enter",
  3519. X: "Mouse Exit",
  3520. D: "Mouse Down",
  3521. U: "Mouse Up",
  3522. Fo: "Focus",
  3523. Bl: "Blur",
  3524. PO: "PageOpen",
  3525. PC: "PageClose",
  3526. PV: "PageVisible",
  3527. PI: "PageInvisible",
  3528. K: "Keystroke",
  3529. F: "Format",
  3530. V: "Validate",
  3531. C: "Calculate"
  3532. };
  3533. const DocumentActionEventType = {
  3534. WC: "WillClose",
  3535. WS: "WillSave",
  3536. DS: "DidSave",
  3537. WP: "WillPrint",
  3538. DP: "DidPrint"
  3539. };
  3540. const PageActionEventType = {
  3541. O: "PageOpen",
  3542. C: "PageClose"
  3543. };
  3544. const VerbosityLevel = {
  3545. ERRORS: 0,
  3546. WARNINGS: 1,
  3547. INFOS: 5
  3548. };
  3549. const CMapCompressionType = {
  3550. NONE: 0,
  3551. BINARY: 1
  3552. };
  3553. const OPS = {
  3554. dependency: 1,
  3555. setLineWidth: 2,
  3556. setLineCap: 3,
  3557. setLineJoin: 4,
  3558. setMiterLimit: 5,
  3559. setDash: 6,
  3560. setRenderingIntent: 7,
  3561. setFlatness: 8,
  3562. setGState: 9,
  3563. save: 10,
  3564. restore: 11,
  3565. transform: 12,
  3566. moveTo: 13,
  3567. lineTo: 14,
  3568. curveTo: 15,
  3569. curveTo2: 16,
  3570. curveTo3: 17,
  3571. closePath: 18,
  3572. rectangle: 19,
  3573. stroke: 20,
  3574. closeStroke: 21,
  3575. fill: 22,
  3576. eoFill: 23,
  3577. fillStroke: 24,
  3578. eoFillStroke: 25,
  3579. closeFillStroke: 26,
  3580. closeEOFillStroke: 27,
  3581. endPath: 28,
  3582. clip: 29,
  3583. eoClip: 30,
  3584. beginText: 31,
  3585. endText: 32,
  3586. setCharSpacing: 33,
  3587. setWordSpacing: 34,
  3588. setHScale: 35,
  3589. setLeading: 36,
  3590. setFont: 37,
  3591. setTextRenderingMode: 38,
  3592. setTextRise: 39,
  3593. moveText: 40,
  3594. setLeadingMoveText: 41,
  3595. setTextMatrix: 42,
  3596. nextLine: 43,
  3597. showText: 44,
  3598. showSpacedText: 45,
  3599. nextLineShowText: 46,
  3600. nextLineSetSpacingShowText: 47,
  3601. setCharWidth: 48,
  3602. setCharWidthAndBounds: 49,
  3603. setStrokeColorSpace: 50,
  3604. setFillColorSpace: 51,
  3605. setStrokeColor: 52,
  3606. setStrokeColorN: 53,
  3607. setFillColor: 54,
  3608. setFillColorN: 55,
  3609. setStrokeGray: 56,
  3610. setFillGray: 57,
  3611. setStrokeRGBColor: 58,
  3612. setFillRGBColor: 59,
  3613. setStrokeCMYKColor: 60,
  3614. setFillCMYKColor: 61,
  3615. shadingFill: 62,
  3616. beginInlineImage: 63,
  3617. beginImageData: 64,
  3618. endInlineImage: 65,
  3619. paintXObject: 66,
  3620. markPoint: 67,
  3621. markPointProps: 68,
  3622. beginMarkedContent: 69,
  3623. beginMarkedContentProps: 70,
  3624. endMarkedContent: 71,
  3625. beginCompat: 72,
  3626. endCompat: 73,
  3627. paintFormXObjectBegin: 74,
  3628. paintFormXObjectEnd: 75,
  3629. beginGroup: 76,
  3630. endGroup: 77,
  3631. beginAnnotation: 80,
  3632. endAnnotation: 81,
  3633. paintImageMaskXObject: 83,
  3634. paintImageMaskXObjectGroup: 84,
  3635. paintImageXObject: 85,
  3636. paintInlineImageXObject: 86,
  3637. paintInlineImageXObjectGroup: 87,
  3638. paintImageXObjectRepeat: 88,
  3639. paintImageMaskXObjectRepeat: 89,
  3640. paintSolidColorImageMask: 90,
  3641. constructPath: 91,
  3642. setStrokeTransparent: 92,
  3643. setFillTransparent: 93
  3644. };
  3645. const PasswordResponses = {
  3646. NEED_PASSWORD: 1,
  3647. INCORRECT_PASSWORD: 2
  3648. };
  3649. let verbosity = VerbosityLevel.WARNINGS;
  3650. function setVerbosityLevel(level) {
  3651. if (Number.isInteger(level)) {
  3652. verbosity = level;
  3653. }
  3654. }
  3655. function getVerbosityLevel() {
  3656. return verbosity;
  3657. }
  3658. function info(msg) {
  3659. if (verbosity >= VerbosityLevel.INFOS) {
  3660. console.log(`Info: ${msg}`);
  3661. }
  3662. }
  3663. function warn(msg) {
  3664. if (verbosity >= VerbosityLevel.WARNINGS) {
  3665. console.log(`Warning: ${msg}`);
  3666. }
  3667. }
  3668. function unreachable(msg) {
  3669. throw new Error(msg);
  3670. }
  3671. function assert(cond, msg) {
  3672. if (!cond) {
  3673. unreachable(msg);
  3674. }
  3675. }
  3676. function _isValidProtocol(url) {
  3677. switch (url?.protocol) {
  3678. case "http:":
  3679. case "https:":
  3680. case "ftp:":
  3681. case "mailto:":
  3682. case "tel:":
  3683. return true;
  3684. default:
  3685. return false;
  3686. }
  3687. }
  3688. function createValidAbsoluteUrl(url, baseUrl = null, options = null) {
  3689. if (!url) {
  3690. return null;
  3691. }
  3692. try {
  3693. if (options && typeof url === "string") {
  3694. if (options.addDefaultProtocol && url.startsWith("www.")) {
  3695. const dots = url.match(/\./g);
  3696. if (dots?.length >= 2) {
  3697. url = `http://${url}`;
  3698. }
  3699. }
  3700. if (options.tryConvertEncoding) {
  3701. try {
  3702. url = stringToUTF8String(url);
  3703. } catch {}
  3704. }
  3705. }
  3706. const absoluteUrl = baseUrl ? new URL(url, baseUrl) : new URL(url);
  3707. if (_isValidProtocol(absoluteUrl)) {
  3708. return absoluteUrl;
  3709. }
  3710. } catch {}
  3711. return null;
  3712. }
  3713. function shadow(obj, prop, value, nonSerializable = false) {
  3714. Object.defineProperty(obj, prop, {
  3715. value,
  3716. enumerable: !nonSerializable,
  3717. configurable: true,
  3718. writable: false
  3719. });
  3720. return value;
  3721. }
  3722. const BaseException = function BaseExceptionClosure() {
  3723. function BaseException(message, name) {
  3724. this.message = message;
  3725. this.name = name;
  3726. }
  3727. BaseException.prototype = new Error();
  3728. BaseException.constructor = BaseException;
  3729. return BaseException;
  3730. }();
  3731. class PasswordException extends BaseException {
  3732. constructor(msg, code) {
  3733. super(msg, "PasswordException");
  3734. this.code = code;
  3735. }
  3736. }
  3737. class UnknownErrorException extends BaseException {
  3738. constructor(msg, details) {
  3739. super(msg, "UnknownErrorException");
  3740. this.details = details;
  3741. }
  3742. }
  3743. class InvalidPDFException extends BaseException {
  3744. constructor(msg) {
  3745. super(msg, "InvalidPDFException");
  3746. }
  3747. }
  3748. class MissingPDFException extends BaseException {
  3749. constructor(msg) {
  3750. super(msg, "MissingPDFException");
  3751. }
  3752. }
  3753. class UnexpectedResponseException extends BaseException {
  3754. constructor(msg, status) {
  3755. super(msg, "UnexpectedResponseException");
  3756. this.status = status;
  3757. }
  3758. }
  3759. class FormatError extends BaseException {
  3760. constructor(msg) {
  3761. super(msg, "FormatError");
  3762. }
  3763. }
  3764. class AbortException extends BaseException {
  3765. constructor(msg) {
  3766. super(msg, "AbortException");
  3767. }
  3768. }
  3769. function bytesToString(bytes) {
  3770. if (typeof bytes !== "object" || bytes?.length === undefined) {
  3771. unreachable("Invalid argument for bytesToString");
  3772. }
  3773. const length = bytes.length;
  3774. const MAX_ARGUMENT_COUNT = 8192;
  3775. if (length < MAX_ARGUMENT_COUNT) {
  3776. return String.fromCharCode.apply(null, bytes);
  3777. }
  3778. const strBuf = [];
  3779. for (let i = 0; i < length; i += MAX_ARGUMENT_COUNT) {
  3780. const chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length);
  3781. const chunk = bytes.subarray(i, chunkEnd);
  3782. strBuf.push(String.fromCharCode.apply(null, chunk));
  3783. }
  3784. return strBuf.join("");
  3785. }
  3786. function stringToBytes(str) {
  3787. if (typeof str !== "string") {
  3788. unreachable("Invalid argument for stringToBytes");
  3789. }
  3790. const length = str.length;
  3791. const bytes = new Uint8Array(length);
  3792. for (let i = 0; i < length; ++i) {
  3793. bytes[i] = str.charCodeAt(i) & 0xff;
  3794. }
  3795. return bytes;
  3796. }
  3797. function string32(value) {
  3798. return String.fromCharCode(value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff);
  3799. }
  3800. function objectSize(obj) {
  3801. return Object.keys(obj).length;
  3802. }
  3803. function objectFromMap(map) {
  3804. const obj = Object.create(null);
  3805. for (const [key, value] of map) {
  3806. obj[key] = value;
  3807. }
  3808. return obj;
  3809. }
  3810. function isLittleEndian() {
  3811. const buffer8 = new Uint8Array(4);
  3812. buffer8[0] = 1;
  3813. const view32 = new Uint32Array(buffer8.buffer, 0, 1);
  3814. return view32[0] === 1;
  3815. }
  3816. function isEvalSupported() {
  3817. try {
  3818. new Function("");
  3819. return true;
  3820. } catch {
  3821. return false;
  3822. }
  3823. }
  3824. class FeatureTest {
  3825. static get isLittleEndian() {
  3826. return shadow(this, "isLittleEndian", isLittleEndian());
  3827. }
  3828. static get isEvalSupported() {
  3829. return shadow(this, "isEvalSupported", isEvalSupported());
  3830. }
  3831. static get isOffscreenCanvasSupported() {
  3832. return shadow(this, "isOffscreenCanvasSupported", typeof OffscreenCanvas !== "undefined");
  3833. }
  3834. static get platform() {
  3835. if (typeof navigator !== "undefined" && typeof navigator?.platform === "string") {
  3836. return shadow(this, "platform", {
  3837. isMac: navigator.platform.includes("Mac"),
  3838. isWindows: navigator.platform.includes("Win"),
  3839. isFirefox: typeof navigator?.userAgent === "string" && navigator.userAgent.includes("Firefox")
  3840. });
  3841. }
  3842. return shadow(this, "platform", {
  3843. isMac: false,
  3844. isWindows: false,
  3845. isFirefox: false
  3846. });
  3847. }
  3848. static get isCSSRoundSupported() {
  3849. return shadow(this, "isCSSRoundSupported", globalThis.CSS?.supports?.("width: round(1.5px, 1px)"));
  3850. }
  3851. }
  3852. const hexNumbers = Array.from(Array(256).keys(), n => n.toString(16).padStart(2, "0"));
  3853. class Util {
  3854. static makeHexColor(r, g, b) {
  3855. return `#${hexNumbers[r]}${hexNumbers[g]}${hexNumbers[b]}`;
  3856. }
  3857. static scaleMinMax(transform, minMax) {
  3858. let temp;
  3859. if (transform[0]) {
  3860. if (transform[0] < 0) {
  3861. temp = minMax[0];
  3862. minMax[0] = minMax[2];
  3863. minMax[2] = temp;
  3864. }
  3865. minMax[0] *= transform[0];
  3866. minMax[2] *= transform[0];
  3867. if (transform[3] < 0) {
  3868. temp = minMax[1];
  3869. minMax[1] = minMax[3];
  3870. minMax[3] = temp;
  3871. }
  3872. minMax[1] *= transform[3];
  3873. minMax[3] *= transform[3];
  3874. } else {
  3875. temp = minMax[0];
  3876. minMax[0] = minMax[1];
  3877. minMax[1] = temp;
  3878. temp = minMax[2];
  3879. minMax[2] = minMax[3];
  3880. minMax[3] = temp;
  3881. if (transform[1] < 0) {
  3882. temp = minMax[1];
  3883. minMax[1] = minMax[3];
  3884. minMax[3] = temp;
  3885. }
  3886. minMax[1] *= transform[1];
  3887. minMax[3] *= transform[1];
  3888. if (transform[2] < 0) {
  3889. temp = minMax[0];
  3890. minMax[0] = minMax[2];
  3891. minMax[2] = temp;
  3892. }
  3893. minMax[0] *= transform[2];
  3894. minMax[2] *= transform[2];
  3895. }
  3896. minMax[0] += transform[4];
  3897. minMax[1] += transform[5];
  3898. minMax[2] += transform[4];
  3899. minMax[3] += transform[5];
  3900. }
  3901. static transform(m1, m2) {
  3902. return [m1[0] * m2[0] + m1[2] * m2[1], m1[1] * m2[0] + m1[3] * m2[1], m1[0] * m2[2] + m1[2] * m2[3], m1[1] * m2[2] + m1[3] * m2[3], m1[0] * m2[4] + m1[2] * m2[5] + m1[4], m1[1] * m2[4] + m1[3] * m2[5] + m1[5]];
  3903. }
  3904. static applyTransform(p, m) {
  3905. const xt = p[0] * m[0] + p[1] * m[2] + m[4];
  3906. const yt = p[0] * m[1] + p[1] * m[3] + m[5];
  3907. return [xt, yt];
  3908. }
  3909. static applyInverseTransform(p, m) {
  3910. const d = m[0] * m[3] - m[1] * m[2];
  3911. const xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d;
  3912. const yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d;
  3913. return [xt, yt];
  3914. }
  3915. static getAxialAlignedBoundingBox(r, m) {
  3916. const p1 = this.applyTransform(r, m);
  3917. const p2 = this.applyTransform(r.slice(2, 4), m);
  3918. const p3 = this.applyTransform([r[0], r[3]], m);
  3919. const p4 = this.applyTransform([r[2], r[1]], m);
  3920. return [Math.min(p1[0], p2[0], p3[0], p4[0]), Math.min(p1[1], p2[1], p3[1], p4[1]), Math.max(p1[0], p2[0], p3[0], p4[0]), Math.max(p1[1], p2[1], p3[1], p4[1])];
  3921. }
  3922. static inverseTransform(m) {
  3923. const d = m[0] * m[3] - m[1] * m[2];
  3924. return [m[3] / d, -m[1] / d, -m[2] / d, m[0] / d, (m[2] * m[5] - m[4] * m[3]) / d, (m[4] * m[1] - m[5] * m[0]) / d];
  3925. }
  3926. static singularValueDecompose2dScale(m) {
  3927. const transpose = [m[0], m[2], m[1], m[3]];
  3928. const a = m[0] * transpose[0] + m[1] * transpose[2];
  3929. const b = m[0] * transpose[1] + m[1] * transpose[3];
  3930. const c = m[2] * transpose[0] + m[3] * transpose[2];
  3931. const d = m[2] * transpose[1] + m[3] * transpose[3];
  3932. const first = (a + d) / 2;
  3933. const second = Math.sqrt((a + d) ** 2 - 4 * (a * d - c * b)) / 2;
  3934. const sx = first + second || 1;
  3935. const sy = first - second || 1;
  3936. return [Math.sqrt(sx), Math.sqrt(sy)];
  3937. }
  3938. static normalizeRect(rect) {
  3939. const r = rect.slice(0);
  3940. if (rect[0] > rect[2]) {
  3941. r[0] = rect[2];
  3942. r[2] = rect[0];
  3943. }
  3944. if (rect[1] > rect[3]) {
  3945. r[1] = rect[3];
  3946. r[3] = rect[1];
  3947. }
  3948. return r;
  3949. }
  3950. static intersect(rect1, rect2) {
  3951. const xLow = Math.max(Math.min(rect1[0], rect1[2]), Math.min(rect2[0], rect2[2]));
  3952. const xHigh = Math.min(Math.max(rect1[0], rect1[2]), Math.max(rect2[0], rect2[2]));
  3953. if (xLow > xHigh) {
  3954. return null;
  3955. }
  3956. const yLow = Math.max(Math.min(rect1[1], rect1[3]), Math.min(rect2[1], rect2[3]));
  3957. const yHigh = Math.min(Math.max(rect1[1], rect1[3]), Math.max(rect2[1], rect2[3]));
  3958. if (yLow > yHigh) {
  3959. return null;
  3960. }
  3961. return [xLow, yLow, xHigh, yHigh];
  3962. }
  3963. static #getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, t, minMax) {
  3964. if (t <= 0 || t >= 1) {
  3965. return;
  3966. }
  3967. const mt = 1 - t;
  3968. const tt = t * t;
  3969. const ttt = tt * t;
  3970. const x = mt * (mt * (mt * x0 + 3 * t * x1) + 3 * tt * x2) + ttt * x3;
  3971. const y = mt * (mt * (mt * y0 + 3 * t * y1) + 3 * tt * y2) + ttt * y3;
  3972. minMax[0] = Math.min(minMax[0], x);
  3973. minMax[1] = Math.min(minMax[1], y);
  3974. minMax[2] = Math.max(minMax[2], x);
  3975. minMax[3] = Math.max(minMax[3], y);
  3976. }
  3977. static #getExtremum(x0, x1, x2, x3, y0, y1, y2, y3, a, b, c, minMax) {
  3978. if (Math.abs(a) < 1e-12) {
  3979. if (Math.abs(b) >= 1e-12) {
  3980. this.#getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, -c / b, minMax);
  3981. }
  3982. return;
  3983. }
  3984. const delta = b ** 2 - 4 * c * a;
  3985. if (delta < 0) {
  3986. return;
  3987. }
  3988. const sqrtDelta = Math.sqrt(delta);
  3989. const a2 = 2 * a;
  3990. this.#getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, (-b + sqrtDelta) / a2, minMax);
  3991. this.#getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, (-b - sqrtDelta) / a2, minMax);
  3992. }
  3993. static bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3, minMax) {
  3994. if (minMax) {
  3995. minMax[0] = Math.min(minMax[0], x0, x3);
  3996. minMax[1] = Math.min(minMax[1], y0, y3);
  3997. minMax[2] = Math.max(minMax[2], x0, x3);
  3998. minMax[3] = Math.max(minMax[3], y0, y3);
  3999. } else {
  4000. minMax = [Math.min(x0, x3), Math.min(y0, y3), Math.max(x0, x3), Math.max(y0, y3)];
  4001. }
  4002. this.#getExtremum(x0, x1, x2, x3, y0, y1, y2, y3, 3 * (-x0 + 3 * (x1 - x2) + x3), 6 * (x0 - 2 * x1 + x2), 3 * (x1 - x0), minMax);
  4003. this.#getExtremum(x0, x1, x2, x3, y0, y1, y2, y3, 3 * (-y0 + 3 * (y1 - y2) + y3), 6 * (y0 - 2 * y1 + y2), 3 * (y1 - y0), minMax);
  4004. return minMax;
  4005. }
  4006. }
  4007. const PDFStringTranslateTable = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2d8, 0x2c7, 0x2c6, 0x2d9, 0x2dd, 0x2db, 0x2da, 0x2dc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, 0x2013, 0x192, 0x2044, 0x2039, 0x203a, 0x2212, 0x2030, 0x201e, 0x201c, 0x201d, 0x2018, 0x2019, 0x201a, 0x2122, 0xfb01, 0xfb02, 0x141, 0x152, 0x160, 0x178, 0x17d, 0x131, 0x142, 0x153, 0x161, 0x17e, 0, 0x20ac];
  4008. function stringToPDFString(str) {
  4009. if (str[0] >= "\xEF") {
  4010. let encoding;
  4011. if (str[0] === "\xFE" && str[1] === "\xFF") {
  4012. encoding = "utf-16be";
  4013. if (str.length % 2 === 1) {
  4014. str = str.slice(0, -1);
  4015. }
  4016. } else if (str[0] === "\xFF" && str[1] === "\xFE") {
  4017. encoding = "utf-16le";
  4018. if (str.length % 2 === 1) {
  4019. str = str.slice(0, -1);
  4020. }
  4021. } else if (str[0] === "\xEF" && str[1] === "\xBB" && str[2] === "\xBF") {
  4022. encoding = "utf-8";
  4023. }
  4024. if (encoding) {
  4025. try {
  4026. const decoder = new TextDecoder(encoding, {
  4027. fatal: true
  4028. });
  4029. const buffer = stringToBytes(str);
  4030. const decoded = decoder.decode(buffer);
  4031. if (!decoded.includes("\x1b")) {
  4032. return decoded;
  4033. }
  4034. return decoded.replaceAll(/\x1b[^\x1b]*(?:\x1b|$)/g, "");
  4035. } catch (ex) {
  4036. warn(`stringToPDFString: "${ex}".`);
  4037. }
  4038. }
  4039. }
  4040. const strBuf = [];
  4041. for (let i = 0, ii = str.length; i < ii; i++) {
  4042. const charCode = str.charCodeAt(i);
  4043. if (charCode === 0x1b) {
  4044. while (++i < ii && str.charCodeAt(i) !== 0x1b) {}
  4045. continue;
  4046. }
  4047. const code = PDFStringTranslateTable[charCode];
  4048. strBuf.push(code ? String.fromCharCode(code) : str.charAt(i));
  4049. }
  4050. return strBuf.join("");
  4051. }
  4052. function stringToUTF8String(str) {
  4053. return decodeURIComponent(escape(str));
  4054. }
  4055. function utf8StringToString(str) {
  4056. return unescape(encodeURIComponent(str));
  4057. }
  4058. function isArrayEqual(arr1, arr2) {
  4059. if (arr1.length !== arr2.length) {
  4060. return false;
  4061. }
  4062. for (let i = 0, ii = arr1.length; i < ii; i++) {
  4063. if (arr1[i] !== arr2[i]) {
  4064. return false;
  4065. }
  4066. }
  4067. return true;
  4068. }
  4069. function getModificationDate(date = new Date()) {
  4070. const buffer = [date.getUTCFullYear().toString(), (date.getUTCMonth() + 1).toString().padStart(2, "0"), date.getUTCDate().toString().padStart(2, "0"), date.getUTCHours().toString().padStart(2, "0"), date.getUTCMinutes().toString().padStart(2, "0"), date.getUTCSeconds().toString().padStart(2, "0")];
  4071. return buffer.join("");
  4072. }
  4073. let NormalizeRegex = null;
  4074. let NormalizationMap = null;
  4075. function normalizeUnicode(str) {
  4076. if (!NormalizeRegex) {
  4077. NormalizeRegex = /([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu;
  4078. NormalizationMap = new Map([["ſt", "ſt"]]);
  4079. }
  4080. return str.replaceAll(NormalizeRegex, (_, p1, p2) => p1 ? p1.normalize("NFKC") : NormalizationMap.get(p2));
  4081. }
  4082. function getUuid() {
  4083. if (typeof crypto !== "undefined" && typeof crypto?.randomUUID === "function") {
  4084. return crypto.randomUUID();
  4085. }
  4086. const buf = new Uint8Array(32);
  4087. if (typeof crypto !== "undefined" && typeof crypto?.getRandomValues === "function") {
  4088. crypto.getRandomValues(buf);
  4089. } else {
  4090. for (let i = 0; i < 32; i++) {
  4091. buf[i] = Math.floor(Math.random() * 255);
  4092. }
  4093. }
  4094. return bytesToString(buf);
  4095. }
  4096. const AnnotationPrefix = "pdfjs_internal_id_";
  4097. const FontRenderOps = {
  4098. BEZIER_CURVE_TO: 0,
  4099. MOVE_TO: 1,
  4100. LINE_TO: 2,
  4101. QUADRATIC_CURVE_TO: 3,
  4102. RESTORE: 4,
  4103. SAVE: 5,
  4104. SCALE: 6,
  4105. TRANSFORM: 7,
  4106. TRANSLATE: 8
  4107. };
  4108. // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.every.js
  4109. var esnext_iterator_every = __webpack_require__(3215);
  4110. ;// ./src/core/primitives.js
  4111. const CIRCULAR_REF = Symbol("CIRCULAR_REF");
  4112. const EOF = Symbol("EOF");
  4113. let CmdCache = Object.create(null);
  4114. let NameCache = Object.create(null);
  4115. let RefCache = Object.create(null);
  4116. function clearPrimitiveCaches() {
  4117. CmdCache = Object.create(null);
  4118. NameCache = Object.create(null);
  4119. RefCache = Object.create(null);
  4120. }
  4121. class Name {
  4122. constructor(name) {
  4123. this.name = name;
  4124. }
  4125. static get(name) {
  4126. return NameCache[name] ||= new Name(name);
  4127. }
  4128. }
  4129. class Cmd {
  4130. constructor(cmd) {
  4131. this.cmd = cmd;
  4132. }
  4133. static get(cmd) {
  4134. return CmdCache[cmd] ||= new Cmd(cmd);
  4135. }
  4136. }
  4137. const nonSerializable = function nonSerializableClosure() {
  4138. return nonSerializable;
  4139. };
  4140. class Dict {
  4141. constructor(xref = null) {
  4142. this._map = Object.create(null);
  4143. this.xref = xref;
  4144. this.objId = null;
  4145. this.suppressEncryption = false;
  4146. this.__nonSerializable__ = nonSerializable;
  4147. }
  4148. assignXref(newXref) {
  4149. this.xref = newXref;
  4150. }
  4151. get size() {
  4152. return Object.keys(this._map).length;
  4153. }
  4154. get(key1, key2, key3) {
  4155. let value = this._map[key1];
  4156. if (value === undefined && key2 !== undefined) {
  4157. value = this._map[key2];
  4158. if (value === undefined && key3 !== undefined) {
  4159. value = this._map[key3];
  4160. }
  4161. }
  4162. if (value instanceof Ref && this.xref) {
  4163. return this.xref.fetch(value, this.suppressEncryption);
  4164. }
  4165. return value;
  4166. }
  4167. async getAsync(key1, key2, key3) {
  4168. let value = this._map[key1];
  4169. if (value === undefined && key2 !== undefined) {
  4170. value = this._map[key2];
  4171. if (value === undefined && key3 !== undefined) {
  4172. value = this._map[key3];
  4173. }
  4174. }
  4175. if (value instanceof Ref && this.xref) {
  4176. return this.xref.fetchAsync(value, this.suppressEncryption);
  4177. }
  4178. return value;
  4179. }
  4180. getArray(key1, key2, key3) {
  4181. let value = this._map[key1];
  4182. if (value === undefined && key2 !== undefined) {
  4183. value = this._map[key2];
  4184. if (value === undefined && key3 !== undefined) {
  4185. value = this._map[key3];
  4186. }
  4187. }
  4188. if (value instanceof Ref && this.xref) {
  4189. value = this.xref.fetch(value, this.suppressEncryption);
  4190. }
  4191. if (Array.isArray(value)) {
  4192. value = value.slice();
  4193. for (let i = 0, ii = value.length; i < ii; i++) {
  4194. if (value[i] instanceof Ref && this.xref) {
  4195. value[i] = this.xref.fetch(value[i], this.suppressEncryption);
  4196. }
  4197. }
  4198. }
  4199. return value;
  4200. }
  4201. getRaw(key) {
  4202. return this._map[key];
  4203. }
  4204. getKeys() {
  4205. return Object.keys(this._map);
  4206. }
  4207. getRawValues() {
  4208. return Object.values(this._map);
  4209. }
  4210. set(key, value) {
  4211. this._map[key] = value;
  4212. }
  4213. has(key) {
  4214. return this._map[key] !== undefined;
  4215. }
  4216. forEach(callback) {
  4217. for (const key in this._map) {
  4218. callback(key, this.get(key));
  4219. }
  4220. }
  4221. static get empty() {
  4222. const emptyDict = new Dict(null);
  4223. emptyDict.set = (key, value) => {
  4224. unreachable("Should not call `set` on the empty dictionary.");
  4225. };
  4226. return shadow(this, "empty", emptyDict);
  4227. }
  4228. static merge({
  4229. xref,
  4230. dictArray,
  4231. mergeSubDicts = false
  4232. }) {
  4233. const mergedDict = new Dict(xref),
  4234. properties = new Map();
  4235. for (const dict of dictArray) {
  4236. if (!(dict instanceof Dict)) {
  4237. continue;
  4238. }
  4239. for (const [key, value] of Object.entries(dict._map)) {
  4240. let property = properties.get(key);
  4241. if (property === undefined) {
  4242. property = [];
  4243. properties.set(key, property);
  4244. } else if (!mergeSubDicts || !(value instanceof Dict)) {
  4245. continue;
  4246. }
  4247. property.push(value);
  4248. }
  4249. }
  4250. for (const [name, values] of properties) {
  4251. if (values.length === 1 || !(values[0] instanceof Dict)) {
  4252. mergedDict._map[name] = values[0];
  4253. continue;
  4254. }
  4255. const subDict = new Dict(xref);
  4256. for (const dict of values) {
  4257. for (const [key, value] of Object.entries(dict._map)) {
  4258. if (subDict._map[key] === undefined) {
  4259. subDict._map[key] = value;
  4260. }
  4261. }
  4262. }
  4263. if (subDict.size > 0) {
  4264. mergedDict._map[name] = subDict;
  4265. }
  4266. }
  4267. properties.clear();
  4268. return mergedDict.size > 0 ? mergedDict : Dict.empty;
  4269. }
  4270. clone() {
  4271. const dict = new Dict(this.xref);
  4272. for (const key of this.getKeys()) {
  4273. dict.set(key, this.getRaw(key));
  4274. }
  4275. return dict;
  4276. }
  4277. delete(key) {
  4278. delete this._map[key];
  4279. }
  4280. }
  4281. class Ref {
  4282. constructor(num, gen) {
  4283. this.num = num;
  4284. this.gen = gen;
  4285. }
  4286. toString() {
  4287. if (this.gen === 0) {
  4288. return `${this.num}R`;
  4289. }
  4290. return `${this.num}R${this.gen}`;
  4291. }
  4292. static fromString(str) {
  4293. const ref = RefCache[str];
  4294. if (ref) {
  4295. return ref;
  4296. }
  4297. const m = /^(\d+)R(\d*)$/.exec(str);
  4298. if (!m || m[1] === "0") {
  4299. return null;
  4300. }
  4301. return RefCache[str] = new Ref(parseInt(m[1]), !m[2] ? 0 : parseInt(m[2]));
  4302. }
  4303. static get(num, gen) {
  4304. const key = gen === 0 ? `${num}R` : `${num}R${gen}`;
  4305. return RefCache[key] ||= new Ref(num, gen);
  4306. }
  4307. }
  4308. class RefSet {
  4309. constructor(parent = null) {
  4310. this._set = new Set(parent?._set);
  4311. }
  4312. has(ref) {
  4313. return this._set.has(ref.toString());
  4314. }
  4315. put(ref) {
  4316. this._set.add(ref.toString());
  4317. }
  4318. remove(ref) {
  4319. this._set.delete(ref.toString());
  4320. }
  4321. [Symbol.iterator]() {
  4322. return this._set.values();
  4323. }
  4324. clear() {
  4325. this._set.clear();
  4326. }
  4327. }
  4328. class RefSetCache {
  4329. constructor() {
  4330. this._map = new Map();
  4331. }
  4332. get size() {
  4333. return this._map.size;
  4334. }
  4335. get(ref) {
  4336. return this._map.get(ref.toString());
  4337. }
  4338. has(ref) {
  4339. return this._map.has(ref.toString());
  4340. }
  4341. put(ref, obj) {
  4342. this._map.set(ref.toString(), obj);
  4343. }
  4344. putAlias(ref, aliasRef) {
  4345. this._map.set(ref.toString(), this.get(aliasRef));
  4346. }
  4347. [Symbol.iterator]() {
  4348. return this._map.values();
  4349. }
  4350. clear() {
  4351. this._map.clear();
  4352. }
  4353. *items() {
  4354. for (const [ref, value] of this._map) {
  4355. yield [Ref.fromString(ref), value];
  4356. }
  4357. }
  4358. }
  4359. function isName(v, name) {
  4360. return v instanceof Name && (name === undefined || v.name === name);
  4361. }
  4362. function isCmd(v, cmd) {
  4363. return v instanceof Cmd && (cmd === undefined || v.cmd === cmd);
  4364. }
  4365. function isDict(v, type) {
  4366. return v instanceof Dict && (type === undefined || isName(v.get("Type"), type));
  4367. }
  4368. function isRefsEqual(v1, v2) {
  4369. return v1.num === v2.num && v1.gen === v2.gen;
  4370. }
  4371. ;// ./src/core/base_stream.js
  4372. class BaseStream {
  4373. get length() {
  4374. unreachable("Abstract getter `length` accessed");
  4375. }
  4376. get isEmpty() {
  4377. unreachable("Abstract getter `isEmpty` accessed");
  4378. }
  4379. get isDataLoaded() {
  4380. return shadow(this, "isDataLoaded", true);
  4381. }
  4382. getByte() {
  4383. unreachable("Abstract method `getByte` called");
  4384. }
  4385. getBytes(length) {
  4386. unreachable("Abstract method `getBytes` called");
  4387. }
  4388. async getImageData(length, decoderOptions) {
  4389. return this.getBytes(length, decoderOptions);
  4390. }
  4391. async asyncGetBytes() {
  4392. unreachable("Abstract method `asyncGetBytes` called");
  4393. }
  4394. get isAsync() {
  4395. return false;
  4396. }
  4397. get canAsyncDecodeImageFromBuffer() {
  4398. return false;
  4399. }
  4400. peekByte() {
  4401. const peekedByte = this.getByte();
  4402. if (peekedByte !== -1) {
  4403. this.pos--;
  4404. }
  4405. return peekedByte;
  4406. }
  4407. peekBytes(length) {
  4408. const bytes = this.getBytes(length);
  4409. this.pos -= bytes.length;
  4410. return bytes;
  4411. }
  4412. getUint16() {
  4413. const b0 = this.getByte();
  4414. const b1 = this.getByte();
  4415. if (b0 === -1 || b1 === -1) {
  4416. return -1;
  4417. }
  4418. return (b0 << 8) + b1;
  4419. }
  4420. getInt32() {
  4421. const b0 = this.getByte();
  4422. const b1 = this.getByte();
  4423. const b2 = this.getByte();
  4424. const b3 = this.getByte();
  4425. return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3;
  4426. }
  4427. getByteRange(begin, end) {
  4428. unreachable("Abstract method `getByteRange` called");
  4429. }
  4430. getString(length) {
  4431. return bytesToString(this.getBytes(length));
  4432. }
  4433. skip(n) {
  4434. this.pos += n || 1;
  4435. }
  4436. reset() {
  4437. unreachable("Abstract method `reset` called");
  4438. }
  4439. moveStart() {
  4440. unreachable("Abstract method `moveStart` called");
  4441. }
  4442. makeSubStream(start, length, dict = null) {
  4443. unreachable("Abstract method `makeSubStream` called");
  4444. }
  4445. getBaseStreams() {
  4446. return null;
  4447. }
  4448. }
  4449. ;// ./src/core/core_utils.js
  4450. const PDF_VERSION_REGEXP = /^[1-9]\.\d$/;
  4451. function getLookupTableFactory(initializer) {
  4452. let lookup;
  4453. return function () {
  4454. if (initializer) {
  4455. lookup = Object.create(null);
  4456. initializer(lookup);
  4457. initializer = null;
  4458. }
  4459. return lookup;
  4460. };
  4461. }
  4462. class MissingDataException extends BaseException {
  4463. constructor(begin, end) {
  4464. super(`Missing data [${begin}, ${end})`, "MissingDataException");
  4465. this.begin = begin;
  4466. this.end = end;
  4467. }
  4468. }
  4469. class ParserEOFException extends BaseException {
  4470. constructor(msg) {
  4471. super(msg, "ParserEOFException");
  4472. }
  4473. }
  4474. class XRefEntryException extends BaseException {
  4475. constructor(msg) {
  4476. super(msg, "XRefEntryException");
  4477. }
  4478. }
  4479. class XRefParseException extends BaseException {
  4480. constructor(msg) {
  4481. super(msg, "XRefParseException");
  4482. }
  4483. }
  4484. function arrayBuffersToBytes(arr) {
  4485. const length = arr.length;
  4486. if (length === 0) {
  4487. return new Uint8Array(0);
  4488. }
  4489. if (length === 1) {
  4490. return new Uint8Array(arr[0]);
  4491. }
  4492. let dataLength = 0;
  4493. for (let i = 0; i < length; i++) {
  4494. dataLength += arr[i].byteLength;
  4495. }
  4496. const data = new Uint8Array(dataLength);
  4497. let pos = 0;
  4498. for (let i = 0; i < length; i++) {
  4499. const item = new Uint8Array(arr[i]);
  4500. data.set(item, pos);
  4501. pos += item.byteLength;
  4502. }
  4503. return data;
  4504. }
  4505. function getInheritableProperty({
  4506. dict,
  4507. key,
  4508. getArray = false,
  4509. stopWhenFound = true
  4510. }) {
  4511. let values;
  4512. const visited = new RefSet();
  4513. while (dict instanceof Dict && !(dict.objId && visited.has(dict.objId))) {
  4514. if (dict.objId) {
  4515. visited.put(dict.objId);
  4516. }
  4517. const value = getArray ? dict.getArray(key) : dict.get(key);
  4518. if (value !== undefined) {
  4519. if (stopWhenFound) {
  4520. return value;
  4521. }
  4522. (values ||= []).push(value);
  4523. }
  4524. dict = dict.get("Parent");
  4525. }
  4526. return values;
  4527. }
  4528. const ROMAN_NUMBER_MAP = ["", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM", "", "X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC", "", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX"];
  4529. function toRomanNumerals(number, lowerCase = false) {
  4530. assert(Number.isInteger(number) && number > 0, "The number should be a positive integer.");
  4531. const romanBuf = [];
  4532. let pos;
  4533. while (number >= 1000) {
  4534. number -= 1000;
  4535. romanBuf.push("M");
  4536. }
  4537. pos = number / 100 | 0;
  4538. number %= 100;
  4539. romanBuf.push(ROMAN_NUMBER_MAP[pos]);
  4540. pos = number / 10 | 0;
  4541. number %= 10;
  4542. romanBuf.push(ROMAN_NUMBER_MAP[10 + pos]);
  4543. romanBuf.push(ROMAN_NUMBER_MAP[20 + number]);
  4544. const romanStr = romanBuf.join("");
  4545. return lowerCase ? romanStr.toLowerCase() : romanStr;
  4546. }
  4547. function log2(x) {
  4548. if (x <= 0) {
  4549. return 0;
  4550. }
  4551. return Math.ceil(Math.log2(x));
  4552. }
  4553. function readInt8(data, offset) {
  4554. return data[offset] << 24 >> 24;
  4555. }
  4556. function readUint16(data, offset) {
  4557. return data[offset] << 8 | data[offset + 1];
  4558. }
  4559. function readUint32(data, offset) {
  4560. return (data[offset] << 24 | data[offset + 1] << 16 | data[offset + 2] << 8 | data[offset + 3]) >>> 0;
  4561. }
  4562. function isWhiteSpace(ch) {
  4563. return ch === 0x20 || ch === 0x09 || ch === 0x0d || ch === 0x0a;
  4564. }
  4565. function isBooleanArray(arr, len) {
  4566. return Array.isArray(arr) && (len === null || arr.length === len) && arr.every(x => typeof x === "boolean");
  4567. }
  4568. function isNumberArray(arr, len) {
  4569. if (Array.isArray(arr)) {
  4570. return (len === null || arr.length === len) && arr.every(x => typeof x === "number");
  4571. }
  4572. return ArrayBuffer.isView(arr) && (arr.length === 0 || typeof arr[0] === "number") && (len === null || arr.length === len);
  4573. }
  4574. function lookupMatrix(arr, fallback) {
  4575. return isNumberArray(arr, 6) ? arr : fallback;
  4576. }
  4577. function lookupRect(arr, fallback) {
  4578. return isNumberArray(arr, 4) ? arr : fallback;
  4579. }
  4580. function lookupNormalRect(arr, fallback) {
  4581. return isNumberArray(arr, 4) ? Util.normalizeRect(arr) : fallback;
  4582. }
  4583. function parseXFAPath(path) {
  4584. const positionPattern = /(.+)\[(\d+)\]$/;
  4585. return path.split(".").map(component => {
  4586. const m = component.match(positionPattern);
  4587. if (m) {
  4588. return {
  4589. name: m[1],
  4590. pos: parseInt(m[2], 10)
  4591. };
  4592. }
  4593. return {
  4594. name: component,
  4595. pos: 0
  4596. };
  4597. });
  4598. }
  4599. function escapePDFName(str) {
  4600. const buffer = [];
  4601. let start = 0;
  4602. for (let i = 0, ii = str.length; i < ii; i++) {
  4603. const char = str.charCodeAt(i);
  4604. if (char < 0x21 || char > 0x7e || char === 0x23 || char === 0x28 || char === 0x29 || char === 0x3c || char === 0x3e || char === 0x5b || char === 0x5d || char === 0x7b || char === 0x7d || char === 0x2f || char === 0x25) {
  4605. if (start < i) {
  4606. buffer.push(str.substring(start, i));
  4607. }
  4608. buffer.push(`#${char.toString(16)}`);
  4609. start = i + 1;
  4610. }
  4611. }
  4612. if (buffer.length === 0) {
  4613. return str;
  4614. }
  4615. if (start < str.length) {
  4616. buffer.push(str.substring(start, str.length));
  4617. }
  4618. return buffer.join("");
  4619. }
  4620. function escapeString(str) {
  4621. return str.replaceAll(/([()\\\n\r])/g, match => {
  4622. if (match === "\n") {
  4623. return "\\n";
  4624. } else if (match === "\r") {
  4625. return "\\r";
  4626. }
  4627. return `\\${match}`;
  4628. });
  4629. }
  4630. function _collectJS(entry, xref, list, parents) {
  4631. if (!entry) {
  4632. return;
  4633. }
  4634. let parent = null;
  4635. if (entry instanceof Ref) {
  4636. if (parents.has(entry)) {
  4637. return;
  4638. }
  4639. parent = entry;
  4640. parents.put(parent);
  4641. entry = xref.fetch(entry);
  4642. }
  4643. if (Array.isArray(entry)) {
  4644. for (const element of entry) {
  4645. _collectJS(element, xref, list, parents);
  4646. }
  4647. } else if (entry instanceof Dict) {
  4648. if (isName(entry.get("S"), "JavaScript")) {
  4649. const js = entry.get("JS");
  4650. let code;
  4651. if (js instanceof BaseStream) {
  4652. code = js.getString();
  4653. } else if (typeof js === "string") {
  4654. code = js;
  4655. }
  4656. code &&= stringToPDFString(code).replaceAll("\x00", "");
  4657. if (code) {
  4658. list.push(code);
  4659. }
  4660. }
  4661. _collectJS(entry.getRaw("Next"), xref, list, parents);
  4662. }
  4663. if (parent) {
  4664. parents.remove(parent);
  4665. }
  4666. }
  4667. function collectActions(xref, dict, eventType) {
  4668. const actions = Object.create(null);
  4669. const additionalActionsDicts = getInheritableProperty({
  4670. dict,
  4671. key: "AA",
  4672. stopWhenFound: false
  4673. });
  4674. if (additionalActionsDicts) {
  4675. for (let i = additionalActionsDicts.length - 1; i >= 0; i--) {
  4676. const additionalActions = additionalActionsDicts[i];
  4677. if (!(additionalActions instanceof Dict)) {
  4678. continue;
  4679. }
  4680. for (const key of additionalActions.getKeys()) {
  4681. const action = eventType[key];
  4682. if (!action) {
  4683. continue;
  4684. }
  4685. const actionDict = additionalActions.getRaw(key);
  4686. const parents = new RefSet();
  4687. const list = [];
  4688. _collectJS(actionDict, xref, list, parents);
  4689. if (list.length > 0) {
  4690. actions[action] = list;
  4691. }
  4692. }
  4693. }
  4694. }
  4695. if (dict.has("A")) {
  4696. const actionDict = dict.get("A");
  4697. const parents = new RefSet();
  4698. const list = [];
  4699. _collectJS(actionDict, xref, list, parents);
  4700. if (list.length > 0) {
  4701. actions.Action = list;
  4702. }
  4703. }
  4704. return objectSize(actions) > 0 ? actions : null;
  4705. }
  4706. const XMLEntities = {
  4707. 0x3c: "&lt;",
  4708. 0x3e: "&gt;",
  4709. 0x26: "&amp;",
  4710. 0x22: "&quot;",
  4711. 0x27: "&apos;"
  4712. };
  4713. function* codePointIter(str) {
  4714. for (let i = 0, ii = str.length; i < ii; i++) {
  4715. const char = str.codePointAt(i);
  4716. if (char > 0xd7ff && (char < 0xe000 || char > 0xfffd)) {
  4717. i++;
  4718. }
  4719. yield char;
  4720. }
  4721. }
  4722. function encodeToXmlString(str) {
  4723. const buffer = [];
  4724. let start = 0;
  4725. for (let i = 0, ii = str.length; i < ii; i++) {
  4726. const char = str.codePointAt(i);
  4727. if (0x20 <= char && char <= 0x7e) {
  4728. const entity = XMLEntities[char];
  4729. if (entity) {
  4730. if (start < i) {
  4731. buffer.push(str.substring(start, i));
  4732. }
  4733. buffer.push(entity);
  4734. start = i + 1;
  4735. }
  4736. } else {
  4737. if (start < i) {
  4738. buffer.push(str.substring(start, i));
  4739. }
  4740. buffer.push(`&#x${char.toString(16).toUpperCase()};`);
  4741. if (char > 0xd7ff && (char < 0xe000 || char > 0xfffd)) {
  4742. i++;
  4743. }
  4744. start = i + 1;
  4745. }
  4746. }
  4747. if (buffer.length === 0) {
  4748. return str;
  4749. }
  4750. if (start < str.length) {
  4751. buffer.push(str.substring(start, str.length));
  4752. }
  4753. return buffer.join("");
  4754. }
  4755. function validateFontName(fontFamily, mustWarn = false) {
  4756. const m = /^("|').*("|')$/.exec(fontFamily);
  4757. if (m && m[1] === m[2]) {
  4758. const re = new RegExp(`[^\\\\]${m[1]}`);
  4759. if (re.test(fontFamily.slice(1, -1))) {
  4760. if (mustWarn) {
  4761. warn(`FontFamily contains unescaped ${m[1]}: ${fontFamily}.`);
  4762. }
  4763. return false;
  4764. }
  4765. } else {
  4766. for (const ident of fontFamily.split(/[ \t]+/)) {
  4767. if (/^(\d|(-(\d|-)))/.test(ident) || !/^[\w-\\]+$/.test(ident)) {
  4768. if (mustWarn) {
  4769. warn(`FontFamily contains invalid <custom-ident>: ${fontFamily}.`);
  4770. }
  4771. return false;
  4772. }
  4773. }
  4774. }
  4775. return true;
  4776. }
  4777. function validateCSSFont(cssFontInfo) {
  4778. const DEFAULT_CSS_FONT_OBLIQUE = "14";
  4779. const DEFAULT_CSS_FONT_WEIGHT = "400";
  4780. const CSS_FONT_WEIGHT_VALUES = new Set(["100", "200", "300", "400", "500", "600", "700", "800", "900", "1000", "normal", "bold", "bolder", "lighter"]);
  4781. const {
  4782. fontFamily,
  4783. fontWeight,
  4784. italicAngle
  4785. } = cssFontInfo;
  4786. if (!validateFontName(fontFamily, true)) {
  4787. return false;
  4788. }
  4789. const weight = fontWeight ? fontWeight.toString() : "";
  4790. cssFontInfo.fontWeight = CSS_FONT_WEIGHT_VALUES.has(weight) ? weight : DEFAULT_CSS_FONT_WEIGHT;
  4791. const angle = parseFloat(italicAngle);
  4792. cssFontInfo.italicAngle = isNaN(angle) || angle < -90 || angle > 90 ? DEFAULT_CSS_FONT_OBLIQUE : italicAngle.toString();
  4793. return true;
  4794. }
  4795. function recoverJsURL(str) {
  4796. const URL_OPEN_METHODS = ["app.launchURL", "window.open", "xfa.host.gotoURL"];
  4797. const regex = new RegExp("^\\s*(" + URL_OPEN_METHODS.join("|").replaceAll(".", "\\.") + ")\\((?:'|\")([^'\"]*)(?:'|\")(?:,\\s*(\\w+)\\)|\\))", "i");
  4798. const jsUrl = regex.exec(str);
  4799. if (jsUrl?.[2]) {
  4800. const url = jsUrl[2];
  4801. let newWindow = false;
  4802. if (jsUrl[3] === "true" && jsUrl[1] === "app.launchURL") {
  4803. newWindow = true;
  4804. }
  4805. return {
  4806. url,
  4807. newWindow
  4808. };
  4809. }
  4810. return null;
  4811. }
  4812. function numberToString(value) {
  4813. if (Number.isInteger(value)) {
  4814. return value.toString();
  4815. }
  4816. const roundedValue = Math.round(value * 100);
  4817. if (roundedValue % 100 === 0) {
  4818. return (roundedValue / 100).toString();
  4819. }
  4820. if (roundedValue % 10 === 0) {
  4821. return value.toFixed(1);
  4822. }
  4823. return value.toFixed(2);
  4824. }
  4825. function getNewAnnotationsMap(annotationStorage) {
  4826. if (!annotationStorage) {
  4827. return null;
  4828. }
  4829. const newAnnotationsByPage = new Map();
  4830. for (const [key, value] of annotationStorage) {
  4831. if (!key.startsWith(AnnotationEditorPrefix)) {
  4832. continue;
  4833. }
  4834. let annotations = newAnnotationsByPage.get(value.pageIndex);
  4835. if (!annotations) {
  4836. annotations = [];
  4837. newAnnotationsByPage.set(value.pageIndex, annotations);
  4838. }
  4839. annotations.push(value);
  4840. }
  4841. return newAnnotationsByPage.size > 0 ? newAnnotationsByPage : null;
  4842. }
  4843. function stringToAsciiOrUTF16BE(str) {
  4844. return isAscii(str) ? str : stringToUTF16String(str, true);
  4845. }
  4846. function isAscii(str) {
  4847. return /^[\x00-\x7F]*$/.test(str);
  4848. }
  4849. function stringToUTF16HexString(str) {
  4850. const buf = [];
  4851. for (let i = 0, ii = str.length; i < ii; i++) {
  4852. const char = str.charCodeAt(i);
  4853. buf.push((char >> 8 & 0xff).toString(16).padStart(2, "0"), (char & 0xff).toString(16).padStart(2, "0"));
  4854. }
  4855. return buf.join("");
  4856. }
  4857. function stringToUTF16String(str, bigEndian = false) {
  4858. const buf = [];
  4859. if (bigEndian) {
  4860. buf.push("\xFE\xFF");
  4861. }
  4862. for (let i = 0, ii = str.length; i < ii; i++) {
  4863. const char = str.charCodeAt(i);
  4864. buf.push(String.fromCharCode(char >> 8 & 0xff), String.fromCharCode(char & 0xff));
  4865. }
  4866. return buf.join("");
  4867. }
  4868. function getRotationMatrix(rotation, width, height) {
  4869. switch (rotation) {
  4870. case 90:
  4871. return [0, 1, -1, 0, width, 0];
  4872. case 180:
  4873. return [-1, 0, 0, -1, width, height];
  4874. case 270:
  4875. return [0, -1, 1, 0, 0, height];
  4876. default:
  4877. throw new Error("Invalid rotation");
  4878. }
  4879. }
  4880. function getSizeInBytes(x) {
  4881. return Math.ceil(Math.ceil(Math.log2(1 + x)) / 8);
  4882. }
  4883. ;// ./src/core/stream.js
  4884. class Stream extends BaseStream {
  4885. constructor(arrayBuffer, start, length, dict) {
  4886. super();
  4887. this.bytes = arrayBuffer instanceof Uint8Array ? arrayBuffer : new Uint8Array(arrayBuffer);
  4888. this.start = start || 0;
  4889. this.pos = this.start;
  4890. this.end = start + length || this.bytes.length;
  4891. this.dict = dict;
  4892. }
  4893. get length() {
  4894. return this.end - this.start;
  4895. }
  4896. get isEmpty() {
  4897. return this.length === 0;
  4898. }
  4899. getByte() {
  4900. if (this.pos >= this.end) {
  4901. return -1;
  4902. }
  4903. return this.bytes[this.pos++];
  4904. }
  4905. getBytes(length) {
  4906. const bytes = this.bytes;
  4907. const pos = this.pos;
  4908. const strEnd = this.end;
  4909. if (!length) {
  4910. return bytes.subarray(pos, strEnd);
  4911. }
  4912. let end = pos + length;
  4913. if (end > strEnd) {
  4914. end = strEnd;
  4915. }
  4916. this.pos = end;
  4917. return bytes.subarray(pos, end);
  4918. }
  4919. getByteRange(begin, end) {
  4920. if (begin < 0) {
  4921. begin = 0;
  4922. }
  4923. if (end > this.end) {
  4924. end = this.end;
  4925. }
  4926. return this.bytes.subarray(begin, end);
  4927. }
  4928. reset() {
  4929. this.pos = this.start;
  4930. }
  4931. moveStart() {
  4932. this.start = this.pos;
  4933. }
  4934. makeSubStream(start, length, dict = null) {
  4935. return new Stream(this.bytes.buffer, start, length, dict);
  4936. }
  4937. }
  4938. class StringStream extends Stream {
  4939. constructor(str) {
  4940. super(stringToBytes(str));
  4941. }
  4942. }
  4943. class NullStream extends Stream {
  4944. constructor() {
  4945. super(new Uint8Array(0));
  4946. }
  4947. }
  4948. ;// ./src/core/chunked_stream.js
  4949. class ChunkedStream extends Stream {
  4950. constructor(length, chunkSize, manager) {
  4951. super(new Uint8Array(length), 0, length, null);
  4952. this.chunkSize = chunkSize;
  4953. this._loadedChunks = new Set();
  4954. this.numChunks = Math.ceil(length / chunkSize);
  4955. this.manager = manager;
  4956. this.progressiveDataLength = 0;
  4957. this.lastSuccessfulEnsureByteChunk = -1;
  4958. }
  4959. getMissingChunks() {
  4960. const chunks = [];
  4961. for (let chunk = 0, n = this.numChunks; chunk < n; ++chunk) {
  4962. if (!this._loadedChunks.has(chunk)) {
  4963. chunks.push(chunk);
  4964. }
  4965. }
  4966. return chunks;
  4967. }
  4968. get numChunksLoaded() {
  4969. return this._loadedChunks.size;
  4970. }
  4971. get isDataLoaded() {
  4972. return this.numChunksLoaded === this.numChunks;
  4973. }
  4974. onReceiveData(begin, chunk) {
  4975. const chunkSize = this.chunkSize;
  4976. if (begin % chunkSize !== 0) {
  4977. throw new Error(`Bad begin offset: ${begin}`);
  4978. }
  4979. const end = begin + chunk.byteLength;
  4980. if (end % chunkSize !== 0 && end !== this.bytes.length) {
  4981. throw new Error(`Bad end offset: ${end}`);
  4982. }
  4983. this.bytes.set(new Uint8Array(chunk), begin);
  4984. const beginChunk = Math.floor(begin / chunkSize);
  4985. const endChunk = Math.floor((end - 1) / chunkSize) + 1;
  4986. for (let curChunk = beginChunk; curChunk < endChunk; ++curChunk) {
  4987. this._loadedChunks.add(curChunk);
  4988. }
  4989. }
  4990. onReceiveProgressiveData(data) {
  4991. let position = this.progressiveDataLength;
  4992. const beginChunk = Math.floor(position / this.chunkSize);
  4993. this.bytes.set(new Uint8Array(data), position);
  4994. position += data.byteLength;
  4995. this.progressiveDataLength = position;
  4996. const endChunk = position >= this.end ? this.numChunks : Math.floor(position / this.chunkSize);
  4997. for (let curChunk = beginChunk; curChunk < endChunk; ++curChunk) {
  4998. this._loadedChunks.add(curChunk);
  4999. }
  5000. }
  5001. ensureByte(pos) {
  5002. if (pos < this.progressiveDataLength) {
  5003. return;
  5004. }
  5005. const chunk = Math.floor(pos / this.chunkSize);
  5006. if (chunk > this.numChunks) {
  5007. return;
  5008. }
  5009. if (chunk === this.lastSuccessfulEnsureByteChunk) {
  5010. return;
  5011. }
  5012. if (!this._loadedChunks.has(chunk)) {
  5013. throw new MissingDataException(pos, pos + 1);
  5014. }
  5015. this.lastSuccessfulEnsureByteChunk = chunk;
  5016. }
  5017. ensureRange(begin, end) {
  5018. if (begin >= end) {
  5019. return;
  5020. }
  5021. if (end <= this.progressiveDataLength) {
  5022. return;
  5023. }
  5024. const beginChunk = Math.floor(begin / this.chunkSize);
  5025. if (beginChunk > this.numChunks) {
  5026. return;
  5027. }
  5028. const endChunk = Math.min(Math.floor((end - 1) / this.chunkSize) + 1, this.numChunks);
  5029. for (let chunk = beginChunk; chunk < endChunk; ++chunk) {
  5030. if (!this._loadedChunks.has(chunk)) {
  5031. throw new MissingDataException(begin, end);
  5032. }
  5033. }
  5034. }
  5035. nextEmptyChunk(beginChunk) {
  5036. const numChunks = this.numChunks;
  5037. for (let i = 0; i < numChunks; ++i) {
  5038. const chunk = (beginChunk + i) % numChunks;
  5039. if (!this._loadedChunks.has(chunk)) {
  5040. return chunk;
  5041. }
  5042. }
  5043. return null;
  5044. }
  5045. hasChunk(chunk) {
  5046. return this._loadedChunks.has(chunk);
  5047. }
  5048. getByte() {
  5049. const pos = this.pos;
  5050. if (pos >= this.end) {
  5051. return -1;
  5052. }
  5053. if (pos >= this.progressiveDataLength) {
  5054. this.ensureByte(pos);
  5055. }
  5056. return this.bytes[this.pos++];
  5057. }
  5058. getBytes(length) {
  5059. const bytes = this.bytes;
  5060. const pos = this.pos;
  5061. const strEnd = this.end;
  5062. if (!length) {
  5063. if (strEnd > this.progressiveDataLength) {
  5064. this.ensureRange(pos, strEnd);
  5065. }
  5066. return bytes.subarray(pos, strEnd);
  5067. }
  5068. let end = pos + length;
  5069. if (end > strEnd) {
  5070. end = strEnd;
  5071. }
  5072. if (end > this.progressiveDataLength) {
  5073. this.ensureRange(pos, end);
  5074. }
  5075. this.pos = end;
  5076. return bytes.subarray(pos, end);
  5077. }
  5078. getByteRange(begin, end) {
  5079. if (begin < 0) {
  5080. begin = 0;
  5081. }
  5082. if (end > this.end) {
  5083. end = this.end;
  5084. }
  5085. if (end > this.progressiveDataLength) {
  5086. this.ensureRange(begin, end);
  5087. }
  5088. return this.bytes.subarray(begin, end);
  5089. }
  5090. makeSubStream(start, length, dict = null) {
  5091. if (length) {
  5092. if (start + length > this.progressiveDataLength) {
  5093. this.ensureRange(start, start + length);
  5094. }
  5095. } else if (start >= this.progressiveDataLength) {
  5096. this.ensureByte(start);
  5097. }
  5098. function ChunkedStreamSubstream() {}
  5099. ChunkedStreamSubstream.prototype = Object.create(this);
  5100. ChunkedStreamSubstream.prototype.getMissingChunks = function () {
  5101. const chunkSize = this.chunkSize;
  5102. const beginChunk = Math.floor(this.start / chunkSize);
  5103. const endChunk = Math.floor((this.end - 1) / chunkSize) + 1;
  5104. const missingChunks = [];
  5105. for (let chunk = beginChunk; chunk < endChunk; ++chunk) {
  5106. if (!this._loadedChunks.has(chunk)) {
  5107. missingChunks.push(chunk);
  5108. }
  5109. }
  5110. return missingChunks;
  5111. };
  5112. Object.defineProperty(ChunkedStreamSubstream.prototype, "isDataLoaded", {
  5113. get() {
  5114. if (this.numChunksLoaded === this.numChunks) {
  5115. return true;
  5116. }
  5117. return this.getMissingChunks().length === 0;
  5118. },
  5119. configurable: true
  5120. });
  5121. const subStream = new ChunkedStreamSubstream();
  5122. subStream.pos = subStream.start = start;
  5123. subStream.end = start + length || this.end;
  5124. subStream.dict = dict;
  5125. return subStream;
  5126. }
  5127. getBaseStreams() {
  5128. return [this];
  5129. }
  5130. }
  5131. class ChunkedStreamManager {
  5132. constructor(pdfNetworkStream, args) {
  5133. this.length = args.length;
  5134. this.chunkSize = args.rangeChunkSize;
  5135. this.stream = new ChunkedStream(this.length, this.chunkSize, this);
  5136. this.pdfNetworkStream = pdfNetworkStream;
  5137. this.disableAutoFetch = args.disableAutoFetch;
  5138. this.msgHandler = args.msgHandler;
  5139. this.currRequestId = 0;
  5140. this._chunksNeededByRequest = new Map();
  5141. this._requestsByChunk = new Map();
  5142. this._promisesByRequest = new Map();
  5143. this.progressiveDataLength = 0;
  5144. this.aborted = false;
  5145. this._loadedStreamCapability = Promise.withResolvers();
  5146. }
  5147. sendRequest(begin, end) {
  5148. const rangeReader = this.pdfNetworkStream.getRangeReader(begin, end);
  5149. if (!rangeReader.isStreamingSupported) {
  5150. rangeReader.onProgress = this.onProgress.bind(this);
  5151. }
  5152. let chunks = [],
  5153. loaded = 0;
  5154. return new Promise((resolve, reject) => {
  5155. const readChunk = ({
  5156. value,
  5157. done
  5158. }) => {
  5159. try {
  5160. if (done) {
  5161. const chunkData = arrayBuffersToBytes(chunks);
  5162. chunks = null;
  5163. resolve(chunkData);
  5164. return;
  5165. }
  5166. loaded += value.byteLength;
  5167. if (rangeReader.isStreamingSupported) {
  5168. this.onProgress({
  5169. loaded
  5170. });
  5171. }
  5172. chunks.push(value);
  5173. rangeReader.read().then(readChunk, reject);
  5174. } catch (e) {
  5175. reject(e);
  5176. }
  5177. };
  5178. rangeReader.read().then(readChunk, reject);
  5179. }).then(data => {
  5180. if (this.aborted) {
  5181. return;
  5182. }
  5183. this.onReceiveData({
  5184. chunk: data,
  5185. begin
  5186. });
  5187. });
  5188. }
  5189. requestAllChunks(noFetch = false) {
  5190. if (!noFetch) {
  5191. const missingChunks = this.stream.getMissingChunks();
  5192. this._requestChunks(missingChunks);
  5193. }
  5194. return this._loadedStreamCapability.promise;
  5195. }
  5196. _requestChunks(chunks) {
  5197. const requestId = this.currRequestId++;
  5198. const chunksNeeded = new Set();
  5199. this._chunksNeededByRequest.set(requestId, chunksNeeded);
  5200. for (const chunk of chunks) {
  5201. if (!this.stream.hasChunk(chunk)) {
  5202. chunksNeeded.add(chunk);
  5203. }
  5204. }
  5205. if (chunksNeeded.size === 0) {
  5206. return Promise.resolve();
  5207. }
  5208. const capability = Promise.withResolvers();
  5209. this._promisesByRequest.set(requestId, capability);
  5210. const chunksToRequest = [];
  5211. for (const chunk of chunksNeeded) {
  5212. let requestIds = this._requestsByChunk.get(chunk);
  5213. if (!requestIds) {
  5214. requestIds = [];
  5215. this._requestsByChunk.set(chunk, requestIds);
  5216. chunksToRequest.push(chunk);
  5217. }
  5218. requestIds.push(requestId);
  5219. }
  5220. if (chunksToRequest.length > 0) {
  5221. const groupedChunksToRequest = this.groupChunks(chunksToRequest);
  5222. for (const groupedChunk of groupedChunksToRequest) {
  5223. const begin = groupedChunk.beginChunk * this.chunkSize;
  5224. const end = Math.min(groupedChunk.endChunk * this.chunkSize, this.length);
  5225. this.sendRequest(begin, end).catch(capability.reject);
  5226. }
  5227. }
  5228. return capability.promise.catch(reason => {
  5229. if (this.aborted) {
  5230. return;
  5231. }
  5232. throw reason;
  5233. });
  5234. }
  5235. getStream() {
  5236. return this.stream;
  5237. }
  5238. requestRange(begin, end) {
  5239. end = Math.min(end, this.length);
  5240. const beginChunk = this.getBeginChunk(begin);
  5241. const endChunk = this.getEndChunk(end);
  5242. const chunks = [];
  5243. for (let chunk = beginChunk; chunk < endChunk; ++chunk) {
  5244. chunks.push(chunk);
  5245. }
  5246. return this._requestChunks(chunks);
  5247. }
  5248. requestRanges(ranges = []) {
  5249. const chunksToRequest = [];
  5250. for (const range of ranges) {
  5251. const beginChunk = this.getBeginChunk(range.begin);
  5252. const endChunk = this.getEndChunk(range.end);
  5253. for (let chunk = beginChunk; chunk < endChunk; ++chunk) {
  5254. if (!chunksToRequest.includes(chunk)) {
  5255. chunksToRequest.push(chunk);
  5256. }
  5257. }
  5258. }
  5259. chunksToRequest.sort(function (a, b) {
  5260. return a - b;
  5261. });
  5262. return this._requestChunks(chunksToRequest);
  5263. }
  5264. groupChunks(chunks) {
  5265. const groupedChunks = [];
  5266. let beginChunk = -1;
  5267. let prevChunk = -1;
  5268. for (let i = 0, ii = chunks.length; i < ii; ++i) {
  5269. const chunk = chunks[i];
  5270. if (beginChunk < 0) {
  5271. beginChunk = chunk;
  5272. }
  5273. if (prevChunk >= 0 && prevChunk + 1 !== chunk) {
  5274. groupedChunks.push({
  5275. beginChunk,
  5276. endChunk: prevChunk + 1
  5277. });
  5278. beginChunk = chunk;
  5279. }
  5280. if (i + 1 === chunks.length) {
  5281. groupedChunks.push({
  5282. beginChunk,
  5283. endChunk: chunk + 1
  5284. });
  5285. }
  5286. prevChunk = chunk;
  5287. }
  5288. return groupedChunks;
  5289. }
  5290. onProgress(args) {
  5291. this.msgHandler.send("DocProgress", {
  5292. loaded: this.stream.numChunksLoaded * this.chunkSize + args.loaded,
  5293. total: this.length
  5294. });
  5295. }
  5296. onReceiveData(args) {
  5297. const chunk = args.chunk;
  5298. const isProgressive = args.begin === undefined;
  5299. const begin = isProgressive ? this.progressiveDataLength : args.begin;
  5300. const end = begin + chunk.byteLength;
  5301. const beginChunk = Math.floor(begin / this.chunkSize);
  5302. const endChunk = end < this.length ? Math.floor(end / this.chunkSize) : Math.ceil(end / this.chunkSize);
  5303. if (isProgressive) {
  5304. this.stream.onReceiveProgressiveData(chunk);
  5305. this.progressiveDataLength = end;
  5306. } else {
  5307. this.stream.onReceiveData(begin, chunk);
  5308. }
  5309. if (this.stream.isDataLoaded) {
  5310. this._loadedStreamCapability.resolve(this.stream);
  5311. }
  5312. const loadedRequests = [];
  5313. for (let curChunk = beginChunk; curChunk < endChunk; ++curChunk) {
  5314. const requestIds = this._requestsByChunk.get(curChunk);
  5315. if (!requestIds) {
  5316. continue;
  5317. }
  5318. this._requestsByChunk.delete(curChunk);
  5319. for (const requestId of requestIds) {
  5320. const chunksNeeded = this._chunksNeededByRequest.get(requestId);
  5321. if (chunksNeeded.has(curChunk)) {
  5322. chunksNeeded.delete(curChunk);
  5323. }
  5324. if (chunksNeeded.size > 0) {
  5325. continue;
  5326. }
  5327. loadedRequests.push(requestId);
  5328. }
  5329. }
  5330. if (!this.disableAutoFetch && this._requestsByChunk.size === 0) {
  5331. let nextEmptyChunk;
  5332. if (this.stream.numChunksLoaded === 1) {
  5333. const lastChunk = this.stream.numChunks - 1;
  5334. if (!this.stream.hasChunk(lastChunk)) {
  5335. nextEmptyChunk = lastChunk;
  5336. }
  5337. } else {
  5338. nextEmptyChunk = this.stream.nextEmptyChunk(endChunk);
  5339. }
  5340. if (Number.isInteger(nextEmptyChunk)) {
  5341. this._requestChunks([nextEmptyChunk]);
  5342. }
  5343. }
  5344. for (const requestId of loadedRequests) {
  5345. const capability = this._promisesByRequest.get(requestId);
  5346. this._promisesByRequest.delete(requestId);
  5347. capability.resolve();
  5348. }
  5349. this.msgHandler.send("DocProgress", {
  5350. loaded: this.stream.numChunksLoaded * this.chunkSize,
  5351. total: this.length
  5352. });
  5353. }
  5354. onError(err) {
  5355. this._loadedStreamCapability.reject(err);
  5356. }
  5357. getBeginChunk(begin) {
  5358. return Math.floor(begin / this.chunkSize);
  5359. }
  5360. getEndChunk(end) {
  5361. return Math.floor((end - 1) / this.chunkSize) + 1;
  5362. }
  5363. abort(reason) {
  5364. this.aborted = true;
  5365. this.pdfNetworkStream?.cancelAllRequests(reason);
  5366. for (const capability of this._promisesByRequest.values()) {
  5367. capability.reject(reason);
  5368. }
  5369. }
  5370. }
  5371. // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.filter.js
  5372. var esnext_iterator_filter = __webpack_require__(4520);
  5373. // EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.flags.js
  5374. var es_regexp_flags = __webpack_require__(9479);
  5375. // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.find.js
  5376. var esnext_iterator_find = __webpack_require__(2577);
  5377. // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.reduce.js
  5378. var esnext_iterator_reduce = __webpack_require__(8872);
  5379. ;// ./src/core/colorspace.js
  5380. function resizeRgbImage(src, dest, w1, h1, w2, h2, alpha01) {
  5381. const COMPONENTS = 3;
  5382. alpha01 = alpha01 !== 1 ? 0 : alpha01;
  5383. const xRatio = w1 / w2;
  5384. const yRatio = h1 / h2;
  5385. let newIndex = 0,
  5386. oldIndex;
  5387. const xScaled = new Uint16Array(w2);
  5388. const w1Scanline = w1 * COMPONENTS;
  5389. for (let i = 0; i < w2; i++) {
  5390. xScaled[i] = Math.floor(i * xRatio) * COMPONENTS;
  5391. }
  5392. for (let i = 0; i < h2; i++) {
  5393. const py = Math.floor(i * yRatio) * w1Scanline;
  5394. for (let j = 0; j < w2; j++) {
  5395. oldIndex = py + xScaled[j];
  5396. dest[newIndex++] = src[oldIndex++];
  5397. dest[newIndex++] = src[oldIndex++];
  5398. dest[newIndex++] = src[oldIndex++];
  5399. newIndex += alpha01;
  5400. }
  5401. }
  5402. }
  5403. class ColorSpace {
  5404. constructor(name, numComps) {
  5405. this.name = name;
  5406. this.numComps = numComps;
  5407. }
  5408. getRgb(src, srcOffset) {
  5409. const rgb = new Uint8ClampedArray(3);
  5410. this.getRgbItem(src, srcOffset, rgb, 0);
  5411. return rgb;
  5412. }
  5413. getRgbItem(src, srcOffset, dest, destOffset) {
  5414. unreachable("Should not call ColorSpace.getRgbItem");
  5415. }
  5416. getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) {
  5417. unreachable("Should not call ColorSpace.getRgbBuffer");
  5418. }
  5419. getOutputLength(inputLength, alpha01) {
  5420. unreachable("Should not call ColorSpace.getOutputLength");
  5421. }
  5422. isPassthrough(bits) {
  5423. return false;
  5424. }
  5425. isDefaultDecode(decodeMap, bpc) {
  5426. return ColorSpace.isDefaultDecode(decodeMap, this.numComps);
  5427. }
  5428. fillRgb(dest, originalWidth, originalHeight, width, height, actualHeight, bpc, comps, alpha01) {
  5429. const count = originalWidth * originalHeight;
  5430. let rgbBuf = null;
  5431. const numComponentColors = 1 << bpc;
  5432. const needsResizing = originalHeight !== height || originalWidth !== width;
  5433. if (this.isPassthrough(bpc)) {
  5434. rgbBuf = comps;
  5435. } else if (this.numComps === 1 && count > numComponentColors && this.name !== "DeviceGray" && this.name !== "DeviceRGB") {
  5436. const allColors = bpc <= 8 ? new Uint8Array(numComponentColors) : new Uint16Array(numComponentColors);
  5437. for (let i = 0; i < numComponentColors; i++) {
  5438. allColors[i] = i;
  5439. }
  5440. const colorMap = new Uint8ClampedArray(numComponentColors * 3);
  5441. this.getRgbBuffer(allColors, 0, numComponentColors, colorMap, 0, bpc, 0);
  5442. if (!needsResizing) {
  5443. let destPos = 0;
  5444. for (let i = 0; i < count; ++i) {
  5445. const key = comps[i] * 3;
  5446. dest[destPos++] = colorMap[key];
  5447. dest[destPos++] = colorMap[key + 1];
  5448. dest[destPos++] = colorMap[key + 2];
  5449. destPos += alpha01;
  5450. }
  5451. } else {
  5452. rgbBuf = new Uint8Array(count * 3);
  5453. let rgbPos = 0;
  5454. for (let i = 0; i < count; ++i) {
  5455. const key = comps[i] * 3;
  5456. rgbBuf[rgbPos++] = colorMap[key];
  5457. rgbBuf[rgbPos++] = colorMap[key + 1];
  5458. rgbBuf[rgbPos++] = colorMap[key + 2];
  5459. }
  5460. }
  5461. } else if (!needsResizing) {
  5462. this.getRgbBuffer(comps, 0, width * actualHeight, dest, 0, bpc, alpha01);
  5463. } else {
  5464. rgbBuf = new Uint8ClampedArray(count * 3);
  5465. this.getRgbBuffer(comps, 0, count, rgbBuf, 0, bpc, 0);
  5466. }
  5467. if (rgbBuf) {
  5468. if (needsResizing) {
  5469. resizeRgbImage(rgbBuf, dest, originalWidth, originalHeight, width, height, alpha01);
  5470. } else {
  5471. let destPos = 0,
  5472. rgbPos = 0;
  5473. for (let i = 0, ii = width * actualHeight; i < ii; i++) {
  5474. dest[destPos++] = rgbBuf[rgbPos++];
  5475. dest[destPos++] = rgbBuf[rgbPos++];
  5476. dest[destPos++] = rgbBuf[rgbPos++];
  5477. destPos += alpha01;
  5478. }
  5479. }
  5480. }
  5481. }
  5482. get usesZeroToOneRange() {
  5483. return shadow(this, "usesZeroToOneRange", true);
  5484. }
  5485. static _cache(cacheKey, xref, localColorSpaceCache, parsedColorSpace) {
  5486. if (!localColorSpaceCache) {
  5487. throw new Error('ColorSpace._cache - expected "localColorSpaceCache" argument.');
  5488. }
  5489. if (!parsedColorSpace) {
  5490. throw new Error('ColorSpace._cache - expected "parsedColorSpace" argument.');
  5491. }
  5492. let csName, csRef;
  5493. if (cacheKey instanceof Ref) {
  5494. csRef = cacheKey;
  5495. cacheKey = xref.fetch(cacheKey);
  5496. }
  5497. if (cacheKey instanceof Name) {
  5498. csName = cacheKey.name;
  5499. }
  5500. if (csName || csRef) {
  5501. localColorSpaceCache.set(csName, csRef, parsedColorSpace);
  5502. }
  5503. }
  5504. static getCached(cacheKey, xref, localColorSpaceCache) {
  5505. if (!localColorSpaceCache) {
  5506. throw new Error('ColorSpace.getCached - expected "localColorSpaceCache" argument.');
  5507. }
  5508. if (cacheKey instanceof Ref) {
  5509. const localColorSpace = localColorSpaceCache.getByRef(cacheKey);
  5510. if (localColorSpace) {
  5511. return localColorSpace;
  5512. }
  5513. try {
  5514. cacheKey = xref.fetch(cacheKey);
  5515. } catch (ex) {
  5516. if (ex instanceof MissingDataException) {
  5517. throw ex;
  5518. }
  5519. }
  5520. }
  5521. if (cacheKey instanceof Name) {
  5522. const localColorSpace = localColorSpaceCache.getByName(cacheKey.name);
  5523. if (localColorSpace) {
  5524. return localColorSpace;
  5525. }
  5526. }
  5527. return null;
  5528. }
  5529. static async parseAsync({
  5530. cs,
  5531. xref,
  5532. resources = null,
  5533. pdfFunctionFactory,
  5534. localColorSpaceCache
  5535. }) {
  5536. const parsedColorSpace = this._parse(cs, xref, resources, pdfFunctionFactory);
  5537. this._cache(cs, xref, localColorSpaceCache, parsedColorSpace);
  5538. return parsedColorSpace;
  5539. }
  5540. static parse({
  5541. cs,
  5542. xref,
  5543. resources = null,
  5544. pdfFunctionFactory,
  5545. localColorSpaceCache
  5546. }) {
  5547. const cachedColorSpace = this.getCached(cs, xref, localColorSpaceCache);
  5548. if (cachedColorSpace) {
  5549. return cachedColorSpace;
  5550. }
  5551. const parsedColorSpace = this._parse(cs, xref, resources, pdfFunctionFactory);
  5552. this._cache(cs, xref, localColorSpaceCache, parsedColorSpace);
  5553. return parsedColorSpace;
  5554. }
  5555. static _parse(cs, xref, resources = null, pdfFunctionFactory) {
  5556. cs = xref.fetchIfRef(cs);
  5557. if (cs instanceof Name) {
  5558. switch (cs.name) {
  5559. case "G":
  5560. case "DeviceGray":
  5561. return this.singletons.gray;
  5562. case "RGB":
  5563. case "DeviceRGB":
  5564. return this.singletons.rgb;
  5565. case "DeviceRGBA":
  5566. return this.singletons.rgba;
  5567. case "CMYK":
  5568. case "DeviceCMYK":
  5569. return this.singletons.cmyk;
  5570. case "Pattern":
  5571. return new PatternCS(null);
  5572. default:
  5573. if (resources instanceof Dict) {
  5574. const colorSpaces = resources.get("ColorSpace");
  5575. if (colorSpaces instanceof Dict) {
  5576. const resourcesCS = colorSpaces.get(cs.name);
  5577. if (resourcesCS) {
  5578. if (resourcesCS instanceof Name) {
  5579. return this._parse(resourcesCS, xref, resources, pdfFunctionFactory);
  5580. }
  5581. cs = resourcesCS;
  5582. break;
  5583. }
  5584. }
  5585. }
  5586. warn(`Unrecognized ColorSpace: ${cs.name}`);
  5587. return this.singletons.gray;
  5588. }
  5589. }
  5590. if (Array.isArray(cs)) {
  5591. const mode = xref.fetchIfRef(cs[0]).name;
  5592. let params, numComps, baseCS, whitePoint, blackPoint, gamma;
  5593. switch (mode) {
  5594. case "G":
  5595. case "DeviceGray":
  5596. return this.singletons.gray;
  5597. case "RGB":
  5598. case "DeviceRGB":
  5599. return this.singletons.rgb;
  5600. case "CMYK":
  5601. case "DeviceCMYK":
  5602. return this.singletons.cmyk;
  5603. case "CalGray":
  5604. params = xref.fetchIfRef(cs[1]);
  5605. whitePoint = params.getArray("WhitePoint");
  5606. blackPoint = params.getArray("BlackPoint");
  5607. gamma = params.get("Gamma");
  5608. return new CalGrayCS(whitePoint, blackPoint, gamma);
  5609. case "CalRGB":
  5610. params = xref.fetchIfRef(cs[1]);
  5611. whitePoint = params.getArray("WhitePoint");
  5612. blackPoint = params.getArray("BlackPoint");
  5613. gamma = params.getArray("Gamma");
  5614. const matrix = params.getArray("Matrix");
  5615. return new CalRGBCS(whitePoint, blackPoint, gamma, matrix);
  5616. case "ICCBased":
  5617. const stream = xref.fetchIfRef(cs[1]);
  5618. const dict = stream.dict;
  5619. numComps = dict.get("N");
  5620. const alt = dict.get("Alternate");
  5621. if (alt) {
  5622. const altCS = this._parse(alt, xref, resources, pdfFunctionFactory);
  5623. if (altCS.numComps === numComps) {
  5624. return altCS;
  5625. }
  5626. warn("ICCBased color space: Ignoring incorrect /Alternate entry.");
  5627. }
  5628. if (numComps === 1) {
  5629. return this.singletons.gray;
  5630. } else if (numComps === 3) {
  5631. return this.singletons.rgb;
  5632. } else if (numComps === 4) {
  5633. return this.singletons.cmyk;
  5634. }
  5635. break;
  5636. case "Pattern":
  5637. baseCS = cs[1] || null;
  5638. if (baseCS) {
  5639. baseCS = this._parse(baseCS, xref, resources, pdfFunctionFactory);
  5640. }
  5641. return new PatternCS(baseCS);
  5642. case "I":
  5643. case "Indexed":
  5644. baseCS = this._parse(cs[1], xref, resources, pdfFunctionFactory);
  5645. const hiVal = xref.fetchIfRef(cs[2]) + 1;
  5646. const lookup = xref.fetchIfRef(cs[3]);
  5647. return new IndexedCS(baseCS, hiVal, lookup);
  5648. case "Separation":
  5649. case "DeviceN":
  5650. const name = xref.fetchIfRef(cs[1]);
  5651. numComps = Array.isArray(name) ? name.length : 1;
  5652. baseCS = this._parse(cs[2], xref, resources, pdfFunctionFactory);
  5653. const tintFn = pdfFunctionFactory.create(cs[3]);
  5654. return new AlternateCS(numComps, baseCS, tintFn);
  5655. case "Lab":
  5656. params = xref.fetchIfRef(cs[1]);
  5657. whitePoint = params.getArray("WhitePoint");
  5658. blackPoint = params.getArray("BlackPoint");
  5659. const range = params.getArray("Range");
  5660. return new LabCS(whitePoint, blackPoint, range);
  5661. default:
  5662. warn(`Unimplemented ColorSpace object: ${mode}`);
  5663. return this.singletons.gray;
  5664. }
  5665. }
  5666. warn(`Unrecognized ColorSpace object: ${cs}`);
  5667. return this.singletons.gray;
  5668. }
  5669. static isDefaultDecode(decode, numComps) {
  5670. if (!Array.isArray(decode)) {
  5671. return true;
  5672. }
  5673. if (numComps * 2 !== decode.length) {
  5674. warn("The decode map is not the correct length");
  5675. return true;
  5676. }
  5677. for (let i = 0, ii = decode.length; i < ii; i += 2) {
  5678. if (decode[i] !== 0 || decode[i + 1] !== 1) {
  5679. return false;
  5680. }
  5681. }
  5682. return true;
  5683. }
  5684. static get singletons() {
  5685. return shadow(this, "singletons", {
  5686. get gray() {
  5687. return shadow(this, "gray", new DeviceGrayCS());
  5688. },
  5689. get rgb() {
  5690. return shadow(this, "rgb", new DeviceRgbCS());
  5691. },
  5692. get rgba() {
  5693. return shadow(this, "rgba", new DeviceRgbaCS());
  5694. },
  5695. get cmyk() {
  5696. return shadow(this, "cmyk", new DeviceCmykCS());
  5697. }
  5698. });
  5699. }
  5700. }
  5701. class AlternateCS extends ColorSpace {
  5702. constructor(numComps, base, tintFn) {
  5703. super("Alternate", numComps);
  5704. this.base = base;
  5705. this.tintFn = tintFn;
  5706. this.tmpBuf = new Float32Array(base.numComps);
  5707. }
  5708. getRgbItem(src, srcOffset, dest, destOffset) {
  5709. const tmpBuf = this.tmpBuf;
  5710. this.tintFn(src, srcOffset, tmpBuf, 0);
  5711. this.base.getRgbItem(tmpBuf, 0, dest, destOffset);
  5712. }
  5713. getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) {
  5714. const tintFn = this.tintFn;
  5715. const base = this.base;
  5716. const scale = 1 / ((1 << bits) - 1);
  5717. const baseNumComps = base.numComps;
  5718. const usesZeroToOneRange = base.usesZeroToOneRange;
  5719. const isPassthrough = (base.isPassthrough(8) || !usesZeroToOneRange) && alpha01 === 0;
  5720. let pos = isPassthrough ? destOffset : 0;
  5721. const baseBuf = isPassthrough ? dest : new Uint8ClampedArray(baseNumComps * count);
  5722. const numComps = this.numComps;
  5723. const scaled = new Float32Array(numComps);
  5724. const tinted = new Float32Array(baseNumComps);
  5725. let i, j;
  5726. for (i = 0; i < count; i++) {
  5727. for (j = 0; j < numComps; j++) {
  5728. scaled[j] = src[srcOffset++] * scale;
  5729. }
  5730. tintFn(scaled, 0, tinted, 0);
  5731. if (usesZeroToOneRange) {
  5732. for (j = 0; j < baseNumComps; j++) {
  5733. baseBuf[pos++] = tinted[j] * 255;
  5734. }
  5735. } else {
  5736. base.getRgbItem(tinted, 0, baseBuf, pos);
  5737. pos += baseNumComps;
  5738. }
  5739. }
  5740. if (!isPassthrough) {
  5741. base.getRgbBuffer(baseBuf, 0, count, dest, destOffset, 8, alpha01);
  5742. }
  5743. }
  5744. getOutputLength(inputLength, alpha01) {
  5745. return this.base.getOutputLength(inputLength * this.base.numComps / this.numComps, alpha01);
  5746. }
  5747. }
  5748. class PatternCS extends ColorSpace {
  5749. constructor(baseCS) {
  5750. super("Pattern", null);
  5751. this.base = baseCS;
  5752. }
  5753. isDefaultDecode(decodeMap, bpc) {
  5754. unreachable("Should not call PatternCS.isDefaultDecode");
  5755. }
  5756. }
  5757. class IndexedCS extends ColorSpace {
  5758. constructor(base, highVal, lookup) {
  5759. super("Indexed", 1);
  5760. this.base = base;
  5761. this.highVal = highVal;
  5762. const length = base.numComps * highVal;
  5763. this.lookup = new Uint8Array(length);
  5764. if (lookup instanceof BaseStream) {
  5765. const bytes = lookup.getBytes(length);
  5766. this.lookup.set(bytes);
  5767. } else if (typeof lookup === "string") {
  5768. for (let i = 0; i < length; ++i) {
  5769. this.lookup[i] = lookup.charCodeAt(i) & 0xff;
  5770. }
  5771. } else {
  5772. throw new FormatError(`IndexedCS - unrecognized lookup table: ${lookup}`);
  5773. }
  5774. }
  5775. getRgbItem(src, srcOffset, dest, destOffset) {
  5776. const numComps = this.base.numComps;
  5777. const start = src[srcOffset] * numComps;
  5778. this.base.getRgbBuffer(this.lookup, start, 1, dest, destOffset, 8, 0);
  5779. }
  5780. getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) {
  5781. const base = this.base;
  5782. const numComps = base.numComps;
  5783. const outputDelta = base.getOutputLength(numComps, alpha01);
  5784. const lookup = this.lookup;
  5785. for (let i = 0; i < count; ++i) {
  5786. const lookupPos = src[srcOffset++] * numComps;
  5787. base.getRgbBuffer(lookup, lookupPos, 1, dest, destOffset, 8, alpha01);
  5788. destOffset += outputDelta;
  5789. }
  5790. }
  5791. getOutputLength(inputLength, alpha01) {
  5792. return this.base.getOutputLength(inputLength * this.base.numComps, alpha01);
  5793. }
  5794. isDefaultDecode(decodeMap, bpc) {
  5795. if (!Array.isArray(decodeMap)) {
  5796. return true;
  5797. }
  5798. if (decodeMap.length !== 2) {
  5799. warn("Decode map length is not correct");
  5800. return true;
  5801. }
  5802. if (!Number.isInteger(bpc) || bpc < 1) {
  5803. warn("Bits per component is not correct");
  5804. return true;
  5805. }
  5806. return decodeMap[0] === 0 && decodeMap[1] === (1 << bpc) - 1;
  5807. }
  5808. }
  5809. class DeviceGrayCS extends ColorSpace {
  5810. constructor() {
  5811. super("DeviceGray", 1);
  5812. }
  5813. getRgbItem(src, srcOffset, dest, destOffset) {
  5814. const c = src[srcOffset] * 255;
  5815. dest[destOffset] = dest[destOffset + 1] = dest[destOffset + 2] = c;
  5816. }
  5817. getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) {
  5818. const scale = 255 / ((1 << bits) - 1);
  5819. let j = srcOffset,
  5820. q = destOffset;
  5821. for (let i = 0; i < count; ++i) {
  5822. const c = scale * src[j++];
  5823. dest[q++] = c;
  5824. dest[q++] = c;
  5825. dest[q++] = c;
  5826. q += alpha01;
  5827. }
  5828. }
  5829. getOutputLength(inputLength, alpha01) {
  5830. return inputLength * (3 + alpha01);
  5831. }
  5832. }
  5833. class DeviceRgbCS extends ColorSpace {
  5834. constructor() {
  5835. super("DeviceRGB", 3);
  5836. }
  5837. getRgbItem(src, srcOffset, dest, destOffset) {
  5838. dest[destOffset] = src[srcOffset] * 255;
  5839. dest[destOffset + 1] = src[srcOffset + 1] * 255;
  5840. dest[destOffset + 2] = src[srcOffset + 2] * 255;
  5841. }
  5842. getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) {
  5843. if (bits === 8 && alpha01 === 0) {
  5844. dest.set(src.subarray(srcOffset, srcOffset + count * 3), destOffset);
  5845. return;
  5846. }
  5847. const scale = 255 / ((1 << bits) - 1);
  5848. let j = srcOffset,
  5849. q = destOffset;
  5850. for (let i = 0; i < count; ++i) {
  5851. dest[q++] = scale * src[j++];
  5852. dest[q++] = scale * src[j++];
  5853. dest[q++] = scale * src[j++];
  5854. q += alpha01;
  5855. }
  5856. }
  5857. getOutputLength(inputLength, alpha01) {
  5858. return inputLength * (3 + alpha01) / 3 | 0;
  5859. }
  5860. isPassthrough(bits) {
  5861. return bits === 8;
  5862. }
  5863. }
  5864. class DeviceRgbaCS extends ColorSpace {
  5865. constructor() {
  5866. super("DeviceRGBA", 4);
  5867. }
  5868. getOutputLength(inputLength, _alpha01) {
  5869. return inputLength * 4;
  5870. }
  5871. isPassthrough(bits) {
  5872. return bits === 8;
  5873. }
  5874. }
  5875. class DeviceCmykCS extends ColorSpace {
  5876. constructor() {
  5877. super("DeviceCMYK", 4);
  5878. }
  5879. #toRgb(src, srcOffset, srcScale, dest, destOffset) {
  5880. const c = src[srcOffset] * srcScale;
  5881. const m = src[srcOffset + 1] * srcScale;
  5882. const y = src[srcOffset + 2] * srcScale;
  5883. const k = src[srcOffset + 3] * srcScale;
  5884. dest[destOffset] = 255 + c * (-4.387332384609988 * c + 54.48615194189176 * m + 18.82290502165302 * y + 212.25662451639585 * k + -285.2331026137004) + m * (1.7149763477362134 * m - 5.6096736904047315 * y + -17.873870861415444 * k - 5.497006427196366) + y * (-2.5217340131683033 * y - 21.248923337353073 * k + 17.5119270841813) + k * (-21.86122147463605 * k - 189.48180835922747);
  5885. dest[destOffset + 1] = 255 + c * (8.841041422036149 * c + 60.118027045597366 * m + 6.871425592049007 * y + 31.159100130055922 * k + -79.2970844816548) + m * (-15.310361306967817 * m + 17.575251261109482 * y + 131.35250912493976 * k - 190.9453302588951) + y * (4.444339102852739 * y + 9.8632861493405 * k - 24.86741582555878) + k * (-20.737325471181034 * k - 187.80453709719578);
  5886. dest[destOffset + 2] = 255 + c * (0.8842522430003296 * c + 8.078677503112928 * m + 30.89978309703729 * y - 0.23883238689178934 * k + -14.183576799673286) + m * (10.49593273432072 * m + 63.02378494754052 * y + 50.606957656360734 * k - 112.23884253719248) + y * (0.03296041114873217 * y + 115.60384449646641 * k + -193.58209356861505) + k * (-22.33816807309886 * k - 180.12613974708367);
  5887. }
  5888. getRgbItem(src, srcOffset, dest, destOffset) {
  5889. this.#toRgb(src, srcOffset, 1, dest, destOffset);
  5890. }
  5891. getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) {
  5892. const scale = 1 / ((1 << bits) - 1);
  5893. for (let i = 0; i < count; i++) {
  5894. this.#toRgb(src, srcOffset, scale, dest, destOffset);
  5895. srcOffset += 4;
  5896. destOffset += 3 + alpha01;
  5897. }
  5898. }
  5899. getOutputLength(inputLength, alpha01) {
  5900. return inputLength / 4 * (3 + alpha01) | 0;
  5901. }
  5902. }
  5903. class CalGrayCS extends ColorSpace {
  5904. constructor(whitePoint, blackPoint, gamma) {
  5905. super("CalGray", 1);
  5906. if (!whitePoint) {
  5907. throw new FormatError("WhitePoint missing - required for color space CalGray");
  5908. }
  5909. [this.XW, this.YW, this.ZW] = whitePoint;
  5910. [this.XB, this.YB, this.ZB] = blackPoint || [0, 0, 0];
  5911. this.G = gamma || 1;
  5912. if (this.XW < 0 || this.ZW < 0 || this.YW !== 1) {
  5913. throw new FormatError(`Invalid WhitePoint components for ${this.name}, no fallback available`);
  5914. }
  5915. if (this.XB < 0 || this.YB < 0 || this.ZB < 0) {
  5916. info(`Invalid BlackPoint for ${this.name}, falling back to default.`);
  5917. this.XB = this.YB = this.ZB = 0;
  5918. }
  5919. if (this.XB !== 0 || this.YB !== 0 || this.ZB !== 0) {
  5920. warn(`${this.name}, BlackPoint: XB: ${this.XB}, YB: ${this.YB}, ` + `ZB: ${this.ZB}, only default values are supported.`);
  5921. }
  5922. if (this.G < 1) {
  5923. info(`Invalid Gamma: ${this.G} for ${this.name}, falling back to default.`);
  5924. this.G = 1;
  5925. }
  5926. }
  5927. #toRgb(src, srcOffset, dest, destOffset, scale) {
  5928. const A = src[srcOffset] * scale;
  5929. const AG = A ** this.G;
  5930. const L = this.YW * AG;
  5931. const val = Math.max(295.8 * L ** 0.3333333333333333 - 40.8, 0);
  5932. dest[destOffset] = val;
  5933. dest[destOffset + 1] = val;
  5934. dest[destOffset + 2] = val;
  5935. }
  5936. getRgbItem(src, srcOffset, dest, destOffset) {
  5937. this.#toRgb(src, srcOffset, dest, destOffset, 1);
  5938. }
  5939. getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) {
  5940. const scale = 1 / ((1 << bits) - 1);
  5941. for (let i = 0; i < count; ++i) {
  5942. this.#toRgb(src, srcOffset, dest, destOffset, scale);
  5943. srcOffset += 1;
  5944. destOffset += 3 + alpha01;
  5945. }
  5946. }
  5947. getOutputLength(inputLength, alpha01) {
  5948. return inputLength * (3 + alpha01);
  5949. }
  5950. }
  5951. class CalRGBCS extends ColorSpace {
  5952. static #BRADFORD_SCALE_MATRIX = new Float32Array([0.8951, 0.2664, -0.1614, -0.7502, 1.7135, 0.0367, 0.0389, -0.0685, 1.0296]);
  5953. static #BRADFORD_SCALE_INVERSE_MATRIX = new Float32Array([0.9869929, -0.1470543, 0.1599627, 0.4323053, 0.5183603, 0.0492912, -0.0085287, 0.0400428, 0.9684867]);
  5954. static #SRGB_D65_XYZ_TO_RGB_MATRIX = new Float32Array([3.2404542, -1.5371385, -0.4985314, -0.9692660, 1.8760108, 0.0415560, 0.0556434, -0.2040259, 1.0572252]);
  5955. static #FLAT_WHITEPOINT_MATRIX = new Float32Array([1, 1, 1]);
  5956. static #tempNormalizeMatrix = new Float32Array(3);
  5957. static #tempConvertMatrix1 = new Float32Array(3);
  5958. static #tempConvertMatrix2 = new Float32Array(3);
  5959. static #DECODE_L_CONSTANT = ((8 + 16) / 116) ** 3 / 8.0;
  5960. constructor(whitePoint, blackPoint, gamma, matrix) {
  5961. super("CalRGB", 3);
  5962. if (!whitePoint) {
  5963. throw new FormatError("WhitePoint missing - required for color space CalRGB");
  5964. }
  5965. const [XW, YW, ZW] = this.whitePoint = whitePoint;
  5966. const [XB, YB, ZB] = this.blackPoint = blackPoint || new Float32Array(3);
  5967. [this.GR, this.GG, this.GB] = gamma || new Float32Array([1, 1, 1]);
  5968. [this.MXA, this.MYA, this.MZA, this.MXB, this.MYB, this.MZB, this.MXC, this.MYC, this.MZC] = matrix || new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]);
  5969. if (XW < 0 || ZW < 0 || YW !== 1) {
  5970. throw new FormatError(`Invalid WhitePoint components for ${this.name}, no fallback available`);
  5971. }
  5972. if (XB < 0 || YB < 0 || ZB < 0) {
  5973. info(`Invalid BlackPoint for ${this.name} [${XB}, ${YB}, ${ZB}], ` + "falling back to default.");
  5974. this.blackPoint = new Float32Array(3);
  5975. }
  5976. if (this.GR < 0 || this.GG < 0 || this.GB < 0) {
  5977. info(`Invalid Gamma [${this.GR}, ${this.GG}, ${this.GB}] for ` + `${this.name}, falling back to default.`);
  5978. this.GR = this.GG = this.GB = 1;
  5979. }
  5980. }
  5981. #matrixProduct(a, b, result) {
  5982. result[0] = a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
  5983. result[1] = a[3] * b[0] + a[4] * b[1] + a[5] * b[2];
  5984. result[2] = a[6] * b[0] + a[7] * b[1] + a[8] * b[2];
  5985. }
  5986. #toFlat(sourceWhitePoint, LMS, result) {
  5987. result[0] = LMS[0] * 1 / sourceWhitePoint[0];
  5988. result[1] = LMS[1] * 1 / sourceWhitePoint[1];
  5989. result[2] = LMS[2] * 1 / sourceWhitePoint[2];
  5990. }
  5991. #toD65(sourceWhitePoint, LMS, result) {
  5992. const D65X = 0.95047;
  5993. const D65Y = 1;
  5994. const D65Z = 1.08883;
  5995. result[0] = LMS[0] * D65X / sourceWhitePoint[0];
  5996. result[1] = LMS[1] * D65Y / sourceWhitePoint[1];
  5997. result[2] = LMS[2] * D65Z / sourceWhitePoint[2];
  5998. }
  5999. #sRGBTransferFunction(color) {
  6000. if (color <= 0.0031308) {
  6001. return this.#adjustToRange(0, 1, 12.92 * color);
  6002. }
  6003. if (color >= 0.99554525) {
  6004. return 1;
  6005. }
  6006. return this.#adjustToRange(0, 1, (1 + 0.055) * color ** (1 / 2.4) - 0.055);
  6007. }
  6008. #adjustToRange(min, max, value) {
  6009. return Math.max(min, Math.min(max, value));
  6010. }
  6011. #decodeL(L) {
  6012. if (L < 0) {
  6013. return -this.#decodeL(-L);
  6014. }
  6015. if (L > 8.0) {
  6016. return ((L + 16) / 116) ** 3;
  6017. }
  6018. return L * CalRGBCS.#DECODE_L_CONSTANT;
  6019. }
  6020. #compensateBlackPoint(sourceBlackPoint, XYZ_Flat, result) {
  6021. if (sourceBlackPoint[0] === 0 && sourceBlackPoint[1] === 0 && sourceBlackPoint[2] === 0) {
  6022. result[0] = XYZ_Flat[0];
  6023. result[1] = XYZ_Flat[1];
  6024. result[2] = XYZ_Flat[2];
  6025. return;
  6026. }
  6027. const zeroDecodeL = this.#decodeL(0);
  6028. const X_DST = zeroDecodeL;
  6029. const X_SRC = this.#decodeL(sourceBlackPoint[0]);
  6030. const Y_DST = zeroDecodeL;
  6031. const Y_SRC = this.#decodeL(sourceBlackPoint[1]);
  6032. const Z_DST = zeroDecodeL;
  6033. const Z_SRC = this.#decodeL(sourceBlackPoint[2]);
  6034. const X_Scale = (1 - X_DST) / (1 - X_SRC);
  6035. const X_Offset = 1 - X_Scale;
  6036. const Y_Scale = (1 - Y_DST) / (1 - Y_SRC);
  6037. const Y_Offset = 1 - Y_Scale;
  6038. const Z_Scale = (1 - Z_DST) / (1 - Z_SRC);
  6039. const Z_Offset = 1 - Z_Scale;
  6040. result[0] = XYZ_Flat[0] * X_Scale + X_Offset;
  6041. result[1] = XYZ_Flat[1] * Y_Scale + Y_Offset;
  6042. result[2] = XYZ_Flat[2] * Z_Scale + Z_Offset;
  6043. }
  6044. #normalizeWhitePointToFlat(sourceWhitePoint, XYZ_In, result) {
  6045. if (sourceWhitePoint[0] === 1 && sourceWhitePoint[2] === 1) {
  6046. result[0] = XYZ_In[0];
  6047. result[1] = XYZ_In[1];
  6048. result[2] = XYZ_In[2];
  6049. return;
  6050. }
  6051. const LMS = result;
  6052. this.#matrixProduct(CalRGBCS.#BRADFORD_SCALE_MATRIX, XYZ_In, LMS);
  6053. const LMS_Flat = CalRGBCS.#tempNormalizeMatrix;
  6054. this.#toFlat(sourceWhitePoint, LMS, LMS_Flat);
  6055. this.#matrixProduct(CalRGBCS.#BRADFORD_SCALE_INVERSE_MATRIX, LMS_Flat, result);
  6056. }
  6057. #normalizeWhitePointToD65(sourceWhitePoint, XYZ_In, result) {
  6058. const LMS = result;
  6059. this.#matrixProduct(CalRGBCS.#BRADFORD_SCALE_MATRIX, XYZ_In, LMS);
  6060. const LMS_D65 = CalRGBCS.#tempNormalizeMatrix;
  6061. this.#toD65(sourceWhitePoint, LMS, LMS_D65);
  6062. this.#matrixProduct(CalRGBCS.#BRADFORD_SCALE_INVERSE_MATRIX, LMS_D65, result);
  6063. }
  6064. #toRgb(src, srcOffset, dest, destOffset, scale) {
  6065. const A = this.#adjustToRange(0, 1, src[srcOffset] * scale);
  6066. const B = this.#adjustToRange(0, 1, src[srcOffset + 1] * scale);
  6067. const C = this.#adjustToRange(0, 1, src[srcOffset + 2] * scale);
  6068. const AGR = A === 1 ? 1 : A ** this.GR;
  6069. const BGG = B === 1 ? 1 : B ** this.GG;
  6070. const CGB = C === 1 ? 1 : C ** this.GB;
  6071. const X = this.MXA * AGR + this.MXB * BGG + this.MXC * CGB;
  6072. const Y = this.MYA * AGR + this.MYB * BGG + this.MYC * CGB;
  6073. const Z = this.MZA * AGR + this.MZB * BGG + this.MZC * CGB;
  6074. const XYZ = CalRGBCS.#tempConvertMatrix1;
  6075. XYZ[0] = X;
  6076. XYZ[1] = Y;
  6077. XYZ[2] = Z;
  6078. const XYZ_Flat = CalRGBCS.#tempConvertMatrix2;
  6079. this.#normalizeWhitePointToFlat(this.whitePoint, XYZ, XYZ_Flat);
  6080. const XYZ_Black = CalRGBCS.#tempConvertMatrix1;
  6081. this.#compensateBlackPoint(this.blackPoint, XYZ_Flat, XYZ_Black);
  6082. const XYZ_D65 = CalRGBCS.#tempConvertMatrix2;
  6083. this.#normalizeWhitePointToD65(CalRGBCS.#FLAT_WHITEPOINT_MATRIX, XYZ_Black, XYZ_D65);
  6084. const SRGB = CalRGBCS.#tempConvertMatrix1;
  6085. this.#matrixProduct(CalRGBCS.#SRGB_D65_XYZ_TO_RGB_MATRIX, XYZ_D65, SRGB);
  6086. dest[destOffset] = this.#sRGBTransferFunction(SRGB[0]) * 255;
  6087. dest[destOffset + 1] = this.#sRGBTransferFunction(SRGB[1]) * 255;
  6088. dest[destOffset + 2] = this.#sRGBTransferFunction(SRGB[2]) * 255;
  6089. }
  6090. getRgbItem(src, srcOffset, dest, destOffset) {
  6091. this.#toRgb(src, srcOffset, dest, destOffset, 1);
  6092. }
  6093. getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) {
  6094. const scale = 1 / ((1 << bits) - 1);
  6095. for (let i = 0; i < count; ++i) {
  6096. this.#toRgb(src, srcOffset, dest, destOffset, scale);
  6097. srcOffset += 3;
  6098. destOffset += 3 + alpha01;
  6099. }
  6100. }
  6101. getOutputLength(inputLength, alpha01) {
  6102. return inputLength * (3 + alpha01) / 3 | 0;
  6103. }
  6104. }
  6105. class LabCS extends ColorSpace {
  6106. constructor(whitePoint, blackPoint, range) {
  6107. super("Lab", 3);
  6108. if (!whitePoint) {
  6109. throw new FormatError("WhitePoint missing - required for color space Lab");
  6110. }
  6111. [this.XW, this.YW, this.ZW] = whitePoint;
  6112. [this.amin, this.amax, this.bmin, this.bmax] = range || [-100, 100, -100, 100];
  6113. [this.XB, this.YB, this.ZB] = blackPoint || [0, 0, 0];
  6114. if (this.XW < 0 || this.ZW < 0 || this.YW !== 1) {
  6115. throw new FormatError("Invalid WhitePoint components, no fallback available");
  6116. }
  6117. if (this.XB < 0 || this.YB < 0 || this.ZB < 0) {
  6118. info("Invalid BlackPoint, falling back to default");
  6119. this.XB = this.YB = this.ZB = 0;
  6120. }
  6121. if (this.amin > this.amax || this.bmin > this.bmax) {
  6122. info("Invalid Range, falling back to defaults");
  6123. this.amin = -100;
  6124. this.amax = 100;
  6125. this.bmin = -100;
  6126. this.bmax = 100;
  6127. }
  6128. }
  6129. #fn_g(x) {
  6130. return x >= 6 / 29 ? x ** 3 : 108 / 841 * (x - 4 / 29);
  6131. }
  6132. #decode(value, high1, low2, high2) {
  6133. return low2 + value * (high2 - low2) / high1;
  6134. }
  6135. #toRgb(src, srcOffset, maxVal, dest, destOffset) {
  6136. let Ls = src[srcOffset];
  6137. let as = src[srcOffset + 1];
  6138. let bs = src[srcOffset + 2];
  6139. if (maxVal !== false) {
  6140. Ls = this.#decode(Ls, maxVal, 0, 100);
  6141. as = this.#decode(as, maxVal, this.amin, this.amax);
  6142. bs = this.#decode(bs, maxVal, this.bmin, this.bmax);
  6143. }
  6144. if (as > this.amax) {
  6145. as = this.amax;
  6146. } else if (as < this.amin) {
  6147. as = this.amin;
  6148. }
  6149. if (bs > this.bmax) {
  6150. bs = this.bmax;
  6151. } else if (bs < this.bmin) {
  6152. bs = this.bmin;
  6153. }
  6154. const M = (Ls + 16) / 116;
  6155. const L = M + as / 500;
  6156. const N = M - bs / 200;
  6157. const X = this.XW * this.#fn_g(L);
  6158. const Y = this.YW * this.#fn_g(M);
  6159. const Z = this.ZW * this.#fn_g(N);
  6160. let r, g, b;
  6161. if (this.ZW < 1) {
  6162. r = X * 3.1339 + Y * -1.617 + Z * -0.4906;
  6163. g = X * -0.9785 + Y * 1.916 + Z * 0.0333;
  6164. b = X * 0.072 + Y * -0.229 + Z * 1.4057;
  6165. } else {
  6166. r = X * 3.2406 + Y * -1.5372 + Z * -0.4986;
  6167. g = X * -0.9689 + Y * 1.8758 + Z * 0.0415;
  6168. b = X * 0.0557 + Y * -0.204 + Z * 1.057;
  6169. }
  6170. dest[destOffset] = Math.sqrt(r) * 255;
  6171. dest[destOffset + 1] = Math.sqrt(g) * 255;
  6172. dest[destOffset + 2] = Math.sqrt(b) * 255;
  6173. }
  6174. getRgbItem(src, srcOffset, dest, destOffset) {
  6175. this.#toRgb(src, srcOffset, false, dest, destOffset);
  6176. }
  6177. getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) {
  6178. const maxVal = (1 << bits) - 1;
  6179. for (let i = 0; i < count; i++) {
  6180. this.#toRgb(src, srcOffset, maxVal, dest, destOffset);
  6181. srcOffset += 3;
  6182. destOffset += 3 + alpha01;
  6183. }
  6184. }
  6185. getOutputLength(inputLength, alpha01) {
  6186. return inputLength * (3 + alpha01) / 3 | 0;
  6187. }
  6188. isDefaultDecode(decodeMap, bpc) {
  6189. return true;
  6190. }
  6191. get usesZeroToOneRange() {
  6192. return shadow(this, "usesZeroToOneRange", false);
  6193. }
  6194. }
  6195. ;// ./src/core/binary_cmap.js
  6196. function hexToInt(a, size) {
  6197. let n = 0;
  6198. for (let i = 0; i <= size; i++) {
  6199. n = n << 8 | a[i];
  6200. }
  6201. return n >>> 0;
  6202. }
  6203. function hexToStr(a, size) {
  6204. if (size === 1) {
  6205. return String.fromCharCode(a[0], a[1]);
  6206. }
  6207. if (size === 3) {
  6208. return String.fromCharCode(a[0], a[1], a[2], a[3]);
  6209. }
  6210. return String.fromCharCode(...a.subarray(0, size + 1));
  6211. }
  6212. function addHex(a, b, size) {
  6213. let c = 0;
  6214. for (let i = size; i >= 0; i--) {
  6215. c += a[i] + b[i];
  6216. a[i] = c & 255;
  6217. c >>= 8;
  6218. }
  6219. }
  6220. function incHex(a, size) {
  6221. let c = 1;
  6222. for (let i = size; i >= 0 && c > 0; i--) {
  6223. c += a[i];
  6224. a[i] = c & 255;
  6225. c >>= 8;
  6226. }
  6227. }
  6228. const MAX_NUM_SIZE = 16;
  6229. const MAX_ENCODED_NUM_SIZE = 19;
  6230. class BinaryCMapStream {
  6231. constructor(data) {
  6232. this.buffer = data;
  6233. this.pos = 0;
  6234. this.end = data.length;
  6235. this.tmpBuf = new Uint8Array(MAX_ENCODED_NUM_SIZE);
  6236. }
  6237. readByte() {
  6238. if (this.pos >= this.end) {
  6239. return -1;
  6240. }
  6241. return this.buffer[this.pos++];
  6242. }
  6243. readNumber() {
  6244. let n = 0;
  6245. let last;
  6246. do {
  6247. const b = this.readByte();
  6248. if (b < 0) {
  6249. throw new FormatError("unexpected EOF in bcmap");
  6250. }
  6251. last = !(b & 0x80);
  6252. n = n << 7 | b & 0x7f;
  6253. } while (!last);
  6254. return n;
  6255. }
  6256. readSigned() {
  6257. const n = this.readNumber();
  6258. return n & 1 ? ~(n >>> 1) : n >>> 1;
  6259. }
  6260. readHex(num, size) {
  6261. num.set(this.buffer.subarray(this.pos, this.pos + size + 1));
  6262. this.pos += size + 1;
  6263. }
  6264. readHexNumber(num, size) {
  6265. let last;
  6266. const stack = this.tmpBuf;
  6267. let sp = 0;
  6268. do {
  6269. const b = this.readByte();
  6270. if (b < 0) {
  6271. throw new FormatError("unexpected EOF in bcmap");
  6272. }
  6273. last = !(b & 0x80);
  6274. stack[sp++] = b & 0x7f;
  6275. } while (!last);
  6276. let i = size,
  6277. buffer = 0,
  6278. bufferSize = 0;
  6279. while (i >= 0) {
  6280. while (bufferSize < 8 && stack.length > 0) {
  6281. buffer |= stack[--sp] << bufferSize;
  6282. bufferSize += 7;
  6283. }
  6284. num[i] = buffer & 255;
  6285. i--;
  6286. buffer >>= 8;
  6287. bufferSize -= 8;
  6288. }
  6289. }
  6290. readHexSigned(num, size) {
  6291. this.readHexNumber(num, size);
  6292. const sign = num[size] & 1 ? 255 : 0;
  6293. let c = 0;
  6294. for (let i = 0; i <= size; i++) {
  6295. c = (c & 1) << 8 | num[i];
  6296. num[i] = c >> 1 ^ sign;
  6297. }
  6298. }
  6299. readString() {
  6300. const len = this.readNumber(),
  6301. buf = new Array(len);
  6302. for (let i = 0; i < len; i++) {
  6303. buf[i] = this.readNumber();
  6304. }
  6305. return String.fromCharCode(...buf);
  6306. }
  6307. }
  6308. class BinaryCMapReader {
  6309. async process(data, cMap, extend) {
  6310. const stream = new BinaryCMapStream(data);
  6311. const header = stream.readByte();
  6312. cMap.vertical = !!(header & 1);
  6313. let useCMap = null;
  6314. const start = new Uint8Array(MAX_NUM_SIZE);
  6315. const end = new Uint8Array(MAX_NUM_SIZE);
  6316. const char = new Uint8Array(MAX_NUM_SIZE);
  6317. const charCode = new Uint8Array(MAX_NUM_SIZE);
  6318. const tmp = new Uint8Array(MAX_NUM_SIZE);
  6319. let code;
  6320. let b;
  6321. while ((b = stream.readByte()) >= 0) {
  6322. const type = b >> 5;
  6323. if (type === 7) {
  6324. switch (b & 0x1f) {
  6325. case 0:
  6326. stream.readString();
  6327. break;
  6328. case 1:
  6329. useCMap = stream.readString();
  6330. break;
  6331. }
  6332. continue;
  6333. }
  6334. const sequence = !!(b & 0x10);
  6335. const dataSize = b & 15;
  6336. if (dataSize + 1 > MAX_NUM_SIZE) {
  6337. throw new Error("BinaryCMapReader.process: Invalid dataSize.");
  6338. }
  6339. const ucs2DataSize = 1;
  6340. const subitemsCount = stream.readNumber();
  6341. switch (type) {
  6342. case 0:
  6343. stream.readHex(start, dataSize);
  6344. stream.readHexNumber(end, dataSize);
  6345. addHex(end, start, dataSize);
  6346. cMap.addCodespaceRange(dataSize + 1, hexToInt(start, dataSize), hexToInt(end, dataSize));
  6347. for (let i = 1; i < subitemsCount; i++) {
  6348. incHex(end, dataSize);
  6349. stream.readHexNumber(start, dataSize);
  6350. addHex(start, end, dataSize);
  6351. stream.readHexNumber(end, dataSize);
  6352. addHex(end, start, dataSize);
  6353. cMap.addCodespaceRange(dataSize + 1, hexToInt(start, dataSize), hexToInt(end, dataSize));
  6354. }
  6355. break;
  6356. case 1:
  6357. stream.readHex(start, dataSize);
  6358. stream.readHexNumber(end, dataSize);
  6359. addHex(end, start, dataSize);
  6360. stream.readNumber();
  6361. for (let i = 1; i < subitemsCount; i++) {
  6362. incHex(end, dataSize);
  6363. stream.readHexNumber(start, dataSize);
  6364. addHex(start, end, dataSize);
  6365. stream.readHexNumber(end, dataSize);
  6366. addHex(end, start, dataSize);
  6367. stream.readNumber();
  6368. }
  6369. break;
  6370. case 2:
  6371. stream.readHex(char, dataSize);
  6372. code = stream.readNumber();
  6373. cMap.mapOne(hexToInt(char, dataSize), code);
  6374. for (let i = 1; i < subitemsCount; i++) {
  6375. incHex(char, dataSize);
  6376. if (!sequence) {
  6377. stream.readHexNumber(tmp, dataSize);
  6378. addHex(char, tmp, dataSize);
  6379. }
  6380. code = stream.readSigned() + (code + 1);
  6381. cMap.mapOne(hexToInt(char, dataSize), code);
  6382. }
  6383. break;
  6384. case 3:
  6385. stream.readHex(start, dataSize);
  6386. stream.readHexNumber(end, dataSize);
  6387. addHex(end, start, dataSize);
  6388. code = stream.readNumber();
  6389. cMap.mapCidRange(hexToInt(start, dataSize), hexToInt(end, dataSize), code);
  6390. for (let i = 1; i < subitemsCount; i++) {
  6391. incHex(end, dataSize);
  6392. if (!sequence) {
  6393. stream.readHexNumber(start, dataSize);
  6394. addHex(start, end, dataSize);
  6395. } else {
  6396. start.set(end);
  6397. }
  6398. stream.readHexNumber(end, dataSize);
  6399. addHex(end, start, dataSize);
  6400. code = stream.readNumber();
  6401. cMap.mapCidRange(hexToInt(start, dataSize), hexToInt(end, dataSize), code);
  6402. }
  6403. break;
  6404. case 4:
  6405. stream.readHex(char, ucs2DataSize);
  6406. stream.readHex(charCode, dataSize);
  6407. cMap.mapOne(hexToInt(char, ucs2DataSize), hexToStr(charCode, dataSize));
  6408. for (let i = 1; i < subitemsCount; i++) {
  6409. incHex(char, ucs2DataSize);
  6410. if (!sequence) {
  6411. stream.readHexNumber(tmp, ucs2DataSize);
  6412. addHex(char, tmp, ucs2DataSize);
  6413. }
  6414. incHex(charCode, dataSize);
  6415. stream.readHexSigned(tmp, dataSize);
  6416. addHex(charCode, tmp, dataSize);
  6417. cMap.mapOne(hexToInt(char, ucs2DataSize), hexToStr(charCode, dataSize));
  6418. }
  6419. break;
  6420. case 5:
  6421. stream.readHex(start, ucs2DataSize);
  6422. stream.readHexNumber(end, ucs2DataSize);
  6423. addHex(end, start, ucs2DataSize);
  6424. stream.readHex(charCode, dataSize);
  6425. cMap.mapBfRange(hexToInt(start, ucs2DataSize), hexToInt(end, ucs2DataSize), hexToStr(charCode, dataSize));
  6426. for (let i = 1; i < subitemsCount; i++) {
  6427. incHex(end, ucs2DataSize);
  6428. if (!sequence) {
  6429. stream.readHexNumber(start, ucs2DataSize);
  6430. addHex(start, end, ucs2DataSize);
  6431. } else {
  6432. start.set(end);
  6433. }
  6434. stream.readHexNumber(end, ucs2DataSize);
  6435. addHex(end, start, ucs2DataSize);
  6436. stream.readHex(charCode, dataSize);
  6437. cMap.mapBfRange(hexToInt(start, ucs2DataSize), hexToInt(end, ucs2DataSize), hexToStr(charCode, dataSize));
  6438. }
  6439. break;
  6440. default:
  6441. throw new Error(`BinaryCMapReader.process - unknown type: ${type}`);
  6442. }
  6443. }
  6444. if (useCMap) {
  6445. return extend(useCMap);
  6446. }
  6447. return cMap;
  6448. }
  6449. }
  6450. ;// ./src/core/decode_stream.js
  6451. const emptyBuffer = new Uint8Array(0);
  6452. class DecodeStream extends BaseStream {
  6453. constructor(maybeMinBufferLength) {
  6454. super();
  6455. this._rawMinBufferLength = maybeMinBufferLength || 0;
  6456. this.pos = 0;
  6457. this.bufferLength = 0;
  6458. this.eof = false;
  6459. this.buffer = emptyBuffer;
  6460. this.minBufferLength = 512;
  6461. if (maybeMinBufferLength) {
  6462. while (this.minBufferLength < maybeMinBufferLength) {
  6463. this.minBufferLength *= 2;
  6464. }
  6465. }
  6466. }
  6467. get isEmpty() {
  6468. while (!this.eof && this.bufferLength === 0) {
  6469. this.readBlock();
  6470. }
  6471. return this.bufferLength === 0;
  6472. }
  6473. ensureBuffer(requested) {
  6474. const buffer = this.buffer;
  6475. if (requested <= buffer.byteLength) {
  6476. return buffer;
  6477. }
  6478. let size = this.minBufferLength;
  6479. while (size < requested) {
  6480. size *= 2;
  6481. }
  6482. const buffer2 = new Uint8Array(size);
  6483. buffer2.set(buffer);
  6484. return this.buffer = buffer2;
  6485. }
  6486. getByte() {
  6487. const pos = this.pos;
  6488. while (this.bufferLength <= pos) {
  6489. if (this.eof) {
  6490. return -1;
  6491. }
  6492. this.readBlock();
  6493. }
  6494. return this.buffer[this.pos++];
  6495. }
  6496. getBytes(length, decoderOptions = null) {
  6497. const pos = this.pos;
  6498. let end;
  6499. if (length) {
  6500. this.ensureBuffer(pos + length);
  6501. end = pos + length;
  6502. while (!this.eof && this.bufferLength < end) {
  6503. this.readBlock(decoderOptions);
  6504. }
  6505. const bufEnd = this.bufferLength;
  6506. if (end > bufEnd) {
  6507. end = bufEnd;
  6508. }
  6509. } else {
  6510. while (!this.eof) {
  6511. this.readBlock(decoderOptions);
  6512. }
  6513. end = this.bufferLength;
  6514. }
  6515. this.pos = end;
  6516. return this.buffer.subarray(pos, end);
  6517. }
  6518. async getImageData(length, decoderOptions = null) {
  6519. if (!this.canAsyncDecodeImageFromBuffer) {
  6520. return this.getBytes(length, decoderOptions);
  6521. }
  6522. const data = await this.stream.asyncGetBytes();
  6523. return this.decodeImage(data, decoderOptions);
  6524. }
  6525. reset() {
  6526. this.pos = 0;
  6527. }
  6528. makeSubStream(start, length, dict = null) {
  6529. if (length === undefined) {
  6530. while (!this.eof) {
  6531. this.readBlock();
  6532. }
  6533. } else {
  6534. const end = start + length;
  6535. while (this.bufferLength <= end && !this.eof) {
  6536. this.readBlock();
  6537. }
  6538. }
  6539. return new Stream(this.buffer, start, length, dict);
  6540. }
  6541. getBaseStreams() {
  6542. return this.str ? this.str.getBaseStreams() : null;
  6543. }
  6544. }
  6545. class StreamsSequenceStream extends DecodeStream {
  6546. constructor(streams, onError = null) {
  6547. let maybeLength = 0;
  6548. for (const stream of streams) {
  6549. maybeLength += stream instanceof DecodeStream ? stream._rawMinBufferLength : stream.length;
  6550. }
  6551. super(maybeLength);
  6552. this.streams = streams;
  6553. this._onError = onError;
  6554. }
  6555. readBlock() {
  6556. const streams = this.streams;
  6557. if (streams.length === 0) {
  6558. this.eof = true;
  6559. return;
  6560. }
  6561. const stream = streams.shift();
  6562. let chunk;
  6563. try {
  6564. chunk = stream.getBytes();
  6565. } catch (reason) {
  6566. if (this._onError) {
  6567. this._onError(reason, stream.dict?.objId);
  6568. return;
  6569. }
  6570. throw reason;
  6571. }
  6572. const bufferLength = this.bufferLength;
  6573. const newLength = bufferLength + chunk.length;
  6574. const buffer = this.ensureBuffer(newLength);
  6575. buffer.set(chunk, bufferLength);
  6576. this.bufferLength = newLength;
  6577. }
  6578. getBaseStreams() {
  6579. const baseStreamsBuf = [];
  6580. for (const stream of this.streams) {
  6581. const baseStreams = stream.getBaseStreams();
  6582. if (baseStreams) {
  6583. baseStreamsBuf.push(...baseStreams);
  6584. }
  6585. }
  6586. return baseStreamsBuf.length > 0 ? baseStreamsBuf : null;
  6587. }
  6588. }
  6589. ;// ./src/core/ascii_85_stream.js
  6590. class Ascii85Stream extends DecodeStream {
  6591. constructor(str, maybeLength) {
  6592. if (maybeLength) {
  6593. maybeLength *= 0.8;
  6594. }
  6595. super(maybeLength);
  6596. this.str = str;
  6597. this.dict = str.dict;
  6598. this.input = new Uint8Array(5);
  6599. }
  6600. readBlock() {
  6601. const TILDA_CHAR = 0x7e;
  6602. const Z_LOWER_CHAR = 0x7a;
  6603. const EOF = -1;
  6604. const str = this.str;
  6605. let c = str.getByte();
  6606. while (isWhiteSpace(c)) {
  6607. c = str.getByte();
  6608. }
  6609. if (c === EOF || c === TILDA_CHAR) {
  6610. this.eof = true;
  6611. return;
  6612. }
  6613. const bufferLength = this.bufferLength;
  6614. let buffer, i;
  6615. if (c === Z_LOWER_CHAR) {
  6616. buffer = this.ensureBuffer(bufferLength + 4);
  6617. for (i = 0; i < 4; ++i) {
  6618. buffer[bufferLength + i] = 0;
  6619. }
  6620. this.bufferLength += 4;
  6621. } else {
  6622. const input = this.input;
  6623. input[0] = c;
  6624. for (i = 1; i < 5; ++i) {
  6625. c = str.getByte();
  6626. while (isWhiteSpace(c)) {
  6627. c = str.getByte();
  6628. }
  6629. input[i] = c;
  6630. if (c === EOF || c === TILDA_CHAR) {
  6631. break;
  6632. }
  6633. }
  6634. buffer = this.ensureBuffer(bufferLength + i - 1);
  6635. this.bufferLength += i - 1;
  6636. if (i < 5) {
  6637. for (; i < 5; ++i) {
  6638. input[i] = 0x21 + 84;
  6639. }
  6640. this.eof = true;
  6641. }
  6642. let t = 0;
  6643. for (i = 0; i < 5; ++i) {
  6644. t = t * 85 + (input[i] - 0x21);
  6645. }
  6646. for (i = 3; i >= 0; --i) {
  6647. buffer[bufferLength + i] = t & 0xff;
  6648. t >>= 8;
  6649. }
  6650. }
  6651. }
  6652. }
  6653. ;// ./src/core/ascii_hex_stream.js
  6654. class AsciiHexStream extends DecodeStream {
  6655. constructor(str, maybeLength) {
  6656. if (maybeLength) {
  6657. maybeLength *= 0.5;
  6658. }
  6659. super(maybeLength);
  6660. this.str = str;
  6661. this.dict = str.dict;
  6662. this.firstDigit = -1;
  6663. }
  6664. readBlock() {
  6665. const UPSTREAM_BLOCK_SIZE = 8000;
  6666. const bytes = this.str.getBytes(UPSTREAM_BLOCK_SIZE);
  6667. if (!bytes.length) {
  6668. this.eof = true;
  6669. return;
  6670. }
  6671. const maxDecodeLength = bytes.length + 1 >> 1;
  6672. const buffer = this.ensureBuffer(this.bufferLength + maxDecodeLength);
  6673. let bufferLength = this.bufferLength;
  6674. let firstDigit = this.firstDigit;
  6675. for (const ch of bytes) {
  6676. let digit;
  6677. if (ch >= 0x30 && ch <= 0x39) {
  6678. digit = ch & 0x0f;
  6679. } else if (ch >= 0x41 && ch <= 0x46 || ch >= 0x61 && ch <= 0x66) {
  6680. digit = (ch & 0x0f) + 9;
  6681. } else if (ch === 0x3e) {
  6682. this.eof = true;
  6683. break;
  6684. } else {
  6685. continue;
  6686. }
  6687. if (firstDigit < 0) {
  6688. firstDigit = digit;
  6689. } else {
  6690. buffer[bufferLength++] = firstDigit << 4 | digit;
  6691. firstDigit = -1;
  6692. }
  6693. }
  6694. if (firstDigit >= 0 && this.eof) {
  6695. buffer[bufferLength++] = firstDigit << 4;
  6696. firstDigit = -1;
  6697. }
  6698. this.firstDigit = firstDigit;
  6699. this.bufferLength = bufferLength;
  6700. }
  6701. }
  6702. ;// ./src/core/ccitt.js
  6703. const ccittEOL = -2;
  6704. const ccittEOF = -1;
  6705. const twoDimPass = 0;
  6706. const twoDimHoriz = 1;
  6707. const twoDimVert0 = 2;
  6708. const twoDimVertR1 = 3;
  6709. const twoDimVertL1 = 4;
  6710. const twoDimVertR2 = 5;
  6711. const twoDimVertL2 = 6;
  6712. const twoDimVertR3 = 7;
  6713. const twoDimVertL3 = 8;
  6714. const twoDimTable = [[-1, -1], [-1, -1], [7, twoDimVertL3], [7, twoDimVertR3], [6, twoDimVertL2], [6, twoDimVertL2], [6, twoDimVertR2], [6, twoDimVertR2], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0]];
  6715. const whiteTable1 = [[-1, -1], [12, ccittEOL], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [11, 1792], [11, 1792], [12, 1984], [12, 2048], [12, 2112], [12, 2176], [12, 2240], [12, 2304], [11, 1856], [11, 1856], [11, 1920], [11, 1920], [12, 2368], [12, 2432], [12, 2496], [12, 2560]];
  6716. const whiteTable2 = [[-1, -1], [-1, -1], [-1, -1], [-1, -1], [8, 29], [8, 29], [8, 30], [8, 30], [8, 45], [8, 45], [8, 46], [8, 46], [7, 22], [7, 22], [7, 22], [7, 22], [7, 23], [7, 23], [7, 23], [7, 23], [8, 47], [8, 47], [8, 48], [8, 48], [6, 13], [6, 13], [6, 13], [6, 13], [6, 13], [6, 13], [6, 13], [6, 13], [7, 20], [7, 20], [7, 20], [7, 20], [8, 33], [8, 33], [8, 34], [8, 34], [8, 35], [8, 35], [8, 36], [8, 36], [8, 37], [8, 37], [8, 38], [8, 38], [7, 19], [7, 19], [7, 19], [7, 19], [8, 31], [8, 31], [8, 32], [8, 32], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 12], [6, 12], [6, 12], [6, 12], [6, 12], [6, 12], [6, 12], [6, 12], [8, 53], [8, 53], [8, 54], [8, 54], [7, 26], [7, 26], [7, 26], [7, 26], [8, 39], [8, 39], [8, 40], [8, 40], [8, 41], [8, 41], [8, 42], [8, 42], [8, 43], [8, 43], [8, 44], [8, 44], [7, 21], [7, 21], [7, 21], [7, 21], [7, 28], [7, 28], [7, 28], [7, 28], [8, 61], [8, 61], [8, 62], [8, 62], [8, 63], [8, 63], [8, 0], [8, 0], [8, 320], [8, 320], [8, 384], [8, 384], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [7, 27], [7, 27], [7, 27], [7, 27], [8, 59], [8, 59], [8, 60], [8, 60], [9, 1472], [9, 1536], [9, 1600], [9, 1728], [7, 18], [7, 18], [7, 18], [7, 18], [7, 24], [7, 24], [7, 24], [7, 24], [8, 49], [8, 49], [8, 50], [8, 50], [8, 51], [8, 51], [8, 52], [8, 52], [7, 25], [7, 25], [7, 25], [7, 25], [8, 55], [8, 55], [8, 56], [8, 56], [8, 57], [8, 57], [8, 58], [8, 58], [6, 192], [6, 192], [6, 192], [6, 192], [6, 192], [6, 192], [6, 192], [6, 192], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [8, 448], [8, 448], [8, 512], [8, 512], [9, 704], [9, 768], [8, 640], [8, 640], [8, 576], [8, 576], [9, 832], [9, 896], [9, 960], [9, 1024], [9, 1088], [9, 1152], [9, 1216], [9, 1280], [9, 1344], [9, 1408], [7, 256], [7, 256], [7, 256], [7, 256], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [6, 16], [6, 16], [6, 16], [6, 16], [6, 16], [6, 16], [6, 16], [6, 16], [6, 17], [6, 17], [6, 17], [6, 17], [6, 17], [6, 17], [6, 17], [6, 17], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [6, 14], [6, 14], [6, 14], [6, 14], [6, 14], [6, 14], [6, 14], [6, 14], [6, 15], [6, 15], [6, 15], [6, 15], [6, 15], [6, 15], [6, 15], [6, 15], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7]];
  6717. const blackTable1 = [[-1, -1], [-1, -1], [12, ccittEOL], [12, ccittEOL], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [11, 1792], [11, 1792], [11, 1792], [11, 1792], [12, 1984], [12, 1984], [12, 2048], [12, 2048], [12, 2112], [12, 2112], [12, 2176], [12, 2176], [12, 2240], [12, 2240], [12, 2304], [12, 2304], [11, 1856], [11, 1856], [11, 1856], [11, 1856], [11, 1920], [11, 1920], [11, 1920], [11, 1920], [12, 2368], [12, 2368], [12, 2432], [12, 2432], [12, 2496], [12, 2496], [12, 2560], [12, 2560], [10, 18], [10, 18], [10, 18], [10, 18], [10, 18], [10, 18], [10, 18], [10, 18], [12, 52], [12, 52], [13, 640], [13, 704], [13, 768], [13, 832], [12, 55], [12, 55], [12, 56], [12, 56], [13, 1280], [13, 1344], [13, 1408], [13, 1472], [12, 59], [12, 59], [12, 60], [12, 60], [13, 1536], [13, 1600], [11, 24], [11, 24], [11, 24], [11, 24], [11, 25], [11, 25], [11, 25], [11, 25], [13, 1664], [13, 1728], [12, 320], [12, 320], [12, 384], [12, 384], [12, 448], [12, 448], [13, 512], [13, 576], [12, 53], [12, 53], [12, 54], [12, 54], [13, 896], [13, 960], [13, 1024], [13, 1088], [13, 1152], [13, 1216], [10, 64], [10, 64], [10, 64], [10, 64], [10, 64], [10, 64], [10, 64], [10, 64]];
  6718. const blackTable2 = [[8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [11, 23], [11, 23], [12, 50], [12, 51], [12, 44], [12, 45], [12, 46], [12, 47], [12, 57], [12, 58], [12, 61], [12, 256], [10, 16], [10, 16], [10, 16], [10, 16], [10, 17], [10, 17], [10, 17], [10, 17], [12, 48], [12, 49], [12, 62], [12, 63], [12, 30], [12, 31], [12, 32], [12, 33], [12, 40], [12, 41], [11, 22], [11, 22], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [9, 15], [9, 15], [9, 15], [9, 15], [9, 15], [9, 15], [9, 15], [9, 15], [12, 128], [12, 192], [12, 26], [12, 27], [12, 28], [12, 29], [11, 19], [11, 19], [11, 20], [11, 20], [12, 34], [12, 35], [12, 36], [12, 37], [12, 38], [12, 39], [11, 21], [11, 21], [12, 42], [12, 43], [10, 0], [10, 0], [10, 0], [10, 0], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12]];
  6719. const blackTable3 = [[-1, -1], [-1, -1], [-1, -1], [-1, -1], [6, 9], [6, 8], [5, 7], [5, 7], [4, 6], [4, 6], [4, 6], [4, 6], [4, 5], [4, 5], [4, 5], [4, 5], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2]];
  6720. class CCITTFaxDecoder {
  6721. constructor(source, options = {}) {
  6722. if (!source || typeof source.next !== "function") {
  6723. throw new Error('CCITTFaxDecoder - invalid "source" parameter.');
  6724. }
  6725. this.source = source;
  6726. this.eof = false;
  6727. this.encoding = options.K || 0;
  6728. this.eoline = options.EndOfLine || false;
  6729. this.byteAlign = options.EncodedByteAlign || false;
  6730. this.columns = options.Columns || 1728;
  6731. this.rows = options.Rows || 0;
  6732. this.eoblock = options.EndOfBlock ?? true;
  6733. this.black = options.BlackIs1 || false;
  6734. this.codingLine = new Uint32Array(this.columns + 1);
  6735. this.refLine = new Uint32Array(this.columns + 2);
  6736. this.codingLine[0] = this.columns;
  6737. this.codingPos = 0;
  6738. this.row = 0;
  6739. this.nextLine2D = this.encoding < 0;
  6740. this.inputBits = 0;
  6741. this.inputBuf = 0;
  6742. this.outputBits = 0;
  6743. this.rowsDone = false;
  6744. let code1;
  6745. while ((code1 = this._lookBits(12)) === 0) {
  6746. this._eatBits(1);
  6747. }
  6748. if (code1 === 1) {
  6749. this._eatBits(12);
  6750. }
  6751. if (this.encoding > 0) {
  6752. this.nextLine2D = !this._lookBits(1);
  6753. this._eatBits(1);
  6754. }
  6755. }
  6756. readNextChar() {
  6757. if (this.eof) {
  6758. return -1;
  6759. }
  6760. const refLine = this.refLine;
  6761. const codingLine = this.codingLine;
  6762. const columns = this.columns;
  6763. let refPos, blackPixels, bits, i;
  6764. if (this.outputBits === 0) {
  6765. if (this.rowsDone) {
  6766. this.eof = true;
  6767. }
  6768. if (this.eof) {
  6769. return -1;
  6770. }
  6771. this.err = false;
  6772. let code1, code2, code3;
  6773. if (this.nextLine2D) {
  6774. for (i = 0; codingLine[i] < columns; ++i) {
  6775. refLine[i] = codingLine[i];
  6776. }
  6777. refLine[i++] = columns;
  6778. refLine[i] = columns;
  6779. codingLine[0] = 0;
  6780. this.codingPos = 0;
  6781. refPos = 0;
  6782. blackPixels = 0;
  6783. while (codingLine[this.codingPos] < columns) {
  6784. code1 = this._getTwoDimCode();
  6785. switch (code1) {
  6786. case twoDimPass:
  6787. this._addPixels(refLine[refPos + 1], blackPixels);
  6788. if (refLine[refPos + 1] < columns) {
  6789. refPos += 2;
  6790. }
  6791. break;
  6792. case twoDimHoriz:
  6793. code1 = code2 = 0;
  6794. if (blackPixels) {
  6795. do {
  6796. code1 += code3 = this._getBlackCode();
  6797. } while (code3 >= 64);
  6798. do {
  6799. code2 += code3 = this._getWhiteCode();
  6800. } while (code3 >= 64);
  6801. } else {
  6802. do {
  6803. code1 += code3 = this._getWhiteCode();
  6804. } while (code3 >= 64);
  6805. do {
  6806. code2 += code3 = this._getBlackCode();
  6807. } while (code3 >= 64);
  6808. }
  6809. this._addPixels(codingLine[this.codingPos] + code1, blackPixels);
  6810. if (codingLine[this.codingPos] < columns) {
  6811. this._addPixels(codingLine[this.codingPos] + code2, blackPixels ^ 1);
  6812. }
  6813. while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) {
  6814. refPos += 2;
  6815. }
  6816. break;
  6817. case twoDimVertR3:
  6818. this._addPixels(refLine[refPos] + 3, blackPixels);
  6819. blackPixels ^= 1;
  6820. if (codingLine[this.codingPos] < columns) {
  6821. ++refPos;
  6822. while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) {
  6823. refPos += 2;
  6824. }
  6825. }
  6826. break;
  6827. case twoDimVertR2:
  6828. this._addPixels(refLine[refPos] + 2, blackPixels);
  6829. blackPixels ^= 1;
  6830. if (codingLine[this.codingPos] < columns) {
  6831. ++refPos;
  6832. while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) {
  6833. refPos += 2;
  6834. }
  6835. }
  6836. break;
  6837. case twoDimVertR1:
  6838. this._addPixels(refLine[refPos] + 1, blackPixels);
  6839. blackPixels ^= 1;
  6840. if (codingLine[this.codingPos] < columns) {
  6841. ++refPos;
  6842. while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) {
  6843. refPos += 2;
  6844. }
  6845. }
  6846. break;
  6847. case twoDimVert0:
  6848. this._addPixels(refLine[refPos], blackPixels);
  6849. blackPixels ^= 1;
  6850. if (codingLine[this.codingPos] < columns) {
  6851. ++refPos;
  6852. while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) {
  6853. refPos += 2;
  6854. }
  6855. }
  6856. break;
  6857. case twoDimVertL3:
  6858. this._addPixelsNeg(refLine[refPos] - 3, blackPixels);
  6859. blackPixels ^= 1;
  6860. if (codingLine[this.codingPos] < columns) {
  6861. if (refPos > 0) {
  6862. --refPos;
  6863. } else {
  6864. ++refPos;
  6865. }
  6866. while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) {
  6867. refPos += 2;
  6868. }
  6869. }
  6870. break;
  6871. case twoDimVertL2:
  6872. this._addPixelsNeg(refLine[refPos] - 2, blackPixels);
  6873. blackPixels ^= 1;
  6874. if (codingLine[this.codingPos] < columns) {
  6875. if (refPos > 0) {
  6876. --refPos;
  6877. } else {
  6878. ++refPos;
  6879. }
  6880. while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) {
  6881. refPos += 2;
  6882. }
  6883. }
  6884. break;
  6885. case twoDimVertL1:
  6886. this._addPixelsNeg(refLine[refPos] - 1, blackPixels);
  6887. blackPixels ^= 1;
  6888. if (codingLine[this.codingPos] < columns) {
  6889. if (refPos > 0) {
  6890. --refPos;
  6891. } else {
  6892. ++refPos;
  6893. }
  6894. while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) {
  6895. refPos += 2;
  6896. }
  6897. }
  6898. break;
  6899. case ccittEOF:
  6900. this._addPixels(columns, 0);
  6901. this.eof = true;
  6902. break;
  6903. default:
  6904. info("bad 2d code");
  6905. this._addPixels(columns, 0);
  6906. this.err = true;
  6907. }
  6908. }
  6909. } else {
  6910. codingLine[0] = 0;
  6911. this.codingPos = 0;
  6912. blackPixels = 0;
  6913. while (codingLine[this.codingPos] < columns) {
  6914. code1 = 0;
  6915. if (blackPixels) {
  6916. do {
  6917. code1 += code3 = this._getBlackCode();
  6918. } while (code3 >= 64);
  6919. } else {
  6920. do {
  6921. code1 += code3 = this._getWhiteCode();
  6922. } while (code3 >= 64);
  6923. }
  6924. this._addPixels(codingLine[this.codingPos] + code1, blackPixels);
  6925. blackPixels ^= 1;
  6926. }
  6927. }
  6928. let gotEOL = false;
  6929. if (this.byteAlign) {
  6930. this.inputBits &= ~7;
  6931. }
  6932. if (!this.eoblock && this.row === this.rows - 1) {
  6933. this.rowsDone = true;
  6934. } else {
  6935. code1 = this._lookBits(12);
  6936. if (this.eoline) {
  6937. while (code1 !== ccittEOF && code1 !== 1) {
  6938. this._eatBits(1);
  6939. code1 = this._lookBits(12);
  6940. }
  6941. } else {
  6942. while (code1 === 0) {
  6943. this._eatBits(1);
  6944. code1 = this._lookBits(12);
  6945. }
  6946. }
  6947. if (code1 === 1) {
  6948. this._eatBits(12);
  6949. gotEOL = true;
  6950. } else if (code1 === ccittEOF) {
  6951. this.eof = true;
  6952. }
  6953. }
  6954. if (!this.eof && this.encoding > 0 && !this.rowsDone) {
  6955. this.nextLine2D = !this._lookBits(1);
  6956. this._eatBits(1);
  6957. }
  6958. if (this.eoblock && gotEOL && this.byteAlign) {
  6959. code1 = this._lookBits(12);
  6960. if (code1 === 1) {
  6961. this._eatBits(12);
  6962. if (this.encoding > 0) {
  6963. this._lookBits(1);
  6964. this._eatBits(1);
  6965. }
  6966. if (this.encoding >= 0) {
  6967. for (i = 0; i < 4; ++i) {
  6968. code1 = this._lookBits(12);
  6969. if (code1 !== 1) {
  6970. info("bad rtc code: " + code1);
  6971. }
  6972. this._eatBits(12);
  6973. if (this.encoding > 0) {
  6974. this._lookBits(1);
  6975. this._eatBits(1);
  6976. }
  6977. }
  6978. }
  6979. this.eof = true;
  6980. }
  6981. } else if (this.err && this.eoline) {
  6982. while (true) {
  6983. code1 = this._lookBits(13);
  6984. if (code1 === ccittEOF) {
  6985. this.eof = true;
  6986. return -1;
  6987. }
  6988. if (code1 >> 1 === 1) {
  6989. break;
  6990. }
  6991. this._eatBits(1);
  6992. }
  6993. this._eatBits(12);
  6994. if (this.encoding > 0) {
  6995. this._eatBits(1);
  6996. this.nextLine2D = !(code1 & 1);
  6997. }
  6998. }
  6999. this.outputBits = codingLine[0] > 0 ? codingLine[this.codingPos = 0] : codingLine[this.codingPos = 1];
  7000. this.row++;
  7001. }
  7002. let c;
  7003. if (this.outputBits >= 8) {
  7004. c = this.codingPos & 1 ? 0 : 0xff;
  7005. this.outputBits -= 8;
  7006. if (this.outputBits === 0 && codingLine[this.codingPos] < columns) {
  7007. this.codingPos++;
  7008. this.outputBits = codingLine[this.codingPos] - codingLine[this.codingPos - 1];
  7009. }
  7010. } else {
  7011. bits = 8;
  7012. c = 0;
  7013. do {
  7014. if (typeof this.outputBits !== "number") {
  7015. throw new FormatError('Invalid /CCITTFaxDecode data, "outputBits" must be a number.');
  7016. }
  7017. if (this.outputBits > bits) {
  7018. c <<= bits;
  7019. if (!(this.codingPos & 1)) {
  7020. c |= 0xff >> 8 - bits;
  7021. }
  7022. this.outputBits -= bits;
  7023. bits = 0;
  7024. } else {
  7025. c <<= this.outputBits;
  7026. if (!(this.codingPos & 1)) {
  7027. c |= 0xff >> 8 - this.outputBits;
  7028. }
  7029. bits -= this.outputBits;
  7030. this.outputBits = 0;
  7031. if (codingLine[this.codingPos] < columns) {
  7032. this.codingPos++;
  7033. this.outputBits = codingLine[this.codingPos] - codingLine[this.codingPos - 1];
  7034. } else if (bits > 0) {
  7035. c <<= bits;
  7036. bits = 0;
  7037. }
  7038. }
  7039. } while (bits);
  7040. }
  7041. if (this.black) {
  7042. c ^= 0xff;
  7043. }
  7044. return c;
  7045. }
  7046. _addPixels(a1, blackPixels) {
  7047. const codingLine = this.codingLine;
  7048. let codingPos = this.codingPos;
  7049. if (a1 > codingLine[codingPos]) {
  7050. if (a1 > this.columns) {
  7051. info("row is wrong length");
  7052. this.err = true;
  7053. a1 = this.columns;
  7054. }
  7055. if (codingPos & 1 ^ blackPixels) {
  7056. ++codingPos;
  7057. }
  7058. codingLine[codingPos] = a1;
  7059. }
  7060. this.codingPos = codingPos;
  7061. }
  7062. _addPixelsNeg(a1, blackPixels) {
  7063. const codingLine = this.codingLine;
  7064. let codingPos = this.codingPos;
  7065. if (a1 > codingLine[codingPos]) {
  7066. if (a1 > this.columns) {
  7067. info("row is wrong length");
  7068. this.err = true;
  7069. a1 = this.columns;
  7070. }
  7071. if (codingPos & 1 ^ blackPixels) {
  7072. ++codingPos;
  7073. }
  7074. codingLine[codingPos] = a1;
  7075. } else if (a1 < codingLine[codingPos]) {
  7076. if (a1 < 0) {
  7077. info("invalid code");
  7078. this.err = true;
  7079. a1 = 0;
  7080. }
  7081. while (codingPos > 0 && a1 < codingLine[codingPos - 1]) {
  7082. --codingPos;
  7083. }
  7084. codingLine[codingPos] = a1;
  7085. }
  7086. this.codingPos = codingPos;
  7087. }
  7088. _findTableCode(start, end, table, limit) {
  7089. const limitValue = limit || 0;
  7090. for (let i = start; i <= end; ++i) {
  7091. let code = this._lookBits(i);
  7092. if (code === ccittEOF) {
  7093. return [true, 1, false];
  7094. }
  7095. if (i < end) {
  7096. code <<= end - i;
  7097. }
  7098. if (!limitValue || code >= limitValue) {
  7099. const p = table[code - limitValue];
  7100. if (p[0] === i) {
  7101. this._eatBits(i);
  7102. return [true, p[1], true];
  7103. }
  7104. }
  7105. }
  7106. return [false, 0, false];
  7107. }
  7108. _getTwoDimCode() {
  7109. let code = 0;
  7110. let p;
  7111. if (this.eoblock) {
  7112. code = this._lookBits(7);
  7113. p = twoDimTable[code];
  7114. if (p?.[0] > 0) {
  7115. this._eatBits(p[0]);
  7116. return p[1];
  7117. }
  7118. } else {
  7119. const result = this._findTableCode(1, 7, twoDimTable);
  7120. if (result[0] && result[2]) {
  7121. return result[1];
  7122. }
  7123. }
  7124. info("Bad two dim code");
  7125. return ccittEOF;
  7126. }
  7127. _getWhiteCode() {
  7128. let code = 0;
  7129. let p;
  7130. if (this.eoblock) {
  7131. code = this._lookBits(12);
  7132. if (code === ccittEOF) {
  7133. return 1;
  7134. }
  7135. p = code >> 5 === 0 ? whiteTable1[code] : whiteTable2[code >> 3];
  7136. if (p[0] > 0) {
  7137. this._eatBits(p[0]);
  7138. return p[1];
  7139. }
  7140. } else {
  7141. let result = this._findTableCode(1, 9, whiteTable2);
  7142. if (result[0]) {
  7143. return result[1];
  7144. }
  7145. result = this._findTableCode(11, 12, whiteTable1);
  7146. if (result[0]) {
  7147. return result[1];
  7148. }
  7149. }
  7150. info("bad white code");
  7151. this._eatBits(1);
  7152. return 1;
  7153. }
  7154. _getBlackCode() {
  7155. let code, p;
  7156. if (this.eoblock) {
  7157. code = this._lookBits(13);
  7158. if (code === ccittEOF) {
  7159. return 1;
  7160. }
  7161. if (code >> 7 === 0) {
  7162. p = blackTable1[code];
  7163. } else if (code >> 9 === 0 && code >> 7 !== 0) {
  7164. p = blackTable2[(code >> 1) - 64];
  7165. } else {
  7166. p = blackTable3[code >> 7];
  7167. }
  7168. if (p[0] > 0) {
  7169. this._eatBits(p[0]);
  7170. return p[1];
  7171. }
  7172. } else {
  7173. let result = this._findTableCode(2, 6, blackTable3);
  7174. if (result[0]) {
  7175. return result[1];
  7176. }
  7177. result = this._findTableCode(7, 12, blackTable2, 64);
  7178. if (result[0]) {
  7179. return result[1];
  7180. }
  7181. result = this._findTableCode(10, 13, blackTable1);
  7182. if (result[0]) {
  7183. return result[1];
  7184. }
  7185. }
  7186. info("bad black code");
  7187. this._eatBits(1);
  7188. return 1;
  7189. }
  7190. _lookBits(n) {
  7191. let c;
  7192. while (this.inputBits < n) {
  7193. if ((c = this.source.next()) === -1) {
  7194. if (this.inputBits === 0) {
  7195. return ccittEOF;
  7196. }
  7197. return this.inputBuf << n - this.inputBits & 0xffff >> 16 - n;
  7198. }
  7199. this.inputBuf = this.inputBuf << 8 | c;
  7200. this.inputBits += 8;
  7201. }
  7202. return this.inputBuf >> this.inputBits - n & 0xffff >> 16 - n;
  7203. }
  7204. _eatBits(n) {
  7205. if ((this.inputBits -= n) < 0) {
  7206. this.inputBits = 0;
  7207. }
  7208. }
  7209. }
  7210. ;// ./src/core/ccitt_stream.js
  7211. class CCITTFaxStream extends DecodeStream {
  7212. constructor(str, maybeLength, params) {
  7213. super(maybeLength);
  7214. this.str = str;
  7215. this.dict = str.dict;
  7216. if (!(params instanceof Dict)) {
  7217. params = Dict.empty;
  7218. }
  7219. const source = {
  7220. next() {
  7221. return str.getByte();
  7222. }
  7223. };
  7224. this.ccittFaxDecoder = new CCITTFaxDecoder(source, {
  7225. K: params.get("K"),
  7226. EndOfLine: params.get("EndOfLine"),
  7227. EncodedByteAlign: params.get("EncodedByteAlign"),
  7228. Columns: params.get("Columns"),
  7229. Rows: params.get("Rows"),
  7230. EndOfBlock: params.get("EndOfBlock"),
  7231. BlackIs1: params.get("BlackIs1")
  7232. });
  7233. }
  7234. readBlock() {
  7235. while (!this.eof) {
  7236. const c = this.ccittFaxDecoder.readNextChar();
  7237. if (c === -1) {
  7238. this.eof = true;
  7239. return;
  7240. }
  7241. this.ensureBuffer(this.bufferLength + 1);
  7242. this.buffer[this.bufferLength++] = c;
  7243. }
  7244. }
  7245. }
  7246. ;// ./src/core/flate_stream.js
  7247. const codeLenCodeMap = new Int32Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);
  7248. const lengthDecode = new Int32Array([0x00003, 0x00004, 0x00005, 0x00006, 0x00007, 0x00008, 0x00009, 0x0000a, 0x1000b, 0x1000d, 0x1000f, 0x10011, 0x20013, 0x20017, 0x2001b, 0x2001f, 0x30023, 0x3002b, 0x30033, 0x3003b, 0x40043, 0x40053, 0x40063, 0x40073, 0x50083, 0x500a3, 0x500c3, 0x500e3, 0x00102, 0x00102, 0x00102]);
  7249. const distDecode = new Int32Array([0x00001, 0x00002, 0x00003, 0x00004, 0x10005, 0x10007, 0x20009, 0x2000d, 0x30011, 0x30019, 0x40021, 0x40031, 0x50041, 0x50061, 0x60081, 0x600c1, 0x70101, 0x70181, 0x80201, 0x80301, 0x90401, 0x90601, 0xa0801, 0xa0c01, 0xb1001, 0xb1801, 0xc2001, 0xc3001, 0xd4001, 0xd6001]);
  7250. const fixedLitCodeTab = [new Int32Array([0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c0, 0x70108, 0x80060, 0x80020, 0x900a0, 0x80000, 0x80080, 0x80040, 0x900e0, 0x70104, 0x80058, 0x80018, 0x90090, 0x70114, 0x80078, 0x80038, 0x900d0, 0x7010c, 0x80068, 0x80028, 0x900b0, 0x80008, 0x80088, 0x80048, 0x900f0, 0x70102, 0x80054, 0x80014, 0x8011c, 0x70112, 0x80074, 0x80034, 0x900c8, 0x7010a, 0x80064, 0x80024, 0x900a8, 0x80004, 0x80084, 0x80044, 0x900e8, 0x70106, 0x8005c, 0x8001c, 0x90098, 0x70116, 0x8007c, 0x8003c, 0x900d8, 0x7010e, 0x8006c, 0x8002c, 0x900b8, 0x8000c, 0x8008c, 0x8004c, 0x900f8, 0x70101, 0x80052, 0x80012, 0x8011a, 0x70111, 0x80072, 0x80032, 0x900c4, 0x70109, 0x80062, 0x80022, 0x900a4, 0x80002, 0x80082, 0x80042, 0x900e4, 0x70105, 0x8005a, 0x8001a, 0x90094, 0x70115, 0x8007a, 0x8003a, 0x900d4, 0x7010d, 0x8006a, 0x8002a, 0x900b4, 0x8000a, 0x8008a, 0x8004a, 0x900f4, 0x70103, 0x80056, 0x80016, 0x8011e, 0x70113, 0x80076, 0x80036, 0x900cc, 0x7010b, 0x80066, 0x80026, 0x900ac, 0x80006, 0x80086, 0x80046, 0x900ec, 0x70107, 0x8005e, 0x8001e, 0x9009c, 0x70117, 0x8007e, 0x8003e, 0x900dc, 0x7010f, 0x8006e, 0x8002e, 0x900bc, 0x8000e, 0x8008e, 0x8004e, 0x900fc, 0x70100, 0x80051, 0x80011, 0x80119, 0x70110, 0x80071, 0x80031, 0x900c2, 0x70108, 0x80061, 0x80021, 0x900a2, 0x80001, 0x80081, 0x80041, 0x900e2, 0x70104, 0x80059, 0x80019, 0x90092, 0x70114, 0x80079, 0x80039, 0x900d2, 0x7010c, 0x80069, 0x80029, 0x900b2, 0x80009, 0x80089, 0x80049, 0x900f2, 0x70102, 0x80055, 0x80015, 0x8011d, 0x70112, 0x80075, 0x80035, 0x900ca, 0x7010a, 0x80065, 0x80025, 0x900aa, 0x80005, 0x80085, 0x80045, 0x900ea, 0x70106, 0x8005d, 0x8001d, 0x9009a, 0x70116, 0x8007d, 0x8003d, 0x900da, 0x7010e, 0x8006d, 0x8002d, 0x900ba, 0x8000d, 0x8008d, 0x8004d, 0x900fa, 0x70101, 0x80053, 0x80013, 0x8011b, 0x70111, 0x80073, 0x80033, 0x900c6, 0x70109, 0x80063, 0x80023, 0x900a6, 0x80003, 0x80083, 0x80043, 0x900e6, 0x70105, 0x8005b, 0x8001b, 0x90096, 0x70115, 0x8007b, 0x8003b, 0x900d6, 0x7010d, 0x8006b, 0x8002b, 0x900b6, 0x8000b, 0x8008b, 0x8004b, 0x900f6, 0x70103, 0x80057, 0x80017, 0x8011f, 0x70113, 0x80077, 0x80037, 0x900ce, 0x7010b, 0x80067, 0x80027, 0x900ae, 0x80007, 0x80087, 0x80047, 0x900ee, 0x70107, 0x8005f, 0x8001f, 0x9009e, 0x70117, 0x8007f, 0x8003f, 0x900de, 0x7010f, 0x8006f, 0x8002f, 0x900be, 0x8000f, 0x8008f, 0x8004f, 0x900fe, 0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c1, 0x70108, 0x80060, 0x80020, 0x900a1, 0x80000, 0x80080, 0x80040, 0x900e1, 0x70104, 0x80058, 0x80018, 0x90091, 0x70114, 0x80078, 0x80038, 0x900d1, 0x7010c, 0x80068, 0x80028, 0x900b1, 0x80008, 0x80088, 0x80048, 0x900f1, 0x70102, 0x80054, 0x80014, 0x8011c, 0x70112, 0x80074, 0x80034, 0x900c9, 0x7010a, 0x80064, 0x80024, 0x900a9, 0x80004, 0x80084, 0x80044, 0x900e9, 0x70106, 0x8005c, 0x8001c, 0x90099, 0x70116, 0x8007c, 0x8003c, 0x900d9, 0x7010e, 0x8006c, 0x8002c, 0x900b9, 0x8000c, 0x8008c, 0x8004c, 0x900f9, 0x70101, 0x80052, 0x80012, 0x8011a, 0x70111, 0x80072, 0x80032, 0x900c5, 0x70109, 0x80062, 0x80022, 0x900a5, 0x80002, 0x80082, 0x80042, 0x900e5, 0x70105, 0x8005a, 0x8001a, 0x90095, 0x70115, 0x8007a, 0x8003a, 0x900d5, 0x7010d, 0x8006a, 0x8002a, 0x900b5, 0x8000a, 0x8008a, 0x8004a, 0x900f5, 0x70103, 0x80056, 0x80016, 0x8011e, 0x70113, 0x80076, 0x80036, 0x900cd, 0x7010b, 0x80066, 0x80026, 0x900ad, 0x80006, 0x80086, 0x80046, 0x900ed, 0x70107, 0x8005e, 0x8001e, 0x9009d, 0x70117, 0x8007e, 0x8003e, 0x900dd, 0x7010f, 0x8006e, 0x8002e, 0x900bd, 0x8000e, 0x8008e, 0x8004e, 0x900fd, 0x70100, 0x80051, 0x80011, 0x80119, 0x70110, 0x80071, 0x80031, 0x900c3, 0x70108, 0x80061, 0x80021, 0x900a3, 0x80001, 0x80081, 0x80041, 0x900e3, 0x70104, 0x80059, 0x80019, 0x90093, 0x70114, 0x80079, 0x80039, 0x900d3, 0x7010c, 0x80069, 0x80029, 0x900b3, 0x80009, 0x80089, 0x80049, 0x900f3, 0x70102, 0x80055, 0x80015, 0x8011d, 0x70112, 0x80075, 0x80035, 0x900cb, 0x7010a, 0x80065, 0x80025, 0x900ab, 0x80005, 0x80085, 0x80045, 0x900eb, 0x70106, 0x8005d, 0x8001d, 0x9009b, 0x70116, 0x8007d, 0x8003d, 0x900db, 0x7010e, 0x8006d, 0x8002d, 0x900bb, 0x8000d, 0x8008d, 0x8004d, 0x900fb, 0x70101, 0x80053, 0x80013, 0x8011b, 0x70111, 0x80073, 0x80033, 0x900c7, 0x70109, 0x80063, 0x80023, 0x900a7, 0x80003, 0x80083, 0x80043, 0x900e7, 0x70105, 0x8005b, 0x8001b, 0x90097, 0x70115, 0x8007b, 0x8003b, 0x900d7, 0x7010d, 0x8006b, 0x8002b, 0x900b7, 0x8000b, 0x8008b, 0x8004b, 0x900f7, 0x70103, 0x80057, 0x80017, 0x8011f, 0x70113, 0x80077, 0x80037, 0x900cf, 0x7010b, 0x80067, 0x80027, 0x900af, 0x80007, 0x80087, 0x80047, 0x900ef, 0x70107, 0x8005f, 0x8001f, 0x9009f, 0x70117, 0x8007f, 0x8003f, 0x900df, 0x7010f, 0x8006f, 0x8002f, 0x900bf, 0x8000f, 0x8008f, 0x8004f, 0x900ff]), 9];
  7251. const fixedDistCodeTab = [new Int32Array([0x50000, 0x50010, 0x50008, 0x50018, 0x50004, 0x50014, 0x5000c, 0x5001c, 0x50002, 0x50012, 0x5000a, 0x5001a, 0x50006, 0x50016, 0x5000e, 0x00000, 0x50001, 0x50011, 0x50009, 0x50019, 0x50005, 0x50015, 0x5000d, 0x5001d, 0x50003, 0x50013, 0x5000b, 0x5001b, 0x50007, 0x50017, 0x5000f, 0x00000]), 5];
  7252. class FlateStream extends DecodeStream {
  7253. constructor(str, maybeLength) {
  7254. super(maybeLength);
  7255. this.str = str;
  7256. this.dict = str.dict;
  7257. const cmf = str.getByte();
  7258. const flg = str.getByte();
  7259. if (cmf === -1 || flg === -1) {
  7260. throw new FormatError(`Invalid header in flate stream: ${cmf}, ${flg}`);
  7261. }
  7262. if ((cmf & 0x0f) !== 0x08) {
  7263. throw new FormatError(`Unknown compression method in flate stream: ${cmf}, ${flg}`);
  7264. }
  7265. if (((cmf << 8) + flg) % 31 !== 0) {
  7266. throw new FormatError(`Bad FCHECK in flate stream: ${cmf}, ${flg}`);
  7267. }
  7268. if (flg & 0x20) {
  7269. throw new FormatError(`FDICT bit set in flate stream: ${cmf}, ${flg}`);
  7270. }
  7271. this.codeSize = 0;
  7272. this.codeBuf = 0;
  7273. }
  7274. async getImageData(length, _decoderOptions) {
  7275. const data = await this.asyncGetBytes();
  7276. return data?.subarray(0, length) || this.getBytes(length);
  7277. }
  7278. async asyncGetBytes() {
  7279. this.str.reset();
  7280. const bytes = this.str.getBytes();
  7281. try {
  7282. const {
  7283. readable,
  7284. writable
  7285. } = new DecompressionStream("deflate");
  7286. const writer = writable.getWriter();
  7287. writer.write(bytes);
  7288. writer.close();
  7289. const chunks = [];
  7290. let totalLength = 0;
  7291. for await (const chunk of readable) {
  7292. chunks.push(chunk);
  7293. totalLength += chunk.byteLength;
  7294. }
  7295. const data = new Uint8Array(totalLength);
  7296. let offset = 0;
  7297. for (const chunk of chunks) {
  7298. data.set(chunk, offset);
  7299. offset += chunk.byteLength;
  7300. }
  7301. return data;
  7302. } catch {
  7303. this.str = new Stream(bytes, 2, bytes.length, this.str.dict);
  7304. this.reset();
  7305. return null;
  7306. }
  7307. }
  7308. get isAsync() {
  7309. return true;
  7310. }
  7311. getBits(bits) {
  7312. const str = this.str;
  7313. let codeSize = this.codeSize;
  7314. let codeBuf = this.codeBuf;
  7315. let b;
  7316. while (codeSize < bits) {
  7317. if ((b = str.getByte()) === -1) {
  7318. throw new FormatError("Bad encoding in flate stream");
  7319. }
  7320. codeBuf |= b << codeSize;
  7321. codeSize += 8;
  7322. }
  7323. b = codeBuf & (1 << bits) - 1;
  7324. this.codeBuf = codeBuf >> bits;
  7325. this.codeSize = codeSize -= bits;
  7326. return b;
  7327. }
  7328. getCode(table) {
  7329. const str = this.str;
  7330. const codes = table[0];
  7331. const maxLen = table[1];
  7332. let codeSize = this.codeSize;
  7333. let codeBuf = this.codeBuf;
  7334. let b;
  7335. while (codeSize < maxLen) {
  7336. if ((b = str.getByte()) === -1) {
  7337. break;
  7338. }
  7339. codeBuf |= b << codeSize;
  7340. codeSize += 8;
  7341. }
  7342. const code = codes[codeBuf & (1 << maxLen) - 1];
  7343. const codeLen = code >> 16;
  7344. const codeVal = code & 0xffff;
  7345. if (codeLen < 1 || codeSize < codeLen) {
  7346. throw new FormatError("Bad encoding in flate stream");
  7347. }
  7348. this.codeBuf = codeBuf >> codeLen;
  7349. this.codeSize = codeSize - codeLen;
  7350. return codeVal;
  7351. }
  7352. generateHuffmanTable(lengths) {
  7353. const n = lengths.length;
  7354. let maxLen = 0;
  7355. let i;
  7356. for (i = 0; i < n; ++i) {
  7357. if (lengths[i] > maxLen) {
  7358. maxLen = lengths[i];
  7359. }
  7360. }
  7361. const size = 1 << maxLen;
  7362. const codes = new Int32Array(size);
  7363. for (let len = 1, code = 0, skip = 2; len <= maxLen; ++len, code <<= 1, skip <<= 1) {
  7364. for (let val = 0; val < n; ++val) {
  7365. if (lengths[val] === len) {
  7366. let code2 = 0;
  7367. let t = code;
  7368. for (i = 0; i < len; ++i) {
  7369. code2 = code2 << 1 | t & 1;
  7370. t >>= 1;
  7371. }
  7372. for (i = code2; i < size; i += skip) {
  7373. codes[i] = len << 16 | val;
  7374. }
  7375. ++code;
  7376. }
  7377. }
  7378. }
  7379. return [codes, maxLen];
  7380. }
  7381. #endsStreamOnError(err) {
  7382. info(err);
  7383. this.eof = true;
  7384. }
  7385. readBlock() {
  7386. let buffer, hdr, len;
  7387. const str = this.str;
  7388. try {
  7389. hdr = this.getBits(3);
  7390. } catch (ex) {
  7391. this.#endsStreamOnError(ex.message);
  7392. return;
  7393. }
  7394. if (hdr & 1) {
  7395. this.eof = true;
  7396. }
  7397. hdr >>= 1;
  7398. if (hdr === 0) {
  7399. let b;
  7400. if ((b = str.getByte()) === -1) {
  7401. this.#endsStreamOnError("Bad block header in flate stream");
  7402. return;
  7403. }
  7404. let blockLen = b;
  7405. if ((b = str.getByte()) === -1) {
  7406. this.#endsStreamOnError("Bad block header in flate stream");
  7407. return;
  7408. }
  7409. blockLen |= b << 8;
  7410. if ((b = str.getByte()) === -1) {
  7411. this.#endsStreamOnError("Bad block header in flate stream");
  7412. return;
  7413. }
  7414. let check = b;
  7415. if ((b = str.getByte()) === -1) {
  7416. this.#endsStreamOnError("Bad block header in flate stream");
  7417. return;
  7418. }
  7419. check |= b << 8;
  7420. if (check !== (~blockLen & 0xffff) && (blockLen !== 0 || check !== 0)) {
  7421. throw new FormatError("Bad uncompressed block length in flate stream");
  7422. }
  7423. this.codeBuf = 0;
  7424. this.codeSize = 0;
  7425. const bufferLength = this.bufferLength,
  7426. end = bufferLength + blockLen;
  7427. buffer = this.ensureBuffer(end);
  7428. this.bufferLength = end;
  7429. if (blockLen === 0) {
  7430. if (str.peekByte() === -1) {
  7431. this.eof = true;
  7432. }
  7433. } else {
  7434. const block = str.getBytes(blockLen);
  7435. buffer.set(block, bufferLength);
  7436. if (block.length < blockLen) {
  7437. this.eof = true;
  7438. }
  7439. }
  7440. return;
  7441. }
  7442. let litCodeTable;
  7443. let distCodeTable;
  7444. if (hdr === 1) {
  7445. litCodeTable = fixedLitCodeTab;
  7446. distCodeTable = fixedDistCodeTab;
  7447. } else if (hdr === 2) {
  7448. const numLitCodes = this.getBits(5) + 257;
  7449. const numDistCodes = this.getBits(5) + 1;
  7450. const numCodeLenCodes = this.getBits(4) + 4;
  7451. const codeLenCodeLengths = new Uint8Array(codeLenCodeMap.length);
  7452. let i;
  7453. for (i = 0; i < numCodeLenCodes; ++i) {
  7454. codeLenCodeLengths[codeLenCodeMap[i]] = this.getBits(3);
  7455. }
  7456. const codeLenCodeTab = this.generateHuffmanTable(codeLenCodeLengths);
  7457. len = 0;
  7458. i = 0;
  7459. const codes = numLitCodes + numDistCodes;
  7460. const codeLengths = new Uint8Array(codes);
  7461. let bitsLength, bitsOffset, what;
  7462. while (i < codes) {
  7463. const code = this.getCode(codeLenCodeTab);
  7464. if (code === 16) {
  7465. bitsLength = 2;
  7466. bitsOffset = 3;
  7467. what = len;
  7468. } else if (code === 17) {
  7469. bitsLength = 3;
  7470. bitsOffset = 3;
  7471. what = len = 0;
  7472. } else if (code === 18) {
  7473. bitsLength = 7;
  7474. bitsOffset = 11;
  7475. what = len = 0;
  7476. } else {
  7477. codeLengths[i++] = len = code;
  7478. continue;
  7479. }
  7480. let repeatLength = this.getBits(bitsLength) + bitsOffset;
  7481. while (repeatLength-- > 0) {
  7482. codeLengths[i++] = what;
  7483. }
  7484. }
  7485. litCodeTable = this.generateHuffmanTable(codeLengths.subarray(0, numLitCodes));
  7486. distCodeTable = this.generateHuffmanTable(codeLengths.subarray(numLitCodes, codes));
  7487. } else {
  7488. throw new FormatError("Unknown block type in flate stream");
  7489. }
  7490. buffer = this.buffer;
  7491. let limit = buffer ? buffer.length : 0;
  7492. let pos = this.bufferLength;
  7493. while (true) {
  7494. let code1 = this.getCode(litCodeTable);
  7495. if (code1 < 256) {
  7496. if (pos + 1 >= limit) {
  7497. buffer = this.ensureBuffer(pos + 1);
  7498. limit = buffer.length;
  7499. }
  7500. buffer[pos++] = code1;
  7501. continue;
  7502. }
  7503. if (code1 === 256) {
  7504. this.bufferLength = pos;
  7505. return;
  7506. }
  7507. code1 -= 257;
  7508. code1 = lengthDecode[code1];
  7509. let code2 = code1 >> 16;
  7510. if (code2 > 0) {
  7511. code2 = this.getBits(code2);
  7512. }
  7513. len = (code1 & 0xffff) + code2;
  7514. code1 = this.getCode(distCodeTable);
  7515. code1 = distDecode[code1];
  7516. code2 = code1 >> 16;
  7517. if (code2 > 0) {
  7518. code2 = this.getBits(code2);
  7519. }
  7520. const dist = (code1 & 0xffff) + code2;
  7521. if (pos + len >= limit) {
  7522. buffer = this.ensureBuffer(pos + len);
  7523. limit = buffer.length;
  7524. }
  7525. for (let k = 0; k < len; ++k, ++pos) {
  7526. buffer[pos] = buffer[pos - dist];
  7527. }
  7528. }
  7529. }
  7530. }
  7531. ;// ./src/core/arithmetic_decoder.js
  7532. const QeTable = [{
  7533. qe: 0x5601,
  7534. nmps: 1,
  7535. nlps: 1,
  7536. switchFlag: 1
  7537. }, {
  7538. qe: 0x3401,
  7539. nmps: 2,
  7540. nlps: 6,
  7541. switchFlag: 0
  7542. }, {
  7543. qe: 0x1801,
  7544. nmps: 3,
  7545. nlps: 9,
  7546. switchFlag: 0
  7547. }, {
  7548. qe: 0x0ac1,
  7549. nmps: 4,
  7550. nlps: 12,
  7551. switchFlag: 0
  7552. }, {
  7553. qe: 0x0521,
  7554. nmps: 5,
  7555. nlps: 29,
  7556. switchFlag: 0
  7557. }, {
  7558. qe: 0x0221,
  7559. nmps: 38,
  7560. nlps: 33,
  7561. switchFlag: 0
  7562. }, {
  7563. qe: 0x5601,
  7564. nmps: 7,
  7565. nlps: 6,
  7566. switchFlag: 1
  7567. }, {
  7568. qe: 0x5401,
  7569. nmps: 8,
  7570. nlps: 14,
  7571. switchFlag: 0
  7572. }, {
  7573. qe: 0x4801,
  7574. nmps: 9,
  7575. nlps: 14,
  7576. switchFlag: 0
  7577. }, {
  7578. qe: 0x3801,
  7579. nmps: 10,
  7580. nlps: 14,
  7581. switchFlag: 0
  7582. }, {
  7583. qe: 0x3001,
  7584. nmps: 11,
  7585. nlps: 17,
  7586. switchFlag: 0
  7587. }, {
  7588. qe: 0x2401,
  7589. nmps: 12,
  7590. nlps: 18,
  7591. switchFlag: 0
  7592. }, {
  7593. qe: 0x1c01,
  7594. nmps: 13,
  7595. nlps: 20,
  7596. switchFlag: 0
  7597. }, {
  7598. qe: 0x1601,
  7599. nmps: 29,
  7600. nlps: 21,
  7601. switchFlag: 0
  7602. }, {
  7603. qe: 0x5601,
  7604. nmps: 15,
  7605. nlps: 14,
  7606. switchFlag: 1
  7607. }, {
  7608. qe: 0x5401,
  7609. nmps: 16,
  7610. nlps: 14,
  7611. switchFlag: 0
  7612. }, {
  7613. qe: 0x5101,
  7614. nmps: 17,
  7615. nlps: 15,
  7616. switchFlag: 0
  7617. }, {
  7618. qe: 0x4801,
  7619. nmps: 18,
  7620. nlps: 16,
  7621. switchFlag: 0
  7622. }, {
  7623. qe: 0x3801,
  7624. nmps: 19,
  7625. nlps: 17,
  7626. switchFlag: 0
  7627. }, {
  7628. qe: 0x3401,
  7629. nmps: 20,
  7630. nlps: 18,
  7631. switchFlag: 0
  7632. }, {
  7633. qe: 0x3001,
  7634. nmps: 21,
  7635. nlps: 19,
  7636. switchFlag: 0
  7637. }, {
  7638. qe: 0x2801,
  7639. nmps: 22,
  7640. nlps: 19,
  7641. switchFlag: 0
  7642. }, {
  7643. qe: 0x2401,
  7644. nmps: 23,
  7645. nlps: 20,
  7646. switchFlag: 0
  7647. }, {
  7648. qe: 0x2201,
  7649. nmps: 24,
  7650. nlps: 21,
  7651. switchFlag: 0
  7652. }, {
  7653. qe: 0x1c01,
  7654. nmps: 25,
  7655. nlps: 22,
  7656. switchFlag: 0
  7657. }, {
  7658. qe: 0x1801,
  7659. nmps: 26,
  7660. nlps: 23,
  7661. switchFlag: 0
  7662. }, {
  7663. qe: 0x1601,
  7664. nmps: 27,
  7665. nlps: 24,
  7666. switchFlag: 0
  7667. }, {
  7668. qe: 0x1401,
  7669. nmps: 28,
  7670. nlps: 25,
  7671. switchFlag: 0
  7672. }, {
  7673. qe: 0x1201,
  7674. nmps: 29,
  7675. nlps: 26,
  7676. switchFlag: 0
  7677. }, {
  7678. qe: 0x1101,
  7679. nmps: 30,
  7680. nlps: 27,
  7681. switchFlag: 0
  7682. }, {
  7683. qe: 0x0ac1,
  7684. nmps: 31,
  7685. nlps: 28,
  7686. switchFlag: 0
  7687. }, {
  7688. qe: 0x09c1,
  7689. nmps: 32,
  7690. nlps: 29,
  7691. switchFlag: 0
  7692. }, {
  7693. qe: 0x08a1,
  7694. nmps: 33,
  7695. nlps: 30,
  7696. switchFlag: 0
  7697. }, {
  7698. qe: 0x0521,
  7699. nmps: 34,
  7700. nlps: 31,
  7701. switchFlag: 0
  7702. }, {
  7703. qe: 0x0441,
  7704. nmps: 35,
  7705. nlps: 32,
  7706. switchFlag: 0
  7707. }, {
  7708. qe: 0x02a1,
  7709. nmps: 36,
  7710. nlps: 33,
  7711. switchFlag: 0
  7712. }, {
  7713. qe: 0x0221,
  7714. nmps: 37,
  7715. nlps: 34,
  7716. switchFlag: 0
  7717. }, {
  7718. qe: 0x0141,
  7719. nmps: 38,
  7720. nlps: 35,
  7721. switchFlag: 0
  7722. }, {
  7723. qe: 0x0111,
  7724. nmps: 39,
  7725. nlps: 36,
  7726. switchFlag: 0
  7727. }, {
  7728. qe: 0x0085,
  7729. nmps: 40,
  7730. nlps: 37,
  7731. switchFlag: 0
  7732. }, {
  7733. qe: 0x0049,
  7734. nmps: 41,
  7735. nlps: 38,
  7736. switchFlag: 0
  7737. }, {
  7738. qe: 0x0025,
  7739. nmps: 42,
  7740. nlps: 39,
  7741. switchFlag: 0
  7742. }, {
  7743. qe: 0x0015,
  7744. nmps: 43,
  7745. nlps: 40,
  7746. switchFlag: 0
  7747. }, {
  7748. qe: 0x0009,
  7749. nmps: 44,
  7750. nlps: 41,
  7751. switchFlag: 0
  7752. }, {
  7753. qe: 0x0005,
  7754. nmps: 45,
  7755. nlps: 42,
  7756. switchFlag: 0
  7757. }, {
  7758. qe: 0x0001,
  7759. nmps: 45,
  7760. nlps: 43,
  7761. switchFlag: 0
  7762. }, {
  7763. qe: 0x5601,
  7764. nmps: 46,
  7765. nlps: 46,
  7766. switchFlag: 0
  7767. }];
  7768. class ArithmeticDecoder {
  7769. constructor(data, start, end) {
  7770. this.data = data;
  7771. this.bp = start;
  7772. this.dataEnd = end;
  7773. this.chigh = data[start];
  7774. this.clow = 0;
  7775. this.byteIn();
  7776. this.chigh = this.chigh << 7 & 0xffff | this.clow >> 9 & 0x7f;
  7777. this.clow = this.clow << 7 & 0xffff;
  7778. this.ct -= 7;
  7779. this.a = 0x8000;
  7780. }
  7781. byteIn() {
  7782. const data = this.data;
  7783. let bp = this.bp;
  7784. if (data[bp] === 0xff) {
  7785. if (data[bp + 1] > 0x8f) {
  7786. this.clow += 0xff00;
  7787. this.ct = 8;
  7788. } else {
  7789. bp++;
  7790. this.clow += data[bp] << 9;
  7791. this.ct = 7;
  7792. this.bp = bp;
  7793. }
  7794. } else {
  7795. bp++;
  7796. this.clow += bp < this.dataEnd ? data[bp] << 8 : 0xff00;
  7797. this.ct = 8;
  7798. this.bp = bp;
  7799. }
  7800. if (this.clow > 0xffff) {
  7801. this.chigh += this.clow >> 16;
  7802. this.clow &= 0xffff;
  7803. }
  7804. }
  7805. readBit(contexts, pos) {
  7806. let cx_index = contexts[pos] >> 1,
  7807. cx_mps = contexts[pos] & 1;
  7808. const qeTableIcx = QeTable[cx_index];
  7809. const qeIcx = qeTableIcx.qe;
  7810. let d;
  7811. let a = this.a - qeIcx;
  7812. if (this.chigh < qeIcx) {
  7813. if (a < qeIcx) {
  7814. a = qeIcx;
  7815. d = cx_mps;
  7816. cx_index = qeTableIcx.nmps;
  7817. } else {
  7818. a = qeIcx;
  7819. d = 1 ^ cx_mps;
  7820. if (qeTableIcx.switchFlag === 1) {
  7821. cx_mps = d;
  7822. }
  7823. cx_index = qeTableIcx.nlps;
  7824. }
  7825. } else {
  7826. this.chigh -= qeIcx;
  7827. if ((a & 0x8000) !== 0) {
  7828. this.a = a;
  7829. return cx_mps;
  7830. }
  7831. if (a < qeIcx) {
  7832. d = 1 ^ cx_mps;
  7833. if (qeTableIcx.switchFlag === 1) {
  7834. cx_mps = d;
  7835. }
  7836. cx_index = qeTableIcx.nlps;
  7837. } else {
  7838. d = cx_mps;
  7839. cx_index = qeTableIcx.nmps;
  7840. }
  7841. }
  7842. do {
  7843. if (this.ct === 0) {
  7844. this.byteIn();
  7845. }
  7846. a <<= 1;
  7847. this.chigh = this.chigh << 1 & 0xffff | this.clow >> 15 & 1;
  7848. this.clow = this.clow << 1 & 0xffff;
  7849. this.ct--;
  7850. } while ((a & 0x8000) === 0);
  7851. this.a = a;
  7852. contexts[pos] = cx_index << 1 | cx_mps;
  7853. return d;
  7854. }
  7855. }
  7856. ;// ./src/core/jbig2.js
  7857. class Jbig2Error extends BaseException {
  7858. constructor(msg) {
  7859. super(msg, "Jbig2Error");
  7860. }
  7861. }
  7862. class ContextCache {
  7863. getContexts(id) {
  7864. if (id in this) {
  7865. return this[id];
  7866. }
  7867. return this[id] = new Int8Array(1 << 16);
  7868. }
  7869. }
  7870. class DecodingContext {
  7871. constructor(data, start, end) {
  7872. this.data = data;
  7873. this.start = start;
  7874. this.end = end;
  7875. }
  7876. get decoder() {
  7877. const decoder = new ArithmeticDecoder(this.data, this.start, this.end);
  7878. return shadow(this, "decoder", decoder);
  7879. }
  7880. get contextCache() {
  7881. const cache = new ContextCache();
  7882. return shadow(this, "contextCache", cache);
  7883. }
  7884. }
  7885. const MAX_INT_32 = 2 ** 31 - 1;
  7886. const MIN_INT_32 = -(2 ** 31);
  7887. function decodeInteger(contextCache, procedure, decoder) {
  7888. const contexts = contextCache.getContexts(procedure);
  7889. let prev = 1;
  7890. function readBits(length) {
  7891. let v = 0;
  7892. for (let i = 0; i < length; i++) {
  7893. const bit = decoder.readBit(contexts, prev);
  7894. prev = prev < 256 ? prev << 1 | bit : (prev << 1 | bit) & 511 | 256;
  7895. v = v << 1 | bit;
  7896. }
  7897. return v >>> 0;
  7898. }
  7899. const sign = readBits(1);
  7900. const value = readBits(1) ? readBits(1) ? readBits(1) ? readBits(1) ? readBits(1) ? readBits(32) + 4436 : readBits(12) + 340 : readBits(8) + 84 : readBits(6) + 20 : readBits(4) + 4 : readBits(2);
  7901. let signedValue;
  7902. if (sign === 0) {
  7903. signedValue = value;
  7904. } else if (value > 0) {
  7905. signedValue = -value;
  7906. }
  7907. if (signedValue >= MIN_INT_32 && signedValue <= MAX_INT_32) {
  7908. return signedValue;
  7909. }
  7910. return null;
  7911. }
  7912. function decodeIAID(contextCache, decoder, codeLength) {
  7913. const contexts = contextCache.getContexts("IAID");
  7914. let prev = 1;
  7915. for (let i = 0; i < codeLength; i++) {
  7916. const bit = decoder.readBit(contexts, prev);
  7917. prev = prev << 1 | bit;
  7918. }
  7919. if (codeLength < 31) {
  7920. return prev & (1 << codeLength) - 1;
  7921. }
  7922. return prev & 0x7fffffff;
  7923. }
  7924. const SegmentTypes = ["SymbolDictionary", null, null, null, "IntermediateTextRegion", null, "ImmediateTextRegion", "ImmediateLosslessTextRegion", null, null, null, null, null, null, null, null, "PatternDictionary", null, null, null, "IntermediateHalftoneRegion", null, "ImmediateHalftoneRegion", "ImmediateLosslessHalftoneRegion", null, null, null, null, null, null, null, null, null, null, null, null, "IntermediateGenericRegion", null, "ImmediateGenericRegion", "ImmediateLosslessGenericRegion", "IntermediateGenericRefinementRegion", null, "ImmediateGenericRefinementRegion", "ImmediateLosslessGenericRefinementRegion", null, null, null, null, "PageInformation", "EndOfPage", "EndOfStripe", "EndOfFile", "Profiles", "Tables", null, null, null, null, null, null, null, null, "Extension"];
  7925. const CodingTemplates = [[{
  7926. x: -1,
  7927. y: -2
  7928. }, {
  7929. x: 0,
  7930. y: -2
  7931. }, {
  7932. x: 1,
  7933. y: -2
  7934. }, {
  7935. x: -2,
  7936. y: -1
  7937. }, {
  7938. x: -1,
  7939. y: -1
  7940. }, {
  7941. x: 0,
  7942. y: -1
  7943. }, {
  7944. x: 1,
  7945. y: -1
  7946. }, {
  7947. x: 2,
  7948. y: -1
  7949. }, {
  7950. x: -4,
  7951. y: 0
  7952. }, {
  7953. x: -3,
  7954. y: 0
  7955. }, {
  7956. x: -2,
  7957. y: 0
  7958. }, {
  7959. x: -1,
  7960. y: 0
  7961. }], [{
  7962. x: -1,
  7963. y: -2
  7964. }, {
  7965. x: 0,
  7966. y: -2
  7967. }, {
  7968. x: 1,
  7969. y: -2
  7970. }, {
  7971. x: 2,
  7972. y: -2
  7973. }, {
  7974. x: -2,
  7975. y: -1
  7976. }, {
  7977. x: -1,
  7978. y: -1
  7979. }, {
  7980. x: 0,
  7981. y: -1
  7982. }, {
  7983. x: 1,
  7984. y: -1
  7985. }, {
  7986. x: 2,
  7987. y: -1
  7988. }, {
  7989. x: -3,
  7990. y: 0
  7991. }, {
  7992. x: -2,
  7993. y: 0
  7994. }, {
  7995. x: -1,
  7996. y: 0
  7997. }], [{
  7998. x: -1,
  7999. y: -2
  8000. }, {
  8001. x: 0,
  8002. y: -2
  8003. }, {
  8004. x: 1,
  8005. y: -2
  8006. }, {
  8007. x: -2,
  8008. y: -1
  8009. }, {
  8010. x: -1,
  8011. y: -1
  8012. }, {
  8013. x: 0,
  8014. y: -1
  8015. }, {
  8016. x: 1,
  8017. y: -1
  8018. }, {
  8019. x: -2,
  8020. y: 0
  8021. }, {
  8022. x: -1,
  8023. y: 0
  8024. }], [{
  8025. x: -3,
  8026. y: -1
  8027. }, {
  8028. x: -2,
  8029. y: -1
  8030. }, {
  8031. x: -1,
  8032. y: -1
  8033. }, {
  8034. x: 0,
  8035. y: -1
  8036. }, {
  8037. x: 1,
  8038. y: -1
  8039. }, {
  8040. x: -4,
  8041. y: 0
  8042. }, {
  8043. x: -3,
  8044. y: 0
  8045. }, {
  8046. x: -2,
  8047. y: 0
  8048. }, {
  8049. x: -1,
  8050. y: 0
  8051. }]];
  8052. const RefinementTemplates = [{
  8053. coding: [{
  8054. x: 0,
  8055. y: -1
  8056. }, {
  8057. x: 1,
  8058. y: -1
  8059. }, {
  8060. x: -1,
  8061. y: 0
  8062. }],
  8063. reference: [{
  8064. x: 0,
  8065. y: -1
  8066. }, {
  8067. x: 1,
  8068. y: -1
  8069. }, {
  8070. x: -1,
  8071. y: 0
  8072. }, {
  8073. x: 0,
  8074. y: 0
  8075. }, {
  8076. x: 1,
  8077. y: 0
  8078. }, {
  8079. x: -1,
  8080. y: 1
  8081. }, {
  8082. x: 0,
  8083. y: 1
  8084. }, {
  8085. x: 1,
  8086. y: 1
  8087. }]
  8088. }, {
  8089. coding: [{
  8090. x: -1,
  8091. y: -1
  8092. }, {
  8093. x: 0,
  8094. y: -1
  8095. }, {
  8096. x: 1,
  8097. y: -1
  8098. }, {
  8099. x: -1,
  8100. y: 0
  8101. }],
  8102. reference: [{
  8103. x: 0,
  8104. y: -1
  8105. }, {
  8106. x: -1,
  8107. y: 0
  8108. }, {
  8109. x: 0,
  8110. y: 0
  8111. }, {
  8112. x: 1,
  8113. y: 0
  8114. }, {
  8115. x: 0,
  8116. y: 1
  8117. }, {
  8118. x: 1,
  8119. y: 1
  8120. }]
  8121. }];
  8122. const ReusedContexts = [0x9b25, 0x0795, 0x00e5, 0x0195];
  8123. const RefinementReusedContexts = [0x0020, 0x0008];
  8124. function decodeBitmapTemplate0(width, height, decodingContext) {
  8125. const decoder = decodingContext.decoder;
  8126. const contexts = decodingContext.contextCache.getContexts("GB");
  8127. const bitmap = [];
  8128. let contextLabel, i, j, pixel, row, row1, row2;
  8129. const OLD_PIXEL_MASK = 0x7bf7;
  8130. for (i = 0; i < height; i++) {
  8131. row = bitmap[i] = new Uint8Array(width);
  8132. row1 = i < 1 ? row : bitmap[i - 1];
  8133. row2 = i < 2 ? row : bitmap[i - 2];
  8134. contextLabel = row2[0] << 13 | row2[1] << 12 | row2[2] << 11 | row1[0] << 7 | row1[1] << 6 | row1[2] << 5 | row1[3] << 4;
  8135. for (j = 0; j < width; j++) {
  8136. row[j] = pixel = decoder.readBit(contexts, contextLabel);
  8137. contextLabel = (contextLabel & OLD_PIXEL_MASK) << 1 | (j + 3 < width ? row2[j + 3] << 11 : 0) | (j + 4 < width ? row1[j + 4] << 4 : 0) | pixel;
  8138. }
  8139. }
  8140. return bitmap;
  8141. }
  8142. function decodeBitmap(mmr, width, height, templateIndex, prediction, skip, at, decodingContext) {
  8143. if (mmr) {
  8144. const input = new Reader(decodingContext.data, decodingContext.start, decodingContext.end);
  8145. return decodeMMRBitmap(input, width, height, false);
  8146. }
  8147. if (templateIndex === 0 && !skip && !prediction && at.length === 4 && at[0].x === 3 && at[0].y === -1 && at[1].x === -3 && at[1].y === -1 && at[2].x === 2 && at[2].y === -2 && at[3].x === -2 && at[3].y === -2) {
  8148. return decodeBitmapTemplate0(width, height, decodingContext);
  8149. }
  8150. const useskip = !!skip;
  8151. const template = CodingTemplates[templateIndex].concat(at);
  8152. template.sort(function (a, b) {
  8153. return a.y - b.y || a.x - b.x;
  8154. });
  8155. const templateLength = template.length;
  8156. const templateX = new Int8Array(templateLength);
  8157. const templateY = new Int8Array(templateLength);
  8158. const changingTemplateEntries = [];
  8159. let reuseMask = 0,
  8160. minX = 0,
  8161. maxX = 0,
  8162. minY = 0;
  8163. let c, k;
  8164. for (k = 0; k < templateLength; k++) {
  8165. templateX[k] = template[k].x;
  8166. templateY[k] = template[k].y;
  8167. minX = Math.min(minX, template[k].x);
  8168. maxX = Math.max(maxX, template[k].x);
  8169. minY = Math.min(minY, template[k].y);
  8170. if (k < templateLength - 1 && template[k].y === template[k + 1].y && template[k].x === template[k + 1].x - 1) {
  8171. reuseMask |= 1 << templateLength - 1 - k;
  8172. } else {
  8173. changingTemplateEntries.push(k);
  8174. }
  8175. }
  8176. const changingEntriesLength = changingTemplateEntries.length;
  8177. const changingTemplateX = new Int8Array(changingEntriesLength);
  8178. const changingTemplateY = new Int8Array(changingEntriesLength);
  8179. const changingTemplateBit = new Uint16Array(changingEntriesLength);
  8180. for (c = 0; c < changingEntriesLength; c++) {
  8181. k = changingTemplateEntries[c];
  8182. changingTemplateX[c] = template[k].x;
  8183. changingTemplateY[c] = template[k].y;
  8184. changingTemplateBit[c] = 1 << templateLength - 1 - k;
  8185. }
  8186. const sbb_left = -minX;
  8187. const sbb_top = -minY;
  8188. const sbb_right = width - maxX;
  8189. const pseudoPixelContext = ReusedContexts[templateIndex];
  8190. let row = new Uint8Array(width);
  8191. const bitmap = [];
  8192. const decoder = decodingContext.decoder;
  8193. const contexts = decodingContext.contextCache.getContexts("GB");
  8194. let ltp = 0,
  8195. j,
  8196. i0,
  8197. j0,
  8198. contextLabel = 0,
  8199. bit,
  8200. shift;
  8201. for (let i = 0; i < height; i++) {
  8202. if (prediction) {
  8203. const sltp = decoder.readBit(contexts, pseudoPixelContext);
  8204. ltp ^= sltp;
  8205. if (ltp) {
  8206. bitmap.push(row);
  8207. continue;
  8208. }
  8209. }
  8210. row = new Uint8Array(row);
  8211. bitmap.push(row);
  8212. for (j = 0; j < width; j++) {
  8213. if (useskip && skip[i][j]) {
  8214. row[j] = 0;
  8215. continue;
  8216. }
  8217. if (j >= sbb_left && j < sbb_right && i >= sbb_top) {
  8218. contextLabel = contextLabel << 1 & reuseMask;
  8219. for (k = 0; k < changingEntriesLength; k++) {
  8220. i0 = i + changingTemplateY[k];
  8221. j0 = j + changingTemplateX[k];
  8222. bit = bitmap[i0][j0];
  8223. if (bit) {
  8224. bit = changingTemplateBit[k];
  8225. contextLabel |= bit;
  8226. }
  8227. }
  8228. } else {
  8229. contextLabel = 0;
  8230. shift = templateLength - 1;
  8231. for (k = 0; k < templateLength; k++, shift--) {
  8232. j0 = j + templateX[k];
  8233. if (j0 >= 0 && j0 < width) {
  8234. i0 = i + templateY[k];
  8235. if (i0 >= 0) {
  8236. bit = bitmap[i0][j0];
  8237. if (bit) {
  8238. contextLabel |= bit << shift;
  8239. }
  8240. }
  8241. }
  8242. }
  8243. }
  8244. const pixel = decoder.readBit(contexts, contextLabel);
  8245. row[j] = pixel;
  8246. }
  8247. }
  8248. return bitmap;
  8249. }
  8250. function decodeRefinement(width, height, templateIndex, referenceBitmap, offsetX, offsetY, prediction, at, decodingContext) {
  8251. let codingTemplate = RefinementTemplates[templateIndex].coding;
  8252. if (templateIndex === 0) {
  8253. codingTemplate = codingTemplate.concat([at[0]]);
  8254. }
  8255. const codingTemplateLength = codingTemplate.length;
  8256. const codingTemplateX = new Int32Array(codingTemplateLength);
  8257. const codingTemplateY = new Int32Array(codingTemplateLength);
  8258. let k;
  8259. for (k = 0; k < codingTemplateLength; k++) {
  8260. codingTemplateX[k] = codingTemplate[k].x;
  8261. codingTemplateY[k] = codingTemplate[k].y;
  8262. }
  8263. let referenceTemplate = RefinementTemplates[templateIndex].reference;
  8264. if (templateIndex === 0) {
  8265. referenceTemplate = referenceTemplate.concat([at[1]]);
  8266. }
  8267. const referenceTemplateLength = referenceTemplate.length;
  8268. const referenceTemplateX = new Int32Array(referenceTemplateLength);
  8269. const referenceTemplateY = new Int32Array(referenceTemplateLength);
  8270. for (k = 0; k < referenceTemplateLength; k++) {
  8271. referenceTemplateX[k] = referenceTemplate[k].x;
  8272. referenceTemplateY[k] = referenceTemplate[k].y;
  8273. }
  8274. const referenceWidth = referenceBitmap[0].length;
  8275. const referenceHeight = referenceBitmap.length;
  8276. const pseudoPixelContext = RefinementReusedContexts[templateIndex];
  8277. const bitmap = [];
  8278. const decoder = decodingContext.decoder;
  8279. const contexts = decodingContext.contextCache.getContexts("GR");
  8280. let ltp = 0;
  8281. for (let i = 0; i < height; i++) {
  8282. if (prediction) {
  8283. const sltp = decoder.readBit(contexts, pseudoPixelContext);
  8284. ltp ^= sltp;
  8285. if (ltp) {
  8286. throw new Jbig2Error("prediction is not supported");
  8287. }
  8288. }
  8289. const row = new Uint8Array(width);
  8290. bitmap.push(row);
  8291. for (let j = 0; j < width; j++) {
  8292. let i0, j0;
  8293. let contextLabel = 0;
  8294. for (k = 0; k < codingTemplateLength; k++) {
  8295. i0 = i + codingTemplateY[k];
  8296. j0 = j + codingTemplateX[k];
  8297. if (i0 < 0 || j0 < 0 || j0 >= width) {
  8298. contextLabel <<= 1;
  8299. } else {
  8300. contextLabel = contextLabel << 1 | bitmap[i0][j0];
  8301. }
  8302. }
  8303. for (k = 0; k < referenceTemplateLength; k++) {
  8304. i0 = i + referenceTemplateY[k] - offsetY;
  8305. j0 = j + referenceTemplateX[k] - offsetX;
  8306. if (i0 < 0 || i0 >= referenceHeight || j0 < 0 || j0 >= referenceWidth) {
  8307. contextLabel <<= 1;
  8308. } else {
  8309. contextLabel = contextLabel << 1 | referenceBitmap[i0][j0];
  8310. }
  8311. }
  8312. const pixel = decoder.readBit(contexts, contextLabel);
  8313. row[j] = pixel;
  8314. }
  8315. }
  8316. return bitmap;
  8317. }
  8318. function decodeSymbolDictionary(huffman, refinement, symbols, numberOfNewSymbols, numberOfExportedSymbols, huffmanTables, templateIndex, at, refinementTemplateIndex, refinementAt, decodingContext, huffmanInput) {
  8319. if (huffman && refinement) {
  8320. throw new Jbig2Error("symbol refinement with Huffman is not supported");
  8321. }
  8322. const newSymbols = [];
  8323. let currentHeight = 0;
  8324. let symbolCodeLength = log2(symbols.length + numberOfNewSymbols);
  8325. const decoder = decodingContext.decoder;
  8326. const contextCache = decodingContext.contextCache;
  8327. let tableB1, symbolWidths;
  8328. if (huffman) {
  8329. tableB1 = getStandardTable(1);
  8330. symbolWidths = [];
  8331. symbolCodeLength = Math.max(symbolCodeLength, 1);
  8332. }
  8333. while (newSymbols.length < numberOfNewSymbols) {
  8334. const deltaHeight = huffman ? huffmanTables.tableDeltaHeight.decode(huffmanInput) : decodeInteger(contextCache, "IADH", decoder);
  8335. currentHeight += deltaHeight;
  8336. let currentWidth = 0,
  8337. totalWidth = 0;
  8338. const firstSymbol = huffman ? symbolWidths.length : 0;
  8339. while (true) {
  8340. const deltaWidth = huffman ? huffmanTables.tableDeltaWidth.decode(huffmanInput) : decodeInteger(contextCache, "IADW", decoder);
  8341. if (deltaWidth === null) {
  8342. break;
  8343. }
  8344. currentWidth += deltaWidth;
  8345. totalWidth += currentWidth;
  8346. let bitmap;
  8347. if (refinement) {
  8348. const numberOfInstances = decodeInteger(contextCache, "IAAI", decoder);
  8349. if (numberOfInstances > 1) {
  8350. bitmap = decodeTextRegion(huffman, refinement, currentWidth, currentHeight, 0, numberOfInstances, 1, symbols.concat(newSymbols), symbolCodeLength, 0, 0, 1, 0, huffmanTables, refinementTemplateIndex, refinementAt, decodingContext, 0, huffmanInput);
  8351. } else {
  8352. const symbolId = decodeIAID(contextCache, decoder, symbolCodeLength);
  8353. const rdx = decodeInteger(contextCache, "IARDX", decoder);
  8354. const rdy = decodeInteger(contextCache, "IARDY", decoder);
  8355. const symbol = symbolId < symbols.length ? symbols[symbolId] : newSymbols[symbolId - symbols.length];
  8356. bitmap = decodeRefinement(currentWidth, currentHeight, refinementTemplateIndex, symbol, rdx, rdy, false, refinementAt, decodingContext);
  8357. }
  8358. newSymbols.push(bitmap);
  8359. } else if (huffman) {
  8360. symbolWidths.push(currentWidth);
  8361. } else {
  8362. bitmap = decodeBitmap(false, currentWidth, currentHeight, templateIndex, false, null, at, decodingContext);
  8363. newSymbols.push(bitmap);
  8364. }
  8365. }
  8366. if (huffman && !refinement) {
  8367. const bitmapSize = huffmanTables.tableBitmapSize.decode(huffmanInput);
  8368. huffmanInput.byteAlign();
  8369. let collectiveBitmap;
  8370. if (bitmapSize === 0) {
  8371. collectiveBitmap = readUncompressedBitmap(huffmanInput, totalWidth, currentHeight);
  8372. } else {
  8373. const originalEnd = huffmanInput.end;
  8374. const bitmapEnd = huffmanInput.position + bitmapSize;
  8375. huffmanInput.end = bitmapEnd;
  8376. collectiveBitmap = decodeMMRBitmap(huffmanInput, totalWidth, currentHeight, false);
  8377. huffmanInput.end = originalEnd;
  8378. huffmanInput.position = bitmapEnd;
  8379. }
  8380. const numberOfSymbolsDecoded = symbolWidths.length;
  8381. if (firstSymbol === numberOfSymbolsDecoded - 1) {
  8382. newSymbols.push(collectiveBitmap);
  8383. } else {
  8384. let i,
  8385. y,
  8386. xMin = 0,
  8387. xMax,
  8388. bitmapWidth,
  8389. symbolBitmap;
  8390. for (i = firstSymbol; i < numberOfSymbolsDecoded; i++) {
  8391. bitmapWidth = symbolWidths[i];
  8392. xMax = xMin + bitmapWidth;
  8393. symbolBitmap = [];
  8394. for (y = 0; y < currentHeight; y++) {
  8395. symbolBitmap.push(collectiveBitmap[y].subarray(xMin, xMax));
  8396. }
  8397. newSymbols.push(symbolBitmap);
  8398. xMin = xMax;
  8399. }
  8400. }
  8401. }
  8402. }
  8403. const exportedSymbols = [],
  8404. flags = [];
  8405. let currentFlag = false,
  8406. i,
  8407. ii;
  8408. const totalSymbolsLength = symbols.length + numberOfNewSymbols;
  8409. while (flags.length < totalSymbolsLength) {
  8410. let runLength = huffman ? tableB1.decode(huffmanInput) : decodeInteger(contextCache, "IAEX", decoder);
  8411. while (runLength--) {
  8412. flags.push(currentFlag);
  8413. }
  8414. currentFlag = !currentFlag;
  8415. }
  8416. for (i = 0, ii = symbols.length; i < ii; i++) {
  8417. if (flags[i]) {
  8418. exportedSymbols.push(symbols[i]);
  8419. }
  8420. }
  8421. for (let j = 0; j < numberOfNewSymbols; i++, j++) {
  8422. if (flags[i]) {
  8423. exportedSymbols.push(newSymbols[j]);
  8424. }
  8425. }
  8426. return exportedSymbols;
  8427. }
  8428. function decodeTextRegion(huffman, refinement, width, height, defaultPixelValue, numberOfSymbolInstances, stripSize, inputSymbols, symbolCodeLength, transposed, dsOffset, referenceCorner, combinationOperator, huffmanTables, refinementTemplateIndex, refinementAt, decodingContext, logStripSize, huffmanInput) {
  8429. if (huffman && refinement) {
  8430. throw new Jbig2Error("refinement with Huffman is not supported");
  8431. }
  8432. const bitmap = [];
  8433. let i, row;
  8434. for (i = 0; i < height; i++) {
  8435. row = new Uint8Array(width);
  8436. if (defaultPixelValue) {
  8437. for (let j = 0; j < width; j++) {
  8438. row[j] = defaultPixelValue;
  8439. }
  8440. }
  8441. bitmap.push(row);
  8442. }
  8443. const decoder = decodingContext.decoder;
  8444. const contextCache = decodingContext.contextCache;
  8445. let stripT = huffman ? -huffmanTables.tableDeltaT.decode(huffmanInput) : -decodeInteger(contextCache, "IADT", decoder);
  8446. let firstS = 0;
  8447. i = 0;
  8448. while (i < numberOfSymbolInstances) {
  8449. const deltaT = huffman ? huffmanTables.tableDeltaT.decode(huffmanInput) : decodeInteger(contextCache, "IADT", decoder);
  8450. stripT += deltaT;
  8451. const deltaFirstS = huffman ? huffmanTables.tableFirstS.decode(huffmanInput) : decodeInteger(contextCache, "IAFS", decoder);
  8452. firstS += deltaFirstS;
  8453. let currentS = firstS;
  8454. do {
  8455. let currentT = 0;
  8456. if (stripSize > 1) {
  8457. currentT = huffman ? huffmanInput.readBits(logStripSize) : decodeInteger(contextCache, "IAIT", decoder);
  8458. }
  8459. const t = stripSize * stripT + currentT;
  8460. const symbolId = huffman ? huffmanTables.symbolIDTable.decode(huffmanInput) : decodeIAID(contextCache, decoder, symbolCodeLength);
  8461. const applyRefinement = refinement && (huffman ? huffmanInput.readBit() : decodeInteger(contextCache, "IARI", decoder));
  8462. let symbolBitmap = inputSymbols[symbolId];
  8463. let symbolWidth = symbolBitmap[0].length;
  8464. let symbolHeight = symbolBitmap.length;
  8465. if (applyRefinement) {
  8466. const rdw = decodeInteger(contextCache, "IARDW", decoder);
  8467. const rdh = decodeInteger(contextCache, "IARDH", decoder);
  8468. const rdx = decodeInteger(contextCache, "IARDX", decoder);
  8469. const rdy = decodeInteger(contextCache, "IARDY", decoder);
  8470. symbolWidth += rdw;
  8471. symbolHeight += rdh;
  8472. symbolBitmap = decodeRefinement(symbolWidth, symbolHeight, refinementTemplateIndex, symbolBitmap, (rdw >> 1) + rdx, (rdh >> 1) + rdy, false, refinementAt, decodingContext);
  8473. }
  8474. let increment = 0;
  8475. if (!transposed) {
  8476. if (referenceCorner > 1) {
  8477. currentS += symbolWidth - 1;
  8478. } else {
  8479. increment = symbolWidth - 1;
  8480. }
  8481. } else if (!(referenceCorner & 1)) {
  8482. currentS += symbolHeight - 1;
  8483. } else {
  8484. increment = symbolHeight - 1;
  8485. }
  8486. const offsetT = t - (referenceCorner & 1 ? 0 : symbolHeight - 1);
  8487. const offsetS = currentS - (referenceCorner & 2 ? symbolWidth - 1 : 0);
  8488. let s2, t2, symbolRow;
  8489. if (transposed) {
  8490. for (s2 = 0; s2 < symbolHeight; s2++) {
  8491. row = bitmap[offsetS + s2];
  8492. if (!row) {
  8493. continue;
  8494. }
  8495. symbolRow = symbolBitmap[s2];
  8496. const maxWidth = Math.min(width - offsetT, symbolWidth);
  8497. switch (combinationOperator) {
  8498. case 0:
  8499. for (t2 = 0; t2 < maxWidth; t2++) {
  8500. row[offsetT + t2] |= symbolRow[t2];
  8501. }
  8502. break;
  8503. case 2:
  8504. for (t2 = 0; t2 < maxWidth; t2++) {
  8505. row[offsetT + t2] ^= symbolRow[t2];
  8506. }
  8507. break;
  8508. default:
  8509. throw new Jbig2Error(`operator ${combinationOperator} is not supported`);
  8510. }
  8511. }
  8512. } else {
  8513. for (t2 = 0; t2 < symbolHeight; t2++) {
  8514. row = bitmap[offsetT + t2];
  8515. if (!row) {
  8516. continue;
  8517. }
  8518. symbolRow = symbolBitmap[t2];
  8519. switch (combinationOperator) {
  8520. case 0:
  8521. for (s2 = 0; s2 < symbolWidth; s2++) {
  8522. row[offsetS + s2] |= symbolRow[s2];
  8523. }
  8524. break;
  8525. case 2:
  8526. for (s2 = 0; s2 < symbolWidth; s2++) {
  8527. row[offsetS + s2] ^= symbolRow[s2];
  8528. }
  8529. break;
  8530. default:
  8531. throw new Jbig2Error(`operator ${combinationOperator} is not supported`);
  8532. }
  8533. }
  8534. }
  8535. i++;
  8536. const deltaS = huffman ? huffmanTables.tableDeltaS.decode(huffmanInput) : decodeInteger(contextCache, "IADS", decoder);
  8537. if (deltaS === null) {
  8538. break;
  8539. }
  8540. currentS += increment + deltaS + dsOffset;
  8541. } while (true);
  8542. }
  8543. return bitmap;
  8544. }
  8545. function decodePatternDictionary(mmr, patternWidth, patternHeight, maxPatternIndex, template, decodingContext) {
  8546. const at = [];
  8547. if (!mmr) {
  8548. at.push({
  8549. x: -patternWidth,
  8550. y: 0
  8551. });
  8552. if (template === 0) {
  8553. at.push({
  8554. x: -3,
  8555. y: -1
  8556. }, {
  8557. x: 2,
  8558. y: -2
  8559. }, {
  8560. x: -2,
  8561. y: -2
  8562. });
  8563. }
  8564. }
  8565. const collectiveWidth = (maxPatternIndex + 1) * patternWidth;
  8566. const collectiveBitmap = decodeBitmap(mmr, collectiveWidth, patternHeight, template, false, null, at, decodingContext);
  8567. const patterns = [];
  8568. for (let i = 0; i <= maxPatternIndex; i++) {
  8569. const patternBitmap = [];
  8570. const xMin = patternWidth * i;
  8571. const xMax = xMin + patternWidth;
  8572. for (let y = 0; y < patternHeight; y++) {
  8573. patternBitmap.push(collectiveBitmap[y].subarray(xMin, xMax));
  8574. }
  8575. patterns.push(patternBitmap);
  8576. }
  8577. return patterns;
  8578. }
  8579. function decodeHalftoneRegion(mmr, patterns, template, regionWidth, regionHeight, defaultPixelValue, enableSkip, combinationOperator, gridWidth, gridHeight, gridOffsetX, gridOffsetY, gridVectorX, gridVectorY, decodingContext) {
  8580. const skip = null;
  8581. if (enableSkip) {
  8582. throw new Jbig2Error("skip is not supported");
  8583. }
  8584. if (combinationOperator !== 0) {
  8585. throw new Jbig2Error(`operator "${combinationOperator}" is not supported in halftone region`);
  8586. }
  8587. const regionBitmap = [];
  8588. let i, j, row;
  8589. for (i = 0; i < regionHeight; i++) {
  8590. row = new Uint8Array(regionWidth);
  8591. if (defaultPixelValue) {
  8592. for (j = 0; j < regionWidth; j++) {
  8593. row[j] = defaultPixelValue;
  8594. }
  8595. }
  8596. regionBitmap.push(row);
  8597. }
  8598. const numberOfPatterns = patterns.length;
  8599. const pattern0 = patterns[0];
  8600. const patternWidth = pattern0[0].length,
  8601. patternHeight = pattern0.length;
  8602. const bitsPerValue = log2(numberOfPatterns);
  8603. const at = [];
  8604. if (!mmr) {
  8605. at.push({
  8606. x: template <= 1 ? 3 : 2,
  8607. y: -1
  8608. });
  8609. if (template === 0) {
  8610. at.push({
  8611. x: -3,
  8612. y: -1
  8613. }, {
  8614. x: 2,
  8615. y: -2
  8616. }, {
  8617. x: -2,
  8618. y: -2
  8619. });
  8620. }
  8621. }
  8622. const grayScaleBitPlanes = [];
  8623. let mmrInput, bitmap;
  8624. if (mmr) {
  8625. mmrInput = new Reader(decodingContext.data, decodingContext.start, decodingContext.end);
  8626. }
  8627. for (i = bitsPerValue - 1; i >= 0; i--) {
  8628. if (mmr) {
  8629. bitmap = decodeMMRBitmap(mmrInput, gridWidth, gridHeight, true);
  8630. } else {
  8631. bitmap = decodeBitmap(false, gridWidth, gridHeight, template, false, skip, at, decodingContext);
  8632. }
  8633. grayScaleBitPlanes[i] = bitmap;
  8634. }
  8635. let mg, ng, bit, patternIndex, patternBitmap, x, y, patternRow, regionRow;
  8636. for (mg = 0; mg < gridHeight; mg++) {
  8637. for (ng = 0; ng < gridWidth; ng++) {
  8638. bit = 0;
  8639. patternIndex = 0;
  8640. for (j = bitsPerValue - 1; j >= 0; j--) {
  8641. bit ^= grayScaleBitPlanes[j][mg][ng];
  8642. patternIndex |= bit << j;
  8643. }
  8644. patternBitmap = patterns[patternIndex];
  8645. x = gridOffsetX + mg * gridVectorY + ng * gridVectorX >> 8;
  8646. y = gridOffsetY + mg * gridVectorX - ng * gridVectorY >> 8;
  8647. if (x >= 0 && x + patternWidth <= regionWidth && y >= 0 && y + patternHeight <= regionHeight) {
  8648. for (i = 0; i < patternHeight; i++) {
  8649. regionRow = regionBitmap[y + i];
  8650. patternRow = patternBitmap[i];
  8651. for (j = 0; j < patternWidth; j++) {
  8652. regionRow[x + j] |= patternRow[j];
  8653. }
  8654. }
  8655. } else {
  8656. let regionX, regionY;
  8657. for (i = 0; i < patternHeight; i++) {
  8658. regionY = y + i;
  8659. if (regionY < 0 || regionY >= regionHeight) {
  8660. continue;
  8661. }
  8662. regionRow = regionBitmap[regionY];
  8663. patternRow = patternBitmap[i];
  8664. for (j = 0; j < patternWidth; j++) {
  8665. regionX = x + j;
  8666. if (regionX >= 0 && regionX < regionWidth) {
  8667. regionRow[regionX] |= patternRow[j];
  8668. }
  8669. }
  8670. }
  8671. }
  8672. }
  8673. }
  8674. return regionBitmap;
  8675. }
  8676. function readSegmentHeader(data, start) {
  8677. const segmentHeader = {};
  8678. segmentHeader.number = readUint32(data, start);
  8679. const flags = data[start + 4];
  8680. const segmentType = flags & 0x3f;
  8681. if (!SegmentTypes[segmentType]) {
  8682. throw new Jbig2Error("invalid segment type: " + segmentType);
  8683. }
  8684. segmentHeader.type = segmentType;
  8685. segmentHeader.typeName = SegmentTypes[segmentType];
  8686. segmentHeader.deferredNonRetain = !!(flags & 0x80);
  8687. const pageAssociationFieldSize = !!(flags & 0x40);
  8688. const referredFlags = data[start + 5];
  8689. let referredToCount = referredFlags >> 5 & 7;
  8690. const retainBits = [referredFlags & 31];
  8691. let position = start + 6;
  8692. if (referredFlags === 7) {
  8693. referredToCount = readUint32(data, position - 1) & 0x1fffffff;
  8694. position += 3;
  8695. let bytes = referredToCount + 7 >> 3;
  8696. retainBits[0] = data[position++];
  8697. while (--bytes > 0) {
  8698. retainBits.push(data[position++]);
  8699. }
  8700. } else if (referredFlags === 5 || referredFlags === 6) {
  8701. throw new Jbig2Error("invalid referred-to flags");
  8702. }
  8703. segmentHeader.retainBits = retainBits;
  8704. let referredToSegmentNumberSize = 4;
  8705. if (segmentHeader.number <= 256) {
  8706. referredToSegmentNumberSize = 1;
  8707. } else if (segmentHeader.number <= 65536) {
  8708. referredToSegmentNumberSize = 2;
  8709. }
  8710. const referredTo = [];
  8711. let i, ii;
  8712. for (i = 0; i < referredToCount; i++) {
  8713. let number;
  8714. if (referredToSegmentNumberSize === 1) {
  8715. number = data[position];
  8716. } else if (referredToSegmentNumberSize === 2) {
  8717. number = readUint16(data, position);
  8718. } else {
  8719. number = readUint32(data, position);
  8720. }
  8721. referredTo.push(number);
  8722. position += referredToSegmentNumberSize;
  8723. }
  8724. segmentHeader.referredTo = referredTo;
  8725. if (!pageAssociationFieldSize) {
  8726. segmentHeader.pageAssociation = data[position++];
  8727. } else {
  8728. segmentHeader.pageAssociation = readUint32(data, position);
  8729. position += 4;
  8730. }
  8731. segmentHeader.length = readUint32(data, position);
  8732. position += 4;
  8733. if (segmentHeader.length === 0xffffffff) {
  8734. if (segmentType === 38) {
  8735. const genericRegionInfo = readRegionSegmentInformation(data, position);
  8736. const genericRegionSegmentFlags = data[position + RegionSegmentInformationFieldLength];
  8737. const genericRegionMmr = !!(genericRegionSegmentFlags & 1);
  8738. const searchPatternLength = 6;
  8739. const searchPattern = new Uint8Array(searchPatternLength);
  8740. if (!genericRegionMmr) {
  8741. searchPattern[0] = 0xff;
  8742. searchPattern[1] = 0xac;
  8743. }
  8744. searchPattern[2] = genericRegionInfo.height >>> 24 & 0xff;
  8745. searchPattern[3] = genericRegionInfo.height >> 16 & 0xff;
  8746. searchPattern[4] = genericRegionInfo.height >> 8 & 0xff;
  8747. searchPattern[5] = genericRegionInfo.height & 0xff;
  8748. for (i = position, ii = data.length; i < ii; i++) {
  8749. let j = 0;
  8750. while (j < searchPatternLength && searchPattern[j] === data[i + j]) {
  8751. j++;
  8752. }
  8753. if (j === searchPatternLength) {
  8754. segmentHeader.length = i + searchPatternLength;
  8755. break;
  8756. }
  8757. }
  8758. if (segmentHeader.length === 0xffffffff) {
  8759. throw new Jbig2Error("segment end was not found");
  8760. }
  8761. } else {
  8762. throw new Jbig2Error("invalid unknown segment length");
  8763. }
  8764. }
  8765. segmentHeader.headerEnd = position;
  8766. return segmentHeader;
  8767. }
  8768. function readSegments(header, data, start, end) {
  8769. const segments = [];
  8770. let position = start;
  8771. while (position < end) {
  8772. const segmentHeader = readSegmentHeader(data, position);
  8773. position = segmentHeader.headerEnd;
  8774. const segment = {
  8775. header: segmentHeader,
  8776. data
  8777. };
  8778. if (!header.randomAccess) {
  8779. segment.start = position;
  8780. position += segmentHeader.length;
  8781. segment.end = position;
  8782. }
  8783. segments.push(segment);
  8784. if (segmentHeader.type === 51) {
  8785. break;
  8786. }
  8787. }
  8788. if (header.randomAccess) {
  8789. for (let i = 0, ii = segments.length; i < ii; i++) {
  8790. segments[i].start = position;
  8791. position += segments[i].header.length;
  8792. segments[i].end = position;
  8793. }
  8794. }
  8795. return segments;
  8796. }
  8797. function readRegionSegmentInformation(data, start) {
  8798. return {
  8799. width: readUint32(data, start),
  8800. height: readUint32(data, start + 4),
  8801. x: readUint32(data, start + 8),
  8802. y: readUint32(data, start + 12),
  8803. combinationOperator: data[start + 16] & 7
  8804. };
  8805. }
  8806. const RegionSegmentInformationFieldLength = 17;
  8807. function processSegment(segment, visitor) {
  8808. const header = segment.header;
  8809. const data = segment.data,
  8810. end = segment.end;
  8811. let position = segment.start;
  8812. let args, at, i, atLength;
  8813. switch (header.type) {
  8814. case 0:
  8815. const dictionary = {};
  8816. const dictionaryFlags = readUint16(data, position);
  8817. dictionary.huffman = !!(dictionaryFlags & 1);
  8818. dictionary.refinement = !!(dictionaryFlags & 2);
  8819. dictionary.huffmanDHSelector = dictionaryFlags >> 2 & 3;
  8820. dictionary.huffmanDWSelector = dictionaryFlags >> 4 & 3;
  8821. dictionary.bitmapSizeSelector = dictionaryFlags >> 6 & 1;
  8822. dictionary.aggregationInstancesSelector = dictionaryFlags >> 7 & 1;
  8823. dictionary.bitmapCodingContextUsed = !!(dictionaryFlags & 256);
  8824. dictionary.bitmapCodingContextRetained = !!(dictionaryFlags & 512);
  8825. dictionary.template = dictionaryFlags >> 10 & 3;
  8826. dictionary.refinementTemplate = dictionaryFlags >> 12 & 1;
  8827. position += 2;
  8828. if (!dictionary.huffman) {
  8829. atLength = dictionary.template === 0 ? 4 : 1;
  8830. at = [];
  8831. for (i = 0; i < atLength; i++) {
  8832. at.push({
  8833. x: readInt8(data, position),
  8834. y: readInt8(data, position + 1)
  8835. });
  8836. position += 2;
  8837. }
  8838. dictionary.at = at;
  8839. }
  8840. if (dictionary.refinement && !dictionary.refinementTemplate) {
  8841. at = [];
  8842. for (i = 0; i < 2; i++) {
  8843. at.push({
  8844. x: readInt8(data, position),
  8845. y: readInt8(data, position + 1)
  8846. });
  8847. position += 2;
  8848. }
  8849. dictionary.refinementAt = at;
  8850. }
  8851. dictionary.numberOfExportedSymbols = readUint32(data, position);
  8852. position += 4;
  8853. dictionary.numberOfNewSymbols = readUint32(data, position);
  8854. position += 4;
  8855. args = [dictionary, header.number, header.referredTo, data, position, end];
  8856. break;
  8857. case 6:
  8858. case 7:
  8859. const textRegion = {};
  8860. textRegion.info = readRegionSegmentInformation(data, position);
  8861. position += RegionSegmentInformationFieldLength;
  8862. const textRegionSegmentFlags = readUint16(data, position);
  8863. position += 2;
  8864. textRegion.huffman = !!(textRegionSegmentFlags & 1);
  8865. textRegion.refinement = !!(textRegionSegmentFlags & 2);
  8866. textRegion.logStripSize = textRegionSegmentFlags >> 2 & 3;
  8867. textRegion.stripSize = 1 << textRegion.logStripSize;
  8868. textRegion.referenceCorner = textRegionSegmentFlags >> 4 & 3;
  8869. textRegion.transposed = !!(textRegionSegmentFlags & 64);
  8870. textRegion.combinationOperator = textRegionSegmentFlags >> 7 & 3;
  8871. textRegion.defaultPixelValue = textRegionSegmentFlags >> 9 & 1;
  8872. textRegion.dsOffset = textRegionSegmentFlags << 17 >> 27;
  8873. textRegion.refinementTemplate = textRegionSegmentFlags >> 15 & 1;
  8874. if (textRegion.huffman) {
  8875. const textRegionHuffmanFlags = readUint16(data, position);
  8876. position += 2;
  8877. textRegion.huffmanFS = textRegionHuffmanFlags & 3;
  8878. textRegion.huffmanDS = textRegionHuffmanFlags >> 2 & 3;
  8879. textRegion.huffmanDT = textRegionHuffmanFlags >> 4 & 3;
  8880. textRegion.huffmanRefinementDW = textRegionHuffmanFlags >> 6 & 3;
  8881. textRegion.huffmanRefinementDH = textRegionHuffmanFlags >> 8 & 3;
  8882. textRegion.huffmanRefinementDX = textRegionHuffmanFlags >> 10 & 3;
  8883. textRegion.huffmanRefinementDY = textRegionHuffmanFlags >> 12 & 3;
  8884. textRegion.huffmanRefinementSizeSelector = !!(textRegionHuffmanFlags & 0x4000);
  8885. }
  8886. if (textRegion.refinement && !textRegion.refinementTemplate) {
  8887. at = [];
  8888. for (i = 0; i < 2; i++) {
  8889. at.push({
  8890. x: readInt8(data, position),
  8891. y: readInt8(data, position + 1)
  8892. });
  8893. position += 2;
  8894. }
  8895. textRegion.refinementAt = at;
  8896. }
  8897. textRegion.numberOfSymbolInstances = readUint32(data, position);
  8898. position += 4;
  8899. args = [textRegion, header.referredTo, data, position, end];
  8900. break;
  8901. case 16:
  8902. const patternDictionary = {};
  8903. const patternDictionaryFlags = data[position++];
  8904. patternDictionary.mmr = !!(patternDictionaryFlags & 1);
  8905. patternDictionary.template = patternDictionaryFlags >> 1 & 3;
  8906. patternDictionary.patternWidth = data[position++];
  8907. patternDictionary.patternHeight = data[position++];
  8908. patternDictionary.maxPatternIndex = readUint32(data, position);
  8909. position += 4;
  8910. args = [patternDictionary, header.number, data, position, end];
  8911. break;
  8912. case 22:
  8913. case 23:
  8914. const halftoneRegion = {};
  8915. halftoneRegion.info = readRegionSegmentInformation(data, position);
  8916. position += RegionSegmentInformationFieldLength;
  8917. const halftoneRegionFlags = data[position++];
  8918. halftoneRegion.mmr = !!(halftoneRegionFlags & 1);
  8919. halftoneRegion.template = halftoneRegionFlags >> 1 & 3;
  8920. halftoneRegion.enableSkip = !!(halftoneRegionFlags & 8);
  8921. halftoneRegion.combinationOperator = halftoneRegionFlags >> 4 & 7;
  8922. halftoneRegion.defaultPixelValue = halftoneRegionFlags >> 7 & 1;
  8923. halftoneRegion.gridWidth = readUint32(data, position);
  8924. position += 4;
  8925. halftoneRegion.gridHeight = readUint32(data, position);
  8926. position += 4;
  8927. halftoneRegion.gridOffsetX = readUint32(data, position) & 0xffffffff;
  8928. position += 4;
  8929. halftoneRegion.gridOffsetY = readUint32(data, position) & 0xffffffff;
  8930. position += 4;
  8931. halftoneRegion.gridVectorX = readUint16(data, position);
  8932. position += 2;
  8933. halftoneRegion.gridVectorY = readUint16(data, position);
  8934. position += 2;
  8935. args = [halftoneRegion, header.referredTo, data, position, end];
  8936. break;
  8937. case 38:
  8938. case 39:
  8939. const genericRegion = {};
  8940. genericRegion.info = readRegionSegmentInformation(data, position);
  8941. position += RegionSegmentInformationFieldLength;
  8942. const genericRegionSegmentFlags = data[position++];
  8943. genericRegion.mmr = !!(genericRegionSegmentFlags & 1);
  8944. genericRegion.template = genericRegionSegmentFlags >> 1 & 3;
  8945. genericRegion.prediction = !!(genericRegionSegmentFlags & 8);
  8946. if (!genericRegion.mmr) {
  8947. atLength = genericRegion.template === 0 ? 4 : 1;
  8948. at = [];
  8949. for (i = 0; i < atLength; i++) {
  8950. at.push({
  8951. x: readInt8(data, position),
  8952. y: readInt8(data, position + 1)
  8953. });
  8954. position += 2;
  8955. }
  8956. genericRegion.at = at;
  8957. }
  8958. args = [genericRegion, data, position, end];
  8959. break;
  8960. case 48:
  8961. const pageInfo = {
  8962. width: readUint32(data, position),
  8963. height: readUint32(data, position + 4),
  8964. resolutionX: readUint32(data, position + 8),
  8965. resolutionY: readUint32(data, position + 12)
  8966. };
  8967. if (pageInfo.height === 0xffffffff) {
  8968. delete pageInfo.height;
  8969. }
  8970. const pageSegmentFlags = data[position + 16];
  8971. readUint16(data, position + 17);
  8972. pageInfo.lossless = !!(pageSegmentFlags & 1);
  8973. pageInfo.refinement = !!(pageSegmentFlags & 2);
  8974. pageInfo.defaultPixelValue = pageSegmentFlags >> 2 & 1;
  8975. pageInfo.combinationOperator = pageSegmentFlags >> 3 & 3;
  8976. pageInfo.requiresBuffer = !!(pageSegmentFlags & 32);
  8977. pageInfo.combinationOperatorOverride = !!(pageSegmentFlags & 64);
  8978. args = [pageInfo];
  8979. break;
  8980. case 49:
  8981. break;
  8982. case 50:
  8983. break;
  8984. case 51:
  8985. break;
  8986. case 53:
  8987. args = [header.number, data, position, end];
  8988. break;
  8989. case 62:
  8990. break;
  8991. default:
  8992. throw new Jbig2Error(`segment type ${header.typeName}(${header.type}) is not implemented`);
  8993. }
  8994. const callbackName = "on" + header.typeName;
  8995. if (callbackName in visitor) {
  8996. visitor[callbackName].apply(visitor, args);
  8997. }
  8998. }
  8999. function processSegments(segments, visitor) {
  9000. for (let i = 0, ii = segments.length; i < ii; i++) {
  9001. processSegment(segments[i], visitor);
  9002. }
  9003. }
  9004. function parseJbig2Chunks(chunks) {
  9005. const visitor = new SimpleSegmentVisitor();
  9006. for (let i = 0, ii = chunks.length; i < ii; i++) {
  9007. const chunk = chunks[i];
  9008. const segments = readSegments({}, chunk.data, chunk.start, chunk.end);
  9009. processSegments(segments, visitor);
  9010. }
  9011. return visitor.buffer;
  9012. }
  9013. function parseJbig2(data) {
  9014. throw new Error("Not implemented: parseJbig2");
  9015. }
  9016. class SimpleSegmentVisitor {
  9017. onPageInformation(info) {
  9018. this.currentPageInfo = info;
  9019. const rowSize = info.width + 7 >> 3;
  9020. const buffer = new Uint8ClampedArray(rowSize * info.height);
  9021. if (info.defaultPixelValue) {
  9022. buffer.fill(0xff);
  9023. }
  9024. this.buffer = buffer;
  9025. }
  9026. drawBitmap(regionInfo, bitmap) {
  9027. const pageInfo = this.currentPageInfo;
  9028. const width = regionInfo.width,
  9029. height = regionInfo.height;
  9030. const rowSize = pageInfo.width + 7 >> 3;
  9031. const combinationOperator = pageInfo.combinationOperatorOverride ? regionInfo.combinationOperator : pageInfo.combinationOperator;
  9032. const buffer = this.buffer;
  9033. const mask0 = 128 >> (regionInfo.x & 7);
  9034. let offset0 = regionInfo.y * rowSize + (regionInfo.x >> 3);
  9035. let i, j, mask, offset;
  9036. switch (combinationOperator) {
  9037. case 0:
  9038. for (i = 0; i < height; i++) {
  9039. mask = mask0;
  9040. offset = offset0;
  9041. for (j = 0; j < width; j++) {
  9042. if (bitmap[i][j]) {
  9043. buffer[offset] |= mask;
  9044. }
  9045. mask >>= 1;
  9046. if (!mask) {
  9047. mask = 128;
  9048. offset++;
  9049. }
  9050. }
  9051. offset0 += rowSize;
  9052. }
  9053. break;
  9054. case 2:
  9055. for (i = 0; i < height; i++) {
  9056. mask = mask0;
  9057. offset = offset0;
  9058. for (j = 0; j < width; j++) {
  9059. if (bitmap[i][j]) {
  9060. buffer[offset] ^= mask;
  9061. }
  9062. mask >>= 1;
  9063. if (!mask) {
  9064. mask = 128;
  9065. offset++;
  9066. }
  9067. }
  9068. offset0 += rowSize;
  9069. }
  9070. break;
  9071. default:
  9072. throw new Jbig2Error(`operator ${combinationOperator} is not supported`);
  9073. }
  9074. }
  9075. onImmediateGenericRegion(region, data, start, end) {
  9076. const regionInfo = region.info;
  9077. const decodingContext = new DecodingContext(data, start, end);
  9078. const bitmap = decodeBitmap(region.mmr, regionInfo.width, regionInfo.height, region.template, region.prediction, null, region.at, decodingContext);
  9079. this.drawBitmap(regionInfo, bitmap);
  9080. }
  9081. onImmediateLosslessGenericRegion() {
  9082. this.onImmediateGenericRegion(...arguments);
  9083. }
  9084. onSymbolDictionary(dictionary, currentSegment, referredSegments, data, start, end) {
  9085. let huffmanTables, huffmanInput;
  9086. if (dictionary.huffman) {
  9087. huffmanTables = getSymbolDictionaryHuffmanTables(dictionary, referredSegments, this.customTables);
  9088. huffmanInput = new Reader(data, start, end);
  9089. }
  9090. let symbols = this.symbols;
  9091. if (!symbols) {
  9092. this.symbols = symbols = {};
  9093. }
  9094. const inputSymbols = [];
  9095. for (const referredSegment of referredSegments) {
  9096. const referredSymbols = symbols[referredSegment];
  9097. if (referredSymbols) {
  9098. inputSymbols.push(...referredSymbols);
  9099. }
  9100. }
  9101. const decodingContext = new DecodingContext(data, start, end);
  9102. symbols[currentSegment] = decodeSymbolDictionary(dictionary.huffman, dictionary.refinement, inputSymbols, dictionary.numberOfNewSymbols, dictionary.numberOfExportedSymbols, huffmanTables, dictionary.template, dictionary.at, dictionary.refinementTemplate, dictionary.refinementAt, decodingContext, huffmanInput);
  9103. }
  9104. onImmediateTextRegion(region, referredSegments, data, start, end) {
  9105. const regionInfo = region.info;
  9106. let huffmanTables, huffmanInput;
  9107. const symbols = this.symbols;
  9108. const inputSymbols = [];
  9109. for (const referredSegment of referredSegments) {
  9110. const referredSymbols = symbols[referredSegment];
  9111. if (referredSymbols) {
  9112. inputSymbols.push(...referredSymbols);
  9113. }
  9114. }
  9115. const symbolCodeLength = log2(inputSymbols.length);
  9116. if (region.huffman) {
  9117. huffmanInput = new Reader(data, start, end);
  9118. huffmanTables = getTextRegionHuffmanTables(region, referredSegments, this.customTables, inputSymbols.length, huffmanInput);
  9119. }
  9120. const decodingContext = new DecodingContext(data, start, end);
  9121. const bitmap = decodeTextRegion(region.huffman, region.refinement, regionInfo.width, regionInfo.height, region.defaultPixelValue, region.numberOfSymbolInstances, region.stripSize, inputSymbols, symbolCodeLength, region.transposed, region.dsOffset, region.referenceCorner, region.combinationOperator, huffmanTables, region.refinementTemplate, region.refinementAt, decodingContext, region.logStripSize, huffmanInput);
  9122. this.drawBitmap(regionInfo, bitmap);
  9123. }
  9124. onImmediateLosslessTextRegion() {
  9125. this.onImmediateTextRegion(...arguments);
  9126. }
  9127. onPatternDictionary(dictionary, currentSegment, data, start, end) {
  9128. let patterns = this.patterns;
  9129. if (!patterns) {
  9130. this.patterns = patterns = {};
  9131. }
  9132. const decodingContext = new DecodingContext(data, start, end);
  9133. patterns[currentSegment] = decodePatternDictionary(dictionary.mmr, dictionary.patternWidth, dictionary.patternHeight, dictionary.maxPatternIndex, dictionary.template, decodingContext);
  9134. }
  9135. onImmediateHalftoneRegion(region, referredSegments, data, start, end) {
  9136. const patterns = this.patterns[referredSegments[0]];
  9137. const regionInfo = region.info;
  9138. const decodingContext = new DecodingContext(data, start, end);
  9139. const bitmap = decodeHalftoneRegion(region.mmr, patterns, region.template, regionInfo.width, regionInfo.height, region.defaultPixelValue, region.enableSkip, region.combinationOperator, region.gridWidth, region.gridHeight, region.gridOffsetX, region.gridOffsetY, region.gridVectorX, region.gridVectorY, decodingContext);
  9140. this.drawBitmap(regionInfo, bitmap);
  9141. }
  9142. onImmediateLosslessHalftoneRegion() {
  9143. this.onImmediateHalftoneRegion(...arguments);
  9144. }
  9145. onTables(currentSegment, data, start, end) {
  9146. let customTables = this.customTables;
  9147. if (!customTables) {
  9148. this.customTables = customTables = {};
  9149. }
  9150. customTables[currentSegment] = decodeTablesSegment(data, start, end);
  9151. }
  9152. }
  9153. class HuffmanLine {
  9154. constructor(lineData) {
  9155. if (lineData.length === 2) {
  9156. this.isOOB = true;
  9157. this.rangeLow = 0;
  9158. this.prefixLength = lineData[0];
  9159. this.rangeLength = 0;
  9160. this.prefixCode = lineData[1];
  9161. this.isLowerRange = false;
  9162. } else {
  9163. this.isOOB = false;
  9164. this.rangeLow = lineData[0];
  9165. this.prefixLength = lineData[1];
  9166. this.rangeLength = lineData[2];
  9167. this.prefixCode = lineData[3];
  9168. this.isLowerRange = lineData[4] === "lower";
  9169. }
  9170. }
  9171. }
  9172. class HuffmanTreeNode {
  9173. constructor(line) {
  9174. this.children = [];
  9175. if (line) {
  9176. this.isLeaf = true;
  9177. this.rangeLength = line.rangeLength;
  9178. this.rangeLow = line.rangeLow;
  9179. this.isLowerRange = line.isLowerRange;
  9180. this.isOOB = line.isOOB;
  9181. } else {
  9182. this.isLeaf = false;
  9183. }
  9184. }
  9185. buildTree(line, shift) {
  9186. const bit = line.prefixCode >> shift & 1;
  9187. if (shift <= 0) {
  9188. this.children[bit] = new HuffmanTreeNode(line);
  9189. } else {
  9190. let node = this.children[bit];
  9191. if (!node) {
  9192. this.children[bit] = node = new HuffmanTreeNode(null);
  9193. }
  9194. node.buildTree(line, shift - 1);
  9195. }
  9196. }
  9197. decodeNode(reader) {
  9198. if (this.isLeaf) {
  9199. if (this.isOOB) {
  9200. return null;
  9201. }
  9202. const htOffset = reader.readBits(this.rangeLength);
  9203. return this.rangeLow + (this.isLowerRange ? -htOffset : htOffset);
  9204. }
  9205. const node = this.children[reader.readBit()];
  9206. if (!node) {
  9207. throw new Jbig2Error("invalid Huffman data");
  9208. }
  9209. return node.decodeNode(reader);
  9210. }
  9211. }
  9212. class HuffmanTable {
  9213. constructor(lines, prefixCodesDone) {
  9214. if (!prefixCodesDone) {
  9215. this.assignPrefixCodes(lines);
  9216. }
  9217. this.rootNode = new HuffmanTreeNode(null);
  9218. for (let i = 0, ii = lines.length; i < ii; i++) {
  9219. const line = lines[i];
  9220. if (line.prefixLength > 0) {
  9221. this.rootNode.buildTree(line, line.prefixLength - 1);
  9222. }
  9223. }
  9224. }
  9225. decode(reader) {
  9226. return this.rootNode.decodeNode(reader);
  9227. }
  9228. assignPrefixCodes(lines) {
  9229. const linesLength = lines.length;
  9230. let prefixLengthMax = 0;
  9231. for (let i = 0; i < linesLength; i++) {
  9232. prefixLengthMax = Math.max(prefixLengthMax, lines[i].prefixLength);
  9233. }
  9234. const histogram = new Uint32Array(prefixLengthMax + 1);
  9235. for (let i = 0; i < linesLength; i++) {
  9236. histogram[lines[i].prefixLength]++;
  9237. }
  9238. let currentLength = 1,
  9239. firstCode = 0,
  9240. currentCode,
  9241. currentTemp,
  9242. line;
  9243. histogram[0] = 0;
  9244. while (currentLength <= prefixLengthMax) {
  9245. firstCode = firstCode + histogram[currentLength - 1] << 1;
  9246. currentCode = firstCode;
  9247. currentTemp = 0;
  9248. while (currentTemp < linesLength) {
  9249. line = lines[currentTemp];
  9250. if (line.prefixLength === currentLength) {
  9251. line.prefixCode = currentCode;
  9252. currentCode++;
  9253. }
  9254. currentTemp++;
  9255. }
  9256. currentLength++;
  9257. }
  9258. }
  9259. }
  9260. function decodeTablesSegment(data, start, end) {
  9261. const flags = data[start];
  9262. const lowestValue = readUint32(data, start + 1) & 0xffffffff;
  9263. const highestValue = readUint32(data, start + 5) & 0xffffffff;
  9264. const reader = new Reader(data, start + 9, end);
  9265. const prefixSizeBits = (flags >> 1 & 7) + 1;
  9266. const rangeSizeBits = (flags >> 4 & 7) + 1;
  9267. const lines = [];
  9268. let prefixLength,
  9269. rangeLength,
  9270. currentRangeLow = lowestValue;
  9271. do {
  9272. prefixLength = reader.readBits(prefixSizeBits);
  9273. rangeLength = reader.readBits(rangeSizeBits);
  9274. lines.push(new HuffmanLine([currentRangeLow, prefixLength, rangeLength, 0]));
  9275. currentRangeLow += 1 << rangeLength;
  9276. } while (currentRangeLow < highestValue);
  9277. prefixLength = reader.readBits(prefixSizeBits);
  9278. lines.push(new HuffmanLine([lowestValue - 1, prefixLength, 32, 0, "lower"]));
  9279. prefixLength = reader.readBits(prefixSizeBits);
  9280. lines.push(new HuffmanLine([highestValue, prefixLength, 32, 0]));
  9281. if (flags & 1) {
  9282. prefixLength = reader.readBits(prefixSizeBits);
  9283. lines.push(new HuffmanLine([prefixLength, 0]));
  9284. }
  9285. return new HuffmanTable(lines, false);
  9286. }
  9287. const standardTablesCache = {};
  9288. function getStandardTable(number) {
  9289. let table = standardTablesCache[number];
  9290. if (table) {
  9291. return table;
  9292. }
  9293. let lines;
  9294. switch (number) {
  9295. case 1:
  9296. lines = [[0, 1, 4, 0x0], [16, 2, 8, 0x2], [272, 3, 16, 0x6], [65808, 3, 32, 0x7]];
  9297. break;
  9298. case 2:
  9299. lines = [[0, 1, 0, 0x0], [1, 2, 0, 0x2], [2, 3, 0, 0x6], [3, 4, 3, 0xe], [11, 5, 6, 0x1e], [75, 6, 32, 0x3e], [6, 0x3f]];
  9300. break;
  9301. case 3:
  9302. lines = [[-256, 8, 8, 0xfe], [0, 1, 0, 0x0], [1, 2, 0, 0x2], [2, 3, 0, 0x6], [3, 4, 3, 0xe], [11, 5, 6, 0x1e], [-257, 8, 32, 0xff, "lower"], [75, 7, 32, 0x7e], [6, 0x3e]];
  9303. break;
  9304. case 4:
  9305. lines = [[1, 1, 0, 0x0], [2, 2, 0, 0x2], [3, 3, 0, 0x6], [4, 4, 3, 0xe], [12, 5, 6, 0x1e], [76, 5, 32, 0x1f]];
  9306. break;
  9307. case 5:
  9308. lines = [[-255, 7, 8, 0x7e], [1, 1, 0, 0x0], [2, 2, 0, 0x2], [3, 3, 0, 0x6], [4, 4, 3, 0xe], [12, 5, 6, 0x1e], [-256, 7, 32, 0x7f, "lower"], [76, 6, 32, 0x3e]];
  9309. break;
  9310. case 6:
  9311. lines = [[-2048, 5, 10, 0x1c], [-1024, 4, 9, 0x8], [-512, 4, 8, 0x9], [-256, 4, 7, 0xa], [-128, 5, 6, 0x1d], [-64, 5, 5, 0x1e], [-32, 4, 5, 0xb], [0, 2, 7, 0x0], [128, 3, 7, 0x2], [256, 3, 8, 0x3], [512, 4, 9, 0xc], [1024, 4, 10, 0xd], [-2049, 6, 32, 0x3e, "lower"], [2048, 6, 32, 0x3f]];
  9312. break;
  9313. case 7:
  9314. lines = [[-1024, 4, 9, 0x8], [-512, 3, 8, 0x0], [-256, 4, 7, 0x9], [-128, 5, 6, 0x1a], [-64, 5, 5, 0x1b], [-32, 4, 5, 0xa], [0, 4, 5, 0xb], [32, 5, 5, 0x1c], [64, 5, 6, 0x1d], [128, 4, 7, 0xc], [256, 3, 8, 0x1], [512, 3, 9, 0x2], [1024, 3, 10, 0x3], [-1025, 5, 32, 0x1e, "lower"], [2048, 5, 32, 0x1f]];
  9315. break;
  9316. case 8:
  9317. lines = [[-15, 8, 3, 0xfc], [-7, 9, 1, 0x1fc], [-5, 8, 1, 0xfd], [-3, 9, 0, 0x1fd], [-2, 7, 0, 0x7c], [-1, 4, 0, 0xa], [0, 2, 1, 0x0], [2, 5, 0, 0x1a], [3, 6, 0, 0x3a], [4, 3, 4, 0x4], [20, 6, 1, 0x3b], [22, 4, 4, 0xb], [38, 4, 5, 0xc], [70, 5, 6, 0x1b], [134, 5, 7, 0x1c], [262, 6, 7, 0x3c], [390, 7, 8, 0x7d], [646, 6, 10, 0x3d], [-16, 9, 32, 0x1fe, "lower"], [1670, 9, 32, 0x1ff], [2, 0x1]];
  9318. break;
  9319. case 9:
  9320. lines = [[-31, 8, 4, 0xfc], [-15, 9, 2, 0x1fc], [-11, 8, 2, 0xfd], [-7, 9, 1, 0x1fd], [-5, 7, 1, 0x7c], [-3, 4, 1, 0xa], [-1, 3, 1, 0x2], [1, 3, 1, 0x3], [3, 5, 1, 0x1a], [5, 6, 1, 0x3a], [7, 3, 5, 0x4], [39, 6, 2, 0x3b], [43, 4, 5, 0xb], [75, 4, 6, 0xc], [139, 5, 7, 0x1b], [267, 5, 8, 0x1c], [523, 6, 8, 0x3c], [779, 7, 9, 0x7d], [1291, 6, 11, 0x3d], [-32, 9, 32, 0x1fe, "lower"], [3339, 9, 32, 0x1ff], [2, 0x0]];
  9321. break;
  9322. case 10:
  9323. lines = [[-21, 7, 4, 0x7a], [-5, 8, 0, 0xfc], [-4, 7, 0, 0x7b], [-3, 5, 0, 0x18], [-2, 2, 2, 0x0], [2, 5, 0, 0x19], [3, 6, 0, 0x36], [4, 7, 0, 0x7c], [5, 8, 0, 0xfd], [6, 2, 6, 0x1], [70, 5, 5, 0x1a], [102, 6, 5, 0x37], [134, 6, 6, 0x38], [198, 6, 7, 0x39], [326, 6, 8, 0x3a], [582, 6, 9, 0x3b], [1094, 6, 10, 0x3c], [2118, 7, 11, 0x7d], [-22, 8, 32, 0xfe, "lower"], [4166, 8, 32, 0xff], [2, 0x2]];
  9324. break;
  9325. case 11:
  9326. lines = [[1, 1, 0, 0x0], [2, 2, 1, 0x2], [4, 4, 0, 0xc], [5, 4, 1, 0xd], [7, 5, 1, 0x1c], [9, 5, 2, 0x1d], [13, 6, 2, 0x3c], [17, 7, 2, 0x7a], [21, 7, 3, 0x7b], [29, 7, 4, 0x7c], [45, 7, 5, 0x7d], [77, 7, 6, 0x7e], [141, 7, 32, 0x7f]];
  9327. break;
  9328. case 12:
  9329. lines = [[1, 1, 0, 0x0], [2, 2, 0, 0x2], [3, 3, 1, 0x6], [5, 5, 0, 0x1c], [6, 5, 1, 0x1d], [8, 6, 1, 0x3c], [10, 7, 0, 0x7a], [11, 7, 1, 0x7b], [13, 7, 2, 0x7c], [17, 7, 3, 0x7d], [25, 7, 4, 0x7e], [41, 8, 5, 0xfe], [73, 8, 32, 0xff]];
  9330. break;
  9331. case 13:
  9332. lines = [[1, 1, 0, 0x0], [2, 3, 0, 0x4], [3, 4, 0, 0xc], [4, 5, 0, 0x1c], [5, 4, 1, 0xd], [7, 3, 3, 0x5], [15, 6, 1, 0x3a], [17, 6, 2, 0x3b], [21, 6, 3, 0x3c], [29, 6, 4, 0x3d], [45, 6, 5, 0x3e], [77, 7, 6, 0x7e], [141, 7, 32, 0x7f]];
  9333. break;
  9334. case 14:
  9335. lines = [[-2, 3, 0, 0x4], [-1, 3, 0, 0x5], [0, 1, 0, 0x0], [1, 3, 0, 0x6], [2, 3, 0, 0x7]];
  9336. break;
  9337. case 15:
  9338. lines = [[-24, 7, 4, 0x7c], [-8, 6, 2, 0x3c], [-4, 5, 1, 0x1c], [-2, 4, 0, 0xc], [-1, 3, 0, 0x4], [0, 1, 0, 0x0], [1, 3, 0, 0x5], [2, 4, 0, 0xd], [3, 5, 1, 0x1d], [5, 6, 2, 0x3d], [9, 7, 4, 0x7d], [-25, 7, 32, 0x7e, "lower"], [25, 7, 32, 0x7f]];
  9339. break;
  9340. default:
  9341. throw new Jbig2Error(`standard table B.${number} does not exist`);
  9342. }
  9343. for (let i = 0, ii = lines.length; i < ii; i++) {
  9344. lines[i] = new HuffmanLine(lines[i]);
  9345. }
  9346. table = new HuffmanTable(lines, true);
  9347. standardTablesCache[number] = table;
  9348. return table;
  9349. }
  9350. class Reader {
  9351. constructor(data, start, end) {
  9352. this.data = data;
  9353. this.start = start;
  9354. this.end = end;
  9355. this.position = start;
  9356. this.shift = -1;
  9357. this.currentByte = 0;
  9358. }
  9359. readBit() {
  9360. if (this.shift < 0) {
  9361. if (this.position >= this.end) {
  9362. throw new Jbig2Error("end of data while reading bit");
  9363. }
  9364. this.currentByte = this.data[this.position++];
  9365. this.shift = 7;
  9366. }
  9367. const bit = this.currentByte >> this.shift & 1;
  9368. this.shift--;
  9369. return bit;
  9370. }
  9371. readBits(numBits) {
  9372. let result = 0,
  9373. i;
  9374. for (i = numBits - 1; i >= 0; i--) {
  9375. result |= this.readBit() << i;
  9376. }
  9377. return result;
  9378. }
  9379. byteAlign() {
  9380. this.shift = -1;
  9381. }
  9382. next() {
  9383. if (this.position >= this.end) {
  9384. return -1;
  9385. }
  9386. return this.data[this.position++];
  9387. }
  9388. }
  9389. function getCustomHuffmanTable(index, referredTo, customTables) {
  9390. let currentIndex = 0;
  9391. for (let i = 0, ii = referredTo.length; i < ii; i++) {
  9392. const table = customTables[referredTo[i]];
  9393. if (table) {
  9394. if (index === currentIndex) {
  9395. return table;
  9396. }
  9397. currentIndex++;
  9398. }
  9399. }
  9400. throw new Jbig2Error("can't find custom Huffman table");
  9401. }
  9402. function getTextRegionHuffmanTables(textRegion, referredTo, customTables, numberOfSymbols, reader) {
  9403. const codes = [];
  9404. for (let i = 0; i <= 34; i++) {
  9405. const codeLength = reader.readBits(4);
  9406. codes.push(new HuffmanLine([i, codeLength, 0, 0]));
  9407. }
  9408. const runCodesTable = new HuffmanTable(codes, false);
  9409. codes.length = 0;
  9410. for (let i = 0; i < numberOfSymbols;) {
  9411. const codeLength = runCodesTable.decode(reader);
  9412. if (codeLength >= 32) {
  9413. let repeatedLength, numberOfRepeats, j;
  9414. switch (codeLength) {
  9415. case 32:
  9416. if (i === 0) {
  9417. throw new Jbig2Error("no previous value in symbol ID table");
  9418. }
  9419. numberOfRepeats = reader.readBits(2) + 3;
  9420. repeatedLength = codes[i - 1].prefixLength;
  9421. break;
  9422. case 33:
  9423. numberOfRepeats = reader.readBits(3) + 3;
  9424. repeatedLength = 0;
  9425. break;
  9426. case 34:
  9427. numberOfRepeats = reader.readBits(7) + 11;
  9428. repeatedLength = 0;
  9429. break;
  9430. default:
  9431. throw new Jbig2Error("invalid code length in symbol ID table");
  9432. }
  9433. for (j = 0; j < numberOfRepeats; j++) {
  9434. codes.push(new HuffmanLine([i, repeatedLength, 0, 0]));
  9435. i++;
  9436. }
  9437. } else {
  9438. codes.push(new HuffmanLine([i, codeLength, 0, 0]));
  9439. i++;
  9440. }
  9441. }
  9442. reader.byteAlign();
  9443. const symbolIDTable = new HuffmanTable(codes, false);
  9444. let customIndex = 0,
  9445. tableFirstS,
  9446. tableDeltaS,
  9447. tableDeltaT;
  9448. switch (textRegion.huffmanFS) {
  9449. case 0:
  9450. case 1:
  9451. tableFirstS = getStandardTable(textRegion.huffmanFS + 6);
  9452. break;
  9453. case 3:
  9454. tableFirstS = getCustomHuffmanTable(customIndex, referredTo, customTables);
  9455. customIndex++;
  9456. break;
  9457. default:
  9458. throw new Jbig2Error("invalid Huffman FS selector");
  9459. }
  9460. switch (textRegion.huffmanDS) {
  9461. case 0:
  9462. case 1:
  9463. case 2:
  9464. tableDeltaS = getStandardTable(textRegion.huffmanDS + 8);
  9465. break;
  9466. case 3:
  9467. tableDeltaS = getCustomHuffmanTable(customIndex, referredTo, customTables);
  9468. customIndex++;
  9469. break;
  9470. default:
  9471. throw new Jbig2Error("invalid Huffman DS selector");
  9472. }
  9473. switch (textRegion.huffmanDT) {
  9474. case 0:
  9475. case 1:
  9476. case 2:
  9477. tableDeltaT = getStandardTable(textRegion.huffmanDT + 11);
  9478. break;
  9479. case 3:
  9480. tableDeltaT = getCustomHuffmanTable(customIndex, referredTo, customTables);
  9481. customIndex++;
  9482. break;
  9483. default:
  9484. throw new Jbig2Error("invalid Huffman DT selector");
  9485. }
  9486. if (textRegion.refinement) {
  9487. throw new Jbig2Error("refinement with Huffman is not supported");
  9488. }
  9489. return {
  9490. symbolIDTable,
  9491. tableFirstS,
  9492. tableDeltaS,
  9493. tableDeltaT
  9494. };
  9495. }
  9496. function getSymbolDictionaryHuffmanTables(dictionary, referredTo, customTables) {
  9497. let customIndex = 0,
  9498. tableDeltaHeight,
  9499. tableDeltaWidth;
  9500. switch (dictionary.huffmanDHSelector) {
  9501. case 0:
  9502. case 1:
  9503. tableDeltaHeight = getStandardTable(dictionary.huffmanDHSelector + 4);
  9504. break;
  9505. case 3:
  9506. tableDeltaHeight = getCustomHuffmanTable(customIndex, referredTo, customTables);
  9507. customIndex++;
  9508. break;
  9509. default:
  9510. throw new Jbig2Error("invalid Huffman DH selector");
  9511. }
  9512. switch (dictionary.huffmanDWSelector) {
  9513. case 0:
  9514. case 1:
  9515. tableDeltaWidth = getStandardTable(dictionary.huffmanDWSelector + 2);
  9516. break;
  9517. case 3:
  9518. tableDeltaWidth = getCustomHuffmanTable(customIndex, referredTo, customTables);
  9519. customIndex++;
  9520. break;
  9521. default:
  9522. throw new Jbig2Error("invalid Huffman DW selector");
  9523. }
  9524. let tableBitmapSize, tableAggregateInstances;
  9525. if (dictionary.bitmapSizeSelector) {
  9526. tableBitmapSize = getCustomHuffmanTable(customIndex, referredTo, customTables);
  9527. customIndex++;
  9528. } else {
  9529. tableBitmapSize = getStandardTable(1);
  9530. }
  9531. if (dictionary.aggregationInstancesSelector) {
  9532. tableAggregateInstances = getCustomHuffmanTable(customIndex, referredTo, customTables);
  9533. } else {
  9534. tableAggregateInstances = getStandardTable(1);
  9535. }
  9536. return {
  9537. tableDeltaHeight,
  9538. tableDeltaWidth,
  9539. tableBitmapSize,
  9540. tableAggregateInstances
  9541. };
  9542. }
  9543. function readUncompressedBitmap(reader, width, height) {
  9544. const bitmap = [];
  9545. for (let y = 0; y < height; y++) {
  9546. const row = new Uint8Array(width);
  9547. bitmap.push(row);
  9548. for (let x = 0; x < width; x++) {
  9549. row[x] = reader.readBit();
  9550. }
  9551. reader.byteAlign();
  9552. }
  9553. return bitmap;
  9554. }
  9555. function decodeMMRBitmap(input, width, height, endOfBlock) {
  9556. const params = {
  9557. K: -1,
  9558. Columns: width,
  9559. Rows: height,
  9560. BlackIs1: true,
  9561. EndOfBlock: endOfBlock
  9562. };
  9563. const decoder = new CCITTFaxDecoder(input, params);
  9564. const bitmap = [];
  9565. let currentByte,
  9566. eof = false;
  9567. for (let y = 0; y < height; y++) {
  9568. const row = new Uint8Array(width);
  9569. bitmap.push(row);
  9570. let shift = -1;
  9571. for (let x = 0; x < width; x++) {
  9572. if (shift < 0) {
  9573. currentByte = decoder.readNextChar();
  9574. if (currentByte === -1) {
  9575. currentByte = 0;
  9576. eof = true;
  9577. }
  9578. shift = 7;
  9579. }
  9580. row[x] = currentByte >> shift & 1;
  9581. shift--;
  9582. }
  9583. }
  9584. if (endOfBlock && !eof) {
  9585. const lookForEOFLimit = 5;
  9586. for (let i = 0; i < lookForEOFLimit; i++) {
  9587. if (decoder.readNextChar() === -1) {
  9588. break;
  9589. }
  9590. }
  9591. }
  9592. return bitmap;
  9593. }
  9594. class Jbig2Image {
  9595. parseChunks(chunks) {
  9596. return parseJbig2Chunks(chunks);
  9597. }
  9598. parse(data) {
  9599. throw new Error("Not implemented: Jbig2Image.parse");
  9600. }
  9601. }
  9602. ;// ./src/core/jbig2_stream.js
  9603. class Jbig2Stream extends DecodeStream {
  9604. constructor(stream, maybeLength, params) {
  9605. super(maybeLength);
  9606. this.stream = stream;
  9607. this.dict = stream.dict;
  9608. this.maybeLength = maybeLength;
  9609. this.params = params;
  9610. }
  9611. get bytes() {
  9612. return shadow(this, "bytes", this.stream.getBytes(this.maybeLength));
  9613. }
  9614. ensureBuffer(requested) {}
  9615. readBlock() {
  9616. this.decodeImage();
  9617. }
  9618. decodeImage(bytes) {
  9619. if (this.eof) {
  9620. return this.buffer;
  9621. }
  9622. bytes ||= this.bytes;
  9623. const jbig2Image = new Jbig2Image();
  9624. const chunks = [];
  9625. if (this.params instanceof Dict) {
  9626. const globalsStream = this.params.get("JBIG2Globals");
  9627. if (globalsStream instanceof BaseStream) {
  9628. const globals = globalsStream.getBytes();
  9629. chunks.push({
  9630. data: globals,
  9631. start: 0,
  9632. end: globals.length
  9633. });
  9634. }
  9635. }
  9636. chunks.push({
  9637. data: bytes,
  9638. start: 0,
  9639. end: bytes.length
  9640. });
  9641. const data = jbig2Image.parseChunks(chunks);
  9642. const dataLength = data.length;
  9643. for (let i = 0; i < dataLength; i++) {
  9644. data[i] ^= 0xff;
  9645. }
  9646. this.buffer = data;
  9647. this.bufferLength = dataLength;
  9648. this.eof = true;
  9649. return this.buffer;
  9650. }
  9651. get canAsyncDecodeImageFromBuffer() {
  9652. return this.stream.isAsync;
  9653. }
  9654. }
  9655. ;// ./src/shared/image_utils.js
  9656. function convertToRGBA(params) {
  9657. switch (params.kind) {
  9658. case ImageKind.GRAYSCALE_1BPP:
  9659. return convertBlackAndWhiteToRGBA(params);
  9660. case ImageKind.RGB_24BPP:
  9661. return convertRGBToRGBA(params);
  9662. }
  9663. return null;
  9664. }
  9665. function convertBlackAndWhiteToRGBA({
  9666. src,
  9667. srcPos = 0,
  9668. dest,
  9669. width,
  9670. height,
  9671. nonBlackColor = 0xffffffff,
  9672. inverseDecode = false
  9673. }) {
  9674. const black = FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff;
  9675. const [zeroMapping, oneMapping] = inverseDecode ? [nonBlackColor, black] : [black, nonBlackColor];
  9676. const widthInSource = width >> 3;
  9677. const widthRemainder = width & 7;
  9678. const srcLength = src.length;
  9679. dest = new Uint32Array(dest.buffer);
  9680. let destPos = 0;
  9681. for (let i = 0; i < height; i++) {
  9682. for (const max = srcPos + widthInSource; srcPos < max; srcPos++) {
  9683. const elem = srcPos < srcLength ? src[srcPos] : 255;
  9684. dest[destPos++] = elem & 0b10000000 ? oneMapping : zeroMapping;
  9685. dest[destPos++] = elem & 0b1000000 ? oneMapping : zeroMapping;
  9686. dest[destPos++] = elem & 0b100000 ? oneMapping : zeroMapping;
  9687. dest[destPos++] = elem & 0b10000 ? oneMapping : zeroMapping;
  9688. dest[destPos++] = elem & 0b1000 ? oneMapping : zeroMapping;
  9689. dest[destPos++] = elem & 0b100 ? oneMapping : zeroMapping;
  9690. dest[destPos++] = elem & 0b10 ? oneMapping : zeroMapping;
  9691. dest[destPos++] = elem & 0b1 ? oneMapping : zeroMapping;
  9692. }
  9693. if (widthRemainder === 0) {
  9694. continue;
  9695. }
  9696. const elem = srcPos < srcLength ? src[srcPos++] : 255;
  9697. for (let j = 0; j < widthRemainder; j++) {
  9698. dest[destPos++] = elem & 1 << 7 - j ? oneMapping : zeroMapping;
  9699. }
  9700. }
  9701. return {
  9702. srcPos,
  9703. destPos
  9704. };
  9705. }
  9706. function convertRGBToRGBA({
  9707. src,
  9708. srcPos = 0,
  9709. dest,
  9710. destPos = 0,
  9711. width,
  9712. height
  9713. }) {
  9714. let i = 0;
  9715. const len32 = src.length >> 2;
  9716. const src32 = new Uint32Array(src.buffer, srcPos, len32);
  9717. if (FeatureTest.isLittleEndian) {
  9718. for (; i < len32 - 2; i += 3, destPos += 4) {
  9719. const s1 = src32[i];
  9720. const s2 = src32[i + 1];
  9721. const s3 = src32[i + 2];
  9722. dest[destPos] = s1 | 0xff000000;
  9723. dest[destPos + 1] = s1 >>> 24 | s2 << 8 | 0xff000000;
  9724. dest[destPos + 2] = s2 >>> 16 | s3 << 16 | 0xff000000;
  9725. dest[destPos + 3] = s3 >>> 8 | 0xff000000;
  9726. }
  9727. for (let j = i * 4, jj = src.length; j < jj; j += 3) {
  9728. dest[destPos++] = src[j] | src[j + 1] << 8 | src[j + 2] << 16 | 0xff000000;
  9729. }
  9730. } else {
  9731. for (; i < len32 - 2; i += 3, destPos += 4) {
  9732. const s1 = src32[i];
  9733. const s2 = src32[i + 1];
  9734. const s3 = src32[i + 2];
  9735. dest[destPos] = s1 | 0xff;
  9736. dest[destPos + 1] = s1 << 24 | s2 >>> 8 | 0xff;
  9737. dest[destPos + 2] = s2 << 16 | s3 >>> 16 | 0xff;
  9738. dest[destPos + 3] = s3 << 8 | 0xff;
  9739. }
  9740. for (let j = i * 4, jj = src.length; j < jj; j += 3) {
  9741. dest[destPos++] = src[j] << 24 | src[j + 1] << 16 | src[j + 2] << 8 | 0xff;
  9742. }
  9743. }
  9744. return {
  9745. srcPos,
  9746. destPos
  9747. };
  9748. }
  9749. function grayToRGBA(src, dest) {
  9750. if (FeatureTest.isLittleEndian) {
  9751. for (let i = 0, ii = src.length; i < ii; i++) {
  9752. dest[i] = src[i] * 0x10101 | 0xff000000;
  9753. }
  9754. } else {
  9755. for (let i = 0, ii = src.length; i < ii; i++) {
  9756. dest[i] = src[i] * 0x1010100 | 0x000000ff;
  9757. }
  9758. }
  9759. }
  9760. ;// ./src/core/jpg.js
  9761. class JpegError extends BaseException {
  9762. constructor(msg) {
  9763. super(msg, "JpegError");
  9764. }
  9765. }
  9766. class DNLMarkerError extends BaseException {
  9767. constructor(message, scanLines) {
  9768. super(message, "DNLMarkerError");
  9769. this.scanLines = scanLines;
  9770. }
  9771. }
  9772. class EOIMarkerError extends BaseException {
  9773. constructor(msg) {
  9774. super(msg, "EOIMarkerError");
  9775. }
  9776. }
  9777. const dctZigZag = new Uint8Array([0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63]);
  9778. const dctCos1 = 4017;
  9779. const dctSin1 = 799;
  9780. const dctCos3 = 3406;
  9781. const dctSin3 = 2276;
  9782. const dctCos6 = 1567;
  9783. const dctSin6 = 3784;
  9784. const dctSqrt2 = 5793;
  9785. const dctSqrt1d2 = 2896;
  9786. function buildHuffmanTable(codeLengths, values) {
  9787. let k = 0,
  9788. i,
  9789. j,
  9790. length = 16;
  9791. while (length > 0 && !codeLengths[length - 1]) {
  9792. length--;
  9793. }
  9794. const code = [{
  9795. children: [],
  9796. index: 0
  9797. }];
  9798. let p = code[0],
  9799. q;
  9800. for (i = 0; i < length; i++) {
  9801. for (j = 0; j < codeLengths[i]; j++) {
  9802. p = code.pop();
  9803. p.children[p.index] = values[k];
  9804. while (p.index > 0) {
  9805. p = code.pop();
  9806. }
  9807. p.index++;
  9808. code.push(p);
  9809. while (code.length <= i) {
  9810. code.push(q = {
  9811. children: [],
  9812. index: 0
  9813. });
  9814. p.children[p.index] = q.children;
  9815. p = q;
  9816. }
  9817. k++;
  9818. }
  9819. if (i + 1 < length) {
  9820. code.push(q = {
  9821. children: [],
  9822. index: 0
  9823. });
  9824. p.children[p.index] = q.children;
  9825. p = q;
  9826. }
  9827. }
  9828. return code[0].children;
  9829. }
  9830. function getBlockBufferOffset(component, row, col) {
  9831. return 64 * ((component.blocksPerLine + 1) * row + col);
  9832. }
  9833. function decodeScan(data, offset, frame, components, resetInterval, spectralStart, spectralEnd, successivePrev, successive, parseDNLMarker = false) {
  9834. const mcusPerLine = frame.mcusPerLine;
  9835. const progressive = frame.progressive;
  9836. const startOffset = offset;
  9837. let bitsData = 0,
  9838. bitsCount = 0;
  9839. function readBit() {
  9840. if (bitsCount > 0) {
  9841. bitsCount--;
  9842. return bitsData >> bitsCount & 1;
  9843. }
  9844. bitsData = data[offset++];
  9845. if (bitsData === 0xff) {
  9846. const nextByte = data[offset++];
  9847. if (nextByte) {
  9848. if (nextByte === 0xdc && parseDNLMarker) {
  9849. offset += 2;
  9850. const scanLines = readUint16(data, offset);
  9851. offset += 2;
  9852. if (scanLines > 0 && scanLines !== frame.scanLines) {
  9853. throw new DNLMarkerError("Found DNL marker (0xFFDC) while parsing scan data", scanLines);
  9854. }
  9855. } else if (nextByte === 0xd9) {
  9856. if (parseDNLMarker) {
  9857. const maybeScanLines = blockRow * (frame.precision === 8 ? 8 : 0);
  9858. if (maybeScanLines > 0 && Math.round(frame.scanLines / maybeScanLines) >= 5) {
  9859. throw new DNLMarkerError("Found EOI marker (0xFFD9) while parsing scan data, " + "possibly caused by incorrect `scanLines` parameter", maybeScanLines);
  9860. }
  9861. }
  9862. throw new EOIMarkerError("Found EOI marker (0xFFD9) while parsing scan data");
  9863. }
  9864. throw new JpegError(`unexpected marker ${(bitsData << 8 | nextByte).toString(16)}`);
  9865. }
  9866. }
  9867. bitsCount = 7;
  9868. return bitsData >>> 7;
  9869. }
  9870. function decodeHuffman(tree) {
  9871. let node = tree;
  9872. while (true) {
  9873. node = node[readBit()];
  9874. switch (typeof node) {
  9875. case "number":
  9876. return node;
  9877. case "object":
  9878. continue;
  9879. }
  9880. throw new JpegError("invalid huffman sequence");
  9881. }
  9882. }
  9883. function receive(length) {
  9884. let n = 0;
  9885. while (length > 0) {
  9886. n = n << 1 | readBit();
  9887. length--;
  9888. }
  9889. return n;
  9890. }
  9891. function receiveAndExtend(length) {
  9892. if (length === 1) {
  9893. return readBit() === 1 ? 1 : -1;
  9894. }
  9895. const n = receive(length);
  9896. if (n >= 1 << length - 1) {
  9897. return n;
  9898. }
  9899. return n + (-1 << length) + 1;
  9900. }
  9901. function decodeBaseline(component, blockOffset) {
  9902. const t = decodeHuffman(component.huffmanTableDC);
  9903. const diff = t === 0 ? 0 : receiveAndExtend(t);
  9904. component.blockData[blockOffset] = component.pred += diff;
  9905. let k = 1;
  9906. while (k < 64) {
  9907. const rs = decodeHuffman(component.huffmanTableAC);
  9908. const s = rs & 15,
  9909. r = rs >> 4;
  9910. if (s === 0) {
  9911. if (r < 15) {
  9912. break;
  9913. }
  9914. k += 16;
  9915. continue;
  9916. }
  9917. k += r;
  9918. const z = dctZigZag[k];
  9919. component.blockData[blockOffset + z] = receiveAndExtend(s);
  9920. k++;
  9921. }
  9922. }
  9923. function decodeDCFirst(component, blockOffset) {
  9924. const t = decodeHuffman(component.huffmanTableDC);
  9925. const diff = t === 0 ? 0 : receiveAndExtend(t) << successive;
  9926. component.blockData[blockOffset] = component.pred += diff;
  9927. }
  9928. function decodeDCSuccessive(component, blockOffset) {
  9929. component.blockData[blockOffset] |= readBit() << successive;
  9930. }
  9931. let eobrun = 0;
  9932. function decodeACFirst(component, blockOffset) {
  9933. if (eobrun > 0) {
  9934. eobrun--;
  9935. return;
  9936. }
  9937. let k = spectralStart;
  9938. const e = spectralEnd;
  9939. while (k <= e) {
  9940. const rs = decodeHuffman(component.huffmanTableAC);
  9941. const s = rs & 15,
  9942. r = rs >> 4;
  9943. if (s === 0) {
  9944. if (r < 15) {
  9945. eobrun = receive(r) + (1 << r) - 1;
  9946. break;
  9947. }
  9948. k += 16;
  9949. continue;
  9950. }
  9951. k += r;
  9952. const z = dctZigZag[k];
  9953. component.blockData[blockOffset + z] = receiveAndExtend(s) * (1 << successive);
  9954. k++;
  9955. }
  9956. }
  9957. let successiveACState = 0,
  9958. successiveACNextValue;
  9959. function decodeACSuccessive(component, blockOffset) {
  9960. let k = spectralStart;
  9961. const e = spectralEnd;
  9962. let r = 0;
  9963. let s;
  9964. let rs;
  9965. while (k <= e) {
  9966. const offsetZ = blockOffset + dctZigZag[k];
  9967. const sign = component.blockData[offsetZ] < 0 ? -1 : 1;
  9968. switch (successiveACState) {
  9969. case 0:
  9970. rs = decodeHuffman(component.huffmanTableAC);
  9971. s = rs & 15;
  9972. r = rs >> 4;
  9973. if (s === 0) {
  9974. if (r < 15) {
  9975. eobrun = receive(r) + (1 << r);
  9976. successiveACState = 4;
  9977. } else {
  9978. r = 16;
  9979. successiveACState = 1;
  9980. }
  9981. } else {
  9982. if (s !== 1) {
  9983. throw new JpegError("invalid ACn encoding");
  9984. }
  9985. successiveACNextValue = receiveAndExtend(s);
  9986. successiveACState = r ? 2 : 3;
  9987. }
  9988. continue;
  9989. case 1:
  9990. case 2:
  9991. if (component.blockData[offsetZ]) {
  9992. component.blockData[offsetZ] += sign * (readBit() << successive);
  9993. } else {
  9994. r--;
  9995. if (r === 0) {
  9996. successiveACState = successiveACState === 2 ? 3 : 0;
  9997. }
  9998. }
  9999. break;
  10000. case 3:
  10001. if (component.blockData[offsetZ]) {
  10002. component.blockData[offsetZ] += sign * (readBit() << successive);
  10003. } else {
  10004. component.blockData[offsetZ] = successiveACNextValue << successive;
  10005. successiveACState = 0;
  10006. }
  10007. break;
  10008. case 4:
  10009. if (component.blockData[offsetZ]) {
  10010. component.blockData[offsetZ] += sign * (readBit() << successive);
  10011. }
  10012. break;
  10013. }
  10014. k++;
  10015. }
  10016. if (successiveACState === 4) {
  10017. eobrun--;
  10018. if (eobrun === 0) {
  10019. successiveACState = 0;
  10020. }
  10021. }
  10022. }
  10023. let blockRow = 0;
  10024. function decodeMcu(component, decode, mcu, row, col) {
  10025. const mcuRow = mcu / mcusPerLine | 0;
  10026. const mcuCol = mcu % mcusPerLine;
  10027. blockRow = mcuRow * component.v + row;
  10028. const blockCol = mcuCol * component.h + col;
  10029. const blockOffset = getBlockBufferOffset(component, blockRow, blockCol);
  10030. decode(component, blockOffset);
  10031. }
  10032. function decodeBlock(component, decode, mcu) {
  10033. blockRow = mcu / component.blocksPerLine | 0;
  10034. const blockCol = mcu % component.blocksPerLine;
  10035. const blockOffset = getBlockBufferOffset(component, blockRow, blockCol);
  10036. decode(component, blockOffset);
  10037. }
  10038. const componentsLength = components.length;
  10039. let component, i, j, k, n;
  10040. let decodeFn;
  10041. if (progressive) {
  10042. if (spectralStart === 0) {
  10043. decodeFn = successivePrev === 0 ? decodeDCFirst : decodeDCSuccessive;
  10044. } else {
  10045. decodeFn = successivePrev === 0 ? decodeACFirst : decodeACSuccessive;
  10046. }
  10047. } else {
  10048. decodeFn = decodeBaseline;
  10049. }
  10050. let mcu = 0,
  10051. fileMarker;
  10052. const mcuExpected = componentsLength === 1 ? components[0].blocksPerLine * components[0].blocksPerColumn : mcusPerLine * frame.mcusPerColumn;
  10053. let h, v;
  10054. while (mcu <= mcuExpected) {
  10055. const mcuToRead = resetInterval ? Math.min(mcuExpected - mcu, resetInterval) : mcuExpected;
  10056. if (mcuToRead > 0) {
  10057. for (i = 0; i < componentsLength; i++) {
  10058. components[i].pred = 0;
  10059. }
  10060. eobrun = 0;
  10061. if (componentsLength === 1) {
  10062. component = components[0];
  10063. for (n = 0; n < mcuToRead; n++) {
  10064. decodeBlock(component, decodeFn, mcu);
  10065. mcu++;
  10066. }
  10067. } else {
  10068. for (n = 0; n < mcuToRead; n++) {
  10069. for (i = 0; i < componentsLength; i++) {
  10070. component = components[i];
  10071. h = component.h;
  10072. v = component.v;
  10073. for (j = 0; j < v; j++) {
  10074. for (k = 0; k < h; k++) {
  10075. decodeMcu(component, decodeFn, mcu, j, k);
  10076. }
  10077. }
  10078. }
  10079. mcu++;
  10080. }
  10081. }
  10082. }
  10083. bitsCount = 0;
  10084. fileMarker = findNextFileMarker(data, offset);
  10085. if (!fileMarker) {
  10086. break;
  10087. }
  10088. if (fileMarker.invalid) {
  10089. const partialMsg = mcuToRead > 0 ? "unexpected" : "excessive";
  10090. warn(`decodeScan - ${partialMsg} MCU data, current marker is: ${fileMarker.invalid}`);
  10091. offset = fileMarker.offset;
  10092. }
  10093. if (fileMarker.marker >= 0xffd0 && fileMarker.marker <= 0xffd7) {
  10094. offset += 2;
  10095. } else {
  10096. break;
  10097. }
  10098. }
  10099. return offset - startOffset;
  10100. }
  10101. function quantizeAndInverse(component, blockBufferOffset, p) {
  10102. const qt = component.quantizationTable,
  10103. blockData = component.blockData;
  10104. let v0, v1, v2, v3, v4, v5, v6, v7;
  10105. let p0, p1, p2, p3, p4, p5, p6, p7;
  10106. let t;
  10107. if (!qt) {
  10108. throw new JpegError("missing required Quantization Table.");
  10109. }
  10110. for (let row = 0; row < 64; row += 8) {
  10111. p0 = blockData[blockBufferOffset + row];
  10112. p1 = blockData[blockBufferOffset + row + 1];
  10113. p2 = blockData[blockBufferOffset + row + 2];
  10114. p3 = blockData[blockBufferOffset + row + 3];
  10115. p4 = blockData[blockBufferOffset + row + 4];
  10116. p5 = blockData[blockBufferOffset + row + 5];
  10117. p6 = blockData[blockBufferOffset + row + 6];
  10118. p7 = blockData[blockBufferOffset + row + 7];
  10119. p0 *= qt[row];
  10120. if ((p1 | p2 | p3 | p4 | p5 | p6 | p7) === 0) {
  10121. t = dctSqrt2 * p0 + 512 >> 10;
  10122. p[row] = t;
  10123. p[row + 1] = t;
  10124. p[row + 2] = t;
  10125. p[row + 3] = t;
  10126. p[row + 4] = t;
  10127. p[row + 5] = t;
  10128. p[row + 6] = t;
  10129. p[row + 7] = t;
  10130. continue;
  10131. }
  10132. p1 *= qt[row + 1];
  10133. p2 *= qt[row + 2];
  10134. p3 *= qt[row + 3];
  10135. p4 *= qt[row + 4];
  10136. p5 *= qt[row + 5];
  10137. p6 *= qt[row + 6];
  10138. p7 *= qt[row + 7];
  10139. v0 = dctSqrt2 * p0 + 128 >> 8;
  10140. v1 = dctSqrt2 * p4 + 128 >> 8;
  10141. v2 = p2;
  10142. v3 = p6;
  10143. v4 = dctSqrt1d2 * (p1 - p7) + 128 >> 8;
  10144. v7 = dctSqrt1d2 * (p1 + p7) + 128 >> 8;
  10145. v5 = p3 << 4;
  10146. v6 = p5 << 4;
  10147. v0 = v0 + v1 + 1 >> 1;
  10148. v1 = v0 - v1;
  10149. t = v2 * dctSin6 + v3 * dctCos6 + 128 >> 8;
  10150. v2 = v2 * dctCos6 - v3 * dctSin6 + 128 >> 8;
  10151. v3 = t;
  10152. v4 = v4 + v6 + 1 >> 1;
  10153. v6 = v4 - v6;
  10154. v7 = v7 + v5 + 1 >> 1;
  10155. v5 = v7 - v5;
  10156. v0 = v0 + v3 + 1 >> 1;
  10157. v3 = v0 - v3;
  10158. v1 = v1 + v2 + 1 >> 1;
  10159. v2 = v1 - v2;
  10160. t = v4 * dctSin3 + v7 * dctCos3 + 2048 >> 12;
  10161. v4 = v4 * dctCos3 - v7 * dctSin3 + 2048 >> 12;
  10162. v7 = t;
  10163. t = v5 * dctSin1 + v6 * dctCos1 + 2048 >> 12;
  10164. v5 = v5 * dctCos1 - v6 * dctSin1 + 2048 >> 12;
  10165. v6 = t;
  10166. p[row] = v0 + v7;
  10167. p[row + 7] = v0 - v7;
  10168. p[row + 1] = v1 + v6;
  10169. p[row + 6] = v1 - v6;
  10170. p[row + 2] = v2 + v5;
  10171. p[row + 5] = v2 - v5;
  10172. p[row + 3] = v3 + v4;
  10173. p[row + 4] = v3 - v4;
  10174. }
  10175. for (let col = 0; col < 8; ++col) {
  10176. p0 = p[col];
  10177. p1 = p[col + 8];
  10178. p2 = p[col + 16];
  10179. p3 = p[col + 24];
  10180. p4 = p[col + 32];
  10181. p5 = p[col + 40];
  10182. p6 = p[col + 48];
  10183. p7 = p[col + 56];
  10184. if ((p1 | p2 | p3 | p4 | p5 | p6 | p7) === 0) {
  10185. t = dctSqrt2 * p0 + 8192 >> 14;
  10186. if (t < -2040) {
  10187. t = 0;
  10188. } else if (t >= 2024) {
  10189. t = 255;
  10190. } else {
  10191. t = t + 2056 >> 4;
  10192. }
  10193. blockData[blockBufferOffset + col] = t;
  10194. blockData[blockBufferOffset + col + 8] = t;
  10195. blockData[blockBufferOffset + col + 16] = t;
  10196. blockData[blockBufferOffset + col + 24] = t;
  10197. blockData[blockBufferOffset + col + 32] = t;
  10198. blockData[blockBufferOffset + col + 40] = t;
  10199. blockData[blockBufferOffset + col + 48] = t;
  10200. blockData[blockBufferOffset + col + 56] = t;
  10201. continue;
  10202. }
  10203. v0 = dctSqrt2 * p0 + 2048 >> 12;
  10204. v1 = dctSqrt2 * p4 + 2048 >> 12;
  10205. v2 = p2;
  10206. v3 = p6;
  10207. v4 = dctSqrt1d2 * (p1 - p7) + 2048 >> 12;
  10208. v7 = dctSqrt1d2 * (p1 + p7) + 2048 >> 12;
  10209. v5 = p3;
  10210. v6 = p5;
  10211. v0 = (v0 + v1 + 1 >> 1) + 4112;
  10212. v1 = v0 - v1;
  10213. t = v2 * dctSin6 + v3 * dctCos6 + 2048 >> 12;
  10214. v2 = v2 * dctCos6 - v3 * dctSin6 + 2048 >> 12;
  10215. v3 = t;
  10216. v4 = v4 + v6 + 1 >> 1;
  10217. v6 = v4 - v6;
  10218. v7 = v7 + v5 + 1 >> 1;
  10219. v5 = v7 - v5;
  10220. v0 = v0 + v3 + 1 >> 1;
  10221. v3 = v0 - v3;
  10222. v1 = v1 + v2 + 1 >> 1;
  10223. v2 = v1 - v2;
  10224. t = v4 * dctSin3 + v7 * dctCos3 + 2048 >> 12;
  10225. v4 = v4 * dctCos3 - v7 * dctSin3 + 2048 >> 12;
  10226. v7 = t;
  10227. t = v5 * dctSin1 + v6 * dctCos1 + 2048 >> 12;
  10228. v5 = v5 * dctCos1 - v6 * dctSin1 + 2048 >> 12;
  10229. v6 = t;
  10230. p0 = v0 + v7;
  10231. p7 = v0 - v7;
  10232. p1 = v1 + v6;
  10233. p6 = v1 - v6;
  10234. p2 = v2 + v5;
  10235. p5 = v2 - v5;
  10236. p3 = v3 + v4;
  10237. p4 = v3 - v4;
  10238. if (p0 < 16) {
  10239. p0 = 0;
  10240. } else if (p0 >= 4080) {
  10241. p0 = 255;
  10242. } else {
  10243. p0 >>= 4;
  10244. }
  10245. if (p1 < 16) {
  10246. p1 = 0;
  10247. } else if (p1 >= 4080) {
  10248. p1 = 255;
  10249. } else {
  10250. p1 >>= 4;
  10251. }
  10252. if (p2 < 16) {
  10253. p2 = 0;
  10254. } else if (p2 >= 4080) {
  10255. p2 = 255;
  10256. } else {
  10257. p2 >>= 4;
  10258. }
  10259. if (p3 < 16) {
  10260. p3 = 0;
  10261. } else if (p3 >= 4080) {
  10262. p3 = 255;
  10263. } else {
  10264. p3 >>= 4;
  10265. }
  10266. if (p4 < 16) {
  10267. p4 = 0;
  10268. } else if (p4 >= 4080) {
  10269. p4 = 255;
  10270. } else {
  10271. p4 >>= 4;
  10272. }
  10273. if (p5 < 16) {
  10274. p5 = 0;
  10275. } else if (p5 >= 4080) {
  10276. p5 = 255;
  10277. } else {
  10278. p5 >>= 4;
  10279. }
  10280. if (p6 < 16) {
  10281. p6 = 0;
  10282. } else if (p6 >= 4080) {
  10283. p6 = 255;
  10284. } else {
  10285. p6 >>= 4;
  10286. }
  10287. if (p7 < 16) {
  10288. p7 = 0;
  10289. } else if (p7 >= 4080) {
  10290. p7 = 255;
  10291. } else {
  10292. p7 >>= 4;
  10293. }
  10294. blockData[blockBufferOffset + col] = p0;
  10295. blockData[blockBufferOffset + col + 8] = p1;
  10296. blockData[blockBufferOffset + col + 16] = p2;
  10297. blockData[blockBufferOffset + col + 24] = p3;
  10298. blockData[blockBufferOffset + col + 32] = p4;
  10299. blockData[blockBufferOffset + col + 40] = p5;
  10300. blockData[blockBufferOffset + col + 48] = p6;
  10301. blockData[blockBufferOffset + col + 56] = p7;
  10302. }
  10303. }
  10304. function buildComponentData(frame, component) {
  10305. const blocksPerLine = component.blocksPerLine;
  10306. const blocksPerColumn = component.blocksPerColumn;
  10307. const computationBuffer = new Int16Array(64);
  10308. for (let blockRow = 0; blockRow < blocksPerColumn; blockRow++) {
  10309. for (let blockCol = 0; blockCol < blocksPerLine; blockCol++) {
  10310. const offset = getBlockBufferOffset(component, blockRow, blockCol);
  10311. quantizeAndInverse(component, offset, computationBuffer);
  10312. }
  10313. }
  10314. return component.blockData;
  10315. }
  10316. function findNextFileMarker(data, currentPos, startPos = currentPos) {
  10317. const maxPos = data.length - 1;
  10318. let newPos = startPos < currentPos ? startPos : currentPos;
  10319. if (currentPos >= maxPos) {
  10320. return null;
  10321. }
  10322. const currentMarker = readUint16(data, currentPos);
  10323. if (currentMarker >= 0xffc0 && currentMarker <= 0xfffe) {
  10324. return {
  10325. invalid: null,
  10326. marker: currentMarker,
  10327. offset: currentPos
  10328. };
  10329. }
  10330. let newMarker = readUint16(data, newPos);
  10331. while (!(newMarker >= 0xffc0 && newMarker <= 0xfffe)) {
  10332. if (++newPos >= maxPos) {
  10333. return null;
  10334. }
  10335. newMarker = readUint16(data, newPos);
  10336. }
  10337. return {
  10338. invalid: currentMarker.toString(16),
  10339. marker: newMarker,
  10340. offset: newPos
  10341. };
  10342. }
  10343. class JpegImage {
  10344. constructor({
  10345. decodeTransform = null,
  10346. colorTransform = -1
  10347. } = {}) {
  10348. this._decodeTransform = decodeTransform;
  10349. this._colorTransform = colorTransform;
  10350. }
  10351. parse(data, {
  10352. dnlScanLines = null
  10353. } = {}) {
  10354. function readDataBlock() {
  10355. const length = readUint16(data, offset);
  10356. offset += 2;
  10357. let endOffset = offset + length - 2;
  10358. const fileMarker = findNextFileMarker(data, endOffset, offset);
  10359. if (fileMarker?.invalid) {
  10360. warn("readDataBlock - incorrect length, current marker is: " + fileMarker.invalid);
  10361. endOffset = fileMarker.offset;
  10362. }
  10363. const array = data.subarray(offset, endOffset);
  10364. offset += array.length;
  10365. return array;
  10366. }
  10367. function prepareComponents(frame) {
  10368. const mcusPerLine = Math.ceil(frame.samplesPerLine / 8 / frame.maxH);
  10369. const mcusPerColumn = Math.ceil(frame.scanLines / 8 / frame.maxV);
  10370. for (const component of frame.components) {
  10371. const blocksPerLine = Math.ceil(Math.ceil(frame.samplesPerLine / 8) * component.h / frame.maxH);
  10372. const blocksPerColumn = Math.ceil(Math.ceil(frame.scanLines / 8) * component.v / frame.maxV);
  10373. const blocksPerLineForMcu = mcusPerLine * component.h;
  10374. const blocksPerColumnForMcu = mcusPerColumn * component.v;
  10375. const blocksBufferSize = 64 * blocksPerColumnForMcu * (blocksPerLineForMcu + 1);
  10376. component.blockData = new Int16Array(blocksBufferSize);
  10377. component.blocksPerLine = blocksPerLine;
  10378. component.blocksPerColumn = blocksPerColumn;
  10379. }
  10380. frame.mcusPerLine = mcusPerLine;
  10381. frame.mcusPerColumn = mcusPerColumn;
  10382. }
  10383. let offset = 0;
  10384. let jfif = null;
  10385. let adobe = null;
  10386. let frame, resetInterval;
  10387. let numSOSMarkers = 0;
  10388. const quantizationTables = [];
  10389. const huffmanTablesAC = [],
  10390. huffmanTablesDC = [];
  10391. let fileMarker = readUint16(data, offset);
  10392. offset += 2;
  10393. if (fileMarker !== 0xffd8) {
  10394. throw new JpegError("SOI not found");
  10395. }
  10396. fileMarker = readUint16(data, offset);
  10397. offset += 2;
  10398. markerLoop: while (fileMarker !== 0xffd9) {
  10399. let i, j, l;
  10400. switch (fileMarker) {
  10401. case 0xffe0:
  10402. case 0xffe1:
  10403. case 0xffe2:
  10404. case 0xffe3:
  10405. case 0xffe4:
  10406. case 0xffe5:
  10407. case 0xffe6:
  10408. case 0xffe7:
  10409. case 0xffe8:
  10410. case 0xffe9:
  10411. case 0xffea:
  10412. case 0xffeb:
  10413. case 0xffec:
  10414. case 0xffed:
  10415. case 0xffee:
  10416. case 0xffef:
  10417. case 0xfffe:
  10418. const appData = readDataBlock();
  10419. if (fileMarker === 0xffe0) {
  10420. if (appData[0] === 0x4a && appData[1] === 0x46 && appData[2] === 0x49 && appData[3] === 0x46 && appData[4] === 0) {
  10421. jfif = {
  10422. version: {
  10423. major: appData[5],
  10424. minor: appData[6]
  10425. },
  10426. densityUnits: appData[7],
  10427. xDensity: appData[8] << 8 | appData[9],
  10428. yDensity: appData[10] << 8 | appData[11],
  10429. thumbWidth: appData[12],
  10430. thumbHeight: appData[13],
  10431. thumbData: appData.subarray(14, 14 + 3 * appData[12] * appData[13])
  10432. };
  10433. }
  10434. }
  10435. if (fileMarker === 0xffee) {
  10436. if (appData[0] === 0x41 && appData[1] === 0x64 && appData[2] === 0x6f && appData[3] === 0x62 && appData[4] === 0x65) {
  10437. adobe = {
  10438. version: appData[5] << 8 | appData[6],
  10439. flags0: appData[7] << 8 | appData[8],
  10440. flags1: appData[9] << 8 | appData[10],
  10441. transformCode: appData[11]
  10442. };
  10443. }
  10444. }
  10445. break;
  10446. case 0xffdb:
  10447. const quantizationTablesLength = readUint16(data, offset);
  10448. offset += 2;
  10449. const quantizationTablesEnd = quantizationTablesLength + offset - 2;
  10450. let z;
  10451. while (offset < quantizationTablesEnd) {
  10452. const quantizationTableSpec = data[offset++];
  10453. const tableData = new Uint16Array(64);
  10454. if (quantizationTableSpec >> 4 === 0) {
  10455. for (j = 0; j < 64; j++) {
  10456. z = dctZigZag[j];
  10457. tableData[z] = data[offset++];
  10458. }
  10459. } else if (quantizationTableSpec >> 4 === 1) {
  10460. for (j = 0; j < 64; j++) {
  10461. z = dctZigZag[j];
  10462. tableData[z] = readUint16(data, offset);
  10463. offset += 2;
  10464. }
  10465. } else {
  10466. throw new JpegError("DQT - invalid table spec");
  10467. }
  10468. quantizationTables[quantizationTableSpec & 15] = tableData;
  10469. }
  10470. break;
  10471. case 0xffc0:
  10472. case 0xffc1:
  10473. case 0xffc2:
  10474. if (frame) {
  10475. throw new JpegError("Only single frame JPEGs supported");
  10476. }
  10477. offset += 2;
  10478. frame = {};
  10479. frame.extended = fileMarker === 0xffc1;
  10480. frame.progressive = fileMarker === 0xffc2;
  10481. frame.precision = data[offset++];
  10482. const sofScanLines = readUint16(data, offset);
  10483. offset += 2;
  10484. frame.scanLines = dnlScanLines || sofScanLines;
  10485. frame.samplesPerLine = readUint16(data, offset);
  10486. offset += 2;
  10487. frame.components = [];
  10488. frame.componentIds = {};
  10489. const componentsCount = data[offset++];
  10490. let maxH = 0,
  10491. maxV = 0;
  10492. for (i = 0; i < componentsCount; i++) {
  10493. const componentId = data[offset];
  10494. const h = data[offset + 1] >> 4;
  10495. const v = data[offset + 1] & 15;
  10496. if (maxH < h) {
  10497. maxH = h;
  10498. }
  10499. if (maxV < v) {
  10500. maxV = v;
  10501. }
  10502. const qId = data[offset + 2];
  10503. l = frame.components.push({
  10504. h,
  10505. v,
  10506. quantizationId: qId,
  10507. quantizationTable: null
  10508. });
  10509. frame.componentIds[componentId] = l - 1;
  10510. offset += 3;
  10511. }
  10512. frame.maxH = maxH;
  10513. frame.maxV = maxV;
  10514. prepareComponents(frame);
  10515. break;
  10516. case 0xffc4:
  10517. const huffmanLength = readUint16(data, offset);
  10518. offset += 2;
  10519. for (i = 2; i < huffmanLength;) {
  10520. const huffmanTableSpec = data[offset++];
  10521. const codeLengths = new Uint8Array(16);
  10522. let codeLengthSum = 0;
  10523. for (j = 0; j < 16; j++, offset++) {
  10524. codeLengthSum += codeLengths[j] = data[offset];
  10525. }
  10526. const huffmanValues = new Uint8Array(codeLengthSum);
  10527. for (j = 0; j < codeLengthSum; j++, offset++) {
  10528. huffmanValues[j] = data[offset];
  10529. }
  10530. i += 17 + codeLengthSum;
  10531. (huffmanTableSpec >> 4 === 0 ? huffmanTablesDC : huffmanTablesAC)[huffmanTableSpec & 15] = buildHuffmanTable(codeLengths, huffmanValues);
  10532. }
  10533. break;
  10534. case 0xffdd:
  10535. offset += 2;
  10536. resetInterval = readUint16(data, offset);
  10537. offset += 2;
  10538. break;
  10539. case 0xffda:
  10540. const parseDNLMarker = ++numSOSMarkers === 1 && !dnlScanLines;
  10541. offset += 2;
  10542. const selectorsCount = data[offset++],
  10543. components = [];
  10544. for (i = 0; i < selectorsCount; i++) {
  10545. const index = data[offset++];
  10546. const componentIndex = frame.componentIds[index];
  10547. const component = frame.components[componentIndex];
  10548. component.index = index;
  10549. const tableSpec = data[offset++];
  10550. component.huffmanTableDC = huffmanTablesDC[tableSpec >> 4];
  10551. component.huffmanTableAC = huffmanTablesAC[tableSpec & 15];
  10552. components.push(component);
  10553. }
  10554. const spectralStart = data[offset++],
  10555. spectralEnd = data[offset++],
  10556. successiveApproximation = data[offset++];
  10557. try {
  10558. const processed = decodeScan(data, offset, frame, components, resetInterval, spectralStart, spectralEnd, successiveApproximation >> 4, successiveApproximation & 15, parseDNLMarker);
  10559. offset += processed;
  10560. } catch (ex) {
  10561. if (ex instanceof DNLMarkerError) {
  10562. warn(`${ex.message} -- attempting to re-parse the JPEG image.`);
  10563. return this.parse(data, {
  10564. dnlScanLines: ex.scanLines
  10565. });
  10566. } else if (ex instanceof EOIMarkerError) {
  10567. warn(`${ex.message} -- ignoring the rest of the image data.`);
  10568. break markerLoop;
  10569. }
  10570. throw ex;
  10571. }
  10572. break;
  10573. case 0xffdc:
  10574. offset += 4;
  10575. break;
  10576. case 0xffff:
  10577. if (data[offset] !== 0xff) {
  10578. offset--;
  10579. }
  10580. break;
  10581. default:
  10582. const nextFileMarker = findNextFileMarker(data, offset - 2, offset - 3);
  10583. if (nextFileMarker?.invalid) {
  10584. warn("JpegImage.parse - unexpected data, current marker is: " + nextFileMarker.invalid);
  10585. offset = nextFileMarker.offset;
  10586. break;
  10587. }
  10588. if (!nextFileMarker || offset >= data.length - 1) {
  10589. warn("JpegImage.parse - reached the end of the image data " + "without finding an EOI marker (0xFFD9).");
  10590. break markerLoop;
  10591. }
  10592. throw new JpegError("JpegImage.parse - unknown marker: " + fileMarker.toString(16));
  10593. }
  10594. fileMarker = readUint16(data, offset);
  10595. offset += 2;
  10596. }
  10597. if (!frame) {
  10598. throw new JpegError("JpegImage.parse - no frame data found.");
  10599. }
  10600. this.width = frame.samplesPerLine;
  10601. this.height = frame.scanLines;
  10602. this.jfif = jfif;
  10603. this.adobe = adobe;
  10604. this.components = [];
  10605. for (const component of frame.components) {
  10606. const quantizationTable = quantizationTables[component.quantizationId];
  10607. if (quantizationTable) {
  10608. component.quantizationTable = quantizationTable;
  10609. }
  10610. this.components.push({
  10611. index: component.index,
  10612. output: buildComponentData(frame, component),
  10613. scaleX: component.h / frame.maxH,
  10614. scaleY: component.v / frame.maxV,
  10615. blocksPerLine: component.blocksPerLine,
  10616. blocksPerColumn: component.blocksPerColumn
  10617. });
  10618. }
  10619. this.numComponents = this.components.length;
  10620. return undefined;
  10621. }
  10622. _getLinearizedBlockData(width, height, isSourcePDF = false) {
  10623. const scaleX = this.width / width,
  10624. scaleY = this.height / height;
  10625. let component, componentScaleX, componentScaleY, blocksPerScanline;
  10626. let x, y, i, j, k;
  10627. let index;
  10628. let offset = 0;
  10629. let output;
  10630. const numComponents = this.components.length;
  10631. const dataLength = width * height * numComponents;
  10632. const data = new Uint8ClampedArray(dataLength);
  10633. const xScaleBlockOffset = new Uint32Array(width);
  10634. const mask3LSB = 0xfffffff8;
  10635. let lastComponentScaleX;
  10636. for (i = 0; i < numComponents; i++) {
  10637. component = this.components[i];
  10638. componentScaleX = component.scaleX * scaleX;
  10639. componentScaleY = component.scaleY * scaleY;
  10640. offset = i;
  10641. output = component.output;
  10642. blocksPerScanline = component.blocksPerLine + 1 << 3;
  10643. if (componentScaleX !== lastComponentScaleX) {
  10644. for (x = 0; x < width; x++) {
  10645. j = 0 | x * componentScaleX;
  10646. xScaleBlockOffset[x] = (j & mask3LSB) << 3 | j & 7;
  10647. }
  10648. lastComponentScaleX = componentScaleX;
  10649. }
  10650. for (y = 0; y < height; y++) {
  10651. j = 0 | y * componentScaleY;
  10652. index = blocksPerScanline * (j & mask3LSB) | (j & 7) << 3;
  10653. for (x = 0; x < width; x++) {
  10654. data[offset] = output[index + xScaleBlockOffset[x]];
  10655. offset += numComponents;
  10656. }
  10657. }
  10658. }
  10659. let transform = this._decodeTransform;
  10660. if (!isSourcePDF && numComponents === 4 && !transform) {
  10661. transform = new Int32Array([-256, 255, -256, 255, -256, 255, -256, 255]);
  10662. }
  10663. if (transform) {
  10664. for (i = 0; i < dataLength;) {
  10665. for (j = 0, k = 0; j < numComponents; j++, i++, k += 2) {
  10666. data[i] = (data[i] * transform[k] >> 8) + transform[k + 1];
  10667. }
  10668. }
  10669. }
  10670. return data;
  10671. }
  10672. get _isColorConversionNeeded() {
  10673. if (this.adobe) {
  10674. return !!this.adobe.transformCode;
  10675. }
  10676. if (this.numComponents === 3) {
  10677. if (this._colorTransform === 0) {
  10678. return false;
  10679. } else if (this.components[0].index === 0x52 && this.components[1].index === 0x47 && this.components[2].index === 0x42) {
  10680. return false;
  10681. }
  10682. return true;
  10683. }
  10684. if (this._colorTransform === 1) {
  10685. return true;
  10686. }
  10687. return false;
  10688. }
  10689. _convertYccToRgb(data) {
  10690. let Y, Cb, Cr;
  10691. for (let i = 0, length = data.length; i < length; i += 3) {
  10692. Y = data[i];
  10693. Cb = data[i + 1];
  10694. Cr = data[i + 2];
  10695. data[i] = Y - 179.456 + 1.402 * Cr;
  10696. data[i + 1] = Y + 135.459 - 0.344 * Cb - 0.714 * Cr;
  10697. data[i + 2] = Y - 226.816 + 1.772 * Cb;
  10698. }
  10699. return data;
  10700. }
  10701. _convertYccToRgba(data, out) {
  10702. for (let i = 0, j = 0, length = data.length; i < length; i += 3, j += 4) {
  10703. const Y = data[i];
  10704. const Cb = data[i + 1];
  10705. const Cr = data[i + 2];
  10706. out[j] = Y - 179.456 + 1.402 * Cr;
  10707. out[j + 1] = Y + 135.459 - 0.344 * Cb - 0.714 * Cr;
  10708. out[j + 2] = Y - 226.816 + 1.772 * Cb;
  10709. out[j + 3] = 255;
  10710. }
  10711. return out;
  10712. }
  10713. _convertYcckToRgb(data) {
  10714. let Y, Cb, Cr, k;
  10715. let offset = 0;
  10716. for (let i = 0, length = data.length; i < length; i += 4) {
  10717. Y = data[i];
  10718. Cb = data[i + 1];
  10719. Cr = data[i + 2];
  10720. k = data[i + 3];
  10721. data[offset++] = -122.67195406894 + Cb * (-6.60635669420364e-5 * Cb + 0.000437130475926232 * Cr - 5.4080610064599e-5 * Y + 0.00048449797120281 * k - 0.154362151871126) + Cr * (-0.000957964378445773 * Cr + 0.000817076911346625 * Y - 0.00477271405408747 * k + 1.53380253221734) + Y * (0.000961250184130688 * Y - 0.00266257332283933 * k + 0.48357088451265) + k * (-0.000336197177618394 * k + 0.484791561490776);
  10722. data[offset++] = 107.268039397724 + Cb * (2.19927104525741e-5 * Cb - 0.000640992018297945 * Cr + 0.000659397001245577 * Y + 0.000426105652938837 * k - 0.176491792462875) + Cr * (-0.000778269941513683 * Cr + 0.00130872261408275 * Y + 0.000770482631801132 * k - 0.151051492775562) + Y * (0.00126935368114843 * Y - 0.00265090189010898 * k + 0.25802910206845) + k * (-0.000318913117588328 * k - 0.213742400323665);
  10723. data[offset++] = -20.810012546947 + Cb * (-0.000570115196973677 * Cb - 2.63409051004589e-5 * Cr + 0.0020741088115012 * Y - 0.00288260236853442 * k + 0.814272968359295) + Cr * (-1.53496057440975e-5 * Cr - 0.000132689043961446 * Y + 0.000560833691242812 * k - 0.195152027534049) + Y * (0.00174418132927582 * Y - 0.00255243321439347 * k + 0.116935020465145) + k * (-0.000343531996510555 * k + 0.24165260232407);
  10724. }
  10725. return data.subarray(0, offset);
  10726. }
  10727. _convertYcckToRgba(data) {
  10728. for (let i = 0, length = data.length; i < length; i += 4) {
  10729. const Y = data[i];
  10730. const Cb = data[i + 1];
  10731. const Cr = data[i + 2];
  10732. const k = data[i + 3];
  10733. data[i] = -122.67195406894 + Cb * (-6.60635669420364e-5 * Cb + 0.000437130475926232 * Cr - 5.4080610064599e-5 * Y + 0.00048449797120281 * k - 0.154362151871126) + Cr * (-0.000957964378445773 * Cr + 0.000817076911346625 * Y - 0.00477271405408747 * k + 1.53380253221734) + Y * (0.000961250184130688 * Y - 0.00266257332283933 * k + 0.48357088451265) + k * (-0.000336197177618394 * k + 0.484791561490776);
  10734. data[i + 1] = 107.268039397724 + Cb * (2.19927104525741e-5 * Cb - 0.000640992018297945 * Cr + 0.000659397001245577 * Y + 0.000426105652938837 * k - 0.176491792462875) + Cr * (-0.000778269941513683 * Cr + 0.00130872261408275 * Y + 0.000770482631801132 * k - 0.151051492775562) + Y * (0.00126935368114843 * Y - 0.00265090189010898 * k + 0.25802910206845) + k * (-0.000318913117588328 * k - 0.213742400323665);
  10735. data[i + 2] = -20.810012546947 + Cb * (-0.000570115196973677 * Cb - 2.63409051004589e-5 * Cr + 0.0020741088115012 * Y - 0.00288260236853442 * k + 0.814272968359295) + Cr * (-1.53496057440975e-5 * Cr - 0.000132689043961446 * Y + 0.000560833691242812 * k - 0.195152027534049) + Y * (0.00174418132927582 * Y - 0.00255243321439347 * k + 0.116935020465145) + k * (-0.000343531996510555 * k + 0.24165260232407);
  10736. data[i + 3] = 255;
  10737. }
  10738. return data;
  10739. }
  10740. _convertYcckToCmyk(data) {
  10741. let Y, Cb, Cr;
  10742. for (let i = 0, length = data.length; i < length; i += 4) {
  10743. Y = data[i];
  10744. Cb = data[i + 1];
  10745. Cr = data[i + 2];
  10746. data[i] = 434.456 - Y - 1.402 * Cr;
  10747. data[i + 1] = 119.541 - Y + 0.344 * Cb + 0.714 * Cr;
  10748. data[i + 2] = 481.816 - Y - 1.772 * Cb;
  10749. }
  10750. return data;
  10751. }
  10752. _convertCmykToRgb(data) {
  10753. let c, m, y, k;
  10754. let offset = 0;
  10755. for (let i = 0, length = data.length; i < length; i += 4) {
  10756. c = data[i];
  10757. m = data[i + 1];
  10758. y = data[i + 2];
  10759. k = data[i + 3];
  10760. data[offset++] = 255 + c * (-0.00006747147073602441 * c + 0.0008379262121013727 * m + 0.0002894718188643294 * y + 0.003264231057537806 * k - 1.1185611867203937) + m * (0.000026374107616089405 * m - 0.00008626949158638572 * y - 0.0002748769067499491 * k - 0.02155688794978967) + y * (-0.00003878099212869363 * y - 0.0003267808279485286 * k + 0.0686742238595345) - k * (0.0003361971776183937 * k + 0.7430659151342254);
  10761. data[offset++] = 255 + c * (0.00013596372813588848 * c + 0.000924537132573585 * m + 0.00010567359618683593 * y + 0.0004791864687436512 * k - 0.3109689587515875) + m * (-0.00023545346108370344 * m + 0.0002702845253534714 * y + 0.0020200308977307156 * k - 0.7488052167015494) + y * (0.00006834815998235662 * y + 0.00015168452363460973 * k - 0.09751927774728933) - k * (0.0003189131175883281 * k + 0.7364883807733168);
  10762. data[offset++] = 255 + c * (0.000013598650411385307 * c + 0.00012423956175490851 * m + 0.0004751985097583589 * y - 0.0000036729317476630422 * k - 0.05562186980264034) + m * (0.00016141380598724676 * m + 0.0009692239130725186 * y + 0.0007782692450036253 * k - 0.44015232367526463) + y * (5.068882914068769e-7 * y + 0.0017778369011375071 * k - 0.7591454649749609) - k * (0.0003435319965105553 * k + 0.7063770186160144);
  10763. }
  10764. return data.subarray(0, offset);
  10765. }
  10766. _convertCmykToRgba(data) {
  10767. for (let i = 0, length = data.length; i < length; i += 4) {
  10768. const c = data[i];
  10769. const m = data[i + 1];
  10770. const y = data[i + 2];
  10771. const k = data[i + 3];
  10772. data[i] = 255 + c * (-0.00006747147073602441 * c + 0.0008379262121013727 * m + 0.0002894718188643294 * y + 0.003264231057537806 * k - 1.1185611867203937) + m * (0.000026374107616089405 * m - 0.00008626949158638572 * y - 0.0002748769067499491 * k - 0.02155688794978967) + y * (-0.00003878099212869363 * y - 0.0003267808279485286 * k + 0.0686742238595345) - k * (0.0003361971776183937 * k + 0.7430659151342254);
  10773. data[i + 1] = 255 + c * (0.00013596372813588848 * c + 0.000924537132573585 * m + 0.00010567359618683593 * y + 0.0004791864687436512 * k - 0.3109689587515875) + m * (-0.00023545346108370344 * m + 0.0002702845253534714 * y + 0.0020200308977307156 * k - 0.7488052167015494) + y * (0.00006834815998235662 * y + 0.00015168452363460973 * k - 0.09751927774728933) - k * (0.0003189131175883281 * k + 0.7364883807733168);
  10774. data[i + 2] = 255 + c * (0.000013598650411385307 * c + 0.00012423956175490851 * m + 0.0004751985097583589 * y - 0.0000036729317476630422 * k - 0.05562186980264034) + m * (0.00016141380598724676 * m + 0.0009692239130725186 * y + 0.0007782692450036253 * k - 0.44015232367526463) + y * (5.068882914068769e-7 * y + 0.0017778369011375071 * k - 0.7591454649749609) - k * (0.0003435319965105553 * k + 0.7063770186160144);
  10775. data[i + 3] = 255;
  10776. }
  10777. return data;
  10778. }
  10779. getData({
  10780. width,
  10781. height,
  10782. forceRGBA = false,
  10783. forceRGB = false,
  10784. isSourcePDF = false
  10785. }) {
  10786. if (this.numComponents > 4) {
  10787. throw new JpegError("Unsupported color mode");
  10788. }
  10789. const data = this._getLinearizedBlockData(width, height, isSourcePDF);
  10790. if (this.numComponents === 1 && (forceRGBA || forceRGB)) {
  10791. const len = data.length * (forceRGBA ? 4 : 3);
  10792. const rgbaData = new Uint8ClampedArray(len);
  10793. let offset = 0;
  10794. if (forceRGBA) {
  10795. grayToRGBA(data, new Uint32Array(rgbaData.buffer));
  10796. } else {
  10797. for (const grayColor of data) {
  10798. rgbaData[offset++] = grayColor;
  10799. rgbaData[offset++] = grayColor;
  10800. rgbaData[offset++] = grayColor;
  10801. }
  10802. }
  10803. return rgbaData;
  10804. } else if (this.numComponents === 3 && this._isColorConversionNeeded) {
  10805. if (forceRGBA) {
  10806. const rgbaData = new Uint8ClampedArray(data.length / 3 * 4);
  10807. return this._convertYccToRgba(data, rgbaData);
  10808. }
  10809. return this._convertYccToRgb(data);
  10810. } else if (this.numComponents === 4) {
  10811. if (this._isColorConversionNeeded) {
  10812. if (forceRGBA) {
  10813. return this._convertYcckToRgba(data);
  10814. }
  10815. if (forceRGB) {
  10816. return this._convertYcckToRgb(data);
  10817. }
  10818. return this._convertYcckToCmyk(data);
  10819. } else if (forceRGBA) {
  10820. return this._convertCmykToRgba(data);
  10821. } else if (forceRGB) {
  10822. return this._convertCmykToRgb(data);
  10823. }
  10824. }
  10825. return data;
  10826. }
  10827. }
  10828. ;// ./src/core/jpeg_stream.js
  10829. class JpegStream extends DecodeStream {
  10830. constructor(stream, maybeLength, params) {
  10831. super(maybeLength);
  10832. this.stream = stream;
  10833. this.dict = stream.dict;
  10834. this.maybeLength = maybeLength;
  10835. this.params = params;
  10836. }
  10837. get bytes() {
  10838. return shadow(this, "bytes", this.stream.getBytes(this.maybeLength));
  10839. }
  10840. ensureBuffer(requested) {}
  10841. readBlock() {
  10842. this.decodeImage();
  10843. }
  10844. decodeImage(bytes) {
  10845. if (this.eof) {
  10846. return this.buffer;
  10847. }
  10848. bytes ||= this.bytes;
  10849. for (let i = 0, ii = bytes.length - 1; i < ii; i++) {
  10850. if (bytes[i] === 0xff && bytes[i + 1] === 0xd8) {
  10851. if (i > 0) {
  10852. bytes = bytes.subarray(i);
  10853. }
  10854. break;
  10855. }
  10856. }
  10857. const jpegOptions = {
  10858. decodeTransform: undefined,
  10859. colorTransform: undefined
  10860. };
  10861. const decodeArr = this.dict.getArray("D", "Decode");
  10862. if ((this.forceRGBA || this.forceRGB) && Array.isArray(decodeArr)) {
  10863. const bitsPerComponent = this.dict.get("BPC", "BitsPerComponent") || 8;
  10864. const decodeArrLength = decodeArr.length;
  10865. const transform = new Int32Array(decodeArrLength);
  10866. let transformNeeded = false;
  10867. const maxValue = (1 << bitsPerComponent) - 1;
  10868. for (let i = 0; i < decodeArrLength; i += 2) {
  10869. transform[i] = (decodeArr[i + 1] - decodeArr[i]) * 256 | 0;
  10870. transform[i + 1] = decodeArr[i] * maxValue | 0;
  10871. if (transform[i] !== 256 || transform[i + 1] !== 0) {
  10872. transformNeeded = true;
  10873. }
  10874. }
  10875. if (transformNeeded) {
  10876. jpegOptions.decodeTransform = transform;
  10877. }
  10878. }
  10879. if (this.params instanceof Dict) {
  10880. const colorTransform = this.params.get("ColorTransform");
  10881. if (Number.isInteger(colorTransform)) {
  10882. jpegOptions.colorTransform = colorTransform;
  10883. }
  10884. }
  10885. const jpegImage = new JpegImage(jpegOptions);
  10886. jpegImage.parse(bytes);
  10887. const data = jpegImage.getData({
  10888. width: this.drawWidth,
  10889. height: this.drawHeight,
  10890. forceRGBA: this.forceRGBA,
  10891. forceRGB: this.forceRGB,
  10892. isSourcePDF: true
  10893. });
  10894. this.buffer = data;
  10895. this.bufferLength = data.length;
  10896. this.eof = true;
  10897. return this.buffer;
  10898. }
  10899. get canAsyncDecodeImageFromBuffer() {
  10900. return this.stream.isAsync;
  10901. }
  10902. }
  10903. // EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-exception.stack.js
  10904. var web_dom_exception_stack = __webpack_require__(4979);
  10905. ;// ./external/openjpeg/openjpeg.js
  10906. var OpenJPEG = (() => {
  10907. var _scriptName = typeof document != 'undefined' ? document.currentScript?.src : undefined;
  10908. return function (moduleArg = {}) {
  10909. var moduleRtn;
  10910. var Module = moduleArg;
  10911. var readyPromiseResolve, readyPromiseReject;
  10912. var readyPromise = new Promise((resolve, reject) => {
  10913. readyPromiseResolve = resolve;
  10914. readyPromiseReject = reject;
  10915. });
  10916. var ENVIRONMENT_IS_WEB = true;
  10917. var ENVIRONMENT_IS_WORKER = false;
  10918. Module.decode = function (bytes, {
  10919. numComponents = 4,
  10920. isIndexedColormap = false,
  10921. smaskInData = false
  10922. }) {
  10923. const size = bytes.length;
  10924. const ptr = Module._malloc(size);
  10925. Module.HEAPU8.set(bytes, ptr);
  10926. const ret = Module._jp2_decode(ptr, size, numComponents > 0 ? numComponents : 0, !!isIndexedColormap, !!smaskInData);
  10927. Module._free(ptr);
  10928. if (ret) {
  10929. const {
  10930. errorMessages: errorMessages
  10931. } = Module;
  10932. if (errorMessages) {
  10933. delete Module.errorMessages;
  10934. return errorMessages;
  10935. }
  10936. return "Unknown error";
  10937. }
  10938. const {
  10939. imageData: imageData
  10940. } = Module;
  10941. Module.imageData = null;
  10942. return imageData;
  10943. };
  10944. var moduleOverrides = Object.assign({}, Module);
  10945. var arguments_ = [];
  10946. var thisProgram = "./this.program";
  10947. var quit_ = (status, toThrow) => {
  10948. throw toThrow;
  10949. };
  10950. var scriptDirectory = "";
  10951. var read_, readAsync, readBinary;
  10952. if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {
  10953. if (ENVIRONMENT_IS_WORKER) {
  10954. scriptDirectory = self.location.href;
  10955. } else if (typeof document != "undefined" && document.currentScript) {
  10956. scriptDirectory = document.currentScript.src;
  10957. }
  10958. if (_scriptName) {
  10959. scriptDirectory = _scriptName;
  10960. }
  10961. if (scriptDirectory.startsWith("blob:")) {
  10962. scriptDirectory = "";
  10963. } else {
  10964. scriptDirectory = scriptDirectory.substr(0, scriptDirectory.replace(/[?#].*/, "").lastIndexOf("/") + 1);
  10965. }
  10966. read_ = url => {
  10967. var xhr = new XMLHttpRequest();
  10968. xhr.open("GET", url, false);
  10969. xhr.send(null);
  10970. return xhr.responseText;
  10971. };
  10972. if (ENVIRONMENT_IS_WORKER) {
  10973. readBinary = url => {
  10974. var xhr = new XMLHttpRequest();
  10975. xhr.open("GET", url, false);
  10976. xhr.responseType = "arraybuffer";
  10977. xhr.send(null);
  10978. return new Uint8Array(xhr.response);
  10979. };
  10980. }
  10981. readAsync = (url, onload, onerror) => {
  10982. fetch(url, {
  10983. credentials: "same-origin"
  10984. }).then(response => {
  10985. if (response.ok) {
  10986. return response.arrayBuffer();
  10987. }
  10988. return Promise.reject(new Error(response.status + " : " + response.url));
  10989. }).then(onload, onerror);
  10990. };
  10991. } else {}
  10992. var out = Module["print"] || console.log.bind(console);
  10993. var err = Module["printErr"] || console.error.bind(console);
  10994. Object.assign(Module, moduleOverrides);
  10995. moduleOverrides = null;
  10996. if (Module["arguments"]) arguments_ = Module["arguments"];
  10997. if (Module["thisProgram"]) thisProgram = Module["thisProgram"];
  10998. if (Module["quit"]) quit_ = Module["quit"];
  10999. var wasmBinary;
  11000. if (Module["wasmBinary"]) wasmBinary = Module["wasmBinary"];
  11001. function intArrayFromBase64(s) {
  11002. var decoded = atob(s);
  11003. var bytes = new Uint8Array(decoded.length);
  11004. for (var i = 0; i < decoded.length; ++i) {
  11005. bytes[i] = decoded.charCodeAt(i);
  11006. }
  11007. return bytes;
  11008. }
  11009. function tryParseAsDataURI(filename) {
  11010. if (!isDataURI(filename)) {
  11011. return;
  11012. }
  11013. return intArrayFromBase64(filename.slice(dataURIPrefix.length));
  11014. }
  11015. var wasmMemory;
  11016. var ABORT = false;
  11017. var HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64;
  11018. function updateMemoryViews() {
  11019. var b = wasmMemory.buffer;
  11020. Module["HEAP8"] = HEAP8 = new Int8Array(b);
  11021. Module["HEAP16"] = HEAP16 = new Int16Array(b);
  11022. Module["HEAPU8"] = HEAPU8 = new Uint8Array(b);
  11023. Module["HEAPU16"] = HEAPU16 = new Uint16Array(b);
  11024. Module["HEAP32"] = HEAP32 = new Int32Array(b);
  11025. Module["HEAPU32"] = HEAPU32 = new Uint32Array(b);
  11026. Module["HEAPF32"] = HEAPF32 = new Float32Array(b);
  11027. Module["HEAPF64"] = HEAPF64 = new Float64Array(b);
  11028. }
  11029. var __ATPRERUN__ = [];
  11030. var __ATINIT__ = [];
  11031. var __ATPOSTRUN__ = [];
  11032. var runtimeInitialized = false;
  11033. function preRun() {
  11034. if (Module["preRun"]) {
  11035. if (typeof Module["preRun"] == "function") Module["preRun"] = [Module["preRun"]];
  11036. while (Module["preRun"].length) {
  11037. addOnPreRun(Module["preRun"].shift());
  11038. }
  11039. }
  11040. callRuntimeCallbacks(__ATPRERUN__);
  11041. }
  11042. function initRuntime() {
  11043. runtimeInitialized = true;
  11044. callRuntimeCallbacks(__ATINIT__);
  11045. }
  11046. function postRun() {
  11047. if (Module["postRun"]) {
  11048. if (typeof Module["postRun"] == "function") Module["postRun"] = [Module["postRun"]];
  11049. while (Module["postRun"].length) {
  11050. addOnPostRun(Module["postRun"].shift());
  11051. }
  11052. }
  11053. callRuntimeCallbacks(__ATPOSTRUN__);
  11054. }
  11055. function addOnPreRun(cb) {
  11056. __ATPRERUN__.unshift(cb);
  11057. }
  11058. function addOnInit(cb) {
  11059. __ATINIT__.unshift(cb);
  11060. }
  11061. function addOnPostRun(cb) {
  11062. __ATPOSTRUN__.unshift(cb);
  11063. }
  11064. var runDependencies = 0;
  11065. var runDependencyWatcher = null;
  11066. var dependenciesFulfilled = null;
  11067. function addRunDependency(id) {
  11068. runDependencies++;
  11069. Module["monitorRunDependencies"]?.(runDependencies);
  11070. }
  11071. function removeRunDependency(id) {
  11072. runDependencies--;
  11073. Module["monitorRunDependencies"]?.(runDependencies);
  11074. if (runDependencies == 0) {
  11075. if (runDependencyWatcher !== null) {
  11076. clearInterval(runDependencyWatcher);
  11077. runDependencyWatcher = null;
  11078. }
  11079. if (dependenciesFulfilled) {
  11080. var callback = dependenciesFulfilled;
  11081. dependenciesFulfilled = null;
  11082. callback();
  11083. }
  11084. }
  11085. }
  11086. var dataURIPrefix = "data:application/octet-stream;base64,";
  11087. var isDataURI = filename => filename.startsWith(dataURIPrefix);
  11088. function findWasmBinary() {
  11089. var f = "data:application/octet-stream;base64,AGFzbQEAAAABzgEaYAN/f38Bf2AEf39/fwF/YAF/AGACf38AYAF/AX9gA39/fwBgAn9/AX9gBH9/f38AYAN/fn8BfmAFf39/f38Bf2ACfn8Bf2ACfn8BfmAFf39/f38AYAN/fn8Bf2AAAX9gB39/f39/f38Bf2AJf39/f39/f39/AX9gC39/f39/f39/f39/AX9gBn9/f39/fwF/YAZ/fH9/f38Bf2AIf39/f39/f38AYAh/f39/f39/fwF/YAAAYAZ/f39/f38AYAd/f39/f39/AGACfH8BfAJbDwFhAWEAAgFhAWIAAQFhAWMABQFh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ASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgACADQQRrIgRLBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAswAQF/AkAgAEUNACABRQ0AQQggACABbCIBECUiAARAIABBACABEBUaCyAAIQILIAILEQAgAEUEQEEADwtBCCAAECUL8gICAn8BfgJAIAJFDQAgACABOgAAIAAgAmoiA0EBayABOgAAIAJBA0kNACAAIAE6AAIgACABOgABIANBA2sgAToAACADQQJrIAE6AAAgAkEHSQ0AIAAgAToAAyADQQRrIAE6AAAgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBBGsgATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQQhrIAE2AgAgAkEMayABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkEQayABNgIAIAJBFGsgATYCACACQRhrIAE2AgAgAkEcayABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa1CgYCAgBB+IQUgAyAEaiEBA0AgASAFNwMYIAEgBTcDECABIAU3AwggASAFNwMAIAFBIGohASACQSBrIgJBH0sNAAsLIAALJwEBfyMAQRBrIgMkACADIAI2AgwgACABIAJBAEEAEGsgA0EQaiQAC+gFAQl/IAFFBEBBAA8LAn8gAEUEQEEIIAEQJQwBCyABRQRAIAAQEEEADAELAkAgAUFHSw0AIA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gQygCACABIENqICYgBhsoAgBqQQJqIQYgASApaiEBDAILIBQgAUECdCIBaiIGIAYoAgAgCkEBdEECakECdWs2AgAgASAkaiIGIAYoAgAgFCgCFEEBdEECakECdWs2AgAgASAqaiIGIAYoAgAgFCgCGEEBdEECakECdWs2AgAgASApaiEBIBQoAhxBAXRBAmohBgwBCyAUIAcgLCAGG0EDdEEEa0ECdCIKaigCACEyIAZFBEAgFCABQQJ0IgFqIgYgBigCACAyIEUoAgBqQQJqQQJ1azYCACABICRqIgYgBigCACAKICRqKAIAIDwoAgBqQQJqQQJ1azYCACABICpqIgYgBigCACAKICpqKAIAIDooAgBqQQJqQQJ1azYCACABIClqIQEgCiApaigCACAmKAIAakECaiEGDAELIBQgAUECdCIBaiIGIAYoAgAgMiAGKAIQakECakECdWs2AgAgASAkaiIGIAYoAgAgCiAkaigCACAGKAIQakECakECdWs2AgAgASAqaiIGIAYoAgAgCiAqaigCACAGKAIQakECakECdWs2AgAgCiApaigCACABIClqIgEoAhBqQQJqIQYLIAEgASgCACAGQQJ1azYCACAHQQFqIgcgG0cNAAsLIA4gHE4NACAMIA4iASIHSgRAA0AgFCABQQV0aiIHIAf9AAIgIAf9AAIA/a4BQQH9rAEgB/0AAhD9rgH9CwIQIAFBAWoiASAMRw0ACyAMIQcLIAcgHE4NAANAIEMgB0EDdCIBQQJ0aiIyAn8gB0EASARAIBQoAgAhBiAHQX9HBEAgNiABQQJ0IgFqIgogCigCACAGajYCACABICBqIgYgBigCACAkKAIAajYCACABIB9qIgEgASgCACAqKAIAajYCACApKAIADAILIDYgAUECdCIBaiIKIAooAgAgVygCACAGakEBdWo2AgAgASAgaiIGIAYoAgAgVigCACAkKAIAakEBdWo2AgAgASAfaiIBIAEoAgAgVSgCACAqKAIAakEBdWo2AgAgVCgCACApKAIAakEBdQwBCyABID4gByASSBshBiASIAdBAWoiZkwEQCA2IAFBAnQiCmoiASABKAIAIGsoAgAgFCAGQQJ0aiIBKAIAakEBdWo2AgAgCiAgaiI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eGIg9CAX0iCCAJIAKsIhB8IBB/xHwgB4enIAggC8R8IAeHp2siAkEASARAIAMgAjYCBCADIAQ2AgAgAUEBQdPkACADEA9BACECDAMLIAAgAjYCCCAIIAogBqwiC3wgC3/EfCAHh6cgDsQgD3xCAX0gB4enayICQQBIBEAgAyACNgIUIAMgBDYCECABQQFBmOUAIANBEGoQD0EAIQIMAwsgACACNgIMIABBNGohAEEBIQIgBEEBaiIEIAVHDQALDAELIAFBAUGnM0EAEA8LIANBIGokACACC9cGAQZ/IAAEQAJAIAAoAgAEQCAAKAIMIgEEQCABEC4gACgCDBAQIABBADYCDAsgACgCECIBBEAgARAQIABCADcDEAsgACgCQBAQIABCADcCPAwBCyAAKAIsIgEEQCABEBAgAEEANgIsCyAAKAIgIgEEQCABEBAgAEIANwMgCyAAKAI0IgFFDQAgARAQIABCADcCNAsgACgC0AEQVSAAKAKcASIBBEAgACgCaCAAKAJsbCIDBH8DQCABEC4gAUGMLGohASACQQFqIgIgA0cNAAsgACgCnAEFIAELEBAgAEEANgKcAQsgACgCdCIBBEAgACgCcCICBEBBACEBA0AgACgCdCABQQN0aigCACIDBEAgAxAQIAAoAnAhAgsgAUEBaiIBIAJJDQALIAAoAnQhAQsgAEEANgJwIAEQECAAQQA2AnQLIAAoAogBEBAgAEEANgJ4IABBADYCiAEgACgCZBAQIABBADYCZCAALQC8AUECcUUEQCAAKAKoARAQCyAAQdAAakEAQfAAEBUaIAAoAsABEDIgAEEANgLAASAAKALEARAyIABBADYCwAEgACgCyAEiAQRAIAEoAhwiAgRAIAIQECABQQA2AhwLIAEoAigiAgRAIAEoAiQEQANAIAIgBUEobCIDaigCJCIEBEAgBBAQIAEoAigiAiADakEANgIkCyACIANqKAIQIgQEQCAEEBAgASgCKCICIANqQQA2AhALIAIgA2ooAhgiBARAIAQQECABKAIoIgIgA2pBADYCGAsgBUEBaiIFIAEoAiRJDQALCyACEBAgAUEANgIoCyABEBALIABBADYCyAEgACgCSBAhIABBADYCSCAAKAJM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gACgCwAEiBigCACEEIAYoAgghBQJAIAQEQEEBIQcgBEEBcSEIIARBAUYEf0EABSAEQX5xIQlBACEEA0ACf0EAIAdFDQAaQQAgACABIAMgBSgCABEAAEUNABogACABIAMgBSgCBBEAAEEARwshByAFQQhqIQUgBEECaiIEIAlHDQALIAdBAXMLIQQCQAJAIAgEQCAEDQEgACABIAMgBSgCABEAAEEARyEHCyAGQQA2AgAgB0EBcUUNAQwDCyAGQQA2AgALIAAoAkgQISAAQQA2AkhBAA8LIAZBADYCAAsgACACEEchBwsgBwv4BAEGfwJAQQFBMBATIgIEfyACIAAoAsgBIgH9AAMA/QsDACACIAEpAxA3AxAgAiABKAIYIgE2AhggAiABQRhsEBQiATYCHCABRQRAIAIQEEEADwsCQCAAKALIASgCHCIDBEAgASADIAIoAhhBGGwQEhoMAQsgARAQIAJBADYCHAsgAiAAKALIASgCJCIBNgIkIAIgAUEoEBMiATYCKCABRQRAIAIoAhwQECACEBBBAA8LAkAgACgCyAEoAigEQCACKAIkRQ0BA0AgASAFQShsIgNqIAAoAsgBKAIoIANqKAIUIgE2AhQgAUEYbBAUIQEgAigCKCIEIANqIgYgATYCGCABRQRAIAUEf0EAIQEDQCACKAIoIAFBKGxqKAIYEBAgAUEBaiIBIAVHDQALIAIoAigFIAQLEBAMBQsCQCAAKALIASgCKCADaigCGCIEBEAgASAEIAYoAhRBGGwQEhogAigCKCEBDAELIAEQECACKAIoIgEgA2pBADYCGAsgASADaiAAKALIASgCKCADaigCBCIBNgIEIAFBGGwQFCEBIAIoAigiBCADaiIGIAE2AhAgAUUEQCAFBH9BACEBA0AgAUEobCIAIAIoAihqKAIYEBAgAigCKCAAaigCEBAQIAFBAWoiASAFRw0ACyACKAIoBSAECxAQDAULAkAgACgCyAEoAiggA2ooAhAiBARAIAEgBCAGKAIEQRhsEBIaIAIoAighAQwBCyABEBAgAigCKCIBIANqQQA2AhALIAEgA2pCADcCICAFQQFqIgUgAigCJEkNAAsMAQsgARAQIAJBADYCKAsg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QAgAUEETwRAIAFBfHEhAwNAIABBADYCPCAAQucHNwI0IABBADYCLCAAQucHNwIkIABBADYCHCAAQucHNwIUIABBADYCDCAAQucHNwIEIABBQGshACACQQRqIgIgA0cNAAsLIAFBA3EiAUUNAEEAIQIDQCAAQQA2AgwgAELnBzcCBCAAQRBqIQAgAkEBaiICIAFHDQALCwv7BQEQfyMAQYACayIIJAACf0EBQRQQEyIGRQRAIAJBAUH0MEEAEA9BAAwBCyAGIAE2AgQgBiAANgIAIAggATYCACAIIAA2AoABA0AgCCAFIg1BAWoiBUECdCIHaiABQQFqQQJtIgM2AgAgCEGAAWogB2ogAEEBakECbSIHNgIAIAQgACABbCIJaiEEIAMhASAHIQAgCUEBSw0ACyAGIAQ2AgggBEUEQCAGEBBBAAwBCyAGIARBEBATIgM2AgwgA0UEQCACQQFB2hpBABAPIAYQEEEADAELIAYgBigCCCILQQR0NgIQIAMhACANBEAgAyAGKAIEIAYoAgBsQQR0aiIEIQEDQAJAIAggDkECdCICaigCACIJQQBMDQAgCUEBayEMQQAhBwJAIAhBgAFqIAJqKAIAIgJBAEwEQEEAIQUgCUEBRwRAIAlB/v///wdxIQoDQCAFIAxGIQ8gBUECaiEFIAEgBCAPGyIEIQEgB0ECaiIHIApHDQALCyAJQQFxDQEgBCEBDAILA0AgBCEFIAIhBANAAkAgACABNgIAIARBAUYEQCAAQRBqIQAgAUEQaiEBDAELIAAgATYCECABQRBqIQEgAEEgaiEAIARBAkohECAEQQJrIQQgEA0BCwsgASAFIAJBBHRqIAcgByAMRnJBAXEiChshBCABIAUgChshASAHQQFqIgcgCUcNAAsMAQsgASAEIAJBBHRqIAUgBSAMRnJBAXEiBRshESABIAQgBRshASARIQQLIA5BAWoiDiANRw0ACwsgAEEANgIAAkAgC0UNACALQQRPBEAgC0F8cSEAQQAhAQNAIANBADYCPCADQucHNwI0IANBADYCLCADQucHNwIkIANBADYCHCADQucHNwIUIANBADYCDCADQucHNwIEIANBQGshAyABQQRqIgEgAEcNAAs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KwMAOQMADwsgACACIAMRAwALDwsgAiACKAIAIgFBBGo2AgAgACABNAIANwMADwsgAiACKAIAIgFBBGo2AgAgACABNQIANwMADwsgAiACKAIAQQdqQXhxIgFBCGo2AgAgACABKQMANwMAC3MBBn8gACgCACIDLAAAQTBrIgFBCUsEQEEADwsDQEF/IQQgAkHMmbPmAE0EQEF/IAEgAkEKbCIFaiABIAVB/////wdzSxshBAsgACADQQFqIgU2AgAgAywAASEGIAQhAiAFIQMgBkEwayIBQQpJDQALIAILtBQCFX8BfiMAQUBqIggkACAIIAE2AjwgCEEnaiEWIAhBKGohEQJAAkACQAJAA0BBACEHA0AgASENIAcgDkH/////B3NKDQIgByAOaiEOAkACQAJAAkAgASIHLQAAIgsEQANAAkACQCALQf8BcSIBRQRAIAchAQwBCyABQSVHDQEgByELA0AgCy0AAUElRwRAIAshAQwCCyAHQQFqIQcgCy0AAiEZIAtBAmoiASELIBlBJUYNAAsLIAcgDWsiByAOQf////8HcyIXSg0JIAAEQCAAIA0gBxAZCyAHDQcgCCABNgI8IAFBAWohB0F/IRACQCABLAABQTBrIglBCUsNACABLQACQSRHDQAgAUEDaiEHQQEhEiAJIRALIAggBzYCPEEAIQwCQCAHLAAAIgtBIGsiAUEfSwRAIAchCQwBCyAHIQlBASABdCIBQYnRBHFFDQADQCAIIAdBAWoiCTYCPCABIAxyIQwgBywAASILQSBrIgFBIE8NASAJIQdBASABdCIBQYnRBHENAAsLAkAgC0EqRgRAAn8CQCAJLAABQTBrIgFBCUsNACAJLQACQSRHDQACfyAARQRAIAQgAUECdGpBCjYCAEEADAELIAMgAUEDdGooAgALIQ8gCUEDaiEBQQEMAQsgEg0GIAlBAWohASAARQRAIAggATYCPEEAIRJBACEPDAMLIAIgAigCACIHQQRqNgIAIAcoAgAhD0EACyESIAggATYCPCAPQQBODQFBACAPayEPIAxBgMAAciEMDAELIAhBPGoQaSIPQQBIDQogCCgCPCEBC0EAIQdBfyEKAn9BACABLQAAQS5HDQAaIAEtAAFBK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IAEBAgABAQC0QAIAAoAhwiASAAKAIgSQRAA0AgACAAKAIYIAAoAhQgAWxBAnRqEF0gAUEBaiIBIAAoAiBJDQALCyAAKAIAEBAgABAQC6gBAQV/IAAoAlQiAygCACEFIAMoAgQiBCAAKAIUIAAoAhwiB2siBiAEIAZJGyIGBEAgBSAHIAYQEhogAyADKAIAIAZqIgU2AgAgAyADKAIEIAZrIgQ2AgQLIAQgAiACIARLGyIEBEAgBSABIAQQEhogAyADKAIAIARqIgU2AgAgAyADKAIEIARrNgIECyAFQQA6AAAgACAAKAIsIgE2AhwgACABNgIUIAILngUCBn4EfyABIAEoAgBBB2pBeHEiAUEQajYCACAAIQsgASkDACEDIAEpAwghByMAQSBrIggkACAHQv///////z+DIQQCfiAHQjCIQv//AYMiBaciCkGB+ABrQf0PTQRAIARCBIYgA0I8iIQhAiAKQYD4AGutIQUCQCADQv//////////D4MiA0KBgICAgICAgAhaBEAgAkIBfCECDAELIANCgICAgICAgIAIUg0AIAJCAYMgAnwhAgtCACACIAJC/////////wdWIgAbIQIgAK0gBXwMAQsCQCADIASEUA0AIAVC//8BUg0AIARCBIYgA0I8iIRCgICAgICAgASEIQJC/w8MAQtC/w8gCkH+hwFLDQAaQgBBgPgAQYH4ACAFUCIBGyIAIAprIglB8ABKDQAaIAMhAiAEIARCgICAgICAwACEIAEbIgYhBAJAQYABIAlrIgFBwABxBEAgAyABQUBqrYYhBEIAIQIMAQsgAUUNACAEIAGtIgWGIAJBwAAgAWutiIQhBCACIAWGIQILIAggAjcDECAIIAQ3AxgCQCAJQcAAcQRAIAYgCUFAaq2IIQNCACEGDAELIAlFDQAgBkHAACAJa62GIAMgCa0iAoiEIQMgBiACiCEGCyAIIAM3AwAgCCAGNwMIIAgpAwhCBIYgCCkDACICQjyIhCEDAkAgACAKRyAIKQMQIAgpAxiEQgBSca0gAkL//////////w+DhCICQoGAgICAgICACFoEQCADQgF8IQMMAQsgAkKAgICAgICAgAhSDQAgA0IBgyADfCEDCyADQoCAg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ADRw0ACyAERQshAyAHBEAgAw0CIAAgASACIAUoAgARAABBAEchBAsgBkEANgIAIARFDQILIAAoAgAaQQEPCyAGQQA2AgALC0EACwoAIAAoAgAaQQALFAAgACgCACIABEAgACABNgK4AQsLIQAgACgCACABEFMgAEEAOgB8IAAgASgCuEBBAXE2AoABCzIAIAJFBEBBAA8LIAAoAgAgASACIAMQSEUEQCADQQFBqS9BABAPQQAPCyAAIAIgAxBxC2kCAn8BfCMAQRBrIgMkACACBEADQCAAIANBCGoQRCABAn8gAysDCCIFmUQAAAAAAADgQWMEQCAFqgwBC0GAgICAeAs2AgAgAUEEaiEBIABBCGohACAEQQFqIgQgAkcNAAsLIANBEGokAAuEAQICfwF9IwBBEGsiAyQAIAIEQANAIAMgAC0AADoADyADIAAtAAE6AA4gAyAALQACOgANIAMgAC0AAzoADCABAn8gAyoCDCIFi0MAAABPXQRAIAWoDAELQYCAgIB4CzYCACABQQRqIQEgAEEEaiEAIARBAWoiBCACRw0ACwsgA0EQaiQAC0sBAn8jAEEQayIDJAAgAgRAA0AgACADQQxqQQQQESABIAMoAgw2AgAgAUEEaiEBIABBBGohACAEQQFqIgQgAkcNAAsLIANBEGokAAtLAQJ/IwBBEGsiAyQAIAIEQANAIAAgA0EMakECEBEgASADKAIMNgIAIAFBBGohASAAQQJqIQAgBEEBaiIEIAJHDQALCyADQRBqJAALSgECfyMAQRBrIgMkACACBEADQCAAIANBCGoQRCABIAMrAwi2OAIAIAFBBGohASAAQQhqIQAgBEEBaiIEIAJHDQALCyADQRBqJAALaAECfyMAQRBrIgMkACACBEADQCADIAAtAAA6AA8gAyAALQABOgAOIAMgAC0AAjoADSADIAAtAAM6AAwgASADKgIMOAIAIAFBBGohASAAQQRqIQAgBEEBaiIEIAJHDQALCyADQRBqJAALTAECfyMAQRBrIgMkACACBEADQCAAIANBDGpBBBARIAEgAygCDLM4AgAgAUEEaiEBIABBBGohACAEQQFqIgQgAkcNAAsLIANBEGokAAtMAQJ/IwBBEGsiAyQA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AFAAAFABBrcQBCwEWAEG5xAELJxUAAAAAFQAAAAAJFgAAAAAAFgAAFgAAMDEyMzQ1Njc4OUFCQ0RFRgBB4MQBCwmQbAEAAAAAAAUAQfTEAQsBaQBBjMUBCwpqAAAAawAAAHhoAEGkxQELAQIAQbTFAQsI//////////8AQfjFAQsBBQBBhMYBCwFsAEGcxgELDmoAAABtAAAAiGgAAAAEAEG0xgELAQEAQcTGAQsF/////wo=";
  11090. return f;
  11091. }
  11092. var wasmBinaryFile;
  11093. function getBinarySync(file) {
  11094. if (file == wasmBinaryFile && wasmBinary) {
  11095. return new Uint8Array(wasmBinary);
  11096. }
  11097. var binary = tryParseAsDataURI(file);
  11098. if (binary) {
  11099. return binary;
  11100. }
  11101. if (readBinary) {
  11102. return readBinary(file);
  11103. }
  11104. throw 'sync fetching of the wasm failed: you can preload it to Module["wasmBinary"] manually, or emcc.py will do that for you when generating HTML (but not JS)';
  11105. }
  11106. function instantiateSync(file, info) {
  11107. var module;
  11108. var binary = getBinarySync(file);
  11109. module = new WebAssembly.Module(binary);
  11110. var instance = new WebAssembly.Instance(module, info);
  11111. return [instance, module];
  11112. }
  11113. function getWasmImports() {
  11114. return {
  11115. a: wasmImports
  11116. };
  11117. }
  11118. function createWasm() {
  11119. var info = getWasmImports();
  11120. function receiveInstance(instance, module) {
  11121. wasmExports = instance.exports;
  11122. wasmMemory = wasmExports["p"];
  11123. updateMemoryViews();
  11124. addOnInit(wasmExports["q"]);
  11125. removeRunDependency("wasm-instantiate");
  11126. return wasmExports;
  11127. }
  11128. addRunDependency("wasm-instantiate");
  11129. if (Module["instantiateWasm"]) {
  11130. try {
  11131. return Module["instantiateWasm"](info, receiveInstance);
  11132. } catch (e) {
  11133. err(`Module.instantiateWasm callback failed with error: ${e}`);
  11134. readyPromiseReject(e);
  11135. }
  11136. }
  11137. if (!wasmBinaryFile) wasmBinaryFile = findWasmBinary();
  11138. var result = instantiateSync(wasmBinaryFile, info);
  11139. return receiveInstance(result[0]);
  11140. }
  11141. var callRuntimeCallbacks = callbacks => {
  11142. while (callbacks.length > 0) {
  11143. callbacks.shift()(Module);
  11144. }
  11145. };
  11146. var noExitRuntime = Module["noExitRuntime"] || true;
  11147. var __emscripten_memcpy_js = (dest, src, num) => HEAPU8.copyWithin(dest, src, src + num);
  11148. function _copy_pixels_1(compG_ptr, nb_pixels) {
  11149. compG_ptr >>= 2;
  11150. const imageData = Module.imageData = new Uint8ClampedArray(nb_pixels);
  11151. const compG = Module.HEAP32.subarray(compG_ptr, compG_ptr + nb_pixels);
  11152. imageData.set(compG);
  11153. }
  11154. function _copy_pixels_3(compR_ptr, compG_ptr, compB_ptr, nb_pixels) {
  11155. compR_ptr >>= 2;
  11156. compG_ptr >>= 2;
  11157. compB_ptr >>= 2;
  11158. const imageData = Module.imageData = new Uint8ClampedArray(nb_pixels * 3);
  11159. const compR = Module.HEAP32.subarray(compR_ptr, compR_ptr + nb_pixels);
  11160. const compG = Module.HEAP32.subarray(compG_ptr, compG_ptr + nb_pixels);
  11161. const compB = Module.HEAP32.subarray(compB_ptr, compB_ptr + nb_pixels);
  11162. for (let i = 0; i < nb_pixels; i++) {
  11163. imageData[3 * i] = compR[i];
  11164. imageData[3 * i + 1] = compG[i];
  11165. imageData[3 * i + 2] = compB[i];
  11166. }
  11167. }
  11168. function _copy_pixels_4(compR_ptr, compG_ptr, compB_ptr, compA_ptr, nb_pixels) {
  11169. compR_ptr >>= 2;
  11170. compG_ptr >>= 2;
  11171. compB_ptr >>= 2;
  11172. compA_ptr >>= 2;
  11173. const imageData = Module.imageData = new Uint8ClampedArray(nb_pixels * 4);
  11174. const compR = Module.HEAP32.subarray(compR_ptr, compR_ptr + nb_pixels);
  11175. const compG = Module.HEAP32.subarray(compG_ptr, compG_ptr + nb_pixels);
  11176. const compB = Module.HEAP32.subarray(compB_ptr, compB_ptr + nb_pixels);
  11177. const compA = Module.HEAP32.subarray(compA_ptr, compA_ptr + nb_pixels);
  11178. for (let i = 0; i < nb_pixels; i++) {
  11179. imageData[4 * i] = compR[i];
  11180. imageData[4 * i + 1] = compG[i];
  11181. imageData[4 * i + 2] = compB[i];
  11182. imageData[4 * i + 3] = compA[i];
  11183. }
  11184. }
  11185. var getHeapMax = () => 2147483648;
  11186. var growMemory = size => {
  11187. var b = wasmMemory.buffer;
  11188. var pages = (size - b.byteLength + 65535) / 65536;
  11189. try {
  11190. wasmMemory.grow(pages);
  11191. updateMemoryViews();
  11192. return 1;
  11193. } catch (e) {}
  11194. };
  11195. var _emscripten_resize_heap = requestedSize => {
  11196. var oldSize = HEAPU8.length;
  11197. requestedSize >>>= 0;
  11198. var maxHeapSize = getHeapMax();
  11199. if (requestedSize > maxHeapSize) {
  11200. return false;
  11201. }
  11202. var alignUp = (x, multiple) => x + (multiple - x % multiple) % multiple;
  11203. for (var cutDown = 1; cutDown <= 4; cutDown *= 2) {
  11204. var overGrownHeapSize = oldSize * (1 + .2 / cutDown);
  11205. overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296);
  11206. var newSize = Math.min(maxHeapSize, alignUp(Math.max(requestedSize, overGrownHeapSize), 65536));
  11207. var replacement = growMemory(newSize);
  11208. if (replacement) {
  11209. return true;
  11210. }
  11211. }
  11212. return false;
  11213. };
  11214. var ENV = {};
  11215. var getExecutableName = () => thisProgram || "./this.program";
  11216. var getEnvStrings = () => {
  11217. if (!getEnvStrings.strings) {
  11218. var lang = (typeof navigator == "object" && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8";
  11219. var env = {
  11220. USER: "web_user",
  11221. LOGNAME: "web_user",
  11222. PATH: "/",
  11223. PWD: "/",
  11224. HOME: "/home/web_user",
  11225. LANG: lang,
  11226. _: getExecutableName()
  11227. };
  11228. for (var x in ENV) {
  11229. if (ENV[x] === undefined) delete env[x];else env[x] = ENV[x];
  11230. }
  11231. var strings = [];
  11232. for (var x in env) {
  11233. strings.push(`${x}=${env[x]}`);
  11234. }
  11235. getEnvStrings.strings = strings;
  11236. }
  11237. return getEnvStrings.strings;
  11238. };
  11239. var stringToAscii = (str, buffer) => {
  11240. for (var i = 0; i < str.length; ++i) {
  11241. HEAP8[buffer++] = str.charCodeAt(i);
  11242. }
  11243. HEAP8[buffer] = 0;
  11244. };
  11245. var _environ_get = (__environ, environ_buf) => {
  11246. var bufSize = 0;
  11247. getEnvStrings().forEach((string, i) => {
  11248. var ptr = environ_buf + bufSize;
  11249. HEAPU32[__environ + i * 4 >> 2] = ptr;
  11250. stringToAscii(string, ptr);
  11251. bufSize += string.length + 1;
  11252. });
  11253. return 0;
  11254. };
  11255. var _environ_sizes_get = (penviron_count, penviron_buf_size) => {
  11256. var strings = getEnvStrings();
  11257. HEAPU32[penviron_count >> 2] = strings.length;
  11258. var bufSize = 0;
  11259. strings.forEach(string => bufSize += string.length + 1);
  11260. HEAPU32[penviron_buf_size >> 2] = bufSize;
  11261. return 0;
  11262. };
  11263. var _fd_close = fd => 52;
  11264. var convertI32PairToI53Checked = (lo, hi) => hi + 2097152 >>> 0 < 4194305 - !!lo ? (lo >>> 0) + hi * 4294967296 : NaN;
  11265. function _fd_seek(fd, offset_low, offset_high, whence, newOffset) {
  11266. var offset = convertI32PairToI53Checked(offset_low, offset_high);
  11267. return 70;
  11268. }
  11269. var printCharBuffers = [null, [], []];
  11270. var UTF8Decoder = typeof TextDecoder != "undefined" ? new TextDecoder("utf8") : undefined;
  11271. var UTF8ArrayToString = (heapOrArray, idx, maxBytesToRead) => {
  11272. var endIdx = idx + maxBytesToRead;
  11273. var endPtr = idx;
  11274. while (heapOrArray[endPtr] && !(endPtr >= endIdx)) ++endPtr;
  11275. if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) {
  11276. return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr));
  11277. }
  11278. var str = "";
  11279. while (idx < endPtr) {
  11280. var u0 = heapOrArray[idx++];
  11281. if (!(u0 & 128)) {
  11282. str += String.fromCharCode(u0);
  11283. continue;
  11284. }
  11285. var u1 = heapOrArray[idx++] & 63;
  11286. if ((u0 & 224) == 192) {
  11287. str += String.fromCharCode((u0 & 31) << 6 | u1);
  11288. continue;
  11289. }
  11290. var u2 = heapOrArray[idx++] & 63;
  11291. if ((u0 & 240) == 224) {
  11292. u0 = (u0 & 15) << 12 | u1 << 6 | u2;
  11293. } else {
  11294. u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heapOrArray[idx++] & 63;
  11295. }
  11296. if (u0 < 65536) {
  11297. str += String.fromCharCode(u0);
  11298. } else {
  11299. var ch = u0 - 65536;
  11300. str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023);
  11301. }
  11302. }
  11303. return str;
  11304. };
  11305. var printChar = (stream, curr) => {
  11306. var buffer = printCharBuffers[stream];
  11307. if (curr === 0 || curr === 10) {
  11308. (stream === 1 ? out : err)(UTF8ArrayToString(buffer, 0));
  11309. buffer.length = 0;
  11310. } else {
  11311. buffer.push(curr);
  11312. }
  11313. };
  11314. var UTF8ToString = (ptr, maxBytesToRead) => ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : "";
  11315. var _fd_write = (fd, iov, iovcnt, pnum) => {
  11316. var num = 0;
  11317. for (var i = 0; i < iovcnt; i++) {
  11318. var ptr = HEAPU32[iov >> 2];
  11319. var len = HEAPU32[iov + 4 >> 2];
  11320. iov += 8;
  11321. for (var j = 0; j < len; j++) {
  11322. printChar(fd, HEAPU8[ptr + j]);
  11323. }
  11324. num += len;
  11325. }
  11326. HEAPU32[pnum >> 2] = num;
  11327. return 0;
  11328. };
  11329. function _gray_to_rgba(compG_ptr, nb_pixels) {
  11330. compG_ptr >>= 2;
  11331. const imageData = Module.imageData = new Uint8ClampedArray(nb_pixels * 4);
  11332. const compG = Module.HEAP32.subarray(compG_ptr, compG_ptr + nb_pixels);
  11333. for (let i = 0; i < nb_pixels; i++) {
  11334. imageData[4 * i] = imageData[4 * i + 1] = imageData[4 * i + 2] = compG[i];
  11335. imageData[4 * i + 3] = 255;
  11336. }
  11337. }
  11338. function _graya_to_rgba(compG_ptr, compA_ptr, nb_pixels) {
  11339. compG_ptr >>= 2;
  11340. compA_ptr >>= 2;
  11341. const imageData = Module.imageData = new Uint8ClampedArray(nb_pixels * 4);
  11342. const compG = Module.HEAP32.subarray(compG_ptr, compG_ptr + nb_pixels);
  11343. const compA = Module.HEAP32.subarray(compA_ptr, compA_ptr + nb_pixels);
  11344. for (let i = 0; i < nb_pixels; i++) {
  11345. imageData[4 * i] = imageData[4 * i + 1] = imageData[4 * i + 2] = compG[i];
  11346. imageData[4 * i + 3] = compA[i];
  11347. }
  11348. }
  11349. function _jsPrintWarning(message_ptr) {
  11350. const message = UTF8ToString(message_ptr);
  11351. (Module.warn || console.warn)(`OpenJPEG: ${message}`);
  11352. }
  11353. function _rgb_to_rgba(compR_ptr, compG_ptr, compB_ptr, nb_pixels) {
  11354. compR_ptr >>= 2;
  11355. compG_ptr >>= 2;
  11356. compB_ptr >>= 2;
  11357. const imageData = Module.imageData = new Uint8ClampedArray(nb_pixels * 4);
  11358. const compR = Module.HEAP32.subarray(compR_ptr, compR_ptr + nb_pixels);
  11359. const compG = Module.HEAP32.subarray(compG_ptr, compG_ptr + nb_pixels);
  11360. const compB = Module.HEAP32.subarray(compB_ptr, compB_ptr + nb_pixels);
  11361. for (let i = 0; i < nb_pixels; i++) {
  11362. imageData[4 * i] = compR[i];
  11363. imageData[4 * i + 1] = compG[i];
  11364. imageData[4 * i + 2] = compB[i];
  11365. imageData[4 * i + 3] = 255;
  11366. }
  11367. }
  11368. function _storeErrorMessage(message_ptr) {
  11369. const message = UTF8ToString(message_ptr);
  11370. if (!Module.errorMessages) {
  11371. Module.errorMessages = message;
  11372. } else {
  11373. Module.errorMessages += "\n" + message;
  11374. }
  11375. }
  11376. var wasmImports = {
  11377. c: __emscripten_memcpy_js,
  11378. g: _copy_pixels_1,
  11379. f: _copy_pixels_3,
  11380. e: _copy_pixels_4,
  11381. k: _emscripten_resize_heap,
  11382. l: _environ_get,
  11383. m: _environ_sizes_get,
  11384. n: _fd_close,
  11385. j: _fd_seek,
  11386. b: _fd_write,
  11387. o: _gray_to_rgba,
  11388. i: _graya_to_rgba,
  11389. d: _jsPrintWarning,
  11390. h: _rgb_to_rgba,
  11391. a: _storeErrorMessage
  11392. };
  11393. var wasmExports = createWasm();
  11394. var ___wasm_call_ctors = wasmExports["q"];
  11395. var _malloc = Module["_malloc"] = wasmExports["r"];
  11396. var _free = Module["_free"] = wasmExports["s"];
  11397. var _jp2_decode = Module["_jp2_decode"] = wasmExports["u"];
  11398. var calledRun;
  11399. dependenciesFulfilled = function runCaller() {
  11400. if (!calledRun) run();
  11401. if (!calledRun) dependenciesFulfilled = runCaller;
  11402. };
  11403. function run() {
  11404. if (runDependencies > 0) {
  11405. return;
  11406. }
  11407. preRun();
  11408. if (runDependencies > 0) {
  11409. return;
  11410. }
  11411. function doRun() {
  11412. if (calledRun) return;
  11413. calledRun = true;
  11414. Module["calledRun"] = true;
  11415. if (ABORT) return;
  11416. initRuntime();
  11417. readyPromiseResolve(Module);
  11418. if (Module["onRuntimeInitialized"]) Module["onRuntimeInitialized"]();
  11419. postRun();
  11420. }
  11421. if (Module["setStatus"]) {
  11422. Module["setStatus"]("Running...");
  11423. setTimeout(function () {
  11424. setTimeout(function () {
  11425. Module["setStatus"]("");
  11426. }, 1);
  11427. doRun();
  11428. }, 1);
  11429. } else {
  11430. doRun();
  11431. }
  11432. }
  11433. if (Module["preInit"]) {
  11434. if (typeof Module["preInit"] == "function") Module["preInit"] = [Module["preInit"]];
  11435. while (Module["preInit"].length > 0) {
  11436. Module["preInit"].pop()();
  11437. }
  11438. }
  11439. run();
  11440. moduleRtn = Module;
  11441. return moduleRtn;
  11442. };
  11443. })();
  11444. /* harmony default export */ const openjpeg = (OpenJPEG);
  11445. ;// ./src/core/jpx.js
  11446. class JpxError extends BaseException {
  11447. constructor(msg) {
  11448. super(msg, "JpxError");
  11449. }
  11450. }
  11451. class JpxImage {
  11452. static #module = null;
  11453. static decode(data, decoderOptions) {
  11454. decoderOptions ||= {};
  11455. this.#module ||= openjpeg({
  11456. warn: warn
  11457. });
  11458. const imageData = this.#module.decode(data, decoderOptions);
  11459. if (typeof imageData === "string") {
  11460. throw new JpxError(imageData);
  11461. }
  11462. return imageData;
  11463. }
  11464. static cleanup() {
  11465. this.#module = null;
  11466. }
  11467. static parseImageProperties(stream) {
  11468. let newByte = stream.getByte();
  11469. while (newByte >= 0) {
  11470. const oldByte = newByte;
  11471. newByte = stream.getByte();
  11472. const code = oldByte << 8 | newByte;
  11473. if (code === 0xff51) {
  11474. stream.skip(4);
  11475. const Xsiz = stream.getInt32() >>> 0;
  11476. const Ysiz = stream.getInt32() >>> 0;
  11477. const XOsiz = stream.getInt32() >>> 0;
  11478. const YOsiz = stream.getInt32() >>> 0;
  11479. stream.skip(16);
  11480. const Csiz = stream.getUint16();
  11481. return {
  11482. width: Xsiz - XOsiz,
  11483. height: Ysiz - YOsiz,
  11484. bitsPerComponent: 8,
  11485. componentsCount: Csiz
  11486. };
  11487. }
  11488. }
  11489. throw new JpxError("No size marker found in JPX stream");
  11490. }
  11491. }
  11492. ;// ./src/core/jpx_stream.js
  11493. class JpxStream extends DecodeStream {
  11494. constructor(stream, maybeLength, params) {
  11495. super(maybeLength);
  11496. this.stream = stream;
  11497. this.dict = stream.dict;
  11498. this.maybeLength = maybeLength;
  11499. this.params = params;
  11500. }
  11501. get bytes() {
  11502. return shadow(this, "bytes", this.stream.getBytes(this.maybeLength));
  11503. }
  11504. ensureBuffer(requested) {}
  11505. readBlock(decoderOptions) {
  11506. this.decodeImage(null, decoderOptions);
  11507. }
  11508. decodeImage(bytes, decoderOptions) {
  11509. if (this.eof) {
  11510. return this.buffer;
  11511. }
  11512. bytes ||= this.bytes;
  11513. this.buffer = JpxImage.decode(bytes, decoderOptions);
  11514. this.bufferLength = this.buffer.length;
  11515. this.eof = true;
  11516. return this.buffer;
  11517. }
  11518. get canAsyncDecodeImageFromBuffer() {
  11519. return this.stream.isAsync;
  11520. }
  11521. }
  11522. ;// ./src/core/lzw_stream.js
  11523. class LZWStream extends DecodeStream {
  11524. constructor(str, maybeLength, earlyChange) {
  11525. super(maybeLength);
  11526. this.str = str;
  11527. this.dict = str.dict;
  11528. this.cachedData = 0;
  11529. this.bitsCached = 0;
  11530. const maxLzwDictionarySize = 4096;
  11531. const lzwState = {
  11532. earlyChange,
  11533. codeLength: 9,
  11534. nextCode: 258,
  11535. dictionaryValues: new Uint8Array(maxLzwDictionarySize),
  11536. dictionaryLengths: new Uint16Array(maxLzwDictionarySize),
  11537. dictionaryPrevCodes: new Uint16Array(maxLzwDictionarySize),
  11538. currentSequence: new Uint8Array(maxLzwDictionarySize),
  11539. currentSequenceLength: 0
  11540. };
  11541. for (let i = 0; i < 256; ++i) {
  11542. lzwState.dictionaryValues[i] = i;
  11543. lzwState.dictionaryLengths[i] = 1;
  11544. }
  11545. this.lzwState = lzwState;
  11546. }
  11547. readBits(n) {
  11548. let bitsCached = this.bitsCached;
  11549. let cachedData = this.cachedData;
  11550. while (bitsCached < n) {
  11551. const c = this.str.getByte();
  11552. if (c === -1) {
  11553. this.eof = true;
  11554. return null;
  11555. }
  11556. cachedData = cachedData << 8 | c;
  11557. bitsCached += 8;
  11558. }
  11559. this.bitsCached = bitsCached -= n;
  11560. this.cachedData = cachedData;
  11561. this.lastCode = null;
  11562. return cachedData >>> bitsCached & (1 << n) - 1;
  11563. }
  11564. readBlock() {
  11565. const blockSize = 512,
  11566. decodedSizeDelta = blockSize;
  11567. let estimatedDecodedSize = blockSize * 2;
  11568. let i, j, q;
  11569. const lzwState = this.lzwState;
  11570. if (!lzwState) {
  11571. return;
  11572. }
  11573. const earlyChange = lzwState.earlyChange;
  11574. let nextCode = lzwState.nextCode;
  11575. const dictionaryValues = lzwState.dictionaryValues;
  11576. const dictionaryLengths = lzwState.dictionaryLengths;
  11577. const dictionaryPrevCodes = lzwState.dictionaryPrevCodes;
  11578. let codeLength = lzwState.codeLength;
  11579. let prevCode = lzwState.prevCode;
  11580. const currentSequence = lzwState.currentSequence;
  11581. let currentSequenceLength = lzwState.currentSequenceLength;
  11582. let decodedLength = 0;
  11583. let currentBufferLength = this.bufferLength;
  11584. let buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize);
  11585. for (i = 0; i < blockSize; i++) {
  11586. const code = this.readBits(codeLength);
  11587. const hasPrev = currentSequenceLength > 0;
  11588. if (code < 256) {
  11589. currentSequence[0] = code;
  11590. currentSequenceLength = 1;
  11591. } else if (code >= 258) {
  11592. if (code < nextCode) {
  11593. currentSequenceLength = dictionaryLengths[code];
  11594. for (j = currentSequenceLength - 1, q = code; j >= 0; j--) {
  11595. currentSequence[j] = dictionaryValues[q];
  11596. q = dictionaryPrevCodes[q];
  11597. }
  11598. } else {
  11599. currentSequence[currentSequenceLength++] = currentSequence[0];
  11600. }
  11601. } else if (code === 256) {
  11602. codeLength = 9;
  11603. nextCode = 258;
  11604. currentSequenceLength = 0;
  11605. continue;
  11606. } else {
  11607. this.eof = true;
  11608. delete this.lzwState;
  11609. break;
  11610. }
  11611. if (hasPrev) {
  11612. dictionaryPrevCodes[nextCode] = prevCode;
  11613. dictionaryLengths[nextCode] = dictionaryLengths[prevCode] + 1;
  11614. dictionaryValues[nextCode] = currentSequence[0];
  11615. nextCode++;
  11616. codeLength = nextCode + earlyChange & nextCode + earlyChange - 1 ? codeLength : Math.min(Math.log(nextCode + earlyChange) / 0.6931471805599453 + 1, 12) | 0;
  11617. }
  11618. prevCode = code;
  11619. decodedLength += currentSequenceLength;
  11620. if (estimatedDecodedSize < decodedLength) {
  11621. do {
  11622. estimatedDecodedSize += decodedSizeDelta;
  11623. } while (estimatedDecodedSize < decodedLength);
  11624. buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize);
  11625. }
  11626. for (j = 0; j < currentSequenceLength; j++) {
  11627. buffer[currentBufferLength++] = currentSequence[j];
  11628. }
  11629. }
  11630. lzwState.nextCode = nextCode;
  11631. lzwState.codeLength = codeLength;
  11632. lzwState.prevCode = prevCode;
  11633. lzwState.currentSequenceLength = currentSequenceLength;
  11634. this.bufferLength = currentBufferLength;
  11635. }
  11636. }
  11637. ;// ./src/core/predictor_stream.js
  11638. class PredictorStream extends DecodeStream {
  11639. constructor(str, maybeLength, params) {
  11640. super(maybeLength);
  11641. if (!(params instanceof Dict)) {
  11642. return str;
  11643. }
  11644. const predictor = this.predictor = params.get("Predictor") || 1;
  11645. if (predictor <= 1) {
  11646. return str;
  11647. }
  11648. if (predictor !== 2 && (predictor < 10 || predictor > 15)) {
  11649. throw new FormatError(`Unsupported predictor: ${predictor}`);
  11650. }
  11651. this.readBlock = predictor === 2 ? this.readBlockTiff : this.readBlockPng;
  11652. this.str = str;
  11653. this.dict = str.dict;
  11654. const colors = this.colors = params.get("Colors") || 1;
  11655. const bits = this.bits = params.get("BPC", "BitsPerComponent") || 8;
  11656. const columns = this.columns = params.get("Columns") || 1;
  11657. this.pixBytes = colors * bits + 7 >> 3;
  11658. this.rowBytes = columns * colors * bits + 7 >> 3;
  11659. return this;
  11660. }
  11661. readBlockTiff() {
  11662. const rowBytes = this.rowBytes;
  11663. const bufferLength = this.bufferLength;
  11664. const buffer = this.ensureBuffer(bufferLength + rowBytes);
  11665. const bits = this.bits;
  11666. const colors = this.colors;
  11667. const rawBytes = this.str.getBytes(rowBytes);
  11668. this.eof = !rawBytes.length;
  11669. if (this.eof) {
  11670. return;
  11671. }
  11672. let inbuf = 0,
  11673. outbuf = 0;
  11674. let inbits = 0,
  11675. outbits = 0;
  11676. let pos = bufferLength;
  11677. let i;
  11678. if (bits === 1 && colors === 1) {
  11679. for (i = 0; i < rowBytes; ++i) {
  11680. let c = rawBytes[i] ^ inbuf;
  11681. c ^= c >> 1;
  11682. c ^= c >> 2;
  11683. c ^= c >> 4;
  11684. inbuf = (c & 1) << 7;
  11685. buffer[pos++] = c;
  11686. }
  11687. } else if (bits === 8) {
  11688. for (i = 0; i < colors; ++i) {
  11689. buffer[pos++] = rawBytes[i];
  11690. }
  11691. for (; i < rowBytes; ++i) {
  11692. buffer[pos] = buffer[pos - colors] + rawBytes[i];
  11693. pos++;
  11694. }
  11695. } else if (bits === 16) {
  11696. const bytesPerPixel = colors * 2;
  11697. for (i = 0; i < bytesPerPixel; ++i) {
  11698. buffer[pos++] = rawBytes[i];
  11699. }
  11700. for (; i < rowBytes; i += 2) {
  11701. const sum = ((rawBytes[i] & 0xff) << 8) + (rawBytes[i + 1] & 0xff) + ((buffer[pos - bytesPerPixel] & 0xff) << 8) + (buffer[pos - bytesPerPixel + 1] & 0xff);
  11702. buffer[pos++] = sum >> 8 & 0xff;
  11703. buffer[pos++] = sum & 0xff;
  11704. }
  11705. } else {
  11706. const compArray = new Uint8Array(colors + 1);
  11707. const bitMask = (1 << bits) - 1;
  11708. let j = 0,
  11709. k = bufferLength;
  11710. const columns = this.columns;
  11711. for (i = 0; i < columns; ++i) {
  11712. for (let kk = 0; kk < colors; ++kk) {
  11713. if (inbits < bits) {
  11714. inbuf = inbuf << 8 | rawBytes[j++] & 0xff;
  11715. inbits += 8;
  11716. }
  11717. compArray[kk] = compArray[kk] + (inbuf >> inbits - bits) & bitMask;
  11718. inbits -= bits;
  11719. outbuf = outbuf << bits | compArray[kk];
  11720. outbits += bits;
  11721. if (outbits >= 8) {
  11722. buffer[k++] = outbuf >> outbits - 8 & 0xff;
  11723. outbits -= 8;
  11724. }
  11725. }
  11726. }
  11727. if (outbits > 0) {
  11728. buffer[k++] = (outbuf << 8 - outbits) + (inbuf & (1 << 8 - outbits) - 1);
  11729. }
  11730. }
  11731. this.bufferLength += rowBytes;
  11732. }
  11733. readBlockPng() {
  11734. const rowBytes = this.rowBytes;
  11735. const pixBytes = this.pixBytes;
  11736. const predictor = this.str.getByte();
  11737. const rawBytes = this.str.getBytes(rowBytes);
  11738. this.eof = !rawBytes.length;
  11739. if (this.eof) {
  11740. return;
  11741. }
  11742. const bufferLength = this.bufferLength;
  11743. const buffer = this.ensureBuffer(bufferLength + rowBytes);
  11744. let prevRow = buffer.subarray(bufferLength - rowBytes, bufferLength);
  11745. if (prevRow.length === 0) {
  11746. prevRow = new Uint8Array(rowBytes);
  11747. }
  11748. let i,
  11749. j = bufferLength,
  11750. up,
  11751. c;
  11752. switch (predictor) {
  11753. case 0:
  11754. for (i = 0; i < rowBytes; ++i) {
  11755. buffer[j++] = rawBytes[i];
  11756. }
  11757. break;
  11758. case 1:
  11759. for (i = 0; i < pixBytes; ++i) {
  11760. buffer[j++] = rawBytes[i];
  11761. }
  11762. for (; i < rowBytes; ++i) {
  11763. buffer[j] = buffer[j - pixBytes] + rawBytes[i] & 0xff;
  11764. j++;
  11765. }
  11766. break;
  11767. case 2:
  11768. for (i = 0; i < rowBytes; ++i) {
  11769. buffer[j++] = prevRow[i] + rawBytes[i] & 0xff;
  11770. }
  11771. break;
  11772. case 3:
  11773. for (i = 0; i < pixBytes; ++i) {
  11774. buffer[j++] = (prevRow[i] >> 1) + rawBytes[i];
  11775. }
  11776. for (; i < rowBytes; ++i) {
  11777. buffer[j] = (prevRow[i] + buffer[j - pixBytes] >> 1) + rawBytes[i] & 0xff;
  11778. j++;
  11779. }
  11780. break;
  11781. case 4:
  11782. for (i = 0; i < pixBytes; ++i) {
  11783. up = prevRow[i];
  11784. c = rawBytes[i];
  11785. buffer[j++] = up + c;
  11786. }
  11787. for (; i < rowBytes; ++i) {
  11788. up = prevRow[i];
  11789. const upLeft = prevRow[i - pixBytes];
  11790. const left = buffer[j - pixBytes];
  11791. const p = left + up - upLeft;
  11792. let pa = p - left;
  11793. if (pa < 0) {
  11794. pa = -pa;
  11795. }
  11796. let pb = p - up;
  11797. if (pb < 0) {
  11798. pb = -pb;
  11799. }
  11800. let pc = p - upLeft;
  11801. if (pc < 0) {
  11802. pc = -pc;
  11803. }
  11804. c = rawBytes[i];
  11805. if (pa <= pb && pa <= pc) {
  11806. buffer[j++] = left + c;
  11807. } else if (pb <= pc) {
  11808. buffer[j++] = up + c;
  11809. } else {
  11810. buffer[j++] = upLeft + c;
  11811. }
  11812. }
  11813. break;
  11814. default:
  11815. throw new FormatError(`Unsupported predictor: ${predictor}`);
  11816. }
  11817. this.bufferLength += rowBytes;
  11818. }
  11819. }
  11820. ;// ./src/core/run_length_stream.js
  11821. class RunLengthStream extends DecodeStream {
  11822. constructor(str, maybeLength) {
  11823. super(maybeLength);
  11824. this.str = str;
  11825. this.dict = str.dict;
  11826. }
  11827. readBlock() {
  11828. const repeatHeader = this.str.getBytes(2);
  11829. if (!repeatHeader || repeatHeader.length < 2 || repeatHeader[0] === 128) {
  11830. this.eof = true;
  11831. return;
  11832. }
  11833. let buffer;
  11834. let bufferLength = this.bufferLength;
  11835. let n = repeatHeader[0];
  11836. if (n < 128) {
  11837. buffer = this.ensureBuffer(bufferLength + n + 1);
  11838. buffer[bufferLength++] = repeatHeader[1];
  11839. if (n > 0) {
  11840. const source = this.str.getBytes(n);
  11841. buffer.set(source, bufferLength);
  11842. bufferLength += n;
  11843. }
  11844. } else {
  11845. n = 257 - n;
  11846. const b = repeatHeader[1];
  11847. buffer = this.ensureBuffer(bufferLength + n + 1);
  11848. for (let i = 0; i < n; i++) {
  11849. buffer[bufferLength++] = b;
  11850. }
  11851. }
  11852. this.bufferLength = bufferLength;
  11853. }
  11854. }
  11855. ;// ./src/core/parser.js
  11856. const MAX_LENGTH_TO_CACHE = 1000;
  11857. function getInlineImageCacheKey(bytes) {
  11858. const strBuf = [],
  11859. ii = bytes.length;
  11860. let i = 0;
  11861. while (i < ii - 1) {
  11862. strBuf.push(bytes[i++] << 8 | bytes[i++]);
  11863. }
  11864. if (i < ii) {
  11865. strBuf.push(bytes[i]);
  11866. }
  11867. return ii + "_" + String.fromCharCode.apply(null, strBuf);
  11868. }
  11869. class Parser {
  11870. constructor({
  11871. lexer,
  11872. xref,
  11873. allowStreams = false,
  11874. recoveryMode = false
  11875. }) {
  11876. this.lexer = lexer;
  11877. this.xref = xref;
  11878. this.allowStreams = allowStreams;
  11879. this.recoveryMode = recoveryMode;
  11880. this.imageCache = Object.create(null);
  11881. this._imageId = 0;
  11882. this.refill();
  11883. }
  11884. refill() {
  11885. this.buf1 = this.lexer.getObj();
  11886. this.buf2 = this.lexer.getObj();
  11887. }
  11888. shift() {
  11889. if (this.buf2 instanceof Cmd && this.buf2.cmd === "ID") {
  11890. this.buf1 = this.buf2;
  11891. this.buf2 = null;
  11892. } else {
  11893. this.buf1 = this.buf2;
  11894. this.buf2 = this.lexer.getObj();
  11895. }
  11896. }
  11897. tryShift() {
  11898. try {
  11899. this.shift();
  11900. return true;
  11901. } catch (e) {
  11902. if (e instanceof MissingDataException) {
  11903. throw e;
  11904. }
  11905. return false;
  11906. }
  11907. }
  11908. getObj(cipherTransform = null) {
  11909. const buf1 = this.buf1;
  11910. this.shift();
  11911. if (buf1 instanceof Cmd) {
  11912. switch (buf1.cmd) {
  11913. case "BI":
  11914. return this.makeInlineImage(cipherTransform);
  11915. case "[":
  11916. const array = [];
  11917. while (!isCmd(this.buf1, "]") && this.buf1 !== EOF) {
  11918. array.push(this.getObj(cipherTransform));
  11919. }
  11920. if (this.buf1 === EOF) {
  11921. if (this.recoveryMode) {
  11922. return array;
  11923. }
  11924. throw new ParserEOFException("End of file inside array.");
  11925. }
  11926. this.shift();
  11927. return array;
  11928. case "<<":
  11929. const dict = new Dict(this.xref);
  11930. while (!isCmd(this.buf1, ">>") && this.buf1 !== EOF) {
  11931. if (!(this.buf1 instanceof Name)) {
  11932. info("Malformed dictionary: key must be a name object");
  11933. this.shift();
  11934. continue;
  11935. }
  11936. const key = this.buf1.name;
  11937. this.shift();
  11938. if (this.buf1 === EOF) {
  11939. break;
  11940. }
  11941. dict.set(key, this.getObj(cipherTransform));
  11942. }
  11943. if (this.buf1 === EOF) {
  11944. if (this.recoveryMode) {
  11945. return dict;
  11946. }
  11947. throw new ParserEOFException("End of file inside dictionary.");
  11948. }
  11949. if (isCmd(this.buf2, "stream")) {
  11950. return this.allowStreams ? this.makeStream(dict, cipherTransform) : dict;
  11951. }
  11952. this.shift();
  11953. return dict;
  11954. default:
  11955. return buf1;
  11956. }
  11957. }
  11958. if (Number.isInteger(buf1)) {
  11959. if (Number.isInteger(this.buf1) && isCmd(this.buf2, "R")) {
  11960. const ref = Ref.get(buf1, this.buf1);
  11961. this.shift();
  11962. this.shift();
  11963. return ref;
  11964. }
  11965. return buf1;
  11966. }
  11967. if (typeof buf1 === "string") {
  11968. if (cipherTransform) {
  11969. return cipherTransform.decryptString(buf1);
  11970. }
  11971. return buf1;
  11972. }
  11973. return buf1;
  11974. }
  11975. findDefaultInlineStreamEnd(stream) {
  11976. const E = 0x45,
  11977. I = 0x49,
  11978. SPACE = 0x20,
  11979. LF = 0xa,
  11980. CR = 0xd,
  11981. NUL = 0x0;
  11982. const {
  11983. knownCommands
  11984. } = this.lexer,
  11985. startPos = stream.pos,
  11986. n = 15;
  11987. let state = 0,
  11988. ch,
  11989. maybeEIPos;
  11990. while ((ch = stream.getByte()) !== -1) {
  11991. if (state === 0) {
  11992. state = ch === E ? 1 : 0;
  11993. } else if (state === 1) {
  11994. state = ch === I ? 2 : 0;
  11995. } else {
  11996. if (ch === SPACE || ch === LF || ch === CR) {
  11997. maybeEIPos = stream.pos;
  11998. const followingBytes = stream.peekBytes(n);
  11999. const ii = followingBytes.length;
  12000. if (ii === 0) {
  12001. break;
  12002. }
  12003. for (let i = 0; i < ii; i++) {
  12004. ch = followingBytes[i];
  12005. if (ch === NUL && followingBytes[i + 1] !== NUL) {
  12006. continue;
  12007. }
  12008. if (ch !== LF && ch !== CR && (ch < SPACE || ch > 0x7f)) {
  12009. state = 0;
  12010. break;
  12011. }
  12012. }
  12013. if (state !== 2) {
  12014. continue;
  12015. }
  12016. if (!knownCommands) {
  12017. warn("findDefaultInlineStreamEnd - `lexer.knownCommands` is undefined.");
  12018. continue;
  12019. }
  12020. const tmpLexer = new Lexer(new Stream(followingBytes.slice()), knownCommands);
  12021. tmpLexer._hexStringWarn = () => {};
  12022. let numArgs = 0;
  12023. while (true) {
  12024. const nextObj = tmpLexer.getObj();
  12025. if (nextObj === EOF) {
  12026. state = 0;
  12027. break;
  12028. }
  12029. if (nextObj instanceof Cmd) {
  12030. const knownCommand = knownCommands[nextObj.cmd];
  12031. if (!knownCommand) {
  12032. state = 0;
  12033. break;
  12034. } else if (knownCommand.variableArgs ? numArgs <= knownCommand.numArgs : numArgs === knownCommand.numArgs) {
  12035. break;
  12036. }
  12037. numArgs = 0;
  12038. continue;
  12039. }
  12040. numArgs++;
  12041. }
  12042. if (state === 2) {
  12043. break;
  12044. }
  12045. } else {
  12046. state = 0;
  12047. }
  12048. }
  12049. }
  12050. if (ch === -1) {
  12051. warn("findDefaultInlineStreamEnd: " + "Reached the end of the stream without finding a valid EI marker");
  12052. if (maybeEIPos) {
  12053. warn('... trying to recover by using the last "EI" occurrence.');
  12054. stream.skip(-(stream.pos - maybeEIPos));
  12055. }
  12056. }
  12057. let endOffset = 4;
  12058. stream.skip(-endOffset);
  12059. ch = stream.peekByte();
  12060. stream.skip(endOffset);
  12061. if (!isWhiteSpace(ch)) {
  12062. endOffset--;
  12063. }
  12064. return stream.pos - endOffset - startPos;
  12065. }
  12066. findDCTDecodeInlineStreamEnd(stream) {
  12067. const startPos = stream.pos;
  12068. let foundEOI = false,
  12069. b,
  12070. markerLength;
  12071. while ((b = stream.getByte()) !== -1) {
  12072. if (b !== 0xff) {
  12073. continue;
  12074. }
  12075. switch (stream.getByte()) {
  12076. case 0x00:
  12077. break;
  12078. case 0xff:
  12079. stream.skip(-1);
  12080. break;
  12081. case 0xd9:
  12082. foundEOI = true;
  12083. break;
  12084. case 0xc0:
  12085. case 0xc1:
  12086. case 0xc2:
  12087. case 0xc3:
  12088. case 0xc5:
  12089. case 0xc6:
  12090. case 0xc7:
  12091. case 0xc9:
  12092. case 0xca:
  12093. case 0xcb:
  12094. case 0xcd:
  12095. case 0xce:
  12096. case 0xcf:
  12097. case 0xc4:
  12098. case 0xcc:
  12099. case 0xda:
  12100. case 0xdb:
  12101. case 0xdc:
  12102. case 0xdd:
  12103. case 0xde:
  12104. case 0xdf:
  12105. case 0xe0:
  12106. case 0xe1:
  12107. case 0xe2:
  12108. case 0xe3:
  12109. case 0xe4:
  12110. case 0xe5:
  12111. case 0xe6:
  12112. case 0xe7:
  12113. case 0xe8:
  12114. case 0xe9:
  12115. case 0xea:
  12116. case 0xeb:
  12117. case 0xec:
  12118. case 0xed:
  12119. case 0xee:
  12120. case 0xef:
  12121. case 0xfe:
  12122. markerLength = stream.getUint16();
  12123. if (markerLength > 2) {
  12124. stream.skip(markerLength - 2);
  12125. } else {
  12126. stream.skip(-2);
  12127. }
  12128. break;
  12129. }
  12130. if (foundEOI) {
  12131. break;
  12132. }
  12133. }
  12134. const length = stream.pos - startPos;
  12135. if (b === -1) {
  12136. warn("Inline DCTDecode image stream: " + "EOI marker not found, searching for /EI/ instead.");
  12137. stream.skip(-length);
  12138. return this.findDefaultInlineStreamEnd(stream);
  12139. }
  12140. this.inlineStreamSkipEI(stream);
  12141. return length;
  12142. }
  12143. findASCII85DecodeInlineStreamEnd(stream) {
  12144. const TILDE = 0x7e,
  12145. GT = 0x3e;
  12146. const startPos = stream.pos;
  12147. let ch;
  12148. while ((ch = stream.getByte()) !== -1) {
  12149. if (ch === TILDE) {
  12150. const tildePos = stream.pos;
  12151. ch = stream.peekByte();
  12152. while (isWhiteSpace(ch)) {
  12153. stream.skip();
  12154. ch = stream.peekByte();
  12155. }
  12156. if (ch === GT) {
  12157. stream.skip();
  12158. break;
  12159. }
  12160. if (stream.pos > tildePos) {
  12161. const maybeEI = stream.peekBytes(2);
  12162. if (maybeEI[0] === 0x45 && maybeEI[1] === 0x49) {
  12163. break;
  12164. }
  12165. }
  12166. }
  12167. }
  12168. const length = stream.pos - startPos;
  12169. if (ch === -1) {
  12170. warn("Inline ASCII85Decode image stream: " + "EOD marker not found, searching for /EI/ instead.");
  12171. stream.skip(-length);
  12172. return this.findDefaultInlineStreamEnd(stream);
  12173. }
  12174. this.inlineStreamSkipEI(stream);
  12175. return length;
  12176. }
  12177. findASCIIHexDecodeInlineStreamEnd(stream) {
  12178. const GT = 0x3e;
  12179. const startPos = stream.pos;
  12180. let ch;
  12181. while ((ch = stream.getByte()) !== -1) {
  12182. if (ch === GT) {
  12183. break;
  12184. }
  12185. }
  12186. const length = stream.pos - startPos;
  12187. if (ch === -1) {
  12188. warn("Inline ASCIIHexDecode image stream: " + "EOD marker not found, searching for /EI/ instead.");
  12189. stream.skip(-length);
  12190. return this.findDefaultInlineStreamEnd(stream);
  12191. }
  12192. this.inlineStreamSkipEI(stream);
  12193. return length;
  12194. }
  12195. inlineStreamSkipEI(stream) {
  12196. const E = 0x45,
  12197. I = 0x49;
  12198. let state = 0,
  12199. ch;
  12200. while ((ch = stream.getByte()) !== -1) {
  12201. if (state === 0) {
  12202. state = ch === E ? 1 : 0;
  12203. } else if (state === 1) {
  12204. state = ch === I ? 2 : 0;
  12205. } else if (state === 2) {
  12206. break;
  12207. }
  12208. }
  12209. }
  12210. makeInlineImage(cipherTransform) {
  12211. const lexer = this.lexer;
  12212. const stream = lexer.stream;
  12213. const dictMap = Object.create(null);
  12214. let dictLength;
  12215. while (!isCmd(this.buf1, "ID") && this.buf1 !== EOF) {
  12216. if (!(this.buf1 instanceof Name)) {
  12217. throw new FormatError("Dictionary key must be a name object");
  12218. }
  12219. const key = this.buf1.name;
  12220. this.shift();
  12221. if (this.buf1 === EOF) {
  12222. break;
  12223. }
  12224. dictMap[key] = this.getObj(cipherTransform);
  12225. }
  12226. if (lexer.beginInlineImagePos !== -1) {
  12227. dictLength = stream.pos - lexer.beginInlineImagePos;
  12228. }
  12229. const filter = this.xref.fetchIfRef(dictMap.F || dictMap.Filter);
  12230. let filterName;
  12231. if (filter instanceof Name) {
  12232. filterName = filter.name;
  12233. } else if (Array.isArray(filter)) {
  12234. const filterZero = this.xref.fetchIfRef(filter[0]);
  12235. if (filterZero instanceof Name) {
  12236. filterName = filterZero.name;
  12237. }
  12238. }
  12239. const startPos = stream.pos;
  12240. let length;
  12241. switch (filterName) {
  12242. case "DCT":
  12243. case "DCTDecode":
  12244. length = this.findDCTDecodeInlineStreamEnd(stream);
  12245. break;
  12246. case "A85":
  12247. case "ASCII85Decode":
  12248. length = this.findASCII85DecodeInlineStreamEnd(stream);
  12249. break;
  12250. case "AHx":
  12251. case "ASCIIHexDecode":
  12252. length = this.findASCIIHexDecodeInlineStreamEnd(stream);
  12253. break;
  12254. default:
  12255. length = this.findDefaultInlineStreamEnd(stream);
  12256. }
  12257. let cacheKey;
  12258. if (length < MAX_LENGTH_TO_CACHE && dictLength > 0) {
  12259. const initialStreamPos = stream.pos;
  12260. stream.pos = lexer.beginInlineImagePos;
  12261. cacheKey = getInlineImageCacheKey(stream.getBytes(dictLength + length));
  12262. stream.pos = initialStreamPos;
  12263. const cacheEntry = this.imageCache[cacheKey];
  12264. if (cacheEntry !== undefined) {
  12265. this.buf2 = Cmd.get("EI");
  12266. this.shift();
  12267. cacheEntry.reset();
  12268. return cacheEntry;
  12269. }
  12270. }
  12271. const dict = new Dict(this.xref);
  12272. for (const key in dictMap) {
  12273. dict.set(key, dictMap[key]);
  12274. }
  12275. let imageStream = stream.makeSubStream(startPos, length, dict);
  12276. if (cipherTransform) {
  12277. imageStream = cipherTransform.createStream(imageStream, length);
  12278. }
  12279. imageStream = this.filter(imageStream, dict, length);
  12280. imageStream.dict = dict;
  12281. if (cacheKey !== undefined) {
  12282. imageStream.cacheKey = `inline_img_${++this._imageId}`;
  12283. this.imageCache[cacheKey] = imageStream;
  12284. }
  12285. this.buf2 = Cmd.get("EI");
  12286. this.shift();
  12287. return imageStream;
  12288. }
  12289. #findStreamLength(startPos) {
  12290. const {
  12291. stream
  12292. } = this.lexer;
  12293. stream.pos = startPos;
  12294. const SCAN_BLOCK_LENGTH = 2048;
  12295. const signatureLength = "endstream".length;
  12296. const END_SIGNATURE = new Uint8Array([0x65, 0x6e, 0x64]);
  12297. const endLength = END_SIGNATURE.length;
  12298. const PARTIAL_SIGNATURE = [new Uint8Array([0x73, 0x74, 0x72, 0x65, 0x61, 0x6d]), new Uint8Array([0x73, 0x74, 0x65, 0x61, 0x6d]), new Uint8Array([0x73, 0x74, 0x72, 0x65, 0x61])];
  12299. const normalLength = signatureLength - endLength;
  12300. while (stream.pos < stream.end) {
  12301. const scanBytes = stream.peekBytes(SCAN_BLOCK_LENGTH);
  12302. const scanLength = scanBytes.length - signatureLength;
  12303. if (scanLength <= 0) {
  12304. break;
  12305. }
  12306. let pos = 0;
  12307. while (pos < scanLength) {
  12308. let j = 0;
  12309. while (j < endLength && scanBytes[pos + j] === END_SIGNATURE[j]) {
  12310. j++;
  12311. }
  12312. if (j >= endLength) {
  12313. let found = false;
  12314. for (const part of PARTIAL_SIGNATURE) {
  12315. const partLen = part.length;
  12316. let k = 0;
  12317. while (k < partLen && scanBytes[pos + j + k] === part[k]) {
  12318. k++;
  12319. }
  12320. if (k >= normalLength) {
  12321. found = true;
  12322. break;
  12323. }
  12324. if (k >= partLen) {
  12325. const lastByte = scanBytes[pos + j + k];
  12326. if (isWhiteSpace(lastByte)) {
  12327. info(`Found "${bytesToString([...END_SIGNATURE, ...part])}" when ` + "searching for endstream command.");
  12328. found = true;
  12329. }
  12330. break;
  12331. }
  12332. }
  12333. if (found) {
  12334. stream.pos += pos;
  12335. return stream.pos - startPos;
  12336. }
  12337. }
  12338. pos++;
  12339. }
  12340. stream.pos += scanLength;
  12341. }
  12342. return -1;
  12343. }
  12344. makeStream(dict, cipherTransform) {
  12345. const lexer = this.lexer;
  12346. let stream = lexer.stream;
  12347. lexer.skipToNextLine();
  12348. const startPos = stream.pos - 1;
  12349. let length = dict.get("Length");
  12350. if (!Number.isInteger(length)) {
  12351. info(`Bad length "${length && length.toString()}" in stream.`);
  12352. length = 0;
  12353. }
  12354. stream.pos = startPos + length;
  12355. lexer.nextChar();
  12356. if (this.tryShift() && isCmd(this.buf2, "endstream")) {
  12357. this.shift();
  12358. } else {
  12359. length = this.#findStreamLength(startPos);
  12360. if (length < 0) {
  12361. throw new FormatError("Missing endstream command.");
  12362. }
  12363. lexer.nextChar();
  12364. this.shift();
  12365. this.shift();
  12366. }
  12367. this.shift();
  12368. stream = stream.makeSubStream(startPos, length, dict);
  12369. if (cipherTransform) {
  12370. stream = cipherTransform.createStream(stream, length);
  12371. }
  12372. stream = this.filter(stream, dict, length);
  12373. stream.dict = dict;
  12374. return stream;
  12375. }
  12376. filter(stream, dict, length) {
  12377. let filter = dict.get("F", "Filter");
  12378. let params = dict.get("DP", "DecodeParms");
  12379. if (filter instanceof Name) {
  12380. if (Array.isArray(params)) {
  12381. warn("/DecodeParms should not be an Array, when /Filter is a Name.");
  12382. }
  12383. return this.makeFilter(stream, filter.name, length, params);
  12384. }
  12385. let maybeLength = length;
  12386. if (Array.isArray(filter)) {
  12387. const filterArray = filter;
  12388. const paramsArray = params;
  12389. for (let i = 0, ii = filterArray.length; i < ii; ++i) {
  12390. filter = this.xref.fetchIfRef(filterArray[i]);
  12391. if (!(filter instanceof Name)) {
  12392. throw new FormatError(`Bad filter name "${filter}"`);
  12393. }
  12394. params = null;
  12395. if (Array.isArray(paramsArray) && i in paramsArray) {
  12396. params = this.xref.fetchIfRef(paramsArray[i]);
  12397. }
  12398. stream = this.makeFilter(stream, filter.name, maybeLength, params);
  12399. maybeLength = null;
  12400. }
  12401. }
  12402. return stream;
  12403. }
  12404. makeFilter(stream, name, maybeLength, params) {
  12405. if (maybeLength === 0) {
  12406. warn(`Empty "${name}" stream.`);
  12407. return new NullStream();
  12408. }
  12409. try {
  12410. switch (name) {
  12411. case "Fl":
  12412. case "FlateDecode":
  12413. if (params) {
  12414. return new PredictorStream(new FlateStream(stream, maybeLength), maybeLength, params);
  12415. }
  12416. return new FlateStream(stream, maybeLength);
  12417. case "LZW":
  12418. case "LZWDecode":
  12419. let earlyChange = 1;
  12420. if (params) {
  12421. if (params.has("EarlyChange")) {
  12422. earlyChange = params.get("EarlyChange");
  12423. }
  12424. return new PredictorStream(new LZWStream(stream, maybeLength, earlyChange), maybeLength, params);
  12425. }
  12426. return new LZWStream(stream, maybeLength, earlyChange);
  12427. case "DCT":
  12428. case "DCTDecode":
  12429. return new JpegStream(stream, maybeLength, params);
  12430. case "JPX":
  12431. case "JPXDecode":
  12432. return new JpxStream(stream, maybeLength, params);
  12433. case "A85":
  12434. case "ASCII85Decode":
  12435. return new Ascii85Stream(stream, maybeLength);
  12436. case "AHx":
  12437. case "ASCIIHexDecode":
  12438. return new AsciiHexStream(stream, maybeLength);
  12439. case "CCF":
  12440. case "CCITTFaxDecode":
  12441. return new CCITTFaxStream(stream, maybeLength, params);
  12442. case "RL":
  12443. case "RunLengthDecode":
  12444. return new RunLengthStream(stream, maybeLength);
  12445. case "JBIG2Decode":
  12446. return new Jbig2Stream(stream, maybeLength, params);
  12447. }
  12448. warn(`Filter "${name}" is not supported.`);
  12449. return stream;
  12450. } catch (ex) {
  12451. if (ex instanceof MissingDataException) {
  12452. throw ex;
  12453. }
  12454. warn(`Invalid stream: "${ex}"`);
  12455. return new NullStream();
  12456. }
  12457. }
  12458. }
  12459. const specialChars = [1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
  12460. function toHexDigit(ch) {
  12461. if (ch >= 0x30 && ch <= 0x39) {
  12462. return ch & 0x0f;
  12463. }
  12464. if (ch >= 0x41 && ch <= 0x46 || ch >= 0x61 && ch <= 0x66) {
  12465. return (ch & 0x0f) + 9;
  12466. }
  12467. return -1;
  12468. }
  12469. class Lexer {
  12470. constructor(stream, knownCommands = null) {
  12471. this.stream = stream;
  12472. this.nextChar();
  12473. this.strBuf = [];
  12474. this.knownCommands = knownCommands;
  12475. this._hexStringNumWarn = 0;
  12476. this.beginInlineImagePos = -1;
  12477. }
  12478. nextChar() {
  12479. return this.currentChar = this.stream.getByte();
  12480. }
  12481. peekChar() {
  12482. return this.stream.peekByte();
  12483. }
  12484. getNumber() {
  12485. let ch = this.currentChar;
  12486. let eNotation = false;
  12487. let divideBy = 0;
  12488. let sign = 1;
  12489. if (ch === 0x2d) {
  12490. sign = -1;
  12491. ch = this.nextChar();
  12492. if (ch === 0x2d) {
  12493. ch = this.nextChar();
  12494. }
  12495. } else if (ch === 0x2b) {
  12496. ch = this.nextChar();
  12497. }
  12498. if (ch === 0x0a || ch === 0x0d) {
  12499. do {
  12500. ch = this.nextChar();
  12501. } while (ch === 0x0a || ch === 0x0d);
  12502. }
  12503. if (ch === 0x2e) {
  12504. divideBy = 10;
  12505. ch = this.nextChar();
  12506. }
  12507. if (ch < 0x30 || ch > 0x39) {
  12508. const msg = `Invalid number: ${String.fromCharCode(ch)} (charCode ${ch})`;
  12509. if (isWhiteSpace(ch) || ch === -1) {
  12510. info(`Lexer.getNumber - "${msg}".`);
  12511. return 0;
  12512. }
  12513. throw new FormatError(msg);
  12514. }
  12515. let baseValue = ch - 0x30;
  12516. let powerValue = 0;
  12517. let powerValueSign = 1;
  12518. while ((ch = this.nextChar()) >= 0) {
  12519. if (ch >= 0x30 && ch <= 0x39) {
  12520. const currentDigit = ch - 0x30;
  12521. if (eNotation) {
  12522. powerValue = powerValue * 10 + currentDigit;
  12523. } else {
  12524. if (divideBy !== 0) {
  12525. divideBy *= 10;
  12526. }
  12527. baseValue = baseValue * 10 + currentDigit;
  12528. }
  12529. } else if (ch === 0x2e) {
  12530. if (divideBy === 0) {
  12531. divideBy = 1;
  12532. } else {
  12533. break;
  12534. }
  12535. } else if (ch === 0x2d) {
  12536. warn("Badly formatted number: minus sign in the middle");
  12537. } else if (ch === 0x45 || ch === 0x65) {
  12538. ch = this.peekChar();
  12539. if (ch === 0x2b || ch === 0x2d) {
  12540. powerValueSign = ch === 0x2d ? -1 : 1;
  12541. this.nextChar();
  12542. } else if (ch < 0x30 || ch > 0x39) {
  12543. break;
  12544. }
  12545. eNotation = true;
  12546. } else {
  12547. break;
  12548. }
  12549. }
  12550. if (divideBy !== 0) {
  12551. baseValue /= divideBy;
  12552. }
  12553. if (eNotation) {
  12554. baseValue *= 10 ** (powerValueSign * powerValue);
  12555. }
  12556. return sign * baseValue;
  12557. }
  12558. getString() {
  12559. let numParen = 1;
  12560. let done = false;
  12561. const strBuf = this.strBuf;
  12562. strBuf.length = 0;
  12563. let ch = this.nextChar();
  12564. while (true) {
  12565. let charBuffered = false;
  12566. switch (ch | 0) {
  12567. case -1:
  12568. warn("Unterminated string");
  12569. done = true;
  12570. break;
  12571. case 0x28:
  12572. ++numParen;
  12573. strBuf.push("(");
  12574. break;
  12575. case 0x29:
  12576. if (--numParen === 0) {
  12577. this.nextChar();
  12578. done = true;
  12579. } else {
  12580. strBuf.push(")");
  12581. }
  12582. break;
  12583. case 0x5c:
  12584. ch = this.nextChar();
  12585. switch (ch) {
  12586. case -1:
  12587. warn("Unterminated string");
  12588. done = true;
  12589. break;
  12590. case 0x6e:
  12591. strBuf.push("\n");
  12592. break;
  12593. case 0x72:
  12594. strBuf.push("\r");
  12595. break;
  12596. case 0x74:
  12597. strBuf.push("\t");
  12598. break;
  12599. case 0x62:
  12600. strBuf.push("\b");
  12601. break;
  12602. case 0x66:
  12603. strBuf.push("\f");
  12604. break;
  12605. case 0x5c:
  12606. case 0x28:
  12607. case 0x29:
  12608. strBuf.push(String.fromCharCode(ch));
  12609. break;
  12610. case 0x30:
  12611. case 0x31:
  12612. case 0x32:
  12613. case 0x33:
  12614. case 0x34:
  12615. case 0x35:
  12616. case 0x36:
  12617. case 0x37:
  12618. let x = ch & 0x0f;
  12619. ch = this.nextChar();
  12620. charBuffered = true;
  12621. if (ch >= 0x30 && ch <= 0x37) {
  12622. x = (x << 3) + (ch & 0x0f);
  12623. ch = this.nextChar();
  12624. if (ch >= 0x30 && ch <= 0x37) {
  12625. charBuffered = false;
  12626. x = (x << 3) + (ch & 0x0f);
  12627. }
  12628. }
  12629. strBuf.push(String.fromCharCode(x));
  12630. break;
  12631. case 0x0d:
  12632. if (this.peekChar() === 0x0a) {
  12633. this.nextChar();
  12634. }
  12635. break;
  12636. case 0x0a:
  12637. break;
  12638. default:
  12639. strBuf.push(String.fromCharCode(ch));
  12640. break;
  12641. }
  12642. break;
  12643. default:
  12644. strBuf.push(String.fromCharCode(ch));
  12645. break;
  12646. }
  12647. if (done) {
  12648. break;
  12649. }
  12650. if (!charBuffered) {
  12651. ch = this.nextChar();
  12652. }
  12653. }
  12654. return strBuf.join("");
  12655. }
  12656. getName() {
  12657. let ch, previousCh;
  12658. const strBuf = this.strBuf;
  12659. strBuf.length = 0;
  12660. while ((ch = this.nextChar()) >= 0 && !specialChars[ch]) {
  12661. if (ch === 0x23) {
  12662. ch = this.nextChar();
  12663. if (specialChars[ch]) {
  12664. warn("Lexer_getName: " + "NUMBER SIGN (#) should be followed by a hexadecimal number.");
  12665. strBuf.push("#");
  12666. break;
  12667. }
  12668. const x = toHexDigit(ch);
  12669. if (x !== -1) {
  12670. previousCh = ch;
  12671. ch = this.nextChar();
  12672. const x2 = toHexDigit(ch);
  12673. if (x2 === -1) {
  12674. warn(`Lexer_getName: Illegal digit (${String.fromCharCode(ch)}) ` + "in hexadecimal number.");
  12675. strBuf.push("#", String.fromCharCode(previousCh));
  12676. if (specialChars[ch]) {
  12677. break;
  12678. }
  12679. strBuf.push(String.fromCharCode(ch));
  12680. continue;
  12681. }
  12682. strBuf.push(String.fromCharCode(x << 4 | x2));
  12683. } else {
  12684. strBuf.push("#", String.fromCharCode(ch));
  12685. }
  12686. } else {
  12687. strBuf.push(String.fromCharCode(ch));
  12688. }
  12689. }
  12690. if (strBuf.length > 127) {
  12691. warn(`Name token is longer than allowed by the spec: ${strBuf.length}`);
  12692. }
  12693. return Name.get(strBuf.join(""));
  12694. }
  12695. _hexStringWarn(ch) {
  12696. const MAX_HEX_STRING_NUM_WARN = 5;
  12697. if (this._hexStringNumWarn++ === MAX_HEX_STRING_NUM_WARN) {
  12698. warn("getHexString - ignoring additional invalid characters.");
  12699. return;
  12700. }
  12701. if (this._hexStringNumWarn > MAX_HEX_STRING_NUM_WARN) {
  12702. return;
  12703. }
  12704. warn(`getHexString - ignoring invalid character: ${ch}`);
  12705. }
  12706. getHexString() {
  12707. const strBuf = this.strBuf;
  12708. strBuf.length = 0;
  12709. let ch = this.currentChar;
  12710. let firstDigit = -1,
  12711. digit = -1;
  12712. this._hexStringNumWarn = 0;
  12713. while (true) {
  12714. if (ch < 0) {
  12715. warn("Unterminated hex string");
  12716. break;
  12717. } else if (ch === 0x3e) {
  12718. this.nextChar();
  12719. break;
  12720. } else if (specialChars[ch] === 1) {
  12721. ch = this.nextChar();
  12722. continue;
  12723. } else {
  12724. digit = toHexDigit(ch);
  12725. if (digit === -1) {
  12726. this._hexStringWarn(ch);
  12727. } else if (firstDigit === -1) {
  12728. firstDigit = digit;
  12729. } else {
  12730. strBuf.push(String.fromCharCode(firstDigit << 4 | digit));
  12731. firstDigit = -1;
  12732. }
  12733. ch = this.nextChar();
  12734. }
  12735. }
  12736. if (firstDigit !== -1) {
  12737. strBuf.push(String.fromCharCode(firstDigit << 4));
  12738. }
  12739. return strBuf.join("");
  12740. }
  12741. getObj() {
  12742. let comment = false;
  12743. let ch = this.currentChar;
  12744. while (true) {
  12745. if (ch < 0) {
  12746. return EOF;
  12747. }
  12748. if (comment) {
  12749. if (ch === 0x0a || ch === 0x0d) {
  12750. comment = false;
  12751. }
  12752. } else if (ch === 0x25) {
  12753. comment = true;
  12754. } else if (specialChars[ch] !== 1) {
  12755. break;
  12756. }
  12757. ch = this.nextChar();
  12758. }
  12759. switch (ch | 0) {
  12760. case 0x30:
  12761. case 0x31:
  12762. case 0x32:
  12763. case 0x33:
  12764. case 0x34:
  12765. case 0x35:
  12766. case 0x36:
  12767. case 0x37:
  12768. case 0x38:
  12769. case 0x39:
  12770. case 0x2b:
  12771. case 0x2d:
  12772. case 0x2e:
  12773. return this.getNumber();
  12774. case 0x28:
  12775. return this.getString();
  12776. case 0x2f:
  12777. return this.getName();
  12778. case 0x5b:
  12779. this.nextChar();
  12780. return Cmd.get("[");
  12781. case 0x5d:
  12782. this.nextChar();
  12783. return Cmd.get("]");
  12784. case 0x3c:
  12785. ch = this.nextChar();
  12786. if (ch === 0x3c) {
  12787. this.nextChar();
  12788. return Cmd.get("<<");
  12789. }
  12790. return this.getHexString();
  12791. case 0x3e:
  12792. ch = this.nextChar();
  12793. if (ch === 0x3e) {
  12794. this.nextChar();
  12795. return Cmd.get(">>");
  12796. }
  12797. return Cmd.get(">");
  12798. case 0x7b:
  12799. this.nextChar();
  12800. return Cmd.get("{");
  12801. case 0x7d:
  12802. this.nextChar();
  12803. return Cmd.get("}");
  12804. case 0x29:
  12805. this.nextChar();
  12806. throw new FormatError(`Illegal character: ${ch}`);
  12807. }
  12808. let str = String.fromCharCode(ch);
  12809. if (ch < 0x20 || ch > 0x7f) {
  12810. const nextCh = this.peekChar();
  12811. if (nextCh >= 0x20 && nextCh <= 0x7f) {
  12812. this.nextChar();
  12813. return Cmd.get(str);
  12814. }
  12815. }
  12816. const knownCommands = this.knownCommands;
  12817. let knownCommandFound = knownCommands?.[str] !== undefined;
  12818. while ((ch = this.nextChar()) >= 0 && !specialChars[ch]) {
  12819. const possibleCommand = str + String.fromCharCode(ch);
  12820. if (knownCommandFound && knownCommands[possibleCommand] === undefined) {
  12821. break;
  12822. }
  12823. if (str.length === 128) {
  12824. throw new FormatError(`Command token too long: ${str.length}`);
  12825. }
  12826. str = possibleCommand;
  12827. knownCommandFound = knownCommands?.[str] !== undefined;
  12828. }
  12829. if (str === "true") {
  12830. return true;
  12831. }
  12832. if (str === "false") {
  12833. return false;
  12834. }
  12835. if (str === "null") {
  12836. return null;
  12837. }
  12838. if (str === "BI") {
  12839. this.beginInlineImagePos = this.stream.pos;
  12840. }
  12841. return Cmd.get(str);
  12842. }
  12843. skipToNextLine() {
  12844. let ch = this.currentChar;
  12845. while (ch >= 0) {
  12846. if (ch === 0x0d) {
  12847. ch = this.nextChar();
  12848. if (ch === 0x0a) {
  12849. this.nextChar();
  12850. }
  12851. break;
  12852. } else if (ch === 0x0a) {
  12853. this.nextChar();
  12854. break;
  12855. }
  12856. ch = this.nextChar();
  12857. }
  12858. }
  12859. }
  12860. class Linearization {
  12861. static create(stream) {
  12862. function getInt(linDict, name, allowZeroValue = false) {
  12863. const obj = linDict.get(name);
  12864. if (Number.isInteger(obj) && (allowZeroValue ? obj >= 0 : obj > 0)) {
  12865. return obj;
  12866. }
  12867. throw new Error(`The "${name}" parameter in the linearization ` + "dictionary is invalid.");
  12868. }
  12869. function getHints(linDict) {
  12870. const hints = linDict.get("H");
  12871. let hintsLength;
  12872. if (Array.isArray(hints) && ((hintsLength = hints.length) === 2 || hintsLength === 4)) {
  12873. for (let index = 0; index < hintsLength; index++) {
  12874. const hint = hints[index];
  12875. if (!(Number.isInteger(hint) && hint > 0)) {
  12876. throw new Error(`Hint (${index}) in the linearization dictionary is invalid.`);
  12877. }
  12878. }
  12879. return hints;
  12880. }
  12881. throw new Error("Hint array in the linearization dictionary is invalid.");
  12882. }
  12883. const parser = new Parser({
  12884. lexer: new Lexer(stream),
  12885. xref: null
  12886. });
  12887. const obj1 = parser.getObj();
  12888. const obj2 = parser.getObj();
  12889. const obj3 = parser.getObj();
  12890. const linDict = parser.getObj();
  12891. let obj, length;
  12892. if (!(Number.isInteger(obj1) && Number.isInteger(obj2) && isCmd(obj3, "obj") && linDict instanceof Dict && typeof (obj = linDict.get("Linearized")) === "number" && obj > 0)) {
  12893. return null;
  12894. } else if ((length = getInt(linDict, "L")) !== stream.length) {
  12895. throw new Error('The "L" parameter in the linearization dictionary ' + "does not equal the stream length.");
  12896. }
  12897. return {
  12898. length,
  12899. hints: getHints(linDict),
  12900. objectNumberFirst: getInt(linDict, "O"),
  12901. endFirst: getInt(linDict, "E"),
  12902. numPages: getInt(linDict, "N"),
  12903. mainXRefEntriesOffset: getInt(linDict, "T"),
  12904. pageFirst: linDict.has("P") ? getInt(linDict, "P", true) : 0
  12905. };
  12906. }
  12907. }
  12908. ;// ./src/core/cmap.js
  12909. const BUILT_IN_CMAPS = ["Adobe-GB1-UCS2", "Adobe-CNS1-UCS2", "Adobe-Japan1-UCS2", "Adobe-Korea1-UCS2", "78-EUC-H", "78-EUC-V", "78-H", "78-RKSJ-H", "78-RKSJ-V", "78-V", "78ms-RKSJ-H", "78ms-RKSJ-V", "83pv-RKSJ-H", "90ms-RKSJ-H", "90ms-RKSJ-V", "90msp-RKSJ-H", "90msp-RKSJ-V", "90pv-RKSJ-H", "90pv-RKSJ-V", "Add-H", "Add-RKSJ-H", "Add-RKSJ-V", "Add-V", "Adobe-CNS1-0", "Adobe-CNS1-1", "Adobe-CNS1-2", "Adobe-CNS1-3", "Adobe-CNS1-4", "Adobe-CNS1-5", "Adobe-CNS1-6", "Adobe-GB1-0", "Adobe-GB1-1", "Adobe-GB1-2", "Adobe-GB1-3", "Adobe-GB1-4", "Adobe-GB1-5", "Adobe-Japan1-0", "Adobe-Japan1-1", "Adobe-Japan1-2", "Adobe-Japan1-3", "Adobe-Japan1-4", "Adobe-Japan1-5", "Adobe-Japan1-6", "Adobe-Korea1-0", "Adobe-Korea1-1", "Adobe-Korea1-2", "B5-H", "B5-V", "B5pc-H", "B5pc-V", "CNS-EUC-H", "CNS-EUC-V", "CNS1-H", "CNS1-V", "CNS2-H", "CNS2-V", "ETHK-B5-H", "ETHK-B5-V", "ETen-B5-H", "ETen-B5-V", "ETenms-B5-H", "ETenms-B5-V", "EUC-H", "EUC-V", "Ext-H", "Ext-RKSJ-H", "Ext-RKSJ-V", "Ext-V", "GB-EUC-H", "GB-EUC-V", "GB-H", "GB-V", "GBK-EUC-H", "GBK-EUC-V", "GBK2K-H", "GBK2K-V", "GBKp-EUC-H", "GBKp-EUC-V", "GBT-EUC-H", "GBT-EUC-V", "GBT-H", "GBT-V", "GBTpc-EUC-H", "GBTpc-EUC-V", "GBpc-EUC-H", "GBpc-EUC-V", "H", "HKdla-B5-H", "HKdla-B5-V", "HKdlb-B5-H", "HKdlb-B5-V", "HKgccs-B5-H", "HKgccs-B5-V", "HKm314-B5-H", "HKm314-B5-V", "HKm471-B5-H", "HKm471-B5-V", "HKscs-B5-H", "HKscs-B5-V", "Hankaku", "Hiragana", "KSC-EUC-H", "KSC-EUC-V", "KSC-H", "KSC-Johab-H", "KSC-Johab-V", "KSC-V", "KSCms-UHC-H", "KSCms-UHC-HW-H", "KSCms-UHC-HW-V", "KSCms-UHC-V", "KSCpc-EUC-H", "KSCpc-EUC-V", "Katakana", "NWP-H", "NWP-V", "RKSJ-H", "RKSJ-V", "Roman", "UniCNS-UCS2-H", "UniCNS-UCS2-V", "UniCNS-UTF16-H", "UniCNS-UTF16-V", "UniCNS-UTF32-H", "UniCNS-UTF32-V", "UniCNS-UTF8-H", "UniCNS-UTF8-V", "UniGB-UCS2-H", "UniGB-UCS2-V", "UniGB-UTF16-H", "UniGB-UTF16-V", "UniGB-UTF32-H", "UniGB-UTF32-V", "UniGB-UTF8-H", "UniGB-UTF8-V", "UniJIS-UCS2-H", "UniJIS-UCS2-HW-H", "UniJIS-UCS2-HW-V", "UniJIS-UCS2-V", "UniJIS-UTF16-H", "UniJIS-UTF16-V", "UniJIS-UTF32-H", "UniJIS-UTF32-V", "UniJIS-UTF8-H", "UniJIS-UTF8-V", "UniJIS2004-UTF16-H", "UniJIS2004-UTF16-V", "UniJIS2004-UTF32-H", "UniJIS2004-UTF32-V", "UniJIS2004-UTF8-H", "UniJIS2004-UTF8-V", "UniJISPro-UCS2-HW-V", "UniJISPro-UCS2-V", "UniJISPro-UTF8-V", "UniJISX0213-UTF32-H", "UniJISX0213-UTF32-V", "UniJISX02132004-UTF32-H", "UniJISX02132004-UTF32-V", "UniKS-UCS2-H", "UniKS-UCS2-V", "UniKS-UTF16-H", "UniKS-UTF16-V", "UniKS-UTF32-H", "UniKS-UTF32-V", "UniKS-UTF8-H", "UniKS-UTF8-V", "V", "WP-Symbol"];
  12910. const MAX_MAP_RANGE = 2 ** 24 - 1;
  12911. class CMap {
  12912. constructor(builtInCMap = false) {
  12913. this.codespaceRanges = [[], [], [], []];
  12914. this.numCodespaceRanges = 0;
  12915. this._map = [];
  12916. this.name = "";
  12917. this.vertical = false;
  12918. this.useCMap = null;
  12919. this.builtInCMap = builtInCMap;
  12920. }
  12921. addCodespaceRange(n, low, high) {
  12922. this.codespaceRanges[n - 1].push(low, high);
  12923. this.numCodespaceRanges++;
  12924. }
  12925. mapCidRange(low, high, dstLow) {
  12926. if (high - low > MAX_MAP_RANGE) {
  12927. throw new Error("mapCidRange - ignoring data above MAX_MAP_RANGE.");
  12928. }
  12929. while (low <= high) {
  12930. this._map[low++] = dstLow++;
  12931. }
  12932. }
  12933. mapBfRange(low, high, dstLow) {
  12934. if (high - low > MAX_MAP_RANGE) {
  12935. throw new Error("mapBfRange - ignoring data above MAX_MAP_RANGE.");
  12936. }
  12937. const lastByte = dstLow.length - 1;
  12938. while (low <= high) {
  12939. this._map[low++] = dstLow;
  12940. const nextCharCode = dstLow.charCodeAt(lastByte) + 1;
  12941. if (nextCharCode > 0xff) {
  12942. dstLow = dstLow.substring(0, lastByte - 1) + String.fromCharCode(dstLow.charCodeAt(lastByte - 1) + 1) + "\x00";
  12943. continue;
  12944. }
  12945. dstLow = dstLow.substring(0, lastByte) + String.fromCharCode(nextCharCode);
  12946. }
  12947. }
  12948. mapBfRangeToArray(low, high, array) {
  12949. if (high - low > MAX_MAP_RANGE) {
  12950. throw new Error("mapBfRangeToArray - ignoring data above MAX_MAP_RANGE.");
  12951. }
  12952. const ii = array.length;
  12953. let i = 0;
  12954. while (low <= high && i < ii) {
  12955. this._map[low] = array[i++];
  12956. ++low;
  12957. }
  12958. }
  12959. mapOne(src, dst) {
  12960. this._map[src] = dst;
  12961. }
  12962. lookup(code) {
  12963. return this._map[code];
  12964. }
  12965. contains(code) {
  12966. return this._map[code] !== undefined;
  12967. }
  12968. forEach(callback) {
  12969. const map = this._map;
  12970. const length = map.length;
  12971. if (length <= 0x10000) {
  12972. for (let i = 0; i < length; i++) {
  12973. if (map[i] !== undefined) {
  12974. callback(i, map[i]);
  12975. }
  12976. }
  12977. } else {
  12978. for (const i in map) {
  12979. callback(i, map[i]);
  12980. }
  12981. }
  12982. }
  12983. charCodeOf(value) {
  12984. const map = this._map;
  12985. if (map.length <= 0x10000) {
  12986. return map.indexOf(value);
  12987. }
  12988. for (const charCode in map) {
  12989. if (map[charCode] === value) {
  12990. return charCode | 0;
  12991. }
  12992. }
  12993. return -1;
  12994. }
  12995. getMap() {
  12996. return this._map;
  12997. }
  12998. readCharCode(str, offset, out) {
  12999. let c = 0;
  13000. const codespaceRanges = this.codespaceRanges;
  13001. for (let n = 0, nn = codespaceRanges.length; n < nn; n++) {
  13002. c = (c << 8 | str.charCodeAt(offset + n)) >>> 0;
  13003. const codespaceRange = codespaceRanges[n];
  13004. for (let k = 0, kk = codespaceRange.length; k < kk;) {
  13005. const low = codespaceRange[k++];
  13006. const high = codespaceRange[k++];
  13007. if (c >= low && c <= high) {
  13008. out.charcode = c;
  13009. out.length = n + 1;
  13010. return;
  13011. }
  13012. }
  13013. }
  13014. out.charcode = 0;
  13015. out.length = 1;
  13016. }
  13017. getCharCodeLength(charCode) {
  13018. const codespaceRanges = this.codespaceRanges;
  13019. for (let n = 0, nn = codespaceRanges.length; n < nn; n++) {
  13020. const codespaceRange = codespaceRanges[n];
  13021. for (let k = 0, kk = codespaceRange.length; k < kk;) {
  13022. const low = codespaceRange[k++];
  13023. const high = codespaceRange[k++];
  13024. if (charCode >= low && charCode <= high) {
  13025. return n + 1;
  13026. }
  13027. }
  13028. }
  13029. return 1;
  13030. }
  13031. get length() {
  13032. return this._map.length;
  13033. }
  13034. get isIdentityCMap() {
  13035. if (!(this.name === "Identity-H" || this.name === "Identity-V")) {
  13036. return false;
  13037. }
  13038. if (this._map.length !== 0x10000) {
  13039. return false;
  13040. }
  13041. for (let i = 0; i < 0x10000; i++) {
  13042. if (this._map[i] !== i) {
  13043. return false;
  13044. }
  13045. }
  13046. return true;
  13047. }
  13048. }
  13049. class IdentityCMap extends CMap {
  13050. constructor(vertical, n) {
  13051. super();
  13052. this.vertical = vertical;
  13053. this.addCodespaceRange(n, 0, 0xffff);
  13054. }
  13055. mapCidRange(low, high, dstLow) {
  13056. unreachable("should not call mapCidRange");
  13057. }
  13058. mapBfRange(low, high, dstLow) {
  13059. unreachable("should not call mapBfRange");
  13060. }
  13061. mapBfRangeToArray(low, high, array) {
  13062. unreachable("should not call mapBfRangeToArray");
  13063. }
  13064. mapOne(src, dst) {
  13065. unreachable("should not call mapCidOne");
  13066. }
  13067. lookup(code) {
  13068. return Number.isInteger(code) && code <= 0xffff ? code : undefined;
  13069. }
  13070. contains(code) {
  13071. return Number.isInteger(code) && code <= 0xffff;
  13072. }
  13073. forEach(callback) {
  13074. for (let i = 0; i <= 0xffff; i++) {
  13075. callback(i, i);
  13076. }
  13077. }
  13078. charCodeOf(value) {
  13079. return Number.isInteger(value) && value <= 0xffff ? value : -1;
  13080. }
  13081. getMap() {
  13082. const map = new Array(0x10000);
  13083. for (let i = 0; i <= 0xffff; i++) {
  13084. map[i] = i;
  13085. }
  13086. return map;
  13087. }
  13088. get length() {
  13089. return 0x10000;
  13090. }
  13091. get isIdentityCMap() {
  13092. unreachable("should not access .isIdentityCMap");
  13093. }
  13094. }
  13095. function strToInt(str) {
  13096. let a = 0;
  13097. for (let i = 0; i < str.length; i++) {
  13098. a = a << 8 | str.charCodeAt(i);
  13099. }
  13100. return a >>> 0;
  13101. }
  13102. function expectString(obj) {
  13103. if (typeof obj !== "string") {
  13104. throw new FormatError("Malformed CMap: expected string.");
  13105. }
  13106. }
  13107. function expectInt(obj) {
  13108. if (!Number.isInteger(obj)) {
  13109. throw new FormatError("Malformed CMap: expected int.");
  13110. }
  13111. }
  13112. function parseBfChar(cMap, lexer) {
  13113. while (true) {
  13114. let obj = lexer.getObj();
  13115. if (obj === EOF) {
  13116. break;
  13117. }
  13118. if (isCmd(obj, "endbfchar")) {
  13119. return;
  13120. }
  13121. expectString(obj);
  13122. const src = strToInt(obj);
  13123. obj = lexer.getObj();
  13124. expectString(obj);
  13125. const dst = obj;
  13126. cMap.mapOne(src, dst);
  13127. }
  13128. }
  13129. function parseBfRange(cMap, lexer) {
  13130. while (true) {
  13131. let obj = lexer.getObj();
  13132. if (obj === EOF) {
  13133. break;
  13134. }
  13135. if (isCmd(obj, "endbfrange")) {
  13136. return;
  13137. }
  13138. expectString(obj);
  13139. const low = strToInt(obj);
  13140. obj = lexer.getObj();
  13141. expectString(obj);
  13142. const high = strToInt(obj);
  13143. obj = lexer.getObj();
  13144. if (Number.isInteger(obj) || typeof obj === "string") {
  13145. const dstLow = Number.isInteger(obj) ? String.fromCharCode(obj) : obj;
  13146. cMap.mapBfRange(low, high, dstLow);
  13147. } else if (isCmd(obj, "[")) {
  13148. obj = lexer.getObj();
  13149. const array = [];
  13150. while (!isCmd(obj, "]") && obj !== EOF) {
  13151. array.push(obj);
  13152. obj = lexer.getObj();
  13153. }
  13154. cMap.mapBfRangeToArray(low, high, array);
  13155. } else {
  13156. break;
  13157. }
  13158. }
  13159. throw new FormatError("Invalid bf range.");
  13160. }
  13161. function parseCidChar(cMap, lexer) {
  13162. while (true) {
  13163. let obj = lexer.getObj();
  13164. if (obj === EOF) {
  13165. break;
  13166. }
  13167. if (isCmd(obj, "endcidchar")) {
  13168. return;
  13169. }
  13170. expectString(obj);
  13171. const src = strToInt(obj);
  13172. obj = lexer.getObj();
  13173. expectInt(obj);
  13174. const dst = obj;
  13175. cMap.mapOne(src, dst);
  13176. }
  13177. }
  13178. function parseCidRange(cMap, lexer) {
  13179. while (true) {
  13180. let obj = lexer.getObj();
  13181. if (obj === EOF) {
  13182. break;
  13183. }
  13184. if (isCmd(obj, "endcidrange")) {
  13185. return;
  13186. }
  13187. expectString(obj);
  13188. const low = strToInt(obj);
  13189. obj = lexer.getObj();
  13190. expectString(obj);
  13191. const high = strToInt(obj);
  13192. obj = lexer.getObj();
  13193. expectInt(obj);
  13194. const dstLow = obj;
  13195. cMap.mapCidRange(low, high, dstLow);
  13196. }
  13197. }
  13198. function parseCodespaceRange(cMap, lexer) {
  13199. while (true) {
  13200. let obj = lexer.getObj();
  13201. if (obj === EOF) {
  13202. break;
  13203. }
  13204. if (isCmd(obj, "endcodespacerange")) {
  13205. return;
  13206. }
  13207. if (typeof obj !== "string") {
  13208. break;
  13209. }
  13210. const low = strToInt(obj);
  13211. obj = lexer.getObj();
  13212. if (typeof obj !== "string") {
  13213. break;
  13214. }
  13215. const high = strToInt(obj);
  13216. cMap.addCodespaceRange(obj.length, low, high);
  13217. }
  13218. throw new FormatError("Invalid codespace range.");
  13219. }
  13220. function parseWMode(cMap, lexer) {
  13221. const obj = lexer.getObj();
  13222. if (Number.isInteger(obj)) {
  13223. cMap.vertical = !!obj;
  13224. }
  13225. }
  13226. function parseCMapName(cMap, lexer) {
  13227. const obj = lexer.getObj();
  13228. if (obj instanceof Name) {
  13229. cMap.name = obj.name;
  13230. }
  13231. }
  13232. async function parseCMap(cMap, lexer, fetchBuiltInCMap, useCMap) {
  13233. let previous, embeddedUseCMap;
  13234. objLoop: while (true) {
  13235. try {
  13236. const obj = lexer.getObj();
  13237. if (obj === EOF) {
  13238. break;
  13239. } else if (obj instanceof Name) {
  13240. if (obj.name === "WMode") {
  13241. parseWMode(cMap, lexer);
  13242. } else if (obj.name === "CMapName") {
  13243. parseCMapName(cMap, lexer);
  13244. }
  13245. previous = obj;
  13246. } else if (obj instanceof Cmd) {
  13247. switch (obj.cmd) {
  13248. case "endcmap":
  13249. break objLoop;
  13250. case "usecmap":
  13251. if (previous instanceof Name) {
  13252. embeddedUseCMap = previous.name;
  13253. }
  13254. break;
  13255. case "begincodespacerange":
  13256. parseCodespaceRange(cMap, lexer);
  13257. break;
  13258. case "beginbfchar":
  13259. parseBfChar(cMap, lexer);
  13260. break;
  13261. case "begincidchar":
  13262. parseCidChar(cMap, lexer);
  13263. break;
  13264. case "beginbfrange":
  13265. parseBfRange(cMap, lexer);
  13266. break;
  13267. case "begincidrange":
  13268. parseCidRange(cMap, lexer);
  13269. break;
  13270. }
  13271. }
  13272. } catch (ex) {
  13273. if (ex instanceof MissingDataException) {
  13274. throw ex;
  13275. }
  13276. warn("Invalid cMap data: " + ex);
  13277. continue;
  13278. }
  13279. }
  13280. if (!useCMap && embeddedUseCMap) {
  13281. useCMap = embeddedUseCMap;
  13282. }
  13283. if (useCMap) {
  13284. return extendCMap(cMap, fetchBuiltInCMap, useCMap);
  13285. }
  13286. return cMap;
  13287. }
  13288. async function extendCMap(cMap, fetchBuiltInCMap, useCMap) {
  13289. cMap.useCMap = await createBuiltInCMap(useCMap, fetchBuiltInCMap);
  13290. if (cMap.numCodespaceRanges === 0) {
  13291. const useCodespaceRanges = cMap.useCMap.codespaceRanges;
  13292. for (let i = 0; i < useCodespaceRanges.length; i++) {
  13293. cMap.codespaceRanges[i] = useCodespaceRanges[i].slice();
  13294. }
  13295. cMap.numCodespaceRanges = cMap.useCMap.numCodespaceRanges;
  13296. }
  13297. cMap.useCMap.forEach(function (key, value) {
  13298. if (!cMap.contains(key)) {
  13299. cMap.mapOne(key, cMap.useCMap.lookup(key));
  13300. }
  13301. });
  13302. return cMap;
  13303. }
  13304. async function createBuiltInCMap(name, fetchBuiltInCMap) {
  13305. if (name === "Identity-H") {
  13306. return new IdentityCMap(false, 2);
  13307. } else if (name === "Identity-V") {
  13308. return new IdentityCMap(true, 2);
  13309. }
  13310. if (!BUILT_IN_CMAPS.includes(name)) {
  13311. throw new Error("Unknown CMap name: " + name);
  13312. }
  13313. if (!fetchBuiltInCMap) {
  13314. throw new Error("Built-in CMap parameters are not provided.");
  13315. }
  13316. const {
  13317. cMapData,
  13318. compressionType
  13319. } = await fetchBuiltInCMap(name);
  13320. const cMap = new CMap(true);
  13321. if (compressionType === CMapCompressionType.BINARY) {
  13322. return new BinaryCMapReader().process(cMapData, cMap, useCMap => extendCMap(cMap, fetchBuiltInCMap, useCMap));
  13323. }
  13324. if (compressionType === CMapCompressionType.NONE) {
  13325. const lexer = new Lexer(new Stream(cMapData));
  13326. return parseCMap(cMap, lexer, fetchBuiltInCMap, null);
  13327. }
  13328. throw new Error(`Invalid CMap "compressionType" value: ${compressionType}`);
  13329. }
  13330. class CMapFactory {
  13331. static async create({
  13332. encoding,
  13333. fetchBuiltInCMap,
  13334. useCMap
  13335. }) {
  13336. if (encoding instanceof Name) {
  13337. return createBuiltInCMap(encoding.name, fetchBuiltInCMap);
  13338. } else if (encoding instanceof BaseStream) {
  13339. const parsedCMap = await parseCMap(new CMap(), new Lexer(encoding), fetchBuiltInCMap, useCMap);
  13340. if (parsedCMap.isIdentityCMap) {
  13341. return createBuiltInCMap(parsedCMap.name, fetchBuiltInCMap);
  13342. }
  13343. return parsedCMap;
  13344. }
  13345. throw new Error("Encoding required.");
  13346. }
  13347. }
  13348. // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.to-array.js
  13349. var esnext_iterator_to_array = __webpack_require__(1795);
  13350. ;// ./src/core/charsets.js
  13351. const ISOAdobeCharset = [".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quoteright", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "quoteleft", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "exclamdown", "cent", "sterling", "fraction", "yen", "florin", "section", "currency", "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi", "fl", "endash", "dagger", "daggerdbl", "periodcentered", "paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright", "guillemotright", "ellipsis", "perthousand", "questiondown", "grave", "acute", "circumflex", "tilde", "macron", "breve", "dotaccent", "dieresis", "ring", "cedilla", "hungarumlaut", "ogonek", "caron", "emdash", "AE", "ordfeminine", "Lslash", "Oslash", "OE", "ordmasculine", "ae", "dotlessi", "lslash", "oslash", "oe", "germandbls", "onesuperior", "logicalnot", "mu", "trademark", "Eth", "onehalf", "plusminus", "Thorn", "onequarter", "divide", "brokenbar", "degree", "thorn", "threequarters", "twosuperior", "registered", "minus", "eth", "multiply", "threesuperior", "copyright", "Aacute", "Acircumflex", "Adieresis", "Agrave", "Aring", "Atilde", "Ccedilla", "Eacute", "Ecircumflex", "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Ntilde", "Oacute", "Ocircumflex", "Odieresis", "Ograve", "Otilde", "Scaron", "Uacute", "Ucircumflex", "Udieresis", "Ugrave", "Yacute", "Ydieresis", "Zcaron", "aacute", "acircumflex", "adieresis", "agrave", "aring", "atilde", "ccedilla", "eacute", "ecircumflex", "edieresis", "egrave", "iacute", "icircumflex", "idieresis", "igrave", "ntilde", "oacute", "ocircumflex", "odieresis", "ograve", "otilde", "scaron", "uacute", "ucircumflex", "udieresis", "ugrave", "yacute", "ydieresis", "zcaron"];
  13352. const ExpertCharset = [".notdef", "space", "exclamsmall", "Hungarumlautsmall", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "comma", "hyphen", "period", "fraction", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "colon", "semicolon", "commasuperior", "threequartersemdash", "periodsuperior", "questionsmall", "asuperior", "bsuperior", "centsuperior", "dsuperior", "esuperior", "isuperior", "lsuperior", "msuperior", "nsuperior", "osuperior", "rsuperior", "ssuperior", "tsuperior", "ff", "fi", "fl", "ffi", "ffl", "parenleftinferior", "parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", "exclamdownsmall", "centoldstyle", "Lslashsmall", "Scaronsmall", "Zcaronsmall", "Dieresissmall", "Brevesmall", "Caronsmall", "Dotaccentsmall", "Macronsmall", "figuredash", "hypheninferior", "Ogoneksmall", "Ringsmall", "Cedillasmall", "onequarter", "onehalf", "threequarters", "questiondownsmall", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "zerosuperior", "onesuperior", "twosuperior", "threesuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior", "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior", "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior", "periodinferior", "commainferior", "Agravesmall", "Aacutesmall", "Acircumflexsmall", "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall", "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", "Igravesmall", "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall", "Ntildesmall", "Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall", "Odieresissmall", "OEsmall", "Oslashsmall", "Ugravesmall", "Uacutesmall", "Ucircumflexsmall", "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall"];
  13353. const ExpertSubsetCharset = [".notdef", "space", "dollaroldstyle", "dollarsuperior", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "comma", "hyphen", "period", "fraction", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "colon", "semicolon", "commasuperior", "threequartersemdash", "periodsuperior", "asuperior", "bsuperior", "centsuperior", "dsuperior", "esuperior", "isuperior", "lsuperior", "msuperior", "nsuperior", "osuperior", "rsuperior", "ssuperior", "tsuperior", "ff", "fi", "fl", "ffi", "ffl", "parenleftinferior", "parenrightinferior", "hyphensuperior", "colonmonetary", "onefitted", "rupiah", "centoldstyle", "figuredash", "hypheninferior", "onequarter", "onehalf", "threequarters", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "zerosuperior", "onesuperior", "twosuperior", "threesuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior", "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior", "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior", "periodinferior", "commainferior"];
  13354. ;// ./src/core/encodings.js
  13355. const ExpertEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclamsmall", "Hungarumlautsmall", "", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "comma", "hyphen", "period", "fraction", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "colon", "semicolon", "commasuperior", "threequartersemdash", "periodsuperior", "questionsmall", "", "asuperior", "bsuperior", "centsuperior", "dsuperior", "esuperior", "", "", "", "isuperior", "", "", "lsuperior", "msuperior", "nsuperior", "osuperior", "", "", "rsuperior", "ssuperior", "tsuperior", "", "ff", "fi", "fl", "ffi", "ffl", "parenleftinferior", "", "parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "exclamdownsmall", "centoldstyle", "Lslashsmall", "", "", "Scaronsmall", "Zcaronsmall", "Dieresissmall", "Brevesmall", "Caronsmall", "", "Dotaccentsmall", "", "", "Macronsmall", "", "", "figuredash", "hypheninferior", "", "", "Ogoneksmall", "Ringsmall", "Cedillasmall", "", "", "", "onequarter", "onehalf", "threequarters", "questiondownsmall", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "", "", "zerosuperior", "onesuperior", "twosuperior", "threesuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior", "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior", "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior", "periodinferior", "commainferior", "Agravesmall", "Aacutesmall", "Acircumflexsmall", "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall", "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", "Igravesmall", "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall", "Ntildesmall", "Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall", "Odieresissmall", "OEsmall", "Oslashsmall", "Ugravesmall", "Uacutesmall", "Ucircumflexsmall", "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall"];
  13356. const MacExpertEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclamsmall", "Hungarumlautsmall", "centoldstyle", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "comma", "hyphen", "period", "fraction", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "colon", "semicolon", "", "threequartersemdash", "", "questionsmall", "", "", "", "", "Ethsmall", "", "", "onequarter", "onehalf", "threequarters", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "", "", "", "", "", "", "ff", "fi", "fl", "ffi", "ffl", "parenleftinferior", "", "parenrightinferior", "Circumflexsmall", "hypheninferior", "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", "", "", "asuperior", "centsuperior", "", "", "", "", "Aacutesmall", "Agravesmall", "Acircumflexsmall", "Adieresissmall", "Atildesmall", "Aringsmall", "Ccedillasmall", "Eacutesmall", "Egravesmall", "Ecircumflexsmall", "Edieresissmall", "Iacutesmall", "Igravesmall", "Icircumflexsmall", "Idieresissmall", "Ntildesmall", "Oacutesmall", "Ogravesmall", "Ocircumflexsmall", "Odieresissmall", "Otildesmall", "Uacutesmall", "Ugravesmall", "Ucircumflexsmall", "Udieresissmall", "", "eightsuperior", "fourinferior", "threeinferior", "sixinferior", "eightinferior", "seveninferior", "Scaronsmall", "", "centinferior", "twoinferior", "", "Dieresissmall", "", "Caronsmall", "osuperior", "fiveinferior", "", "commainferior", "periodinferior", "Yacutesmall", "", "dollarinferior", "", "", "Thornsmall", "", "nineinferior", "zeroinferior", "Zcaronsmall", "AEsmall", "Oslashsmall", "questiondownsmall", "oneinferior", "Lslashsmall", "", "", "", "", "", "", "Cedillasmall", "", "", "", "", "", "OEsmall", "figuredash", "hyphensuperior", "", "", "", "", "exclamdownsmall", "", "Ydieresissmall", "", "onesuperior", "twosuperior", "threesuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "ninesuperior", "zerosuperior", "", "esuperior", "rsuperior", "tsuperior", "", "", "isuperior", "ssuperior", "dsuperior", "", "", "", "", "", "lsuperior", "Ogoneksmall", "Brevesmall", "Macronsmall", "bsuperior", "nsuperior", "msuperior", "commasuperior", "periodsuperior", "Dotaccentsmall", "Ringsmall", "", "", "", ""];
  13357. const MacRomanEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "", "Adieresis", "Aring", "Ccedilla", "Eacute", "Ntilde", "Odieresis", "Udieresis", "aacute", "agrave", "acircumflex", "adieresis", "atilde", "aring", "ccedilla", "eacute", "egrave", "ecircumflex", "edieresis", "iacute", "igrave", "icircumflex", "idieresis", "ntilde", "oacute", "ograve", "ocircumflex", "odieresis", "otilde", "uacute", "ugrave", "ucircumflex", "udieresis", "dagger", "degree", "cent", "sterling", "section", "bullet", "paragraph", "germandbls", "registered", "copyright", "trademark", "acute", "dieresis", "notequal", "AE", "Oslash", "infinity", "plusminus", "lessequal", "greaterequal", "yen", "mu", "partialdiff", "summation", "product", "pi", "integral", "ordfeminine", "ordmasculine", "Omega", "ae", "oslash", "questiondown", "exclamdown", "logicalnot", "radical", "florin", "approxequal", "Delta", "guillemotleft", "guillemotright", "ellipsis", "space", "Agrave", "Atilde", "Otilde", "OE", "oe", "endash", "emdash", "quotedblleft", "quotedblright", "quoteleft", "quoteright", "divide", "lozenge", "ydieresis", "Ydieresis", "fraction", "currency", "guilsinglleft", "guilsinglright", "fi", "fl", "daggerdbl", "periodcentered", "quotesinglbase", "quotedblbase", "perthousand", "Acircumflex", "Ecircumflex", "Aacute", "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Oacute", "Ocircumflex", "apple", "Ograve", "Uacute", "Ucircumflex", "Ugrave", "dotlessi", "circumflex", "tilde", "macron", "breve", "dotaccent", "ring", "cedilla", "hungarumlaut", "ogonek", "caron"];
  13358. const StandardEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quoteright", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "quoteleft", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "exclamdown", "cent", "sterling", "fraction", "yen", "florin", "section", "currency", "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi", "fl", "", "endash", "dagger", "daggerdbl", "periodcentered", "", "paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright", "guillemotright", "ellipsis", "perthousand", "", "questiondown", "", "grave", "acute", "circumflex", "tilde", "macron", "breve", "dotaccent", "dieresis", "", "ring", "cedilla", "", "hungarumlaut", "ogonek", "caron", "emdash", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "AE", "", "ordfeminine", "", "", "", "", "Lslash", "Oslash", "OE", "ordmasculine", "", "", "", "", "", "ae", "", "", "", "dotlessi", "", "", "lslash", "oslash", "oe", "germandbls", "", "", "", ""];
  13359. const WinAnsiEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "bullet", "Euro", "bullet", "quotesinglbase", "florin", "quotedblbase", "ellipsis", "dagger", "daggerdbl", "circumflex", "perthousand", "Scaron", "guilsinglleft", "OE", "bullet", "Zcaron", "bullet", "bullet", "quoteleft", "quoteright", "quotedblleft", "quotedblright", "bullet", "endash", "emdash", "tilde", "trademark", "scaron", "guilsinglright", "oe", "bullet", "zcaron", "Ydieresis", "space", "exclamdown", "cent", "sterling", "currency", "yen", "brokenbar", "section", "dieresis", "copyright", "ordfeminine", "guillemotleft", "logicalnot", "hyphen", "registered", "macron", "degree", "plusminus", "twosuperior", "threesuperior", "acute", "mu", "paragraph", "periodcentered", "cedilla", "onesuperior", "ordmasculine", "guillemotright", "onequarter", "onehalf", "threequarters", "questiondown", "Agrave", "Aacute", "Acircumflex", "Atilde", "Adieresis", "Aring", "AE", "Ccedilla", "Egrave", "Eacute", "Ecircumflex", "Edieresis", "Igrave", "Iacute", "Icircumflex", "Idieresis", "Eth", "Ntilde", "Ograve", "Oacute", "Ocircumflex", "Otilde", "Odieresis", "multiply", "Oslash", "Ugrave", "Uacute", "Ucircumflex", "Udieresis", "Yacute", "Thorn", "germandbls", "agrave", "aacute", "acircumflex", "atilde", "adieresis", "aring", "ae", "ccedilla", "egrave", "eacute", "ecircumflex", "edieresis", "igrave", "iacute", "icircumflex", "idieresis", "eth", "ntilde", "ograve", "oacute", "ocircumflex", "otilde", "odieresis", "divide", "oslash", "ugrave", "uacute", "ucircumflex", "udieresis", "yacute", "thorn", "ydieresis"];
  13360. const SymbolSetEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclam", "universal", "numbersign", "existential", "percent", "ampersand", "suchthat", "parenleft", "parenright", "asteriskmath", "plus", "comma", "minus", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "congruent", "Alpha", "Beta", "Chi", "Delta", "Epsilon", "Phi", "Gamma", "Eta", "Iota", "theta1", "Kappa", "Lambda", "Mu", "Nu", "Omicron", "Pi", "Theta", "Rho", "Sigma", "Tau", "Upsilon", "sigma1", "Omega", "Xi", "Psi", "Zeta", "bracketleft", "therefore", "bracketright", "perpendicular", "underscore", "radicalex", "alpha", "beta", "chi", "delta", "epsilon", "phi", "gamma", "eta", "iota", "phi1", "kappa", "lambda", "mu", "nu", "omicron", "pi", "theta", "rho", "sigma", "tau", "upsilon", "omega1", "omega", "xi", "psi", "zeta", "braceleft", "bar", "braceright", "similar", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "Euro", "Upsilon1", "minute", "lessequal", "fraction", "infinity", "florin", "club", "diamond", "heart", "spade", "arrowboth", "arrowleft", "arrowup", "arrowright", "arrowdown", "degree", "plusminus", "second", "greaterequal", "multiply", "proportional", "partialdiff", "bullet", "divide", "notequal", "equivalence", "approxequal", "ellipsis", "arrowvertex", "arrowhorizex", "carriagereturn", "aleph", "Ifraktur", "Rfraktur", "weierstrass", "circlemultiply", "circleplus", "emptyset", "intersection", "union", "propersuperset", "reflexsuperset", "notsubset", "propersubset", "reflexsubset", "element", "notelement", "angle", "gradient", "registerserif", "copyrightserif", "trademarkserif", "product", "radical", "dotmath", "logicalnot", "logicaland", "logicalor", "arrowdblboth", "arrowdblleft", "arrowdblup", "arrowdblright", "arrowdbldown", "lozenge", "angleleft", "registersans", "copyrightsans", "trademarksans", "summation", "parenlefttp", "parenleftex", "parenleftbt", "bracketlefttp", "bracketleftex", "bracketleftbt", "bracelefttp", "braceleftmid", "braceleftbt", "braceex", "", "angleright", "integral", "integraltp", "integralex", "integralbt", "parenrighttp", "parenrightex", "parenrightbt", "bracketrighttp", "bracketrightex", "bracketrightbt", "bracerighttp", "bracerightmid", "bracerightbt", ""];
  13361. const ZapfDingbatsEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "a1", "a2", "a202", "a3", "a4", "a5", "a119", "a118", "a117", "a11", "a12", "a13", "a14", "a15", "a16", "a105", "a17", "a18", "a19", "a20", "a21", "a22", "a23", "a24", "a25", "a26", "a27", "a28", "a6", "a7", "a8", "a9", "a10", "a29", "a30", "a31", "a32", "a33", "a34", "a35", "a36", "a37", "a38", "a39", "a40", "a41", "a42", "a43", "a44", "a45", "a46", "a47", "a48", "a49", "a50", "a51", "a52", "a53", "a54", "a55", "a56", "a57", "a58", "a59", "a60", "a61", "a62", "a63", "a64", "a65", "a66", "a67", "a68", "a69", "a70", "a71", "a72", "a73", "a74", "a203", "a75", "a204", "a76", "a77", "a78", "a79", "a81", "a82", "a83", "a84", "a97", "a98", "a99", "a100", "", "a89", "a90", "a93", "a94", "a91", "a92", "a205", "a85", "a206", "a86", "a87", "a88", "a95", "a96", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "a101", "a102", "a103", "a104", "a106", "a107", "a108", "a112", "a111", "a110", "a109", "a120", "a121", "a122", "a123", "a124", "a125", "a126", "a127", "a128", "a129", "a130", "a131", "a132", "a133", "a134", "a135", "a136", "a137", "a138", "a139", "a140", "a141", "a142", "a143", "a144", "a145", "a146", "a147", "a148", "a149", "a150", "a151", "a152", "a153", "a154", "a155", "a156", "a157", "a158", "a159", "a160", "a161", "a163", "a164", "a196", "a165", "a192", "a166", "a167", "a168", "a169", "a170", "a171", "a172", "a173", "a162", "a174", "a175", "a176", "a177", "a178", "a179", "a193", "a180", "a199", "a181", "a200", "a182", "", "a201", "a183", "a184", "a197", "a185", "a194", "a198", "a186", "a195", "a187", "a188", "a189", "a190", "a191", ""];
  13362. function getEncoding(encodingName) {
  13363. switch (encodingName) {
  13364. case "WinAnsiEncoding":
  13365. return WinAnsiEncoding;
  13366. case "StandardEncoding":
  13367. return StandardEncoding;
  13368. case "MacRomanEncoding":
  13369. return MacRomanEncoding;
  13370. case "SymbolSetEncoding":
  13371. return SymbolSetEncoding;
  13372. case "ZapfDingbatsEncoding":
  13373. return ZapfDingbatsEncoding;
  13374. case "ExpertEncoding":
  13375. return ExpertEncoding;
  13376. case "MacExpertEncoding":
  13377. return MacExpertEncoding;
  13378. default:
  13379. return null;
  13380. }
  13381. }
  13382. ;// ./src/core/cff_parser.js
  13383. const MAX_SUBR_NESTING = 10;
  13384. const CFFStandardStrings = [".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quoteright", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "quoteleft", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "exclamdown", "cent", "sterling", "fraction", "yen", "florin", "section", "currency", "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi", "fl", "endash", "dagger", "daggerdbl", "periodcentered", "paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright", "guillemotright", "ellipsis", "perthousand", "questiondown", "grave", "acute", "circumflex", "tilde", "macron", "breve", "dotaccent", "dieresis", "ring", "cedilla", "hungarumlaut", "ogonek", "caron", "emdash", "AE", "ordfeminine", "Lslash", "Oslash", "OE", "ordmasculine", "ae", "dotlessi", "lslash", "oslash", "oe", "germandbls", "onesuperior", "logicalnot", "mu", "trademark", "Eth", "onehalf", "plusminus", "Thorn", "onequarter", "divide", "brokenbar", "degree", "thorn", "threequarters", "twosuperior", "registered", "minus", "eth", "multiply", "threesuperior", "copyright", "Aacute", "Acircumflex", "Adieresis", "Agrave", "Aring", "Atilde", "Ccedilla", "Eacute", "Ecircumflex", "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Ntilde", "Oacute", "Ocircumflex", "Odieresis", "Ograve", "Otilde", "Scaron", "Uacute", "Ucircumflex", "Udieresis", "Ugrave", "Yacute", "Ydieresis", "Zcaron", "aacute", "acircumflex", "adieresis", "agrave", "aring", "atilde", "ccedilla", "eacute", "ecircumflex", "edieresis", "egrave", "iacute", "icircumflex", "idieresis", "igrave", "ntilde", "oacute", "ocircumflex", "odieresis", "ograve", "otilde", "scaron", "uacute", "ucircumflex", "udieresis", "ugrave", "yacute", "ydieresis", "zcaron", "exclamsmall", "Hungarumlautsmall", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "commasuperior", "threequartersemdash", "periodsuperior", "questionsmall", "asuperior", "bsuperior", "centsuperior", "dsuperior", "esuperior", "isuperior", "lsuperior", "msuperior", "nsuperior", "osuperior", "rsuperior", "ssuperior", "tsuperior", "ff", "ffi", "ffl", "parenleftinferior", "parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", "exclamdownsmall", "centoldstyle", "Lslashsmall", "Scaronsmall", "Zcaronsmall", "Dieresissmall", "Brevesmall", "Caronsmall", "Dotaccentsmall", "Macronsmall", "figuredash", "hypheninferior", "Ogoneksmall", "Ringsmall", "Cedillasmall", "questiondownsmall", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "zerosuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior", "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior", "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior", "periodinferior", "commainferior", "Agravesmall", "Aacutesmall", "Acircumflexsmall", "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall", "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", "Igravesmall", "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall", "Ntildesmall", "Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall", "Odieresissmall", "OEsmall", "Oslashsmall", "Ugravesmall", "Uacutesmall", "Ucircumflexsmall", "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall", "001.000", "001.001", "001.002", "001.003", "Black", "Bold", "Book", "Light", "Medium", "Regular", "Roman", "Semibold"];
  13385. const NUM_STANDARD_CFF_STRINGS = 391;
  13386. const CharstringValidationData = [null, {
  13387. id: "hstem",
  13388. min: 2,
  13389. stackClearing: true,
  13390. stem: true
  13391. }, null, {
  13392. id: "vstem",
  13393. min: 2,
  13394. stackClearing: true,
  13395. stem: true
  13396. }, {
  13397. id: "vmoveto",
  13398. min: 1,
  13399. stackClearing: true
  13400. }, {
  13401. id: "rlineto",
  13402. min: 2,
  13403. resetStack: true
  13404. }, {
  13405. id: "hlineto",
  13406. min: 1,
  13407. resetStack: true
  13408. }, {
  13409. id: "vlineto",
  13410. min: 1,
  13411. resetStack: true
  13412. }, {
  13413. id: "rrcurveto",
  13414. min: 6,
  13415. resetStack: true
  13416. }, null, {
  13417. id: "callsubr",
  13418. min: 1,
  13419. undefStack: true
  13420. }, {
  13421. id: "return",
  13422. min: 0,
  13423. undefStack: true
  13424. }, null, null, {
  13425. id: "endchar",
  13426. min: 0,
  13427. stackClearing: true
  13428. }, null, null, null, {
  13429. id: "hstemhm",
  13430. min: 2,
  13431. stackClearing: true,
  13432. stem: true
  13433. }, {
  13434. id: "hintmask",
  13435. min: 0,
  13436. stackClearing: true
  13437. }, {
  13438. id: "cntrmask",
  13439. min: 0,
  13440. stackClearing: true
  13441. }, {
  13442. id: "rmoveto",
  13443. min: 2,
  13444. stackClearing: true
  13445. }, {
  13446. id: "hmoveto",
  13447. min: 1,
  13448. stackClearing: true
  13449. }, {
  13450. id: "vstemhm",
  13451. min: 2,
  13452. stackClearing: true,
  13453. stem: true
  13454. }, {
  13455. id: "rcurveline",
  13456. min: 8,
  13457. resetStack: true
  13458. }, {
  13459. id: "rlinecurve",
  13460. min: 8,
  13461. resetStack: true
  13462. }, {
  13463. id: "vvcurveto",
  13464. min: 4,
  13465. resetStack: true
  13466. }, {
  13467. id: "hhcurveto",
  13468. min: 4,
  13469. resetStack: true
  13470. }, null, {
  13471. id: "callgsubr",
  13472. min: 1,
  13473. undefStack: true
  13474. }, {
  13475. id: "vhcurveto",
  13476. min: 4,
  13477. resetStack: true
  13478. }, {
  13479. id: "hvcurveto",
  13480. min: 4,
  13481. resetStack: true
  13482. }];
  13483. const CharstringValidationData12 = [null, null, null, {
  13484. id: "and",
  13485. min: 2,
  13486. stackDelta: -1
  13487. }, {
  13488. id: "or",
  13489. min: 2,
  13490. stackDelta: -1
  13491. }, {
  13492. id: "not",
  13493. min: 1,
  13494. stackDelta: 0
  13495. }, null, null, null, {
  13496. id: "abs",
  13497. min: 1,
  13498. stackDelta: 0
  13499. }, {
  13500. id: "add",
  13501. min: 2,
  13502. stackDelta: -1,
  13503. stackFn(stack, index) {
  13504. stack[index - 2] = stack[index - 2] + stack[index - 1];
  13505. }
  13506. }, {
  13507. id: "sub",
  13508. min: 2,
  13509. stackDelta: -1,
  13510. stackFn(stack, index) {
  13511. stack[index - 2] = stack[index - 2] - stack[index - 1];
  13512. }
  13513. }, {
  13514. id: "div",
  13515. min: 2,
  13516. stackDelta: -1,
  13517. stackFn(stack, index) {
  13518. stack[index - 2] = stack[index - 2] / stack[index - 1];
  13519. }
  13520. }, null, {
  13521. id: "neg",
  13522. min: 1,
  13523. stackDelta: 0,
  13524. stackFn(stack, index) {
  13525. stack[index - 1] = -stack[index - 1];
  13526. }
  13527. }, {
  13528. id: "eq",
  13529. min: 2,
  13530. stackDelta: -1
  13531. }, null, null, {
  13532. id: "drop",
  13533. min: 1,
  13534. stackDelta: -1
  13535. }, null, {
  13536. id: "put",
  13537. min: 2,
  13538. stackDelta: -2
  13539. }, {
  13540. id: "get",
  13541. min: 1,
  13542. stackDelta: 0
  13543. }, {
  13544. id: "ifelse",
  13545. min: 4,
  13546. stackDelta: -3
  13547. }, {
  13548. id: "random",
  13549. min: 0,
  13550. stackDelta: 1
  13551. }, {
  13552. id: "mul",
  13553. min: 2,
  13554. stackDelta: -1,
  13555. stackFn(stack, index) {
  13556. stack[index - 2] = stack[index - 2] * stack[index - 1];
  13557. }
  13558. }, null, {
  13559. id: "sqrt",
  13560. min: 1,
  13561. stackDelta: 0
  13562. }, {
  13563. id: "dup",
  13564. min: 1,
  13565. stackDelta: 1
  13566. }, {
  13567. id: "exch",
  13568. min: 2,
  13569. stackDelta: 0
  13570. }, {
  13571. id: "index",
  13572. min: 2,
  13573. stackDelta: 0
  13574. }, {
  13575. id: "roll",
  13576. min: 3,
  13577. stackDelta: -2
  13578. }, null, null, null, {
  13579. id: "hflex",
  13580. min: 7,
  13581. resetStack: true
  13582. }, {
  13583. id: "flex",
  13584. min: 13,
  13585. resetStack: true
  13586. }, {
  13587. id: "hflex1",
  13588. min: 9,
  13589. resetStack: true
  13590. }, {
  13591. id: "flex1",
  13592. min: 11,
  13593. resetStack: true
  13594. }];
  13595. class CFFParser {
  13596. constructor(file, properties, seacAnalysisEnabled) {
  13597. this.bytes = file.getBytes();
  13598. this.properties = properties;
  13599. this.seacAnalysisEnabled = !!seacAnalysisEnabled;
  13600. }
  13601. parse() {
  13602. const properties = this.properties;
  13603. const cff = new CFF();
  13604. this.cff = cff;
  13605. const header = this.parseHeader();
  13606. const nameIndex = this.parseIndex(header.endPos);
  13607. const topDictIndex = this.parseIndex(nameIndex.endPos);
  13608. const stringIndex = this.parseIndex(topDictIndex.endPos);
  13609. const globalSubrIndex = this.parseIndex(stringIndex.endPos);
  13610. const topDictParsed = this.parseDict(topDictIndex.obj.get(0));
  13611. const topDict = this.createDict(CFFTopDict, topDictParsed, cff.strings);
  13612. cff.header = header.obj;
  13613. cff.names = this.parseNameIndex(nameIndex.obj);
  13614. cff.strings = this.parseStringIndex(stringIndex.obj);
  13615. cff.topDict = topDict;
  13616. cff.globalSubrIndex = globalSubrIndex.obj;
  13617. this.parsePrivateDict(cff.topDict);
  13618. cff.isCIDFont = topDict.hasName("ROS");
  13619. const charStringOffset = topDict.getByName("CharStrings");
  13620. const charStringIndex = this.parseIndex(charStringOffset).obj;
  13621. const fontMatrix = topDict.getByName("FontMatrix");
  13622. if (fontMatrix) {
  13623. properties.fontMatrix = fontMatrix;
  13624. }
  13625. const fontBBox = topDict.getByName("FontBBox");
  13626. if (fontBBox) {
  13627. properties.ascent = Math.max(fontBBox[3], fontBBox[1]);
  13628. properties.descent = Math.min(fontBBox[1], fontBBox[3]);
  13629. properties.ascentScaled = true;
  13630. }
  13631. let charset, encoding;
  13632. if (cff.isCIDFont) {
  13633. const fdArrayIndex = this.parseIndex(topDict.getByName("FDArray")).obj;
  13634. for (let i = 0, ii = fdArrayIndex.count; i < ii; ++i) {
  13635. const dictRaw = fdArrayIndex.get(i);
  13636. const fontDict = this.createDict(CFFTopDict, this.parseDict(dictRaw), cff.strings);
  13637. this.parsePrivateDict(fontDict);
  13638. cff.fdArray.push(fontDict);
  13639. }
  13640. encoding = null;
  13641. charset = this.parseCharsets(topDict.getByName("charset"), charStringIndex.count, cff.strings, true);
  13642. cff.fdSelect = this.parseFDSelect(topDict.getByName("FDSelect"), charStringIndex.count);
  13643. } else {
  13644. charset = this.parseCharsets(topDict.getByName("charset"), charStringIndex.count, cff.strings, false);
  13645. encoding = this.parseEncoding(topDict.getByName("Encoding"), properties, cff.strings, charset.charset);
  13646. }
  13647. cff.charset = charset;
  13648. cff.encoding = encoding;
  13649. const charStringsAndSeacs = this.parseCharStrings({
  13650. charStrings: charStringIndex,
  13651. localSubrIndex: topDict.privateDict.subrsIndex,
  13652. globalSubrIndex: globalSubrIndex.obj,
  13653. fdSelect: cff.fdSelect,
  13654. fdArray: cff.fdArray,
  13655. privateDict: topDict.privateDict
  13656. });
  13657. cff.charStrings = charStringsAndSeacs.charStrings;
  13658. cff.seacs = charStringsAndSeacs.seacs;
  13659. cff.widths = charStringsAndSeacs.widths;
  13660. return cff;
  13661. }
  13662. parseHeader() {
  13663. let bytes = this.bytes;
  13664. const bytesLength = bytes.length;
  13665. let offset = 0;
  13666. while (offset < bytesLength && bytes[offset] !== 1) {
  13667. ++offset;
  13668. }
  13669. if (offset >= bytesLength) {
  13670. throw new FormatError("Invalid CFF header");
  13671. }
  13672. if (offset !== 0) {
  13673. info("cff data is shifted");
  13674. bytes = bytes.subarray(offset);
  13675. this.bytes = bytes;
  13676. }
  13677. const major = bytes[0];
  13678. const minor = bytes[1];
  13679. const hdrSize = bytes[2];
  13680. const offSize = bytes[3];
  13681. const header = new CFFHeader(major, minor, hdrSize, offSize);
  13682. return {
  13683. obj: header,
  13684. endPos: hdrSize
  13685. };
  13686. }
  13687. parseDict(dict) {
  13688. let pos = 0;
  13689. function parseOperand() {
  13690. let value = dict[pos++];
  13691. if (value === 30) {
  13692. return parseFloatOperand();
  13693. } else if (value === 28) {
  13694. value = dict[pos++];
  13695. value = (value << 24 | dict[pos++] << 16) >> 16;
  13696. return value;
  13697. } else if (value === 29) {
  13698. value = dict[pos++];
  13699. value = value << 8 | dict[pos++];
  13700. value = value << 8 | dict[pos++];
  13701. value = value << 8 | dict[pos++];
  13702. return value;
  13703. } else if (value >= 32 && value <= 246) {
  13704. return value - 139;
  13705. } else if (value >= 247 && value <= 250) {
  13706. return (value - 247) * 256 + dict[pos++] + 108;
  13707. } else if (value >= 251 && value <= 254) {
  13708. return -((value - 251) * 256) - dict[pos++] - 108;
  13709. }
  13710. warn('CFFParser_parseDict: "' + value + '" is a reserved command.');
  13711. return NaN;
  13712. }
  13713. function parseFloatOperand() {
  13714. let str = "";
  13715. const eof = 15;
  13716. const lookup = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ".", "E", "E-", null, "-"];
  13717. const length = dict.length;
  13718. while (pos < length) {
  13719. const b = dict[pos++];
  13720. const b1 = b >> 4;
  13721. const b2 = b & 15;
  13722. if (b1 === eof) {
  13723. break;
  13724. }
  13725. str += lookup[b1];
  13726. if (b2 === eof) {
  13727. break;
  13728. }
  13729. str += lookup[b2];
  13730. }
  13731. return parseFloat(str);
  13732. }
  13733. let operands = [];
  13734. const entries = [];
  13735. pos = 0;
  13736. const end = dict.length;
  13737. while (pos < end) {
  13738. let b = dict[pos];
  13739. if (b <= 21) {
  13740. if (b === 12) {
  13741. b = b << 8 | dict[++pos];
  13742. }
  13743. entries.push([b, operands]);
  13744. operands = [];
  13745. ++pos;
  13746. } else {
  13747. operands.push(parseOperand());
  13748. }
  13749. }
  13750. return entries;
  13751. }
  13752. parseIndex(pos) {
  13753. const cffIndex = new CFFIndex();
  13754. const bytes = this.bytes;
  13755. const count = bytes[pos++] << 8 | bytes[pos++];
  13756. const offsets = [];
  13757. let end = pos;
  13758. let i, ii;
  13759. if (count !== 0) {
  13760. const offsetSize = bytes[pos++];
  13761. const startPos = pos + (count + 1) * offsetSize - 1;
  13762. for (i = 0, ii = count + 1; i < ii; ++i) {
  13763. let offset = 0;
  13764. for (let j = 0; j < offsetSize; ++j) {
  13765. offset <<= 8;
  13766. offset += bytes[pos++];
  13767. }
  13768. offsets.push(startPos + offset);
  13769. }
  13770. end = offsets[count];
  13771. }
  13772. for (i = 0, ii = offsets.length - 1; i < ii; ++i) {
  13773. const offsetStart = offsets[i];
  13774. const offsetEnd = offsets[i + 1];
  13775. cffIndex.add(bytes.subarray(offsetStart, offsetEnd));
  13776. }
  13777. return {
  13778. obj: cffIndex,
  13779. endPos: end
  13780. };
  13781. }
  13782. parseNameIndex(index) {
  13783. const names = [];
  13784. for (let i = 0, ii = index.count; i < ii; ++i) {
  13785. const name = index.get(i);
  13786. names.push(bytesToString(name));
  13787. }
  13788. return names;
  13789. }
  13790. parseStringIndex(index) {
  13791. const strings = new CFFStrings();
  13792. for (let i = 0, ii = index.count; i < ii; ++i) {
  13793. const data = index.get(i);
  13794. strings.add(bytesToString(data));
  13795. }
  13796. return strings;
  13797. }
  13798. createDict(Type, dict, strings) {
  13799. const cffDict = new Type(strings);
  13800. for (const [key, value] of dict) {
  13801. cffDict.setByKey(key, value);
  13802. }
  13803. return cffDict;
  13804. }
  13805. parseCharString(state, data, localSubrIndex, globalSubrIndex) {
  13806. if (!data || state.callDepth > MAX_SUBR_NESTING) {
  13807. return false;
  13808. }
  13809. let stackSize = state.stackSize;
  13810. const stack = state.stack;
  13811. let length = data.length;
  13812. for (let j = 0; j < length;) {
  13813. const value = data[j++];
  13814. let validationCommand = null;
  13815. if (value === 12) {
  13816. const q = data[j++];
  13817. if (q === 0) {
  13818. data[j - 2] = 139;
  13819. data[j - 1] = 22;
  13820. stackSize = 0;
  13821. } else {
  13822. validationCommand = CharstringValidationData12[q];
  13823. }
  13824. } else if (value === 28) {
  13825. stack[stackSize] = (data[j] << 24 | data[j + 1] << 16) >> 16;
  13826. j += 2;
  13827. stackSize++;
  13828. } else if (value === 14) {
  13829. if (stackSize >= 4) {
  13830. stackSize -= 4;
  13831. if (this.seacAnalysisEnabled) {
  13832. state.seac = stack.slice(stackSize, stackSize + 4);
  13833. return false;
  13834. }
  13835. }
  13836. validationCommand = CharstringValidationData[value];
  13837. } else if (value >= 32 && value <= 246) {
  13838. stack[stackSize] = value - 139;
  13839. stackSize++;
  13840. } else if (value >= 247 && value <= 254) {
  13841. stack[stackSize] = value < 251 ? (value - 247 << 8) + data[j] + 108 : -(value - 251 << 8) - data[j] - 108;
  13842. j++;
  13843. stackSize++;
  13844. } else if (value === 255) {
  13845. stack[stackSize] = (data[j] << 24 | data[j + 1] << 16 | data[j + 2] << 8 | data[j + 3]) / 65536;
  13846. j += 4;
  13847. stackSize++;
  13848. } else if (value === 19 || value === 20) {
  13849. state.hints += stackSize >> 1;
  13850. if (state.hints === 0) {
  13851. data.copyWithin(j - 1, j, -1);
  13852. j -= 1;
  13853. length -= 1;
  13854. continue;
  13855. }
  13856. j += state.hints + 7 >> 3;
  13857. stackSize %= 2;
  13858. validationCommand = CharstringValidationData[value];
  13859. } else if (value === 10 || value === 29) {
  13860. const subrsIndex = value === 10 ? localSubrIndex : globalSubrIndex;
  13861. if (!subrsIndex) {
  13862. validationCommand = CharstringValidationData[value];
  13863. warn("Missing subrsIndex for " + validationCommand.id);
  13864. return false;
  13865. }
  13866. let bias = 32768;
  13867. if (subrsIndex.count < 1240) {
  13868. bias = 107;
  13869. } else if (subrsIndex.count < 33900) {
  13870. bias = 1131;
  13871. }
  13872. const subrNumber = stack[--stackSize] + bias;
  13873. if (subrNumber < 0 || subrNumber >= subrsIndex.count || isNaN(subrNumber)) {
  13874. validationCommand = CharstringValidationData[value];
  13875. warn("Out of bounds subrIndex for " + validationCommand.id);
  13876. return false;
  13877. }
  13878. state.stackSize = stackSize;
  13879. state.callDepth++;
  13880. const valid = this.parseCharString(state, subrsIndex.get(subrNumber), localSubrIndex, globalSubrIndex);
  13881. if (!valid) {
  13882. return false;
  13883. }
  13884. state.callDepth--;
  13885. stackSize = state.stackSize;
  13886. continue;
  13887. } else if (value === 11) {
  13888. state.stackSize = stackSize;
  13889. return true;
  13890. } else if (value === 0 && j === data.length) {
  13891. data[j - 1] = 14;
  13892. validationCommand = CharstringValidationData[14];
  13893. } else if (value === 9) {
  13894. data.copyWithin(j - 1, j, -1);
  13895. j -= 1;
  13896. length -= 1;
  13897. continue;
  13898. } else {
  13899. validationCommand = CharstringValidationData[value];
  13900. }
  13901. if (validationCommand) {
  13902. if (validationCommand.stem) {
  13903. state.hints += stackSize >> 1;
  13904. if (value === 3 || value === 23) {
  13905. state.hasVStems = true;
  13906. } else if (state.hasVStems && (value === 1 || value === 18)) {
  13907. warn("CFF stem hints are in wrong order");
  13908. data[j - 1] = value === 1 ? 3 : 23;
  13909. }
  13910. }
  13911. if ("min" in validationCommand) {
  13912. if (!state.undefStack && stackSize < validationCommand.min) {
  13913. warn("Not enough parameters for " + validationCommand.id + "; actual: " + stackSize + ", expected: " + validationCommand.min);
  13914. if (stackSize === 0) {
  13915. data[j - 1] = 14;
  13916. return true;
  13917. }
  13918. return false;
  13919. }
  13920. }
  13921. if (state.firstStackClearing && validationCommand.stackClearing) {
  13922. state.firstStackClearing = false;
  13923. stackSize -= validationCommand.min;
  13924. if (stackSize >= 2 && validationCommand.stem) {
  13925. stackSize %= 2;
  13926. } else if (stackSize > 1) {
  13927. warn("Found too many parameters for stack-clearing command");
  13928. }
  13929. if (stackSize > 0) {
  13930. state.width = stack[stackSize - 1];
  13931. }
  13932. }
  13933. if ("stackDelta" in validationCommand) {
  13934. if ("stackFn" in validationCommand) {
  13935. validationCommand.stackFn(stack, stackSize);
  13936. }
  13937. stackSize += validationCommand.stackDelta;
  13938. } else if (validationCommand.stackClearing) {
  13939. stackSize = 0;
  13940. } else if (validationCommand.resetStack) {
  13941. stackSize = 0;
  13942. state.undefStack = false;
  13943. } else if (validationCommand.undefStack) {
  13944. stackSize = 0;
  13945. state.undefStack = true;
  13946. state.firstStackClearing = false;
  13947. }
  13948. }
  13949. }
  13950. if (length < data.length) {
  13951. data.fill(14, length);
  13952. }
  13953. state.stackSize = stackSize;
  13954. return true;
  13955. }
  13956. parseCharStrings({
  13957. charStrings,
  13958. localSubrIndex,
  13959. globalSubrIndex,
  13960. fdSelect,
  13961. fdArray,
  13962. privateDict
  13963. }) {
  13964. const seacs = [];
  13965. const widths = [];
  13966. const count = charStrings.count;
  13967. for (let i = 0; i < count; i++) {
  13968. const charstring = charStrings.get(i);
  13969. const state = {
  13970. callDepth: 0,
  13971. stackSize: 0,
  13972. stack: [],
  13973. undefStack: true,
  13974. hints: 0,
  13975. firstStackClearing: true,
  13976. seac: null,
  13977. width: null,
  13978. hasVStems: false
  13979. };
  13980. let valid = true;
  13981. let localSubrToUse = null;
  13982. let privateDictToUse = privateDict;
  13983. if (fdSelect && fdArray.length) {
  13984. const fdIndex = fdSelect.getFDIndex(i);
  13985. if (fdIndex === -1) {
  13986. warn("Glyph index is not in fd select.");
  13987. valid = false;
  13988. }
  13989. if (fdIndex >= fdArray.length) {
  13990. warn("Invalid fd index for glyph index.");
  13991. valid = false;
  13992. }
  13993. if (valid) {
  13994. privateDictToUse = fdArray[fdIndex].privateDict;
  13995. localSubrToUse = privateDictToUse.subrsIndex;
  13996. }
  13997. } else if (localSubrIndex) {
  13998. localSubrToUse = localSubrIndex;
  13999. }
  14000. if (valid) {
  14001. valid = this.parseCharString(state, charstring, localSubrToUse, globalSubrIndex);
  14002. }
  14003. if (state.width !== null) {
  14004. const nominalWidth = privateDictToUse.getByName("nominalWidthX");
  14005. widths[i] = nominalWidth + state.width;
  14006. } else {
  14007. const defaultWidth = privateDictToUse.getByName("defaultWidthX");
  14008. widths[i] = defaultWidth;
  14009. }
  14010. if (state.seac !== null) {
  14011. seacs[i] = state.seac;
  14012. }
  14013. if (!valid) {
  14014. charStrings.set(i, new Uint8Array([14]));
  14015. }
  14016. }
  14017. return {
  14018. charStrings,
  14019. seacs,
  14020. widths
  14021. };
  14022. }
  14023. emptyPrivateDictionary(parentDict) {
  14024. const privateDict = this.createDict(CFFPrivateDict, [], parentDict.strings);
  14025. parentDict.setByKey(18, [0, 0]);
  14026. parentDict.privateDict = privateDict;
  14027. }
  14028. parsePrivateDict(parentDict) {
  14029. if (!parentDict.hasName("Private")) {
  14030. this.emptyPrivateDictionary(parentDict);
  14031. return;
  14032. }
  14033. const privateOffset = parentDict.getByName("Private");
  14034. if (!Array.isArray(privateOffset) || privateOffset.length !== 2) {
  14035. parentDict.removeByName("Private");
  14036. return;
  14037. }
  14038. const size = privateOffset[0];
  14039. const offset = privateOffset[1];
  14040. if (size === 0 || offset >= this.bytes.length) {
  14041. this.emptyPrivateDictionary(parentDict);
  14042. return;
  14043. }
  14044. const privateDictEnd = offset + size;
  14045. const dictData = this.bytes.subarray(offset, privateDictEnd);
  14046. const dict = this.parseDict(dictData);
  14047. const privateDict = this.createDict(CFFPrivateDict, dict, parentDict.strings);
  14048. parentDict.privateDict = privateDict;
  14049. if (privateDict.getByName("ExpansionFactor") === 0) {
  14050. privateDict.setByName("ExpansionFactor", 0.06);
  14051. }
  14052. if (!privateDict.getByName("Subrs")) {
  14053. return;
  14054. }
  14055. const subrsOffset = privateDict.getByName("Subrs");
  14056. const relativeOffset = offset + subrsOffset;
  14057. if (subrsOffset === 0 || relativeOffset >= this.bytes.length) {
  14058. this.emptyPrivateDictionary(parentDict);
  14059. return;
  14060. }
  14061. const subrsIndex = this.parseIndex(relativeOffset);
  14062. privateDict.subrsIndex = subrsIndex.obj;
  14063. }
  14064. parseCharsets(pos, length, strings, cid) {
  14065. if (pos === 0) {
  14066. return new CFFCharset(true, CFFCharsetPredefinedTypes.ISO_ADOBE, ISOAdobeCharset);
  14067. } else if (pos === 1) {
  14068. return new CFFCharset(true, CFFCharsetPredefinedTypes.EXPERT, ExpertCharset);
  14069. } else if (pos === 2) {
  14070. return new CFFCharset(true, CFFCharsetPredefinedTypes.EXPERT_SUBSET, ExpertSubsetCharset);
  14071. }
  14072. const bytes = this.bytes;
  14073. const start = pos;
  14074. const format = bytes[pos++];
  14075. const charset = [cid ? 0 : ".notdef"];
  14076. let id, count, i;
  14077. length -= 1;
  14078. switch (format) {
  14079. case 0:
  14080. for (i = 0; i < length; i++) {
  14081. id = bytes[pos++] << 8 | bytes[pos++];
  14082. charset.push(cid ? id : strings.get(id));
  14083. }
  14084. break;
  14085. case 1:
  14086. while (charset.length <= length) {
  14087. id = bytes[pos++] << 8 | bytes[pos++];
  14088. count = bytes[pos++];
  14089. for (i = 0; i <= count; i++) {
  14090. charset.push(cid ? id++ : strings.get(id++));
  14091. }
  14092. }
  14093. break;
  14094. case 2:
  14095. while (charset.length <= length) {
  14096. id = bytes[pos++] << 8 | bytes[pos++];
  14097. count = bytes[pos++] << 8 | bytes[pos++];
  14098. for (i = 0; i <= count; i++) {
  14099. charset.push(cid ? id++ : strings.get(id++));
  14100. }
  14101. }
  14102. break;
  14103. default:
  14104. throw new FormatError("Unknown charset format");
  14105. }
  14106. const end = pos;
  14107. const raw = bytes.subarray(start, end);
  14108. return new CFFCharset(false, format, charset, raw);
  14109. }
  14110. parseEncoding(pos, properties, strings, charset) {
  14111. const encoding = Object.create(null);
  14112. const bytes = this.bytes;
  14113. let predefined = false;
  14114. let format, i, ii;
  14115. let raw = null;
  14116. function readSupplement() {
  14117. const supplementsCount = bytes[pos++];
  14118. for (i = 0; i < supplementsCount; i++) {
  14119. const code = bytes[pos++];
  14120. const sid = (bytes[pos++] << 8) + (bytes[pos++] & 0xff);
  14121. encoding[code] = charset.indexOf(strings.get(sid));
  14122. }
  14123. }
  14124. if (pos === 0 || pos === 1) {
  14125. predefined = true;
  14126. format = pos;
  14127. const baseEncoding = pos ? ExpertEncoding : StandardEncoding;
  14128. for (i = 0, ii = charset.length; i < ii; i++) {
  14129. const index = baseEncoding.indexOf(charset[i]);
  14130. if (index !== -1) {
  14131. encoding[index] = i;
  14132. }
  14133. }
  14134. } else {
  14135. const dataStart = pos;
  14136. format = bytes[pos++];
  14137. switch (format & 0x7f) {
  14138. case 0:
  14139. const glyphsCount = bytes[pos++];
  14140. for (i = 1; i <= glyphsCount; i++) {
  14141. encoding[bytes[pos++]] = i;
  14142. }
  14143. break;
  14144. case 1:
  14145. const rangesCount = bytes[pos++];
  14146. let gid = 1;
  14147. for (i = 0; i < rangesCount; i++) {
  14148. const start = bytes[pos++];
  14149. const left = bytes[pos++];
  14150. for (let j = start; j <= start + left; j++) {
  14151. encoding[j] = gid++;
  14152. }
  14153. }
  14154. break;
  14155. default:
  14156. throw new FormatError(`Unknown encoding format: ${format} in CFF`);
  14157. }
  14158. const dataEnd = pos;
  14159. if (format & 0x80) {
  14160. bytes[dataStart] &= 0x7f;
  14161. readSupplement();
  14162. }
  14163. raw = bytes.subarray(dataStart, dataEnd);
  14164. }
  14165. format &= 0x7f;
  14166. return new CFFEncoding(predefined, format, encoding, raw);
  14167. }
  14168. parseFDSelect(pos, length) {
  14169. const bytes = this.bytes;
  14170. const format = bytes[pos++];
  14171. const fdSelect = [];
  14172. let i;
  14173. switch (format) {
  14174. case 0:
  14175. for (i = 0; i < length; ++i) {
  14176. const id = bytes[pos++];
  14177. fdSelect.push(id);
  14178. }
  14179. break;
  14180. case 3:
  14181. const rangesCount = bytes[pos++] << 8 | bytes[pos++];
  14182. for (i = 0; i < rangesCount; ++i) {
  14183. let first = bytes[pos++] << 8 | bytes[pos++];
  14184. if (i === 0 && first !== 0) {
  14185. warn("parseFDSelect: The first range must have a first GID of 0" + " -- trying to recover.");
  14186. first = 0;
  14187. }
  14188. const fdIndex = bytes[pos++];
  14189. const next = bytes[pos] << 8 | bytes[pos + 1];
  14190. for (let j = first; j < next; ++j) {
  14191. fdSelect.push(fdIndex);
  14192. }
  14193. }
  14194. pos += 2;
  14195. break;
  14196. default:
  14197. throw new FormatError(`parseFDSelect: Unknown format "${format}".`);
  14198. }
  14199. if (fdSelect.length !== length) {
  14200. throw new FormatError("parseFDSelect: Invalid font data.");
  14201. }
  14202. return new CFFFDSelect(format, fdSelect);
  14203. }
  14204. }
  14205. class CFF {
  14206. constructor() {
  14207. this.header = null;
  14208. this.names = [];
  14209. this.topDict = null;
  14210. this.strings = new CFFStrings();
  14211. this.globalSubrIndex = null;
  14212. this.encoding = null;
  14213. this.charset = null;
  14214. this.charStrings = null;
  14215. this.fdArray = [];
  14216. this.fdSelect = null;
  14217. this.isCIDFont = false;
  14218. }
  14219. duplicateFirstGlyph() {
  14220. if (this.charStrings.count >= 65535) {
  14221. warn("Not enough space in charstrings to duplicate first glyph.");
  14222. return;
  14223. }
  14224. const glyphZero = this.charStrings.get(0);
  14225. this.charStrings.add(glyphZero);
  14226. if (this.isCIDFont) {
  14227. this.fdSelect.fdSelect.push(this.fdSelect.fdSelect[0]);
  14228. }
  14229. }
  14230. hasGlyphId(id) {
  14231. if (id < 0 || id >= this.charStrings.count) {
  14232. return false;
  14233. }
  14234. const glyph = this.charStrings.get(id);
  14235. return glyph.length > 0;
  14236. }
  14237. }
  14238. class CFFHeader {
  14239. constructor(major, minor, hdrSize, offSize) {
  14240. this.major = major;
  14241. this.minor = minor;
  14242. this.hdrSize = hdrSize;
  14243. this.offSize = offSize;
  14244. }
  14245. }
  14246. class CFFStrings {
  14247. constructor() {
  14248. this.strings = [];
  14249. }
  14250. get(index) {
  14251. if (index >= 0 && index <= NUM_STANDARD_CFF_STRINGS - 1) {
  14252. return CFFStandardStrings[index];
  14253. }
  14254. if (index - NUM_STANDARD_CFF_STRINGS <= this.strings.length) {
  14255. return this.strings[index - NUM_STANDARD_CFF_STRINGS];
  14256. }
  14257. return CFFStandardStrings[0];
  14258. }
  14259. getSID(str) {
  14260. let index = CFFStandardStrings.indexOf(str);
  14261. if (index !== -1) {
  14262. return index;
  14263. }
  14264. index = this.strings.indexOf(str);
  14265. if (index !== -1) {
  14266. return index + NUM_STANDARD_CFF_STRINGS;
  14267. }
  14268. return -1;
  14269. }
  14270. add(value) {
  14271. this.strings.push(value);
  14272. }
  14273. get count() {
  14274. return this.strings.length;
  14275. }
  14276. }
  14277. class CFFIndex {
  14278. constructor() {
  14279. this.objects = [];
  14280. this.length = 0;
  14281. }
  14282. add(data) {
  14283. this.length += data.length;
  14284. this.objects.push(data);
  14285. }
  14286. set(index, data) {
  14287. this.length += data.length - this.objects[index].length;
  14288. this.objects[index] = data;
  14289. }
  14290. get(index) {
  14291. return this.objects[index];
  14292. }
  14293. get count() {
  14294. return this.objects.length;
  14295. }
  14296. }
  14297. class CFFDict {
  14298. constructor(tables, strings) {
  14299. this.keyToNameMap = tables.keyToNameMap;
  14300. this.nameToKeyMap = tables.nameToKeyMap;
  14301. this.defaults = tables.defaults;
  14302. this.types = tables.types;
  14303. this.opcodes = tables.opcodes;
  14304. this.order = tables.order;
  14305. this.strings = strings;
  14306. this.values = Object.create(null);
  14307. }
  14308. setByKey(key, value) {
  14309. if (!(key in this.keyToNameMap)) {
  14310. return false;
  14311. }
  14312. if (value.length === 0) {
  14313. return true;
  14314. }
  14315. for (const val of value) {
  14316. if (isNaN(val)) {
  14317. warn(`Invalid CFFDict value: "${value}" for key "${key}".`);
  14318. return true;
  14319. }
  14320. }
  14321. const type = this.types[key];
  14322. if (type === "num" || type === "sid" || type === "offset") {
  14323. value = value[0];
  14324. }
  14325. this.values[key] = value;
  14326. return true;
  14327. }
  14328. setByName(name, value) {
  14329. if (!(name in this.nameToKeyMap)) {
  14330. throw new FormatError(`Invalid dictionary name "${name}"`);
  14331. }
  14332. this.values[this.nameToKeyMap[name]] = value;
  14333. }
  14334. hasName(name) {
  14335. return this.nameToKeyMap[name] in this.values;
  14336. }
  14337. getByName(name) {
  14338. if (!(name in this.nameToKeyMap)) {
  14339. throw new FormatError(`Invalid dictionary name ${name}"`);
  14340. }
  14341. const key = this.nameToKeyMap[name];
  14342. if (!(key in this.values)) {
  14343. return this.defaults[key];
  14344. }
  14345. return this.values[key];
  14346. }
  14347. removeByName(name) {
  14348. delete this.values[this.nameToKeyMap[name]];
  14349. }
  14350. static createTables(layout) {
  14351. const tables = {
  14352. keyToNameMap: {},
  14353. nameToKeyMap: {},
  14354. defaults: {},
  14355. types: {},
  14356. opcodes: {},
  14357. order: []
  14358. };
  14359. for (const entry of layout) {
  14360. const key = Array.isArray(entry[0]) ? (entry[0][0] << 8) + entry[0][1] : entry[0];
  14361. tables.keyToNameMap[key] = entry[1];
  14362. tables.nameToKeyMap[entry[1]] = key;
  14363. tables.types[key] = entry[2];
  14364. tables.defaults[key] = entry[3];
  14365. tables.opcodes[key] = Array.isArray(entry[0]) ? entry[0] : [entry[0]];
  14366. tables.order.push(key);
  14367. }
  14368. return tables;
  14369. }
  14370. }
  14371. const CFFTopDictLayout = [[[12, 30], "ROS", ["sid", "sid", "num"], null], [[12, 20], "SyntheticBase", "num", null], [0, "version", "sid", null], [1, "Notice", "sid", null], [[12, 0], "Copyright", "sid", null], [2, "FullName", "sid", null], [3, "FamilyName", "sid", null], [4, "Weight", "sid", null], [[12, 1], "isFixedPitch", "num", 0], [[12, 2], "ItalicAngle", "num", 0], [[12, 3], "UnderlinePosition", "num", -100], [[12, 4], "UnderlineThickness", "num", 50], [[12, 5], "PaintType", "num", 0], [[12, 6], "CharstringType", "num", 2], [[12, 7], "FontMatrix", ["num", "num", "num", "num", "num", "num"], [0.001, 0, 0, 0.001, 0, 0]], [13, "UniqueID", "num", null], [5, "FontBBox", ["num", "num", "num", "num"], [0, 0, 0, 0]], [[12, 8], "StrokeWidth", "num", 0], [14, "XUID", "array", null], [15, "charset", "offset", 0], [16, "Encoding", "offset", 0], [17, "CharStrings", "offset", 0], [18, "Private", ["offset", "offset"], null], [[12, 21], "PostScript", "sid", null], [[12, 22], "BaseFontName", "sid", null], [[12, 23], "BaseFontBlend", "delta", null], [[12, 31], "CIDFontVersion", "num", 0], [[12, 32], "CIDFontRevision", "num", 0], [[12, 33], "CIDFontType", "num", 0], [[12, 34], "CIDCount", "num", 8720], [[12, 35], "UIDBase", "num", null], [[12, 37], "FDSelect", "offset", null], [[12, 36], "FDArray", "offset", null], [[12, 38], "FontName", "sid", null]];
  14372. class CFFTopDict extends CFFDict {
  14373. static get tables() {
  14374. return shadow(this, "tables", this.createTables(CFFTopDictLayout));
  14375. }
  14376. constructor(strings) {
  14377. super(CFFTopDict.tables, strings);
  14378. this.privateDict = null;
  14379. }
  14380. }
  14381. const CFFPrivateDictLayout = [[6, "BlueValues", "delta", null], [7, "OtherBlues", "delta", null], [8, "FamilyBlues", "delta", null], [9, "FamilyOtherBlues", "delta", null], [[12, 9], "BlueScale", "num", 0.039625], [[12, 10], "BlueShift", "num", 7], [[12, 11], "BlueFuzz", "num", 1], [10, "StdHW", "num", null], [11, "StdVW", "num", null], [[12, 12], "StemSnapH", "delta", null], [[12, 13], "StemSnapV", "delta", null], [[12, 14], "ForceBold", "num", 0], [[12, 17], "LanguageGroup", "num", 0], [[12, 18], "ExpansionFactor", "num", 0.06], [[12, 19], "initialRandomSeed", "num", 0], [20, "defaultWidthX", "num", 0], [21, "nominalWidthX", "num", 0], [19, "Subrs", "offset", null]];
  14382. class CFFPrivateDict extends CFFDict {
  14383. static get tables() {
  14384. return shadow(this, "tables", this.createTables(CFFPrivateDictLayout));
  14385. }
  14386. constructor(strings) {
  14387. super(CFFPrivateDict.tables, strings);
  14388. this.subrsIndex = null;
  14389. }
  14390. }
  14391. const CFFCharsetPredefinedTypes = {
  14392. ISO_ADOBE: 0,
  14393. EXPERT: 1,
  14394. EXPERT_SUBSET: 2
  14395. };
  14396. class CFFCharset {
  14397. constructor(predefined, format, charset, raw) {
  14398. this.predefined = predefined;
  14399. this.format = format;
  14400. this.charset = charset;
  14401. this.raw = raw;
  14402. }
  14403. }
  14404. class CFFEncoding {
  14405. constructor(predefined, format, encoding, raw) {
  14406. this.predefined = predefined;
  14407. this.format = format;
  14408. this.encoding = encoding;
  14409. this.raw = raw;
  14410. }
  14411. }
  14412. class CFFFDSelect {
  14413. constructor(format, fdSelect) {
  14414. this.format = format;
  14415. this.fdSelect = fdSelect;
  14416. }
  14417. getFDIndex(glyphIndex) {
  14418. if (glyphIndex < 0 || glyphIndex >= this.fdSelect.length) {
  14419. return -1;
  14420. }
  14421. return this.fdSelect[glyphIndex];
  14422. }
  14423. }
  14424. class CFFOffsetTracker {
  14425. constructor() {
  14426. this.offsets = Object.create(null);
  14427. }
  14428. isTracking(key) {
  14429. return key in this.offsets;
  14430. }
  14431. track(key, location) {
  14432. if (key in this.offsets) {
  14433. throw new FormatError(`Already tracking location of ${key}`);
  14434. }
  14435. this.offsets[key] = location;
  14436. }
  14437. offset(value) {
  14438. for (const key in this.offsets) {
  14439. this.offsets[key] += value;
  14440. }
  14441. }
  14442. setEntryLocation(key, values, output) {
  14443. if (!(key in this.offsets)) {
  14444. throw new FormatError(`Not tracking location of ${key}`);
  14445. }
  14446. const data = output.data;
  14447. const dataOffset = this.offsets[key];
  14448. const size = 5;
  14449. for (let i = 0, ii = values.length; i < ii; ++i) {
  14450. const offset0 = i * size + dataOffset;
  14451. const offset1 = offset0 + 1;
  14452. const offset2 = offset0 + 2;
  14453. const offset3 = offset0 + 3;
  14454. const offset4 = offset0 + 4;
  14455. if (data[offset0] !== 0x1d || data[offset1] !== 0 || data[offset2] !== 0 || data[offset3] !== 0 || data[offset4] !== 0) {
  14456. throw new FormatError("writing to an offset that is not empty");
  14457. }
  14458. const value = values[i];
  14459. data[offset0] = 0x1d;
  14460. data[offset1] = value >> 24 & 0xff;
  14461. data[offset2] = value >> 16 & 0xff;
  14462. data[offset3] = value >> 8 & 0xff;
  14463. data[offset4] = value & 0xff;
  14464. }
  14465. }
  14466. }
  14467. class CFFCompiler {
  14468. constructor(cff) {
  14469. this.cff = cff;
  14470. }
  14471. compile() {
  14472. const cff = this.cff;
  14473. const output = {
  14474. data: [],
  14475. length: 0,
  14476. add(data) {
  14477. try {
  14478. this.data.push(...data);
  14479. } catch {
  14480. this.data = this.data.concat(data);
  14481. }
  14482. this.length = this.data.length;
  14483. }
  14484. };
  14485. const header = this.compileHeader(cff.header);
  14486. output.add(header);
  14487. const nameIndex = this.compileNameIndex(cff.names);
  14488. output.add(nameIndex);
  14489. if (cff.isCIDFont) {
  14490. if (cff.topDict.hasName("FontMatrix")) {
  14491. const base = cff.topDict.getByName("FontMatrix");
  14492. cff.topDict.removeByName("FontMatrix");
  14493. for (const subDict of cff.fdArray) {
  14494. let matrix = base.slice(0);
  14495. if (subDict.hasName("FontMatrix")) {
  14496. matrix = Util.transform(matrix, subDict.getByName("FontMatrix"));
  14497. }
  14498. subDict.setByName("FontMatrix", matrix);
  14499. }
  14500. }
  14501. }
  14502. const xuid = cff.topDict.getByName("XUID");
  14503. if (xuid?.length > 16) {
  14504. cff.topDict.removeByName("XUID");
  14505. }
  14506. cff.topDict.setByName("charset", 0);
  14507. let compiled = this.compileTopDicts([cff.topDict], output.length, cff.isCIDFont);
  14508. output.add(compiled.output);
  14509. const topDictTracker = compiled.trackers[0];
  14510. const stringIndex = this.compileStringIndex(cff.strings.strings);
  14511. output.add(stringIndex);
  14512. const globalSubrIndex = this.compileIndex(cff.globalSubrIndex);
  14513. output.add(globalSubrIndex);
  14514. if (cff.encoding && cff.topDict.hasName("Encoding")) {
  14515. if (cff.encoding.predefined) {
  14516. topDictTracker.setEntryLocation("Encoding", [cff.encoding.format], output);
  14517. } else {
  14518. const encoding = this.compileEncoding(cff.encoding);
  14519. topDictTracker.setEntryLocation("Encoding", [output.length], output);
  14520. output.add(encoding);
  14521. }
  14522. }
  14523. const charset = this.compileCharset(cff.charset, cff.charStrings.count, cff.strings, cff.isCIDFont);
  14524. topDictTracker.setEntryLocation("charset", [output.length], output);
  14525. output.add(charset);
  14526. const charStrings = this.compileCharStrings(cff.charStrings);
  14527. topDictTracker.setEntryLocation("CharStrings", [output.length], output);
  14528. output.add(charStrings);
  14529. if (cff.isCIDFont) {
  14530. topDictTracker.setEntryLocation("FDSelect", [output.length], output);
  14531. const fdSelect = this.compileFDSelect(cff.fdSelect);
  14532. output.add(fdSelect);
  14533. compiled = this.compileTopDicts(cff.fdArray, output.length, true);
  14534. topDictTracker.setEntryLocation("FDArray", [output.length], output);
  14535. output.add(compiled.output);
  14536. const fontDictTrackers = compiled.trackers;
  14537. this.compilePrivateDicts(cff.fdArray, fontDictTrackers, output);
  14538. }
  14539. this.compilePrivateDicts([cff.topDict], [topDictTracker], output);
  14540. output.add([0]);
  14541. return output.data;
  14542. }
  14543. encodeNumber(value) {
  14544. if (Number.isInteger(value)) {
  14545. return this.encodeInteger(value);
  14546. }
  14547. return this.encodeFloat(value);
  14548. }
  14549. static get EncodeFloatRegExp() {
  14550. return shadow(this, "EncodeFloatRegExp", /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/);
  14551. }
  14552. encodeFloat(num) {
  14553. let value = num.toString();
  14554. const m = CFFCompiler.EncodeFloatRegExp.exec(value);
  14555. if (m) {
  14556. const epsilon = parseFloat("1e" + ((m[2] ? +m[2] : 0) + m[1].length));
  14557. value = (Math.round(num * epsilon) / epsilon).toString();
  14558. }
  14559. let nibbles = "";
  14560. let i, ii;
  14561. for (i = 0, ii = value.length; i < ii; ++i) {
  14562. const a = value[i];
  14563. if (a === "e") {
  14564. nibbles += value[++i] === "-" ? "c" : "b";
  14565. } else if (a === ".") {
  14566. nibbles += "a";
  14567. } else if (a === "-") {
  14568. nibbles += "e";
  14569. } else {
  14570. nibbles += a;
  14571. }
  14572. }
  14573. nibbles += nibbles.length & 1 ? "f" : "ff";
  14574. const out = [30];
  14575. for (i = 0, ii = nibbles.length; i < ii; i += 2) {
  14576. out.push(parseInt(nibbles.substring(i, i + 2), 16));
  14577. }
  14578. return out;
  14579. }
  14580. encodeInteger(value) {
  14581. let code;
  14582. if (value >= -107 && value <= 107) {
  14583. code = [value + 139];
  14584. } else if (value >= 108 && value <= 1131) {
  14585. value -= 108;
  14586. code = [(value >> 8) + 247, value & 0xff];
  14587. } else if (value >= -1131 && value <= -108) {
  14588. value = -value - 108;
  14589. code = [(value >> 8) + 251, value & 0xff];
  14590. } else if (value >= -32768 && value <= 32767) {
  14591. code = [0x1c, value >> 8 & 0xff, value & 0xff];
  14592. } else {
  14593. code = [0x1d, value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff];
  14594. }
  14595. return code;
  14596. }
  14597. compileHeader(header) {
  14598. return [header.major, header.minor, 4, header.offSize];
  14599. }
  14600. compileNameIndex(names) {
  14601. const nameIndex = new CFFIndex();
  14602. for (const name of names) {
  14603. const length = Math.min(name.length, 127);
  14604. let sanitizedName = new Array(length);
  14605. for (let j = 0; j < length; j++) {
  14606. let char = name[j];
  14607. if (char < "!" || char > "~" || char === "[" || char === "]" || char === "(" || char === ")" || char === "{" || char === "}" || char === "<" || char === ">" || char === "/" || char === "%") {
  14608. char = "_";
  14609. }
  14610. sanitizedName[j] = char;
  14611. }
  14612. sanitizedName = sanitizedName.join("");
  14613. if (sanitizedName === "") {
  14614. sanitizedName = "Bad_Font_Name";
  14615. }
  14616. nameIndex.add(stringToBytes(sanitizedName));
  14617. }
  14618. return this.compileIndex(nameIndex);
  14619. }
  14620. compileTopDicts(dicts, length, removeCidKeys) {
  14621. const fontDictTrackers = [];
  14622. let fdArrayIndex = new CFFIndex();
  14623. for (const fontDict of dicts) {
  14624. if (removeCidKeys) {
  14625. fontDict.removeByName("CIDFontVersion");
  14626. fontDict.removeByName("CIDFontRevision");
  14627. fontDict.removeByName("CIDFontType");
  14628. fontDict.removeByName("CIDCount");
  14629. fontDict.removeByName("UIDBase");
  14630. }
  14631. const fontDictTracker = new CFFOffsetTracker();
  14632. const fontDictData = this.compileDict(fontDict, fontDictTracker);
  14633. fontDictTrackers.push(fontDictTracker);
  14634. fdArrayIndex.add(fontDictData);
  14635. fontDictTracker.offset(length);
  14636. }
  14637. fdArrayIndex = this.compileIndex(fdArrayIndex, fontDictTrackers);
  14638. return {
  14639. trackers: fontDictTrackers,
  14640. output: fdArrayIndex
  14641. };
  14642. }
  14643. compilePrivateDicts(dicts, trackers, output) {
  14644. for (let i = 0, ii = dicts.length; i < ii; ++i) {
  14645. const fontDict = dicts[i];
  14646. const privateDict = fontDict.privateDict;
  14647. if (!privateDict || !fontDict.hasName("Private")) {
  14648. throw new FormatError("There must be a private dictionary.");
  14649. }
  14650. const privateDictTracker = new CFFOffsetTracker();
  14651. const privateDictData = this.compileDict(privateDict, privateDictTracker);
  14652. let outputLength = output.length;
  14653. privateDictTracker.offset(outputLength);
  14654. if (!privateDictData.length) {
  14655. outputLength = 0;
  14656. }
  14657. trackers[i].setEntryLocation("Private", [privateDictData.length, outputLength], output);
  14658. output.add(privateDictData);
  14659. if (privateDict.subrsIndex && privateDict.hasName("Subrs")) {
  14660. const subrs = this.compileIndex(privateDict.subrsIndex);
  14661. privateDictTracker.setEntryLocation("Subrs", [privateDictData.length], output);
  14662. output.add(subrs);
  14663. }
  14664. }
  14665. }
  14666. compileDict(dict, offsetTracker) {
  14667. const out = [];
  14668. for (const key of dict.order) {
  14669. if (!(key in dict.values)) {
  14670. continue;
  14671. }
  14672. let values = dict.values[key];
  14673. let types = dict.types[key];
  14674. if (!Array.isArray(types)) {
  14675. types = [types];
  14676. }
  14677. if (!Array.isArray(values)) {
  14678. values = [values];
  14679. }
  14680. if (values.length === 0) {
  14681. continue;
  14682. }
  14683. for (let j = 0, jj = types.length; j < jj; ++j) {
  14684. const type = types[j];
  14685. const value = values[j];
  14686. switch (type) {
  14687. case "num":
  14688. case "sid":
  14689. out.push(...this.encodeNumber(value));
  14690. break;
  14691. case "offset":
  14692. const name = dict.keyToNameMap[key];
  14693. if (!offsetTracker.isTracking(name)) {
  14694. offsetTracker.track(name, out.length);
  14695. }
  14696. out.push(0x1d, 0, 0, 0, 0);
  14697. break;
  14698. case "array":
  14699. case "delta":
  14700. out.push(...this.encodeNumber(value));
  14701. for (let k = 1, kk = values.length; k < kk; ++k) {
  14702. out.push(...this.encodeNumber(values[k]));
  14703. }
  14704. break;
  14705. default:
  14706. throw new FormatError(`Unknown data type of ${type}`);
  14707. }
  14708. }
  14709. out.push(...dict.opcodes[key]);
  14710. }
  14711. return out;
  14712. }
  14713. compileStringIndex(strings) {
  14714. const stringIndex = new CFFIndex();
  14715. for (const string of strings) {
  14716. stringIndex.add(stringToBytes(string));
  14717. }
  14718. return this.compileIndex(stringIndex);
  14719. }
  14720. compileCharStrings(charStrings) {
  14721. const charStringsIndex = new CFFIndex();
  14722. for (let i = 0; i < charStrings.count; i++) {
  14723. const glyph = charStrings.get(i);
  14724. if (glyph.length === 0) {
  14725. charStringsIndex.add(new Uint8Array([0x8b, 0x0e]));
  14726. continue;
  14727. }
  14728. charStringsIndex.add(glyph);
  14729. }
  14730. return this.compileIndex(charStringsIndex);
  14731. }
  14732. compileCharset(charset, numGlyphs, strings, isCIDFont) {
  14733. let out;
  14734. const numGlyphsLessNotDef = numGlyphs - 1;
  14735. if (isCIDFont) {
  14736. out = new Uint8Array([2, 0, 0, numGlyphsLessNotDef >> 8 & 0xff, numGlyphsLessNotDef & 0xff]);
  14737. } else {
  14738. const length = 1 + numGlyphsLessNotDef * 2;
  14739. out = new Uint8Array(length);
  14740. out[0] = 0;
  14741. let charsetIndex = 0;
  14742. const numCharsets = charset.charset.length;
  14743. let warned = false;
  14744. for (let i = 1; i < out.length; i += 2) {
  14745. let sid = 0;
  14746. if (charsetIndex < numCharsets) {
  14747. const name = charset.charset[charsetIndex++];
  14748. sid = strings.getSID(name);
  14749. if (sid === -1) {
  14750. sid = 0;
  14751. if (!warned) {
  14752. warned = true;
  14753. warn(`Couldn't find ${name} in CFF strings`);
  14754. }
  14755. }
  14756. }
  14757. out[i] = sid >> 8 & 0xff;
  14758. out[i + 1] = sid & 0xff;
  14759. }
  14760. }
  14761. return this.compileTypedArray(out);
  14762. }
  14763. compileEncoding(encoding) {
  14764. return this.compileTypedArray(encoding.raw);
  14765. }
  14766. compileFDSelect(fdSelect) {
  14767. const format = fdSelect.format;
  14768. let out, i;
  14769. switch (format) {
  14770. case 0:
  14771. out = new Uint8Array(1 + fdSelect.fdSelect.length);
  14772. out[0] = format;
  14773. for (i = 0; i < fdSelect.fdSelect.length; i++) {
  14774. out[i + 1] = fdSelect.fdSelect[i];
  14775. }
  14776. break;
  14777. case 3:
  14778. const start = 0;
  14779. let lastFD = fdSelect.fdSelect[0];
  14780. const ranges = [format, 0, 0, start >> 8 & 0xff, start & 0xff, lastFD];
  14781. for (i = 1; i < fdSelect.fdSelect.length; i++) {
  14782. const currentFD = fdSelect.fdSelect[i];
  14783. if (currentFD !== lastFD) {
  14784. ranges.push(i >> 8 & 0xff, i & 0xff, currentFD);
  14785. lastFD = currentFD;
  14786. }
  14787. }
  14788. const numRanges = (ranges.length - 3) / 3;
  14789. ranges[1] = numRanges >> 8 & 0xff;
  14790. ranges[2] = numRanges & 0xff;
  14791. ranges.push(i >> 8 & 0xff, i & 0xff);
  14792. out = new Uint8Array(ranges);
  14793. break;
  14794. }
  14795. return this.compileTypedArray(out);
  14796. }
  14797. compileTypedArray(data) {
  14798. return Array.from(data);
  14799. }
  14800. compileIndex(index, trackers = []) {
  14801. const objects = index.objects;
  14802. const count = objects.length;
  14803. if (count === 0) {
  14804. return [0, 0];
  14805. }
  14806. const data = [count >> 8 & 0xff, count & 0xff];
  14807. let lastOffset = 1,
  14808. i;
  14809. for (i = 0; i < count; ++i) {
  14810. lastOffset += objects[i].length;
  14811. }
  14812. let offsetSize;
  14813. if (lastOffset < 0x100) {
  14814. offsetSize = 1;
  14815. } else if (lastOffset < 0x10000) {
  14816. offsetSize = 2;
  14817. } else if (lastOffset < 0x1000000) {
  14818. offsetSize = 3;
  14819. } else {
  14820. offsetSize = 4;
  14821. }
  14822. data.push(offsetSize);
  14823. let relativeOffset = 1;
  14824. for (i = 0; i < count + 1; i++) {
  14825. if (offsetSize === 1) {
  14826. data.push(relativeOffset & 0xff);
  14827. } else if (offsetSize === 2) {
  14828. data.push(relativeOffset >> 8 & 0xff, relativeOffset & 0xff);
  14829. } else if (offsetSize === 3) {
  14830. data.push(relativeOffset >> 16 & 0xff, relativeOffset >> 8 & 0xff, relativeOffset & 0xff);
  14831. } else {
  14832. data.push(relativeOffset >>> 24 & 0xff, relativeOffset >> 16 & 0xff, relativeOffset >> 8 & 0xff, relativeOffset & 0xff);
  14833. }
  14834. if (objects[i]) {
  14835. relativeOffset += objects[i].length;
  14836. }
  14837. }
  14838. for (i = 0; i < count; i++) {
  14839. if (trackers[i]) {
  14840. trackers[i].offset(data.length);
  14841. }
  14842. data.push(...objects[i]);
  14843. }
  14844. return data;
  14845. }
  14846. }
  14847. ;// ./src/core/glyphlist.js
  14848. const getGlyphsUnicode = getLookupTableFactory(function (t) {
  14849. t.A = 0x0041;
  14850. t.AE = 0x00c6;
  14851. t.AEacute = 0x01fc;
  14852. t.AEmacron = 0x01e2;
  14853. t.AEsmall = 0xf7e6;
  14854. t.Aacute = 0x00c1;
  14855. t.Aacutesmall = 0xf7e1;
  14856. t.Abreve = 0x0102;
  14857. t.Abreveacute = 0x1eae;
  14858. t.Abrevecyrillic = 0x04d0;
  14859. t.Abrevedotbelow = 0x1eb6;
  14860. t.Abrevegrave = 0x1eb0;
  14861. t.Abrevehookabove = 0x1eb2;
  14862. t.Abrevetilde = 0x1eb4;
  14863. t.Acaron = 0x01cd;
  14864. t.Acircle = 0x24b6;
  14865. t.Acircumflex = 0x00c2;
  14866. t.Acircumflexacute = 0x1ea4;
  14867. t.Acircumflexdotbelow = 0x1eac;
  14868. t.Acircumflexgrave = 0x1ea6;
  14869. t.Acircumflexhookabove = 0x1ea8;
  14870. t.Acircumflexsmall = 0xf7e2;
  14871. t.Acircumflextilde = 0x1eaa;
  14872. t.Acute = 0xf6c9;
  14873. t.Acutesmall = 0xf7b4;
  14874. t.Acyrillic = 0x0410;
  14875. t.Adblgrave = 0x0200;
  14876. t.Adieresis = 0x00c4;
  14877. t.Adieresiscyrillic = 0x04d2;
  14878. t.Adieresismacron = 0x01de;
  14879. t.Adieresissmall = 0xf7e4;
  14880. t.Adotbelow = 0x1ea0;
  14881. t.Adotmacron = 0x01e0;
  14882. t.Agrave = 0x00c0;
  14883. t.Agravesmall = 0xf7e0;
  14884. t.Ahookabove = 0x1ea2;
  14885. t.Aiecyrillic = 0x04d4;
  14886. t.Ainvertedbreve = 0x0202;
  14887. t.Alpha = 0x0391;
  14888. t.Alphatonos = 0x0386;
  14889. t.Amacron = 0x0100;
  14890. t.Amonospace = 0xff21;
  14891. t.Aogonek = 0x0104;
  14892. t.Aring = 0x00c5;
  14893. t.Aringacute = 0x01fa;
  14894. t.Aringbelow = 0x1e00;
  14895. t.Aringsmall = 0xf7e5;
  14896. t.Asmall = 0xf761;
  14897. t.Atilde = 0x00c3;
  14898. t.Atildesmall = 0xf7e3;
  14899. t.Aybarmenian = 0x0531;
  14900. t.B = 0x0042;
  14901. t.Bcircle = 0x24b7;
  14902. t.Bdotaccent = 0x1e02;
  14903. t.Bdotbelow = 0x1e04;
  14904. t.Becyrillic = 0x0411;
  14905. t.Benarmenian = 0x0532;
  14906. t.Beta = 0x0392;
  14907. t.Bhook = 0x0181;
  14908. t.Blinebelow = 0x1e06;
  14909. t.Bmonospace = 0xff22;
  14910. t.Brevesmall = 0xf6f4;
  14911. t.Bsmall = 0xf762;
  14912. t.Btopbar = 0x0182;
  14913. t.C = 0x0043;
  14914. t.Caarmenian = 0x053e;
  14915. t.Cacute = 0x0106;
  14916. t.Caron = 0xf6ca;
  14917. t.Caronsmall = 0xf6f5;
  14918. t.Ccaron = 0x010c;
  14919. t.Ccedilla = 0x00c7;
  14920. t.Ccedillaacute = 0x1e08;
  14921. t.Ccedillasmall = 0xf7e7;
  14922. t.Ccircle = 0x24b8;
  14923. t.Ccircumflex = 0x0108;
  14924. t.Cdot = 0x010a;
  14925. t.Cdotaccent = 0x010a;
  14926. t.Cedillasmall = 0xf7b8;
  14927. t.Chaarmenian = 0x0549;
  14928. t.Cheabkhasiancyrillic = 0x04bc;
  14929. t.Checyrillic = 0x0427;
  14930. t.Chedescenderabkhasiancyrillic = 0x04be;
  14931. t.Chedescendercyrillic = 0x04b6;
  14932. t.Chedieresiscyrillic = 0x04f4;
  14933. t.Cheharmenian = 0x0543;
  14934. t.Chekhakassiancyrillic = 0x04cb;
  14935. t.Cheverticalstrokecyrillic = 0x04b8;
  14936. t.Chi = 0x03a7;
  14937. t.Chook = 0x0187;
  14938. t.Circumflexsmall = 0xf6f6;
  14939. t.Cmonospace = 0xff23;
  14940. t.Coarmenian = 0x0551;
  14941. t.Csmall = 0xf763;
  14942. t.D = 0x0044;
  14943. t.DZ = 0x01f1;
  14944. t.DZcaron = 0x01c4;
  14945. t.Daarmenian = 0x0534;
  14946. t.Dafrican = 0x0189;
  14947. t.Dcaron = 0x010e;
  14948. t.Dcedilla = 0x1e10;
  14949. t.Dcircle = 0x24b9;
  14950. t.Dcircumflexbelow = 0x1e12;
  14951. t.Dcroat = 0x0110;
  14952. t.Ddotaccent = 0x1e0a;
  14953. t.Ddotbelow = 0x1e0c;
  14954. t.Decyrillic = 0x0414;
  14955. t.Deicoptic = 0x03ee;
  14956. t.Delta = 0x2206;
  14957. t.Deltagreek = 0x0394;
  14958. t.Dhook = 0x018a;
  14959. t.Dieresis = 0xf6cb;
  14960. t.DieresisAcute = 0xf6cc;
  14961. t.DieresisGrave = 0xf6cd;
  14962. t.Dieresissmall = 0xf7a8;
  14963. t.Digammagreek = 0x03dc;
  14964. t.Djecyrillic = 0x0402;
  14965. t.Dlinebelow = 0x1e0e;
  14966. t.Dmonospace = 0xff24;
  14967. t.Dotaccentsmall = 0xf6f7;
  14968. t.Dslash = 0x0110;
  14969. t.Dsmall = 0xf764;
  14970. t.Dtopbar = 0x018b;
  14971. t.Dz = 0x01f2;
  14972. t.Dzcaron = 0x01c5;
  14973. t.Dzeabkhasiancyrillic = 0x04e0;
  14974. t.Dzecyrillic = 0x0405;
  14975. t.Dzhecyrillic = 0x040f;
  14976. t.E = 0x0045;
  14977. t.Eacute = 0x00c9;
  14978. t.Eacutesmall = 0xf7e9;
  14979. t.Ebreve = 0x0114;
  14980. t.Ecaron = 0x011a;
  14981. t.Ecedillabreve = 0x1e1c;
  14982. t.Echarmenian = 0x0535;
  14983. t.Ecircle = 0x24ba;
  14984. t.Ecircumflex = 0x00ca;
  14985. t.Ecircumflexacute = 0x1ebe;
  14986. t.Ecircumflexbelow = 0x1e18;
  14987. t.Ecircumflexdotbelow = 0x1ec6;
  14988. t.Ecircumflexgrave = 0x1ec0;
  14989. t.Ecircumflexhookabove = 0x1ec2;
  14990. t.Ecircumflexsmall = 0xf7ea;
  14991. t.Ecircumflextilde = 0x1ec4;
  14992. t.Ecyrillic = 0x0404;
  14993. t.Edblgrave = 0x0204;
  14994. t.Edieresis = 0x00cb;
  14995. t.Edieresissmall = 0xf7eb;
  14996. t.Edot = 0x0116;
  14997. t.Edotaccent = 0x0116;
  14998. t.Edotbelow = 0x1eb8;
  14999. t.Efcyrillic = 0x0424;
  15000. t.Egrave = 0x00c8;
  15001. t.Egravesmall = 0xf7e8;
  15002. t.Eharmenian = 0x0537;
  15003. t.Ehookabove = 0x1eba;
  15004. t.Eightroman = 0x2167;
  15005. t.Einvertedbreve = 0x0206;
  15006. t.Eiotifiedcyrillic = 0x0464;
  15007. t.Elcyrillic = 0x041b;
  15008. t.Elevenroman = 0x216a;
  15009. t.Emacron = 0x0112;
  15010. t.Emacronacute = 0x1e16;
  15011. t.Emacrongrave = 0x1e14;
  15012. t.Emcyrillic = 0x041c;
  15013. t.Emonospace = 0xff25;
  15014. t.Encyrillic = 0x041d;
  15015. t.Endescendercyrillic = 0x04a2;
  15016. t.Eng = 0x014a;
  15017. t.Enghecyrillic = 0x04a4;
  15018. t.Enhookcyrillic = 0x04c7;
  15019. t.Eogonek = 0x0118;
  15020. t.Eopen = 0x0190;
  15021. t.Epsilon = 0x0395;
  15022. t.Epsilontonos = 0x0388;
  15023. t.Ercyrillic = 0x0420;
  15024. t.Ereversed = 0x018e;
  15025. t.Ereversedcyrillic = 0x042d;
  15026. t.Escyrillic = 0x0421;
  15027. t.Esdescendercyrillic = 0x04aa;
  15028. t.Esh = 0x01a9;
  15029. t.Esmall = 0xf765;
  15030. t.Eta = 0x0397;
  15031. t.Etarmenian = 0x0538;
  15032. t.Etatonos = 0x0389;
  15033. t.Eth = 0x00d0;
  15034. t.Ethsmall = 0xf7f0;
  15035. t.Etilde = 0x1ebc;
  15036. t.Etildebelow = 0x1e1a;
  15037. t.Euro = 0x20ac;
  15038. t.Ezh = 0x01b7;
  15039. t.Ezhcaron = 0x01ee;
  15040. t.Ezhreversed = 0x01b8;
  15041. t.F = 0x0046;
  15042. t.Fcircle = 0x24bb;
  15043. t.Fdotaccent = 0x1e1e;
  15044. t.Feharmenian = 0x0556;
  15045. t.Feicoptic = 0x03e4;
  15046. t.Fhook = 0x0191;
  15047. t.Fitacyrillic = 0x0472;
  15048. t.Fiveroman = 0x2164;
  15049. t.Fmonospace = 0xff26;
  15050. t.Fourroman = 0x2163;
  15051. t.Fsmall = 0xf766;
  15052. t.G = 0x0047;
  15053. t.GBsquare = 0x3387;
  15054. t.Gacute = 0x01f4;
  15055. t.Gamma = 0x0393;
  15056. t.Gammaafrican = 0x0194;
  15057. t.Gangiacoptic = 0x03ea;
  15058. t.Gbreve = 0x011e;
  15059. t.Gcaron = 0x01e6;
  15060. t.Gcedilla = 0x0122;
  15061. t.Gcircle = 0x24bc;
  15062. t.Gcircumflex = 0x011c;
  15063. t.Gcommaaccent = 0x0122;
  15064. t.Gdot = 0x0120;
  15065. t.Gdotaccent = 0x0120;
  15066. t.Gecyrillic = 0x0413;
  15067. t.Ghadarmenian = 0x0542;
  15068. t.Ghemiddlehookcyrillic = 0x0494;
  15069. t.Ghestrokecyrillic = 0x0492;
  15070. t.Gheupturncyrillic = 0x0490;
  15071. t.Ghook = 0x0193;
  15072. t.Gimarmenian = 0x0533;
  15073. t.Gjecyrillic = 0x0403;
  15074. t.Gmacron = 0x1e20;
  15075. t.Gmonospace = 0xff27;
  15076. t.Grave = 0xf6ce;
  15077. t.Gravesmall = 0xf760;
  15078. t.Gsmall = 0xf767;
  15079. t.Gsmallhook = 0x029b;
  15080. t.Gstroke = 0x01e4;
  15081. t.H = 0x0048;
  15082. t.H18533 = 0x25cf;
  15083. t.H18543 = 0x25aa;
  15084. t.H18551 = 0x25ab;
  15085. t.H22073 = 0x25a1;
  15086. t.HPsquare = 0x33cb;
  15087. t.Haabkhasiancyrillic = 0x04a8;
  15088. t.Hadescendercyrillic = 0x04b2;
  15089. t.Hardsigncyrillic = 0x042a;
  15090. t.Hbar = 0x0126;
  15091. t.Hbrevebelow = 0x1e2a;
  15092. t.Hcedilla = 0x1e28;
  15093. t.Hcircle = 0x24bd;
  15094. t.Hcircumflex = 0x0124;
  15095. t.Hdieresis = 0x1e26;
  15096. t.Hdotaccent = 0x1e22;
  15097. t.Hdotbelow = 0x1e24;
  15098. t.Hmonospace = 0xff28;
  15099. t.Hoarmenian = 0x0540;
  15100. t.Horicoptic = 0x03e8;
  15101. t.Hsmall = 0xf768;
  15102. t.Hungarumlaut = 0xf6cf;
  15103. t.Hungarumlautsmall = 0xf6f8;
  15104. t.Hzsquare = 0x3390;
  15105. t.I = 0x0049;
  15106. t.IAcyrillic = 0x042f;
  15107. t.IJ = 0x0132;
  15108. t.IUcyrillic = 0x042e;
  15109. t.Iacute = 0x00cd;
  15110. t.Iacutesmall = 0xf7ed;
  15111. t.Ibreve = 0x012c;
  15112. t.Icaron = 0x01cf;
  15113. t.Icircle = 0x24be;
  15114. t.Icircumflex = 0x00ce;
  15115. t.Icircumflexsmall = 0xf7ee;
  15116. t.Icyrillic = 0x0406;
  15117. t.Idblgrave = 0x0208;
  15118. t.Idieresis = 0x00cf;
  15119. t.Idieresisacute = 0x1e2e;
  15120. t.Idieresiscyrillic = 0x04e4;
  15121. t.Idieresissmall = 0xf7ef;
  15122. t.Idot = 0x0130;
  15123. t.Idotaccent = 0x0130;
  15124. t.Idotbelow = 0x1eca;
  15125. t.Iebrevecyrillic = 0x04d6;
  15126. t.Iecyrillic = 0x0415;
  15127. t.Ifraktur = 0x2111;
  15128. t.Igrave = 0x00cc;
  15129. t.Igravesmall = 0xf7ec;
  15130. t.Ihookabove = 0x1ec8;
  15131. t.Iicyrillic = 0x0418;
  15132. t.Iinvertedbreve = 0x020a;
  15133. t.Iishortcyrillic = 0x0419;
  15134. t.Imacron = 0x012a;
  15135. t.Imacroncyrillic = 0x04e2;
  15136. t.Imonospace = 0xff29;
  15137. t.Iniarmenian = 0x053b;
  15138. t.Iocyrillic = 0x0401;
  15139. t.Iogonek = 0x012e;
  15140. t.Iota = 0x0399;
  15141. t.Iotaafrican = 0x0196;
  15142. t.Iotadieresis = 0x03aa;
  15143. t.Iotatonos = 0x038a;
  15144. t.Ismall = 0xf769;
  15145. t.Istroke = 0x0197;
  15146. t.Itilde = 0x0128;
  15147. t.Itildebelow = 0x1e2c;
  15148. t.Izhitsacyrillic = 0x0474;
  15149. t.Izhitsadblgravecyrillic = 0x0476;
  15150. t.J = 0x004a;
  15151. t.Jaarmenian = 0x0541;
  15152. t.Jcircle = 0x24bf;
  15153. t.Jcircumflex = 0x0134;
  15154. t.Jecyrillic = 0x0408;
  15155. t.Jheharmenian = 0x054b;
  15156. t.Jmonospace = 0xff2a;
  15157. t.Jsmall = 0xf76a;
  15158. t.K = 0x004b;
  15159. t.KBsquare = 0x3385;
  15160. t.KKsquare = 0x33cd;
  15161. t.Kabashkircyrillic = 0x04a0;
  15162. t.Kacute = 0x1e30;
  15163. t.Kacyrillic = 0x041a;
  15164. t.Kadescendercyrillic = 0x049a;
  15165. t.Kahookcyrillic = 0x04c3;
  15166. t.Kappa = 0x039a;
  15167. t.Kastrokecyrillic = 0x049e;
  15168. t.Kaverticalstrokecyrillic = 0x049c;
  15169. t.Kcaron = 0x01e8;
  15170. t.Kcedilla = 0x0136;
  15171. t.Kcircle = 0x24c0;
  15172. t.Kcommaaccent = 0x0136;
  15173. t.Kdotbelow = 0x1e32;
  15174. t.Keharmenian = 0x0554;
  15175. t.Kenarmenian = 0x053f;
  15176. t.Khacyrillic = 0x0425;
  15177. t.Kheicoptic = 0x03e6;
  15178. t.Khook = 0x0198;
  15179. t.Kjecyrillic = 0x040c;
  15180. t.Klinebelow = 0x1e34;
  15181. t.Kmonospace = 0xff2b;
  15182. t.Koppacyrillic = 0x0480;
  15183. t.Koppagreek = 0x03de;
  15184. t.Ksicyrillic = 0x046e;
  15185. t.Ksmall = 0xf76b;
  15186. t.L = 0x004c;
  15187. t.LJ = 0x01c7;
  15188. t.LL = 0xf6bf;
  15189. t.Lacute = 0x0139;
  15190. t.Lambda = 0x039b;
  15191. t.Lcaron = 0x013d;
  15192. t.Lcedilla = 0x013b;
  15193. t.Lcircle = 0x24c1;
  15194. t.Lcircumflexbelow = 0x1e3c;
  15195. t.Lcommaaccent = 0x013b;
  15196. t.Ldot = 0x013f;
  15197. t.Ldotaccent = 0x013f;
  15198. t.Ldotbelow = 0x1e36;
  15199. t.Ldotbelowmacron = 0x1e38;
  15200. t.Liwnarmenian = 0x053c;
  15201. t.Lj = 0x01c8;
  15202. t.Ljecyrillic = 0x0409;
  15203. t.Llinebelow = 0x1e3a;
  15204. t.Lmonospace = 0xff2c;
  15205. t.Lslash = 0x0141;
  15206. t.Lslashsmall = 0xf6f9;
  15207. t.Lsmall = 0xf76c;
  15208. t.M = 0x004d;
  15209. t.MBsquare = 0x3386;
  15210. t.Macron = 0xf6d0;
  15211. t.Macronsmall = 0xf7af;
  15212. t.Macute = 0x1e3e;
  15213. t.Mcircle = 0x24c2;
  15214. t.Mdotaccent = 0x1e40;
  15215. t.Mdotbelow = 0x1e42;
  15216. t.Menarmenian = 0x0544;
  15217. t.Mmonospace = 0xff2d;
  15218. t.Msmall = 0xf76d;
  15219. t.Mturned = 0x019c;
  15220. t.Mu = 0x039c;
  15221. t.N = 0x004e;
  15222. t.NJ = 0x01ca;
  15223. t.Nacute = 0x0143;
  15224. t.Ncaron = 0x0147;
  15225. t.Ncedilla = 0x0145;
  15226. t.Ncircle = 0x24c3;
  15227. t.Ncircumflexbelow = 0x1e4a;
  15228. t.Ncommaaccent = 0x0145;
  15229. t.Ndotaccent = 0x1e44;
  15230. t.Ndotbelow = 0x1e46;
  15231. t.Nhookleft = 0x019d;
  15232. t.Nineroman = 0x2168;
  15233. t.Nj = 0x01cb;
  15234. t.Njecyrillic = 0x040a;
  15235. t.Nlinebelow = 0x1e48;
  15236. t.Nmonospace = 0xff2e;
  15237. t.Nowarmenian = 0x0546;
  15238. t.Nsmall = 0xf76e;
  15239. t.Ntilde = 0x00d1;
  15240. t.Ntildesmall = 0xf7f1;
  15241. t.Nu = 0x039d;
  15242. t.O = 0x004f;
  15243. t.OE = 0x0152;
  15244. t.OEsmall = 0xf6fa;
  15245. t.Oacute = 0x00d3;
  15246. t.Oacutesmall = 0xf7f3;
  15247. t.Obarredcyrillic = 0x04e8;
  15248. t.Obarreddieresiscyrillic = 0x04ea;
  15249. t.Obreve = 0x014e;
  15250. t.Ocaron = 0x01d1;
  15251. t.Ocenteredtilde = 0x019f;
  15252. t.Ocircle = 0x24c4;
  15253. t.Ocircumflex = 0x00d4;
  15254. t.Ocircumflexacute = 0x1ed0;
  15255. t.Ocircumflexdotbelow = 0x1ed8;
  15256. t.Ocircumflexgrave = 0x1ed2;
  15257. t.Ocircumflexhookabove = 0x1ed4;
  15258. t.Ocircumflexsmall = 0xf7f4;
  15259. t.Ocircumflextilde = 0x1ed6;
  15260. t.Ocyrillic = 0x041e;
  15261. t.Odblacute = 0x0150;
  15262. t.Odblgrave = 0x020c;
  15263. t.Odieresis = 0x00d6;
  15264. t.Odieresiscyrillic = 0x04e6;
  15265. t.Odieresissmall = 0xf7f6;
  15266. t.Odotbelow = 0x1ecc;
  15267. t.Ogoneksmall = 0xf6fb;
  15268. t.Ograve = 0x00d2;
  15269. t.Ogravesmall = 0xf7f2;
  15270. t.Oharmenian = 0x0555;
  15271. t.Ohm = 0x2126;
  15272. t.Ohookabove = 0x1ece;
  15273. t.Ohorn = 0x01a0;
  15274. t.Ohornacute = 0x1eda;
  15275. t.Ohorndotbelow = 0x1ee2;
  15276. t.Ohorngrave = 0x1edc;
  15277. t.Ohornhookabove = 0x1ede;
  15278. t.Ohorntilde = 0x1ee0;
  15279. t.Ohungarumlaut = 0x0150;
  15280. t.Oi = 0x01a2;
  15281. t.Oinvertedbreve = 0x020e;
  15282. t.Omacron = 0x014c;
  15283. t.Omacronacute = 0x1e52;
  15284. t.Omacrongrave = 0x1e50;
  15285. t.Omega = 0x2126;
  15286. t.Omegacyrillic = 0x0460;
  15287. t.Omegagreek = 0x03a9;
  15288. t.Omegaroundcyrillic = 0x047a;
  15289. t.Omegatitlocyrillic = 0x047c;
  15290. t.Omegatonos = 0x038f;
  15291. t.Omicron = 0x039f;
  15292. t.Omicrontonos = 0x038c;
  15293. t.Omonospace = 0xff2f;
  15294. t.Oneroman = 0x2160;
  15295. t.Oogonek = 0x01ea;
  15296. t.Oogonekmacron = 0x01ec;
  15297. t.Oopen = 0x0186;
  15298. t.Oslash = 0x00d8;
  15299. t.Oslashacute = 0x01fe;
  15300. t.Oslashsmall = 0xf7f8;
  15301. t.Osmall = 0xf76f;
  15302. t.Ostrokeacute = 0x01fe;
  15303. t.Otcyrillic = 0x047e;
  15304. t.Otilde = 0x00d5;
  15305. t.Otildeacute = 0x1e4c;
  15306. t.Otildedieresis = 0x1e4e;
  15307. t.Otildesmall = 0xf7f5;
  15308. t.P = 0x0050;
  15309. t.Pacute = 0x1e54;
  15310. t.Pcircle = 0x24c5;
  15311. t.Pdotaccent = 0x1e56;
  15312. t.Pecyrillic = 0x041f;
  15313. t.Peharmenian = 0x054a;
  15314. t.Pemiddlehookcyrillic = 0x04a6;
  15315. t.Phi = 0x03a6;
  15316. t.Phook = 0x01a4;
  15317. t.Pi = 0x03a0;
  15318. t.Piwrarmenian = 0x0553;
  15319. t.Pmonospace = 0xff30;
  15320. t.Psi = 0x03a8;
  15321. t.Psicyrillic = 0x0470;
  15322. t.Psmall = 0xf770;
  15323. t.Q = 0x0051;
  15324. t.Qcircle = 0x24c6;
  15325. t.Qmonospace = 0xff31;
  15326. t.Qsmall = 0xf771;
  15327. t.R = 0x0052;
  15328. t.Raarmenian = 0x054c;
  15329. t.Racute = 0x0154;
  15330. t.Rcaron = 0x0158;
  15331. t.Rcedilla = 0x0156;
  15332. t.Rcircle = 0x24c7;
  15333. t.Rcommaaccent = 0x0156;
  15334. t.Rdblgrave = 0x0210;
  15335. t.Rdotaccent = 0x1e58;
  15336. t.Rdotbelow = 0x1e5a;
  15337. t.Rdotbelowmacron = 0x1e5c;
  15338. t.Reharmenian = 0x0550;
  15339. t.Rfraktur = 0x211c;
  15340. t.Rho = 0x03a1;
  15341. t.Ringsmall = 0xf6fc;
  15342. t.Rinvertedbreve = 0x0212;
  15343. t.Rlinebelow = 0x1e5e;
  15344. t.Rmonospace = 0xff32;
  15345. t.Rsmall = 0xf772;
  15346. t.Rsmallinverted = 0x0281;
  15347. t.Rsmallinvertedsuperior = 0x02b6;
  15348. t.S = 0x0053;
  15349. t.SF010000 = 0x250c;
  15350. t.SF020000 = 0x2514;
  15351. t.SF030000 = 0x2510;
  15352. t.SF040000 = 0x2518;
  15353. t.SF050000 = 0x253c;
  15354. t.SF060000 = 0x252c;
  15355. t.SF070000 = 0x2534;
  15356. t.SF080000 = 0x251c;
  15357. t.SF090000 = 0x2524;
  15358. t.SF100000 = 0x2500;
  15359. t.SF110000 = 0x2502;
  15360. t.SF190000 = 0x2561;
  15361. t.SF200000 = 0x2562;
  15362. t.SF210000 = 0x2556;
  15363. t.SF220000 = 0x2555;
  15364. t.SF230000 = 0x2563;
  15365. t.SF240000 = 0x2551;
  15366. t.SF250000 = 0x2557;
  15367. t.SF260000 = 0x255d;
  15368. t.SF270000 = 0x255c;
  15369. t.SF280000 = 0x255b;
  15370. t.SF360000 = 0x255e;
  15371. t.SF370000 = 0x255f;
  15372. t.SF380000 = 0x255a;
  15373. t.SF390000 = 0x2554;
  15374. t.SF400000 = 0x2569;
  15375. t.SF410000 = 0x2566;
  15376. t.SF420000 = 0x2560;
  15377. t.SF430000 = 0x2550;
  15378. t.SF440000 = 0x256c;
  15379. t.SF450000 = 0x2567;
  15380. t.SF460000 = 0x2568;
  15381. t.SF470000 = 0x2564;
  15382. t.SF480000 = 0x2565;
  15383. t.SF490000 = 0x2559;
  15384. t.SF500000 = 0x2558;
  15385. t.SF510000 = 0x2552;
  15386. t.SF520000 = 0x2553;
  15387. t.SF530000 = 0x256b;
  15388. t.SF540000 = 0x256a;
  15389. t.Sacute = 0x015a;
  15390. t.Sacutedotaccent = 0x1e64;
  15391. t.Sampigreek = 0x03e0;
  15392. t.Scaron = 0x0160;
  15393. t.Scarondotaccent = 0x1e66;
  15394. t.Scaronsmall = 0xf6fd;
  15395. t.Scedilla = 0x015e;
  15396. t.Schwa = 0x018f;
  15397. t.Schwacyrillic = 0x04d8;
  15398. t.Schwadieresiscyrillic = 0x04da;
  15399. t.Scircle = 0x24c8;
  15400. t.Scircumflex = 0x015c;
  15401. t.Scommaaccent = 0x0218;
  15402. t.Sdotaccent = 0x1e60;
  15403. t.Sdotbelow = 0x1e62;
  15404. t.Sdotbelowdotaccent = 0x1e68;
  15405. t.Seharmenian = 0x054d;
  15406. t.Sevenroman = 0x2166;
  15407. t.Shaarmenian = 0x0547;
  15408. t.Shacyrillic = 0x0428;
  15409. t.Shchacyrillic = 0x0429;
  15410. t.Sheicoptic = 0x03e2;
  15411. t.Shhacyrillic = 0x04ba;
  15412. t.Shimacoptic = 0x03ec;
  15413. t.Sigma = 0x03a3;
  15414. t.Sixroman = 0x2165;
  15415. t.Smonospace = 0xff33;
  15416. t.Softsigncyrillic = 0x042c;
  15417. t.Ssmall = 0xf773;
  15418. t.Stigmagreek = 0x03da;
  15419. t.T = 0x0054;
  15420. t.Tau = 0x03a4;
  15421. t.Tbar = 0x0166;
  15422. t.Tcaron = 0x0164;
  15423. t.Tcedilla = 0x0162;
  15424. t.Tcircle = 0x24c9;
  15425. t.Tcircumflexbelow = 0x1e70;
  15426. t.Tcommaaccent = 0x0162;
  15427. t.Tdotaccent = 0x1e6a;
  15428. t.Tdotbelow = 0x1e6c;
  15429. t.Tecyrillic = 0x0422;
  15430. t.Tedescendercyrillic = 0x04ac;
  15431. t.Tenroman = 0x2169;
  15432. t.Tetsecyrillic = 0x04b4;
  15433. t.Theta = 0x0398;
  15434. t.Thook = 0x01ac;
  15435. t.Thorn = 0x00de;
  15436. t.Thornsmall = 0xf7fe;
  15437. t.Threeroman = 0x2162;
  15438. t.Tildesmall = 0xf6fe;
  15439. t.Tiwnarmenian = 0x054f;
  15440. t.Tlinebelow = 0x1e6e;
  15441. t.Tmonospace = 0xff34;
  15442. t.Toarmenian = 0x0539;
  15443. t.Tonefive = 0x01bc;
  15444. t.Tonesix = 0x0184;
  15445. t.Tonetwo = 0x01a7;
  15446. t.Tretroflexhook = 0x01ae;
  15447. t.Tsecyrillic = 0x0426;
  15448. t.Tshecyrillic = 0x040b;
  15449. t.Tsmall = 0xf774;
  15450. t.Twelveroman = 0x216b;
  15451. t.Tworoman = 0x2161;
  15452. t.U = 0x0055;
  15453. t.Uacute = 0x00da;
  15454. t.Uacutesmall = 0xf7fa;
  15455. t.Ubreve = 0x016c;
  15456. t.Ucaron = 0x01d3;
  15457. t.Ucircle = 0x24ca;
  15458. t.Ucircumflex = 0x00db;
  15459. t.Ucircumflexbelow = 0x1e76;
  15460. t.Ucircumflexsmall = 0xf7fb;
  15461. t.Ucyrillic = 0x0423;
  15462. t.Udblacute = 0x0170;
  15463. t.Udblgrave = 0x0214;
  15464. t.Udieresis = 0x00dc;
  15465. t.Udieresisacute = 0x01d7;
  15466. t.Udieresisbelow = 0x1e72;
  15467. t.Udieresiscaron = 0x01d9;
  15468. t.Udieresiscyrillic = 0x04f0;
  15469. t.Udieresisgrave = 0x01db;
  15470. t.Udieresismacron = 0x01d5;
  15471. t.Udieresissmall = 0xf7fc;
  15472. t.Udotbelow = 0x1ee4;
  15473. t.Ugrave = 0x00d9;
  15474. t.Ugravesmall = 0xf7f9;
  15475. t.Uhookabove = 0x1ee6;
  15476. t.Uhorn = 0x01af;
  15477. t.Uhornacute = 0x1ee8;
  15478. t.Uhorndotbelow = 0x1ef0;
  15479. t.Uhorngrave = 0x1eea;
  15480. t.Uhornhookabove = 0x1eec;
  15481. t.Uhorntilde = 0x1eee;
  15482. t.Uhungarumlaut = 0x0170;
  15483. t.Uhungarumlautcyrillic = 0x04f2;
  15484. t.Uinvertedbreve = 0x0216;
  15485. t.Ukcyrillic = 0x0478;
  15486. t.Umacron = 0x016a;
  15487. t.Umacroncyrillic = 0x04ee;
  15488. t.Umacrondieresis = 0x1e7a;
  15489. t.Umonospace = 0xff35;
  15490. t.Uogonek = 0x0172;
  15491. t.Upsilon = 0x03a5;
  15492. t.Upsilon1 = 0x03d2;
  15493. t.Upsilonacutehooksymbolgreek = 0x03d3;
  15494. t.Upsilonafrican = 0x01b1;
  15495. t.Upsilondieresis = 0x03ab;
  15496. t.Upsilondieresishooksymbolgreek = 0x03d4;
  15497. t.Upsilonhooksymbol = 0x03d2;
  15498. t.Upsilontonos = 0x038e;
  15499. t.Uring = 0x016e;
  15500. t.Ushortcyrillic = 0x040e;
  15501. t.Usmall = 0xf775;
  15502. t.Ustraightcyrillic = 0x04ae;
  15503. t.Ustraightstrokecyrillic = 0x04b0;
  15504. t.Utilde = 0x0168;
  15505. t.Utildeacute = 0x1e78;
  15506. t.Utildebelow = 0x1e74;
  15507. t.V = 0x0056;
  15508. t.Vcircle = 0x24cb;
  15509. t.Vdotbelow = 0x1e7e;
  15510. t.Vecyrillic = 0x0412;
  15511. t.Vewarmenian = 0x054e;
  15512. t.Vhook = 0x01b2;
  15513. t.Vmonospace = 0xff36;
  15514. t.Voarmenian = 0x0548;
  15515. t.Vsmall = 0xf776;
  15516. t.Vtilde = 0x1e7c;
  15517. t.W = 0x0057;
  15518. t.Wacute = 0x1e82;
  15519. t.Wcircle = 0x24cc;
  15520. t.Wcircumflex = 0x0174;
  15521. t.Wdieresis = 0x1e84;
  15522. t.Wdotaccent = 0x1e86;
  15523. t.Wdotbelow = 0x1e88;
  15524. t.Wgrave = 0x1e80;
  15525. t.Wmonospace = 0xff37;
  15526. t.Wsmall = 0xf777;
  15527. t.X = 0x0058;
  15528. t.Xcircle = 0x24cd;
  15529. t.Xdieresis = 0x1e8c;
  15530. t.Xdotaccent = 0x1e8a;
  15531. t.Xeharmenian = 0x053d;
  15532. t.Xi = 0x039e;
  15533. t.Xmonospace = 0xff38;
  15534. t.Xsmall = 0xf778;
  15535. t.Y = 0x0059;
  15536. t.Yacute = 0x00dd;
  15537. t.Yacutesmall = 0xf7fd;
  15538. t.Yatcyrillic = 0x0462;
  15539. t.Ycircle = 0x24ce;
  15540. t.Ycircumflex = 0x0176;
  15541. t.Ydieresis = 0x0178;
  15542. t.Ydieresissmall = 0xf7ff;
  15543. t.Ydotaccent = 0x1e8e;
  15544. t.Ydotbelow = 0x1ef4;
  15545. t.Yericyrillic = 0x042b;
  15546. t.Yerudieresiscyrillic = 0x04f8;
  15547. t.Ygrave = 0x1ef2;
  15548. t.Yhook = 0x01b3;
  15549. t.Yhookabove = 0x1ef6;
  15550. t.Yiarmenian = 0x0545;
  15551. t.Yicyrillic = 0x0407;
  15552. t.Yiwnarmenian = 0x0552;
  15553. t.Ymonospace = 0xff39;
  15554. t.Ysmall = 0xf779;
  15555. t.Ytilde = 0x1ef8;
  15556. t.Yusbigcyrillic = 0x046a;
  15557. t.Yusbigiotifiedcyrillic = 0x046c;
  15558. t.Yuslittlecyrillic = 0x0466;
  15559. t.Yuslittleiotifiedcyrillic = 0x0468;
  15560. t.Z = 0x005a;
  15561. t.Zaarmenian = 0x0536;
  15562. t.Zacute = 0x0179;
  15563. t.Zcaron = 0x017d;
  15564. t.Zcaronsmall = 0xf6ff;
  15565. t.Zcircle = 0x24cf;
  15566. t.Zcircumflex = 0x1e90;
  15567. t.Zdot = 0x017b;
  15568. t.Zdotaccent = 0x017b;
  15569. t.Zdotbelow = 0x1e92;
  15570. t.Zecyrillic = 0x0417;
  15571. t.Zedescendercyrillic = 0x0498;
  15572. t.Zedieresiscyrillic = 0x04de;
  15573. t.Zeta = 0x0396;
  15574. t.Zhearmenian = 0x053a;
  15575. t.Zhebrevecyrillic = 0x04c1;
  15576. t.Zhecyrillic = 0x0416;
  15577. t.Zhedescendercyrillic = 0x0496;
  15578. t.Zhedieresiscyrillic = 0x04dc;
  15579. t.Zlinebelow = 0x1e94;
  15580. t.Zmonospace = 0xff3a;
  15581. t.Zsmall = 0xf77a;
  15582. t.Zstroke = 0x01b5;
  15583. t.a = 0x0061;
  15584. t.aabengali = 0x0986;
  15585. t.aacute = 0x00e1;
  15586. t.aadeva = 0x0906;
  15587. t.aagujarati = 0x0a86;
  15588. t.aagurmukhi = 0x0a06;
  15589. t.aamatragurmukhi = 0x0a3e;
  15590. t.aarusquare = 0x3303;
  15591. t.aavowelsignbengali = 0x09be;
  15592. t.aavowelsigndeva = 0x093e;
  15593. t.aavowelsigngujarati = 0x0abe;
  15594. t.abbreviationmarkarmenian = 0x055f;
  15595. t.abbreviationsigndeva = 0x0970;
  15596. t.abengali = 0x0985;
  15597. t.abopomofo = 0x311a;
  15598. t.abreve = 0x0103;
  15599. t.abreveacute = 0x1eaf;
  15600. t.abrevecyrillic = 0x04d1;
  15601. t.abrevedotbelow = 0x1eb7;
  15602. t.abrevegrave = 0x1eb1;
  15603. t.abrevehookabove = 0x1eb3;
  15604. t.abrevetilde = 0x1eb5;
  15605. t.acaron = 0x01ce;
  15606. t.acircle = 0x24d0;
  15607. t.acircumflex = 0x00e2;
  15608. t.acircumflexacute = 0x1ea5;
  15609. t.acircumflexdotbelow = 0x1ead;
  15610. t.acircumflexgrave = 0x1ea7;
  15611. t.acircumflexhookabove = 0x1ea9;
  15612. t.acircumflextilde = 0x1eab;
  15613. t.acute = 0x00b4;
  15614. t.acutebelowcmb = 0x0317;
  15615. t.acutecmb = 0x0301;
  15616. t.acutecomb = 0x0301;
  15617. t.acutedeva = 0x0954;
  15618. t.acutelowmod = 0x02cf;
  15619. t.acutetonecmb = 0x0341;
  15620. t.acyrillic = 0x0430;
  15621. t.adblgrave = 0x0201;
  15622. t.addakgurmukhi = 0x0a71;
  15623. t.adeva = 0x0905;
  15624. t.adieresis = 0x00e4;
  15625. t.adieresiscyrillic = 0x04d3;
  15626. t.adieresismacron = 0x01df;
  15627. t.adotbelow = 0x1ea1;
  15628. t.adotmacron = 0x01e1;
  15629. t.ae = 0x00e6;
  15630. t.aeacute = 0x01fd;
  15631. t.aekorean = 0x3150;
  15632. t.aemacron = 0x01e3;
  15633. t.afii00208 = 0x2015;
  15634. t.afii08941 = 0x20a4;
  15635. t.afii10017 = 0x0410;
  15636. t.afii10018 = 0x0411;
  15637. t.afii10019 = 0x0412;
  15638. t.afii10020 = 0x0413;
  15639. t.afii10021 = 0x0414;
  15640. t.afii10022 = 0x0415;
  15641. t.afii10023 = 0x0401;
  15642. t.afii10024 = 0x0416;
  15643. t.afii10025 = 0x0417;
  15644. t.afii10026 = 0x0418;
  15645. t.afii10027 = 0x0419;
  15646. t.afii10028 = 0x041a;
  15647. t.afii10029 = 0x041b;
  15648. t.afii10030 = 0x041c;
  15649. t.afii10031 = 0x041d;
  15650. t.afii10032 = 0x041e;
  15651. t.afii10033 = 0x041f;
  15652. t.afii10034 = 0x0420;
  15653. t.afii10035 = 0x0421;
  15654. t.afii10036 = 0x0422;
  15655. t.afii10037 = 0x0423;
  15656. t.afii10038 = 0x0424;
  15657. t.afii10039 = 0x0425;
  15658. t.afii10040 = 0x0426;
  15659. t.afii10041 = 0x0427;
  15660. t.afii10042 = 0x0428;
  15661. t.afii10043 = 0x0429;
  15662. t.afii10044 = 0x042a;
  15663. t.afii10045 = 0x042b;
  15664. t.afii10046 = 0x042c;
  15665. t.afii10047 = 0x042d;
  15666. t.afii10048 = 0x042e;
  15667. t.afii10049 = 0x042f;
  15668. t.afii10050 = 0x0490;
  15669. t.afii10051 = 0x0402;
  15670. t.afii10052 = 0x0403;
  15671. t.afii10053 = 0x0404;
  15672. t.afii10054 = 0x0405;
  15673. t.afii10055 = 0x0406;
  15674. t.afii10056 = 0x0407;
  15675. t.afii10057 = 0x0408;
  15676. t.afii10058 = 0x0409;
  15677. t.afii10059 = 0x040a;
  15678. t.afii10060 = 0x040b;
  15679. t.afii10061 = 0x040c;
  15680. t.afii10062 = 0x040e;
  15681. t.afii10063 = 0xf6c4;
  15682. t.afii10064 = 0xf6c5;
  15683. t.afii10065 = 0x0430;
  15684. t.afii10066 = 0x0431;
  15685. t.afii10067 = 0x0432;
  15686. t.afii10068 = 0x0433;
  15687. t.afii10069 = 0x0434;
  15688. t.afii10070 = 0x0435;
  15689. t.afii10071 = 0x0451;
  15690. t.afii10072 = 0x0436;
  15691. t.afii10073 = 0x0437;
  15692. t.afii10074 = 0x0438;
  15693. t.afii10075 = 0x0439;
  15694. t.afii10076 = 0x043a;
  15695. t.afii10077 = 0x043b;
  15696. t.afii10078 = 0x043c;
  15697. t.afii10079 = 0x043d;
  15698. t.afii10080 = 0x043e;
  15699. t.afii10081 = 0x043f;
  15700. t.afii10082 = 0x0440;
  15701. t.afii10083 = 0x0441;
  15702. t.afii10084 = 0x0442;
  15703. t.afii10085 = 0x0443;
  15704. t.afii10086 = 0x0444;
  15705. t.afii10087 = 0x0445;
  15706. t.afii10088 = 0x0446;
  15707. t.afii10089 = 0x0447;
  15708. t.afii10090 = 0x0448;
  15709. t.afii10091 = 0x0449;
  15710. t.afii10092 = 0x044a;
  15711. t.afii10093 = 0x044b;
  15712. t.afii10094 = 0x044c;
  15713. t.afii10095 = 0x044d;
  15714. t.afii10096 = 0x044e;
  15715. t.afii10097 = 0x044f;
  15716. t.afii10098 = 0x0491;
  15717. t.afii10099 = 0x0452;
  15718. t.afii10100 = 0x0453;
  15719. t.afii10101 = 0x0454;
  15720. t.afii10102 = 0x0455;
  15721. t.afii10103 = 0x0456;
  15722. t.afii10104 = 0x0457;
  15723. t.afii10105 = 0x0458;
  15724. t.afii10106 = 0x0459;
  15725. t.afii10107 = 0x045a;
  15726. t.afii10108 = 0x045b;
  15727. t.afii10109 = 0x045c;
  15728. t.afii10110 = 0x045e;
  15729. t.afii10145 = 0x040f;
  15730. t.afii10146 = 0x0462;
  15731. t.afii10147 = 0x0472;
  15732. t.afii10148 = 0x0474;
  15733. t.afii10192 = 0xf6c6;
  15734. t.afii10193 = 0x045f;
  15735. t.afii10194 = 0x0463;
  15736. t.afii10195 = 0x0473;
  15737. t.afii10196 = 0x0475;
  15738. t.afii10831 = 0xf6c7;
  15739. t.afii10832 = 0xf6c8;
  15740. t.afii10846 = 0x04d9;
  15741. t.afii299 = 0x200e;
  15742. t.afii300 = 0x200f;
  15743. t.afii301 = 0x200d;
  15744. t.afii57381 = 0x066a;
  15745. t.afii57388 = 0x060c;
  15746. t.afii57392 = 0x0660;
  15747. t.afii57393 = 0x0661;
  15748. t.afii57394 = 0x0662;
  15749. t.afii57395 = 0x0663;
  15750. t.afii57396 = 0x0664;
  15751. t.afii57397 = 0x0665;
  15752. t.afii57398 = 0x0666;
  15753. t.afii57399 = 0x0667;
  15754. t.afii57400 = 0x0668;
  15755. t.afii57401 = 0x0669;
  15756. t.afii57403 = 0x061b;
  15757. t.afii57407 = 0x061f;
  15758. t.afii57409 = 0x0621;
  15759. t.afii57410 = 0x0622;
  15760. t.afii57411 = 0x0623;
  15761. t.afii57412 = 0x0624;
  15762. t.afii57413 = 0x0625;
  15763. t.afii57414 = 0x0626;
  15764. t.afii57415 = 0x0627;
  15765. t.afii57416 = 0x0628;
  15766. t.afii57417 = 0x0629;
  15767. t.afii57418 = 0x062a;
  15768. t.afii57419 = 0x062b;
  15769. t.afii57420 = 0x062c;
  15770. t.afii57421 = 0x062d;
  15771. t.afii57422 = 0x062e;
  15772. t.afii57423 = 0x062f;
  15773. t.afii57424 = 0x0630;
  15774. t.afii57425 = 0x0631;
  15775. t.afii57426 = 0x0632;
  15776. t.afii57427 = 0x0633;
  15777. t.afii57428 = 0x0634;
  15778. t.afii57429 = 0x0635;
  15779. t.afii57430 = 0x0636;
  15780. t.afii57431 = 0x0637;
  15781. t.afii57432 = 0x0638;
  15782. t.afii57433 = 0x0639;
  15783. t.afii57434 = 0x063a;
  15784. t.afii57440 = 0x0640;
  15785. t.afii57441 = 0x0641;
  15786. t.afii57442 = 0x0642;
  15787. t.afii57443 = 0x0643;
  15788. t.afii57444 = 0x0644;
  15789. t.afii57445 = 0x0645;
  15790. t.afii57446 = 0x0646;
  15791. t.afii57448 = 0x0648;
  15792. t.afii57449 = 0x0649;
  15793. t.afii57450 = 0x064a;
  15794. t.afii57451 = 0x064b;
  15795. t.afii57452 = 0x064c;
  15796. t.afii57453 = 0x064d;
  15797. t.afii57454 = 0x064e;
  15798. t.afii57455 = 0x064f;
  15799. t.afii57456 = 0x0650;
  15800. t.afii57457 = 0x0651;
  15801. t.afii57458 = 0x0652;
  15802. t.afii57470 = 0x0647;
  15803. t.afii57505 = 0x06a4;
  15804. t.afii57506 = 0x067e;
  15805. t.afii57507 = 0x0686;
  15806. t.afii57508 = 0x0698;
  15807. t.afii57509 = 0x06af;
  15808. t.afii57511 = 0x0679;
  15809. t.afii57512 = 0x0688;
  15810. t.afii57513 = 0x0691;
  15811. t.afii57514 = 0x06ba;
  15812. t.afii57519 = 0x06d2;
  15813. t.afii57534 = 0x06d5;
  15814. t.afii57636 = 0x20aa;
  15815. t.afii57645 = 0x05be;
  15816. t.afii57658 = 0x05c3;
  15817. t.afii57664 = 0x05d0;
  15818. t.afii57665 = 0x05d1;
  15819. t.afii57666 = 0x05d2;
  15820. t.afii57667 = 0x05d3;
  15821. t.afii57668 = 0x05d4;
  15822. t.afii57669 = 0x05d5;
  15823. t.afii57670 = 0x05d6;
  15824. t.afii57671 = 0x05d7;
  15825. t.afii57672 = 0x05d8;
  15826. t.afii57673 = 0x05d9;
  15827. t.afii57674 = 0x05da;
  15828. t.afii57675 = 0x05db;
  15829. t.afii57676 = 0x05dc;
  15830. t.afii57677 = 0x05dd;
  15831. t.afii57678 = 0x05de;
  15832. t.afii57679 = 0x05df;
  15833. t.afii57680 = 0x05e0;
  15834. t.afii57681 = 0x05e1;
  15835. t.afii57682 = 0x05e2;
  15836. t.afii57683 = 0x05e3;
  15837. t.afii57684 = 0x05e4;
  15838. t.afii57685 = 0x05e5;
  15839. t.afii57686 = 0x05e6;
  15840. t.afii57687 = 0x05e7;
  15841. t.afii57688 = 0x05e8;
  15842. t.afii57689 = 0x05e9;
  15843. t.afii57690 = 0x05ea;
  15844. t.afii57694 = 0xfb2a;
  15845. t.afii57695 = 0xfb2b;
  15846. t.afii57700 = 0xfb4b;
  15847. t.afii57705 = 0xfb1f;
  15848. t.afii57716 = 0x05f0;
  15849. t.afii57717 = 0x05f1;
  15850. t.afii57718 = 0x05f2;
  15851. t.afii57723 = 0xfb35;
  15852. t.afii57793 = 0x05b4;
  15853. t.afii57794 = 0x05b5;
  15854. t.afii57795 = 0x05b6;
  15855. t.afii57796 = 0x05bb;
  15856. t.afii57797 = 0x05b8;
  15857. t.afii57798 = 0x05b7;
  15858. t.afii57799 = 0x05b0;
  15859. t.afii57800 = 0x05b2;
  15860. t.afii57801 = 0x05b1;
  15861. t.afii57802 = 0x05b3;
  15862. t.afii57803 = 0x05c2;
  15863. t.afii57804 = 0x05c1;
  15864. t.afii57806 = 0x05b9;
  15865. t.afii57807 = 0x05bc;
  15866. t.afii57839 = 0x05bd;
  15867. t.afii57841 = 0x05bf;
  15868. t.afii57842 = 0x05c0;
  15869. t.afii57929 = 0x02bc;
  15870. t.afii61248 = 0x2105;
  15871. t.afii61289 = 0x2113;
  15872. t.afii61352 = 0x2116;
  15873. t.afii61573 = 0x202c;
  15874. t.afii61574 = 0x202d;
  15875. t.afii61575 = 0x202e;
  15876. t.afii61664 = 0x200c;
  15877. t.afii63167 = 0x066d;
  15878. t.afii64937 = 0x02bd;
  15879. t.agrave = 0x00e0;
  15880. t.agujarati = 0x0a85;
  15881. t.agurmukhi = 0x0a05;
  15882. t.ahiragana = 0x3042;
  15883. t.ahookabove = 0x1ea3;
  15884. t.aibengali = 0x0990;
  15885. t.aibopomofo = 0x311e;
  15886. t.aideva = 0x0910;
  15887. t.aiecyrillic = 0x04d5;
  15888. t.aigujarati = 0x0a90;
  15889. t.aigurmukhi = 0x0a10;
  15890. t.aimatragurmukhi = 0x0a48;
  15891. t.ainarabic = 0x0639;
  15892. t.ainfinalarabic = 0xfeca;
  15893. t.aininitialarabic = 0xfecb;
  15894. t.ainmedialarabic = 0xfecc;
  15895. t.ainvertedbreve = 0x0203;
  15896. t.aivowelsignbengali = 0x09c8;
  15897. t.aivowelsigndeva = 0x0948;
  15898. t.aivowelsigngujarati = 0x0ac8;
  15899. t.akatakana = 0x30a2;
  15900. t.akatakanahalfwidth = 0xff71;
  15901. t.akorean = 0x314f;
  15902. t.alef = 0x05d0;
  15903. t.alefarabic = 0x0627;
  15904. t.alefdageshhebrew = 0xfb30;
  15905. t.aleffinalarabic = 0xfe8e;
  15906. t.alefhamzaabovearabic = 0x0623;
  15907. t.alefhamzaabovefinalarabic = 0xfe84;
  15908. t.alefhamzabelowarabic = 0x0625;
  15909. t.alefhamzabelowfinalarabic = 0xfe88;
  15910. t.alefhebrew = 0x05d0;
  15911. t.aleflamedhebrew = 0xfb4f;
  15912. t.alefmaddaabovearabic = 0x0622;
  15913. t.alefmaddaabovefinalarabic = 0xfe82;
  15914. t.alefmaksuraarabic = 0x0649;
  15915. t.alefmaksurafinalarabic = 0xfef0;
  15916. t.alefmaksurainitialarabic = 0xfef3;
  15917. t.alefmaksuramedialarabic = 0xfef4;
  15918. t.alefpatahhebrew = 0xfb2e;
  15919. t.alefqamatshebrew = 0xfb2f;
  15920. t.aleph = 0x2135;
  15921. t.allequal = 0x224c;
  15922. t.alpha = 0x03b1;
  15923. t.alphatonos = 0x03ac;
  15924. t.amacron = 0x0101;
  15925. t.amonospace = 0xff41;
  15926. t.ampersand = 0x0026;
  15927. t.ampersandmonospace = 0xff06;
  15928. t.ampersandsmall = 0xf726;
  15929. t.amsquare = 0x33c2;
  15930. t.anbopomofo = 0x3122;
  15931. t.angbopomofo = 0x3124;
  15932. t.angbracketleft = 0x3008;
  15933. t.angbracketright = 0x3009;
  15934. t.angkhankhuthai = 0x0e5a;
  15935. t.angle = 0x2220;
  15936. t.anglebracketleft = 0x3008;
  15937. t.anglebracketleftvertical = 0xfe3f;
  15938. t.anglebracketright = 0x3009;
  15939. t.anglebracketrightvertical = 0xfe40;
  15940. t.angleleft = 0x2329;
  15941. t.angleright = 0x232a;
  15942. t.angstrom = 0x212b;
  15943. t.anoteleia = 0x0387;
  15944. t.anudattadeva = 0x0952;
  15945. t.anusvarabengali = 0x0982;
  15946. t.anusvaradeva = 0x0902;
  15947. t.anusvaragujarati = 0x0a82;
  15948. t.aogonek = 0x0105;
  15949. t.apaatosquare = 0x3300;
  15950. t.aparen = 0x249c;
  15951. t.apostrophearmenian = 0x055a;
  15952. t.apostrophemod = 0x02bc;
  15953. t.apple = 0xf8ff;
  15954. t.approaches = 0x2250;
  15955. t.approxequal = 0x2248;
  15956. t.approxequalorimage = 0x2252;
  15957. t.approximatelyequal = 0x2245;
  15958. t.araeaekorean = 0x318e;
  15959. t.araeakorean = 0x318d;
  15960. t.arc = 0x2312;
  15961. t.arighthalfring = 0x1e9a;
  15962. t.aring = 0x00e5;
  15963. t.aringacute = 0x01fb;
  15964. t.aringbelow = 0x1e01;
  15965. t.arrowboth = 0x2194;
  15966. t.arrowdashdown = 0x21e3;
  15967. t.arrowdashleft = 0x21e0;
  15968. t.arrowdashright = 0x21e2;
  15969. t.arrowdashup = 0x21e1;
  15970. t.arrowdblboth = 0x21d4;
  15971. t.arrowdbldown = 0x21d3;
  15972. t.arrowdblleft = 0x21d0;
  15973. t.arrowdblright = 0x21d2;
  15974. t.arrowdblup = 0x21d1;
  15975. t.arrowdown = 0x2193;
  15976. t.arrowdownleft = 0x2199;
  15977. t.arrowdownright = 0x2198;
  15978. t.arrowdownwhite = 0x21e9;
  15979. t.arrowheaddownmod = 0x02c5;
  15980. t.arrowheadleftmod = 0x02c2;
  15981. t.arrowheadrightmod = 0x02c3;
  15982. t.arrowheadupmod = 0x02c4;
  15983. t.arrowhorizex = 0xf8e7;
  15984. t.arrowleft = 0x2190;
  15985. t.arrowleftdbl = 0x21d0;
  15986. t.arrowleftdblstroke = 0x21cd;
  15987. t.arrowleftoverright = 0x21c6;
  15988. t.arrowleftwhite = 0x21e6;
  15989. t.arrowright = 0x2192;
  15990. t.arrowrightdblstroke = 0x21cf;
  15991. t.arrowrightheavy = 0x279e;
  15992. t.arrowrightoverleft = 0x21c4;
  15993. t.arrowrightwhite = 0x21e8;
  15994. t.arrowtableft = 0x21e4;
  15995. t.arrowtabright = 0x21e5;
  15996. t.arrowup = 0x2191;
  15997. t.arrowupdn = 0x2195;
  15998. t.arrowupdnbse = 0x21a8;
  15999. t.arrowupdownbase = 0x21a8;
  16000. t.arrowupleft = 0x2196;
  16001. t.arrowupleftofdown = 0x21c5;
  16002. t.arrowupright = 0x2197;
  16003. t.arrowupwhite = 0x21e7;
  16004. t.arrowvertex = 0xf8e6;
  16005. t.asciicircum = 0x005e;
  16006. t.asciicircummonospace = 0xff3e;
  16007. t.asciitilde = 0x007e;
  16008. t.asciitildemonospace = 0xff5e;
  16009. t.ascript = 0x0251;
  16010. t.ascriptturned = 0x0252;
  16011. t.asmallhiragana = 0x3041;
  16012. t.asmallkatakana = 0x30a1;
  16013. t.asmallkatakanahalfwidth = 0xff67;
  16014. t.asterisk = 0x002a;
  16015. t.asteriskaltonearabic = 0x066d;
  16016. t.asteriskarabic = 0x066d;
  16017. t.asteriskmath = 0x2217;
  16018. t.asteriskmonospace = 0xff0a;
  16019. t.asterisksmall = 0xfe61;
  16020. t.asterism = 0x2042;
  16021. t.asuperior = 0xf6e9;
  16022. t.asymptoticallyequal = 0x2243;
  16023. t.at = 0x0040;
  16024. t.atilde = 0x00e3;
  16025. t.atmonospace = 0xff20;
  16026. t.atsmall = 0xfe6b;
  16027. t.aturned = 0x0250;
  16028. t.aubengali = 0x0994;
  16029. t.aubopomofo = 0x3120;
  16030. t.audeva = 0x0914;
  16031. t.augujarati = 0x0a94;
  16032. t.augurmukhi = 0x0a14;
  16033. t.aulengthmarkbengali = 0x09d7;
  16034. t.aumatragurmukhi = 0x0a4c;
  16035. t.auvowelsignbengali = 0x09cc;
  16036. t.auvowelsigndeva = 0x094c;
  16037. t.auvowelsigngujarati = 0x0acc;
  16038. t.avagrahadeva = 0x093d;
  16039. t.aybarmenian = 0x0561;
  16040. t.ayin = 0x05e2;
  16041. t.ayinaltonehebrew = 0xfb20;
  16042. t.ayinhebrew = 0x05e2;
  16043. t.b = 0x0062;
  16044. t.babengali = 0x09ac;
  16045. t.backslash = 0x005c;
  16046. t.backslashmonospace = 0xff3c;
  16047. t.badeva = 0x092c;
  16048. t.bagujarati = 0x0aac;
  16049. t.bagurmukhi = 0x0a2c;
  16050. t.bahiragana = 0x3070;
  16051. t.bahtthai = 0x0e3f;
  16052. t.bakatakana = 0x30d0;
  16053. t.bar = 0x007c;
  16054. t.barmonospace = 0xff5c;
  16055. t.bbopomofo = 0x3105;
  16056. t.bcircle = 0x24d1;
  16057. t.bdotaccent = 0x1e03;
  16058. t.bdotbelow = 0x1e05;
  16059. t.beamedsixteenthnotes = 0x266c;
  16060. t.because = 0x2235;
  16061. t.becyrillic = 0x0431;
  16062. t.beharabic = 0x0628;
  16063. t.behfinalarabic = 0xfe90;
  16064. t.behinitialarabic = 0xfe91;
  16065. t.behiragana = 0x3079;
  16066. t.behmedialarabic = 0xfe92;
  16067. t.behmeeminitialarabic = 0xfc9f;
  16068. t.behmeemisolatedarabic = 0xfc08;
  16069. t.behnoonfinalarabic = 0xfc6d;
  16070. t.bekatakana = 0x30d9;
  16071. t.benarmenian = 0x0562;
  16072. t.bet = 0x05d1;
  16073. t.beta = 0x03b2;
  16074. t.betasymbolgreek = 0x03d0;
  16075. t.betdagesh = 0xfb31;
  16076. t.betdageshhebrew = 0xfb31;
  16077. t.bethebrew = 0x05d1;
  16078. t.betrafehebrew = 0xfb4c;
  16079. t.bhabengali = 0x09ad;
  16080. t.bhadeva = 0x092d;
  16081. t.bhagujarati = 0x0aad;
  16082. t.bhagurmukhi = 0x0a2d;
  16083. t.bhook = 0x0253;
  16084. t.bihiragana = 0x3073;
  16085. t.bikatakana = 0x30d3;
  16086. t.bilabialclick = 0x0298;
  16087. t.bindigurmukhi = 0x0a02;
  16088. t.birusquare = 0x3331;
  16089. t.blackcircle = 0x25cf;
  16090. t.blackdiamond = 0x25c6;
  16091. t.blackdownpointingtriangle = 0x25bc;
  16092. t.blackleftpointingpointer = 0x25c4;
  16093. t.blackleftpointingtriangle = 0x25c0;
  16094. t.blacklenticularbracketleft = 0x3010;
  16095. t.blacklenticularbracketleftvertical = 0xfe3b;
  16096. t.blacklenticularbracketright = 0x3011;
  16097. t.blacklenticularbracketrightvertical = 0xfe3c;
  16098. t.blacklowerlefttriangle = 0x25e3;
  16099. t.blacklowerrighttriangle = 0x25e2;
  16100. t.blackrectangle = 0x25ac;
  16101. t.blackrightpointingpointer = 0x25ba;
  16102. t.blackrightpointingtriangle = 0x25b6;
  16103. t.blacksmallsquare = 0x25aa;
  16104. t.blacksmilingface = 0x263b;
  16105. t.blacksquare = 0x25a0;
  16106. t.blackstar = 0x2605;
  16107. t.blackupperlefttriangle = 0x25e4;
  16108. t.blackupperrighttriangle = 0x25e5;
  16109. t.blackuppointingsmalltriangle = 0x25b4;
  16110. t.blackuppointingtriangle = 0x25b2;
  16111. t.blank = 0x2423;
  16112. t.blinebelow = 0x1e07;
  16113. t.block = 0x2588;
  16114. t.bmonospace = 0xff42;
  16115. t.bobaimaithai = 0x0e1a;
  16116. t.bohiragana = 0x307c;
  16117. t.bokatakana = 0x30dc;
  16118. t.bparen = 0x249d;
  16119. t.bqsquare = 0x33c3;
  16120. t.braceex = 0xf8f4;
  16121. t.braceleft = 0x007b;
  16122. t.braceleftbt = 0xf8f3;
  16123. t.braceleftmid = 0xf8f2;
  16124. t.braceleftmonospace = 0xff5b;
  16125. t.braceleftsmall = 0xfe5b;
  16126. t.bracelefttp = 0xf8f1;
  16127. t.braceleftvertical = 0xfe37;
  16128. t.braceright = 0x007d;
  16129. t.bracerightbt = 0xf8fe;
  16130. t.bracerightmid = 0xf8fd;
  16131. t.bracerightmonospace = 0xff5d;
  16132. t.bracerightsmall = 0xfe5c;
  16133. t.bracerighttp = 0xf8fc;
  16134. t.bracerightvertical = 0xfe38;
  16135. t.bracketleft = 0x005b;
  16136. t.bracketleftbt = 0xf8f0;
  16137. t.bracketleftex = 0xf8ef;
  16138. t.bracketleftmonospace = 0xff3b;
  16139. t.bracketlefttp = 0xf8ee;
  16140. t.bracketright = 0x005d;
  16141. t.bracketrightbt = 0xf8fb;
  16142. t.bracketrightex = 0xf8fa;
  16143. t.bracketrightmonospace = 0xff3d;
  16144. t.bracketrighttp = 0xf8f9;
  16145. t.breve = 0x02d8;
  16146. t.brevebelowcmb = 0x032e;
  16147. t.brevecmb = 0x0306;
  16148. t.breveinvertedbelowcmb = 0x032f;
  16149. t.breveinvertedcmb = 0x0311;
  16150. t.breveinverteddoublecmb = 0x0361;
  16151. t.bridgebelowcmb = 0x032a;
  16152. t.bridgeinvertedbelowcmb = 0x033a;
  16153. t.brokenbar = 0x00a6;
  16154. t.bstroke = 0x0180;
  16155. t.bsuperior = 0xf6ea;
  16156. t.btopbar = 0x0183;
  16157. t.buhiragana = 0x3076;
  16158. t.bukatakana = 0x30d6;
  16159. t.bullet = 0x2022;
  16160. t.bulletinverse = 0x25d8;
  16161. t.bulletoperator = 0x2219;
  16162. t.bullseye = 0x25ce;
  16163. t.c = 0x0063;
  16164. t.caarmenian = 0x056e;
  16165. t.cabengali = 0x099a;
  16166. t.cacute = 0x0107;
  16167. t.cadeva = 0x091a;
  16168. t.cagujarati = 0x0a9a;
  16169. t.cagurmukhi = 0x0a1a;
  16170. t.calsquare = 0x3388;
  16171. t.candrabindubengali = 0x0981;
  16172. t.candrabinducmb = 0x0310;
  16173. t.candrabindudeva = 0x0901;
  16174. t.candrabindugujarati = 0x0a81;
  16175. t.capslock = 0x21ea;
  16176. t.careof = 0x2105;
  16177. t.caron = 0x02c7;
  16178. t.caronbelowcmb = 0x032c;
  16179. t.caroncmb = 0x030c;
  16180. t.carriagereturn = 0x21b5;
  16181. t.cbopomofo = 0x3118;
  16182. t.ccaron = 0x010d;
  16183. t.ccedilla = 0x00e7;
  16184. t.ccedillaacute = 0x1e09;
  16185. t.ccircle = 0x24d2;
  16186. t.ccircumflex = 0x0109;
  16187. t.ccurl = 0x0255;
  16188. t.cdot = 0x010b;
  16189. t.cdotaccent = 0x010b;
  16190. t.cdsquare = 0x33c5;
  16191. t.cedilla = 0x00b8;
  16192. t.cedillacmb = 0x0327;
  16193. t.cent = 0x00a2;
  16194. t.centigrade = 0x2103;
  16195. t.centinferior = 0xf6df;
  16196. t.centmonospace = 0xffe0;
  16197. t.centoldstyle = 0xf7a2;
  16198. t.centsuperior = 0xf6e0;
  16199. t.chaarmenian = 0x0579;
  16200. t.chabengali = 0x099b;
  16201. t.chadeva = 0x091b;
  16202. t.chagujarati = 0x0a9b;
  16203. t.chagurmukhi = 0x0a1b;
  16204. t.chbopomofo = 0x3114;
  16205. t.cheabkhasiancyrillic = 0x04bd;
  16206. t.checkmark = 0x2713;
  16207. t.checyrillic = 0x0447;
  16208. t.chedescenderabkhasiancyrillic = 0x04bf;
  16209. t.chedescendercyrillic = 0x04b7;
  16210. t.chedieresiscyrillic = 0x04f5;
  16211. t.cheharmenian = 0x0573;
  16212. t.chekhakassiancyrillic = 0x04cc;
  16213. t.cheverticalstrokecyrillic = 0x04b9;
  16214. t.chi = 0x03c7;
  16215. t.chieuchacirclekorean = 0x3277;
  16216. t.chieuchaparenkorean = 0x3217;
  16217. t.chieuchcirclekorean = 0x3269;
  16218. t.chieuchkorean = 0x314a;
  16219. t.chieuchparenkorean = 0x3209;
  16220. t.chochangthai = 0x0e0a;
  16221. t.chochanthai = 0x0e08;
  16222. t.chochingthai = 0x0e09;
  16223. t.chochoethai = 0x0e0c;
  16224. t.chook = 0x0188;
  16225. t.cieucacirclekorean = 0x3276;
  16226. t.cieucaparenkorean = 0x3216;
  16227. t.cieuccirclekorean = 0x3268;
  16228. t.cieuckorean = 0x3148;
  16229. t.cieucparenkorean = 0x3208;
  16230. t.cieucuparenkorean = 0x321c;
  16231. t.circle = 0x25cb;
  16232. t.circlecopyrt = 0x00a9;
  16233. t.circlemultiply = 0x2297;
  16234. t.circleot = 0x2299;
  16235. t.circleplus = 0x2295;
  16236. t.circlepostalmark = 0x3036;
  16237. t.circlewithlefthalfblack = 0x25d0;
  16238. t.circlewithrighthalfblack = 0x25d1;
  16239. t.circumflex = 0x02c6;
  16240. t.circumflexbelowcmb = 0x032d;
  16241. t.circumflexcmb = 0x0302;
  16242. t.clear = 0x2327;
  16243. t.clickalveolar = 0x01c2;
  16244. t.clickdental = 0x01c0;
  16245. t.clicklateral = 0x01c1;
  16246. t.clickretroflex = 0x01c3;
  16247. t.club = 0x2663;
  16248. t.clubsuitblack = 0x2663;
  16249. t.clubsuitwhite = 0x2667;
  16250. t.cmcubedsquare = 0x33a4;
  16251. t.cmonospace = 0xff43;
  16252. t.cmsquaredsquare = 0x33a0;
  16253. t.coarmenian = 0x0581;
  16254. t.colon = 0x003a;
  16255. t.colonmonetary = 0x20a1;
  16256. t.colonmonospace = 0xff1a;
  16257. t.colonsign = 0x20a1;
  16258. t.colonsmall = 0xfe55;
  16259. t.colontriangularhalfmod = 0x02d1;
  16260. t.colontriangularmod = 0x02d0;
  16261. t.comma = 0x002c;
  16262. t.commaabovecmb = 0x0313;
  16263. t.commaaboverightcmb = 0x0315;
  16264. t.commaaccent = 0xf6c3;
  16265. t.commaarabic = 0x060c;
  16266. t.commaarmenian = 0x055d;
  16267. t.commainferior = 0xf6e1;
  16268. t.commamonospace = 0xff0c;
  16269. t.commareversedabovecmb = 0x0314;
  16270. t.commareversedmod = 0x02bd;
  16271. t.commasmall = 0xfe50;
  16272. t.commasuperior = 0xf6e2;
  16273. t.commaturnedabovecmb = 0x0312;
  16274. t.commaturnedmod = 0x02bb;
  16275. t.compass = 0x263c;
  16276. t.congruent = 0x2245;
  16277. t.contourintegral = 0x222e;
  16278. t.control = 0x2303;
  16279. t.controlACK = 0x0006;
  16280. t.controlBEL = 0x0007;
  16281. t.controlBS = 0x0008;
  16282. t.controlCAN = 0x0018;
  16283. t.controlCR = 0x000d;
  16284. t.controlDC1 = 0x0011;
  16285. t.controlDC2 = 0x0012;
  16286. t.controlDC3 = 0x0013;
  16287. t.controlDC4 = 0x0014;
  16288. t.controlDEL = 0x007f;
  16289. t.controlDLE = 0x0010;
  16290. t.controlEM = 0x0019;
  16291. t.controlENQ = 0x0005;
  16292. t.controlEOT = 0x0004;
  16293. t.controlESC = 0x001b;
  16294. t.controlETB = 0x0017;
  16295. t.controlETX = 0x0003;
  16296. t.controlFF = 0x000c;
  16297. t.controlFS = 0x001c;
  16298. t.controlGS = 0x001d;
  16299. t.controlHT = 0x0009;
  16300. t.controlLF = 0x000a;
  16301. t.controlNAK = 0x0015;
  16302. t.controlNULL = 0x0000;
  16303. t.controlRS = 0x001e;
  16304. t.controlSI = 0x000f;
  16305. t.controlSO = 0x000e;
  16306. t.controlSOT = 0x0002;
  16307. t.controlSTX = 0x0001;
  16308. t.controlSUB = 0x001a;
  16309. t.controlSYN = 0x0016;
  16310. t.controlUS = 0x001f;
  16311. t.controlVT = 0x000b;
  16312. t.copyright = 0x00a9;
  16313. t.copyrightsans = 0xf8e9;
  16314. t.copyrightserif = 0xf6d9;
  16315. t.cornerbracketleft = 0x300c;
  16316. t.cornerbracketlefthalfwidth = 0xff62;
  16317. t.cornerbracketleftvertical = 0xfe41;
  16318. t.cornerbracketright = 0x300d;
  16319. t.cornerbracketrighthalfwidth = 0xff63;
  16320. t.cornerbracketrightvertical = 0xfe42;
  16321. t.corporationsquare = 0x337f;
  16322. t.cosquare = 0x33c7;
  16323. t.coverkgsquare = 0x33c6;
  16324. t.cparen = 0x249e;
  16325. t.cruzeiro = 0x20a2;
  16326. t.cstretched = 0x0297;
  16327. t.curlyand = 0x22cf;
  16328. t.curlyor = 0x22ce;
  16329. t.currency = 0x00a4;
  16330. t.cyrBreve = 0xf6d1;
  16331. t.cyrFlex = 0xf6d2;
  16332. t.cyrbreve = 0xf6d4;
  16333. t.cyrflex = 0xf6d5;
  16334. t.d = 0x0064;
  16335. t.daarmenian = 0x0564;
  16336. t.dabengali = 0x09a6;
  16337. t.dadarabic = 0x0636;
  16338. t.dadeva = 0x0926;
  16339. t.dadfinalarabic = 0xfebe;
  16340. t.dadinitialarabic = 0xfebf;
  16341. t.dadmedialarabic = 0xfec0;
  16342. t.dagesh = 0x05bc;
  16343. t.dageshhebrew = 0x05bc;
  16344. t.dagger = 0x2020;
  16345. t.daggerdbl = 0x2021;
  16346. t.dagujarati = 0x0aa6;
  16347. t.dagurmukhi = 0x0a26;
  16348. t.dahiragana = 0x3060;
  16349. t.dakatakana = 0x30c0;
  16350. t.dalarabic = 0x062f;
  16351. t.dalet = 0x05d3;
  16352. t.daletdagesh = 0xfb33;
  16353. t.daletdageshhebrew = 0xfb33;
  16354. t.dalethebrew = 0x05d3;
  16355. t.dalfinalarabic = 0xfeaa;
  16356. t.dammaarabic = 0x064f;
  16357. t.dammalowarabic = 0x064f;
  16358. t.dammatanaltonearabic = 0x064c;
  16359. t.dammatanarabic = 0x064c;
  16360. t.danda = 0x0964;
  16361. t.dargahebrew = 0x05a7;
  16362. t.dargalefthebrew = 0x05a7;
  16363. t.dasiapneumatacyrilliccmb = 0x0485;
  16364. t.dblGrave = 0xf6d3;
  16365. t.dblanglebracketleft = 0x300a;
  16366. t.dblanglebracketleftvertical = 0xfe3d;
  16367. t.dblanglebracketright = 0x300b;
  16368. t.dblanglebracketrightvertical = 0xfe3e;
  16369. t.dblarchinvertedbelowcmb = 0x032b;
  16370. t.dblarrowleft = 0x21d4;
  16371. t.dblarrowright = 0x21d2;
  16372. t.dbldanda = 0x0965;
  16373. t.dblgrave = 0xf6d6;
  16374. t.dblgravecmb = 0x030f;
  16375. t.dblintegral = 0x222c;
  16376. t.dbllowline = 0x2017;
  16377. t.dbllowlinecmb = 0x0333;
  16378. t.dbloverlinecmb = 0x033f;
  16379. t.dblprimemod = 0x02ba;
  16380. t.dblverticalbar = 0x2016;
  16381. t.dblverticallineabovecmb = 0x030e;
  16382. t.dbopomofo = 0x3109;
  16383. t.dbsquare = 0x33c8;
  16384. t.dcaron = 0x010f;
  16385. t.dcedilla = 0x1e11;
  16386. t.dcircle = 0x24d3;
  16387. t.dcircumflexbelow = 0x1e13;
  16388. t.dcroat = 0x0111;
  16389. t.ddabengali = 0x09a1;
  16390. t.ddadeva = 0x0921;
  16391. t.ddagujarati = 0x0aa1;
  16392. t.ddagurmukhi = 0x0a21;
  16393. t.ddalarabic = 0x0688;
  16394. t.ddalfinalarabic = 0xfb89;
  16395. t.dddhadeva = 0x095c;
  16396. t.ddhabengali = 0x09a2;
  16397. t.ddhadeva = 0x0922;
  16398. t.ddhagujarati = 0x0aa2;
  16399. t.ddhagurmukhi = 0x0a22;
  16400. t.ddotaccent = 0x1e0b;
  16401. t.ddotbelow = 0x1e0d;
  16402. t.decimalseparatorarabic = 0x066b;
  16403. t.decimalseparatorpersian = 0x066b;
  16404. t.decyrillic = 0x0434;
  16405. t.degree = 0x00b0;
  16406. t.dehihebrew = 0x05ad;
  16407. t.dehiragana = 0x3067;
  16408. t.deicoptic = 0x03ef;
  16409. t.dekatakana = 0x30c7;
  16410. t.deleteleft = 0x232b;
  16411. t.deleteright = 0x2326;
  16412. t.delta = 0x03b4;
  16413. t.deltaturned = 0x018d;
  16414. t.denominatorminusonenumeratorbengali = 0x09f8;
  16415. t.dezh = 0x02a4;
  16416. t.dhabengali = 0x09a7;
  16417. t.dhadeva = 0x0927;
  16418. t.dhagujarati = 0x0aa7;
  16419. t.dhagurmukhi = 0x0a27;
  16420. t.dhook = 0x0257;
  16421. t.dialytikatonos = 0x0385;
  16422. t.dialytikatonoscmb = 0x0344;
  16423. t.diamond = 0x2666;
  16424. t.diamondsuitwhite = 0x2662;
  16425. t.dieresis = 0x00a8;
  16426. t.dieresisacute = 0xf6d7;
  16427. t.dieresisbelowcmb = 0x0324;
  16428. t.dieresiscmb = 0x0308;
  16429. t.dieresisgrave = 0xf6d8;
  16430. t.dieresistonos = 0x0385;
  16431. t.dihiragana = 0x3062;
  16432. t.dikatakana = 0x30c2;
  16433. t.dittomark = 0x3003;
  16434. t.divide = 0x00f7;
  16435. t.divides = 0x2223;
  16436. t.divisionslash = 0x2215;
  16437. t.djecyrillic = 0x0452;
  16438. t.dkshade = 0x2593;
  16439. t.dlinebelow = 0x1e0f;
  16440. t.dlsquare = 0x3397;
  16441. t.dmacron = 0x0111;
  16442. t.dmonospace = 0xff44;
  16443. t.dnblock = 0x2584;
  16444. t.dochadathai = 0x0e0e;
  16445. t.dodekthai = 0x0e14;
  16446. t.dohiragana = 0x3069;
  16447. t.dokatakana = 0x30c9;
  16448. t.dollar = 0x0024;
  16449. t.dollarinferior = 0xf6e3;
  16450. t.dollarmonospace = 0xff04;
  16451. t.dollaroldstyle = 0xf724;
  16452. t.dollarsmall = 0xfe69;
  16453. t.dollarsuperior = 0xf6e4;
  16454. t.dong = 0x20ab;
  16455. t.dorusquare = 0x3326;
  16456. t.dotaccent = 0x02d9;
  16457. t.dotaccentcmb = 0x0307;
  16458. t.dotbelowcmb = 0x0323;
  16459. t.dotbelowcomb = 0x0323;
  16460. t.dotkatakana = 0x30fb;
  16461. t.dotlessi = 0x0131;
  16462. t.dotlessj = 0xf6be;
  16463. t.dotlessjstrokehook = 0x0284;
  16464. t.dotmath = 0x22c5;
  16465. t.dottedcircle = 0x25cc;
  16466. t.doubleyodpatah = 0xfb1f;
  16467. t.doubleyodpatahhebrew = 0xfb1f;
  16468. t.downtackbelowcmb = 0x031e;
  16469. t.downtackmod = 0x02d5;
  16470. t.dparen = 0x249f;
  16471. t.dsuperior = 0xf6eb;
  16472. t.dtail = 0x0256;
  16473. t.dtopbar = 0x018c;
  16474. t.duhiragana = 0x3065;
  16475. t.dukatakana = 0x30c5;
  16476. t.dz = 0x01f3;
  16477. t.dzaltone = 0x02a3;
  16478. t.dzcaron = 0x01c6;
  16479. t.dzcurl = 0x02a5;
  16480. t.dzeabkhasiancyrillic = 0x04e1;
  16481. t.dzecyrillic = 0x0455;
  16482. t.dzhecyrillic = 0x045f;
  16483. t.e = 0x0065;
  16484. t.eacute = 0x00e9;
  16485. t.earth = 0x2641;
  16486. t.ebengali = 0x098f;
  16487. t.ebopomofo = 0x311c;
  16488. t.ebreve = 0x0115;
  16489. t.ecandradeva = 0x090d;
  16490. t.ecandragujarati = 0x0a8d;
  16491. t.ecandravowelsigndeva = 0x0945;
  16492. t.ecandravowelsigngujarati = 0x0ac5;
  16493. t.ecaron = 0x011b;
  16494. t.ecedillabreve = 0x1e1d;
  16495. t.echarmenian = 0x0565;
  16496. t.echyiwnarmenian = 0x0587;
  16497. t.ecircle = 0x24d4;
  16498. t.ecircumflex = 0x00ea;
  16499. t.ecircumflexacute = 0x1ebf;
  16500. t.ecircumflexbelow = 0x1e19;
  16501. t.ecircumflexdotbelow = 0x1ec7;
  16502. t.ecircumflexgrave = 0x1ec1;
  16503. t.ecircumflexhookabove = 0x1ec3;
  16504. t.ecircumflextilde = 0x1ec5;
  16505. t.ecyrillic = 0x0454;
  16506. t.edblgrave = 0x0205;
  16507. t.edeva = 0x090f;
  16508. t.edieresis = 0x00eb;
  16509. t.edot = 0x0117;
  16510. t.edotaccent = 0x0117;
  16511. t.edotbelow = 0x1eb9;
  16512. t.eegurmukhi = 0x0a0f;
  16513. t.eematragurmukhi = 0x0a47;
  16514. t.efcyrillic = 0x0444;
  16515. t.egrave = 0x00e8;
  16516. t.egujarati = 0x0a8f;
  16517. t.eharmenian = 0x0567;
  16518. t.ehbopomofo = 0x311d;
  16519. t.ehiragana = 0x3048;
  16520. t.ehookabove = 0x1ebb;
  16521. t.eibopomofo = 0x311f;
  16522. t.eight = 0x0038;
  16523. t.eightarabic = 0x0668;
  16524. t.eightbengali = 0x09ee;
  16525. t.eightcircle = 0x2467;
  16526. t.eightcircleinversesansserif = 0x2791;
  16527. t.eightdeva = 0x096e;
  16528. t.eighteencircle = 0x2471;
  16529. t.eighteenparen = 0x2485;
  16530. t.eighteenperiod = 0x2499;
  16531. t.eightgujarati = 0x0aee;
  16532. t.eightgurmukhi = 0x0a6e;
  16533. t.eighthackarabic = 0x0668;
  16534. t.eighthangzhou = 0x3028;
  16535. t.eighthnotebeamed = 0x266b;
  16536. t.eightideographicparen = 0x3227;
  16537. t.eightinferior = 0x2088;
  16538. t.eightmonospace = 0xff18;
  16539. t.eightoldstyle = 0xf738;
  16540. t.eightparen = 0x247b;
  16541. t.eightperiod = 0x248f;
  16542. t.eightpersian = 0x06f8;
  16543. t.eightroman = 0x2177;
  16544. t.eightsuperior = 0x2078;
  16545. t.eightthai = 0x0e58;
  16546. t.einvertedbreve = 0x0207;
  16547. t.eiotifiedcyrillic = 0x0465;
  16548. t.ekatakana = 0x30a8;
  16549. t.ekatakanahalfwidth = 0xff74;
  16550. t.ekonkargurmukhi = 0x0a74;
  16551. t.ekorean = 0x3154;
  16552. t.elcyrillic = 0x043b;
  16553. t.element = 0x2208;
  16554. t.elevencircle = 0x246a;
  16555. t.elevenparen = 0x247e;
  16556. t.elevenperiod = 0x2492;
  16557. t.elevenroman = 0x217a;
  16558. t.ellipsis = 0x2026;
  16559. t.ellipsisvertical = 0x22ee;
  16560. t.emacron = 0x0113;
  16561. t.emacronacute = 0x1e17;
  16562. t.emacrongrave = 0x1e15;
  16563. t.emcyrillic = 0x043c;
  16564. t.emdash = 0x2014;
  16565. t.emdashvertical = 0xfe31;
  16566. t.emonospace = 0xff45;
  16567. t.emphasismarkarmenian = 0x055b;
  16568. t.emptyset = 0x2205;
  16569. t.enbopomofo = 0x3123;
  16570. t.encyrillic = 0x043d;
  16571. t.endash = 0x2013;
  16572. t.endashvertical = 0xfe32;
  16573. t.endescendercyrillic = 0x04a3;
  16574. t.eng = 0x014b;
  16575. t.engbopomofo = 0x3125;
  16576. t.enghecyrillic = 0x04a5;
  16577. t.enhookcyrillic = 0x04c8;
  16578. t.enspace = 0x2002;
  16579. t.eogonek = 0x0119;
  16580. t.eokorean = 0x3153;
  16581. t.eopen = 0x025b;
  16582. t.eopenclosed = 0x029a;
  16583. t.eopenreversed = 0x025c;
  16584. t.eopenreversedclosed = 0x025e;
  16585. t.eopenreversedhook = 0x025d;
  16586. t.eparen = 0x24a0;
  16587. t.epsilon = 0x03b5;
  16588. t.epsilontonos = 0x03ad;
  16589. t.equal = 0x003d;
  16590. t.equalmonospace = 0xff1d;
  16591. t.equalsmall = 0xfe66;
  16592. t.equalsuperior = 0x207c;
  16593. t.equivalence = 0x2261;
  16594. t.erbopomofo = 0x3126;
  16595. t.ercyrillic = 0x0440;
  16596. t.ereversed = 0x0258;
  16597. t.ereversedcyrillic = 0x044d;
  16598. t.escyrillic = 0x0441;
  16599. t.esdescendercyrillic = 0x04ab;
  16600. t.esh = 0x0283;
  16601. t.eshcurl = 0x0286;
  16602. t.eshortdeva = 0x090e;
  16603. t.eshortvowelsigndeva = 0x0946;
  16604. t.eshreversedloop = 0x01aa;
  16605. t.eshsquatreversed = 0x0285;
  16606. t.esmallhiragana = 0x3047;
  16607. t.esmallkatakana = 0x30a7;
  16608. t.esmallkatakanahalfwidth = 0xff6a;
  16609. t.estimated = 0x212e;
  16610. t.esuperior = 0xf6ec;
  16611. t.eta = 0x03b7;
  16612. t.etarmenian = 0x0568;
  16613. t.etatonos = 0x03ae;
  16614. t.eth = 0x00f0;
  16615. t.etilde = 0x1ebd;
  16616. t.etildebelow = 0x1e1b;
  16617. t.etnahtafoukhhebrew = 0x0591;
  16618. t.etnahtafoukhlefthebrew = 0x0591;
  16619. t.etnahtahebrew = 0x0591;
  16620. t.etnahtalefthebrew = 0x0591;
  16621. t.eturned = 0x01dd;
  16622. t.eukorean = 0x3161;
  16623. t.euro = 0x20ac;
  16624. t.evowelsignbengali = 0x09c7;
  16625. t.evowelsigndeva = 0x0947;
  16626. t.evowelsigngujarati = 0x0ac7;
  16627. t.exclam = 0x0021;
  16628. t.exclamarmenian = 0x055c;
  16629. t.exclamdbl = 0x203c;
  16630. t.exclamdown = 0x00a1;
  16631. t.exclamdownsmall = 0xf7a1;
  16632. t.exclammonospace = 0xff01;
  16633. t.exclamsmall = 0xf721;
  16634. t.existential = 0x2203;
  16635. t.ezh = 0x0292;
  16636. t.ezhcaron = 0x01ef;
  16637. t.ezhcurl = 0x0293;
  16638. t.ezhreversed = 0x01b9;
  16639. t.ezhtail = 0x01ba;
  16640. t.f = 0x0066;
  16641. t.fadeva = 0x095e;
  16642. t.fagurmukhi = 0x0a5e;
  16643. t.fahrenheit = 0x2109;
  16644. t.fathaarabic = 0x064e;
  16645. t.fathalowarabic = 0x064e;
  16646. t.fathatanarabic = 0x064b;
  16647. t.fbopomofo = 0x3108;
  16648. t.fcircle = 0x24d5;
  16649. t.fdotaccent = 0x1e1f;
  16650. t.feharabic = 0x0641;
  16651. t.feharmenian = 0x0586;
  16652. t.fehfinalarabic = 0xfed2;
  16653. t.fehinitialarabic = 0xfed3;
  16654. t.fehmedialarabic = 0xfed4;
  16655. t.feicoptic = 0x03e5;
  16656. t.female = 0x2640;
  16657. t.ff = 0xfb00;
  16658. t.f_f = 0xfb00;
  16659. t.ffi = 0xfb03;
  16660. t.f_f_i = 0xfb03;
  16661. t.ffl = 0xfb04;
  16662. t.f_f_l = 0xfb04;
  16663. t.fi = 0xfb01;
  16664. t.f_i = 0xfb01;
  16665. t.fifteencircle = 0x246e;
  16666. t.fifteenparen = 0x2482;
  16667. t.fifteenperiod = 0x2496;
  16668. t.figuredash = 0x2012;
  16669. t.filledbox = 0x25a0;
  16670. t.filledrect = 0x25ac;
  16671. t.finalkaf = 0x05da;
  16672. t.finalkafdagesh = 0xfb3a;
  16673. t.finalkafdageshhebrew = 0xfb3a;
  16674. t.finalkafhebrew = 0x05da;
  16675. t.finalmem = 0x05dd;
  16676. t.finalmemhebrew = 0x05dd;
  16677. t.finalnun = 0x05df;
  16678. t.finalnunhebrew = 0x05df;
  16679. t.finalpe = 0x05e3;
  16680. t.finalpehebrew = 0x05e3;
  16681. t.finaltsadi = 0x05e5;
  16682. t.finaltsadihebrew = 0x05e5;
  16683. t.firsttonechinese = 0x02c9;
  16684. t.fisheye = 0x25c9;
  16685. t.fitacyrillic = 0x0473;
  16686. t.five = 0x0035;
  16687. t.fivearabic = 0x0665;
  16688. t.fivebengali = 0x09eb;
  16689. t.fivecircle = 0x2464;
  16690. t.fivecircleinversesansserif = 0x278e;
  16691. t.fivedeva = 0x096b;
  16692. t.fiveeighths = 0x215d;
  16693. t.fivegujarati = 0x0aeb;
  16694. t.fivegurmukhi = 0x0a6b;
  16695. t.fivehackarabic = 0x0665;
  16696. t.fivehangzhou = 0x3025;
  16697. t.fiveideographicparen = 0x3224;
  16698. t.fiveinferior = 0x2085;
  16699. t.fivemonospace = 0xff15;
  16700. t.fiveoldstyle = 0xf735;
  16701. t.fiveparen = 0x2478;
  16702. t.fiveperiod = 0x248c;
  16703. t.fivepersian = 0x06f5;
  16704. t.fiveroman = 0x2174;
  16705. t.fivesuperior = 0x2075;
  16706. t.fivethai = 0x0e55;
  16707. t.fl = 0xfb02;
  16708. t.f_l = 0xfb02;
  16709. t.florin = 0x0192;
  16710. t.fmonospace = 0xff46;
  16711. t.fmsquare = 0x3399;
  16712. t.fofanthai = 0x0e1f;
  16713. t.fofathai = 0x0e1d;
  16714. t.fongmanthai = 0x0e4f;
  16715. t.forall = 0x2200;
  16716. t.four = 0x0034;
  16717. t.fourarabic = 0x0664;
  16718. t.fourbengali = 0x09ea;
  16719. t.fourcircle = 0x2463;
  16720. t.fourcircleinversesansserif = 0x278d;
  16721. t.fourdeva = 0x096a;
  16722. t.fourgujarati = 0x0aea;
  16723. t.fourgurmukhi = 0x0a6a;
  16724. t.fourhackarabic = 0x0664;
  16725. t.fourhangzhou = 0x3024;
  16726. t.fourideographicparen = 0x3223;
  16727. t.fourinferior = 0x2084;
  16728. t.fourmonospace = 0xff14;
  16729. t.fournumeratorbengali = 0x09f7;
  16730. t.fouroldstyle = 0xf734;
  16731. t.fourparen = 0x2477;
  16732. t.fourperiod = 0x248b;
  16733. t.fourpersian = 0x06f4;
  16734. t.fourroman = 0x2173;
  16735. t.foursuperior = 0x2074;
  16736. t.fourteencircle = 0x246d;
  16737. t.fourteenparen = 0x2481;
  16738. t.fourteenperiod = 0x2495;
  16739. t.fourthai = 0x0e54;
  16740. t.fourthtonechinese = 0x02cb;
  16741. t.fparen = 0x24a1;
  16742. t.fraction = 0x2044;
  16743. t.franc = 0x20a3;
  16744. t.g = 0x0067;
  16745. t.gabengali = 0x0997;
  16746. t.gacute = 0x01f5;
  16747. t.gadeva = 0x0917;
  16748. t.gafarabic = 0x06af;
  16749. t.gaffinalarabic = 0xfb93;
  16750. t.gafinitialarabic = 0xfb94;
  16751. t.gafmedialarabic = 0xfb95;
  16752. t.gagujarati = 0x0a97;
  16753. t.gagurmukhi = 0x0a17;
  16754. t.gahiragana = 0x304c;
  16755. t.gakatakana = 0x30ac;
  16756. t.gamma = 0x03b3;
  16757. t.gammalatinsmall = 0x0263;
  16758. t.gammasuperior = 0x02e0;
  16759. t.gangiacoptic = 0x03eb;
  16760. t.gbopomofo = 0x310d;
  16761. t.gbreve = 0x011f;
  16762. t.gcaron = 0x01e7;
  16763. t.gcedilla = 0x0123;
  16764. t.gcircle = 0x24d6;
  16765. t.gcircumflex = 0x011d;
  16766. t.gcommaaccent = 0x0123;
  16767. t.gdot = 0x0121;
  16768. t.gdotaccent = 0x0121;
  16769. t.gecyrillic = 0x0433;
  16770. t.gehiragana = 0x3052;
  16771. t.gekatakana = 0x30b2;
  16772. t.geometricallyequal = 0x2251;
  16773. t.gereshaccenthebrew = 0x059c;
  16774. t.gereshhebrew = 0x05f3;
  16775. t.gereshmuqdamhebrew = 0x059d;
  16776. t.germandbls = 0x00df;
  16777. t.gershayimaccenthebrew = 0x059e;
  16778. t.gershayimhebrew = 0x05f4;
  16779. t.getamark = 0x3013;
  16780. t.ghabengali = 0x0998;
  16781. t.ghadarmenian = 0x0572;
  16782. t.ghadeva = 0x0918;
  16783. t.ghagujarati = 0x0a98;
  16784. t.ghagurmukhi = 0x0a18;
  16785. t.ghainarabic = 0x063a;
  16786. t.ghainfinalarabic = 0xfece;
  16787. t.ghaininitialarabic = 0xfecf;
  16788. t.ghainmedialarabic = 0xfed0;
  16789. t.ghemiddlehookcyrillic = 0x0495;
  16790. t.ghestrokecyrillic = 0x0493;
  16791. t.gheupturncyrillic = 0x0491;
  16792. t.ghhadeva = 0x095a;
  16793. t.ghhagurmukhi = 0x0a5a;
  16794. t.ghook = 0x0260;
  16795. t.ghzsquare = 0x3393;
  16796. t.gihiragana = 0x304e;
  16797. t.gikatakana = 0x30ae;
  16798. t.gimarmenian = 0x0563;
  16799. t.gimel = 0x05d2;
  16800. t.gimeldagesh = 0xfb32;
  16801. t.gimeldageshhebrew = 0xfb32;
  16802. t.gimelhebrew = 0x05d2;
  16803. t.gjecyrillic = 0x0453;
  16804. t.glottalinvertedstroke = 0x01be;
  16805. t.glottalstop = 0x0294;
  16806. t.glottalstopinverted = 0x0296;
  16807. t.glottalstopmod = 0x02c0;
  16808. t.glottalstopreversed = 0x0295;
  16809. t.glottalstopreversedmod = 0x02c1;
  16810. t.glottalstopreversedsuperior = 0x02e4;
  16811. t.glottalstopstroke = 0x02a1;
  16812. t.glottalstopstrokereversed = 0x02a2;
  16813. t.gmacron = 0x1e21;
  16814. t.gmonospace = 0xff47;
  16815. t.gohiragana = 0x3054;
  16816. t.gokatakana = 0x30b4;
  16817. t.gparen = 0x24a2;
  16818. t.gpasquare = 0x33ac;
  16819. t.gradient = 0x2207;
  16820. t.grave = 0x0060;
  16821. t.gravebelowcmb = 0x0316;
  16822. t.gravecmb = 0x0300;
  16823. t.gravecomb = 0x0300;
  16824. t.gravedeva = 0x0953;
  16825. t.gravelowmod = 0x02ce;
  16826. t.gravemonospace = 0xff40;
  16827. t.gravetonecmb = 0x0340;
  16828. t.greater = 0x003e;
  16829. t.greaterequal = 0x2265;
  16830. t.greaterequalorless = 0x22db;
  16831. t.greatermonospace = 0xff1e;
  16832. t.greaterorequivalent = 0x2273;
  16833. t.greaterorless = 0x2277;
  16834. t.greateroverequal = 0x2267;
  16835. t.greatersmall = 0xfe65;
  16836. t.gscript = 0x0261;
  16837. t.gstroke = 0x01e5;
  16838. t.guhiragana = 0x3050;
  16839. t.guillemotleft = 0x00ab;
  16840. t.guillemotright = 0x00bb;
  16841. t.guilsinglleft = 0x2039;
  16842. t.guilsinglright = 0x203a;
  16843. t.gukatakana = 0x30b0;
  16844. t.guramusquare = 0x3318;
  16845. t.gysquare = 0x33c9;
  16846. t.h = 0x0068;
  16847. t.haabkhasiancyrillic = 0x04a9;
  16848. t.haaltonearabic = 0x06c1;
  16849. t.habengali = 0x09b9;
  16850. t.hadescendercyrillic = 0x04b3;
  16851. t.hadeva = 0x0939;
  16852. t.hagujarati = 0x0ab9;
  16853. t.hagurmukhi = 0x0a39;
  16854. t.haharabic = 0x062d;
  16855. t.hahfinalarabic = 0xfea2;
  16856. t.hahinitialarabic = 0xfea3;
  16857. t.hahiragana = 0x306f;
  16858. t.hahmedialarabic = 0xfea4;
  16859. t.haitusquare = 0x332a;
  16860. t.hakatakana = 0x30cf;
  16861. t.hakatakanahalfwidth = 0xff8a;
  16862. t.halantgurmukhi = 0x0a4d;
  16863. t.hamzaarabic = 0x0621;
  16864. t.hamzalowarabic = 0x0621;
  16865. t.hangulfiller = 0x3164;
  16866. t.hardsigncyrillic = 0x044a;
  16867. t.harpoonleftbarbup = 0x21bc;
  16868. t.harpoonrightbarbup = 0x21c0;
  16869. t.hasquare = 0x33ca;
  16870. t.hatafpatah = 0x05b2;
  16871. t.hatafpatah16 = 0x05b2;
  16872. t.hatafpatah23 = 0x05b2;
  16873. t.hatafpatah2f = 0x05b2;
  16874. t.hatafpatahhebrew = 0x05b2;
  16875. t.hatafpatahnarrowhebrew = 0x05b2;
  16876. t.hatafpatahquarterhebrew = 0x05b2;
  16877. t.hatafpatahwidehebrew = 0x05b2;
  16878. t.hatafqamats = 0x05b3;
  16879. t.hatafqamats1b = 0x05b3;
  16880. t.hatafqamats28 = 0x05b3;
  16881. t.hatafqamats34 = 0x05b3;
  16882. t.hatafqamatshebrew = 0x05b3;
  16883. t.hatafqamatsnarrowhebrew = 0x05b3;
  16884. t.hatafqamatsquarterhebrew = 0x05b3;
  16885. t.hatafqamatswidehebrew = 0x05b3;
  16886. t.hatafsegol = 0x05b1;
  16887. t.hatafsegol17 = 0x05b1;
  16888. t.hatafsegol24 = 0x05b1;
  16889. t.hatafsegol30 = 0x05b1;
  16890. t.hatafsegolhebrew = 0x05b1;
  16891. t.hatafsegolnarrowhebrew = 0x05b1;
  16892. t.hatafsegolquarterhebrew = 0x05b1;
  16893. t.hatafsegolwidehebrew = 0x05b1;
  16894. t.hbar = 0x0127;
  16895. t.hbopomofo = 0x310f;
  16896. t.hbrevebelow = 0x1e2b;
  16897. t.hcedilla = 0x1e29;
  16898. t.hcircle = 0x24d7;
  16899. t.hcircumflex = 0x0125;
  16900. t.hdieresis = 0x1e27;
  16901. t.hdotaccent = 0x1e23;
  16902. t.hdotbelow = 0x1e25;
  16903. t.he = 0x05d4;
  16904. t.heart = 0x2665;
  16905. t.heartsuitblack = 0x2665;
  16906. t.heartsuitwhite = 0x2661;
  16907. t.hedagesh = 0xfb34;
  16908. t.hedageshhebrew = 0xfb34;
  16909. t.hehaltonearabic = 0x06c1;
  16910. t.heharabic = 0x0647;
  16911. t.hehebrew = 0x05d4;
  16912. t.hehfinalaltonearabic = 0xfba7;
  16913. t.hehfinalalttwoarabic = 0xfeea;
  16914. t.hehfinalarabic = 0xfeea;
  16915. t.hehhamzaabovefinalarabic = 0xfba5;
  16916. t.hehhamzaaboveisolatedarabic = 0xfba4;
  16917. t.hehinitialaltonearabic = 0xfba8;
  16918. t.hehinitialarabic = 0xfeeb;
  16919. t.hehiragana = 0x3078;
  16920. t.hehmedialaltonearabic = 0xfba9;
  16921. t.hehmedialarabic = 0xfeec;
  16922. t.heiseierasquare = 0x337b;
  16923. t.hekatakana = 0x30d8;
  16924. t.hekatakanahalfwidth = 0xff8d;
  16925. t.hekutaarusquare = 0x3336;
  16926. t.henghook = 0x0267;
  16927. t.herutusquare = 0x3339;
  16928. t.het = 0x05d7;
  16929. t.hethebrew = 0x05d7;
  16930. t.hhook = 0x0266;
  16931. t.hhooksuperior = 0x02b1;
  16932. t.hieuhacirclekorean = 0x327b;
  16933. t.hieuhaparenkorean = 0x321b;
  16934. t.hieuhcirclekorean = 0x326d;
  16935. t.hieuhkorean = 0x314e;
  16936. t.hieuhparenkorean = 0x320d;
  16937. t.hihiragana = 0x3072;
  16938. t.hikatakana = 0x30d2;
  16939. t.hikatakanahalfwidth = 0xff8b;
  16940. t.hiriq = 0x05b4;
  16941. t.hiriq14 = 0x05b4;
  16942. t.hiriq21 = 0x05b4;
  16943. t.hiriq2d = 0x05b4;
  16944. t.hiriqhebrew = 0x05b4;
  16945. t.hiriqnarrowhebrew = 0x05b4;
  16946. t.hiriqquarterhebrew = 0x05b4;
  16947. t.hiriqwidehebrew = 0x05b4;
  16948. t.hlinebelow = 0x1e96;
  16949. t.hmonospace = 0xff48;
  16950. t.hoarmenian = 0x0570;
  16951. t.hohipthai = 0x0e2b;
  16952. t.hohiragana = 0x307b;
  16953. t.hokatakana = 0x30db;
  16954. t.hokatakanahalfwidth = 0xff8e;
  16955. t.holam = 0x05b9;
  16956. t.holam19 = 0x05b9;
  16957. t.holam26 = 0x05b9;
  16958. t.holam32 = 0x05b9;
  16959. t.holamhebrew = 0x05b9;
  16960. t.holamnarrowhebrew = 0x05b9;
  16961. t.holamquarterhebrew = 0x05b9;
  16962. t.holamwidehebrew = 0x05b9;
  16963. t.honokhukthai = 0x0e2e;
  16964. t.hookabovecomb = 0x0309;
  16965. t.hookcmb = 0x0309;
  16966. t.hookpalatalizedbelowcmb = 0x0321;
  16967. t.hookretroflexbelowcmb = 0x0322;
  16968. t.hoonsquare = 0x3342;
  16969. t.horicoptic = 0x03e9;
  16970. t.horizontalbar = 0x2015;
  16971. t.horncmb = 0x031b;
  16972. t.hotsprings = 0x2668;
  16973. t.house = 0x2302;
  16974. t.hparen = 0x24a3;
  16975. t.hsuperior = 0x02b0;
  16976. t.hturned = 0x0265;
  16977. t.huhiragana = 0x3075;
  16978. t.huiitosquare = 0x3333;
  16979. t.hukatakana = 0x30d5;
  16980. t.hukatakanahalfwidth = 0xff8c;
  16981. t.hungarumlaut = 0x02dd;
  16982. t.hungarumlautcmb = 0x030b;
  16983. t.hv = 0x0195;
  16984. t.hyphen = 0x002d;
  16985. t.hypheninferior = 0xf6e5;
  16986. t.hyphenmonospace = 0xff0d;
  16987. t.hyphensmall = 0xfe63;
  16988. t.hyphensuperior = 0xf6e6;
  16989. t.hyphentwo = 0x2010;
  16990. t.i = 0x0069;
  16991. t.iacute = 0x00ed;
  16992. t.iacyrillic = 0x044f;
  16993. t.ibengali = 0x0987;
  16994. t.ibopomofo = 0x3127;
  16995. t.ibreve = 0x012d;
  16996. t.icaron = 0x01d0;
  16997. t.icircle = 0x24d8;
  16998. t.icircumflex = 0x00ee;
  16999. t.icyrillic = 0x0456;
  17000. t.idblgrave = 0x0209;
  17001. t.ideographearthcircle = 0x328f;
  17002. t.ideographfirecircle = 0x328b;
  17003. t.ideographicallianceparen = 0x323f;
  17004. t.ideographiccallparen = 0x323a;
  17005. t.ideographiccentrecircle = 0x32a5;
  17006. t.ideographicclose = 0x3006;
  17007. t.ideographiccomma = 0x3001;
  17008. t.ideographiccommaleft = 0xff64;
  17009. t.ideographiccongratulationparen = 0x3237;
  17010. t.ideographiccorrectcircle = 0x32a3;
  17011. t.ideographicearthparen = 0x322f;
  17012. t.ideographicenterpriseparen = 0x323d;
  17013. t.ideographicexcellentcircle = 0x329d;
  17014. t.ideographicfestivalparen = 0x3240;
  17015. t.ideographicfinancialcircle = 0x3296;
  17016. t.ideographicfinancialparen = 0x3236;
  17017. t.ideographicfireparen = 0x322b;
  17018. t.ideographichaveparen = 0x3232;
  17019. t.ideographichighcircle = 0x32a4;
  17020. t.ideographiciterationmark = 0x3005;
  17021. t.ideographiclaborcircle = 0x3298;
  17022. t.ideographiclaborparen = 0x3238;
  17023. t.ideographicleftcircle = 0x32a7;
  17024. t.ideographiclowcircle = 0x32a6;
  17025. t.ideographicmedicinecircle = 0x32a9;
  17026. t.ideographicmetalparen = 0x322e;
  17027. t.ideographicmoonparen = 0x322a;
  17028. t.ideographicnameparen = 0x3234;
  17029. t.ideographicperiod = 0x3002;
  17030. t.ideographicprintcircle = 0x329e;
  17031. t.ideographicreachparen = 0x3243;
  17032. t.ideographicrepresentparen = 0x3239;
  17033. t.ideographicresourceparen = 0x323e;
  17034. t.ideographicrightcircle = 0x32a8;
  17035. t.ideographicsecretcircle = 0x3299;
  17036. t.ideographicselfparen = 0x3242;
  17037. t.ideographicsocietyparen = 0x3233;
  17038. t.ideographicspace = 0x3000;
  17039. t.ideographicspecialparen = 0x3235;
  17040. t.ideographicstockparen = 0x3231;
  17041. t.ideographicstudyparen = 0x323b;
  17042. t.ideographicsunparen = 0x3230;
  17043. t.ideographicsuperviseparen = 0x323c;
  17044. t.ideographicwaterparen = 0x322c;
  17045. t.ideographicwoodparen = 0x322d;
  17046. t.ideographiczero = 0x3007;
  17047. t.ideographmetalcircle = 0x328e;
  17048. t.ideographmooncircle = 0x328a;
  17049. t.ideographnamecircle = 0x3294;
  17050. t.ideographsuncircle = 0x3290;
  17051. t.ideographwatercircle = 0x328c;
  17052. t.ideographwoodcircle = 0x328d;
  17053. t.ideva = 0x0907;
  17054. t.idieresis = 0x00ef;
  17055. t.idieresisacute = 0x1e2f;
  17056. t.idieresiscyrillic = 0x04e5;
  17057. t.idotbelow = 0x1ecb;
  17058. t.iebrevecyrillic = 0x04d7;
  17059. t.iecyrillic = 0x0435;
  17060. t.ieungacirclekorean = 0x3275;
  17061. t.ieungaparenkorean = 0x3215;
  17062. t.ieungcirclekorean = 0x3267;
  17063. t.ieungkorean = 0x3147;
  17064. t.ieungparenkorean = 0x3207;
  17065. t.igrave = 0x00ec;
  17066. t.igujarati = 0x0a87;
  17067. t.igurmukhi = 0x0a07;
  17068. t.ihiragana = 0x3044;
  17069. t.ihookabove = 0x1ec9;
  17070. t.iibengali = 0x0988;
  17071. t.iicyrillic = 0x0438;
  17072. t.iideva = 0x0908;
  17073. t.iigujarati = 0x0a88;
  17074. t.iigurmukhi = 0x0a08;
  17075. t.iimatragurmukhi = 0x0a40;
  17076. t.iinvertedbreve = 0x020b;
  17077. t.iishortcyrillic = 0x0439;
  17078. t.iivowelsignbengali = 0x09c0;
  17079. t.iivowelsigndeva = 0x0940;
  17080. t.iivowelsigngujarati = 0x0ac0;
  17081. t.ij = 0x0133;
  17082. t.ikatakana = 0x30a4;
  17083. t.ikatakanahalfwidth = 0xff72;
  17084. t.ikorean = 0x3163;
  17085. t.ilde = 0x02dc;
  17086. t.iluyhebrew = 0x05ac;
  17087. t.imacron = 0x012b;
  17088. t.imacroncyrillic = 0x04e3;
  17089. t.imageorapproximatelyequal = 0x2253;
  17090. t.imatragurmukhi = 0x0a3f;
  17091. t.imonospace = 0xff49;
  17092. t.increment = 0x2206;
  17093. t.infinity = 0x221e;
  17094. t.iniarmenian = 0x056b;
  17095. t.integral = 0x222b;
  17096. t.integralbottom = 0x2321;
  17097. t.integralbt = 0x2321;
  17098. t.integralex = 0xf8f5;
  17099. t.integraltop = 0x2320;
  17100. t.integraltp = 0x2320;
  17101. t.intersection = 0x2229;
  17102. t.intisquare = 0x3305;
  17103. t.invbullet = 0x25d8;
  17104. t.invcircle = 0x25d9;
  17105. t.invsmileface = 0x263b;
  17106. t.iocyrillic = 0x0451;
  17107. t.iogonek = 0x012f;
  17108. t.iota = 0x03b9;
  17109. t.iotadieresis = 0x03ca;
  17110. t.iotadieresistonos = 0x0390;
  17111. t.iotalatin = 0x0269;
  17112. t.iotatonos = 0x03af;
  17113. t.iparen = 0x24a4;
  17114. t.irigurmukhi = 0x0a72;
  17115. t.ismallhiragana = 0x3043;
  17116. t.ismallkatakana = 0x30a3;
  17117. t.ismallkatakanahalfwidth = 0xff68;
  17118. t.issharbengali = 0x09fa;
  17119. t.istroke = 0x0268;
  17120. t.isuperior = 0xf6ed;
  17121. t.iterationhiragana = 0x309d;
  17122. t.iterationkatakana = 0x30fd;
  17123. t.itilde = 0x0129;
  17124. t.itildebelow = 0x1e2d;
  17125. t.iubopomofo = 0x3129;
  17126. t.iucyrillic = 0x044e;
  17127. t.ivowelsignbengali = 0x09bf;
  17128. t.ivowelsigndeva = 0x093f;
  17129. t.ivowelsigngujarati = 0x0abf;
  17130. t.izhitsacyrillic = 0x0475;
  17131. t.izhitsadblgravecyrillic = 0x0477;
  17132. t.j = 0x006a;
  17133. t.jaarmenian = 0x0571;
  17134. t.jabengali = 0x099c;
  17135. t.jadeva = 0x091c;
  17136. t.jagujarati = 0x0a9c;
  17137. t.jagurmukhi = 0x0a1c;
  17138. t.jbopomofo = 0x3110;
  17139. t.jcaron = 0x01f0;
  17140. t.jcircle = 0x24d9;
  17141. t.jcircumflex = 0x0135;
  17142. t.jcrossedtail = 0x029d;
  17143. t.jdotlessstroke = 0x025f;
  17144. t.jecyrillic = 0x0458;
  17145. t.jeemarabic = 0x062c;
  17146. t.jeemfinalarabic = 0xfe9e;
  17147. t.jeeminitialarabic = 0xfe9f;
  17148. t.jeemmedialarabic = 0xfea0;
  17149. t.jeharabic = 0x0698;
  17150. t.jehfinalarabic = 0xfb8b;
  17151. t.jhabengali = 0x099d;
  17152. t.jhadeva = 0x091d;
  17153. t.jhagujarati = 0x0a9d;
  17154. t.jhagurmukhi = 0x0a1d;
  17155. t.jheharmenian = 0x057b;
  17156. t.jis = 0x3004;
  17157. t.jmonospace = 0xff4a;
  17158. t.jparen = 0x24a5;
  17159. t.jsuperior = 0x02b2;
  17160. t.k = 0x006b;
  17161. t.kabashkircyrillic = 0x04a1;
  17162. t.kabengali = 0x0995;
  17163. t.kacute = 0x1e31;
  17164. t.kacyrillic = 0x043a;
  17165. t.kadescendercyrillic = 0x049b;
  17166. t.kadeva = 0x0915;
  17167. t.kaf = 0x05db;
  17168. t.kafarabic = 0x0643;
  17169. t.kafdagesh = 0xfb3b;
  17170. t.kafdageshhebrew = 0xfb3b;
  17171. t.kaffinalarabic = 0xfeda;
  17172. t.kafhebrew = 0x05db;
  17173. t.kafinitialarabic = 0xfedb;
  17174. t.kafmedialarabic = 0xfedc;
  17175. t.kafrafehebrew = 0xfb4d;
  17176. t.kagujarati = 0x0a95;
  17177. t.kagurmukhi = 0x0a15;
  17178. t.kahiragana = 0x304b;
  17179. t.kahookcyrillic = 0x04c4;
  17180. t.kakatakana = 0x30ab;
  17181. t.kakatakanahalfwidth = 0xff76;
  17182. t.kappa = 0x03ba;
  17183. t.kappasymbolgreek = 0x03f0;
  17184. t.kapyeounmieumkorean = 0x3171;
  17185. t.kapyeounphieuphkorean = 0x3184;
  17186. t.kapyeounpieupkorean = 0x3178;
  17187. t.kapyeounssangpieupkorean = 0x3179;
  17188. t.karoriisquare = 0x330d;
  17189. t.kashidaautoarabic = 0x0640;
  17190. t.kashidaautonosidebearingarabic = 0x0640;
  17191. t.kasmallkatakana = 0x30f5;
  17192. t.kasquare = 0x3384;
  17193. t.kasraarabic = 0x0650;
  17194. t.kasratanarabic = 0x064d;
  17195. t.kastrokecyrillic = 0x049f;
  17196. t.katahiraprolongmarkhalfwidth = 0xff70;
  17197. t.kaverticalstrokecyrillic = 0x049d;
  17198. t.kbopomofo = 0x310e;
  17199. t.kcalsquare = 0x3389;
  17200. t.kcaron = 0x01e9;
  17201. t.kcedilla = 0x0137;
  17202. t.kcircle = 0x24da;
  17203. t.kcommaaccent = 0x0137;
  17204. t.kdotbelow = 0x1e33;
  17205. t.keharmenian = 0x0584;
  17206. t.kehiragana = 0x3051;
  17207. t.kekatakana = 0x30b1;
  17208. t.kekatakanahalfwidth = 0xff79;
  17209. t.kenarmenian = 0x056f;
  17210. t.kesmallkatakana = 0x30f6;
  17211. t.kgreenlandic = 0x0138;
  17212. t.khabengali = 0x0996;
  17213. t.khacyrillic = 0x0445;
  17214. t.khadeva = 0x0916;
  17215. t.khagujarati = 0x0a96;
  17216. t.khagurmukhi = 0x0a16;
  17217. t.khaharabic = 0x062e;
  17218. t.khahfinalarabic = 0xfea6;
  17219. t.khahinitialarabic = 0xfea7;
  17220. t.khahmedialarabic = 0xfea8;
  17221. t.kheicoptic = 0x03e7;
  17222. t.khhadeva = 0x0959;
  17223. t.khhagurmukhi = 0x0a59;
  17224. t.khieukhacirclekorean = 0x3278;
  17225. t.khieukhaparenkorean = 0x3218;
  17226. t.khieukhcirclekorean = 0x326a;
  17227. t.khieukhkorean = 0x314b;
  17228. t.khieukhparenkorean = 0x320a;
  17229. t.khokhaithai = 0x0e02;
  17230. t.khokhonthai = 0x0e05;
  17231. t.khokhuatthai = 0x0e03;
  17232. t.khokhwaithai = 0x0e04;
  17233. t.khomutthai = 0x0e5b;
  17234. t.khook = 0x0199;
  17235. t.khorakhangthai = 0x0e06;
  17236. t.khzsquare = 0x3391;
  17237. t.kihiragana = 0x304d;
  17238. t.kikatakana = 0x30ad;
  17239. t.kikatakanahalfwidth = 0xff77;
  17240. t.kiroguramusquare = 0x3315;
  17241. t.kiromeetorusquare = 0x3316;
  17242. t.kirosquare = 0x3314;
  17243. t.kiyeokacirclekorean = 0x326e;
  17244. t.kiyeokaparenkorean = 0x320e;
  17245. t.kiyeokcirclekorean = 0x3260;
  17246. t.kiyeokkorean = 0x3131;
  17247. t.kiyeokparenkorean = 0x3200;
  17248. t.kiyeoksioskorean = 0x3133;
  17249. t.kjecyrillic = 0x045c;
  17250. t.klinebelow = 0x1e35;
  17251. t.klsquare = 0x3398;
  17252. t.kmcubedsquare = 0x33a6;
  17253. t.kmonospace = 0xff4b;
  17254. t.kmsquaredsquare = 0x33a2;
  17255. t.kohiragana = 0x3053;
  17256. t.kohmsquare = 0x33c0;
  17257. t.kokaithai = 0x0e01;
  17258. t.kokatakana = 0x30b3;
  17259. t.kokatakanahalfwidth = 0xff7a;
  17260. t.kooposquare = 0x331e;
  17261. t.koppacyrillic = 0x0481;
  17262. t.koreanstandardsymbol = 0x327f;
  17263. t.koroniscmb = 0x0343;
  17264. t.kparen = 0x24a6;
  17265. t.kpasquare = 0x33aa;
  17266. t.ksicyrillic = 0x046f;
  17267. t.ktsquare = 0x33cf;
  17268. t.kturned = 0x029e;
  17269. t.kuhiragana = 0x304f;
  17270. t.kukatakana = 0x30af;
  17271. t.kukatakanahalfwidth = 0xff78;
  17272. t.kvsquare = 0x33b8;
  17273. t.kwsquare = 0x33be;
  17274. t.l = 0x006c;
  17275. t.labengali = 0x09b2;
  17276. t.lacute = 0x013a;
  17277. t.ladeva = 0x0932;
  17278. t.lagujarati = 0x0ab2;
  17279. t.lagurmukhi = 0x0a32;
  17280. t.lakkhangyaothai = 0x0e45;
  17281. t.lamaleffinalarabic = 0xfefc;
  17282. t.lamalefhamzaabovefinalarabic = 0xfef8;
  17283. t.lamalefhamzaaboveisolatedarabic = 0xfef7;
  17284. t.lamalefhamzabelowfinalarabic = 0xfefa;
  17285. t.lamalefhamzabelowisolatedarabic = 0xfef9;
  17286. t.lamalefisolatedarabic = 0xfefb;
  17287. t.lamalefmaddaabovefinalarabic = 0xfef6;
  17288. t.lamalefmaddaaboveisolatedarabic = 0xfef5;
  17289. t.lamarabic = 0x0644;
  17290. t.lambda = 0x03bb;
  17291. t.lambdastroke = 0x019b;
  17292. t.lamed = 0x05dc;
  17293. t.lameddagesh = 0xfb3c;
  17294. t.lameddageshhebrew = 0xfb3c;
  17295. t.lamedhebrew = 0x05dc;
  17296. t.lamfinalarabic = 0xfede;
  17297. t.lamhahinitialarabic = 0xfcca;
  17298. t.laminitialarabic = 0xfedf;
  17299. t.lamjeeminitialarabic = 0xfcc9;
  17300. t.lamkhahinitialarabic = 0xfccb;
  17301. t.lamlamhehisolatedarabic = 0xfdf2;
  17302. t.lammedialarabic = 0xfee0;
  17303. t.lammeemhahinitialarabic = 0xfd88;
  17304. t.lammeeminitialarabic = 0xfccc;
  17305. t.largecircle = 0x25ef;
  17306. t.lbar = 0x019a;
  17307. t.lbelt = 0x026c;
  17308. t.lbopomofo = 0x310c;
  17309. t.lcaron = 0x013e;
  17310. t.lcedilla = 0x013c;
  17311. t.lcircle = 0x24db;
  17312. t.lcircumflexbelow = 0x1e3d;
  17313. t.lcommaaccent = 0x013c;
  17314. t.ldot = 0x0140;
  17315. t.ldotaccent = 0x0140;
  17316. t.ldotbelow = 0x1e37;
  17317. t.ldotbelowmacron = 0x1e39;
  17318. t.leftangleabovecmb = 0x031a;
  17319. t.lefttackbelowcmb = 0x0318;
  17320. t.less = 0x003c;
  17321. t.lessequal = 0x2264;
  17322. t.lessequalorgreater = 0x22da;
  17323. t.lessmonospace = 0xff1c;
  17324. t.lessorequivalent = 0x2272;
  17325. t.lessorgreater = 0x2276;
  17326. t.lessoverequal = 0x2266;
  17327. t.lesssmall = 0xfe64;
  17328. t.lezh = 0x026e;
  17329. t.lfblock = 0x258c;
  17330. t.lhookretroflex = 0x026d;
  17331. t.lira = 0x20a4;
  17332. t.liwnarmenian = 0x056c;
  17333. t.lj = 0x01c9;
  17334. t.ljecyrillic = 0x0459;
  17335. t.ll = 0xf6c0;
  17336. t.lladeva = 0x0933;
  17337. t.llagujarati = 0x0ab3;
  17338. t.llinebelow = 0x1e3b;
  17339. t.llladeva = 0x0934;
  17340. t.llvocalicbengali = 0x09e1;
  17341. t.llvocalicdeva = 0x0961;
  17342. t.llvocalicvowelsignbengali = 0x09e3;
  17343. t.llvocalicvowelsigndeva = 0x0963;
  17344. t.lmiddletilde = 0x026b;
  17345. t.lmonospace = 0xff4c;
  17346. t.lmsquare = 0x33d0;
  17347. t.lochulathai = 0x0e2c;
  17348. t.logicaland = 0x2227;
  17349. t.logicalnot = 0x00ac;
  17350. t.logicalnotreversed = 0x2310;
  17351. t.logicalor = 0x2228;
  17352. t.lolingthai = 0x0e25;
  17353. t.longs = 0x017f;
  17354. t.lowlinecenterline = 0xfe4e;
  17355. t.lowlinecmb = 0x0332;
  17356. t.lowlinedashed = 0xfe4d;
  17357. t.lozenge = 0x25ca;
  17358. t.lparen = 0x24a7;
  17359. t.lslash = 0x0142;
  17360. t.lsquare = 0x2113;
  17361. t.lsuperior = 0xf6ee;
  17362. t.ltshade = 0x2591;
  17363. t.luthai = 0x0e26;
  17364. t.lvocalicbengali = 0x098c;
  17365. t.lvocalicdeva = 0x090c;
  17366. t.lvocalicvowelsignbengali = 0x09e2;
  17367. t.lvocalicvowelsigndeva = 0x0962;
  17368. t.lxsquare = 0x33d3;
  17369. t.m = 0x006d;
  17370. t.mabengali = 0x09ae;
  17371. t.macron = 0x00af;
  17372. t.macronbelowcmb = 0x0331;
  17373. t.macroncmb = 0x0304;
  17374. t.macronlowmod = 0x02cd;
  17375. t.macronmonospace = 0xffe3;
  17376. t.macute = 0x1e3f;
  17377. t.madeva = 0x092e;
  17378. t.magujarati = 0x0aae;
  17379. t.magurmukhi = 0x0a2e;
  17380. t.mahapakhhebrew = 0x05a4;
  17381. t.mahapakhlefthebrew = 0x05a4;
  17382. t.mahiragana = 0x307e;
  17383. t.maichattawalowleftthai = 0xf895;
  17384. t.maichattawalowrightthai = 0xf894;
  17385. t.maichattawathai = 0x0e4b;
  17386. t.maichattawaupperleftthai = 0xf893;
  17387. t.maieklowleftthai = 0xf88c;
  17388. t.maieklowrightthai = 0xf88b;
  17389. t.maiekthai = 0x0e48;
  17390. t.maiekupperleftthai = 0xf88a;
  17391. t.maihanakatleftthai = 0xf884;
  17392. t.maihanakatthai = 0x0e31;
  17393. t.maitaikhuleftthai = 0xf889;
  17394. t.maitaikhuthai = 0x0e47;
  17395. t.maitholowleftthai = 0xf88f;
  17396. t.maitholowrightthai = 0xf88e;
  17397. t.maithothai = 0x0e49;
  17398. t.maithoupperleftthai = 0xf88d;
  17399. t.maitrilowleftthai = 0xf892;
  17400. t.maitrilowrightthai = 0xf891;
  17401. t.maitrithai = 0x0e4a;
  17402. t.maitriupperleftthai = 0xf890;
  17403. t.maiyamokthai = 0x0e46;
  17404. t.makatakana = 0x30de;
  17405. t.makatakanahalfwidth = 0xff8f;
  17406. t.male = 0x2642;
  17407. t.mansyonsquare = 0x3347;
  17408. t.maqafhebrew = 0x05be;
  17409. t.mars = 0x2642;
  17410. t.masoracirclehebrew = 0x05af;
  17411. t.masquare = 0x3383;
  17412. t.mbopomofo = 0x3107;
  17413. t.mbsquare = 0x33d4;
  17414. t.mcircle = 0x24dc;
  17415. t.mcubedsquare = 0x33a5;
  17416. t.mdotaccent = 0x1e41;
  17417. t.mdotbelow = 0x1e43;
  17418. t.meemarabic = 0x0645;
  17419. t.meemfinalarabic = 0xfee2;
  17420. t.meeminitialarabic = 0xfee3;
  17421. t.meemmedialarabic = 0xfee4;
  17422. t.meemmeeminitialarabic = 0xfcd1;
  17423. t.meemmeemisolatedarabic = 0xfc48;
  17424. t.meetorusquare = 0x334d;
  17425. t.mehiragana = 0x3081;
  17426. t.meizierasquare = 0x337e;
  17427. t.mekatakana = 0x30e1;
  17428. t.mekatakanahalfwidth = 0xff92;
  17429. t.mem = 0x05de;
  17430. t.memdagesh = 0xfb3e;
  17431. t.memdageshhebrew = 0xfb3e;
  17432. t.memhebrew = 0x05de;
  17433. t.menarmenian = 0x0574;
  17434. t.merkhahebrew = 0x05a5;
  17435. t.merkhakefulahebrew = 0x05a6;
  17436. t.merkhakefulalefthebrew = 0x05a6;
  17437. t.merkhalefthebrew = 0x05a5;
  17438. t.mhook = 0x0271;
  17439. t.mhzsquare = 0x3392;
  17440. t.middledotkatakanahalfwidth = 0xff65;
  17441. t.middot = 0x00b7;
  17442. t.mieumacirclekorean = 0x3272;
  17443. t.mieumaparenkorean = 0x3212;
  17444. t.mieumcirclekorean = 0x3264;
  17445. t.mieumkorean = 0x3141;
  17446. t.mieumpansioskorean = 0x3170;
  17447. t.mieumparenkorean = 0x3204;
  17448. t.mieumpieupkorean = 0x316e;
  17449. t.mieumsioskorean = 0x316f;
  17450. t.mihiragana = 0x307f;
  17451. t.mikatakana = 0x30df;
  17452. t.mikatakanahalfwidth = 0xff90;
  17453. t.minus = 0x2212;
  17454. t.minusbelowcmb = 0x0320;
  17455. t.minuscircle = 0x2296;
  17456. t.minusmod = 0x02d7;
  17457. t.minusplus = 0x2213;
  17458. t.minute = 0x2032;
  17459. t.miribaarusquare = 0x334a;
  17460. t.mirisquare = 0x3349;
  17461. t.mlonglegturned = 0x0270;
  17462. t.mlsquare = 0x3396;
  17463. t.mmcubedsquare = 0x33a3;
  17464. t.mmonospace = 0xff4d;
  17465. t.mmsquaredsquare = 0x339f;
  17466. t.mohiragana = 0x3082;
  17467. t.mohmsquare = 0x33c1;
  17468. t.mokatakana = 0x30e2;
  17469. t.mokatakanahalfwidth = 0xff93;
  17470. t.molsquare = 0x33d6;
  17471. t.momathai = 0x0e21;
  17472. t.moverssquare = 0x33a7;
  17473. t.moverssquaredsquare = 0x33a8;
  17474. t.mparen = 0x24a8;
  17475. t.mpasquare = 0x33ab;
  17476. t.mssquare = 0x33b3;
  17477. t.msuperior = 0xf6ef;
  17478. t.mturned = 0x026f;
  17479. t.mu = 0x00b5;
  17480. t.mu1 = 0x00b5;
  17481. t.muasquare = 0x3382;
  17482. t.muchgreater = 0x226b;
  17483. t.muchless = 0x226a;
  17484. t.mufsquare = 0x338c;
  17485. t.mugreek = 0x03bc;
  17486. t.mugsquare = 0x338d;
  17487. t.muhiragana = 0x3080;
  17488. t.mukatakana = 0x30e0;
  17489. t.mukatakanahalfwidth = 0xff91;
  17490. t.mulsquare = 0x3395;
  17491. t.multiply = 0x00d7;
  17492. t.mumsquare = 0x339b;
  17493. t.munahhebrew = 0x05a3;
  17494. t.munahlefthebrew = 0x05a3;
  17495. t.musicalnote = 0x266a;
  17496. t.musicalnotedbl = 0x266b;
  17497. t.musicflatsign = 0x266d;
  17498. t.musicsharpsign = 0x266f;
  17499. t.mussquare = 0x33b2;
  17500. t.muvsquare = 0x33b6;
  17501. t.muwsquare = 0x33bc;
  17502. t.mvmegasquare = 0x33b9;
  17503. t.mvsquare = 0x33b7;
  17504. t.mwmegasquare = 0x33bf;
  17505. t.mwsquare = 0x33bd;
  17506. t.n = 0x006e;
  17507. t.nabengali = 0x09a8;
  17508. t.nabla = 0x2207;
  17509. t.nacute = 0x0144;
  17510. t.nadeva = 0x0928;
  17511. t.nagujarati = 0x0aa8;
  17512. t.nagurmukhi = 0x0a28;
  17513. t.nahiragana = 0x306a;
  17514. t.nakatakana = 0x30ca;
  17515. t.nakatakanahalfwidth = 0xff85;
  17516. t.napostrophe = 0x0149;
  17517. t.nasquare = 0x3381;
  17518. t.nbopomofo = 0x310b;
  17519. t.nbspace = 0x00a0;
  17520. t.ncaron = 0x0148;
  17521. t.ncedilla = 0x0146;
  17522. t.ncircle = 0x24dd;
  17523. t.ncircumflexbelow = 0x1e4b;
  17524. t.ncommaaccent = 0x0146;
  17525. t.ndotaccent = 0x1e45;
  17526. t.ndotbelow = 0x1e47;
  17527. t.nehiragana = 0x306d;
  17528. t.nekatakana = 0x30cd;
  17529. t.nekatakanahalfwidth = 0xff88;
  17530. t.newsheqelsign = 0x20aa;
  17531. t.nfsquare = 0x338b;
  17532. t.ngabengali = 0x0999;
  17533. t.ngadeva = 0x0919;
  17534. t.ngagujarati = 0x0a99;
  17535. t.ngagurmukhi = 0x0a19;
  17536. t.ngonguthai = 0x0e07;
  17537. t.nhiragana = 0x3093;
  17538. t.nhookleft = 0x0272;
  17539. t.nhookretroflex = 0x0273;
  17540. t.nieunacirclekorean = 0x326f;
  17541. t.nieunaparenkorean = 0x320f;
  17542. t.nieuncieuckorean = 0x3135;
  17543. t.nieuncirclekorean = 0x3261;
  17544. t.nieunhieuhkorean = 0x3136;
  17545. t.nieunkorean = 0x3134;
  17546. t.nieunpansioskorean = 0x3168;
  17547. t.nieunparenkorean = 0x3201;
  17548. t.nieunsioskorean = 0x3167;
  17549. t.nieuntikeutkorean = 0x3166;
  17550. t.nihiragana = 0x306b;
  17551. t.nikatakana = 0x30cb;
  17552. t.nikatakanahalfwidth = 0xff86;
  17553. t.nikhahitleftthai = 0xf899;
  17554. t.nikhahitthai = 0x0e4d;
  17555. t.nine = 0x0039;
  17556. t.ninearabic = 0x0669;
  17557. t.ninebengali = 0x09ef;
  17558. t.ninecircle = 0x2468;
  17559. t.ninecircleinversesansserif = 0x2792;
  17560. t.ninedeva = 0x096f;
  17561. t.ninegujarati = 0x0aef;
  17562. t.ninegurmukhi = 0x0a6f;
  17563. t.ninehackarabic = 0x0669;
  17564. t.ninehangzhou = 0x3029;
  17565. t.nineideographicparen = 0x3228;
  17566. t.nineinferior = 0x2089;
  17567. t.ninemonospace = 0xff19;
  17568. t.nineoldstyle = 0xf739;
  17569. t.nineparen = 0x247c;
  17570. t.nineperiod = 0x2490;
  17571. t.ninepersian = 0x06f9;
  17572. t.nineroman = 0x2178;
  17573. t.ninesuperior = 0x2079;
  17574. t.nineteencircle = 0x2472;
  17575. t.nineteenparen = 0x2486;
  17576. t.nineteenperiod = 0x249a;
  17577. t.ninethai = 0x0e59;
  17578. t.nj = 0x01cc;
  17579. t.njecyrillic = 0x045a;
  17580. t.nkatakana = 0x30f3;
  17581. t.nkatakanahalfwidth = 0xff9d;
  17582. t.nlegrightlong = 0x019e;
  17583. t.nlinebelow = 0x1e49;
  17584. t.nmonospace = 0xff4e;
  17585. t.nmsquare = 0x339a;
  17586. t.nnabengali = 0x09a3;
  17587. t.nnadeva = 0x0923;
  17588. t.nnagujarati = 0x0aa3;
  17589. t.nnagurmukhi = 0x0a23;
  17590. t.nnnadeva = 0x0929;
  17591. t.nohiragana = 0x306e;
  17592. t.nokatakana = 0x30ce;
  17593. t.nokatakanahalfwidth = 0xff89;
  17594. t.nonbreakingspace = 0x00a0;
  17595. t.nonenthai = 0x0e13;
  17596. t.nonuthai = 0x0e19;
  17597. t.noonarabic = 0x0646;
  17598. t.noonfinalarabic = 0xfee6;
  17599. t.noonghunnaarabic = 0x06ba;
  17600. t.noonghunnafinalarabic = 0xfb9f;
  17601. t.nooninitialarabic = 0xfee7;
  17602. t.noonjeeminitialarabic = 0xfcd2;
  17603. t.noonjeemisolatedarabic = 0xfc4b;
  17604. t.noonmedialarabic = 0xfee8;
  17605. t.noonmeeminitialarabic = 0xfcd5;
  17606. t.noonmeemisolatedarabic = 0xfc4e;
  17607. t.noonnoonfinalarabic = 0xfc8d;
  17608. t.notcontains = 0x220c;
  17609. t.notelement = 0x2209;
  17610. t.notelementof = 0x2209;
  17611. t.notequal = 0x2260;
  17612. t.notgreater = 0x226f;
  17613. t.notgreaternorequal = 0x2271;
  17614. t.notgreaternorless = 0x2279;
  17615. t.notidentical = 0x2262;
  17616. t.notless = 0x226e;
  17617. t.notlessnorequal = 0x2270;
  17618. t.notparallel = 0x2226;
  17619. t.notprecedes = 0x2280;
  17620. t.notsubset = 0x2284;
  17621. t.notsucceeds = 0x2281;
  17622. t.notsuperset = 0x2285;
  17623. t.nowarmenian = 0x0576;
  17624. t.nparen = 0x24a9;
  17625. t.nssquare = 0x33b1;
  17626. t.nsuperior = 0x207f;
  17627. t.ntilde = 0x00f1;
  17628. t.nu = 0x03bd;
  17629. t.nuhiragana = 0x306c;
  17630. t.nukatakana = 0x30cc;
  17631. t.nukatakanahalfwidth = 0xff87;
  17632. t.nuktabengali = 0x09bc;
  17633. t.nuktadeva = 0x093c;
  17634. t.nuktagujarati = 0x0abc;
  17635. t.nuktagurmukhi = 0x0a3c;
  17636. t.numbersign = 0x0023;
  17637. t.numbersignmonospace = 0xff03;
  17638. t.numbersignsmall = 0xfe5f;
  17639. t.numeralsigngreek = 0x0374;
  17640. t.numeralsignlowergreek = 0x0375;
  17641. t.numero = 0x2116;
  17642. t.nun = 0x05e0;
  17643. t.nundagesh = 0xfb40;
  17644. t.nundageshhebrew = 0xfb40;
  17645. t.nunhebrew = 0x05e0;
  17646. t.nvsquare = 0x33b5;
  17647. t.nwsquare = 0x33bb;
  17648. t.nyabengali = 0x099e;
  17649. t.nyadeva = 0x091e;
  17650. t.nyagujarati = 0x0a9e;
  17651. t.nyagurmukhi = 0x0a1e;
  17652. t.o = 0x006f;
  17653. t.oacute = 0x00f3;
  17654. t.oangthai = 0x0e2d;
  17655. t.obarred = 0x0275;
  17656. t.obarredcyrillic = 0x04e9;
  17657. t.obarreddieresiscyrillic = 0x04eb;
  17658. t.obengali = 0x0993;
  17659. t.obopomofo = 0x311b;
  17660. t.obreve = 0x014f;
  17661. t.ocandradeva = 0x0911;
  17662. t.ocandragujarati = 0x0a91;
  17663. t.ocandravowelsigndeva = 0x0949;
  17664. t.ocandravowelsigngujarati = 0x0ac9;
  17665. t.ocaron = 0x01d2;
  17666. t.ocircle = 0x24de;
  17667. t.ocircumflex = 0x00f4;
  17668. t.ocircumflexacute = 0x1ed1;
  17669. t.ocircumflexdotbelow = 0x1ed9;
  17670. t.ocircumflexgrave = 0x1ed3;
  17671. t.ocircumflexhookabove = 0x1ed5;
  17672. t.ocircumflextilde = 0x1ed7;
  17673. t.ocyrillic = 0x043e;
  17674. t.odblacute = 0x0151;
  17675. t.odblgrave = 0x020d;
  17676. t.odeva = 0x0913;
  17677. t.odieresis = 0x00f6;
  17678. t.odieresiscyrillic = 0x04e7;
  17679. t.odotbelow = 0x1ecd;
  17680. t.oe = 0x0153;
  17681. t.oekorean = 0x315a;
  17682. t.ogonek = 0x02db;
  17683. t.ogonekcmb = 0x0328;
  17684. t.ograve = 0x00f2;
  17685. t.ogujarati = 0x0a93;
  17686. t.oharmenian = 0x0585;
  17687. t.ohiragana = 0x304a;
  17688. t.ohookabove = 0x1ecf;
  17689. t.ohorn = 0x01a1;
  17690. t.ohornacute = 0x1edb;
  17691. t.ohorndotbelow = 0x1ee3;
  17692. t.ohorngrave = 0x1edd;
  17693. t.ohornhookabove = 0x1edf;
  17694. t.ohorntilde = 0x1ee1;
  17695. t.ohungarumlaut = 0x0151;
  17696. t.oi = 0x01a3;
  17697. t.oinvertedbreve = 0x020f;
  17698. t.okatakana = 0x30aa;
  17699. t.okatakanahalfwidth = 0xff75;
  17700. t.okorean = 0x3157;
  17701. t.olehebrew = 0x05ab;
  17702. t.omacron = 0x014d;
  17703. t.omacronacute = 0x1e53;
  17704. t.omacrongrave = 0x1e51;
  17705. t.omdeva = 0x0950;
  17706. t.omega = 0x03c9;
  17707. t.omega1 = 0x03d6;
  17708. t.omegacyrillic = 0x0461;
  17709. t.omegalatinclosed = 0x0277;
  17710. t.omegaroundcyrillic = 0x047b;
  17711. t.omegatitlocyrillic = 0x047d;
  17712. t.omegatonos = 0x03ce;
  17713. t.omgujarati = 0x0ad0;
  17714. t.omicron = 0x03bf;
  17715. t.omicrontonos = 0x03cc;
  17716. t.omonospace = 0xff4f;
  17717. t.one = 0x0031;
  17718. t.onearabic = 0x0661;
  17719. t.onebengali = 0x09e7;
  17720. t.onecircle = 0x2460;
  17721. t.onecircleinversesansserif = 0x278a;
  17722. t.onedeva = 0x0967;
  17723. t.onedotenleader = 0x2024;
  17724. t.oneeighth = 0x215b;
  17725. t.onefitted = 0xf6dc;
  17726. t.onegujarati = 0x0ae7;
  17727. t.onegurmukhi = 0x0a67;
  17728. t.onehackarabic = 0x0661;
  17729. t.onehalf = 0x00bd;
  17730. t.onehangzhou = 0x3021;
  17731. t.oneideographicparen = 0x3220;
  17732. t.oneinferior = 0x2081;
  17733. t.onemonospace = 0xff11;
  17734. t.onenumeratorbengali = 0x09f4;
  17735. t.oneoldstyle = 0xf731;
  17736. t.oneparen = 0x2474;
  17737. t.oneperiod = 0x2488;
  17738. t.onepersian = 0x06f1;
  17739. t.onequarter = 0x00bc;
  17740. t.oneroman = 0x2170;
  17741. t.onesuperior = 0x00b9;
  17742. t.onethai = 0x0e51;
  17743. t.onethird = 0x2153;
  17744. t.oogonek = 0x01eb;
  17745. t.oogonekmacron = 0x01ed;
  17746. t.oogurmukhi = 0x0a13;
  17747. t.oomatragurmukhi = 0x0a4b;
  17748. t.oopen = 0x0254;
  17749. t.oparen = 0x24aa;
  17750. t.openbullet = 0x25e6;
  17751. t.option = 0x2325;
  17752. t.ordfeminine = 0x00aa;
  17753. t.ordmasculine = 0x00ba;
  17754. t.orthogonal = 0x221f;
  17755. t.oshortdeva = 0x0912;
  17756. t.oshortvowelsigndeva = 0x094a;
  17757. t.oslash = 0x00f8;
  17758. t.oslashacute = 0x01ff;
  17759. t.osmallhiragana = 0x3049;
  17760. t.osmallkatakana = 0x30a9;
  17761. t.osmallkatakanahalfwidth = 0xff6b;
  17762. t.ostrokeacute = 0x01ff;
  17763. t.osuperior = 0xf6f0;
  17764. t.otcyrillic = 0x047f;
  17765. t.otilde = 0x00f5;
  17766. t.otildeacute = 0x1e4d;
  17767. t.otildedieresis = 0x1e4f;
  17768. t.oubopomofo = 0x3121;
  17769. t.overline = 0x203e;
  17770. t.overlinecenterline = 0xfe4a;
  17771. t.overlinecmb = 0x0305;
  17772. t.overlinedashed = 0xfe49;
  17773. t.overlinedblwavy = 0xfe4c;
  17774. t.overlinewavy = 0xfe4b;
  17775. t.overscore = 0x00af;
  17776. t.ovowelsignbengali = 0x09cb;
  17777. t.ovowelsigndeva = 0x094b;
  17778. t.ovowelsigngujarati = 0x0acb;
  17779. t.p = 0x0070;
  17780. t.paampssquare = 0x3380;
  17781. t.paasentosquare = 0x332b;
  17782. t.pabengali = 0x09aa;
  17783. t.pacute = 0x1e55;
  17784. t.padeva = 0x092a;
  17785. t.pagedown = 0x21df;
  17786. t.pageup = 0x21de;
  17787. t.pagujarati = 0x0aaa;
  17788. t.pagurmukhi = 0x0a2a;
  17789. t.pahiragana = 0x3071;
  17790. t.paiyannoithai = 0x0e2f;
  17791. t.pakatakana = 0x30d1;
  17792. t.palatalizationcyrilliccmb = 0x0484;
  17793. t.palochkacyrillic = 0x04c0;
  17794. t.pansioskorean = 0x317f;
  17795. t.paragraph = 0x00b6;
  17796. t.parallel = 0x2225;
  17797. t.parenleft = 0x0028;
  17798. t.parenleftaltonearabic = 0xfd3e;
  17799. t.parenleftbt = 0xf8ed;
  17800. t.parenleftex = 0xf8ec;
  17801. t.parenleftinferior = 0x208d;
  17802. t.parenleftmonospace = 0xff08;
  17803. t.parenleftsmall = 0xfe59;
  17804. t.parenleftsuperior = 0x207d;
  17805. t.parenlefttp = 0xf8eb;
  17806. t.parenleftvertical = 0xfe35;
  17807. t.parenright = 0x0029;
  17808. t.parenrightaltonearabic = 0xfd3f;
  17809. t.parenrightbt = 0xf8f8;
  17810. t.parenrightex = 0xf8f7;
  17811. t.parenrightinferior = 0x208e;
  17812. t.parenrightmonospace = 0xff09;
  17813. t.parenrightsmall = 0xfe5a;
  17814. t.parenrightsuperior = 0x207e;
  17815. t.parenrighttp = 0xf8f6;
  17816. t.parenrightvertical = 0xfe36;
  17817. t.partialdiff = 0x2202;
  17818. t.paseqhebrew = 0x05c0;
  17819. t.pashtahebrew = 0x0599;
  17820. t.pasquare = 0x33a9;
  17821. t.patah = 0x05b7;
  17822. t.patah11 = 0x05b7;
  17823. t.patah1d = 0x05b7;
  17824. t.patah2a = 0x05b7;
  17825. t.patahhebrew = 0x05b7;
  17826. t.patahnarrowhebrew = 0x05b7;
  17827. t.patahquarterhebrew = 0x05b7;
  17828. t.patahwidehebrew = 0x05b7;
  17829. t.pazerhebrew = 0x05a1;
  17830. t.pbopomofo = 0x3106;
  17831. t.pcircle = 0x24df;
  17832. t.pdotaccent = 0x1e57;
  17833. t.pe = 0x05e4;
  17834. t.pecyrillic = 0x043f;
  17835. t.pedagesh = 0xfb44;
  17836. t.pedageshhebrew = 0xfb44;
  17837. t.peezisquare = 0x333b;
  17838. t.pefinaldageshhebrew = 0xfb43;
  17839. t.peharabic = 0x067e;
  17840. t.peharmenian = 0x057a;
  17841. t.pehebrew = 0x05e4;
  17842. t.pehfinalarabic = 0xfb57;
  17843. t.pehinitialarabic = 0xfb58;
  17844. t.pehiragana = 0x307a;
  17845. t.pehmedialarabic = 0xfb59;
  17846. t.pekatakana = 0x30da;
  17847. t.pemiddlehookcyrillic = 0x04a7;
  17848. t.perafehebrew = 0xfb4e;
  17849. t.percent = 0x0025;
  17850. t.percentarabic = 0x066a;
  17851. t.percentmonospace = 0xff05;
  17852. t.percentsmall = 0xfe6a;
  17853. t.period = 0x002e;
  17854. t.periodarmenian = 0x0589;
  17855. t.periodcentered = 0x00b7;
  17856. t.periodhalfwidth = 0xff61;
  17857. t.periodinferior = 0xf6e7;
  17858. t.periodmonospace = 0xff0e;
  17859. t.periodsmall = 0xfe52;
  17860. t.periodsuperior = 0xf6e8;
  17861. t.perispomenigreekcmb = 0x0342;
  17862. t.perpendicular = 0x22a5;
  17863. t.perthousand = 0x2030;
  17864. t.peseta = 0x20a7;
  17865. t.pfsquare = 0x338a;
  17866. t.phabengali = 0x09ab;
  17867. t.phadeva = 0x092b;
  17868. t.phagujarati = 0x0aab;
  17869. t.phagurmukhi = 0x0a2b;
  17870. t.phi = 0x03c6;
  17871. t.phi1 = 0x03d5;
  17872. t.phieuphacirclekorean = 0x327a;
  17873. t.phieuphaparenkorean = 0x321a;
  17874. t.phieuphcirclekorean = 0x326c;
  17875. t.phieuphkorean = 0x314d;
  17876. t.phieuphparenkorean = 0x320c;
  17877. t.philatin = 0x0278;
  17878. t.phinthuthai = 0x0e3a;
  17879. t.phisymbolgreek = 0x03d5;
  17880. t.phook = 0x01a5;
  17881. t.phophanthai = 0x0e1e;
  17882. t.phophungthai = 0x0e1c;
  17883. t.phosamphaothai = 0x0e20;
  17884. t.pi = 0x03c0;
  17885. t.pieupacirclekorean = 0x3273;
  17886. t.pieupaparenkorean = 0x3213;
  17887. t.pieupcieuckorean = 0x3176;
  17888. t.pieupcirclekorean = 0x3265;
  17889. t.pieupkiyeokkorean = 0x3172;
  17890. t.pieupkorean = 0x3142;
  17891. t.pieupparenkorean = 0x3205;
  17892. t.pieupsioskiyeokkorean = 0x3174;
  17893. t.pieupsioskorean = 0x3144;
  17894. t.pieupsiostikeutkorean = 0x3175;
  17895. t.pieupthieuthkorean = 0x3177;
  17896. t.pieuptikeutkorean = 0x3173;
  17897. t.pihiragana = 0x3074;
  17898. t.pikatakana = 0x30d4;
  17899. t.pisymbolgreek = 0x03d6;
  17900. t.piwrarmenian = 0x0583;
  17901. t.planckover2pi = 0x210f;
  17902. t.planckover2pi1 = 0x210f;
  17903. t.plus = 0x002b;
  17904. t.plusbelowcmb = 0x031f;
  17905. t.pluscircle = 0x2295;
  17906. t.plusminus = 0x00b1;
  17907. t.plusmod = 0x02d6;
  17908. t.plusmonospace = 0xff0b;
  17909. t.plussmall = 0xfe62;
  17910. t.plussuperior = 0x207a;
  17911. t.pmonospace = 0xff50;
  17912. t.pmsquare = 0x33d8;
  17913. t.pohiragana = 0x307d;
  17914. t.pointingindexdownwhite = 0x261f;
  17915. t.pointingindexleftwhite = 0x261c;
  17916. t.pointingindexrightwhite = 0x261e;
  17917. t.pointingindexupwhite = 0x261d;
  17918. t.pokatakana = 0x30dd;
  17919. t.poplathai = 0x0e1b;
  17920. t.postalmark = 0x3012;
  17921. t.postalmarkface = 0x3020;
  17922. t.pparen = 0x24ab;
  17923. t.precedes = 0x227a;
  17924. t.prescription = 0x211e;
  17925. t.primemod = 0x02b9;
  17926. t.primereversed = 0x2035;
  17927. t.product = 0x220f;
  17928. t.projective = 0x2305;
  17929. t.prolongedkana = 0x30fc;
  17930. t.propellor = 0x2318;
  17931. t.propersubset = 0x2282;
  17932. t.propersuperset = 0x2283;
  17933. t.proportion = 0x2237;
  17934. t.proportional = 0x221d;
  17935. t.psi = 0x03c8;
  17936. t.psicyrillic = 0x0471;
  17937. t.psilipneumatacyrilliccmb = 0x0486;
  17938. t.pssquare = 0x33b0;
  17939. t.puhiragana = 0x3077;
  17940. t.pukatakana = 0x30d7;
  17941. t.pvsquare = 0x33b4;
  17942. t.pwsquare = 0x33ba;
  17943. t.q = 0x0071;
  17944. t.qadeva = 0x0958;
  17945. t.qadmahebrew = 0x05a8;
  17946. t.qafarabic = 0x0642;
  17947. t.qaffinalarabic = 0xfed6;
  17948. t.qafinitialarabic = 0xfed7;
  17949. t.qafmedialarabic = 0xfed8;
  17950. t.qamats = 0x05b8;
  17951. t.qamats10 = 0x05b8;
  17952. t.qamats1a = 0x05b8;
  17953. t.qamats1c = 0x05b8;
  17954. t.qamats27 = 0x05b8;
  17955. t.qamats29 = 0x05b8;
  17956. t.qamats33 = 0x05b8;
  17957. t.qamatsde = 0x05b8;
  17958. t.qamatshebrew = 0x05b8;
  17959. t.qamatsnarrowhebrew = 0x05b8;
  17960. t.qamatsqatanhebrew = 0x05b8;
  17961. t.qamatsqatannarrowhebrew = 0x05b8;
  17962. t.qamatsqatanquarterhebrew = 0x05b8;
  17963. t.qamatsqatanwidehebrew = 0x05b8;
  17964. t.qamatsquarterhebrew = 0x05b8;
  17965. t.qamatswidehebrew = 0x05b8;
  17966. t.qarneyparahebrew = 0x059f;
  17967. t.qbopomofo = 0x3111;
  17968. t.qcircle = 0x24e0;
  17969. t.qhook = 0x02a0;
  17970. t.qmonospace = 0xff51;
  17971. t.qof = 0x05e7;
  17972. t.qofdagesh = 0xfb47;
  17973. t.qofdageshhebrew = 0xfb47;
  17974. t.qofhebrew = 0x05e7;
  17975. t.qparen = 0x24ac;
  17976. t.quarternote = 0x2669;
  17977. t.qubuts = 0x05bb;
  17978. t.qubuts18 = 0x05bb;
  17979. t.qubuts25 = 0x05bb;
  17980. t.qubuts31 = 0x05bb;
  17981. t.qubutshebrew = 0x05bb;
  17982. t.qubutsnarrowhebrew = 0x05bb;
  17983. t.qubutsquarterhebrew = 0x05bb;
  17984. t.qubutswidehebrew = 0x05bb;
  17985. t.question = 0x003f;
  17986. t.questionarabic = 0x061f;
  17987. t.questionarmenian = 0x055e;
  17988. t.questiondown = 0x00bf;
  17989. t.questiondownsmall = 0xf7bf;
  17990. t.questiongreek = 0x037e;
  17991. t.questionmonospace = 0xff1f;
  17992. t.questionsmall = 0xf73f;
  17993. t.quotedbl = 0x0022;
  17994. t.quotedblbase = 0x201e;
  17995. t.quotedblleft = 0x201c;
  17996. t.quotedblmonospace = 0xff02;
  17997. t.quotedblprime = 0x301e;
  17998. t.quotedblprimereversed = 0x301d;
  17999. t.quotedblright = 0x201d;
  18000. t.quoteleft = 0x2018;
  18001. t.quoteleftreversed = 0x201b;
  18002. t.quotereversed = 0x201b;
  18003. t.quoteright = 0x2019;
  18004. t.quoterightn = 0x0149;
  18005. t.quotesinglbase = 0x201a;
  18006. t.quotesingle = 0x0027;
  18007. t.quotesinglemonospace = 0xff07;
  18008. t.r = 0x0072;
  18009. t.raarmenian = 0x057c;
  18010. t.rabengali = 0x09b0;
  18011. t.racute = 0x0155;
  18012. t.radeva = 0x0930;
  18013. t.radical = 0x221a;
  18014. t.radicalex = 0xf8e5;
  18015. t.radoverssquare = 0x33ae;
  18016. t.radoverssquaredsquare = 0x33af;
  18017. t.radsquare = 0x33ad;
  18018. t.rafe = 0x05bf;
  18019. t.rafehebrew = 0x05bf;
  18020. t.ragujarati = 0x0ab0;
  18021. t.ragurmukhi = 0x0a30;
  18022. t.rahiragana = 0x3089;
  18023. t.rakatakana = 0x30e9;
  18024. t.rakatakanahalfwidth = 0xff97;
  18025. t.ralowerdiagonalbengali = 0x09f1;
  18026. t.ramiddlediagonalbengali = 0x09f0;
  18027. t.ramshorn = 0x0264;
  18028. t.ratio = 0x2236;
  18029. t.rbopomofo = 0x3116;
  18030. t.rcaron = 0x0159;
  18031. t.rcedilla = 0x0157;
  18032. t.rcircle = 0x24e1;
  18033. t.rcommaaccent = 0x0157;
  18034. t.rdblgrave = 0x0211;
  18035. t.rdotaccent = 0x1e59;
  18036. t.rdotbelow = 0x1e5b;
  18037. t.rdotbelowmacron = 0x1e5d;
  18038. t.referencemark = 0x203b;
  18039. t.reflexsubset = 0x2286;
  18040. t.reflexsuperset = 0x2287;
  18041. t.registered = 0x00ae;
  18042. t.registersans = 0xf8e8;
  18043. t.registerserif = 0xf6da;
  18044. t.reharabic = 0x0631;
  18045. t.reharmenian = 0x0580;
  18046. t.rehfinalarabic = 0xfeae;
  18047. t.rehiragana = 0x308c;
  18048. t.rekatakana = 0x30ec;
  18049. t.rekatakanahalfwidth = 0xff9a;
  18050. t.resh = 0x05e8;
  18051. t.reshdageshhebrew = 0xfb48;
  18052. t.reshhebrew = 0x05e8;
  18053. t.reversedtilde = 0x223d;
  18054. t.reviahebrew = 0x0597;
  18055. t.reviamugrashhebrew = 0x0597;
  18056. t.revlogicalnot = 0x2310;
  18057. t.rfishhook = 0x027e;
  18058. t.rfishhookreversed = 0x027f;
  18059. t.rhabengali = 0x09dd;
  18060. t.rhadeva = 0x095d;
  18061. t.rho = 0x03c1;
  18062. t.rhook = 0x027d;
  18063. t.rhookturned = 0x027b;
  18064. t.rhookturnedsuperior = 0x02b5;
  18065. t.rhosymbolgreek = 0x03f1;
  18066. t.rhotichookmod = 0x02de;
  18067. t.rieulacirclekorean = 0x3271;
  18068. t.rieulaparenkorean = 0x3211;
  18069. t.rieulcirclekorean = 0x3263;
  18070. t.rieulhieuhkorean = 0x3140;
  18071. t.rieulkiyeokkorean = 0x313a;
  18072. t.rieulkiyeoksioskorean = 0x3169;
  18073. t.rieulkorean = 0x3139;
  18074. t.rieulmieumkorean = 0x313b;
  18075. t.rieulpansioskorean = 0x316c;
  18076. t.rieulparenkorean = 0x3203;
  18077. t.rieulphieuphkorean = 0x313f;
  18078. t.rieulpieupkorean = 0x313c;
  18079. t.rieulpieupsioskorean = 0x316b;
  18080. t.rieulsioskorean = 0x313d;
  18081. t.rieulthieuthkorean = 0x313e;
  18082. t.rieultikeutkorean = 0x316a;
  18083. t.rieulyeorinhieuhkorean = 0x316d;
  18084. t.rightangle = 0x221f;
  18085. t.righttackbelowcmb = 0x0319;
  18086. t.righttriangle = 0x22bf;
  18087. t.rihiragana = 0x308a;
  18088. t.rikatakana = 0x30ea;
  18089. t.rikatakanahalfwidth = 0xff98;
  18090. t.ring = 0x02da;
  18091. t.ringbelowcmb = 0x0325;
  18092. t.ringcmb = 0x030a;
  18093. t.ringhalfleft = 0x02bf;
  18094. t.ringhalfleftarmenian = 0x0559;
  18095. t.ringhalfleftbelowcmb = 0x031c;
  18096. t.ringhalfleftcentered = 0x02d3;
  18097. t.ringhalfright = 0x02be;
  18098. t.ringhalfrightbelowcmb = 0x0339;
  18099. t.ringhalfrightcentered = 0x02d2;
  18100. t.rinvertedbreve = 0x0213;
  18101. t.rittorusquare = 0x3351;
  18102. t.rlinebelow = 0x1e5f;
  18103. t.rlongleg = 0x027c;
  18104. t.rlonglegturned = 0x027a;
  18105. t.rmonospace = 0xff52;
  18106. t.rohiragana = 0x308d;
  18107. t.rokatakana = 0x30ed;
  18108. t.rokatakanahalfwidth = 0xff9b;
  18109. t.roruathai = 0x0e23;
  18110. t.rparen = 0x24ad;
  18111. t.rrabengali = 0x09dc;
  18112. t.rradeva = 0x0931;
  18113. t.rragurmukhi = 0x0a5c;
  18114. t.rreharabic = 0x0691;
  18115. t.rrehfinalarabic = 0xfb8d;
  18116. t.rrvocalicbengali = 0x09e0;
  18117. t.rrvocalicdeva = 0x0960;
  18118. t.rrvocalicgujarati = 0x0ae0;
  18119. t.rrvocalicvowelsignbengali = 0x09c4;
  18120. t.rrvocalicvowelsigndeva = 0x0944;
  18121. t.rrvocalicvowelsigngujarati = 0x0ac4;
  18122. t.rsuperior = 0xf6f1;
  18123. t.rtblock = 0x2590;
  18124. t.rturned = 0x0279;
  18125. t.rturnedsuperior = 0x02b4;
  18126. t.ruhiragana = 0x308b;
  18127. t.rukatakana = 0x30eb;
  18128. t.rukatakanahalfwidth = 0xff99;
  18129. t.rupeemarkbengali = 0x09f2;
  18130. t.rupeesignbengali = 0x09f3;
  18131. t.rupiah = 0xf6dd;
  18132. t.ruthai = 0x0e24;
  18133. t.rvocalicbengali = 0x098b;
  18134. t.rvocalicdeva = 0x090b;
  18135. t.rvocalicgujarati = 0x0a8b;
  18136. t.rvocalicvowelsignbengali = 0x09c3;
  18137. t.rvocalicvowelsigndeva = 0x0943;
  18138. t.rvocalicvowelsigngujarati = 0x0ac3;
  18139. t.s = 0x0073;
  18140. t.sabengali = 0x09b8;
  18141. t.sacute = 0x015b;
  18142. t.sacutedotaccent = 0x1e65;
  18143. t.sadarabic = 0x0635;
  18144. t.sadeva = 0x0938;
  18145. t.sadfinalarabic = 0xfeba;
  18146. t.sadinitialarabic = 0xfebb;
  18147. t.sadmedialarabic = 0xfebc;
  18148. t.sagujarati = 0x0ab8;
  18149. t.sagurmukhi = 0x0a38;
  18150. t.sahiragana = 0x3055;
  18151. t.sakatakana = 0x30b5;
  18152. t.sakatakanahalfwidth = 0xff7b;
  18153. t.sallallahoualayhewasallamarabic = 0xfdfa;
  18154. t.samekh = 0x05e1;
  18155. t.samekhdagesh = 0xfb41;
  18156. t.samekhdageshhebrew = 0xfb41;
  18157. t.samekhhebrew = 0x05e1;
  18158. t.saraaathai = 0x0e32;
  18159. t.saraaethai = 0x0e41;
  18160. t.saraaimaimalaithai = 0x0e44;
  18161. t.saraaimaimuanthai = 0x0e43;
  18162. t.saraamthai = 0x0e33;
  18163. t.saraathai = 0x0e30;
  18164. t.saraethai = 0x0e40;
  18165. t.saraiileftthai = 0xf886;
  18166. t.saraiithai = 0x0e35;
  18167. t.saraileftthai = 0xf885;
  18168. t.saraithai = 0x0e34;
  18169. t.saraothai = 0x0e42;
  18170. t.saraueeleftthai = 0xf888;
  18171. t.saraueethai = 0x0e37;
  18172. t.saraueleftthai = 0xf887;
  18173. t.sarauethai = 0x0e36;
  18174. t.sarauthai = 0x0e38;
  18175. t.sarauuthai = 0x0e39;
  18176. t.sbopomofo = 0x3119;
  18177. t.scaron = 0x0161;
  18178. t.scarondotaccent = 0x1e67;
  18179. t.scedilla = 0x015f;
  18180. t.schwa = 0x0259;
  18181. t.schwacyrillic = 0x04d9;
  18182. t.schwadieresiscyrillic = 0x04db;
  18183. t.schwahook = 0x025a;
  18184. t.scircle = 0x24e2;
  18185. t.scircumflex = 0x015d;
  18186. t.scommaaccent = 0x0219;
  18187. t.sdotaccent = 0x1e61;
  18188. t.sdotbelow = 0x1e63;
  18189. t.sdotbelowdotaccent = 0x1e69;
  18190. t.seagullbelowcmb = 0x033c;
  18191. t.second = 0x2033;
  18192. t.secondtonechinese = 0x02ca;
  18193. t.section = 0x00a7;
  18194. t.seenarabic = 0x0633;
  18195. t.seenfinalarabic = 0xfeb2;
  18196. t.seeninitialarabic = 0xfeb3;
  18197. t.seenmedialarabic = 0xfeb4;
  18198. t.segol = 0x05b6;
  18199. t.segol13 = 0x05b6;
  18200. t.segol1f = 0x05b6;
  18201. t.segol2c = 0x05b6;
  18202. t.segolhebrew = 0x05b6;
  18203. t.segolnarrowhebrew = 0x05b6;
  18204. t.segolquarterhebrew = 0x05b6;
  18205. t.segoltahebrew = 0x0592;
  18206. t.segolwidehebrew = 0x05b6;
  18207. t.seharmenian = 0x057d;
  18208. t.sehiragana = 0x305b;
  18209. t.sekatakana = 0x30bb;
  18210. t.sekatakanahalfwidth = 0xff7e;
  18211. t.semicolon = 0x003b;
  18212. t.semicolonarabic = 0x061b;
  18213. t.semicolonmonospace = 0xff1b;
  18214. t.semicolonsmall = 0xfe54;
  18215. t.semivoicedmarkkana = 0x309c;
  18216. t.semivoicedmarkkanahalfwidth = 0xff9f;
  18217. t.sentisquare = 0x3322;
  18218. t.sentosquare = 0x3323;
  18219. t.seven = 0x0037;
  18220. t.sevenarabic = 0x0667;
  18221. t.sevenbengali = 0x09ed;
  18222. t.sevencircle = 0x2466;
  18223. t.sevencircleinversesansserif = 0x2790;
  18224. t.sevendeva = 0x096d;
  18225. t.seveneighths = 0x215e;
  18226. t.sevengujarati = 0x0aed;
  18227. t.sevengurmukhi = 0x0a6d;
  18228. t.sevenhackarabic = 0x0667;
  18229. t.sevenhangzhou = 0x3027;
  18230. t.sevenideographicparen = 0x3226;
  18231. t.seveninferior = 0x2087;
  18232. t.sevenmonospace = 0xff17;
  18233. t.sevenoldstyle = 0xf737;
  18234. t.sevenparen = 0x247a;
  18235. t.sevenperiod = 0x248e;
  18236. t.sevenpersian = 0x06f7;
  18237. t.sevenroman = 0x2176;
  18238. t.sevensuperior = 0x2077;
  18239. t.seventeencircle = 0x2470;
  18240. t.seventeenparen = 0x2484;
  18241. t.seventeenperiod = 0x2498;
  18242. t.seventhai = 0x0e57;
  18243. t.sfthyphen = 0x00ad;
  18244. t.shaarmenian = 0x0577;
  18245. t.shabengali = 0x09b6;
  18246. t.shacyrillic = 0x0448;
  18247. t.shaddaarabic = 0x0651;
  18248. t.shaddadammaarabic = 0xfc61;
  18249. t.shaddadammatanarabic = 0xfc5e;
  18250. t.shaddafathaarabic = 0xfc60;
  18251. t.shaddakasraarabic = 0xfc62;
  18252. t.shaddakasratanarabic = 0xfc5f;
  18253. t.shade = 0x2592;
  18254. t.shadedark = 0x2593;
  18255. t.shadelight = 0x2591;
  18256. t.shademedium = 0x2592;
  18257. t.shadeva = 0x0936;
  18258. t.shagujarati = 0x0ab6;
  18259. t.shagurmukhi = 0x0a36;
  18260. t.shalshelethebrew = 0x0593;
  18261. t.shbopomofo = 0x3115;
  18262. t.shchacyrillic = 0x0449;
  18263. t.sheenarabic = 0x0634;
  18264. t.sheenfinalarabic = 0xfeb6;
  18265. t.sheeninitialarabic = 0xfeb7;
  18266. t.sheenmedialarabic = 0xfeb8;
  18267. t.sheicoptic = 0x03e3;
  18268. t.sheqel = 0x20aa;
  18269. t.sheqelhebrew = 0x20aa;
  18270. t.sheva = 0x05b0;
  18271. t.sheva115 = 0x05b0;
  18272. t.sheva15 = 0x05b0;
  18273. t.sheva22 = 0x05b0;
  18274. t.sheva2e = 0x05b0;
  18275. t.shevahebrew = 0x05b0;
  18276. t.shevanarrowhebrew = 0x05b0;
  18277. t.shevaquarterhebrew = 0x05b0;
  18278. t.shevawidehebrew = 0x05b0;
  18279. t.shhacyrillic = 0x04bb;
  18280. t.shimacoptic = 0x03ed;
  18281. t.shin = 0x05e9;
  18282. t.shindagesh = 0xfb49;
  18283. t.shindageshhebrew = 0xfb49;
  18284. t.shindageshshindot = 0xfb2c;
  18285. t.shindageshshindothebrew = 0xfb2c;
  18286. t.shindageshsindot = 0xfb2d;
  18287. t.shindageshsindothebrew = 0xfb2d;
  18288. t.shindothebrew = 0x05c1;
  18289. t.shinhebrew = 0x05e9;
  18290. t.shinshindot = 0xfb2a;
  18291. t.shinshindothebrew = 0xfb2a;
  18292. t.shinsindot = 0xfb2b;
  18293. t.shinsindothebrew = 0xfb2b;
  18294. t.shook = 0x0282;
  18295. t.sigma = 0x03c3;
  18296. t.sigma1 = 0x03c2;
  18297. t.sigmafinal = 0x03c2;
  18298. t.sigmalunatesymbolgreek = 0x03f2;
  18299. t.sihiragana = 0x3057;
  18300. t.sikatakana = 0x30b7;
  18301. t.sikatakanahalfwidth = 0xff7c;
  18302. t.siluqhebrew = 0x05bd;
  18303. t.siluqlefthebrew = 0x05bd;
  18304. t.similar = 0x223c;
  18305. t.sindothebrew = 0x05c2;
  18306. t.siosacirclekorean = 0x3274;
  18307. t.siosaparenkorean = 0x3214;
  18308. t.sioscieuckorean = 0x317e;
  18309. t.sioscirclekorean = 0x3266;
  18310. t.sioskiyeokkorean = 0x317a;
  18311. t.sioskorean = 0x3145;
  18312. t.siosnieunkorean = 0x317b;
  18313. t.siosparenkorean = 0x3206;
  18314. t.siospieupkorean = 0x317d;
  18315. t.siostikeutkorean = 0x317c;
  18316. t.six = 0x0036;
  18317. t.sixarabic = 0x0666;
  18318. t.sixbengali = 0x09ec;
  18319. t.sixcircle = 0x2465;
  18320. t.sixcircleinversesansserif = 0x278f;
  18321. t.sixdeva = 0x096c;
  18322. t.sixgujarati = 0x0aec;
  18323. t.sixgurmukhi = 0x0a6c;
  18324. t.sixhackarabic = 0x0666;
  18325. t.sixhangzhou = 0x3026;
  18326. t.sixideographicparen = 0x3225;
  18327. t.sixinferior = 0x2086;
  18328. t.sixmonospace = 0xff16;
  18329. t.sixoldstyle = 0xf736;
  18330. t.sixparen = 0x2479;
  18331. t.sixperiod = 0x248d;
  18332. t.sixpersian = 0x06f6;
  18333. t.sixroman = 0x2175;
  18334. t.sixsuperior = 0x2076;
  18335. t.sixteencircle = 0x246f;
  18336. t.sixteencurrencydenominatorbengali = 0x09f9;
  18337. t.sixteenparen = 0x2483;
  18338. t.sixteenperiod = 0x2497;
  18339. t.sixthai = 0x0e56;
  18340. t.slash = 0x002f;
  18341. t.slashmonospace = 0xff0f;
  18342. t.slong = 0x017f;
  18343. t.slongdotaccent = 0x1e9b;
  18344. t.smileface = 0x263a;
  18345. t.smonospace = 0xff53;
  18346. t.sofpasuqhebrew = 0x05c3;
  18347. t.softhyphen = 0x00ad;
  18348. t.softsigncyrillic = 0x044c;
  18349. t.sohiragana = 0x305d;
  18350. t.sokatakana = 0x30bd;
  18351. t.sokatakanahalfwidth = 0xff7f;
  18352. t.soliduslongoverlaycmb = 0x0338;
  18353. t.solidusshortoverlaycmb = 0x0337;
  18354. t.sorusithai = 0x0e29;
  18355. t.sosalathai = 0x0e28;
  18356. t.sosothai = 0x0e0b;
  18357. t.sosuathai = 0x0e2a;
  18358. t.space = 0x0020;
  18359. t.spacehackarabic = 0x0020;
  18360. t.spade = 0x2660;
  18361. t.spadesuitblack = 0x2660;
  18362. t.spadesuitwhite = 0x2664;
  18363. t.sparen = 0x24ae;
  18364. t.squarebelowcmb = 0x033b;
  18365. t.squarecc = 0x33c4;
  18366. t.squarecm = 0x339d;
  18367. t.squarediagonalcrosshatchfill = 0x25a9;
  18368. t.squarehorizontalfill = 0x25a4;
  18369. t.squarekg = 0x338f;
  18370. t.squarekm = 0x339e;
  18371. t.squarekmcapital = 0x33ce;
  18372. t.squareln = 0x33d1;
  18373. t.squarelog = 0x33d2;
  18374. t.squaremg = 0x338e;
  18375. t.squaremil = 0x33d5;
  18376. t.squaremm = 0x339c;
  18377. t.squaremsquared = 0x33a1;
  18378. t.squareorthogonalcrosshatchfill = 0x25a6;
  18379. t.squareupperlefttolowerrightfill = 0x25a7;
  18380. t.squareupperrighttolowerleftfill = 0x25a8;
  18381. t.squareverticalfill = 0x25a5;
  18382. t.squarewhitewithsmallblack = 0x25a3;
  18383. t.srsquare = 0x33db;
  18384. t.ssabengali = 0x09b7;
  18385. t.ssadeva = 0x0937;
  18386. t.ssagujarati = 0x0ab7;
  18387. t.ssangcieuckorean = 0x3149;
  18388. t.ssanghieuhkorean = 0x3185;
  18389. t.ssangieungkorean = 0x3180;
  18390. t.ssangkiyeokkorean = 0x3132;
  18391. t.ssangnieunkorean = 0x3165;
  18392. t.ssangpieupkorean = 0x3143;
  18393. t.ssangsioskorean = 0x3146;
  18394. t.ssangtikeutkorean = 0x3138;
  18395. t.ssuperior = 0xf6f2;
  18396. t.sterling = 0x00a3;
  18397. t.sterlingmonospace = 0xffe1;
  18398. t.strokelongoverlaycmb = 0x0336;
  18399. t.strokeshortoverlaycmb = 0x0335;
  18400. t.subset = 0x2282;
  18401. t.subsetnotequal = 0x228a;
  18402. t.subsetorequal = 0x2286;
  18403. t.succeeds = 0x227b;
  18404. t.suchthat = 0x220b;
  18405. t.suhiragana = 0x3059;
  18406. t.sukatakana = 0x30b9;
  18407. t.sukatakanahalfwidth = 0xff7d;
  18408. t.sukunarabic = 0x0652;
  18409. t.summation = 0x2211;
  18410. t.sun = 0x263c;
  18411. t.superset = 0x2283;
  18412. t.supersetnotequal = 0x228b;
  18413. t.supersetorequal = 0x2287;
  18414. t.svsquare = 0x33dc;
  18415. t.syouwaerasquare = 0x337c;
  18416. t.t = 0x0074;
  18417. t.tabengali = 0x09a4;
  18418. t.tackdown = 0x22a4;
  18419. t.tackleft = 0x22a3;
  18420. t.tadeva = 0x0924;
  18421. t.tagujarati = 0x0aa4;
  18422. t.tagurmukhi = 0x0a24;
  18423. t.taharabic = 0x0637;
  18424. t.tahfinalarabic = 0xfec2;
  18425. t.tahinitialarabic = 0xfec3;
  18426. t.tahiragana = 0x305f;
  18427. t.tahmedialarabic = 0xfec4;
  18428. t.taisyouerasquare = 0x337d;
  18429. t.takatakana = 0x30bf;
  18430. t.takatakanahalfwidth = 0xff80;
  18431. t.tatweelarabic = 0x0640;
  18432. t.tau = 0x03c4;
  18433. t.tav = 0x05ea;
  18434. t.tavdages = 0xfb4a;
  18435. t.tavdagesh = 0xfb4a;
  18436. t.tavdageshhebrew = 0xfb4a;
  18437. t.tavhebrew = 0x05ea;
  18438. t.tbar = 0x0167;
  18439. t.tbopomofo = 0x310a;
  18440. t.tcaron = 0x0165;
  18441. t.tccurl = 0x02a8;
  18442. t.tcedilla = 0x0163;
  18443. t.tcheharabic = 0x0686;
  18444. t.tchehfinalarabic = 0xfb7b;
  18445. t.tchehinitialarabic = 0xfb7c;
  18446. t.tchehmedialarabic = 0xfb7d;
  18447. t.tcircle = 0x24e3;
  18448. t.tcircumflexbelow = 0x1e71;
  18449. t.tcommaaccent = 0x0163;
  18450. t.tdieresis = 0x1e97;
  18451. t.tdotaccent = 0x1e6b;
  18452. t.tdotbelow = 0x1e6d;
  18453. t.tecyrillic = 0x0442;
  18454. t.tedescendercyrillic = 0x04ad;
  18455. t.teharabic = 0x062a;
  18456. t.tehfinalarabic = 0xfe96;
  18457. t.tehhahinitialarabic = 0xfca2;
  18458. t.tehhahisolatedarabic = 0xfc0c;
  18459. t.tehinitialarabic = 0xfe97;
  18460. t.tehiragana = 0x3066;
  18461. t.tehjeeminitialarabic = 0xfca1;
  18462. t.tehjeemisolatedarabic = 0xfc0b;
  18463. t.tehmarbutaarabic = 0x0629;
  18464. t.tehmarbutafinalarabic = 0xfe94;
  18465. t.tehmedialarabic = 0xfe98;
  18466. t.tehmeeminitialarabic = 0xfca4;
  18467. t.tehmeemisolatedarabic = 0xfc0e;
  18468. t.tehnoonfinalarabic = 0xfc73;
  18469. t.tekatakana = 0x30c6;
  18470. t.tekatakanahalfwidth = 0xff83;
  18471. t.telephone = 0x2121;
  18472. t.telephoneblack = 0x260e;
  18473. t.telishagedolahebrew = 0x05a0;
  18474. t.telishaqetanahebrew = 0x05a9;
  18475. t.tencircle = 0x2469;
  18476. t.tenideographicparen = 0x3229;
  18477. t.tenparen = 0x247d;
  18478. t.tenperiod = 0x2491;
  18479. t.tenroman = 0x2179;
  18480. t.tesh = 0x02a7;
  18481. t.tet = 0x05d8;
  18482. t.tetdagesh = 0xfb38;
  18483. t.tetdageshhebrew = 0xfb38;
  18484. t.tethebrew = 0x05d8;
  18485. t.tetsecyrillic = 0x04b5;
  18486. t.tevirhebrew = 0x059b;
  18487. t.tevirlefthebrew = 0x059b;
  18488. t.thabengali = 0x09a5;
  18489. t.thadeva = 0x0925;
  18490. t.thagujarati = 0x0aa5;
  18491. t.thagurmukhi = 0x0a25;
  18492. t.thalarabic = 0x0630;
  18493. t.thalfinalarabic = 0xfeac;
  18494. t.thanthakhatlowleftthai = 0xf898;
  18495. t.thanthakhatlowrightthai = 0xf897;
  18496. t.thanthakhatthai = 0x0e4c;
  18497. t.thanthakhatupperleftthai = 0xf896;
  18498. t.theharabic = 0x062b;
  18499. t.thehfinalarabic = 0xfe9a;
  18500. t.thehinitialarabic = 0xfe9b;
  18501. t.thehmedialarabic = 0xfe9c;
  18502. t.thereexists = 0x2203;
  18503. t.therefore = 0x2234;
  18504. t.theta = 0x03b8;
  18505. t.theta1 = 0x03d1;
  18506. t.thetasymbolgreek = 0x03d1;
  18507. t.thieuthacirclekorean = 0x3279;
  18508. t.thieuthaparenkorean = 0x3219;
  18509. t.thieuthcirclekorean = 0x326b;
  18510. t.thieuthkorean = 0x314c;
  18511. t.thieuthparenkorean = 0x320b;
  18512. t.thirteencircle = 0x246c;
  18513. t.thirteenparen = 0x2480;
  18514. t.thirteenperiod = 0x2494;
  18515. t.thonangmonthothai = 0x0e11;
  18516. t.thook = 0x01ad;
  18517. t.thophuthaothai = 0x0e12;
  18518. t.thorn = 0x00fe;
  18519. t.thothahanthai = 0x0e17;
  18520. t.thothanthai = 0x0e10;
  18521. t.thothongthai = 0x0e18;
  18522. t.thothungthai = 0x0e16;
  18523. t.thousandcyrillic = 0x0482;
  18524. t.thousandsseparatorarabic = 0x066c;
  18525. t.thousandsseparatorpersian = 0x066c;
  18526. t.three = 0x0033;
  18527. t.threearabic = 0x0663;
  18528. t.threebengali = 0x09e9;
  18529. t.threecircle = 0x2462;
  18530. t.threecircleinversesansserif = 0x278c;
  18531. t.threedeva = 0x0969;
  18532. t.threeeighths = 0x215c;
  18533. t.threegujarati = 0x0ae9;
  18534. t.threegurmukhi = 0x0a69;
  18535. t.threehackarabic = 0x0663;
  18536. t.threehangzhou = 0x3023;
  18537. t.threeideographicparen = 0x3222;
  18538. t.threeinferior = 0x2083;
  18539. t.threemonospace = 0xff13;
  18540. t.threenumeratorbengali = 0x09f6;
  18541. t.threeoldstyle = 0xf733;
  18542. t.threeparen = 0x2476;
  18543. t.threeperiod = 0x248a;
  18544. t.threepersian = 0x06f3;
  18545. t.threequarters = 0x00be;
  18546. t.threequartersemdash = 0xf6de;
  18547. t.threeroman = 0x2172;
  18548. t.threesuperior = 0x00b3;
  18549. t.threethai = 0x0e53;
  18550. t.thzsquare = 0x3394;
  18551. t.tihiragana = 0x3061;
  18552. t.tikatakana = 0x30c1;
  18553. t.tikatakanahalfwidth = 0xff81;
  18554. t.tikeutacirclekorean = 0x3270;
  18555. t.tikeutaparenkorean = 0x3210;
  18556. t.tikeutcirclekorean = 0x3262;
  18557. t.tikeutkorean = 0x3137;
  18558. t.tikeutparenkorean = 0x3202;
  18559. t.tilde = 0x02dc;
  18560. t.tildebelowcmb = 0x0330;
  18561. t.tildecmb = 0x0303;
  18562. t.tildecomb = 0x0303;
  18563. t.tildedoublecmb = 0x0360;
  18564. t.tildeoperator = 0x223c;
  18565. t.tildeoverlaycmb = 0x0334;
  18566. t.tildeverticalcmb = 0x033e;
  18567. t.timescircle = 0x2297;
  18568. t.tipehahebrew = 0x0596;
  18569. t.tipehalefthebrew = 0x0596;
  18570. t.tippigurmukhi = 0x0a70;
  18571. t.titlocyrilliccmb = 0x0483;
  18572. t.tiwnarmenian = 0x057f;
  18573. t.tlinebelow = 0x1e6f;
  18574. t.tmonospace = 0xff54;
  18575. t.toarmenian = 0x0569;
  18576. t.tohiragana = 0x3068;
  18577. t.tokatakana = 0x30c8;
  18578. t.tokatakanahalfwidth = 0xff84;
  18579. t.tonebarextrahighmod = 0x02e5;
  18580. t.tonebarextralowmod = 0x02e9;
  18581. t.tonebarhighmod = 0x02e6;
  18582. t.tonebarlowmod = 0x02e8;
  18583. t.tonebarmidmod = 0x02e7;
  18584. t.tonefive = 0x01bd;
  18585. t.tonesix = 0x0185;
  18586. t.tonetwo = 0x01a8;
  18587. t.tonos = 0x0384;
  18588. t.tonsquare = 0x3327;
  18589. t.topatakthai = 0x0e0f;
  18590. t.tortoiseshellbracketleft = 0x3014;
  18591. t.tortoiseshellbracketleftsmall = 0xfe5d;
  18592. t.tortoiseshellbracketleftvertical = 0xfe39;
  18593. t.tortoiseshellbracketright = 0x3015;
  18594. t.tortoiseshellbracketrightsmall = 0xfe5e;
  18595. t.tortoiseshellbracketrightvertical = 0xfe3a;
  18596. t.totaothai = 0x0e15;
  18597. t.tpalatalhook = 0x01ab;
  18598. t.tparen = 0x24af;
  18599. t.trademark = 0x2122;
  18600. t.trademarksans = 0xf8ea;
  18601. t.trademarkserif = 0xf6db;
  18602. t.tretroflexhook = 0x0288;
  18603. t.triagdn = 0x25bc;
  18604. t.triaglf = 0x25c4;
  18605. t.triagrt = 0x25ba;
  18606. t.triagup = 0x25b2;
  18607. t.ts = 0x02a6;
  18608. t.tsadi = 0x05e6;
  18609. t.tsadidagesh = 0xfb46;
  18610. t.tsadidageshhebrew = 0xfb46;
  18611. t.tsadihebrew = 0x05e6;
  18612. t.tsecyrillic = 0x0446;
  18613. t.tsere = 0x05b5;
  18614. t.tsere12 = 0x05b5;
  18615. t.tsere1e = 0x05b5;
  18616. t.tsere2b = 0x05b5;
  18617. t.tserehebrew = 0x05b5;
  18618. t.tserenarrowhebrew = 0x05b5;
  18619. t.tserequarterhebrew = 0x05b5;
  18620. t.tserewidehebrew = 0x05b5;
  18621. t.tshecyrillic = 0x045b;
  18622. t.tsuperior = 0xf6f3;
  18623. t.ttabengali = 0x099f;
  18624. t.ttadeva = 0x091f;
  18625. t.ttagujarati = 0x0a9f;
  18626. t.ttagurmukhi = 0x0a1f;
  18627. t.tteharabic = 0x0679;
  18628. t.ttehfinalarabic = 0xfb67;
  18629. t.ttehinitialarabic = 0xfb68;
  18630. t.ttehmedialarabic = 0xfb69;
  18631. t.tthabengali = 0x09a0;
  18632. t.tthadeva = 0x0920;
  18633. t.tthagujarati = 0x0aa0;
  18634. t.tthagurmukhi = 0x0a20;
  18635. t.tturned = 0x0287;
  18636. t.tuhiragana = 0x3064;
  18637. t.tukatakana = 0x30c4;
  18638. t.tukatakanahalfwidth = 0xff82;
  18639. t.tusmallhiragana = 0x3063;
  18640. t.tusmallkatakana = 0x30c3;
  18641. t.tusmallkatakanahalfwidth = 0xff6f;
  18642. t.twelvecircle = 0x246b;
  18643. t.twelveparen = 0x247f;
  18644. t.twelveperiod = 0x2493;
  18645. t.twelveroman = 0x217b;
  18646. t.twentycircle = 0x2473;
  18647. t.twentyhangzhou = 0x5344;
  18648. t.twentyparen = 0x2487;
  18649. t.twentyperiod = 0x249b;
  18650. t.two = 0x0032;
  18651. t.twoarabic = 0x0662;
  18652. t.twobengali = 0x09e8;
  18653. t.twocircle = 0x2461;
  18654. t.twocircleinversesansserif = 0x278b;
  18655. t.twodeva = 0x0968;
  18656. t.twodotenleader = 0x2025;
  18657. t.twodotleader = 0x2025;
  18658. t.twodotleadervertical = 0xfe30;
  18659. t.twogujarati = 0x0ae8;
  18660. t.twogurmukhi = 0x0a68;
  18661. t.twohackarabic = 0x0662;
  18662. t.twohangzhou = 0x3022;
  18663. t.twoideographicparen = 0x3221;
  18664. t.twoinferior = 0x2082;
  18665. t.twomonospace = 0xff12;
  18666. t.twonumeratorbengali = 0x09f5;
  18667. t.twooldstyle = 0xf732;
  18668. t.twoparen = 0x2475;
  18669. t.twoperiod = 0x2489;
  18670. t.twopersian = 0x06f2;
  18671. t.tworoman = 0x2171;
  18672. t.twostroke = 0x01bb;
  18673. t.twosuperior = 0x00b2;
  18674. t.twothai = 0x0e52;
  18675. t.twothirds = 0x2154;
  18676. t.u = 0x0075;
  18677. t.uacute = 0x00fa;
  18678. t.ubar = 0x0289;
  18679. t.ubengali = 0x0989;
  18680. t.ubopomofo = 0x3128;
  18681. t.ubreve = 0x016d;
  18682. t.ucaron = 0x01d4;
  18683. t.ucircle = 0x24e4;
  18684. t.ucircumflex = 0x00fb;
  18685. t.ucircumflexbelow = 0x1e77;
  18686. t.ucyrillic = 0x0443;
  18687. t.udattadeva = 0x0951;
  18688. t.udblacute = 0x0171;
  18689. t.udblgrave = 0x0215;
  18690. t.udeva = 0x0909;
  18691. t.udieresis = 0x00fc;
  18692. t.udieresisacute = 0x01d8;
  18693. t.udieresisbelow = 0x1e73;
  18694. t.udieresiscaron = 0x01da;
  18695. t.udieresiscyrillic = 0x04f1;
  18696. t.udieresisgrave = 0x01dc;
  18697. t.udieresismacron = 0x01d6;
  18698. t.udotbelow = 0x1ee5;
  18699. t.ugrave = 0x00f9;
  18700. t.ugujarati = 0x0a89;
  18701. t.ugurmukhi = 0x0a09;
  18702. t.uhiragana = 0x3046;
  18703. t.uhookabove = 0x1ee7;
  18704. t.uhorn = 0x01b0;
  18705. t.uhornacute = 0x1ee9;
  18706. t.uhorndotbelow = 0x1ef1;
  18707. t.uhorngrave = 0x1eeb;
  18708. t.uhornhookabove = 0x1eed;
  18709. t.uhorntilde = 0x1eef;
  18710. t.uhungarumlaut = 0x0171;
  18711. t.uhungarumlautcyrillic = 0x04f3;
  18712. t.uinvertedbreve = 0x0217;
  18713. t.ukatakana = 0x30a6;
  18714. t.ukatakanahalfwidth = 0xff73;
  18715. t.ukcyrillic = 0x0479;
  18716. t.ukorean = 0x315c;
  18717. t.umacron = 0x016b;
  18718. t.umacroncyrillic = 0x04ef;
  18719. t.umacrondieresis = 0x1e7b;
  18720. t.umatragurmukhi = 0x0a41;
  18721. t.umonospace = 0xff55;
  18722. t.underscore = 0x005f;
  18723. t.underscoredbl = 0x2017;
  18724. t.underscoremonospace = 0xff3f;
  18725. t.underscorevertical = 0xfe33;
  18726. t.underscorewavy = 0xfe4f;
  18727. t.union = 0x222a;
  18728. t.universal = 0x2200;
  18729. t.uogonek = 0x0173;
  18730. t.uparen = 0x24b0;
  18731. t.upblock = 0x2580;
  18732. t.upperdothebrew = 0x05c4;
  18733. t.upsilon = 0x03c5;
  18734. t.upsilondieresis = 0x03cb;
  18735. t.upsilondieresistonos = 0x03b0;
  18736. t.upsilonlatin = 0x028a;
  18737. t.upsilontonos = 0x03cd;
  18738. t.uptackbelowcmb = 0x031d;
  18739. t.uptackmod = 0x02d4;
  18740. t.uragurmukhi = 0x0a73;
  18741. t.uring = 0x016f;
  18742. t.ushortcyrillic = 0x045e;
  18743. t.usmallhiragana = 0x3045;
  18744. t.usmallkatakana = 0x30a5;
  18745. t.usmallkatakanahalfwidth = 0xff69;
  18746. t.ustraightcyrillic = 0x04af;
  18747. t.ustraightstrokecyrillic = 0x04b1;
  18748. t.utilde = 0x0169;
  18749. t.utildeacute = 0x1e79;
  18750. t.utildebelow = 0x1e75;
  18751. t.uubengali = 0x098a;
  18752. t.uudeva = 0x090a;
  18753. t.uugujarati = 0x0a8a;
  18754. t.uugurmukhi = 0x0a0a;
  18755. t.uumatragurmukhi = 0x0a42;
  18756. t.uuvowelsignbengali = 0x09c2;
  18757. t.uuvowelsigndeva = 0x0942;
  18758. t.uuvowelsigngujarati = 0x0ac2;
  18759. t.uvowelsignbengali = 0x09c1;
  18760. t.uvowelsigndeva = 0x0941;
  18761. t.uvowelsigngujarati = 0x0ac1;
  18762. t.v = 0x0076;
  18763. t.vadeva = 0x0935;
  18764. t.vagujarati = 0x0ab5;
  18765. t.vagurmukhi = 0x0a35;
  18766. t.vakatakana = 0x30f7;
  18767. t.vav = 0x05d5;
  18768. t.vavdagesh = 0xfb35;
  18769. t.vavdagesh65 = 0xfb35;
  18770. t.vavdageshhebrew = 0xfb35;
  18771. t.vavhebrew = 0x05d5;
  18772. t.vavholam = 0xfb4b;
  18773. t.vavholamhebrew = 0xfb4b;
  18774. t.vavvavhebrew = 0x05f0;
  18775. t.vavyodhebrew = 0x05f1;
  18776. t.vcircle = 0x24e5;
  18777. t.vdotbelow = 0x1e7f;
  18778. t.vecyrillic = 0x0432;
  18779. t.veharabic = 0x06a4;
  18780. t.vehfinalarabic = 0xfb6b;
  18781. t.vehinitialarabic = 0xfb6c;
  18782. t.vehmedialarabic = 0xfb6d;
  18783. t.vekatakana = 0x30f9;
  18784. t.venus = 0x2640;
  18785. t.verticalbar = 0x007c;
  18786. t.verticallineabovecmb = 0x030d;
  18787. t.verticallinebelowcmb = 0x0329;
  18788. t.verticallinelowmod = 0x02cc;
  18789. t.verticallinemod = 0x02c8;
  18790. t.vewarmenian = 0x057e;
  18791. t.vhook = 0x028b;
  18792. t.vikatakana = 0x30f8;
  18793. t.viramabengali = 0x09cd;
  18794. t.viramadeva = 0x094d;
  18795. t.viramagujarati = 0x0acd;
  18796. t.visargabengali = 0x0983;
  18797. t.visargadeva = 0x0903;
  18798. t.visargagujarati = 0x0a83;
  18799. t.vmonospace = 0xff56;
  18800. t.voarmenian = 0x0578;
  18801. t.voicediterationhiragana = 0x309e;
  18802. t.voicediterationkatakana = 0x30fe;
  18803. t.voicedmarkkana = 0x309b;
  18804. t.voicedmarkkanahalfwidth = 0xff9e;
  18805. t.vokatakana = 0x30fa;
  18806. t.vparen = 0x24b1;
  18807. t.vtilde = 0x1e7d;
  18808. t.vturned = 0x028c;
  18809. t.vuhiragana = 0x3094;
  18810. t.vukatakana = 0x30f4;
  18811. t.w = 0x0077;
  18812. t.wacute = 0x1e83;
  18813. t.waekorean = 0x3159;
  18814. t.wahiragana = 0x308f;
  18815. t.wakatakana = 0x30ef;
  18816. t.wakatakanahalfwidth = 0xff9c;
  18817. t.wakorean = 0x3158;
  18818. t.wasmallhiragana = 0x308e;
  18819. t.wasmallkatakana = 0x30ee;
  18820. t.wattosquare = 0x3357;
  18821. t.wavedash = 0x301c;
  18822. t.wavyunderscorevertical = 0xfe34;
  18823. t.wawarabic = 0x0648;
  18824. t.wawfinalarabic = 0xfeee;
  18825. t.wawhamzaabovearabic = 0x0624;
  18826. t.wawhamzaabovefinalarabic = 0xfe86;
  18827. t.wbsquare = 0x33dd;
  18828. t.wcircle = 0x24e6;
  18829. t.wcircumflex = 0x0175;
  18830. t.wdieresis = 0x1e85;
  18831. t.wdotaccent = 0x1e87;
  18832. t.wdotbelow = 0x1e89;
  18833. t.wehiragana = 0x3091;
  18834. t.weierstrass = 0x2118;
  18835. t.wekatakana = 0x30f1;
  18836. t.wekorean = 0x315e;
  18837. t.weokorean = 0x315d;
  18838. t.wgrave = 0x1e81;
  18839. t.whitebullet = 0x25e6;
  18840. t.whitecircle = 0x25cb;
  18841. t.whitecircleinverse = 0x25d9;
  18842. t.whitecornerbracketleft = 0x300e;
  18843. t.whitecornerbracketleftvertical = 0xfe43;
  18844. t.whitecornerbracketright = 0x300f;
  18845. t.whitecornerbracketrightvertical = 0xfe44;
  18846. t.whitediamond = 0x25c7;
  18847. t.whitediamondcontainingblacksmalldiamond = 0x25c8;
  18848. t.whitedownpointingsmalltriangle = 0x25bf;
  18849. t.whitedownpointingtriangle = 0x25bd;
  18850. t.whiteleftpointingsmalltriangle = 0x25c3;
  18851. t.whiteleftpointingtriangle = 0x25c1;
  18852. t.whitelenticularbracketleft = 0x3016;
  18853. t.whitelenticularbracketright = 0x3017;
  18854. t.whiterightpointingsmalltriangle = 0x25b9;
  18855. t.whiterightpointingtriangle = 0x25b7;
  18856. t.whitesmallsquare = 0x25ab;
  18857. t.whitesmilingface = 0x263a;
  18858. t.whitesquare = 0x25a1;
  18859. t.whitestar = 0x2606;
  18860. t.whitetelephone = 0x260f;
  18861. t.whitetortoiseshellbracketleft = 0x3018;
  18862. t.whitetortoiseshellbracketright = 0x3019;
  18863. t.whiteuppointingsmalltriangle = 0x25b5;
  18864. t.whiteuppointingtriangle = 0x25b3;
  18865. t.wihiragana = 0x3090;
  18866. t.wikatakana = 0x30f0;
  18867. t.wikorean = 0x315f;
  18868. t.wmonospace = 0xff57;
  18869. t.wohiragana = 0x3092;
  18870. t.wokatakana = 0x30f2;
  18871. t.wokatakanahalfwidth = 0xff66;
  18872. t.won = 0x20a9;
  18873. t.wonmonospace = 0xffe6;
  18874. t.wowaenthai = 0x0e27;
  18875. t.wparen = 0x24b2;
  18876. t.wring = 0x1e98;
  18877. t.wsuperior = 0x02b7;
  18878. t.wturned = 0x028d;
  18879. t.wynn = 0x01bf;
  18880. t.x = 0x0078;
  18881. t.xabovecmb = 0x033d;
  18882. t.xbopomofo = 0x3112;
  18883. t.xcircle = 0x24e7;
  18884. t.xdieresis = 0x1e8d;
  18885. t.xdotaccent = 0x1e8b;
  18886. t.xeharmenian = 0x056d;
  18887. t.xi = 0x03be;
  18888. t.xmonospace = 0xff58;
  18889. t.xparen = 0x24b3;
  18890. t.xsuperior = 0x02e3;
  18891. t.y = 0x0079;
  18892. t.yaadosquare = 0x334e;
  18893. t.yabengali = 0x09af;
  18894. t.yacute = 0x00fd;
  18895. t.yadeva = 0x092f;
  18896. t.yaekorean = 0x3152;
  18897. t.yagujarati = 0x0aaf;
  18898. t.yagurmukhi = 0x0a2f;
  18899. t.yahiragana = 0x3084;
  18900. t.yakatakana = 0x30e4;
  18901. t.yakatakanahalfwidth = 0xff94;
  18902. t.yakorean = 0x3151;
  18903. t.yamakkanthai = 0x0e4e;
  18904. t.yasmallhiragana = 0x3083;
  18905. t.yasmallkatakana = 0x30e3;
  18906. t.yasmallkatakanahalfwidth = 0xff6c;
  18907. t.yatcyrillic = 0x0463;
  18908. t.ycircle = 0x24e8;
  18909. t.ycircumflex = 0x0177;
  18910. t.ydieresis = 0x00ff;
  18911. t.ydotaccent = 0x1e8f;
  18912. t.ydotbelow = 0x1ef5;
  18913. t.yeharabic = 0x064a;
  18914. t.yehbarreearabic = 0x06d2;
  18915. t.yehbarreefinalarabic = 0xfbaf;
  18916. t.yehfinalarabic = 0xfef2;
  18917. t.yehhamzaabovearabic = 0x0626;
  18918. t.yehhamzaabovefinalarabic = 0xfe8a;
  18919. t.yehhamzaaboveinitialarabic = 0xfe8b;
  18920. t.yehhamzaabovemedialarabic = 0xfe8c;
  18921. t.yehinitialarabic = 0xfef3;
  18922. t.yehmedialarabic = 0xfef4;
  18923. t.yehmeeminitialarabic = 0xfcdd;
  18924. t.yehmeemisolatedarabic = 0xfc58;
  18925. t.yehnoonfinalarabic = 0xfc94;
  18926. t.yehthreedotsbelowarabic = 0x06d1;
  18927. t.yekorean = 0x3156;
  18928. t.yen = 0x00a5;
  18929. t.yenmonospace = 0xffe5;
  18930. t.yeokorean = 0x3155;
  18931. t.yeorinhieuhkorean = 0x3186;
  18932. t.yerahbenyomohebrew = 0x05aa;
  18933. t.yerahbenyomolefthebrew = 0x05aa;
  18934. t.yericyrillic = 0x044b;
  18935. t.yerudieresiscyrillic = 0x04f9;
  18936. t.yesieungkorean = 0x3181;
  18937. t.yesieungpansioskorean = 0x3183;
  18938. t.yesieungsioskorean = 0x3182;
  18939. t.yetivhebrew = 0x059a;
  18940. t.ygrave = 0x1ef3;
  18941. t.yhook = 0x01b4;
  18942. t.yhookabove = 0x1ef7;
  18943. t.yiarmenian = 0x0575;
  18944. t.yicyrillic = 0x0457;
  18945. t.yikorean = 0x3162;
  18946. t.yinyang = 0x262f;
  18947. t.yiwnarmenian = 0x0582;
  18948. t.ymonospace = 0xff59;
  18949. t.yod = 0x05d9;
  18950. t.yoddagesh = 0xfb39;
  18951. t.yoddageshhebrew = 0xfb39;
  18952. t.yodhebrew = 0x05d9;
  18953. t.yodyodhebrew = 0x05f2;
  18954. t.yodyodpatahhebrew = 0xfb1f;
  18955. t.yohiragana = 0x3088;
  18956. t.yoikorean = 0x3189;
  18957. t.yokatakana = 0x30e8;
  18958. t.yokatakanahalfwidth = 0xff96;
  18959. t.yokorean = 0x315b;
  18960. t.yosmallhiragana = 0x3087;
  18961. t.yosmallkatakana = 0x30e7;
  18962. t.yosmallkatakanahalfwidth = 0xff6e;
  18963. t.yotgreek = 0x03f3;
  18964. t.yoyaekorean = 0x3188;
  18965. t.yoyakorean = 0x3187;
  18966. t.yoyakthai = 0x0e22;
  18967. t.yoyingthai = 0x0e0d;
  18968. t.yparen = 0x24b4;
  18969. t.ypogegrammeni = 0x037a;
  18970. t.ypogegrammenigreekcmb = 0x0345;
  18971. t.yr = 0x01a6;
  18972. t.yring = 0x1e99;
  18973. t.ysuperior = 0x02b8;
  18974. t.ytilde = 0x1ef9;
  18975. t.yturned = 0x028e;
  18976. t.yuhiragana = 0x3086;
  18977. t.yuikorean = 0x318c;
  18978. t.yukatakana = 0x30e6;
  18979. t.yukatakanahalfwidth = 0xff95;
  18980. t.yukorean = 0x3160;
  18981. t.yusbigcyrillic = 0x046b;
  18982. t.yusbigiotifiedcyrillic = 0x046d;
  18983. t.yuslittlecyrillic = 0x0467;
  18984. t.yuslittleiotifiedcyrillic = 0x0469;
  18985. t.yusmallhiragana = 0x3085;
  18986. t.yusmallkatakana = 0x30e5;
  18987. t.yusmallkatakanahalfwidth = 0xff6d;
  18988. t.yuyekorean = 0x318b;
  18989. t.yuyeokorean = 0x318a;
  18990. t.yyabengali = 0x09df;
  18991. t.yyadeva = 0x095f;
  18992. t.z = 0x007a;
  18993. t.zaarmenian = 0x0566;
  18994. t.zacute = 0x017a;
  18995. t.zadeva = 0x095b;
  18996. t.zagurmukhi = 0x0a5b;
  18997. t.zaharabic = 0x0638;
  18998. t.zahfinalarabic = 0xfec6;
  18999. t.zahinitialarabic = 0xfec7;
  19000. t.zahiragana = 0x3056;
  19001. t.zahmedialarabic = 0xfec8;
  19002. t.zainarabic = 0x0632;
  19003. t.zainfinalarabic = 0xfeb0;
  19004. t.zakatakana = 0x30b6;
  19005. t.zaqefgadolhebrew = 0x0595;
  19006. t.zaqefqatanhebrew = 0x0594;
  19007. t.zarqahebrew = 0x0598;
  19008. t.zayin = 0x05d6;
  19009. t.zayindagesh = 0xfb36;
  19010. t.zayindageshhebrew = 0xfb36;
  19011. t.zayinhebrew = 0x05d6;
  19012. t.zbopomofo = 0x3117;
  19013. t.zcaron = 0x017e;
  19014. t.zcircle = 0x24e9;
  19015. t.zcircumflex = 0x1e91;
  19016. t.zcurl = 0x0291;
  19017. t.zdot = 0x017c;
  19018. t.zdotaccent = 0x017c;
  19019. t.zdotbelow = 0x1e93;
  19020. t.zecyrillic = 0x0437;
  19021. t.zedescendercyrillic = 0x0499;
  19022. t.zedieresiscyrillic = 0x04df;
  19023. t.zehiragana = 0x305c;
  19024. t.zekatakana = 0x30bc;
  19025. t.zero = 0x0030;
  19026. t.zeroarabic = 0x0660;
  19027. t.zerobengali = 0x09e6;
  19028. t.zerodeva = 0x0966;
  19029. t.zerogujarati = 0x0ae6;
  19030. t.zerogurmukhi = 0x0a66;
  19031. t.zerohackarabic = 0x0660;
  19032. t.zeroinferior = 0x2080;
  19033. t.zeromonospace = 0xff10;
  19034. t.zerooldstyle = 0xf730;
  19035. t.zeropersian = 0x06f0;
  19036. t.zerosuperior = 0x2070;
  19037. t.zerothai = 0x0e50;
  19038. t.zerowidthjoiner = 0xfeff;
  19039. t.zerowidthnonjoiner = 0x200c;
  19040. t.zerowidthspace = 0x200b;
  19041. t.zeta = 0x03b6;
  19042. t.zhbopomofo = 0x3113;
  19043. t.zhearmenian = 0x056a;
  19044. t.zhebrevecyrillic = 0x04c2;
  19045. t.zhecyrillic = 0x0436;
  19046. t.zhedescendercyrillic = 0x0497;
  19047. t.zhedieresiscyrillic = 0x04dd;
  19048. t.zihiragana = 0x3058;
  19049. t.zikatakana = 0x30b8;
  19050. t.zinorhebrew = 0x05ae;
  19051. t.zlinebelow = 0x1e95;
  19052. t.zmonospace = 0xff5a;
  19053. t.zohiragana = 0x305e;
  19054. t.zokatakana = 0x30be;
  19055. t.zparen = 0x24b5;
  19056. t.zretroflexhook = 0x0290;
  19057. t.zstroke = 0x01b6;
  19058. t.zuhiragana = 0x305a;
  19059. t.zukatakana = 0x30ba;
  19060. t[".notdef"] = 0x0000;
  19061. t.angbracketleftbig = 0x2329;
  19062. t.angbracketleftBig = 0x2329;
  19063. t.angbracketleftbigg = 0x2329;
  19064. t.angbracketleftBigg = 0x2329;
  19065. t.angbracketrightBig = 0x232a;
  19066. t.angbracketrightbig = 0x232a;
  19067. t.angbracketrightBigg = 0x232a;
  19068. t.angbracketrightbigg = 0x232a;
  19069. t.arrowhookleft = 0x21aa;
  19070. t.arrowhookright = 0x21a9;
  19071. t.arrowlefttophalf = 0x21bc;
  19072. t.arrowleftbothalf = 0x21bd;
  19073. t.arrownortheast = 0x2197;
  19074. t.arrownorthwest = 0x2196;
  19075. t.arrowrighttophalf = 0x21c0;
  19076. t.arrowrightbothalf = 0x21c1;
  19077. t.arrowsoutheast = 0x2198;
  19078. t.arrowsouthwest = 0x2199;
  19079. t.backslashbig = 0x2216;
  19080. t.backslashBig = 0x2216;
  19081. t.backslashBigg = 0x2216;
  19082. t.backslashbigg = 0x2216;
  19083. t.bardbl = 0x2016;
  19084. t.bracehtipdownleft = 0xfe37;
  19085. t.bracehtipdownright = 0xfe37;
  19086. t.bracehtipupleft = 0xfe38;
  19087. t.bracehtipupright = 0xfe38;
  19088. t.braceleftBig = 0x007b;
  19089. t.braceleftbig = 0x007b;
  19090. t.braceleftbigg = 0x007b;
  19091. t.braceleftBigg = 0x007b;
  19092. t.bracerightBig = 0x007d;
  19093. t.bracerightbig = 0x007d;
  19094. t.bracerightbigg = 0x007d;
  19095. t.bracerightBigg = 0x007d;
  19096. t.bracketleftbig = 0x005b;
  19097. t.bracketleftBig = 0x005b;
  19098. t.bracketleftbigg = 0x005b;
  19099. t.bracketleftBigg = 0x005b;
  19100. t.bracketrightBig = 0x005d;
  19101. t.bracketrightbig = 0x005d;
  19102. t.bracketrightbigg = 0x005d;
  19103. t.bracketrightBigg = 0x005d;
  19104. t.ceilingleftbig = 0x2308;
  19105. t.ceilingleftBig = 0x2308;
  19106. t.ceilingleftBigg = 0x2308;
  19107. t.ceilingleftbigg = 0x2308;
  19108. t.ceilingrightbig = 0x2309;
  19109. t.ceilingrightBig = 0x2309;
  19110. t.ceilingrightbigg = 0x2309;
  19111. t.ceilingrightBigg = 0x2309;
  19112. t.circledotdisplay = 0x2299;
  19113. t.circledottext = 0x2299;
  19114. t.circlemultiplydisplay = 0x2297;
  19115. t.circlemultiplytext = 0x2297;
  19116. t.circleplusdisplay = 0x2295;
  19117. t.circleplustext = 0x2295;
  19118. t.contintegraldisplay = 0x222e;
  19119. t.contintegraltext = 0x222e;
  19120. t.coproductdisplay = 0x2210;
  19121. t.coproducttext = 0x2210;
  19122. t.floorleftBig = 0x230a;
  19123. t.floorleftbig = 0x230a;
  19124. t.floorleftbigg = 0x230a;
  19125. t.floorleftBigg = 0x230a;
  19126. t.floorrightbig = 0x230b;
  19127. t.floorrightBig = 0x230b;
  19128. t.floorrightBigg = 0x230b;
  19129. t.floorrightbigg = 0x230b;
  19130. t.hatwide = 0x0302;
  19131. t.hatwider = 0x0302;
  19132. t.hatwidest = 0x0302;
  19133. t.intercal = 0x1d40;
  19134. t.integraldisplay = 0x222b;
  19135. t.integraltext = 0x222b;
  19136. t.intersectiondisplay = 0x22c2;
  19137. t.intersectiontext = 0x22c2;
  19138. t.logicalanddisplay = 0x2227;
  19139. t.logicalandtext = 0x2227;
  19140. t.logicalordisplay = 0x2228;
  19141. t.logicalortext = 0x2228;
  19142. t.parenleftBig = 0x0028;
  19143. t.parenleftbig = 0x0028;
  19144. t.parenleftBigg = 0x0028;
  19145. t.parenleftbigg = 0x0028;
  19146. t.parenrightBig = 0x0029;
  19147. t.parenrightbig = 0x0029;
  19148. t.parenrightBigg = 0x0029;
  19149. t.parenrightbigg = 0x0029;
  19150. t.prime = 0x2032;
  19151. t.productdisplay = 0x220f;
  19152. t.producttext = 0x220f;
  19153. t.radicalbig = 0x221a;
  19154. t.radicalBig = 0x221a;
  19155. t.radicalBigg = 0x221a;
  19156. t.radicalbigg = 0x221a;
  19157. t.radicalbt = 0x221a;
  19158. t.radicaltp = 0x221a;
  19159. t.radicalvertex = 0x221a;
  19160. t.slashbig = 0x002f;
  19161. t.slashBig = 0x002f;
  19162. t.slashBigg = 0x002f;
  19163. t.slashbigg = 0x002f;
  19164. t.summationdisplay = 0x2211;
  19165. t.summationtext = 0x2211;
  19166. t.tildewide = 0x02dc;
  19167. t.tildewider = 0x02dc;
  19168. t.tildewidest = 0x02dc;
  19169. t.uniondisplay = 0x22c3;
  19170. t.unionmultidisplay = 0x228e;
  19171. t.unionmultitext = 0x228e;
  19172. t.unionsqdisplay = 0x2294;
  19173. t.unionsqtext = 0x2294;
  19174. t.uniontext = 0x22c3;
  19175. t.vextenddouble = 0x2225;
  19176. t.vextendsingle = 0x2223;
  19177. });
  19178. const getDingbatsGlyphsUnicode = getLookupTableFactory(function (t) {
  19179. t.space = 0x0020;
  19180. t.a1 = 0x2701;
  19181. t.a2 = 0x2702;
  19182. t.a202 = 0x2703;
  19183. t.a3 = 0x2704;
  19184. t.a4 = 0x260e;
  19185. t.a5 = 0x2706;
  19186. t.a119 = 0x2707;
  19187. t.a118 = 0x2708;
  19188. t.a117 = 0x2709;
  19189. t.a11 = 0x261b;
  19190. t.a12 = 0x261e;
  19191. t.a13 = 0x270c;
  19192. t.a14 = 0x270d;
  19193. t.a15 = 0x270e;
  19194. t.a16 = 0x270f;
  19195. t.a105 = 0x2710;
  19196. t.a17 = 0x2711;
  19197. t.a18 = 0x2712;
  19198. t.a19 = 0x2713;
  19199. t.a20 = 0x2714;
  19200. t.a21 = 0x2715;
  19201. t.a22 = 0x2716;
  19202. t.a23 = 0x2717;
  19203. t.a24 = 0x2718;
  19204. t.a25 = 0x2719;
  19205. t.a26 = 0x271a;
  19206. t.a27 = 0x271b;
  19207. t.a28 = 0x271c;
  19208. t.a6 = 0x271d;
  19209. t.a7 = 0x271e;
  19210. t.a8 = 0x271f;
  19211. t.a9 = 0x2720;
  19212. t.a10 = 0x2721;
  19213. t.a29 = 0x2722;
  19214. t.a30 = 0x2723;
  19215. t.a31 = 0x2724;
  19216. t.a32 = 0x2725;
  19217. t.a33 = 0x2726;
  19218. t.a34 = 0x2727;
  19219. t.a35 = 0x2605;
  19220. t.a36 = 0x2729;
  19221. t.a37 = 0x272a;
  19222. t.a38 = 0x272b;
  19223. t.a39 = 0x272c;
  19224. t.a40 = 0x272d;
  19225. t.a41 = 0x272e;
  19226. t.a42 = 0x272f;
  19227. t.a43 = 0x2730;
  19228. t.a44 = 0x2731;
  19229. t.a45 = 0x2732;
  19230. t.a46 = 0x2733;
  19231. t.a47 = 0x2734;
  19232. t.a48 = 0x2735;
  19233. t.a49 = 0x2736;
  19234. t.a50 = 0x2737;
  19235. t.a51 = 0x2738;
  19236. t.a52 = 0x2739;
  19237. t.a53 = 0x273a;
  19238. t.a54 = 0x273b;
  19239. t.a55 = 0x273c;
  19240. t.a56 = 0x273d;
  19241. t.a57 = 0x273e;
  19242. t.a58 = 0x273f;
  19243. t.a59 = 0x2740;
  19244. t.a60 = 0x2741;
  19245. t.a61 = 0x2742;
  19246. t.a62 = 0x2743;
  19247. t.a63 = 0x2744;
  19248. t.a64 = 0x2745;
  19249. t.a65 = 0x2746;
  19250. t.a66 = 0x2747;
  19251. t.a67 = 0x2748;
  19252. t.a68 = 0x2749;
  19253. t.a69 = 0x274a;
  19254. t.a70 = 0x274b;
  19255. t.a71 = 0x25cf;
  19256. t.a72 = 0x274d;
  19257. t.a73 = 0x25a0;
  19258. t.a74 = 0x274f;
  19259. t.a203 = 0x2750;
  19260. t.a75 = 0x2751;
  19261. t.a204 = 0x2752;
  19262. t.a76 = 0x25b2;
  19263. t.a77 = 0x25bc;
  19264. t.a78 = 0x25c6;
  19265. t.a79 = 0x2756;
  19266. t.a81 = 0x25d7;
  19267. t.a82 = 0x2758;
  19268. t.a83 = 0x2759;
  19269. t.a84 = 0x275a;
  19270. t.a97 = 0x275b;
  19271. t.a98 = 0x275c;
  19272. t.a99 = 0x275d;
  19273. t.a100 = 0x275e;
  19274. t.a101 = 0x2761;
  19275. t.a102 = 0x2762;
  19276. t.a103 = 0x2763;
  19277. t.a104 = 0x2764;
  19278. t.a106 = 0x2765;
  19279. t.a107 = 0x2766;
  19280. t.a108 = 0x2767;
  19281. t.a112 = 0x2663;
  19282. t.a111 = 0x2666;
  19283. t.a110 = 0x2665;
  19284. t.a109 = 0x2660;
  19285. t.a120 = 0x2460;
  19286. t.a121 = 0x2461;
  19287. t.a122 = 0x2462;
  19288. t.a123 = 0x2463;
  19289. t.a124 = 0x2464;
  19290. t.a125 = 0x2465;
  19291. t.a126 = 0x2466;
  19292. t.a127 = 0x2467;
  19293. t.a128 = 0x2468;
  19294. t.a129 = 0x2469;
  19295. t.a130 = 0x2776;
  19296. t.a131 = 0x2777;
  19297. t.a132 = 0x2778;
  19298. t.a133 = 0x2779;
  19299. t.a134 = 0x277a;
  19300. t.a135 = 0x277b;
  19301. t.a136 = 0x277c;
  19302. t.a137 = 0x277d;
  19303. t.a138 = 0x277e;
  19304. t.a139 = 0x277f;
  19305. t.a140 = 0x2780;
  19306. t.a141 = 0x2781;
  19307. t.a142 = 0x2782;
  19308. t.a143 = 0x2783;
  19309. t.a144 = 0x2784;
  19310. t.a145 = 0x2785;
  19311. t.a146 = 0x2786;
  19312. t.a147 = 0x2787;
  19313. t.a148 = 0x2788;
  19314. t.a149 = 0x2789;
  19315. t.a150 = 0x278a;
  19316. t.a151 = 0x278b;
  19317. t.a152 = 0x278c;
  19318. t.a153 = 0x278d;
  19319. t.a154 = 0x278e;
  19320. t.a155 = 0x278f;
  19321. t.a156 = 0x2790;
  19322. t.a157 = 0x2791;
  19323. t.a158 = 0x2792;
  19324. t.a159 = 0x2793;
  19325. t.a160 = 0x2794;
  19326. t.a161 = 0x2192;
  19327. t.a163 = 0x2194;
  19328. t.a164 = 0x2195;
  19329. t.a196 = 0x2798;
  19330. t.a165 = 0x2799;
  19331. t.a192 = 0x279a;
  19332. t.a166 = 0x279b;
  19333. t.a167 = 0x279c;
  19334. t.a168 = 0x279d;
  19335. t.a169 = 0x279e;
  19336. t.a170 = 0x279f;
  19337. t.a171 = 0x27a0;
  19338. t.a172 = 0x27a1;
  19339. t.a173 = 0x27a2;
  19340. t.a162 = 0x27a3;
  19341. t.a174 = 0x27a4;
  19342. t.a175 = 0x27a5;
  19343. t.a176 = 0x27a6;
  19344. t.a177 = 0x27a7;
  19345. t.a178 = 0x27a8;
  19346. t.a179 = 0x27a9;
  19347. t.a193 = 0x27aa;
  19348. t.a180 = 0x27ab;
  19349. t.a199 = 0x27ac;
  19350. t.a181 = 0x27ad;
  19351. t.a200 = 0x27ae;
  19352. t.a182 = 0x27af;
  19353. t.a201 = 0x27b1;
  19354. t.a183 = 0x27b2;
  19355. t.a184 = 0x27b3;
  19356. t.a197 = 0x27b4;
  19357. t.a185 = 0x27b5;
  19358. t.a194 = 0x27b6;
  19359. t.a198 = 0x27b7;
  19360. t.a186 = 0x27b8;
  19361. t.a195 = 0x27b9;
  19362. t.a187 = 0x27ba;
  19363. t.a188 = 0x27bb;
  19364. t.a189 = 0x27bc;
  19365. t.a190 = 0x27bd;
  19366. t.a191 = 0x27be;
  19367. t.a89 = 0x2768;
  19368. t.a90 = 0x2769;
  19369. t.a93 = 0x276a;
  19370. t.a94 = 0x276b;
  19371. t.a91 = 0x276c;
  19372. t.a92 = 0x276d;
  19373. t.a205 = 0x276e;
  19374. t.a85 = 0x276f;
  19375. t.a206 = 0x2770;
  19376. t.a86 = 0x2771;
  19377. t.a87 = 0x2772;
  19378. t.a88 = 0x2773;
  19379. t.a95 = 0x2774;
  19380. t.a96 = 0x2775;
  19381. t[".notdef"] = 0x0000;
  19382. });
  19383. ;// ./src/core/unicode.js
  19384. const getSpecialPUASymbols = getLookupTableFactory(function (t) {
  19385. t[63721] = 0x00a9;
  19386. t[63193] = 0x00a9;
  19387. t[63720] = 0x00ae;
  19388. t[63194] = 0x00ae;
  19389. t[63722] = 0x2122;
  19390. t[63195] = 0x2122;
  19391. t[63729] = 0x23a7;
  19392. t[63730] = 0x23a8;
  19393. t[63731] = 0x23a9;
  19394. t[63740] = 0x23ab;
  19395. t[63741] = 0x23ac;
  19396. t[63742] = 0x23ad;
  19397. t[63726] = 0x23a1;
  19398. t[63727] = 0x23a2;
  19399. t[63728] = 0x23a3;
  19400. t[63737] = 0x23a4;
  19401. t[63738] = 0x23a5;
  19402. t[63739] = 0x23a6;
  19403. t[63723] = 0x239b;
  19404. t[63724] = 0x239c;
  19405. t[63725] = 0x239d;
  19406. t[63734] = 0x239e;
  19407. t[63735] = 0x239f;
  19408. t[63736] = 0x23a0;
  19409. });
  19410. function mapSpecialUnicodeValues(code) {
  19411. if (code >= 0xfff0 && code <= 0xffff) {
  19412. return 0;
  19413. } else if (code >= 0xf600 && code <= 0xf8ff) {
  19414. return getSpecialPUASymbols()[code] || code;
  19415. } else if (code === 0x00ad) {
  19416. return 0x002d;
  19417. }
  19418. return code;
  19419. }
  19420. function getUnicodeForGlyph(name, glyphsUnicodeMap) {
  19421. let unicode = glyphsUnicodeMap[name];
  19422. if (unicode !== undefined) {
  19423. return unicode;
  19424. }
  19425. if (!name) {
  19426. return -1;
  19427. }
  19428. if (name[0] === "u") {
  19429. const nameLen = name.length;
  19430. let hexStr;
  19431. if (nameLen === 7 && name[1] === "n" && name[2] === "i") {
  19432. hexStr = name.substring(3);
  19433. } else if (nameLen >= 5 && nameLen <= 7) {
  19434. hexStr = name.substring(1);
  19435. } else {
  19436. return -1;
  19437. }
  19438. if (hexStr === hexStr.toUpperCase()) {
  19439. unicode = parseInt(hexStr, 16);
  19440. if (unicode >= 0) {
  19441. return unicode;
  19442. }
  19443. }
  19444. }
  19445. return -1;
  19446. }
  19447. const UnicodeRanges = [[0x0000, 0x007f], [0x0080, 0x00ff], [0x0100, 0x017f], [0x0180, 0x024f], [0x0250, 0x02af, 0x1d00, 0x1d7f, 0x1d80, 0x1dbf], [0x02b0, 0x02ff, 0xa700, 0xa71f], [0x0300, 0x036f, 0x1dc0, 0x1dff], [0x0370, 0x03ff], [0x2c80, 0x2cff], [0x0400, 0x04ff, 0x0500, 0x052f, 0x2de0, 0x2dff, 0xa640, 0xa69f], [0x0530, 0x058f], [0x0590, 0x05ff], [0xa500, 0xa63f], [0x0600, 0x06ff, 0x0750, 0x077f], [0x07c0, 0x07ff], [0x0900, 0x097f], [0x0980, 0x09ff], [0x0a00, 0x0a7f], [0x0a80, 0x0aff], [0x0b00, 0x0b7f], [0x0b80, 0x0bff], [0x0c00, 0x0c7f], [0x0c80, 0x0cff], [0x0d00, 0x0d7f], [0x0e00, 0x0e7f], [0x0e80, 0x0eff], [0x10a0, 0x10ff, 0x2d00, 0x2d2f], [0x1b00, 0x1b7f], [0x1100, 0x11ff], [0x1e00, 0x1eff, 0x2c60, 0x2c7f, 0xa720, 0xa7ff], [0x1f00, 0x1fff], [0x2000, 0x206f, 0x2e00, 0x2e7f], [0x2070, 0x209f], [0x20a0, 0x20cf], [0x20d0, 0x20ff], [0x2100, 0x214f], [0x2150, 0x218f], [0x2190, 0x21ff, 0x27f0, 0x27ff, 0x2900, 0x297f, 0x2b00, 0x2bff], [0x2200, 0x22ff, 0x2a00, 0x2aff, 0x27c0, 0x27ef, 0x2980, 0x29ff], [0x2300, 0x23ff], [0x2400, 0x243f], [0x2440, 0x245f], [0x2460, 0x24ff], [0x2500, 0x257f], [0x2580, 0x259f], [0x25a0, 0x25ff], [0x2600, 0x26ff], [0x2700, 0x27bf], [0x3000, 0x303f], [0x3040, 0x309f], [0x30a0, 0x30ff, 0x31f0, 0x31ff], [0x3100, 0x312f, 0x31a0, 0x31bf], [0x3130, 0x318f], [0xa840, 0xa87f], [0x3200, 0x32ff], [0x3300, 0x33ff], [0xac00, 0xd7af], [0xd800, 0xdfff], [0x10900, 0x1091f], [0x4e00, 0x9fff, 0x2e80, 0x2eff, 0x2f00, 0x2fdf, 0x2ff0, 0x2fff, 0x3400, 0x4dbf, 0x20000, 0x2a6df, 0x3190, 0x319f], [0xe000, 0xf8ff], [0x31c0, 0x31ef, 0xf900, 0xfaff, 0x2f800, 0x2fa1f], [0xfb00, 0xfb4f], [0xfb50, 0xfdff], [0xfe20, 0xfe2f], [0xfe10, 0xfe1f], [0xfe50, 0xfe6f], [0xfe70, 0xfeff], [0xff00, 0xffef], [0xfff0, 0xffff], [0x0f00, 0x0fff], [0x0700, 0x074f], [0x0780, 0x07bf], [0x0d80, 0x0dff], [0x1000, 0x109f], [0x1200, 0x137f, 0x1380, 0x139f, 0x2d80, 0x2ddf], [0x13a0, 0x13ff], [0x1400, 0x167f], [0x1680, 0x169f], [0x16a0, 0x16ff], [0x1780, 0x17ff], [0x1800, 0x18af], [0x2800, 0x28ff], [0xa000, 0xa48f], [0x1700, 0x171f, 0x1720, 0x173f, 0x1740, 0x175f, 0x1760, 0x177f], [0x10300, 0x1032f], [0x10330, 0x1034f], [0x10400, 0x1044f], [0x1d000, 0x1d0ff, 0x1d100, 0x1d1ff, 0x1d200, 0x1d24f], [0x1d400, 0x1d7ff], [0xff000, 0xffffd], [0xfe00, 0xfe0f, 0xe0100, 0xe01ef], [0xe0000, 0xe007f], [0x1900, 0x194f], [0x1950, 0x197f], [0x1980, 0x19df], [0x1a00, 0x1a1f], [0x2c00, 0x2c5f], [0x2d30, 0x2d7f], [0x4dc0, 0x4dff], [0xa800, 0xa82f], [0x10000, 0x1007f, 0x10080, 0x100ff, 0x10100, 0x1013f], [0x10140, 0x1018f], [0x10380, 0x1039f], [0x103a0, 0x103df], [0x10450, 0x1047f], [0x10480, 0x104af], [0x10800, 0x1083f], [0x10a00, 0x10a5f], [0x1d300, 0x1d35f], [0x12000, 0x123ff, 0x12400, 0x1247f], [0x1d360, 0x1d37f], [0x1b80, 0x1bbf], [0x1c00, 0x1c4f], [0x1c50, 0x1c7f], [0xa880, 0xa8df], [0xa900, 0xa92f], [0xa930, 0xa95f], [0xaa00, 0xaa5f], [0x10190, 0x101cf], [0x101d0, 0x101ff], [0x102a0, 0x102df, 0x10280, 0x1029f, 0x10920, 0x1093f], [0x1f030, 0x1f09f, 0x1f000, 0x1f02f]];
  19448. function getUnicodeRangeFor(value, lastPosition = -1) {
  19449. if (lastPosition !== -1) {
  19450. const range = UnicodeRanges[lastPosition];
  19451. for (let i = 0, ii = range.length; i < ii; i += 2) {
  19452. if (value >= range[i] && value <= range[i + 1]) {
  19453. return lastPosition;
  19454. }
  19455. }
  19456. }
  19457. for (let i = 0, ii = UnicodeRanges.length; i < ii; i++) {
  19458. const range = UnicodeRanges[i];
  19459. for (let j = 0, jj = range.length; j < jj; j += 2) {
  19460. if (value >= range[j] && value <= range[j + 1]) {
  19461. return i;
  19462. }
  19463. }
  19464. }
  19465. return -1;
  19466. }
  19467. const SpecialCharRegExp = new RegExp("^(\\s)|(\\p{Mn})|(\\p{Cf})$", "u");
  19468. const CategoryCache = new Map();
  19469. function getCharUnicodeCategory(char) {
  19470. const cachedCategory = CategoryCache.get(char);
  19471. if (cachedCategory) {
  19472. return cachedCategory;
  19473. }
  19474. const groups = char.match(SpecialCharRegExp);
  19475. const category = {
  19476. isWhitespace: !!groups?.[1],
  19477. isZeroWidthDiacritic: !!groups?.[2],
  19478. isInvisibleFormatMark: !!groups?.[3]
  19479. };
  19480. CategoryCache.set(char, category);
  19481. return category;
  19482. }
  19483. function clearUnicodeCaches() {
  19484. CategoryCache.clear();
  19485. }
  19486. ;// ./src/core/fonts_utils.js
  19487. const SEAC_ANALYSIS_ENABLED = true;
  19488. const FontFlags = {
  19489. FixedPitch: 1,
  19490. Serif: 2,
  19491. Symbolic: 4,
  19492. Script: 8,
  19493. Nonsymbolic: 32,
  19494. Italic: 64,
  19495. AllCap: 65536,
  19496. SmallCap: 131072,
  19497. ForceBold: 262144
  19498. };
  19499. const MacStandardGlyphOrdering = [".notdef", ".null", "nonmarkingreturn", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "Adieresis", "Aring", "Ccedilla", "Eacute", "Ntilde", "Odieresis", "Udieresis", "aacute", "agrave", "acircumflex", "adieresis", "atilde", "aring", "ccedilla", "eacute", "egrave", "ecircumflex", "edieresis", "iacute", "igrave", "icircumflex", "idieresis", "ntilde", "oacute", "ograve", "ocircumflex", "odieresis", "otilde", "uacute", "ugrave", "ucircumflex", "udieresis", "dagger", "degree", "cent", "sterling", "section", "bullet", "paragraph", "germandbls", "registered", "copyright", "trademark", "acute", "dieresis", "notequal", "AE", "Oslash", "infinity", "plusminus", "lessequal", "greaterequal", "yen", "mu", "partialdiff", "summation", "product", "pi", "integral", "ordfeminine", "ordmasculine", "Omega", "ae", "oslash", "questiondown", "exclamdown", "logicalnot", "radical", "florin", "approxequal", "Delta", "guillemotleft", "guillemotright", "ellipsis", "nonbreakingspace", "Agrave", "Atilde", "Otilde", "OE", "oe", "endash", "emdash", "quotedblleft", "quotedblright", "quoteleft", "quoteright", "divide", "lozenge", "ydieresis", "Ydieresis", "fraction", "currency", "guilsinglleft", "guilsinglright", "fi", "fl", "daggerdbl", "periodcentered", "quotesinglbase", "quotedblbase", "perthousand", "Acircumflex", "Ecircumflex", "Aacute", "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Oacute", "Ocircumflex", "apple", "Ograve", "Uacute", "Ucircumflex", "Ugrave", "dotlessi", "circumflex", "tilde", "macron", "breve", "dotaccent", "ring", "cedilla", "hungarumlaut", "ogonek", "caron", "Lslash", "lslash", "Scaron", "scaron", "Zcaron", "zcaron", "brokenbar", "Eth", "eth", "Yacute", "yacute", "Thorn", "thorn", "minus", "multiply", "onesuperior", "twosuperior", "threesuperior", "onehalf", "onequarter", "threequarters", "franc", "Gbreve", "gbreve", "Idotaccent", "Scedilla", "scedilla", "Cacute", "cacute", "Ccaron", "ccaron", "dcroat"];
  19500. function recoverGlyphName(name, glyphsUnicodeMap) {
  19501. if (glyphsUnicodeMap[name] !== undefined) {
  19502. return name;
  19503. }
  19504. const unicode = getUnicodeForGlyph(name, glyphsUnicodeMap);
  19505. if (unicode !== -1) {
  19506. for (const key in glyphsUnicodeMap) {
  19507. if (glyphsUnicodeMap[key] === unicode) {
  19508. return key;
  19509. }
  19510. }
  19511. }
  19512. info("Unable to recover a standard glyph name for: " + name);
  19513. return name;
  19514. }
  19515. function type1FontGlyphMapping(properties, builtInEncoding, glyphNames) {
  19516. const charCodeToGlyphId = Object.create(null);
  19517. let glyphId, charCode, baseEncoding;
  19518. const isSymbolicFont = !!(properties.flags & FontFlags.Symbolic);
  19519. if (properties.isInternalFont) {
  19520. baseEncoding = builtInEncoding;
  19521. for (charCode = 0; charCode < baseEncoding.length; charCode++) {
  19522. glyphId = glyphNames.indexOf(baseEncoding[charCode]);
  19523. charCodeToGlyphId[charCode] = glyphId >= 0 ? glyphId : 0;
  19524. }
  19525. } else if (properties.baseEncodingName) {
  19526. baseEncoding = getEncoding(properties.baseEncodingName);
  19527. for (charCode = 0; charCode < baseEncoding.length; charCode++) {
  19528. glyphId = glyphNames.indexOf(baseEncoding[charCode]);
  19529. charCodeToGlyphId[charCode] = glyphId >= 0 ? glyphId : 0;
  19530. }
  19531. } else if (isSymbolicFont) {
  19532. for (charCode in builtInEncoding) {
  19533. charCodeToGlyphId[charCode] = builtInEncoding[charCode];
  19534. }
  19535. } else {
  19536. baseEncoding = StandardEncoding;
  19537. for (charCode = 0; charCode < baseEncoding.length; charCode++) {
  19538. glyphId = glyphNames.indexOf(baseEncoding[charCode]);
  19539. charCodeToGlyphId[charCode] = glyphId >= 0 ? glyphId : 0;
  19540. }
  19541. }
  19542. const differences = properties.differences;
  19543. let glyphsUnicodeMap;
  19544. if (differences) {
  19545. for (charCode in differences) {
  19546. const glyphName = differences[charCode];
  19547. glyphId = glyphNames.indexOf(glyphName);
  19548. if (glyphId === -1) {
  19549. if (!glyphsUnicodeMap) {
  19550. glyphsUnicodeMap = getGlyphsUnicode();
  19551. }
  19552. const standardGlyphName = recoverGlyphName(glyphName, glyphsUnicodeMap);
  19553. if (standardGlyphName !== glyphName) {
  19554. glyphId = glyphNames.indexOf(standardGlyphName);
  19555. }
  19556. }
  19557. charCodeToGlyphId[charCode] = glyphId >= 0 ? glyphId : 0;
  19558. }
  19559. }
  19560. return charCodeToGlyphId;
  19561. }
  19562. function normalizeFontName(name) {
  19563. return name.replaceAll(/[,_]/g, "-").replaceAll(/\s/g, "");
  19564. }
  19565. const getVerticalPresentationForm = getLookupTableFactory(t => {
  19566. t[0x2013] = 0xfe32;
  19567. t[0x2014] = 0xfe31;
  19568. t[0x2025] = 0xfe30;
  19569. t[0x2026] = 0xfe19;
  19570. t[0x3001] = 0xfe11;
  19571. t[0x3002] = 0xfe12;
  19572. t[0x3008] = 0xfe3f;
  19573. t[0x3009] = 0xfe40;
  19574. t[0x300a] = 0xfe3d;
  19575. t[0x300b] = 0xfe3e;
  19576. t[0x300c] = 0xfe41;
  19577. t[0x300d] = 0xfe42;
  19578. t[0x300e] = 0xfe43;
  19579. t[0x300f] = 0xfe44;
  19580. t[0x3010] = 0xfe3b;
  19581. t[0x3011] = 0xfe3c;
  19582. t[0x3014] = 0xfe39;
  19583. t[0x3015] = 0xfe3a;
  19584. t[0x3016] = 0xfe17;
  19585. t[0x3017] = 0xfe18;
  19586. t[0xfe4f] = 0xfe34;
  19587. t[0xff01] = 0xfe15;
  19588. t[0xff08] = 0xfe35;
  19589. t[0xff09] = 0xfe36;
  19590. t[0xff0c] = 0xfe10;
  19591. t[0xff1a] = 0xfe13;
  19592. t[0xff1b] = 0xfe14;
  19593. t[0xff1f] = 0xfe16;
  19594. t[0xff3b] = 0xfe47;
  19595. t[0xff3d] = 0xfe48;
  19596. t[0xff3f] = 0xfe33;
  19597. t[0xff5b] = 0xfe37;
  19598. t[0xff5d] = 0xfe38;
  19599. });
  19600. ;// ./src/core/standard_fonts.js
  19601. const getStdFontMap = getLookupTableFactory(function (t) {
  19602. t["Times-Roman"] = "Times-Roman";
  19603. t.Helvetica = "Helvetica";
  19604. t.Courier = "Courier";
  19605. t.Symbol = "Symbol";
  19606. t["Times-Bold"] = "Times-Bold";
  19607. t["Helvetica-Bold"] = "Helvetica-Bold";
  19608. t["Courier-Bold"] = "Courier-Bold";
  19609. t.ZapfDingbats = "ZapfDingbats";
  19610. t["Times-Italic"] = "Times-Italic";
  19611. t["Helvetica-Oblique"] = "Helvetica-Oblique";
  19612. t["Courier-Oblique"] = "Courier-Oblique";
  19613. t["Times-BoldItalic"] = "Times-BoldItalic";
  19614. t["Helvetica-BoldOblique"] = "Helvetica-BoldOblique";
  19615. t["Courier-BoldOblique"] = "Courier-BoldOblique";
  19616. t.ArialNarrow = "Helvetica";
  19617. t["ArialNarrow-Bold"] = "Helvetica-Bold";
  19618. t["ArialNarrow-BoldItalic"] = "Helvetica-BoldOblique";
  19619. t["ArialNarrow-Italic"] = "Helvetica-Oblique";
  19620. t.ArialBlack = "Helvetica";
  19621. t["ArialBlack-Bold"] = "Helvetica-Bold";
  19622. t["ArialBlack-BoldItalic"] = "Helvetica-BoldOblique";
  19623. t["ArialBlack-Italic"] = "Helvetica-Oblique";
  19624. t["Arial-Black"] = "Helvetica";
  19625. t["Arial-Black-Bold"] = "Helvetica-Bold";
  19626. t["Arial-Black-BoldItalic"] = "Helvetica-BoldOblique";
  19627. t["Arial-Black-Italic"] = "Helvetica-Oblique";
  19628. t.Arial = "Helvetica";
  19629. t["Arial-Bold"] = "Helvetica-Bold";
  19630. t["Arial-BoldItalic"] = "Helvetica-BoldOblique";
  19631. t["Arial-Italic"] = "Helvetica-Oblique";
  19632. t.ArialMT = "Helvetica";
  19633. t["Arial-BoldItalicMT"] = "Helvetica-BoldOblique";
  19634. t["Arial-BoldMT"] = "Helvetica-Bold";
  19635. t["Arial-ItalicMT"] = "Helvetica-Oblique";
  19636. t["Arial-BoldItalicMT-BoldItalic"] = "Helvetica-BoldOblique";
  19637. t["Arial-BoldMT-Bold"] = "Helvetica-Bold";
  19638. t["Arial-ItalicMT-Italic"] = "Helvetica-Oblique";
  19639. t.ArialUnicodeMS = "Helvetica";
  19640. t["ArialUnicodeMS-Bold"] = "Helvetica-Bold";
  19641. t["ArialUnicodeMS-BoldItalic"] = "Helvetica-BoldOblique";
  19642. t["ArialUnicodeMS-Italic"] = "Helvetica-Oblique";
  19643. t["Courier-BoldItalic"] = "Courier-BoldOblique";
  19644. t["Courier-Italic"] = "Courier-Oblique";
  19645. t.CourierNew = "Courier";
  19646. t["CourierNew-Bold"] = "Courier-Bold";
  19647. t["CourierNew-BoldItalic"] = "Courier-BoldOblique";
  19648. t["CourierNew-Italic"] = "Courier-Oblique";
  19649. t["CourierNewPS-BoldItalicMT"] = "Courier-BoldOblique";
  19650. t["CourierNewPS-BoldMT"] = "Courier-Bold";
  19651. t["CourierNewPS-ItalicMT"] = "Courier-Oblique";
  19652. t.CourierNewPSMT = "Courier";
  19653. t["Helvetica-BoldItalic"] = "Helvetica-BoldOblique";
  19654. t["Helvetica-Italic"] = "Helvetica-Oblique";
  19655. t["Symbol-Bold"] = "Symbol";
  19656. t["Symbol-BoldItalic"] = "Symbol";
  19657. t["Symbol-Italic"] = "Symbol";
  19658. t.TimesNewRoman = "Times-Roman";
  19659. t["TimesNewRoman-Bold"] = "Times-Bold";
  19660. t["TimesNewRoman-BoldItalic"] = "Times-BoldItalic";
  19661. t["TimesNewRoman-Italic"] = "Times-Italic";
  19662. t.TimesNewRomanPS = "Times-Roman";
  19663. t["TimesNewRomanPS-Bold"] = "Times-Bold";
  19664. t["TimesNewRomanPS-BoldItalic"] = "Times-BoldItalic";
  19665. t["TimesNewRomanPS-BoldItalicMT"] = "Times-BoldItalic";
  19666. t["TimesNewRomanPS-BoldMT"] = "Times-Bold";
  19667. t["TimesNewRomanPS-Italic"] = "Times-Italic";
  19668. t["TimesNewRomanPS-ItalicMT"] = "Times-Italic";
  19669. t.TimesNewRomanPSMT = "Times-Roman";
  19670. t["TimesNewRomanPSMT-Bold"] = "Times-Bold";
  19671. t["TimesNewRomanPSMT-BoldItalic"] = "Times-BoldItalic";
  19672. t["TimesNewRomanPSMT-Italic"] = "Times-Italic";
  19673. });
  19674. const getFontNameToFileMap = getLookupTableFactory(function (t) {
  19675. t.Courier = "FoxitFixed.pfb";
  19676. t["Courier-Bold"] = "FoxitFixedBold.pfb";
  19677. t["Courier-BoldOblique"] = "FoxitFixedBoldItalic.pfb";
  19678. t["Courier-Oblique"] = "FoxitFixedItalic.pfb";
  19679. t.Helvetica = "LiberationSans-Regular.ttf";
  19680. t["Helvetica-Bold"] = "LiberationSans-Bold.ttf";
  19681. t["Helvetica-BoldOblique"] = "LiberationSans-BoldItalic.ttf";
  19682. t["Helvetica-Oblique"] = "LiberationSans-Italic.ttf";
  19683. t["Times-Roman"] = "FoxitSerif.pfb";
  19684. t["Times-Bold"] = "FoxitSerifBold.pfb";
  19685. t["Times-BoldItalic"] = "FoxitSerifBoldItalic.pfb";
  19686. t["Times-Italic"] = "FoxitSerifItalic.pfb";
  19687. t.Symbol = "FoxitSymbol.pfb";
  19688. t.ZapfDingbats = "FoxitDingbats.pfb";
  19689. t["LiberationSans-Regular"] = "LiberationSans-Regular.ttf";
  19690. t["LiberationSans-Bold"] = "LiberationSans-Bold.ttf";
  19691. t["LiberationSans-Italic"] = "LiberationSans-Italic.ttf";
  19692. t["LiberationSans-BoldItalic"] = "LiberationSans-BoldItalic.ttf";
  19693. });
  19694. const getNonStdFontMap = getLookupTableFactory(function (t) {
  19695. t.Calibri = "Helvetica";
  19696. t["Calibri-Bold"] = "Helvetica-Bold";
  19697. t["Calibri-BoldItalic"] = "Helvetica-BoldOblique";
  19698. t["Calibri-Italic"] = "Helvetica-Oblique";
  19699. t.CenturyGothic = "Helvetica";
  19700. t["CenturyGothic-Bold"] = "Helvetica-Bold";
  19701. t["CenturyGothic-BoldItalic"] = "Helvetica-BoldOblique";
  19702. t["CenturyGothic-Italic"] = "Helvetica-Oblique";
  19703. t.ComicSansMS = "Comic Sans MS";
  19704. t["ComicSansMS-Bold"] = "Comic Sans MS-Bold";
  19705. t["ComicSansMS-BoldItalic"] = "Comic Sans MS-BoldItalic";
  19706. t["ComicSansMS-Italic"] = "Comic Sans MS-Italic";
  19707. t.GillSansMT = "Helvetica";
  19708. t["GillSansMT-Bold"] = "Helvetica-Bold";
  19709. t["GillSansMT-BoldItalic"] = "Helvetica-BoldOblique";
  19710. t["GillSansMT-Italic"] = "Helvetica-Oblique";
  19711. t.Impact = "Helvetica";
  19712. t["ItcSymbol-Bold"] = "Helvetica-Bold";
  19713. t["ItcSymbol-BoldItalic"] = "Helvetica-BoldOblique";
  19714. t["ItcSymbol-Book"] = "Helvetica";
  19715. t["ItcSymbol-BookItalic"] = "Helvetica-Oblique";
  19716. t["ItcSymbol-Medium"] = "Helvetica";
  19717. t["ItcSymbol-MediumItalic"] = "Helvetica-Oblique";
  19718. t.LucidaConsole = "Courier";
  19719. t["LucidaConsole-Bold"] = "Courier-Bold";
  19720. t["LucidaConsole-BoldItalic"] = "Courier-BoldOblique";
  19721. t["LucidaConsole-Italic"] = "Courier-Oblique";
  19722. t["LucidaSans-Demi"] = "Helvetica-Bold";
  19723. t["MS-Gothic"] = "MS Gothic";
  19724. t["MS-Gothic-Bold"] = "MS Gothic-Bold";
  19725. t["MS-Gothic-BoldItalic"] = "MS Gothic-BoldItalic";
  19726. t["MS-Gothic-Italic"] = "MS Gothic-Italic";
  19727. t["MS-Mincho"] = "MS Mincho";
  19728. t["MS-Mincho-Bold"] = "MS Mincho-Bold";
  19729. t["MS-Mincho-BoldItalic"] = "MS Mincho-BoldItalic";
  19730. t["MS-Mincho-Italic"] = "MS Mincho-Italic";
  19731. t["MS-PGothic"] = "MS PGothic";
  19732. t["MS-PGothic-Bold"] = "MS PGothic-Bold";
  19733. t["MS-PGothic-BoldItalic"] = "MS PGothic-BoldItalic";
  19734. t["MS-PGothic-Italic"] = "MS PGothic-Italic";
  19735. t["MS-PMincho"] = "MS PMincho";
  19736. t["MS-PMincho-Bold"] = "MS PMincho-Bold";
  19737. t["MS-PMincho-BoldItalic"] = "MS PMincho-BoldItalic";
  19738. t["MS-PMincho-Italic"] = "MS PMincho-Italic";
  19739. t.NuptialScript = "Times-Italic";
  19740. t.SegoeUISymbol = "Helvetica";
  19741. });
  19742. const getSerifFonts = getLookupTableFactory(function (t) {
  19743. t["Adobe Jenson"] = true;
  19744. t["Adobe Text"] = true;
  19745. t.Albertus = true;
  19746. t.Aldus = true;
  19747. t.Alexandria = true;
  19748. t.Algerian = true;
  19749. t["American Typewriter"] = true;
  19750. t.Antiqua = true;
  19751. t.Apex = true;
  19752. t.Arno = true;
  19753. t.Aster = true;
  19754. t.Aurora = true;
  19755. t.Baskerville = true;
  19756. t.Bell = true;
  19757. t.Bembo = true;
  19758. t["Bembo Schoolbook"] = true;
  19759. t.Benguiat = true;
  19760. t["Berkeley Old Style"] = true;
  19761. t["Bernhard Modern"] = true;
  19762. t["Berthold City"] = true;
  19763. t.Bodoni = true;
  19764. t["Bauer Bodoni"] = true;
  19765. t["Book Antiqua"] = true;
  19766. t.Bookman = true;
  19767. t["Bordeaux Roman"] = true;
  19768. t["Californian FB"] = true;
  19769. t.Calisto = true;
  19770. t.Calvert = true;
  19771. t.Capitals = true;
  19772. t.Cambria = true;
  19773. t.Cartier = true;
  19774. t.Caslon = true;
  19775. t.Catull = true;
  19776. t.Centaur = true;
  19777. t["Century Old Style"] = true;
  19778. t["Century Schoolbook"] = true;
  19779. t.Chaparral = true;
  19780. t["Charis SIL"] = true;
  19781. t.Cheltenham = true;
  19782. t["Cholla Slab"] = true;
  19783. t.Clarendon = true;
  19784. t.Clearface = true;
  19785. t.Cochin = true;
  19786. t.Colonna = true;
  19787. t["Computer Modern"] = true;
  19788. t["Concrete Roman"] = true;
  19789. t.Constantia = true;
  19790. t["Cooper Black"] = true;
  19791. t.Corona = true;
  19792. t.Ecotype = true;
  19793. t.Egyptienne = true;
  19794. t.Elephant = true;
  19795. t.Excelsior = true;
  19796. t.Fairfield = true;
  19797. t["FF Scala"] = true;
  19798. t.Folkard = true;
  19799. t.Footlight = true;
  19800. t.FreeSerif = true;
  19801. t["Friz Quadrata"] = true;
  19802. t.Garamond = true;
  19803. t.Gentium = true;
  19804. t.Georgia = true;
  19805. t.Gloucester = true;
  19806. t["Goudy Old Style"] = true;
  19807. t["Goudy Schoolbook"] = true;
  19808. t["Goudy Pro Font"] = true;
  19809. t.Granjon = true;
  19810. t["Guardian Egyptian"] = true;
  19811. t.Heather = true;
  19812. t.Hercules = true;
  19813. t["High Tower Text"] = true;
  19814. t.Hiroshige = true;
  19815. t["Hoefler Text"] = true;
  19816. t["Humana Serif"] = true;
  19817. t.Imprint = true;
  19818. t["Ionic No. 5"] = true;
  19819. t.Janson = true;
  19820. t.Joanna = true;
  19821. t.Korinna = true;
  19822. t.Lexicon = true;
  19823. t.LiberationSerif = true;
  19824. t["Liberation Serif"] = true;
  19825. t["Linux Libertine"] = true;
  19826. t.Literaturnaya = true;
  19827. t.Lucida = true;
  19828. t["Lucida Bright"] = true;
  19829. t.Melior = true;
  19830. t.Memphis = true;
  19831. t.Miller = true;
  19832. t.Minion = true;
  19833. t.Modern = true;
  19834. t["Mona Lisa"] = true;
  19835. t["Mrs Eaves"] = true;
  19836. t["MS Serif"] = true;
  19837. t["Museo Slab"] = true;
  19838. t["New York"] = true;
  19839. t["Nimbus Roman"] = true;
  19840. t["NPS Rawlinson Roadway"] = true;
  19841. t.NuptialScript = true;
  19842. t.Palatino = true;
  19843. t.Perpetua = true;
  19844. t.Plantin = true;
  19845. t["Plantin Schoolbook"] = true;
  19846. t.Playbill = true;
  19847. t["Poor Richard"] = true;
  19848. t["Rawlinson Roadway"] = true;
  19849. t.Renault = true;
  19850. t.Requiem = true;
  19851. t.Rockwell = true;
  19852. t.Roman = true;
  19853. t["Rotis Serif"] = true;
  19854. t.Sabon = true;
  19855. t.Scala = true;
  19856. t.Seagull = true;
  19857. t.Sistina = true;
  19858. t.Souvenir = true;
  19859. t.STIX = true;
  19860. t["Stone Informal"] = true;
  19861. t["Stone Serif"] = true;
  19862. t.Sylfaen = true;
  19863. t.Times = true;
  19864. t.Trajan = true;
  19865. t["Trinité"] = true;
  19866. t["Trump Mediaeval"] = true;
  19867. t.Utopia = true;
  19868. t["Vale Type"] = true;
  19869. t["Bitstream Vera"] = true;
  19870. t["Vera Serif"] = true;
  19871. t.Versailles = true;
  19872. t.Wanted = true;
  19873. t.Weiss = true;
  19874. t["Wide Latin"] = true;
  19875. t.Windsor = true;
  19876. t.XITS = true;
  19877. });
  19878. const getSymbolsFonts = getLookupTableFactory(function (t) {
  19879. t.Dingbats = true;
  19880. t.Symbol = true;
  19881. t.ZapfDingbats = true;
  19882. t.Wingdings = true;
  19883. t["Wingdings-Bold"] = true;
  19884. t["Wingdings-Regular"] = true;
  19885. });
  19886. const getGlyphMapForStandardFonts = getLookupTableFactory(function (t) {
  19887. t[2] = 10;
  19888. t[3] = 32;
  19889. t[4] = 33;
  19890. t[5] = 34;
  19891. t[6] = 35;
  19892. t[7] = 36;
  19893. t[8] = 37;
  19894. t[9] = 38;
  19895. t[10] = 39;
  19896. t[11] = 40;
  19897. t[12] = 41;
  19898. t[13] = 42;
  19899. t[14] = 43;
  19900. t[15] = 44;
  19901. t[16] = 45;
  19902. t[17] = 46;
  19903. t[18] = 47;
  19904. t[19] = 48;
  19905. t[20] = 49;
  19906. t[21] = 50;
  19907. t[22] = 51;
  19908. t[23] = 52;
  19909. t[24] = 53;
  19910. t[25] = 54;
  19911. t[26] = 55;
  19912. t[27] = 56;
  19913. t[28] = 57;
  19914. t[29] = 58;
  19915. t[30] = 894;
  19916. t[31] = 60;
  19917. t[32] = 61;
  19918. t[33] = 62;
  19919. t[34] = 63;
  19920. t[35] = 64;
  19921. t[36] = 65;
  19922. t[37] = 66;
  19923. t[38] = 67;
  19924. t[39] = 68;
  19925. t[40] = 69;
  19926. t[41] = 70;
  19927. t[42] = 71;
  19928. t[43] = 72;
  19929. t[44] = 73;
  19930. t[45] = 74;
  19931. t[46] = 75;
  19932. t[47] = 76;
  19933. t[48] = 77;
  19934. t[49] = 78;
  19935. t[50] = 79;
  19936. t[51] = 80;
  19937. t[52] = 81;
  19938. t[53] = 82;
  19939. t[54] = 83;
  19940. t[55] = 84;
  19941. t[56] = 85;
  19942. t[57] = 86;
  19943. t[58] = 87;
  19944. t[59] = 88;
  19945. t[60] = 89;
  19946. t[61] = 90;
  19947. t[62] = 91;
  19948. t[63] = 92;
  19949. t[64] = 93;
  19950. t[65] = 94;
  19951. t[66] = 95;
  19952. t[67] = 96;
  19953. t[68] = 97;
  19954. t[69] = 98;
  19955. t[70] = 99;
  19956. t[71] = 100;
  19957. t[72] = 101;
  19958. t[73] = 102;
  19959. t[74] = 103;
  19960. t[75] = 104;
  19961. t[76] = 105;
  19962. t[77] = 106;
  19963. t[78] = 107;
  19964. t[79] = 108;
  19965. t[80] = 109;
  19966. t[81] = 110;
  19967. t[82] = 111;
  19968. t[83] = 112;
  19969. t[84] = 113;
  19970. t[85] = 114;
  19971. t[86] = 115;
  19972. t[87] = 116;
  19973. t[88] = 117;
  19974. t[89] = 118;
  19975. t[90] = 119;
  19976. t[91] = 120;
  19977. t[92] = 121;
  19978. t[93] = 122;
  19979. t[94] = 123;
  19980. t[95] = 124;
  19981. t[96] = 125;
  19982. t[97] = 126;
  19983. t[98] = 196;
  19984. t[99] = 197;
  19985. t[100] = 199;
  19986. t[101] = 201;
  19987. t[102] = 209;
  19988. t[103] = 214;
  19989. t[104] = 220;
  19990. t[105] = 225;
  19991. t[106] = 224;
  19992. t[107] = 226;
  19993. t[108] = 228;
  19994. t[109] = 227;
  19995. t[110] = 229;
  19996. t[111] = 231;
  19997. t[112] = 233;
  19998. t[113] = 232;
  19999. t[114] = 234;
  20000. t[115] = 235;
  20001. t[116] = 237;
  20002. t[117] = 236;
  20003. t[118] = 238;
  20004. t[119] = 239;
  20005. t[120] = 241;
  20006. t[121] = 243;
  20007. t[122] = 242;
  20008. t[123] = 244;
  20009. t[124] = 246;
  20010. t[125] = 245;
  20011. t[126] = 250;
  20012. t[127] = 249;
  20013. t[128] = 251;
  20014. t[129] = 252;
  20015. t[130] = 8224;
  20016. t[131] = 176;
  20017. t[132] = 162;
  20018. t[133] = 163;
  20019. t[134] = 167;
  20020. t[135] = 8226;
  20021. t[136] = 182;
  20022. t[137] = 223;
  20023. t[138] = 174;
  20024. t[139] = 169;
  20025. t[140] = 8482;
  20026. t[141] = 180;
  20027. t[142] = 168;
  20028. t[143] = 8800;
  20029. t[144] = 198;
  20030. t[145] = 216;
  20031. t[146] = 8734;
  20032. t[147] = 177;
  20033. t[148] = 8804;
  20034. t[149] = 8805;
  20035. t[150] = 165;
  20036. t[151] = 181;
  20037. t[152] = 8706;
  20038. t[153] = 8721;
  20039. t[154] = 8719;
  20040. t[156] = 8747;
  20041. t[157] = 170;
  20042. t[158] = 186;
  20043. t[159] = 8486;
  20044. t[160] = 230;
  20045. t[161] = 248;
  20046. t[162] = 191;
  20047. t[163] = 161;
  20048. t[164] = 172;
  20049. t[165] = 8730;
  20050. t[166] = 402;
  20051. t[167] = 8776;
  20052. t[168] = 8710;
  20053. t[169] = 171;
  20054. t[170] = 187;
  20055. t[171] = 8230;
  20056. t[179] = 8220;
  20057. t[180] = 8221;
  20058. t[181] = 8216;
  20059. t[182] = 8217;
  20060. t[200] = 193;
  20061. t[203] = 205;
  20062. t[207] = 211;
  20063. t[210] = 218;
  20064. t[223] = 711;
  20065. t[224] = 321;
  20066. t[225] = 322;
  20067. t[226] = 352;
  20068. t[227] = 353;
  20069. t[228] = 381;
  20070. t[229] = 382;
  20071. t[233] = 221;
  20072. t[234] = 253;
  20073. t[252] = 263;
  20074. t[253] = 268;
  20075. t[254] = 269;
  20076. t[258] = 258;
  20077. t[260] = 260;
  20078. t[261] = 261;
  20079. t[265] = 280;
  20080. t[266] = 281;
  20081. t[267] = 282;
  20082. t[268] = 283;
  20083. t[269] = 313;
  20084. t[275] = 323;
  20085. t[276] = 324;
  20086. t[278] = 328;
  20087. t[283] = 344;
  20088. t[284] = 345;
  20089. t[285] = 346;
  20090. t[286] = 347;
  20091. t[292] = 367;
  20092. t[295] = 377;
  20093. t[296] = 378;
  20094. t[298] = 380;
  20095. t[305] = 963;
  20096. t[306] = 964;
  20097. t[307] = 966;
  20098. t[308] = 8215;
  20099. t[309] = 8252;
  20100. t[310] = 8319;
  20101. t[311] = 8359;
  20102. t[312] = 8592;
  20103. t[313] = 8593;
  20104. t[337] = 9552;
  20105. t[493] = 1039;
  20106. t[494] = 1040;
  20107. t[672] = 1488;
  20108. t[673] = 1489;
  20109. t[674] = 1490;
  20110. t[675] = 1491;
  20111. t[676] = 1492;
  20112. t[677] = 1493;
  20113. t[678] = 1494;
  20114. t[679] = 1495;
  20115. t[680] = 1496;
  20116. t[681] = 1497;
  20117. t[682] = 1498;
  20118. t[683] = 1499;
  20119. t[684] = 1500;
  20120. t[685] = 1501;
  20121. t[686] = 1502;
  20122. t[687] = 1503;
  20123. t[688] = 1504;
  20124. t[689] = 1505;
  20125. t[690] = 1506;
  20126. t[691] = 1507;
  20127. t[692] = 1508;
  20128. t[693] = 1509;
  20129. t[694] = 1510;
  20130. t[695] = 1511;
  20131. t[696] = 1512;
  20132. t[697] = 1513;
  20133. t[698] = 1514;
  20134. t[705] = 1524;
  20135. t[706] = 8362;
  20136. t[710] = 64288;
  20137. t[711] = 64298;
  20138. t[759] = 1617;
  20139. t[761] = 1776;
  20140. t[763] = 1778;
  20141. t[775] = 1652;
  20142. t[777] = 1764;
  20143. t[778] = 1780;
  20144. t[779] = 1781;
  20145. t[780] = 1782;
  20146. t[782] = 771;
  20147. t[783] = 64726;
  20148. t[786] = 8363;
  20149. t[788] = 8532;
  20150. t[790] = 768;
  20151. t[791] = 769;
  20152. t[792] = 768;
  20153. t[795] = 803;
  20154. t[797] = 64336;
  20155. t[798] = 64337;
  20156. t[799] = 64342;
  20157. t[800] = 64343;
  20158. t[801] = 64344;
  20159. t[802] = 64345;
  20160. t[803] = 64362;
  20161. t[804] = 64363;
  20162. t[805] = 64364;
  20163. t[2424] = 7821;
  20164. t[2425] = 7822;
  20165. t[2426] = 7823;
  20166. t[2427] = 7824;
  20167. t[2428] = 7825;
  20168. t[2429] = 7826;
  20169. t[2430] = 7827;
  20170. t[2433] = 7682;
  20171. t[2678] = 8045;
  20172. t[2679] = 8046;
  20173. t[2830] = 1552;
  20174. t[2838] = 686;
  20175. t[2840] = 751;
  20176. t[2842] = 753;
  20177. t[2843] = 754;
  20178. t[2844] = 755;
  20179. t[2846] = 757;
  20180. t[2856] = 767;
  20181. t[2857] = 848;
  20182. t[2858] = 849;
  20183. t[2862] = 853;
  20184. t[2863] = 854;
  20185. t[2864] = 855;
  20186. t[2865] = 861;
  20187. t[2866] = 862;
  20188. t[2906] = 7460;
  20189. t[2908] = 7462;
  20190. t[2909] = 7463;
  20191. t[2910] = 7464;
  20192. t[2912] = 7466;
  20193. t[2913] = 7467;
  20194. t[2914] = 7468;
  20195. t[2916] = 7470;
  20196. t[2917] = 7471;
  20197. t[2918] = 7472;
  20198. t[2920] = 7474;
  20199. t[2921] = 7475;
  20200. t[2922] = 7476;
  20201. t[2924] = 7478;
  20202. t[2925] = 7479;
  20203. t[2926] = 7480;
  20204. t[2928] = 7482;
  20205. t[2929] = 7483;
  20206. t[2930] = 7484;
  20207. t[2932] = 7486;
  20208. t[2933] = 7487;
  20209. t[2934] = 7488;
  20210. t[2936] = 7490;
  20211. t[2937] = 7491;
  20212. t[2938] = 7492;
  20213. t[2940] = 7494;
  20214. t[2941] = 7495;
  20215. t[2942] = 7496;
  20216. t[2944] = 7498;
  20217. t[2946] = 7500;
  20218. t[2948] = 7502;
  20219. t[2950] = 7504;
  20220. t[2951] = 7505;
  20221. t[2952] = 7506;
  20222. t[2954] = 7508;
  20223. t[2955] = 7509;
  20224. t[2956] = 7510;
  20225. t[2958] = 7512;
  20226. t[2959] = 7513;
  20227. t[2960] = 7514;
  20228. t[2962] = 7516;
  20229. t[2963] = 7517;
  20230. t[2964] = 7518;
  20231. t[2966] = 7520;
  20232. t[2967] = 7521;
  20233. t[2968] = 7522;
  20234. t[2970] = 7524;
  20235. t[2971] = 7525;
  20236. t[2972] = 7526;
  20237. t[2974] = 7528;
  20238. t[2975] = 7529;
  20239. t[2976] = 7530;
  20240. t[2978] = 1537;
  20241. t[2979] = 1538;
  20242. t[2980] = 1539;
  20243. t[2982] = 1549;
  20244. t[2983] = 1551;
  20245. t[2984] = 1552;
  20246. t[2986] = 1554;
  20247. t[2987] = 1555;
  20248. t[2988] = 1556;
  20249. t[2990] = 1623;
  20250. t[2991] = 1624;
  20251. t[2995] = 1775;
  20252. t[2999] = 1791;
  20253. t[3002] = 64290;
  20254. t[3003] = 64291;
  20255. t[3004] = 64292;
  20256. t[3006] = 64294;
  20257. t[3007] = 64295;
  20258. t[3008] = 64296;
  20259. t[3011] = 1900;
  20260. t[3014] = 8223;
  20261. t[3015] = 8244;
  20262. t[3017] = 7532;
  20263. t[3018] = 7533;
  20264. t[3019] = 7534;
  20265. t[3075] = 7590;
  20266. t[3076] = 7591;
  20267. t[3079] = 7594;
  20268. t[3080] = 7595;
  20269. t[3083] = 7598;
  20270. t[3084] = 7599;
  20271. t[3087] = 7602;
  20272. t[3088] = 7603;
  20273. t[3091] = 7606;
  20274. t[3092] = 7607;
  20275. t[3095] = 7610;
  20276. t[3096] = 7611;
  20277. t[3099] = 7614;
  20278. t[3100] = 7615;
  20279. t[3103] = 7618;
  20280. t[3104] = 7619;
  20281. t[3107] = 8337;
  20282. t[3108] = 8338;
  20283. t[3116] = 1884;
  20284. t[3119] = 1885;
  20285. t[3120] = 1885;
  20286. t[3123] = 1886;
  20287. t[3124] = 1886;
  20288. t[3127] = 1887;
  20289. t[3128] = 1887;
  20290. t[3131] = 1888;
  20291. t[3132] = 1888;
  20292. t[3135] = 1889;
  20293. t[3136] = 1889;
  20294. t[3139] = 1890;
  20295. t[3140] = 1890;
  20296. t[3143] = 1891;
  20297. t[3144] = 1891;
  20298. t[3147] = 1892;
  20299. t[3148] = 1892;
  20300. t[3153] = 580;
  20301. t[3154] = 581;
  20302. t[3157] = 584;
  20303. t[3158] = 585;
  20304. t[3161] = 588;
  20305. t[3162] = 589;
  20306. t[3165] = 891;
  20307. t[3166] = 892;
  20308. t[3169] = 1274;
  20309. t[3170] = 1275;
  20310. t[3173] = 1278;
  20311. t[3174] = 1279;
  20312. t[3181] = 7622;
  20313. t[3182] = 7623;
  20314. t[3282] = 11799;
  20315. t[3316] = 578;
  20316. t[3379] = 42785;
  20317. t[3393] = 1159;
  20318. t[3416] = 8377;
  20319. });
  20320. const getSupplementalGlyphMapForArialBlack = getLookupTableFactory(function (t) {
  20321. t[227] = 322;
  20322. t[264] = 261;
  20323. t[291] = 346;
  20324. });
  20325. const getSupplementalGlyphMapForCalibri = getLookupTableFactory(function (t) {
  20326. t[1] = 32;
  20327. t[4] = 65;
  20328. t[5] = 192;
  20329. t[6] = 193;
  20330. t[9] = 196;
  20331. t[17] = 66;
  20332. t[18] = 67;
  20333. t[21] = 268;
  20334. t[24] = 68;
  20335. t[28] = 69;
  20336. t[29] = 200;
  20337. t[30] = 201;
  20338. t[32] = 282;
  20339. t[38] = 70;
  20340. t[39] = 71;
  20341. t[44] = 72;
  20342. t[47] = 73;
  20343. t[48] = 204;
  20344. t[49] = 205;
  20345. t[58] = 74;
  20346. t[60] = 75;
  20347. t[62] = 76;
  20348. t[68] = 77;
  20349. t[69] = 78;
  20350. t[75] = 79;
  20351. t[76] = 210;
  20352. t[80] = 214;
  20353. t[87] = 80;
  20354. t[89] = 81;
  20355. t[90] = 82;
  20356. t[92] = 344;
  20357. t[94] = 83;
  20358. t[97] = 352;
  20359. t[100] = 84;
  20360. t[104] = 85;
  20361. t[109] = 220;
  20362. t[115] = 86;
  20363. t[116] = 87;
  20364. t[121] = 88;
  20365. t[122] = 89;
  20366. t[124] = 221;
  20367. t[127] = 90;
  20368. t[129] = 381;
  20369. t[258] = 97;
  20370. t[259] = 224;
  20371. t[260] = 225;
  20372. t[263] = 228;
  20373. t[268] = 261;
  20374. t[271] = 98;
  20375. t[272] = 99;
  20376. t[273] = 263;
  20377. t[275] = 269;
  20378. t[282] = 100;
  20379. t[286] = 101;
  20380. t[287] = 232;
  20381. t[288] = 233;
  20382. t[290] = 283;
  20383. t[295] = 281;
  20384. t[296] = 102;
  20385. t[336] = 103;
  20386. t[346] = 104;
  20387. t[349] = 105;
  20388. t[350] = 236;
  20389. t[351] = 237;
  20390. t[361] = 106;
  20391. t[364] = 107;
  20392. t[367] = 108;
  20393. t[371] = 322;
  20394. t[373] = 109;
  20395. t[374] = 110;
  20396. t[381] = 111;
  20397. t[382] = 242;
  20398. t[383] = 243;
  20399. t[386] = 246;
  20400. t[393] = 112;
  20401. t[395] = 113;
  20402. t[396] = 114;
  20403. t[398] = 345;
  20404. t[400] = 115;
  20405. t[401] = 347;
  20406. t[403] = 353;
  20407. t[410] = 116;
  20408. t[437] = 117;
  20409. t[442] = 252;
  20410. t[448] = 118;
  20411. t[449] = 119;
  20412. t[454] = 120;
  20413. t[455] = 121;
  20414. t[457] = 253;
  20415. t[460] = 122;
  20416. t[462] = 382;
  20417. t[463] = 380;
  20418. t[853] = 44;
  20419. t[855] = 58;
  20420. t[856] = 46;
  20421. t[876] = 47;
  20422. t[878] = 45;
  20423. t[882] = 45;
  20424. t[894] = 40;
  20425. t[895] = 41;
  20426. t[896] = 91;
  20427. t[897] = 93;
  20428. t[923] = 64;
  20429. t[1004] = 48;
  20430. t[1005] = 49;
  20431. t[1006] = 50;
  20432. t[1007] = 51;
  20433. t[1008] = 52;
  20434. t[1009] = 53;
  20435. t[1010] = 54;
  20436. t[1011] = 55;
  20437. t[1012] = 56;
  20438. t[1013] = 57;
  20439. t[1081] = 37;
  20440. t[1085] = 43;
  20441. t[1086] = 45;
  20442. });
  20443. function getStandardFontName(name) {
  20444. const fontName = normalizeFontName(name);
  20445. const stdFontMap = getStdFontMap();
  20446. return stdFontMap[fontName];
  20447. }
  20448. function isKnownFontName(name) {
  20449. const fontName = normalizeFontName(name);
  20450. return !!(getStdFontMap()[fontName] || getNonStdFontMap()[fontName] || getSerifFonts()[fontName] || getSymbolsFonts()[fontName]);
  20451. }
  20452. ;// ./src/core/to_unicode_map.js
  20453. class ToUnicodeMap {
  20454. constructor(cmap = []) {
  20455. this._map = cmap;
  20456. }
  20457. get length() {
  20458. return this._map.length;
  20459. }
  20460. forEach(callback) {
  20461. for (const charCode in this._map) {
  20462. callback(charCode, this._map[charCode].charCodeAt(0));
  20463. }
  20464. }
  20465. has(i) {
  20466. return this._map[i] !== undefined;
  20467. }
  20468. get(i) {
  20469. return this._map[i];
  20470. }
  20471. charCodeOf(value) {
  20472. const map = this._map;
  20473. if (map.length <= 0x10000) {
  20474. return map.indexOf(value);
  20475. }
  20476. for (const charCode in map) {
  20477. if (map[charCode] === value) {
  20478. return charCode | 0;
  20479. }
  20480. }
  20481. return -1;
  20482. }
  20483. amend(map) {
  20484. for (const charCode in map) {
  20485. this._map[charCode] = map[charCode];
  20486. }
  20487. }
  20488. }
  20489. class IdentityToUnicodeMap {
  20490. constructor(firstChar, lastChar) {
  20491. this.firstChar = firstChar;
  20492. this.lastChar = lastChar;
  20493. }
  20494. get length() {
  20495. return this.lastChar + 1 - this.firstChar;
  20496. }
  20497. forEach(callback) {
  20498. for (let i = this.firstChar, ii = this.lastChar; i <= ii; i++) {
  20499. callback(i, i);
  20500. }
  20501. }
  20502. has(i) {
  20503. return this.firstChar <= i && i <= this.lastChar;
  20504. }
  20505. get(i) {
  20506. if (this.firstChar <= i && i <= this.lastChar) {
  20507. return String.fromCharCode(i);
  20508. }
  20509. return undefined;
  20510. }
  20511. charCodeOf(v) {
  20512. return Number.isInteger(v) && v >= this.firstChar && v <= this.lastChar ? v : -1;
  20513. }
  20514. amend(map) {
  20515. unreachable("Should not call amend()");
  20516. }
  20517. }
  20518. ;// ./src/core/cff_font.js
  20519. class CFFFont {
  20520. constructor(file, properties) {
  20521. this.properties = properties;
  20522. const parser = new CFFParser(file, properties, SEAC_ANALYSIS_ENABLED);
  20523. this.cff = parser.parse();
  20524. this.cff.duplicateFirstGlyph();
  20525. const compiler = new CFFCompiler(this.cff);
  20526. this.seacs = this.cff.seacs;
  20527. try {
  20528. this.data = compiler.compile();
  20529. } catch {
  20530. warn("Failed to compile font " + properties.loadedName);
  20531. this.data = file;
  20532. }
  20533. this._createBuiltInEncoding();
  20534. }
  20535. get numGlyphs() {
  20536. return this.cff.charStrings.count;
  20537. }
  20538. getCharset() {
  20539. return this.cff.charset.charset;
  20540. }
  20541. getGlyphMapping() {
  20542. const cff = this.cff;
  20543. const properties = this.properties;
  20544. const {
  20545. cidToGidMap,
  20546. cMap
  20547. } = properties;
  20548. const charsets = cff.charset.charset;
  20549. let charCodeToGlyphId;
  20550. let glyphId;
  20551. if (properties.composite) {
  20552. let invCidToGidMap;
  20553. if (cidToGidMap?.length > 0) {
  20554. invCidToGidMap = Object.create(null);
  20555. for (let i = 0, ii = cidToGidMap.length; i < ii; i++) {
  20556. const gid = cidToGidMap[i];
  20557. if (gid !== undefined) {
  20558. invCidToGidMap[gid] = i;
  20559. }
  20560. }
  20561. }
  20562. charCodeToGlyphId = Object.create(null);
  20563. let charCode;
  20564. if (cff.isCIDFont) {
  20565. for (glyphId = 0; glyphId < charsets.length; glyphId++) {
  20566. const cid = charsets[glyphId];
  20567. charCode = cMap.charCodeOf(cid);
  20568. if (invCidToGidMap?.[charCode] !== undefined) {
  20569. charCode = invCidToGidMap[charCode];
  20570. }
  20571. charCodeToGlyphId[charCode] = glyphId;
  20572. }
  20573. } else {
  20574. for (glyphId = 0; glyphId < cff.charStrings.count; glyphId++) {
  20575. charCode = cMap.charCodeOf(glyphId);
  20576. charCodeToGlyphId[charCode] = glyphId;
  20577. }
  20578. }
  20579. return charCodeToGlyphId;
  20580. }
  20581. let encoding = cff.encoding ? cff.encoding.encoding : null;
  20582. if (properties.isInternalFont) {
  20583. encoding = properties.defaultEncoding;
  20584. }
  20585. charCodeToGlyphId = type1FontGlyphMapping(properties, encoding, charsets);
  20586. return charCodeToGlyphId;
  20587. }
  20588. hasGlyphId(id) {
  20589. return this.cff.hasGlyphId(id);
  20590. }
  20591. _createBuiltInEncoding() {
  20592. const {
  20593. charset,
  20594. encoding
  20595. } = this.cff;
  20596. if (!charset || !encoding) {
  20597. return;
  20598. }
  20599. const charsets = charset.charset,
  20600. encodings = encoding.encoding;
  20601. const map = [];
  20602. for (const charCode in encodings) {
  20603. const glyphId = encodings[charCode];
  20604. if (glyphId >= 0) {
  20605. const glyphName = charsets[glyphId];
  20606. if (glyphName) {
  20607. map[charCode] = glyphName;
  20608. }
  20609. }
  20610. }
  20611. if (map.length > 0) {
  20612. this.properties.builtInEncoding = map;
  20613. }
  20614. }
  20615. }
  20616. ;// ./src/core/font_renderer.js
  20617. function getUint32(data, offset) {
  20618. return (data[offset] << 24 | data[offset + 1] << 16 | data[offset + 2] << 8 | data[offset + 3]) >>> 0;
  20619. }
  20620. function getUint16(data, offset) {
  20621. return data[offset] << 8 | data[offset + 1];
  20622. }
  20623. function getInt16(data, offset) {
  20624. return (data[offset] << 24 | data[offset + 1] << 16) >> 16;
  20625. }
  20626. function getInt8(data, offset) {
  20627. return data[offset] << 24 >> 24;
  20628. }
  20629. function getFloat214(data, offset) {
  20630. return getInt16(data, offset) / 16384;
  20631. }
  20632. function getSubroutineBias(subrs) {
  20633. const numSubrs = subrs.length;
  20634. let bias = 32768;
  20635. if (numSubrs < 1240) {
  20636. bias = 107;
  20637. } else if (numSubrs < 33900) {
  20638. bias = 1131;
  20639. }
  20640. return bias;
  20641. }
  20642. function parseCmap(data, start, end) {
  20643. const offset = getUint16(data, start + 2) === 1 ? getUint32(data, start + 8) : getUint32(data, start + 16);
  20644. const format = getUint16(data, start + offset);
  20645. let ranges, p, i;
  20646. if (format === 4) {
  20647. getUint16(data, start + offset + 2);
  20648. const segCount = getUint16(data, start + offset + 6) >> 1;
  20649. p = start + offset + 14;
  20650. ranges = [];
  20651. for (i = 0; i < segCount; i++, p += 2) {
  20652. ranges[i] = {
  20653. end: getUint16(data, p)
  20654. };
  20655. }
  20656. p += 2;
  20657. for (i = 0; i < segCount; i++, p += 2) {
  20658. ranges[i].start = getUint16(data, p);
  20659. }
  20660. for (i = 0; i < segCount; i++, p += 2) {
  20661. ranges[i].idDelta = getUint16(data, p);
  20662. }
  20663. for (i = 0; i < segCount; i++, p += 2) {
  20664. let idOffset = getUint16(data, p);
  20665. if (idOffset === 0) {
  20666. continue;
  20667. }
  20668. ranges[i].ids = [];
  20669. for (let j = 0, jj = ranges[i].end - ranges[i].start + 1; j < jj; j++) {
  20670. ranges[i].ids[j] = getUint16(data, p + idOffset);
  20671. idOffset += 2;
  20672. }
  20673. }
  20674. return ranges;
  20675. } else if (format === 12) {
  20676. const groups = getUint32(data, start + offset + 12);
  20677. p = start + offset + 16;
  20678. ranges = [];
  20679. for (i = 0; i < groups; i++) {
  20680. start = getUint32(data, p);
  20681. ranges.push({
  20682. start,
  20683. end: getUint32(data, p + 4),
  20684. idDelta: getUint32(data, p + 8) - start
  20685. });
  20686. p += 12;
  20687. }
  20688. return ranges;
  20689. }
  20690. throw new FormatError(`unsupported cmap: ${format}`);
  20691. }
  20692. function parseCff(data, start, end, seacAnalysisEnabled) {
  20693. const properties = {};
  20694. const parser = new CFFParser(new Stream(data, start, end - start), properties, seacAnalysisEnabled);
  20695. const cff = parser.parse();
  20696. return {
  20697. glyphs: cff.charStrings.objects,
  20698. subrs: cff.topDict.privateDict?.subrsIndex?.objects,
  20699. gsubrs: cff.globalSubrIndex?.objects,
  20700. isCFFCIDFont: cff.isCIDFont,
  20701. fdSelect: cff.fdSelect,
  20702. fdArray: cff.fdArray
  20703. };
  20704. }
  20705. function parseGlyfTable(glyf, loca, isGlyphLocationsLong) {
  20706. let itemSize, itemDecode;
  20707. if (isGlyphLocationsLong) {
  20708. itemSize = 4;
  20709. itemDecode = getUint32;
  20710. } else {
  20711. itemSize = 2;
  20712. itemDecode = (data, offset) => 2 * getUint16(data, offset);
  20713. }
  20714. const glyphs = [];
  20715. let startOffset = itemDecode(loca, 0);
  20716. for (let j = itemSize; j < loca.length; j += itemSize) {
  20717. const endOffset = itemDecode(loca, j);
  20718. glyphs.push(glyf.subarray(startOffset, endOffset));
  20719. startOffset = endOffset;
  20720. }
  20721. return glyphs;
  20722. }
  20723. function lookupCmap(ranges, unicode) {
  20724. const code = unicode.codePointAt(0);
  20725. let gid = 0,
  20726. l = 0,
  20727. r = ranges.length - 1;
  20728. while (l < r) {
  20729. const c = l + r + 1 >> 1;
  20730. if (code < ranges[c].start) {
  20731. r = c - 1;
  20732. } else {
  20733. l = c;
  20734. }
  20735. }
  20736. if (ranges[l].start <= code && code <= ranges[l].end) {
  20737. gid = ranges[l].idDelta + (ranges[l].ids ? ranges[l].ids[code - ranges[l].start] : code) & 0xffff;
  20738. }
  20739. return {
  20740. charCode: code,
  20741. glyphId: gid
  20742. };
  20743. }
  20744. function compileGlyf(code, cmds, font) {
  20745. function moveTo(x, y) {
  20746. cmds.add(FontRenderOps.MOVE_TO, [x, y]);
  20747. }
  20748. function lineTo(x, y) {
  20749. cmds.add(FontRenderOps.LINE_TO, [x, y]);
  20750. }
  20751. function quadraticCurveTo(xa, ya, x, y) {
  20752. cmds.add(FontRenderOps.QUADRATIC_CURVE_TO, [xa, ya, x, y]);
  20753. }
  20754. let i = 0;
  20755. const numberOfContours = getInt16(code, i);
  20756. let flags;
  20757. let x = 0,
  20758. y = 0;
  20759. i += 10;
  20760. if (numberOfContours < 0) {
  20761. do {
  20762. flags = getUint16(code, i);
  20763. const glyphIndex = getUint16(code, i + 2);
  20764. i += 4;
  20765. let arg1, arg2;
  20766. if (flags & 0x01) {
  20767. if (flags & 0x02) {
  20768. arg1 = getInt16(code, i);
  20769. arg2 = getInt16(code, i + 2);
  20770. } else {
  20771. arg1 = getUint16(code, i);
  20772. arg2 = getUint16(code, i + 2);
  20773. }
  20774. i += 4;
  20775. } else if (flags & 0x02) {
  20776. arg1 = getInt8(code, i++);
  20777. arg2 = getInt8(code, i++);
  20778. } else {
  20779. arg1 = code[i++];
  20780. arg2 = code[i++];
  20781. }
  20782. if (flags & 0x02) {
  20783. x = arg1;
  20784. y = arg2;
  20785. } else {
  20786. x = 0;
  20787. y = 0;
  20788. }
  20789. let scaleX = 1,
  20790. scaleY = 1,
  20791. scale01 = 0,
  20792. scale10 = 0;
  20793. if (flags & 0x08) {
  20794. scaleX = scaleY = getFloat214(code, i);
  20795. i += 2;
  20796. } else if (flags & 0x40) {
  20797. scaleX = getFloat214(code, i);
  20798. scaleY = getFloat214(code, i + 2);
  20799. i += 4;
  20800. } else if (flags & 0x80) {
  20801. scaleX = getFloat214(code, i);
  20802. scale01 = getFloat214(code, i + 2);
  20803. scale10 = getFloat214(code, i + 4);
  20804. scaleY = getFloat214(code, i + 6);
  20805. i += 8;
  20806. }
  20807. const subglyph = font.glyphs[glyphIndex];
  20808. if (subglyph) {
  20809. cmds.add(FontRenderOps.SAVE);
  20810. cmds.add(FontRenderOps.TRANSFORM, [scaleX, scale01, scale10, scaleY, x, y]);
  20811. if (!(flags & 0x02)) {}
  20812. compileGlyf(subglyph, cmds, font);
  20813. cmds.add(FontRenderOps.RESTORE);
  20814. }
  20815. } while (flags & 0x20);
  20816. } else {
  20817. const endPtsOfContours = [];
  20818. let j, jj;
  20819. for (j = 0; j < numberOfContours; j++) {
  20820. endPtsOfContours.push(getUint16(code, i));
  20821. i += 2;
  20822. }
  20823. const instructionLength = getUint16(code, i);
  20824. i += 2 + instructionLength;
  20825. const numberOfPoints = endPtsOfContours.at(-1) + 1;
  20826. const points = [];
  20827. while (points.length < numberOfPoints) {
  20828. flags = code[i++];
  20829. let repeat = 1;
  20830. if (flags & 0x08) {
  20831. repeat += code[i++];
  20832. }
  20833. while (repeat-- > 0) {
  20834. points.push({
  20835. flags
  20836. });
  20837. }
  20838. }
  20839. for (j = 0; j < numberOfPoints; j++) {
  20840. switch (points[j].flags & 0x12) {
  20841. case 0x00:
  20842. x += getInt16(code, i);
  20843. i += 2;
  20844. break;
  20845. case 0x02:
  20846. x -= code[i++];
  20847. break;
  20848. case 0x12:
  20849. x += code[i++];
  20850. break;
  20851. }
  20852. points[j].x = x;
  20853. }
  20854. for (j = 0; j < numberOfPoints; j++) {
  20855. switch (points[j].flags & 0x24) {
  20856. case 0x00:
  20857. y += getInt16(code, i);
  20858. i += 2;
  20859. break;
  20860. case 0x04:
  20861. y -= code[i++];
  20862. break;
  20863. case 0x24:
  20864. y += code[i++];
  20865. break;
  20866. }
  20867. points[j].y = y;
  20868. }
  20869. let startPoint = 0;
  20870. for (i = 0; i < numberOfContours; i++) {
  20871. const endPoint = endPtsOfContours[i];
  20872. const contour = points.slice(startPoint, endPoint + 1);
  20873. if (contour[0].flags & 1) {
  20874. contour.push(contour[0]);
  20875. } else if (contour.at(-1).flags & 1) {
  20876. contour.unshift(contour.at(-1));
  20877. } else {
  20878. const p = {
  20879. flags: 1,
  20880. x: (contour[0].x + contour.at(-1).x) / 2,
  20881. y: (contour[0].y + contour.at(-1).y) / 2
  20882. };
  20883. contour.unshift(p);
  20884. contour.push(p);
  20885. }
  20886. moveTo(contour[0].x, contour[0].y);
  20887. for (j = 1, jj = contour.length; j < jj; j++) {
  20888. if (contour[j].flags & 1) {
  20889. lineTo(contour[j].x, contour[j].y);
  20890. } else if (contour[j + 1].flags & 1) {
  20891. quadraticCurveTo(contour[j].x, contour[j].y, contour[j + 1].x, contour[j + 1].y);
  20892. j++;
  20893. } else {
  20894. quadraticCurveTo(contour[j].x, contour[j].y, (contour[j].x + contour[j + 1].x) / 2, (contour[j].y + contour[j + 1].y) / 2);
  20895. }
  20896. }
  20897. startPoint = endPoint + 1;
  20898. }
  20899. }
  20900. }
  20901. function compileCharString(charStringCode, cmds, font, glyphId) {
  20902. function moveTo(x, y) {
  20903. cmds.add(FontRenderOps.MOVE_TO, [x, y]);
  20904. }
  20905. function lineTo(x, y) {
  20906. cmds.add(FontRenderOps.LINE_TO, [x, y]);
  20907. }
  20908. function bezierCurveTo(x1, y1, x2, y2, x, y) {
  20909. cmds.add(FontRenderOps.BEZIER_CURVE_TO, [x1, y1, x2, y2, x, y]);
  20910. }
  20911. const stack = [];
  20912. let x = 0,
  20913. y = 0;
  20914. let stems = 0;
  20915. function parse(code) {
  20916. let i = 0;
  20917. while (i < code.length) {
  20918. let stackClean = false;
  20919. let v = code[i++];
  20920. let xa, xb, ya, yb, y1, y2, y3, n, subrCode;
  20921. switch (v) {
  20922. case 1:
  20923. stems += stack.length >> 1;
  20924. stackClean = true;
  20925. break;
  20926. case 3:
  20927. stems += stack.length >> 1;
  20928. stackClean = true;
  20929. break;
  20930. case 4:
  20931. y += stack.pop();
  20932. moveTo(x, y);
  20933. stackClean = true;
  20934. break;
  20935. case 5:
  20936. while (stack.length > 0) {
  20937. x += stack.shift();
  20938. y += stack.shift();
  20939. lineTo(x, y);
  20940. }
  20941. break;
  20942. case 6:
  20943. while (stack.length > 0) {
  20944. x += stack.shift();
  20945. lineTo(x, y);
  20946. if (stack.length === 0) {
  20947. break;
  20948. }
  20949. y += stack.shift();
  20950. lineTo(x, y);
  20951. }
  20952. break;
  20953. case 7:
  20954. while (stack.length > 0) {
  20955. y += stack.shift();
  20956. lineTo(x, y);
  20957. if (stack.length === 0) {
  20958. break;
  20959. }
  20960. x += stack.shift();
  20961. lineTo(x, y);
  20962. }
  20963. break;
  20964. case 8:
  20965. while (stack.length > 0) {
  20966. xa = x + stack.shift();
  20967. ya = y + stack.shift();
  20968. xb = xa + stack.shift();
  20969. yb = ya + stack.shift();
  20970. x = xb + stack.shift();
  20971. y = yb + stack.shift();
  20972. bezierCurveTo(xa, ya, xb, yb, x, y);
  20973. }
  20974. break;
  20975. case 10:
  20976. n = stack.pop();
  20977. subrCode = null;
  20978. if (font.isCFFCIDFont) {
  20979. const fdIndex = font.fdSelect.getFDIndex(glyphId);
  20980. if (fdIndex >= 0 && fdIndex < font.fdArray.length) {
  20981. const fontDict = font.fdArray[fdIndex];
  20982. let subrs;
  20983. if (fontDict.privateDict?.subrsIndex) {
  20984. subrs = fontDict.privateDict.subrsIndex.objects;
  20985. }
  20986. if (subrs) {
  20987. n += getSubroutineBias(subrs);
  20988. subrCode = subrs[n];
  20989. }
  20990. } else {
  20991. warn("Invalid fd index for glyph index.");
  20992. }
  20993. } else {
  20994. subrCode = font.subrs[n + font.subrsBias];
  20995. }
  20996. if (subrCode) {
  20997. parse(subrCode);
  20998. }
  20999. break;
  21000. case 11:
  21001. return;
  21002. case 12:
  21003. v = code[i++];
  21004. switch (v) {
  21005. case 34:
  21006. xa = x + stack.shift();
  21007. xb = xa + stack.shift();
  21008. y1 = y + stack.shift();
  21009. x = xb + stack.shift();
  21010. bezierCurveTo(xa, y, xb, y1, x, y1);
  21011. xa = x + stack.shift();
  21012. xb = xa + stack.shift();
  21013. x = xb + stack.shift();
  21014. bezierCurveTo(xa, y1, xb, y, x, y);
  21015. break;
  21016. case 35:
  21017. xa = x + stack.shift();
  21018. ya = y + stack.shift();
  21019. xb = xa + stack.shift();
  21020. yb = ya + stack.shift();
  21021. x = xb + stack.shift();
  21022. y = yb + stack.shift();
  21023. bezierCurveTo(xa, ya, xb, yb, x, y);
  21024. xa = x + stack.shift();
  21025. ya = y + stack.shift();
  21026. xb = xa + stack.shift();
  21027. yb = ya + stack.shift();
  21028. x = xb + stack.shift();
  21029. y = yb + stack.shift();
  21030. bezierCurveTo(xa, ya, xb, yb, x, y);
  21031. stack.pop();
  21032. break;
  21033. case 36:
  21034. xa = x + stack.shift();
  21035. y1 = y + stack.shift();
  21036. xb = xa + stack.shift();
  21037. y2 = y1 + stack.shift();
  21038. x = xb + stack.shift();
  21039. bezierCurveTo(xa, y1, xb, y2, x, y2);
  21040. xa = x + stack.shift();
  21041. xb = xa + stack.shift();
  21042. y3 = y2 + stack.shift();
  21043. x = xb + stack.shift();
  21044. bezierCurveTo(xa, y2, xb, y3, x, y);
  21045. break;
  21046. case 37:
  21047. const x0 = x,
  21048. y0 = y;
  21049. xa = x + stack.shift();
  21050. ya = y + stack.shift();
  21051. xb = xa + stack.shift();
  21052. yb = ya + stack.shift();
  21053. x = xb + stack.shift();
  21054. y = yb + stack.shift();
  21055. bezierCurveTo(xa, ya, xb, yb, x, y);
  21056. xa = x + stack.shift();
  21057. ya = y + stack.shift();
  21058. xb = xa + stack.shift();
  21059. yb = ya + stack.shift();
  21060. x = xb;
  21061. y = yb;
  21062. if (Math.abs(x - x0) > Math.abs(y - y0)) {
  21063. x += stack.shift();
  21064. } else {
  21065. y += stack.shift();
  21066. }
  21067. bezierCurveTo(xa, ya, xb, yb, x, y);
  21068. break;
  21069. default:
  21070. throw new FormatError(`unknown operator: 12 ${v}`);
  21071. }
  21072. break;
  21073. case 14:
  21074. if (stack.length >= 4) {
  21075. const achar = stack.pop();
  21076. const bchar = stack.pop();
  21077. y = stack.pop();
  21078. x = stack.pop();
  21079. cmds.add(FontRenderOps.SAVE);
  21080. cmds.add(FontRenderOps.TRANSLATE, [x, y]);
  21081. let cmap = lookupCmap(font.cmap, String.fromCharCode(font.glyphNameMap[StandardEncoding[achar]]));
  21082. compileCharString(font.glyphs[cmap.glyphId], cmds, font, cmap.glyphId);
  21083. cmds.add(FontRenderOps.RESTORE);
  21084. cmap = lookupCmap(font.cmap, String.fromCharCode(font.glyphNameMap[StandardEncoding[bchar]]));
  21085. compileCharString(font.glyphs[cmap.glyphId], cmds, font, cmap.glyphId);
  21086. }
  21087. return;
  21088. case 18:
  21089. stems += stack.length >> 1;
  21090. stackClean = true;
  21091. break;
  21092. case 19:
  21093. stems += stack.length >> 1;
  21094. i += stems + 7 >> 3;
  21095. stackClean = true;
  21096. break;
  21097. case 20:
  21098. stems += stack.length >> 1;
  21099. i += stems + 7 >> 3;
  21100. stackClean = true;
  21101. break;
  21102. case 21:
  21103. y += stack.pop();
  21104. x += stack.pop();
  21105. moveTo(x, y);
  21106. stackClean = true;
  21107. break;
  21108. case 22:
  21109. x += stack.pop();
  21110. moveTo(x, y);
  21111. stackClean = true;
  21112. break;
  21113. case 23:
  21114. stems += stack.length >> 1;
  21115. stackClean = true;
  21116. break;
  21117. case 24:
  21118. while (stack.length > 2) {
  21119. xa = x + stack.shift();
  21120. ya = y + stack.shift();
  21121. xb = xa + stack.shift();
  21122. yb = ya + stack.shift();
  21123. x = xb + stack.shift();
  21124. y = yb + stack.shift();
  21125. bezierCurveTo(xa, ya, xb, yb, x, y);
  21126. }
  21127. x += stack.shift();
  21128. y += stack.shift();
  21129. lineTo(x, y);
  21130. break;
  21131. case 25:
  21132. while (stack.length > 6) {
  21133. x += stack.shift();
  21134. y += stack.shift();
  21135. lineTo(x, y);
  21136. }
  21137. xa = x + stack.shift();
  21138. ya = y + stack.shift();
  21139. xb = xa + stack.shift();
  21140. yb = ya + stack.shift();
  21141. x = xb + stack.shift();
  21142. y = yb + stack.shift();
  21143. bezierCurveTo(xa, ya, xb, yb, x, y);
  21144. break;
  21145. case 26:
  21146. if (stack.length % 2) {
  21147. x += stack.shift();
  21148. }
  21149. while (stack.length > 0) {
  21150. xa = x;
  21151. ya = y + stack.shift();
  21152. xb = xa + stack.shift();
  21153. yb = ya + stack.shift();
  21154. x = xb;
  21155. y = yb + stack.shift();
  21156. bezierCurveTo(xa, ya, xb, yb, x, y);
  21157. }
  21158. break;
  21159. case 27:
  21160. if (stack.length % 2) {
  21161. y += stack.shift();
  21162. }
  21163. while (stack.length > 0) {
  21164. xa = x + stack.shift();
  21165. ya = y;
  21166. xb = xa + stack.shift();
  21167. yb = ya + stack.shift();
  21168. x = xb + stack.shift();
  21169. y = yb;
  21170. bezierCurveTo(xa, ya, xb, yb, x, y);
  21171. }
  21172. break;
  21173. case 28:
  21174. stack.push((code[i] << 24 | code[i + 1] << 16) >> 16);
  21175. i += 2;
  21176. break;
  21177. case 29:
  21178. n = stack.pop() + font.gsubrsBias;
  21179. subrCode = font.gsubrs[n];
  21180. if (subrCode) {
  21181. parse(subrCode);
  21182. }
  21183. break;
  21184. case 30:
  21185. while (stack.length > 0) {
  21186. xa = x;
  21187. ya = y + stack.shift();
  21188. xb = xa + stack.shift();
  21189. yb = ya + stack.shift();
  21190. x = xb + stack.shift();
  21191. y = yb + (stack.length === 1 ? stack.shift() : 0);
  21192. bezierCurveTo(xa, ya, xb, yb, x, y);
  21193. if (stack.length === 0) {
  21194. break;
  21195. }
  21196. xa = x + stack.shift();
  21197. ya = y;
  21198. xb = xa + stack.shift();
  21199. yb = ya + stack.shift();
  21200. y = yb + stack.shift();
  21201. x = xb + (stack.length === 1 ? stack.shift() : 0);
  21202. bezierCurveTo(xa, ya, xb, yb, x, y);
  21203. }
  21204. break;
  21205. case 31:
  21206. while (stack.length > 0) {
  21207. xa = x + stack.shift();
  21208. ya = y;
  21209. xb = xa + stack.shift();
  21210. yb = ya + stack.shift();
  21211. y = yb + stack.shift();
  21212. x = xb + (stack.length === 1 ? stack.shift() : 0);
  21213. bezierCurveTo(xa, ya, xb, yb, x, y);
  21214. if (stack.length === 0) {
  21215. break;
  21216. }
  21217. xa = x;
  21218. ya = y + stack.shift();
  21219. xb = xa + stack.shift();
  21220. yb = ya + stack.shift();
  21221. x = xb + stack.shift();
  21222. y = yb + (stack.length === 1 ? stack.shift() : 0);
  21223. bezierCurveTo(xa, ya, xb, yb, x, y);
  21224. }
  21225. break;
  21226. default:
  21227. if (v < 32) {
  21228. throw new FormatError(`unknown operator: ${v}`);
  21229. }
  21230. if (v < 247) {
  21231. stack.push(v - 139);
  21232. } else if (v < 251) {
  21233. stack.push((v - 247) * 256 + code[i++] + 108);
  21234. } else if (v < 255) {
  21235. stack.push(-(v - 251) * 256 - code[i++] - 108);
  21236. } else {
  21237. stack.push((code[i] << 24 | code[i + 1] << 16 | code[i + 2] << 8 | code[i + 3]) / 65536);
  21238. i += 4;
  21239. }
  21240. break;
  21241. }
  21242. if (stackClean) {
  21243. stack.length = 0;
  21244. }
  21245. }
  21246. }
  21247. parse(charStringCode);
  21248. }
  21249. const NOOP = [];
  21250. class Commands {
  21251. cmds = [];
  21252. add(cmd, args) {
  21253. if (args) {
  21254. if (!isNumberArray(args, null)) {
  21255. warn(`Commands.add - "${cmd}" has at least one non-number arg: "${args}".`);
  21256. const newArgs = args.map(arg => typeof arg === "number" ? arg : 0);
  21257. this.cmds.push(cmd, ...newArgs);
  21258. } else {
  21259. this.cmds.push(cmd, ...args);
  21260. }
  21261. } else {
  21262. this.cmds.push(cmd);
  21263. }
  21264. }
  21265. }
  21266. class CompiledFont {
  21267. constructor(fontMatrix) {
  21268. this.fontMatrix = fontMatrix;
  21269. this.compiledGlyphs = Object.create(null);
  21270. this.compiledCharCodeToGlyphId = Object.create(null);
  21271. }
  21272. getPathJs(unicode) {
  21273. const {
  21274. charCode,
  21275. glyphId
  21276. } = lookupCmap(this.cmap, unicode);
  21277. let fn = this.compiledGlyphs[glyphId],
  21278. compileEx;
  21279. if (!fn) {
  21280. try {
  21281. fn = this.compileGlyph(this.glyphs[glyphId], glyphId);
  21282. } catch (ex) {
  21283. fn = NOOP;
  21284. compileEx = ex;
  21285. }
  21286. this.compiledGlyphs[glyphId] = fn;
  21287. }
  21288. this.compiledCharCodeToGlyphId[charCode] ??= glyphId;
  21289. if (compileEx) {
  21290. throw compileEx;
  21291. }
  21292. return fn;
  21293. }
  21294. compileGlyph(code, glyphId) {
  21295. if (!code || code.length === 0 || code[0] === 14) {
  21296. return NOOP;
  21297. }
  21298. let fontMatrix = this.fontMatrix;
  21299. if (this.isCFFCIDFont) {
  21300. const fdIndex = this.fdSelect.getFDIndex(glyphId);
  21301. if (fdIndex >= 0 && fdIndex < this.fdArray.length) {
  21302. const fontDict = this.fdArray[fdIndex];
  21303. fontMatrix = fontDict.getByName("FontMatrix") || FONT_IDENTITY_MATRIX;
  21304. } else {
  21305. warn("Invalid fd index for glyph index.");
  21306. }
  21307. }
  21308. const cmds = new Commands();
  21309. cmds.add(FontRenderOps.SAVE);
  21310. cmds.add(FontRenderOps.TRANSFORM, fontMatrix.slice());
  21311. cmds.add(FontRenderOps.SCALE);
  21312. this.compileGlyphImpl(code, cmds, glyphId);
  21313. cmds.add(FontRenderOps.RESTORE);
  21314. return cmds.cmds;
  21315. }
  21316. compileGlyphImpl() {
  21317. unreachable("Children classes should implement this.");
  21318. }
  21319. hasBuiltPath(unicode) {
  21320. const {
  21321. charCode,
  21322. glyphId
  21323. } = lookupCmap(this.cmap, unicode);
  21324. return this.compiledGlyphs[glyphId] !== undefined && this.compiledCharCodeToGlyphId[charCode] !== undefined;
  21325. }
  21326. }
  21327. class TrueTypeCompiled extends CompiledFont {
  21328. constructor(glyphs, cmap, fontMatrix) {
  21329. super(fontMatrix || [0.000488, 0, 0, 0.000488, 0, 0]);
  21330. this.glyphs = glyphs;
  21331. this.cmap = cmap;
  21332. }
  21333. compileGlyphImpl(code, cmds) {
  21334. compileGlyf(code, cmds, this);
  21335. }
  21336. }
  21337. class Type2Compiled extends CompiledFont {
  21338. constructor(cffInfo, cmap, fontMatrix, glyphNameMap) {
  21339. super(fontMatrix || [0.001, 0, 0, 0.001, 0, 0]);
  21340. this.glyphs = cffInfo.glyphs;
  21341. this.gsubrs = cffInfo.gsubrs || [];
  21342. this.subrs = cffInfo.subrs || [];
  21343. this.cmap = cmap;
  21344. this.glyphNameMap = glyphNameMap || getGlyphsUnicode();
  21345. this.gsubrsBias = getSubroutineBias(this.gsubrs);
  21346. this.subrsBias = getSubroutineBias(this.subrs);
  21347. this.isCFFCIDFont = cffInfo.isCFFCIDFont;
  21348. this.fdSelect = cffInfo.fdSelect;
  21349. this.fdArray = cffInfo.fdArray;
  21350. }
  21351. compileGlyphImpl(code, cmds, glyphId) {
  21352. compileCharString(code, cmds, this, glyphId);
  21353. }
  21354. }
  21355. class FontRendererFactory {
  21356. static create(font, seacAnalysisEnabled) {
  21357. const data = new Uint8Array(font.data);
  21358. let cmap, glyf, loca, cff, indexToLocFormat, unitsPerEm;
  21359. const numTables = getUint16(data, 4);
  21360. for (let i = 0, p = 12; i < numTables; i++, p += 16) {
  21361. const tag = bytesToString(data.subarray(p, p + 4));
  21362. const offset = getUint32(data, p + 8);
  21363. const length = getUint32(data, p + 12);
  21364. switch (tag) {
  21365. case "cmap":
  21366. cmap = parseCmap(data, offset, offset + length);
  21367. break;
  21368. case "glyf":
  21369. glyf = data.subarray(offset, offset + length);
  21370. break;
  21371. case "loca":
  21372. loca = data.subarray(offset, offset + length);
  21373. break;
  21374. case "head":
  21375. unitsPerEm = getUint16(data, offset + 18);
  21376. indexToLocFormat = getUint16(data, offset + 50);
  21377. break;
  21378. case "CFF ":
  21379. cff = parseCff(data, offset, offset + length, seacAnalysisEnabled);
  21380. break;
  21381. }
  21382. }
  21383. if (glyf) {
  21384. const fontMatrix = !unitsPerEm ? font.fontMatrix : [1 / unitsPerEm, 0, 0, 1 / unitsPerEm, 0, 0];
  21385. return new TrueTypeCompiled(parseGlyfTable(glyf, loca, indexToLocFormat), cmap, fontMatrix);
  21386. }
  21387. return new Type2Compiled(cff, cmap, font.fontMatrix, font.glyphNameMap);
  21388. }
  21389. }
  21390. ;// ./src/core/metrics.js
  21391. const getMetrics = getLookupTableFactory(function (t) {
  21392. t.Courier = 600;
  21393. t["Courier-Bold"] = 600;
  21394. t["Courier-BoldOblique"] = 600;
  21395. t["Courier-Oblique"] = 600;
  21396. t.Helvetica = getLookupTableFactory(function (t) {
  21397. t.space = 278;
  21398. t.exclam = 278;
  21399. t.quotedbl = 355;
  21400. t.numbersign = 556;
  21401. t.dollar = 556;
  21402. t.percent = 889;
  21403. t.ampersand = 667;
  21404. t.quoteright = 222;
  21405. t.parenleft = 333;
  21406. t.parenright = 333;
  21407. t.asterisk = 389;
  21408. t.plus = 584;
  21409. t.comma = 278;
  21410. t.hyphen = 333;
  21411. t.period = 278;
  21412. t.slash = 278;
  21413. t.zero = 556;
  21414. t.one = 556;
  21415. t.two = 556;
  21416. t.three = 556;
  21417. t.four = 556;
  21418. t.five = 556;
  21419. t.six = 556;
  21420. t.seven = 556;
  21421. t.eight = 556;
  21422. t.nine = 556;
  21423. t.colon = 278;
  21424. t.semicolon = 278;
  21425. t.less = 584;
  21426. t.equal = 584;
  21427. t.greater = 584;
  21428. t.question = 556;
  21429. t.at = 1015;
  21430. t.A = 667;
  21431. t.B = 667;
  21432. t.C = 722;
  21433. t.D = 722;
  21434. t.E = 667;
  21435. t.F = 611;
  21436. t.G = 778;
  21437. t.H = 722;
  21438. t.I = 278;
  21439. t.J = 500;
  21440. t.K = 667;
  21441. t.L = 556;
  21442. t.M = 833;
  21443. t.N = 722;
  21444. t.O = 778;
  21445. t.P = 667;
  21446. t.Q = 778;
  21447. t.R = 722;
  21448. t.S = 667;
  21449. t.T = 611;
  21450. t.U = 722;
  21451. t.V = 667;
  21452. t.W = 944;
  21453. t.X = 667;
  21454. t.Y = 667;
  21455. t.Z = 611;
  21456. t.bracketleft = 278;
  21457. t.backslash = 278;
  21458. t.bracketright = 278;
  21459. t.asciicircum = 469;
  21460. t.underscore = 556;
  21461. t.quoteleft = 222;
  21462. t.a = 556;
  21463. t.b = 556;
  21464. t.c = 500;
  21465. t.d = 556;
  21466. t.e = 556;
  21467. t.f = 278;
  21468. t.g = 556;
  21469. t.h = 556;
  21470. t.i = 222;
  21471. t.j = 222;
  21472. t.k = 500;
  21473. t.l = 222;
  21474. t.m = 833;
  21475. t.n = 556;
  21476. t.o = 556;
  21477. t.p = 556;
  21478. t.q = 556;
  21479. t.r = 333;
  21480. t.s = 500;
  21481. t.t = 278;
  21482. t.u = 556;
  21483. t.v = 500;
  21484. t.w = 722;
  21485. t.x = 500;
  21486. t.y = 500;
  21487. t.z = 500;
  21488. t.braceleft = 334;
  21489. t.bar = 260;
  21490. t.braceright = 334;
  21491. t.asciitilde = 584;
  21492. t.exclamdown = 333;
  21493. t.cent = 556;
  21494. t.sterling = 556;
  21495. t.fraction = 167;
  21496. t.yen = 556;
  21497. t.florin = 556;
  21498. t.section = 556;
  21499. t.currency = 556;
  21500. t.quotesingle = 191;
  21501. t.quotedblleft = 333;
  21502. t.guillemotleft = 556;
  21503. t.guilsinglleft = 333;
  21504. t.guilsinglright = 333;
  21505. t.fi = 500;
  21506. t.fl = 500;
  21507. t.endash = 556;
  21508. t.dagger = 556;
  21509. t.daggerdbl = 556;
  21510. t.periodcentered = 278;
  21511. t.paragraph = 537;
  21512. t.bullet = 350;
  21513. t.quotesinglbase = 222;
  21514. t.quotedblbase = 333;
  21515. t.quotedblright = 333;
  21516. t.guillemotright = 556;
  21517. t.ellipsis = 1000;
  21518. t.perthousand = 1000;
  21519. t.questiondown = 611;
  21520. t.grave = 333;
  21521. t.acute = 333;
  21522. t.circumflex = 333;
  21523. t.tilde = 333;
  21524. t.macron = 333;
  21525. t.breve = 333;
  21526. t.dotaccent = 333;
  21527. t.dieresis = 333;
  21528. t.ring = 333;
  21529. t.cedilla = 333;
  21530. t.hungarumlaut = 333;
  21531. t.ogonek = 333;
  21532. t.caron = 333;
  21533. t.emdash = 1000;
  21534. t.AE = 1000;
  21535. t.ordfeminine = 370;
  21536. t.Lslash = 556;
  21537. t.Oslash = 778;
  21538. t.OE = 1000;
  21539. t.ordmasculine = 365;
  21540. t.ae = 889;
  21541. t.dotlessi = 278;
  21542. t.lslash = 222;
  21543. t.oslash = 611;
  21544. t.oe = 944;
  21545. t.germandbls = 611;
  21546. t.Idieresis = 278;
  21547. t.eacute = 556;
  21548. t.abreve = 556;
  21549. t.uhungarumlaut = 556;
  21550. t.ecaron = 556;
  21551. t.Ydieresis = 667;
  21552. t.divide = 584;
  21553. t.Yacute = 667;
  21554. t.Acircumflex = 667;
  21555. t.aacute = 556;
  21556. t.Ucircumflex = 722;
  21557. t.yacute = 500;
  21558. t.scommaaccent = 500;
  21559. t.ecircumflex = 556;
  21560. t.Uring = 722;
  21561. t.Udieresis = 722;
  21562. t.aogonek = 556;
  21563. t.Uacute = 722;
  21564. t.uogonek = 556;
  21565. t.Edieresis = 667;
  21566. t.Dcroat = 722;
  21567. t.commaaccent = 250;
  21568. t.copyright = 737;
  21569. t.Emacron = 667;
  21570. t.ccaron = 500;
  21571. t.aring = 556;
  21572. t.Ncommaaccent = 722;
  21573. t.lacute = 222;
  21574. t.agrave = 556;
  21575. t.Tcommaaccent = 611;
  21576. t.Cacute = 722;
  21577. t.atilde = 556;
  21578. t.Edotaccent = 667;
  21579. t.scaron = 500;
  21580. t.scedilla = 500;
  21581. t.iacute = 278;
  21582. t.lozenge = 471;
  21583. t.Rcaron = 722;
  21584. t.Gcommaaccent = 778;
  21585. t.ucircumflex = 556;
  21586. t.acircumflex = 556;
  21587. t.Amacron = 667;
  21588. t.rcaron = 333;
  21589. t.ccedilla = 500;
  21590. t.Zdotaccent = 611;
  21591. t.Thorn = 667;
  21592. t.Omacron = 778;
  21593. t.Racute = 722;
  21594. t.Sacute = 667;
  21595. t.dcaron = 643;
  21596. t.Umacron = 722;
  21597. t.uring = 556;
  21598. t.threesuperior = 333;
  21599. t.Ograve = 778;
  21600. t.Agrave = 667;
  21601. t.Abreve = 667;
  21602. t.multiply = 584;
  21603. t.uacute = 556;
  21604. t.Tcaron = 611;
  21605. t.partialdiff = 476;
  21606. t.ydieresis = 500;
  21607. t.Nacute = 722;
  21608. t.icircumflex = 278;
  21609. t.Ecircumflex = 667;
  21610. t.adieresis = 556;
  21611. t.edieresis = 556;
  21612. t.cacute = 500;
  21613. t.nacute = 556;
  21614. t.umacron = 556;
  21615. t.Ncaron = 722;
  21616. t.Iacute = 278;
  21617. t.plusminus = 584;
  21618. t.brokenbar = 260;
  21619. t.registered = 737;
  21620. t.Gbreve = 778;
  21621. t.Idotaccent = 278;
  21622. t.summation = 600;
  21623. t.Egrave = 667;
  21624. t.racute = 333;
  21625. t.omacron = 556;
  21626. t.Zacute = 611;
  21627. t.Zcaron = 611;
  21628. t.greaterequal = 549;
  21629. t.Eth = 722;
  21630. t.Ccedilla = 722;
  21631. t.lcommaaccent = 222;
  21632. t.tcaron = 317;
  21633. t.eogonek = 556;
  21634. t.Uogonek = 722;
  21635. t.Aacute = 667;
  21636. t.Adieresis = 667;
  21637. t.egrave = 556;
  21638. t.zacute = 500;
  21639. t.iogonek = 222;
  21640. t.Oacute = 778;
  21641. t.oacute = 556;
  21642. t.amacron = 556;
  21643. t.sacute = 500;
  21644. t.idieresis = 278;
  21645. t.Ocircumflex = 778;
  21646. t.Ugrave = 722;
  21647. t.Delta = 612;
  21648. t.thorn = 556;
  21649. t.twosuperior = 333;
  21650. t.Odieresis = 778;
  21651. t.mu = 556;
  21652. t.igrave = 278;
  21653. t.ohungarumlaut = 556;
  21654. t.Eogonek = 667;
  21655. t.dcroat = 556;
  21656. t.threequarters = 834;
  21657. t.Scedilla = 667;
  21658. t.lcaron = 299;
  21659. t.Kcommaaccent = 667;
  21660. t.Lacute = 556;
  21661. t.trademark = 1000;
  21662. t.edotaccent = 556;
  21663. t.Igrave = 278;
  21664. t.Imacron = 278;
  21665. t.Lcaron = 556;
  21666. t.onehalf = 834;
  21667. t.lessequal = 549;
  21668. t.ocircumflex = 556;
  21669. t.ntilde = 556;
  21670. t.Uhungarumlaut = 722;
  21671. t.Eacute = 667;
  21672. t.emacron = 556;
  21673. t.gbreve = 556;
  21674. t.onequarter = 834;
  21675. t.Scaron = 667;
  21676. t.Scommaaccent = 667;
  21677. t.Ohungarumlaut = 778;
  21678. t.degree = 400;
  21679. t.ograve = 556;
  21680. t.Ccaron = 722;
  21681. t.ugrave = 556;
  21682. t.radical = 453;
  21683. t.Dcaron = 722;
  21684. t.rcommaaccent = 333;
  21685. t.Ntilde = 722;
  21686. t.otilde = 556;
  21687. t.Rcommaaccent = 722;
  21688. t.Lcommaaccent = 556;
  21689. t.Atilde = 667;
  21690. t.Aogonek = 667;
  21691. t.Aring = 667;
  21692. t.Otilde = 778;
  21693. t.zdotaccent = 500;
  21694. t.Ecaron = 667;
  21695. t.Iogonek = 278;
  21696. t.kcommaaccent = 500;
  21697. t.minus = 584;
  21698. t.Icircumflex = 278;
  21699. t.ncaron = 556;
  21700. t.tcommaaccent = 278;
  21701. t.logicalnot = 584;
  21702. t.odieresis = 556;
  21703. t.udieresis = 556;
  21704. t.notequal = 549;
  21705. t.gcommaaccent = 556;
  21706. t.eth = 556;
  21707. t.zcaron = 500;
  21708. t.ncommaaccent = 556;
  21709. t.onesuperior = 333;
  21710. t.imacron = 278;
  21711. t.Euro = 556;
  21712. });
  21713. t["Helvetica-Bold"] = getLookupTableFactory(function (t) {
  21714. t.space = 278;
  21715. t.exclam = 333;
  21716. t.quotedbl = 474;
  21717. t.numbersign = 556;
  21718. t.dollar = 556;
  21719. t.percent = 889;
  21720. t.ampersand = 722;
  21721. t.quoteright = 278;
  21722. t.parenleft = 333;
  21723. t.parenright = 333;
  21724. t.asterisk = 389;
  21725. t.plus = 584;
  21726. t.comma = 278;
  21727. t.hyphen = 333;
  21728. t.period = 278;
  21729. t.slash = 278;
  21730. t.zero = 556;
  21731. t.one = 556;
  21732. t.two = 556;
  21733. t.three = 556;
  21734. t.four = 556;
  21735. t.five = 556;
  21736. t.six = 556;
  21737. t.seven = 556;
  21738. t.eight = 556;
  21739. t.nine = 556;
  21740. t.colon = 333;
  21741. t.semicolon = 333;
  21742. t.less = 584;
  21743. t.equal = 584;
  21744. t.greater = 584;
  21745. t.question = 611;
  21746. t.at = 975;
  21747. t.A = 722;
  21748. t.B = 722;
  21749. t.C = 722;
  21750. t.D = 722;
  21751. t.E = 667;
  21752. t.F = 611;
  21753. t.G = 778;
  21754. t.H = 722;
  21755. t.I = 278;
  21756. t.J = 556;
  21757. t.K = 722;
  21758. t.L = 611;
  21759. t.M = 833;
  21760. t.N = 722;
  21761. t.O = 778;
  21762. t.P = 667;
  21763. t.Q = 778;
  21764. t.R = 722;
  21765. t.S = 667;
  21766. t.T = 611;
  21767. t.U = 722;
  21768. t.V = 667;
  21769. t.W = 944;
  21770. t.X = 667;
  21771. t.Y = 667;
  21772. t.Z = 611;
  21773. t.bracketleft = 333;
  21774. t.backslash = 278;
  21775. t.bracketright = 333;
  21776. t.asciicircum = 584;
  21777. t.underscore = 556;
  21778. t.quoteleft = 278;
  21779. t.a = 556;
  21780. t.b = 611;
  21781. t.c = 556;
  21782. t.d = 611;
  21783. t.e = 556;
  21784. t.f = 333;
  21785. t.g = 611;
  21786. t.h = 611;
  21787. t.i = 278;
  21788. t.j = 278;
  21789. t.k = 556;
  21790. t.l = 278;
  21791. t.m = 889;
  21792. t.n = 611;
  21793. t.o = 611;
  21794. t.p = 611;
  21795. t.q = 611;
  21796. t.r = 389;
  21797. t.s = 556;
  21798. t.t = 333;
  21799. t.u = 611;
  21800. t.v = 556;
  21801. t.w = 778;
  21802. t.x = 556;
  21803. t.y = 556;
  21804. t.z = 500;
  21805. t.braceleft = 389;
  21806. t.bar = 280;
  21807. t.braceright = 389;
  21808. t.asciitilde = 584;
  21809. t.exclamdown = 333;
  21810. t.cent = 556;
  21811. t.sterling = 556;
  21812. t.fraction = 167;
  21813. t.yen = 556;
  21814. t.florin = 556;
  21815. t.section = 556;
  21816. t.currency = 556;
  21817. t.quotesingle = 238;
  21818. t.quotedblleft = 500;
  21819. t.guillemotleft = 556;
  21820. t.guilsinglleft = 333;
  21821. t.guilsinglright = 333;
  21822. t.fi = 611;
  21823. t.fl = 611;
  21824. t.endash = 556;
  21825. t.dagger = 556;
  21826. t.daggerdbl = 556;
  21827. t.periodcentered = 278;
  21828. t.paragraph = 556;
  21829. t.bullet = 350;
  21830. t.quotesinglbase = 278;
  21831. t.quotedblbase = 500;
  21832. t.quotedblright = 500;
  21833. t.guillemotright = 556;
  21834. t.ellipsis = 1000;
  21835. t.perthousand = 1000;
  21836. t.questiondown = 611;
  21837. t.grave = 333;
  21838. t.acute = 333;
  21839. t.circumflex = 333;
  21840. t.tilde = 333;
  21841. t.macron = 333;
  21842. t.breve = 333;
  21843. t.dotaccent = 333;
  21844. t.dieresis = 333;
  21845. t.ring = 333;
  21846. t.cedilla = 333;
  21847. t.hungarumlaut = 333;
  21848. t.ogonek = 333;
  21849. t.caron = 333;
  21850. t.emdash = 1000;
  21851. t.AE = 1000;
  21852. t.ordfeminine = 370;
  21853. t.Lslash = 611;
  21854. t.Oslash = 778;
  21855. t.OE = 1000;
  21856. t.ordmasculine = 365;
  21857. t.ae = 889;
  21858. t.dotlessi = 278;
  21859. t.lslash = 278;
  21860. t.oslash = 611;
  21861. t.oe = 944;
  21862. t.germandbls = 611;
  21863. t.Idieresis = 278;
  21864. t.eacute = 556;
  21865. t.abreve = 556;
  21866. t.uhungarumlaut = 611;
  21867. t.ecaron = 556;
  21868. t.Ydieresis = 667;
  21869. t.divide = 584;
  21870. t.Yacute = 667;
  21871. t.Acircumflex = 722;
  21872. t.aacute = 556;
  21873. t.Ucircumflex = 722;
  21874. t.yacute = 556;
  21875. t.scommaaccent = 556;
  21876. t.ecircumflex = 556;
  21877. t.Uring = 722;
  21878. t.Udieresis = 722;
  21879. t.aogonek = 556;
  21880. t.Uacute = 722;
  21881. t.uogonek = 611;
  21882. t.Edieresis = 667;
  21883. t.Dcroat = 722;
  21884. t.commaaccent = 250;
  21885. t.copyright = 737;
  21886. t.Emacron = 667;
  21887. t.ccaron = 556;
  21888. t.aring = 556;
  21889. t.Ncommaaccent = 722;
  21890. t.lacute = 278;
  21891. t.agrave = 556;
  21892. t.Tcommaaccent = 611;
  21893. t.Cacute = 722;
  21894. t.atilde = 556;
  21895. t.Edotaccent = 667;
  21896. t.scaron = 556;
  21897. t.scedilla = 556;
  21898. t.iacute = 278;
  21899. t.lozenge = 494;
  21900. t.Rcaron = 722;
  21901. t.Gcommaaccent = 778;
  21902. t.ucircumflex = 611;
  21903. t.acircumflex = 556;
  21904. t.Amacron = 722;
  21905. t.rcaron = 389;
  21906. t.ccedilla = 556;
  21907. t.Zdotaccent = 611;
  21908. t.Thorn = 667;
  21909. t.Omacron = 778;
  21910. t.Racute = 722;
  21911. t.Sacute = 667;
  21912. t.dcaron = 743;
  21913. t.Umacron = 722;
  21914. t.uring = 611;
  21915. t.threesuperior = 333;
  21916. t.Ograve = 778;
  21917. t.Agrave = 722;
  21918. t.Abreve = 722;
  21919. t.multiply = 584;
  21920. t.uacute = 611;
  21921. t.Tcaron = 611;
  21922. t.partialdiff = 494;
  21923. t.ydieresis = 556;
  21924. t.Nacute = 722;
  21925. t.icircumflex = 278;
  21926. t.Ecircumflex = 667;
  21927. t.adieresis = 556;
  21928. t.edieresis = 556;
  21929. t.cacute = 556;
  21930. t.nacute = 611;
  21931. t.umacron = 611;
  21932. t.Ncaron = 722;
  21933. t.Iacute = 278;
  21934. t.plusminus = 584;
  21935. t.brokenbar = 280;
  21936. t.registered = 737;
  21937. t.Gbreve = 778;
  21938. t.Idotaccent = 278;
  21939. t.summation = 600;
  21940. t.Egrave = 667;
  21941. t.racute = 389;
  21942. t.omacron = 611;
  21943. t.Zacute = 611;
  21944. t.Zcaron = 611;
  21945. t.greaterequal = 549;
  21946. t.Eth = 722;
  21947. t.Ccedilla = 722;
  21948. t.lcommaaccent = 278;
  21949. t.tcaron = 389;
  21950. t.eogonek = 556;
  21951. t.Uogonek = 722;
  21952. t.Aacute = 722;
  21953. t.Adieresis = 722;
  21954. t.egrave = 556;
  21955. t.zacute = 500;
  21956. t.iogonek = 278;
  21957. t.Oacute = 778;
  21958. t.oacute = 611;
  21959. t.amacron = 556;
  21960. t.sacute = 556;
  21961. t.idieresis = 278;
  21962. t.Ocircumflex = 778;
  21963. t.Ugrave = 722;
  21964. t.Delta = 612;
  21965. t.thorn = 611;
  21966. t.twosuperior = 333;
  21967. t.Odieresis = 778;
  21968. t.mu = 611;
  21969. t.igrave = 278;
  21970. t.ohungarumlaut = 611;
  21971. t.Eogonek = 667;
  21972. t.dcroat = 611;
  21973. t.threequarters = 834;
  21974. t.Scedilla = 667;
  21975. t.lcaron = 400;
  21976. t.Kcommaaccent = 722;
  21977. t.Lacute = 611;
  21978. t.trademark = 1000;
  21979. t.edotaccent = 556;
  21980. t.Igrave = 278;
  21981. t.Imacron = 278;
  21982. t.Lcaron = 611;
  21983. t.onehalf = 834;
  21984. t.lessequal = 549;
  21985. t.ocircumflex = 611;
  21986. t.ntilde = 611;
  21987. t.Uhungarumlaut = 722;
  21988. t.Eacute = 667;
  21989. t.emacron = 556;
  21990. t.gbreve = 611;
  21991. t.onequarter = 834;
  21992. t.Scaron = 667;
  21993. t.Scommaaccent = 667;
  21994. t.Ohungarumlaut = 778;
  21995. t.degree = 400;
  21996. t.ograve = 611;
  21997. t.Ccaron = 722;
  21998. t.ugrave = 611;
  21999. t.radical = 549;
  22000. t.Dcaron = 722;
  22001. t.rcommaaccent = 389;
  22002. t.Ntilde = 722;
  22003. t.otilde = 611;
  22004. t.Rcommaaccent = 722;
  22005. t.Lcommaaccent = 611;
  22006. t.Atilde = 722;
  22007. t.Aogonek = 722;
  22008. t.Aring = 722;
  22009. t.Otilde = 778;
  22010. t.zdotaccent = 500;
  22011. t.Ecaron = 667;
  22012. t.Iogonek = 278;
  22013. t.kcommaaccent = 556;
  22014. t.minus = 584;
  22015. t.Icircumflex = 278;
  22016. t.ncaron = 611;
  22017. t.tcommaaccent = 333;
  22018. t.logicalnot = 584;
  22019. t.odieresis = 611;
  22020. t.udieresis = 611;
  22021. t.notequal = 549;
  22022. t.gcommaaccent = 611;
  22023. t.eth = 611;
  22024. t.zcaron = 500;
  22025. t.ncommaaccent = 611;
  22026. t.onesuperior = 333;
  22027. t.imacron = 278;
  22028. t.Euro = 556;
  22029. });
  22030. t["Helvetica-BoldOblique"] = getLookupTableFactory(function (t) {
  22031. t.space = 278;
  22032. t.exclam = 333;
  22033. t.quotedbl = 474;
  22034. t.numbersign = 556;
  22035. t.dollar = 556;
  22036. t.percent = 889;
  22037. t.ampersand = 722;
  22038. t.quoteright = 278;
  22039. t.parenleft = 333;
  22040. t.parenright = 333;
  22041. t.asterisk = 389;
  22042. t.plus = 584;
  22043. t.comma = 278;
  22044. t.hyphen = 333;
  22045. t.period = 278;
  22046. t.slash = 278;
  22047. t.zero = 556;
  22048. t.one = 556;
  22049. t.two = 556;
  22050. t.three = 556;
  22051. t.four = 556;
  22052. t.five = 556;
  22053. t.six = 556;
  22054. t.seven = 556;
  22055. t.eight = 556;
  22056. t.nine = 556;
  22057. t.colon = 333;
  22058. t.semicolon = 333;
  22059. t.less = 584;
  22060. t.equal = 584;
  22061. t.greater = 584;
  22062. t.question = 611;
  22063. t.at = 975;
  22064. t.A = 722;
  22065. t.B = 722;
  22066. t.C = 722;
  22067. t.D = 722;
  22068. t.E = 667;
  22069. t.F = 611;
  22070. t.G = 778;
  22071. t.H = 722;
  22072. t.I = 278;
  22073. t.J = 556;
  22074. t.K = 722;
  22075. t.L = 611;
  22076. t.M = 833;
  22077. t.N = 722;
  22078. t.O = 778;
  22079. t.P = 667;
  22080. t.Q = 778;
  22081. t.R = 722;
  22082. t.S = 667;
  22083. t.T = 611;
  22084. t.U = 722;
  22085. t.V = 667;
  22086. t.W = 944;
  22087. t.X = 667;
  22088. t.Y = 667;
  22089. t.Z = 611;
  22090. t.bracketleft = 333;
  22091. t.backslash = 278;
  22092. t.bracketright = 333;
  22093. t.asciicircum = 584;
  22094. t.underscore = 556;
  22095. t.quoteleft = 278;
  22096. t.a = 556;
  22097. t.b = 611;
  22098. t.c = 556;
  22099. t.d = 611;
  22100. t.e = 556;
  22101. t.f = 333;
  22102. t.g = 611;
  22103. t.h = 611;
  22104. t.i = 278;
  22105. t.j = 278;
  22106. t.k = 556;
  22107. t.l = 278;
  22108. t.m = 889;
  22109. t.n = 611;
  22110. t.o = 611;
  22111. t.p = 611;
  22112. t.q = 611;
  22113. t.r = 389;
  22114. t.s = 556;
  22115. t.t = 333;
  22116. t.u = 611;
  22117. t.v = 556;
  22118. t.w = 778;
  22119. t.x = 556;
  22120. t.y = 556;
  22121. t.z = 500;
  22122. t.braceleft = 389;
  22123. t.bar = 280;
  22124. t.braceright = 389;
  22125. t.asciitilde = 584;
  22126. t.exclamdown = 333;
  22127. t.cent = 556;
  22128. t.sterling = 556;
  22129. t.fraction = 167;
  22130. t.yen = 556;
  22131. t.florin = 556;
  22132. t.section = 556;
  22133. t.currency = 556;
  22134. t.quotesingle = 238;
  22135. t.quotedblleft = 500;
  22136. t.guillemotleft = 556;
  22137. t.guilsinglleft = 333;
  22138. t.guilsinglright = 333;
  22139. t.fi = 611;
  22140. t.fl = 611;
  22141. t.endash = 556;
  22142. t.dagger = 556;
  22143. t.daggerdbl = 556;
  22144. t.periodcentered = 278;
  22145. t.paragraph = 556;
  22146. t.bullet = 350;
  22147. t.quotesinglbase = 278;
  22148. t.quotedblbase = 500;
  22149. t.quotedblright = 500;
  22150. t.guillemotright = 556;
  22151. t.ellipsis = 1000;
  22152. t.perthousand = 1000;
  22153. t.questiondown = 611;
  22154. t.grave = 333;
  22155. t.acute = 333;
  22156. t.circumflex = 333;
  22157. t.tilde = 333;
  22158. t.macron = 333;
  22159. t.breve = 333;
  22160. t.dotaccent = 333;
  22161. t.dieresis = 333;
  22162. t.ring = 333;
  22163. t.cedilla = 333;
  22164. t.hungarumlaut = 333;
  22165. t.ogonek = 333;
  22166. t.caron = 333;
  22167. t.emdash = 1000;
  22168. t.AE = 1000;
  22169. t.ordfeminine = 370;
  22170. t.Lslash = 611;
  22171. t.Oslash = 778;
  22172. t.OE = 1000;
  22173. t.ordmasculine = 365;
  22174. t.ae = 889;
  22175. t.dotlessi = 278;
  22176. t.lslash = 278;
  22177. t.oslash = 611;
  22178. t.oe = 944;
  22179. t.germandbls = 611;
  22180. t.Idieresis = 278;
  22181. t.eacute = 556;
  22182. t.abreve = 556;
  22183. t.uhungarumlaut = 611;
  22184. t.ecaron = 556;
  22185. t.Ydieresis = 667;
  22186. t.divide = 584;
  22187. t.Yacute = 667;
  22188. t.Acircumflex = 722;
  22189. t.aacute = 556;
  22190. t.Ucircumflex = 722;
  22191. t.yacute = 556;
  22192. t.scommaaccent = 556;
  22193. t.ecircumflex = 556;
  22194. t.Uring = 722;
  22195. t.Udieresis = 722;
  22196. t.aogonek = 556;
  22197. t.Uacute = 722;
  22198. t.uogonek = 611;
  22199. t.Edieresis = 667;
  22200. t.Dcroat = 722;
  22201. t.commaaccent = 250;
  22202. t.copyright = 737;
  22203. t.Emacron = 667;
  22204. t.ccaron = 556;
  22205. t.aring = 556;
  22206. t.Ncommaaccent = 722;
  22207. t.lacute = 278;
  22208. t.agrave = 556;
  22209. t.Tcommaaccent = 611;
  22210. t.Cacute = 722;
  22211. t.atilde = 556;
  22212. t.Edotaccent = 667;
  22213. t.scaron = 556;
  22214. t.scedilla = 556;
  22215. t.iacute = 278;
  22216. t.lozenge = 494;
  22217. t.Rcaron = 722;
  22218. t.Gcommaaccent = 778;
  22219. t.ucircumflex = 611;
  22220. t.acircumflex = 556;
  22221. t.Amacron = 722;
  22222. t.rcaron = 389;
  22223. t.ccedilla = 556;
  22224. t.Zdotaccent = 611;
  22225. t.Thorn = 667;
  22226. t.Omacron = 778;
  22227. t.Racute = 722;
  22228. t.Sacute = 667;
  22229. t.dcaron = 743;
  22230. t.Umacron = 722;
  22231. t.uring = 611;
  22232. t.threesuperior = 333;
  22233. t.Ograve = 778;
  22234. t.Agrave = 722;
  22235. t.Abreve = 722;
  22236. t.multiply = 584;
  22237. t.uacute = 611;
  22238. t.Tcaron = 611;
  22239. t.partialdiff = 494;
  22240. t.ydieresis = 556;
  22241. t.Nacute = 722;
  22242. t.icircumflex = 278;
  22243. t.Ecircumflex = 667;
  22244. t.adieresis = 556;
  22245. t.edieresis = 556;
  22246. t.cacute = 556;
  22247. t.nacute = 611;
  22248. t.umacron = 611;
  22249. t.Ncaron = 722;
  22250. t.Iacute = 278;
  22251. t.plusminus = 584;
  22252. t.brokenbar = 280;
  22253. t.registered = 737;
  22254. t.Gbreve = 778;
  22255. t.Idotaccent = 278;
  22256. t.summation = 600;
  22257. t.Egrave = 667;
  22258. t.racute = 389;
  22259. t.omacron = 611;
  22260. t.Zacute = 611;
  22261. t.Zcaron = 611;
  22262. t.greaterequal = 549;
  22263. t.Eth = 722;
  22264. t.Ccedilla = 722;
  22265. t.lcommaaccent = 278;
  22266. t.tcaron = 389;
  22267. t.eogonek = 556;
  22268. t.Uogonek = 722;
  22269. t.Aacute = 722;
  22270. t.Adieresis = 722;
  22271. t.egrave = 556;
  22272. t.zacute = 500;
  22273. t.iogonek = 278;
  22274. t.Oacute = 778;
  22275. t.oacute = 611;
  22276. t.amacron = 556;
  22277. t.sacute = 556;
  22278. t.idieresis = 278;
  22279. t.Ocircumflex = 778;
  22280. t.Ugrave = 722;
  22281. t.Delta = 612;
  22282. t.thorn = 611;
  22283. t.twosuperior = 333;
  22284. t.Odieresis = 778;
  22285. t.mu = 611;
  22286. t.igrave = 278;
  22287. t.ohungarumlaut = 611;
  22288. t.Eogonek = 667;
  22289. t.dcroat = 611;
  22290. t.threequarters = 834;
  22291. t.Scedilla = 667;
  22292. t.lcaron = 400;
  22293. t.Kcommaaccent = 722;
  22294. t.Lacute = 611;
  22295. t.trademark = 1000;
  22296. t.edotaccent = 556;
  22297. t.Igrave = 278;
  22298. t.Imacron = 278;
  22299. t.Lcaron = 611;
  22300. t.onehalf = 834;
  22301. t.lessequal = 549;
  22302. t.ocircumflex = 611;
  22303. t.ntilde = 611;
  22304. t.Uhungarumlaut = 722;
  22305. t.Eacute = 667;
  22306. t.emacron = 556;
  22307. t.gbreve = 611;
  22308. t.onequarter = 834;
  22309. t.Scaron = 667;
  22310. t.Scommaaccent = 667;
  22311. t.Ohungarumlaut = 778;
  22312. t.degree = 400;
  22313. t.ograve = 611;
  22314. t.Ccaron = 722;
  22315. t.ugrave = 611;
  22316. t.radical = 549;
  22317. t.Dcaron = 722;
  22318. t.rcommaaccent = 389;
  22319. t.Ntilde = 722;
  22320. t.otilde = 611;
  22321. t.Rcommaaccent = 722;
  22322. t.Lcommaaccent = 611;
  22323. t.Atilde = 722;
  22324. t.Aogonek = 722;
  22325. t.Aring = 722;
  22326. t.Otilde = 778;
  22327. t.zdotaccent = 500;
  22328. t.Ecaron = 667;
  22329. t.Iogonek = 278;
  22330. t.kcommaaccent = 556;
  22331. t.minus = 584;
  22332. t.Icircumflex = 278;
  22333. t.ncaron = 611;
  22334. t.tcommaaccent = 333;
  22335. t.logicalnot = 584;
  22336. t.odieresis = 611;
  22337. t.udieresis = 611;
  22338. t.notequal = 549;
  22339. t.gcommaaccent = 611;
  22340. t.eth = 611;
  22341. t.zcaron = 500;
  22342. t.ncommaaccent = 611;
  22343. t.onesuperior = 333;
  22344. t.imacron = 278;
  22345. t.Euro = 556;
  22346. });
  22347. t["Helvetica-Oblique"] = getLookupTableFactory(function (t) {
  22348. t.space = 278;
  22349. t.exclam = 278;
  22350. t.quotedbl = 355;
  22351. t.numbersign = 556;
  22352. t.dollar = 556;
  22353. t.percent = 889;
  22354. t.ampersand = 667;
  22355. t.quoteright = 222;
  22356. t.parenleft = 333;
  22357. t.parenright = 333;
  22358. t.asterisk = 389;
  22359. t.plus = 584;
  22360. t.comma = 278;
  22361. t.hyphen = 333;
  22362. t.period = 278;
  22363. t.slash = 278;
  22364. t.zero = 556;
  22365. t.one = 556;
  22366. t.two = 556;
  22367. t.three = 556;
  22368. t.four = 556;
  22369. t.five = 556;
  22370. t.six = 556;
  22371. t.seven = 556;
  22372. t.eight = 556;
  22373. t.nine = 556;
  22374. t.colon = 278;
  22375. t.semicolon = 278;
  22376. t.less = 584;
  22377. t.equal = 584;
  22378. t.greater = 584;
  22379. t.question = 556;
  22380. t.at = 1015;
  22381. t.A = 667;
  22382. t.B = 667;
  22383. t.C = 722;
  22384. t.D = 722;
  22385. t.E = 667;
  22386. t.F = 611;
  22387. t.G = 778;
  22388. t.H = 722;
  22389. t.I = 278;
  22390. t.J = 500;
  22391. t.K = 667;
  22392. t.L = 556;
  22393. t.M = 833;
  22394. t.N = 722;
  22395. t.O = 778;
  22396. t.P = 667;
  22397. t.Q = 778;
  22398. t.R = 722;
  22399. t.S = 667;
  22400. t.T = 611;
  22401. t.U = 722;
  22402. t.V = 667;
  22403. t.W = 944;
  22404. t.X = 667;
  22405. t.Y = 667;
  22406. t.Z = 611;
  22407. t.bracketleft = 278;
  22408. t.backslash = 278;
  22409. t.bracketright = 278;
  22410. t.asciicircum = 469;
  22411. t.underscore = 556;
  22412. t.quoteleft = 222;
  22413. t.a = 556;
  22414. t.b = 556;
  22415. t.c = 500;
  22416. t.d = 556;
  22417. t.e = 556;
  22418. t.f = 278;
  22419. t.g = 556;
  22420. t.h = 556;
  22421. t.i = 222;
  22422. t.j = 222;
  22423. t.k = 500;
  22424. t.l = 222;
  22425. t.m = 833;
  22426. t.n = 556;
  22427. t.o = 556;
  22428. t.p = 556;
  22429. t.q = 556;
  22430. t.r = 333;
  22431. t.s = 500;
  22432. t.t = 278;
  22433. t.u = 556;
  22434. t.v = 500;
  22435. t.w = 722;
  22436. t.x = 500;
  22437. t.y = 500;
  22438. t.z = 500;
  22439. t.braceleft = 334;
  22440. t.bar = 260;
  22441. t.braceright = 334;
  22442. t.asciitilde = 584;
  22443. t.exclamdown = 333;
  22444. t.cent = 556;
  22445. t.sterling = 556;
  22446. t.fraction = 167;
  22447. t.yen = 556;
  22448. t.florin = 556;
  22449. t.section = 556;
  22450. t.currency = 556;
  22451. t.quotesingle = 191;
  22452. t.quotedblleft = 333;
  22453. t.guillemotleft = 556;
  22454. t.guilsinglleft = 333;
  22455. t.guilsinglright = 333;
  22456. t.fi = 500;
  22457. t.fl = 500;
  22458. t.endash = 556;
  22459. t.dagger = 556;
  22460. t.daggerdbl = 556;
  22461. t.periodcentered = 278;
  22462. t.paragraph = 537;
  22463. t.bullet = 350;
  22464. t.quotesinglbase = 222;
  22465. t.quotedblbase = 333;
  22466. t.quotedblright = 333;
  22467. t.guillemotright = 556;
  22468. t.ellipsis = 1000;
  22469. t.perthousand = 1000;
  22470. t.questiondown = 611;
  22471. t.grave = 333;
  22472. t.acute = 333;
  22473. t.circumflex = 333;
  22474. t.tilde = 333;
  22475. t.macron = 333;
  22476. t.breve = 333;
  22477. t.dotaccent = 333;
  22478. t.dieresis = 333;
  22479. t.ring = 333;
  22480. t.cedilla = 333;
  22481. t.hungarumlaut = 333;
  22482. t.ogonek = 333;
  22483. t.caron = 333;
  22484. t.emdash = 1000;
  22485. t.AE = 1000;
  22486. t.ordfeminine = 370;
  22487. t.Lslash = 556;
  22488. t.Oslash = 778;
  22489. t.OE = 1000;
  22490. t.ordmasculine = 365;
  22491. t.ae = 889;
  22492. t.dotlessi = 278;
  22493. t.lslash = 222;
  22494. t.oslash = 611;
  22495. t.oe = 944;
  22496. t.germandbls = 611;
  22497. t.Idieresis = 278;
  22498. t.eacute = 556;
  22499. t.abreve = 556;
  22500. t.uhungarumlaut = 556;
  22501. t.ecaron = 556;
  22502. t.Ydieresis = 667;
  22503. t.divide = 584;
  22504. t.Yacute = 667;
  22505. t.Acircumflex = 667;
  22506. t.aacute = 556;
  22507. t.Ucircumflex = 722;
  22508. t.yacute = 500;
  22509. t.scommaaccent = 500;
  22510. t.ecircumflex = 556;
  22511. t.Uring = 722;
  22512. t.Udieresis = 722;
  22513. t.aogonek = 556;
  22514. t.Uacute = 722;
  22515. t.uogonek = 556;
  22516. t.Edieresis = 667;
  22517. t.Dcroat = 722;
  22518. t.commaaccent = 250;
  22519. t.copyright = 737;
  22520. t.Emacron = 667;
  22521. t.ccaron = 500;
  22522. t.aring = 556;
  22523. t.Ncommaaccent = 722;
  22524. t.lacute = 222;
  22525. t.agrave = 556;
  22526. t.Tcommaaccent = 611;
  22527. t.Cacute = 722;
  22528. t.atilde = 556;
  22529. t.Edotaccent = 667;
  22530. t.scaron = 500;
  22531. t.scedilla = 500;
  22532. t.iacute = 278;
  22533. t.lozenge = 471;
  22534. t.Rcaron = 722;
  22535. t.Gcommaaccent = 778;
  22536. t.ucircumflex = 556;
  22537. t.acircumflex = 556;
  22538. t.Amacron = 667;
  22539. t.rcaron = 333;
  22540. t.ccedilla = 500;
  22541. t.Zdotaccent = 611;
  22542. t.Thorn = 667;
  22543. t.Omacron = 778;
  22544. t.Racute = 722;
  22545. t.Sacute = 667;
  22546. t.dcaron = 643;
  22547. t.Umacron = 722;
  22548. t.uring = 556;
  22549. t.threesuperior = 333;
  22550. t.Ograve = 778;
  22551. t.Agrave = 667;
  22552. t.Abreve = 667;
  22553. t.multiply = 584;
  22554. t.uacute = 556;
  22555. t.Tcaron = 611;
  22556. t.partialdiff = 476;
  22557. t.ydieresis = 500;
  22558. t.Nacute = 722;
  22559. t.icircumflex = 278;
  22560. t.Ecircumflex = 667;
  22561. t.adieresis = 556;
  22562. t.edieresis = 556;
  22563. t.cacute = 500;
  22564. t.nacute = 556;
  22565. t.umacron = 556;
  22566. t.Ncaron = 722;
  22567. t.Iacute = 278;
  22568. t.plusminus = 584;
  22569. t.brokenbar = 260;
  22570. t.registered = 737;
  22571. t.Gbreve = 778;
  22572. t.Idotaccent = 278;
  22573. t.summation = 600;
  22574. t.Egrave = 667;
  22575. t.racute = 333;
  22576. t.omacron = 556;
  22577. t.Zacute = 611;
  22578. t.Zcaron = 611;
  22579. t.greaterequal = 549;
  22580. t.Eth = 722;
  22581. t.Ccedilla = 722;
  22582. t.lcommaaccent = 222;
  22583. t.tcaron = 317;
  22584. t.eogonek = 556;
  22585. t.Uogonek = 722;
  22586. t.Aacute = 667;
  22587. t.Adieresis = 667;
  22588. t.egrave = 556;
  22589. t.zacute = 500;
  22590. t.iogonek = 222;
  22591. t.Oacute = 778;
  22592. t.oacute = 556;
  22593. t.amacron = 556;
  22594. t.sacute = 500;
  22595. t.idieresis = 278;
  22596. t.Ocircumflex = 778;
  22597. t.Ugrave = 722;
  22598. t.Delta = 612;
  22599. t.thorn = 556;
  22600. t.twosuperior = 333;
  22601. t.Odieresis = 778;
  22602. t.mu = 556;
  22603. t.igrave = 278;
  22604. t.ohungarumlaut = 556;
  22605. t.Eogonek = 667;
  22606. t.dcroat = 556;
  22607. t.threequarters = 834;
  22608. t.Scedilla = 667;
  22609. t.lcaron = 299;
  22610. t.Kcommaaccent = 667;
  22611. t.Lacute = 556;
  22612. t.trademark = 1000;
  22613. t.edotaccent = 556;
  22614. t.Igrave = 278;
  22615. t.Imacron = 278;
  22616. t.Lcaron = 556;
  22617. t.onehalf = 834;
  22618. t.lessequal = 549;
  22619. t.ocircumflex = 556;
  22620. t.ntilde = 556;
  22621. t.Uhungarumlaut = 722;
  22622. t.Eacute = 667;
  22623. t.emacron = 556;
  22624. t.gbreve = 556;
  22625. t.onequarter = 834;
  22626. t.Scaron = 667;
  22627. t.Scommaaccent = 667;
  22628. t.Ohungarumlaut = 778;
  22629. t.degree = 400;
  22630. t.ograve = 556;
  22631. t.Ccaron = 722;
  22632. t.ugrave = 556;
  22633. t.radical = 453;
  22634. t.Dcaron = 722;
  22635. t.rcommaaccent = 333;
  22636. t.Ntilde = 722;
  22637. t.otilde = 556;
  22638. t.Rcommaaccent = 722;
  22639. t.Lcommaaccent = 556;
  22640. t.Atilde = 667;
  22641. t.Aogonek = 667;
  22642. t.Aring = 667;
  22643. t.Otilde = 778;
  22644. t.zdotaccent = 500;
  22645. t.Ecaron = 667;
  22646. t.Iogonek = 278;
  22647. t.kcommaaccent = 500;
  22648. t.minus = 584;
  22649. t.Icircumflex = 278;
  22650. t.ncaron = 556;
  22651. t.tcommaaccent = 278;
  22652. t.logicalnot = 584;
  22653. t.odieresis = 556;
  22654. t.udieresis = 556;
  22655. t.notequal = 549;
  22656. t.gcommaaccent = 556;
  22657. t.eth = 556;
  22658. t.zcaron = 500;
  22659. t.ncommaaccent = 556;
  22660. t.onesuperior = 333;
  22661. t.imacron = 278;
  22662. t.Euro = 556;
  22663. });
  22664. t.Symbol = getLookupTableFactory(function (t) {
  22665. t.space = 250;
  22666. t.exclam = 333;
  22667. t.universal = 713;
  22668. t.numbersign = 500;
  22669. t.existential = 549;
  22670. t.percent = 833;
  22671. t.ampersand = 778;
  22672. t.suchthat = 439;
  22673. t.parenleft = 333;
  22674. t.parenright = 333;
  22675. t.asteriskmath = 500;
  22676. t.plus = 549;
  22677. t.comma = 250;
  22678. t.minus = 549;
  22679. t.period = 250;
  22680. t.slash = 278;
  22681. t.zero = 500;
  22682. t.one = 500;
  22683. t.two = 500;
  22684. t.three = 500;
  22685. t.four = 500;
  22686. t.five = 500;
  22687. t.six = 500;
  22688. t.seven = 500;
  22689. t.eight = 500;
  22690. t.nine = 500;
  22691. t.colon = 278;
  22692. t.semicolon = 278;
  22693. t.less = 549;
  22694. t.equal = 549;
  22695. t.greater = 549;
  22696. t.question = 444;
  22697. t.congruent = 549;
  22698. t.Alpha = 722;
  22699. t.Beta = 667;
  22700. t.Chi = 722;
  22701. t.Delta = 612;
  22702. t.Epsilon = 611;
  22703. t.Phi = 763;
  22704. t.Gamma = 603;
  22705. t.Eta = 722;
  22706. t.Iota = 333;
  22707. t.theta1 = 631;
  22708. t.Kappa = 722;
  22709. t.Lambda = 686;
  22710. t.Mu = 889;
  22711. t.Nu = 722;
  22712. t.Omicron = 722;
  22713. t.Pi = 768;
  22714. t.Theta = 741;
  22715. t.Rho = 556;
  22716. t.Sigma = 592;
  22717. t.Tau = 611;
  22718. t.Upsilon = 690;
  22719. t.sigma1 = 439;
  22720. t.Omega = 768;
  22721. t.Xi = 645;
  22722. t.Psi = 795;
  22723. t.Zeta = 611;
  22724. t.bracketleft = 333;
  22725. t.therefore = 863;
  22726. t.bracketright = 333;
  22727. t.perpendicular = 658;
  22728. t.underscore = 500;
  22729. t.radicalex = 500;
  22730. t.alpha = 631;
  22731. t.beta = 549;
  22732. t.chi = 549;
  22733. t.delta = 494;
  22734. t.epsilon = 439;
  22735. t.phi = 521;
  22736. t.gamma = 411;
  22737. t.eta = 603;
  22738. t.iota = 329;
  22739. t.phi1 = 603;
  22740. t.kappa = 549;
  22741. t.lambda = 549;
  22742. t.mu = 576;
  22743. t.nu = 521;
  22744. t.omicron = 549;
  22745. t.pi = 549;
  22746. t.theta = 521;
  22747. t.rho = 549;
  22748. t.sigma = 603;
  22749. t.tau = 439;
  22750. t.upsilon = 576;
  22751. t.omega1 = 713;
  22752. t.omega = 686;
  22753. t.xi = 493;
  22754. t.psi = 686;
  22755. t.zeta = 494;
  22756. t.braceleft = 480;
  22757. t.bar = 200;
  22758. t.braceright = 480;
  22759. t.similar = 549;
  22760. t.Euro = 750;
  22761. t.Upsilon1 = 620;
  22762. t.minute = 247;
  22763. t.lessequal = 549;
  22764. t.fraction = 167;
  22765. t.infinity = 713;
  22766. t.florin = 500;
  22767. t.club = 753;
  22768. t.diamond = 753;
  22769. t.heart = 753;
  22770. t.spade = 753;
  22771. t.arrowboth = 1042;
  22772. t.arrowleft = 987;
  22773. t.arrowup = 603;
  22774. t.arrowright = 987;
  22775. t.arrowdown = 603;
  22776. t.degree = 400;
  22777. t.plusminus = 549;
  22778. t.second = 411;
  22779. t.greaterequal = 549;
  22780. t.multiply = 549;
  22781. t.proportional = 713;
  22782. t.partialdiff = 494;
  22783. t.bullet = 460;
  22784. t.divide = 549;
  22785. t.notequal = 549;
  22786. t.equivalence = 549;
  22787. t.approxequal = 549;
  22788. t.ellipsis = 1000;
  22789. t.arrowvertex = 603;
  22790. t.arrowhorizex = 1000;
  22791. t.carriagereturn = 658;
  22792. t.aleph = 823;
  22793. t.Ifraktur = 686;
  22794. t.Rfraktur = 795;
  22795. t.weierstrass = 987;
  22796. t.circlemultiply = 768;
  22797. t.circleplus = 768;
  22798. t.emptyset = 823;
  22799. t.intersection = 768;
  22800. t.union = 768;
  22801. t.propersuperset = 713;
  22802. t.reflexsuperset = 713;
  22803. t.notsubset = 713;
  22804. t.propersubset = 713;
  22805. t.reflexsubset = 713;
  22806. t.element = 713;
  22807. t.notelement = 713;
  22808. t.angle = 768;
  22809. t.gradient = 713;
  22810. t.registerserif = 790;
  22811. t.copyrightserif = 790;
  22812. t.trademarkserif = 890;
  22813. t.product = 823;
  22814. t.radical = 549;
  22815. t.dotmath = 250;
  22816. t.logicalnot = 713;
  22817. t.logicaland = 603;
  22818. t.logicalor = 603;
  22819. t.arrowdblboth = 1042;
  22820. t.arrowdblleft = 987;
  22821. t.arrowdblup = 603;
  22822. t.arrowdblright = 987;
  22823. t.arrowdbldown = 603;
  22824. t.lozenge = 494;
  22825. t.angleleft = 329;
  22826. t.registersans = 790;
  22827. t.copyrightsans = 790;
  22828. t.trademarksans = 786;
  22829. t.summation = 713;
  22830. t.parenlefttp = 384;
  22831. t.parenleftex = 384;
  22832. t.parenleftbt = 384;
  22833. t.bracketlefttp = 384;
  22834. t.bracketleftex = 384;
  22835. t.bracketleftbt = 384;
  22836. t.bracelefttp = 494;
  22837. t.braceleftmid = 494;
  22838. t.braceleftbt = 494;
  22839. t.braceex = 494;
  22840. t.angleright = 329;
  22841. t.integral = 274;
  22842. t.integraltp = 686;
  22843. t.integralex = 686;
  22844. t.integralbt = 686;
  22845. t.parenrighttp = 384;
  22846. t.parenrightex = 384;
  22847. t.parenrightbt = 384;
  22848. t.bracketrighttp = 384;
  22849. t.bracketrightex = 384;
  22850. t.bracketrightbt = 384;
  22851. t.bracerighttp = 494;
  22852. t.bracerightmid = 494;
  22853. t.bracerightbt = 494;
  22854. t.apple = 790;
  22855. });
  22856. t["Times-Roman"] = getLookupTableFactory(function (t) {
  22857. t.space = 250;
  22858. t.exclam = 333;
  22859. t.quotedbl = 408;
  22860. t.numbersign = 500;
  22861. t.dollar = 500;
  22862. t.percent = 833;
  22863. t.ampersand = 778;
  22864. t.quoteright = 333;
  22865. t.parenleft = 333;
  22866. t.parenright = 333;
  22867. t.asterisk = 500;
  22868. t.plus = 564;
  22869. t.comma = 250;
  22870. t.hyphen = 333;
  22871. t.period = 250;
  22872. t.slash = 278;
  22873. t.zero = 500;
  22874. t.one = 500;
  22875. t.two = 500;
  22876. t.three = 500;
  22877. t.four = 500;
  22878. t.five = 500;
  22879. t.six = 500;
  22880. t.seven = 500;
  22881. t.eight = 500;
  22882. t.nine = 500;
  22883. t.colon = 278;
  22884. t.semicolon = 278;
  22885. t.less = 564;
  22886. t.equal = 564;
  22887. t.greater = 564;
  22888. t.question = 444;
  22889. t.at = 921;
  22890. t.A = 722;
  22891. t.B = 667;
  22892. t.C = 667;
  22893. t.D = 722;
  22894. t.E = 611;
  22895. t.F = 556;
  22896. t.G = 722;
  22897. t.H = 722;
  22898. t.I = 333;
  22899. t.J = 389;
  22900. t.K = 722;
  22901. t.L = 611;
  22902. t.M = 889;
  22903. t.N = 722;
  22904. t.O = 722;
  22905. t.P = 556;
  22906. t.Q = 722;
  22907. t.R = 667;
  22908. t.S = 556;
  22909. t.T = 611;
  22910. t.U = 722;
  22911. t.V = 722;
  22912. t.W = 944;
  22913. t.X = 722;
  22914. t.Y = 722;
  22915. t.Z = 611;
  22916. t.bracketleft = 333;
  22917. t.backslash = 278;
  22918. t.bracketright = 333;
  22919. t.asciicircum = 469;
  22920. t.underscore = 500;
  22921. t.quoteleft = 333;
  22922. t.a = 444;
  22923. t.b = 500;
  22924. t.c = 444;
  22925. t.d = 500;
  22926. t.e = 444;
  22927. t.f = 333;
  22928. t.g = 500;
  22929. t.h = 500;
  22930. t.i = 278;
  22931. t.j = 278;
  22932. t.k = 500;
  22933. t.l = 278;
  22934. t.m = 778;
  22935. t.n = 500;
  22936. t.o = 500;
  22937. t.p = 500;
  22938. t.q = 500;
  22939. t.r = 333;
  22940. t.s = 389;
  22941. t.t = 278;
  22942. t.u = 500;
  22943. t.v = 500;
  22944. t.w = 722;
  22945. t.x = 500;
  22946. t.y = 500;
  22947. t.z = 444;
  22948. t.braceleft = 480;
  22949. t.bar = 200;
  22950. t.braceright = 480;
  22951. t.asciitilde = 541;
  22952. t.exclamdown = 333;
  22953. t.cent = 500;
  22954. t.sterling = 500;
  22955. t.fraction = 167;
  22956. t.yen = 500;
  22957. t.florin = 500;
  22958. t.section = 500;
  22959. t.currency = 500;
  22960. t.quotesingle = 180;
  22961. t.quotedblleft = 444;
  22962. t.guillemotleft = 500;
  22963. t.guilsinglleft = 333;
  22964. t.guilsinglright = 333;
  22965. t.fi = 556;
  22966. t.fl = 556;
  22967. t.endash = 500;
  22968. t.dagger = 500;
  22969. t.daggerdbl = 500;
  22970. t.periodcentered = 250;
  22971. t.paragraph = 453;
  22972. t.bullet = 350;
  22973. t.quotesinglbase = 333;
  22974. t.quotedblbase = 444;
  22975. t.quotedblright = 444;
  22976. t.guillemotright = 500;
  22977. t.ellipsis = 1000;
  22978. t.perthousand = 1000;
  22979. t.questiondown = 444;
  22980. t.grave = 333;
  22981. t.acute = 333;
  22982. t.circumflex = 333;
  22983. t.tilde = 333;
  22984. t.macron = 333;
  22985. t.breve = 333;
  22986. t.dotaccent = 333;
  22987. t.dieresis = 333;
  22988. t.ring = 333;
  22989. t.cedilla = 333;
  22990. t.hungarumlaut = 333;
  22991. t.ogonek = 333;
  22992. t.caron = 333;
  22993. t.emdash = 1000;
  22994. t.AE = 889;
  22995. t.ordfeminine = 276;
  22996. t.Lslash = 611;
  22997. t.Oslash = 722;
  22998. t.OE = 889;
  22999. t.ordmasculine = 310;
  23000. t.ae = 667;
  23001. t.dotlessi = 278;
  23002. t.lslash = 278;
  23003. t.oslash = 500;
  23004. t.oe = 722;
  23005. t.germandbls = 500;
  23006. t.Idieresis = 333;
  23007. t.eacute = 444;
  23008. t.abreve = 444;
  23009. t.uhungarumlaut = 500;
  23010. t.ecaron = 444;
  23011. t.Ydieresis = 722;
  23012. t.divide = 564;
  23013. t.Yacute = 722;
  23014. t.Acircumflex = 722;
  23015. t.aacute = 444;
  23016. t.Ucircumflex = 722;
  23017. t.yacute = 500;
  23018. t.scommaaccent = 389;
  23019. t.ecircumflex = 444;
  23020. t.Uring = 722;
  23021. t.Udieresis = 722;
  23022. t.aogonek = 444;
  23023. t.Uacute = 722;
  23024. t.uogonek = 500;
  23025. t.Edieresis = 611;
  23026. t.Dcroat = 722;
  23027. t.commaaccent = 250;
  23028. t.copyright = 760;
  23029. t.Emacron = 611;
  23030. t.ccaron = 444;
  23031. t.aring = 444;
  23032. t.Ncommaaccent = 722;
  23033. t.lacute = 278;
  23034. t.agrave = 444;
  23035. t.Tcommaaccent = 611;
  23036. t.Cacute = 667;
  23037. t.atilde = 444;
  23038. t.Edotaccent = 611;
  23039. t.scaron = 389;
  23040. t.scedilla = 389;
  23041. t.iacute = 278;
  23042. t.lozenge = 471;
  23043. t.Rcaron = 667;
  23044. t.Gcommaaccent = 722;
  23045. t.ucircumflex = 500;
  23046. t.acircumflex = 444;
  23047. t.Amacron = 722;
  23048. t.rcaron = 333;
  23049. t.ccedilla = 444;
  23050. t.Zdotaccent = 611;
  23051. t.Thorn = 556;
  23052. t.Omacron = 722;
  23053. t.Racute = 667;
  23054. t.Sacute = 556;
  23055. t.dcaron = 588;
  23056. t.Umacron = 722;
  23057. t.uring = 500;
  23058. t.threesuperior = 300;
  23059. t.Ograve = 722;
  23060. t.Agrave = 722;
  23061. t.Abreve = 722;
  23062. t.multiply = 564;
  23063. t.uacute = 500;
  23064. t.Tcaron = 611;
  23065. t.partialdiff = 476;
  23066. t.ydieresis = 500;
  23067. t.Nacute = 722;
  23068. t.icircumflex = 278;
  23069. t.Ecircumflex = 611;
  23070. t.adieresis = 444;
  23071. t.edieresis = 444;
  23072. t.cacute = 444;
  23073. t.nacute = 500;
  23074. t.umacron = 500;
  23075. t.Ncaron = 722;
  23076. t.Iacute = 333;
  23077. t.plusminus = 564;
  23078. t.brokenbar = 200;
  23079. t.registered = 760;
  23080. t.Gbreve = 722;
  23081. t.Idotaccent = 333;
  23082. t.summation = 600;
  23083. t.Egrave = 611;
  23084. t.racute = 333;
  23085. t.omacron = 500;
  23086. t.Zacute = 611;
  23087. t.Zcaron = 611;
  23088. t.greaterequal = 549;
  23089. t.Eth = 722;
  23090. t.Ccedilla = 667;
  23091. t.lcommaaccent = 278;
  23092. t.tcaron = 326;
  23093. t.eogonek = 444;
  23094. t.Uogonek = 722;
  23095. t.Aacute = 722;
  23096. t.Adieresis = 722;
  23097. t.egrave = 444;
  23098. t.zacute = 444;
  23099. t.iogonek = 278;
  23100. t.Oacute = 722;
  23101. t.oacute = 500;
  23102. t.amacron = 444;
  23103. t.sacute = 389;
  23104. t.idieresis = 278;
  23105. t.Ocircumflex = 722;
  23106. t.Ugrave = 722;
  23107. t.Delta = 612;
  23108. t.thorn = 500;
  23109. t.twosuperior = 300;
  23110. t.Odieresis = 722;
  23111. t.mu = 500;
  23112. t.igrave = 278;
  23113. t.ohungarumlaut = 500;
  23114. t.Eogonek = 611;
  23115. t.dcroat = 500;
  23116. t.threequarters = 750;
  23117. t.Scedilla = 556;
  23118. t.lcaron = 344;
  23119. t.Kcommaaccent = 722;
  23120. t.Lacute = 611;
  23121. t.trademark = 980;
  23122. t.edotaccent = 444;
  23123. t.Igrave = 333;
  23124. t.Imacron = 333;
  23125. t.Lcaron = 611;
  23126. t.onehalf = 750;
  23127. t.lessequal = 549;
  23128. t.ocircumflex = 500;
  23129. t.ntilde = 500;
  23130. t.Uhungarumlaut = 722;
  23131. t.Eacute = 611;
  23132. t.emacron = 444;
  23133. t.gbreve = 500;
  23134. t.onequarter = 750;
  23135. t.Scaron = 556;
  23136. t.Scommaaccent = 556;
  23137. t.Ohungarumlaut = 722;
  23138. t.degree = 400;
  23139. t.ograve = 500;
  23140. t.Ccaron = 667;
  23141. t.ugrave = 500;
  23142. t.radical = 453;
  23143. t.Dcaron = 722;
  23144. t.rcommaaccent = 333;
  23145. t.Ntilde = 722;
  23146. t.otilde = 500;
  23147. t.Rcommaaccent = 667;
  23148. t.Lcommaaccent = 611;
  23149. t.Atilde = 722;
  23150. t.Aogonek = 722;
  23151. t.Aring = 722;
  23152. t.Otilde = 722;
  23153. t.zdotaccent = 444;
  23154. t.Ecaron = 611;
  23155. t.Iogonek = 333;
  23156. t.kcommaaccent = 500;
  23157. t.minus = 564;
  23158. t.Icircumflex = 333;
  23159. t.ncaron = 500;
  23160. t.tcommaaccent = 278;
  23161. t.logicalnot = 564;
  23162. t.odieresis = 500;
  23163. t.udieresis = 500;
  23164. t.notequal = 549;
  23165. t.gcommaaccent = 500;
  23166. t.eth = 500;
  23167. t.zcaron = 444;
  23168. t.ncommaaccent = 500;
  23169. t.onesuperior = 300;
  23170. t.imacron = 278;
  23171. t.Euro = 500;
  23172. });
  23173. t["Times-Bold"] = getLookupTableFactory(function (t) {
  23174. t.space = 250;
  23175. t.exclam = 333;
  23176. t.quotedbl = 555;
  23177. t.numbersign = 500;
  23178. t.dollar = 500;
  23179. t.percent = 1000;
  23180. t.ampersand = 833;
  23181. t.quoteright = 333;
  23182. t.parenleft = 333;
  23183. t.parenright = 333;
  23184. t.asterisk = 500;
  23185. t.plus = 570;
  23186. t.comma = 250;
  23187. t.hyphen = 333;
  23188. t.period = 250;
  23189. t.slash = 278;
  23190. t.zero = 500;
  23191. t.one = 500;
  23192. t.two = 500;
  23193. t.three = 500;
  23194. t.four = 500;
  23195. t.five = 500;
  23196. t.six = 500;
  23197. t.seven = 500;
  23198. t.eight = 500;
  23199. t.nine = 500;
  23200. t.colon = 333;
  23201. t.semicolon = 333;
  23202. t.less = 570;
  23203. t.equal = 570;
  23204. t.greater = 570;
  23205. t.question = 500;
  23206. t.at = 930;
  23207. t.A = 722;
  23208. t.B = 667;
  23209. t.C = 722;
  23210. t.D = 722;
  23211. t.E = 667;
  23212. t.F = 611;
  23213. t.G = 778;
  23214. t.H = 778;
  23215. t.I = 389;
  23216. t.J = 500;
  23217. t.K = 778;
  23218. t.L = 667;
  23219. t.M = 944;
  23220. t.N = 722;
  23221. t.O = 778;
  23222. t.P = 611;
  23223. t.Q = 778;
  23224. t.R = 722;
  23225. t.S = 556;
  23226. t.T = 667;
  23227. t.U = 722;
  23228. t.V = 722;
  23229. t.W = 1000;
  23230. t.X = 722;
  23231. t.Y = 722;
  23232. t.Z = 667;
  23233. t.bracketleft = 333;
  23234. t.backslash = 278;
  23235. t.bracketright = 333;
  23236. t.asciicircum = 581;
  23237. t.underscore = 500;
  23238. t.quoteleft = 333;
  23239. t.a = 500;
  23240. t.b = 556;
  23241. t.c = 444;
  23242. t.d = 556;
  23243. t.e = 444;
  23244. t.f = 333;
  23245. t.g = 500;
  23246. t.h = 556;
  23247. t.i = 278;
  23248. t.j = 333;
  23249. t.k = 556;
  23250. t.l = 278;
  23251. t.m = 833;
  23252. t.n = 556;
  23253. t.o = 500;
  23254. t.p = 556;
  23255. t.q = 556;
  23256. t.r = 444;
  23257. t.s = 389;
  23258. t.t = 333;
  23259. t.u = 556;
  23260. t.v = 500;
  23261. t.w = 722;
  23262. t.x = 500;
  23263. t.y = 500;
  23264. t.z = 444;
  23265. t.braceleft = 394;
  23266. t.bar = 220;
  23267. t.braceright = 394;
  23268. t.asciitilde = 520;
  23269. t.exclamdown = 333;
  23270. t.cent = 500;
  23271. t.sterling = 500;
  23272. t.fraction = 167;
  23273. t.yen = 500;
  23274. t.florin = 500;
  23275. t.section = 500;
  23276. t.currency = 500;
  23277. t.quotesingle = 278;
  23278. t.quotedblleft = 500;
  23279. t.guillemotleft = 500;
  23280. t.guilsinglleft = 333;
  23281. t.guilsinglright = 333;
  23282. t.fi = 556;
  23283. t.fl = 556;
  23284. t.endash = 500;
  23285. t.dagger = 500;
  23286. t.daggerdbl = 500;
  23287. t.periodcentered = 250;
  23288. t.paragraph = 540;
  23289. t.bullet = 350;
  23290. t.quotesinglbase = 333;
  23291. t.quotedblbase = 500;
  23292. t.quotedblright = 500;
  23293. t.guillemotright = 500;
  23294. t.ellipsis = 1000;
  23295. t.perthousand = 1000;
  23296. t.questiondown = 500;
  23297. t.grave = 333;
  23298. t.acute = 333;
  23299. t.circumflex = 333;
  23300. t.tilde = 333;
  23301. t.macron = 333;
  23302. t.breve = 333;
  23303. t.dotaccent = 333;
  23304. t.dieresis = 333;
  23305. t.ring = 333;
  23306. t.cedilla = 333;
  23307. t.hungarumlaut = 333;
  23308. t.ogonek = 333;
  23309. t.caron = 333;
  23310. t.emdash = 1000;
  23311. t.AE = 1000;
  23312. t.ordfeminine = 300;
  23313. t.Lslash = 667;
  23314. t.Oslash = 778;
  23315. t.OE = 1000;
  23316. t.ordmasculine = 330;
  23317. t.ae = 722;
  23318. t.dotlessi = 278;
  23319. t.lslash = 278;
  23320. t.oslash = 500;
  23321. t.oe = 722;
  23322. t.germandbls = 556;
  23323. t.Idieresis = 389;
  23324. t.eacute = 444;
  23325. t.abreve = 500;
  23326. t.uhungarumlaut = 556;
  23327. t.ecaron = 444;
  23328. t.Ydieresis = 722;
  23329. t.divide = 570;
  23330. t.Yacute = 722;
  23331. t.Acircumflex = 722;
  23332. t.aacute = 500;
  23333. t.Ucircumflex = 722;
  23334. t.yacute = 500;
  23335. t.scommaaccent = 389;
  23336. t.ecircumflex = 444;
  23337. t.Uring = 722;
  23338. t.Udieresis = 722;
  23339. t.aogonek = 500;
  23340. t.Uacute = 722;
  23341. t.uogonek = 556;
  23342. t.Edieresis = 667;
  23343. t.Dcroat = 722;
  23344. t.commaaccent = 250;
  23345. t.copyright = 747;
  23346. t.Emacron = 667;
  23347. t.ccaron = 444;
  23348. t.aring = 500;
  23349. t.Ncommaaccent = 722;
  23350. t.lacute = 278;
  23351. t.agrave = 500;
  23352. t.Tcommaaccent = 667;
  23353. t.Cacute = 722;
  23354. t.atilde = 500;
  23355. t.Edotaccent = 667;
  23356. t.scaron = 389;
  23357. t.scedilla = 389;
  23358. t.iacute = 278;
  23359. t.lozenge = 494;
  23360. t.Rcaron = 722;
  23361. t.Gcommaaccent = 778;
  23362. t.ucircumflex = 556;
  23363. t.acircumflex = 500;
  23364. t.Amacron = 722;
  23365. t.rcaron = 444;
  23366. t.ccedilla = 444;
  23367. t.Zdotaccent = 667;
  23368. t.Thorn = 611;
  23369. t.Omacron = 778;
  23370. t.Racute = 722;
  23371. t.Sacute = 556;
  23372. t.dcaron = 672;
  23373. t.Umacron = 722;
  23374. t.uring = 556;
  23375. t.threesuperior = 300;
  23376. t.Ograve = 778;
  23377. t.Agrave = 722;
  23378. t.Abreve = 722;
  23379. t.multiply = 570;
  23380. t.uacute = 556;
  23381. t.Tcaron = 667;
  23382. t.partialdiff = 494;
  23383. t.ydieresis = 500;
  23384. t.Nacute = 722;
  23385. t.icircumflex = 278;
  23386. t.Ecircumflex = 667;
  23387. t.adieresis = 500;
  23388. t.edieresis = 444;
  23389. t.cacute = 444;
  23390. t.nacute = 556;
  23391. t.umacron = 556;
  23392. t.Ncaron = 722;
  23393. t.Iacute = 389;
  23394. t.plusminus = 570;
  23395. t.brokenbar = 220;
  23396. t.registered = 747;
  23397. t.Gbreve = 778;
  23398. t.Idotaccent = 389;
  23399. t.summation = 600;
  23400. t.Egrave = 667;
  23401. t.racute = 444;
  23402. t.omacron = 500;
  23403. t.Zacute = 667;
  23404. t.Zcaron = 667;
  23405. t.greaterequal = 549;
  23406. t.Eth = 722;
  23407. t.Ccedilla = 722;
  23408. t.lcommaaccent = 278;
  23409. t.tcaron = 416;
  23410. t.eogonek = 444;
  23411. t.Uogonek = 722;
  23412. t.Aacute = 722;
  23413. t.Adieresis = 722;
  23414. t.egrave = 444;
  23415. t.zacute = 444;
  23416. t.iogonek = 278;
  23417. t.Oacute = 778;
  23418. t.oacute = 500;
  23419. t.amacron = 500;
  23420. t.sacute = 389;
  23421. t.idieresis = 278;
  23422. t.Ocircumflex = 778;
  23423. t.Ugrave = 722;
  23424. t.Delta = 612;
  23425. t.thorn = 556;
  23426. t.twosuperior = 300;
  23427. t.Odieresis = 778;
  23428. t.mu = 556;
  23429. t.igrave = 278;
  23430. t.ohungarumlaut = 500;
  23431. t.Eogonek = 667;
  23432. t.dcroat = 556;
  23433. t.threequarters = 750;
  23434. t.Scedilla = 556;
  23435. t.lcaron = 394;
  23436. t.Kcommaaccent = 778;
  23437. t.Lacute = 667;
  23438. t.trademark = 1000;
  23439. t.edotaccent = 444;
  23440. t.Igrave = 389;
  23441. t.Imacron = 389;
  23442. t.Lcaron = 667;
  23443. t.onehalf = 750;
  23444. t.lessequal = 549;
  23445. t.ocircumflex = 500;
  23446. t.ntilde = 556;
  23447. t.Uhungarumlaut = 722;
  23448. t.Eacute = 667;
  23449. t.emacron = 444;
  23450. t.gbreve = 500;
  23451. t.onequarter = 750;
  23452. t.Scaron = 556;
  23453. t.Scommaaccent = 556;
  23454. t.Ohungarumlaut = 778;
  23455. t.degree = 400;
  23456. t.ograve = 500;
  23457. t.Ccaron = 722;
  23458. t.ugrave = 556;
  23459. t.radical = 549;
  23460. t.Dcaron = 722;
  23461. t.rcommaaccent = 444;
  23462. t.Ntilde = 722;
  23463. t.otilde = 500;
  23464. t.Rcommaaccent = 722;
  23465. t.Lcommaaccent = 667;
  23466. t.Atilde = 722;
  23467. t.Aogonek = 722;
  23468. t.Aring = 722;
  23469. t.Otilde = 778;
  23470. t.zdotaccent = 444;
  23471. t.Ecaron = 667;
  23472. t.Iogonek = 389;
  23473. t.kcommaaccent = 556;
  23474. t.minus = 570;
  23475. t.Icircumflex = 389;
  23476. t.ncaron = 556;
  23477. t.tcommaaccent = 333;
  23478. t.logicalnot = 570;
  23479. t.odieresis = 500;
  23480. t.udieresis = 556;
  23481. t.notequal = 549;
  23482. t.gcommaaccent = 500;
  23483. t.eth = 500;
  23484. t.zcaron = 444;
  23485. t.ncommaaccent = 556;
  23486. t.onesuperior = 300;
  23487. t.imacron = 278;
  23488. t.Euro = 500;
  23489. });
  23490. t["Times-BoldItalic"] = getLookupTableFactory(function (t) {
  23491. t.space = 250;
  23492. t.exclam = 389;
  23493. t.quotedbl = 555;
  23494. t.numbersign = 500;
  23495. t.dollar = 500;
  23496. t.percent = 833;
  23497. t.ampersand = 778;
  23498. t.quoteright = 333;
  23499. t.parenleft = 333;
  23500. t.parenright = 333;
  23501. t.asterisk = 500;
  23502. t.plus = 570;
  23503. t.comma = 250;
  23504. t.hyphen = 333;
  23505. t.period = 250;
  23506. t.slash = 278;
  23507. t.zero = 500;
  23508. t.one = 500;
  23509. t.two = 500;
  23510. t.three = 500;
  23511. t.four = 500;
  23512. t.five = 500;
  23513. t.six = 500;
  23514. t.seven = 500;
  23515. t.eight = 500;
  23516. t.nine = 500;
  23517. t.colon = 333;
  23518. t.semicolon = 333;
  23519. t.less = 570;
  23520. t.equal = 570;
  23521. t.greater = 570;
  23522. t.question = 500;
  23523. t.at = 832;
  23524. t.A = 667;
  23525. t.B = 667;
  23526. t.C = 667;
  23527. t.D = 722;
  23528. t.E = 667;
  23529. t.F = 667;
  23530. t.G = 722;
  23531. t.H = 778;
  23532. t.I = 389;
  23533. t.J = 500;
  23534. t.K = 667;
  23535. t.L = 611;
  23536. t.M = 889;
  23537. t.N = 722;
  23538. t.O = 722;
  23539. t.P = 611;
  23540. t.Q = 722;
  23541. t.R = 667;
  23542. t.S = 556;
  23543. t.T = 611;
  23544. t.U = 722;
  23545. t.V = 667;
  23546. t.W = 889;
  23547. t.X = 667;
  23548. t.Y = 611;
  23549. t.Z = 611;
  23550. t.bracketleft = 333;
  23551. t.backslash = 278;
  23552. t.bracketright = 333;
  23553. t.asciicircum = 570;
  23554. t.underscore = 500;
  23555. t.quoteleft = 333;
  23556. t.a = 500;
  23557. t.b = 500;
  23558. t.c = 444;
  23559. t.d = 500;
  23560. t.e = 444;
  23561. t.f = 333;
  23562. t.g = 500;
  23563. t.h = 556;
  23564. t.i = 278;
  23565. t.j = 278;
  23566. t.k = 500;
  23567. t.l = 278;
  23568. t.m = 778;
  23569. t.n = 556;
  23570. t.o = 500;
  23571. t.p = 500;
  23572. t.q = 500;
  23573. t.r = 389;
  23574. t.s = 389;
  23575. t.t = 278;
  23576. t.u = 556;
  23577. t.v = 444;
  23578. t.w = 667;
  23579. t.x = 500;
  23580. t.y = 444;
  23581. t.z = 389;
  23582. t.braceleft = 348;
  23583. t.bar = 220;
  23584. t.braceright = 348;
  23585. t.asciitilde = 570;
  23586. t.exclamdown = 389;
  23587. t.cent = 500;
  23588. t.sterling = 500;
  23589. t.fraction = 167;
  23590. t.yen = 500;
  23591. t.florin = 500;
  23592. t.section = 500;
  23593. t.currency = 500;
  23594. t.quotesingle = 278;
  23595. t.quotedblleft = 500;
  23596. t.guillemotleft = 500;
  23597. t.guilsinglleft = 333;
  23598. t.guilsinglright = 333;
  23599. t.fi = 556;
  23600. t.fl = 556;
  23601. t.endash = 500;
  23602. t.dagger = 500;
  23603. t.daggerdbl = 500;
  23604. t.periodcentered = 250;
  23605. t.paragraph = 500;
  23606. t.bullet = 350;
  23607. t.quotesinglbase = 333;
  23608. t.quotedblbase = 500;
  23609. t.quotedblright = 500;
  23610. t.guillemotright = 500;
  23611. t.ellipsis = 1000;
  23612. t.perthousand = 1000;
  23613. t.questiondown = 500;
  23614. t.grave = 333;
  23615. t.acute = 333;
  23616. t.circumflex = 333;
  23617. t.tilde = 333;
  23618. t.macron = 333;
  23619. t.breve = 333;
  23620. t.dotaccent = 333;
  23621. t.dieresis = 333;
  23622. t.ring = 333;
  23623. t.cedilla = 333;
  23624. t.hungarumlaut = 333;
  23625. t.ogonek = 333;
  23626. t.caron = 333;
  23627. t.emdash = 1000;
  23628. t.AE = 944;
  23629. t.ordfeminine = 266;
  23630. t.Lslash = 611;
  23631. t.Oslash = 722;
  23632. t.OE = 944;
  23633. t.ordmasculine = 300;
  23634. t.ae = 722;
  23635. t.dotlessi = 278;
  23636. t.lslash = 278;
  23637. t.oslash = 500;
  23638. t.oe = 722;
  23639. t.germandbls = 500;
  23640. t.Idieresis = 389;
  23641. t.eacute = 444;
  23642. t.abreve = 500;
  23643. t.uhungarumlaut = 556;
  23644. t.ecaron = 444;
  23645. t.Ydieresis = 611;
  23646. t.divide = 570;
  23647. t.Yacute = 611;
  23648. t.Acircumflex = 667;
  23649. t.aacute = 500;
  23650. t.Ucircumflex = 722;
  23651. t.yacute = 444;
  23652. t.scommaaccent = 389;
  23653. t.ecircumflex = 444;
  23654. t.Uring = 722;
  23655. t.Udieresis = 722;
  23656. t.aogonek = 500;
  23657. t.Uacute = 722;
  23658. t.uogonek = 556;
  23659. t.Edieresis = 667;
  23660. t.Dcroat = 722;
  23661. t.commaaccent = 250;
  23662. t.copyright = 747;
  23663. t.Emacron = 667;
  23664. t.ccaron = 444;
  23665. t.aring = 500;
  23666. t.Ncommaaccent = 722;
  23667. t.lacute = 278;
  23668. t.agrave = 500;
  23669. t.Tcommaaccent = 611;
  23670. t.Cacute = 667;
  23671. t.atilde = 500;
  23672. t.Edotaccent = 667;
  23673. t.scaron = 389;
  23674. t.scedilla = 389;
  23675. t.iacute = 278;
  23676. t.lozenge = 494;
  23677. t.Rcaron = 667;
  23678. t.Gcommaaccent = 722;
  23679. t.ucircumflex = 556;
  23680. t.acircumflex = 500;
  23681. t.Amacron = 667;
  23682. t.rcaron = 389;
  23683. t.ccedilla = 444;
  23684. t.Zdotaccent = 611;
  23685. t.Thorn = 611;
  23686. t.Omacron = 722;
  23687. t.Racute = 667;
  23688. t.Sacute = 556;
  23689. t.dcaron = 608;
  23690. t.Umacron = 722;
  23691. t.uring = 556;
  23692. t.threesuperior = 300;
  23693. t.Ograve = 722;
  23694. t.Agrave = 667;
  23695. t.Abreve = 667;
  23696. t.multiply = 570;
  23697. t.uacute = 556;
  23698. t.Tcaron = 611;
  23699. t.partialdiff = 494;
  23700. t.ydieresis = 444;
  23701. t.Nacute = 722;
  23702. t.icircumflex = 278;
  23703. t.Ecircumflex = 667;
  23704. t.adieresis = 500;
  23705. t.edieresis = 444;
  23706. t.cacute = 444;
  23707. t.nacute = 556;
  23708. t.umacron = 556;
  23709. t.Ncaron = 722;
  23710. t.Iacute = 389;
  23711. t.plusminus = 570;
  23712. t.brokenbar = 220;
  23713. t.registered = 747;
  23714. t.Gbreve = 722;
  23715. t.Idotaccent = 389;
  23716. t.summation = 600;
  23717. t.Egrave = 667;
  23718. t.racute = 389;
  23719. t.omacron = 500;
  23720. t.Zacute = 611;
  23721. t.Zcaron = 611;
  23722. t.greaterequal = 549;
  23723. t.Eth = 722;
  23724. t.Ccedilla = 667;
  23725. t.lcommaaccent = 278;
  23726. t.tcaron = 366;
  23727. t.eogonek = 444;
  23728. t.Uogonek = 722;
  23729. t.Aacute = 667;
  23730. t.Adieresis = 667;
  23731. t.egrave = 444;
  23732. t.zacute = 389;
  23733. t.iogonek = 278;
  23734. t.Oacute = 722;
  23735. t.oacute = 500;
  23736. t.amacron = 500;
  23737. t.sacute = 389;
  23738. t.idieresis = 278;
  23739. t.Ocircumflex = 722;
  23740. t.Ugrave = 722;
  23741. t.Delta = 612;
  23742. t.thorn = 500;
  23743. t.twosuperior = 300;
  23744. t.Odieresis = 722;
  23745. t.mu = 576;
  23746. t.igrave = 278;
  23747. t.ohungarumlaut = 500;
  23748. t.Eogonek = 667;
  23749. t.dcroat = 500;
  23750. t.threequarters = 750;
  23751. t.Scedilla = 556;
  23752. t.lcaron = 382;
  23753. t.Kcommaaccent = 667;
  23754. t.Lacute = 611;
  23755. t.trademark = 1000;
  23756. t.edotaccent = 444;
  23757. t.Igrave = 389;
  23758. t.Imacron = 389;
  23759. t.Lcaron = 611;
  23760. t.onehalf = 750;
  23761. t.lessequal = 549;
  23762. t.ocircumflex = 500;
  23763. t.ntilde = 556;
  23764. t.Uhungarumlaut = 722;
  23765. t.Eacute = 667;
  23766. t.emacron = 444;
  23767. t.gbreve = 500;
  23768. t.onequarter = 750;
  23769. t.Scaron = 556;
  23770. t.Scommaaccent = 556;
  23771. t.Ohungarumlaut = 722;
  23772. t.degree = 400;
  23773. t.ograve = 500;
  23774. t.Ccaron = 667;
  23775. t.ugrave = 556;
  23776. t.radical = 549;
  23777. t.Dcaron = 722;
  23778. t.rcommaaccent = 389;
  23779. t.Ntilde = 722;
  23780. t.otilde = 500;
  23781. t.Rcommaaccent = 667;
  23782. t.Lcommaaccent = 611;
  23783. t.Atilde = 667;
  23784. t.Aogonek = 667;
  23785. t.Aring = 667;
  23786. t.Otilde = 722;
  23787. t.zdotaccent = 389;
  23788. t.Ecaron = 667;
  23789. t.Iogonek = 389;
  23790. t.kcommaaccent = 500;
  23791. t.minus = 606;
  23792. t.Icircumflex = 389;
  23793. t.ncaron = 556;
  23794. t.tcommaaccent = 278;
  23795. t.logicalnot = 606;
  23796. t.odieresis = 500;
  23797. t.udieresis = 556;
  23798. t.notequal = 549;
  23799. t.gcommaaccent = 500;
  23800. t.eth = 500;
  23801. t.zcaron = 389;
  23802. t.ncommaaccent = 556;
  23803. t.onesuperior = 300;
  23804. t.imacron = 278;
  23805. t.Euro = 500;
  23806. });
  23807. t["Times-Italic"] = getLookupTableFactory(function (t) {
  23808. t.space = 250;
  23809. t.exclam = 333;
  23810. t.quotedbl = 420;
  23811. t.numbersign = 500;
  23812. t.dollar = 500;
  23813. t.percent = 833;
  23814. t.ampersand = 778;
  23815. t.quoteright = 333;
  23816. t.parenleft = 333;
  23817. t.parenright = 333;
  23818. t.asterisk = 500;
  23819. t.plus = 675;
  23820. t.comma = 250;
  23821. t.hyphen = 333;
  23822. t.period = 250;
  23823. t.slash = 278;
  23824. t.zero = 500;
  23825. t.one = 500;
  23826. t.two = 500;
  23827. t.three = 500;
  23828. t.four = 500;
  23829. t.five = 500;
  23830. t.six = 500;
  23831. t.seven = 500;
  23832. t.eight = 500;
  23833. t.nine = 500;
  23834. t.colon = 333;
  23835. t.semicolon = 333;
  23836. t.less = 675;
  23837. t.equal = 675;
  23838. t.greater = 675;
  23839. t.question = 500;
  23840. t.at = 920;
  23841. t.A = 611;
  23842. t.B = 611;
  23843. t.C = 667;
  23844. t.D = 722;
  23845. t.E = 611;
  23846. t.F = 611;
  23847. t.G = 722;
  23848. t.H = 722;
  23849. t.I = 333;
  23850. t.J = 444;
  23851. t.K = 667;
  23852. t.L = 556;
  23853. t.M = 833;
  23854. t.N = 667;
  23855. t.O = 722;
  23856. t.P = 611;
  23857. t.Q = 722;
  23858. t.R = 611;
  23859. t.S = 500;
  23860. t.T = 556;
  23861. t.U = 722;
  23862. t.V = 611;
  23863. t.W = 833;
  23864. t.X = 611;
  23865. t.Y = 556;
  23866. t.Z = 556;
  23867. t.bracketleft = 389;
  23868. t.backslash = 278;
  23869. t.bracketright = 389;
  23870. t.asciicircum = 422;
  23871. t.underscore = 500;
  23872. t.quoteleft = 333;
  23873. t.a = 500;
  23874. t.b = 500;
  23875. t.c = 444;
  23876. t.d = 500;
  23877. t.e = 444;
  23878. t.f = 278;
  23879. t.g = 500;
  23880. t.h = 500;
  23881. t.i = 278;
  23882. t.j = 278;
  23883. t.k = 444;
  23884. t.l = 278;
  23885. t.m = 722;
  23886. t.n = 500;
  23887. t.o = 500;
  23888. t.p = 500;
  23889. t.q = 500;
  23890. t.r = 389;
  23891. t.s = 389;
  23892. t.t = 278;
  23893. t.u = 500;
  23894. t.v = 444;
  23895. t.w = 667;
  23896. t.x = 444;
  23897. t.y = 444;
  23898. t.z = 389;
  23899. t.braceleft = 400;
  23900. t.bar = 275;
  23901. t.braceright = 400;
  23902. t.asciitilde = 541;
  23903. t.exclamdown = 389;
  23904. t.cent = 500;
  23905. t.sterling = 500;
  23906. t.fraction = 167;
  23907. t.yen = 500;
  23908. t.florin = 500;
  23909. t.section = 500;
  23910. t.currency = 500;
  23911. t.quotesingle = 214;
  23912. t.quotedblleft = 556;
  23913. t.guillemotleft = 500;
  23914. t.guilsinglleft = 333;
  23915. t.guilsinglright = 333;
  23916. t.fi = 500;
  23917. t.fl = 500;
  23918. t.endash = 500;
  23919. t.dagger = 500;
  23920. t.daggerdbl = 500;
  23921. t.periodcentered = 250;
  23922. t.paragraph = 523;
  23923. t.bullet = 350;
  23924. t.quotesinglbase = 333;
  23925. t.quotedblbase = 556;
  23926. t.quotedblright = 556;
  23927. t.guillemotright = 500;
  23928. t.ellipsis = 889;
  23929. t.perthousand = 1000;
  23930. t.questiondown = 500;
  23931. t.grave = 333;
  23932. t.acute = 333;
  23933. t.circumflex = 333;
  23934. t.tilde = 333;
  23935. t.macron = 333;
  23936. t.breve = 333;
  23937. t.dotaccent = 333;
  23938. t.dieresis = 333;
  23939. t.ring = 333;
  23940. t.cedilla = 333;
  23941. t.hungarumlaut = 333;
  23942. t.ogonek = 333;
  23943. t.caron = 333;
  23944. t.emdash = 889;
  23945. t.AE = 889;
  23946. t.ordfeminine = 276;
  23947. t.Lslash = 556;
  23948. t.Oslash = 722;
  23949. t.OE = 944;
  23950. t.ordmasculine = 310;
  23951. t.ae = 667;
  23952. t.dotlessi = 278;
  23953. t.lslash = 278;
  23954. t.oslash = 500;
  23955. t.oe = 667;
  23956. t.germandbls = 500;
  23957. t.Idieresis = 333;
  23958. t.eacute = 444;
  23959. t.abreve = 500;
  23960. t.uhungarumlaut = 500;
  23961. t.ecaron = 444;
  23962. t.Ydieresis = 556;
  23963. t.divide = 675;
  23964. t.Yacute = 556;
  23965. t.Acircumflex = 611;
  23966. t.aacute = 500;
  23967. t.Ucircumflex = 722;
  23968. t.yacute = 444;
  23969. t.scommaaccent = 389;
  23970. t.ecircumflex = 444;
  23971. t.Uring = 722;
  23972. t.Udieresis = 722;
  23973. t.aogonek = 500;
  23974. t.Uacute = 722;
  23975. t.uogonek = 500;
  23976. t.Edieresis = 611;
  23977. t.Dcroat = 722;
  23978. t.commaaccent = 250;
  23979. t.copyright = 760;
  23980. t.Emacron = 611;
  23981. t.ccaron = 444;
  23982. t.aring = 500;
  23983. t.Ncommaaccent = 667;
  23984. t.lacute = 278;
  23985. t.agrave = 500;
  23986. t.Tcommaaccent = 556;
  23987. t.Cacute = 667;
  23988. t.atilde = 500;
  23989. t.Edotaccent = 611;
  23990. t.scaron = 389;
  23991. t.scedilla = 389;
  23992. t.iacute = 278;
  23993. t.lozenge = 471;
  23994. t.Rcaron = 611;
  23995. t.Gcommaaccent = 722;
  23996. t.ucircumflex = 500;
  23997. t.acircumflex = 500;
  23998. t.Amacron = 611;
  23999. t.rcaron = 389;
  24000. t.ccedilla = 444;
  24001. t.Zdotaccent = 556;
  24002. t.Thorn = 611;
  24003. t.Omacron = 722;
  24004. t.Racute = 611;
  24005. t.Sacute = 500;
  24006. t.dcaron = 544;
  24007. t.Umacron = 722;
  24008. t.uring = 500;
  24009. t.threesuperior = 300;
  24010. t.Ograve = 722;
  24011. t.Agrave = 611;
  24012. t.Abreve = 611;
  24013. t.multiply = 675;
  24014. t.uacute = 500;
  24015. t.Tcaron = 556;
  24016. t.partialdiff = 476;
  24017. t.ydieresis = 444;
  24018. t.Nacute = 667;
  24019. t.icircumflex = 278;
  24020. t.Ecircumflex = 611;
  24021. t.adieresis = 500;
  24022. t.edieresis = 444;
  24023. t.cacute = 444;
  24024. t.nacute = 500;
  24025. t.umacron = 500;
  24026. t.Ncaron = 667;
  24027. t.Iacute = 333;
  24028. t.plusminus = 675;
  24029. t.brokenbar = 275;
  24030. t.registered = 760;
  24031. t.Gbreve = 722;
  24032. t.Idotaccent = 333;
  24033. t.summation = 600;
  24034. t.Egrave = 611;
  24035. t.racute = 389;
  24036. t.omacron = 500;
  24037. t.Zacute = 556;
  24038. t.Zcaron = 556;
  24039. t.greaterequal = 549;
  24040. t.Eth = 722;
  24041. t.Ccedilla = 667;
  24042. t.lcommaaccent = 278;
  24043. t.tcaron = 300;
  24044. t.eogonek = 444;
  24045. t.Uogonek = 722;
  24046. t.Aacute = 611;
  24047. t.Adieresis = 611;
  24048. t.egrave = 444;
  24049. t.zacute = 389;
  24050. t.iogonek = 278;
  24051. t.Oacute = 722;
  24052. t.oacute = 500;
  24053. t.amacron = 500;
  24054. t.sacute = 389;
  24055. t.idieresis = 278;
  24056. t.Ocircumflex = 722;
  24057. t.Ugrave = 722;
  24058. t.Delta = 612;
  24059. t.thorn = 500;
  24060. t.twosuperior = 300;
  24061. t.Odieresis = 722;
  24062. t.mu = 500;
  24063. t.igrave = 278;
  24064. t.ohungarumlaut = 500;
  24065. t.Eogonek = 611;
  24066. t.dcroat = 500;
  24067. t.threequarters = 750;
  24068. t.Scedilla = 500;
  24069. t.lcaron = 300;
  24070. t.Kcommaaccent = 667;
  24071. t.Lacute = 556;
  24072. t.trademark = 980;
  24073. t.edotaccent = 444;
  24074. t.Igrave = 333;
  24075. t.Imacron = 333;
  24076. t.Lcaron = 611;
  24077. t.onehalf = 750;
  24078. t.lessequal = 549;
  24079. t.ocircumflex = 500;
  24080. t.ntilde = 500;
  24081. t.Uhungarumlaut = 722;
  24082. t.Eacute = 611;
  24083. t.emacron = 444;
  24084. t.gbreve = 500;
  24085. t.onequarter = 750;
  24086. t.Scaron = 500;
  24087. t.Scommaaccent = 500;
  24088. t.Ohungarumlaut = 722;
  24089. t.degree = 400;
  24090. t.ograve = 500;
  24091. t.Ccaron = 667;
  24092. t.ugrave = 500;
  24093. t.radical = 453;
  24094. t.Dcaron = 722;
  24095. t.rcommaaccent = 389;
  24096. t.Ntilde = 667;
  24097. t.otilde = 500;
  24098. t.Rcommaaccent = 611;
  24099. t.Lcommaaccent = 556;
  24100. t.Atilde = 611;
  24101. t.Aogonek = 611;
  24102. t.Aring = 611;
  24103. t.Otilde = 722;
  24104. t.zdotaccent = 389;
  24105. t.Ecaron = 611;
  24106. t.Iogonek = 333;
  24107. t.kcommaaccent = 444;
  24108. t.minus = 675;
  24109. t.Icircumflex = 333;
  24110. t.ncaron = 500;
  24111. t.tcommaaccent = 278;
  24112. t.logicalnot = 675;
  24113. t.odieresis = 500;
  24114. t.udieresis = 500;
  24115. t.notequal = 549;
  24116. t.gcommaaccent = 500;
  24117. t.eth = 500;
  24118. t.zcaron = 389;
  24119. t.ncommaaccent = 500;
  24120. t.onesuperior = 300;
  24121. t.imacron = 278;
  24122. t.Euro = 500;
  24123. });
  24124. t.ZapfDingbats = getLookupTableFactory(function (t) {
  24125. t.space = 278;
  24126. t.a1 = 974;
  24127. t.a2 = 961;
  24128. t.a202 = 974;
  24129. t.a3 = 980;
  24130. t.a4 = 719;
  24131. t.a5 = 789;
  24132. t.a119 = 790;
  24133. t.a118 = 791;
  24134. t.a117 = 690;
  24135. t.a11 = 960;
  24136. t.a12 = 939;
  24137. t.a13 = 549;
  24138. t.a14 = 855;
  24139. t.a15 = 911;
  24140. t.a16 = 933;
  24141. t.a105 = 911;
  24142. t.a17 = 945;
  24143. t.a18 = 974;
  24144. t.a19 = 755;
  24145. t.a20 = 846;
  24146. t.a21 = 762;
  24147. t.a22 = 761;
  24148. t.a23 = 571;
  24149. t.a24 = 677;
  24150. t.a25 = 763;
  24151. t.a26 = 760;
  24152. t.a27 = 759;
  24153. t.a28 = 754;
  24154. t.a6 = 494;
  24155. t.a7 = 552;
  24156. t.a8 = 537;
  24157. t.a9 = 577;
  24158. t.a10 = 692;
  24159. t.a29 = 786;
  24160. t.a30 = 788;
  24161. t.a31 = 788;
  24162. t.a32 = 790;
  24163. t.a33 = 793;
  24164. t.a34 = 794;
  24165. t.a35 = 816;
  24166. t.a36 = 823;
  24167. t.a37 = 789;
  24168. t.a38 = 841;
  24169. t.a39 = 823;
  24170. t.a40 = 833;
  24171. t.a41 = 816;
  24172. t.a42 = 831;
  24173. t.a43 = 923;
  24174. t.a44 = 744;
  24175. t.a45 = 723;
  24176. t.a46 = 749;
  24177. t.a47 = 790;
  24178. t.a48 = 792;
  24179. t.a49 = 695;
  24180. t.a50 = 776;
  24181. t.a51 = 768;
  24182. t.a52 = 792;
  24183. t.a53 = 759;
  24184. t.a54 = 707;
  24185. t.a55 = 708;
  24186. t.a56 = 682;
  24187. t.a57 = 701;
  24188. t.a58 = 826;
  24189. t.a59 = 815;
  24190. t.a60 = 789;
  24191. t.a61 = 789;
  24192. t.a62 = 707;
  24193. t.a63 = 687;
  24194. t.a64 = 696;
  24195. t.a65 = 689;
  24196. t.a66 = 786;
  24197. t.a67 = 787;
  24198. t.a68 = 713;
  24199. t.a69 = 791;
  24200. t.a70 = 785;
  24201. t.a71 = 791;
  24202. t.a72 = 873;
  24203. t.a73 = 761;
  24204. t.a74 = 762;
  24205. t.a203 = 762;
  24206. t.a75 = 759;
  24207. t.a204 = 759;
  24208. t.a76 = 892;
  24209. t.a77 = 892;
  24210. t.a78 = 788;
  24211. t.a79 = 784;
  24212. t.a81 = 438;
  24213. t.a82 = 138;
  24214. t.a83 = 277;
  24215. t.a84 = 415;
  24216. t.a97 = 392;
  24217. t.a98 = 392;
  24218. t.a99 = 668;
  24219. t.a100 = 668;
  24220. t.a89 = 390;
  24221. t.a90 = 390;
  24222. t.a93 = 317;
  24223. t.a94 = 317;
  24224. t.a91 = 276;
  24225. t.a92 = 276;
  24226. t.a205 = 509;
  24227. t.a85 = 509;
  24228. t.a206 = 410;
  24229. t.a86 = 410;
  24230. t.a87 = 234;
  24231. t.a88 = 234;
  24232. t.a95 = 334;
  24233. t.a96 = 334;
  24234. t.a101 = 732;
  24235. t.a102 = 544;
  24236. t.a103 = 544;
  24237. t.a104 = 910;
  24238. t.a106 = 667;
  24239. t.a107 = 760;
  24240. t.a108 = 760;
  24241. t.a112 = 776;
  24242. t.a111 = 595;
  24243. t.a110 = 694;
  24244. t.a109 = 626;
  24245. t.a120 = 788;
  24246. t.a121 = 788;
  24247. t.a122 = 788;
  24248. t.a123 = 788;
  24249. t.a124 = 788;
  24250. t.a125 = 788;
  24251. t.a126 = 788;
  24252. t.a127 = 788;
  24253. t.a128 = 788;
  24254. t.a129 = 788;
  24255. t.a130 = 788;
  24256. t.a131 = 788;
  24257. t.a132 = 788;
  24258. t.a133 = 788;
  24259. t.a134 = 788;
  24260. t.a135 = 788;
  24261. t.a136 = 788;
  24262. t.a137 = 788;
  24263. t.a138 = 788;
  24264. t.a139 = 788;
  24265. t.a140 = 788;
  24266. t.a141 = 788;
  24267. t.a142 = 788;
  24268. t.a143 = 788;
  24269. t.a144 = 788;
  24270. t.a145 = 788;
  24271. t.a146 = 788;
  24272. t.a147 = 788;
  24273. t.a148 = 788;
  24274. t.a149 = 788;
  24275. t.a150 = 788;
  24276. t.a151 = 788;
  24277. t.a152 = 788;
  24278. t.a153 = 788;
  24279. t.a154 = 788;
  24280. t.a155 = 788;
  24281. t.a156 = 788;
  24282. t.a157 = 788;
  24283. t.a158 = 788;
  24284. t.a159 = 788;
  24285. t.a160 = 894;
  24286. t.a161 = 838;
  24287. t.a163 = 1016;
  24288. t.a164 = 458;
  24289. t.a196 = 748;
  24290. t.a165 = 924;
  24291. t.a192 = 748;
  24292. t.a166 = 918;
  24293. t.a167 = 927;
  24294. t.a168 = 928;
  24295. t.a169 = 928;
  24296. t.a170 = 834;
  24297. t.a171 = 873;
  24298. t.a172 = 828;
  24299. t.a173 = 924;
  24300. t.a162 = 924;
  24301. t.a174 = 917;
  24302. t.a175 = 930;
  24303. t.a176 = 931;
  24304. t.a177 = 463;
  24305. t.a178 = 883;
  24306. t.a179 = 836;
  24307. t.a193 = 836;
  24308. t.a180 = 867;
  24309. t.a199 = 867;
  24310. t.a181 = 696;
  24311. t.a200 = 696;
  24312. t.a182 = 874;
  24313. t.a201 = 874;
  24314. t.a183 = 760;
  24315. t.a184 = 946;
  24316. t.a197 = 771;
  24317. t.a185 = 865;
  24318. t.a194 = 771;
  24319. t.a198 = 888;
  24320. t.a186 = 967;
  24321. t.a195 = 888;
  24322. t.a187 = 831;
  24323. t.a188 = 873;
  24324. t.a189 = 927;
  24325. t.a190 = 970;
  24326. t.a191 = 918;
  24327. });
  24328. });
  24329. const getFontBasicMetrics = getLookupTableFactory(function (t) {
  24330. t.Courier = {
  24331. ascent: 629,
  24332. descent: -157,
  24333. capHeight: 562,
  24334. xHeight: -426
  24335. };
  24336. t["Courier-Bold"] = {
  24337. ascent: 629,
  24338. descent: -157,
  24339. capHeight: 562,
  24340. xHeight: 439
  24341. };
  24342. t["Courier-Oblique"] = {
  24343. ascent: 629,
  24344. descent: -157,
  24345. capHeight: 562,
  24346. xHeight: 426
  24347. };
  24348. t["Courier-BoldOblique"] = {
  24349. ascent: 629,
  24350. descent: -157,
  24351. capHeight: 562,
  24352. xHeight: 426
  24353. };
  24354. t.Helvetica = {
  24355. ascent: 718,
  24356. descent: -207,
  24357. capHeight: 718,
  24358. xHeight: 523
  24359. };
  24360. t["Helvetica-Bold"] = {
  24361. ascent: 718,
  24362. descent: -207,
  24363. capHeight: 718,
  24364. xHeight: 532
  24365. };
  24366. t["Helvetica-Oblique"] = {
  24367. ascent: 718,
  24368. descent: -207,
  24369. capHeight: 718,
  24370. xHeight: 523
  24371. };
  24372. t["Helvetica-BoldOblique"] = {
  24373. ascent: 718,
  24374. descent: -207,
  24375. capHeight: 718,
  24376. xHeight: 532
  24377. };
  24378. t["Times-Roman"] = {
  24379. ascent: 683,
  24380. descent: -217,
  24381. capHeight: 662,
  24382. xHeight: 450
  24383. };
  24384. t["Times-Bold"] = {
  24385. ascent: 683,
  24386. descent: -217,
  24387. capHeight: 676,
  24388. xHeight: 461
  24389. };
  24390. t["Times-Italic"] = {
  24391. ascent: 683,
  24392. descent: -217,
  24393. capHeight: 653,
  24394. xHeight: 441
  24395. };
  24396. t["Times-BoldItalic"] = {
  24397. ascent: 683,
  24398. descent: -217,
  24399. capHeight: 669,
  24400. xHeight: 462
  24401. };
  24402. t.Symbol = {
  24403. ascent: Math.NaN,
  24404. descent: Math.NaN,
  24405. capHeight: Math.NaN,
  24406. xHeight: Math.NaN
  24407. };
  24408. t.ZapfDingbats = {
  24409. ascent: Math.NaN,
  24410. descent: Math.NaN,
  24411. capHeight: Math.NaN,
  24412. xHeight: Math.NaN
  24413. };
  24414. });
  24415. ;// ./src/core/glyf.js
  24416. const ON_CURVE_POINT = 1 << 0;
  24417. const X_SHORT_VECTOR = 1 << 1;
  24418. const Y_SHORT_VECTOR = 1 << 2;
  24419. const REPEAT_FLAG = 1 << 3;
  24420. const X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR = 1 << 4;
  24421. const Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR = 1 << 5;
  24422. const OVERLAP_SIMPLE = 1 << 6;
  24423. const ARG_1_AND_2_ARE_WORDS = 1 << 0;
  24424. const ARGS_ARE_XY_VALUES = 1 << 1;
  24425. const WE_HAVE_A_SCALE = 1 << 3;
  24426. const MORE_COMPONENTS = 1 << 5;
  24427. const WE_HAVE_AN_X_AND_Y_SCALE = 1 << 6;
  24428. const WE_HAVE_A_TWO_BY_TWO = 1 << 7;
  24429. const WE_HAVE_INSTRUCTIONS = 1 << 8;
  24430. class GlyfTable {
  24431. constructor({
  24432. glyfTable,
  24433. isGlyphLocationsLong,
  24434. locaTable,
  24435. numGlyphs
  24436. }) {
  24437. this.glyphs = [];
  24438. const loca = new DataView(locaTable.buffer, locaTable.byteOffset, locaTable.byteLength);
  24439. const glyf = new DataView(glyfTable.buffer, glyfTable.byteOffset, glyfTable.byteLength);
  24440. const offsetSize = isGlyphLocationsLong ? 4 : 2;
  24441. let prev = isGlyphLocationsLong ? loca.getUint32(0) : 2 * loca.getUint16(0);
  24442. let pos = 0;
  24443. for (let i = 0; i < numGlyphs; i++) {
  24444. pos += offsetSize;
  24445. const next = isGlyphLocationsLong ? loca.getUint32(pos) : 2 * loca.getUint16(pos);
  24446. if (next === prev) {
  24447. this.glyphs.push(new Glyph({}));
  24448. continue;
  24449. }
  24450. const glyph = Glyph.parse(prev, glyf);
  24451. this.glyphs.push(glyph);
  24452. prev = next;
  24453. }
  24454. }
  24455. getSize() {
  24456. return this.glyphs.reduce((a, g) => {
  24457. const size = g.getSize();
  24458. return a + (size + 3 & ~3);
  24459. }, 0);
  24460. }
  24461. write() {
  24462. const totalSize = this.getSize();
  24463. const glyfTable = new DataView(new ArrayBuffer(totalSize));
  24464. const isLocationLong = totalSize > 0x1fffe;
  24465. const offsetSize = isLocationLong ? 4 : 2;
  24466. const locaTable = new DataView(new ArrayBuffer((this.glyphs.length + 1) * offsetSize));
  24467. if (isLocationLong) {
  24468. locaTable.setUint32(0, 0);
  24469. } else {
  24470. locaTable.setUint16(0, 0);
  24471. }
  24472. let pos = 0;
  24473. let locaIndex = 0;
  24474. for (const glyph of this.glyphs) {
  24475. pos += glyph.write(pos, glyfTable);
  24476. pos = pos + 3 & ~3;
  24477. locaIndex += offsetSize;
  24478. if (isLocationLong) {
  24479. locaTable.setUint32(locaIndex, pos);
  24480. } else {
  24481. locaTable.setUint16(locaIndex, pos >> 1);
  24482. }
  24483. }
  24484. return {
  24485. isLocationLong,
  24486. loca: new Uint8Array(locaTable.buffer),
  24487. glyf: new Uint8Array(glyfTable.buffer)
  24488. };
  24489. }
  24490. scale(factors) {
  24491. for (let i = 0, ii = this.glyphs.length; i < ii; i++) {
  24492. this.glyphs[i].scale(factors[i]);
  24493. }
  24494. }
  24495. }
  24496. class Glyph {
  24497. constructor({
  24498. header = null,
  24499. simple = null,
  24500. composites = null
  24501. }) {
  24502. this.header = header;
  24503. this.simple = simple;
  24504. this.composites = composites;
  24505. }
  24506. static parse(pos, glyf) {
  24507. const [read, header] = GlyphHeader.parse(pos, glyf);
  24508. pos += read;
  24509. if (header.numberOfContours < 0) {
  24510. const composites = [];
  24511. while (true) {
  24512. const [n, composite] = CompositeGlyph.parse(pos, glyf);
  24513. pos += n;
  24514. composites.push(composite);
  24515. if (!(composite.flags & MORE_COMPONENTS)) {
  24516. break;
  24517. }
  24518. }
  24519. return new Glyph({
  24520. header,
  24521. composites
  24522. });
  24523. }
  24524. const simple = SimpleGlyph.parse(pos, glyf, header.numberOfContours);
  24525. return new Glyph({
  24526. header,
  24527. simple
  24528. });
  24529. }
  24530. getSize() {
  24531. if (!this.header) {
  24532. return 0;
  24533. }
  24534. const size = this.simple ? this.simple.getSize() : this.composites.reduce((a, c) => a + c.getSize(), 0);
  24535. return this.header.getSize() + size;
  24536. }
  24537. write(pos, buf) {
  24538. if (!this.header) {
  24539. return 0;
  24540. }
  24541. const spos = pos;
  24542. pos += this.header.write(pos, buf);
  24543. if (this.simple) {
  24544. pos += this.simple.write(pos, buf);
  24545. } else {
  24546. for (const composite of this.composites) {
  24547. pos += composite.write(pos, buf);
  24548. }
  24549. }
  24550. return pos - spos;
  24551. }
  24552. scale(factor) {
  24553. if (!this.header) {
  24554. return;
  24555. }
  24556. const xMiddle = (this.header.xMin + this.header.xMax) / 2;
  24557. this.header.scale(xMiddle, factor);
  24558. if (this.simple) {
  24559. this.simple.scale(xMiddle, factor);
  24560. } else {
  24561. for (const composite of this.composites) {
  24562. composite.scale(xMiddle, factor);
  24563. }
  24564. }
  24565. }
  24566. }
  24567. class GlyphHeader {
  24568. constructor({
  24569. numberOfContours,
  24570. xMin,
  24571. yMin,
  24572. xMax,
  24573. yMax
  24574. }) {
  24575. this.numberOfContours = numberOfContours;
  24576. this.xMin = xMin;
  24577. this.yMin = yMin;
  24578. this.xMax = xMax;
  24579. this.yMax = yMax;
  24580. }
  24581. static parse(pos, glyf) {
  24582. return [10, new GlyphHeader({
  24583. numberOfContours: glyf.getInt16(pos),
  24584. xMin: glyf.getInt16(pos + 2),
  24585. yMin: glyf.getInt16(pos + 4),
  24586. xMax: glyf.getInt16(pos + 6),
  24587. yMax: glyf.getInt16(pos + 8)
  24588. })];
  24589. }
  24590. getSize() {
  24591. return 10;
  24592. }
  24593. write(pos, buf) {
  24594. buf.setInt16(pos, this.numberOfContours);
  24595. buf.setInt16(pos + 2, this.xMin);
  24596. buf.setInt16(pos + 4, this.yMin);
  24597. buf.setInt16(pos + 6, this.xMax);
  24598. buf.setInt16(pos + 8, this.yMax);
  24599. return 10;
  24600. }
  24601. scale(x, factor) {
  24602. this.xMin = Math.round(x + (this.xMin - x) * factor);
  24603. this.xMax = Math.round(x + (this.xMax - x) * factor);
  24604. }
  24605. }
  24606. class Contour {
  24607. constructor({
  24608. flags,
  24609. xCoordinates,
  24610. yCoordinates
  24611. }) {
  24612. this.xCoordinates = xCoordinates;
  24613. this.yCoordinates = yCoordinates;
  24614. this.flags = flags;
  24615. }
  24616. }
  24617. class SimpleGlyph {
  24618. constructor({
  24619. contours,
  24620. instructions
  24621. }) {
  24622. this.contours = contours;
  24623. this.instructions = instructions;
  24624. }
  24625. static parse(pos, glyf, numberOfContours) {
  24626. const endPtsOfContours = [];
  24627. for (let i = 0; i < numberOfContours; i++) {
  24628. const endPt = glyf.getUint16(pos);
  24629. pos += 2;
  24630. endPtsOfContours.push(endPt);
  24631. }
  24632. const numberOfPt = endPtsOfContours[numberOfContours - 1] + 1;
  24633. const instructionLength = glyf.getUint16(pos);
  24634. pos += 2;
  24635. const instructions = new Uint8Array(glyf).slice(pos, pos + instructionLength);
  24636. pos += instructionLength;
  24637. const flags = [];
  24638. for (let i = 0; i < numberOfPt; pos++, i++) {
  24639. let flag = glyf.getUint8(pos);
  24640. flags.push(flag);
  24641. if (flag & REPEAT_FLAG) {
  24642. const count = glyf.getUint8(++pos);
  24643. flag ^= REPEAT_FLAG;
  24644. for (let m = 0; m < count; m++) {
  24645. flags.push(flag);
  24646. }
  24647. i += count;
  24648. }
  24649. }
  24650. const allXCoordinates = [];
  24651. let xCoordinates = [];
  24652. let yCoordinates = [];
  24653. let pointFlags = [];
  24654. const contours = [];
  24655. let endPtsOfContoursIndex = 0;
  24656. let lastCoordinate = 0;
  24657. for (let i = 0; i < numberOfPt; i++) {
  24658. const flag = flags[i];
  24659. if (flag & X_SHORT_VECTOR) {
  24660. const x = glyf.getUint8(pos++);
  24661. lastCoordinate += flag & X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR ? x : -x;
  24662. xCoordinates.push(lastCoordinate);
  24663. } else if (flag & X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR) {
  24664. xCoordinates.push(lastCoordinate);
  24665. } else {
  24666. lastCoordinate += glyf.getInt16(pos);
  24667. pos += 2;
  24668. xCoordinates.push(lastCoordinate);
  24669. }
  24670. if (endPtsOfContours[endPtsOfContoursIndex] === i) {
  24671. endPtsOfContoursIndex++;
  24672. allXCoordinates.push(xCoordinates);
  24673. xCoordinates = [];
  24674. }
  24675. }
  24676. lastCoordinate = 0;
  24677. endPtsOfContoursIndex = 0;
  24678. for (let i = 0; i < numberOfPt; i++) {
  24679. const flag = flags[i];
  24680. if (flag & Y_SHORT_VECTOR) {
  24681. const y = glyf.getUint8(pos++);
  24682. lastCoordinate += flag & Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR ? y : -y;
  24683. yCoordinates.push(lastCoordinate);
  24684. } else if (flag & Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR) {
  24685. yCoordinates.push(lastCoordinate);
  24686. } else {
  24687. lastCoordinate += glyf.getInt16(pos);
  24688. pos += 2;
  24689. yCoordinates.push(lastCoordinate);
  24690. }
  24691. pointFlags.push(flag & ON_CURVE_POINT | flag & OVERLAP_SIMPLE);
  24692. if (endPtsOfContours[endPtsOfContoursIndex] === i) {
  24693. xCoordinates = allXCoordinates[endPtsOfContoursIndex];
  24694. endPtsOfContoursIndex++;
  24695. contours.push(new Contour({
  24696. flags: pointFlags,
  24697. xCoordinates,
  24698. yCoordinates
  24699. }));
  24700. yCoordinates = [];
  24701. pointFlags = [];
  24702. }
  24703. }
  24704. return new SimpleGlyph({
  24705. contours,
  24706. instructions
  24707. });
  24708. }
  24709. getSize() {
  24710. let size = this.contours.length * 2 + 2 + this.instructions.length;
  24711. let lastX = 0;
  24712. let lastY = 0;
  24713. for (const contour of this.contours) {
  24714. size += contour.flags.length;
  24715. for (let i = 0, ii = contour.xCoordinates.length; i < ii; i++) {
  24716. const x = contour.xCoordinates[i];
  24717. const y = contour.yCoordinates[i];
  24718. let abs = Math.abs(x - lastX);
  24719. if (abs > 255) {
  24720. size += 2;
  24721. } else if (abs > 0) {
  24722. size += 1;
  24723. }
  24724. lastX = x;
  24725. abs = Math.abs(y - lastY);
  24726. if (abs > 255) {
  24727. size += 2;
  24728. } else if (abs > 0) {
  24729. size += 1;
  24730. }
  24731. lastY = y;
  24732. }
  24733. }
  24734. return size;
  24735. }
  24736. write(pos, buf) {
  24737. const spos = pos;
  24738. const xCoordinates = [];
  24739. const yCoordinates = [];
  24740. const flags = [];
  24741. let lastX = 0;
  24742. let lastY = 0;
  24743. for (const contour of this.contours) {
  24744. for (let i = 0, ii = contour.xCoordinates.length; i < ii; i++) {
  24745. let flag = contour.flags[i];
  24746. const x = contour.xCoordinates[i];
  24747. let delta = x - lastX;
  24748. if (delta === 0) {
  24749. flag |= X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR;
  24750. xCoordinates.push(0);
  24751. } else {
  24752. const abs = Math.abs(delta);
  24753. if (abs <= 255) {
  24754. flag |= delta >= 0 ? X_SHORT_VECTOR | X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR : X_SHORT_VECTOR;
  24755. xCoordinates.push(abs);
  24756. } else {
  24757. xCoordinates.push(delta);
  24758. }
  24759. }
  24760. lastX = x;
  24761. const y = contour.yCoordinates[i];
  24762. delta = y - lastY;
  24763. if (delta === 0) {
  24764. flag |= Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR;
  24765. yCoordinates.push(0);
  24766. } else {
  24767. const abs = Math.abs(delta);
  24768. if (abs <= 255) {
  24769. flag |= delta >= 0 ? Y_SHORT_VECTOR | Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR : Y_SHORT_VECTOR;
  24770. yCoordinates.push(abs);
  24771. } else {
  24772. yCoordinates.push(delta);
  24773. }
  24774. }
  24775. lastY = y;
  24776. flags.push(flag);
  24777. }
  24778. buf.setUint16(pos, xCoordinates.length - 1);
  24779. pos += 2;
  24780. }
  24781. buf.setUint16(pos, this.instructions.length);
  24782. pos += 2;
  24783. if (this.instructions.length) {
  24784. new Uint8Array(buf.buffer, 0, buf.buffer.byteLength).set(this.instructions, pos);
  24785. pos += this.instructions.length;
  24786. }
  24787. for (const flag of flags) {
  24788. buf.setUint8(pos++, flag);
  24789. }
  24790. for (let i = 0, ii = xCoordinates.length; i < ii; i++) {
  24791. const x = xCoordinates[i];
  24792. const flag = flags[i];
  24793. if (flag & X_SHORT_VECTOR) {
  24794. buf.setUint8(pos++, x);
  24795. } else if (!(flag & X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR)) {
  24796. buf.setInt16(pos, x);
  24797. pos += 2;
  24798. }
  24799. }
  24800. for (let i = 0, ii = yCoordinates.length; i < ii; i++) {
  24801. const y = yCoordinates[i];
  24802. const flag = flags[i];
  24803. if (flag & Y_SHORT_VECTOR) {
  24804. buf.setUint8(pos++, y);
  24805. } else if (!(flag & Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR)) {
  24806. buf.setInt16(pos, y);
  24807. pos += 2;
  24808. }
  24809. }
  24810. return pos - spos;
  24811. }
  24812. scale(x, factor) {
  24813. for (const contour of this.contours) {
  24814. if (contour.xCoordinates.length === 0) {
  24815. continue;
  24816. }
  24817. for (let i = 0, ii = contour.xCoordinates.length; i < ii; i++) {
  24818. contour.xCoordinates[i] = Math.round(x + (contour.xCoordinates[i] - x) * factor);
  24819. }
  24820. }
  24821. }
  24822. }
  24823. class CompositeGlyph {
  24824. constructor({
  24825. flags,
  24826. glyphIndex,
  24827. argument1,
  24828. argument2,
  24829. transf,
  24830. instructions
  24831. }) {
  24832. this.flags = flags;
  24833. this.glyphIndex = glyphIndex;
  24834. this.argument1 = argument1;
  24835. this.argument2 = argument2;
  24836. this.transf = transf;
  24837. this.instructions = instructions;
  24838. }
  24839. static parse(pos, glyf) {
  24840. const spos = pos;
  24841. const transf = [];
  24842. let flags = glyf.getUint16(pos);
  24843. const glyphIndex = glyf.getUint16(pos + 2);
  24844. pos += 4;
  24845. let argument1, argument2;
  24846. if (flags & ARG_1_AND_2_ARE_WORDS) {
  24847. if (flags & ARGS_ARE_XY_VALUES) {
  24848. argument1 = glyf.getInt16(pos);
  24849. argument2 = glyf.getInt16(pos + 2);
  24850. } else {
  24851. argument1 = glyf.getUint16(pos);
  24852. argument2 = glyf.getUint16(pos + 2);
  24853. }
  24854. pos += 4;
  24855. flags ^= ARG_1_AND_2_ARE_WORDS;
  24856. } else {
  24857. if (flags & ARGS_ARE_XY_VALUES) {
  24858. argument1 = glyf.getInt8(pos);
  24859. argument2 = glyf.getInt8(pos + 1);
  24860. } else {
  24861. argument1 = glyf.getUint8(pos);
  24862. argument2 = glyf.getUint8(pos + 1);
  24863. }
  24864. pos += 2;
  24865. }
  24866. if (flags & WE_HAVE_A_SCALE) {
  24867. transf.push(glyf.getUint16(pos));
  24868. pos += 2;
  24869. } else if (flags & WE_HAVE_AN_X_AND_Y_SCALE) {
  24870. transf.push(glyf.getUint16(pos), glyf.getUint16(pos + 2));
  24871. pos += 4;
  24872. } else if (flags & WE_HAVE_A_TWO_BY_TWO) {
  24873. transf.push(glyf.getUint16(pos), glyf.getUint16(pos + 2), glyf.getUint16(pos + 4), glyf.getUint16(pos + 6));
  24874. pos += 8;
  24875. }
  24876. let instructions = null;
  24877. if (flags & WE_HAVE_INSTRUCTIONS) {
  24878. const instructionLength = glyf.getUint16(pos);
  24879. pos += 2;
  24880. instructions = new Uint8Array(glyf).slice(pos, pos + instructionLength);
  24881. pos += instructionLength;
  24882. }
  24883. return [pos - spos, new CompositeGlyph({
  24884. flags,
  24885. glyphIndex,
  24886. argument1,
  24887. argument2,
  24888. transf,
  24889. instructions
  24890. })];
  24891. }
  24892. getSize() {
  24893. let size = 2 + 2 + this.transf.length * 2;
  24894. if (this.flags & WE_HAVE_INSTRUCTIONS) {
  24895. size += 2 + this.instructions.length;
  24896. }
  24897. size += 2;
  24898. if (this.flags & 2) {
  24899. if (!(this.argument1 >= -128 && this.argument1 <= 127 && this.argument2 >= -128 && this.argument2 <= 127)) {
  24900. size += 2;
  24901. }
  24902. } else if (!(this.argument1 >= 0 && this.argument1 <= 255 && this.argument2 >= 0 && this.argument2 <= 255)) {
  24903. size += 2;
  24904. }
  24905. return size;
  24906. }
  24907. write(pos, buf) {
  24908. const spos = pos;
  24909. if (this.flags & ARGS_ARE_XY_VALUES) {
  24910. if (!(this.argument1 >= -128 && this.argument1 <= 127 && this.argument2 >= -128 && this.argument2 <= 127)) {
  24911. this.flags |= ARG_1_AND_2_ARE_WORDS;
  24912. }
  24913. } else if (!(this.argument1 >= 0 && this.argument1 <= 255 && this.argument2 >= 0 && this.argument2 <= 255)) {
  24914. this.flags |= ARG_1_AND_2_ARE_WORDS;
  24915. }
  24916. buf.setUint16(pos, this.flags);
  24917. buf.setUint16(pos + 2, this.glyphIndex);
  24918. pos += 4;
  24919. if (this.flags & ARG_1_AND_2_ARE_WORDS) {
  24920. if (this.flags & ARGS_ARE_XY_VALUES) {
  24921. buf.setInt16(pos, this.argument1);
  24922. buf.setInt16(pos + 2, this.argument2);
  24923. } else {
  24924. buf.setUint16(pos, this.argument1);
  24925. buf.setUint16(pos + 2, this.argument2);
  24926. }
  24927. pos += 4;
  24928. } else {
  24929. buf.setUint8(pos, this.argument1);
  24930. buf.setUint8(pos + 1, this.argument2);
  24931. pos += 2;
  24932. }
  24933. if (this.flags & WE_HAVE_INSTRUCTIONS) {
  24934. buf.setUint16(pos, this.instructions.length);
  24935. pos += 2;
  24936. if (this.instructions.length) {
  24937. new Uint8Array(buf.buffer, 0, buf.buffer.byteLength).set(this.instructions, pos);
  24938. pos += this.instructions.length;
  24939. }
  24940. }
  24941. return pos - spos;
  24942. }
  24943. scale(x, factor) {}
  24944. }
  24945. ;// ./src/core/opentype_file_builder.js
  24946. function writeInt16(dest, offset, num) {
  24947. dest[offset] = num >> 8 & 0xff;
  24948. dest[offset + 1] = num & 0xff;
  24949. }
  24950. function writeInt32(dest, offset, num) {
  24951. dest[offset] = num >> 24 & 0xff;
  24952. dest[offset + 1] = num >> 16 & 0xff;
  24953. dest[offset + 2] = num >> 8 & 0xff;
  24954. dest[offset + 3] = num & 0xff;
  24955. }
  24956. function writeData(dest, offset, data) {
  24957. if (data instanceof Uint8Array) {
  24958. dest.set(data, offset);
  24959. } else if (typeof data === "string") {
  24960. for (let i = 0, ii = data.length; i < ii; i++) {
  24961. dest[offset++] = data.charCodeAt(i) & 0xff;
  24962. }
  24963. } else {
  24964. for (const num of data) {
  24965. dest[offset++] = num & 0xff;
  24966. }
  24967. }
  24968. }
  24969. const OTF_HEADER_SIZE = 12;
  24970. const OTF_TABLE_ENTRY_SIZE = 16;
  24971. class OpenTypeFileBuilder {
  24972. constructor(sfnt) {
  24973. this.sfnt = sfnt;
  24974. this.tables = Object.create(null);
  24975. }
  24976. static getSearchParams(entriesCount, entrySize) {
  24977. let maxPower2 = 1,
  24978. log2 = 0;
  24979. while ((maxPower2 ^ entriesCount) > maxPower2) {
  24980. maxPower2 <<= 1;
  24981. log2++;
  24982. }
  24983. const searchRange = maxPower2 * entrySize;
  24984. return {
  24985. range: searchRange,
  24986. entry: log2,
  24987. rangeShift: entrySize * entriesCount - searchRange
  24988. };
  24989. }
  24990. toArray() {
  24991. let sfnt = this.sfnt;
  24992. const tables = this.tables;
  24993. const tablesNames = Object.keys(tables);
  24994. tablesNames.sort();
  24995. const numTables = tablesNames.length;
  24996. let i, j, jj, table, tableName;
  24997. let offset = OTF_HEADER_SIZE + numTables * OTF_TABLE_ENTRY_SIZE;
  24998. const tableOffsets = [offset];
  24999. for (i = 0; i < numTables; i++) {
  25000. table = tables[tablesNames[i]];
  25001. const paddedLength = (table.length + 3 & ~3) >>> 0;
  25002. offset += paddedLength;
  25003. tableOffsets.push(offset);
  25004. }
  25005. const file = new Uint8Array(offset);
  25006. for (i = 0; i < numTables; i++) {
  25007. table = tables[tablesNames[i]];
  25008. writeData(file, tableOffsets[i], table);
  25009. }
  25010. if (sfnt === "true") {
  25011. sfnt = string32(0x00010000);
  25012. }
  25013. file[0] = sfnt.charCodeAt(0) & 0xff;
  25014. file[1] = sfnt.charCodeAt(1) & 0xff;
  25015. file[2] = sfnt.charCodeAt(2) & 0xff;
  25016. file[3] = sfnt.charCodeAt(3) & 0xff;
  25017. writeInt16(file, 4, numTables);
  25018. const searchParams = OpenTypeFileBuilder.getSearchParams(numTables, 16);
  25019. writeInt16(file, 6, searchParams.range);
  25020. writeInt16(file, 8, searchParams.entry);
  25021. writeInt16(file, 10, searchParams.rangeShift);
  25022. offset = OTF_HEADER_SIZE;
  25023. for (i = 0; i < numTables; i++) {
  25024. tableName = tablesNames[i];
  25025. file[offset] = tableName.charCodeAt(0) & 0xff;
  25026. file[offset + 1] = tableName.charCodeAt(1) & 0xff;
  25027. file[offset + 2] = tableName.charCodeAt(2) & 0xff;
  25028. file[offset + 3] = tableName.charCodeAt(3) & 0xff;
  25029. let checksum = 0;
  25030. for (j = tableOffsets[i], jj = tableOffsets[i + 1]; j < jj; j += 4) {
  25031. const quad = readUint32(file, j);
  25032. checksum = checksum + quad >>> 0;
  25033. }
  25034. writeInt32(file, offset + 4, checksum);
  25035. writeInt32(file, offset + 8, tableOffsets[i]);
  25036. writeInt32(file, offset + 12, tables[tableName].length);
  25037. offset += OTF_TABLE_ENTRY_SIZE;
  25038. }
  25039. return file;
  25040. }
  25041. addTable(tag, data) {
  25042. if (tag in this.tables) {
  25043. throw new Error("Table " + tag + " already exists");
  25044. }
  25045. this.tables[tag] = data;
  25046. }
  25047. }
  25048. ;// ./src/core/type1_parser.js
  25049. const HINTING_ENABLED = false;
  25050. const COMMAND_MAP = {
  25051. hstem: [1],
  25052. vstem: [3],
  25053. vmoveto: [4],
  25054. rlineto: [5],
  25055. hlineto: [6],
  25056. vlineto: [7],
  25057. rrcurveto: [8],
  25058. callsubr: [10],
  25059. flex: [12, 35],
  25060. drop: [12, 18],
  25061. endchar: [14],
  25062. rmoveto: [21],
  25063. hmoveto: [22],
  25064. vhcurveto: [30],
  25065. hvcurveto: [31]
  25066. };
  25067. class Type1CharString {
  25068. constructor() {
  25069. this.width = 0;
  25070. this.lsb = 0;
  25071. this.flexing = false;
  25072. this.output = [];
  25073. this.stack = [];
  25074. }
  25075. convert(encoded, subrs, seacAnalysisEnabled) {
  25076. const count = encoded.length;
  25077. let error = false;
  25078. let wx, sbx, subrNumber;
  25079. for (let i = 0; i < count; i++) {
  25080. let value = encoded[i];
  25081. if (value < 32) {
  25082. if (value === 12) {
  25083. value = (value << 8) + encoded[++i];
  25084. }
  25085. switch (value) {
  25086. case 1:
  25087. if (!HINTING_ENABLED) {
  25088. this.stack = [];
  25089. break;
  25090. }
  25091. error = this.executeCommand(2, COMMAND_MAP.hstem);
  25092. break;
  25093. case 3:
  25094. if (!HINTING_ENABLED) {
  25095. this.stack = [];
  25096. break;
  25097. }
  25098. error = this.executeCommand(2, COMMAND_MAP.vstem);
  25099. break;
  25100. case 4:
  25101. if (this.flexing) {
  25102. if (this.stack.length < 1) {
  25103. error = true;
  25104. break;
  25105. }
  25106. const dy = this.stack.pop();
  25107. this.stack.push(0, dy);
  25108. break;
  25109. }
  25110. error = this.executeCommand(1, COMMAND_MAP.vmoveto);
  25111. break;
  25112. case 5:
  25113. error = this.executeCommand(2, COMMAND_MAP.rlineto);
  25114. break;
  25115. case 6:
  25116. error = this.executeCommand(1, COMMAND_MAP.hlineto);
  25117. break;
  25118. case 7:
  25119. error = this.executeCommand(1, COMMAND_MAP.vlineto);
  25120. break;
  25121. case 8:
  25122. error = this.executeCommand(6, COMMAND_MAP.rrcurveto);
  25123. break;
  25124. case 9:
  25125. this.stack = [];
  25126. break;
  25127. case 10:
  25128. if (this.stack.length < 1) {
  25129. error = true;
  25130. break;
  25131. }
  25132. subrNumber = this.stack.pop();
  25133. if (!subrs[subrNumber]) {
  25134. error = true;
  25135. break;
  25136. }
  25137. error = this.convert(subrs[subrNumber], subrs, seacAnalysisEnabled);
  25138. break;
  25139. case 11:
  25140. return error;
  25141. case 13:
  25142. if (this.stack.length < 2) {
  25143. error = true;
  25144. break;
  25145. }
  25146. wx = this.stack.pop();
  25147. sbx = this.stack.pop();
  25148. this.lsb = sbx;
  25149. this.width = wx;
  25150. this.stack.push(wx, sbx);
  25151. error = this.executeCommand(2, COMMAND_MAP.hmoveto);
  25152. break;
  25153. case 14:
  25154. this.output.push(COMMAND_MAP.endchar[0]);
  25155. break;
  25156. case 21:
  25157. if (this.flexing) {
  25158. break;
  25159. }
  25160. error = this.executeCommand(2, COMMAND_MAP.rmoveto);
  25161. break;
  25162. case 22:
  25163. if (this.flexing) {
  25164. this.stack.push(0);
  25165. break;
  25166. }
  25167. error = this.executeCommand(1, COMMAND_MAP.hmoveto);
  25168. break;
  25169. case 30:
  25170. error = this.executeCommand(4, COMMAND_MAP.vhcurveto);
  25171. break;
  25172. case 31:
  25173. error = this.executeCommand(4, COMMAND_MAP.hvcurveto);
  25174. break;
  25175. case (12 << 8) + 0:
  25176. this.stack = [];
  25177. break;
  25178. case (12 << 8) + 1:
  25179. if (!HINTING_ENABLED) {
  25180. this.stack = [];
  25181. break;
  25182. }
  25183. error = this.executeCommand(2, COMMAND_MAP.vstem);
  25184. break;
  25185. case (12 << 8) + 2:
  25186. if (!HINTING_ENABLED) {
  25187. this.stack = [];
  25188. break;
  25189. }
  25190. error = this.executeCommand(2, COMMAND_MAP.hstem);
  25191. break;
  25192. case (12 << 8) + 6:
  25193. if (seacAnalysisEnabled) {
  25194. const asb = this.stack.at(-5);
  25195. this.seac = this.stack.splice(-4, 4);
  25196. this.seac[0] += this.lsb - asb;
  25197. error = this.executeCommand(0, COMMAND_MAP.endchar);
  25198. } else {
  25199. error = this.executeCommand(4, COMMAND_MAP.endchar);
  25200. }
  25201. break;
  25202. case (12 << 8) + 7:
  25203. if (this.stack.length < 4) {
  25204. error = true;
  25205. break;
  25206. }
  25207. this.stack.pop();
  25208. wx = this.stack.pop();
  25209. const sby = this.stack.pop();
  25210. sbx = this.stack.pop();
  25211. this.lsb = sbx;
  25212. this.width = wx;
  25213. this.stack.push(wx, sbx, sby);
  25214. error = this.executeCommand(3, COMMAND_MAP.rmoveto);
  25215. break;
  25216. case (12 << 8) + 12:
  25217. if (this.stack.length < 2) {
  25218. error = true;
  25219. break;
  25220. }
  25221. const num2 = this.stack.pop();
  25222. const num1 = this.stack.pop();
  25223. this.stack.push(num1 / num2);
  25224. break;
  25225. case (12 << 8) + 16:
  25226. if (this.stack.length < 2) {
  25227. error = true;
  25228. break;
  25229. }
  25230. subrNumber = this.stack.pop();
  25231. const numArgs = this.stack.pop();
  25232. if (subrNumber === 0 && numArgs === 3) {
  25233. const flexArgs = this.stack.splice(-17, 17);
  25234. this.stack.push(flexArgs[2] + flexArgs[0], flexArgs[3] + flexArgs[1], flexArgs[4], flexArgs[5], flexArgs[6], flexArgs[7], flexArgs[8], flexArgs[9], flexArgs[10], flexArgs[11], flexArgs[12], flexArgs[13], flexArgs[14]);
  25235. error = this.executeCommand(13, COMMAND_MAP.flex, true);
  25236. this.flexing = false;
  25237. this.stack.push(flexArgs[15], flexArgs[16]);
  25238. } else if (subrNumber === 1 && numArgs === 0) {
  25239. this.flexing = true;
  25240. }
  25241. break;
  25242. case (12 << 8) + 17:
  25243. break;
  25244. case (12 << 8) + 33:
  25245. this.stack = [];
  25246. break;
  25247. default:
  25248. warn('Unknown type 1 charstring command of "' + value + '"');
  25249. break;
  25250. }
  25251. if (error) {
  25252. break;
  25253. }
  25254. continue;
  25255. } else if (value <= 246) {
  25256. value -= 139;
  25257. } else if (value <= 250) {
  25258. value = (value - 247) * 256 + encoded[++i] + 108;
  25259. } else if (value <= 254) {
  25260. value = -((value - 251) * 256) - encoded[++i] - 108;
  25261. } else {
  25262. value = (encoded[++i] & 0xff) << 24 | (encoded[++i] & 0xff) << 16 | (encoded[++i] & 0xff) << 8 | (encoded[++i] & 0xff) << 0;
  25263. }
  25264. this.stack.push(value);
  25265. }
  25266. return error;
  25267. }
  25268. executeCommand(howManyArgs, command, keepStack) {
  25269. const stackLength = this.stack.length;
  25270. if (howManyArgs > stackLength) {
  25271. return true;
  25272. }
  25273. const start = stackLength - howManyArgs;
  25274. for (let i = start; i < stackLength; i++) {
  25275. let value = this.stack[i];
  25276. if (Number.isInteger(value)) {
  25277. this.output.push(28, value >> 8 & 0xff, value & 0xff);
  25278. } else {
  25279. value = 65536 * value | 0;
  25280. this.output.push(255, value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff);
  25281. }
  25282. }
  25283. this.output.push(...command);
  25284. if (keepStack) {
  25285. this.stack.splice(start, howManyArgs);
  25286. } else {
  25287. this.stack.length = 0;
  25288. }
  25289. return false;
  25290. }
  25291. }
  25292. const EEXEC_ENCRYPT_KEY = 55665;
  25293. const CHAR_STRS_ENCRYPT_KEY = 4330;
  25294. function isHexDigit(code) {
  25295. return code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102;
  25296. }
  25297. function decrypt(data, key, discardNumber) {
  25298. if (discardNumber >= data.length) {
  25299. return new Uint8Array(0);
  25300. }
  25301. const c1 = 52845,
  25302. c2 = 22719;
  25303. let r = key | 0,
  25304. i,
  25305. j;
  25306. for (i = 0; i < discardNumber; i++) {
  25307. r = (data[i] + r) * c1 + c2 & (1 << 16) - 1;
  25308. }
  25309. const count = data.length - discardNumber;
  25310. const decrypted = new Uint8Array(count);
  25311. for (i = discardNumber, j = 0; j < count; i++, j++) {
  25312. const value = data[i];
  25313. decrypted[j] = value ^ r >> 8;
  25314. r = (value + r) * c1 + c2 & (1 << 16) - 1;
  25315. }
  25316. return decrypted;
  25317. }
  25318. function decryptAscii(data, key, discardNumber) {
  25319. const c1 = 52845,
  25320. c2 = 22719;
  25321. let r = key | 0;
  25322. const count = data.length,
  25323. maybeLength = count >>> 1;
  25324. const decrypted = new Uint8Array(maybeLength);
  25325. let i, j;
  25326. for (i = 0, j = 0; i < count; i++) {
  25327. const digit1 = data[i];
  25328. if (!isHexDigit(digit1)) {
  25329. continue;
  25330. }
  25331. i++;
  25332. let digit2;
  25333. while (i < count && !isHexDigit(digit2 = data[i])) {
  25334. i++;
  25335. }
  25336. if (i < count) {
  25337. const value = parseInt(String.fromCharCode(digit1, digit2), 16);
  25338. decrypted[j++] = value ^ r >> 8;
  25339. r = (value + r) * c1 + c2 & (1 << 16) - 1;
  25340. }
  25341. }
  25342. return decrypted.slice(discardNumber, j);
  25343. }
  25344. function isSpecial(c) {
  25345. return c === 0x2f || c === 0x5b || c === 0x5d || c === 0x7b || c === 0x7d || c === 0x28 || c === 0x29;
  25346. }
  25347. class Type1Parser {
  25348. constructor(stream, encrypted, seacAnalysisEnabled) {
  25349. if (encrypted) {
  25350. const data = stream.getBytes();
  25351. const isBinary = !((isHexDigit(data[0]) || isWhiteSpace(data[0])) && isHexDigit(data[1]) && isHexDigit(data[2]) && isHexDigit(data[3]) && isHexDigit(data[4]) && isHexDigit(data[5]) && isHexDigit(data[6]) && isHexDigit(data[7]));
  25352. stream = new Stream(isBinary ? decrypt(data, EEXEC_ENCRYPT_KEY, 4) : decryptAscii(data, EEXEC_ENCRYPT_KEY, 4));
  25353. }
  25354. this.seacAnalysisEnabled = !!seacAnalysisEnabled;
  25355. this.stream = stream;
  25356. this.nextChar();
  25357. }
  25358. readNumberArray() {
  25359. this.getToken();
  25360. const array = [];
  25361. while (true) {
  25362. const token = this.getToken();
  25363. if (token === null || token === "]" || token === "}") {
  25364. break;
  25365. }
  25366. array.push(parseFloat(token || 0));
  25367. }
  25368. return array;
  25369. }
  25370. readNumber() {
  25371. const token = this.getToken();
  25372. return parseFloat(token || 0);
  25373. }
  25374. readInt() {
  25375. const token = this.getToken();
  25376. return parseInt(token || 0, 10) | 0;
  25377. }
  25378. readBoolean() {
  25379. const token = this.getToken();
  25380. return token === "true" ? 1 : 0;
  25381. }
  25382. nextChar() {
  25383. return this.currentChar = this.stream.getByte();
  25384. }
  25385. prevChar() {
  25386. this.stream.skip(-2);
  25387. return this.currentChar = this.stream.getByte();
  25388. }
  25389. getToken() {
  25390. let comment = false;
  25391. let ch = this.currentChar;
  25392. while (true) {
  25393. if (ch === -1) {
  25394. return null;
  25395. }
  25396. if (comment) {
  25397. if (ch === 0x0a || ch === 0x0d) {
  25398. comment = false;
  25399. }
  25400. } else if (ch === 0x25) {
  25401. comment = true;
  25402. } else if (!isWhiteSpace(ch)) {
  25403. break;
  25404. }
  25405. ch = this.nextChar();
  25406. }
  25407. if (isSpecial(ch)) {
  25408. this.nextChar();
  25409. return String.fromCharCode(ch);
  25410. }
  25411. let token = "";
  25412. do {
  25413. token += String.fromCharCode(ch);
  25414. ch = this.nextChar();
  25415. } while (ch >= 0 && !isWhiteSpace(ch) && !isSpecial(ch));
  25416. return token;
  25417. }
  25418. readCharStrings(bytes, lenIV) {
  25419. if (lenIV === -1) {
  25420. return bytes;
  25421. }
  25422. return decrypt(bytes, CHAR_STRS_ENCRYPT_KEY, lenIV);
  25423. }
  25424. extractFontProgram(properties) {
  25425. const stream = this.stream;
  25426. const subrs = [],
  25427. charstrings = [];
  25428. const privateData = Object.create(null);
  25429. privateData.lenIV = 4;
  25430. const program = {
  25431. subrs: [],
  25432. charstrings: [],
  25433. properties: {
  25434. privateData
  25435. }
  25436. };
  25437. let token, length, data, lenIV;
  25438. while ((token = this.getToken()) !== null) {
  25439. if (token !== "/") {
  25440. continue;
  25441. }
  25442. token = this.getToken();
  25443. switch (token) {
  25444. case "CharStrings":
  25445. this.getToken();
  25446. this.getToken();
  25447. this.getToken();
  25448. this.getToken();
  25449. while (true) {
  25450. token = this.getToken();
  25451. if (token === null || token === "end") {
  25452. break;
  25453. }
  25454. if (token !== "/") {
  25455. continue;
  25456. }
  25457. const glyph = this.getToken();
  25458. length = this.readInt();
  25459. this.getToken();
  25460. data = length > 0 ? stream.getBytes(length) : new Uint8Array(0);
  25461. lenIV = program.properties.privateData.lenIV;
  25462. const encoded = this.readCharStrings(data, lenIV);
  25463. this.nextChar();
  25464. token = this.getToken();
  25465. if (token === "noaccess") {
  25466. this.getToken();
  25467. } else if (token === "/") {
  25468. this.prevChar();
  25469. }
  25470. charstrings.push({
  25471. glyph,
  25472. encoded
  25473. });
  25474. }
  25475. break;
  25476. case "Subrs":
  25477. this.readInt();
  25478. this.getToken();
  25479. while (this.getToken() === "dup") {
  25480. const index = this.readInt();
  25481. length = this.readInt();
  25482. this.getToken();
  25483. data = length > 0 ? stream.getBytes(length) : new Uint8Array(0);
  25484. lenIV = program.properties.privateData.lenIV;
  25485. const encoded = this.readCharStrings(data, lenIV);
  25486. this.nextChar();
  25487. token = this.getToken();
  25488. if (token === "noaccess") {
  25489. this.getToken();
  25490. }
  25491. subrs[index] = encoded;
  25492. }
  25493. break;
  25494. case "BlueValues":
  25495. case "OtherBlues":
  25496. case "FamilyBlues":
  25497. case "FamilyOtherBlues":
  25498. const blueArray = this.readNumberArray();
  25499. if (blueArray.length > 0 && blueArray.length % 2 === 0 && HINTING_ENABLED) {
  25500. program.properties.privateData[token] = blueArray;
  25501. }
  25502. break;
  25503. case "StemSnapH":
  25504. case "StemSnapV":
  25505. program.properties.privateData[token] = this.readNumberArray();
  25506. break;
  25507. case "StdHW":
  25508. case "StdVW":
  25509. program.properties.privateData[token] = this.readNumberArray()[0];
  25510. break;
  25511. case "BlueShift":
  25512. case "lenIV":
  25513. case "BlueFuzz":
  25514. case "BlueScale":
  25515. case "LanguageGroup":
  25516. program.properties.privateData[token] = this.readNumber();
  25517. break;
  25518. case "ExpansionFactor":
  25519. program.properties.privateData[token] = this.readNumber() || 0.06;
  25520. break;
  25521. case "ForceBold":
  25522. program.properties.privateData[token] = this.readBoolean();
  25523. break;
  25524. }
  25525. }
  25526. for (const {
  25527. encoded,
  25528. glyph
  25529. } of charstrings) {
  25530. const charString = new Type1CharString();
  25531. const error = charString.convert(encoded, subrs, this.seacAnalysisEnabled);
  25532. let output = charString.output;
  25533. if (error) {
  25534. output = [14];
  25535. }
  25536. const charStringObject = {
  25537. glyphName: glyph,
  25538. charstring: output,
  25539. width: charString.width,
  25540. lsb: charString.lsb,
  25541. seac: charString.seac
  25542. };
  25543. if (glyph === ".notdef") {
  25544. program.charstrings.unshift(charStringObject);
  25545. } else {
  25546. program.charstrings.push(charStringObject);
  25547. }
  25548. if (properties.builtInEncoding) {
  25549. const index = properties.builtInEncoding.indexOf(glyph);
  25550. if (index > -1 && properties.widths[index] === undefined && index >= properties.firstChar && index <= properties.lastChar) {
  25551. properties.widths[index] = charString.width;
  25552. }
  25553. }
  25554. }
  25555. return program;
  25556. }
  25557. extractFontHeader(properties) {
  25558. let token;
  25559. while ((token = this.getToken()) !== null) {
  25560. if (token !== "/") {
  25561. continue;
  25562. }
  25563. token = this.getToken();
  25564. switch (token) {
  25565. case "FontMatrix":
  25566. const matrix = this.readNumberArray();
  25567. properties.fontMatrix = matrix;
  25568. break;
  25569. case "Encoding":
  25570. const encodingArg = this.getToken();
  25571. let encoding;
  25572. if (!/^\d+$/.test(encodingArg)) {
  25573. encoding = getEncoding(encodingArg);
  25574. } else {
  25575. encoding = [];
  25576. const size = parseInt(encodingArg, 10) | 0;
  25577. this.getToken();
  25578. for (let j = 0; j < size; j++) {
  25579. token = this.getToken();
  25580. while (token !== "dup" && token !== "def") {
  25581. token = this.getToken();
  25582. if (token === null) {
  25583. return;
  25584. }
  25585. }
  25586. if (token === "def") {
  25587. break;
  25588. }
  25589. const index = this.readInt();
  25590. this.getToken();
  25591. const glyph = this.getToken();
  25592. encoding[index] = glyph;
  25593. this.getToken();
  25594. }
  25595. }
  25596. properties.builtInEncoding = encoding;
  25597. break;
  25598. case "FontBBox":
  25599. const fontBBox = this.readNumberArray();
  25600. properties.ascent = Math.max(fontBBox[3], fontBBox[1]);
  25601. properties.descent = Math.min(fontBBox[1], fontBBox[3]);
  25602. properties.ascentScaled = true;
  25603. break;
  25604. }
  25605. }
  25606. }
  25607. }
  25608. ;// ./src/core/type1_font.js
  25609. function findBlock(streamBytes, signature, startIndex) {
  25610. const streamBytesLength = streamBytes.length;
  25611. const signatureLength = signature.length;
  25612. const scanLength = streamBytesLength - signatureLength;
  25613. let i = startIndex,
  25614. found = false;
  25615. while (i < scanLength) {
  25616. let j = 0;
  25617. while (j < signatureLength && streamBytes[i + j] === signature[j]) {
  25618. j++;
  25619. }
  25620. if (j >= signatureLength) {
  25621. i += j;
  25622. while (i < streamBytesLength && isWhiteSpace(streamBytes[i])) {
  25623. i++;
  25624. }
  25625. found = true;
  25626. break;
  25627. }
  25628. i++;
  25629. }
  25630. return {
  25631. found,
  25632. length: i
  25633. };
  25634. }
  25635. function getHeaderBlock(stream, suggestedLength) {
  25636. const EEXEC_SIGNATURE = [0x65, 0x65, 0x78, 0x65, 0x63];
  25637. const streamStartPos = stream.pos;
  25638. let headerBytes, headerBytesLength, block;
  25639. try {
  25640. headerBytes = stream.getBytes(suggestedLength);
  25641. headerBytesLength = headerBytes.length;
  25642. } catch {}
  25643. if (headerBytesLength === suggestedLength) {
  25644. block = findBlock(headerBytes, EEXEC_SIGNATURE, suggestedLength - 2 * EEXEC_SIGNATURE.length);
  25645. if (block.found && block.length === suggestedLength) {
  25646. return {
  25647. stream: new Stream(headerBytes),
  25648. length: suggestedLength
  25649. };
  25650. }
  25651. }
  25652. warn('Invalid "Length1" property in Type1 font -- trying to recover.');
  25653. stream.pos = streamStartPos;
  25654. const SCAN_BLOCK_LENGTH = 2048;
  25655. let actualLength;
  25656. while (true) {
  25657. const scanBytes = stream.peekBytes(SCAN_BLOCK_LENGTH);
  25658. block = findBlock(scanBytes, EEXEC_SIGNATURE, 0);
  25659. if (block.length === 0) {
  25660. break;
  25661. }
  25662. stream.pos += block.length;
  25663. if (block.found) {
  25664. actualLength = stream.pos - streamStartPos;
  25665. break;
  25666. }
  25667. }
  25668. stream.pos = streamStartPos;
  25669. if (actualLength) {
  25670. return {
  25671. stream: new Stream(stream.getBytes(actualLength)),
  25672. length: actualLength
  25673. };
  25674. }
  25675. warn('Unable to recover "Length1" property in Type1 font -- using as is.');
  25676. return {
  25677. stream: new Stream(stream.getBytes(suggestedLength)),
  25678. length: suggestedLength
  25679. };
  25680. }
  25681. function getEexecBlock(stream, suggestedLength) {
  25682. const eexecBytes = stream.getBytes();
  25683. if (eexecBytes.length === 0) {
  25684. throw new FormatError("getEexecBlock - no font program found.");
  25685. }
  25686. return {
  25687. stream: new Stream(eexecBytes),
  25688. length: eexecBytes.length
  25689. };
  25690. }
  25691. class Type1Font {
  25692. constructor(name, file, properties) {
  25693. const PFB_HEADER_SIZE = 6;
  25694. let headerBlockLength = properties.length1;
  25695. let eexecBlockLength = properties.length2;
  25696. let pfbHeader = file.peekBytes(PFB_HEADER_SIZE);
  25697. const pfbHeaderPresent = pfbHeader[0] === 0x80 && pfbHeader[1] === 0x01;
  25698. if (pfbHeaderPresent) {
  25699. file.skip(PFB_HEADER_SIZE);
  25700. headerBlockLength = pfbHeader[5] << 24 | pfbHeader[4] << 16 | pfbHeader[3] << 8 | pfbHeader[2];
  25701. }
  25702. const headerBlock = getHeaderBlock(file, headerBlockLength);
  25703. const headerBlockParser = new Type1Parser(headerBlock.stream, false, SEAC_ANALYSIS_ENABLED);
  25704. headerBlockParser.extractFontHeader(properties);
  25705. if (pfbHeaderPresent) {
  25706. pfbHeader = file.getBytes(PFB_HEADER_SIZE);
  25707. eexecBlockLength = pfbHeader[5] << 24 | pfbHeader[4] << 16 | pfbHeader[3] << 8 | pfbHeader[2];
  25708. }
  25709. const eexecBlock = getEexecBlock(file, eexecBlockLength);
  25710. const eexecBlockParser = new Type1Parser(eexecBlock.stream, true, SEAC_ANALYSIS_ENABLED);
  25711. const data = eexecBlockParser.extractFontProgram(properties);
  25712. for (const key in data.properties) {
  25713. properties[key] = data.properties[key];
  25714. }
  25715. const charstrings = data.charstrings;
  25716. const type2Charstrings = this.getType2Charstrings(charstrings);
  25717. const subrs = this.getType2Subrs(data.subrs);
  25718. this.charstrings = charstrings;
  25719. this.data = this.wrap(name, type2Charstrings, this.charstrings, subrs, properties);
  25720. this.seacs = this.getSeacs(data.charstrings);
  25721. }
  25722. get numGlyphs() {
  25723. return this.charstrings.length + 1;
  25724. }
  25725. getCharset() {
  25726. const charset = [".notdef"];
  25727. for (const {
  25728. glyphName
  25729. } of this.charstrings) {
  25730. charset.push(glyphName);
  25731. }
  25732. return charset;
  25733. }
  25734. getGlyphMapping(properties) {
  25735. const charstrings = this.charstrings;
  25736. if (properties.composite) {
  25737. const charCodeToGlyphId = Object.create(null);
  25738. for (let glyphId = 0, charstringsLen = charstrings.length; glyphId < charstringsLen; glyphId++) {
  25739. const charCode = properties.cMap.charCodeOf(glyphId);
  25740. charCodeToGlyphId[charCode] = glyphId + 1;
  25741. }
  25742. return charCodeToGlyphId;
  25743. }
  25744. const glyphNames = [".notdef"];
  25745. let builtInEncoding, glyphId;
  25746. for (glyphId = 0; glyphId < charstrings.length; glyphId++) {
  25747. glyphNames.push(charstrings[glyphId].glyphName);
  25748. }
  25749. const encoding = properties.builtInEncoding;
  25750. if (encoding) {
  25751. builtInEncoding = Object.create(null);
  25752. for (const charCode in encoding) {
  25753. glyphId = glyphNames.indexOf(encoding[charCode]);
  25754. if (glyphId >= 0) {
  25755. builtInEncoding[charCode] = glyphId;
  25756. }
  25757. }
  25758. }
  25759. return type1FontGlyphMapping(properties, builtInEncoding, glyphNames);
  25760. }
  25761. hasGlyphId(id) {
  25762. if (id < 0 || id >= this.numGlyphs) {
  25763. return false;
  25764. }
  25765. if (id === 0) {
  25766. return true;
  25767. }
  25768. const glyph = this.charstrings[id - 1];
  25769. return glyph.charstring.length > 0;
  25770. }
  25771. getSeacs(charstrings) {
  25772. const seacMap = [];
  25773. for (let i = 0, ii = charstrings.length; i < ii; i++) {
  25774. const charstring = charstrings[i];
  25775. if (charstring.seac) {
  25776. seacMap[i + 1] = charstring.seac;
  25777. }
  25778. }
  25779. return seacMap;
  25780. }
  25781. getType2Charstrings(type1Charstrings) {
  25782. const type2Charstrings = [];
  25783. for (const type1Charstring of type1Charstrings) {
  25784. type2Charstrings.push(type1Charstring.charstring);
  25785. }
  25786. return type2Charstrings;
  25787. }
  25788. getType2Subrs(type1Subrs) {
  25789. let bias = 0;
  25790. const count = type1Subrs.length;
  25791. if (count < 1133) {
  25792. bias = 107;
  25793. } else if (count < 33769) {
  25794. bias = 1131;
  25795. } else {
  25796. bias = 32768;
  25797. }
  25798. const type2Subrs = [];
  25799. let i;
  25800. for (i = 0; i < bias; i++) {
  25801. type2Subrs.push([0x0b]);
  25802. }
  25803. for (i = 0; i < count; i++) {
  25804. type2Subrs.push(type1Subrs[i]);
  25805. }
  25806. return type2Subrs;
  25807. }
  25808. wrap(name, glyphs, charstrings, subrs, properties) {
  25809. const cff = new CFF();
  25810. cff.header = new CFFHeader(1, 0, 4, 4);
  25811. cff.names = [name];
  25812. const topDict = new CFFTopDict();
  25813. topDict.setByName("version", 391);
  25814. topDict.setByName("Notice", 392);
  25815. topDict.setByName("FullName", 393);
  25816. topDict.setByName("FamilyName", 394);
  25817. topDict.setByName("Weight", 395);
  25818. topDict.setByName("Encoding", null);
  25819. topDict.setByName("FontMatrix", properties.fontMatrix);
  25820. topDict.setByName("FontBBox", properties.bbox);
  25821. topDict.setByName("charset", null);
  25822. topDict.setByName("CharStrings", null);
  25823. topDict.setByName("Private", null);
  25824. cff.topDict = topDict;
  25825. const strings = new CFFStrings();
  25826. strings.add("Version 0.11");
  25827. strings.add("See original notice");
  25828. strings.add(name);
  25829. strings.add(name);
  25830. strings.add("Medium");
  25831. cff.strings = strings;
  25832. cff.globalSubrIndex = new CFFIndex();
  25833. const count = glyphs.length;
  25834. const charsetArray = [".notdef"];
  25835. let i, ii;
  25836. for (i = 0; i < count; i++) {
  25837. const glyphName = charstrings[i].glyphName;
  25838. const index = CFFStandardStrings.indexOf(glyphName);
  25839. if (index === -1) {
  25840. strings.add(glyphName);
  25841. }
  25842. charsetArray.push(glyphName);
  25843. }
  25844. cff.charset = new CFFCharset(false, 0, charsetArray);
  25845. const charStringsIndex = new CFFIndex();
  25846. charStringsIndex.add([0x8b, 0x0e]);
  25847. for (i = 0; i < count; i++) {
  25848. charStringsIndex.add(glyphs[i]);
  25849. }
  25850. cff.charStrings = charStringsIndex;
  25851. const privateDict = new CFFPrivateDict();
  25852. privateDict.setByName("Subrs", null);
  25853. const fields = ["BlueValues", "OtherBlues", "FamilyBlues", "FamilyOtherBlues", "StemSnapH", "StemSnapV", "BlueShift", "BlueFuzz", "BlueScale", "LanguageGroup", "ExpansionFactor", "ForceBold", "StdHW", "StdVW"];
  25854. for (i = 0, ii = fields.length; i < ii; i++) {
  25855. const field = fields[i];
  25856. if (!(field in properties.privateData)) {
  25857. continue;
  25858. }
  25859. const value = properties.privateData[field];
  25860. if (Array.isArray(value)) {
  25861. for (let j = value.length - 1; j > 0; j--) {
  25862. value[j] -= value[j - 1];
  25863. }
  25864. }
  25865. privateDict.setByName(field, value);
  25866. }
  25867. cff.topDict.privateDict = privateDict;
  25868. const subrIndex = new CFFIndex();
  25869. for (i = 0, ii = subrs.length; i < ii; i++) {
  25870. subrIndex.add(subrs[i]);
  25871. }
  25872. privateDict.subrsIndex = subrIndex;
  25873. const compiler = new CFFCompiler(cff);
  25874. return compiler.compile();
  25875. }
  25876. }
  25877. ;// ./src/core/fonts.js
  25878. const PRIVATE_USE_AREAS = [[0xe000, 0xf8ff], [0x100000, 0x10fffd]];
  25879. const PDF_GLYPH_SPACE_UNITS = 1000;
  25880. const EXPORT_DATA_PROPERTIES = ["ascent", "bbox", "black", "bold", "charProcOperatorList", "composite", "cssFontInfo", "data", "defaultVMetrics", "defaultWidth", "descent", "fallbackName", "fontMatrix", "isInvalidPDFjsFont", "isType3Font", "italic", "loadedName", "mimetype", "missingFile", "name", "remeasure", "subtype", "systemFontInfo", "type", "vertical"];
  25881. const EXPORT_DATA_EXTRA_PROPERTIES = ["cMap", "defaultEncoding", "differences", "isMonospace", "isSerifFont", "isSymbolicFont", "seacMap", "toFontChar", "toUnicode", "vmetrics", "widths"];
  25882. function adjustWidths(properties) {
  25883. if (!properties.fontMatrix) {
  25884. return;
  25885. }
  25886. if (properties.fontMatrix[0] === FONT_IDENTITY_MATRIX[0]) {
  25887. return;
  25888. }
  25889. const scale = 0.001 / properties.fontMatrix[0];
  25890. const glyphsWidths = properties.widths;
  25891. for (const glyph in glyphsWidths) {
  25892. glyphsWidths[glyph] *= scale;
  25893. }
  25894. properties.defaultWidth *= scale;
  25895. }
  25896. function adjustTrueTypeToUnicode(properties, isSymbolicFont, nameRecords) {
  25897. if (properties.isInternalFont) {
  25898. return;
  25899. }
  25900. if (properties.hasIncludedToUnicodeMap) {
  25901. return;
  25902. }
  25903. if (properties.hasEncoding) {
  25904. return;
  25905. }
  25906. if (properties.toUnicode instanceof IdentityToUnicodeMap) {
  25907. return;
  25908. }
  25909. if (!isSymbolicFont) {
  25910. return;
  25911. }
  25912. if (nameRecords.length === 0) {
  25913. return;
  25914. }
  25915. if (properties.defaultEncoding === WinAnsiEncoding) {
  25916. return;
  25917. }
  25918. for (const r of nameRecords) {
  25919. if (!isWinNameRecord(r)) {
  25920. return;
  25921. }
  25922. }
  25923. const encoding = WinAnsiEncoding;
  25924. const toUnicode = [],
  25925. glyphsUnicodeMap = getGlyphsUnicode();
  25926. for (const charCode in encoding) {
  25927. const glyphName = encoding[charCode];
  25928. if (glyphName === "") {
  25929. continue;
  25930. }
  25931. const unicode = glyphsUnicodeMap[glyphName];
  25932. if (unicode === undefined) {
  25933. continue;
  25934. }
  25935. toUnicode[charCode] = String.fromCharCode(unicode);
  25936. }
  25937. if (toUnicode.length > 0) {
  25938. properties.toUnicode.amend(toUnicode);
  25939. }
  25940. }
  25941. function adjustType1ToUnicode(properties, builtInEncoding) {
  25942. if (properties.isInternalFont) {
  25943. return;
  25944. }
  25945. if (properties.hasIncludedToUnicodeMap) {
  25946. return;
  25947. }
  25948. if (builtInEncoding === properties.defaultEncoding) {
  25949. return;
  25950. }
  25951. if (properties.toUnicode instanceof IdentityToUnicodeMap) {
  25952. return;
  25953. }
  25954. const toUnicode = [],
  25955. glyphsUnicodeMap = getGlyphsUnicode();
  25956. for (const charCode in builtInEncoding) {
  25957. if (properties.hasEncoding) {
  25958. if (properties.baseEncodingName || properties.differences[charCode] !== undefined) {
  25959. continue;
  25960. }
  25961. }
  25962. const glyphName = builtInEncoding[charCode];
  25963. const unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap);
  25964. if (unicode !== -1) {
  25965. toUnicode[charCode] = String.fromCharCode(unicode);
  25966. }
  25967. }
  25968. if (toUnicode.length > 0) {
  25969. properties.toUnicode.amend(toUnicode);
  25970. }
  25971. }
  25972. function amendFallbackToUnicode(properties) {
  25973. if (!properties.fallbackToUnicode) {
  25974. return;
  25975. }
  25976. if (properties.toUnicode instanceof IdentityToUnicodeMap) {
  25977. return;
  25978. }
  25979. const toUnicode = [];
  25980. for (const charCode in properties.fallbackToUnicode) {
  25981. if (properties.toUnicode.has(charCode)) {
  25982. continue;
  25983. }
  25984. toUnicode[charCode] = properties.fallbackToUnicode[charCode];
  25985. }
  25986. if (toUnicode.length > 0) {
  25987. properties.toUnicode.amend(toUnicode);
  25988. }
  25989. }
  25990. class fonts_Glyph {
  25991. constructor(originalCharCode, fontChar, unicode, accent, width, vmetric, operatorListId, isSpace, isInFont) {
  25992. this.originalCharCode = originalCharCode;
  25993. this.fontChar = fontChar;
  25994. this.unicode = unicode;
  25995. this.accent = accent;
  25996. this.width = width;
  25997. this.vmetric = vmetric;
  25998. this.operatorListId = operatorListId;
  25999. this.isSpace = isSpace;
  26000. this.isInFont = isInFont;
  26001. }
  26002. get category() {
  26003. return shadow(this, "category", getCharUnicodeCategory(this.unicode), true);
  26004. }
  26005. }
  26006. function int16(b0, b1) {
  26007. return (b0 << 8) + b1;
  26008. }
  26009. function writeSignedInt16(bytes, index, value) {
  26010. bytes[index + 1] = value;
  26011. bytes[index] = value >>> 8;
  26012. }
  26013. function signedInt16(b0, b1) {
  26014. const value = (b0 << 8) + b1;
  26015. return value & 1 << 15 ? value - 0x10000 : value;
  26016. }
  26017. function writeUint32(bytes, index, value) {
  26018. bytes[index + 3] = value & 0xff;
  26019. bytes[index + 2] = value >>> 8;
  26020. bytes[index + 1] = value >>> 16;
  26021. bytes[index] = value >>> 24;
  26022. }
  26023. function int32(b0, b1, b2, b3) {
  26024. return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3;
  26025. }
  26026. function string16(value) {
  26027. return String.fromCharCode(value >> 8 & 0xff, value & 0xff);
  26028. }
  26029. function safeString16(value) {
  26030. if (value > 0x7fff) {
  26031. value = 0x7fff;
  26032. } else if (value < -0x8000) {
  26033. value = -0x8000;
  26034. }
  26035. return String.fromCharCode(value >> 8 & 0xff, value & 0xff);
  26036. }
  26037. function isTrueTypeFile(file) {
  26038. const header = file.peekBytes(4);
  26039. return readUint32(header, 0) === 0x00010000 || bytesToString(header) === "true";
  26040. }
  26041. function isTrueTypeCollectionFile(file) {
  26042. const header = file.peekBytes(4);
  26043. return bytesToString(header) === "ttcf";
  26044. }
  26045. function isOpenTypeFile(file) {
  26046. const header = file.peekBytes(4);
  26047. return bytesToString(header) === "OTTO";
  26048. }
  26049. function isType1File(file) {
  26050. const header = file.peekBytes(2);
  26051. if (header[0] === 0x25 && header[1] === 0x21) {
  26052. return true;
  26053. }
  26054. if (header[0] === 0x80 && header[1] === 0x01) {
  26055. return true;
  26056. }
  26057. return false;
  26058. }
  26059. function isCFFFile(file) {
  26060. const header = file.peekBytes(4);
  26061. if (header[0] >= 1 && header[3] >= 1 && header[3] <= 4) {
  26062. return true;
  26063. }
  26064. return false;
  26065. }
  26066. function getFontFileType(file, {
  26067. type,
  26068. subtype,
  26069. composite
  26070. }) {
  26071. let fileType, fileSubtype;
  26072. if (isTrueTypeFile(file) || isTrueTypeCollectionFile(file)) {
  26073. fileType = composite ? "CIDFontType2" : "TrueType";
  26074. } else if (isOpenTypeFile(file)) {
  26075. fileType = composite ? "CIDFontType2" : "OpenType";
  26076. } else if (isType1File(file)) {
  26077. if (composite) {
  26078. fileType = "CIDFontType0";
  26079. } else {
  26080. fileType = type === "MMType1" ? "MMType1" : "Type1";
  26081. }
  26082. } else if (isCFFFile(file)) {
  26083. if (composite) {
  26084. fileType = "CIDFontType0";
  26085. fileSubtype = "CIDFontType0C";
  26086. } else {
  26087. fileType = type === "MMType1" ? "MMType1" : "Type1";
  26088. fileSubtype = "Type1C";
  26089. }
  26090. } else {
  26091. warn("getFontFileType: Unable to detect correct font file Type/Subtype.");
  26092. fileType = type;
  26093. fileSubtype = subtype;
  26094. }
  26095. return [fileType, fileSubtype];
  26096. }
  26097. function applyStandardFontGlyphMap(map, glyphMap) {
  26098. for (const charCode in glyphMap) {
  26099. map[+charCode] = glyphMap[charCode];
  26100. }
  26101. }
  26102. function buildToFontChar(encoding, glyphsUnicodeMap, differences) {
  26103. const toFontChar = [];
  26104. let unicode;
  26105. for (let i = 0, ii = encoding.length; i < ii; i++) {
  26106. unicode = getUnicodeForGlyph(encoding[i], glyphsUnicodeMap);
  26107. if (unicode !== -1) {
  26108. toFontChar[i] = unicode;
  26109. }
  26110. }
  26111. for (const charCode in differences) {
  26112. unicode = getUnicodeForGlyph(differences[charCode], glyphsUnicodeMap);
  26113. if (unicode !== -1) {
  26114. toFontChar[+charCode] = unicode;
  26115. }
  26116. }
  26117. return toFontChar;
  26118. }
  26119. function isMacNameRecord(r) {
  26120. return r.platform === 1 && r.encoding === 0 && r.language === 0;
  26121. }
  26122. function isWinNameRecord(r) {
  26123. return r.platform === 3 && r.encoding === 1 && r.language === 0x409;
  26124. }
  26125. function convertCidString(charCode, cid, shouldThrow = false) {
  26126. switch (cid.length) {
  26127. case 1:
  26128. return cid.charCodeAt(0);
  26129. case 2:
  26130. return cid.charCodeAt(0) << 8 | cid.charCodeAt(1);
  26131. }
  26132. const msg = `Unsupported CID string (charCode ${charCode}): "${cid}".`;
  26133. if (shouldThrow) {
  26134. throw new FormatError(msg);
  26135. }
  26136. warn(msg);
  26137. return cid;
  26138. }
  26139. function adjustMapping(charCodeToGlyphId, hasGlyph, newGlyphZeroId, toUnicode) {
  26140. const newMap = Object.create(null);
  26141. const toUnicodeExtraMap = new Map();
  26142. const toFontChar = [];
  26143. const usedGlyphIds = new Set();
  26144. let privateUseAreaIndex = 0;
  26145. const privateUseOffetStart = PRIVATE_USE_AREAS[privateUseAreaIndex][0];
  26146. let nextAvailableFontCharCode = privateUseOffetStart;
  26147. let privateUseOffetEnd = PRIVATE_USE_AREAS[privateUseAreaIndex][1];
  26148. const isInPrivateArea = code => PRIVATE_USE_AREAS[0][0] <= code && code <= PRIVATE_USE_AREAS[0][1] || PRIVATE_USE_AREAS[1][0] <= code && code <= PRIVATE_USE_AREAS[1][1];
  26149. for (const originalCharCode in charCodeToGlyphId) {
  26150. let glyphId = charCodeToGlyphId[originalCharCode];
  26151. if (!hasGlyph(glyphId)) {
  26152. continue;
  26153. }
  26154. if (nextAvailableFontCharCode > privateUseOffetEnd) {
  26155. privateUseAreaIndex++;
  26156. if (privateUseAreaIndex >= PRIVATE_USE_AREAS.length) {
  26157. warn("Ran out of space in font private use area.");
  26158. break;
  26159. }
  26160. nextAvailableFontCharCode = PRIVATE_USE_AREAS[privateUseAreaIndex][0];
  26161. privateUseOffetEnd = PRIVATE_USE_AREAS[privateUseAreaIndex][1];
  26162. }
  26163. const fontCharCode = nextAvailableFontCharCode++;
  26164. if (glyphId === 0) {
  26165. glyphId = newGlyphZeroId;
  26166. }
  26167. let unicode = toUnicode.get(originalCharCode);
  26168. if (typeof unicode === "string") {
  26169. unicode = unicode.codePointAt(0);
  26170. }
  26171. if (unicode && !isInPrivateArea(unicode) && !usedGlyphIds.has(glyphId)) {
  26172. toUnicodeExtraMap.set(unicode, glyphId);
  26173. usedGlyphIds.add(glyphId);
  26174. }
  26175. newMap[fontCharCode] = glyphId;
  26176. toFontChar[originalCharCode] = fontCharCode;
  26177. }
  26178. return {
  26179. toFontChar,
  26180. charCodeToGlyphId: newMap,
  26181. toUnicodeExtraMap,
  26182. nextAvailableFontCharCode
  26183. };
  26184. }
  26185. function getRanges(glyphs, toUnicodeExtraMap, numGlyphs) {
  26186. const codes = [];
  26187. for (const charCode in glyphs) {
  26188. if (glyphs[charCode] >= numGlyphs) {
  26189. continue;
  26190. }
  26191. codes.push({
  26192. fontCharCode: charCode | 0,
  26193. glyphId: glyphs[charCode]
  26194. });
  26195. }
  26196. if (toUnicodeExtraMap) {
  26197. for (const [unicode, glyphId] of toUnicodeExtraMap) {
  26198. if (glyphId >= numGlyphs) {
  26199. continue;
  26200. }
  26201. codes.push({
  26202. fontCharCode: unicode,
  26203. glyphId
  26204. });
  26205. }
  26206. }
  26207. if (codes.length === 0) {
  26208. codes.push({
  26209. fontCharCode: 0,
  26210. glyphId: 0
  26211. });
  26212. }
  26213. codes.sort(function fontGetRangesSort(a, b) {
  26214. return a.fontCharCode - b.fontCharCode;
  26215. });
  26216. const ranges = [];
  26217. const length = codes.length;
  26218. for (let n = 0; n < length;) {
  26219. const start = codes[n].fontCharCode;
  26220. const codeIndices = [codes[n].glyphId];
  26221. ++n;
  26222. let end = start;
  26223. while (n < length && end + 1 === codes[n].fontCharCode) {
  26224. codeIndices.push(codes[n].glyphId);
  26225. ++end;
  26226. ++n;
  26227. if (end === 0xffff) {
  26228. break;
  26229. }
  26230. }
  26231. ranges.push([start, end, codeIndices]);
  26232. }
  26233. return ranges;
  26234. }
  26235. function createCmapTable(glyphs, toUnicodeExtraMap, numGlyphs) {
  26236. const ranges = getRanges(glyphs, toUnicodeExtraMap, numGlyphs);
  26237. const numTables = ranges.at(-1)[1] > 0xffff ? 2 : 1;
  26238. let cmap = "\x00\x00" + string16(numTables) + "\x00\x03" + "\x00\x01" + string32(4 + numTables * 8);
  26239. let i, ii, j, jj;
  26240. for (i = ranges.length - 1; i >= 0; --i) {
  26241. if (ranges[i][0] <= 0xffff) {
  26242. break;
  26243. }
  26244. }
  26245. const bmpLength = i + 1;
  26246. if (ranges[i][0] < 0xffff && ranges[i][1] === 0xffff) {
  26247. ranges[i][1] = 0xfffe;
  26248. }
  26249. const trailingRangesCount = ranges[i][1] < 0xffff ? 1 : 0;
  26250. const segCount = bmpLength + trailingRangesCount;
  26251. const searchParams = OpenTypeFileBuilder.getSearchParams(segCount, 2);
  26252. let startCount = "";
  26253. let endCount = "";
  26254. let idDeltas = "";
  26255. let idRangeOffsets = "";
  26256. let glyphsIds = "";
  26257. let bias = 0;
  26258. let range, start, end, codes;
  26259. for (i = 0, ii = bmpLength; i < ii; i++) {
  26260. range = ranges[i];
  26261. start = range[0];
  26262. end = range[1];
  26263. startCount += string16(start);
  26264. endCount += string16(end);
  26265. codes = range[2];
  26266. let contiguous = true;
  26267. for (j = 1, jj = codes.length; j < jj; ++j) {
  26268. if (codes[j] !== codes[j - 1] + 1) {
  26269. contiguous = false;
  26270. break;
  26271. }
  26272. }
  26273. if (!contiguous) {
  26274. const offset = (segCount - i) * 2 + bias * 2;
  26275. bias += end - start + 1;
  26276. idDeltas += string16(0);
  26277. idRangeOffsets += string16(offset);
  26278. for (j = 0, jj = codes.length; j < jj; ++j) {
  26279. glyphsIds += string16(codes[j]);
  26280. }
  26281. } else {
  26282. const startCode = codes[0];
  26283. idDeltas += string16(startCode - start & 0xffff);
  26284. idRangeOffsets += string16(0);
  26285. }
  26286. }
  26287. if (trailingRangesCount > 0) {
  26288. endCount += "\xFF\xFF";
  26289. startCount += "\xFF\xFF";
  26290. idDeltas += "\x00\x01";
  26291. idRangeOffsets += "\x00\x00";
  26292. }
  26293. const format314 = "\x00\x00" + string16(2 * segCount) + string16(searchParams.range) + string16(searchParams.entry) + string16(searchParams.rangeShift) + endCount + "\x00\x00" + startCount + idDeltas + idRangeOffsets + glyphsIds;
  26294. let format31012 = "";
  26295. let header31012 = "";
  26296. if (numTables > 1) {
  26297. cmap += "\x00\x03" + "\x00\x0A" + string32(4 + numTables * 8 + 4 + format314.length);
  26298. format31012 = "";
  26299. for (i = 0, ii = ranges.length; i < ii; i++) {
  26300. range = ranges[i];
  26301. start = range[0];
  26302. codes = range[2];
  26303. let code = codes[0];
  26304. for (j = 1, jj = codes.length; j < jj; ++j) {
  26305. if (codes[j] !== codes[j - 1] + 1) {
  26306. end = range[0] + j - 1;
  26307. format31012 += string32(start) + string32(end) + string32(code);
  26308. start = end + 1;
  26309. code = codes[j];
  26310. }
  26311. }
  26312. format31012 += string32(start) + string32(range[1]) + string32(code);
  26313. }
  26314. header31012 = "\x00\x0C" + "\x00\x00" + string32(format31012.length + 16) + "\x00\x00\x00\x00" + string32(format31012.length / 12);
  26315. }
  26316. return cmap + "\x00\x04" + string16(format314.length + 4) + format314 + header31012 + format31012;
  26317. }
  26318. function validateOS2Table(os2, file) {
  26319. file.pos = (file.start || 0) + os2.offset;
  26320. const version = file.getUint16();
  26321. file.skip(60);
  26322. const selection = file.getUint16();
  26323. if (version < 4 && selection & 0x0300) {
  26324. return false;
  26325. }
  26326. const firstChar = file.getUint16();
  26327. const lastChar = file.getUint16();
  26328. if (firstChar > lastChar) {
  26329. return false;
  26330. }
  26331. file.skip(6);
  26332. const usWinAscent = file.getUint16();
  26333. if (usWinAscent === 0) {
  26334. return false;
  26335. }
  26336. os2.data[8] = os2.data[9] = 0;
  26337. return true;
  26338. }
  26339. function createOS2Table(properties, charstrings, override) {
  26340. override ||= {
  26341. unitsPerEm: 0,
  26342. yMax: 0,
  26343. yMin: 0,
  26344. ascent: 0,
  26345. descent: 0
  26346. };
  26347. let ulUnicodeRange1 = 0;
  26348. let ulUnicodeRange2 = 0;
  26349. let ulUnicodeRange3 = 0;
  26350. let ulUnicodeRange4 = 0;
  26351. let firstCharIndex = null;
  26352. let lastCharIndex = 0;
  26353. let position = -1;
  26354. if (charstrings) {
  26355. for (let code in charstrings) {
  26356. code |= 0;
  26357. if (firstCharIndex > code || !firstCharIndex) {
  26358. firstCharIndex = code;
  26359. }
  26360. if (lastCharIndex < code) {
  26361. lastCharIndex = code;
  26362. }
  26363. position = getUnicodeRangeFor(code, position);
  26364. if (position < 32) {
  26365. ulUnicodeRange1 |= 1 << position;
  26366. } else if (position < 64) {
  26367. ulUnicodeRange2 |= 1 << position - 32;
  26368. } else if (position < 96) {
  26369. ulUnicodeRange3 |= 1 << position - 64;
  26370. } else if (position < 123) {
  26371. ulUnicodeRange4 |= 1 << position - 96;
  26372. } else {
  26373. throw new FormatError("Unicode ranges Bits > 123 are reserved for internal usage");
  26374. }
  26375. }
  26376. if (lastCharIndex > 0xffff) {
  26377. lastCharIndex = 0xffff;
  26378. }
  26379. } else {
  26380. firstCharIndex = 0;
  26381. lastCharIndex = 255;
  26382. }
  26383. const bbox = properties.bbox || [0, 0, 0, 0];
  26384. const unitsPerEm = override.unitsPerEm || (properties.fontMatrix ? 1 / Math.max(...properties.fontMatrix.slice(0, 4).map(Math.abs)) : 1000);
  26385. const scale = properties.ascentScaled ? 1.0 : unitsPerEm / PDF_GLYPH_SPACE_UNITS;
  26386. const typoAscent = override.ascent || Math.round(scale * (properties.ascent || bbox[3]));
  26387. let typoDescent = override.descent || Math.round(scale * (properties.descent || bbox[1]));
  26388. if (typoDescent > 0 && properties.descent > 0 && bbox[1] < 0) {
  26389. typoDescent = -typoDescent;
  26390. }
  26391. const winAscent = override.yMax || typoAscent;
  26392. const winDescent = -override.yMin || -typoDescent;
  26393. return "\x00\x03" + "\x02\x24" + "\x01\xF4" + "\x00\x05" + "\x00\x00" + "\x02\x8A" + "\x02\xBB" + "\x00\x00" + "\x00\x8C" + "\x02\x8A" + "\x02\xBB" + "\x00\x00" + "\x01\xDF" + "\x00\x31" + "\x01\x02" + "\x00\x00" + "\x00\x00\x06" + String.fromCharCode(properties.fixedPitch ? 0x09 : 0x00) + "\x00\x00\x00\x00\x00\x00" + string32(ulUnicodeRange1) + string32(ulUnicodeRange2) + string32(ulUnicodeRange3) + string32(ulUnicodeRange4) + "\x2A\x32\x31\x2A" + string16(properties.italicAngle ? 1 : 0) + string16(firstCharIndex || properties.firstChar) + string16(lastCharIndex || properties.lastChar) + string16(typoAscent) + string16(typoDescent) + "\x00\x64" + string16(winAscent) + string16(winDescent) + "\x00\x00\x00\x00" + "\x00\x00\x00\x00" + string16(properties.xHeight) + string16(properties.capHeight) + string16(0) + string16(firstCharIndex || properties.firstChar) + "\x00\x03";
  26394. }
  26395. function createPostTable(properties) {
  26396. const angle = Math.floor(properties.italicAngle * 2 ** 16);
  26397. return "\x00\x03\x00\x00" + string32(angle) + "\x00\x00" + "\x00\x00" + string32(properties.fixedPitch ? 1 : 0) + "\x00\x00\x00\x00" + "\x00\x00\x00\x00" + "\x00\x00\x00\x00" + "\x00\x00\x00\x00";
  26398. }
  26399. function createPostscriptName(name) {
  26400. return name.replaceAll(/[^\x21-\x7E]|[[\](){}<>/%]/g, "").slice(0, 63);
  26401. }
  26402. function createNameTable(name, proto) {
  26403. if (!proto) {
  26404. proto = [[], []];
  26405. }
  26406. const strings = [proto[0][0] || "Original licence", proto[0][1] || name, proto[0][2] || "Unknown", proto[0][3] || "uniqueID", proto[0][4] || name, proto[0][5] || "Version 0.11", proto[0][6] || createPostscriptName(name), proto[0][7] || "Unknown", proto[0][8] || "Unknown", proto[0][9] || "Unknown"];
  26407. const stringsUnicode = [];
  26408. let i, ii, j, jj, str;
  26409. for (i = 0, ii = strings.length; i < ii; i++) {
  26410. str = proto[1][i] || strings[i];
  26411. const strBufUnicode = [];
  26412. for (j = 0, jj = str.length; j < jj; j++) {
  26413. strBufUnicode.push(string16(str.charCodeAt(j)));
  26414. }
  26415. stringsUnicode.push(strBufUnicode.join(""));
  26416. }
  26417. const names = [strings, stringsUnicode];
  26418. const platforms = ["\x00\x01", "\x00\x03"];
  26419. const encodings = ["\x00\x00", "\x00\x01"];
  26420. const languages = ["\x00\x00", "\x04\x09"];
  26421. const namesRecordCount = strings.length * platforms.length;
  26422. let nameTable = "\x00\x00" + string16(namesRecordCount) + string16(namesRecordCount * 12 + 6);
  26423. let strOffset = 0;
  26424. for (i = 0, ii = platforms.length; i < ii; i++) {
  26425. const strs = names[i];
  26426. for (j = 0, jj = strs.length; j < jj; j++) {
  26427. str = strs[j];
  26428. const nameRecord = platforms[i] + encodings[i] + languages[i] + string16(j) + string16(str.length) + string16(strOffset);
  26429. nameTable += nameRecord;
  26430. strOffset += str.length;
  26431. }
  26432. }
  26433. nameTable += strings.join("") + stringsUnicode.join("");
  26434. return nameTable;
  26435. }
  26436. class Font {
  26437. constructor(name, file, properties) {
  26438. this.name = name;
  26439. this.psName = null;
  26440. this.mimetype = null;
  26441. this.disableFontFace = false;
  26442. this.loadedName = properties.loadedName;
  26443. this.isType3Font = properties.isType3Font;
  26444. this.missingFile = false;
  26445. this.cssFontInfo = properties.cssFontInfo;
  26446. this._charsCache = Object.create(null);
  26447. this._glyphCache = Object.create(null);
  26448. let isSerifFont = !!(properties.flags & FontFlags.Serif);
  26449. if (!isSerifFont && !properties.isSimulatedFlags) {
  26450. const baseName = name.replaceAll(/[,_]/g, "-").split("-", 1)[0],
  26451. serifFonts = getSerifFonts();
  26452. for (const namePart of baseName.split("+")) {
  26453. if (serifFonts[namePart]) {
  26454. isSerifFont = true;
  26455. break;
  26456. }
  26457. }
  26458. }
  26459. this.isSerifFont = isSerifFont;
  26460. this.isSymbolicFont = !!(properties.flags & FontFlags.Symbolic);
  26461. this.isMonospace = !!(properties.flags & FontFlags.FixedPitch);
  26462. let {
  26463. type,
  26464. subtype
  26465. } = properties;
  26466. this.type = type;
  26467. this.subtype = subtype;
  26468. this.systemFontInfo = properties.systemFontInfo;
  26469. const matches = name.match(/^InvalidPDFjsFont_(.*)_\d+$/);
  26470. this.isInvalidPDFjsFont = !!matches;
  26471. if (this.isInvalidPDFjsFont) {
  26472. this.fallbackName = matches[1];
  26473. } else if (this.isMonospace) {
  26474. this.fallbackName = "monospace";
  26475. } else if (this.isSerifFont) {
  26476. this.fallbackName = "serif";
  26477. } else {
  26478. this.fallbackName = "sans-serif";
  26479. }
  26480. if (this.systemFontInfo?.guessFallback) {
  26481. this.systemFontInfo.guessFallback = false;
  26482. this.systemFontInfo.css += `,${this.fallbackName}`;
  26483. }
  26484. this.differences = properties.differences;
  26485. this.widths = properties.widths;
  26486. this.defaultWidth = properties.defaultWidth;
  26487. this.composite = properties.composite;
  26488. this.cMap = properties.cMap;
  26489. this.capHeight = properties.capHeight / PDF_GLYPH_SPACE_UNITS;
  26490. this.ascent = properties.ascent / PDF_GLYPH_SPACE_UNITS;
  26491. this.descent = properties.descent / PDF_GLYPH_SPACE_UNITS;
  26492. this.lineHeight = this.ascent - this.descent;
  26493. this.fontMatrix = properties.fontMatrix;
  26494. this.bbox = properties.bbox;
  26495. this.defaultEncoding = properties.defaultEncoding;
  26496. this.toUnicode = properties.toUnicode;
  26497. this.toFontChar = [];
  26498. if (properties.type === "Type3") {
  26499. for (let charCode = 0; charCode < 256; charCode++) {
  26500. this.toFontChar[charCode] = this.differences[charCode] || properties.defaultEncoding[charCode];
  26501. }
  26502. return;
  26503. }
  26504. this.cidEncoding = properties.cidEncoding || "";
  26505. this.vertical = !!properties.vertical;
  26506. if (this.vertical) {
  26507. this.vmetrics = properties.vmetrics;
  26508. this.defaultVMetrics = properties.defaultVMetrics;
  26509. }
  26510. if (!file || file.isEmpty) {
  26511. if (file) {
  26512. warn('Font file is empty in "' + name + '" (' + this.loadedName + ")");
  26513. }
  26514. this.fallbackToSystemFont(properties);
  26515. return;
  26516. }
  26517. [type, subtype] = getFontFileType(file, properties);
  26518. if (type !== this.type || subtype !== this.subtype) {
  26519. info("Inconsistent font file Type/SubType, expected: " + `${this.type}/${this.subtype} but found: ${type}/${subtype}.`);
  26520. }
  26521. let data;
  26522. try {
  26523. switch (type) {
  26524. case "MMType1":
  26525. info("MMType1 font (" + name + "), falling back to Type1.");
  26526. case "Type1":
  26527. case "CIDFontType0":
  26528. this.mimetype = "font/opentype";
  26529. const cff = subtype === "Type1C" || subtype === "CIDFontType0C" ? new CFFFont(file, properties) : new Type1Font(name, file, properties);
  26530. adjustWidths(properties);
  26531. data = this.convert(name, cff, properties);
  26532. break;
  26533. case "OpenType":
  26534. case "TrueType":
  26535. case "CIDFontType2":
  26536. this.mimetype = "font/opentype";
  26537. data = this.checkAndRepair(name, file, properties);
  26538. if (this.isOpenType) {
  26539. adjustWidths(properties);
  26540. type = "OpenType";
  26541. }
  26542. break;
  26543. default:
  26544. throw new FormatError(`Font ${type} is not supported`);
  26545. }
  26546. } catch (e) {
  26547. warn(e);
  26548. this.fallbackToSystemFont(properties);
  26549. return;
  26550. }
  26551. amendFallbackToUnicode(properties);
  26552. this.data = data;
  26553. this.type = type;
  26554. this.subtype = subtype;
  26555. this.fontMatrix = properties.fontMatrix;
  26556. this.widths = properties.widths;
  26557. this.defaultWidth = properties.defaultWidth;
  26558. this.toUnicode = properties.toUnicode;
  26559. this.seacMap = properties.seacMap;
  26560. }
  26561. get renderer() {
  26562. const renderer = FontRendererFactory.create(this, SEAC_ANALYSIS_ENABLED);
  26563. return shadow(this, "renderer", renderer);
  26564. }
  26565. exportData(extraProperties = false) {
  26566. const exportDataProperties = extraProperties ? [...EXPORT_DATA_PROPERTIES, ...EXPORT_DATA_EXTRA_PROPERTIES] : EXPORT_DATA_PROPERTIES;
  26567. const data = Object.create(null);
  26568. let property, value;
  26569. for (property of exportDataProperties) {
  26570. value = this[property];
  26571. if (value !== undefined) {
  26572. data[property] = value;
  26573. }
  26574. }
  26575. return data;
  26576. }
  26577. fallbackToSystemFont(properties) {
  26578. this.missingFile = true;
  26579. const {
  26580. name,
  26581. type
  26582. } = this;
  26583. let fontName = normalizeFontName(name);
  26584. const stdFontMap = getStdFontMap(),
  26585. nonStdFontMap = getNonStdFontMap();
  26586. const isStandardFont = !!stdFontMap[fontName];
  26587. const isMappedToStandardFont = !!(nonStdFontMap[fontName] && stdFontMap[nonStdFontMap[fontName]]);
  26588. fontName = stdFontMap[fontName] || nonStdFontMap[fontName] || fontName;
  26589. const fontBasicMetricsMap = getFontBasicMetrics();
  26590. const metrics = fontBasicMetricsMap[fontName];
  26591. if (metrics) {
  26592. if (isNaN(this.ascent)) {
  26593. this.ascent = metrics.ascent / PDF_GLYPH_SPACE_UNITS;
  26594. }
  26595. if (isNaN(this.descent)) {
  26596. this.descent = metrics.descent / PDF_GLYPH_SPACE_UNITS;
  26597. }
  26598. if (isNaN(this.capHeight)) {
  26599. this.capHeight = metrics.capHeight / PDF_GLYPH_SPACE_UNITS;
  26600. }
  26601. }
  26602. this.bold = /bold/gi.test(fontName);
  26603. this.italic = /oblique|italic/gi.test(fontName);
  26604. this.black = /Black/g.test(name);
  26605. const isNarrow = /Narrow/g.test(name);
  26606. this.remeasure = (!isStandardFont || isNarrow) && Object.keys(this.widths).length > 0;
  26607. if ((isStandardFont || isMappedToStandardFont) && type === "CIDFontType2" && this.cidEncoding.startsWith("Identity-")) {
  26608. const cidToGidMap = properties.cidToGidMap;
  26609. const map = [];
  26610. applyStandardFontGlyphMap(map, getGlyphMapForStandardFonts());
  26611. if (/Arial-?Black/i.test(name)) {
  26612. applyStandardFontGlyphMap(map, getSupplementalGlyphMapForArialBlack());
  26613. } else if (/Calibri/i.test(name)) {
  26614. applyStandardFontGlyphMap(map, getSupplementalGlyphMapForCalibri());
  26615. }
  26616. if (cidToGidMap) {
  26617. for (const charCode in map) {
  26618. const cid = map[charCode];
  26619. if (cidToGidMap[cid] !== undefined) {
  26620. map[+charCode] = cidToGidMap[cid];
  26621. }
  26622. }
  26623. if (cidToGidMap.length !== this.toUnicode.length && properties.hasIncludedToUnicodeMap && this.toUnicode instanceof IdentityToUnicodeMap) {
  26624. this.toUnicode.forEach(function (charCode, unicodeCharCode) {
  26625. const cid = map[charCode];
  26626. if (cidToGidMap[cid] === undefined) {
  26627. map[+charCode] = unicodeCharCode;
  26628. }
  26629. });
  26630. }
  26631. }
  26632. if (!(this.toUnicode instanceof IdentityToUnicodeMap)) {
  26633. this.toUnicode.forEach(function (charCode, unicodeCharCode) {
  26634. map[+charCode] = unicodeCharCode;
  26635. });
  26636. }
  26637. this.toFontChar = map;
  26638. this.toUnicode = new ToUnicodeMap(map);
  26639. } else if (/Symbol/i.test(fontName)) {
  26640. this.toFontChar = buildToFontChar(SymbolSetEncoding, getGlyphsUnicode(), this.differences);
  26641. } else if (/Dingbats/i.test(fontName)) {
  26642. this.toFontChar = buildToFontChar(ZapfDingbatsEncoding, getDingbatsGlyphsUnicode(), this.differences);
  26643. } else if (isStandardFont || isMappedToStandardFont) {
  26644. const map = buildToFontChar(this.defaultEncoding, getGlyphsUnicode(), this.differences);
  26645. if (type === "CIDFontType2" && !this.cidEncoding.startsWith("Identity-") && !(this.toUnicode instanceof IdentityToUnicodeMap)) {
  26646. this.toUnicode.forEach(function (charCode, unicodeCharCode) {
  26647. map[+charCode] = unicodeCharCode;
  26648. });
  26649. }
  26650. this.toFontChar = map;
  26651. } else {
  26652. const glyphsUnicodeMap = getGlyphsUnicode();
  26653. const map = [];
  26654. this.toUnicode.forEach((charCode, unicodeCharCode) => {
  26655. if (!this.composite) {
  26656. const glyphName = this.differences[charCode] || this.defaultEncoding[charCode];
  26657. const unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap);
  26658. if (unicode !== -1) {
  26659. unicodeCharCode = unicode;
  26660. }
  26661. }
  26662. map[+charCode] = unicodeCharCode;
  26663. });
  26664. if (this.composite && this.toUnicode instanceof IdentityToUnicodeMap) {
  26665. if (/Tahoma|Verdana/i.test(name)) {
  26666. applyStandardFontGlyphMap(map, getGlyphMapForStandardFonts());
  26667. }
  26668. }
  26669. this.toFontChar = map;
  26670. }
  26671. amendFallbackToUnicode(properties);
  26672. this.loadedName = fontName.split("-", 1)[0];
  26673. }
  26674. checkAndRepair(name, font, properties) {
  26675. const VALID_TABLES = ["OS/2", "cmap", "head", "hhea", "hmtx", "maxp", "name", "post", "loca", "glyf", "fpgm", "prep", "cvt ", "CFF "];
  26676. function readTables(file, numTables) {
  26677. const tables = Object.create(null);
  26678. tables["OS/2"] = null;
  26679. tables.cmap = null;
  26680. tables.head = null;
  26681. tables.hhea = null;
  26682. tables.hmtx = null;
  26683. tables.maxp = null;
  26684. tables.name = null;
  26685. tables.post = null;
  26686. for (let i = 0; i < numTables; i++) {
  26687. const table = readTableEntry(file);
  26688. if (!VALID_TABLES.includes(table.tag)) {
  26689. continue;
  26690. }
  26691. if (table.length === 0) {
  26692. continue;
  26693. }
  26694. tables[table.tag] = table;
  26695. }
  26696. return tables;
  26697. }
  26698. function readTableEntry(file) {
  26699. const tag = file.getString(4);
  26700. const checksum = file.getInt32() >>> 0;
  26701. const offset = file.getInt32() >>> 0;
  26702. const length = file.getInt32() >>> 0;
  26703. const previousPosition = file.pos;
  26704. file.pos = file.start || 0;
  26705. file.skip(offset);
  26706. const data = file.getBytes(length);
  26707. file.pos = previousPosition;
  26708. if (tag === "head") {
  26709. data[8] = data[9] = data[10] = data[11] = 0;
  26710. data[17] |= 0x20;
  26711. }
  26712. return {
  26713. tag,
  26714. checksum,
  26715. length,
  26716. offset,
  26717. data
  26718. };
  26719. }
  26720. function readOpenTypeHeader(ttf) {
  26721. return {
  26722. version: ttf.getString(4),
  26723. numTables: ttf.getUint16(),
  26724. searchRange: ttf.getUint16(),
  26725. entrySelector: ttf.getUint16(),
  26726. rangeShift: ttf.getUint16()
  26727. };
  26728. }
  26729. function readTrueTypeCollectionHeader(ttc) {
  26730. const ttcTag = ttc.getString(4);
  26731. assert(ttcTag === "ttcf", "Must be a TrueType Collection font.");
  26732. const majorVersion = ttc.getUint16();
  26733. const minorVersion = ttc.getUint16();
  26734. const numFonts = ttc.getInt32() >>> 0;
  26735. const offsetTable = [];
  26736. for (let i = 0; i < numFonts; i++) {
  26737. offsetTable.push(ttc.getInt32() >>> 0);
  26738. }
  26739. const header = {
  26740. ttcTag,
  26741. majorVersion,
  26742. minorVersion,
  26743. numFonts,
  26744. offsetTable
  26745. };
  26746. switch (majorVersion) {
  26747. case 1:
  26748. return header;
  26749. case 2:
  26750. header.dsigTag = ttc.getInt32() >>> 0;
  26751. header.dsigLength = ttc.getInt32() >>> 0;
  26752. header.dsigOffset = ttc.getInt32() >>> 0;
  26753. return header;
  26754. }
  26755. throw new FormatError(`Invalid TrueType Collection majorVersion: ${majorVersion}.`);
  26756. }
  26757. function readTrueTypeCollectionData(ttc, fontName) {
  26758. const {
  26759. numFonts,
  26760. offsetTable
  26761. } = readTrueTypeCollectionHeader(ttc);
  26762. const fontNameParts = fontName.split("+");
  26763. let fallbackData;
  26764. for (let i = 0; i < numFonts; i++) {
  26765. ttc.pos = (ttc.start || 0) + offsetTable[i];
  26766. const potentialHeader = readOpenTypeHeader(ttc);
  26767. const potentialTables = readTables(ttc, potentialHeader.numTables);
  26768. if (!potentialTables.name) {
  26769. throw new FormatError('TrueType Collection font must contain a "name" table.');
  26770. }
  26771. const [nameTable] = readNameTable(potentialTables.name);
  26772. for (let j = 0, jj = nameTable.length; j < jj; j++) {
  26773. for (let k = 0, kk = nameTable[j].length; k < kk; k++) {
  26774. const nameEntry = nameTable[j][k]?.replaceAll(/\s/g, "");
  26775. if (!nameEntry) {
  26776. continue;
  26777. }
  26778. if (nameEntry === fontName) {
  26779. return {
  26780. header: potentialHeader,
  26781. tables: potentialTables
  26782. };
  26783. }
  26784. if (fontNameParts.length < 2) {
  26785. continue;
  26786. }
  26787. for (const part of fontNameParts) {
  26788. if (nameEntry === part) {
  26789. fallbackData = {
  26790. name: part,
  26791. header: potentialHeader,
  26792. tables: potentialTables
  26793. };
  26794. }
  26795. }
  26796. }
  26797. }
  26798. }
  26799. if (fallbackData) {
  26800. warn(`TrueType Collection does not contain "${fontName}" font, ` + `falling back to "${fallbackData.name}" font instead.`);
  26801. return {
  26802. header: fallbackData.header,
  26803. tables: fallbackData.tables
  26804. };
  26805. }
  26806. throw new FormatError(`TrueType Collection does not contain "${fontName}" font.`);
  26807. }
  26808. function readCmapTable(cmap, file, isSymbolicFont, hasEncoding) {
  26809. if (!cmap) {
  26810. warn("No cmap table available.");
  26811. return {
  26812. platformId: -1,
  26813. encodingId: -1,
  26814. mappings: [],
  26815. hasShortCmap: false
  26816. };
  26817. }
  26818. let segment;
  26819. let start = (file.start || 0) + cmap.offset;
  26820. file.pos = start;
  26821. file.skip(2);
  26822. const numTables = file.getUint16();
  26823. let potentialTable;
  26824. let canBreak = false;
  26825. for (let i = 0; i < numTables; i++) {
  26826. const platformId = file.getUint16();
  26827. const encodingId = file.getUint16();
  26828. const offset = file.getInt32() >>> 0;
  26829. let useTable = false;
  26830. if (potentialTable?.platformId === platformId && potentialTable?.encodingId === encodingId) {
  26831. continue;
  26832. }
  26833. if (platformId === 0 && (encodingId === 0 || encodingId === 1 || encodingId === 3)) {
  26834. useTable = true;
  26835. } else if (platformId === 1 && encodingId === 0) {
  26836. useTable = true;
  26837. } else if (platformId === 3 && encodingId === 1 && (hasEncoding || !potentialTable)) {
  26838. useTable = true;
  26839. if (!isSymbolicFont) {
  26840. canBreak = true;
  26841. }
  26842. } else if (isSymbolicFont && platformId === 3 && encodingId === 0) {
  26843. useTable = true;
  26844. let correctlySorted = true;
  26845. if (i < numTables - 1) {
  26846. const nextBytes = file.peekBytes(2),
  26847. nextPlatformId = int16(nextBytes[0], nextBytes[1]);
  26848. if (nextPlatformId < platformId) {
  26849. correctlySorted = false;
  26850. }
  26851. }
  26852. if (correctlySorted) {
  26853. canBreak = true;
  26854. }
  26855. }
  26856. if (useTable) {
  26857. potentialTable = {
  26858. platformId,
  26859. encodingId,
  26860. offset
  26861. };
  26862. }
  26863. if (canBreak) {
  26864. break;
  26865. }
  26866. }
  26867. if (potentialTable) {
  26868. file.pos = start + potentialTable.offset;
  26869. }
  26870. if (!potentialTable || file.peekByte() === -1) {
  26871. warn("Could not find a preferred cmap table.");
  26872. return {
  26873. platformId: -1,
  26874. encodingId: -1,
  26875. mappings: [],
  26876. hasShortCmap: false
  26877. };
  26878. }
  26879. const format = file.getUint16();
  26880. let hasShortCmap = false;
  26881. const mappings = [];
  26882. let j, glyphId;
  26883. if (format === 0) {
  26884. file.skip(2 + 2);
  26885. for (j = 0; j < 256; j++) {
  26886. const index = file.getByte();
  26887. if (!index) {
  26888. continue;
  26889. }
  26890. mappings.push({
  26891. charCode: j,
  26892. glyphId: index
  26893. });
  26894. }
  26895. hasShortCmap = true;
  26896. } else if (format === 2) {
  26897. file.skip(2 + 2);
  26898. const subHeaderKeys = [];
  26899. let maxSubHeaderKey = 0;
  26900. for (let i = 0; i < 256; i++) {
  26901. const subHeaderKey = file.getUint16() >> 3;
  26902. subHeaderKeys.push(subHeaderKey);
  26903. maxSubHeaderKey = Math.max(subHeaderKey, maxSubHeaderKey);
  26904. }
  26905. const subHeaders = [];
  26906. for (let i = 0; i <= maxSubHeaderKey; i++) {
  26907. subHeaders.push({
  26908. firstCode: file.getUint16(),
  26909. entryCount: file.getUint16(),
  26910. idDelta: signedInt16(file.getByte(), file.getByte()),
  26911. idRangePos: file.pos + file.getUint16()
  26912. });
  26913. }
  26914. for (let i = 0; i < 256; i++) {
  26915. if (subHeaderKeys[i] === 0) {
  26916. file.pos = subHeaders[0].idRangePos + 2 * i;
  26917. glyphId = file.getUint16();
  26918. mappings.push({
  26919. charCode: i,
  26920. glyphId
  26921. });
  26922. } else {
  26923. const s = subHeaders[subHeaderKeys[i]];
  26924. for (j = 0; j < s.entryCount; j++) {
  26925. const charCode = (i << 8) + j + s.firstCode;
  26926. file.pos = s.idRangePos + 2 * j;
  26927. glyphId = file.getUint16();
  26928. if (glyphId !== 0) {
  26929. glyphId = (glyphId + s.idDelta) % 65536;
  26930. }
  26931. mappings.push({
  26932. charCode,
  26933. glyphId
  26934. });
  26935. }
  26936. }
  26937. }
  26938. } else if (format === 4) {
  26939. file.skip(2 + 2);
  26940. const segCount = file.getUint16() >> 1;
  26941. file.skip(6);
  26942. const segments = [];
  26943. let segIndex;
  26944. for (segIndex = 0; segIndex < segCount; segIndex++) {
  26945. segments.push({
  26946. end: file.getUint16()
  26947. });
  26948. }
  26949. file.skip(2);
  26950. for (segIndex = 0; segIndex < segCount; segIndex++) {
  26951. segments[segIndex].start = file.getUint16();
  26952. }
  26953. for (segIndex = 0; segIndex < segCount; segIndex++) {
  26954. segments[segIndex].delta = file.getUint16();
  26955. }
  26956. let offsetsCount = 0,
  26957. offsetIndex;
  26958. for (segIndex = 0; segIndex < segCount; segIndex++) {
  26959. segment = segments[segIndex];
  26960. const rangeOffset = file.getUint16();
  26961. if (!rangeOffset) {
  26962. segment.offsetIndex = -1;
  26963. continue;
  26964. }
  26965. offsetIndex = (rangeOffset >> 1) - (segCount - segIndex);
  26966. segment.offsetIndex = offsetIndex;
  26967. offsetsCount = Math.max(offsetsCount, offsetIndex + segment.end - segment.start + 1);
  26968. }
  26969. const offsets = [];
  26970. for (j = 0; j < offsetsCount; j++) {
  26971. offsets.push(file.getUint16());
  26972. }
  26973. for (segIndex = 0; segIndex < segCount; segIndex++) {
  26974. segment = segments[segIndex];
  26975. start = segment.start;
  26976. const end = segment.end;
  26977. const delta = segment.delta;
  26978. offsetIndex = segment.offsetIndex;
  26979. for (j = start; j <= end; j++) {
  26980. if (j === 0xffff) {
  26981. continue;
  26982. }
  26983. glyphId = offsetIndex < 0 ? j : offsets[offsetIndex + j - start];
  26984. glyphId = glyphId + delta & 0xffff;
  26985. mappings.push({
  26986. charCode: j,
  26987. glyphId
  26988. });
  26989. }
  26990. }
  26991. } else if (format === 6) {
  26992. file.skip(2 + 2);
  26993. const firstCode = file.getUint16();
  26994. const entryCount = file.getUint16();
  26995. for (j = 0; j < entryCount; j++) {
  26996. glyphId = file.getUint16();
  26997. const charCode = firstCode + j;
  26998. mappings.push({
  26999. charCode,
  27000. glyphId
  27001. });
  27002. }
  27003. } else if (format === 12) {
  27004. file.skip(2 + 4 + 4);
  27005. const nGroups = file.getInt32() >>> 0;
  27006. for (j = 0; j < nGroups; j++) {
  27007. const startCharCode = file.getInt32() >>> 0;
  27008. const endCharCode = file.getInt32() >>> 0;
  27009. let glyphCode = file.getInt32() >>> 0;
  27010. for (let charCode = startCharCode; charCode <= endCharCode; charCode++) {
  27011. mappings.push({
  27012. charCode,
  27013. glyphId: glyphCode++
  27014. });
  27015. }
  27016. }
  27017. } else {
  27018. warn("cmap table has unsupported format: " + format);
  27019. return {
  27020. platformId: -1,
  27021. encodingId: -1,
  27022. mappings: [],
  27023. hasShortCmap: false
  27024. };
  27025. }
  27026. mappings.sort(function (a, b) {
  27027. return a.charCode - b.charCode;
  27028. });
  27029. for (let i = 1; i < mappings.length; i++) {
  27030. if (mappings[i - 1].charCode === mappings[i].charCode) {
  27031. mappings.splice(i, 1);
  27032. i--;
  27033. }
  27034. }
  27035. return {
  27036. platformId: potentialTable.platformId,
  27037. encodingId: potentialTable.encodingId,
  27038. mappings,
  27039. hasShortCmap
  27040. };
  27041. }
  27042. function sanitizeMetrics(file, header, metrics, headTable, numGlyphs, dupFirstEntry) {
  27043. if (!header) {
  27044. if (metrics) {
  27045. metrics.data = null;
  27046. }
  27047. return;
  27048. }
  27049. file.pos = (file.start || 0) + header.offset;
  27050. file.pos += 4;
  27051. file.pos += 2;
  27052. file.pos += 2;
  27053. file.pos += 2;
  27054. file.pos += 2;
  27055. file.pos += 2;
  27056. file.pos += 2;
  27057. file.pos += 2;
  27058. file.pos += 2;
  27059. file.pos += 2;
  27060. const caretOffset = file.getUint16();
  27061. file.pos += 8;
  27062. file.pos += 2;
  27063. let numOfMetrics = file.getUint16();
  27064. if (caretOffset !== 0) {
  27065. const macStyle = int16(headTable.data[44], headTable.data[45]);
  27066. if (!(macStyle & 2)) {
  27067. header.data[22] = 0;
  27068. header.data[23] = 0;
  27069. }
  27070. }
  27071. if (numOfMetrics > numGlyphs) {
  27072. info(`The numOfMetrics (${numOfMetrics}) should not be ` + `greater than the numGlyphs (${numGlyphs}).`);
  27073. numOfMetrics = numGlyphs;
  27074. header.data[34] = (numOfMetrics & 0xff00) >> 8;
  27075. header.data[35] = numOfMetrics & 0x00ff;
  27076. }
  27077. const numOfSidebearings = numGlyphs - numOfMetrics;
  27078. const numMissing = numOfSidebearings - (metrics.length - numOfMetrics * 4 >> 1);
  27079. if (numMissing > 0) {
  27080. const entries = new Uint8Array(metrics.length + numMissing * 2);
  27081. entries.set(metrics.data);
  27082. if (dupFirstEntry) {
  27083. entries[metrics.length] = metrics.data[2];
  27084. entries[metrics.length + 1] = metrics.data[3];
  27085. }
  27086. metrics.data = entries;
  27087. }
  27088. }
  27089. function sanitizeGlyph(source, sourceStart, sourceEnd, dest, destStart, hintsValid) {
  27090. const glyphProfile = {
  27091. length: 0,
  27092. sizeOfInstructions: 0
  27093. };
  27094. if (sourceStart < 0 || sourceStart >= source.length || sourceEnd > source.length || sourceEnd - sourceStart <= 12) {
  27095. return glyphProfile;
  27096. }
  27097. const glyf = source.subarray(sourceStart, sourceEnd);
  27098. const xMin = signedInt16(glyf[2], glyf[3]);
  27099. const yMin = signedInt16(glyf[4], glyf[5]);
  27100. const xMax = signedInt16(glyf[6], glyf[7]);
  27101. const yMax = signedInt16(glyf[8], glyf[9]);
  27102. if (xMin > xMax) {
  27103. writeSignedInt16(glyf, 2, xMax);
  27104. writeSignedInt16(glyf, 6, xMin);
  27105. }
  27106. if (yMin > yMax) {
  27107. writeSignedInt16(glyf, 4, yMax);
  27108. writeSignedInt16(glyf, 8, yMin);
  27109. }
  27110. const contoursCount = signedInt16(glyf[0], glyf[1]);
  27111. if (contoursCount < 0) {
  27112. if (contoursCount < -1) {
  27113. return glyphProfile;
  27114. }
  27115. dest.set(glyf, destStart);
  27116. glyphProfile.length = glyf.length;
  27117. return glyphProfile;
  27118. }
  27119. let i,
  27120. j = 10,
  27121. flagsCount = 0;
  27122. for (i = 0; i < contoursCount; i++) {
  27123. const endPoint = glyf[j] << 8 | glyf[j + 1];
  27124. flagsCount = endPoint + 1;
  27125. j += 2;
  27126. }
  27127. const instructionsStart = j;
  27128. const instructionsLength = glyf[j] << 8 | glyf[j + 1];
  27129. glyphProfile.sizeOfInstructions = instructionsLength;
  27130. j += 2 + instructionsLength;
  27131. const instructionsEnd = j;
  27132. let coordinatesLength = 0;
  27133. for (i = 0; i < flagsCount; i++) {
  27134. const flag = glyf[j++];
  27135. if (flag & 0xc0) {
  27136. glyf[j - 1] = flag & 0x3f;
  27137. }
  27138. let xLength = 2;
  27139. if (flag & 2) {
  27140. xLength = 1;
  27141. } else if (flag & 16) {
  27142. xLength = 0;
  27143. }
  27144. let yLength = 2;
  27145. if (flag & 4) {
  27146. yLength = 1;
  27147. } else if (flag & 32) {
  27148. yLength = 0;
  27149. }
  27150. const xyLength = xLength + yLength;
  27151. coordinatesLength += xyLength;
  27152. if (flag & 8) {
  27153. const repeat = glyf[j++];
  27154. if (repeat === 0) {
  27155. glyf[j - 1] ^= 8;
  27156. }
  27157. i += repeat;
  27158. coordinatesLength += repeat * xyLength;
  27159. }
  27160. }
  27161. if (coordinatesLength === 0) {
  27162. return glyphProfile;
  27163. }
  27164. let glyphDataLength = j + coordinatesLength;
  27165. if (glyphDataLength > glyf.length) {
  27166. return glyphProfile;
  27167. }
  27168. if (!hintsValid && instructionsLength > 0) {
  27169. dest.set(glyf.subarray(0, instructionsStart), destStart);
  27170. dest.set([0, 0], destStart + instructionsStart);
  27171. dest.set(glyf.subarray(instructionsEnd, glyphDataLength), destStart + instructionsStart + 2);
  27172. glyphDataLength -= instructionsLength;
  27173. if (glyf.length - glyphDataLength > 3) {
  27174. glyphDataLength = glyphDataLength + 3 & ~3;
  27175. }
  27176. glyphProfile.length = glyphDataLength;
  27177. return glyphProfile;
  27178. }
  27179. if (glyf.length - glyphDataLength > 3) {
  27180. glyphDataLength = glyphDataLength + 3 & ~3;
  27181. dest.set(glyf.subarray(0, glyphDataLength), destStart);
  27182. glyphProfile.length = glyphDataLength;
  27183. return glyphProfile;
  27184. }
  27185. dest.set(glyf, destStart);
  27186. glyphProfile.length = glyf.length;
  27187. return glyphProfile;
  27188. }
  27189. function sanitizeHead(head, numGlyphs, locaLength) {
  27190. const data = head.data;
  27191. const version = int32(data[0], data[1], data[2], data[3]);
  27192. if (version >> 16 !== 1) {
  27193. info("Attempting to fix invalid version in head table: " + version);
  27194. data[0] = 0;
  27195. data[1] = 1;
  27196. data[2] = 0;
  27197. data[3] = 0;
  27198. }
  27199. const indexToLocFormat = int16(data[50], data[51]);
  27200. if (indexToLocFormat < 0 || indexToLocFormat > 1) {
  27201. info("Attempting to fix invalid indexToLocFormat in head table: " + indexToLocFormat);
  27202. const numGlyphsPlusOne = numGlyphs + 1;
  27203. if (locaLength === numGlyphsPlusOne << 1) {
  27204. data[50] = 0;
  27205. data[51] = 0;
  27206. } else if (locaLength === numGlyphsPlusOne << 2) {
  27207. data[50] = 0;
  27208. data[51] = 1;
  27209. } else {
  27210. throw new FormatError("Could not fix indexToLocFormat: " + indexToLocFormat);
  27211. }
  27212. }
  27213. }
  27214. function sanitizeGlyphLocations(loca, glyf, numGlyphs, isGlyphLocationsLong, hintsValid, dupFirstEntry, maxSizeOfInstructions) {
  27215. let itemSize, itemDecode, itemEncode;
  27216. if (isGlyphLocationsLong) {
  27217. itemSize = 4;
  27218. itemDecode = function fontItemDecodeLong(data, offset) {
  27219. return data[offset] << 24 | data[offset + 1] << 16 | data[offset + 2] << 8 | data[offset + 3];
  27220. };
  27221. itemEncode = function fontItemEncodeLong(data, offset, value) {
  27222. data[offset] = value >>> 24 & 0xff;
  27223. data[offset + 1] = value >> 16 & 0xff;
  27224. data[offset + 2] = value >> 8 & 0xff;
  27225. data[offset + 3] = value & 0xff;
  27226. };
  27227. } else {
  27228. itemSize = 2;
  27229. itemDecode = function fontItemDecode(data, offset) {
  27230. return data[offset] << 9 | data[offset + 1] << 1;
  27231. };
  27232. itemEncode = function fontItemEncode(data, offset, value) {
  27233. data[offset] = value >> 9 & 0xff;
  27234. data[offset + 1] = value >> 1 & 0xff;
  27235. };
  27236. }
  27237. const numGlyphsOut = dupFirstEntry ? numGlyphs + 1 : numGlyphs;
  27238. const locaDataSize = itemSize * (1 + numGlyphsOut);
  27239. const locaData = new Uint8Array(locaDataSize);
  27240. locaData.set(loca.data.subarray(0, locaDataSize));
  27241. loca.data = locaData;
  27242. const oldGlyfData = glyf.data;
  27243. const oldGlyfDataLength = oldGlyfData.length;
  27244. const newGlyfData = new Uint8Array(oldGlyfDataLength);
  27245. let i, j;
  27246. const locaEntries = [];
  27247. for (i = 0, j = 0; i < numGlyphs + 1; i++, j += itemSize) {
  27248. let offset = itemDecode(locaData, j);
  27249. if (offset > oldGlyfDataLength) {
  27250. offset = oldGlyfDataLength;
  27251. }
  27252. locaEntries.push({
  27253. index: i,
  27254. offset,
  27255. endOffset: 0
  27256. });
  27257. }
  27258. locaEntries.sort((a, b) => a.offset - b.offset);
  27259. for (i = 0; i < numGlyphs; i++) {
  27260. locaEntries[i].endOffset = locaEntries[i + 1].offset;
  27261. }
  27262. locaEntries.sort((a, b) => a.index - b.index);
  27263. for (i = 0; i < numGlyphs; i++) {
  27264. const {
  27265. offset,
  27266. endOffset
  27267. } = locaEntries[i];
  27268. if (offset !== 0 || endOffset !== 0) {
  27269. break;
  27270. }
  27271. const nextOffset = locaEntries[i + 1].offset;
  27272. if (nextOffset === 0) {
  27273. continue;
  27274. }
  27275. locaEntries[i].endOffset = nextOffset;
  27276. break;
  27277. }
  27278. const last = locaEntries.at(-2);
  27279. if (last.offset !== 0 && last.endOffset === 0) {
  27280. last.endOffset = oldGlyfDataLength;
  27281. }
  27282. const missingGlyphs = Object.create(null);
  27283. let writeOffset = 0;
  27284. itemEncode(locaData, 0, writeOffset);
  27285. for (i = 0, j = itemSize; i < numGlyphs; i++, j += itemSize) {
  27286. const glyphProfile = sanitizeGlyph(oldGlyfData, locaEntries[i].offset, locaEntries[i].endOffset, newGlyfData, writeOffset, hintsValid);
  27287. const newLength = glyphProfile.length;
  27288. if (newLength === 0) {
  27289. missingGlyphs[i] = true;
  27290. }
  27291. if (glyphProfile.sizeOfInstructions > maxSizeOfInstructions) {
  27292. maxSizeOfInstructions = glyphProfile.sizeOfInstructions;
  27293. }
  27294. writeOffset += newLength;
  27295. itemEncode(locaData, j, writeOffset);
  27296. }
  27297. if (writeOffset === 0) {
  27298. const simpleGlyph = new Uint8Array([0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 0]);
  27299. for (i = 0, j = itemSize; i < numGlyphsOut; i++, j += itemSize) {
  27300. itemEncode(locaData, j, simpleGlyph.length);
  27301. }
  27302. glyf.data = simpleGlyph;
  27303. } else if (dupFirstEntry) {
  27304. const firstEntryLength = itemDecode(locaData, itemSize);
  27305. if (newGlyfData.length > firstEntryLength + writeOffset) {
  27306. glyf.data = newGlyfData.subarray(0, firstEntryLength + writeOffset);
  27307. } else {
  27308. glyf.data = new Uint8Array(firstEntryLength + writeOffset);
  27309. glyf.data.set(newGlyfData.subarray(0, writeOffset));
  27310. }
  27311. glyf.data.set(newGlyfData.subarray(0, firstEntryLength), writeOffset);
  27312. itemEncode(loca.data, locaData.length - itemSize, writeOffset + firstEntryLength);
  27313. } else {
  27314. glyf.data = newGlyfData.subarray(0, writeOffset);
  27315. }
  27316. return {
  27317. missingGlyphs,
  27318. maxSizeOfInstructions
  27319. };
  27320. }
  27321. function readPostScriptTable(post, propertiesObj, maxpNumGlyphs) {
  27322. const start = (font.start || 0) + post.offset;
  27323. font.pos = start;
  27324. const length = post.length,
  27325. end = start + length;
  27326. const version = font.getInt32();
  27327. font.skip(28);
  27328. let glyphNames;
  27329. let valid = true;
  27330. let i;
  27331. switch (version) {
  27332. case 0x00010000:
  27333. glyphNames = MacStandardGlyphOrdering;
  27334. break;
  27335. case 0x00020000:
  27336. const numGlyphs = font.getUint16();
  27337. if (numGlyphs !== maxpNumGlyphs) {
  27338. valid = false;
  27339. break;
  27340. }
  27341. const glyphNameIndexes = [];
  27342. for (i = 0; i < numGlyphs; ++i) {
  27343. const index = font.getUint16();
  27344. if (index >= 32768) {
  27345. valid = false;
  27346. break;
  27347. }
  27348. glyphNameIndexes.push(index);
  27349. }
  27350. if (!valid) {
  27351. break;
  27352. }
  27353. const customNames = [],
  27354. strBuf = [];
  27355. while (font.pos < end) {
  27356. const stringLength = font.getByte();
  27357. strBuf.length = stringLength;
  27358. for (i = 0; i < stringLength; ++i) {
  27359. strBuf[i] = String.fromCharCode(font.getByte());
  27360. }
  27361. customNames.push(strBuf.join(""));
  27362. }
  27363. glyphNames = [];
  27364. for (i = 0; i < numGlyphs; ++i) {
  27365. const j = glyphNameIndexes[i];
  27366. if (j < 258) {
  27367. glyphNames.push(MacStandardGlyphOrdering[j]);
  27368. continue;
  27369. }
  27370. glyphNames.push(customNames[j - 258]);
  27371. }
  27372. break;
  27373. case 0x00030000:
  27374. break;
  27375. default:
  27376. warn("Unknown/unsupported post table version " + version);
  27377. valid = false;
  27378. if (propertiesObj.defaultEncoding) {
  27379. glyphNames = propertiesObj.defaultEncoding;
  27380. }
  27381. break;
  27382. }
  27383. propertiesObj.glyphNames = glyphNames;
  27384. return valid;
  27385. }
  27386. function readNameTable(nameTable) {
  27387. const start = (font.start || 0) + nameTable.offset;
  27388. font.pos = start;
  27389. const names = [[], []],
  27390. records = [];
  27391. const length = nameTable.length,
  27392. end = start + length;
  27393. const format = font.getUint16();
  27394. const FORMAT_0_HEADER_LENGTH = 6;
  27395. if (format !== 0 || length < FORMAT_0_HEADER_LENGTH) {
  27396. return [names, records];
  27397. }
  27398. const numRecords = font.getUint16();
  27399. const stringsStart = font.getUint16();
  27400. const NAME_RECORD_LENGTH = 12;
  27401. let i, ii;
  27402. for (i = 0; i < numRecords && font.pos + NAME_RECORD_LENGTH <= end; i++) {
  27403. const r = {
  27404. platform: font.getUint16(),
  27405. encoding: font.getUint16(),
  27406. language: font.getUint16(),
  27407. name: font.getUint16(),
  27408. length: font.getUint16(),
  27409. offset: font.getUint16()
  27410. };
  27411. if (isMacNameRecord(r) || isWinNameRecord(r)) {
  27412. records.push(r);
  27413. }
  27414. }
  27415. for (i = 0, ii = records.length; i < ii; i++) {
  27416. const record = records[i];
  27417. if (record.length <= 0) {
  27418. continue;
  27419. }
  27420. const pos = start + stringsStart + record.offset;
  27421. if (pos + record.length > end) {
  27422. continue;
  27423. }
  27424. font.pos = pos;
  27425. const nameIndex = record.name;
  27426. if (record.encoding) {
  27427. let str = "";
  27428. for (let j = 0, jj = record.length; j < jj; j += 2) {
  27429. str += String.fromCharCode(font.getUint16());
  27430. }
  27431. names[1][nameIndex] = str;
  27432. } else {
  27433. names[0][nameIndex] = font.getString(record.length);
  27434. }
  27435. }
  27436. return [names, records];
  27437. }
  27438. const TTOpsStackDeltas = [0, 0, 0, 0, 0, 0, 0, 0, -2, -2, -2, -2, 0, 0, -2, -5, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, -1, -1, 1, -1, -999, 0, 1, 0, -1, -2, 0, -1, -2, -1, -1, 0, -1, -1, 0, 0, -999, -999, -1, -1, -1, -1, -2, -999, -2, -2, -999, 0, -2, -2, 0, 0, -2, 0, -2, 0, 0, 0, -2, -1, -1, 1, 1, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, 0, -999, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, -999, -999, -999, -999, -999, -1, -1, -2, -2, 0, 0, 0, 0, -1, -1, -999, -2, -2, 0, 0, -1, -2, -2, 0, 0, 0, -1, -1, -1, -2];
  27439. function sanitizeTTProgram(table, ttContext) {
  27440. let data = table.data;
  27441. let i = 0,
  27442. j,
  27443. n,
  27444. b,
  27445. funcId,
  27446. pc,
  27447. lastEndf = 0,
  27448. lastDeff = 0;
  27449. const stack = [];
  27450. const callstack = [];
  27451. const functionsCalled = [];
  27452. let tooComplexToFollowFunctions = ttContext.tooComplexToFollowFunctions;
  27453. let inFDEF = false,
  27454. ifLevel = 0,
  27455. inELSE = 0;
  27456. for (let ii = data.length; i < ii;) {
  27457. const op = data[i++];
  27458. if (op === 0x40) {
  27459. n = data[i++];
  27460. if (inFDEF || inELSE) {
  27461. i += n;
  27462. } else {
  27463. for (j = 0; j < n; j++) {
  27464. stack.push(data[i++]);
  27465. }
  27466. }
  27467. } else if (op === 0x41) {
  27468. n = data[i++];
  27469. if (inFDEF || inELSE) {
  27470. i += n * 2;
  27471. } else {
  27472. for (j = 0; j < n; j++) {
  27473. b = data[i++];
  27474. stack.push(b << 8 | data[i++]);
  27475. }
  27476. }
  27477. } else if ((op & 0xf8) === 0xb0) {
  27478. n = op - 0xb0 + 1;
  27479. if (inFDEF || inELSE) {
  27480. i += n;
  27481. } else {
  27482. for (j = 0; j < n; j++) {
  27483. stack.push(data[i++]);
  27484. }
  27485. }
  27486. } else if ((op & 0xf8) === 0xb8) {
  27487. n = op - 0xb8 + 1;
  27488. if (inFDEF || inELSE) {
  27489. i += n * 2;
  27490. } else {
  27491. for (j = 0; j < n; j++) {
  27492. b = data[i++];
  27493. stack.push(signedInt16(b, data[i++]));
  27494. }
  27495. }
  27496. } else if (op === 0x2b && !tooComplexToFollowFunctions) {
  27497. if (!inFDEF && !inELSE) {
  27498. funcId = stack.at(-1);
  27499. if (isNaN(funcId)) {
  27500. info("TT: CALL empty stack (or invalid entry).");
  27501. } else {
  27502. ttContext.functionsUsed[funcId] = true;
  27503. if (funcId in ttContext.functionsStackDeltas) {
  27504. const newStackLength = stack.length + ttContext.functionsStackDeltas[funcId];
  27505. if (newStackLength < 0) {
  27506. warn("TT: CALL invalid functions stack delta.");
  27507. ttContext.hintsValid = false;
  27508. return;
  27509. }
  27510. stack.length = newStackLength;
  27511. } else if (funcId in ttContext.functionsDefined && !functionsCalled.includes(funcId)) {
  27512. callstack.push({
  27513. data,
  27514. i,
  27515. stackTop: stack.length - 1
  27516. });
  27517. functionsCalled.push(funcId);
  27518. pc = ttContext.functionsDefined[funcId];
  27519. if (!pc) {
  27520. warn("TT: CALL non-existent function");
  27521. ttContext.hintsValid = false;
  27522. return;
  27523. }
  27524. data = pc.data;
  27525. i = pc.i;
  27526. }
  27527. }
  27528. }
  27529. } else if (op === 0x2c && !tooComplexToFollowFunctions) {
  27530. if (inFDEF || inELSE) {
  27531. warn("TT: nested FDEFs not allowed");
  27532. tooComplexToFollowFunctions = true;
  27533. }
  27534. inFDEF = true;
  27535. lastDeff = i;
  27536. funcId = stack.pop();
  27537. ttContext.functionsDefined[funcId] = {
  27538. data,
  27539. i
  27540. };
  27541. } else if (op === 0x2d) {
  27542. if (inFDEF) {
  27543. inFDEF = false;
  27544. lastEndf = i;
  27545. } else {
  27546. pc = callstack.pop();
  27547. if (!pc) {
  27548. warn("TT: ENDF bad stack");
  27549. ttContext.hintsValid = false;
  27550. return;
  27551. }
  27552. funcId = functionsCalled.pop();
  27553. data = pc.data;
  27554. i = pc.i;
  27555. ttContext.functionsStackDeltas[funcId] = stack.length - pc.stackTop;
  27556. }
  27557. } else if (op === 0x89) {
  27558. if (inFDEF || inELSE) {
  27559. warn("TT: nested IDEFs not allowed");
  27560. tooComplexToFollowFunctions = true;
  27561. }
  27562. inFDEF = true;
  27563. lastDeff = i;
  27564. } else if (op === 0x58) {
  27565. ++ifLevel;
  27566. } else if (op === 0x1b) {
  27567. inELSE = ifLevel;
  27568. } else if (op === 0x59) {
  27569. if (inELSE === ifLevel) {
  27570. inELSE = 0;
  27571. }
  27572. --ifLevel;
  27573. } else if (op === 0x1c) {
  27574. if (!inFDEF && !inELSE) {
  27575. const offset = stack.at(-1);
  27576. if (offset > 0) {
  27577. i += offset - 1;
  27578. }
  27579. }
  27580. }
  27581. if (!inFDEF && !inELSE) {
  27582. let stackDelta = 0;
  27583. if (op <= 0x8e) {
  27584. stackDelta = TTOpsStackDeltas[op];
  27585. } else if (op >= 0xc0 && op <= 0xdf) {
  27586. stackDelta = -1;
  27587. } else if (op >= 0xe0) {
  27588. stackDelta = -2;
  27589. }
  27590. if (op >= 0x71 && op <= 0x75) {
  27591. n = stack.pop();
  27592. if (!isNaN(n)) {
  27593. stackDelta = -n * 2;
  27594. }
  27595. }
  27596. while (stackDelta < 0 && stack.length > 0) {
  27597. stack.pop();
  27598. stackDelta++;
  27599. }
  27600. while (stackDelta > 0) {
  27601. stack.push(NaN);
  27602. stackDelta--;
  27603. }
  27604. }
  27605. }
  27606. ttContext.tooComplexToFollowFunctions = tooComplexToFollowFunctions;
  27607. const content = [data];
  27608. if (i > data.length) {
  27609. content.push(new Uint8Array(i - data.length));
  27610. }
  27611. if (lastDeff > lastEndf) {
  27612. warn("TT: complementing a missing function tail");
  27613. content.push(new Uint8Array([0x22, 0x2d]));
  27614. }
  27615. foldTTTable(table, content);
  27616. }
  27617. function checkInvalidFunctions(ttContext, maxFunctionDefs) {
  27618. if (ttContext.tooComplexToFollowFunctions) {
  27619. return;
  27620. }
  27621. if (ttContext.functionsDefined.length > maxFunctionDefs) {
  27622. warn("TT: more functions defined than expected");
  27623. ttContext.hintsValid = false;
  27624. return;
  27625. }
  27626. for (let j = 0, jj = ttContext.functionsUsed.length; j < jj; j++) {
  27627. if (j > maxFunctionDefs) {
  27628. warn("TT: invalid function id: " + j);
  27629. ttContext.hintsValid = false;
  27630. return;
  27631. }
  27632. if (ttContext.functionsUsed[j] && !ttContext.functionsDefined[j]) {
  27633. warn("TT: undefined function: " + j);
  27634. ttContext.hintsValid = false;
  27635. return;
  27636. }
  27637. }
  27638. }
  27639. function foldTTTable(table, content) {
  27640. if (content.length > 1) {
  27641. let newLength = 0;
  27642. let j, jj;
  27643. for (j = 0, jj = content.length; j < jj; j++) {
  27644. newLength += content[j].length;
  27645. }
  27646. newLength = newLength + 3 & ~3;
  27647. const result = new Uint8Array(newLength);
  27648. let pos = 0;
  27649. for (j = 0, jj = content.length; j < jj; j++) {
  27650. result.set(content[j], pos);
  27651. pos += content[j].length;
  27652. }
  27653. table.data = result;
  27654. table.length = newLength;
  27655. }
  27656. }
  27657. function sanitizeTTPrograms(fpgm, prep, cvt, maxFunctionDefs) {
  27658. const ttContext = {
  27659. functionsDefined: [],
  27660. functionsUsed: [],
  27661. functionsStackDeltas: [],
  27662. tooComplexToFollowFunctions: false,
  27663. hintsValid: true
  27664. };
  27665. if (fpgm) {
  27666. sanitizeTTProgram(fpgm, ttContext);
  27667. }
  27668. if (prep) {
  27669. sanitizeTTProgram(prep, ttContext);
  27670. }
  27671. if (fpgm) {
  27672. checkInvalidFunctions(ttContext, maxFunctionDefs);
  27673. }
  27674. if (cvt && cvt.length & 1) {
  27675. const cvtData = new Uint8Array(cvt.length + 1);
  27676. cvtData.set(cvt.data);
  27677. cvt.data = cvtData;
  27678. }
  27679. return ttContext.hintsValid;
  27680. }
  27681. font = new Stream(new Uint8Array(font.getBytes()));
  27682. let header, tables;
  27683. if (isTrueTypeCollectionFile(font)) {
  27684. const ttcData = readTrueTypeCollectionData(font, this.name);
  27685. header = ttcData.header;
  27686. tables = ttcData.tables;
  27687. } else {
  27688. header = readOpenTypeHeader(font);
  27689. tables = readTables(font, header.numTables);
  27690. }
  27691. let cff, cffFile;
  27692. const isTrueType = !tables["CFF "];
  27693. if (!isTrueType) {
  27694. const isComposite = properties.composite && (properties.cidToGidMap?.length > 0 || !(properties.cMap instanceof IdentityCMap));
  27695. if (header.version === "OTTO" && !isComposite || !tables.head || !tables.hhea || !tables.maxp || !tables.post) {
  27696. cffFile = new Stream(tables["CFF "].data);
  27697. cff = new CFFFont(cffFile, properties);
  27698. adjustWidths(properties);
  27699. return this.convert(name, cff, properties);
  27700. }
  27701. delete tables.glyf;
  27702. delete tables.loca;
  27703. delete tables.fpgm;
  27704. delete tables.prep;
  27705. delete tables["cvt "];
  27706. this.isOpenType = true;
  27707. } else {
  27708. if (!tables.loca) {
  27709. throw new FormatError('Required "loca" table is not found');
  27710. }
  27711. if (!tables.glyf) {
  27712. warn('Required "glyf" table is not found -- trying to recover.');
  27713. tables.glyf = {
  27714. tag: "glyf",
  27715. data: new Uint8Array(0)
  27716. };
  27717. }
  27718. this.isOpenType = false;
  27719. }
  27720. if (!tables.maxp) {
  27721. throw new FormatError('Required "maxp" table is not found');
  27722. }
  27723. font.pos = (font.start || 0) + tables.maxp.offset;
  27724. let version = font.getInt32();
  27725. const numGlyphs = font.getUint16();
  27726. if (version !== 0x00010000 && version !== 0x00005000) {
  27727. if (tables.maxp.length === 6) {
  27728. version = 0x0005000;
  27729. } else if (tables.maxp.length >= 32) {
  27730. version = 0x00010000;
  27731. } else {
  27732. throw new FormatError(`"maxp" table has a wrong version number`);
  27733. }
  27734. writeUint32(tables.maxp.data, 0, version);
  27735. }
  27736. if (properties.scaleFactors?.length === numGlyphs && isTrueType) {
  27737. const {
  27738. scaleFactors
  27739. } = properties;
  27740. const isGlyphLocationsLong = int16(tables.head.data[50], tables.head.data[51]);
  27741. const glyphs = new GlyfTable({
  27742. glyfTable: tables.glyf.data,
  27743. isGlyphLocationsLong,
  27744. locaTable: tables.loca.data,
  27745. numGlyphs
  27746. });
  27747. glyphs.scale(scaleFactors);
  27748. const {
  27749. glyf,
  27750. loca,
  27751. isLocationLong
  27752. } = glyphs.write();
  27753. tables.glyf.data = glyf;
  27754. tables.loca.data = loca;
  27755. if (isLocationLong !== !!isGlyphLocationsLong) {
  27756. tables.head.data[50] = 0;
  27757. tables.head.data[51] = isLocationLong ? 1 : 0;
  27758. }
  27759. const metrics = tables.hmtx.data;
  27760. for (let i = 0; i < numGlyphs; i++) {
  27761. const j = 4 * i;
  27762. const advanceWidth = Math.round(scaleFactors[i] * int16(metrics[j], metrics[j + 1]));
  27763. metrics[j] = advanceWidth >> 8 & 0xff;
  27764. metrics[j + 1] = advanceWidth & 0xff;
  27765. const lsb = Math.round(scaleFactors[i] * signedInt16(metrics[j + 2], metrics[j + 3]));
  27766. writeSignedInt16(metrics, j + 2, lsb);
  27767. }
  27768. }
  27769. let numGlyphsOut = numGlyphs + 1;
  27770. let dupFirstEntry = true;
  27771. if (numGlyphsOut > 0xffff) {
  27772. dupFirstEntry = false;
  27773. numGlyphsOut = numGlyphs;
  27774. warn("Not enough space in glyfs to duplicate first glyph.");
  27775. }
  27776. let maxFunctionDefs = 0;
  27777. let maxSizeOfInstructions = 0;
  27778. if (version >= 0x00010000 && tables.maxp.length >= 32) {
  27779. font.pos += 8;
  27780. const maxZones = font.getUint16();
  27781. if (maxZones > 2) {
  27782. tables.maxp.data[14] = 0;
  27783. tables.maxp.data[15] = 2;
  27784. }
  27785. font.pos += 4;
  27786. maxFunctionDefs = font.getUint16();
  27787. font.pos += 4;
  27788. maxSizeOfInstructions = font.getUint16();
  27789. }
  27790. tables.maxp.data[4] = numGlyphsOut >> 8;
  27791. tables.maxp.data[5] = numGlyphsOut & 255;
  27792. const hintsValid = sanitizeTTPrograms(tables.fpgm, tables.prep, tables["cvt "], maxFunctionDefs);
  27793. if (!hintsValid) {
  27794. delete tables.fpgm;
  27795. delete tables.prep;
  27796. delete tables["cvt "];
  27797. }
  27798. sanitizeMetrics(font, tables.hhea, tables.hmtx, tables.head, numGlyphsOut, dupFirstEntry);
  27799. if (!tables.head) {
  27800. throw new FormatError('Required "head" table is not found');
  27801. }
  27802. sanitizeHead(tables.head, numGlyphs, isTrueType ? tables.loca.length : 0);
  27803. let missingGlyphs = Object.create(null);
  27804. if (isTrueType) {
  27805. const isGlyphLocationsLong = int16(tables.head.data[50], tables.head.data[51]);
  27806. const glyphsInfo = sanitizeGlyphLocations(tables.loca, tables.glyf, numGlyphs, isGlyphLocationsLong, hintsValid, dupFirstEntry, maxSizeOfInstructions);
  27807. missingGlyphs = glyphsInfo.missingGlyphs;
  27808. if (version >= 0x00010000 && tables.maxp.length >= 32) {
  27809. tables.maxp.data[26] = glyphsInfo.maxSizeOfInstructions >> 8;
  27810. tables.maxp.data[27] = glyphsInfo.maxSizeOfInstructions & 255;
  27811. }
  27812. }
  27813. if (!tables.hhea) {
  27814. throw new FormatError('Required "hhea" table is not found');
  27815. }
  27816. if (tables.hhea.data[10] === 0 && tables.hhea.data[11] === 0) {
  27817. tables.hhea.data[10] = 0xff;
  27818. tables.hhea.data[11] = 0xff;
  27819. }
  27820. const metricsOverride = {
  27821. unitsPerEm: int16(tables.head.data[18], tables.head.data[19]),
  27822. yMax: signedInt16(tables.head.data[42], tables.head.data[43]),
  27823. yMin: signedInt16(tables.head.data[38], tables.head.data[39]),
  27824. ascent: signedInt16(tables.hhea.data[4], tables.hhea.data[5]),
  27825. descent: signedInt16(tables.hhea.data[6], tables.hhea.data[7]),
  27826. lineGap: signedInt16(tables.hhea.data[8], tables.hhea.data[9])
  27827. };
  27828. this.ascent = metricsOverride.ascent / metricsOverride.unitsPerEm;
  27829. this.descent = metricsOverride.descent / metricsOverride.unitsPerEm;
  27830. this.lineGap = metricsOverride.lineGap / metricsOverride.unitsPerEm;
  27831. if (this.cssFontInfo?.lineHeight) {
  27832. this.lineHeight = this.cssFontInfo.metrics.lineHeight;
  27833. this.lineGap = this.cssFontInfo.metrics.lineGap;
  27834. } else {
  27835. this.lineHeight = this.ascent - this.descent + this.lineGap;
  27836. }
  27837. if (tables.post) {
  27838. readPostScriptTable(tables.post, properties, numGlyphs);
  27839. }
  27840. tables.post = {
  27841. tag: "post",
  27842. data: createPostTable(properties)
  27843. };
  27844. const charCodeToGlyphId = Object.create(null);
  27845. function hasGlyph(glyphId) {
  27846. return !missingGlyphs[glyphId];
  27847. }
  27848. if (properties.composite) {
  27849. const cidToGidMap = properties.cidToGidMap || [];
  27850. const isCidToGidMapEmpty = cidToGidMap.length === 0;
  27851. properties.cMap.forEach(function (charCode, cid) {
  27852. if (typeof cid === "string") {
  27853. cid = convertCidString(charCode, cid, true);
  27854. }
  27855. if (cid > 0xffff) {
  27856. throw new FormatError("Max size of CID is 65,535");
  27857. }
  27858. let glyphId = -1;
  27859. if (isCidToGidMapEmpty) {
  27860. glyphId = cid;
  27861. } else if (cidToGidMap[cid] !== undefined) {
  27862. glyphId = cidToGidMap[cid];
  27863. }
  27864. if (glyphId >= 0 && glyphId < numGlyphs && hasGlyph(glyphId)) {
  27865. charCodeToGlyphId[charCode] = glyphId;
  27866. }
  27867. });
  27868. } else {
  27869. const cmapTable = readCmapTable(tables.cmap, font, this.isSymbolicFont, properties.hasEncoding);
  27870. const cmapPlatformId = cmapTable.platformId;
  27871. const cmapEncodingId = cmapTable.encodingId;
  27872. const cmapMappings = cmapTable.mappings;
  27873. let baseEncoding = [],
  27874. forcePostTable = false;
  27875. if (properties.hasEncoding && (properties.baseEncodingName === "MacRomanEncoding" || properties.baseEncodingName === "WinAnsiEncoding")) {
  27876. baseEncoding = getEncoding(properties.baseEncodingName);
  27877. }
  27878. if (properties.hasEncoding && !this.isSymbolicFont && (cmapPlatformId === 3 && cmapEncodingId === 1 || cmapPlatformId === 1 && cmapEncodingId === 0)) {
  27879. const glyphsUnicodeMap = getGlyphsUnicode();
  27880. for (let charCode = 0; charCode < 256; charCode++) {
  27881. let glyphName;
  27882. if (this.differences[charCode] !== undefined) {
  27883. glyphName = this.differences[charCode];
  27884. } else if (baseEncoding.length && baseEncoding[charCode] !== "") {
  27885. glyphName = baseEncoding[charCode];
  27886. } else {
  27887. glyphName = StandardEncoding[charCode];
  27888. }
  27889. if (!glyphName) {
  27890. continue;
  27891. }
  27892. const standardGlyphName = recoverGlyphName(glyphName, glyphsUnicodeMap);
  27893. let unicodeOrCharCode;
  27894. if (cmapPlatformId === 3 && cmapEncodingId === 1) {
  27895. unicodeOrCharCode = glyphsUnicodeMap[standardGlyphName];
  27896. } else if (cmapPlatformId === 1 && cmapEncodingId === 0) {
  27897. unicodeOrCharCode = MacRomanEncoding.indexOf(standardGlyphName);
  27898. }
  27899. if (unicodeOrCharCode === undefined) {
  27900. if (!properties.glyphNames && properties.hasIncludedToUnicodeMap && !(this.toUnicode instanceof IdentityToUnicodeMap)) {
  27901. const unicode = this.toUnicode.get(charCode);
  27902. if (unicode) {
  27903. unicodeOrCharCode = unicode.codePointAt(0);
  27904. }
  27905. }
  27906. if (unicodeOrCharCode === undefined) {
  27907. continue;
  27908. }
  27909. }
  27910. for (const mapping of cmapMappings) {
  27911. if (mapping.charCode !== unicodeOrCharCode) {
  27912. continue;
  27913. }
  27914. charCodeToGlyphId[charCode] = mapping.glyphId;
  27915. break;
  27916. }
  27917. }
  27918. } else if (cmapPlatformId === 0) {
  27919. for (const mapping of cmapMappings) {
  27920. charCodeToGlyphId[mapping.charCode] = mapping.glyphId;
  27921. }
  27922. forcePostTable = true;
  27923. } else if (cmapPlatformId === 3 && cmapEncodingId === 0) {
  27924. for (const mapping of cmapMappings) {
  27925. let charCode = mapping.charCode;
  27926. if (charCode >= 0xf000 && charCode <= 0xf0ff) {
  27927. charCode &= 0xff;
  27928. }
  27929. charCodeToGlyphId[charCode] = mapping.glyphId;
  27930. }
  27931. } else {
  27932. for (const mapping of cmapMappings) {
  27933. charCodeToGlyphId[mapping.charCode] = mapping.glyphId;
  27934. }
  27935. }
  27936. if (properties.glyphNames && (baseEncoding.length || this.differences.length)) {
  27937. for (let i = 0; i < 256; ++i) {
  27938. if (!forcePostTable && charCodeToGlyphId[i] !== undefined) {
  27939. continue;
  27940. }
  27941. const glyphName = this.differences[i] || baseEncoding[i];
  27942. if (!glyphName) {
  27943. continue;
  27944. }
  27945. const glyphId = properties.glyphNames.indexOf(glyphName);
  27946. if (glyphId > 0 && hasGlyph(glyphId)) {
  27947. charCodeToGlyphId[i] = glyphId;
  27948. }
  27949. }
  27950. }
  27951. }
  27952. if (charCodeToGlyphId.length === 0) {
  27953. charCodeToGlyphId[0] = 0;
  27954. }
  27955. let glyphZeroId = numGlyphsOut - 1;
  27956. if (!dupFirstEntry) {
  27957. glyphZeroId = 0;
  27958. }
  27959. if (!properties.cssFontInfo) {
  27960. const newMapping = adjustMapping(charCodeToGlyphId, hasGlyph, glyphZeroId, this.toUnicode);
  27961. this.toFontChar = newMapping.toFontChar;
  27962. tables.cmap = {
  27963. tag: "cmap",
  27964. data: createCmapTable(newMapping.charCodeToGlyphId, newMapping.toUnicodeExtraMap, numGlyphsOut)
  27965. };
  27966. if (!tables["OS/2"] || !validateOS2Table(tables["OS/2"], font)) {
  27967. tables["OS/2"] = {
  27968. tag: "OS/2",
  27969. data: createOS2Table(properties, newMapping.charCodeToGlyphId, metricsOverride)
  27970. };
  27971. }
  27972. }
  27973. if (!isTrueType) {
  27974. try {
  27975. cffFile = new Stream(tables["CFF "].data);
  27976. const parser = new CFFParser(cffFile, properties, SEAC_ANALYSIS_ENABLED);
  27977. cff = parser.parse();
  27978. cff.duplicateFirstGlyph();
  27979. const compiler = new CFFCompiler(cff);
  27980. tables["CFF "].data = compiler.compile();
  27981. } catch {
  27982. warn("Failed to compile font " + properties.loadedName);
  27983. }
  27984. }
  27985. if (!tables.name) {
  27986. tables.name = {
  27987. tag: "name",
  27988. data: createNameTable(this.name)
  27989. };
  27990. } else {
  27991. const [namePrototype, nameRecords] = readNameTable(tables.name);
  27992. tables.name.data = createNameTable(name, namePrototype);
  27993. this.psName = namePrototype[0][6] || null;
  27994. if (!properties.composite) {
  27995. adjustTrueTypeToUnicode(properties, this.isSymbolicFont, nameRecords);
  27996. }
  27997. }
  27998. const builder = new OpenTypeFileBuilder(header.version);
  27999. for (const tableTag in tables) {
  28000. builder.addTable(tableTag, tables[tableTag].data);
  28001. }
  28002. return builder.toArray();
  28003. }
  28004. convert(fontName, font, properties) {
  28005. properties.fixedPitch = false;
  28006. if (properties.builtInEncoding) {
  28007. adjustType1ToUnicode(properties, properties.builtInEncoding);
  28008. }
  28009. let glyphZeroId = 1;
  28010. if (font instanceof CFFFont) {
  28011. glyphZeroId = font.numGlyphs - 1;
  28012. }
  28013. const mapping = font.getGlyphMapping(properties);
  28014. let newMapping = null;
  28015. let newCharCodeToGlyphId = mapping;
  28016. let toUnicodeExtraMap = null;
  28017. if (!properties.cssFontInfo) {
  28018. newMapping = adjustMapping(mapping, font.hasGlyphId.bind(font), glyphZeroId, this.toUnicode);
  28019. this.toFontChar = newMapping.toFontChar;
  28020. newCharCodeToGlyphId = newMapping.charCodeToGlyphId;
  28021. toUnicodeExtraMap = newMapping.toUnicodeExtraMap;
  28022. }
  28023. const numGlyphs = font.numGlyphs;
  28024. function getCharCodes(charCodeToGlyphId, glyphId) {
  28025. let charCodes = null;
  28026. for (const charCode in charCodeToGlyphId) {
  28027. if (glyphId === charCodeToGlyphId[charCode]) {
  28028. (charCodes ||= []).push(charCode | 0);
  28029. }
  28030. }
  28031. return charCodes;
  28032. }
  28033. function createCharCode(charCodeToGlyphId, glyphId) {
  28034. for (const charCode in charCodeToGlyphId) {
  28035. if (glyphId === charCodeToGlyphId[charCode]) {
  28036. return charCode | 0;
  28037. }
  28038. }
  28039. newMapping.charCodeToGlyphId[newMapping.nextAvailableFontCharCode] = glyphId;
  28040. return newMapping.nextAvailableFontCharCode++;
  28041. }
  28042. const seacs = font.seacs;
  28043. if (newMapping && SEAC_ANALYSIS_ENABLED && seacs?.length) {
  28044. const matrix = properties.fontMatrix || FONT_IDENTITY_MATRIX;
  28045. const charset = font.getCharset();
  28046. const seacMap = Object.create(null);
  28047. for (let glyphId in seacs) {
  28048. glyphId |= 0;
  28049. const seac = seacs[glyphId];
  28050. const baseGlyphName = StandardEncoding[seac[2]];
  28051. const accentGlyphName = StandardEncoding[seac[3]];
  28052. const baseGlyphId = charset.indexOf(baseGlyphName);
  28053. const accentGlyphId = charset.indexOf(accentGlyphName);
  28054. if (baseGlyphId < 0 || accentGlyphId < 0) {
  28055. continue;
  28056. }
  28057. const accentOffset = {
  28058. x: seac[0] * matrix[0] + seac[1] * matrix[2] + matrix[4],
  28059. y: seac[0] * matrix[1] + seac[1] * matrix[3] + matrix[5]
  28060. };
  28061. const charCodes = getCharCodes(mapping, glyphId);
  28062. if (!charCodes) {
  28063. continue;
  28064. }
  28065. for (const charCode of charCodes) {
  28066. const charCodeToGlyphId = newMapping.charCodeToGlyphId;
  28067. const baseFontCharCode = createCharCode(charCodeToGlyphId, baseGlyphId);
  28068. const accentFontCharCode = createCharCode(charCodeToGlyphId, accentGlyphId);
  28069. seacMap[charCode] = {
  28070. baseFontCharCode,
  28071. accentFontCharCode,
  28072. accentOffset
  28073. };
  28074. }
  28075. }
  28076. properties.seacMap = seacMap;
  28077. }
  28078. const unitsPerEm = properties.fontMatrix ? 1 / Math.max(...properties.fontMatrix.slice(0, 4).map(Math.abs)) : 1000;
  28079. const builder = new OpenTypeFileBuilder("\x4F\x54\x54\x4F");
  28080. builder.addTable("CFF ", font.data);
  28081. builder.addTable("OS/2", createOS2Table(properties, newCharCodeToGlyphId));
  28082. builder.addTable("cmap", createCmapTable(newCharCodeToGlyphId, toUnicodeExtraMap, numGlyphs));
  28083. builder.addTable("head", "\x00\x01\x00\x00" + "\x00\x00\x10\x00" + "\x00\x00\x00\x00" + "\x5F\x0F\x3C\xF5" + "\x00\x00" + safeString16(unitsPerEm) + "\x00\x00\x00\x00\x9e\x0b\x7e\x27" + "\x00\x00\x00\x00\x9e\x0b\x7e\x27" + "\x00\x00" + safeString16(properties.descent) + "\x0F\xFF" + safeString16(properties.ascent) + string16(properties.italicAngle ? 2 : 0) + "\x00\x11" + "\x00\x00" + "\x00\x00" + "\x00\x00");
  28084. builder.addTable("hhea", "\x00\x01\x00\x00" + safeString16(properties.ascent) + safeString16(properties.descent) + "\x00\x00" + "\xFF\xFF" + "\x00\x00" + "\x00\x00" + "\x00\x00" + safeString16(properties.capHeight) + safeString16(Math.tan(properties.italicAngle) * properties.xHeight) + "\x00\x00" + "\x00\x00" + "\x00\x00" + "\x00\x00" + "\x00\x00" + "\x00\x00" + string16(numGlyphs));
  28085. builder.addTable("hmtx", function fontFieldsHmtx() {
  28086. const charstrings = font.charstrings;
  28087. const cffWidths = font.cff ? font.cff.widths : null;
  28088. let hmtx = "\x00\x00\x00\x00";
  28089. for (let i = 1, ii = numGlyphs; i < ii; i++) {
  28090. let width = 0;
  28091. if (charstrings) {
  28092. const charstring = charstrings[i - 1];
  28093. width = "width" in charstring ? charstring.width : 0;
  28094. } else if (cffWidths) {
  28095. width = Math.ceil(cffWidths[i] || 0);
  28096. }
  28097. hmtx += string16(width) + string16(0);
  28098. }
  28099. return hmtx;
  28100. }());
  28101. builder.addTable("maxp", "\x00\x00\x50\x00" + string16(numGlyphs));
  28102. builder.addTable("name", createNameTable(fontName));
  28103. builder.addTable("post", createPostTable(properties));
  28104. return builder.toArray();
  28105. }
  28106. get _spaceWidth() {
  28107. const possibleSpaceReplacements = ["space", "minus", "one", "i", "I"];
  28108. let width;
  28109. for (const glyphName of possibleSpaceReplacements) {
  28110. if (glyphName in this.widths) {
  28111. width = this.widths[glyphName];
  28112. break;
  28113. }
  28114. const glyphsUnicodeMap = getGlyphsUnicode();
  28115. const glyphUnicode = glyphsUnicodeMap[glyphName];
  28116. let charcode = 0;
  28117. if (this.composite && this.cMap.contains(glyphUnicode)) {
  28118. charcode = this.cMap.lookup(glyphUnicode);
  28119. if (typeof charcode === "string") {
  28120. charcode = convertCidString(glyphUnicode, charcode);
  28121. }
  28122. }
  28123. if (!charcode && this.toUnicode) {
  28124. charcode = this.toUnicode.charCodeOf(glyphUnicode);
  28125. }
  28126. if (charcode <= 0) {
  28127. charcode = glyphUnicode;
  28128. }
  28129. width = this.widths[charcode];
  28130. if (width) {
  28131. break;
  28132. }
  28133. }
  28134. return shadow(this, "_spaceWidth", width || this.defaultWidth);
  28135. }
  28136. _charToGlyph(charcode, isSpace = false) {
  28137. let glyph = this._glyphCache[charcode];
  28138. if (glyph?.isSpace === isSpace) {
  28139. return glyph;
  28140. }
  28141. let fontCharCode, width, operatorListId;
  28142. let widthCode = charcode;
  28143. if (this.cMap?.contains(charcode)) {
  28144. widthCode = this.cMap.lookup(charcode);
  28145. if (typeof widthCode === "string") {
  28146. widthCode = convertCidString(charcode, widthCode);
  28147. }
  28148. }
  28149. width = this.widths[widthCode];
  28150. if (typeof width !== "number") {
  28151. width = this.defaultWidth;
  28152. }
  28153. const vmetric = this.vmetrics?.[widthCode];
  28154. let unicode = this.toUnicode.get(charcode) || charcode;
  28155. if (typeof unicode === "number") {
  28156. unicode = String.fromCharCode(unicode);
  28157. }
  28158. let isInFont = this.toFontChar[charcode] !== undefined;
  28159. fontCharCode = this.toFontChar[charcode] || charcode;
  28160. if (this.missingFile) {
  28161. const glyphName = this.differences[charcode] || this.defaultEncoding[charcode];
  28162. if ((glyphName === ".notdef" || glyphName === "") && this.type === "Type1") {
  28163. fontCharCode = 0x20;
  28164. if (glyphName === "") {
  28165. width ||= this._spaceWidth;
  28166. unicode = String.fromCharCode(fontCharCode);
  28167. }
  28168. }
  28169. fontCharCode = mapSpecialUnicodeValues(fontCharCode);
  28170. }
  28171. if (this.isType3Font) {
  28172. operatorListId = fontCharCode;
  28173. }
  28174. let accent = null;
  28175. if (this.seacMap?.[charcode]) {
  28176. isInFont = true;
  28177. const seac = this.seacMap[charcode];
  28178. fontCharCode = seac.baseFontCharCode;
  28179. accent = {
  28180. fontChar: String.fromCodePoint(seac.accentFontCharCode),
  28181. offset: seac.accentOffset
  28182. };
  28183. }
  28184. let fontChar = "";
  28185. if (typeof fontCharCode === "number") {
  28186. if (fontCharCode <= 0x10ffff) {
  28187. fontChar = String.fromCodePoint(fontCharCode);
  28188. } else {
  28189. warn(`charToGlyph - invalid fontCharCode: ${fontCharCode}`);
  28190. }
  28191. }
  28192. if (this.missingFile && this.vertical && fontChar.length === 1) {
  28193. const vertical = getVerticalPresentationForm()[fontChar.charCodeAt(0)];
  28194. if (vertical) {
  28195. fontChar = unicode = String.fromCharCode(vertical);
  28196. }
  28197. }
  28198. glyph = new fonts_Glyph(charcode, fontChar, unicode, accent, width, vmetric, operatorListId, isSpace, isInFont);
  28199. return this._glyphCache[charcode] = glyph;
  28200. }
  28201. charsToGlyphs(chars) {
  28202. let glyphs = this._charsCache[chars];
  28203. if (glyphs) {
  28204. return glyphs;
  28205. }
  28206. glyphs = [];
  28207. if (this.cMap) {
  28208. const c = Object.create(null),
  28209. ii = chars.length;
  28210. let i = 0;
  28211. while (i < ii) {
  28212. this.cMap.readCharCode(chars, i, c);
  28213. const {
  28214. charcode,
  28215. length
  28216. } = c;
  28217. i += length;
  28218. const glyph = this._charToGlyph(charcode, length === 1 && chars.charCodeAt(i - 1) === 0x20);
  28219. glyphs.push(glyph);
  28220. }
  28221. } else {
  28222. for (let i = 0, ii = chars.length; i < ii; ++i) {
  28223. const charcode = chars.charCodeAt(i);
  28224. const glyph = this._charToGlyph(charcode, charcode === 0x20);
  28225. glyphs.push(glyph);
  28226. }
  28227. }
  28228. return this._charsCache[chars] = glyphs;
  28229. }
  28230. getCharPositions(chars) {
  28231. const positions = [];
  28232. if (this.cMap) {
  28233. const c = Object.create(null);
  28234. let i = 0;
  28235. while (i < chars.length) {
  28236. this.cMap.readCharCode(chars, i, c);
  28237. const length = c.length;
  28238. positions.push([i, i + length]);
  28239. i += length;
  28240. }
  28241. } else {
  28242. for (let i = 0, ii = chars.length; i < ii; ++i) {
  28243. positions.push([i, i + 1]);
  28244. }
  28245. }
  28246. return positions;
  28247. }
  28248. get glyphCacheValues() {
  28249. return Object.values(this._glyphCache);
  28250. }
  28251. encodeString(str) {
  28252. const buffers = [];
  28253. const currentBuf = [];
  28254. const hasCurrentBufErrors = () => buffers.length % 2 === 1;
  28255. const getCharCode = this.toUnicode instanceof IdentityToUnicodeMap ? unicode => this.toUnicode.charCodeOf(unicode) : unicode => this.toUnicode.charCodeOf(String.fromCodePoint(unicode));
  28256. for (let i = 0, ii = str.length; i < ii; i++) {
  28257. const unicode = str.codePointAt(i);
  28258. if (unicode > 0xd7ff && (unicode < 0xe000 || unicode > 0xfffd)) {
  28259. i++;
  28260. }
  28261. if (this.toUnicode) {
  28262. const charCode = getCharCode(unicode);
  28263. if (charCode !== -1) {
  28264. if (hasCurrentBufErrors()) {
  28265. buffers.push(currentBuf.join(""));
  28266. currentBuf.length = 0;
  28267. }
  28268. const charCodeLength = this.cMap ? this.cMap.getCharCodeLength(charCode) : 1;
  28269. for (let j = charCodeLength - 1; j >= 0; j--) {
  28270. currentBuf.push(String.fromCharCode(charCode >> 8 * j & 0xff));
  28271. }
  28272. continue;
  28273. }
  28274. }
  28275. if (!hasCurrentBufErrors()) {
  28276. buffers.push(currentBuf.join(""));
  28277. currentBuf.length = 0;
  28278. }
  28279. currentBuf.push(String.fromCodePoint(unicode));
  28280. }
  28281. buffers.push(currentBuf.join(""));
  28282. return buffers;
  28283. }
  28284. }
  28285. class ErrorFont {
  28286. constructor(error) {
  28287. this.error = error;
  28288. this.loadedName = "g_font_error";
  28289. this.missingFile = true;
  28290. }
  28291. charsToGlyphs() {
  28292. return [];
  28293. }
  28294. encodeString(chars) {
  28295. return [chars];
  28296. }
  28297. exportData(extraProperties = false) {
  28298. return {
  28299. error: this.error
  28300. };
  28301. }
  28302. }
  28303. ;// ./src/core/pattern.js
  28304. const ShadingType = {
  28305. FUNCTION_BASED: 1,
  28306. AXIAL: 2,
  28307. RADIAL: 3,
  28308. FREE_FORM_MESH: 4,
  28309. LATTICE_FORM_MESH: 5,
  28310. COONS_PATCH_MESH: 6,
  28311. TENSOR_PATCH_MESH: 7
  28312. };
  28313. class Pattern {
  28314. constructor() {
  28315. unreachable("Cannot initialize Pattern.");
  28316. }
  28317. static parseShading(shading, xref, res, pdfFunctionFactory, localColorSpaceCache) {
  28318. const dict = shading instanceof BaseStream ? shading.dict : shading;
  28319. const type = dict.get("ShadingType");
  28320. try {
  28321. switch (type) {
  28322. case ShadingType.AXIAL:
  28323. case ShadingType.RADIAL:
  28324. return new RadialAxialShading(dict, xref, res, pdfFunctionFactory, localColorSpaceCache);
  28325. case ShadingType.FREE_FORM_MESH:
  28326. case ShadingType.LATTICE_FORM_MESH:
  28327. case ShadingType.COONS_PATCH_MESH:
  28328. case ShadingType.TENSOR_PATCH_MESH:
  28329. return new MeshShading(shading, xref, res, pdfFunctionFactory, localColorSpaceCache);
  28330. default:
  28331. throw new FormatError("Unsupported ShadingType: " + type);
  28332. }
  28333. } catch (ex) {
  28334. if (ex instanceof MissingDataException) {
  28335. throw ex;
  28336. }
  28337. warn(ex);
  28338. return new DummyShading();
  28339. }
  28340. }
  28341. }
  28342. class BaseShading {
  28343. static SMALL_NUMBER = 1e-6;
  28344. getIR() {
  28345. unreachable("Abstract method `getIR` called.");
  28346. }
  28347. }
  28348. class RadialAxialShading extends BaseShading {
  28349. constructor(dict, xref, resources, pdfFunctionFactory, localColorSpaceCache) {
  28350. super();
  28351. this.shadingType = dict.get("ShadingType");
  28352. let coordsLen = 0;
  28353. if (this.shadingType === ShadingType.AXIAL) {
  28354. coordsLen = 4;
  28355. } else if (this.shadingType === ShadingType.RADIAL) {
  28356. coordsLen = 6;
  28357. }
  28358. this.coordsArr = dict.getArray("Coords");
  28359. if (!isNumberArray(this.coordsArr, coordsLen)) {
  28360. throw new FormatError("RadialAxialShading: Invalid /Coords array.");
  28361. }
  28362. const cs = ColorSpace.parse({
  28363. cs: dict.getRaw("CS") || dict.getRaw("ColorSpace"),
  28364. xref,
  28365. resources,
  28366. pdfFunctionFactory,
  28367. localColorSpaceCache
  28368. });
  28369. this.bbox = lookupNormalRect(dict.getArray("BBox"), null);
  28370. let t0 = 0.0,
  28371. t1 = 1.0;
  28372. const domainArr = dict.getArray("Domain");
  28373. if (isNumberArray(domainArr, 2)) {
  28374. [t0, t1] = domainArr;
  28375. }
  28376. let extendStart = false,
  28377. extendEnd = false;
  28378. const extendArr = dict.getArray("Extend");
  28379. if (isBooleanArray(extendArr, 2)) {
  28380. [extendStart, extendEnd] = extendArr;
  28381. }
  28382. if (this.shadingType === ShadingType.RADIAL && (!extendStart || !extendEnd)) {
  28383. const [x1, y1, r1, x2, y2, r2] = this.coordsArr;
  28384. const distance = Math.hypot(x1 - x2, y1 - y2);
  28385. if (r1 <= r2 + distance && r2 <= r1 + distance) {
  28386. warn("Unsupported radial gradient.");
  28387. }
  28388. }
  28389. this.extendStart = extendStart;
  28390. this.extendEnd = extendEnd;
  28391. const fnObj = dict.getRaw("Function");
  28392. const fn = pdfFunctionFactory.createFromArray(fnObj);
  28393. const NUMBER_OF_SAMPLES = 840;
  28394. const step = (t1 - t0) / NUMBER_OF_SAMPLES;
  28395. const colorStops = this.colorStops = [];
  28396. if (t0 >= t1 || step <= 0) {
  28397. info("Bad shading domain.");
  28398. return;
  28399. }
  28400. const color = new Float32Array(cs.numComps),
  28401. ratio = new Float32Array(1);
  28402. let rgbColor;
  28403. let iBase = 0;
  28404. ratio[0] = t0;
  28405. fn(ratio, 0, color, 0);
  28406. let rgbBase = cs.getRgb(color, 0);
  28407. const cssColorBase = Util.makeHexColor(rgbBase[0], rgbBase[1], rgbBase[2]);
  28408. colorStops.push([0, cssColorBase]);
  28409. let iPrev = 1;
  28410. ratio[0] = t0 + step;
  28411. fn(ratio, 0, color, 0);
  28412. let rgbPrev = cs.getRgb(color, 0);
  28413. let maxSlopeR = rgbPrev[0] - rgbBase[0] + 1;
  28414. let maxSlopeG = rgbPrev[1] - rgbBase[1] + 1;
  28415. let maxSlopeB = rgbPrev[2] - rgbBase[2] + 1;
  28416. let minSlopeR = rgbPrev[0] - rgbBase[0] - 1;
  28417. let minSlopeG = rgbPrev[1] - rgbBase[1] - 1;
  28418. let minSlopeB = rgbPrev[2] - rgbBase[2] - 1;
  28419. for (let i = 2; i < NUMBER_OF_SAMPLES; i++) {
  28420. ratio[0] = t0 + i * step;
  28421. fn(ratio, 0, color, 0);
  28422. rgbColor = cs.getRgb(color, 0);
  28423. const run = i - iBase;
  28424. maxSlopeR = Math.min(maxSlopeR, (rgbColor[0] - rgbBase[0] + 1) / run);
  28425. maxSlopeG = Math.min(maxSlopeG, (rgbColor[1] - rgbBase[1] + 1) / run);
  28426. maxSlopeB = Math.min(maxSlopeB, (rgbColor[2] - rgbBase[2] + 1) / run);
  28427. minSlopeR = Math.max(minSlopeR, (rgbColor[0] - rgbBase[0] - 1) / run);
  28428. minSlopeG = Math.max(minSlopeG, (rgbColor[1] - rgbBase[1] - 1) / run);
  28429. minSlopeB = Math.max(minSlopeB, (rgbColor[2] - rgbBase[2] - 1) / run);
  28430. const slopesExist = minSlopeR <= maxSlopeR && minSlopeG <= maxSlopeG && minSlopeB <= maxSlopeB;
  28431. if (!slopesExist) {
  28432. const cssColor = Util.makeHexColor(rgbPrev[0], rgbPrev[1], rgbPrev[2]);
  28433. colorStops.push([iPrev / NUMBER_OF_SAMPLES, cssColor]);
  28434. maxSlopeR = rgbColor[0] - rgbPrev[0] + 1;
  28435. maxSlopeG = rgbColor[1] - rgbPrev[1] + 1;
  28436. maxSlopeB = rgbColor[2] - rgbPrev[2] + 1;
  28437. minSlopeR = rgbColor[0] - rgbPrev[0] - 1;
  28438. minSlopeG = rgbColor[1] - rgbPrev[1] - 1;
  28439. minSlopeB = rgbColor[2] - rgbPrev[2] - 1;
  28440. iBase = iPrev;
  28441. rgbBase = rgbPrev;
  28442. }
  28443. iPrev = i;
  28444. rgbPrev = rgbColor;
  28445. }
  28446. const cssColor = Util.makeHexColor(rgbPrev[0], rgbPrev[1], rgbPrev[2]);
  28447. colorStops.push([1, cssColor]);
  28448. let background = "transparent";
  28449. if (dict.has("Background")) {
  28450. rgbColor = cs.getRgb(dict.get("Background"), 0);
  28451. background = Util.makeHexColor(rgbColor[0], rgbColor[1], rgbColor[2]);
  28452. }
  28453. if (!extendStart) {
  28454. colorStops.unshift([0, background]);
  28455. colorStops[1][0] += BaseShading.SMALL_NUMBER;
  28456. }
  28457. if (!extendEnd) {
  28458. colorStops.at(-1)[0] -= BaseShading.SMALL_NUMBER;
  28459. colorStops.push([1, background]);
  28460. }
  28461. this.colorStops = colorStops;
  28462. }
  28463. getIR() {
  28464. const {
  28465. coordsArr,
  28466. shadingType
  28467. } = this;
  28468. let type, p0, p1, r0, r1;
  28469. if (shadingType === ShadingType.AXIAL) {
  28470. p0 = [coordsArr[0], coordsArr[1]];
  28471. p1 = [coordsArr[2], coordsArr[3]];
  28472. r0 = null;
  28473. r1 = null;
  28474. type = "axial";
  28475. } else if (shadingType === ShadingType.RADIAL) {
  28476. p0 = [coordsArr[0], coordsArr[1]];
  28477. p1 = [coordsArr[3], coordsArr[4]];
  28478. r0 = coordsArr[2];
  28479. r1 = coordsArr[5];
  28480. type = "radial";
  28481. } else {
  28482. unreachable(`getPattern type unknown: ${shadingType}`);
  28483. }
  28484. return ["RadialAxial", type, this.bbox, this.colorStops, p0, p1, r0, r1];
  28485. }
  28486. }
  28487. class MeshStreamReader {
  28488. constructor(stream, context) {
  28489. this.stream = stream;
  28490. this.context = context;
  28491. this.buffer = 0;
  28492. this.bufferLength = 0;
  28493. const numComps = context.numComps;
  28494. this.tmpCompsBuf = new Float32Array(numComps);
  28495. const csNumComps = context.colorSpace.numComps;
  28496. this.tmpCsCompsBuf = context.colorFn ? new Float32Array(csNumComps) : this.tmpCompsBuf;
  28497. }
  28498. get hasData() {
  28499. if (this.stream.end) {
  28500. return this.stream.pos < this.stream.end;
  28501. }
  28502. if (this.bufferLength > 0) {
  28503. return true;
  28504. }
  28505. const nextByte = this.stream.getByte();
  28506. if (nextByte < 0) {
  28507. return false;
  28508. }
  28509. this.buffer = nextByte;
  28510. this.bufferLength = 8;
  28511. return true;
  28512. }
  28513. readBits(n) {
  28514. let buffer = this.buffer;
  28515. let bufferLength = this.bufferLength;
  28516. if (n === 32) {
  28517. if (bufferLength === 0) {
  28518. return (this.stream.getByte() << 24 | this.stream.getByte() << 16 | this.stream.getByte() << 8 | this.stream.getByte()) >>> 0;
  28519. }
  28520. buffer = buffer << 24 | this.stream.getByte() << 16 | this.stream.getByte() << 8 | this.stream.getByte();
  28521. const nextByte = this.stream.getByte();
  28522. this.buffer = nextByte & (1 << bufferLength) - 1;
  28523. return (buffer << 8 - bufferLength | (nextByte & 0xff) >> bufferLength) >>> 0;
  28524. }
  28525. if (n === 8 && bufferLength === 0) {
  28526. return this.stream.getByte();
  28527. }
  28528. while (bufferLength < n) {
  28529. buffer = buffer << 8 | this.stream.getByte();
  28530. bufferLength += 8;
  28531. }
  28532. bufferLength -= n;
  28533. this.bufferLength = bufferLength;
  28534. this.buffer = buffer & (1 << bufferLength) - 1;
  28535. return buffer >> bufferLength;
  28536. }
  28537. align() {
  28538. this.buffer = 0;
  28539. this.bufferLength = 0;
  28540. }
  28541. readFlag() {
  28542. return this.readBits(this.context.bitsPerFlag);
  28543. }
  28544. readCoordinate() {
  28545. const bitsPerCoordinate = this.context.bitsPerCoordinate;
  28546. const xi = this.readBits(bitsPerCoordinate);
  28547. const yi = this.readBits(bitsPerCoordinate);
  28548. const decode = this.context.decode;
  28549. const scale = bitsPerCoordinate < 32 ? 1 / ((1 << bitsPerCoordinate) - 1) : 2.3283064365386963e-10;
  28550. return [xi * scale * (decode[1] - decode[0]) + decode[0], yi * scale * (decode[3] - decode[2]) + decode[2]];
  28551. }
  28552. readComponents() {
  28553. const numComps = this.context.numComps;
  28554. const bitsPerComponent = this.context.bitsPerComponent;
  28555. const scale = bitsPerComponent < 32 ? 1 / ((1 << bitsPerComponent) - 1) : 2.3283064365386963e-10;
  28556. const decode = this.context.decode;
  28557. const components = this.tmpCompsBuf;
  28558. for (let i = 0, j = 4; i < numComps; i++, j += 2) {
  28559. const ci = this.readBits(bitsPerComponent);
  28560. components[i] = ci * scale * (decode[j + 1] - decode[j]) + decode[j];
  28561. }
  28562. const color = this.tmpCsCompsBuf;
  28563. if (this.context.colorFn) {
  28564. this.context.colorFn(components, 0, color, 0);
  28565. }
  28566. return this.context.colorSpace.getRgb(color, 0);
  28567. }
  28568. }
  28569. let bCache = Object.create(null);
  28570. function buildB(count) {
  28571. const lut = [];
  28572. for (let i = 0; i <= count; i++) {
  28573. const t = i / count,
  28574. t_ = 1 - t;
  28575. lut.push(new Float32Array([t_ ** 3, 3 * t * t_ ** 2, 3 * t ** 2 * t_, t ** 3]));
  28576. }
  28577. return lut;
  28578. }
  28579. function getB(count) {
  28580. return bCache[count] ||= buildB(count);
  28581. }
  28582. function clearPatternCaches() {
  28583. bCache = Object.create(null);
  28584. }
  28585. class MeshShading extends BaseShading {
  28586. static MIN_SPLIT_PATCH_CHUNKS_AMOUNT = 3;
  28587. static MAX_SPLIT_PATCH_CHUNKS_AMOUNT = 20;
  28588. static TRIANGLE_DENSITY = 20;
  28589. constructor(stream, xref, resources, pdfFunctionFactory, localColorSpaceCache) {
  28590. super();
  28591. if (!(stream instanceof BaseStream)) {
  28592. throw new FormatError("Mesh data is not a stream");
  28593. }
  28594. const dict = stream.dict;
  28595. this.shadingType = dict.get("ShadingType");
  28596. this.bbox = lookupNormalRect(dict.getArray("BBox"), null);
  28597. const cs = ColorSpace.parse({
  28598. cs: dict.getRaw("CS") || dict.getRaw("ColorSpace"),
  28599. xref,
  28600. resources,
  28601. pdfFunctionFactory,
  28602. localColorSpaceCache
  28603. });
  28604. this.background = dict.has("Background") ? cs.getRgb(dict.get("Background"), 0) : null;
  28605. const fnObj = dict.getRaw("Function");
  28606. const fn = fnObj ? pdfFunctionFactory.createFromArray(fnObj) : null;
  28607. this.coords = [];
  28608. this.colors = [];
  28609. this.figures = [];
  28610. const decodeContext = {
  28611. bitsPerCoordinate: dict.get("BitsPerCoordinate"),
  28612. bitsPerComponent: dict.get("BitsPerComponent"),
  28613. bitsPerFlag: dict.get("BitsPerFlag"),
  28614. decode: dict.getArray("Decode"),
  28615. colorFn: fn,
  28616. colorSpace: cs,
  28617. numComps: fn ? 1 : cs.numComps
  28618. };
  28619. const reader = new MeshStreamReader(stream, decodeContext);
  28620. let patchMesh = false;
  28621. switch (this.shadingType) {
  28622. case ShadingType.FREE_FORM_MESH:
  28623. this._decodeType4Shading(reader);
  28624. break;
  28625. case ShadingType.LATTICE_FORM_MESH:
  28626. const verticesPerRow = dict.get("VerticesPerRow") | 0;
  28627. if (verticesPerRow < 2) {
  28628. throw new FormatError("Invalid VerticesPerRow");
  28629. }
  28630. this._decodeType5Shading(reader, verticesPerRow);
  28631. break;
  28632. case ShadingType.COONS_PATCH_MESH:
  28633. this._decodeType6Shading(reader);
  28634. patchMesh = true;
  28635. break;
  28636. case ShadingType.TENSOR_PATCH_MESH:
  28637. this._decodeType7Shading(reader);
  28638. patchMesh = true;
  28639. break;
  28640. default:
  28641. unreachable("Unsupported mesh type.");
  28642. break;
  28643. }
  28644. if (patchMesh) {
  28645. this._updateBounds();
  28646. for (let i = 0, ii = this.figures.length; i < ii; i++) {
  28647. this._buildFigureFromPatch(i);
  28648. }
  28649. }
  28650. this._updateBounds();
  28651. this._packData();
  28652. }
  28653. _decodeType4Shading(reader) {
  28654. const coords = this.coords;
  28655. const colors = this.colors;
  28656. const operators = [];
  28657. const ps = [];
  28658. let verticesLeft = 0;
  28659. while (reader.hasData) {
  28660. const f = reader.readFlag();
  28661. const coord = reader.readCoordinate();
  28662. const color = reader.readComponents();
  28663. if (verticesLeft === 0) {
  28664. if (!(0 <= f && f <= 2)) {
  28665. throw new FormatError("Unknown type4 flag");
  28666. }
  28667. switch (f) {
  28668. case 0:
  28669. verticesLeft = 3;
  28670. break;
  28671. case 1:
  28672. ps.push(ps.at(-2), ps.at(-1));
  28673. verticesLeft = 1;
  28674. break;
  28675. case 2:
  28676. ps.push(ps.at(-3), ps.at(-1));
  28677. verticesLeft = 1;
  28678. break;
  28679. }
  28680. operators.push(f);
  28681. }
  28682. ps.push(coords.length);
  28683. coords.push(coord);
  28684. colors.push(color);
  28685. verticesLeft--;
  28686. reader.align();
  28687. }
  28688. this.figures.push({
  28689. type: "triangles",
  28690. coords: new Int32Array(ps),
  28691. colors: new Int32Array(ps)
  28692. });
  28693. }
  28694. _decodeType5Shading(reader, verticesPerRow) {
  28695. const coords = this.coords;
  28696. const colors = this.colors;
  28697. const ps = [];
  28698. while (reader.hasData) {
  28699. const coord = reader.readCoordinate();
  28700. const color = reader.readComponents();
  28701. ps.push(coords.length);
  28702. coords.push(coord);
  28703. colors.push(color);
  28704. }
  28705. this.figures.push({
  28706. type: "lattice",
  28707. coords: new Int32Array(ps),
  28708. colors: new Int32Array(ps),
  28709. verticesPerRow
  28710. });
  28711. }
  28712. _decodeType6Shading(reader) {
  28713. const coords = this.coords;
  28714. const colors = this.colors;
  28715. const ps = new Int32Array(16);
  28716. const cs = new Int32Array(4);
  28717. while (reader.hasData) {
  28718. const f = reader.readFlag();
  28719. if (!(0 <= f && f <= 3)) {
  28720. throw new FormatError("Unknown type6 flag");
  28721. }
  28722. const pi = coords.length;
  28723. for (let i = 0, ii = f !== 0 ? 8 : 12; i < ii; i++) {
  28724. coords.push(reader.readCoordinate());
  28725. }
  28726. const ci = colors.length;
  28727. for (let i = 0, ii = f !== 0 ? 2 : 4; i < ii; i++) {
  28728. colors.push(reader.readComponents());
  28729. }
  28730. let tmp1, tmp2, tmp3, tmp4;
  28731. switch (f) {
  28732. case 0:
  28733. ps[12] = pi + 3;
  28734. ps[13] = pi + 4;
  28735. ps[14] = pi + 5;
  28736. ps[15] = pi + 6;
  28737. ps[8] = pi + 2;
  28738. ps[11] = pi + 7;
  28739. ps[4] = pi + 1;
  28740. ps[7] = pi + 8;
  28741. ps[0] = pi;
  28742. ps[1] = pi + 11;
  28743. ps[2] = pi + 10;
  28744. ps[3] = pi + 9;
  28745. cs[2] = ci + 1;
  28746. cs[3] = ci + 2;
  28747. cs[0] = ci;
  28748. cs[1] = ci + 3;
  28749. break;
  28750. case 1:
  28751. tmp1 = ps[12];
  28752. tmp2 = ps[13];
  28753. tmp3 = ps[14];
  28754. tmp4 = ps[15];
  28755. ps[12] = tmp4;
  28756. ps[13] = pi + 0;
  28757. ps[14] = pi + 1;
  28758. ps[15] = pi + 2;
  28759. ps[8] = tmp3;
  28760. ps[11] = pi + 3;
  28761. ps[4] = tmp2;
  28762. ps[7] = pi + 4;
  28763. ps[0] = tmp1;
  28764. ps[1] = pi + 7;
  28765. ps[2] = pi + 6;
  28766. ps[3] = pi + 5;
  28767. tmp1 = cs[2];
  28768. tmp2 = cs[3];
  28769. cs[2] = tmp2;
  28770. cs[3] = ci;
  28771. cs[0] = tmp1;
  28772. cs[1] = ci + 1;
  28773. break;
  28774. case 2:
  28775. tmp1 = ps[15];
  28776. tmp2 = ps[11];
  28777. ps[12] = ps[3];
  28778. ps[13] = pi + 0;
  28779. ps[14] = pi + 1;
  28780. ps[15] = pi + 2;
  28781. ps[8] = ps[7];
  28782. ps[11] = pi + 3;
  28783. ps[4] = tmp2;
  28784. ps[7] = pi + 4;
  28785. ps[0] = tmp1;
  28786. ps[1] = pi + 7;
  28787. ps[2] = pi + 6;
  28788. ps[3] = pi + 5;
  28789. tmp1 = cs[3];
  28790. cs[2] = cs[1];
  28791. cs[3] = ci;
  28792. cs[0] = tmp1;
  28793. cs[1] = ci + 1;
  28794. break;
  28795. case 3:
  28796. ps[12] = ps[0];
  28797. ps[13] = pi + 0;
  28798. ps[14] = pi + 1;
  28799. ps[15] = pi + 2;
  28800. ps[8] = ps[1];
  28801. ps[11] = pi + 3;
  28802. ps[4] = ps[2];
  28803. ps[7] = pi + 4;
  28804. ps[0] = ps[3];
  28805. ps[1] = pi + 7;
  28806. ps[2] = pi + 6;
  28807. ps[3] = pi + 5;
  28808. cs[2] = cs[0];
  28809. cs[3] = ci;
  28810. cs[0] = cs[1];
  28811. cs[1] = ci + 1;
  28812. break;
  28813. }
  28814. ps[5] = coords.length;
  28815. coords.push([(-4 * coords[ps[0]][0] - coords[ps[15]][0] + 6 * (coords[ps[4]][0] + coords[ps[1]][0]) - 2 * (coords[ps[12]][0] + coords[ps[3]][0]) + 3 * (coords[ps[13]][0] + coords[ps[7]][0])) / 9, (-4 * coords[ps[0]][1] - coords[ps[15]][1] + 6 * (coords[ps[4]][1] + coords[ps[1]][1]) - 2 * (coords[ps[12]][1] + coords[ps[3]][1]) + 3 * (coords[ps[13]][1] + coords[ps[7]][1])) / 9]);
  28816. ps[6] = coords.length;
  28817. coords.push([(-4 * coords[ps[3]][0] - coords[ps[12]][0] + 6 * (coords[ps[2]][0] + coords[ps[7]][0]) - 2 * (coords[ps[0]][0] + coords[ps[15]][0]) + 3 * (coords[ps[4]][0] + coords[ps[14]][0])) / 9, (-4 * coords[ps[3]][1] - coords[ps[12]][1] + 6 * (coords[ps[2]][1] + coords[ps[7]][1]) - 2 * (coords[ps[0]][1] + coords[ps[15]][1]) + 3 * (coords[ps[4]][1] + coords[ps[14]][1])) / 9]);
  28818. ps[9] = coords.length;
  28819. coords.push([(-4 * coords[ps[12]][0] - coords[ps[3]][0] + 6 * (coords[ps[8]][0] + coords[ps[13]][0]) - 2 * (coords[ps[0]][0] + coords[ps[15]][0]) + 3 * (coords[ps[11]][0] + coords[ps[1]][0])) / 9, (-4 * coords[ps[12]][1] - coords[ps[3]][1] + 6 * (coords[ps[8]][1] + coords[ps[13]][1]) - 2 * (coords[ps[0]][1] + coords[ps[15]][1]) + 3 * (coords[ps[11]][1] + coords[ps[1]][1])) / 9]);
  28820. ps[10] = coords.length;
  28821. coords.push([(-4 * coords[ps[15]][0] - coords[ps[0]][0] + 6 * (coords[ps[11]][0] + coords[ps[14]][0]) - 2 * (coords[ps[12]][0] + coords[ps[3]][0]) + 3 * (coords[ps[2]][0] + coords[ps[8]][0])) / 9, (-4 * coords[ps[15]][1] - coords[ps[0]][1] + 6 * (coords[ps[11]][1] + coords[ps[14]][1]) - 2 * (coords[ps[12]][1] + coords[ps[3]][1]) + 3 * (coords[ps[2]][1] + coords[ps[8]][1])) / 9]);
  28822. this.figures.push({
  28823. type: "patch",
  28824. coords: new Int32Array(ps),
  28825. colors: new Int32Array(cs)
  28826. });
  28827. }
  28828. }
  28829. _decodeType7Shading(reader) {
  28830. const coords = this.coords;
  28831. const colors = this.colors;
  28832. const ps = new Int32Array(16);
  28833. const cs = new Int32Array(4);
  28834. while (reader.hasData) {
  28835. const f = reader.readFlag();
  28836. if (!(0 <= f && f <= 3)) {
  28837. throw new FormatError("Unknown type7 flag");
  28838. }
  28839. const pi = coords.length;
  28840. for (let i = 0, ii = f !== 0 ? 12 : 16; i < ii; i++) {
  28841. coords.push(reader.readCoordinate());
  28842. }
  28843. const ci = colors.length;
  28844. for (let i = 0, ii = f !== 0 ? 2 : 4; i < ii; i++) {
  28845. colors.push(reader.readComponents());
  28846. }
  28847. let tmp1, tmp2, tmp3, tmp4;
  28848. switch (f) {
  28849. case 0:
  28850. ps[12] = pi + 3;
  28851. ps[13] = pi + 4;
  28852. ps[14] = pi + 5;
  28853. ps[15] = pi + 6;
  28854. ps[8] = pi + 2;
  28855. ps[9] = pi + 13;
  28856. ps[10] = pi + 14;
  28857. ps[11] = pi + 7;
  28858. ps[4] = pi + 1;
  28859. ps[5] = pi + 12;
  28860. ps[6] = pi + 15;
  28861. ps[7] = pi + 8;
  28862. ps[0] = pi;
  28863. ps[1] = pi + 11;
  28864. ps[2] = pi + 10;
  28865. ps[3] = pi + 9;
  28866. cs[2] = ci + 1;
  28867. cs[3] = ci + 2;
  28868. cs[0] = ci;
  28869. cs[1] = ci + 3;
  28870. break;
  28871. case 1:
  28872. tmp1 = ps[12];
  28873. tmp2 = ps[13];
  28874. tmp3 = ps[14];
  28875. tmp4 = ps[15];
  28876. ps[12] = tmp4;
  28877. ps[13] = pi + 0;
  28878. ps[14] = pi + 1;
  28879. ps[15] = pi + 2;
  28880. ps[8] = tmp3;
  28881. ps[9] = pi + 9;
  28882. ps[10] = pi + 10;
  28883. ps[11] = pi + 3;
  28884. ps[4] = tmp2;
  28885. ps[5] = pi + 8;
  28886. ps[6] = pi + 11;
  28887. ps[7] = pi + 4;
  28888. ps[0] = tmp1;
  28889. ps[1] = pi + 7;
  28890. ps[2] = pi + 6;
  28891. ps[3] = pi + 5;
  28892. tmp1 = cs[2];
  28893. tmp2 = cs[3];
  28894. cs[2] = tmp2;
  28895. cs[3] = ci;
  28896. cs[0] = tmp1;
  28897. cs[1] = ci + 1;
  28898. break;
  28899. case 2:
  28900. tmp1 = ps[15];
  28901. tmp2 = ps[11];
  28902. ps[12] = ps[3];
  28903. ps[13] = pi + 0;
  28904. ps[14] = pi + 1;
  28905. ps[15] = pi + 2;
  28906. ps[8] = ps[7];
  28907. ps[9] = pi + 9;
  28908. ps[10] = pi + 10;
  28909. ps[11] = pi + 3;
  28910. ps[4] = tmp2;
  28911. ps[5] = pi + 8;
  28912. ps[6] = pi + 11;
  28913. ps[7] = pi + 4;
  28914. ps[0] = tmp1;
  28915. ps[1] = pi + 7;
  28916. ps[2] = pi + 6;
  28917. ps[3] = pi + 5;
  28918. tmp1 = cs[3];
  28919. cs[2] = cs[1];
  28920. cs[3] = ci;
  28921. cs[0] = tmp1;
  28922. cs[1] = ci + 1;
  28923. break;
  28924. case 3:
  28925. ps[12] = ps[0];
  28926. ps[13] = pi + 0;
  28927. ps[14] = pi + 1;
  28928. ps[15] = pi + 2;
  28929. ps[8] = ps[1];
  28930. ps[9] = pi + 9;
  28931. ps[10] = pi + 10;
  28932. ps[11] = pi + 3;
  28933. ps[4] = ps[2];
  28934. ps[5] = pi + 8;
  28935. ps[6] = pi + 11;
  28936. ps[7] = pi + 4;
  28937. ps[0] = ps[3];
  28938. ps[1] = pi + 7;
  28939. ps[2] = pi + 6;
  28940. ps[3] = pi + 5;
  28941. cs[2] = cs[0];
  28942. cs[3] = ci;
  28943. cs[0] = cs[1];
  28944. cs[1] = ci + 1;
  28945. break;
  28946. }
  28947. this.figures.push({
  28948. type: "patch",
  28949. coords: new Int32Array(ps),
  28950. colors: new Int32Array(cs)
  28951. });
  28952. }
  28953. }
  28954. _buildFigureFromPatch(index) {
  28955. const figure = this.figures[index];
  28956. assert(figure.type === "patch", "Unexpected patch mesh figure");
  28957. const coords = this.coords,
  28958. colors = this.colors;
  28959. const pi = figure.coords;
  28960. const ci = figure.colors;
  28961. const figureMinX = Math.min(coords[pi[0]][0], coords[pi[3]][0], coords[pi[12]][0], coords[pi[15]][0]);
  28962. const figureMinY = Math.min(coords[pi[0]][1], coords[pi[3]][1], coords[pi[12]][1], coords[pi[15]][1]);
  28963. const figureMaxX = Math.max(coords[pi[0]][0], coords[pi[3]][0], coords[pi[12]][0], coords[pi[15]][0]);
  28964. const figureMaxY = Math.max(coords[pi[0]][1], coords[pi[3]][1], coords[pi[12]][1], coords[pi[15]][1]);
  28965. let splitXBy = Math.ceil((figureMaxX - figureMinX) * MeshShading.TRIANGLE_DENSITY / (this.bounds[2] - this.bounds[0]));
  28966. splitXBy = Math.max(MeshShading.MIN_SPLIT_PATCH_CHUNKS_AMOUNT, Math.min(MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT, splitXBy));
  28967. let splitYBy = Math.ceil((figureMaxY - figureMinY) * MeshShading.TRIANGLE_DENSITY / (this.bounds[3] - this.bounds[1]));
  28968. splitYBy = Math.max(MeshShading.MIN_SPLIT_PATCH_CHUNKS_AMOUNT, Math.min(MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT, splitYBy));
  28969. const verticesPerRow = splitXBy + 1;
  28970. const figureCoords = new Int32Array((splitYBy + 1) * verticesPerRow);
  28971. const figureColors = new Int32Array((splitYBy + 1) * verticesPerRow);
  28972. let k = 0;
  28973. const cl = new Uint8Array(3),
  28974. cr = new Uint8Array(3);
  28975. const c0 = colors[ci[0]],
  28976. c1 = colors[ci[1]],
  28977. c2 = colors[ci[2]],
  28978. c3 = colors[ci[3]];
  28979. const bRow = getB(splitYBy),
  28980. bCol = getB(splitXBy);
  28981. for (let row = 0; row <= splitYBy; row++) {
  28982. cl[0] = (c0[0] * (splitYBy - row) + c2[0] * row) / splitYBy | 0;
  28983. cl[1] = (c0[1] * (splitYBy - row) + c2[1] * row) / splitYBy | 0;
  28984. cl[2] = (c0[2] * (splitYBy - row) + c2[2] * row) / splitYBy | 0;
  28985. cr[0] = (c1[0] * (splitYBy - row) + c3[0] * row) / splitYBy | 0;
  28986. cr[1] = (c1[1] * (splitYBy - row) + c3[1] * row) / splitYBy | 0;
  28987. cr[2] = (c1[2] * (splitYBy - row) + c3[2] * row) / splitYBy | 0;
  28988. for (let col = 0; col <= splitXBy; col++, k++) {
  28989. if ((row === 0 || row === splitYBy) && (col === 0 || col === splitXBy)) {
  28990. continue;
  28991. }
  28992. let x = 0,
  28993. y = 0;
  28994. let q = 0;
  28995. for (let i = 0; i <= 3; i++) {
  28996. for (let j = 0; j <= 3; j++, q++) {
  28997. const m = bRow[row][i] * bCol[col][j];
  28998. x += coords[pi[q]][0] * m;
  28999. y += coords[pi[q]][1] * m;
  29000. }
  29001. }
  29002. figureCoords[k] = coords.length;
  29003. coords.push([x, y]);
  29004. figureColors[k] = colors.length;
  29005. const newColor = new Uint8Array(3);
  29006. newColor[0] = (cl[0] * (splitXBy - col) + cr[0] * col) / splitXBy | 0;
  29007. newColor[1] = (cl[1] * (splitXBy - col) + cr[1] * col) / splitXBy | 0;
  29008. newColor[2] = (cl[2] * (splitXBy - col) + cr[2] * col) / splitXBy | 0;
  29009. colors.push(newColor);
  29010. }
  29011. }
  29012. figureCoords[0] = pi[0];
  29013. figureColors[0] = ci[0];
  29014. figureCoords[splitXBy] = pi[3];
  29015. figureColors[splitXBy] = ci[1];
  29016. figureCoords[verticesPerRow * splitYBy] = pi[12];
  29017. figureColors[verticesPerRow * splitYBy] = ci[2];
  29018. figureCoords[verticesPerRow * splitYBy + splitXBy] = pi[15];
  29019. figureColors[verticesPerRow * splitYBy + splitXBy] = ci[3];
  29020. this.figures[index] = {
  29021. type: "lattice",
  29022. coords: figureCoords,
  29023. colors: figureColors,
  29024. verticesPerRow
  29025. };
  29026. }
  29027. _updateBounds() {
  29028. let minX = this.coords[0][0],
  29029. minY = this.coords[0][1],
  29030. maxX = minX,
  29031. maxY = minY;
  29032. for (let i = 1, ii = this.coords.length; i < ii; i++) {
  29033. const x = this.coords[i][0],
  29034. y = this.coords[i][1];
  29035. minX = minX > x ? x : minX;
  29036. minY = minY > y ? y : minY;
  29037. maxX = maxX < x ? x : maxX;
  29038. maxY = maxY < y ? y : maxY;
  29039. }
  29040. this.bounds = [minX, minY, maxX, maxY];
  29041. }
  29042. _packData() {
  29043. let i, ii, j, jj;
  29044. const coords = this.coords;
  29045. const coordsPacked = new Float32Array(coords.length * 2);
  29046. for (i = 0, j = 0, ii = coords.length; i < ii; i++) {
  29047. const xy = coords[i];
  29048. coordsPacked[j++] = xy[0];
  29049. coordsPacked[j++] = xy[1];
  29050. }
  29051. this.coords = coordsPacked;
  29052. const colors = this.colors;
  29053. const colorsPacked = new Uint8Array(colors.length * 3);
  29054. for (i = 0, j = 0, ii = colors.length; i < ii; i++) {
  29055. const c = colors[i];
  29056. colorsPacked[j++] = c[0];
  29057. colorsPacked[j++] = c[1];
  29058. colorsPacked[j++] = c[2];
  29059. }
  29060. this.colors = colorsPacked;
  29061. const figures = this.figures;
  29062. for (i = 0, ii = figures.length; i < ii; i++) {
  29063. const figure = figures[i],
  29064. ps = figure.coords,
  29065. cs = figure.colors;
  29066. for (j = 0, jj = ps.length; j < jj; j++) {
  29067. ps[j] *= 2;
  29068. cs[j] *= 3;
  29069. }
  29070. }
  29071. }
  29072. getIR() {
  29073. const {
  29074. bounds
  29075. } = this;
  29076. if (bounds[2] - bounds[0] === 0 || bounds[3] - bounds[1] === 0) {
  29077. throw new FormatError(`Invalid MeshShading bounds: [${bounds}].`);
  29078. }
  29079. return ["Mesh", this.shadingType, this.coords, this.colors, this.figures, bounds, this.bbox, this.background];
  29080. }
  29081. }
  29082. class DummyShading extends BaseShading {
  29083. getIR() {
  29084. return ["Dummy"];
  29085. }
  29086. }
  29087. function getTilingPatternIR(operatorList, dict, color) {
  29088. const matrix = lookupMatrix(dict.getArray("Matrix"), IDENTITY_MATRIX);
  29089. const bbox = lookupNormalRect(dict.getArray("BBox"), null);
  29090. if (!bbox || bbox[2] - bbox[0] === 0 || bbox[3] - bbox[1] === 0) {
  29091. throw new FormatError(`Invalid getTilingPatternIR /BBox array.`);
  29092. }
  29093. const xstep = dict.get("XStep");
  29094. if (typeof xstep !== "number") {
  29095. throw new FormatError(`Invalid getTilingPatternIR /XStep value.`);
  29096. }
  29097. const ystep = dict.get("YStep");
  29098. if (typeof ystep !== "number") {
  29099. throw new FormatError(`Invalid getTilingPatternIR /YStep value.`);
  29100. }
  29101. const paintType = dict.get("PaintType");
  29102. if (!Number.isInteger(paintType)) {
  29103. throw new FormatError(`Invalid getTilingPatternIR /PaintType value.`);
  29104. }
  29105. const tilingType = dict.get("TilingType");
  29106. if (!Number.isInteger(tilingType)) {
  29107. throw new FormatError(`Invalid getTilingPatternIR /TilingType value.`);
  29108. }
  29109. return ["TilingPattern", color, operatorList, matrix, bbox, xstep, ystep, paintType, tilingType];
  29110. }
  29111. ;// ./src/core/calibri_factors.js
  29112. const CalibriBoldFactors = [1.3877, 1, 1, 1, 0.97801, 0.92482, 0.89552, 0.91133, 0.81988, 0.97566, 0.98152, 0.93548, 0.93548, 1.2798, 0.85284, 0.92794, 1, 0.96134, 1.54657, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.82845, 0.82845, 0.85284, 0.85284, 0.85284, 0.75859, 0.92138, 0.83908, 0.7762, 0.73293, 0.87289, 0.73133, 0.7514, 0.81921, 0.87356, 0.95958, 0.59526, 0.75727, 0.69225, 1.04924, 0.9121, 0.86943, 0.79795, 0.88198, 0.77958, 0.70864, 0.81055, 0.90399, 0.88653, 0.96017, 0.82577, 0.77892, 0.78257, 0.97507, 1.54657, 0.97507, 0.85284, 0.89552, 0.90176, 0.88762, 0.8785, 0.75241, 0.8785, 0.90518, 0.95015, 0.77618, 0.8785, 0.88401, 0.91916, 0.86304, 0.88401, 0.91488, 0.8785, 0.8801, 0.8785, 0.8785, 0.91343, 0.7173, 1.04106, 0.8785, 0.85075, 0.95794, 0.82616, 0.85162, 0.79492, 0.88331, 1.69808, 0.88331, 0.85284, 0.97801, 0.89552, 0.91133, 0.89552, 0.91133, 1.7801, 0.89552, 1.24487, 1.13254, 1.12401, 0.96839, 0.85284, 0.68787, 0.70645, 0.85592, 0.90747, 1.01466, 1.0088, 0.90323, 1, 1.07463, 1, 0.91056, 0.75806, 1.19118, 0.96839, 0.78864, 0.82845, 0.84133, 0.75859, 0.83908, 0.83908, 0.83908, 0.83908, 0.83908, 0.83908, 0.77539, 0.73293, 0.73133, 0.73133, 0.73133, 0.73133, 0.95958, 0.95958, 0.95958, 0.95958, 0.88506, 0.9121, 0.86943, 0.86943, 0.86943, 0.86943, 0.86943, 0.85284, 0.87508, 0.90399, 0.90399, 0.90399, 0.90399, 0.77892, 0.79795, 0.90807, 0.88762, 0.88762, 0.88762, 0.88762, 0.88762, 0.88762, 0.8715, 0.75241, 0.90518, 0.90518, 0.90518, 0.90518, 0.88401, 0.88401, 0.88401, 0.88401, 0.8785, 0.8785, 0.8801, 0.8801, 0.8801, 0.8801, 0.8801, 0.90747, 0.89049, 0.8785, 0.8785, 0.8785, 0.8785, 0.85162, 0.8785, 0.85162, 0.83908, 0.88762, 0.83908, 0.88762, 0.83908, 0.88762, 0.73293, 0.75241, 0.73293, 0.75241, 0.73293, 0.75241, 0.73293, 0.75241, 0.87289, 0.83016, 0.88506, 0.93125, 0.73133, 0.90518, 0.73133, 0.90518, 0.73133, 0.90518, 0.73133, 0.90518, 0.73133, 0.90518, 0.81921, 0.77618, 0.81921, 0.77618, 0.81921, 0.77618, 1, 1, 0.87356, 0.8785, 0.91075, 0.89608, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.76229, 0.90167, 0.59526, 0.91916, 1, 1, 0.86304, 0.69225, 0.88401, 1, 1, 0.70424, 0.79468, 0.91926, 0.88175, 0.70823, 0.94903, 0.9121, 0.8785, 1, 1, 0.9121, 0.8785, 0.87802, 0.88656, 0.8785, 0.86943, 0.8801, 0.86943, 0.8801, 0.86943, 0.8801, 0.87402, 0.89291, 0.77958, 0.91343, 1, 1, 0.77958, 0.91343, 0.70864, 0.7173, 0.70864, 0.7173, 0.70864, 0.7173, 0.70864, 0.7173, 1, 1, 0.81055, 0.75841, 0.81055, 1.06452, 0.90399, 0.8785, 0.90399, 0.8785, 0.90399, 0.8785, 0.90399, 0.8785, 0.90399, 0.8785, 0.90399, 0.8785, 0.96017, 0.95794, 0.77892, 0.85162, 0.77892, 0.78257, 0.79492, 0.78257, 0.79492, 0.78257, 0.79492, 0.9297, 0.56892, 0.83908, 0.88762, 0.77539, 0.8715, 0.87508, 0.89049, 1, 1, 0.81055, 1.04106, 1.20528, 1.20528, 1, 1.15543, 0.70674, 0.98387, 0.94721, 1.33431, 1.45894, 0.95161, 1.06303, 0.83908, 0.80352, 0.57184, 0.6965, 0.56289, 0.82001, 0.56029, 0.81235, 1.02988, 0.83908, 0.7762, 0.68156, 0.80367, 0.73133, 0.78257, 0.87356, 0.86943, 0.95958, 0.75727, 0.89019, 1.04924, 0.9121, 0.7648, 0.86943, 0.87356, 0.79795, 0.78275, 0.81055, 0.77892, 0.9762, 0.82577, 0.99819, 0.84896, 0.95958, 0.77892, 0.96108, 1.01407, 0.89049, 1.02988, 0.94211, 0.96108, 0.8936, 0.84021, 0.87842, 0.96399, 0.79109, 0.89049, 1.00813, 1.02988, 0.86077, 0.87445, 0.92099, 0.84723, 0.86513, 0.8801, 0.75638, 0.85714, 0.78216, 0.79586, 0.87965, 0.94211, 0.97747, 0.78287, 0.97926, 0.84971, 1.02988, 0.94211, 0.8801, 0.94211, 0.84971, 0.73133, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90264, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90518, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90548, 1, 1, 1, 1, 1, 1, 0.96017, 0.95794, 0.96017, 0.95794, 0.96017, 0.95794, 0.77892, 0.85162, 1, 1, 0.89552, 0.90527, 1, 0.90363, 0.92794, 0.92794, 0.92794, 0.92794, 0.87012, 0.87012, 0.87012, 0.89552, 0.89552, 1.42259, 0.71143, 1.06152, 1, 1, 1.03372, 1.03372, 0.97171, 1.4956, 2.2807, 0.93835, 0.83406, 0.91133, 0.84107, 0.91133, 1, 1, 1, 0.72021, 1, 1.23108, 0.83489, 0.88525, 0.88525, 0.81499, 0.90527, 1.81055, 0.90527, 1.81055, 1.31006, 1.53711, 0.94434, 1.08696, 1, 0.95018, 0.77192, 0.85284, 0.90747, 1.17534, 0.69825, 0.9716, 1.37077, 0.90747, 0.90747, 0.85356, 0.90747, 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572, 0.8, 0.70572, 0.70572, 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.08004, 0.91027, 1, 1, 1, 0.99862, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90727, 0.90727, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
  29113. const CalibriBoldMetrics = {
  29114. lineHeight: 1.2207,
  29115. lineGap: 0.2207
  29116. };
  29117. const CalibriBoldItalicFactors = [1.3877, 1, 1, 1, 0.97801, 0.92482, 0.89552, 0.91133, 0.81988, 0.97566, 0.98152, 0.93548, 0.93548, 1.2798, 0.85284, 0.92794, 1, 0.96134, 1.56239, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.82845, 0.82845, 0.85284, 0.85284, 0.85284, 0.75859, 0.92138, 0.83908, 0.7762, 0.71805, 0.87289, 0.73133, 0.7514, 0.81921, 0.87356, 0.95958, 0.59526, 0.75727, 0.69225, 1.04924, 0.90872, 0.85938, 0.79795, 0.87068, 0.77958, 0.69766, 0.81055, 0.90399, 0.88653, 0.96068, 0.82577, 0.77892, 0.78257, 0.97507, 1.529, 0.97507, 0.85284, 0.89552, 0.90176, 0.94908, 0.86411, 0.74012, 0.86411, 0.88323, 0.95015, 0.86411, 0.86331, 0.88401, 0.91916, 0.86304, 0.88401, 0.9039, 0.86331, 0.86331, 0.86411, 0.86411, 0.90464, 0.70852, 1.04106, 0.86331, 0.84372, 0.95794, 0.82616, 0.84548, 0.79492, 0.88331, 1.69808, 0.88331, 0.85284, 0.97801, 0.89552, 0.91133, 0.89552, 0.91133, 1.7801, 0.89552, 1.24487, 1.13254, 1.19129, 0.96839, 0.85284, 0.68787, 0.70645, 0.85592, 0.90747, 1.01466, 1.0088, 0.90323, 1, 1.07463, 1, 0.91056, 0.75806, 1.19118, 0.96839, 0.78864, 0.82845, 0.84133, 0.75859, 0.83908, 0.83908, 0.83908, 0.83908, 0.83908, 0.83908, 0.77539, 0.71805, 0.73133, 0.73133, 0.73133, 0.73133, 0.95958, 0.95958, 0.95958, 0.95958, 0.88506, 0.90872, 0.85938, 0.85938, 0.85938, 0.85938, 0.85938, 0.85284, 0.87068, 0.90399, 0.90399, 0.90399, 0.90399, 0.77892, 0.79795, 0.90807, 0.94908, 0.94908, 0.94908, 0.94908, 0.94908, 0.94908, 0.85887, 0.74012, 0.88323, 0.88323, 0.88323, 0.88323, 0.88401, 0.88401, 0.88401, 0.88401, 0.8785, 0.86331, 0.86331, 0.86331, 0.86331, 0.86331, 0.86331, 0.90747, 0.89049, 0.86331, 0.86331, 0.86331, 0.86331, 0.84548, 0.86411, 0.84548, 0.83908, 0.94908, 0.83908, 0.94908, 0.83908, 0.94908, 0.71805, 0.74012, 0.71805, 0.74012, 0.71805, 0.74012, 0.71805, 0.74012, 0.87289, 0.79538, 0.88506, 0.92726, 0.73133, 0.88323, 0.73133, 0.88323, 0.73133, 0.88323, 0.73133, 0.88323, 0.73133, 0.88323, 0.81921, 0.86411, 0.81921, 0.86411, 0.81921, 0.86411, 1, 1, 0.87356, 0.86331, 0.91075, 0.8777, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.76467, 0.90167, 0.59526, 0.91916, 1, 1, 0.86304, 0.69225, 0.88401, 1, 1, 0.70424, 0.77312, 0.91926, 0.88175, 0.70823, 0.94903, 0.90872, 0.86331, 1, 1, 0.90872, 0.86331, 0.86906, 0.88116, 0.86331, 0.85938, 0.86331, 0.85938, 0.86331, 0.85938, 0.86331, 0.87402, 0.86549, 0.77958, 0.90464, 1, 1, 0.77958, 0.90464, 0.69766, 0.70852, 0.69766, 0.70852, 0.69766, 0.70852, 0.69766, 0.70852, 1, 1, 0.81055, 0.75841, 0.81055, 1.06452, 0.90399, 0.86331, 0.90399, 0.86331, 0.90399, 0.86331, 0.90399, 0.86331, 0.90399, 0.86331, 0.90399, 0.86331, 0.96068, 0.95794, 0.77892, 0.84548, 0.77892, 0.78257, 0.79492, 0.78257, 0.79492, 0.78257, 0.79492, 0.9297, 0.56892, 0.83908, 0.94908, 0.77539, 0.85887, 0.87068, 0.89049, 1, 1, 0.81055, 1.04106, 1.20528, 1.20528, 1, 1.15543, 0.70088, 0.98387, 0.94721, 1.33431, 1.45894, 0.95161, 1.48387, 0.83908, 0.80352, 0.57118, 0.6965, 0.56347, 0.79179, 0.55853, 0.80346, 1.02988, 0.83908, 0.7762, 0.67174, 0.86036, 0.73133, 0.78257, 0.87356, 0.86441, 0.95958, 0.75727, 0.89019, 1.04924, 0.90872, 0.74889, 0.85938, 0.87891, 0.79795, 0.7957, 0.81055, 0.77892, 0.97447, 0.82577, 0.97466, 0.87179, 0.95958, 0.77892, 0.94252, 0.95612, 0.8753, 1.02988, 0.92733, 0.94252, 0.87411, 0.84021, 0.8728, 0.95612, 0.74081, 0.8753, 1.02189, 1.02988, 0.84814, 0.87445, 0.91822, 0.84723, 0.85668, 0.86331, 0.81344, 0.87581, 0.76422, 0.82046, 0.96057, 0.92733, 0.99375, 0.78022, 0.95452, 0.86015, 1.02988, 0.92733, 0.86331, 0.92733, 0.86015, 0.73133, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90631, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.88323, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.85174, 1, 1, 1, 1, 1, 1, 0.96068, 0.95794, 0.96068, 0.95794, 0.96068, 0.95794, 0.77892, 0.84548, 1, 1, 0.89552, 0.90527, 1, 0.90363, 0.92794, 0.92794, 0.92794, 0.89807, 0.87012, 0.87012, 0.87012, 0.89552, 0.89552, 1.42259, 0.71094, 1.06152, 1, 1, 1.03372, 1.03372, 0.97171, 1.4956, 2.2807, 0.92972, 0.83406, 0.91133, 0.83326, 0.91133, 1, 1, 1, 0.72021, 1, 1.23108, 0.83489, 0.88525, 0.88525, 0.81499, 0.90616, 1.81055, 0.90527, 1.81055, 1.3107, 1.53711, 0.94434, 1.08696, 1, 0.95018, 0.77192, 0.85284, 0.90747, 1.17534, 0.69825, 0.9716, 1.37077, 0.90747, 0.90747, 0.85356, 0.90747, 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572, 0.8, 0.70572, 0.70572, 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.08004, 0.91027, 1, 1, 1, 0.99862, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90727, 0.90727, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
  29118. const CalibriBoldItalicMetrics = {
  29119. lineHeight: 1.2207,
  29120. lineGap: 0.2207
  29121. };
  29122. const CalibriItalicFactors = [1.3877, 1, 1, 1, 1.17223, 1.1293, 0.89552, 0.91133, 0.80395, 1.02269, 1.15601, 0.91056, 0.91056, 1.2798, 0.85284, 0.89807, 1, 0.90861, 1.39543, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.96309, 0.96309, 0.85284, 0.85284, 0.85284, 0.83319, 0.88071, 0.8675, 0.81552, 0.72346, 0.85193, 0.73206, 0.7522, 0.81105, 0.86275, 0.90685, 0.6377, 0.77892, 0.75593, 1.02638, 0.89249, 0.84118, 0.77452, 0.85374, 0.75186, 0.67789, 0.79776, 0.88844, 0.85066, 0.94309, 0.77818, 0.7306, 0.76659, 1.10369, 1.38313, 1.10369, 1.06139, 0.89552, 0.8739, 0.9245, 0.9245, 0.83203, 0.9245, 0.85865, 1.09842, 0.9245, 0.9245, 1.03297, 1.07692, 0.90918, 1.03297, 0.94959, 0.9245, 0.92274, 0.9245, 0.9245, 1.02933, 0.77832, 1.20562, 0.9245, 0.8916, 0.98986, 0.86621, 0.89453, 0.79004, 0.94152, 1.77256, 0.94152, 0.85284, 0.97801, 0.89552, 0.91133, 0.89552, 0.91133, 1.91729, 0.89552, 1.17889, 1.13254, 1.16359, 0.92098, 0.85284, 0.68787, 0.71353, 0.84737, 0.90747, 1.0088, 1.0044, 0.87683, 1, 1.09091, 1, 0.92229, 0.739, 1.15642, 0.92098, 0.76288, 0.80504, 0.80972, 0.75859, 0.8675, 0.8675, 0.8675, 0.8675, 0.8675, 0.8675, 0.76318, 0.72346, 0.73206, 0.73206, 0.73206, 0.73206, 0.90685, 0.90685, 0.90685, 0.90685, 0.86477, 0.89249, 0.84118, 0.84118, 0.84118, 0.84118, 0.84118, 0.85284, 0.84557, 0.88844, 0.88844, 0.88844, 0.88844, 0.7306, 0.77452, 0.86331, 0.9245, 0.9245, 0.9245, 0.9245, 0.9245, 0.9245, 0.84843, 0.83203, 0.85865, 0.85865, 0.85865, 0.85865, 0.82601, 0.82601, 0.82601, 0.82601, 0.94469, 0.9245, 0.92274, 0.92274, 0.92274, 0.92274, 0.92274, 0.90747, 0.86651, 0.9245, 0.9245, 0.9245, 0.9245, 0.89453, 0.9245, 0.89453, 0.8675, 0.9245, 0.8675, 0.9245, 0.8675, 0.9245, 0.72346, 0.83203, 0.72346, 0.83203, 0.72346, 0.83203, 0.72346, 0.83203, 0.85193, 0.8875, 0.86477, 0.99034, 0.73206, 0.85865, 0.73206, 0.85865, 0.73206, 0.85865, 0.73206, 0.85865, 0.73206, 0.85865, 0.81105, 0.9245, 0.81105, 0.9245, 0.81105, 0.9245, 1, 1, 0.86275, 0.9245, 0.90872, 0.93591, 0.90685, 0.82601, 0.90685, 0.82601, 0.90685, 0.82601, 0.90685, 1.03297, 0.90685, 0.82601, 0.77896, 1.05611, 0.6377, 1.07692, 1, 1, 0.90918, 0.75593, 1.03297, 1, 1, 0.76032, 0.9375, 0.98156, 0.93407, 0.77261, 1.11429, 0.89249, 0.9245, 1, 1, 0.89249, 0.9245, 0.92534, 0.86698, 0.9245, 0.84118, 0.92274, 0.84118, 0.92274, 0.84118, 0.92274, 0.8667, 0.86291, 0.75186, 1.02933, 1, 1, 0.75186, 1.02933, 0.67789, 0.77832, 0.67789, 0.77832, 0.67789, 0.77832, 0.67789, 0.77832, 1, 1, 0.79776, 0.97655, 0.79776, 1.23023, 0.88844, 0.9245, 0.88844, 0.9245, 0.88844, 0.9245, 0.88844, 0.9245, 0.88844, 0.9245, 0.88844, 0.9245, 0.94309, 0.98986, 0.7306, 0.89453, 0.7306, 0.76659, 0.79004, 0.76659, 0.79004, 0.76659, 0.79004, 1.09231, 0.54873, 0.8675, 0.9245, 0.76318, 0.84843, 0.84557, 0.86651, 1, 1, 0.79776, 1.20562, 1.18622, 1.18622, 1, 1.1437, 0.67009, 0.96334, 0.93695, 1.35191, 1.40909, 0.95161, 1.48387, 0.8675, 0.90861, 0.6192, 0.7363, 0.64824, 0.82411, 0.56321, 0.85696, 1.23516, 0.8675, 0.81552, 0.7286, 0.84134, 0.73206, 0.76659, 0.86275, 0.84369, 0.90685, 0.77892, 0.85871, 1.02638, 0.89249, 0.75828, 0.84118, 0.85984, 0.77452, 0.76466, 0.79776, 0.7306, 0.90782, 0.77818, 0.903, 0.87291, 0.90685, 0.7306, 0.99058, 1.03667, 0.94635, 1.23516, 0.9849, 0.99058, 0.92393, 0.8916, 0.942, 1.03667, 0.75026, 0.94635, 1.0297, 1.23516, 0.90918, 0.94048, 0.98217, 0.89746, 0.84153, 0.92274, 0.82507, 0.88832, 0.84438, 0.88178, 1.03525, 0.9849, 1.00225, 0.78086, 0.97248, 0.89404, 1.23516, 0.9849, 0.92274, 0.9849, 0.89404, 0.73206, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.89693, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.85865, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90933, 1, 1, 1, 1, 1, 1, 0.94309, 0.98986, 0.94309, 0.98986, 0.94309, 0.98986, 0.7306, 0.89453, 1, 1, 0.89552, 0.90527, 1, 0.90186, 1.12308, 1.12308, 1.12308, 1.12308, 1.2566, 1.2566, 1.2566, 0.89552, 0.89552, 1.42259, 0.68994, 1.03809, 1, 1, 1.0176, 1.0176, 1.11523, 1.4956, 2.01462, 0.97858, 0.82616, 0.91133, 0.83437, 0.91133, 1, 1, 1, 0.70508, 1, 1.23108, 0.79801, 0.84426, 0.84426, 0.774, 0.90572, 1.81055, 0.90749, 1.81055, 1.28809, 1.55469, 0.94434, 1.07806, 1, 0.97094, 0.7589, 0.85284, 0.90747, 1.19658, 0.69825, 0.97622, 1.33512, 0.90747, 0.90747, 0.85284, 0.90747, 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572, 0.8, 0.70572, 0.70572, 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.0336, 0.91027, 1, 1, 1, 0.99862, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05859, 1.05859, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
  29123. const CalibriItalicMetrics = {
  29124. lineHeight: 1.2207,
  29125. lineGap: 0.2207
  29126. };
  29127. const CalibriRegularFactors = [1.3877, 1, 1, 1, 1.17223, 1.1293, 0.89552, 0.91133, 0.80395, 1.02269, 1.15601, 0.91056, 0.91056, 1.2798, 0.85284, 0.89807, 1, 0.90861, 1.39016, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.96309, 0.96309, 0.85284, 0.85284, 0.85284, 0.83319, 0.88071, 0.8675, 0.81552, 0.73834, 0.85193, 0.73206, 0.7522, 0.81105, 0.86275, 0.90685, 0.6377, 0.77892, 0.75593, 1.02638, 0.89385, 0.85122, 0.77452, 0.86503, 0.75186, 0.68887, 0.79776, 0.88844, 0.85066, 0.94258, 0.77818, 0.7306, 0.76659, 1.10369, 1.39016, 1.10369, 1.06139, 0.89552, 0.8739, 0.86128, 0.94469, 0.8457, 0.94469, 0.89464, 1.09842, 0.84636, 0.94469, 1.03297, 1.07692, 0.90918, 1.03297, 0.95897, 0.94469, 0.9482, 0.94469, 0.94469, 1.04692, 0.78223, 1.20562, 0.94469, 0.90332, 0.98986, 0.86621, 0.90527, 0.79004, 0.94152, 1.77256, 0.94152, 0.85284, 0.97801, 0.89552, 0.91133, 0.89552, 0.91133, 1.91729, 0.89552, 1.17889, 1.13254, 1.08707, 0.92098, 0.85284, 0.68787, 0.71353, 0.84737, 0.90747, 1.0088, 1.0044, 0.87683, 1, 1.09091, 1, 0.92229, 0.739, 1.15642, 0.92098, 0.76288, 0.80504, 0.80972, 0.75859, 0.8675, 0.8675, 0.8675, 0.8675, 0.8675, 0.8675, 0.76318, 0.73834, 0.73206, 0.73206, 0.73206, 0.73206, 0.90685, 0.90685, 0.90685, 0.90685, 0.86477, 0.89385, 0.85122, 0.85122, 0.85122, 0.85122, 0.85122, 0.85284, 0.85311, 0.88844, 0.88844, 0.88844, 0.88844, 0.7306, 0.77452, 0.86331, 0.86128, 0.86128, 0.86128, 0.86128, 0.86128, 0.86128, 0.8693, 0.8457, 0.89464, 0.89464, 0.89464, 0.89464, 0.82601, 0.82601, 0.82601, 0.82601, 0.94469, 0.94469, 0.9482, 0.9482, 0.9482, 0.9482, 0.9482, 0.90747, 0.86651, 0.94469, 0.94469, 0.94469, 0.94469, 0.90527, 0.94469, 0.90527, 0.8675, 0.86128, 0.8675, 0.86128, 0.8675, 0.86128, 0.73834, 0.8457, 0.73834, 0.8457, 0.73834, 0.8457, 0.73834, 0.8457, 0.85193, 0.92454, 0.86477, 0.9921, 0.73206, 0.89464, 0.73206, 0.89464, 0.73206, 0.89464, 0.73206, 0.89464, 0.73206, 0.89464, 0.81105, 0.84636, 0.81105, 0.84636, 0.81105, 0.84636, 1, 1, 0.86275, 0.94469, 0.90872, 0.95786, 0.90685, 0.82601, 0.90685, 0.82601, 0.90685, 0.82601, 0.90685, 1.03297, 0.90685, 0.82601, 0.77741, 1.05611, 0.6377, 1.07692, 1, 1, 0.90918, 0.75593, 1.03297, 1, 1, 0.76032, 0.90452, 0.98156, 1.11842, 0.77261, 1.11429, 0.89385, 0.94469, 1, 1, 0.89385, 0.94469, 0.95877, 0.86901, 0.94469, 0.85122, 0.9482, 0.85122, 0.9482, 0.85122, 0.9482, 0.8667, 0.90016, 0.75186, 1.04692, 1, 1, 0.75186, 1.04692, 0.68887, 0.78223, 0.68887, 0.78223, 0.68887, 0.78223, 0.68887, 0.78223, 1, 1, 0.79776, 0.92188, 0.79776, 1.23023, 0.88844, 0.94469, 0.88844, 0.94469, 0.88844, 0.94469, 0.88844, 0.94469, 0.88844, 0.94469, 0.88844, 0.94469, 0.94258, 0.98986, 0.7306, 0.90527, 0.7306, 0.76659, 0.79004, 0.76659, 0.79004, 0.76659, 0.79004, 1.09231, 0.54873, 0.8675, 0.86128, 0.76318, 0.8693, 0.85311, 0.86651, 1, 1, 0.79776, 1.20562, 1.18622, 1.18622, 1, 1.1437, 0.67742, 0.96334, 0.93695, 1.35191, 1.40909, 0.95161, 1.48387, 0.86686, 0.90861, 0.62267, 0.74359, 0.65649, 0.85498, 0.56963, 0.88254, 1.23516, 0.8675, 0.81552, 0.75443, 0.84503, 0.73206, 0.76659, 0.86275, 0.85122, 0.90685, 0.77892, 0.85746, 1.02638, 0.89385, 0.75657, 0.85122, 0.86275, 0.77452, 0.74171, 0.79776, 0.7306, 0.95165, 0.77818, 0.89772, 0.88831, 0.90685, 0.7306, 0.98142, 1.02191, 0.96576, 1.23516, 0.99018, 0.98142, 0.9236, 0.89258, 0.94035, 1.02191, 0.78848, 0.96576, 0.9561, 1.23516, 0.90918, 0.92578, 0.95424, 0.89746, 0.83969, 0.9482, 0.80113, 0.89442, 0.85208, 0.86155, 0.98022, 0.99018, 1.00452, 0.81209, 0.99247, 0.89181, 1.23516, 0.99018, 0.9482, 0.99018, 0.89181, 0.73206, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.88844, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.89464, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.96766, 1, 1, 1, 1, 1, 1, 0.94258, 0.98986, 0.94258, 0.98986, 0.94258, 0.98986, 0.7306, 0.90527, 1, 1, 0.89552, 0.90527, 1, 0.90186, 1.12308, 1.12308, 1.12308, 1.12308, 1.2566, 1.2566, 1.2566, 0.89552, 0.89552, 1.42259, 0.69043, 1.03809, 1, 1, 1.0176, 1.0176, 1.11523, 1.4956, 2.01462, 0.99331, 0.82616, 0.91133, 0.84286, 0.91133, 1, 1, 1, 0.70508, 1, 1.23108, 0.79801, 0.84426, 0.84426, 0.774, 0.90527, 1.81055, 0.90527, 1.81055, 1.28809, 1.55469, 0.94434, 1.07806, 1, 0.97094, 0.7589, 0.85284, 0.90747, 1.19658, 0.69825, 0.97622, 1.33512, 0.90747, 0.90747, 0.85356, 0.90747, 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572, 0.8, 0.70572, 0.70572, 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.0336, 0.91027, 1, 1, 1, 0.99862, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05859, 1.05859, 1, 1, 1, 1.07185, 0.99413, 0.96334, 1.08065, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
  29128. const CalibriRegularMetrics = {
  29129. lineHeight: 1.2207,
  29130. lineGap: 0.2207
  29131. };
  29132. ;// ./src/core/helvetica_factors.js
  29133. const HelveticaBoldFactors = [0.76116, 1, 1, 1.0006, 0.99998, 0.99974, 0.99973, 0.99973, 0.99982, 0.99977, 1.00087, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99998, 1, 1.00003, 1.00003, 1.00003, 1.00026, 0.9999, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, 0.99977, 1.0006, 0.99973, 0.99977, 1.00026, 0.99999, 0.99977, 1.00022, 1.00001, 1.00022, 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001, 1.00001, 1.00026, 0.99998, 1.0006, 0.99998, 1.00003, 0.99973, 0.99998, 0.99973, 1.00026, 0.99973, 1.00026, 0.99973, 0.99998, 1.00026, 1.00026, 1.0006, 1.0006, 0.99973, 1.0006, 0.99982, 1.00026, 1.00026, 1.00026, 1.00026, 0.99959, 0.99973, 0.99998, 1.00026, 0.99973, 1.00022, 0.99973, 0.99973, 1, 0.99959, 1.00077, 0.99959, 1.00003, 0.99998, 0.99973, 0.99973, 0.99973, 0.99973, 1.00077, 0.99973, 0.99998, 1.00025, 0.99968, 0.99973, 1.00003, 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1, 0.99973, 1.0006, 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002, 1.00026, 0.99977, 0.99977, 0.99977, 0.99977, 0.99977, 0.99977, 1, 0.99977, 1.00001, 1.00001, 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977, 0.99977, 1.00022, 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99982, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.06409, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 0.99973, 1.00026, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 1.03374, 0.99977, 1.00026, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.00042, 0.99973, 0.99973, 1.0006, 0.99977, 0.99973, 0.99973, 1.00026, 1.0006, 1.00026, 1.0006, 1.00026, 1.03828, 1.00026, 0.99999, 1.00026, 1.0006, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.9993, 0.9998, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1, 1.00016, 0.99977, 0.99959, 0.99977, 0.99959, 0.99977, 0.99959, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00026, 0.99998, 1.00026, 0.8121, 1.00026, 0.99998, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 1.00016, 1.00022, 1.00001, 0.99973, 1.00001, 1.00026, 1, 1.00026, 1, 1.00026, 1, 1.0006, 0.99973, 0.99977, 0.99973, 1, 0.99982, 1.00022, 1.00026, 1.00001, 0.99973, 1.00026, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 1.00034, 0.99977, 1, 0.99997, 1.00026, 1.00078, 1.00036, 0.99973, 1.00013, 1.0006, 0.99977, 0.99977, 0.99988, 0.85148, 1.00001, 1.00026, 0.99977, 1.00022, 1.0006, 0.99977, 1.00001, 0.99999, 0.99977, 1.00069, 1.00022, 0.99977, 1.00001, 0.99984, 1.00026, 1.00001, 1.00024, 1.00001, 0.9999, 1, 1.0006, 1.00001, 1.00041, 0.99962, 1.00026, 1.0006, 0.99995, 1.00041, 0.99942, 0.99973, 0.99927, 1.00082, 0.99902, 1.00026, 1.00087, 1.0006, 1.00069, 0.99973, 0.99867, 0.99973, 0.9993, 1.00026, 1.00049, 1.00056, 1, 0.99988, 0.99935, 0.99995, 0.99954, 1.00055, 0.99945, 1.00032, 1.0006, 0.99995, 1.00026, 0.99995, 1.00032, 1.00001, 1.00008, 0.99971, 1.00019, 0.9994, 1.00001, 1.0006, 1.00044, 0.99973, 1.00023, 1.00047, 1, 0.99942, 0.99561, 0.99989, 1.00035, 0.99977, 1.00035, 0.99977, 1.00019, 0.99944, 1.00001, 1.00021, 0.99926, 1.00035, 1.00035, 0.99942, 1.00048, 0.99999, 0.99977, 1.00022, 1.00035, 1.00001, 0.99977, 1.00026, 0.99989, 1.00057, 1.00001, 0.99936, 1.00052, 1.00012, 0.99996, 1.00043, 1, 1.00035, 0.9994, 0.99976, 1.00035, 0.99973, 1.00052, 1.00041, 1.00119, 1.00037, 0.99973, 1.00002, 0.99986, 1.00041, 1.00041, 0.99902, 0.9996, 1.00034, 0.99999, 1.00026, 0.99999, 1.00026, 0.99973, 1.00052, 0.99973, 1, 0.99973, 1.00041, 1.00075, 0.9994, 1.0003, 0.99999, 1, 1.00041, 0.99955, 1, 0.99915, 0.99973, 0.99973, 1.00026, 1.00119, 0.99955, 0.99973, 1.0006, 0.99911, 1.0006, 1.00026, 0.99972, 1.00026, 0.99902, 1.00041, 0.99973, 0.99999, 1, 1, 1.00038, 1.0005, 1.00016, 1.00022, 1.00016, 1.00022, 1.00016, 1.00022, 1.00001, 0.99973, 1, 1, 0.99973, 1, 1, 0.99955, 1.0006, 1.0006, 1.0006, 1.0006, 1, 1, 1, 0.99973, 0.99973, 0.99972, 1, 1, 1.00106, 0.99999, 0.99998, 0.99998, 0.99999, 0.99998, 1.66475, 1, 0.99973, 0.99973, 1.00023, 0.99973, 0.99971, 1.00047, 1.00023, 1, 0.99991, 0.99984, 1.00002, 1.00002, 1.00002, 1.00002, 1, 1, 1, 1, 1, 1, 1, 0.99972, 1, 1.20985, 1.39713, 1.00003, 1.00031, 1.00015, 1, 0.99561, 1.00027, 1.00031, 1.00031, 0.99915, 1.00031, 1.00031, 0.99999, 1.00003, 0.99999, 0.99999, 1.41144, 1.6, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.40579, 1.40579, 1.36625, 0.99999, 1, 0.99861, 0.99861, 1, 1.00026, 1.00026, 1.00026, 1.00026, 0.99972, 0.99999, 0.99999, 0.99999, 0.99999, 1.40483, 1, 0.99977, 1.00054, 1, 1, 0.99953, 0.99962, 1.00042, 0.9995, 1, 1, 1, 1, 1, 1, 1, 1, 0.99998, 0.99998, 0.99998, 0.99998, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
  29134. const HelveticaBoldMetrics = {
  29135. lineHeight: 1.2,
  29136. lineGap: 0.2
  29137. };
  29138. const HelveticaBoldItalicFactors = [0.76116, 1, 1, 1.0006, 0.99998, 0.99974, 0.99973, 0.99973, 0.99982, 0.99977, 1.00087, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99998, 1, 1.00003, 1.00003, 1.00003, 1.00026, 0.9999, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, 0.99977, 1.0006, 0.99973, 0.99977, 1.00026, 0.99999, 0.99977, 1.00022, 1.00001, 1.00022, 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001, 1.00001, 1.00026, 0.99998, 1.0006, 0.99998, 1.00003, 0.99973, 0.99998, 0.99973, 1.00026, 0.99973, 1.00026, 0.99973, 0.99998, 1.00026, 1.00026, 1.0006, 1.0006, 0.99973, 1.0006, 0.99982, 1.00026, 1.00026, 1.00026, 1.00026, 0.99959, 0.99973, 0.99998, 1.00026, 0.99973, 1.00022, 0.99973, 0.99973, 1, 0.99959, 1.00077, 0.99959, 1.00003, 0.99998, 0.99973, 0.99973, 0.99973, 0.99973, 1.00077, 0.99973, 0.99998, 1.00025, 0.99968, 0.99973, 1.00003, 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1, 0.99973, 1.0006, 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002, 1.00026, 0.99977, 0.99977, 0.99977, 0.99977, 0.99977, 0.99977, 1, 0.99977, 1.00001, 1.00001, 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977, 0.99977, 1.00022, 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99982, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.06409, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 0.99973, 1.00026, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 1.0044, 0.99977, 1.00026, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 0.99971, 0.99973, 0.99973, 1.0006, 0.99977, 0.99973, 0.99973, 1.00026, 1.0006, 1.00026, 1.0006, 1.00026, 1.01011, 1.00026, 0.99999, 1.00026, 1.0006, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.9993, 0.9998, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1, 1.00016, 0.99977, 0.99959, 0.99977, 0.99959, 0.99977, 0.99959, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00026, 0.99998, 1.00026, 0.8121, 1.00026, 0.99998, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 1.00016, 1.00022, 1.00001, 0.99973, 1.00001, 1.00026, 1, 1.00026, 1, 1.00026, 1, 1.0006, 0.99973, 0.99977, 0.99973, 1, 0.99982, 1.00022, 1.00026, 1.00001, 0.99973, 1.00026, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99977, 1, 1, 1.00026, 0.99969, 0.99972, 0.99981, 0.9998, 1.0006, 0.99977, 0.99977, 1.00022, 0.91155, 1.00001, 1.00026, 0.99977, 1.00022, 1.0006, 0.99977, 1.00001, 0.99999, 0.99977, 0.99966, 1.00022, 1.00032, 1.00001, 0.99944, 1.00026, 1.00001, 0.99968, 1.00001, 1.00047, 1, 1.0006, 1.00001, 0.99981, 1.00101, 1.00026, 1.0006, 0.99948, 0.99981, 1.00064, 0.99973, 0.99942, 1.00101, 1.00061, 1.00026, 1.00069, 1.0006, 1.00014, 0.99973, 1.01322, 0.99973, 1.00065, 1.00026, 1.00012, 0.99923, 1, 1.00064, 1.00076, 0.99948, 1.00055, 1.00063, 1.00007, 0.99943, 1.0006, 0.99948, 1.00026, 0.99948, 0.99943, 1.00001, 1.00001, 1.00029, 1.00038, 1.00035, 1.00001, 1.0006, 1.0006, 0.99973, 0.99978, 1.00001, 1.00057, 0.99989, 0.99967, 0.99964, 0.99967, 0.99977, 0.99999, 0.99977, 1.00038, 0.99977, 1.00001, 0.99973, 1.00066, 0.99967, 0.99967, 1.00041, 0.99998, 0.99999, 0.99977, 1.00022, 0.99967, 1.00001, 0.99977, 1.00026, 0.99964, 1.00031, 1.00001, 0.99999, 0.99999, 1, 1.00023, 1, 1, 0.99999, 1.00035, 1.00001, 0.99999, 0.99973, 0.99977, 0.99999, 1.00058, 0.99973, 0.99973, 0.99955, 0.9995, 1.00026, 1.00026, 1.00032, 0.99989, 1.00034, 0.99999, 1.00026, 1.00026, 1.00026, 0.99973, 0.45998, 0.99973, 1.00026, 0.99973, 1.00001, 0.99999, 0.99982, 0.99994, 0.99996, 1, 1.00042, 1.00044, 1.00029, 1.00023, 0.99973, 0.99973, 1.00026, 0.99949, 1.00002, 0.99973, 1.0006, 1.0006, 1.0006, 0.99975, 1.00026, 1.00026, 1.00032, 0.98685, 0.99973, 1.00026, 1, 1, 0.99966, 1.00044, 1.00016, 1.00022, 1.00016, 1.00022, 1.00016, 1.00022, 1.00001, 0.99973, 1, 1, 0.99973, 1, 1, 0.99955, 1.0006, 1.0006, 1.0006, 1.0006, 1, 1, 1, 0.99973, 0.99973, 0.99972, 1, 1, 1.00106, 0.99999, 0.99998, 0.99998, 0.99999, 0.99998, 1.66475, 1, 0.99973, 0.99973, 1, 0.99973, 0.99971, 0.99978, 1, 1, 0.99991, 0.99984, 1.00002, 1.00002, 1.00002, 1.00002, 1.00098, 1, 1, 1, 1.00049, 1, 1, 0.99972, 1, 1.20985, 1.39713, 1.00003, 1.00031, 1.00015, 1, 0.99561, 1.00027, 1.00031, 1.00031, 0.99915, 1.00031, 1.00031, 0.99999, 1.00003, 0.99999, 0.99999, 1.41144, 1.6, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.40579, 1.40579, 1.36625, 0.99999, 1, 0.99861, 0.99861, 1, 1.00026, 1.00026, 1.00026, 1.00026, 0.99972, 0.99999, 0.99999, 0.99999, 0.99999, 1.40483, 1, 0.99977, 1.00054, 1, 1, 0.99953, 0.99962, 1.00042, 0.9995, 1, 1, 1, 1, 1, 1, 1, 1, 0.99998, 0.99998, 0.99998, 0.99998, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
  29139. const HelveticaBoldItalicMetrics = {
  29140. lineHeight: 1.35,
  29141. lineGap: 0.2
  29142. };
  29143. const HelveticaItalicFactors = [0.76116, 1, 1, 1.0006, 1.0006, 1.00006, 0.99973, 0.99973, 0.99982, 1.00001, 1.00043, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1, 1.00003, 1.00003, 1.00003, 0.99973, 0.99987, 1.00001, 1.00001, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, 0.99977, 1.0006, 1, 1.00001, 0.99973, 0.99999, 0.99977, 1.00022, 1.00001, 1.00022, 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001, 1.00001, 1.00026, 1.0006, 1.0006, 1.0006, 0.99949, 0.99973, 0.99998, 0.99973, 0.99973, 1, 0.99973, 0.99973, 1.0006, 0.99973, 0.99973, 0.99924, 0.99924, 1, 0.99924, 0.99999, 0.99973, 0.99973, 0.99973, 0.99973, 0.99998, 1, 1.0006, 0.99973, 1, 0.99977, 1, 1, 1, 1.00005, 1.0009, 1.00005, 1.00003, 0.99998, 0.99973, 0.99973, 0.99973, 0.99973, 1.0009, 0.99973, 0.99998, 1.00025, 0.99968, 0.99973, 1.00003, 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1, 0.9998, 1.0006, 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002, 1.00026, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, 1, 0.99977, 1.00001, 1.00001, 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977, 0.99977, 1.00022, 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99982, 1, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.06409, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 1, 0.99973, 1, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 0.99977, 1, 0.99977, 1, 0.99977, 1, 0.99977, 1, 0.99977, 1.0288, 0.99977, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 0.99924, 1.0006, 1.0006, 0.99946, 1.00034, 1, 0.99924, 1.00001, 1, 1, 0.99973, 0.99924, 0.99973, 0.99924, 0.99973, 1.06311, 0.99973, 1.00024, 0.99973, 0.99924, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.00041, 0.9998, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1, 1.00016, 0.99977, 0.99998, 0.99977, 0.99998, 0.99977, 0.99998, 1.00001, 1, 1.00001, 1, 1.00001, 1, 1.00001, 1, 1.00026, 1.0006, 1.00026, 0.89547, 1.00026, 1.0006, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.00016, 0.99977, 1.00001, 1, 1.00001, 1.00026, 1, 1.00026, 1, 1.00026, 1, 0.99924, 0.99973, 1.00001, 0.99973, 1, 0.99982, 1.00022, 1.00026, 1.00001, 1, 1.00026, 1.0006, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 1.00001, 1, 1.00054, 0.99977, 1.00084, 1.00007, 0.99973, 1.00013, 0.99924, 1.00001, 1.00001, 0.99945, 0.91221, 1.00001, 1.00026, 0.99977, 1.00022, 1.0006, 1.00001, 1.00001, 0.99999, 0.99977, 0.99933, 1.00022, 1.00054, 1.00001, 1.00065, 1.00026, 1.00001, 1.0001, 1.00001, 1.00052, 1, 1.0006, 1.00001, 0.99945, 0.99897, 0.99968, 0.99924, 1.00036, 0.99945, 0.99949, 1, 1.0006, 0.99897, 0.99918, 0.99968, 0.99911, 0.99924, 1, 0.99962, 1.01487, 1, 1.0005, 0.99973, 1.00012, 1.00043, 1, 0.99995, 0.99994, 1.00036, 0.99947, 1.00019, 1.00063, 1.00025, 0.99924, 1.00036, 0.99973, 1.00036, 1.00025, 1.00001, 1.00001, 1.00027, 1.0001, 1.00068, 1.00001, 1.0006, 1.0006, 1, 1.00008, 0.99957, 0.99972, 0.9994, 0.99954, 0.99975, 1.00051, 1.00001, 1.00019, 1.00001, 1.0001, 0.99986, 1.00001, 1.00001, 1.00038, 0.99954, 0.99954, 0.9994, 1.00066, 0.99999, 0.99977, 1.00022, 1.00054, 1.00001, 0.99977, 1.00026, 0.99975, 1.0001, 1.00001, 0.99993, 0.9995, 0.99955, 1.00016, 0.99978, 0.99974, 1.00019, 1.00022, 0.99955, 1.00053, 0.99973, 1.00089, 1.00005, 0.99967, 1.00048, 0.99973, 1.00002, 1.00034, 0.99973, 0.99973, 0.99964, 1.00006, 1.00066, 0.99947, 0.99973, 0.98894, 0.99973, 1, 0.44898, 1, 0.99946, 1, 1.00039, 1.00082, 0.99991, 0.99991, 0.99985, 1.00022, 1.00023, 1.00061, 1.00006, 0.99966, 0.99973, 0.99973, 0.99973, 1.00019, 1.0008, 1, 0.99924, 0.99924, 0.99924, 0.99983, 1.00044, 0.99973, 0.99964, 0.98332, 1, 0.99973, 1, 1, 0.99962, 0.99895, 1.00016, 0.99977, 1.00016, 0.99977, 1.00016, 0.99977, 1.00001, 1, 1, 1, 0.99973, 1, 1, 0.99955, 0.99924, 0.99924, 0.99924, 0.99924, 0.99998, 0.99998, 0.99998, 0.99973, 0.99973, 0.99972, 1, 1, 1.00267, 0.99999, 0.99998, 0.99998, 1, 0.99998, 1.66475, 1, 0.99973, 0.99973, 1.00023, 0.99973, 1.00423, 0.99925, 0.99999, 1, 0.99991, 0.99984, 1.00002, 1.00002, 1.00002, 1.00002, 1.00049, 1, 1.00245, 1, 1, 1, 1, 0.96329, 1, 1.20985, 1.39713, 1.00003, 0.8254, 1.00015, 1, 1.00035, 1.00027, 1.00031, 1.00031, 1.00003, 1.00031, 1.00031, 0.99999, 1.00003, 0.99999, 0.99999, 1.41144, 1.6, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.40579, 1.40579, 1.36625, 0.99999, 1, 0.99861, 0.99861, 1, 1.00026, 1.00026, 1.00026, 1.00026, 0.95317, 0.99999, 0.99999, 0.99999, 0.99999, 1.40483, 1, 0.99977, 1.00054, 1, 1, 0.99953, 0.99962, 1.00042, 0.9995, 1, 1, 1, 1, 1, 1, 1, 1, 0.99998, 0.99998, 0.99998, 0.99998, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
  29144. const HelveticaItalicMetrics = {
  29145. lineHeight: 1.35,
  29146. lineGap: 0.2
  29147. };
  29148. const HelveticaRegularFactors = [0.76116, 1, 1, 1.0006, 1.0006, 1.00006, 0.99973, 0.99973, 0.99982, 1.00001, 1.00043, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1, 1.00003, 1.00003, 1.00003, 0.99973, 0.99987, 1.00001, 1.00001, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, 0.99977, 1.0006, 1, 1.00001, 0.99973, 0.99999, 0.99977, 1.00022, 1.00001, 1.00022, 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001, 1.00001, 1.00026, 1.0006, 1.0006, 1.0006, 0.99949, 0.99973, 0.99998, 0.99973, 0.99973, 1, 0.99973, 0.99973, 1.0006, 0.99973, 0.99973, 0.99924, 0.99924, 1, 0.99924, 0.99999, 0.99973, 0.99973, 0.99973, 0.99973, 0.99998, 1, 1.0006, 0.99973, 1, 0.99977, 1, 1, 1, 1.00005, 1.0009, 1.00005, 1.00003, 0.99998, 0.99973, 0.99973, 0.99973, 0.99973, 1.0009, 0.99973, 0.99998, 1.00025, 0.99968, 0.99973, 1.00003, 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1, 0.9998, 1.0006, 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002, 1.00026, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, 1, 0.99977, 1.00001, 1.00001, 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977, 0.99977, 1.00022, 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99982, 1, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.06409, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 1, 0.99973, 1, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 0.99977, 1, 0.99977, 1, 0.99977, 1, 0.99977, 1, 0.99977, 1.04596, 0.99977, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 0.99924, 1.0006, 1.0006, 1.00019, 1.00034, 1, 0.99924, 1.00001, 1, 1, 0.99973, 0.99924, 0.99973, 0.99924, 0.99973, 1.02572, 0.99973, 1.00005, 0.99973, 0.99924, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99999, 0.9998, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1, 1.00016, 0.99977, 0.99998, 0.99977, 0.99998, 0.99977, 0.99998, 1.00001, 1, 1.00001, 1, 1.00001, 1, 1.00001, 1, 1.00026, 1.0006, 1.00026, 0.84533, 1.00026, 1.0006, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.00016, 0.99977, 1.00001, 1, 1.00001, 1.00026, 1, 1.00026, 1, 1.00026, 1, 0.99924, 0.99973, 1.00001, 0.99973, 1, 0.99982, 1.00022, 1.00026, 1.00001, 1, 1.00026, 1.0006, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99928, 1, 0.99977, 1.00013, 1.00055, 0.99947, 0.99945, 0.99941, 0.99924, 1.00001, 1.00001, 1.0004, 0.91621, 1.00001, 1.00026, 0.99977, 1.00022, 1.0006, 1.00001, 1.00005, 0.99999, 0.99977, 1.00015, 1.00022, 0.99977, 1.00001, 0.99973, 1.00026, 1.00001, 1.00019, 1.00001, 0.99946, 1, 1.0006, 1.00001, 0.99978, 1.00045, 0.99973, 0.99924, 1.00023, 0.99978, 0.99966, 1, 1.00065, 1.00045, 1.00019, 0.99973, 0.99973, 0.99924, 1, 1, 0.96499, 1, 1.00055, 0.99973, 1.00008, 1.00027, 1, 0.9997, 0.99995, 1.00023, 0.99933, 1.00019, 1.00015, 1.00031, 0.99924, 1.00023, 0.99973, 1.00023, 1.00031, 1.00001, 0.99928, 1.00029, 1.00092, 1.00035, 1.00001, 1.0006, 1.0006, 1, 0.99988, 0.99975, 1, 1.00082, 0.99561, 0.9996, 1.00035, 1.00001, 0.99962, 1.00001, 1.00092, 0.99964, 1.00001, 0.99963, 0.99999, 1.00035, 1.00035, 1.00082, 0.99962, 0.99999, 0.99977, 1.00022, 1.00035, 1.00001, 0.99977, 1.00026, 0.9996, 0.99967, 1.00001, 1.00034, 1.00074, 1.00054, 1.00053, 1.00063, 0.99971, 0.99962, 1.00035, 0.99975, 0.99977, 0.99973, 1.00043, 0.99953, 1.0007, 0.99915, 0.99973, 1.00008, 0.99892, 1.00073, 1.00073, 1.00114, 0.99915, 1.00073, 0.99955, 0.99973, 1.00092, 0.99973, 1, 0.99998, 1, 1.0003, 1, 1.00043, 1.00001, 0.99969, 1.0003, 1, 1.00035, 1.00001, 0.9995, 1, 1.00092, 0.99973, 0.99973, 0.99973, 1.0007, 0.9995, 1, 0.99924, 1.0006, 0.99924, 0.99972, 1.00062, 0.99973, 1.00114, 1.00073, 1, 0.99955, 1, 1, 1.00047, 0.99968, 1.00016, 0.99977, 1.00016, 0.99977, 1.00016, 0.99977, 1.00001, 1, 1, 1, 0.99973, 1, 1, 0.99955, 0.99924, 0.99924, 0.99924, 0.99924, 0.99998, 0.99998, 0.99998, 0.99973, 0.99973, 0.99972, 1, 1, 1.00267, 0.99999, 0.99998, 0.99998, 1, 0.99998, 1.66475, 1, 0.99973, 0.99973, 1.00023, 0.99973, 0.99971, 0.99925, 1.00023, 1, 0.99991, 0.99984, 1.00002, 1.00002, 1.00002, 1.00002, 1, 1, 1, 1, 1, 1, 1, 0.96329, 1, 1.20985, 1.39713, 1.00003, 0.8254, 1.00015, 1, 1.00035, 1.00027, 1.00031, 1.00031, 0.99915, 1.00031, 1.00031, 0.99999, 1.00003, 0.99999, 0.99999, 1.41144, 1.6, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.40579, 1.40579, 1.36625, 0.99999, 1, 0.99861, 0.99861, 1, 1.00026, 1.00026, 1.00026, 1.00026, 0.95317, 0.99999, 0.99999, 0.99999, 0.99999, 1.40483, 1, 0.99977, 1.00054, 1, 1, 0.99953, 0.99962, 1.00042, 0.9995, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
  29149. const HelveticaRegularMetrics = {
  29150. lineHeight: 1.2,
  29151. lineGap: 0.2
  29152. };
  29153. ;// ./src/core/liberationsans_widths.js
  29154. const LiberationSansBoldWidths = [365, 0, 333, 278, 333, 474, 556, 556, 889, 722, 238, 333, 333, 389, 584, 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 333, 333, 584, 584, 584, 611, 975, 722, 722, 722, 722, 667, 611, 778, 722, 278, 556, 722, 611, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 333, 278, 333, 584, 556, 333, 556, 611, 556, 611, 556, 333, 611, 611, 278, 278, 556, 278, 889, 611, 611, 611, 611, 389, 556, 333, 611, 556, 778, 556, 556, 500, 389, 280, 389, 584, 333, 556, 556, 556, 556, 280, 556, 333, 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 556, 278, 333, 333, 365, 556, 834, 834, 834, 611, 722, 722, 722, 722, 722, 722, 1000, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 556, 556, 556, 556, 556, 278, 278, 278, 278, 611, 611, 611, 611, 611, 611, 611, 549, 611, 611, 611, 611, 611, 556, 611, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 719, 722, 611, 667, 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 611, 778, 611, 778, 611, 778, 611, 722, 611, 722, 611, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 785, 556, 556, 278, 722, 556, 556, 611, 278, 611, 278, 611, 385, 611, 479, 611, 278, 722, 611, 722, 611, 722, 611, 708, 723, 611, 778, 611, 778, 611, 778, 611, 1000, 944, 722, 389, 722, 389, 722, 389, 667, 556, 667, 556, 667, 556, 667, 556, 611, 333, 611, 479, 611, 333, 722, 611, 722, 611, 722, 611, 722, 611, 722, 611, 722, 611, 944, 778, 667, 556, 667, 611, 500, 611, 500, 611, 500, 278, 556, 722, 556, 1000, 889, 778, 611, 667, 556, 611, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 465, 722, 333, 853, 906, 474, 825, 927, 838, 278, 722, 722, 601, 719, 667, 611, 722, 778, 278, 722, 667, 833, 722, 644, 778, 722, 667, 600, 611, 667, 821, 667, 809, 802, 278, 667, 615, 451, 611, 278, 582, 615, 610, 556, 606, 475, 460, 611, 541, 278, 558, 556, 612, 556, 445, 611, 766, 619, 520, 684, 446, 582, 715, 576, 753, 845, 278, 582, 611, 582, 845, 667, 669, 885, 567, 711, 667, 278, 276, 556, 1094, 1062, 875, 610, 722, 622, 719, 722, 719, 722, 567, 712, 667, 904, 626, 719, 719, 610, 702, 833, 722, 778, 719, 667, 722, 611, 622, 854, 667, 730, 703, 1005, 1019, 870, 979, 719, 711, 1031, 719, 556, 618, 615, 417, 635, 556, 709, 497, 615, 615, 500, 635, 740, 604, 611, 604, 611, 556, 490, 556, 875, 556, 615, 581, 833, 844, 729, 854, 615, 552, 854, 583, 556, 556, 611, 417, 552, 556, 278, 281, 278, 969, 906, 611, 500, 615, 556, 604, 778, 611, 487, 447, 944, 778, 944, 778, 944, 778, 667, 556, 333, 333, 556, 1000, 1000, 552, 278, 278, 278, 278, 500, 500, 500, 556, 556, 350, 1000, 1000, 240, 479, 333, 333, 604, 333, 167, 396, 556, 556, 1094, 556, 885, 489, 1115, 1000, 768, 600, 834, 834, 834, 834, 1000, 500, 1000, 500, 1000, 500, 500, 494, 612, 823, 713, 584, 549, 713, 979, 722, 274, 549, 549, 583, 549, 549, 604, 584, 604, 604, 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 729, 604, 604, 354, 354, 1000, 990, 990, 990, 990, 494, 604, 604, 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, 750, 611, 611, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 333, 333, 333, 333, 333, 333, 333, 333];
  29155. const LiberationSansBoldMapping = [-1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538, 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904, 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1138, 1139, 1168, 1169, 7808, 7809, 7810, 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211, 8212, 8213, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226, 8230, 8240, 8242, 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359, 8364, 8453, 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593, 8594, 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735, 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, 9474, 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9600, 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, 9633, 9642, 9643, 9644, 9650, 9658, 9660, 9668, 9674, 9675, 9679, 9688, 9689, 9702, 9786, 9787, 9788, 9792, 9794, 9824, 9827, 9829, 9830, 9834, 9835, 9836, 61441, 61442, 61445, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1];
  29156. const LiberationSansBoldItalicWidths = [365, 0, 333, 278, 333, 474, 556, 556, 889, 722, 238, 333, 333, 389, 584, 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 333, 333, 584, 584, 584, 611, 975, 722, 722, 722, 722, 667, 611, 778, 722, 278, 556, 722, 611, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 333, 278, 333, 584, 556, 333, 556, 611, 556, 611, 556, 333, 611, 611, 278, 278, 556, 278, 889, 611, 611, 611, 611, 389, 556, 333, 611, 556, 778, 556, 556, 500, 389, 280, 389, 584, 333, 556, 556, 556, 556, 280, 556, 333, 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 556, 278, 333, 333, 365, 556, 834, 834, 834, 611, 722, 722, 722, 722, 722, 722, 1000, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 556, 556, 556, 556, 556, 278, 278, 278, 278, 611, 611, 611, 611, 611, 611, 611, 549, 611, 611, 611, 611, 611, 556, 611, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 740, 722, 611, 667, 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 611, 778, 611, 778, 611, 778, 611, 722, 611, 722, 611, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 782, 556, 556, 278, 722, 556, 556, 611, 278, 611, 278, 611, 396, 611, 479, 611, 278, 722, 611, 722, 611, 722, 611, 708, 723, 611, 778, 611, 778, 611, 778, 611, 1000, 944, 722, 389, 722, 389, 722, 389, 667, 556, 667, 556, 667, 556, 667, 556, 611, 333, 611, 479, 611, 333, 722, 611, 722, 611, 722, 611, 722, 611, 722, 611, 722, 611, 944, 778, 667, 556, 667, 611, 500, 611, 500, 611, 500, 278, 556, 722, 556, 1000, 889, 778, 611, 667, 556, 611, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 722, 333, 854, 906, 473, 844, 930, 847, 278, 722, 722, 610, 671, 667, 611, 722, 778, 278, 722, 667, 833, 722, 657, 778, 718, 667, 590, 611, 667, 822, 667, 829, 781, 278, 667, 620, 479, 611, 278, 591, 620, 621, 556, 610, 479, 492, 611, 558, 278, 566, 556, 603, 556, 450, 611, 712, 605, 532, 664, 409, 591, 704, 578, 773, 834, 278, 591, 611, 591, 834, 667, 667, 886, 614, 719, 667, 278, 278, 556, 1094, 1042, 854, 622, 719, 677, 719, 722, 708, 722, 614, 722, 667, 927, 643, 719, 719, 615, 687, 833, 722, 778, 719, 667, 722, 611, 677, 781, 667, 729, 708, 979, 989, 854, 1000, 708, 719, 1042, 729, 556, 619, 604, 534, 618, 556, 736, 510, 611, 611, 507, 622, 740, 604, 611, 611, 611, 556, 889, 556, 885, 556, 646, 583, 889, 935, 707, 854, 594, 552, 865, 589, 556, 556, 611, 469, 563, 556, 278, 278, 278, 969, 906, 611, 507, 619, 556, 611, 778, 611, 575, 467, 944, 778, 944, 778, 944, 778, 667, 556, 333, 333, 556, 1000, 1000, 552, 278, 278, 278, 278, 500, 500, 500, 556, 556, 350, 1000, 1000, 240, 479, 333, 333, 604, 333, 167, 396, 556, 556, 1104, 556, 885, 516, 1146, 1000, 768, 600, 834, 834, 834, 834, 999, 500, 1000, 500, 1000, 500, 500, 494, 612, 823, 713, 584, 549, 713, 979, 722, 274, 549, 549, 583, 549, 549, 604, 584, 604, 604, 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 729, 604, 604, 354, 354, 1000, 990, 990, 990, 990, 494, 604, 604, 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, 750, 611, 611, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 333, 333, 333, 333, 333, 333, 333, 333];
  29157. const LiberationSansBoldItalicMapping = [-1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538, 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904, 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1138, 1139, 1168, 1169, 7808, 7809, 7810, 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211, 8212, 8213, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226, 8230, 8240, 8242, 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359, 8364, 8453, 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593, 8594, 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735, 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, 9474, 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9600, 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, 9633, 9642, 9643, 9644, 9650, 9658, 9660, 9668, 9674, 9675, 9679, 9688, 9689, 9702, 9786, 9787, 9788, 9792, 9794, 9824, 9827, 9829, 9830, 9834, 9835, 9836, 61441, 61442, 61445, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1];
  29158. const LiberationSansItalicWidths = [365, 0, 333, 278, 278, 355, 556, 556, 889, 667, 191, 333, 333, 389, 584, 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 278, 278, 584, 584, 584, 556, 1015, 667, 667, 722, 722, 667, 611, 778, 722, 278, 500, 667, 556, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 278, 278, 278, 469, 556, 333, 556, 556, 500, 556, 556, 278, 556, 556, 222, 222, 500, 222, 833, 556, 556, 556, 556, 333, 500, 278, 556, 500, 722, 500, 500, 500, 334, 260, 334, 584, 333, 556, 556, 556, 556, 260, 556, 333, 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 537, 278, 333, 333, 365, 556, 834, 834, 834, 611, 667, 667, 667, 667, 667, 667, 1000, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 500, 556, 556, 556, 556, 278, 278, 278, 278, 556, 556, 556, 556, 556, 556, 556, 549, 611, 556, 556, 556, 556, 500, 556, 500, 667, 556, 667, 556, 667, 556, 722, 500, 722, 500, 722, 500, 722, 500, 722, 625, 722, 556, 667, 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 556, 778, 556, 778, 556, 778, 556, 722, 556, 722, 556, 278, 278, 278, 278, 278, 278, 278, 222, 278, 278, 733, 444, 500, 222, 667, 500, 500, 556, 222, 556, 222, 556, 281, 556, 400, 556, 222, 722, 556, 722, 556, 722, 556, 615, 723, 556, 778, 556, 778, 556, 778, 556, 1000, 944, 722, 333, 722, 333, 722, 333, 667, 500, 667, 500, 667, 500, 667, 500, 611, 278, 611, 354, 611, 278, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 944, 722, 667, 500, 667, 611, 500, 611, 500, 611, 500, 222, 556, 667, 556, 1000, 889, 778, 611, 667, 500, 611, 278, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 667, 278, 789, 846, 389, 794, 865, 775, 222, 667, 667, 570, 671, 667, 611, 722, 778, 278, 667, 667, 833, 722, 648, 778, 725, 667, 600, 611, 667, 837, 667, 831, 761, 278, 667, 570, 439, 555, 222, 550, 570, 571, 500, 556, 439, 463, 555, 542, 222, 500, 492, 548, 500, 447, 556, 670, 573, 486, 603, 374, 550, 652, 546, 728, 779, 222, 550, 556, 550, 779, 667, 667, 843, 544, 708, 667, 278, 278, 500, 1066, 982, 844, 589, 715, 639, 724, 667, 651, 667, 544, 704, 667, 917, 614, 715, 715, 589, 686, 833, 722, 778, 725, 667, 722, 611, 639, 795, 667, 727, 673, 920, 923, 805, 886, 651, 694, 1022, 682, 556, 562, 522, 493, 553, 556, 688, 465, 556, 556, 472, 564, 686, 550, 556, 556, 556, 500, 833, 500, 835, 500, 572, 518, 830, 851, 621, 736, 526, 492, 752, 534, 556, 556, 556, 378, 496, 500, 222, 222, 222, 910, 828, 556, 472, 565, 500, 556, 778, 556, 492, 339, 944, 722, 944, 722, 944, 722, 667, 500, 333, 333, 556, 1000, 1000, 552, 222, 222, 222, 222, 333, 333, 333, 556, 556, 350, 1000, 1000, 188, 354, 333, 333, 500, 333, 167, 365, 556, 556, 1094, 556, 885, 323, 1083, 1000, 768, 600, 834, 834, 834, 834, 1000, 500, 998, 500, 1000, 500, 500, 494, 612, 823, 713, 584, 549, 713, 979, 719, 274, 549, 549, 584, 549, 549, 604, 584, 604, 604, 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 729, 604, 604, 354, 354, 1000, 990, 990, 990, 990, 494, 604, 604, 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, 750, 500, 500, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 294, 294, 324, 324, 316, 328, 398, 285];
  29159. const LiberationSansItalicMapping = [-1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538, 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904, 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1138, 1139, 1168, 1169, 7808, 7809, 7810, 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211, 8212, 8213, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226, 8230, 8240, 8242, 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359, 8364, 8453, 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593, 8594, 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735, 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, 9474, 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9600, 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, 9633, 9642, 9643, 9644, 9650, 9658, 9660, 9668, 9674, 9675, 9679, 9688, 9689, 9702, 9786, 9787, 9788, 9792, 9794, 9824, 9827, 9829, 9830, 9834, 9835, 9836, 61441, 61442, 61445, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1];
  29160. const LiberationSansRegularWidths = [365, 0, 333, 278, 278, 355, 556, 556, 889, 667, 191, 333, 333, 389, 584, 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 278, 278, 584, 584, 584, 556, 1015, 667, 667, 722, 722, 667, 611, 778, 722, 278, 500, 667, 556, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 278, 278, 278, 469, 556, 333, 556, 556, 500, 556, 556, 278, 556, 556, 222, 222, 500, 222, 833, 556, 556, 556, 556, 333, 500, 278, 556, 500, 722, 500, 500, 500, 334, 260, 334, 584, 333, 556, 556, 556, 556, 260, 556, 333, 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 537, 278, 333, 333, 365, 556, 834, 834, 834, 611, 667, 667, 667, 667, 667, 667, 1000, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 500, 556, 556, 556, 556, 278, 278, 278, 278, 556, 556, 556, 556, 556, 556, 556, 549, 611, 556, 556, 556, 556, 500, 556, 500, 667, 556, 667, 556, 667, 556, 722, 500, 722, 500, 722, 500, 722, 500, 722, 615, 722, 556, 667, 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 556, 778, 556, 778, 556, 778, 556, 722, 556, 722, 556, 278, 278, 278, 278, 278, 278, 278, 222, 278, 278, 735, 444, 500, 222, 667, 500, 500, 556, 222, 556, 222, 556, 292, 556, 334, 556, 222, 722, 556, 722, 556, 722, 556, 604, 723, 556, 778, 556, 778, 556, 778, 556, 1000, 944, 722, 333, 722, 333, 722, 333, 667, 500, 667, 500, 667, 500, 667, 500, 611, 278, 611, 375, 611, 278, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 944, 722, 667, 500, 667, 611, 500, 611, 500, 611, 500, 222, 556, 667, 556, 1000, 889, 778, 611, 667, 500, 611, 278, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 667, 278, 784, 838, 384, 774, 855, 752, 222, 667, 667, 551, 668, 667, 611, 722, 778, 278, 667, 668, 833, 722, 650, 778, 722, 667, 618, 611, 667, 798, 667, 835, 748, 278, 667, 578, 446, 556, 222, 547, 578, 575, 500, 557, 446, 441, 556, 556, 222, 500, 500, 576, 500, 448, 556, 690, 569, 482, 617, 395, 547, 648, 525, 713, 781, 222, 547, 556, 547, 781, 667, 667, 865, 542, 719, 667, 278, 278, 500, 1057, 1010, 854, 583, 722, 635, 719, 667, 656, 667, 542, 677, 667, 923, 604, 719, 719, 583, 656, 833, 722, 778, 719, 667, 722, 611, 635, 760, 667, 740, 667, 917, 938, 792, 885, 656, 719, 1010, 722, 556, 573, 531, 365, 583, 556, 669, 458, 559, 559, 438, 583, 688, 552, 556, 542, 556, 500, 458, 500, 823, 500, 573, 521, 802, 823, 625, 719, 521, 510, 750, 542, 556, 556, 556, 365, 510, 500, 222, 278, 222, 906, 812, 556, 438, 559, 500, 552, 778, 556, 489, 411, 944, 722, 944, 722, 944, 722, 667, 500, 333, 333, 556, 1000, 1000, 552, 222, 222, 222, 222, 333, 333, 333, 556, 556, 350, 1000, 1000, 188, 354, 333, 333, 500, 333, 167, 365, 556, 556, 1094, 556, 885, 323, 1073, 1000, 768, 600, 834, 834, 834, 834, 1000, 500, 1000, 500, 1000, 500, 500, 494, 612, 823, 713, 584, 549, 713, 979, 719, 274, 549, 549, 583, 549, 549, 604, 584, 604, 604, 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 729, 604, 604, 354, 354, 1000, 990, 990, 990, 990, 494, 604, 604, 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, 750, 500, 500, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 294, 294, 324, 324, 316, 328, 398, 285];
  29161. const LiberationSansRegularMapping = [-1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538, 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904, 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1138, 1139, 1168, 1169, 7808, 7809, 7810, 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211, 8212, 8213, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226, 8230, 8240, 8242, 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359, 8364, 8453, 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593, 8594, 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735, 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, 9474, 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9600, 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, 9633, 9642, 9643, 9644, 9650, 9658, 9660, 9668, 9674, 9675, 9679, 9688, 9689, 9702, 9786, 9787, 9788, 9792, 9794, 9824, 9827, 9829, 9830, 9834, 9835, 9836, 61441, 61442, 61445, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1];
  29162. ;// ./src/core/myriadpro_factors.js
  29163. const MyriadProBoldFactors = [1.36898, 1, 1, 0.72706, 0.80479, 0.83734, 0.98894, 0.99793, 0.9897, 0.93884, 0.86209, 0.94292, 0.94292, 1.16661, 1.02058, 0.93582, 0.96694, 0.93582, 1.19137, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.78076, 0.78076, 1.02058, 1.02058, 1.02058, 0.72851, 0.78966, 0.90838, 0.83637, 0.82391, 0.96376, 0.80061, 0.86275, 0.8768, 0.95407, 1.0258, 0.73901, 0.85022, 0.83655, 1.0156, 0.95546, 0.92179, 0.87107, 0.92179, 0.82114, 0.8096, 0.89713, 0.94438, 0.95353, 0.94083, 0.91905, 0.90406, 0.9446, 0.94292, 1.18777, 0.94292, 1.02058, 0.89903, 0.90088, 0.94938, 0.97898, 0.81093, 0.97571, 0.94938, 1.024, 0.9577, 0.95933, 0.98621, 1.0474, 0.97455, 0.98981, 0.9672, 0.95933, 0.9446, 0.97898, 0.97407, 0.97646, 0.78036, 1.10208, 0.95442, 0.95298, 0.97579, 0.9332, 0.94039, 0.938, 0.80687, 1.01149, 0.80687, 1.02058, 0.80479, 0.99793, 0.99793, 0.99793, 0.99793, 1.01149, 1.00872, 0.90088, 0.91882, 1.0213, 0.8361, 1.02058, 0.62295, 0.54324, 0.89022, 1.08595, 1, 1, 0.90088, 1, 0.97455, 0.93582, 0.90088, 1, 1.05686, 0.8361, 0.99642, 0.99642, 0.99642, 0.72851, 0.90838, 0.90838, 0.90838, 0.90838, 0.90838, 0.90838, 0.868, 0.82391, 0.80061, 0.80061, 0.80061, 0.80061, 1.0258, 1.0258, 1.0258, 1.0258, 0.97484, 0.95546, 0.92179, 0.92179, 0.92179, 0.92179, 0.92179, 1.02058, 0.92179, 0.94438, 0.94438, 0.94438, 0.94438, 0.90406, 0.86958, 0.98225, 0.94938, 0.94938, 0.94938, 0.94938, 0.94938, 0.94938, 0.9031, 0.81093, 0.94938, 0.94938, 0.94938, 0.94938, 0.98621, 0.98621, 0.98621, 0.98621, 0.93969, 0.95933, 0.9446, 0.9446, 0.9446, 0.9446, 0.9446, 1.08595, 0.9446, 0.95442, 0.95442, 0.95442, 0.95442, 0.94039, 0.97898, 0.94039, 0.90838, 0.94938, 0.90838, 0.94938, 0.90838, 0.94938, 0.82391, 0.81093, 0.82391, 0.81093, 0.82391, 0.81093, 0.82391, 0.81093, 0.96376, 0.84313, 0.97484, 0.97571, 0.80061, 0.94938, 0.80061, 0.94938, 0.80061, 0.94938, 0.80061, 0.94938, 0.80061, 0.94938, 0.8768, 0.9577, 0.8768, 0.9577, 0.8768, 0.9577, 1, 1, 0.95407, 0.95933, 0.97069, 0.95933, 1.0258, 0.98621, 1.0258, 0.98621, 1.0258, 0.98621, 1.0258, 0.98621, 1.0258, 0.98621, 0.887, 1.01591, 0.73901, 1.0474, 1, 1, 0.97455, 0.83655, 0.98981, 1, 1, 0.83655, 0.73977, 0.83655, 0.73903, 0.84638, 1.033, 0.95546, 0.95933, 1, 1, 0.95546, 0.95933, 0.8271, 0.95417, 0.95933, 0.92179, 0.9446, 0.92179, 0.9446, 0.92179, 0.9446, 0.936, 0.91964, 0.82114, 0.97646, 1, 1, 0.82114, 0.97646, 0.8096, 0.78036, 0.8096, 0.78036, 1, 1, 0.8096, 0.78036, 1, 1, 0.89713, 0.77452, 0.89713, 1.10208, 0.94438, 0.95442, 0.94438, 0.95442, 0.94438, 0.95442, 0.94438, 0.95442, 0.94438, 0.95442, 0.94438, 0.95442, 0.94083, 0.97579, 0.90406, 0.94039, 0.90406, 0.9446, 0.938, 0.9446, 0.938, 0.9446, 0.938, 1, 0.99793, 0.90838, 0.94938, 0.868, 0.9031, 0.92179, 0.9446, 1, 1, 0.89713, 1.10208, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90989, 0.9358, 0.91945, 0.83181, 0.75261, 0.87992, 0.82976, 0.96034, 0.83689, 0.97268, 1.0078, 0.90838, 0.83637, 0.8019, 0.90157, 0.80061, 0.9446, 0.95407, 0.92436, 1.0258, 0.85022, 0.97153, 1.0156, 0.95546, 0.89192, 0.92179, 0.92361, 0.87107, 0.96318, 0.89713, 0.93704, 0.95638, 0.91905, 0.91709, 0.92796, 1.0258, 0.93704, 0.94836, 1.0373, 0.95933, 1.0078, 0.95871, 0.94836, 0.96174, 0.92601, 0.9498, 0.98607, 0.95776, 0.95933, 1.05453, 1.0078, 0.98275, 0.9314, 0.95617, 0.91701, 1.05993, 0.9446, 0.78367, 0.9553, 1, 0.86832, 1.0128, 0.95871, 0.99394, 0.87548, 0.96361, 0.86774, 1.0078, 0.95871, 0.9446, 0.95871, 0.86774, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.94083, 0.97579, 0.94083, 0.97579, 0.94083, 0.97579, 0.90406, 0.94039, 0.96694, 1, 0.89903, 1, 1, 1, 0.93582, 0.93582, 0.93582, 1, 0.908, 0.908, 0.918, 0.94219, 0.94219, 0.96544, 1, 1.285, 1, 1, 0.81079, 0.81079, 1, 1, 0.74854, 1, 1, 1, 1, 0.99793, 1, 1, 1, 0.65, 1, 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.17173, 1, 0.80535, 0.76169, 1.02058, 1.0732, 1.05486, 1, 1, 1.30692, 1.08595, 1.08595, 1, 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.16161, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
  29164. const MyriadProBoldMetrics = {
  29165. lineHeight: 1.2,
  29166. lineGap: 0.2
  29167. };
  29168. const MyriadProBoldItalicFactors = [1.36898, 1, 1, 0.66227, 0.80779, 0.81625, 0.97276, 0.97276, 0.97733, 0.92222, 0.83266, 0.94292, 0.94292, 1.16148, 1.02058, 0.93582, 0.96694, 0.93582, 1.17337, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.78076, 0.78076, 1.02058, 1.02058, 1.02058, 0.71541, 0.76813, 0.85576, 0.80591, 0.80729, 0.94299, 0.77512, 0.83655, 0.86523, 0.92222, 0.98621, 0.71743, 0.81698, 0.79726, 0.98558, 0.92222, 0.90637, 0.83809, 0.90637, 0.80729, 0.76463, 0.86275, 0.90699, 0.91605, 0.9154, 0.85308, 0.85458, 0.90531, 0.94292, 1.21296, 0.94292, 1.02058, 0.89903, 1.18616, 0.99613, 0.91677, 0.78216, 0.91677, 0.90083, 0.98796, 0.9135, 0.92168, 0.95381, 0.98981, 0.95298, 0.95381, 0.93459, 0.92168, 0.91513, 0.92004, 0.91677, 0.95077, 0.748, 1.04502, 0.91677, 0.92061, 0.94236, 0.89544, 0.89364, 0.9, 0.80687, 0.8578, 0.80687, 1.02058, 0.80779, 0.97276, 0.97276, 0.97276, 0.97276, 0.8578, 0.99973, 1.18616, 0.91339, 1.08074, 0.82891, 1.02058, 0.55509, 0.71526, 0.89022, 1.08595, 1, 1, 1.18616, 1, 0.96736, 0.93582, 1.18616, 1, 1.04864, 0.82711, 0.99043, 0.99043, 0.99043, 0.71541, 0.85576, 0.85576, 0.85576, 0.85576, 0.85576, 0.85576, 0.845, 0.80729, 0.77512, 0.77512, 0.77512, 0.77512, 0.98621, 0.98621, 0.98621, 0.98621, 0.95961, 0.92222, 0.90637, 0.90637, 0.90637, 0.90637, 0.90637, 1.02058, 0.90251, 0.90699, 0.90699, 0.90699, 0.90699, 0.85458, 0.83659, 0.94951, 0.99613, 0.99613, 0.99613, 0.99613, 0.99613, 0.99613, 0.85811, 0.78216, 0.90083, 0.90083, 0.90083, 0.90083, 0.95381, 0.95381, 0.95381, 0.95381, 0.9135, 0.92168, 0.91513, 0.91513, 0.91513, 0.91513, 0.91513, 1.08595, 0.91677, 0.91677, 0.91677, 0.91677, 0.91677, 0.89364, 0.92332, 0.89364, 0.85576, 0.99613, 0.85576, 0.99613, 0.85576, 0.99613, 0.80729, 0.78216, 0.80729, 0.78216, 0.80729, 0.78216, 0.80729, 0.78216, 0.94299, 0.76783, 0.95961, 0.91677, 0.77512, 0.90083, 0.77512, 0.90083, 0.77512, 0.90083, 0.77512, 0.90083, 0.77512, 0.90083, 0.86523, 0.9135, 0.86523, 0.9135, 0.86523, 0.9135, 1, 1, 0.92222, 0.92168, 0.92222, 0.92168, 0.98621, 0.95381, 0.98621, 0.95381, 0.98621, 0.95381, 0.98621, 0.95381, 0.98621, 0.95381, 0.86036, 0.97096, 0.71743, 0.98981, 1, 1, 0.95298, 0.79726, 0.95381, 1, 1, 0.79726, 0.6894, 0.79726, 0.74321, 0.81691, 1.0006, 0.92222, 0.92168, 1, 1, 0.92222, 0.92168, 0.79464, 0.92098, 0.92168, 0.90637, 0.91513, 0.90637, 0.91513, 0.90637, 0.91513, 0.909, 0.87514, 0.80729, 0.95077, 1, 1, 0.80729, 0.95077, 0.76463, 0.748, 0.76463, 0.748, 1, 1, 0.76463, 0.748, 1, 1, 0.86275, 0.72651, 0.86275, 1.04502, 0.90699, 0.91677, 0.90699, 0.91677, 0.90699, 0.91677, 0.90699, 0.91677, 0.90699, 0.91677, 0.90699, 0.91677, 0.9154, 0.94236, 0.85458, 0.89364, 0.85458, 0.90531, 0.9, 0.90531, 0.9, 0.90531, 0.9, 1, 0.97276, 0.85576, 0.99613, 0.845, 0.85811, 0.90251, 0.91677, 1, 1, 0.86275, 1.04502, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.00899, 1.30628, 0.85576, 0.80178, 0.66862, 0.7927, 0.69323, 0.88127, 0.72459, 0.89711, 0.95381, 0.85576, 0.80591, 0.7805, 0.94729, 0.77512, 0.90531, 0.92222, 0.90637, 0.98621, 0.81698, 0.92655, 0.98558, 0.92222, 0.85359, 0.90637, 0.90976, 0.83809, 0.94523, 0.86275, 0.83509, 0.93157, 0.85308, 0.83392, 0.92346, 0.98621, 0.83509, 0.92886, 0.91324, 0.92168, 0.95381, 0.90646, 0.92886, 0.90557, 0.86847, 0.90276, 0.91324, 0.86842, 0.92168, 0.99531, 0.95381, 0.9224, 0.85408, 0.92699, 0.86847, 1.0051, 0.91513, 0.80487, 0.93481, 1, 0.88159, 1.05214, 0.90646, 0.97355, 0.81539, 0.89398, 0.85923, 0.95381, 0.90646, 0.91513, 0.90646, 0.85923, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.9154, 0.94236, 0.9154, 0.94236, 0.9154, 0.94236, 0.85458, 0.89364, 0.96694, 1, 0.89903, 1, 1, 1, 0.91782, 0.91782, 0.91782, 1, 0.896, 0.896, 0.896, 0.9332, 0.9332, 0.95973, 1, 1.26, 1, 1, 0.80479, 0.80178, 1, 1, 0.85633, 1, 1, 1, 1, 0.97276, 1, 1, 1, 0.698, 1, 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.14542, 1, 0.79199, 0.78694, 1.02058, 1.03493, 1.05486, 1, 1, 1.23026, 1.08595, 1.08595, 1, 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.20006, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
  29169. const MyriadProBoldItalicMetrics = {
  29170. lineHeight: 1.2,
  29171. lineGap: 0.2
  29172. };
  29173. const MyriadProItalicFactors = [1.36898, 1, 1, 0.65507, 0.84943, 0.85639, 0.88465, 0.88465, 0.86936, 0.88307, 0.86948, 0.85283, 0.85283, 1.06383, 1.02058, 0.75945, 0.9219, 0.75945, 1.17337, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.75945, 0.75945, 1.02058, 1.02058, 1.02058, 0.69046, 0.70926, 0.85158, 0.77812, 0.76852, 0.89591, 0.70466, 0.76125, 0.80094, 0.86822, 0.83864, 0.728, 0.77212, 0.79475, 0.93637, 0.87514, 0.8588, 0.76013, 0.8588, 0.72421, 0.69866, 0.77598, 0.85991, 0.80811, 0.87832, 0.78112, 0.77512, 0.8562, 1.0222, 1.18417, 1.0222, 1.27014, 0.89903, 1.15012, 0.93859, 0.94399, 0.846, 0.94399, 0.81453, 1.0186, 0.94219, 0.96017, 1.03075, 1.02175, 0.912, 1.03075, 0.96998, 0.96017, 0.93859, 0.94399, 0.94399, 0.95493, 0.746, 1.12658, 0.94578, 0.91, 0.979, 0.882, 0.882, 0.83, 0.85034, 0.83537, 0.85034, 1.02058, 0.70869, 0.88465, 0.88465, 0.88465, 0.88465, 0.83537, 0.90083, 1.15012, 0.9161, 0.94565, 0.73541, 1.02058, 0.53609, 0.69353, 0.79519, 1.08595, 1, 1, 1.15012, 1, 0.91974, 0.75945, 1.15012, 1, 0.9446, 0.73361, 0.9005, 0.9005, 0.9005, 0.62864, 0.85158, 0.85158, 0.85158, 0.85158, 0.85158, 0.85158, 0.773, 0.76852, 0.70466, 0.70466, 0.70466, 0.70466, 0.83864, 0.83864, 0.83864, 0.83864, 0.90561, 0.87514, 0.8588, 0.8588, 0.8588, 0.8588, 0.8588, 1.02058, 0.85751, 0.85991, 0.85991, 0.85991, 0.85991, 0.77512, 0.76013, 0.88075, 0.93859, 0.93859, 0.93859, 0.93859, 0.93859, 0.93859, 0.8075, 0.846, 0.81453, 0.81453, 0.81453, 0.81453, 0.82424, 0.82424, 0.82424, 0.82424, 0.9278, 0.96017, 0.93859, 0.93859, 0.93859, 0.93859, 0.93859, 1.08595, 0.8562, 0.94578, 0.94578, 0.94578, 0.94578, 0.882, 0.94578, 0.882, 0.85158, 0.93859, 0.85158, 0.93859, 0.85158, 0.93859, 0.76852, 0.846, 0.76852, 0.846, 0.76852, 0.846, 0.76852, 0.846, 0.89591, 0.8544, 0.90561, 0.94399, 0.70466, 0.81453, 0.70466, 0.81453, 0.70466, 0.81453, 0.70466, 0.81453, 0.70466, 0.81453, 0.80094, 0.94219, 0.80094, 0.94219, 0.80094, 0.94219, 1, 1, 0.86822, 0.96017, 0.86822, 0.96017, 0.83864, 0.82424, 0.83864, 0.82424, 0.83864, 0.82424, 0.83864, 1.03075, 0.83864, 0.82424, 0.81402, 1.02738, 0.728, 1.02175, 1, 1, 0.912, 0.79475, 1.03075, 1, 1, 0.79475, 0.83911, 0.79475, 0.66266, 0.80553, 1.06676, 0.87514, 0.96017, 1, 1, 0.87514, 0.96017, 0.86865, 0.87396, 0.96017, 0.8588, 0.93859, 0.8588, 0.93859, 0.8588, 0.93859, 0.867, 0.84759, 0.72421, 0.95493, 1, 1, 0.72421, 0.95493, 0.69866, 0.746, 0.69866, 0.746, 1, 1, 0.69866, 0.746, 1, 1, 0.77598, 0.88417, 0.77598, 1.12658, 0.85991, 0.94578, 0.85991, 0.94578, 0.85991, 0.94578, 0.85991, 0.94578, 0.85991, 0.94578, 0.85991, 0.94578, 0.87832, 0.979, 0.77512, 0.882, 0.77512, 0.8562, 0.83, 0.8562, 0.83, 0.8562, 0.83, 1, 0.88465, 0.85158, 0.93859, 0.773, 0.8075, 0.85751, 0.8562, 1, 1, 0.77598, 1.12658, 1.15012, 1.15012, 1.15012, 1.15012, 1.15012, 1.15313, 1.15012, 1.15012, 1.15012, 1.08106, 1.03901, 0.85158, 0.77025, 0.62264, 0.7646, 0.65351, 0.86026, 0.69461, 0.89947, 1.03075, 0.85158, 0.77812, 0.76449, 0.88836, 0.70466, 0.8562, 0.86822, 0.8588, 0.83864, 0.77212, 0.85308, 0.93637, 0.87514, 0.82352, 0.8588, 0.85701, 0.76013, 0.89058, 0.77598, 0.8156, 0.82565, 0.78112, 0.77899, 0.89386, 0.83864, 0.8156, 0.9486, 0.92388, 0.96186, 1.03075, 0.91123, 0.9486, 0.93298, 0.878, 0.93942, 0.92388, 0.84596, 0.96186, 0.95119, 1.03075, 0.922, 0.88787, 0.95829, 0.88, 0.93559, 0.93859, 0.78815, 0.93758, 1, 0.89217, 1.03737, 0.91123, 0.93969, 0.77487, 0.85769, 0.86799, 1.03075, 0.91123, 0.93859, 0.91123, 0.86799, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.87832, 0.979, 0.87832, 0.979, 0.87832, 0.979, 0.77512, 0.882, 0.9219, 1, 0.89903, 1, 1, 1, 0.87321, 0.87321, 0.87321, 1, 1.027, 1.027, 1.027, 0.86847, 0.86847, 0.79121, 1, 1.124, 1, 1, 0.73572, 0.73572, 1, 1, 0.85034, 1, 1, 1, 1, 0.88465, 1, 1, 1, 0.669, 1, 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.04828, 1, 0.74948, 0.75187, 1.02058, 0.98391, 1.02119, 1, 1, 1.06233, 1.08595, 1.08595, 1, 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05233, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
  29174. const MyriadProItalicMetrics = {
  29175. lineHeight: 1.2,
  29176. lineGap: 0.2
  29177. };
  29178. const MyriadProRegularFactors = [1.36898, 1, 1, 0.76305, 0.82784, 0.94935, 0.89364, 0.92241, 0.89073, 0.90706, 0.98472, 0.85283, 0.85283, 1.0664, 1.02058, 0.74505, 0.9219, 0.74505, 1.23456, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.74505, 0.74505, 1.02058, 1.02058, 1.02058, 0.73002, 0.72601, 0.91755, 0.8126, 0.80314, 0.92222, 0.73764, 0.79726, 0.83051, 0.90284, 0.86023, 0.74, 0.8126, 0.84869, 0.96518, 0.91115, 0.8858, 0.79761, 0.8858, 0.74498, 0.73914, 0.81363, 0.89591, 0.83659, 0.89633, 0.85608, 0.8111, 0.90531, 1.0222, 1.22736, 1.0222, 1.27014, 0.89903, 0.90088, 0.86667, 1.0231, 0.896, 1.01411, 0.90083, 1.05099, 1.00512, 0.99793, 1.05326, 1.09377, 0.938, 1.06226, 1.00119, 0.99793, 0.98714, 1.0231, 1.01231, 0.98196, 0.792, 1.19137, 0.99074, 0.962, 1.01915, 0.926, 0.942, 0.856, 0.85034, 0.92006, 0.85034, 1.02058, 0.69067, 0.92241, 0.92241, 0.92241, 0.92241, 0.92006, 0.9332, 0.90088, 0.91882, 0.93484, 0.75339, 1.02058, 0.56866, 0.54324, 0.79519, 1.08595, 1, 1, 0.90088, 1, 0.95325, 0.74505, 0.90088, 1, 0.97198, 0.75339, 0.91009, 0.91009, 0.91009, 0.66466, 0.91755, 0.91755, 0.91755, 0.91755, 0.91755, 0.91755, 0.788, 0.80314, 0.73764, 0.73764, 0.73764, 0.73764, 0.86023, 0.86023, 0.86023, 0.86023, 0.92915, 0.91115, 0.8858, 0.8858, 0.8858, 0.8858, 0.8858, 1.02058, 0.8858, 0.89591, 0.89591, 0.89591, 0.89591, 0.8111, 0.79611, 0.89713, 0.86667, 0.86667, 0.86667, 0.86667, 0.86667, 0.86667, 0.86936, 0.896, 0.90083, 0.90083, 0.90083, 0.90083, 0.84224, 0.84224, 0.84224, 0.84224, 0.97276, 0.99793, 0.98714, 0.98714, 0.98714, 0.98714, 0.98714, 1.08595, 0.89876, 0.99074, 0.99074, 0.99074, 0.99074, 0.942, 1.0231, 0.942, 0.91755, 0.86667, 0.91755, 0.86667, 0.91755, 0.86667, 0.80314, 0.896, 0.80314, 0.896, 0.80314, 0.896, 0.80314, 0.896, 0.92222, 0.93372, 0.92915, 1.01411, 0.73764, 0.90083, 0.73764, 0.90083, 0.73764, 0.90083, 0.73764, 0.90083, 0.73764, 0.90083, 0.83051, 1.00512, 0.83051, 1.00512, 0.83051, 1.00512, 1, 1, 0.90284, 0.99793, 0.90976, 0.99793, 0.86023, 0.84224, 0.86023, 0.84224, 0.86023, 0.84224, 0.86023, 1.05326, 0.86023, 0.84224, 0.82873, 1.07469, 0.74, 1.09377, 1, 1, 0.938, 0.84869, 1.06226, 1, 1, 0.84869, 0.83704, 0.84869, 0.81441, 0.85588, 1.08927, 0.91115, 0.99793, 1, 1, 0.91115, 0.99793, 0.91887, 0.90991, 0.99793, 0.8858, 0.98714, 0.8858, 0.98714, 0.8858, 0.98714, 0.894, 0.91434, 0.74498, 0.98196, 1, 1, 0.74498, 0.98196, 0.73914, 0.792, 0.73914, 0.792, 1, 1, 0.73914, 0.792, 1, 1, 0.81363, 0.904, 0.81363, 1.19137, 0.89591, 0.99074, 0.89591, 0.99074, 0.89591, 0.99074, 0.89591, 0.99074, 0.89591, 0.99074, 0.89591, 0.99074, 0.89633, 1.01915, 0.8111, 0.942, 0.8111, 0.90531, 0.856, 0.90531, 0.856, 0.90531, 0.856, 1, 0.92241, 0.91755, 0.86667, 0.788, 0.86936, 0.8858, 0.89876, 1, 1, 0.81363, 1.19137, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90388, 1.03901, 0.92138, 0.78105, 0.7154, 0.86169, 0.80513, 0.94007, 0.82528, 0.98612, 1.06226, 0.91755, 0.8126, 0.81884, 0.92819, 0.73764, 0.90531, 0.90284, 0.8858, 0.86023, 0.8126, 0.91172, 0.96518, 0.91115, 0.83089, 0.8858, 0.87791, 0.79761, 0.89297, 0.81363, 0.88157, 0.89992, 0.85608, 0.81992, 0.94307, 0.86023, 0.88157, 0.95308, 0.98699, 0.99793, 1.06226, 0.95817, 0.95308, 0.97358, 0.928, 0.98088, 0.98699, 0.92761, 0.99793, 0.96017, 1.06226, 0.986, 0.944, 0.95978, 0.938, 0.96705, 0.98714, 0.80442, 0.98972, 1, 0.89762, 1.04552, 0.95817, 0.99007, 0.87064, 0.91879, 0.88888, 1.06226, 0.95817, 0.98714, 0.95817, 0.88888, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.89633, 1.01915, 0.89633, 1.01915, 0.89633, 1.01915, 0.8111, 0.942, 0.9219, 1, 0.89903, 1, 1, 1, 0.93173, 0.93173, 0.93173, 1, 1.06304, 1.06304, 1.06904, 0.89903, 0.89903, 0.80549, 1, 1.156, 1, 1, 0.76575, 0.76575, 1, 1, 0.72458, 1, 1, 1, 1, 0.92241, 1, 1, 1, 0.619, 1, 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.07257, 1, 0.74705, 0.71119, 1.02058, 1.024, 1.02119, 1, 1, 1.1536, 1.08595, 1.08595, 1, 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05638, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
  29179. const MyriadProRegularMetrics = {
  29180. lineHeight: 1.2,
  29181. lineGap: 0.2
  29182. };
  29183. ;// ./src/core/segoeui_factors.js
  29184. const SegoeuiBoldFactors = [1.76738, 1, 1, 0.99297, 0.9824, 1.04016, 1.06497, 1.03424, 0.97529, 1.17647, 1.23203, 1.1085, 1.1085, 1.16939, 1.2107, 0.9754, 1.21408, 0.9754, 1.59578, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 0.81378, 0.81378, 1.2107, 1.2107, 1.2107, 0.71703, 0.97847, 0.97363, 0.88776, 0.8641, 1.02096, 0.79795, 0.85132, 0.914, 1.06085, 1.1406, 0.8007, 0.89858, 0.83693, 1.14889, 1.09398, 0.97489, 0.92094, 0.97489, 0.90399, 0.84041, 0.95923, 1.00135, 1, 1.06467, 0.98243, 0.90996, 0.99361, 1.1085, 1.56942, 1.1085, 1.2107, 0.74627, 0.94282, 0.96752, 1.01519, 0.86304, 1.01359, 0.97278, 1.15103, 1.01359, 0.98561, 1.02285, 1.02285, 1.00527, 1.02285, 1.0302, 0.99041, 1.0008, 1.01519, 1.01359, 1.02258, 0.79104, 1.16862, 0.99041, 0.97454, 1.02511, 0.99298, 0.96752, 0.95801, 0.94856, 1.16579, 0.94856, 1.2107, 0.9824, 1.03424, 1.03424, 1, 1.03424, 1.16579, 0.8727, 1.3871, 1.18622, 1.10818, 1.04478, 1.2107, 1.18622, 0.75155, 0.94994, 1.28826, 1.21408, 1.21408, 0.91056, 1, 0.91572, 0.9754, 0.64663, 1.18328, 1.24866, 1.04478, 1.14169, 1.15749, 1.17389, 0.71703, 0.97363, 0.97363, 0.97363, 0.97363, 0.97363, 0.97363, 0.93506, 0.8641, 0.79795, 0.79795, 0.79795, 0.79795, 1.1406, 1.1406, 1.1406, 1.1406, 1.02096, 1.09398, 0.97426, 0.97426, 0.97426, 0.97426, 0.97426, 1.2107, 0.97489, 1.00135, 1.00135, 1.00135, 1.00135, 0.90996, 0.92094, 1.02798, 0.96752, 0.96752, 0.96752, 0.96752, 0.96752, 0.96752, 0.93136, 0.86304, 0.97278, 0.97278, 0.97278, 0.97278, 1.02285, 1.02285, 1.02285, 1.02285, 0.97122, 0.99041, 1, 1, 1, 1, 1, 1.28826, 1.0008, 0.99041, 0.99041, 0.99041, 0.99041, 0.96752, 1.01519, 0.96752, 0.97363, 0.96752, 0.97363, 0.96752, 0.97363, 0.96752, 0.8641, 0.86304, 0.8641, 0.86304, 0.8641, 0.86304, 0.8641, 0.86304, 1.02096, 1.03057, 1.02096, 1.03517, 0.79795, 0.97278, 0.79795, 0.97278, 0.79795, 0.97278, 0.79795, 0.97278, 0.79795, 0.97278, 0.914, 1.01359, 0.914, 1.01359, 0.914, 1.01359, 1, 1, 1.06085, 0.98561, 1.06085, 1.00879, 1.1406, 1.02285, 1.1406, 1.02285, 1.1406, 1.02285, 1.1406, 1.02285, 1.1406, 1.02285, 0.97138, 1.08692, 0.8007, 1.02285, 1, 1, 1.00527, 0.83693, 1.02285, 1, 1, 0.83693, 0.9455, 0.83693, 0.90418, 0.83693, 1.13005, 1.09398, 0.99041, 1, 1, 1.09398, 0.99041, 0.96692, 1.09251, 0.99041, 0.97489, 1.0008, 0.97489, 1.0008, 0.97489, 1.0008, 0.93994, 0.97931, 0.90399, 1.02258, 1, 1, 0.90399, 1.02258, 0.84041, 0.79104, 0.84041, 0.79104, 0.84041, 0.79104, 0.84041, 0.79104, 1, 1, 0.95923, 1.07034, 0.95923, 1.16862, 1.00135, 0.99041, 1.00135, 0.99041, 1.00135, 0.99041, 1.00135, 0.99041, 1.00135, 0.99041, 1.00135, 0.99041, 1.06467, 1.02511, 0.90996, 0.96752, 0.90996, 0.99361, 0.95801, 0.99361, 0.95801, 0.99361, 0.95801, 1.07733, 1.03424, 0.97363, 0.96752, 0.93506, 0.93136, 0.97489, 1.0008, 1, 1, 0.95923, 1.16862, 1.15103, 1.15103, 1.01173, 1.03959, 0.75953, 0.81378, 0.79912, 1.15103, 1.21994, 0.95161, 0.87815, 1.01149, 0.81525, 0.7676, 0.98167, 1.01134, 1.02546, 0.84097, 1.03089, 1.18102, 0.97363, 0.88776, 0.85134, 0.97826, 0.79795, 0.99361, 1.06085, 0.97489, 1.1406, 0.89858, 1.0388, 1.14889, 1.09398, 0.86039, 0.97489, 1.0595, 0.92094, 0.94793, 0.95923, 0.90996, 0.99346, 0.98243, 1.02112, 0.95493, 1.1406, 0.90996, 1.03574, 1.02597, 1.0008, 1.18102, 1.06628, 1.03574, 1.0192, 1.01932, 1.00886, 0.97531, 1.0106, 1.0008, 1.13189, 1.18102, 1.02277, 0.98683, 1.0016, 0.99561, 1.07237, 1.0008, 0.90434, 0.99921, 0.93803, 0.8965, 1.23085, 1.06628, 1.04983, 0.96268, 1.0499, 0.98439, 1.18102, 1.06628, 1.0008, 1.06628, 0.98439, 0.79795, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.09466, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.97278, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.02065, 1, 1, 1, 1, 1, 1, 1.06467, 1.02511, 1.06467, 1.02511, 1.06467, 1.02511, 0.90996, 0.96752, 1, 1.21408, 0.89903, 1, 1, 0.75155, 1.04394, 1.04394, 1.04394, 1.04394, 0.98633, 0.98633, 0.98633, 0.73047, 0.73047, 1.20642, 0.91211, 1.25635, 1.222, 1.02956, 1.03372, 1.03372, 0.96039, 1.24633, 1, 1.12454, 0.93503, 1.03424, 1.19687, 1.03424, 1, 1, 1, 0.771, 1, 1, 1.15749, 1.15749, 1.15749, 1.10948, 0.86279, 0.94434, 0.86279, 0.94434, 0.86182, 1, 1, 1.16897, 1, 0.96085, 0.90137, 1.2107, 1.18416, 1.13973, 0.69825, 0.9716, 2.10339, 1.29004, 1.29004, 1.21172, 1.29004, 1.29004, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.42603, 1, 0.99862, 0.99862, 1, 0.87025, 0.87025, 0.87025, 0.87025, 1.18874, 1.42603, 1, 1.42603, 1.42603, 0.99862, 1, 1, 1, 1, 1, 1.2886, 1.04315, 1.15296, 1.34163, 1, 1, 1, 1.09193, 1.09193, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
  29185. const SegoeuiBoldMetrics = {
  29186. lineHeight: 1.33008,
  29187. lineGap: 0
  29188. };
  29189. const SegoeuiBoldItalicFactors = [1.76738, 1, 1, 0.98946, 1.03959, 1.04016, 1.02809, 1.036, 0.97639, 1.10953, 1.23203, 1.11144, 1.11144, 1.16939, 1.21237, 0.9754, 1.21261, 0.9754, 1.59754, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 0.81378, 0.81378, 1.21237, 1.21237, 1.21237, 0.73541, 0.97847, 0.97363, 0.89723, 0.87897, 1.0426, 0.79429, 0.85292, 0.91149, 1.05815, 1.1406, 0.79631, 0.90128, 0.83853, 1.04396, 1.10615, 0.97552, 0.94436, 0.97552, 0.88641, 0.80527, 0.96083, 1.00135, 1, 1.06777, 0.9817, 0.91142, 0.99361, 1.11144, 1.57293, 1.11144, 1.21237, 0.74627, 1.31818, 1.06585, 0.97042, 0.83055, 0.97042, 0.93503, 1.1261, 0.97042, 0.97922, 1.14236, 0.94552, 1.01054, 1.14236, 1.02471, 0.97922, 0.94165, 0.97042, 0.97042, 1.0276, 0.78929, 1.1261, 0.97922, 0.95874, 1.02197, 0.98507, 0.96752, 0.97168, 0.95107, 1.16579, 0.95107, 1.21237, 1.03959, 1.036, 1.036, 1, 1.036, 1.16579, 0.87357, 1.31818, 1.18754, 1.26781, 1.05356, 1.21237, 1.18622, 0.79487, 0.94994, 1.29004, 1.24047, 1.24047, 1.31818, 1, 0.91484, 0.9754, 1.31818, 1.1349, 1.24866, 1.05356, 1.13934, 1.15574, 1.17389, 0.73541, 0.97363, 0.97363, 0.97363, 0.97363, 0.97363, 0.97363, 0.94385, 0.87897, 0.79429, 0.79429, 0.79429, 0.79429, 1.1406, 1.1406, 1.1406, 1.1406, 1.0426, 1.10615, 0.97552, 0.97552, 0.97552, 0.97552, 0.97552, 1.21237, 0.97552, 1.00135, 1.00135, 1.00135, 1.00135, 0.91142, 0.94436, 0.98721, 1.06585, 1.06585, 1.06585, 1.06585, 1.06585, 1.06585, 0.96705, 0.83055, 0.93503, 0.93503, 0.93503, 0.93503, 1.14236, 1.14236, 1.14236, 1.14236, 0.93125, 0.97922, 0.94165, 0.94165, 0.94165, 0.94165, 0.94165, 1.29004, 0.94165, 0.97922, 0.97922, 0.97922, 0.97922, 0.96752, 0.97042, 0.96752, 0.97363, 1.06585, 0.97363, 1.06585, 0.97363, 1.06585, 0.87897, 0.83055, 0.87897, 0.83055, 0.87897, 0.83055, 0.87897, 0.83055, 1.0426, 1.0033, 1.0426, 0.97042, 0.79429, 0.93503, 0.79429, 0.93503, 0.79429, 0.93503, 0.79429, 0.93503, 0.79429, 0.93503, 0.91149, 0.97042, 0.91149, 0.97042, 0.91149, 0.97042, 1, 1, 1.05815, 0.97922, 1.05815, 0.97922, 1.1406, 1.14236, 1.1406, 1.14236, 1.1406, 1.14236, 1.1406, 1.14236, 1.1406, 1.14236, 0.97441, 1.04302, 0.79631, 1.01582, 1, 1, 1.01054, 0.83853, 1.14236, 1, 1, 0.83853, 1.09125, 0.83853, 0.90418, 0.83853, 1.19508, 1.10615, 0.97922, 1, 1, 1.10615, 0.97922, 1.01034, 1.10466, 0.97922, 0.97552, 0.94165, 0.97552, 0.94165, 0.97552, 0.94165, 0.91602, 0.91981, 0.88641, 1.0276, 1, 1, 0.88641, 1.0276, 0.80527, 0.78929, 0.80527, 0.78929, 0.80527, 0.78929, 0.80527, 0.78929, 1, 1, 0.96083, 1.05403, 0.95923, 1.16862, 1.00135, 0.97922, 1.00135, 0.97922, 1.00135, 0.97922, 1.00135, 0.97922, 1.00135, 0.97922, 1.00135, 0.97922, 1.06777, 1.02197, 0.91142, 0.96752, 0.91142, 0.99361, 0.97168, 0.99361, 0.97168, 0.99361, 0.97168, 1.23199, 1.036, 0.97363, 1.06585, 0.94385, 0.96705, 0.97552, 0.94165, 1, 1, 0.96083, 1.1261, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 0.95161, 1.27126, 1.00811, 0.83284, 0.77702, 0.99137, 0.95253, 1.0347, 0.86142, 1.07205, 1.14236, 0.97363, 0.89723, 0.86869, 1.09818, 0.79429, 0.99361, 1.05815, 0.97552, 1.1406, 0.90128, 1.06662, 1.04396, 1.10615, 0.84918, 0.97552, 1.04694, 0.94436, 0.98015, 0.96083, 0.91142, 1.00356, 0.9817, 1.01945, 0.98999, 1.1406, 0.91142, 1.04961, 0.9898, 1.00639, 1.14236, 1.07514, 1.04961, 0.99607, 1.02897, 1.008, 0.9898, 0.95134, 1.00639, 1.11121, 1.14236, 1.00518, 0.97981, 1.02186, 1, 1.08578, 0.94165, 0.99314, 0.98387, 0.93028, 0.93377, 1.35125, 1.07514, 1.10687, 0.93491, 1.04232, 1.00351, 1.14236, 1.07514, 0.94165, 1.07514, 1.00351, 0.79429, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.09097, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.93503, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.96609, 1, 1, 1, 1, 1, 1, 1.06777, 1.02197, 1.06777, 1.02197, 1.06777, 1.02197, 0.91142, 0.96752, 1, 1.21261, 0.89903, 1, 1, 0.75155, 1.04745, 1.04745, 1.04745, 1.04394, 0.98633, 0.98633, 0.98633, 0.72959, 0.72959, 1.20502, 0.91406, 1.26514, 1.222, 1.02956, 1.03372, 1.03372, 0.96039, 1.24633, 1, 1.09125, 0.93327, 1.03336, 1.16541, 1.036, 1, 1, 1, 0.771, 1, 1, 1.15574, 1.15574, 1.15574, 1.15574, 0.86364, 0.94434, 0.86279, 0.94434, 0.86224, 1, 1, 1.16798, 1, 0.96085, 0.90068, 1.21237, 1.18416, 1.13904, 0.69825, 0.9716, 2.10339, 1.29004, 1.29004, 1.21339, 1.29004, 1.29004, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.42603, 1, 0.99862, 0.99862, 1, 0.87025, 0.87025, 0.87025, 0.87025, 1.18775, 1.42603, 1, 1.42603, 1.42603, 0.99862, 1, 1, 1, 1, 1, 1.2886, 1.04315, 1.15296, 1.34163, 1, 1, 1, 1.13269, 1.13269, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
  29190. const SegoeuiBoldItalicMetrics = {
  29191. lineHeight: 1.33008,
  29192. lineGap: 0
  29193. };
  29194. const SegoeuiItalicFactors = [1.76738, 1, 1, 0.98946, 1.14763, 1.05365, 1.06234, 0.96927, 0.92586, 1.15373, 1.18414, 0.91349, 0.91349, 1.07403, 1.17308, 0.78383, 1.20088, 0.78383, 1.42531, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.78383, 0.78383, 1.17308, 1.17308, 1.17308, 0.77349, 0.94565, 0.94729, 0.85944, 0.88506, 0.9858, 0.74817, 0.80016, 0.88449, 0.98039, 0.95782, 0.69238, 0.89898, 0.83231, 0.98183, 1.03989, 0.96924, 0.86237, 0.96924, 0.80595, 0.74524, 0.86091, 0.95402, 0.94143, 0.98448, 0.8858, 0.83089, 0.93285, 1.0949, 1.39016, 1.0949, 1.45994, 0.74627, 1.04839, 0.97454, 0.97454, 0.87207, 0.97454, 0.87533, 1.06151, 0.97454, 1.00176, 1.16484, 1.08132, 0.98047, 1.16484, 1.02989, 1.01054, 0.96225, 0.97454, 0.97454, 1.06598, 0.79004, 1.16344, 1.00351, 0.94629, 0.9973, 0.91016, 0.96777, 0.9043, 0.91082, 0.92481, 0.91082, 1.17308, 0.95748, 0.96927, 0.96927, 1, 0.96927, 0.92481, 0.80597, 1.04839, 1.23393, 1.1781, 0.9245, 1.17308, 1.20808, 0.63218, 0.94261, 1.24822, 1.09971, 1.09971, 1.04839, 1, 0.85273, 0.78032, 1.04839, 1.09971, 1.22326, 0.9245, 1.09836, 1.13525, 1.15222, 0.70424, 0.94729, 0.94729, 0.94729, 0.94729, 0.94729, 0.94729, 0.85498, 0.88506, 0.74817, 0.74817, 0.74817, 0.74817, 0.95782, 0.95782, 0.95782, 0.95782, 0.9858, 1.03989, 0.96924, 0.96924, 0.96924, 0.96924, 0.96924, 1.17308, 0.96924, 0.95402, 0.95402, 0.95402, 0.95402, 0.83089, 0.86237, 0.88409, 0.97454, 0.97454, 0.97454, 0.97454, 0.97454, 0.97454, 0.92916, 0.87207, 0.87533, 0.87533, 0.87533, 0.87533, 0.93146, 0.93146, 0.93146, 0.93146, 0.93854, 1.01054, 0.96225, 0.96225, 0.96225, 0.96225, 0.96225, 1.24822, 0.8761, 1.00351, 1.00351, 1.00351, 1.00351, 0.96777, 0.97454, 0.96777, 0.94729, 0.97454, 0.94729, 0.97454, 0.94729, 0.97454, 0.88506, 0.87207, 0.88506, 0.87207, 0.88506, 0.87207, 0.88506, 0.87207, 0.9858, 0.95391, 0.9858, 0.97454, 0.74817, 0.87533, 0.74817, 0.87533, 0.74817, 0.87533, 0.74817, 0.87533, 0.74817, 0.87533, 0.88449, 0.97454, 0.88449, 0.97454, 0.88449, 0.97454, 1, 1, 0.98039, 1.00176, 0.98039, 1.00176, 0.95782, 0.93146, 0.95782, 0.93146, 0.95782, 0.93146, 0.95782, 1.16484, 0.95782, 0.93146, 0.84421, 1.12761, 0.69238, 1.08132, 1, 1, 0.98047, 0.83231, 1.16484, 1, 1, 0.84723, 1.04861, 0.84723, 0.78755, 0.83231, 1.23736, 1.03989, 1.01054, 1, 1, 1.03989, 1.01054, 0.9857, 1.03849, 1.01054, 0.96924, 0.96225, 0.96924, 0.96225, 0.96924, 0.96225, 0.92383, 0.90171, 0.80595, 1.06598, 1, 1, 0.80595, 1.06598, 0.74524, 0.79004, 0.74524, 0.79004, 0.74524, 0.79004, 0.74524, 0.79004, 1, 1, 0.86091, 1.02759, 0.85771, 1.16344, 0.95402, 1.00351, 0.95402, 1.00351, 0.95402, 1.00351, 0.95402, 1.00351, 0.95402, 1.00351, 0.95402, 1.00351, 0.98448, 0.9973, 0.83089, 0.96777, 0.83089, 0.93285, 0.9043, 0.93285, 0.9043, 0.93285, 0.9043, 1.31868, 0.96927, 0.94729, 0.97454, 0.85498, 0.92916, 0.96924, 0.8761, 1, 1, 0.86091, 1.16344, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 0.81965, 0.81965, 0.94729, 0.78032, 0.71022, 0.90883, 0.84171, 0.99877, 0.77596, 1.05734, 1.2, 0.94729, 0.85944, 0.82791, 0.9607, 0.74817, 0.93285, 0.98039, 0.96924, 0.95782, 0.89898, 0.98316, 0.98183, 1.03989, 0.78614, 0.96924, 0.97642, 0.86237, 0.86075, 0.86091, 0.83089, 0.90082, 0.8858, 0.97296, 1.01284, 0.95782, 0.83089, 1.0976, 1.04, 1.03342, 1.2, 1.0675, 1.0976, 0.98205, 1.03809, 1.05097, 1.04, 0.95364, 1.03342, 1.05401, 1.2, 1.02148, 1.0119, 1.04724, 1.0127, 1.02732, 0.96225, 0.8965, 0.97783, 0.93574, 0.94818, 1.30679, 1.0675, 1.11826, 0.99821, 1.0557, 1.0326, 1.2, 1.0675, 0.96225, 1.0675, 1.0326, 0.74817, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.03754, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.87533, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.98705, 1, 1, 1, 1, 1, 1, 0.98448, 0.9973, 0.98448, 0.9973, 0.98448, 0.9973, 0.83089, 0.96777, 1, 1.20088, 0.89903, 1, 1, 0.75155, 0.94945, 0.94945, 0.94945, 0.94945, 1.12317, 1.12317, 1.12317, 0.67603, 0.67603, 1.15621, 0.73584, 1.21191, 1.22135, 1.06483, 0.94868, 0.94868, 0.95996, 1.24633, 1, 1.07497, 0.87709, 0.96927, 1.01473, 0.96927, 1, 1, 1, 0.77295, 1, 1, 1.09836, 1.09836, 1.09836, 1.01522, 0.86321, 0.94434, 0.8649, 0.94434, 0.86182, 1, 1, 1.083, 1, 0.91578, 0.86438, 1.17308, 1.18416, 1.14589, 0.69825, 0.97622, 1.96791, 1.24822, 1.24822, 1.17308, 1.24822, 1.24822, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.42603, 1, 0.99862, 0.99862, 1, 0.87025, 0.87025, 0.87025, 0.87025, 1.17984, 1.42603, 1, 1.42603, 1.42603, 0.99862, 1, 1, 1, 1, 1, 1.2886, 1.04315, 1.15296, 1.34163, 1, 1, 1, 1.10742, 1.10742, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
  29195. const SegoeuiItalicMetrics = {
  29196. lineHeight: 1.33008,
  29197. lineGap: 0
  29198. };
  29199. const SegoeuiRegularFactors = [1.76738, 1, 1, 0.98594, 1.02285, 1.10454, 1.06234, 0.96927, 0.92037, 1.19985, 1.2046, 0.90616, 0.90616, 1.07152, 1.1714, 0.78032, 1.20088, 0.78032, 1.40246, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.78032, 0.78032, 1.1714, 1.1714, 1.1714, 0.80597, 0.94084, 0.96706, 0.85944, 0.85734, 0.97093, 0.75842, 0.79936, 0.88198, 0.9831, 0.95782, 0.71387, 0.86969, 0.84636, 1.07796, 1.03584, 0.96924, 0.83968, 0.96924, 0.82826, 0.79649, 0.85771, 0.95132, 0.93119, 0.98965, 0.88433, 0.8287, 0.93365, 1.08612, 1.3638, 1.08612, 1.45786, 0.74627, 0.80499, 0.91484, 1.05707, 0.92383, 1.05882, 0.9403, 1.12654, 1.05882, 1.01756, 1.09011, 1.09011, 0.99414, 1.09011, 1.034, 1.01756, 1.05356, 1.05707, 1.05882, 1.04399, 0.84863, 1.21968, 1.01756, 0.95801, 1.00068, 0.91797, 0.96777, 0.9043, 0.90351, 0.92105, 0.90351, 1.1714, 0.85337, 0.96927, 0.96927, 0.99912, 0.96927, 0.92105, 0.80597, 1.2434, 1.20808, 1.05937, 0.90957, 1.1714, 1.20808, 0.75155, 0.94261, 1.24644, 1.09971, 1.09971, 0.84751, 1, 0.85273, 0.78032, 0.61584, 1.05425, 1.17914, 0.90957, 1.08665, 1.11593, 1.14169, 0.73381, 0.96706, 0.96706, 0.96706, 0.96706, 0.96706, 0.96706, 0.86035, 0.85734, 0.75842, 0.75842, 0.75842, 0.75842, 0.95782, 0.95782, 0.95782, 0.95782, 0.97093, 1.03584, 0.96924, 0.96924, 0.96924, 0.96924, 0.96924, 1.1714, 0.96924, 0.95132, 0.95132, 0.95132, 0.95132, 0.8287, 0.83968, 0.89049, 0.91484, 0.91484, 0.91484, 0.91484, 0.91484, 0.91484, 0.93575, 0.92383, 0.9403, 0.9403, 0.9403, 0.9403, 0.8717, 0.8717, 0.8717, 0.8717, 1.00527, 1.01756, 1.05356, 1.05356, 1.05356, 1.05356, 1.05356, 1.24644, 0.95923, 1.01756, 1.01756, 1.01756, 1.01756, 0.96777, 1.05707, 0.96777, 0.96706, 0.91484, 0.96706, 0.91484, 0.96706, 0.91484, 0.85734, 0.92383, 0.85734, 0.92383, 0.85734, 0.92383, 0.85734, 0.92383, 0.97093, 1.0969, 0.97093, 1.05882, 0.75842, 0.9403, 0.75842, 0.9403, 0.75842, 0.9403, 0.75842, 0.9403, 0.75842, 0.9403, 0.88198, 1.05882, 0.88198, 1.05882, 0.88198, 1.05882, 1, 1, 0.9831, 1.01756, 0.9831, 1.01756, 0.95782, 0.8717, 0.95782, 0.8717, 0.95782, 0.8717, 0.95782, 1.09011, 0.95782, 0.8717, 0.84784, 1.11551, 0.71387, 1.09011, 1, 1, 0.99414, 0.84636, 1.09011, 1, 1, 0.84636, 1.0536, 0.84636, 0.94298, 0.84636, 1.23297, 1.03584, 1.01756, 1, 1, 1.03584, 1.01756, 1.00323, 1.03444, 1.01756, 0.96924, 1.05356, 0.96924, 1.05356, 0.96924, 1.05356, 0.93066, 0.98293, 0.82826, 1.04399, 1, 1, 0.82826, 1.04399, 0.79649, 0.84863, 0.79649, 0.84863, 0.79649, 0.84863, 0.79649, 0.84863, 1, 1, 0.85771, 1.17318, 0.85771, 1.21968, 0.95132, 1.01756, 0.95132, 1.01756, 0.95132, 1.01756, 0.95132, 1.01756, 0.95132, 1.01756, 0.95132, 1.01756, 0.98965, 1.00068, 0.8287, 0.96777, 0.8287, 0.93365, 0.9043, 0.93365, 0.9043, 0.93365, 0.9043, 1.08571, 0.96927, 0.96706, 0.91484, 0.86035, 0.93575, 0.96924, 0.95923, 1, 1, 0.85771, 1.21968, 1.11437, 1.11437, 0.93109, 0.91202, 0.60411, 0.84164, 0.55572, 1.01173, 0.97361, 0.81818, 0.81818, 0.96635, 0.78032, 0.72727, 0.92366, 0.98601, 1.03405, 0.77968, 1.09799, 1.2, 0.96706, 0.85944, 0.85638, 0.96491, 0.75842, 0.93365, 0.9831, 0.96924, 0.95782, 0.86969, 0.94152, 1.07796, 1.03584, 0.78437, 0.96924, 0.98715, 0.83968, 0.83491, 0.85771, 0.8287, 0.94492, 0.88433, 0.9287, 1.0098, 0.95782, 0.8287, 1.0625, 0.98248, 1.03424, 1.2, 1.01071, 1.0625, 0.95246, 1.03809, 1.04912, 0.98248, 1.00221, 1.03424, 1.05443, 1.2, 1.04785, 0.99609, 1.00169, 1.05176, 0.99346, 1.05356, 0.9087, 1.03004, 0.95542, 0.93117, 1.23362, 1.01071, 1.07831, 1.02512, 1.05205, 1.03502, 1.2, 1.01071, 1.05356, 1.01071, 1.03502, 0.75842, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.03719, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.9403, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.04021, 1, 1, 1, 1, 1, 1, 0.98965, 1.00068, 0.98965, 1.00068, 0.98965, 1.00068, 0.8287, 0.96777, 1, 1.20088, 0.89903, 1, 1, 0.75155, 1.03077, 1.03077, 1.03077, 1.03077, 1.13196, 1.13196, 1.13196, 0.67428, 0.67428, 1.16039, 0.73291, 1.20996, 1.22135, 1.06483, 0.94868, 0.94868, 0.95996, 1.24633, 1, 1.07497, 0.87796, 0.96927, 1.01518, 0.96927, 1, 1, 1, 0.77295, 1, 1, 1.10539, 1.10539, 1.11358, 1.06967, 0.86279, 0.94434, 0.86279, 0.94434, 0.86182, 1, 1, 1.083, 1, 0.91578, 0.86507, 1.1714, 1.18416, 1.14589, 0.69825, 0.97622, 1.9697, 1.24822, 1.24822, 1.17238, 1.24822, 1.24822, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.42603, 1, 0.99862, 0.99862, 1, 0.87025, 0.87025, 0.87025, 0.87025, 1.18083, 1.42603, 1, 1.42603, 1.42603, 0.99862, 1, 1, 1, 1, 1, 1.2886, 1.04315, 1.15296, 1.34163, 1, 1, 1, 1.10938, 1.10938, 1, 1, 1, 1.05425, 1.09971, 1.09971, 1.09971, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
  29200. const SegoeuiRegularMetrics = {
  29201. lineHeight: 1.33008,
  29202. lineGap: 0
  29203. };
  29204. ;// ./src/core/xfa_fonts.js
  29205. const getXFAFontMap = getLookupTableFactory(function (t) {
  29206. t["MyriadPro-Regular"] = t["PdfJS-Fallback-Regular"] = {
  29207. name: "LiberationSans-Regular",
  29208. factors: MyriadProRegularFactors,
  29209. baseWidths: LiberationSansRegularWidths,
  29210. baseMapping: LiberationSansRegularMapping,
  29211. metrics: MyriadProRegularMetrics
  29212. };
  29213. t["MyriadPro-Bold"] = t["PdfJS-Fallback-Bold"] = {
  29214. name: "LiberationSans-Bold",
  29215. factors: MyriadProBoldFactors,
  29216. baseWidths: LiberationSansBoldWidths,
  29217. baseMapping: LiberationSansBoldMapping,
  29218. metrics: MyriadProBoldMetrics
  29219. };
  29220. t["MyriadPro-It"] = t["MyriadPro-Italic"] = t["PdfJS-Fallback-Italic"] = {
  29221. name: "LiberationSans-Italic",
  29222. factors: MyriadProItalicFactors,
  29223. baseWidths: LiberationSansItalicWidths,
  29224. baseMapping: LiberationSansItalicMapping,
  29225. metrics: MyriadProItalicMetrics
  29226. };
  29227. t["MyriadPro-BoldIt"] = t["MyriadPro-BoldItalic"] = t["PdfJS-Fallback-BoldItalic"] = {
  29228. name: "LiberationSans-BoldItalic",
  29229. factors: MyriadProBoldItalicFactors,
  29230. baseWidths: LiberationSansBoldItalicWidths,
  29231. baseMapping: LiberationSansBoldItalicMapping,
  29232. metrics: MyriadProBoldItalicMetrics
  29233. };
  29234. t.ArialMT = t.Arial = t["Arial-Regular"] = {
  29235. name: "LiberationSans-Regular",
  29236. baseWidths: LiberationSansRegularWidths,
  29237. baseMapping: LiberationSansRegularMapping
  29238. };
  29239. t["Arial-BoldMT"] = t["Arial-Bold"] = {
  29240. name: "LiberationSans-Bold",
  29241. baseWidths: LiberationSansBoldWidths,
  29242. baseMapping: LiberationSansBoldMapping
  29243. };
  29244. t["Arial-ItalicMT"] = t["Arial-Italic"] = {
  29245. name: "LiberationSans-Italic",
  29246. baseWidths: LiberationSansItalicWidths,
  29247. baseMapping: LiberationSansItalicMapping
  29248. };
  29249. t["Arial-BoldItalicMT"] = t["Arial-BoldItalic"] = {
  29250. name: "LiberationSans-BoldItalic",
  29251. baseWidths: LiberationSansBoldItalicWidths,
  29252. baseMapping: LiberationSansBoldItalicMapping
  29253. };
  29254. t["Calibri-Regular"] = {
  29255. name: "LiberationSans-Regular",
  29256. factors: CalibriRegularFactors,
  29257. baseWidths: LiberationSansRegularWidths,
  29258. baseMapping: LiberationSansRegularMapping,
  29259. metrics: CalibriRegularMetrics
  29260. };
  29261. t["Calibri-Bold"] = {
  29262. name: "LiberationSans-Bold",
  29263. factors: CalibriBoldFactors,
  29264. baseWidths: LiberationSansBoldWidths,
  29265. baseMapping: LiberationSansBoldMapping,
  29266. metrics: CalibriBoldMetrics
  29267. };
  29268. t["Calibri-Italic"] = {
  29269. name: "LiberationSans-Italic",
  29270. factors: CalibriItalicFactors,
  29271. baseWidths: LiberationSansItalicWidths,
  29272. baseMapping: LiberationSansItalicMapping,
  29273. metrics: CalibriItalicMetrics
  29274. };
  29275. t["Calibri-BoldItalic"] = {
  29276. name: "LiberationSans-BoldItalic",
  29277. factors: CalibriBoldItalicFactors,
  29278. baseWidths: LiberationSansBoldItalicWidths,
  29279. baseMapping: LiberationSansBoldItalicMapping,
  29280. metrics: CalibriBoldItalicMetrics
  29281. };
  29282. t["Segoeui-Regular"] = {
  29283. name: "LiberationSans-Regular",
  29284. factors: SegoeuiRegularFactors,
  29285. baseWidths: LiberationSansRegularWidths,
  29286. baseMapping: LiberationSansRegularMapping,
  29287. metrics: SegoeuiRegularMetrics
  29288. };
  29289. t["Segoeui-Bold"] = {
  29290. name: "LiberationSans-Bold",
  29291. factors: SegoeuiBoldFactors,
  29292. baseWidths: LiberationSansBoldWidths,
  29293. baseMapping: LiberationSansBoldMapping,
  29294. metrics: SegoeuiBoldMetrics
  29295. };
  29296. t["Segoeui-Italic"] = {
  29297. name: "LiberationSans-Italic",
  29298. factors: SegoeuiItalicFactors,
  29299. baseWidths: LiberationSansItalicWidths,
  29300. baseMapping: LiberationSansItalicMapping,
  29301. metrics: SegoeuiItalicMetrics
  29302. };
  29303. t["Segoeui-BoldItalic"] = {
  29304. name: "LiberationSans-BoldItalic",
  29305. factors: SegoeuiBoldItalicFactors,
  29306. baseWidths: LiberationSansBoldItalicWidths,
  29307. baseMapping: LiberationSansBoldItalicMapping,
  29308. metrics: SegoeuiBoldItalicMetrics
  29309. };
  29310. t["Helvetica-Regular"] = t.Helvetica = {
  29311. name: "LiberationSans-Regular",
  29312. factors: HelveticaRegularFactors,
  29313. baseWidths: LiberationSansRegularWidths,
  29314. baseMapping: LiberationSansRegularMapping,
  29315. metrics: HelveticaRegularMetrics
  29316. };
  29317. t["Helvetica-Bold"] = {
  29318. name: "LiberationSans-Bold",
  29319. factors: HelveticaBoldFactors,
  29320. baseWidths: LiberationSansBoldWidths,
  29321. baseMapping: LiberationSansBoldMapping,
  29322. metrics: HelveticaBoldMetrics
  29323. };
  29324. t["Helvetica-Italic"] = {
  29325. name: "LiberationSans-Italic",
  29326. factors: HelveticaItalicFactors,
  29327. baseWidths: LiberationSansItalicWidths,
  29328. baseMapping: LiberationSansItalicMapping,
  29329. metrics: HelveticaItalicMetrics
  29330. };
  29331. t["Helvetica-BoldItalic"] = {
  29332. name: "LiberationSans-BoldItalic",
  29333. factors: HelveticaBoldItalicFactors,
  29334. baseWidths: LiberationSansBoldItalicWidths,
  29335. baseMapping: LiberationSansBoldItalicMapping,
  29336. metrics: HelveticaBoldItalicMetrics
  29337. };
  29338. });
  29339. function getXfaFontName(name) {
  29340. const fontName = normalizeFontName(name);
  29341. const fontMap = getXFAFontMap();
  29342. return fontMap[fontName];
  29343. }
  29344. function getXfaFontWidths(name) {
  29345. const info = getXfaFontName(name);
  29346. if (!info) {
  29347. return null;
  29348. }
  29349. const {
  29350. baseWidths,
  29351. baseMapping,
  29352. factors
  29353. } = info;
  29354. const rescaledBaseWidths = !factors ? baseWidths : baseWidths.map((w, i) => w * factors[i]);
  29355. let currentCode = -2;
  29356. let currentArray;
  29357. const newWidths = [];
  29358. for (const [unicode, glyphIndex] of baseMapping.map((charUnicode, index) => [charUnicode, index]).sort(([unicode1], [unicode2]) => unicode1 - unicode2)) {
  29359. if (unicode === -1) {
  29360. continue;
  29361. }
  29362. if (unicode === currentCode + 1) {
  29363. currentArray.push(rescaledBaseWidths[glyphIndex]);
  29364. currentCode += 1;
  29365. } else {
  29366. currentCode = unicode;
  29367. currentArray = [rescaledBaseWidths[glyphIndex]];
  29368. newWidths.push(unicode, currentArray);
  29369. }
  29370. }
  29371. return newWidths;
  29372. }
  29373. function getXfaFontDict(name) {
  29374. const widths = getXfaFontWidths(name);
  29375. const dict = new Dict(null);
  29376. dict.set("BaseFont", Name.get(name));
  29377. dict.set("Type", Name.get("Font"));
  29378. dict.set("Subtype", Name.get("CIDFontType2"));
  29379. dict.set("Encoding", Name.get("Identity-H"));
  29380. dict.set("CIDToGIDMap", Name.get("Identity"));
  29381. dict.set("W", widths);
  29382. dict.set("FirstChar", widths[0]);
  29383. dict.set("LastChar", widths.at(-2) + widths.at(-1).length - 1);
  29384. const descriptor = new Dict(null);
  29385. dict.set("FontDescriptor", descriptor);
  29386. const systemInfo = new Dict(null);
  29387. systemInfo.set("Ordering", "Identity");
  29388. systemInfo.set("Registry", "Adobe");
  29389. systemInfo.set("Supplement", 0);
  29390. dict.set("CIDSystemInfo", systemInfo);
  29391. return dict;
  29392. }
  29393. ;// ./src/core/ps_parser.js
  29394. class PostScriptParser {
  29395. constructor(lexer) {
  29396. this.lexer = lexer;
  29397. this.operators = [];
  29398. this.token = null;
  29399. this.prev = null;
  29400. }
  29401. nextToken() {
  29402. this.prev = this.token;
  29403. this.token = this.lexer.getToken();
  29404. }
  29405. accept(type) {
  29406. if (this.token.type === type) {
  29407. this.nextToken();
  29408. return true;
  29409. }
  29410. return false;
  29411. }
  29412. expect(type) {
  29413. if (this.accept(type)) {
  29414. return true;
  29415. }
  29416. throw new FormatError(`Unexpected symbol: found ${this.token.type} expected ${type}.`);
  29417. }
  29418. parse() {
  29419. this.nextToken();
  29420. this.expect(PostScriptTokenTypes.LBRACE);
  29421. this.parseBlock();
  29422. this.expect(PostScriptTokenTypes.RBRACE);
  29423. return this.operators;
  29424. }
  29425. parseBlock() {
  29426. while (true) {
  29427. if (this.accept(PostScriptTokenTypes.NUMBER)) {
  29428. this.operators.push(this.prev.value);
  29429. } else if (this.accept(PostScriptTokenTypes.OPERATOR)) {
  29430. this.operators.push(this.prev.value);
  29431. } else if (this.accept(PostScriptTokenTypes.LBRACE)) {
  29432. this.parseCondition();
  29433. } else {
  29434. return;
  29435. }
  29436. }
  29437. }
  29438. parseCondition() {
  29439. const conditionLocation = this.operators.length;
  29440. this.operators.push(null, null);
  29441. this.parseBlock();
  29442. this.expect(PostScriptTokenTypes.RBRACE);
  29443. if (this.accept(PostScriptTokenTypes.IF)) {
  29444. this.operators[conditionLocation] = this.operators.length;
  29445. this.operators[conditionLocation + 1] = "jz";
  29446. } else if (this.accept(PostScriptTokenTypes.LBRACE)) {
  29447. const jumpLocation = this.operators.length;
  29448. this.operators.push(null, null);
  29449. const endOfTrue = this.operators.length;
  29450. this.parseBlock();
  29451. this.expect(PostScriptTokenTypes.RBRACE);
  29452. this.expect(PostScriptTokenTypes.IFELSE);
  29453. this.operators[jumpLocation] = this.operators.length;
  29454. this.operators[jumpLocation + 1] = "j";
  29455. this.operators[conditionLocation] = endOfTrue;
  29456. this.operators[conditionLocation + 1] = "jz";
  29457. } else {
  29458. throw new FormatError("PS Function: error parsing conditional.");
  29459. }
  29460. }
  29461. }
  29462. const PostScriptTokenTypes = {
  29463. LBRACE: 0,
  29464. RBRACE: 1,
  29465. NUMBER: 2,
  29466. OPERATOR: 3,
  29467. IF: 4,
  29468. IFELSE: 5
  29469. };
  29470. class PostScriptToken {
  29471. static get opCache() {
  29472. return shadow(this, "opCache", Object.create(null));
  29473. }
  29474. constructor(type, value) {
  29475. this.type = type;
  29476. this.value = value;
  29477. }
  29478. static getOperator(op) {
  29479. return PostScriptToken.opCache[op] ||= new PostScriptToken(PostScriptTokenTypes.OPERATOR, op);
  29480. }
  29481. static get LBRACE() {
  29482. return shadow(this, "LBRACE", new PostScriptToken(PostScriptTokenTypes.LBRACE, "{"));
  29483. }
  29484. static get RBRACE() {
  29485. return shadow(this, "RBRACE", new PostScriptToken(PostScriptTokenTypes.RBRACE, "}"));
  29486. }
  29487. static get IF() {
  29488. return shadow(this, "IF", new PostScriptToken(PostScriptTokenTypes.IF, "IF"));
  29489. }
  29490. static get IFELSE() {
  29491. return shadow(this, "IFELSE", new PostScriptToken(PostScriptTokenTypes.IFELSE, "IFELSE"));
  29492. }
  29493. }
  29494. class PostScriptLexer {
  29495. constructor(stream) {
  29496. this.stream = stream;
  29497. this.nextChar();
  29498. this.strBuf = [];
  29499. }
  29500. nextChar() {
  29501. return this.currentChar = this.stream.getByte();
  29502. }
  29503. getToken() {
  29504. let comment = false;
  29505. let ch = this.currentChar;
  29506. while (true) {
  29507. if (ch < 0) {
  29508. return EOF;
  29509. }
  29510. if (comment) {
  29511. if (ch === 0x0a || ch === 0x0d) {
  29512. comment = false;
  29513. }
  29514. } else if (ch === 0x25) {
  29515. comment = true;
  29516. } else if (!isWhiteSpace(ch)) {
  29517. break;
  29518. }
  29519. ch = this.nextChar();
  29520. }
  29521. switch (ch | 0) {
  29522. case 0x30:
  29523. case 0x31:
  29524. case 0x32:
  29525. case 0x33:
  29526. case 0x34:
  29527. case 0x35:
  29528. case 0x36:
  29529. case 0x37:
  29530. case 0x38:
  29531. case 0x39:
  29532. case 0x2b:
  29533. case 0x2d:
  29534. case 0x2e:
  29535. return new PostScriptToken(PostScriptTokenTypes.NUMBER, this.getNumber());
  29536. case 0x7b:
  29537. this.nextChar();
  29538. return PostScriptToken.LBRACE;
  29539. case 0x7d:
  29540. this.nextChar();
  29541. return PostScriptToken.RBRACE;
  29542. }
  29543. const strBuf = this.strBuf;
  29544. strBuf.length = 0;
  29545. strBuf[0] = String.fromCharCode(ch);
  29546. while ((ch = this.nextChar()) >= 0 && (ch >= 0x41 && ch <= 0x5a || ch >= 0x61 && ch <= 0x7a)) {
  29547. strBuf.push(String.fromCharCode(ch));
  29548. }
  29549. const str = strBuf.join("");
  29550. switch (str.toLowerCase()) {
  29551. case "if":
  29552. return PostScriptToken.IF;
  29553. case "ifelse":
  29554. return PostScriptToken.IFELSE;
  29555. default:
  29556. return PostScriptToken.getOperator(str);
  29557. }
  29558. }
  29559. getNumber() {
  29560. let ch = this.currentChar;
  29561. const strBuf = this.strBuf;
  29562. strBuf.length = 0;
  29563. strBuf[0] = String.fromCharCode(ch);
  29564. while ((ch = this.nextChar()) >= 0) {
  29565. if (ch >= 0x30 && ch <= 0x39 || ch === 0x2d || ch === 0x2e) {
  29566. strBuf.push(String.fromCharCode(ch));
  29567. } else {
  29568. break;
  29569. }
  29570. }
  29571. const value = parseFloat(strBuf.join(""));
  29572. if (isNaN(value)) {
  29573. throw new FormatError(`Invalid floating point number: ${value}`);
  29574. }
  29575. return value;
  29576. }
  29577. }
  29578. ;// ./src/core/image_utils.js
  29579. class BaseLocalCache {
  29580. constructor(options) {
  29581. this._onlyRefs = options?.onlyRefs === true;
  29582. if (!this._onlyRefs) {
  29583. this._nameRefMap = new Map();
  29584. this._imageMap = new Map();
  29585. }
  29586. this._imageCache = new RefSetCache();
  29587. }
  29588. getByName(name) {
  29589. if (this._onlyRefs) {
  29590. unreachable("Should not call `getByName` method.");
  29591. }
  29592. const ref = this._nameRefMap.get(name);
  29593. if (ref) {
  29594. return this.getByRef(ref);
  29595. }
  29596. return this._imageMap.get(name) || null;
  29597. }
  29598. getByRef(ref) {
  29599. return this._imageCache.get(ref) || null;
  29600. }
  29601. set(name, ref, data) {
  29602. unreachable("Abstract method `set` called.");
  29603. }
  29604. }
  29605. class LocalImageCache extends BaseLocalCache {
  29606. set(name, ref = null, data) {
  29607. if (typeof name !== "string") {
  29608. throw new Error('LocalImageCache.set - expected "name" argument.');
  29609. }
  29610. if (ref) {
  29611. if (this._imageCache.has(ref)) {
  29612. return;
  29613. }
  29614. this._nameRefMap.set(name, ref);
  29615. this._imageCache.put(ref, data);
  29616. return;
  29617. }
  29618. if (this._imageMap.has(name)) {
  29619. return;
  29620. }
  29621. this._imageMap.set(name, data);
  29622. }
  29623. }
  29624. class LocalColorSpaceCache extends BaseLocalCache {
  29625. set(name = null, ref = null, data) {
  29626. if (typeof name !== "string" && !ref) {
  29627. throw new Error('LocalColorSpaceCache.set - expected "name" and/or "ref" argument.');
  29628. }
  29629. if (ref) {
  29630. if (this._imageCache.has(ref)) {
  29631. return;
  29632. }
  29633. if (name !== null) {
  29634. this._nameRefMap.set(name, ref);
  29635. }
  29636. this._imageCache.put(ref, data);
  29637. return;
  29638. }
  29639. if (this._imageMap.has(name)) {
  29640. return;
  29641. }
  29642. this._imageMap.set(name, data);
  29643. }
  29644. }
  29645. class LocalFunctionCache extends BaseLocalCache {
  29646. constructor(options) {
  29647. super({
  29648. onlyRefs: true
  29649. });
  29650. }
  29651. set(name = null, ref, data) {
  29652. if (!ref) {
  29653. throw new Error('LocalFunctionCache.set - expected "ref" argument.');
  29654. }
  29655. if (this._imageCache.has(ref)) {
  29656. return;
  29657. }
  29658. this._imageCache.put(ref, data);
  29659. }
  29660. }
  29661. class LocalGStateCache extends BaseLocalCache {
  29662. set(name, ref = null, data) {
  29663. if (typeof name !== "string") {
  29664. throw new Error('LocalGStateCache.set - expected "name" argument.');
  29665. }
  29666. if (ref) {
  29667. if (this._imageCache.has(ref)) {
  29668. return;
  29669. }
  29670. this._nameRefMap.set(name, ref);
  29671. this._imageCache.put(ref, data);
  29672. return;
  29673. }
  29674. if (this._imageMap.has(name)) {
  29675. return;
  29676. }
  29677. this._imageMap.set(name, data);
  29678. }
  29679. }
  29680. class LocalTilingPatternCache extends BaseLocalCache {
  29681. constructor(options) {
  29682. super({
  29683. onlyRefs: true
  29684. });
  29685. }
  29686. set(name = null, ref, data) {
  29687. if (!ref) {
  29688. throw new Error('LocalTilingPatternCache.set - expected "ref" argument.');
  29689. }
  29690. if (this._imageCache.has(ref)) {
  29691. return;
  29692. }
  29693. this._imageCache.put(ref, data);
  29694. }
  29695. }
  29696. class RegionalImageCache extends BaseLocalCache {
  29697. constructor(options) {
  29698. super({
  29699. onlyRefs: true
  29700. });
  29701. }
  29702. set(name = null, ref, data) {
  29703. if (!ref) {
  29704. throw new Error('RegionalImageCache.set - expected "ref" argument.');
  29705. }
  29706. if (this._imageCache.has(ref)) {
  29707. return;
  29708. }
  29709. this._imageCache.put(ref, data);
  29710. }
  29711. }
  29712. class GlobalImageCache {
  29713. static NUM_PAGES_THRESHOLD = 2;
  29714. static MIN_IMAGES_TO_CACHE = 10;
  29715. static MAX_BYTE_SIZE = 5 * MAX_IMAGE_SIZE_TO_CACHE;
  29716. #decodeFailedSet = new RefSet();
  29717. constructor() {
  29718. this._refCache = new RefSetCache();
  29719. this._imageCache = new RefSetCache();
  29720. }
  29721. get #byteSize() {
  29722. let byteSize = 0;
  29723. for (const imageData of this._imageCache) {
  29724. byteSize += imageData.byteSize;
  29725. }
  29726. return byteSize;
  29727. }
  29728. get #cacheLimitReached() {
  29729. if (this._imageCache.size < GlobalImageCache.MIN_IMAGES_TO_CACHE) {
  29730. return false;
  29731. }
  29732. if (this.#byteSize < GlobalImageCache.MAX_BYTE_SIZE) {
  29733. return false;
  29734. }
  29735. return true;
  29736. }
  29737. shouldCache(ref, pageIndex) {
  29738. let pageIndexSet = this._refCache.get(ref);
  29739. if (!pageIndexSet) {
  29740. pageIndexSet = new Set();
  29741. this._refCache.put(ref, pageIndexSet);
  29742. }
  29743. pageIndexSet.add(pageIndex);
  29744. if (pageIndexSet.size < GlobalImageCache.NUM_PAGES_THRESHOLD) {
  29745. return false;
  29746. }
  29747. if (!this._imageCache.has(ref) && this.#cacheLimitReached) {
  29748. return false;
  29749. }
  29750. return true;
  29751. }
  29752. addDecodeFailed(ref) {
  29753. this.#decodeFailedSet.put(ref);
  29754. }
  29755. hasDecodeFailed(ref) {
  29756. return this.#decodeFailedSet.has(ref);
  29757. }
  29758. addByteSize(ref, byteSize) {
  29759. const imageData = this._imageCache.get(ref);
  29760. if (!imageData) {
  29761. return;
  29762. }
  29763. if (imageData.byteSize) {
  29764. return;
  29765. }
  29766. imageData.byteSize = byteSize;
  29767. }
  29768. getData(ref, pageIndex) {
  29769. const pageIndexSet = this._refCache.get(ref);
  29770. if (!pageIndexSet) {
  29771. return null;
  29772. }
  29773. if (pageIndexSet.size < GlobalImageCache.NUM_PAGES_THRESHOLD) {
  29774. return null;
  29775. }
  29776. const imageData = this._imageCache.get(ref);
  29777. if (!imageData) {
  29778. return null;
  29779. }
  29780. pageIndexSet.add(pageIndex);
  29781. return imageData;
  29782. }
  29783. setData(ref, data) {
  29784. if (!this._refCache.has(ref)) {
  29785. throw new Error('GlobalImageCache.setData - expected "shouldCache" to have been called.');
  29786. }
  29787. if (this._imageCache.has(ref)) {
  29788. return;
  29789. }
  29790. if (this.#cacheLimitReached) {
  29791. warn("GlobalImageCache.setData - cache limit reached.");
  29792. return;
  29793. }
  29794. this._imageCache.put(ref, data);
  29795. }
  29796. clear(onlyData = false) {
  29797. if (!onlyData) {
  29798. this.#decodeFailedSet.clear();
  29799. this._refCache.clear();
  29800. }
  29801. this._imageCache.clear();
  29802. }
  29803. }
  29804. ;// ./src/core/function.js
  29805. class PDFFunctionFactory {
  29806. constructor({
  29807. xref,
  29808. isEvalSupported = true
  29809. }) {
  29810. this.xref = xref;
  29811. this.isEvalSupported = isEvalSupported !== false;
  29812. }
  29813. create(fn) {
  29814. const cachedFunction = this.getCached(fn);
  29815. if (cachedFunction) {
  29816. return cachedFunction;
  29817. }
  29818. const parsedFunction = PDFFunction.parse({
  29819. xref: this.xref,
  29820. isEvalSupported: this.isEvalSupported,
  29821. fn: fn instanceof Ref ? this.xref.fetch(fn) : fn
  29822. });
  29823. this._cache(fn, parsedFunction);
  29824. return parsedFunction;
  29825. }
  29826. createFromArray(fnObj) {
  29827. const cachedFunction = this.getCached(fnObj);
  29828. if (cachedFunction) {
  29829. return cachedFunction;
  29830. }
  29831. const parsedFunction = PDFFunction.parseArray({
  29832. xref: this.xref,
  29833. isEvalSupported: this.isEvalSupported,
  29834. fnObj: fnObj instanceof Ref ? this.xref.fetch(fnObj) : fnObj
  29835. });
  29836. this._cache(fnObj, parsedFunction);
  29837. return parsedFunction;
  29838. }
  29839. getCached(cacheKey) {
  29840. let fnRef;
  29841. if (cacheKey instanceof Ref) {
  29842. fnRef = cacheKey;
  29843. } else if (cacheKey instanceof Dict) {
  29844. fnRef = cacheKey.objId;
  29845. } else if (cacheKey instanceof BaseStream) {
  29846. fnRef = cacheKey.dict?.objId;
  29847. }
  29848. if (fnRef) {
  29849. const localFunction = this._localFunctionCache.getByRef(fnRef);
  29850. if (localFunction) {
  29851. return localFunction;
  29852. }
  29853. }
  29854. return null;
  29855. }
  29856. _cache(cacheKey, parsedFunction) {
  29857. if (!parsedFunction) {
  29858. throw new Error('PDFFunctionFactory._cache - expected "parsedFunction" argument.');
  29859. }
  29860. let fnRef;
  29861. if (cacheKey instanceof Ref) {
  29862. fnRef = cacheKey;
  29863. } else if (cacheKey instanceof Dict) {
  29864. fnRef = cacheKey.objId;
  29865. } else if (cacheKey instanceof BaseStream) {
  29866. fnRef = cacheKey.dict?.objId;
  29867. }
  29868. if (fnRef) {
  29869. this._localFunctionCache.set(null, fnRef, parsedFunction);
  29870. }
  29871. }
  29872. get _localFunctionCache() {
  29873. return shadow(this, "_localFunctionCache", new LocalFunctionCache());
  29874. }
  29875. }
  29876. function toNumberArray(arr) {
  29877. if (!Array.isArray(arr)) {
  29878. return null;
  29879. }
  29880. if (!isNumberArray(arr, null)) {
  29881. return arr.map(x => +x);
  29882. }
  29883. return arr;
  29884. }
  29885. class PDFFunction {
  29886. static getSampleArray(size, outputSize, bps, stream) {
  29887. let i, ii;
  29888. let length = 1;
  29889. for (i = 0, ii = size.length; i < ii; i++) {
  29890. length *= size[i];
  29891. }
  29892. length *= outputSize;
  29893. const array = new Array(length);
  29894. let codeSize = 0;
  29895. let codeBuf = 0;
  29896. const sampleMul = 1.0 / (2.0 ** bps - 1);
  29897. const strBytes = stream.getBytes((length * bps + 7) / 8);
  29898. let strIdx = 0;
  29899. for (i = 0; i < length; i++) {
  29900. while (codeSize < bps) {
  29901. codeBuf <<= 8;
  29902. codeBuf |= strBytes[strIdx++];
  29903. codeSize += 8;
  29904. }
  29905. codeSize -= bps;
  29906. array[i] = (codeBuf >> codeSize) * sampleMul;
  29907. codeBuf &= (1 << codeSize) - 1;
  29908. }
  29909. return array;
  29910. }
  29911. static parse({
  29912. xref,
  29913. isEvalSupported,
  29914. fn
  29915. }) {
  29916. const dict = fn.dict || fn;
  29917. const typeNum = dict.get("FunctionType");
  29918. switch (typeNum) {
  29919. case 0:
  29920. return this.constructSampled({
  29921. xref,
  29922. isEvalSupported,
  29923. fn,
  29924. dict
  29925. });
  29926. case 1:
  29927. break;
  29928. case 2:
  29929. return this.constructInterpolated({
  29930. xref,
  29931. isEvalSupported,
  29932. dict
  29933. });
  29934. case 3:
  29935. return this.constructStiched({
  29936. xref,
  29937. isEvalSupported,
  29938. dict
  29939. });
  29940. case 4:
  29941. return this.constructPostScript({
  29942. xref,
  29943. isEvalSupported,
  29944. fn,
  29945. dict
  29946. });
  29947. }
  29948. throw new FormatError("Unknown type of function");
  29949. }
  29950. static parseArray({
  29951. xref,
  29952. isEvalSupported,
  29953. fnObj
  29954. }) {
  29955. if (!Array.isArray(fnObj)) {
  29956. return this.parse({
  29957. xref,
  29958. isEvalSupported,
  29959. fn: fnObj
  29960. });
  29961. }
  29962. const fnArray = [];
  29963. for (const fn of fnObj) {
  29964. fnArray.push(this.parse({
  29965. xref,
  29966. isEvalSupported,
  29967. fn: xref.fetchIfRef(fn)
  29968. }));
  29969. }
  29970. return function (src, srcOffset, dest, destOffset) {
  29971. for (let i = 0, ii = fnArray.length; i < ii; i++) {
  29972. fnArray[i](src, srcOffset, dest, destOffset + i);
  29973. }
  29974. };
  29975. }
  29976. static constructSampled({
  29977. xref,
  29978. isEvalSupported,
  29979. fn,
  29980. dict
  29981. }) {
  29982. function toMultiArray(arr) {
  29983. const inputLength = arr.length;
  29984. const out = [];
  29985. let index = 0;
  29986. for (let i = 0; i < inputLength; i += 2) {
  29987. out[index++] = [arr[i], arr[i + 1]];
  29988. }
  29989. return out;
  29990. }
  29991. function interpolate(x, xmin, xmax, ymin, ymax) {
  29992. return ymin + (x - xmin) * ((ymax - ymin) / (xmax - xmin));
  29993. }
  29994. let domain = toNumberArray(dict.getArray("Domain"));
  29995. let range = toNumberArray(dict.getArray("Range"));
  29996. if (!domain || !range) {
  29997. throw new FormatError("No domain or range");
  29998. }
  29999. const inputSize = domain.length / 2;
  30000. const outputSize = range.length / 2;
  30001. domain = toMultiArray(domain);
  30002. range = toMultiArray(range);
  30003. const size = toNumberArray(dict.getArray("Size"));
  30004. const bps = dict.get("BitsPerSample");
  30005. const order = dict.get("Order") || 1;
  30006. if (order !== 1) {
  30007. info("No support for cubic spline interpolation: " + order);
  30008. }
  30009. let encode = toNumberArray(dict.getArray("Encode"));
  30010. if (!encode) {
  30011. encode = [];
  30012. for (let i = 0; i < inputSize; ++i) {
  30013. encode.push([0, size[i] - 1]);
  30014. }
  30015. } else {
  30016. encode = toMultiArray(encode);
  30017. }
  30018. let decode = toNumberArray(dict.getArray("Decode"));
  30019. decode = !decode ? range : toMultiArray(decode);
  30020. const samples = this.getSampleArray(size, outputSize, bps, fn);
  30021. return function constructSampledFn(src, srcOffset, dest, destOffset) {
  30022. const cubeVertices = 1 << inputSize;
  30023. const cubeN = new Float64Array(cubeVertices);
  30024. const cubeVertex = new Uint32Array(cubeVertices);
  30025. let i, j;
  30026. for (j = 0; j < cubeVertices; j++) {
  30027. cubeN[j] = 1;
  30028. }
  30029. let k = outputSize,
  30030. pos = 1;
  30031. for (i = 0; i < inputSize; ++i) {
  30032. const domain_2i = domain[i][0];
  30033. const domain_2i_1 = domain[i][1];
  30034. const xi = Math.min(Math.max(src[srcOffset + i], domain_2i), domain_2i_1);
  30035. let e = interpolate(xi, domain_2i, domain_2i_1, encode[i][0], encode[i][1]);
  30036. const size_i = size[i];
  30037. e = Math.min(Math.max(e, 0), size_i - 1);
  30038. const e0 = e < size_i - 1 ? Math.floor(e) : e - 1;
  30039. const n0 = e0 + 1 - e;
  30040. const n1 = e - e0;
  30041. const offset0 = e0 * k;
  30042. const offset1 = offset0 + k;
  30043. for (j = 0; j < cubeVertices; j++) {
  30044. if (j & pos) {
  30045. cubeN[j] *= n1;
  30046. cubeVertex[j] += offset1;
  30047. } else {
  30048. cubeN[j] *= n0;
  30049. cubeVertex[j] += offset0;
  30050. }
  30051. }
  30052. k *= size_i;
  30053. pos <<= 1;
  30054. }
  30055. for (j = 0; j < outputSize; ++j) {
  30056. let rj = 0;
  30057. for (i = 0; i < cubeVertices; i++) {
  30058. rj += samples[cubeVertex[i] + j] * cubeN[i];
  30059. }
  30060. rj = interpolate(rj, 0, 1, decode[j][0], decode[j][1]);
  30061. dest[destOffset + j] = Math.min(Math.max(rj, range[j][0]), range[j][1]);
  30062. }
  30063. };
  30064. }
  30065. static constructInterpolated({
  30066. xref,
  30067. isEvalSupported,
  30068. dict
  30069. }) {
  30070. const c0 = toNumberArray(dict.getArray("C0")) || [0];
  30071. const c1 = toNumberArray(dict.getArray("C1")) || [1];
  30072. const n = dict.get("N");
  30073. const diff = [];
  30074. for (let i = 0, ii = c0.length; i < ii; ++i) {
  30075. diff.push(c1[i] - c0[i]);
  30076. }
  30077. const length = diff.length;
  30078. return function constructInterpolatedFn(src, srcOffset, dest, destOffset) {
  30079. const x = n === 1 ? src[srcOffset] : src[srcOffset] ** n;
  30080. for (let j = 0; j < length; ++j) {
  30081. dest[destOffset + j] = c0[j] + x * diff[j];
  30082. }
  30083. };
  30084. }
  30085. static constructStiched({
  30086. xref,
  30087. isEvalSupported,
  30088. dict
  30089. }) {
  30090. const domain = toNumberArray(dict.getArray("Domain"));
  30091. if (!domain) {
  30092. throw new FormatError("No domain");
  30093. }
  30094. const inputSize = domain.length / 2;
  30095. if (inputSize !== 1) {
  30096. throw new FormatError("Bad domain for stiched function");
  30097. }
  30098. const fns = [];
  30099. for (const fn of dict.get("Functions")) {
  30100. fns.push(this.parse({
  30101. xref,
  30102. isEvalSupported,
  30103. fn: xref.fetchIfRef(fn)
  30104. }));
  30105. }
  30106. const bounds = toNumberArray(dict.getArray("Bounds"));
  30107. const encode = toNumberArray(dict.getArray("Encode"));
  30108. const tmpBuf = new Float32Array(1);
  30109. return function constructStichedFn(src, srcOffset, dest, destOffset) {
  30110. const clip = function constructStichedFromIRClip(v, min, max) {
  30111. if (v > max) {
  30112. v = max;
  30113. } else if (v < min) {
  30114. v = min;
  30115. }
  30116. return v;
  30117. };
  30118. const v = clip(src[srcOffset], domain[0], domain[1]);
  30119. const length = bounds.length;
  30120. let i;
  30121. for (i = 0; i < length; ++i) {
  30122. if (v < bounds[i]) {
  30123. break;
  30124. }
  30125. }
  30126. let dmin = domain[0];
  30127. if (i > 0) {
  30128. dmin = bounds[i - 1];
  30129. }
  30130. let dmax = domain[1];
  30131. if (i < bounds.length) {
  30132. dmax = bounds[i];
  30133. }
  30134. const rmin = encode[2 * i];
  30135. const rmax = encode[2 * i + 1];
  30136. tmpBuf[0] = dmin === dmax ? rmin : rmin + (v - dmin) * (rmax - rmin) / (dmax - dmin);
  30137. fns[i](tmpBuf, 0, dest, destOffset);
  30138. };
  30139. }
  30140. static constructPostScript({
  30141. xref,
  30142. isEvalSupported,
  30143. fn,
  30144. dict
  30145. }) {
  30146. const domain = toNumberArray(dict.getArray("Domain"));
  30147. const range = toNumberArray(dict.getArray("Range"));
  30148. if (!domain) {
  30149. throw new FormatError("No domain.");
  30150. }
  30151. if (!range) {
  30152. throw new FormatError("No range.");
  30153. }
  30154. const lexer = new PostScriptLexer(fn);
  30155. const parser = new PostScriptParser(lexer);
  30156. const code = parser.parse();
  30157. if (isEvalSupported && FeatureTest.isEvalSupported) {
  30158. const compiled = new PostScriptCompiler().compile(code, domain, range);
  30159. if (compiled) {
  30160. return new Function("src", "srcOffset", "dest", "destOffset", compiled);
  30161. }
  30162. }
  30163. info("Unable to compile PS function");
  30164. const numOutputs = range.length >> 1;
  30165. const numInputs = domain.length >> 1;
  30166. const evaluator = new PostScriptEvaluator(code);
  30167. const cache = Object.create(null);
  30168. const MAX_CACHE_SIZE = 2048 * 4;
  30169. let cache_available = MAX_CACHE_SIZE;
  30170. const tmpBuf = new Float32Array(numInputs);
  30171. return function constructPostScriptFn(src, srcOffset, dest, destOffset) {
  30172. let i, value;
  30173. let key = "";
  30174. const input = tmpBuf;
  30175. for (i = 0; i < numInputs; i++) {
  30176. value = src[srcOffset + i];
  30177. input[i] = value;
  30178. key += value + "_";
  30179. }
  30180. const cachedValue = cache[key];
  30181. if (cachedValue !== undefined) {
  30182. dest.set(cachedValue, destOffset);
  30183. return;
  30184. }
  30185. const output = new Float32Array(numOutputs);
  30186. const stack = evaluator.execute(input);
  30187. const stackIndex = stack.length - numOutputs;
  30188. for (i = 0; i < numOutputs; i++) {
  30189. value = stack[stackIndex + i];
  30190. let bound = range[i * 2];
  30191. if (value < bound) {
  30192. value = bound;
  30193. } else {
  30194. bound = range[i * 2 + 1];
  30195. if (value > bound) {
  30196. value = bound;
  30197. }
  30198. }
  30199. output[i] = value;
  30200. }
  30201. if (cache_available > 0) {
  30202. cache_available--;
  30203. cache[key] = output;
  30204. }
  30205. dest.set(output, destOffset);
  30206. };
  30207. }
  30208. }
  30209. function isPDFFunction(v) {
  30210. let fnDict;
  30211. if (v instanceof Dict) {
  30212. fnDict = v;
  30213. } else if (v instanceof BaseStream) {
  30214. fnDict = v.dict;
  30215. } else {
  30216. return false;
  30217. }
  30218. return fnDict.has("FunctionType");
  30219. }
  30220. class PostScriptStack {
  30221. static MAX_STACK_SIZE = 100;
  30222. constructor(initialStack) {
  30223. this.stack = initialStack ? Array.from(initialStack) : [];
  30224. }
  30225. push(value) {
  30226. if (this.stack.length >= PostScriptStack.MAX_STACK_SIZE) {
  30227. throw new Error("PostScript function stack overflow.");
  30228. }
  30229. this.stack.push(value);
  30230. }
  30231. pop() {
  30232. if (this.stack.length <= 0) {
  30233. throw new Error("PostScript function stack underflow.");
  30234. }
  30235. return this.stack.pop();
  30236. }
  30237. copy(n) {
  30238. if (this.stack.length + n >= PostScriptStack.MAX_STACK_SIZE) {
  30239. throw new Error("PostScript function stack overflow.");
  30240. }
  30241. const stack = this.stack;
  30242. for (let i = stack.length - n, j = n - 1; j >= 0; j--, i++) {
  30243. stack.push(stack[i]);
  30244. }
  30245. }
  30246. index(n) {
  30247. this.push(this.stack[this.stack.length - n - 1]);
  30248. }
  30249. roll(n, p) {
  30250. const stack = this.stack;
  30251. const l = stack.length - n;
  30252. const r = stack.length - 1;
  30253. const c = l + (p - Math.floor(p / n) * n);
  30254. for (let i = l, j = r; i < j; i++, j--) {
  30255. const t = stack[i];
  30256. stack[i] = stack[j];
  30257. stack[j] = t;
  30258. }
  30259. for (let i = l, j = c - 1; i < j; i++, j--) {
  30260. const t = stack[i];
  30261. stack[i] = stack[j];
  30262. stack[j] = t;
  30263. }
  30264. for (let i = c, j = r; i < j; i++, j--) {
  30265. const t = stack[i];
  30266. stack[i] = stack[j];
  30267. stack[j] = t;
  30268. }
  30269. }
  30270. }
  30271. class PostScriptEvaluator {
  30272. constructor(operators) {
  30273. this.operators = operators;
  30274. }
  30275. execute(initialStack) {
  30276. const stack = new PostScriptStack(initialStack);
  30277. let counter = 0;
  30278. const operators = this.operators;
  30279. const length = operators.length;
  30280. let operator, a, b;
  30281. while (counter < length) {
  30282. operator = operators[counter++];
  30283. if (typeof operator === "number") {
  30284. stack.push(operator);
  30285. continue;
  30286. }
  30287. switch (operator) {
  30288. case "jz":
  30289. b = stack.pop();
  30290. a = stack.pop();
  30291. if (!a) {
  30292. counter = b;
  30293. }
  30294. break;
  30295. case "j":
  30296. a = stack.pop();
  30297. counter = a;
  30298. break;
  30299. case "abs":
  30300. a = stack.pop();
  30301. stack.push(Math.abs(a));
  30302. break;
  30303. case "add":
  30304. b = stack.pop();
  30305. a = stack.pop();
  30306. stack.push(a + b);
  30307. break;
  30308. case "and":
  30309. b = stack.pop();
  30310. a = stack.pop();
  30311. if (typeof a === "boolean" && typeof b === "boolean") {
  30312. stack.push(a && b);
  30313. } else {
  30314. stack.push(a & b);
  30315. }
  30316. break;
  30317. case "atan":
  30318. b = stack.pop();
  30319. a = stack.pop();
  30320. a = Math.atan2(a, b) / Math.PI * 180;
  30321. if (a < 0) {
  30322. a += 360;
  30323. }
  30324. stack.push(a);
  30325. break;
  30326. case "bitshift":
  30327. b = stack.pop();
  30328. a = stack.pop();
  30329. if (a > 0) {
  30330. stack.push(a << b);
  30331. } else {
  30332. stack.push(a >> b);
  30333. }
  30334. break;
  30335. case "ceiling":
  30336. a = stack.pop();
  30337. stack.push(Math.ceil(a));
  30338. break;
  30339. case "copy":
  30340. a = stack.pop();
  30341. stack.copy(a);
  30342. break;
  30343. case "cos":
  30344. a = stack.pop();
  30345. stack.push(Math.cos(a % 360 / 180 * Math.PI));
  30346. break;
  30347. case "cvi":
  30348. a = stack.pop() | 0;
  30349. stack.push(a);
  30350. break;
  30351. case "cvr":
  30352. break;
  30353. case "div":
  30354. b = stack.pop();
  30355. a = stack.pop();
  30356. stack.push(a / b);
  30357. break;
  30358. case "dup":
  30359. stack.copy(1);
  30360. break;
  30361. case "eq":
  30362. b = stack.pop();
  30363. a = stack.pop();
  30364. stack.push(a === b);
  30365. break;
  30366. case "exch":
  30367. stack.roll(2, 1);
  30368. break;
  30369. case "exp":
  30370. b = stack.pop();
  30371. a = stack.pop();
  30372. stack.push(a ** b);
  30373. break;
  30374. case "false":
  30375. stack.push(false);
  30376. break;
  30377. case "floor":
  30378. a = stack.pop();
  30379. stack.push(Math.floor(a));
  30380. break;
  30381. case "ge":
  30382. b = stack.pop();
  30383. a = stack.pop();
  30384. stack.push(a >= b);
  30385. break;
  30386. case "gt":
  30387. b = stack.pop();
  30388. a = stack.pop();
  30389. stack.push(a > b);
  30390. break;
  30391. case "idiv":
  30392. b = stack.pop();
  30393. a = stack.pop();
  30394. stack.push(a / b | 0);
  30395. break;
  30396. case "index":
  30397. a = stack.pop();
  30398. stack.index(a);
  30399. break;
  30400. case "le":
  30401. b = stack.pop();
  30402. a = stack.pop();
  30403. stack.push(a <= b);
  30404. break;
  30405. case "ln":
  30406. a = stack.pop();
  30407. stack.push(Math.log(a));
  30408. break;
  30409. case "log":
  30410. a = stack.pop();
  30411. stack.push(Math.log10(a));
  30412. break;
  30413. case "lt":
  30414. b = stack.pop();
  30415. a = stack.pop();
  30416. stack.push(a < b);
  30417. break;
  30418. case "mod":
  30419. b = stack.pop();
  30420. a = stack.pop();
  30421. stack.push(a % b);
  30422. break;
  30423. case "mul":
  30424. b = stack.pop();
  30425. a = stack.pop();
  30426. stack.push(a * b);
  30427. break;
  30428. case "ne":
  30429. b = stack.pop();
  30430. a = stack.pop();
  30431. stack.push(a !== b);
  30432. break;
  30433. case "neg":
  30434. a = stack.pop();
  30435. stack.push(-a);
  30436. break;
  30437. case "not":
  30438. a = stack.pop();
  30439. if (typeof a === "boolean") {
  30440. stack.push(!a);
  30441. } else {
  30442. stack.push(~a);
  30443. }
  30444. break;
  30445. case "or":
  30446. b = stack.pop();
  30447. a = stack.pop();
  30448. if (typeof a === "boolean" && typeof b === "boolean") {
  30449. stack.push(a || b);
  30450. } else {
  30451. stack.push(a | b);
  30452. }
  30453. break;
  30454. case "pop":
  30455. stack.pop();
  30456. break;
  30457. case "roll":
  30458. b = stack.pop();
  30459. a = stack.pop();
  30460. stack.roll(a, b);
  30461. break;
  30462. case "round":
  30463. a = stack.pop();
  30464. stack.push(Math.round(a));
  30465. break;
  30466. case "sin":
  30467. a = stack.pop();
  30468. stack.push(Math.sin(a % 360 / 180 * Math.PI));
  30469. break;
  30470. case "sqrt":
  30471. a = stack.pop();
  30472. stack.push(Math.sqrt(a));
  30473. break;
  30474. case "sub":
  30475. b = stack.pop();
  30476. a = stack.pop();
  30477. stack.push(a - b);
  30478. break;
  30479. case "true":
  30480. stack.push(true);
  30481. break;
  30482. case "truncate":
  30483. a = stack.pop();
  30484. a = a < 0 ? Math.ceil(a) : Math.floor(a);
  30485. stack.push(a);
  30486. break;
  30487. case "xor":
  30488. b = stack.pop();
  30489. a = stack.pop();
  30490. if (typeof a === "boolean" && typeof b === "boolean") {
  30491. stack.push(a !== b);
  30492. } else {
  30493. stack.push(a ^ b);
  30494. }
  30495. break;
  30496. default:
  30497. throw new FormatError(`Unknown operator ${operator}`);
  30498. }
  30499. }
  30500. return stack.stack;
  30501. }
  30502. }
  30503. class AstNode {
  30504. constructor(type) {
  30505. this.type = type;
  30506. }
  30507. visit(visitor) {
  30508. unreachable("abstract method");
  30509. }
  30510. }
  30511. class AstArgument extends AstNode {
  30512. constructor(index, min, max) {
  30513. super("args");
  30514. this.index = index;
  30515. this.min = min;
  30516. this.max = max;
  30517. }
  30518. visit(visitor) {
  30519. visitor.visitArgument(this);
  30520. }
  30521. }
  30522. class AstLiteral extends AstNode {
  30523. constructor(number) {
  30524. super("literal");
  30525. this.number = number;
  30526. this.min = number;
  30527. this.max = number;
  30528. }
  30529. visit(visitor) {
  30530. visitor.visitLiteral(this);
  30531. }
  30532. }
  30533. class AstBinaryOperation extends AstNode {
  30534. constructor(op, arg1, arg2, min, max) {
  30535. super("binary");
  30536. this.op = op;
  30537. this.arg1 = arg1;
  30538. this.arg2 = arg2;
  30539. this.min = min;
  30540. this.max = max;
  30541. }
  30542. visit(visitor) {
  30543. visitor.visitBinaryOperation(this);
  30544. }
  30545. }
  30546. class AstMin extends AstNode {
  30547. constructor(arg, max) {
  30548. super("max");
  30549. this.arg = arg;
  30550. this.min = arg.min;
  30551. this.max = max;
  30552. }
  30553. visit(visitor) {
  30554. visitor.visitMin(this);
  30555. }
  30556. }
  30557. class AstVariable extends AstNode {
  30558. constructor(index, min, max) {
  30559. super("var");
  30560. this.index = index;
  30561. this.min = min;
  30562. this.max = max;
  30563. }
  30564. visit(visitor) {
  30565. visitor.visitVariable(this);
  30566. }
  30567. }
  30568. class AstVariableDefinition extends AstNode {
  30569. constructor(variable, arg) {
  30570. super("definition");
  30571. this.variable = variable;
  30572. this.arg = arg;
  30573. }
  30574. visit(visitor) {
  30575. visitor.visitVariableDefinition(this);
  30576. }
  30577. }
  30578. class ExpressionBuilderVisitor {
  30579. constructor() {
  30580. this.parts = [];
  30581. }
  30582. visitArgument(arg) {
  30583. this.parts.push("Math.max(", arg.min, ", Math.min(", arg.max, ", src[srcOffset + ", arg.index, "]))");
  30584. }
  30585. visitVariable(variable) {
  30586. this.parts.push("v", variable.index);
  30587. }
  30588. visitLiteral(literal) {
  30589. this.parts.push(literal.number);
  30590. }
  30591. visitBinaryOperation(operation) {
  30592. this.parts.push("(");
  30593. operation.arg1.visit(this);
  30594. this.parts.push(" ", operation.op, " ");
  30595. operation.arg2.visit(this);
  30596. this.parts.push(")");
  30597. }
  30598. visitVariableDefinition(definition) {
  30599. this.parts.push("var ");
  30600. definition.variable.visit(this);
  30601. this.parts.push(" = ");
  30602. definition.arg.visit(this);
  30603. this.parts.push(";");
  30604. }
  30605. visitMin(max) {
  30606. this.parts.push("Math.min(");
  30607. max.arg.visit(this);
  30608. this.parts.push(", ", max.max, ")");
  30609. }
  30610. toString() {
  30611. return this.parts.join("");
  30612. }
  30613. }
  30614. function buildAddOperation(num1, num2) {
  30615. if (num2.type === "literal" && num2.number === 0) {
  30616. return num1;
  30617. }
  30618. if (num1.type === "literal" && num1.number === 0) {
  30619. return num2;
  30620. }
  30621. if (num2.type === "literal" && num1.type === "literal") {
  30622. return new AstLiteral(num1.number + num2.number);
  30623. }
  30624. return new AstBinaryOperation("+", num1, num2, num1.min + num2.min, num1.max + num2.max);
  30625. }
  30626. function buildMulOperation(num1, num2) {
  30627. if (num2.type === "literal") {
  30628. if (num2.number === 0) {
  30629. return new AstLiteral(0);
  30630. } else if (num2.number === 1) {
  30631. return num1;
  30632. } else if (num1.type === "literal") {
  30633. return new AstLiteral(num1.number * num2.number);
  30634. }
  30635. }
  30636. if (num1.type === "literal") {
  30637. if (num1.number === 0) {
  30638. return new AstLiteral(0);
  30639. } else if (num1.number === 1) {
  30640. return num2;
  30641. }
  30642. }
  30643. const min = Math.min(num1.min * num2.min, num1.min * num2.max, num1.max * num2.min, num1.max * num2.max);
  30644. const max = Math.max(num1.min * num2.min, num1.min * num2.max, num1.max * num2.min, num1.max * num2.max);
  30645. return new AstBinaryOperation("*", num1, num2, min, max);
  30646. }
  30647. function buildSubOperation(num1, num2) {
  30648. if (num2.type === "literal") {
  30649. if (num2.number === 0) {
  30650. return num1;
  30651. } else if (num1.type === "literal") {
  30652. return new AstLiteral(num1.number - num2.number);
  30653. }
  30654. }
  30655. if (num2.type === "binary" && num2.op === "-" && num1.type === "literal" && num1.number === 1 && num2.arg1.type === "literal" && num2.arg1.number === 1) {
  30656. return num2.arg2;
  30657. }
  30658. return new AstBinaryOperation("-", num1, num2, num1.min - num2.max, num1.max - num2.min);
  30659. }
  30660. function buildMinOperation(num1, max) {
  30661. if (num1.min >= max) {
  30662. return new AstLiteral(max);
  30663. } else if (num1.max <= max) {
  30664. return num1;
  30665. }
  30666. return new AstMin(num1, max);
  30667. }
  30668. class PostScriptCompiler {
  30669. compile(code, domain, range) {
  30670. const stack = [];
  30671. const instructions = [];
  30672. const inputSize = domain.length >> 1,
  30673. outputSize = range.length >> 1;
  30674. let lastRegister = 0;
  30675. let n, j;
  30676. let num1, num2, ast1, ast2, tmpVar, item;
  30677. for (let i = 0; i < inputSize; i++) {
  30678. stack.push(new AstArgument(i, domain[i * 2], domain[i * 2 + 1]));
  30679. }
  30680. for (let i = 0, ii = code.length; i < ii; i++) {
  30681. item = code[i];
  30682. if (typeof item === "number") {
  30683. stack.push(new AstLiteral(item));
  30684. continue;
  30685. }
  30686. switch (item) {
  30687. case "add":
  30688. if (stack.length < 2) {
  30689. return null;
  30690. }
  30691. num2 = stack.pop();
  30692. num1 = stack.pop();
  30693. stack.push(buildAddOperation(num1, num2));
  30694. break;
  30695. case "cvr":
  30696. if (stack.length < 1) {
  30697. return null;
  30698. }
  30699. break;
  30700. case "mul":
  30701. if (stack.length < 2) {
  30702. return null;
  30703. }
  30704. num2 = stack.pop();
  30705. num1 = stack.pop();
  30706. stack.push(buildMulOperation(num1, num2));
  30707. break;
  30708. case "sub":
  30709. if (stack.length < 2) {
  30710. return null;
  30711. }
  30712. num2 = stack.pop();
  30713. num1 = stack.pop();
  30714. stack.push(buildSubOperation(num1, num2));
  30715. break;
  30716. case "exch":
  30717. if (stack.length < 2) {
  30718. return null;
  30719. }
  30720. ast1 = stack.pop();
  30721. ast2 = stack.pop();
  30722. stack.push(ast1, ast2);
  30723. break;
  30724. case "pop":
  30725. if (stack.length < 1) {
  30726. return null;
  30727. }
  30728. stack.pop();
  30729. break;
  30730. case "index":
  30731. if (stack.length < 1) {
  30732. return null;
  30733. }
  30734. num1 = stack.pop();
  30735. if (num1.type !== "literal") {
  30736. return null;
  30737. }
  30738. n = num1.number;
  30739. if (n < 0 || !Number.isInteger(n) || stack.length < n) {
  30740. return null;
  30741. }
  30742. ast1 = stack[stack.length - n - 1];
  30743. if (ast1.type === "literal" || ast1.type === "var") {
  30744. stack.push(ast1);
  30745. break;
  30746. }
  30747. tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max);
  30748. stack[stack.length - n - 1] = tmpVar;
  30749. stack.push(tmpVar);
  30750. instructions.push(new AstVariableDefinition(tmpVar, ast1));
  30751. break;
  30752. case "dup":
  30753. if (stack.length < 1) {
  30754. return null;
  30755. }
  30756. if (typeof code[i + 1] === "number" && code[i + 2] === "gt" && code[i + 3] === i + 7 && code[i + 4] === "jz" && code[i + 5] === "pop" && code[i + 6] === code[i + 1]) {
  30757. num1 = stack.pop();
  30758. stack.push(buildMinOperation(num1, code[i + 1]));
  30759. i += 6;
  30760. break;
  30761. }
  30762. ast1 = stack.at(-1);
  30763. if (ast1.type === "literal" || ast1.type === "var") {
  30764. stack.push(ast1);
  30765. break;
  30766. }
  30767. tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max);
  30768. stack[stack.length - 1] = tmpVar;
  30769. stack.push(tmpVar);
  30770. instructions.push(new AstVariableDefinition(tmpVar, ast1));
  30771. break;
  30772. case "roll":
  30773. if (stack.length < 2) {
  30774. return null;
  30775. }
  30776. num2 = stack.pop();
  30777. num1 = stack.pop();
  30778. if (num2.type !== "literal" || num1.type !== "literal") {
  30779. return null;
  30780. }
  30781. j = num2.number;
  30782. n = num1.number;
  30783. if (n <= 0 || !Number.isInteger(n) || !Number.isInteger(j) || stack.length < n) {
  30784. return null;
  30785. }
  30786. j = (j % n + n) % n;
  30787. if (j === 0) {
  30788. break;
  30789. }
  30790. stack.push(...stack.splice(stack.length - n, n - j));
  30791. break;
  30792. default:
  30793. return null;
  30794. }
  30795. }
  30796. if (stack.length !== outputSize) {
  30797. return null;
  30798. }
  30799. const result = [];
  30800. for (const instruction of instructions) {
  30801. const statementBuilder = new ExpressionBuilderVisitor();
  30802. instruction.visit(statementBuilder);
  30803. result.push(statementBuilder.toString());
  30804. }
  30805. for (let i = 0, ii = stack.length; i < ii; i++) {
  30806. const expr = stack[i],
  30807. statementBuilder = new ExpressionBuilderVisitor();
  30808. expr.visit(statementBuilder);
  30809. const min = range[i * 2],
  30810. max = range[i * 2 + 1];
  30811. const out = [statementBuilder.toString()];
  30812. if (min > expr.min) {
  30813. out.unshift("Math.max(", min, ", ");
  30814. out.push(")");
  30815. }
  30816. if (max < expr.max) {
  30817. out.unshift("Math.min(", max, ", ");
  30818. out.push(")");
  30819. }
  30820. out.unshift("dest[destOffset + ", i, "] = ");
  30821. out.push(";");
  30822. result.push(out.join(""));
  30823. }
  30824. return result.join("\n");
  30825. }
  30826. }
  30827. ;// ./src/core/bidi.js
  30828. const baseTypes = ["BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "S", "B", "S", "WS", "B", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "B", "B", "B", "S", "WS", "ON", "ON", "ET", "ET", "ET", "ON", "ON", "ON", "ON", "ON", "ES", "CS", "ES", "CS", "CS", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "CS", "ON", "ON", "ON", "ON", "ON", "ON", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "ON", "ON", "ON", "ON", "ON", "ON", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "ON", "ON", "ON", "ON", "BN", "BN", "BN", "BN", "BN", "BN", "B", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "CS", "ON", "ET", "ET", "ET", "ET", "ON", "ON", "ON", "ON", "L", "ON", "ON", "BN", "ON", "ON", "ET", "ET", "EN", "EN", "ON", "L", "ON", "ON", "ON", "EN", "L", "ON", "ON", "ON", "ON", "ON", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "ON", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "ON", "L", "L", "L", "L", "L", "L", "L", "L"];
  30829. const arabicTypes = ["AN", "AN", "AN", "AN", "AN", "AN", "ON", "ON", "AL", "ET", "ET", "AL", "CS", "AL", "ON", "ON", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "ET", "AN", "AN", "AL", "AL", "AL", "NSM", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AN", "ON", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "NSM", "NSM", "ON", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "AL", "AL", "AL", "AL", "AL", "AL"];
  30830. function isOdd(i) {
  30831. return (i & 1) !== 0;
  30832. }
  30833. function isEven(i) {
  30834. return (i & 1) === 0;
  30835. }
  30836. function findUnequal(arr, start, value) {
  30837. let j, jj;
  30838. for (j = start, jj = arr.length; j < jj; ++j) {
  30839. if (arr[j] !== value) {
  30840. return j;
  30841. }
  30842. }
  30843. return j;
  30844. }
  30845. function setValues(arr, start, end, value) {
  30846. for (let j = start; j < end; ++j) {
  30847. arr[j] = value;
  30848. }
  30849. }
  30850. function reverseValues(arr, start, end) {
  30851. for (let i = start, j = end - 1; i < j; ++i, --j) {
  30852. const temp = arr[i];
  30853. arr[i] = arr[j];
  30854. arr[j] = temp;
  30855. }
  30856. }
  30857. function createBidiText(str, isLTR, vertical = false) {
  30858. let dir = "ltr";
  30859. if (vertical) {
  30860. dir = "ttb";
  30861. } else if (!isLTR) {
  30862. dir = "rtl";
  30863. }
  30864. return {
  30865. str,
  30866. dir
  30867. };
  30868. }
  30869. const chars = [];
  30870. const types = [];
  30871. function bidi(str, startLevel = -1, vertical = false) {
  30872. let isLTR = true;
  30873. const strLength = str.length;
  30874. if (strLength === 0 || vertical) {
  30875. return createBidiText(str, isLTR, vertical);
  30876. }
  30877. chars.length = strLength;
  30878. types.length = strLength;
  30879. let numBidi = 0;
  30880. let i, ii;
  30881. for (i = 0; i < strLength; ++i) {
  30882. chars[i] = str.charAt(i);
  30883. const charCode = str.charCodeAt(i);
  30884. let charType = "L";
  30885. if (charCode <= 0x00ff) {
  30886. charType = baseTypes[charCode];
  30887. } else if (0x0590 <= charCode && charCode <= 0x05f4) {
  30888. charType = "R";
  30889. } else if (0x0600 <= charCode && charCode <= 0x06ff) {
  30890. charType = arabicTypes[charCode & 0xff];
  30891. if (!charType) {
  30892. warn("Bidi: invalid Unicode character " + charCode.toString(16));
  30893. }
  30894. } else if (0x0700 <= charCode && charCode <= 0x08ac || 0xfb50 <= charCode && charCode <= 0xfdff || 0xfe70 <= charCode && charCode <= 0xfeff) {
  30895. charType = "AL";
  30896. }
  30897. if (charType === "R" || charType === "AL" || charType === "AN") {
  30898. numBidi++;
  30899. }
  30900. types[i] = charType;
  30901. }
  30902. if (numBidi === 0) {
  30903. isLTR = true;
  30904. return createBidiText(str, isLTR);
  30905. }
  30906. if (startLevel === -1) {
  30907. if (numBidi / strLength < 0.3 && strLength > 4) {
  30908. isLTR = true;
  30909. startLevel = 0;
  30910. } else {
  30911. isLTR = false;
  30912. startLevel = 1;
  30913. }
  30914. }
  30915. const levels = [];
  30916. for (i = 0; i < strLength; ++i) {
  30917. levels[i] = startLevel;
  30918. }
  30919. const e = isOdd(startLevel) ? "R" : "L";
  30920. const sor = e;
  30921. const eor = sor;
  30922. let lastType = sor;
  30923. for (i = 0; i < strLength; ++i) {
  30924. if (types[i] === "NSM") {
  30925. types[i] = lastType;
  30926. } else {
  30927. lastType = types[i];
  30928. }
  30929. }
  30930. lastType = sor;
  30931. let t;
  30932. for (i = 0; i < strLength; ++i) {
  30933. t = types[i];
  30934. if (t === "EN") {
  30935. types[i] = lastType === "AL" ? "AN" : "EN";
  30936. } else if (t === "R" || t === "L" || t === "AL") {
  30937. lastType = t;
  30938. }
  30939. }
  30940. for (i = 0; i < strLength; ++i) {
  30941. t = types[i];
  30942. if (t === "AL") {
  30943. types[i] = "R";
  30944. }
  30945. }
  30946. for (i = 1; i < strLength - 1; ++i) {
  30947. if (types[i] === "ES" && types[i - 1] === "EN" && types[i + 1] === "EN") {
  30948. types[i] = "EN";
  30949. }
  30950. if (types[i] === "CS" && (types[i - 1] === "EN" || types[i - 1] === "AN") && types[i + 1] === types[i - 1]) {
  30951. types[i] = types[i - 1];
  30952. }
  30953. }
  30954. for (i = 0; i < strLength; ++i) {
  30955. if (types[i] === "EN") {
  30956. for (let j = i - 1; j >= 0; --j) {
  30957. if (types[j] !== "ET") {
  30958. break;
  30959. }
  30960. types[j] = "EN";
  30961. }
  30962. for (let j = i + 1; j < strLength; ++j) {
  30963. if (types[j] !== "ET") {
  30964. break;
  30965. }
  30966. types[j] = "EN";
  30967. }
  30968. }
  30969. }
  30970. for (i = 0; i < strLength; ++i) {
  30971. t = types[i];
  30972. if (t === "WS" || t === "ES" || t === "ET" || t === "CS") {
  30973. types[i] = "ON";
  30974. }
  30975. }
  30976. lastType = sor;
  30977. for (i = 0; i < strLength; ++i) {
  30978. t = types[i];
  30979. if (t === "EN") {
  30980. types[i] = lastType === "L" ? "L" : "EN";
  30981. } else if (t === "R" || t === "L") {
  30982. lastType = t;
  30983. }
  30984. }
  30985. for (i = 0; i < strLength; ++i) {
  30986. if (types[i] === "ON") {
  30987. const end = findUnequal(types, i + 1, "ON");
  30988. let before = sor;
  30989. if (i > 0) {
  30990. before = types[i - 1];
  30991. }
  30992. let after = eor;
  30993. if (end + 1 < strLength) {
  30994. after = types[end + 1];
  30995. }
  30996. if (before !== "L") {
  30997. before = "R";
  30998. }
  30999. if (after !== "L") {
  31000. after = "R";
  31001. }
  31002. if (before === after) {
  31003. setValues(types, i, end, before);
  31004. }
  31005. i = end - 1;
  31006. }
  31007. }
  31008. for (i = 0; i < strLength; ++i) {
  31009. if (types[i] === "ON") {
  31010. types[i] = e;
  31011. }
  31012. }
  31013. for (i = 0; i < strLength; ++i) {
  31014. t = types[i];
  31015. if (isEven(levels[i])) {
  31016. if (t === "R") {
  31017. levels[i] += 1;
  31018. } else if (t === "AN" || t === "EN") {
  31019. levels[i] += 2;
  31020. }
  31021. } else if (t === "L" || t === "AN" || t === "EN") {
  31022. levels[i] += 1;
  31023. }
  31024. }
  31025. let highestLevel = -1;
  31026. let lowestOddLevel = 99;
  31027. let level;
  31028. for (i = 0, ii = levels.length; i < ii; ++i) {
  31029. level = levels[i];
  31030. if (highestLevel < level) {
  31031. highestLevel = level;
  31032. }
  31033. if (lowestOddLevel > level && isOdd(level)) {
  31034. lowestOddLevel = level;
  31035. }
  31036. }
  31037. for (level = highestLevel; level >= lowestOddLevel; --level) {
  31038. let start = -1;
  31039. for (i = 0, ii = levels.length; i < ii; ++i) {
  31040. if (levels[i] < level) {
  31041. if (start >= 0) {
  31042. reverseValues(chars, start, i);
  31043. start = -1;
  31044. }
  31045. } else if (start < 0) {
  31046. start = i;
  31047. }
  31048. }
  31049. if (start >= 0) {
  31050. reverseValues(chars, start, levels.length);
  31051. }
  31052. }
  31053. for (i = 0, ii = chars.length; i < ii; ++i) {
  31054. const ch = chars[i];
  31055. if (ch === "<" || ch === ">") {
  31056. chars[i] = "";
  31057. }
  31058. }
  31059. return createBidiText(chars.join(""), isLTR);
  31060. }
  31061. ;// ./src/core/font_substitutions.js
  31062. const NORMAL = {
  31063. style: "normal",
  31064. weight: "normal"
  31065. };
  31066. const BOLD = {
  31067. style: "normal",
  31068. weight: "bold"
  31069. };
  31070. const ITALIC = {
  31071. style: "italic",
  31072. weight: "normal"
  31073. };
  31074. const BOLDITALIC = {
  31075. style: "italic",
  31076. weight: "bold"
  31077. };
  31078. const substitutionMap = new Map([["Times-Roman", {
  31079. local: ["Times New Roman", "Times-Roman", "Times", "Liberation Serif", "Nimbus Roman", "Nimbus Roman L", "Tinos", "Thorndale", "TeX Gyre Termes", "FreeSerif", "Linux Libertine O", "Libertinus Serif", "DejaVu Serif", "Bitstream Vera Serif", "Ubuntu"],
  31080. style: NORMAL,
  31081. ultimate: "serif"
  31082. }], ["Times-Bold", {
  31083. alias: "Times-Roman",
  31084. style: BOLD,
  31085. ultimate: "serif"
  31086. }], ["Times-Italic", {
  31087. alias: "Times-Roman",
  31088. style: ITALIC,
  31089. ultimate: "serif"
  31090. }], ["Times-BoldItalic", {
  31091. alias: "Times-Roman",
  31092. style: BOLDITALIC,
  31093. ultimate: "serif"
  31094. }], ["Helvetica", {
  31095. local: ["Helvetica", "Helvetica Neue", "Arial", "Arial Nova", "Liberation Sans", "Arimo", "Nimbus Sans", "Nimbus Sans L", "A030", "TeX Gyre Heros", "FreeSans", "DejaVu Sans", "Albany", "Bitstream Vera Sans", "Arial Unicode MS", "Microsoft Sans Serif", "Apple Symbols", "Cantarell"],
  31096. path: "LiberationSans-Regular.ttf",
  31097. style: NORMAL,
  31098. ultimate: "sans-serif"
  31099. }], ["Helvetica-Bold", {
  31100. alias: "Helvetica",
  31101. path: "LiberationSans-Bold.ttf",
  31102. style: BOLD,
  31103. ultimate: "sans-serif"
  31104. }], ["Helvetica-Oblique", {
  31105. alias: "Helvetica",
  31106. path: "LiberationSans-Italic.ttf",
  31107. style: ITALIC,
  31108. ultimate: "sans-serif"
  31109. }], ["Helvetica-BoldOblique", {
  31110. alias: "Helvetica",
  31111. path: "LiberationSans-BoldItalic.ttf",
  31112. style: BOLDITALIC,
  31113. ultimate: "sans-serif"
  31114. }], ["Courier", {
  31115. local: ["Courier", "Courier New", "Liberation Mono", "Nimbus Mono", "Nimbus Mono L", "Cousine", "Cumberland", "TeX Gyre Cursor", "FreeMono", "Linux Libertine Mono O", "Libertinus Mono"],
  31116. style: NORMAL,
  31117. ultimate: "monospace"
  31118. }], ["Courier-Bold", {
  31119. alias: "Courier",
  31120. style: BOLD,
  31121. ultimate: "monospace"
  31122. }], ["Courier-Oblique", {
  31123. alias: "Courier",
  31124. style: ITALIC,
  31125. ultimate: "monospace"
  31126. }], ["Courier-BoldOblique", {
  31127. alias: "Courier",
  31128. style: BOLDITALIC,
  31129. ultimate: "monospace"
  31130. }], ["ArialBlack", {
  31131. local: ["Arial Black"],
  31132. style: {
  31133. style: "normal",
  31134. weight: "900"
  31135. },
  31136. fallback: "Helvetica-Bold"
  31137. }], ["ArialBlack-Bold", {
  31138. alias: "ArialBlack"
  31139. }], ["ArialBlack-Italic", {
  31140. alias: "ArialBlack",
  31141. style: {
  31142. style: "italic",
  31143. weight: "900"
  31144. },
  31145. fallback: "Helvetica-BoldOblique"
  31146. }], ["ArialBlack-BoldItalic", {
  31147. alias: "ArialBlack-Italic"
  31148. }], ["ArialNarrow", {
  31149. local: ["Arial Narrow", "Liberation Sans Narrow", "Helvetica Condensed", "Nimbus Sans Narrow", "TeX Gyre Heros Cn"],
  31150. style: NORMAL,
  31151. fallback: "Helvetica"
  31152. }], ["ArialNarrow-Bold", {
  31153. alias: "ArialNarrow",
  31154. style: BOLD,
  31155. fallback: "Helvetica-Bold"
  31156. }], ["ArialNarrow-Italic", {
  31157. alias: "ArialNarrow",
  31158. style: ITALIC,
  31159. fallback: "Helvetica-Oblique"
  31160. }], ["ArialNarrow-BoldItalic", {
  31161. alias: "ArialNarrow",
  31162. style: BOLDITALIC,
  31163. fallback: "Helvetica-BoldOblique"
  31164. }], ["Calibri", {
  31165. local: ["Calibri", "Carlito"],
  31166. style: NORMAL,
  31167. fallback: "Helvetica"
  31168. }], ["Calibri-Bold", {
  31169. alias: "Calibri",
  31170. style: BOLD,
  31171. fallback: "Helvetica-Bold"
  31172. }], ["Calibri-Italic", {
  31173. alias: "Calibri",
  31174. style: ITALIC,
  31175. fallback: "Helvetica-Oblique"
  31176. }], ["Calibri-BoldItalic", {
  31177. alias: "Calibri",
  31178. style: BOLDITALIC,
  31179. fallback: "Helvetica-BoldOblique"
  31180. }], ["Wingdings", {
  31181. local: ["Wingdings", "URW Dingbats"],
  31182. style: NORMAL
  31183. }], ["Wingdings-Regular", {
  31184. alias: "Wingdings"
  31185. }], ["Wingdings-Bold", {
  31186. alias: "Wingdings"
  31187. }]]);
  31188. const fontAliases = new Map([["Arial-Black", "ArialBlack"]]);
  31189. function getStyleToAppend(style) {
  31190. switch (style) {
  31191. case BOLD:
  31192. return "Bold";
  31193. case ITALIC:
  31194. return "Italic";
  31195. case BOLDITALIC:
  31196. return "Bold Italic";
  31197. default:
  31198. if (style?.weight === "bold") {
  31199. return "Bold";
  31200. }
  31201. if (style?.style === "italic") {
  31202. return "Italic";
  31203. }
  31204. }
  31205. return "";
  31206. }
  31207. function getFamilyName(str) {
  31208. const keywords = new Set(["thin", "extralight", "ultralight", "demilight", "semilight", "light", "book", "regular", "normal", "medium", "demibold", "semibold", "bold", "extrabold", "ultrabold", "black", "heavy", "extrablack", "ultrablack", "roman", "italic", "oblique", "ultracondensed", "extracondensed", "condensed", "semicondensed", "normal", "semiexpanded", "expanded", "extraexpanded", "ultraexpanded", "bolditalic"]);
  31209. return str.split(/[- ,+]+/g).filter(tok => !keywords.has(tok.toLowerCase())).join(" ");
  31210. }
  31211. function generateFont({
  31212. alias,
  31213. local,
  31214. path,
  31215. fallback,
  31216. style,
  31217. ultimate
  31218. }, src, localFontPath, useFallback = true, usePath = true, append = "") {
  31219. const result = {
  31220. style: null,
  31221. ultimate: null
  31222. };
  31223. if (local) {
  31224. const extra = append ? ` ${append}` : "";
  31225. for (const name of local) {
  31226. src.push(`local(${name}${extra})`);
  31227. }
  31228. }
  31229. if (alias) {
  31230. const substitution = substitutionMap.get(alias);
  31231. const aliasAppend = append || getStyleToAppend(style);
  31232. Object.assign(result, generateFont(substitution, src, localFontPath, useFallback && !fallback, usePath && !path, aliasAppend));
  31233. }
  31234. if (style) {
  31235. result.style = style;
  31236. }
  31237. if (ultimate) {
  31238. result.ultimate = ultimate;
  31239. }
  31240. if (useFallback && fallback) {
  31241. const fallbackInfo = substitutionMap.get(fallback);
  31242. const {
  31243. ultimate: fallbackUltimate
  31244. } = generateFont(fallbackInfo, src, localFontPath, useFallback, usePath && !path, append);
  31245. result.ultimate ||= fallbackUltimate;
  31246. }
  31247. if (usePath && path && localFontPath) {
  31248. src.push(`url(${localFontPath}${path})`);
  31249. }
  31250. return result;
  31251. }
  31252. function getFontSubstitution(systemFontCache, idFactory, localFontPath, baseFontName, standardFontName, type) {
  31253. if (baseFontName.startsWith("InvalidPDFjsFont_")) {
  31254. return null;
  31255. }
  31256. if ((type === "TrueType" || type === "Type1") && /^[A-Z]{6}\+/.test(baseFontName)) {
  31257. baseFontName = baseFontName.slice(7);
  31258. }
  31259. baseFontName = normalizeFontName(baseFontName);
  31260. const key = baseFontName;
  31261. let substitutionInfo = systemFontCache.get(key);
  31262. if (substitutionInfo) {
  31263. return substitutionInfo;
  31264. }
  31265. let substitution = substitutionMap.get(baseFontName);
  31266. if (!substitution) {
  31267. for (const [alias, subst] of fontAliases) {
  31268. if (baseFontName.startsWith(alias)) {
  31269. baseFontName = `${subst}${baseFontName.substring(alias.length)}`;
  31270. substitution = substitutionMap.get(baseFontName);
  31271. break;
  31272. }
  31273. }
  31274. }
  31275. let mustAddBaseFont = false;
  31276. if (!substitution) {
  31277. substitution = substitutionMap.get(standardFontName);
  31278. mustAddBaseFont = true;
  31279. }
  31280. const loadedName = `${idFactory.getDocId()}_s${idFactory.createFontId()}`;
  31281. if (!substitution) {
  31282. if (!validateFontName(baseFontName)) {
  31283. warn(`Cannot substitute the font because of its name: ${baseFontName}`);
  31284. systemFontCache.set(key, null);
  31285. return null;
  31286. }
  31287. const bold = /bold/gi.test(baseFontName);
  31288. const italic = /oblique|italic/gi.test(baseFontName);
  31289. const style = bold && italic && BOLDITALIC || bold && BOLD || italic && ITALIC || NORMAL;
  31290. substitutionInfo = {
  31291. css: `"${getFamilyName(baseFontName)}",${loadedName}`,
  31292. guessFallback: true,
  31293. loadedName,
  31294. baseFontName,
  31295. src: `local(${baseFontName})`,
  31296. style
  31297. };
  31298. systemFontCache.set(key, substitutionInfo);
  31299. return substitutionInfo;
  31300. }
  31301. const src = [];
  31302. if (mustAddBaseFont && validateFontName(baseFontName)) {
  31303. src.push(`local(${baseFontName})`);
  31304. }
  31305. const {
  31306. style,
  31307. ultimate
  31308. } = generateFont(substitution, src, localFontPath);
  31309. const guessFallback = ultimate === null;
  31310. const fallback = guessFallback ? "" : `,${ultimate}`;
  31311. substitutionInfo = {
  31312. css: `"${getFamilyName(baseFontName)}",${loadedName}${fallback}`,
  31313. guessFallback,
  31314. loadedName,
  31315. baseFontName,
  31316. src: src.join(","),
  31317. style
  31318. };
  31319. systemFontCache.set(key, substitutionInfo);
  31320. return substitutionInfo;
  31321. }
  31322. ;// ./src/core/image_resizer.js
  31323. const MIN_IMAGE_DIM = 2048;
  31324. const MAX_IMAGE_DIM = 65537;
  31325. const MAX_ERROR = 128;
  31326. class ImageResizer {
  31327. constructor(imgData, isMask) {
  31328. this._imgData = imgData;
  31329. this._isMask = isMask;
  31330. }
  31331. static needsToBeResized(width, height) {
  31332. if (width <= this._goodSquareLength && height <= this._goodSquareLength) {
  31333. return false;
  31334. }
  31335. const {
  31336. MAX_DIM
  31337. } = this;
  31338. if (width > MAX_DIM || height > MAX_DIM) {
  31339. return true;
  31340. }
  31341. const area = width * height;
  31342. if (this._hasMaxArea) {
  31343. return area > this.MAX_AREA;
  31344. }
  31345. if (area < this._goodSquareLength ** 2) {
  31346. return false;
  31347. }
  31348. if (this._areGoodDims(width, height)) {
  31349. this._goodSquareLength = Math.max(this._goodSquareLength, Math.floor(Math.sqrt(width * height)));
  31350. return false;
  31351. }
  31352. this._goodSquareLength = this._guessMax(this._goodSquareLength, MAX_DIM, MAX_ERROR, 0);
  31353. const maxArea = this.MAX_AREA = this._goodSquareLength ** 2;
  31354. return area > maxArea;
  31355. }
  31356. static get MAX_DIM() {
  31357. return shadow(this, "MAX_DIM", this._guessMax(MIN_IMAGE_DIM, MAX_IMAGE_DIM, 0, 1));
  31358. }
  31359. static get MAX_AREA() {
  31360. this._hasMaxArea = true;
  31361. return shadow(this, "MAX_AREA", this._guessMax(ImageResizer._goodSquareLength, this.MAX_DIM, MAX_ERROR, 0) ** 2);
  31362. }
  31363. static set MAX_AREA(area) {
  31364. if (area >= 0) {
  31365. this._hasMaxArea = true;
  31366. shadow(this, "MAX_AREA", area);
  31367. }
  31368. }
  31369. static setMaxArea(area) {
  31370. if (!this._hasMaxArea) {
  31371. this.MAX_AREA = area >> 2;
  31372. }
  31373. }
  31374. static _areGoodDims(width, height) {
  31375. try {
  31376. const canvas = new OffscreenCanvas(width, height);
  31377. const ctx = canvas.getContext("2d");
  31378. ctx.fillRect(0, 0, 1, 1);
  31379. const opacity = ctx.getImageData(0, 0, 1, 1).data[3];
  31380. canvas.width = canvas.height = 1;
  31381. return opacity !== 0;
  31382. } catch {
  31383. return false;
  31384. }
  31385. }
  31386. static _guessMax(start, end, tolerance, defaultHeight) {
  31387. while (start + tolerance + 1 < end) {
  31388. const middle = Math.floor((start + end) / 2);
  31389. const height = defaultHeight || middle;
  31390. if (this._areGoodDims(middle, height)) {
  31391. start = middle;
  31392. } else {
  31393. end = middle;
  31394. }
  31395. }
  31396. return start;
  31397. }
  31398. static async createImage(imgData, isMask = false) {
  31399. return new ImageResizer(imgData, isMask)._createImage();
  31400. }
  31401. async _createImage() {
  31402. const data = this._encodeBMP();
  31403. const blob = new Blob([data.buffer], {
  31404. type: "image/bmp"
  31405. });
  31406. const bitmapPromise = createImageBitmap(blob);
  31407. const {
  31408. MAX_AREA,
  31409. MAX_DIM
  31410. } = ImageResizer;
  31411. const {
  31412. _imgData: imgData
  31413. } = this;
  31414. const {
  31415. width,
  31416. height
  31417. } = imgData;
  31418. const minFactor = Math.max(width / MAX_DIM, height / MAX_DIM, Math.sqrt(width * height / MAX_AREA));
  31419. const firstFactor = Math.max(minFactor, 2);
  31420. const factor = Math.round(10 * (minFactor + 1.25)) / 10 / firstFactor;
  31421. const N = Math.floor(Math.log2(factor));
  31422. const steps = new Array(N + 2).fill(2);
  31423. steps[0] = firstFactor;
  31424. steps.splice(-1, 1, factor / (1 << N));
  31425. let newWidth = width;
  31426. let newHeight = height;
  31427. let bitmap = await bitmapPromise;
  31428. for (const step of steps) {
  31429. const prevWidth = newWidth;
  31430. const prevHeight = newHeight;
  31431. newWidth = Math.floor(newWidth / step) - 1;
  31432. newHeight = Math.floor(newHeight / step) - 1;
  31433. const canvas = new OffscreenCanvas(newWidth, newHeight);
  31434. const ctx = canvas.getContext("2d");
  31435. ctx.drawImage(bitmap, 0, 0, prevWidth, prevHeight, 0, 0, newWidth, newHeight);
  31436. bitmap = canvas.transferToImageBitmap();
  31437. }
  31438. imgData.data = null;
  31439. imgData.bitmap = bitmap;
  31440. imgData.width = newWidth;
  31441. imgData.height = newHeight;
  31442. return imgData;
  31443. }
  31444. _encodeBMP() {
  31445. const {
  31446. width,
  31447. height,
  31448. kind
  31449. } = this._imgData;
  31450. let data = this._imgData.data;
  31451. let bitPerPixel;
  31452. let colorTable = new Uint8Array(0);
  31453. let maskTable = colorTable;
  31454. let compression = 0;
  31455. switch (kind) {
  31456. case ImageKind.GRAYSCALE_1BPP:
  31457. {
  31458. bitPerPixel = 1;
  31459. colorTable = new Uint8Array(this._isMask ? [255, 255, 255, 255, 0, 0, 0, 0] : [0, 0, 0, 0, 255, 255, 255, 255]);
  31460. const rowLen = width + 7 >> 3;
  31461. const rowSize = rowLen + 3 & -4;
  31462. if (rowLen !== rowSize) {
  31463. const newData = new Uint8Array(rowSize * height);
  31464. let k = 0;
  31465. for (let i = 0, ii = height * rowLen; i < ii; i += rowLen, k += rowSize) {
  31466. newData.set(data.subarray(i, i + rowLen), k);
  31467. }
  31468. data = newData;
  31469. }
  31470. break;
  31471. }
  31472. case ImageKind.RGB_24BPP:
  31473. {
  31474. bitPerPixel = 24;
  31475. if (width & 3) {
  31476. const rowLen = 3 * width;
  31477. const rowSize = rowLen + 3 & -4;
  31478. const extraLen = rowSize - rowLen;
  31479. const newData = new Uint8Array(rowSize * height);
  31480. let k = 0;
  31481. for (let i = 0, ii = height * rowLen; i < ii; i += rowLen) {
  31482. const row = data.subarray(i, i + rowLen);
  31483. for (let j = 0; j < rowLen; j += 3) {
  31484. newData[k++] = row[j + 2];
  31485. newData[k++] = row[j + 1];
  31486. newData[k++] = row[j];
  31487. }
  31488. k += extraLen;
  31489. }
  31490. data = newData;
  31491. } else {
  31492. for (let i = 0, ii = data.length; i < ii; i += 3) {
  31493. const tmp = data[i];
  31494. data[i] = data[i + 2];
  31495. data[i + 2] = tmp;
  31496. }
  31497. }
  31498. break;
  31499. }
  31500. case ImageKind.RGBA_32BPP:
  31501. bitPerPixel = 32;
  31502. compression = 3;
  31503. maskTable = new Uint8Array(4 + 4 + 4 + 4 + 52);
  31504. const view = new DataView(maskTable.buffer);
  31505. if (FeatureTest.isLittleEndian) {
  31506. view.setUint32(0, 0x000000ff, true);
  31507. view.setUint32(4, 0x0000ff00, true);
  31508. view.setUint32(8, 0x00ff0000, true);
  31509. view.setUint32(12, 0xff000000, true);
  31510. } else {
  31511. view.setUint32(0, 0xff000000, true);
  31512. view.setUint32(4, 0x00ff0000, true);
  31513. view.setUint32(8, 0x0000ff00, true);
  31514. view.setUint32(12, 0x000000ff, true);
  31515. }
  31516. break;
  31517. default:
  31518. throw new Error("invalid format");
  31519. }
  31520. let i = 0;
  31521. const headerLength = 40 + maskTable.length;
  31522. const fileLength = 14 + headerLength + colorTable.length + data.length;
  31523. const bmpData = new Uint8Array(fileLength);
  31524. const view = new DataView(bmpData.buffer);
  31525. view.setUint16(i, 0x4d42, true);
  31526. i += 2;
  31527. view.setUint32(i, fileLength, true);
  31528. i += 4;
  31529. view.setUint32(i, 0, true);
  31530. i += 4;
  31531. view.setUint32(i, 14 + headerLength + colorTable.length, true);
  31532. i += 4;
  31533. view.setUint32(i, headerLength, true);
  31534. i += 4;
  31535. view.setInt32(i, width, true);
  31536. i += 4;
  31537. view.setInt32(i, -height, true);
  31538. i += 4;
  31539. view.setUint16(i, 1, true);
  31540. i += 2;
  31541. view.setUint16(i, bitPerPixel, true);
  31542. i += 2;
  31543. view.setUint32(i, compression, true);
  31544. i += 4;
  31545. view.setUint32(i, 0, true);
  31546. i += 4;
  31547. view.setInt32(i, 0, true);
  31548. i += 4;
  31549. view.setInt32(i, 0, true);
  31550. i += 4;
  31551. view.setUint32(i, colorTable.length / 4, true);
  31552. i += 4;
  31553. view.setUint32(i, 0, true);
  31554. i += 4;
  31555. bmpData.set(maskTable, i);
  31556. i += maskTable.length;
  31557. bmpData.set(colorTable, i);
  31558. i += colorTable.length;
  31559. bmpData.set(data, i);
  31560. return bmpData;
  31561. }
  31562. }
  31563. ImageResizer._goodSquareLength = MIN_IMAGE_DIM;
  31564. ;// ./src/shared/murmurhash3.js
  31565. const SEED = 0xc3d2e1f0;
  31566. const MASK_HIGH = 0xffff0000;
  31567. const MASK_LOW = 0xffff;
  31568. class MurmurHash3_64 {
  31569. constructor(seed) {
  31570. this.h1 = seed ? seed & 0xffffffff : SEED;
  31571. this.h2 = seed ? seed & 0xffffffff : SEED;
  31572. }
  31573. update(input) {
  31574. let data, length;
  31575. if (typeof input === "string") {
  31576. data = new Uint8Array(input.length * 2);
  31577. length = 0;
  31578. for (let i = 0, ii = input.length; i < ii; i++) {
  31579. const code = input.charCodeAt(i);
  31580. if (code <= 0xff) {
  31581. data[length++] = code;
  31582. } else {
  31583. data[length++] = code >>> 8;
  31584. data[length++] = code & 0xff;
  31585. }
  31586. }
  31587. } else if (ArrayBuffer.isView(input)) {
  31588. data = input.slice();
  31589. length = data.byteLength;
  31590. } else {
  31591. throw new Error("Invalid data format, must be a string or TypedArray.");
  31592. }
  31593. const blockCounts = length >> 2;
  31594. const tailLength = length - blockCounts * 4;
  31595. const dataUint32 = new Uint32Array(data.buffer, 0, blockCounts);
  31596. let k1 = 0,
  31597. k2 = 0;
  31598. let h1 = this.h1,
  31599. h2 = this.h2;
  31600. const C1 = 0xcc9e2d51,
  31601. C2 = 0x1b873593;
  31602. const C1_LOW = C1 & MASK_LOW,
  31603. C2_LOW = C2 & MASK_LOW;
  31604. for (let i = 0; i < blockCounts; i++) {
  31605. if (i & 1) {
  31606. k1 = dataUint32[i];
  31607. k1 = k1 * C1 & MASK_HIGH | k1 * C1_LOW & MASK_LOW;
  31608. k1 = k1 << 15 | k1 >>> 17;
  31609. k1 = k1 * C2 & MASK_HIGH | k1 * C2_LOW & MASK_LOW;
  31610. h1 ^= k1;
  31611. h1 = h1 << 13 | h1 >>> 19;
  31612. h1 = h1 * 5 + 0xe6546b64;
  31613. } else {
  31614. k2 = dataUint32[i];
  31615. k2 = k2 * C1 & MASK_HIGH | k2 * C1_LOW & MASK_LOW;
  31616. k2 = k2 << 15 | k2 >>> 17;
  31617. k2 = k2 * C2 & MASK_HIGH | k2 * C2_LOW & MASK_LOW;
  31618. h2 ^= k2;
  31619. h2 = h2 << 13 | h2 >>> 19;
  31620. h2 = h2 * 5 + 0xe6546b64;
  31621. }
  31622. }
  31623. k1 = 0;
  31624. switch (tailLength) {
  31625. case 3:
  31626. k1 ^= data[blockCounts * 4 + 2] << 16;
  31627. case 2:
  31628. k1 ^= data[blockCounts * 4 + 1] << 8;
  31629. case 1:
  31630. k1 ^= data[blockCounts * 4];
  31631. k1 = k1 * C1 & MASK_HIGH | k1 * C1_LOW & MASK_LOW;
  31632. k1 = k1 << 15 | k1 >>> 17;
  31633. k1 = k1 * C2 & MASK_HIGH | k1 * C2_LOW & MASK_LOW;
  31634. if (blockCounts & 1) {
  31635. h1 ^= k1;
  31636. } else {
  31637. h2 ^= k1;
  31638. }
  31639. }
  31640. this.h1 = h1;
  31641. this.h2 = h2;
  31642. }
  31643. hexdigest() {
  31644. let h1 = this.h1,
  31645. h2 = this.h2;
  31646. h1 ^= h2 >>> 1;
  31647. h1 = h1 * 0xed558ccd & MASK_HIGH | h1 * 0x8ccd & MASK_LOW;
  31648. h2 = h2 * 0xff51afd7 & MASK_HIGH | ((h2 << 16 | h1 >>> 16) * 0xafd7ed55 & MASK_HIGH) >>> 16;
  31649. h1 ^= h2 >>> 1;
  31650. h1 = h1 * 0x1a85ec53 & MASK_HIGH | h1 * 0xec53 & MASK_LOW;
  31651. h2 = h2 * 0xc4ceb9fe & MASK_HIGH | ((h2 << 16 | h1 >>> 16) * 0xb9fe1a85 & MASK_HIGH) >>> 16;
  31652. h1 ^= h2 >>> 1;
  31653. return (h1 >>> 0).toString(16).padStart(8, "0") + (h2 >>> 0).toString(16).padStart(8, "0");
  31654. }
  31655. }
  31656. ;// ./src/core/operator_list.js
  31657. function addState(parentState, pattern, checkFn, iterateFn, processFn) {
  31658. let state = parentState;
  31659. for (let i = 0, ii = pattern.length - 1; i < ii; i++) {
  31660. const item = pattern[i];
  31661. state = state[item] ||= [];
  31662. }
  31663. state[pattern.at(-1)] = {
  31664. checkFn,
  31665. iterateFn,
  31666. processFn
  31667. };
  31668. }
  31669. const InitialState = [];
  31670. addState(InitialState, [OPS.save, OPS.transform, OPS.paintInlineImageXObject, OPS.restore], null, function iterateInlineImageGroup(context, i) {
  31671. const fnArray = context.fnArray;
  31672. const iFirstSave = context.iCurr - 3;
  31673. const pos = (i - iFirstSave) % 4;
  31674. switch (pos) {
  31675. case 0:
  31676. return fnArray[i] === OPS.save;
  31677. case 1:
  31678. return fnArray[i] === OPS.transform;
  31679. case 2:
  31680. return fnArray[i] === OPS.paintInlineImageXObject;
  31681. case 3:
  31682. return fnArray[i] === OPS.restore;
  31683. }
  31684. throw new Error(`iterateInlineImageGroup - invalid pos: ${pos}`);
  31685. }, function foundInlineImageGroup(context, i) {
  31686. const MIN_IMAGES_IN_INLINE_IMAGES_BLOCK = 10;
  31687. const MAX_IMAGES_IN_INLINE_IMAGES_BLOCK = 200;
  31688. const MAX_WIDTH = 1000;
  31689. const IMAGE_PADDING = 1;
  31690. const fnArray = context.fnArray,
  31691. argsArray = context.argsArray;
  31692. const curr = context.iCurr;
  31693. const iFirstSave = curr - 3;
  31694. const iFirstTransform = curr - 2;
  31695. const iFirstPIIXO = curr - 1;
  31696. const count = Math.min(Math.floor((i - iFirstSave) / 4), MAX_IMAGES_IN_INLINE_IMAGES_BLOCK);
  31697. if (count < MIN_IMAGES_IN_INLINE_IMAGES_BLOCK) {
  31698. return i - (i - iFirstSave) % 4;
  31699. }
  31700. let maxX = 0;
  31701. const map = [];
  31702. let maxLineHeight = 0;
  31703. let currentX = IMAGE_PADDING,
  31704. currentY = IMAGE_PADDING;
  31705. for (let q = 0; q < count; q++) {
  31706. const transform = argsArray[iFirstTransform + (q << 2)];
  31707. const img = argsArray[iFirstPIIXO + (q << 2)][0];
  31708. if (currentX + img.width > MAX_WIDTH) {
  31709. maxX = Math.max(maxX, currentX);
  31710. currentY += maxLineHeight + 2 * IMAGE_PADDING;
  31711. currentX = 0;
  31712. maxLineHeight = 0;
  31713. }
  31714. map.push({
  31715. transform,
  31716. x: currentX,
  31717. y: currentY,
  31718. w: img.width,
  31719. h: img.height
  31720. });
  31721. currentX += img.width + 2 * IMAGE_PADDING;
  31722. maxLineHeight = Math.max(maxLineHeight, img.height);
  31723. }
  31724. const imgWidth = Math.max(maxX, currentX) + IMAGE_PADDING;
  31725. const imgHeight = currentY + maxLineHeight + IMAGE_PADDING;
  31726. const imgData = new Uint8Array(imgWidth * imgHeight * 4);
  31727. const imgRowSize = imgWidth << 2;
  31728. for (let q = 0; q < count; q++) {
  31729. const data = argsArray[iFirstPIIXO + (q << 2)][0].data;
  31730. const rowSize = map[q].w << 2;
  31731. let dataOffset = 0;
  31732. let offset = map[q].x + map[q].y * imgWidth << 2;
  31733. imgData.set(data.subarray(0, rowSize), offset - imgRowSize);
  31734. for (let k = 0, kk = map[q].h; k < kk; k++) {
  31735. imgData.set(data.subarray(dataOffset, dataOffset + rowSize), offset);
  31736. dataOffset += rowSize;
  31737. offset += imgRowSize;
  31738. }
  31739. imgData.set(data.subarray(dataOffset - rowSize, dataOffset), offset);
  31740. while (offset >= 0) {
  31741. data[offset - 4] = data[offset];
  31742. data[offset - 3] = data[offset + 1];
  31743. data[offset - 2] = data[offset + 2];
  31744. data[offset - 1] = data[offset + 3];
  31745. data[offset + rowSize] = data[offset + rowSize - 4];
  31746. data[offset + rowSize + 1] = data[offset + rowSize - 3];
  31747. data[offset + rowSize + 2] = data[offset + rowSize - 2];
  31748. data[offset + rowSize + 3] = data[offset + rowSize - 1];
  31749. offset -= imgRowSize;
  31750. }
  31751. }
  31752. const img = {
  31753. width: imgWidth,
  31754. height: imgHeight
  31755. };
  31756. if (context.isOffscreenCanvasSupported) {
  31757. const canvas = new OffscreenCanvas(imgWidth, imgHeight);
  31758. const ctx = canvas.getContext("2d");
  31759. ctx.putImageData(new ImageData(new Uint8ClampedArray(imgData.buffer), imgWidth, imgHeight), 0, 0);
  31760. img.bitmap = canvas.transferToImageBitmap();
  31761. img.data = null;
  31762. } else {
  31763. img.kind = ImageKind.RGBA_32BPP;
  31764. img.data = imgData;
  31765. }
  31766. fnArray.splice(iFirstSave, count * 4, OPS.paintInlineImageXObjectGroup);
  31767. argsArray.splice(iFirstSave, count * 4, [img, map]);
  31768. return iFirstSave + 1;
  31769. });
  31770. addState(InitialState, [OPS.save, OPS.transform, OPS.paintImageMaskXObject, OPS.restore], null, function iterateImageMaskGroup(context, i) {
  31771. const fnArray = context.fnArray;
  31772. const iFirstSave = context.iCurr - 3;
  31773. const pos = (i - iFirstSave) % 4;
  31774. switch (pos) {
  31775. case 0:
  31776. return fnArray[i] === OPS.save;
  31777. case 1:
  31778. return fnArray[i] === OPS.transform;
  31779. case 2:
  31780. return fnArray[i] === OPS.paintImageMaskXObject;
  31781. case 3:
  31782. return fnArray[i] === OPS.restore;
  31783. }
  31784. throw new Error(`iterateImageMaskGroup - invalid pos: ${pos}`);
  31785. }, function foundImageMaskGroup(context, i) {
  31786. const MIN_IMAGES_IN_MASKS_BLOCK = 10;
  31787. const MAX_IMAGES_IN_MASKS_BLOCK = 100;
  31788. const MAX_SAME_IMAGES_IN_MASKS_BLOCK = 1000;
  31789. const fnArray = context.fnArray,
  31790. argsArray = context.argsArray;
  31791. const curr = context.iCurr;
  31792. const iFirstSave = curr - 3;
  31793. const iFirstTransform = curr - 2;
  31794. const iFirstPIMXO = curr - 1;
  31795. let count = Math.floor((i - iFirstSave) / 4);
  31796. if (count < MIN_IMAGES_IN_MASKS_BLOCK) {
  31797. return i - (i - iFirstSave) % 4;
  31798. }
  31799. let isSameImage = false;
  31800. let iTransform, transformArgs;
  31801. const firstPIMXOArg0 = argsArray[iFirstPIMXO][0];
  31802. const firstTransformArg0 = argsArray[iFirstTransform][0],
  31803. firstTransformArg1 = argsArray[iFirstTransform][1],
  31804. firstTransformArg2 = argsArray[iFirstTransform][2],
  31805. firstTransformArg3 = argsArray[iFirstTransform][3];
  31806. if (firstTransformArg1 === firstTransformArg2) {
  31807. isSameImage = true;
  31808. iTransform = iFirstTransform + 4;
  31809. let iPIMXO = iFirstPIMXO + 4;
  31810. for (let q = 1; q < count; q++, iTransform += 4, iPIMXO += 4) {
  31811. transformArgs = argsArray[iTransform];
  31812. if (argsArray[iPIMXO][0] !== firstPIMXOArg0 || transformArgs[0] !== firstTransformArg0 || transformArgs[1] !== firstTransformArg1 || transformArgs[2] !== firstTransformArg2 || transformArgs[3] !== firstTransformArg3) {
  31813. if (q < MIN_IMAGES_IN_MASKS_BLOCK) {
  31814. isSameImage = false;
  31815. } else {
  31816. count = q;
  31817. }
  31818. break;
  31819. }
  31820. }
  31821. }
  31822. if (isSameImage) {
  31823. count = Math.min(count, MAX_SAME_IMAGES_IN_MASKS_BLOCK);
  31824. const positions = new Float32Array(count * 2);
  31825. iTransform = iFirstTransform;
  31826. for (let q = 0; q < count; q++, iTransform += 4) {
  31827. transformArgs = argsArray[iTransform];
  31828. positions[q << 1] = transformArgs[4];
  31829. positions[(q << 1) + 1] = transformArgs[5];
  31830. }
  31831. fnArray.splice(iFirstSave, count * 4, OPS.paintImageMaskXObjectRepeat);
  31832. argsArray.splice(iFirstSave, count * 4, [firstPIMXOArg0, firstTransformArg0, firstTransformArg1, firstTransformArg2, firstTransformArg3, positions]);
  31833. } else {
  31834. count = Math.min(count, MAX_IMAGES_IN_MASKS_BLOCK);
  31835. const images = [];
  31836. for (let q = 0; q < count; q++) {
  31837. transformArgs = argsArray[iFirstTransform + (q << 2)];
  31838. const maskParams = argsArray[iFirstPIMXO + (q << 2)][0];
  31839. images.push({
  31840. data: maskParams.data,
  31841. width: maskParams.width,
  31842. height: maskParams.height,
  31843. interpolate: maskParams.interpolate,
  31844. count: maskParams.count,
  31845. transform: transformArgs
  31846. });
  31847. }
  31848. fnArray.splice(iFirstSave, count * 4, OPS.paintImageMaskXObjectGroup);
  31849. argsArray.splice(iFirstSave, count * 4, [images]);
  31850. }
  31851. return iFirstSave + 1;
  31852. });
  31853. addState(InitialState, [OPS.save, OPS.transform, OPS.paintImageXObject, OPS.restore], function (context) {
  31854. const argsArray = context.argsArray;
  31855. const iFirstTransform = context.iCurr - 2;
  31856. return argsArray[iFirstTransform][1] === 0 && argsArray[iFirstTransform][2] === 0;
  31857. }, function iterateImageGroup(context, i) {
  31858. const fnArray = context.fnArray,
  31859. argsArray = context.argsArray;
  31860. const iFirstSave = context.iCurr - 3;
  31861. const pos = (i - iFirstSave) % 4;
  31862. switch (pos) {
  31863. case 0:
  31864. return fnArray[i] === OPS.save;
  31865. case 1:
  31866. if (fnArray[i] !== OPS.transform) {
  31867. return false;
  31868. }
  31869. const iFirstTransform = context.iCurr - 2;
  31870. const firstTransformArg0 = argsArray[iFirstTransform][0];
  31871. const firstTransformArg3 = argsArray[iFirstTransform][3];
  31872. if (argsArray[i][0] !== firstTransformArg0 || argsArray[i][1] !== 0 || argsArray[i][2] !== 0 || argsArray[i][3] !== firstTransformArg3) {
  31873. return false;
  31874. }
  31875. return true;
  31876. case 2:
  31877. if (fnArray[i] !== OPS.paintImageXObject) {
  31878. return false;
  31879. }
  31880. const iFirstPIXO = context.iCurr - 1;
  31881. const firstPIXOArg0 = argsArray[iFirstPIXO][0];
  31882. if (argsArray[i][0] !== firstPIXOArg0) {
  31883. return false;
  31884. }
  31885. return true;
  31886. case 3:
  31887. return fnArray[i] === OPS.restore;
  31888. }
  31889. throw new Error(`iterateImageGroup - invalid pos: ${pos}`);
  31890. }, function (context, i) {
  31891. const MIN_IMAGES_IN_BLOCK = 3;
  31892. const MAX_IMAGES_IN_BLOCK = 1000;
  31893. const fnArray = context.fnArray,
  31894. argsArray = context.argsArray;
  31895. const curr = context.iCurr;
  31896. const iFirstSave = curr - 3;
  31897. const iFirstTransform = curr - 2;
  31898. const iFirstPIXO = curr - 1;
  31899. const firstPIXOArg0 = argsArray[iFirstPIXO][0];
  31900. const firstTransformArg0 = argsArray[iFirstTransform][0];
  31901. const firstTransformArg3 = argsArray[iFirstTransform][3];
  31902. const count = Math.min(Math.floor((i - iFirstSave) / 4), MAX_IMAGES_IN_BLOCK);
  31903. if (count < MIN_IMAGES_IN_BLOCK) {
  31904. return i - (i - iFirstSave) % 4;
  31905. }
  31906. const positions = new Float32Array(count * 2);
  31907. let iTransform = iFirstTransform;
  31908. for (let q = 0; q < count; q++, iTransform += 4) {
  31909. const transformArgs = argsArray[iTransform];
  31910. positions[q << 1] = transformArgs[4];
  31911. positions[(q << 1) + 1] = transformArgs[5];
  31912. }
  31913. const args = [firstPIXOArg0, firstTransformArg0, firstTransformArg3, positions];
  31914. fnArray.splice(iFirstSave, count * 4, OPS.paintImageXObjectRepeat);
  31915. argsArray.splice(iFirstSave, count * 4, args);
  31916. return iFirstSave + 1;
  31917. });
  31918. addState(InitialState, [OPS.beginText, OPS.setFont, OPS.setTextMatrix, OPS.showText, OPS.endText], null, function iterateShowTextGroup(context, i) {
  31919. const fnArray = context.fnArray,
  31920. argsArray = context.argsArray;
  31921. const iFirstSave = context.iCurr - 4;
  31922. const pos = (i - iFirstSave) % 5;
  31923. switch (pos) {
  31924. case 0:
  31925. return fnArray[i] === OPS.beginText;
  31926. case 1:
  31927. return fnArray[i] === OPS.setFont;
  31928. case 2:
  31929. return fnArray[i] === OPS.setTextMatrix;
  31930. case 3:
  31931. if (fnArray[i] !== OPS.showText) {
  31932. return false;
  31933. }
  31934. const iFirstSetFont = context.iCurr - 3;
  31935. const firstSetFontArg0 = argsArray[iFirstSetFont][0];
  31936. const firstSetFontArg1 = argsArray[iFirstSetFont][1];
  31937. if (argsArray[i][0] !== firstSetFontArg0 || argsArray[i][1] !== firstSetFontArg1) {
  31938. return false;
  31939. }
  31940. return true;
  31941. case 4:
  31942. return fnArray[i] === OPS.endText;
  31943. }
  31944. throw new Error(`iterateShowTextGroup - invalid pos: ${pos}`);
  31945. }, function (context, i) {
  31946. const MIN_CHARS_IN_BLOCK = 3;
  31947. const MAX_CHARS_IN_BLOCK = 1000;
  31948. const fnArray = context.fnArray,
  31949. argsArray = context.argsArray;
  31950. const curr = context.iCurr;
  31951. const iFirstBeginText = curr - 4;
  31952. const iFirstSetFont = curr - 3;
  31953. const iFirstSetTextMatrix = curr - 2;
  31954. const iFirstShowText = curr - 1;
  31955. const iFirstEndText = curr;
  31956. const firstSetFontArg0 = argsArray[iFirstSetFont][0];
  31957. const firstSetFontArg1 = argsArray[iFirstSetFont][1];
  31958. let count = Math.min(Math.floor((i - iFirstBeginText) / 5), MAX_CHARS_IN_BLOCK);
  31959. if (count < MIN_CHARS_IN_BLOCK) {
  31960. return i - (i - iFirstBeginText) % 5;
  31961. }
  31962. let iFirst = iFirstBeginText;
  31963. if (iFirstBeginText >= 4 && fnArray[iFirstBeginText - 4] === fnArray[iFirstSetFont] && fnArray[iFirstBeginText - 3] === fnArray[iFirstSetTextMatrix] && fnArray[iFirstBeginText - 2] === fnArray[iFirstShowText] && fnArray[iFirstBeginText - 1] === fnArray[iFirstEndText] && argsArray[iFirstBeginText - 4][0] === firstSetFontArg0 && argsArray[iFirstBeginText - 4][1] === firstSetFontArg1) {
  31964. count++;
  31965. iFirst -= 5;
  31966. }
  31967. let iEndText = iFirst + 4;
  31968. for (let q = 1; q < count; q++) {
  31969. fnArray.splice(iEndText, 3);
  31970. argsArray.splice(iEndText, 3);
  31971. iEndText += 2;
  31972. }
  31973. return iEndText + 1;
  31974. });
  31975. class NullOptimizer {
  31976. constructor(queue) {
  31977. this.queue = queue;
  31978. }
  31979. _optimize() {}
  31980. push(fn, args) {
  31981. this.queue.fnArray.push(fn);
  31982. this.queue.argsArray.push(args);
  31983. this._optimize();
  31984. }
  31985. flush() {}
  31986. reset() {}
  31987. }
  31988. class QueueOptimizer extends NullOptimizer {
  31989. constructor(queue) {
  31990. super(queue);
  31991. this.state = null;
  31992. this.context = {
  31993. iCurr: 0,
  31994. fnArray: queue.fnArray,
  31995. argsArray: queue.argsArray,
  31996. isOffscreenCanvasSupported: false
  31997. };
  31998. this.match = null;
  31999. this.lastProcessed = 0;
  32000. }
  32001. set isOffscreenCanvasSupported(value) {
  32002. this.context.isOffscreenCanvasSupported = value;
  32003. }
  32004. _optimize() {
  32005. const fnArray = this.queue.fnArray;
  32006. let i = this.lastProcessed,
  32007. ii = fnArray.length;
  32008. let state = this.state;
  32009. let match = this.match;
  32010. if (!state && !match && i + 1 === ii && !InitialState[fnArray[i]]) {
  32011. this.lastProcessed = ii;
  32012. return;
  32013. }
  32014. const context = this.context;
  32015. while (i < ii) {
  32016. if (match) {
  32017. const iterate = (0, match.iterateFn)(context, i);
  32018. if (iterate) {
  32019. i++;
  32020. continue;
  32021. }
  32022. i = (0, match.processFn)(context, i + 1);
  32023. ii = fnArray.length;
  32024. match = null;
  32025. state = null;
  32026. if (i >= ii) {
  32027. break;
  32028. }
  32029. }
  32030. state = (state || InitialState)[fnArray[i]];
  32031. if (!state || Array.isArray(state)) {
  32032. i++;
  32033. continue;
  32034. }
  32035. context.iCurr = i;
  32036. i++;
  32037. if (state.checkFn && !(0, state.checkFn)(context)) {
  32038. state = null;
  32039. continue;
  32040. }
  32041. match = state;
  32042. state = null;
  32043. }
  32044. this.state = state;
  32045. this.match = match;
  32046. this.lastProcessed = i;
  32047. }
  32048. flush() {
  32049. while (this.match) {
  32050. const length = this.queue.fnArray.length;
  32051. this.lastProcessed = (0, this.match.processFn)(this.context, length);
  32052. this.match = null;
  32053. this.state = null;
  32054. this._optimize();
  32055. }
  32056. }
  32057. reset() {
  32058. this.state = null;
  32059. this.match = null;
  32060. this.lastProcessed = 0;
  32061. }
  32062. }
  32063. class OperatorList {
  32064. static CHUNK_SIZE = 1000;
  32065. static CHUNK_SIZE_ABOUT = this.CHUNK_SIZE - 5;
  32066. constructor(intent = 0, streamSink) {
  32067. this._streamSink = streamSink;
  32068. this.fnArray = [];
  32069. this.argsArray = [];
  32070. this.optimizer = streamSink && !(intent & RenderingIntentFlag.OPLIST) ? new QueueOptimizer(this) : new NullOptimizer(this);
  32071. this.dependencies = new Set();
  32072. this._totalLength = 0;
  32073. this.weight = 0;
  32074. this._resolved = streamSink ? null : Promise.resolve();
  32075. }
  32076. set isOffscreenCanvasSupported(value) {
  32077. this.optimizer.isOffscreenCanvasSupported = value;
  32078. }
  32079. get length() {
  32080. return this.argsArray.length;
  32081. }
  32082. get ready() {
  32083. return this._resolved || this._streamSink.ready;
  32084. }
  32085. get totalLength() {
  32086. return this._totalLength + this.length;
  32087. }
  32088. addOp(fn, args) {
  32089. this.optimizer.push(fn, args);
  32090. this.weight++;
  32091. if (this._streamSink) {
  32092. if (this.weight >= OperatorList.CHUNK_SIZE) {
  32093. this.flush();
  32094. } else if (this.weight >= OperatorList.CHUNK_SIZE_ABOUT && (fn === OPS.restore || fn === OPS.endText)) {
  32095. this.flush();
  32096. }
  32097. }
  32098. }
  32099. addImageOps(fn, args, optionalContent) {
  32100. if (optionalContent !== undefined) {
  32101. this.addOp(OPS.beginMarkedContentProps, ["OC", optionalContent]);
  32102. }
  32103. this.addOp(fn, args);
  32104. if (optionalContent !== undefined) {
  32105. this.addOp(OPS.endMarkedContent, []);
  32106. }
  32107. }
  32108. addDependency(dependency) {
  32109. if (this.dependencies.has(dependency)) {
  32110. return;
  32111. }
  32112. this.dependencies.add(dependency);
  32113. this.addOp(OPS.dependency, [dependency]);
  32114. }
  32115. addDependencies(dependencies) {
  32116. for (const dependency of dependencies) {
  32117. this.addDependency(dependency);
  32118. }
  32119. }
  32120. addOpList(opList) {
  32121. if (!(opList instanceof OperatorList)) {
  32122. warn('addOpList - ignoring invalid "opList" parameter.');
  32123. return;
  32124. }
  32125. for (const dependency of opList.dependencies) {
  32126. this.dependencies.add(dependency);
  32127. }
  32128. for (let i = 0, ii = opList.length; i < ii; i++) {
  32129. this.addOp(opList.fnArray[i], opList.argsArray[i]);
  32130. }
  32131. }
  32132. getIR() {
  32133. return {
  32134. fnArray: this.fnArray,
  32135. argsArray: this.argsArray,
  32136. length: this.length
  32137. };
  32138. }
  32139. get _transfers() {
  32140. const transfers = [];
  32141. const {
  32142. fnArray,
  32143. argsArray,
  32144. length
  32145. } = this;
  32146. for (let i = 0; i < length; i++) {
  32147. switch (fnArray[i]) {
  32148. case OPS.paintInlineImageXObject:
  32149. case OPS.paintInlineImageXObjectGroup:
  32150. case OPS.paintImageMaskXObject:
  32151. const arg = argsArray[i][0];
  32152. if (!arg.cached && arg.data?.buffer instanceof ArrayBuffer) {
  32153. transfers.push(arg.data.buffer);
  32154. }
  32155. break;
  32156. }
  32157. }
  32158. return transfers;
  32159. }
  32160. flush(lastChunk = false, separateAnnots = null) {
  32161. this.optimizer.flush();
  32162. const length = this.length;
  32163. this._totalLength += length;
  32164. this._streamSink.enqueue({
  32165. fnArray: this.fnArray,
  32166. argsArray: this.argsArray,
  32167. lastChunk,
  32168. separateAnnots,
  32169. length
  32170. }, 1, this._transfers);
  32171. this.dependencies.clear();
  32172. this.fnArray.length = 0;
  32173. this.argsArray.length = 0;
  32174. this.weight = 0;
  32175. this.optimizer.reset();
  32176. }
  32177. }
  32178. ;// ./src/core/image.js
  32179. function decodeAndClamp(value, addend, coefficient, max) {
  32180. value = addend + value * coefficient;
  32181. if (value < 0) {
  32182. value = 0;
  32183. } else if (value > max) {
  32184. value = max;
  32185. }
  32186. return value;
  32187. }
  32188. function resizeImageMask(src, bpc, w1, h1, w2, h2) {
  32189. const length = w2 * h2;
  32190. let dest;
  32191. if (bpc <= 8) {
  32192. dest = new Uint8Array(length);
  32193. } else if (bpc <= 16) {
  32194. dest = new Uint16Array(length);
  32195. } else {
  32196. dest = new Uint32Array(length);
  32197. }
  32198. const xRatio = w1 / w2;
  32199. const yRatio = h1 / h2;
  32200. let i,
  32201. j,
  32202. py,
  32203. newIndex = 0,
  32204. oldIndex;
  32205. const xScaled = new Uint16Array(w2);
  32206. const w1Scanline = w1;
  32207. for (i = 0; i < w2; i++) {
  32208. xScaled[i] = Math.floor(i * xRatio);
  32209. }
  32210. for (i = 0; i < h2; i++) {
  32211. py = Math.floor(i * yRatio) * w1Scanline;
  32212. for (j = 0; j < w2; j++) {
  32213. oldIndex = py + xScaled[j];
  32214. dest[newIndex++] = src[oldIndex];
  32215. }
  32216. }
  32217. return dest;
  32218. }
  32219. class PDFImage {
  32220. constructor({
  32221. xref,
  32222. res,
  32223. image,
  32224. isInline = false,
  32225. smask = null,
  32226. mask = null,
  32227. isMask = false,
  32228. pdfFunctionFactory,
  32229. localColorSpaceCache
  32230. }) {
  32231. this.image = image;
  32232. const dict = image.dict;
  32233. const filter = dict.get("F", "Filter");
  32234. let filterName;
  32235. if (filter instanceof Name) {
  32236. filterName = filter.name;
  32237. } else if (Array.isArray(filter)) {
  32238. const filterZero = xref.fetchIfRef(filter[0]);
  32239. if (filterZero instanceof Name) {
  32240. filterName = filterZero.name;
  32241. }
  32242. }
  32243. switch (filterName) {
  32244. case "JPXDecode":
  32245. ({
  32246. width: image.width,
  32247. height: image.height,
  32248. componentsCount: image.numComps,
  32249. bitsPerComponent: image.bitsPerComponent
  32250. } = JpxImage.parseImageProperties(image.stream));
  32251. image.stream.reset();
  32252. this.jpxDecoderOptions = {
  32253. numComponents: 0,
  32254. isIndexedColormap: false,
  32255. smaskInData: dict.has("SMaskInData")
  32256. };
  32257. break;
  32258. case "JBIG2Decode":
  32259. image.bitsPerComponent = 1;
  32260. image.numComps = 1;
  32261. break;
  32262. }
  32263. let width = dict.get("W", "Width");
  32264. let height = dict.get("H", "Height");
  32265. if (Number.isInteger(image.width) && image.width > 0 && Number.isInteger(image.height) && image.height > 0 && (image.width !== width || image.height !== height)) {
  32266. warn("PDFImage - using the Width/Height of the image data, " + "rather than the image dictionary.");
  32267. width = image.width;
  32268. height = image.height;
  32269. }
  32270. if (width < 1 || height < 1) {
  32271. throw new FormatError(`Invalid image width: ${width} or height: ${height}`);
  32272. }
  32273. this.width = width;
  32274. this.height = height;
  32275. this.interpolate = dict.get("I", "Interpolate");
  32276. this.imageMask = dict.get("IM", "ImageMask") || false;
  32277. this.matte = dict.get("Matte") || false;
  32278. let bitsPerComponent = image.bitsPerComponent;
  32279. if (!bitsPerComponent) {
  32280. bitsPerComponent = dict.get("BPC", "BitsPerComponent");
  32281. if (!bitsPerComponent) {
  32282. if (this.imageMask) {
  32283. bitsPerComponent = 1;
  32284. } else {
  32285. throw new FormatError(`Bits per component missing in image: ${this.imageMask}`);
  32286. }
  32287. }
  32288. }
  32289. this.bpc = bitsPerComponent;
  32290. if (!this.imageMask) {
  32291. let colorSpace = dict.getRaw("CS") || dict.getRaw("ColorSpace");
  32292. const hasColorSpace = !!colorSpace;
  32293. if (!hasColorSpace) {
  32294. if (this.jpxDecoderOptions) {
  32295. colorSpace = Name.get("DeviceRGBA");
  32296. } else {
  32297. switch (image.numComps) {
  32298. case 1:
  32299. colorSpace = Name.get("DeviceGray");
  32300. break;
  32301. case 3:
  32302. colorSpace = Name.get("DeviceRGB");
  32303. break;
  32304. case 4:
  32305. colorSpace = Name.get("DeviceCMYK");
  32306. break;
  32307. default:
  32308. throw new Error(`Images with ${image.numComps} color components not supported.`);
  32309. }
  32310. }
  32311. } else if (this.jpxDecoderOptions?.smaskInData) {
  32312. colorSpace = Name.get("DeviceRGBA");
  32313. }
  32314. this.colorSpace = ColorSpace.parse({
  32315. cs: colorSpace,
  32316. xref,
  32317. resources: isInline ? res : null,
  32318. pdfFunctionFactory,
  32319. localColorSpaceCache
  32320. });
  32321. this.numComps = this.colorSpace.numComps;
  32322. if (this.jpxDecoderOptions) {
  32323. this.jpxDecoderOptions.numComponents = hasColorSpace ? this.numComp : 0;
  32324. this.jpxDecoderOptions.isIndexedColormap = this.colorSpace.name === "Indexed";
  32325. }
  32326. }
  32327. this.decode = dict.getArray("D", "Decode");
  32328. this.needsDecode = false;
  32329. if (this.decode && (this.colorSpace && !this.colorSpace.isDefaultDecode(this.decode, bitsPerComponent) || isMask && !ColorSpace.isDefaultDecode(this.decode, 1))) {
  32330. this.needsDecode = true;
  32331. const max = (1 << bitsPerComponent) - 1;
  32332. this.decodeCoefficients = [];
  32333. this.decodeAddends = [];
  32334. const isIndexed = this.colorSpace?.name === "Indexed";
  32335. for (let i = 0, j = 0; i < this.decode.length; i += 2, ++j) {
  32336. const dmin = this.decode[i];
  32337. const dmax = this.decode[i + 1];
  32338. this.decodeCoefficients[j] = isIndexed ? (dmax - dmin) / max : dmax - dmin;
  32339. this.decodeAddends[j] = isIndexed ? dmin : max * dmin;
  32340. }
  32341. }
  32342. if (smask) {
  32343. this.smask = new PDFImage({
  32344. xref,
  32345. res,
  32346. image: smask,
  32347. isInline,
  32348. pdfFunctionFactory,
  32349. localColorSpaceCache
  32350. });
  32351. } else if (mask) {
  32352. if (mask instanceof BaseStream) {
  32353. const maskDict = mask.dict,
  32354. imageMask = maskDict.get("IM", "ImageMask");
  32355. if (!imageMask) {
  32356. warn("Ignoring /Mask in image without /ImageMask.");
  32357. } else {
  32358. this.mask = new PDFImage({
  32359. xref,
  32360. res,
  32361. image: mask,
  32362. isInline,
  32363. isMask: true,
  32364. pdfFunctionFactory,
  32365. localColorSpaceCache
  32366. });
  32367. }
  32368. } else {
  32369. this.mask = mask;
  32370. }
  32371. }
  32372. }
  32373. static async buildImage({
  32374. xref,
  32375. res,
  32376. image,
  32377. isInline = false,
  32378. pdfFunctionFactory,
  32379. localColorSpaceCache
  32380. }) {
  32381. const imageData = image;
  32382. let smaskData = null;
  32383. let maskData = null;
  32384. const smask = image.dict.get("SMask");
  32385. const mask = image.dict.get("Mask");
  32386. if (smask) {
  32387. if (smask instanceof BaseStream) {
  32388. smaskData = smask;
  32389. } else {
  32390. warn("Unsupported /SMask format.");
  32391. }
  32392. } else if (mask) {
  32393. if (mask instanceof BaseStream || Array.isArray(mask)) {
  32394. maskData = mask;
  32395. } else {
  32396. warn("Unsupported /Mask format.");
  32397. }
  32398. }
  32399. return new PDFImage({
  32400. xref,
  32401. res,
  32402. image: imageData,
  32403. isInline,
  32404. smask: smaskData,
  32405. mask: maskData,
  32406. pdfFunctionFactory,
  32407. localColorSpaceCache
  32408. });
  32409. }
  32410. static createRawMask({
  32411. imgArray,
  32412. width,
  32413. height,
  32414. imageIsFromDecodeStream,
  32415. inverseDecode,
  32416. interpolate
  32417. }) {
  32418. const computedLength = (width + 7 >> 3) * height;
  32419. const actualLength = imgArray.byteLength;
  32420. const haveFullData = computedLength === actualLength;
  32421. let data, i;
  32422. if (imageIsFromDecodeStream && (!inverseDecode || haveFullData)) {
  32423. data = imgArray;
  32424. } else if (!inverseDecode) {
  32425. data = new Uint8Array(imgArray);
  32426. } else {
  32427. data = new Uint8Array(computedLength);
  32428. data.set(imgArray);
  32429. data.fill(0xff, actualLength);
  32430. }
  32431. if (inverseDecode) {
  32432. for (i = 0; i < actualLength; i++) {
  32433. data[i] ^= 0xff;
  32434. }
  32435. }
  32436. return {
  32437. data,
  32438. width,
  32439. height,
  32440. interpolate
  32441. };
  32442. }
  32443. static async createMask({
  32444. imgArray,
  32445. width,
  32446. height,
  32447. imageIsFromDecodeStream,
  32448. inverseDecode,
  32449. interpolate,
  32450. isOffscreenCanvasSupported = false
  32451. }) {
  32452. const isSingleOpaquePixel = width === 1 && height === 1 && inverseDecode === (imgArray.length === 0 || !!(imgArray[0] & 128));
  32453. if (isSingleOpaquePixel) {
  32454. return {
  32455. isSingleOpaquePixel
  32456. };
  32457. }
  32458. if (isOffscreenCanvasSupported) {
  32459. if (ImageResizer.needsToBeResized(width, height)) {
  32460. const data = new Uint8ClampedArray(width * height * 4);
  32461. convertBlackAndWhiteToRGBA({
  32462. src: imgArray,
  32463. dest: data,
  32464. width,
  32465. height,
  32466. nonBlackColor: 0,
  32467. inverseDecode
  32468. });
  32469. return ImageResizer.createImage({
  32470. kind: ImageKind.RGBA_32BPP,
  32471. data,
  32472. width,
  32473. height,
  32474. interpolate
  32475. });
  32476. }
  32477. const canvas = new OffscreenCanvas(width, height);
  32478. const ctx = canvas.getContext("2d");
  32479. const imgData = ctx.createImageData(width, height);
  32480. convertBlackAndWhiteToRGBA({
  32481. src: imgArray,
  32482. dest: imgData.data,
  32483. width,
  32484. height,
  32485. nonBlackColor: 0,
  32486. inverseDecode
  32487. });
  32488. ctx.putImageData(imgData, 0, 0);
  32489. const bitmap = canvas.transferToImageBitmap();
  32490. return {
  32491. data: null,
  32492. width,
  32493. height,
  32494. interpolate,
  32495. bitmap
  32496. };
  32497. }
  32498. return this.createRawMask({
  32499. imgArray,
  32500. width,
  32501. height,
  32502. inverseDecode,
  32503. imageIsFromDecodeStream,
  32504. interpolate
  32505. });
  32506. }
  32507. get drawWidth() {
  32508. return Math.max(this.width, this.smask?.width || 0, this.mask?.width || 0);
  32509. }
  32510. get drawHeight() {
  32511. return Math.max(this.height, this.smask?.height || 0, this.mask?.height || 0);
  32512. }
  32513. decodeBuffer(buffer) {
  32514. const bpc = this.bpc;
  32515. const numComps = this.numComps;
  32516. const decodeAddends = this.decodeAddends;
  32517. const decodeCoefficients = this.decodeCoefficients;
  32518. const max = (1 << bpc) - 1;
  32519. let i, ii;
  32520. if (bpc === 1) {
  32521. for (i = 0, ii = buffer.length; i < ii; i++) {
  32522. buffer[i] = +!buffer[i];
  32523. }
  32524. return;
  32525. }
  32526. let index = 0;
  32527. for (i = 0, ii = this.width * this.height; i < ii; i++) {
  32528. for (let j = 0; j < numComps; j++) {
  32529. buffer[index] = decodeAndClamp(buffer[index], decodeAddends[j], decodeCoefficients[j], max);
  32530. index++;
  32531. }
  32532. }
  32533. }
  32534. getComponents(buffer) {
  32535. const bpc = this.bpc;
  32536. if (bpc === 8) {
  32537. return buffer;
  32538. }
  32539. const width = this.width;
  32540. const height = this.height;
  32541. const numComps = this.numComps;
  32542. const length = width * height * numComps;
  32543. let bufferPos = 0;
  32544. let output;
  32545. if (bpc <= 8) {
  32546. output = new Uint8Array(length);
  32547. } else if (bpc <= 16) {
  32548. output = new Uint16Array(length);
  32549. } else {
  32550. output = new Uint32Array(length);
  32551. }
  32552. const rowComps = width * numComps;
  32553. const max = (1 << bpc) - 1;
  32554. let i = 0,
  32555. ii,
  32556. buf;
  32557. if (bpc === 1) {
  32558. let mask, loop1End, loop2End;
  32559. for (let j = 0; j < height; j++) {
  32560. loop1End = i + (rowComps & ~7);
  32561. loop2End = i + rowComps;
  32562. while (i < loop1End) {
  32563. buf = buffer[bufferPos++];
  32564. output[i] = buf >> 7 & 1;
  32565. output[i + 1] = buf >> 6 & 1;
  32566. output[i + 2] = buf >> 5 & 1;
  32567. output[i + 3] = buf >> 4 & 1;
  32568. output[i + 4] = buf >> 3 & 1;
  32569. output[i + 5] = buf >> 2 & 1;
  32570. output[i + 6] = buf >> 1 & 1;
  32571. output[i + 7] = buf & 1;
  32572. i += 8;
  32573. }
  32574. if (i < loop2End) {
  32575. buf = buffer[bufferPos++];
  32576. mask = 128;
  32577. while (i < loop2End) {
  32578. output[i++] = +!!(buf & mask);
  32579. mask >>= 1;
  32580. }
  32581. }
  32582. }
  32583. } else {
  32584. let bits = 0;
  32585. buf = 0;
  32586. for (i = 0, ii = length; i < ii; ++i) {
  32587. if (i % rowComps === 0) {
  32588. buf = 0;
  32589. bits = 0;
  32590. }
  32591. while (bits < bpc) {
  32592. buf = buf << 8 | buffer[bufferPos++];
  32593. bits += 8;
  32594. }
  32595. const remainingBits = bits - bpc;
  32596. let value = buf >> remainingBits;
  32597. if (value < 0) {
  32598. value = 0;
  32599. } else if (value > max) {
  32600. value = max;
  32601. }
  32602. output[i] = value;
  32603. buf &= (1 << remainingBits) - 1;
  32604. bits = remainingBits;
  32605. }
  32606. }
  32607. return output;
  32608. }
  32609. async fillOpacity(rgbaBuf, width, height, actualHeight, image) {
  32610. const smask = this.smask;
  32611. const mask = this.mask;
  32612. let alphaBuf, sw, sh, i, ii, j;
  32613. if (smask) {
  32614. sw = smask.width;
  32615. sh = smask.height;
  32616. alphaBuf = new Uint8ClampedArray(sw * sh);
  32617. await smask.fillGrayBuffer(alphaBuf);
  32618. if (sw !== width || sh !== height) {
  32619. alphaBuf = resizeImageMask(alphaBuf, smask.bpc, sw, sh, width, height);
  32620. }
  32621. } else if (mask) {
  32622. if (mask instanceof PDFImage) {
  32623. sw = mask.width;
  32624. sh = mask.height;
  32625. alphaBuf = new Uint8ClampedArray(sw * sh);
  32626. mask.numComps = 1;
  32627. await mask.fillGrayBuffer(alphaBuf);
  32628. for (i = 0, ii = sw * sh; i < ii; ++i) {
  32629. alphaBuf[i] = 255 - alphaBuf[i];
  32630. }
  32631. if (sw !== width || sh !== height) {
  32632. alphaBuf = resizeImageMask(alphaBuf, mask.bpc, sw, sh, width, height);
  32633. }
  32634. } else if (Array.isArray(mask)) {
  32635. alphaBuf = new Uint8ClampedArray(width * height);
  32636. const numComps = this.numComps;
  32637. for (i = 0, ii = width * height; i < ii; ++i) {
  32638. let opacity = 0;
  32639. const imageOffset = i * numComps;
  32640. for (j = 0; j < numComps; ++j) {
  32641. const color = image[imageOffset + j];
  32642. const maskOffset = j * 2;
  32643. if (color < mask[maskOffset] || color > mask[maskOffset + 1]) {
  32644. opacity = 255;
  32645. break;
  32646. }
  32647. }
  32648. alphaBuf[i] = opacity;
  32649. }
  32650. } else {
  32651. throw new FormatError("Unknown mask format.");
  32652. }
  32653. }
  32654. if (alphaBuf) {
  32655. for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) {
  32656. rgbaBuf[j] = alphaBuf[i];
  32657. }
  32658. } else {
  32659. for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) {
  32660. rgbaBuf[j] = 255;
  32661. }
  32662. }
  32663. }
  32664. undoPreblend(buffer, width, height) {
  32665. const matte = this.smask?.matte;
  32666. if (!matte) {
  32667. return;
  32668. }
  32669. const matteRgb = this.colorSpace.getRgb(matte, 0);
  32670. const matteR = matteRgb[0];
  32671. const matteG = matteRgb[1];
  32672. const matteB = matteRgb[2];
  32673. const length = width * height * 4;
  32674. for (let i = 0; i < length; i += 4) {
  32675. const alpha = buffer[i + 3];
  32676. if (alpha === 0) {
  32677. buffer[i] = 255;
  32678. buffer[i + 1] = 255;
  32679. buffer[i + 2] = 255;
  32680. continue;
  32681. }
  32682. const k = 255 / alpha;
  32683. buffer[i] = (buffer[i] - matteR) * k + matteR;
  32684. buffer[i + 1] = (buffer[i + 1] - matteG) * k + matteG;
  32685. buffer[i + 2] = (buffer[i + 2] - matteB) * k + matteB;
  32686. }
  32687. }
  32688. async createImageData(forceRGBA = false, isOffscreenCanvasSupported = false) {
  32689. const drawWidth = this.drawWidth;
  32690. const drawHeight = this.drawHeight;
  32691. const imgData = {
  32692. width: drawWidth,
  32693. height: drawHeight,
  32694. interpolate: this.interpolate,
  32695. kind: 0,
  32696. data: null
  32697. };
  32698. const numComps = this.numComps;
  32699. const originalWidth = this.width;
  32700. const originalHeight = this.height;
  32701. const bpc = this.bpc;
  32702. const rowBytes = originalWidth * numComps * bpc + 7 >> 3;
  32703. const mustBeResized = isOffscreenCanvasSupported && ImageResizer.needsToBeResized(drawWidth, drawHeight);
  32704. if (this.colorSpace.name === "DeviceRGBA") {
  32705. imgData.kind = ImageKind.RGBA_32BPP;
  32706. const imgArray = imgData.data = await this.getImageBytes(originalHeight * originalWidth * 4, {});
  32707. if (isOffscreenCanvasSupported) {
  32708. if (!mustBeResized) {
  32709. return this.createBitmap(ImageKind.RGBA_32BPP, drawWidth, drawHeight, imgArray);
  32710. }
  32711. return ImageResizer.createImage(imgData, false);
  32712. }
  32713. return imgData;
  32714. }
  32715. if (!forceRGBA) {
  32716. let kind;
  32717. if (this.colorSpace.name === "DeviceGray" && bpc === 1) {
  32718. kind = ImageKind.GRAYSCALE_1BPP;
  32719. } else if (this.colorSpace.name === "DeviceRGB" && bpc === 8 && !this.needsDecode) {
  32720. kind = ImageKind.RGB_24BPP;
  32721. }
  32722. if (kind && !this.smask && !this.mask && drawWidth === originalWidth && drawHeight === originalHeight) {
  32723. const data = await this.getImageBytes(originalHeight * rowBytes, {});
  32724. if (isOffscreenCanvasSupported) {
  32725. if (mustBeResized) {
  32726. return ImageResizer.createImage({
  32727. data,
  32728. kind,
  32729. width: drawWidth,
  32730. height: drawHeight,
  32731. interpolate: this.interpolate
  32732. }, this.needsDecode);
  32733. }
  32734. return this.createBitmap(kind, originalWidth, originalHeight, data);
  32735. }
  32736. imgData.kind = kind;
  32737. imgData.data = data;
  32738. if (this.needsDecode) {
  32739. assert(kind === ImageKind.GRAYSCALE_1BPP, "PDFImage.createImageData: The image must be grayscale.");
  32740. const buffer = imgData.data;
  32741. for (let i = 0, ii = buffer.length; i < ii; i++) {
  32742. buffer[i] ^= 0xff;
  32743. }
  32744. }
  32745. return imgData;
  32746. }
  32747. if (this.image instanceof JpegStream && !this.smask && !this.mask && !this.needsDecode) {
  32748. let imageLength = originalHeight * rowBytes;
  32749. if (isOffscreenCanvasSupported && !mustBeResized) {
  32750. let isHandled = false;
  32751. switch (this.colorSpace.name) {
  32752. case "DeviceGray":
  32753. imageLength *= 4;
  32754. isHandled = true;
  32755. break;
  32756. case "DeviceRGB":
  32757. imageLength = imageLength / 3 * 4;
  32758. isHandled = true;
  32759. break;
  32760. case "DeviceCMYK":
  32761. isHandled = true;
  32762. break;
  32763. }
  32764. if (isHandled) {
  32765. const rgba = await this.getImageBytes(imageLength, {
  32766. drawWidth,
  32767. drawHeight,
  32768. forceRGBA: true
  32769. });
  32770. return this.createBitmap(ImageKind.RGBA_32BPP, drawWidth, drawHeight, rgba);
  32771. }
  32772. } else {
  32773. switch (this.colorSpace.name) {
  32774. case "DeviceGray":
  32775. imageLength *= 3;
  32776. case "DeviceRGB":
  32777. case "DeviceCMYK":
  32778. imgData.kind = ImageKind.RGB_24BPP;
  32779. imgData.data = await this.getImageBytes(imageLength, {
  32780. drawWidth,
  32781. drawHeight,
  32782. forceRGB: true
  32783. });
  32784. if (mustBeResized) {
  32785. return ImageResizer.createImage(imgData);
  32786. }
  32787. return imgData;
  32788. }
  32789. }
  32790. }
  32791. }
  32792. const imgArray = await this.getImageBytes(originalHeight * rowBytes, {
  32793. internal: true
  32794. });
  32795. const actualHeight = 0 | imgArray.length / rowBytes * drawHeight / originalHeight;
  32796. const comps = this.getComponents(imgArray);
  32797. let alpha01, maybeUndoPreblend;
  32798. let canvas, ctx, canvasImgData, data;
  32799. if (isOffscreenCanvasSupported && !mustBeResized) {
  32800. canvas = new OffscreenCanvas(drawWidth, drawHeight);
  32801. ctx = canvas.getContext("2d");
  32802. canvasImgData = ctx.createImageData(drawWidth, drawHeight);
  32803. data = canvasImgData.data;
  32804. }
  32805. imgData.kind = ImageKind.RGBA_32BPP;
  32806. if (!forceRGBA && !this.smask && !this.mask) {
  32807. if (!isOffscreenCanvasSupported || mustBeResized) {
  32808. imgData.kind = ImageKind.RGB_24BPP;
  32809. data = new Uint8ClampedArray(drawWidth * drawHeight * 3);
  32810. alpha01 = 0;
  32811. } else {
  32812. const arr = new Uint32Array(data.buffer);
  32813. arr.fill(FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff);
  32814. alpha01 = 1;
  32815. }
  32816. maybeUndoPreblend = false;
  32817. } else {
  32818. if (!isOffscreenCanvasSupported || mustBeResized) {
  32819. data = new Uint8ClampedArray(drawWidth * drawHeight * 4);
  32820. }
  32821. alpha01 = 1;
  32822. maybeUndoPreblend = true;
  32823. await this.fillOpacity(data, drawWidth, drawHeight, actualHeight, comps);
  32824. }
  32825. if (this.needsDecode) {
  32826. this.decodeBuffer(comps);
  32827. }
  32828. this.colorSpace.fillRgb(data, originalWidth, originalHeight, drawWidth, drawHeight, actualHeight, bpc, comps, alpha01);
  32829. if (maybeUndoPreblend) {
  32830. this.undoPreblend(data, drawWidth, actualHeight);
  32831. }
  32832. if (isOffscreenCanvasSupported && !mustBeResized) {
  32833. ctx.putImageData(canvasImgData, 0, 0);
  32834. const bitmap = canvas.transferToImageBitmap();
  32835. return {
  32836. data: null,
  32837. width: drawWidth,
  32838. height: drawHeight,
  32839. bitmap,
  32840. interpolate: this.interpolate
  32841. };
  32842. }
  32843. imgData.data = data;
  32844. if (mustBeResized) {
  32845. return ImageResizer.createImage(imgData);
  32846. }
  32847. return imgData;
  32848. }
  32849. async fillGrayBuffer(buffer) {
  32850. const numComps = this.numComps;
  32851. if (numComps !== 1) {
  32852. throw new FormatError(`Reading gray scale from a color image: ${numComps}`);
  32853. }
  32854. const width = this.width;
  32855. const height = this.height;
  32856. const bpc = this.bpc;
  32857. const rowBytes = width * numComps * bpc + 7 >> 3;
  32858. const imgArray = await this.getImageBytes(height * rowBytes, {
  32859. internal: true
  32860. });
  32861. const comps = this.getComponents(imgArray);
  32862. let i, length;
  32863. if (bpc === 1) {
  32864. length = width * height;
  32865. if (this.needsDecode) {
  32866. for (i = 0; i < length; ++i) {
  32867. buffer[i] = comps[i] - 1 & 255;
  32868. }
  32869. } else {
  32870. for (i = 0; i < length; ++i) {
  32871. buffer[i] = -comps[i] & 255;
  32872. }
  32873. }
  32874. return;
  32875. }
  32876. if (this.needsDecode) {
  32877. this.decodeBuffer(comps);
  32878. }
  32879. length = width * height;
  32880. const scale = 255 / ((1 << bpc) - 1);
  32881. for (i = 0; i < length; ++i) {
  32882. buffer[i] = scale * comps[i];
  32883. }
  32884. }
  32885. createBitmap(kind, width, height, src) {
  32886. const canvas = new OffscreenCanvas(width, height);
  32887. const ctx = canvas.getContext("2d");
  32888. let imgData;
  32889. if (kind === ImageKind.RGBA_32BPP) {
  32890. imgData = new ImageData(src, width, height);
  32891. } else {
  32892. imgData = ctx.createImageData(width, height);
  32893. convertToRGBA({
  32894. kind,
  32895. src,
  32896. dest: new Uint32Array(imgData.data.buffer),
  32897. width,
  32898. height,
  32899. inverseDecode: this.needsDecode
  32900. });
  32901. }
  32902. ctx.putImageData(imgData, 0, 0);
  32903. const bitmap = canvas.transferToImageBitmap();
  32904. return {
  32905. data: null,
  32906. width,
  32907. height,
  32908. bitmap,
  32909. interpolate: this.interpolate
  32910. };
  32911. }
  32912. async getImageBytes(length, {
  32913. drawWidth,
  32914. drawHeight,
  32915. forceRGBA = false,
  32916. forceRGB = false,
  32917. internal = false
  32918. }) {
  32919. this.image.reset();
  32920. this.image.drawWidth = drawWidth || this.width;
  32921. this.image.drawHeight = drawHeight || this.height;
  32922. this.image.forceRGBA = !!forceRGBA;
  32923. this.image.forceRGB = !!forceRGB;
  32924. const imageBytes = await this.image.getImageData(length, this.jpxDecoderOptions);
  32925. if (internal || this.image instanceof DecodeStream) {
  32926. return imageBytes;
  32927. }
  32928. assert(imageBytes instanceof Uint8Array, 'PDFImage.getImageBytes: Unsupported "imageBytes" type.');
  32929. return new Uint8Array(imageBytes);
  32930. }
  32931. }
  32932. ;// ./src/core/evaluator.js
  32933. const DefaultPartialEvaluatorOptions = Object.freeze({
  32934. maxImageSize: -1,
  32935. disableFontFace: false,
  32936. ignoreErrors: false,
  32937. isEvalSupported: true,
  32938. isOffscreenCanvasSupported: false,
  32939. canvasMaxAreaInBytes: -1,
  32940. fontExtraProperties: false,
  32941. useSystemFonts: true,
  32942. cMapUrl: null,
  32943. standardFontDataUrl: null
  32944. });
  32945. const PatternType = {
  32946. TILING: 1,
  32947. SHADING: 2
  32948. };
  32949. const TEXT_CHUNK_BATCH_SIZE = 10;
  32950. const deferred = Promise.resolve();
  32951. function normalizeBlendMode(value, parsingArray = false) {
  32952. if (Array.isArray(value)) {
  32953. for (const val of value) {
  32954. const maybeBM = normalizeBlendMode(val, true);
  32955. if (maybeBM) {
  32956. return maybeBM;
  32957. }
  32958. }
  32959. warn(`Unsupported blend mode Array: ${value}`);
  32960. return "source-over";
  32961. }
  32962. if (!(value instanceof Name)) {
  32963. if (parsingArray) {
  32964. return null;
  32965. }
  32966. return "source-over";
  32967. }
  32968. switch (value.name) {
  32969. case "Normal":
  32970. case "Compatible":
  32971. return "source-over";
  32972. case "Multiply":
  32973. return "multiply";
  32974. case "Screen":
  32975. return "screen";
  32976. case "Overlay":
  32977. return "overlay";
  32978. case "Darken":
  32979. return "darken";
  32980. case "Lighten":
  32981. return "lighten";
  32982. case "ColorDodge":
  32983. return "color-dodge";
  32984. case "ColorBurn":
  32985. return "color-burn";
  32986. case "HardLight":
  32987. return "hard-light";
  32988. case "SoftLight":
  32989. return "soft-light";
  32990. case "Difference":
  32991. return "difference";
  32992. case "Exclusion":
  32993. return "exclusion";
  32994. case "Hue":
  32995. return "hue";
  32996. case "Saturation":
  32997. return "saturation";
  32998. case "Color":
  32999. return "color";
  33000. case "Luminosity":
  33001. return "luminosity";
  33002. }
  33003. if (parsingArray) {
  33004. return null;
  33005. }
  33006. warn(`Unsupported blend mode: ${value.name}`);
  33007. return "source-over";
  33008. }
  33009. function addLocallyCachedImageOps(opList, data) {
  33010. if (data.objId) {
  33011. opList.addDependency(data.objId);
  33012. }
  33013. opList.addImageOps(data.fn, data.args, data.optionalContent);
  33014. if (data.fn === OPS.paintImageMaskXObject && data.args[0]?.count > 0) {
  33015. data.args[0].count++;
  33016. }
  33017. }
  33018. class TimeSlotManager {
  33019. static TIME_SLOT_DURATION_MS = 20;
  33020. static CHECK_TIME_EVERY = 100;
  33021. constructor() {
  33022. this.reset();
  33023. }
  33024. check() {
  33025. if (++this.checked < TimeSlotManager.CHECK_TIME_EVERY) {
  33026. return false;
  33027. }
  33028. this.checked = 0;
  33029. return this.endTime <= Date.now();
  33030. }
  33031. reset() {
  33032. this.endTime = Date.now() + TimeSlotManager.TIME_SLOT_DURATION_MS;
  33033. this.checked = 0;
  33034. }
  33035. }
  33036. class PartialEvaluator {
  33037. constructor({
  33038. xref,
  33039. handler,
  33040. pageIndex,
  33041. idFactory,
  33042. fontCache,
  33043. builtInCMapCache,
  33044. standardFontDataCache,
  33045. globalImageCache,
  33046. systemFontCache,
  33047. options = null
  33048. }) {
  33049. this.xref = xref;
  33050. this.handler = handler;
  33051. this.pageIndex = pageIndex;
  33052. this.idFactory = idFactory;
  33053. this.fontCache = fontCache;
  33054. this.builtInCMapCache = builtInCMapCache;
  33055. this.standardFontDataCache = standardFontDataCache;
  33056. this.globalImageCache = globalImageCache;
  33057. this.systemFontCache = systemFontCache;
  33058. this.options = options || DefaultPartialEvaluatorOptions;
  33059. this.type3FontRefs = null;
  33060. this._regionalImageCache = new RegionalImageCache();
  33061. this._fetchBuiltInCMapBound = this.fetchBuiltInCMap.bind(this);
  33062. ImageResizer.setMaxArea(this.options.canvasMaxAreaInBytes);
  33063. }
  33064. get _pdfFunctionFactory() {
  33065. const pdfFunctionFactory = new PDFFunctionFactory({
  33066. xref: this.xref,
  33067. isEvalSupported: this.options.isEvalSupported
  33068. });
  33069. return shadow(this, "_pdfFunctionFactory", pdfFunctionFactory);
  33070. }
  33071. get parsingType3Font() {
  33072. return !!this.type3FontRefs;
  33073. }
  33074. clone(newOptions = null) {
  33075. const newEvaluator = Object.create(this);
  33076. newEvaluator.options = Object.assign(Object.create(null), this.options, newOptions);
  33077. return newEvaluator;
  33078. }
  33079. hasBlendModes(resources, nonBlendModesSet) {
  33080. if (!(resources instanceof Dict)) {
  33081. return false;
  33082. }
  33083. if (resources.objId && nonBlendModesSet.has(resources.objId)) {
  33084. return false;
  33085. }
  33086. const processed = new RefSet(nonBlendModesSet);
  33087. if (resources.objId) {
  33088. processed.put(resources.objId);
  33089. }
  33090. const nodes = [resources],
  33091. xref = this.xref;
  33092. while (nodes.length) {
  33093. const node = nodes.shift();
  33094. const graphicStates = node.get("ExtGState");
  33095. if (graphicStates instanceof Dict) {
  33096. for (let graphicState of graphicStates.getRawValues()) {
  33097. if (graphicState instanceof Ref) {
  33098. if (processed.has(graphicState)) {
  33099. continue;
  33100. }
  33101. try {
  33102. graphicState = xref.fetch(graphicState);
  33103. } catch (ex) {
  33104. processed.put(graphicState);
  33105. info(`hasBlendModes - ignoring ExtGState: "${ex}".`);
  33106. continue;
  33107. }
  33108. }
  33109. if (!(graphicState instanceof Dict)) {
  33110. continue;
  33111. }
  33112. if (graphicState.objId) {
  33113. processed.put(graphicState.objId);
  33114. }
  33115. const bm = graphicState.get("BM");
  33116. if (bm instanceof Name) {
  33117. if (bm.name !== "Normal") {
  33118. return true;
  33119. }
  33120. continue;
  33121. }
  33122. if (bm !== undefined && Array.isArray(bm)) {
  33123. for (const element of bm) {
  33124. if (element instanceof Name && element.name !== "Normal") {
  33125. return true;
  33126. }
  33127. }
  33128. }
  33129. }
  33130. }
  33131. const xObjects = node.get("XObject");
  33132. if (!(xObjects instanceof Dict)) {
  33133. continue;
  33134. }
  33135. for (let xObject of xObjects.getRawValues()) {
  33136. if (xObject instanceof Ref) {
  33137. if (processed.has(xObject)) {
  33138. continue;
  33139. }
  33140. try {
  33141. xObject = xref.fetch(xObject);
  33142. } catch (ex) {
  33143. processed.put(xObject);
  33144. info(`hasBlendModes - ignoring XObject: "${ex}".`);
  33145. continue;
  33146. }
  33147. }
  33148. if (!(xObject instanceof BaseStream)) {
  33149. continue;
  33150. }
  33151. if (xObject.dict.objId) {
  33152. processed.put(xObject.dict.objId);
  33153. }
  33154. const xResources = xObject.dict.get("Resources");
  33155. if (!(xResources instanceof Dict)) {
  33156. continue;
  33157. }
  33158. if (xResources.objId && processed.has(xResources.objId)) {
  33159. continue;
  33160. }
  33161. nodes.push(xResources);
  33162. if (xResources.objId) {
  33163. processed.put(xResources.objId);
  33164. }
  33165. }
  33166. }
  33167. for (const ref of processed) {
  33168. nonBlendModesSet.put(ref);
  33169. }
  33170. return false;
  33171. }
  33172. async fetchBuiltInCMap(name) {
  33173. const cachedData = this.builtInCMapCache.get(name);
  33174. if (cachedData) {
  33175. return cachedData;
  33176. }
  33177. let data;
  33178. if (this.options.cMapUrl !== null) {
  33179. const url = `${this.options.cMapUrl}${name}.bcmap`;
  33180. const response = await fetch(url);
  33181. if (!response.ok) {
  33182. throw new Error(`fetchBuiltInCMap: failed to fetch file "${url}" with "${response.statusText}".`);
  33183. }
  33184. data = {
  33185. cMapData: new Uint8Array(await response.arrayBuffer()),
  33186. compressionType: CMapCompressionType.BINARY
  33187. };
  33188. } else {
  33189. data = await this.handler.sendWithPromise("FetchBuiltInCMap", {
  33190. name
  33191. });
  33192. }
  33193. if (data.compressionType !== CMapCompressionType.NONE) {
  33194. this.builtInCMapCache.set(name, data);
  33195. }
  33196. return data;
  33197. }
  33198. async fetchStandardFontData(name) {
  33199. const cachedData = this.standardFontDataCache.get(name);
  33200. if (cachedData) {
  33201. return new Stream(cachedData);
  33202. }
  33203. if (this.options.useSystemFonts && name !== "Symbol" && name !== "ZapfDingbats") {
  33204. return null;
  33205. }
  33206. const standardFontNameToFileName = getFontNameToFileMap(),
  33207. filename = standardFontNameToFileName[name];
  33208. let data;
  33209. if (this.options.standardFontDataUrl !== null) {
  33210. const url = `${this.options.standardFontDataUrl}${filename}`;
  33211. const response = await fetch(url);
  33212. if (!response.ok) {
  33213. warn(`fetchStandardFontData: failed to fetch file "${url}" with "${response.statusText}".`);
  33214. } else {
  33215. data = new Uint8Array(await response.arrayBuffer());
  33216. }
  33217. } else {
  33218. try {
  33219. data = await this.handler.sendWithPromise("FetchStandardFontData", {
  33220. filename
  33221. });
  33222. } catch (e) {
  33223. warn(`fetchStandardFontData: failed to fetch file "${filename}" with "${e}".`);
  33224. }
  33225. }
  33226. if (!data) {
  33227. return null;
  33228. }
  33229. this.standardFontDataCache.set(name, data);
  33230. return new Stream(data);
  33231. }
  33232. async buildFormXObject(resources, xobj, smask, operatorList, task, initialState, localColorSpaceCache) {
  33233. const dict = xobj.dict;
  33234. const matrix = lookupMatrix(dict.getArray("Matrix"), null);
  33235. const bbox = lookupNormalRect(dict.getArray("BBox"), null);
  33236. let optionalContent, groupOptions;
  33237. if (dict.has("OC")) {
  33238. optionalContent = await this.parseMarkedContentProps(dict.get("OC"), resources);
  33239. }
  33240. if (optionalContent !== undefined) {
  33241. operatorList.addOp(OPS.beginMarkedContentProps, ["OC", optionalContent]);
  33242. }
  33243. const group = dict.get("Group");
  33244. if (group) {
  33245. groupOptions = {
  33246. matrix,
  33247. bbox,
  33248. smask,
  33249. isolated: false,
  33250. knockout: false
  33251. };
  33252. const groupSubtype = group.get("S");
  33253. let colorSpace = null;
  33254. if (isName(groupSubtype, "Transparency")) {
  33255. groupOptions.isolated = group.get("I") || false;
  33256. groupOptions.knockout = group.get("K") || false;
  33257. if (group.has("CS")) {
  33258. const cs = group.getRaw("CS");
  33259. const cachedColorSpace = ColorSpace.getCached(cs, this.xref, localColorSpaceCache);
  33260. if (cachedColorSpace) {
  33261. colorSpace = cachedColorSpace;
  33262. } else {
  33263. colorSpace = await this.parseColorSpace({
  33264. cs,
  33265. resources,
  33266. localColorSpaceCache
  33267. });
  33268. }
  33269. }
  33270. }
  33271. if (smask?.backdrop) {
  33272. colorSpace ||= ColorSpace.singletons.rgb;
  33273. smask.backdrop = colorSpace.getRgb(smask.backdrop, 0);
  33274. }
  33275. operatorList.addOp(OPS.beginGroup, [groupOptions]);
  33276. }
  33277. const args = group ? [matrix, null] : [matrix, bbox];
  33278. operatorList.addOp(OPS.paintFormXObjectBegin, args);
  33279. await this.getOperatorList({
  33280. stream: xobj,
  33281. task,
  33282. resources: dict.get("Resources") || resources,
  33283. operatorList,
  33284. initialState
  33285. });
  33286. operatorList.addOp(OPS.paintFormXObjectEnd, []);
  33287. if (group) {
  33288. operatorList.addOp(OPS.endGroup, [groupOptions]);
  33289. }
  33290. if (optionalContent !== undefined) {
  33291. operatorList.addOp(OPS.endMarkedContent, []);
  33292. }
  33293. }
  33294. _sendImgData(objId, imgData, cacheGlobally = false) {
  33295. const transfers = imgData ? [imgData.bitmap || imgData.data.buffer] : null;
  33296. if (this.parsingType3Font || cacheGlobally) {
  33297. return this.handler.send("commonobj", [objId, "Image", imgData], transfers);
  33298. }
  33299. return this.handler.send("obj", [objId, this.pageIndex, "Image", imgData], transfers);
  33300. }
  33301. async buildPaintImageXObject({
  33302. resources,
  33303. image,
  33304. isInline = false,
  33305. operatorList,
  33306. cacheKey,
  33307. localImageCache,
  33308. localColorSpaceCache
  33309. }) {
  33310. const dict = image.dict;
  33311. const imageRef = dict.objId;
  33312. const w = dict.get("W", "Width");
  33313. const h = dict.get("H", "Height");
  33314. if (!(w && typeof w === "number") || !(h && typeof h === "number")) {
  33315. warn("Image dimensions are missing, or not numbers.");
  33316. return;
  33317. }
  33318. const maxImageSize = this.options.maxImageSize;
  33319. if (maxImageSize !== -1 && w * h > maxImageSize) {
  33320. const msg = "Image exceeded maximum allowed size and was removed.";
  33321. if (this.options.ignoreErrors) {
  33322. warn(msg);
  33323. return;
  33324. }
  33325. throw new Error(msg);
  33326. }
  33327. let optionalContent;
  33328. if (dict.has("OC")) {
  33329. optionalContent = await this.parseMarkedContentProps(dict.get("OC"), resources);
  33330. }
  33331. const imageMask = dict.get("IM", "ImageMask") || false;
  33332. let imgData, args;
  33333. if (imageMask) {
  33334. const interpolate = dict.get("I", "Interpolate");
  33335. const bitStrideLength = w + 7 >> 3;
  33336. const imgArray = image.getBytes(bitStrideLength * h);
  33337. const decode = dict.getArray("D", "Decode");
  33338. if (this.parsingType3Font) {
  33339. imgData = PDFImage.createRawMask({
  33340. imgArray,
  33341. width: w,
  33342. height: h,
  33343. imageIsFromDecodeStream: image instanceof DecodeStream,
  33344. inverseDecode: decode?.[0] > 0,
  33345. interpolate
  33346. });
  33347. imgData.cached = !!cacheKey;
  33348. args = [imgData];
  33349. operatorList.addImageOps(OPS.paintImageMaskXObject, args, optionalContent);
  33350. if (cacheKey) {
  33351. const cacheData = {
  33352. fn: OPS.paintImageMaskXObject,
  33353. args,
  33354. optionalContent
  33355. };
  33356. localImageCache.set(cacheKey, imageRef, cacheData);
  33357. if (imageRef) {
  33358. this._regionalImageCache.set(null, imageRef, cacheData);
  33359. }
  33360. }
  33361. return;
  33362. }
  33363. imgData = await PDFImage.createMask({
  33364. imgArray,
  33365. width: w,
  33366. height: h,
  33367. imageIsFromDecodeStream: image instanceof DecodeStream,
  33368. inverseDecode: decode?.[0] > 0,
  33369. interpolate,
  33370. isOffscreenCanvasSupported: this.options.isOffscreenCanvasSupported
  33371. });
  33372. if (imgData.isSingleOpaquePixel) {
  33373. operatorList.addImageOps(OPS.paintSolidColorImageMask, [], optionalContent);
  33374. if (cacheKey) {
  33375. const cacheData = {
  33376. fn: OPS.paintSolidColorImageMask,
  33377. args: [],
  33378. optionalContent
  33379. };
  33380. localImageCache.set(cacheKey, imageRef, cacheData);
  33381. if (imageRef) {
  33382. this._regionalImageCache.set(null, imageRef, cacheData);
  33383. }
  33384. }
  33385. return;
  33386. }
  33387. const objId = `mask_${this.idFactory.createObjId()}`;
  33388. operatorList.addDependency(objId);
  33389. imgData.dataLen = imgData.bitmap ? imgData.width * imgData.height * 4 : imgData.data.length;
  33390. this._sendImgData(objId, imgData);
  33391. args = [{
  33392. data: objId,
  33393. width: imgData.width,
  33394. height: imgData.height,
  33395. interpolate: imgData.interpolate,
  33396. count: 1
  33397. }];
  33398. operatorList.addImageOps(OPS.paintImageMaskXObject, args, optionalContent);
  33399. if (cacheKey) {
  33400. const cacheData = {
  33401. objId,
  33402. fn: OPS.paintImageMaskXObject,
  33403. args,
  33404. optionalContent
  33405. };
  33406. localImageCache.set(cacheKey, imageRef, cacheData);
  33407. if (imageRef) {
  33408. this._regionalImageCache.set(null, imageRef, cacheData);
  33409. }
  33410. }
  33411. return;
  33412. }
  33413. const SMALL_IMAGE_DIMENSIONS = 200;
  33414. if (isInline && w + h < SMALL_IMAGE_DIMENSIONS && !dict.has("SMask") && !dict.has("Mask")) {
  33415. try {
  33416. const imageObj = new PDFImage({
  33417. xref: this.xref,
  33418. res: resources,
  33419. image,
  33420. isInline,
  33421. pdfFunctionFactory: this._pdfFunctionFactory,
  33422. localColorSpaceCache
  33423. });
  33424. imgData = await imageObj.createImageData(true, false);
  33425. operatorList.isOffscreenCanvasSupported = this.options.isOffscreenCanvasSupported;
  33426. operatorList.addImageOps(OPS.paintInlineImageXObject, [imgData], optionalContent);
  33427. } catch (reason) {
  33428. const msg = `Unable to decode inline image: "${reason}".`;
  33429. if (!this.options.ignoreErrors) {
  33430. throw new Error(msg);
  33431. }
  33432. warn(msg);
  33433. }
  33434. return;
  33435. }
  33436. let objId = `img_${this.idFactory.createObjId()}`,
  33437. cacheGlobally = false;
  33438. if (this.parsingType3Font) {
  33439. objId = `${this.idFactory.getDocId()}_type3_${objId}`;
  33440. } else if (cacheKey && imageRef) {
  33441. cacheGlobally = this.globalImageCache.shouldCache(imageRef, this.pageIndex);
  33442. if (cacheGlobally) {
  33443. assert(!isInline, "Cannot cache an inline image globally.");
  33444. objId = `${this.idFactory.getDocId()}_${objId}`;
  33445. }
  33446. }
  33447. operatorList.addDependency(objId);
  33448. args = [objId, w, h];
  33449. operatorList.addImageOps(OPS.paintImageXObject, args, optionalContent);
  33450. if (cacheGlobally) {
  33451. if (this.globalImageCache.hasDecodeFailed(imageRef)) {
  33452. this.globalImageCache.setData(imageRef, {
  33453. objId,
  33454. fn: OPS.paintImageXObject,
  33455. args,
  33456. optionalContent,
  33457. byteSize: 0
  33458. });
  33459. this._sendImgData(objId, null, cacheGlobally);
  33460. return;
  33461. }
  33462. if (w * h > 250000 || dict.has("SMask") || dict.has("Mask")) {
  33463. const localLength = await this.handler.sendWithPromise("commonobj", [objId, "CopyLocalImage", {
  33464. imageRef
  33465. }]);
  33466. if (localLength) {
  33467. this.globalImageCache.setData(imageRef, {
  33468. objId,
  33469. fn: OPS.paintImageXObject,
  33470. args,
  33471. optionalContent,
  33472. byteSize: 0
  33473. });
  33474. this.globalImageCache.addByteSize(imageRef, localLength);
  33475. return;
  33476. }
  33477. }
  33478. }
  33479. PDFImage.buildImage({
  33480. xref: this.xref,
  33481. res: resources,
  33482. image,
  33483. isInline,
  33484. pdfFunctionFactory: this._pdfFunctionFactory,
  33485. localColorSpaceCache
  33486. }).then(async imageObj => {
  33487. imgData = await imageObj.createImageData(false, this.options.isOffscreenCanvasSupported);
  33488. imgData.dataLen = imgData.bitmap ? imgData.width * imgData.height * 4 : imgData.data.length;
  33489. imgData.ref = imageRef;
  33490. if (cacheGlobally) {
  33491. this.globalImageCache.addByteSize(imageRef, imgData.dataLen);
  33492. }
  33493. return this._sendImgData(objId, imgData, cacheGlobally);
  33494. }).catch(reason => {
  33495. warn(`Unable to decode image "${objId}": "${reason}".`);
  33496. if (imageRef) {
  33497. this.globalImageCache.addDecodeFailed(imageRef);
  33498. }
  33499. return this._sendImgData(objId, null, cacheGlobally);
  33500. });
  33501. if (cacheKey) {
  33502. const cacheData = {
  33503. objId,
  33504. fn: OPS.paintImageXObject,
  33505. args,
  33506. optionalContent
  33507. };
  33508. localImageCache.set(cacheKey, imageRef, cacheData);
  33509. if (imageRef) {
  33510. this._regionalImageCache.set(null, imageRef, cacheData);
  33511. if (cacheGlobally) {
  33512. this.globalImageCache.setData(imageRef, {
  33513. objId,
  33514. fn: OPS.paintImageXObject,
  33515. args,
  33516. optionalContent,
  33517. byteSize: 0
  33518. });
  33519. }
  33520. }
  33521. }
  33522. }
  33523. handleSMask(smask, resources, operatorList, task, stateManager, localColorSpaceCache) {
  33524. const smaskContent = smask.get("G");
  33525. const smaskOptions = {
  33526. subtype: smask.get("S").name,
  33527. backdrop: smask.get("BC")
  33528. };
  33529. const transferObj = smask.get("TR");
  33530. if (isPDFFunction(transferObj)) {
  33531. const transferFn = this._pdfFunctionFactory.create(transferObj);
  33532. const transferMap = new Uint8Array(256);
  33533. const tmp = new Float32Array(1);
  33534. for (let i = 0; i < 256; i++) {
  33535. tmp[0] = i / 255;
  33536. transferFn(tmp, 0, tmp, 0);
  33537. transferMap[i] = tmp[0] * 255 | 0;
  33538. }
  33539. smaskOptions.transferMap = transferMap;
  33540. }
  33541. return this.buildFormXObject(resources, smaskContent, smaskOptions, operatorList, task, stateManager.state.clone(), localColorSpaceCache);
  33542. }
  33543. handleTransferFunction(tr) {
  33544. let transferArray;
  33545. if (Array.isArray(tr)) {
  33546. transferArray = tr;
  33547. } else if (isPDFFunction(tr)) {
  33548. transferArray = [tr];
  33549. } else {
  33550. return null;
  33551. }
  33552. const transferMaps = [];
  33553. let numFns = 0,
  33554. numEffectfulFns = 0;
  33555. for (const entry of transferArray) {
  33556. const transferObj = this.xref.fetchIfRef(entry);
  33557. numFns++;
  33558. if (isName(transferObj, "Identity")) {
  33559. transferMaps.push(null);
  33560. continue;
  33561. } else if (!isPDFFunction(transferObj)) {
  33562. return null;
  33563. }
  33564. const transferFn = this._pdfFunctionFactory.create(transferObj);
  33565. const transferMap = new Uint8Array(256),
  33566. tmp = new Float32Array(1);
  33567. for (let j = 0; j < 256; j++) {
  33568. tmp[0] = j / 255;
  33569. transferFn(tmp, 0, tmp, 0);
  33570. transferMap[j] = tmp[0] * 255 | 0;
  33571. }
  33572. transferMaps.push(transferMap);
  33573. numEffectfulFns++;
  33574. }
  33575. if (!(numFns === 1 || numFns === 4)) {
  33576. return null;
  33577. }
  33578. if (numEffectfulFns === 0) {
  33579. return null;
  33580. }
  33581. return transferMaps;
  33582. }
  33583. handleTilingType(fn, color, resources, pattern, patternDict, operatorList, task, localTilingPatternCache) {
  33584. const tilingOpList = new OperatorList();
  33585. const patternResources = Dict.merge({
  33586. xref: this.xref,
  33587. dictArray: [patternDict.get("Resources"), resources]
  33588. });
  33589. return this.getOperatorList({
  33590. stream: pattern,
  33591. task,
  33592. resources: patternResources,
  33593. operatorList: tilingOpList
  33594. }).then(function () {
  33595. const operatorListIR = tilingOpList.getIR();
  33596. const tilingPatternIR = getTilingPatternIR(operatorListIR, patternDict, color);
  33597. operatorList.addDependencies(tilingOpList.dependencies);
  33598. operatorList.addOp(fn, tilingPatternIR);
  33599. if (patternDict.objId) {
  33600. localTilingPatternCache.set(null, patternDict.objId, {
  33601. operatorListIR,
  33602. dict: patternDict
  33603. });
  33604. }
  33605. }).catch(reason => {
  33606. if (reason instanceof AbortException) {
  33607. return;
  33608. }
  33609. if (this.options.ignoreErrors) {
  33610. warn(`handleTilingType - ignoring pattern: "${reason}".`);
  33611. return;
  33612. }
  33613. throw reason;
  33614. });
  33615. }
  33616. async handleSetFont(resources, fontArgs, fontRef, operatorList, task, state, fallbackFontDict = null, cssFontInfo = null) {
  33617. const fontName = fontArgs?.[0] instanceof Name ? fontArgs[0].name : null;
  33618. let translated = await this.loadFont(fontName, fontRef, resources, fallbackFontDict, cssFontInfo);
  33619. if (translated.font.isType3Font) {
  33620. try {
  33621. await translated.loadType3Data(this, resources, task);
  33622. operatorList.addDependencies(translated.type3Dependencies);
  33623. } catch (reason) {
  33624. translated = new TranslatedFont({
  33625. loadedName: "g_font_error",
  33626. font: new ErrorFont(`Type3 font load error: ${reason}`),
  33627. dict: translated.font,
  33628. evaluatorOptions: this.options
  33629. });
  33630. }
  33631. }
  33632. state.font = translated.font;
  33633. translated.send(this.handler);
  33634. return translated.loadedName;
  33635. }
  33636. handleText(chars, state) {
  33637. const font = state.font;
  33638. const glyphs = font.charsToGlyphs(chars);
  33639. if (font.data) {
  33640. const isAddToPathSet = !!(state.textRenderingMode & TextRenderingMode.ADD_TO_PATH_FLAG);
  33641. if (isAddToPathSet || state.fillColorSpace.name === "Pattern" || font.disableFontFace || this.options.disableFontFace) {
  33642. PartialEvaluator.buildFontPaths(font, glyphs, this.handler, this.options);
  33643. }
  33644. }
  33645. return glyphs;
  33646. }
  33647. ensureStateFont(state) {
  33648. if (state.font) {
  33649. return;
  33650. }
  33651. const reason = new FormatError("Missing setFont (Tf) operator before text rendering operator.");
  33652. if (this.options.ignoreErrors) {
  33653. warn(`ensureStateFont: "${reason}".`);
  33654. return;
  33655. }
  33656. throw reason;
  33657. }
  33658. async setGState({
  33659. resources,
  33660. gState,
  33661. operatorList,
  33662. cacheKey,
  33663. task,
  33664. stateManager,
  33665. localGStateCache,
  33666. localColorSpaceCache
  33667. }) {
  33668. const gStateRef = gState.objId;
  33669. let isSimpleGState = true;
  33670. const gStateObj = [];
  33671. let promise = Promise.resolve();
  33672. for (const key of gState.getKeys()) {
  33673. const value = gState.get(key);
  33674. switch (key) {
  33675. case "Type":
  33676. break;
  33677. case "LW":
  33678. case "LC":
  33679. case "LJ":
  33680. case "ML":
  33681. case "D":
  33682. case "RI":
  33683. case "FL":
  33684. case "CA":
  33685. case "ca":
  33686. gStateObj.push([key, value]);
  33687. break;
  33688. case "Font":
  33689. isSimpleGState = false;
  33690. promise = promise.then(() => this.handleSetFont(resources, null, value[0], operatorList, task, stateManager.state).then(function (loadedName) {
  33691. operatorList.addDependency(loadedName);
  33692. gStateObj.push([key, [loadedName, value[1]]]);
  33693. }));
  33694. break;
  33695. case "BM":
  33696. gStateObj.push([key, normalizeBlendMode(value)]);
  33697. break;
  33698. case "SMask":
  33699. if (isName(value, "None")) {
  33700. gStateObj.push([key, false]);
  33701. break;
  33702. }
  33703. if (value instanceof Dict) {
  33704. isSimpleGState = false;
  33705. promise = promise.then(() => this.handleSMask(value, resources, operatorList, task, stateManager, localColorSpaceCache));
  33706. gStateObj.push([key, true]);
  33707. } else {
  33708. warn("Unsupported SMask type");
  33709. }
  33710. break;
  33711. case "TR":
  33712. const transferMaps = this.handleTransferFunction(value);
  33713. gStateObj.push([key, transferMaps]);
  33714. break;
  33715. case "OP":
  33716. case "op":
  33717. case "OPM":
  33718. case "BG":
  33719. case "BG2":
  33720. case "UCR":
  33721. case "UCR2":
  33722. case "TR2":
  33723. case "HT":
  33724. case "SM":
  33725. case "SA":
  33726. case "AIS":
  33727. case "TK":
  33728. info("graphic state operator " + key);
  33729. break;
  33730. default:
  33731. info("Unknown graphic state operator " + key);
  33732. break;
  33733. }
  33734. }
  33735. await promise;
  33736. if (gStateObj.length > 0) {
  33737. operatorList.addOp(OPS.setGState, [gStateObj]);
  33738. }
  33739. if (isSimpleGState) {
  33740. localGStateCache.set(cacheKey, gStateRef, gStateObj);
  33741. }
  33742. }
  33743. loadFont(fontName, font, resources, fallbackFontDict = null, cssFontInfo = null) {
  33744. const errorFont = async () => {
  33745. return new TranslatedFont({
  33746. loadedName: "g_font_error",
  33747. font: new ErrorFont(`Font "${fontName}" is not available.`),
  33748. dict: font,
  33749. evaluatorOptions: this.options
  33750. });
  33751. };
  33752. let fontRef;
  33753. if (font) {
  33754. if (font instanceof Ref) {
  33755. fontRef = font;
  33756. }
  33757. } else {
  33758. const fontRes = resources.get("Font");
  33759. if (fontRes) {
  33760. fontRef = fontRes.getRaw(fontName);
  33761. }
  33762. }
  33763. if (fontRef) {
  33764. if (this.type3FontRefs?.has(fontRef)) {
  33765. return errorFont();
  33766. }
  33767. if (this.fontCache.has(fontRef)) {
  33768. return this.fontCache.get(fontRef);
  33769. }
  33770. try {
  33771. font = this.xref.fetchIfRef(fontRef);
  33772. } catch (ex) {
  33773. warn(`loadFont - lookup failed: "${ex}".`);
  33774. }
  33775. }
  33776. if (!(font instanceof Dict)) {
  33777. if (!this.options.ignoreErrors && !this.parsingType3Font) {
  33778. warn(`Font "${fontName}" is not available.`);
  33779. return errorFont();
  33780. }
  33781. warn(`Font "${fontName}" is not available -- attempting to fallback to a default font.`);
  33782. font = fallbackFontDict || PartialEvaluator.fallbackFontDict;
  33783. }
  33784. if (font.cacheKey && this.fontCache.has(font.cacheKey)) {
  33785. return this.fontCache.get(font.cacheKey);
  33786. }
  33787. const {
  33788. promise,
  33789. resolve
  33790. } = Promise.withResolvers();
  33791. let preEvaluatedFont;
  33792. try {
  33793. preEvaluatedFont = this.preEvaluateFont(font);
  33794. preEvaluatedFont.cssFontInfo = cssFontInfo;
  33795. } catch (reason) {
  33796. warn(`loadFont - preEvaluateFont failed: "${reason}".`);
  33797. return errorFont();
  33798. }
  33799. const {
  33800. descriptor,
  33801. hash
  33802. } = preEvaluatedFont;
  33803. const fontRefIsRef = fontRef instanceof Ref;
  33804. let fontID;
  33805. if (hash && descriptor instanceof Dict) {
  33806. const fontAliases = descriptor.fontAliases ||= Object.create(null);
  33807. if (fontAliases[hash]) {
  33808. const aliasFontRef = fontAliases[hash].aliasRef;
  33809. if (fontRefIsRef && aliasFontRef && this.fontCache.has(aliasFontRef)) {
  33810. this.fontCache.putAlias(fontRef, aliasFontRef);
  33811. return this.fontCache.get(fontRef);
  33812. }
  33813. } else {
  33814. fontAliases[hash] = {
  33815. fontID: this.idFactory.createFontId()
  33816. };
  33817. }
  33818. if (fontRefIsRef) {
  33819. fontAliases[hash].aliasRef = fontRef;
  33820. }
  33821. fontID = fontAliases[hash].fontID;
  33822. } else {
  33823. fontID = this.idFactory.createFontId();
  33824. }
  33825. assert(fontID?.startsWith("f"), 'The "fontID" must be (correctly) defined.');
  33826. if (fontRefIsRef) {
  33827. this.fontCache.put(fontRef, promise);
  33828. } else {
  33829. font.cacheKey = `cacheKey_${fontID}`;
  33830. this.fontCache.put(font.cacheKey, promise);
  33831. }
  33832. font.loadedName = `${this.idFactory.getDocId()}_${fontID}`;
  33833. this.translateFont(preEvaluatedFont).then(translatedFont => {
  33834. resolve(new TranslatedFont({
  33835. loadedName: font.loadedName,
  33836. font: translatedFont,
  33837. dict: font,
  33838. evaluatorOptions: this.options
  33839. }));
  33840. }).catch(reason => {
  33841. warn(`loadFont - translateFont failed: "${reason}".`);
  33842. resolve(new TranslatedFont({
  33843. loadedName: font.loadedName,
  33844. font: new ErrorFont(reason instanceof Error ? reason.message : reason),
  33845. dict: font,
  33846. evaluatorOptions: this.options
  33847. }));
  33848. });
  33849. return promise;
  33850. }
  33851. buildPath(operatorList, fn, args, parsingText = false) {
  33852. const lastIndex = operatorList.length - 1;
  33853. if (!args) {
  33854. args = [];
  33855. }
  33856. if (lastIndex < 0 || operatorList.fnArray[lastIndex] !== OPS.constructPath) {
  33857. if (parsingText) {
  33858. warn(`Encountered path operator "${fn}" inside of a text object.`);
  33859. operatorList.addOp(OPS.save, null);
  33860. }
  33861. let minMax;
  33862. switch (fn) {
  33863. case OPS.rectangle:
  33864. const x = args[0] + args[2];
  33865. const y = args[1] + args[3];
  33866. minMax = [Math.min(args[0], x), Math.min(args[1], y), Math.max(args[0], x), Math.max(args[1], y)];
  33867. break;
  33868. case OPS.moveTo:
  33869. case OPS.lineTo:
  33870. minMax = [args[0], args[1], args[0], args[1]];
  33871. break;
  33872. default:
  33873. minMax = [Infinity, Infinity, -Infinity, -Infinity];
  33874. break;
  33875. }
  33876. operatorList.addOp(OPS.constructPath, [[fn], args, minMax]);
  33877. if (parsingText) {
  33878. operatorList.addOp(OPS.restore, null);
  33879. }
  33880. } else {
  33881. const opArgs = operatorList.argsArray[lastIndex];
  33882. opArgs[0].push(fn);
  33883. opArgs[1].push(...args);
  33884. const minMax = opArgs[2];
  33885. switch (fn) {
  33886. case OPS.rectangle:
  33887. const x = args[0] + args[2];
  33888. const y = args[1] + args[3];
  33889. minMax[0] = Math.min(minMax[0], args[0], x);
  33890. minMax[1] = Math.min(minMax[1], args[1], y);
  33891. minMax[2] = Math.max(minMax[2], args[0], x);
  33892. minMax[3] = Math.max(minMax[3], args[1], y);
  33893. break;
  33894. case OPS.moveTo:
  33895. case OPS.lineTo:
  33896. minMax[0] = Math.min(minMax[0], args[0]);
  33897. minMax[1] = Math.min(minMax[1], args[1]);
  33898. minMax[2] = Math.max(minMax[2], args[0]);
  33899. minMax[3] = Math.max(minMax[3], args[1]);
  33900. break;
  33901. }
  33902. }
  33903. }
  33904. parseColorSpace({
  33905. cs,
  33906. resources,
  33907. localColorSpaceCache
  33908. }) {
  33909. return ColorSpace.parseAsync({
  33910. cs,
  33911. xref: this.xref,
  33912. resources,
  33913. pdfFunctionFactory: this._pdfFunctionFactory,
  33914. localColorSpaceCache
  33915. }).catch(reason => {
  33916. if (reason instanceof AbortException) {
  33917. return null;
  33918. }
  33919. if (this.options.ignoreErrors) {
  33920. warn(`parseColorSpace - ignoring ColorSpace: "${reason}".`);
  33921. return null;
  33922. }
  33923. throw reason;
  33924. });
  33925. }
  33926. parseShading({
  33927. shading,
  33928. resources,
  33929. localColorSpaceCache,
  33930. localShadingPatternCache
  33931. }) {
  33932. let id = localShadingPatternCache.get(shading);
  33933. if (id) {
  33934. return id;
  33935. }
  33936. let patternIR;
  33937. try {
  33938. const shadingFill = Pattern.parseShading(shading, this.xref, resources, this._pdfFunctionFactory, localColorSpaceCache);
  33939. patternIR = shadingFill.getIR();
  33940. } catch (reason) {
  33941. if (reason instanceof AbortException) {
  33942. return null;
  33943. }
  33944. if (this.options.ignoreErrors) {
  33945. warn(`parseShading - ignoring shading: "${reason}".`);
  33946. localShadingPatternCache.set(shading, null);
  33947. return null;
  33948. }
  33949. throw reason;
  33950. }
  33951. id = `pattern_${this.idFactory.createObjId()}`;
  33952. if (this.parsingType3Font) {
  33953. id = `${this.idFactory.getDocId()}_type3_${id}`;
  33954. }
  33955. localShadingPatternCache.set(shading, id);
  33956. if (this.parsingType3Font) {
  33957. this.handler.send("commonobj", [id, "Pattern", patternIR]);
  33958. } else {
  33959. this.handler.send("obj", [id, this.pageIndex, "Pattern", patternIR]);
  33960. }
  33961. return id;
  33962. }
  33963. handleColorN(operatorList, fn, args, cs, patterns, resources, task, localColorSpaceCache, localTilingPatternCache, localShadingPatternCache) {
  33964. const patternName = args.pop();
  33965. if (patternName instanceof Name) {
  33966. const rawPattern = patterns.getRaw(patternName.name);
  33967. const localTilingPattern = rawPattern instanceof Ref && localTilingPatternCache.getByRef(rawPattern);
  33968. if (localTilingPattern) {
  33969. try {
  33970. const color = cs.base ? cs.base.getRgb(args, 0) : null;
  33971. const tilingPatternIR = getTilingPatternIR(localTilingPattern.operatorListIR, localTilingPattern.dict, color);
  33972. operatorList.addOp(fn, tilingPatternIR);
  33973. return undefined;
  33974. } catch {}
  33975. }
  33976. const pattern = this.xref.fetchIfRef(rawPattern);
  33977. if (pattern) {
  33978. const dict = pattern instanceof BaseStream ? pattern.dict : pattern;
  33979. const typeNum = dict.get("PatternType");
  33980. if (typeNum === PatternType.TILING) {
  33981. const color = cs.base ? cs.base.getRgb(args, 0) : null;
  33982. return this.handleTilingType(fn, color, resources, pattern, dict, operatorList, task, localTilingPatternCache);
  33983. } else if (typeNum === PatternType.SHADING) {
  33984. const shading = dict.get("Shading");
  33985. const objId = this.parseShading({
  33986. shading,
  33987. resources,
  33988. localColorSpaceCache,
  33989. localShadingPatternCache
  33990. });
  33991. if (objId) {
  33992. const matrix = lookupMatrix(dict.getArray("Matrix"), null);
  33993. operatorList.addOp(fn, ["Shading", objId, matrix]);
  33994. }
  33995. return undefined;
  33996. }
  33997. throw new FormatError(`Unknown PatternType: ${typeNum}`);
  33998. }
  33999. }
  34000. throw new FormatError(`Unknown PatternName: ${patternName}`);
  34001. }
  34002. _parseVisibilityExpression(array, nestingCounter, currentResult) {
  34003. const MAX_NESTING = 10;
  34004. if (++nestingCounter > MAX_NESTING) {
  34005. warn("Visibility expression is too deeply nested");
  34006. return;
  34007. }
  34008. const length = array.length;
  34009. const operator = this.xref.fetchIfRef(array[0]);
  34010. if (length < 2 || !(operator instanceof Name)) {
  34011. warn("Invalid visibility expression");
  34012. return;
  34013. }
  34014. switch (operator.name) {
  34015. case "And":
  34016. case "Or":
  34017. case "Not":
  34018. currentResult.push(operator.name);
  34019. break;
  34020. default:
  34021. warn(`Invalid operator ${operator.name} in visibility expression`);
  34022. return;
  34023. }
  34024. for (let i = 1; i < length; i++) {
  34025. const raw = array[i];
  34026. const object = this.xref.fetchIfRef(raw);
  34027. if (Array.isArray(object)) {
  34028. const nestedResult = [];
  34029. currentResult.push(nestedResult);
  34030. this._parseVisibilityExpression(object, nestingCounter, nestedResult);
  34031. } else if (raw instanceof Ref) {
  34032. currentResult.push(raw.toString());
  34033. }
  34034. }
  34035. }
  34036. async parseMarkedContentProps(contentProperties, resources) {
  34037. let optionalContent;
  34038. if (contentProperties instanceof Name) {
  34039. const properties = resources.get("Properties");
  34040. optionalContent = properties.get(contentProperties.name);
  34041. } else if (contentProperties instanceof Dict) {
  34042. optionalContent = contentProperties;
  34043. } else {
  34044. throw new FormatError("Optional content properties malformed.");
  34045. }
  34046. const optionalContentType = optionalContent.get("Type")?.name;
  34047. if (optionalContentType === "OCG") {
  34048. return {
  34049. type: optionalContentType,
  34050. id: optionalContent.objId
  34051. };
  34052. } else if (optionalContentType === "OCMD") {
  34053. const expression = optionalContent.get("VE");
  34054. if (Array.isArray(expression)) {
  34055. const result = [];
  34056. this._parseVisibilityExpression(expression, 0, result);
  34057. if (result.length > 0) {
  34058. return {
  34059. type: "OCMD",
  34060. expression: result
  34061. };
  34062. }
  34063. }
  34064. const optionalContentGroups = optionalContent.get("OCGs");
  34065. if (Array.isArray(optionalContentGroups) || optionalContentGroups instanceof Dict) {
  34066. const groupIds = [];
  34067. if (Array.isArray(optionalContentGroups)) {
  34068. for (const ocg of optionalContentGroups) {
  34069. groupIds.push(ocg.toString());
  34070. }
  34071. } else {
  34072. groupIds.push(optionalContentGroups.objId);
  34073. }
  34074. return {
  34075. type: optionalContentType,
  34076. ids: groupIds,
  34077. policy: optionalContent.get("P") instanceof Name ? optionalContent.get("P").name : null,
  34078. expression: null
  34079. };
  34080. } else if (optionalContentGroups instanceof Ref) {
  34081. return {
  34082. type: optionalContentType,
  34083. id: optionalContentGroups.toString()
  34084. };
  34085. }
  34086. }
  34087. return null;
  34088. }
  34089. getOperatorList({
  34090. stream,
  34091. task,
  34092. resources,
  34093. operatorList,
  34094. initialState = null,
  34095. fallbackFontDict = null
  34096. }) {
  34097. resources ||= Dict.empty;
  34098. initialState ||= new EvalState();
  34099. if (!operatorList) {
  34100. throw new Error('getOperatorList: missing "operatorList" parameter');
  34101. }
  34102. const self = this;
  34103. const xref = this.xref;
  34104. let parsingText = false;
  34105. const localImageCache = new LocalImageCache();
  34106. const localColorSpaceCache = new LocalColorSpaceCache();
  34107. const localGStateCache = new LocalGStateCache();
  34108. const localTilingPatternCache = new LocalTilingPatternCache();
  34109. const localShadingPatternCache = new Map();
  34110. const xobjs = resources.get("XObject") || Dict.empty;
  34111. const patterns = resources.get("Pattern") || Dict.empty;
  34112. const stateManager = new StateManager(initialState);
  34113. const preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager);
  34114. const timeSlotManager = new TimeSlotManager();
  34115. function closePendingRestoreOPS(argument) {
  34116. for (let i = 0, ii = preprocessor.savedStatesDepth; i < ii; i++) {
  34117. operatorList.addOp(OPS.restore, []);
  34118. }
  34119. }
  34120. return new Promise(function promiseBody(resolve, reject) {
  34121. const next = function (promise) {
  34122. Promise.all([promise, operatorList.ready]).then(function () {
  34123. try {
  34124. promiseBody(resolve, reject);
  34125. } catch (ex) {
  34126. reject(ex);
  34127. }
  34128. }, reject);
  34129. };
  34130. task.ensureNotTerminated();
  34131. timeSlotManager.reset();
  34132. const operation = {};
  34133. let stop, i, ii, cs, name, isValidName;
  34134. while (!(stop = timeSlotManager.check())) {
  34135. operation.args = null;
  34136. if (!preprocessor.read(operation)) {
  34137. break;
  34138. }
  34139. let args = operation.args;
  34140. let fn = operation.fn;
  34141. switch (fn | 0) {
  34142. case OPS.paintXObject:
  34143. isValidName = args[0] instanceof Name;
  34144. name = args[0].name;
  34145. if (isValidName) {
  34146. const localImage = localImageCache.getByName(name);
  34147. if (localImage) {
  34148. addLocallyCachedImageOps(operatorList, localImage);
  34149. args = null;
  34150. continue;
  34151. }
  34152. }
  34153. next(new Promise(function (resolveXObject, rejectXObject) {
  34154. if (!isValidName) {
  34155. throw new FormatError("XObject must be referred to by name.");
  34156. }
  34157. let xobj = xobjs.getRaw(name);
  34158. if (xobj instanceof Ref) {
  34159. const localImage = localImageCache.getByRef(xobj) || self._regionalImageCache.getByRef(xobj);
  34160. if (localImage) {
  34161. addLocallyCachedImageOps(operatorList, localImage);
  34162. resolveXObject();
  34163. return;
  34164. }
  34165. const globalImage = self.globalImageCache.getData(xobj, self.pageIndex);
  34166. if (globalImage) {
  34167. operatorList.addDependency(globalImage.objId);
  34168. operatorList.addImageOps(globalImage.fn, globalImage.args, globalImage.optionalContent);
  34169. resolveXObject();
  34170. return;
  34171. }
  34172. xobj = xref.fetch(xobj);
  34173. }
  34174. if (!(xobj instanceof BaseStream)) {
  34175. throw new FormatError("XObject should be a stream");
  34176. }
  34177. const type = xobj.dict.get("Subtype");
  34178. if (!(type instanceof Name)) {
  34179. throw new FormatError("XObject should have a Name subtype");
  34180. }
  34181. if (type.name === "Form") {
  34182. stateManager.save();
  34183. self.buildFormXObject(resources, xobj, null, operatorList, task, stateManager.state.clone(), localColorSpaceCache).then(function () {
  34184. stateManager.restore();
  34185. resolveXObject();
  34186. }, rejectXObject);
  34187. return;
  34188. } else if (type.name === "Image") {
  34189. self.buildPaintImageXObject({
  34190. resources,
  34191. image: xobj,
  34192. operatorList,
  34193. cacheKey: name,
  34194. localImageCache,
  34195. localColorSpaceCache
  34196. }).then(resolveXObject, rejectXObject);
  34197. return;
  34198. } else if (type.name === "PS") {
  34199. info("Ignored XObject subtype PS");
  34200. } else {
  34201. throw new FormatError(`Unhandled XObject subtype ${type.name}`);
  34202. }
  34203. resolveXObject();
  34204. }).catch(function (reason) {
  34205. if (reason instanceof AbortException) {
  34206. return;
  34207. }
  34208. if (self.options.ignoreErrors) {
  34209. warn(`getOperatorList - ignoring XObject: "${reason}".`);
  34210. return;
  34211. }
  34212. throw reason;
  34213. }));
  34214. return;
  34215. case OPS.setFont:
  34216. var fontSize = args[1];
  34217. next(self.handleSetFont(resources, args, null, operatorList, task, stateManager.state, fallbackFontDict).then(function (loadedName) {
  34218. operatorList.addDependency(loadedName);
  34219. operatorList.addOp(OPS.setFont, [loadedName, fontSize]);
  34220. }));
  34221. return;
  34222. case OPS.beginText:
  34223. parsingText = true;
  34224. break;
  34225. case OPS.endText:
  34226. parsingText = false;
  34227. break;
  34228. case OPS.endInlineImage:
  34229. var cacheKey = args[0].cacheKey;
  34230. if (cacheKey) {
  34231. const localImage = localImageCache.getByName(cacheKey);
  34232. if (localImage) {
  34233. addLocallyCachedImageOps(operatorList, localImage);
  34234. args = null;
  34235. continue;
  34236. }
  34237. }
  34238. next(self.buildPaintImageXObject({
  34239. resources,
  34240. image: args[0],
  34241. isInline: true,
  34242. operatorList,
  34243. cacheKey,
  34244. localImageCache,
  34245. localColorSpaceCache
  34246. }));
  34247. return;
  34248. case OPS.showText:
  34249. if (!stateManager.state.font) {
  34250. self.ensureStateFont(stateManager.state);
  34251. continue;
  34252. }
  34253. args[0] = self.handleText(args[0], stateManager.state);
  34254. break;
  34255. case OPS.showSpacedText:
  34256. if (!stateManager.state.font) {
  34257. self.ensureStateFont(stateManager.state);
  34258. continue;
  34259. }
  34260. var combinedGlyphs = [];
  34261. var state = stateManager.state;
  34262. for (const arrItem of args[0]) {
  34263. if (typeof arrItem === "string") {
  34264. combinedGlyphs.push(...self.handleText(arrItem, state));
  34265. } else if (typeof arrItem === "number") {
  34266. combinedGlyphs.push(arrItem);
  34267. }
  34268. }
  34269. args[0] = combinedGlyphs;
  34270. fn = OPS.showText;
  34271. break;
  34272. case OPS.nextLineShowText:
  34273. if (!stateManager.state.font) {
  34274. self.ensureStateFont(stateManager.state);
  34275. continue;
  34276. }
  34277. operatorList.addOp(OPS.nextLine);
  34278. args[0] = self.handleText(args[0], stateManager.state);
  34279. fn = OPS.showText;
  34280. break;
  34281. case OPS.nextLineSetSpacingShowText:
  34282. if (!stateManager.state.font) {
  34283. self.ensureStateFont(stateManager.state);
  34284. continue;
  34285. }
  34286. operatorList.addOp(OPS.nextLine);
  34287. operatorList.addOp(OPS.setWordSpacing, [args.shift()]);
  34288. operatorList.addOp(OPS.setCharSpacing, [args.shift()]);
  34289. args[0] = self.handleText(args[0], stateManager.state);
  34290. fn = OPS.showText;
  34291. break;
  34292. case OPS.setTextRenderingMode:
  34293. stateManager.state.textRenderingMode = args[0];
  34294. break;
  34295. case OPS.setFillColorSpace:
  34296. {
  34297. const cachedColorSpace = ColorSpace.getCached(args[0], xref, localColorSpaceCache);
  34298. if (cachedColorSpace) {
  34299. stateManager.state.fillColorSpace = cachedColorSpace;
  34300. continue;
  34301. }
  34302. next(self.parseColorSpace({
  34303. cs: args[0],
  34304. resources,
  34305. localColorSpaceCache
  34306. }).then(function (colorSpace) {
  34307. stateManager.state.fillColorSpace = colorSpace || ColorSpace.singletons.gray;
  34308. }));
  34309. return;
  34310. }
  34311. case OPS.setStrokeColorSpace:
  34312. {
  34313. const cachedColorSpace = ColorSpace.getCached(args[0], xref, localColorSpaceCache);
  34314. if (cachedColorSpace) {
  34315. stateManager.state.strokeColorSpace = cachedColorSpace;
  34316. continue;
  34317. }
  34318. next(self.parseColorSpace({
  34319. cs: args[0],
  34320. resources,
  34321. localColorSpaceCache
  34322. }).then(function (colorSpace) {
  34323. stateManager.state.strokeColorSpace = colorSpace || ColorSpace.singletons.gray;
  34324. }));
  34325. return;
  34326. }
  34327. case OPS.setFillColor:
  34328. cs = stateManager.state.fillColorSpace;
  34329. args = cs.getRgb(args, 0);
  34330. fn = OPS.setFillRGBColor;
  34331. break;
  34332. case OPS.setStrokeColor:
  34333. cs = stateManager.state.strokeColorSpace;
  34334. args = cs.getRgb(args, 0);
  34335. fn = OPS.setStrokeRGBColor;
  34336. break;
  34337. case OPS.setFillGray:
  34338. stateManager.state.fillColorSpace = ColorSpace.singletons.gray;
  34339. args = ColorSpace.singletons.gray.getRgb(args, 0);
  34340. fn = OPS.setFillRGBColor;
  34341. break;
  34342. case OPS.setStrokeGray:
  34343. stateManager.state.strokeColorSpace = ColorSpace.singletons.gray;
  34344. args = ColorSpace.singletons.gray.getRgb(args, 0);
  34345. fn = OPS.setStrokeRGBColor;
  34346. break;
  34347. case OPS.setFillCMYKColor:
  34348. stateManager.state.fillColorSpace = ColorSpace.singletons.cmyk;
  34349. args = ColorSpace.singletons.cmyk.getRgb(args, 0);
  34350. fn = OPS.setFillRGBColor;
  34351. break;
  34352. case OPS.setStrokeCMYKColor:
  34353. stateManager.state.strokeColorSpace = ColorSpace.singletons.cmyk;
  34354. args = ColorSpace.singletons.cmyk.getRgb(args, 0);
  34355. fn = OPS.setStrokeRGBColor;
  34356. break;
  34357. case OPS.setFillRGBColor:
  34358. stateManager.state.fillColorSpace = ColorSpace.singletons.rgb;
  34359. args = ColorSpace.singletons.rgb.getRgb(args, 0);
  34360. break;
  34361. case OPS.setStrokeRGBColor:
  34362. stateManager.state.strokeColorSpace = ColorSpace.singletons.rgb;
  34363. args = ColorSpace.singletons.rgb.getRgb(args, 0);
  34364. break;
  34365. case OPS.setFillColorN:
  34366. cs = stateManager.state.patternFillColorSpace;
  34367. if (!cs) {
  34368. args = [];
  34369. fn = OPS.setFillTransparent;
  34370. break;
  34371. }
  34372. if (cs.name === "Pattern") {
  34373. next(self.handleColorN(operatorList, OPS.setFillColorN, args, cs, patterns, resources, task, localColorSpaceCache, localTilingPatternCache, localShadingPatternCache));
  34374. return;
  34375. }
  34376. args = cs.getRgb(args, 0);
  34377. fn = OPS.setFillRGBColor;
  34378. break;
  34379. case OPS.setStrokeColorN:
  34380. cs = stateManager.state.patternStrokeColorSpace;
  34381. if (!cs) {
  34382. args = [];
  34383. fn = OPS.setStrokeTransparent;
  34384. break;
  34385. }
  34386. if (cs.name === "Pattern") {
  34387. next(self.handleColorN(operatorList, OPS.setStrokeColorN, args, cs, patterns, resources, task, localColorSpaceCache, localTilingPatternCache, localShadingPatternCache));
  34388. return;
  34389. }
  34390. args = cs.getRgb(args, 0);
  34391. fn = OPS.setStrokeRGBColor;
  34392. break;
  34393. case OPS.shadingFill:
  34394. let shading;
  34395. try {
  34396. const shadingRes = resources.get("Shading");
  34397. if (!shadingRes) {
  34398. throw new FormatError("No shading resource found");
  34399. }
  34400. shading = shadingRes.get(args[0].name);
  34401. if (!shading) {
  34402. throw new FormatError("No shading object found");
  34403. }
  34404. } catch (reason) {
  34405. if (reason instanceof AbortException) {
  34406. continue;
  34407. }
  34408. if (self.options.ignoreErrors) {
  34409. warn(`getOperatorList - ignoring Shading: "${reason}".`);
  34410. continue;
  34411. }
  34412. throw reason;
  34413. }
  34414. const patternId = self.parseShading({
  34415. shading,
  34416. resources,
  34417. localColorSpaceCache,
  34418. localShadingPatternCache
  34419. });
  34420. if (!patternId) {
  34421. continue;
  34422. }
  34423. args = [patternId];
  34424. fn = OPS.shadingFill;
  34425. break;
  34426. case OPS.setGState:
  34427. isValidName = args[0] instanceof Name;
  34428. name = args[0].name;
  34429. if (isValidName) {
  34430. const localGStateObj = localGStateCache.getByName(name);
  34431. if (localGStateObj) {
  34432. if (localGStateObj.length > 0) {
  34433. operatorList.addOp(OPS.setGState, [localGStateObj]);
  34434. }
  34435. args = null;
  34436. continue;
  34437. }
  34438. }
  34439. next(new Promise(function (resolveGState, rejectGState) {
  34440. if (!isValidName) {
  34441. throw new FormatError("GState must be referred to by name.");
  34442. }
  34443. const extGState = resources.get("ExtGState");
  34444. if (!(extGState instanceof Dict)) {
  34445. throw new FormatError("ExtGState should be a dictionary.");
  34446. }
  34447. const gState = extGState.get(name);
  34448. if (!(gState instanceof Dict)) {
  34449. throw new FormatError("GState should be a dictionary.");
  34450. }
  34451. self.setGState({
  34452. resources,
  34453. gState,
  34454. operatorList,
  34455. cacheKey: name,
  34456. task,
  34457. stateManager,
  34458. localGStateCache,
  34459. localColorSpaceCache
  34460. }).then(resolveGState, rejectGState);
  34461. }).catch(function (reason) {
  34462. if (reason instanceof AbortException) {
  34463. return;
  34464. }
  34465. if (self.options.ignoreErrors) {
  34466. warn(`getOperatorList - ignoring ExtGState: "${reason}".`);
  34467. return;
  34468. }
  34469. throw reason;
  34470. }));
  34471. return;
  34472. case OPS.moveTo:
  34473. case OPS.lineTo:
  34474. case OPS.curveTo:
  34475. case OPS.curveTo2:
  34476. case OPS.curveTo3:
  34477. case OPS.closePath:
  34478. case OPS.rectangle:
  34479. self.buildPath(operatorList, fn, args, parsingText);
  34480. continue;
  34481. case OPS.markPoint:
  34482. case OPS.markPointProps:
  34483. case OPS.beginCompat:
  34484. case OPS.endCompat:
  34485. continue;
  34486. case OPS.beginMarkedContentProps:
  34487. if (!(args[0] instanceof Name)) {
  34488. warn(`Expected name for beginMarkedContentProps arg0=${args[0]}`);
  34489. operatorList.addOp(OPS.beginMarkedContentProps, ["OC", null]);
  34490. continue;
  34491. }
  34492. if (args[0].name === "OC") {
  34493. next(self.parseMarkedContentProps(args[1], resources).then(data => {
  34494. operatorList.addOp(OPS.beginMarkedContentProps, ["OC", data]);
  34495. }).catch(reason => {
  34496. if (reason instanceof AbortException) {
  34497. return;
  34498. }
  34499. if (self.options.ignoreErrors) {
  34500. warn(`getOperatorList - ignoring beginMarkedContentProps: "${reason}".`);
  34501. operatorList.addOp(OPS.beginMarkedContentProps, ["OC", null]);
  34502. return;
  34503. }
  34504. throw reason;
  34505. }));
  34506. return;
  34507. }
  34508. args = [args[0].name, args[1] instanceof Dict ? args[1].get("MCID") : null];
  34509. break;
  34510. case OPS.beginMarkedContent:
  34511. case OPS.endMarkedContent:
  34512. default:
  34513. if (args !== null) {
  34514. for (i = 0, ii = args.length; i < ii; i++) {
  34515. if (args[i] instanceof Dict) {
  34516. break;
  34517. }
  34518. }
  34519. if (i < ii) {
  34520. warn("getOperatorList - ignoring operator: " + fn);
  34521. continue;
  34522. }
  34523. }
  34524. }
  34525. operatorList.addOp(fn, args);
  34526. }
  34527. if (stop) {
  34528. next(deferred);
  34529. return;
  34530. }
  34531. closePendingRestoreOPS();
  34532. resolve();
  34533. }).catch(reason => {
  34534. if (reason instanceof AbortException) {
  34535. return;
  34536. }
  34537. if (this.options.ignoreErrors) {
  34538. warn(`getOperatorList - ignoring errors during "${task.name}" ` + `task: "${reason}".`);
  34539. closePendingRestoreOPS();
  34540. return;
  34541. }
  34542. throw reason;
  34543. });
  34544. }
  34545. getTextContent({
  34546. stream,
  34547. task,
  34548. resources,
  34549. stateManager = null,
  34550. includeMarkedContent = false,
  34551. sink,
  34552. seenStyles = new Set(),
  34553. viewBox,
  34554. lang = null,
  34555. markedContentData = null,
  34556. disableNormalization = false,
  34557. keepWhiteSpace = false
  34558. }) {
  34559. resources ||= Dict.empty;
  34560. stateManager ||= new StateManager(new TextState());
  34561. if (includeMarkedContent) {
  34562. markedContentData ||= {
  34563. level: 0
  34564. };
  34565. }
  34566. const textContent = {
  34567. items: [],
  34568. styles: Object.create(null),
  34569. lang
  34570. };
  34571. const textContentItem = {
  34572. initialized: false,
  34573. str: [],
  34574. totalWidth: 0,
  34575. totalHeight: 0,
  34576. width: 0,
  34577. height: 0,
  34578. vertical: false,
  34579. prevTransform: null,
  34580. textAdvanceScale: 0,
  34581. spaceInFlowMin: 0,
  34582. spaceInFlowMax: 0,
  34583. trackingSpaceMin: Infinity,
  34584. negativeSpaceMax: -Infinity,
  34585. notASpace: -Infinity,
  34586. transform: null,
  34587. fontName: null,
  34588. hasEOL: false
  34589. };
  34590. const twoLastChars = [" ", " "];
  34591. let twoLastCharsPos = 0;
  34592. function saveLastChar(char) {
  34593. const nextPos = (twoLastCharsPos + 1) % 2;
  34594. const ret = twoLastChars[twoLastCharsPos] !== " " && twoLastChars[nextPos] === " ";
  34595. twoLastChars[twoLastCharsPos] = char;
  34596. twoLastCharsPos = nextPos;
  34597. return !keepWhiteSpace && ret;
  34598. }
  34599. function shouldAddWhitepsace() {
  34600. return !keepWhiteSpace && twoLastChars[twoLastCharsPos] !== " " && twoLastChars[(twoLastCharsPos + 1) % 2] === " ";
  34601. }
  34602. function resetLastChars() {
  34603. twoLastChars[0] = twoLastChars[1] = " ";
  34604. twoLastCharsPos = 0;
  34605. }
  34606. const TRACKING_SPACE_FACTOR = 0.102;
  34607. const NOT_A_SPACE_FACTOR = 0.03;
  34608. const NEGATIVE_SPACE_FACTOR = -0.2;
  34609. const SPACE_IN_FLOW_MIN_FACTOR = 0.102;
  34610. const SPACE_IN_FLOW_MAX_FACTOR = 0.6;
  34611. const VERTICAL_SHIFT_RATIO = 0.25;
  34612. const self = this;
  34613. const xref = this.xref;
  34614. const showSpacedTextBuffer = [];
  34615. let xobjs = null;
  34616. const emptyXObjectCache = new LocalImageCache();
  34617. const emptyGStateCache = new LocalGStateCache();
  34618. const preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager);
  34619. let textState;
  34620. function pushWhitespace({
  34621. width = 0,
  34622. height = 0,
  34623. transform = textContentItem.prevTransform,
  34624. fontName = textContentItem.fontName
  34625. }) {
  34626. textContent.items.push({
  34627. str: " ",
  34628. dir: "ltr",
  34629. width,
  34630. height,
  34631. transform,
  34632. fontName,
  34633. hasEOL: false
  34634. });
  34635. }
  34636. function getCurrentTextTransform() {
  34637. const font = textState.font;
  34638. const tsm = [textState.fontSize * textState.textHScale, 0, 0, textState.fontSize, 0, textState.textRise];
  34639. if (font.isType3Font && (textState.fontSize <= 1 || font.isCharBBox) && !isArrayEqual(textState.fontMatrix, FONT_IDENTITY_MATRIX)) {
  34640. const glyphHeight = font.bbox[3] - font.bbox[1];
  34641. if (glyphHeight > 0) {
  34642. tsm[3] *= glyphHeight * textState.fontMatrix[3];
  34643. }
  34644. }
  34645. return Util.transform(textState.ctm, Util.transform(textState.textMatrix, tsm));
  34646. }
  34647. function ensureTextContentItem() {
  34648. if (textContentItem.initialized) {
  34649. return textContentItem;
  34650. }
  34651. const {
  34652. font,
  34653. loadedName
  34654. } = textState;
  34655. if (!seenStyles.has(loadedName)) {
  34656. seenStyles.add(loadedName);
  34657. textContent.styles[loadedName] = {
  34658. fontFamily: font.fallbackName,
  34659. ascent: font.ascent,
  34660. descent: font.descent,
  34661. vertical: font.vertical
  34662. };
  34663. if (self.options.fontExtraProperties && font.systemFontInfo) {
  34664. const style = textContent.styles[loadedName];
  34665. style.fontSubstitution = font.systemFontInfo.css;
  34666. style.fontSubstitutionLoadedName = font.systemFontInfo.loadedName;
  34667. }
  34668. }
  34669. textContentItem.fontName = loadedName;
  34670. const trm = textContentItem.transform = getCurrentTextTransform();
  34671. if (!font.vertical) {
  34672. textContentItem.width = textContentItem.totalWidth = 0;
  34673. textContentItem.height = textContentItem.totalHeight = Math.hypot(trm[2], trm[3]);
  34674. textContentItem.vertical = false;
  34675. } else {
  34676. textContentItem.width = textContentItem.totalWidth = Math.hypot(trm[0], trm[1]);
  34677. textContentItem.height = textContentItem.totalHeight = 0;
  34678. textContentItem.vertical = true;
  34679. }
  34680. const scaleLineX = Math.hypot(textState.textLineMatrix[0], textState.textLineMatrix[1]);
  34681. const scaleCtmX = Math.hypot(textState.ctm[0], textState.ctm[1]);
  34682. textContentItem.textAdvanceScale = scaleCtmX * scaleLineX;
  34683. const {
  34684. fontSize
  34685. } = textState;
  34686. textContentItem.trackingSpaceMin = fontSize * TRACKING_SPACE_FACTOR;
  34687. textContentItem.notASpace = fontSize * NOT_A_SPACE_FACTOR;
  34688. textContentItem.negativeSpaceMax = fontSize * NEGATIVE_SPACE_FACTOR;
  34689. textContentItem.spaceInFlowMin = fontSize * SPACE_IN_FLOW_MIN_FACTOR;
  34690. textContentItem.spaceInFlowMax = fontSize * SPACE_IN_FLOW_MAX_FACTOR;
  34691. textContentItem.hasEOL = false;
  34692. textContentItem.initialized = true;
  34693. return textContentItem;
  34694. }
  34695. function updateAdvanceScale() {
  34696. if (!textContentItem.initialized) {
  34697. return;
  34698. }
  34699. const scaleLineX = Math.hypot(textState.textLineMatrix[0], textState.textLineMatrix[1]);
  34700. const scaleCtmX = Math.hypot(textState.ctm[0], textState.ctm[1]);
  34701. const scaleFactor = scaleCtmX * scaleLineX;
  34702. if (scaleFactor === textContentItem.textAdvanceScale) {
  34703. return;
  34704. }
  34705. if (!textContentItem.vertical) {
  34706. textContentItem.totalWidth += textContentItem.width * textContentItem.textAdvanceScale;
  34707. textContentItem.width = 0;
  34708. } else {
  34709. textContentItem.totalHeight += textContentItem.height * textContentItem.textAdvanceScale;
  34710. textContentItem.height = 0;
  34711. }
  34712. textContentItem.textAdvanceScale = scaleFactor;
  34713. }
  34714. function runBidiTransform(textChunk) {
  34715. let text = textChunk.str.join("");
  34716. if (!disableNormalization) {
  34717. text = normalizeUnicode(text);
  34718. }
  34719. const bidiResult = bidi(text, -1, textChunk.vertical);
  34720. return {
  34721. str: bidiResult.str,
  34722. dir: bidiResult.dir,
  34723. width: Math.abs(textChunk.totalWidth),
  34724. height: Math.abs(textChunk.totalHeight),
  34725. transform: textChunk.transform,
  34726. fontName: textChunk.fontName,
  34727. hasEOL: textChunk.hasEOL
  34728. };
  34729. }
  34730. async function handleSetFont(fontName, fontRef) {
  34731. const translated = await self.loadFont(fontName, fontRef, resources);
  34732. if (translated.font.isType3Font) {
  34733. try {
  34734. await translated.loadType3Data(self, resources, task);
  34735. } catch {}
  34736. }
  34737. textState.loadedName = translated.loadedName;
  34738. textState.font = translated.font;
  34739. textState.fontMatrix = translated.font.fontMatrix || FONT_IDENTITY_MATRIX;
  34740. }
  34741. function applyInverseRotation(x, y, matrix) {
  34742. const scale = Math.hypot(matrix[0], matrix[1]);
  34743. return [(matrix[0] * x + matrix[1] * y) / scale, (matrix[2] * x + matrix[3] * y) / scale];
  34744. }
  34745. function compareWithLastPosition(glyphWidth) {
  34746. const currentTransform = getCurrentTextTransform();
  34747. let posX = currentTransform[4];
  34748. let posY = currentTransform[5];
  34749. if (textState.font?.vertical) {
  34750. if (posX < viewBox[0] || posX > viewBox[2] || posY + glyphWidth < viewBox[1] || posY > viewBox[3]) {
  34751. return false;
  34752. }
  34753. } else if (posX + glyphWidth < viewBox[0] || posX > viewBox[2] || posY < viewBox[1] || posY > viewBox[3]) {
  34754. return false;
  34755. }
  34756. if (!textState.font || !textContentItem.prevTransform) {
  34757. return true;
  34758. }
  34759. let lastPosX = textContentItem.prevTransform[4];
  34760. let lastPosY = textContentItem.prevTransform[5];
  34761. if (lastPosX === posX && lastPosY === posY) {
  34762. return true;
  34763. }
  34764. let rotate = -1;
  34765. if (currentTransform[0] && currentTransform[1] === 0 && currentTransform[2] === 0) {
  34766. rotate = currentTransform[0] > 0 ? 0 : 180;
  34767. } else if (currentTransform[1] && currentTransform[0] === 0 && currentTransform[3] === 0) {
  34768. rotate = currentTransform[1] > 0 ? 90 : 270;
  34769. }
  34770. switch (rotate) {
  34771. case 0:
  34772. break;
  34773. case 90:
  34774. [posX, posY] = [posY, posX];
  34775. [lastPosX, lastPosY] = [lastPosY, lastPosX];
  34776. break;
  34777. case 180:
  34778. [posX, posY, lastPosX, lastPosY] = [-posX, -posY, -lastPosX, -lastPosY];
  34779. break;
  34780. case 270:
  34781. [posX, posY] = [-posY, -posX];
  34782. [lastPosX, lastPosY] = [-lastPosY, -lastPosX];
  34783. break;
  34784. default:
  34785. [posX, posY] = applyInverseRotation(posX, posY, currentTransform);
  34786. [lastPosX, lastPosY] = applyInverseRotation(lastPosX, lastPosY, textContentItem.prevTransform);
  34787. }
  34788. if (textState.font.vertical) {
  34789. const advanceY = (lastPosY - posY) / textContentItem.textAdvanceScale;
  34790. const advanceX = posX - lastPosX;
  34791. const textOrientation = Math.sign(textContentItem.height);
  34792. if (advanceY < textOrientation * textContentItem.negativeSpaceMax) {
  34793. if (Math.abs(advanceX) > 0.5 * textContentItem.width) {
  34794. appendEOL();
  34795. return true;
  34796. }
  34797. resetLastChars();
  34798. flushTextContentItem();
  34799. return true;
  34800. }
  34801. if (Math.abs(advanceX) > textContentItem.width) {
  34802. appendEOL();
  34803. return true;
  34804. }
  34805. if (advanceY <= textOrientation * textContentItem.notASpace) {
  34806. resetLastChars();
  34807. }
  34808. if (advanceY <= textOrientation * textContentItem.trackingSpaceMin) {
  34809. if (shouldAddWhitepsace()) {
  34810. resetLastChars();
  34811. flushTextContentItem();
  34812. pushWhitespace({
  34813. height: Math.abs(advanceY)
  34814. });
  34815. } else {
  34816. textContentItem.height += advanceY;
  34817. }
  34818. } else if (!addFakeSpaces(advanceY, textContentItem.prevTransform, textOrientation)) {
  34819. if (textContentItem.str.length === 0) {
  34820. resetLastChars();
  34821. pushWhitespace({
  34822. height: Math.abs(advanceY)
  34823. });
  34824. } else {
  34825. textContentItem.height += advanceY;
  34826. }
  34827. }
  34828. if (Math.abs(advanceX) > textContentItem.width * VERTICAL_SHIFT_RATIO) {
  34829. flushTextContentItem();
  34830. }
  34831. return true;
  34832. }
  34833. const advanceX = (posX - lastPosX) / textContentItem.textAdvanceScale;
  34834. const advanceY = posY - lastPosY;
  34835. const textOrientation = Math.sign(textContentItem.width);
  34836. if (advanceX < textOrientation * textContentItem.negativeSpaceMax) {
  34837. if (Math.abs(advanceY) > 0.5 * textContentItem.height) {
  34838. appendEOL();
  34839. return true;
  34840. }
  34841. resetLastChars();
  34842. flushTextContentItem();
  34843. return true;
  34844. }
  34845. if (Math.abs(advanceY) > textContentItem.height) {
  34846. appendEOL();
  34847. return true;
  34848. }
  34849. if (advanceX <= textOrientation * textContentItem.notASpace) {
  34850. resetLastChars();
  34851. }
  34852. if (advanceX <= textOrientation * textContentItem.trackingSpaceMin) {
  34853. if (shouldAddWhitepsace()) {
  34854. resetLastChars();
  34855. flushTextContentItem();
  34856. pushWhitespace({
  34857. width: Math.abs(advanceX)
  34858. });
  34859. } else {
  34860. textContentItem.width += advanceX;
  34861. }
  34862. } else if (!addFakeSpaces(advanceX, textContentItem.prevTransform, textOrientation)) {
  34863. if (textContentItem.str.length === 0) {
  34864. resetLastChars();
  34865. pushWhitespace({
  34866. width: Math.abs(advanceX)
  34867. });
  34868. } else {
  34869. textContentItem.width += advanceX;
  34870. }
  34871. }
  34872. if (Math.abs(advanceY) > textContentItem.height * VERTICAL_SHIFT_RATIO) {
  34873. flushTextContentItem();
  34874. }
  34875. return true;
  34876. }
  34877. function buildTextContentItem({
  34878. chars,
  34879. extraSpacing
  34880. }) {
  34881. const font = textState.font;
  34882. if (!chars) {
  34883. const charSpacing = textState.charSpacing + extraSpacing;
  34884. if (charSpacing) {
  34885. if (!font.vertical) {
  34886. textState.translateTextMatrix(charSpacing * textState.textHScale, 0);
  34887. } else {
  34888. textState.translateTextMatrix(0, -charSpacing);
  34889. }
  34890. }
  34891. if (keepWhiteSpace) {
  34892. compareWithLastPosition(0);
  34893. }
  34894. return;
  34895. }
  34896. const glyphs = font.charsToGlyphs(chars);
  34897. const scale = textState.fontMatrix[0] * textState.fontSize;
  34898. for (let i = 0, ii = glyphs.length; i < ii; i++) {
  34899. const glyph = glyphs[i];
  34900. const {
  34901. category
  34902. } = glyph;
  34903. if (category.isInvisibleFormatMark) {
  34904. continue;
  34905. }
  34906. let charSpacing = textState.charSpacing + (i + 1 === ii ? extraSpacing : 0);
  34907. let glyphWidth = glyph.width;
  34908. if (font.vertical) {
  34909. glyphWidth = glyph.vmetric ? glyph.vmetric[0] : -glyphWidth;
  34910. }
  34911. let scaledDim = glyphWidth * scale;
  34912. if (!keepWhiteSpace && category.isWhitespace) {
  34913. if (!font.vertical) {
  34914. charSpacing += scaledDim + textState.wordSpacing;
  34915. textState.translateTextMatrix(charSpacing * textState.textHScale, 0);
  34916. } else {
  34917. charSpacing += -scaledDim + textState.wordSpacing;
  34918. textState.translateTextMatrix(0, -charSpacing);
  34919. }
  34920. saveLastChar(" ");
  34921. continue;
  34922. }
  34923. if (!category.isZeroWidthDiacritic && !compareWithLastPosition(scaledDim)) {
  34924. if (!font.vertical) {
  34925. textState.translateTextMatrix(scaledDim * textState.textHScale, 0);
  34926. } else {
  34927. textState.translateTextMatrix(0, scaledDim);
  34928. }
  34929. continue;
  34930. }
  34931. const textChunk = ensureTextContentItem();
  34932. if (category.isZeroWidthDiacritic) {
  34933. scaledDim = 0;
  34934. }
  34935. if (!font.vertical) {
  34936. scaledDim *= textState.textHScale;
  34937. textState.translateTextMatrix(scaledDim, 0);
  34938. textChunk.width += scaledDim;
  34939. } else {
  34940. textState.translateTextMatrix(0, scaledDim);
  34941. scaledDim = Math.abs(scaledDim);
  34942. textChunk.height += scaledDim;
  34943. }
  34944. if (scaledDim) {
  34945. textChunk.prevTransform = getCurrentTextTransform();
  34946. }
  34947. const glyphUnicode = glyph.unicode;
  34948. if (saveLastChar(glyphUnicode)) {
  34949. textChunk.str.push(" ");
  34950. }
  34951. textChunk.str.push(glyphUnicode);
  34952. if (charSpacing) {
  34953. if (!font.vertical) {
  34954. textState.translateTextMatrix(charSpacing * textState.textHScale, 0);
  34955. } else {
  34956. textState.translateTextMatrix(0, -charSpacing);
  34957. }
  34958. }
  34959. }
  34960. }
  34961. function appendEOL() {
  34962. resetLastChars();
  34963. if (textContentItem.initialized) {
  34964. textContentItem.hasEOL = true;
  34965. flushTextContentItem();
  34966. } else {
  34967. textContent.items.push({
  34968. str: "",
  34969. dir: "ltr",
  34970. width: 0,
  34971. height: 0,
  34972. transform: getCurrentTextTransform(),
  34973. fontName: textState.loadedName,
  34974. hasEOL: true
  34975. });
  34976. }
  34977. }
  34978. function addFakeSpaces(width, transf, textOrientation) {
  34979. if (textOrientation * textContentItem.spaceInFlowMin <= width && width <= textOrientation * textContentItem.spaceInFlowMax) {
  34980. if (textContentItem.initialized) {
  34981. resetLastChars();
  34982. textContentItem.str.push(" ");
  34983. }
  34984. return false;
  34985. }
  34986. const fontName = textContentItem.fontName;
  34987. let height = 0;
  34988. if (textContentItem.vertical) {
  34989. height = width;
  34990. width = 0;
  34991. }
  34992. flushTextContentItem();
  34993. resetLastChars();
  34994. pushWhitespace({
  34995. width: Math.abs(width),
  34996. height: Math.abs(height),
  34997. transform: transf || getCurrentTextTransform(),
  34998. fontName
  34999. });
  35000. return true;
  35001. }
  35002. function flushTextContentItem() {
  35003. if (!textContentItem.initialized || !textContentItem.str) {
  35004. return;
  35005. }
  35006. if (!textContentItem.vertical) {
  35007. textContentItem.totalWidth += textContentItem.width * textContentItem.textAdvanceScale;
  35008. } else {
  35009. textContentItem.totalHeight += textContentItem.height * textContentItem.textAdvanceScale;
  35010. }
  35011. textContent.items.push(runBidiTransform(textContentItem));
  35012. textContentItem.initialized = false;
  35013. textContentItem.str.length = 0;
  35014. }
  35015. function enqueueChunk(batch = false) {
  35016. const length = textContent.items.length;
  35017. if (length === 0) {
  35018. return;
  35019. }
  35020. if (batch && length < TEXT_CHUNK_BATCH_SIZE) {
  35021. return;
  35022. }
  35023. sink.enqueue(textContent, length);
  35024. textContent.items = [];
  35025. textContent.styles = Object.create(null);
  35026. }
  35027. const timeSlotManager = new TimeSlotManager();
  35028. return new Promise(function promiseBody(resolve, reject) {
  35029. const next = function (promise) {
  35030. enqueueChunk(true);
  35031. Promise.all([promise, sink.ready]).then(function () {
  35032. try {
  35033. promiseBody(resolve, reject);
  35034. } catch (ex) {
  35035. reject(ex);
  35036. }
  35037. }, reject);
  35038. };
  35039. task.ensureNotTerminated();
  35040. timeSlotManager.reset();
  35041. const operation = {};
  35042. let stop,
  35043. args = [];
  35044. while (!(stop = timeSlotManager.check())) {
  35045. args.length = 0;
  35046. operation.args = args;
  35047. if (!preprocessor.read(operation)) {
  35048. break;
  35049. }
  35050. const previousState = textState;
  35051. textState = stateManager.state;
  35052. const fn = operation.fn;
  35053. args = operation.args;
  35054. switch (fn | 0) {
  35055. case OPS.setFont:
  35056. var fontNameArg = args[0].name,
  35057. fontSizeArg = args[1];
  35058. if (textState.font && fontNameArg === textState.fontName && fontSizeArg === textState.fontSize) {
  35059. break;
  35060. }
  35061. flushTextContentItem();
  35062. textState.fontName = fontNameArg;
  35063. textState.fontSize = fontSizeArg;
  35064. next(handleSetFont(fontNameArg, null));
  35065. return;
  35066. case OPS.setTextRise:
  35067. textState.textRise = args[0];
  35068. break;
  35069. case OPS.setHScale:
  35070. textState.textHScale = args[0] / 100;
  35071. break;
  35072. case OPS.setLeading:
  35073. textState.leading = args[0];
  35074. break;
  35075. case OPS.moveText:
  35076. textState.translateTextLineMatrix(args[0], args[1]);
  35077. textState.textMatrix = textState.textLineMatrix.slice();
  35078. break;
  35079. case OPS.setLeadingMoveText:
  35080. textState.leading = -args[1];
  35081. textState.translateTextLineMatrix(args[0], args[1]);
  35082. textState.textMatrix = textState.textLineMatrix.slice();
  35083. break;
  35084. case OPS.nextLine:
  35085. textState.carriageReturn();
  35086. break;
  35087. case OPS.setTextMatrix:
  35088. textState.setTextMatrix(args[0], args[1], args[2], args[3], args[4], args[5]);
  35089. textState.setTextLineMatrix(args[0], args[1], args[2], args[3], args[4], args[5]);
  35090. updateAdvanceScale();
  35091. break;
  35092. case OPS.setCharSpacing:
  35093. textState.charSpacing = args[0];
  35094. break;
  35095. case OPS.setWordSpacing:
  35096. textState.wordSpacing = args[0];
  35097. break;
  35098. case OPS.beginText:
  35099. textState.textMatrix = IDENTITY_MATRIX.slice();
  35100. textState.textLineMatrix = IDENTITY_MATRIX.slice();
  35101. break;
  35102. case OPS.showSpacedText:
  35103. if (!stateManager.state.font) {
  35104. self.ensureStateFont(stateManager.state);
  35105. continue;
  35106. }
  35107. const spaceFactor = (textState.font.vertical ? 1 : -1) * textState.fontSize / 1000;
  35108. const elements = args[0];
  35109. for (let i = 0, ii = elements.length; i < ii; i++) {
  35110. const item = elements[i];
  35111. if (typeof item === "string") {
  35112. showSpacedTextBuffer.push(item);
  35113. } else if (typeof item === "number" && item !== 0) {
  35114. const str = showSpacedTextBuffer.join("");
  35115. showSpacedTextBuffer.length = 0;
  35116. buildTextContentItem({
  35117. chars: str,
  35118. extraSpacing: item * spaceFactor
  35119. });
  35120. }
  35121. }
  35122. if (showSpacedTextBuffer.length > 0) {
  35123. const str = showSpacedTextBuffer.join("");
  35124. showSpacedTextBuffer.length = 0;
  35125. buildTextContentItem({
  35126. chars: str,
  35127. extraSpacing: 0
  35128. });
  35129. }
  35130. break;
  35131. case OPS.showText:
  35132. if (!stateManager.state.font) {
  35133. self.ensureStateFont(stateManager.state);
  35134. continue;
  35135. }
  35136. buildTextContentItem({
  35137. chars: args[0],
  35138. extraSpacing: 0
  35139. });
  35140. break;
  35141. case OPS.nextLineShowText:
  35142. if (!stateManager.state.font) {
  35143. self.ensureStateFont(stateManager.state);
  35144. continue;
  35145. }
  35146. textState.carriageReturn();
  35147. buildTextContentItem({
  35148. chars: args[0],
  35149. extraSpacing: 0
  35150. });
  35151. break;
  35152. case OPS.nextLineSetSpacingShowText:
  35153. if (!stateManager.state.font) {
  35154. self.ensureStateFont(stateManager.state);
  35155. continue;
  35156. }
  35157. textState.wordSpacing = args[0];
  35158. textState.charSpacing = args[1];
  35159. textState.carriageReturn();
  35160. buildTextContentItem({
  35161. chars: args[2],
  35162. extraSpacing: 0
  35163. });
  35164. break;
  35165. case OPS.paintXObject:
  35166. flushTextContentItem();
  35167. if (!xobjs) {
  35168. xobjs = resources.get("XObject") || Dict.empty;
  35169. }
  35170. var isValidName = args[0] instanceof Name;
  35171. var name = args[0].name;
  35172. if (isValidName && emptyXObjectCache.getByName(name)) {
  35173. break;
  35174. }
  35175. next(new Promise(function (resolveXObject, rejectXObject) {
  35176. if (!isValidName) {
  35177. throw new FormatError("XObject must be referred to by name.");
  35178. }
  35179. let xobj = xobjs.getRaw(name);
  35180. if (xobj instanceof Ref) {
  35181. if (emptyXObjectCache.getByRef(xobj)) {
  35182. resolveXObject();
  35183. return;
  35184. }
  35185. const globalImage = self.globalImageCache.getData(xobj, self.pageIndex);
  35186. if (globalImage) {
  35187. resolveXObject();
  35188. return;
  35189. }
  35190. xobj = xref.fetch(xobj);
  35191. }
  35192. if (!(xobj instanceof BaseStream)) {
  35193. throw new FormatError("XObject should be a stream");
  35194. }
  35195. const type = xobj.dict.get("Subtype");
  35196. if (!(type instanceof Name)) {
  35197. throw new FormatError("XObject should have a Name subtype");
  35198. }
  35199. if (type.name !== "Form") {
  35200. emptyXObjectCache.set(name, xobj.dict.objId, true);
  35201. resolveXObject();
  35202. return;
  35203. }
  35204. const currentState = stateManager.state.clone();
  35205. const xObjStateManager = new StateManager(currentState);
  35206. const matrix = lookupMatrix(xobj.dict.getArray("Matrix"), null);
  35207. if (matrix) {
  35208. xObjStateManager.transform(matrix);
  35209. }
  35210. enqueueChunk();
  35211. const sinkWrapper = {
  35212. enqueueInvoked: false,
  35213. enqueue(chunk, size) {
  35214. this.enqueueInvoked = true;
  35215. sink.enqueue(chunk, size);
  35216. },
  35217. get desiredSize() {
  35218. return sink.desiredSize;
  35219. },
  35220. get ready() {
  35221. return sink.ready;
  35222. }
  35223. };
  35224. self.getTextContent({
  35225. stream: xobj,
  35226. task,
  35227. resources: xobj.dict.get("Resources") || resources,
  35228. stateManager: xObjStateManager,
  35229. includeMarkedContent,
  35230. sink: sinkWrapper,
  35231. seenStyles,
  35232. viewBox,
  35233. lang,
  35234. markedContentData,
  35235. disableNormalization,
  35236. keepWhiteSpace
  35237. }).then(function () {
  35238. if (!sinkWrapper.enqueueInvoked) {
  35239. emptyXObjectCache.set(name, xobj.dict.objId, true);
  35240. }
  35241. resolveXObject();
  35242. }, rejectXObject);
  35243. }).catch(function (reason) {
  35244. if (reason instanceof AbortException) {
  35245. return;
  35246. }
  35247. if (self.options.ignoreErrors) {
  35248. warn(`getTextContent - ignoring XObject: "${reason}".`);
  35249. return;
  35250. }
  35251. throw reason;
  35252. }));
  35253. return;
  35254. case OPS.setGState:
  35255. isValidName = args[0] instanceof Name;
  35256. name = args[0].name;
  35257. if (isValidName && emptyGStateCache.getByName(name)) {
  35258. break;
  35259. }
  35260. next(new Promise(function (resolveGState, rejectGState) {
  35261. if (!isValidName) {
  35262. throw new FormatError("GState must be referred to by name.");
  35263. }
  35264. const extGState = resources.get("ExtGState");
  35265. if (!(extGState instanceof Dict)) {
  35266. throw new FormatError("ExtGState should be a dictionary.");
  35267. }
  35268. const gState = extGState.get(name);
  35269. if (!(gState instanceof Dict)) {
  35270. throw new FormatError("GState should be a dictionary.");
  35271. }
  35272. const gStateFont = gState.get("Font");
  35273. if (!gStateFont) {
  35274. emptyGStateCache.set(name, gState.objId, true);
  35275. resolveGState();
  35276. return;
  35277. }
  35278. flushTextContentItem();
  35279. textState.fontName = null;
  35280. textState.fontSize = gStateFont[1];
  35281. handleSetFont(null, gStateFont[0]).then(resolveGState, rejectGState);
  35282. }).catch(function (reason) {
  35283. if (reason instanceof AbortException) {
  35284. return;
  35285. }
  35286. if (self.options.ignoreErrors) {
  35287. warn(`getTextContent - ignoring ExtGState: "${reason}".`);
  35288. return;
  35289. }
  35290. throw reason;
  35291. }));
  35292. return;
  35293. case OPS.beginMarkedContent:
  35294. flushTextContentItem();
  35295. if (includeMarkedContent) {
  35296. markedContentData.level++;
  35297. textContent.items.push({
  35298. type: "beginMarkedContent",
  35299. tag: args[0] instanceof Name ? args[0].name : null
  35300. });
  35301. }
  35302. break;
  35303. case OPS.beginMarkedContentProps:
  35304. flushTextContentItem();
  35305. if (includeMarkedContent) {
  35306. markedContentData.level++;
  35307. let mcid = null;
  35308. if (args[1] instanceof Dict) {
  35309. mcid = args[1].get("MCID");
  35310. }
  35311. textContent.items.push({
  35312. type: "beginMarkedContentProps",
  35313. id: Number.isInteger(mcid) ? `${self.idFactory.getPageObjId()}_mc${mcid}` : null,
  35314. tag: args[0] instanceof Name ? args[0].name : null
  35315. });
  35316. }
  35317. break;
  35318. case OPS.endMarkedContent:
  35319. flushTextContentItem();
  35320. if (includeMarkedContent) {
  35321. if (markedContentData.level === 0) {
  35322. break;
  35323. }
  35324. markedContentData.level--;
  35325. textContent.items.push({
  35326. type: "endMarkedContent"
  35327. });
  35328. }
  35329. break;
  35330. case OPS.restore:
  35331. if (previousState && (previousState.font !== textState.font || previousState.fontSize !== textState.fontSize || previousState.fontName !== textState.fontName)) {
  35332. flushTextContentItem();
  35333. }
  35334. break;
  35335. }
  35336. if (textContent.items.length >= sink.desiredSize) {
  35337. stop = true;
  35338. break;
  35339. }
  35340. }
  35341. if (stop) {
  35342. next(deferred);
  35343. return;
  35344. }
  35345. flushTextContentItem();
  35346. enqueueChunk();
  35347. resolve();
  35348. }).catch(reason => {
  35349. if (reason instanceof AbortException) {
  35350. return;
  35351. }
  35352. if (this.options.ignoreErrors) {
  35353. warn(`getTextContent - ignoring errors during "${task.name}" ` + `task: "${reason}".`);
  35354. flushTextContentItem();
  35355. enqueueChunk();
  35356. return;
  35357. }
  35358. throw reason;
  35359. });
  35360. }
  35361. async extractDataStructures(dict, properties) {
  35362. const xref = this.xref;
  35363. let cidToGidBytes;
  35364. const toUnicodePromise = this.readToUnicode(properties.toUnicode);
  35365. if (properties.composite) {
  35366. const cidSystemInfo = dict.get("CIDSystemInfo");
  35367. if (cidSystemInfo instanceof Dict) {
  35368. properties.cidSystemInfo = {
  35369. registry: stringToPDFString(cidSystemInfo.get("Registry")),
  35370. ordering: stringToPDFString(cidSystemInfo.get("Ordering")),
  35371. supplement: cidSystemInfo.get("Supplement")
  35372. };
  35373. }
  35374. try {
  35375. const cidToGidMap = dict.get("CIDToGIDMap");
  35376. if (cidToGidMap instanceof BaseStream) {
  35377. cidToGidBytes = cidToGidMap.getBytes();
  35378. }
  35379. } catch (ex) {
  35380. if (!this.options.ignoreErrors) {
  35381. throw ex;
  35382. }
  35383. warn(`extractDataStructures - ignoring CIDToGIDMap data: "${ex}".`);
  35384. }
  35385. }
  35386. const differences = [];
  35387. let baseEncodingName = null;
  35388. let encoding;
  35389. if (dict.has("Encoding")) {
  35390. encoding = dict.get("Encoding");
  35391. if (encoding instanceof Dict) {
  35392. baseEncodingName = encoding.get("BaseEncoding");
  35393. baseEncodingName = baseEncodingName instanceof Name ? baseEncodingName.name : null;
  35394. if (encoding.has("Differences")) {
  35395. const diffEncoding = encoding.get("Differences");
  35396. let index = 0;
  35397. for (const entry of diffEncoding) {
  35398. const data = xref.fetchIfRef(entry);
  35399. if (typeof data === "number") {
  35400. index = data;
  35401. } else if (data instanceof Name) {
  35402. differences[index++] = data.name;
  35403. } else {
  35404. throw new FormatError(`Invalid entry in 'Differences' array: ${data}`);
  35405. }
  35406. }
  35407. }
  35408. } else if (encoding instanceof Name) {
  35409. baseEncodingName = encoding.name;
  35410. } else {
  35411. const msg = "Encoding is not a Name nor a Dict";
  35412. if (!this.options.ignoreErrors) {
  35413. throw new FormatError(msg);
  35414. }
  35415. warn(msg);
  35416. }
  35417. if (baseEncodingName !== "MacRomanEncoding" && baseEncodingName !== "MacExpertEncoding" && baseEncodingName !== "WinAnsiEncoding") {
  35418. baseEncodingName = null;
  35419. }
  35420. }
  35421. const nonEmbeddedFont = !properties.file || properties.isInternalFont,
  35422. isSymbolsFontName = getSymbolsFonts()[properties.name];
  35423. if (baseEncodingName && nonEmbeddedFont && isSymbolsFontName) {
  35424. baseEncodingName = null;
  35425. }
  35426. if (baseEncodingName) {
  35427. properties.defaultEncoding = getEncoding(baseEncodingName);
  35428. } else {
  35429. const isSymbolicFont = !!(properties.flags & FontFlags.Symbolic);
  35430. const isNonsymbolicFont = !!(properties.flags & FontFlags.Nonsymbolic);
  35431. encoding = StandardEncoding;
  35432. if (properties.type === "TrueType" && !isNonsymbolicFont) {
  35433. encoding = WinAnsiEncoding;
  35434. }
  35435. if (isSymbolicFont || isSymbolsFontName) {
  35436. encoding = MacRomanEncoding;
  35437. if (nonEmbeddedFont) {
  35438. if (/Symbol/i.test(properties.name)) {
  35439. encoding = SymbolSetEncoding;
  35440. } else if (/Dingbats/i.test(properties.name)) {
  35441. encoding = ZapfDingbatsEncoding;
  35442. } else if (/Wingdings/i.test(properties.name)) {
  35443. encoding = WinAnsiEncoding;
  35444. }
  35445. }
  35446. }
  35447. properties.defaultEncoding = encoding;
  35448. }
  35449. properties.differences = differences;
  35450. properties.baseEncodingName = baseEncodingName;
  35451. properties.hasEncoding = !!baseEncodingName || differences.length > 0;
  35452. properties.dict = dict;
  35453. properties.toUnicode = await toUnicodePromise;
  35454. const builtToUnicode = await this.buildToUnicode(properties);
  35455. properties.toUnicode = builtToUnicode;
  35456. if (cidToGidBytes) {
  35457. properties.cidToGidMap = this.readCidToGidMap(cidToGidBytes, builtToUnicode);
  35458. }
  35459. return properties;
  35460. }
  35461. _simpleFontToUnicode(properties, forceGlyphs = false) {
  35462. assert(!properties.composite, "Must be a simple font.");
  35463. const toUnicode = [];
  35464. const encoding = properties.defaultEncoding.slice();
  35465. const baseEncodingName = properties.baseEncodingName;
  35466. const differences = properties.differences;
  35467. for (const charcode in differences) {
  35468. const glyphName = differences[charcode];
  35469. if (glyphName === ".notdef") {
  35470. continue;
  35471. }
  35472. encoding[charcode] = glyphName;
  35473. }
  35474. const glyphsUnicodeMap = getGlyphsUnicode();
  35475. for (const charcode in encoding) {
  35476. let glyphName = encoding[charcode];
  35477. if (glyphName === "") {
  35478. continue;
  35479. }
  35480. let unicode = glyphsUnicodeMap[glyphName];
  35481. if (unicode !== undefined) {
  35482. toUnicode[charcode] = String.fromCharCode(unicode);
  35483. continue;
  35484. }
  35485. let code = 0;
  35486. switch (glyphName[0]) {
  35487. case "G":
  35488. if (glyphName.length === 3) {
  35489. code = parseInt(glyphName.substring(1), 16);
  35490. }
  35491. break;
  35492. case "g":
  35493. if (glyphName.length === 5) {
  35494. code = parseInt(glyphName.substring(1), 16);
  35495. }
  35496. break;
  35497. case "C":
  35498. case "c":
  35499. if (glyphName.length >= 3 && glyphName.length <= 4) {
  35500. const codeStr = glyphName.substring(1);
  35501. if (forceGlyphs) {
  35502. code = parseInt(codeStr, 16);
  35503. break;
  35504. }
  35505. code = +codeStr;
  35506. if (Number.isNaN(code) && Number.isInteger(parseInt(codeStr, 16))) {
  35507. return this._simpleFontToUnicode(properties, true);
  35508. }
  35509. }
  35510. break;
  35511. case "u":
  35512. unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap);
  35513. if (unicode !== -1) {
  35514. code = unicode;
  35515. }
  35516. break;
  35517. default:
  35518. switch (glyphName) {
  35519. case "f_h":
  35520. case "f_t":
  35521. case "T_h":
  35522. toUnicode[charcode] = glyphName.replaceAll("_", "");
  35523. continue;
  35524. }
  35525. break;
  35526. }
  35527. if (code > 0 && code <= 0x10ffff && Number.isInteger(code)) {
  35528. if (baseEncodingName && code === +charcode) {
  35529. const baseEncoding = getEncoding(baseEncodingName);
  35530. if (baseEncoding && (glyphName = baseEncoding[charcode])) {
  35531. toUnicode[charcode] = String.fromCharCode(glyphsUnicodeMap[glyphName]);
  35532. continue;
  35533. }
  35534. }
  35535. toUnicode[charcode] = String.fromCodePoint(code);
  35536. }
  35537. }
  35538. return toUnicode;
  35539. }
  35540. async buildToUnicode(properties) {
  35541. properties.hasIncludedToUnicodeMap = properties.toUnicode?.length > 0;
  35542. if (properties.hasIncludedToUnicodeMap) {
  35543. if (!properties.composite && properties.hasEncoding) {
  35544. properties.fallbackToUnicode = this._simpleFontToUnicode(properties);
  35545. }
  35546. return properties.toUnicode;
  35547. }
  35548. if (!properties.composite) {
  35549. return new ToUnicodeMap(this._simpleFontToUnicode(properties));
  35550. }
  35551. if (properties.composite && (properties.cMap.builtInCMap && !(properties.cMap instanceof IdentityCMap) || properties.cidSystemInfo?.registry === "Adobe" && (properties.cidSystemInfo.ordering === "GB1" || properties.cidSystemInfo.ordering === "CNS1" || properties.cidSystemInfo.ordering === "Japan1" || properties.cidSystemInfo.ordering === "Korea1"))) {
  35552. const {
  35553. registry,
  35554. ordering
  35555. } = properties.cidSystemInfo;
  35556. const ucs2CMapName = Name.get(`${registry}-${ordering}-UCS2`);
  35557. const ucs2CMap = await CMapFactory.create({
  35558. encoding: ucs2CMapName,
  35559. fetchBuiltInCMap: this._fetchBuiltInCMapBound,
  35560. useCMap: null
  35561. });
  35562. const toUnicode = [],
  35563. buf = [];
  35564. properties.cMap.forEach(function (charcode, cid) {
  35565. if (cid > 0xffff) {
  35566. throw new FormatError("Max size of CID is 65,535");
  35567. }
  35568. const ucs2 = ucs2CMap.lookup(cid);
  35569. if (ucs2) {
  35570. buf.length = 0;
  35571. for (let i = 0, ii = ucs2.length; i < ii; i += 2) {
  35572. buf.push((ucs2.charCodeAt(i) << 8) + ucs2.charCodeAt(i + 1));
  35573. }
  35574. toUnicode[charcode] = String.fromCharCode(...buf);
  35575. }
  35576. });
  35577. return new ToUnicodeMap(toUnicode);
  35578. }
  35579. return new IdentityToUnicodeMap(properties.firstChar, properties.lastChar);
  35580. }
  35581. async readToUnicode(cmapObj) {
  35582. if (!cmapObj) {
  35583. return null;
  35584. }
  35585. if (cmapObj instanceof Name) {
  35586. const cmap = await CMapFactory.create({
  35587. encoding: cmapObj,
  35588. fetchBuiltInCMap: this._fetchBuiltInCMapBound,
  35589. useCMap: null
  35590. });
  35591. if (cmap instanceof IdentityCMap) {
  35592. return new IdentityToUnicodeMap(0, 0xffff);
  35593. }
  35594. return new ToUnicodeMap(cmap.getMap());
  35595. }
  35596. if (cmapObj instanceof BaseStream) {
  35597. try {
  35598. const cmap = await CMapFactory.create({
  35599. encoding: cmapObj,
  35600. fetchBuiltInCMap: this._fetchBuiltInCMapBound,
  35601. useCMap: null
  35602. });
  35603. if (cmap instanceof IdentityCMap) {
  35604. return new IdentityToUnicodeMap(0, 0xffff);
  35605. }
  35606. const map = new Array(cmap.length);
  35607. cmap.forEach(function (charCode, token) {
  35608. if (typeof token === "number") {
  35609. map[charCode] = String.fromCodePoint(token);
  35610. return;
  35611. }
  35612. if (token.length % 2 !== 0) {
  35613. token = "\u0000" + token;
  35614. }
  35615. const str = [];
  35616. for (let k = 0; k < token.length; k += 2) {
  35617. const w1 = token.charCodeAt(k) << 8 | token.charCodeAt(k + 1);
  35618. if ((w1 & 0xf800) !== 0xd800) {
  35619. str.push(w1);
  35620. continue;
  35621. }
  35622. k += 2;
  35623. const w2 = token.charCodeAt(k) << 8 | token.charCodeAt(k + 1);
  35624. str.push(((w1 & 0x3ff) << 10) + (w2 & 0x3ff) + 0x10000);
  35625. }
  35626. map[charCode] = String.fromCodePoint(...str);
  35627. });
  35628. return new ToUnicodeMap(map);
  35629. } catch (reason) {
  35630. if (reason instanceof AbortException) {
  35631. return null;
  35632. }
  35633. if (this.options.ignoreErrors) {
  35634. warn(`readToUnicode - ignoring ToUnicode data: "${reason}".`);
  35635. return null;
  35636. }
  35637. throw reason;
  35638. }
  35639. }
  35640. return null;
  35641. }
  35642. readCidToGidMap(glyphsData, toUnicode) {
  35643. const result = [];
  35644. for (let j = 0, jj = glyphsData.length; j < jj; j++) {
  35645. const glyphID = glyphsData[j++] << 8 | glyphsData[j];
  35646. const code = j >> 1;
  35647. if (glyphID === 0 && !toUnicode.has(code)) {
  35648. continue;
  35649. }
  35650. result[code] = glyphID;
  35651. }
  35652. return result;
  35653. }
  35654. extractWidths(dict, descriptor, properties) {
  35655. const xref = this.xref;
  35656. let glyphsWidths = [];
  35657. let defaultWidth = 0;
  35658. const glyphsVMetrics = [];
  35659. let defaultVMetrics;
  35660. if (properties.composite) {
  35661. const dw = dict.get("DW");
  35662. defaultWidth = typeof dw === "number" ? Math.ceil(dw) : 1000;
  35663. const widths = dict.get("W");
  35664. if (Array.isArray(widths)) {
  35665. for (let i = 0, ii = widths.length; i < ii; i++) {
  35666. let start = xref.fetchIfRef(widths[i++]);
  35667. if (!Number.isInteger(start)) {
  35668. break;
  35669. }
  35670. const code = xref.fetchIfRef(widths[i]);
  35671. if (Array.isArray(code)) {
  35672. for (const c of code) {
  35673. const width = xref.fetchIfRef(c);
  35674. if (typeof width === "number") {
  35675. glyphsWidths[start] = width;
  35676. }
  35677. start++;
  35678. }
  35679. } else if (Number.isInteger(code)) {
  35680. const width = xref.fetchIfRef(widths[++i]);
  35681. if (typeof width !== "number") {
  35682. continue;
  35683. }
  35684. for (let j = start; j <= code; j++) {
  35685. glyphsWidths[j] = width;
  35686. }
  35687. } else {
  35688. break;
  35689. }
  35690. }
  35691. }
  35692. if (properties.vertical) {
  35693. const dw2 = dict.getArray("DW2");
  35694. let vmetrics = isNumberArray(dw2, 2) ? dw2 : [880, -1000];
  35695. defaultVMetrics = [vmetrics[1], defaultWidth * 0.5, vmetrics[0]];
  35696. vmetrics = dict.get("W2");
  35697. if (Array.isArray(vmetrics)) {
  35698. for (let i = 0, ii = vmetrics.length; i < ii; i++) {
  35699. let start = xref.fetchIfRef(vmetrics[i++]);
  35700. if (!Number.isInteger(start)) {
  35701. break;
  35702. }
  35703. const code = xref.fetchIfRef(vmetrics[i]);
  35704. if (Array.isArray(code)) {
  35705. for (let j = 0, jj = code.length; j < jj; j++) {
  35706. const vmetric = [xref.fetchIfRef(code[j++]), xref.fetchIfRef(code[j++]), xref.fetchIfRef(code[j])];
  35707. if (isNumberArray(vmetric, null)) {
  35708. glyphsVMetrics[start] = vmetric;
  35709. }
  35710. start++;
  35711. }
  35712. } else if (Number.isInteger(code)) {
  35713. const vmetric = [xref.fetchIfRef(vmetrics[++i]), xref.fetchIfRef(vmetrics[++i]), xref.fetchIfRef(vmetrics[++i])];
  35714. if (!isNumberArray(vmetric, null)) {
  35715. continue;
  35716. }
  35717. for (let j = start; j <= code; j++) {
  35718. glyphsVMetrics[j] = vmetric;
  35719. }
  35720. } else {
  35721. break;
  35722. }
  35723. }
  35724. }
  35725. }
  35726. } else {
  35727. const widths = dict.get("Widths");
  35728. if (Array.isArray(widths)) {
  35729. let j = properties.firstChar;
  35730. for (const w of widths) {
  35731. const width = xref.fetchIfRef(w);
  35732. if (typeof width === "number") {
  35733. glyphsWidths[j] = width;
  35734. }
  35735. j++;
  35736. }
  35737. const missingWidth = descriptor.get("MissingWidth");
  35738. defaultWidth = typeof missingWidth === "number" ? missingWidth : 0;
  35739. } else {
  35740. const baseFontName = dict.get("BaseFont");
  35741. if (baseFontName instanceof Name) {
  35742. const metrics = this.getBaseFontMetrics(baseFontName.name);
  35743. glyphsWidths = this.buildCharCodeToWidth(metrics.widths, properties);
  35744. defaultWidth = metrics.defaultWidth;
  35745. }
  35746. }
  35747. }
  35748. let isMonospace = true;
  35749. let firstWidth = defaultWidth;
  35750. for (const glyph in glyphsWidths) {
  35751. const glyphWidth = glyphsWidths[glyph];
  35752. if (!glyphWidth) {
  35753. continue;
  35754. }
  35755. if (!firstWidth) {
  35756. firstWidth = glyphWidth;
  35757. continue;
  35758. }
  35759. if (firstWidth !== glyphWidth) {
  35760. isMonospace = false;
  35761. break;
  35762. }
  35763. }
  35764. if (isMonospace) {
  35765. properties.flags |= FontFlags.FixedPitch;
  35766. } else {
  35767. properties.flags &= ~FontFlags.FixedPitch;
  35768. }
  35769. properties.defaultWidth = defaultWidth;
  35770. properties.widths = glyphsWidths;
  35771. properties.defaultVMetrics = defaultVMetrics;
  35772. properties.vmetrics = glyphsVMetrics;
  35773. }
  35774. isSerifFont(baseFontName) {
  35775. const fontNameWoStyle = baseFontName.split("-", 1)[0];
  35776. return fontNameWoStyle in getSerifFonts() || /serif/gi.test(fontNameWoStyle);
  35777. }
  35778. getBaseFontMetrics(name) {
  35779. let defaultWidth = 0;
  35780. let widths = Object.create(null);
  35781. let monospace = false;
  35782. const stdFontMap = getStdFontMap();
  35783. let lookupName = stdFontMap[name] || name;
  35784. const Metrics = getMetrics();
  35785. if (!(lookupName in Metrics)) {
  35786. lookupName = this.isSerifFont(name) ? "Times-Roman" : "Helvetica";
  35787. }
  35788. const glyphWidths = Metrics[lookupName];
  35789. if (typeof glyphWidths === "number") {
  35790. defaultWidth = glyphWidths;
  35791. monospace = true;
  35792. } else {
  35793. widths = glyphWidths();
  35794. }
  35795. return {
  35796. defaultWidth,
  35797. monospace,
  35798. widths
  35799. };
  35800. }
  35801. buildCharCodeToWidth(widthsByGlyphName, properties) {
  35802. const widths = Object.create(null);
  35803. const differences = properties.differences;
  35804. const encoding = properties.defaultEncoding;
  35805. for (let charCode = 0; charCode < 256; charCode++) {
  35806. if (charCode in differences && widthsByGlyphName[differences[charCode]]) {
  35807. widths[charCode] = widthsByGlyphName[differences[charCode]];
  35808. continue;
  35809. }
  35810. if (charCode in encoding && widthsByGlyphName[encoding[charCode]]) {
  35811. widths[charCode] = widthsByGlyphName[encoding[charCode]];
  35812. continue;
  35813. }
  35814. }
  35815. return widths;
  35816. }
  35817. preEvaluateFont(dict) {
  35818. const baseDict = dict;
  35819. let type = dict.get("Subtype");
  35820. if (!(type instanceof Name)) {
  35821. throw new FormatError("invalid font Subtype");
  35822. }
  35823. let composite = false;
  35824. let hash;
  35825. if (type.name === "Type0") {
  35826. const df = dict.get("DescendantFonts");
  35827. if (!df) {
  35828. throw new FormatError("Descendant fonts are not specified");
  35829. }
  35830. dict = Array.isArray(df) ? this.xref.fetchIfRef(df[0]) : df;
  35831. if (!(dict instanceof Dict)) {
  35832. throw new FormatError("Descendant font is not a dictionary.");
  35833. }
  35834. type = dict.get("Subtype");
  35835. if (!(type instanceof Name)) {
  35836. throw new FormatError("invalid font Subtype");
  35837. }
  35838. composite = true;
  35839. }
  35840. let firstChar = dict.get("FirstChar");
  35841. if (!Number.isInteger(firstChar)) {
  35842. firstChar = 0;
  35843. }
  35844. let lastChar = dict.get("LastChar");
  35845. if (!Number.isInteger(lastChar)) {
  35846. lastChar = composite ? 0xffff : 0xff;
  35847. }
  35848. const descriptor = dict.get("FontDescriptor");
  35849. const toUnicode = dict.get("ToUnicode") || baseDict.get("ToUnicode");
  35850. if (descriptor) {
  35851. hash = new MurmurHash3_64();
  35852. const encoding = baseDict.getRaw("Encoding");
  35853. if (encoding instanceof Name) {
  35854. hash.update(encoding.name);
  35855. } else if (encoding instanceof Ref) {
  35856. hash.update(encoding.toString());
  35857. } else if (encoding instanceof Dict) {
  35858. for (const entry of encoding.getRawValues()) {
  35859. if (entry instanceof Name) {
  35860. hash.update(entry.name);
  35861. } else if (entry instanceof Ref) {
  35862. hash.update(entry.toString());
  35863. } else if (Array.isArray(entry)) {
  35864. const diffLength = entry.length,
  35865. diffBuf = new Array(diffLength);
  35866. for (let j = 0; j < diffLength; j++) {
  35867. const diffEntry = entry[j];
  35868. if (diffEntry instanceof Name) {
  35869. diffBuf[j] = diffEntry.name;
  35870. } else if (typeof diffEntry === "number" || diffEntry instanceof Ref) {
  35871. diffBuf[j] = diffEntry.toString();
  35872. }
  35873. }
  35874. hash.update(diffBuf.join());
  35875. }
  35876. }
  35877. }
  35878. hash.update(`${firstChar}-${lastChar}`);
  35879. if (toUnicode instanceof BaseStream) {
  35880. const stream = toUnicode.str || toUnicode;
  35881. const uint8array = stream.buffer ? new Uint8Array(stream.buffer.buffer, 0, stream.bufferLength) : new Uint8Array(stream.bytes.buffer, stream.start, stream.end - stream.start);
  35882. hash.update(uint8array);
  35883. } else if (toUnicode instanceof Name) {
  35884. hash.update(toUnicode.name);
  35885. }
  35886. const widths = dict.get("Widths") || baseDict.get("Widths");
  35887. if (Array.isArray(widths)) {
  35888. const widthsBuf = [];
  35889. for (const entry of widths) {
  35890. if (typeof entry === "number" || entry instanceof Ref) {
  35891. widthsBuf.push(entry.toString());
  35892. }
  35893. }
  35894. hash.update(widthsBuf.join());
  35895. }
  35896. if (composite) {
  35897. hash.update("compositeFont");
  35898. const compositeWidths = dict.get("W") || baseDict.get("W");
  35899. if (Array.isArray(compositeWidths)) {
  35900. const widthsBuf = [];
  35901. for (const entry of compositeWidths) {
  35902. if (typeof entry === "number" || entry instanceof Ref) {
  35903. widthsBuf.push(entry.toString());
  35904. } else if (Array.isArray(entry)) {
  35905. const subWidthsBuf = [];
  35906. for (const element of entry) {
  35907. if (typeof element === "number" || element instanceof Ref) {
  35908. subWidthsBuf.push(element.toString());
  35909. }
  35910. }
  35911. widthsBuf.push(`[${subWidthsBuf.join()}]`);
  35912. }
  35913. }
  35914. hash.update(widthsBuf.join());
  35915. }
  35916. const cidToGidMap = dict.getRaw("CIDToGIDMap") || baseDict.getRaw("CIDToGIDMap");
  35917. if (cidToGidMap instanceof Name) {
  35918. hash.update(cidToGidMap.name);
  35919. } else if (cidToGidMap instanceof Ref) {
  35920. hash.update(cidToGidMap.toString());
  35921. } else if (cidToGidMap instanceof BaseStream) {
  35922. hash.update(cidToGidMap.peekBytes());
  35923. }
  35924. }
  35925. }
  35926. return {
  35927. descriptor,
  35928. dict,
  35929. baseDict,
  35930. composite,
  35931. type: type.name,
  35932. firstChar,
  35933. lastChar,
  35934. toUnicode,
  35935. hash: hash ? hash.hexdigest() : ""
  35936. };
  35937. }
  35938. async translateFont({
  35939. descriptor,
  35940. dict,
  35941. baseDict,
  35942. composite,
  35943. type,
  35944. firstChar,
  35945. lastChar,
  35946. toUnicode,
  35947. cssFontInfo
  35948. }) {
  35949. const isType3Font = type === "Type3";
  35950. if (!descriptor) {
  35951. if (isType3Font) {
  35952. const bbox = lookupNormalRect(dict.getArray("FontBBox"), [0, 0, 0, 0]);
  35953. descriptor = new Dict(null);
  35954. descriptor.set("FontName", Name.get(type));
  35955. descriptor.set("FontBBox", bbox);
  35956. } else {
  35957. let baseFontName = dict.get("BaseFont");
  35958. if (!(baseFontName instanceof Name)) {
  35959. throw new FormatError("Base font is not specified");
  35960. }
  35961. baseFontName = baseFontName.name.replaceAll(/[,_]/g, "-");
  35962. const metrics = this.getBaseFontMetrics(baseFontName);
  35963. const fontNameWoStyle = baseFontName.split("-", 1)[0];
  35964. const flags = (this.isSerifFont(fontNameWoStyle) ? FontFlags.Serif : 0) | (metrics.monospace ? FontFlags.FixedPitch : 0) | (getSymbolsFonts()[fontNameWoStyle] ? FontFlags.Symbolic : FontFlags.Nonsymbolic);
  35965. const properties = {
  35966. type,
  35967. name: baseFontName,
  35968. loadedName: baseDict.loadedName,
  35969. systemFontInfo: null,
  35970. widths: metrics.widths,
  35971. defaultWidth: metrics.defaultWidth,
  35972. isSimulatedFlags: true,
  35973. flags,
  35974. firstChar,
  35975. lastChar,
  35976. toUnicode,
  35977. xHeight: 0,
  35978. capHeight: 0,
  35979. italicAngle: 0,
  35980. isType3Font
  35981. };
  35982. const widths = dict.get("Widths");
  35983. const standardFontName = getStandardFontName(baseFontName);
  35984. let file = null;
  35985. if (standardFontName) {
  35986. file = await this.fetchStandardFontData(standardFontName);
  35987. properties.isInternalFont = !!file;
  35988. }
  35989. if (!properties.isInternalFont && this.options.useSystemFonts) {
  35990. properties.systemFontInfo = getFontSubstitution(this.systemFontCache, this.idFactory, this.options.standardFontDataUrl, baseFontName, standardFontName, type);
  35991. }
  35992. const newProperties = await this.extractDataStructures(dict, properties);
  35993. if (Array.isArray(widths)) {
  35994. const glyphWidths = [];
  35995. let j = firstChar;
  35996. for (const w of widths) {
  35997. const width = this.xref.fetchIfRef(w);
  35998. if (typeof width === "number") {
  35999. glyphWidths[j] = width;
  36000. }
  36001. j++;
  36002. }
  36003. newProperties.widths = glyphWidths;
  36004. } else {
  36005. newProperties.widths = this.buildCharCodeToWidth(metrics.widths, newProperties);
  36006. }
  36007. return new Font(baseFontName, file, newProperties);
  36008. }
  36009. }
  36010. let fontName = descriptor.get("FontName");
  36011. let baseFont = dict.get("BaseFont");
  36012. if (typeof fontName === "string") {
  36013. fontName = Name.get(fontName);
  36014. }
  36015. if (typeof baseFont === "string") {
  36016. baseFont = Name.get(baseFont);
  36017. }
  36018. const fontNameStr = fontName?.name;
  36019. const baseFontStr = baseFont?.name;
  36020. if (!isType3Font && fontNameStr !== baseFontStr) {
  36021. info(`The FontDescriptor's FontName is "${fontNameStr}" but ` + `should be the same as the Font's BaseFont "${baseFontStr}".`);
  36022. if (fontNameStr && baseFontStr && (baseFontStr.startsWith(fontNameStr) || !isKnownFontName(fontNameStr) && isKnownFontName(baseFontStr))) {
  36023. fontName = null;
  36024. }
  36025. }
  36026. fontName ||= baseFont;
  36027. if (!(fontName instanceof Name)) {
  36028. throw new FormatError("invalid font name");
  36029. }
  36030. let fontFile, subtype, length1, length2, length3;
  36031. try {
  36032. fontFile = descriptor.get("FontFile", "FontFile2", "FontFile3");
  36033. } catch (ex) {
  36034. if (!this.options.ignoreErrors) {
  36035. throw ex;
  36036. }
  36037. warn(`translateFont - fetching "${fontName.name}" font file: "${ex}".`);
  36038. fontFile = new NullStream();
  36039. }
  36040. let isInternalFont = false;
  36041. let glyphScaleFactors = null;
  36042. let systemFontInfo = null;
  36043. if (fontFile) {
  36044. if (fontFile.dict) {
  36045. const subtypeEntry = fontFile.dict.get("Subtype");
  36046. if (subtypeEntry instanceof Name) {
  36047. subtype = subtypeEntry.name;
  36048. }
  36049. length1 = fontFile.dict.get("Length1");
  36050. length2 = fontFile.dict.get("Length2");
  36051. length3 = fontFile.dict.get("Length3");
  36052. }
  36053. } else if (cssFontInfo) {
  36054. const standardFontName = getXfaFontName(fontName.name);
  36055. if (standardFontName) {
  36056. cssFontInfo.fontFamily = `${cssFontInfo.fontFamily}-PdfJS-XFA`;
  36057. cssFontInfo.metrics = standardFontName.metrics || null;
  36058. glyphScaleFactors = standardFontName.factors || null;
  36059. fontFile = await this.fetchStandardFontData(standardFontName.name);
  36060. isInternalFont = !!fontFile;
  36061. baseDict = dict = getXfaFontDict(fontName.name);
  36062. composite = true;
  36063. }
  36064. } else if (!isType3Font) {
  36065. const standardFontName = getStandardFontName(fontName.name);
  36066. if (standardFontName) {
  36067. fontFile = await this.fetchStandardFontData(standardFontName);
  36068. isInternalFont = !!fontFile;
  36069. }
  36070. if (!isInternalFont && this.options.useSystemFonts) {
  36071. systemFontInfo = getFontSubstitution(this.systemFontCache, this.idFactory, this.options.standardFontDataUrl, fontName.name, standardFontName, type);
  36072. }
  36073. }
  36074. const fontMatrix = lookupMatrix(dict.getArray("FontMatrix"), FONT_IDENTITY_MATRIX);
  36075. const bbox = lookupNormalRect(descriptor.getArray("FontBBox") || dict.getArray("FontBBox"), undefined);
  36076. let ascent = descriptor.get("Ascent");
  36077. if (typeof ascent !== "number") {
  36078. ascent = undefined;
  36079. }
  36080. let descent = descriptor.get("Descent");
  36081. if (typeof descent !== "number") {
  36082. descent = undefined;
  36083. }
  36084. let xHeight = descriptor.get("XHeight");
  36085. if (typeof xHeight !== "number") {
  36086. xHeight = 0;
  36087. }
  36088. let capHeight = descriptor.get("CapHeight");
  36089. if (typeof capHeight !== "number") {
  36090. capHeight = 0;
  36091. }
  36092. let flags = descriptor.get("Flags");
  36093. if (!Number.isInteger(flags)) {
  36094. flags = 0;
  36095. }
  36096. let italicAngle = descriptor.get("ItalicAngle");
  36097. if (typeof italicAngle !== "number") {
  36098. italicAngle = 0;
  36099. }
  36100. const properties = {
  36101. type,
  36102. name: fontName.name,
  36103. subtype,
  36104. file: fontFile,
  36105. length1,
  36106. length2,
  36107. length3,
  36108. isInternalFont,
  36109. loadedName: baseDict.loadedName,
  36110. composite,
  36111. fixedPitch: false,
  36112. fontMatrix,
  36113. firstChar,
  36114. lastChar,
  36115. toUnicode,
  36116. bbox,
  36117. ascent,
  36118. descent,
  36119. xHeight,
  36120. capHeight,
  36121. flags,
  36122. italicAngle,
  36123. isType3Font,
  36124. cssFontInfo,
  36125. scaleFactors: glyphScaleFactors,
  36126. systemFontInfo
  36127. };
  36128. if (composite) {
  36129. const cidEncoding = baseDict.get("Encoding");
  36130. if (cidEncoding instanceof Name) {
  36131. properties.cidEncoding = cidEncoding.name;
  36132. }
  36133. const cMap = await CMapFactory.create({
  36134. encoding: cidEncoding,
  36135. fetchBuiltInCMap: this._fetchBuiltInCMapBound,
  36136. useCMap: null
  36137. });
  36138. properties.cMap = cMap;
  36139. properties.vertical = properties.cMap.vertical;
  36140. }
  36141. const newProperties = await this.extractDataStructures(dict, properties);
  36142. this.extractWidths(dict, descriptor, newProperties);
  36143. return new Font(fontName.name, fontFile, newProperties);
  36144. }
  36145. static buildFontPaths(font, glyphs, handler, evaluatorOptions) {
  36146. function buildPath(fontChar) {
  36147. const glyphName = `${font.loadedName}_path_${fontChar}`;
  36148. try {
  36149. if (font.renderer.hasBuiltPath(fontChar)) {
  36150. return;
  36151. }
  36152. handler.send("commonobj", [glyphName, "FontPath", font.renderer.getPathJs(fontChar)]);
  36153. } catch (reason) {
  36154. if (evaluatorOptions.ignoreErrors) {
  36155. warn(`buildFontPaths - ignoring ${glyphName} glyph: "${reason}".`);
  36156. return;
  36157. }
  36158. throw reason;
  36159. }
  36160. }
  36161. for (const glyph of glyphs) {
  36162. buildPath(glyph.fontChar);
  36163. const accent = glyph.accent;
  36164. if (accent?.fontChar) {
  36165. buildPath(accent.fontChar);
  36166. }
  36167. }
  36168. }
  36169. static get fallbackFontDict() {
  36170. const dict = new Dict();
  36171. dict.set("BaseFont", Name.get("Helvetica"));
  36172. dict.set("Type", Name.get("FallbackType"));
  36173. dict.set("Subtype", Name.get("FallbackType"));
  36174. dict.set("Encoding", Name.get("WinAnsiEncoding"));
  36175. return shadow(this, "fallbackFontDict", dict);
  36176. }
  36177. }
  36178. class TranslatedFont {
  36179. constructor({
  36180. loadedName,
  36181. font,
  36182. dict,
  36183. evaluatorOptions
  36184. }) {
  36185. this.loadedName = loadedName;
  36186. this.font = font;
  36187. this.dict = dict;
  36188. this._evaluatorOptions = evaluatorOptions || DefaultPartialEvaluatorOptions;
  36189. this.type3Loaded = null;
  36190. this.type3Dependencies = font.isType3Font ? new Set() : null;
  36191. this.sent = false;
  36192. }
  36193. send(handler) {
  36194. if (this.sent) {
  36195. return;
  36196. }
  36197. this.sent = true;
  36198. handler.send("commonobj", [this.loadedName, "Font", this.font.exportData(this._evaluatorOptions.fontExtraProperties)]);
  36199. }
  36200. fallback(handler) {
  36201. if (!this.font.data) {
  36202. return;
  36203. }
  36204. this.font.disableFontFace = true;
  36205. PartialEvaluator.buildFontPaths(this.font, this.font.glyphCacheValues, handler, this._evaluatorOptions);
  36206. }
  36207. loadType3Data(evaluator, resources, task) {
  36208. if (this.type3Loaded) {
  36209. return this.type3Loaded;
  36210. }
  36211. if (!this.font.isType3Font) {
  36212. throw new Error("Must be a Type3 font.");
  36213. }
  36214. const type3Evaluator = evaluator.clone({
  36215. ignoreErrors: false
  36216. });
  36217. const type3FontRefs = new RefSet(evaluator.type3FontRefs);
  36218. if (this.dict.objId && !type3FontRefs.has(this.dict.objId)) {
  36219. type3FontRefs.put(this.dict.objId);
  36220. }
  36221. type3Evaluator.type3FontRefs = type3FontRefs;
  36222. const translatedFont = this.font,
  36223. type3Dependencies = this.type3Dependencies;
  36224. let loadCharProcsPromise = Promise.resolve();
  36225. const charProcs = this.dict.get("CharProcs");
  36226. const fontResources = this.dict.get("Resources") || resources;
  36227. const charProcOperatorList = Object.create(null);
  36228. const fontBBox = Util.normalizeRect(translatedFont.bbox || [0, 0, 0, 0]),
  36229. width = fontBBox[2] - fontBBox[0],
  36230. height = fontBBox[3] - fontBBox[1];
  36231. const fontBBoxSize = Math.hypot(width, height);
  36232. for (const key of charProcs.getKeys()) {
  36233. loadCharProcsPromise = loadCharProcsPromise.then(() => {
  36234. const glyphStream = charProcs.get(key);
  36235. const operatorList = new OperatorList();
  36236. return type3Evaluator.getOperatorList({
  36237. stream: glyphStream,
  36238. task,
  36239. resources: fontResources,
  36240. operatorList
  36241. }).then(() => {
  36242. if (operatorList.fnArray[0] === OPS.setCharWidthAndBounds) {
  36243. this._removeType3ColorOperators(operatorList, fontBBoxSize);
  36244. }
  36245. charProcOperatorList[key] = operatorList.getIR();
  36246. for (const dependency of operatorList.dependencies) {
  36247. type3Dependencies.add(dependency);
  36248. }
  36249. }).catch(function (reason) {
  36250. warn(`Type3 font resource "${key}" is not available.`);
  36251. const dummyOperatorList = new OperatorList();
  36252. charProcOperatorList[key] = dummyOperatorList.getIR();
  36253. });
  36254. });
  36255. }
  36256. this.type3Loaded = loadCharProcsPromise.then(() => {
  36257. translatedFont.charProcOperatorList = charProcOperatorList;
  36258. if (this._bbox) {
  36259. translatedFont.isCharBBox = true;
  36260. translatedFont.bbox = this._bbox;
  36261. }
  36262. });
  36263. return this.type3Loaded;
  36264. }
  36265. _removeType3ColorOperators(operatorList, fontBBoxSize = NaN) {
  36266. const charBBox = Util.normalizeRect(operatorList.argsArray[0].slice(2)),
  36267. width = charBBox[2] - charBBox[0],
  36268. height = charBBox[3] - charBBox[1];
  36269. const charBBoxSize = Math.hypot(width, height);
  36270. if (width === 0 || height === 0) {
  36271. operatorList.fnArray.splice(0, 1);
  36272. operatorList.argsArray.splice(0, 1);
  36273. } else if (fontBBoxSize === 0 || Math.round(charBBoxSize / fontBBoxSize) >= 10) {
  36274. if (!this._bbox) {
  36275. this._bbox = [Infinity, Infinity, -Infinity, -Infinity];
  36276. }
  36277. this._bbox[0] = Math.min(this._bbox[0], charBBox[0]);
  36278. this._bbox[1] = Math.min(this._bbox[1], charBBox[1]);
  36279. this._bbox[2] = Math.max(this._bbox[2], charBBox[2]);
  36280. this._bbox[3] = Math.max(this._bbox[3], charBBox[3]);
  36281. }
  36282. let i = 0,
  36283. ii = operatorList.length;
  36284. while (i < ii) {
  36285. switch (operatorList.fnArray[i]) {
  36286. case OPS.setCharWidthAndBounds:
  36287. break;
  36288. case OPS.setStrokeColorSpace:
  36289. case OPS.setFillColorSpace:
  36290. case OPS.setStrokeColor:
  36291. case OPS.setStrokeColorN:
  36292. case OPS.setFillColor:
  36293. case OPS.setFillColorN:
  36294. case OPS.setStrokeGray:
  36295. case OPS.setFillGray:
  36296. case OPS.setStrokeRGBColor:
  36297. case OPS.setFillRGBColor:
  36298. case OPS.setStrokeCMYKColor:
  36299. case OPS.setFillCMYKColor:
  36300. case OPS.shadingFill:
  36301. case OPS.setRenderingIntent:
  36302. operatorList.fnArray.splice(i, 1);
  36303. operatorList.argsArray.splice(i, 1);
  36304. ii--;
  36305. continue;
  36306. case OPS.setGState:
  36307. const [gStateObj] = operatorList.argsArray[i];
  36308. let j = 0,
  36309. jj = gStateObj.length;
  36310. while (j < jj) {
  36311. const [gStateKey] = gStateObj[j];
  36312. switch (gStateKey) {
  36313. case "TR":
  36314. case "TR2":
  36315. case "HT":
  36316. case "BG":
  36317. case "BG2":
  36318. case "UCR":
  36319. case "UCR2":
  36320. gStateObj.splice(j, 1);
  36321. jj--;
  36322. continue;
  36323. }
  36324. j++;
  36325. }
  36326. break;
  36327. }
  36328. i++;
  36329. }
  36330. }
  36331. }
  36332. class StateManager {
  36333. constructor(initialState = new EvalState()) {
  36334. this.state = initialState;
  36335. this.stateStack = [];
  36336. }
  36337. save() {
  36338. const old = this.state;
  36339. this.stateStack.push(this.state);
  36340. this.state = old.clone();
  36341. }
  36342. restore() {
  36343. const prev = this.stateStack.pop();
  36344. if (prev) {
  36345. this.state = prev;
  36346. }
  36347. }
  36348. transform(args) {
  36349. this.state.ctm = Util.transform(this.state.ctm, args);
  36350. }
  36351. }
  36352. class TextState {
  36353. constructor() {
  36354. this.ctm = new Float32Array(IDENTITY_MATRIX);
  36355. this.fontName = null;
  36356. this.fontSize = 0;
  36357. this.loadedName = null;
  36358. this.font = null;
  36359. this.fontMatrix = FONT_IDENTITY_MATRIX;
  36360. this.textMatrix = IDENTITY_MATRIX.slice();
  36361. this.textLineMatrix = IDENTITY_MATRIX.slice();
  36362. this.charSpacing = 0;
  36363. this.wordSpacing = 0;
  36364. this.leading = 0;
  36365. this.textHScale = 1;
  36366. this.textRise = 0;
  36367. }
  36368. setTextMatrix(a, b, c, d, e, f) {
  36369. const m = this.textMatrix;
  36370. m[0] = a;
  36371. m[1] = b;
  36372. m[2] = c;
  36373. m[3] = d;
  36374. m[4] = e;
  36375. m[5] = f;
  36376. }
  36377. setTextLineMatrix(a, b, c, d, e, f) {
  36378. const m = this.textLineMatrix;
  36379. m[0] = a;
  36380. m[1] = b;
  36381. m[2] = c;
  36382. m[3] = d;
  36383. m[4] = e;
  36384. m[5] = f;
  36385. }
  36386. translateTextMatrix(x, y) {
  36387. const m = this.textMatrix;
  36388. m[4] = m[0] * x + m[2] * y + m[4];
  36389. m[5] = m[1] * x + m[3] * y + m[5];
  36390. }
  36391. translateTextLineMatrix(x, y) {
  36392. const m = this.textLineMatrix;
  36393. m[4] = m[0] * x + m[2] * y + m[4];
  36394. m[5] = m[1] * x + m[3] * y + m[5];
  36395. }
  36396. carriageReturn() {
  36397. this.translateTextLineMatrix(0, -this.leading);
  36398. this.textMatrix = this.textLineMatrix.slice();
  36399. }
  36400. clone() {
  36401. const clone = Object.create(this);
  36402. clone.textMatrix = this.textMatrix.slice();
  36403. clone.textLineMatrix = this.textLineMatrix.slice();
  36404. clone.fontMatrix = this.fontMatrix.slice();
  36405. return clone;
  36406. }
  36407. }
  36408. class EvalState {
  36409. constructor() {
  36410. this.ctm = new Float32Array(IDENTITY_MATRIX);
  36411. this.font = null;
  36412. this.textRenderingMode = TextRenderingMode.FILL;
  36413. this._fillColorSpace = ColorSpace.singletons.gray;
  36414. this._strokeColorSpace = ColorSpace.singletons.gray;
  36415. this.patternFillColorSpace = null;
  36416. this.patternStrokeColorSpace = null;
  36417. }
  36418. get fillColorSpace() {
  36419. return this._fillColorSpace;
  36420. }
  36421. set fillColorSpace(colorSpace) {
  36422. this._fillColorSpace = this.patternFillColorSpace = colorSpace;
  36423. }
  36424. get strokeColorSpace() {
  36425. return this._strokeColorSpace;
  36426. }
  36427. set strokeColorSpace(colorSpace) {
  36428. this._strokeColorSpace = this.patternStrokeColorSpace = colorSpace;
  36429. }
  36430. clone() {
  36431. return Object.create(this);
  36432. }
  36433. }
  36434. class EvaluatorPreprocessor {
  36435. static get opMap() {
  36436. return shadow(this, "opMap", Object.assign(Object.create(null), {
  36437. w: {
  36438. id: OPS.setLineWidth,
  36439. numArgs: 1,
  36440. variableArgs: false
  36441. },
  36442. J: {
  36443. id: OPS.setLineCap,
  36444. numArgs: 1,
  36445. variableArgs: false
  36446. },
  36447. j: {
  36448. id: OPS.setLineJoin,
  36449. numArgs: 1,
  36450. variableArgs: false
  36451. },
  36452. M: {
  36453. id: OPS.setMiterLimit,
  36454. numArgs: 1,
  36455. variableArgs: false
  36456. },
  36457. d: {
  36458. id: OPS.setDash,
  36459. numArgs: 2,
  36460. variableArgs: false
  36461. },
  36462. ri: {
  36463. id: OPS.setRenderingIntent,
  36464. numArgs: 1,
  36465. variableArgs: false
  36466. },
  36467. i: {
  36468. id: OPS.setFlatness,
  36469. numArgs: 1,
  36470. variableArgs: false
  36471. },
  36472. gs: {
  36473. id: OPS.setGState,
  36474. numArgs: 1,
  36475. variableArgs: false
  36476. },
  36477. q: {
  36478. id: OPS.save,
  36479. numArgs: 0,
  36480. variableArgs: false
  36481. },
  36482. Q: {
  36483. id: OPS.restore,
  36484. numArgs: 0,
  36485. variableArgs: false
  36486. },
  36487. cm: {
  36488. id: OPS.transform,
  36489. numArgs: 6,
  36490. variableArgs: false
  36491. },
  36492. m: {
  36493. id: OPS.moveTo,
  36494. numArgs: 2,
  36495. variableArgs: false
  36496. },
  36497. l: {
  36498. id: OPS.lineTo,
  36499. numArgs: 2,
  36500. variableArgs: false
  36501. },
  36502. c: {
  36503. id: OPS.curveTo,
  36504. numArgs: 6,
  36505. variableArgs: false
  36506. },
  36507. v: {
  36508. id: OPS.curveTo2,
  36509. numArgs: 4,
  36510. variableArgs: false
  36511. },
  36512. y: {
  36513. id: OPS.curveTo3,
  36514. numArgs: 4,
  36515. variableArgs: false
  36516. },
  36517. h: {
  36518. id: OPS.closePath,
  36519. numArgs: 0,
  36520. variableArgs: false
  36521. },
  36522. re: {
  36523. id: OPS.rectangle,
  36524. numArgs: 4,
  36525. variableArgs: false
  36526. },
  36527. S: {
  36528. id: OPS.stroke,
  36529. numArgs: 0,
  36530. variableArgs: false
  36531. },
  36532. s: {
  36533. id: OPS.closeStroke,
  36534. numArgs: 0,
  36535. variableArgs: false
  36536. },
  36537. f: {
  36538. id: OPS.fill,
  36539. numArgs: 0,
  36540. variableArgs: false
  36541. },
  36542. F: {
  36543. id: OPS.fill,
  36544. numArgs: 0,
  36545. variableArgs: false
  36546. },
  36547. "f*": {
  36548. id: OPS.eoFill,
  36549. numArgs: 0,
  36550. variableArgs: false
  36551. },
  36552. B: {
  36553. id: OPS.fillStroke,
  36554. numArgs: 0,
  36555. variableArgs: false
  36556. },
  36557. "B*": {
  36558. id: OPS.eoFillStroke,
  36559. numArgs: 0,
  36560. variableArgs: false
  36561. },
  36562. b: {
  36563. id: OPS.closeFillStroke,
  36564. numArgs: 0,
  36565. variableArgs: false
  36566. },
  36567. "b*": {
  36568. id: OPS.closeEOFillStroke,
  36569. numArgs: 0,
  36570. variableArgs: false
  36571. },
  36572. n: {
  36573. id: OPS.endPath,
  36574. numArgs: 0,
  36575. variableArgs: false
  36576. },
  36577. W: {
  36578. id: OPS.clip,
  36579. numArgs: 0,
  36580. variableArgs: false
  36581. },
  36582. "W*": {
  36583. id: OPS.eoClip,
  36584. numArgs: 0,
  36585. variableArgs: false
  36586. },
  36587. BT: {
  36588. id: OPS.beginText,
  36589. numArgs: 0,
  36590. variableArgs: false
  36591. },
  36592. ET: {
  36593. id: OPS.endText,
  36594. numArgs: 0,
  36595. variableArgs: false
  36596. },
  36597. Tc: {
  36598. id: OPS.setCharSpacing,
  36599. numArgs: 1,
  36600. variableArgs: false
  36601. },
  36602. Tw: {
  36603. id: OPS.setWordSpacing,
  36604. numArgs: 1,
  36605. variableArgs: false
  36606. },
  36607. Tz: {
  36608. id: OPS.setHScale,
  36609. numArgs: 1,
  36610. variableArgs: false
  36611. },
  36612. TL: {
  36613. id: OPS.setLeading,
  36614. numArgs: 1,
  36615. variableArgs: false
  36616. },
  36617. Tf: {
  36618. id: OPS.setFont,
  36619. numArgs: 2,
  36620. variableArgs: false
  36621. },
  36622. Tr: {
  36623. id: OPS.setTextRenderingMode,
  36624. numArgs: 1,
  36625. variableArgs: false
  36626. },
  36627. Ts: {
  36628. id: OPS.setTextRise,
  36629. numArgs: 1,
  36630. variableArgs: false
  36631. },
  36632. Td: {
  36633. id: OPS.moveText,
  36634. numArgs: 2,
  36635. variableArgs: false
  36636. },
  36637. TD: {
  36638. id: OPS.setLeadingMoveText,
  36639. numArgs: 2,
  36640. variableArgs: false
  36641. },
  36642. Tm: {
  36643. id: OPS.setTextMatrix,
  36644. numArgs: 6,
  36645. variableArgs: false
  36646. },
  36647. "T*": {
  36648. id: OPS.nextLine,
  36649. numArgs: 0,
  36650. variableArgs: false
  36651. },
  36652. Tj: {
  36653. id: OPS.showText,
  36654. numArgs: 1,
  36655. variableArgs: false
  36656. },
  36657. TJ: {
  36658. id: OPS.showSpacedText,
  36659. numArgs: 1,
  36660. variableArgs: false
  36661. },
  36662. "'": {
  36663. id: OPS.nextLineShowText,
  36664. numArgs: 1,
  36665. variableArgs: false
  36666. },
  36667. '"': {
  36668. id: OPS.nextLineSetSpacingShowText,
  36669. numArgs: 3,
  36670. variableArgs: false
  36671. },
  36672. d0: {
  36673. id: OPS.setCharWidth,
  36674. numArgs: 2,
  36675. variableArgs: false
  36676. },
  36677. d1: {
  36678. id: OPS.setCharWidthAndBounds,
  36679. numArgs: 6,
  36680. variableArgs: false
  36681. },
  36682. CS: {
  36683. id: OPS.setStrokeColorSpace,
  36684. numArgs: 1,
  36685. variableArgs: false
  36686. },
  36687. cs: {
  36688. id: OPS.setFillColorSpace,
  36689. numArgs: 1,
  36690. variableArgs: false
  36691. },
  36692. SC: {
  36693. id: OPS.setStrokeColor,
  36694. numArgs: 4,
  36695. variableArgs: true
  36696. },
  36697. SCN: {
  36698. id: OPS.setStrokeColorN,
  36699. numArgs: 33,
  36700. variableArgs: true
  36701. },
  36702. sc: {
  36703. id: OPS.setFillColor,
  36704. numArgs: 4,
  36705. variableArgs: true
  36706. },
  36707. scn: {
  36708. id: OPS.setFillColorN,
  36709. numArgs: 33,
  36710. variableArgs: true
  36711. },
  36712. G: {
  36713. id: OPS.setStrokeGray,
  36714. numArgs: 1,
  36715. variableArgs: false
  36716. },
  36717. g: {
  36718. id: OPS.setFillGray,
  36719. numArgs: 1,
  36720. variableArgs: false
  36721. },
  36722. RG: {
  36723. id: OPS.setStrokeRGBColor,
  36724. numArgs: 3,
  36725. variableArgs: false
  36726. },
  36727. rg: {
  36728. id: OPS.setFillRGBColor,
  36729. numArgs: 3,
  36730. variableArgs: false
  36731. },
  36732. K: {
  36733. id: OPS.setStrokeCMYKColor,
  36734. numArgs: 4,
  36735. variableArgs: false
  36736. },
  36737. k: {
  36738. id: OPS.setFillCMYKColor,
  36739. numArgs: 4,
  36740. variableArgs: false
  36741. },
  36742. sh: {
  36743. id: OPS.shadingFill,
  36744. numArgs: 1,
  36745. variableArgs: false
  36746. },
  36747. BI: {
  36748. id: OPS.beginInlineImage,
  36749. numArgs: 0,
  36750. variableArgs: false
  36751. },
  36752. ID: {
  36753. id: OPS.beginImageData,
  36754. numArgs: 0,
  36755. variableArgs: false
  36756. },
  36757. EI: {
  36758. id: OPS.endInlineImage,
  36759. numArgs: 1,
  36760. variableArgs: false
  36761. },
  36762. Do: {
  36763. id: OPS.paintXObject,
  36764. numArgs: 1,
  36765. variableArgs: false
  36766. },
  36767. MP: {
  36768. id: OPS.markPoint,
  36769. numArgs: 1,
  36770. variableArgs: false
  36771. },
  36772. DP: {
  36773. id: OPS.markPointProps,
  36774. numArgs: 2,
  36775. variableArgs: false
  36776. },
  36777. BMC: {
  36778. id: OPS.beginMarkedContent,
  36779. numArgs: 1,
  36780. variableArgs: false
  36781. },
  36782. BDC: {
  36783. id: OPS.beginMarkedContentProps,
  36784. numArgs: 2,
  36785. variableArgs: false
  36786. },
  36787. EMC: {
  36788. id: OPS.endMarkedContent,
  36789. numArgs: 0,
  36790. variableArgs: false
  36791. },
  36792. BX: {
  36793. id: OPS.beginCompat,
  36794. numArgs: 0,
  36795. variableArgs: false
  36796. },
  36797. EX: {
  36798. id: OPS.endCompat,
  36799. numArgs: 0,
  36800. variableArgs: false
  36801. },
  36802. BM: null,
  36803. BD: null,
  36804. true: null,
  36805. fa: null,
  36806. fal: null,
  36807. fals: null,
  36808. false: null,
  36809. nu: null,
  36810. nul: null,
  36811. null: null
  36812. }));
  36813. }
  36814. static MAX_INVALID_PATH_OPS = 10;
  36815. constructor(stream, xref, stateManager = new StateManager()) {
  36816. this.parser = new Parser({
  36817. lexer: new Lexer(stream, EvaluatorPreprocessor.opMap),
  36818. xref
  36819. });
  36820. this.stateManager = stateManager;
  36821. this.nonProcessedArgs = [];
  36822. this._isPathOp = false;
  36823. this._numInvalidPathOPS = 0;
  36824. }
  36825. get savedStatesDepth() {
  36826. return this.stateManager.stateStack.length;
  36827. }
  36828. read(operation) {
  36829. let args = operation.args;
  36830. while (true) {
  36831. const obj = this.parser.getObj();
  36832. if (obj instanceof Cmd) {
  36833. const cmd = obj.cmd;
  36834. const opSpec = EvaluatorPreprocessor.opMap[cmd];
  36835. if (!opSpec) {
  36836. warn(`Unknown command "${cmd}".`);
  36837. continue;
  36838. }
  36839. const fn = opSpec.id;
  36840. const numArgs = opSpec.numArgs;
  36841. let argsLength = args !== null ? args.length : 0;
  36842. if (!this._isPathOp) {
  36843. this._numInvalidPathOPS = 0;
  36844. }
  36845. this._isPathOp = fn >= OPS.moveTo && fn <= OPS.endPath;
  36846. if (!opSpec.variableArgs) {
  36847. if (argsLength !== numArgs) {
  36848. const nonProcessedArgs = this.nonProcessedArgs;
  36849. while (argsLength > numArgs) {
  36850. nonProcessedArgs.push(args.shift());
  36851. argsLength--;
  36852. }
  36853. while (argsLength < numArgs && nonProcessedArgs.length !== 0) {
  36854. if (args === null) {
  36855. args = [];
  36856. }
  36857. args.unshift(nonProcessedArgs.pop());
  36858. argsLength++;
  36859. }
  36860. }
  36861. if (argsLength < numArgs) {
  36862. const partialMsg = `command ${cmd}: expected ${numArgs} args, ` + `but received ${argsLength} args.`;
  36863. if (this._isPathOp && ++this._numInvalidPathOPS > EvaluatorPreprocessor.MAX_INVALID_PATH_OPS) {
  36864. throw new FormatError(`Invalid ${partialMsg}`);
  36865. }
  36866. warn(`Skipping ${partialMsg}`);
  36867. if (args !== null) {
  36868. args.length = 0;
  36869. }
  36870. continue;
  36871. }
  36872. } else if (argsLength > numArgs) {
  36873. info(`Command ${cmd}: expected [0, ${numArgs}] args, ` + `but received ${argsLength} args.`);
  36874. }
  36875. this.preprocessCommand(fn, args);
  36876. operation.fn = fn;
  36877. operation.args = args;
  36878. return true;
  36879. }
  36880. if (obj === EOF) {
  36881. return false;
  36882. }
  36883. if (obj !== null) {
  36884. if (args === null) {
  36885. args = [];
  36886. }
  36887. args.push(obj);
  36888. if (args.length > 33) {
  36889. throw new FormatError("Too many arguments");
  36890. }
  36891. }
  36892. }
  36893. }
  36894. preprocessCommand(fn, args) {
  36895. switch (fn | 0) {
  36896. case OPS.save:
  36897. this.stateManager.save();
  36898. break;
  36899. case OPS.restore:
  36900. this.stateManager.restore();
  36901. break;
  36902. case OPS.transform:
  36903. this.stateManager.transform(args);
  36904. break;
  36905. }
  36906. }
  36907. }
  36908. ;// ./src/core/default_appearance.js
  36909. class DefaultAppearanceEvaluator extends EvaluatorPreprocessor {
  36910. constructor(str) {
  36911. super(new StringStream(str));
  36912. }
  36913. parse() {
  36914. const operation = {
  36915. fn: 0,
  36916. args: []
  36917. };
  36918. const result = {
  36919. fontSize: 0,
  36920. fontName: "",
  36921. fontColor: new Uint8ClampedArray(3)
  36922. };
  36923. try {
  36924. while (true) {
  36925. operation.args.length = 0;
  36926. if (!this.read(operation)) {
  36927. break;
  36928. }
  36929. if (this.savedStatesDepth !== 0) {
  36930. continue;
  36931. }
  36932. const {
  36933. fn,
  36934. args
  36935. } = operation;
  36936. switch (fn | 0) {
  36937. case OPS.setFont:
  36938. const [fontName, fontSize] = args;
  36939. if (fontName instanceof Name) {
  36940. result.fontName = fontName.name;
  36941. }
  36942. if (typeof fontSize === "number" && fontSize > 0) {
  36943. result.fontSize = fontSize;
  36944. }
  36945. break;
  36946. case OPS.setFillRGBColor:
  36947. ColorSpace.singletons.rgb.getRgbItem(args, 0, result.fontColor, 0);
  36948. break;
  36949. case OPS.setFillGray:
  36950. ColorSpace.singletons.gray.getRgbItem(args, 0, result.fontColor, 0);
  36951. break;
  36952. case OPS.setFillCMYKColor:
  36953. ColorSpace.singletons.cmyk.getRgbItem(args, 0, result.fontColor, 0);
  36954. break;
  36955. }
  36956. }
  36957. } catch (reason) {
  36958. warn(`parseDefaultAppearance - ignoring errors: "${reason}".`);
  36959. }
  36960. return result;
  36961. }
  36962. }
  36963. function parseDefaultAppearance(str) {
  36964. return new DefaultAppearanceEvaluator(str).parse();
  36965. }
  36966. class AppearanceStreamEvaluator extends EvaluatorPreprocessor {
  36967. constructor(stream, evaluatorOptions, xref) {
  36968. super(stream);
  36969. this.stream = stream;
  36970. this.evaluatorOptions = evaluatorOptions;
  36971. this.xref = xref;
  36972. this.resources = stream.dict?.get("Resources");
  36973. }
  36974. parse() {
  36975. const operation = {
  36976. fn: 0,
  36977. args: []
  36978. };
  36979. let result = {
  36980. scaleFactor: 1,
  36981. fontSize: 0,
  36982. fontName: "",
  36983. fontColor: new Uint8ClampedArray(3),
  36984. fillColorSpace: ColorSpace.singletons.gray
  36985. };
  36986. let breakLoop = false;
  36987. const stack = [];
  36988. try {
  36989. while (true) {
  36990. operation.args.length = 0;
  36991. if (breakLoop || !this.read(operation)) {
  36992. break;
  36993. }
  36994. const {
  36995. fn,
  36996. args
  36997. } = operation;
  36998. switch (fn | 0) {
  36999. case OPS.save:
  37000. stack.push({
  37001. scaleFactor: result.scaleFactor,
  37002. fontSize: result.fontSize,
  37003. fontName: result.fontName,
  37004. fontColor: result.fontColor.slice(),
  37005. fillColorSpace: result.fillColorSpace
  37006. });
  37007. break;
  37008. case OPS.restore:
  37009. result = stack.pop() || result;
  37010. break;
  37011. case OPS.setTextMatrix:
  37012. result.scaleFactor *= Math.hypot(args[0], args[1]);
  37013. break;
  37014. case OPS.setFont:
  37015. const [fontName, fontSize] = args;
  37016. if (fontName instanceof Name) {
  37017. result.fontName = fontName.name;
  37018. }
  37019. if (typeof fontSize === "number" && fontSize > 0) {
  37020. result.fontSize = fontSize * result.scaleFactor;
  37021. }
  37022. break;
  37023. case OPS.setFillColorSpace:
  37024. result.fillColorSpace = ColorSpace.parse({
  37025. cs: args[0],
  37026. xref: this.xref,
  37027. resources: this.resources,
  37028. pdfFunctionFactory: this._pdfFunctionFactory,
  37029. localColorSpaceCache: this._localColorSpaceCache
  37030. });
  37031. break;
  37032. case OPS.setFillColor:
  37033. const cs = result.fillColorSpace;
  37034. cs.getRgbItem(args, 0, result.fontColor, 0);
  37035. break;
  37036. case OPS.setFillRGBColor:
  37037. ColorSpace.singletons.rgb.getRgbItem(args, 0, result.fontColor, 0);
  37038. break;
  37039. case OPS.setFillGray:
  37040. ColorSpace.singletons.gray.getRgbItem(args, 0, result.fontColor, 0);
  37041. break;
  37042. case OPS.setFillCMYKColor:
  37043. ColorSpace.singletons.cmyk.getRgbItem(args, 0, result.fontColor, 0);
  37044. break;
  37045. case OPS.showText:
  37046. case OPS.showSpacedText:
  37047. case OPS.nextLineShowText:
  37048. case OPS.nextLineSetSpacingShowText:
  37049. breakLoop = true;
  37050. break;
  37051. }
  37052. }
  37053. } catch (reason) {
  37054. warn(`parseAppearanceStream - ignoring errors: "${reason}".`);
  37055. }
  37056. this.stream.reset();
  37057. delete result.scaleFactor;
  37058. delete result.fillColorSpace;
  37059. return result;
  37060. }
  37061. get _localColorSpaceCache() {
  37062. return shadow(this, "_localColorSpaceCache", new LocalColorSpaceCache());
  37063. }
  37064. get _pdfFunctionFactory() {
  37065. const pdfFunctionFactory = new PDFFunctionFactory({
  37066. xref: this.xref,
  37067. isEvalSupported: this.evaluatorOptions.isEvalSupported
  37068. });
  37069. return shadow(this, "_pdfFunctionFactory", pdfFunctionFactory);
  37070. }
  37071. }
  37072. function parseAppearanceStream(stream, evaluatorOptions, xref) {
  37073. return new AppearanceStreamEvaluator(stream, evaluatorOptions, xref).parse();
  37074. }
  37075. function getPdfColor(color, isFill) {
  37076. if (color[0] === color[1] && color[1] === color[2]) {
  37077. const gray = color[0] / 255;
  37078. return `${numberToString(gray)} ${isFill ? "g" : "G"}`;
  37079. }
  37080. return Array.from(color, c => numberToString(c / 255)).join(" ") + ` ${isFill ? "rg" : "RG"}`;
  37081. }
  37082. function createDefaultAppearance({
  37083. fontSize,
  37084. fontName,
  37085. fontColor
  37086. }) {
  37087. return `/${escapePDFName(fontName)} ${fontSize} Tf ${getPdfColor(fontColor, true)}`;
  37088. }
  37089. class FakeUnicodeFont {
  37090. constructor(xref, fontFamily) {
  37091. this.xref = xref;
  37092. this.widths = null;
  37093. this.firstChar = Infinity;
  37094. this.lastChar = -Infinity;
  37095. this.fontFamily = fontFamily;
  37096. const canvas = new OffscreenCanvas(1, 1);
  37097. this.ctxMeasure = canvas.getContext("2d", {
  37098. willReadFrequently: true
  37099. });
  37100. if (!FakeUnicodeFont._fontNameId) {
  37101. FakeUnicodeFont._fontNameId = 1;
  37102. }
  37103. this.fontName = Name.get(`InvalidPDFjsFont_${fontFamily}_${FakeUnicodeFont._fontNameId++}`);
  37104. }
  37105. get fontDescriptorRef() {
  37106. if (!FakeUnicodeFont._fontDescriptorRef) {
  37107. const fontDescriptor = new Dict(this.xref);
  37108. fontDescriptor.set("Type", Name.get("FontDescriptor"));
  37109. fontDescriptor.set("FontName", this.fontName);
  37110. fontDescriptor.set("FontFamily", "MyriadPro Regular");
  37111. fontDescriptor.set("FontBBox", [0, 0, 0, 0]);
  37112. fontDescriptor.set("FontStretch", Name.get("Normal"));
  37113. fontDescriptor.set("FontWeight", 400);
  37114. fontDescriptor.set("ItalicAngle", 0);
  37115. FakeUnicodeFont._fontDescriptorRef = this.xref.getNewPersistentRef(fontDescriptor);
  37116. }
  37117. return FakeUnicodeFont._fontDescriptorRef;
  37118. }
  37119. get descendantFontRef() {
  37120. const descendantFont = new Dict(this.xref);
  37121. descendantFont.set("BaseFont", this.fontName);
  37122. descendantFont.set("Type", Name.get("Font"));
  37123. descendantFont.set("Subtype", Name.get("CIDFontType0"));
  37124. descendantFont.set("CIDToGIDMap", Name.get("Identity"));
  37125. descendantFont.set("FirstChar", this.firstChar);
  37126. descendantFont.set("LastChar", this.lastChar);
  37127. descendantFont.set("FontDescriptor", this.fontDescriptorRef);
  37128. descendantFont.set("DW", 1000);
  37129. const widths = [];
  37130. const chars = [...this.widths.entries()].sort();
  37131. let currentChar = null;
  37132. let currentWidths = null;
  37133. for (const [char, width] of chars) {
  37134. if (!currentChar) {
  37135. currentChar = char;
  37136. currentWidths = [width];
  37137. continue;
  37138. }
  37139. if (char === currentChar + currentWidths.length) {
  37140. currentWidths.push(width);
  37141. } else {
  37142. widths.push(currentChar, currentWidths);
  37143. currentChar = char;
  37144. currentWidths = [width];
  37145. }
  37146. }
  37147. if (currentChar) {
  37148. widths.push(currentChar, currentWidths);
  37149. }
  37150. descendantFont.set("W", widths);
  37151. const cidSystemInfo = new Dict(this.xref);
  37152. cidSystemInfo.set("Ordering", "Identity");
  37153. cidSystemInfo.set("Registry", "Adobe");
  37154. cidSystemInfo.set("Supplement", 0);
  37155. descendantFont.set("CIDSystemInfo", cidSystemInfo);
  37156. return this.xref.getNewPersistentRef(descendantFont);
  37157. }
  37158. get baseFontRef() {
  37159. const baseFont = new Dict(this.xref);
  37160. baseFont.set("BaseFont", this.fontName);
  37161. baseFont.set("Type", Name.get("Font"));
  37162. baseFont.set("Subtype", Name.get("Type0"));
  37163. baseFont.set("Encoding", Name.get("Identity-H"));
  37164. baseFont.set("DescendantFonts", [this.descendantFontRef]);
  37165. baseFont.set("ToUnicode", Name.get("Identity-H"));
  37166. return this.xref.getNewPersistentRef(baseFont);
  37167. }
  37168. get resources() {
  37169. const resources = new Dict(this.xref);
  37170. const font = new Dict(this.xref);
  37171. font.set(this.fontName.name, this.baseFontRef);
  37172. resources.set("Font", font);
  37173. return resources;
  37174. }
  37175. _createContext() {
  37176. this.widths = new Map();
  37177. this.ctxMeasure.font = `1000px ${this.fontFamily}`;
  37178. return this.ctxMeasure;
  37179. }
  37180. createFontResources(text) {
  37181. const ctx = this._createContext();
  37182. for (const line of text.split(/\r\n?|\n/)) {
  37183. for (const char of line.split("")) {
  37184. const code = char.charCodeAt(0);
  37185. if (this.widths.has(code)) {
  37186. continue;
  37187. }
  37188. const metrics = ctx.measureText(char);
  37189. const width = Math.ceil(metrics.width);
  37190. this.widths.set(code, width);
  37191. this.firstChar = Math.min(code, this.firstChar);
  37192. this.lastChar = Math.max(code, this.lastChar);
  37193. }
  37194. }
  37195. return this.resources;
  37196. }
  37197. static getFirstPositionInfo(rect, rotation, fontSize) {
  37198. const [x1, y1, x2, y2] = rect;
  37199. let w = x2 - x1;
  37200. let h = y2 - y1;
  37201. if (rotation % 180 !== 0) {
  37202. [w, h] = [h, w];
  37203. }
  37204. const lineHeight = LINE_FACTOR * fontSize;
  37205. const lineDescent = LINE_DESCENT_FACTOR * fontSize;
  37206. return {
  37207. coords: [0, h + lineDescent - lineHeight],
  37208. bbox: [0, 0, w, h],
  37209. matrix: rotation !== 0 ? getRotationMatrix(rotation, h, lineHeight) : undefined
  37210. };
  37211. }
  37212. createAppearance(text, rect, rotation, fontSize, bgColor, strokeAlpha) {
  37213. const ctx = this._createContext();
  37214. const lines = [];
  37215. let maxWidth = -Infinity;
  37216. for (const line of text.split(/\r\n?|\n/)) {
  37217. lines.push(line);
  37218. const lineWidth = ctx.measureText(line).width;
  37219. maxWidth = Math.max(maxWidth, lineWidth);
  37220. for (const code of codePointIter(line)) {
  37221. const char = String.fromCodePoint(code);
  37222. let width = this.widths.get(code);
  37223. if (width === undefined) {
  37224. const metrics = ctx.measureText(char);
  37225. width = Math.ceil(metrics.width);
  37226. this.widths.set(code, width);
  37227. this.firstChar = Math.min(code, this.firstChar);
  37228. this.lastChar = Math.max(code, this.lastChar);
  37229. }
  37230. }
  37231. }
  37232. maxWidth *= fontSize / 1000;
  37233. const [x1, y1, x2, y2] = rect;
  37234. let w = x2 - x1;
  37235. let h = y2 - y1;
  37236. if (rotation % 180 !== 0) {
  37237. [w, h] = [h, w];
  37238. }
  37239. let hscale = 1;
  37240. if (maxWidth > w) {
  37241. hscale = w / maxWidth;
  37242. }
  37243. let vscale = 1;
  37244. const lineHeight = LINE_FACTOR * fontSize;
  37245. const lineDescent = LINE_DESCENT_FACTOR * fontSize;
  37246. const maxHeight = lineHeight * lines.length;
  37247. if (maxHeight > h) {
  37248. vscale = h / maxHeight;
  37249. }
  37250. const fscale = Math.min(hscale, vscale);
  37251. const newFontSize = fontSize * fscale;
  37252. const buffer = ["q", `0 0 ${numberToString(w)} ${numberToString(h)} re W n`, `BT`, `1 0 0 1 0 ${numberToString(h + lineDescent)} Tm 0 Tc ${getPdfColor(bgColor, true)}`, `/${this.fontName.name} ${numberToString(newFontSize)} Tf`];
  37253. const {
  37254. resources
  37255. } = this;
  37256. strokeAlpha = typeof strokeAlpha === "number" && strokeAlpha >= 0 && strokeAlpha <= 1 ? strokeAlpha : 1;
  37257. if (strokeAlpha !== 1) {
  37258. buffer.push("/R0 gs");
  37259. const extGState = new Dict(this.xref);
  37260. const r0 = new Dict(this.xref);
  37261. r0.set("ca", strokeAlpha);
  37262. r0.set("CA", strokeAlpha);
  37263. r0.set("Type", Name.get("ExtGState"));
  37264. extGState.set("R0", r0);
  37265. resources.set("ExtGState", extGState);
  37266. }
  37267. const vShift = numberToString(lineHeight);
  37268. for (const line of lines) {
  37269. buffer.push(`0 -${vShift} Td <${stringToUTF16HexString(line)}> Tj`);
  37270. }
  37271. buffer.push("ET", "Q");
  37272. const appearance = buffer.join("\n");
  37273. const appearanceStreamDict = new Dict(this.xref);
  37274. appearanceStreamDict.set("Subtype", Name.get("Form"));
  37275. appearanceStreamDict.set("Type", Name.get("XObject"));
  37276. appearanceStreamDict.set("BBox", [0, 0, w, h]);
  37277. appearanceStreamDict.set("Length", appearance.length);
  37278. appearanceStreamDict.set("Resources", resources);
  37279. if (rotation) {
  37280. const matrix = getRotationMatrix(rotation, w, h);
  37281. appearanceStreamDict.set("Matrix", matrix);
  37282. }
  37283. const ap = new StringStream(appearance);
  37284. ap.dict = appearanceStreamDict;
  37285. return ap;
  37286. }
  37287. }
  37288. ;// ./src/core/name_number_tree.js
  37289. class NameOrNumberTree {
  37290. constructor(root, xref, type) {
  37291. this.root = root;
  37292. this.xref = xref;
  37293. this._type = type;
  37294. }
  37295. getAll() {
  37296. const map = new Map();
  37297. if (!this.root) {
  37298. return map;
  37299. }
  37300. const xref = this.xref;
  37301. const processed = new RefSet();
  37302. processed.put(this.root);
  37303. const queue = [this.root];
  37304. while (queue.length > 0) {
  37305. const obj = xref.fetchIfRef(queue.shift());
  37306. if (!(obj instanceof Dict)) {
  37307. continue;
  37308. }
  37309. if (obj.has("Kids")) {
  37310. const kids = obj.get("Kids");
  37311. if (!Array.isArray(kids)) {
  37312. continue;
  37313. }
  37314. for (const kid of kids) {
  37315. if (processed.has(kid)) {
  37316. throw new FormatError(`Duplicate entry in "${this._type}" tree.`);
  37317. }
  37318. queue.push(kid);
  37319. processed.put(kid);
  37320. }
  37321. continue;
  37322. }
  37323. const entries = obj.get(this._type);
  37324. if (!Array.isArray(entries)) {
  37325. continue;
  37326. }
  37327. for (let i = 0, ii = entries.length; i < ii; i += 2) {
  37328. map.set(xref.fetchIfRef(entries[i]), xref.fetchIfRef(entries[i + 1]));
  37329. }
  37330. }
  37331. return map;
  37332. }
  37333. getRaw(key) {
  37334. if (!this.root) {
  37335. return null;
  37336. }
  37337. const xref = this.xref;
  37338. let kidsOrEntries = xref.fetchIfRef(this.root);
  37339. let loopCount = 0;
  37340. const MAX_LEVELS = 10;
  37341. while (kidsOrEntries.has("Kids")) {
  37342. if (++loopCount > MAX_LEVELS) {
  37343. warn(`Search depth limit reached for "${this._type}" tree.`);
  37344. return null;
  37345. }
  37346. const kids = kidsOrEntries.get("Kids");
  37347. if (!Array.isArray(kids)) {
  37348. return null;
  37349. }
  37350. let l = 0,
  37351. r = kids.length - 1;
  37352. while (l <= r) {
  37353. const m = l + r >> 1;
  37354. const kid = xref.fetchIfRef(kids[m]);
  37355. const limits = kid.get("Limits");
  37356. if (key < xref.fetchIfRef(limits[0])) {
  37357. r = m - 1;
  37358. } else if (key > xref.fetchIfRef(limits[1])) {
  37359. l = m + 1;
  37360. } else {
  37361. kidsOrEntries = kid;
  37362. break;
  37363. }
  37364. }
  37365. if (l > r) {
  37366. return null;
  37367. }
  37368. }
  37369. const entries = kidsOrEntries.get(this._type);
  37370. if (Array.isArray(entries)) {
  37371. let l = 0,
  37372. r = entries.length - 2;
  37373. while (l <= r) {
  37374. const tmp = l + r >> 1,
  37375. m = tmp + (tmp & 1);
  37376. const currentKey = xref.fetchIfRef(entries[m]);
  37377. if (key < currentKey) {
  37378. r = m - 2;
  37379. } else if (key > currentKey) {
  37380. l = m + 2;
  37381. } else {
  37382. return entries[m + 1];
  37383. }
  37384. }
  37385. }
  37386. return null;
  37387. }
  37388. get(key) {
  37389. return this.xref.fetchIfRef(this.getRaw(key));
  37390. }
  37391. }
  37392. class NameTree extends NameOrNumberTree {
  37393. constructor(root, xref) {
  37394. super(root, xref, "Names");
  37395. }
  37396. }
  37397. class NumberTree extends NameOrNumberTree {
  37398. constructor(root, xref) {
  37399. super(root, xref, "Nums");
  37400. }
  37401. }
  37402. ;// ./src/core/cleanup_helper.js
  37403. function clearGlobalCaches() {
  37404. clearPatternCaches();
  37405. clearPrimitiveCaches();
  37406. clearUnicodeCaches();
  37407. JpxImage.cleanup();
  37408. }
  37409. ;// ./src/core/file_spec.js
  37410. function pickPlatformItem(dict) {
  37411. if (!(dict instanceof Dict)) {
  37412. return null;
  37413. }
  37414. if (dict.has("UF")) {
  37415. return dict.get("UF");
  37416. } else if (dict.has("F")) {
  37417. return dict.get("F");
  37418. } else if (dict.has("Unix")) {
  37419. return dict.get("Unix");
  37420. } else if (dict.has("Mac")) {
  37421. return dict.get("Mac");
  37422. } else if (dict.has("DOS")) {
  37423. return dict.get("DOS");
  37424. }
  37425. return null;
  37426. }
  37427. function stripPath(str) {
  37428. return str.substring(str.lastIndexOf("/") + 1);
  37429. }
  37430. class FileSpec {
  37431. #contentAvailable = false;
  37432. constructor(root, xref, skipContent = false) {
  37433. if (!(root instanceof Dict)) {
  37434. return;
  37435. }
  37436. this.xref = xref;
  37437. this.root = root;
  37438. if (root.has("FS")) {
  37439. this.fs = root.get("FS");
  37440. }
  37441. if (root.has("RF")) {
  37442. warn("Related file specifications are not supported");
  37443. }
  37444. if (!skipContent) {
  37445. if (root.has("EF")) {
  37446. this.#contentAvailable = true;
  37447. } else {
  37448. warn("Non-embedded file specifications are not supported");
  37449. }
  37450. }
  37451. }
  37452. get filename() {
  37453. let filename = "";
  37454. const item = pickPlatformItem(this.root);
  37455. if (item && typeof item === "string") {
  37456. filename = stringToPDFString(item).replaceAll("\\\\", "\\").replaceAll("\\/", "/").replaceAll("\\", "/");
  37457. }
  37458. return shadow(this, "filename", filename || "unnamed");
  37459. }
  37460. get content() {
  37461. if (!this.#contentAvailable) {
  37462. return null;
  37463. }
  37464. this._contentRef ||= pickPlatformItem(this.root?.get("EF"));
  37465. let content = null;
  37466. if (this._contentRef) {
  37467. const fileObj = this.xref.fetchIfRef(this._contentRef);
  37468. if (fileObj instanceof BaseStream) {
  37469. content = fileObj.getBytes();
  37470. } else {
  37471. warn("Embedded file specification points to non-existing/invalid content");
  37472. }
  37473. } else {
  37474. warn("Embedded file specification does not have any content");
  37475. }
  37476. return content;
  37477. }
  37478. get description() {
  37479. let description = "";
  37480. const desc = this.root?.get("Desc");
  37481. if (desc && typeof desc === "string") {
  37482. description = stringToPDFString(desc);
  37483. }
  37484. return shadow(this, "description", description);
  37485. }
  37486. get serializable() {
  37487. return {
  37488. rawFilename: this.filename,
  37489. filename: stripPath(this.filename),
  37490. content: this.content,
  37491. description: this.description
  37492. };
  37493. }
  37494. }
  37495. ;// ./src/core/xml_parser.js
  37496. const XMLParserErrorCode = {
  37497. NoError: 0,
  37498. EndOfDocument: -1,
  37499. UnterminatedCdat: -2,
  37500. UnterminatedXmlDeclaration: -3,
  37501. UnterminatedDoctypeDeclaration: -4,
  37502. UnterminatedComment: -5,
  37503. MalformedElement: -6,
  37504. OutOfMemory: -7,
  37505. UnterminatedAttributeValue: -8,
  37506. UnterminatedElement: -9,
  37507. ElementNeverBegun: -10
  37508. };
  37509. function isWhitespace(s, index) {
  37510. const ch = s[index];
  37511. return ch === " " || ch === "\n" || ch === "\r" || ch === "\t";
  37512. }
  37513. function isWhitespaceString(s) {
  37514. for (let i = 0, ii = s.length; i < ii; i++) {
  37515. if (!isWhitespace(s, i)) {
  37516. return false;
  37517. }
  37518. }
  37519. return true;
  37520. }
  37521. class XMLParserBase {
  37522. _resolveEntities(s) {
  37523. return s.replaceAll(/&([^;]+);/g, (all, entity) => {
  37524. if (entity.substring(0, 2) === "#x") {
  37525. return String.fromCodePoint(parseInt(entity.substring(2), 16));
  37526. } else if (entity.substring(0, 1) === "#") {
  37527. return String.fromCodePoint(parseInt(entity.substring(1), 10));
  37528. }
  37529. switch (entity) {
  37530. case "lt":
  37531. return "<";
  37532. case "gt":
  37533. return ">";
  37534. case "amp":
  37535. return "&";
  37536. case "quot":
  37537. return '"';
  37538. case "apos":
  37539. return "'";
  37540. }
  37541. return this.onResolveEntity(entity);
  37542. });
  37543. }
  37544. _parseContent(s, start) {
  37545. const attributes = [];
  37546. let pos = start;
  37547. function skipWs() {
  37548. while (pos < s.length && isWhitespace(s, pos)) {
  37549. ++pos;
  37550. }
  37551. }
  37552. while (pos < s.length && !isWhitespace(s, pos) && s[pos] !== ">" && s[pos] !== "/") {
  37553. ++pos;
  37554. }
  37555. const name = s.substring(start, pos);
  37556. skipWs();
  37557. while (pos < s.length && s[pos] !== ">" && s[pos] !== "/" && s[pos] !== "?") {
  37558. skipWs();
  37559. let attrName = "",
  37560. attrValue = "";
  37561. while (pos < s.length && !isWhitespace(s, pos) && s[pos] !== "=") {
  37562. attrName += s[pos];
  37563. ++pos;
  37564. }
  37565. skipWs();
  37566. if (s[pos] !== "=") {
  37567. return null;
  37568. }
  37569. ++pos;
  37570. skipWs();
  37571. const attrEndChar = s[pos];
  37572. if (attrEndChar !== '"' && attrEndChar !== "'") {
  37573. return null;
  37574. }
  37575. const attrEndIndex = s.indexOf(attrEndChar, ++pos);
  37576. if (attrEndIndex < 0) {
  37577. return null;
  37578. }
  37579. attrValue = s.substring(pos, attrEndIndex);
  37580. attributes.push({
  37581. name: attrName,
  37582. value: this._resolveEntities(attrValue)
  37583. });
  37584. pos = attrEndIndex + 1;
  37585. skipWs();
  37586. }
  37587. return {
  37588. name,
  37589. attributes,
  37590. parsed: pos - start
  37591. };
  37592. }
  37593. _parseProcessingInstruction(s, start) {
  37594. let pos = start;
  37595. function skipWs() {
  37596. while (pos < s.length && isWhitespace(s, pos)) {
  37597. ++pos;
  37598. }
  37599. }
  37600. while (pos < s.length && !isWhitespace(s, pos) && s[pos] !== ">" && s[pos] !== "?" && s[pos] !== "/") {
  37601. ++pos;
  37602. }
  37603. const name = s.substring(start, pos);
  37604. skipWs();
  37605. const attrStart = pos;
  37606. while (pos < s.length && (s[pos] !== "?" || s[pos + 1] !== ">")) {
  37607. ++pos;
  37608. }
  37609. const value = s.substring(attrStart, pos);
  37610. return {
  37611. name,
  37612. value,
  37613. parsed: pos - start
  37614. };
  37615. }
  37616. parseXml(s) {
  37617. let i = 0;
  37618. while (i < s.length) {
  37619. const ch = s[i];
  37620. let j = i;
  37621. if (ch === "<") {
  37622. ++j;
  37623. const ch2 = s[j];
  37624. let q;
  37625. switch (ch2) {
  37626. case "/":
  37627. ++j;
  37628. q = s.indexOf(">", j);
  37629. if (q < 0) {
  37630. this.onError(XMLParserErrorCode.UnterminatedElement);
  37631. return;
  37632. }
  37633. this.onEndElement(s.substring(j, q));
  37634. j = q + 1;
  37635. break;
  37636. case "?":
  37637. ++j;
  37638. const pi = this._parseProcessingInstruction(s, j);
  37639. if (s.substring(j + pi.parsed, j + pi.parsed + 2) !== "?>") {
  37640. this.onError(XMLParserErrorCode.UnterminatedXmlDeclaration);
  37641. return;
  37642. }
  37643. this.onPi(pi.name, pi.value);
  37644. j += pi.parsed + 2;
  37645. break;
  37646. case "!":
  37647. if (s.substring(j + 1, j + 3) === "--") {
  37648. q = s.indexOf("-->", j + 3);
  37649. if (q < 0) {
  37650. this.onError(XMLParserErrorCode.UnterminatedComment);
  37651. return;
  37652. }
  37653. this.onComment(s.substring(j + 3, q));
  37654. j = q + 3;
  37655. } else if (s.substring(j + 1, j + 8) === "[CDATA[") {
  37656. q = s.indexOf("]]>", j + 8);
  37657. if (q < 0) {
  37658. this.onError(XMLParserErrorCode.UnterminatedCdat);
  37659. return;
  37660. }
  37661. this.onCdata(s.substring(j + 8, q));
  37662. j = q + 3;
  37663. } else if (s.substring(j + 1, j + 8) === "DOCTYPE") {
  37664. const q2 = s.indexOf("[", j + 8);
  37665. let complexDoctype = false;
  37666. q = s.indexOf(">", j + 8);
  37667. if (q < 0) {
  37668. this.onError(XMLParserErrorCode.UnterminatedDoctypeDeclaration);
  37669. return;
  37670. }
  37671. if (q2 > 0 && q > q2) {
  37672. q = s.indexOf("]>", j + 8);
  37673. if (q < 0) {
  37674. this.onError(XMLParserErrorCode.UnterminatedDoctypeDeclaration);
  37675. return;
  37676. }
  37677. complexDoctype = true;
  37678. }
  37679. const doctypeContent = s.substring(j + 8, q + (complexDoctype ? 1 : 0));
  37680. this.onDoctype(doctypeContent);
  37681. j = q + (complexDoctype ? 2 : 1);
  37682. } else {
  37683. this.onError(XMLParserErrorCode.MalformedElement);
  37684. return;
  37685. }
  37686. break;
  37687. default:
  37688. const content = this._parseContent(s, j);
  37689. if (content === null) {
  37690. this.onError(XMLParserErrorCode.MalformedElement);
  37691. return;
  37692. }
  37693. let isClosed = false;
  37694. if (s.substring(j + content.parsed, j + content.parsed + 2) === "/>") {
  37695. isClosed = true;
  37696. } else if (s.substring(j + content.parsed, j + content.parsed + 1) !== ">") {
  37697. this.onError(XMLParserErrorCode.UnterminatedElement);
  37698. return;
  37699. }
  37700. this.onBeginElement(content.name, content.attributes, isClosed);
  37701. j += content.parsed + (isClosed ? 2 : 1);
  37702. break;
  37703. }
  37704. } else {
  37705. while (j < s.length && s[j] !== "<") {
  37706. j++;
  37707. }
  37708. const text = s.substring(i, j);
  37709. this.onText(this._resolveEntities(text));
  37710. }
  37711. i = j;
  37712. }
  37713. }
  37714. onResolveEntity(name) {
  37715. return `&${name};`;
  37716. }
  37717. onPi(name, value) {}
  37718. onComment(text) {}
  37719. onCdata(text) {}
  37720. onDoctype(doctypeContent) {}
  37721. onText(text) {}
  37722. onBeginElement(name, attributes, isEmpty) {}
  37723. onEndElement(name) {}
  37724. onError(code) {}
  37725. }
  37726. class SimpleDOMNode {
  37727. constructor(nodeName, nodeValue) {
  37728. this.nodeName = nodeName;
  37729. this.nodeValue = nodeValue;
  37730. Object.defineProperty(this, "parentNode", {
  37731. value: null,
  37732. writable: true
  37733. });
  37734. }
  37735. get firstChild() {
  37736. return this.childNodes?.[0];
  37737. }
  37738. get nextSibling() {
  37739. const childNodes = this.parentNode.childNodes;
  37740. if (!childNodes) {
  37741. return undefined;
  37742. }
  37743. const index = childNodes.indexOf(this);
  37744. if (index === -1) {
  37745. return undefined;
  37746. }
  37747. return childNodes[index + 1];
  37748. }
  37749. get textContent() {
  37750. if (!this.childNodes) {
  37751. return this.nodeValue || "";
  37752. }
  37753. return this.childNodes.map(function (child) {
  37754. return child.textContent;
  37755. }).join("");
  37756. }
  37757. get children() {
  37758. return this.childNodes || [];
  37759. }
  37760. hasChildNodes() {
  37761. return this.childNodes?.length > 0;
  37762. }
  37763. searchNode(paths, pos) {
  37764. if (pos >= paths.length) {
  37765. return this;
  37766. }
  37767. const component = paths[pos];
  37768. if (component.name.startsWith("#") && pos < paths.length - 1) {
  37769. return this.searchNode(paths, pos + 1);
  37770. }
  37771. const stack = [];
  37772. let node = this;
  37773. while (true) {
  37774. if (component.name === node.nodeName) {
  37775. if (component.pos === 0) {
  37776. const res = node.searchNode(paths, pos + 1);
  37777. if (res !== null) {
  37778. return res;
  37779. }
  37780. } else if (stack.length === 0) {
  37781. return null;
  37782. } else {
  37783. const [parent] = stack.pop();
  37784. let siblingPos = 0;
  37785. for (const child of parent.childNodes) {
  37786. if (component.name === child.nodeName) {
  37787. if (siblingPos === component.pos) {
  37788. return child.searchNode(paths, pos + 1);
  37789. }
  37790. siblingPos++;
  37791. }
  37792. }
  37793. return node.searchNode(paths, pos + 1);
  37794. }
  37795. }
  37796. if (node.childNodes?.length > 0) {
  37797. stack.push([node, 0]);
  37798. node = node.childNodes[0];
  37799. } else if (stack.length === 0) {
  37800. return null;
  37801. } else {
  37802. while (stack.length !== 0) {
  37803. const [parent, currentPos] = stack.pop();
  37804. const newPos = currentPos + 1;
  37805. if (newPos < parent.childNodes.length) {
  37806. stack.push([parent, newPos]);
  37807. node = parent.childNodes[newPos];
  37808. break;
  37809. }
  37810. }
  37811. if (stack.length === 0) {
  37812. return null;
  37813. }
  37814. }
  37815. }
  37816. }
  37817. dump(buffer) {
  37818. if (this.nodeName === "#text") {
  37819. buffer.push(encodeToXmlString(this.nodeValue));
  37820. return;
  37821. }
  37822. buffer.push(`<${this.nodeName}`);
  37823. if (this.attributes) {
  37824. for (const attribute of this.attributes) {
  37825. buffer.push(` ${attribute.name}="${encodeToXmlString(attribute.value)}"`);
  37826. }
  37827. }
  37828. if (this.hasChildNodes()) {
  37829. buffer.push(">");
  37830. for (const child of this.childNodes) {
  37831. child.dump(buffer);
  37832. }
  37833. buffer.push(`</${this.nodeName}>`);
  37834. } else if (this.nodeValue) {
  37835. buffer.push(`>${encodeToXmlString(this.nodeValue)}</${this.nodeName}>`);
  37836. } else {
  37837. buffer.push("/>");
  37838. }
  37839. }
  37840. }
  37841. class SimpleXMLParser extends XMLParserBase {
  37842. constructor({
  37843. hasAttributes = false,
  37844. lowerCaseName = false
  37845. }) {
  37846. super();
  37847. this._currentFragment = null;
  37848. this._stack = null;
  37849. this._errorCode = XMLParserErrorCode.NoError;
  37850. this._hasAttributes = hasAttributes;
  37851. this._lowerCaseName = lowerCaseName;
  37852. }
  37853. parseFromString(data) {
  37854. this._currentFragment = [];
  37855. this._stack = [];
  37856. this._errorCode = XMLParserErrorCode.NoError;
  37857. this.parseXml(data);
  37858. if (this._errorCode !== XMLParserErrorCode.NoError) {
  37859. return undefined;
  37860. }
  37861. const [documentElement] = this._currentFragment;
  37862. if (!documentElement) {
  37863. return undefined;
  37864. }
  37865. return {
  37866. documentElement
  37867. };
  37868. }
  37869. onText(text) {
  37870. if (isWhitespaceString(text)) {
  37871. return;
  37872. }
  37873. const node = new SimpleDOMNode("#text", text);
  37874. this._currentFragment.push(node);
  37875. }
  37876. onCdata(text) {
  37877. const node = new SimpleDOMNode("#text", text);
  37878. this._currentFragment.push(node);
  37879. }
  37880. onBeginElement(name, attributes, isEmpty) {
  37881. if (this._lowerCaseName) {
  37882. name = name.toLowerCase();
  37883. }
  37884. const node = new SimpleDOMNode(name);
  37885. node.childNodes = [];
  37886. if (this._hasAttributes) {
  37887. node.attributes = attributes;
  37888. }
  37889. this._currentFragment.push(node);
  37890. if (isEmpty) {
  37891. return;
  37892. }
  37893. this._stack.push(this._currentFragment);
  37894. this._currentFragment = node.childNodes;
  37895. }
  37896. onEndElement(name) {
  37897. this._currentFragment = this._stack.pop() || [];
  37898. const lastElement = this._currentFragment.at(-1);
  37899. if (!lastElement) {
  37900. return null;
  37901. }
  37902. for (const childNode of lastElement.childNodes) {
  37903. childNode.parentNode = lastElement;
  37904. }
  37905. return lastElement;
  37906. }
  37907. onError(code) {
  37908. this._errorCode = code;
  37909. }
  37910. }
  37911. ;// ./src/core/metadata_parser.js
  37912. class MetadataParser {
  37913. constructor(data) {
  37914. data = this._repair(data);
  37915. const parser = new SimpleXMLParser({
  37916. lowerCaseName: true
  37917. });
  37918. const xmlDocument = parser.parseFromString(data);
  37919. this._metadataMap = new Map();
  37920. this._data = data;
  37921. if (xmlDocument) {
  37922. this._parse(xmlDocument);
  37923. }
  37924. }
  37925. _repair(data) {
  37926. return data.replace(/^[^<]+/, "").replaceAll(/>\\376\\377([^<]+)/g, function (all, codes) {
  37927. const bytes = codes.replaceAll(/\\([0-3])([0-7])([0-7])/g, function (code, d1, d2, d3) {
  37928. return String.fromCharCode(d1 * 64 + d2 * 8 + d3 * 1);
  37929. }).replaceAll(/&(amp|apos|gt|lt|quot);/g, function (str, name) {
  37930. switch (name) {
  37931. case "amp":
  37932. return "&";
  37933. case "apos":
  37934. return "'";
  37935. case "gt":
  37936. return ">";
  37937. case "lt":
  37938. return "<";
  37939. case "quot":
  37940. return '"';
  37941. }
  37942. throw new Error(`_repair: ${name} isn't defined.`);
  37943. });
  37944. const charBuf = [">"];
  37945. for (let i = 0, ii = bytes.length; i < ii; i += 2) {
  37946. const code = bytes.charCodeAt(i) * 256 + bytes.charCodeAt(i + 1);
  37947. if (code >= 32 && code < 127 && code !== 60 && code !== 62 && code !== 38) {
  37948. charBuf.push(String.fromCharCode(code));
  37949. } else {
  37950. charBuf.push("&#x" + (0x10000 + code).toString(16).substring(1) + ";");
  37951. }
  37952. }
  37953. return charBuf.join("");
  37954. });
  37955. }
  37956. _getSequence(entry) {
  37957. const name = entry.nodeName;
  37958. if (name !== "rdf:bag" && name !== "rdf:seq" && name !== "rdf:alt") {
  37959. return null;
  37960. }
  37961. return entry.childNodes.filter(node => node.nodeName === "rdf:li");
  37962. }
  37963. _parseArray(entry) {
  37964. if (!entry.hasChildNodes()) {
  37965. return;
  37966. }
  37967. const [seqNode] = entry.childNodes;
  37968. const sequence = this._getSequence(seqNode) || [];
  37969. this._metadataMap.set(entry.nodeName, sequence.map(node => node.textContent.trim()));
  37970. }
  37971. _parse(xmlDocument) {
  37972. let rdf = xmlDocument.documentElement;
  37973. if (rdf.nodeName !== "rdf:rdf") {
  37974. rdf = rdf.firstChild;
  37975. while (rdf && rdf.nodeName !== "rdf:rdf") {
  37976. rdf = rdf.nextSibling;
  37977. }
  37978. }
  37979. if (!rdf || rdf.nodeName !== "rdf:rdf" || !rdf.hasChildNodes()) {
  37980. return;
  37981. }
  37982. for (const desc of rdf.childNodes) {
  37983. if (desc.nodeName !== "rdf:description") {
  37984. continue;
  37985. }
  37986. for (const entry of desc.childNodes) {
  37987. const name = entry.nodeName;
  37988. switch (name) {
  37989. case "#text":
  37990. continue;
  37991. case "dc:creator":
  37992. case "dc:subject":
  37993. this._parseArray(entry);
  37994. continue;
  37995. }
  37996. this._metadataMap.set(name, entry.textContent.trim());
  37997. }
  37998. }
  37999. }
  38000. get serializable() {
  38001. return {
  38002. parsedData: this._metadataMap,
  38003. rawData: this._data
  38004. };
  38005. }
  38006. }
  38007. ;// ./src/core/decrypt_stream.js
  38008. const chunkSize = 512;
  38009. class DecryptStream extends DecodeStream {
  38010. constructor(str, maybeLength, decrypt) {
  38011. super(maybeLength);
  38012. this.str = str;
  38013. this.dict = str.dict;
  38014. this.decrypt = decrypt;
  38015. this.nextChunk = null;
  38016. this.initialized = false;
  38017. }
  38018. readBlock() {
  38019. let chunk;
  38020. if (this.initialized) {
  38021. chunk = this.nextChunk;
  38022. } else {
  38023. chunk = this.str.getBytes(chunkSize);
  38024. this.initialized = true;
  38025. }
  38026. if (!chunk || chunk.length === 0) {
  38027. this.eof = true;
  38028. return;
  38029. }
  38030. this.nextChunk = this.str.getBytes(chunkSize);
  38031. const hasMoreData = this.nextChunk?.length > 0;
  38032. const decrypt = this.decrypt;
  38033. chunk = decrypt(chunk, !hasMoreData);
  38034. const bufferLength = this.bufferLength,
  38035. newLength = bufferLength + chunk.length,
  38036. buffer = this.ensureBuffer(newLength);
  38037. buffer.set(chunk, bufferLength);
  38038. this.bufferLength = newLength;
  38039. }
  38040. }
  38041. ;// ./src/core/crypto.js
  38042. class ARCFourCipher {
  38043. constructor(key) {
  38044. this.a = 0;
  38045. this.b = 0;
  38046. const s = new Uint8Array(256);
  38047. const keyLength = key.length;
  38048. for (let i = 0; i < 256; ++i) {
  38049. s[i] = i;
  38050. }
  38051. for (let i = 0, j = 0; i < 256; ++i) {
  38052. const tmp = s[i];
  38053. j = j + tmp + key[i % keyLength] & 0xff;
  38054. s[i] = s[j];
  38055. s[j] = tmp;
  38056. }
  38057. this.s = s;
  38058. }
  38059. encryptBlock(data) {
  38060. let a = this.a,
  38061. b = this.b;
  38062. const s = this.s;
  38063. const n = data.length;
  38064. const output = new Uint8Array(n);
  38065. for (let i = 0; i < n; ++i) {
  38066. a = a + 1 & 0xff;
  38067. const tmp = s[a];
  38068. b = b + tmp & 0xff;
  38069. const tmp2 = s[b];
  38070. s[a] = tmp2;
  38071. s[b] = tmp;
  38072. output[i] = data[i] ^ s[tmp + tmp2 & 0xff];
  38073. }
  38074. this.a = a;
  38075. this.b = b;
  38076. return output;
  38077. }
  38078. decryptBlock(data) {
  38079. return this.encryptBlock(data);
  38080. }
  38081. encrypt(data) {
  38082. return this.encryptBlock(data);
  38083. }
  38084. }
  38085. const calculateMD5 = function calculateMD5Closure() {
  38086. const r = new Uint8Array([7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21]);
  38087. const k = new Int32Array([-680876936, -389564586, 606105819, -1044525330, -176418897, 1200080426, -1473231341, -45705983, 1770035416, -1958414417, -42063, -1990404162, 1804603682, -40341101, -1502002290, 1236535329, -165796510, -1069501632, 643717713, -373897302, -701558691, 38016083, -660478335, -405537848, 568446438, -1019803690, -187363961, 1163531501, -1444681467, -51403784, 1735328473, -1926607734, -378558, -2022574463, 1839030562, -35309556, -1530992060, 1272893353, -155497632, -1094730640, 681279174, -358537222, -722521979, 76029189, -640364487, -421815835, 530742520, -995338651, -198630844, 1126891415, -1416354905, -57434055, 1700485571, -1894986606, -1051523, -2054922799, 1873313359, -30611744, -1560198380, 1309151649, -145523070, -1120210379, 718787259, -343485551]);
  38088. function hash(data, offset, length) {
  38089. let h0 = 1732584193,
  38090. h1 = -271733879,
  38091. h2 = -1732584194,
  38092. h3 = 271733878;
  38093. const paddedLength = length + 72 & ~63;
  38094. const padded = new Uint8Array(paddedLength);
  38095. let i, j;
  38096. for (i = 0; i < length; ++i) {
  38097. padded[i] = data[offset++];
  38098. }
  38099. padded[i++] = 0x80;
  38100. const n = paddedLength - 8;
  38101. while (i < n) {
  38102. padded[i++] = 0;
  38103. }
  38104. padded[i++] = length << 3 & 0xff;
  38105. padded[i++] = length >> 5 & 0xff;
  38106. padded[i++] = length >> 13 & 0xff;
  38107. padded[i++] = length >> 21 & 0xff;
  38108. padded[i++] = length >>> 29 & 0xff;
  38109. padded[i++] = 0;
  38110. padded[i++] = 0;
  38111. padded[i++] = 0;
  38112. const w = new Int32Array(16);
  38113. for (i = 0; i < paddedLength;) {
  38114. for (j = 0; j < 16; ++j, i += 4) {
  38115. w[j] = padded[i] | padded[i + 1] << 8 | padded[i + 2] << 16 | padded[i + 3] << 24;
  38116. }
  38117. let a = h0,
  38118. b = h1,
  38119. c = h2,
  38120. d = h3,
  38121. f,
  38122. g;
  38123. for (j = 0; j < 64; ++j) {
  38124. if (j < 16) {
  38125. f = b & c | ~b & d;
  38126. g = j;
  38127. } else if (j < 32) {
  38128. f = d & b | ~d & c;
  38129. g = 5 * j + 1 & 15;
  38130. } else if (j < 48) {
  38131. f = b ^ c ^ d;
  38132. g = 3 * j + 5 & 15;
  38133. } else {
  38134. f = c ^ (b | ~d);
  38135. g = 7 * j & 15;
  38136. }
  38137. const tmp = d,
  38138. rotateArg = a + f + k[j] + w[g] | 0,
  38139. rotate = r[j];
  38140. d = c;
  38141. c = b;
  38142. b = b + (rotateArg << rotate | rotateArg >>> 32 - rotate) | 0;
  38143. a = tmp;
  38144. }
  38145. h0 = h0 + a | 0;
  38146. h1 = h1 + b | 0;
  38147. h2 = h2 + c | 0;
  38148. h3 = h3 + d | 0;
  38149. }
  38150. return new Uint8Array([h0 & 0xFF, h0 >> 8 & 0xFF, h0 >> 16 & 0xFF, h0 >>> 24 & 0xFF, h1 & 0xFF, h1 >> 8 & 0xFF, h1 >> 16 & 0xFF, h1 >>> 24 & 0xFF, h2 & 0xFF, h2 >> 8 & 0xFF, h2 >> 16 & 0xFF, h2 >>> 24 & 0xFF, h3 & 0xFF, h3 >> 8 & 0xFF, h3 >> 16 & 0xFF, h3 >>> 24 & 0xFF]);
  38151. }
  38152. return hash;
  38153. }();
  38154. class Word64 {
  38155. constructor(highInteger, lowInteger) {
  38156. this.high = highInteger | 0;
  38157. this.low = lowInteger | 0;
  38158. }
  38159. and(word) {
  38160. this.high &= word.high;
  38161. this.low &= word.low;
  38162. }
  38163. xor(word) {
  38164. this.high ^= word.high;
  38165. this.low ^= word.low;
  38166. }
  38167. or(word) {
  38168. this.high |= word.high;
  38169. this.low |= word.low;
  38170. }
  38171. shiftRight(places) {
  38172. if (places >= 32) {
  38173. this.low = this.high >>> places - 32 | 0;
  38174. this.high = 0;
  38175. } else {
  38176. this.low = this.low >>> places | this.high << 32 - places;
  38177. this.high = this.high >>> places | 0;
  38178. }
  38179. }
  38180. shiftLeft(places) {
  38181. if (places >= 32) {
  38182. this.high = this.low << places - 32;
  38183. this.low = 0;
  38184. } else {
  38185. this.high = this.high << places | this.low >>> 32 - places;
  38186. this.low <<= places;
  38187. }
  38188. }
  38189. rotateRight(places) {
  38190. let low, high;
  38191. if (places & 32) {
  38192. high = this.low;
  38193. low = this.high;
  38194. } else {
  38195. low = this.low;
  38196. high = this.high;
  38197. }
  38198. places &= 31;
  38199. this.low = low >>> places | high << 32 - places;
  38200. this.high = high >>> places | low << 32 - places;
  38201. }
  38202. not() {
  38203. this.high = ~this.high;
  38204. this.low = ~this.low;
  38205. }
  38206. add(word) {
  38207. const lowAdd = (this.low >>> 0) + (word.low >>> 0);
  38208. let highAdd = (this.high >>> 0) + (word.high >>> 0);
  38209. if (lowAdd > 0xffffffff) {
  38210. highAdd += 1;
  38211. }
  38212. this.low = lowAdd | 0;
  38213. this.high = highAdd | 0;
  38214. }
  38215. copyTo(bytes, offset) {
  38216. bytes[offset] = this.high >>> 24 & 0xff;
  38217. bytes[offset + 1] = this.high >> 16 & 0xff;
  38218. bytes[offset + 2] = this.high >> 8 & 0xff;
  38219. bytes[offset + 3] = this.high & 0xff;
  38220. bytes[offset + 4] = this.low >>> 24 & 0xff;
  38221. bytes[offset + 5] = this.low >> 16 & 0xff;
  38222. bytes[offset + 6] = this.low >> 8 & 0xff;
  38223. bytes[offset + 7] = this.low & 0xff;
  38224. }
  38225. assign(word) {
  38226. this.high = word.high;
  38227. this.low = word.low;
  38228. }
  38229. }
  38230. const calculateSHA256 = function calculateSHA256Closure() {
  38231. function rotr(x, n) {
  38232. return x >>> n | x << 32 - n;
  38233. }
  38234. function ch(x, y, z) {
  38235. return x & y ^ ~x & z;
  38236. }
  38237. function maj(x, y, z) {
  38238. return x & y ^ x & z ^ y & z;
  38239. }
  38240. function sigma(x) {
  38241. return rotr(x, 2) ^ rotr(x, 13) ^ rotr(x, 22);
  38242. }
  38243. function sigmaPrime(x) {
  38244. return rotr(x, 6) ^ rotr(x, 11) ^ rotr(x, 25);
  38245. }
  38246. function littleSigma(x) {
  38247. return rotr(x, 7) ^ rotr(x, 18) ^ x >>> 3;
  38248. }
  38249. function littleSigmaPrime(x) {
  38250. return rotr(x, 17) ^ rotr(x, 19) ^ x >>> 10;
  38251. }
  38252. const k = [0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2];
  38253. function hash(data, offset, length) {
  38254. let h0 = 0x6a09e667,
  38255. h1 = 0xbb67ae85,
  38256. h2 = 0x3c6ef372,
  38257. h3 = 0xa54ff53a,
  38258. h4 = 0x510e527f,
  38259. h5 = 0x9b05688c,
  38260. h6 = 0x1f83d9ab,
  38261. h7 = 0x5be0cd19;
  38262. const paddedLength = Math.ceil((length + 9) / 64) * 64;
  38263. const padded = new Uint8Array(paddedLength);
  38264. let i, j;
  38265. for (i = 0; i < length; ++i) {
  38266. padded[i] = data[offset++];
  38267. }
  38268. padded[i++] = 0x80;
  38269. const n = paddedLength - 8;
  38270. while (i < n) {
  38271. padded[i++] = 0;
  38272. }
  38273. padded[i++] = 0;
  38274. padded[i++] = 0;
  38275. padded[i++] = 0;
  38276. padded[i++] = length >>> 29 & 0xff;
  38277. padded[i++] = length >> 21 & 0xff;
  38278. padded[i++] = length >> 13 & 0xff;
  38279. padded[i++] = length >> 5 & 0xff;
  38280. padded[i++] = length << 3 & 0xff;
  38281. const w = new Uint32Array(64);
  38282. for (i = 0; i < paddedLength;) {
  38283. for (j = 0; j < 16; ++j) {
  38284. w[j] = padded[i] << 24 | padded[i + 1] << 16 | padded[i + 2] << 8 | padded[i + 3];
  38285. i += 4;
  38286. }
  38287. for (j = 16; j < 64; ++j) {
  38288. w[j] = littleSigmaPrime(w[j - 2]) + w[j - 7] + littleSigma(w[j - 15]) + w[j - 16] | 0;
  38289. }
  38290. let a = h0,
  38291. b = h1,
  38292. c = h2,
  38293. d = h3,
  38294. e = h4,
  38295. f = h5,
  38296. g = h6,
  38297. h = h7,
  38298. t1,
  38299. t2;
  38300. for (j = 0; j < 64; ++j) {
  38301. t1 = h + sigmaPrime(e) + ch(e, f, g) + k[j] + w[j];
  38302. t2 = sigma(a) + maj(a, b, c);
  38303. h = g;
  38304. g = f;
  38305. f = e;
  38306. e = d + t1 | 0;
  38307. d = c;
  38308. c = b;
  38309. b = a;
  38310. a = t1 + t2 | 0;
  38311. }
  38312. h0 = h0 + a | 0;
  38313. h1 = h1 + b | 0;
  38314. h2 = h2 + c | 0;
  38315. h3 = h3 + d | 0;
  38316. h4 = h4 + e | 0;
  38317. h5 = h5 + f | 0;
  38318. h6 = h6 + g | 0;
  38319. h7 = h7 + h | 0;
  38320. }
  38321. return new Uint8Array([h0 >> 24 & 0xFF, h0 >> 16 & 0xFF, h0 >> 8 & 0xFF, h0 & 0xFF, h1 >> 24 & 0xFF, h1 >> 16 & 0xFF, h1 >> 8 & 0xFF, h1 & 0xFF, h2 >> 24 & 0xFF, h2 >> 16 & 0xFF, h2 >> 8 & 0xFF, h2 & 0xFF, h3 >> 24 & 0xFF, h3 >> 16 & 0xFF, h3 >> 8 & 0xFF, h3 & 0xFF, h4 >> 24 & 0xFF, h4 >> 16 & 0xFF, h4 >> 8 & 0xFF, h4 & 0xFF, h5 >> 24 & 0xFF, h5 >> 16 & 0xFF, h5 >> 8 & 0xFF, h5 & 0xFF, h6 >> 24 & 0xFF, h6 >> 16 & 0xFF, h6 >> 8 & 0xFF, h6 & 0xFF, h7 >> 24 & 0xFF, h7 >> 16 & 0xFF, h7 >> 8 & 0xFF, h7 & 0xFF]);
  38322. }
  38323. return hash;
  38324. }();
  38325. const calculateSHA512 = function calculateSHA512Closure() {
  38326. function ch(result, x, y, z, tmp) {
  38327. result.assign(x);
  38328. result.and(y);
  38329. tmp.assign(x);
  38330. tmp.not();
  38331. tmp.and(z);
  38332. result.xor(tmp);
  38333. }
  38334. function maj(result, x, y, z, tmp) {
  38335. result.assign(x);
  38336. result.and(y);
  38337. tmp.assign(x);
  38338. tmp.and(z);
  38339. result.xor(tmp);
  38340. tmp.assign(y);
  38341. tmp.and(z);
  38342. result.xor(tmp);
  38343. }
  38344. function sigma(result, x, tmp) {
  38345. result.assign(x);
  38346. result.rotateRight(28);
  38347. tmp.assign(x);
  38348. tmp.rotateRight(34);
  38349. result.xor(tmp);
  38350. tmp.assign(x);
  38351. tmp.rotateRight(39);
  38352. result.xor(tmp);
  38353. }
  38354. function sigmaPrime(result, x, tmp) {
  38355. result.assign(x);
  38356. result.rotateRight(14);
  38357. tmp.assign(x);
  38358. tmp.rotateRight(18);
  38359. result.xor(tmp);
  38360. tmp.assign(x);
  38361. tmp.rotateRight(41);
  38362. result.xor(tmp);
  38363. }
  38364. function littleSigma(result, x, tmp) {
  38365. result.assign(x);
  38366. result.rotateRight(1);
  38367. tmp.assign(x);
  38368. tmp.rotateRight(8);
  38369. result.xor(tmp);
  38370. tmp.assign(x);
  38371. tmp.shiftRight(7);
  38372. result.xor(tmp);
  38373. }
  38374. function littleSigmaPrime(result, x, tmp) {
  38375. result.assign(x);
  38376. result.rotateRight(19);
  38377. tmp.assign(x);
  38378. tmp.rotateRight(61);
  38379. result.xor(tmp);
  38380. tmp.assign(x);
  38381. tmp.shiftRight(6);
  38382. result.xor(tmp);
  38383. }
  38384. const k = [new Word64(0x428a2f98, 0xd728ae22), new Word64(0x71374491, 0x23ef65cd), new Word64(0xb5c0fbcf, 0xec4d3b2f), new Word64(0xe9b5dba5, 0x8189dbbc), new Word64(0x3956c25b, 0xf348b538), new Word64(0x59f111f1, 0xb605d019), new Word64(0x923f82a4, 0xaf194f9b), new Word64(0xab1c5ed5, 0xda6d8118), new Word64(0xd807aa98, 0xa3030242), new Word64(0x12835b01, 0x45706fbe), new Word64(0x243185be, 0x4ee4b28c), new Word64(0x550c7dc3, 0xd5ffb4e2), new Word64(0x72be5d74, 0xf27b896f), new Word64(0x80deb1fe, 0x3b1696b1), new Word64(0x9bdc06a7, 0x25c71235), new Word64(0xc19bf174, 0xcf692694), new Word64(0xe49b69c1, 0x9ef14ad2), new Word64(0xefbe4786, 0x384f25e3), new Word64(0x0fc19dc6, 0x8b8cd5b5), new Word64(0x240ca1cc, 0x77ac9c65), new Word64(0x2de92c6f, 0x592b0275), new Word64(0x4a7484aa, 0x6ea6e483), new Word64(0x5cb0a9dc, 0xbd41fbd4), new Word64(0x76f988da, 0x831153b5), new Word64(0x983e5152, 0xee66dfab), new Word64(0xa831c66d, 0x2db43210), new Word64(0xb00327c8, 0x98fb213f), new Word64(0xbf597fc7, 0xbeef0ee4), new Word64(0xc6e00bf3, 0x3da88fc2), new Word64(0xd5a79147, 0x930aa725), new Word64(0x06ca6351, 0xe003826f), new Word64(0x14292967, 0x0a0e6e70), new Word64(0x27b70a85, 0x46d22ffc), new Word64(0x2e1b2138, 0x5c26c926), new Word64(0x4d2c6dfc, 0x5ac42aed), new Word64(0x53380d13, 0x9d95b3df), new Word64(0x650a7354, 0x8baf63de), new Word64(0x766a0abb, 0x3c77b2a8), new Word64(0x81c2c92e, 0x47edaee6), new Word64(0x92722c85, 0x1482353b), new Word64(0xa2bfe8a1, 0x4cf10364), new Word64(0xa81a664b, 0xbc423001), new Word64(0xc24b8b70, 0xd0f89791), new Word64(0xc76c51a3, 0x0654be30), new Word64(0xd192e819, 0xd6ef5218), new Word64(0xd6990624, 0x5565a910), new Word64(0xf40e3585, 0x5771202a), new Word64(0x106aa070, 0x32bbd1b8), new Word64(0x19a4c116, 0xb8d2d0c8), new Word64(0x1e376c08, 0x5141ab53), new Word64(0x2748774c, 0xdf8eeb99), new Word64(0x34b0bcb5, 0xe19b48a8), new Word64(0x391c0cb3, 0xc5c95a63), new Word64(0x4ed8aa4a, 0xe3418acb), new Word64(0x5b9cca4f, 0x7763e373), new Word64(0x682e6ff3, 0xd6b2b8a3), new Word64(0x748f82ee, 0x5defb2fc), new Word64(0x78a5636f, 0x43172f60), new Word64(0x84c87814, 0xa1f0ab72), new Word64(0x8cc70208, 0x1a6439ec), new Word64(0x90befffa, 0x23631e28), new Word64(0xa4506ceb, 0xde82bde9), new Word64(0xbef9a3f7, 0xb2c67915), new Word64(0xc67178f2, 0xe372532b), new Word64(0xca273ece, 0xea26619c), new Word64(0xd186b8c7, 0x21c0c207), new Word64(0xeada7dd6, 0xcde0eb1e), new Word64(0xf57d4f7f, 0xee6ed178), new Word64(0x06f067aa, 0x72176fba), new Word64(0x0a637dc5, 0xa2c898a6), new Word64(0x113f9804, 0xbef90dae), new Word64(0x1b710b35, 0x131c471b), new Word64(0x28db77f5, 0x23047d84), new Word64(0x32caab7b, 0x40c72493), new Word64(0x3c9ebe0a, 0x15c9bebc), new Word64(0x431d67c4, 0x9c100d4c), new Word64(0x4cc5d4be, 0xcb3e42b6), new Word64(0x597f299c, 0xfc657e2a), new Word64(0x5fcb6fab, 0x3ad6faec), new Word64(0x6c44198c, 0x4a475817)];
  38385. function hash(data, offset, length, mode384 = false) {
  38386. let h0, h1, h2, h3, h4, h5, h6, h7;
  38387. if (!mode384) {
  38388. h0 = new Word64(0x6a09e667, 0xf3bcc908);
  38389. h1 = new Word64(0xbb67ae85, 0x84caa73b);
  38390. h2 = new Word64(0x3c6ef372, 0xfe94f82b);
  38391. h3 = new Word64(0xa54ff53a, 0x5f1d36f1);
  38392. h4 = new Word64(0x510e527f, 0xade682d1);
  38393. h5 = new Word64(0x9b05688c, 0x2b3e6c1f);
  38394. h6 = new Word64(0x1f83d9ab, 0xfb41bd6b);
  38395. h7 = new Word64(0x5be0cd19, 0x137e2179);
  38396. } else {
  38397. h0 = new Word64(0xcbbb9d5d, 0xc1059ed8);
  38398. h1 = new Word64(0x629a292a, 0x367cd507);
  38399. h2 = new Word64(0x9159015a, 0x3070dd17);
  38400. h3 = new Word64(0x152fecd8, 0xf70e5939);
  38401. h4 = new Word64(0x67332667, 0xffc00b31);
  38402. h5 = new Word64(0x8eb44a87, 0x68581511);
  38403. h6 = new Word64(0xdb0c2e0d, 0x64f98fa7);
  38404. h7 = new Word64(0x47b5481d, 0xbefa4fa4);
  38405. }
  38406. const paddedLength = Math.ceil((length + 17) / 128) * 128;
  38407. const padded = new Uint8Array(paddedLength);
  38408. let i, j;
  38409. for (i = 0; i < length; ++i) {
  38410. padded[i] = data[offset++];
  38411. }
  38412. padded[i++] = 0x80;
  38413. const n = paddedLength - 16;
  38414. while (i < n) {
  38415. padded[i++] = 0;
  38416. }
  38417. padded[i++] = 0;
  38418. padded[i++] = 0;
  38419. padded[i++] = 0;
  38420. padded[i++] = 0;
  38421. padded[i++] = 0;
  38422. padded[i++] = 0;
  38423. padded[i++] = 0;
  38424. padded[i++] = 0;
  38425. padded[i++] = 0;
  38426. padded[i++] = 0;
  38427. padded[i++] = 0;
  38428. padded[i++] = length >>> 29 & 0xff;
  38429. padded[i++] = length >> 21 & 0xff;
  38430. padded[i++] = length >> 13 & 0xff;
  38431. padded[i++] = length >> 5 & 0xff;
  38432. padded[i++] = length << 3 & 0xff;
  38433. const w = new Array(80);
  38434. for (i = 0; i < 80; i++) {
  38435. w[i] = new Word64(0, 0);
  38436. }
  38437. let a = new Word64(0, 0),
  38438. b = new Word64(0, 0),
  38439. c = new Word64(0, 0);
  38440. let d = new Word64(0, 0),
  38441. e = new Word64(0, 0),
  38442. f = new Word64(0, 0);
  38443. let g = new Word64(0, 0),
  38444. h = new Word64(0, 0);
  38445. const t1 = new Word64(0, 0),
  38446. t2 = new Word64(0, 0);
  38447. const tmp1 = new Word64(0, 0),
  38448. tmp2 = new Word64(0, 0);
  38449. let tmp3;
  38450. for (i = 0; i < paddedLength;) {
  38451. for (j = 0; j < 16; ++j) {
  38452. w[j].high = padded[i] << 24 | padded[i + 1] << 16 | padded[i + 2] << 8 | padded[i + 3];
  38453. w[j].low = padded[i + 4] << 24 | padded[i + 5] << 16 | padded[i + 6] << 8 | padded[i + 7];
  38454. i += 8;
  38455. }
  38456. for (j = 16; j < 80; ++j) {
  38457. tmp3 = w[j];
  38458. littleSigmaPrime(tmp3, w[j - 2], tmp2);
  38459. tmp3.add(w[j - 7]);
  38460. littleSigma(tmp1, w[j - 15], tmp2);
  38461. tmp3.add(tmp1);
  38462. tmp3.add(w[j - 16]);
  38463. }
  38464. a.assign(h0);
  38465. b.assign(h1);
  38466. c.assign(h2);
  38467. d.assign(h3);
  38468. e.assign(h4);
  38469. f.assign(h5);
  38470. g.assign(h6);
  38471. h.assign(h7);
  38472. for (j = 0; j < 80; ++j) {
  38473. t1.assign(h);
  38474. sigmaPrime(tmp1, e, tmp2);
  38475. t1.add(tmp1);
  38476. ch(tmp1, e, f, g, tmp2);
  38477. t1.add(tmp1);
  38478. t1.add(k[j]);
  38479. t1.add(w[j]);
  38480. sigma(t2, a, tmp2);
  38481. maj(tmp1, a, b, c, tmp2);
  38482. t2.add(tmp1);
  38483. tmp3 = h;
  38484. h = g;
  38485. g = f;
  38486. f = e;
  38487. d.add(t1);
  38488. e = d;
  38489. d = c;
  38490. c = b;
  38491. b = a;
  38492. tmp3.assign(t1);
  38493. tmp3.add(t2);
  38494. a = tmp3;
  38495. }
  38496. h0.add(a);
  38497. h1.add(b);
  38498. h2.add(c);
  38499. h3.add(d);
  38500. h4.add(e);
  38501. h5.add(f);
  38502. h6.add(g);
  38503. h7.add(h);
  38504. }
  38505. let result;
  38506. if (!mode384) {
  38507. result = new Uint8Array(64);
  38508. h0.copyTo(result, 0);
  38509. h1.copyTo(result, 8);
  38510. h2.copyTo(result, 16);
  38511. h3.copyTo(result, 24);
  38512. h4.copyTo(result, 32);
  38513. h5.copyTo(result, 40);
  38514. h6.copyTo(result, 48);
  38515. h7.copyTo(result, 56);
  38516. } else {
  38517. result = new Uint8Array(48);
  38518. h0.copyTo(result, 0);
  38519. h1.copyTo(result, 8);
  38520. h2.copyTo(result, 16);
  38521. h3.copyTo(result, 24);
  38522. h4.copyTo(result, 32);
  38523. h5.copyTo(result, 40);
  38524. }
  38525. return result;
  38526. }
  38527. return hash;
  38528. }();
  38529. function calculateSHA384(data, offset, length) {
  38530. return calculateSHA512(data, offset, length, true);
  38531. }
  38532. class NullCipher {
  38533. decryptBlock(data) {
  38534. return data;
  38535. }
  38536. encrypt(data) {
  38537. return data;
  38538. }
  38539. }
  38540. class AESBaseCipher {
  38541. constructor() {
  38542. this._s = new Uint8Array([0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16]);
  38543. this._inv_s = new Uint8Array([0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb, 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43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a9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d]);
  38544. this._mix = new Uint32Array([0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3]);
  38545. this._mixCol = new Uint8Array(256);
  38546. for (let i = 0; i < 256; i++) {
  38547. this._mixCol[i] = i < 128 ? i << 1 : i << 1 ^ 0x1b;
  38548. }
  38549. this.buffer = new Uint8Array(16);
  38550. this.bufferPosition = 0;
  38551. }
  38552. _expandKey(cipherKey) {
  38553. unreachable("Cannot call `_expandKey` on the base class");
  38554. }
  38555. _decrypt(input, key) {
  38556. let t, u, v;
  38557. const state = new Uint8Array(16);
  38558. state.set(input);
  38559. for (let j = 0, k = this._keySize; j < 16; ++j, ++k) {
  38560. state[j] ^= key[k];
  38561. }
  38562. for (let i = this._cyclesOfRepetition - 1; i >= 1; --i) {
  38563. t = state[13];
  38564. state[13] = state[9];
  38565. state[9] = state[5];
  38566. state[5] = state[1];
  38567. state[1] = t;
  38568. t = state[14];
  38569. u = state[10];
  38570. state[14] = state[6];
  38571. state[10] = state[2];
  38572. state[6] = t;
  38573. state[2] = u;
  38574. t = state[15];
  38575. u = state[11];
  38576. v = state[7];
  38577. state[15] = state[3];
  38578. state[11] = t;
  38579. state[7] = u;
  38580. state[3] = v;
  38581. for (let j = 0; j < 16; ++j) {
  38582. state[j] = this._inv_s[state[j]];
  38583. }
  38584. for (let j = 0, k = i * 16; j < 16; ++j, ++k) {
  38585. state[j] ^= key[k];
  38586. }
  38587. for (let j = 0; j < 16; j += 4) {
  38588. const s0 = this._mix[state[j]];
  38589. const s1 = this._mix[state[j + 1]];
  38590. const s2 = this._mix[state[j + 2]];
  38591. const s3 = this._mix[state[j + 3]];
  38592. t = s0 ^ s1 >>> 8 ^ s1 << 24 ^ s2 >>> 16 ^ s2 << 16 ^ s3 >>> 24 ^ s3 << 8;
  38593. state[j] = t >>> 24 & 0xff;
  38594. state[j + 1] = t >> 16 & 0xff;
  38595. state[j + 2] = t >> 8 & 0xff;
  38596. state[j + 3] = t & 0xff;
  38597. }
  38598. }
  38599. t = state[13];
  38600. state[13] = state[9];
  38601. state[9] = state[5];
  38602. state[5] = state[1];
  38603. state[1] = t;
  38604. t = state[14];
  38605. u = state[10];
  38606. state[14] = state[6];
  38607. state[10] = state[2];
  38608. state[6] = t;
  38609. state[2] = u;
  38610. t = state[15];
  38611. u = state[11];
  38612. v = state[7];
  38613. state[15] = state[3];
  38614. state[11] = t;
  38615. state[7] = u;
  38616. state[3] = v;
  38617. for (let j = 0; j < 16; ++j) {
  38618. state[j] = this._inv_s[state[j]];
  38619. state[j] ^= key[j];
  38620. }
  38621. return state;
  38622. }
  38623. _encrypt(input, key) {
  38624. const s = this._s;
  38625. let t, u, v;
  38626. const state = new Uint8Array(16);
  38627. state.set(input);
  38628. for (let j = 0; j < 16; ++j) {
  38629. state[j] ^= key[j];
  38630. }
  38631. for (let i = 1; i < this._cyclesOfRepetition; i++) {
  38632. for (let j = 0; j < 16; ++j) {
  38633. state[j] = s[state[j]];
  38634. }
  38635. v = state[1];
  38636. state[1] = state[5];
  38637. state[5] = state[9];
  38638. state[9] = state[13];
  38639. state[13] = v;
  38640. v = state[2];
  38641. u = state[6];
  38642. state[2] = state[10];
  38643. state[6] = state[14];
  38644. state[10] = v;
  38645. state[14] = u;
  38646. v = state[3];
  38647. u = state[7];
  38648. t = state[11];
  38649. state[3] = state[15];
  38650. state[7] = v;
  38651. state[11] = u;
  38652. state[15] = t;
  38653. for (let j = 0; j < 16; j += 4) {
  38654. const s0 = state[j + 0];
  38655. const s1 = state[j + 1];
  38656. const s2 = state[j + 2];
  38657. const s3 = state[j + 3];
  38658. t = s0 ^ s1 ^ s2 ^ s3;
  38659. state[j + 0] ^= t ^ this._mixCol[s0 ^ s1];
  38660. state[j + 1] ^= t ^ this._mixCol[s1 ^ s2];
  38661. state[j + 2] ^= t ^ this._mixCol[s2 ^ s3];
  38662. state[j + 3] ^= t ^ this._mixCol[s3 ^ s0];
  38663. }
  38664. for (let j = 0, k = i * 16; j < 16; ++j, ++k) {
  38665. state[j] ^= key[k];
  38666. }
  38667. }
  38668. for (let j = 0; j < 16; ++j) {
  38669. state[j] = s[state[j]];
  38670. }
  38671. v = state[1];
  38672. state[1] = state[5];
  38673. state[5] = state[9];
  38674. state[9] = state[13];
  38675. state[13] = v;
  38676. v = state[2];
  38677. u = state[6];
  38678. state[2] = state[10];
  38679. state[6] = state[14];
  38680. state[10] = v;
  38681. state[14] = u;
  38682. v = state[3];
  38683. u = state[7];
  38684. t = state[11];
  38685. state[3] = state[15];
  38686. state[7] = v;
  38687. state[11] = u;
  38688. state[15] = t;
  38689. for (let j = 0, k = this._keySize; j < 16; ++j, ++k) {
  38690. state[j] ^= key[k];
  38691. }
  38692. return state;
  38693. }
  38694. _decryptBlock2(data, finalize) {
  38695. const sourceLength = data.length;
  38696. let buffer = this.buffer,
  38697. bufferLength = this.bufferPosition;
  38698. const result = [];
  38699. let iv = this.iv;
  38700. for (let i = 0; i < sourceLength; ++i) {
  38701. buffer[bufferLength] = data[i];
  38702. ++bufferLength;
  38703. if (bufferLength < 16) {
  38704. continue;
  38705. }
  38706. const plain = this._decrypt(buffer, this._key);
  38707. for (let j = 0; j < 16; ++j) {
  38708. plain[j] ^= iv[j];
  38709. }
  38710. iv = buffer;
  38711. result.push(plain);
  38712. buffer = new Uint8Array(16);
  38713. bufferLength = 0;
  38714. }
  38715. this.buffer = buffer;
  38716. this.bufferLength = bufferLength;
  38717. this.iv = iv;
  38718. if (result.length === 0) {
  38719. return new Uint8Array(0);
  38720. }
  38721. let outputLength = 16 * result.length;
  38722. if (finalize) {
  38723. const lastBlock = result.at(-1);
  38724. let psLen = lastBlock[15];
  38725. if (psLen <= 16) {
  38726. for (let i = 15, ii = 16 - psLen; i >= ii; --i) {
  38727. if (lastBlock[i] !== psLen) {
  38728. psLen = 0;
  38729. break;
  38730. }
  38731. }
  38732. outputLength -= psLen;
  38733. result[result.length - 1] = lastBlock.subarray(0, 16 - psLen);
  38734. }
  38735. }
  38736. const output = new Uint8Array(outputLength);
  38737. for (let i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) {
  38738. output.set(result[i], j);
  38739. }
  38740. return output;
  38741. }
  38742. decryptBlock(data, finalize, iv = null) {
  38743. const sourceLength = data.length;
  38744. const buffer = this.buffer;
  38745. let bufferLength = this.bufferPosition;
  38746. if (iv) {
  38747. this.iv = iv;
  38748. } else {
  38749. for (let i = 0; bufferLength < 16 && i < sourceLength; ++i, ++bufferLength) {
  38750. buffer[bufferLength] = data[i];
  38751. }
  38752. if (bufferLength < 16) {
  38753. this.bufferLength = bufferLength;
  38754. return new Uint8Array(0);
  38755. }
  38756. this.iv = buffer;
  38757. data = data.subarray(16);
  38758. }
  38759. this.buffer = new Uint8Array(16);
  38760. this.bufferLength = 0;
  38761. this.decryptBlock = this._decryptBlock2;
  38762. return this.decryptBlock(data, finalize);
  38763. }
  38764. encrypt(data, iv) {
  38765. const sourceLength = data.length;
  38766. let buffer = this.buffer,
  38767. bufferLength = this.bufferPosition;
  38768. const result = [];
  38769. if (!iv) {
  38770. iv = new Uint8Array(16);
  38771. }
  38772. for (let i = 0; i < sourceLength; ++i) {
  38773. buffer[bufferLength] = data[i];
  38774. ++bufferLength;
  38775. if (bufferLength < 16) {
  38776. continue;
  38777. }
  38778. for (let j = 0; j < 16; ++j) {
  38779. buffer[j] ^= iv[j];
  38780. }
  38781. const cipher = this._encrypt(buffer, this._key);
  38782. iv = cipher;
  38783. result.push(cipher);
  38784. buffer = new Uint8Array(16);
  38785. bufferLength = 0;
  38786. }
  38787. this.buffer = buffer;
  38788. this.bufferLength = bufferLength;
  38789. this.iv = iv;
  38790. if (result.length === 0) {
  38791. return new Uint8Array(0);
  38792. }
  38793. const outputLength = 16 * result.length;
  38794. const output = new Uint8Array(outputLength);
  38795. for (let i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) {
  38796. output.set(result[i], j);
  38797. }
  38798. return output;
  38799. }
  38800. }
  38801. class AES128Cipher extends AESBaseCipher {
  38802. constructor(key) {
  38803. super();
  38804. this._cyclesOfRepetition = 10;
  38805. this._keySize = 160;
  38806. this._rcon = new Uint8Array([0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d]);
  38807. this._key = this._expandKey(key);
  38808. }
  38809. _expandKey(cipherKey) {
  38810. const b = 176;
  38811. const s = this._s;
  38812. const rcon = this._rcon;
  38813. const result = new Uint8Array(b);
  38814. result.set(cipherKey);
  38815. for (let j = 16, i = 1; j < b; ++i) {
  38816. let t1 = result[j - 3];
  38817. let t2 = result[j - 2];
  38818. let t3 = result[j - 1];
  38819. let t4 = result[j - 4];
  38820. t1 = s[t1];
  38821. t2 = s[t2];
  38822. t3 = s[t3];
  38823. t4 = s[t4];
  38824. t1 ^= rcon[i];
  38825. for (let n = 0; n < 4; ++n) {
  38826. result[j] = t1 ^= result[j - 16];
  38827. j++;
  38828. result[j] = t2 ^= result[j - 16];
  38829. j++;
  38830. result[j] = t3 ^= result[j - 16];
  38831. j++;
  38832. result[j] = t4 ^= result[j - 16];
  38833. j++;
  38834. }
  38835. }
  38836. return result;
  38837. }
  38838. }
  38839. class AES256Cipher extends AESBaseCipher {
  38840. constructor(key) {
  38841. super();
  38842. this._cyclesOfRepetition = 14;
  38843. this._keySize = 224;
  38844. this._key = this._expandKey(key);
  38845. }
  38846. _expandKey(cipherKey) {
  38847. const b = 240;
  38848. const s = this._s;
  38849. const result = new Uint8Array(b);
  38850. result.set(cipherKey);
  38851. let r = 1;
  38852. let t1, t2, t3, t4;
  38853. for (let j = 32, i = 1; j < b; ++i) {
  38854. if (j % 32 === 16) {
  38855. t1 = s[t1];
  38856. t2 = s[t2];
  38857. t3 = s[t3];
  38858. t4 = s[t4];
  38859. } else if (j % 32 === 0) {
  38860. t1 = result[j - 3];
  38861. t2 = result[j - 2];
  38862. t3 = result[j - 1];
  38863. t4 = result[j - 4];
  38864. t1 = s[t1];
  38865. t2 = s[t2];
  38866. t3 = s[t3];
  38867. t4 = s[t4];
  38868. t1 ^= r;
  38869. if ((r <<= 1) >= 256) {
  38870. r = (r ^ 0x1b) & 0xff;
  38871. }
  38872. }
  38873. for (let n = 0; n < 4; ++n) {
  38874. result[j] = t1 ^= result[j - 32];
  38875. j++;
  38876. result[j] = t2 ^= result[j - 32];
  38877. j++;
  38878. result[j] = t3 ^= result[j - 32];
  38879. j++;
  38880. result[j] = t4 ^= result[j - 32];
  38881. j++;
  38882. }
  38883. }
  38884. return result;
  38885. }
  38886. }
  38887. class PDF17 {
  38888. checkOwnerPassword(password, ownerValidationSalt, userBytes, ownerPassword) {
  38889. const hashData = new Uint8Array(password.length + 56);
  38890. hashData.set(password, 0);
  38891. hashData.set(ownerValidationSalt, password.length);
  38892. hashData.set(userBytes, password.length + ownerValidationSalt.length);
  38893. const result = calculateSHA256(hashData, 0, hashData.length);
  38894. return isArrayEqual(result, ownerPassword);
  38895. }
  38896. checkUserPassword(password, userValidationSalt, userPassword) {
  38897. const hashData = new Uint8Array(password.length + 8);
  38898. hashData.set(password, 0);
  38899. hashData.set(userValidationSalt, password.length);
  38900. const result = calculateSHA256(hashData, 0, hashData.length);
  38901. return isArrayEqual(result, userPassword);
  38902. }
  38903. getOwnerKey(password, ownerKeySalt, userBytes, ownerEncryption) {
  38904. const hashData = new Uint8Array(password.length + 56);
  38905. hashData.set(password, 0);
  38906. hashData.set(ownerKeySalt, password.length);
  38907. hashData.set(userBytes, password.length + ownerKeySalt.length);
  38908. const key = calculateSHA256(hashData, 0, hashData.length);
  38909. const cipher = new AES256Cipher(key);
  38910. return cipher.decryptBlock(ownerEncryption, false, new Uint8Array(16));
  38911. }
  38912. getUserKey(password, userKeySalt, userEncryption) {
  38913. const hashData = new Uint8Array(password.length + 8);
  38914. hashData.set(password, 0);
  38915. hashData.set(userKeySalt, password.length);
  38916. const key = calculateSHA256(hashData, 0, hashData.length);
  38917. const cipher = new AES256Cipher(key);
  38918. return cipher.decryptBlock(userEncryption, false, new Uint8Array(16));
  38919. }
  38920. }
  38921. class PDF20 {
  38922. _hash(password, input, userBytes) {
  38923. let k = calculateSHA256(input, 0, input.length).subarray(0, 32);
  38924. let e = [0];
  38925. let i = 0;
  38926. while (i < 64 || e.at(-1) > i - 32) {
  38927. const combinedLength = password.length + k.length + userBytes.length,
  38928. combinedArray = new Uint8Array(combinedLength);
  38929. let writeOffset = 0;
  38930. combinedArray.set(password, writeOffset);
  38931. writeOffset += password.length;
  38932. combinedArray.set(k, writeOffset);
  38933. writeOffset += k.length;
  38934. combinedArray.set(userBytes, writeOffset);
  38935. const k1 = new Uint8Array(combinedLength * 64);
  38936. for (let j = 0, pos = 0; j < 64; j++, pos += combinedLength) {
  38937. k1.set(combinedArray, pos);
  38938. }
  38939. const cipher = new AES128Cipher(k.subarray(0, 16));
  38940. e = cipher.encrypt(k1, k.subarray(16, 32));
  38941. const remainder = e.slice(0, 16).reduce((a, b) => a + b, 0) % 3;
  38942. if (remainder === 0) {
  38943. k = calculateSHA256(e, 0, e.length);
  38944. } else if (remainder === 1) {
  38945. k = calculateSHA384(e, 0, e.length);
  38946. } else if (remainder === 2) {
  38947. k = calculateSHA512(e, 0, e.length);
  38948. }
  38949. i++;
  38950. }
  38951. return k.subarray(0, 32);
  38952. }
  38953. checkOwnerPassword(password, ownerValidationSalt, userBytes, ownerPassword) {
  38954. const hashData = new Uint8Array(password.length + 56);
  38955. hashData.set(password, 0);
  38956. hashData.set(ownerValidationSalt, password.length);
  38957. hashData.set(userBytes, password.length + ownerValidationSalt.length);
  38958. const result = this._hash(password, hashData, userBytes);
  38959. return isArrayEqual(result, ownerPassword);
  38960. }
  38961. checkUserPassword(password, userValidationSalt, userPassword) {
  38962. const hashData = new Uint8Array(password.length + 8);
  38963. hashData.set(password, 0);
  38964. hashData.set(userValidationSalt, password.length);
  38965. const result = this._hash(password, hashData, []);
  38966. return isArrayEqual(result, userPassword);
  38967. }
  38968. getOwnerKey(password, ownerKeySalt, userBytes, ownerEncryption) {
  38969. const hashData = new Uint8Array(password.length + 56);
  38970. hashData.set(password, 0);
  38971. hashData.set(ownerKeySalt, password.length);
  38972. hashData.set(userBytes, password.length + ownerKeySalt.length);
  38973. const key = this._hash(password, hashData, userBytes);
  38974. const cipher = new AES256Cipher(key);
  38975. return cipher.decryptBlock(ownerEncryption, false, new Uint8Array(16));
  38976. }
  38977. getUserKey(password, userKeySalt, userEncryption) {
  38978. const hashData = new Uint8Array(password.length + 8);
  38979. hashData.set(password, 0);
  38980. hashData.set(userKeySalt, password.length);
  38981. const key = this._hash(password, hashData, []);
  38982. const cipher = new AES256Cipher(key);
  38983. return cipher.decryptBlock(userEncryption, false, new Uint8Array(16));
  38984. }
  38985. }
  38986. class CipherTransform {
  38987. constructor(stringCipherConstructor, streamCipherConstructor) {
  38988. this.StringCipherConstructor = stringCipherConstructor;
  38989. this.StreamCipherConstructor = streamCipherConstructor;
  38990. }
  38991. createStream(stream, length) {
  38992. const cipher = new this.StreamCipherConstructor();
  38993. return new DecryptStream(stream, length, function cipherTransformDecryptStream(data, finalize) {
  38994. return cipher.decryptBlock(data, finalize);
  38995. });
  38996. }
  38997. decryptString(s) {
  38998. const cipher = new this.StringCipherConstructor();
  38999. let data = stringToBytes(s);
  39000. data = cipher.decryptBlock(data, true);
  39001. return bytesToString(data);
  39002. }
  39003. encryptString(s) {
  39004. const cipher = new this.StringCipherConstructor();
  39005. if (cipher instanceof AESBaseCipher) {
  39006. const strLen = s.length;
  39007. const pad = 16 - strLen % 16;
  39008. s += String.fromCharCode(pad).repeat(pad);
  39009. const iv = new Uint8Array(16);
  39010. if (typeof crypto !== "undefined") {
  39011. crypto.getRandomValues(iv);
  39012. } else {
  39013. for (let i = 0; i < 16; i++) {
  39014. iv[i] = Math.floor(256 * Math.random());
  39015. }
  39016. }
  39017. let data = stringToBytes(s);
  39018. data = cipher.encrypt(data, iv);
  39019. const buf = new Uint8Array(16 + data.length);
  39020. buf.set(iv);
  39021. buf.set(data, 16);
  39022. return bytesToString(buf);
  39023. }
  39024. let data = stringToBytes(s);
  39025. data = cipher.encrypt(data);
  39026. return bytesToString(data);
  39027. }
  39028. }
  39029. class CipherTransformFactory {
  39030. static #defaultPasswordBytes = new Uint8Array([0x28, 0xbf, 0x4e, 0x5e, 0x4e, 0x75, 0x8a, 0x41, 0x64, 0x00, 0x4e, 0x56, 0xff, 0xfa, 0x01, 0x08, 0x2e, 0x2e, 0x00, 0xb6, 0xd0, 0x68, 0x3e, 0x80, 0x2f, 0x0c, 0xa9, 0xfe, 0x64, 0x53, 0x69, 0x7a]);
  39031. #createEncryptionKey20(revision, password, ownerPassword, ownerValidationSalt, ownerKeySalt, uBytes, userPassword, userValidationSalt, userKeySalt, ownerEncryption, userEncryption, perms) {
  39032. if (password) {
  39033. const passwordLength = Math.min(127, password.length);
  39034. password = password.subarray(0, passwordLength);
  39035. } else {
  39036. password = [];
  39037. }
  39038. const pdfAlgorithm = revision === 6 ? new PDF20() : new PDF17();
  39039. if (pdfAlgorithm.checkUserPassword(password, userValidationSalt, userPassword)) {
  39040. return pdfAlgorithm.getUserKey(password, userKeySalt, userEncryption);
  39041. } else if (password.length && pdfAlgorithm.checkOwnerPassword(password, ownerValidationSalt, uBytes, ownerPassword)) {
  39042. return pdfAlgorithm.getOwnerKey(password, ownerKeySalt, uBytes, ownerEncryption);
  39043. }
  39044. return null;
  39045. }
  39046. #prepareKeyData(fileId, password, ownerPassword, userPassword, flags, revision, keyLength, encryptMetadata) {
  39047. const hashDataSize = 40 + ownerPassword.length + fileId.length;
  39048. const hashData = new Uint8Array(hashDataSize);
  39049. let i = 0,
  39050. j,
  39051. n;
  39052. if (password) {
  39053. n = Math.min(32, password.length);
  39054. for (; i < n; ++i) {
  39055. hashData[i] = password[i];
  39056. }
  39057. }
  39058. j = 0;
  39059. while (i < 32) {
  39060. hashData[i++] = CipherTransformFactory.#defaultPasswordBytes[j++];
  39061. }
  39062. for (j = 0, n = ownerPassword.length; j < n; ++j) {
  39063. hashData[i++] = ownerPassword[j];
  39064. }
  39065. hashData[i++] = flags & 0xff;
  39066. hashData[i++] = flags >> 8 & 0xff;
  39067. hashData[i++] = flags >> 16 & 0xff;
  39068. hashData[i++] = flags >>> 24 & 0xff;
  39069. for (j = 0, n = fileId.length; j < n; ++j) {
  39070. hashData[i++] = fileId[j];
  39071. }
  39072. if (revision >= 4 && !encryptMetadata) {
  39073. hashData[i++] = 0xff;
  39074. hashData[i++] = 0xff;
  39075. hashData[i++] = 0xff;
  39076. hashData[i++] = 0xff;
  39077. }
  39078. let hash = calculateMD5(hashData, 0, i);
  39079. const keyLengthInBytes = keyLength >> 3;
  39080. if (revision >= 3) {
  39081. for (j = 0; j < 50; ++j) {
  39082. hash = calculateMD5(hash, 0, keyLengthInBytes);
  39083. }
  39084. }
  39085. const encryptionKey = hash.subarray(0, keyLengthInBytes);
  39086. let cipher, checkData;
  39087. if (revision >= 3) {
  39088. for (i = 0; i < 32; ++i) {
  39089. hashData[i] = CipherTransformFactory.#defaultPasswordBytes[i];
  39090. }
  39091. for (j = 0, n = fileId.length; j < n; ++j) {
  39092. hashData[i++] = fileId[j];
  39093. }
  39094. cipher = new ARCFourCipher(encryptionKey);
  39095. checkData = cipher.encryptBlock(calculateMD5(hashData, 0, i));
  39096. n = encryptionKey.length;
  39097. const derivedKey = new Uint8Array(n);
  39098. for (j = 1; j <= 19; ++j) {
  39099. for (let k = 0; k < n; ++k) {
  39100. derivedKey[k] = encryptionKey[k] ^ j;
  39101. }
  39102. cipher = new ARCFourCipher(derivedKey);
  39103. checkData = cipher.encryptBlock(checkData);
  39104. }
  39105. for (j = 0, n = checkData.length; j < n; ++j) {
  39106. if (userPassword[j] !== checkData[j]) {
  39107. return null;
  39108. }
  39109. }
  39110. } else {
  39111. cipher = new ARCFourCipher(encryptionKey);
  39112. checkData = cipher.encryptBlock(CipherTransformFactory.#defaultPasswordBytes);
  39113. for (j = 0, n = checkData.length; j < n; ++j) {
  39114. if (userPassword[j] !== checkData[j]) {
  39115. return null;
  39116. }
  39117. }
  39118. }
  39119. return encryptionKey;
  39120. }
  39121. #decodeUserPassword(password, ownerPassword, revision, keyLength) {
  39122. const hashData = new Uint8Array(32);
  39123. let i = 0;
  39124. const n = Math.min(32, password.length);
  39125. for (; i < n; ++i) {
  39126. hashData[i] = password[i];
  39127. }
  39128. let j = 0;
  39129. while (i < 32) {
  39130. hashData[i++] = CipherTransformFactory.#defaultPasswordBytes[j++];
  39131. }
  39132. let hash = calculateMD5(hashData, 0, i);
  39133. const keyLengthInBytes = keyLength >> 3;
  39134. if (revision >= 3) {
  39135. for (j = 0; j < 50; ++j) {
  39136. hash = calculateMD5(hash, 0, hash.length);
  39137. }
  39138. }
  39139. let cipher, userPassword;
  39140. if (revision >= 3) {
  39141. userPassword = ownerPassword;
  39142. const derivedKey = new Uint8Array(keyLengthInBytes);
  39143. for (j = 19; j >= 0; j--) {
  39144. for (let k = 0; k < keyLengthInBytes; ++k) {
  39145. derivedKey[k] = hash[k] ^ j;
  39146. }
  39147. cipher = new ARCFourCipher(derivedKey);
  39148. userPassword = cipher.encryptBlock(userPassword);
  39149. }
  39150. } else {
  39151. cipher = new ARCFourCipher(hash.subarray(0, keyLengthInBytes));
  39152. userPassword = cipher.encryptBlock(ownerPassword);
  39153. }
  39154. return userPassword;
  39155. }
  39156. #buildObjectKey(num, gen, encryptionKey, isAes = false) {
  39157. const key = new Uint8Array(encryptionKey.length + 9);
  39158. const n = encryptionKey.length;
  39159. let i;
  39160. for (i = 0; i < n; ++i) {
  39161. key[i] = encryptionKey[i];
  39162. }
  39163. key[i++] = num & 0xff;
  39164. key[i++] = num >> 8 & 0xff;
  39165. key[i++] = num >> 16 & 0xff;
  39166. key[i++] = gen & 0xff;
  39167. key[i++] = gen >> 8 & 0xff;
  39168. if (isAes) {
  39169. key[i++] = 0x73;
  39170. key[i++] = 0x41;
  39171. key[i++] = 0x6c;
  39172. key[i++] = 0x54;
  39173. }
  39174. const hash = calculateMD5(key, 0, i);
  39175. return hash.subarray(0, Math.min(encryptionKey.length + 5, 16));
  39176. }
  39177. #buildCipherConstructor(cf, name, num, gen, key) {
  39178. if (!(name instanceof Name)) {
  39179. throw new FormatError("Invalid crypt filter name.");
  39180. }
  39181. const self = this;
  39182. const cryptFilter = cf.get(name.name);
  39183. const cfm = cryptFilter?.get("CFM");
  39184. if (!cfm || cfm.name === "None") {
  39185. return function () {
  39186. return new NullCipher();
  39187. };
  39188. }
  39189. if (cfm.name === "V2") {
  39190. return function () {
  39191. return new ARCFourCipher(self.#buildObjectKey(num, gen, key, false));
  39192. };
  39193. }
  39194. if (cfm.name === "AESV2") {
  39195. return function () {
  39196. return new AES128Cipher(self.#buildObjectKey(num, gen, key, true));
  39197. };
  39198. }
  39199. if (cfm.name === "AESV3") {
  39200. return function () {
  39201. return new AES256Cipher(key);
  39202. };
  39203. }
  39204. throw new FormatError("Unknown crypto method");
  39205. }
  39206. constructor(dict, fileId, password) {
  39207. const filter = dict.get("Filter");
  39208. if (!isName(filter, "Standard")) {
  39209. throw new FormatError("unknown encryption method");
  39210. }
  39211. this.filterName = filter.name;
  39212. this.dict = dict;
  39213. const algorithm = dict.get("V");
  39214. if (!Number.isInteger(algorithm) || algorithm !== 1 && algorithm !== 2 && algorithm !== 4 && algorithm !== 5) {
  39215. throw new FormatError("unsupported encryption algorithm");
  39216. }
  39217. this.algorithm = algorithm;
  39218. let keyLength = dict.get("Length");
  39219. if (!keyLength) {
  39220. if (algorithm <= 3) {
  39221. keyLength = 40;
  39222. } else {
  39223. const cfDict = dict.get("CF");
  39224. const streamCryptoName = dict.get("StmF");
  39225. if (cfDict instanceof Dict && streamCryptoName instanceof Name) {
  39226. cfDict.suppressEncryption = true;
  39227. const handlerDict = cfDict.get(streamCryptoName.name);
  39228. keyLength = handlerDict?.get("Length") || 128;
  39229. if (keyLength < 40) {
  39230. keyLength <<= 3;
  39231. }
  39232. }
  39233. }
  39234. }
  39235. if (!Number.isInteger(keyLength) || keyLength < 40 || keyLength % 8 !== 0) {
  39236. throw new FormatError("invalid key length");
  39237. }
  39238. const ownerBytes = stringToBytes(dict.get("O")),
  39239. userBytes = stringToBytes(dict.get("U"));
  39240. const ownerPassword = ownerBytes.subarray(0, 32);
  39241. const userPassword = userBytes.subarray(0, 32);
  39242. const flags = dict.get("P");
  39243. const revision = dict.get("R");
  39244. const encryptMetadata = (algorithm === 4 || algorithm === 5) && dict.get("EncryptMetadata") !== false;
  39245. this.encryptMetadata = encryptMetadata;
  39246. const fileIdBytes = stringToBytes(fileId);
  39247. let passwordBytes;
  39248. if (password) {
  39249. if (revision === 6) {
  39250. try {
  39251. password = utf8StringToString(password);
  39252. } catch {
  39253. warn("CipherTransformFactory: Unable to convert UTF8 encoded password.");
  39254. }
  39255. }
  39256. passwordBytes = stringToBytes(password);
  39257. }
  39258. let encryptionKey;
  39259. if (algorithm !== 5) {
  39260. encryptionKey = this.#prepareKeyData(fileIdBytes, passwordBytes, ownerPassword, userPassword, flags, revision, keyLength, encryptMetadata);
  39261. } else {
  39262. const ownerValidationSalt = ownerBytes.subarray(32, 40);
  39263. const ownerKeySalt = ownerBytes.subarray(40, 48);
  39264. const uBytes = userBytes.subarray(0, 48);
  39265. const userValidationSalt = userBytes.subarray(32, 40);
  39266. const userKeySalt = userBytes.subarray(40, 48);
  39267. const ownerEncryption = stringToBytes(dict.get("OE"));
  39268. const userEncryption = stringToBytes(dict.get("UE"));
  39269. const perms = stringToBytes(dict.get("Perms"));
  39270. encryptionKey = this.#createEncryptionKey20(revision, passwordBytes, ownerPassword, ownerValidationSalt, ownerKeySalt, uBytes, userPassword, userValidationSalt, userKeySalt, ownerEncryption, userEncryption, perms);
  39271. }
  39272. if (!encryptionKey && !password) {
  39273. throw new PasswordException("No password given", PasswordResponses.NEED_PASSWORD);
  39274. } else if (!encryptionKey && password) {
  39275. const decodedPassword = this.#decodeUserPassword(passwordBytes, ownerPassword, revision, keyLength);
  39276. encryptionKey = this.#prepareKeyData(fileIdBytes, decodedPassword, ownerPassword, userPassword, flags, revision, keyLength, encryptMetadata);
  39277. }
  39278. if (!encryptionKey) {
  39279. throw new PasswordException("Incorrect Password", PasswordResponses.INCORRECT_PASSWORD);
  39280. }
  39281. this.encryptionKey = encryptionKey;
  39282. if (algorithm >= 4) {
  39283. const cf = dict.get("CF");
  39284. if (cf instanceof Dict) {
  39285. cf.suppressEncryption = true;
  39286. }
  39287. this.cf = cf;
  39288. this.stmf = dict.get("StmF") || Name.get("Identity");
  39289. this.strf = dict.get("StrF") || Name.get("Identity");
  39290. this.eff = dict.get("EFF") || this.stmf;
  39291. }
  39292. }
  39293. createCipherTransform(num, gen) {
  39294. if (this.algorithm === 4 || this.algorithm === 5) {
  39295. return new CipherTransform(this.#buildCipherConstructor(this.cf, this.strf, num, gen, this.encryptionKey), this.#buildCipherConstructor(this.cf, this.stmf, num, gen, this.encryptionKey));
  39296. }
  39297. const key = this.#buildObjectKey(num, gen, this.encryptionKey, false);
  39298. const cipherConstructor = function () {
  39299. return new ARCFourCipher(key);
  39300. };
  39301. return new CipherTransform(cipherConstructor, cipherConstructor);
  39302. }
  39303. }
  39304. ;// ./src/core/writer.js
  39305. async function writeObject(ref, obj, buffer, {
  39306. encrypt = null
  39307. }) {
  39308. const transform = encrypt?.createCipherTransform(ref.num, ref.gen);
  39309. buffer.push(`${ref.num} ${ref.gen} obj\n`);
  39310. if (obj instanceof Dict) {
  39311. await writeDict(obj, buffer, transform);
  39312. } else if (obj instanceof BaseStream) {
  39313. await writeStream(obj, buffer, transform);
  39314. } else if (Array.isArray(obj) || ArrayBuffer.isView(obj)) {
  39315. await writeArray(obj, buffer, transform);
  39316. }
  39317. buffer.push("\nendobj\n");
  39318. }
  39319. async function writeDict(dict, buffer, transform) {
  39320. buffer.push("<<");
  39321. for (const key of dict.getKeys()) {
  39322. buffer.push(` /${escapePDFName(key)} `);
  39323. await writeValue(dict.getRaw(key), buffer, transform);
  39324. }
  39325. buffer.push(">>");
  39326. }
  39327. async function writeStream(stream, buffer, transform) {
  39328. let bytes = stream.getBytes();
  39329. const {
  39330. dict
  39331. } = stream;
  39332. const [filter, params] = await Promise.all([dict.getAsync("Filter"), dict.getAsync("DecodeParms")]);
  39333. const filterZero = Array.isArray(filter) ? await dict.xref.fetchIfRefAsync(filter[0]) : filter;
  39334. const isFilterZeroFlateDecode = isName(filterZero, "FlateDecode");
  39335. const MIN_LENGTH_FOR_COMPRESSING = 256;
  39336. if (bytes.length >= MIN_LENGTH_FOR_COMPRESSING || isFilterZeroFlateDecode) {
  39337. try {
  39338. const cs = new CompressionStream("deflate");
  39339. const writer = cs.writable.getWriter();
  39340. writer.write(bytes);
  39341. writer.close();
  39342. const buf = await new Response(cs.readable).arrayBuffer();
  39343. bytes = new Uint8Array(buf);
  39344. let newFilter, newParams;
  39345. if (!filter) {
  39346. newFilter = Name.get("FlateDecode");
  39347. } else if (!isFilterZeroFlateDecode) {
  39348. newFilter = Array.isArray(filter) ? [Name.get("FlateDecode"), ...filter] : [Name.get("FlateDecode"), filter];
  39349. if (params) {
  39350. newParams = Array.isArray(params) ? [null, ...params] : [null, params];
  39351. }
  39352. }
  39353. if (newFilter) {
  39354. dict.set("Filter", newFilter);
  39355. }
  39356. if (newParams) {
  39357. dict.set("DecodeParms", newParams);
  39358. }
  39359. } catch (ex) {
  39360. info(`writeStream - cannot compress data: "${ex}".`);
  39361. }
  39362. }
  39363. let string = bytesToString(bytes);
  39364. if (transform) {
  39365. string = transform.encryptString(string);
  39366. }
  39367. dict.set("Length", string.length);
  39368. await writeDict(dict, buffer, transform);
  39369. buffer.push(" stream\n", string, "\nendstream");
  39370. }
  39371. async function writeArray(array, buffer, transform) {
  39372. buffer.push("[");
  39373. let first = true;
  39374. for (const val of array) {
  39375. if (!first) {
  39376. buffer.push(" ");
  39377. } else {
  39378. first = false;
  39379. }
  39380. await writeValue(val, buffer, transform);
  39381. }
  39382. buffer.push("]");
  39383. }
  39384. async function writeValue(value, buffer, transform) {
  39385. if (value instanceof Name) {
  39386. buffer.push(`/${escapePDFName(value.name)}`);
  39387. } else if (value instanceof Ref) {
  39388. buffer.push(`${value.num} ${value.gen} R`);
  39389. } else if (Array.isArray(value) || ArrayBuffer.isView(value)) {
  39390. await writeArray(value, buffer, transform);
  39391. } else if (typeof value === "string") {
  39392. if (transform) {
  39393. value = transform.encryptString(value);
  39394. }
  39395. buffer.push(`(${escapeString(value)})`);
  39396. } else if (typeof value === "number") {
  39397. buffer.push(numberToString(value));
  39398. } else if (typeof value === "boolean") {
  39399. buffer.push(value.toString());
  39400. } else if (value instanceof Dict) {
  39401. await writeDict(value, buffer, transform);
  39402. } else if (value instanceof BaseStream) {
  39403. await writeStream(value, buffer, transform);
  39404. } else if (value === null) {
  39405. buffer.push("null");
  39406. } else {
  39407. warn(`Unhandled value in writer: ${typeof value}, please file a bug.`);
  39408. }
  39409. }
  39410. function writeInt(number, size, offset, buffer) {
  39411. for (let i = size + offset - 1; i > offset - 1; i--) {
  39412. buffer[i] = number & 0xff;
  39413. number >>= 8;
  39414. }
  39415. return offset + size;
  39416. }
  39417. function writeString(string, offset, buffer) {
  39418. for (let i = 0, len = string.length; i < len; i++) {
  39419. buffer[offset + i] = string.charCodeAt(i) & 0xff;
  39420. }
  39421. }
  39422. function computeMD5(filesize, xrefInfo) {
  39423. const time = Math.floor(Date.now() / 1000);
  39424. const filename = xrefInfo.filename || "";
  39425. const md5Buffer = [time.toString(), filename, filesize.toString()];
  39426. let md5BufferLen = md5Buffer.reduce((a, str) => a + str.length, 0);
  39427. for (const value of Object.values(xrefInfo.info)) {
  39428. md5Buffer.push(value);
  39429. md5BufferLen += value.length;
  39430. }
  39431. const array = new Uint8Array(md5BufferLen);
  39432. let offset = 0;
  39433. for (const str of md5Buffer) {
  39434. writeString(str, offset, array);
  39435. offset += str.length;
  39436. }
  39437. return bytesToString(calculateMD5(array));
  39438. }
  39439. function writeXFADataForAcroform(str, newRefs) {
  39440. const xml = new SimpleXMLParser({
  39441. hasAttributes: true
  39442. }).parseFromString(str);
  39443. for (const {
  39444. xfa
  39445. } of newRefs) {
  39446. if (!xfa) {
  39447. continue;
  39448. }
  39449. const {
  39450. path,
  39451. value
  39452. } = xfa;
  39453. if (!path) {
  39454. continue;
  39455. }
  39456. const nodePath = parseXFAPath(path);
  39457. let node = xml.documentElement.searchNode(nodePath, 0);
  39458. if (!node && nodePath.length > 1) {
  39459. node = xml.documentElement.searchNode([nodePath.at(-1)], 0);
  39460. }
  39461. if (node) {
  39462. node.childNodes = Array.isArray(value) ? value.map(val => new SimpleDOMNode("value", val)) : [new SimpleDOMNode("#text", value)];
  39463. } else {
  39464. warn(`Node not found for path: ${path}`);
  39465. }
  39466. }
  39467. const buffer = [];
  39468. xml.documentElement.dump(buffer);
  39469. return buffer.join("");
  39470. }
  39471. async function updateAcroform({
  39472. xref,
  39473. acroForm,
  39474. acroFormRef,
  39475. hasXfa,
  39476. hasXfaDatasetsEntry,
  39477. xfaDatasetsRef,
  39478. needAppearances,
  39479. newRefs
  39480. }) {
  39481. if (hasXfa && !hasXfaDatasetsEntry && !xfaDatasetsRef) {
  39482. warn("XFA - Cannot save it");
  39483. }
  39484. if (!needAppearances && (!hasXfa || !xfaDatasetsRef || hasXfaDatasetsEntry)) {
  39485. return;
  39486. }
  39487. const dict = acroForm.clone();
  39488. if (hasXfa && !hasXfaDatasetsEntry) {
  39489. const newXfa = acroForm.get("XFA").slice();
  39490. newXfa.splice(2, 0, "datasets");
  39491. newXfa.splice(3, 0, xfaDatasetsRef);
  39492. dict.set("XFA", newXfa);
  39493. }
  39494. if (needAppearances) {
  39495. dict.set("NeedAppearances", true);
  39496. }
  39497. const buffer = [];
  39498. await writeObject(acroFormRef, dict, buffer, xref);
  39499. newRefs.push({
  39500. ref: acroFormRef,
  39501. data: buffer.join("")
  39502. });
  39503. }
  39504. function updateXFA({
  39505. xfaData,
  39506. xfaDatasetsRef,
  39507. newRefs,
  39508. xref
  39509. }) {
  39510. if (xfaData === null) {
  39511. const datasets = xref.fetchIfRef(xfaDatasetsRef);
  39512. xfaData = writeXFADataForAcroform(datasets.getString(), newRefs);
  39513. }
  39514. const encrypt = xref.encrypt;
  39515. if (encrypt) {
  39516. const transform = encrypt.createCipherTransform(xfaDatasetsRef.num, xfaDatasetsRef.gen);
  39517. xfaData = transform.encryptString(xfaData);
  39518. }
  39519. const data = `${xfaDatasetsRef.num} ${xfaDatasetsRef.gen} obj\n` + `<< /Type /EmbeddedFile /Length ${xfaData.length}>>\nstream\n` + xfaData + "\nendstream\nendobj\n";
  39520. newRefs.push({
  39521. ref: xfaDatasetsRef,
  39522. data
  39523. });
  39524. }
  39525. async function getXRefTable(xrefInfo, baseOffset, newRefs, newXref, buffer) {
  39526. buffer.push("xref\n");
  39527. const indexes = getIndexes(newRefs);
  39528. let indexesPosition = 0;
  39529. for (const {
  39530. ref,
  39531. data
  39532. } of newRefs) {
  39533. if (ref.num === indexes[indexesPosition]) {
  39534. buffer.push(`${indexes[indexesPosition]} ${indexes[indexesPosition + 1]}\n`);
  39535. indexesPosition += 2;
  39536. }
  39537. if (data !== null) {
  39538. buffer.push(`${baseOffset.toString().padStart(10, "0")} ${Math.min(ref.gen, 0xffff).toString().padStart(5, "0")} n\r\n`);
  39539. baseOffset += data.length;
  39540. } else {
  39541. buffer.push(`0000000000 ${Math.min(ref.gen + 1, 0xffff).toString().padStart(5, "0")} f\r\n`);
  39542. }
  39543. }
  39544. computeIDs(baseOffset, xrefInfo, newXref);
  39545. buffer.push("trailer\n");
  39546. await writeDict(newXref, buffer);
  39547. buffer.push("\nstartxref\n", baseOffset.toString(), "\n%%EOF\n");
  39548. }
  39549. function getIndexes(newRefs) {
  39550. const indexes = [];
  39551. for (const {
  39552. ref
  39553. } of newRefs) {
  39554. if (ref.num === indexes.at(-2) + indexes.at(-1)) {
  39555. indexes[indexes.length - 1] += 1;
  39556. } else {
  39557. indexes.push(ref.num, 1);
  39558. }
  39559. }
  39560. return indexes;
  39561. }
  39562. async function getXRefStreamTable(xrefInfo, baseOffset, newRefs, newXref, buffer) {
  39563. const xrefTableData = [];
  39564. let maxOffset = 0;
  39565. let maxGen = 0;
  39566. for (const {
  39567. ref,
  39568. data
  39569. } of newRefs) {
  39570. let gen;
  39571. maxOffset = Math.max(maxOffset, baseOffset);
  39572. if (data !== null) {
  39573. gen = Math.min(ref.gen, 0xffff);
  39574. xrefTableData.push([1, baseOffset, gen]);
  39575. baseOffset += data.length;
  39576. } else {
  39577. gen = Math.min(ref.gen + 1, 0xffff);
  39578. xrefTableData.push([0, 0, gen]);
  39579. }
  39580. maxGen = Math.max(maxGen, gen);
  39581. }
  39582. newXref.set("Index", getIndexes(newRefs));
  39583. const offsetSize = getSizeInBytes(maxOffset);
  39584. const maxGenSize = getSizeInBytes(maxGen);
  39585. const sizes = [1, offsetSize, maxGenSize];
  39586. newXref.set("W", sizes);
  39587. computeIDs(baseOffset, xrefInfo, newXref);
  39588. const structSize = sizes.reduce((a, x) => a + x, 0);
  39589. const data = new Uint8Array(structSize * xrefTableData.length);
  39590. const stream = new Stream(data);
  39591. stream.dict = newXref;
  39592. let offset = 0;
  39593. for (const [type, objOffset, gen] of xrefTableData) {
  39594. offset = writeInt(type, sizes[0], offset, data);
  39595. offset = writeInt(objOffset, sizes[1], offset, data);
  39596. offset = writeInt(gen, sizes[2], offset, data);
  39597. }
  39598. await writeObject(xrefInfo.newRef, stream, buffer, {});
  39599. buffer.push("startxref\n", baseOffset.toString(), "\n%%EOF\n");
  39600. }
  39601. function computeIDs(baseOffset, xrefInfo, newXref) {
  39602. if (Array.isArray(xrefInfo.fileIds) && xrefInfo.fileIds.length > 0) {
  39603. const md5 = computeMD5(baseOffset, xrefInfo);
  39604. newXref.set("ID", [xrefInfo.fileIds[0], md5]);
  39605. }
  39606. }
  39607. function getTrailerDict(xrefInfo, newRefs, useXrefStream) {
  39608. const newXref = new Dict(null);
  39609. newXref.set("Prev", xrefInfo.startXRef);
  39610. const refForXrefTable = xrefInfo.newRef;
  39611. if (useXrefStream) {
  39612. newRefs.push({
  39613. ref: refForXrefTable,
  39614. data: ""
  39615. });
  39616. newXref.set("Size", refForXrefTable.num + 1);
  39617. newXref.set("Type", Name.get("XRef"));
  39618. } else {
  39619. newXref.set("Size", refForXrefTable.num);
  39620. }
  39621. if (xrefInfo.rootRef !== null) {
  39622. newXref.set("Root", xrefInfo.rootRef);
  39623. }
  39624. if (xrefInfo.infoRef !== null) {
  39625. newXref.set("Info", xrefInfo.infoRef);
  39626. }
  39627. if (xrefInfo.encryptRef !== null) {
  39628. newXref.set("Encrypt", xrefInfo.encryptRef);
  39629. }
  39630. return newXref;
  39631. }
  39632. async function incrementalUpdate({
  39633. originalData,
  39634. xrefInfo,
  39635. newRefs,
  39636. xref = null,
  39637. hasXfa = false,
  39638. xfaDatasetsRef = null,
  39639. hasXfaDatasetsEntry = false,
  39640. needAppearances,
  39641. acroFormRef = null,
  39642. acroForm = null,
  39643. xfaData = null,
  39644. useXrefStream = false
  39645. }) {
  39646. await updateAcroform({
  39647. xref,
  39648. acroForm,
  39649. acroFormRef,
  39650. hasXfa,
  39651. hasXfaDatasetsEntry,
  39652. xfaDatasetsRef,
  39653. needAppearances,
  39654. newRefs
  39655. });
  39656. if (hasXfa) {
  39657. updateXFA({
  39658. xfaData,
  39659. xfaDatasetsRef,
  39660. newRefs,
  39661. xref
  39662. });
  39663. }
  39664. const buffer = [];
  39665. let baseOffset = originalData.length;
  39666. const lastByte = originalData.at(-1);
  39667. if (lastByte !== 0x0a && lastByte !== 0x0d) {
  39668. buffer.push("\n");
  39669. baseOffset += 1;
  39670. }
  39671. const newXref = getTrailerDict(xrefInfo, newRefs, useXrefStream);
  39672. newRefs = newRefs.sort((a, b) => a.ref.num - b.ref.num);
  39673. for (const {
  39674. data
  39675. } of newRefs) {
  39676. if (data !== null) {
  39677. buffer.push(data);
  39678. }
  39679. }
  39680. await (useXrefStream ? getXRefStreamTable(xrefInfo, baseOffset, newRefs, newXref, buffer) : getXRefTable(xrefInfo, baseOffset, newRefs, newXref, buffer));
  39681. const totalLength = buffer.reduce((a, str) => a + str.length, originalData.length);
  39682. const array = new Uint8Array(totalLength);
  39683. array.set(originalData);
  39684. let offset = originalData.length;
  39685. for (const str of buffer) {
  39686. writeString(str, offset, array);
  39687. offset += str.length;
  39688. }
  39689. return array;
  39690. }
  39691. ;// ./src/core/struct_tree.js
  39692. const MAX_DEPTH = 40;
  39693. const StructElementType = {
  39694. PAGE_CONTENT: 1,
  39695. STREAM_CONTENT: 2,
  39696. OBJECT: 3,
  39697. ANNOTATION: 4,
  39698. ELEMENT: 5
  39699. };
  39700. class StructTreeRoot {
  39701. constructor(rootDict, rootRef) {
  39702. this.dict = rootDict;
  39703. this.ref = rootRef instanceof Ref ? rootRef : null;
  39704. this.roleMap = new Map();
  39705. this.structParentIds = null;
  39706. }
  39707. init() {
  39708. this.readRoleMap();
  39709. }
  39710. #addIdToPage(pageRef, id, type) {
  39711. if (!(pageRef instanceof Ref) || id < 0) {
  39712. return;
  39713. }
  39714. this.structParentIds ||= new RefSetCache();
  39715. let ids = this.structParentIds.get(pageRef);
  39716. if (!ids) {
  39717. ids = [];
  39718. this.structParentIds.put(pageRef, ids);
  39719. }
  39720. ids.push([id, type]);
  39721. }
  39722. addAnnotationIdToPage(pageRef, id) {
  39723. this.#addIdToPage(pageRef, id, StructElementType.ANNOTATION);
  39724. }
  39725. readRoleMap() {
  39726. const roleMapDict = this.dict.get("RoleMap");
  39727. if (!(roleMapDict instanceof Dict)) {
  39728. return;
  39729. }
  39730. roleMapDict.forEach((key, value) => {
  39731. if (!(value instanceof Name)) {
  39732. return;
  39733. }
  39734. this.roleMap.set(key, value.name);
  39735. });
  39736. }
  39737. static async canCreateStructureTree({
  39738. catalogRef,
  39739. pdfManager,
  39740. newAnnotationsByPage
  39741. }) {
  39742. if (!(catalogRef instanceof Ref)) {
  39743. warn("Cannot save the struct tree: no catalog reference.");
  39744. return false;
  39745. }
  39746. let nextKey = 0;
  39747. let hasNothingToUpdate = true;
  39748. for (const [pageIndex, elements] of newAnnotationsByPage) {
  39749. const {
  39750. ref: pageRef
  39751. } = await pdfManager.getPage(pageIndex);
  39752. if (!(pageRef instanceof Ref)) {
  39753. warn(`Cannot save the struct tree: page ${pageIndex} has no ref.`);
  39754. hasNothingToUpdate = true;
  39755. break;
  39756. }
  39757. for (const element of elements) {
  39758. if (element.accessibilityData?.type) {
  39759. element.parentTreeId = nextKey++;
  39760. hasNothingToUpdate = false;
  39761. }
  39762. }
  39763. }
  39764. if (hasNothingToUpdate) {
  39765. for (const elements of newAnnotationsByPage.values()) {
  39766. for (const element of elements) {
  39767. delete element.parentTreeId;
  39768. }
  39769. }
  39770. return false;
  39771. }
  39772. return true;
  39773. }
  39774. static async createStructureTree({
  39775. newAnnotationsByPage,
  39776. xref,
  39777. catalogRef,
  39778. pdfManager,
  39779. newRefs
  39780. }) {
  39781. const root = pdfManager.catalog.cloneDict();
  39782. const cache = new RefSetCache();
  39783. cache.put(catalogRef, root);
  39784. const structTreeRootRef = xref.getNewTemporaryRef();
  39785. root.set("StructTreeRoot", structTreeRootRef);
  39786. const structTreeRoot = new Dict(xref);
  39787. structTreeRoot.set("Type", Name.get("StructTreeRoot"));
  39788. const parentTreeRef = xref.getNewTemporaryRef();
  39789. structTreeRoot.set("ParentTree", parentTreeRef);
  39790. const kids = [];
  39791. structTreeRoot.set("K", kids);
  39792. cache.put(structTreeRootRef, structTreeRoot);
  39793. const parentTree = new Dict(xref);
  39794. const nums = [];
  39795. parentTree.set("Nums", nums);
  39796. const nextKey = await this.#writeKids({
  39797. newAnnotationsByPage,
  39798. structTreeRootRef,
  39799. structTreeRoot: null,
  39800. kids,
  39801. nums,
  39802. xref,
  39803. pdfManager,
  39804. newRefs,
  39805. cache
  39806. });
  39807. structTreeRoot.set("ParentTreeNextKey", nextKey);
  39808. cache.put(parentTreeRef, parentTree);
  39809. const buffer = [];
  39810. for (const [ref, obj] of cache.items()) {
  39811. buffer.length = 0;
  39812. await writeObject(ref, obj, buffer, xref);
  39813. newRefs.push({
  39814. ref,
  39815. data: buffer.join("")
  39816. });
  39817. }
  39818. }
  39819. async canUpdateStructTree({
  39820. pdfManager,
  39821. xref,
  39822. newAnnotationsByPage
  39823. }) {
  39824. if (!this.ref) {
  39825. warn("Cannot update the struct tree: no root reference.");
  39826. return false;
  39827. }
  39828. let nextKey = this.dict.get("ParentTreeNextKey");
  39829. if (!Number.isInteger(nextKey) || nextKey < 0) {
  39830. warn("Cannot update the struct tree: invalid next key.");
  39831. return false;
  39832. }
  39833. const parentTree = this.dict.get("ParentTree");
  39834. if (!(parentTree instanceof Dict)) {
  39835. warn("Cannot update the struct tree: ParentTree isn't a dict.");
  39836. return false;
  39837. }
  39838. const nums = parentTree.get("Nums");
  39839. if (!Array.isArray(nums)) {
  39840. warn("Cannot update the struct tree: nums isn't an array.");
  39841. return false;
  39842. }
  39843. const numberTree = new NumberTree(parentTree, xref);
  39844. for (const pageIndex of newAnnotationsByPage.keys()) {
  39845. const {
  39846. pageDict
  39847. } = await pdfManager.getPage(pageIndex);
  39848. if (!pageDict.has("StructParents")) {
  39849. continue;
  39850. }
  39851. const id = pageDict.get("StructParents");
  39852. if (!Number.isInteger(id) || !Array.isArray(numberTree.get(id))) {
  39853. warn(`Cannot save the struct tree: page ${pageIndex} has a wrong id.`);
  39854. return false;
  39855. }
  39856. }
  39857. let hasNothingToUpdate = true;
  39858. for (const [pageIndex, elements] of newAnnotationsByPage) {
  39859. const {
  39860. pageDict
  39861. } = await pdfManager.getPage(pageIndex);
  39862. StructTreeRoot.#collectParents({
  39863. elements,
  39864. xref: this.dict.xref,
  39865. pageDict,
  39866. numberTree
  39867. });
  39868. for (const element of elements) {
  39869. if (element.accessibilityData?.type) {
  39870. if (!(element.accessibilityData.structParent >= 0)) {
  39871. element.parentTreeId = nextKey++;
  39872. }
  39873. hasNothingToUpdate = false;
  39874. }
  39875. }
  39876. }
  39877. if (hasNothingToUpdate) {
  39878. for (const elements of newAnnotationsByPage.values()) {
  39879. for (const element of elements) {
  39880. delete element.parentTreeId;
  39881. delete element.structTreeParent;
  39882. }
  39883. }
  39884. return false;
  39885. }
  39886. return true;
  39887. }
  39888. async updateStructureTree({
  39889. newAnnotationsByPage,
  39890. pdfManager,
  39891. newRefs
  39892. }) {
  39893. const xref = this.dict.xref;
  39894. const structTreeRoot = this.dict.clone();
  39895. const structTreeRootRef = this.ref;
  39896. const cache = new RefSetCache();
  39897. cache.put(structTreeRootRef, structTreeRoot);
  39898. let parentTreeRef = structTreeRoot.getRaw("ParentTree");
  39899. let parentTree;
  39900. if (parentTreeRef instanceof Ref) {
  39901. parentTree = xref.fetch(parentTreeRef);
  39902. } else {
  39903. parentTree = parentTreeRef;
  39904. parentTreeRef = xref.getNewTemporaryRef();
  39905. structTreeRoot.set("ParentTree", parentTreeRef);
  39906. }
  39907. parentTree = parentTree.clone();
  39908. cache.put(parentTreeRef, parentTree);
  39909. let nums = parentTree.getRaw("Nums");
  39910. let numsRef = null;
  39911. if (nums instanceof Ref) {
  39912. numsRef = nums;
  39913. nums = xref.fetch(numsRef);
  39914. }
  39915. nums = nums.slice();
  39916. if (!numsRef) {
  39917. parentTree.set("Nums", nums);
  39918. }
  39919. const newNextKey = await StructTreeRoot.#writeKids({
  39920. newAnnotationsByPage,
  39921. structTreeRootRef,
  39922. structTreeRoot: this,
  39923. kids: null,
  39924. nums,
  39925. xref,
  39926. pdfManager,
  39927. newRefs,
  39928. cache
  39929. });
  39930. if (newNextKey === -1) {
  39931. return;
  39932. }
  39933. structTreeRoot.set("ParentTreeNextKey", newNextKey);
  39934. if (numsRef) {
  39935. cache.put(numsRef, nums);
  39936. }
  39937. const buffer = [];
  39938. for (const [ref, obj] of cache.items()) {
  39939. buffer.length = 0;
  39940. await writeObject(ref, obj, buffer, xref);
  39941. newRefs.push({
  39942. ref,
  39943. data: buffer.join("")
  39944. });
  39945. }
  39946. }
  39947. static async #writeKids({
  39948. newAnnotationsByPage,
  39949. structTreeRootRef,
  39950. structTreeRoot,
  39951. kids,
  39952. nums,
  39953. xref,
  39954. pdfManager,
  39955. newRefs,
  39956. cache
  39957. }) {
  39958. const objr = Name.get("OBJR");
  39959. let nextKey = -1;
  39960. let structTreePageObjs;
  39961. const buffer = [];
  39962. for (const [pageIndex, elements] of newAnnotationsByPage) {
  39963. const page = await pdfManager.getPage(pageIndex);
  39964. const {
  39965. ref: pageRef
  39966. } = page;
  39967. const isPageRef = pageRef instanceof Ref;
  39968. for (const {
  39969. accessibilityData,
  39970. ref,
  39971. parentTreeId,
  39972. structTreeParent
  39973. } of elements) {
  39974. if (!accessibilityData?.type) {
  39975. continue;
  39976. }
  39977. const {
  39978. structParent
  39979. } = accessibilityData;
  39980. if (structTreeRoot && Number.isInteger(structParent) && structParent >= 0) {
  39981. let objs = (structTreePageObjs ||= new Map()).get(pageIndex);
  39982. if (objs === undefined) {
  39983. const structTreePage = new StructTreePage(structTreeRoot, page.pageDict);
  39984. objs = structTreePage.collectObjects(pageRef);
  39985. structTreePageObjs.set(pageIndex, objs);
  39986. }
  39987. const objRef = objs?.get(structParent);
  39988. if (objRef) {
  39989. const tagDict = xref.fetch(objRef).clone();
  39990. StructTreeRoot.#writeProperties(tagDict, accessibilityData);
  39991. buffer.length = 0;
  39992. await writeObject(objRef, tagDict, buffer, xref);
  39993. newRefs.push({
  39994. ref: objRef,
  39995. data: buffer.join("")
  39996. });
  39997. continue;
  39998. }
  39999. }
  40000. nextKey = Math.max(nextKey, parentTreeId);
  40001. const tagRef = xref.getNewTemporaryRef();
  40002. const tagDict = new Dict(xref);
  40003. StructTreeRoot.#writeProperties(tagDict, accessibilityData);
  40004. await this.#updateParentTag({
  40005. structTreeParent,
  40006. tagDict,
  40007. newTagRef: tagRef,
  40008. structTreeRootRef,
  40009. fallbackKids: kids,
  40010. xref,
  40011. cache
  40012. });
  40013. const objDict = new Dict(xref);
  40014. tagDict.set("K", objDict);
  40015. objDict.set("Type", objr);
  40016. if (isPageRef) {
  40017. objDict.set("Pg", pageRef);
  40018. }
  40019. objDict.set("Obj", ref);
  40020. cache.put(tagRef, tagDict);
  40021. nums.push(parentTreeId, tagRef);
  40022. }
  40023. }
  40024. return nextKey + 1;
  40025. }
  40026. static #writeProperties(tagDict, {
  40027. type,
  40028. title,
  40029. lang,
  40030. alt,
  40031. expanded,
  40032. actualText
  40033. }) {
  40034. tagDict.set("S", Name.get(type));
  40035. if (title) {
  40036. tagDict.set("T", stringToAsciiOrUTF16BE(title));
  40037. }
  40038. if (lang) {
  40039. tagDict.set("Lang", stringToAsciiOrUTF16BE(lang));
  40040. }
  40041. if (alt) {
  40042. tagDict.set("Alt", stringToAsciiOrUTF16BE(alt));
  40043. }
  40044. if (expanded) {
  40045. tagDict.set("E", stringToAsciiOrUTF16BE(expanded));
  40046. }
  40047. if (actualText) {
  40048. tagDict.set("ActualText", stringToAsciiOrUTF16BE(actualText));
  40049. }
  40050. }
  40051. static #collectParents({
  40052. elements,
  40053. xref,
  40054. pageDict,
  40055. numberTree
  40056. }) {
  40057. const idToElements = new Map();
  40058. for (const element of elements) {
  40059. if (element.structTreeParentId) {
  40060. const id = parseInt(element.structTreeParentId.split("_mc")[1], 10);
  40061. let elems = idToElements.get(id);
  40062. if (!elems) {
  40063. elems = [];
  40064. idToElements.set(id, elems);
  40065. }
  40066. elems.push(element);
  40067. }
  40068. }
  40069. const id = pageDict.get("StructParents");
  40070. if (!Number.isInteger(id)) {
  40071. return;
  40072. }
  40073. const parentArray = numberTree.get(id);
  40074. const updateElement = (kid, pageKid, kidRef) => {
  40075. const elems = idToElements.get(kid);
  40076. if (elems) {
  40077. const parentRef = pageKid.getRaw("P");
  40078. const parentDict = xref.fetchIfRef(parentRef);
  40079. if (parentRef instanceof Ref && parentDict instanceof Dict) {
  40080. const params = {
  40081. ref: kidRef,
  40082. dict: pageKid
  40083. };
  40084. for (const element of elems) {
  40085. element.structTreeParent = params;
  40086. }
  40087. }
  40088. return true;
  40089. }
  40090. return false;
  40091. };
  40092. for (const kidRef of parentArray) {
  40093. if (!(kidRef instanceof Ref)) {
  40094. continue;
  40095. }
  40096. const pageKid = xref.fetch(kidRef);
  40097. const k = pageKid.get("K");
  40098. if (Number.isInteger(k)) {
  40099. updateElement(k, pageKid, kidRef);
  40100. continue;
  40101. }
  40102. if (!Array.isArray(k)) {
  40103. continue;
  40104. }
  40105. for (let kid of k) {
  40106. kid = xref.fetchIfRef(kid);
  40107. if (Number.isInteger(kid) && updateElement(kid, pageKid, kidRef)) {
  40108. break;
  40109. }
  40110. if (!(kid instanceof Dict)) {
  40111. continue;
  40112. }
  40113. if (!isName(kid.get("Type"), "MCR")) {
  40114. break;
  40115. }
  40116. const mcid = kid.get("MCID");
  40117. if (Number.isInteger(mcid) && updateElement(mcid, pageKid, kidRef)) {
  40118. break;
  40119. }
  40120. }
  40121. }
  40122. }
  40123. static async #updateParentTag({
  40124. structTreeParent,
  40125. tagDict,
  40126. newTagRef,
  40127. structTreeRootRef,
  40128. fallbackKids,
  40129. xref,
  40130. cache
  40131. }) {
  40132. let ref = null;
  40133. let parentRef;
  40134. if (structTreeParent) {
  40135. ({
  40136. ref
  40137. } = structTreeParent);
  40138. parentRef = structTreeParent.dict.getRaw("P") || structTreeRootRef;
  40139. } else {
  40140. parentRef = structTreeRootRef;
  40141. }
  40142. tagDict.set("P", parentRef);
  40143. const parentDict = xref.fetchIfRef(parentRef);
  40144. if (!parentDict) {
  40145. fallbackKids.push(newTagRef);
  40146. return;
  40147. }
  40148. let cachedParentDict = cache.get(parentRef);
  40149. if (!cachedParentDict) {
  40150. cachedParentDict = parentDict.clone();
  40151. cache.put(parentRef, cachedParentDict);
  40152. }
  40153. const parentKidsRaw = cachedParentDict.getRaw("K");
  40154. let cachedParentKids = parentKidsRaw instanceof Ref ? cache.get(parentKidsRaw) : null;
  40155. if (!cachedParentKids) {
  40156. cachedParentKids = xref.fetchIfRef(parentKidsRaw);
  40157. cachedParentKids = Array.isArray(cachedParentKids) ? cachedParentKids.slice() : [parentKidsRaw];
  40158. const parentKidsRef = xref.getNewTemporaryRef();
  40159. cachedParentDict.set("K", parentKidsRef);
  40160. cache.put(parentKidsRef, cachedParentKids);
  40161. }
  40162. const index = cachedParentKids.indexOf(ref);
  40163. cachedParentKids.splice(index >= 0 ? index + 1 : cachedParentKids.length, 0, newTagRef);
  40164. }
  40165. }
  40166. class StructElementNode {
  40167. constructor(tree, dict) {
  40168. this.tree = tree;
  40169. this.dict = dict;
  40170. this.kids = [];
  40171. this.parseKids();
  40172. }
  40173. get role() {
  40174. const nameObj = this.dict.get("S");
  40175. const name = nameObj instanceof Name ? nameObj.name : "";
  40176. const {
  40177. root
  40178. } = this.tree;
  40179. if (root.roleMap.has(name)) {
  40180. return root.roleMap.get(name);
  40181. }
  40182. return name;
  40183. }
  40184. parseKids() {
  40185. let pageObjId = null;
  40186. const objRef = this.dict.getRaw("Pg");
  40187. if (objRef instanceof Ref) {
  40188. pageObjId = objRef.toString();
  40189. }
  40190. const kids = this.dict.get("K");
  40191. if (Array.isArray(kids)) {
  40192. for (const kid of kids) {
  40193. const element = this.parseKid(pageObjId, kid);
  40194. if (element) {
  40195. this.kids.push(element);
  40196. }
  40197. }
  40198. } else {
  40199. const element = this.parseKid(pageObjId, kids);
  40200. if (element) {
  40201. this.kids.push(element);
  40202. }
  40203. }
  40204. }
  40205. parseKid(pageObjId, kid) {
  40206. if (Number.isInteger(kid)) {
  40207. if (this.tree.pageDict.objId !== pageObjId) {
  40208. return null;
  40209. }
  40210. return new StructElement({
  40211. type: StructElementType.PAGE_CONTENT,
  40212. mcid: kid,
  40213. pageObjId
  40214. });
  40215. }
  40216. let kidDict = null;
  40217. if (kid instanceof Ref) {
  40218. kidDict = this.dict.xref.fetch(kid);
  40219. } else if (kid instanceof Dict) {
  40220. kidDict = kid;
  40221. }
  40222. if (!kidDict) {
  40223. return null;
  40224. }
  40225. const pageRef = kidDict.getRaw("Pg");
  40226. if (pageRef instanceof Ref) {
  40227. pageObjId = pageRef.toString();
  40228. }
  40229. const type = kidDict.get("Type") instanceof Name ? kidDict.get("Type").name : null;
  40230. if (type === "MCR") {
  40231. if (this.tree.pageDict.objId !== pageObjId) {
  40232. return null;
  40233. }
  40234. const kidRef = kidDict.getRaw("Stm");
  40235. return new StructElement({
  40236. type: StructElementType.STREAM_CONTENT,
  40237. refObjId: kidRef instanceof Ref ? kidRef.toString() : null,
  40238. pageObjId,
  40239. mcid: kidDict.get("MCID")
  40240. });
  40241. }
  40242. if (type === "OBJR") {
  40243. if (this.tree.pageDict.objId !== pageObjId) {
  40244. return null;
  40245. }
  40246. const kidRef = kidDict.getRaw("Obj");
  40247. return new StructElement({
  40248. type: StructElementType.OBJECT,
  40249. refObjId: kidRef instanceof Ref ? kidRef.toString() : null,
  40250. pageObjId
  40251. });
  40252. }
  40253. return new StructElement({
  40254. type: StructElementType.ELEMENT,
  40255. dict: kidDict
  40256. });
  40257. }
  40258. }
  40259. class StructElement {
  40260. constructor({
  40261. type,
  40262. dict = null,
  40263. mcid = null,
  40264. pageObjId = null,
  40265. refObjId = null
  40266. }) {
  40267. this.type = type;
  40268. this.dict = dict;
  40269. this.mcid = mcid;
  40270. this.pageObjId = pageObjId;
  40271. this.refObjId = refObjId;
  40272. this.parentNode = null;
  40273. }
  40274. }
  40275. class StructTreePage {
  40276. constructor(structTreeRoot, pageDict) {
  40277. this.root = structTreeRoot;
  40278. this.rootDict = structTreeRoot ? structTreeRoot.dict : null;
  40279. this.pageDict = pageDict;
  40280. this.nodes = [];
  40281. }
  40282. collectObjects(pageRef) {
  40283. if (!this.root || !this.rootDict || !(pageRef instanceof Ref)) {
  40284. return null;
  40285. }
  40286. const parentTree = this.rootDict.get("ParentTree");
  40287. if (!parentTree) {
  40288. return null;
  40289. }
  40290. const ids = this.root.structParentIds?.get(pageRef);
  40291. if (!ids) {
  40292. return null;
  40293. }
  40294. const map = new Map();
  40295. const numberTree = new NumberTree(parentTree, this.rootDict.xref);
  40296. for (const [elemId] of ids) {
  40297. const obj = numberTree.getRaw(elemId);
  40298. if (obj instanceof Ref) {
  40299. map.set(elemId, obj);
  40300. }
  40301. }
  40302. return map;
  40303. }
  40304. parse(pageRef) {
  40305. if (!this.root || !this.rootDict || !(pageRef instanceof Ref)) {
  40306. return;
  40307. }
  40308. const parentTree = this.rootDict.get("ParentTree");
  40309. if (!parentTree) {
  40310. return;
  40311. }
  40312. const id = this.pageDict.get("StructParents");
  40313. const ids = this.root.structParentIds?.get(pageRef);
  40314. if (!Number.isInteger(id) && !ids) {
  40315. return;
  40316. }
  40317. const map = new Map();
  40318. const numberTree = new NumberTree(parentTree, this.rootDict.xref);
  40319. if (Number.isInteger(id)) {
  40320. const parentArray = numberTree.get(id);
  40321. if (Array.isArray(parentArray)) {
  40322. for (const ref of parentArray) {
  40323. if (ref instanceof Ref) {
  40324. this.addNode(this.rootDict.xref.fetch(ref), map);
  40325. }
  40326. }
  40327. }
  40328. }
  40329. if (!ids) {
  40330. return;
  40331. }
  40332. for (const [elemId, type] of ids) {
  40333. const obj = numberTree.get(elemId);
  40334. if (obj) {
  40335. const elem = this.addNode(this.rootDict.xref.fetchIfRef(obj), map);
  40336. if (elem?.kids?.length === 1 && elem.kids[0].type === StructElementType.OBJECT) {
  40337. elem.kids[0].type = type;
  40338. }
  40339. }
  40340. }
  40341. }
  40342. addNode(dict, map, level = 0) {
  40343. if (level > MAX_DEPTH) {
  40344. warn("StructTree MAX_DEPTH reached.");
  40345. return null;
  40346. }
  40347. if (!(dict instanceof Dict)) {
  40348. return null;
  40349. }
  40350. if (map.has(dict)) {
  40351. return map.get(dict);
  40352. }
  40353. const element = new StructElementNode(this, dict);
  40354. map.set(dict, element);
  40355. const parent = dict.get("P");
  40356. if (!parent || isName(parent.get("Type"), "StructTreeRoot")) {
  40357. if (!this.addTopLevelNode(dict, element)) {
  40358. map.delete(dict);
  40359. }
  40360. return element;
  40361. }
  40362. const parentNode = this.addNode(parent, map, level + 1);
  40363. if (!parentNode) {
  40364. return element;
  40365. }
  40366. let save = false;
  40367. for (const kid of parentNode.kids) {
  40368. if (kid.type === StructElementType.ELEMENT && kid.dict === dict) {
  40369. kid.parentNode = element;
  40370. save = true;
  40371. }
  40372. }
  40373. if (!save) {
  40374. map.delete(dict);
  40375. }
  40376. return element;
  40377. }
  40378. addTopLevelNode(dict, element) {
  40379. const obj = this.rootDict.get("K");
  40380. if (!obj) {
  40381. return false;
  40382. }
  40383. if (obj instanceof Dict) {
  40384. if (obj.objId !== dict.objId) {
  40385. return false;
  40386. }
  40387. this.nodes[0] = element;
  40388. return true;
  40389. }
  40390. if (!Array.isArray(obj)) {
  40391. return true;
  40392. }
  40393. let save = false;
  40394. for (let i = 0; i < obj.length; i++) {
  40395. const kidRef = obj[i];
  40396. if (kidRef?.toString() === dict.objId) {
  40397. this.nodes[i] = element;
  40398. save = true;
  40399. }
  40400. }
  40401. return save;
  40402. }
  40403. get serializable() {
  40404. function nodeToSerializable(node, parent, level = 0) {
  40405. if (level > MAX_DEPTH) {
  40406. warn("StructTree too deep to be fully serialized.");
  40407. return;
  40408. }
  40409. const obj = Object.create(null);
  40410. obj.role = node.role;
  40411. obj.children = [];
  40412. parent.children.push(obj);
  40413. let alt = node.dict.get("Alt");
  40414. if (typeof alt !== "string") {
  40415. alt = node.dict.get("ActualText");
  40416. }
  40417. if (typeof alt === "string") {
  40418. obj.alt = stringToPDFString(alt);
  40419. }
  40420. const a = node.dict.get("A");
  40421. if (a instanceof Dict) {
  40422. const bbox = lookupNormalRect(a.getArray("BBox"), null);
  40423. if (bbox) {
  40424. obj.bbox = bbox;
  40425. } else {
  40426. const width = a.get("Width");
  40427. const height = a.get("Height");
  40428. if (typeof width === "number" && width > 0 && typeof height === "number" && height > 0) {
  40429. obj.bbox = [0, 0, width, height];
  40430. }
  40431. }
  40432. }
  40433. const lang = node.dict.get("Lang");
  40434. if (typeof lang === "string") {
  40435. obj.lang = stringToPDFString(lang);
  40436. }
  40437. for (const kid of node.kids) {
  40438. const kidElement = kid.type === StructElementType.ELEMENT ? kid.parentNode : null;
  40439. if (kidElement) {
  40440. nodeToSerializable(kidElement, obj, level + 1);
  40441. continue;
  40442. } else if (kid.type === StructElementType.PAGE_CONTENT || kid.type === StructElementType.STREAM_CONTENT) {
  40443. obj.children.push({
  40444. type: "content",
  40445. id: `p${kid.pageObjId}_mc${kid.mcid}`
  40446. });
  40447. } else if (kid.type === StructElementType.OBJECT) {
  40448. obj.children.push({
  40449. type: "object",
  40450. id: kid.refObjId
  40451. });
  40452. } else if (kid.type === StructElementType.ANNOTATION) {
  40453. obj.children.push({
  40454. type: "annotation",
  40455. id: `${AnnotationPrefix}${kid.refObjId}`
  40456. });
  40457. }
  40458. }
  40459. }
  40460. const root = Object.create(null);
  40461. root.children = [];
  40462. root.role = "Root";
  40463. for (const child of this.nodes) {
  40464. if (!child) {
  40465. continue;
  40466. }
  40467. nodeToSerializable(child, root);
  40468. }
  40469. return root;
  40470. }
  40471. }
  40472. ;// ./src/core/catalog.js
  40473. function isValidExplicitDest(dest) {
  40474. if (!Array.isArray(dest) || dest.length < 2) {
  40475. return false;
  40476. }
  40477. const [page, zoom, ...args] = dest;
  40478. if (!(page instanceof Ref) && !Number.isInteger(page)) {
  40479. return false;
  40480. }
  40481. if (!(zoom instanceof Name)) {
  40482. return false;
  40483. }
  40484. const argsLen = args.length;
  40485. let allowNull = true;
  40486. switch (zoom.name) {
  40487. case "XYZ":
  40488. if (argsLen < 2 || argsLen > 3) {
  40489. return false;
  40490. }
  40491. break;
  40492. case "Fit":
  40493. case "FitB":
  40494. return argsLen === 0;
  40495. case "FitH":
  40496. case "FitBH":
  40497. case "FitV":
  40498. case "FitBV":
  40499. if (argsLen > 1) {
  40500. return false;
  40501. }
  40502. break;
  40503. case "FitR":
  40504. if (argsLen !== 4) {
  40505. return false;
  40506. }
  40507. allowNull = false;
  40508. break;
  40509. default:
  40510. return false;
  40511. }
  40512. for (const arg of args) {
  40513. if (!(typeof arg === "number" || allowNull && arg === null)) {
  40514. return false;
  40515. }
  40516. }
  40517. return true;
  40518. }
  40519. function fetchDest(dest) {
  40520. if (dest instanceof Dict) {
  40521. dest = dest.get("D");
  40522. }
  40523. return isValidExplicitDest(dest) ? dest : null;
  40524. }
  40525. function fetchRemoteDest(action) {
  40526. let dest = action.get("D");
  40527. if (dest) {
  40528. if (dest instanceof Name) {
  40529. dest = dest.name;
  40530. }
  40531. if (typeof dest === "string") {
  40532. return stringToPDFString(dest);
  40533. } else if (isValidExplicitDest(dest)) {
  40534. return JSON.stringify(dest);
  40535. }
  40536. }
  40537. return null;
  40538. }
  40539. class Catalog {
  40540. constructor(pdfManager, xref) {
  40541. this.pdfManager = pdfManager;
  40542. this.xref = xref;
  40543. this._catDict = xref.getCatalogObj();
  40544. if (!(this._catDict instanceof Dict)) {
  40545. throw new FormatError("Catalog object is not a dictionary.");
  40546. }
  40547. this.toplevelPagesDict;
  40548. this._actualNumPages = null;
  40549. this.fontCache = new RefSetCache();
  40550. this.builtInCMapCache = new Map();
  40551. this.standardFontDataCache = new Map();
  40552. this.globalImageCache = new GlobalImageCache();
  40553. this.pageKidsCountCache = new RefSetCache();
  40554. this.pageIndexCache = new RefSetCache();
  40555. this.pageDictCache = new RefSetCache();
  40556. this.nonBlendModesSet = new RefSet();
  40557. this.systemFontCache = new Map();
  40558. }
  40559. cloneDict() {
  40560. return this._catDict.clone();
  40561. }
  40562. get version() {
  40563. const version = this._catDict.get("Version");
  40564. if (version instanceof Name) {
  40565. if (PDF_VERSION_REGEXP.test(version.name)) {
  40566. return shadow(this, "version", version.name);
  40567. }
  40568. warn(`Invalid PDF catalog version: ${version.name}`);
  40569. }
  40570. return shadow(this, "version", null);
  40571. }
  40572. get lang() {
  40573. const lang = this._catDict.get("Lang");
  40574. return shadow(this, "lang", lang && typeof lang === "string" ? stringToPDFString(lang) : null);
  40575. }
  40576. get needsRendering() {
  40577. const needsRendering = this._catDict.get("NeedsRendering");
  40578. return shadow(this, "needsRendering", typeof needsRendering === "boolean" ? needsRendering : false);
  40579. }
  40580. get collection() {
  40581. let collection = null;
  40582. try {
  40583. const obj = this._catDict.get("Collection");
  40584. if (obj instanceof Dict && obj.size > 0) {
  40585. collection = obj;
  40586. }
  40587. } catch (ex) {
  40588. if (ex instanceof MissingDataException) {
  40589. throw ex;
  40590. }
  40591. info("Cannot fetch Collection entry; assuming no collection is present.");
  40592. }
  40593. return shadow(this, "collection", collection);
  40594. }
  40595. get acroForm() {
  40596. let acroForm = null;
  40597. try {
  40598. const obj = this._catDict.get("AcroForm");
  40599. if (obj instanceof Dict && obj.size > 0) {
  40600. acroForm = obj;
  40601. }
  40602. } catch (ex) {
  40603. if (ex instanceof MissingDataException) {
  40604. throw ex;
  40605. }
  40606. info("Cannot fetch AcroForm entry; assuming no forms are present.");
  40607. }
  40608. return shadow(this, "acroForm", acroForm);
  40609. }
  40610. get acroFormRef() {
  40611. const value = this._catDict.getRaw("AcroForm");
  40612. return shadow(this, "acroFormRef", value instanceof Ref ? value : null);
  40613. }
  40614. get metadata() {
  40615. const streamRef = this._catDict.getRaw("Metadata");
  40616. if (!(streamRef instanceof Ref)) {
  40617. return shadow(this, "metadata", null);
  40618. }
  40619. let metadata = null;
  40620. try {
  40621. const stream = this.xref.fetch(streamRef, !this.xref.encrypt?.encryptMetadata);
  40622. if (stream instanceof BaseStream && stream.dict instanceof Dict) {
  40623. const type = stream.dict.get("Type");
  40624. const subtype = stream.dict.get("Subtype");
  40625. if (isName(type, "Metadata") && isName(subtype, "XML")) {
  40626. const data = stringToUTF8String(stream.getString());
  40627. if (data) {
  40628. metadata = new MetadataParser(data).serializable;
  40629. }
  40630. }
  40631. }
  40632. } catch (ex) {
  40633. if (ex instanceof MissingDataException) {
  40634. throw ex;
  40635. }
  40636. info(`Skipping invalid Metadata: "${ex}".`);
  40637. }
  40638. return shadow(this, "metadata", metadata);
  40639. }
  40640. get markInfo() {
  40641. let markInfo = null;
  40642. try {
  40643. markInfo = this._readMarkInfo();
  40644. } catch (ex) {
  40645. if (ex instanceof MissingDataException) {
  40646. throw ex;
  40647. }
  40648. warn("Unable to read mark info.");
  40649. }
  40650. return shadow(this, "markInfo", markInfo);
  40651. }
  40652. _readMarkInfo() {
  40653. const obj = this._catDict.get("MarkInfo");
  40654. if (!(obj instanceof Dict)) {
  40655. return null;
  40656. }
  40657. const markInfo = {
  40658. Marked: false,
  40659. UserProperties: false,
  40660. Suspects: false
  40661. };
  40662. for (const key in markInfo) {
  40663. const value = obj.get(key);
  40664. if (typeof value === "boolean") {
  40665. markInfo[key] = value;
  40666. }
  40667. }
  40668. return markInfo;
  40669. }
  40670. get structTreeRoot() {
  40671. let structTree = null;
  40672. try {
  40673. structTree = this._readStructTreeRoot();
  40674. } catch (ex) {
  40675. if (ex instanceof MissingDataException) {
  40676. throw ex;
  40677. }
  40678. warn("Unable read to structTreeRoot info.");
  40679. }
  40680. return shadow(this, "structTreeRoot", structTree);
  40681. }
  40682. _readStructTreeRoot() {
  40683. const rawObj = this._catDict.getRaw("StructTreeRoot");
  40684. const obj = this.xref.fetchIfRef(rawObj);
  40685. if (!(obj instanceof Dict)) {
  40686. return null;
  40687. }
  40688. const root = new StructTreeRoot(obj, rawObj);
  40689. root.init();
  40690. return root;
  40691. }
  40692. get toplevelPagesDict() {
  40693. const pagesObj = this._catDict.get("Pages");
  40694. if (!(pagesObj instanceof Dict)) {
  40695. throw new FormatError("Invalid top-level pages dictionary.");
  40696. }
  40697. return shadow(this, "toplevelPagesDict", pagesObj);
  40698. }
  40699. get documentOutline() {
  40700. let obj = null;
  40701. try {
  40702. obj = this._readDocumentOutline();
  40703. } catch (ex) {
  40704. if (ex instanceof MissingDataException) {
  40705. throw ex;
  40706. }
  40707. warn("Unable to read document outline.");
  40708. }
  40709. return shadow(this, "documentOutline", obj);
  40710. }
  40711. _readDocumentOutline() {
  40712. let obj = this._catDict.get("Outlines");
  40713. if (!(obj instanceof Dict)) {
  40714. return null;
  40715. }
  40716. obj = obj.getRaw("First");
  40717. if (!(obj instanceof Ref)) {
  40718. return null;
  40719. }
  40720. const root = {
  40721. items: []
  40722. };
  40723. const queue = [{
  40724. obj,
  40725. parent: root
  40726. }];
  40727. const processed = new RefSet();
  40728. processed.put(obj);
  40729. const xref = this.xref,
  40730. blackColor = new Uint8ClampedArray(3);
  40731. while (queue.length > 0) {
  40732. const i = queue.shift();
  40733. const outlineDict = xref.fetchIfRef(i.obj);
  40734. if (outlineDict === null) {
  40735. continue;
  40736. }
  40737. if (!outlineDict.has("Title")) {
  40738. warn("Invalid outline item encountered.");
  40739. }
  40740. const data = {
  40741. url: null,
  40742. dest: null,
  40743. action: null
  40744. };
  40745. Catalog.parseDestDictionary({
  40746. destDict: outlineDict,
  40747. resultObj: data,
  40748. docBaseUrl: this.baseUrl,
  40749. docAttachments: this.attachments
  40750. });
  40751. const title = outlineDict.get("Title");
  40752. const flags = outlineDict.get("F") || 0;
  40753. const color = outlineDict.getArray("C");
  40754. const count = outlineDict.get("Count");
  40755. let rgbColor = blackColor;
  40756. if (isNumberArray(color, 3) && (color[0] !== 0 || color[1] !== 0 || color[2] !== 0)) {
  40757. rgbColor = ColorSpace.singletons.rgb.getRgb(color, 0);
  40758. }
  40759. const outlineItem = {
  40760. action: data.action,
  40761. attachment: data.attachment,
  40762. dest: data.dest,
  40763. url: data.url,
  40764. unsafeUrl: data.unsafeUrl,
  40765. newWindow: data.newWindow,
  40766. setOCGState: data.setOCGState,
  40767. title: typeof title === "string" ? stringToPDFString(title) : "",
  40768. color: rgbColor,
  40769. count: Number.isInteger(count) ? count : undefined,
  40770. bold: !!(flags & 2),
  40771. italic: !!(flags & 1),
  40772. items: []
  40773. };
  40774. i.parent.items.push(outlineItem);
  40775. obj = outlineDict.getRaw("First");
  40776. if (obj instanceof Ref && !processed.has(obj)) {
  40777. queue.push({
  40778. obj,
  40779. parent: outlineItem
  40780. });
  40781. processed.put(obj);
  40782. }
  40783. obj = outlineDict.getRaw("Next");
  40784. if (obj instanceof Ref && !processed.has(obj)) {
  40785. queue.push({
  40786. obj,
  40787. parent: i.parent
  40788. });
  40789. processed.put(obj);
  40790. }
  40791. }
  40792. return root.items.length > 0 ? root.items : null;
  40793. }
  40794. get permissions() {
  40795. let permissions = null;
  40796. try {
  40797. permissions = this._readPermissions();
  40798. } catch (ex) {
  40799. if (ex instanceof MissingDataException) {
  40800. throw ex;
  40801. }
  40802. warn("Unable to read permissions.");
  40803. }
  40804. return shadow(this, "permissions", permissions);
  40805. }
  40806. _readPermissions() {
  40807. const encrypt = this.xref.trailer.get("Encrypt");
  40808. if (!(encrypt instanceof Dict)) {
  40809. return null;
  40810. }
  40811. let flags = encrypt.get("P");
  40812. if (typeof flags !== "number") {
  40813. return null;
  40814. }
  40815. flags += 2 ** 32;
  40816. const permissions = [];
  40817. for (const key in PermissionFlag) {
  40818. const value = PermissionFlag[key];
  40819. if (flags & value) {
  40820. permissions.push(value);
  40821. }
  40822. }
  40823. return permissions;
  40824. }
  40825. get optionalContentConfig() {
  40826. let config = null;
  40827. try {
  40828. const properties = this._catDict.get("OCProperties");
  40829. if (!properties) {
  40830. return shadow(this, "optionalContentConfig", null);
  40831. }
  40832. const defaultConfig = properties.get("D");
  40833. if (!defaultConfig) {
  40834. return shadow(this, "optionalContentConfig", null);
  40835. }
  40836. const groupsData = properties.get("OCGs");
  40837. if (!Array.isArray(groupsData)) {
  40838. return shadow(this, "optionalContentConfig", null);
  40839. }
  40840. const groups = [];
  40841. const groupRefs = new RefSet();
  40842. for (const groupRef of groupsData) {
  40843. if (!(groupRef instanceof Ref) || groupRefs.has(groupRef)) {
  40844. continue;
  40845. }
  40846. groupRefs.put(groupRef);
  40847. groups.push(this.#readOptionalContentGroup(groupRef));
  40848. }
  40849. config = this.#readOptionalContentConfig(defaultConfig, groupRefs);
  40850. config.groups = groups;
  40851. } catch (ex) {
  40852. if (ex instanceof MissingDataException) {
  40853. throw ex;
  40854. }
  40855. warn(`Unable to read optional content config: ${ex}`);
  40856. }
  40857. return shadow(this, "optionalContentConfig", config);
  40858. }
  40859. #readOptionalContentGroup(groupRef) {
  40860. const group = this.xref.fetch(groupRef);
  40861. const obj = {
  40862. id: groupRef.toString(),
  40863. name: null,
  40864. intent: null,
  40865. usage: {
  40866. print: null,
  40867. view: null
  40868. }
  40869. };
  40870. const name = group.get("Name");
  40871. if (typeof name === "string") {
  40872. obj.name = stringToPDFString(name);
  40873. }
  40874. let intent = group.getArray("Intent");
  40875. if (!Array.isArray(intent)) {
  40876. intent = [intent];
  40877. }
  40878. if (intent.every(i => i instanceof Name)) {
  40879. obj.intent = intent.map(i => i.name);
  40880. }
  40881. const usage = group.get("Usage");
  40882. if (!(usage instanceof Dict)) {
  40883. return obj;
  40884. }
  40885. const usageObj = obj.usage;
  40886. const print = usage.get("Print");
  40887. if (print instanceof Dict) {
  40888. const printState = print.get("PrintState");
  40889. if (printState instanceof Name) {
  40890. switch (printState.name) {
  40891. case "ON":
  40892. case "OFF":
  40893. usageObj.print = {
  40894. printState: printState.name
  40895. };
  40896. }
  40897. }
  40898. }
  40899. const view = usage.get("View");
  40900. if (view instanceof Dict) {
  40901. const viewState = view.get("ViewState");
  40902. if (viewState instanceof Name) {
  40903. switch (viewState.name) {
  40904. case "ON":
  40905. case "OFF":
  40906. usageObj.view = {
  40907. viewState: viewState.name
  40908. };
  40909. }
  40910. }
  40911. }
  40912. return obj;
  40913. }
  40914. #readOptionalContentConfig(config, contentGroupRefs) {
  40915. function parseOnOff(refs) {
  40916. const onParsed = [];
  40917. if (Array.isArray(refs)) {
  40918. for (const value of refs) {
  40919. if (!(value instanceof Ref)) {
  40920. continue;
  40921. }
  40922. if (contentGroupRefs.has(value)) {
  40923. onParsed.push(value.toString());
  40924. }
  40925. }
  40926. }
  40927. return onParsed;
  40928. }
  40929. function parseOrder(refs, nestedLevels = 0) {
  40930. if (!Array.isArray(refs)) {
  40931. return null;
  40932. }
  40933. const order = [];
  40934. for (const value of refs) {
  40935. if (value instanceof Ref && contentGroupRefs.has(value)) {
  40936. parsedOrderRefs.put(value);
  40937. order.push(value.toString());
  40938. continue;
  40939. }
  40940. const nestedOrder = parseNestedOrder(value, nestedLevels);
  40941. if (nestedOrder) {
  40942. order.push(nestedOrder);
  40943. }
  40944. }
  40945. if (nestedLevels > 0) {
  40946. return order;
  40947. }
  40948. const hiddenGroups = [];
  40949. for (const groupRef of contentGroupRefs) {
  40950. if (parsedOrderRefs.has(groupRef)) {
  40951. continue;
  40952. }
  40953. hiddenGroups.push(groupRef.toString());
  40954. }
  40955. if (hiddenGroups.length) {
  40956. order.push({
  40957. name: null,
  40958. order: hiddenGroups
  40959. });
  40960. }
  40961. return order;
  40962. }
  40963. function parseNestedOrder(ref, nestedLevels) {
  40964. if (++nestedLevels > MAX_NESTED_LEVELS) {
  40965. warn("parseNestedOrder - reached MAX_NESTED_LEVELS.");
  40966. return null;
  40967. }
  40968. const value = xref.fetchIfRef(ref);
  40969. if (!Array.isArray(value)) {
  40970. return null;
  40971. }
  40972. const nestedName = xref.fetchIfRef(value[0]);
  40973. if (typeof nestedName !== "string") {
  40974. return null;
  40975. }
  40976. const nestedOrder = parseOrder(value.slice(1), nestedLevels);
  40977. if (!nestedOrder || !nestedOrder.length) {
  40978. return null;
  40979. }
  40980. return {
  40981. name: stringToPDFString(nestedName),
  40982. order: nestedOrder
  40983. };
  40984. }
  40985. const xref = this.xref,
  40986. parsedOrderRefs = new RefSet(),
  40987. MAX_NESTED_LEVELS = 10;
  40988. return {
  40989. name: typeof config.get("Name") === "string" ? stringToPDFString(config.get("Name")) : null,
  40990. creator: typeof config.get("Creator") === "string" ? stringToPDFString(config.get("Creator")) : null,
  40991. baseState: config.get("BaseState") instanceof Name ? config.get("BaseState").name : null,
  40992. on: parseOnOff(config.get("ON")),
  40993. off: parseOnOff(config.get("OFF")),
  40994. order: parseOrder(config.get("Order")),
  40995. groups: null
  40996. };
  40997. }
  40998. setActualNumPages(num = null) {
  40999. this._actualNumPages = num;
  41000. }
  41001. get hasActualNumPages() {
  41002. return this._actualNumPages !== null;
  41003. }
  41004. get _pagesCount() {
  41005. const obj = this.toplevelPagesDict.get("Count");
  41006. if (!Number.isInteger(obj)) {
  41007. throw new FormatError("Page count in top-level pages dictionary is not an integer.");
  41008. }
  41009. return shadow(this, "_pagesCount", obj);
  41010. }
  41011. get numPages() {
  41012. return this.hasActualNumPages ? this._actualNumPages : this._pagesCount;
  41013. }
  41014. get destinations() {
  41015. const obj = this._readDests(),
  41016. dests = Object.create(null);
  41017. if (obj instanceof NameTree) {
  41018. for (const [key, value] of obj.getAll()) {
  41019. const dest = fetchDest(value);
  41020. if (dest) {
  41021. dests[stringToPDFString(key)] = dest;
  41022. }
  41023. }
  41024. } else if (obj instanceof Dict) {
  41025. obj.forEach(function (key, value) {
  41026. const dest = fetchDest(value);
  41027. if (dest) {
  41028. dests[key] = dest;
  41029. }
  41030. });
  41031. }
  41032. return shadow(this, "destinations", dests);
  41033. }
  41034. getDestination(id) {
  41035. const obj = this._readDests();
  41036. if (obj instanceof NameTree) {
  41037. const dest = fetchDest(obj.get(id));
  41038. if (dest) {
  41039. return dest;
  41040. }
  41041. const allDest = this.destinations[id];
  41042. if (allDest) {
  41043. warn(`Found "${id}" at an incorrect position in the NameTree.`);
  41044. return allDest;
  41045. }
  41046. } else if (obj instanceof Dict) {
  41047. const dest = fetchDest(obj.get(id));
  41048. if (dest) {
  41049. return dest;
  41050. }
  41051. }
  41052. return null;
  41053. }
  41054. _readDests() {
  41055. const obj = this._catDict.get("Names");
  41056. if (obj?.has("Dests")) {
  41057. return new NameTree(obj.getRaw("Dests"), this.xref);
  41058. } else if (this._catDict.has("Dests")) {
  41059. return this._catDict.get("Dests");
  41060. }
  41061. return undefined;
  41062. }
  41063. get pageLabels() {
  41064. let obj = null;
  41065. try {
  41066. obj = this._readPageLabels();
  41067. } catch (ex) {
  41068. if (ex instanceof MissingDataException) {
  41069. throw ex;
  41070. }
  41071. warn("Unable to read page labels.");
  41072. }
  41073. return shadow(this, "pageLabels", obj);
  41074. }
  41075. _readPageLabels() {
  41076. const obj = this._catDict.getRaw("PageLabels");
  41077. if (!obj) {
  41078. return null;
  41079. }
  41080. const pageLabels = new Array(this.numPages);
  41081. let style = null,
  41082. prefix = "";
  41083. const numberTree = new NumberTree(obj, this.xref);
  41084. const nums = numberTree.getAll();
  41085. let currentLabel = "",
  41086. currentIndex = 1;
  41087. for (let i = 0, ii = this.numPages; i < ii; i++) {
  41088. const labelDict = nums.get(i);
  41089. if (labelDict !== undefined) {
  41090. if (!(labelDict instanceof Dict)) {
  41091. throw new FormatError("PageLabel is not a dictionary.");
  41092. }
  41093. if (labelDict.has("Type") && !isName(labelDict.get("Type"), "PageLabel")) {
  41094. throw new FormatError("Invalid type in PageLabel dictionary.");
  41095. }
  41096. if (labelDict.has("S")) {
  41097. const s = labelDict.get("S");
  41098. if (!(s instanceof Name)) {
  41099. throw new FormatError("Invalid style in PageLabel dictionary.");
  41100. }
  41101. style = s.name;
  41102. } else {
  41103. style = null;
  41104. }
  41105. if (labelDict.has("P")) {
  41106. const p = labelDict.get("P");
  41107. if (typeof p !== "string") {
  41108. throw new FormatError("Invalid prefix in PageLabel dictionary.");
  41109. }
  41110. prefix = stringToPDFString(p);
  41111. } else {
  41112. prefix = "";
  41113. }
  41114. if (labelDict.has("St")) {
  41115. const st = labelDict.get("St");
  41116. if (!(Number.isInteger(st) && st >= 1)) {
  41117. throw new FormatError("Invalid start in PageLabel dictionary.");
  41118. }
  41119. currentIndex = st;
  41120. } else {
  41121. currentIndex = 1;
  41122. }
  41123. }
  41124. switch (style) {
  41125. case "D":
  41126. currentLabel = currentIndex;
  41127. break;
  41128. case "R":
  41129. case "r":
  41130. currentLabel = toRomanNumerals(currentIndex, style === "r");
  41131. break;
  41132. case "A":
  41133. case "a":
  41134. const LIMIT = 26;
  41135. const A_UPPER_CASE = 0x41,
  41136. A_LOWER_CASE = 0x61;
  41137. const baseCharCode = style === "a" ? A_LOWER_CASE : A_UPPER_CASE;
  41138. const letterIndex = currentIndex - 1;
  41139. const character = String.fromCharCode(baseCharCode + letterIndex % LIMIT);
  41140. currentLabel = character.repeat(Math.floor(letterIndex / LIMIT) + 1);
  41141. break;
  41142. default:
  41143. if (style) {
  41144. throw new FormatError(`Invalid style "${style}" in PageLabel dictionary.`);
  41145. }
  41146. currentLabel = "";
  41147. }
  41148. pageLabels[i] = prefix + currentLabel;
  41149. currentIndex++;
  41150. }
  41151. return pageLabels;
  41152. }
  41153. get pageLayout() {
  41154. const obj = this._catDict.get("PageLayout");
  41155. let pageLayout = "";
  41156. if (obj instanceof Name) {
  41157. switch (obj.name) {
  41158. case "SinglePage":
  41159. case "OneColumn":
  41160. case "TwoColumnLeft":
  41161. case "TwoColumnRight":
  41162. case "TwoPageLeft":
  41163. case "TwoPageRight":
  41164. pageLayout = obj.name;
  41165. }
  41166. }
  41167. return shadow(this, "pageLayout", pageLayout);
  41168. }
  41169. get pageMode() {
  41170. const obj = this._catDict.get("PageMode");
  41171. let pageMode = "UseNone";
  41172. if (obj instanceof Name) {
  41173. switch (obj.name) {
  41174. case "UseNone":
  41175. case "UseOutlines":
  41176. case "UseThumbs":
  41177. case "FullScreen":
  41178. case "UseOC":
  41179. case "UseAttachments":
  41180. pageMode = obj.name;
  41181. }
  41182. }
  41183. return shadow(this, "pageMode", pageMode);
  41184. }
  41185. get viewerPreferences() {
  41186. const obj = this._catDict.get("ViewerPreferences");
  41187. if (!(obj instanceof Dict)) {
  41188. return shadow(this, "viewerPreferences", null);
  41189. }
  41190. let prefs = null;
  41191. for (const key of obj.getKeys()) {
  41192. const value = obj.get(key);
  41193. let prefValue;
  41194. switch (key) {
  41195. case "HideToolbar":
  41196. case "HideMenubar":
  41197. case "HideWindowUI":
  41198. case "FitWindow":
  41199. case "CenterWindow":
  41200. case "DisplayDocTitle":
  41201. case "PickTrayByPDFSize":
  41202. if (typeof value === "boolean") {
  41203. prefValue = value;
  41204. }
  41205. break;
  41206. case "NonFullScreenPageMode":
  41207. if (value instanceof Name) {
  41208. switch (value.name) {
  41209. case "UseNone":
  41210. case "UseOutlines":
  41211. case "UseThumbs":
  41212. case "UseOC":
  41213. prefValue = value.name;
  41214. break;
  41215. default:
  41216. prefValue = "UseNone";
  41217. }
  41218. }
  41219. break;
  41220. case "Direction":
  41221. if (value instanceof Name) {
  41222. switch (value.name) {
  41223. case "L2R":
  41224. case "R2L":
  41225. prefValue = value.name;
  41226. break;
  41227. default:
  41228. prefValue = "L2R";
  41229. }
  41230. }
  41231. break;
  41232. case "ViewArea":
  41233. case "ViewClip":
  41234. case "PrintArea":
  41235. case "PrintClip":
  41236. if (value instanceof Name) {
  41237. switch (value.name) {
  41238. case "MediaBox":
  41239. case "CropBox":
  41240. case "BleedBox":
  41241. case "TrimBox":
  41242. case "ArtBox":
  41243. prefValue = value.name;
  41244. break;
  41245. default:
  41246. prefValue = "CropBox";
  41247. }
  41248. }
  41249. break;
  41250. case "PrintScaling":
  41251. if (value instanceof Name) {
  41252. switch (value.name) {
  41253. case "None":
  41254. case "AppDefault":
  41255. prefValue = value.name;
  41256. break;
  41257. default:
  41258. prefValue = "AppDefault";
  41259. }
  41260. }
  41261. break;
  41262. case "Duplex":
  41263. if (value instanceof Name) {
  41264. switch (value.name) {
  41265. case "Simplex":
  41266. case "DuplexFlipShortEdge":
  41267. case "DuplexFlipLongEdge":
  41268. prefValue = value.name;
  41269. break;
  41270. default:
  41271. prefValue = "None";
  41272. }
  41273. }
  41274. break;
  41275. case "PrintPageRange":
  41276. if (Array.isArray(value) && value.length % 2 === 0) {
  41277. const isValid = value.every((page, i, arr) => Number.isInteger(page) && page > 0 && (i === 0 || page >= arr[i - 1]) && page <= this.numPages);
  41278. if (isValid) {
  41279. prefValue = value;
  41280. }
  41281. }
  41282. break;
  41283. case "NumCopies":
  41284. if (Number.isInteger(value) && value > 0) {
  41285. prefValue = value;
  41286. }
  41287. break;
  41288. default:
  41289. warn(`Ignoring non-standard key in ViewerPreferences: ${key}.`);
  41290. continue;
  41291. }
  41292. if (prefValue === undefined) {
  41293. warn(`Bad value, for key "${key}", in ViewerPreferences: ${value}.`);
  41294. continue;
  41295. }
  41296. if (!prefs) {
  41297. prefs = Object.create(null);
  41298. }
  41299. prefs[key] = prefValue;
  41300. }
  41301. return shadow(this, "viewerPreferences", prefs);
  41302. }
  41303. get openAction() {
  41304. const obj = this._catDict.get("OpenAction");
  41305. const openAction = Object.create(null);
  41306. if (obj instanceof Dict) {
  41307. const destDict = new Dict(this.xref);
  41308. destDict.set("A", obj);
  41309. const resultObj = {
  41310. url: null,
  41311. dest: null,
  41312. action: null
  41313. };
  41314. Catalog.parseDestDictionary({
  41315. destDict,
  41316. resultObj
  41317. });
  41318. if (Array.isArray(resultObj.dest)) {
  41319. openAction.dest = resultObj.dest;
  41320. } else if (resultObj.action) {
  41321. openAction.action = resultObj.action;
  41322. }
  41323. } else if (Array.isArray(obj)) {
  41324. openAction.dest = obj;
  41325. }
  41326. return shadow(this, "openAction", objectSize(openAction) > 0 ? openAction : null);
  41327. }
  41328. get attachments() {
  41329. const obj = this._catDict.get("Names");
  41330. let attachments = null;
  41331. if (obj instanceof Dict && obj.has("EmbeddedFiles")) {
  41332. const nameTree = new NameTree(obj.getRaw("EmbeddedFiles"), this.xref);
  41333. for (const [key, value] of nameTree.getAll()) {
  41334. const fs = new FileSpec(value, this.xref);
  41335. if (!attachments) {
  41336. attachments = Object.create(null);
  41337. }
  41338. attachments[stringToPDFString(key)] = fs.serializable;
  41339. }
  41340. }
  41341. return shadow(this, "attachments", attachments);
  41342. }
  41343. get xfaImages() {
  41344. const obj = this._catDict.get("Names");
  41345. let xfaImages = null;
  41346. if (obj instanceof Dict && obj.has("XFAImages")) {
  41347. const nameTree = new NameTree(obj.getRaw("XFAImages"), this.xref);
  41348. for (const [key, value] of nameTree.getAll()) {
  41349. if (!xfaImages) {
  41350. xfaImages = new Dict(this.xref);
  41351. }
  41352. xfaImages.set(stringToPDFString(key), value);
  41353. }
  41354. }
  41355. return shadow(this, "xfaImages", xfaImages);
  41356. }
  41357. _collectJavaScript() {
  41358. const obj = this._catDict.get("Names");
  41359. let javaScript = null;
  41360. function appendIfJavaScriptDict(name, jsDict) {
  41361. if (!(jsDict instanceof Dict)) {
  41362. return;
  41363. }
  41364. if (!isName(jsDict.get("S"), "JavaScript")) {
  41365. return;
  41366. }
  41367. let js = jsDict.get("JS");
  41368. if (js instanceof BaseStream) {
  41369. js = js.getString();
  41370. } else if (typeof js !== "string") {
  41371. return;
  41372. }
  41373. js = stringToPDFString(js).replaceAll("\x00", "");
  41374. if (js) {
  41375. (javaScript ||= new Map()).set(name, js);
  41376. }
  41377. }
  41378. if (obj instanceof Dict && obj.has("JavaScript")) {
  41379. const nameTree = new NameTree(obj.getRaw("JavaScript"), this.xref);
  41380. for (const [key, value] of nameTree.getAll()) {
  41381. appendIfJavaScriptDict(stringToPDFString(key), value);
  41382. }
  41383. }
  41384. const openAction = this._catDict.get("OpenAction");
  41385. if (openAction) {
  41386. appendIfJavaScriptDict("OpenAction", openAction);
  41387. }
  41388. return javaScript;
  41389. }
  41390. get jsActions() {
  41391. const javaScript = this._collectJavaScript();
  41392. let actions = collectActions(this.xref, this._catDict, DocumentActionEventType);
  41393. if (javaScript) {
  41394. actions ||= Object.create(null);
  41395. for (const [key, val] of javaScript) {
  41396. if (key in actions) {
  41397. actions[key].push(val);
  41398. } else {
  41399. actions[key] = [val];
  41400. }
  41401. }
  41402. }
  41403. return shadow(this, "jsActions", actions);
  41404. }
  41405. async fontFallback(id, handler) {
  41406. const translatedFonts = await Promise.all(this.fontCache);
  41407. for (const translatedFont of translatedFonts) {
  41408. if (translatedFont.loadedName === id) {
  41409. translatedFont.fallback(handler);
  41410. return;
  41411. }
  41412. }
  41413. }
  41414. async cleanup(manuallyTriggered = false) {
  41415. clearGlobalCaches();
  41416. this.globalImageCache.clear(manuallyTriggered);
  41417. this.pageKidsCountCache.clear();
  41418. this.pageIndexCache.clear();
  41419. this.pageDictCache.clear();
  41420. this.nonBlendModesSet.clear();
  41421. const translatedFonts = await Promise.all(this.fontCache);
  41422. for (const {
  41423. dict
  41424. } of translatedFonts) {
  41425. delete dict.cacheKey;
  41426. }
  41427. this.fontCache.clear();
  41428. this.builtInCMapCache.clear();
  41429. this.standardFontDataCache.clear();
  41430. this.systemFontCache.clear();
  41431. }
  41432. async getPageDict(pageIndex) {
  41433. const nodesToVisit = [this.toplevelPagesDict];
  41434. const visitedNodes = new RefSet();
  41435. const pagesRef = this._catDict.getRaw("Pages");
  41436. if (pagesRef instanceof Ref) {
  41437. visitedNodes.put(pagesRef);
  41438. }
  41439. const xref = this.xref,
  41440. pageKidsCountCache = this.pageKidsCountCache,
  41441. pageIndexCache = this.pageIndexCache,
  41442. pageDictCache = this.pageDictCache;
  41443. let currentPageIndex = 0;
  41444. while (nodesToVisit.length) {
  41445. const currentNode = nodesToVisit.pop();
  41446. if (currentNode instanceof Ref) {
  41447. const count = pageKidsCountCache.get(currentNode);
  41448. if (count >= 0 && currentPageIndex + count <= pageIndex) {
  41449. currentPageIndex += count;
  41450. continue;
  41451. }
  41452. if (visitedNodes.has(currentNode)) {
  41453. throw new FormatError("Pages tree contains circular reference.");
  41454. }
  41455. visitedNodes.put(currentNode);
  41456. const obj = await (pageDictCache.get(currentNode) || xref.fetchAsync(currentNode));
  41457. if (obj instanceof Dict) {
  41458. let type = obj.getRaw("Type");
  41459. if (type instanceof Ref) {
  41460. type = await xref.fetchAsync(type);
  41461. }
  41462. if (isName(type, "Page") || !obj.has("Kids")) {
  41463. if (!pageKidsCountCache.has(currentNode)) {
  41464. pageKidsCountCache.put(currentNode, 1);
  41465. }
  41466. if (!pageIndexCache.has(currentNode)) {
  41467. pageIndexCache.put(currentNode, currentPageIndex);
  41468. }
  41469. if (currentPageIndex === pageIndex) {
  41470. return [obj, currentNode];
  41471. }
  41472. currentPageIndex++;
  41473. continue;
  41474. }
  41475. }
  41476. nodesToVisit.push(obj);
  41477. continue;
  41478. }
  41479. if (!(currentNode instanceof Dict)) {
  41480. throw new FormatError("Page dictionary kid reference points to wrong type of object.");
  41481. }
  41482. const {
  41483. objId
  41484. } = currentNode;
  41485. let count = currentNode.getRaw("Count");
  41486. if (count instanceof Ref) {
  41487. count = await xref.fetchAsync(count);
  41488. }
  41489. if (Number.isInteger(count) && count >= 0) {
  41490. if (objId && !pageKidsCountCache.has(objId)) {
  41491. pageKidsCountCache.put(objId, count);
  41492. }
  41493. if (currentPageIndex + count <= pageIndex) {
  41494. currentPageIndex += count;
  41495. continue;
  41496. }
  41497. }
  41498. let kids = currentNode.getRaw("Kids");
  41499. if (kids instanceof Ref) {
  41500. kids = await xref.fetchAsync(kids);
  41501. }
  41502. if (!Array.isArray(kids)) {
  41503. let type = currentNode.getRaw("Type");
  41504. if (type instanceof Ref) {
  41505. type = await xref.fetchAsync(type);
  41506. }
  41507. if (isName(type, "Page") || !currentNode.has("Kids")) {
  41508. if (currentPageIndex === pageIndex) {
  41509. return [currentNode, null];
  41510. }
  41511. currentPageIndex++;
  41512. continue;
  41513. }
  41514. throw new FormatError("Page dictionary kids object is not an array.");
  41515. }
  41516. for (let last = kids.length - 1; last >= 0; last--) {
  41517. const lastKid = kids[last];
  41518. nodesToVisit.push(lastKid);
  41519. if (currentNode === this.toplevelPagesDict && lastKid instanceof Ref && !pageDictCache.has(lastKid)) {
  41520. pageDictCache.put(lastKid, xref.fetchAsync(lastKid));
  41521. }
  41522. }
  41523. }
  41524. throw new Error(`Page index ${pageIndex} not found.`);
  41525. }
  41526. async getAllPageDicts(recoveryMode = false) {
  41527. const {
  41528. ignoreErrors
  41529. } = this.pdfManager.evaluatorOptions;
  41530. const queue = [{
  41531. currentNode: this.toplevelPagesDict,
  41532. posInKids: 0
  41533. }];
  41534. const visitedNodes = new RefSet();
  41535. const pagesRef = this._catDict.getRaw("Pages");
  41536. if (pagesRef instanceof Ref) {
  41537. visitedNodes.put(pagesRef);
  41538. }
  41539. const map = new Map(),
  41540. xref = this.xref,
  41541. pageIndexCache = this.pageIndexCache;
  41542. let pageIndex = 0;
  41543. function addPageDict(pageDict, pageRef) {
  41544. if (pageRef && !pageIndexCache.has(pageRef)) {
  41545. pageIndexCache.put(pageRef, pageIndex);
  41546. }
  41547. map.set(pageIndex++, [pageDict, pageRef]);
  41548. }
  41549. function addPageError(error) {
  41550. if (error instanceof XRefEntryException && !recoveryMode) {
  41551. throw error;
  41552. }
  41553. if (recoveryMode && ignoreErrors && pageIndex === 0) {
  41554. warn(`getAllPageDicts - Skipping invalid first page: "${error}".`);
  41555. error = Dict.empty;
  41556. }
  41557. map.set(pageIndex++, [error, null]);
  41558. }
  41559. while (queue.length > 0) {
  41560. const queueItem = queue.at(-1);
  41561. const {
  41562. currentNode,
  41563. posInKids
  41564. } = queueItem;
  41565. let kids = currentNode.getRaw("Kids");
  41566. if (kids instanceof Ref) {
  41567. try {
  41568. kids = await xref.fetchAsync(kids);
  41569. } catch (ex) {
  41570. addPageError(ex);
  41571. break;
  41572. }
  41573. }
  41574. if (!Array.isArray(kids)) {
  41575. addPageError(new FormatError("Page dictionary kids object is not an array."));
  41576. break;
  41577. }
  41578. if (posInKids >= kids.length) {
  41579. queue.pop();
  41580. continue;
  41581. }
  41582. const kidObj = kids[posInKids];
  41583. let obj;
  41584. if (kidObj instanceof Ref) {
  41585. if (visitedNodes.has(kidObj)) {
  41586. addPageError(new FormatError("Pages tree contains circular reference."));
  41587. break;
  41588. }
  41589. visitedNodes.put(kidObj);
  41590. try {
  41591. obj = await xref.fetchAsync(kidObj);
  41592. } catch (ex) {
  41593. addPageError(ex);
  41594. break;
  41595. }
  41596. } else {
  41597. obj = kidObj;
  41598. }
  41599. if (!(obj instanceof Dict)) {
  41600. addPageError(new FormatError("Page dictionary kid reference points to wrong type of object."));
  41601. break;
  41602. }
  41603. let type = obj.getRaw("Type");
  41604. if (type instanceof Ref) {
  41605. try {
  41606. type = await xref.fetchAsync(type);
  41607. } catch (ex) {
  41608. addPageError(ex);
  41609. break;
  41610. }
  41611. }
  41612. if (isName(type, "Page") || !obj.has("Kids")) {
  41613. addPageDict(obj, kidObj instanceof Ref ? kidObj : null);
  41614. } else {
  41615. queue.push({
  41616. currentNode: obj,
  41617. posInKids: 0
  41618. });
  41619. }
  41620. queueItem.posInKids++;
  41621. }
  41622. return map;
  41623. }
  41624. getPageIndex(pageRef) {
  41625. const cachedPageIndex = this.pageIndexCache.get(pageRef);
  41626. if (cachedPageIndex !== undefined) {
  41627. return Promise.resolve(cachedPageIndex);
  41628. }
  41629. const xref = this.xref;
  41630. function pagesBeforeRef(kidRef) {
  41631. let total = 0,
  41632. parentRef;
  41633. return xref.fetchAsync(kidRef).then(function (node) {
  41634. if (isRefsEqual(kidRef, pageRef) && !isDict(node, "Page") && !(node instanceof Dict && !node.has("Type") && node.has("Contents"))) {
  41635. throw new FormatError("The reference does not point to a /Page dictionary.");
  41636. }
  41637. if (!node) {
  41638. return null;
  41639. }
  41640. if (!(node instanceof Dict)) {
  41641. throw new FormatError("Node must be a dictionary.");
  41642. }
  41643. parentRef = node.getRaw("Parent");
  41644. return node.getAsync("Parent");
  41645. }).then(function (parent) {
  41646. if (!parent) {
  41647. return null;
  41648. }
  41649. if (!(parent instanceof Dict)) {
  41650. throw new FormatError("Parent must be a dictionary.");
  41651. }
  41652. return parent.getAsync("Kids");
  41653. }).then(function (kids) {
  41654. if (!kids) {
  41655. return null;
  41656. }
  41657. const kidPromises = [];
  41658. let found = false;
  41659. for (const kid of kids) {
  41660. if (!(kid instanceof Ref)) {
  41661. throw new FormatError("Kid must be a reference.");
  41662. }
  41663. if (isRefsEqual(kid, kidRef)) {
  41664. found = true;
  41665. break;
  41666. }
  41667. kidPromises.push(xref.fetchAsync(kid).then(function (obj) {
  41668. if (!(obj instanceof Dict)) {
  41669. throw new FormatError("Kid node must be a dictionary.");
  41670. }
  41671. if (obj.has("Count")) {
  41672. total += obj.get("Count");
  41673. } else {
  41674. total++;
  41675. }
  41676. }));
  41677. }
  41678. if (!found) {
  41679. throw new FormatError("Kid reference not found in parent's kids.");
  41680. }
  41681. return Promise.all(kidPromises).then(function () {
  41682. return [total, parentRef];
  41683. });
  41684. });
  41685. }
  41686. let total = 0;
  41687. const next = ref => pagesBeforeRef(ref).then(args => {
  41688. if (!args) {
  41689. this.pageIndexCache.put(pageRef, total);
  41690. return total;
  41691. }
  41692. const [count, parentRef] = args;
  41693. total += count;
  41694. return next(parentRef);
  41695. });
  41696. return next(pageRef);
  41697. }
  41698. get baseUrl() {
  41699. const uri = this._catDict.get("URI");
  41700. if (uri instanceof Dict) {
  41701. const base = uri.get("Base");
  41702. if (typeof base === "string") {
  41703. const absoluteUrl = createValidAbsoluteUrl(base, null, {
  41704. tryConvertEncoding: true
  41705. });
  41706. if (absoluteUrl) {
  41707. return shadow(this, "baseUrl", absoluteUrl.href);
  41708. }
  41709. }
  41710. }
  41711. return shadow(this, "baseUrl", this.pdfManager.docBaseUrl);
  41712. }
  41713. static parseDestDictionary({
  41714. destDict,
  41715. resultObj,
  41716. docBaseUrl = null,
  41717. docAttachments = null
  41718. }) {
  41719. if (!(destDict instanceof Dict)) {
  41720. warn("parseDestDictionary: `destDict` must be a dictionary.");
  41721. return;
  41722. }
  41723. let action = destDict.get("A"),
  41724. url,
  41725. dest;
  41726. if (!(action instanceof Dict)) {
  41727. if (destDict.has("Dest")) {
  41728. action = destDict.get("Dest");
  41729. } else {
  41730. action = destDict.get("AA");
  41731. if (action instanceof Dict) {
  41732. if (action.has("D")) {
  41733. action = action.get("D");
  41734. } else if (action.has("U")) {
  41735. action = action.get("U");
  41736. }
  41737. }
  41738. }
  41739. }
  41740. if (action instanceof Dict) {
  41741. const actionType = action.get("S");
  41742. if (!(actionType instanceof Name)) {
  41743. warn("parseDestDictionary: Invalid type in Action dictionary.");
  41744. return;
  41745. }
  41746. const actionName = actionType.name;
  41747. switch (actionName) {
  41748. case "ResetForm":
  41749. const flags = action.get("Flags");
  41750. const include = ((typeof flags === "number" ? flags : 0) & 1) === 0;
  41751. const fields = [];
  41752. const refs = [];
  41753. for (const obj of action.get("Fields") || []) {
  41754. if (obj instanceof Ref) {
  41755. refs.push(obj.toString());
  41756. } else if (typeof obj === "string") {
  41757. fields.push(stringToPDFString(obj));
  41758. }
  41759. }
  41760. resultObj.resetForm = {
  41761. fields,
  41762. refs,
  41763. include
  41764. };
  41765. break;
  41766. case "URI":
  41767. url = action.get("URI");
  41768. if (url instanceof Name) {
  41769. url = "/" + url.name;
  41770. }
  41771. break;
  41772. case "GoTo":
  41773. dest = action.get("D");
  41774. break;
  41775. case "Launch":
  41776. case "GoToR":
  41777. const urlDict = action.get("F");
  41778. if (urlDict instanceof Dict) {
  41779. const fs = new FileSpec(urlDict, null, true);
  41780. const {
  41781. rawFilename
  41782. } = fs.serializable;
  41783. url = rawFilename;
  41784. } else if (typeof urlDict === "string") {
  41785. url = urlDict;
  41786. }
  41787. const remoteDest = fetchRemoteDest(action);
  41788. if (remoteDest && typeof url === "string") {
  41789. url = url.split("#", 1)[0] + "#" + remoteDest;
  41790. }
  41791. const newWindow = action.get("NewWindow");
  41792. if (typeof newWindow === "boolean") {
  41793. resultObj.newWindow = newWindow;
  41794. }
  41795. break;
  41796. case "GoToE":
  41797. const target = action.get("T");
  41798. let attachment;
  41799. if (docAttachments && target instanceof Dict) {
  41800. const relationship = target.get("R");
  41801. const name = target.get("N");
  41802. if (isName(relationship, "C") && typeof name === "string") {
  41803. attachment = docAttachments[stringToPDFString(name)];
  41804. }
  41805. }
  41806. if (attachment) {
  41807. resultObj.attachment = attachment;
  41808. const attachmentDest = fetchRemoteDest(action);
  41809. if (attachmentDest) {
  41810. resultObj.attachmentDest = attachmentDest;
  41811. }
  41812. } else {
  41813. warn(`parseDestDictionary - unimplemented "GoToE" action.`);
  41814. }
  41815. break;
  41816. case "Named":
  41817. const namedAction = action.get("N");
  41818. if (namedAction instanceof Name) {
  41819. resultObj.action = namedAction.name;
  41820. }
  41821. break;
  41822. case "SetOCGState":
  41823. const state = action.get("State");
  41824. const preserveRB = action.get("PreserveRB");
  41825. if (!Array.isArray(state) || state.length === 0) {
  41826. break;
  41827. }
  41828. const stateArr = [];
  41829. for (const elem of state) {
  41830. if (elem instanceof Name) {
  41831. switch (elem.name) {
  41832. case "ON":
  41833. case "OFF":
  41834. case "Toggle":
  41835. stateArr.push(elem.name);
  41836. break;
  41837. }
  41838. } else if (elem instanceof Ref) {
  41839. stateArr.push(elem.toString());
  41840. }
  41841. }
  41842. if (stateArr.length !== state.length) {
  41843. break;
  41844. }
  41845. resultObj.setOCGState = {
  41846. state: stateArr,
  41847. preserveRB: typeof preserveRB === "boolean" ? preserveRB : true
  41848. };
  41849. break;
  41850. case "JavaScript":
  41851. const jsAction = action.get("JS");
  41852. let js;
  41853. if (jsAction instanceof BaseStream) {
  41854. js = jsAction.getString();
  41855. } else if (typeof jsAction === "string") {
  41856. js = jsAction;
  41857. }
  41858. const jsURL = js && recoverJsURL(stringToPDFString(js));
  41859. if (jsURL) {
  41860. url = jsURL.url;
  41861. resultObj.newWindow = jsURL.newWindow;
  41862. break;
  41863. }
  41864. default:
  41865. if (actionName === "JavaScript" || actionName === "SubmitForm") {
  41866. break;
  41867. }
  41868. warn(`parseDestDictionary - unsupported action: "${actionName}".`);
  41869. break;
  41870. }
  41871. } else if (destDict.has("Dest")) {
  41872. dest = destDict.get("Dest");
  41873. }
  41874. if (typeof url === "string") {
  41875. const absoluteUrl = createValidAbsoluteUrl(url, docBaseUrl, {
  41876. addDefaultProtocol: true,
  41877. tryConvertEncoding: true
  41878. });
  41879. if (absoluteUrl) {
  41880. resultObj.url = absoluteUrl.href;
  41881. }
  41882. resultObj.unsafeUrl = url;
  41883. }
  41884. if (dest) {
  41885. if (dest instanceof Name) {
  41886. dest = dest.name;
  41887. }
  41888. if (typeof dest === "string") {
  41889. resultObj.dest = stringToPDFString(dest);
  41890. } else if (isValidExplicitDest(dest)) {
  41891. resultObj.dest = dest;
  41892. }
  41893. }
  41894. }
  41895. }
  41896. ;// ./src/core/object_loader.js
  41897. function mayHaveChildren(value) {
  41898. return value instanceof Ref || value instanceof Dict || value instanceof BaseStream || Array.isArray(value);
  41899. }
  41900. function addChildren(node, nodesToVisit) {
  41901. if (node instanceof Dict) {
  41902. node = node.getRawValues();
  41903. } else if (node instanceof BaseStream) {
  41904. node = node.dict.getRawValues();
  41905. } else if (!Array.isArray(node)) {
  41906. return;
  41907. }
  41908. for (const rawValue of node) {
  41909. if (mayHaveChildren(rawValue)) {
  41910. nodesToVisit.push(rawValue);
  41911. }
  41912. }
  41913. }
  41914. class ObjectLoader {
  41915. constructor(dict, keys, xref) {
  41916. this.dict = dict;
  41917. this.keys = keys;
  41918. this.xref = xref;
  41919. this.refSet = null;
  41920. }
  41921. async load() {
  41922. if (this.xref.stream.isDataLoaded) {
  41923. return undefined;
  41924. }
  41925. const {
  41926. keys,
  41927. dict
  41928. } = this;
  41929. this.refSet = new RefSet();
  41930. const nodesToVisit = [];
  41931. for (const key of keys) {
  41932. const rawValue = dict.getRaw(key);
  41933. if (rawValue !== undefined) {
  41934. nodesToVisit.push(rawValue);
  41935. }
  41936. }
  41937. return this._walk(nodesToVisit);
  41938. }
  41939. async _walk(nodesToVisit) {
  41940. const nodesToRevisit = [];
  41941. const pendingRequests = [];
  41942. while (nodesToVisit.length) {
  41943. let currentNode = nodesToVisit.pop();
  41944. if (currentNode instanceof Ref) {
  41945. if (this.refSet.has(currentNode)) {
  41946. continue;
  41947. }
  41948. try {
  41949. this.refSet.put(currentNode);
  41950. currentNode = this.xref.fetch(currentNode);
  41951. } catch (ex) {
  41952. if (!(ex instanceof MissingDataException)) {
  41953. warn(`ObjectLoader._walk - requesting all data: "${ex}".`);
  41954. this.refSet = null;
  41955. const {
  41956. manager
  41957. } = this.xref.stream;
  41958. return manager.requestAllChunks();
  41959. }
  41960. nodesToRevisit.push(currentNode);
  41961. pendingRequests.push({
  41962. begin: ex.begin,
  41963. end: ex.end
  41964. });
  41965. }
  41966. }
  41967. if (currentNode instanceof BaseStream) {
  41968. const baseStreams = currentNode.getBaseStreams();
  41969. if (baseStreams) {
  41970. let foundMissingData = false;
  41971. for (const stream of baseStreams) {
  41972. if (stream.isDataLoaded) {
  41973. continue;
  41974. }
  41975. foundMissingData = true;
  41976. pendingRequests.push({
  41977. begin: stream.start,
  41978. end: stream.end
  41979. });
  41980. }
  41981. if (foundMissingData) {
  41982. nodesToRevisit.push(currentNode);
  41983. }
  41984. }
  41985. }
  41986. addChildren(currentNode, nodesToVisit);
  41987. }
  41988. if (pendingRequests.length) {
  41989. await this.xref.stream.manager.requestRanges(pendingRequests);
  41990. for (const node of nodesToRevisit) {
  41991. if (node instanceof Ref) {
  41992. this.refSet.remove(node);
  41993. }
  41994. }
  41995. return this._walk(nodesToRevisit);
  41996. }
  41997. this.refSet = null;
  41998. return undefined;
  41999. }
  42000. }
  42001. ;// ./src/core/xfa/symbol_utils.js
  42002. const $acceptWhitespace = Symbol();
  42003. const $addHTML = Symbol();
  42004. const $appendChild = Symbol();
  42005. const $childrenToHTML = Symbol();
  42006. const $clean = Symbol();
  42007. const $cleanPage = Symbol();
  42008. const $cleanup = Symbol();
  42009. const $clone = Symbol();
  42010. const $consumed = Symbol();
  42011. const $content = Symbol("content");
  42012. const $data = Symbol("data");
  42013. const $dump = Symbol();
  42014. const $extra = Symbol("extra");
  42015. const $finalize = Symbol();
  42016. const $flushHTML = Symbol();
  42017. const $getAttributeIt = Symbol();
  42018. const $getAttributes = Symbol();
  42019. const $getAvailableSpace = Symbol();
  42020. const $getChildrenByClass = Symbol();
  42021. const $getChildrenByName = Symbol();
  42022. const $getChildrenByNameIt = Symbol();
  42023. const $getDataValue = Symbol();
  42024. const $getExtra = Symbol();
  42025. const $getRealChildrenByNameIt = Symbol();
  42026. const $getChildren = Symbol();
  42027. const $getContainedChildren = Symbol();
  42028. const $getNextPage = Symbol();
  42029. const $getSubformParent = Symbol();
  42030. const $getParent = Symbol();
  42031. const $getTemplateRoot = Symbol();
  42032. const $globalData = Symbol();
  42033. const $hasSettableValue = Symbol();
  42034. const $ids = Symbol();
  42035. const $indexOf = Symbol();
  42036. const $insertAt = Symbol();
  42037. const $isCDATAXml = Symbol();
  42038. const $isBindable = Symbol();
  42039. const $isDataValue = Symbol();
  42040. const $isDescendent = Symbol();
  42041. const $isNsAgnostic = Symbol();
  42042. const $isSplittable = Symbol();
  42043. const $isThereMoreWidth = Symbol();
  42044. const $isTransparent = Symbol();
  42045. const $isUsable = Symbol();
  42046. const $lastAttribute = Symbol();
  42047. const $namespaceId = Symbol("namespaceId");
  42048. const $nodeName = Symbol("nodeName");
  42049. const $nsAttributes = Symbol();
  42050. const $onChild = Symbol();
  42051. const $onChildCheck = Symbol();
  42052. const $onText = Symbol();
  42053. const $pushGlyphs = Symbol();
  42054. const $popPara = Symbol();
  42055. const $pushPara = Symbol();
  42056. const $removeChild = Symbol();
  42057. const $root = Symbol("root");
  42058. const $resolvePrototypes = Symbol();
  42059. const $searchNode = Symbol();
  42060. const $setId = Symbol();
  42061. const $setSetAttributes = Symbol();
  42062. const $setValue = Symbol();
  42063. const $tabIndex = Symbol();
  42064. const $text = Symbol();
  42065. const $toPages = Symbol();
  42066. const $toHTML = Symbol();
  42067. const $toString = Symbol();
  42068. const $toStyle = Symbol();
  42069. const $uid = Symbol("uid");
  42070. ;// ./src/core/xfa/namespaces.js
  42071. const $buildXFAObject = Symbol();
  42072. const NamespaceIds = {
  42073. config: {
  42074. id: 0,
  42075. check: ns => ns.startsWith("http://www.xfa.org/schema/xci/")
  42076. },
  42077. connectionSet: {
  42078. id: 1,
  42079. check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-connection-set/")
  42080. },
  42081. datasets: {
  42082. id: 2,
  42083. check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-data/")
  42084. },
  42085. form: {
  42086. id: 3,
  42087. check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-form/")
  42088. },
  42089. localeSet: {
  42090. id: 4,
  42091. check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-locale-set/")
  42092. },
  42093. pdf: {
  42094. id: 5,
  42095. check: ns => ns === "http://ns.adobe.com/xdp/pdf/"
  42096. },
  42097. signature: {
  42098. id: 6,
  42099. check: ns => ns === "http://www.w3.org/2000/09/xmldsig#"
  42100. },
  42101. sourceSet: {
  42102. id: 7,
  42103. check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-source-set/")
  42104. },
  42105. stylesheet: {
  42106. id: 8,
  42107. check: ns => ns === "http://www.w3.org/1999/XSL/Transform"
  42108. },
  42109. template: {
  42110. id: 9,
  42111. check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-template/")
  42112. },
  42113. xdc: {
  42114. id: 10,
  42115. check: ns => ns.startsWith("http://www.xfa.org/schema/xdc/")
  42116. },
  42117. xdp: {
  42118. id: 11,
  42119. check: ns => ns === "http://ns.adobe.com/xdp/"
  42120. },
  42121. xfdf: {
  42122. id: 12,
  42123. check: ns => ns === "http://ns.adobe.com/xfdf/"
  42124. },
  42125. xhtml: {
  42126. id: 13,
  42127. check: ns => ns === "http://www.w3.org/1999/xhtml"
  42128. },
  42129. xmpmeta: {
  42130. id: 14,
  42131. check: ns => ns === "http://ns.adobe.com/xmpmeta/"
  42132. }
  42133. };
  42134. ;// ./src/core/xfa/utils.js
  42135. const dimConverters = {
  42136. pt: x => x,
  42137. cm: x => x / 2.54 * 72,
  42138. mm: x => x / (10 * 2.54) * 72,
  42139. in: x => x * 72,
  42140. px: x => x
  42141. };
  42142. const measurementPattern = /([+-]?\d+\.?\d*)(.*)/;
  42143. function stripQuotes(str) {
  42144. if (str.startsWith("'") || str.startsWith('"')) {
  42145. return str.slice(1, -1);
  42146. }
  42147. return str;
  42148. }
  42149. function getInteger({
  42150. data,
  42151. defaultValue,
  42152. validate
  42153. }) {
  42154. if (!data) {
  42155. return defaultValue;
  42156. }
  42157. data = data.trim();
  42158. const n = parseInt(data, 10);
  42159. if (!isNaN(n) && validate(n)) {
  42160. return n;
  42161. }
  42162. return defaultValue;
  42163. }
  42164. function getFloat({
  42165. data,
  42166. defaultValue,
  42167. validate
  42168. }) {
  42169. if (!data) {
  42170. return defaultValue;
  42171. }
  42172. data = data.trim();
  42173. const n = parseFloat(data);
  42174. if (!isNaN(n) && validate(n)) {
  42175. return n;
  42176. }
  42177. return defaultValue;
  42178. }
  42179. function getKeyword({
  42180. data,
  42181. defaultValue,
  42182. validate
  42183. }) {
  42184. if (!data) {
  42185. return defaultValue;
  42186. }
  42187. data = data.trim();
  42188. if (validate(data)) {
  42189. return data;
  42190. }
  42191. return defaultValue;
  42192. }
  42193. function getStringOption(data, options) {
  42194. return getKeyword({
  42195. data,
  42196. defaultValue: options[0],
  42197. validate: k => options.includes(k)
  42198. });
  42199. }
  42200. function getMeasurement(str, def = "0") {
  42201. def ||= "0";
  42202. if (!str) {
  42203. return getMeasurement(def);
  42204. }
  42205. const match = str.trim().match(measurementPattern);
  42206. if (!match) {
  42207. return getMeasurement(def);
  42208. }
  42209. const [, valueStr, unit] = match;
  42210. const value = parseFloat(valueStr);
  42211. if (isNaN(value)) {
  42212. return getMeasurement(def);
  42213. }
  42214. if (value === 0) {
  42215. return 0;
  42216. }
  42217. const conv = dimConverters[unit];
  42218. if (conv) {
  42219. return conv(value);
  42220. }
  42221. return value;
  42222. }
  42223. function getRatio(data) {
  42224. if (!data) {
  42225. return {
  42226. num: 1,
  42227. den: 1
  42228. };
  42229. }
  42230. const ratio = data.trim().split(/\s*:\s*/).map(x => parseFloat(x)).filter(x => !isNaN(x));
  42231. if (ratio.length === 1) {
  42232. ratio.push(1);
  42233. }
  42234. if (ratio.length === 0) {
  42235. return {
  42236. num: 1,
  42237. den: 1
  42238. };
  42239. }
  42240. const [num, den] = ratio;
  42241. return {
  42242. num,
  42243. den
  42244. };
  42245. }
  42246. function getRelevant(data) {
  42247. if (!data) {
  42248. return [];
  42249. }
  42250. return data.trim().split(/\s+/).map(e => ({
  42251. excluded: e[0] === "-",
  42252. viewname: e.substring(1)
  42253. }));
  42254. }
  42255. function getColor(data, def = [0, 0, 0]) {
  42256. let [r, g, b] = def;
  42257. if (!data) {
  42258. return {
  42259. r,
  42260. g,
  42261. b
  42262. };
  42263. }
  42264. const color = data.trim().split(/\s*,\s*/).map(c => Math.min(Math.max(0, parseInt(c.trim(), 10)), 255)).map(c => isNaN(c) ? 0 : c);
  42265. if (color.length < 3) {
  42266. return {
  42267. r,
  42268. g,
  42269. b
  42270. };
  42271. }
  42272. [r, g, b] = color;
  42273. return {
  42274. r,
  42275. g,
  42276. b
  42277. };
  42278. }
  42279. function getBBox(data) {
  42280. const def = -1;
  42281. if (!data) {
  42282. return {
  42283. x: def,
  42284. y: def,
  42285. width: def,
  42286. height: def
  42287. };
  42288. }
  42289. const bbox = data.trim().split(/\s*,\s*/).map(m => getMeasurement(m, "-1"));
  42290. if (bbox.length < 4 || bbox[2] < 0 || bbox[3] < 0) {
  42291. return {
  42292. x: def,
  42293. y: def,
  42294. width: def,
  42295. height: def
  42296. };
  42297. }
  42298. const [x, y, width, height] = bbox;
  42299. return {
  42300. x,
  42301. y,
  42302. width,
  42303. height
  42304. };
  42305. }
  42306. class HTMLResult {
  42307. static get FAILURE() {
  42308. return shadow(this, "FAILURE", new HTMLResult(false, null, null, null));
  42309. }
  42310. static get EMPTY() {
  42311. return shadow(this, "EMPTY", new HTMLResult(true, null, null, null));
  42312. }
  42313. constructor(success, html, bbox, breakNode) {
  42314. this.success = success;
  42315. this.html = html;
  42316. this.bbox = bbox;
  42317. this.breakNode = breakNode;
  42318. }
  42319. isBreak() {
  42320. return !!this.breakNode;
  42321. }
  42322. static breakNode(node) {
  42323. return new HTMLResult(false, null, null, node);
  42324. }
  42325. static success(html, bbox = null) {
  42326. return new HTMLResult(true, html, bbox, null);
  42327. }
  42328. }
  42329. ;// ./src/core/xfa/fonts.js
  42330. class FontFinder {
  42331. constructor(pdfFonts) {
  42332. this.fonts = new Map();
  42333. this.cache = new Map();
  42334. this.warned = new Set();
  42335. this.defaultFont = null;
  42336. this.add(pdfFonts);
  42337. }
  42338. add(pdfFonts, reallyMissingFonts = null) {
  42339. for (const pdfFont of pdfFonts) {
  42340. this.addPdfFont(pdfFont);
  42341. }
  42342. for (const pdfFont of this.fonts.values()) {
  42343. if (!pdfFont.regular) {
  42344. pdfFont.regular = pdfFont.italic || pdfFont.bold || pdfFont.bolditalic;
  42345. }
  42346. }
  42347. if (!reallyMissingFonts || reallyMissingFonts.size === 0) {
  42348. return;
  42349. }
  42350. const myriad = this.fonts.get("PdfJS-Fallback-PdfJS-XFA");
  42351. for (const missing of reallyMissingFonts) {
  42352. this.fonts.set(missing, myriad);
  42353. }
  42354. }
  42355. addPdfFont(pdfFont) {
  42356. const cssFontInfo = pdfFont.cssFontInfo;
  42357. const name = cssFontInfo.fontFamily;
  42358. let font = this.fonts.get(name);
  42359. if (!font) {
  42360. font = Object.create(null);
  42361. this.fonts.set(name, font);
  42362. if (!this.defaultFont) {
  42363. this.defaultFont = font;
  42364. }
  42365. }
  42366. let property = "";
  42367. const fontWeight = parseFloat(cssFontInfo.fontWeight);
  42368. if (parseFloat(cssFontInfo.italicAngle) !== 0) {
  42369. property = fontWeight >= 700 ? "bolditalic" : "italic";
  42370. } else if (fontWeight >= 700) {
  42371. property = "bold";
  42372. }
  42373. if (!property) {
  42374. if (pdfFont.name.includes("Bold") || pdfFont.psName?.includes("Bold")) {
  42375. property = "bold";
  42376. }
  42377. if (pdfFont.name.includes("Italic") || pdfFont.name.endsWith("It") || pdfFont.psName?.includes("Italic") || pdfFont.psName?.endsWith("It")) {
  42378. property += "italic";
  42379. }
  42380. }
  42381. if (!property) {
  42382. property = "regular";
  42383. }
  42384. font[property] = pdfFont;
  42385. }
  42386. getDefault() {
  42387. return this.defaultFont;
  42388. }
  42389. find(fontName, mustWarn = true) {
  42390. let font = this.fonts.get(fontName) || this.cache.get(fontName);
  42391. if (font) {
  42392. return font;
  42393. }
  42394. const pattern = /,|-|_| |bolditalic|bold|italic|regular|it/gi;
  42395. let name = fontName.replaceAll(pattern, "");
  42396. font = this.fonts.get(name);
  42397. if (font) {
  42398. this.cache.set(fontName, font);
  42399. return font;
  42400. }
  42401. name = name.toLowerCase();
  42402. const maybe = [];
  42403. for (const [family, pdfFont] of this.fonts.entries()) {
  42404. if (family.replaceAll(pattern, "").toLowerCase().startsWith(name)) {
  42405. maybe.push(pdfFont);
  42406. }
  42407. }
  42408. if (maybe.length === 0) {
  42409. for (const [, pdfFont] of this.fonts.entries()) {
  42410. if (pdfFont.regular.name?.replaceAll(pattern, "").toLowerCase().startsWith(name)) {
  42411. maybe.push(pdfFont);
  42412. }
  42413. }
  42414. }
  42415. if (maybe.length === 0) {
  42416. name = name.replaceAll(/psmt|mt/gi, "");
  42417. for (const [family, pdfFont] of this.fonts.entries()) {
  42418. if (family.replaceAll(pattern, "").toLowerCase().startsWith(name)) {
  42419. maybe.push(pdfFont);
  42420. }
  42421. }
  42422. }
  42423. if (maybe.length === 0) {
  42424. for (const pdfFont of this.fonts.values()) {
  42425. if (pdfFont.regular.name?.replaceAll(pattern, "").toLowerCase().startsWith(name)) {
  42426. maybe.push(pdfFont);
  42427. }
  42428. }
  42429. }
  42430. if (maybe.length >= 1) {
  42431. if (maybe.length !== 1 && mustWarn) {
  42432. warn(`XFA - Too many choices to guess the correct font: ${fontName}`);
  42433. }
  42434. this.cache.set(fontName, maybe[0]);
  42435. return maybe[0];
  42436. }
  42437. if (mustWarn && !this.warned.has(fontName)) {
  42438. this.warned.add(fontName);
  42439. warn(`XFA - Cannot find the font: ${fontName}`);
  42440. }
  42441. return null;
  42442. }
  42443. }
  42444. function selectFont(xfaFont, typeface) {
  42445. if (xfaFont.posture === "italic") {
  42446. if (xfaFont.weight === "bold") {
  42447. return typeface.bolditalic;
  42448. }
  42449. return typeface.italic;
  42450. } else if (xfaFont.weight === "bold") {
  42451. return typeface.bold;
  42452. }
  42453. return typeface.regular;
  42454. }
  42455. function fonts_getMetrics(xfaFont, real = false) {
  42456. let pdfFont = null;
  42457. if (xfaFont) {
  42458. const name = stripQuotes(xfaFont.typeface);
  42459. const typeface = xfaFont[$globalData].fontFinder.find(name);
  42460. pdfFont = selectFont(xfaFont, typeface);
  42461. }
  42462. if (!pdfFont) {
  42463. return {
  42464. lineHeight: 12,
  42465. lineGap: 2,
  42466. lineNoGap: 10
  42467. };
  42468. }
  42469. const size = xfaFont.size || 10;
  42470. const lineHeight = pdfFont.lineHeight ? Math.max(real ? 0 : 1.2, pdfFont.lineHeight) : 1.2;
  42471. const lineGap = pdfFont.lineGap === undefined ? 0.2 : pdfFont.lineGap;
  42472. return {
  42473. lineHeight: lineHeight * size,
  42474. lineGap: lineGap * size,
  42475. lineNoGap: Math.max(1, lineHeight - lineGap) * size
  42476. };
  42477. }
  42478. ;// ./src/core/xfa/text.js
  42479. const WIDTH_FACTOR = 1.02;
  42480. class FontInfo {
  42481. constructor(xfaFont, margin, lineHeight, fontFinder) {
  42482. this.lineHeight = lineHeight;
  42483. this.paraMargin = margin || {
  42484. top: 0,
  42485. bottom: 0,
  42486. left: 0,
  42487. right: 0
  42488. };
  42489. if (!xfaFont) {
  42490. [this.pdfFont, this.xfaFont] = this.defaultFont(fontFinder);
  42491. return;
  42492. }
  42493. this.xfaFont = {
  42494. typeface: xfaFont.typeface,
  42495. posture: xfaFont.posture,
  42496. weight: xfaFont.weight,
  42497. size: xfaFont.size,
  42498. letterSpacing: xfaFont.letterSpacing
  42499. };
  42500. const typeface = fontFinder.find(xfaFont.typeface);
  42501. if (!typeface) {
  42502. [this.pdfFont, this.xfaFont] = this.defaultFont(fontFinder);
  42503. return;
  42504. }
  42505. this.pdfFont = selectFont(xfaFont, typeface);
  42506. if (!this.pdfFont) {
  42507. [this.pdfFont, this.xfaFont] = this.defaultFont(fontFinder);
  42508. }
  42509. }
  42510. defaultFont(fontFinder) {
  42511. const font = fontFinder.find("Helvetica", false) || fontFinder.find("Myriad Pro", false) || fontFinder.find("Arial", false) || fontFinder.getDefault();
  42512. if (font?.regular) {
  42513. const pdfFont = font.regular;
  42514. const info = pdfFont.cssFontInfo;
  42515. const xfaFont = {
  42516. typeface: info.fontFamily,
  42517. posture: "normal",
  42518. weight: "normal",
  42519. size: 10,
  42520. letterSpacing: 0
  42521. };
  42522. return [pdfFont, xfaFont];
  42523. }
  42524. const xfaFont = {
  42525. typeface: "Courier",
  42526. posture: "normal",
  42527. weight: "normal",
  42528. size: 10,
  42529. letterSpacing: 0
  42530. };
  42531. return [null, xfaFont];
  42532. }
  42533. }
  42534. class FontSelector {
  42535. constructor(defaultXfaFont, defaultParaMargin, defaultLineHeight, fontFinder) {
  42536. this.fontFinder = fontFinder;
  42537. this.stack = [new FontInfo(defaultXfaFont, defaultParaMargin, defaultLineHeight, fontFinder)];
  42538. }
  42539. pushData(xfaFont, margin, lineHeight) {
  42540. const lastFont = this.stack.at(-1);
  42541. for (const name of ["typeface", "posture", "weight", "size", "letterSpacing"]) {
  42542. if (!xfaFont[name]) {
  42543. xfaFont[name] = lastFont.xfaFont[name];
  42544. }
  42545. }
  42546. for (const name of ["top", "bottom", "left", "right"]) {
  42547. if (isNaN(margin[name])) {
  42548. margin[name] = lastFont.paraMargin[name];
  42549. }
  42550. }
  42551. const fontInfo = new FontInfo(xfaFont, margin, lineHeight || lastFont.lineHeight, this.fontFinder);
  42552. if (!fontInfo.pdfFont) {
  42553. fontInfo.pdfFont = lastFont.pdfFont;
  42554. }
  42555. this.stack.push(fontInfo);
  42556. }
  42557. popFont() {
  42558. this.stack.pop();
  42559. }
  42560. topFont() {
  42561. return this.stack.at(-1);
  42562. }
  42563. }
  42564. class TextMeasure {
  42565. constructor(defaultXfaFont, defaultParaMargin, defaultLineHeight, fonts) {
  42566. this.glyphs = [];
  42567. this.fontSelector = new FontSelector(defaultXfaFont, defaultParaMargin, defaultLineHeight, fonts);
  42568. this.extraHeight = 0;
  42569. }
  42570. pushData(xfaFont, margin, lineHeight) {
  42571. this.fontSelector.pushData(xfaFont, margin, lineHeight);
  42572. }
  42573. popFont(xfaFont) {
  42574. return this.fontSelector.popFont();
  42575. }
  42576. addPara() {
  42577. const lastFont = this.fontSelector.topFont();
  42578. this.extraHeight += lastFont.paraMargin.top + lastFont.paraMargin.bottom;
  42579. }
  42580. addString(str) {
  42581. if (!str) {
  42582. return;
  42583. }
  42584. const lastFont = this.fontSelector.topFont();
  42585. const fontSize = lastFont.xfaFont.size;
  42586. if (lastFont.pdfFont) {
  42587. const letterSpacing = lastFont.xfaFont.letterSpacing;
  42588. const pdfFont = lastFont.pdfFont;
  42589. const fontLineHeight = pdfFont.lineHeight || 1.2;
  42590. const lineHeight = lastFont.lineHeight || Math.max(1.2, fontLineHeight) * fontSize;
  42591. const lineGap = pdfFont.lineGap === undefined ? 0.2 : pdfFont.lineGap;
  42592. const noGap = fontLineHeight - lineGap;
  42593. const firstLineHeight = Math.max(1, noGap) * fontSize;
  42594. const scale = fontSize / 1000;
  42595. const fallbackWidth = pdfFont.defaultWidth || pdfFont.charsToGlyphs(" ")[0].width;
  42596. for (const line of str.split(/[\u2029\n]/)) {
  42597. const encodedLine = pdfFont.encodeString(line).join("");
  42598. const glyphs = pdfFont.charsToGlyphs(encodedLine);
  42599. for (const glyph of glyphs) {
  42600. const width = glyph.width || fallbackWidth;
  42601. this.glyphs.push([width * scale + letterSpacing, lineHeight, firstLineHeight, glyph.unicode, false]);
  42602. }
  42603. this.glyphs.push([0, 0, 0, "\n", true]);
  42604. }
  42605. this.glyphs.pop();
  42606. return;
  42607. }
  42608. for (const line of str.split(/[\u2029\n]/)) {
  42609. for (const char of line.split("")) {
  42610. this.glyphs.push([fontSize, 1.2 * fontSize, fontSize, char, false]);
  42611. }
  42612. this.glyphs.push([0, 0, 0, "\n", true]);
  42613. }
  42614. this.glyphs.pop();
  42615. }
  42616. compute(maxWidth) {
  42617. let lastSpacePos = -1,
  42618. lastSpaceWidth = 0,
  42619. width = 0,
  42620. height = 0,
  42621. currentLineWidth = 0,
  42622. currentLineHeight = 0;
  42623. let isBroken = false;
  42624. let isFirstLine = true;
  42625. for (let i = 0, ii = this.glyphs.length; i < ii; i++) {
  42626. const [glyphWidth, lineHeight, firstLineHeight, char, isEOL] = this.glyphs[i];
  42627. const isSpace = char === " ";
  42628. const glyphHeight = isFirstLine ? firstLineHeight : lineHeight;
  42629. if (isEOL) {
  42630. width = Math.max(width, currentLineWidth);
  42631. currentLineWidth = 0;
  42632. height += currentLineHeight;
  42633. currentLineHeight = glyphHeight;
  42634. lastSpacePos = -1;
  42635. lastSpaceWidth = 0;
  42636. isFirstLine = false;
  42637. continue;
  42638. }
  42639. if (isSpace) {
  42640. if (currentLineWidth + glyphWidth > maxWidth) {
  42641. width = Math.max(width, currentLineWidth);
  42642. currentLineWidth = 0;
  42643. height += currentLineHeight;
  42644. currentLineHeight = glyphHeight;
  42645. lastSpacePos = -1;
  42646. lastSpaceWidth = 0;
  42647. isBroken = true;
  42648. isFirstLine = false;
  42649. } else {
  42650. currentLineHeight = Math.max(glyphHeight, currentLineHeight);
  42651. lastSpaceWidth = currentLineWidth;
  42652. currentLineWidth += glyphWidth;
  42653. lastSpacePos = i;
  42654. }
  42655. continue;
  42656. }
  42657. if (currentLineWidth + glyphWidth > maxWidth) {
  42658. height += currentLineHeight;
  42659. currentLineHeight = glyphHeight;
  42660. if (lastSpacePos !== -1) {
  42661. i = lastSpacePos;
  42662. width = Math.max(width, lastSpaceWidth);
  42663. currentLineWidth = 0;
  42664. lastSpacePos = -1;
  42665. lastSpaceWidth = 0;
  42666. } else {
  42667. width = Math.max(width, currentLineWidth);
  42668. currentLineWidth = glyphWidth;
  42669. }
  42670. isBroken = true;
  42671. isFirstLine = false;
  42672. continue;
  42673. }
  42674. currentLineWidth += glyphWidth;
  42675. currentLineHeight = Math.max(glyphHeight, currentLineHeight);
  42676. }
  42677. width = Math.max(width, currentLineWidth);
  42678. height += currentLineHeight + this.extraHeight;
  42679. return {
  42680. width: WIDTH_FACTOR * width,
  42681. height,
  42682. isBroken
  42683. };
  42684. }
  42685. }
  42686. ;// ./src/core/xfa/som.js
  42687. const namePattern = /^[^.[]+/;
  42688. const indexPattern = /^[^\]]+/;
  42689. const operators = {
  42690. dot: 0,
  42691. dotDot: 1,
  42692. dotHash: 2,
  42693. dotBracket: 3,
  42694. dotParen: 4
  42695. };
  42696. const shortcuts = new Map([["$data", (root, current) => root.datasets ? root.datasets.data : root], ["$record", (root, current) => (root.datasets ? root.datasets.data : root)[$getChildren]()[0]], ["$template", (root, current) => root.template], ["$connectionSet", (root, current) => root.connectionSet], ["$form", (root, current) => root.form], ["$layout", (root, current) => root.layout], ["$host", (root, current) => root.host], ["$dataWindow", (root, current) => root.dataWindow], ["$event", (root, current) => root.event], ["!", (root, current) => root.datasets], ["$xfa", (root, current) => root], ["xfa", (root, current) => root], ["$", (root, current) => current]]);
  42697. const somCache = new WeakMap();
  42698. function parseIndex(index) {
  42699. index = index.trim();
  42700. if (index === "*") {
  42701. return Infinity;
  42702. }
  42703. return parseInt(index, 10) || 0;
  42704. }
  42705. function parseExpression(expr, dotDotAllowed, noExpr = true) {
  42706. let match = expr.match(namePattern);
  42707. if (!match) {
  42708. return null;
  42709. }
  42710. let [name] = match;
  42711. const parsed = [{
  42712. name,
  42713. cacheName: "." + name,
  42714. index: 0,
  42715. js: null,
  42716. formCalc: null,
  42717. operator: operators.dot
  42718. }];
  42719. let pos = name.length;
  42720. while (pos < expr.length) {
  42721. const spos = pos;
  42722. const char = expr.charAt(pos++);
  42723. if (char === "[") {
  42724. match = expr.slice(pos).match(indexPattern);
  42725. if (!match) {
  42726. warn("XFA - Invalid index in SOM expression");
  42727. return null;
  42728. }
  42729. parsed.at(-1).index = parseIndex(match[0]);
  42730. pos += match[0].length + 1;
  42731. continue;
  42732. }
  42733. let operator;
  42734. switch (expr.charAt(pos)) {
  42735. case ".":
  42736. if (!dotDotAllowed) {
  42737. return null;
  42738. }
  42739. pos++;
  42740. operator = operators.dotDot;
  42741. break;
  42742. case "#":
  42743. pos++;
  42744. operator = operators.dotHash;
  42745. break;
  42746. case "[":
  42747. if (noExpr) {
  42748. warn("XFA - SOM expression contains a FormCalc subexpression which is not supported for now.");
  42749. return null;
  42750. }
  42751. operator = operators.dotBracket;
  42752. break;
  42753. case "(":
  42754. if (noExpr) {
  42755. warn("XFA - SOM expression contains a JavaScript subexpression which is not supported for now.");
  42756. return null;
  42757. }
  42758. operator = operators.dotParen;
  42759. break;
  42760. default:
  42761. operator = operators.dot;
  42762. break;
  42763. }
  42764. match = expr.slice(pos).match(namePattern);
  42765. if (!match) {
  42766. break;
  42767. }
  42768. [name] = match;
  42769. pos += name.length;
  42770. parsed.push({
  42771. name,
  42772. cacheName: expr.slice(spos, pos),
  42773. operator,
  42774. index: 0,
  42775. js: null,
  42776. formCalc: null
  42777. });
  42778. }
  42779. return parsed;
  42780. }
  42781. function searchNode(root, container, expr, dotDotAllowed = true, useCache = true) {
  42782. const parsed = parseExpression(expr, dotDotAllowed);
  42783. if (!parsed) {
  42784. return null;
  42785. }
  42786. const fn = shortcuts.get(parsed[0].name);
  42787. let i = 0;
  42788. let isQualified;
  42789. if (fn) {
  42790. isQualified = true;
  42791. root = [fn(root, container)];
  42792. i = 1;
  42793. } else {
  42794. isQualified = container === null;
  42795. root = [container || root];
  42796. }
  42797. for (let ii = parsed.length; i < ii; i++) {
  42798. const {
  42799. name,
  42800. cacheName,
  42801. operator,
  42802. index
  42803. } = parsed[i];
  42804. const nodes = [];
  42805. for (const node of root) {
  42806. if (!node.isXFAObject) {
  42807. continue;
  42808. }
  42809. let children, cached;
  42810. if (useCache) {
  42811. cached = somCache.get(node);
  42812. if (!cached) {
  42813. cached = new Map();
  42814. somCache.set(node, cached);
  42815. }
  42816. children = cached.get(cacheName);
  42817. }
  42818. if (!children) {
  42819. switch (operator) {
  42820. case operators.dot:
  42821. children = node[$getChildrenByName](name, false);
  42822. break;
  42823. case operators.dotDot:
  42824. children = node[$getChildrenByName](name, true);
  42825. break;
  42826. case operators.dotHash:
  42827. children = node[$getChildrenByClass](name);
  42828. children = children.isXFAObjectArray ? children.children : [children];
  42829. break;
  42830. default:
  42831. break;
  42832. }
  42833. if (useCache) {
  42834. cached.set(cacheName, children);
  42835. }
  42836. }
  42837. if (children.length > 0) {
  42838. nodes.push(children);
  42839. }
  42840. }
  42841. if (nodes.length === 0 && !isQualified && i === 0) {
  42842. const parent = container[$getParent]();
  42843. container = parent;
  42844. if (!container) {
  42845. return null;
  42846. }
  42847. i = -1;
  42848. root = [container];
  42849. continue;
  42850. }
  42851. root = isFinite(index) ? nodes.filter(node => index < node.length).map(node => node[index]) : nodes.flat();
  42852. }
  42853. if (root.length === 0) {
  42854. return null;
  42855. }
  42856. return root;
  42857. }
  42858. function createDataNode(root, container, expr) {
  42859. const parsed = parseExpression(expr);
  42860. if (!parsed) {
  42861. return null;
  42862. }
  42863. if (parsed.some(x => x.operator === operators.dotDot)) {
  42864. return null;
  42865. }
  42866. const fn = shortcuts.get(parsed[0].name);
  42867. let i = 0;
  42868. if (fn) {
  42869. root = fn(root, container);
  42870. i = 1;
  42871. } else {
  42872. root = container || root;
  42873. }
  42874. for (let ii = parsed.length; i < ii; i++) {
  42875. const {
  42876. name,
  42877. operator,
  42878. index
  42879. } = parsed[i];
  42880. if (!isFinite(index)) {
  42881. parsed[i].index = 0;
  42882. return root.createNodes(parsed.slice(i));
  42883. }
  42884. let children;
  42885. switch (operator) {
  42886. case operators.dot:
  42887. children = root[$getChildrenByName](name, false);
  42888. break;
  42889. case operators.dotDot:
  42890. children = root[$getChildrenByName](name, true);
  42891. break;
  42892. case operators.dotHash:
  42893. children = root[$getChildrenByClass](name);
  42894. children = children.isXFAObjectArray ? children.children : [children];
  42895. break;
  42896. default:
  42897. break;
  42898. }
  42899. if (children.length === 0) {
  42900. return root.createNodes(parsed.slice(i));
  42901. }
  42902. if (index < children.length) {
  42903. const child = children[index];
  42904. if (!child.isXFAObject) {
  42905. warn(`XFA - Cannot create a node.`);
  42906. return null;
  42907. }
  42908. root = child;
  42909. } else {
  42910. parsed[i].index = index - children.length;
  42911. return root.createNodes(parsed.slice(i));
  42912. }
  42913. }
  42914. return null;
  42915. }
  42916. ;// ./src/core/xfa/xfa_object.js
  42917. const _applyPrototype = Symbol();
  42918. const _attributes = Symbol();
  42919. const _attributeNames = Symbol();
  42920. const _children = Symbol("_children");
  42921. const _cloneAttribute = Symbol();
  42922. const _dataValue = Symbol();
  42923. const _defaultValue = Symbol();
  42924. const _filteredChildrenGenerator = Symbol();
  42925. const _getPrototype = Symbol();
  42926. const _getUnsetAttributes = Symbol();
  42927. const _hasChildren = Symbol();
  42928. const _max = Symbol();
  42929. const _options = Symbol();
  42930. const _parent = Symbol("parent");
  42931. const _resolvePrototypesHelper = Symbol();
  42932. const _setAttributes = Symbol();
  42933. const _validator = Symbol();
  42934. let uid = 0;
  42935. const NS_DATASETS = NamespaceIds.datasets.id;
  42936. class XFAObject {
  42937. constructor(nsId, name, hasChildren = false) {
  42938. this[$namespaceId] = nsId;
  42939. this[$nodeName] = name;
  42940. this[_hasChildren] = hasChildren;
  42941. this[_parent] = null;
  42942. this[_children] = [];
  42943. this[$uid] = `${name}${uid++}`;
  42944. this[$globalData] = null;
  42945. }
  42946. get isXFAObject() {
  42947. return true;
  42948. }
  42949. get isXFAObjectArray() {
  42950. return false;
  42951. }
  42952. createNodes(path) {
  42953. let root = this,
  42954. node = null;
  42955. for (const {
  42956. name,
  42957. index
  42958. } of path) {
  42959. for (let i = 0, ii = isFinite(index) ? index : 0; i <= ii; i++) {
  42960. const nsId = root[$namespaceId] === NS_DATASETS ? -1 : root[$namespaceId];
  42961. node = new XmlObject(nsId, name);
  42962. root[$appendChild](node);
  42963. }
  42964. root = node;
  42965. }
  42966. return node;
  42967. }
  42968. [$onChild](child) {
  42969. if (!this[_hasChildren] || !this[$onChildCheck](child)) {
  42970. return false;
  42971. }
  42972. const name = child[$nodeName];
  42973. const node = this[name];
  42974. if (node instanceof XFAObjectArray) {
  42975. if (node.push(child)) {
  42976. this[$appendChild](child);
  42977. return true;
  42978. }
  42979. } else {
  42980. if (node !== null) {
  42981. this[$removeChild](node);
  42982. }
  42983. this[name] = child;
  42984. this[$appendChild](child);
  42985. return true;
  42986. }
  42987. let id = "";
  42988. if (this.id) {
  42989. id = ` (id: ${this.id})`;
  42990. } else if (this.name) {
  42991. id = ` (name: ${this.name} ${this.h.value})`;
  42992. }
  42993. warn(`XFA - node "${this[$nodeName]}"${id} has already enough "${name}"!`);
  42994. return false;
  42995. }
  42996. [$onChildCheck](child) {
  42997. return this.hasOwnProperty(child[$nodeName]) && child[$namespaceId] === this[$namespaceId];
  42998. }
  42999. [$isNsAgnostic]() {
  43000. return false;
  43001. }
  43002. [$acceptWhitespace]() {
  43003. return false;
  43004. }
  43005. [$isCDATAXml]() {
  43006. return false;
  43007. }
  43008. [$isBindable]() {
  43009. return false;
  43010. }
  43011. [$popPara]() {
  43012. if (this.para) {
  43013. this[$getTemplateRoot]()[$extra].paraStack.pop();
  43014. }
  43015. }
  43016. [$pushPara]() {
  43017. this[$getTemplateRoot]()[$extra].paraStack.push(this.para);
  43018. }
  43019. [$setId](ids) {
  43020. if (this.id && this[$namespaceId] === NamespaceIds.template.id) {
  43021. ids.set(this.id, this);
  43022. }
  43023. }
  43024. [$getTemplateRoot]() {
  43025. return this[$globalData].template;
  43026. }
  43027. [$isSplittable]() {
  43028. return false;
  43029. }
  43030. [$isThereMoreWidth]() {
  43031. return false;
  43032. }
  43033. [$appendChild](child) {
  43034. child[_parent] = this;
  43035. this[_children].push(child);
  43036. if (!child[$globalData] && this[$globalData]) {
  43037. child[$globalData] = this[$globalData];
  43038. }
  43039. }
  43040. [$removeChild](child) {
  43041. const i = this[_children].indexOf(child);
  43042. this[_children].splice(i, 1);
  43043. }
  43044. [$hasSettableValue]() {
  43045. return this.hasOwnProperty("value");
  43046. }
  43047. [$setValue](_) {}
  43048. [$onText](_) {}
  43049. [$finalize]() {}
  43050. [$clean](builder) {
  43051. delete this[_hasChildren];
  43052. if (this[$cleanup]) {
  43053. builder.clean(this[$cleanup]);
  43054. delete this[$cleanup];
  43055. }
  43056. }
  43057. [$indexOf](child) {
  43058. return this[_children].indexOf(child);
  43059. }
  43060. [$insertAt](i, child) {
  43061. child[_parent] = this;
  43062. this[_children].splice(i, 0, child);
  43063. if (!child[$globalData] && this[$globalData]) {
  43064. child[$globalData] = this[$globalData];
  43065. }
  43066. }
  43067. [$isTransparent]() {
  43068. return !this.name;
  43069. }
  43070. [$lastAttribute]() {
  43071. return "";
  43072. }
  43073. [$text]() {
  43074. if (this[_children].length === 0) {
  43075. return this[$content];
  43076. }
  43077. return this[_children].map(c => c[$text]()).join("");
  43078. }
  43079. get [_attributeNames]() {
  43080. const proto = Object.getPrototypeOf(this);
  43081. if (!proto._attributes) {
  43082. const attributes = proto._attributes = new Set();
  43083. for (const name of Object.getOwnPropertyNames(this)) {
  43084. if (this[name] === null || this[name] instanceof XFAObject || this[name] instanceof XFAObjectArray) {
  43085. break;
  43086. }
  43087. attributes.add(name);
  43088. }
  43089. }
  43090. return shadow(this, _attributeNames, proto._attributes);
  43091. }
  43092. [$isDescendent](parent) {
  43093. let node = this;
  43094. while (node) {
  43095. if (node === parent) {
  43096. return true;
  43097. }
  43098. node = node[$getParent]();
  43099. }
  43100. return false;
  43101. }
  43102. [$getParent]() {
  43103. return this[_parent];
  43104. }
  43105. [$getSubformParent]() {
  43106. return this[$getParent]();
  43107. }
  43108. [$getChildren](name = null) {
  43109. if (!name) {
  43110. return this[_children];
  43111. }
  43112. return this[name];
  43113. }
  43114. [$dump]() {
  43115. const dumped = Object.create(null);
  43116. if (this[$content]) {
  43117. dumped.$content = this[$content];
  43118. }
  43119. for (const name of Object.getOwnPropertyNames(this)) {
  43120. const value = this[name];
  43121. if (value === null) {
  43122. continue;
  43123. }
  43124. if (value instanceof XFAObject) {
  43125. dumped[name] = value[$dump]();
  43126. } else if (value instanceof XFAObjectArray) {
  43127. if (!value.isEmpty()) {
  43128. dumped[name] = value.dump();
  43129. }
  43130. } else {
  43131. dumped[name] = value;
  43132. }
  43133. }
  43134. return dumped;
  43135. }
  43136. [$toStyle]() {
  43137. return null;
  43138. }
  43139. [$toHTML]() {
  43140. return HTMLResult.EMPTY;
  43141. }
  43142. *[$getContainedChildren]() {
  43143. for (const node of this[$getChildren]()) {
  43144. yield node;
  43145. }
  43146. }
  43147. *[_filteredChildrenGenerator](filter, include) {
  43148. for (const node of this[$getContainedChildren]()) {
  43149. if (!filter || include === filter.has(node[$nodeName])) {
  43150. const availableSpace = this[$getAvailableSpace]();
  43151. const res = node[$toHTML](availableSpace);
  43152. if (!res.success) {
  43153. this[$extra].failingNode = node;
  43154. }
  43155. yield res;
  43156. }
  43157. }
  43158. }
  43159. [$flushHTML]() {
  43160. return null;
  43161. }
  43162. [$addHTML](html, bbox) {
  43163. this[$extra].children.push(html);
  43164. }
  43165. [$getAvailableSpace]() {}
  43166. [$childrenToHTML]({
  43167. filter = null,
  43168. include = true
  43169. }) {
  43170. if (!this[$extra].generator) {
  43171. this[$extra].generator = this[_filteredChildrenGenerator](filter, include);
  43172. } else {
  43173. const availableSpace = this[$getAvailableSpace]();
  43174. const res = this[$extra].failingNode[$toHTML](availableSpace);
  43175. if (!res.success) {
  43176. return res;
  43177. }
  43178. if (res.html) {
  43179. this[$addHTML](res.html, res.bbox);
  43180. }
  43181. delete this[$extra].failingNode;
  43182. }
  43183. while (true) {
  43184. const gen = this[$extra].generator.next();
  43185. if (gen.done) {
  43186. break;
  43187. }
  43188. const res = gen.value;
  43189. if (!res.success) {
  43190. return res;
  43191. }
  43192. if (res.html) {
  43193. this[$addHTML](res.html, res.bbox);
  43194. }
  43195. }
  43196. this[$extra].generator = null;
  43197. return HTMLResult.EMPTY;
  43198. }
  43199. [$setSetAttributes](attributes) {
  43200. this[_setAttributes] = new Set(Object.keys(attributes));
  43201. }
  43202. [_getUnsetAttributes](protoAttributes) {
  43203. const allAttr = this[_attributeNames];
  43204. const setAttr = this[_setAttributes];
  43205. return [...protoAttributes].filter(x => allAttr.has(x) && !setAttr.has(x));
  43206. }
  43207. [$resolvePrototypes](ids, ancestors = new Set()) {
  43208. for (const child of this[_children]) {
  43209. child[_resolvePrototypesHelper](ids, ancestors);
  43210. }
  43211. }
  43212. [_resolvePrototypesHelper](ids, ancestors) {
  43213. const proto = this[_getPrototype](ids, ancestors);
  43214. if (proto) {
  43215. this[_applyPrototype](proto, ids, ancestors);
  43216. } else {
  43217. this[$resolvePrototypes](ids, ancestors);
  43218. }
  43219. }
  43220. [_getPrototype](ids, ancestors) {
  43221. const {
  43222. use,
  43223. usehref
  43224. } = this;
  43225. if (!use && !usehref) {
  43226. return null;
  43227. }
  43228. let proto = null;
  43229. let somExpression = null;
  43230. let id = null;
  43231. let ref = use;
  43232. if (usehref) {
  43233. ref = usehref;
  43234. if (usehref.startsWith("#som(") && usehref.endsWith(")")) {
  43235. somExpression = usehref.slice("#som(".length, -1);
  43236. } else if (usehref.startsWith(".#som(") && usehref.endsWith(")")) {
  43237. somExpression = usehref.slice(".#som(".length, -1);
  43238. } else if (usehref.startsWith("#")) {
  43239. id = usehref.slice(1);
  43240. } else if (usehref.startsWith(".#")) {
  43241. id = usehref.slice(2);
  43242. }
  43243. } else if (use.startsWith("#")) {
  43244. id = use.slice(1);
  43245. } else {
  43246. somExpression = use;
  43247. }
  43248. this.use = this.usehref = "";
  43249. if (id) {
  43250. proto = ids.get(id);
  43251. } else {
  43252. proto = searchNode(ids.get($root), this, somExpression, true, false);
  43253. if (proto) {
  43254. proto = proto[0];
  43255. }
  43256. }
  43257. if (!proto) {
  43258. warn(`XFA - Invalid prototype reference: ${ref}.`);
  43259. return null;
  43260. }
  43261. if (proto[$nodeName] !== this[$nodeName]) {
  43262. warn(`XFA - Incompatible prototype: ${proto[$nodeName]} !== ${this[$nodeName]}.`);
  43263. return null;
  43264. }
  43265. if (ancestors.has(proto)) {
  43266. warn(`XFA - Cycle detected in prototypes use.`);
  43267. return null;
  43268. }
  43269. ancestors.add(proto);
  43270. const protoProto = proto[_getPrototype](ids, ancestors);
  43271. if (protoProto) {
  43272. proto[_applyPrototype](protoProto, ids, ancestors);
  43273. }
  43274. proto[$resolvePrototypes](ids, ancestors);
  43275. ancestors.delete(proto);
  43276. return proto;
  43277. }
  43278. [_applyPrototype](proto, ids, ancestors) {
  43279. if (ancestors.has(proto)) {
  43280. warn(`XFA - Cycle detected in prototypes use.`);
  43281. return;
  43282. }
  43283. if (!this[$content] && proto[$content]) {
  43284. this[$content] = proto[$content];
  43285. }
  43286. const newAncestors = new Set(ancestors);
  43287. newAncestors.add(proto);
  43288. for (const unsetAttrName of this[_getUnsetAttributes](proto[_setAttributes])) {
  43289. this[unsetAttrName] = proto[unsetAttrName];
  43290. if (this[_setAttributes]) {
  43291. this[_setAttributes].add(unsetAttrName);
  43292. }
  43293. }
  43294. for (const name of Object.getOwnPropertyNames(this)) {
  43295. if (this[_attributeNames].has(name)) {
  43296. continue;
  43297. }
  43298. const value = this[name];
  43299. const protoValue = proto[name];
  43300. if (value instanceof XFAObjectArray) {
  43301. for (const child of value[_children]) {
  43302. child[_resolvePrototypesHelper](ids, ancestors);
  43303. }
  43304. for (let i = value[_children].length, ii = protoValue[_children].length; i < ii; i++) {
  43305. const child = proto[_children][i][$clone]();
  43306. if (value.push(child)) {
  43307. child[_parent] = this;
  43308. this[_children].push(child);
  43309. child[_resolvePrototypesHelper](ids, ancestors);
  43310. } else {
  43311. break;
  43312. }
  43313. }
  43314. continue;
  43315. }
  43316. if (value !== null) {
  43317. value[$resolvePrototypes](ids, ancestors);
  43318. if (protoValue) {
  43319. value[_applyPrototype](protoValue, ids, ancestors);
  43320. }
  43321. continue;
  43322. }
  43323. if (protoValue !== null) {
  43324. const child = protoValue[$clone]();
  43325. child[_parent] = this;
  43326. this[name] = child;
  43327. this[_children].push(child);
  43328. child[_resolvePrototypesHelper](ids, ancestors);
  43329. }
  43330. }
  43331. }
  43332. static [_cloneAttribute](obj) {
  43333. if (Array.isArray(obj)) {
  43334. return obj.map(x => XFAObject[_cloneAttribute](x));
  43335. }
  43336. if (typeof obj === "object" && obj !== null) {
  43337. return Object.assign({}, obj);
  43338. }
  43339. return obj;
  43340. }
  43341. [$clone]() {
  43342. const clone = Object.create(Object.getPrototypeOf(this));
  43343. for (const $symbol of Object.getOwnPropertySymbols(this)) {
  43344. try {
  43345. clone[$symbol] = this[$symbol];
  43346. } catch {
  43347. shadow(clone, $symbol, this[$symbol]);
  43348. }
  43349. }
  43350. clone[$uid] = `${clone[$nodeName]}${uid++}`;
  43351. clone[_children] = [];
  43352. for (const name of Object.getOwnPropertyNames(this)) {
  43353. if (this[_attributeNames].has(name)) {
  43354. clone[name] = XFAObject[_cloneAttribute](this[name]);
  43355. continue;
  43356. }
  43357. const value = this[name];
  43358. clone[name] = value instanceof XFAObjectArray ? new XFAObjectArray(value[_max]) : null;
  43359. }
  43360. for (const child of this[_children]) {
  43361. const name = child[$nodeName];
  43362. const clonedChild = child[$clone]();
  43363. clone[_children].push(clonedChild);
  43364. clonedChild[_parent] = clone;
  43365. if (clone[name] === null) {
  43366. clone[name] = clonedChild;
  43367. } else {
  43368. clone[name][_children].push(clonedChild);
  43369. }
  43370. }
  43371. return clone;
  43372. }
  43373. [$getChildren](name = null) {
  43374. if (!name) {
  43375. return this[_children];
  43376. }
  43377. return this[_children].filter(c => c[$nodeName] === name);
  43378. }
  43379. [$getChildrenByClass](name) {
  43380. return this[name];
  43381. }
  43382. [$getChildrenByName](name, allTransparent, first = true) {
  43383. return Array.from(this[$getChildrenByNameIt](name, allTransparent, first));
  43384. }
  43385. *[$getChildrenByNameIt](name, allTransparent, first = true) {
  43386. if (name === "parent") {
  43387. yield this[_parent];
  43388. return;
  43389. }
  43390. for (const child of this[_children]) {
  43391. if (child[$nodeName] === name) {
  43392. yield child;
  43393. }
  43394. if (child.name === name) {
  43395. yield child;
  43396. }
  43397. if (allTransparent || child[$isTransparent]()) {
  43398. yield* child[$getChildrenByNameIt](name, allTransparent, false);
  43399. }
  43400. }
  43401. if (first && this[_attributeNames].has(name)) {
  43402. yield new XFAAttribute(this, name, this[name]);
  43403. }
  43404. }
  43405. }
  43406. class XFAObjectArray {
  43407. constructor(max = Infinity) {
  43408. this[_max] = max;
  43409. this[_children] = [];
  43410. }
  43411. get isXFAObject() {
  43412. return false;
  43413. }
  43414. get isXFAObjectArray() {
  43415. return true;
  43416. }
  43417. push(child) {
  43418. const len = this[_children].length;
  43419. if (len <= this[_max]) {
  43420. this[_children].push(child);
  43421. return true;
  43422. }
  43423. warn(`XFA - node "${child[$nodeName]}" accepts no more than ${this[_max]} children`);
  43424. return false;
  43425. }
  43426. isEmpty() {
  43427. return this[_children].length === 0;
  43428. }
  43429. dump() {
  43430. return this[_children].length === 1 ? this[_children][0][$dump]() : this[_children].map(x => x[$dump]());
  43431. }
  43432. [$clone]() {
  43433. const clone = new XFAObjectArray(this[_max]);
  43434. clone[_children] = this[_children].map(c => c[$clone]());
  43435. return clone;
  43436. }
  43437. get children() {
  43438. return this[_children];
  43439. }
  43440. clear() {
  43441. this[_children].length = 0;
  43442. }
  43443. }
  43444. class XFAAttribute {
  43445. constructor(node, name, value) {
  43446. this[_parent] = node;
  43447. this[$nodeName] = name;
  43448. this[$content] = value;
  43449. this[$consumed] = false;
  43450. this[$uid] = `attribute${uid++}`;
  43451. }
  43452. [$getParent]() {
  43453. return this[_parent];
  43454. }
  43455. [$isDataValue]() {
  43456. return true;
  43457. }
  43458. [$getDataValue]() {
  43459. return this[$content].trim();
  43460. }
  43461. [$setValue](value) {
  43462. value = value.value || "";
  43463. this[$content] = value.toString();
  43464. }
  43465. [$text]() {
  43466. return this[$content];
  43467. }
  43468. [$isDescendent](parent) {
  43469. return this[_parent] === parent || this[_parent][$isDescendent](parent);
  43470. }
  43471. }
  43472. class XmlObject extends XFAObject {
  43473. constructor(nsId, name, attributes = {}) {
  43474. super(nsId, name);
  43475. this[$content] = "";
  43476. this[_dataValue] = null;
  43477. if (name !== "#text") {
  43478. const map = new Map();
  43479. this[_attributes] = map;
  43480. for (const [attrName, value] of Object.entries(attributes)) {
  43481. map.set(attrName, new XFAAttribute(this, attrName, value));
  43482. }
  43483. if (attributes.hasOwnProperty($nsAttributes)) {
  43484. const dataNode = attributes[$nsAttributes].xfa.dataNode;
  43485. if (dataNode !== undefined) {
  43486. if (dataNode === "dataGroup") {
  43487. this[_dataValue] = false;
  43488. } else if (dataNode === "dataValue") {
  43489. this[_dataValue] = true;
  43490. }
  43491. }
  43492. }
  43493. }
  43494. this[$consumed] = false;
  43495. }
  43496. [$toString](buf) {
  43497. const tagName = this[$nodeName];
  43498. if (tagName === "#text") {
  43499. buf.push(encodeToXmlString(this[$content]));
  43500. return;
  43501. }
  43502. const utf8TagName = utf8StringToString(tagName);
  43503. const prefix = this[$namespaceId] === NS_DATASETS ? "xfa:" : "";
  43504. buf.push(`<${prefix}${utf8TagName}`);
  43505. for (const [name, value] of this[_attributes].entries()) {
  43506. const utf8Name = utf8StringToString(name);
  43507. buf.push(` ${utf8Name}="${encodeToXmlString(value[$content])}"`);
  43508. }
  43509. if (this[_dataValue] !== null) {
  43510. if (this[_dataValue]) {
  43511. buf.push(` xfa:dataNode="dataValue"`);
  43512. } else {
  43513. buf.push(` xfa:dataNode="dataGroup"`);
  43514. }
  43515. }
  43516. if (!this[$content] && this[_children].length === 0) {
  43517. buf.push("/>");
  43518. return;
  43519. }
  43520. buf.push(">");
  43521. if (this[$content]) {
  43522. if (typeof this[$content] === "string") {
  43523. buf.push(encodeToXmlString(this[$content]));
  43524. } else {
  43525. this[$content][$toString](buf);
  43526. }
  43527. } else {
  43528. for (const child of this[_children]) {
  43529. child[$toString](buf);
  43530. }
  43531. }
  43532. buf.push(`</${prefix}${utf8TagName}>`);
  43533. }
  43534. [$onChild](child) {
  43535. if (this[$content]) {
  43536. const node = new XmlObject(this[$namespaceId], "#text");
  43537. this[$appendChild](node);
  43538. node[$content] = this[$content];
  43539. this[$content] = "";
  43540. }
  43541. this[$appendChild](child);
  43542. return true;
  43543. }
  43544. [$onText](str) {
  43545. this[$content] += str;
  43546. }
  43547. [$finalize]() {
  43548. if (this[$content] && this[_children].length > 0) {
  43549. const node = new XmlObject(this[$namespaceId], "#text");
  43550. this[$appendChild](node);
  43551. node[$content] = this[$content];
  43552. delete this[$content];
  43553. }
  43554. }
  43555. [$toHTML]() {
  43556. if (this[$nodeName] === "#text") {
  43557. return HTMLResult.success({
  43558. name: "#text",
  43559. value: this[$content]
  43560. });
  43561. }
  43562. return HTMLResult.EMPTY;
  43563. }
  43564. [$getChildren](name = null) {
  43565. if (!name) {
  43566. return this[_children];
  43567. }
  43568. return this[_children].filter(c => c[$nodeName] === name);
  43569. }
  43570. [$getAttributes]() {
  43571. return this[_attributes];
  43572. }
  43573. [$getChildrenByClass](name) {
  43574. const value = this[_attributes].get(name);
  43575. if (value !== undefined) {
  43576. return value;
  43577. }
  43578. return this[$getChildren](name);
  43579. }
  43580. *[$getChildrenByNameIt](name, allTransparent) {
  43581. const value = this[_attributes].get(name);
  43582. if (value) {
  43583. yield value;
  43584. }
  43585. for (const child of this[_children]) {
  43586. if (child[$nodeName] === name) {
  43587. yield child;
  43588. }
  43589. if (allTransparent) {
  43590. yield* child[$getChildrenByNameIt](name, allTransparent);
  43591. }
  43592. }
  43593. }
  43594. *[$getAttributeIt](name, skipConsumed) {
  43595. const value = this[_attributes].get(name);
  43596. if (value && (!skipConsumed || !value[$consumed])) {
  43597. yield value;
  43598. }
  43599. for (const child of this[_children]) {
  43600. yield* child[$getAttributeIt](name, skipConsumed);
  43601. }
  43602. }
  43603. *[$getRealChildrenByNameIt](name, allTransparent, skipConsumed) {
  43604. for (const child of this[_children]) {
  43605. if (child[$nodeName] === name && (!skipConsumed || !child[$consumed])) {
  43606. yield child;
  43607. }
  43608. if (allTransparent) {
  43609. yield* child[$getRealChildrenByNameIt](name, allTransparent, skipConsumed);
  43610. }
  43611. }
  43612. }
  43613. [$isDataValue]() {
  43614. if (this[_dataValue] === null) {
  43615. return this[_children].length === 0 || this[_children][0][$namespaceId] === NamespaceIds.xhtml.id;
  43616. }
  43617. return this[_dataValue];
  43618. }
  43619. [$getDataValue]() {
  43620. if (this[_dataValue] === null) {
  43621. if (this[_children].length === 0) {
  43622. return this[$content].trim();
  43623. }
  43624. if (this[_children][0][$namespaceId] === NamespaceIds.xhtml.id) {
  43625. return this[_children][0][$text]().trim();
  43626. }
  43627. return null;
  43628. }
  43629. return this[$content].trim();
  43630. }
  43631. [$setValue](value) {
  43632. value = value.value || "";
  43633. this[$content] = value.toString();
  43634. }
  43635. [$dump](hasNS = false) {
  43636. const dumped = Object.create(null);
  43637. if (hasNS) {
  43638. dumped.$ns = this[$namespaceId];
  43639. }
  43640. if (this[$content]) {
  43641. dumped.$content = this[$content];
  43642. }
  43643. dumped.$name = this[$nodeName];
  43644. dumped.children = [];
  43645. for (const child of this[_children]) {
  43646. dumped.children.push(child[$dump](hasNS));
  43647. }
  43648. dumped.attributes = Object.create(null);
  43649. for (const [name, value] of this[_attributes]) {
  43650. dumped.attributes[name] = value[$content];
  43651. }
  43652. return dumped;
  43653. }
  43654. }
  43655. class ContentObject extends XFAObject {
  43656. constructor(nsId, name) {
  43657. super(nsId, name);
  43658. this[$content] = "";
  43659. }
  43660. [$onText](text) {
  43661. this[$content] += text;
  43662. }
  43663. [$finalize]() {}
  43664. }
  43665. class OptionObject extends ContentObject {
  43666. constructor(nsId, name, options) {
  43667. super(nsId, name);
  43668. this[_options] = options;
  43669. }
  43670. [$finalize]() {
  43671. this[$content] = getKeyword({
  43672. data: this[$content],
  43673. defaultValue: this[_options][0],
  43674. validate: k => this[_options].includes(k)
  43675. });
  43676. }
  43677. [$clean](builder) {
  43678. super[$clean](builder);
  43679. delete this[_options];
  43680. }
  43681. }
  43682. class StringObject extends ContentObject {
  43683. [$finalize]() {
  43684. this[$content] = this[$content].trim();
  43685. }
  43686. }
  43687. class IntegerObject extends ContentObject {
  43688. constructor(nsId, name, defaultValue, validator) {
  43689. super(nsId, name);
  43690. this[_defaultValue] = defaultValue;
  43691. this[_validator] = validator;
  43692. }
  43693. [$finalize]() {
  43694. this[$content] = getInteger({
  43695. data: this[$content],
  43696. defaultValue: this[_defaultValue],
  43697. validate: this[_validator]
  43698. });
  43699. }
  43700. [$clean](builder) {
  43701. super[$clean](builder);
  43702. delete this[_defaultValue];
  43703. delete this[_validator];
  43704. }
  43705. }
  43706. class Option01 extends IntegerObject {
  43707. constructor(nsId, name) {
  43708. super(nsId, name, 0, n => n === 1);
  43709. }
  43710. }
  43711. class Option10 extends IntegerObject {
  43712. constructor(nsId, name) {
  43713. super(nsId, name, 1, n => n === 0);
  43714. }
  43715. }
  43716. ;// ./src/core/xfa/html_utils.js
  43717. function measureToString(m) {
  43718. if (typeof m === "string") {
  43719. return "0px";
  43720. }
  43721. return Number.isInteger(m) ? `${m}px` : `${m.toFixed(2)}px`;
  43722. }
  43723. const converters = {
  43724. anchorType(node, style) {
  43725. const parent = node[$getSubformParent]();
  43726. if (!parent || parent.layout && parent.layout !== "position") {
  43727. return;
  43728. }
  43729. if (!("transform" in style)) {
  43730. style.transform = "";
  43731. }
  43732. switch (node.anchorType) {
  43733. case "bottomCenter":
  43734. style.transform += "translate(-50%, -100%)";
  43735. break;
  43736. case "bottomLeft":
  43737. style.transform += "translate(0,-100%)";
  43738. break;
  43739. case "bottomRight":
  43740. style.transform += "translate(-100%,-100%)";
  43741. break;
  43742. case "middleCenter":
  43743. style.transform += "translate(-50%,-50%)";
  43744. break;
  43745. case "middleLeft":
  43746. style.transform += "translate(0,-50%)";
  43747. break;
  43748. case "middleRight":
  43749. style.transform += "translate(-100%,-50%)";
  43750. break;
  43751. case "topCenter":
  43752. style.transform += "translate(-50%,0)";
  43753. break;
  43754. case "topRight":
  43755. style.transform += "translate(-100%,0)";
  43756. break;
  43757. }
  43758. },
  43759. dimensions(node, style) {
  43760. const parent = node[$getSubformParent]();
  43761. let width = node.w;
  43762. const height = node.h;
  43763. if (parent.layout?.includes("row")) {
  43764. const extra = parent[$extra];
  43765. const colSpan = node.colSpan;
  43766. let w;
  43767. if (colSpan === -1) {
  43768. w = extra.columnWidths.slice(extra.currentColumn).reduce((a, x) => a + x, 0);
  43769. extra.currentColumn = 0;
  43770. } else {
  43771. w = extra.columnWidths.slice(extra.currentColumn, extra.currentColumn + colSpan).reduce((a, x) => a + x, 0);
  43772. extra.currentColumn = (extra.currentColumn + node.colSpan) % extra.columnWidths.length;
  43773. }
  43774. if (!isNaN(w)) {
  43775. width = node.w = w;
  43776. }
  43777. }
  43778. style.width = width !== "" ? measureToString(width) : "auto";
  43779. style.height = height !== "" ? measureToString(height) : "auto";
  43780. },
  43781. position(node, style) {
  43782. const parent = node[$getSubformParent]();
  43783. if (parent?.layout && parent.layout !== "position") {
  43784. return;
  43785. }
  43786. style.position = "absolute";
  43787. style.left = measureToString(node.x);
  43788. style.top = measureToString(node.y);
  43789. },
  43790. rotate(node, style) {
  43791. if (node.rotate) {
  43792. if (!("transform" in style)) {
  43793. style.transform = "";
  43794. }
  43795. style.transform += `rotate(-${node.rotate}deg)`;
  43796. style.transformOrigin = "top left";
  43797. }
  43798. },
  43799. presence(node, style) {
  43800. switch (node.presence) {
  43801. case "invisible":
  43802. style.visibility = "hidden";
  43803. break;
  43804. case "hidden":
  43805. case "inactive":
  43806. style.display = "none";
  43807. break;
  43808. }
  43809. },
  43810. hAlign(node, style) {
  43811. if (node[$nodeName] === "para") {
  43812. switch (node.hAlign) {
  43813. case "justifyAll":
  43814. style.textAlign = "justify-all";
  43815. break;
  43816. case "radix":
  43817. style.textAlign = "left";
  43818. break;
  43819. default:
  43820. style.textAlign = node.hAlign;
  43821. }
  43822. } else {
  43823. switch (node.hAlign) {
  43824. case "left":
  43825. style.alignSelf = "start";
  43826. break;
  43827. case "center":
  43828. style.alignSelf = "center";
  43829. break;
  43830. case "right":
  43831. style.alignSelf = "end";
  43832. break;
  43833. }
  43834. }
  43835. },
  43836. margin(node, style) {
  43837. if (node.margin) {
  43838. style.margin = node.margin[$toStyle]().margin;
  43839. }
  43840. }
  43841. };
  43842. function setMinMaxDimensions(node, style) {
  43843. const parent = node[$getSubformParent]();
  43844. if (parent.layout === "position") {
  43845. if (node.minW > 0) {
  43846. style.minWidth = measureToString(node.minW);
  43847. }
  43848. if (node.maxW > 0) {
  43849. style.maxWidth = measureToString(node.maxW);
  43850. }
  43851. if (node.minH > 0) {
  43852. style.minHeight = measureToString(node.minH);
  43853. }
  43854. if (node.maxH > 0) {
  43855. style.maxHeight = measureToString(node.maxH);
  43856. }
  43857. }
  43858. }
  43859. function layoutText(text, xfaFont, margin, lineHeight, fontFinder, width) {
  43860. const measure = new TextMeasure(xfaFont, margin, lineHeight, fontFinder);
  43861. if (typeof text === "string") {
  43862. measure.addString(text);
  43863. } else {
  43864. text[$pushGlyphs](measure);
  43865. }
  43866. return measure.compute(width);
  43867. }
  43868. function layoutNode(node, availableSpace) {
  43869. let height = null;
  43870. let width = null;
  43871. let isBroken = false;
  43872. if ((!node.w || !node.h) && node.value) {
  43873. let marginH = 0;
  43874. let marginV = 0;
  43875. if (node.margin) {
  43876. marginH = node.margin.leftInset + node.margin.rightInset;
  43877. marginV = node.margin.topInset + node.margin.bottomInset;
  43878. }
  43879. let lineHeight = null;
  43880. let margin = null;
  43881. if (node.para) {
  43882. margin = Object.create(null);
  43883. lineHeight = node.para.lineHeight === "" ? null : node.para.lineHeight;
  43884. margin.top = node.para.spaceAbove === "" ? 0 : node.para.spaceAbove;
  43885. margin.bottom = node.para.spaceBelow === "" ? 0 : node.para.spaceBelow;
  43886. margin.left = node.para.marginLeft === "" ? 0 : node.para.marginLeft;
  43887. margin.right = node.para.marginRight === "" ? 0 : node.para.marginRight;
  43888. }
  43889. let font = node.font;
  43890. if (!font) {
  43891. const root = node[$getTemplateRoot]();
  43892. let parent = node[$getParent]();
  43893. while (parent && parent !== root) {
  43894. if (parent.font) {
  43895. font = parent.font;
  43896. break;
  43897. }
  43898. parent = parent[$getParent]();
  43899. }
  43900. }
  43901. const maxWidth = (node.w || availableSpace.width) - marginH;
  43902. const fontFinder = node[$globalData].fontFinder;
  43903. if (node.value.exData && node.value.exData[$content] && node.value.exData.contentType === "text/html") {
  43904. const res = layoutText(node.value.exData[$content], font, margin, lineHeight, fontFinder, maxWidth);
  43905. width = res.width;
  43906. height = res.height;
  43907. isBroken = res.isBroken;
  43908. } else {
  43909. const text = node.value[$text]();
  43910. if (text) {
  43911. const res = layoutText(text, font, margin, lineHeight, fontFinder, maxWidth);
  43912. width = res.width;
  43913. height = res.height;
  43914. isBroken = res.isBroken;
  43915. }
  43916. }
  43917. if (width !== null && !node.w) {
  43918. width += marginH;
  43919. }
  43920. if (height !== null && !node.h) {
  43921. height += marginV;
  43922. }
  43923. }
  43924. return {
  43925. w: width,
  43926. h: height,
  43927. isBroken
  43928. };
  43929. }
  43930. function computeBbox(node, html, availableSpace) {
  43931. let bbox;
  43932. if (node.w !== "" && node.h !== "") {
  43933. bbox = [node.x, node.y, node.w, node.h];
  43934. } else {
  43935. if (!availableSpace) {
  43936. return null;
  43937. }
  43938. let width = node.w;
  43939. if (width === "") {
  43940. if (node.maxW === 0) {
  43941. const parent = node[$getSubformParent]();
  43942. width = parent.layout === "position" && parent.w !== "" ? 0 : node.minW;
  43943. } else {
  43944. width = Math.min(node.maxW, availableSpace.width);
  43945. }
  43946. html.attributes.style.width = measureToString(width);
  43947. }
  43948. let height = node.h;
  43949. if (height === "") {
  43950. if (node.maxH === 0) {
  43951. const parent = node[$getSubformParent]();
  43952. height = parent.layout === "position" && parent.h !== "" ? 0 : node.minH;
  43953. } else {
  43954. height = Math.min(node.maxH, availableSpace.height);
  43955. }
  43956. html.attributes.style.height = measureToString(height);
  43957. }
  43958. bbox = [node.x, node.y, width, height];
  43959. }
  43960. return bbox;
  43961. }
  43962. function fixDimensions(node) {
  43963. const parent = node[$getSubformParent]();
  43964. if (parent.layout?.includes("row")) {
  43965. const extra = parent[$extra];
  43966. const colSpan = node.colSpan;
  43967. let width;
  43968. if (colSpan === -1) {
  43969. width = extra.columnWidths.slice(extra.currentColumn).reduce((a, w) => a + w, 0);
  43970. } else {
  43971. width = extra.columnWidths.slice(extra.currentColumn, extra.currentColumn + colSpan).reduce((a, w) => a + w, 0);
  43972. }
  43973. if (!isNaN(width)) {
  43974. node.w = width;
  43975. }
  43976. }
  43977. if (parent.layout && parent.layout !== "position") {
  43978. node.x = node.y = 0;
  43979. }
  43980. if (node.layout === "table") {
  43981. if (node.w === "" && Array.isArray(node.columnWidths)) {
  43982. node.w = node.columnWidths.reduce((a, x) => a + x, 0);
  43983. }
  43984. }
  43985. }
  43986. function layoutClass(node) {
  43987. switch (node.layout) {
  43988. case "position":
  43989. return "xfaPosition";
  43990. case "lr-tb":
  43991. return "xfaLrTb";
  43992. case "rl-row":
  43993. return "xfaRlRow";
  43994. case "rl-tb":
  43995. return "xfaRlTb";
  43996. case "row":
  43997. return "xfaRow";
  43998. case "table":
  43999. return "xfaTable";
  44000. case "tb":
  44001. return "xfaTb";
  44002. default:
  44003. return "xfaPosition";
  44004. }
  44005. }
  44006. function toStyle(node, ...names) {
  44007. const style = Object.create(null);
  44008. for (const name of names) {
  44009. const value = node[name];
  44010. if (value === null) {
  44011. continue;
  44012. }
  44013. if (converters.hasOwnProperty(name)) {
  44014. converters[name](node, style);
  44015. continue;
  44016. }
  44017. if (value instanceof XFAObject) {
  44018. const newStyle = value[$toStyle]();
  44019. if (newStyle) {
  44020. Object.assign(style, newStyle);
  44021. } else {
  44022. warn(`(DEBUG) - XFA - style for ${name} not implemented yet`);
  44023. }
  44024. }
  44025. }
  44026. return style;
  44027. }
  44028. function createWrapper(node, html) {
  44029. const {
  44030. attributes
  44031. } = html;
  44032. const {
  44033. style
  44034. } = attributes;
  44035. const wrapper = {
  44036. name: "div",
  44037. attributes: {
  44038. class: ["xfaWrapper"],
  44039. style: Object.create(null)
  44040. },
  44041. children: []
  44042. };
  44043. attributes.class.push("xfaWrapped");
  44044. if (node.border) {
  44045. const {
  44046. widths,
  44047. insets
  44048. } = node.border[$extra];
  44049. let width, height;
  44050. let top = insets[0];
  44051. let left = insets[3];
  44052. const insetsH = insets[0] + insets[2];
  44053. const insetsW = insets[1] + insets[3];
  44054. switch (node.border.hand) {
  44055. case "even":
  44056. top -= widths[0] / 2;
  44057. left -= widths[3] / 2;
  44058. width = `calc(100% + ${(widths[1] + widths[3]) / 2 - insetsW}px)`;
  44059. height = `calc(100% + ${(widths[0] + widths[2]) / 2 - insetsH}px)`;
  44060. break;
  44061. case "left":
  44062. top -= widths[0];
  44063. left -= widths[3];
  44064. width = `calc(100% + ${widths[1] + widths[3] - insetsW}px)`;
  44065. height = `calc(100% + ${widths[0] + widths[2] - insetsH}px)`;
  44066. break;
  44067. case "right":
  44068. width = insetsW ? `calc(100% - ${insetsW}px)` : "100%";
  44069. height = insetsH ? `calc(100% - ${insetsH}px)` : "100%";
  44070. break;
  44071. }
  44072. const classNames = ["xfaBorder"];
  44073. if (isPrintOnly(node.border)) {
  44074. classNames.push("xfaPrintOnly");
  44075. }
  44076. const border = {
  44077. name: "div",
  44078. attributes: {
  44079. class: classNames,
  44080. style: {
  44081. top: `${top}px`,
  44082. left: `${left}px`,
  44083. width,
  44084. height
  44085. }
  44086. },
  44087. children: []
  44088. };
  44089. for (const key of ["border", "borderWidth", "borderColor", "borderRadius", "borderStyle"]) {
  44090. if (style[key] !== undefined) {
  44091. border.attributes.style[key] = style[key];
  44092. delete style[key];
  44093. }
  44094. }
  44095. wrapper.children.push(border, html);
  44096. } else {
  44097. wrapper.children.push(html);
  44098. }
  44099. for (const key of ["background", "backgroundClip", "top", "left", "width", "height", "minWidth", "minHeight", "maxWidth", "maxHeight", "transform", "transformOrigin", "visibility"]) {
  44100. if (style[key] !== undefined) {
  44101. wrapper.attributes.style[key] = style[key];
  44102. delete style[key];
  44103. }
  44104. }
  44105. wrapper.attributes.style.position = style.position === "absolute" ? "absolute" : "relative";
  44106. delete style.position;
  44107. if (style.alignSelf) {
  44108. wrapper.attributes.style.alignSelf = style.alignSelf;
  44109. delete style.alignSelf;
  44110. }
  44111. return wrapper;
  44112. }
  44113. function fixTextIndent(styles) {
  44114. const indent = getMeasurement(styles.textIndent, "0px");
  44115. if (indent >= 0) {
  44116. return;
  44117. }
  44118. const align = styles.textAlign === "right" ? "right" : "left";
  44119. const name = "padding" + (align === "left" ? "Left" : "Right");
  44120. const padding = getMeasurement(styles[name], "0px");
  44121. styles[name] = `${padding - indent}px`;
  44122. }
  44123. function setAccess(node, classNames) {
  44124. switch (node.access) {
  44125. case "nonInteractive":
  44126. classNames.push("xfaNonInteractive");
  44127. break;
  44128. case "readOnly":
  44129. classNames.push("xfaReadOnly");
  44130. break;
  44131. case "protected":
  44132. classNames.push("xfaDisabled");
  44133. break;
  44134. }
  44135. }
  44136. function isPrintOnly(node) {
  44137. return node.relevant.length > 0 && !node.relevant[0].excluded && node.relevant[0].viewname === "print";
  44138. }
  44139. function getCurrentPara(node) {
  44140. const stack = node[$getTemplateRoot]()[$extra].paraStack;
  44141. return stack.length ? stack.at(-1) : null;
  44142. }
  44143. function setPara(node, nodeStyle, value) {
  44144. if (value.attributes.class?.includes("xfaRich")) {
  44145. if (nodeStyle) {
  44146. if (node.h === "") {
  44147. nodeStyle.height = "auto";
  44148. }
  44149. if (node.w === "") {
  44150. nodeStyle.width = "auto";
  44151. }
  44152. }
  44153. const para = getCurrentPara(node);
  44154. if (para) {
  44155. const valueStyle = value.attributes.style;
  44156. valueStyle.display = "flex";
  44157. valueStyle.flexDirection = "column";
  44158. switch (para.vAlign) {
  44159. case "top":
  44160. valueStyle.justifyContent = "start";
  44161. break;
  44162. case "bottom":
  44163. valueStyle.justifyContent = "end";
  44164. break;
  44165. case "middle":
  44166. valueStyle.justifyContent = "center";
  44167. break;
  44168. }
  44169. const paraStyle = para[$toStyle]();
  44170. for (const [key, val] of Object.entries(paraStyle)) {
  44171. if (!(key in valueStyle)) {
  44172. valueStyle[key] = val;
  44173. }
  44174. }
  44175. }
  44176. }
  44177. }
  44178. function setFontFamily(xfaFont, node, fontFinder, style) {
  44179. if (!fontFinder) {
  44180. delete style.fontFamily;
  44181. return;
  44182. }
  44183. const name = stripQuotes(xfaFont.typeface);
  44184. style.fontFamily = `"${name}"`;
  44185. const typeface = fontFinder.find(name);
  44186. if (typeface) {
  44187. const {
  44188. fontFamily
  44189. } = typeface.regular.cssFontInfo;
  44190. if (fontFamily !== name) {
  44191. style.fontFamily = `"${fontFamily}"`;
  44192. }
  44193. const para = getCurrentPara(node);
  44194. if (para && para.lineHeight !== "") {
  44195. return;
  44196. }
  44197. if (style.lineHeight) {
  44198. return;
  44199. }
  44200. const pdfFont = selectFont(xfaFont, typeface);
  44201. if (pdfFont) {
  44202. style.lineHeight = Math.max(1.2, pdfFont.lineHeight);
  44203. }
  44204. }
  44205. }
  44206. function fixURL(str) {
  44207. const absoluteUrl = createValidAbsoluteUrl(str, null, {
  44208. addDefaultProtocol: true,
  44209. tryConvertEncoding: true
  44210. });
  44211. return absoluteUrl ? absoluteUrl.href : null;
  44212. }
  44213. ;// ./src/core/xfa/layout.js
  44214. function createLine(node, children) {
  44215. return {
  44216. name: "div",
  44217. attributes: {
  44218. class: [node.layout === "lr-tb" ? "xfaLr" : "xfaRl"]
  44219. },
  44220. children
  44221. };
  44222. }
  44223. function flushHTML(node) {
  44224. if (!node[$extra]) {
  44225. return null;
  44226. }
  44227. const attributes = node[$extra].attributes;
  44228. const html = {
  44229. name: "div",
  44230. attributes,
  44231. children: node[$extra].children
  44232. };
  44233. if (node[$extra].failingNode) {
  44234. const htmlFromFailing = node[$extra].failingNode[$flushHTML]();
  44235. if (htmlFromFailing) {
  44236. if (node.layout.endsWith("-tb")) {
  44237. html.children.push(createLine(node, [htmlFromFailing]));
  44238. } else {
  44239. html.children.push(htmlFromFailing);
  44240. }
  44241. }
  44242. }
  44243. if (html.children.length === 0) {
  44244. return null;
  44245. }
  44246. return html;
  44247. }
  44248. function addHTML(node, html, bbox) {
  44249. const extra = node[$extra];
  44250. const availableSpace = extra.availableSpace;
  44251. const [x, y, w, h] = bbox;
  44252. switch (node.layout) {
  44253. case "position":
  44254. {
  44255. extra.width = Math.max(extra.width, x + w);
  44256. extra.height = Math.max(extra.height, y + h);
  44257. extra.children.push(html);
  44258. break;
  44259. }
  44260. case "lr-tb":
  44261. case "rl-tb":
  44262. if (!extra.line || extra.attempt === 1) {
  44263. extra.line = createLine(node, []);
  44264. extra.children.push(extra.line);
  44265. extra.numberInLine = 0;
  44266. }
  44267. extra.numberInLine += 1;
  44268. extra.line.children.push(html);
  44269. if (extra.attempt === 0) {
  44270. extra.currentWidth += w;
  44271. extra.height = Math.max(extra.height, extra.prevHeight + h);
  44272. } else {
  44273. extra.currentWidth = w;
  44274. extra.prevHeight = extra.height;
  44275. extra.height += h;
  44276. extra.attempt = 0;
  44277. }
  44278. extra.width = Math.max(extra.width, extra.currentWidth);
  44279. break;
  44280. case "rl-row":
  44281. case "row":
  44282. {
  44283. extra.children.push(html);
  44284. extra.width += w;
  44285. extra.height = Math.max(extra.height, h);
  44286. const height = measureToString(extra.height);
  44287. for (const child of extra.children) {
  44288. child.attributes.style.height = height;
  44289. }
  44290. break;
  44291. }
  44292. case "table":
  44293. {
  44294. extra.width = Math.min(availableSpace.width, Math.max(extra.width, w));
  44295. extra.height += h;
  44296. extra.children.push(html);
  44297. break;
  44298. }
  44299. case "tb":
  44300. {
  44301. extra.width = Math.min(availableSpace.width, Math.max(extra.width, w));
  44302. extra.height += h;
  44303. extra.children.push(html);
  44304. break;
  44305. }
  44306. }
  44307. }
  44308. function getAvailableSpace(node) {
  44309. const availableSpace = node[$extra].availableSpace;
  44310. const marginV = node.margin ? node.margin.topInset + node.margin.bottomInset : 0;
  44311. const marginH = node.margin ? node.margin.leftInset + node.margin.rightInset : 0;
  44312. switch (node.layout) {
  44313. case "lr-tb":
  44314. case "rl-tb":
  44315. if (node[$extra].attempt === 0) {
  44316. return {
  44317. width: availableSpace.width - marginH - node[$extra].currentWidth,
  44318. height: availableSpace.height - marginV - node[$extra].prevHeight
  44319. };
  44320. }
  44321. return {
  44322. width: availableSpace.width - marginH,
  44323. height: availableSpace.height - marginV - node[$extra].height
  44324. };
  44325. case "rl-row":
  44326. case "row":
  44327. const width = node[$extra].columnWidths.slice(node[$extra].currentColumn).reduce((a, x) => a + x);
  44328. return {
  44329. width,
  44330. height: availableSpace.height - marginH
  44331. };
  44332. case "table":
  44333. case "tb":
  44334. return {
  44335. width: availableSpace.width - marginH,
  44336. height: availableSpace.height - marginV - node[$extra].height
  44337. };
  44338. case "position":
  44339. default:
  44340. return availableSpace;
  44341. }
  44342. }
  44343. function getTransformedBBox(node) {
  44344. let w = node.w === "" ? NaN : node.w;
  44345. let h = node.h === "" ? NaN : node.h;
  44346. let [centerX, centerY] = [0, 0];
  44347. switch (node.anchorType || "") {
  44348. case "bottomCenter":
  44349. [centerX, centerY] = [w / 2, h];
  44350. break;
  44351. case "bottomLeft":
  44352. [centerX, centerY] = [0, h];
  44353. break;
  44354. case "bottomRight":
  44355. [centerX, centerY] = [w, h];
  44356. break;
  44357. case "middleCenter":
  44358. [centerX, centerY] = [w / 2, h / 2];
  44359. break;
  44360. case "middleLeft":
  44361. [centerX, centerY] = [0, h / 2];
  44362. break;
  44363. case "middleRight":
  44364. [centerX, centerY] = [w, h / 2];
  44365. break;
  44366. case "topCenter":
  44367. [centerX, centerY] = [w / 2, 0];
  44368. break;
  44369. case "topRight":
  44370. [centerX, centerY] = [w, 0];
  44371. break;
  44372. }
  44373. let x, y;
  44374. switch (node.rotate || 0) {
  44375. case 0:
  44376. [x, y] = [-centerX, -centerY];
  44377. break;
  44378. case 90:
  44379. [x, y] = [-centerY, centerX];
  44380. [w, h] = [h, -w];
  44381. break;
  44382. case 180:
  44383. [x, y] = [centerX, centerY];
  44384. [w, h] = [-w, -h];
  44385. break;
  44386. case 270:
  44387. [x, y] = [centerY, -centerX];
  44388. [w, h] = [-h, w];
  44389. break;
  44390. }
  44391. return [node.x + x + Math.min(0, w), node.y + y + Math.min(0, h), Math.abs(w), Math.abs(h)];
  44392. }
  44393. function checkDimensions(node, space) {
  44394. if (node[$getTemplateRoot]()[$extra].firstUnsplittable === null) {
  44395. return true;
  44396. }
  44397. if (node.w === 0 || node.h === 0) {
  44398. return true;
  44399. }
  44400. const ERROR = 2;
  44401. const parent = node[$getSubformParent]();
  44402. const attempt = parent[$extra]?.attempt || 0;
  44403. const [, y, w, h] = getTransformedBBox(node);
  44404. switch (parent.layout) {
  44405. case "lr-tb":
  44406. case "rl-tb":
  44407. if (attempt === 0) {
  44408. if (!node[$getTemplateRoot]()[$extra].noLayoutFailure) {
  44409. if (node.h !== "" && Math.round(h - space.height) > ERROR) {
  44410. return false;
  44411. }
  44412. if (node.w !== "") {
  44413. if (Math.round(w - space.width) <= ERROR) {
  44414. return true;
  44415. }
  44416. if (parent[$extra].numberInLine === 0) {
  44417. return space.height > ERROR;
  44418. }
  44419. return false;
  44420. }
  44421. return space.width > ERROR;
  44422. }
  44423. if (node.w !== "") {
  44424. return Math.round(w - space.width) <= ERROR;
  44425. }
  44426. return space.width > ERROR;
  44427. }
  44428. if (node[$getTemplateRoot]()[$extra].noLayoutFailure) {
  44429. return true;
  44430. }
  44431. if (node.h !== "" && Math.round(h - space.height) > ERROR) {
  44432. return false;
  44433. }
  44434. if (node.w === "" || Math.round(w - space.width) <= ERROR) {
  44435. return space.height > ERROR;
  44436. }
  44437. if (parent[$isThereMoreWidth]()) {
  44438. return false;
  44439. }
  44440. return space.height > ERROR;
  44441. case "table":
  44442. case "tb":
  44443. if (node[$getTemplateRoot]()[$extra].noLayoutFailure) {
  44444. return true;
  44445. }
  44446. if (node.h !== "" && !node[$isSplittable]()) {
  44447. return Math.round(h - space.height) <= ERROR;
  44448. }
  44449. if (node.w === "" || Math.round(w - space.width) <= ERROR) {
  44450. return space.height > ERROR;
  44451. }
  44452. if (parent[$isThereMoreWidth]()) {
  44453. return false;
  44454. }
  44455. return space.height > ERROR;
  44456. case "position":
  44457. if (node[$getTemplateRoot]()[$extra].noLayoutFailure) {
  44458. return true;
  44459. }
  44460. if (node.h === "" || Math.round(h + y - space.height) <= ERROR) {
  44461. return true;
  44462. }
  44463. const area = node[$getTemplateRoot]()[$extra].currentContentArea;
  44464. return h + y > area.h;
  44465. case "rl-row":
  44466. case "row":
  44467. if (node[$getTemplateRoot]()[$extra].noLayoutFailure) {
  44468. return true;
  44469. }
  44470. if (node.h !== "") {
  44471. return Math.round(h - space.height) <= ERROR;
  44472. }
  44473. return true;
  44474. default:
  44475. return true;
  44476. }
  44477. }
  44478. ;// ./src/core/xfa/template.js
  44479. const TEMPLATE_NS_ID = NamespaceIds.template.id;
  44480. const SVG_NS = "http://www.w3.org/2000/svg";
  44481. const MAX_ATTEMPTS_FOR_LRTB_LAYOUT = 2;
  44482. const MAX_EMPTY_PAGES = 3;
  44483. const DEFAULT_TAB_INDEX = 5000;
  44484. const HEADING_PATTERN = /^H(\d+)$/;
  44485. const MIMES = new Set(["image/gif", "image/jpeg", "image/jpg", "image/pjpeg", "image/png", "image/apng", "image/x-png", "image/bmp", "image/x-ms-bmp", "image/tiff", "image/tif", "application/octet-stream"]);
  44486. const IMAGES_HEADERS = [[[0x42, 0x4d], "image/bmp"], [[0xff, 0xd8, 0xff], "image/jpeg"], [[0x49, 0x49, 0x2a, 0x00], "image/tiff"], [[0x4d, 0x4d, 0x00, 0x2a], "image/tiff"], [[0x47, 0x49, 0x46, 0x38, 0x39, 0x61], "image/gif"], [[0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a], "image/png"]];
  44487. function getBorderDims(node) {
  44488. if (!node || !node.border) {
  44489. return {
  44490. w: 0,
  44491. h: 0
  44492. };
  44493. }
  44494. const borderExtra = node.border[$getExtra]();
  44495. if (!borderExtra) {
  44496. return {
  44497. w: 0,
  44498. h: 0
  44499. };
  44500. }
  44501. return {
  44502. w: borderExtra.widths[0] + borderExtra.widths[2] + borderExtra.insets[0] + borderExtra.insets[2],
  44503. h: borderExtra.widths[1] + borderExtra.widths[3] + borderExtra.insets[1] + borderExtra.insets[3]
  44504. };
  44505. }
  44506. function hasMargin(node) {
  44507. return node.margin && (node.margin.topInset || node.margin.rightInset || node.margin.bottomInset || node.margin.leftInset);
  44508. }
  44509. function _setValue(templateNode, value) {
  44510. if (!templateNode.value) {
  44511. const nodeValue = new Value({});
  44512. templateNode[$appendChild](nodeValue);
  44513. templateNode.value = nodeValue;
  44514. }
  44515. templateNode.value[$setValue](value);
  44516. }
  44517. function* getContainedChildren(node) {
  44518. for (const child of node[$getChildren]()) {
  44519. if (child instanceof SubformSet) {
  44520. yield* child[$getContainedChildren]();
  44521. continue;
  44522. }
  44523. yield child;
  44524. }
  44525. }
  44526. function isRequired(node) {
  44527. return node.validate?.nullTest === "error";
  44528. }
  44529. function setTabIndex(node) {
  44530. while (node) {
  44531. if (!node.traversal) {
  44532. node[$tabIndex] = node[$getParent]()[$tabIndex];
  44533. return;
  44534. }
  44535. if (node[$tabIndex]) {
  44536. return;
  44537. }
  44538. let next = null;
  44539. for (const child of node.traversal[$getChildren]()) {
  44540. if (child.operation === "next") {
  44541. next = child;
  44542. break;
  44543. }
  44544. }
  44545. if (!next || !next.ref) {
  44546. node[$tabIndex] = node[$getParent]()[$tabIndex];
  44547. return;
  44548. }
  44549. const root = node[$getTemplateRoot]();
  44550. node[$tabIndex] = ++root[$tabIndex];
  44551. const ref = root[$searchNode](next.ref, node);
  44552. if (!ref) {
  44553. return;
  44554. }
  44555. node = ref[0];
  44556. }
  44557. }
  44558. function applyAssist(obj, attributes) {
  44559. const assist = obj.assist;
  44560. if (assist) {
  44561. const assistTitle = assist[$toHTML]();
  44562. if (assistTitle) {
  44563. attributes.title = assistTitle;
  44564. }
  44565. const role = assist.role;
  44566. const match = role.match(HEADING_PATTERN);
  44567. if (match) {
  44568. const ariaRole = "heading";
  44569. const ariaLevel = match[1];
  44570. attributes.role = ariaRole;
  44571. attributes["aria-level"] = ariaLevel;
  44572. }
  44573. }
  44574. if (obj.layout === "table") {
  44575. attributes.role = "table";
  44576. } else if (obj.layout === "row") {
  44577. attributes.role = "row";
  44578. } else {
  44579. const parent = obj[$getParent]();
  44580. if (parent.layout === "row") {
  44581. attributes.role = parent.assist?.role === "TH" ? "columnheader" : "cell";
  44582. }
  44583. }
  44584. }
  44585. function ariaLabel(obj) {
  44586. if (!obj.assist) {
  44587. return null;
  44588. }
  44589. const assist = obj.assist;
  44590. if (assist.speak && assist.speak[$content] !== "") {
  44591. return assist.speak[$content];
  44592. }
  44593. if (assist.toolTip) {
  44594. return assist.toolTip[$content];
  44595. }
  44596. return null;
  44597. }
  44598. function valueToHtml(value) {
  44599. return HTMLResult.success({
  44600. name: "div",
  44601. attributes: {
  44602. class: ["xfaRich"],
  44603. style: Object.create(null)
  44604. },
  44605. children: [{
  44606. name: "span",
  44607. attributes: {
  44608. style: Object.create(null)
  44609. },
  44610. value
  44611. }]
  44612. });
  44613. }
  44614. function setFirstUnsplittable(node) {
  44615. const root = node[$getTemplateRoot]();
  44616. if (root[$extra].firstUnsplittable === null) {
  44617. root[$extra].firstUnsplittable = node;
  44618. root[$extra].noLayoutFailure = true;
  44619. }
  44620. }
  44621. function unsetFirstUnsplittable(node) {
  44622. const root = node[$getTemplateRoot]();
  44623. if (root[$extra].firstUnsplittable === node) {
  44624. root[$extra].noLayoutFailure = false;
  44625. }
  44626. }
  44627. function handleBreak(node) {
  44628. if (node[$extra]) {
  44629. return false;
  44630. }
  44631. node[$extra] = Object.create(null);
  44632. if (node.targetType === "auto") {
  44633. return false;
  44634. }
  44635. const root = node[$getTemplateRoot]();
  44636. let target = null;
  44637. if (node.target) {
  44638. target = root[$searchNode](node.target, node[$getParent]());
  44639. if (!target) {
  44640. return false;
  44641. }
  44642. target = target[0];
  44643. }
  44644. const {
  44645. currentPageArea,
  44646. currentContentArea
  44647. } = root[$extra];
  44648. if (node.targetType === "pageArea") {
  44649. if (!(target instanceof PageArea)) {
  44650. target = null;
  44651. }
  44652. if (node.startNew) {
  44653. node[$extra].target = target || currentPageArea;
  44654. return true;
  44655. } else if (target && target !== currentPageArea) {
  44656. node[$extra].target = target;
  44657. return true;
  44658. }
  44659. return false;
  44660. }
  44661. if (!(target instanceof ContentArea)) {
  44662. target = null;
  44663. }
  44664. const pageArea = target && target[$getParent]();
  44665. let index;
  44666. let nextPageArea = pageArea;
  44667. if (node.startNew) {
  44668. if (target) {
  44669. const contentAreas = pageArea.contentArea.children;
  44670. const indexForCurrent = contentAreas.indexOf(currentContentArea);
  44671. const indexForTarget = contentAreas.indexOf(target);
  44672. if (indexForCurrent !== -1 && indexForCurrent < indexForTarget) {
  44673. nextPageArea = null;
  44674. }
  44675. index = indexForTarget - 1;
  44676. } else {
  44677. index = currentPageArea.contentArea.children.indexOf(currentContentArea);
  44678. }
  44679. } else if (target && target !== currentContentArea) {
  44680. const contentAreas = pageArea.contentArea.children;
  44681. index = contentAreas.indexOf(target) - 1;
  44682. nextPageArea = pageArea === currentPageArea ? null : pageArea;
  44683. } else {
  44684. return false;
  44685. }
  44686. node[$extra].target = nextPageArea;
  44687. node[$extra].index = index;
  44688. return true;
  44689. }
  44690. function handleOverflow(node, extraNode, space) {
  44691. const root = node[$getTemplateRoot]();
  44692. const saved = root[$extra].noLayoutFailure;
  44693. const savedMethod = extraNode[$getSubformParent];
  44694. extraNode[$getSubformParent] = () => node;
  44695. root[$extra].noLayoutFailure = true;
  44696. const res = extraNode[$toHTML](space);
  44697. node[$addHTML](res.html, res.bbox);
  44698. root[$extra].noLayoutFailure = saved;
  44699. extraNode[$getSubformParent] = savedMethod;
  44700. }
  44701. class AppearanceFilter extends StringObject {
  44702. constructor(attributes) {
  44703. super(TEMPLATE_NS_ID, "appearanceFilter");
  44704. this.id = attributes.id || "";
  44705. this.type = getStringOption(attributes.type, ["optional", "required"]);
  44706. this.use = attributes.use || "";
  44707. this.usehref = attributes.usehref || "";
  44708. }
  44709. }
  44710. class Arc extends XFAObject {
  44711. constructor(attributes) {
  44712. super(TEMPLATE_NS_ID, "arc", true);
  44713. this.circular = getInteger({
  44714. data: attributes.circular,
  44715. defaultValue: 0,
  44716. validate: x => x === 1
  44717. });
  44718. this.hand = getStringOption(attributes.hand, ["even", "left", "right"]);
  44719. this.id = attributes.id || "";
  44720. this.startAngle = getFloat({
  44721. data: attributes.startAngle,
  44722. defaultValue: 0,
  44723. validate: x => true
  44724. });
  44725. this.sweepAngle = getFloat({
  44726. data: attributes.sweepAngle,
  44727. defaultValue: 360,
  44728. validate: x => true
  44729. });
  44730. this.use = attributes.use || "";
  44731. this.usehref = attributes.usehref || "";
  44732. this.edge = null;
  44733. this.fill = null;
  44734. }
  44735. [$toHTML]() {
  44736. const edge = this.edge || new Edge({});
  44737. const edgeStyle = edge[$toStyle]();
  44738. const style = Object.create(null);
  44739. if (this.fill?.presence === "visible") {
  44740. Object.assign(style, this.fill[$toStyle]());
  44741. } else {
  44742. style.fill = "transparent";
  44743. }
  44744. style.strokeWidth = measureToString(edge.presence === "visible" ? edge.thickness : 0);
  44745. style.stroke = edgeStyle.color;
  44746. let arc;
  44747. const attributes = {
  44748. xmlns: SVG_NS,
  44749. style: {
  44750. width: "100%",
  44751. height: "100%",
  44752. overflow: "visible"
  44753. }
  44754. };
  44755. if (this.sweepAngle === 360) {
  44756. arc = {
  44757. name: "ellipse",
  44758. attributes: {
  44759. xmlns: SVG_NS,
  44760. cx: "50%",
  44761. cy: "50%",
  44762. rx: "50%",
  44763. ry: "50%",
  44764. style
  44765. }
  44766. };
  44767. } else {
  44768. const startAngle = this.startAngle * Math.PI / 180;
  44769. const sweepAngle = this.sweepAngle * Math.PI / 180;
  44770. const largeArc = this.sweepAngle > 180 ? 1 : 0;
  44771. const [x1, y1, x2, y2] = [50 * (1 + Math.cos(startAngle)), 50 * (1 - Math.sin(startAngle)), 50 * (1 + Math.cos(startAngle + sweepAngle)), 50 * (1 - Math.sin(startAngle + sweepAngle))];
  44772. arc = {
  44773. name: "path",
  44774. attributes: {
  44775. xmlns: SVG_NS,
  44776. d: `M ${x1} ${y1} A 50 50 0 ${largeArc} 0 ${x2} ${y2}`,
  44777. vectorEffect: "non-scaling-stroke",
  44778. style
  44779. }
  44780. };
  44781. Object.assign(attributes, {
  44782. viewBox: "0 0 100 100",
  44783. preserveAspectRatio: "none"
  44784. });
  44785. }
  44786. const svg = {
  44787. name: "svg",
  44788. children: [arc],
  44789. attributes
  44790. };
  44791. const parent = this[$getParent]()[$getParent]();
  44792. if (hasMargin(parent)) {
  44793. return HTMLResult.success({
  44794. name: "div",
  44795. attributes: {
  44796. style: {
  44797. display: "inline",
  44798. width: "100%",
  44799. height: "100%"
  44800. }
  44801. },
  44802. children: [svg]
  44803. });
  44804. }
  44805. svg.attributes.style.position = "absolute";
  44806. return HTMLResult.success(svg);
  44807. }
  44808. }
  44809. class Area extends XFAObject {
  44810. constructor(attributes) {
  44811. super(TEMPLATE_NS_ID, "area", true);
  44812. this.colSpan = getInteger({
  44813. data: attributes.colSpan,
  44814. defaultValue: 1,
  44815. validate: n => n >= 1 || n === -1
  44816. });
  44817. this.id = attributes.id || "";
  44818. this.name = attributes.name || "";
  44819. this.relevant = getRelevant(attributes.relevant);
  44820. this.use = attributes.use || "";
  44821. this.usehref = attributes.usehref || "";
  44822. this.x = getMeasurement(attributes.x, "0pt");
  44823. this.y = getMeasurement(attributes.y, "0pt");
  44824. this.desc = null;
  44825. this.extras = null;
  44826. this.area = new XFAObjectArray();
  44827. this.draw = new XFAObjectArray();
  44828. this.exObject = new XFAObjectArray();
  44829. this.exclGroup = new XFAObjectArray();
  44830. this.field = new XFAObjectArray();
  44831. this.subform = new XFAObjectArray();
  44832. this.subformSet = new XFAObjectArray();
  44833. }
  44834. *[$getContainedChildren]() {
  44835. yield* getContainedChildren(this);
  44836. }
  44837. [$isTransparent]() {
  44838. return true;
  44839. }
  44840. [$isBindable]() {
  44841. return true;
  44842. }
  44843. [$addHTML](html, bbox) {
  44844. const [x, y, w, h] = bbox;
  44845. this[$extra].width = Math.max(this[$extra].width, x + w);
  44846. this[$extra].height = Math.max(this[$extra].height, y + h);
  44847. this[$extra].children.push(html);
  44848. }
  44849. [$getAvailableSpace]() {
  44850. return this[$extra].availableSpace;
  44851. }
  44852. [$toHTML](availableSpace) {
  44853. const style = toStyle(this, "position");
  44854. const attributes = {
  44855. style,
  44856. id: this[$uid],
  44857. class: ["xfaArea"]
  44858. };
  44859. if (isPrintOnly(this)) {
  44860. attributes.class.push("xfaPrintOnly");
  44861. }
  44862. if (this.name) {
  44863. attributes.xfaName = this.name;
  44864. }
  44865. const children = [];
  44866. this[$extra] = {
  44867. children,
  44868. width: 0,
  44869. height: 0,
  44870. availableSpace
  44871. };
  44872. const result = this[$childrenToHTML]({
  44873. filter: new Set(["area", "draw", "field", "exclGroup", "subform", "subformSet"]),
  44874. include: true
  44875. });
  44876. if (!result.success) {
  44877. if (result.isBreak()) {
  44878. return result;
  44879. }
  44880. delete this[$extra];
  44881. return HTMLResult.FAILURE;
  44882. }
  44883. style.width = measureToString(this[$extra].width);
  44884. style.height = measureToString(this[$extra].height);
  44885. const html = {
  44886. name: "div",
  44887. attributes,
  44888. children
  44889. };
  44890. const bbox = [this.x, this.y, this[$extra].width, this[$extra].height];
  44891. delete this[$extra];
  44892. return HTMLResult.success(html, bbox);
  44893. }
  44894. }
  44895. class Assist extends XFAObject {
  44896. constructor(attributes) {
  44897. super(TEMPLATE_NS_ID, "assist", true);
  44898. this.id = attributes.id || "";
  44899. this.role = attributes.role || "";
  44900. this.use = attributes.use || "";
  44901. this.usehref = attributes.usehref || "";
  44902. this.speak = null;
  44903. this.toolTip = null;
  44904. }
  44905. [$toHTML]() {
  44906. return this.toolTip?.[$content] || null;
  44907. }
  44908. }
  44909. class Barcode extends XFAObject {
  44910. constructor(attributes) {
  44911. super(TEMPLATE_NS_ID, "barcode", true);
  44912. this.charEncoding = getKeyword({
  44913. data: attributes.charEncoding ? attributes.charEncoding.toLowerCase() : "",
  44914. defaultValue: "",
  44915. validate: k => ["utf-8", "big-five", "fontspecific", "gbk", "gb-18030", "gb-2312", "ksc-5601", "none", "shift-jis", "ucs-2", "utf-16"].includes(k) || k.match(/iso-8859-\d{2}/)
  44916. });
  44917. this.checksum = getStringOption(attributes.checksum, ["none", "1mod10", "1mod10_1mod11", "2mod10", "auto"]);
  44918. this.dataColumnCount = getInteger({
  44919. data: attributes.dataColumnCount,
  44920. defaultValue: -1,
  44921. validate: x => x >= 0
  44922. });
  44923. this.dataLength = getInteger({
  44924. data: attributes.dataLength,
  44925. defaultValue: -1,
  44926. validate: x => x >= 0
  44927. });
  44928. this.dataPrep = getStringOption(attributes.dataPrep, ["none", "flateCompress"]);
  44929. this.dataRowCount = getInteger({
  44930. data: attributes.dataRowCount,
  44931. defaultValue: -1,
  44932. validate: x => x >= 0
  44933. });
  44934. this.endChar = attributes.endChar || "";
  44935. this.errorCorrectionLevel = getInteger({
  44936. data: attributes.errorCorrectionLevel,
  44937. defaultValue: -1,
  44938. validate: x => x >= 0 && x <= 8
  44939. });
  44940. this.id = attributes.id || "";
  44941. this.moduleHeight = getMeasurement(attributes.moduleHeight, "5mm");
  44942. this.moduleWidth = getMeasurement(attributes.moduleWidth, "0.25mm");
  44943. this.printCheckDigit = getInteger({
  44944. data: attributes.printCheckDigit,
  44945. defaultValue: 0,
  44946. validate: x => x === 1
  44947. });
  44948. this.rowColumnRatio = getRatio(attributes.rowColumnRatio);
  44949. this.startChar = attributes.startChar || "";
  44950. this.textLocation = getStringOption(attributes.textLocation, ["below", "above", "aboveEmbedded", "belowEmbedded", "none"]);
  44951. this.truncate = getInteger({
  44952. data: attributes.truncate,
  44953. defaultValue: 0,
  44954. validate: x => x === 1
  44955. });
  44956. this.type = getStringOption(attributes.type ? attributes.type.toLowerCase() : "", ["aztec", "codabar", "code2of5industrial", "code2of5interleaved", "code2of5matrix", "code2of5standard", "code3of9", "code3of9extended", "code11", "code49", "code93", "code128", "code128a", "code128b", "code128c", "code128sscc", "datamatrix", "ean8", "ean8add2", "ean8add5", "ean13", "ean13add2", "ean13add5", "ean13pwcd", "fim", "logmars", "maxicode", "msi", "pdf417", "pdf417macro", "plessey", "postauscust2", "postauscust3", "postausreplypaid", "postausstandard", "postukrm4scc", "postusdpbc", "postusimb", "postusstandard", "postus5zip", "qrcode", "rfid", "rss14", "rss14expanded", "rss14limited", "rss14stacked", "rss14stackedomni", "rss14truncated", "telepen", "ucc128", "ucc128random", "ucc128sscc", "upca", "upcaadd2", "upcaadd5", "upcapwcd", "upce", "upceadd2", "upceadd5", "upcean2", "upcean5", "upsmaxicode"]);
  44957. this.upsMode = getStringOption(attributes.upsMode, ["usCarrier", "internationalCarrier", "secureSymbol", "standardSymbol"]);
  44958. this.use = attributes.use || "";
  44959. this.usehref = attributes.usehref || "";
  44960. this.wideNarrowRatio = getRatio(attributes.wideNarrowRatio);
  44961. this.encrypt = null;
  44962. this.extras = null;
  44963. }
  44964. }
  44965. class Bind extends XFAObject {
  44966. constructor(attributes) {
  44967. super(TEMPLATE_NS_ID, "bind", true);
  44968. this.match = getStringOption(attributes.match, ["once", "dataRef", "global", "none"]);
  44969. this.ref = attributes.ref || "";
  44970. this.picture = null;
  44971. }
  44972. }
  44973. class BindItems extends XFAObject {
  44974. constructor(attributes) {
  44975. super(TEMPLATE_NS_ID, "bindItems");
  44976. this.connection = attributes.connection || "";
  44977. this.labelRef = attributes.labelRef || "";
  44978. this.ref = attributes.ref || "";
  44979. this.valueRef = attributes.valueRef || "";
  44980. }
  44981. }
  44982. class Bookend extends XFAObject {
  44983. constructor(attributes) {
  44984. super(TEMPLATE_NS_ID, "bookend");
  44985. this.id = attributes.id || "";
  44986. this.leader = attributes.leader || "";
  44987. this.trailer = attributes.trailer || "";
  44988. this.use = attributes.use || "";
  44989. this.usehref = attributes.usehref || "";
  44990. }
  44991. }
  44992. class BooleanElement extends Option01 {
  44993. constructor(attributes) {
  44994. super(TEMPLATE_NS_ID, "boolean");
  44995. this.id = attributes.id || "";
  44996. this.name = attributes.name || "";
  44997. this.use = attributes.use || "";
  44998. this.usehref = attributes.usehref || "";
  44999. }
  45000. [$toHTML](availableSpace) {
  45001. return valueToHtml(this[$content] === 1 ? "1" : "0");
  45002. }
  45003. }
  45004. class Border extends XFAObject {
  45005. constructor(attributes) {
  45006. super(TEMPLATE_NS_ID, "border", true);
  45007. this.break = getStringOption(attributes.break, ["close", "open"]);
  45008. this.hand = getStringOption(attributes.hand, ["even", "left", "right"]);
  45009. this.id = attributes.id || "";
  45010. this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
  45011. this.relevant = getRelevant(attributes.relevant);
  45012. this.use = attributes.use || "";
  45013. this.usehref = attributes.usehref || "";
  45014. this.corner = new XFAObjectArray(4);
  45015. this.edge = new XFAObjectArray(4);
  45016. this.extras = null;
  45017. this.fill = null;
  45018. this.margin = null;
  45019. }
  45020. [$getExtra]() {
  45021. if (!this[$extra]) {
  45022. const edges = this.edge.children.slice();
  45023. if (edges.length < 4) {
  45024. const defaultEdge = edges.at(-1) || new Edge({});
  45025. for (let i = edges.length; i < 4; i++) {
  45026. edges.push(defaultEdge);
  45027. }
  45028. }
  45029. const widths = edges.map(edge => edge.thickness);
  45030. const insets = [0, 0, 0, 0];
  45031. if (this.margin) {
  45032. insets[0] = this.margin.topInset;
  45033. insets[1] = this.margin.rightInset;
  45034. insets[2] = this.margin.bottomInset;
  45035. insets[3] = this.margin.leftInset;
  45036. }
  45037. this[$extra] = {
  45038. widths,
  45039. insets,
  45040. edges
  45041. };
  45042. }
  45043. return this[$extra];
  45044. }
  45045. [$toStyle]() {
  45046. const {
  45047. edges
  45048. } = this[$getExtra]();
  45049. const edgeStyles = edges.map(node => {
  45050. const style = node[$toStyle]();
  45051. style.color ||= "#000000";
  45052. return style;
  45053. });
  45054. const style = Object.create(null);
  45055. if (this.margin) {
  45056. Object.assign(style, this.margin[$toStyle]());
  45057. }
  45058. if (this.fill?.presence === "visible") {
  45059. Object.assign(style, this.fill[$toStyle]());
  45060. }
  45061. if (this.corner.children.some(node => node.radius !== 0)) {
  45062. const cornerStyles = this.corner.children.map(node => node[$toStyle]());
  45063. if (cornerStyles.length === 2 || cornerStyles.length === 3) {
  45064. const last = cornerStyles.at(-1);
  45065. for (let i = cornerStyles.length; i < 4; i++) {
  45066. cornerStyles.push(last);
  45067. }
  45068. }
  45069. style.borderRadius = cornerStyles.map(s => s.radius).join(" ");
  45070. }
  45071. switch (this.presence) {
  45072. case "invisible":
  45073. case "hidden":
  45074. style.borderStyle = "";
  45075. break;
  45076. case "inactive":
  45077. style.borderStyle = "none";
  45078. break;
  45079. default:
  45080. style.borderStyle = edgeStyles.map(s => s.style).join(" ");
  45081. break;
  45082. }
  45083. style.borderWidth = edgeStyles.map(s => s.width).join(" ");
  45084. style.borderColor = edgeStyles.map(s => s.color).join(" ");
  45085. return style;
  45086. }
  45087. }
  45088. class Break extends XFAObject {
  45089. constructor(attributes) {
  45090. super(TEMPLATE_NS_ID, "break", true);
  45091. this.after = getStringOption(attributes.after, ["auto", "contentArea", "pageArea", "pageEven", "pageOdd"]);
  45092. this.afterTarget = attributes.afterTarget || "";
  45093. this.before = getStringOption(attributes.before, ["auto", "contentArea", "pageArea", "pageEven", "pageOdd"]);
  45094. this.beforeTarget = attributes.beforeTarget || "";
  45095. this.bookendLeader = attributes.bookendLeader || "";
  45096. this.bookendTrailer = attributes.bookendTrailer || "";
  45097. this.id = attributes.id || "";
  45098. this.overflowLeader = attributes.overflowLeader || "";
  45099. this.overflowTarget = attributes.overflowTarget || "";
  45100. this.overflowTrailer = attributes.overflowTrailer || "";
  45101. this.startNew = getInteger({
  45102. data: attributes.startNew,
  45103. defaultValue: 0,
  45104. validate: x => x === 1
  45105. });
  45106. this.use = attributes.use || "";
  45107. this.usehref = attributes.usehref || "";
  45108. this.extras = null;
  45109. }
  45110. }
  45111. class BreakAfter extends XFAObject {
  45112. constructor(attributes) {
  45113. super(TEMPLATE_NS_ID, "breakAfter", true);
  45114. this.id = attributes.id || "";
  45115. this.leader = attributes.leader || "";
  45116. this.startNew = getInteger({
  45117. data: attributes.startNew,
  45118. defaultValue: 0,
  45119. validate: x => x === 1
  45120. });
  45121. this.target = attributes.target || "";
  45122. this.targetType = getStringOption(attributes.targetType, ["auto", "contentArea", "pageArea"]);
  45123. this.trailer = attributes.trailer || "";
  45124. this.use = attributes.use || "";
  45125. this.usehref = attributes.usehref || "";
  45126. this.script = null;
  45127. }
  45128. }
  45129. class BreakBefore extends XFAObject {
  45130. constructor(attributes) {
  45131. super(TEMPLATE_NS_ID, "breakBefore", true);
  45132. this.id = attributes.id || "";
  45133. this.leader = attributes.leader || "";
  45134. this.startNew = getInteger({
  45135. data: attributes.startNew,
  45136. defaultValue: 0,
  45137. validate: x => x === 1
  45138. });
  45139. this.target = attributes.target || "";
  45140. this.targetType = getStringOption(attributes.targetType, ["auto", "contentArea", "pageArea"]);
  45141. this.trailer = attributes.trailer || "";
  45142. this.use = attributes.use || "";
  45143. this.usehref = attributes.usehref || "";
  45144. this.script = null;
  45145. }
  45146. [$toHTML](availableSpace) {
  45147. this[$extra] = {};
  45148. return HTMLResult.FAILURE;
  45149. }
  45150. }
  45151. class Button extends XFAObject {
  45152. constructor(attributes) {
  45153. super(TEMPLATE_NS_ID, "button", true);
  45154. this.highlight = getStringOption(attributes.highlight, ["inverted", "none", "outline", "push"]);
  45155. this.id = attributes.id || "";
  45156. this.use = attributes.use || "";
  45157. this.usehref = attributes.usehref || "";
  45158. this.extras = null;
  45159. }
  45160. [$toHTML](availableSpace) {
  45161. const parent = this[$getParent]();
  45162. const grandpa = parent[$getParent]();
  45163. const htmlButton = {
  45164. name: "button",
  45165. attributes: {
  45166. id: this[$uid],
  45167. class: ["xfaButton"],
  45168. style: {}
  45169. },
  45170. children: []
  45171. };
  45172. for (const event of grandpa.event.children) {
  45173. if (event.activity !== "click" || !event.script) {
  45174. continue;
  45175. }
  45176. const jsURL = recoverJsURL(event.script[$content]);
  45177. if (!jsURL) {
  45178. continue;
  45179. }
  45180. const href = fixURL(jsURL.url);
  45181. if (!href) {
  45182. continue;
  45183. }
  45184. htmlButton.children.push({
  45185. name: "a",
  45186. attributes: {
  45187. id: "link" + this[$uid],
  45188. href,
  45189. newWindow: jsURL.newWindow,
  45190. class: ["xfaLink"],
  45191. style: {}
  45192. },
  45193. children: []
  45194. });
  45195. }
  45196. return HTMLResult.success(htmlButton);
  45197. }
  45198. }
  45199. class Calculate extends XFAObject {
  45200. constructor(attributes) {
  45201. super(TEMPLATE_NS_ID, "calculate", true);
  45202. this.id = attributes.id || "";
  45203. this.override = getStringOption(attributes.override, ["disabled", "error", "ignore", "warning"]);
  45204. this.use = attributes.use || "";
  45205. this.usehref = attributes.usehref || "";
  45206. this.extras = null;
  45207. this.message = null;
  45208. this.script = null;
  45209. }
  45210. }
  45211. class Caption extends XFAObject {
  45212. constructor(attributes) {
  45213. super(TEMPLATE_NS_ID, "caption", true);
  45214. this.id = attributes.id || "";
  45215. this.placement = getStringOption(attributes.placement, ["left", "bottom", "inline", "right", "top"]);
  45216. this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
  45217. this.reserve = Math.ceil(getMeasurement(attributes.reserve));
  45218. this.use = attributes.use || "";
  45219. this.usehref = attributes.usehref || "";
  45220. this.extras = null;
  45221. this.font = null;
  45222. this.margin = null;
  45223. this.para = null;
  45224. this.value = null;
  45225. }
  45226. [$setValue](value) {
  45227. _setValue(this, value);
  45228. }
  45229. [$getExtra](availableSpace) {
  45230. if (!this[$extra]) {
  45231. let {
  45232. width,
  45233. height
  45234. } = availableSpace;
  45235. switch (this.placement) {
  45236. case "left":
  45237. case "right":
  45238. case "inline":
  45239. width = this.reserve <= 0 ? width : this.reserve;
  45240. break;
  45241. case "top":
  45242. case "bottom":
  45243. height = this.reserve <= 0 ? height : this.reserve;
  45244. break;
  45245. }
  45246. this[$extra] = layoutNode(this, {
  45247. width,
  45248. height
  45249. });
  45250. }
  45251. return this[$extra];
  45252. }
  45253. [$toHTML](availableSpace) {
  45254. if (!this.value) {
  45255. return HTMLResult.EMPTY;
  45256. }
  45257. this[$pushPara]();
  45258. const value = this.value[$toHTML](availableSpace).html;
  45259. if (!value) {
  45260. this[$popPara]();
  45261. return HTMLResult.EMPTY;
  45262. }
  45263. const savedReserve = this.reserve;
  45264. if (this.reserve <= 0) {
  45265. const {
  45266. w,
  45267. h
  45268. } = this[$getExtra](availableSpace);
  45269. switch (this.placement) {
  45270. case "left":
  45271. case "right":
  45272. case "inline":
  45273. this.reserve = w;
  45274. break;
  45275. case "top":
  45276. case "bottom":
  45277. this.reserve = h;
  45278. break;
  45279. }
  45280. }
  45281. const children = [];
  45282. if (typeof value === "string") {
  45283. children.push({
  45284. name: "#text",
  45285. value
  45286. });
  45287. } else {
  45288. children.push(value);
  45289. }
  45290. const style = toStyle(this, "font", "margin", "visibility");
  45291. switch (this.placement) {
  45292. case "left":
  45293. case "right":
  45294. if (this.reserve > 0) {
  45295. style.width = measureToString(this.reserve);
  45296. }
  45297. break;
  45298. case "top":
  45299. case "bottom":
  45300. if (this.reserve > 0) {
  45301. style.height = measureToString(this.reserve);
  45302. }
  45303. break;
  45304. }
  45305. setPara(this, null, value);
  45306. this[$popPara]();
  45307. this.reserve = savedReserve;
  45308. return HTMLResult.success({
  45309. name: "div",
  45310. attributes: {
  45311. style,
  45312. class: ["xfaCaption"]
  45313. },
  45314. children
  45315. });
  45316. }
  45317. }
  45318. class Certificate extends StringObject {
  45319. constructor(attributes) {
  45320. super(TEMPLATE_NS_ID, "certificate");
  45321. this.id = attributes.id || "";
  45322. this.name = attributes.name || "";
  45323. this.use = attributes.use || "";
  45324. this.usehref = attributes.usehref || "";
  45325. }
  45326. }
  45327. class Certificates extends XFAObject {
  45328. constructor(attributes) {
  45329. super(TEMPLATE_NS_ID, "certificates", true);
  45330. this.credentialServerPolicy = getStringOption(attributes.credentialServerPolicy, ["optional", "required"]);
  45331. this.id = attributes.id || "";
  45332. this.url = attributes.url || "";
  45333. this.urlPolicy = attributes.urlPolicy || "";
  45334. this.use = attributes.use || "";
  45335. this.usehref = attributes.usehref || "";
  45336. this.encryption = null;
  45337. this.issuers = null;
  45338. this.keyUsage = null;
  45339. this.oids = null;
  45340. this.signing = null;
  45341. this.subjectDNs = null;
  45342. }
  45343. }
  45344. class CheckButton extends XFAObject {
  45345. constructor(attributes) {
  45346. super(TEMPLATE_NS_ID, "checkButton", true);
  45347. this.id = attributes.id || "";
  45348. this.mark = getStringOption(attributes.mark, ["default", "check", "circle", "cross", "diamond", "square", "star"]);
  45349. this.shape = getStringOption(attributes.shape, ["square", "round"]);
  45350. this.size = getMeasurement(attributes.size, "10pt");
  45351. this.use = attributes.use || "";
  45352. this.usehref = attributes.usehref || "";
  45353. this.border = null;
  45354. this.extras = null;
  45355. this.margin = null;
  45356. }
  45357. [$toHTML](availableSpace) {
  45358. const style = toStyle("margin");
  45359. const size = measureToString(this.size);
  45360. style.width = style.height = size;
  45361. let type;
  45362. let className;
  45363. let groupId;
  45364. const field = this[$getParent]()[$getParent]();
  45365. const items = field.items.children.length && field.items.children[0][$toHTML]().html || [];
  45366. const exportedValue = {
  45367. on: (items[0] !== undefined ? items[0] : "on").toString(),
  45368. off: (items[1] !== undefined ? items[1] : "off").toString()
  45369. };
  45370. const value = field.value?.[$text]() || "off";
  45371. const checked = value === exportedValue.on || undefined;
  45372. const container = field[$getSubformParent]();
  45373. const fieldId = field[$uid];
  45374. let dataId;
  45375. if (container instanceof ExclGroup) {
  45376. groupId = container[$uid];
  45377. type = "radio";
  45378. className = "xfaRadio";
  45379. dataId = container[$data]?.[$uid] || container[$uid];
  45380. } else {
  45381. type = "checkbox";
  45382. className = "xfaCheckbox";
  45383. dataId = field[$data]?.[$uid] || field[$uid];
  45384. }
  45385. const input = {
  45386. name: "input",
  45387. attributes: {
  45388. class: [className],
  45389. style,
  45390. fieldId,
  45391. dataId,
  45392. type,
  45393. checked,
  45394. xfaOn: exportedValue.on,
  45395. xfaOff: exportedValue.off,
  45396. "aria-label": ariaLabel(field),
  45397. "aria-required": false
  45398. }
  45399. };
  45400. if (groupId) {
  45401. input.attributes.name = groupId;
  45402. }
  45403. if (isRequired(field)) {
  45404. input.attributes["aria-required"] = true;
  45405. input.attributes.required = true;
  45406. }
  45407. return HTMLResult.success({
  45408. name: "label",
  45409. attributes: {
  45410. class: ["xfaLabel"]
  45411. },
  45412. children: [input]
  45413. });
  45414. }
  45415. }
  45416. class ChoiceList extends XFAObject {
  45417. constructor(attributes) {
  45418. super(TEMPLATE_NS_ID, "choiceList", true);
  45419. this.commitOn = getStringOption(attributes.commitOn, ["select", "exit"]);
  45420. this.id = attributes.id || "";
  45421. this.open = getStringOption(attributes.open, ["userControl", "always", "multiSelect", "onEntry"]);
  45422. this.textEntry = getInteger({
  45423. data: attributes.textEntry,
  45424. defaultValue: 0,
  45425. validate: x => x === 1
  45426. });
  45427. this.use = attributes.use || "";
  45428. this.usehref = attributes.usehref || "";
  45429. this.border = null;
  45430. this.extras = null;
  45431. this.margin = null;
  45432. }
  45433. [$toHTML](availableSpace) {
  45434. const style = toStyle(this, "border", "margin");
  45435. const ui = this[$getParent]();
  45436. const field = ui[$getParent]();
  45437. const fontSize = field.font?.size || 10;
  45438. const optionStyle = {
  45439. fontSize: `calc(${fontSize}px * var(--scale-factor))`
  45440. };
  45441. const children = [];
  45442. if (field.items.children.length > 0) {
  45443. const items = field.items;
  45444. let displayedIndex = 0;
  45445. let saveIndex = 0;
  45446. if (items.children.length === 2) {
  45447. displayedIndex = items.children[0].save;
  45448. saveIndex = 1 - displayedIndex;
  45449. }
  45450. const displayed = items.children[displayedIndex][$toHTML]().html;
  45451. const values = items.children[saveIndex][$toHTML]().html;
  45452. let selected = false;
  45453. const value = field.value?.[$text]() || "";
  45454. for (let i = 0, ii = displayed.length; i < ii; i++) {
  45455. const option = {
  45456. name: "option",
  45457. attributes: {
  45458. value: values[i] || displayed[i],
  45459. style: optionStyle
  45460. },
  45461. value: displayed[i]
  45462. };
  45463. if (values[i] === value) {
  45464. option.attributes.selected = selected = true;
  45465. }
  45466. children.push(option);
  45467. }
  45468. if (!selected) {
  45469. children.splice(0, 0, {
  45470. name: "option",
  45471. attributes: {
  45472. hidden: true,
  45473. selected: true
  45474. },
  45475. value: " "
  45476. });
  45477. }
  45478. }
  45479. const selectAttributes = {
  45480. class: ["xfaSelect"],
  45481. fieldId: field[$uid],
  45482. dataId: field[$data]?.[$uid] || field[$uid],
  45483. style,
  45484. "aria-label": ariaLabel(field),
  45485. "aria-required": false
  45486. };
  45487. if (isRequired(field)) {
  45488. selectAttributes["aria-required"] = true;
  45489. selectAttributes.required = true;
  45490. }
  45491. if (this.open === "multiSelect") {
  45492. selectAttributes.multiple = true;
  45493. }
  45494. return HTMLResult.success({
  45495. name: "label",
  45496. attributes: {
  45497. class: ["xfaLabel"]
  45498. },
  45499. children: [{
  45500. name: "select",
  45501. children,
  45502. attributes: selectAttributes
  45503. }]
  45504. });
  45505. }
  45506. }
  45507. class Color extends XFAObject {
  45508. constructor(attributes) {
  45509. super(TEMPLATE_NS_ID, "color", true);
  45510. this.cSpace = getStringOption(attributes.cSpace, ["SRGB"]);
  45511. this.id = attributes.id || "";
  45512. this.use = attributes.use || "";
  45513. this.usehref = attributes.usehref || "";
  45514. this.value = attributes.value ? getColor(attributes.value) : "";
  45515. this.extras = null;
  45516. }
  45517. [$hasSettableValue]() {
  45518. return false;
  45519. }
  45520. [$toStyle]() {
  45521. return this.value ? Util.makeHexColor(this.value.r, this.value.g, this.value.b) : null;
  45522. }
  45523. }
  45524. class Comb extends XFAObject {
  45525. constructor(attributes) {
  45526. super(TEMPLATE_NS_ID, "comb");
  45527. this.id = attributes.id || "";
  45528. this.numberOfCells = getInteger({
  45529. data: attributes.numberOfCells,
  45530. defaultValue: 0,
  45531. validate: x => x >= 0
  45532. });
  45533. this.use = attributes.use || "";
  45534. this.usehref = attributes.usehref || "";
  45535. }
  45536. }
  45537. class Connect extends XFAObject {
  45538. constructor(attributes) {
  45539. super(TEMPLATE_NS_ID, "connect", true);
  45540. this.connection = attributes.connection || "";
  45541. this.id = attributes.id || "";
  45542. this.ref = attributes.ref || "";
  45543. this.usage = getStringOption(attributes.usage, ["exportAndImport", "exportOnly", "importOnly"]);
  45544. this.use = attributes.use || "";
  45545. this.usehref = attributes.usehref || "";
  45546. this.picture = null;
  45547. }
  45548. }
  45549. class ContentArea extends XFAObject {
  45550. constructor(attributes) {
  45551. super(TEMPLATE_NS_ID, "contentArea", true);
  45552. this.h = getMeasurement(attributes.h);
  45553. this.id = attributes.id || "";
  45554. this.name = attributes.name || "";
  45555. this.relevant = getRelevant(attributes.relevant);
  45556. this.use = attributes.use || "";
  45557. this.usehref = attributes.usehref || "";
  45558. this.w = getMeasurement(attributes.w);
  45559. this.x = getMeasurement(attributes.x, "0pt");
  45560. this.y = getMeasurement(attributes.y, "0pt");
  45561. this.desc = null;
  45562. this.extras = null;
  45563. }
  45564. [$toHTML](availableSpace) {
  45565. const left = measureToString(this.x);
  45566. const top = measureToString(this.y);
  45567. const style = {
  45568. left,
  45569. top,
  45570. width: measureToString(this.w),
  45571. height: measureToString(this.h)
  45572. };
  45573. const classNames = ["xfaContentarea"];
  45574. if (isPrintOnly(this)) {
  45575. classNames.push("xfaPrintOnly");
  45576. }
  45577. return HTMLResult.success({
  45578. name: "div",
  45579. children: [],
  45580. attributes: {
  45581. style,
  45582. class: classNames,
  45583. id: this[$uid]
  45584. }
  45585. });
  45586. }
  45587. }
  45588. class Corner extends XFAObject {
  45589. constructor(attributes) {
  45590. super(TEMPLATE_NS_ID, "corner", true);
  45591. this.id = attributes.id || "";
  45592. this.inverted = getInteger({
  45593. data: attributes.inverted,
  45594. defaultValue: 0,
  45595. validate: x => x === 1
  45596. });
  45597. this.join = getStringOption(attributes.join, ["square", "round"]);
  45598. this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
  45599. this.radius = getMeasurement(attributes.radius);
  45600. this.stroke = getStringOption(attributes.stroke, ["solid", "dashDot", "dashDotDot", "dashed", "dotted", "embossed", "etched", "lowered", "raised"]);
  45601. this.thickness = getMeasurement(attributes.thickness, "0.5pt");
  45602. this.use = attributes.use || "";
  45603. this.usehref = attributes.usehref || "";
  45604. this.color = null;
  45605. this.extras = null;
  45606. }
  45607. [$toStyle]() {
  45608. const style = toStyle(this, "visibility");
  45609. style.radius = measureToString(this.join === "square" ? 0 : this.radius);
  45610. return style;
  45611. }
  45612. }
  45613. class DateElement extends ContentObject {
  45614. constructor(attributes) {
  45615. super(TEMPLATE_NS_ID, "date");
  45616. this.id = attributes.id || "";
  45617. this.name = attributes.name || "";
  45618. this.use = attributes.use || "";
  45619. this.usehref = attributes.usehref || "";
  45620. }
  45621. [$finalize]() {
  45622. const date = this[$content].trim();
  45623. this[$content] = date ? new Date(date) : null;
  45624. }
  45625. [$toHTML](availableSpace) {
  45626. return valueToHtml(this[$content] ? this[$content].toString() : "");
  45627. }
  45628. }
  45629. class DateTime extends ContentObject {
  45630. constructor(attributes) {
  45631. super(TEMPLATE_NS_ID, "dateTime");
  45632. this.id = attributes.id || "";
  45633. this.name = attributes.name || "";
  45634. this.use = attributes.use || "";
  45635. this.usehref = attributes.usehref || "";
  45636. }
  45637. [$finalize]() {
  45638. const date = this[$content].trim();
  45639. this[$content] = date ? new Date(date) : null;
  45640. }
  45641. [$toHTML](availableSpace) {
  45642. return valueToHtml(this[$content] ? this[$content].toString() : "");
  45643. }
  45644. }
  45645. class DateTimeEdit extends XFAObject {
  45646. constructor(attributes) {
  45647. super(TEMPLATE_NS_ID, "dateTimeEdit", true);
  45648. this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, ["auto", "off", "on"]);
  45649. this.id = attributes.id || "";
  45650. this.picker = getStringOption(attributes.picker, ["host", "none"]);
  45651. this.use = attributes.use || "";
  45652. this.usehref = attributes.usehref || "";
  45653. this.border = null;
  45654. this.comb = null;
  45655. this.extras = null;
  45656. this.margin = null;
  45657. }
  45658. [$toHTML](availableSpace) {
  45659. const style = toStyle(this, "border", "font", "margin");
  45660. const field = this[$getParent]()[$getParent]();
  45661. const html = {
  45662. name: "input",
  45663. attributes: {
  45664. type: "text",
  45665. fieldId: field[$uid],
  45666. dataId: field[$data]?.[$uid] || field[$uid],
  45667. class: ["xfaTextfield"],
  45668. style,
  45669. "aria-label": ariaLabel(field),
  45670. "aria-required": false
  45671. }
  45672. };
  45673. if (isRequired(field)) {
  45674. html.attributes["aria-required"] = true;
  45675. html.attributes.required = true;
  45676. }
  45677. return HTMLResult.success({
  45678. name: "label",
  45679. attributes: {
  45680. class: ["xfaLabel"]
  45681. },
  45682. children: [html]
  45683. });
  45684. }
  45685. }
  45686. class Decimal extends ContentObject {
  45687. constructor(attributes) {
  45688. super(TEMPLATE_NS_ID, "decimal");
  45689. this.fracDigits = getInteger({
  45690. data: attributes.fracDigits,
  45691. defaultValue: 2,
  45692. validate: x => true
  45693. });
  45694. this.id = attributes.id || "";
  45695. this.leadDigits = getInteger({
  45696. data: attributes.leadDigits,
  45697. defaultValue: -1,
  45698. validate: x => true
  45699. });
  45700. this.name = attributes.name || "";
  45701. this.use = attributes.use || "";
  45702. this.usehref = attributes.usehref || "";
  45703. }
  45704. [$finalize]() {
  45705. const number = parseFloat(this[$content].trim());
  45706. this[$content] = isNaN(number) ? null : number;
  45707. }
  45708. [$toHTML](availableSpace) {
  45709. return valueToHtml(this[$content] !== null ? this[$content].toString() : "");
  45710. }
  45711. }
  45712. class DefaultUi extends XFAObject {
  45713. constructor(attributes) {
  45714. super(TEMPLATE_NS_ID, "defaultUi", true);
  45715. this.id = attributes.id || "";
  45716. this.use = attributes.use || "";
  45717. this.usehref = attributes.usehref || "";
  45718. this.extras = null;
  45719. }
  45720. }
  45721. class Desc extends XFAObject {
  45722. constructor(attributes) {
  45723. super(TEMPLATE_NS_ID, "desc", true);
  45724. this.id = attributes.id || "";
  45725. this.use = attributes.use || "";
  45726. this.usehref = attributes.usehref || "";
  45727. this.boolean = new XFAObjectArray();
  45728. this.date = new XFAObjectArray();
  45729. this.dateTime = new XFAObjectArray();
  45730. this.decimal = new XFAObjectArray();
  45731. this.exData = new XFAObjectArray();
  45732. this.float = new XFAObjectArray();
  45733. this.image = new XFAObjectArray();
  45734. this.integer = new XFAObjectArray();
  45735. this.text = new XFAObjectArray();
  45736. this.time = new XFAObjectArray();
  45737. }
  45738. }
  45739. class DigestMethod extends OptionObject {
  45740. constructor(attributes) {
  45741. super(TEMPLATE_NS_ID, "digestMethod", ["", "SHA1", "SHA256", "SHA512", "RIPEMD160"]);
  45742. this.id = attributes.id || "";
  45743. this.use = attributes.use || "";
  45744. this.usehref = attributes.usehref || "";
  45745. }
  45746. }
  45747. class DigestMethods extends XFAObject {
  45748. constructor(attributes) {
  45749. super(TEMPLATE_NS_ID, "digestMethods", true);
  45750. this.id = attributes.id || "";
  45751. this.type = getStringOption(attributes.type, ["optional", "required"]);
  45752. this.use = attributes.use || "";
  45753. this.usehref = attributes.usehref || "";
  45754. this.digestMethod = new XFAObjectArray();
  45755. }
  45756. }
  45757. class Draw extends XFAObject {
  45758. constructor(attributes) {
  45759. super(TEMPLATE_NS_ID, "draw", true);
  45760. this.anchorType = getStringOption(attributes.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]);
  45761. this.colSpan = getInteger({
  45762. data: attributes.colSpan,
  45763. defaultValue: 1,
  45764. validate: n => n >= 1 || n === -1
  45765. });
  45766. this.h = attributes.h ? getMeasurement(attributes.h) : "";
  45767. this.hAlign = getStringOption(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]);
  45768. this.id = attributes.id || "";
  45769. this.locale = attributes.locale || "";
  45770. this.maxH = getMeasurement(attributes.maxH, "0pt");
  45771. this.maxW = getMeasurement(attributes.maxW, "0pt");
  45772. this.minH = getMeasurement(attributes.minH, "0pt");
  45773. this.minW = getMeasurement(attributes.minW, "0pt");
  45774. this.name = attributes.name || "";
  45775. this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
  45776. this.relevant = getRelevant(attributes.relevant);
  45777. this.rotate = getInteger({
  45778. data: attributes.rotate,
  45779. defaultValue: 0,
  45780. validate: x => x % 90 === 0
  45781. });
  45782. this.use = attributes.use || "";
  45783. this.usehref = attributes.usehref || "";
  45784. this.w = attributes.w ? getMeasurement(attributes.w) : "";
  45785. this.x = getMeasurement(attributes.x, "0pt");
  45786. this.y = getMeasurement(attributes.y, "0pt");
  45787. this.assist = null;
  45788. this.border = null;
  45789. this.caption = null;
  45790. this.desc = null;
  45791. this.extras = null;
  45792. this.font = null;
  45793. this.keep = null;
  45794. this.margin = null;
  45795. this.para = null;
  45796. this.traversal = null;
  45797. this.ui = null;
  45798. this.value = null;
  45799. this.setProperty = new XFAObjectArray();
  45800. }
  45801. [$setValue](value) {
  45802. _setValue(this, value);
  45803. }
  45804. [$toHTML](availableSpace) {
  45805. setTabIndex(this);
  45806. if (this.presence === "hidden" || this.presence === "inactive") {
  45807. return HTMLResult.EMPTY;
  45808. }
  45809. fixDimensions(this);
  45810. this[$pushPara]();
  45811. const savedW = this.w;
  45812. const savedH = this.h;
  45813. const {
  45814. w,
  45815. h,
  45816. isBroken
  45817. } = layoutNode(this, availableSpace);
  45818. if (w && this.w === "") {
  45819. if (isBroken && this[$getSubformParent]()[$isThereMoreWidth]()) {
  45820. this[$popPara]();
  45821. return HTMLResult.FAILURE;
  45822. }
  45823. this.w = w;
  45824. }
  45825. if (h && this.h === "") {
  45826. this.h = h;
  45827. }
  45828. setFirstUnsplittable(this);
  45829. if (!checkDimensions(this, availableSpace)) {
  45830. this.w = savedW;
  45831. this.h = savedH;
  45832. this[$popPara]();
  45833. return HTMLResult.FAILURE;
  45834. }
  45835. unsetFirstUnsplittable(this);
  45836. const style = toStyle(this, "font", "hAlign", "dimensions", "position", "presence", "rotate", "anchorType", "border", "margin");
  45837. setMinMaxDimensions(this, style);
  45838. if (style.margin) {
  45839. style.padding = style.margin;
  45840. delete style.margin;
  45841. }
  45842. const classNames = ["xfaDraw"];
  45843. if (this.font) {
  45844. classNames.push("xfaFont");
  45845. }
  45846. if (isPrintOnly(this)) {
  45847. classNames.push("xfaPrintOnly");
  45848. }
  45849. const attributes = {
  45850. style,
  45851. id: this[$uid],
  45852. class: classNames
  45853. };
  45854. if (this.name) {
  45855. attributes.xfaName = this.name;
  45856. }
  45857. const html = {
  45858. name: "div",
  45859. attributes,
  45860. children: []
  45861. };
  45862. applyAssist(this, attributes);
  45863. const bbox = computeBbox(this, html, availableSpace);
  45864. const value = this.value ? this.value[$toHTML](availableSpace).html : null;
  45865. if (value === null) {
  45866. this.w = savedW;
  45867. this.h = savedH;
  45868. this[$popPara]();
  45869. return HTMLResult.success(createWrapper(this, html), bbox);
  45870. }
  45871. html.children.push(value);
  45872. setPara(this, style, value);
  45873. this.w = savedW;
  45874. this.h = savedH;
  45875. this[$popPara]();
  45876. return HTMLResult.success(createWrapper(this, html), bbox);
  45877. }
  45878. }
  45879. class Edge extends XFAObject {
  45880. constructor(attributes) {
  45881. super(TEMPLATE_NS_ID, "edge", true);
  45882. this.cap = getStringOption(attributes.cap, ["square", "butt", "round"]);
  45883. this.id = attributes.id || "";
  45884. this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
  45885. this.stroke = getStringOption(attributes.stroke, ["solid", "dashDot", "dashDotDot", "dashed", "dotted", "embossed", "etched", "lowered", "raised"]);
  45886. this.thickness = getMeasurement(attributes.thickness, "0.5pt");
  45887. this.use = attributes.use || "";
  45888. this.usehref = attributes.usehref || "";
  45889. this.color = null;
  45890. this.extras = null;
  45891. }
  45892. [$toStyle]() {
  45893. const style = toStyle(this, "visibility");
  45894. Object.assign(style, {
  45895. linecap: this.cap,
  45896. width: measureToString(this.thickness),
  45897. color: this.color ? this.color[$toStyle]() : "#000000",
  45898. style: ""
  45899. });
  45900. if (this.presence !== "visible") {
  45901. style.style = "none";
  45902. } else {
  45903. switch (this.stroke) {
  45904. case "solid":
  45905. style.style = "solid";
  45906. break;
  45907. case "dashDot":
  45908. style.style = "dashed";
  45909. break;
  45910. case "dashDotDot":
  45911. style.style = "dashed";
  45912. break;
  45913. case "dashed":
  45914. style.style = "dashed";
  45915. break;
  45916. case "dotted":
  45917. style.style = "dotted";
  45918. break;
  45919. case "embossed":
  45920. style.style = "ridge";
  45921. break;
  45922. case "etched":
  45923. style.style = "groove";
  45924. break;
  45925. case "lowered":
  45926. style.style = "inset";
  45927. break;
  45928. case "raised":
  45929. style.style = "outset";
  45930. break;
  45931. }
  45932. }
  45933. return style;
  45934. }
  45935. }
  45936. class Encoding extends OptionObject {
  45937. constructor(attributes) {
  45938. super(TEMPLATE_NS_ID, "encoding", ["adbe.x509.rsa_sha1", "adbe.pkcs7.detached", "adbe.pkcs7.sha1"]);
  45939. this.id = attributes.id || "";
  45940. this.use = attributes.use || "";
  45941. this.usehref = attributes.usehref || "";
  45942. }
  45943. }
  45944. class Encodings extends XFAObject {
  45945. constructor(attributes) {
  45946. super(TEMPLATE_NS_ID, "encodings", true);
  45947. this.id = attributes.id || "";
  45948. this.type = getStringOption(attributes.type, ["optional", "required"]);
  45949. this.use = attributes.use || "";
  45950. this.usehref = attributes.usehref || "";
  45951. this.encoding = new XFAObjectArray();
  45952. }
  45953. }
  45954. class Encrypt extends XFAObject {
  45955. constructor(attributes) {
  45956. super(TEMPLATE_NS_ID, "encrypt", true);
  45957. this.id = attributes.id || "";
  45958. this.use = attributes.use || "";
  45959. this.usehref = attributes.usehref || "";
  45960. this.certificate = null;
  45961. }
  45962. }
  45963. class EncryptData extends XFAObject {
  45964. constructor(attributes) {
  45965. super(TEMPLATE_NS_ID, "encryptData", true);
  45966. this.id = attributes.id || "";
  45967. this.operation = getStringOption(attributes.operation, ["encrypt", "decrypt"]);
  45968. this.target = attributes.target || "";
  45969. this.use = attributes.use || "";
  45970. this.usehref = attributes.usehref || "";
  45971. this.filter = null;
  45972. this.manifest = null;
  45973. }
  45974. }
  45975. class Encryption extends XFAObject {
  45976. constructor(attributes) {
  45977. super(TEMPLATE_NS_ID, "encryption", true);
  45978. this.id = attributes.id || "";
  45979. this.type = getStringOption(attributes.type, ["optional", "required"]);
  45980. this.use = attributes.use || "";
  45981. this.usehref = attributes.usehref || "";
  45982. this.certificate = new XFAObjectArray();
  45983. }
  45984. }
  45985. class EncryptionMethod extends OptionObject {
  45986. constructor(attributes) {
  45987. super(TEMPLATE_NS_ID, "encryptionMethod", ["", "AES256-CBC", "TRIPLEDES-CBC", "AES128-CBC", "AES192-CBC"]);
  45988. this.id = attributes.id || "";
  45989. this.use = attributes.use || "";
  45990. this.usehref = attributes.usehref || "";
  45991. }
  45992. }
  45993. class EncryptionMethods extends XFAObject {
  45994. constructor(attributes) {
  45995. super(TEMPLATE_NS_ID, "encryptionMethods", true);
  45996. this.id = attributes.id || "";
  45997. this.type = getStringOption(attributes.type, ["optional", "required"]);
  45998. this.use = attributes.use || "";
  45999. this.usehref = attributes.usehref || "";
  46000. this.encryptionMethod = new XFAObjectArray();
  46001. }
  46002. }
  46003. class Event extends XFAObject {
  46004. constructor(attributes) {
  46005. super(TEMPLATE_NS_ID, "event", true);
  46006. this.activity = getStringOption(attributes.activity, ["click", "change", "docClose", "docReady", "enter", "exit", "full", "indexChange", "initialize", "mouseDown", "mouseEnter", "mouseExit", "mouseUp", "postExecute", "postOpen", "postPrint", "postSave", "postSign", "postSubmit", "preExecute", "preOpen", "prePrint", "preSave", "preSign", "preSubmit", "ready", "validationState"]);
  46007. this.id = attributes.id || "";
  46008. this.listen = getStringOption(attributes.listen, ["refOnly", "refAndDescendents"]);
  46009. this.name = attributes.name || "";
  46010. this.ref = attributes.ref || "";
  46011. this.use = attributes.use || "";
  46012. this.usehref = attributes.usehref || "";
  46013. this.extras = null;
  46014. this.encryptData = null;
  46015. this.execute = null;
  46016. this.script = null;
  46017. this.signData = null;
  46018. this.submit = null;
  46019. }
  46020. }
  46021. class ExData extends ContentObject {
  46022. constructor(attributes) {
  46023. super(TEMPLATE_NS_ID, "exData");
  46024. this.contentType = attributes.contentType || "";
  46025. this.href = attributes.href || "";
  46026. this.id = attributes.id || "";
  46027. this.maxLength = getInteger({
  46028. data: attributes.maxLength,
  46029. defaultValue: -1,
  46030. validate: x => x >= -1
  46031. });
  46032. this.name = attributes.name || "";
  46033. this.rid = attributes.rid || "";
  46034. this.transferEncoding = getStringOption(attributes.transferEncoding, ["none", "base64", "package"]);
  46035. this.use = attributes.use || "";
  46036. this.usehref = attributes.usehref || "";
  46037. }
  46038. [$isCDATAXml]() {
  46039. return this.contentType === "text/html";
  46040. }
  46041. [$onChild](child) {
  46042. if (this.contentType === "text/html" && child[$namespaceId] === NamespaceIds.xhtml.id) {
  46043. this[$content] = child;
  46044. return true;
  46045. }
  46046. if (this.contentType === "text/xml") {
  46047. this[$content] = child;
  46048. return true;
  46049. }
  46050. return false;
  46051. }
  46052. [$toHTML](availableSpace) {
  46053. if (this.contentType !== "text/html" || !this[$content]) {
  46054. return HTMLResult.EMPTY;
  46055. }
  46056. return this[$content][$toHTML](availableSpace);
  46057. }
  46058. }
  46059. class ExObject extends XFAObject {
  46060. constructor(attributes) {
  46061. super(TEMPLATE_NS_ID, "exObject", true);
  46062. this.archive = attributes.archive || "";
  46063. this.classId = attributes.classId || "";
  46064. this.codeBase = attributes.codeBase || "";
  46065. this.codeType = attributes.codeType || "";
  46066. this.id = attributes.id || "";
  46067. this.name = attributes.name || "";
  46068. this.use = attributes.use || "";
  46069. this.usehref = attributes.usehref || "";
  46070. this.extras = null;
  46071. this.boolean = new XFAObjectArray();
  46072. this.date = new XFAObjectArray();
  46073. this.dateTime = new XFAObjectArray();
  46074. this.decimal = new XFAObjectArray();
  46075. this.exData = new XFAObjectArray();
  46076. this.exObject = new XFAObjectArray();
  46077. this.float = new XFAObjectArray();
  46078. this.image = new XFAObjectArray();
  46079. this.integer = new XFAObjectArray();
  46080. this.text = new XFAObjectArray();
  46081. this.time = new XFAObjectArray();
  46082. }
  46083. }
  46084. class ExclGroup extends XFAObject {
  46085. constructor(attributes) {
  46086. super(TEMPLATE_NS_ID, "exclGroup", true);
  46087. this.access = getStringOption(attributes.access, ["open", "nonInteractive", "protected", "readOnly"]);
  46088. this.accessKey = attributes.accessKey || "";
  46089. this.anchorType = getStringOption(attributes.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]);
  46090. this.colSpan = getInteger({
  46091. data: attributes.colSpan,
  46092. defaultValue: 1,
  46093. validate: n => n >= 1 || n === -1
  46094. });
  46095. this.h = attributes.h ? getMeasurement(attributes.h) : "";
  46096. this.hAlign = getStringOption(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]);
  46097. this.id = attributes.id || "";
  46098. this.layout = getStringOption(attributes.layout, ["position", "lr-tb", "rl-row", "rl-tb", "row", "table", "tb"]);
  46099. this.maxH = getMeasurement(attributes.maxH, "0pt");
  46100. this.maxW = getMeasurement(attributes.maxW, "0pt");
  46101. this.minH = getMeasurement(attributes.minH, "0pt");
  46102. this.minW = getMeasurement(attributes.minW, "0pt");
  46103. this.name = attributes.name || "";
  46104. this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
  46105. this.relevant = getRelevant(attributes.relevant);
  46106. this.use = attributes.use || "";
  46107. this.usehref = attributes.usehref || "";
  46108. this.w = attributes.w ? getMeasurement(attributes.w) : "";
  46109. this.x = getMeasurement(attributes.x, "0pt");
  46110. this.y = getMeasurement(attributes.y, "0pt");
  46111. this.assist = null;
  46112. this.bind = null;
  46113. this.border = null;
  46114. this.calculate = null;
  46115. this.caption = null;
  46116. this.desc = null;
  46117. this.extras = null;
  46118. this.margin = null;
  46119. this.para = null;
  46120. this.traversal = null;
  46121. this.validate = null;
  46122. this.connect = new XFAObjectArray();
  46123. this.event = new XFAObjectArray();
  46124. this.field = new XFAObjectArray();
  46125. this.setProperty = new XFAObjectArray();
  46126. }
  46127. [$isBindable]() {
  46128. return true;
  46129. }
  46130. [$hasSettableValue]() {
  46131. return true;
  46132. }
  46133. [$setValue](value) {
  46134. for (const field of this.field.children) {
  46135. if (!field.value) {
  46136. const nodeValue = new Value({});
  46137. field[$appendChild](nodeValue);
  46138. field.value = nodeValue;
  46139. }
  46140. field.value[$setValue](value);
  46141. }
  46142. }
  46143. [$isThereMoreWidth]() {
  46144. return this.layout.endsWith("-tb") && this[$extra].attempt === 0 && this[$extra].numberInLine > 0 || this[$getParent]()[$isThereMoreWidth]();
  46145. }
  46146. [$isSplittable]() {
  46147. const parent = this[$getSubformParent]();
  46148. if (!parent[$isSplittable]()) {
  46149. return false;
  46150. }
  46151. if (this[$extra]._isSplittable !== undefined) {
  46152. return this[$extra]._isSplittable;
  46153. }
  46154. if (this.layout === "position" || this.layout.includes("row")) {
  46155. this[$extra]._isSplittable = false;
  46156. return false;
  46157. }
  46158. if (parent.layout?.endsWith("-tb") && parent[$extra].numberInLine !== 0) {
  46159. return false;
  46160. }
  46161. this[$extra]._isSplittable = true;
  46162. return true;
  46163. }
  46164. [$flushHTML]() {
  46165. return flushHTML(this);
  46166. }
  46167. [$addHTML](html, bbox) {
  46168. addHTML(this, html, bbox);
  46169. }
  46170. [$getAvailableSpace]() {
  46171. return getAvailableSpace(this);
  46172. }
  46173. [$toHTML](availableSpace) {
  46174. setTabIndex(this);
  46175. if (this.presence === "hidden" || this.presence === "inactive" || this.h === 0 || this.w === 0) {
  46176. return HTMLResult.EMPTY;
  46177. }
  46178. fixDimensions(this);
  46179. const children = [];
  46180. const attributes = {
  46181. id: this[$uid],
  46182. class: []
  46183. };
  46184. setAccess(this, attributes.class);
  46185. if (!this[$extra]) {
  46186. this[$extra] = Object.create(null);
  46187. }
  46188. Object.assign(this[$extra], {
  46189. children,
  46190. attributes,
  46191. attempt: 0,
  46192. line: null,
  46193. numberInLine: 0,
  46194. availableSpace: {
  46195. width: Math.min(this.w || Infinity, availableSpace.width),
  46196. height: Math.min(this.h || Infinity, availableSpace.height)
  46197. },
  46198. width: 0,
  46199. height: 0,
  46200. prevHeight: 0,
  46201. currentWidth: 0
  46202. });
  46203. const isSplittable = this[$isSplittable]();
  46204. if (!isSplittable) {
  46205. setFirstUnsplittable(this);
  46206. }
  46207. if (!checkDimensions(this, availableSpace)) {
  46208. return HTMLResult.FAILURE;
  46209. }
  46210. const filter = new Set(["field"]);
  46211. if (this.layout.includes("row")) {
  46212. const columnWidths = this[$getSubformParent]().columnWidths;
  46213. if (Array.isArray(columnWidths) && columnWidths.length > 0) {
  46214. this[$extra].columnWidths = columnWidths;
  46215. this[$extra].currentColumn = 0;
  46216. }
  46217. }
  46218. const style = toStyle(this, "anchorType", "dimensions", "position", "presence", "border", "margin", "hAlign");
  46219. const classNames = ["xfaExclgroup"];
  46220. const cl = layoutClass(this);
  46221. if (cl) {
  46222. classNames.push(cl);
  46223. }
  46224. if (isPrintOnly(this)) {
  46225. classNames.push("xfaPrintOnly");
  46226. }
  46227. attributes.style = style;
  46228. attributes.class = classNames;
  46229. if (this.name) {
  46230. attributes.xfaName = this.name;
  46231. }
  46232. this[$pushPara]();
  46233. const isLrTb = this.layout === "lr-tb" || this.layout === "rl-tb";
  46234. const maxRun = isLrTb ? MAX_ATTEMPTS_FOR_LRTB_LAYOUT : 1;
  46235. for (; this[$extra].attempt < maxRun; this[$extra].attempt++) {
  46236. if (isLrTb && this[$extra].attempt === MAX_ATTEMPTS_FOR_LRTB_LAYOUT - 1) {
  46237. this[$extra].numberInLine = 0;
  46238. }
  46239. const result = this[$childrenToHTML]({
  46240. filter,
  46241. include: true
  46242. });
  46243. if (result.success) {
  46244. break;
  46245. }
  46246. if (result.isBreak()) {
  46247. this[$popPara]();
  46248. return result;
  46249. }
  46250. if (isLrTb && this[$extra].attempt === 0 && this[$extra].numberInLine === 0 && !this[$getTemplateRoot]()[$extra].noLayoutFailure) {
  46251. this[$extra].attempt = maxRun;
  46252. break;
  46253. }
  46254. }
  46255. this[$popPara]();
  46256. if (!isSplittable) {
  46257. unsetFirstUnsplittable(this);
  46258. }
  46259. if (this[$extra].attempt === maxRun) {
  46260. if (!isSplittable) {
  46261. delete this[$extra];
  46262. }
  46263. return HTMLResult.FAILURE;
  46264. }
  46265. let marginH = 0;
  46266. let marginV = 0;
  46267. if (this.margin) {
  46268. marginH = this.margin.leftInset + this.margin.rightInset;
  46269. marginV = this.margin.topInset + this.margin.bottomInset;
  46270. }
  46271. const width = Math.max(this[$extra].width + marginH, this.w || 0);
  46272. const height = Math.max(this[$extra].height + marginV, this.h || 0);
  46273. const bbox = [this.x, this.y, width, height];
  46274. if (this.w === "") {
  46275. style.width = measureToString(width);
  46276. }
  46277. if (this.h === "") {
  46278. style.height = measureToString(height);
  46279. }
  46280. const html = {
  46281. name: "div",
  46282. attributes,
  46283. children
  46284. };
  46285. applyAssist(this, attributes);
  46286. delete this[$extra];
  46287. return HTMLResult.success(createWrapper(this, html), bbox);
  46288. }
  46289. }
  46290. class Execute extends XFAObject {
  46291. constructor(attributes) {
  46292. super(TEMPLATE_NS_ID, "execute");
  46293. this.connection = attributes.connection || "";
  46294. this.executeType = getStringOption(attributes.executeType, ["import", "remerge"]);
  46295. this.id = attributes.id || "";
  46296. this.runAt = getStringOption(attributes.runAt, ["client", "both", "server"]);
  46297. this.use = attributes.use || "";
  46298. this.usehref = attributes.usehref || "";
  46299. }
  46300. }
  46301. class Extras extends XFAObject {
  46302. constructor(attributes) {
  46303. super(TEMPLATE_NS_ID, "extras", true);
  46304. this.id = attributes.id || "";
  46305. this.name = attributes.name || "";
  46306. this.use = attributes.use || "";
  46307. this.usehref = attributes.usehref || "";
  46308. this.boolean = new XFAObjectArray();
  46309. this.date = new XFAObjectArray();
  46310. this.dateTime = new XFAObjectArray();
  46311. this.decimal = new XFAObjectArray();
  46312. this.exData = new XFAObjectArray();
  46313. this.extras = new XFAObjectArray();
  46314. this.float = new XFAObjectArray();
  46315. this.image = new XFAObjectArray();
  46316. this.integer = new XFAObjectArray();
  46317. this.text = new XFAObjectArray();
  46318. this.time = new XFAObjectArray();
  46319. }
  46320. }
  46321. class Field extends XFAObject {
  46322. constructor(attributes) {
  46323. super(TEMPLATE_NS_ID, "field", true);
  46324. this.access = getStringOption(attributes.access, ["open", "nonInteractive", "protected", "readOnly"]);
  46325. this.accessKey = attributes.accessKey || "";
  46326. this.anchorType = getStringOption(attributes.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]);
  46327. this.colSpan = getInteger({
  46328. data: attributes.colSpan,
  46329. defaultValue: 1,
  46330. validate: n => n >= 1 || n === -1
  46331. });
  46332. this.h = attributes.h ? getMeasurement(attributes.h) : "";
  46333. this.hAlign = getStringOption(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]);
  46334. this.id = attributes.id || "";
  46335. this.locale = attributes.locale || "";
  46336. this.maxH = getMeasurement(attributes.maxH, "0pt");
  46337. this.maxW = getMeasurement(attributes.maxW, "0pt");
  46338. this.minH = getMeasurement(attributes.minH, "0pt");
  46339. this.minW = getMeasurement(attributes.minW, "0pt");
  46340. this.name = attributes.name || "";
  46341. this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
  46342. this.relevant = getRelevant(attributes.relevant);
  46343. this.rotate = getInteger({
  46344. data: attributes.rotate,
  46345. defaultValue: 0,
  46346. validate: x => x % 90 === 0
  46347. });
  46348. this.use = attributes.use || "";
  46349. this.usehref = attributes.usehref || "";
  46350. this.w = attributes.w ? getMeasurement(attributes.w) : "";
  46351. this.x = getMeasurement(attributes.x, "0pt");
  46352. this.y = getMeasurement(attributes.y, "0pt");
  46353. this.assist = null;
  46354. this.bind = null;
  46355. this.border = null;
  46356. this.calculate = null;
  46357. this.caption = null;
  46358. this.desc = null;
  46359. this.extras = null;
  46360. this.font = null;
  46361. this.format = null;
  46362. this.items = new XFAObjectArray(2);
  46363. this.keep = null;
  46364. this.margin = null;
  46365. this.para = null;
  46366. this.traversal = null;
  46367. this.ui = null;
  46368. this.validate = null;
  46369. this.value = null;
  46370. this.bindItems = new XFAObjectArray();
  46371. this.connect = new XFAObjectArray();
  46372. this.event = new XFAObjectArray();
  46373. this.setProperty = new XFAObjectArray();
  46374. }
  46375. [$isBindable]() {
  46376. return true;
  46377. }
  46378. [$setValue](value) {
  46379. _setValue(this, value);
  46380. }
  46381. [$toHTML](availableSpace) {
  46382. setTabIndex(this);
  46383. if (!this.ui) {
  46384. this.ui = new Ui({});
  46385. this.ui[$globalData] = this[$globalData];
  46386. this[$appendChild](this.ui);
  46387. let node;
  46388. switch (this.items.children.length) {
  46389. case 0:
  46390. node = new TextEdit({});
  46391. this.ui.textEdit = node;
  46392. break;
  46393. case 1:
  46394. node = new CheckButton({});
  46395. this.ui.checkButton = node;
  46396. break;
  46397. case 2:
  46398. node = new ChoiceList({});
  46399. this.ui.choiceList = node;
  46400. break;
  46401. }
  46402. this.ui[$appendChild](node);
  46403. }
  46404. if (!this.ui || this.presence === "hidden" || this.presence === "inactive" || this.h === 0 || this.w === 0) {
  46405. return HTMLResult.EMPTY;
  46406. }
  46407. if (this.caption) {
  46408. delete this.caption[$extra];
  46409. }
  46410. this[$pushPara]();
  46411. const caption = this.caption ? this.caption[$toHTML](availableSpace).html : null;
  46412. const savedW = this.w;
  46413. const savedH = this.h;
  46414. let marginH = 0;
  46415. let marginV = 0;
  46416. if (this.margin) {
  46417. marginH = this.margin.leftInset + this.margin.rightInset;
  46418. marginV = this.margin.topInset + this.margin.bottomInset;
  46419. }
  46420. let borderDims = null;
  46421. if (this.w === "" || this.h === "") {
  46422. let width = null;
  46423. let height = null;
  46424. let uiW = 0;
  46425. let uiH = 0;
  46426. if (this.ui.checkButton) {
  46427. uiW = uiH = this.ui.checkButton.size;
  46428. } else {
  46429. const {
  46430. w,
  46431. h
  46432. } = layoutNode(this, availableSpace);
  46433. if (w !== null) {
  46434. uiW = w;
  46435. uiH = h;
  46436. } else {
  46437. uiH = fonts_getMetrics(this.font, true).lineNoGap;
  46438. }
  46439. }
  46440. borderDims = getBorderDims(this.ui[$getExtra]());
  46441. uiW += borderDims.w;
  46442. uiH += borderDims.h;
  46443. if (this.caption) {
  46444. const {
  46445. w,
  46446. h,
  46447. isBroken
  46448. } = this.caption[$getExtra](availableSpace);
  46449. if (isBroken && this[$getSubformParent]()[$isThereMoreWidth]()) {
  46450. this[$popPara]();
  46451. return HTMLResult.FAILURE;
  46452. }
  46453. width = w;
  46454. height = h;
  46455. switch (this.caption.placement) {
  46456. case "left":
  46457. case "right":
  46458. case "inline":
  46459. width += uiW;
  46460. break;
  46461. case "top":
  46462. case "bottom":
  46463. height += uiH;
  46464. break;
  46465. }
  46466. } else {
  46467. width = uiW;
  46468. height = uiH;
  46469. }
  46470. if (width && this.w === "") {
  46471. width += marginH;
  46472. this.w = Math.min(this.maxW <= 0 ? Infinity : this.maxW, this.minW + 1 < width ? width : this.minW);
  46473. }
  46474. if (height && this.h === "") {
  46475. height += marginV;
  46476. this.h = Math.min(this.maxH <= 0 ? Infinity : this.maxH, this.minH + 1 < height ? height : this.minH);
  46477. }
  46478. }
  46479. this[$popPara]();
  46480. fixDimensions(this);
  46481. setFirstUnsplittable(this);
  46482. if (!checkDimensions(this, availableSpace)) {
  46483. this.w = savedW;
  46484. this.h = savedH;
  46485. this[$popPara]();
  46486. return HTMLResult.FAILURE;
  46487. }
  46488. unsetFirstUnsplittable(this);
  46489. const style = toStyle(this, "font", "dimensions", "position", "rotate", "anchorType", "presence", "margin", "hAlign");
  46490. setMinMaxDimensions(this, style);
  46491. const classNames = ["xfaField"];
  46492. if (this.font) {
  46493. classNames.push("xfaFont");
  46494. }
  46495. if (isPrintOnly(this)) {
  46496. classNames.push("xfaPrintOnly");
  46497. }
  46498. const attributes = {
  46499. style,
  46500. id: this[$uid],
  46501. class: classNames
  46502. };
  46503. if (style.margin) {
  46504. style.padding = style.margin;
  46505. delete style.margin;
  46506. }
  46507. setAccess(this, classNames);
  46508. if (this.name) {
  46509. attributes.xfaName = this.name;
  46510. }
  46511. const children = [];
  46512. const html = {
  46513. name: "div",
  46514. attributes,
  46515. children
  46516. };
  46517. applyAssist(this, attributes);
  46518. const borderStyle = this.border ? this.border[$toStyle]() : null;
  46519. const bbox = computeBbox(this, html, availableSpace);
  46520. const ui = this.ui[$toHTML]().html;
  46521. if (!ui) {
  46522. Object.assign(style, borderStyle);
  46523. return HTMLResult.success(createWrapper(this, html), bbox);
  46524. }
  46525. if (this[$tabIndex]) {
  46526. if (ui.children?.[0]) {
  46527. ui.children[0].attributes.tabindex = this[$tabIndex];
  46528. } else {
  46529. ui.attributes.tabindex = this[$tabIndex];
  46530. }
  46531. }
  46532. if (!ui.attributes.style) {
  46533. ui.attributes.style = Object.create(null);
  46534. }
  46535. let aElement = null;
  46536. if (this.ui.button) {
  46537. if (ui.children.length === 1) {
  46538. [aElement] = ui.children.splice(0, 1);
  46539. }
  46540. Object.assign(ui.attributes.style, borderStyle);
  46541. } else {
  46542. Object.assign(style, borderStyle);
  46543. }
  46544. children.push(ui);
  46545. if (this.value) {
  46546. if (this.ui.imageEdit) {
  46547. ui.children.push(this.value[$toHTML]().html);
  46548. } else if (!this.ui.button) {
  46549. let value = "";
  46550. if (this.value.exData) {
  46551. value = this.value.exData[$text]();
  46552. } else if (this.value.text) {
  46553. value = this.value.text[$getExtra]();
  46554. } else {
  46555. const htmlValue = this.value[$toHTML]().html;
  46556. if (htmlValue !== null) {
  46557. value = htmlValue.children[0].value;
  46558. }
  46559. }
  46560. if (this.ui.textEdit && this.value.text?.maxChars) {
  46561. ui.children[0].attributes.maxLength = this.value.text.maxChars;
  46562. }
  46563. if (value) {
  46564. if (this.ui.numericEdit) {
  46565. value = parseFloat(value);
  46566. value = isNaN(value) ? "" : value.toString();
  46567. }
  46568. if (ui.children[0].name === "textarea") {
  46569. ui.children[0].attributes.textContent = value;
  46570. } else {
  46571. ui.children[0].attributes.value = value;
  46572. }
  46573. }
  46574. }
  46575. }
  46576. if (!this.ui.imageEdit && ui.children?.[0] && this.h) {
  46577. borderDims = borderDims || getBorderDims(this.ui[$getExtra]());
  46578. let captionHeight = 0;
  46579. if (this.caption && ["top", "bottom"].includes(this.caption.placement)) {
  46580. captionHeight = this.caption.reserve;
  46581. if (captionHeight <= 0) {
  46582. captionHeight = this.caption[$getExtra](availableSpace).h;
  46583. }
  46584. const inputHeight = this.h - captionHeight - marginV - borderDims.h;
  46585. ui.children[0].attributes.style.height = measureToString(inputHeight);
  46586. } else {
  46587. ui.children[0].attributes.style.height = "100%";
  46588. }
  46589. }
  46590. if (aElement) {
  46591. ui.children.push(aElement);
  46592. }
  46593. if (!caption) {
  46594. if (ui.attributes.class) {
  46595. ui.attributes.class.push("xfaLeft");
  46596. }
  46597. this.w = savedW;
  46598. this.h = savedH;
  46599. return HTMLResult.success(createWrapper(this, html), bbox);
  46600. }
  46601. if (this.ui.button) {
  46602. if (style.padding) {
  46603. delete style.padding;
  46604. }
  46605. if (caption.name === "div") {
  46606. caption.name = "span";
  46607. }
  46608. ui.children.push(caption);
  46609. return HTMLResult.success(html, bbox);
  46610. } else if (this.ui.checkButton) {
  46611. caption.attributes.class[0] = "xfaCaptionForCheckButton";
  46612. }
  46613. if (!ui.attributes.class) {
  46614. ui.attributes.class = [];
  46615. }
  46616. ui.children.splice(0, 0, caption);
  46617. switch (this.caption.placement) {
  46618. case "left":
  46619. ui.attributes.class.push("xfaLeft");
  46620. break;
  46621. case "right":
  46622. ui.attributes.class.push("xfaRight");
  46623. break;
  46624. case "top":
  46625. ui.attributes.class.push("xfaTop");
  46626. break;
  46627. case "bottom":
  46628. ui.attributes.class.push("xfaBottom");
  46629. break;
  46630. case "inline":
  46631. ui.attributes.class.push("xfaLeft");
  46632. break;
  46633. }
  46634. this.w = savedW;
  46635. this.h = savedH;
  46636. return HTMLResult.success(createWrapper(this, html), bbox);
  46637. }
  46638. }
  46639. class Fill extends XFAObject {
  46640. constructor(attributes) {
  46641. super(TEMPLATE_NS_ID, "fill", true);
  46642. this.id = attributes.id || "";
  46643. this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
  46644. this.use = attributes.use || "";
  46645. this.usehref = attributes.usehref || "";
  46646. this.color = null;
  46647. this.extras = null;
  46648. this.linear = null;
  46649. this.pattern = null;
  46650. this.radial = null;
  46651. this.solid = null;
  46652. this.stipple = null;
  46653. }
  46654. [$toStyle]() {
  46655. const parent = this[$getParent]();
  46656. const grandpa = parent[$getParent]();
  46657. const ggrandpa = grandpa[$getParent]();
  46658. const style = Object.create(null);
  46659. let propName = "color";
  46660. let altPropName = propName;
  46661. if (parent instanceof Border) {
  46662. propName = "background-color";
  46663. altPropName = "background";
  46664. if (ggrandpa instanceof Ui) {
  46665. style.backgroundColor = "white";
  46666. }
  46667. }
  46668. if (parent instanceof Rectangle || parent instanceof Arc) {
  46669. propName = altPropName = "fill";
  46670. style.fill = "white";
  46671. }
  46672. for (const name of Object.getOwnPropertyNames(this)) {
  46673. if (name === "extras" || name === "color") {
  46674. continue;
  46675. }
  46676. const obj = this[name];
  46677. if (!(obj instanceof XFAObject)) {
  46678. continue;
  46679. }
  46680. const color = obj[$toStyle](this.color);
  46681. if (color) {
  46682. style[color.startsWith("#") ? propName : altPropName] = color;
  46683. }
  46684. return style;
  46685. }
  46686. if (this.color?.value) {
  46687. const color = this.color[$toStyle]();
  46688. style[color.startsWith("#") ? propName : altPropName] = color;
  46689. }
  46690. return style;
  46691. }
  46692. }
  46693. class Filter extends XFAObject {
  46694. constructor(attributes) {
  46695. super(TEMPLATE_NS_ID, "filter", true);
  46696. this.addRevocationInfo = getStringOption(attributes.addRevocationInfo, ["", "required", "optional", "none"]);
  46697. this.id = attributes.id || "";
  46698. this.name = attributes.name || "";
  46699. this.use = attributes.use || "";
  46700. this.usehref = attributes.usehref || "";
  46701. this.version = getInteger({
  46702. data: this.version,
  46703. defaultValue: 5,
  46704. validate: x => x >= 1 && x <= 5
  46705. });
  46706. this.appearanceFilter = null;
  46707. this.certificates = null;
  46708. this.digestMethods = null;
  46709. this.encodings = null;
  46710. this.encryptionMethods = null;
  46711. this.handler = null;
  46712. this.lockDocument = null;
  46713. this.mdp = null;
  46714. this.reasons = null;
  46715. this.timeStamp = null;
  46716. }
  46717. }
  46718. class Float extends ContentObject {
  46719. constructor(attributes) {
  46720. super(TEMPLATE_NS_ID, "float");
  46721. this.id = attributes.id || "";
  46722. this.name = attributes.name || "";
  46723. this.use = attributes.use || "";
  46724. this.usehref = attributes.usehref || "";
  46725. }
  46726. [$finalize]() {
  46727. const number = parseFloat(this[$content].trim());
  46728. this[$content] = isNaN(number) ? null : number;
  46729. }
  46730. [$toHTML](availableSpace) {
  46731. return valueToHtml(this[$content] !== null ? this[$content].toString() : "");
  46732. }
  46733. }
  46734. class template_Font extends XFAObject {
  46735. constructor(attributes) {
  46736. super(TEMPLATE_NS_ID, "font", true);
  46737. this.baselineShift = getMeasurement(attributes.baselineShift);
  46738. this.fontHorizontalScale = getFloat({
  46739. data: attributes.fontHorizontalScale,
  46740. defaultValue: 100,
  46741. validate: x => x >= 0
  46742. });
  46743. this.fontVerticalScale = getFloat({
  46744. data: attributes.fontVerticalScale,
  46745. defaultValue: 100,
  46746. validate: x => x >= 0
  46747. });
  46748. this.id = attributes.id || "";
  46749. this.kerningMode = getStringOption(attributes.kerningMode, ["none", "pair"]);
  46750. this.letterSpacing = getMeasurement(attributes.letterSpacing, "0");
  46751. this.lineThrough = getInteger({
  46752. data: attributes.lineThrough,
  46753. defaultValue: 0,
  46754. validate: x => x === 1 || x === 2
  46755. });
  46756. this.lineThroughPeriod = getStringOption(attributes.lineThroughPeriod, ["all", "word"]);
  46757. this.overline = getInteger({
  46758. data: attributes.overline,
  46759. defaultValue: 0,
  46760. validate: x => x === 1 || x === 2
  46761. });
  46762. this.overlinePeriod = getStringOption(attributes.overlinePeriod, ["all", "word"]);
  46763. this.posture = getStringOption(attributes.posture, ["normal", "italic"]);
  46764. this.size = getMeasurement(attributes.size, "10pt");
  46765. this.typeface = attributes.typeface || "Courier";
  46766. this.underline = getInteger({
  46767. data: attributes.underline,
  46768. defaultValue: 0,
  46769. validate: x => x === 1 || x === 2
  46770. });
  46771. this.underlinePeriod = getStringOption(attributes.underlinePeriod, ["all", "word"]);
  46772. this.use = attributes.use || "";
  46773. this.usehref = attributes.usehref || "";
  46774. this.weight = getStringOption(attributes.weight, ["normal", "bold"]);
  46775. this.extras = null;
  46776. this.fill = null;
  46777. }
  46778. [$clean](builder) {
  46779. super[$clean](builder);
  46780. this[$globalData].usedTypefaces.add(this.typeface);
  46781. }
  46782. [$toStyle]() {
  46783. const style = toStyle(this, "fill");
  46784. const color = style.color;
  46785. if (color) {
  46786. if (color === "#000000") {
  46787. delete style.color;
  46788. } else if (!color.startsWith("#")) {
  46789. style.background = color;
  46790. style.backgroundClip = "text";
  46791. style.color = "transparent";
  46792. }
  46793. }
  46794. if (this.baselineShift) {
  46795. style.verticalAlign = measureToString(this.baselineShift);
  46796. }
  46797. style.fontKerning = this.kerningMode === "none" ? "none" : "normal";
  46798. style.letterSpacing = measureToString(this.letterSpacing);
  46799. if (this.lineThrough !== 0) {
  46800. style.textDecoration = "line-through";
  46801. if (this.lineThrough === 2) {
  46802. style.textDecorationStyle = "double";
  46803. }
  46804. }
  46805. if (this.overline !== 0) {
  46806. style.textDecoration = "overline";
  46807. if (this.overline === 2) {
  46808. style.textDecorationStyle = "double";
  46809. }
  46810. }
  46811. style.fontStyle = this.posture;
  46812. style.fontSize = measureToString(0.99 * this.size);
  46813. setFontFamily(this, this, this[$globalData].fontFinder, style);
  46814. if (this.underline !== 0) {
  46815. style.textDecoration = "underline";
  46816. if (this.underline === 2) {
  46817. style.textDecorationStyle = "double";
  46818. }
  46819. }
  46820. style.fontWeight = this.weight;
  46821. return style;
  46822. }
  46823. }
  46824. class Format extends XFAObject {
  46825. constructor(attributes) {
  46826. super(TEMPLATE_NS_ID, "format", true);
  46827. this.id = attributes.id || "";
  46828. this.use = attributes.use || "";
  46829. this.usehref = attributes.usehref || "";
  46830. this.extras = null;
  46831. this.picture = null;
  46832. }
  46833. }
  46834. class Handler extends StringObject {
  46835. constructor(attributes) {
  46836. super(TEMPLATE_NS_ID, "handler");
  46837. this.id = attributes.id || "";
  46838. this.type = getStringOption(attributes.type, ["optional", "required"]);
  46839. this.use = attributes.use || "";
  46840. this.usehref = attributes.usehref || "";
  46841. }
  46842. }
  46843. class Hyphenation extends XFAObject {
  46844. constructor(attributes) {
  46845. super(TEMPLATE_NS_ID, "hyphenation");
  46846. this.excludeAllCaps = getInteger({
  46847. data: attributes.excludeAllCaps,
  46848. defaultValue: 0,
  46849. validate: x => x === 1
  46850. });
  46851. this.excludeInitialCap = getInteger({
  46852. data: attributes.excludeInitialCap,
  46853. defaultValue: 0,
  46854. validate: x => x === 1
  46855. });
  46856. this.hyphenate = getInteger({
  46857. data: attributes.hyphenate,
  46858. defaultValue: 0,
  46859. validate: x => x === 1
  46860. });
  46861. this.id = attributes.id || "";
  46862. this.pushCharacterCount = getInteger({
  46863. data: attributes.pushCharacterCount,
  46864. defaultValue: 3,
  46865. validate: x => x >= 0
  46866. });
  46867. this.remainCharacterCount = getInteger({
  46868. data: attributes.remainCharacterCount,
  46869. defaultValue: 3,
  46870. validate: x => x >= 0
  46871. });
  46872. this.use = attributes.use || "";
  46873. this.usehref = attributes.usehref || "";
  46874. this.wordCharacterCount = getInteger({
  46875. data: attributes.wordCharacterCount,
  46876. defaultValue: 7,
  46877. validate: x => x >= 0
  46878. });
  46879. }
  46880. }
  46881. class Image extends StringObject {
  46882. constructor(attributes) {
  46883. super(TEMPLATE_NS_ID, "image");
  46884. this.aspect = getStringOption(attributes.aspect, ["fit", "actual", "height", "none", "width"]);
  46885. this.contentType = attributes.contentType || "";
  46886. this.href = attributes.href || "";
  46887. this.id = attributes.id || "";
  46888. this.name = attributes.name || "";
  46889. this.transferEncoding = getStringOption(attributes.transferEncoding, ["base64", "none", "package"]);
  46890. this.use = attributes.use || "";
  46891. this.usehref = attributes.usehref || "";
  46892. }
  46893. [$toHTML]() {
  46894. if (this.contentType && !MIMES.has(this.contentType.toLowerCase())) {
  46895. return HTMLResult.EMPTY;
  46896. }
  46897. let buffer = this[$globalData].images && this[$globalData].images.get(this.href);
  46898. if (!buffer && (this.href || !this[$content])) {
  46899. return HTMLResult.EMPTY;
  46900. }
  46901. if (!buffer && this.transferEncoding === "base64") {
  46902. buffer = stringToBytes(atob(this[$content]));
  46903. }
  46904. if (!buffer) {
  46905. return HTMLResult.EMPTY;
  46906. }
  46907. if (!this.contentType) {
  46908. for (const [header, type] of IMAGES_HEADERS) {
  46909. if (buffer.length > header.length && header.every((x, i) => x === buffer[i])) {
  46910. this.contentType = type;
  46911. break;
  46912. }
  46913. }
  46914. if (!this.contentType) {
  46915. return HTMLResult.EMPTY;
  46916. }
  46917. }
  46918. const blob = new Blob([buffer], {
  46919. type: this.contentType
  46920. });
  46921. let style;
  46922. switch (this.aspect) {
  46923. case "fit":
  46924. case "actual":
  46925. break;
  46926. case "height":
  46927. style = {
  46928. height: "100%",
  46929. objectFit: "fill"
  46930. };
  46931. break;
  46932. case "none":
  46933. style = {
  46934. width: "100%",
  46935. height: "100%",
  46936. objectFit: "fill"
  46937. };
  46938. break;
  46939. case "width":
  46940. style = {
  46941. width: "100%",
  46942. objectFit: "fill"
  46943. };
  46944. break;
  46945. }
  46946. const parent = this[$getParent]();
  46947. return HTMLResult.success({
  46948. name: "img",
  46949. attributes: {
  46950. class: ["xfaImage"],
  46951. style,
  46952. src: URL.createObjectURL(blob),
  46953. alt: parent ? ariaLabel(parent[$getParent]()) : null
  46954. }
  46955. });
  46956. }
  46957. }
  46958. class ImageEdit extends XFAObject {
  46959. constructor(attributes) {
  46960. super(TEMPLATE_NS_ID, "imageEdit", true);
  46961. this.data = getStringOption(attributes.data, ["link", "embed"]);
  46962. this.id = attributes.id || "";
  46963. this.use = attributes.use || "";
  46964. this.usehref = attributes.usehref || "";
  46965. this.border = null;
  46966. this.extras = null;
  46967. this.margin = null;
  46968. }
  46969. [$toHTML](availableSpace) {
  46970. if (this.data === "embed") {
  46971. return HTMLResult.success({
  46972. name: "div",
  46973. children: [],
  46974. attributes: {}
  46975. });
  46976. }
  46977. return HTMLResult.EMPTY;
  46978. }
  46979. }
  46980. class Integer extends ContentObject {
  46981. constructor(attributes) {
  46982. super(TEMPLATE_NS_ID, "integer");
  46983. this.id = attributes.id || "";
  46984. this.name = attributes.name || "";
  46985. this.use = attributes.use || "";
  46986. this.usehref = attributes.usehref || "";
  46987. }
  46988. [$finalize]() {
  46989. const number = parseInt(this[$content].trim(), 10);
  46990. this[$content] = isNaN(number) ? null : number;
  46991. }
  46992. [$toHTML](availableSpace) {
  46993. return valueToHtml(this[$content] !== null ? this[$content].toString() : "");
  46994. }
  46995. }
  46996. class Issuers extends XFAObject {
  46997. constructor(attributes) {
  46998. super(TEMPLATE_NS_ID, "issuers", true);
  46999. this.id = attributes.id || "";
  47000. this.type = getStringOption(attributes.type, ["optional", "required"]);
  47001. this.use = attributes.use || "";
  47002. this.usehref = attributes.usehref || "";
  47003. this.certificate = new XFAObjectArray();
  47004. }
  47005. }
  47006. class Items extends XFAObject {
  47007. constructor(attributes) {
  47008. super(TEMPLATE_NS_ID, "items", true);
  47009. this.id = attributes.id || "";
  47010. this.name = attributes.name || "";
  47011. this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
  47012. this.ref = attributes.ref || "";
  47013. this.save = getInteger({
  47014. data: attributes.save,
  47015. defaultValue: 0,
  47016. validate: x => x === 1
  47017. });
  47018. this.use = attributes.use || "";
  47019. this.usehref = attributes.usehref || "";
  47020. this.boolean = new XFAObjectArray();
  47021. this.date = new XFAObjectArray();
  47022. this.dateTime = new XFAObjectArray();
  47023. this.decimal = new XFAObjectArray();
  47024. this.exData = new XFAObjectArray();
  47025. this.float = new XFAObjectArray();
  47026. this.image = new XFAObjectArray();
  47027. this.integer = new XFAObjectArray();
  47028. this.text = new XFAObjectArray();
  47029. this.time = new XFAObjectArray();
  47030. }
  47031. [$toHTML]() {
  47032. const output = [];
  47033. for (const child of this[$getChildren]()) {
  47034. output.push(child[$text]());
  47035. }
  47036. return HTMLResult.success(output);
  47037. }
  47038. }
  47039. class Keep extends XFAObject {
  47040. constructor(attributes) {
  47041. super(TEMPLATE_NS_ID, "keep", true);
  47042. this.id = attributes.id || "";
  47043. const options = ["none", "contentArea", "pageArea"];
  47044. this.intact = getStringOption(attributes.intact, options);
  47045. this.next = getStringOption(attributes.next, options);
  47046. this.previous = getStringOption(attributes.previous, options);
  47047. this.use = attributes.use || "";
  47048. this.usehref = attributes.usehref || "";
  47049. this.extras = null;
  47050. }
  47051. }
  47052. class KeyUsage extends XFAObject {
  47053. constructor(attributes) {
  47054. super(TEMPLATE_NS_ID, "keyUsage");
  47055. const options = ["", "yes", "no"];
  47056. this.crlSign = getStringOption(attributes.crlSign, options);
  47057. this.dataEncipherment = getStringOption(attributes.dataEncipherment, options);
  47058. this.decipherOnly = getStringOption(attributes.decipherOnly, options);
  47059. this.digitalSignature = getStringOption(attributes.digitalSignature, options);
  47060. this.encipherOnly = getStringOption(attributes.encipherOnly, options);
  47061. this.id = attributes.id || "";
  47062. this.keyAgreement = getStringOption(attributes.keyAgreement, options);
  47063. this.keyCertSign = getStringOption(attributes.keyCertSign, options);
  47064. this.keyEncipherment = getStringOption(attributes.keyEncipherment, options);
  47065. this.nonRepudiation = getStringOption(attributes.nonRepudiation, options);
  47066. this.type = getStringOption(attributes.type, ["optional", "required"]);
  47067. this.use = attributes.use || "";
  47068. this.usehref = attributes.usehref || "";
  47069. }
  47070. }
  47071. class Line extends XFAObject {
  47072. constructor(attributes) {
  47073. super(TEMPLATE_NS_ID, "line", true);
  47074. this.hand = getStringOption(attributes.hand, ["even", "left", "right"]);
  47075. this.id = attributes.id || "";
  47076. this.slope = getStringOption(attributes.slope, ["\\", "/"]);
  47077. this.use = attributes.use || "";
  47078. this.usehref = attributes.usehref || "";
  47079. this.edge = null;
  47080. }
  47081. [$toHTML]() {
  47082. const parent = this[$getParent]()[$getParent]();
  47083. const edge = this.edge || new Edge({});
  47084. const edgeStyle = edge[$toStyle]();
  47085. const style = Object.create(null);
  47086. const thickness = edge.presence === "visible" ? edge.thickness : 0;
  47087. style.strokeWidth = measureToString(thickness);
  47088. style.stroke = edgeStyle.color;
  47089. let x1, y1, x2, y2;
  47090. let width = "100%";
  47091. let height = "100%";
  47092. if (parent.w <= thickness) {
  47093. [x1, y1, x2, y2] = ["50%", 0, "50%", "100%"];
  47094. width = style.strokeWidth;
  47095. } else if (parent.h <= thickness) {
  47096. [x1, y1, x2, y2] = [0, "50%", "100%", "50%"];
  47097. height = style.strokeWidth;
  47098. } else if (this.slope === "\\") {
  47099. [x1, y1, x2, y2] = [0, 0, "100%", "100%"];
  47100. } else {
  47101. [x1, y1, x2, y2] = [0, "100%", "100%", 0];
  47102. }
  47103. const line = {
  47104. name: "line",
  47105. attributes: {
  47106. xmlns: SVG_NS,
  47107. x1,
  47108. y1,
  47109. x2,
  47110. y2,
  47111. style
  47112. }
  47113. };
  47114. const svg = {
  47115. name: "svg",
  47116. children: [line],
  47117. attributes: {
  47118. xmlns: SVG_NS,
  47119. width,
  47120. height,
  47121. style: {
  47122. overflow: "visible"
  47123. }
  47124. }
  47125. };
  47126. if (hasMargin(parent)) {
  47127. return HTMLResult.success({
  47128. name: "div",
  47129. attributes: {
  47130. style: {
  47131. display: "inline",
  47132. width: "100%",
  47133. height: "100%"
  47134. }
  47135. },
  47136. children: [svg]
  47137. });
  47138. }
  47139. svg.attributes.style.position = "absolute";
  47140. return HTMLResult.success(svg);
  47141. }
  47142. }
  47143. class Linear extends XFAObject {
  47144. constructor(attributes) {
  47145. super(TEMPLATE_NS_ID, "linear", true);
  47146. this.id = attributes.id || "";
  47147. this.type = getStringOption(attributes.type, ["toRight", "toBottom", "toLeft", "toTop"]);
  47148. this.use = attributes.use || "";
  47149. this.usehref = attributes.usehref || "";
  47150. this.color = null;
  47151. this.extras = null;
  47152. }
  47153. [$toStyle](startColor) {
  47154. startColor = startColor ? startColor[$toStyle]() : "#FFFFFF";
  47155. const transf = this.type.replace(/([RBLT])/, " $1").toLowerCase();
  47156. const endColor = this.color ? this.color[$toStyle]() : "#000000";
  47157. return `linear-gradient(${transf}, ${startColor}, ${endColor})`;
  47158. }
  47159. }
  47160. class LockDocument extends ContentObject {
  47161. constructor(attributes) {
  47162. super(TEMPLATE_NS_ID, "lockDocument");
  47163. this.id = attributes.id || "";
  47164. this.type = getStringOption(attributes.type, ["optional", "required"]);
  47165. this.use = attributes.use || "";
  47166. this.usehref = attributes.usehref || "";
  47167. }
  47168. [$finalize]() {
  47169. this[$content] = getStringOption(this[$content], ["auto", "0", "1"]);
  47170. }
  47171. }
  47172. class Manifest extends XFAObject {
  47173. constructor(attributes) {
  47174. super(TEMPLATE_NS_ID, "manifest", true);
  47175. this.action = getStringOption(attributes.action, ["include", "all", "exclude"]);
  47176. this.id = attributes.id || "";
  47177. this.name = attributes.name || "";
  47178. this.use = attributes.use || "";
  47179. this.usehref = attributes.usehref || "";
  47180. this.extras = null;
  47181. this.ref = new XFAObjectArray();
  47182. }
  47183. }
  47184. class Margin extends XFAObject {
  47185. constructor(attributes) {
  47186. super(TEMPLATE_NS_ID, "margin", true);
  47187. this.bottomInset = getMeasurement(attributes.bottomInset, "0");
  47188. this.id = attributes.id || "";
  47189. this.leftInset = getMeasurement(attributes.leftInset, "0");
  47190. this.rightInset = getMeasurement(attributes.rightInset, "0");
  47191. this.topInset = getMeasurement(attributes.topInset, "0");
  47192. this.use = attributes.use || "";
  47193. this.usehref = attributes.usehref || "";
  47194. this.extras = null;
  47195. }
  47196. [$toStyle]() {
  47197. return {
  47198. margin: measureToString(this.topInset) + " " + measureToString(this.rightInset) + " " + measureToString(this.bottomInset) + " " + measureToString(this.leftInset)
  47199. };
  47200. }
  47201. }
  47202. class Mdp extends XFAObject {
  47203. constructor(attributes) {
  47204. super(TEMPLATE_NS_ID, "mdp");
  47205. this.id = attributes.id || "";
  47206. this.permissions = getInteger({
  47207. data: attributes.permissions,
  47208. defaultValue: 2,
  47209. validate: x => x === 1 || x === 3
  47210. });
  47211. this.signatureType = getStringOption(attributes.signatureType, ["filler", "author"]);
  47212. this.use = attributes.use || "";
  47213. this.usehref = attributes.usehref || "";
  47214. }
  47215. }
  47216. class Medium extends XFAObject {
  47217. constructor(attributes) {
  47218. super(TEMPLATE_NS_ID, "medium");
  47219. this.id = attributes.id || "";
  47220. this.imagingBBox = getBBox(attributes.imagingBBox);
  47221. this.long = getMeasurement(attributes.long);
  47222. this.orientation = getStringOption(attributes.orientation, ["portrait", "landscape"]);
  47223. this.short = getMeasurement(attributes.short);
  47224. this.stock = attributes.stock || "";
  47225. this.trayIn = getStringOption(attributes.trayIn, ["auto", "delegate", "pageFront"]);
  47226. this.trayOut = getStringOption(attributes.trayOut, ["auto", "delegate"]);
  47227. this.use = attributes.use || "";
  47228. this.usehref = attributes.usehref || "";
  47229. }
  47230. }
  47231. class Message extends XFAObject {
  47232. constructor(attributes) {
  47233. super(TEMPLATE_NS_ID, "message", true);
  47234. this.id = attributes.id || "";
  47235. this.use = attributes.use || "";
  47236. this.usehref = attributes.usehref || "";
  47237. this.text = new XFAObjectArray();
  47238. }
  47239. }
  47240. class NumericEdit extends XFAObject {
  47241. constructor(attributes) {
  47242. super(TEMPLATE_NS_ID, "numericEdit", true);
  47243. this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, ["auto", "off", "on"]);
  47244. this.id = attributes.id || "";
  47245. this.use = attributes.use || "";
  47246. this.usehref = attributes.usehref || "";
  47247. this.border = null;
  47248. this.comb = null;
  47249. this.extras = null;
  47250. this.margin = null;
  47251. }
  47252. [$toHTML](availableSpace) {
  47253. const style = toStyle(this, "border", "font", "margin");
  47254. const field = this[$getParent]()[$getParent]();
  47255. const html = {
  47256. name: "input",
  47257. attributes: {
  47258. type: "text",
  47259. fieldId: field[$uid],
  47260. dataId: field[$data]?.[$uid] || field[$uid],
  47261. class: ["xfaTextfield"],
  47262. style,
  47263. "aria-label": ariaLabel(field),
  47264. "aria-required": false
  47265. }
  47266. };
  47267. if (isRequired(field)) {
  47268. html.attributes["aria-required"] = true;
  47269. html.attributes.required = true;
  47270. }
  47271. return HTMLResult.success({
  47272. name: "label",
  47273. attributes: {
  47274. class: ["xfaLabel"]
  47275. },
  47276. children: [html]
  47277. });
  47278. }
  47279. }
  47280. class Occur extends XFAObject {
  47281. constructor(attributes) {
  47282. super(TEMPLATE_NS_ID, "occur", true);
  47283. this.id = attributes.id || "";
  47284. this.initial = attributes.initial !== "" ? getInteger({
  47285. data: attributes.initial,
  47286. defaultValue: "",
  47287. validate: x => true
  47288. }) : "";
  47289. this.max = attributes.max !== "" ? getInteger({
  47290. data: attributes.max,
  47291. defaultValue: 1,
  47292. validate: x => true
  47293. }) : "";
  47294. this.min = attributes.min !== "" ? getInteger({
  47295. data: attributes.min,
  47296. defaultValue: 1,
  47297. validate: x => true
  47298. }) : "";
  47299. this.use = attributes.use || "";
  47300. this.usehref = attributes.usehref || "";
  47301. this.extras = null;
  47302. }
  47303. [$clean]() {
  47304. const parent = this[$getParent]();
  47305. const originalMin = this.min;
  47306. if (this.min === "") {
  47307. this.min = parent instanceof PageArea || parent instanceof PageSet ? 0 : 1;
  47308. }
  47309. if (this.max === "") {
  47310. if (originalMin === "") {
  47311. this.max = parent instanceof PageArea || parent instanceof PageSet ? -1 : 1;
  47312. } else {
  47313. this.max = this.min;
  47314. }
  47315. }
  47316. if (this.max !== -1 && this.max < this.min) {
  47317. this.max = this.min;
  47318. }
  47319. if (this.initial === "") {
  47320. this.initial = parent instanceof Template ? 1 : this.min;
  47321. }
  47322. }
  47323. }
  47324. class Oid extends StringObject {
  47325. constructor(attributes) {
  47326. super(TEMPLATE_NS_ID, "oid");
  47327. this.id = attributes.id || "";
  47328. this.name = attributes.name || "";
  47329. this.use = attributes.use || "";
  47330. this.usehref = attributes.usehref || "";
  47331. }
  47332. }
  47333. class Oids extends XFAObject {
  47334. constructor(attributes) {
  47335. super(TEMPLATE_NS_ID, "oids", true);
  47336. this.id = attributes.id || "";
  47337. this.type = getStringOption(attributes.type, ["optional", "required"]);
  47338. this.use = attributes.use || "";
  47339. this.usehref = attributes.usehref || "";
  47340. this.oid = new XFAObjectArray();
  47341. }
  47342. }
  47343. class Overflow extends XFAObject {
  47344. constructor(attributes) {
  47345. super(TEMPLATE_NS_ID, "overflow");
  47346. this.id = attributes.id || "";
  47347. this.leader = attributes.leader || "";
  47348. this.target = attributes.target || "";
  47349. this.trailer = attributes.trailer || "";
  47350. this.use = attributes.use || "";
  47351. this.usehref = attributes.usehref || "";
  47352. }
  47353. [$getExtra]() {
  47354. if (!this[$extra]) {
  47355. const parent = this[$getParent]();
  47356. const root = this[$getTemplateRoot]();
  47357. const target = root[$searchNode](this.target, parent);
  47358. const leader = root[$searchNode](this.leader, parent);
  47359. const trailer = root[$searchNode](this.trailer, parent);
  47360. this[$extra] = {
  47361. target: target?.[0] || null,
  47362. leader: leader?.[0] || null,
  47363. trailer: trailer?.[0] || null,
  47364. addLeader: false,
  47365. addTrailer: false
  47366. };
  47367. }
  47368. return this[$extra];
  47369. }
  47370. }
  47371. class PageArea extends XFAObject {
  47372. constructor(attributes) {
  47373. super(TEMPLATE_NS_ID, "pageArea", true);
  47374. this.blankOrNotBlank = getStringOption(attributes.blankOrNotBlank, ["any", "blank", "notBlank"]);
  47375. this.id = attributes.id || "";
  47376. this.initialNumber = getInteger({
  47377. data: attributes.initialNumber,
  47378. defaultValue: 1,
  47379. validate: x => true
  47380. });
  47381. this.name = attributes.name || "";
  47382. this.numbered = getInteger({
  47383. data: attributes.numbered,
  47384. defaultValue: 1,
  47385. validate: x => true
  47386. });
  47387. this.oddOrEven = getStringOption(attributes.oddOrEven, ["any", "even", "odd"]);
  47388. this.pagePosition = getStringOption(attributes.pagePosition, ["any", "first", "last", "only", "rest"]);
  47389. this.relevant = getRelevant(attributes.relevant);
  47390. this.use = attributes.use || "";
  47391. this.usehref = attributes.usehref || "";
  47392. this.desc = null;
  47393. this.extras = null;
  47394. this.medium = null;
  47395. this.occur = null;
  47396. this.area = new XFAObjectArray();
  47397. this.contentArea = new XFAObjectArray();
  47398. this.draw = new XFAObjectArray();
  47399. this.exclGroup = new XFAObjectArray();
  47400. this.field = new XFAObjectArray();
  47401. this.subform = new XFAObjectArray();
  47402. }
  47403. [$isUsable]() {
  47404. if (!this[$extra]) {
  47405. this[$extra] = {
  47406. numberOfUse: 0
  47407. };
  47408. return true;
  47409. }
  47410. return !this.occur || this.occur.max === -1 || this[$extra].numberOfUse < this.occur.max;
  47411. }
  47412. [$cleanPage]() {
  47413. delete this[$extra];
  47414. }
  47415. [$getNextPage]() {
  47416. if (!this[$extra]) {
  47417. this[$extra] = {
  47418. numberOfUse: 0
  47419. };
  47420. }
  47421. const parent = this[$getParent]();
  47422. if (parent.relation === "orderedOccurrence") {
  47423. if (this[$isUsable]()) {
  47424. this[$extra].numberOfUse += 1;
  47425. return this;
  47426. }
  47427. }
  47428. return parent[$getNextPage]();
  47429. }
  47430. [$getAvailableSpace]() {
  47431. return this[$extra].space || {
  47432. width: 0,
  47433. height: 0
  47434. };
  47435. }
  47436. [$toHTML]() {
  47437. if (!this[$extra]) {
  47438. this[$extra] = {
  47439. numberOfUse: 1
  47440. };
  47441. }
  47442. const children = [];
  47443. this[$extra].children = children;
  47444. const style = Object.create(null);
  47445. if (this.medium && this.medium.short && this.medium.long) {
  47446. style.width = measureToString(this.medium.short);
  47447. style.height = measureToString(this.medium.long);
  47448. this[$extra].space = {
  47449. width: this.medium.short,
  47450. height: this.medium.long
  47451. };
  47452. if (this.medium.orientation === "landscape") {
  47453. const x = style.width;
  47454. style.width = style.height;
  47455. style.height = x;
  47456. this[$extra].space = {
  47457. width: this.medium.long,
  47458. height: this.medium.short
  47459. };
  47460. }
  47461. } else {
  47462. warn("XFA - No medium specified in pageArea: please file a bug.");
  47463. }
  47464. this[$childrenToHTML]({
  47465. filter: new Set(["area", "draw", "field", "subform"]),
  47466. include: true
  47467. });
  47468. this[$childrenToHTML]({
  47469. filter: new Set(["contentArea"]),
  47470. include: true
  47471. });
  47472. return HTMLResult.success({
  47473. name: "div",
  47474. children,
  47475. attributes: {
  47476. class: ["xfaPage"],
  47477. id: this[$uid],
  47478. style,
  47479. xfaName: this.name
  47480. }
  47481. });
  47482. }
  47483. }
  47484. class PageSet extends XFAObject {
  47485. constructor(attributes) {
  47486. super(TEMPLATE_NS_ID, "pageSet", true);
  47487. this.duplexImposition = getStringOption(attributes.duplexImposition, ["longEdge", "shortEdge"]);
  47488. this.id = attributes.id || "";
  47489. this.name = attributes.name || "";
  47490. this.relation = getStringOption(attributes.relation, ["orderedOccurrence", "duplexPaginated", "simplexPaginated"]);
  47491. this.relevant = getRelevant(attributes.relevant);
  47492. this.use = attributes.use || "";
  47493. this.usehref = attributes.usehref || "";
  47494. this.extras = null;
  47495. this.occur = null;
  47496. this.pageArea = new XFAObjectArray();
  47497. this.pageSet = new XFAObjectArray();
  47498. }
  47499. [$cleanPage]() {
  47500. for (const page of this.pageArea.children) {
  47501. page[$cleanPage]();
  47502. }
  47503. for (const page of this.pageSet.children) {
  47504. page[$cleanPage]();
  47505. }
  47506. }
  47507. [$isUsable]() {
  47508. return !this.occur || this.occur.max === -1 || this[$extra].numberOfUse < this.occur.max;
  47509. }
  47510. [$getNextPage]() {
  47511. if (!this[$extra]) {
  47512. this[$extra] = {
  47513. numberOfUse: 1,
  47514. pageIndex: -1,
  47515. pageSetIndex: -1
  47516. };
  47517. }
  47518. if (this.relation === "orderedOccurrence") {
  47519. if (this[$extra].pageIndex + 1 < this.pageArea.children.length) {
  47520. this[$extra].pageIndex += 1;
  47521. const pageArea = this.pageArea.children[this[$extra].pageIndex];
  47522. return pageArea[$getNextPage]();
  47523. }
  47524. if (this[$extra].pageSetIndex + 1 < this.pageSet.children.length) {
  47525. this[$extra].pageSetIndex += 1;
  47526. return this.pageSet.children[this[$extra].pageSetIndex][$getNextPage]();
  47527. }
  47528. if (this[$isUsable]()) {
  47529. this[$extra].numberOfUse += 1;
  47530. this[$extra].pageIndex = -1;
  47531. this[$extra].pageSetIndex = -1;
  47532. return this[$getNextPage]();
  47533. }
  47534. const parent = this[$getParent]();
  47535. if (parent instanceof PageSet) {
  47536. return parent[$getNextPage]();
  47537. }
  47538. this[$cleanPage]();
  47539. return this[$getNextPage]();
  47540. }
  47541. const pageNumber = this[$getTemplateRoot]()[$extra].pageNumber;
  47542. const parity = pageNumber % 2 === 0 ? "even" : "odd";
  47543. const position = pageNumber === 0 ? "first" : "rest";
  47544. let page = this.pageArea.children.find(p => p.oddOrEven === parity && p.pagePosition === position);
  47545. if (page) {
  47546. return page;
  47547. }
  47548. page = this.pageArea.children.find(p => p.oddOrEven === "any" && p.pagePosition === position);
  47549. if (page) {
  47550. return page;
  47551. }
  47552. page = this.pageArea.children.find(p => p.oddOrEven === "any" && p.pagePosition === "any");
  47553. if (page) {
  47554. return page;
  47555. }
  47556. return this.pageArea.children[0];
  47557. }
  47558. }
  47559. class Para extends XFAObject {
  47560. constructor(attributes) {
  47561. super(TEMPLATE_NS_ID, "para", true);
  47562. this.hAlign = getStringOption(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]);
  47563. this.id = attributes.id || "";
  47564. this.lineHeight = attributes.lineHeight ? getMeasurement(attributes.lineHeight, "0pt") : "";
  47565. this.marginLeft = attributes.marginLeft ? getMeasurement(attributes.marginLeft, "0pt") : "";
  47566. this.marginRight = attributes.marginRight ? getMeasurement(attributes.marginRight, "0pt") : "";
  47567. this.orphans = getInteger({
  47568. data: attributes.orphans,
  47569. defaultValue: 0,
  47570. validate: x => x >= 0
  47571. });
  47572. this.preserve = attributes.preserve || "";
  47573. this.radixOffset = attributes.radixOffset ? getMeasurement(attributes.radixOffset, "0pt") : "";
  47574. this.spaceAbove = attributes.spaceAbove ? getMeasurement(attributes.spaceAbove, "0pt") : "";
  47575. this.spaceBelow = attributes.spaceBelow ? getMeasurement(attributes.spaceBelow, "0pt") : "";
  47576. this.tabDefault = attributes.tabDefault ? getMeasurement(this.tabDefault) : "";
  47577. this.tabStops = (attributes.tabStops || "").trim().split(/\s+/).map((x, i) => i % 2 === 1 ? getMeasurement(x) : x);
  47578. this.textIndent = attributes.textIndent ? getMeasurement(attributes.textIndent, "0pt") : "";
  47579. this.use = attributes.use || "";
  47580. this.usehref = attributes.usehref || "";
  47581. this.vAlign = getStringOption(attributes.vAlign, ["top", "bottom", "middle"]);
  47582. this.widows = getInteger({
  47583. data: attributes.widows,
  47584. defaultValue: 0,
  47585. validate: x => x >= 0
  47586. });
  47587. this.hyphenation = null;
  47588. }
  47589. [$toStyle]() {
  47590. const style = toStyle(this, "hAlign");
  47591. if (this.marginLeft !== "") {
  47592. style.paddingLeft = measureToString(this.marginLeft);
  47593. }
  47594. if (this.marginRight !== "") {
  47595. style.paddingight = measureToString(this.marginRight);
  47596. }
  47597. if (this.spaceAbove !== "") {
  47598. style.paddingTop = measureToString(this.spaceAbove);
  47599. }
  47600. if (this.spaceBelow !== "") {
  47601. style.paddingBottom = measureToString(this.spaceBelow);
  47602. }
  47603. if (this.textIndent !== "") {
  47604. style.textIndent = measureToString(this.textIndent);
  47605. fixTextIndent(style);
  47606. }
  47607. if (this.lineHeight > 0) {
  47608. style.lineHeight = measureToString(this.lineHeight);
  47609. }
  47610. if (this.tabDefault !== "") {
  47611. style.tabSize = measureToString(this.tabDefault);
  47612. }
  47613. if (this.tabStops.length > 0) {}
  47614. if (this.hyphenatation) {
  47615. Object.assign(style, this.hyphenatation[$toStyle]());
  47616. }
  47617. return style;
  47618. }
  47619. }
  47620. class PasswordEdit extends XFAObject {
  47621. constructor(attributes) {
  47622. super(TEMPLATE_NS_ID, "passwordEdit", true);
  47623. this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, ["auto", "off", "on"]);
  47624. this.id = attributes.id || "";
  47625. this.passwordChar = attributes.passwordChar || "*";
  47626. this.use = attributes.use || "";
  47627. this.usehref = attributes.usehref || "";
  47628. this.border = null;
  47629. this.extras = null;
  47630. this.margin = null;
  47631. }
  47632. }
  47633. class template_Pattern extends XFAObject {
  47634. constructor(attributes) {
  47635. super(TEMPLATE_NS_ID, "pattern", true);
  47636. this.id = attributes.id || "";
  47637. this.type = getStringOption(attributes.type, ["crossHatch", "crossDiagonal", "diagonalLeft", "diagonalRight", "horizontal", "vertical"]);
  47638. this.use = attributes.use || "";
  47639. this.usehref = attributes.usehref || "";
  47640. this.color = null;
  47641. this.extras = null;
  47642. }
  47643. [$toStyle](startColor) {
  47644. startColor = startColor ? startColor[$toStyle]() : "#FFFFFF";
  47645. const endColor = this.color ? this.color[$toStyle]() : "#000000";
  47646. const width = 5;
  47647. const cmd = "repeating-linear-gradient";
  47648. const colors = `${startColor},${startColor} ${width}px,${endColor} ${width}px,${endColor} ${2 * width}px`;
  47649. switch (this.type) {
  47650. case "crossHatch":
  47651. return `${cmd}(to top,${colors}) ${cmd}(to right,${colors})`;
  47652. case "crossDiagonal":
  47653. return `${cmd}(45deg,${colors}) ${cmd}(-45deg,${colors})`;
  47654. case "diagonalLeft":
  47655. return `${cmd}(45deg,${colors})`;
  47656. case "diagonalRight":
  47657. return `${cmd}(-45deg,${colors})`;
  47658. case "horizontal":
  47659. return `${cmd}(to top,${colors})`;
  47660. case "vertical":
  47661. return `${cmd}(to right,${colors})`;
  47662. }
  47663. return "";
  47664. }
  47665. }
  47666. class Picture extends StringObject {
  47667. constructor(attributes) {
  47668. super(TEMPLATE_NS_ID, "picture");
  47669. this.id = attributes.id || "";
  47670. this.use = attributes.use || "";
  47671. this.usehref = attributes.usehref || "";
  47672. }
  47673. }
  47674. class Proto extends XFAObject {
  47675. constructor(attributes) {
  47676. super(TEMPLATE_NS_ID, "proto", true);
  47677. this.appearanceFilter = new XFAObjectArray();
  47678. this.arc = new XFAObjectArray();
  47679. this.area = new XFAObjectArray();
  47680. this.assist = new XFAObjectArray();
  47681. this.barcode = new XFAObjectArray();
  47682. this.bindItems = new XFAObjectArray();
  47683. this.bookend = new XFAObjectArray();
  47684. this.boolean = new XFAObjectArray();
  47685. this.border = new XFAObjectArray();
  47686. this.break = new XFAObjectArray();
  47687. this.breakAfter = new XFAObjectArray();
  47688. this.breakBefore = new XFAObjectArray();
  47689. this.button = new XFAObjectArray();
  47690. this.calculate = new XFAObjectArray();
  47691. this.caption = new XFAObjectArray();
  47692. this.certificate = new XFAObjectArray();
  47693. this.certificates = new XFAObjectArray();
  47694. this.checkButton = new XFAObjectArray();
  47695. this.choiceList = new XFAObjectArray();
  47696. this.color = new XFAObjectArray();
  47697. this.comb = new XFAObjectArray();
  47698. this.connect = new XFAObjectArray();
  47699. this.contentArea = new XFAObjectArray();
  47700. this.corner = new XFAObjectArray();
  47701. this.date = new XFAObjectArray();
  47702. this.dateTime = new XFAObjectArray();
  47703. this.dateTimeEdit = new XFAObjectArray();
  47704. this.decimal = new XFAObjectArray();
  47705. this.defaultUi = new XFAObjectArray();
  47706. this.desc = new XFAObjectArray();
  47707. this.digestMethod = new XFAObjectArray();
  47708. this.digestMethods = new XFAObjectArray();
  47709. this.draw = new XFAObjectArray();
  47710. this.edge = new XFAObjectArray();
  47711. this.encoding = new XFAObjectArray();
  47712. this.encodings = new XFAObjectArray();
  47713. this.encrypt = new XFAObjectArray();
  47714. this.encryptData = new XFAObjectArray();
  47715. this.encryption = new XFAObjectArray();
  47716. this.encryptionMethod = new XFAObjectArray();
  47717. this.encryptionMethods = new XFAObjectArray();
  47718. this.event = new XFAObjectArray();
  47719. this.exData = new XFAObjectArray();
  47720. this.exObject = new XFAObjectArray();
  47721. this.exclGroup = new XFAObjectArray();
  47722. this.execute = new XFAObjectArray();
  47723. this.extras = new XFAObjectArray();
  47724. this.field = new XFAObjectArray();
  47725. this.fill = new XFAObjectArray();
  47726. this.filter = new XFAObjectArray();
  47727. this.float = new XFAObjectArray();
  47728. this.font = new XFAObjectArray();
  47729. this.format = new XFAObjectArray();
  47730. this.handler = new XFAObjectArray();
  47731. this.hyphenation = new XFAObjectArray();
  47732. this.image = new XFAObjectArray();
  47733. this.imageEdit = new XFAObjectArray();
  47734. this.integer = new XFAObjectArray();
  47735. this.issuers = new XFAObjectArray();
  47736. this.items = new XFAObjectArray();
  47737. this.keep = new XFAObjectArray();
  47738. this.keyUsage = new XFAObjectArray();
  47739. this.line = new XFAObjectArray();
  47740. this.linear = new XFAObjectArray();
  47741. this.lockDocument = new XFAObjectArray();
  47742. this.manifest = new XFAObjectArray();
  47743. this.margin = new XFAObjectArray();
  47744. this.mdp = new XFAObjectArray();
  47745. this.medium = new XFAObjectArray();
  47746. this.message = new XFAObjectArray();
  47747. this.numericEdit = new XFAObjectArray();
  47748. this.occur = new XFAObjectArray();
  47749. this.oid = new XFAObjectArray();
  47750. this.oids = new XFAObjectArray();
  47751. this.overflow = new XFAObjectArray();
  47752. this.pageArea = new XFAObjectArray();
  47753. this.pageSet = new XFAObjectArray();
  47754. this.para = new XFAObjectArray();
  47755. this.passwordEdit = new XFAObjectArray();
  47756. this.pattern = new XFAObjectArray();
  47757. this.picture = new XFAObjectArray();
  47758. this.radial = new XFAObjectArray();
  47759. this.reason = new XFAObjectArray();
  47760. this.reasons = new XFAObjectArray();
  47761. this.rectangle = new XFAObjectArray();
  47762. this.ref = new XFAObjectArray();
  47763. this.script = new XFAObjectArray();
  47764. this.setProperty = new XFAObjectArray();
  47765. this.signData = new XFAObjectArray();
  47766. this.signature = new XFAObjectArray();
  47767. this.signing = new XFAObjectArray();
  47768. this.solid = new XFAObjectArray();
  47769. this.speak = new XFAObjectArray();
  47770. this.stipple = new XFAObjectArray();
  47771. this.subform = new XFAObjectArray();
  47772. this.subformSet = new XFAObjectArray();
  47773. this.subjectDN = new XFAObjectArray();
  47774. this.subjectDNs = new XFAObjectArray();
  47775. this.submit = new XFAObjectArray();
  47776. this.text = new XFAObjectArray();
  47777. this.textEdit = new XFAObjectArray();
  47778. this.time = new XFAObjectArray();
  47779. this.timeStamp = new XFAObjectArray();
  47780. this.toolTip = new XFAObjectArray();
  47781. this.traversal = new XFAObjectArray();
  47782. this.traverse = new XFAObjectArray();
  47783. this.ui = new XFAObjectArray();
  47784. this.validate = new XFAObjectArray();
  47785. this.value = new XFAObjectArray();
  47786. this.variables = new XFAObjectArray();
  47787. }
  47788. }
  47789. class Radial extends XFAObject {
  47790. constructor(attributes) {
  47791. super(TEMPLATE_NS_ID, "radial", true);
  47792. this.id = attributes.id || "";
  47793. this.type = getStringOption(attributes.type, ["toEdge", "toCenter"]);
  47794. this.use = attributes.use || "";
  47795. this.usehref = attributes.usehref || "";
  47796. this.color = null;
  47797. this.extras = null;
  47798. }
  47799. [$toStyle](startColor) {
  47800. startColor = startColor ? startColor[$toStyle]() : "#FFFFFF";
  47801. const endColor = this.color ? this.color[$toStyle]() : "#000000";
  47802. const colors = this.type === "toEdge" ? `${startColor},${endColor}` : `${endColor},${startColor}`;
  47803. return `radial-gradient(circle at center, ${colors})`;
  47804. }
  47805. }
  47806. class Reason extends StringObject {
  47807. constructor(attributes) {
  47808. super(TEMPLATE_NS_ID, "reason");
  47809. this.id = attributes.id || "";
  47810. this.name = attributes.name || "";
  47811. this.use = attributes.use || "";
  47812. this.usehref = attributes.usehref || "";
  47813. }
  47814. }
  47815. class Reasons extends XFAObject {
  47816. constructor(attributes) {
  47817. super(TEMPLATE_NS_ID, "reasons", true);
  47818. this.id = attributes.id || "";
  47819. this.type = getStringOption(attributes.type, ["optional", "required"]);
  47820. this.use = attributes.use || "";
  47821. this.usehref = attributes.usehref || "";
  47822. this.reason = new XFAObjectArray();
  47823. }
  47824. }
  47825. class Rectangle extends XFAObject {
  47826. constructor(attributes) {
  47827. super(TEMPLATE_NS_ID, "rectangle", true);
  47828. this.hand = getStringOption(attributes.hand, ["even", "left", "right"]);
  47829. this.id = attributes.id || "";
  47830. this.use = attributes.use || "";
  47831. this.usehref = attributes.usehref || "";
  47832. this.corner = new XFAObjectArray(4);
  47833. this.edge = new XFAObjectArray(4);
  47834. this.fill = null;
  47835. }
  47836. [$toHTML]() {
  47837. const edge = this.edge.children.length ? this.edge.children[0] : new Edge({});
  47838. const edgeStyle = edge[$toStyle]();
  47839. const style = Object.create(null);
  47840. if (this.fill?.presence === "visible") {
  47841. Object.assign(style, this.fill[$toStyle]());
  47842. } else {
  47843. style.fill = "transparent";
  47844. }
  47845. style.strokeWidth = measureToString(edge.presence === "visible" ? edge.thickness : 0);
  47846. style.stroke = edgeStyle.color;
  47847. const corner = this.corner.children.length ? this.corner.children[0] : new Corner({});
  47848. const cornerStyle = corner[$toStyle]();
  47849. const rect = {
  47850. name: "rect",
  47851. attributes: {
  47852. xmlns: SVG_NS,
  47853. width: "100%",
  47854. height: "100%",
  47855. x: 0,
  47856. y: 0,
  47857. rx: cornerStyle.radius,
  47858. ry: cornerStyle.radius,
  47859. style
  47860. }
  47861. };
  47862. const svg = {
  47863. name: "svg",
  47864. children: [rect],
  47865. attributes: {
  47866. xmlns: SVG_NS,
  47867. style: {
  47868. overflow: "visible"
  47869. },
  47870. width: "100%",
  47871. height: "100%"
  47872. }
  47873. };
  47874. const parent = this[$getParent]()[$getParent]();
  47875. if (hasMargin(parent)) {
  47876. return HTMLResult.success({
  47877. name: "div",
  47878. attributes: {
  47879. style: {
  47880. display: "inline",
  47881. width: "100%",
  47882. height: "100%"
  47883. }
  47884. },
  47885. children: [svg]
  47886. });
  47887. }
  47888. svg.attributes.style.position = "absolute";
  47889. return HTMLResult.success(svg);
  47890. }
  47891. }
  47892. class RefElement extends StringObject {
  47893. constructor(attributes) {
  47894. super(TEMPLATE_NS_ID, "ref");
  47895. this.id = attributes.id || "";
  47896. this.use = attributes.use || "";
  47897. this.usehref = attributes.usehref || "";
  47898. }
  47899. }
  47900. class Script extends StringObject {
  47901. constructor(attributes) {
  47902. super(TEMPLATE_NS_ID, "script");
  47903. this.binding = attributes.binding || "";
  47904. this.contentType = attributes.contentType || "";
  47905. this.id = attributes.id || "";
  47906. this.name = attributes.name || "";
  47907. this.runAt = getStringOption(attributes.runAt, ["client", "both", "server"]);
  47908. this.use = attributes.use || "";
  47909. this.usehref = attributes.usehref || "";
  47910. }
  47911. }
  47912. class SetProperty extends XFAObject {
  47913. constructor(attributes) {
  47914. super(TEMPLATE_NS_ID, "setProperty");
  47915. this.connection = attributes.connection || "";
  47916. this.ref = attributes.ref || "";
  47917. this.target = attributes.target || "";
  47918. }
  47919. }
  47920. class SignData extends XFAObject {
  47921. constructor(attributes) {
  47922. super(TEMPLATE_NS_ID, "signData", true);
  47923. this.id = attributes.id || "";
  47924. this.operation = getStringOption(attributes.operation, ["sign", "clear", "verify"]);
  47925. this.ref = attributes.ref || "";
  47926. this.target = attributes.target || "";
  47927. this.use = attributes.use || "";
  47928. this.usehref = attributes.usehref || "";
  47929. this.filter = null;
  47930. this.manifest = null;
  47931. }
  47932. }
  47933. class Signature extends XFAObject {
  47934. constructor(attributes) {
  47935. super(TEMPLATE_NS_ID, "signature", true);
  47936. this.id = attributes.id || "";
  47937. this.type = getStringOption(attributes.type, ["PDF1.3", "PDF1.6"]);
  47938. this.use = attributes.use || "";
  47939. this.usehref = attributes.usehref || "";
  47940. this.border = null;
  47941. this.extras = null;
  47942. this.filter = null;
  47943. this.manifest = null;
  47944. this.margin = null;
  47945. }
  47946. }
  47947. class Signing extends XFAObject {
  47948. constructor(attributes) {
  47949. super(TEMPLATE_NS_ID, "signing", true);
  47950. this.id = attributes.id || "";
  47951. this.type = getStringOption(attributes.type, ["optional", "required"]);
  47952. this.use = attributes.use || "";
  47953. this.usehref = attributes.usehref || "";
  47954. this.certificate = new XFAObjectArray();
  47955. }
  47956. }
  47957. class Solid extends XFAObject {
  47958. constructor(attributes) {
  47959. super(TEMPLATE_NS_ID, "solid", true);
  47960. this.id = attributes.id || "";
  47961. this.use = attributes.use || "";
  47962. this.usehref = attributes.usehref || "";
  47963. this.extras = null;
  47964. }
  47965. [$toStyle](startColor) {
  47966. return startColor ? startColor[$toStyle]() : "#FFFFFF";
  47967. }
  47968. }
  47969. class Speak extends StringObject {
  47970. constructor(attributes) {
  47971. super(TEMPLATE_NS_ID, "speak");
  47972. this.disable = getInteger({
  47973. data: attributes.disable,
  47974. defaultValue: 0,
  47975. validate: x => x === 1
  47976. });
  47977. this.id = attributes.id || "";
  47978. this.priority = getStringOption(attributes.priority, ["custom", "caption", "name", "toolTip"]);
  47979. this.rid = attributes.rid || "";
  47980. this.use = attributes.use || "";
  47981. this.usehref = attributes.usehref || "";
  47982. }
  47983. }
  47984. class Stipple extends XFAObject {
  47985. constructor(attributes) {
  47986. super(TEMPLATE_NS_ID, "stipple", true);
  47987. this.id = attributes.id || "";
  47988. this.rate = getInteger({
  47989. data: attributes.rate,
  47990. defaultValue: 50,
  47991. validate: x => x >= 0 && x <= 100
  47992. });
  47993. this.use = attributes.use || "";
  47994. this.usehref = attributes.usehref || "";
  47995. this.color = null;
  47996. this.extras = null;
  47997. }
  47998. [$toStyle](bgColor) {
  47999. const alpha = this.rate / 100;
  48000. return Util.makeHexColor(Math.round(bgColor.value.r * (1 - alpha) + this.value.r * alpha), Math.round(bgColor.value.g * (1 - alpha) + this.value.g * alpha), Math.round(bgColor.value.b * (1 - alpha) + this.value.b * alpha));
  48001. }
  48002. }
  48003. class Subform extends XFAObject {
  48004. constructor(attributes) {
  48005. super(TEMPLATE_NS_ID, "subform", true);
  48006. this.access = getStringOption(attributes.access, ["open", "nonInteractive", "protected", "readOnly"]);
  48007. this.allowMacro = getInteger({
  48008. data: attributes.allowMacro,
  48009. defaultValue: 0,
  48010. validate: x => x === 1
  48011. });
  48012. this.anchorType = getStringOption(attributes.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]);
  48013. this.colSpan = getInteger({
  48014. data: attributes.colSpan,
  48015. defaultValue: 1,
  48016. validate: n => n >= 1 || n === -1
  48017. });
  48018. this.columnWidths = (attributes.columnWidths || "").trim().split(/\s+/).map(x => x === "-1" ? -1 : getMeasurement(x));
  48019. this.h = attributes.h ? getMeasurement(attributes.h) : "";
  48020. this.hAlign = getStringOption(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]);
  48021. this.id = attributes.id || "";
  48022. this.layout = getStringOption(attributes.layout, ["position", "lr-tb", "rl-row", "rl-tb", "row", "table", "tb"]);
  48023. this.locale = attributes.locale || "";
  48024. this.maxH = getMeasurement(attributes.maxH, "0pt");
  48025. this.maxW = getMeasurement(attributes.maxW, "0pt");
  48026. this.mergeMode = getStringOption(attributes.mergeMode, ["consumeData", "matchTemplate"]);
  48027. this.minH = getMeasurement(attributes.minH, "0pt");
  48028. this.minW = getMeasurement(attributes.minW, "0pt");
  48029. this.name = attributes.name || "";
  48030. this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
  48031. this.relevant = getRelevant(attributes.relevant);
  48032. this.restoreState = getStringOption(attributes.restoreState, ["manual", "auto"]);
  48033. this.scope = getStringOption(attributes.scope, ["name", "none"]);
  48034. this.use = attributes.use || "";
  48035. this.usehref = attributes.usehref || "";
  48036. this.w = attributes.w ? getMeasurement(attributes.w) : "";
  48037. this.x = getMeasurement(attributes.x, "0pt");
  48038. this.y = getMeasurement(attributes.y, "0pt");
  48039. this.assist = null;
  48040. this.bind = null;
  48041. this.bookend = null;
  48042. this.border = null;
  48043. this.break = null;
  48044. this.calculate = null;
  48045. this.desc = null;
  48046. this.extras = null;
  48047. this.keep = null;
  48048. this.margin = null;
  48049. this.occur = null;
  48050. this.overflow = null;
  48051. this.pageSet = null;
  48052. this.para = null;
  48053. this.traversal = null;
  48054. this.validate = null;
  48055. this.variables = null;
  48056. this.area = new XFAObjectArray();
  48057. this.breakAfter = new XFAObjectArray();
  48058. this.breakBefore = new XFAObjectArray();
  48059. this.connect = new XFAObjectArray();
  48060. this.draw = new XFAObjectArray();
  48061. this.event = new XFAObjectArray();
  48062. this.exObject = new XFAObjectArray();
  48063. this.exclGroup = new XFAObjectArray();
  48064. this.field = new XFAObjectArray();
  48065. this.proto = new XFAObjectArray();
  48066. this.setProperty = new XFAObjectArray();
  48067. this.subform = new XFAObjectArray();
  48068. this.subformSet = new XFAObjectArray();
  48069. }
  48070. [$getSubformParent]() {
  48071. const parent = this[$getParent]();
  48072. if (parent instanceof SubformSet) {
  48073. return parent[$getSubformParent]();
  48074. }
  48075. return parent;
  48076. }
  48077. [$isBindable]() {
  48078. return true;
  48079. }
  48080. [$isThereMoreWidth]() {
  48081. return this.layout.endsWith("-tb") && this[$extra].attempt === 0 && this[$extra].numberInLine > 0 || this[$getParent]()[$isThereMoreWidth]();
  48082. }
  48083. *[$getContainedChildren]() {
  48084. yield* getContainedChildren(this);
  48085. }
  48086. [$flushHTML]() {
  48087. return flushHTML(this);
  48088. }
  48089. [$addHTML](html, bbox) {
  48090. addHTML(this, html, bbox);
  48091. }
  48092. [$getAvailableSpace]() {
  48093. return getAvailableSpace(this);
  48094. }
  48095. [$isSplittable]() {
  48096. const parent = this[$getSubformParent]();
  48097. if (!parent[$isSplittable]()) {
  48098. return false;
  48099. }
  48100. if (this[$extra]._isSplittable !== undefined) {
  48101. return this[$extra]._isSplittable;
  48102. }
  48103. if (this.layout === "position" || this.layout.includes("row")) {
  48104. this[$extra]._isSplittable = false;
  48105. return false;
  48106. }
  48107. if (this.keep && this.keep.intact !== "none") {
  48108. this[$extra]._isSplittable = false;
  48109. return false;
  48110. }
  48111. if (parent.layout?.endsWith("-tb") && parent[$extra].numberInLine !== 0) {
  48112. return false;
  48113. }
  48114. this[$extra]._isSplittable = true;
  48115. return true;
  48116. }
  48117. [$toHTML](availableSpace) {
  48118. setTabIndex(this);
  48119. if (this.break) {
  48120. if (this.break.after !== "auto" || this.break.afterTarget !== "") {
  48121. const node = new BreakAfter({
  48122. targetType: this.break.after,
  48123. target: this.break.afterTarget,
  48124. startNew: this.break.startNew.toString()
  48125. });
  48126. node[$globalData] = this[$globalData];
  48127. this[$appendChild](node);
  48128. this.breakAfter.push(node);
  48129. }
  48130. if (this.break.before !== "auto" || this.break.beforeTarget !== "") {
  48131. const node = new BreakBefore({
  48132. targetType: this.break.before,
  48133. target: this.break.beforeTarget,
  48134. startNew: this.break.startNew.toString()
  48135. });
  48136. node[$globalData] = this[$globalData];
  48137. this[$appendChild](node);
  48138. this.breakBefore.push(node);
  48139. }
  48140. if (this.break.overflowTarget !== "") {
  48141. const node = new Overflow({
  48142. target: this.break.overflowTarget,
  48143. leader: this.break.overflowLeader,
  48144. trailer: this.break.overflowTrailer
  48145. });
  48146. node[$globalData] = this[$globalData];
  48147. this[$appendChild](node);
  48148. this.overflow.push(node);
  48149. }
  48150. this[$removeChild](this.break);
  48151. this.break = null;
  48152. }
  48153. if (this.presence === "hidden" || this.presence === "inactive") {
  48154. return HTMLResult.EMPTY;
  48155. }
  48156. if (this.breakBefore.children.length > 1 || this.breakAfter.children.length > 1) {
  48157. warn("XFA - Several breakBefore or breakAfter in subforms: please file a bug.");
  48158. }
  48159. if (this.breakBefore.children.length >= 1) {
  48160. const breakBefore = this.breakBefore.children[0];
  48161. if (handleBreak(breakBefore)) {
  48162. return HTMLResult.breakNode(breakBefore);
  48163. }
  48164. }
  48165. if (this[$extra]?.afterBreakAfter) {
  48166. return HTMLResult.EMPTY;
  48167. }
  48168. fixDimensions(this);
  48169. const children = [];
  48170. const attributes = {
  48171. id: this[$uid],
  48172. class: []
  48173. };
  48174. setAccess(this, attributes.class);
  48175. if (!this[$extra]) {
  48176. this[$extra] = Object.create(null);
  48177. }
  48178. Object.assign(this[$extra], {
  48179. children,
  48180. line: null,
  48181. attributes,
  48182. attempt: 0,
  48183. numberInLine: 0,
  48184. availableSpace: {
  48185. width: Math.min(this.w || Infinity, availableSpace.width),
  48186. height: Math.min(this.h || Infinity, availableSpace.height)
  48187. },
  48188. width: 0,
  48189. height: 0,
  48190. prevHeight: 0,
  48191. currentWidth: 0
  48192. });
  48193. const root = this[$getTemplateRoot]();
  48194. const savedNoLayoutFailure = root[$extra].noLayoutFailure;
  48195. const isSplittable = this[$isSplittable]();
  48196. if (!isSplittable) {
  48197. setFirstUnsplittable(this);
  48198. }
  48199. if (!checkDimensions(this, availableSpace)) {
  48200. return HTMLResult.FAILURE;
  48201. }
  48202. const filter = new Set(["area", "draw", "exclGroup", "field", "subform", "subformSet"]);
  48203. if (this.layout.includes("row")) {
  48204. const columnWidths = this[$getSubformParent]().columnWidths;
  48205. if (Array.isArray(columnWidths) && columnWidths.length > 0) {
  48206. this[$extra].columnWidths = columnWidths;
  48207. this[$extra].currentColumn = 0;
  48208. }
  48209. }
  48210. const style = toStyle(this, "anchorType", "dimensions", "position", "presence", "border", "margin", "hAlign");
  48211. const classNames = ["xfaSubform"];
  48212. const cl = layoutClass(this);
  48213. if (cl) {
  48214. classNames.push(cl);
  48215. }
  48216. attributes.style = style;
  48217. attributes.class = classNames;
  48218. if (this.name) {
  48219. attributes.xfaName = this.name;
  48220. }
  48221. if (this.overflow) {
  48222. const overflowExtra = this.overflow[$getExtra]();
  48223. if (overflowExtra.addLeader) {
  48224. overflowExtra.addLeader = false;
  48225. handleOverflow(this, overflowExtra.leader, availableSpace);
  48226. }
  48227. }
  48228. this[$pushPara]();
  48229. const isLrTb = this.layout === "lr-tb" || this.layout === "rl-tb";
  48230. const maxRun = isLrTb ? MAX_ATTEMPTS_FOR_LRTB_LAYOUT : 1;
  48231. for (; this[$extra].attempt < maxRun; this[$extra].attempt++) {
  48232. if (isLrTb && this[$extra].attempt === MAX_ATTEMPTS_FOR_LRTB_LAYOUT - 1) {
  48233. this[$extra].numberInLine = 0;
  48234. }
  48235. const result = this[$childrenToHTML]({
  48236. filter,
  48237. include: true
  48238. });
  48239. if (result.success) {
  48240. break;
  48241. }
  48242. if (result.isBreak()) {
  48243. this[$popPara]();
  48244. return result;
  48245. }
  48246. if (isLrTb && this[$extra].attempt === 0 && this[$extra].numberInLine === 0 && !root[$extra].noLayoutFailure) {
  48247. this[$extra].attempt = maxRun;
  48248. break;
  48249. }
  48250. }
  48251. this[$popPara]();
  48252. if (!isSplittable) {
  48253. unsetFirstUnsplittable(this);
  48254. }
  48255. root[$extra].noLayoutFailure = savedNoLayoutFailure;
  48256. if (this[$extra].attempt === maxRun) {
  48257. if (this.overflow) {
  48258. this[$getTemplateRoot]()[$extra].overflowNode = this.overflow;
  48259. }
  48260. if (!isSplittable) {
  48261. delete this[$extra];
  48262. }
  48263. return HTMLResult.FAILURE;
  48264. }
  48265. if (this.overflow) {
  48266. const overflowExtra = this.overflow[$getExtra]();
  48267. if (overflowExtra.addTrailer) {
  48268. overflowExtra.addTrailer = false;
  48269. handleOverflow(this, overflowExtra.trailer, availableSpace);
  48270. }
  48271. }
  48272. let marginH = 0;
  48273. let marginV = 0;
  48274. if (this.margin) {
  48275. marginH = this.margin.leftInset + this.margin.rightInset;
  48276. marginV = this.margin.topInset + this.margin.bottomInset;
  48277. }
  48278. const width = Math.max(this[$extra].width + marginH, this.w || 0);
  48279. const height = Math.max(this[$extra].height + marginV, this.h || 0);
  48280. const bbox = [this.x, this.y, width, height];
  48281. if (this.w === "") {
  48282. style.width = measureToString(width);
  48283. }
  48284. if (this.h === "") {
  48285. style.height = measureToString(height);
  48286. }
  48287. if ((style.width === "0px" || style.height === "0px") && children.length === 0) {
  48288. return HTMLResult.EMPTY;
  48289. }
  48290. const html = {
  48291. name: "div",
  48292. attributes,
  48293. children
  48294. };
  48295. applyAssist(this, attributes);
  48296. const result = HTMLResult.success(createWrapper(this, html), bbox);
  48297. if (this.breakAfter.children.length >= 1) {
  48298. const breakAfter = this.breakAfter.children[0];
  48299. if (handleBreak(breakAfter)) {
  48300. this[$extra].afterBreakAfter = result;
  48301. return HTMLResult.breakNode(breakAfter);
  48302. }
  48303. }
  48304. delete this[$extra];
  48305. return result;
  48306. }
  48307. }
  48308. class SubformSet extends XFAObject {
  48309. constructor(attributes) {
  48310. super(TEMPLATE_NS_ID, "subformSet", true);
  48311. this.id = attributes.id || "";
  48312. this.name = attributes.name || "";
  48313. this.relation = getStringOption(attributes.relation, ["ordered", "choice", "unordered"]);
  48314. this.relevant = getRelevant(attributes.relevant);
  48315. this.use = attributes.use || "";
  48316. this.usehref = attributes.usehref || "";
  48317. this.bookend = null;
  48318. this.break = null;
  48319. this.desc = null;
  48320. this.extras = null;
  48321. this.occur = null;
  48322. this.overflow = null;
  48323. this.breakAfter = new XFAObjectArray();
  48324. this.breakBefore = new XFAObjectArray();
  48325. this.subform = new XFAObjectArray();
  48326. this.subformSet = new XFAObjectArray();
  48327. }
  48328. *[$getContainedChildren]() {
  48329. yield* getContainedChildren(this);
  48330. }
  48331. [$getSubformParent]() {
  48332. let parent = this[$getParent]();
  48333. while (!(parent instanceof Subform)) {
  48334. parent = parent[$getParent]();
  48335. }
  48336. return parent;
  48337. }
  48338. [$isBindable]() {
  48339. return true;
  48340. }
  48341. }
  48342. class SubjectDN extends ContentObject {
  48343. constructor(attributes) {
  48344. super(TEMPLATE_NS_ID, "subjectDN");
  48345. this.delimiter = attributes.delimiter || ",";
  48346. this.id = attributes.id || "";
  48347. this.name = attributes.name || "";
  48348. this.use = attributes.use || "";
  48349. this.usehref = attributes.usehref || "";
  48350. }
  48351. [$finalize]() {
  48352. this[$content] = new Map(this[$content].split(this.delimiter).map(kv => {
  48353. kv = kv.split("=", 2);
  48354. kv[0] = kv[0].trim();
  48355. return kv;
  48356. }));
  48357. }
  48358. }
  48359. class SubjectDNs extends XFAObject {
  48360. constructor(attributes) {
  48361. super(TEMPLATE_NS_ID, "subjectDNs", true);
  48362. this.id = attributes.id || "";
  48363. this.type = getStringOption(attributes.type, ["optional", "required"]);
  48364. this.use = attributes.use || "";
  48365. this.usehref = attributes.usehref || "";
  48366. this.subjectDN = new XFAObjectArray();
  48367. }
  48368. }
  48369. class Submit extends XFAObject {
  48370. constructor(attributes) {
  48371. super(TEMPLATE_NS_ID, "submit", true);
  48372. this.embedPDF = getInteger({
  48373. data: attributes.embedPDF,
  48374. defaultValue: 0,
  48375. validate: x => x === 1
  48376. });
  48377. this.format = getStringOption(attributes.format, ["xdp", "formdata", "pdf", "urlencoded", "xfd", "xml"]);
  48378. this.id = attributes.id || "";
  48379. this.target = attributes.target || "";
  48380. this.textEncoding = getKeyword({
  48381. data: attributes.textEncoding ? attributes.textEncoding.toLowerCase() : "",
  48382. defaultValue: "",
  48383. validate: k => ["utf-8", "big-five", "fontspecific", "gbk", "gb-18030", "gb-2312", "ksc-5601", "none", "shift-jis", "ucs-2", "utf-16"].includes(k) || k.match(/iso-8859-\d{2}/)
  48384. });
  48385. this.use = attributes.use || "";
  48386. this.usehref = attributes.usehref || "";
  48387. this.xdpContent = attributes.xdpContent || "";
  48388. this.encrypt = null;
  48389. this.encryptData = new XFAObjectArray();
  48390. this.signData = new XFAObjectArray();
  48391. }
  48392. }
  48393. class Template extends XFAObject {
  48394. constructor(attributes) {
  48395. super(TEMPLATE_NS_ID, "template", true);
  48396. this.baseProfile = getStringOption(attributes.baseProfile, ["full", "interactiveForms"]);
  48397. this.extras = null;
  48398. this.subform = new XFAObjectArray();
  48399. }
  48400. [$finalize]() {
  48401. if (this.subform.children.length === 0) {
  48402. warn("XFA - No subforms in template node.");
  48403. }
  48404. if (this.subform.children.length >= 2) {
  48405. warn("XFA - Several subforms in template node: please file a bug.");
  48406. }
  48407. this[$tabIndex] = DEFAULT_TAB_INDEX;
  48408. }
  48409. [$isSplittable]() {
  48410. return true;
  48411. }
  48412. [$searchNode](expr, container) {
  48413. if (expr.startsWith("#")) {
  48414. return [this[$ids].get(expr.slice(1))];
  48415. }
  48416. return searchNode(this, container, expr, true, true);
  48417. }
  48418. *[$toPages]() {
  48419. if (!this.subform.children.length) {
  48420. return HTMLResult.success({
  48421. name: "div",
  48422. children: []
  48423. });
  48424. }
  48425. this[$extra] = {
  48426. overflowNode: null,
  48427. firstUnsplittable: null,
  48428. currentContentArea: null,
  48429. currentPageArea: null,
  48430. noLayoutFailure: false,
  48431. pageNumber: 1,
  48432. pagePosition: "first",
  48433. oddOrEven: "odd",
  48434. blankOrNotBlank: "nonBlank",
  48435. paraStack: []
  48436. };
  48437. const root = this.subform.children[0];
  48438. root.pageSet[$cleanPage]();
  48439. const pageAreas = root.pageSet.pageArea.children;
  48440. const mainHtml = {
  48441. name: "div",
  48442. children: []
  48443. };
  48444. let pageArea = null;
  48445. let breakBefore = null;
  48446. let breakBeforeTarget = null;
  48447. if (root.breakBefore.children.length >= 1) {
  48448. breakBefore = root.breakBefore.children[0];
  48449. breakBeforeTarget = breakBefore.target;
  48450. } else if (root.subform.children.length >= 1 && root.subform.children[0].breakBefore.children.length >= 1) {
  48451. breakBefore = root.subform.children[0].breakBefore.children[0];
  48452. breakBeforeTarget = breakBefore.target;
  48453. } else if (root.break?.beforeTarget) {
  48454. breakBefore = root.break;
  48455. breakBeforeTarget = breakBefore.beforeTarget;
  48456. } else if (root.subform.children.length >= 1 && root.subform.children[0].break?.beforeTarget) {
  48457. breakBefore = root.subform.children[0].break;
  48458. breakBeforeTarget = breakBefore.beforeTarget;
  48459. }
  48460. if (breakBefore) {
  48461. const target = this[$searchNode](breakBeforeTarget, breakBefore[$getParent]());
  48462. if (target instanceof PageArea) {
  48463. pageArea = target;
  48464. breakBefore[$extra] = {};
  48465. }
  48466. }
  48467. if (!pageArea) {
  48468. pageArea = pageAreas[0];
  48469. }
  48470. pageArea[$extra] = {
  48471. numberOfUse: 1
  48472. };
  48473. const pageAreaParent = pageArea[$getParent]();
  48474. pageAreaParent[$extra] = {
  48475. numberOfUse: 1,
  48476. pageIndex: pageAreaParent.pageArea.children.indexOf(pageArea),
  48477. pageSetIndex: 0
  48478. };
  48479. let targetPageArea;
  48480. let leader = null;
  48481. let trailer = null;
  48482. let hasSomething = true;
  48483. let hasSomethingCounter = 0;
  48484. let startIndex = 0;
  48485. while (true) {
  48486. if (!hasSomething) {
  48487. mainHtml.children.pop();
  48488. if (++hasSomethingCounter === MAX_EMPTY_PAGES) {
  48489. warn("XFA - Something goes wrong: please file a bug.");
  48490. return mainHtml;
  48491. }
  48492. } else {
  48493. hasSomethingCounter = 0;
  48494. }
  48495. targetPageArea = null;
  48496. this[$extra].currentPageArea = pageArea;
  48497. const page = pageArea[$toHTML]().html;
  48498. mainHtml.children.push(page);
  48499. if (leader) {
  48500. this[$extra].noLayoutFailure = true;
  48501. page.children.push(leader[$toHTML](pageArea[$extra].space).html);
  48502. leader = null;
  48503. }
  48504. if (trailer) {
  48505. this[$extra].noLayoutFailure = true;
  48506. page.children.push(trailer[$toHTML](pageArea[$extra].space).html);
  48507. trailer = null;
  48508. }
  48509. const contentAreas = pageArea.contentArea.children;
  48510. const htmlContentAreas = page.children.filter(node => node.attributes.class.includes("xfaContentarea"));
  48511. hasSomething = false;
  48512. this[$extra].firstUnsplittable = null;
  48513. this[$extra].noLayoutFailure = false;
  48514. const flush = index => {
  48515. const html = root[$flushHTML]();
  48516. if (html) {
  48517. hasSomething ||= html.children?.length > 0;
  48518. htmlContentAreas[index].children.push(html);
  48519. }
  48520. };
  48521. for (let i = startIndex, ii = contentAreas.length; i < ii; i++) {
  48522. const contentArea = this[$extra].currentContentArea = contentAreas[i];
  48523. const space = {
  48524. width: contentArea.w,
  48525. height: contentArea.h
  48526. };
  48527. startIndex = 0;
  48528. if (leader) {
  48529. htmlContentAreas[i].children.push(leader[$toHTML](space).html);
  48530. leader = null;
  48531. }
  48532. if (trailer) {
  48533. htmlContentAreas[i].children.push(trailer[$toHTML](space).html);
  48534. trailer = null;
  48535. }
  48536. const html = root[$toHTML](space);
  48537. if (html.success) {
  48538. if (html.html) {
  48539. hasSomething ||= html.html.children?.length > 0;
  48540. htmlContentAreas[i].children.push(html.html);
  48541. } else if (!hasSomething && mainHtml.children.length > 1) {
  48542. mainHtml.children.pop();
  48543. }
  48544. return mainHtml;
  48545. }
  48546. if (html.isBreak()) {
  48547. const node = html.breakNode;
  48548. flush(i);
  48549. if (node.targetType === "auto") {
  48550. continue;
  48551. }
  48552. if (node.leader) {
  48553. leader = this[$searchNode](node.leader, node[$getParent]());
  48554. leader = leader ? leader[0] : null;
  48555. }
  48556. if (node.trailer) {
  48557. trailer = this[$searchNode](node.trailer, node[$getParent]());
  48558. trailer = trailer ? trailer[0] : null;
  48559. }
  48560. if (node.targetType === "pageArea") {
  48561. targetPageArea = node[$extra].target;
  48562. i = Infinity;
  48563. } else if (!node[$extra].target) {
  48564. i = node[$extra].index;
  48565. } else {
  48566. targetPageArea = node[$extra].target;
  48567. startIndex = node[$extra].index + 1;
  48568. i = Infinity;
  48569. }
  48570. continue;
  48571. }
  48572. if (this[$extra].overflowNode) {
  48573. const node = this[$extra].overflowNode;
  48574. this[$extra].overflowNode = null;
  48575. const overflowExtra = node[$getExtra]();
  48576. const target = overflowExtra.target;
  48577. overflowExtra.addLeader = overflowExtra.leader !== null;
  48578. overflowExtra.addTrailer = overflowExtra.trailer !== null;
  48579. flush(i);
  48580. const currentIndex = i;
  48581. i = Infinity;
  48582. if (target instanceof PageArea) {
  48583. targetPageArea = target;
  48584. } else if (target instanceof ContentArea) {
  48585. const index = contentAreas.indexOf(target);
  48586. if (index !== -1) {
  48587. if (index > currentIndex) {
  48588. i = index - 1;
  48589. } else {
  48590. startIndex = index;
  48591. }
  48592. } else {
  48593. targetPageArea = target[$getParent]();
  48594. startIndex = targetPageArea.contentArea.children.indexOf(target);
  48595. }
  48596. }
  48597. continue;
  48598. }
  48599. flush(i);
  48600. }
  48601. this[$extra].pageNumber += 1;
  48602. if (targetPageArea) {
  48603. if (targetPageArea[$isUsable]()) {
  48604. targetPageArea[$extra].numberOfUse += 1;
  48605. } else {
  48606. targetPageArea = null;
  48607. }
  48608. }
  48609. pageArea = targetPageArea || pageArea[$getNextPage]();
  48610. yield null;
  48611. }
  48612. }
  48613. }
  48614. class Text extends ContentObject {
  48615. constructor(attributes) {
  48616. super(TEMPLATE_NS_ID, "text");
  48617. this.id = attributes.id || "";
  48618. this.maxChars = getInteger({
  48619. data: attributes.maxChars,
  48620. defaultValue: 0,
  48621. validate: x => x >= 0
  48622. });
  48623. this.name = attributes.name || "";
  48624. this.rid = attributes.rid || "";
  48625. this.use = attributes.use || "";
  48626. this.usehref = attributes.usehref || "";
  48627. }
  48628. [$acceptWhitespace]() {
  48629. return true;
  48630. }
  48631. [$onChild](child) {
  48632. if (child[$namespaceId] === NamespaceIds.xhtml.id) {
  48633. this[$content] = child;
  48634. return true;
  48635. }
  48636. warn(`XFA - Invalid content in Text: ${child[$nodeName]}.`);
  48637. return false;
  48638. }
  48639. [$onText](str) {
  48640. if (this[$content] instanceof XFAObject) {
  48641. return;
  48642. }
  48643. super[$onText](str);
  48644. }
  48645. [$finalize]() {
  48646. if (typeof this[$content] === "string") {
  48647. this[$content] = this[$content].replaceAll("\r\n", "\n");
  48648. }
  48649. }
  48650. [$getExtra]() {
  48651. if (typeof this[$content] === "string") {
  48652. return this[$content].split(/[\u2029\u2028\n]/).reduce((acc, line) => {
  48653. if (line) {
  48654. acc.push(line);
  48655. }
  48656. return acc;
  48657. }, []).join("\n");
  48658. }
  48659. return this[$content][$text]();
  48660. }
  48661. [$toHTML](availableSpace) {
  48662. if (typeof this[$content] === "string") {
  48663. const html = valueToHtml(this[$content]).html;
  48664. if (this[$content].includes("\u2029")) {
  48665. html.name = "div";
  48666. html.children = [];
  48667. this[$content].split("\u2029").map(para => para.split(/[\u2028\n]/).reduce((acc, line) => {
  48668. acc.push({
  48669. name: "span",
  48670. value: line
  48671. }, {
  48672. name: "br"
  48673. });
  48674. return acc;
  48675. }, [])).forEach(lines => {
  48676. html.children.push({
  48677. name: "p",
  48678. children: lines
  48679. });
  48680. });
  48681. } else if (/[\u2028\n]/.test(this[$content])) {
  48682. html.name = "div";
  48683. html.children = [];
  48684. this[$content].split(/[\u2028\n]/).forEach(line => {
  48685. html.children.push({
  48686. name: "span",
  48687. value: line
  48688. }, {
  48689. name: "br"
  48690. });
  48691. });
  48692. }
  48693. return HTMLResult.success(html);
  48694. }
  48695. return this[$content][$toHTML](availableSpace);
  48696. }
  48697. }
  48698. class TextEdit extends XFAObject {
  48699. constructor(attributes) {
  48700. super(TEMPLATE_NS_ID, "textEdit", true);
  48701. this.allowRichText = getInteger({
  48702. data: attributes.allowRichText,
  48703. defaultValue: 0,
  48704. validate: x => x === 1
  48705. });
  48706. this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, ["auto", "off", "on"]);
  48707. this.id = attributes.id || "";
  48708. this.multiLine = getInteger({
  48709. data: attributes.multiLine,
  48710. defaultValue: "",
  48711. validate: x => x === 0 || x === 1
  48712. });
  48713. this.use = attributes.use || "";
  48714. this.usehref = attributes.usehref || "";
  48715. this.vScrollPolicy = getStringOption(attributes.vScrollPolicy, ["auto", "off", "on"]);
  48716. this.border = null;
  48717. this.comb = null;
  48718. this.extras = null;
  48719. this.margin = null;
  48720. }
  48721. [$toHTML](availableSpace) {
  48722. const style = toStyle(this, "border", "font", "margin");
  48723. let html;
  48724. const field = this[$getParent]()[$getParent]();
  48725. if (this.multiLine === "") {
  48726. this.multiLine = field instanceof Draw ? 1 : 0;
  48727. }
  48728. if (this.multiLine === 1) {
  48729. html = {
  48730. name: "textarea",
  48731. attributes: {
  48732. dataId: field[$data]?.[$uid] || field[$uid],
  48733. fieldId: field[$uid],
  48734. class: ["xfaTextfield"],
  48735. style,
  48736. "aria-label": ariaLabel(field),
  48737. "aria-required": false
  48738. }
  48739. };
  48740. } else {
  48741. html = {
  48742. name: "input",
  48743. attributes: {
  48744. type: "text",
  48745. dataId: field[$data]?.[$uid] || field[$uid],
  48746. fieldId: field[$uid],
  48747. class: ["xfaTextfield"],
  48748. style,
  48749. "aria-label": ariaLabel(field),
  48750. "aria-required": false
  48751. }
  48752. };
  48753. }
  48754. if (isRequired(field)) {
  48755. html.attributes["aria-required"] = true;
  48756. html.attributes.required = true;
  48757. }
  48758. return HTMLResult.success({
  48759. name: "label",
  48760. attributes: {
  48761. class: ["xfaLabel"]
  48762. },
  48763. children: [html]
  48764. });
  48765. }
  48766. }
  48767. class Time extends StringObject {
  48768. constructor(attributes) {
  48769. super(TEMPLATE_NS_ID, "time");
  48770. this.id = attributes.id || "";
  48771. this.name = attributes.name || "";
  48772. this.use = attributes.use || "";
  48773. this.usehref = attributes.usehref || "";
  48774. }
  48775. [$finalize]() {
  48776. const date = this[$content].trim();
  48777. this[$content] = date ? new Date(date) : null;
  48778. }
  48779. [$toHTML](availableSpace) {
  48780. return valueToHtml(this[$content] ? this[$content].toString() : "");
  48781. }
  48782. }
  48783. class TimeStamp extends XFAObject {
  48784. constructor(attributes) {
  48785. super(TEMPLATE_NS_ID, "timeStamp");
  48786. this.id = attributes.id || "";
  48787. this.server = attributes.server || "";
  48788. this.type = getStringOption(attributes.type, ["optional", "required"]);
  48789. this.use = attributes.use || "";
  48790. this.usehref = attributes.usehref || "";
  48791. }
  48792. }
  48793. class ToolTip extends StringObject {
  48794. constructor(attributes) {
  48795. super(TEMPLATE_NS_ID, "toolTip");
  48796. this.id = attributes.id || "";
  48797. this.rid = attributes.rid || "";
  48798. this.use = attributes.use || "";
  48799. this.usehref = attributes.usehref || "";
  48800. }
  48801. }
  48802. class Traversal extends XFAObject {
  48803. constructor(attributes) {
  48804. super(TEMPLATE_NS_ID, "traversal", true);
  48805. this.id = attributes.id || "";
  48806. this.use = attributes.use || "";
  48807. this.usehref = attributes.usehref || "";
  48808. this.extras = null;
  48809. this.traverse = new XFAObjectArray();
  48810. }
  48811. }
  48812. class Traverse extends XFAObject {
  48813. constructor(attributes) {
  48814. super(TEMPLATE_NS_ID, "traverse", true);
  48815. this.id = attributes.id || "";
  48816. this.operation = getStringOption(attributes.operation, ["next", "back", "down", "first", "left", "right", "up"]);
  48817. this.ref = attributes.ref || "";
  48818. this.use = attributes.use || "";
  48819. this.usehref = attributes.usehref || "";
  48820. this.extras = null;
  48821. this.script = null;
  48822. }
  48823. get name() {
  48824. return this.operation;
  48825. }
  48826. [$isTransparent]() {
  48827. return false;
  48828. }
  48829. }
  48830. class Ui extends XFAObject {
  48831. constructor(attributes) {
  48832. super(TEMPLATE_NS_ID, "ui", true);
  48833. this.id = attributes.id || "";
  48834. this.use = attributes.use || "";
  48835. this.usehref = attributes.usehref || "";
  48836. this.extras = null;
  48837. this.picture = null;
  48838. this.barcode = null;
  48839. this.button = null;
  48840. this.checkButton = null;
  48841. this.choiceList = null;
  48842. this.dateTimeEdit = null;
  48843. this.defaultUi = null;
  48844. this.imageEdit = null;
  48845. this.numericEdit = null;
  48846. this.passwordEdit = null;
  48847. this.signature = null;
  48848. this.textEdit = null;
  48849. }
  48850. [$getExtra]() {
  48851. if (this[$extra] === undefined) {
  48852. for (const name of Object.getOwnPropertyNames(this)) {
  48853. if (name === "extras" || name === "picture") {
  48854. continue;
  48855. }
  48856. const obj = this[name];
  48857. if (!(obj instanceof XFAObject)) {
  48858. continue;
  48859. }
  48860. this[$extra] = obj;
  48861. return obj;
  48862. }
  48863. this[$extra] = null;
  48864. }
  48865. return this[$extra];
  48866. }
  48867. [$toHTML](availableSpace) {
  48868. const obj = this[$getExtra]();
  48869. if (obj) {
  48870. return obj[$toHTML](availableSpace);
  48871. }
  48872. return HTMLResult.EMPTY;
  48873. }
  48874. }
  48875. class Validate extends XFAObject {
  48876. constructor(attributes) {
  48877. super(TEMPLATE_NS_ID, "validate", true);
  48878. this.formatTest = getStringOption(attributes.formatTest, ["warning", "disabled", "error"]);
  48879. this.id = attributes.id || "";
  48880. this.nullTest = getStringOption(attributes.nullTest, ["disabled", "error", "warning"]);
  48881. this.scriptTest = getStringOption(attributes.scriptTest, ["error", "disabled", "warning"]);
  48882. this.use = attributes.use || "";
  48883. this.usehref = attributes.usehref || "";
  48884. this.extras = null;
  48885. this.message = null;
  48886. this.picture = null;
  48887. this.script = null;
  48888. }
  48889. }
  48890. class Value extends XFAObject {
  48891. constructor(attributes) {
  48892. super(TEMPLATE_NS_ID, "value", true);
  48893. this.id = attributes.id || "";
  48894. this.override = getInteger({
  48895. data: attributes.override,
  48896. defaultValue: 0,
  48897. validate: x => x === 1
  48898. });
  48899. this.relevant = getRelevant(attributes.relevant);
  48900. this.use = attributes.use || "";
  48901. this.usehref = attributes.usehref || "";
  48902. this.arc = null;
  48903. this.boolean = null;
  48904. this.date = null;
  48905. this.dateTime = null;
  48906. this.decimal = null;
  48907. this.exData = null;
  48908. this.float = null;
  48909. this.image = null;
  48910. this.integer = null;
  48911. this.line = null;
  48912. this.rectangle = null;
  48913. this.text = null;
  48914. this.time = null;
  48915. }
  48916. [$setValue](value) {
  48917. const parent = this[$getParent]();
  48918. if (parent instanceof Field) {
  48919. if (parent.ui?.imageEdit) {
  48920. if (!this.image) {
  48921. this.image = new Image({});
  48922. this[$appendChild](this.image);
  48923. }
  48924. this.image[$content] = value[$content];
  48925. return;
  48926. }
  48927. }
  48928. const valueName = value[$nodeName];
  48929. if (this[valueName] !== null) {
  48930. this[valueName][$content] = value[$content];
  48931. return;
  48932. }
  48933. for (const name of Object.getOwnPropertyNames(this)) {
  48934. const obj = this[name];
  48935. if (obj instanceof XFAObject) {
  48936. this[name] = null;
  48937. this[$removeChild](obj);
  48938. }
  48939. }
  48940. this[value[$nodeName]] = value;
  48941. this[$appendChild](value);
  48942. }
  48943. [$text]() {
  48944. if (this.exData) {
  48945. if (typeof this.exData[$content] === "string") {
  48946. return this.exData[$content].trim();
  48947. }
  48948. return this.exData[$content][$text]().trim();
  48949. }
  48950. for (const name of Object.getOwnPropertyNames(this)) {
  48951. if (name === "image") {
  48952. continue;
  48953. }
  48954. const obj = this[name];
  48955. if (obj instanceof XFAObject) {
  48956. return (obj[$content] || "").toString().trim();
  48957. }
  48958. }
  48959. return null;
  48960. }
  48961. [$toHTML](availableSpace) {
  48962. for (const name of Object.getOwnPropertyNames(this)) {
  48963. const obj = this[name];
  48964. if (!(obj instanceof XFAObject)) {
  48965. continue;
  48966. }
  48967. return obj[$toHTML](availableSpace);
  48968. }
  48969. return HTMLResult.EMPTY;
  48970. }
  48971. }
  48972. class Variables extends XFAObject {
  48973. constructor(attributes) {
  48974. super(TEMPLATE_NS_ID, "variables", true);
  48975. this.id = attributes.id || "";
  48976. this.use = attributes.use || "";
  48977. this.usehref = attributes.usehref || "";
  48978. this.boolean = new XFAObjectArray();
  48979. this.date = new XFAObjectArray();
  48980. this.dateTime = new XFAObjectArray();
  48981. this.decimal = new XFAObjectArray();
  48982. this.exData = new XFAObjectArray();
  48983. this.float = new XFAObjectArray();
  48984. this.image = new XFAObjectArray();
  48985. this.integer = new XFAObjectArray();
  48986. this.manifest = new XFAObjectArray();
  48987. this.script = new XFAObjectArray();
  48988. this.text = new XFAObjectArray();
  48989. this.time = new XFAObjectArray();
  48990. }
  48991. [$isTransparent]() {
  48992. return true;
  48993. }
  48994. }
  48995. class TemplateNamespace {
  48996. static [$buildXFAObject](name, attributes) {
  48997. if (TemplateNamespace.hasOwnProperty(name)) {
  48998. const node = TemplateNamespace[name](attributes);
  48999. node[$setSetAttributes](attributes);
  49000. return node;
  49001. }
  49002. return undefined;
  49003. }
  49004. static appearanceFilter(attrs) {
  49005. return new AppearanceFilter(attrs);
  49006. }
  49007. static arc(attrs) {
  49008. return new Arc(attrs);
  49009. }
  49010. static area(attrs) {
  49011. return new Area(attrs);
  49012. }
  49013. static assist(attrs) {
  49014. return new Assist(attrs);
  49015. }
  49016. static barcode(attrs) {
  49017. return new Barcode(attrs);
  49018. }
  49019. static bind(attrs) {
  49020. return new Bind(attrs);
  49021. }
  49022. static bindItems(attrs) {
  49023. return new BindItems(attrs);
  49024. }
  49025. static bookend(attrs) {
  49026. return new Bookend(attrs);
  49027. }
  49028. static boolean(attrs) {
  49029. return new BooleanElement(attrs);
  49030. }
  49031. static border(attrs) {
  49032. return new Border(attrs);
  49033. }
  49034. static break(attrs) {
  49035. return new Break(attrs);
  49036. }
  49037. static breakAfter(attrs) {
  49038. return new BreakAfter(attrs);
  49039. }
  49040. static breakBefore(attrs) {
  49041. return new BreakBefore(attrs);
  49042. }
  49043. static button(attrs) {
  49044. return new Button(attrs);
  49045. }
  49046. static calculate(attrs) {
  49047. return new Calculate(attrs);
  49048. }
  49049. static caption(attrs) {
  49050. return new Caption(attrs);
  49051. }
  49052. static certificate(attrs) {
  49053. return new Certificate(attrs);
  49054. }
  49055. static certificates(attrs) {
  49056. return new Certificates(attrs);
  49057. }
  49058. static checkButton(attrs) {
  49059. return new CheckButton(attrs);
  49060. }
  49061. static choiceList(attrs) {
  49062. return new ChoiceList(attrs);
  49063. }
  49064. static color(attrs) {
  49065. return new Color(attrs);
  49066. }
  49067. static comb(attrs) {
  49068. return new Comb(attrs);
  49069. }
  49070. static connect(attrs) {
  49071. return new Connect(attrs);
  49072. }
  49073. static contentArea(attrs) {
  49074. return new ContentArea(attrs);
  49075. }
  49076. static corner(attrs) {
  49077. return new Corner(attrs);
  49078. }
  49079. static date(attrs) {
  49080. return new DateElement(attrs);
  49081. }
  49082. static dateTime(attrs) {
  49083. return new DateTime(attrs);
  49084. }
  49085. static dateTimeEdit(attrs) {
  49086. return new DateTimeEdit(attrs);
  49087. }
  49088. static decimal(attrs) {
  49089. return new Decimal(attrs);
  49090. }
  49091. static defaultUi(attrs) {
  49092. return new DefaultUi(attrs);
  49093. }
  49094. static desc(attrs) {
  49095. return new Desc(attrs);
  49096. }
  49097. static digestMethod(attrs) {
  49098. return new DigestMethod(attrs);
  49099. }
  49100. static digestMethods(attrs) {
  49101. return new DigestMethods(attrs);
  49102. }
  49103. static draw(attrs) {
  49104. return new Draw(attrs);
  49105. }
  49106. static edge(attrs) {
  49107. return new Edge(attrs);
  49108. }
  49109. static encoding(attrs) {
  49110. return new Encoding(attrs);
  49111. }
  49112. static encodings(attrs) {
  49113. return new Encodings(attrs);
  49114. }
  49115. static encrypt(attrs) {
  49116. return new Encrypt(attrs);
  49117. }
  49118. static encryptData(attrs) {
  49119. return new EncryptData(attrs);
  49120. }
  49121. static encryption(attrs) {
  49122. return new Encryption(attrs);
  49123. }
  49124. static encryptionMethod(attrs) {
  49125. return new EncryptionMethod(attrs);
  49126. }
  49127. static encryptionMethods(attrs) {
  49128. return new EncryptionMethods(attrs);
  49129. }
  49130. static event(attrs) {
  49131. return new Event(attrs);
  49132. }
  49133. static exData(attrs) {
  49134. return new ExData(attrs);
  49135. }
  49136. static exObject(attrs) {
  49137. return new ExObject(attrs);
  49138. }
  49139. static exclGroup(attrs) {
  49140. return new ExclGroup(attrs);
  49141. }
  49142. static execute(attrs) {
  49143. return new Execute(attrs);
  49144. }
  49145. static extras(attrs) {
  49146. return new Extras(attrs);
  49147. }
  49148. static field(attrs) {
  49149. return new Field(attrs);
  49150. }
  49151. static fill(attrs) {
  49152. return new Fill(attrs);
  49153. }
  49154. static filter(attrs) {
  49155. return new Filter(attrs);
  49156. }
  49157. static float(attrs) {
  49158. return new Float(attrs);
  49159. }
  49160. static font(attrs) {
  49161. return new template_Font(attrs);
  49162. }
  49163. static format(attrs) {
  49164. return new Format(attrs);
  49165. }
  49166. static handler(attrs) {
  49167. return new Handler(attrs);
  49168. }
  49169. static hyphenation(attrs) {
  49170. return new Hyphenation(attrs);
  49171. }
  49172. static image(attrs) {
  49173. return new Image(attrs);
  49174. }
  49175. static imageEdit(attrs) {
  49176. return new ImageEdit(attrs);
  49177. }
  49178. static integer(attrs) {
  49179. return new Integer(attrs);
  49180. }
  49181. static issuers(attrs) {
  49182. return new Issuers(attrs);
  49183. }
  49184. static items(attrs) {
  49185. return new Items(attrs);
  49186. }
  49187. static keep(attrs) {
  49188. return new Keep(attrs);
  49189. }
  49190. static keyUsage(attrs) {
  49191. return new KeyUsage(attrs);
  49192. }
  49193. static line(attrs) {
  49194. return new Line(attrs);
  49195. }
  49196. static linear(attrs) {
  49197. return new Linear(attrs);
  49198. }
  49199. static lockDocument(attrs) {
  49200. return new LockDocument(attrs);
  49201. }
  49202. static manifest(attrs) {
  49203. return new Manifest(attrs);
  49204. }
  49205. static margin(attrs) {
  49206. return new Margin(attrs);
  49207. }
  49208. static mdp(attrs) {
  49209. return new Mdp(attrs);
  49210. }
  49211. static medium(attrs) {
  49212. return new Medium(attrs);
  49213. }
  49214. static message(attrs) {
  49215. return new Message(attrs);
  49216. }
  49217. static numericEdit(attrs) {
  49218. return new NumericEdit(attrs);
  49219. }
  49220. static occur(attrs) {
  49221. return new Occur(attrs);
  49222. }
  49223. static oid(attrs) {
  49224. return new Oid(attrs);
  49225. }
  49226. static oids(attrs) {
  49227. return new Oids(attrs);
  49228. }
  49229. static overflow(attrs) {
  49230. return new Overflow(attrs);
  49231. }
  49232. static pageArea(attrs) {
  49233. return new PageArea(attrs);
  49234. }
  49235. static pageSet(attrs) {
  49236. return new PageSet(attrs);
  49237. }
  49238. static para(attrs) {
  49239. return new Para(attrs);
  49240. }
  49241. static passwordEdit(attrs) {
  49242. return new PasswordEdit(attrs);
  49243. }
  49244. static pattern(attrs) {
  49245. return new template_Pattern(attrs);
  49246. }
  49247. static picture(attrs) {
  49248. return new Picture(attrs);
  49249. }
  49250. static proto(attrs) {
  49251. return new Proto(attrs);
  49252. }
  49253. static radial(attrs) {
  49254. return new Radial(attrs);
  49255. }
  49256. static reason(attrs) {
  49257. return new Reason(attrs);
  49258. }
  49259. static reasons(attrs) {
  49260. return new Reasons(attrs);
  49261. }
  49262. static rectangle(attrs) {
  49263. return new Rectangle(attrs);
  49264. }
  49265. static ref(attrs) {
  49266. return new RefElement(attrs);
  49267. }
  49268. static script(attrs) {
  49269. return new Script(attrs);
  49270. }
  49271. static setProperty(attrs) {
  49272. return new SetProperty(attrs);
  49273. }
  49274. static signData(attrs) {
  49275. return new SignData(attrs);
  49276. }
  49277. static signature(attrs) {
  49278. return new Signature(attrs);
  49279. }
  49280. static signing(attrs) {
  49281. return new Signing(attrs);
  49282. }
  49283. static solid(attrs) {
  49284. return new Solid(attrs);
  49285. }
  49286. static speak(attrs) {
  49287. return new Speak(attrs);
  49288. }
  49289. static stipple(attrs) {
  49290. return new Stipple(attrs);
  49291. }
  49292. static subform(attrs) {
  49293. return new Subform(attrs);
  49294. }
  49295. static subformSet(attrs) {
  49296. return new SubformSet(attrs);
  49297. }
  49298. static subjectDN(attrs) {
  49299. return new SubjectDN(attrs);
  49300. }
  49301. static subjectDNs(attrs) {
  49302. return new SubjectDNs(attrs);
  49303. }
  49304. static submit(attrs) {
  49305. return new Submit(attrs);
  49306. }
  49307. static template(attrs) {
  49308. return new Template(attrs);
  49309. }
  49310. static text(attrs) {
  49311. return new Text(attrs);
  49312. }
  49313. static textEdit(attrs) {
  49314. return new TextEdit(attrs);
  49315. }
  49316. static time(attrs) {
  49317. return new Time(attrs);
  49318. }
  49319. static timeStamp(attrs) {
  49320. return new TimeStamp(attrs);
  49321. }
  49322. static toolTip(attrs) {
  49323. return new ToolTip(attrs);
  49324. }
  49325. static traversal(attrs) {
  49326. return new Traversal(attrs);
  49327. }
  49328. static traverse(attrs) {
  49329. return new Traverse(attrs);
  49330. }
  49331. static ui(attrs) {
  49332. return new Ui(attrs);
  49333. }
  49334. static validate(attrs) {
  49335. return new Validate(attrs);
  49336. }
  49337. static value(attrs) {
  49338. return new Value(attrs);
  49339. }
  49340. static variables(attrs) {
  49341. return new Variables(attrs);
  49342. }
  49343. }
  49344. ;// ./src/core/xfa/bind.js
  49345. const bind_NS_DATASETS = NamespaceIds.datasets.id;
  49346. function createText(content) {
  49347. const node = new Text({});
  49348. node[$content] = content;
  49349. return node;
  49350. }
  49351. class Binder {
  49352. constructor(root) {
  49353. this.root = root;
  49354. this.datasets = root.datasets;
  49355. this.data = root.datasets?.data || new XmlObject(NamespaceIds.datasets.id, "data");
  49356. this.emptyMerge = this.data[$getChildren]().length === 0;
  49357. this.root.form = this.form = root.template[$clone]();
  49358. }
  49359. _isConsumeData() {
  49360. return !this.emptyMerge && this._mergeMode;
  49361. }
  49362. _isMatchTemplate() {
  49363. return !this._isConsumeData();
  49364. }
  49365. bind() {
  49366. this._bindElement(this.form, this.data);
  49367. return this.form;
  49368. }
  49369. getData() {
  49370. return this.data;
  49371. }
  49372. _bindValue(formNode, data, picture) {
  49373. formNode[$data] = data;
  49374. if (formNode[$hasSettableValue]()) {
  49375. if (data[$isDataValue]()) {
  49376. const value = data[$getDataValue]();
  49377. formNode[$setValue](createText(value));
  49378. } else if (formNode instanceof Field && formNode.ui?.choiceList?.open === "multiSelect") {
  49379. const value = data[$getChildren]().map(child => child[$content].trim()).join("\n");
  49380. formNode[$setValue](createText(value));
  49381. } else if (this._isConsumeData()) {
  49382. warn(`XFA - Nodes haven't the same type.`);
  49383. }
  49384. } else if (!data[$isDataValue]() || this._isMatchTemplate()) {
  49385. this._bindElement(formNode, data);
  49386. } else {
  49387. warn(`XFA - Nodes haven't the same type.`);
  49388. }
  49389. }
  49390. _findDataByNameToConsume(name, isValue, dataNode, global) {
  49391. if (!name) {
  49392. return null;
  49393. }
  49394. let generator, match;
  49395. for (let i = 0; i < 3; i++) {
  49396. generator = dataNode[$getRealChildrenByNameIt](name, false, true);
  49397. while (true) {
  49398. match = generator.next().value;
  49399. if (!match) {
  49400. break;
  49401. }
  49402. if (isValue === match[$isDataValue]()) {
  49403. return match;
  49404. }
  49405. }
  49406. if (dataNode[$namespaceId] === NamespaceIds.datasets.id && dataNode[$nodeName] === "data") {
  49407. break;
  49408. }
  49409. dataNode = dataNode[$getParent]();
  49410. }
  49411. if (!global) {
  49412. return null;
  49413. }
  49414. generator = this.data[$getRealChildrenByNameIt](name, true, false);
  49415. match = generator.next().value;
  49416. if (match) {
  49417. return match;
  49418. }
  49419. generator = this.data[$getAttributeIt](name, true);
  49420. match = generator.next().value;
  49421. if (match?.[$isDataValue]()) {
  49422. return match;
  49423. }
  49424. return null;
  49425. }
  49426. _setProperties(formNode, dataNode) {
  49427. if (!formNode.hasOwnProperty("setProperty")) {
  49428. return;
  49429. }
  49430. for (const {
  49431. ref,
  49432. target,
  49433. connection
  49434. } of formNode.setProperty.children) {
  49435. if (connection) {
  49436. continue;
  49437. }
  49438. if (!ref) {
  49439. continue;
  49440. }
  49441. const nodes = searchNode(this.root, dataNode, ref, false, false);
  49442. if (!nodes) {
  49443. warn(`XFA - Invalid reference: ${ref}.`);
  49444. continue;
  49445. }
  49446. const [node] = nodes;
  49447. if (!node[$isDescendent](this.data)) {
  49448. warn(`XFA - Invalid node: must be a data node.`);
  49449. continue;
  49450. }
  49451. const targetNodes = searchNode(this.root, formNode, target, false, false);
  49452. if (!targetNodes) {
  49453. warn(`XFA - Invalid target: ${target}.`);
  49454. continue;
  49455. }
  49456. const [targetNode] = targetNodes;
  49457. if (!targetNode[$isDescendent](formNode)) {
  49458. warn(`XFA - Invalid target: must be a property or subproperty.`);
  49459. continue;
  49460. }
  49461. const targetParent = targetNode[$getParent]();
  49462. if (targetNode instanceof SetProperty || targetParent instanceof SetProperty) {
  49463. warn(`XFA - Invalid target: cannot be a setProperty or one of its properties.`);
  49464. continue;
  49465. }
  49466. if (targetNode instanceof BindItems || targetParent instanceof BindItems) {
  49467. warn(`XFA - Invalid target: cannot be a bindItems or one of its properties.`);
  49468. continue;
  49469. }
  49470. const content = node[$text]();
  49471. const name = targetNode[$nodeName];
  49472. if (targetNode instanceof XFAAttribute) {
  49473. const attrs = Object.create(null);
  49474. attrs[name] = content;
  49475. const obj = Reflect.construct(Object.getPrototypeOf(targetParent).constructor, [attrs]);
  49476. targetParent[name] = obj[name];
  49477. continue;
  49478. }
  49479. if (!targetNode.hasOwnProperty($content)) {
  49480. warn(`XFA - Invalid node to use in setProperty`);
  49481. continue;
  49482. }
  49483. targetNode[$data] = node;
  49484. targetNode[$content] = content;
  49485. targetNode[$finalize]();
  49486. }
  49487. }
  49488. _bindItems(formNode, dataNode) {
  49489. if (!formNode.hasOwnProperty("items") || !formNode.hasOwnProperty("bindItems") || formNode.bindItems.isEmpty()) {
  49490. return;
  49491. }
  49492. for (const item of formNode.items.children) {
  49493. formNode[$removeChild](item);
  49494. }
  49495. formNode.items.clear();
  49496. const labels = new Items({});
  49497. const values = new Items({});
  49498. formNode[$appendChild](labels);
  49499. formNode.items.push(labels);
  49500. formNode[$appendChild](values);
  49501. formNode.items.push(values);
  49502. for (const {
  49503. ref,
  49504. labelRef,
  49505. valueRef,
  49506. connection
  49507. } of formNode.bindItems.children) {
  49508. if (connection) {
  49509. continue;
  49510. }
  49511. if (!ref) {
  49512. continue;
  49513. }
  49514. const nodes = searchNode(this.root, dataNode, ref, false, false);
  49515. if (!nodes) {
  49516. warn(`XFA - Invalid reference: ${ref}.`);
  49517. continue;
  49518. }
  49519. for (const node of nodes) {
  49520. if (!node[$isDescendent](this.datasets)) {
  49521. warn(`XFA - Invalid ref (${ref}): must be a datasets child.`);
  49522. continue;
  49523. }
  49524. const labelNodes = searchNode(this.root, node, labelRef, true, false);
  49525. if (!labelNodes) {
  49526. warn(`XFA - Invalid label: ${labelRef}.`);
  49527. continue;
  49528. }
  49529. const [labelNode] = labelNodes;
  49530. if (!labelNode[$isDescendent](this.datasets)) {
  49531. warn(`XFA - Invalid label: must be a datasets child.`);
  49532. continue;
  49533. }
  49534. const valueNodes = searchNode(this.root, node, valueRef, true, false);
  49535. if (!valueNodes) {
  49536. warn(`XFA - Invalid value: ${valueRef}.`);
  49537. continue;
  49538. }
  49539. const [valueNode] = valueNodes;
  49540. if (!valueNode[$isDescendent](this.datasets)) {
  49541. warn(`XFA - Invalid value: must be a datasets child.`);
  49542. continue;
  49543. }
  49544. const label = createText(labelNode[$text]());
  49545. const value = createText(valueNode[$text]());
  49546. labels[$appendChild](label);
  49547. labels.text.push(label);
  49548. values[$appendChild](value);
  49549. values.text.push(value);
  49550. }
  49551. }
  49552. }
  49553. _bindOccurrences(formNode, matches, picture) {
  49554. let baseClone;
  49555. if (matches.length > 1) {
  49556. baseClone = formNode[$clone]();
  49557. baseClone[$removeChild](baseClone.occur);
  49558. baseClone.occur = null;
  49559. }
  49560. this._bindValue(formNode, matches[0], picture);
  49561. this._setProperties(formNode, matches[0]);
  49562. this._bindItems(formNode, matches[0]);
  49563. if (matches.length === 1) {
  49564. return;
  49565. }
  49566. const parent = formNode[$getParent]();
  49567. const name = formNode[$nodeName];
  49568. const pos = parent[$indexOf](formNode);
  49569. for (let i = 1, ii = matches.length; i < ii; i++) {
  49570. const match = matches[i];
  49571. const clone = baseClone[$clone]();
  49572. parent[name].push(clone);
  49573. parent[$insertAt](pos + i, clone);
  49574. this._bindValue(clone, match, picture);
  49575. this._setProperties(clone, match);
  49576. this._bindItems(clone, match);
  49577. }
  49578. }
  49579. _createOccurrences(formNode) {
  49580. if (!this.emptyMerge) {
  49581. return;
  49582. }
  49583. const {
  49584. occur
  49585. } = formNode;
  49586. if (!occur || occur.initial <= 1) {
  49587. return;
  49588. }
  49589. const parent = formNode[$getParent]();
  49590. const name = formNode[$nodeName];
  49591. if (!(parent[name] instanceof XFAObjectArray)) {
  49592. return;
  49593. }
  49594. let currentNumber;
  49595. if (formNode.name) {
  49596. currentNumber = parent[name].children.filter(e => e.name === formNode.name).length;
  49597. } else {
  49598. currentNumber = parent[name].children.length;
  49599. }
  49600. const pos = parent[$indexOf](formNode) + 1;
  49601. const ii = occur.initial - currentNumber;
  49602. if (ii) {
  49603. const nodeClone = formNode[$clone]();
  49604. nodeClone[$removeChild](nodeClone.occur);
  49605. nodeClone.occur = null;
  49606. parent[name].push(nodeClone);
  49607. parent[$insertAt](pos, nodeClone);
  49608. for (let i = 1; i < ii; i++) {
  49609. const clone = nodeClone[$clone]();
  49610. parent[name].push(clone);
  49611. parent[$insertAt](pos + i, clone);
  49612. }
  49613. }
  49614. }
  49615. _getOccurInfo(formNode) {
  49616. const {
  49617. name,
  49618. occur
  49619. } = formNode;
  49620. if (!occur || !name) {
  49621. return [1, 1];
  49622. }
  49623. const max = occur.max === -1 ? Infinity : occur.max;
  49624. return [occur.min, max];
  49625. }
  49626. _setAndBind(formNode, dataNode) {
  49627. this._setProperties(formNode, dataNode);
  49628. this._bindItems(formNode, dataNode);
  49629. this._bindElement(formNode, dataNode);
  49630. }
  49631. _bindElement(formNode, dataNode) {
  49632. const uselessNodes = [];
  49633. this._createOccurrences(formNode);
  49634. for (const child of formNode[$getChildren]()) {
  49635. if (child[$data]) {
  49636. continue;
  49637. }
  49638. if (this._mergeMode === undefined && child[$nodeName] === "subform") {
  49639. this._mergeMode = child.mergeMode === "consumeData";
  49640. const dataChildren = dataNode[$getChildren]();
  49641. if (dataChildren.length > 0) {
  49642. this._bindOccurrences(child, [dataChildren[0]], null);
  49643. } else if (this.emptyMerge) {
  49644. const nsId = dataNode[$namespaceId] === bind_NS_DATASETS ? -1 : dataNode[$namespaceId];
  49645. const dataChild = child[$data] = new XmlObject(nsId, child.name || "root");
  49646. dataNode[$appendChild](dataChild);
  49647. this._bindElement(child, dataChild);
  49648. }
  49649. continue;
  49650. }
  49651. if (!child[$isBindable]()) {
  49652. continue;
  49653. }
  49654. let global = false;
  49655. let picture = null;
  49656. let ref = null;
  49657. let match = null;
  49658. if (child.bind) {
  49659. switch (child.bind.match) {
  49660. case "none":
  49661. this._setAndBind(child, dataNode);
  49662. continue;
  49663. case "global":
  49664. global = true;
  49665. break;
  49666. case "dataRef":
  49667. if (!child.bind.ref) {
  49668. warn(`XFA - ref is empty in node ${child[$nodeName]}.`);
  49669. this._setAndBind(child, dataNode);
  49670. continue;
  49671. }
  49672. ref = child.bind.ref;
  49673. break;
  49674. default:
  49675. break;
  49676. }
  49677. if (child.bind.picture) {
  49678. picture = child.bind.picture[$content];
  49679. }
  49680. }
  49681. const [min, max] = this._getOccurInfo(child);
  49682. if (ref) {
  49683. match = searchNode(this.root, dataNode, ref, true, false);
  49684. if (match === null) {
  49685. match = createDataNode(this.data, dataNode, ref);
  49686. if (!match) {
  49687. continue;
  49688. }
  49689. if (this._isConsumeData()) {
  49690. match[$consumed] = true;
  49691. }
  49692. this._setAndBind(child, match);
  49693. continue;
  49694. } else {
  49695. if (this._isConsumeData()) {
  49696. match = match.filter(node => !node[$consumed]);
  49697. }
  49698. if (match.length > max) {
  49699. match = match.slice(0, max);
  49700. } else if (match.length === 0) {
  49701. match = null;
  49702. }
  49703. if (match && this._isConsumeData()) {
  49704. match.forEach(node => {
  49705. node[$consumed] = true;
  49706. });
  49707. }
  49708. }
  49709. } else {
  49710. if (!child.name) {
  49711. this._setAndBind(child, dataNode);
  49712. continue;
  49713. }
  49714. if (this._isConsumeData()) {
  49715. const matches = [];
  49716. while (matches.length < max) {
  49717. const found = this._findDataByNameToConsume(child.name, child[$hasSettableValue](), dataNode, global);
  49718. if (!found) {
  49719. break;
  49720. }
  49721. found[$consumed] = true;
  49722. matches.push(found);
  49723. }
  49724. match = matches.length > 0 ? matches : null;
  49725. } else {
  49726. match = dataNode[$getRealChildrenByNameIt](child.name, false, this.emptyMerge).next().value;
  49727. if (!match) {
  49728. if (min === 0) {
  49729. uselessNodes.push(child);
  49730. continue;
  49731. }
  49732. const nsId = dataNode[$namespaceId] === bind_NS_DATASETS ? -1 : dataNode[$namespaceId];
  49733. match = child[$data] = new XmlObject(nsId, child.name);
  49734. if (this.emptyMerge) {
  49735. match[$consumed] = true;
  49736. }
  49737. dataNode[$appendChild](match);
  49738. this._setAndBind(child, match);
  49739. continue;
  49740. }
  49741. if (this.emptyMerge) {
  49742. match[$consumed] = true;
  49743. }
  49744. match = [match];
  49745. }
  49746. }
  49747. if (match) {
  49748. this._bindOccurrences(child, match, picture);
  49749. } else if (min > 0) {
  49750. this._setAndBind(child, dataNode);
  49751. } else {
  49752. uselessNodes.push(child);
  49753. }
  49754. }
  49755. uselessNodes.forEach(node => node[$getParent]()[$removeChild](node));
  49756. }
  49757. }
  49758. ;// ./src/core/xfa/data.js
  49759. class DataHandler {
  49760. constructor(root, data) {
  49761. this.data = data;
  49762. this.dataset = root.datasets || null;
  49763. }
  49764. serialize(storage) {
  49765. const stack = [[-1, this.data[$getChildren]()]];
  49766. while (stack.length > 0) {
  49767. const last = stack.at(-1);
  49768. const [i, children] = last;
  49769. if (i + 1 === children.length) {
  49770. stack.pop();
  49771. continue;
  49772. }
  49773. const child = children[++last[0]];
  49774. const storageEntry = storage.get(child[$uid]);
  49775. if (storageEntry) {
  49776. child[$setValue](storageEntry);
  49777. } else {
  49778. const attributes = child[$getAttributes]();
  49779. for (const value of attributes.values()) {
  49780. const entry = storage.get(value[$uid]);
  49781. if (entry) {
  49782. value[$setValue](entry);
  49783. break;
  49784. }
  49785. }
  49786. }
  49787. const nodes = child[$getChildren]();
  49788. if (nodes.length > 0) {
  49789. stack.push([-1, nodes]);
  49790. }
  49791. }
  49792. const buf = [`<xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">`];
  49793. if (this.dataset) {
  49794. for (const child of this.dataset[$getChildren]()) {
  49795. if (child[$nodeName] !== "data") {
  49796. child[$toString](buf);
  49797. }
  49798. }
  49799. }
  49800. this.data[$toString](buf);
  49801. buf.push("</xfa:datasets>");
  49802. return buf.join("");
  49803. }
  49804. }
  49805. ;// ./src/core/xfa/config.js
  49806. const CONFIG_NS_ID = NamespaceIds.config.id;
  49807. class Acrobat extends XFAObject {
  49808. constructor(attributes) {
  49809. super(CONFIG_NS_ID, "acrobat", true);
  49810. this.acrobat7 = null;
  49811. this.autoSave = null;
  49812. this.common = null;
  49813. this.validate = null;
  49814. this.validateApprovalSignatures = null;
  49815. this.submitUrl = new XFAObjectArray();
  49816. }
  49817. }
  49818. class Acrobat7 extends XFAObject {
  49819. constructor(attributes) {
  49820. super(CONFIG_NS_ID, "acrobat7", true);
  49821. this.dynamicRender = null;
  49822. }
  49823. }
  49824. class ADBE_JSConsole extends OptionObject {
  49825. constructor(attributes) {
  49826. super(CONFIG_NS_ID, "ADBE_JSConsole", ["delegate", "Enable", "Disable"]);
  49827. }
  49828. }
  49829. class ADBE_JSDebugger extends OptionObject {
  49830. constructor(attributes) {
  49831. super(CONFIG_NS_ID, "ADBE_JSDebugger", ["delegate", "Enable", "Disable"]);
  49832. }
  49833. }
  49834. class AddSilentPrint extends Option01 {
  49835. constructor(attributes) {
  49836. super(CONFIG_NS_ID, "addSilentPrint");
  49837. }
  49838. }
  49839. class AddViewerPreferences extends Option01 {
  49840. constructor(attributes) {
  49841. super(CONFIG_NS_ID, "addViewerPreferences");
  49842. }
  49843. }
  49844. class AdjustData extends Option10 {
  49845. constructor(attributes) {
  49846. super(CONFIG_NS_ID, "adjustData");
  49847. }
  49848. }
  49849. class AdobeExtensionLevel extends IntegerObject {
  49850. constructor(attributes) {
  49851. super(CONFIG_NS_ID, "adobeExtensionLevel", 0, n => n >= 1 && n <= 8);
  49852. }
  49853. }
  49854. class Agent extends XFAObject {
  49855. constructor(attributes) {
  49856. super(CONFIG_NS_ID, "agent", true);
  49857. this.name = attributes.name ? attributes.name.trim() : "";
  49858. this.common = new XFAObjectArray();
  49859. }
  49860. }
  49861. class AlwaysEmbed extends ContentObject {
  49862. constructor(attributes) {
  49863. super(CONFIG_NS_ID, "alwaysEmbed");
  49864. }
  49865. }
  49866. class Amd extends StringObject {
  49867. constructor(attributes) {
  49868. super(CONFIG_NS_ID, "amd");
  49869. }
  49870. }
  49871. class config_Area extends XFAObject {
  49872. constructor(attributes) {
  49873. super(CONFIG_NS_ID, "area");
  49874. this.level = getInteger({
  49875. data: attributes.level,
  49876. defaultValue: 0,
  49877. validate: n => n >= 1 && n <= 3
  49878. });
  49879. this.name = getStringOption(attributes.name, ["", "barcode", "coreinit", "deviceDriver", "font", "general", "layout", "merge", "script", "signature", "sourceSet", "templateCache"]);
  49880. }
  49881. }
  49882. class Attributes extends OptionObject {
  49883. constructor(attributes) {
  49884. super(CONFIG_NS_ID, "attributes", ["preserve", "delegate", "ignore"]);
  49885. }
  49886. }
  49887. class AutoSave extends OptionObject {
  49888. constructor(attributes) {
  49889. super(CONFIG_NS_ID, "autoSave", ["disabled", "enabled"]);
  49890. }
  49891. }
  49892. class Base extends StringObject {
  49893. constructor(attributes) {
  49894. super(CONFIG_NS_ID, "base");
  49895. }
  49896. }
  49897. class BatchOutput extends XFAObject {
  49898. constructor(attributes) {
  49899. super(CONFIG_NS_ID, "batchOutput");
  49900. this.format = getStringOption(attributes.format, ["none", "concat", "zip", "zipCompress"]);
  49901. }
  49902. }
  49903. class BehaviorOverride extends ContentObject {
  49904. constructor(attributes) {
  49905. super(CONFIG_NS_ID, "behaviorOverride");
  49906. }
  49907. [$finalize]() {
  49908. this[$content] = new Map(this[$content].trim().split(/\s+/).filter(x => x.includes(":")).map(x => x.split(":", 2)));
  49909. }
  49910. }
  49911. class Cache extends XFAObject {
  49912. constructor(attributes) {
  49913. super(CONFIG_NS_ID, "cache", true);
  49914. this.templateCache = null;
  49915. }
  49916. }
  49917. class Change extends Option01 {
  49918. constructor(attributes) {
  49919. super(CONFIG_NS_ID, "change");
  49920. }
  49921. }
  49922. class Common extends XFAObject {
  49923. constructor(attributes) {
  49924. super(CONFIG_NS_ID, "common", true);
  49925. this.data = null;
  49926. this.locale = null;
  49927. this.localeSet = null;
  49928. this.messaging = null;
  49929. this.suppressBanner = null;
  49930. this.template = null;
  49931. this.validationMessaging = null;
  49932. this.versionControl = null;
  49933. this.log = new XFAObjectArray();
  49934. }
  49935. }
  49936. class Compress extends XFAObject {
  49937. constructor(attributes) {
  49938. super(CONFIG_NS_ID, "compress");
  49939. this.scope = getStringOption(attributes.scope, ["imageOnly", "document"]);
  49940. }
  49941. }
  49942. class CompressLogicalStructure extends Option01 {
  49943. constructor(attributes) {
  49944. super(CONFIG_NS_ID, "compressLogicalStructure");
  49945. }
  49946. }
  49947. class CompressObjectStream extends Option10 {
  49948. constructor(attributes) {
  49949. super(CONFIG_NS_ID, "compressObjectStream");
  49950. }
  49951. }
  49952. class Compression extends XFAObject {
  49953. constructor(attributes) {
  49954. super(CONFIG_NS_ID, "compression", true);
  49955. this.compressLogicalStructure = null;
  49956. this.compressObjectStream = null;
  49957. this.level = null;
  49958. this.type = null;
  49959. }
  49960. }
  49961. class Config extends XFAObject {
  49962. constructor(attributes) {
  49963. super(CONFIG_NS_ID, "config", true);
  49964. this.acrobat = null;
  49965. this.present = null;
  49966. this.trace = null;
  49967. this.agent = new XFAObjectArray();
  49968. }
  49969. }
  49970. class Conformance extends OptionObject {
  49971. constructor(attributes) {
  49972. super(CONFIG_NS_ID, "conformance", ["A", "B"]);
  49973. }
  49974. }
  49975. class ContentCopy extends Option01 {
  49976. constructor(attributes) {
  49977. super(CONFIG_NS_ID, "contentCopy");
  49978. }
  49979. }
  49980. class Copies extends IntegerObject {
  49981. constructor(attributes) {
  49982. super(CONFIG_NS_ID, "copies", 1, n => n >= 1);
  49983. }
  49984. }
  49985. class Creator extends StringObject {
  49986. constructor(attributes) {
  49987. super(CONFIG_NS_ID, "creator");
  49988. }
  49989. }
  49990. class CurrentPage extends IntegerObject {
  49991. constructor(attributes) {
  49992. super(CONFIG_NS_ID, "currentPage", 0, n => n >= 0);
  49993. }
  49994. }
  49995. class Data extends XFAObject {
  49996. constructor(attributes) {
  49997. super(CONFIG_NS_ID, "data", true);
  49998. this.adjustData = null;
  49999. this.attributes = null;
  50000. this.incrementalLoad = null;
  50001. this.outputXSL = null;
  50002. this.range = null;
  50003. this.record = null;
  50004. this.startNode = null;
  50005. this.uri = null;
  50006. this.window = null;
  50007. this.xsl = null;
  50008. this.excludeNS = new XFAObjectArray();
  50009. this.transform = new XFAObjectArray();
  50010. }
  50011. }
  50012. class Debug extends XFAObject {
  50013. constructor(attributes) {
  50014. super(CONFIG_NS_ID, "debug", true);
  50015. this.uri = null;
  50016. }
  50017. }
  50018. class DefaultTypeface extends ContentObject {
  50019. constructor(attributes) {
  50020. super(CONFIG_NS_ID, "defaultTypeface");
  50021. this.writingScript = getStringOption(attributes.writingScript, ["*", "Arabic", "Cyrillic", "EastEuropeanRoman", "Greek", "Hebrew", "Japanese", "Korean", "Roman", "SimplifiedChinese", "Thai", "TraditionalChinese", "Vietnamese"]);
  50022. }
  50023. }
  50024. class Destination extends OptionObject {
  50025. constructor(attributes) {
  50026. super(CONFIG_NS_ID, "destination", ["pdf", "pcl", "ps", "webClient", "zpl"]);
  50027. }
  50028. }
  50029. class DocumentAssembly extends Option01 {
  50030. constructor(attributes) {
  50031. super(CONFIG_NS_ID, "documentAssembly");
  50032. }
  50033. }
  50034. class Driver extends XFAObject {
  50035. constructor(attributes) {
  50036. super(CONFIG_NS_ID, "driver", true);
  50037. this.name = attributes.name ? attributes.name.trim() : "";
  50038. this.fontInfo = null;
  50039. this.xdc = null;
  50040. }
  50041. }
  50042. class DuplexOption extends OptionObject {
  50043. constructor(attributes) {
  50044. super(CONFIG_NS_ID, "duplexOption", ["simplex", "duplexFlipLongEdge", "duplexFlipShortEdge"]);
  50045. }
  50046. }
  50047. class DynamicRender extends OptionObject {
  50048. constructor(attributes) {
  50049. super(CONFIG_NS_ID, "dynamicRender", ["forbidden", "required"]);
  50050. }
  50051. }
  50052. class Embed extends Option01 {
  50053. constructor(attributes) {
  50054. super(CONFIG_NS_ID, "embed");
  50055. }
  50056. }
  50057. class config_Encrypt extends Option01 {
  50058. constructor(attributes) {
  50059. super(CONFIG_NS_ID, "encrypt");
  50060. }
  50061. }
  50062. class config_Encryption extends XFAObject {
  50063. constructor(attributes) {
  50064. super(CONFIG_NS_ID, "encryption", true);
  50065. this.encrypt = null;
  50066. this.encryptionLevel = null;
  50067. this.permissions = null;
  50068. }
  50069. }
  50070. class EncryptionLevel extends OptionObject {
  50071. constructor(attributes) {
  50072. super(CONFIG_NS_ID, "encryptionLevel", ["40bit", "128bit"]);
  50073. }
  50074. }
  50075. class Enforce extends StringObject {
  50076. constructor(attributes) {
  50077. super(CONFIG_NS_ID, "enforce");
  50078. }
  50079. }
  50080. class Equate extends XFAObject {
  50081. constructor(attributes) {
  50082. super(CONFIG_NS_ID, "equate");
  50083. this.force = getInteger({
  50084. data: attributes.force,
  50085. defaultValue: 1,
  50086. validate: n => n === 0
  50087. });
  50088. this.from = attributes.from || "";
  50089. this.to = attributes.to || "";
  50090. }
  50091. }
  50092. class EquateRange extends XFAObject {
  50093. constructor(attributes) {
  50094. super(CONFIG_NS_ID, "equateRange");
  50095. this.from = attributes.from || "";
  50096. this.to = attributes.to || "";
  50097. this._unicodeRange = attributes.unicodeRange || "";
  50098. }
  50099. get unicodeRange() {
  50100. const ranges = [];
  50101. const unicodeRegex = /U\+([0-9a-fA-F]+)/;
  50102. const unicodeRange = this._unicodeRange;
  50103. for (let range of unicodeRange.split(",").map(x => x.trim()).filter(x => !!x)) {
  50104. range = range.split("-", 2).map(x => {
  50105. const found = x.match(unicodeRegex);
  50106. if (!found) {
  50107. return 0;
  50108. }
  50109. return parseInt(found[1], 16);
  50110. });
  50111. if (range.length === 1) {
  50112. range.push(range[0]);
  50113. }
  50114. ranges.push(range);
  50115. }
  50116. return shadow(this, "unicodeRange", ranges);
  50117. }
  50118. }
  50119. class Exclude extends ContentObject {
  50120. constructor(attributes) {
  50121. super(CONFIG_NS_ID, "exclude");
  50122. }
  50123. [$finalize]() {
  50124. this[$content] = this[$content].trim().split(/\s+/).filter(x => x && ["calculate", "close", "enter", "exit", "initialize", "ready", "validate"].includes(x));
  50125. }
  50126. }
  50127. class ExcludeNS extends StringObject {
  50128. constructor(attributes) {
  50129. super(CONFIG_NS_ID, "excludeNS");
  50130. }
  50131. }
  50132. class FlipLabel extends OptionObject {
  50133. constructor(attributes) {
  50134. super(CONFIG_NS_ID, "flipLabel", ["usePrinterSetting", "on", "off"]);
  50135. }
  50136. }
  50137. class config_FontInfo extends XFAObject {
  50138. constructor(attributes) {
  50139. super(CONFIG_NS_ID, "fontInfo", true);
  50140. this.embed = null;
  50141. this.map = null;
  50142. this.subsetBelow = null;
  50143. this.alwaysEmbed = new XFAObjectArray();
  50144. this.defaultTypeface = new XFAObjectArray();
  50145. this.neverEmbed = new XFAObjectArray();
  50146. }
  50147. }
  50148. class FormFieldFilling extends Option01 {
  50149. constructor(attributes) {
  50150. super(CONFIG_NS_ID, "formFieldFilling");
  50151. }
  50152. }
  50153. class GroupParent extends StringObject {
  50154. constructor(attributes) {
  50155. super(CONFIG_NS_ID, "groupParent");
  50156. }
  50157. }
  50158. class IfEmpty extends OptionObject {
  50159. constructor(attributes) {
  50160. super(CONFIG_NS_ID, "ifEmpty", ["dataValue", "dataGroup", "ignore", "remove"]);
  50161. }
  50162. }
  50163. class IncludeXDPContent extends StringObject {
  50164. constructor(attributes) {
  50165. super(CONFIG_NS_ID, "includeXDPContent");
  50166. }
  50167. }
  50168. class IncrementalLoad extends OptionObject {
  50169. constructor(attributes) {
  50170. super(CONFIG_NS_ID, "incrementalLoad", ["none", "forwardOnly"]);
  50171. }
  50172. }
  50173. class IncrementalMerge extends Option01 {
  50174. constructor(attributes) {
  50175. super(CONFIG_NS_ID, "incrementalMerge");
  50176. }
  50177. }
  50178. class Interactive extends Option01 {
  50179. constructor(attributes) {
  50180. super(CONFIG_NS_ID, "interactive");
  50181. }
  50182. }
  50183. class Jog extends OptionObject {
  50184. constructor(attributes) {
  50185. super(CONFIG_NS_ID, "jog", ["usePrinterSetting", "none", "pageSet"]);
  50186. }
  50187. }
  50188. class LabelPrinter extends XFAObject {
  50189. constructor(attributes) {
  50190. super(CONFIG_NS_ID, "labelPrinter", true);
  50191. this.name = getStringOption(attributes.name, ["zpl", "dpl", "ipl", "tcpl"]);
  50192. this.batchOutput = null;
  50193. this.flipLabel = null;
  50194. this.fontInfo = null;
  50195. this.xdc = null;
  50196. }
  50197. }
  50198. class Layout extends OptionObject {
  50199. constructor(attributes) {
  50200. super(CONFIG_NS_ID, "layout", ["paginate", "panel"]);
  50201. }
  50202. }
  50203. class Level extends IntegerObject {
  50204. constructor(attributes) {
  50205. super(CONFIG_NS_ID, "level", 0, n => n > 0);
  50206. }
  50207. }
  50208. class Linearized extends Option01 {
  50209. constructor(attributes) {
  50210. super(CONFIG_NS_ID, "linearized");
  50211. }
  50212. }
  50213. class Locale extends StringObject {
  50214. constructor(attributes) {
  50215. super(CONFIG_NS_ID, "locale");
  50216. }
  50217. }
  50218. class LocaleSet extends StringObject {
  50219. constructor(attributes) {
  50220. super(CONFIG_NS_ID, "localeSet");
  50221. }
  50222. }
  50223. class Log extends XFAObject {
  50224. constructor(attributes) {
  50225. super(CONFIG_NS_ID, "log", true);
  50226. this.mode = null;
  50227. this.threshold = null;
  50228. this.to = null;
  50229. this.uri = null;
  50230. }
  50231. }
  50232. class MapElement extends XFAObject {
  50233. constructor(attributes) {
  50234. super(CONFIG_NS_ID, "map", true);
  50235. this.equate = new XFAObjectArray();
  50236. this.equateRange = new XFAObjectArray();
  50237. }
  50238. }
  50239. class MediumInfo extends XFAObject {
  50240. constructor(attributes) {
  50241. super(CONFIG_NS_ID, "mediumInfo", true);
  50242. this.map = null;
  50243. }
  50244. }
  50245. class config_Message extends XFAObject {
  50246. constructor(attributes) {
  50247. super(CONFIG_NS_ID, "message", true);
  50248. this.msgId = null;
  50249. this.severity = null;
  50250. }
  50251. }
  50252. class Messaging extends XFAObject {
  50253. constructor(attributes) {
  50254. super(CONFIG_NS_ID, "messaging", true);
  50255. this.message = new XFAObjectArray();
  50256. }
  50257. }
  50258. class Mode extends OptionObject {
  50259. constructor(attributes) {
  50260. super(CONFIG_NS_ID, "mode", ["append", "overwrite"]);
  50261. }
  50262. }
  50263. class ModifyAnnots extends Option01 {
  50264. constructor(attributes) {
  50265. super(CONFIG_NS_ID, "modifyAnnots");
  50266. }
  50267. }
  50268. class MsgId extends IntegerObject {
  50269. constructor(attributes) {
  50270. super(CONFIG_NS_ID, "msgId", 1, n => n >= 1);
  50271. }
  50272. }
  50273. class NameAttr extends StringObject {
  50274. constructor(attributes) {
  50275. super(CONFIG_NS_ID, "nameAttr");
  50276. }
  50277. }
  50278. class NeverEmbed extends ContentObject {
  50279. constructor(attributes) {
  50280. super(CONFIG_NS_ID, "neverEmbed");
  50281. }
  50282. }
  50283. class NumberOfCopies extends IntegerObject {
  50284. constructor(attributes) {
  50285. super(CONFIG_NS_ID, "numberOfCopies", null, n => n >= 2 && n <= 5);
  50286. }
  50287. }
  50288. class OpenAction extends XFAObject {
  50289. constructor(attributes) {
  50290. super(CONFIG_NS_ID, "openAction", true);
  50291. this.destination = null;
  50292. }
  50293. }
  50294. class Output extends XFAObject {
  50295. constructor(attributes) {
  50296. super(CONFIG_NS_ID, "output", true);
  50297. this.to = null;
  50298. this.type = null;
  50299. this.uri = null;
  50300. }
  50301. }
  50302. class OutputBin extends StringObject {
  50303. constructor(attributes) {
  50304. super(CONFIG_NS_ID, "outputBin");
  50305. }
  50306. }
  50307. class OutputXSL extends XFAObject {
  50308. constructor(attributes) {
  50309. super(CONFIG_NS_ID, "outputXSL", true);
  50310. this.uri = null;
  50311. }
  50312. }
  50313. class Overprint extends OptionObject {
  50314. constructor(attributes) {
  50315. super(CONFIG_NS_ID, "overprint", ["none", "both", "draw", "field"]);
  50316. }
  50317. }
  50318. class Packets extends StringObject {
  50319. constructor(attributes) {
  50320. super(CONFIG_NS_ID, "packets");
  50321. }
  50322. [$finalize]() {
  50323. if (this[$content] === "*") {
  50324. return;
  50325. }
  50326. this[$content] = this[$content].trim().split(/\s+/).filter(x => ["config", "datasets", "template", "xfdf", "xslt"].includes(x));
  50327. }
  50328. }
  50329. class PageOffset extends XFAObject {
  50330. constructor(attributes) {
  50331. super(CONFIG_NS_ID, "pageOffset");
  50332. this.x = getInteger({
  50333. data: attributes.x,
  50334. defaultValue: "useXDCSetting",
  50335. validate: n => true
  50336. });
  50337. this.y = getInteger({
  50338. data: attributes.y,
  50339. defaultValue: "useXDCSetting",
  50340. validate: n => true
  50341. });
  50342. }
  50343. }
  50344. class PageRange extends StringObject {
  50345. constructor(attributes) {
  50346. super(CONFIG_NS_ID, "pageRange");
  50347. }
  50348. [$finalize]() {
  50349. const numbers = this[$content].trim().split(/\s+/).map(x => parseInt(x, 10));
  50350. const ranges = [];
  50351. for (let i = 0, ii = numbers.length; i < ii; i += 2) {
  50352. ranges.push(numbers.slice(i, i + 2));
  50353. }
  50354. this[$content] = ranges;
  50355. }
  50356. }
  50357. class Pagination extends OptionObject {
  50358. constructor(attributes) {
  50359. super(CONFIG_NS_ID, "pagination", ["simplex", "duplexShortEdge", "duplexLongEdge"]);
  50360. }
  50361. }
  50362. class PaginationOverride extends OptionObject {
  50363. constructor(attributes) {
  50364. super(CONFIG_NS_ID, "paginationOverride", ["none", "forceDuplex", "forceDuplexLongEdge", "forceDuplexShortEdge", "forceSimplex"]);
  50365. }
  50366. }
  50367. class Part extends IntegerObject {
  50368. constructor(attributes) {
  50369. super(CONFIG_NS_ID, "part", 1, n => false);
  50370. }
  50371. }
  50372. class Pcl extends XFAObject {
  50373. constructor(attributes) {
  50374. super(CONFIG_NS_ID, "pcl", true);
  50375. this.name = attributes.name || "";
  50376. this.batchOutput = null;
  50377. this.fontInfo = null;
  50378. this.jog = null;
  50379. this.mediumInfo = null;
  50380. this.outputBin = null;
  50381. this.pageOffset = null;
  50382. this.staple = null;
  50383. this.xdc = null;
  50384. }
  50385. }
  50386. class Pdf extends XFAObject {
  50387. constructor(attributes) {
  50388. super(CONFIG_NS_ID, "pdf", true);
  50389. this.name = attributes.name || "";
  50390. this.adobeExtensionLevel = null;
  50391. this.batchOutput = null;
  50392. this.compression = null;
  50393. this.creator = null;
  50394. this.encryption = null;
  50395. this.fontInfo = null;
  50396. this.interactive = null;
  50397. this.linearized = null;
  50398. this.openAction = null;
  50399. this.pdfa = null;
  50400. this.producer = null;
  50401. this.renderPolicy = null;
  50402. this.scriptModel = null;
  50403. this.silentPrint = null;
  50404. this.submitFormat = null;
  50405. this.tagged = null;
  50406. this.version = null;
  50407. this.viewerPreferences = null;
  50408. this.xdc = null;
  50409. }
  50410. }
  50411. class Pdfa extends XFAObject {
  50412. constructor(attributes) {
  50413. super(CONFIG_NS_ID, "pdfa", true);
  50414. this.amd = null;
  50415. this.conformance = null;
  50416. this.includeXDPContent = null;
  50417. this.part = null;
  50418. }
  50419. }
  50420. class Permissions extends XFAObject {
  50421. constructor(attributes) {
  50422. super(CONFIG_NS_ID, "permissions", true);
  50423. this.accessibleContent = null;
  50424. this.change = null;
  50425. this.contentCopy = null;
  50426. this.documentAssembly = null;
  50427. this.formFieldFilling = null;
  50428. this.modifyAnnots = null;
  50429. this.plaintextMetadata = null;
  50430. this.print = null;
  50431. this.printHighQuality = null;
  50432. }
  50433. }
  50434. class PickTrayByPDFSize extends Option01 {
  50435. constructor(attributes) {
  50436. super(CONFIG_NS_ID, "pickTrayByPDFSize");
  50437. }
  50438. }
  50439. class config_Picture extends StringObject {
  50440. constructor(attributes) {
  50441. super(CONFIG_NS_ID, "picture");
  50442. }
  50443. }
  50444. class PlaintextMetadata extends Option01 {
  50445. constructor(attributes) {
  50446. super(CONFIG_NS_ID, "plaintextMetadata");
  50447. }
  50448. }
  50449. class Presence extends OptionObject {
  50450. constructor(attributes) {
  50451. super(CONFIG_NS_ID, "presence", ["preserve", "dissolve", "dissolveStructure", "ignore", "remove"]);
  50452. }
  50453. }
  50454. class Present extends XFAObject {
  50455. constructor(attributes) {
  50456. super(CONFIG_NS_ID, "present", true);
  50457. this.behaviorOverride = null;
  50458. this.cache = null;
  50459. this.common = null;
  50460. this.copies = null;
  50461. this.destination = null;
  50462. this.incrementalMerge = null;
  50463. this.layout = null;
  50464. this.output = null;
  50465. this.overprint = null;
  50466. this.pagination = null;
  50467. this.paginationOverride = null;
  50468. this.script = null;
  50469. this.validate = null;
  50470. this.xdp = null;
  50471. this.driver = new XFAObjectArray();
  50472. this.labelPrinter = new XFAObjectArray();
  50473. this.pcl = new XFAObjectArray();
  50474. this.pdf = new XFAObjectArray();
  50475. this.ps = new XFAObjectArray();
  50476. this.submitUrl = new XFAObjectArray();
  50477. this.webClient = new XFAObjectArray();
  50478. this.zpl = new XFAObjectArray();
  50479. }
  50480. }
  50481. class Print extends Option01 {
  50482. constructor(attributes) {
  50483. super(CONFIG_NS_ID, "print");
  50484. }
  50485. }
  50486. class PrintHighQuality extends Option01 {
  50487. constructor(attributes) {
  50488. super(CONFIG_NS_ID, "printHighQuality");
  50489. }
  50490. }
  50491. class PrintScaling extends OptionObject {
  50492. constructor(attributes) {
  50493. super(CONFIG_NS_ID, "printScaling", ["appdefault", "noScaling"]);
  50494. }
  50495. }
  50496. class PrinterName extends StringObject {
  50497. constructor(attributes) {
  50498. super(CONFIG_NS_ID, "printerName");
  50499. }
  50500. }
  50501. class Producer extends StringObject {
  50502. constructor(attributes) {
  50503. super(CONFIG_NS_ID, "producer");
  50504. }
  50505. }
  50506. class Ps extends XFAObject {
  50507. constructor(attributes) {
  50508. super(CONFIG_NS_ID, "ps", true);
  50509. this.name = attributes.name || "";
  50510. this.batchOutput = null;
  50511. this.fontInfo = null;
  50512. this.jog = null;
  50513. this.mediumInfo = null;
  50514. this.outputBin = null;
  50515. this.staple = null;
  50516. this.xdc = null;
  50517. }
  50518. }
  50519. class Range extends ContentObject {
  50520. constructor(attributes) {
  50521. super(CONFIG_NS_ID, "range");
  50522. }
  50523. [$finalize]() {
  50524. this[$content] = this[$content].trim().split(/\s*,\s*/, 2).map(range => range.split("-").map(x => parseInt(x.trim(), 10))).filter(range => range.every(x => !isNaN(x))).map(range => {
  50525. if (range.length === 1) {
  50526. range.push(range[0]);
  50527. }
  50528. return range;
  50529. });
  50530. }
  50531. }
  50532. class Record extends ContentObject {
  50533. constructor(attributes) {
  50534. super(CONFIG_NS_ID, "record");
  50535. }
  50536. [$finalize]() {
  50537. this[$content] = this[$content].trim();
  50538. const n = parseInt(this[$content], 10);
  50539. if (!isNaN(n) && n >= 0) {
  50540. this[$content] = n;
  50541. }
  50542. }
  50543. }
  50544. class Relevant extends ContentObject {
  50545. constructor(attributes) {
  50546. super(CONFIG_NS_ID, "relevant");
  50547. }
  50548. [$finalize]() {
  50549. this[$content] = this[$content].trim().split(/\s+/);
  50550. }
  50551. }
  50552. class Rename extends ContentObject {
  50553. constructor(attributes) {
  50554. super(CONFIG_NS_ID, "rename");
  50555. }
  50556. [$finalize]() {
  50557. this[$content] = this[$content].trim();
  50558. if (this[$content].toLowerCase().startsWith("xml") || new RegExp("[\\p{L}_][\\p{L}\\d._\\p{M}-]*", "u").test(this[$content])) {
  50559. warn("XFA - Rename: invalid XFA name");
  50560. }
  50561. }
  50562. }
  50563. class RenderPolicy extends OptionObject {
  50564. constructor(attributes) {
  50565. super(CONFIG_NS_ID, "renderPolicy", ["server", "client"]);
  50566. }
  50567. }
  50568. class RunScripts extends OptionObject {
  50569. constructor(attributes) {
  50570. super(CONFIG_NS_ID, "runScripts", ["both", "client", "none", "server"]);
  50571. }
  50572. }
  50573. class config_Script extends XFAObject {
  50574. constructor(attributes) {
  50575. super(CONFIG_NS_ID, "script", true);
  50576. this.currentPage = null;
  50577. this.exclude = null;
  50578. this.runScripts = null;
  50579. }
  50580. }
  50581. class ScriptModel extends OptionObject {
  50582. constructor(attributes) {
  50583. super(CONFIG_NS_ID, "scriptModel", ["XFA", "none"]);
  50584. }
  50585. }
  50586. class Severity extends OptionObject {
  50587. constructor(attributes) {
  50588. super(CONFIG_NS_ID, "severity", ["ignore", "error", "information", "trace", "warning"]);
  50589. }
  50590. }
  50591. class SilentPrint extends XFAObject {
  50592. constructor(attributes) {
  50593. super(CONFIG_NS_ID, "silentPrint", true);
  50594. this.addSilentPrint = null;
  50595. this.printerName = null;
  50596. }
  50597. }
  50598. class Staple extends XFAObject {
  50599. constructor(attributes) {
  50600. super(CONFIG_NS_ID, "staple");
  50601. this.mode = getStringOption(attributes.mode, ["usePrinterSetting", "on", "off"]);
  50602. }
  50603. }
  50604. class StartNode extends StringObject {
  50605. constructor(attributes) {
  50606. super(CONFIG_NS_ID, "startNode");
  50607. }
  50608. }
  50609. class StartPage extends IntegerObject {
  50610. constructor(attributes) {
  50611. super(CONFIG_NS_ID, "startPage", 0, n => true);
  50612. }
  50613. }
  50614. class SubmitFormat extends OptionObject {
  50615. constructor(attributes) {
  50616. super(CONFIG_NS_ID, "submitFormat", ["html", "delegate", "fdf", "xml", "pdf"]);
  50617. }
  50618. }
  50619. class SubmitUrl extends StringObject {
  50620. constructor(attributes) {
  50621. super(CONFIG_NS_ID, "submitUrl");
  50622. }
  50623. }
  50624. class SubsetBelow extends IntegerObject {
  50625. constructor(attributes) {
  50626. super(CONFIG_NS_ID, "subsetBelow", 100, n => n >= 0 && n <= 100);
  50627. }
  50628. }
  50629. class SuppressBanner extends Option01 {
  50630. constructor(attributes) {
  50631. super(CONFIG_NS_ID, "suppressBanner");
  50632. }
  50633. }
  50634. class Tagged extends Option01 {
  50635. constructor(attributes) {
  50636. super(CONFIG_NS_ID, "tagged");
  50637. }
  50638. }
  50639. class config_Template extends XFAObject {
  50640. constructor(attributes) {
  50641. super(CONFIG_NS_ID, "template", true);
  50642. this.base = null;
  50643. this.relevant = null;
  50644. this.startPage = null;
  50645. this.uri = null;
  50646. this.xsl = null;
  50647. }
  50648. }
  50649. class Threshold extends OptionObject {
  50650. constructor(attributes) {
  50651. super(CONFIG_NS_ID, "threshold", ["trace", "error", "information", "warning"]);
  50652. }
  50653. }
  50654. class To extends OptionObject {
  50655. constructor(attributes) {
  50656. super(CONFIG_NS_ID, "to", ["null", "memory", "stderr", "stdout", "system", "uri"]);
  50657. }
  50658. }
  50659. class TemplateCache extends XFAObject {
  50660. constructor(attributes) {
  50661. super(CONFIG_NS_ID, "templateCache");
  50662. this.maxEntries = getInteger({
  50663. data: attributes.maxEntries,
  50664. defaultValue: 5,
  50665. validate: n => n >= 0
  50666. });
  50667. }
  50668. }
  50669. class Trace extends XFAObject {
  50670. constructor(attributes) {
  50671. super(CONFIG_NS_ID, "trace", true);
  50672. this.area = new XFAObjectArray();
  50673. }
  50674. }
  50675. class Transform extends XFAObject {
  50676. constructor(attributes) {
  50677. super(CONFIG_NS_ID, "transform", true);
  50678. this.groupParent = null;
  50679. this.ifEmpty = null;
  50680. this.nameAttr = null;
  50681. this.picture = null;
  50682. this.presence = null;
  50683. this.rename = null;
  50684. this.whitespace = null;
  50685. }
  50686. }
  50687. class Type extends OptionObject {
  50688. constructor(attributes) {
  50689. super(CONFIG_NS_ID, "type", ["none", "ascii85", "asciiHex", "ccittfax", "flate", "lzw", "runLength", "native", "xdp", "mergedXDP"]);
  50690. }
  50691. }
  50692. class Uri extends StringObject {
  50693. constructor(attributes) {
  50694. super(CONFIG_NS_ID, "uri");
  50695. }
  50696. }
  50697. class config_Validate extends OptionObject {
  50698. constructor(attributes) {
  50699. super(CONFIG_NS_ID, "validate", ["preSubmit", "prePrint", "preExecute", "preSave"]);
  50700. }
  50701. }
  50702. class ValidateApprovalSignatures extends ContentObject {
  50703. constructor(attributes) {
  50704. super(CONFIG_NS_ID, "validateApprovalSignatures");
  50705. }
  50706. [$finalize]() {
  50707. this[$content] = this[$content].trim().split(/\s+/).filter(x => ["docReady", "postSign"].includes(x));
  50708. }
  50709. }
  50710. class ValidationMessaging extends OptionObject {
  50711. constructor(attributes) {
  50712. super(CONFIG_NS_ID, "validationMessaging", ["allMessagesIndividually", "allMessagesTogether", "firstMessageOnly", "noMessages"]);
  50713. }
  50714. }
  50715. class Version extends OptionObject {
  50716. constructor(attributes) {
  50717. super(CONFIG_NS_ID, "version", ["1.7", "1.6", "1.5", "1.4", "1.3", "1.2"]);
  50718. }
  50719. }
  50720. class VersionControl extends XFAObject {
  50721. constructor(attributes) {
  50722. super(CONFIG_NS_ID, "VersionControl");
  50723. this.outputBelow = getStringOption(attributes.outputBelow, ["warn", "error", "update"]);
  50724. this.sourceAbove = getStringOption(attributes.sourceAbove, ["warn", "error"]);
  50725. this.sourceBelow = getStringOption(attributes.sourceBelow, ["update", "maintain"]);
  50726. }
  50727. }
  50728. class ViewerPreferences extends XFAObject {
  50729. constructor(attributes) {
  50730. super(CONFIG_NS_ID, "viewerPreferences", true);
  50731. this.ADBE_JSConsole = null;
  50732. this.ADBE_JSDebugger = null;
  50733. this.addViewerPreferences = null;
  50734. this.duplexOption = null;
  50735. this.enforce = null;
  50736. this.numberOfCopies = null;
  50737. this.pageRange = null;
  50738. this.pickTrayByPDFSize = null;
  50739. this.printScaling = null;
  50740. }
  50741. }
  50742. class WebClient extends XFAObject {
  50743. constructor(attributes) {
  50744. super(CONFIG_NS_ID, "webClient", true);
  50745. this.name = attributes.name ? attributes.name.trim() : "";
  50746. this.fontInfo = null;
  50747. this.xdc = null;
  50748. }
  50749. }
  50750. class Whitespace extends OptionObject {
  50751. constructor(attributes) {
  50752. super(CONFIG_NS_ID, "whitespace", ["preserve", "ltrim", "normalize", "rtrim", "trim"]);
  50753. }
  50754. }
  50755. class Window extends ContentObject {
  50756. constructor(attributes) {
  50757. super(CONFIG_NS_ID, "window");
  50758. }
  50759. [$finalize]() {
  50760. const pair = this[$content].trim().split(/\s*,\s*/, 2).map(x => parseInt(x, 10));
  50761. if (pair.some(x => isNaN(x))) {
  50762. this[$content] = [0, 0];
  50763. return;
  50764. }
  50765. if (pair.length === 1) {
  50766. pair.push(pair[0]);
  50767. }
  50768. this[$content] = pair;
  50769. }
  50770. }
  50771. class Xdc extends XFAObject {
  50772. constructor(attributes) {
  50773. super(CONFIG_NS_ID, "xdc", true);
  50774. this.uri = new XFAObjectArray();
  50775. this.xsl = new XFAObjectArray();
  50776. }
  50777. }
  50778. class Xdp extends XFAObject {
  50779. constructor(attributes) {
  50780. super(CONFIG_NS_ID, "xdp", true);
  50781. this.packets = null;
  50782. }
  50783. }
  50784. class Xsl extends XFAObject {
  50785. constructor(attributes) {
  50786. super(CONFIG_NS_ID, "xsl", true);
  50787. this.debug = null;
  50788. this.uri = null;
  50789. }
  50790. }
  50791. class Zpl extends XFAObject {
  50792. constructor(attributes) {
  50793. super(CONFIG_NS_ID, "zpl", true);
  50794. this.name = attributes.name ? attributes.name.trim() : "";
  50795. this.batchOutput = null;
  50796. this.flipLabel = null;
  50797. this.fontInfo = null;
  50798. this.xdc = null;
  50799. }
  50800. }
  50801. class ConfigNamespace {
  50802. static [$buildXFAObject](name, attributes) {
  50803. if (ConfigNamespace.hasOwnProperty(name)) {
  50804. return ConfigNamespace[name](attributes);
  50805. }
  50806. return undefined;
  50807. }
  50808. static acrobat(attrs) {
  50809. return new Acrobat(attrs);
  50810. }
  50811. static acrobat7(attrs) {
  50812. return new Acrobat7(attrs);
  50813. }
  50814. static ADBE_JSConsole(attrs) {
  50815. return new ADBE_JSConsole(attrs);
  50816. }
  50817. static ADBE_JSDebugger(attrs) {
  50818. return new ADBE_JSDebugger(attrs);
  50819. }
  50820. static addSilentPrint(attrs) {
  50821. return new AddSilentPrint(attrs);
  50822. }
  50823. static addViewerPreferences(attrs) {
  50824. return new AddViewerPreferences(attrs);
  50825. }
  50826. static adjustData(attrs) {
  50827. return new AdjustData(attrs);
  50828. }
  50829. static adobeExtensionLevel(attrs) {
  50830. return new AdobeExtensionLevel(attrs);
  50831. }
  50832. static agent(attrs) {
  50833. return new Agent(attrs);
  50834. }
  50835. static alwaysEmbed(attrs) {
  50836. return new AlwaysEmbed(attrs);
  50837. }
  50838. static amd(attrs) {
  50839. return new Amd(attrs);
  50840. }
  50841. static area(attrs) {
  50842. return new config_Area(attrs);
  50843. }
  50844. static attributes(attrs) {
  50845. return new Attributes(attrs);
  50846. }
  50847. static autoSave(attrs) {
  50848. return new AutoSave(attrs);
  50849. }
  50850. static base(attrs) {
  50851. return new Base(attrs);
  50852. }
  50853. static batchOutput(attrs) {
  50854. return new BatchOutput(attrs);
  50855. }
  50856. static behaviorOverride(attrs) {
  50857. return new BehaviorOverride(attrs);
  50858. }
  50859. static cache(attrs) {
  50860. return new Cache(attrs);
  50861. }
  50862. static change(attrs) {
  50863. return new Change(attrs);
  50864. }
  50865. static common(attrs) {
  50866. return new Common(attrs);
  50867. }
  50868. static compress(attrs) {
  50869. return new Compress(attrs);
  50870. }
  50871. static compressLogicalStructure(attrs) {
  50872. return new CompressLogicalStructure(attrs);
  50873. }
  50874. static compressObjectStream(attrs) {
  50875. return new CompressObjectStream(attrs);
  50876. }
  50877. static compression(attrs) {
  50878. return new Compression(attrs);
  50879. }
  50880. static config(attrs) {
  50881. return new Config(attrs);
  50882. }
  50883. static conformance(attrs) {
  50884. return new Conformance(attrs);
  50885. }
  50886. static contentCopy(attrs) {
  50887. return new ContentCopy(attrs);
  50888. }
  50889. static copies(attrs) {
  50890. return new Copies(attrs);
  50891. }
  50892. static creator(attrs) {
  50893. return new Creator(attrs);
  50894. }
  50895. static currentPage(attrs) {
  50896. return new CurrentPage(attrs);
  50897. }
  50898. static data(attrs) {
  50899. return new Data(attrs);
  50900. }
  50901. static debug(attrs) {
  50902. return new Debug(attrs);
  50903. }
  50904. static defaultTypeface(attrs) {
  50905. return new DefaultTypeface(attrs);
  50906. }
  50907. static destination(attrs) {
  50908. return new Destination(attrs);
  50909. }
  50910. static documentAssembly(attrs) {
  50911. return new DocumentAssembly(attrs);
  50912. }
  50913. static driver(attrs) {
  50914. return new Driver(attrs);
  50915. }
  50916. static duplexOption(attrs) {
  50917. return new DuplexOption(attrs);
  50918. }
  50919. static dynamicRender(attrs) {
  50920. return new DynamicRender(attrs);
  50921. }
  50922. static embed(attrs) {
  50923. return new Embed(attrs);
  50924. }
  50925. static encrypt(attrs) {
  50926. return new config_Encrypt(attrs);
  50927. }
  50928. static encryption(attrs) {
  50929. return new config_Encryption(attrs);
  50930. }
  50931. static encryptionLevel(attrs) {
  50932. return new EncryptionLevel(attrs);
  50933. }
  50934. static enforce(attrs) {
  50935. return new Enforce(attrs);
  50936. }
  50937. static equate(attrs) {
  50938. return new Equate(attrs);
  50939. }
  50940. static equateRange(attrs) {
  50941. return new EquateRange(attrs);
  50942. }
  50943. static exclude(attrs) {
  50944. return new Exclude(attrs);
  50945. }
  50946. static excludeNS(attrs) {
  50947. return new ExcludeNS(attrs);
  50948. }
  50949. static flipLabel(attrs) {
  50950. return new FlipLabel(attrs);
  50951. }
  50952. static fontInfo(attrs) {
  50953. return new config_FontInfo(attrs);
  50954. }
  50955. static formFieldFilling(attrs) {
  50956. return new FormFieldFilling(attrs);
  50957. }
  50958. static groupParent(attrs) {
  50959. return new GroupParent(attrs);
  50960. }
  50961. static ifEmpty(attrs) {
  50962. return new IfEmpty(attrs);
  50963. }
  50964. static includeXDPContent(attrs) {
  50965. return new IncludeXDPContent(attrs);
  50966. }
  50967. static incrementalLoad(attrs) {
  50968. return new IncrementalLoad(attrs);
  50969. }
  50970. static incrementalMerge(attrs) {
  50971. return new IncrementalMerge(attrs);
  50972. }
  50973. static interactive(attrs) {
  50974. return new Interactive(attrs);
  50975. }
  50976. static jog(attrs) {
  50977. return new Jog(attrs);
  50978. }
  50979. static labelPrinter(attrs) {
  50980. return new LabelPrinter(attrs);
  50981. }
  50982. static layout(attrs) {
  50983. return new Layout(attrs);
  50984. }
  50985. static level(attrs) {
  50986. return new Level(attrs);
  50987. }
  50988. static linearized(attrs) {
  50989. return new Linearized(attrs);
  50990. }
  50991. static locale(attrs) {
  50992. return new Locale(attrs);
  50993. }
  50994. static localeSet(attrs) {
  50995. return new LocaleSet(attrs);
  50996. }
  50997. static log(attrs) {
  50998. return new Log(attrs);
  50999. }
  51000. static map(attrs) {
  51001. return new MapElement(attrs);
  51002. }
  51003. static mediumInfo(attrs) {
  51004. return new MediumInfo(attrs);
  51005. }
  51006. static message(attrs) {
  51007. return new config_Message(attrs);
  51008. }
  51009. static messaging(attrs) {
  51010. return new Messaging(attrs);
  51011. }
  51012. static mode(attrs) {
  51013. return new Mode(attrs);
  51014. }
  51015. static modifyAnnots(attrs) {
  51016. return new ModifyAnnots(attrs);
  51017. }
  51018. static msgId(attrs) {
  51019. return new MsgId(attrs);
  51020. }
  51021. static nameAttr(attrs) {
  51022. return new NameAttr(attrs);
  51023. }
  51024. static neverEmbed(attrs) {
  51025. return new NeverEmbed(attrs);
  51026. }
  51027. static numberOfCopies(attrs) {
  51028. return new NumberOfCopies(attrs);
  51029. }
  51030. static openAction(attrs) {
  51031. return new OpenAction(attrs);
  51032. }
  51033. static output(attrs) {
  51034. return new Output(attrs);
  51035. }
  51036. static outputBin(attrs) {
  51037. return new OutputBin(attrs);
  51038. }
  51039. static outputXSL(attrs) {
  51040. return new OutputXSL(attrs);
  51041. }
  51042. static overprint(attrs) {
  51043. return new Overprint(attrs);
  51044. }
  51045. static packets(attrs) {
  51046. return new Packets(attrs);
  51047. }
  51048. static pageOffset(attrs) {
  51049. return new PageOffset(attrs);
  51050. }
  51051. static pageRange(attrs) {
  51052. return new PageRange(attrs);
  51053. }
  51054. static pagination(attrs) {
  51055. return new Pagination(attrs);
  51056. }
  51057. static paginationOverride(attrs) {
  51058. return new PaginationOverride(attrs);
  51059. }
  51060. static part(attrs) {
  51061. return new Part(attrs);
  51062. }
  51063. static pcl(attrs) {
  51064. return new Pcl(attrs);
  51065. }
  51066. static pdf(attrs) {
  51067. return new Pdf(attrs);
  51068. }
  51069. static pdfa(attrs) {
  51070. return new Pdfa(attrs);
  51071. }
  51072. static permissions(attrs) {
  51073. return new Permissions(attrs);
  51074. }
  51075. static pickTrayByPDFSize(attrs) {
  51076. return new PickTrayByPDFSize(attrs);
  51077. }
  51078. static picture(attrs) {
  51079. return new config_Picture(attrs);
  51080. }
  51081. static plaintextMetadata(attrs) {
  51082. return new PlaintextMetadata(attrs);
  51083. }
  51084. static presence(attrs) {
  51085. return new Presence(attrs);
  51086. }
  51087. static present(attrs) {
  51088. return new Present(attrs);
  51089. }
  51090. static print(attrs) {
  51091. return new Print(attrs);
  51092. }
  51093. static printHighQuality(attrs) {
  51094. return new PrintHighQuality(attrs);
  51095. }
  51096. static printScaling(attrs) {
  51097. return new PrintScaling(attrs);
  51098. }
  51099. static printerName(attrs) {
  51100. return new PrinterName(attrs);
  51101. }
  51102. static producer(attrs) {
  51103. return new Producer(attrs);
  51104. }
  51105. static ps(attrs) {
  51106. return new Ps(attrs);
  51107. }
  51108. static range(attrs) {
  51109. return new Range(attrs);
  51110. }
  51111. static record(attrs) {
  51112. return new Record(attrs);
  51113. }
  51114. static relevant(attrs) {
  51115. return new Relevant(attrs);
  51116. }
  51117. static rename(attrs) {
  51118. return new Rename(attrs);
  51119. }
  51120. static renderPolicy(attrs) {
  51121. return new RenderPolicy(attrs);
  51122. }
  51123. static runScripts(attrs) {
  51124. return new RunScripts(attrs);
  51125. }
  51126. static script(attrs) {
  51127. return new config_Script(attrs);
  51128. }
  51129. static scriptModel(attrs) {
  51130. return new ScriptModel(attrs);
  51131. }
  51132. static severity(attrs) {
  51133. return new Severity(attrs);
  51134. }
  51135. static silentPrint(attrs) {
  51136. return new SilentPrint(attrs);
  51137. }
  51138. static staple(attrs) {
  51139. return new Staple(attrs);
  51140. }
  51141. static startNode(attrs) {
  51142. return new StartNode(attrs);
  51143. }
  51144. static startPage(attrs) {
  51145. return new StartPage(attrs);
  51146. }
  51147. static submitFormat(attrs) {
  51148. return new SubmitFormat(attrs);
  51149. }
  51150. static submitUrl(attrs) {
  51151. return new SubmitUrl(attrs);
  51152. }
  51153. static subsetBelow(attrs) {
  51154. return new SubsetBelow(attrs);
  51155. }
  51156. static suppressBanner(attrs) {
  51157. return new SuppressBanner(attrs);
  51158. }
  51159. static tagged(attrs) {
  51160. return new Tagged(attrs);
  51161. }
  51162. static template(attrs) {
  51163. return new config_Template(attrs);
  51164. }
  51165. static templateCache(attrs) {
  51166. return new TemplateCache(attrs);
  51167. }
  51168. static threshold(attrs) {
  51169. return new Threshold(attrs);
  51170. }
  51171. static to(attrs) {
  51172. return new To(attrs);
  51173. }
  51174. static trace(attrs) {
  51175. return new Trace(attrs);
  51176. }
  51177. static transform(attrs) {
  51178. return new Transform(attrs);
  51179. }
  51180. static type(attrs) {
  51181. return new Type(attrs);
  51182. }
  51183. static uri(attrs) {
  51184. return new Uri(attrs);
  51185. }
  51186. static validate(attrs) {
  51187. return new config_Validate(attrs);
  51188. }
  51189. static validateApprovalSignatures(attrs) {
  51190. return new ValidateApprovalSignatures(attrs);
  51191. }
  51192. static validationMessaging(attrs) {
  51193. return new ValidationMessaging(attrs);
  51194. }
  51195. static version(attrs) {
  51196. return new Version(attrs);
  51197. }
  51198. static versionControl(attrs) {
  51199. return new VersionControl(attrs);
  51200. }
  51201. static viewerPreferences(attrs) {
  51202. return new ViewerPreferences(attrs);
  51203. }
  51204. static webClient(attrs) {
  51205. return new WebClient(attrs);
  51206. }
  51207. static whitespace(attrs) {
  51208. return new Whitespace(attrs);
  51209. }
  51210. static window(attrs) {
  51211. return new Window(attrs);
  51212. }
  51213. static xdc(attrs) {
  51214. return new Xdc(attrs);
  51215. }
  51216. static xdp(attrs) {
  51217. return new Xdp(attrs);
  51218. }
  51219. static xsl(attrs) {
  51220. return new Xsl(attrs);
  51221. }
  51222. static zpl(attrs) {
  51223. return new Zpl(attrs);
  51224. }
  51225. }
  51226. ;// ./src/core/xfa/connection_set.js
  51227. const CONNECTION_SET_NS_ID = NamespaceIds.connectionSet.id;
  51228. class ConnectionSet extends XFAObject {
  51229. constructor(attributes) {
  51230. super(CONNECTION_SET_NS_ID, "connectionSet", true);
  51231. this.wsdlConnection = new XFAObjectArray();
  51232. this.xmlConnection = new XFAObjectArray();
  51233. this.xsdConnection = new XFAObjectArray();
  51234. }
  51235. }
  51236. class EffectiveInputPolicy extends XFAObject {
  51237. constructor(attributes) {
  51238. super(CONNECTION_SET_NS_ID, "effectiveInputPolicy");
  51239. this.id = attributes.id || "";
  51240. this.name = attributes.name || "";
  51241. this.use = attributes.use || "";
  51242. this.usehref = attributes.usehref || "";
  51243. }
  51244. }
  51245. class EffectiveOutputPolicy extends XFAObject {
  51246. constructor(attributes) {
  51247. super(CONNECTION_SET_NS_ID, "effectiveOutputPolicy");
  51248. this.id = attributes.id || "";
  51249. this.name = attributes.name || "";
  51250. this.use = attributes.use || "";
  51251. this.usehref = attributes.usehref || "";
  51252. }
  51253. }
  51254. class Operation extends StringObject {
  51255. constructor(attributes) {
  51256. super(CONNECTION_SET_NS_ID, "operation");
  51257. this.id = attributes.id || "";
  51258. this.input = attributes.input || "";
  51259. this.name = attributes.name || "";
  51260. this.output = attributes.output || "";
  51261. this.use = attributes.use || "";
  51262. this.usehref = attributes.usehref || "";
  51263. }
  51264. }
  51265. class RootElement extends StringObject {
  51266. constructor(attributes) {
  51267. super(CONNECTION_SET_NS_ID, "rootElement");
  51268. this.id = attributes.id || "";
  51269. this.name = attributes.name || "";
  51270. this.use = attributes.use || "";
  51271. this.usehref = attributes.usehref || "";
  51272. }
  51273. }
  51274. class SoapAction extends StringObject {
  51275. constructor(attributes) {
  51276. super(CONNECTION_SET_NS_ID, "soapAction");
  51277. this.id = attributes.id || "";
  51278. this.name = attributes.name || "";
  51279. this.use = attributes.use || "";
  51280. this.usehref = attributes.usehref || "";
  51281. }
  51282. }
  51283. class SoapAddress extends StringObject {
  51284. constructor(attributes) {
  51285. super(CONNECTION_SET_NS_ID, "soapAddress");
  51286. this.id = attributes.id || "";
  51287. this.name = attributes.name || "";
  51288. this.use = attributes.use || "";
  51289. this.usehref = attributes.usehref || "";
  51290. }
  51291. }
  51292. class connection_set_Uri extends StringObject {
  51293. constructor(attributes) {
  51294. super(CONNECTION_SET_NS_ID, "uri");
  51295. this.id = attributes.id || "";
  51296. this.name = attributes.name || "";
  51297. this.use = attributes.use || "";
  51298. this.usehref = attributes.usehref || "";
  51299. }
  51300. }
  51301. class WsdlAddress extends StringObject {
  51302. constructor(attributes) {
  51303. super(CONNECTION_SET_NS_ID, "wsdlAddress");
  51304. this.id = attributes.id || "";
  51305. this.name = attributes.name || "";
  51306. this.use = attributes.use || "";
  51307. this.usehref = attributes.usehref || "";
  51308. }
  51309. }
  51310. class WsdlConnection extends XFAObject {
  51311. constructor(attributes) {
  51312. super(CONNECTION_SET_NS_ID, "wsdlConnection", true);
  51313. this.dataDescription = attributes.dataDescription || "";
  51314. this.name = attributes.name || "";
  51315. this.effectiveInputPolicy = null;
  51316. this.effectiveOutputPolicy = null;
  51317. this.operation = null;
  51318. this.soapAction = null;
  51319. this.soapAddress = null;
  51320. this.wsdlAddress = null;
  51321. }
  51322. }
  51323. class XmlConnection extends XFAObject {
  51324. constructor(attributes) {
  51325. super(CONNECTION_SET_NS_ID, "xmlConnection", true);
  51326. this.dataDescription = attributes.dataDescription || "";
  51327. this.name = attributes.name || "";
  51328. this.uri = null;
  51329. }
  51330. }
  51331. class XsdConnection extends XFAObject {
  51332. constructor(attributes) {
  51333. super(CONNECTION_SET_NS_ID, "xsdConnection", true);
  51334. this.dataDescription = attributes.dataDescription || "";
  51335. this.name = attributes.name || "";
  51336. this.rootElement = null;
  51337. this.uri = null;
  51338. }
  51339. }
  51340. class ConnectionSetNamespace {
  51341. static [$buildXFAObject](name, attributes) {
  51342. if (ConnectionSetNamespace.hasOwnProperty(name)) {
  51343. return ConnectionSetNamespace[name](attributes);
  51344. }
  51345. return undefined;
  51346. }
  51347. static connectionSet(attrs) {
  51348. return new ConnectionSet(attrs);
  51349. }
  51350. static effectiveInputPolicy(attrs) {
  51351. return new EffectiveInputPolicy(attrs);
  51352. }
  51353. static effectiveOutputPolicy(attrs) {
  51354. return new EffectiveOutputPolicy(attrs);
  51355. }
  51356. static operation(attrs) {
  51357. return new Operation(attrs);
  51358. }
  51359. static rootElement(attrs) {
  51360. return new RootElement(attrs);
  51361. }
  51362. static soapAction(attrs) {
  51363. return new SoapAction(attrs);
  51364. }
  51365. static soapAddress(attrs) {
  51366. return new SoapAddress(attrs);
  51367. }
  51368. static uri(attrs) {
  51369. return new connection_set_Uri(attrs);
  51370. }
  51371. static wsdlAddress(attrs) {
  51372. return new WsdlAddress(attrs);
  51373. }
  51374. static wsdlConnection(attrs) {
  51375. return new WsdlConnection(attrs);
  51376. }
  51377. static xmlConnection(attrs) {
  51378. return new XmlConnection(attrs);
  51379. }
  51380. static xsdConnection(attrs) {
  51381. return new XsdConnection(attrs);
  51382. }
  51383. }
  51384. ;// ./src/core/xfa/datasets.js
  51385. const DATASETS_NS_ID = NamespaceIds.datasets.id;
  51386. class datasets_Data extends XmlObject {
  51387. constructor(attributes) {
  51388. super(DATASETS_NS_ID, "data", attributes);
  51389. }
  51390. [$isNsAgnostic]() {
  51391. return true;
  51392. }
  51393. }
  51394. class Datasets extends XFAObject {
  51395. constructor(attributes) {
  51396. super(DATASETS_NS_ID, "datasets", true);
  51397. this.data = null;
  51398. this.Signature = null;
  51399. }
  51400. [$onChild](child) {
  51401. const name = child[$nodeName];
  51402. if (name === "data" && child[$namespaceId] === DATASETS_NS_ID || name === "Signature" && child[$namespaceId] === NamespaceIds.signature.id) {
  51403. this[name] = child;
  51404. }
  51405. this[$appendChild](child);
  51406. }
  51407. }
  51408. class DatasetsNamespace {
  51409. static [$buildXFAObject](name, attributes) {
  51410. if (DatasetsNamespace.hasOwnProperty(name)) {
  51411. return DatasetsNamespace[name](attributes);
  51412. }
  51413. return undefined;
  51414. }
  51415. static datasets(attributes) {
  51416. return new Datasets(attributes);
  51417. }
  51418. static data(attributes) {
  51419. return new datasets_Data(attributes);
  51420. }
  51421. }
  51422. ;// ./src/core/xfa/locale_set.js
  51423. const LOCALE_SET_NS_ID = NamespaceIds.localeSet.id;
  51424. class CalendarSymbols extends XFAObject {
  51425. constructor(attributes) {
  51426. super(LOCALE_SET_NS_ID, "calendarSymbols", true);
  51427. this.name = "gregorian";
  51428. this.dayNames = new XFAObjectArray(2);
  51429. this.eraNames = null;
  51430. this.meridiemNames = null;
  51431. this.monthNames = new XFAObjectArray(2);
  51432. }
  51433. }
  51434. class CurrencySymbol extends StringObject {
  51435. constructor(attributes) {
  51436. super(LOCALE_SET_NS_ID, "currencySymbol");
  51437. this.name = getStringOption(attributes.name, ["symbol", "isoname", "decimal"]);
  51438. }
  51439. }
  51440. class CurrencySymbols extends XFAObject {
  51441. constructor(attributes) {
  51442. super(LOCALE_SET_NS_ID, "currencySymbols", true);
  51443. this.currencySymbol = new XFAObjectArray(3);
  51444. }
  51445. }
  51446. class DatePattern extends StringObject {
  51447. constructor(attributes) {
  51448. super(LOCALE_SET_NS_ID, "datePattern");
  51449. this.name = getStringOption(attributes.name, ["full", "long", "med", "short"]);
  51450. }
  51451. }
  51452. class DatePatterns extends XFAObject {
  51453. constructor(attributes) {
  51454. super(LOCALE_SET_NS_ID, "datePatterns", true);
  51455. this.datePattern = new XFAObjectArray(4);
  51456. }
  51457. }
  51458. class DateTimeSymbols extends ContentObject {
  51459. constructor(attributes) {
  51460. super(LOCALE_SET_NS_ID, "dateTimeSymbols");
  51461. }
  51462. }
  51463. class Day extends StringObject {
  51464. constructor(attributes) {
  51465. super(LOCALE_SET_NS_ID, "day");
  51466. }
  51467. }
  51468. class DayNames extends XFAObject {
  51469. constructor(attributes) {
  51470. super(LOCALE_SET_NS_ID, "dayNames", true);
  51471. this.abbr = getInteger({
  51472. data: attributes.abbr,
  51473. defaultValue: 0,
  51474. validate: x => x === 1
  51475. });
  51476. this.day = new XFAObjectArray(7);
  51477. }
  51478. }
  51479. class Era extends StringObject {
  51480. constructor(attributes) {
  51481. super(LOCALE_SET_NS_ID, "era");
  51482. }
  51483. }
  51484. class EraNames extends XFAObject {
  51485. constructor(attributes) {
  51486. super(LOCALE_SET_NS_ID, "eraNames", true);
  51487. this.era = new XFAObjectArray(2);
  51488. }
  51489. }
  51490. class locale_set_Locale extends XFAObject {
  51491. constructor(attributes) {
  51492. super(LOCALE_SET_NS_ID, "locale", true);
  51493. this.desc = attributes.desc || "";
  51494. this.name = "isoname";
  51495. this.calendarSymbols = null;
  51496. this.currencySymbols = null;
  51497. this.datePatterns = null;
  51498. this.dateTimeSymbols = null;
  51499. this.numberPatterns = null;
  51500. this.numberSymbols = null;
  51501. this.timePatterns = null;
  51502. this.typeFaces = null;
  51503. }
  51504. }
  51505. class locale_set_LocaleSet extends XFAObject {
  51506. constructor(attributes) {
  51507. super(LOCALE_SET_NS_ID, "localeSet", true);
  51508. this.locale = new XFAObjectArray();
  51509. }
  51510. }
  51511. class Meridiem extends StringObject {
  51512. constructor(attributes) {
  51513. super(LOCALE_SET_NS_ID, "meridiem");
  51514. }
  51515. }
  51516. class MeridiemNames extends XFAObject {
  51517. constructor(attributes) {
  51518. super(LOCALE_SET_NS_ID, "meridiemNames", true);
  51519. this.meridiem = new XFAObjectArray(2);
  51520. }
  51521. }
  51522. class Month extends StringObject {
  51523. constructor(attributes) {
  51524. super(LOCALE_SET_NS_ID, "month");
  51525. }
  51526. }
  51527. class MonthNames extends XFAObject {
  51528. constructor(attributes) {
  51529. super(LOCALE_SET_NS_ID, "monthNames", true);
  51530. this.abbr = getInteger({
  51531. data: attributes.abbr,
  51532. defaultValue: 0,
  51533. validate: x => x === 1
  51534. });
  51535. this.month = new XFAObjectArray(12);
  51536. }
  51537. }
  51538. class NumberPattern extends StringObject {
  51539. constructor(attributes) {
  51540. super(LOCALE_SET_NS_ID, "numberPattern");
  51541. this.name = getStringOption(attributes.name, ["full", "long", "med", "short"]);
  51542. }
  51543. }
  51544. class NumberPatterns extends XFAObject {
  51545. constructor(attributes) {
  51546. super(LOCALE_SET_NS_ID, "numberPatterns", true);
  51547. this.numberPattern = new XFAObjectArray(4);
  51548. }
  51549. }
  51550. class NumberSymbol extends StringObject {
  51551. constructor(attributes) {
  51552. super(LOCALE_SET_NS_ID, "numberSymbol");
  51553. this.name = getStringOption(attributes.name, ["decimal", "grouping", "percent", "minus", "zero"]);
  51554. }
  51555. }
  51556. class NumberSymbols extends XFAObject {
  51557. constructor(attributes) {
  51558. super(LOCALE_SET_NS_ID, "numberSymbols", true);
  51559. this.numberSymbol = new XFAObjectArray(5);
  51560. }
  51561. }
  51562. class TimePattern extends StringObject {
  51563. constructor(attributes) {
  51564. super(LOCALE_SET_NS_ID, "timePattern");
  51565. this.name = getStringOption(attributes.name, ["full", "long", "med", "short"]);
  51566. }
  51567. }
  51568. class TimePatterns extends XFAObject {
  51569. constructor(attributes) {
  51570. super(LOCALE_SET_NS_ID, "timePatterns", true);
  51571. this.timePattern = new XFAObjectArray(4);
  51572. }
  51573. }
  51574. class TypeFace extends XFAObject {
  51575. constructor(attributes) {
  51576. super(LOCALE_SET_NS_ID, "typeFace", true);
  51577. this.name = attributes.name | "";
  51578. }
  51579. }
  51580. class TypeFaces extends XFAObject {
  51581. constructor(attributes) {
  51582. super(LOCALE_SET_NS_ID, "typeFaces", true);
  51583. this.typeFace = new XFAObjectArray();
  51584. }
  51585. }
  51586. class LocaleSetNamespace {
  51587. static [$buildXFAObject](name, attributes) {
  51588. if (LocaleSetNamespace.hasOwnProperty(name)) {
  51589. return LocaleSetNamespace[name](attributes);
  51590. }
  51591. return undefined;
  51592. }
  51593. static calendarSymbols(attrs) {
  51594. return new CalendarSymbols(attrs);
  51595. }
  51596. static currencySymbol(attrs) {
  51597. return new CurrencySymbol(attrs);
  51598. }
  51599. static currencySymbols(attrs) {
  51600. return new CurrencySymbols(attrs);
  51601. }
  51602. static datePattern(attrs) {
  51603. return new DatePattern(attrs);
  51604. }
  51605. static datePatterns(attrs) {
  51606. return new DatePatterns(attrs);
  51607. }
  51608. static dateTimeSymbols(attrs) {
  51609. return new DateTimeSymbols(attrs);
  51610. }
  51611. static day(attrs) {
  51612. return new Day(attrs);
  51613. }
  51614. static dayNames(attrs) {
  51615. return new DayNames(attrs);
  51616. }
  51617. static era(attrs) {
  51618. return new Era(attrs);
  51619. }
  51620. static eraNames(attrs) {
  51621. return new EraNames(attrs);
  51622. }
  51623. static locale(attrs) {
  51624. return new locale_set_Locale(attrs);
  51625. }
  51626. static localeSet(attrs) {
  51627. return new locale_set_LocaleSet(attrs);
  51628. }
  51629. static meridiem(attrs) {
  51630. return new Meridiem(attrs);
  51631. }
  51632. static meridiemNames(attrs) {
  51633. return new MeridiemNames(attrs);
  51634. }
  51635. static month(attrs) {
  51636. return new Month(attrs);
  51637. }
  51638. static monthNames(attrs) {
  51639. return new MonthNames(attrs);
  51640. }
  51641. static numberPattern(attrs) {
  51642. return new NumberPattern(attrs);
  51643. }
  51644. static numberPatterns(attrs) {
  51645. return new NumberPatterns(attrs);
  51646. }
  51647. static numberSymbol(attrs) {
  51648. return new NumberSymbol(attrs);
  51649. }
  51650. static numberSymbols(attrs) {
  51651. return new NumberSymbols(attrs);
  51652. }
  51653. static timePattern(attrs) {
  51654. return new TimePattern(attrs);
  51655. }
  51656. static timePatterns(attrs) {
  51657. return new TimePatterns(attrs);
  51658. }
  51659. static typeFace(attrs) {
  51660. return new TypeFace(attrs);
  51661. }
  51662. static typeFaces(attrs) {
  51663. return new TypeFaces(attrs);
  51664. }
  51665. }
  51666. ;// ./src/core/xfa/signature.js
  51667. const SIGNATURE_NS_ID = NamespaceIds.signature.id;
  51668. class signature_Signature extends XFAObject {
  51669. constructor(attributes) {
  51670. super(SIGNATURE_NS_ID, "signature", true);
  51671. }
  51672. }
  51673. class SignatureNamespace {
  51674. static [$buildXFAObject](name, attributes) {
  51675. if (SignatureNamespace.hasOwnProperty(name)) {
  51676. return SignatureNamespace[name](attributes);
  51677. }
  51678. return undefined;
  51679. }
  51680. static signature(attributes) {
  51681. return new signature_Signature(attributes);
  51682. }
  51683. }
  51684. ;// ./src/core/xfa/stylesheet.js
  51685. const STYLESHEET_NS_ID = NamespaceIds.stylesheet.id;
  51686. class Stylesheet extends XFAObject {
  51687. constructor(attributes) {
  51688. super(STYLESHEET_NS_ID, "stylesheet", true);
  51689. }
  51690. }
  51691. class StylesheetNamespace {
  51692. static [$buildXFAObject](name, attributes) {
  51693. if (StylesheetNamespace.hasOwnProperty(name)) {
  51694. return StylesheetNamespace[name](attributes);
  51695. }
  51696. return undefined;
  51697. }
  51698. static stylesheet(attributes) {
  51699. return new Stylesheet(attributes);
  51700. }
  51701. }
  51702. ;// ./src/core/xfa/xdp.js
  51703. const XDP_NS_ID = NamespaceIds.xdp.id;
  51704. class xdp_Xdp extends XFAObject {
  51705. constructor(attributes) {
  51706. super(XDP_NS_ID, "xdp", true);
  51707. this.uuid = attributes.uuid || "";
  51708. this.timeStamp = attributes.timeStamp || "";
  51709. this.config = null;
  51710. this.connectionSet = null;
  51711. this.datasets = null;
  51712. this.localeSet = null;
  51713. this.stylesheet = new XFAObjectArray();
  51714. this.template = null;
  51715. }
  51716. [$onChildCheck](child) {
  51717. const ns = NamespaceIds[child[$nodeName]];
  51718. return ns && child[$namespaceId] === ns.id;
  51719. }
  51720. }
  51721. class XdpNamespace {
  51722. static [$buildXFAObject](name, attributes) {
  51723. if (XdpNamespace.hasOwnProperty(name)) {
  51724. return XdpNamespace[name](attributes);
  51725. }
  51726. return undefined;
  51727. }
  51728. static xdp(attributes) {
  51729. return new xdp_Xdp(attributes);
  51730. }
  51731. }
  51732. ;// ./src/core/xfa/xhtml.js
  51733. const XHTML_NS_ID = NamespaceIds.xhtml.id;
  51734. const $richText = Symbol();
  51735. const VALID_STYLES = new Set(["color", "font", "font-family", "font-size", "font-stretch", "font-style", "font-weight", "margin", "margin-bottom", "margin-left", "margin-right", "margin-top", "letter-spacing", "line-height", "orphans", "page-break-after", "page-break-before", "page-break-inside", "tab-interval", "tab-stop", "text-align", "text-decoration", "text-indent", "vertical-align", "widows", "kerning-mode", "xfa-font-horizontal-scale", "xfa-font-vertical-scale", "xfa-spacerun", "xfa-tab-stops"]);
  51736. const StyleMapping = new Map([["page-break-after", "breakAfter"], ["page-break-before", "breakBefore"], ["page-break-inside", "breakInside"], ["kerning-mode", value => value === "none" ? "none" : "normal"], ["xfa-font-horizontal-scale", value => `scaleX(${Math.max(0, Math.min(parseInt(value) / 100)).toFixed(2)})`], ["xfa-font-vertical-scale", value => `scaleY(${Math.max(0, Math.min(parseInt(value) / 100)).toFixed(2)})`], ["xfa-spacerun", ""], ["xfa-tab-stops", ""], ["font-size", (value, original) => {
  51737. value = original.fontSize = getMeasurement(value);
  51738. return measureToString(0.99 * value);
  51739. }], ["letter-spacing", value => measureToString(getMeasurement(value))], ["line-height", value => measureToString(getMeasurement(value))], ["margin", value => measureToString(getMeasurement(value))], ["margin-bottom", value => measureToString(getMeasurement(value))], ["margin-left", value => measureToString(getMeasurement(value))], ["margin-right", value => measureToString(getMeasurement(value))], ["margin-top", value => measureToString(getMeasurement(value))], ["text-indent", value => measureToString(getMeasurement(value))], ["font-family", value => value], ["vertical-align", value => measureToString(getMeasurement(value))]]);
  51740. const spacesRegExp = /\s+/g;
  51741. const crlfRegExp = /[\r\n]+/g;
  51742. const crlfForRichTextRegExp = /\r\n?/g;
  51743. function mapStyle(styleStr, node, richText) {
  51744. const style = Object.create(null);
  51745. if (!styleStr) {
  51746. return style;
  51747. }
  51748. const original = Object.create(null);
  51749. for (const [key, value] of styleStr.split(";").map(s => s.split(":", 2))) {
  51750. const mapping = StyleMapping.get(key);
  51751. if (mapping === "") {
  51752. continue;
  51753. }
  51754. let newValue = value;
  51755. if (mapping) {
  51756. newValue = typeof mapping === "string" ? mapping : mapping(value, original);
  51757. }
  51758. if (key.endsWith("scale")) {
  51759. style.transform = style.transform ? `${style[key]} ${newValue}` : newValue;
  51760. } else {
  51761. style[key.replaceAll(/-([a-zA-Z])/g, (_, x) => x.toUpperCase())] = newValue;
  51762. }
  51763. }
  51764. if (style.fontFamily) {
  51765. setFontFamily({
  51766. typeface: style.fontFamily,
  51767. weight: style.fontWeight || "normal",
  51768. posture: style.fontStyle || "normal",
  51769. size: original.fontSize || 0
  51770. }, node, node[$globalData].fontFinder, style);
  51771. }
  51772. if (richText && style.verticalAlign && style.verticalAlign !== "0px" && style.fontSize) {
  51773. const SUB_SUPER_SCRIPT_FACTOR = 0.583;
  51774. const VERTICAL_FACTOR = 0.333;
  51775. const fontSize = getMeasurement(style.fontSize);
  51776. style.fontSize = measureToString(fontSize * SUB_SUPER_SCRIPT_FACTOR);
  51777. style.verticalAlign = measureToString(Math.sign(getMeasurement(style.verticalAlign)) * fontSize * VERTICAL_FACTOR);
  51778. }
  51779. if (richText && style.fontSize) {
  51780. style.fontSize = `calc(${style.fontSize} * var(--scale-factor))`;
  51781. }
  51782. fixTextIndent(style);
  51783. return style;
  51784. }
  51785. function checkStyle(node) {
  51786. if (!node.style) {
  51787. return "";
  51788. }
  51789. return node.style.trim().split(/\s*;\s*/).filter(s => !!s).map(s => s.split(/\s*:\s*/, 2)).filter(([key, value]) => {
  51790. if (key === "font-family") {
  51791. node[$globalData].usedTypefaces.add(value);
  51792. }
  51793. return VALID_STYLES.has(key);
  51794. }).map(kv => kv.join(":")).join(";");
  51795. }
  51796. const NoWhites = new Set(["body", "html"]);
  51797. class XhtmlObject extends XmlObject {
  51798. constructor(attributes, name) {
  51799. super(XHTML_NS_ID, name);
  51800. this[$richText] = false;
  51801. this.style = attributes.style || "";
  51802. }
  51803. [$clean](builder) {
  51804. super[$clean](builder);
  51805. this.style = checkStyle(this);
  51806. }
  51807. [$acceptWhitespace]() {
  51808. return !NoWhites.has(this[$nodeName]);
  51809. }
  51810. [$onText](str, richText = false) {
  51811. if (!richText) {
  51812. str = str.replaceAll(crlfRegExp, "");
  51813. if (!this.style.includes("xfa-spacerun:yes")) {
  51814. str = str.replaceAll(spacesRegExp, " ");
  51815. }
  51816. } else {
  51817. this[$richText] = true;
  51818. }
  51819. if (str) {
  51820. this[$content] += str;
  51821. }
  51822. }
  51823. [$pushGlyphs](measure, mustPop = true) {
  51824. const xfaFont = Object.create(null);
  51825. const margin = {
  51826. top: NaN,
  51827. bottom: NaN,
  51828. left: NaN,
  51829. right: NaN
  51830. };
  51831. let lineHeight = null;
  51832. for (const [key, value] of this.style.split(";").map(s => s.split(":", 2))) {
  51833. switch (key) {
  51834. case "font-family":
  51835. xfaFont.typeface = stripQuotes(value);
  51836. break;
  51837. case "font-size":
  51838. xfaFont.size = getMeasurement(value);
  51839. break;
  51840. case "font-weight":
  51841. xfaFont.weight = value;
  51842. break;
  51843. case "font-style":
  51844. xfaFont.posture = value;
  51845. break;
  51846. case "letter-spacing":
  51847. xfaFont.letterSpacing = getMeasurement(value);
  51848. break;
  51849. case "margin":
  51850. const values = value.split(/ \t/).map(x => getMeasurement(x));
  51851. switch (values.length) {
  51852. case 1:
  51853. margin.top = margin.bottom = margin.left = margin.right = values[0];
  51854. break;
  51855. case 2:
  51856. margin.top = margin.bottom = values[0];
  51857. margin.left = margin.right = values[1];
  51858. break;
  51859. case 3:
  51860. margin.top = values[0];
  51861. margin.bottom = values[2];
  51862. margin.left = margin.right = values[1];
  51863. break;
  51864. case 4:
  51865. margin.top = values[0];
  51866. margin.left = values[1];
  51867. margin.bottom = values[2];
  51868. margin.right = values[3];
  51869. break;
  51870. }
  51871. break;
  51872. case "margin-top":
  51873. margin.top = getMeasurement(value);
  51874. break;
  51875. case "margin-bottom":
  51876. margin.bottom = getMeasurement(value);
  51877. break;
  51878. case "margin-left":
  51879. margin.left = getMeasurement(value);
  51880. break;
  51881. case "margin-right":
  51882. margin.right = getMeasurement(value);
  51883. break;
  51884. case "line-height":
  51885. lineHeight = getMeasurement(value);
  51886. break;
  51887. }
  51888. }
  51889. measure.pushData(xfaFont, margin, lineHeight);
  51890. if (this[$content]) {
  51891. measure.addString(this[$content]);
  51892. } else {
  51893. for (const child of this[$getChildren]()) {
  51894. if (child[$nodeName] === "#text") {
  51895. measure.addString(child[$content]);
  51896. continue;
  51897. }
  51898. child[$pushGlyphs](measure);
  51899. }
  51900. }
  51901. if (mustPop) {
  51902. measure.popFont();
  51903. }
  51904. }
  51905. [$toHTML](availableSpace) {
  51906. const children = [];
  51907. this[$extra] = {
  51908. children
  51909. };
  51910. this[$childrenToHTML]({});
  51911. if (children.length === 0 && !this[$content]) {
  51912. return HTMLResult.EMPTY;
  51913. }
  51914. let value;
  51915. if (this[$richText]) {
  51916. value = this[$content] ? this[$content].replaceAll(crlfForRichTextRegExp, "\n") : undefined;
  51917. } else {
  51918. value = this[$content] || undefined;
  51919. }
  51920. return HTMLResult.success({
  51921. name: this[$nodeName],
  51922. attributes: {
  51923. href: this.href,
  51924. style: mapStyle(this.style, this, this[$richText])
  51925. },
  51926. children,
  51927. value
  51928. });
  51929. }
  51930. }
  51931. class A extends XhtmlObject {
  51932. constructor(attributes) {
  51933. super(attributes, "a");
  51934. this.href = fixURL(attributes.href) || "";
  51935. }
  51936. }
  51937. class B extends XhtmlObject {
  51938. constructor(attributes) {
  51939. super(attributes, "b");
  51940. }
  51941. [$pushGlyphs](measure) {
  51942. measure.pushFont({
  51943. weight: "bold"
  51944. });
  51945. super[$pushGlyphs](measure);
  51946. measure.popFont();
  51947. }
  51948. }
  51949. class Body extends XhtmlObject {
  51950. constructor(attributes) {
  51951. super(attributes, "body");
  51952. }
  51953. [$toHTML](availableSpace) {
  51954. const res = super[$toHTML](availableSpace);
  51955. const {
  51956. html
  51957. } = res;
  51958. if (!html) {
  51959. return HTMLResult.EMPTY;
  51960. }
  51961. html.name = "div";
  51962. html.attributes.class = ["xfaRich"];
  51963. return res;
  51964. }
  51965. }
  51966. class Br extends XhtmlObject {
  51967. constructor(attributes) {
  51968. super(attributes, "br");
  51969. }
  51970. [$text]() {
  51971. return "\n";
  51972. }
  51973. [$pushGlyphs](measure) {
  51974. measure.addString("\n");
  51975. }
  51976. [$toHTML](availableSpace) {
  51977. return HTMLResult.success({
  51978. name: "br"
  51979. });
  51980. }
  51981. }
  51982. class Html extends XhtmlObject {
  51983. constructor(attributes) {
  51984. super(attributes, "html");
  51985. }
  51986. [$toHTML](availableSpace) {
  51987. const children = [];
  51988. this[$extra] = {
  51989. children
  51990. };
  51991. this[$childrenToHTML]({});
  51992. if (children.length === 0) {
  51993. return HTMLResult.success({
  51994. name: "div",
  51995. attributes: {
  51996. class: ["xfaRich"],
  51997. style: {}
  51998. },
  51999. value: this[$content] || ""
  52000. });
  52001. }
  52002. if (children.length === 1) {
  52003. const child = children[0];
  52004. if (child.attributes?.class.includes("xfaRich")) {
  52005. return HTMLResult.success(child);
  52006. }
  52007. }
  52008. return HTMLResult.success({
  52009. name: "div",
  52010. attributes: {
  52011. class: ["xfaRich"],
  52012. style: {}
  52013. },
  52014. children
  52015. });
  52016. }
  52017. }
  52018. class I extends XhtmlObject {
  52019. constructor(attributes) {
  52020. super(attributes, "i");
  52021. }
  52022. [$pushGlyphs](measure) {
  52023. measure.pushFont({
  52024. posture: "italic"
  52025. });
  52026. super[$pushGlyphs](measure);
  52027. measure.popFont();
  52028. }
  52029. }
  52030. class Li extends XhtmlObject {
  52031. constructor(attributes) {
  52032. super(attributes, "li");
  52033. }
  52034. }
  52035. class Ol extends XhtmlObject {
  52036. constructor(attributes) {
  52037. super(attributes, "ol");
  52038. }
  52039. }
  52040. class P extends XhtmlObject {
  52041. constructor(attributes) {
  52042. super(attributes, "p");
  52043. }
  52044. [$pushGlyphs](measure) {
  52045. super[$pushGlyphs](measure, false);
  52046. measure.addString("\n");
  52047. measure.addPara();
  52048. measure.popFont();
  52049. }
  52050. [$text]() {
  52051. const siblings = this[$getParent]()[$getChildren]();
  52052. if (siblings.at(-1) === this) {
  52053. return super[$text]();
  52054. }
  52055. return super[$text]() + "\n";
  52056. }
  52057. }
  52058. class Span extends XhtmlObject {
  52059. constructor(attributes) {
  52060. super(attributes, "span");
  52061. }
  52062. }
  52063. class Sub extends XhtmlObject {
  52064. constructor(attributes) {
  52065. super(attributes, "sub");
  52066. }
  52067. }
  52068. class Sup extends XhtmlObject {
  52069. constructor(attributes) {
  52070. super(attributes, "sup");
  52071. }
  52072. }
  52073. class Ul extends XhtmlObject {
  52074. constructor(attributes) {
  52075. super(attributes, "ul");
  52076. }
  52077. }
  52078. class XhtmlNamespace {
  52079. static [$buildXFAObject](name, attributes) {
  52080. if (XhtmlNamespace.hasOwnProperty(name)) {
  52081. return XhtmlNamespace[name](attributes);
  52082. }
  52083. return undefined;
  52084. }
  52085. static a(attributes) {
  52086. return new A(attributes);
  52087. }
  52088. static b(attributes) {
  52089. return new B(attributes);
  52090. }
  52091. static body(attributes) {
  52092. return new Body(attributes);
  52093. }
  52094. static br(attributes) {
  52095. return new Br(attributes);
  52096. }
  52097. static html(attributes) {
  52098. return new Html(attributes);
  52099. }
  52100. static i(attributes) {
  52101. return new I(attributes);
  52102. }
  52103. static li(attributes) {
  52104. return new Li(attributes);
  52105. }
  52106. static ol(attributes) {
  52107. return new Ol(attributes);
  52108. }
  52109. static p(attributes) {
  52110. return new P(attributes);
  52111. }
  52112. static span(attributes) {
  52113. return new Span(attributes);
  52114. }
  52115. static sub(attributes) {
  52116. return new Sub(attributes);
  52117. }
  52118. static sup(attributes) {
  52119. return new Sup(attributes);
  52120. }
  52121. static ul(attributes) {
  52122. return new Ul(attributes);
  52123. }
  52124. }
  52125. ;// ./src/core/xfa/setup.js
  52126. const NamespaceSetUp = {
  52127. config: ConfigNamespace,
  52128. connection: ConnectionSetNamespace,
  52129. datasets: DatasetsNamespace,
  52130. localeSet: LocaleSetNamespace,
  52131. signature: SignatureNamespace,
  52132. stylesheet: StylesheetNamespace,
  52133. template: TemplateNamespace,
  52134. xdp: XdpNamespace,
  52135. xhtml: XhtmlNamespace
  52136. };
  52137. ;// ./src/core/xfa/unknown.js
  52138. class UnknownNamespace {
  52139. constructor(nsId) {
  52140. this.namespaceId = nsId;
  52141. }
  52142. [$buildXFAObject](name, attributes) {
  52143. return new XmlObject(this.namespaceId, name, attributes);
  52144. }
  52145. }
  52146. ;// ./src/core/xfa/builder.js
  52147. class Root extends XFAObject {
  52148. constructor(ids) {
  52149. super(-1, "root", Object.create(null));
  52150. this.element = null;
  52151. this[$ids] = ids;
  52152. }
  52153. [$onChild](child) {
  52154. this.element = child;
  52155. return true;
  52156. }
  52157. [$finalize]() {
  52158. super[$finalize]();
  52159. if (this.element.template instanceof Template) {
  52160. this[$ids].set($root, this.element);
  52161. this.element.template[$resolvePrototypes](this[$ids]);
  52162. this.element.template[$ids] = this[$ids];
  52163. }
  52164. }
  52165. }
  52166. class Empty extends XFAObject {
  52167. constructor() {
  52168. super(-1, "", Object.create(null));
  52169. }
  52170. [$onChild](_) {
  52171. return false;
  52172. }
  52173. }
  52174. class Builder {
  52175. constructor(rootNameSpace = null) {
  52176. this._namespaceStack = [];
  52177. this._nsAgnosticLevel = 0;
  52178. this._namespacePrefixes = new Map();
  52179. this._namespaces = new Map();
  52180. this._nextNsId = Math.max(...Object.values(NamespaceIds).map(({
  52181. id
  52182. }) => id));
  52183. this._currentNamespace = rootNameSpace || new UnknownNamespace(++this._nextNsId);
  52184. }
  52185. buildRoot(ids) {
  52186. return new Root(ids);
  52187. }
  52188. build({
  52189. nsPrefix,
  52190. name,
  52191. attributes,
  52192. namespace,
  52193. prefixes
  52194. }) {
  52195. const hasNamespaceDef = namespace !== null;
  52196. if (hasNamespaceDef) {
  52197. this._namespaceStack.push(this._currentNamespace);
  52198. this._currentNamespace = this._searchNamespace(namespace);
  52199. }
  52200. if (prefixes) {
  52201. this._addNamespacePrefix(prefixes);
  52202. }
  52203. if (attributes.hasOwnProperty($nsAttributes)) {
  52204. const dataTemplate = NamespaceSetUp.datasets;
  52205. const nsAttrs = attributes[$nsAttributes];
  52206. let xfaAttrs = null;
  52207. for (const [ns, attrs] of Object.entries(nsAttrs)) {
  52208. const nsToUse = this._getNamespaceToUse(ns);
  52209. if (nsToUse === dataTemplate) {
  52210. xfaAttrs = {
  52211. xfa: attrs
  52212. };
  52213. break;
  52214. }
  52215. }
  52216. if (xfaAttrs) {
  52217. attributes[$nsAttributes] = xfaAttrs;
  52218. } else {
  52219. delete attributes[$nsAttributes];
  52220. }
  52221. }
  52222. const namespaceToUse = this._getNamespaceToUse(nsPrefix);
  52223. const node = namespaceToUse?.[$buildXFAObject](name, attributes) || new Empty();
  52224. if (node[$isNsAgnostic]()) {
  52225. this._nsAgnosticLevel++;
  52226. }
  52227. if (hasNamespaceDef || prefixes || node[$isNsAgnostic]()) {
  52228. node[$cleanup] = {
  52229. hasNamespace: hasNamespaceDef,
  52230. prefixes,
  52231. nsAgnostic: node[$isNsAgnostic]()
  52232. };
  52233. }
  52234. return node;
  52235. }
  52236. isNsAgnostic() {
  52237. return this._nsAgnosticLevel > 0;
  52238. }
  52239. _searchNamespace(nsName) {
  52240. let ns = this._namespaces.get(nsName);
  52241. if (ns) {
  52242. return ns;
  52243. }
  52244. for (const [name, {
  52245. check
  52246. }] of Object.entries(NamespaceIds)) {
  52247. if (check(nsName)) {
  52248. ns = NamespaceSetUp[name];
  52249. if (ns) {
  52250. this._namespaces.set(nsName, ns);
  52251. return ns;
  52252. }
  52253. break;
  52254. }
  52255. }
  52256. ns = new UnknownNamespace(++this._nextNsId);
  52257. this._namespaces.set(nsName, ns);
  52258. return ns;
  52259. }
  52260. _addNamespacePrefix(prefixes) {
  52261. for (const {
  52262. prefix,
  52263. value
  52264. } of prefixes) {
  52265. const namespace = this._searchNamespace(value);
  52266. let prefixStack = this._namespacePrefixes.get(prefix);
  52267. if (!prefixStack) {
  52268. prefixStack = [];
  52269. this._namespacePrefixes.set(prefix, prefixStack);
  52270. }
  52271. prefixStack.push(namespace);
  52272. }
  52273. }
  52274. _getNamespaceToUse(prefix) {
  52275. if (!prefix) {
  52276. return this._currentNamespace;
  52277. }
  52278. const prefixStack = this._namespacePrefixes.get(prefix);
  52279. if (prefixStack?.length > 0) {
  52280. return prefixStack.at(-1);
  52281. }
  52282. warn(`Unknown namespace prefix: ${prefix}.`);
  52283. return null;
  52284. }
  52285. clean(data) {
  52286. const {
  52287. hasNamespace,
  52288. prefixes,
  52289. nsAgnostic
  52290. } = data;
  52291. if (hasNamespace) {
  52292. this._currentNamespace = this._namespaceStack.pop();
  52293. }
  52294. if (prefixes) {
  52295. prefixes.forEach(({
  52296. prefix
  52297. }) => {
  52298. this._namespacePrefixes.get(prefix).pop();
  52299. });
  52300. }
  52301. if (nsAgnostic) {
  52302. this._nsAgnosticLevel--;
  52303. }
  52304. }
  52305. }
  52306. ;// ./src/core/xfa/parser.js
  52307. class XFAParser extends XMLParserBase {
  52308. constructor(rootNameSpace = null, richText = false) {
  52309. super();
  52310. this._builder = new Builder(rootNameSpace);
  52311. this._stack = [];
  52312. this._globalData = {
  52313. usedTypefaces: new Set()
  52314. };
  52315. this._ids = new Map();
  52316. this._current = this._builder.buildRoot(this._ids);
  52317. this._errorCode = XMLParserErrorCode.NoError;
  52318. this._whiteRegex = /^\s+$/;
  52319. this._nbsps = /\xa0+/g;
  52320. this._richText = richText;
  52321. }
  52322. parse(data) {
  52323. this.parseXml(data);
  52324. if (this._errorCode !== XMLParserErrorCode.NoError) {
  52325. return undefined;
  52326. }
  52327. this._current[$finalize]();
  52328. return this._current.element;
  52329. }
  52330. onText(text) {
  52331. text = text.replace(this._nbsps, match => match.slice(1) + " ");
  52332. if (this._richText || this._current[$acceptWhitespace]()) {
  52333. this._current[$onText](text, this._richText);
  52334. return;
  52335. }
  52336. if (this._whiteRegex.test(text)) {
  52337. return;
  52338. }
  52339. this._current[$onText](text.trim());
  52340. }
  52341. onCdata(text) {
  52342. this._current[$onText](text);
  52343. }
  52344. _mkAttributes(attributes, tagName) {
  52345. let namespace = null;
  52346. let prefixes = null;
  52347. const attributeObj = Object.create({});
  52348. for (const {
  52349. name,
  52350. value
  52351. } of attributes) {
  52352. if (name === "xmlns") {
  52353. if (!namespace) {
  52354. namespace = value;
  52355. } else {
  52356. warn(`XFA - multiple namespace definition in <${tagName}>`);
  52357. }
  52358. } else if (name.startsWith("xmlns:")) {
  52359. const prefix = name.substring("xmlns:".length);
  52360. if (!prefixes) {
  52361. prefixes = [];
  52362. }
  52363. prefixes.push({
  52364. prefix,
  52365. value
  52366. });
  52367. } else {
  52368. const i = name.indexOf(":");
  52369. if (i === -1) {
  52370. attributeObj[name] = value;
  52371. } else {
  52372. let nsAttrs = attributeObj[$nsAttributes];
  52373. if (!nsAttrs) {
  52374. nsAttrs = attributeObj[$nsAttributes] = Object.create(null);
  52375. }
  52376. const [ns, attrName] = [name.slice(0, i), name.slice(i + 1)];
  52377. const attrs = nsAttrs[ns] ||= Object.create(null);
  52378. attrs[attrName] = value;
  52379. }
  52380. }
  52381. }
  52382. return [namespace, prefixes, attributeObj];
  52383. }
  52384. _getNameAndPrefix(name, nsAgnostic) {
  52385. const i = name.indexOf(":");
  52386. if (i === -1) {
  52387. return [name, null];
  52388. }
  52389. return [name.substring(i + 1), nsAgnostic ? "" : name.substring(0, i)];
  52390. }
  52391. onBeginElement(tagName, attributes, isEmpty) {
  52392. const [namespace, prefixes, attributesObj] = this._mkAttributes(attributes, tagName);
  52393. const [name, nsPrefix] = this._getNameAndPrefix(tagName, this._builder.isNsAgnostic());
  52394. const node = this._builder.build({
  52395. nsPrefix,
  52396. name,
  52397. attributes: attributesObj,
  52398. namespace,
  52399. prefixes
  52400. });
  52401. node[$globalData] = this._globalData;
  52402. if (isEmpty) {
  52403. node[$finalize]();
  52404. if (this._current[$onChild](node)) {
  52405. node[$setId](this._ids);
  52406. }
  52407. node[$clean](this._builder);
  52408. return;
  52409. }
  52410. this._stack.push(this._current);
  52411. this._current = node;
  52412. }
  52413. onEndElement(name) {
  52414. const node = this._current;
  52415. if (node[$isCDATAXml]() && typeof node[$content] === "string") {
  52416. const parser = new XFAParser();
  52417. parser._globalData = this._globalData;
  52418. const root = parser.parse(node[$content]);
  52419. node[$content] = null;
  52420. node[$onChild](root);
  52421. }
  52422. node[$finalize]();
  52423. this._current = this._stack.pop();
  52424. if (this._current[$onChild](node)) {
  52425. node[$setId](this._ids);
  52426. }
  52427. node[$clean](this._builder);
  52428. }
  52429. onError(code) {
  52430. this._errorCode = code;
  52431. }
  52432. }
  52433. ;// ./src/core/xfa/factory.js
  52434. class XFAFactory {
  52435. constructor(data) {
  52436. try {
  52437. this.root = new XFAParser().parse(XFAFactory._createDocument(data));
  52438. const binder = new Binder(this.root);
  52439. this.form = binder.bind();
  52440. this.dataHandler = new DataHandler(this.root, binder.getData());
  52441. this.form[$globalData].template = this.form;
  52442. } catch (e) {
  52443. warn(`XFA - an error occurred during parsing and binding: ${e}`);
  52444. }
  52445. }
  52446. isValid() {
  52447. return this.root && this.form;
  52448. }
  52449. _createPagesHelper() {
  52450. const iterator = this.form[$toPages]();
  52451. return new Promise((resolve, reject) => {
  52452. const nextIteration = () => {
  52453. try {
  52454. const value = iterator.next();
  52455. if (value.done) {
  52456. resolve(value.value);
  52457. } else {
  52458. setTimeout(nextIteration, 0);
  52459. }
  52460. } catch (e) {
  52461. reject(e);
  52462. }
  52463. };
  52464. setTimeout(nextIteration, 0);
  52465. });
  52466. }
  52467. async _createPages() {
  52468. try {
  52469. this.pages = await this._createPagesHelper();
  52470. this.dims = this.pages.children.map(c => {
  52471. const {
  52472. width,
  52473. height
  52474. } = c.attributes.style;
  52475. return [0, 0, parseInt(width), parseInt(height)];
  52476. });
  52477. } catch (e) {
  52478. warn(`XFA - an error occurred during layout: ${e}`);
  52479. }
  52480. }
  52481. getBoundingBox(pageIndex) {
  52482. return this.dims[pageIndex];
  52483. }
  52484. async getNumPages() {
  52485. if (!this.pages) {
  52486. await this._createPages();
  52487. }
  52488. return this.dims.length;
  52489. }
  52490. setImages(images) {
  52491. this.form[$globalData].images = images;
  52492. }
  52493. setFonts(fonts) {
  52494. this.form[$globalData].fontFinder = new FontFinder(fonts);
  52495. const missingFonts = [];
  52496. for (let typeface of this.form[$globalData].usedTypefaces) {
  52497. typeface = stripQuotes(typeface);
  52498. const font = this.form[$globalData].fontFinder.find(typeface);
  52499. if (!font) {
  52500. missingFonts.push(typeface);
  52501. }
  52502. }
  52503. if (missingFonts.length > 0) {
  52504. return missingFonts;
  52505. }
  52506. return null;
  52507. }
  52508. appendFonts(fonts, reallyMissingFonts) {
  52509. this.form[$globalData].fontFinder.add(fonts, reallyMissingFonts);
  52510. }
  52511. async getPages() {
  52512. if (!this.pages) {
  52513. await this._createPages();
  52514. }
  52515. const pages = this.pages;
  52516. this.pages = null;
  52517. return pages;
  52518. }
  52519. serializeData(storage) {
  52520. return this.dataHandler.serialize(storage);
  52521. }
  52522. static _createDocument(data) {
  52523. if (!data["/xdp:xdp"]) {
  52524. return data["xdp:xdp"];
  52525. }
  52526. return Object.values(data).join("");
  52527. }
  52528. static getRichTextAsHtml(rc) {
  52529. if (!rc || typeof rc !== "string") {
  52530. return null;
  52531. }
  52532. try {
  52533. let root = new XFAParser(XhtmlNamespace, true).parse(rc);
  52534. if (!["body", "xhtml"].includes(root[$nodeName])) {
  52535. const newRoot = XhtmlNamespace.body({});
  52536. newRoot[$appendChild](root);
  52537. root = newRoot;
  52538. }
  52539. const result = root[$toHTML]();
  52540. if (!result.success) {
  52541. return null;
  52542. }
  52543. const {
  52544. html
  52545. } = result;
  52546. const {
  52547. attributes
  52548. } = html;
  52549. if (attributes) {
  52550. if (attributes.class) {
  52551. attributes.class = attributes.class.filter(attr => !attr.startsWith("xfa"));
  52552. }
  52553. attributes.dir = "auto";
  52554. }
  52555. return {
  52556. html,
  52557. str: root[$text]()
  52558. };
  52559. } catch (e) {
  52560. warn(`XFA - an error occurred during parsing of rich text: ${e}`);
  52561. }
  52562. return null;
  52563. }
  52564. }
  52565. ;// ./src/core/annotation.js
  52566. class AnnotationFactory {
  52567. static createGlobals(pdfManager) {
  52568. return Promise.all([pdfManager.ensureCatalog("acroForm"), pdfManager.ensureDoc("xfaDatasets"), pdfManager.ensureCatalog("structTreeRoot"), pdfManager.ensureCatalog("baseUrl"), pdfManager.ensureCatalog("attachments")]).then(([acroForm, xfaDatasets, structTreeRoot, baseUrl, attachments]) => {
  52569. return {
  52570. pdfManager,
  52571. acroForm: acroForm instanceof Dict ? acroForm : Dict.empty,
  52572. xfaDatasets,
  52573. structTreeRoot,
  52574. baseUrl,
  52575. attachments
  52576. };
  52577. }, reason => {
  52578. warn(`createGlobals: "${reason}".`);
  52579. return null;
  52580. });
  52581. }
  52582. static async create(xref, ref, annotationGlobals, idFactory, collectFields, orphanFields, pageRef) {
  52583. const pageIndex = collectFields ? await this._getPageIndex(xref, ref, annotationGlobals.pdfManager) : null;
  52584. return annotationGlobals.pdfManager.ensure(this, "_create", [xref, ref, annotationGlobals, idFactory, collectFields, orphanFields, pageIndex, pageRef]);
  52585. }
  52586. static _create(xref, ref, annotationGlobals, idFactory, collectFields = false, orphanFields = null, pageIndex = null, pageRef = null) {
  52587. const dict = xref.fetchIfRef(ref);
  52588. if (!(dict instanceof Dict)) {
  52589. return undefined;
  52590. }
  52591. const {
  52592. acroForm,
  52593. pdfManager
  52594. } = annotationGlobals;
  52595. const id = ref instanceof Ref ? ref.toString() : `annot_${idFactory.createObjId()}`;
  52596. let subtype = dict.get("Subtype");
  52597. subtype = subtype instanceof Name ? subtype.name : null;
  52598. const parameters = {
  52599. xref,
  52600. ref,
  52601. dict,
  52602. subtype,
  52603. id,
  52604. annotationGlobals,
  52605. collectFields,
  52606. orphanFields,
  52607. needAppearances: !collectFields && acroForm.get("NeedAppearances") === true,
  52608. pageIndex,
  52609. evaluatorOptions: pdfManager.evaluatorOptions,
  52610. pageRef
  52611. };
  52612. switch (subtype) {
  52613. case "Link":
  52614. return new LinkAnnotation(parameters);
  52615. case "Text":
  52616. return new TextAnnotation(parameters);
  52617. case "Widget":
  52618. let fieldType = getInheritableProperty({
  52619. dict,
  52620. key: "FT"
  52621. });
  52622. fieldType = fieldType instanceof Name ? fieldType.name : null;
  52623. switch (fieldType) {
  52624. case "Tx":
  52625. return new TextWidgetAnnotation(parameters);
  52626. case "Btn":
  52627. return new ButtonWidgetAnnotation(parameters);
  52628. case "Ch":
  52629. return new ChoiceWidgetAnnotation(parameters);
  52630. case "Sig":
  52631. return new SignatureWidgetAnnotation(parameters);
  52632. }
  52633. warn(`Unimplemented widget field type "${fieldType}", ` + "falling back to base field type.");
  52634. return new WidgetAnnotation(parameters);
  52635. case "Popup":
  52636. return new PopupAnnotation(parameters);
  52637. case "FreeText":
  52638. return new FreeTextAnnotation(parameters);
  52639. case "Line":
  52640. return new LineAnnotation(parameters);
  52641. case "Square":
  52642. return new SquareAnnotation(parameters);
  52643. case "Circle":
  52644. return new CircleAnnotation(parameters);
  52645. case "PolyLine":
  52646. return new PolylineAnnotation(parameters);
  52647. case "Polygon":
  52648. return new PolygonAnnotation(parameters);
  52649. case "Caret":
  52650. return new CaretAnnotation(parameters);
  52651. case "Ink":
  52652. return new InkAnnotation(parameters);
  52653. case "Highlight":
  52654. return new HighlightAnnotation(parameters);
  52655. case "Underline":
  52656. return new UnderlineAnnotation(parameters);
  52657. case "Squiggly":
  52658. return new SquigglyAnnotation(parameters);
  52659. case "StrikeOut":
  52660. return new StrikeOutAnnotation(parameters);
  52661. case "Stamp":
  52662. return new StampAnnotation(parameters);
  52663. case "FileAttachment":
  52664. return new FileAttachmentAnnotation(parameters);
  52665. default:
  52666. if (!collectFields) {
  52667. if (!subtype) {
  52668. warn("Annotation is missing the required /Subtype.");
  52669. } else {
  52670. warn(`Unimplemented annotation type "${subtype}", ` + "falling back to base annotation.");
  52671. }
  52672. }
  52673. return new Annotation(parameters);
  52674. }
  52675. }
  52676. static async _getPageIndex(xref, ref, pdfManager) {
  52677. try {
  52678. const annotDict = await xref.fetchIfRefAsync(ref);
  52679. if (!(annotDict instanceof Dict)) {
  52680. return -1;
  52681. }
  52682. const pageRef = annotDict.getRaw("P");
  52683. if (pageRef instanceof Ref) {
  52684. try {
  52685. const pageIndex = await pdfManager.ensureCatalog("getPageIndex", [pageRef]);
  52686. return pageIndex;
  52687. } catch (ex) {
  52688. info(`_getPageIndex -- not a valid page reference: "${ex}".`);
  52689. }
  52690. }
  52691. if (annotDict.has("Kids")) {
  52692. return -1;
  52693. }
  52694. const numPages = await pdfManager.ensureDoc("numPages");
  52695. for (let pageIndex = 0; pageIndex < numPages; pageIndex++) {
  52696. const page = await pdfManager.getPage(pageIndex);
  52697. const annotations = await pdfManager.ensure(page, "annotations");
  52698. for (const annotRef of annotations) {
  52699. if (annotRef instanceof Ref && isRefsEqual(annotRef, ref)) {
  52700. return pageIndex;
  52701. }
  52702. }
  52703. }
  52704. } catch (ex) {
  52705. warn(`_getPageIndex: "${ex}".`);
  52706. }
  52707. return -1;
  52708. }
  52709. static generateImages(annotations, xref, isOffscreenCanvasSupported) {
  52710. if (!isOffscreenCanvasSupported) {
  52711. warn("generateImages: OffscreenCanvas is not supported, cannot save or print some annotations with images.");
  52712. return null;
  52713. }
  52714. let imagePromises;
  52715. for (const {
  52716. bitmapId,
  52717. bitmap
  52718. } of annotations) {
  52719. if (!bitmap) {
  52720. continue;
  52721. }
  52722. imagePromises ||= new Map();
  52723. imagePromises.set(bitmapId, StampAnnotation.createImage(bitmap, xref));
  52724. }
  52725. return imagePromises;
  52726. }
  52727. static async saveNewAnnotations(evaluator, task, annotations, imagePromises) {
  52728. const xref = evaluator.xref;
  52729. let baseFontRef;
  52730. const dependencies = [];
  52731. const promises = [];
  52732. const {
  52733. isOffscreenCanvasSupported
  52734. } = evaluator.options;
  52735. for (const annotation of annotations) {
  52736. if (annotation.deleted) {
  52737. continue;
  52738. }
  52739. switch (annotation.annotationType) {
  52740. case AnnotationEditorType.FREETEXT:
  52741. if (!baseFontRef) {
  52742. const baseFont = new Dict(xref);
  52743. baseFont.set("BaseFont", Name.get("Helvetica"));
  52744. baseFont.set("Type", Name.get("Font"));
  52745. baseFont.set("Subtype", Name.get("Type1"));
  52746. baseFont.set("Encoding", Name.get("WinAnsiEncoding"));
  52747. const buffer = [];
  52748. baseFontRef = xref.getNewTemporaryRef();
  52749. await writeObject(baseFontRef, baseFont, buffer, xref);
  52750. dependencies.push({
  52751. ref: baseFontRef,
  52752. data: buffer.join("")
  52753. });
  52754. }
  52755. promises.push(FreeTextAnnotation.createNewAnnotation(xref, annotation, dependencies, {
  52756. evaluator,
  52757. task,
  52758. baseFontRef
  52759. }));
  52760. break;
  52761. case AnnotationEditorType.HIGHLIGHT:
  52762. if (annotation.quadPoints) {
  52763. promises.push(HighlightAnnotation.createNewAnnotation(xref, annotation, dependencies));
  52764. } else {
  52765. promises.push(InkAnnotation.createNewAnnotation(xref, annotation, dependencies));
  52766. }
  52767. break;
  52768. case AnnotationEditorType.INK:
  52769. promises.push(InkAnnotation.createNewAnnotation(xref, annotation, dependencies));
  52770. break;
  52771. case AnnotationEditorType.STAMP:
  52772. const image = isOffscreenCanvasSupported ? await imagePromises?.get(annotation.bitmapId) : null;
  52773. if (image?.imageStream) {
  52774. const {
  52775. imageStream,
  52776. smaskStream
  52777. } = image;
  52778. const buffer = [];
  52779. if (smaskStream) {
  52780. const smaskRef = xref.getNewTemporaryRef();
  52781. await writeObject(smaskRef, smaskStream, buffer, xref);
  52782. dependencies.push({
  52783. ref: smaskRef,
  52784. data: buffer.join("")
  52785. });
  52786. imageStream.dict.set("SMask", smaskRef);
  52787. buffer.length = 0;
  52788. }
  52789. const imageRef = image.imageRef = xref.getNewTemporaryRef();
  52790. await writeObject(imageRef, imageStream, buffer, xref);
  52791. dependencies.push({
  52792. ref: imageRef,
  52793. data: buffer.join("")
  52794. });
  52795. image.imageStream = image.smaskStream = null;
  52796. }
  52797. promises.push(StampAnnotation.createNewAnnotation(xref, annotation, dependencies, {
  52798. image
  52799. }));
  52800. break;
  52801. }
  52802. }
  52803. return {
  52804. annotations: await Promise.all(promises),
  52805. dependencies
  52806. };
  52807. }
  52808. static async printNewAnnotations(annotationGlobals, evaluator, task, annotations, imagePromises) {
  52809. if (!annotations) {
  52810. return null;
  52811. }
  52812. const {
  52813. options,
  52814. xref
  52815. } = evaluator;
  52816. const promises = [];
  52817. for (const annotation of annotations) {
  52818. if (annotation.deleted) {
  52819. continue;
  52820. }
  52821. switch (annotation.annotationType) {
  52822. case AnnotationEditorType.FREETEXT:
  52823. promises.push(FreeTextAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, {
  52824. evaluator,
  52825. task,
  52826. evaluatorOptions: options
  52827. }));
  52828. break;
  52829. case AnnotationEditorType.HIGHLIGHT:
  52830. if (annotation.quadPoints) {
  52831. promises.push(HighlightAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, {
  52832. evaluatorOptions: options
  52833. }));
  52834. } else {
  52835. promises.push(InkAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, {
  52836. evaluatorOptions: options
  52837. }));
  52838. }
  52839. break;
  52840. case AnnotationEditorType.INK:
  52841. promises.push(InkAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, {
  52842. evaluatorOptions: options
  52843. }));
  52844. break;
  52845. case AnnotationEditorType.STAMP:
  52846. const image = options.isOffscreenCanvasSupported ? await imagePromises?.get(annotation.bitmapId) : null;
  52847. if (image?.imageStream) {
  52848. const {
  52849. imageStream,
  52850. smaskStream
  52851. } = image;
  52852. if (smaskStream) {
  52853. imageStream.dict.set("SMask", smaskStream);
  52854. }
  52855. image.imageRef = new JpegStream(imageStream, imageStream.length);
  52856. image.imageStream = image.smaskStream = null;
  52857. }
  52858. promises.push(StampAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, {
  52859. image,
  52860. evaluatorOptions: options
  52861. }));
  52862. break;
  52863. }
  52864. }
  52865. return Promise.all(promises);
  52866. }
  52867. }
  52868. function getRgbColor(color, defaultColor = new Uint8ClampedArray(3)) {
  52869. if (!Array.isArray(color)) {
  52870. return defaultColor;
  52871. }
  52872. const rgbColor = defaultColor || new Uint8ClampedArray(3);
  52873. switch (color.length) {
  52874. case 0:
  52875. return null;
  52876. case 1:
  52877. ColorSpace.singletons.gray.getRgbItem(color, 0, rgbColor, 0);
  52878. return rgbColor;
  52879. case 3:
  52880. ColorSpace.singletons.rgb.getRgbItem(color, 0, rgbColor, 0);
  52881. return rgbColor;
  52882. case 4:
  52883. ColorSpace.singletons.cmyk.getRgbItem(color, 0, rgbColor, 0);
  52884. return rgbColor;
  52885. default:
  52886. return defaultColor;
  52887. }
  52888. }
  52889. function getPdfColorArray(color) {
  52890. return Array.from(color, c => c / 255);
  52891. }
  52892. function getQuadPoints(dict, rect) {
  52893. const quadPoints = dict.getArray("QuadPoints");
  52894. if (!isNumberArray(quadPoints, null) || quadPoints.length === 0 || quadPoints.length % 8 > 0) {
  52895. return null;
  52896. }
  52897. const newQuadPoints = new Float32Array(quadPoints.length);
  52898. for (let i = 0, ii = quadPoints.length; i < ii; i += 8) {
  52899. const [x1, y1, x2, y2, x3, y3, x4, y4] = quadPoints.slice(i, i + 8);
  52900. const minX = Math.min(x1, x2, x3, x4);
  52901. const maxX = Math.max(x1, x2, x3, x4);
  52902. const minY = Math.min(y1, y2, y3, y4);
  52903. const maxY = Math.max(y1, y2, y3, y4);
  52904. if (rect !== null && (minX < rect[0] || maxX > rect[2] || minY < rect[1] || maxY > rect[3])) {
  52905. return null;
  52906. }
  52907. newQuadPoints.set([minX, maxY, maxX, maxY, minX, minY, maxX, minY], i);
  52908. }
  52909. return newQuadPoints;
  52910. }
  52911. function getTransformMatrix(rect, bbox, matrix) {
  52912. const [minX, minY, maxX, maxY] = Util.getAxialAlignedBoundingBox(bbox, matrix);
  52913. if (minX === maxX || minY === maxY) {
  52914. return [1, 0, 0, 1, rect[0], rect[1]];
  52915. }
  52916. const xRatio = (rect[2] - rect[0]) / (maxX - minX);
  52917. const yRatio = (rect[3] - rect[1]) / (maxY - minY);
  52918. return [xRatio, 0, 0, yRatio, rect[0] - minX * xRatio, rect[1] - minY * yRatio];
  52919. }
  52920. class Annotation {
  52921. constructor(params) {
  52922. const {
  52923. dict,
  52924. xref,
  52925. annotationGlobals,
  52926. ref,
  52927. orphanFields
  52928. } = params;
  52929. const parentRef = orphanFields?.get(ref);
  52930. if (parentRef) {
  52931. dict.set("Parent", parentRef);
  52932. }
  52933. this.setTitle(dict.get("T"));
  52934. this.setContents(dict.get("Contents"));
  52935. this.setModificationDate(dict.get("M"));
  52936. this.setFlags(dict.get("F"));
  52937. this.setRectangle(dict.getArray("Rect"));
  52938. this.setColor(dict.getArray("C"));
  52939. this.setBorderStyle(dict);
  52940. this.setAppearance(dict);
  52941. this.setOptionalContent(dict);
  52942. const MK = dict.get("MK");
  52943. this.setBorderAndBackgroundColors(MK);
  52944. this.setRotation(MK, dict);
  52945. this.ref = params.ref instanceof Ref ? params.ref : null;
  52946. this._streams = [];
  52947. if (this.appearance) {
  52948. this._streams.push(this.appearance);
  52949. }
  52950. const isLocked = !!(this.flags & AnnotationFlag.LOCKED);
  52951. const isContentLocked = !!(this.flags & AnnotationFlag.LOCKEDCONTENTS);
  52952. this.data = {
  52953. annotationFlags: this.flags,
  52954. borderStyle: this.borderStyle,
  52955. color: this.color,
  52956. backgroundColor: this.backgroundColor,
  52957. borderColor: this.borderColor,
  52958. rotation: this.rotation,
  52959. contentsObj: this._contents,
  52960. hasAppearance: !!this.appearance,
  52961. id: params.id,
  52962. modificationDate: this.modificationDate,
  52963. rect: this.rectangle,
  52964. subtype: params.subtype,
  52965. hasOwnCanvas: false,
  52966. noRotate: !!(this.flags & AnnotationFlag.NOROTATE),
  52967. noHTML: isLocked && isContentLocked,
  52968. isEditable: false,
  52969. structParent: -1
  52970. };
  52971. if (annotationGlobals.structTreeRoot) {
  52972. let structParent = dict.get("StructParent");
  52973. this.data.structParent = structParent = Number.isInteger(structParent) && structParent >= 0 ? structParent : -1;
  52974. annotationGlobals.structTreeRoot.addAnnotationIdToPage(params.pageRef, structParent);
  52975. }
  52976. if (params.collectFields) {
  52977. const kids = dict.get("Kids");
  52978. if (Array.isArray(kids)) {
  52979. const kidIds = [];
  52980. for (const kid of kids) {
  52981. if (kid instanceof Ref) {
  52982. kidIds.push(kid.toString());
  52983. }
  52984. }
  52985. if (kidIds.length !== 0) {
  52986. this.data.kidIds = kidIds;
  52987. }
  52988. }
  52989. this.data.actions = collectActions(xref, dict, AnnotationActionEventType);
  52990. this.data.fieldName = this._constructFieldName(dict);
  52991. this.data.pageIndex = params.pageIndex;
  52992. }
  52993. const it = dict.get("IT");
  52994. if (it instanceof Name) {
  52995. this.data.it = it.name;
  52996. }
  52997. this._isOffscreenCanvasSupported = params.evaluatorOptions.isOffscreenCanvasSupported;
  52998. this._fallbackFontDict = null;
  52999. this._needAppearances = false;
  53000. }
  53001. _hasFlag(flags, flag) {
  53002. return !!(flags & flag);
  53003. }
  53004. _buildFlags(noView, noPrint) {
  53005. let {
  53006. flags
  53007. } = this;
  53008. if (noView === undefined) {
  53009. if (noPrint === undefined) {
  53010. return undefined;
  53011. }
  53012. if (noPrint) {
  53013. return flags & ~AnnotationFlag.PRINT;
  53014. }
  53015. return flags & ~AnnotationFlag.HIDDEN | AnnotationFlag.PRINT;
  53016. }
  53017. if (noView) {
  53018. flags |= AnnotationFlag.PRINT;
  53019. if (noPrint) {
  53020. return flags & ~AnnotationFlag.NOVIEW | AnnotationFlag.HIDDEN;
  53021. }
  53022. return flags & ~AnnotationFlag.HIDDEN | AnnotationFlag.NOVIEW;
  53023. }
  53024. flags &= ~(AnnotationFlag.HIDDEN | AnnotationFlag.NOVIEW);
  53025. if (noPrint) {
  53026. return flags & ~AnnotationFlag.PRINT;
  53027. }
  53028. return flags | AnnotationFlag.PRINT;
  53029. }
  53030. _isViewable(flags) {
  53031. return !this._hasFlag(flags, AnnotationFlag.INVISIBLE) && !this._hasFlag(flags, AnnotationFlag.NOVIEW);
  53032. }
  53033. _isPrintable(flags) {
  53034. return this._hasFlag(flags, AnnotationFlag.PRINT) && !this._hasFlag(flags, AnnotationFlag.HIDDEN) && !this._hasFlag(flags, AnnotationFlag.INVISIBLE);
  53035. }
  53036. mustBeViewed(annotationStorage, _renderForms) {
  53037. const noView = annotationStorage?.get(this.data.id)?.noView;
  53038. if (noView !== undefined) {
  53039. return !noView;
  53040. }
  53041. return this.viewable && !this._hasFlag(this.flags, AnnotationFlag.HIDDEN);
  53042. }
  53043. mustBePrinted(annotationStorage) {
  53044. const noPrint = annotationStorage?.get(this.data.id)?.noPrint;
  53045. if (noPrint !== undefined) {
  53046. return !noPrint;
  53047. }
  53048. return this.printable;
  53049. }
  53050. mustBeViewedWhenEditing(isEditing, modifiedIds = null) {
  53051. return isEditing ? !this.data.isEditable : !modifiedIds?.has(this.data.id);
  53052. }
  53053. get viewable() {
  53054. if (this.data.quadPoints === null) {
  53055. return false;
  53056. }
  53057. if (this.flags === 0) {
  53058. return true;
  53059. }
  53060. return this._isViewable(this.flags);
  53061. }
  53062. get printable() {
  53063. if (this.data.quadPoints === null) {
  53064. return false;
  53065. }
  53066. if (this.flags === 0) {
  53067. return false;
  53068. }
  53069. return this._isPrintable(this.flags);
  53070. }
  53071. _parseStringHelper(data) {
  53072. const str = typeof data === "string" ? stringToPDFString(data) : "";
  53073. const dir = str && bidi(str).dir === "rtl" ? "rtl" : "ltr";
  53074. return {
  53075. str,
  53076. dir
  53077. };
  53078. }
  53079. setDefaultAppearance(params) {
  53080. const {
  53081. dict,
  53082. annotationGlobals
  53083. } = params;
  53084. const defaultAppearance = getInheritableProperty({
  53085. dict,
  53086. key: "DA"
  53087. }) || annotationGlobals.acroForm.get("DA");
  53088. this._defaultAppearance = typeof defaultAppearance === "string" ? defaultAppearance : "";
  53089. this.data.defaultAppearanceData = parseDefaultAppearance(this._defaultAppearance);
  53090. }
  53091. setTitle(title) {
  53092. this._title = this._parseStringHelper(title);
  53093. }
  53094. setContents(contents) {
  53095. this._contents = this._parseStringHelper(contents);
  53096. }
  53097. setModificationDate(modificationDate) {
  53098. this.modificationDate = typeof modificationDate === "string" ? modificationDate : null;
  53099. }
  53100. setFlags(flags) {
  53101. this.flags = Number.isInteger(flags) && flags > 0 ? flags : 0;
  53102. if (this.flags & AnnotationFlag.INVISIBLE && this.constructor.name !== "Annotation") {
  53103. this.flags ^= AnnotationFlag.INVISIBLE;
  53104. }
  53105. }
  53106. hasFlag(flag) {
  53107. return this._hasFlag(this.flags, flag);
  53108. }
  53109. setRectangle(rectangle) {
  53110. this.rectangle = lookupNormalRect(rectangle, [0, 0, 0, 0]);
  53111. }
  53112. setColor(color) {
  53113. this.color = getRgbColor(color);
  53114. }
  53115. setLineEndings(lineEndings) {
  53116. this.lineEndings = ["None", "None"];
  53117. if (Array.isArray(lineEndings) && lineEndings.length === 2) {
  53118. for (let i = 0; i < 2; i++) {
  53119. const obj = lineEndings[i];
  53120. if (obj instanceof Name) {
  53121. switch (obj.name) {
  53122. case "None":
  53123. continue;
  53124. case "Square":
  53125. case "Circle":
  53126. case "Diamond":
  53127. case "OpenArrow":
  53128. case "ClosedArrow":
  53129. case "Butt":
  53130. case "ROpenArrow":
  53131. case "RClosedArrow":
  53132. case "Slash":
  53133. this.lineEndings[i] = obj.name;
  53134. continue;
  53135. }
  53136. }
  53137. warn(`Ignoring invalid lineEnding: ${obj}`);
  53138. }
  53139. }
  53140. }
  53141. setRotation(mk, dict) {
  53142. this.rotation = 0;
  53143. let angle = mk instanceof Dict ? mk.get("R") || 0 : dict.get("Rotate") || 0;
  53144. if (Number.isInteger(angle) && angle !== 0) {
  53145. angle %= 360;
  53146. if (angle < 0) {
  53147. angle += 360;
  53148. }
  53149. if (angle % 90 === 0) {
  53150. this.rotation = angle;
  53151. }
  53152. }
  53153. }
  53154. setBorderAndBackgroundColors(mk) {
  53155. if (mk instanceof Dict) {
  53156. this.borderColor = getRgbColor(mk.getArray("BC"), null);
  53157. this.backgroundColor = getRgbColor(mk.getArray("BG"), null);
  53158. } else {
  53159. this.borderColor = this.backgroundColor = null;
  53160. }
  53161. }
  53162. setBorderStyle(borderStyle) {
  53163. this.borderStyle = new AnnotationBorderStyle();
  53164. if (!(borderStyle instanceof Dict)) {
  53165. return;
  53166. }
  53167. if (borderStyle.has("BS")) {
  53168. const dict = borderStyle.get("BS");
  53169. if (dict instanceof Dict) {
  53170. const dictType = dict.get("Type");
  53171. if (!dictType || isName(dictType, "Border")) {
  53172. this.borderStyle.setWidth(dict.get("W"), this.rectangle);
  53173. this.borderStyle.setStyle(dict.get("S"));
  53174. this.borderStyle.setDashArray(dict.getArray("D"));
  53175. }
  53176. }
  53177. } else if (borderStyle.has("Border")) {
  53178. const array = borderStyle.getArray("Border");
  53179. if (Array.isArray(array) && array.length >= 3) {
  53180. this.borderStyle.setHorizontalCornerRadius(array[0]);
  53181. this.borderStyle.setVerticalCornerRadius(array[1]);
  53182. this.borderStyle.setWidth(array[2], this.rectangle);
  53183. if (array.length === 4) {
  53184. this.borderStyle.setDashArray(array[3], true);
  53185. }
  53186. }
  53187. } else {
  53188. this.borderStyle.setWidth(0);
  53189. }
  53190. }
  53191. setAppearance(dict) {
  53192. this.appearance = null;
  53193. const appearanceStates = dict.get("AP");
  53194. if (!(appearanceStates instanceof Dict)) {
  53195. return;
  53196. }
  53197. const normalAppearanceState = appearanceStates.get("N");
  53198. if (normalAppearanceState instanceof BaseStream) {
  53199. this.appearance = normalAppearanceState;
  53200. return;
  53201. }
  53202. if (!(normalAppearanceState instanceof Dict)) {
  53203. return;
  53204. }
  53205. const as = dict.get("AS");
  53206. if (!(as instanceof Name) || !normalAppearanceState.has(as.name)) {
  53207. return;
  53208. }
  53209. const appearance = normalAppearanceState.get(as.name);
  53210. if (appearance instanceof BaseStream) {
  53211. this.appearance = appearance;
  53212. }
  53213. }
  53214. setOptionalContent(dict) {
  53215. this.oc = null;
  53216. const oc = dict.get("OC");
  53217. if (oc instanceof Name) {
  53218. warn("setOptionalContent: Support for /Name-entry is not implemented.");
  53219. } else if (oc instanceof Dict) {
  53220. this.oc = oc;
  53221. }
  53222. }
  53223. loadResources(keys, appearance) {
  53224. return appearance.dict.getAsync("Resources").then(resources => {
  53225. if (!resources) {
  53226. return undefined;
  53227. }
  53228. const objectLoader = new ObjectLoader(resources, keys, resources.xref);
  53229. return objectLoader.load().then(function () {
  53230. return resources;
  53231. });
  53232. });
  53233. }
  53234. async getOperatorList(evaluator, task, intent, annotationStorage) {
  53235. const {
  53236. hasOwnCanvas,
  53237. id,
  53238. rect
  53239. } = this.data;
  53240. let appearance = this.appearance;
  53241. const isUsingOwnCanvas = !!(hasOwnCanvas && intent & RenderingIntentFlag.DISPLAY);
  53242. if (isUsingOwnCanvas && (rect[0] === rect[2] || rect[1] === rect[3])) {
  53243. this.data.hasOwnCanvas = false;
  53244. return {
  53245. opList: new OperatorList(),
  53246. separateForm: false,
  53247. separateCanvas: false
  53248. };
  53249. }
  53250. if (!appearance) {
  53251. if (!isUsingOwnCanvas) {
  53252. return {
  53253. opList: new OperatorList(),
  53254. separateForm: false,
  53255. separateCanvas: false
  53256. };
  53257. }
  53258. appearance = new StringStream("");
  53259. appearance.dict = new Dict();
  53260. }
  53261. const appearanceDict = appearance.dict;
  53262. const resources = await this.loadResources(["ExtGState", "ColorSpace", "Pattern", "Shading", "XObject", "Font"], appearance);
  53263. const bbox = lookupRect(appearanceDict.getArray("BBox"), [0, 0, 1, 1]);
  53264. const matrix = lookupMatrix(appearanceDict.getArray("Matrix"), IDENTITY_MATRIX);
  53265. const transform = getTransformMatrix(rect, bbox, matrix);
  53266. const opList = new OperatorList();
  53267. let optionalContent;
  53268. if (this.oc) {
  53269. optionalContent = await evaluator.parseMarkedContentProps(this.oc, null);
  53270. }
  53271. if (optionalContent !== undefined) {
  53272. opList.addOp(OPS.beginMarkedContentProps, ["OC", optionalContent]);
  53273. }
  53274. opList.addOp(OPS.beginAnnotation, [id, rect, transform, matrix, isUsingOwnCanvas]);
  53275. await evaluator.getOperatorList({
  53276. stream: appearance,
  53277. task,
  53278. resources,
  53279. operatorList: opList,
  53280. fallbackFontDict: this._fallbackFontDict
  53281. });
  53282. opList.addOp(OPS.endAnnotation, []);
  53283. if (optionalContent !== undefined) {
  53284. opList.addOp(OPS.endMarkedContent, []);
  53285. }
  53286. this.reset();
  53287. return {
  53288. opList,
  53289. separateForm: false,
  53290. separateCanvas: isUsingOwnCanvas
  53291. };
  53292. }
  53293. async save(evaluator, task, annotationStorage) {
  53294. return null;
  53295. }
  53296. get hasTextContent() {
  53297. return false;
  53298. }
  53299. async extractTextContent(evaluator, task, viewBox) {
  53300. if (!this.appearance) {
  53301. return;
  53302. }
  53303. const resources = await this.loadResources(["ExtGState", "Font", "Properties", "XObject"], this.appearance);
  53304. const text = [];
  53305. const buffer = [];
  53306. let firstPosition = null;
  53307. const sink = {
  53308. desiredSize: Math.Infinity,
  53309. ready: true,
  53310. enqueue(chunk, size) {
  53311. for (const item of chunk.items) {
  53312. if (item.str === undefined) {
  53313. continue;
  53314. }
  53315. firstPosition ||= item.transform.slice(-2);
  53316. buffer.push(item.str);
  53317. if (item.hasEOL) {
  53318. text.push(buffer.join("").trimEnd());
  53319. buffer.length = 0;
  53320. }
  53321. }
  53322. }
  53323. };
  53324. await evaluator.getTextContent({
  53325. stream: this.appearance,
  53326. task,
  53327. resources,
  53328. includeMarkedContent: true,
  53329. keepWhiteSpace: true,
  53330. sink,
  53331. viewBox
  53332. });
  53333. this.reset();
  53334. if (buffer.length) {
  53335. text.push(buffer.join("").trimEnd());
  53336. }
  53337. if (text.length > 1 || text[0]) {
  53338. const appearanceDict = this.appearance.dict;
  53339. const bbox = lookupRect(appearanceDict.getArray("BBox"), null);
  53340. const matrix = lookupMatrix(appearanceDict.getArray("Matrix"), null);
  53341. this.data.textPosition = this._transformPoint(firstPosition, bbox, matrix);
  53342. this.data.textContent = text;
  53343. }
  53344. }
  53345. _transformPoint(coords, bbox, matrix) {
  53346. const {
  53347. rect
  53348. } = this.data;
  53349. bbox ||= [0, 0, 1, 1];
  53350. matrix ||= [1, 0, 0, 1, 0, 0];
  53351. const transform = getTransformMatrix(rect, bbox, matrix);
  53352. transform[4] -= rect[0];
  53353. transform[5] -= rect[1];
  53354. coords = Util.applyTransform(coords, transform);
  53355. return Util.applyTransform(coords, matrix);
  53356. }
  53357. getFieldObject() {
  53358. if (this.data.kidIds) {
  53359. return {
  53360. id: this.data.id,
  53361. actions: this.data.actions,
  53362. name: this.data.fieldName,
  53363. strokeColor: this.data.borderColor,
  53364. fillColor: this.data.backgroundColor,
  53365. type: "",
  53366. kidIds: this.data.kidIds,
  53367. page: this.data.pageIndex,
  53368. rotation: this.rotation
  53369. };
  53370. }
  53371. return null;
  53372. }
  53373. reset() {
  53374. for (const stream of this._streams) {
  53375. stream.reset();
  53376. }
  53377. }
  53378. _constructFieldName(dict) {
  53379. if (!dict.has("T") && !dict.has("Parent")) {
  53380. warn("Unknown field name, falling back to empty field name.");
  53381. return "";
  53382. }
  53383. if (!dict.has("Parent")) {
  53384. return stringToPDFString(dict.get("T"));
  53385. }
  53386. const fieldName = [];
  53387. if (dict.has("T")) {
  53388. fieldName.unshift(stringToPDFString(dict.get("T")));
  53389. }
  53390. let loopDict = dict;
  53391. const visited = new RefSet();
  53392. if (dict.objId) {
  53393. visited.put(dict.objId);
  53394. }
  53395. while (loopDict.has("Parent")) {
  53396. loopDict = loopDict.get("Parent");
  53397. if (!(loopDict instanceof Dict) || loopDict.objId && visited.has(loopDict.objId)) {
  53398. break;
  53399. }
  53400. if (loopDict.objId) {
  53401. visited.put(loopDict.objId);
  53402. }
  53403. if (loopDict.has("T")) {
  53404. fieldName.unshift(stringToPDFString(loopDict.get("T")));
  53405. }
  53406. }
  53407. return fieldName.join(".");
  53408. }
  53409. }
  53410. class AnnotationBorderStyle {
  53411. constructor() {
  53412. this.width = 1;
  53413. this.rawWidth = 1;
  53414. this.style = AnnotationBorderStyleType.SOLID;
  53415. this.dashArray = [3];
  53416. this.horizontalCornerRadius = 0;
  53417. this.verticalCornerRadius = 0;
  53418. }
  53419. setWidth(width, rect = [0, 0, 0, 0]) {
  53420. if (width instanceof Name) {
  53421. this.width = 0;
  53422. return;
  53423. }
  53424. if (typeof width === "number") {
  53425. if (width > 0) {
  53426. this.rawWidth = width;
  53427. const maxWidth = (rect[2] - rect[0]) / 2;
  53428. const maxHeight = (rect[3] - rect[1]) / 2;
  53429. if (maxWidth > 0 && maxHeight > 0 && (width > maxWidth || width > maxHeight)) {
  53430. warn(`AnnotationBorderStyle.setWidth - ignoring width: ${width}`);
  53431. width = 1;
  53432. }
  53433. }
  53434. this.width = width;
  53435. }
  53436. }
  53437. setStyle(style) {
  53438. if (!(style instanceof Name)) {
  53439. return;
  53440. }
  53441. switch (style.name) {
  53442. case "S":
  53443. this.style = AnnotationBorderStyleType.SOLID;
  53444. break;
  53445. case "D":
  53446. this.style = AnnotationBorderStyleType.DASHED;
  53447. break;
  53448. case "B":
  53449. this.style = AnnotationBorderStyleType.BEVELED;
  53450. break;
  53451. case "I":
  53452. this.style = AnnotationBorderStyleType.INSET;
  53453. break;
  53454. case "U":
  53455. this.style = AnnotationBorderStyleType.UNDERLINE;
  53456. break;
  53457. default:
  53458. break;
  53459. }
  53460. }
  53461. setDashArray(dashArray, forceStyle = false) {
  53462. if (Array.isArray(dashArray)) {
  53463. let isValid = true;
  53464. let allZeros = true;
  53465. for (const element of dashArray) {
  53466. const validNumber = +element >= 0;
  53467. if (!validNumber) {
  53468. isValid = false;
  53469. break;
  53470. } else if (element > 0) {
  53471. allZeros = false;
  53472. }
  53473. }
  53474. if (dashArray.length === 0 || isValid && !allZeros) {
  53475. this.dashArray = dashArray;
  53476. if (forceStyle) {
  53477. this.setStyle(Name.get("D"));
  53478. }
  53479. } else {
  53480. this.width = 0;
  53481. }
  53482. } else if (dashArray) {
  53483. this.width = 0;
  53484. }
  53485. }
  53486. setHorizontalCornerRadius(radius) {
  53487. if (Number.isInteger(radius)) {
  53488. this.horizontalCornerRadius = radius;
  53489. }
  53490. }
  53491. setVerticalCornerRadius(radius) {
  53492. if (Number.isInteger(radius)) {
  53493. this.verticalCornerRadius = radius;
  53494. }
  53495. }
  53496. }
  53497. class MarkupAnnotation extends Annotation {
  53498. constructor(params) {
  53499. super(params);
  53500. const {
  53501. dict
  53502. } = params;
  53503. if (dict.has("IRT")) {
  53504. const rawIRT = dict.getRaw("IRT");
  53505. this.data.inReplyTo = rawIRT instanceof Ref ? rawIRT.toString() : null;
  53506. const rt = dict.get("RT");
  53507. this.data.replyType = rt instanceof Name ? rt.name : AnnotationReplyType.REPLY;
  53508. }
  53509. let popupRef = null;
  53510. if (this.data.replyType === AnnotationReplyType.GROUP) {
  53511. const parent = dict.get("IRT");
  53512. this.setTitle(parent.get("T"));
  53513. this.data.titleObj = this._title;
  53514. this.setContents(parent.get("Contents"));
  53515. this.data.contentsObj = this._contents;
  53516. if (!parent.has("CreationDate")) {
  53517. this.data.creationDate = null;
  53518. } else {
  53519. this.setCreationDate(parent.get("CreationDate"));
  53520. this.data.creationDate = this.creationDate;
  53521. }
  53522. if (!parent.has("M")) {
  53523. this.data.modificationDate = null;
  53524. } else {
  53525. this.setModificationDate(parent.get("M"));
  53526. this.data.modificationDate = this.modificationDate;
  53527. }
  53528. popupRef = parent.getRaw("Popup");
  53529. if (!parent.has("C")) {
  53530. this.data.color = null;
  53531. } else {
  53532. this.setColor(parent.getArray("C"));
  53533. this.data.color = this.color;
  53534. }
  53535. } else {
  53536. this.data.titleObj = this._title;
  53537. this.setCreationDate(dict.get("CreationDate"));
  53538. this.data.creationDate = this.creationDate;
  53539. popupRef = dict.getRaw("Popup");
  53540. if (!dict.has("C")) {
  53541. this.data.color = null;
  53542. }
  53543. }
  53544. this.data.popupRef = popupRef instanceof Ref ? popupRef.toString() : null;
  53545. if (dict.has("RC")) {
  53546. this.data.richText = XFAFactory.getRichTextAsHtml(dict.get("RC"));
  53547. }
  53548. }
  53549. setCreationDate(creationDate) {
  53550. this.creationDate = typeof creationDate === "string" ? creationDate : null;
  53551. }
  53552. _setDefaultAppearance({
  53553. xref,
  53554. extra,
  53555. strokeColor,
  53556. fillColor,
  53557. blendMode,
  53558. strokeAlpha,
  53559. fillAlpha,
  53560. pointsCallback
  53561. }) {
  53562. let minX = Number.MAX_VALUE;
  53563. let minY = Number.MAX_VALUE;
  53564. let maxX = Number.MIN_VALUE;
  53565. let maxY = Number.MIN_VALUE;
  53566. const buffer = ["q"];
  53567. if (extra) {
  53568. buffer.push(extra);
  53569. }
  53570. if (strokeColor) {
  53571. buffer.push(`${strokeColor[0]} ${strokeColor[1]} ${strokeColor[2]} RG`);
  53572. }
  53573. if (fillColor) {
  53574. buffer.push(`${fillColor[0]} ${fillColor[1]} ${fillColor[2]} rg`);
  53575. }
  53576. let pointsArray = this.data.quadPoints;
  53577. if (!pointsArray) {
  53578. pointsArray = Float32Array.from([this.rectangle[0], this.rectangle[3], this.rectangle[2], this.rectangle[3], this.rectangle[0], this.rectangle[1], this.rectangle[2], this.rectangle[1]]);
  53579. }
  53580. for (let i = 0, ii = pointsArray.length; i < ii; i += 8) {
  53581. const [mX, MX, mY, MY] = pointsCallback(buffer, pointsArray.subarray(i, i + 8));
  53582. minX = Math.min(minX, mX);
  53583. maxX = Math.max(maxX, MX);
  53584. minY = Math.min(minY, mY);
  53585. maxY = Math.max(maxY, MY);
  53586. }
  53587. buffer.push("Q");
  53588. const formDict = new Dict(xref);
  53589. const appearanceStreamDict = new Dict(xref);
  53590. appearanceStreamDict.set("Subtype", Name.get("Form"));
  53591. const appearanceStream = new StringStream(buffer.join(" "));
  53592. appearanceStream.dict = appearanceStreamDict;
  53593. formDict.set("Fm0", appearanceStream);
  53594. const gsDict = new Dict(xref);
  53595. if (blendMode) {
  53596. gsDict.set("BM", Name.get(blendMode));
  53597. }
  53598. if (typeof strokeAlpha === "number") {
  53599. gsDict.set("CA", strokeAlpha);
  53600. }
  53601. if (typeof fillAlpha === "number") {
  53602. gsDict.set("ca", fillAlpha);
  53603. }
  53604. const stateDict = new Dict(xref);
  53605. stateDict.set("GS0", gsDict);
  53606. const resources = new Dict(xref);
  53607. resources.set("ExtGState", stateDict);
  53608. resources.set("XObject", formDict);
  53609. const appearanceDict = new Dict(xref);
  53610. appearanceDict.set("Resources", resources);
  53611. const bbox = this.data.rect = [minX, minY, maxX, maxY];
  53612. appearanceDict.set("BBox", bbox);
  53613. this.appearance = new StringStream("/GS0 gs /Fm0 Do");
  53614. this.appearance.dict = appearanceDict;
  53615. this._streams.push(this.appearance, appearanceStream);
  53616. }
  53617. static async createNewAnnotation(xref, annotation, dependencies, params) {
  53618. if (!annotation.ref) {
  53619. annotation.ref = xref.getNewTemporaryRef();
  53620. }
  53621. const annotationRef = annotation.ref;
  53622. const ap = await this.createNewAppearanceStream(annotation, xref, params);
  53623. const buffer = [];
  53624. let annotationDict;
  53625. if (ap) {
  53626. const apRef = xref.getNewTemporaryRef();
  53627. annotationDict = this.createNewDict(annotation, xref, {
  53628. apRef
  53629. });
  53630. await writeObject(apRef, ap, buffer, xref);
  53631. dependencies.push({
  53632. ref: apRef,
  53633. data: buffer.join("")
  53634. });
  53635. } else {
  53636. annotationDict = this.createNewDict(annotation, xref, {});
  53637. }
  53638. if (Number.isInteger(annotation.parentTreeId)) {
  53639. annotationDict.set("StructParent", annotation.parentTreeId);
  53640. }
  53641. buffer.length = 0;
  53642. await writeObject(annotationRef, annotationDict, buffer, xref);
  53643. return {
  53644. ref: annotationRef,
  53645. data: buffer.join("")
  53646. };
  53647. }
  53648. static async createNewPrintAnnotation(annotationGlobals, xref, annotation, params) {
  53649. const ap = await this.createNewAppearanceStream(annotation, xref, params);
  53650. const annotationDict = this.createNewDict(annotation, xref, ap ? {
  53651. ap
  53652. } : {});
  53653. const newAnnotation = new this.prototype.constructor({
  53654. dict: annotationDict,
  53655. xref,
  53656. annotationGlobals,
  53657. evaluatorOptions: params.evaluatorOptions
  53658. });
  53659. if (annotation.ref) {
  53660. newAnnotation.ref = newAnnotation.refToReplace = annotation.ref;
  53661. }
  53662. return newAnnotation;
  53663. }
  53664. }
  53665. class WidgetAnnotation extends Annotation {
  53666. constructor(params) {
  53667. super(params);
  53668. const {
  53669. dict,
  53670. xref,
  53671. annotationGlobals
  53672. } = params;
  53673. const data = this.data;
  53674. this._needAppearances = params.needAppearances;
  53675. data.annotationType = AnnotationType.WIDGET;
  53676. if (data.fieldName === undefined) {
  53677. data.fieldName = this._constructFieldName(dict);
  53678. }
  53679. if (data.actions === undefined) {
  53680. data.actions = collectActions(xref, dict, AnnotationActionEventType);
  53681. }
  53682. let fieldValue = getInheritableProperty({
  53683. dict,
  53684. key: "V",
  53685. getArray: true
  53686. });
  53687. data.fieldValue = this._decodeFormValue(fieldValue);
  53688. const defaultFieldValue = getInheritableProperty({
  53689. dict,
  53690. key: "DV",
  53691. getArray: true
  53692. });
  53693. data.defaultFieldValue = this._decodeFormValue(defaultFieldValue);
  53694. if (fieldValue === undefined && annotationGlobals.xfaDatasets) {
  53695. const path = this._title.str;
  53696. if (path) {
  53697. this._hasValueFromXFA = true;
  53698. data.fieldValue = fieldValue = annotationGlobals.xfaDatasets.getValue(path);
  53699. }
  53700. }
  53701. if (fieldValue === undefined && data.defaultFieldValue !== null) {
  53702. data.fieldValue = data.defaultFieldValue;
  53703. }
  53704. data.alternativeText = stringToPDFString(dict.get("TU") || "");
  53705. this.setDefaultAppearance(params);
  53706. data.hasAppearance ||= this._needAppearances && data.fieldValue !== undefined && data.fieldValue !== null;
  53707. const fieldType = getInheritableProperty({
  53708. dict,
  53709. key: "FT"
  53710. });
  53711. data.fieldType = fieldType instanceof Name ? fieldType.name : null;
  53712. const localResources = getInheritableProperty({
  53713. dict,
  53714. key: "DR"
  53715. });
  53716. const acroFormResources = annotationGlobals.acroForm.get("DR");
  53717. const appearanceResources = this.appearance?.dict.get("Resources");
  53718. this._fieldResources = {
  53719. localResources,
  53720. acroFormResources,
  53721. appearanceResources,
  53722. mergedResources: Dict.merge({
  53723. xref,
  53724. dictArray: [localResources, appearanceResources, acroFormResources],
  53725. mergeSubDicts: true
  53726. })
  53727. };
  53728. data.fieldFlags = getInheritableProperty({
  53729. dict,
  53730. key: "Ff"
  53731. });
  53732. if (!Number.isInteger(data.fieldFlags) || data.fieldFlags < 0) {
  53733. data.fieldFlags = 0;
  53734. }
  53735. data.readOnly = this.hasFieldFlag(AnnotationFieldFlag.READONLY);
  53736. data.required = this.hasFieldFlag(AnnotationFieldFlag.REQUIRED);
  53737. data.hidden = this._hasFlag(data.annotationFlags, AnnotationFlag.HIDDEN) || this._hasFlag(data.annotationFlags, AnnotationFlag.NOVIEW);
  53738. }
  53739. _decodeFormValue(formValue) {
  53740. if (Array.isArray(formValue)) {
  53741. return formValue.filter(item => typeof item === "string").map(item => stringToPDFString(item));
  53742. } else if (formValue instanceof Name) {
  53743. return stringToPDFString(formValue.name);
  53744. } else if (typeof formValue === "string") {
  53745. return stringToPDFString(formValue);
  53746. }
  53747. return null;
  53748. }
  53749. hasFieldFlag(flag) {
  53750. return !!(this.data.fieldFlags & flag);
  53751. }
  53752. _isViewable(flags) {
  53753. return true;
  53754. }
  53755. mustBeViewed(annotationStorage, renderForms) {
  53756. if (renderForms) {
  53757. return this.viewable;
  53758. }
  53759. return super.mustBeViewed(annotationStorage, renderForms) && !this._hasFlag(this.flags, AnnotationFlag.NOVIEW);
  53760. }
  53761. getRotationMatrix(annotationStorage) {
  53762. let rotation = annotationStorage?.get(this.data.id)?.rotation;
  53763. if (rotation === undefined) {
  53764. rotation = this.rotation;
  53765. }
  53766. if (rotation === 0) {
  53767. return IDENTITY_MATRIX;
  53768. }
  53769. const width = this.data.rect[2] - this.data.rect[0];
  53770. const height = this.data.rect[3] - this.data.rect[1];
  53771. return getRotationMatrix(rotation, width, height);
  53772. }
  53773. getBorderAndBackgroundAppearances(annotationStorage) {
  53774. let rotation = annotationStorage?.get(this.data.id)?.rotation;
  53775. if (rotation === undefined) {
  53776. rotation = this.rotation;
  53777. }
  53778. if (!this.backgroundColor && !this.borderColor) {
  53779. return "";
  53780. }
  53781. const width = this.data.rect[2] - this.data.rect[0];
  53782. const height = this.data.rect[3] - this.data.rect[1];
  53783. const rect = rotation === 0 || rotation === 180 ? `0 0 ${width} ${height} re` : `0 0 ${height} ${width} re`;
  53784. let str = "";
  53785. if (this.backgroundColor) {
  53786. str = `${getPdfColor(this.backgroundColor, true)} ${rect} f `;
  53787. }
  53788. if (this.borderColor) {
  53789. const borderWidth = this.borderStyle.width || 1;
  53790. str += `${borderWidth} w ${getPdfColor(this.borderColor, false)} ${rect} S `;
  53791. }
  53792. return str;
  53793. }
  53794. async getOperatorList(evaluator, task, intent, annotationStorage) {
  53795. if (intent & RenderingIntentFlag.ANNOTATIONS_FORMS && !(this instanceof SignatureWidgetAnnotation) && !this.data.noHTML && !this.data.hasOwnCanvas) {
  53796. return {
  53797. opList: new OperatorList(),
  53798. separateForm: true,
  53799. separateCanvas: false
  53800. };
  53801. }
  53802. if (!this._hasText) {
  53803. return super.getOperatorList(evaluator, task, intent, annotationStorage);
  53804. }
  53805. const content = await this._getAppearance(evaluator, task, intent, annotationStorage);
  53806. if (this.appearance && content === null) {
  53807. return super.getOperatorList(evaluator, task, intent, annotationStorage);
  53808. }
  53809. const opList = new OperatorList();
  53810. if (!this._defaultAppearance || content === null) {
  53811. return {
  53812. opList,
  53813. separateForm: false,
  53814. separateCanvas: false
  53815. };
  53816. }
  53817. const isUsingOwnCanvas = !!(this.data.hasOwnCanvas && intent & RenderingIntentFlag.DISPLAY);
  53818. const matrix = [1, 0, 0, 1, 0, 0];
  53819. const bbox = [0, 0, this.data.rect[2] - this.data.rect[0], this.data.rect[3] - this.data.rect[1]];
  53820. const transform = getTransformMatrix(this.data.rect, bbox, matrix);
  53821. let optionalContent;
  53822. if (this.oc) {
  53823. optionalContent = await evaluator.parseMarkedContentProps(this.oc, null);
  53824. }
  53825. if (optionalContent !== undefined) {
  53826. opList.addOp(OPS.beginMarkedContentProps, ["OC", optionalContent]);
  53827. }
  53828. opList.addOp(OPS.beginAnnotation, [this.data.id, this.data.rect, transform, this.getRotationMatrix(annotationStorage), isUsingOwnCanvas]);
  53829. const stream = new StringStream(content);
  53830. await evaluator.getOperatorList({
  53831. stream,
  53832. task,
  53833. resources: this._fieldResources.mergedResources,
  53834. operatorList: opList
  53835. });
  53836. opList.addOp(OPS.endAnnotation, []);
  53837. if (optionalContent !== undefined) {
  53838. opList.addOp(OPS.endMarkedContent, []);
  53839. }
  53840. return {
  53841. opList,
  53842. separateForm: false,
  53843. separateCanvas: isUsingOwnCanvas
  53844. };
  53845. }
  53846. _getMKDict(rotation) {
  53847. const mk = new Dict(null);
  53848. if (rotation) {
  53849. mk.set("R", rotation);
  53850. }
  53851. if (this.borderColor) {
  53852. mk.set("BC", getPdfColorArray(this.borderColor));
  53853. }
  53854. if (this.backgroundColor) {
  53855. mk.set("BG", getPdfColorArray(this.backgroundColor));
  53856. }
  53857. return mk.size > 0 ? mk : null;
  53858. }
  53859. amendSavedDict(annotationStorage, dict) {}
  53860. async save(evaluator, task, annotationStorage) {
  53861. const storageEntry = annotationStorage?.get(this.data.id);
  53862. const flags = this._buildFlags(storageEntry?.noView, storageEntry?.noPrint);
  53863. let value = storageEntry?.value,
  53864. rotation = storageEntry?.rotation;
  53865. if (value === this.data.fieldValue || value === undefined) {
  53866. if (!this._hasValueFromXFA && rotation === undefined && flags === undefined) {
  53867. return null;
  53868. }
  53869. value ||= this.data.fieldValue;
  53870. }
  53871. if (rotation === undefined && !this._hasValueFromXFA && Array.isArray(value) && Array.isArray(this.data.fieldValue) && isArrayEqual(value, this.data.fieldValue) && flags === undefined) {
  53872. return null;
  53873. }
  53874. if (rotation === undefined) {
  53875. rotation = this.rotation;
  53876. }
  53877. let appearance = null;
  53878. if (!this._needAppearances) {
  53879. appearance = await this._getAppearance(evaluator, task, RenderingIntentFlag.SAVE, annotationStorage);
  53880. if (appearance === null && flags === undefined) {
  53881. return null;
  53882. }
  53883. } else {}
  53884. let needAppearances = false;
  53885. if (appearance?.needAppearances) {
  53886. needAppearances = true;
  53887. appearance = null;
  53888. }
  53889. const {
  53890. xref
  53891. } = evaluator;
  53892. const originalDict = xref.fetchIfRef(this.ref);
  53893. if (!(originalDict instanceof Dict)) {
  53894. return null;
  53895. }
  53896. const dict = new Dict(xref);
  53897. for (const key of originalDict.getKeys()) {
  53898. if (key !== "AP") {
  53899. dict.set(key, originalDict.getRaw(key));
  53900. }
  53901. }
  53902. if (flags !== undefined) {
  53903. dict.set("F", flags);
  53904. if (appearance === null && !needAppearances) {
  53905. const ap = originalDict.getRaw("AP");
  53906. if (ap) {
  53907. dict.set("AP", ap);
  53908. }
  53909. }
  53910. }
  53911. const xfa = {
  53912. path: this.data.fieldName,
  53913. value
  53914. };
  53915. dict.set("V", Array.isArray(value) ? value.map(stringToAsciiOrUTF16BE) : stringToAsciiOrUTF16BE(value));
  53916. this.amendSavedDict(annotationStorage, dict);
  53917. const maybeMK = this._getMKDict(rotation);
  53918. if (maybeMK) {
  53919. dict.set("MK", maybeMK);
  53920. }
  53921. const buffer = [];
  53922. const changes = [{
  53923. ref: this.ref,
  53924. data: "",
  53925. xfa,
  53926. needAppearances
  53927. }];
  53928. if (appearance !== null) {
  53929. const newRef = xref.getNewTemporaryRef();
  53930. const AP = new Dict(xref);
  53931. dict.set("AP", AP);
  53932. AP.set("N", newRef);
  53933. const resources = this._getSaveFieldResources(xref);
  53934. const appearanceStream = new StringStream(appearance);
  53935. const appearanceDict = appearanceStream.dict = new Dict(xref);
  53936. appearanceDict.set("Subtype", Name.get("Form"));
  53937. appearanceDict.set("Resources", resources);
  53938. appearanceDict.set("BBox", [0, 0, this.data.rect[2] - this.data.rect[0], this.data.rect[3] - this.data.rect[1]]);
  53939. const rotationMatrix = this.getRotationMatrix(annotationStorage);
  53940. if (rotationMatrix !== IDENTITY_MATRIX) {
  53941. appearanceDict.set("Matrix", rotationMatrix);
  53942. }
  53943. await writeObject(newRef, appearanceStream, buffer, xref);
  53944. changes.push({
  53945. ref: newRef,
  53946. data: buffer.join(""),
  53947. xfa: null,
  53948. needAppearances: false
  53949. });
  53950. buffer.length = 0;
  53951. }
  53952. dict.set("M", `D:${getModificationDate()}`);
  53953. await writeObject(this.ref, dict, buffer, xref);
  53954. changes[0].data = buffer.join("");
  53955. return changes;
  53956. }
  53957. async _getAppearance(evaluator, task, intent, annotationStorage) {
  53958. const isPassword = this.hasFieldFlag(AnnotationFieldFlag.PASSWORD);
  53959. if (isPassword) {
  53960. return null;
  53961. }
  53962. const storageEntry = annotationStorage?.get(this.data.id);
  53963. let value, rotation;
  53964. if (storageEntry) {
  53965. value = storageEntry.formattedValue || storageEntry.value;
  53966. rotation = storageEntry.rotation;
  53967. }
  53968. if (rotation === undefined && value === undefined && !this._needAppearances) {
  53969. if (!this._hasValueFromXFA || this.appearance) {
  53970. return null;
  53971. }
  53972. }
  53973. const colors = this.getBorderAndBackgroundAppearances(annotationStorage);
  53974. if (value === undefined) {
  53975. value = this.data.fieldValue;
  53976. if (!value) {
  53977. return `/Tx BMC q ${colors}Q EMC`;
  53978. }
  53979. }
  53980. if (Array.isArray(value) && value.length === 1) {
  53981. value = value[0];
  53982. }
  53983. assert(typeof value === "string", "Expected `value` to be a string.");
  53984. value = value.trimEnd();
  53985. if (this.data.combo) {
  53986. const option = this.data.options.find(({
  53987. exportValue
  53988. }) => value === exportValue);
  53989. value = option?.displayValue || value;
  53990. }
  53991. if (value === "") {
  53992. return `/Tx BMC q ${colors}Q EMC`;
  53993. }
  53994. if (rotation === undefined) {
  53995. rotation = this.rotation;
  53996. }
  53997. let lineCount = -1;
  53998. let lines;
  53999. if (this.data.multiLine) {
  54000. lines = value.split(/\r\n?|\n/).map(line => line.normalize("NFC"));
  54001. lineCount = lines.length;
  54002. } else {
  54003. lines = [value.replace(/\r\n?|\n/, "").normalize("NFC")];
  54004. }
  54005. const defaultPadding = 1;
  54006. const defaultHPadding = 2;
  54007. let totalHeight = this.data.rect[3] - this.data.rect[1];
  54008. let totalWidth = this.data.rect[2] - this.data.rect[0];
  54009. if (rotation === 90 || rotation === 270) {
  54010. [totalWidth, totalHeight] = [totalHeight, totalWidth];
  54011. }
  54012. if (!this._defaultAppearance) {
  54013. this.data.defaultAppearanceData = parseDefaultAppearance(this._defaultAppearance = "/Helvetica 0 Tf 0 g");
  54014. }
  54015. let font = await WidgetAnnotation._getFontData(evaluator, task, this.data.defaultAppearanceData, this._fieldResources.mergedResources);
  54016. let defaultAppearance, fontSize, lineHeight;
  54017. const encodedLines = [];
  54018. let encodingError = false;
  54019. for (const line of lines) {
  54020. const encodedString = font.encodeString(line);
  54021. if (encodedString.length > 1) {
  54022. encodingError = true;
  54023. }
  54024. encodedLines.push(encodedString.join(""));
  54025. }
  54026. if (encodingError && intent & RenderingIntentFlag.SAVE) {
  54027. return {
  54028. needAppearances: true
  54029. };
  54030. }
  54031. if (encodingError && this._isOffscreenCanvasSupported) {
  54032. const fontFamily = this.data.comb ? "monospace" : "sans-serif";
  54033. const fakeUnicodeFont = new FakeUnicodeFont(evaluator.xref, fontFamily);
  54034. const resources = fakeUnicodeFont.createFontResources(lines.join(""));
  54035. const newFont = resources.getRaw("Font");
  54036. if (this._fieldResources.mergedResources.has("Font")) {
  54037. const oldFont = this._fieldResources.mergedResources.get("Font");
  54038. for (const key of newFont.getKeys()) {
  54039. oldFont.set(key, newFont.getRaw(key));
  54040. }
  54041. } else {
  54042. this._fieldResources.mergedResources.set("Font", newFont);
  54043. }
  54044. const fontName = fakeUnicodeFont.fontName.name;
  54045. font = await WidgetAnnotation._getFontData(evaluator, task, {
  54046. fontName,
  54047. fontSize: 0
  54048. }, resources);
  54049. for (let i = 0, ii = encodedLines.length; i < ii; i++) {
  54050. encodedLines[i] = stringToUTF16String(lines[i]);
  54051. }
  54052. const savedDefaultAppearance = Object.assign(Object.create(null), this.data.defaultAppearanceData);
  54053. this.data.defaultAppearanceData.fontSize = 0;
  54054. this.data.defaultAppearanceData.fontName = fontName;
  54055. [defaultAppearance, fontSize, lineHeight] = this._computeFontSize(totalHeight - 2 * defaultPadding, totalWidth - 2 * defaultHPadding, value, font, lineCount);
  54056. this.data.defaultAppearanceData = savedDefaultAppearance;
  54057. } else {
  54058. if (!this._isOffscreenCanvasSupported) {
  54059. warn("_getAppearance: OffscreenCanvas is not supported, annotation may not render correctly.");
  54060. }
  54061. [defaultAppearance, fontSize, lineHeight] = this._computeFontSize(totalHeight - 2 * defaultPadding, totalWidth - 2 * defaultHPadding, value, font, lineCount);
  54062. }
  54063. let descent = font.descent;
  54064. if (isNaN(descent)) {
  54065. descent = BASELINE_FACTOR * lineHeight;
  54066. } else {
  54067. descent = Math.max(BASELINE_FACTOR * lineHeight, Math.abs(descent) * fontSize);
  54068. }
  54069. const defaultVPadding = Math.min(Math.floor((totalHeight - fontSize) / 2), defaultPadding);
  54070. const alignment = this.data.textAlignment;
  54071. if (this.data.multiLine) {
  54072. return this._getMultilineAppearance(defaultAppearance, encodedLines, font, fontSize, totalWidth, totalHeight, alignment, defaultHPadding, defaultVPadding, descent, lineHeight, annotationStorage);
  54073. }
  54074. if (this.data.comb) {
  54075. return this._getCombAppearance(defaultAppearance, font, encodedLines[0], fontSize, totalWidth, totalHeight, defaultHPadding, defaultVPadding, descent, lineHeight, annotationStorage);
  54076. }
  54077. const bottomPadding = defaultVPadding + descent;
  54078. if (alignment === 0 || alignment > 2) {
  54079. return `/Tx BMC q ${colors}BT ` + defaultAppearance + ` 1 0 0 1 ${numberToString(defaultHPadding)} ${numberToString(bottomPadding)} Tm (${escapeString(encodedLines[0])}) Tj` + " ET Q EMC";
  54080. }
  54081. const prevInfo = {
  54082. shift: 0
  54083. };
  54084. const renderedText = this._renderText(encodedLines[0], font, fontSize, totalWidth, alignment, prevInfo, defaultHPadding, bottomPadding);
  54085. return `/Tx BMC q ${colors}BT ` + defaultAppearance + ` 1 0 0 1 0 0 Tm ${renderedText}` + " ET Q EMC";
  54086. }
  54087. static async _getFontData(evaluator, task, appearanceData, resources) {
  54088. const operatorList = new OperatorList();
  54089. const initialState = {
  54090. font: null,
  54091. clone() {
  54092. return this;
  54093. }
  54094. };
  54095. const {
  54096. fontName,
  54097. fontSize
  54098. } = appearanceData;
  54099. await evaluator.handleSetFont(resources, [fontName && Name.get(fontName), fontSize], null, operatorList, task, initialState, null);
  54100. return initialState.font;
  54101. }
  54102. _getTextWidth(text, font) {
  54103. return font.charsToGlyphs(text).reduce((width, glyph) => width + glyph.width, 0) / 1000;
  54104. }
  54105. _computeFontSize(height, width, text, font, lineCount) {
  54106. let {
  54107. fontSize
  54108. } = this.data.defaultAppearanceData;
  54109. let lineHeight = (fontSize || 12) * LINE_FACTOR,
  54110. numberOfLines = Math.round(height / lineHeight);
  54111. if (!fontSize) {
  54112. const roundWithTwoDigits = x => Math.floor(x * 100) / 100;
  54113. if (lineCount === -1) {
  54114. const textWidth = this._getTextWidth(text, font);
  54115. fontSize = roundWithTwoDigits(Math.min(height / LINE_FACTOR, width / textWidth));
  54116. numberOfLines = 1;
  54117. } else {
  54118. const lines = text.split(/\r\n?|\n/);
  54119. const cachedLines = [];
  54120. for (const line of lines) {
  54121. const encoded = font.encodeString(line).join("");
  54122. const glyphs = font.charsToGlyphs(encoded);
  54123. const positions = font.getCharPositions(encoded);
  54124. cachedLines.push({
  54125. line: encoded,
  54126. glyphs,
  54127. positions
  54128. });
  54129. }
  54130. const isTooBig = fsize => {
  54131. let totalHeight = 0;
  54132. for (const cache of cachedLines) {
  54133. const chunks = this._splitLine(null, font, fsize, width, cache);
  54134. totalHeight += chunks.length * fsize;
  54135. if (totalHeight > height) {
  54136. return true;
  54137. }
  54138. }
  54139. return false;
  54140. };
  54141. numberOfLines = Math.max(numberOfLines, lineCount);
  54142. while (true) {
  54143. lineHeight = height / numberOfLines;
  54144. fontSize = roundWithTwoDigits(lineHeight / LINE_FACTOR);
  54145. if (isTooBig(fontSize)) {
  54146. numberOfLines++;
  54147. continue;
  54148. }
  54149. break;
  54150. }
  54151. }
  54152. const {
  54153. fontName,
  54154. fontColor
  54155. } = this.data.defaultAppearanceData;
  54156. this._defaultAppearance = createDefaultAppearance({
  54157. fontSize,
  54158. fontName,
  54159. fontColor
  54160. });
  54161. }
  54162. return [this._defaultAppearance, fontSize, height / numberOfLines];
  54163. }
  54164. _renderText(text, font, fontSize, totalWidth, alignment, prevInfo, hPadding, vPadding) {
  54165. let shift;
  54166. if (alignment === 1) {
  54167. const width = this._getTextWidth(text, font) * fontSize;
  54168. shift = (totalWidth - width) / 2;
  54169. } else if (alignment === 2) {
  54170. const width = this._getTextWidth(text, font) * fontSize;
  54171. shift = totalWidth - width - hPadding;
  54172. } else {
  54173. shift = hPadding;
  54174. }
  54175. const shiftStr = numberToString(shift - prevInfo.shift);
  54176. prevInfo.shift = shift;
  54177. vPadding = numberToString(vPadding);
  54178. return `${shiftStr} ${vPadding} Td (${escapeString(text)}) Tj`;
  54179. }
  54180. _getSaveFieldResources(xref) {
  54181. const {
  54182. localResources,
  54183. appearanceResources,
  54184. acroFormResources
  54185. } = this._fieldResources;
  54186. const fontName = this.data.defaultAppearanceData?.fontName;
  54187. if (!fontName) {
  54188. return localResources || Dict.empty;
  54189. }
  54190. for (const resources of [localResources, appearanceResources]) {
  54191. if (resources instanceof Dict) {
  54192. const localFont = resources.get("Font");
  54193. if (localFont instanceof Dict && localFont.has(fontName)) {
  54194. return resources;
  54195. }
  54196. }
  54197. }
  54198. if (acroFormResources instanceof Dict) {
  54199. const acroFormFont = acroFormResources.get("Font");
  54200. if (acroFormFont instanceof Dict && acroFormFont.has(fontName)) {
  54201. const subFontDict = new Dict(xref);
  54202. subFontDict.set(fontName, acroFormFont.getRaw(fontName));
  54203. const subResourcesDict = new Dict(xref);
  54204. subResourcesDict.set("Font", subFontDict);
  54205. return Dict.merge({
  54206. xref,
  54207. dictArray: [subResourcesDict, localResources],
  54208. mergeSubDicts: true
  54209. });
  54210. }
  54211. }
  54212. return localResources || Dict.empty;
  54213. }
  54214. getFieldObject() {
  54215. return null;
  54216. }
  54217. }
  54218. class TextWidgetAnnotation extends WidgetAnnotation {
  54219. constructor(params) {
  54220. super(params);
  54221. const {
  54222. dict
  54223. } = params;
  54224. if (dict.has("PMD")) {
  54225. this.flags |= AnnotationFlag.HIDDEN;
  54226. this.data.hidden = true;
  54227. warn("Barcodes are not supported");
  54228. }
  54229. this.data.hasOwnCanvas = this.data.readOnly && !this.data.noHTML;
  54230. this._hasText = true;
  54231. if (typeof this.data.fieldValue !== "string") {
  54232. this.data.fieldValue = "";
  54233. }
  54234. let alignment = getInheritableProperty({
  54235. dict,
  54236. key: "Q"
  54237. });
  54238. if (!Number.isInteger(alignment) || alignment < 0 || alignment > 2) {
  54239. alignment = null;
  54240. }
  54241. this.data.textAlignment = alignment;
  54242. let maximumLength = getInheritableProperty({
  54243. dict,
  54244. key: "MaxLen"
  54245. });
  54246. if (!Number.isInteger(maximumLength) || maximumLength < 0) {
  54247. maximumLength = 0;
  54248. }
  54249. this.data.maxLen = maximumLength;
  54250. this.data.multiLine = this.hasFieldFlag(AnnotationFieldFlag.MULTILINE);
  54251. this.data.comb = this.hasFieldFlag(AnnotationFieldFlag.COMB) && !this.hasFieldFlag(AnnotationFieldFlag.MULTILINE) && !this.hasFieldFlag(AnnotationFieldFlag.PASSWORD) && !this.hasFieldFlag(AnnotationFieldFlag.FILESELECT) && this.data.maxLen !== 0;
  54252. this.data.doNotScroll = this.hasFieldFlag(AnnotationFieldFlag.DONOTSCROLL);
  54253. }
  54254. get hasTextContent() {
  54255. return !!this.appearance && !this._needAppearances;
  54256. }
  54257. _getCombAppearance(defaultAppearance, font, text, fontSize, width, height, hPadding, vPadding, descent, lineHeight, annotationStorage) {
  54258. const combWidth = width / this.data.maxLen;
  54259. const colors = this.getBorderAndBackgroundAppearances(annotationStorage);
  54260. const buf = [];
  54261. const positions = font.getCharPositions(text);
  54262. for (const [start, end] of positions) {
  54263. buf.push(`(${escapeString(text.substring(start, end))}) Tj`);
  54264. }
  54265. const renderedComb = buf.join(` ${numberToString(combWidth)} 0 Td `);
  54266. return `/Tx BMC q ${colors}BT ` + defaultAppearance + ` 1 0 0 1 ${numberToString(hPadding)} ${numberToString(vPadding + descent)} Tm ${renderedComb}` + " ET Q EMC";
  54267. }
  54268. _getMultilineAppearance(defaultAppearance, lines, font, fontSize, width, height, alignment, hPadding, vPadding, descent, lineHeight, annotationStorage) {
  54269. const buf = [];
  54270. const totalWidth = width - 2 * hPadding;
  54271. const prevInfo = {
  54272. shift: 0
  54273. };
  54274. for (let i = 0, ii = lines.length; i < ii; i++) {
  54275. const line = lines[i];
  54276. const chunks = this._splitLine(line, font, fontSize, totalWidth);
  54277. for (let j = 0, jj = chunks.length; j < jj; j++) {
  54278. const chunk = chunks[j];
  54279. const vShift = i === 0 && j === 0 ? -vPadding - (lineHeight - descent) : -lineHeight;
  54280. buf.push(this._renderText(chunk, font, fontSize, width, alignment, prevInfo, hPadding, vShift));
  54281. }
  54282. }
  54283. const colors = this.getBorderAndBackgroundAppearances(annotationStorage);
  54284. const renderedText = buf.join("\n");
  54285. return `/Tx BMC q ${colors}BT ` + defaultAppearance + ` 1 0 0 1 0 ${numberToString(height)} Tm ${renderedText}` + " ET Q EMC";
  54286. }
  54287. _splitLine(line, font, fontSize, width, cache = {}) {
  54288. line = cache.line || line;
  54289. const glyphs = cache.glyphs || font.charsToGlyphs(line);
  54290. if (glyphs.length <= 1) {
  54291. return [line];
  54292. }
  54293. const positions = cache.positions || font.getCharPositions(line);
  54294. const scale = fontSize / 1000;
  54295. const chunks = [];
  54296. let lastSpacePosInStringStart = -1,
  54297. lastSpacePosInStringEnd = -1,
  54298. lastSpacePos = -1,
  54299. startChunk = 0,
  54300. currentWidth = 0;
  54301. for (let i = 0, ii = glyphs.length; i < ii; i++) {
  54302. const [start, end] = positions[i];
  54303. const glyph = glyphs[i];
  54304. const glyphWidth = glyph.width * scale;
  54305. if (glyph.unicode === " ") {
  54306. if (currentWidth + glyphWidth > width) {
  54307. chunks.push(line.substring(startChunk, start));
  54308. startChunk = start;
  54309. currentWidth = glyphWidth;
  54310. lastSpacePosInStringStart = -1;
  54311. lastSpacePos = -1;
  54312. } else {
  54313. currentWidth += glyphWidth;
  54314. lastSpacePosInStringStart = start;
  54315. lastSpacePosInStringEnd = end;
  54316. lastSpacePos = i;
  54317. }
  54318. } else if (currentWidth + glyphWidth > width) {
  54319. if (lastSpacePosInStringStart !== -1) {
  54320. chunks.push(line.substring(startChunk, lastSpacePosInStringEnd));
  54321. startChunk = lastSpacePosInStringEnd;
  54322. i = lastSpacePos + 1;
  54323. lastSpacePosInStringStart = -1;
  54324. currentWidth = 0;
  54325. } else {
  54326. chunks.push(line.substring(startChunk, start));
  54327. startChunk = start;
  54328. currentWidth = glyphWidth;
  54329. }
  54330. } else {
  54331. currentWidth += glyphWidth;
  54332. }
  54333. }
  54334. if (startChunk < line.length) {
  54335. chunks.push(line.substring(startChunk, line.length));
  54336. }
  54337. return chunks;
  54338. }
  54339. async extractTextContent(evaluator, task, viewBox) {
  54340. await super.extractTextContent(evaluator, task, viewBox);
  54341. const text = this.data.textContent;
  54342. if (!text) {
  54343. return;
  54344. }
  54345. const allText = text.join("\n");
  54346. if (allText === this.data.fieldValue) {
  54347. return;
  54348. }
  54349. const regex = allText.replaceAll(/([.*+?^${}()|[\]\\])|(\s+)/g, (_m, p1) => p1 ? `\\${p1}` : "\\s+");
  54350. if (new RegExp(`^\\s*${regex}\\s*$`).test(this.data.fieldValue)) {
  54351. this.data.textContent = this.data.fieldValue.split("\n");
  54352. }
  54353. }
  54354. getFieldObject() {
  54355. return {
  54356. id: this.data.id,
  54357. value: this.data.fieldValue,
  54358. defaultValue: this.data.defaultFieldValue || "",
  54359. multiline: this.data.multiLine,
  54360. password: this.hasFieldFlag(AnnotationFieldFlag.PASSWORD),
  54361. charLimit: this.data.maxLen,
  54362. comb: this.data.comb,
  54363. editable: !this.data.readOnly,
  54364. hidden: this.data.hidden,
  54365. name: this.data.fieldName,
  54366. rect: this.data.rect,
  54367. actions: this.data.actions,
  54368. page: this.data.pageIndex,
  54369. strokeColor: this.data.borderColor,
  54370. fillColor: this.data.backgroundColor,
  54371. rotation: this.rotation,
  54372. type: "text"
  54373. };
  54374. }
  54375. }
  54376. class ButtonWidgetAnnotation extends WidgetAnnotation {
  54377. constructor(params) {
  54378. super(params);
  54379. this.checkedAppearance = null;
  54380. this.uncheckedAppearance = null;
  54381. this.data.checkBox = !this.hasFieldFlag(AnnotationFieldFlag.RADIO) && !this.hasFieldFlag(AnnotationFieldFlag.PUSHBUTTON);
  54382. this.data.radioButton = this.hasFieldFlag(AnnotationFieldFlag.RADIO) && !this.hasFieldFlag(AnnotationFieldFlag.PUSHBUTTON);
  54383. this.data.pushButton = this.hasFieldFlag(AnnotationFieldFlag.PUSHBUTTON);
  54384. this.data.isTooltipOnly = false;
  54385. if (this.data.checkBox) {
  54386. this._processCheckBox(params);
  54387. } else if (this.data.radioButton) {
  54388. this._processRadioButton(params);
  54389. } else if (this.data.pushButton) {
  54390. this.data.hasOwnCanvas = true;
  54391. this.data.noHTML = false;
  54392. this._processPushButton(params);
  54393. } else {
  54394. warn("Invalid field flags for button widget annotation");
  54395. }
  54396. }
  54397. async getOperatorList(evaluator, task, intent, annotationStorage) {
  54398. if (this.data.pushButton) {
  54399. return super.getOperatorList(evaluator, task, intent, false, annotationStorage);
  54400. }
  54401. let value = null;
  54402. let rotation = null;
  54403. if (annotationStorage) {
  54404. const storageEntry = annotationStorage.get(this.data.id);
  54405. value = storageEntry ? storageEntry.value : null;
  54406. rotation = storageEntry ? storageEntry.rotation : null;
  54407. }
  54408. if (value === null && this.appearance) {
  54409. return super.getOperatorList(evaluator, task, intent, annotationStorage);
  54410. }
  54411. if (value === null || value === undefined) {
  54412. value = this.data.checkBox ? this.data.fieldValue === this.data.exportValue : this.data.fieldValue === this.data.buttonValue;
  54413. }
  54414. const appearance = value ? this.checkedAppearance : this.uncheckedAppearance;
  54415. if (appearance) {
  54416. const savedAppearance = this.appearance;
  54417. const savedMatrix = lookupMatrix(appearance.dict.getArray("Matrix"), IDENTITY_MATRIX);
  54418. if (rotation) {
  54419. appearance.dict.set("Matrix", this.getRotationMatrix(annotationStorage));
  54420. }
  54421. this.appearance = appearance;
  54422. const operatorList = super.getOperatorList(evaluator, task, intent, annotationStorage);
  54423. this.appearance = savedAppearance;
  54424. appearance.dict.set("Matrix", savedMatrix);
  54425. return operatorList;
  54426. }
  54427. return {
  54428. opList: new OperatorList(),
  54429. separateForm: false,
  54430. separateCanvas: false
  54431. };
  54432. }
  54433. async save(evaluator, task, annotationStorage) {
  54434. if (this.data.checkBox) {
  54435. return this._saveCheckbox(evaluator, task, annotationStorage);
  54436. }
  54437. if (this.data.radioButton) {
  54438. return this._saveRadioButton(evaluator, task, annotationStorage);
  54439. }
  54440. return null;
  54441. }
  54442. async _saveCheckbox(evaluator, task, annotationStorage) {
  54443. if (!annotationStorage) {
  54444. return null;
  54445. }
  54446. const storageEntry = annotationStorage.get(this.data.id);
  54447. const flags = this._buildFlags(storageEntry?.noView, storageEntry?.noPrint);
  54448. let rotation = storageEntry?.rotation,
  54449. value = storageEntry?.value;
  54450. if (rotation === undefined && flags === undefined) {
  54451. if (value === undefined) {
  54452. return null;
  54453. }
  54454. const defaultValue = this.data.fieldValue === this.data.exportValue;
  54455. if (defaultValue === value) {
  54456. return null;
  54457. }
  54458. }
  54459. let dict = evaluator.xref.fetchIfRef(this.ref);
  54460. if (!(dict instanceof Dict)) {
  54461. return null;
  54462. }
  54463. dict = dict.clone();
  54464. if (rotation === undefined) {
  54465. rotation = this.rotation;
  54466. }
  54467. if (value === undefined) {
  54468. value = this.data.fieldValue === this.data.exportValue;
  54469. }
  54470. const xfa = {
  54471. path: this.data.fieldName,
  54472. value: value ? this.data.exportValue : ""
  54473. };
  54474. const name = Name.get(value ? this.data.exportValue : "Off");
  54475. dict.set("V", name);
  54476. dict.set("AS", name);
  54477. dict.set("M", `D:${getModificationDate()}`);
  54478. if (flags !== undefined) {
  54479. dict.set("F", flags);
  54480. }
  54481. const maybeMK = this._getMKDict(rotation);
  54482. if (maybeMK) {
  54483. dict.set("MK", maybeMK);
  54484. }
  54485. const buffer = [];
  54486. await writeObject(this.ref, dict, buffer, evaluator.xref);
  54487. return [{
  54488. ref: this.ref,
  54489. data: buffer.join(""),
  54490. xfa
  54491. }];
  54492. }
  54493. async _saveRadioButton(evaluator, task, annotationStorage) {
  54494. if (!annotationStorage) {
  54495. return null;
  54496. }
  54497. const storageEntry = annotationStorage.get(this.data.id);
  54498. const flags = this._buildFlags(storageEntry?.noView, storageEntry?.noPrint);
  54499. let rotation = storageEntry?.rotation,
  54500. value = storageEntry?.value;
  54501. if (rotation === undefined && flags === undefined) {
  54502. if (value === undefined) {
  54503. return null;
  54504. }
  54505. const defaultValue = this.data.fieldValue === this.data.buttonValue;
  54506. if (defaultValue === value) {
  54507. return null;
  54508. }
  54509. }
  54510. let dict = evaluator.xref.fetchIfRef(this.ref);
  54511. if (!(dict instanceof Dict)) {
  54512. return null;
  54513. }
  54514. dict = dict.clone();
  54515. if (value === undefined) {
  54516. value = this.data.fieldValue === this.data.buttonValue;
  54517. }
  54518. if (rotation === undefined) {
  54519. rotation = this.rotation;
  54520. }
  54521. const xfa = {
  54522. path: this.data.fieldName,
  54523. value: value ? this.data.buttonValue : ""
  54524. };
  54525. const name = Name.get(value ? this.data.buttonValue : "Off");
  54526. const buffer = [];
  54527. let parentData = null;
  54528. if (value) {
  54529. if (this.parent instanceof Ref) {
  54530. const parent = evaluator.xref.fetch(this.parent);
  54531. parent.set("V", name);
  54532. await writeObject(this.parent, parent, buffer, evaluator.xref);
  54533. parentData = buffer.join("");
  54534. buffer.length = 0;
  54535. } else if (this.parent instanceof Dict) {
  54536. this.parent.set("V", name);
  54537. }
  54538. }
  54539. if (!this.parent) {
  54540. dict.set("V", name);
  54541. }
  54542. dict.set("AS", name);
  54543. dict.set("M", `D:${getModificationDate()}`);
  54544. if (flags !== undefined) {
  54545. dict.set("F", flags);
  54546. }
  54547. const maybeMK = this._getMKDict(rotation);
  54548. if (maybeMK) {
  54549. dict.set("MK", maybeMK);
  54550. }
  54551. await writeObject(this.ref, dict, buffer, evaluator.xref);
  54552. const newRefs = [{
  54553. ref: this.ref,
  54554. data: buffer.join(""),
  54555. xfa
  54556. }];
  54557. if (parentData) {
  54558. newRefs.push({
  54559. ref: this.parent,
  54560. data: parentData,
  54561. xfa: null
  54562. });
  54563. }
  54564. return newRefs;
  54565. }
  54566. _getDefaultCheckedAppearance(params, type) {
  54567. const width = this.data.rect[2] - this.data.rect[0];
  54568. const height = this.data.rect[3] - this.data.rect[1];
  54569. const bbox = [0, 0, width, height];
  54570. const FONT_RATIO = 0.8;
  54571. const fontSize = Math.min(width, height) * FONT_RATIO;
  54572. let metrics, char;
  54573. if (type === "check") {
  54574. metrics = {
  54575. width: 0.755 * fontSize,
  54576. height: 0.705 * fontSize
  54577. };
  54578. char = "\x33";
  54579. } else if (type === "disc") {
  54580. metrics = {
  54581. width: 0.791 * fontSize,
  54582. height: 0.705 * fontSize
  54583. };
  54584. char = "\x6C";
  54585. } else {
  54586. unreachable(`_getDefaultCheckedAppearance - unsupported type: ${type}`);
  54587. }
  54588. const xShift = numberToString((width - metrics.width) / 2);
  54589. const yShift = numberToString((height - metrics.height) / 2);
  54590. const appearance = `q BT /PdfJsZaDb ${fontSize} Tf 0 g ${xShift} ${yShift} Td (${char}) Tj ET Q`;
  54591. const appearanceStreamDict = new Dict(params.xref);
  54592. appearanceStreamDict.set("FormType", 1);
  54593. appearanceStreamDict.set("Subtype", Name.get("Form"));
  54594. appearanceStreamDict.set("Type", Name.get("XObject"));
  54595. appearanceStreamDict.set("BBox", bbox);
  54596. appearanceStreamDict.set("Matrix", [1, 0, 0, 1, 0, 0]);
  54597. appearanceStreamDict.set("Length", appearance.length);
  54598. const resources = new Dict(params.xref);
  54599. const font = new Dict(params.xref);
  54600. font.set("PdfJsZaDb", this.fallbackFontDict);
  54601. resources.set("Font", font);
  54602. appearanceStreamDict.set("Resources", resources);
  54603. this.checkedAppearance = new StringStream(appearance);
  54604. this.checkedAppearance.dict = appearanceStreamDict;
  54605. this._streams.push(this.checkedAppearance);
  54606. }
  54607. _processCheckBox(params) {
  54608. const customAppearance = params.dict.get("AP");
  54609. if (!(customAppearance instanceof Dict)) {
  54610. return;
  54611. }
  54612. const normalAppearance = customAppearance.get("N");
  54613. if (!(normalAppearance instanceof Dict)) {
  54614. return;
  54615. }
  54616. const asValue = this._decodeFormValue(params.dict.get("AS"));
  54617. if (typeof asValue === "string") {
  54618. this.data.fieldValue = asValue;
  54619. }
  54620. const yes = this.data.fieldValue !== null && this.data.fieldValue !== "Off" ? this.data.fieldValue : "Yes";
  54621. const exportValues = normalAppearance.getKeys();
  54622. if (exportValues.length === 0) {
  54623. exportValues.push("Off", yes);
  54624. } else if (exportValues.length === 1) {
  54625. if (exportValues[0] === "Off") {
  54626. exportValues.push(yes);
  54627. } else {
  54628. exportValues.unshift("Off");
  54629. }
  54630. } else if (exportValues.includes(yes)) {
  54631. exportValues.length = 0;
  54632. exportValues.push("Off", yes);
  54633. } else {
  54634. const otherYes = exportValues.find(v => v !== "Off");
  54635. exportValues.length = 0;
  54636. exportValues.push("Off", otherYes);
  54637. }
  54638. if (!exportValues.includes(this.data.fieldValue)) {
  54639. this.data.fieldValue = "Off";
  54640. }
  54641. this.data.exportValue = exportValues[1];
  54642. const checkedAppearance = normalAppearance.get(this.data.exportValue);
  54643. this.checkedAppearance = checkedAppearance instanceof BaseStream ? checkedAppearance : null;
  54644. const uncheckedAppearance = normalAppearance.get("Off");
  54645. this.uncheckedAppearance = uncheckedAppearance instanceof BaseStream ? uncheckedAppearance : null;
  54646. if (this.checkedAppearance) {
  54647. this._streams.push(this.checkedAppearance);
  54648. } else {
  54649. this._getDefaultCheckedAppearance(params, "check");
  54650. }
  54651. if (this.uncheckedAppearance) {
  54652. this._streams.push(this.uncheckedAppearance);
  54653. }
  54654. this._fallbackFontDict = this.fallbackFontDict;
  54655. if (this.data.defaultFieldValue === null) {
  54656. this.data.defaultFieldValue = "Off";
  54657. }
  54658. }
  54659. _processRadioButton(params) {
  54660. this.data.buttonValue = null;
  54661. const fieldParent = params.dict.get("Parent");
  54662. if (fieldParent instanceof Dict) {
  54663. this.parent = params.dict.getRaw("Parent");
  54664. const fieldParentValue = fieldParent.get("V");
  54665. if (fieldParentValue instanceof Name) {
  54666. this.data.fieldValue = this._decodeFormValue(fieldParentValue);
  54667. }
  54668. }
  54669. const appearanceStates = params.dict.get("AP");
  54670. if (!(appearanceStates instanceof Dict)) {
  54671. return;
  54672. }
  54673. const normalAppearance = appearanceStates.get("N");
  54674. if (!(normalAppearance instanceof Dict)) {
  54675. return;
  54676. }
  54677. for (const key of normalAppearance.getKeys()) {
  54678. if (key !== "Off") {
  54679. this.data.buttonValue = this._decodeFormValue(key);
  54680. break;
  54681. }
  54682. }
  54683. const checkedAppearance = normalAppearance.get(this.data.buttonValue);
  54684. this.checkedAppearance = checkedAppearance instanceof BaseStream ? checkedAppearance : null;
  54685. const uncheckedAppearance = normalAppearance.get("Off");
  54686. this.uncheckedAppearance = uncheckedAppearance instanceof BaseStream ? uncheckedAppearance : null;
  54687. if (this.checkedAppearance) {
  54688. this._streams.push(this.checkedAppearance);
  54689. } else {
  54690. this._getDefaultCheckedAppearance(params, "disc");
  54691. }
  54692. if (this.uncheckedAppearance) {
  54693. this._streams.push(this.uncheckedAppearance);
  54694. }
  54695. this._fallbackFontDict = this.fallbackFontDict;
  54696. if (this.data.defaultFieldValue === null) {
  54697. this.data.defaultFieldValue = "Off";
  54698. }
  54699. }
  54700. _processPushButton(params) {
  54701. const {
  54702. dict,
  54703. annotationGlobals
  54704. } = params;
  54705. if (!dict.has("A") && !dict.has("AA") && !this.data.alternativeText) {
  54706. warn("Push buttons without action dictionaries are not supported");
  54707. return;
  54708. }
  54709. this.data.isTooltipOnly = !dict.has("A") && !dict.has("AA");
  54710. Catalog.parseDestDictionary({
  54711. destDict: dict,
  54712. resultObj: this.data,
  54713. docBaseUrl: annotationGlobals.baseUrl,
  54714. docAttachments: annotationGlobals.attachments
  54715. });
  54716. }
  54717. getFieldObject() {
  54718. let type = "button";
  54719. let exportValues;
  54720. if (this.data.checkBox) {
  54721. type = "checkbox";
  54722. exportValues = this.data.exportValue;
  54723. } else if (this.data.radioButton) {
  54724. type = "radiobutton";
  54725. exportValues = this.data.buttonValue;
  54726. }
  54727. return {
  54728. id: this.data.id,
  54729. value: this.data.fieldValue || "Off",
  54730. defaultValue: this.data.defaultFieldValue,
  54731. exportValues,
  54732. editable: !this.data.readOnly,
  54733. name: this.data.fieldName,
  54734. rect: this.data.rect,
  54735. hidden: this.data.hidden,
  54736. actions: this.data.actions,
  54737. page: this.data.pageIndex,
  54738. strokeColor: this.data.borderColor,
  54739. fillColor: this.data.backgroundColor,
  54740. rotation: this.rotation,
  54741. type
  54742. };
  54743. }
  54744. get fallbackFontDict() {
  54745. const dict = new Dict();
  54746. dict.set("BaseFont", Name.get("ZapfDingbats"));
  54747. dict.set("Type", Name.get("FallbackType"));
  54748. dict.set("Subtype", Name.get("FallbackType"));
  54749. dict.set("Encoding", Name.get("ZapfDingbatsEncoding"));
  54750. return shadow(this, "fallbackFontDict", dict);
  54751. }
  54752. }
  54753. class ChoiceWidgetAnnotation extends WidgetAnnotation {
  54754. constructor(params) {
  54755. super(params);
  54756. const {
  54757. dict,
  54758. xref
  54759. } = params;
  54760. this.indices = dict.getArray("I");
  54761. this.hasIndices = Array.isArray(this.indices) && this.indices.length > 0;
  54762. this.data.options = [];
  54763. const options = getInheritableProperty({
  54764. dict,
  54765. key: "Opt"
  54766. });
  54767. if (Array.isArray(options)) {
  54768. for (let i = 0, ii = options.length; i < ii; i++) {
  54769. const option = xref.fetchIfRef(options[i]);
  54770. const isOptionArray = Array.isArray(option);
  54771. this.data.options[i] = {
  54772. exportValue: this._decodeFormValue(isOptionArray ? xref.fetchIfRef(option[0]) : option),
  54773. displayValue: this._decodeFormValue(isOptionArray ? xref.fetchIfRef(option[1]) : option)
  54774. };
  54775. }
  54776. }
  54777. if (!this.hasIndices) {
  54778. if (typeof this.data.fieldValue === "string") {
  54779. this.data.fieldValue = [this.data.fieldValue];
  54780. } else if (!this.data.fieldValue) {
  54781. this.data.fieldValue = [];
  54782. }
  54783. } else {
  54784. this.data.fieldValue = [];
  54785. const ii = this.data.options.length;
  54786. for (const i of this.indices) {
  54787. if (Number.isInteger(i) && i >= 0 && i < ii) {
  54788. this.data.fieldValue.push(this.data.options[i].exportValue);
  54789. }
  54790. }
  54791. }
  54792. this.data.combo = this.hasFieldFlag(AnnotationFieldFlag.COMBO);
  54793. this.data.multiSelect = this.hasFieldFlag(AnnotationFieldFlag.MULTISELECT);
  54794. this._hasText = true;
  54795. }
  54796. getFieldObject() {
  54797. const type = this.data.combo ? "combobox" : "listbox";
  54798. const value = this.data.fieldValue.length > 0 ? this.data.fieldValue[0] : null;
  54799. return {
  54800. id: this.data.id,
  54801. value,
  54802. defaultValue: this.data.defaultFieldValue,
  54803. editable: !this.data.readOnly,
  54804. name: this.data.fieldName,
  54805. rect: this.data.rect,
  54806. numItems: this.data.fieldValue.length,
  54807. multipleSelection: this.data.multiSelect,
  54808. hidden: this.data.hidden,
  54809. actions: this.data.actions,
  54810. items: this.data.options,
  54811. page: this.data.pageIndex,
  54812. strokeColor: this.data.borderColor,
  54813. fillColor: this.data.backgroundColor,
  54814. rotation: this.rotation,
  54815. type
  54816. };
  54817. }
  54818. amendSavedDict(annotationStorage, dict) {
  54819. if (!this.hasIndices) {
  54820. return;
  54821. }
  54822. let values = annotationStorage?.get(this.data.id)?.value;
  54823. if (!Array.isArray(values)) {
  54824. values = [values];
  54825. }
  54826. const indices = [];
  54827. const {
  54828. options
  54829. } = this.data;
  54830. for (let i = 0, j = 0, ii = options.length; i < ii; i++) {
  54831. if (options[i].exportValue === values[j]) {
  54832. indices.push(i);
  54833. j += 1;
  54834. }
  54835. }
  54836. dict.set("I", indices);
  54837. }
  54838. async _getAppearance(evaluator, task, intent, annotationStorage) {
  54839. if (this.data.combo) {
  54840. return super._getAppearance(evaluator, task, intent, annotationStorage);
  54841. }
  54842. let exportedValue, rotation;
  54843. const storageEntry = annotationStorage?.get(this.data.id);
  54844. if (storageEntry) {
  54845. rotation = storageEntry.rotation;
  54846. exportedValue = storageEntry.value;
  54847. }
  54848. if (rotation === undefined && exportedValue === undefined && !this._needAppearances) {
  54849. return null;
  54850. }
  54851. if (exportedValue === undefined) {
  54852. exportedValue = this.data.fieldValue;
  54853. } else if (!Array.isArray(exportedValue)) {
  54854. exportedValue = [exportedValue];
  54855. }
  54856. const defaultPadding = 1;
  54857. const defaultHPadding = 2;
  54858. let totalHeight = this.data.rect[3] - this.data.rect[1];
  54859. let totalWidth = this.data.rect[2] - this.data.rect[0];
  54860. if (rotation === 90 || rotation === 270) {
  54861. [totalWidth, totalHeight] = [totalHeight, totalWidth];
  54862. }
  54863. const lineCount = this.data.options.length;
  54864. const valueIndices = [];
  54865. for (let i = 0; i < lineCount; i++) {
  54866. const {
  54867. exportValue
  54868. } = this.data.options[i];
  54869. if (exportedValue.includes(exportValue)) {
  54870. valueIndices.push(i);
  54871. }
  54872. }
  54873. if (!this._defaultAppearance) {
  54874. this.data.defaultAppearanceData = parseDefaultAppearance(this._defaultAppearance = "/Helvetica 0 Tf 0 g");
  54875. }
  54876. const font = await WidgetAnnotation._getFontData(evaluator, task, this.data.defaultAppearanceData, this._fieldResources.mergedResources);
  54877. let defaultAppearance;
  54878. let {
  54879. fontSize
  54880. } = this.data.defaultAppearanceData;
  54881. if (!fontSize) {
  54882. const lineHeight = (totalHeight - defaultPadding) / lineCount;
  54883. let lineWidth = -1;
  54884. let value;
  54885. for (const {
  54886. displayValue
  54887. } of this.data.options) {
  54888. const width = this._getTextWidth(displayValue, font);
  54889. if (width > lineWidth) {
  54890. lineWidth = width;
  54891. value = displayValue;
  54892. }
  54893. }
  54894. [defaultAppearance, fontSize] = this._computeFontSize(lineHeight, totalWidth - 2 * defaultHPadding, value, font, -1);
  54895. } else {
  54896. defaultAppearance = this._defaultAppearance;
  54897. }
  54898. const lineHeight = fontSize * LINE_FACTOR;
  54899. const vPadding = (lineHeight - fontSize) / 2;
  54900. const numberOfVisibleLines = Math.floor(totalHeight / lineHeight);
  54901. let firstIndex = 0;
  54902. if (valueIndices.length > 0) {
  54903. const minIndex = Math.min(...valueIndices);
  54904. const maxIndex = Math.max(...valueIndices);
  54905. firstIndex = Math.max(0, maxIndex - numberOfVisibleLines + 1);
  54906. if (firstIndex > minIndex) {
  54907. firstIndex = minIndex;
  54908. }
  54909. }
  54910. const end = Math.min(firstIndex + numberOfVisibleLines + 1, lineCount);
  54911. const buf = ["/Tx BMC q", `1 1 ${totalWidth} ${totalHeight} re W n`];
  54912. if (valueIndices.length) {
  54913. buf.push("0.600006 0.756866 0.854904 rg");
  54914. for (const index of valueIndices) {
  54915. if (firstIndex <= index && index < end) {
  54916. buf.push(`1 ${totalHeight - (index - firstIndex + 1) * lineHeight} ${totalWidth} ${lineHeight} re f`);
  54917. }
  54918. }
  54919. }
  54920. buf.push("BT", defaultAppearance, `1 0 0 1 0 ${totalHeight} Tm`);
  54921. const prevInfo = {
  54922. shift: 0
  54923. };
  54924. for (let i = firstIndex; i < end; i++) {
  54925. const {
  54926. displayValue
  54927. } = this.data.options[i];
  54928. const vpadding = i === firstIndex ? vPadding : 0;
  54929. buf.push(this._renderText(displayValue, font, fontSize, totalWidth, 0, prevInfo, defaultHPadding, -lineHeight + vpadding));
  54930. }
  54931. buf.push("ET Q EMC");
  54932. return buf.join("\n");
  54933. }
  54934. }
  54935. class SignatureWidgetAnnotation extends WidgetAnnotation {
  54936. constructor(params) {
  54937. super(params);
  54938. this.data.fieldValue = null;
  54939. this.data.hasOwnCanvas = this.data.noRotate;
  54940. this.data.noHTML = !this.data.hasOwnCanvas;
  54941. }
  54942. getFieldObject() {
  54943. return {
  54944. id: this.data.id,
  54945. value: null,
  54946. page: this.data.pageIndex,
  54947. type: "signature"
  54948. };
  54949. }
  54950. }
  54951. class TextAnnotation extends MarkupAnnotation {
  54952. constructor(params) {
  54953. const DEFAULT_ICON_SIZE = 22;
  54954. super(params);
  54955. this.data.noRotate = true;
  54956. this.data.hasOwnCanvas = this.data.noRotate;
  54957. this.data.noHTML = false;
  54958. const {
  54959. dict
  54960. } = params;
  54961. this.data.annotationType = AnnotationType.TEXT;
  54962. if (this.data.hasAppearance) {
  54963. this.data.name = "NoIcon";
  54964. } else {
  54965. this.data.rect[1] = this.data.rect[3] - DEFAULT_ICON_SIZE;
  54966. this.data.rect[2] = this.data.rect[0] + DEFAULT_ICON_SIZE;
  54967. this.data.name = dict.has("Name") ? dict.get("Name").name : "Note";
  54968. }
  54969. if (dict.has("State")) {
  54970. this.data.state = dict.get("State") || null;
  54971. this.data.stateModel = dict.get("StateModel") || null;
  54972. } else {
  54973. this.data.state = null;
  54974. this.data.stateModel = null;
  54975. }
  54976. }
  54977. }
  54978. class LinkAnnotation extends Annotation {
  54979. constructor(params) {
  54980. super(params);
  54981. const {
  54982. dict,
  54983. annotationGlobals
  54984. } = params;
  54985. this.data.annotationType = AnnotationType.LINK;
  54986. this.data.noHTML = false;
  54987. const quadPoints = getQuadPoints(dict, this.rectangle);
  54988. if (quadPoints) {
  54989. this.data.quadPoints = quadPoints;
  54990. }
  54991. this.data.borderColor ||= this.data.color;
  54992. Catalog.parseDestDictionary({
  54993. destDict: dict,
  54994. resultObj: this.data,
  54995. docBaseUrl: annotationGlobals.baseUrl,
  54996. docAttachments: annotationGlobals.attachments
  54997. });
  54998. }
  54999. }
  55000. class PopupAnnotation extends Annotation {
  55001. constructor(params) {
  55002. super(params);
  55003. const {
  55004. dict
  55005. } = params;
  55006. this.data.annotationType = AnnotationType.POPUP;
  55007. this.data.noHTML = false;
  55008. if (this.data.rect[0] === this.data.rect[2] || this.data.rect[1] === this.data.rect[3]) {
  55009. this.data.rect = null;
  55010. }
  55011. let parentItem = dict.get("Parent");
  55012. if (!parentItem) {
  55013. warn("Popup annotation has a missing or invalid parent annotation.");
  55014. return;
  55015. }
  55016. this.data.parentRect = lookupNormalRect(parentItem.getArray("Rect"), null);
  55017. const rt = parentItem.get("RT");
  55018. if (isName(rt, AnnotationReplyType.GROUP)) {
  55019. parentItem = parentItem.get("IRT");
  55020. }
  55021. if (!parentItem.has("M")) {
  55022. this.data.modificationDate = null;
  55023. } else {
  55024. this.setModificationDate(parentItem.get("M"));
  55025. this.data.modificationDate = this.modificationDate;
  55026. }
  55027. if (!parentItem.has("C")) {
  55028. this.data.color = null;
  55029. } else {
  55030. this.setColor(parentItem.getArray("C"));
  55031. this.data.color = this.color;
  55032. }
  55033. if (!this.viewable) {
  55034. const parentFlags = parentItem.get("F");
  55035. if (this._isViewable(parentFlags)) {
  55036. this.setFlags(parentFlags);
  55037. }
  55038. }
  55039. this.setTitle(parentItem.get("T"));
  55040. this.data.titleObj = this._title;
  55041. this.setContents(parentItem.get("Contents"));
  55042. this.data.contentsObj = this._contents;
  55043. if (parentItem.has("RC")) {
  55044. this.data.richText = XFAFactory.getRichTextAsHtml(parentItem.get("RC"));
  55045. }
  55046. this.data.open = !!dict.get("Open");
  55047. }
  55048. }
  55049. class FreeTextAnnotation extends MarkupAnnotation {
  55050. constructor(params) {
  55051. super(params);
  55052. this.data.hasOwnCanvas = this.data.noRotate;
  55053. this.data.isEditable = !this.data.noHTML;
  55054. this.data.noHTML = false;
  55055. const {
  55056. evaluatorOptions,
  55057. xref
  55058. } = params;
  55059. this.data.annotationType = AnnotationType.FREETEXT;
  55060. this.setDefaultAppearance(params);
  55061. this._hasAppearance = !!this.appearance;
  55062. if (this._hasAppearance) {
  55063. const {
  55064. fontColor,
  55065. fontSize
  55066. } = parseAppearanceStream(this.appearance, evaluatorOptions, xref);
  55067. this.data.defaultAppearanceData.fontColor = fontColor;
  55068. this.data.defaultAppearanceData.fontSize = fontSize || 10;
  55069. } else {
  55070. this.data.defaultAppearanceData.fontSize ||= 10;
  55071. const {
  55072. fontColor,
  55073. fontSize
  55074. } = this.data.defaultAppearanceData;
  55075. if (this._contents.str) {
  55076. this.data.textContent = this._contents.str.split(/\r\n?|\n/).map(line => line.trimEnd());
  55077. const {
  55078. coords,
  55079. bbox,
  55080. matrix
  55081. } = FakeUnicodeFont.getFirstPositionInfo(this.rectangle, this.rotation, fontSize);
  55082. this.data.textPosition = this._transformPoint(coords, bbox, matrix);
  55083. }
  55084. if (this._isOffscreenCanvasSupported) {
  55085. const strokeAlpha = params.dict.get("CA");
  55086. const fakeUnicodeFont = new FakeUnicodeFont(xref, "sans-serif");
  55087. this.appearance = fakeUnicodeFont.createAppearance(this._contents.str, this.rectangle, this.rotation, fontSize, fontColor, strokeAlpha);
  55088. this._streams.push(this.appearance);
  55089. } else {
  55090. warn("FreeTextAnnotation: OffscreenCanvas is not supported, annotation may not render correctly.");
  55091. }
  55092. }
  55093. }
  55094. get hasTextContent() {
  55095. return this._hasAppearance;
  55096. }
  55097. static createNewDict(annotation, xref, {
  55098. apRef,
  55099. ap
  55100. }) {
  55101. const {
  55102. color,
  55103. fontSize,
  55104. oldAnnotation,
  55105. rect,
  55106. rotation,
  55107. user,
  55108. value
  55109. } = annotation;
  55110. const freetext = oldAnnotation || new Dict(xref);
  55111. freetext.set("Type", Name.get("Annot"));
  55112. freetext.set("Subtype", Name.get("FreeText"));
  55113. if (oldAnnotation) {
  55114. freetext.set("M", `D:${getModificationDate()}`);
  55115. freetext.delete("RC");
  55116. } else {
  55117. freetext.set("CreationDate", `D:${getModificationDate()}`);
  55118. }
  55119. freetext.set("Rect", rect);
  55120. const da = `/Helv ${fontSize} Tf ${getPdfColor(color, true)}`;
  55121. freetext.set("DA", da);
  55122. freetext.set("Contents", stringToAsciiOrUTF16BE(value));
  55123. freetext.set("F", 4);
  55124. freetext.set("Border", [0, 0, 0]);
  55125. freetext.set("Rotate", rotation);
  55126. if (user) {
  55127. freetext.set("T", stringToAsciiOrUTF16BE(user));
  55128. }
  55129. if (apRef || ap) {
  55130. const n = new Dict(xref);
  55131. freetext.set("AP", n);
  55132. if (apRef) {
  55133. n.set("N", apRef);
  55134. } else {
  55135. n.set("N", ap);
  55136. }
  55137. }
  55138. return freetext;
  55139. }
  55140. static async createNewAppearanceStream(annotation, xref, params) {
  55141. const {
  55142. baseFontRef,
  55143. evaluator,
  55144. task
  55145. } = params;
  55146. const {
  55147. color,
  55148. fontSize,
  55149. rect,
  55150. rotation,
  55151. value
  55152. } = annotation;
  55153. const resources = new Dict(xref);
  55154. const font = new Dict(xref);
  55155. if (baseFontRef) {
  55156. font.set("Helv", baseFontRef);
  55157. } else {
  55158. const baseFont = new Dict(xref);
  55159. baseFont.set("BaseFont", Name.get("Helvetica"));
  55160. baseFont.set("Type", Name.get("Font"));
  55161. baseFont.set("Subtype", Name.get("Type1"));
  55162. baseFont.set("Encoding", Name.get("WinAnsiEncoding"));
  55163. font.set("Helv", baseFont);
  55164. }
  55165. resources.set("Font", font);
  55166. const helv = await WidgetAnnotation._getFontData(evaluator, task, {
  55167. fontName: "Helv",
  55168. fontSize
  55169. }, resources);
  55170. const [x1, y1, x2, y2] = rect;
  55171. let w = x2 - x1;
  55172. let h = y2 - y1;
  55173. if (rotation % 180 !== 0) {
  55174. [w, h] = [h, w];
  55175. }
  55176. const lines = value.split("\n");
  55177. const scale = fontSize / 1000;
  55178. let totalWidth = -Infinity;
  55179. const encodedLines = [];
  55180. for (let line of lines) {
  55181. const encoded = helv.encodeString(line);
  55182. if (encoded.length > 1) {
  55183. return null;
  55184. }
  55185. line = encoded.join("");
  55186. encodedLines.push(line);
  55187. let lineWidth = 0;
  55188. const glyphs = helv.charsToGlyphs(line);
  55189. for (const glyph of glyphs) {
  55190. lineWidth += glyph.width * scale;
  55191. }
  55192. totalWidth = Math.max(totalWidth, lineWidth);
  55193. }
  55194. let hscale = 1;
  55195. if (totalWidth > w) {
  55196. hscale = w / totalWidth;
  55197. }
  55198. let vscale = 1;
  55199. const lineHeight = LINE_FACTOR * fontSize;
  55200. const lineAscent = (LINE_FACTOR - LINE_DESCENT_FACTOR) * fontSize;
  55201. const totalHeight = lineHeight * lines.length;
  55202. if (totalHeight > h) {
  55203. vscale = h / totalHeight;
  55204. }
  55205. const fscale = Math.min(hscale, vscale);
  55206. const newFontSize = fontSize * fscale;
  55207. let firstPoint, clipBox, matrix;
  55208. switch (rotation) {
  55209. case 0:
  55210. matrix = [1, 0, 0, 1];
  55211. clipBox = [rect[0], rect[1], w, h];
  55212. firstPoint = [rect[0], rect[3] - lineAscent];
  55213. break;
  55214. case 90:
  55215. matrix = [0, 1, -1, 0];
  55216. clipBox = [rect[1], -rect[2], w, h];
  55217. firstPoint = [rect[1], -rect[0] - lineAscent];
  55218. break;
  55219. case 180:
  55220. matrix = [-1, 0, 0, -1];
  55221. clipBox = [-rect[2], -rect[3], w, h];
  55222. firstPoint = [-rect[2], -rect[1] - lineAscent];
  55223. break;
  55224. case 270:
  55225. matrix = [0, -1, 1, 0];
  55226. clipBox = [-rect[3], rect[0], w, h];
  55227. firstPoint = [-rect[3], rect[2] - lineAscent];
  55228. break;
  55229. }
  55230. const buffer = ["q", `${matrix.join(" ")} 0 0 cm`, `${clipBox.join(" ")} re W n`, `BT`, `${getPdfColor(color, true)}`, `0 Tc /Helv ${numberToString(newFontSize)} Tf`];
  55231. buffer.push(`${firstPoint.join(" ")} Td (${escapeString(encodedLines[0])}) Tj`);
  55232. const vShift = numberToString(lineHeight);
  55233. for (let i = 1, ii = encodedLines.length; i < ii; i++) {
  55234. const line = encodedLines[i];
  55235. buffer.push(`0 -${vShift} Td (${escapeString(line)}) Tj`);
  55236. }
  55237. buffer.push("ET", "Q");
  55238. const appearance = buffer.join("\n");
  55239. const appearanceStreamDict = new Dict(xref);
  55240. appearanceStreamDict.set("FormType", 1);
  55241. appearanceStreamDict.set("Subtype", Name.get("Form"));
  55242. appearanceStreamDict.set("Type", Name.get("XObject"));
  55243. appearanceStreamDict.set("BBox", rect);
  55244. appearanceStreamDict.set("Resources", resources);
  55245. appearanceStreamDict.set("Matrix", [1, 0, 0, 1, -rect[0], -rect[1]]);
  55246. const ap = new StringStream(appearance);
  55247. ap.dict = appearanceStreamDict;
  55248. return ap;
  55249. }
  55250. }
  55251. class LineAnnotation extends MarkupAnnotation {
  55252. constructor(params) {
  55253. super(params);
  55254. const {
  55255. dict,
  55256. xref
  55257. } = params;
  55258. this.data.annotationType = AnnotationType.LINE;
  55259. this.data.hasOwnCanvas = this.data.noRotate;
  55260. this.data.noHTML = false;
  55261. const lineCoordinates = lookupRect(dict.getArray("L"), [0, 0, 0, 0]);
  55262. this.data.lineCoordinates = Util.normalizeRect(lineCoordinates);
  55263. this.setLineEndings(dict.getArray("LE"));
  55264. this.data.lineEndings = this.lineEndings;
  55265. if (!this.appearance) {
  55266. const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0];
  55267. const strokeAlpha = dict.get("CA");
  55268. const interiorColor = getRgbColor(dict.getArray("IC"), null);
  55269. const fillColor = interiorColor ? getPdfColorArray(interiorColor) : null;
  55270. const fillAlpha = fillColor ? strokeAlpha : null;
  55271. const borderWidth = this.borderStyle.width || 1,
  55272. borderAdjust = 2 * borderWidth;
  55273. const bbox = [this.data.lineCoordinates[0] - borderAdjust, this.data.lineCoordinates[1] - borderAdjust, this.data.lineCoordinates[2] + borderAdjust, this.data.lineCoordinates[3] + borderAdjust];
  55274. if (!Util.intersect(this.rectangle, bbox)) {
  55275. this.rectangle = bbox;
  55276. }
  55277. this._setDefaultAppearance({
  55278. xref,
  55279. extra: `${borderWidth} w`,
  55280. strokeColor,
  55281. fillColor,
  55282. strokeAlpha,
  55283. fillAlpha,
  55284. pointsCallback: (buffer, points) => {
  55285. buffer.push(`${lineCoordinates[0]} ${lineCoordinates[1]} m`, `${lineCoordinates[2]} ${lineCoordinates[3]} l`, "S");
  55286. return [points[0] - borderWidth, points[2] + borderWidth, points[7] - borderWidth, points[3] + borderWidth];
  55287. }
  55288. });
  55289. }
  55290. }
  55291. }
  55292. class SquareAnnotation extends MarkupAnnotation {
  55293. constructor(params) {
  55294. super(params);
  55295. const {
  55296. dict,
  55297. xref
  55298. } = params;
  55299. this.data.annotationType = AnnotationType.SQUARE;
  55300. this.data.hasOwnCanvas = this.data.noRotate;
  55301. this.data.noHTML = false;
  55302. if (!this.appearance) {
  55303. const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0];
  55304. const strokeAlpha = dict.get("CA");
  55305. const interiorColor = getRgbColor(dict.getArray("IC"), null);
  55306. const fillColor = interiorColor ? getPdfColorArray(interiorColor) : null;
  55307. const fillAlpha = fillColor ? strokeAlpha : null;
  55308. if (this.borderStyle.width === 0 && !fillColor) {
  55309. return;
  55310. }
  55311. this._setDefaultAppearance({
  55312. xref,
  55313. extra: `${this.borderStyle.width} w`,
  55314. strokeColor,
  55315. fillColor,
  55316. strokeAlpha,
  55317. fillAlpha,
  55318. pointsCallback: (buffer, points) => {
  55319. const x = points[4] + this.borderStyle.width / 2;
  55320. const y = points[5] + this.borderStyle.width / 2;
  55321. const width = points[6] - points[4] - this.borderStyle.width;
  55322. const height = points[3] - points[7] - this.borderStyle.width;
  55323. buffer.push(`${x} ${y} ${width} ${height} re`);
  55324. if (fillColor) {
  55325. buffer.push("B");
  55326. } else {
  55327. buffer.push("S");
  55328. }
  55329. return [points[0], points[2], points[7], points[3]];
  55330. }
  55331. });
  55332. }
  55333. }
  55334. }
  55335. class CircleAnnotation extends MarkupAnnotation {
  55336. constructor(params) {
  55337. super(params);
  55338. const {
  55339. dict,
  55340. xref
  55341. } = params;
  55342. this.data.annotationType = AnnotationType.CIRCLE;
  55343. if (!this.appearance) {
  55344. const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0];
  55345. const strokeAlpha = dict.get("CA");
  55346. const interiorColor = getRgbColor(dict.getArray("IC"), null);
  55347. const fillColor = interiorColor ? getPdfColorArray(interiorColor) : null;
  55348. const fillAlpha = fillColor ? strokeAlpha : null;
  55349. if (this.borderStyle.width === 0 && !fillColor) {
  55350. return;
  55351. }
  55352. const controlPointsDistance = 4 / 3 * Math.tan(Math.PI / (2 * 4));
  55353. this._setDefaultAppearance({
  55354. xref,
  55355. extra: `${this.borderStyle.width} w`,
  55356. strokeColor,
  55357. fillColor,
  55358. strokeAlpha,
  55359. fillAlpha,
  55360. pointsCallback: (buffer, points) => {
  55361. const x0 = points[0] + this.borderStyle.width / 2;
  55362. const y0 = points[1] - this.borderStyle.width / 2;
  55363. const x1 = points[6] - this.borderStyle.width / 2;
  55364. const y1 = points[7] + this.borderStyle.width / 2;
  55365. const xMid = x0 + (x1 - x0) / 2;
  55366. const yMid = y0 + (y1 - y0) / 2;
  55367. const xOffset = (x1 - x0) / 2 * controlPointsDistance;
  55368. const yOffset = (y1 - y0) / 2 * controlPointsDistance;
  55369. buffer.push(`${xMid} ${y1} m`, `${xMid + xOffset} ${y1} ${x1} ${yMid + yOffset} ${x1} ${yMid} c`, `${x1} ${yMid - yOffset} ${xMid + xOffset} ${y0} ${xMid} ${y0} c`, `${xMid - xOffset} ${y0} ${x0} ${yMid - yOffset} ${x0} ${yMid} c`, `${x0} ${yMid + yOffset} ${xMid - xOffset} ${y1} ${xMid} ${y1} c`, "h");
  55370. if (fillColor) {
  55371. buffer.push("B");
  55372. } else {
  55373. buffer.push("S");
  55374. }
  55375. return [points[0], points[2], points[7], points[3]];
  55376. }
  55377. });
  55378. }
  55379. }
  55380. }
  55381. class PolylineAnnotation extends MarkupAnnotation {
  55382. constructor(params) {
  55383. super(params);
  55384. const {
  55385. dict,
  55386. xref
  55387. } = params;
  55388. this.data.annotationType = AnnotationType.POLYLINE;
  55389. this.data.hasOwnCanvas = this.data.noRotate;
  55390. this.data.noHTML = false;
  55391. this.data.vertices = null;
  55392. if (!(this instanceof PolygonAnnotation)) {
  55393. this.setLineEndings(dict.getArray("LE"));
  55394. this.data.lineEndings = this.lineEndings;
  55395. }
  55396. const rawVertices = dict.getArray("Vertices");
  55397. if (!isNumberArray(rawVertices, null)) {
  55398. return;
  55399. }
  55400. const vertices = this.data.vertices = Float32Array.from(rawVertices);
  55401. if (!this.appearance) {
  55402. const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0];
  55403. const strokeAlpha = dict.get("CA");
  55404. const borderWidth = this.borderStyle.width || 1,
  55405. borderAdjust = 2 * borderWidth;
  55406. const bbox = [Infinity, Infinity, -Infinity, -Infinity];
  55407. for (let i = 0, ii = vertices.length; i < ii; i += 2) {
  55408. bbox[0] = Math.min(bbox[0], vertices[i] - borderAdjust);
  55409. bbox[1] = Math.min(bbox[1], vertices[i + 1] - borderAdjust);
  55410. bbox[2] = Math.max(bbox[2], vertices[i] + borderAdjust);
  55411. bbox[3] = Math.max(bbox[3], vertices[i + 1] + borderAdjust);
  55412. }
  55413. if (!Util.intersect(this.rectangle, bbox)) {
  55414. this.rectangle = bbox;
  55415. }
  55416. this._setDefaultAppearance({
  55417. xref,
  55418. extra: `${borderWidth} w`,
  55419. strokeColor,
  55420. strokeAlpha,
  55421. pointsCallback: (buffer, points) => {
  55422. for (let i = 0, ii = vertices.length; i < ii; i += 2) {
  55423. buffer.push(`${vertices[i]} ${vertices[i + 1]} ${i === 0 ? "m" : "l"}`);
  55424. }
  55425. buffer.push("S");
  55426. return [points[0], points[2], points[7], points[3]];
  55427. }
  55428. });
  55429. }
  55430. }
  55431. }
  55432. class PolygonAnnotation extends PolylineAnnotation {
  55433. constructor(params) {
  55434. super(params);
  55435. this.data.annotationType = AnnotationType.POLYGON;
  55436. }
  55437. }
  55438. class CaretAnnotation extends MarkupAnnotation {
  55439. constructor(params) {
  55440. super(params);
  55441. this.data.annotationType = AnnotationType.CARET;
  55442. }
  55443. }
  55444. class InkAnnotation extends MarkupAnnotation {
  55445. constructor(params) {
  55446. super(params);
  55447. this.data.hasOwnCanvas = this.data.noRotate;
  55448. this.data.noHTML = false;
  55449. const {
  55450. dict,
  55451. xref
  55452. } = params;
  55453. this.data.annotationType = AnnotationType.INK;
  55454. this.data.inkLists = [];
  55455. this.data.isEditable = !this.data.noHTML && this.data.it === "InkHighlight";
  55456. this.data.noHTML = false;
  55457. this.data.opacity = dict.get("CA") || 1;
  55458. const rawInkLists = dict.getArray("InkList");
  55459. if (!Array.isArray(rawInkLists)) {
  55460. return;
  55461. }
  55462. for (let i = 0, ii = rawInkLists.length; i < ii; ++i) {
  55463. if (!Array.isArray(rawInkLists[i])) {
  55464. continue;
  55465. }
  55466. const inkList = new Float32Array(rawInkLists[i].length);
  55467. this.data.inkLists.push(inkList);
  55468. for (let j = 0, jj = rawInkLists[i].length; j < jj; j += 2) {
  55469. const x = xref.fetchIfRef(rawInkLists[i][j]),
  55470. y = xref.fetchIfRef(rawInkLists[i][j + 1]);
  55471. if (typeof x === "number" && typeof y === "number") {
  55472. inkList[j] = x;
  55473. inkList[j + 1] = y;
  55474. }
  55475. }
  55476. }
  55477. if (!this.appearance) {
  55478. const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0];
  55479. const strokeAlpha = dict.get("CA");
  55480. const borderWidth = this.borderStyle.width || 1,
  55481. borderAdjust = 2 * borderWidth;
  55482. const bbox = [Infinity, Infinity, -Infinity, -Infinity];
  55483. for (const inkList of this.data.inkLists) {
  55484. for (let i = 0, ii = inkList.length; i < ii; i += 2) {
  55485. bbox[0] = Math.min(bbox[0], inkList[i] - borderAdjust);
  55486. bbox[1] = Math.min(bbox[1], inkList[i + 1] - borderAdjust);
  55487. bbox[2] = Math.max(bbox[2], inkList[i] + borderAdjust);
  55488. bbox[3] = Math.max(bbox[3], inkList[i + 1] + borderAdjust);
  55489. }
  55490. }
  55491. if (!Util.intersect(this.rectangle, bbox)) {
  55492. this.rectangle = bbox;
  55493. }
  55494. this._setDefaultAppearance({
  55495. xref,
  55496. extra: `${borderWidth} w`,
  55497. strokeColor,
  55498. strokeAlpha,
  55499. pointsCallback: (buffer, points) => {
  55500. for (const inkList of this.data.inkLists) {
  55501. for (let i = 0, ii = inkList.length; i < ii; i += 2) {
  55502. buffer.push(`${inkList[i]} ${inkList[i + 1]} ${i === 0 ? "m" : "l"}`);
  55503. }
  55504. buffer.push("S");
  55505. }
  55506. return [points[0], points[2], points[7], points[3]];
  55507. }
  55508. });
  55509. }
  55510. }
  55511. static createNewDict(annotation, xref, {
  55512. apRef,
  55513. ap
  55514. }) {
  55515. const {
  55516. color,
  55517. opacity,
  55518. paths,
  55519. outlines,
  55520. rect,
  55521. rotation,
  55522. thickness
  55523. } = annotation;
  55524. const ink = new Dict(xref);
  55525. ink.set("Type", Name.get("Annot"));
  55526. ink.set("Subtype", Name.get("Ink"));
  55527. ink.set("CreationDate", `D:${getModificationDate()}`);
  55528. ink.set("Rect", rect);
  55529. ink.set("InkList", outlines?.points || paths.map(p => p.points));
  55530. ink.set("F", 4);
  55531. ink.set("Rotate", rotation);
  55532. if (outlines) {
  55533. ink.set("IT", Name.get("InkHighlight"));
  55534. }
  55535. const bs = new Dict(xref);
  55536. ink.set("BS", bs);
  55537. bs.set("W", thickness);
  55538. ink.set("C", Array.from(color, c => c / 255));
  55539. ink.set("CA", opacity);
  55540. const n = new Dict(xref);
  55541. ink.set("AP", n);
  55542. if (apRef) {
  55543. n.set("N", apRef);
  55544. } else {
  55545. n.set("N", ap);
  55546. }
  55547. return ink;
  55548. }
  55549. static async createNewAppearanceStream(annotation, xref, params) {
  55550. if (annotation.outlines) {
  55551. return this.createNewAppearanceStreamForHighlight(annotation, xref, params);
  55552. }
  55553. const {
  55554. color,
  55555. rect,
  55556. paths,
  55557. thickness,
  55558. opacity
  55559. } = annotation;
  55560. const appearanceBuffer = [`${thickness} w 1 J 1 j`, `${getPdfColor(color, false)}`];
  55561. if (opacity !== 1) {
  55562. appearanceBuffer.push("/R0 gs");
  55563. }
  55564. const buffer = [];
  55565. for (const {
  55566. bezier
  55567. } of paths) {
  55568. buffer.length = 0;
  55569. buffer.push(`${numberToString(bezier[0])} ${numberToString(bezier[1])} m`);
  55570. if (bezier.length === 2) {
  55571. buffer.push(`${numberToString(bezier[0])} ${numberToString(bezier[1])} l S`);
  55572. } else {
  55573. for (let i = 2, ii = bezier.length; i < ii; i += 6) {
  55574. const curve = bezier.slice(i, i + 6).map(numberToString).join(" ");
  55575. buffer.push(`${curve} c`);
  55576. }
  55577. buffer.push("S");
  55578. }
  55579. appearanceBuffer.push(buffer.join("\n"));
  55580. }
  55581. const appearance = appearanceBuffer.join("\n");
  55582. const appearanceStreamDict = new Dict(xref);
  55583. appearanceStreamDict.set("FormType", 1);
  55584. appearanceStreamDict.set("Subtype", Name.get("Form"));
  55585. appearanceStreamDict.set("Type", Name.get("XObject"));
  55586. appearanceStreamDict.set("BBox", rect);
  55587. appearanceStreamDict.set("Length", appearance.length);
  55588. if (opacity !== 1) {
  55589. const resources = new Dict(xref);
  55590. const extGState = new Dict(xref);
  55591. const r0 = new Dict(xref);
  55592. r0.set("CA", opacity);
  55593. r0.set("Type", Name.get("ExtGState"));
  55594. extGState.set("R0", r0);
  55595. resources.set("ExtGState", extGState);
  55596. appearanceStreamDict.set("Resources", resources);
  55597. }
  55598. const ap = new StringStream(appearance);
  55599. ap.dict = appearanceStreamDict;
  55600. return ap;
  55601. }
  55602. static async createNewAppearanceStreamForHighlight(annotation, xref, params) {
  55603. const {
  55604. color,
  55605. rect,
  55606. outlines: {
  55607. outline
  55608. },
  55609. opacity
  55610. } = annotation;
  55611. const appearanceBuffer = [`${getPdfColor(color, true)}`, "/R0 gs"];
  55612. appearanceBuffer.push(`${numberToString(outline[4])} ${numberToString(outline[5])} m`);
  55613. for (let i = 6, ii = outline.length; i < ii; i += 6) {
  55614. if (isNaN(outline[i]) || outline[i] === null) {
  55615. appearanceBuffer.push(`${numberToString(outline[i + 4])} ${numberToString(outline[i + 5])} l`);
  55616. } else {
  55617. const curve = outline.slice(i, i + 6).map(numberToString).join(" ");
  55618. appearanceBuffer.push(`${curve} c`);
  55619. }
  55620. }
  55621. appearanceBuffer.push("h f");
  55622. const appearance = appearanceBuffer.join("\n");
  55623. const appearanceStreamDict = new Dict(xref);
  55624. appearanceStreamDict.set("FormType", 1);
  55625. appearanceStreamDict.set("Subtype", Name.get("Form"));
  55626. appearanceStreamDict.set("Type", Name.get("XObject"));
  55627. appearanceStreamDict.set("BBox", rect);
  55628. appearanceStreamDict.set("Length", appearance.length);
  55629. const resources = new Dict(xref);
  55630. const extGState = new Dict(xref);
  55631. resources.set("ExtGState", extGState);
  55632. appearanceStreamDict.set("Resources", resources);
  55633. const r0 = new Dict(xref);
  55634. extGState.set("R0", r0);
  55635. r0.set("BM", Name.get("Multiply"));
  55636. if (opacity !== 1) {
  55637. r0.set("ca", opacity);
  55638. r0.set("Type", Name.get("ExtGState"));
  55639. }
  55640. const ap = new StringStream(appearance);
  55641. ap.dict = appearanceStreamDict;
  55642. return ap;
  55643. }
  55644. }
  55645. class HighlightAnnotation extends MarkupAnnotation {
  55646. constructor(params) {
  55647. super(params);
  55648. const {
  55649. dict,
  55650. xref
  55651. } = params;
  55652. this.data.annotationType = AnnotationType.HIGHLIGHT;
  55653. this.data.isEditable = !this.data.noHTML;
  55654. this.data.noHTML = false;
  55655. this.data.opacity = dict.get("CA") || 1;
  55656. const quadPoints = this.data.quadPoints = getQuadPoints(dict, null);
  55657. if (quadPoints) {
  55658. const resources = this.appearance?.dict.get("Resources");
  55659. if (!this.appearance || !resources?.has("ExtGState")) {
  55660. if (this.appearance) {
  55661. warn("HighlightAnnotation - ignoring built-in appearance stream.");
  55662. }
  55663. const fillColor = this.color ? getPdfColorArray(this.color) : [1, 1, 0];
  55664. const fillAlpha = dict.get("CA");
  55665. this._setDefaultAppearance({
  55666. xref,
  55667. fillColor,
  55668. blendMode: "Multiply",
  55669. fillAlpha,
  55670. pointsCallback: (buffer, points) => {
  55671. buffer.push(`${points[0]} ${points[1]} m`, `${points[2]} ${points[3]} l`, `${points[6]} ${points[7]} l`, `${points[4]} ${points[5]} l`, "f");
  55672. return [points[0], points[2], points[7], points[3]];
  55673. }
  55674. });
  55675. }
  55676. } else {
  55677. this.data.popupRef = null;
  55678. }
  55679. }
  55680. static createNewDict(annotation, xref, {
  55681. apRef,
  55682. ap
  55683. }) {
  55684. const {
  55685. color,
  55686. oldAnnotation,
  55687. opacity,
  55688. rect,
  55689. rotation,
  55690. user,
  55691. quadPoints
  55692. } = annotation;
  55693. const highlight = oldAnnotation || new Dict(xref);
  55694. highlight.set("Type", Name.get("Annot"));
  55695. highlight.set("Subtype", Name.get("Highlight"));
  55696. highlight.set(oldAnnotation ? "M" : "CreationDate", `D:${getModificationDate()}`);
  55697. highlight.set("CreationDate", `D:${getModificationDate()}`);
  55698. highlight.set("Rect", rect);
  55699. highlight.set("F", 4);
  55700. highlight.set("Border", [0, 0, 0]);
  55701. highlight.set("Rotate", rotation);
  55702. highlight.set("QuadPoints", quadPoints);
  55703. highlight.set("C", Array.from(color, c => c / 255));
  55704. highlight.set("CA", opacity);
  55705. if (user) {
  55706. highlight.set("T", stringToAsciiOrUTF16BE(user));
  55707. }
  55708. if (apRef || ap) {
  55709. const n = new Dict(xref);
  55710. highlight.set("AP", n);
  55711. n.set("N", apRef || ap);
  55712. }
  55713. return highlight;
  55714. }
  55715. static async createNewAppearanceStream(annotation, xref, params) {
  55716. const {
  55717. color,
  55718. rect,
  55719. outlines,
  55720. opacity
  55721. } = annotation;
  55722. const appearanceBuffer = [`${getPdfColor(color, true)}`, "/R0 gs"];
  55723. const buffer = [];
  55724. for (const outline of outlines) {
  55725. buffer.length = 0;
  55726. buffer.push(`${numberToString(outline[0])} ${numberToString(outline[1])} m`);
  55727. for (let i = 2, ii = outline.length; i < ii; i += 2) {
  55728. buffer.push(`${numberToString(outline[i])} ${numberToString(outline[i + 1])} l`);
  55729. }
  55730. buffer.push("h");
  55731. appearanceBuffer.push(buffer.join("\n"));
  55732. }
  55733. appearanceBuffer.push("f*");
  55734. const appearance = appearanceBuffer.join("\n");
  55735. const appearanceStreamDict = new Dict(xref);
  55736. appearanceStreamDict.set("FormType", 1);
  55737. appearanceStreamDict.set("Subtype", Name.get("Form"));
  55738. appearanceStreamDict.set("Type", Name.get("XObject"));
  55739. appearanceStreamDict.set("BBox", rect);
  55740. appearanceStreamDict.set("Length", appearance.length);
  55741. const resources = new Dict(xref);
  55742. const extGState = new Dict(xref);
  55743. resources.set("ExtGState", extGState);
  55744. appearanceStreamDict.set("Resources", resources);
  55745. const r0 = new Dict(xref);
  55746. extGState.set("R0", r0);
  55747. r0.set("BM", Name.get("Multiply"));
  55748. if (opacity !== 1) {
  55749. r0.set("ca", opacity);
  55750. r0.set("Type", Name.get("ExtGState"));
  55751. }
  55752. const ap = new StringStream(appearance);
  55753. ap.dict = appearanceStreamDict;
  55754. return ap;
  55755. }
  55756. }
  55757. class UnderlineAnnotation extends MarkupAnnotation {
  55758. constructor(params) {
  55759. super(params);
  55760. const {
  55761. dict,
  55762. xref
  55763. } = params;
  55764. this.data.annotationType = AnnotationType.UNDERLINE;
  55765. const quadPoints = this.data.quadPoints = getQuadPoints(dict, null);
  55766. if (quadPoints) {
  55767. if (!this.appearance) {
  55768. const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0];
  55769. const strokeAlpha = dict.get("CA");
  55770. this._setDefaultAppearance({
  55771. xref,
  55772. extra: "[] 0 d 0.571 w",
  55773. strokeColor,
  55774. strokeAlpha,
  55775. pointsCallback: (buffer, points) => {
  55776. buffer.push(`${points[4]} ${points[5] + 1.3} m`, `${points[6]} ${points[7] + 1.3} l`, "S");
  55777. return [points[0], points[2], points[7], points[3]];
  55778. }
  55779. });
  55780. }
  55781. } else {
  55782. this.data.popupRef = null;
  55783. }
  55784. }
  55785. }
  55786. class SquigglyAnnotation extends MarkupAnnotation {
  55787. constructor(params) {
  55788. super(params);
  55789. const {
  55790. dict,
  55791. xref
  55792. } = params;
  55793. this.data.annotationType = AnnotationType.SQUIGGLY;
  55794. const quadPoints = this.data.quadPoints = getQuadPoints(dict, null);
  55795. if (quadPoints) {
  55796. if (!this.appearance) {
  55797. const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0];
  55798. const strokeAlpha = dict.get("CA");
  55799. this._setDefaultAppearance({
  55800. xref,
  55801. extra: "[] 0 d 1 w",
  55802. strokeColor,
  55803. strokeAlpha,
  55804. pointsCallback: (buffer, points) => {
  55805. const dy = (points[1] - points[5]) / 6;
  55806. let shift = dy;
  55807. let x = points[4];
  55808. const y = points[5];
  55809. const xEnd = points[6];
  55810. buffer.push(`${x} ${y + shift} m`);
  55811. do {
  55812. x += 2;
  55813. shift = shift === 0 ? dy : 0;
  55814. buffer.push(`${x} ${y + shift} l`);
  55815. } while (x < xEnd);
  55816. buffer.push("S");
  55817. return [points[4], xEnd, y - 2 * dy, y + 2 * dy];
  55818. }
  55819. });
  55820. }
  55821. } else {
  55822. this.data.popupRef = null;
  55823. }
  55824. }
  55825. }
  55826. class StrikeOutAnnotation extends MarkupAnnotation {
  55827. constructor(params) {
  55828. super(params);
  55829. const {
  55830. dict,
  55831. xref
  55832. } = params;
  55833. this.data.annotationType = AnnotationType.STRIKEOUT;
  55834. const quadPoints = this.data.quadPoints = getQuadPoints(dict, null);
  55835. if (quadPoints) {
  55836. if (!this.appearance) {
  55837. const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0];
  55838. const strokeAlpha = dict.get("CA");
  55839. this._setDefaultAppearance({
  55840. xref,
  55841. extra: "[] 0 d 1 w",
  55842. strokeColor,
  55843. strokeAlpha,
  55844. pointsCallback: (buffer, points) => {
  55845. buffer.push(`${(points[0] + points[4]) / 2} ` + `${(points[1] + points[5]) / 2} m`, `${(points[2] + points[6]) / 2} ` + `${(points[3] + points[7]) / 2} l`, "S");
  55846. return [points[0], points[2], points[7], points[3]];
  55847. }
  55848. });
  55849. }
  55850. } else {
  55851. this.data.popupRef = null;
  55852. }
  55853. }
  55854. }
  55855. class StampAnnotation extends MarkupAnnotation {
  55856. #savedHasOwnCanvas;
  55857. constructor(params) {
  55858. super(params);
  55859. this.data.annotationType = AnnotationType.STAMP;
  55860. this.#savedHasOwnCanvas = this.data.hasOwnCanvas = this.data.noRotate;
  55861. this.data.isEditable = !this.data.noHTML;
  55862. this.data.noHTML = false;
  55863. }
  55864. mustBeViewedWhenEditing(isEditing, modifiedIds = null) {
  55865. if (isEditing) {
  55866. if (!this.data.isEditable) {
  55867. return false;
  55868. }
  55869. this.#savedHasOwnCanvas = this.data.hasOwnCanvas;
  55870. this.data.hasOwnCanvas = true;
  55871. return true;
  55872. }
  55873. this.data.hasOwnCanvas = this.#savedHasOwnCanvas;
  55874. return !modifiedIds?.has(this.data.id);
  55875. }
  55876. static async createImage(bitmap, xref) {
  55877. const {
  55878. width,
  55879. height
  55880. } = bitmap;
  55881. const canvas = new OffscreenCanvas(width, height);
  55882. const ctx = canvas.getContext("2d", {
  55883. alpha: true
  55884. });
  55885. ctx.drawImage(bitmap, 0, 0);
  55886. const data = ctx.getImageData(0, 0, width, height).data;
  55887. const buf32 = new Uint32Array(data.buffer);
  55888. const hasAlpha = buf32.some(FeatureTest.isLittleEndian ? x => x >>> 24 !== 0xff : x => (x & 0xff) !== 0xff);
  55889. if (hasAlpha) {
  55890. ctx.fillStyle = "white";
  55891. ctx.fillRect(0, 0, width, height);
  55892. ctx.drawImage(bitmap, 0, 0);
  55893. }
  55894. const jpegBufferPromise = canvas.convertToBlob({
  55895. type: "image/jpeg",
  55896. quality: 1
  55897. }).then(blob => blob.arrayBuffer());
  55898. const xobjectName = Name.get("XObject");
  55899. const imageName = Name.get("Image");
  55900. const image = new Dict(xref);
  55901. image.set("Type", xobjectName);
  55902. image.set("Subtype", imageName);
  55903. image.set("BitsPerComponent", 8);
  55904. image.set("ColorSpace", Name.get("DeviceRGB"));
  55905. image.set("Filter", Name.get("DCTDecode"));
  55906. image.set("BBox", [0, 0, width, height]);
  55907. image.set("Width", width);
  55908. image.set("Height", height);
  55909. let smaskStream = null;
  55910. if (hasAlpha) {
  55911. const alphaBuffer = new Uint8Array(buf32.length);
  55912. if (FeatureTest.isLittleEndian) {
  55913. for (let i = 0, ii = buf32.length; i < ii; i++) {
  55914. alphaBuffer[i] = buf32[i] >>> 24;
  55915. }
  55916. } else {
  55917. for (let i = 0, ii = buf32.length; i < ii; i++) {
  55918. alphaBuffer[i] = buf32[i] & 0xff;
  55919. }
  55920. }
  55921. const smask = new Dict(xref);
  55922. smask.set("Type", xobjectName);
  55923. smask.set("Subtype", imageName);
  55924. smask.set("BitsPerComponent", 8);
  55925. smask.set("ColorSpace", Name.get("DeviceGray"));
  55926. smask.set("Width", width);
  55927. smask.set("Height", height);
  55928. smaskStream = new Stream(alphaBuffer, 0, 0, smask);
  55929. }
  55930. const imageStream = new Stream(await jpegBufferPromise, 0, 0, image);
  55931. return {
  55932. imageStream,
  55933. smaskStream,
  55934. width,
  55935. height
  55936. };
  55937. }
  55938. static createNewDict(annotation, xref, {
  55939. apRef,
  55940. ap
  55941. }) {
  55942. const {
  55943. oldAnnotation,
  55944. rect,
  55945. rotation,
  55946. user
  55947. } = annotation;
  55948. const stamp = oldAnnotation || new Dict(xref);
  55949. stamp.set("Type", Name.get("Annot"));
  55950. stamp.set("Subtype", Name.get("Stamp"));
  55951. stamp.set(oldAnnotation ? "M" : "CreationDate", `D:${getModificationDate()}`);
  55952. stamp.set("CreationDate", `D:${getModificationDate()}`);
  55953. stamp.set("Rect", rect);
  55954. stamp.set("F", 4);
  55955. stamp.set("Border", [0, 0, 0]);
  55956. stamp.set("Rotate", rotation);
  55957. if (user) {
  55958. stamp.set("T", stringToAsciiOrUTF16BE(user));
  55959. }
  55960. if (apRef || ap) {
  55961. const n = new Dict(xref);
  55962. stamp.set("AP", n);
  55963. if (apRef) {
  55964. n.set("N", apRef);
  55965. } else {
  55966. n.set("N", ap);
  55967. }
  55968. }
  55969. return stamp;
  55970. }
  55971. static async createNewAppearanceStream(annotation, xref, params) {
  55972. if (annotation.oldAnnotation) {
  55973. return null;
  55974. }
  55975. const {
  55976. rotation
  55977. } = annotation;
  55978. const {
  55979. imageRef,
  55980. width,
  55981. height
  55982. } = params.image;
  55983. const resources = new Dict(xref);
  55984. const xobject = new Dict(xref);
  55985. resources.set("XObject", xobject);
  55986. xobject.set("Im0", imageRef);
  55987. const appearance = `q ${width} 0 0 ${height} 0 0 cm /Im0 Do Q`;
  55988. const appearanceStreamDict = new Dict(xref);
  55989. appearanceStreamDict.set("FormType", 1);
  55990. appearanceStreamDict.set("Subtype", Name.get("Form"));
  55991. appearanceStreamDict.set("Type", Name.get("XObject"));
  55992. appearanceStreamDict.set("BBox", [0, 0, width, height]);
  55993. appearanceStreamDict.set("Resources", resources);
  55994. if (rotation) {
  55995. const matrix = getRotationMatrix(rotation, width, height);
  55996. appearanceStreamDict.set("Matrix", matrix);
  55997. }
  55998. const ap = new StringStream(appearance);
  55999. ap.dict = appearanceStreamDict;
  56000. return ap;
  56001. }
  56002. }
  56003. class FileAttachmentAnnotation extends MarkupAnnotation {
  56004. constructor(params) {
  56005. super(params);
  56006. const {
  56007. dict,
  56008. xref
  56009. } = params;
  56010. const file = new FileSpec(dict.get("FS"), xref);
  56011. this.data.annotationType = AnnotationType.FILEATTACHMENT;
  56012. this.data.hasOwnCanvas = this.data.noRotate;
  56013. this.data.noHTML = false;
  56014. this.data.file = file.serializable;
  56015. const name = dict.get("Name");
  56016. this.data.name = name instanceof Name ? stringToPDFString(name.name) : "PushPin";
  56017. const fillAlpha = dict.get("ca");
  56018. this.data.fillAlpha = typeof fillAlpha === "number" && fillAlpha >= 0 && fillAlpha <= 1 ? fillAlpha : null;
  56019. }
  56020. }
  56021. ;// ./src/core/dataset_reader.js
  56022. function decodeString(str) {
  56023. try {
  56024. return stringToUTF8String(str);
  56025. } catch (ex) {
  56026. warn(`UTF-8 decoding failed: "${ex}".`);
  56027. return str;
  56028. }
  56029. }
  56030. class DatasetXMLParser extends SimpleXMLParser {
  56031. constructor(options) {
  56032. super(options);
  56033. this.node = null;
  56034. }
  56035. onEndElement(name) {
  56036. const node = super.onEndElement(name);
  56037. if (node && name === "xfa:datasets") {
  56038. this.node = node;
  56039. throw new Error("Aborting DatasetXMLParser.");
  56040. }
  56041. }
  56042. }
  56043. class DatasetReader {
  56044. constructor(data) {
  56045. if (data.datasets) {
  56046. this.node = new SimpleXMLParser({
  56047. hasAttributes: true
  56048. }).parseFromString(data.datasets).documentElement;
  56049. } else {
  56050. const parser = new DatasetXMLParser({
  56051. hasAttributes: true
  56052. });
  56053. try {
  56054. parser.parseFromString(data["xdp:xdp"]);
  56055. } catch {}
  56056. this.node = parser.node;
  56057. }
  56058. }
  56059. getValue(path) {
  56060. if (!this.node || !path) {
  56061. return "";
  56062. }
  56063. const node = this.node.searchNode(parseXFAPath(path), 0);
  56064. if (!node) {
  56065. return "";
  56066. }
  56067. const first = node.firstChild;
  56068. if (first?.nodeName === "value") {
  56069. return node.children.map(child => decodeString(child.textContent));
  56070. }
  56071. return decodeString(node.textContent);
  56072. }
  56073. }
  56074. ;// ./src/core/xref.js
  56075. class XRef {
  56076. #firstXRefStmPos = null;
  56077. constructor(stream, pdfManager) {
  56078. this.stream = stream;
  56079. this.pdfManager = pdfManager;
  56080. this.entries = [];
  56081. this._xrefStms = new Set();
  56082. this._cacheMap = new Map();
  56083. this._pendingRefs = new RefSet();
  56084. this._newPersistentRefNum = null;
  56085. this._newTemporaryRefNum = null;
  56086. this._persistentRefsCache = null;
  56087. }
  56088. getNewPersistentRef(obj) {
  56089. if (this._newPersistentRefNum === null) {
  56090. this._newPersistentRefNum = this.entries.length || 1;
  56091. }
  56092. const num = this._newPersistentRefNum++;
  56093. this._cacheMap.set(num, obj);
  56094. return Ref.get(num, 0);
  56095. }
  56096. getNewTemporaryRef() {
  56097. if (this._newTemporaryRefNum === null) {
  56098. this._newTemporaryRefNum = this.entries.length || 1;
  56099. if (this._newPersistentRefNum) {
  56100. this._persistentRefsCache = new Map();
  56101. for (let i = this._newTemporaryRefNum; i < this._newPersistentRefNum; i++) {
  56102. this._persistentRefsCache.set(i, this._cacheMap.get(i));
  56103. this._cacheMap.delete(i);
  56104. }
  56105. }
  56106. }
  56107. return Ref.get(this._newTemporaryRefNum++, 0);
  56108. }
  56109. resetNewTemporaryRef() {
  56110. this._newTemporaryRefNum = null;
  56111. if (this._persistentRefsCache) {
  56112. for (const [num, obj] of this._persistentRefsCache) {
  56113. this._cacheMap.set(num, obj);
  56114. }
  56115. }
  56116. this._persistentRefsCache = null;
  56117. }
  56118. setStartXRef(startXRef) {
  56119. this.startXRefQueue = [startXRef];
  56120. }
  56121. parse(recoveryMode = false) {
  56122. let trailerDict;
  56123. if (!recoveryMode) {
  56124. trailerDict = this.readXRef();
  56125. } else {
  56126. warn("Indexing all PDF objects");
  56127. trailerDict = this.indexObjects();
  56128. }
  56129. trailerDict.assignXref(this);
  56130. this.trailer = trailerDict;
  56131. let encrypt;
  56132. try {
  56133. encrypt = trailerDict.get("Encrypt");
  56134. } catch (ex) {
  56135. if (ex instanceof MissingDataException) {
  56136. throw ex;
  56137. }
  56138. warn(`XRef.parse - Invalid "Encrypt" reference: "${ex}".`);
  56139. }
  56140. if (encrypt instanceof Dict) {
  56141. const ids = trailerDict.get("ID");
  56142. const fileId = ids?.length ? ids[0] : "";
  56143. encrypt.suppressEncryption = true;
  56144. this.encrypt = new CipherTransformFactory(encrypt, fileId, this.pdfManager.password);
  56145. }
  56146. let root;
  56147. try {
  56148. root = trailerDict.get("Root");
  56149. } catch (ex) {
  56150. if (ex instanceof MissingDataException) {
  56151. throw ex;
  56152. }
  56153. warn(`XRef.parse - Invalid "Root" reference: "${ex}".`);
  56154. }
  56155. if (root instanceof Dict) {
  56156. try {
  56157. const pages = root.get("Pages");
  56158. if (pages instanceof Dict) {
  56159. this.root = root;
  56160. return;
  56161. }
  56162. } catch (ex) {
  56163. if (ex instanceof MissingDataException) {
  56164. throw ex;
  56165. }
  56166. warn(`XRef.parse - Invalid "Pages" reference: "${ex}".`);
  56167. }
  56168. }
  56169. if (!recoveryMode) {
  56170. throw new XRefParseException();
  56171. }
  56172. throw new InvalidPDFException("Invalid Root reference.");
  56173. }
  56174. processXRefTable(parser) {
  56175. if (!("tableState" in this)) {
  56176. this.tableState = {
  56177. entryNum: 0,
  56178. streamPos: parser.lexer.stream.pos,
  56179. parserBuf1: parser.buf1,
  56180. parserBuf2: parser.buf2
  56181. };
  56182. }
  56183. const obj = this.readXRefTable(parser);
  56184. if (!isCmd(obj, "trailer")) {
  56185. throw new FormatError("Invalid XRef table: could not find trailer dictionary");
  56186. }
  56187. let dict = parser.getObj();
  56188. if (!(dict instanceof Dict) && dict.dict) {
  56189. dict = dict.dict;
  56190. }
  56191. if (!(dict instanceof Dict)) {
  56192. throw new FormatError("Invalid XRef table: could not parse trailer dictionary");
  56193. }
  56194. delete this.tableState;
  56195. return dict;
  56196. }
  56197. readXRefTable(parser) {
  56198. const stream = parser.lexer.stream;
  56199. const tableState = this.tableState;
  56200. stream.pos = tableState.streamPos;
  56201. parser.buf1 = tableState.parserBuf1;
  56202. parser.buf2 = tableState.parserBuf2;
  56203. let obj;
  56204. while (true) {
  56205. if (!("firstEntryNum" in tableState) || !("entryCount" in tableState)) {
  56206. if (isCmd(obj = parser.getObj(), "trailer")) {
  56207. break;
  56208. }
  56209. tableState.firstEntryNum = obj;
  56210. tableState.entryCount = parser.getObj();
  56211. }
  56212. let first = tableState.firstEntryNum;
  56213. const count = tableState.entryCount;
  56214. if (!Number.isInteger(first) || !Number.isInteger(count)) {
  56215. throw new FormatError("Invalid XRef table: wrong types in subsection header");
  56216. }
  56217. for (let i = tableState.entryNum; i < count; i++) {
  56218. tableState.streamPos = stream.pos;
  56219. tableState.entryNum = i;
  56220. tableState.parserBuf1 = parser.buf1;
  56221. tableState.parserBuf2 = parser.buf2;
  56222. const entry = {};
  56223. entry.offset = parser.getObj();
  56224. entry.gen = parser.getObj();
  56225. const type = parser.getObj();
  56226. if (type instanceof Cmd) {
  56227. switch (type.cmd) {
  56228. case "f":
  56229. entry.free = true;
  56230. break;
  56231. case "n":
  56232. entry.uncompressed = true;
  56233. break;
  56234. }
  56235. }
  56236. if (!Number.isInteger(entry.offset) || !Number.isInteger(entry.gen) || !(entry.free || entry.uncompressed)) {
  56237. throw new FormatError(`Invalid entry in XRef subsection: ${first}, ${count}`);
  56238. }
  56239. if (i === 0 && entry.free && first === 1) {
  56240. first = 0;
  56241. }
  56242. if (!this.entries[i + first]) {
  56243. this.entries[i + first] = entry;
  56244. }
  56245. }
  56246. tableState.entryNum = 0;
  56247. tableState.streamPos = stream.pos;
  56248. tableState.parserBuf1 = parser.buf1;
  56249. tableState.parserBuf2 = parser.buf2;
  56250. delete tableState.firstEntryNum;
  56251. delete tableState.entryCount;
  56252. }
  56253. if (this.entries[0] && !this.entries[0].free) {
  56254. throw new FormatError("Invalid XRef table: unexpected first object");
  56255. }
  56256. return obj;
  56257. }
  56258. processXRefStream(stream) {
  56259. if (!("streamState" in this)) {
  56260. const streamParameters = stream.dict;
  56261. const byteWidths = streamParameters.get("W");
  56262. let range = streamParameters.get("Index");
  56263. if (!range) {
  56264. range = [0, streamParameters.get("Size")];
  56265. }
  56266. this.streamState = {
  56267. entryRanges: range,
  56268. byteWidths,
  56269. entryNum: 0,
  56270. streamPos: stream.pos
  56271. };
  56272. }
  56273. this.readXRefStream(stream);
  56274. delete this.streamState;
  56275. return stream.dict;
  56276. }
  56277. readXRefStream(stream) {
  56278. const streamState = this.streamState;
  56279. stream.pos = streamState.streamPos;
  56280. const [typeFieldWidth, offsetFieldWidth, generationFieldWidth] = streamState.byteWidths;
  56281. const entryRanges = streamState.entryRanges;
  56282. while (entryRanges.length > 0) {
  56283. const [first, n] = entryRanges;
  56284. if (!Number.isInteger(first) || !Number.isInteger(n)) {
  56285. throw new FormatError(`Invalid XRef range fields: ${first}, ${n}`);
  56286. }
  56287. if (!Number.isInteger(typeFieldWidth) || !Number.isInteger(offsetFieldWidth) || !Number.isInteger(generationFieldWidth)) {
  56288. throw new FormatError(`Invalid XRef entry fields length: ${first}, ${n}`);
  56289. }
  56290. for (let i = streamState.entryNum; i < n; ++i) {
  56291. streamState.entryNum = i;
  56292. streamState.streamPos = stream.pos;
  56293. let type = 0,
  56294. offset = 0,
  56295. generation = 0;
  56296. for (let j = 0; j < typeFieldWidth; ++j) {
  56297. const typeByte = stream.getByte();
  56298. if (typeByte === -1) {
  56299. throw new FormatError("Invalid XRef byteWidths 'type'.");
  56300. }
  56301. type = type << 8 | typeByte;
  56302. }
  56303. if (typeFieldWidth === 0) {
  56304. type = 1;
  56305. }
  56306. for (let j = 0; j < offsetFieldWidth; ++j) {
  56307. const offsetByte = stream.getByte();
  56308. if (offsetByte === -1) {
  56309. throw new FormatError("Invalid XRef byteWidths 'offset'.");
  56310. }
  56311. offset = offset << 8 | offsetByte;
  56312. }
  56313. for (let j = 0; j < generationFieldWidth; ++j) {
  56314. const generationByte = stream.getByte();
  56315. if (generationByte === -1) {
  56316. throw new FormatError("Invalid XRef byteWidths 'generation'.");
  56317. }
  56318. generation = generation << 8 | generationByte;
  56319. }
  56320. const entry = {};
  56321. entry.offset = offset;
  56322. entry.gen = generation;
  56323. switch (type) {
  56324. case 0:
  56325. entry.free = true;
  56326. break;
  56327. case 1:
  56328. entry.uncompressed = true;
  56329. break;
  56330. case 2:
  56331. break;
  56332. default:
  56333. throw new FormatError(`Invalid XRef entry type: ${type}`);
  56334. }
  56335. if (!this.entries[first + i]) {
  56336. this.entries[first + i] = entry;
  56337. }
  56338. }
  56339. streamState.entryNum = 0;
  56340. streamState.streamPos = stream.pos;
  56341. entryRanges.splice(0, 2);
  56342. }
  56343. }
  56344. indexObjects() {
  56345. const TAB = 0x9,
  56346. LF = 0xa,
  56347. CR = 0xd,
  56348. SPACE = 0x20;
  56349. const PERCENT = 0x25,
  56350. LT = 0x3c;
  56351. function readToken(data, offset) {
  56352. let token = "",
  56353. ch = data[offset];
  56354. while (ch !== LF && ch !== CR && ch !== LT) {
  56355. if (++offset >= data.length) {
  56356. break;
  56357. }
  56358. token += String.fromCharCode(ch);
  56359. ch = data[offset];
  56360. }
  56361. return token;
  56362. }
  56363. function skipUntil(data, offset, what) {
  56364. const length = what.length,
  56365. dataLength = data.length;
  56366. let skipped = 0;
  56367. while (offset < dataLength) {
  56368. let i = 0;
  56369. while (i < length && data[offset + i] === what[i]) {
  56370. ++i;
  56371. }
  56372. if (i >= length) {
  56373. break;
  56374. }
  56375. offset++;
  56376. skipped++;
  56377. }
  56378. return skipped;
  56379. }
  56380. const gEndobjRegExp = /\b(endobj|\d+\s+\d+\s+obj|xref|trailer\s*<<)\b/g;
  56381. const gStartxrefRegExp = /\b(startxref|\d+\s+\d+\s+obj)\b/g;
  56382. const objRegExp = /^(\d+)\s+(\d+)\s+obj\b/;
  56383. const trailerBytes = new Uint8Array([116, 114, 97, 105, 108, 101, 114]);
  56384. const startxrefBytes = new Uint8Array([115, 116, 97, 114, 116, 120, 114, 101, 102]);
  56385. const xrefBytes = new Uint8Array([47, 88, 82, 101, 102]);
  56386. this.entries.length = 0;
  56387. this._cacheMap.clear();
  56388. const stream = this.stream;
  56389. stream.pos = 0;
  56390. const buffer = stream.getBytes(),
  56391. bufferStr = bytesToString(buffer),
  56392. length = buffer.length;
  56393. let position = stream.start;
  56394. const trailers = [],
  56395. xrefStms = [];
  56396. while (position < length) {
  56397. let ch = buffer[position];
  56398. if (ch === TAB || ch === LF || ch === CR || ch === SPACE) {
  56399. ++position;
  56400. continue;
  56401. }
  56402. if (ch === PERCENT) {
  56403. do {
  56404. ++position;
  56405. if (position >= length) {
  56406. break;
  56407. }
  56408. ch = buffer[position];
  56409. } while (ch !== LF && ch !== CR);
  56410. continue;
  56411. }
  56412. const token = readToken(buffer, position);
  56413. let m;
  56414. if (token.startsWith("xref") && (token.length === 4 || /\s/.test(token[4]))) {
  56415. position += skipUntil(buffer, position, trailerBytes);
  56416. trailers.push(position);
  56417. position += skipUntil(buffer, position, startxrefBytes);
  56418. } else if (m = objRegExp.exec(token)) {
  56419. const num = m[1] | 0,
  56420. gen = m[2] | 0;
  56421. const startPos = position + token.length;
  56422. let contentLength,
  56423. updateEntries = false;
  56424. if (!this.entries[num]) {
  56425. updateEntries = true;
  56426. } else if (this.entries[num].gen === gen) {
  56427. try {
  56428. const parser = new Parser({
  56429. lexer: new Lexer(stream.makeSubStream(startPos))
  56430. });
  56431. parser.getObj();
  56432. updateEntries = true;
  56433. } catch (ex) {
  56434. if (ex instanceof ParserEOFException) {
  56435. warn(`indexObjects -- checking object (${token}): "${ex}".`);
  56436. } else {
  56437. updateEntries = true;
  56438. }
  56439. }
  56440. }
  56441. if (updateEntries) {
  56442. this.entries[num] = {
  56443. offset: position - stream.start,
  56444. gen,
  56445. uncompressed: true
  56446. };
  56447. }
  56448. gEndobjRegExp.lastIndex = startPos;
  56449. const match = gEndobjRegExp.exec(bufferStr);
  56450. if (match) {
  56451. const endPos = gEndobjRegExp.lastIndex + 1;
  56452. contentLength = endPos - position;
  56453. if (match[1] !== "endobj") {
  56454. warn(`indexObjects: Found "${match[1]}" inside of another "obj", ` + 'caused by missing "endobj" -- trying to recover.');
  56455. contentLength -= match[1].length + 1;
  56456. }
  56457. } else {
  56458. contentLength = length - position;
  56459. }
  56460. const content = buffer.subarray(position, position + contentLength);
  56461. const xrefTagOffset = skipUntil(content, 0, xrefBytes);
  56462. if (xrefTagOffset < contentLength && content[xrefTagOffset + 5] < 64) {
  56463. xrefStms.push(position - stream.start);
  56464. this._xrefStms.add(position - stream.start);
  56465. }
  56466. position += contentLength;
  56467. } else if (token.startsWith("trailer") && (token.length === 7 || /\s/.test(token[7]))) {
  56468. trailers.push(position);
  56469. const startPos = position + token.length;
  56470. let contentLength;
  56471. gStartxrefRegExp.lastIndex = startPos;
  56472. const match = gStartxrefRegExp.exec(bufferStr);
  56473. if (match) {
  56474. const endPos = gStartxrefRegExp.lastIndex + 1;
  56475. contentLength = endPos - position;
  56476. if (match[1] !== "startxref") {
  56477. warn(`indexObjects: Found "${match[1]}" after "trailer", ` + 'caused by missing "startxref" -- trying to recover.');
  56478. contentLength -= match[1].length + 1;
  56479. }
  56480. } else {
  56481. contentLength = length - position;
  56482. }
  56483. position += contentLength;
  56484. } else {
  56485. position += token.length + 1;
  56486. }
  56487. }
  56488. for (const xrefStm of xrefStms) {
  56489. this.startXRefQueue.push(xrefStm);
  56490. this.readXRef(true);
  56491. }
  56492. const trailerDicts = [];
  56493. let isEncrypted = false;
  56494. for (const trailer of trailers) {
  56495. stream.pos = trailer;
  56496. const parser = new Parser({
  56497. lexer: new Lexer(stream),
  56498. xref: this,
  56499. allowStreams: true,
  56500. recoveryMode: true
  56501. });
  56502. const obj = parser.getObj();
  56503. if (!isCmd(obj, "trailer")) {
  56504. continue;
  56505. }
  56506. const dict = parser.getObj();
  56507. if (!(dict instanceof Dict)) {
  56508. continue;
  56509. }
  56510. trailerDicts.push(dict);
  56511. if (dict.has("Encrypt")) {
  56512. isEncrypted = true;
  56513. }
  56514. }
  56515. let trailerDict, trailerError;
  56516. for (const dict of [...trailerDicts, "genFallback", ...trailerDicts]) {
  56517. if (dict === "genFallback") {
  56518. if (!trailerError) {
  56519. break;
  56520. }
  56521. this._generationFallback = true;
  56522. continue;
  56523. }
  56524. let validPagesDict = false;
  56525. try {
  56526. const rootDict = dict.get("Root");
  56527. if (!(rootDict instanceof Dict)) {
  56528. continue;
  56529. }
  56530. const pagesDict = rootDict.get("Pages");
  56531. if (!(pagesDict instanceof Dict)) {
  56532. continue;
  56533. }
  56534. const pagesCount = pagesDict.get("Count");
  56535. if (Number.isInteger(pagesCount)) {
  56536. validPagesDict = true;
  56537. }
  56538. } catch (ex) {
  56539. trailerError = ex;
  56540. continue;
  56541. }
  56542. if (validPagesDict && (!isEncrypted || dict.has("Encrypt")) && dict.has("ID")) {
  56543. return dict;
  56544. }
  56545. trailerDict = dict;
  56546. }
  56547. if (trailerDict) {
  56548. return trailerDict;
  56549. }
  56550. if (this.topDict) {
  56551. return this.topDict;
  56552. }
  56553. throw new InvalidPDFException("Invalid PDF structure.");
  56554. }
  56555. readXRef(recoveryMode = false) {
  56556. const stream = this.stream;
  56557. const startXRefParsedCache = new Set();
  56558. while (this.startXRefQueue.length) {
  56559. try {
  56560. const startXRef = this.startXRefQueue[0];
  56561. if (startXRefParsedCache.has(startXRef)) {
  56562. warn("readXRef - skipping XRef table since it was already parsed.");
  56563. this.startXRefQueue.shift();
  56564. continue;
  56565. }
  56566. startXRefParsedCache.add(startXRef);
  56567. stream.pos = startXRef + stream.start;
  56568. const parser = new Parser({
  56569. lexer: new Lexer(stream),
  56570. xref: this,
  56571. allowStreams: true
  56572. });
  56573. let obj = parser.getObj();
  56574. let dict;
  56575. if (isCmd(obj, "xref")) {
  56576. dict = this.processXRefTable(parser);
  56577. if (!this.topDict) {
  56578. this.topDict = dict;
  56579. }
  56580. obj = dict.get("XRefStm");
  56581. if (Number.isInteger(obj) && !this._xrefStms.has(obj)) {
  56582. this._xrefStms.add(obj);
  56583. this.startXRefQueue.push(obj);
  56584. this.#firstXRefStmPos ??= obj;
  56585. }
  56586. } else if (Number.isInteger(obj)) {
  56587. if (!Number.isInteger(parser.getObj()) || !isCmd(parser.getObj(), "obj") || !((obj = parser.getObj()) instanceof BaseStream)) {
  56588. throw new FormatError("Invalid XRef stream");
  56589. }
  56590. dict = this.processXRefStream(obj);
  56591. if (!this.topDict) {
  56592. this.topDict = dict;
  56593. }
  56594. if (!dict) {
  56595. throw new FormatError("Failed to read XRef stream");
  56596. }
  56597. } else {
  56598. throw new FormatError("Invalid XRef stream header");
  56599. }
  56600. obj = dict.get("Prev");
  56601. if (Number.isInteger(obj)) {
  56602. this.startXRefQueue.push(obj);
  56603. } else if (obj instanceof Ref) {
  56604. this.startXRefQueue.push(obj.num);
  56605. }
  56606. } catch (e) {
  56607. if (e instanceof MissingDataException) {
  56608. throw e;
  56609. }
  56610. info("(while reading XRef): " + e);
  56611. }
  56612. this.startXRefQueue.shift();
  56613. }
  56614. if (this.topDict) {
  56615. return this.topDict;
  56616. }
  56617. if (recoveryMode) {
  56618. return undefined;
  56619. }
  56620. throw new XRefParseException();
  56621. }
  56622. get lastXRefStreamPos() {
  56623. return this.#firstXRefStmPos ?? (this._xrefStms.size > 0 ? Math.max(...this._xrefStms) : null);
  56624. }
  56625. getEntry(i) {
  56626. const xrefEntry = this.entries[i];
  56627. if (xrefEntry && !xrefEntry.free && xrefEntry.offset) {
  56628. return xrefEntry;
  56629. }
  56630. return null;
  56631. }
  56632. fetchIfRef(obj, suppressEncryption = false) {
  56633. if (obj instanceof Ref) {
  56634. return this.fetch(obj, suppressEncryption);
  56635. }
  56636. return obj;
  56637. }
  56638. fetch(ref, suppressEncryption = false) {
  56639. if (!(ref instanceof Ref)) {
  56640. throw new Error("ref object is not a reference");
  56641. }
  56642. const num = ref.num;
  56643. const cacheEntry = this._cacheMap.get(num);
  56644. if (cacheEntry !== undefined) {
  56645. if (cacheEntry instanceof Dict && !cacheEntry.objId) {
  56646. cacheEntry.objId = ref.toString();
  56647. }
  56648. return cacheEntry;
  56649. }
  56650. let xrefEntry = this.getEntry(num);
  56651. if (xrefEntry === null) {
  56652. this._cacheMap.set(num, xrefEntry);
  56653. return xrefEntry;
  56654. }
  56655. if (this._pendingRefs.has(ref)) {
  56656. this._pendingRefs.remove(ref);
  56657. warn(`Ignoring circular reference: ${ref}.`);
  56658. return CIRCULAR_REF;
  56659. }
  56660. this._pendingRefs.put(ref);
  56661. try {
  56662. xrefEntry = xrefEntry.uncompressed ? this.fetchUncompressed(ref, xrefEntry, suppressEncryption) : this.fetchCompressed(ref, xrefEntry, suppressEncryption);
  56663. this._pendingRefs.remove(ref);
  56664. } catch (ex) {
  56665. this._pendingRefs.remove(ref);
  56666. throw ex;
  56667. }
  56668. if (xrefEntry instanceof Dict) {
  56669. xrefEntry.objId = ref.toString();
  56670. } else if (xrefEntry instanceof BaseStream) {
  56671. xrefEntry.dict.objId = ref.toString();
  56672. }
  56673. return xrefEntry;
  56674. }
  56675. fetchUncompressed(ref, xrefEntry, suppressEncryption = false) {
  56676. const gen = ref.gen;
  56677. let num = ref.num;
  56678. if (xrefEntry.gen !== gen) {
  56679. const msg = `Inconsistent generation in XRef: ${ref}`;
  56680. if (this._generationFallback && xrefEntry.gen < gen) {
  56681. warn(msg);
  56682. return this.fetchUncompressed(Ref.get(num, xrefEntry.gen), xrefEntry, suppressEncryption);
  56683. }
  56684. throw new XRefEntryException(msg);
  56685. }
  56686. const stream = this.stream.makeSubStream(xrefEntry.offset + this.stream.start);
  56687. const parser = new Parser({
  56688. lexer: new Lexer(stream),
  56689. xref: this,
  56690. allowStreams: true
  56691. });
  56692. const obj1 = parser.getObj();
  56693. const obj2 = parser.getObj();
  56694. const obj3 = parser.getObj();
  56695. if (obj1 !== num || obj2 !== gen || !(obj3 instanceof Cmd)) {
  56696. throw new XRefEntryException(`Bad (uncompressed) XRef entry: ${ref}`);
  56697. }
  56698. if (obj3.cmd !== "obj") {
  56699. if (obj3.cmd.startsWith("obj")) {
  56700. num = parseInt(obj3.cmd.substring(3), 10);
  56701. if (!Number.isNaN(num)) {
  56702. return num;
  56703. }
  56704. }
  56705. throw new XRefEntryException(`Bad (uncompressed) XRef entry: ${ref}`);
  56706. }
  56707. xrefEntry = this.encrypt && !suppressEncryption ? parser.getObj(this.encrypt.createCipherTransform(num, gen)) : parser.getObj();
  56708. if (!(xrefEntry instanceof BaseStream)) {
  56709. this._cacheMap.set(num, xrefEntry);
  56710. }
  56711. return xrefEntry;
  56712. }
  56713. fetchCompressed(ref, xrefEntry, suppressEncryption = false) {
  56714. const tableOffset = xrefEntry.offset;
  56715. const stream = this.fetch(Ref.get(tableOffset, 0));
  56716. if (!(stream instanceof BaseStream)) {
  56717. throw new FormatError("bad ObjStm stream");
  56718. }
  56719. const first = stream.dict.get("First");
  56720. const n = stream.dict.get("N");
  56721. if (!Number.isInteger(first) || !Number.isInteger(n)) {
  56722. throw new FormatError("invalid first and n parameters for ObjStm stream");
  56723. }
  56724. let parser = new Parser({
  56725. lexer: new Lexer(stream),
  56726. xref: this,
  56727. allowStreams: true
  56728. });
  56729. const nums = new Array(n);
  56730. const offsets = new Array(n);
  56731. for (let i = 0; i < n; ++i) {
  56732. const num = parser.getObj();
  56733. if (!Number.isInteger(num)) {
  56734. throw new FormatError(`invalid object number in the ObjStm stream: ${num}`);
  56735. }
  56736. const offset = parser.getObj();
  56737. if (!Number.isInteger(offset)) {
  56738. throw new FormatError(`invalid object offset in the ObjStm stream: ${offset}`);
  56739. }
  56740. nums[i] = num;
  56741. offsets[i] = offset;
  56742. }
  56743. const start = (stream.start || 0) + first;
  56744. const entries = new Array(n);
  56745. for (let i = 0; i < n; ++i) {
  56746. const length = i < n - 1 ? offsets[i + 1] - offsets[i] : undefined;
  56747. if (length < 0) {
  56748. throw new FormatError("Invalid offset in the ObjStm stream.");
  56749. }
  56750. parser = new Parser({
  56751. lexer: new Lexer(stream.makeSubStream(start + offsets[i], length, stream.dict)),
  56752. xref: this,
  56753. allowStreams: true
  56754. });
  56755. const obj = parser.getObj();
  56756. entries[i] = obj;
  56757. if (obj instanceof BaseStream) {
  56758. continue;
  56759. }
  56760. const num = nums[i],
  56761. entry = this.entries[num];
  56762. if (entry && entry.offset === tableOffset && entry.gen === i) {
  56763. this._cacheMap.set(num, obj);
  56764. }
  56765. }
  56766. xrefEntry = entries[xrefEntry.gen];
  56767. if (xrefEntry === undefined) {
  56768. throw new XRefEntryException(`Bad (compressed) XRef entry: ${ref}`);
  56769. }
  56770. return xrefEntry;
  56771. }
  56772. async fetchIfRefAsync(obj, suppressEncryption) {
  56773. if (obj instanceof Ref) {
  56774. return this.fetchAsync(obj, suppressEncryption);
  56775. }
  56776. return obj;
  56777. }
  56778. async fetchAsync(ref, suppressEncryption) {
  56779. try {
  56780. return this.fetch(ref, suppressEncryption);
  56781. } catch (ex) {
  56782. if (!(ex instanceof MissingDataException)) {
  56783. throw ex;
  56784. }
  56785. await this.pdfManager.requestRange(ex.begin, ex.end);
  56786. return this.fetchAsync(ref, suppressEncryption);
  56787. }
  56788. }
  56789. getCatalogObj() {
  56790. return this.root;
  56791. }
  56792. }
  56793. ;// ./src/core/document.js
  56794. const DEFAULT_USER_UNIT = 1.0;
  56795. const LETTER_SIZE_MEDIABOX = [0, 0, 612, 792];
  56796. class Page {
  56797. constructor({
  56798. pdfManager,
  56799. xref,
  56800. pageIndex,
  56801. pageDict,
  56802. ref,
  56803. globalIdFactory,
  56804. fontCache,
  56805. builtInCMapCache,
  56806. standardFontDataCache,
  56807. globalImageCache,
  56808. systemFontCache,
  56809. nonBlendModesSet,
  56810. xfaFactory
  56811. }) {
  56812. this.pdfManager = pdfManager;
  56813. this.pageIndex = pageIndex;
  56814. this.pageDict = pageDict;
  56815. this.xref = xref;
  56816. this.ref = ref;
  56817. this.fontCache = fontCache;
  56818. this.builtInCMapCache = builtInCMapCache;
  56819. this.standardFontDataCache = standardFontDataCache;
  56820. this.globalImageCache = globalImageCache;
  56821. this.systemFontCache = systemFontCache;
  56822. this.nonBlendModesSet = nonBlendModesSet;
  56823. this.evaluatorOptions = pdfManager.evaluatorOptions;
  56824. this.resourcesPromise = null;
  56825. this.xfaFactory = xfaFactory;
  56826. const idCounters = {
  56827. obj: 0
  56828. };
  56829. this._localIdFactory = class extends globalIdFactory {
  56830. static createObjId() {
  56831. return `p${pageIndex}_${++idCounters.obj}`;
  56832. }
  56833. static getPageObjId() {
  56834. return `p${ref.toString()}`;
  56835. }
  56836. };
  56837. }
  56838. _getInheritableProperty(key, getArray = false) {
  56839. const value = getInheritableProperty({
  56840. dict: this.pageDict,
  56841. key,
  56842. getArray,
  56843. stopWhenFound: false
  56844. });
  56845. if (!Array.isArray(value)) {
  56846. return value;
  56847. }
  56848. if (value.length === 1 || !(value[0] instanceof Dict)) {
  56849. return value[0];
  56850. }
  56851. return Dict.merge({
  56852. xref: this.xref,
  56853. dictArray: value
  56854. });
  56855. }
  56856. get content() {
  56857. return this.pageDict.getArray("Contents");
  56858. }
  56859. get resources() {
  56860. const resources = this._getInheritableProperty("Resources");
  56861. return shadow(this, "resources", resources instanceof Dict ? resources : Dict.empty);
  56862. }
  56863. _getBoundingBox(name) {
  56864. if (this.xfaData) {
  56865. return this.xfaData.bbox;
  56866. }
  56867. const box = lookupNormalRect(this._getInheritableProperty(name, true), null);
  56868. if (box) {
  56869. if (box[2] - box[0] > 0 && box[3] - box[1] > 0) {
  56870. return box;
  56871. }
  56872. warn(`Empty, or invalid, /${name} entry.`);
  56873. }
  56874. return null;
  56875. }
  56876. get mediaBox() {
  56877. return shadow(this, "mediaBox", this._getBoundingBox("MediaBox") || LETTER_SIZE_MEDIABOX);
  56878. }
  56879. get cropBox() {
  56880. return shadow(this, "cropBox", this._getBoundingBox("CropBox") || this.mediaBox);
  56881. }
  56882. get userUnit() {
  56883. let obj = this.pageDict.get("UserUnit");
  56884. if (typeof obj !== "number" || obj <= 0) {
  56885. obj = DEFAULT_USER_UNIT;
  56886. }
  56887. return shadow(this, "userUnit", obj);
  56888. }
  56889. get view() {
  56890. const {
  56891. cropBox,
  56892. mediaBox
  56893. } = this;
  56894. if (cropBox !== mediaBox && !isArrayEqual(cropBox, mediaBox)) {
  56895. const box = Util.intersect(cropBox, mediaBox);
  56896. if (box && box[2] - box[0] > 0 && box[3] - box[1] > 0) {
  56897. return shadow(this, "view", box);
  56898. }
  56899. warn("Empty /CropBox and /MediaBox intersection.");
  56900. }
  56901. return shadow(this, "view", mediaBox);
  56902. }
  56903. get rotate() {
  56904. let rotate = this._getInheritableProperty("Rotate") || 0;
  56905. if (rotate % 90 !== 0) {
  56906. rotate = 0;
  56907. } else if (rotate >= 360) {
  56908. rotate %= 360;
  56909. } else if (rotate < 0) {
  56910. rotate = (rotate % 360 + 360) % 360;
  56911. }
  56912. return shadow(this, "rotate", rotate);
  56913. }
  56914. _onSubStreamError(reason, objId) {
  56915. if (this.evaluatorOptions.ignoreErrors) {
  56916. warn(`getContentStream - ignoring sub-stream (${objId}): "${reason}".`);
  56917. return;
  56918. }
  56919. throw reason;
  56920. }
  56921. getContentStream() {
  56922. return this.pdfManager.ensure(this, "content").then(content => {
  56923. if (content instanceof BaseStream) {
  56924. return content;
  56925. }
  56926. if (Array.isArray(content)) {
  56927. return new StreamsSequenceStream(content, this._onSubStreamError.bind(this));
  56928. }
  56929. return new NullStream();
  56930. });
  56931. }
  56932. get xfaData() {
  56933. return shadow(this, "xfaData", this.xfaFactory ? {
  56934. bbox: this.xfaFactory.getBoundingBox(this.pageIndex)
  56935. } : null);
  56936. }
  56937. async #replaceIdByRef(annotations, deletedAnnotations, existingAnnotations) {
  56938. const promises = [];
  56939. for (const annotation of annotations) {
  56940. if (annotation.id) {
  56941. const ref = Ref.fromString(annotation.id);
  56942. if (!ref) {
  56943. warn(`A non-linked annotation cannot be modified: ${annotation.id}`);
  56944. continue;
  56945. }
  56946. if (annotation.deleted) {
  56947. deletedAnnotations.put(ref, ref);
  56948. if (annotation.popupRef) {
  56949. const popupRef = Ref.fromString(annotation.popupRef);
  56950. if (popupRef) {
  56951. deletedAnnotations.put(popupRef, popupRef);
  56952. }
  56953. }
  56954. continue;
  56955. }
  56956. existingAnnotations?.put(ref);
  56957. annotation.ref = ref;
  56958. promises.push(this.xref.fetchAsync(ref).then(obj => {
  56959. if (obj instanceof Dict) {
  56960. annotation.oldAnnotation = obj.clone();
  56961. }
  56962. }, () => {
  56963. warn(`Cannot fetch \`oldAnnotation\` for: ${ref}.`);
  56964. }));
  56965. delete annotation.id;
  56966. }
  56967. }
  56968. await Promise.all(promises);
  56969. }
  56970. async saveNewAnnotations(handler, task, annotations, imagePromises) {
  56971. if (this.xfaFactory) {
  56972. throw new Error("XFA: Cannot save new annotations.");
  56973. }
  56974. const partialEvaluator = new PartialEvaluator({
  56975. xref: this.xref,
  56976. handler,
  56977. pageIndex: this.pageIndex,
  56978. idFactory: this._localIdFactory,
  56979. fontCache: this.fontCache,
  56980. builtInCMapCache: this.builtInCMapCache,
  56981. standardFontDataCache: this.standardFontDataCache,
  56982. globalImageCache: this.globalImageCache,
  56983. systemFontCache: this.systemFontCache,
  56984. options: this.evaluatorOptions
  56985. });
  56986. const deletedAnnotations = new RefSetCache();
  56987. const existingAnnotations = new RefSet();
  56988. await this.#replaceIdByRef(annotations, deletedAnnotations, existingAnnotations);
  56989. const pageDict = this.pageDict;
  56990. const annotationsArray = this.annotations.filter(a => !(a instanceof Ref && deletedAnnotations.has(a)));
  56991. const newData = await AnnotationFactory.saveNewAnnotations(partialEvaluator, task, annotations, imagePromises);
  56992. for (const {
  56993. ref
  56994. } of newData.annotations) {
  56995. if (ref instanceof Ref && !existingAnnotations.has(ref)) {
  56996. annotationsArray.push(ref);
  56997. }
  56998. }
  56999. const savedDict = pageDict.get("Annots");
  57000. pageDict.set("Annots", annotationsArray);
  57001. const buffer = [];
  57002. await writeObject(this.ref, pageDict, buffer, this.xref);
  57003. if (savedDict) {
  57004. pageDict.set("Annots", savedDict);
  57005. }
  57006. const objects = newData.dependencies;
  57007. objects.push({
  57008. ref: this.ref,
  57009. data: buffer.join("")
  57010. }, ...newData.annotations);
  57011. for (const deletedRef of deletedAnnotations) {
  57012. objects.push({
  57013. ref: deletedRef,
  57014. data: null
  57015. });
  57016. }
  57017. return objects;
  57018. }
  57019. save(handler, task, annotationStorage) {
  57020. const partialEvaluator = new PartialEvaluator({
  57021. xref: this.xref,
  57022. handler,
  57023. pageIndex: this.pageIndex,
  57024. idFactory: this._localIdFactory,
  57025. fontCache: this.fontCache,
  57026. builtInCMapCache: this.builtInCMapCache,
  57027. standardFontDataCache: this.standardFontDataCache,
  57028. globalImageCache: this.globalImageCache,
  57029. systemFontCache: this.systemFontCache,
  57030. options: this.evaluatorOptions
  57031. });
  57032. return this._parsedAnnotations.then(function (annotations) {
  57033. const newRefsPromises = [];
  57034. for (const annotation of annotations) {
  57035. newRefsPromises.push(annotation.save(partialEvaluator, task, annotationStorage).catch(function (reason) {
  57036. warn("save - ignoring annotation data during " + `"${task.name}" task: "${reason}".`);
  57037. return null;
  57038. }));
  57039. }
  57040. return Promise.all(newRefsPromises).then(function (newRefs) {
  57041. return newRefs.filter(newRef => !!newRef);
  57042. });
  57043. });
  57044. }
  57045. loadResources(keys) {
  57046. this.resourcesPromise ||= this.pdfManager.ensure(this, "resources");
  57047. return this.resourcesPromise.then(() => {
  57048. const objectLoader = new ObjectLoader(this.resources, keys, this.xref);
  57049. return objectLoader.load();
  57050. });
  57051. }
  57052. getOperatorList({
  57053. handler,
  57054. sink,
  57055. task,
  57056. intent,
  57057. cacheKey,
  57058. annotationStorage = null,
  57059. modifiedIds = null
  57060. }) {
  57061. const contentStreamPromise = this.getContentStream();
  57062. const resourcesPromise = this.loadResources(["ColorSpace", "ExtGState", "Font", "Pattern", "Properties", "Shading", "XObject"]);
  57063. const partialEvaluator = new PartialEvaluator({
  57064. xref: this.xref,
  57065. handler,
  57066. pageIndex: this.pageIndex,
  57067. idFactory: this._localIdFactory,
  57068. fontCache: this.fontCache,
  57069. builtInCMapCache: this.builtInCMapCache,
  57070. standardFontDataCache: this.standardFontDataCache,
  57071. globalImageCache: this.globalImageCache,
  57072. systemFontCache: this.systemFontCache,
  57073. options: this.evaluatorOptions
  57074. });
  57075. const newAnnotsByPage = !this.xfaFactory ? getNewAnnotationsMap(annotationStorage) : null;
  57076. const newAnnots = newAnnotsByPage?.get(this.pageIndex);
  57077. let newAnnotationsPromise = Promise.resolve(null);
  57078. let deletedAnnotations = null;
  57079. if (newAnnots) {
  57080. const annotationGlobalsPromise = this.pdfManager.ensureDoc("annotationGlobals");
  57081. let imagePromises;
  57082. const missingBitmaps = new Set();
  57083. for (const {
  57084. bitmapId,
  57085. bitmap
  57086. } of newAnnots) {
  57087. if (bitmapId && !bitmap && !missingBitmaps.has(bitmapId)) {
  57088. missingBitmaps.add(bitmapId);
  57089. }
  57090. }
  57091. const {
  57092. isOffscreenCanvasSupported
  57093. } = this.evaluatorOptions;
  57094. if (missingBitmaps.size > 0) {
  57095. const annotationWithBitmaps = newAnnots.slice();
  57096. for (const [key, annotation] of annotationStorage) {
  57097. if (!key.startsWith(AnnotationEditorPrefix)) {
  57098. continue;
  57099. }
  57100. if (annotation.bitmap && missingBitmaps.has(annotation.bitmapId)) {
  57101. annotationWithBitmaps.push(annotation);
  57102. }
  57103. }
  57104. imagePromises = AnnotationFactory.generateImages(annotationWithBitmaps, this.xref, isOffscreenCanvasSupported);
  57105. } else {
  57106. imagePromises = AnnotationFactory.generateImages(newAnnots, this.xref, isOffscreenCanvasSupported);
  57107. }
  57108. deletedAnnotations = new RefSet();
  57109. newAnnotationsPromise = Promise.all([annotationGlobalsPromise, this.#replaceIdByRef(newAnnots, deletedAnnotations, null)]).then(([annotationGlobals]) => {
  57110. if (!annotationGlobals) {
  57111. return null;
  57112. }
  57113. return AnnotationFactory.printNewAnnotations(annotationGlobals, partialEvaluator, task, newAnnots, imagePromises);
  57114. });
  57115. }
  57116. const pageListPromise = Promise.all([contentStreamPromise, resourcesPromise]).then(([contentStream]) => {
  57117. const opList = new OperatorList(intent, sink);
  57118. handler.send("StartRenderPage", {
  57119. transparency: partialEvaluator.hasBlendModes(this.resources, this.nonBlendModesSet),
  57120. pageIndex: this.pageIndex,
  57121. cacheKey
  57122. });
  57123. return partialEvaluator.getOperatorList({
  57124. stream: contentStream,
  57125. task,
  57126. resources: this.resources,
  57127. operatorList: opList
  57128. }).then(function () {
  57129. return opList;
  57130. });
  57131. });
  57132. return Promise.all([pageListPromise, this._parsedAnnotations, newAnnotationsPromise]).then(function ([pageOpList, annotations, newAnnotations]) {
  57133. if (newAnnotations) {
  57134. annotations = annotations.filter(a => !(a.ref && deletedAnnotations.has(a.ref)));
  57135. for (let i = 0, ii = newAnnotations.length; i < ii; i++) {
  57136. const newAnnotation = newAnnotations[i];
  57137. if (newAnnotation.refToReplace) {
  57138. const j = annotations.findIndex(a => a.ref && isRefsEqual(a.ref, newAnnotation.refToReplace));
  57139. if (j >= 0) {
  57140. annotations.splice(j, 1, newAnnotation);
  57141. newAnnotations.splice(i--, 1);
  57142. ii--;
  57143. }
  57144. }
  57145. }
  57146. annotations = annotations.concat(newAnnotations);
  57147. }
  57148. if (annotations.length === 0 || intent & RenderingIntentFlag.ANNOTATIONS_DISABLE) {
  57149. pageOpList.flush(true);
  57150. return {
  57151. length: pageOpList.totalLength
  57152. };
  57153. }
  57154. const renderForms = !!(intent & RenderingIntentFlag.ANNOTATIONS_FORMS),
  57155. isEditing = !!(intent & RenderingIntentFlag.IS_EDITING),
  57156. intentAny = !!(intent & RenderingIntentFlag.ANY),
  57157. intentDisplay = !!(intent & RenderingIntentFlag.DISPLAY),
  57158. intentPrint = !!(intent & RenderingIntentFlag.PRINT);
  57159. const opListPromises = [];
  57160. for (const annotation of annotations) {
  57161. if (intentAny || intentDisplay && annotation.mustBeViewed(annotationStorage, renderForms) && annotation.mustBeViewedWhenEditing(isEditing, modifiedIds) || intentPrint && annotation.mustBePrinted(annotationStorage)) {
  57162. opListPromises.push(annotation.getOperatorList(partialEvaluator, task, intent, annotationStorage).catch(function (reason) {
  57163. warn("getOperatorList - ignoring annotation data during " + `"${task.name}" task: "${reason}".`);
  57164. return {
  57165. opList: null,
  57166. separateForm: false,
  57167. separateCanvas: false
  57168. };
  57169. }));
  57170. }
  57171. }
  57172. return Promise.all(opListPromises).then(function (opLists) {
  57173. let form = false,
  57174. canvas = false;
  57175. for (const {
  57176. opList,
  57177. separateForm,
  57178. separateCanvas
  57179. } of opLists) {
  57180. pageOpList.addOpList(opList);
  57181. form ||= separateForm;
  57182. canvas ||= separateCanvas;
  57183. }
  57184. pageOpList.flush(true, {
  57185. form,
  57186. canvas
  57187. });
  57188. return {
  57189. length: pageOpList.totalLength
  57190. };
  57191. });
  57192. });
  57193. }
  57194. async extractTextContent({
  57195. handler,
  57196. task,
  57197. includeMarkedContent,
  57198. disableNormalization,
  57199. sink
  57200. }) {
  57201. const contentStreamPromise = this.getContentStream();
  57202. const resourcesPromise = this.loadResources(["ExtGState", "Font", "Properties", "XObject"]);
  57203. const langPromise = this.pdfManager.ensureCatalog("lang");
  57204. const [contentStream,, lang] = await Promise.all([contentStreamPromise, resourcesPromise, langPromise]);
  57205. const partialEvaluator = new PartialEvaluator({
  57206. xref: this.xref,
  57207. handler,
  57208. pageIndex: this.pageIndex,
  57209. idFactory: this._localIdFactory,
  57210. fontCache: this.fontCache,
  57211. builtInCMapCache: this.builtInCMapCache,
  57212. standardFontDataCache: this.standardFontDataCache,
  57213. globalImageCache: this.globalImageCache,
  57214. systemFontCache: this.systemFontCache,
  57215. options: this.evaluatorOptions
  57216. });
  57217. return partialEvaluator.getTextContent({
  57218. stream: contentStream,
  57219. task,
  57220. resources: this.resources,
  57221. includeMarkedContent,
  57222. disableNormalization,
  57223. sink,
  57224. viewBox: this.view,
  57225. lang
  57226. });
  57227. }
  57228. async getStructTree() {
  57229. const structTreeRoot = await this.pdfManager.ensureCatalog("structTreeRoot");
  57230. if (!structTreeRoot) {
  57231. return null;
  57232. }
  57233. await this._parsedAnnotations;
  57234. const structTree = await this.pdfManager.ensure(this, "_parseStructTree", [structTreeRoot]);
  57235. return structTree.serializable;
  57236. }
  57237. _parseStructTree(structTreeRoot) {
  57238. const tree = new StructTreePage(structTreeRoot, this.pageDict);
  57239. tree.parse(this.ref);
  57240. return tree;
  57241. }
  57242. async getAnnotationsData(handler, task, intent) {
  57243. const annotations = await this._parsedAnnotations;
  57244. if (annotations.length === 0) {
  57245. return annotations;
  57246. }
  57247. const annotationsData = [],
  57248. textContentPromises = [];
  57249. let partialEvaluator;
  57250. const intentAny = !!(intent & RenderingIntentFlag.ANY),
  57251. intentDisplay = !!(intent & RenderingIntentFlag.DISPLAY),
  57252. intentPrint = !!(intent & RenderingIntentFlag.PRINT);
  57253. for (const annotation of annotations) {
  57254. const isVisible = intentAny || intentDisplay && annotation.viewable;
  57255. if (isVisible || intentPrint && annotation.printable) {
  57256. annotationsData.push(annotation.data);
  57257. }
  57258. if (annotation.hasTextContent && isVisible) {
  57259. partialEvaluator ||= new PartialEvaluator({
  57260. xref: this.xref,
  57261. handler,
  57262. pageIndex: this.pageIndex,
  57263. idFactory: this._localIdFactory,
  57264. fontCache: this.fontCache,
  57265. builtInCMapCache: this.builtInCMapCache,
  57266. standardFontDataCache: this.standardFontDataCache,
  57267. globalImageCache: this.globalImageCache,
  57268. systemFontCache: this.systemFontCache,
  57269. options: this.evaluatorOptions
  57270. });
  57271. textContentPromises.push(annotation.extractTextContent(partialEvaluator, task, [-Infinity, -Infinity, Infinity, Infinity]).catch(function (reason) {
  57272. warn(`getAnnotationsData - ignoring textContent during "${task.name}" task: "${reason}".`);
  57273. }));
  57274. }
  57275. }
  57276. await Promise.all(textContentPromises);
  57277. return annotationsData;
  57278. }
  57279. get annotations() {
  57280. const annots = this._getInheritableProperty("Annots");
  57281. return shadow(this, "annotations", Array.isArray(annots) ? annots : []);
  57282. }
  57283. get _parsedAnnotations() {
  57284. const promise = this.pdfManager.ensure(this, "annotations").then(async annots => {
  57285. if (annots.length === 0) {
  57286. return annots;
  57287. }
  57288. const [annotationGlobals, fieldObjects] = await Promise.all([this.pdfManager.ensureDoc("annotationGlobals"), this.pdfManager.ensureDoc("fieldObjects")]);
  57289. if (!annotationGlobals) {
  57290. return [];
  57291. }
  57292. const orphanFields = fieldObjects?.orphanFields;
  57293. const annotationPromises = [];
  57294. for (const annotationRef of annots) {
  57295. annotationPromises.push(AnnotationFactory.create(this.xref, annotationRef, annotationGlobals, this._localIdFactory, false, orphanFields, this.ref).catch(function (reason) {
  57296. warn(`_parsedAnnotations: "${reason}".`);
  57297. return null;
  57298. }));
  57299. }
  57300. const sortedAnnotations = [];
  57301. let popupAnnotations, widgetAnnotations;
  57302. for (const annotation of await Promise.all(annotationPromises)) {
  57303. if (!annotation) {
  57304. continue;
  57305. }
  57306. if (annotation instanceof WidgetAnnotation) {
  57307. (widgetAnnotations ||= []).push(annotation);
  57308. continue;
  57309. }
  57310. if (annotation instanceof PopupAnnotation) {
  57311. (popupAnnotations ||= []).push(annotation);
  57312. continue;
  57313. }
  57314. sortedAnnotations.push(annotation);
  57315. }
  57316. if (widgetAnnotations) {
  57317. sortedAnnotations.push(...widgetAnnotations);
  57318. }
  57319. if (popupAnnotations) {
  57320. sortedAnnotations.push(...popupAnnotations);
  57321. }
  57322. return sortedAnnotations;
  57323. });
  57324. return shadow(this, "_parsedAnnotations", promise);
  57325. }
  57326. get jsActions() {
  57327. const actions = collectActions(this.xref, this.pageDict, PageActionEventType);
  57328. return shadow(this, "jsActions", actions);
  57329. }
  57330. }
  57331. const PDF_HEADER_SIGNATURE = new Uint8Array([0x25, 0x50, 0x44, 0x46, 0x2d]);
  57332. const STARTXREF_SIGNATURE = new Uint8Array([0x73, 0x74, 0x61, 0x72, 0x74, 0x78, 0x72, 0x65, 0x66]);
  57333. const ENDOBJ_SIGNATURE = new Uint8Array([0x65, 0x6e, 0x64, 0x6f, 0x62, 0x6a]);
  57334. const FINGERPRINT_FIRST_BYTES = 1024;
  57335. const EMPTY_FINGERPRINT = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
  57336. function find(stream, signature, limit = 1024, backwards = false) {
  57337. const signatureLength = signature.length;
  57338. const scanBytes = stream.peekBytes(limit);
  57339. const scanLength = scanBytes.length - signatureLength;
  57340. if (scanLength <= 0) {
  57341. return false;
  57342. }
  57343. if (backwards) {
  57344. const signatureEnd = signatureLength - 1;
  57345. let pos = scanBytes.length - 1;
  57346. while (pos >= signatureEnd) {
  57347. let j = 0;
  57348. while (j < signatureLength && scanBytes[pos - j] === signature[signatureEnd - j]) {
  57349. j++;
  57350. }
  57351. if (j >= signatureLength) {
  57352. stream.pos += pos - signatureEnd;
  57353. return true;
  57354. }
  57355. pos--;
  57356. }
  57357. } else {
  57358. let pos = 0;
  57359. while (pos <= scanLength) {
  57360. let j = 0;
  57361. while (j < signatureLength && scanBytes[pos + j] === signature[j]) {
  57362. j++;
  57363. }
  57364. if (j >= signatureLength) {
  57365. stream.pos += pos;
  57366. return true;
  57367. }
  57368. pos++;
  57369. }
  57370. }
  57371. return false;
  57372. }
  57373. class PDFDocument {
  57374. constructor(pdfManager, stream) {
  57375. if (stream.length <= 0) {
  57376. throw new InvalidPDFException("The PDF file is empty, i.e. its size is zero bytes.");
  57377. }
  57378. this.pdfManager = pdfManager;
  57379. this.stream = stream;
  57380. this.xref = new XRef(stream, pdfManager);
  57381. this._pagePromises = new Map();
  57382. this._version = null;
  57383. const idCounters = {
  57384. font: 0
  57385. };
  57386. this._globalIdFactory = class {
  57387. static getDocId() {
  57388. return `g_${pdfManager.docId}`;
  57389. }
  57390. static createFontId() {
  57391. return `f${++idCounters.font}`;
  57392. }
  57393. static createObjId() {
  57394. unreachable("Abstract method `createObjId` called.");
  57395. }
  57396. static getPageObjId() {
  57397. unreachable("Abstract method `getPageObjId` called.");
  57398. }
  57399. };
  57400. }
  57401. parse(recoveryMode) {
  57402. this.xref.parse(recoveryMode);
  57403. this.catalog = new Catalog(this.pdfManager, this.xref);
  57404. }
  57405. get linearization() {
  57406. let linearization = null;
  57407. try {
  57408. linearization = Linearization.create(this.stream);
  57409. } catch (err) {
  57410. if (err instanceof MissingDataException) {
  57411. throw err;
  57412. }
  57413. info(err);
  57414. }
  57415. return shadow(this, "linearization", linearization);
  57416. }
  57417. get startXRef() {
  57418. const stream = this.stream;
  57419. let startXRef = 0;
  57420. if (this.linearization) {
  57421. stream.reset();
  57422. if (find(stream, ENDOBJ_SIGNATURE)) {
  57423. stream.skip(6);
  57424. let ch = stream.peekByte();
  57425. while (isWhiteSpace(ch)) {
  57426. stream.pos++;
  57427. ch = stream.peekByte();
  57428. }
  57429. startXRef = stream.pos - stream.start;
  57430. }
  57431. } else {
  57432. const step = 1024;
  57433. const startXRefLength = STARTXREF_SIGNATURE.length;
  57434. let found = false,
  57435. pos = stream.end;
  57436. while (!found && pos > 0) {
  57437. pos -= step - startXRefLength;
  57438. if (pos < 0) {
  57439. pos = 0;
  57440. }
  57441. stream.pos = pos;
  57442. found = find(stream, STARTXREF_SIGNATURE, step, true);
  57443. }
  57444. if (found) {
  57445. stream.skip(9);
  57446. let ch;
  57447. do {
  57448. ch = stream.getByte();
  57449. } while (isWhiteSpace(ch));
  57450. let str = "";
  57451. while (ch >= 0x20 && ch <= 0x39) {
  57452. str += String.fromCharCode(ch);
  57453. ch = stream.getByte();
  57454. }
  57455. startXRef = parseInt(str, 10);
  57456. if (isNaN(startXRef)) {
  57457. startXRef = 0;
  57458. }
  57459. }
  57460. }
  57461. return shadow(this, "startXRef", startXRef);
  57462. }
  57463. checkHeader() {
  57464. const stream = this.stream;
  57465. stream.reset();
  57466. if (!find(stream, PDF_HEADER_SIGNATURE)) {
  57467. return;
  57468. }
  57469. stream.moveStart();
  57470. stream.skip(PDF_HEADER_SIGNATURE.length);
  57471. let version = "",
  57472. ch;
  57473. while ((ch = stream.getByte()) > 0x20 && version.length < 7) {
  57474. version += String.fromCharCode(ch);
  57475. }
  57476. if (PDF_VERSION_REGEXP.test(version)) {
  57477. this._version = version;
  57478. } else {
  57479. warn(`Invalid PDF header version: ${version}`);
  57480. }
  57481. }
  57482. parseStartXRef() {
  57483. this.xref.setStartXRef(this.startXRef);
  57484. }
  57485. get numPages() {
  57486. let num = 0;
  57487. if (this.catalog.hasActualNumPages) {
  57488. num = this.catalog.numPages;
  57489. } else if (this.xfaFactory) {
  57490. num = this.xfaFactory.getNumPages();
  57491. } else if (this.linearization) {
  57492. num = this.linearization.numPages;
  57493. } else {
  57494. num = this.catalog.numPages;
  57495. }
  57496. return shadow(this, "numPages", num);
  57497. }
  57498. _hasOnlyDocumentSignatures(fields, recursionDepth = 0) {
  57499. const RECURSION_LIMIT = 10;
  57500. if (!Array.isArray(fields)) {
  57501. return false;
  57502. }
  57503. return fields.every(field => {
  57504. field = this.xref.fetchIfRef(field);
  57505. if (!(field instanceof Dict)) {
  57506. return false;
  57507. }
  57508. if (field.has("Kids")) {
  57509. if (++recursionDepth > RECURSION_LIMIT) {
  57510. warn("_hasOnlyDocumentSignatures: maximum recursion depth reached");
  57511. return false;
  57512. }
  57513. return this._hasOnlyDocumentSignatures(field.get("Kids"), recursionDepth);
  57514. }
  57515. const isSignature = isName(field.get("FT"), "Sig");
  57516. const rectangle = field.get("Rect");
  57517. const isInvisible = Array.isArray(rectangle) && rectangle.every(value => value === 0);
  57518. return isSignature && isInvisible;
  57519. });
  57520. }
  57521. get _xfaStreams() {
  57522. const acroForm = this.catalog.acroForm;
  57523. if (!acroForm) {
  57524. return null;
  57525. }
  57526. const xfa = acroForm.get("XFA");
  57527. const entries = {
  57528. "xdp:xdp": "",
  57529. template: "",
  57530. datasets: "",
  57531. config: "",
  57532. connectionSet: "",
  57533. localeSet: "",
  57534. stylesheet: "",
  57535. "/xdp:xdp": ""
  57536. };
  57537. if (xfa instanceof BaseStream && !xfa.isEmpty) {
  57538. entries["xdp:xdp"] = xfa;
  57539. return entries;
  57540. }
  57541. if (!Array.isArray(xfa) || xfa.length === 0) {
  57542. return null;
  57543. }
  57544. for (let i = 0, ii = xfa.length; i < ii; i += 2) {
  57545. let name;
  57546. if (i === 0) {
  57547. name = "xdp:xdp";
  57548. } else if (i === ii - 2) {
  57549. name = "/xdp:xdp";
  57550. } else {
  57551. name = xfa[i];
  57552. }
  57553. if (!entries.hasOwnProperty(name)) {
  57554. continue;
  57555. }
  57556. const data = this.xref.fetchIfRef(xfa[i + 1]);
  57557. if (!(data instanceof BaseStream) || data.isEmpty) {
  57558. continue;
  57559. }
  57560. entries[name] = data;
  57561. }
  57562. return entries;
  57563. }
  57564. get xfaDatasets() {
  57565. const streams = this._xfaStreams;
  57566. if (!streams) {
  57567. return shadow(this, "xfaDatasets", null);
  57568. }
  57569. for (const key of ["datasets", "xdp:xdp"]) {
  57570. const stream = streams[key];
  57571. if (!stream) {
  57572. continue;
  57573. }
  57574. try {
  57575. const str = stringToUTF8String(stream.getString());
  57576. const data = {
  57577. [key]: str
  57578. };
  57579. return shadow(this, "xfaDatasets", new DatasetReader(data));
  57580. } catch {
  57581. warn("XFA - Invalid utf-8 string.");
  57582. break;
  57583. }
  57584. }
  57585. return shadow(this, "xfaDatasets", null);
  57586. }
  57587. get xfaData() {
  57588. const streams = this._xfaStreams;
  57589. if (!streams) {
  57590. return null;
  57591. }
  57592. const data = Object.create(null);
  57593. for (const [key, stream] of Object.entries(streams)) {
  57594. if (!stream) {
  57595. continue;
  57596. }
  57597. try {
  57598. data[key] = stringToUTF8String(stream.getString());
  57599. } catch {
  57600. warn("XFA - Invalid utf-8 string.");
  57601. return null;
  57602. }
  57603. }
  57604. return data;
  57605. }
  57606. get xfaFactory() {
  57607. let data;
  57608. if (this.pdfManager.enableXfa && this.catalog.needsRendering && this.formInfo.hasXfa && !this.formInfo.hasAcroForm) {
  57609. data = this.xfaData;
  57610. }
  57611. return shadow(this, "xfaFactory", data ? new XFAFactory(data) : null);
  57612. }
  57613. get isPureXfa() {
  57614. return this.xfaFactory ? this.xfaFactory.isValid() : false;
  57615. }
  57616. get htmlForXfa() {
  57617. return this.xfaFactory ? this.xfaFactory.getPages() : null;
  57618. }
  57619. async loadXfaImages() {
  57620. const xfaImagesDict = await this.pdfManager.ensureCatalog("xfaImages");
  57621. if (!xfaImagesDict) {
  57622. return;
  57623. }
  57624. const keys = xfaImagesDict.getKeys();
  57625. const objectLoader = new ObjectLoader(xfaImagesDict, keys, this.xref);
  57626. await objectLoader.load();
  57627. const xfaImages = new Map();
  57628. for (const key of keys) {
  57629. const stream = xfaImagesDict.get(key);
  57630. if (stream instanceof BaseStream) {
  57631. xfaImages.set(key, stream.getBytes());
  57632. }
  57633. }
  57634. this.xfaFactory.setImages(xfaImages);
  57635. }
  57636. async loadXfaFonts(handler, task) {
  57637. const acroForm = await this.pdfManager.ensureCatalog("acroForm");
  57638. if (!acroForm) {
  57639. return;
  57640. }
  57641. const resources = await acroForm.getAsync("DR");
  57642. if (!(resources instanceof Dict)) {
  57643. return;
  57644. }
  57645. const objectLoader = new ObjectLoader(resources, ["Font"], this.xref);
  57646. await objectLoader.load();
  57647. const fontRes = resources.get("Font");
  57648. if (!(fontRes instanceof Dict)) {
  57649. return;
  57650. }
  57651. const options = Object.assign(Object.create(null), this.pdfManager.evaluatorOptions);
  57652. options.useSystemFonts = false;
  57653. const partialEvaluator = new PartialEvaluator({
  57654. xref: this.xref,
  57655. handler,
  57656. pageIndex: -1,
  57657. idFactory: this._globalIdFactory,
  57658. fontCache: this.catalog.fontCache,
  57659. builtInCMapCache: this.catalog.builtInCMapCache,
  57660. standardFontDataCache: this.catalog.standardFontDataCache,
  57661. options
  57662. });
  57663. const operatorList = new OperatorList();
  57664. const pdfFonts = [];
  57665. const initialState = {
  57666. get font() {
  57667. return pdfFonts.at(-1);
  57668. },
  57669. set font(font) {
  57670. pdfFonts.push(font);
  57671. },
  57672. clone() {
  57673. return this;
  57674. }
  57675. };
  57676. const fonts = new Map();
  57677. fontRes.forEach((fontName, font) => {
  57678. fonts.set(fontName, font);
  57679. });
  57680. const promises = [];
  57681. for (const [fontName, font] of fonts) {
  57682. const descriptor = font.get("FontDescriptor");
  57683. if (!(descriptor instanceof Dict)) {
  57684. continue;
  57685. }
  57686. let fontFamily = descriptor.get("FontFamily");
  57687. fontFamily = fontFamily.replaceAll(/[ ]+(\d)/g, "$1");
  57688. const fontWeight = descriptor.get("FontWeight");
  57689. const italicAngle = -descriptor.get("ItalicAngle");
  57690. const cssFontInfo = {
  57691. fontFamily,
  57692. fontWeight,
  57693. italicAngle
  57694. };
  57695. if (!validateCSSFont(cssFontInfo)) {
  57696. continue;
  57697. }
  57698. promises.push(partialEvaluator.handleSetFont(resources, [Name.get(fontName), 1], null, operatorList, task, initialState, null, cssFontInfo).catch(function (reason) {
  57699. warn(`loadXfaFonts: "${reason}".`);
  57700. return null;
  57701. }));
  57702. }
  57703. await Promise.all(promises);
  57704. const missingFonts = this.xfaFactory.setFonts(pdfFonts);
  57705. if (!missingFonts) {
  57706. return;
  57707. }
  57708. options.ignoreErrors = true;
  57709. promises.length = 0;
  57710. pdfFonts.length = 0;
  57711. const reallyMissingFonts = new Set();
  57712. for (const missing of missingFonts) {
  57713. if (!getXfaFontName(`${missing}-Regular`)) {
  57714. reallyMissingFonts.add(missing);
  57715. }
  57716. }
  57717. if (reallyMissingFonts.size) {
  57718. missingFonts.push("PdfJS-Fallback");
  57719. }
  57720. for (const missing of missingFonts) {
  57721. if (reallyMissingFonts.has(missing)) {
  57722. continue;
  57723. }
  57724. for (const fontInfo of [{
  57725. name: "Regular",
  57726. fontWeight: 400,
  57727. italicAngle: 0
  57728. }, {
  57729. name: "Bold",
  57730. fontWeight: 700,
  57731. italicAngle: 0
  57732. }, {
  57733. name: "Italic",
  57734. fontWeight: 400,
  57735. italicAngle: 12
  57736. }, {
  57737. name: "BoldItalic",
  57738. fontWeight: 700,
  57739. italicAngle: 12
  57740. }]) {
  57741. const name = `${missing}-${fontInfo.name}`;
  57742. const dict = getXfaFontDict(name);
  57743. promises.push(partialEvaluator.handleSetFont(resources, [Name.get(name), 1], null, operatorList, task, initialState, dict, {
  57744. fontFamily: missing,
  57745. fontWeight: fontInfo.fontWeight,
  57746. italicAngle: fontInfo.italicAngle
  57747. }).catch(function (reason) {
  57748. warn(`loadXfaFonts: "${reason}".`);
  57749. return null;
  57750. }));
  57751. }
  57752. }
  57753. await Promise.all(promises);
  57754. this.xfaFactory.appendFonts(pdfFonts, reallyMissingFonts);
  57755. }
  57756. async serializeXfaData(annotationStorage) {
  57757. return this.xfaFactory ? this.xfaFactory.serializeData(annotationStorage) : null;
  57758. }
  57759. get version() {
  57760. return this.catalog.version || this._version;
  57761. }
  57762. get formInfo() {
  57763. const formInfo = {
  57764. hasFields: false,
  57765. hasAcroForm: false,
  57766. hasXfa: false,
  57767. hasSignatures: false
  57768. };
  57769. const acroForm = this.catalog.acroForm;
  57770. if (!acroForm) {
  57771. return shadow(this, "formInfo", formInfo);
  57772. }
  57773. try {
  57774. const fields = acroForm.get("Fields");
  57775. const hasFields = Array.isArray(fields) && fields.length > 0;
  57776. formInfo.hasFields = hasFields;
  57777. const xfa = acroForm.get("XFA");
  57778. formInfo.hasXfa = Array.isArray(xfa) && xfa.length > 0 || xfa instanceof BaseStream && !xfa.isEmpty;
  57779. const sigFlags = acroForm.get("SigFlags");
  57780. const hasSignatures = !!(sigFlags & 0x1);
  57781. const hasOnlyDocumentSignatures = hasSignatures && this._hasOnlyDocumentSignatures(fields);
  57782. formInfo.hasAcroForm = hasFields && !hasOnlyDocumentSignatures;
  57783. formInfo.hasSignatures = hasSignatures;
  57784. } catch (ex) {
  57785. if (ex instanceof MissingDataException) {
  57786. throw ex;
  57787. }
  57788. warn(`Cannot fetch form information: "${ex}".`);
  57789. }
  57790. return shadow(this, "formInfo", formInfo);
  57791. }
  57792. get documentInfo() {
  57793. const docInfo = {
  57794. PDFFormatVersion: this.version,
  57795. Language: this.catalog.lang,
  57796. EncryptFilterName: this.xref.encrypt ? this.xref.encrypt.filterName : null,
  57797. IsLinearized: !!this.linearization,
  57798. IsAcroFormPresent: this.formInfo.hasAcroForm,
  57799. IsXFAPresent: this.formInfo.hasXfa,
  57800. IsCollectionPresent: !!this.catalog.collection,
  57801. IsSignaturesPresent: this.formInfo.hasSignatures
  57802. };
  57803. let infoDict;
  57804. try {
  57805. infoDict = this.xref.trailer.get("Info");
  57806. } catch (err) {
  57807. if (err instanceof MissingDataException) {
  57808. throw err;
  57809. }
  57810. info("The document information dictionary is invalid.");
  57811. }
  57812. if (!(infoDict instanceof Dict)) {
  57813. return shadow(this, "documentInfo", docInfo);
  57814. }
  57815. for (const key of infoDict.getKeys()) {
  57816. const value = infoDict.get(key);
  57817. switch (key) {
  57818. case "Title":
  57819. case "Author":
  57820. case "Subject":
  57821. case "Keywords":
  57822. case "Creator":
  57823. case "Producer":
  57824. case "CreationDate":
  57825. case "ModDate":
  57826. if (typeof value === "string") {
  57827. docInfo[key] = stringToPDFString(value);
  57828. continue;
  57829. }
  57830. break;
  57831. case "Trapped":
  57832. if (value instanceof Name) {
  57833. docInfo[key] = value;
  57834. continue;
  57835. }
  57836. break;
  57837. default:
  57838. let customValue;
  57839. switch (typeof value) {
  57840. case "string":
  57841. customValue = stringToPDFString(value);
  57842. break;
  57843. case "number":
  57844. case "boolean":
  57845. customValue = value;
  57846. break;
  57847. default:
  57848. if (value instanceof Name) {
  57849. customValue = value;
  57850. }
  57851. break;
  57852. }
  57853. if (customValue === undefined) {
  57854. warn(`Bad value, for custom key "${key}", in Info: ${value}.`);
  57855. continue;
  57856. }
  57857. if (!docInfo.Custom) {
  57858. docInfo.Custom = Object.create(null);
  57859. }
  57860. docInfo.Custom[key] = customValue;
  57861. continue;
  57862. }
  57863. warn(`Bad value, for key "${key}", in Info: ${value}.`);
  57864. }
  57865. return shadow(this, "documentInfo", docInfo);
  57866. }
  57867. get fingerprints() {
  57868. function validate(data) {
  57869. return typeof data === "string" && data.length > 0 && data !== EMPTY_FINGERPRINT;
  57870. }
  57871. function hexString(hash) {
  57872. const buf = [];
  57873. for (const num of hash) {
  57874. const hex = num.toString(16);
  57875. buf.push(hex.padStart(2, "0"));
  57876. }
  57877. return buf.join("");
  57878. }
  57879. const idArray = this.xref.trailer.get("ID");
  57880. let hashOriginal, hashModified;
  57881. if (Array.isArray(idArray) && validate(idArray[0])) {
  57882. hashOriginal = stringToBytes(idArray[0]);
  57883. if (idArray[1] !== idArray[0] && validate(idArray[1])) {
  57884. hashModified = stringToBytes(idArray[1]);
  57885. }
  57886. } else {
  57887. hashOriginal = calculateMD5(this.stream.getByteRange(0, FINGERPRINT_FIRST_BYTES), 0, FINGERPRINT_FIRST_BYTES);
  57888. }
  57889. return shadow(this, "fingerprints", [hexString(hashOriginal), hashModified ? hexString(hashModified) : null]);
  57890. }
  57891. async _getLinearizationPage(pageIndex) {
  57892. const {
  57893. catalog,
  57894. linearization,
  57895. xref
  57896. } = this;
  57897. const ref = Ref.get(linearization.objectNumberFirst, 0);
  57898. try {
  57899. const obj = await xref.fetchAsync(ref);
  57900. if (obj instanceof Dict) {
  57901. let type = obj.getRaw("Type");
  57902. if (type instanceof Ref) {
  57903. type = await xref.fetchAsync(type);
  57904. }
  57905. if (isName(type, "Page") || !obj.has("Type") && !obj.has("Kids") && obj.has("Contents")) {
  57906. if (!catalog.pageKidsCountCache.has(ref)) {
  57907. catalog.pageKidsCountCache.put(ref, 1);
  57908. }
  57909. if (!catalog.pageIndexCache.has(ref)) {
  57910. catalog.pageIndexCache.put(ref, 0);
  57911. }
  57912. return [obj, ref];
  57913. }
  57914. }
  57915. throw new FormatError("The Linearization dictionary doesn't point to a valid Page dictionary.");
  57916. } catch (reason) {
  57917. warn(`_getLinearizationPage: "${reason.message}".`);
  57918. return catalog.getPageDict(pageIndex);
  57919. }
  57920. }
  57921. getPage(pageIndex) {
  57922. const cachedPromise = this._pagePromises.get(pageIndex);
  57923. if (cachedPromise) {
  57924. return cachedPromise;
  57925. }
  57926. const {
  57927. catalog,
  57928. linearization,
  57929. xfaFactory
  57930. } = this;
  57931. let promise;
  57932. if (xfaFactory) {
  57933. promise = Promise.resolve([Dict.empty, null]);
  57934. } else if (linearization?.pageFirst === pageIndex) {
  57935. promise = this._getLinearizationPage(pageIndex);
  57936. } else {
  57937. promise = catalog.getPageDict(pageIndex);
  57938. }
  57939. promise = promise.then(([pageDict, ref]) => {
  57940. return new Page({
  57941. pdfManager: this.pdfManager,
  57942. xref: this.xref,
  57943. pageIndex,
  57944. pageDict,
  57945. ref,
  57946. globalIdFactory: this._globalIdFactory,
  57947. fontCache: catalog.fontCache,
  57948. builtInCMapCache: catalog.builtInCMapCache,
  57949. standardFontDataCache: catalog.standardFontDataCache,
  57950. globalImageCache: catalog.globalImageCache,
  57951. systemFontCache: catalog.systemFontCache,
  57952. nonBlendModesSet: catalog.nonBlendModesSet,
  57953. xfaFactory
  57954. });
  57955. });
  57956. this._pagePromises.set(pageIndex, promise);
  57957. return promise;
  57958. }
  57959. async checkFirstPage(recoveryMode = false) {
  57960. if (recoveryMode) {
  57961. return;
  57962. }
  57963. try {
  57964. await this.getPage(0);
  57965. } catch (reason) {
  57966. if (reason instanceof XRefEntryException) {
  57967. this._pagePromises.delete(0);
  57968. await this.cleanup();
  57969. throw new XRefParseException();
  57970. }
  57971. }
  57972. }
  57973. async checkLastPage(recoveryMode = false) {
  57974. const {
  57975. catalog,
  57976. pdfManager
  57977. } = this;
  57978. catalog.setActualNumPages();
  57979. let numPages;
  57980. try {
  57981. await Promise.all([pdfManager.ensureDoc("xfaFactory"), pdfManager.ensureDoc("linearization"), pdfManager.ensureCatalog("numPages")]);
  57982. if (this.xfaFactory) {
  57983. return;
  57984. } else if (this.linearization) {
  57985. numPages = this.linearization.numPages;
  57986. } else {
  57987. numPages = catalog.numPages;
  57988. }
  57989. if (!Number.isInteger(numPages)) {
  57990. throw new FormatError("Page count is not an integer.");
  57991. } else if (numPages <= 1) {
  57992. return;
  57993. }
  57994. await this.getPage(numPages - 1);
  57995. } catch (reason) {
  57996. this._pagePromises.delete(numPages - 1);
  57997. await this.cleanup();
  57998. if (reason instanceof XRefEntryException && !recoveryMode) {
  57999. throw new XRefParseException();
  58000. }
  58001. warn(`checkLastPage - invalid /Pages tree /Count: ${numPages}.`);
  58002. let pagesTree;
  58003. try {
  58004. pagesTree = await catalog.getAllPageDicts(recoveryMode);
  58005. } catch (reasonAll) {
  58006. if (reasonAll instanceof XRefEntryException && !recoveryMode) {
  58007. throw new XRefParseException();
  58008. }
  58009. catalog.setActualNumPages(1);
  58010. return;
  58011. }
  58012. for (const [pageIndex, [pageDict, ref]] of pagesTree) {
  58013. let promise;
  58014. if (pageDict instanceof Error) {
  58015. promise = Promise.reject(pageDict);
  58016. promise.catch(() => {});
  58017. } else {
  58018. promise = Promise.resolve(new Page({
  58019. pdfManager,
  58020. xref: this.xref,
  58021. pageIndex,
  58022. pageDict,
  58023. ref,
  58024. globalIdFactory: this._globalIdFactory,
  58025. fontCache: catalog.fontCache,
  58026. builtInCMapCache: catalog.builtInCMapCache,
  58027. standardFontDataCache: catalog.standardFontDataCache,
  58028. globalImageCache: catalog.globalImageCache,
  58029. systemFontCache: catalog.systemFontCache,
  58030. nonBlendModesSet: catalog.nonBlendModesSet,
  58031. xfaFactory: null
  58032. }));
  58033. }
  58034. this._pagePromises.set(pageIndex, promise);
  58035. }
  58036. catalog.setActualNumPages(pagesTree.size);
  58037. }
  58038. }
  58039. fontFallback(id, handler) {
  58040. return this.catalog.fontFallback(id, handler);
  58041. }
  58042. async cleanup(manuallyTriggered = false) {
  58043. return this.catalog ? this.catalog.cleanup(manuallyTriggered) : clearGlobalCaches();
  58044. }
  58045. async #collectFieldObjects(name, parentRef, fieldRef, promises, annotationGlobals, visitedRefs, orphanFields) {
  58046. const {
  58047. xref
  58048. } = this;
  58049. if (!(fieldRef instanceof Ref) || visitedRefs.has(fieldRef)) {
  58050. return;
  58051. }
  58052. visitedRefs.put(fieldRef);
  58053. const field = await xref.fetchAsync(fieldRef);
  58054. if (!(field instanceof Dict)) {
  58055. return;
  58056. }
  58057. if (field.has("T")) {
  58058. const partName = stringToPDFString(await field.getAsync("T"));
  58059. name = name === "" ? partName : `${name}.${partName}`;
  58060. } else {
  58061. let obj = field;
  58062. while (true) {
  58063. obj = obj.getRaw("Parent") || parentRef;
  58064. if (obj instanceof Ref) {
  58065. if (visitedRefs.has(obj)) {
  58066. break;
  58067. }
  58068. obj = await xref.fetchAsync(obj);
  58069. }
  58070. if (!(obj instanceof Dict)) {
  58071. break;
  58072. }
  58073. if (obj.has("T")) {
  58074. const partName = stringToPDFString(await obj.getAsync("T"));
  58075. name = name === "" ? partName : `${name}.${partName}`;
  58076. break;
  58077. }
  58078. }
  58079. }
  58080. if (parentRef && !field.has("Parent") && isName(field.get("Subtype"), "Widget")) {
  58081. orphanFields.put(fieldRef, parentRef);
  58082. }
  58083. if (!promises.has(name)) {
  58084. promises.set(name, []);
  58085. }
  58086. promises.get(name).push(AnnotationFactory.create(xref, fieldRef, annotationGlobals, null, true, orphanFields, null).then(annotation => annotation?.getFieldObject()).catch(function (reason) {
  58087. warn(`#collectFieldObjects: "${reason}".`);
  58088. return null;
  58089. }));
  58090. if (!field.has("Kids")) {
  58091. return;
  58092. }
  58093. const kids = await field.getAsync("Kids");
  58094. if (Array.isArray(kids)) {
  58095. for (const kid of kids) {
  58096. await this.#collectFieldObjects(name, fieldRef, kid, promises, annotationGlobals, visitedRefs, orphanFields);
  58097. }
  58098. }
  58099. }
  58100. get fieldObjects() {
  58101. if (!this.formInfo.hasFields) {
  58102. return shadow(this, "fieldObjects", Promise.resolve(null));
  58103. }
  58104. const promise = Promise.all([this.pdfManager.ensureDoc("annotationGlobals"), this.pdfManager.ensureCatalog("acroForm")]).then(async ([annotationGlobals, acroForm]) => {
  58105. if (!annotationGlobals) {
  58106. return null;
  58107. }
  58108. const visitedRefs = new RefSet();
  58109. const allFields = Object.create(null);
  58110. const fieldPromises = new Map();
  58111. const orphanFields = new RefSetCache();
  58112. for (const fieldRef of await acroForm.getAsync("Fields")) {
  58113. await this.#collectFieldObjects("", null, fieldRef, fieldPromises, annotationGlobals, visitedRefs, orphanFields);
  58114. }
  58115. const allPromises = [];
  58116. for (const [name, promises] of fieldPromises) {
  58117. allPromises.push(Promise.all(promises).then(fields => {
  58118. fields = fields.filter(field => !!field);
  58119. if (fields.length > 0) {
  58120. allFields[name] = fields;
  58121. }
  58122. }));
  58123. }
  58124. await Promise.all(allPromises);
  58125. return {
  58126. allFields,
  58127. orphanFields
  58128. };
  58129. });
  58130. return shadow(this, "fieldObjects", promise);
  58131. }
  58132. get hasJSActions() {
  58133. const promise = this.pdfManager.ensureDoc("_parseHasJSActions");
  58134. return shadow(this, "hasJSActions", promise);
  58135. }
  58136. async _parseHasJSActions() {
  58137. const [catalogJsActions, fieldObjects] = await Promise.all([this.pdfManager.ensureCatalog("jsActions"), this.pdfManager.ensureDoc("fieldObjects")]);
  58138. if (catalogJsActions) {
  58139. return true;
  58140. }
  58141. if (fieldObjects) {
  58142. return Object.values(fieldObjects.allFields).some(fieldObject => fieldObject.some(object => object.actions !== null));
  58143. }
  58144. return false;
  58145. }
  58146. get calculationOrderIds() {
  58147. const acroForm = this.catalog.acroForm;
  58148. if (!acroForm?.has("CO")) {
  58149. return shadow(this, "calculationOrderIds", null);
  58150. }
  58151. const calculationOrder = acroForm.get("CO");
  58152. if (!Array.isArray(calculationOrder) || calculationOrder.length === 0) {
  58153. return shadow(this, "calculationOrderIds", null);
  58154. }
  58155. const ids = [];
  58156. for (const id of calculationOrder) {
  58157. if (id instanceof Ref) {
  58158. ids.push(id.toString());
  58159. }
  58160. }
  58161. if (ids.length === 0) {
  58162. return shadow(this, "calculationOrderIds", null);
  58163. }
  58164. return shadow(this, "calculationOrderIds", ids);
  58165. }
  58166. get annotationGlobals() {
  58167. return shadow(this, "annotationGlobals", AnnotationFactory.createGlobals(this.pdfManager));
  58168. }
  58169. }
  58170. ;// ./src/core/pdf_manager.js
  58171. function parseDocBaseUrl(url) {
  58172. if (url) {
  58173. const absoluteUrl = createValidAbsoluteUrl(url);
  58174. if (absoluteUrl) {
  58175. return absoluteUrl.href;
  58176. }
  58177. warn(`Invalid absolute docBaseUrl: "${url}".`);
  58178. }
  58179. return null;
  58180. }
  58181. class BasePdfManager {
  58182. constructor(args) {
  58183. this._docBaseUrl = parseDocBaseUrl(args.docBaseUrl);
  58184. this._docId = args.docId;
  58185. this._password = args.password;
  58186. this.enableXfa = args.enableXfa;
  58187. args.evaluatorOptions.isOffscreenCanvasSupported &&= FeatureTest.isOffscreenCanvasSupported;
  58188. this.evaluatorOptions = Object.freeze(args.evaluatorOptions);
  58189. }
  58190. get docId() {
  58191. return this._docId;
  58192. }
  58193. get password() {
  58194. return this._password;
  58195. }
  58196. get docBaseUrl() {
  58197. return this._docBaseUrl;
  58198. }
  58199. get catalog() {
  58200. return this.pdfDocument.catalog;
  58201. }
  58202. ensureDoc(prop, args) {
  58203. return this.ensure(this.pdfDocument, prop, args);
  58204. }
  58205. ensureXRef(prop, args) {
  58206. return this.ensure(this.pdfDocument.xref, prop, args);
  58207. }
  58208. ensureCatalog(prop, args) {
  58209. return this.ensure(this.pdfDocument.catalog, prop, args);
  58210. }
  58211. getPage(pageIndex) {
  58212. return this.pdfDocument.getPage(pageIndex);
  58213. }
  58214. fontFallback(id, handler) {
  58215. return this.pdfDocument.fontFallback(id, handler);
  58216. }
  58217. loadXfaFonts(handler, task) {
  58218. return this.pdfDocument.loadXfaFonts(handler, task);
  58219. }
  58220. loadXfaImages() {
  58221. return this.pdfDocument.loadXfaImages();
  58222. }
  58223. serializeXfaData(annotationStorage) {
  58224. return this.pdfDocument.serializeXfaData(annotationStorage);
  58225. }
  58226. cleanup(manuallyTriggered = false) {
  58227. return this.pdfDocument.cleanup(manuallyTriggered);
  58228. }
  58229. async ensure(obj, prop, args) {
  58230. unreachable("Abstract method `ensure` called");
  58231. }
  58232. requestRange(begin, end) {
  58233. unreachable("Abstract method `requestRange` called");
  58234. }
  58235. requestLoadedStream(noFetch = false) {
  58236. unreachable("Abstract method `requestLoadedStream` called");
  58237. }
  58238. sendProgressiveData(chunk) {
  58239. unreachable("Abstract method `sendProgressiveData` called");
  58240. }
  58241. updatePassword(password) {
  58242. this._password = password;
  58243. }
  58244. terminate(reason) {
  58245. unreachable("Abstract method `terminate` called");
  58246. }
  58247. }
  58248. class LocalPdfManager extends BasePdfManager {
  58249. constructor(args) {
  58250. super(args);
  58251. const stream = new Stream(args.source);
  58252. this.pdfDocument = new PDFDocument(this, stream);
  58253. this._loadedStreamPromise = Promise.resolve(stream);
  58254. }
  58255. async ensure(obj, prop, args) {
  58256. const value = obj[prop];
  58257. if (typeof value === "function") {
  58258. return value.apply(obj, args);
  58259. }
  58260. return value;
  58261. }
  58262. requestRange(begin, end) {
  58263. return Promise.resolve();
  58264. }
  58265. requestLoadedStream(noFetch = false) {
  58266. return this._loadedStreamPromise;
  58267. }
  58268. terminate(reason) {}
  58269. }
  58270. class NetworkPdfManager extends BasePdfManager {
  58271. constructor(args) {
  58272. super(args);
  58273. this.streamManager = new ChunkedStreamManager(args.source, {
  58274. msgHandler: args.handler,
  58275. length: args.length,
  58276. disableAutoFetch: args.disableAutoFetch,
  58277. rangeChunkSize: args.rangeChunkSize
  58278. });
  58279. this.pdfDocument = new PDFDocument(this, this.streamManager.getStream());
  58280. }
  58281. async ensure(obj, prop, args) {
  58282. try {
  58283. const value = obj[prop];
  58284. if (typeof value === "function") {
  58285. return value.apply(obj, args);
  58286. }
  58287. return value;
  58288. } catch (ex) {
  58289. if (!(ex instanceof MissingDataException)) {
  58290. throw ex;
  58291. }
  58292. await this.requestRange(ex.begin, ex.end);
  58293. return this.ensure(obj, prop, args);
  58294. }
  58295. }
  58296. requestRange(begin, end) {
  58297. return this.streamManager.requestRange(begin, end);
  58298. }
  58299. requestLoadedStream(noFetch = false) {
  58300. return this.streamManager.requestAllChunks(noFetch);
  58301. }
  58302. sendProgressiveData(chunk) {
  58303. this.streamManager.onReceiveData({
  58304. chunk
  58305. });
  58306. }
  58307. terminate(reason) {
  58308. this.streamManager.abort(reason);
  58309. }
  58310. }
  58311. ;// ./src/shared/message_handler.js
  58312. const CallbackKind = {
  58313. UNKNOWN: 0,
  58314. DATA: 1,
  58315. ERROR: 2
  58316. };
  58317. const StreamKind = {
  58318. UNKNOWN: 0,
  58319. CANCEL: 1,
  58320. CANCEL_COMPLETE: 2,
  58321. CLOSE: 3,
  58322. ENQUEUE: 4,
  58323. ERROR: 5,
  58324. PULL: 6,
  58325. PULL_COMPLETE: 7,
  58326. START_COMPLETE: 8
  58327. };
  58328. function wrapReason(reason) {
  58329. if (!(reason instanceof Error || typeof reason === "object" && reason !== null)) {
  58330. unreachable('wrapReason: Expected "reason" to be a (possibly cloned) Error.');
  58331. }
  58332. switch (reason.name) {
  58333. case "AbortException":
  58334. return new AbortException(reason.message);
  58335. case "MissingPDFException":
  58336. return new MissingPDFException(reason.message);
  58337. case "PasswordException":
  58338. return new PasswordException(reason.message, reason.code);
  58339. case "UnexpectedResponseException":
  58340. return new UnexpectedResponseException(reason.message, reason.status);
  58341. case "UnknownErrorException":
  58342. return new UnknownErrorException(reason.message, reason.details);
  58343. default:
  58344. return new UnknownErrorException(reason.message, reason.toString());
  58345. }
  58346. }
  58347. class MessageHandler {
  58348. constructor(sourceName, targetName, comObj) {
  58349. this.sourceName = sourceName;
  58350. this.targetName = targetName;
  58351. this.comObj = comObj;
  58352. this.callbackId = 1;
  58353. this.streamId = 1;
  58354. this.streamSinks = Object.create(null);
  58355. this.streamControllers = Object.create(null);
  58356. this.callbackCapabilities = Object.create(null);
  58357. this.actionHandler = Object.create(null);
  58358. this._onComObjOnMessage = event => {
  58359. const data = event.data;
  58360. if (data.targetName !== this.sourceName) {
  58361. return;
  58362. }
  58363. if (data.stream) {
  58364. this.#processStreamMessage(data);
  58365. return;
  58366. }
  58367. if (data.callback) {
  58368. const callbackId = data.callbackId;
  58369. const capability = this.callbackCapabilities[callbackId];
  58370. if (!capability) {
  58371. throw new Error(`Cannot resolve callback ${callbackId}`);
  58372. }
  58373. delete this.callbackCapabilities[callbackId];
  58374. if (data.callback === CallbackKind.DATA) {
  58375. capability.resolve(data.data);
  58376. } else if (data.callback === CallbackKind.ERROR) {
  58377. capability.reject(wrapReason(data.reason));
  58378. } else {
  58379. throw new Error("Unexpected callback case");
  58380. }
  58381. return;
  58382. }
  58383. const action = this.actionHandler[data.action];
  58384. if (!action) {
  58385. throw new Error(`Unknown action from worker: ${data.action}`);
  58386. }
  58387. if (data.callbackId) {
  58388. const cbSourceName = this.sourceName;
  58389. const cbTargetName = data.sourceName;
  58390. new Promise(function (resolve) {
  58391. resolve(action(data.data));
  58392. }).then(function (result) {
  58393. comObj.postMessage({
  58394. sourceName: cbSourceName,
  58395. targetName: cbTargetName,
  58396. callback: CallbackKind.DATA,
  58397. callbackId: data.callbackId,
  58398. data: result
  58399. });
  58400. }, function (reason) {
  58401. comObj.postMessage({
  58402. sourceName: cbSourceName,
  58403. targetName: cbTargetName,
  58404. callback: CallbackKind.ERROR,
  58405. callbackId: data.callbackId,
  58406. reason: wrapReason(reason)
  58407. });
  58408. });
  58409. return;
  58410. }
  58411. if (data.streamId) {
  58412. this.#createStreamSink(data);
  58413. return;
  58414. }
  58415. action(data.data);
  58416. };
  58417. comObj.addEventListener("message", this._onComObjOnMessage);
  58418. }
  58419. on(actionName, handler) {
  58420. const ah = this.actionHandler;
  58421. if (ah[actionName]) {
  58422. throw new Error(`There is already an actionName called "${actionName}"`);
  58423. }
  58424. ah[actionName] = handler;
  58425. }
  58426. send(actionName, data, transfers) {
  58427. this.comObj.postMessage({
  58428. sourceName: this.sourceName,
  58429. targetName: this.targetName,
  58430. action: actionName,
  58431. data
  58432. }, transfers);
  58433. }
  58434. sendWithPromise(actionName, data, transfers) {
  58435. const callbackId = this.callbackId++;
  58436. const capability = Promise.withResolvers();
  58437. this.callbackCapabilities[callbackId] = capability;
  58438. try {
  58439. this.comObj.postMessage({
  58440. sourceName: this.sourceName,
  58441. targetName: this.targetName,
  58442. action: actionName,
  58443. callbackId,
  58444. data
  58445. }, transfers);
  58446. } catch (ex) {
  58447. capability.reject(ex);
  58448. }
  58449. return capability.promise;
  58450. }
  58451. sendWithStream(actionName, data, queueingStrategy, transfers) {
  58452. const streamId = this.streamId++,
  58453. sourceName = this.sourceName,
  58454. targetName = this.targetName,
  58455. comObj = this.comObj;
  58456. return new ReadableStream({
  58457. start: controller => {
  58458. const startCapability = Promise.withResolvers();
  58459. this.streamControllers[streamId] = {
  58460. controller,
  58461. startCall: startCapability,
  58462. pullCall: null,
  58463. cancelCall: null,
  58464. isClosed: false
  58465. };
  58466. comObj.postMessage({
  58467. sourceName,
  58468. targetName,
  58469. action: actionName,
  58470. streamId,
  58471. data,
  58472. desiredSize: controller.desiredSize
  58473. }, transfers);
  58474. return startCapability.promise;
  58475. },
  58476. pull: controller => {
  58477. const pullCapability = Promise.withResolvers();
  58478. this.streamControllers[streamId].pullCall = pullCapability;
  58479. comObj.postMessage({
  58480. sourceName,
  58481. targetName,
  58482. stream: StreamKind.PULL,
  58483. streamId,
  58484. desiredSize: controller.desiredSize
  58485. });
  58486. return pullCapability.promise;
  58487. },
  58488. cancel: reason => {
  58489. assert(reason instanceof Error, "cancel must have a valid reason");
  58490. const cancelCapability = Promise.withResolvers();
  58491. this.streamControllers[streamId].cancelCall = cancelCapability;
  58492. this.streamControllers[streamId].isClosed = true;
  58493. comObj.postMessage({
  58494. sourceName,
  58495. targetName,
  58496. stream: StreamKind.CANCEL,
  58497. streamId,
  58498. reason: wrapReason(reason)
  58499. });
  58500. return cancelCapability.promise;
  58501. }
  58502. }, queueingStrategy);
  58503. }
  58504. #createStreamSink(data) {
  58505. const streamId = data.streamId,
  58506. sourceName = this.sourceName,
  58507. targetName = data.sourceName,
  58508. comObj = this.comObj;
  58509. const self = this,
  58510. action = this.actionHandler[data.action];
  58511. const streamSink = {
  58512. enqueue(chunk, size = 1, transfers) {
  58513. if (this.isCancelled) {
  58514. return;
  58515. }
  58516. const lastDesiredSize = this.desiredSize;
  58517. this.desiredSize -= size;
  58518. if (lastDesiredSize > 0 && this.desiredSize <= 0) {
  58519. this.sinkCapability = Promise.withResolvers();
  58520. this.ready = this.sinkCapability.promise;
  58521. }
  58522. comObj.postMessage({
  58523. sourceName,
  58524. targetName,
  58525. stream: StreamKind.ENQUEUE,
  58526. streamId,
  58527. chunk
  58528. }, transfers);
  58529. },
  58530. close() {
  58531. if (this.isCancelled) {
  58532. return;
  58533. }
  58534. this.isCancelled = true;
  58535. comObj.postMessage({
  58536. sourceName,
  58537. targetName,
  58538. stream: StreamKind.CLOSE,
  58539. streamId
  58540. });
  58541. delete self.streamSinks[streamId];
  58542. },
  58543. error(reason) {
  58544. assert(reason instanceof Error, "error must have a valid reason");
  58545. if (this.isCancelled) {
  58546. return;
  58547. }
  58548. this.isCancelled = true;
  58549. comObj.postMessage({
  58550. sourceName,
  58551. targetName,
  58552. stream: StreamKind.ERROR,
  58553. streamId,
  58554. reason: wrapReason(reason)
  58555. });
  58556. },
  58557. sinkCapability: Promise.withResolvers(),
  58558. onPull: null,
  58559. onCancel: null,
  58560. isCancelled: false,
  58561. desiredSize: data.desiredSize,
  58562. ready: null
  58563. };
  58564. streamSink.sinkCapability.resolve();
  58565. streamSink.ready = streamSink.sinkCapability.promise;
  58566. this.streamSinks[streamId] = streamSink;
  58567. new Promise(function (resolve) {
  58568. resolve(action(data.data, streamSink));
  58569. }).then(function () {
  58570. comObj.postMessage({
  58571. sourceName,
  58572. targetName,
  58573. stream: StreamKind.START_COMPLETE,
  58574. streamId,
  58575. success: true
  58576. });
  58577. }, function (reason) {
  58578. comObj.postMessage({
  58579. sourceName,
  58580. targetName,
  58581. stream: StreamKind.START_COMPLETE,
  58582. streamId,
  58583. reason: wrapReason(reason)
  58584. });
  58585. });
  58586. }
  58587. #processStreamMessage(data) {
  58588. const streamId = data.streamId,
  58589. sourceName = this.sourceName,
  58590. targetName = data.sourceName,
  58591. comObj = this.comObj;
  58592. const streamController = this.streamControllers[streamId],
  58593. streamSink = this.streamSinks[streamId];
  58594. switch (data.stream) {
  58595. case StreamKind.START_COMPLETE:
  58596. if (data.success) {
  58597. streamController.startCall.resolve();
  58598. } else {
  58599. streamController.startCall.reject(wrapReason(data.reason));
  58600. }
  58601. break;
  58602. case StreamKind.PULL_COMPLETE:
  58603. if (data.success) {
  58604. streamController.pullCall.resolve();
  58605. } else {
  58606. streamController.pullCall.reject(wrapReason(data.reason));
  58607. }
  58608. break;
  58609. case StreamKind.PULL:
  58610. if (!streamSink) {
  58611. comObj.postMessage({
  58612. sourceName,
  58613. targetName,
  58614. stream: StreamKind.PULL_COMPLETE,
  58615. streamId,
  58616. success: true
  58617. });
  58618. break;
  58619. }
  58620. if (streamSink.desiredSize <= 0 && data.desiredSize > 0) {
  58621. streamSink.sinkCapability.resolve();
  58622. }
  58623. streamSink.desiredSize = data.desiredSize;
  58624. new Promise(function (resolve) {
  58625. resolve(streamSink.onPull?.());
  58626. }).then(function () {
  58627. comObj.postMessage({
  58628. sourceName,
  58629. targetName,
  58630. stream: StreamKind.PULL_COMPLETE,
  58631. streamId,
  58632. success: true
  58633. });
  58634. }, function (reason) {
  58635. comObj.postMessage({
  58636. sourceName,
  58637. targetName,
  58638. stream: StreamKind.PULL_COMPLETE,
  58639. streamId,
  58640. reason: wrapReason(reason)
  58641. });
  58642. });
  58643. break;
  58644. case StreamKind.ENQUEUE:
  58645. assert(streamController, "enqueue should have stream controller");
  58646. if (streamController.isClosed) {
  58647. break;
  58648. }
  58649. streamController.controller.enqueue(data.chunk);
  58650. break;
  58651. case StreamKind.CLOSE:
  58652. assert(streamController, "close should have stream controller");
  58653. if (streamController.isClosed) {
  58654. break;
  58655. }
  58656. streamController.isClosed = true;
  58657. streamController.controller.close();
  58658. this.#deleteStreamController(streamController, streamId);
  58659. break;
  58660. case StreamKind.ERROR:
  58661. assert(streamController, "error should have stream controller");
  58662. streamController.controller.error(wrapReason(data.reason));
  58663. this.#deleteStreamController(streamController, streamId);
  58664. break;
  58665. case StreamKind.CANCEL_COMPLETE:
  58666. if (data.success) {
  58667. streamController.cancelCall.resolve();
  58668. } else {
  58669. streamController.cancelCall.reject(wrapReason(data.reason));
  58670. }
  58671. this.#deleteStreamController(streamController, streamId);
  58672. break;
  58673. case StreamKind.CANCEL:
  58674. if (!streamSink) {
  58675. break;
  58676. }
  58677. new Promise(function (resolve) {
  58678. resolve(streamSink.onCancel?.(wrapReason(data.reason)));
  58679. }).then(function () {
  58680. comObj.postMessage({
  58681. sourceName,
  58682. targetName,
  58683. stream: StreamKind.CANCEL_COMPLETE,
  58684. streamId,
  58685. success: true
  58686. });
  58687. }, function (reason) {
  58688. comObj.postMessage({
  58689. sourceName,
  58690. targetName,
  58691. stream: StreamKind.CANCEL_COMPLETE,
  58692. streamId,
  58693. reason: wrapReason(reason)
  58694. });
  58695. });
  58696. streamSink.sinkCapability.reject(wrapReason(data.reason));
  58697. streamSink.isCancelled = true;
  58698. delete this.streamSinks[streamId];
  58699. break;
  58700. default:
  58701. throw new Error("Unexpected stream case");
  58702. }
  58703. }
  58704. async #deleteStreamController(streamController, streamId) {
  58705. await Promise.allSettled([streamController.startCall?.promise, streamController.pullCall?.promise, streamController.cancelCall?.promise]);
  58706. delete this.streamControllers[streamId];
  58707. }
  58708. destroy() {
  58709. this.comObj.removeEventListener("message", this._onComObjOnMessage);
  58710. }
  58711. }
  58712. ;// ./src/core/worker_stream.js
  58713. class PDFWorkerStream {
  58714. constructor(msgHandler) {
  58715. this._msgHandler = msgHandler;
  58716. this._contentLength = null;
  58717. this._fullRequestReader = null;
  58718. this._rangeRequestReaders = [];
  58719. }
  58720. getFullReader() {
  58721. assert(!this._fullRequestReader, "PDFWorkerStream.getFullReader can only be called once.");
  58722. this._fullRequestReader = new PDFWorkerStreamReader(this._msgHandler);
  58723. return this._fullRequestReader;
  58724. }
  58725. getRangeReader(begin, end) {
  58726. const reader = new PDFWorkerStreamRangeReader(begin, end, this._msgHandler);
  58727. this._rangeRequestReaders.push(reader);
  58728. return reader;
  58729. }
  58730. cancelAllRequests(reason) {
  58731. this._fullRequestReader?.cancel(reason);
  58732. for (const reader of this._rangeRequestReaders.slice(0)) {
  58733. reader.cancel(reason);
  58734. }
  58735. }
  58736. }
  58737. class PDFWorkerStreamReader {
  58738. constructor(msgHandler) {
  58739. this._msgHandler = msgHandler;
  58740. this.onProgress = null;
  58741. this._contentLength = null;
  58742. this._isRangeSupported = false;
  58743. this._isStreamingSupported = false;
  58744. const readableStream = this._msgHandler.sendWithStream("GetReader");
  58745. this._reader = readableStream.getReader();
  58746. this._headersReady = this._msgHandler.sendWithPromise("ReaderHeadersReady").then(data => {
  58747. this._isStreamingSupported = data.isStreamingSupported;
  58748. this._isRangeSupported = data.isRangeSupported;
  58749. this._contentLength = data.contentLength;
  58750. });
  58751. }
  58752. get headersReady() {
  58753. return this._headersReady;
  58754. }
  58755. get contentLength() {
  58756. return this._contentLength;
  58757. }
  58758. get isStreamingSupported() {
  58759. return this._isStreamingSupported;
  58760. }
  58761. get isRangeSupported() {
  58762. return this._isRangeSupported;
  58763. }
  58764. async read() {
  58765. const {
  58766. value,
  58767. done
  58768. } = await this._reader.read();
  58769. if (done) {
  58770. return {
  58771. value: undefined,
  58772. done: true
  58773. };
  58774. }
  58775. return {
  58776. value: value.buffer,
  58777. done: false
  58778. };
  58779. }
  58780. cancel(reason) {
  58781. this._reader.cancel(reason);
  58782. }
  58783. }
  58784. class PDFWorkerStreamRangeReader {
  58785. constructor(begin, end, msgHandler) {
  58786. this._msgHandler = msgHandler;
  58787. this.onProgress = null;
  58788. const readableStream = this._msgHandler.sendWithStream("GetRangeReader", {
  58789. begin,
  58790. end
  58791. });
  58792. this._reader = readableStream.getReader();
  58793. }
  58794. get isStreamingSupported() {
  58795. return false;
  58796. }
  58797. async read() {
  58798. const {
  58799. value,
  58800. done
  58801. } = await this._reader.read();
  58802. if (done) {
  58803. return {
  58804. value: undefined,
  58805. done: true
  58806. };
  58807. }
  58808. return {
  58809. value: value.buffer,
  58810. done: false
  58811. };
  58812. }
  58813. cancel(reason) {
  58814. this._reader.cancel(reason);
  58815. }
  58816. }
  58817. ;// ./src/core/worker.js
  58818. class WorkerTask {
  58819. constructor(name) {
  58820. this.name = name;
  58821. this.terminated = false;
  58822. this._capability = Promise.withResolvers();
  58823. }
  58824. get finished() {
  58825. return this._capability.promise;
  58826. }
  58827. finish() {
  58828. this._capability.resolve();
  58829. }
  58830. terminate() {
  58831. this.terminated = true;
  58832. }
  58833. ensureNotTerminated() {
  58834. if (this.terminated) {
  58835. throw new Error("Worker task was terminated");
  58836. }
  58837. }
  58838. }
  58839. class WorkerMessageHandler {
  58840. static setup(handler, port) {
  58841. let testMessageProcessed = false;
  58842. handler.on("test", function (data) {
  58843. if (testMessageProcessed) {
  58844. return;
  58845. }
  58846. testMessageProcessed = true;
  58847. handler.send("test", data instanceof Uint8Array);
  58848. });
  58849. handler.on("configure", function (data) {
  58850. setVerbosityLevel(data.verbosity);
  58851. });
  58852. handler.on("GetDocRequest", function (data) {
  58853. return WorkerMessageHandler.createDocumentHandler(data, port);
  58854. });
  58855. }
  58856. static createDocumentHandler(docParams, port) {
  58857. let pdfManager;
  58858. let terminated = false;
  58859. let cancelXHRs = null;
  58860. const WorkerTasks = new Set();
  58861. const verbosity = getVerbosityLevel();
  58862. const {
  58863. docId,
  58864. apiVersion
  58865. } = docParams;
  58866. const workerVersion = "4.7.76";
  58867. if (apiVersion !== workerVersion) {
  58868. throw new Error(`The API version "${apiVersion}" does not match ` + `the Worker version "${workerVersion}".`);
  58869. }
  58870. const enumerableProperties = [];
  58871. for (const property in []) {
  58872. enumerableProperties.push(property);
  58873. }
  58874. if (enumerableProperties.length) {
  58875. throw new Error("The `Array.prototype` contains unexpected enumerable properties: " + enumerableProperties.join(", ") + "; thus breaking e.g. `for...in` iteration of `Array`s.");
  58876. }
  58877. const workerHandlerName = docId + "_worker";
  58878. let handler = new MessageHandler(workerHandlerName, docId, port);
  58879. function ensureNotTerminated() {
  58880. if (terminated) {
  58881. throw new Error("Worker was terminated");
  58882. }
  58883. }
  58884. function startWorkerTask(task) {
  58885. WorkerTasks.add(task);
  58886. }
  58887. function finishWorkerTask(task) {
  58888. task.finish();
  58889. WorkerTasks.delete(task);
  58890. }
  58891. async function loadDocument(recoveryMode) {
  58892. await pdfManager.ensureDoc("checkHeader");
  58893. await pdfManager.ensureDoc("parseStartXRef");
  58894. await pdfManager.ensureDoc("parse", [recoveryMode]);
  58895. await pdfManager.ensureDoc("checkFirstPage", [recoveryMode]);
  58896. await pdfManager.ensureDoc("checkLastPage", [recoveryMode]);
  58897. const isPureXfa = await pdfManager.ensureDoc("isPureXfa");
  58898. if (isPureXfa) {
  58899. const task = new WorkerTask("loadXfaFonts");
  58900. startWorkerTask(task);
  58901. await Promise.all([pdfManager.loadXfaFonts(handler, task).catch(reason => {}).then(() => finishWorkerTask(task)), pdfManager.loadXfaImages()]);
  58902. }
  58903. const [numPages, fingerprints] = await Promise.all([pdfManager.ensureDoc("numPages"), pdfManager.ensureDoc("fingerprints")]);
  58904. const htmlForXfa = isPureXfa ? await pdfManager.ensureDoc("htmlForXfa") : null;
  58905. return {
  58906. numPages,
  58907. fingerprints,
  58908. htmlForXfa
  58909. };
  58910. }
  58911. function getPdfManager({
  58912. data,
  58913. password,
  58914. disableAutoFetch,
  58915. rangeChunkSize,
  58916. length,
  58917. docBaseUrl,
  58918. enableXfa,
  58919. evaluatorOptions
  58920. }) {
  58921. const pdfManagerArgs = {
  58922. source: null,
  58923. disableAutoFetch,
  58924. docBaseUrl,
  58925. docId,
  58926. enableXfa,
  58927. evaluatorOptions,
  58928. handler,
  58929. length,
  58930. password,
  58931. rangeChunkSize
  58932. };
  58933. const pdfManagerCapability = Promise.withResolvers();
  58934. let newPdfManager;
  58935. if (data) {
  58936. try {
  58937. pdfManagerArgs.source = data;
  58938. newPdfManager = new LocalPdfManager(pdfManagerArgs);
  58939. pdfManagerCapability.resolve(newPdfManager);
  58940. } catch (ex) {
  58941. pdfManagerCapability.reject(ex);
  58942. }
  58943. return pdfManagerCapability.promise;
  58944. }
  58945. let pdfStream,
  58946. cachedChunks = [];
  58947. try {
  58948. pdfStream = new PDFWorkerStream(handler);
  58949. } catch (ex) {
  58950. pdfManagerCapability.reject(ex);
  58951. return pdfManagerCapability.promise;
  58952. }
  58953. const fullRequest = pdfStream.getFullReader();
  58954. fullRequest.headersReady.then(function () {
  58955. if (!fullRequest.isRangeSupported) {
  58956. return;
  58957. }
  58958. pdfManagerArgs.source = pdfStream;
  58959. pdfManagerArgs.length = fullRequest.contentLength;
  58960. pdfManagerArgs.disableAutoFetch ||= fullRequest.isStreamingSupported;
  58961. newPdfManager = new NetworkPdfManager(pdfManagerArgs);
  58962. for (const chunk of cachedChunks) {
  58963. newPdfManager.sendProgressiveData(chunk);
  58964. }
  58965. cachedChunks = [];
  58966. pdfManagerCapability.resolve(newPdfManager);
  58967. cancelXHRs = null;
  58968. }).catch(function (reason) {
  58969. pdfManagerCapability.reject(reason);
  58970. cancelXHRs = null;
  58971. });
  58972. let loaded = 0;
  58973. const flushChunks = function () {
  58974. const pdfFile = arrayBuffersToBytes(cachedChunks);
  58975. if (length && pdfFile.length !== length) {
  58976. warn("reported HTTP length is different from actual");
  58977. }
  58978. try {
  58979. pdfManagerArgs.source = pdfFile;
  58980. newPdfManager = new LocalPdfManager(pdfManagerArgs);
  58981. pdfManagerCapability.resolve(newPdfManager);
  58982. } catch (ex) {
  58983. pdfManagerCapability.reject(ex);
  58984. }
  58985. cachedChunks = [];
  58986. };
  58987. new Promise(function (resolve, reject) {
  58988. const readChunk = function ({
  58989. value,
  58990. done
  58991. }) {
  58992. try {
  58993. ensureNotTerminated();
  58994. if (done) {
  58995. if (!newPdfManager) {
  58996. flushChunks();
  58997. }
  58998. cancelXHRs = null;
  58999. return;
  59000. }
  59001. loaded += value.byteLength;
  59002. if (!fullRequest.isStreamingSupported) {
  59003. handler.send("DocProgress", {
  59004. loaded,
  59005. total: Math.max(loaded, fullRequest.contentLength || 0)
  59006. });
  59007. }
  59008. if (newPdfManager) {
  59009. newPdfManager.sendProgressiveData(value);
  59010. } else {
  59011. cachedChunks.push(value);
  59012. }
  59013. fullRequest.read().then(readChunk, reject);
  59014. } catch (e) {
  59015. reject(e);
  59016. }
  59017. };
  59018. fullRequest.read().then(readChunk, reject);
  59019. }).catch(function (e) {
  59020. pdfManagerCapability.reject(e);
  59021. cancelXHRs = null;
  59022. });
  59023. cancelXHRs = function (reason) {
  59024. pdfStream.cancelAllRequests(reason);
  59025. };
  59026. return pdfManagerCapability.promise;
  59027. }
  59028. function setupDoc(data) {
  59029. function onSuccess(doc) {
  59030. ensureNotTerminated();
  59031. handler.send("GetDoc", {
  59032. pdfInfo: doc
  59033. });
  59034. }
  59035. function onFailure(ex) {
  59036. ensureNotTerminated();
  59037. if (ex instanceof PasswordException) {
  59038. const task = new WorkerTask(`PasswordException: response ${ex.code}`);
  59039. startWorkerTask(task);
  59040. handler.sendWithPromise("PasswordRequest", ex).then(function ({
  59041. password
  59042. }) {
  59043. finishWorkerTask(task);
  59044. pdfManager.updatePassword(password);
  59045. pdfManagerReady();
  59046. }).catch(function () {
  59047. finishWorkerTask(task);
  59048. handler.send("DocException", ex);
  59049. });
  59050. } else if (ex instanceof InvalidPDFException || ex instanceof MissingPDFException || ex instanceof UnexpectedResponseException || ex instanceof UnknownErrorException) {
  59051. handler.send("DocException", ex);
  59052. } else {
  59053. handler.send("DocException", new UnknownErrorException(ex.message, ex.toString()));
  59054. }
  59055. }
  59056. function pdfManagerReady() {
  59057. ensureNotTerminated();
  59058. loadDocument(false).then(onSuccess, function (reason) {
  59059. ensureNotTerminated();
  59060. if (!(reason instanceof XRefParseException)) {
  59061. onFailure(reason);
  59062. return;
  59063. }
  59064. pdfManager.requestLoadedStream().then(function () {
  59065. ensureNotTerminated();
  59066. loadDocument(true).then(onSuccess, onFailure);
  59067. });
  59068. });
  59069. }
  59070. ensureNotTerminated();
  59071. getPdfManager(data).then(function (newPdfManager) {
  59072. if (terminated) {
  59073. newPdfManager.terminate(new AbortException("Worker was terminated."));
  59074. throw new Error("Worker was terminated");
  59075. }
  59076. pdfManager = newPdfManager;
  59077. pdfManager.requestLoadedStream(true).then(stream => {
  59078. handler.send("DataLoaded", {
  59079. length: stream.bytes.byteLength
  59080. });
  59081. });
  59082. }).then(pdfManagerReady, onFailure);
  59083. }
  59084. handler.on("GetPage", function (data) {
  59085. return pdfManager.getPage(data.pageIndex).then(function (page) {
  59086. return Promise.all([pdfManager.ensure(page, "rotate"), pdfManager.ensure(page, "ref"), pdfManager.ensure(page, "userUnit"), pdfManager.ensure(page, "view")]).then(function ([rotate, ref, userUnit, view]) {
  59087. return {
  59088. rotate,
  59089. ref,
  59090. refStr: ref?.toString() ?? null,
  59091. userUnit,
  59092. view
  59093. };
  59094. });
  59095. });
  59096. });
  59097. handler.on("GetPageIndex", function (data) {
  59098. const pageRef = Ref.get(data.num, data.gen);
  59099. return pdfManager.ensureCatalog("getPageIndex", [pageRef]);
  59100. });
  59101. handler.on("GetDestinations", function (data) {
  59102. return pdfManager.ensureCatalog("destinations");
  59103. });
  59104. handler.on("GetDestination", function (data) {
  59105. return pdfManager.ensureCatalog("getDestination", [data.id]);
  59106. });
  59107. handler.on("GetPageLabels", function (data) {
  59108. return pdfManager.ensureCatalog("pageLabels");
  59109. });
  59110. handler.on("GetPageLayout", function (data) {
  59111. return pdfManager.ensureCatalog("pageLayout");
  59112. });
  59113. handler.on("GetPageMode", function (data) {
  59114. return pdfManager.ensureCatalog("pageMode");
  59115. });
  59116. handler.on("GetViewerPreferences", function (data) {
  59117. return pdfManager.ensureCatalog("viewerPreferences");
  59118. });
  59119. handler.on("GetOpenAction", function (data) {
  59120. return pdfManager.ensureCatalog("openAction");
  59121. });
  59122. handler.on("GetAttachments", function (data) {
  59123. return pdfManager.ensureCatalog("attachments");
  59124. });
  59125. handler.on("GetDocJSActions", function (data) {
  59126. return pdfManager.ensureCatalog("jsActions");
  59127. });
  59128. handler.on("GetPageJSActions", function ({
  59129. pageIndex
  59130. }) {
  59131. return pdfManager.getPage(pageIndex).then(function (page) {
  59132. return pdfManager.ensure(page, "jsActions");
  59133. });
  59134. });
  59135. handler.on("GetOutline", function (data) {
  59136. return pdfManager.ensureCatalog("documentOutline");
  59137. });
  59138. handler.on("GetOptionalContentConfig", function (data) {
  59139. return pdfManager.ensureCatalog("optionalContentConfig");
  59140. });
  59141. handler.on("GetPermissions", function (data) {
  59142. return pdfManager.ensureCatalog("permissions");
  59143. });
  59144. handler.on("GetMetadata", function (data) {
  59145. return Promise.all([pdfManager.ensureDoc("documentInfo"), pdfManager.ensureCatalog("metadata")]);
  59146. });
  59147. handler.on("GetMarkInfo", function (data) {
  59148. return pdfManager.ensureCatalog("markInfo");
  59149. });
  59150. handler.on("GetData", function (data) {
  59151. return pdfManager.requestLoadedStream().then(function (stream) {
  59152. return stream.bytes;
  59153. });
  59154. });
  59155. handler.on("GetAnnotations", function ({
  59156. pageIndex,
  59157. intent
  59158. }) {
  59159. return pdfManager.getPage(pageIndex).then(function (page) {
  59160. const task = new WorkerTask(`GetAnnotations: page ${pageIndex}`);
  59161. startWorkerTask(task);
  59162. return page.getAnnotationsData(handler, task, intent).then(data => {
  59163. finishWorkerTask(task);
  59164. return data;
  59165. }, reason => {
  59166. finishWorkerTask(task);
  59167. throw reason;
  59168. });
  59169. });
  59170. });
  59171. handler.on("GetFieldObjects", function (data) {
  59172. return pdfManager.ensureDoc("fieldObjects").then(fieldObjects => fieldObjects?.allFields || null);
  59173. });
  59174. handler.on("HasJSActions", function (data) {
  59175. return pdfManager.ensureDoc("hasJSActions");
  59176. });
  59177. handler.on("GetCalculationOrderIds", function (data) {
  59178. return pdfManager.ensureDoc("calculationOrderIds");
  59179. });
  59180. handler.on("SaveDocument", async function ({
  59181. isPureXfa,
  59182. numPages,
  59183. annotationStorage,
  59184. filename
  59185. }) {
  59186. const globalPromises = [pdfManager.requestLoadedStream(), pdfManager.ensureCatalog("acroForm"), pdfManager.ensureCatalog("acroFormRef"), pdfManager.ensureDoc("startXRef"), pdfManager.ensureDoc("xref"), pdfManager.ensureDoc("linearization"), pdfManager.ensureCatalog("structTreeRoot")];
  59187. const promises = [];
  59188. const newAnnotationsByPage = !isPureXfa ? getNewAnnotationsMap(annotationStorage) : null;
  59189. const [stream, acroForm, acroFormRef, startXRef, xref, linearization, _structTreeRoot] = await Promise.all(globalPromises);
  59190. const catalogRef = xref.trailer.getRaw("Root") || null;
  59191. let structTreeRoot;
  59192. if (newAnnotationsByPage) {
  59193. if (!_structTreeRoot) {
  59194. if (await StructTreeRoot.canCreateStructureTree({
  59195. catalogRef,
  59196. pdfManager,
  59197. newAnnotationsByPage
  59198. })) {
  59199. structTreeRoot = null;
  59200. }
  59201. } else if (await _structTreeRoot.canUpdateStructTree({
  59202. pdfManager,
  59203. xref,
  59204. newAnnotationsByPage
  59205. })) {
  59206. structTreeRoot = _structTreeRoot;
  59207. }
  59208. const imagePromises = AnnotationFactory.generateImages(annotationStorage.values(), xref, pdfManager.evaluatorOptions.isOffscreenCanvasSupported);
  59209. const newAnnotationPromises = structTreeRoot === undefined ? promises : [];
  59210. for (const [pageIndex, annotations] of newAnnotationsByPage) {
  59211. newAnnotationPromises.push(pdfManager.getPage(pageIndex).then(page => {
  59212. const task = new WorkerTask(`Save (editor): page ${pageIndex}`);
  59213. return page.saveNewAnnotations(handler, task, annotations, imagePromises).finally(function () {
  59214. finishWorkerTask(task);
  59215. });
  59216. }));
  59217. }
  59218. if (structTreeRoot === null) {
  59219. promises.push(Promise.all(newAnnotationPromises).then(async newRefs => {
  59220. await StructTreeRoot.createStructureTree({
  59221. newAnnotationsByPage,
  59222. xref,
  59223. catalogRef,
  59224. pdfManager,
  59225. newRefs
  59226. });
  59227. return newRefs;
  59228. }));
  59229. } else if (structTreeRoot) {
  59230. promises.push(Promise.all(newAnnotationPromises).then(async newRefs => {
  59231. await structTreeRoot.updateStructureTree({
  59232. newAnnotationsByPage,
  59233. pdfManager,
  59234. newRefs
  59235. });
  59236. return newRefs;
  59237. }));
  59238. }
  59239. }
  59240. if (isPureXfa) {
  59241. promises.push(pdfManager.serializeXfaData(annotationStorage));
  59242. } else {
  59243. for (let pageIndex = 0; pageIndex < numPages; pageIndex++) {
  59244. promises.push(pdfManager.getPage(pageIndex).then(function (page) {
  59245. const task = new WorkerTask(`Save: page ${pageIndex}`);
  59246. return page.save(handler, task, annotationStorage).finally(function () {
  59247. finishWorkerTask(task);
  59248. });
  59249. }));
  59250. }
  59251. }
  59252. const refs = await Promise.all(promises);
  59253. let newRefs = [];
  59254. let xfaData = null;
  59255. if (isPureXfa) {
  59256. xfaData = refs[0];
  59257. if (!xfaData) {
  59258. return stream.bytes;
  59259. }
  59260. } else {
  59261. newRefs = refs.flat(2);
  59262. if (newRefs.length === 0) {
  59263. return stream.bytes;
  59264. }
  59265. }
  59266. const needAppearances = acroFormRef && acroForm instanceof Dict && newRefs.some(ref => ref.needAppearances);
  59267. const xfa = acroForm instanceof Dict && acroForm.get("XFA") || null;
  59268. let xfaDatasetsRef = null;
  59269. let hasXfaDatasetsEntry = false;
  59270. if (Array.isArray(xfa)) {
  59271. for (let i = 0, ii = xfa.length; i < ii; i += 2) {
  59272. if (xfa[i] === "datasets") {
  59273. xfaDatasetsRef = xfa[i + 1];
  59274. hasXfaDatasetsEntry = true;
  59275. }
  59276. }
  59277. if (xfaDatasetsRef === null) {
  59278. xfaDatasetsRef = xref.getNewTemporaryRef();
  59279. }
  59280. } else if (xfa) {
  59281. warn("Unsupported XFA type.");
  59282. }
  59283. let newXrefInfo = Object.create(null);
  59284. if (xref.trailer) {
  59285. const infoObj = Object.create(null);
  59286. const xrefInfo = xref.trailer.get("Info") || null;
  59287. if (xrefInfo instanceof Dict) {
  59288. xrefInfo.forEach((key, value) => {
  59289. if (typeof value === "string") {
  59290. infoObj[key] = stringToPDFString(value);
  59291. }
  59292. });
  59293. }
  59294. newXrefInfo = {
  59295. rootRef: catalogRef,
  59296. encryptRef: xref.trailer.getRaw("Encrypt") || null,
  59297. newRef: xref.getNewTemporaryRef(),
  59298. infoRef: xref.trailer.getRaw("Info") || null,
  59299. info: infoObj,
  59300. fileIds: xref.trailer.get("ID") || null,
  59301. startXRef: linearization ? startXRef : xref.lastXRefStreamPos ?? startXRef,
  59302. filename
  59303. };
  59304. }
  59305. return incrementalUpdate({
  59306. originalData: stream.bytes,
  59307. xrefInfo: newXrefInfo,
  59308. newRefs,
  59309. xref,
  59310. hasXfa: !!xfa,
  59311. xfaDatasetsRef,
  59312. hasXfaDatasetsEntry,
  59313. needAppearances,
  59314. acroFormRef,
  59315. acroForm,
  59316. xfaData,
  59317. useXrefStream: isDict(xref.topDict, "XRef")
  59318. }).finally(() => {
  59319. xref.resetNewTemporaryRef();
  59320. });
  59321. });
  59322. handler.on("GetOperatorList", function (data, sink) {
  59323. const pageIndex = data.pageIndex;
  59324. pdfManager.getPage(pageIndex).then(function (page) {
  59325. const task = new WorkerTask(`GetOperatorList: page ${pageIndex}`);
  59326. startWorkerTask(task);
  59327. const start = verbosity >= VerbosityLevel.INFOS ? Date.now() : 0;
  59328. page.getOperatorList({
  59329. handler,
  59330. sink,
  59331. task,
  59332. intent: data.intent,
  59333. cacheKey: data.cacheKey,
  59334. annotationStorage: data.annotationStorage,
  59335. modifiedIds: data.modifiedIds
  59336. }).then(function (operatorListInfo) {
  59337. finishWorkerTask(task);
  59338. if (start) {
  59339. info(`page=${pageIndex + 1} - getOperatorList: time=` + `${Date.now() - start}ms, len=${operatorListInfo.length}`);
  59340. }
  59341. sink.close();
  59342. }, function (reason) {
  59343. finishWorkerTask(task);
  59344. if (task.terminated) {
  59345. return;
  59346. }
  59347. sink.error(reason);
  59348. });
  59349. });
  59350. });
  59351. handler.on("GetTextContent", function (data, sink) {
  59352. const {
  59353. pageIndex,
  59354. includeMarkedContent,
  59355. disableNormalization
  59356. } = data;
  59357. pdfManager.getPage(pageIndex).then(function (page) {
  59358. const task = new WorkerTask("GetTextContent: page " + pageIndex);
  59359. startWorkerTask(task);
  59360. const start = verbosity >= VerbosityLevel.INFOS ? Date.now() : 0;
  59361. page.extractTextContent({
  59362. handler,
  59363. task,
  59364. sink,
  59365. includeMarkedContent,
  59366. disableNormalization
  59367. }).then(function () {
  59368. finishWorkerTask(task);
  59369. if (start) {
  59370. info(`page=${pageIndex + 1} - getTextContent: time=` + `${Date.now() - start}ms`);
  59371. }
  59372. sink.close();
  59373. }, function (reason) {
  59374. finishWorkerTask(task);
  59375. if (task.terminated) {
  59376. return;
  59377. }
  59378. sink.error(reason);
  59379. });
  59380. });
  59381. });
  59382. handler.on("GetStructTree", function (data) {
  59383. return pdfManager.getPage(data.pageIndex).then(function (page) {
  59384. return pdfManager.ensure(page, "getStructTree");
  59385. });
  59386. });
  59387. handler.on("FontFallback", function (data) {
  59388. return pdfManager.fontFallback(data.id, handler);
  59389. });
  59390. handler.on("Cleanup", function (data) {
  59391. return pdfManager.cleanup(true);
  59392. });
  59393. handler.on("Terminate", function (data) {
  59394. terminated = true;
  59395. const waitOn = [];
  59396. if (pdfManager) {
  59397. pdfManager.terminate(new AbortException("Worker was terminated."));
  59398. const cleanupPromise = pdfManager.cleanup();
  59399. waitOn.push(cleanupPromise);
  59400. pdfManager = null;
  59401. } else {
  59402. clearGlobalCaches();
  59403. }
  59404. if (cancelXHRs) {
  59405. cancelXHRs(new AbortException("Worker was terminated."));
  59406. }
  59407. for (const task of WorkerTasks) {
  59408. waitOn.push(task.finished);
  59409. task.terminate();
  59410. }
  59411. return Promise.all(waitOn).then(function () {
  59412. handler.destroy();
  59413. handler = null;
  59414. });
  59415. });
  59416. handler.on("Ready", function (data) {
  59417. setupDoc(docParams);
  59418. docParams = null;
  59419. });
  59420. return workerHandlerName;
  59421. }
  59422. static initializeFromPort(port) {
  59423. const handler = new MessageHandler("worker", "main", port);
  59424. WorkerMessageHandler.setup(handler, port);
  59425. handler.send("ready", null);
  59426. }
  59427. }
  59428. function isMessagePort(maybePort) {
  59429. return typeof maybePort.postMessage === "function" && "onmessage" in maybePort;
  59430. }
  59431. if (typeof window === "undefined" && !isNodeJS && typeof self !== "undefined" && isMessagePort(self)) {
  59432. WorkerMessageHandler.initializeFromPort(self);
  59433. }
  59434. ;// ./src/pdf.worker.js
  59435. const pdfjsVersion = "4.7.76";
  59436. const pdfjsBuild = "8b73b828b";
  59437. var __webpack_exports__WorkerMessageHandler = __webpack_exports__.WorkerMessageHandler;
  59438. export { __webpack_exports__WorkerMessageHandler as WorkerMessageHandler };
  59439. //# sourceMappingURL=pdf.worker.mjs.map